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,75 @@
|
|
|
1
|
+
/** Project internal provider routing state into the caller-visible session status. */
|
|
2
|
+
export const binarySessionStatus = ({ target, route, router, runtimeAvailability, }) => {
|
|
3
|
+
const configuredProvider = router.configuredIdentity();
|
|
4
|
+
const provider = providerSummary(configuredProvider);
|
|
5
|
+
const providers = router.providerIdentities(route).map(providerSummary);
|
|
6
|
+
const capabilities = [...(route.capabilities?.values() ?? [])]
|
|
7
|
+
.sort((left, right) => left.operation.localeCompare(right.operation))
|
|
8
|
+
.map((descriptor) => ({
|
|
9
|
+
...descriptor,
|
|
10
|
+
...runtimeAvailability.get(descriptor.operation),
|
|
11
|
+
}))
|
|
12
|
+
.map(capabilityStatus);
|
|
13
|
+
const analysisProviderBinding = route.binding === null
|
|
14
|
+
? null
|
|
15
|
+
: {
|
|
16
|
+
provider: providerSummary(route.binding.identity),
|
|
17
|
+
selection_source: route.binding.selectionSource,
|
|
18
|
+
analysis_profile: structuredClone(route.binding.profile),
|
|
19
|
+
};
|
|
20
|
+
const analysisProviderCandidates = router
|
|
21
|
+
.candidateStatuses(route)
|
|
22
|
+
.map((candidate) => ({
|
|
23
|
+
provider: providerSummary(candidate.provider),
|
|
24
|
+
availability: structuredClone(candidate.availability),
|
|
25
|
+
target_support: structuredClone(candidate.targetSupport),
|
|
26
|
+
selected: candidate.selected,
|
|
27
|
+
capabilities: candidate.capabilities
|
|
28
|
+
.slice()
|
|
29
|
+
.sort((left, right) => left.operation.localeCompare(right.operation))
|
|
30
|
+
.map(capabilityStatus),
|
|
31
|
+
}));
|
|
32
|
+
const common = {
|
|
33
|
+
provider,
|
|
34
|
+
providers,
|
|
35
|
+
capabilities,
|
|
36
|
+
analysis_provider_binding: analysisProviderBinding,
|
|
37
|
+
analysis_provider_candidates: analysisProviderCandidates,
|
|
38
|
+
};
|
|
39
|
+
return target === undefined
|
|
40
|
+
? { open: false, ...common }
|
|
41
|
+
: {
|
|
42
|
+
open: true,
|
|
43
|
+
...common,
|
|
44
|
+
path: target.path,
|
|
45
|
+
sha256: target.sha256,
|
|
46
|
+
format: target.format,
|
|
47
|
+
kind: target.kind,
|
|
48
|
+
architecture: target.architecture ?? null,
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
const providerSummary = ({ id, name, version, }) => ({ id, name, version });
|
|
52
|
+
const capabilityStatus = (descriptor) => ({
|
|
53
|
+
operation: descriptor.operation,
|
|
54
|
+
available: descriptor.available,
|
|
55
|
+
reason: descriptor.reason,
|
|
56
|
+
input_contract_version: descriptor.inputContractVersion,
|
|
57
|
+
output_contract_version: descriptor.outputContractVersion,
|
|
58
|
+
pagination: descriptor.pagination,
|
|
59
|
+
exhaustive: descriptor.exhaustive,
|
|
60
|
+
effects: {
|
|
61
|
+
mutates_artifact: descriptor.effects.mutatesArtifact,
|
|
62
|
+
launches_process: descriptor.effects.launchesProcess,
|
|
63
|
+
may_show_ui: descriptor.effects.mayShowUi,
|
|
64
|
+
may_access_network: descriptor.effects.mayAccessNetwork,
|
|
65
|
+
may_write_filesystem: descriptor.effects.mayWriteFilesystem,
|
|
66
|
+
changes_permissions: descriptor.effects.changesPermissions,
|
|
67
|
+
requires_root: descriptor.effects.requiresRoot,
|
|
68
|
+
},
|
|
69
|
+
limits: {
|
|
70
|
+
max_results: descriptor.limits.maxResults,
|
|
71
|
+
max_payload_bytes: descriptor.limits.maxPayloadBytes,
|
|
72
|
+
timeout_ms: descriptor.limits.timeoutMs,
|
|
73
|
+
},
|
|
74
|
+
limitations: [...descriptor.limitations],
|
|
75
|
+
});
|
|
@@ -37,13 +37,21 @@ export const buildCapabilityInventory = (sessionStatus, policy) => {
|
|
|
37
37
|
const status = statusSchema.parse(sessionStatus);
|
|
38
38
|
const descriptors = new Map(status.capabilities.map((descriptor) => [descriptor.operation, descriptor]));
|
|
39
39
|
return TOOL_CONTRACTS.map((contract) => {
|
|
40
|
-
const availability = availabilityFor(
|
|
40
|
+
const availability = availabilityFor({
|
|
41
|
+
name: contract.name,
|
|
42
|
+
kind: contract.kind,
|
|
43
|
+
targetOpen: status.open,
|
|
44
|
+
targetKind: status.kind,
|
|
45
|
+
descriptors,
|
|
46
|
+
policy,
|
|
47
|
+
});
|
|
41
48
|
return {
|
|
42
49
|
name: contract.name,
|
|
43
50
|
surface: contract.kind,
|
|
44
51
|
available: availability.reason === "available",
|
|
45
52
|
reason: availability.reason,
|
|
46
53
|
remediation: availability.remediation,
|
|
54
|
+
effects: { ...contract.effects },
|
|
47
55
|
annotations: {
|
|
48
56
|
read_only: contract.annotations.readOnlyHint ?? false,
|
|
49
57
|
destructive: contract.annotations.destructiveHint ?? false,
|
|
@@ -53,12 +61,38 @@ export const buildCapabilityInventory = (sessionStatus, policy) => {
|
|
|
53
61
|
};
|
|
54
62
|
}).sort((left, right) => left.name.localeCompare(right.name));
|
|
55
63
|
};
|
|
56
|
-
const availabilityFor = (
|
|
64
|
+
const availabilityFor = (context) => {
|
|
65
|
+
const policyDecision = policyAvailability(context);
|
|
66
|
+
if (policyDecision !== null)
|
|
67
|
+
return policyDecision;
|
|
68
|
+
const targetDecision = targetAvailability(context);
|
|
69
|
+
if (targetDecision !== null)
|
|
70
|
+
return targetDecision;
|
|
71
|
+
return providerAvailability(context);
|
|
72
|
+
};
|
|
73
|
+
const policyAvailability = ({ name, kind, policy, }) => {
|
|
57
74
|
if (name === "capture_process_scenario" && !policy.processCaptureEnabled)
|
|
58
75
|
return {
|
|
59
76
|
reason: "policy_disabled",
|
|
60
77
|
remediation: "Enable or grant process_capture within the administrator ceiling.",
|
|
61
78
|
};
|
|
79
|
+
if (name === "run_controlled_replay" && !policy.javascriptReplayEnabled)
|
|
80
|
+
return {
|
|
81
|
+
reason: "policy_disabled",
|
|
82
|
+
remediation: "Enable javascript_replay with exact source roots and sandbox executables.",
|
|
83
|
+
};
|
|
84
|
+
if (name === "run_controlled_replay")
|
|
85
|
+
return { reason: "available", remediation: null };
|
|
86
|
+
if (name === "plan_managed_runtime_correlation" &&
|
|
87
|
+
!policy.managedRuntimeEnabled)
|
|
88
|
+
return {
|
|
89
|
+
reason: "policy_disabled",
|
|
90
|
+
remediation: "Enable managed_runtime with exact artifact roots and a runtime executable.",
|
|
91
|
+
};
|
|
92
|
+
if (name === "plan_managed_runtime_correlation")
|
|
93
|
+
return { reason: "available", remediation: null };
|
|
94
|
+
if (kind === "application")
|
|
95
|
+
return { reason: "available", remediation: null };
|
|
62
96
|
if (name === "import_evidence_bundle" && policy.evidenceFileRoots === 0)
|
|
63
97
|
return {
|
|
64
98
|
reason: "policy_disabled",
|
|
@@ -80,6 +114,9 @@ const availabilityFor = (name, kind, targetOpen, targetKind, descriptors, policy
|
|
|
80
114
|
};
|
|
81
115
|
if (kind === "session")
|
|
82
116
|
return { reason: "available", remediation: null };
|
|
117
|
+
return null;
|
|
118
|
+
};
|
|
119
|
+
const targetAvailability = ({ kind, targetKind, targetOpen, }) => {
|
|
83
120
|
if (!targetOpen)
|
|
84
121
|
return {
|
|
85
122
|
reason: "target_required",
|
|
@@ -93,6 +130,9 @@ const availabilityFor = (name, kind, targetOpen, targetKind, descriptors, policy
|
|
|
93
130
|
reason: "target_unsupported",
|
|
94
131
|
remediation: "Inventory or extract a native executable, then call open_binary on that executable.",
|
|
95
132
|
};
|
|
133
|
+
return null;
|
|
134
|
+
};
|
|
135
|
+
const providerAvailability = ({ descriptors, kind, name, }) => {
|
|
96
136
|
if (kind === "enhanced")
|
|
97
137
|
return composedAvailability(name, descriptors);
|
|
98
138
|
const descriptor = descriptors.get(name);
|
|
@@ -39,7 +39,7 @@ const registrationAligned = (command, currentCommandPath) => {
|
|
|
39
39
|
if (command.length === 4 &&
|
|
40
40
|
command[0] === "npx" &&
|
|
41
41
|
command[1] === "-y" &&
|
|
42
|
-
command[2] === PRODUCT_IDENTITY.
|
|
42
|
+
command[2] === PRODUCT_IDENTITY.packageSpecifier &&
|
|
43
43
|
command[3] === "mcp")
|
|
44
44
|
return true;
|
|
45
45
|
return (command.length === 2 &&
|
|
@@ -10,8 +10,14 @@ export const AUTOMATIC_RUN_LIMITATION = "Automatic cross-version runs compare sh
|
|
|
10
10
|
/** Start both independent version scans while preserving left/right identity. */
|
|
11
11
|
export const scanVersionInventories = async (options, scanner = scanAuthorizedArtifactInventory) => {
|
|
12
12
|
const [left, right] = await Promise.all([
|
|
13
|
-
scanner(options.leftPath, options.inputRoots, options.limits,
|
|
14
|
-
|
|
13
|
+
scanner(options.leftPath, options.inputRoots, options.limits, {
|
|
14
|
+
signal: options.signal,
|
|
15
|
+
integrity: options.integrity,
|
|
16
|
+
}),
|
|
17
|
+
scanner(options.rightPath, options.inputRoots, options.limits, {
|
|
18
|
+
signal: options.signal,
|
|
19
|
+
integrity: options.integrity,
|
|
20
|
+
}),
|
|
15
21
|
]);
|
|
16
22
|
return { left, right };
|
|
17
23
|
};
|
|
@@ -7,6 +7,7 @@ import { createInventoryEvidencePages, runLimitations, scanVersions, targetFor,
|
|
|
7
7
|
import { readInvestigationWorkspace, writeInvestigationWorkspace, } from "./InvestigationWorkspaceStore.js";
|
|
8
8
|
import { createArtifactComparisonEvidence, createChangedBehaviorEvidence, } from "./CrossVersionInvestigationEvidence.js";
|
|
9
9
|
import { selectCompletedInvestigationReplay } from "./CrossVersionInvestigationReplay.js";
|
|
10
|
+
import { investigationEvidenceIds as evidenceIds, mergeInvestigationEvidence as mergeEvidence, recordsForInvestigationRun as recordsForRun, replaceInvestigationRun as replaceRun, } from "./CrossVersionInvestigationCollections.js";
|
|
10
11
|
/** Run or resume a deterministic cross-version artifact investigation. */
|
|
11
12
|
export const runCrossVersionInvestigation = async (input, policy, execution) => {
|
|
12
13
|
const parsed = crossVersionInvestigationInputSchema.safeParse(input);
|
|
@@ -14,16 +15,20 @@ export const runCrossVersionInvestigation = async (input, policy, execution) =>
|
|
|
14
15
|
return err(new AnalysisInputError("find_changed_behavior", {
|
|
15
16
|
cause: parsed.error,
|
|
16
17
|
}));
|
|
17
|
-
|
|
18
|
+
return runCrossVersionInvestigationValidated(parsed.data, policy, execution);
|
|
19
|
+
};
|
|
20
|
+
/** Run input already parsed by a trusted adapter boundary. */
|
|
21
|
+
export const runCrossVersionInvestigationValidated = async (input, policy, execution) => {
|
|
22
|
+
const initial = await readInvestigationWorkspace(input.workspace_path, policy);
|
|
18
23
|
if (!initial.ok)
|
|
19
24
|
return initial;
|
|
20
|
-
const preflight = validateWorkspaceRequest(initial.value,
|
|
25
|
+
const preflight = validateWorkspaceRequest(initial.value, input);
|
|
21
26
|
if (!preflight.ok)
|
|
22
27
|
return preflight;
|
|
23
28
|
if (isCancelled(execution.signal))
|
|
24
29
|
return err(new AnalysisCancelledError("find_changed_behavior"));
|
|
25
|
-
if (
|
|
26
|
-
const replay = selectCompletedInvestigationReplay(initial.value,
|
|
30
|
+
if (input.replay_run_id !== undefined) {
|
|
31
|
+
const replay = selectCompletedInvestigationReplay(initial.value, input);
|
|
27
32
|
if (!replay.ok)
|
|
28
33
|
return replay;
|
|
29
34
|
return completeOutcome(replay.value.workspace, replay.value.run, true, execution.session);
|
|
@@ -39,7 +44,7 @@ export const runCrossVersionInvestigation = async (input, policy, execution) =>
|
|
|
39
44
|
total: 4,
|
|
40
45
|
message: "Scanning both version inputs",
|
|
41
46
|
});
|
|
42
|
-
const snapshots = await scanVersions(
|
|
47
|
+
const snapshots = await scanVersions(input, execution.inputRoots, execution.signal, execution.integrityContinueEnabled);
|
|
43
48
|
if (!snapshots.ok)
|
|
44
49
|
return snapshots;
|
|
45
50
|
await execution.progress?.report({
|
|
@@ -49,7 +54,7 @@ export const runCrossVersionInvestigation = async (input, policy, execution) =>
|
|
|
49
54
|
message: "Version inputs scanned",
|
|
50
55
|
});
|
|
51
56
|
return continueInvestigation({
|
|
52
|
-
input
|
|
57
|
+
input,
|
|
53
58
|
initial: initial.value,
|
|
54
59
|
snapshots: snapshots.value,
|
|
55
60
|
policy,
|
|
@@ -294,26 +299,3 @@ const inventoryEvidence = (workspace, run) => {
|
|
|
294
299
|
? ok({ left, right })
|
|
295
300
|
: err(new EvidenceIntegrityError("Investigation inventory checkpoint is incomplete"));
|
|
296
301
|
};
|
|
297
|
-
const recordsForRun = (workspace, run) => {
|
|
298
|
-
const ids = new Set([
|
|
299
|
-
...run.left_inventory_evidence_ids,
|
|
300
|
-
...run.right_inventory_evidence_ids,
|
|
301
|
-
...(run.comparison_evidence_id === null
|
|
302
|
-
? []
|
|
303
|
-
: [run.comparison_evidence_id]),
|
|
304
|
-
...(run.result_evidence_id === null ? [] : [run.result_evidence_id]),
|
|
305
|
-
]);
|
|
306
|
-
return workspace.bundle.records.filter(({ evidence_id: id }) => ids.has(id));
|
|
307
|
-
};
|
|
308
|
-
const mergeEvidence = (current, additions) => {
|
|
309
|
-
const records = new Map(current.map((record) => [record.evidence_id, record]));
|
|
310
|
-
for (const record of additions)
|
|
311
|
-
if (!records.has(record.evidence_id))
|
|
312
|
-
records.set(record.evidence_id, record);
|
|
313
|
-
return [...records.values()];
|
|
314
|
-
};
|
|
315
|
-
const replaceRun = (runs, replacement) => [
|
|
316
|
-
...runs.filter(({ run_id: id }) => id !== replacement.run_id),
|
|
317
|
-
replacement,
|
|
318
|
-
];
|
|
319
|
-
const evidenceIds = (records) => records.map(({ evidence_id: id }) => id);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export const recordsForInvestigationRun = (workspace, run) => {
|
|
2
|
+
const ids = new Set([
|
|
3
|
+
...run.left_inventory_evidence_ids,
|
|
4
|
+
...run.right_inventory_evidence_ids,
|
|
5
|
+
...(run.comparison_evidence_id === null
|
|
6
|
+
? []
|
|
7
|
+
: [run.comparison_evidence_id]),
|
|
8
|
+
...(run.result_evidence_id === null ? [] : [run.result_evidence_id]),
|
|
9
|
+
]);
|
|
10
|
+
return workspace.bundle.records.filter(({ evidence_id: id }) => ids.has(id));
|
|
11
|
+
};
|
|
12
|
+
export const mergeInvestigationEvidence = (current, additions) => {
|
|
13
|
+
const records = new Map(current.map((record) => [record.evidence_id, record]));
|
|
14
|
+
for (const record of additions)
|
|
15
|
+
if (!records.has(record.evidence_id))
|
|
16
|
+
records.set(record.evidence_id, record);
|
|
17
|
+
return [...records.values()];
|
|
18
|
+
};
|
|
19
|
+
export const replaceInvestigationRun = (runs, replacement) => [
|
|
20
|
+
...runs.filter(({ run_id: id }) => id !== replacement.run_id),
|
|
21
|
+
replacement,
|
|
22
|
+
];
|
|
23
|
+
export const investigationEvidenceIds = (records) => records.map(({ evidence_id: id }) => id);
|
|
@@ -31,7 +31,7 @@ export const runDirectAnalysis = async (path, tool, arguments_, options = {}) =>
|
|
|
31
31
|
: { permissionAuthority: options.permissionAuthority }),
|
|
32
32
|
}));
|
|
33
33
|
/** Execute one provider-native semantic operation with atomic provenance. */
|
|
34
|
-
export const runProviderAnalysis = async (path, tool, arguments_, logger = silentLogger, signal) => withProcessCancellation(signal, (operationSignal) => runAnalysis(path, tool, arguments_, {
|
|
34
|
+
export const runProviderAnalysis = async (...[path, tool, arguments_, logger = silentLogger, signal]) => withProcessCancellation(signal, (operationSignal) => runAnalysis(path, tool, arguments_, {
|
|
35
35
|
logger,
|
|
36
36
|
snapshotPath: undefined,
|
|
37
37
|
signal: operationSignal,
|
|
@@ -172,49 +172,14 @@ const runAnalysis = async (path, tool, arguments_, options) => {
|
|
|
172
172
|
const writable = await authorizeDeferredWrite(authorization.value);
|
|
173
173
|
if (!writable.ok)
|
|
174
174
|
return cliError(writable.error);
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
tool
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
else {
|
|
184
|
-
evidence = createEvidence(opened.value, tool === "analyze_function"
|
|
185
|
-
? session.providerIdentity(tool)
|
|
186
|
-
: REA_WORKFLOW_PROVIDER, {
|
|
187
|
-
operation: tool,
|
|
188
|
-
parameters: arguments_,
|
|
189
|
-
result: result.value,
|
|
190
|
-
...(evidenceProfile === undefined
|
|
191
|
-
? {}
|
|
192
|
-
: { analysisProfile: evidenceProfile }),
|
|
193
|
-
confidence: "derived",
|
|
194
|
-
limitations: ["Derived by an REA composed workflow."],
|
|
195
|
-
});
|
|
196
|
-
output = evidence;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
else {
|
|
200
|
-
const result = await session.execute(tool, arguments_, { signal });
|
|
201
|
-
if (!result.ok)
|
|
202
|
-
output = cliError(result.error);
|
|
203
|
-
else {
|
|
204
|
-
evidence = createEvidence(result.value.subject ?? opened.value, result.value.provider, {
|
|
205
|
-
operation: tool,
|
|
206
|
-
parameters: arguments_,
|
|
207
|
-
result: result.value.result,
|
|
208
|
-
...(result.value.analysisProfile === undefined
|
|
209
|
-
? {}
|
|
210
|
-
: { analysisProfile: result.value.analysisProfile }),
|
|
211
|
-
rawResult: result.value.rawResult,
|
|
212
|
-
limitations: result.value.limitations,
|
|
213
|
-
locations: result.value.locations,
|
|
214
|
-
});
|
|
215
|
-
output = evidence;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
175
|
+
const { output, evidence } = await executeAnalysisTool({
|
|
176
|
+
session,
|
|
177
|
+
openedTarget: opened.value,
|
|
178
|
+
tool,
|
|
179
|
+
arguments: arguments_,
|
|
180
|
+
signal,
|
|
181
|
+
evidenceProfile,
|
|
182
|
+
});
|
|
218
183
|
if (evidence !== undefined)
|
|
219
184
|
session.recordEvidence(evidence);
|
|
220
185
|
if (snapshotPath !== undefined && evidence !== undefined) {
|
|
@@ -231,6 +196,44 @@ const runAnalysis = async (path, tool, arguments_, options) => {
|
|
|
231
196
|
await session.close();
|
|
232
197
|
}
|
|
233
198
|
};
|
|
199
|
+
const executeAnalysisTool = async (input) => {
|
|
200
|
+
const { session, tool, signal, evidenceProfile } = input;
|
|
201
|
+
if (tool === "binary_overview" ||
|
|
202
|
+
tool === "analyze_function" ||
|
|
203
|
+
tool === "trace_feature") {
|
|
204
|
+
const result = await new EnhancedTools(session).execute(tool, input.arguments, signal);
|
|
205
|
+
if (!result.ok)
|
|
206
|
+
return { output: cliError(result.error) };
|
|
207
|
+
const evidence = createEvidence(input.openedTarget, tool === "analyze_function"
|
|
208
|
+
? session.providerIdentity(tool)
|
|
209
|
+
: REA_WORKFLOW_PROVIDER, {
|
|
210
|
+
operation: tool,
|
|
211
|
+
parameters: input.arguments,
|
|
212
|
+
result: result.value,
|
|
213
|
+
...(evidenceProfile === undefined
|
|
214
|
+
? {}
|
|
215
|
+
: { analysisProfile: evidenceProfile }),
|
|
216
|
+
confidence: "derived",
|
|
217
|
+
limitations: ["Derived by an REA composed workflow."],
|
|
218
|
+
});
|
|
219
|
+
return { output: evidence, evidence };
|
|
220
|
+
}
|
|
221
|
+
const result = await session.execute(tool, input.arguments, { signal });
|
|
222
|
+
if (!result.ok)
|
|
223
|
+
return { output: cliError(result.error) };
|
|
224
|
+
const evidence = createEvidence(result.value.subject ?? input.openedTarget, result.value.provider, {
|
|
225
|
+
operation: tool,
|
|
226
|
+
parameters: input.arguments,
|
|
227
|
+
result: result.value.result,
|
|
228
|
+
...(result.value.analysisProfile === undefined
|
|
229
|
+
? {}
|
|
230
|
+
: { analysisProfile: result.value.analysisProfile }),
|
|
231
|
+
rawResult: result.value.rawResult,
|
|
232
|
+
limitations: result.value.limitations,
|
|
233
|
+
locations: result.value.locations,
|
|
234
|
+
});
|
|
235
|
+
return { output: evidence, evidence };
|
|
236
|
+
};
|
|
234
237
|
const withProcessCancellation = async (suppliedSignal, operation) => {
|
|
235
238
|
if (suppliedSignal !== undefined)
|
|
236
239
|
return operation(suppliedSignal);
|