rea-agents 1.7.0 → 2.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 +112 -59
- package/bridge/ghidra/ReaGhidraBridge.java +96 -11
- 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 +42 -2
- package/dist/application/ClientRegistrationStatus.js +1 -1
- package/dist/application/CrossVersionInventory.js +8 -2
- package/dist/application/CrossVersionInvestigation.js +11 -29
- package/dist/application/CrossVersionInvestigationCollections.js +23 -0
- package/dist/application/DirectAnalysis.js +47 -44
- package/dist/application/Doctor.js +165 -197
- package/dist/application/DoctorDiagnostics.js +180 -0
- package/dist/application/ElectronBoundaryAnalysis.js +112 -0
- package/dist/application/ElectronBoundaryGraph.js +9 -0
- package/dist/application/ElectronBoundaryGraphContext.js +62 -0
- package/dist/application/ElectronBoundaryGraphIpc.js +242 -0
- package/dist/application/ElectronBoundaryGraphNative.js +86 -0
- package/dist/application/ElectronBoundaryGraphWindows.js +223 -0
- package/dist/application/EnhancedToolPagination.js +22 -0
- package/dist/application/EnhancedToolTypes.js +4 -0
- package/dist/application/EnhancedTools.js +58 -50
- package/dist/application/InstrumentedJavaScriptReplayHost.js +36 -0
- package/dist/application/InvestigationProviders.js +30 -0
- package/dist/application/InvestigationWorkspaceStore.js +24 -10
- package/dist/application/JavaScriptApplicationEvidence.js +26 -0
- package/dist/application/JavaScriptApplicationEvidenceGraph.js +89 -0
- package/dist/application/JavaScriptApplicationService.js +74 -0
- package/dist/application/JavaScriptApplicationWorkflowEvidence.js +29 -0
- package/dist/application/JavaScriptApplicationWorkflowService.js +90 -0
- package/dist/application/JavaScriptArtifactAnalysis.js +52 -7
- package/dist/application/JavaScriptArtifactFiles.js +6 -2
- package/dist/application/JavaScriptArtifactGraphBuilder.js +82 -17
- package/dist/application/JavaScriptArtifactGraphBundlers.js +225 -0
- package/dist/application/JavaScriptArtifactGraphContext.js +37 -36
- package/dist/application/JavaScriptArtifactGraphDocuments.js +27 -4
- package/dist/application/JavaScriptArtifactGraphEvidence.js +24 -14
- 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 +4 -1
- package/dist/application/JavaScriptArtifactReconstructionInput.js +2 -83
- package/dist/application/JavaScriptJsonModules.js +39 -0
- package/dist/application/JavaScriptModuleRelationships.js +262 -0
- package/dist/application/JavaScriptReplayPermission.js +16 -0
- package/dist/application/JavaScriptReplayPlanning.js +201 -0
- package/dist/application/JavaScriptReplayService.js +292 -0
- package/dist/application/JavaScriptRuntimeReconciliationEvidence.js +25 -0
- package/dist/application/JavaScriptRuntimeReconciliationService.js +27 -0
- package/dist/application/LinuxHopper.js +10 -0
- package/dist/application/MacHopper.js +22 -11
- package/dist/application/ManagedApplicationGraphService.js +55 -0
- package/dist/application/ManagedMemberComparisonService.js +122 -0
- package/dist/application/ManagedNativeVerificationService.js +39 -0
- package/dist/application/ManagedReconstructionService.js +58 -0
- package/dist/application/ManagedRuntimeCorrelationService.js +103 -0
- 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/ProcessSampling.js +15 -11
- package/dist/application/ProjectPermissionStore.js +49 -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 +147 -259
- package/dist/application/SetupClientConfiguration.js +220 -0
- package/dist/application/SetupClients.js +24 -2
- package/dist/application/SetupPlan.js +123 -12
- package/dist/application/SetupSkill.js +26 -12
- package/dist/application/SupportedClients.js +1 -0
- package/dist/application/Uninstall.js +6 -3
- package/dist/application/WindowsCapabilities.js +86 -0
- package/dist/application/runtime.js +2 -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 +46 -464
- package/dist/browser/CdpElectronInspection.js +106 -162
- package/dist/browser/CdpElectronProvider.js +5 -1
- package/dist/browser/CdpElectronScriptEvents.js +69 -0
- package/dist/browser/CdpElectronScripts.js +94 -0
- package/dist/browser/CdpElectronWorkers.js +56 -0
- package/dist/browser/CdpObservationSession.js +51 -8
- package/dist/browser/CdpPageCapture.js +12 -129
- 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 +8 -1
- 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 +108 -0
- package/dist/cli/types.js +1 -0
- package/dist/cli/utilityCommands.js +122 -0
- package/dist/cli.js +13 -383
- package/dist/cliApplicationCommands.js +176 -0
- package/dist/cliBrowserAdvancedCommands.js +73 -16
- package/dist/cliBrowserCommands.js +39 -115
- package/dist/cliCommandNames.js +17 -0
- package/dist/cliElectronCommands.js +100 -27
- package/dist/cliEvidenceCommands.js +13 -2
- package/dist/cliInvestigationCommands.js +53 -10
- package/dist/cliJsonInput.js +54 -0
- package/dist/cliObservationOptions.js +137 -0
- package/dist/cliPolicyCommands.js +80 -46
- package/dist/cliSetup.js +289 -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 -292
- package/dist/contracts/applicationToolContracts.js +225 -0
- package/dist/contracts/artifactToolContracts.js +5 -9
- package/dist/contracts/browserToolContracts.js +14 -62
- package/dist/contracts/electronToolContracts.js +45 -19
- package/dist/contracts/errorSchemas.js +1 -0
- package/dist/contracts/investigationExamples.js +0 -6
- package/dist/contracts/javascriptApplicationWorkflowExamples.js +46 -0
- package/dist/contracts/javascriptRuntimeReconciliationExample.js +208 -0
- package/dist/contracts/managedToolContracts.js +153 -0
- package/dist/contracts/managedWorkflowExamples.js +346 -0
- package/dist/contracts/managedWorkflowToolContracts.js +203 -0
- package/dist/contracts/nativeToolContracts.js +2 -6
- package/dist/contracts/promptContracts.js +18 -2
- package/dist/contracts/providerSelection.js +2 -0
- package/dist/contracts/toolContractExamples.js +10 -25
- package/dist/contracts/toolContracts.js +49 -47
- package/dist/contracts/toolEffects.js +174 -0
- package/dist/contracts/toolOutputSchemaGroups.js +232 -0
- package/dist/contracts/toolOutputSchemaPrimitives.js +327 -0
- package/dist/contracts/toolOutputSchemas.js +2 -535
- package/dist/doctorRuntime.js +42 -1
- package/dist/domain/analysisErrorPresentation.js +234 -0
- package/dist/domain/analysisErrorProjection.js +284 -0
- package/dist/domain/artifactComparison.js +37 -19
- package/dist/domain/binaryTarget.js +87 -37
- package/dist/domain/browserObservation.js +1 -282
- package/dist/domain/browserObservationSchemas.js +286 -0
- package/dist/domain/bundleComparison.js +4 -4
- package/dist/domain/electronObservation.js +13 -0
- package/dist/domain/electronStaticAnalysis.js +9 -0
- package/dist/domain/electronStaticAnalysisBrowser.js +206 -0
- package/dist/domain/electronStaticAnalysisIpc.js +171 -0
- package/dist/domain/electronStaticAnalysisNative.js +164 -0
- package/dist/domain/electronStaticAnalysisTypes.js +1 -0
- package/dist/domain/electronStaticAnalysisValues.js +103 -0
- package/dist/domain/errors.js +32 -448
- package/dist/domain/functionComparison.js +4 -165
- package/dist/domain/functionComparisonDimensions.js +164 -0
- package/dist/domain/functionComparisonSchemas.js +3 -8
- package/dist/domain/inputIssueProjection.js +52 -0
- package/dist/domain/javascriptApplicationAnalysis.js +155 -0
- package/dist/domain/javascriptApplicationChangeGraph.js +231 -0
- package/dist/domain/javascriptApplicationEvidenceSchemas.js +18 -0
- package/dist/domain/javascriptApplicationGraph.js +2 -1
- package/dist/domain/javascriptApplicationGraphSchemas.js +7 -0
- package/dist/domain/javascriptApplicationVersionComparison.js +116 -0
- package/dist/domain/javascriptApplicationVersionComparisonSchemas.js +139 -0
- package/dist/domain/javascriptApplicationVersionItems.js +233 -0
- package/dist/domain/javascriptApplicationVersionKeys.js +170 -0
- package/dist/domain/javascriptExportInstrumentation.js +97 -0
- package/dist/domain/javascriptFeatureSeed.js +140 -0
- package/dist/domain/javascriptFeatureTrace.js +232 -0
- package/dist/domain/javascriptFeatureTraceSchemas.js +136 -0
- package/dist/domain/javascriptFeatureTraversal.js +100 -0
- package/dist/domain/javascriptNativeHandoff.js +85 -0
- package/dist/domain/javascriptReplay.js +361 -0
- package/dist/domain/javascriptRuntimeLoadState.js +106 -0
- package/dist/domain/javascriptRuntimeReconciliation.js +42 -0
- package/dist/domain/javascriptRuntimeReconciliationGraph.js +169 -0
- package/dist/domain/javascriptRuntimeReconciliationMatching.js +247 -0
- package/dist/domain/javascriptRuntimeReconciliationParsing.js +160 -0
- package/dist/domain/javascriptRuntimeReconciliationResult.js +119 -0
- package/dist/domain/javascriptRuntimeReconciliationRuntime.js +316 -0
- package/dist/domain/javascriptRuntimeReconciliationSchemas.js +245 -0
- package/dist/domain/javascriptRuntimeStaticCandidates.js +193 -0
- 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 +26 -254
- package/dist/domain/javascriptStaticAnalysisBundler.js +209 -0
- package/dist/domain/javascriptStaticAnalysisCalls.js +180 -0
- package/dist/domain/javascriptStaticAnalysisFindings.js +39 -0
- package/dist/domain/javascriptStaticAnalysisHelpers.js +81 -2
- package/dist/domain/javascriptStaticAnalysisState.js +6 -0
- package/dist/domain/knownPageCoverage.js +21 -0
- package/dist/domain/managedApplicationGraph.js +206 -0
- 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 +452 -0
- package/dist/domain/managedMemberComparison.js +211 -0
- package/dist/domain/managedMemberComparisonCoverage.js +72 -0
- package/dist/domain/managedMemberComparisonMatch.js +356 -0
- package/dist/domain/managedNativeVerification.js +46 -0
- package/dist/domain/managedNativeVerificationMatch.js +272 -0
- package/dist/domain/managedNativeVerificationSchemas.js +141 -0
- package/dist/domain/managedReconstruction.js +196 -0
- package/dist/domain/managedRuntimeCorrelation.js +184 -0
- package/dist/domain/nodeRuntimeCharacterization.js +66 -0
- package/dist/domain/permissionPolicy.js +2 -0
- package/dist/domain/reconstructionCoverage.js +387 -0
- package/dist/domain/reconstructionCoverageEvaluation.js +212 -0
- package/dist/domain/reconstructionVerificationSchemas.js +9 -3
- package/dist/domain/runtimeCharacterization.js +85 -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 +339 -0
- package/dist/dotnet/ManagedMemberInspector.js +153 -0
- package/dist/dotnet/ManagedMemberInspectorCore.js +297 -0
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +427 -0
- package/dist/dotnet/ManagedMemberRows.js +120 -0
- package/dist/dotnet/ManagedMetadataHeaps.js +131 -0
- package/dist/dotnet/ManagedMetadataInventory.js +104 -0
- package/dist/dotnet/ManagedMetadataInventoryRows.js +292 -0
- package/dist/dotnet/ManagedMetadataLayout.js +259 -0
- 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 +143 -0
- package/dist/dotnet/ManagedPeReader.js +188 -0
- package/dist/dotnet/ManagedReaderFailure.js +10 -0
- package/dist/dotnet/ManagedStaticProvider.js +203 -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 +67 -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 +3 -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 -132
- 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 +300 -0
- package/dist/replay/LinuxJavaScriptReplayRunner.js +217 -0
- package/dist/replay/LinuxJavaScriptReplaySandbox.js +140 -0
- package/dist/replay/LinuxRuntimeClosure.js +46 -0
- package/dist/replay/LinuxSeccompPolicy.js +40 -0
- package/dist/replay/ReplayOutcome.js +95 -0
- package/dist/replay/ReplayProcessLifecycle.js +71 -0
- package/dist/replay/ReplayWorkerProtocol.js +55 -0
- package/dist/replay/SystemJavaScriptReplayHost.js +182 -0
- package/dist/server/ProcessCaptureElicitation.js +157 -0
- package/dist/server/createServer.js +158 -41
- 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 +13 -0
- package/dist/server/registerArtifactComparisonTool.js +16 -9
- package/dist/server/registerBrowserTools.js +61 -60
- package/dist/server/registerBundleComparisonTool.js +17 -20
- package/dist/server/registerElectronTools.js +39 -12
- package/dist/server/registerEnhancedTools.js +52 -15
- package/dist/server/registerEvidenceResources.js +54 -0
- package/dist/server/registerEvidenceTools.js +5 -1
- package/dist/server/registerFunctionComparisonTool.js +14 -7
- package/dist/server/registerInvestigationTools/helpers.js +74 -0
- package/dist/server/registerInvestigationTools/types.js +1 -0
- package/dist/server/registerInvestigationTools.js +103 -132
- package/dist/server/registerManagedTools.js +6 -0
- 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 +13 -0
- package/dist/server/registerOfficialTools.js +81 -67
- package/dist/server/registerProcessComparisonTool.js +25 -47
- package/dist/server/registerSessionRecordTools.js +137 -0
- package/dist/server/registerSessionStatusTool.js +9 -8
- package/dist/server/registerSessionTools.js +77 -216
- package/dist/server/sessionAvailabilityPolicy.js +10 -0
- package/dist/server/sessionEvidence.js +14 -19
- package/dist/server/toolInputValidation.js +77 -0
- package/dist/server/toolRegistrationOptions.js +177 -2
- package/dist/server/toolResult.js +30 -17
- package/package.json +21 -14
- package/scripts/rea.mjs +1 -1
- package/skills/{rea-analysis → reverse-engineer-anything}/SKILL.md +75 -6
- package/scripts/prepare-node-pty.mjs +0 -35
- package/scripts/rebuild-native.mjs +0 -22
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
const effects = (overrides = {}) => ({
|
|
2
|
+
mutatesTarget: false,
|
|
3
|
+
mutatesSession: false,
|
|
4
|
+
writesFilesystem: false,
|
|
5
|
+
launchesProcess: false,
|
|
6
|
+
accessesNetwork: false,
|
|
7
|
+
changesUiState: false,
|
|
8
|
+
mayDiscardData: false,
|
|
9
|
+
idempotent: true,
|
|
10
|
+
...overrides,
|
|
11
|
+
});
|
|
12
|
+
const evidence = effects({ mutatesSession: true });
|
|
13
|
+
const nativeEvidence = effects({ mutatesSession: true, launchesProcess: true });
|
|
14
|
+
const browserEvidence = effects({
|
|
15
|
+
mutatesSession: true,
|
|
16
|
+
accessesNetwork: true,
|
|
17
|
+
});
|
|
18
|
+
const sessionEvidence = effects({ mutatesSession: true });
|
|
19
|
+
/** Explicit effect audit for every public tool. */
|
|
20
|
+
export const TOOL_EFFECTS = {
|
|
21
|
+
address_name: evidence,
|
|
22
|
+
comment: evidence,
|
|
23
|
+
current_address: evidence,
|
|
24
|
+
current_procedure: evidence,
|
|
25
|
+
current_document: evidence,
|
|
26
|
+
goto_address: effects({ mutatesSession: true, changesUiState: true }),
|
|
27
|
+
inline_comment: evidence,
|
|
28
|
+
list_bookmarks: evidence,
|
|
29
|
+
list_documents: evidence,
|
|
30
|
+
list_names: evidence,
|
|
31
|
+
list_procedures: evidence,
|
|
32
|
+
list_segments: evidence,
|
|
33
|
+
list_strings: evidence,
|
|
34
|
+
next_address: evidence,
|
|
35
|
+
prev_address: evidence,
|
|
36
|
+
procedure_address: evidence,
|
|
37
|
+
procedure_assembly: evidence,
|
|
38
|
+
procedure_callees: evidence,
|
|
39
|
+
procedure_callers: evidence,
|
|
40
|
+
procedure_info: evidence,
|
|
41
|
+
procedure_references: evidence,
|
|
42
|
+
procedure_pseudo_code: evidence,
|
|
43
|
+
resolve_containing_procedure: evidence,
|
|
44
|
+
search_procedures: evidence,
|
|
45
|
+
search_strings: evidence,
|
|
46
|
+
set_address_name: effects({ mutatesTarget: true, mutatesSession: true }),
|
|
47
|
+
set_addresses_names: effects({ mutatesTarget: true, mutatesSession: true }),
|
|
48
|
+
set_bookmark: effects({ mutatesTarget: true, mutatesSession: true }),
|
|
49
|
+
set_comment: effects({ mutatesTarget: true, mutatesSession: true }),
|
|
50
|
+
set_current_document: effects({ mutatesSession: true, changesUiState: true }),
|
|
51
|
+
set_inline_comment: effects({ mutatesTarget: true, mutatesSession: true }),
|
|
52
|
+
unset_bookmark: effects({
|
|
53
|
+
mutatesTarget: true,
|
|
54
|
+
mutatesSession: true,
|
|
55
|
+
mayDiscardData: true,
|
|
56
|
+
}),
|
|
57
|
+
xrefs: evidence,
|
|
58
|
+
swift_classes: evidence,
|
|
59
|
+
get_objc_classes: evidence,
|
|
60
|
+
get_objc_protocols: evidence,
|
|
61
|
+
batch_decompile: evidence,
|
|
62
|
+
get_call_graph: evidence,
|
|
63
|
+
analyze_swift_types: evidence,
|
|
64
|
+
find_xrefs_to_name: evidence,
|
|
65
|
+
binary_overview: evidence,
|
|
66
|
+
analyze_function: evidence,
|
|
67
|
+
trace_feature: effects({ mutatesSession: true, idempotent: false }),
|
|
68
|
+
inspect_macho: nativeEvidence,
|
|
69
|
+
inspect_signature: nativeEvidence,
|
|
70
|
+
inspect_plist: nativeEvidence,
|
|
71
|
+
list_architectures: nativeEvidence,
|
|
72
|
+
demangle_swift: nativeEvidence,
|
|
73
|
+
inventory_artifact: evidence,
|
|
74
|
+
extract_artifact: effects({ mutatesSession: true, writesFilesystem: true }),
|
|
75
|
+
inspect_managed_artifact: evidence,
|
|
76
|
+
inspect_managed_members: evidence,
|
|
77
|
+
inspect_managed_native_boundaries: evidence,
|
|
78
|
+
compare_managed_members: sessionEvidence,
|
|
79
|
+
verify_managed_native_boundaries: sessionEvidence,
|
|
80
|
+
import_managed_reconstruction: sessionEvidence,
|
|
81
|
+
plan_managed_runtime_correlation: sessionEvidence,
|
|
82
|
+
project_managed_application_graph: sessionEvidence,
|
|
83
|
+
list_browser_targets: browserEvidence,
|
|
84
|
+
inspect_web_page: browserEvidence,
|
|
85
|
+
analyze_web_bundle: browserEvidence,
|
|
86
|
+
observe_web_session: browserEvidence,
|
|
87
|
+
discover_webmcp_tools: browserEvidence,
|
|
88
|
+
compare_web_captures: browserEvidence,
|
|
89
|
+
capture_web_screenshot: browserEvidence,
|
|
90
|
+
compare_web_screenshots: browserEvidence,
|
|
91
|
+
list_electron_targets: browserEvidence,
|
|
92
|
+
inspect_electron_page: browserEvidence,
|
|
93
|
+
analyze_javascript_application: evidence,
|
|
94
|
+
reconcile_javascript_runtime: evidence,
|
|
95
|
+
trace_application_feature: evidence,
|
|
96
|
+
compare_application_versions: evidence,
|
|
97
|
+
run_controlled_replay: effects({
|
|
98
|
+
mutatesSession: true,
|
|
99
|
+
writesFilesystem: true,
|
|
100
|
+
launchesProcess: true,
|
|
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 }),
|
|
116
|
+
open_binary: effects({ mutatesSession: true, launchesProcess: true }),
|
|
117
|
+
close_binary: effects({
|
|
118
|
+
mutatesSession: true,
|
|
119
|
+
writesFilesystem: true,
|
|
120
|
+
mayDiscardData: true,
|
|
121
|
+
idempotent: false,
|
|
122
|
+
}),
|
|
123
|
+
binary_session: effects(),
|
|
124
|
+
export_evidence_bundle: effects({
|
|
125
|
+
writesFilesystem: true,
|
|
126
|
+
mayDiscardData: true,
|
|
127
|
+
}),
|
|
128
|
+
import_evidence_bundle: effects({ mutatesSession: true }),
|
|
129
|
+
capture_process_scenario: effects({
|
|
130
|
+
mutatesSession: true,
|
|
131
|
+
writesFilesystem: true,
|
|
132
|
+
launchesProcess: true,
|
|
133
|
+
idempotent: false,
|
|
134
|
+
}),
|
|
135
|
+
compare_process_captures: sessionEvidence,
|
|
136
|
+
compare_artifacts: sessionEvidence,
|
|
137
|
+
compare_functions: sessionEvidence,
|
|
138
|
+
compare_bundles: effects({ mutatesSession: true }),
|
|
139
|
+
find_changed_behavior: sessionEvidence,
|
|
140
|
+
build_call_path: sessionEvidence,
|
|
141
|
+
correlate_static_and_runtime: sessionEvidence,
|
|
142
|
+
verify_reconstruction: sessionEvidence,
|
|
143
|
+
list_unknowns: effects(),
|
|
144
|
+
record_unknown: effects({ mutatesSession: true, idempotent: false }),
|
|
145
|
+
update_unknown: effects({ mutatesSession: true, idempotent: false }),
|
|
146
|
+
verify_unknown_resolution: effects(),
|
|
147
|
+
};
|
|
148
|
+
/** Derive MCP annotations without tool-name or tool-family heuristics. */
|
|
149
|
+
export const annotationsFromEffects = (value) => ({
|
|
150
|
+
readOnlyHint: !(value.mutatesTarget ||
|
|
151
|
+
value.mutatesSession ||
|
|
152
|
+
value.writesFilesystem ||
|
|
153
|
+
value.launchesProcess ||
|
|
154
|
+
value.accessesNetwork ||
|
|
155
|
+
value.changesUiState ||
|
|
156
|
+
value.mayDiscardData),
|
|
157
|
+
destructiveHint: value.mayDiscardData,
|
|
158
|
+
idempotentHint: value.idempotent,
|
|
159
|
+
openWorldHint: value.launchesProcess || value.accessesNetwork,
|
|
160
|
+
});
|
|
161
|
+
/** Resolve the audited metadata for one public tool. */
|
|
162
|
+
export const toolContractMetadata = (name) => {
|
|
163
|
+
const audited = TOOL_EFFECTS[name];
|
|
164
|
+
if (audited === undefined)
|
|
165
|
+
throw new Error(`Missing effect audit for ${name}`);
|
|
166
|
+
return {
|
|
167
|
+
title: name
|
|
168
|
+
.split("_")
|
|
169
|
+
.map((word) => word[0]?.toUpperCase() + word.slice(1))
|
|
170
|
+
.join(" "),
|
|
171
|
+
effects: audited,
|
|
172
|
+
annotations: annotationsFromEffects(audited),
|
|
173
|
+
};
|
|
174
|
+
};
|
|
@@ -0,0 +1,232 @@
|
|
|
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, 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
|
+
sessionProvider.extend({ open: z.literal(false) }),
|
|
194
|
+
sessionProvider.extend({
|
|
195
|
+
open: z.literal(true),
|
|
196
|
+
path: z.string(),
|
|
197
|
+
format: targetFormatSchema,
|
|
198
|
+
kind: targetKindSchema,
|
|
199
|
+
sha256: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
200
|
+
architecture: z.enum(["x86", "x86_64", "arm", "arm64"]).nullable(),
|
|
201
|
+
}),
|
|
202
|
+
])),
|
|
203
|
+
export_evidence_bundle: lifecycleResultOf(z.union([
|
|
204
|
+
evidenceBundleSchema,
|
|
205
|
+
z.object({
|
|
206
|
+
path: z.string(),
|
|
207
|
+
bytes: z.number().int().min(0),
|
|
208
|
+
records: z.number().int().min(0),
|
|
209
|
+
}),
|
|
210
|
+
])),
|
|
211
|
+
import_evidence_bundle: lifecycleResultOf(z.object({
|
|
212
|
+
imported: z.number().int().min(0),
|
|
213
|
+
total: z.number().int().min(0),
|
|
214
|
+
})),
|
|
215
|
+
capture_process_scenario: resultOf(processCaptureSchema),
|
|
216
|
+
compare_process_captures: resultOf(processCaptureComparisonSchema),
|
|
217
|
+
compare_artifacts: resultOf(artifactComparisonResultSchema),
|
|
218
|
+
compare_functions: resultOf(functionComparisonResultSchema),
|
|
219
|
+
compare_bundles: resultOf(bundleComparisonResultSchema),
|
|
220
|
+
find_changed_behavior: resultOf(changedBehaviorResultSchema),
|
|
221
|
+
build_call_path: resultOf(callPathResultSchema),
|
|
222
|
+
correlate_static_and_runtime: resultOf(staticRuntimeCorrelationResultSchema),
|
|
223
|
+
verify_reconstruction: resultOf(reconstructionVerificationResultSchema),
|
|
224
|
+
list_unknowns: lifecycleResultOf(z.array(residualUnknownSchema)),
|
|
225
|
+
record_unknown: lifecycleResultOf(residualUnknownSchema),
|
|
226
|
+
update_unknown: lifecycleResultOf(residualUnknownSchema),
|
|
227
|
+
verify_unknown_resolution: lifecycleResultOf(z.object({
|
|
228
|
+
valid: z.boolean(),
|
|
229
|
+
truthVerified: z.boolean(),
|
|
230
|
+
unknown: residualUnknownSchema,
|
|
231
|
+
})),
|
|
232
|
+
};
|