rea-agents 3.2.1 → 4.0.1
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 +183 -332
- package/bridge/ghidra/ReaGhidraBridge.java +561 -74
- package/bridge/hopper_bridge.py +70 -27
- package/bridge/native/ReaNativeUI.swift +157 -0
- package/dist/application/AnalysisContextQueries.js +19 -5
- package/dist/application/AnalysisSnapshotCache.js +30 -11
- package/dist/application/AppleAssetCatalogAnalysis.js +171 -0
- package/dist/application/ArtifactExtractionDestination.js +0 -12
- package/dist/application/ArtifactGraphConstruction.js +44 -11
- package/dist/application/ArtifactInventory/classify.js +7 -15
- package/dist/application/ArtifactInventory/hash.js +4 -2
- package/dist/application/ArtifactInventory/policy.js +2 -17
- package/dist/application/ArtifactInventory/reader.js +3 -3
- package/dist/application/ArtifactInventory/scanCanonical.js +2 -2
- package/dist/application/ArtifactInventory/scanReader.js +12 -4
- package/dist/application/ArtifactInventory/types.js +0 -3
- package/dist/application/BinarySession.js +28 -43
- package/dist/application/BinarySessionExecution.js +37 -1
- package/dist/application/BinaryTargetResolver.js +50 -4
- package/dist/application/BrowserEvidence.js +36 -7
- package/dist/application/BrowserObservationService.js +17 -44
- package/dist/application/BrowserScenarioCaptureService.js +2 -35
- package/dist/application/BrowserScenarioEvidence.js +13 -9
- package/dist/application/CapabilityClientRequirements.js +2 -11
- package/dist/application/CapabilityInventory.js +21 -35
- package/dist/application/ClientConfigurationDocument.js +84 -7
- package/dist/application/ClientRegistrationIdentity.js +32 -0
- package/dist/application/ClientRegistrationStatus.js +59 -6
- package/dist/application/DirectAnalysis.js +37 -58
- package/dist/application/DirectAnalysisStatus.js +4 -4
- package/dist/application/Doctor.js +89 -80
- package/dist/application/DoctorDiagnostics.js +2 -26
- package/dist/application/DoctorScope.js +8 -14
- package/dist/application/ElectronActiveEvidence.js +10 -27
- package/dist/application/ElectronActiveObservationService.js +9 -36
- package/dist/application/ElectronBoundaryAnalysis.js +2 -0
- package/dist/application/ElectronBoundaryGraphNative.js +1 -1
- package/dist/application/ElectronEvidence.js +8 -3
- package/dist/application/ElectronObservationService.js +9 -25
- package/dist/application/EnhancedLiteralTracing.js +4 -8
- package/dist/application/EnhancedTools.js +15 -35
- package/dist/application/FilesystemSnapshot.js +7 -8
- package/dist/application/JavaScriptApplicationEvidenceGraph.js +2 -1
- package/dist/application/JavaScriptApplicationWorkflowService.js +31 -7
- package/dist/application/JavaScriptArtifactAnalysis.js +6 -4
- package/dist/application/JavaScriptArtifactFiles.js +5 -0
- package/dist/application/JavaScriptArtifactPathResolution.js +179 -47
- package/dist/application/JavaScriptRuntimeObservationEvidence.js +6 -3
- package/dist/application/JavaScriptRuntimeObservationService.js +9 -25
- package/dist/application/JavaScriptRuntimeReconciliationService.js +45 -4
- package/dist/application/JavaScriptSemanticGraphAsyncProjection.js +11 -0
- package/dist/application/JavaScriptSemanticGraphChildProcessProjection.js +11 -0
- package/dist/application/JavaScriptSemanticGraphDataProjection.js +11 -0
- package/dist/application/JavaScriptSemanticGraphFlowProjection.js +14 -5
- package/dist/application/JsonFiles.js +1 -1
- package/dist/application/LazyAnalysisProvider.js +27 -6
- package/dist/application/ManagedMemberComparisonService.js +19 -6
- package/dist/application/NativeApiInspection.js +2 -0
- package/dist/application/NativeCallRoutes.js +72 -0
- package/dist/application/NativeDispatchMetadataInspection.js +33 -0
- package/dist/application/NativeUiActionTrace.js +73 -49
- package/dist/application/NativeValueTrace.js +320 -0
- package/dist/application/ProcessCaptureCapability.js +32 -5
- package/dist/application/ProcessCaptureEnvironment.js +9 -26
- package/dist/application/ProcessCaptureError.js +1 -5
- package/dist/application/ProcessCaptureJournal.js +3 -40
- package/dist/application/ProcessCaptureLifecycle.js +102 -111
- package/dist/application/ProcessCli.js +18 -25
- package/dist/application/ProcessEvidence.js +5 -7
- package/dist/application/ProcessFilesystemEffects.js +36 -0
- package/dist/application/ProcessHarness.js +41 -120
- package/dist/application/ProcessNormalization.js +2 -17
- package/dist/application/ProcessScenarioRuntimeValidation.js +76 -0
- package/dist/application/ReferenceSourceImport.js +3 -4
- package/dist/application/Setup.js +236 -84
- package/dist/application/SetupClientConfiguration.js +14 -9
- package/dist/application/SetupPlan.js +138 -86
- package/dist/application/SetupSkill.js +0 -1
- package/dist/application/SupportedClients.js +102 -21
- package/dist/application/Uninstall.js +31 -20
- package/dist/application/Update.js +93 -0
- package/dist/application/UpdateMaintenance.js +108 -0
- package/dist/application/UpdateRuntime.js +126 -0
- package/dist/application/runtime.js +13 -2
- package/dist/artifacts/ArtifactPaths.js +6 -8
- package/dist/artifacts/ArtifactProvider.js +94 -41
- package/dist/artifacts/AsarArtifactReader.js +19 -4
- package/dist/artifacts/KeyedArchiveReader.js +110 -0
- package/dist/artifacts/MachOSliceArtifactReader.js +53 -5
- package/dist/artifacts/ZipArtifactReader.js +18 -1
- package/dist/browser/BrowserScenarioSecrets.js +28 -1
- package/dist/browser/CdpBrowserProvider.js +36 -15
- package/dist/browser/CdpCaptureDocuments.js +22 -8
- package/dist/browser/CdpCaptureEventHandlers.js +14 -5
- package/dist/browser/CdpCaptureEventHelpers.js +13 -0
- package/dist/browser/CdpCaptureEvents.js +10 -1
- package/dist/browser/CdpElectronInspection.js +5 -10
- package/dist/browser/CdpElectronProvider.js +1 -5
- package/dist/browser/CdpElectronScripts.js +1 -1
- package/dist/browser/CdpEndpoint.js +3 -2
- package/dist/browser/CdpObservationSession.js +14 -10
- package/dist/browser/CdpPageCapture.js +1 -1
- package/dist/browser/CdpPageCaptureScripts.js +1 -1
- package/dist/browser/CdpSafeMetadata.js +5 -4
- package/dist/browser/CdpScreenshot.js +16 -5
- package/dist/browser/CdpTargetSession.js +25 -4
- package/dist/browser/CdpWebMcpDiscovery.js +93 -20
- package/dist/browser/JavaScriptRuntimeScope.js +28 -2
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +9 -8
- package/dist/browser/PlaywrightElectronActiveActions.js +3 -10
- package/dist/browser/PlaywrightElectronActiveProvider.js +5 -5
- package/dist/browser/PlaywrightScenarioActions.js +1 -1
- package/dist/browser/PlaywrightScenarioArtifacts.js +13 -25
- package/dist/browser/PlaywrightScenarioBrowser.js +28 -25
- package/dist/browser/PlaywrightScenarioEvents.js +82 -93
- package/dist/browser/PlaywrightScenarioSession.js +27 -123
- package/dist/browser/PngVisualDiff.js +22 -3
- package/dist/browser/V8InspectorCaptureProjection.js +7 -1
- package/dist/browser/V8InspectorProvider.js +60 -7
- package/dist/browser/WebSourceMapFetcher.js +99 -53
- package/dist/cli/artifactCommands.js +56 -12
- package/dist/cli/coreAnalysisCommands.js +110 -0
- package/dist/cli/managedCommands.js +1 -31
- package/dist/cli/setupCommands.js +16 -14
- package/dist/cli/utilityCommands.js +61 -4
- package/dist/cli.js +5 -7
- package/dist/cliApplicationCommands.js +0 -83
- package/dist/cliBrowserAdvancedCommands.js +7 -11
- package/dist/cliBrowserCommands.js +15 -23
- package/dist/cliBrowserContext.js +3 -24
- package/dist/cliBrowserScenarioCommands.js +2 -10
- package/dist/cliCommandNames.js +82 -7
- package/dist/cliElectronCommands.js +10 -36
- package/dist/cliJavaScriptRuntimeCommands.js +6 -30
- package/dist/cliJsonInput.js +4 -2
- package/dist/cliLogging.js +16 -7
- package/dist/cliObservationOptions.js +1 -1
- package/dist/cliOutput.js +2 -4
- package/dist/cliProcessCommands.js +6 -33
- package/dist/cliSetup.js +90 -160
- package/dist/config/environment.js +2 -78
- package/dist/config/parseConfig.js +18 -109
- package/dist/config/parsers.js +0 -23
- package/dist/contracts/applicationToolContracts.js +1 -118
- package/dist/contracts/artifactToolContracts.js +11 -19
- package/dist/contracts/browserScenarioToolContracts.js +1 -5
- package/dist/contracts/browserToolContracts.js +9 -16
- package/dist/contracts/electronToolContracts.js +5 -6
- package/dist/contracts/enhancedInputs.js +3 -2
- package/dist/contracts/errorSchemas.js +16 -40
- package/dist/contracts/functionWorkflowToolContracts.js +2 -2
- package/dist/contracts/javascriptApplicationWorkflowExamples.js +2 -2
- package/dist/contracts/javascriptRuntimeObservationToolContracts.js +4 -4
- package/dist/contracts/javascriptRuntimeReconciliationExample.js +1 -1
- package/dist/contracts/managedToolContracts.js +7 -4
- package/dist/contracts/managedWorkflowExamples.js +0 -22
- package/dist/contracts/managedWorkflowToolContracts.js +16 -31
- package/dist/contracts/nativeToolContracts.js +9 -0
- package/dist/contracts/promptContracts.js +6 -6
- package/dist/contracts/sessionToolSchemas.js +3 -3
- package/dist/contracts/toolContractExamples.js +4 -3
- package/dist/contracts/toolContracts.js +18 -7
- package/dist/contracts/toolEffects.js +34 -21
- package/dist/contracts/toolOutputSchemaGroups.js +18 -5
- package/dist/contracts/toolOutputSchemaPrimitives.js +9 -6
- package/dist/contracts/toolSchemaMetadata.js +5 -8
- package/dist/doctorRuntime.js +0 -41
- package/dist/domain/analysisErrorPresentation.js +4 -28
- package/dist/domain/analysisErrorProjection.js +33 -50
- package/dist/domain/analysisProfile.js +1 -1
- package/dist/domain/analysisSnapshot.js +77 -3
- package/dist/domain/androidApplication.js +5 -4
- package/dist/domain/appleApplication.js +5 -4
- package/dist/domain/appleAssetCatalog.js +127 -0
- package/dist/domain/artifactComparison.js +7 -11
- package/dist/domain/artifactGraph.js +8 -6
- package/dist/domain/artifactInspection.js +13 -12
- package/dist/domain/binaryTarget.js +23 -9
- package/dist/domain/browserObservation.js +43 -24
- package/dist/domain/browserObservationSchemas.js +2 -1
- package/dist/domain/browserScenario.js +7 -107
- package/dist/domain/browserScenarioCapture.js +0 -1
- package/dist/domain/browserScenarioCaptureValues.js +5 -4
- package/dist/domain/browserScenarioDiff.js +1 -3
- package/dist/domain/browserScenarioValues.js +16 -107
- package/dist/domain/bundleComparison.js +18 -17
- package/dist/domain/callPathSchemas.js +17 -7
- package/dist/domain/changedBehavior.js +2 -3
- package/dist/domain/comparisonSemantics.js +19 -0
- package/dist/domain/completionLedgerGeneration.js +3 -2
- package/dist/domain/conformancePackage.js +2 -1
- package/dist/domain/conformanceTrustGate.js +3 -5
- package/dist/domain/customProtocolCapture.js +2 -2
- package/dist/domain/digests.js +30 -0
- package/dist/domain/dosMz.js +83 -0
- package/dist/domain/electronActiveObservation.js +7 -5
- package/dist/domain/electronObservation.js +3 -2
- package/dist/domain/electronStaticAnalysisNative.js +15 -6
- package/dist/domain/emptyArraySchema.js +3 -0
- package/dist/domain/errors.js +10 -28
- package/dist/domain/evidence.js +5 -3
- package/dist/domain/evidenceCompletionLedger.js +3 -2
- package/dist/domain/functionComparisonNormalization.js +24 -18
- package/dist/domain/functionComparisonResults.js +3 -7
- package/dist/domain/functionComparisonSchemas.js +3 -2
- package/dist/domain/hopperValues.js +108 -8
- package/dist/domain/javascriptApplicationAnalysis.js +4 -7
- package/dist/domain/javascriptApplicationEvidenceSchemas.js +4 -3
- package/dist/domain/javascriptApplicationGraphSchemas.js +8 -7
- package/dist/domain/javascriptApplicationVersionComparisonSchemas.js +9 -7
- package/dist/domain/javascriptApplicationVersionItems.js +12 -18
- package/dist/domain/javascriptAstValues.js +4 -0
- package/dist/domain/javascriptExportShapeComparison.js +1 -6
- package/dist/domain/javascriptExportShapeComparisonSchemas.js +6 -10
- package/dist/domain/javascriptExportShapeVariants.js +15 -2
- package/dist/domain/javascriptFeatureTraceSchemas.js +8 -7
- package/dist/domain/javascriptRuntimeObservation.js +14 -2
- package/dist/domain/javascriptRuntimeReconciliationMatching.js +8 -0
- package/dist/domain/javascriptRuntimeReconciliationParsing.js +4 -2
- package/dist/domain/javascriptRuntimeReconciliationResult.js +6 -4
- package/dist/domain/javascriptRuntimeReconciliationRuntime.js +15 -4
- package/dist/domain/javascriptRuntimeReconciliationSchemas.js +19 -18
- package/dist/domain/javascriptRuntimeStaticCandidates.js +18 -6
- package/dist/domain/javascriptSemanticAnalysis.js +57 -19
- package/dist/domain/javascriptSemanticAsyncEffects.js +39 -40
- package/dist/domain/javascriptSemanticCalls.js +46 -27
- package/dist/domain/javascriptSemanticChildProcesses.js +43 -50
- package/dist/domain/javascriptSemanticDataEffectHelpers.js +91 -18
- package/dist/domain/javascriptSemanticDataEffects.js +22 -10
- package/dist/domain/javascriptSemanticGraphSchemas.js +8 -6
- package/dist/domain/javascriptSemanticObjects.js +13 -3
- package/dist/domain/javascriptSemanticProjection.js +144 -38
- package/dist/domain/javascriptSemanticPromises.js +14 -27
- package/dist/domain/javascriptSemanticQuerySchemas.js +6 -9
- package/dist/domain/javascriptSemanticResources.js +2 -5
- package/dist/domain/javascriptSemanticState.js +4 -0
- package/dist/domain/javascriptSemanticTraceSchemas.js +2 -1
- package/dist/domain/javascriptSemanticTraversal.js +13 -5
- package/dist/domain/javascriptSemanticValues.js +10 -9
- package/dist/domain/javascriptSourceParser.js +5 -1
- package/dist/domain/javascriptStaticAnalysisCalls.js +8 -5
- package/dist/domain/javascriptStaticAnalysisHelpers.js +16 -7
- package/dist/domain/keyedArchive.js +181 -0
- package/dist/domain/managedApplicationGraph.js +4 -3
- package/dist/domain/managedArtifact.js +2 -1
- package/dist/domain/managedMemberComparison.js +18 -13
- package/dist/domain/managedMemberComparisonCoverage.js +2 -1
- package/dist/domain/managedMemberComparisonItems.js +27 -7
- package/dist/domain/managedMemberComparisonMatch.js +22 -6
- package/dist/domain/managedNativeVerificationMatch.js +2 -2
- package/dist/domain/managedNativeVerificationSchemas.js +7 -5
- package/dist/domain/managedReconstruction.js +6 -5
- package/dist/domain/nativeApiBoundary.js +7 -0
- package/dist/domain/nativeDataType.js +51 -0
- package/dist/domain/nativeInspection.js +0 -1
- package/dist/domain/nativeInstruction.js +82 -0
- package/dist/domain/nativeInvestigationGraph.js +9 -5
- package/dist/domain/nativeUiObservation.js +123 -0
- package/dist/domain/nativeValueFlow.js +17 -0
- package/dist/domain/nativeValueTrace.js +64 -0
- package/dist/domain/objcSwiftMetadata.js +39 -0
- package/dist/domain/peInspection.js +1 -0
- package/dist/domain/processCapture.js +5 -55
- package/dist/domain/processCaptureExample.js +0 -9
- package/dist/domain/processCaptureValidation.js +13 -144
- package/dist/domain/processComparison.js +3 -25
- package/dist/domain/processObservation.js +0 -29
- package/dist/domain/processScenario.js +28 -228
- package/dist/domain/processTraceDimensionProjection.js +0 -15
- package/dist/domain/processTraceEvaluation.js +0 -6
- package/dist/domain/protocolCapture.js +8 -36
- package/dist/domain/reconstructionCoverage.js +3 -2
- package/dist/domain/reconstructionObligationLedgerSchemas.js +4 -12
- package/dist/domain/reconstructionReadinessSchemas.js +4 -3
- package/dist/domain/reconstructionVerification.js +2 -1
- package/dist/domain/reconstructionVerificationSchemas.js +6 -13
- package/dist/domain/referenceSourceClassification.js +0 -110
- package/dist/domain/referenceSourceGraph.js +15 -5
- package/dist/domain/residualUnknown.js +3 -2
- package/dist/domain/runtimeIdentification.js +6 -5
- package/dist/domain/sourceMapContents.js +5 -0
- package/dist/domain/sourceToBundleComparison.js +3 -10
- package/dist/domain/sourceToBundleComparisonSchemas.js +7 -6
- package/dist/domain/sourceToBundleSignals.js +9 -3
- package/dist/domain/staticRuntimeCorrelation.js +5 -11
- package/dist/domain/webBundleAnalysis.js +17 -9
- package/dist/domain/webBundleAnalyzer.js +1 -1
- package/dist/domain/webCaptureDiff.js +5 -11
- package/dist/domain/webCaptureDiffSchemas.js +2 -1
- package/dist/domain/webMcpDiscovery.js +2 -1
- package/dist/dotnet/ManagedMemberInspectorCore.js +15 -7
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +57 -40
- package/dist/dotnet/ManagedMemberRows.js +2 -0
- package/dist/dotnet/ManagedMethodBodyReader.js +15 -8
- package/dist/dotnet/ManagedPeReader.js +2 -0
- package/dist/generatedMcpToolCatalog.js +1 -1
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraAnalysisProfile.js +15 -5
- package/dist/ghidra/GhidraClient.js +38 -8
- package/dist/ghidra/GhidraFunctionValues.js +56 -20
- package/dist/ghidra/GhidraInstallation.js +7 -4
- package/dist/ghidra/GhidraInventoryValues.js +44 -9
- package/dist/ghidra/GhidraLauncher.js +18 -3
- package/dist/ghidra/GhidraProvider.js +23 -2
- package/dist/ghidra/GhidraRequestQueue.js +45 -4
- package/dist/ghidra/GhidraSessionValues.js +5 -0
- package/dist/hopper/HopperAnalysisProfile.js +2 -0
- package/dist/hopper/HopperProvider.js +29 -6
- package/dist/hopper/HopperTargetLease.js +18 -4
- package/dist/logger.js +0 -13
- package/dist/main/messages.js +0 -1
- package/dist/main/reload.js +3 -32
- package/dist/main/shutdown.js +1 -2
- package/dist/main/transport.js +0 -17
- package/dist/main.js +0 -10
- package/dist/native/AppleDispatchMetadata.js +582 -0
- package/dist/native/AppleObjcProtocols.js +88 -0
- package/dist/native/AppleSwiftVtables.js +86 -0
- package/dist/native/CommandRunner.js +1 -1
- package/dist/native/NativeHostCapabilities.js +23 -0
- package/dist/native/NativeMacOSProvider.js +61 -9
- package/dist/native/NativeMachoInspection.js +39 -6
- package/dist/native/NativeUiHelperRuntime.js +42 -0
- package/dist/native/NativeUiObservation.js +174 -0
- package/dist/native/parsers/codesign.js +4 -1
- package/dist/native/parsers/dyldInfo.js +51 -25
- package/dist/native/parsers/lipo.js +13 -4
- package/dist/native/parsers/otool.js +84 -39
- package/dist/native/parsers/plist.js +2 -1
- package/dist/process/ExecFileOutput.js +5 -1
- package/dist/process/ProcessOwnership.js +69 -33
- package/dist/process/ProcessOwnershipObservation.js +31 -12
- package/dist/process/ProviderProcess.js +4 -2
- package/dist/reference/ReferenceSourceReaderEntries.js +48 -31
- package/dist/reference/ReferenceSourceReaderErrors.js +24 -0
- package/dist/reference/ReferenceSourceReaderFile.js +11 -5
- package/dist/reference/ReferenceSourceReaderValidate.js +22 -8
- package/dist/server/createServer.js +7 -62
- package/dist/server/registerApplicationTools/helpers.js +2 -9
- package/dist/server/registerApplicationTools.js +0 -4
- package/dist/server/registerArtifactComparisonTool.js +1 -1
- package/dist/server/registerBrowserScenarioTool.js +4 -2
- package/dist/server/registerBrowserTools.js +7 -7
- package/dist/server/registerBundleComparisonTool.js +1 -1
- package/dist/server/registerCloseLifecycleTool.js +1 -1
- package/dist/server/registerElectronTools.js +10 -4
- package/dist/server/registerEnhancedTools.js +20 -12
- package/dist/server/registerEvidenceTools.js +4 -28
- package/dist/server/registerFunctionComparisonTool.js +1 -1
- package/dist/server/registerInvestigationTools.js +6 -6
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +2 -2
- package/dist/server/registerManagedTools.js +28 -14
- package/dist/server/registerManagedWorkflowTools.js +0 -2
- package/dist/server/registerProcessComparisonTool.js +1 -3
- package/dist/server/registerSessionRecordTools.js +9 -9
- package/dist/server/registerSessionStatusTool.js +1 -1
- package/dist/server/registerSessionTools.js +28 -57
- package/dist/server/sessionAvailabilityPolicy.js +2 -3
- package/dist/server/sessionToolPolicies.js +0 -4
- package/dist/server/toolResult.js +8 -10
- package/package.json +32 -22
- package/skills/reverse-engineer-anything/SKILL.md +15 -11
- package/skills/reverse-engineer-anything/references/evidence-workflows.md +3 -2
- package/skills/reverse-engineer-anything/references/javascript-applications.md +3 -2
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +8 -6
- package/skills/reverse-engineer-anything/references/runtime-observation.md +15 -11
- package/dist/application/CommandShimReplay.js +0 -152
- package/dist/application/ConfiguredRoots.js +0 -19
- package/dist/application/InstrumentedJavaScriptReplayHost.js +0 -36
- package/dist/application/JavaScriptReplayPermission.js +0 -16
- package/dist/application/JavaScriptReplayPlanning.js +0 -207
- package/dist/application/JavaScriptReplayService.js +0 -274
- package/dist/application/LoopbackReplay.js +0 -389
- package/dist/application/LoopbackReplayRecorder.js +0 -129
- package/dist/application/ManagedRuntimeCorrelationService.js +0 -104
- package/dist/application/NodeRuntimeCharacterizationService.js +0 -191
- package/dist/application/PermissionAuthority.js +0 -268
- package/dist/application/PermissionConfiguration.js +0 -26
- package/dist/application/PermissionFailure.js +0 -5
- package/dist/application/ProcessCaptureAuthority.js +0 -24
- package/dist/application/ProcessCapturePermission.js +0 -13
- package/dist/application/ProcessCheckpoints.js +0 -178
- package/dist/application/ProcessReactiveCoordinator.js +0 -223
- package/dist/application/ProcessReactiveEffects.js +0 -153
- package/dist/application/ProcessReactiveHarness.js +0 -106
- package/dist/application/ProcessReactiveObservations.js +0 -105
- package/dist/application/ProjectPermissionStore.js +0 -199
- package/dist/application/RuntimeExecutableDiagnostics.js +0 -198
- package/dist/application/Upgrade.js +0 -134
- package/dist/browser/SensitiveTextCapture.js +0 -8
- package/dist/cliPolicyCommands.js +0 -185
- package/dist/config/browserScenario.js +0 -77
- package/dist/config/electronAutomation.js +0 -35
- package/dist/config/javascriptReplay.js +0 -41
- package/dist/config/managedRuntime.js +0 -25
- package/dist/config/passiveObservation.js +0 -87
- package/dist/config/permissions.js +0 -23
- package/dist/config/processCapture.js +0 -47
- package/dist/contracts/replayMachineExample.js +0 -37
- package/dist/domain/javascriptExportInstrumentation.js +0 -95
- package/dist/domain/javascriptReplay.js +0 -360
- package/dist/domain/managedRuntimeCorrelation.js +0 -181
- package/dist/domain/nodeRuntimeCharacterization.js +0 -63
- package/dist/domain/permissionPolicy.js +0 -176
- package/dist/domain/processCaptureReactiveSchema.js +0 -68
- package/dist/domain/processCaptureReactiveValidation.js +0 -180
- package/dist/domain/processReactiveCheckpointDataflow.js +0 -32
- package/dist/domain/processReactiveMatching.js +0 -196
- package/dist/domain/processReactiveRuntime.js +0 -116
- package/dist/domain/processReactiveScenario.js +0 -296
- package/dist/domain/processReactiveScenarioPreflight.js +0 -95
- package/dist/domain/processReactiveTransition.js +0 -187
- package/dist/domain/replayMachine.js +0 -320
- package/dist/domain/replayMachineRun.js +0 -168
- package/dist/domain/replayMachineRuntime.js +0 -296
- package/dist/domain/replayMachineValues.js +0 -84
- package/dist/domain/runtimeCharacterization.js +0 -84
- package/dist/replay/JavaScriptReplayWorker.js +0 -382
- package/dist/replay/JavaScriptReplayWorkerTypes.js +0 -1
- package/dist/replay/LinuxJavaScriptReplayRunner.js +0 -216
- package/dist/replay/LinuxJavaScriptReplaySandbox.js +0 -121
- package/dist/replay/LinuxRuntimeClosure.js +0 -44
- package/dist/replay/LinuxSeccompPolicy.js +0 -40
- package/dist/replay/ReplayOutcome.js +0 -104
- package/dist/replay/ReplayProcessLifecycle.js +0 -96
- package/dist/replay/ReplaySeccompFile.js +0 -29
- package/dist/replay/ReplayWorkerProtocol.js +0 -58
- package/dist/replay/SystemJavaScriptReplayHost.js +0 -153
- package/dist/server/ProcessCaptureElicitation.js +0 -153
- package/dist/server/registerApplicationTools/characterization.js +0 -46
- package/dist/server/registerApplicationTools/controlledReplay.js +0 -31
- package/dist/server/registerManagedWorkflowTools/planManagedRuntimeCorrelation.js +0 -29
- package/dist/server/registerReplayMachineTool.js +0 -14
- package/skills/reverse-engineer-anything/references/controlled-replay.md +0 -12
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rea-agents",
|
|
3
3
|
"mcpName": "io.github.morluto/rea",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "4.0.1",
|
|
5
5
|
"description": "Reverse engineer anything from your terminal or agent with one CLI and MCP server.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"dist",
|
|
43
43
|
"install.sh",
|
|
44
44
|
"bridge/hopper_bridge.py",
|
|
45
|
+
"bridge/native/ReaNativeUI.swift",
|
|
45
46
|
"bridge/ghidra/ReaGhidraBridge.java",
|
|
46
47
|
"scripts/rea.mjs",
|
|
47
48
|
"scripts/electron-active-hook.cjs",
|
|
@@ -60,14 +61,15 @@
|
|
|
60
61
|
"mcp-registry:check": "node scripts/verify-mcp-registry-metadata.mjs",
|
|
61
62
|
"mcp-catalog:generate": "npm run build:cached && node scripts/generate-mcp-tool-catalog.mjs",
|
|
62
63
|
"mcp-catalog:check": "node scripts/generate-mcp-tool-catalog.mjs --check",
|
|
63
|
-
"prebuild": "npm run deps:check && npm run metadata:check
|
|
64
|
-
"build": "
|
|
64
|
+
"prebuild": "npm run deps:check && npm run metadata:check",
|
|
65
|
+
"build": "node scripts/run-exclusive.mjs build npm run build:unlocked",
|
|
66
|
+
"build:unlocked": "node scripts/clean-build-output.mjs && tsc -p tsconfig.build.json",
|
|
65
67
|
"precheck": "npm run deps:check",
|
|
66
68
|
"check": "turbo run typecheck lint format:check knip metadata:check",
|
|
67
69
|
"precheck:fast": "npm run deps:check",
|
|
68
|
-
"check:fast": "turbo run typecheck lint",
|
|
70
|
+
"check:fast": "turbo run typecheck lint --output-logs=errors-only",
|
|
69
71
|
"precheck:changed": "npm run deps:check",
|
|
70
|
-
"check:changed": "
|
|
72
|
+
"check:changed": "npm run check:fast && npm run test:changed",
|
|
71
73
|
"precheck:test": "npm run deps:check",
|
|
72
74
|
"check:test": "turbo run typecheck lint format:check knip metadata:check test:run",
|
|
73
75
|
"precheck:pr": "npm run deps:check",
|
|
@@ -75,8 +77,8 @@
|
|
|
75
77
|
"precheck:ci": "npm run deps:check",
|
|
76
78
|
"check:ci": "turbo run typecheck lint format:check knip metadata:check jscpd scan:todos",
|
|
77
79
|
"build:cached": "turbo run build",
|
|
78
|
-
"format": "
|
|
79
|
-
"format:check": "
|
|
80
|
+
"format": "oxfmt .",
|
|
81
|
+
"format:check": "oxfmt --check .",
|
|
80
82
|
"lint": "oxlint",
|
|
81
83
|
"lint:fix": "oxlint --fix",
|
|
82
84
|
"knip": "knip",
|
|
@@ -84,20 +86,18 @@
|
|
|
84
86
|
"jscpd": "jscpd src/ tests/",
|
|
85
87
|
"scan:todos": "node scripts/scan-todos.mjs",
|
|
86
88
|
"start": "node scripts/rea.mjs mcp",
|
|
87
|
-
"test": "
|
|
89
|
+
"test": "npm run test:with-build",
|
|
88
90
|
"test:with-build": "npm run build:cached && vitest run",
|
|
89
|
-
"test:run": "
|
|
90
|
-
"test:local": "node scripts/run-
|
|
91
|
-
"
|
|
92
|
-
"test:fast": "vitest run --project domain --project services --project adapters --project composition --project boundary --project process-boundary --project mcp-boundary --project conformance",
|
|
91
|
+
"test:run": "vitest run",
|
|
92
|
+
"test:local": "node scripts/run-development-tests.mjs local",
|
|
93
|
+
"test:fast": "vitest run --project domain --project services --project adapters --project composition --project conformance --project evaluation",
|
|
93
94
|
"pretest:boundary": "npm run build:cached",
|
|
94
95
|
"test:boundary": "vitest run --project boundary --project process-boundary --project mcp-boundary --project process-global",
|
|
95
96
|
"pretest:mcp": "npm run build:cached",
|
|
96
97
|
"test:mcp": "vitest run --project mcp-boundary",
|
|
97
98
|
"pretest:acceptance": "npm run build:cached",
|
|
98
99
|
"test:acceptance": "vitest run --project acceptance",
|
|
99
|
-
"
|
|
100
|
-
"test:changed": "vitest run --project domain --project services --project adapters --project composition --project boundary --project process-boundary --project mcp-boundary --project conformance --project evaluation --changed",
|
|
100
|
+
"test:changed": "node scripts/run-development-tests.mjs changed",
|
|
101
101
|
"pretest:integration": "npm run build:cached",
|
|
102
102
|
"test:integration": "vitest run --project boundary --project process-boundary --project mcp-boundary --project process-global --project acceptance",
|
|
103
103
|
"pretest:coverage": "npm run build:cached",
|
|
@@ -109,14 +109,18 @@
|
|
|
109
109
|
"test:ci:merge": "vitest --merge-reports --coverage.enabled --coverage.provider=v8",
|
|
110
110
|
"pretest:verbose": "npm run build:cached",
|
|
111
111
|
"test:verbose": "vitest run --reporter=verbose",
|
|
112
|
-
"
|
|
113
|
-
"test:watch": "vitest --project domain --project services --project adapters --project composition --project boundary --project process-boundary --project mcp-boundary --project conformance --project evaluation --changed",
|
|
112
|
+
"test:watch": "vitest --project domain --project services --project adapters --project composition --project conformance --project evaluation --changed",
|
|
114
113
|
"pretest:watch:all": "npm run build:cached",
|
|
115
114
|
"test:watch:all": "vitest --changed",
|
|
116
115
|
"typecheck": "tsc --noEmit",
|
|
117
116
|
"verify:test-temp-hygiene": "npm run build:cached && node scripts/verify-test-temp-hygiene.mjs",
|
|
118
117
|
"verify:hopper": "npm run verify:fixtures && npm run build:cached && node scripts/verify-real-hopper.mjs",
|
|
118
|
+
"verify:apple-dispatch": "npm run build:cached && node scripts/verify-apple-dispatch.mjs",
|
|
119
|
+
"verify:native-ui": "npm run build:cached && node scripts/verify-native-ui.mjs",
|
|
120
|
+
"verify:keyed-archive": "npm run build:cached && node scripts/verify-keyed-archive.mjs",
|
|
119
121
|
"verify:ghidra": "npm run build:cached && node scripts/verify-real-ghidra.mjs",
|
|
122
|
+
"verify:ghidra:switch": "npm run build:cached && node scripts/verify-real-ghidra-switch.mjs",
|
|
123
|
+
"verify:ghidra:dos": "npm run build:cached && node scripts/verify-real-ghidra-dos.mjs",
|
|
120
124
|
"verify:ghidra:aarch64-jump-table": "npm run build:cached && node scripts/verify-real-ghidra.mjs --aarch64-jump-table",
|
|
121
125
|
"verify:interface-builder": "npm run build:cached && node scripts/verify-interface-builder.mjs",
|
|
122
126
|
"verify:ghidra:cross-format": "npm run build:cached && node scripts/verify-real-ghidra.mjs --cross-format",
|
|
@@ -127,7 +131,6 @@
|
|
|
127
131
|
"verify:javascript-runtime": "npm run build:cached && node scripts/verify-local-javascript-runtime.mjs",
|
|
128
132
|
"verify:application-workflows": "npm run build:cached && node scripts/verify-local-application-workflows.mjs",
|
|
129
133
|
"verify:managed": "npm run build:cached && node scripts/verify-managed-conformance.mjs",
|
|
130
|
-
"verify:replay": "npm run build:cached && node scripts/verify-real-javascript-replay.mjs",
|
|
131
134
|
"verify:agent": "npm run build:cached && node scripts/verify-agent-experience.mjs",
|
|
132
135
|
"verify:hopper:linux": "npm run verify:fixtures && npm run build:cached && node scripts/verify-real-hopper-linux.mjs",
|
|
133
136
|
"verify:setup:linux": "npm run build:cached && node scripts/verify-linux-setup-e2e.mjs",
|
|
@@ -145,19 +148,22 @@
|
|
|
145
148
|
"docs:api": "typedoc",
|
|
146
149
|
"docs:api:cached": "turbo run docs:api",
|
|
147
150
|
"docs:generate": "node scripts/run-exclusive.mjs docs npm run docs:generate:unlocked",
|
|
148
|
-
"docs:generate:unlocked": "npm run metadata:generate && npm run build:cached && node scripts/generate-mcp-tool-catalog.mjs && node scripts/generate-skill-metadata.mjs && node scripts/generate-product-catalog.mjs && node scripts/generate-completion-ledger.mjs &&
|
|
151
|
+
"docs:generate:unlocked": "npm run metadata:generate && npm run build:cached && node scripts/generate-mcp-tool-catalog.mjs && node scripts/generate-skill-metadata.mjs && node scripts/generate-product-catalog.mjs && node scripts/generate-completion-ledger.mjs && node scripts/generate-error-schema.mjs",
|
|
149
152
|
"docs:check": "node scripts/run-exclusive.mjs docs turbo run docs:check:built",
|
|
150
153
|
"docs:check:built": "node scripts/generate-package-metadata.mjs --check && node scripts/generate-mcp-tool-catalog.mjs --check && node scripts/generate-skill-metadata.mjs --check && node scripts/generate-product-catalog.mjs --check && node scripts/generate-completion-ledger.mjs --check && node scripts/check-doc-facts.mjs && node scripts/generate-error-schema.mjs --check",
|
|
151
154
|
"docs:error-schema": "npm run build:cached && node scripts/generate-error-schema.mjs",
|
|
152
155
|
"prepack": "node scripts/prepack.mjs",
|
|
153
|
-
"prepare": "node scripts/prepare.mjs"
|
|
156
|
+
"prepare": "node scripts/prepare.mjs",
|
|
157
|
+
"verify:asset-catalog": "npm run build:cached && node scripts/verify-asset-catalog.mjs",
|
|
158
|
+
"verify:native-ui:permissions": "npm run build:cached && node scripts/verify-native-ui.mjs --allow-permission-denial",
|
|
159
|
+
"test:focused": "node scripts/run-development-tests.mjs focused"
|
|
154
160
|
},
|
|
155
161
|
"lint-staged": {
|
|
156
162
|
"*.{cjs,cts,js,jsx,mjs,mts,ts,tsx}": [
|
|
157
|
-
"
|
|
163
|
+
"oxfmt",
|
|
158
164
|
"oxlint --fix"
|
|
159
165
|
],
|
|
160
|
-
"*.{json,md,yml,yaml}": "
|
|
166
|
+
"*.{json,md,yml,yaml}": "oxfmt"
|
|
161
167
|
},
|
|
162
168
|
"dependencies": {
|
|
163
169
|
"@babel/parser": "8.0.4",
|
|
@@ -172,12 +178,14 @@
|
|
|
172
178
|
"@xterm/headless": "6.0.0",
|
|
173
179
|
"@zip.js/zip.js": "2.8.26",
|
|
174
180
|
"canonicalize": "3.0.0",
|
|
181
|
+
"cross-spawn": "7.0.6",
|
|
175
182
|
"diff": "9.0.0",
|
|
176
183
|
"graphology": "0.26.0",
|
|
177
184
|
"graphology-shortest-path": "2.1.0",
|
|
178
185
|
"ignore": "7.0.6",
|
|
179
186
|
"incur": "0.4.13",
|
|
180
187
|
"isomorphic-git": "1.38.7",
|
|
188
|
+
"jsonc-parser": "3.3.1",
|
|
181
189
|
"pino": "9.14.0",
|
|
182
190
|
"playwright-core": "1.58.2",
|
|
183
191
|
"plist": "5.0.0",
|
|
@@ -189,17 +197,19 @@
|
|
|
189
197
|
},
|
|
190
198
|
"devDependencies": {
|
|
191
199
|
"@fast-check/vitest": "0.4.1",
|
|
200
|
+
"@types/cross-spawn": "6.0.6",
|
|
192
201
|
"@types/node": "24.10.1",
|
|
193
202
|
"@types/semver": "7.7.1",
|
|
194
203
|
"@types/write-file-atomic": "4.0.3",
|
|
195
204
|
"@types/ws": "8.18.1",
|
|
196
205
|
"@vitest/coverage-v8": "4.1.10",
|
|
206
|
+
"ajv": "8.20.0",
|
|
197
207
|
"husky": "9.1.7",
|
|
198
208
|
"jscpd": "5.0.12",
|
|
199
209
|
"knip": "6.26.0",
|
|
200
210
|
"lint-staged": "16.4.0",
|
|
211
|
+
"oxfmt": "0.72.0",
|
|
201
212
|
"oxlint": "1.73.0",
|
|
202
|
-
"prettier": "3.6.2",
|
|
203
213
|
"turbo": "2.10.5",
|
|
204
214
|
"typedoc": "0.28.20",
|
|
205
215
|
"typescript": "5.9.3",
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: reverse-engineer-anything
|
|
3
|
-
description: Reverse engineer native, managed, Electron/JavaScript, packaged, and browser applications with REA. Use shipped-artifact or
|
|
3
|
+
description: Reverse engineer native, managed, Electron/JavaScript, packaged, and browser applications with REA. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.
|
|
4
4
|
metadata:
|
|
5
|
-
version: "
|
|
6
|
-
tool_count:
|
|
7
|
-
catalog_digest: "
|
|
5
|
+
version: "24"
|
|
6
|
+
tool_count: 116
|
|
7
|
+
catalog_digest: "5bb3f994a3c4d0c87a34ff5aab4e28141b5fa6f3a98b5ae7e95686d85d9d983e"
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# REA
|
|
11
11
|
|
|
12
12
|
Use REA when a claim depends on a shipped binary or package, decompilation,
|
|
13
|
-
passive application runtime evidence,
|
|
13
|
+
passive application runtime evidence, or comparison with
|
|
14
14
|
behavior not established by available source. For ordinary analysis of a
|
|
15
15
|
complete source repository, use normal repository tools and do not run REA
|
|
16
16
|
readiness or provider commands.
|
|
@@ -50,8 +50,12 @@ returned result leaves a specific question unanswered.
|
|
|
50
50
|
|
|
51
51
|
Every conclusion must distinguish observations, inferences, and unknowns. Cite
|
|
52
52
|
Evidence IDs, preserve limitations and incomplete coverage, and never imply
|
|
53
|
-
that static analysis observed execution.
|
|
54
|
-
|
|
53
|
+
that static analysis observed execution. Runtime requests execute the declared
|
|
54
|
+
target and lifecycle; do not broaden the target or action beyond those fields.
|
|
55
|
+
|
|
56
|
+
Within the user's requested investigation, call available analysis tools
|
|
57
|
+
directly. REA does not require permission grants or per-call approval flags.
|
|
58
|
+
Follow the declared request scope and the host's actual access requirements.
|
|
55
59
|
|
|
56
60
|
## Plan broader investigations
|
|
57
61
|
|
|
@@ -71,8 +75,10 @@ For requests that span multiple features or subsystems, use a staged workflow:
|
|
|
71
75
|
they affect the question. Use format-aware inventory and parsers; do not
|
|
72
76
|
infer behavior from filenames, strings, or layout alone.
|
|
73
77
|
5. Corroborate a conclusion with the evidence type it requires. Use runtime
|
|
74
|
-
observation
|
|
75
|
-
|
|
78
|
+
observation only when static evidence cannot answer the question and the
|
|
79
|
+
required host runtime and OS access are available. For JavaScript behavior,
|
|
80
|
+
run probes against the actual app through the available browser, Electron,
|
|
81
|
+
or process capture workflow.
|
|
76
82
|
6. Decompose work into independent questions. When parallel workers are
|
|
77
83
|
available and the questions do not depend on one another, assign distinct
|
|
78
84
|
scopes, point workers to existing evidence, and ask them to return sources,
|
|
@@ -96,8 +102,6 @@ as complete while required questions remain open.
|
|
|
96
102
|
[references/runtime-observation.md](references/runtime-observation.md)
|
|
97
103
|
- Evidence paging, comparisons, residual unknowns, and verification:
|
|
98
104
|
[references/evidence-workflows.md](references/evidence-workflows.md)
|
|
99
|
-
- Controlled JavaScript replay:
|
|
100
|
-
[references/controlled-replay.md](references/controlled-replay.md)
|
|
101
105
|
|
|
102
106
|
## Readiness and setup
|
|
103
107
|
|
|
@@ -7,8 +7,9 @@ is incomplete or paginated, continue only when the remaining data matters to
|
|
|
7
7
|
the task; do not fetch a bundle or resource merely to read a result already
|
|
8
8
|
returned inline.
|
|
9
9
|
|
|
10
|
-
Use `record_unknown`
|
|
11
|
-
environment still required. Supply supporting and
|
|
10
|
+
Use `record_unknown` to track unresolved questions in the user's investigation
|
|
11
|
+
and name the authority or environment still required. Supply supporting and
|
|
12
|
+
contradicting evidence IDs. It updates the session registry directly.
|
|
12
13
|
Use `update_unknown` with the current revision; reread after a stale revision
|
|
13
14
|
instead of retrying blindly. Only qualifying observed evidence can verify a
|
|
14
15
|
resolution.
|
|
@@ -31,5 +31,6 @@ Include the complete Evidence records from both analysis calls. Accept variant
|
|
|
31
31
|
pairing only through the tool's unique exact literal discriminant. Cite the
|
|
32
32
|
comparison Evidence and report JSON Pointer changes; dynamic values, ambiguous
|
|
33
33
|
variants, and incomplete parent-property coverage stay unknown. This is static
|
|
34
|
-
inference, not runtime behavior.
|
|
35
|
-
|
|
34
|
+
inference, not runtime behavior. When runtime semantics are needed, run
|
|
35
|
+
behavioral probes against the relevant application versions and capture them
|
|
36
|
+
through the available browser, Electron, or process workflows.
|
|
@@ -32,9 +32,11 @@ IDs when using them.
|
|
|
32
32
|
Use `extract_artifact` when materialized files are needed. It takes no arguments
|
|
33
33
|
and materializes all regular files into a fresh temporary directory chosen by
|
|
34
34
|
REA. Symlinks and encrypted entries are inventory facts, not extractable files.
|
|
35
|
-
The
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
Native DMG traversal
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
The result reports the materialized directory; callers do not choose the
|
|
36
|
+
destination. No separate permission grant is needed.
|
|
37
|
+
|
|
38
|
+
Native DMG traversal automatically uses a read-only mount on supported macOS
|
|
39
|
+
hosts, with an owned temporary mount directory and cleanup. It needs no approval
|
|
40
|
+
flag. Unsupported hosts or mount failures remain explicit limitations; do not
|
|
41
|
+
claim child inventory when only root identity is available. Extraction is a
|
|
42
|
+
separate filesystem-writing operation.
|
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
# Passive browser and Electron observation
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
endpoint
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
Supply the existing browser or Electron instance's literal-port loopback CDP
|
|
4
|
+
endpoint in the request. No separate permission configuration or per-call
|
|
5
|
+
approval flag is needed. Browser discovery lists eligible HTTP(S) pages;
|
|
6
|
+
`allowed_origins` optionally filters them. An individual capture defaults to the
|
|
7
|
+
selected page's current origin. Electron discovery lists eligible local
|
|
8
|
+
`file://` targets without a configured file-root allowlist.
|
|
7
9
|
|
|
8
10
|
Start browser work with `list_browser_targets`; start Electron runtime work with
|
|
9
|
-
`list_electron_targets`. Inspect
|
|
11
|
+
`list_electron_targets`. Inspect the target selected for the user's task. Observation
|
|
10
12
|
is passive: never claim REA clicked, navigated, evaluated page JavaScript,
|
|
11
13
|
invoked IPC, captured prior activity, or contained the page's network.
|
|
12
14
|
|
|
13
|
-
Credentials, cookies, authorization headers, storage values,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
Credentials, cookies, authorization headers, storage values, and raw
|
|
16
|
+
WebSocket/JSON bodies are deliberately absent. Local URLs retain ordinary query
|
|
17
|
+
values and fragments; userinfo credentials are removed. Browser accessibility
|
|
18
|
+
text, console primitives, value-free shapes, script sources, source maps, and
|
|
19
|
+
storage key names have request-specific capture options. Electron script
|
|
20
|
+
sources are also optional. Use `capture_web_screenshot` when pixels are needed.
|
|
21
|
+
Treat scope filtering, truncation, and attach-window coverage as limitations.
|
|
22
|
+
Page-declared WebMCP tools are untrusted inventory and are never invoked by REA.
|
|
19
23
|
|
|
20
24
|
Use `reconcile_javascript_runtime` only after static application Evidence and
|
|
21
25
|
passive browser/Electron Evidence exist. Prefer captured-source digest identity;
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import { createServer } from "node:http";
|
|
2
|
-
import { chmod, mkdir, writeFile } from "node:fs/promises";
|
|
3
|
-
import { join } from "node:path";
|
|
4
|
-
const RUNNER = `const command = process.argv[2];
|
|
5
|
-
const maximumTimerDelay = 2147483647;
|
|
6
|
-
const delay = milliseconds => new Promise(resolve => {
|
|
7
|
-
let remaining = milliseconds;
|
|
8
|
-
const schedule = () => {
|
|
9
|
-
const interval = Math.min(remaining, maximumTimerDelay);
|
|
10
|
-
setTimeout(() => {
|
|
11
|
-
remaining -= interval;
|
|
12
|
-
if (remaining === 0) resolve();
|
|
13
|
-
else schedule();
|
|
14
|
-
}, interval);
|
|
15
|
-
};
|
|
16
|
-
schedule();
|
|
17
|
-
});
|
|
18
|
-
const response = await fetch(process.env.REA_SHIM_LEDGER_URL, {
|
|
19
|
-
method: "POST",
|
|
20
|
-
headers: { "content-type": "application/json" },
|
|
21
|
-
body: JSON.stringify({ command, arguments: process.argv.slice(3), working_directory: process.cwd() }),
|
|
22
|
-
});
|
|
23
|
-
if (!response.ok) process.exit(127);
|
|
24
|
-
const route = await response.json();
|
|
25
|
-
let elapsed = 0;
|
|
26
|
-
for (const output of route.outputs) {
|
|
27
|
-
const wait = Math.max(0, output.at_ms - elapsed);
|
|
28
|
-
if (wait > 0) await delay(wait);
|
|
29
|
-
elapsed = output.at_ms;
|
|
30
|
-
(output.stream === "stdout" ? process.stdout : process.stderr).write(output.data);
|
|
31
|
-
}
|
|
32
|
-
if (route.termination.type === "signal") process.kill(process.pid, route.termination.signal);
|
|
33
|
-
else process.exit(route.termination.code);
|
|
34
|
-
`;
|
|
35
|
-
const shellQuote = (value) => `'${value.replaceAll("'", `'\\''`)}'`;
|
|
36
|
-
/**
|
|
37
|
-
* Start bounded executable replay wrappers and their private invocation ledger.
|
|
38
|
-
*
|
|
39
|
-
* Exact argument matching is deliberate: a fallback to the host executable
|
|
40
|
-
* would make an unmatched dependency call look authoritative. Unmatched and
|
|
41
|
-
* exhausted routes therefore fail visibly and remain part of the capture.
|
|
42
|
-
*/
|
|
43
|
-
export const startCommandShimReplay = async (scenario, temporaryRoot, started, recordEvent = () => undefined) => {
|
|
44
|
-
const binPath = join(temporaryRoot, "shims");
|
|
45
|
-
await mkdir(binPath);
|
|
46
|
-
const runnerPath = join(temporaryRoot, "shim-runner.mjs");
|
|
47
|
-
await writeFile(runnerPath, RUNNER, { mode: 0o600, flag: "wx" });
|
|
48
|
-
for (const shim of scenario.command_shims) {
|
|
49
|
-
const path = join(binPath, shim.name);
|
|
50
|
-
const wrapper = `#!/bin/sh\nexec ${shellQuote(process.execPath)} ${shellQuote(runnerPath)} ${shellQuote(shim.name)} "$@"\n`;
|
|
51
|
-
await writeFile(path, wrapper, { mode: 0o700, flag: "wx" });
|
|
52
|
-
await chmod(path, 0o700);
|
|
53
|
-
}
|
|
54
|
-
const events = [];
|
|
55
|
-
let truncated = false;
|
|
56
|
-
const calls = new Map();
|
|
57
|
-
const server = createServer((request, response) => {
|
|
58
|
-
if (request.method !== "POST" || request.url !== "/invoke") {
|
|
59
|
-
response.writeHead(404).end();
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
readInvocation(request)
|
|
63
|
-
.then((invocation) => {
|
|
64
|
-
const shim = scenario.command_shims.find(({ name }) => name === invocation.command);
|
|
65
|
-
const routeIndex = shim?.routes.findIndex(({ arguments: expected }) => JSON.stringify(expected) === JSON.stringify(invocation.arguments));
|
|
66
|
-
const key = `${invocation.command}:${String(routeIndex ?? -1)}`;
|
|
67
|
-
const used = calls.get(key) ?? 0;
|
|
68
|
-
const route = shim !== undefined && routeIndex !== undefined && routeIndex >= 0
|
|
69
|
-
? shim.routes[routeIndex]
|
|
70
|
-
: undefined;
|
|
71
|
-
const outcome = route === undefined
|
|
72
|
-
? "unmatched"
|
|
73
|
-
: used >= route.max_calls
|
|
74
|
-
? "exhausted"
|
|
75
|
-
: "matched";
|
|
76
|
-
if (events.length >= scenario.limits.protocol_events)
|
|
77
|
-
truncated = true;
|
|
78
|
-
else {
|
|
79
|
-
const index = events.length;
|
|
80
|
-
events.push({
|
|
81
|
-
sequence: index,
|
|
82
|
-
at_ms: Math.max(0, Date.now() - started),
|
|
83
|
-
command: invocation.command,
|
|
84
|
-
route_index: routeIndex !== undefined && routeIndex >= 0 ? routeIndex : null,
|
|
85
|
-
arguments: invocation.arguments,
|
|
86
|
-
working_directory: invocation.working_directory,
|
|
87
|
-
outcome,
|
|
88
|
-
});
|
|
89
|
-
recordEvent("shim_events", index);
|
|
90
|
-
}
|
|
91
|
-
if (outcome !== "matched" || route === undefined) {
|
|
92
|
-
response.writeHead(409).end();
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
calls.set(key, used + 1);
|
|
96
|
-
response
|
|
97
|
-
.writeHead(200, { "content-type": "application/json" })
|
|
98
|
-
.end(JSON.stringify(route));
|
|
99
|
-
})
|
|
100
|
-
.catch(() => response.writeHead(400).end());
|
|
101
|
-
});
|
|
102
|
-
await listen(server);
|
|
103
|
-
const address = server.address();
|
|
104
|
-
if (address === null || typeof address === "string") {
|
|
105
|
-
await closeServer(server);
|
|
106
|
-
throw new Error("command shim ledger did not bind an IPv4 port");
|
|
107
|
-
}
|
|
108
|
-
return {
|
|
109
|
-
binPath,
|
|
110
|
-
url: `http://127.0.0.1:${String(address.port)}/invoke`,
|
|
111
|
-
events,
|
|
112
|
-
get truncated() {
|
|
113
|
-
return truncated;
|
|
114
|
-
},
|
|
115
|
-
close: () => closeServer(server),
|
|
116
|
-
};
|
|
117
|
-
};
|
|
118
|
-
const readInvocation = async (request) => {
|
|
119
|
-
const chunks = [];
|
|
120
|
-
let bytes = 0;
|
|
121
|
-
for await (const chunk of request) {
|
|
122
|
-
const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
123
|
-
bytes += buffer.length;
|
|
124
|
-
if (bytes > 64 * 1024)
|
|
125
|
-
throw new Error("shim invocation exceeds limit");
|
|
126
|
-
chunks.push(buffer);
|
|
127
|
-
}
|
|
128
|
-
const value = JSON.parse(Buffer.concat(chunks).toString("utf8"));
|
|
129
|
-
if (typeof value !== "object" ||
|
|
130
|
-
value === null ||
|
|
131
|
-
!("command" in value) ||
|
|
132
|
-
typeof value.command !== "string" ||
|
|
133
|
-
!("arguments" in value) ||
|
|
134
|
-
!Array.isArray(value.arguments) ||
|
|
135
|
-
!value.arguments.every((item) => typeof item === "string") ||
|
|
136
|
-
!("working_directory" in value) ||
|
|
137
|
-
typeof value.working_directory !== "string")
|
|
138
|
-
throw new Error("invalid shim invocation");
|
|
139
|
-
return {
|
|
140
|
-
command: value.command,
|
|
141
|
-
arguments: value.arguments,
|
|
142
|
-
working_directory: value.working_directory,
|
|
143
|
-
};
|
|
144
|
-
};
|
|
145
|
-
const listen = (server) => new Promise((resolveListen, rejectListen) => {
|
|
146
|
-
server.once("error", rejectListen);
|
|
147
|
-
server.listen(0, "127.0.0.1", () => {
|
|
148
|
-
server.off("error", rejectListen);
|
|
149
|
-
resolveListen();
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
const closeServer = (server) => new Promise((resolveClose, rejectClose) => server.close((cause) => cause === undefined ? resolveClose() : rejectClose(cause)));
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { realpath } from "node:fs/promises";
|
|
2
|
-
/** Canonicalize configured policy roots while ignoring stale missing entries. */
|
|
3
|
-
export const canonicalizeConfiguredRoots = async (roots) => {
|
|
4
|
-
const canonical = [];
|
|
5
|
-
for (const root of roots) {
|
|
6
|
-
try {
|
|
7
|
-
canonical.push(await realpath(root));
|
|
8
|
-
}
|
|
9
|
-
catch (cause) {
|
|
10
|
-
if (!isMissingPath(cause))
|
|
11
|
-
throw cause;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return canonical;
|
|
15
|
-
};
|
|
16
|
-
const isMissingPath = (cause) => typeof cause === "object" &&
|
|
17
|
-
cause !== null &&
|
|
18
|
-
"code" in cause &&
|
|
19
|
-
cause.code === "ENOENT";
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { instrumentJavaScriptExport, } from "../domain/javascriptExportInstrumentation.js";
|
|
2
|
-
/** Decorate one exact replay source with deterministic in-memory instrumentation. */
|
|
3
|
-
export class InstrumentedJavaScriptReplayHost {
|
|
4
|
-
delegate;
|
|
5
|
-
input;
|
|
6
|
-
instrumentation = null;
|
|
7
|
-
constructor(delegate, input) {
|
|
8
|
-
this.delegate = delegate;
|
|
9
|
-
this.input = input;
|
|
10
|
-
}
|
|
11
|
-
async readSource(path, maximumBytes) {
|
|
12
|
-
const source = await this.delegate.readSource(path, maximumBytes);
|
|
13
|
-
if (path !== this.input.artifact_path)
|
|
14
|
-
return source;
|
|
15
|
-
const instrumented = instrumentJavaScriptExport(source.bytes, this.input);
|
|
16
|
-
if (instrumented.bytes.byteLength > maximumBytes)
|
|
17
|
-
throw new RangeError("Instrumented JavaScript exceeds the replay module byte limit");
|
|
18
|
-
this.instrumentation = instrumented;
|
|
19
|
-
return { canonicalPath: source.canonicalPath, bytes: instrumented.bytes };
|
|
20
|
-
}
|
|
21
|
-
identifyExecutable(path, versionArguments) {
|
|
22
|
-
return this.delegate.identifyExecutable(path, versionArguments);
|
|
23
|
-
}
|
|
24
|
-
identifyWorker() {
|
|
25
|
-
return this.delegate.identifyWorker();
|
|
26
|
-
}
|
|
27
|
-
identifyRuntimeClosure(nodePath) {
|
|
28
|
-
return this.delegate.identifyRuntimeClosure(nodePath);
|
|
29
|
-
}
|
|
30
|
-
seccompDigest() {
|
|
31
|
-
return this.delegate.seccompDigest();
|
|
32
|
-
}
|
|
33
|
-
probe(policy) {
|
|
34
|
-
return this.delegate.probe(policy);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/** Build the exact permission request for one controlled replay operation. */
|
|
2
|
-
export const replayPermissionRequest = (input, policy) => ({
|
|
3
|
-
capability: "javascript_replay",
|
|
4
|
-
roots: [...input.left.modules, ...(input.right?.modules ?? [])].map(({ path }) => path),
|
|
5
|
-
executables: [
|
|
6
|
-
policy.nodePath,
|
|
7
|
-
policy.bubblewrapPath,
|
|
8
|
-
policy.systemdRunPath,
|
|
9
|
-
policy.systemctlPath,
|
|
10
|
-
policy.shellPath,
|
|
11
|
-
],
|
|
12
|
-
environment_names: [],
|
|
13
|
-
network: "none",
|
|
14
|
-
mount: true,
|
|
15
|
-
operation_identity: `run_controlled_replay:${input.mode === "plan" ? "plan" : input.plan_digest}`,
|
|
16
|
-
});
|