feat: expand cross-platform investigation workflows
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import { z } from "zod";
|
||||
|
||||
import { androidApplicationOutputSchemas } from "./toolOutputSchemas.js";
|
||||
import { toolContractMetadata } from "./toolEffects.js";
|
||||
import type { ToolContract } from "./toolContractTypes.js";
|
||||
|
||||
/** Session references for one bounded Android application projection. */
|
||||
export const androidApplicationReferenceInputSchema = z.strictObject({
|
||||
inventory_evidence_ids: z
|
||||
.array(z.string().regex(/^ev_[a-f0-9]{64}$/u))
|
||||
.min(1)
|
||||
.max(100),
|
||||
limits: z
|
||||
.strictObject({
|
||||
max_components: z.number().int().min(1).max(10_000).default(1_000),
|
||||
})
|
||||
.default({ max_components: 1_000 }),
|
||||
});
|
||||
|
||||
const outputSchema =
|
||||
androidApplicationOutputSchemas.project_android_application_graph;
|
||||
if (outputSchema === undefined)
|
||||
throw new Error("Missing Android application graph output schema");
|
||||
|
||||
/** Provider-neutral Android application workflow contract. */
|
||||
export const ANDROID_APPLICATION_TOOL_CONTRACTS = [
|
||||
{
|
||||
name: "project_android_application_graph",
|
||||
...toolContractMetadata("project_android_application_graph"),
|
||||
description:
|
||||
"Project authenticated, bounded APK inventory Evidence into deterministic Android components, runtime-family observations, and explicit managed-to-native bridge hypotheses. Reports exact artifact paths and hashes without executing code or decoding Android binary formats.",
|
||||
kind: "application",
|
||||
inputSchema: androidApplicationReferenceInputSchema,
|
||||
outputSchema,
|
||||
examples: [
|
||||
{
|
||||
title: "Project an APK inventory into Android application components",
|
||||
input: {
|
||||
inventory_evidence_ids: [`ev_${"1".repeat(64)}`],
|
||||
limits: { max_components: 1_000 },
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
] as const satisfies readonly ToolContract[];
|
||||
@@ -0,0 +1,45 @@
|
||||
import { z } from "zod";
|
||||
|
||||
import { appleApplicationOutputSchemas } from "./toolOutputSchemas.js";
|
||||
import { toolContractMetadata } from "./toolEffects.js";
|
||||
import type { ToolContract } from "./toolContractTypes.js";
|
||||
|
||||
/** Session references for one bounded Apple application projection. */
|
||||
export const appleApplicationReferenceInputSchema = z.strictObject({
|
||||
inventory_evidence_ids: z
|
||||
.array(z.string().regex(/^ev_[a-f0-9]{64}$/u))
|
||||
.min(1)
|
||||
.max(100),
|
||||
limits: z
|
||||
.strictObject({
|
||||
max_components: z.number().int().min(1).max(10_000).default(1_000),
|
||||
})
|
||||
.default({ max_components: 1_000 }),
|
||||
});
|
||||
|
||||
const outputSchema =
|
||||
appleApplicationOutputSchemas.project_apple_application_graph;
|
||||
if (outputSchema === undefined)
|
||||
throw new Error("Missing Apple application graph output schema");
|
||||
|
||||
/** Provider-neutral Apple application workflow contract. */
|
||||
export const APPLE_APPLICATION_TOOL_CONTRACTS = [
|
||||
{
|
||||
name: "project_apple_application_graph",
|
||||
...toolContractMetadata("project_apple_application_graph"),
|
||||
description:
|
||||
"Project authenticated, bounded IPA inventory Evidence into deterministic Apple application components, runtime-family observations, and explicit cross-language bridge hypotheses. Reports exact artifact paths and hashes without executing code or parsing provisioning-profile signing material.",
|
||||
kind: "application",
|
||||
inputSchema: appleApplicationReferenceInputSchema,
|
||||
outputSchema,
|
||||
examples: [
|
||||
{
|
||||
title: "Project an IPA inventory into Apple application components",
|
||||
input: {
|
||||
inventory_evidence_ids: [`ev_${"1".repeat(64)}`],
|
||||
limits: { max_components: 1_000 },
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
] as const satisfies readonly ToolContract[];
|
||||
@@ -58,6 +58,7 @@ export const artifactInventoryInputSchema = z
|
||||
/** Exact caller boundary for approved artifact extraction. */
|
||||
export const artifactExtractionInputSchema = z.object({
|
||||
approved: z.literal(true),
|
||||
native_mount_approved: z.boolean().default(false),
|
||||
output_root: z.string().min(1).max(4_096),
|
||||
occurrence_ids: z
|
||||
.array(z.string().regex(/^occ_[a-f0-9]{64}$/u))
|
||||
@@ -73,6 +74,7 @@ const examples: Readonly<Record<string, Readonly<Record<string, unknown>>>> = {
|
||||
inventory_artifact: {},
|
||||
extract_artifact: {
|
||||
approved: true,
|
||||
native_mount_approved: false,
|
||||
output_root: "/tmp/rea-extracted",
|
||||
occurrence_ids: [`occ_${"0".repeat(64)}`],
|
||||
},
|
||||
@@ -111,7 +113,7 @@ export const ARTIFACT_TOOL_CONTRACTS = [
|
||||
),
|
||||
artifact(
|
||||
"extract_artifact",
|
||||
"Extract selected graph artifacts beneath an explicit output root. Requires approval, rejects traversal and symlink escapes, never overwrites, enforces bomb limits, and verifies cleanup.",
|
||||
"Extract selected graph artifacts beneath an explicit output root. Requires extraction approval; DMG inputs additionally require per-call native-mount approval and operator enablement. Rejects traversal and symlink escapes, never overwrites, enforces bomb limits, and verifies cleanup.",
|
||||
artifactExtractionInputSchema,
|
||||
),
|
||||
] as const satisfies readonly ToolContract[];
|
||||
|
||||
@@ -44,7 +44,7 @@ export const FUNCTION_COMPARISON_EVIDENCE = createEvidence(
|
||||
const PROCESS_PROVIDER = {
|
||||
id: "rea-process",
|
||||
name: "REA deterministic process harness",
|
||||
version: "3",
|
||||
version: "4",
|
||||
} as const;
|
||||
const capture = processCaptureSchema.parse(EMPTY_PROCESS_CAPTURE_EXAMPLE);
|
||||
const captureEvidence = (scenario: string) =>
|
||||
@@ -68,7 +68,7 @@ export const PROCESS_COMPARISON_EVIDENCE = createEvidence(
|
||||
undefined,
|
||||
PROCESS_PROVIDER,
|
||||
{
|
||||
predicateType: "rea.process-comparison/v3",
|
||||
predicateType: "rea.process-comparison/v4",
|
||||
operation: "compare_process_captures",
|
||||
parameters: {
|
||||
left_evidence_id: PROCESS_CAPTURE_REFERENCE.evidence_id,
|
||||
|
||||
@@ -18,7 +18,7 @@ export const EMPTY_PROCESS_CAPTURE_EXAMPLE = {
|
||||
schema_version: 4,
|
||||
manifest: {
|
||||
rea_version: "1.1.0",
|
||||
provider_version: "3",
|
||||
provider_version: "4",
|
||||
platform: "fixture",
|
||||
architecture: "fixture",
|
||||
pty_backend: "node-pty",
|
||||
@@ -46,6 +46,7 @@ export const EMPTY_PROCESS_CAPTURE_EXAMPLE = {
|
||||
cleanup_outcome: "not_required",
|
||||
},
|
||||
process_samples: [],
|
||||
process_events: [],
|
||||
filesystem_checkpoints: [
|
||||
{ name: "before", at_ms: 0, files: [], effects: [], truncated: false },
|
||||
{
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
import { z } from "zod";
|
||||
|
||||
import { runtimeIdentificationOutputSchemas } from "./toolOutputSchemas.js";
|
||||
import { toolContractMetadata } from "./toolEffects.js";
|
||||
import type { ToolContract } from "./toolContractTypes.js";
|
||||
|
||||
/** Session Evidence references accepted by runtime identification. */
|
||||
export const runtimeIdentificationReferenceInputSchema = z.strictObject({
|
||||
inventory_evidence_ids: z
|
||||
.array(z.string().regex(/^ev_[a-f0-9]{64}$/u))
|
||||
.min(1)
|
||||
.max(100),
|
||||
limits: z
|
||||
.strictObject({
|
||||
max_observations: z.number().int().min(1).max(10_000).default(1_000),
|
||||
})
|
||||
.default({ max_observations: 1_000 }),
|
||||
});
|
||||
|
||||
const outputSchema = runtimeIdentificationOutputSchemas.identify_runtime;
|
||||
if (outputSchema === undefined)
|
||||
throw new Error("Missing runtime-identification output schema");
|
||||
|
||||
/** Provider-neutral runtime-identification tool contract. */
|
||||
export const RUNTIME_IDENTIFICATION_TOOL_CONTRACTS = [
|
||||
{
|
||||
name: "identify_runtime",
|
||||
...toolContractMetadata("identify_runtime"),
|
||||
description:
|
||||
"Identify runtime families from authenticated artifact inventory Evidence and report whether semantic tooling is available, missing, or requires provider selection. This classifies exact formats and paths without executing or decoding target bytecode.",
|
||||
inputSchema: runtimeIdentificationReferenceInputSchema,
|
||||
outputSchema,
|
||||
kind: "application",
|
||||
examples: [
|
||||
{
|
||||
title: "Identify runtimes in an artifact inventory",
|
||||
input: {
|
||||
inventory_evidence_ids: [`ev_${"1".repeat(64)}`],
|
||||
limits: { max_observations: 1_000 },
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
] as const satisfies readonly ToolContract[];
|
||||
@@ -25,6 +25,9 @@ import { NATIVE_TOOL_CONTRACTS } from "./nativeToolContracts.js";
|
||||
import { ARTIFACT_TOOL_CONTRACTS } from "./artifactToolContracts.js";
|
||||
import { MANAGED_TOOL_CONTRACTS } from "./managedToolContracts.js";
|
||||
import { MANAGED_WORKFLOW_TOOL_CONTRACTS } from "./managedWorkflowToolContracts.js";
|
||||
import { APPLE_APPLICATION_TOOL_CONTRACTS } from "./appleApplicationToolContracts.js";
|
||||
import { ANDROID_APPLICATION_TOOL_CONTRACTS } from "./androidApplicationToolContracts.js";
|
||||
import { RUNTIME_IDENTIFICATION_TOOL_CONTRACTS } from "./runtimeIdentificationToolContracts.js";
|
||||
import { BROWSER_TOOL_CONTRACTS } from "./browserToolContracts.js";
|
||||
import { ELECTRON_TOOL_CONTRACTS } from "./electronToolContracts.js";
|
||||
import { APPLICATION_TOOL_CONTRACTS } from "./applicationToolContracts.js";
|
||||
@@ -514,6 +517,9 @@ export const TOOL_CONTRACTS = [
|
||||
...ARTIFACT_TOOL_CONTRACTS,
|
||||
...MANAGED_TOOL_CONTRACTS,
|
||||
...MANAGED_WORKFLOW_TOOL_CONTRACTS,
|
||||
...APPLE_APPLICATION_TOOL_CONTRACTS,
|
||||
...ANDROID_APPLICATION_TOOL_CONTRACTS,
|
||||
...RUNTIME_IDENTIFICATION_TOOL_CONTRACTS,
|
||||
...BROWSER_TOOL_CONTRACTS,
|
||||
...ELECTRON_TOOL_CONTRACTS,
|
||||
...APPLICATION_TOOL_CONTRACTS,
|
||||
|
||||
@@ -102,6 +102,9 @@ export const TOOL_EFFECTS: Readonly<Record<string, ToolEffects>> = {
|
||||
import_managed_reconstruction: sessionEvidence,
|
||||
plan_managed_runtime_correlation: sessionEvidence,
|
||||
project_managed_application_graph: sessionEvidence,
|
||||
project_apple_application_graph: sessionEvidence,
|
||||
project_android_application_graph: sessionEvidence,
|
||||
identify_runtime: sessionEvidence,
|
||||
list_browser_targets: browserEvidence,
|
||||
inspect_web_page: browserEvidence,
|
||||
analyze_web_bundle: browserEvidence,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { z } from "zod";
|
||||
import { runtimeIdentificationResultSchema } from "../domain/runtimeIdentification.js";
|
||||
import {
|
||||
processCaptureComparisonSchema,
|
||||
processCaptureSchema,
|
||||
@@ -28,6 +29,8 @@ import {
|
||||
managedMemberInspectionSchema,
|
||||
managedNativeBoundaryInspectionSchema,
|
||||
} from "../domain/managedArtifact.js";
|
||||
import { appleApplicationProjectionResultSchema } from "../domain/appleApplication.js";
|
||||
import { androidApplicationProjectionResultSchema } from "../domain/androidApplication.js";
|
||||
import { managedMemberComparisonResultSchema } from "../domain/managedMemberComparison.js";
|
||||
import { managedNativeVerificationResultSchema } from "../domain/managedNativeVerification.js";
|
||||
import { managedReconstructionImportResultSchema } from "../domain/managedReconstruction.js";
|
||||
@@ -582,6 +585,31 @@ export const managedWorkflowOutputSchemas: Readonly<
|
||||
),
|
||||
};
|
||||
|
||||
/** Exact Evidence v2 schema for Apple application workflows. */
|
||||
export const appleApplicationOutputSchemas: Readonly<
|
||||
Record<string, z.ZodObject>
|
||||
> = {
|
||||
project_apple_application_graph: resultOf(
|
||||
appleApplicationProjectionResultSchema,
|
||||
),
|
||||
};
|
||||
|
||||
/** Exact Evidence v2 schema for Android application workflows. */
|
||||
export const androidApplicationOutputSchemas: Readonly<
|
||||
Record<string, z.ZodObject>
|
||||
> = {
|
||||
project_android_application_graph: resultOf(
|
||||
androidApplicationProjectionResultSchema,
|
||||
),
|
||||
};
|
||||
|
||||
/** Exact Evidence v2 schema for provider-neutral runtime identification. */
|
||||
export const runtimeIdentificationOutputSchemas: Readonly<
|
||||
Record<string, z.ZodObject>
|
||||
> = {
|
||||
identify_runtime: resultOf(runtimeIdentificationResultSchema),
|
||||
};
|
||||
|
||||
/** Exact structured-content schemas for target lifecycle operations. */
|
||||
export const sessionOutputSchemas: Readonly<Record<string, z.ZodObject>> = {
|
||||
open_binary: lifecycleResultOf(
|
||||
|
||||
Reference in New Issue
Block a user