rea-agents 2.5.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -12
- package/bridge/ghidra/ReaGhidraBridge.java +477 -4
- package/bridge/hopper_bridge.py +54 -4
- package/dist/application/AnalysisContextQueries.js +142 -0
- package/dist/application/AnalysisSnapshotCache.js +4 -2
- package/dist/application/ApplicationWorkflowEvidenceResolver.js +19 -11
- package/dist/application/ArtifactInventory/policy.js +17 -0
- package/dist/application/ArtifactInventory/reader.js +1 -4
- package/dist/application/ArtifactInventory/scanCanonical.js +0 -3
- package/dist/application/ArtifactInventory/scanReader.js +7 -7
- package/dist/application/ArtifactInventory/types.js +1 -5
- package/dist/application/BinarySession.js +19 -20
- package/dist/application/BinarySessionComposition.js +21 -0
- package/dist/application/BinarySessionRecords.js +106 -10
- package/dist/application/BinarySessionStatus.js +11 -5
- package/dist/application/BrowserEvidence.js +3 -5
- package/dist/application/CapabilityClientRequirements.js +26 -0
- package/dist/application/CapabilityInventory.js +140 -55
- package/dist/application/ClientRegistrationStatus.js +4 -1
- package/dist/application/CrossVersionInventory.js +7 -6
- package/dist/application/DirectAnalysis.js +6 -2
- package/dist/application/ElectronActiveEvidence.js +55 -0
- package/dist/application/ElectronActiveObservationPort.js +1 -0
- package/dist/application/ElectronActiveObservationService.js +81 -0
- package/dist/application/EnhancedTools.js +49 -17
- package/dist/application/EvidenceBundleCommands.js +5 -1
- package/dist/application/EvidenceLedger.js +53 -17
- package/dist/application/JavaScriptArtifactAnalysis.js +13 -4
- package/dist/application/JavaScriptReplayPermission.js +1 -1
- package/dist/application/JavaScriptReplayService.js +23 -15
- package/dist/application/LazyAnalysisProvider.js +77 -0
- package/dist/application/LoopbackReplay.js +1 -1
- package/dist/application/ManagedRuntimeCorrelationService.js +9 -5
- package/dist/application/NativeApiInspection.js +80 -0
- package/dist/application/NodeRuntimeCharacterizationService.js +8 -9
- package/dist/application/ProcessCaptureLifecycle.js +5 -0
- package/dist/application/ProcessCli.js +2 -1
- package/dist/application/ProcessHarness.js +8 -3
- package/dist/application/ProcessNormalization.js +2 -1
- package/dist/application/ProjectPermissionStore.js +1 -0
- package/dist/application/ReferenceSourceImport.js +2 -2
- package/dist/application/SessionProviderRouter.js +6 -6
- package/dist/application/SetupClientConfiguration.js +10 -3
- package/dist/application/WindowsCapabilities.js +5 -4
- package/dist/application/runtime.js +26 -9
- package/dist/artifacts/ArtifactProvider.js +8 -10
- package/dist/artifacts/SafeOutputTree.js +7 -8
- package/dist/browser/CdpCaptureStorageFingerprints.js +10 -7
- package/dist/browser/CdpElectronInspection.js +3 -1
- package/dist/browser/JavaScriptRuntimeScope.js +5 -0
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +8 -2
- package/dist/browser/PlaywrightElectronActiveActions.js +324 -0
- package/dist/browser/PlaywrightElectronActiveProvider.js +294 -0
- package/dist/browser/PlaywrightScenarioBrowser.js +4 -4
- package/dist/browser/PlaywrightScenarioSession.js +4 -4
- package/dist/browser/SensitiveTextCapture.js +1 -1
- package/dist/browser/V8InspectorCaptureProjection.js +1 -0
- package/dist/browser/V8InspectorProvider.js +3 -3
- package/dist/catalogIdentity.js +15 -9
- package/dist/cli/artifactCommands.js +5 -3
- package/dist/cli/coreAnalysisCommands.js +41 -0
- package/dist/cli/managedCommands.js +1 -1
- package/dist/cliApplicationCommands.js +2 -2
- package/dist/cliBrowserAdvancedCommands.js +11 -5
- package/dist/cliBrowserCommands.js +14 -7
- package/dist/cliCommandNames.js +2 -0
- package/dist/cliElectronCommands.js +46 -4
- package/dist/cliJavaScriptRuntimeCommands.js +14 -6
- package/dist/cliObservationOptions.js +4 -0
- package/dist/cliPolicyCommands.js +1 -0
- package/dist/config/browserScenario.js +77 -0
- package/dist/config/electronAutomation.js +35 -0
- package/dist/config/environment.js +6 -0
- package/dist/config/javascriptReplay.js +41 -0
- package/dist/config/managedRuntime.js +25 -0
- package/dist/config/parseConfig.js +56 -200
- package/dist/config/parsers.js +10 -1
- package/dist/config/passiveObservation.js +157 -0
- package/dist/config/processCapture.js +47 -0
- package/dist/contracts/applicationToolContracts.js +2 -5
- package/dist/contracts/applicationWorkflowInputContracts.js +86 -96
- package/dist/contracts/artifactToolContracts.js +35 -37
- package/dist/contracts/browserToolContracts.js +2 -2
- package/dist/contracts/electronToolContracts.js +30 -1
- package/dist/contracts/enhancedInputs.js +21 -27
- package/dist/contracts/functionWorkflowToolContracts.js +29 -0
- package/dist/contracts/managedToolContracts.js +4 -9
- package/dist/contracts/managedWorkflowExamples.js +12 -9
- package/dist/contracts/managedWorkflowToolContracts.js +30 -27
- package/dist/contracts/nativeToolContracts.js +2 -3
- package/dist/contracts/promptContracts.js +14 -15
- package/dist/contracts/sessionToolSchemas.js +61 -0
- package/dist/contracts/toolContractExamples.js +4 -0
- package/dist/contracts/toolContractHelpers.js +23 -0
- package/dist/contracts/toolContracts.js +12 -67
- package/dist/contracts/toolEffects.js +19 -0
- package/dist/contracts/toolOutputSchemaGroups.js +66 -11
- package/dist/contracts/toolOutputSchemaPrimitives.js +76 -26
- package/dist/contracts/toolSchemaMetadata.js +128 -0
- package/dist/doctorRuntime.js +1 -1
- package/dist/domain/analysisErrorPresentation.js +8 -2
- package/dist/domain/analysisErrorProjection.js +1 -0
- package/dist/domain/androidApplication.js +2 -0
- package/dist/domain/appleApplication.js +2 -0
- package/dist/domain/binaryTarget.js +7 -5
- package/dist/domain/binaryTargetTypes.js +1 -0
- package/dist/domain/browserCaptureComparison.js +21 -69
- package/dist/domain/browserObservation.js +22 -9
- package/dist/domain/bytecodeProvider.js +177 -0
- package/dist/domain/callPath.js +3 -2
- package/dist/domain/conformancePackage.js +169 -0
- package/dist/domain/conformanceReplay.js +104 -0
- package/dist/domain/conformanceTrustGate.js +328 -0
- package/dist/domain/customProtocolCapture.js +137 -0
- package/dist/domain/electronActiveObservation.js +277 -0
- package/dist/domain/electronObservation.js +15 -11
- package/dist/domain/electronStaticAnalysisValues.js +4 -1
- package/dist/domain/eventProcessTree.js +217 -0
- package/dist/domain/evidenceBundle.js +47 -0
- package/dist/domain/functionComparisonNormalization.js +15 -8
- package/dist/domain/functionDossierEvidence.js +9 -4
- package/dist/domain/hopperStartupFailure.js +1 -1
- package/dist/domain/hopperValues.js +68 -68
- package/dist/domain/inputIssueProjection.js +11 -2
- package/dist/domain/investigationWorkspace.js +16 -15
- package/dist/domain/javascriptExportShapeComparisonSchemas.js +2 -2
- package/dist/domain/javascriptReplay.js +79 -63
- package/dist/domain/javascriptRuntimeObservation.js +1 -0
- package/dist/domain/javascriptRuntimeReconciliationActive.js +89 -0
- package/dist/domain/javascriptRuntimeReconciliationGraph.js +11 -10
- package/dist/domain/javascriptRuntimeReconciliationMatching.js +57 -49
- package/dist/domain/javascriptRuntimeReconciliationParsing.js +5 -1
- package/dist/domain/javascriptRuntimeReconciliationResult.js +21 -14
- package/dist/domain/javascriptRuntimeReconciliationSchemas.js +1 -1
- package/dist/domain/javascriptSemanticAnalysis.js +8 -12
- package/dist/domain/javascriptSourceParser.js +15 -0
- package/dist/domain/javascriptStaticAnalysis.js +8 -12
- package/dist/domain/knownPageCoverage.js +15 -7
- package/dist/domain/mobileApplicationInvestigation.js +159 -0
- package/dist/domain/nativeApiBoundary.js +138 -0
- package/dist/domain/nodeRuntimeCharacterization.js +14 -13
- package/dist/domain/objcSwiftMetadata.js +150 -0
- package/dist/domain/packageAnalysis.js +123 -0
- package/dist/domain/peInspection.js +196 -0
- package/dist/domain/processCaptureReactiveValidation.js +8 -3
- package/dist/domain/processCaptureValidation.js +7 -3
- package/dist/domain/processComparison.js +12 -7
- package/dist/domain/processObservation.js +5 -6
- package/dist/domain/processReactiveMatching.js +14 -7
- package/dist/domain/processReactiveTransition.js +9 -3
- package/dist/domain/processScenario.js +6 -3
- package/dist/domain/processTraceComparison.js +3 -2
- package/dist/domain/protocolCapture.js +245 -0
- package/dist/domain/reconstructionReadinessSchemas.js +30 -2
- package/dist/domain/referenceSourceImportParsing.js +2 -2
- package/dist/domain/replayMachineRuntime.js +5 -3
- package/dist/domain/sourceToBundleComparison.js +2 -2
- package/dist/domain/sourceToBundleComparisonSchemas.js +8 -8
- package/dist/domain/sourceToBundleSignals.js +7 -1
- package/dist/domain/staticRuntimeCorrelation.js +7 -5
- package/dist/domain/webBundleAnalysis.js +14 -14
- package/dist/domain/webCaptureDiff.js +15 -12
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +2 -3
- package/dist/dotnet/ManagedStaticProvider.js +34 -5
- package/dist/generatedMcpToolCatalog.js +37 -0
- package/dist/generatedPackageMetadata.js +4 -4
- package/dist/ghidra/GhidraClient.js +1 -1
- package/dist/ghidra/GhidraClientStartup.js +1 -1
- package/dist/ghidra/GhidraDefaults.js +1 -1
- package/dist/ghidra/GhidraFunctionValues.js +44 -16
- package/dist/ghidra/GhidraInventoryValues.js +57 -47
- package/dist/ghidra/GhidraProvider.js +18 -10
- package/dist/ghidra/GhidraProviderCapabilities.js +45 -39
- package/dist/ghidra/GhidraSocketConnection.js +1 -1
- package/dist/ghidra/protocol.js +19 -42
- package/dist/hopper/BridgeLauncher.js +3 -1
- package/dist/hopper/HopperAnalysisProfile.js +2 -4
- package/dist/hopper/HopperCleanup.js +5 -6
- package/dist/hopper/HopperClient.js +27 -3
- package/dist/hopper/HopperProvider.js +42 -44
- package/dist/hopper/HopperRequestQueue.js +32 -4
- package/dist/hopper/HopperResponseStream.js +2 -2
- package/dist/hopper/LinuxPrivateDisplayProbe.js +16 -10
- package/dist/hopper/protocol.js +63 -21
- package/dist/main/reload.js +1 -6
- package/dist/main/state.js +0 -14
- package/dist/main/transport.js +31 -41
- package/dist/main.js +17 -13
- package/dist/mcpDoctor.js +4 -26
- package/dist/mcpStartupPolicy.js +14 -0
- package/dist/process/PrivateRuntimeRoot.js +17 -0
- package/dist/process/ProcessOwnership.js +64 -128
- package/dist/process/ProcessOwnershipIdentity.js +13 -0
- package/dist/process/ProcessOwnershipObservation.js +88 -0
- package/dist/process/ProcessOwnershipProcessTree.js +22 -0
- package/dist/process/ProviderDeadline.js +8 -12
- package/dist/process/WindowsAuthority.js +32 -0
- package/dist/reference/ReferenceSourceReader.js +3 -3
- package/dist/reference/ReferenceSourceReaderEntries.js +2 -2
- package/dist/replay/JavaScriptReplayWorker.js +95 -11
- package/dist/replay/JavaScriptReplayWorkerTypes.js +1 -0
- package/dist/replay/LinuxJavaScriptReplayRunner.js +10 -15
- package/dist/replay/ReplayOutcome.js +26 -15
- package/dist/replay/ReplayWorkerProtocol.js +34 -29
- package/dist/server/createServer.js +101 -144
- package/dist/server/mcpClientMetadata.js +32 -0
- package/dist/server/registerApplicationTools/characterization.js +6 -13
- package/dist/server/registerApplicationTools/compareExportShapes.js +2 -7
- package/dist/server/registerApplicationTools/compareSourceToBundle.js +2 -7
- package/dist/server/registerApplicationTools/compareVersions.js +3 -8
- package/dist/server/registerApplicationTools/controlledReplay.js +6 -11
- package/dist/server/registerApplicationTools/coverage.js +13 -19
- package/dist/server/registerApplicationTools/obligationLedger.js +1 -6
- package/dist/server/registerApplicationTools/readiness.js +1 -6
- package/dist/server/registerApplicationTools/traceFeature.js +3 -8
- package/dist/server/registerApplicationTools/traceSemantics.js +1 -6
- package/dist/server/registerArtifactComparisonTool.js +12 -16
- package/dist/server/registerBrowserScenarioTool.js +1 -6
- package/dist/server/registerBrowserTools.js +37 -79
- package/dist/server/registerBundleComparisonTool.js +10 -14
- package/dist/server/registerCloseLifecycleTool.js +6 -14
- package/dist/server/registerElectronTools.js +30 -47
- package/dist/server/registerEnhancedTools.js +124 -122
- package/dist/server/registerEvidenceResources.js +50 -101
- package/dist/server/registerEvidenceTools.js +5 -9
- package/dist/server/registerFunctionComparisonTool.js +11 -15
- package/dist/server/registerInvestigationTools.js +42 -59
- package/dist/server/registerJavaScriptApplicationGraphResource.js +0 -4
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +13 -27
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +4 -9
- package/dist/server/registerManagedWorkflowTools/contract.js +2 -3
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +3 -8
- package/dist/server/registerManagedWorkflowTools/planManagedRuntimeCorrelation.js +3 -8
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +8 -13
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +4 -9
- package/dist/server/registerOfficialTools.js +8 -9
- package/dist/server/registerProcessComparisonTool.js +19 -24
- package/dist/server/registerReconstructionObligationLedgerResource.js +0 -7
- package/dist/server/registerReconstructionReadinessResource.js +0 -7
- package/dist/server/registerReplayMachineTool.js +4 -10
- package/dist/server/registerSessionRecordTools.js +146 -47
- package/dist/server/registerSessionStatusTool.js +14 -29
- package/dist/server/registerSessionTools.js +45 -41
- package/dist/server/sessionAvailabilityPolicy.js +2 -1
- package/dist/server/sessionToolPolicies.js +1 -5
- package/dist/server/toolRegistrationOptions.js +4 -177
- package/dist/server/toolResult.js +14 -18
- package/package.json +35 -16
- package/scripts/electron-active-hook-boundaries.cjs +394 -0
- package/scripts/electron-active-hook.cjs +501 -0
- package/skills/reverse-engineer-anything/SKILL.md +10 -3
- package/dist/server/DynamicToolAvailability.js +0 -70
- package/dist/server/toolInputValidation.js +0 -77
|
@@ -7,6 +7,7 @@ import { projectManagedApplicationGraphInputSchema } from "../domain/managedAppl
|
|
|
7
7
|
import { managedWorkflowOutputSchemas } from "./toolOutputSchemas.js";
|
|
8
8
|
import { MANAGED_MEMBER_COMPARISON_EXAMPLE, MANAGED_NATIVE_VERIFICATION_EXAMPLE, MANAGED_APPLICATION_GRAPH_EXAMPLE, MANAGED_RECONSTRUCTION_IMPORT_EXAMPLE, MANAGED_RUNTIME_CORRELATION_EXAMPLE, } from "./managedWorkflowExamples.js";
|
|
9
9
|
import { toolContractMetadata } from "./toolEffects.js";
|
|
10
|
+
import { requireOutputSchema } from "./toolOutputSchemaPrimitives.js";
|
|
10
11
|
const evidenceIdSchema = z.string().regex(/^ev_[a-f0-9]{64}$/u);
|
|
11
12
|
const managedEvidenceIdSchema = evidenceIdSchema.describe("Session-owned inspect_managed_members Evidence ID");
|
|
12
13
|
const managedArtifactEvidenceIdSchema = evidenceIdSchema.describe("Session-owned inspect_managed_artifact Evidence ID");
|
|
@@ -66,46 +67,48 @@ export const managedNativeVerificationReferenceInputSchema = z
|
|
|
66
67
|
ids.add(evidenceId);
|
|
67
68
|
}
|
|
68
69
|
});
|
|
69
|
-
|
|
70
|
-
export const managedApplicationGraphReferenceInputSchema = z
|
|
71
|
-
.strictObject({
|
|
72
|
-
managed_artifact_evidence_id: managedArtifactEvidenceIdSchema.optional(),
|
|
73
|
-
managed_members_evidence_id: managedEvidenceIdSchema.optional(),
|
|
74
|
-
managed_native_boundaries_evidence_id: managedBoundaryEvidenceIdSchema.optional(),
|
|
70
|
+
const managedApplicationGraphReferenceFacts = {
|
|
75
71
|
limits: projectManagedApplicationGraphInputSchema.shape.limits,
|
|
76
|
-
}
|
|
72
|
+
};
|
|
73
|
+
/** MCP references requiring at least one managed Evidence source. */
|
|
74
|
+
export const managedApplicationGraphReferenceInputSchema = z
|
|
75
|
+
.union([
|
|
76
|
+
z.strictObject({
|
|
77
|
+
...managedApplicationGraphReferenceFacts,
|
|
78
|
+
managed_artifact_evidence_id: managedArtifactEvidenceIdSchema,
|
|
79
|
+
managed_members_evidence_id: managedEvidenceIdSchema.optional(),
|
|
80
|
+
managed_native_boundaries_evidence_id: managedBoundaryEvidenceIdSchema.optional(),
|
|
81
|
+
}),
|
|
82
|
+
z.strictObject({
|
|
83
|
+
...managedApplicationGraphReferenceFacts,
|
|
84
|
+
managed_artifact_evidence_id: managedArtifactEvidenceIdSchema.optional(),
|
|
85
|
+
managed_members_evidence_id: managedEvidenceIdSchema,
|
|
86
|
+
managed_native_boundaries_evidence_id: managedBoundaryEvidenceIdSchema.optional(),
|
|
87
|
+
}),
|
|
88
|
+
z.strictObject({
|
|
89
|
+
...managedApplicationGraphReferenceFacts,
|
|
90
|
+
managed_artifact_evidence_id: managedArtifactEvidenceIdSchema.optional(),
|
|
91
|
+
managed_members_evidence_id: managedEvidenceIdSchema.optional(),
|
|
92
|
+
managed_native_boundaries_evidence_id: managedBoundaryEvidenceIdSchema,
|
|
93
|
+
}),
|
|
94
|
+
])
|
|
77
95
|
.superRefine((input, context) => {
|
|
78
96
|
const ids = [
|
|
79
97
|
input.managed_artifact_evidence_id,
|
|
80
98
|
input.managed_members_evidence_id,
|
|
81
99
|
input.managed_native_boundaries_evidence_id,
|
|
82
100
|
].filter((id) => id !== undefined);
|
|
83
|
-
if (ids.length === 0)
|
|
84
|
-
context.addIssue({
|
|
85
|
-
code: "custom",
|
|
86
|
-
message: "At least one managed Evidence ID is required",
|
|
87
|
-
});
|
|
88
101
|
if (new Set(ids).size !== ids.length)
|
|
89
102
|
context.addIssue({
|
|
90
103
|
code: "custom",
|
|
91
104
|
message: "Managed application graph Evidence IDs must be unique",
|
|
92
105
|
});
|
|
93
106
|
});
|
|
94
|
-
const comparisonOutputSchema = managedWorkflowOutputSchemas
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
throw new Error("Missing managed workflow output schema for plan_managed_runtime_correlation");
|
|
100
|
-
const reconstructionOutputSchema = managedWorkflowOutputSchemas.import_managed_reconstruction;
|
|
101
|
-
if (reconstructionOutputSchema === undefined)
|
|
102
|
-
throw new Error("Missing managed workflow output schema for import_managed_reconstruction");
|
|
103
|
-
const nativeVerificationOutputSchema = managedWorkflowOutputSchemas.verify_managed_native_boundaries;
|
|
104
|
-
if (nativeVerificationOutputSchema === undefined)
|
|
105
|
-
throw new Error("Missing managed workflow output schema for verify_managed_native_boundaries");
|
|
106
|
-
const managedApplicationGraphOutputSchema = managedWorkflowOutputSchemas.project_managed_application_graph;
|
|
107
|
-
if (managedApplicationGraphOutputSchema === undefined)
|
|
108
|
-
throw new Error("Missing managed workflow output schema for project_managed_application_graph");
|
|
107
|
+
const comparisonOutputSchema = requireOutputSchema(managedWorkflowOutputSchemas, "compare_managed_members");
|
|
108
|
+
const runtimeOutputSchema = requireOutputSchema(managedWorkflowOutputSchemas, "plan_managed_runtime_correlation");
|
|
109
|
+
const reconstructionOutputSchema = requireOutputSchema(managedWorkflowOutputSchemas, "import_managed_reconstruction");
|
|
110
|
+
const nativeVerificationOutputSchema = requireOutputSchema(managedWorkflowOutputSchemas, "verify_managed_native_boundaries");
|
|
111
|
+
const managedApplicationGraphOutputSchema = requireOutputSchema(managedWorkflowOutputSchemas, "project_managed_application_graph");
|
|
109
112
|
/** Provider-neutral managed-code workflow contracts. */
|
|
110
113
|
export const MANAGED_WORKFLOW_TOOL_CONTRACTS = [
|
|
111
114
|
{
|
|
@@ -2,6 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { nativeOutputSchemas } from "./toolOutputSchemas.js";
|
|
3
3
|
import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
4
4
|
import { toolContractMetadata } from "./toolEffects.js";
|
|
5
|
+
import { requireOutputSchema } from "./toolOutputSchemaPrimitives.js";
|
|
5
6
|
const examples = {
|
|
6
7
|
inspect_macho: {},
|
|
7
8
|
inspect_signature: {},
|
|
@@ -10,9 +11,7 @@ const examples = {
|
|
|
10
11
|
demangle_swift: { symbols: ["$s4Test3fooyyF"] },
|
|
11
12
|
};
|
|
12
13
|
const native = (name, description, inputSchema) => {
|
|
13
|
-
const outputSchema = nativeOutputSchemas
|
|
14
|
-
if (outputSchema === undefined)
|
|
15
|
-
throw new Error(`Missing native output schema for ${name}`);
|
|
14
|
+
const outputSchema = requireOutputSchema(nativeOutputSchemas, name);
|
|
16
15
|
return {
|
|
17
16
|
name,
|
|
18
17
|
...toolContractMetadata(name),
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { TOOL_CONTRACTS } from "./toolContracts.js";
|
|
2
1
|
const optional = (description, completion) => ({
|
|
3
2
|
description,
|
|
4
3
|
required: false,
|
|
@@ -81,8 +80,8 @@ export const PROMPT_CONTRACTS = [
|
|
|
81
80
|
instruction: "Build function dossiers and corroborate references and call relationships. Keep indirect or truncated paths unknown.",
|
|
82
81
|
},
|
|
83
82
|
{
|
|
84
|
-
tools: ["
|
|
85
|
-
instruction: "
|
|
83
|
+
tools: ["snapshot_evidence_bundle", "record_unknown"],
|
|
84
|
+
instruction: "Snapshot the canonical bundle, copy its opaque URI unchanged, and read that resource before citing retained Evidence IDs. Record residual unknowns only after separate explicit approval for registry mutation.",
|
|
86
85
|
},
|
|
87
86
|
],
|
|
88
87
|
},
|
|
@@ -100,8 +99,8 @@ export const PROMPT_CONTRACTS = [
|
|
|
100
99
|
},
|
|
101
100
|
steps: [
|
|
102
101
|
{
|
|
103
|
-
tools: ["inventory_artifact"],
|
|
104
|
-
instruction: "
|
|
102
|
+
tools: ["open_binary", "inventory_artifact"],
|
|
103
|
+
instruction: "For each supplied target path, open that target before inventory because inventory_artifact uses the active target and accepts no path. Follow nodes, occurrences, and edges to completion and retain every Evidence page for each manifest.",
|
|
105
104
|
},
|
|
106
105
|
{
|
|
107
106
|
tools: [
|
|
@@ -112,8 +111,8 @@ export const PROMPT_CONTRACTS = [
|
|
|
112
111
|
instruction: "For JavaScript/Electron versions, reconstruct each approved artifact independently, optionally reconcile separately retained passive runtime Evidence, then compare authenticated graphs with unique-only identity tiers. Keep ambiguous and incomplete matches unknown.",
|
|
113
112
|
},
|
|
114
113
|
{
|
|
115
|
-
tools: ["
|
|
116
|
-
instruction: "
|
|
114
|
+
tools: ["snapshot_evidence_bundle", "compare_artifacts"],
|
|
115
|
+
instruction: "Snapshot and read the canonical bundle through its exact resource URI, resolve any supplied manifest IDs to retained inventory Evidence, validate graph commitments, then compare the complete left and right Evidence page sets.",
|
|
117
116
|
},
|
|
118
117
|
{
|
|
119
118
|
tools: ["open_binary", "analyze_function", "compare_functions"],
|
|
@@ -141,8 +140,8 @@ export const PROMPT_CONTRACTS = [
|
|
|
141
140
|
},
|
|
142
141
|
steps: [
|
|
143
142
|
{
|
|
144
|
-
tools: ["
|
|
145
|
-
instruction: "
|
|
143
|
+
tools: ["snapshot_evidence_bundle"],
|
|
144
|
+
instruction: "Snapshot the current canonical bundle, copy its opaque URI unchanged, read the resource, and verify that every selected comparison Evidence ID is present and compatible with the intended claim.",
|
|
146
145
|
},
|
|
147
146
|
{
|
|
148
147
|
tools: [
|
|
@@ -194,11 +193,11 @@ export const PROMPT_CONTRACTS = [
|
|
|
194
193
|
},
|
|
195
194
|
{
|
|
196
195
|
tools: [
|
|
197
|
-
"
|
|
196
|
+
"snapshot_evidence_bundle",
|
|
198
197
|
"capture_process_scenario",
|
|
199
198
|
"correlate_static_and_runtime",
|
|
200
199
|
],
|
|
201
|
-
instruction: "Reuse a retained capture when supplied. Otherwise capture only after operator policy and per-call approval, then correlate through explicit hypotheses rather than timing or name coincidence.",
|
|
200
|
+
instruction: "Snapshot and read retained Evidence through the exact resource URI. Reuse a retained capture when supplied. Otherwise capture only after operator policy and per-call approval, then correlate through explicit hypotheses rather than timing or name coincidence.",
|
|
202
201
|
},
|
|
203
202
|
{
|
|
204
203
|
tools: ["record_unknown"],
|
|
@@ -222,8 +221,8 @@ export const PROMPT_CONTRACTS = [
|
|
|
222
221
|
instruction: "List current heads first and select only active, session-owned unknown IDs. Preserve their exact revision and requirements.",
|
|
223
222
|
},
|
|
224
223
|
{
|
|
225
|
-
tools: ["
|
|
226
|
-
instruction: "
|
|
224
|
+
tools: ["snapshot_evidence_bundle", "verify_unknown_resolution"],
|
|
225
|
+
instruction: "Snapshot and read the canonical bundle through its exact resource URI, inspect cited supporting, contradicting, and mutation Evidence, then validate any resolved head against bundle integrity and authority requirements.",
|
|
227
226
|
},
|
|
228
227
|
{
|
|
229
228
|
tools: ["update_unknown"],
|
|
@@ -252,8 +251,8 @@ export const PROMPT_CONTRACTS = [
|
|
|
252
251
|
instruction: "Inspect capture capability, declared effects, and limits before proposing execution. An unavailable capability is not permission to widen policy.",
|
|
253
252
|
},
|
|
254
253
|
{
|
|
255
|
-
tools: ["
|
|
256
|
-
instruction: "
|
|
254
|
+
tools: ["snapshot_evidence_bundle"],
|
|
255
|
+
instruction: "Snapshot and read the canonical bundle through its exact resource URI, then review any prior capture for unanswered dimensions, truncation, scenario commitments, and descendant settlement before designing a repeat.",
|
|
257
256
|
},
|
|
258
257
|
{
|
|
259
258
|
tools: ["capture_process_scenario"],
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { artifactComparisonInputSchema } from "../domain/artifactComparison.js";
|
|
3
|
+
import { bundleComparisonInputSchema } from "../domain/bundleComparison.js";
|
|
4
|
+
import { callPathInputSchema } from "../domain/callPath.js";
|
|
5
|
+
import { changedBehaviorInputSchema } from "../domain/changedBehavior.js";
|
|
6
|
+
import { functionComparisonInputSchema } from "../domain/functionComparison.js";
|
|
7
|
+
import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
8
|
+
import { processScenarioSchema } from "../domain/processCapture.js";
|
|
9
|
+
import { processTraceSpecificationSchema } from "../domain/processTraceComparison.js";
|
|
10
|
+
import { recordUnknownInputSchema } from "../domain/residualUnknown.js";
|
|
11
|
+
import { reconstructionVerificationInputSchema } from "../domain/reconstructionVerification.js";
|
|
12
|
+
import { replayMachineRunInputSchema } from "../domain/replayMachineRun.js";
|
|
13
|
+
import { staticRuntimeCorrelationInputSchema } from "../domain/staticRuntimeCorrelation.js";
|
|
14
|
+
import { updateUnknownInputSchema } from "../domain/residualUnknown.js";
|
|
15
|
+
import { openBinaryInputSchema, closeBinaryInputSchema, } from "./sessionLifecycleInputs.js";
|
|
16
|
+
import { binarySessionInputSchema } from "./sessionStatusContract.js";
|
|
17
|
+
/** Retain the current canonical Evidence bundle as a session resource. */
|
|
18
|
+
export const snapshotEvidenceBundleInputSchema = z.strictObject({});
|
|
19
|
+
/** Release one session-retained immutable Evidence bundle. */
|
|
20
|
+
export const releaseEvidenceBundleInputSchema = z.strictObject({
|
|
21
|
+
bundle_digest: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
22
|
+
});
|
|
23
|
+
/** Optional document selection for volatile navigation context. */
|
|
24
|
+
export const navigationContextInputSchema = z.strictObject({
|
|
25
|
+
document: z.string().min(1).optional(),
|
|
26
|
+
});
|
|
27
|
+
/** Explicit reproducible address context query. */
|
|
28
|
+
export const addressContextInputSchema = z.strictObject({
|
|
29
|
+
address: z.string().min(1),
|
|
30
|
+
document: z.string().min(1).optional(),
|
|
31
|
+
});
|
|
32
|
+
/** Session-owned Evidence bundle import options. */
|
|
33
|
+
export const importEvidenceBundleInputSchema = z.strictObject({
|
|
34
|
+
path: z.string().min(1),
|
|
35
|
+
});
|
|
36
|
+
/** Evidence references for deterministic process comparison. */
|
|
37
|
+
export const processComparisonInputSchema = z.strictObject({
|
|
38
|
+
left_evidence_id: z.string().regex(/^ev_[a-f0-9]{64}$/u),
|
|
39
|
+
right_evidence_id: z.string().regex(/^ev_[a-f0-9]{64}$/u),
|
|
40
|
+
trace_spec: processTraceSpecificationSchema.optional(),
|
|
41
|
+
max_capture_age_ms: z.number().int().nonnegative().optional(),
|
|
42
|
+
unknown_registry_approved: z
|
|
43
|
+
.literal(true)
|
|
44
|
+
.optional()
|
|
45
|
+
.describe("Explicit approval to record capture disagreement durably"),
|
|
46
|
+
});
|
|
47
|
+
/** Residual-unknown list filters. */
|
|
48
|
+
export const listUnknownsInputSchema = z.strictObject({
|
|
49
|
+
status: z
|
|
50
|
+
.enum(["open", "investigating", "blocked", "contradicted", "resolved"])
|
|
51
|
+
.optional(),
|
|
52
|
+
severity: z.enum(["low", "medium", "high", "critical"]).optional(),
|
|
53
|
+
domain: z.string().trim().min(1).max(100).optional(),
|
|
54
|
+
offset: z.number().int().min(0).default(0),
|
|
55
|
+
limit: z.number().int().min(1).max(500).default(100),
|
|
56
|
+
});
|
|
57
|
+
/** Exact residual-unknown identity to revalidate. */
|
|
58
|
+
export const verifyUnknownResolutionInputSchema = z.strictObject({
|
|
59
|
+
unknown_id: z.string().regex(/^unk_[a-f0-9]{64}$/u),
|
|
60
|
+
});
|
|
61
|
+
export { artifactComparisonInputSchema, binarySessionInputSchema, bundleComparisonInputSchema, callPathInputSchema, changedBehaviorInputSchema, closeBinaryInputSchema, functionComparisonInputSchema, jsonValueSchema, openBinaryInputSchema, processScenarioSchema, reconstructionVerificationInputSchema, recordUnknownInputSchema, replayMachineRunInputSchema, staticRuntimeCorrelationInputSchema, updateUnknownInputSchema, };
|
|
@@ -31,11 +31,15 @@ export const TOOL_EXAMPLE_OVERRIDES = {
|
|
|
31
31
|
get_call_graph: { address: "0x1000" },
|
|
32
32
|
find_xrefs_to_name: { name: "malloc" },
|
|
33
33
|
analyze_function: { procedure: "main" },
|
|
34
|
+
inspect_native_api: { procedure: "main" },
|
|
34
35
|
trace_feature: { query: "license" },
|
|
35
36
|
find_code_for_string: { query: "authorization failed" },
|
|
36
37
|
trace_call_path: { start: "0x1000", goal: "0x1100" },
|
|
37
38
|
open_binary: { path: "/tmp/fixture" },
|
|
39
|
+
export_evidence_bundle: { path: "/tmp/evidence.json" },
|
|
40
|
+
inspect_address_context: { address: "0x1000" },
|
|
38
41
|
import_evidence_bundle: { path: "evidence.json" },
|
|
42
|
+
release_evidence_bundle: { bundle_digest: "a".repeat(64) },
|
|
39
43
|
capture_process_scenario: {
|
|
40
44
|
approved: true,
|
|
41
45
|
executable: "/usr/bin/true",
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
3
|
+
import { TOOL_EXAMPLE_OVERRIDES } from "./toolContractExamples.js";
|
|
4
|
+
export const document = z.string().optional().describe("The document name");
|
|
5
|
+
export const address = z
|
|
6
|
+
.string()
|
|
7
|
+
.describe("A provider-normalized address; default memory uses 0x-prefixed hexadecimal");
|
|
8
|
+
export const optionalAddress = address.optional();
|
|
9
|
+
export const procedure = z.string().describe("The procedure name or address");
|
|
10
|
+
export const pagination = {
|
|
11
|
+
offset: z.number().int().min(0).default(0),
|
|
12
|
+
limit: z.number().int().min(1).max(500).default(100),
|
|
13
|
+
};
|
|
14
|
+
const exampleInputSchema = z.record(z.string(), jsonValueSchema);
|
|
15
|
+
export const examplesFor = (name, inputSchema) => {
|
|
16
|
+
const parsed = inputSchema.parse(TOOL_EXAMPLE_OVERRIDES[name] ?? {});
|
|
17
|
+
return [
|
|
18
|
+
{
|
|
19
|
+
title: `Example ${name.replaceAll("_", " ")} request`,
|
|
20
|
+
input: exampleInputSchema.parse(parsed),
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
};
|
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
3
|
-
import { processScenarioSchema } from "../domain/processCapture.js";
|
|
4
|
-
import { recordUnknownInputSchema, updateUnknownInputSchema, } from "../domain/residualUnknown.js";
|
|
5
|
-
import { artifactComparisonInputSchema } from "../domain/artifactComparison.js";
|
|
6
|
-
import { functionComparisonInputSchema } from "../domain/functionComparison.js";
|
|
7
|
-
import { bundleComparisonInputSchema } from "../domain/bundleComparison.js";
|
|
8
|
-
import { changedBehaviorInputSchema } from "../domain/changedBehavior.js";
|
|
9
|
-
import { callPathInputSchema } from "../domain/callPath.js";
|
|
10
|
-
import { staticRuntimeCorrelationInputSchema } from "../domain/staticRuntimeCorrelation.js";
|
|
11
|
-
import { reconstructionVerificationInputSchema } from "../domain/reconstructionVerification.js";
|
|
12
|
-
import { replayMachineRunInputSchema } from "../domain/replayMachineRun.js";
|
|
13
|
-
import { processTraceSpecificationSchema } from "../domain/processTraceComparison.js";
|
|
14
2
|
import { enhancedInputSchemas } from "./enhancedInputs.js";
|
|
15
3
|
import { enhancedOutputSchemas, officialOutputSchemas, requireOutputSchema, sessionOutputSchemas, } from "./toolOutputSchemas.js";
|
|
16
|
-
import { TOOL_EXAMPLE_OVERRIDES } from "./toolContractExamples.js";
|
|
17
4
|
import { NATIVE_TOOL_CONTRACTS } from "./nativeToolContracts.js";
|
|
18
5
|
import { ARTIFACT_TOOL_CONTRACTS } from "./artifactToolContracts.js";
|
|
19
6
|
import { MANAGED_TOOL_CONTRACTS } from "./managedToolContracts.js";
|
|
@@ -22,33 +9,14 @@ import { BROWSER_PROVIDER_TOOL_CONTRACTS } from "./browserProviderToolContracts.
|
|
|
22
9
|
import { ELECTRON_TOOL_CONTRACTS } from "./electronToolContracts.js";
|
|
23
10
|
import { JAVASCRIPT_RUNTIME_OBSERVATION_TOOL_CONTRACTS } from "./javascriptRuntimeObservationToolContracts.js";
|
|
24
11
|
import { APPLICATION_TOOL_CONTRACTS } from "./applicationToolContracts.js";
|
|
25
|
-
import { closeBinaryInputSchema, openBinaryInputSchema, } from "./
|
|
12
|
+
import { addressContextInputSchema, artifactComparisonInputSchema, binarySessionInputSchema, bundleComparisonInputSchema, callPathInputSchema, changedBehaviorInputSchema, closeBinaryInputSchema, functionComparisonInputSchema, importEvidenceBundleInputSchema, listUnknownsInputSchema, navigationContextInputSchema, openBinaryInputSchema, processComparisonInputSchema, processScenarioSchema, reconstructionVerificationInputSchema, recordUnknownInputSchema, releaseEvidenceBundleInputSchema, replayMachineRunInputSchema, snapshotEvidenceBundleInputSchema, staticRuntimeCorrelationInputSchema, updateUnknownInputSchema, verifyUnknownResolutionInputSchema, } from "./sessionToolSchemas.js";
|
|
13
|
+
import { address, document, examplesFor, optionalAddress, pagination, procedure, } from "./toolContractHelpers.js";
|
|
26
14
|
import { toolContractMetadata } from "./toolEffects.js";
|
|
27
|
-
import { binarySessionInputSchema } from "./sessionStatusContract.js";
|
|
28
15
|
import { functionInstructionInputSchema } from "./functionInstructionContract.js";
|
|
29
16
|
import { HOPPER_MEMORY_TOOL_DEFINITIONS } from "./hopperMemoryContracts.js";
|
|
30
17
|
import { analysisSearchInput } from "./analysisSearchContract.js";
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const address = z
|
|
34
|
-
.string()
|
|
35
|
-
.describe("A provider-normalized address; default memory uses 0x-prefixed hexadecimal");
|
|
36
|
-
const optionalAddress = address.optional();
|
|
37
|
-
const procedure = z.string().describe("The procedure name or address");
|
|
38
|
-
const pagination = {
|
|
39
|
-
offset: z.number().int().min(0).default(0),
|
|
40
|
-
limit: z.number().int().min(1).max(500).default(100),
|
|
41
|
-
};
|
|
42
|
-
const exampleInputSchema = z.record(z.string(), jsonValueSchema);
|
|
43
|
-
const examplesFor = (name, inputSchema) => {
|
|
44
|
-
const parsed = inputSchema.parse(TOOL_EXAMPLE_OVERRIDES[name] ?? {});
|
|
45
|
-
return [
|
|
46
|
-
{
|
|
47
|
-
title: `Example ${name.replaceAll("_", " ")} request`,
|
|
48
|
-
input: exampleInputSchema.parse(parsed),
|
|
49
|
-
},
|
|
50
|
-
];
|
|
51
|
-
};
|
|
18
|
+
import { FUNCTION_WORKFLOW_TOOL_CONTRACTS } from "./functionWorkflowToolContracts.js";
|
|
19
|
+
export { addressContextInputSchema, binarySessionInputSchema, importEvidenceBundleInputSchema, listUnknownsInputSchema, navigationContextInputSchema, processComparisonInputSchema, releaseEvidenceBundleInputSchema, snapshotEvidenceBundleInputSchema, verifyUnknownResolutionInputSchema, } from "./sessionToolSchemas.js";
|
|
52
20
|
const official = (name, description, inputSchema) => {
|
|
53
21
|
const trackedInputSchema = inputSchema.extend({
|
|
54
22
|
unknown_registry_approved: z
|
|
@@ -139,49 +107,22 @@ export const ENHANCED_TOOL_CONTRACTS = [
|
|
|
139
107
|
enhanced("analyze_swift_types", "Categorize exhaustively paged procedure names into Swift classes, structs, enums, protocols, extensions, and other symbols. Scans at most 5,000 names and returns at most 50 entries per category.", enhancedInputSchemas.analyze_swift_types),
|
|
140
108
|
enhanced("find_xrefs_to_name", "Resolve an exact name through the bound provider's exhaustively paged name inventory and return a resolved or unresolved result. Unresolved names use the stable name_not_found reason; this compact xref workflow returns address-only projections.", enhancedInputSchemas.find_xrefs_to_name),
|
|
141
109
|
enhanced("binary_overview", "Use immediately after opening a target to summarize document, exhaustive procedure/string counts, and a bounded segment sample. detail controls segment fields and limit controls only the returned segment sample.", enhancedInputSchemas.binary_overview),
|
|
142
|
-
|
|
110
|
+
...FUNCTION_WORKFLOW_TOOL_CONTRACTS,
|
|
143
111
|
enhanced("trace_feature", "Trace a bounded literal feature query through matching strings and procedures, xrefs, and truthful containing-procedure resolution. Returns the operation budget, truncation, and residual unknowns; unknown_registry_approved: true records them durably without inferring reference kinds.", enhancedInputSchemas.trace_feature),
|
|
144
112
|
enhanced("find_code_for_string", "Resolve one literal string query to bounded analyzed string entries, xrefs, and truthful containing-procedure candidates. Returns an Evidence ID, exact operation budget, truncation, and residual unknowns; it never infers reference kinds or runtime reachability.", enhancedInputSchemas.find_code_for_string),
|
|
145
113
|
enhanced("trace_call_path", "Trace a deterministic bounded caller or callee path from one exact procedure address, optionally stopping at a goal. Returns visited nodes, direct-call edges, one shortest traversal path, failures, frontier, consumed limits, an Evidence ID, and explicit residual unknowns without claiming unresolved indirect calls are absent.", enhancedInputSchemas.trace_call_path),
|
|
146
114
|
];
|
|
147
115
|
/** Session-owned Evidence bundle export options. */
|
|
148
116
|
export const exportEvidenceBundleInputSchema = z.strictObject({
|
|
149
|
-
path: z.string().min(1).optional(),
|
|
150
|
-
overwrite: z.boolean().default(false),
|
|
151
|
-
});
|
|
152
|
-
/** Session-owned Evidence bundle import options. */
|
|
153
|
-
export const importEvidenceBundleInputSchema = z.strictObject({
|
|
154
117
|
path: z.string().min(1),
|
|
155
|
-
|
|
156
|
-
/** Evidence references for deterministic process comparison. */
|
|
157
|
-
export const processComparisonInputSchema = z.strictObject({
|
|
158
|
-
left_evidence_id: z.string().regex(/^ev_[a-f0-9]{64}$/u),
|
|
159
|
-
right_evidence_id: z.string().regex(/^ev_[a-f0-9]{64}$/u),
|
|
160
|
-
trace_spec: processTraceSpecificationSchema.optional(),
|
|
161
|
-
max_capture_age_ms: z.number().int().nonnegative().optional(),
|
|
162
|
-
unknown_registry_approved: z
|
|
163
|
-
.literal(true)
|
|
164
|
-
.optional()
|
|
165
|
-
.describe("Explicit approval to record capture disagreement durably"),
|
|
166
|
-
});
|
|
167
|
-
/** Residual-unknown list filters. */
|
|
168
|
-
export const listUnknownsInputSchema = z.strictObject({
|
|
169
|
-
status: z
|
|
170
|
-
.enum(["open", "investigating", "blocked", "contradicted", "resolved"])
|
|
171
|
-
.optional(),
|
|
172
|
-
severity: z.enum(["low", "medium", "high", "critical"]).optional(),
|
|
173
|
-
domain: z.string().trim().min(1).max(100).optional(),
|
|
174
|
-
});
|
|
175
|
-
/** Exact residual-unknown identity to revalidate. */
|
|
176
|
-
export const verifyUnknownResolutionInputSchema = z.strictObject({
|
|
177
|
-
unknown_id: z.string().regex(/^unk_[a-f0-9]{64}$/u),
|
|
118
|
+
overwrite: z.boolean().default(false),
|
|
178
119
|
});
|
|
179
120
|
/** Target lifecycle tools available only on the long-lived MCP adapter. */
|
|
180
121
|
export const SESSION_TOOL_CONTRACTS = [
|
|
181
122
|
session("open_binary", "Open a local executable, application bundle, archive, JavaScript, source map, plist, or analysis database after validation. provider_id selects one deep provider or deterministic auto selection; the binding remains stable until close or an explicit switch, with no failure fallback. An optional snapshot v2 is imported atomically and must match the binary identity, concrete provider, and canonical analysis profile exactly.", openBinaryInputSchema),
|
|
182
123
|
session("close_binary", "Optionally write a provider-neutral analysis snapshot atomically, then close the active target and every provider resource started for it. Snapshot files require an operator-approved root and explicit overwrite; a failed save leaves the session open so cached analysis is not lost.", closeBinaryInputSchema),
|
|
183
124
|
session("binary_session", "Report compact target, provider, and alignment state without starting analysis. The default summary is the routing check agents should use; detail=capabilities returns one family-filtered availability page, while detail=full is reserved for complete provider diagnostics.", binarySessionInputSchema),
|
|
184
|
-
session("export_evidence_bundle", "
|
|
125
|
+
session("export_evidence_bundle", "Atomically write the session's deterministic Evidence v2 bundle beneath an operator-approved root. Existing files require overwrite: true; records and manifests use canonical byte-stable ordering. For an in-session read, use snapshot_evidence_bundle and read its exact resource URI instead.", exportEvidenceBundleInputSchema),
|
|
185
126
|
session("import_evidence_bundle", "Read a bounded local JSON bundle beneath an operator-approved root, validate every Evidence v2 ID and canonical manifest, then atomically merge it. Imported content is data only and is never executed.", importEvidenceBundleInputSchema),
|
|
186
127
|
session("capture_process_scenario", "Run one bounded process under a PTY using operator-approved executable and working roots. Produces Process Capture v4; legacy v3 captures cannot be upgraded and must be recaptured with this tool. Requires approved: true; unknown_registry_approved: true separately records capture residuals. Captures raw and xterm-rendered terminal frames, scripted interactions, lifecycle filesystem checkpoints, process ownership, declarative command shims, and loopback replay. Disabled unless operator policy enables it; not a security sandbox.", processScenarioSchema),
|
|
187
128
|
session("compare_process_captures", "Compare two compatible Process Capture v4 observations across terminal, interaction, lifecycle, process, filesystem, command-shim, HTTP, and WebSocket evidence. Optional trace_spec validates exact events against an explicit partial order or finite trace language; concurrency is never inferred from timestamps or broad sorting. Missing, journal-free, or truncated observations are never treated as equivalent.", processComparisonInputSchema),
|
|
@@ -192,11 +133,15 @@ export const SESSION_TOOL_CONTRACTS = [
|
|
|
192
133
|
session("build_call_path", "Build bounded shortest-first direct-callee paths from explicit analyze_function Evidence groups using exact canonical addresses. Missing dossiers, incomplete callee pages, provider mixing, and depth frontiers remain unknown; every node and edge cites source Evidence.", callPathInputSchema),
|
|
193
134
|
session("correlate_static_and_runtime", "Evaluate explicit caller-declared hypotheses between exact static comparison findings and runtime comparison dimensions. Similar names or paths are never auto-matched, consistent cochange never proves causality, and unknown or truncated inputs remain unresolved.", staticRuntimeCorrelationInputSchema),
|
|
194
135
|
session("verify_reconstruction", "Verify a finite typed behavioral and structural specification against a canonical Evidence bundle. Pass means every declared claim has complete comparable authority—not global source equivalence; changed claims fail and missing, limited, or unresolved evidence stays unknown.", reconstructionVerificationInputSchema),
|
|
195
|
-
session("list_unknowns", "List current residual-unknown heads in deterministic ID order, with optional exact status, severity, and domain filters. This is read-only; unresolved, contradicted, and non-truth dispositions remain distinct.", listUnknownsInputSchema),
|
|
136
|
+
session("list_unknowns", "List current residual-unknown heads in deterministic ID order, with optional exact status, severity, and domain filters. Pages default to 100 items; while has_more is true, pass next_offset as offset and continue until false. This is read-only; unresolved, contradicted, and non-truth dispositions remain distinct.", listUnknownsInputSchema),
|
|
196
137
|
session("record_unknown", "Create one deterministic residual unknown and immutable mutation evidence. Requires approved: true, validates all evidence and relationship references, and rejects duplicate stable identity.", recordUnknownInputSchema),
|
|
197
138
|
session("update_unknown", "Append one immutable full-state revision and mutation evidence. Requires approved: true and exact expected_revision; stale concurrent writers fail instead of overwriting newer analysis.", updateUnknownInputSchema),
|
|
198
139
|
session("verify_unknown_resolution", "Revalidate the current residual-unknown head against live bundled evidence, exact authority/confidence/environment requirements, and revision integrity. Withdrawn and out-of-scope dispositions are not truth claims.", verifyUnknownResolutionInputSchema),
|
|
199
140
|
session("run_replay_machine", "Evaluate ordered HTTP and WebSocket events directly against one validated finite replay machine without opening sockets or launching a target. Returns every decision, a capture-value-free transition journal, one redacted action table entry per used transition, captured aliases, final state, and exact configured and consumed limits.", replayMachineRunInputSchema),
|
|
141
|
+
session("snapshot_evidence_bundle", "Retain the current canonical Evidence v2 bundle as an immutable session resource. Returns a compact digest summary and exact opaque URI; copy that URI unchanged and call MCP resources/read (Codex: read_mcp_resource) for the full bundle. Repeating an unchanged snapshot is idempotent.", snapshotEvidenceBundleInputSchema),
|
|
142
|
+
session("release_evidence_bundle", "Release one immutable session-retained Evidence v2 bundle by exact digest. This is the recovery operation when bounded bundle retention is exhausted; releasing an unknown digest is idempotent and reports released: false.", releaseEvidenceBundleInputSchema),
|
|
143
|
+
session("get_navigation_context", "Compose the selected document, current address, and containing/current procedure into one provider-neutral result. The result reflects sequential provider observations, not an atomic cursor snapshot; a cursor outside any procedure returns procedure: null. Scalar navigation getters remain available for evaluation and compatibility.", navigationContextInputSchema),
|
|
144
|
+
session("inspect_address_context", "Inspect one explicit reproducible address for its analyzed name, containing procedure, regular and inline comments, and matching bookmarks. Each unsupported facet returns a typed unavailable outcome; xrefs, assembly, and pseudocode remain separate bounded follow-ups.", addressContextInputSchema),
|
|
200
145
|
];
|
|
201
146
|
/** Complete ordered public inventory used by registration and verification. */
|
|
202
147
|
export const TOOL_CONTRACTS = [
|
|
@@ -67,6 +67,7 @@ export const TOOL_EFFECTS = {
|
|
|
67
67
|
find_xrefs_to_name: evidence,
|
|
68
68
|
binary_overview: evidence,
|
|
69
69
|
analyze_function: evidence,
|
|
70
|
+
inspect_native_api: effects({ mutatesSession: true, idempotent: false }),
|
|
70
71
|
trace_feature: effects({ mutatesSession: true, idempotent: false }),
|
|
71
72
|
find_code_for_string: effects({ mutatesSession: true, idempotent: false }),
|
|
72
73
|
trace_call_path: effects({ mutatesSession: true, idempotent: false }),
|
|
@@ -106,6 +107,16 @@ export const TOOL_EFFECTS = {
|
|
|
106
107
|
}),
|
|
107
108
|
list_electron_targets: browserEvidence,
|
|
108
109
|
inspect_electron_page: browserEvidence,
|
|
110
|
+
capture_electron_scenario: effects({
|
|
111
|
+
mutatesTarget: true,
|
|
112
|
+
mutatesSession: true,
|
|
113
|
+
writesFilesystem: true,
|
|
114
|
+
launchesProcess: true,
|
|
115
|
+
accessesNetwork: true,
|
|
116
|
+
changesUiState: true,
|
|
117
|
+
mayDiscardData: true,
|
|
118
|
+
idempotent: false,
|
|
119
|
+
}),
|
|
109
120
|
list_javascript_runtime_targets: browserEvidence,
|
|
110
121
|
observe_javascript_runtime: browserEvidence,
|
|
111
122
|
analyze_javascript_application: evidence,
|
|
@@ -149,11 +160,19 @@ export const TOOL_EFFECTS = {
|
|
|
149
160
|
writesFilesystem: true,
|
|
150
161
|
mayDiscardData: true,
|
|
151
162
|
}),
|
|
163
|
+
snapshot_evidence_bundle: effects({ mutatesSession: true }),
|
|
164
|
+
release_evidence_bundle: effects({
|
|
165
|
+
mutatesSession: true,
|
|
166
|
+
mayDiscardData: true,
|
|
167
|
+
}),
|
|
168
|
+
get_navigation_context: effects({ mutatesSession: true }),
|
|
169
|
+
inspect_address_context: effects({ mutatesSession: true }),
|
|
152
170
|
import_evidence_bundle: effects({ mutatesSession: true }),
|
|
153
171
|
capture_process_scenario: effects({
|
|
154
172
|
mutatesSession: true,
|
|
155
173
|
writesFilesystem: true,
|
|
156
174
|
launchesProcess: true,
|
|
175
|
+
accessesNetwork: true,
|
|
157
176
|
idempotent: false,
|
|
158
177
|
}),
|
|
159
178
|
compare_process_captures: sessionEvidence,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
2
3
|
import { processCaptureComparisonSchema, processCaptureSchema, } from "../domain/processCapture.js";
|
|
3
|
-
import { evidenceBundleSchema } from "../domain/evidenceBundle.js";
|
|
4
4
|
import { residualUnknownSchema } from "../domain/residualUnknown.js";
|
|
5
5
|
import { functionInstructionWindowSchema, referenceKindSchema, } from "../domain/hopperValues.js";
|
|
6
|
+
import { nativeApiInspectionResultSchema } from "../domain/nativeApiBoundary.js";
|
|
6
7
|
import { demangleSwiftSchema, inspectMachoSchema, inspectPlistSchema, inspectSignatureSchema, listArchitecturesSchema, } from "../domain/nativeInspection.js";
|
|
7
8
|
import { artifactExtractionResultSchema, artifactInventoryResultSchema, } from "../domain/artifactGraph.js";
|
|
8
9
|
import { artifactInspectionResultSchema } from "../domain/artifactInspection.js";
|
|
@@ -21,7 +22,23 @@ import { staticRuntimeCorrelationResultSchema } from "../domain/staticRuntimeCor
|
|
|
21
22
|
import { reconstructionVerificationResultSchema } from "../domain/reconstructionVerification.js";
|
|
22
23
|
import { replayMachineRunOutputSchema } from "../domain/replayMachineRun.js";
|
|
23
24
|
import { analysisErrorProjectionSchema } from "./errorSchemas.js";
|
|
24
|
-
import { addressList,
|
|
25
|
+
import { addressList, addressedEntry, analysisActivity, bounded, containingProcedureResolution, clientFeatureAvailabilitySchema, functionDossierOutput, graphNode, lifecycleResultOf, nullableText, pageOutput, procedureIdentity, procedureInfoOutput, evidenceResultOf as resultOf, searchPageOutput, segmentOutput, sessionProvider, providerIdentity, toolAvailability, symbolDiscoveryOutput, targetFormatSchema, targetKindSchema, } from "./toolOutputSchemaPrimitives.js";
|
|
26
|
+
const contextFacetSchema = z.discriminatedUnion("state", [
|
|
27
|
+
z.object({ state: z.literal("available"), value: jsonValueSchema }),
|
|
28
|
+
z.object({
|
|
29
|
+
state: z.literal("unavailable"),
|
|
30
|
+
reason: z.string(),
|
|
31
|
+
remediation: z.string(),
|
|
32
|
+
}),
|
|
33
|
+
]);
|
|
34
|
+
const bookmarkFacetSchema = z.discriminatedUnion("state", [
|
|
35
|
+
z.object({ state: z.literal("available"), value: z.array(addressedEntry) }),
|
|
36
|
+
z.object({
|
|
37
|
+
state: z.literal("unavailable"),
|
|
38
|
+
reason: z.string(),
|
|
39
|
+
remediation: z.string(),
|
|
40
|
+
}),
|
|
41
|
+
]);
|
|
25
42
|
/** Exact structured-content schemas shared by direct analysis providers. */
|
|
26
43
|
export const officialOutputSchemas = {
|
|
27
44
|
address_name: resultOf(nullableText),
|
|
@@ -188,6 +205,7 @@ export const enhancedOutputSchemas = {
|
|
|
188
205
|
string_count: z.number().int().min(0),
|
|
189
206
|
})),
|
|
190
207
|
analyze_function: functionDossierOutput,
|
|
208
|
+
inspect_native_api: resultOf(nativeApiInspectionResultSchema),
|
|
191
209
|
trace_feature: literalTraceOutput,
|
|
192
210
|
find_code_for_string: literalTraceOutput,
|
|
193
211
|
trace_call_path: callPathTraceOutput,
|
|
@@ -293,16 +311,43 @@ export const sessionOutputSchemas = {
|
|
|
293
311
|
}),
|
|
294
312
|
]),
|
|
295
313
|
])),
|
|
296
|
-
export_evidence_bundle: lifecycleResultOf(z.
|
|
297
|
-
|
|
298
|
-
z.
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
314
|
+
export_evidence_bundle: lifecycleResultOf(z.object({
|
|
315
|
+
path: z.string(),
|
|
316
|
+
bytes: z.number().int().min(0),
|
|
317
|
+
records: z.number().int().min(0),
|
|
318
|
+
unknowns: z.number().int().min(0),
|
|
319
|
+
})),
|
|
320
|
+
snapshot_evidence_bundle: lifecycleResultOf(z.object({
|
|
321
|
+
bundle_digest: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
322
|
+
bundle_version: z.literal(2),
|
|
323
|
+
bytes: z.number().int().min(0),
|
|
324
|
+
records: z.number().int().min(0),
|
|
325
|
+
unknowns: z.number().int().min(0),
|
|
326
|
+
scope: z.literal("session"),
|
|
327
|
+
survives_session: z.literal(false),
|
|
328
|
+
bundle_uri: z.string().regex(/^rea:\/\/evidence-bundle\/[a-f0-9]{64}$/u),
|
|
329
|
+
})),
|
|
330
|
+
release_evidence_bundle: lifecycleResultOf(z.object({
|
|
331
|
+
bundle_digest: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
332
|
+
released: z.boolean(),
|
|
333
|
+
})),
|
|
334
|
+
get_navigation_context: lifecycleResultOf(z.object({
|
|
335
|
+
document: z.string(),
|
|
336
|
+
address: z.string(),
|
|
337
|
+
procedure: z.union([z.string(), z.null()]),
|
|
338
|
+
})),
|
|
339
|
+
inspect_address_context: lifecycleResultOf(z.object({
|
|
340
|
+
address: z.string(),
|
|
341
|
+
document: z.string().nullable(),
|
|
342
|
+
name: contextFacetSchema,
|
|
343
|
+
procedure: contextFacetSchema,
|
|
344
|
+
comment: contextFacetSchema,
|
|
345
|
+
inline_comment: contextFacetSchema,
|
|
346
|
+
bookmarks: bookmarkFacetSchema,
|
|
347
|
+
})),
|
|
304
348
|
import_evidence_bundle: lifecycleResultOf(z.object({
|
|
305
349
|
imported: z.number().int().min(0),
|
|
350
|
+
unknowns_added: z.number().int().min(0),
|
|
306
351
|
total: z.number().int().min(0),
|
|
307
352
|
})),
|
|
308
353
|
capture_process_scenario: resultOf(processCaptureSchema),
|
|
@@ -314,7 +359,17 @@ export const sessionOutputSchemas = {
|
|
|
314
359
|
build_call_path: resultOf(callPathResultSchema),
|
|
315
360
|
correlate_static_and_runtime: resultOf(staticRuntimeCorrelationResultSchema),
|
|
316
361
|
verify_reconstruction: resultOf(reconstructionVerificationResultSchema),
|
|
317
|
-
list_unknowns: lifecycleResultOf(z.
|
|
362
|
+
list_unknowns: lifecycleResultOf(z.object({
|
|
363
|
+
items: z.array(z.object({
|
|
364
|
+
unknown: residualUnknownSchema,
|
|
365
|
+
uri: z.string().regex(/^rea:\/\/unknown\/unk_[a-f0-9]{64}$/u),
|
|
366
|
+
})),
|
|
367
|
+
offset: z.number().int().min(0),
|
|
368
|
+
limit: z.number().int().min(1).max(500),
|
|
369
|
+
total: z.number().int().min(0),
|
|
370
|
+
next_offset: z.number().int().min(0).nullable(),
|
|
371
|
+
has_more: z.boolean(),
|
|
372
|
+
})),
|
|
318
373
|
record_unknown: lifecycleResultOf(residualUnknownSchema),
|
|
319
374
|
update_unknown: lifecycleResultOf(residualUnknownSchema),
|
|
320
375
|
verify_unknown_resolution: lifecycleResultOf(z.object({
|