rea-agents 2.0.0 → 2.2.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 +103 -38
- package/bridge/ghidra/ReaGhidraBridge.java +96 -11
- package/dist/application/AndroidApplicationService.js +17 -0
- package/dist/application/AppleApplicationService.js +17 -0
- package/dist/application/ArtifactExtraction.js +1 -1
- package/dist/application/ArtifactInventory/classify.js +42 -0
- package/dist/application/ArtifactInventory/hash.js +43 -0
- package/dist/application/ArtifactInventory/reader.js +41 -0
- package/dist/application/ArtifactInventory/scanCanonical.js +155 -0
- package/dist/application/ArtifactInventory/scanReader.js +124 -0
- package/dist/application/ArtifactInventory/types.js +10 -0
- package/dist/application/ArtifactInventory.js +9 -351
- package/dist/application/AuthorizedArtifactInventory.js +2 -2
- package/dist/application/BinarySession.js +47 -270
- package/dist/application/BinarySessionExecution.js +28 -0
- package/dist/application/BinarySessionOpen.js +39 -0
- package/dist/application/BinarySessionRecords.js +149 -0
- package/dist/application/BinarySessionStatus.js +75 -0
- package/dist/application/CapabilityInventory.js +24 -2
- package/dist/application/ClientRegistrationStatus.js +11 -4
- package/dist/application/CrossVersionInventory.js +8 -2
- package/dist/application/CrossVersionInvestigation.js +1 -23
- package/dist/application/CrossVersionInvestigationCollections.js +23 -0
- package/dist/application/DirectAnalysis.js +47 -44
- package/dist/application/Doctor.js +156 -238
- package/dist/application/DoctorDiagnostics.js +180 -0
- package/dist/application/ElectronBoundaryAnalysis.js +23 -7
- package/dist/application/ElectronBoundaryGraphWindows.js +32 -8
- package/dist/application/EnhancedToolPagination.js +22 -0
- package/dist/application/EnhancedToolTypes.js +4 -0
- package/dist/application/EnhancedTools.js +20 -37
- package/dist/application/InstrumentedJavaScriptReplayHost.js +36 -0
- package/dist/application/InventoryProjectionEvidence.js +41 -0
- package/dist/application/InvestigationProviders.js +12 -0
- package/dist/application/InvestigationWorkspaceStore.js +24 -10
- package/dist/application/JavaScriptArtifactAnalysis.js +45 -6
- package/dist/application/JavaScriptArtifactFiles.js +6 -2
- package/dist/application/JavaScriptArtifactGraphBuilder.js +23 -1
- package/dist/application/JavaScriptArtifactGraphBundlers.js +225 -0
- package/dist/application/JavaScriptArtifactGraphContext.js +37 -36
- package/dist/application/JavaScriptArtifactGraphDocuments.js +27 -4
- package/dist/application/JavaScriptArtifactGraphFindings.js +54 -8
- package/dist/application/JavaScriptArtifactGraphStructure.js +29 -101
- package/dist/application/JavaScriptArtifactPathResolution.js +269 -0
- package/dist/application/JavaScriptArtifactReconstruction.js +1 -1
- package/dist/application/JavaScriptJsonModules.js +39 -0
- package/dist/application/JavaScriptModuleRelationships.js +262 -0
- package/dist/application/JavaScriptReplayPermission.js +16 -0
- package/dist/application/JavaScriptReplayService.js +182 -156
- package/dist/application/LinuxHopper.js +10 -0
- package/dist/application/MacHopper.js +22 -11
- package/dist/application/NodeRuntimeCharacterizationService.js +196 -0
- package/dist/application/PermissionAuthority.js +106 -63
- package/dist/application/ProcessCaptureCapability.js +1 -1
- package/dist/application/ProcessCapturePermission.js +13 -0
- package/dist/application/ProcessCli.js +2 -12
- package/dist/application/ProcessHarness.js +1 -1
- package/dist/application/ProcessPairedExperiment.js +72 -0
- package/dist/application/ProjectPermissionStore.js +48 -9
- package/dist/application/RealHopperAssertions.js +76 -0
- package/dist/application/ReconstructionCoverageService.js +69 -0
- package/dist/application/ReconstructionCoverageWorkspaceStore.js +31 -0
- package/dist/application/RuntimeExecutableDiagnostics.js +172 -0
- package/dist/application/Setup.js +148 -260
- package/dist/application/SetupClientConfiguration.js +224 -0
- package/dist/application/SetupClients.js +24 -2
- package/dist/application/SetupPlan.js +124 -12
- package/dist/application/SetupSkill.js +54 -36
- package/dist/application/SupportedClients.js +1 -0
- package/dist/application/Uninstall.js +12 -3
- package/dist/application/Upgrade.js +16 -1
- package/dist/application/WindowsCapabilities.js +86 -0
- package/dist/artifacts/AsarArtifactReader.js +11 -0
- package/dist/browser/BrowserProcessStartup.js +88 -0
- package/dist/browser/CdpCaptureDocuments.js +12 -8
- package/dist/browser/CdpCaptureEventBodyShapes.js +75 -0
- package/dist/browser/CdpCaptureEventHandlers.js +336 -0
- package/dist/browser/CdpCaptureEventHelpers.js +71 -0
- package/dist/browser/CdpCaptureEventState.js +1 -0
- package/dist/browser/CdpCaptureEventTypes.js +1 -0
- package/dist/browser/CdpCaptureEvents.js +29 -496
- package/dist/browser/CdpObservationSession.js +51 -8
- package/dist/browser/CdpPageCapture.js +12 -133
- package/dist/browser/CdpPageCaptureScripts.js +97 -0
- package/dist/browser/CdpPageCaptureWorkers.js +46 -0
- package/dist/browser/CdpWebMcpDiscovery.js +38 -14
- package/dist/browser/PngVisualDiff.js +9 -2
- package/dist/catalogIdentity.js +4 -0
- package/dist/cli/artifactCommands.js +82 -0
- package/dist/cli/coreAnalysisCommands.js +232 -0
- package/dist/cli/managedCommands.js +397 -0
- package/dist/cli/managedProjectGraphCommand.js +24 -0
- package/dist/cli/options.js +9 -0
- package/dist/cli/setupCommands.js +113 -0
- package/dist/cli/types.js +1 -0
- package/dist/cli/utilityCommands.js +122 -0
- package/dist/cli.js +10 -768
- package/dist/cliApplicationCommands.js +118 -4
- package/dist/cliBrowserAdvancedCommands.js +73 -16
- package/dist/cliBrowserCommands.js +39 -115
- package/dist/cliCommandNames.js +4 -0
- package/dist/cliElectronCommands.js +33 -62
- package/dist/cliEvidenceCommands.js +13 -2
- package/dist/cliInvestigationCommands.js +53 -10
- package/dist/cliObservationOptions.js +137 -0
- package/dist/cliPolicyCommands.js +80 -46
- package/dist/cliSetup.js +306 -0
- package/dist/config/environment.js +107 -0
- package/dist/config/parseConfig.js +228 -0
- package/dist/config/parsers.js +68 -0
- package/dist/config/permissions.js +30 -0
- package/dist/config/types.js +1 -0
- package/dist/config.js +1 -375
- package/dist/contracts/applicationToolContracts.js +134 -0
- package/dist/contracts/electronToolContracts.js +51 -3
- package/dist/contracts/managedToolContracts.js +8 -3
- package/dist/contracts/managedWorkflowToolContracts.js +3 -3
- package/dist/contracts/providerSelection.js +2 -0
- package/dist/contracts/sessionStatusContract.js +26 -0
- package/dist/contracts/toolContractTypes.js +12 -1
- package/dist/contracts/toolContracts.js +5 -12
- package/dist/contracts/toolEffects.js +14 -0
- package/dist/contracts/toolOutputSchemaGroups.js +274 -0
- package/dist/contracts/toolOutputSchemaPrimitives.js +328 -0
- package/dist/contracts/toolOutputSchemas.js +2 -550
- package/dist/domain/analysisErrorPresentation.js +234 -0
- package/dist/domain/analysisErrorProjection.js +284 -0
- package/dist/domain/androidApplication.js +206 -0
- package/dist/domain/appleApplication.js +221 -0
- package/dist/domain/artifactComparison.js +34 -15
- package/dist/domain/binaryTarget.js +87 -37
- package/dist/domain/boundedCartesianProjection.js +15 -0
- package/dist/domain/browserObservation.js +1 -285
- package/dist/domain/browserObservationSchemas.js +286 -0
- package/dist/domain/electronStaticAnalysisBrowser.js +14 -2
- package/dist/domain/errors.js +4 -486
- package/dist/domain/functionComparison.js +4 -165
- package/dist/domain/functionComparisonDimensions.js +164 -0
- package/dist/domain/javascriptApplicationVersionItems.js +18 -6
- package/dist/domain/javascriptApplicationVersionKeys.js +8 -8
- package/dist/domain/javascriptExportInstrumentation.js +97 -0
- package/dist/domain/javascriptFeatureTraversal.js +19 -7
- package/dist/domain/javascriptRuntimeStaticCandidates.js +3 -1
- package/dist/domain/javascriptSemanticAnalysis.js +386 -0
- package/dist/domain/javascriptSemanticIr.js +30 -0
- package/dist/domain/javascriptSemanticProjection.js +366 -0
- package/dist/domain/javascriptSemanticState.js +40 -0
- package/dist/domain/javascriptSemanticTraversal.js +22 -0
- package/dist/domain/javascriptSemanticValues.js +352 -0
- package/dist/domain/javascriptStaticAnalysis.js +5 -221
- package/dist/domain/javascriptStaticAnalysisBundler.js +209 -0
- package/dist/domain/javascriptStaticAnalysisCalls.js +180 -0
- package/dist/domain/javascriptStaticAnalysisHelpers.js +71 -2
- package/dist/domain/knownPageCoverage.js +21 -0
- package/dist/domain/managedApplicationGraph.js +14 -364
- package/dist/domain/managedApplicationGraphCoverage.js +170 -0
- package/dist/domain/managedApplicationGraphNodeCoverage.js +6 -0
- package/dist/domain/managedApplicationGraphNodes.js +336 -0
- package/dist/domain/managedArtifact.js +16 -8
- package/dist/domain/managedMemberComparison.js +37 -391
- package/dist/domain/managedMemberComparisonCoverage.js +72 -0
- package/dist/domain/managedMemberComparisonMatch.js +356 -0
- package/dist/domain/managedNativeVerification.js +27 -389
- package/dist/domain/managedNativeVerificationMatch.js +272 -0
- package/dist/domain/managedNativeVerificationSchemas.js +141 -0
- package/dist/domain/managedReconstruction.js +82 -69
- package/dist/domain/managedRuntimeCorrelation.js +12 -3
- package/dist/domain/nodeRuntimeCharacterization.js +66 -0
- package/dist/domain/permissionPolicy.js +2 -0
- package/dist/domain/processComparison.js +19 -0
- package/dist/domain/processPairedExperiment.js +128 -0
- package/dist/domain/reconstructionCoverage.js +387 -0
- package/dist/domain/reconstructionCoverageEvaluation.js +212 -0
- package/dist/domain/reconstructionVerificationSchemas.js +8 -0
- package/dist/domain/replayMachine.js +316 -0
- package/dist/domain/replayMachineRuntime.js +215 -0
- package/dist/domain/runtimeCharacterization.js +85 -0
- package/dist/domain/runtimeIdentification.js +210 -0
- package/dist/domain/webBundleAnalyzer.js +3 -409
- package/dist/domain/webBundleAnalyzerAst.js +77 -0
- package/dist/domain/webBundleAnalyzerInspection.js +307 -0
- package/dist/domain/webBundleAnalyzerResult.js +120 -0
- package/dist/dotnet/ManagedArtifactInspector.js +50 -29
- package/dist/dotnet/ManagedMemberInspector.js +51 -785
- package/dist/dotnet/ManagedMemberInspectorCore.js +297 -0
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +427 -0
- package/dist/dotnet/ManagedMemberRows.js +120 -0
- package/dist/dotnet/ManagedMetadataInventory.js +42 -306
- package/dist/dotnet/ManagedMetadataInventoryRows.js +292 -0
- package/dist/dotnet/ManagedMetadataLayout.js +48 -111
- package/dist/dotnet/ManagedMetadataRowSizes.js +54 -0
- package/dist/dotnet/ManagedMethodBodyReader.js +143 -0
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +311 -0
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +102 -350
- package/dist/dotnet/ManagedPeReader.js +59 -28
- package/dist/evaluation/CodexAgentEval.js +132 -0
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraClient.js +76 -91
- package/dist/ghidra/GhidraClientStartup.js +29 -0
- package/dist/ghidra/GhidraClientWire.js +34 -0
- package/dist/ghidra/GhidraDefaults.js +1 -1
- package/dist/ghidra/GhidraDiagnostics.js +6 -1
- package/dist/ghidra/GhidraInstallation.js +20 -15
- package/dist/ghidra/GhidraLauncher.js +93 -29
- package/dist/ghidra/GhidraProvider.js +61 -161
- package/dist/ghidra/GhidraProviderCapabilities.js +173 -0
- package/dist/ghidra/GhidraSessionValues.js +2 -0
- package/dist/ghidra/GhidraSocketConnection.js +44 -7
- package/dist/ghidra/GhidraTargetSnapshot.js +30 -0
- package/dist/ghidra/GhidraTransport.js +71 -0
- package/dist/identity.js +4 -2
- package/dist/main/messages.js +5 -0
- package/dist/main/reload.js +49 -0
- package/dist/main/shutdown.js +25 -0
- package/dist/main/startup.js +14 -0
- package/dist/main/state.js +26 -0
- package/dist/main/transport.js +61 -0
- package/dist/main/types.js +1 -0
- package/dist/main.js +35 -146
- package/dist/process/PrivateRuntimeRoot.js +3 -2
- package/dist/process/ProcessOwnership.js +35 -0
- package/dist/process/ProviderProcess.js +2 -0
- package/dist/replay/JavaScriptReplayWorker.js +64 -50
- package/dist/replay/LinuxJavaScriptReplayRunner.js +173 -390
- package/dist/replay/LinuxJavaScriptReplaySandbox.js +140 -0
- package/dist/replay/ReplayOutcome.js +95 -0
- package/dist/replay/ReplayProcessLifecycle.js +71 -0
- package/dist/server/ProcessCaptureElicitation.js +157 -0
- package/dist/server/createServer.js +124 -56
- package/dist/server/javascriptApplicationResult.js +85 -0
- package/dist/server/registerApplicationTools/characterization.js +57 -0
- package/dist/server/registerApplicationTools/compareVersions.js +34 -0
- package/dist/server/registerApplicationTools/controlledReplay.js +38 -0
- package/dist/server/registerApplicationTools/coverage.js +84 -0
- package/dist/server/registerApplicationTools/helpers.js +42 -0
- package/dist/server/registerApplicationTools/traceFeature.js +26 -0
- package/dist/server/registerApplicationTools/types.js +1 -0
- package/dist/server/registerApplicationTools.js +10 -112
- package/dist/server/registerBrowserTools.js +59 -83
- package/dist/server/registerElectronTools.js +48 -49
- package/dist/server/registerEnhancedTools.js +34 -42
- package/dist/server/registerEvidenceResources.js +56 -0
- package/dist/server/registerInvestigationTools/helpers.js +74 -0
- package/dist/server/registerInvestigationTools/types.js +1 -0
- package/dist/server/registerInvestigationTools.js +83 -116
- package/dist/server/registerJavaScriptApplicationGraphResource.js +69 -0
- package/dist/server/registerManagedTools.js +18 -1
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +65 -0
- package/dist/server/registerManagedWorkflowTools/contract.js +8 -0
- package/dist/server/registerManagedWorkflowTools/evidence.js +43 -0
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +39 -0
- package/dist/server/registerManagedWorkflowTools/planManagedRuntimeCorrelation.js +39 -0
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +52 -0
- package/dist/server/registerManagedWorkflowTools/types.js +1 -0
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +75 -0
- package/dist/server/registerManagedWorkflowTools.js +10 -274
- package/dist/server/registerOfficialTools.js +73 -59
- package/dist/server/registerSessionRecordTools.js +137 -0
- package/dist/server/registerSessionStatusTool.js +97 -26
- package/dist/server/registerSessionTools.js +60 -164
- package/dist/server/sessionAvailabilityPolicy.js +10 -0
- package/dist/server/toolRegistrationOptions.js +101 -3
- package/dist/server/toolResult.js +15 -4
- package/package.json +11 -11
- package/skills/reverse-engineer-anything/SKILL.md +76 -0
- package/skills/reverse-engineer-anything/references/controlled-replay.md +12 -0
- package/skills/reverse-engineer-anything/references/evidence-workflows.md +33 -0
- package/skills/reverse-engineer-anything/references/javascript-applications.md +25 -0
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +36 -0
- package/skills/reverse-engineer-anything/references/runtime-observation.md +24 -0
- package/scripts/prepare-node-pty.mjs +0 -35
- package/scripts/rebuild-native.mjs +0 -22
- package/skills/rea-analysis/SKILL.md +0 -222
|
@@ -111,7 +111,7 @@ export const MANAGED_WORKFLOW_TOOL_CONTRACTS = [
|
|
|
111
111
|
{
|
|
112
112
|
name: "compare_managed_members",
|
|
113
113
|
...toolContractMetadata("compare_managed_members"),
|
|
114
|
-
description: "Compare two authenticated inspect_managed_members Evidence records using unique-only CIL/signature and structural method-shape tiers. Names are reported as observations but are not used as a matching basis; metadata tokens
|
|
114
|
+
description: "Compare two authenticated inspect_managed_members Evidence records using unique-only decoded-CIL-v1/signature and structural method-shape tiers. Names are reported as observations but are not used as a matching basis; metadata tokens remain build-local coordinates bound to each artifact SHA-256 and MVID, and the v1 tuple digest does not itself remap them.",
|
|
115
115
|
kind: "application",
|
|
116
116
|
inputSchema: compareManagedMembersReferenceInputSchema,
|
|
117
117
|
outputSchema: comparisonOutputSchema,
|
|
@@ -147,7 +147,7 @@ export const MANAGED_WORKFLOW_TOOL_CONTRACTS = [
|
|
|
147
147
|
{
|
|
148
148
|
name: "import_managed_reconstruction",
|
|
149
149
|
...toolContractMetadata("import_managed_reconstruction"),
|
|
150
|
-
description: "Import decompiler-produced managed reconstruction against authenticated inspect_managed_members Evidence. The workflow locks each method to artifact SHA-256, MVID, metadata token, signature hash, and
|
|
150
|
+
description: "Import decompiler-produced managed reconstruction against authenticated inspect_managed_members Evidence. The workflow locks each method to artifact SHA-256, MVID, metadata token, signature hash, and the limited member-result-v1 decoded-IL tuple hash, records the decompiler identity and options, and marks C# or pseudocode as analyst inference rather than canonical byte observation.",
|
|
151
151
|
kind: "application",
|
|
152
152
|
inputSchema: managedReconstructionReferenceInputSchema,
|
|
153
153
|
outputSchema: reconstructionOutputSchema,
|
|
@@ -166,7 +166,7 @@ export const MANAGED_WORKFLOW_TOOL_CONTRACTS = [
|
|
|
166
166
|
{
|
|
167
167
|
name: "plan_managed_runtime_correlation",
|
|
168
168
|
...toolContractMetadata("plan_managed_runtime_correlation"),
|
|
169
|
-
description: "Prepare a separately authorized managed runtime-correlation admission plan from authenticated inspect_managed_members Evidence. The operation is default-disabled, requires the managed_runtime permission ceiling and grant, locks the exact artifact SHA-256, MVID, method signature, and
|
|
169
|
+
description: "Prepare a separately authorized managed runtime-correlation admission plan from authenticated inspect_managed_members Evidence. The operation is default-disabled, requires the managed_runtime permission ceiling and grant, locks the exact artifact SHA-256, MVID, method signature, and limited member-result-v1 decoded-IL tuple hash, distinguishes attach/load/debugger/reflection/instrumentation effects, and records that no target code was executed.",
|
|
170
170
|
kind: "application",
|
|
171
171
|
inputSchema: managedRuntimeCorrelationReferenceInputSchema,
|
|
172
172
|
outputSchema: runtimeOutputSchema,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { TOOL_KINDS } from "./toolContractTypes.js";
|
|
3
|
+
/** Caller observations and projection controls for binary_session. */
|
|
4
|
+
export const binarySessionInputSchema = z.object({
|
|
5
|
+
detail: z
|
|
6
|
+
.enum(["summary", "capabilities", "full"])
|
|
7
|
+
.default("summary")
|
|
8
|
+
.describe("summary returns routing state; capabilities returns one filtered tool-availability page; full returns complete diagnostics only when required"),
|
|
9
|
+
capability_family: z
|
|
10
|
+
.enum(TOOL_KINDS)
|
|
11
|
+
.optional()
|
|
12
|
+
.describe("Optional tool family for detail=capabilities"),
|
|
13
|
+
cursor: z
|
|
14
|
+
.number()
|
|
15
|
+
.int()
|
|
16
|
+
.min(0)
|
|
17
|
+
.default(0)
|
|
18
|
+
.describe("Zero-based capability cursor for detail=capabilities"),
|
|
19
|
+
limit: z.number().int().min(1).max(100).default(25),
|
|
20
|
+
expected_package_version: z.string().min(1).optional(),
|
|
21
|
+
expected_catalog_digest: z
|
|
22
|
+
.string()
|
|
23
|
+
.regex(/^[a-f0-9]{64}$/u)
|
|
24
|
+
.optional(),
|
|
25
|
+
expected_server_path: z.string().min(1).optional(),
|
|
26
|
+
});
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
/** Canonical adapter families responsible for public MCP tools. */
|
|
2
|
+
export const TOOL_KINDS = [
|
|
3
|
+
"official-proxy",
|
|
4
|
+
"enhanced",
|
|
5
|
+
"native-provider",
|
|
6
|
+
"artifact-provider",
|
|
7
|
+
"managed-provider",
|
|
8
|
+
"browser-provider",
|
|
9
|
+
"electron-provider",
|
|
10
|
+
"application",
|
|
11
|
+
"session",
|
|
12
|
+
];
|
|
@@ -21,6 +21,8 @@ import { ELECTRON_TOOL_CONTRACTS } from "./electronToolContracts.js";
|
|
|
21
21
|
import { APPLICATION_TOOL_CONTRACTS } from "./applicationToolContracts.js";
|
|
22
22
|
import { closeBinaryInputSchema, openBinaryInputSchema, } from "./sessionLifecycleInputs.js";
|
|
23
23
|
import { toolContractMetadata } from "./toolEffects.js";
|
|
24
|
+
import { binarySessionInputSchema } from "./sessionStatusContract.js";
|
|
25
|
+
export { binarySessionInputSchema } from "./sessionStatusContract.js";
|
|
24
26
|
const document = z.string().optional().describe("The document name");
|
|
25
27
|
const address = z
|
|
26
28
|
.string()
|
|
@@ -125,8 +127,8 @@ export const OFFICIAL_TOOL_CONTRACTS = [
|
|
|
125
127
|
})),
|
|
126
128
|
official("procedure_pseudo_code", "Decompile one analyzed procedure by symbol name or provider-normalized address. Returns provider-specific pseudocode, never original source or cross-provider text equivalence, and may return null; request procedure_assembly when instruction precision matters.", z.object({ procedure, document })),
|
|
127
129
|
official("resolve_containing_procedure", "Resolve an arbitrary address, including an interior instruction or exact external entry, to its provider-analyzed containing procedure. A negative result distinguishes outside segments from not in a procedure and is never guessed from nearby symbols.", z.object({ address, document })),
|
|
128
|
-
official("search_procedures", "Search analyzed procedure names using literal matching by default or regex opt-in.
|
|
129
|
-
official("search_strings", "Search analyzed strings using literal matching by default or regex opt-in.
|
|
130
|
+
official("search_procedures", "Search analyzed procedure names using literal matching by default or regex opt-in. Providers bound search work and reject regex constructs, paths, candidates, or cumulative work outside their finite budgets. Results are deterministic and offset-paginated.", z.object(searchInput)),
|
|
131
|
+
official("search_strings", "Search analyzed strings using literal matching by default or regex opt-in. Providers bound search work and reject regex constructs, paths, candidates, or cumulative work outside their finite budgets. Results are deterministic, offset-paginated, and explicitly truncated.", z.object(searchInput)),
|
|
130
132
|
official("set_address_name", "Assign an analyst name to one hexadecimal address and report Hopper's boolean result. This mutates analysis metadata; read it back with address_name before relying on it.", z.object({ address, name: z.string(), document })),
|
|
131
133
|
official("set_addresses_names", "Assign analyst names to an address/name map and return per-address success booleans. This mutates analysis metadata; use for bounded batches and verify failures individually.", z.object({ names: z.record(z.string(), z.string()), document })),
|
|
132
134
|
official("set_bookmark", "Create or replace a bookmark at a hexadecimal address. This mutates navigation metadata; verify with list_bookmarks and do not treat bookmarks as binary evidence.", z.object({ address, name: z.string().optional(), document })),
|
|
@@ -149,15 +151,6 @@ export const ENHANCED_TOOL_CONTRACTS = [
|
|
|
149
151
|
enhanced("analyze_function", "Preferred bounded analysis for one procedure symbol or address. Returns identity, provider-specific pseudocode, optional assembly, comments, calls, typed-or-explicitly-unavailable references, referenced strings/names, and local CFG blocks with exact truncation metadata.", enhancedInputSchemas.analyze_function),
|
|
150
152
|
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),
|
|
151
153
|
];
|
|
152
|
-
/** Caller observations used to compare a live server with expected identity. */
|
|
153
|
-
export const binarySessionInputSchema = z.object({
|
|
154
|
-
expected_package_version: z.string().min(1).optional(),
|
|
155
|
-
expected_catalog_digest: z
|
|
156
|
-
.string()
|
|
157
|
-
.regex(/^[a-f0-9]{64}$/u)
|
|
158
|
-
.optional(),
|
|
159
|
-
expected_server_path: z.string().min(1).optional(),
|
|
160
|
-
});
|
|
161
154
|
/** Session-owned Evidence bundle export options. */
|
|
162
155
|
export const exportEvidenceBundleInputSchema = z.strictObject({
|
|
163
156
|
path: z.string().min(1).optional(),
|
|
@@ -193,7 +186,7 @@ export const verifyUnknownResolutionInputSchema = z.strictObject({
|
|
|
193
186
|
export const SESSION_TOOL_CONTRACTS = [
|
|
194
187
|
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),
|
|
195
188
|
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),
|
|
196
|
-
session("binary_session", "Report
|
|
189
|
+
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),
|
|
197
190
|
session("export_evidence_bundle", "Return the session's deterministic Evidence v2 bundle, or atomically write it beneath an operator-approved root. Existing files require overwrite: true; records and manifests use canonical byte-stable ordering.", exportEvidenceBundleInputSchema),
|
|
198
191
|
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),
|
|
199
192
|
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),
|
|
@@ -99,6 +99,20 @@ export const TOOL_EFFECTS = {
|
|
|
99
99
|
writesFilesystem: true,
|
|
100
100
|
launchesProcess: true,
|
|
101
101
|
}),
|
|
102
|
+
prepare_node_characterization: effects({
|
|
103
|
+
mutatesSession: true,
|
|
104
|
+
launchesProcess: true,
|
|
105
|
+
}),
|
|
106
|
+
execute_node_characterization: effects({
|
|
107
|
+
mutatesSession: true,
|
|
108
|
+
writesFilesystem: true,
|
|
109
|
+
launchesProcess: true,
|
|
110
|
+
}),
|
|
111
|
+
commit_reconstruction_coverage: effects({
|
|
112
|
+
writesFilesystem: true,
|
|
113
|
+
mutatesSession: true,
|
|
114
|
+
}),
|
|
115
|
+
query_reconstruction_coverage: effects({ mutatesSession: true }),
|
|
102
116
|
open_binary: effects({ mutatesSession: true, launchesProcess: true }),
|
|
103
117
|
close_binary: effects({
|
|
104
118
|
mutatesSession: true,
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { processCaptureComparisonSchema, processCaptureSchema, } from "../domain/processCapture.js";
|
|
3
|
+
import { evidenceBundleSchema } from "../domain/evidenceBundle.js";
|
|
4
|
+
import { residualUnknownSchema } from "../domain/residualUnknown.js";
|
|
5
|
+
import { referenceKindSchema } from "../domain/hopperValues.js";
|
|
6
|
+
import { demangleSwiftSchema, inspectMachoSchema, inspectPlistSchema, inspectSignatureSchema, listArchitecturesSchema, } from "../domain/nativeInspection.js";
|
|
7
|
+
import { artifactExtractionResultSchema, artifactInventoryResultSchema, } from "../domain/artifactGraph.js";
|
|
8
|
+
import { managedArtifactInspectionSchema, managedMemberInspectionSchema, managedNativeBoundaryInspectionSchema, } from "../domain/managedArtifact.js";
|
|
9
|
+
import { managedMemberComparisonResultSchema } from "../domain/managedMemberComparison.js";
|
|
10
|
+
import { managedNativeVerificationResultSchema } from "../domain/managedNativeVerification.js";
|
|
11
|
+
import { managedReconstructionImportResultSchema } from "../domain/managedReconstruction.js";
|
|
12
|
+
import { managedRuntimeCorrelationResultSchema } from "../domain/managedRuntimeCorrelation.js";
|
|
13
|
+
import { managedApplicationGraphResultSchema } from "../domain/managedApplicationGraph.js";
|
|
14
|
+
import { artifactComparisonResultSchema } from "../domain/artifactComparison.js";
|
|
15
|
+
import { functionComparisonResultSchema } from "../domain/functionComparison.js";
|
|
16
|
+
import { bundleComparisonResultSchema } from "../domain/bundleComparison.js";
|
|
17
|
+
import { changedBehaviorResultSchema } from "../domain/changedBehavior.js";
|
|
18
|
+
import { callPathResultSchema } from "../domain/callPath.js";
|
|
19
|
+
import { staticRuntimeCorrelationResultSchema } from "../domain/staticRuntimeCorrelation.js";
|
|
20
|
+
import { reconstructionVerificationResultSchema } from "../domain/reconstructionVerification.js";
|
|
21
|
+
import { analysisErrorProjectionSchema } from "./errorSchemas.js";
|
|
22
|
+
import { addressList, addressedEntry, bounded, containingProcedureResolution, functionDossierOutput, graphNode, lifecycleResultOf, nullableText, pageOutput, procedureIdentity, procedureInfoOutput, evidenceResultOf as resultOf, searchPageOutput, segmentOutput, sessionProvider, providerIdentity, toolAvailability, symbolDiscoveryOutput, targetFormatSchema, targetKindSchema, } from "./toolOutputSchemaPrimitives.js";
|
|
23
|
+
/** Exact structured-content schemas shared by direct analysis providers. */
|
|
24
|
+
export const officialOutputSchemas = {
|
|
25
|
+
address_name: resultOf(nullableText),
|
|
26
|
+
comment: resultOf(nullableText),
|
|
27
|
+
current_address: resultOf(z.string()),
|
|
28
|
+
current_procedure: resultOf(z.string()),
|
|
29
|
+
current_document: resultOf(z.string()),
|
|
30
|
+
goto_address: resultOf(z.string()),
|
|
31
|
+
inline_comment: resultOf(nullableText),
|
|
32
|
+
list_bookmarks: resultOf(z.array(addressedEntry)),
|
|
33
|
+
list_documents: resultOf(z.array(z.string())),
|
|
34
|
+
list_names: resultOf(pageOutput),
|
|
35
|
+
list_procedures: resultOf(pageOutput),
|
|
36
|
+
list_segments: segmentOutput,
|
|
37
|
+
list_strings: resultOf(pageOutput),
|
|
38
|
+
next_address: resultOf(z.string()),
|
|
39
|
+
prev_address: resultOf(z.string()),
|
|
40
|
+
procedure_address: resultOf(z.string()),
|
|
41
|
+
procedure_assembly: resultOf(z.string()),
|
|
42
|
+
procedure_callees: resultOf(addressList),
|
|
43
|
+
procedure_callers: resultOf(addressList),
|
|
44
|
+
procedure_info: procedureInfoOutput,
|
|
45
|
+
procedure_references: resultOf(z.object({
|
|
46
|
+
procedure: procedureIdentity,
|
|
47
|
+
direction: z.enum(["incoming", "outgoing"]),
|
|
48
|
+
references: bounded(z.object({
|
|
49
|
+
source_address: z.string(),
|
|
50
|
+
target_address: z.string(),
|
|
51
|
+
source_procedure: procedureIdentity.nullable(),
|
|
52
|
+
target_procedure: procedureIdentity.nullable(),
|
|
53
|
+
kind: referenceKindSchema,
|
|
54
|
+
})),
|
|
55
|
+
instructions_scanned: z.number().int().min(0),
|
|
56
|
+
instruction_scan_truncated: z.boolean(),
|
|
57
|
+
})),
|
|
58
|
+
procedure_pseudo_code: resultOf(nullableText),
|
|
59
|
+
resolve_containing_procedure: resultOf(containingProcedureResolution),
|
|
60
|
+
search_procedures: resultOf(searchPageOutput),
|
|
61
|
+
search_strings: resultOf(searchPageOutput),
|
|
62
|
+
set_address_name: resultOf(z.boolean()),
|
|
63
|
+
set_addresses_names: resultOf(z.record(z.string(), z.boolean())),
|
|
64
|
+
set_bookmark: resultOf(z.boolean()),
|
|
65
|
+
set_comment: resultOf(z.boolean()),
|
|
66
|
+
set_current_document: resultOf(z.string()),
|
|
67
|
+
set_inline_comment: resultOf(z.boolean()),
|
|
68
|
+
unset_bookmark: resultOf(z.boolean()),
|
|
69
|
+
xrefs: resultOf(addressList),
|
|
70
|
+
};
|
|
71
|
+
/** Exact structured-content schemas for composed analysis workflows. */
|
|
72
|
+
export const enhancedOutputSchemas = {
|
|
73
|
+
swift_classes: symbolDiscoveryOutput("classes"),
|
|
74
|
+
get_objc_classes: symbolDiscoveryOutput("classes"),
|
|
75
|
+
get_objc_protocols: symbolDiscoveryOutput("protocols"),
|
|
76
|
+
batch_decompile: resultOf(z.object({
|
|
77
|
+
items: z.array(z.discriminatedUnion("status", [
|
|
78
|
+
z.object({
|
|
79
|
+
address: z.string(),
|
|
80
|
+
status: z.literal("ok"),
|
|
81
|
+
pseudocode: z.string().min(1),
|
|
82
|
+
}),
|
|
83
|
+
z.object({
|
|
84
|
+
address: z.string(),
|
|
85
|
+
status: z.literal("error"),
|
|
86
|
+
error: analysisErrorProjectionSchema,
|
|
87
|
+
}),
|
|
88
|
+
])),
|
|
89
|
+
total: z.number().int().min(0),
|
|
90
|
+
succeeded: z.number().int().min(0),
|
|
91
|
+
failed: z.number().int().min(0),
|
|
92
|
+
})),
|
|
93
|
+
get_call_graph: resultOf(z.record(z.string(), z.array(graphNode))),
|
|
94
|
+
analyze_swift_types: resultOf(z.object({
|
|
95
|
+
total: z.number().int().min(0),
|
|
96
|
+
categories: z.record(z.string(), z.object({
|
|
97
|
+
count: z.number().int().min(0),
|
|
98
|
+
items: z.array(addressedEntry),
|
|
99
|
+
})),
|
|
100
|
+
})),
|
|
101
|
+
find_xrefs_to_name: resultOf(z.discriminatedUnion("status", [
|
|
102
|
+
z.object({
|
|
103
|
+
status: z.literal("resolved"),
|
|
104
|
+
name: z.string(),
|
|
105
|
+
address: z.string(),
|
|
106
|
+
xrefs: addressList,
|
|
107
|
+
}),
|
|
108
|
+
z.object({
|
|
109
|
+
status: z.literal("unresolved"),
|
|
110
|
+
name: z.string(),
|
|
111
|
+
reason: z.literal("name_not_found"),
|
|
112
|
+
}),
|
|
113
|
+
])),
|
|
114
|
+
binary_overview: resultOf(z.object({
|
|
115
|
+
document: z.string(),
|
|
116
|
+
detail: z.enum(["concise", "detailed"]),
|
|
117
|
+
segments: z.array(z.object({
|
|
118
|
+
name: z.string(),
|
|
119
|
+
start: z.string(),
|
|
120
|
+
end: z.string(),
|
|
121
|
+
length: z.number().min(0).optional(),
|
|
122
|
+
})),
|
|
123
|
+
segment_count: z.number().int().min(0),
|
|
124
|
+
procedure_count: z.number().int().min(0),
|
|
125
|
+
string_count: z.number().int().min(0),
|
|
126
|
+
})),
|
|
127
|
+
analyze_function: functionDossierOutput,
|
|
128
|
+
trace_feature: resultOf(z.object({
|
|
129
|
+
query: z.string(),
|
|
130
|
+
search_mode: z.literal("literal"),
|
|
131
|
+
operations_used: z.number().int().min(0),
|
|
132
|
+
operation_budget: z.number().int().min(1),
|
|
133
|
+
matches: z.array(z.object({
|
|
134
|
+
type: z.enum(["string", "procedure"]),
|
|
135
|
+
address: z.string(),
|
|
136
|
+
value: z.string(),
|
|
137
|
+
})),
|
|
138
|
+
references: z.array(z.object({
|
|
139
|
+
target_address: z.string(),
|
|
140
|
+
source_address: z.string(),
|
|
141
|
+
containing_procedure: containingProcedureResolution,
|
|
142
|
+
})),
|
|
143
|
+
truncated: z.boolean(),
|
|
144
|
+
residual_unknowns: z.array(z.string()),
|
|
145
|
+
})),
|
|
146
|
+
};
|
|
147
|
+
/** Exact Evidence v2 schemas for provider-neutral native inspection. */
|
|
148
|
+
export const nativeOutputSchemas = {
|
|
149
|
+
inspect_macho: resultOf(inspectMachoSchema),
|
|
150
|
+
inspect_signature: resultOf(inspectSignatureSchema),
|
|
151
|
+
inspect_plist: resultOf(inspectPlistSchema),
|
|
152
|
+
list_architectures: resultOf(listArchitecturesSchema),
|
|
153
|
+
demangle_swift: resultOf(demangleSwiftSchema),
|
|
154
|
+
};
|
|
155
|
+
/** Exact Evidence v2 schemas for provider-neutral artifact graph operations. */
|
|
156
|
+
export const artifactOutputSchemas = {
|
|
157
|
+
inventory_artifact: resultOf(artifactInventoryResultSchema),
|
|
158
|
+
extract_artifact: resultOf(artifactExtractionResultSchema),
|
|
159
|
+
};
|
|
160
|
+
/** Exact Evidence v2 schema for execution-free managed static analysis. */
|
|
161
|
+
export const managedOutputSchemas = {
|
|
162
|
+
inspect_managed_artifact: resultOf(managedArtifactInspectionSchema),
|
|
163
|
+
inspect_managed_members: resultOf(managedMemberInspectionSchema),
|
|
164
|
+
inspect_managed_native_boundaries: resultOf(managedNativeBoundaryInspectionSchema),
|
|
165
|
+
};
|
|
166
|
+
/** Exact Evidence v2 schema for provider-neutral managed workflows. */
|
|
167
|
+
export const managedWorkflowOutputSchemas = {
|
|
168
|
+
compare_managed_members: resultOf(managedMemberComparisonResultSchema),
|
|
169
|
+
verify_managed_native_boundaries: resultOf(managedNativeVerificationResultSchema),
|
|
170
|
+
import_managed_reconstruction: resultOf(managedReconstructionImportResultSchema),
|
|
171
|
+
plan_managed_runtime_correlation: resultOf(managedRuntimeCorrelationResultSchema),
|
|
172
|
+
project_managed_application_graph: resultOf(managedApplicationGraphResultSchema),
|
|
173
|
+
};
|
|
174
|
+
/** Exact structured-content schemas for target lifecycle operations. */
|
|
175
|
+
export const sessionOutputSchemas = {
|
|
176
|
+
open_binary: lifecycleResultOf(z.object({
|
|
177
|
+
path: z.string(),
|
|
178
|
+
format: targetFormatSchema,
|
|
179
|
+
kind: targetKindSchema,
|
|
180
|
+
loaderArgs: z.array(z.string()),
|
|
181
|
+
sha256: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
182
|
+
architecture: z.enum(["x86", "x86_64", "arm", "arm64"]).nullable(),
|
|
183
|
+
})),
|
|
184
|
+
close_binary: lifecycleResultOf(z.union([
|
|
185
|
+
z.null(),
|
|
186
|
+
z.object({
|
|
187
|
+
path: z.string(),
|
|
188
|
+
bytes: z.number().int().min(0),
|
|
189
|
+
entries: z.number().int().min(0),
|
|
190
|
+
}),
|
|
191
|
+
])),
|
|
192
|
+
binary_session: lifecycleResultOf(z.union([
|
|
193
|
+
z.object({
|
|
194
|
+
view: z.literal("summary"),
|
|
195
|
+
open: z.boolean(),
|
|
196
|
+
provider: providerIdentity,
|
|
197
|
+
active_provider: providerIdentity.nullable(),
|
|
198
|
+
target: z
|
|
199
|
+
.object({
|
|
200
|
+
path: z.string(),
|
|
201
|
+
format: targetFormatSchema,
|
|
202
|
+
kind: targetKindSchema,
|
|
203
|
+
sha256: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
204
|
+
architecture: z.enum(["x86", "x86_64", "arm", "arm64"]).nullable(),
|
|
205
|
+
})
|
|
206
|
+
.nullable(),
|
|
207
|
+
alignment: z.object({
|
|
208
|
+
state: z.enum(["aligned", "mcp_server_restart_required", "unknown"]),
|
|
209
|
+
reasons: z.array(z.string()),
|
|
210
|
+
remediation: z.string().nullable(),
|
|
211
|
+
}),
|
|
212
|
+
recommended_actions: z.array(z.string()),
|
|
213
|
+
}),
|
|
214
|
+
z.object({
|
|
215
|
+
view: z.literal("capabilities"),
|
|
216
|
+
open: z.boolean(),
|
|
217
|
+
provider: providerIdentity,
|
|
218
|
+
active_provider: providerIdentity.nullable(),
|
|
219
|
+
capability_family: z.string().nullable(),
|
|
220
|
+
capabilities: z.object({
|
|
221
|
+
items: z.array(toolAvailability),
|
|
222
|
+
cursor: z.number().int().min(0),
|
|
223
|
+
limit: z.number().int().min(1),
|
|
224
|
+
total: z.number().int().min(0),
|
|
225
|
+
next_cursor: z.number().int().min(0).nullable(),
|
|
226
|
+
has_more: z.boolean(),
|
|
227
|
+
}),
|
|
228
|
+
}),
|
|
229
|
+
z.union([
|
|
230
|
+
sessionProvider.extend({
|
|
231
|
+
view: z.literal("full"),
|
|
232
|
+
open: z.literal(false),
|
|
233
|
+
}),
|
|
234
|
+
sessionProvider.extend({
|
|
235
|
+
view: z.literal("full"),
|
|
236
|
+
open: z.literal(true),
|
|
237
|
+
path: z.string(),
|
|
238
|
+
format: targetFormatSchema,
|
|
239
|
+
kind: targetKindSchema,
|
|
240
|
+
sha256: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
241
|
+
architecture: z.enum(["x86", "x86_64", "arm", "arm64"]).nullable(),
|
|
242
|
+
}),
|
|
243
|
+
]),
|
|
244
|
+
])),
|
|
245
|
+
export_evidence_bundle: lifecycleResultOf(z.union([
|
|
246
|
+
evidenceBundleSchema,
|
|
247
|
+
z.object({
|
|
248
|
+
path: z.string(),
|
|
249
|
+
bytes: z.number().int().min(0),
|
|
250
|
+
records: z.number().int().min(0),
|
|
251
|
+
}),
|
|
252
|
+
])),
|
|
253
|
+
import_evidence_bundle: lifecycleResultOf(z.object({
|
|
254
|
+
imported: z.number().int().min(0),
|
|
255
|
+
total: z.number().int().min(0),
|
|
256
|
+
})),
|
|
257
|
+
capture_process_scenario: resultOf(processCaptureSchema),
|
|
258
|
+
compare_process_captures: resultOf(processCaptureComparisonSchema),
|
|
259
|
+
compare_artifacts: resultOf(artifactComparisonResultSchema),
|
|
260
|
+
compare_functions: resultOf(functionComparisonResultSchema),
|
|
261
|
+
compare_bundles: resultOf(bundleComparisonResultSchema),
|
|
262
|
+
find_changed_behavior: resultOf(changedBehaviorResultSchema),
|
|
263
|
+
build_call_path: resultOf(callPathResultSchema),
|
|
264
|
+
correlate_static_and_runtime: resultOf(staticRuntimeCorrelationResultSchema),
|
|
265
|
+
verify_reconstruction: resultOf(reconstructionVerificationResultSchema),
|
|
266
|
+
list_unknowns: lifecycleResultOf(z.array(residualUnknownSchema)),
|
|
267
|
+
record_unknown: lifecycleResultOf(residualUnknownSchema),
|
|
268
|
+
update_unknown: lifecycleResultOf(residualUnknownSchema),
|
|
269
|
+
verify_unknown_resolution: lifecycleResultOf(z.object({
|
|
270
|
+
valid: z.boolean(),
|
|
271
|
+
truthVerified: z.boolean(),
|
|
272
|
+
unknown: residualUnknownSchema,
|
|
273
|
+
})),
|
|
274
|
+
};
|