rea-agents 3.2.1 → 4.0.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.
Files changed (434) hide show
  1. package/README.md +183 -332
  2. package/bridge/ghidra/ReaGhidraBridge.java +561 -74
  3. package/bridge/hopper_bridge.py +70 -27
  4. package/bridge/native/ReaNativeUI.swift +157 -0
  5. package/dist/application/AnalysisContextQueries.js +19 -5
  6. package/dist/application/AnalysisSnapshotCache.js +30 -11
  7. package/dist/application/AppleAssetCatalogAnalysis.js +171 -0
  8. package/dist/application/ArtifactExtractionDestination.js +0 -12
  9. package/dist/application/ArtifactGraphConstruction.js +44 -11
  10. package/dist/application/ArtifactInventory/classify.js +7 -15
  11. package/dist/application/ArtifactInventory/hash.js +4 -2
  12. package/dist/application/ArtifactInventory/policy.js +2 -17
  13. package/dist/application/ArtifactInventory/reader.js +3 -3
  14. package/dist/application/ArtifactInventory/scanCanonical.js +2 -2
  15. package/dist/application/ArtifactInventory/scanReader.js +12 -4
  16. package/dist/application/ArtifactInventory/types.js +0 -3
  17. package/dist/application/BinarySession.js +28 -43
  18. package/dist/application/BinarySessionExecution.js +37 -1
  19. package/dist/application/BinaryTargetResolver.js +50 -4
  20. package/dist/application/BrowserEvidence.js +36 -7
  21. package/dist/application/BrowserObservationService.js +17 -44
  22. package/dist/application/BrowserScenarioCaptureService.js +2 -35
  23. package/dist/application/BrowserScenarioEvidence.js +13 -9
  24. package/dist/application/CapabilityClientRequirements.js +2 -11
  25. package/dist/application/CapabilityInventory.js +21 -35
  26. package/dist/application/ClientConfigurationDocument.js +84 -7
  27. package/dist/application/ClientRegistrationIdentity.js +32 -0
  28. package/dist/application/ClientRegistrationStatus.js +59 -6
  29. package/dist/application/DirectAnalysis.js +37 -58
  30. package/dist/application/DirectAnalysisStatus.js +4 -4
  31. package/dist/application/Doctor.js +89 -80
  32. package/dist/application/DoctorDiagnostics.js +2 -26
  33. package/dist/application/DoctorScope.js +8 -14
  34. package/dist/application/ElectronActiveEvidence.js +10 -27
  35. package/dist/application/ElectronActiveObservationService.js +9 -36
  36. package/dist/application/ElectronBoundaryAnalysis.js +2 -0
  37. package/dist/application/ElectronBoundaryGraphNative.js +1 -1
  38. package/dist/application/ElectronEvidence.js +8 -3
  39. package/dist/application/ElectronObservationService.js +9 -25
  40. package/dist/application/EnhancedLiteralTracing.js +4 -8
  41. package/dist/application/EnhancedTools.js +15 -35
  42. package/dist/application/FilesystemSnapshot.js +7 -8
  43. package/dist/application/JavaScriptApplicationEvidenceGraph.js +2 -1
  44. package/dist/application/JavaScriptApplicationWorkflowService.js +31 -7
  45. package/dist/application/JavaScriptArtifactAnalysis.js +6 -4
  46. package/dist/application/JavaScriptArtifactFiles.js +5 -0
  47. package/dist/application/JavaScriptArtifactPathResolution.js +179 -47
  48. package/dist/application/JavaScriptRuntimeObservationEvidence.js +6 -3
  49. package/dist/application/JavaScriptRuntimeObservationService.js +9 -25
  50. package/dist/application/JavaScriptRuntimeReconciliationService.js +45 -4
  51. package/dist/application/JavaScriptSemanticGraphAsyncProjection.js +11 -0
  52. package/dist/application/JavaScriptSemanticGraphChildProcessProjection.js +11 -0
  53. package/dist/application/JavaScriptSemanticGraphDataProjection.js +11 -0
  54. package/dist/application/JavaScriptSemanticGraphFlowProjection.js +14 -5
  55. package/dist/application/JsonFiles.js +1 -1
  56. package/dist/application/LazyAnalysisProvider.js +27 -6
  57. package/dist/application/ManagedMemberComparisonService.js +19 -6
  58. package/dist/application/NativeApiInspection.js +2 -0
  59. package/dist/application/NativeCallRoutes.js +72 -0
  60. package/dist/application/NativeDispatchMetadataInspection.js +33 -0
  61. package/dist/application/NativeUiActionTrace.js +73 -49
  62. package/dist/application/NativeValueTrace.js +320 -0
  63. package/dist/application/ProcessCaptureCapability.js +32 -5
  64. package/dist/application/ProcessCaptureEnvironment.js +9 -26
  65. package/dist/application/ProcessCaptureError.js +1 -5
  66. package/dist/application/ProcessCaptureJournal.js +3 -40
  67. package/dist/application/ProcessCaptureLifecycle.js +102 -111
  68. package/dist/application/ProcessCli.js +18 -25
  69. package/dist/application/ProcessEvidence.js +5 -7
  70. package/dist/application/ProcessFilesystemEffects.js +36 -0
  71. package/dist/application/ProcessHarness.js +41 -120
  72. package/dist/application/ProcessNormalization.js +2 -17
  73. package/dist/application/ProcessScenarioRuntimeValidation.js +76 -0
  74. package/dist/application/ReferenceSourceImport.js +3 -4
  75. package/dist/application/Setup.js +236 -84
  76. package/dist/application/SetupClientConfiguration.js +14 -9
  77. package/dist/application/SetupPlan.js +138 -86
  78. package/dist/application/SetupSkill.js +0 -1
  79. package/dist/application/SupportedClients.js +102 -21
  80. package/dist/application/Uninstall.js +31 -20
  81. package/dist/application/Update.js +93 -0
  82. package/dist/application/UpdateMaintenance.js +108 -0
  83. package/dist/application/UpdateRuntime.js +126 -0
  84. package/dist/application/runtime.js +13 -2
  85. package/dist/artifacts/ArtifactPaths.js +6 -8
  86. package/dist/artifacts/ArtifactProvider.js +94 -41
  87. package/dist/artifacts/AsarArtifactReader.js +19 -4
  88. package/dist/artifacts/KeyedArchiveReader.js +110 -0
  89. package/dist/artifacts/MachOSliceArtifactReader.js +53 -5
  90. package/dist/artifacts/ZipArtifactReader.js +18 -1
  91. package/dist/browser/BrowserScenarioSecrets.js +28 -1
  92. package/dist/browser/CdpBrowserProvider.js +36 -15
  93. package/dist/browser/CdpCaptureDocuments.js +22 -8
  94. package/dist/browser/CdpCaptureEventHandlers.js +14 -5
  95. package/dist/browser/CdpCaptureEventHelpers.js +13 -0
  96. package/dist/browser/CdpCaptureEvents.js +10 -1
  97. package/dist/browser/CdpElectronInspection.js +5 -10
  98. package/dist/browser/CdpElectronProvider.js +1 -5
  99. package/dist/browser/CdpElectronScripts.js +1 -1
  100. package/dist/browser/CdpEndpoint.js +3 -2
  101. package/dist/browser/CdpObservationSession.js +14 -10
  102. package/dist/browser/CdpPageCapture.js +1 -1
  103. package/dist/browser/CdpPageCaptureScripts.js +1 -1
  104. package/dist/browser/CdpSafeMetadata.js +5 -4
  105. package/dist/browser/CdpScreenshot.js +16 -5
  106. package/dist/browser/CdpTargetSession.js +25 -4
  107. package/dist/browser/CdpWebMcpDiscovery.js +93 -20
  108. package/dist/browser/JavaScriptRuntimeScope.js +28 -2
  109. package/dist/browser/PlaywrightBrowserScenarioProvider.js +9 -8
  110. package/dist/browser/PlaywrightElectronActiveActions.js +3 -10
  111. package/dist/browser/PlaywrightElectronActiveProvider.js +5 -5
  112. package/dist/browser/PlaywrightScenarioActions.js +1 -1
  113. package/dist/browser/PlaywrightScenarioArtifacts.js +13 -25
  114. package/dist/browser/PlaywrightScenarioBrowser.js +28 -25
  115. package/dist/browser/PlaywrightScenarioEvents.js +82 -93
  116. package/dist/browser/PlaywrightScenarioSession.js +27 -123
  117. package/dist/browser/PngVisualDiff.js +22 -3
  118. package/dist/browser/V8InspectorCaptureProjection.js +7 -1
  119. package/dist/browser/V8InspectorProvider.js +60 -7
  120. package/dist/browser/WebSourceMapFetcher.js +99 -53
  121. package/dist/cli/artifactCommands.js +56 -12
  122. package/dist/cli/coreAnalysisCommands.js +110 -0
  123. package/dist/cli/managedCommands.js +1 -31
  124. package/dist/cli/setupCommands.js +16 -14
  125. package/dist/cli/utilityCommands.js +61 -4
  126. package/dist/cli.js +5 -7
  127. package/dist/cliApplicationCommands.js +0 -83
  128. package/dist/cliBrowserAdvancedCommands.js +7 -11
  129. package/dist/cliBrowserCommands.js +15 -23
  130. package/dist/cliBrowserContext.js +3 -24
  131. package/dist/cliBrowserScenarioCommands.js +2 -10
  132. package/dist/cliCommandNames.js +82 -7
  133. package/dist/cliElectronCommands.js +10 -36
  134. package/dist/cliJavaScriptRuntimeCommands.js +6 -30
  135. package/dist/cliJsonInput.js +4 -2
  136. package/dist/cliLogging.js +16 -7
  137. package/dist/cliObservationOptions.js +1 -1
  138. package/dist/cliOutput.js +2 -4
  139. package/dist/cliProcessCommands.js +6 -33
  140. package/dist/cliSetup.js +90 -160
  141. package/dist/config/environment.js +2 -78
  142. package/dist/config/parseConfig.js +18 -109
  143. package/dist/config/parsers.js +0 -23
  144. package/dist/contracts/applicationToolContracts.js +1 -118
  145. package/dist/contracts/artifactToolContracts.js +11 -19
  146. package/dist/contracts/browserScenarioToolContracts.js +1 -5
  147. package/dist/contracts/browserToolContracts.js +9 -16
  148. package/dist/contracts/electronToolContracts.js +5 -6
  149. package/dist/contracts/enhancedInputs.js +3 -2
  150. package/dist/contracts/errorSchemas.js +16 -40
  151. package/dist/contracts/functionWorkflowToolContracts.js +2 -2
  152. package/dist/contracts/javascriptApplicationWorkflowExamples.js +2 -2
  153. package/dist/contracts/javascriptRuntimeObservationToolContracts.js +4 -4
  154. package/dist/contracts/javascriptRuntimeReconciliationExample.js +1 -1
  155. package/dist/contracts/managedToolContracts.js +7 -4
  156. package/dist/contracts/managedWorkflowExamples.js +0 -22
  157. package/dist/contracts/managedWorkflowToolContracts.js +16 -31
  158. package/dist/contracts/nativeToolContracts.js +9 -0
  159. package/dist/contracts/promptContracts.js +6 -6
  160. package/dist/contracts/sessionToolSchemas.js +3 -3
  161. package/dist/contracts/toolContractExamples.js +4 -3
  162. package/dist/contracts/toolContracts.js +18 -7
  163. package/dist/contracts/toolEffects.js +34 -21
  164. package/dist/contracts/toolOutputSchemaGroups.js +18 -5
  165. package/dist/contracts/toolOutputSchemaPrimitives.js +9 -6
  166. package/dist/contracts/toolSchemaMetadata.js +5 -8
  167. package/dist/doctorRuntime.js +0 -41
  168. package/dist/domain/analysisErrorPresentation.js +4 -28
  169. package/dist/domain/analysisErrorProjection.js +33 -50
  170. package/dist/domain/analysisProfile.js +1 -1
  171. package/dist/domain/analysisSnapshot.js +77 -3
  172. package/dist/domain/androidApplication.js +5 -4
  173. package/dist/domain/appleApplication.js +5 -4
  174. package/dist/domain/appleAssetCatalog.js +127 -0
  175. package/dist/domain/artifactComparison.js +7 -11
  176. package/dist/domain/artifactGraph.js +8 -6
  177. package/dist/domain/artifactInspection.js +13 -12
  178. package/dist/domain/binaryTarget.js +23 -9
  179. package/dist/domain/browserObservation.js +43 -24
  180. package/dist/domain/browserObservationSchemas.js +2 -1
  181. package/dist/domain/browserScenario.js +7 -107
  182. package/dist/domain/browserScenarioCapture.js +0 -1
  183. package/dist/domain/browserScenarioCaptureValues.js +5 -4
  184. package/dist/domain/browserScenarioDiff.js +1 -3
  185. package/dist/domain/browserScenarioValues.js +16 -107
  186. package/dist/domain/bundleComparison.js +18 -17
  187. package/dist/domain/callPathSchemas.js +17 -7
  188. package/dist/domain/changedBehavior.js +2 -3
  189. package/dist/domain/comparisonSemantics.js +19 -0
  190. package/dist/domain/completionLedgerGeneration.js +3 -2
  191. package/dist/domain/conformancePackage.js +2 -1
  192. package/dist/domain/conformanceTrustGate.js +3 -5
  193. package/dist/domain/customProtocolCapture.js +2 -2
  194. package/dist/domain/digests.js +30 -0
  195. package/dist/domain/dosMz.js +83 -0
  196. package/dist/domain/electronActiveObservation.js +7 -5
  197. package/dist/domain/electronObservation.js +3 -2
  198. package/dist/domain/electronStaticAnalysisNative.js +15 -6
  199. package/dist/domain/emptyArraySchema.js +3 -0
  200. package/dist/domain/errors.js +10 -28
  201. package/dist/domain/evidence.js +5 -3
  202. package/dist/domain/evidenceCompletionLedger.js +3 -2
  203. package/dist/domain/functionComparisonNormalization.js +24 -18
  204. package/dist/domain/functionComparisonResults.js +3 -7
  205. package/dist/domain/functionComparisonSchemas.js +3 -2
  206. package/dist/domain/hopperValues.js +108 -8
  207. package/dist/domain/javascriptApplicationAnalysis.js +4 -7
  208. package/dist/domain/javascriptApplicationEvidenceSchemas.js +4 -3
  209. package/dist/domain/javascriptApplicationGraphSchemas.js +8 -7
  210. package/dist/domain/javascriptApplicationVersionComparisonSchemas.js +9 -7
  211. package/dist/domain/javascriptApplicationVersionItems.js +12 -18
  212. package/dist/domain/javascriptAstValues.js +4 -0
  213. package/dist/domain/javascriptExportShapeComparison.js +1 -6
  214. package/dist/domain/javascriptExportShapeComparisonSchemas.js +6 -10
  215. package/dist/domain/javascriptExportShapeVariants.js +15 -2
  216. package/dist/domain/javascriptFeatureTraceSchemas.js +8 -7
  217. package/dist/domain/javascriptRuntimeObservation.js +14 -2
  218. package/dist/domain/javascriptRuntimeReconciliationMatching.js +8 -0
  219. package/dist/domain/javascriptRuntimeReconciliationParsing.js +4 -2
  220. package/dist/domain/javascriptRuntimeReconciliationResult.js +6 -4
  221. package/dist/domain/javascriptRuntimeReconciliationRuntime.js +15 -4
  222. package/dist/domain/javascriptRuntimeReconciliationSchemas.js +19 -18
  223. package/dist/domain/javascriptRuntimeStaticCandidates.js +18 -6
  224. package/dist/domain/javascriptSemanticAnalysis.js +57 -19
  225. package/dist/domain/javascriptSemanticAsyncEffects.js +39 -40
  226. package/dist/domain/javascriptSemanticCalls.js +46 -27
  227. package/dist/domain/javascriptSemanticChildProcesses.js +43 -50
  228. package/dist/domain/javascriptSemanticDataEffectHelpers.js +91 -18
  229. package/dist/domain/javascriptSemanticDataEffects.js +22 -10
  230. package/dist/domain/javascriptSemanticGraphSchemas.js +8 -6
  231. package/dist/domain/javascriptSemanticObjects.js +13 -3
  232. package/dist/domain/javascriptSemanticProjection.js +144 -38
  233. package/dist/domain/javascriptSemanticPromises.js +14 -27
  234. package/dist/domain/javascriptSemanticQuerySchemas.js +6 -9
  235. package/dist/domain/javascriptSemanticResources.js +2 -5
  236. package/dist/domain/javascriptSemanticState.js +4 -0
  237. package/dist/domain/javascriptSemanticTraceSchemas.js +2 -1
  238. package/dist/domain/javascriptSemanticTraversal.js +13 -5
  239. package/dist/domain/javascriptSemanticValues.js +10 -9
  240. package/dist/domain/javascriptSourceParser.js +5 -1
  241. package/dist/domain/javascriptStaticAnalysisCalls.js +8 -5
  242. package/dist/domain/javascriptStaticAnalysisHelpers.js +16 -7
  243. package/dist/domain/keyedArchive.js +181 -0
  244. package/dist/domain/managedApplicationGraph.js +4 -3
  245. package/dist/domain/managedArtifact.js +2 -1
  246. package/dist/domain/managedMemberComparison.js +18 -13
  247. package/dist/domain/managedMemberComparisonCoverage.js +2 -1
  248. package/dist/domain/managedMemberComparisonItems.js +27 -7
  249. package/dist/domain/managedMemberComparisonMatch.js +22 -6
  250. package/dist/domain/managedNativeVerificationMatch.js +2 -2
  251. package/dist/domain/managedNativeVerificationSchemas.js +7 -5
  252. package/dist/domain/managedReconstruction.js +6 -5
  253. package/dist/domain/nativeApiBoundary.js +7 -0
  254. package/dist/domain/nativeDataType.js +51 -0
  255. package/dist/domain/nativeInspection.js +0 -1
  256. package/dist/domain/nativeInstruction.js +82 -0
  257. package/dist/domain/nativeInvestigationGraph.js +9 -5
  258. package/dist/domain/nativeUiObservation.js +123 -0
  259. package/dist/domain/nativeValueFlow.js +17 -0
  260. package/dist/domain/nativeValueTrace.js +64 -0
  261. package/dist/domain/objcSwiftMetadata.js +39 -0
  262. package/dist/domain/peInspection.js +1 -0
  263. package/dist/domain/processCapture.js +5 -55
  264. package/dist/domain/processCaptureExample.js +0 -9
  265. package/dist/domain/processCaptureValidation.js +13 -144
  266. package/dist/domain/processComparison.js +3 -25
  267. package/dist/domain/processObservation.js +0 -29
  268. package/dist/domain/processScenario.js +28 -228
  269. package/dist/domain/processTraceDimensionProjection.js +0 -15
  270. package/dist/domain/processTraceEvaluation.js +0 -6
  271. package/dist/domain/protocolCapture.js +8 -36
  272. package/dist/domain/reconstructionCoverage.js +3 -2
  273. package/dist/domain/reconstructionObligationLedgerSchemas.js +4 -12
  274. package/dist/domain/reconstructionReadinessSchemas.js +4 -3
  275. package/dist/domain/reconstructionVerification.js +2 -1
  276. package/dist/domain/reconstructionVerificationSchemas.js +6 -13
  277. package/dist/domain/referenceSourceClassification.js +0 -110
  278. package/dist/domain/referenceSourceGraph.js +15 -5
  279. package/dist/domain/residualUnknown.js +3 -2
  280. package/dist/domain/runtimeIdentification.js +6 -5
  281. package/dist/domain/sourceMapContents.js +5 -0
  282. package/dist/domain/sourceToBundleComparison.js +3 -10
  283. package/dist/domain/sourceToBundleComparisonSchemas.js +7 -6
  284. package/dist/domain/sourceToBundleSignals.js +9 -3
  285. package/dist/domain/staticRuntimeCorrelation.js +5 -11
  286. package/dist/domain/webBundleAnalysis.js +17 -9
  287. package/dist/domain/webBundleAnalyzer.js +1 -1
  288. package/dist/domain/webCaptureDiff.js +5 -11
  289. package/dist/domain/webCaptureDiffSchemas.js +2 -1
  290. package/dist/domain/webMcpDiscovery.js +2 -1
  291. package/dist/dotnet/ManagedMemberInspectorCore.js +15 -7
  292. package/dist/dotnet/ManagedMemberInstructionDecoder.js +57 -40
  293. package/dist/dotnet/ManagedMemberRows.js +2 -0
  294. package/dist/dotnet/ManagedMethodBodyReader.js +15 -8
  295. package/dist/dotnet/ManagedPeReader.js +2 -0
  296. package/dist/generatedMcpToolCatalog.js +1 -1
  297. package/dist/generatedPackageMetadata.js +2 -2
  298. package/dist/ghidra/GhidraAnalysisProfile.js +15 -5
  299. package/dist/ghidra/GhidraClient.js +38 -8
  300. package/dist/ghidra/GhidraFunctionValues.js +56 -20
  301. package/dist/ghidra/GhidraInstallation.js +7 -4
  302. package/dist/ghidra/GhidraInventoryValues.js +44 -9
  303. package/dist/ghidra/GhidraLauncher.js +18 -3
  304. package/dist/ghidra/GhidraProvider.js +23 -2
  305. package/dist/ghidra/GhidraRequestQueue.js +45 -4
  306. package/dist/ghidra/GhidraSessionValues.js +5 -0
  307. package/dist/hopper/HopperAnalysisProfile.js +2 -0
  308. package/dist/hopper/HopperProvider.js +29 -6
  309. package/dist/hopper/HopperTargetLease.js +18 -4
  310. package/dist/logger.js +0 -13
  311. package/dist/main/messages.js +0 -1
  312. package/dist/main/reload.js +3 -32
  313. package/dist/main/shutdown.js +1 -2
  314. package/dist/main/transport.js +0 -17
  315. package/dist/main.js +0 -10
  316. package/dist/native/AppleDispatchMetadata.js +582 -0
  317. package/dist/native/AppleObjcProtocols.js +88 -0
  318. package/dist/native/AppleSwiftVtables.js +86 -0
  319. package/dist/native/CommandRunner.js +1 -1
  320. package/dist/native/NativeHostCapabilities.js +23 -0
  321. package/dist/native/NativeMacOSProvider.js +61 -9
  322. package/dist/native/NativeMachoInspection.js +39 -6
  323. package/dist/native/NativeUiHelperRuntime.js +42 -0
  324. package/dist/native/NativeUiObservation.js +174 -0
  325. package/dist/native/parsers/codesign.js +4 -1
  326. package/dist/native/parsers/dyldInfo.js +51 -25
  327. package/dist/native/parsers/lipo.js +13 -4
  328. package/dist/native/parsers/otool.js +84 -39
  329. package/dist/native/parsers/plist.js +2 -1
  330. package/dist/process/ExecFileOutput.js +5 -1
  331. package/dist/process/ProcessOwnership.js +69 -33
  332. package/dist/process/ProcessOwnershipObservation.js +31 -12
  333. package/dist/process/ProviderProcess.js +4 -2
  334. package/dist/reference/ReferenceSourceReaderEntries.js +48 -31
  335. package/dist/reference/ReferenceSourceReaderErrors.js +24 -0
  336. package/dist/reference/ReferenceSourceReaderFile.js +11 -5
  337. package/dist/reference/ReferenceSourceReaderValidate.js +22 -8
  338. package/dist/server/createServer.js +7 -62
  339. package/dist/server/registerApplicationTools/helpers.js +2 -9
  340. package/dist/server/registerApplicationTools.js +0 -4
  341. package/dist/server/registerArtifactComparisonTool.js +1 -1
  342. package/dist/server/registerBrowserScenarioTool.js +4 -2
  343. package/dist/server/registerBrowserTools.js +7 -7
  344. package/dist/server/registerBundleComparisonTool.js +1 -1
  345. package/dist/server/registerCloseLifecycleTool.js +1 -1
  346. package/dist/server/registerElectronTools.js +10 -4
  347. package/dist/server/registerEnhancedTools.js +20 -12
  348. package/dist/server/registerEvidenceTools.js +4 -28
  349. package/dist/server/registerFunctionComparisonTool.js +1 -1
  350. package/dist/server/registerInvestigationTools.js +6 -6
  351. package/dist/server/registerJavaScriptRuntimeObservationTools.js +2 -2
  352. package/dist/server/registerManagedTools.js +28 -14
  353. package/dist/server/registerManagedWorkflowTools.js +0 -2
  354. package/dist/server/registerProcessComparisonTool.js +1 -3
  355. package/dist/server/registerSessionRecordTools.js +9 -9
  356. package/dist/server/registerSessionStatusTool.js +1 -1
  357. package/dist/server/registerSessionTools.js +28 -57
  358. package/dist/server/sessionAvailabilityPolicy.js +2 -3
  359. package/dist/server/sessionToolPolicies.js +0 -4
  360. package/dist/server/toolResult.js +8 -10
  361. package/package.json +32 -22
  362. package/skills/reverse-engineer-anything/SKILL.md +15 -11
  363. package/skills/reverse-engineer-anything/references/evidence-workflows.md +3 -2
  364. package/skills/reverse-engineer-anything/references/javascript-applications.md +3 -2
  365. package/skills/reverse-engineer-anything/references/native-and-artifacts.md +8 -6
  366. package/skills/reverse-engineer-anything/references/runtime-observation.md +15 -11
  367. package/dist/application/CommandShimReplay.js +0 -152
  368. package/dist/application/ConfiguredRoots.js +0 -19
  369. package/dist/application/InstrumentedJavaScriptReplayHost.js +0 -36
  370. package/dist/application/JavaScriptReplayPermission.js +0 -16
  371. package/dist/application/JavaScriptReplayPlanning.js +0 -207
  372. package/dist/application/JavaScriptReplayService.js +0 -274
  373. package/dist/application/LoopbackReplay.js +0 -389
  374. package/dist/application/LoopbackReplayRecorder.js +0 -129
  375. package/dist/application/ManagedRuntimeCorrelationService.js +0 -104
  376. package/dist/application/NodeRuntimeCharacterizationService.js +0 -191
  377. package/dist/application/PermissionAuthority.js +0 -268
  378. package/dist/application/PermissionConfiguration.js +0 -26
  379. package/dist/application/PermissionFailure.js +0 -5
  380. package/dist/application/ProcessCaptureAuthority.js +0 -24
  381. package/dist/application/ProcessCapturePermission.js +0 -13
  382. package/dist/application/ProcessCheckpoints.js +0 -178
  383. package/dist/application/ProcessReactiveCoordinator.js +0 -223
  384. package/dist/application/ProcessReactiveEffects.js +0 -153
  385. package/dist/application/ProcessReactiveHarness.js +0 -106
  386. package/dist/application/ProcessReactiveObservations.js +0 -105
  387. package/dist/application/ProjectPermissionStore.js +0 -199
  388. package/dist/application/RuntimeExecutableDiagnostics.js +0 -198
  389. package/dist/application/Upgrade.js +0 -134
  390. package/dist/browser/SensitiveTextCapture.js +0 -8
  391. package/dist/cliPolicyCommands.js +0 -185
  392. package/dist/config/browserScenario.js +0 -77
  393. package/dist/config/electronAutomation.js +0 -35
  394. package/dist/config/javascriptReplay.js +0 -41
  395. package/dist/config/managedRuntime.js +0 -25
  396. package/dist/config/passiveObservation.js +0 -87
  397. package/dist/config/permissions.js +0 -23
  398. package/dist/config/processCapture.js +0 -47
  399. package/dist/contracts/replayMachineExample.js +0 -37
  400. package/dist/domain/javascriptExportInstrumentation.js +0 -95
  401. package/dist/domain/javascriptReplay.js +0 -360
  402. package/dist/domain/managedRuntimeCorrelation.js +0 -181
  403. package/dist/domain/nodeRuntimeCharacterization.js +0 -63
  404. package/dist/domain/permissionPolicy.js +0 -176
  405. package/dist/domain/processCaptureReactiveSchema.js +0 -68
  406. package/dist/domain/processCaptureReactiveValidation.js +0 -180
  407. package/dist/domain/processReactiveCheckpointDataflow.js +0 -32
  408. package/dist/domain/processReactiveMatching.js +0 -196
  409. package/dist/domain/processReactiveRuntime.js +0 -116
  410. package/dist/domain/processReactiveScenario.js +0 -296
  411. package/dist/domain/processReactiveScenarioPreflight.js +0 -95
  412. package/dist/domain/processReactiveTransition.js +0 -187
  413. package/dist/domain/replayMachine.js +0 -320
  414. package/dist/domain/replayMachineRun.js +0 -168
  415. package/dist/domain/replayMachineRuntime.js +0 -296
  416. package/dist/domain/replayMachineValues.js +0 -84
  417. package/dist/domain/runtimeCharacterization.js +0 -84
  418. package/dist/replay/JavaScriptReplayWorker.js +0 -382
  419. package/dist/replay/JavaScriptReplayWorkerTypes.js +0 -1
  420. package/dist/replay/LinuxJavaScriptReplayRunner.js +0 -216
  421. package/dist/replay/LinuxJavaScriptReplaySandbox.js +0 -121
  422. package/dist/replay/LinuxRuntimeClosure.js +0 -44
  423. package/dist/replay/LinuxSeccompPolicy.js +0 -40
  424. package/dist/replay/ReplayOutcome.js +0 -104
  425. package/dist/replay/ReplayProcessLifecycle.js +0 -96
  426. package/dist/replay/ReplaySeccompFile.js +0 -29
  427. package/dist/replay/ReplayWorkerProtocol.js +0 -58
  428. package/dist/replay/SystemJavaScriptReplayHost.js +0 -153
  429. package/dist/server/ProcessCaptureElicitation.js +0 -153
  430. package/dist/server/registerApplicationTools/characterization.js +0 -46
  431. package/dist/server/registerApplicationTools/controlledReplay.js +0 -31
  432. package/dist/server/registerManagedWorkflowTools/planManagedRuntimeCorrelation.js +0 -29
  433. package/dist/server/registerReplayMachineTool.js +0 -14
  434. package/skills/reverse-engineer-anything/references/controlled-replay.md +0 -12
@@ -4,12 +4,9 @@ import { javaScriptSemanticTraceResultSchema } from "../domain/javascriptSemanti
4
4
  import { javaScriptExportShapeComparisonResultSchema } from "../domain/javascriptExportShapeComparisonSchemas.js";
5
5
  import { sourceToBundleComparisonResultSchema } from "../domain/sourceToBundleComparisonSchemas.js";
6
6
  import { compareApplicationVersionsRequestSchema, compareJavaScriptExportShapesRequestSchema, compareSourceToBundleRequestSchema, traceApplicationFeatureRequestSchema, traceJavaScriptSemanticsRequestSchema, } from "./applicationWorkflowInputContracts.js";
7
- import { controlledReplayInputSchema, controlledReplayOutputSchema, } from "../domain/javascriptReplay.js";
8
- import { nodeCharacterizationExecutionInputSchema, nodeCharacterizationExecutionOutputSchema, nodeCharacterizationPreparationInputSchema, nodeCharacterizationPreparationOutputSchema, } from "../domain/nodeRuntimeCharacterization.js";
9
7
  import { reconstructionCoverageEvaluationInputSchema } from "../application/ReconstructionCoverageService.js";
10
8
  import { reconstructionClosureResultSchema } from "../domain/reconstructionCoverage.js";
11
9
  import { reconstructionObligationLedgerInputSchema, reconstructionObligationLedgerSchema, } from "../domain/reconstructionObligationLedgerSchemas.js";
12
- import { jsonObjectSchema } from "../domain/jsonValue.js";
13
10
  import { toolContractMetadata } from "./toolEffects.js";
14
11
  import { evidenceResultOf } from "./toolOutputSchemas.js";
15
12
  import { JAVASCRIPT_APPLICATION_VERSION_COMPARISON_EXAMPLE, JAVASCRIPT_EXPORT_SHAPE_COMPARISON_EXAMPLE, JAVASCRIPT_FEATURE_TRACE_EXAMPLE, SOURCE_TO_BUNDLE_COMPARISON_EXAMPLE, } from "./javascriptApplicationWorkflowExamples.js";
@@ -20,37 +17,6 @@ const sourceToBundleOutputSchema = evidenceResultOf(sourceToBundleComparisonResu
20
17
  const exportShapeComparisonOutputSchema = evidenceResultOf(javaScriptExportShapeComparisonResultSchema);
21
18
  const reconstructionObligationLedgerOutputSchema = evidenceResultOf(reconstructionObligationLedgerSchema);
22
19
  const HASH = "0".repeat(64);
23
- const NODE_PREPARATION_EXAMPLE = jsonObjectSchema.parse({
24
- selected_alias: "bundle",
25
- expected_effect: "pure",
26
- instrumentation: {
27
- artifact_path: "/tmp/example/bundle.js",
28
- artifact_sha256: HASH,
29
- selection: {
30
- byte_start: 100,
31
- byte_end: 120,
32
- selected_sha256: HASH,
33
- export_name: "selected",
34
- },
35
- },
36
- replay: {
37
- mode: "plan",
38
- left: {
39
- modules: [
40
- {
41
- alias: "bundle",
42
- path: "/tmp/example/bundle.js",
43
- format: "commonjs-factory",
44
- role: "module",
45
- dependencies: {},
46
- },
47
- ],
48
- entry_alias: "bundle",
49
- entry_export: "selected",
50
- },
51
- cases: [{ case_id: "empty", arguments: [""] }],
52
- },
53
- });
54
20
  /** Provider-neutral graph workflow contracts shared by MCP and CLI adapters. */
55
21
  export const APPLICATION_TOOL_CONTRACTS = [
56
22
  {
@@ -82,7 +48,6 @@ export const APPLICATION_TOOL_CONTRACTS = [
82
48
  query: {
83
49
  seed: { kind: "semantic-node", node_id: `jsrg_node_${HASH}` },
84
50
  direction: "backward-provenance",
85
- source_map_authority: { authority: "none" },
86
51
  },
87
52
  },
88
53
  },
@@ -119,7 +84,7 @@ export const APPLICATION_TOOL_CONTRACTS = [
119
84
  {
120
85
  name: "compare_javascript_export_shapes",
121
86
  ...toolContractMetadata("compare_javascript_export_shapes"),
122
- description: "Compare static return shapes for one exact module/export selector on each authenticated JavaScript Application Graph supplied as inline Evidence. Variants pair only by reciprocal unique literal discriminants; dynamic values, incomplete properties, and ambiguous variants remain unknown. Reports JSON Pointer changes and recommends controlled replay separately without executing JavaScript.",
87
+ description: "Compare static return shapes for one exact module/export selector on each authenticated JavaScript Application Graph supplied as inline Evidence. Variants pair only by reciprocal unique literal discriminants; dynamic values, incomplete properties, and ambiguous variants remain unknown. Reports JSON Pointer changes without executing JavaScript; runtime behavior requires a separate agent-run probe.",
123
88
  kind: "application",
124
89
  inputSchema: compareJavaScriptExportShapesRequestSchema,
125
90
  outputSchema: exportShapeComparisonOutputSchema,
@@ -130,88 +95,6 @@ export const APPLICATION_TOOL_CONTRACTS = [
130
95
  },
131
96
  ],
132
97
  },
133
- {
134
- name: "run_controlled_replay",
135
- ...toolContractMetadata("run_controlled_replay"),
136
- description: "Plan or execute a content-bound extracted-module JavaScript replay inside the Linux Bubblewrap, seccomp, and cgroup boundary. Execution requires the exact plan digest. Supports deterministic boundary cases and optional left/right differential comparison; observations have controlled-replay authority and do not claim real application runtime behavior.",
137
- kind: "application",
138
- inputSchema: controlledReplayInputSchema,
139
- outputSchema: controlledReplayOutputSchema,
140
- examples: [
141
- {
142
- title: "Plan one extracted ESM parser replay",
143
- input: {
144
- mode: "plan",
145
- left: {
146
- modules: [
147
- {
148
- alias: "parser",
149
- path: "/tmp/example/parser.mjs",
150
- format: "esm",
151
- role: "module",
152
- dependencies: {},
153
- },
154
- ],
155
- entry_alias: "parser",
156
- entry_export: "default",
157
- },
158
- cases: [{ case_id: "empty", arguments: [""] }],
159
- determinism: {
160
- clock_iso: "2000-01-01T00:00:00.000Z",
161
- random_seed: 0,
162
- locale: "en-US",
163
- timezone: "UTC",
164
- platform: "linux",
165
- },
166
- limits: {
167
- wall_time_ms: 3000,
168
- memory_bytes: 134217728,
169
- tasks: 8,
170
- cpu_quota_percent: 50,
171
- tmpfs_bytes: 16777216,
172
- module_bytes: 4194304,
173
- input_bytes: 262144,
174
- protocol_bytes: 16777216,
175
- output_bytes: 524288,
176
- stderr_bytes: 32768,
177
- result_depth: 16,
178
- result_nodes: 10000,
179
- },
180
- },
181
- },
182
- ],
183
- },
184
- {
185
- name: "prepare_node_characterization",
186
- ...toolContractMetadata("prepare_node_characterization"),
187
- description: "Prepare a hash-bound Node/JavaScript characterization plan and deterministic reversible export transformation without executing target code. The exact source, selected byte range, runtime closure, sandbox profile, cases, and limits are committed for later execution.",
188
- kind: "application",
189
- inputSchema: nodeCharacterizationPreparationInputSchema,
190
- outputSchema: nodeCharacterizationPreparationOutputSchema,
191
- examples: [
192
- {
193
- title: "Prepare one exact bundled callable characterization",
194
- input: NODE_PREPARATION_EXAMPLE,
195
- },
196
- ],
197
- },
198
- {
199
- name: "execute_node_characterization",
200
- ...toolContractMetadata("execute_node_characterization"),
201
- description: "Recompute and execute one exact Node characterization plan in the owned controlled-replay boundary. Returns transformation, replay, cleanup, and provider-neutral characterization Evidence; stale plans fail before execution.",
202
- kind: "application",
203
- inputSchema: nodeCharacterizationExecutionInputSchema,
204
- outputSchema: nodeCharacterizationExecutionOutputSchema,
205
- examples: [
206
- {
207
- title: "Execute one exact characterization plan",
208
- input: {
209
- approved_plan_sha256: HASH,
210
- preparation: NODE_PREPARATION_EXAMPLE,
211
- },
212
- },
213
- ],
214
- },
215
98
  {
216
99
  name: "build_reconstruction_obligation_ledger",
217
100
  ...toolContractMetadata("build_reconstruction_obligation_ledger"),
@@ -3,27 +3,15 @@ import { artifactOutputSchemas } from "./toolOutputSchemas.js";
3
3
  import { jsonValueSchema } from "../domain/jsonValue.js";
4
4
  import { toolContractMetadata } from "./toolEffects.js";
5
5
  import { requireOutputSchema } from "./toolOutputSchemaPrimitives.js";
6
- const integrityInput = {
7
- fail: {
8
- integrity_policy: z.literal("fail").default("fail"),
9
- integrity_continue_approved: z.literal(false).default(false),
10
- },
11
- continue: {
12
- integrity_policy: z.literal("record-and-continue"),
13
- integrity_continue_approved: z.literal(true),
14
- },
15
- };
16
- const artifactInventoryFacts = {
17
- native_mount_approved: z.boolean().default(false),
18
- };
6
+ import { appleAssetCatalogInputSchema } from "../domain/appleAssetCatalog.js";
7
+ import { keyedArchiveInputSchema } from "../domain/keyedArchive.js";
19
8
  /** Exact caller boundary for deterministic artifact inventory. */
20
- export const artifactInventoryInputSchema = z.union([
21
- z.object({ ...artifactInventoryFacts, ...integrityInput.fail }),
22
- z.object({ ...artifactInventoryFacts, ...integrityInput.continue }),
23
- ]);
9
+ export const artifactInventoryInputSchema = z.strictObject({
10
+ integrity_policy: z.enum(["fail", "record-and-continue"]).default("fail"),
11
+ });
24
12
  /** Extraction needs no selector: it materializes every regular child file. */
25
13
  export const artifactExtractionInputSchema = z.strictObject({});
26
- /** Provider input after the local permission boundary chooses its destination. */
14
+ /** Provider input containing the destination chosen by the local adapter. */
27
15
  export const artifactExtractionExecutionSchema = z.strictObject({
28
16
  output_root: z.string().min(1),
29
17
  });
@@ -32,6 +20,8 @@ const examples = {
32
20
  inspect_artifact: {},
33
21
  extract_artifact: {},
34
22
  decode_interface_builder: {},
23
+ inspect_asset_catalog: { offset: 0, limit: 1000 },
24
+ inspect_keyed_archive: { path: "Contents/Resources/Model.plist" },
35
25
  };
36
26
  const artifact = (name, description, inputSchema) => {
37
27
  const outputSchema = requireOutputSchema(artifactOutputSchemas, name);
@@ -52,13 +42,15 @@ const artifact = (name, description, inputSchema) => {
52
42
  };
53
43
  /** Artifact-graph inventory and safe extraction contracts. */
54
44
  export const ARTIFACT_TOOL_CONTRACTS = [
55
- artifact("inspect_artifact", "Inspect an active archive or application package in one call. Returns the complete content-addressed artifact graph, source Evidence, observations, relationships, integrity contradictions, hypotheses, unexplored branches, limitations, and next probes inline. It does not extract files; use extract_artifact to materialize its regular contents.", artifactInventoryInputSchema),
45
+ artifact("inspect_artifact", "Inspect an active archive or application package in one call. Returns the complete content-addressed artifact graph, source Evidence, observations, relationships, integrity contradictions, hypotheses, unexplored branches, limitations, and next probes inline. Read-only DMG mounting is used automatically on supported macOS hosts. Integrity mismatches fail by default; record-and-continue keeps mismatches explicitly untrusted. It does not extract files; use extract_artifact to materialize its regular contents.", artifactInventoryInputSchema),
56
46
  artifact("extract_artifact", "Extract all regular files from the active archive or application package into a fresh temporary directory chosen by REA. The result includes its location. Rejects traversal and symlink escapes, never overwrites, enforces archive integrity checks, and verifies cleanup.", artifactExtractionInputSchema),
57
47
  artifact("decode_interface_builder", "Decode compiled storyboard and nib archives inside the active Apple app bundle, including keyed property lists and NIBArchive object tables, into a bounded object, hierarchy, and connection graph. This is static archive parsing; unrecognized archive classes and unresolved code handlers remain explicit unknowns.", z.strictObject({
58
48
  max_documents: z.number().int().min(1).max(64).default(64),
59
49
  max_objects: z.number().int().min(1).max(20_000).default(20_000),
60
50
  max_connections: z.number().int().min(1).max(40_000).default(40_000),
61
51
  })),
52
+ artifact("inspect_keyed_archive", "Inspect one Foundation NSKeyedArchiver plist in the active app bundle as original object-table nodes, class descriptors, named roots, and UID edges. Preserves shared and cyclic references without instantiating classes. The path is relative to the bundle; root selection and object pagination preserve original identities.", keyedArchiveInputSchema),
53
+ artifact("inspect_asset_catalog", "Inspect compiled Assets.car metadata in an active Apple app bundle. Returns stable paginated catalog and rendition records with raw assetutil metadata and catalog digests; rendition bytes are not extracted.", appleAssetCatalogInputSchema),
62
54
  ];
63
55
  /** Provider operations; inventory remains an internal primitive of inspection. */
64
56
  export const ARTIFACT_ANALYSIS_OPERATIONS = [
@@ -6,12 +6,8 @@ const example = {
6
6
  browser: {
7
7
  mode: "launch",
8
8
  executable_path: "/opt/chromium/chrome",
9
- headless: true,
10
- user_data: "temporary-owned",
11
- cleanup: "close-and-delete-profile",
12
9
  },
13
10
  start_url: { url: "https://app.example.test/", query: [] },
14
- allowed_origins: ["https://app.example.test"],
15
11
  actions: [
16
12
  {
17
13
  step_id: "settle",
@@ -25,7 +21,7 @@ export const BROWSER_SCENARIO_TOOL_CONTRACTS = [
25
21
  {
26
22
  name: "capture_browser_scenario",
27
23
  ...toolContractMetadata("capture_browser_scenario"),
28
- description: "Run a controlled browser scenario when passive observation cannot exercise the application. Launch an approved executable or connect to an approved loopback CDP target, declare the allowed origins, and provide actions. Environment, empty storage, disabled request replay, redaction, and a URL-only final capture are defaults; provide secrets, initial storage, request replay, or additional artifacts when needed. Actions run until completion or cancellation unless timeout_ms is set. Results are returned inline.",
24
+ description: "Run a controlled browser scenario when passive observation cannot exercise the application. Launch the selected executable or connect to a loopback CDP target, provide a start URL and actions, and select storage or artifacts when needed. Environment, empty storage, and a URL-only final capture are defaults; provide initial storage or additional artifacts when needed. Agents can run their own local fixture servers to control application responses. Actions run until completion or cancellation unless timeout_ms is set. Results are returned inline.",
29
25
  kind: "browser-provider",
30
26
  inputSchema: browserScenarioInputSchema,
31
27
  outputSchema: evidenceResultOf(browserScenarioCaptureSchema),
@@ -47,7 +47,6 @@ const exampleScenarioCapture = () => ({
47
47
  },
48
48
  scenario: {
49
49
  start_origin: origin,
50
- allowed_origins: [origin],
51
50
  action_count: 1,
52
51
  secret_references: [],
53
52
  },
@@ -86,21 +85,20 @@ const exampleScenarioCapture = () => ({
86
85
  completeness: scenarioCompleteness,
87
86
  limitations: [],
88
87
  });
89
- /** Origin-scoped, passive browser reverse-engineering contracts. */
88
+ /** Passive browser reverse-engineering contracts. */
90
89
  export const BROWSER_TOOL_CONTRACTS = [
91
90
  {
92
91
  name: "list_browser_targets",
93
92
  ...toolContractMetadata("list_browser_targets"),
94
- description: "List every page target from an approved user-owned loopback Chrome DevTools Protocol endpoint whose current URL matches an approved exact origin. URL credentials, query values, and fragments are redacted.",
93
+ description: "List page targets exposed by the selected loopback Chrome DevTools Protocol endpoint. Optionally filter by exact origin. URLs preserve query values and fragments; only URL userinfo credentials are removed.",
95
94
  kind: "browser-provider",
96
95
  inputSchema: listBrowserTargetsInputSchema,
97
96
  outputSchema: listOutputSchema,
98
97
  examples: [
99
98
  {
100
- title: "List approved browser page targets",
99
+ title: "List browser page targets",
101
100
  input: {
102
101
  cdp_endpoint: endpoint,
103
- allowed_origins: [origin],
104
102
  },
105
103
  },
106
104
  ],
@@ -108,16 +106,15 @@ export const BROWSER_TOOL_CONTRACTS = [
108
106
  {
109
107
  name: "inspect_web_page",
110
108
  ...toolContractMetadata("inspect_web_page"),
111
- description: "Passively inspect one approved page target through CDP without evaluating JavaScript, navigating, clicking, closing, or mutating the page. Returns DOM structure, accessibility, scripts, resources, attach-window network and console metadata, workers, and redacted storage inventory as Evidence.",
109
+ description: "Passively inspect one selected page target through CDP without evaluating JavaScript, navigating, clicking, closing, or mutating the page. If no origin filter is supplied, capture is scoped to the target's current origin. Returns DOM structure, accessibility, scripts, resources, attach-window network and console metadata, workers, and redacted storage inventory as Evidence.",
112
110
  kind: "browser-provider",
113
111
  inputSchema: inspectWebPageInputSchema,
114
112
  outputSchema: inspectionOutputSchema,
115
113
  examples: [
116
114
  {
117
- title: "Inspect one approved browser page",
115
+ title: "Inspect one browser page",
118
116
  input: {
119
117
  cdp_endpoint: endpoint,
120
- allowed_origins: [origin],
121
118
  target_id: "TARGET_ID_FROM_LIST_BROWSER_TARGETS",
122
119
  },
123
120
  },
@@ -126,16 +123,15 @@ export const BROWSER_TOOL_CONTRACTS = [
126
123
  {
127
124
  name: "analyze_web_bundle",
128
125
  ...toolContractMetadata("analyze_web_bundle"),
129
- description: "Capture JavaScript source from one configured CDP page and statically derive a chunk graph, route and endpoint candidates, vendor fingerprints, page-declared WebMCP metadata, and optionally fetch source maps from allowed origins. JavaScript is parsed but never executed.",
126
+ description: "Capture JavaScript source from one selected CDP page and statically derive a chunk graph, route and endpoint candidates, vendor fingerprints, page-declared WebMCP metadata, and optionally fetch source maps from the selected target origin or explicitly requested origins. JavaScript is parsed but never executed.",
130
127
  kind: "browser-provider",
131
128
  inputSchema: analyzeWebBundleInputSchema,
132
129
  outputSchema: bundleOutputSchema,
133
130
  examples: [
134
131
  {
135
- title: "Analyze an approved page bundle",
132
+ title: "Analyze a page bundle",
136
133
  input: {
137
134
  cdp_endpoint: endpoint,
138
- allowed_origins: [origin],
139
135
  target_id: "TARGET_ID_FROM_LIST_BROWSER_TARGETS",
140
136
  observation_ms: 500,
141
137
  include_accessibility_text: false,
@@ -149,7 +145,7 @@ export const BROWSER_TOOL_CONTRACTS = [
149
145
  {
150
146
  name: "observe_web_session",
151
147
  ...toolContractMetadata("observe_web_session"),
152
- description: "Arm a CDP observation window of the requested duration while the user operates the page. Allows approved same-origin reload and SPA navigation, records every observed navigation, redirect, lifecycle, and failure event, and stops before retaining an out-of-policy destination.",
148
+ description: "Arm a CDP observation window of the requested duration while the user operates the page. By default it follows the selected target's current origin; an explicit origin list controls which origins may be retained. Records navigation, redirect, lifecycle, and failure events.",
153
149
  kind: "browser-provider",
154
150
  inputSchema: observeWebSessionInputSchema,
155
151
  outputSchema: observationSessionOutputSchema,
@@ -158,7 +154,6 @@ export const BROWSER_TOOL_CONTRACTS = [
158
154
  title: "Observe one external user action",
159
155
  input: {
160
156
  cdp_endpoint: endpoint,
161
- allowed_origins: [origin],
162
157
  target_id: "TARGET_ID_FROM_LIST_BROWSER_TARGETS",
163
158
  observation_ms: 10_000,
164
159
  },
@@ -177,7 +172,6 @@ export const BROWSER_TOOL_CONTRACTS = [
177
172
  title: "Discover current WebMCP declarations",
178
173
  input: {
179
174
  cdp_endpoint: endpoint,
180
- allowed_origins: [origin],
181
175
  target_id: "TARGET_ID_FROM_LIST_BROWSER_TARGETS",
182
176
  observation_ms: 100,
183
177
  },
@@ -220,10 +214,9 @@ export const BROWSER_TOOL_CONTRACTS = [
220
214
  outputSchema: screenshotOutputSchema,
221
215
  examples: [
222
216
  {
223
- title: "Capture an approved viewport",
217
+ title: "Capture a viewport",
224
218
  input: {
225
219
  cdp_endpoint: endpoint,
226
- allowed_origins: [origin],
227
220
  target_id: "TARGET_ID_FROM_LIST_BROWSER_TARGETS",
228
221
  },
229
222
  },
@@ -13,22 +13,21 @@ const endpoint = "http://127.0.0.1:9223";
13
13
  const activeExample = {
14
14
  executable_path: "/Applications/Electron.app/Contents/MacOS/Electron",
15
15
  application_path: "/Applications/Example.app/Contents/Resources/main.js",
16
- application_root: "/Applications/Example.app/Contents/Resources",
17
16
  args: [],
18
17
  actions: [{ step_id: "exercise-ipc", kind: "click", selector: "#run" }],
19
18
  };
20
- /** Root-confined Electron file-page discovery and inspection contracts. */
19
+ /** Endpoint-scoped Electron file-page discovery and inspection contracts. */
21
20
  export const ELECTRON_TOOL_CONTRACTS = [
22
21
  {
23
22
  name: "list_electron_targets",
24
23
  ...toolContractMetadata("list_electron_targets"),
25
- description: "List every Electron file:// page target from an approved user-owned loopback CDP endpoint. Every path is canonicalized and must remain contained by an approved filesystem root, including after symlink resolution.",
24
+ description: "List every Electron file:// page target from a selected loopback CDP endpoint. Local file paths are canonicalized after symlink resolution. Selecting an endpoint exposes every eligible target and its local path metadata.",
26
25
  kind: "electron-provider",
27
26
  inputSchema: listElectronTargetsInputSchema,
28
27
  outputSchema: listOutputSchema,
29
28
  examples: [
30
29
  {
31
- title: "List approved Electron file pages",
30
+ title: "List Electron file pages",
32
31
  input: {
33
32
  cdp_endpoint: endpoint,
34
33
  },
@@ -44,7 +43,7 @@ export const ELECTRON_TOOL_CONTRACTS = [
44
43
  outputSchema: inspectionOutputSchema,
45
44
  examples: [
46
45
  {
47
- title: "Inspect an approved Electron page",
46
+ title: "Inspect an Electron page",
48
47
  input: {
49
48
  cdp_endpoint: endpoint,
50
49
  target_id: "TARGET_ID_FROM_LIST_ELECTRON_TARGETS",
@@ -86,7 +85,7 @@ export const ELECTRON_TOOL_CONTRACTS = [
86
85
  {
87
86
  name: "capture_electron_scenario",
88
87
  ...toolContractMetadata("capture_electron_scenario"),
89
- description: "Use this for an explicitly approved, provider-owned Electron run when passive CDP or Inspector observation cannot exercise application behavior. REA owns startup and teardown, accepts caller-defined click/wait actions plus window-targeted renderer reload/crash and synthetic open-url/second-instance delivery, and returns correlated window/WebContents/process/preload/session/navigation/shell/IPC evidence without retaining payload values. Results identify observed and unavailable event families, coverage status, action targets, and truncation. External shell, navigation, permission, download, popup, updater, and OS-integration effects are blocked and recorded. Use passive Electron tools for observation-only work.",
88
+ description: "Use this for a provider-owned Electron run when passive CDP or Inspector observation cannot exercise application behavior. REA owns startup and teardown, accepts caller-defined click/wait actions plus window-targeted renderer reload/crash and synthetic open-url/second-instance delivery, and returns correlated window/WebContents/process/preload/session/navigation/shell/IPC evidence without retaining payload values. Results identify observed and unavailable event families, coverage status, action targets, and truncation. External shell, navigation, permission, download, popup, updater, and OS-integration effects are blocked and recorded. Use passive Electron tools for observation-only work.",
90
89
  kind: "electron-provider",
91
90
  inputSchema: electronActiveObservationInputSchema,
92
91
  outputSchema: evidenceResultOf(electronActiveObservationResultSchema),
@@ -1,10 +1,12 @@
1
1
  import { z } from "zod";
2
+ import { nativeValueTraceInputSchema } from "../domain/nativeValueTrace.js";
2
3
  const traceLiteralInputSchema = z.strictObject({
3
4
  query: z.string().min(1),
4
5
  case_sensitive: z.boolean().default(false),
5
6
  });
6
7
  /** Input schemas shared by MCP registration and enhanced application dispatch. */
7
8
  export const enhancedInputSchemas = {
9
+ trace_native_values: nativeValueTraceInputSchema,
8
10
  inspect_native_dispatch_metadata: z.strictObject({
9
11
  max_records: z.number().int().min(1).max(20_000).default(5_000),
10
12
  }),
@@ -38,7 +40,6 @@ export const enhancedInputSchemas = {
38
40
  procedure: z.string().describe("A procedure name or address"),
39
41
  }),
40
42
  trace_feature: traceLiteralInputSchema,
41
- find_code_for_string: traceLiteralInputSchema,
42
43
  trace_call_path: z.strictObject({
43
44
  start: z.string().describe("A provider-normalized procedure address"),
44
45
  goal: z
@@ -51,7 +52,7 @@ export const enhancedInputSchemas = {
51
52
  action: z
52
53
  .string()
53
54
  .min(1)
54
- .describe("A unique compiled UI action selector or interface object ID"),
55
+ .describe("A unique compiled UI action selector, interface object ID, native symbol or exact function address"),
55
56
  max_depth: z.number().int().min(0).max(32).default(8),
56
57
  max_nodes: z.number().int().min(1).max(2_000).default(250),
57
58
  max_edges: z.number().int().min(1).max(5_000).default(500),
@@ -1,7 +1,6 @@
1
1
  import { z } from "zod";
2
2
  const categorySchema = z.enum([
3
3
  "invalid_input",
4
- "permission_required",
5
4
  "unsupported_provider",
6
5
  "integrity_mismatch",
7
6
  "truncated",
@@ -13,8 +12,6 @@ const categorySchema = z.enum([
13
12
  const remediationSchema = z
14
13
  .object({
15
14
  action: z.string().min(1),
16
- restart_required: z.boolean(),
17
- elicitation_supported: z.boolean().optional(),
18
15
  })
19
16
  .strict();
20
17
  const common = {
@@ -27,27 +24,6 @@ const genericDetails = z.record(z.string(), z.json()).optional();
27
24
  const generic = (code) => z
28
25
  .object({ code: z.literal(code), ...common, details: genericDetails })
29
26
  .strict();
30
- const scopeSchema = z
31
- .object({
32
- capability: z.string(),
33
- roots: z.array(z.string()),
34
- executables: z.array(z.string()),
35
- environment_names: z.array(z.string()),
36
- origins: z.array(z.string()).optional(),
37
- network: z.enum(["none", "loopback", "external"]),
38
- mount: z.boolean(),
39
- })
40
- .strict();
41
- const missingScopeSchema = z
42
- .object({
43
- roots: z.array(z.string()).optional(),
44
- executables: z.array(z.string()).optional(),
45
- environment_names: z.array(z.string()).optional(),
46
- origins: z.array(z.string()).optional(),
47
- network: z.enum(["none", "loopback", "external"]).optional(),
48
- mount: z.literal(true).optional(),
49
- })
50
- .strict();
51
27
  /** Stable discriminated schema shared by every CLI and MCP error surface. */
52
28
  export const analysisErrorProjectionSchema = z.discriminatedUnion("code", [
53
29
  generic("invalid_request"),
@@ -73,28 +49,28 @@ export const analysisErrorProjectionSchema = z.discriminatedUnion("code", [
73
49
  generic("artifact_operation_failed"),
74
50
  generic("evidence_integrity_mismatch"),
75
51
  generic("truncated"),
76
- z
77
- .object({
78
- code: z.literal("permission_required"),
79
- ...common,
80
- details: z
81
- .object({
82
- capability: z.string(),
83
- requested: scopeSchema,
84
- missing: missingScopeSchema,
85
- ceiling: scopeSchema.nullable(),
86
- })
87
- .strict()
88
- .optional(),
89
- })
90
- .strict(),
91
52
  generic("process_capture_failed"),
92
53
  generic("cleanup_incomplete"),
93
54
  generic("revision_conflict"),
94
55
  generic("configuration_invalid"),
95
56
  generic("target_unavailable"),
96
57
  generic("execution_failure"),
97
- generic("plan_stale"),
98
58
  ]);
59
+ /** Legacy CLI envelope: a human label plus the canonical projected error fields. */
60
+ export const analysisCliErrorEnvelopeSchema = z
61
+ .object({
62
+ error: z.string().min(1),
63
+ })
64
+ .passthrough()
65
+ .superRefine((value, context) => {
66
+ const { error: _label, ...projection } = value;
67
+ const parsed = analysisErrorProjectionSchema.safeParse(projection);
68
+ if (!parsed.success) {
69
+ context.addIssue({
70
+ code: "custom",
71
+ message: "CLI error envelope must contain a canonical analysis error projection",
72
+ });
73
+ }
74
+ });
99
75
  /** JSON Schema document used by generated API documentation and clients. */
100
76
  export const analysisErrorJsonSchema = z.toJSONSchema(analysisErrorProjectionSchema);
@@ -24,6 +24,6 @@ const functionWorkflow = (name, description) => {
24
24
  };
25
25
  /** Function dossier and native API reconstruction workflow contracts. */
26
26
  export const FUNCTION_WORKFLOW_TOOL_CONTRACTS = [
27
- functionWorkflow("analyze_function", "Build a dossier for one native function identified by symbol or provider-returned address. Returns identity, provider-specific pseudocode and assembly, comments, calls, references, referenced strings/names, local CFG blocks, and available native API boundary observations."),
28
- functionWorkflow("inspect_native_api", "Analyze a native API boundary in one function identified by symbol or provider-returned address. Returns confidence, evidence, jump-table dispatch/data/target mappings, unsupported branches, and residual unknowns."),
27
+ functionWorkflow("analyze_function", "Build a dossier for one native function identified by symbol or provider-returned address. Returns identity with complete inclusive body ranges or explicit unknown, provider-specific pseudocode and assembly, comments, calls, references, referenced strings/names, local CFG blocks, and available native API boundary observations."),
28
+ functionWorkflow("inspect_native_api", "Analyze a native API boundary in one function identified by symbol or provider-returned address. Returns confidence, evidence, jump-table dispatch/data/case mappings, separately evidenced default targets, unsupported branches, and residual unknowns. Null case values mean unresolved cases, never a known default."),
29
29
  ];
@@ -11,8 +11,8 @@ const reconciliationEvidence = createEvidence(undefined, {
11
11
  predicateType: "rea.javascript-runtime-reconciliation",
12
12
  operation: "reconcile_javascript_runtime",
13
13
  parameters: {
14
- static_layers: JAVASCRIPT_RUNTIME_RECONCILIATION_EXAMPLE.static_layers.map(({ role, analysis }) => ({
15
- role,
14
+ static_layers: JAVASCRIPT_RUNTIME_RECONCILIATION_EXAMPLE.static_layers.map(({ analysis }) => ({
15
+ role: "application",
16
16
  evidence_id: analysis.evidence_id,
17
17
  runtime_mappings: [],
18
18
  })),
@@ -7,13 +7,13 @@ export const JAVASCRIPT_RUNTIME_OBSERVATION_TOOL_CONTRACTS = [
7
7
  {
8
8
  name: "list_javascript_runtime_targets",
9
9
  ...toolContractMetadata("list_javascript_runtime_targets"),
10
- description: "List every attachable Node/Electron V8 Inspector target from an explicit literal-loopback endpoint. Every returned target and script location exposed by that Inspector endpoint is eligible for Evidence.",
10
+ description: "List every eligible Node/Electron V8 Inspector target from an explicit literal-loopback endpoint. Node discovery file locations that cannot be verified are preserved as unresolved reported URLs; they do not prove filesystem identity. Listing does not attach to targets.",
11
11
  kind: "runtime-provider",
12
12
  inputSchema: listJavaScriptRuntimeTargetsInputSchema,
13
13
  outputSchema: evidenceResultOf(javascriptRuntimeTargetListSchema),
14
14
  examples: [
15
15
  {
16
- title: "List approved Node Inspector targets",
16
+ title: "List Node Inspector targets",
17
17
  input: {
18
18
  inspector_endpoint: endpoint,
19
19
  },
@@ -23,13 +23,13 @@ export const JAVASCRIPT_RUNTIME_OBSERVATION_TOOL_CONTRACTS = [
23
23
  {
24
24
  name: "observe_javascript_runtime",
25
25
  ...toolContractMetadata("observe_javascript_runtime"),
26
- description: "Attach passively to one Node/Electron V8 Inspector target by supplying its loopback Inspector endpoint and target ID. The provider rechecks that the target currently exists at that endpoint and is an attachable file or URL target. Captures Debugger.scriptParsed and Runtime execution-context events. REA never evaluates, pauses, resumes, reads source, or instruments the target; require/import edges, EventEmitter activity, and Electron IPC remain explicit unknowns. Reconcile the result with static Application Graph Evidence using reconcile_javascript_runtime. The selected endpoint exposes every target it serves to this tool.",
26
+ description: "Attach passively to one Node/Electron V8 Inspector target by supplying its loopback Inspector endpoint and target ID. The provider rechecks target presence and attachability; a Node discovery file location may remain unresolved. Loaded script locations are validated independently from Debugger.scriptParsed. Captures script and Runtime execution-context metadata. REA never evaluates, pauses, resumes, reads source, or instruments the target; require/import edges, EventEmitter activity, and Electron IPC remain explicit unknowns. Reconcile the result with static Application Graph Evidence using reconcile_javascript_runtime. The selected endpoint exposes every target it serves to this tool.",
27
27
  kind: "runtime-provider",
28
28
  inputSchema: observeJavaScriptRuntimeInputSchema,
29
29
  outputSchema: evidenceResultOf(javascriptRuntimeObservationSchema),
30
30
  examples: [
31
31
  {
32
- title: "Observe one approved Node runtime",
32
+ title: "Observe one Node runtime",
33
33
  input: {
34
34
  inspector_endpoint: endpoint,
35
35
  target_id: "TARGET_ID_FROM_LIST_JAVASCRIPT_RUNTIME_TARGETS",
@@ -215,7 +215,7 @@ const runtimeEvidence = createEvidence(undefined, {
215
215
  });
216
216
  /** Compact valid Evidence pair used by the public reconciliation contract. */
217
217
  export const JAVASCRIPT_RUNTIME_RECONCILIATION_EXAMPLE = {
218
- static_layers: [{ role: "application", analysis: staticEvidence }],
218
+ static_layers: [{ analysis: staticEvidence }],
219
219
  runtime_observations: [runtimeEvidence],
220
220
  };
221
221
  function browserCompleteness() {
@@ -3,17 +3,18 @@ import { managedOutputSchemas } from "./toolOutputSchemas.js";
3
3
  import { toolContractMetadata } from "./toolEffects.js";
4
4
  import { requireOutputSchema } from "./toolOutputSchemaPrimitives.js";
5
5
  /** Exact caller boundary for execution-free PE/CLI triage and identity. */
6
- export const managedArtifactInputSchema = z.object({
6
+ const managedTargetInputSchema = z.object({
7
7
  path: z
8
8
  .string()
9
9
  .min(1)
10
10
  .optional()
11
- .describe("Managed PE/CLI path to open before inspection; omit only when a managed target is already active"),
11
+ .describe("Explicit managed PE/CLI path; omit to reuse the previously selected managed target"),
12
12
  });
13
+ export const managedArtifactInputSchema = managedTargetInputSchema;
13
14
  /** Exact caller boundary for execution-free metadata/signature/IL inspection. */
14
- export const managedMemberInputSchema = z.object({});
15
+ export const managedMemberInputSchema = managedTargetInputSchema;
15
16
  /** Exact caller boundary for execution-free managed/native boundary inspection. */
16
- export const managedNativeBoundaryInputSchema = z.object({});
17
+ export const managedNativeBoundaryInputSchema = managedTargetInputSchema;
17
18
  const outputSchema = requireOutputSchema(managedOutputSchemas, "inspect_managed_artifact");
18
19
  const memberOutputSchema = requireOutputSchema(managedOutputSchemas, "inspect_managed_members");
19
20
  const nativeBoundaryOutputSchema = requireOutputSchema(managedOutputSchemas, "inspect_managed_native_boundaries");
@@ -62,3 +63,5 @@ export const MANAGED_TOOL_CONTRACTS = [
62
63
  ],
63
64
  },
64
65
  ];
66
+ /** Parse whether an analysis operation belongs to the managed static tools. */
67
+ export const isManagedToolName = (name) => MANAGED_TOOL_CONTRACTS.some((contract) => contract.name === name);
@@ -274,25 +274,3 @@ export const MANAGED_NATIVE_VERIFICATION_EXAMPLE = {
274
274
  managed_boundaries: boundaryEvidence(),
275
275
  native_observations: [nativeExportEvidence()],
276
276
  };
277
- /** Minimal valid managed runtime-correlation planning request. */
278
- export const MANAGED_RUNTIME_CORRELATION_EXAMPLE = {
279
- static_members: runtimeExampleEvidence,
280
- method: {
281
- token: "0x06000001",
282
- signature_sha256: "3".repeat(64),
283
- normalized_il_sha256: "5".repeat(64),
284
- },
285
- requested_effect: "attach",
286
- host: {
287
- os: "linux",
288
- clr_family: "dotnet",
289
- architecture: "x86_64",
290
- },
291
- bounds: {
292
- timeout_ms: 5_000,
293
- max_threads: 32,
294
- max_output_bytes: 65_536,
295
- allow_network: false,
296
- allow_ui: false,
297
- },
298
- };