reverseport 0.0.0-stage → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1489) hide show
  1. package/DISCLAIMER.md +136 -0
  2. package/LICENSE +22 -0
  3. package/README.md +289 -2
  4. package/RESPONSIBLE-USE.md +22 -0
  5. package/THIRD_PARTY_NOTICES.md +130 -0
  6. package/bin/reverseport.mjs +136 -0
  7. package/bridge/android/ReaJadxBridge.java +270 -0
  8. package/bridge/ghidra/ReaGhidraAnalysisOptions.java +38 -0
  9. package/bridge/ghidra/ReaGhidraApplySeeds.java +151 -0
  10. package/bridge/ghidra/ReaGhidraBridge.java +3858 -0
  11. package/bridge/ghidra/ReaGhidraBundleActivator.java +14 -0
  12. package/bridge/ghidra/ReaGhidraExtensions.java +113 -0
  13. package/bridge/ghidra/ReaGhidraMipsSoftFloat.java +176 -0
  14. package/bridge/ghidra/ReaGhidraNoReturnFix.java +123 -0
  15. package/bridge/ghidra/ReaGhidraPrepareCom.java +32 -0
  16. package/bridge/ghidra/ReaGhidraPrepareRaw.java +36 -0
  17. package/bridge/hopper_bridge.py +1162 -0
  18. package/bridge/mitmproxy/capture.py +208 -0
  19. package/bridge/native/NativeUIChildren.swift +27 -0
  20. package/bridge/native/ReaNativeUI.swift +171 -0
  21. package/bridge/native/rea_lldb_tracer.py +839 -0
  22. package/bridge/process/ProcessRunTokenReader.swift +339 -0
  23. package/bridge/process/ProcessRunTokenReaderMain.swift +35 -0
  24. package/bridge/pwndbg/core_context.py +101 -0
  25. package/bridge/pwndbg/launch.py +39 -0
  26. package/bridge/pwndbg/launch_impl.py +34 -0
  27. package/bridge/pwntools/decoder_runtime.py +59 -0
  28. package/bridge/pwntools/layout.py +39 -0
  29. package/bridge/pwntools/layout_impl.py +314 -0
  30. package/bridge/pwntools/recorded_crash.py +39 -0
  31. package/bridge/pwntools/recorded_crash_impl.py +147 -0
  32. package/dist/adb/AdbConfiguration.js +88 -0
  33. package/dist/adb/AdbDeviceOutput.js +191 -0
  34. package/dist/adb/AdbDirectoryListing.js +80 -0
  35. package/dist/adb/AdbHostFileName.js +34 -0
  36. package/dist/adb/AdbProvider.js +1227 -0
  37. package/dist/adb/AdbShellOutput.js +267 -0
  38. package/dist/android/AndroidTargetSnapshot.js +118 -0
  39. package/dist/android/JadxAnalysis.js +201 -0
  40. package/dist/android/JadxConfiguration.js +320 -0
  41. package/dist/android/JadxMcpTransport.js +188 -0
  42. package/dist/android/JadxProtocol.js +115 -0
  43. package/dist/android/JadxProvider.js +337 -0
  44. package/dist/android/JadxRelease.js +27 -0
  45. package/dist/android/JadxSession.js +172 -0
  46. package/dist/apktool/ApktoolConfiguration.js +120 -0
  47. package/dist/apktool/ApktoolDecodeOutput.js +142 -0
  48. package/dist/apktool/ApktoolProvider.js +522 -0
  49. package/dist/application/AnalysisContextQueries.js +128 -0
  50. package/dist/application/AnalysisDocument.js +32 -0
  51. package/dist/application/AnalysisProvider.js +27 -0
  52. package/dist/application/AppBundleExecutable.js +192 -0
  53. package/dist/application/BinaryTargetResolver.js +356 -0
  54. package/dist/application/BrowserEvidence.js +127 -0
  55. package/dist/application/BrowserObservationPort.js +1 -0
  56. package/dist/application/BrowserObservationService.js +86 -0
  57. package/dist/application/BrowserScenarioCapturePort.js +1 -0
  58. package/dist/application/BrowserScenarioCaptureService.js +17 -0
  59. package/dist/application/BrowserScenarioEvidence.js +28 -0
  60. package/dist/application/CallPathTracing.js +182 -0
  61. package/dist/application/CapabilityClientRequirements.js +17 -0
  62. package/dist/application/CapabilityInventory.js +525 -0
  63. package/dist/application/ClientConfigPath.js +35 -0
  64. package/dist/application/ClientConfigurationDocument.js +1196 -0
  65. package/dist/application/ClientConfigurationFiles.js +91 -0
  66. package/dist/application/ClientRegistrationEnvironment.js +39 -0
  67. package/dist/application/ClientRegistrationIdentity.js +80 -0
  68. package/dist/application/ClientRegistrationStatus.js +233 -0
  69. package/dist/application/DirectAnalysis.js +371 -0
  70. package/dist/application/DirectAnalysisCleanup.js +71 -0
  71. package/dist/application/DirectAnalysisDependencies.js +1 -0
  72. package/dist/application/DirectAnalysisStatus.js +22 -0
  73. package/dist/application/Doctor.js +349 -0
  74. package/dist/application/DoctorDiagnostics.js +169 -0
  75. package/dist/application/DoctorProviderIds.js +2 -0
  76. package/dist/application/DoctorScope.js +113 -0
  77. package/dist/application/DshCordisPatch.js +342 -0
  78. package/dist/application/DshCordisYaml.js +155 -0
  79. package/dist/application/EnhancedLiteralTracing.js +88 -0
  80. package/dist/application/EnhancedToolTypes.js +4 -0
  81. package/dist/application/EnhancedTools.js +428 -0
  82. package/dist/application/EvidenceBundleCommands.js +70 -0
  83. package/dist/application/EvidenceBundleFiles.js +79 -0
  84. package/dist/application/EvidenceInputResolver.js +30 -0
  85. package/dist/application/FunctionAnalysisEvidence.js +34 -0
  86. package/dist/application/GeminiClientSettings.js +139 -0
  87. package/dist/application/HermesClientHome.js +115 -0
  88. package/dist/application/HopperDownload.js +39 -0
  89. package/dist/application/InventoryProjectionEvidence.js +44 -0
  90. package/dist/application/InvestigationProviders.js +130 -0
  91. package/dist/application/JsonFiles.js +225 -0
  92. package/dist/application/JsonInputFile.js +410 -0
  93. package/dist/application/LinuxHopper.js +232 -0
  94. package/dist/application/MacHopper.js +235 -0
  95. package/dist/application/MipsElfMetadata.js +175 -0
  96. package/dist/application/MipsElfSharedLoad.js +164 -0
  97. package/dist/application/OptionalObservationProviders.js +3 -0
  98. package/dist/application/ProcedureAddressResolution.js +11 -0
  99. package/dist/application/ProgressReporter.js +30 -0
  100. package/dist/application/ProviderOperationExecution.js +31 -0
  101. package/dist/application/RealHopperAssertions.js +135 -0
  102. package/dist/application/ReconstructionCoverageService.js +22 -0
  103. package/dist/application/ReconstructionObligationAuthority.js +72 -0
  104. package/dist/application/ReconstructionObligationCandidates.js +286 -0
  105. package/dist/application/ReconstructionObligationLedgerDiagnostics.js +47 -0
  106. package/dist/application/ReconstructionObligationLedgerEvaluation.js +238 -0
  107. package/dist/application/ReconstructionObligationLedgerProjection.js +15 -0
  108. package/dist/application/ReconstructionObligationLedgerService.js +54 -0
  109. package/dist/application/ReconstructionObligationOriginalCases.js +34 -0
  110. package/dist/application/ReconstructionObligationPolicies.js +132 -0
  111. package/dist/application/ReferenceSourceImport.js +200 -0
  112. package/dist/application/ReferenceSourceImportEntries.js +151 -0
  113. package/dist/application/ReferenceSourceImportPolicy.js +125 -0
  114. package/dist/application/ReferenceSourceImportTypes.js +47 -0
  115. package/dist/application/ReferenceSourceVcsAdapter.js +180 -0
  116. package/dist/application/RegularFileRead.js +120 -0
  117. package/dist/application/Setup.js +408 -0
  118. package/dist/application/SetupClientConfiguration.js +314 -0
  119. package/dist/application/SetupClients.js +44 -0
  120. package/dist/application/SetupHost.js +203 -0
  121. package/dist/application/SetupInstallFailure.js +77 -0
  122. package/dist/application/SetupPlan.js +210 -0
  123. package/dist/application/SetupRegistrationEnvironment.js +5 -0
  124. package/dist/application/SetupSkill.js +248 -0
  125. package/dist/application/SetupTypes.js +17 -0
  126. package/dist/application/SupportedClients.js +469 -0
  127. package/dist/application/TypeScriptEmittedSourceCandidates.js +23 -0
  128. package/dist/application/Uninstall.js +452 -0
  129. package/dist/application/UninstallFailure.js +14 -0
  130. package/dist/application/Update.js +137 -0
  131. package/dist/application/UpdateFailure.js +17 -0
  132. package/dist/application/UpdateMaintenance.js +111 -0
  133. package/dist/application/UpdateRuntime.js +264 -0
  134. package/dist/application/Utf8JsonInput.js +71 -0
  135. package/dist/application/ValidateSelectedWebScript.js +27 -0
  136. package/dist/application/WebModulePorts.js +1 -0
  137. package/dist/application/WebModuleTraceService.js +214 -0
  138. package/dist/application/WebNetworkCapturePort.js +1 -0
  139. package/dist/application/WebNetworkCaptureService.js +134 -0
  140. package/dist/application/WebRuntimePort.js +1 -0
  141. package/dist/application/WebRuntimeService.js +75 -0
  142. package/dist/application/WebScriptArtifactPort.js +1 -0
  143. package/dist/application/WebScriptExportService.js +214 -0
  144. package/dist/application/WebSourceLocationPorts.js +1 -0
  145. package/dist/application/WebSourceLocationService.js +177 -0
  146. package/dist/application/WindowsCapabilities.js +87 -0
  147. package/dist/application/WorkflowEvidence.js +105 -0
  148. package/dist/application/XrefsAddressResolution.js +45 -0
  149. package/dist/application/adb/AdbDeviceAnalysisPort.js +1 -0
  150. package/dist/application/adb/AdbDeviceAnalysisService.js +13 -0
  151. package/dist/application/analysisView/AnalysisViewService.js +133 -0
  152. package/dist/application/android/AndroidAnalysisPort.js +1 -0
  153. package/dist/application/android/AndroidAnalysisService.js +37 -0
  154. package/dist/application/android/AndroidApplicationService.js +17 -0
  155. package/dist/application/android/AndroidSearchEvidenceSummary.js +100 -0
  156. package/dist/application/apktool/ApktoolResourceAnalysisPort.js +1 -0
  157. package/dist/application/apktool/ApktoolResourceAnalysisService.js +13 -0
  158. package/dist/application/apple/AppleApplicationService.js +17 -0
  159. package/dist/application/artifacts/ArtifactExtractionDestination.js +5 -0
  160. package/dist/application/binary/AbortablePromise.js +28 -0
  161. package/dist/application/binary/AnalysisClientCleanup.js +15 -0
  162. package/dist/application/binary/AnalysisProviderEvaluation.js +77 -0
  163. package/dist/application/binary/AnalysisProviderRegistry.js +235 -0
  164. package/dist/application/binary/AnalysisSnapshotCache.js +232 -0
  165. package/dist/application/binary/AnalysisSnapshotFiles.js +96 -0
  166. package/dist/application/binary/BinarySession.js +605 -0
  167. package/dist/application/binary/BinarySessionComposition.js +9 -0
  168. package/dist/application/binary/BinarySessionExecution.js +66 -0
  169. package/dist/application/binary/BinarySessionOpen.js +66 -0
  170. package/dist/application/binary/BinarySessionPort.js +1 -0
  171. package/dist/application/binary/BinarySessionRecords.js +216 -0
  172. package/dist/application/binary/BinarySessionStatus.js +219 -0
  173. package/dist/application/binary/BinaryTargetSummary.js +9 -0
  174. package/dist/application/binary/CompositeProvider.js +103 -0
  175. package/dist/application/binary/LazyAnalysisProvider.js +105 -0
  176. package/dist/application/binary/SessionProviderRouter.js +118 -0
  177. package/dist/application/binaryDiagnostics/BinaryLayoutPort.js +1 -0
  178. package/dist/application/binaryDiagnostics/BinaryLayoutService.js +60 -0
  179. package/dist/application/binaryDiagnostics/PeResourcesPort.js +1 -0
  180. package/dist/application/binaryDiagnostics/PeResourcesService.js +111 -0
  181. package/dist/application/binaryDiagnostics/RecordedCrashPort.js +1 -0
  182. package/dist/application/binaryDiagnostics/RecordedCrashService.js +63 -0
  183. package/dist/application/evm/EvmInterfacePort.js +1 -0
  184. package/dist/application/evm/EvmInterfaceService.js +67 -0
  185. package/dist/application/firmware/FirmwareAnalysisPort.js +1 -0
  186. package/dist/application/firmware/FirmwareAnalysisService.js +38 -0
  187. package/dist/application/go/GoBinaryPort.js +1 -0
  188. package/dist/application/go/GoBinaryService.js +77 -0
  189. package/dist/application/harmony/HarmonyApplicationService.js +17 -0
  190. package/dist/application/homebrew.js +67 -0
  191. package/dist/application/investigation/EvidenceLedger.js +338 -0
  192. package/dist/application/investigation/InspectEvidenceBundle.js +18 -0
  193. package/dist/application/investigation/InvestigationRecordPort.js +1 -0
  194. package/dist/application/investigation/InvestigationRecords.js +65 -0
  195. package/dist/application/investigation/UnknownEvidence.js +37 -0
  196. package/dist/application/javascript/ElectronActiveEvidence.js +29 -0
  197. package/dist/application/javascript/ElectronActiveObservationPort.js +1 -0
  198. package/dist/application/javascript/ElectronActiveObservationService.js +51 -0
  199. package/dist/application/javascript/ElectronBoundaryAnalysis.js +118 -0
  200. package/dist/application/javascript/ElectronBoundaryGraph.js +11 -0
  201. package/dist/application/javascript/ElectronBoundaryGraphCallPaths.js +134 -0
  202. package/dist/application/javascript/ElectronBoundaryGraphContext.js +63 -0
  203. package/dist/application/javascript/ElectronBoundaryGraphIpc.js +261 -0
  204. package/dist/application/javascript/ElectronBoundaryGraphNative.js +102 -0
  205. package/dist/application/javascript/ElectronBoundaryGraphWindows.js +224 -0
  206. package/dist/application/javascript/ElectronEvidence.js +37 -0
  207. package/dist/application/javascript/ElectronObservationPort.js +1 -0
  208. package/dist/application/javascript/ElectronObservationService.js +26 -0
  209. package/dist/application/javascript/JavaScriptAnalysisControl.js +34 -0
  210. package/dist/application/javascript/JavaScriptApplicationEvidence.js +49 -0
  211. package/dist/application/javascript/JavaScriptApplicationEvidenceGraph.js +173 -0
  212. package/dist/application/javascript/JavaScriptApplicationService.js +170 -0
  213. package/dist/application/javascript/JavaScriptApplicationWorkflowEvidence.js +67 -0
  214. package/dist/application/javascript/JavaScriptApplicationWorkflowService.js +194 -0
  215. package/dist/application/javascript/JavaScriptArtifactAnalysis.js +431 -0
  216. package/dist/application/javascript/JavaScriptArtifactAnalysisTypes.js +1 -0
  217. package/dist/application/javascript/JavaScriptArtifactGraphAccumulator.js +89 -0
  218. package/dist/application/javascript/JavaScriptArtifactGraphBuilder.js +193 -0
  219. package/dist/application/javascript/JavaScriptArtifactGraphBundlers.js +229 -0
  220. package/dist/application/javascript/JavaScriptArtifactGraphContext.js +194 -0
  221. package/dist/application/javascript/JavaScriptArtifactGraphDocuments.js +160 -0
  222. package/dist/application/javascript/JavaScriptArtifactGraphEvidence.js +85 -0
  223. package/dist/application/javascript/JavaScriptArtifactGraphFindings.js +349 -0
  224. package/dist/application/javascript/JavaScriptArtifactGraphStructure.js +424 -0
  225. package/dist/application/javascript/JavaScriptArtifactPathResolution.js +836 -0
  226. package/dist/application/javascript/JavaScriptArtifactReconstruction.js +245 -0
  227. package/dist/application/javascript/JavaScriptArtifactReconstructionInput.js +12 -0
  228. package/dist/application/javascript/JavaScriptJsonModules.js +40 -0
  229. package/dist/application/javascript/JavaScriptModuleRelationships.js +304 -0
  230. package/dist/application/javascript/JavaScriptRecoveryPort.js +1 -0
  231. package/dist/application/javascript/JavaScriptRecoveryService.js +77 -0
  232. package/dist/application/javascript/JavaScriptRuntimeObservationEvidence.js +36 -0
  233. package/dist/application/javascript/JavaScriptRuntimeObservationPort.js +1 -0
  234. package/dist/application/javascript/JavaScriptRuntimeObservationService.js +28 -0
  235. package/dist/application/javascript/JavaScriptRuntimeReconciliationEvidence.js +24 -0
  236. package/dist/application/javascript/JavaScriptRuntimeReconciliationService.js +52 -0
  237. package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +163 -0
  238. package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +527 -0
  239. package/dist/application/javascript/JavaScriptSemanticGraphChildProcessProjection.js +165 -0
  240. package/dist/application/javascript/JavaScriptSemanticGraphConstruction.js +156 -0
  241. package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +216 -0
  242. package/dist/application/javascript/JavaScriptSemanticGraphElectronProjection.js +61 -0
  243. package/dist/application/javascript/JavaScriptSemanticGraphEvidence.js +86 -0
  244. package/dist/application/javascript/JavaScriptSemanticGraphFingerprintProjection.js +25 -0
  245. package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +183 -0
  246. package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +112 -0
  247. package/dist/application/javascript/JavaScriptSemanticGraphProjection.js +144 -0
  248. package/dist/application/javascript/JavaScriptSemanticGraphResourceProjection.js +58 -0
  249. package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +136 -0
  250. package/dist/application/javascript/JavaScriptSemanticTraceService.js +41 -0
  251. package/dist/application/jeb/JebAnalysisPort.js +1 -0
  252. package/dist/application/jeb/JebAnalysisService.js +13 -0
  253. package/dist/application/managed/ManagedApplicationGraphService.js +55 -0
  254. package/dist/application/managed/ManagedMemberComparisonService.js +125 -0
  255. package/dist/application/managed/ManagedNativeVerificationService.js +40 -0
  256. package/dist/application/managed/ManagedReconstructionService.js +59 -0
  257. package/dist/application/native/NativeApiInspection.js +77 -0
  258. package/dist/application/native/NativeCallRoutes.js +73 -0
  259. package/dist/application/native/NativeDispatchMetadataInspection.js +33 -0
  260. package/dist/application/native/NativeUiActionTrace.js +427 -0
  261. package/dist/application/native/NativeValueTrace.js +340 -0
  262. package/dist/application/process/ProcessCli.js +190 -0
  263. package/dist/application/process/ProcessEvidence.js +30 -0
  264. package/dist/application/wasm/WasmArtifactPort.js +1 -0
  265. package/dist/application/wasm/WasmArtifactService.js +72 -0
  266. package/dist/application/workflowInputError.js +18 -0
  267. package/dist/artifacts/ArtifactHash.js +29 -0
  268. package/dist/artifacts/ArtifactPaths.js +167 -0
  269. package/dist/artifacts/ArtifactProvider.js +280 -0
  270. package/dist/artifacts/ArtifactProviderMetadata.js +34 -0
  271. package/dist/artifacts/ArtifactReader.js +77 -0
  272. package/dist/artifacts/ArtifactResourceScope.js +103 -0
  273. package/dist/artifacts/AsarArtifactReader.js +518 -0
  274. package/dist/artifacts/AsarEntryStream.js +76 -0
  275. package/dist/artifacts/AsarHeader.js +24 -0
  276. package/dist/artifacts/DirectoryArtifactReader.js +292 -0
  277. package/dist/artifacts/MachOSliceArtifactReader.js +342 -0
  278. package/dist/artifacts/NativeDmgArtifactReader.js +508 -0
  279. package/dist/artifacts/NativeDmgOwnership.js +109 -0
  280. package/dist/artifacts/SafeOutputTree.js +394 -0
  281. package/dist/artifacts/SafeOutputTreeCleanup.js +45 -0
  282. package/dist/artifacts/SafeOutputTreeCreationFailure.js +20 -0
  283. package/dist/artifacts/SafeOutputTreeIdentity.js +42 -0
  284. package/dist/artifacts/SafeOutputTreeReadback.js +33 -0
  285. package/dist/artifacts/StreamBytes.js +10 -0
  286. package/dist/artifacts/ZipArtifactReader.js +222 -0
  287. package/dist/artifacts/apple/AppleAssetCatalogAnalysis.js +190 -0
  288. package/dist/artifacts/apple/DylibResolutionReader.js +269 -0
  289. package/dist/artifacts/apple/InterfaceBuilderAnalysis.js +500 -0
  290. package/dist/artifacts/apple/InterfaceBuilderDecodeBudget.js +233 -0
  291. package/dist/artifacts/apple/KeyedArchiveReader.js +163 -0
  292. package/dist/artifacts/apple/MachoLoadCommandReader.js +393 -0
  293. package/dist/artifacts/apple/NibArchive.js +338 -0
  294. package/dist/artifacts/apple/NibViewHierarchy.js +157 -0
  295. package/dist/artifacts/apple/PlistNumberLiterals.js +164 -0
  296. package/dist/artifacts/extraction/ArtifactExtraction.js +253 -0
  297. package/dist/artifacts/hostExecutableMarking.js +16 -0
  298. package/dist/artifacts/inventory/ArtifactGraphConstruction.js +343 -0
  299. package/dist/artifacts/inventory/ArtifactInventory.js +16 -0
  300. package/dist/artifacts/inventory/classify.js +94 -0
  301. package/dist/artifacts/inventory/hashStableRootArtifact.js +70 -0
  302. package/dist/artifacts/inventory/reader.js +40 -0
  303. package/dist/artifacts/inventory/scanCanonical.js +213 -0
  304. package/dist/artifacts/inventory/scanReader.js +169 -0
  305. package/dist/artifacts/inventory/types.js +3 -0
  306. package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +317 -0
  307. package/dist/artifacts/javascript/JavaScriptArtifactReader.js +6 -0
  308. package/dist/artifacts/javascript/JavaScriptSourceAnalysis.js +3 -0
  309. package/dist/artifacts/readStableArtifact.js +68 -0
  310. package/dist/browser/BrowserProcessStartup.js +89 -0
  311. package/dist/browser/BrowserScenarioPartialObservation.js +127 -0
  312. package/dist/browser/BrowserScenarioSecrets.js +137 -0
  313. package/dist/browser/BrowserScenarioSessionPort.js +1 -0
  314. package/dist/browser/CdpAuthorizedMainFrame.js +16 -0
  315. package/dist/browser/CdpAuthorizedTarget.js +22 -0
  316. package/dist/browser/CdpBrowserProvider.js +276 -0
  317. package/dist/browser/CdpCaptureCompleteness.js +92 -0
  318. package/dist/browser/CdpCaptureDocuments.js +375 -0
  319. package/dist/browser/CdpCaptureDomSvg.js +210 -0
  320. package/dist/browser/CdpCaptureEventBodyShapes.js +55 -0
  321. package/dist/browser/CdpCaptureEventHandlers.js +463 -0
  322. package/dist/browser/CdpCaptureEventHelpers.js +84 -0
  323. package/dist/browser/CdpCaptureEventState.js +1 -0
  324. package/dist/browser/CdpCaptureEventTypes.js +5 -0
  325. package/dist/browser/CdpCaptureEvents.js +199 -0
  326. package/dist/browser/CdpCaptureStorage.js +86 -0
  327. package/dist/browser/CdpCaptureStorageFingerprints.js +320 -0
  328. package/dist/browser/CdpCaptureValues.js +91 -0
  329. package/dist/browser/CdpCommandRejection.js +17 -0
  330. package/dist/browser/CdpConnection.js +303 -0
  331. package/dist/browser/CdpElectronInspection.js +253 -0
  332. package/dist/browser/CdpElectronProvider.js +115 -0
  333. package/dist/browser/CdpElectronScriptEvents.js +55 -0
  334. package/dist/browser/CdpElectronScripts.js +65 -0
  335. package/dist/browser/CdpElectronWorkers.js +57 -0
  336. package/dist/browser/CdpEndpoint.js +217 -0
  337. package/dist/browser/CdpObservationSession.js +332 -0
  338. package/dist/browser/CdpOptionalCommand.js +14 -0
  339. package/dist/browser/CdpPageCapture.js +278 -0
  340. package/dist/browser/CdpPageCaptureScripts.js +79 -0
  341. package/dist/browser/CdpPageCaptureWorkers.js +46 -0
  342. package/dist/browser/CdpSafeMetadata.js +284 -0
  343. package/dist/browser/CdpScreenshot.js +110 -0
  344. package/dist/browser/CdpTargetEvents.js +8 -0
  345. package/dist/browser/CdpTargetSession.js +65 -0
  346. package/dist/browser/CdpWebMcpDiscovery.js +361 -0
  347. package/dist/browser/ElectronFileScope.js +135 -0
  348. package/dist/browser/PlaywrightBrowserScenarioProvider.js +301 -0
  349. package/dist/browser/PlaywrightElectronActiveActions.js +257 -0
  350. package/dist/browser/PlaywrightElectronActiveProjection.js +141 -0
  351. package/dist/browser/PlaywrightElectronActiveProvider.js +293 -0
  352. package/dist/browser/PlaywrightExecutionBoundary.js +53 -0
  353. package/dist/browser/PlaywrightScenarioActions.js +58 -0
  354. package/dist/browser/PlaywrightScenarioArtifacts.js +162 -0
  355. package/dist/browser/PlaywrightScenarioBrowser.js +412 -0
  356. package/dist/browser/PlaywrightScenarioEvents.js +253 -0
  357. package/dist/browser/PlaywrightScenarioSession.js +279 -0
  358. package/dist/browser/PlaywrightScenarioStorage.js +507 -0
  359. package/dist/browser/PngVisualDiff.js +380 -0
  360. package/dist/browser/WebSourceMapFetcher.js +718 -0
  361. package/dist/browser/assets/LocalWebScriptArtifacts.js +89 -0
  362. package/dist/browser/assets/PageScriptCapture.js +32 -0
  363. package/dist/browser/assets/PublishWebScripts.js +140 -0
  364. package/dist/browser/assets/ScenarioScriptCapture.js +73 -0
  365. package/dist/browser/assets/ScriptCaptureAdapters.js +57 -0
  366. package/dist/browser/assets/WebArtifactReads.js +78 -0
  367. package/dist/browser/assets/WebSourceLocationArtifacts.js +41 -0
  368. package/dist/browser/execution/CdpEventListeners.js +79 -0
  369. package/dist/browser/execution/CdpExecutionCapture.js +135 -0
  370. package/dist/browser/execution/CdpExecutionCollection.js +57 -0
  371. package/dist/browser/execution/CdpExecutionWindow.js +100 -0
  372. package/dist/browser/execution/CdpListenerSelector.js +22 -0
  373. package/dist/browser/execution/CdpPreciseCoverage.js +45 -0
  374. package/dist/browser/execution/CdpRuntimeInitiator.js +18 -0
  375. package/dist/browser/execution/CdpRuntimeProtocol.js +106 -0
  376. package/dist/browser/execution/CdpRuntimeRequests.js +81 -0
  377. package/dist/browser/execution/CdpRuntimeSession.js +163 -0
  378. package/dist/browser/execution/CdpRuntimeSources.js +223 -0
  379. package/dist/browser/execution/CdpWebRuntimeProvider.js +51 -0
  380. package/dist/browser/history/CaptureFailures.js +153 -0
  381. package/dist/browser/history/CaptureFormatError.js +10 -0
  382. package/dist/browser/history/CaptureRedaction.js +68 -0
  383. package/dist/browser/history/CaptureRelease.js +23 -0
  384. package/dist/browser/history/HarCapture.js +179 -0
  385. package/dist/browser/history/HarCaptureAdapter.js +23 -0
  386. package/dist/browser/history/HarCaptureProcess.js +49 -0
  387. package/dist/browser/history/HarJson.js +92 -0
  388. package/dist/browser/history/HarSchema.js +72 -0
  389. package/dist/browser/history/HistoricalCaptureDecoder.js +198 -0
  390. package/dist/browser/history/HistoricalCaptureFormatAdapter.js +1 -0
  391. package/dist/browser/history/MitmproxyCaptureAdapter.js +46 -0
  392. package/dist/browser/modules/NativeModuleResolver.js +277 -0
  393. package/dist/browser/modules/WebModuleArtifacts.js +41 -0
  394. package/dist/browser/network/PlaywrightNetworkContent.js +71 -0
  395. package/dist/browser/network/PlaywrightScenarioNetwork.js +180 -0
  396. package/dist/browser/providerIdentities.js +24 -0
  397. package/dist/catalogIdentity.js +65 -0
  398. package/dist/cli/adbCommands.js +337 -0
  399. package/dist/cli/analysisSelector.js +23 -0
  400. package/dist/cli/analysisViewCommands.js +74 -0
  401. package/dist/cli/androidCommands.js +91 -0
  402. package/dist/cli/apktoolCommands.js +53 -0
  403. package/dist/cli/applicationCommands.js +173 -0
  404. package/dist/cli/artifactCommands.js +160 -0
  405. package/dist/cli/binaryDiagnosticsCommands.js +57 -0
  406. package/dist/cli/browserAdvancedCommands.js +189 -0
  407. package/dist/cli/browserCommands.js +125 -0
  408. package/dist/cli/commandCancellation.js +24 -0
  409. package/dist/cli/coreAnalysisCommands.js +7 -0
  410. package/dist/cli/coreBinaryCommands.js +283 -0
  411. package/dist/cli/coreNativeCommands.js +269 -0
  412. package/dist/cli/electronCommands.js +150 -0
  413. package/dist/cli/evmCommands.js +33 -0
  414. package/dist/cli/firmwareCommands.js +61 -0
  415. package/dist/cli/goCommands.js +21 -0
  416. package/dist/cli/interactiveSetup.js +236 -0
  417. package/dist/cli/javascriptApplicationAnalysis.js +34 -0
  418. package/dist/cli/javascriptRecoveryCommands.js +59 -0
  419. package/dist/cli/jebCommands.js +99 -0
  420. package/dist/cli/jsonOutput.js +46 -0
  421. package/dist/cli/managedCommands.js +129 -0
  422. package/dist/cli/managedProjectGraphCommand.js +24 -0
  423. package/dist/cli/nativeCallCommands.js +33 -0
  424. package/dist/cli/omittableDefaults.js +50 -0
  425. package/dist/cli/options.js +33 -0
  426. package/dist/cli/processCommands.js +25 -0
  427. package/dist/cli/referenceSourceImportStatus.js +22 -0
  428. package/dist/cli/setupCommands.js +189 -0
  429. package/dist/cli/streamedJsonOutput.js +134 -0
  430. package/dist/cli/types.js +1 -0
  431. package/dist/cli/utilityCommands.js +226 -0
  432. package/dist/cli/wasmCommands.js +44 -0
  433. package/dist/cli/webModuleCommands.js +60 -0
  434. package/dist/cli/webNetworkCaptureCommands.js +40 -0
  435. package/dist/cli/webRuntimeCommands.js +60 -0
  436. package/dist/cli/webScriptCommands.js +50 -0
  437. package/dist/cli/webSourceLocationCommands.js +54 -0
  438. package/dist/cli-runtime/AnalysisProvider-CeyX2u-b.js +25 -0
  439. package/dist/cli-runtime/AnalysisSnapshotFiles-BuK_ymw5.js +523 -0
  440. package/dist/cli-runtime/ArtifactReader-BXkffc1D.js +55 -0
  441. package/dist/cli-runtime/ArtifactResourceScope-CZqLEfbb.js +108 -0
  442. package/dist/cli-runtime/AsarHeader-CnzOzYEH.js +31 -0
  443. package/dist/cli-runtime/BinaryTargetResolver-CKRfFhLj.js +965 -0
  444. package/dist/cli-runtime/BoundedFileBytes-BU30odTm.js +39 -0
  445. package/dist/cli-runtime/ClientConfigPath-c6jr6INc.js +36 -0
  446. package/dist/cli-runtime/ClientConfigurationDocument-D0ZqgTCv.js +1522 -0
  447. package/dist/cli-runtime/ClientRegistrationStatus-DGpwJ4ry.js +422 -0
  448. package/dist/cli-runtime/DirectAnalysis-DW3MvxW0.js +500 -0
  449. package/dist/cli-runtime/Doctor-CzwYS9nB.js +862 -0
  450. package/dist/cli-runtime/ElectronFileScope-C1hUEp36.js +1419 -0
  451. package/dist/cli-runtime/ExecFileOutput-Czbj-HpV.js +106 -0
  452. package/dist/cli-runtime/IdaConfiguration-rEjpuRQ1.js +854 -0
  453. package/dist/cli-runtime/InterfaceBuilderDecodeBudget-DT74BY9z.js +225 -0
  454. package/dist/cli-runtime/InventoryProjectionEvidence-Dt4Og45O.js +49 -0
  455. package/dist/cli-runtime/InvestigationProviders-D-QCy-4c.js +117 -0
  456. package/dist/cli-runtime/JavaScriptApplicationEvidenceGraph-CODAjVru.js +160 -0
  457. package/dist/cli-runtime/JavaScriptApplicationWorkflowEvidence-CCtwSg8r.js +75 -0
  458. package/dist/cli-runtime/JavaScriptWorkerMemoryLimit-CJeBSMPx.js +83 -0
  459. package/dist/cli-runtime/JsonFiles-Ce_O5NcH.js +708 -0
  460. package/dist/cli-runtime/ManagedSnapshot-DthWfmy9.js +3622 -0
  461. package/dist/cli-runtime/OwnedCommand-CnK8-h3N.js +106 -0
  462. package/dist/cli-runtime/PrivateRuntimeRoot-KNg6qLwo.js +237 -0
  463. package/dist/cli-runtime/ProcessOwnership-AOJaszxt.js +1310 -0
  464. package/dist/cli-runtime/ProviderDeadline-BSbNOmuW.js +89 -0
  465. package/dist/cli-runtime/RegularFile-CL6meBxi.js +114 -0
  466. package/dist/cli-runtime/RegularFileRead-BMh5FMXd.js +115 -0
  467. package/dist/cli-runtime/SafeOutputTree-D8z2Zrnu.js +512 -0
  468. package/dist/cli-runtime/SetupHost-CzzRF89z.js +842 -0
  469. package/dist/cli-runtime/SupportedClients-BrZ2qZVg.js +671 -0
  470. package/dist/cli-runtime/UninstallFailure-1blyKXHE.js +22 -0
  471. package/dist/cli-runtime/Update-DF55X_N2.js +143 -0
  472. package/dist/cli-runtime/UpdateFailure-BcFNxEZZ.js +24 -0
  473. package/dist/cli-runtime/WindowsBatchCommand-5gT-d7O4.js +45 -0
  474. package/dist/cli-runtime/ZipArtifactReader-Db65WuM_.js +380 -0
  475. package/dist/cli-runtime/analysisErrorCleanup-DaUQNiQd.js +32 -0
  476. package/dist/cli-runtime/analysisErrorPresentation-DZrKL8kS.js +331 -0
  477. package/dist/cli-runtime/application__DirectAnalysisStatus-OZFIFjZr.js +93 -0
  478. package/dist/cli-runtime/application__EnhancedTools-C__HAdqG.js +1728 -0
  479. package/dist/cli-runtime/application__FunctionAnalysisEvidence-fWSgvV74.js +41 -0
  480. package/dist/cli-runtime/application__ReconstructionCoverageService-DlNt-4TY.js +32 -0
  481. package/dist/cli-runtime/application__ReconstructionObligationLedgerService-CEpbUv-7.js +813 -0
  482. package/dist/cli-runtime/application__Setup-BExVGpqG.js +540 -0
  483. package/dist/cli-runtime/application__Uninstall-BVgWDCPN.js +349 -0
  484. package/dist/cli-runtime/application__UpdateRuntime-Dj6UIhHQ.js +358 -0
  485. package/dist/cli-runtime/application__android__AndroidApplicationService-CyynwW6Z.js +31 -0
  486. package/dist/cli-runtime/application__apple__AppleApplicationService-BNPcWeL8.js +31 -0
  487. package/dist/cli-runtime/application__harmony__HarmonyApplicationService-W66PwMvx.js +31 -0
  488. package/dist/cli-runtime/application__javascript__ElectronActiveObservationService-D8VbeCxz.js +85 -0
  489. package/dist/cli-runtime/application__javascript__ElectronObservationService-FmXFG4f2.js +63 -0
  490. package/dist/cli-runtime/application__javascript__JavaScriptApplicationService-D-dVrmAY.js +10467 -0
  491. package/dist/cli-runtime/application__javascript__JavaScriptApplicationWorkflowService-Cb0jmh8J.js +2284 -0
  492. package/dist/cli-runtime/application__javascript__JavaScriptRuntimeReconciliationService-D55gO7Gq.js +88 -0
  493. package/dist/cli-runtime/application__javascript__JavaScriptSemanticTraceService-DivM-Ym-.js +298 -0
  494. package/dist/cli-runtime/artifactOperationError-Wd0PRLIZ.js +27 -0
  495. package/dist/cli-runtime/artifacts__ArtifactProvider-B_4h3RAw.js +2091 -0
  496. package/dist/cli-runtime/binary-9Gt3vJ1P.js +12990 -0
  497. package/dist/cli-runtime/browserObservationError-D73SM55P.js +40 -0
  498. package/dist/cli-runtime/browserScenario-CTNr5ISp.js +5543 -0
  499. package/dist/cli-runtime/catalogIdentity-EYVhBUYJ.js +339 -0
  500. package/dist/cli-runtime/cli.js +28528 -0
  501. package/dist/cli-runtime/cliOutput-CoDmWVu5.js +98 -0
  502. package/dist/cli-runtime/cliOutput.js +5 -0
  503. package/dist/cli-runtime/composition__browserScenario-DNr3A_BM.js +2318 -0
  504. package/dist/cli-runtime/composition__electronObservation-DNw1f38M.js +550 -0
  505. package/dist/cli-runtime/composition__electronScenario-Cu7PX270.js +586 -0
  506. package/dist/cli-runtime/configurationErrors-ByuF6gMR.js +49 -0
  507. package/dist/cli-runtime/doctorRuntime-D5y43lEp.js +162 -0
  508. package/dist/cli-runtime/dosMz-pwwUuxyC.js +65 -0
  509. package/dist/cli-runtime/dotnet__ManagedStaticProvider-BSnWggeb.js +5 -0
  510. package/dist/cli-runtime/enhancedInputs-K8C_o3b4.js +56 -0
  511. package/dist/cli-runtime/javascriptApplicationGraph-DUWeec4O.js +940 -0
  512. package/dist/cli-runtime/javascriptExportReturnShapeProjection-BVbnAdOd.js +78 -0
  513. package/dist/cli-runtime/javascriptExportShapeComparisonSchemas-BzSil7ft.js +1153 -0
  514. package/dist/cli-runtime/javascriptRuntimeObservation-9xTNoKY2.js +1215 -0
  515. package/dist/cli-runtime/javascriptRuntimeReconciliation-CneBtMvx.js +1437 -0
  516. package/dist/cli-runtime/javascriptRuntimeReconciliationSchemas-D1Mrb_Y0.js +245 -0
  517. package/dist/cli-runtime/javascriptSemanticTraceSchemas-BHItrqIA.js +126 -0
  518. package/dist/cli-runtime/lipo-BCA3wVyN.js +365 -0
  519. package/dist/cli-runtime/logger-CKq3JfbZ.js +34 -0
  520. package/dist/cli-runtime/machoContainer-DxxkB2b0.js +52 -0
  521. package/dist/cli-runtime/managedApplicationGraph-BqOr01E6.js +1116 -0
  522. package/dist/cli-runtime/managedToolContracts-BSy4TRaK.js +80 -0
  523. package/dist/cli-runtime/mcpDoctor.js +342 -0
  524. package/dist/cli-runtime/mcpStartupPolicy-Bb7TMLzn.js +18 -0
  525. package/dist/cli-runtime/native__NativeMacOSProvider-BIG9iCcj.js +4415 -0
  526. package/dist/cli-runtime/plistValue-KM-SqiXe.js +47 -0
  527. package/dist/cli-runtime/propertyListKeys-DejfMb-U.js +86 -0
  528. package/dist/cli-runtime/providerAdapterError-SRSE_gzN.js +27 -0
  529. package/dist/cli-runtime/providerCleanupError-Do66qCEp.js +27 -0
  530. package/dist/cli-runtime/providerIdentities-Ao1XTvwx.js +31 -0
  531. package/dist/cli-runtime/providerOperationHealth-DSTcYPJe.js +577 -0
  532. package/dist/cli-runtime/providerStartupTimeout-Be8B1Ro8.js +16 -0
  533. package/dist/cli-runtime/readFileHandleChunks-dp60iZ6v.js +38 -0
  534. package/dist/cli-runtime/reconstructionObligationLedgerSchemas-dvp6PEnZ.js +15839 -0
  535. package/dist/cli-runtime/rolldown-runtime-DXoylpqc.js +121 -0
  536. package/dist/cli-runtime/runtimeVersion-CMGd0bDu.js +23 -0
  537. package/dist/cli-runtime/safeJson-DKKACtdy.js +25 -0
  538. package/dist/cli-runtime/scanCanonical-Bi6si9nb.js +2773 -0
  539. package/dist/cli-runtime/snapshotEnvironment-B5Ai0mha.js +678 -0
  540. package/dist/cli-runtime/streamedJsonOutput-VYlQZsM7.js +654 -0
  541. package/dist/cli-runtime/streamedJsonOutput.js +5 -0
  542. package/dist/cli-runtime/toolContracts-C7pvYKxF.js +4516 -0
  543. package/dist/cli-runtime/toolEffects-DW31yTSx.js +7004 -0
  544. package/dist/cli-runtime/workflowInputError-26EGiDpx.js +26 -0
  545. package/dist/cli.js +91 -0
  546. package/dist/cliBrowserContext.js +11 -0
  547. package/dist/cliBrowserScenarioCommands.js +73 -0
  548. package/dist/cliCommandNames.js +205 -0
  549. package/dist/cliEvidenceCommands.js +51 -0
  550. package/dist/cliJavaScriptRuntimeCommands.js +69 -0
  551. package/dist/cliJsonInput.js +129 -0
  552. package/dist/cliLogging.js +48 -0
  553. package/dist/cliObservationOptions.js +73 -0
  554. package/dist/cliOutput.js +97 -0
  555. package/dist/composition/adb.js +3 -0
  556. package/dist/composition/android.js +3 -0
  557. package/dist/composition/apktool.js +3 -0
  558. package/dist/composition/auxiliaryAnalysisProviders.js +35 -0
  559. package/dist/composition/binary.js +25 -0
  560. package/dist/composition/binaryDiagnostics.js +12 -0
  561. package/dist/composition/browserObservation.js +3 -0
  562. package/dist/composition/browserScenario.js +4 -0
  563. package/dist/composition/directAnalysis.js +44 -0
  564. package/dist/composition/electronObservation.js +3 -0
  565. package/dist/composition/electronScenario.js +3 -0
  566. package/dist/composition/evm.js +4 -0
  567. package/dist/composition/firmware.js +3 -0
  568. package/dist/composition/go.js +4 -0
  569. package/dist/composition/javascriptAnalysisWorkerProcess.js +48 -0
  570. package/dist/composition/javascriptRecovery.js +3 -0
  571. package/dist/composition/javascriptRuntimeObservation.js +3 -0
  572. package/dist/composition/jeb.js +6 -0
  573. package/dist/composition/optionalObservationProviders.js +54 -0
  574. package/dist/composition/wasm.js +4 -0
  575. package/dist/composition/webModules.js +5 -0
  576. package/dist/composition/webNetworkCaptures.js +6 -0
  577. package/dist/composition/webRuntime.js +4 -0
  578. package/dist/composition/webSourceLocations.js +5 -0
  579. package/dist/config/environment.js +73 -0
  580. package/dist/config/ghidraDisabledAnalyzers.js +25 -0
  581. package/dist/config/ghidraLanguageOverride.js +9 -0
  582. package/dist/config/homeDirectory.js +12 -0
  583. package/dist/config/mcpInputSchemaProfile.js +27 -0
  584. package/dist/config/mcpResponseBudget.js +30 -0
  585. package/dist/config/parseConfig.js +93 -0
  586. package/dist/config/parsers.js +30 -0
  587. package/dist/config/providerStartupTimeout.js +13 -0
  588. package/dist/config/types.js +1 -0
  589. package/dist/contracts/adb/adbToolContracts.js +353 -0
  590. package/dist/contracts/advertisedInputExamples.js +48 -0
  591. package/dist/contracts/analysisDetail.js +13 -0
  592. package/dist/contracts/analysisSearchContract.js +14 -0
  593. package/dist/contracts/analysisViewApiSurfaceExample.js +68 -0
  594. package/dist/contracts/analysisViewToolContracts.js +76 -0
  595. package/dist/contracts/android/androidToolContracts.js +77 -0
  596. package/dist/contracts/apktool/apktoolToolContracts.js +33 -0
  597. package/dist/contracts/applicationToolContracts.js +261 -0
  598. package/dist/contracts/artifactComparisonExample.js +86 -0
  599. package/dist/contracts/artifactToolContracts.js +68 -0
  600. package/dist/contracts/browserProviderToolContracts.js +7 -0
  601. package/dist/contracts/browserScenarioToolContracts.js +32 -0
  602. package/dist/contracts/browserToolContracts.js +256 -0
  603. package/dist/contracts/compactInputSchema.js +256 -0
  604. package/dist/contracts/enhancedInputs.js +74 -0
  605. package/dist/contracts/enhancedToolContracts.js +32 -0
  606. package/dist/contracts/errorSchemas.js +87 -0
  607. package/dist/contracts/evidenceInputContracts.js +13 -0
  608. package/dist/contracts/evm/evmToolContracts.js +20 -0
  609. package/dist/contracts/firmware/firmwareToolContracts.js +38 -0
  610. package/dist/contracts/functionComparisonExample.js +51 -0
  611. package/dist/contracts/functionInstructionContract.js +6 -0
  612. package/dist/contracts/functionWorkflowToolContracts.js +29 -0
  613. package/dist/contracts/go/goToolContracts.js +20 -0
  614. package/dist/contracts/hopperMemoryContracts.js +19 -0
  615. package/dist/contracts/inputSchemaPresentation.js +181 -0
  616. package/dist/contracts/investigationExamples.js +116 -0
  617. package/dist/contracts/javascript/applicationWorkflowInputContracts.js +52 -0
  618. package/dist/contracts/javascript/electronToolContracts.js +118 -0
  619. package/dist/contracts/javascript/javascriptApplicationWorkflowExamples.js +85 -0
  620. package/dist/contracts/javascript/javascriptExportShapeComparisonExample.js +248 -0
  621. package/dist/contracts/javascript/javascriptRecoveryToolContracts.js +35 -0
  622. package/dist/contracts/javascript/javascriptRuntimeObservationToolContracts.js +40 -0
  623. package/dist/contracts/javascript/javascriptRuntimeReconciliationExample.js +242 -0
  624. package/dist/contracts/jeb/jebToolContracts.js +64 -0
  625. package/dist/contracts/managed/managedToolContracts.js +87 -0
  626. package/dist/contracts/managed/managedWorkflowExamples.js +281 -0
  627. package/dist/contracts/managed/managedWorkflowToolContracts.js +165 -0
  628. package/dist/contracts/mobileApplicationGraphExamples.js +117 -0
  629. package/dist/contracts/native/binaryDiagnosticsToolContracts.js +65 -0
  630. package/dist/contracts/native/nativeToolContracts.js +77 -0
  631. package/dist/contracts/officialToolContracts.js +69 -0
  632. package/dist/contracts/promptContracts.js +253 -0
  633. package/dist/contracts/providerSelection.js +29 -0
  634. package/dist/contracts/reconstructionReadinessExample.js +438 -0
  635. package/dist/contracts/sessionLifecycleInputs.js +63 -0
  636. package/dist/contracts/sessionStatusContract.js +17 -0
  637. package/dist/contracts/sessionToolContracts.js +61 -0
  638. package/dist/contracts/sessionToolSchemas.js +51 -0
  639. package/dist/contracts/toolContractExamples.js +77 -0
  640. package/dist/contracts/toolContractHelpers.js +22 -0
  641. package/dist/contracts/toolContractTypes.js +18 -0
  642. package/dist/contracts/toolContracts.js +60 -0
  643. package/dist/contracts/toolEffects.js +544 -0
  644. package/dist/contracts/toolOutputSchemaGroups.js +411 -0
  645. package/dist/contracts/toolOutputSchemaPrimitives.js +532 -0
  646. package/dist/contracts/toolSchemaMetadata.js +197 -0
  647. package/dist/contracts/unknownContractExamples.js +31 -0
  648. package/dist/contracts/wasm/wasmToolContracts.js +24 -0
  649. package/dist/contracts/webNetworkCaptureToolContracts.js +24 -0
  650. package/dist/contracts/webRuntimeToolContracts.js +43 -0
  651. package/dist/contracts/webScriptToolContracts.js +68 -0
  652. package/dist/doctorRuntime.js +53 -0
  653. package/dist/domain/adb/adbDeviceAnalysis.js +583 -0
  654. package/dist/domain/analysisErrorBase.js +58 -0
  655. package/dist/domain/analysisErrorCleanup.js +29 -0
  656. package/dist/domain/analysisErrorCore.js +123 -0
  657. package/dist/domain/analysisErrorPresentation.js +372 -0
  658. package/dist/domain/analysisErrorProjection.js +454 -0
  659. package/dist/domain/analysisProfile.js +50 -0
  660. package/dist/domain/analysisSnapshot.js +538 -0
  661. package/dist/domain/analysisView/WebNetworkApiSurfaceAccumulator.js +362 -0
  662. package/dist/domain/analysisView/analysisView.js +340 -0
  663. package/dist/domain/analysisView/analysisViewCoverage.js +19 -0
  664. package/dist/domain/analysisView/binaryLayoutView.js +161 -0
  665. package/dist/domain/analysisView/javascriptApplicationView.js +245 -0
  666. package/dist/domain/analysisView/nativeFunctionView.js +155 -0
  667. package/dist/domain/analysisView/webNetworkApiSurfaceView.js +108 -0
  668. package/dist/domain/android/androidAnalysis.js +143 -0
  669. package/dist/domain/android/androidApplication.js +144 -0
  670. package/dist/domain/android/androidPartialObservation.js +36 -0
  671. package/dist/domain/apktool/apktoolResourceAnalysis.js +75 -0
  672. package/dist/domain/apple/appleApplication.js +315 -0
  673. package/dist/domain/apple/appleAssetCatalog.js +127 -0
  674. package/dist/domain/apple/appleBundleAnatomy.js +303 -0
  675. package/dist/domain/apple/dyldEnvironment.js +73 -0
  676. package/dist/domain/apple/dyldPaths.js +89 -0
  677. package/dist/domain/apple/dylibResolution.js +485 -0
  678. package/dist/domain/apple/dylibResolutionFindings.js +77 -0
  679. package/dist/domain/apple/interfaceBuilderGraph.js +403 -0
  680. package/dist/domain/apple/interfaceBuilderKeyedArchive.js +430 -0
  681. package/dist/domain/apple/keyedArchive.js +214 -0
  682. package/dist/domain/apple/machoContainer.js +54 -0
  683. package/dist/domain/apple/plistNumbers.js +76 -0
  684. package/dist/domain/apple/plistValue.js +35 -0
  685. package/dist/domain/artifactComparison.js +348 -0
  686. package/dist/domain/artifactGraph.js +213 -0
  687. package/dist/domain/artifactIdentity.js +57 -0
  688. package/dist/domain/artifactInspection.js +279 -0
  689. package/dist/domain/artifactIntegrityPolicy.js +10 -0
  690. package/dist/domain/artifactInventoryEvidence.js +166 -0
  691. package/dist/domain/artifactInventorySnapshot.js +1 -0
  692. package/dist/domain/artifactOperationError.js +20 -0
  693. package/dist/domain/artifactPartialObservation.js +1 -0
  694. package/dist/domain/artifactPathSyntax.js +75 -0
  695. package/dist/domain/binaryTarget.js +233 -0
  696. package/dist/domain/binaryTargetTypes.js +10 -0
  697. package/dist/domain/bridgeCandidateProjection.js +71 -0
  698. package/dist/domain/browserCaptureComparison.js +21 -0
  699. package/dist/domain/browserCompleteness.js +103 -0
  700. package/dist/domain/browserNetworkEvidence.js +92 -0
  701. package/dist/domain/browserObservation.js +187 -0
  702. package/dist/domain/browserObservationError.js +44 -0
  703. package/dist/domain/browserObservationErrors.js +1 -0
  704. package/dist/domain/browserObservationSchemas.js +327 -0
  705. package/dist/domain/browserScenario.js +61 -0
  706. package/dist/domain/browserScenarioCapture.js +76 -0
  707. package/dist/domain/browserScenarioCaptureValues.js +292 -0
  708. package/dist/domain/browserScenarioDiff.js +266 -0
  709. package/dist/domain/browserScenarioDiffEvidence.js +73 -0
  710. package/dist/domain/browserScenarioDiffValues.js +140 -0
  711. package/dist/domain/browserScenarioNormalization.js +40 -0
  712. package/dist/domain/browserScenarioValues.js +268 -0
  713. package/dist/domain/browserSession.js +55 -0
  714. package/dist/domain/bundleComparison.js +243 -0
  715. package/dist/domain/callPath.js +301 -0
  716. package/dist/domain/callPathSchemas.js +89 -0
  717. package/dist/domain/canonicalDigest.js +83 -0
  718. package/dist/domain/canonicalJsonDigestSteps.js +155 -0
  719. package/dist/domain/canonicalOrdering.js +3 -0
  720. package/dist/domain/changedBehavior.js +282 -0
  721. package/dist/domain/compactStringIdentity.js +9 -0
  722. package/dist/domain/comparisonSemantics.js +12 -0
  723. package/dist/domain/comparisonSourceEvidence.js +40 -0
  724. package/dist/domain/comparisonStatus.js +11 -0
  725. package/dist/domain/completionLedgerGeneration.js +186 -0
  726. package/dist/domain/configurationErrors.js +37 -0
  727. package/dist/domain/conformancePackage.js +200 -0
  728. package/dist/domain/conformanceReplay.js +132 -0
  729. package/dist/domain/conformanceTrustGate.js +319 -0
  730. package/dist/domain/digests.js +27 -0
  731. package/dist/domain/dosCom.js +8 -0
  732. package/dist/domain/dosMz.js +83 -0
  733. package/dist/domain/emptyArraySchema.js +3 -0
  734. package/dist/domain/evidence.js +305 -0
  735. package/dist/domain/evidenceBundle.js +413 -0
  736. package/dist/domain/evidenceCompletionLedger.js +113 -0
  737. package/dist/domain/evidenceErrors.js +46 -0
  738. package/dist/domain/evidenceRecordSummary.js +144 -0
  739. package/dist/domain/evm/evmInterface.js +61 -0
  740. package/dist/domain/explicitSensitiveFailure.js +108 -0
  741. package/dist/domain/explicitSensitiveValues.js +10 -0
  742. package/dist/domain/firmware/firmwareAnalysis.js +128 -0
  743. package/dist/domain/functionComparison.js +38 -0
  744. package/dist/domain/functionComparisonDimensions.js +199 -0
  745. package/dist/domain/functionComparisonNormalization.js +150 -0
  746. package/dist/domain/functionComparisonResults.js +54 -0
  747. package/dist/domain/functionComparisonSchemas.js +88 -0
  748. package/dist/domain/functionDossierEvidence.js +20 -0
  749. package/dist/domain/go/goBinary.js +96 -0
  750. package/dist/domain/harmony/harmonyApplication.js +169 -0
  751. package/dist/domain/hopperErrors.js +98 -0
  752. package/dist/domain/hopperStartupFailure.js +64 -0
  753. package/dist/domain/hopperValues.js +368 -0
  754. package/dist/domain/immutableJson.js +114 -0
  755. package/dist/domain/inputIssueProjection.js +94 -0
  756. package/dist/domain/javascript/electronActiveObservation.js +237 -0
  757. package/dist/domain/javascript/electronObservation.js +122 -0
  758. package/dist/domain/javascript/electronStaticAnalysis.js +9 -0
  759. package/dist/domain/javascript/electronStaticAnalysisBrowser.js +187 -0
  760. package/dist/domain/javascript/electronStaticAnalysisIpc.js +197 -0
  761. package/dist/domain/javascript/electronStaticAnalysisNative.js +199 -0
  762. package/dist/domain/javascript/electronStaticAnalysisTypes.js +1 -0
  763. package/dist/domain/javascript/electronStaticAnalysisValues.js +134 -0
  764. package/dist/domain/javascript/electronWrappedCallPaths.js +399 -0
  765. package/dist/domain/javascript/htmlArtifactReferences.js +40 -0
  766. package/dist/domain/javascript/javascriptAnalysisResourceControls.js +65 -0
  767. package/dist/domain/javascript/javascriptApplicationAnalysis.js +146 -0
  768. package/dist/domain/javascript/javascriptApplicationChangeGraph.js +175 -0
  769. package/dist/domain/javascript/javascriptApplicationEvidenceSchemas.js +400 -0
  770. package/dist/domain/javascript/javascriptApplicationGraph.js +378 -0
  771. package/dist/domain/javascript/javascriptApplicationGraphSchemas.js +126 -0
  772. package/dist/domain/javascript/javascriptApplicationProjectionResources.js +43 -0
  773. package/dist/domain/javascript/javascriptApplicationVersionComparison.js +104 -0
  774. package/dist/domain/javascript/javascriptApplicationVersionComparisonSchemas.js +211 -0
  775. package/dist/domain/javascript/javascriptApplicationVersionItems.js +324 -0
  776. package/dist/domain/javascript/javascriptApplicationVersionKeys.js +199 -0
  777. package/dist/domain/javascript/javascriptArtifactFiles.js +1 -0
  778. package/dist/domain/javascript/javascriptAstFingerprint.js +153 -0
  779. package/dist/domain/javascript/javascriptAstValues.js +99 -0
  780. package/dist/domain/javascript/javascriptBootstrap.js +94 -0
  781. package/dist/domain/javascript/javascriptElectronMemberWrites.js +119 -0
  782. package/dist/domain/javascript/javascriptExportReturnShapeProjection.js +81 -0
  783. package/dist/domain/javascript/javascriptExportShapeComparison.js +161 -0
  784. package/dist/domain/javascript/javascriptExportShapeComparisonIdentity.js +16 -0
  785. package/dist/domain/javascript/javascriptExportShapeComparisonSchemas.js +302 -0
  786. package/dist/domain/javascript/javascriptExportShapeSelection.js +130 -0
  787. package/dist/domain/javascript/javascriptExportShapeVariants.js +333 -0
  788. package/dist/domain/javascript/javascriptFeatureSeed.js +193 -0
  789. package/dist/domain/javascript/javascriptFeatureTrace.js +177 -0
  790. package/dist/domain/javascript/javascriptFeatureTraceSchemas.js +131 -0
  791. package/dist/domain/javascript/javascriptFeatureTraversal.js +61 -0
  792. package/dist/domain/javascript/javascriptIntrinsicInvocation.js +93 -0
  793. package/dist/domain/javascript/javascriptModuleInterop.js +617 -0
  794. package/dist/domain/javascript/javascriptModuleSemanticIr.js +15 -0
  795. package/dist/domain/javascript/javascriptNativeHandoff.js +90 -0
  796. package/dist/domain/javascript/javascriptPackageImportAliases.js +58 -0
  797. package/dist/domain/javascript/javascriptRecovery.js +90 -0
  798. package/dist/domain/javascript/javascriptRpcEndpoints.js +253 -0
  799. package/dist/domain/javascript/javascriptRuntimeLoadState.js +98 -0
  800. package/dist/domain/javascript/javascriptRuntimeObservation.js +136 -0
  801. package/dist/domain/javascript/javascriptRuntimeReconciliation.js +46 -0
  802. package/dist/domain/javascript/javascriptRuntimeReconciliationActive.js +74 -0
  803. package/dist/domain/javascript/javascriptRuntimeReconciliationCaptureParsing.js +212 -0
  804. package/dist/domain/javascript/javascriptRuntimeReconciliationGraph.js +163 -0
  805. package/dist/domain/javascript/javascriptRuntimeReconciliationInputValidation.js +28 -0
  806. package/dist/domain/javascript/javascriptRuntimeReconciliationMatching.js +270 -0
  807. package/dist/domain/javascript/javascriptRuntimeReconciliationParsing.js +39 -0
  808. package/dist/domain/javascript/javascriptRuntimeReconciliationResult.js +126 -0
  809. package/dist/domain/javascript/javascriptRuntimeReconciliationRuntime.js +334 -0
  810. package/dist/domain/javascript/javascriptRuntimeReconciliationSchemas.js +234 -0
  811. package/dist/domain/javascript/javascriptRuntimeStaticCandidates.js +206 -0
  812. package/dist/domain/javascript/javascriptSemanticAnalysis.js +910 -0
  813. package/dist/domain/javascript/javascriptSemanticAsyncEffects.js +246 -0
  814. package/dist/domain/javascript/javascriptSemanticCallResolution.js +127 -0
  815. package/dist/domain/javascript/javascriptSemanticCallableResults.js +42 -0
  816. package/dist/domain/javascript/javascriptSemanticCalls.js +272 -0
  817. package/dist/domain/javascript/javascriptSemanticChildProcesses.js +224 -0
  818. package/dist/domain/javascript/javascriptSemanticCoverage.js +32 -0
  819. package/dist/domain/javascript/javascriptSemanticDataEffectHelpers.js +182 -0
  820. package/dist/domain/javascript/javascriptSemanticDataEffects.js +299 -0
  821. package/dist/domain/javascript/javascriptSemanticDerivedAnalysis.js +52 -0
  822. package/dist/domain/javascript/javascriptSemanticFileProjection.js +1 -0
  823. package/dist/domain/javascript/javascriptSemanticFingerprints.js +187 -0
  824. package/dist/domain/javascript/javascriptSemanticGraph.js +575 -0
  825. package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +316 -0
  826. package/dist/domain/javascript/javascriptSemanticGraphSerialization.js +12 -0
  827. package/dist/domain/javascript/javascriptSemanticIr.js +31 -0
  828. package/dist/domain/javascript/javascriptSemanticIterationSources.js +139 -0
  829. package/dist/domain/javascript/javascriptSemanticMemberMutations.js +865 -0
  830. package/dist/domain/javascript/javascriptSemanticMutationInitializers.js +190 -0
  831. package/dist/domain/javascript/javascriptSemanticMutationValues.js +104 -0
  832. package/dist/domain/javascript/javascriptSemanticObjectReferences.js +381 -0
  833. package/dist/domain/javascript/javascriptSemanticObjects.js +164 -0
  834. package/dist/domain/javascript/javascriptSemanticPrimitives.js +38 -0
  835. package/dist/domain/javascript/javascriptSemanticProjection.js +571 -0
  836. package/dist/domain/javascript/javascriptSemanticPromises.js +321 -0
  837. package/dist/domain/javascript/javascriptSemanticPropertyPaths.js +100 -0
  838. package/dist/domain/javascript/javascriptSemanticProvenance.js +29 -0
  839. package/dist/domain/javascript/javascriptSemanticQuery.js +175 -0
  840. package/dist/domain/javascript/javascriptSemanticQueryAssessment.js +45 -0
  841. package/dist/domain/javascript/javascriptSemanticQueryIdentity.js +63 -0
  842. package/dist/domain/javascript/javascriptSemanticQueryRelations.js +15 -0
  843. package/dist/domain/javascript/javascriptSemanticQuerySchemas.js +95 -0
  844. package/dist/domain/javascript/javascriptSemanticRequireOrigin.js +34 -0
  845. package/dist/domain/javascript/javascriptSemanticResourceLimits.js +77 -0
  846. package/dist/domain/javascript/javascriptSemanticResources.js +129 -0
  847. package/dist/domain/javascript/javascriptSemanticReturnedReferences.js +219 -0
  848. package/dist/domain/javascript/javascriptSemanticReturns.js +159 -0
  849. package/dist/domain/javascript/javascriptSemanticSlots.js +72 -0
  850. package/dist/domain/javascript/javascriptSemanticState.js +116 -0
  851. package/dist/domain/javascript/javascriptSemanticTraceSchemas.js +15 -0
  852. package/dist/domain/javascript/javascriptSemanticTraversal.js +80 -0
  853. package/dist/domain/javascript/javascriptSemanticValueTypes.js +1 -0
  854. package/dist/domain/javascript/javascriptSemanticValues.js +581 -0
  855. package/dist/domain/javascript/javascriptSourceAnalysis.js +1 -0
  856. package/dist/domain/javascript/javascriptSourceMapPaths.js +114 -0
  857. package/dist/domain/javascript/javascriptSourceParser.js +50 -0
  858. package/dist/domain/javascript/javascriptSourceSelection.js +11 -0
  859. package/dist/domain/javascript/javascriptStaticAnalysis.js +142 -0
  860. package/dist/domain/javascript/javascriptStaticAnalysisBundler.js +239 -0
  861. package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +271 -0
  862. package/dist/domain/javascript/javascriptStaticAnalysisFindings.js +86 -0
  863. package/dist/domain/javascript/javascriptStaticAnalysisHelpers.js +561 -0
  864. package/dist/domain/javascript/javascriptStaticAnalysisState.js +21 -0
  865. package/dist/domain/javascript/javascriptStaticAnalysisTypes.js +2 -0
  866. package/dist/domain/javascript/javascriptSymbolicBindings.js +795 -0
  867. package/dist/domain/javascript/javascriptSymbolicControlFlow.js +40 -0
  868. package/dist/domain/javascript/javascriptSymbolicValues.js +34 -0
  869. package/dist/domain/javascript/sourceToBundleComparison.js +261 -0
  870. package/dist/domain/javascript/sourceToBundleComparisonSchemas.js +109 -0
  871. package/dist/domain/javascript/sourceToBundleSignals.js +231 -0
  872. package/dist/domain/jeb/jebAnalysis.js +114 -0
  873. package/dist/domain/jsonSerialization.js +163 -0
  874. package/dist/domain/jsonShape.js +141 -0
  875. package/dist/domain/jsonValue.js +96 -0
  876. package/dist/domain/localPath.js +24 -0
  877. package/dist/domain/managed/managedApplicationGraph.js +221 -0
  878. package/dist/domain/managed/managedApplicationGraphCoverage.js +48 -0
  879. package/dist/domain/managed/managedApplicationGraphNodes.js +367 -0
  880. package/dist/domain/managed/managedArtifact.js +465 -0
  881. package/dist/domain/managed/managedInspectionEvidence.js +28 -0
  882. package/dist/domain/managed/managedMemberComparison.js +211 -0
  883. package/dist/domain/managed/managedMemberComparisonCoverage.js +71 -0
  884. package/dist/domain/managed/managedMemberComparisonItems.js +304 -0
  885. package/dist/domain/managed/managedMemberComparisonMatch.js +204 -0
  886. package/dist/domain/managed/managedNativeVerification.js +35 -0
  887. package/dist/domain/managed/managedNativeVerificationMatch.js +276 -0
  888. package/dist/domain/managed/managedNativeVerificationSchemas.js +180 -0
  889. package/dist/domain/managed/managedReconstruction.js +190 -0
  890. package/dist/domain/mobileApplicationGraphProjection.js +61 -0
  891. package/dist/domain/native/binaryLayout.js +354 -0
  892. package/dist/domain/native/fileOffsetPartialObservation.js +1 -0
  893. package/dist/domain/native/nativeAotPe.js +1408 -0
  894. package/dist/domain/native/nativeApiBoundary.js +140 -0
  895. package/dist/domain/native/nativeCallObservation.js +186 -0
  896. package/dist/domain/native/nativeCallPartialObservation.js +33 -0
  897. package/dist/domain/native/nativeDataType.js +53 -0
  898. package/dist/domain/native/nativeFunctionAnnotations.js +43 -0
  899. package/dist/domain/native/nativeInspection.js +174 -0
  900. package/dist/domain/native/nativeInstruction.js +125 -0
  901. package/dist/domain/native/nativeInvestigationGraph.js +364 -0
  902. package/dist/domain/native/nativeLoadImage.js +112 -0
  903. package/dist/domain/native/nativeMetadataRecovery.js +128 -0
  904. package/dist/domain/native/nativeUiObservation.js +137 -0
  905. package/dist/domain/native/nativeValueFlow.js +72 -0
  906. package/dist/domain/native/nativeValueTrace.js +64 -0
  907. package/dist/domain/native/objcSwiftMetadata.js +419 -0
  908. package/dist/domain/native/peResources.js +100 -0
  909. package/dist/domain/native/recordedCrash.js +263 -0
  910. package/dist/domain/native/recordedCrashNoteCoverage.js +73 -0
  911. package/dist/domain/nativeConvention.js +33 -0
  912. package/dist/domain/offsetDateTime.js +17 -0
  913. package/dist/domain/peMachine.js +36 -0
  914. package/dist/domain/process/processCapture.js +412 -0
  915. package/dist/domain/process/processCaptureCoverage.js +70 -0
  916. package/dist/domain/process/processCaptureExample.js +132 -0
  917. package/dist/domain/process/processCaptureParsing.js +21 -0
  918. package/dist/domain/process/processCaptureValidation.js +246 -0
  919. package/dist/domain/process/processComparison.js +315 -0
  920. package/dist/domain/process/processEvidenceProvider.js +11 -0
  921. package/dist/domain/process/processObservation.js +140 -0
  922. package/dist/domain/process/processScenario.js +247 -0
  923. package/dist/domain/process/processTraceComparison.js +34 -0
  924. package/dist/domain/process/processTraceDimensionProjection.js +35 -0
  925. package/dist/domain/process/processTraceEvaluation.js +320 -0
  926. package/dist/domain/process/processTraceSpecification.js +382 -0
  927. package/dist/domain/propertyListKeys.js +107 -0
  928. package/dist/domain/propertyListXmlText.js +19 -0
  929. package/dist/domain/providerAdapterError.js +19 -0
  930. package/dist/domain/providerCleanupError.js +18 -0
  931. package/dist/domain/providerConfigurationRefusal.js +12 -0
  932. package/dist/domain/providerOperationHealth.js +54 -0
  933. package/dist/domain/providerSelectionError.js +46 -0
  934. package/dist/domain/rawBinary.js +93 -0
  935. package/dist/domain/reconstructionCoverage.js +325 -0
  936. package/dist/domain/reconstructionCoverageEvaluation.js +234 -0
  937. package/dist/domain/reconstructionCoverageInput.js +7 -0
  938. package/dist/domain/reconstructionObligationLedgerIntegrity.js +114 -0
  939. package/dist/domain/reconstructionObligationLedgerSchemas.js +347 -0
  940. package/dist/domain/reconstructionReadiness.js +116 -0
  941. package/dist/domain/reconstructionReadinessFindingHelpers.js +17 -0
  942. package/dist/domain/reconstructionReadinessIntegrityFindings.js +118 -0
  943. package/dist/domain/reconstructionReadinessJourneyFindings.js +193 -0
  944. package/dist/domain/reconstructionReadinessSchemas.js +268 -0
  945. package/dist/domain/reconstructionUnknowns.js +91 -0
  946. package/dist/domain/reconstructionVerification.js +218 -0
  947. package/dist/domain/reconstructionVerificationSchemas.js +141 -0
  948. package/dist/domain/recordedTransportUrl.js +51 -0
  949. package/dist/domain/referenceSourceClassification.js +385 -0
  950. package/dist/domain/referenceSourceGraph.js +380 -0
  951. package/dist/domain/referenceSourceImportParsing.js +238 -0
  952. package/dist/domain/referenceSourcePathIdentity.js +22 -0
  953. package/dist/domain/referenceSourcePolicy.js +1 -0
  954. package/dist/domain/referenceSourceRequireBindings.js +137 -0
  955. package/dist/domain/relationshipCoverage.js +20 -0
  956. package/dist/domain/residualUnknown.js +252 -0
  957. package/dist/domain/result.js +4 -0
  958. package/dist/domain/runtimeVersion.js +15 -0
  959. package/dist/domain/safeJson.js +13 -0
  960. package/dist/domain/sourceMapContents.js +6 -0
  961. package/dist/domain/sourceMapEnvelope.js +44 -0
  962. package/dist/domain/staticRuntimeCorrelation.js +334 -0
  963. package/dist/domain/stringPatterns.js +6 -0
  964. package/dist/domain/swiftSymbolClassification.js +66 -0
  965. package/dist/domain/symbolAnalysis.js +122 -0
  966. package/dist/domain/unicodeCodePointOrder.js +23 -0
  967. package/dist/domain/unknownRegistryError.js +10 -0
  968. package/dist/domain/wasm/wasmArtifact.js +105 -0
  969. package/dist/domain/webBundleAnalysis.js +192 -0
  970. package/dist/domain/webBundleAnalyzer.js +15 -0
  971. package/dist/domain/webBundleAnalyzerAst.js +49 -0
  972. package/dist/domain/webBundleAnalyzerInspection.js +315 -0
  973. package/dist/domain/webBundleAnalyzerResult.js +142 -0
  974. package/dist/domain/webCaptureDiff.js +423 -0
  975. package/dist/domain/webCaptureDiffSchemas.js +84 -0
  976. package/dist/domain/webContentArtifact.js +38 -0
  977. package/dist/domain/webEventListeners.js +29 -0
  978. package/dist/domain/webExecution.js +75 -0
  979. package/dist/domain/webInventory.js +62 -0
  980. package/dist/domain/webMcpDiscovery.js +53 -0
  981. package/dist/domain/webModuleImports.js +99 -0
  982. package/dist/domain/webModuleTrace.js +101 -0
  983. package/dist/domain/webNetworkCapture.js +142 -0
  984. package/dist/domain/webNetworkCaptureCoordinates.js +58 -0
  985. package/dist/domain/webRuntime.js +80 -0
  986. package/dist/domain/webScreenshot.js +132 -0
  987. package/dist/domain/webScriptArtifacts.js +37 -0
  988. package/dist/domain/webScriptExport.js +84 -0
  989. package/dist/domain/webScriptExportError.js +19 -0
  990. package/dist/domain/webScriptExportPlan.js +104 -0
  991. package/dist/domain/webSourceLocation.js +118 -0
  992. package/dist/domain/webSourcePosition.js +21 -0
  993. package/dist/domain/zipPackageFormat.js +52 -0
  994. package/dist/domain/zodCollectionSteps.js +24 -0
  995. package/dist/dotnet/ManagedArtifactInspector.js +308 -0
  996. package/dist/dotnet/ManagedDecodeBudget.js +138 -0
  997. package/dist/dotnet/ManagedExceptionRegionValidation.js +41 -0
  998. package/dist/dotnet/ManagedMemberInspector.js +173 -0
  999. package/dist/dotnet/ManagedMemberInspectorCore.js +446 -0
  1000. package/dist/dotnet/ManagedMemberInstructionDecoder.js +468 -0
  1001. package/dist/dotnet/ManagedMemberOwnership.js +71 -0
  1002. package/dist/dotnet/ManagedMemberPointers.js +62 -0
  1003. package/dist/dotnet/ManagedMemberRows.js +227 -0
  1004. package/dist/dotnet/ManagedMetadataHeaps.js +179 -0
  1005. package/dist/dotnet/ManagedMetadataInventory.js +99 -0
  1006. package/dist/dotnet/ManagedMetadataInventoryRows.js +295 -0
  1007. package/dist/dotnet/ManagedMetadataLayout.js +270 -0
  1008. package/dist/dotnet/ManagedMetadataRowSizes.js +54 -0
  1009. package/dist/dotnet/ManagedMethodBodyReader.js +155 -0
  1010. package/dist/dotnet/ManagedNativeBoundaryHelpers.js +314 -0
  1011. package/dist/dotnet/ManagedNativeBoundaryInspector.js +128 -0
  1012. package/dist/dotnet/ManagedPeReader.js +233 -0
  1013. package/dist/dotnet/ManagedReaderFailure.js +27 -0
  1014. package/dist/dotnet/ManagedSnapshot.js +88 -0
  1015. package/dist/dotnet/ManagedStaticProvider.js +158 -0
  1016. package/dist/dotnet/ManagedStaticProviderMetadata.js +33 -0
  1017. package/dist/evaluation/AgentEvaluationFixtures.js +250 -0
  1018. package/dist/evaluation/AgentEvaluationReport.js +32 -0
  1019. package/dist/evaluation/CodexAgentEval.js +188 -0
  1020. package/dist/evaluation/KnownAnswerEvaluation.js +323 -0
  1021. package/dist/evm/EvmBytecodeCarrier.js +21 -0
  1022. package/dist/evm/EvmWorkerLimits.js +40 -0
  1023. package/dist/evm/EvmoleFailures.js +124 -0
  1024. package/dist/evm/EvmoleInterfaceAdapter.js +53 -0
  1025. package/dist/evm/EvmoleInterfaceProvider.js +339 -0
  1026. package/dist/evm/EvmoleInterfaceWorker.js +87 -0
  1027. package/dist/evm/EvmoleRelease.js +16 -0
  1028. package/dist/filesystem/OwnedDirectoryHandle.js +29 -0
  1029. package/dist/filesystem/OwnedFileHandle.js +36 -0
  1030. package/dist/filesystem/OwnedStagedOutput.js +138 -0
  1031. package/dist/filesystem/RegularFile.js +73 -0
  1032. package/dist/filesystem/StableFileHash.js +46 -0
  1033. package/dist/filesystem/readFileHandleChunks.js +35 -0
  1034. package/dist/firmware/FirmwareCommand.js +190 -0
  1035. package/dist/firmware/FirmwareFiles.js +206 -0
  1036. package/dist/firmware/FirmwareProvider.js +388 -0
  1037. package/dist/firmware/FirmwarePublication.js +105 -0
  1038. package/dist/firmware/FirmwareRelease.js +33 -0
  1039. package/dist/firmware/FirmwareReports.js +287 -0
  1040. package/dist/firmware/FirmwareVersion.js +80 -0
  1041. package/dist/generatedPackageMetadata.js +9 -0
  1042. package/dist/ghidra/GhidraAnalysisProfile.js +219 -0
  1043. package/dist/ghidra/GhidraAnalysisSeeds.js +211 -0
  1044. package/dist/ghidra/GhidraClient.js +725 -0
  1045. package/dist/ghidra/GhidraClientStartup.js +27 -0
  1046. package/dist/ghidra/GhidraClientTypes.js +1 -0
  1047. package/dist/ghidra/GhidraClientWire.js +38 -0
  1048. package/dist/ghidra/GhidraDiagnostics.js +53 -0
  1049. package/dist/ghidra/GhidraDoctor.js +88 -0
  1050. package/dist/ghidra/GhidraFunctionValues.js +328 -0
  1051. package/dist/ghidra/GhidraInstallation.js +443 -0
  1052. package/dist/ghidra/GhidraInstallationPolicy.js +140 -0
  1053. package/dist/ghidra/GhidraInventoryValues.js +262 -0
  1054. package/dist/ghidra/GhidraJavaLaunch.js +66 -0
  1055. package/dist/ghidra/GhidraLanguageCatalog.js +99 -0
  1056. package/dist/ghidra/GhidraLauncher.js +490 -0
  1057. package/dist/ghidra/GhidraLoadImageAttest.js +103 -0
  1058. package/dist/ghidra/GhidraLoadImageValues.js +260 -0
  1059. package/dist/ghidra/GhidraMipsProfile.js +187 -0
  1060. package/dist/ghidra/GhidraProvider.js +250 -0
  1061. package/dist/ghidra/GhidraProviderCapabilities.js +208 -0
  1062. package/dist/ghidra/GhidraProviderClient.js +613 -0
  1063. package/dist/ghidra/GhidraPspExtension.js +144 -0
  1064. package/dist/ghidra/GhidraPspProfile.js +50 -0
  1065. package/dist/ghidra/GhidraRawBinaryLanguage.js +18 -0
  1066. package/dist/ghidra/GhidraRequestQueue.js +115 -0
  1067. package/dist/ghidra/GhidraResponseBuffer.js +31 -0
  1068. package/dist/ghidra/GhidraResponseRouter.js +24 -0
  1069. package/dist/ghidra/GhidraSessionError.js +180 -0
  1070. package/dist/ghidra/GhidraSessionRoot.js +39 -0
  1071. package/dist/ghidra/GhidraSessionValues.js +86 -0
  1072. package/dist/ghidra/GhidraSocketConnection.js +83 -0
  1073. package/dist/ghidra/GhidraTargetSnapshot.js +79 -0
  1074. package/dist/ghidra/GhidraTransport.js +101 -0
  1075. package/dist/ghidra/extensions/GhidraExtensionFailures.js +20 -0
  1076. package/dist/ghidra/extensions/GhidraExtensions.js +177 -0
  1077. package/dist/ghidra/extensions/nativeaot/NativeAotAdapter.js +27 -0
  1078. package/dist/ghidra/extensions/nativeaot/NativeAotReport.js +100 -0
  1079. package/dist/ghidra/protocol.js +46 -0
  1080. package/dist/go/GoBinaryContainer.js +125 -0
  1081. package/dist/go/GoBinaryImage.js +172 -0
  1082. package/dist/go/GoBinaryProvider.js +137 -0
  1083. package/dist/go/GoElfImage.js +149 -0
  1084. package/dist/go/GoMachoImage.js +113 -0
  1085. package/dist/go/GoModuleText.js +217 -0
  1086. package/dist/go/GoPeImage.js +102 -0
  1087. package/dist/hopper/BridgeLauncher.js +305 -0
  1088. package/dist/hopper/HopperAnalysisProfile.js +168 -0
  1089. package/dist/hopper/HopperCleanup.js +245 -0
  1090. package/dist/hopper/HopperClient.js +767 -0
  1091. package/dist/hopper/HopperDiagnostics.js +14 -0
  1092. package/dist/hopper/HopperFileOffset.js +237 -0
  1093. package/dist/hopper/HopperMachOImage.js +200 -0
  1094. package/dist/hopper/HopperOperationStage.js +6 -0
  1095. package/dist/hopper/HopperProcessDiagnostic.js +26 -0
  1096. package/dist/hopper/HopperProvider.js +269 -0
  1097. package/dist/hopper/HopperProviderCapabilities.js +91 -0
  1098. package/dist/hopper/HopperRegexSearch.js +134 -0
  1099. package/dist/hopper/HopperRegexWorker.js +27 -0
  1100. package/dist/hopper/HopperRequestQueue.js +261 -0
  1101. package/dist/hopper/HopperResponseStream.js +44 -0
  1102. package/dist/hopper/HopperSessionValues.js +30 -0
  1103. package/dist/hopper/HopperSocketConnection.js +31 -0
  1104. package/dist/hopper/HopperTargetLease.js +233 -0
  1105. package/dist/hopper/LinuxPrivateDisplayDiagnostic.js +64 -0
  1106. package/dist/hopper/LinuxPrivateDisplayProbe.js +224 -0
  1107. package/dist/hopper/protocol.js +88 -0
  1108. package/dist/ida/IdaBusyHealth.js +44 -0
  1109. package/dist/ida/IdaCallGraph.js +134 -0
  1110. package/dist/ida/IdaConfiguration.js +61 -0
  1111. package/dist/ida/IdaDoctor.js +53 -0
  1112. package/dist/ida/IdaInput.js +56 -0
  1113. package/dist/ida/IdaMcpConnection.js +115 -0
  1114. package/dist/ida/IdaOperationRunner.js +376 -0
  1115. package/dist/ida/IdaProtocolValues.js +208 -0
  1116. package/dist/ida/IdaProvider.js +136 -0
  1117. package/dist/ida/IdaProviderCapabilities.js +64 -0
  1118. package/dist/ida/IdaSessionClient.js +444 -0
  1119. package/dist/ida/IdaWorkspace.js +55 -0
  1120. package/dist/identity.js +25 -0
  1121. package/dist/inspector/JavaScriptRuntimeScope.js +89 -0
  1122. package/dist/inspector/V8InspectorCaptureProjection.js +197 -0
  1123. package/dist/inspector/V8InspectorEndpoint.js +70 -0
  1124. package/dist/inspector/V8InspectorProvider.js +378 -0
  1125. package/dist/inspector/providerIdentity.js +6 -0
  1126. package/dist/javascript/analysis/JavaScriptAnalysisTransfer.js +337 -0
  1127. package/dist/javascript/analysis/JavaScriptAnalysisWorker.js +574 -0
  1128. package/dist/javascript/analysis/JavaScriptAnalysisWorkerProtocol.js +64 -0
  1129. package/dist/javascript/analysis/JavaScriptAnalysisWorkerSchemas.js +558 -0
  1130. package/dist/javascript/analysis/JavaScriptAnalysisWorkerServer.js +121 -0
  1131. package/dist/javascript/recovery/RecoveryFiles.js +175 -0
  1132. package/dist/javascript/recovery/WakaruCommand.js +137 -0
  1133. package/dist/javascript/recovery/WakaruExecution.js +115 -0
  1134. package/dist/javascript/recovery/WakaruProvider.js +218 -0
  1135. package/dist/javascript/recovery/WakaruPublication.js +126 -0
  1136. package/dist/javascript/recovery/WakaruRelease.js +36 -0
  1137. package/dist/javascript/recovery/WakaruReport.js +140 -0
  1138. package/dist/javascript/recovery/WakaruVersion.js +24 -0
  1139. package/dist/javascript/sourceMaps/DecodedSourceMap.js +47 -0
  1140. package/dist/javascript/sourceMaps/SourceMapCodecProcess.js +37 -0
  1141. package/dist/javascript/sourceMaps/SourceMapCodecProtocol.js +20 -0
  1142. package/dist/javascript/sourceMaps/SourceMapCommand.js +223 -0
  1143. package/dist/javascript/sourceMaps/SourceMapDecoder.js +135 -0
  1144. package/dist/javascript/sourceMaps/SourceMapFormat.js +238 -0
  1145. package/dist/javascript/sourceMaps/TraceSourceMap.js +152 -0
  1146. package/dist/jeb/JebMcpConnection.js +186 -0
  1147. package/dist/jeb/JebMcpEndpoint.js +40 -0
  1148. package/dist/jeb/JebProvider.js +297 -0
  1149. package/dist/logger.js +14 -0
  1150. package/dist/main/messages.js +4 -0
  1151. package/dist/main/shutdown.js +102 -0
  1152. package/dist/main/startup.js +21 -0
  1153. package/dist/main/transport.js +72 -0
  1154. package/dist/main/types.js +1 -0
  1155. package/dist/main.js +92 -0
  1156. package/dist/mcp/AnalysisSnapshotFiles-DbgHi36O.js +1225 -0
  1157. package/dist/mcp/ArtifactProvider-BNxKlaKX.js +2090 -0
  1158. package/dist/mcp/ArtifactProviderMetadata--hy-wyJK.js +76 -0
  1159. package/dist/mcp/ArtifactReader-OyM03Gjn.js +55 -0
  1160. package/dist/mcp/ArtifactResourceScope-CBR5q4aK.js +108 -0
  1161. package/dist/mcp/AsarHeader-WsPgoooH.js +31 -0
  1162. package/dist/mcp/BinaryTargetResolver-DbiUzRLh.js +1073 -0
  1163. package/dist/mcp/BoundedFileBytes-CJPW_TzE.js +68 -0
  1164. package/dist/mcp/CdpConnection-CM0tkVfW.js +557 -0
  1165. package/dist/mcp/CdpOptionalCommand-H8_fL7Q_.js +120 -0
  1166. package/dist/mcp/CdpTargetSession-OYD1d6XM.js +647 -0
  1167. package/dist/mcp/DirectAnalysis-BWAu8Ro5.js +395 -0
  1168. package/dist/mcp/DirectAnalysisStatus-DofNPhKd.js +33 -0
  1169. package/dist/mcp/ElectronFileScope-DEayib6K.js +110 -0
  1170. package/dist/mcp/InterfaceBuilderDecodeBudget-CUrOtfNo.js +401 -0
  1171. package/dist/mcp/ManagedStaticProvider-CXE93Bow.js +4460 -0
  1172. package/dist/mcp/NativeMacOSProvider-BbITFLHW.js +4408 -0
  1173. package/dist/mcp/NativeMacOSProviderMetadata-mxDhaNJf.js +281 -0
  1174. package/dist/mcp/ProcedureAddressResolution-Gnjf9Hya.js +19 -0
  1175. package/dist/mcp/ProcessOwnership-nOFZsmD3.js +1411 -0
  1176. package/dist/mcp/WorkflowEvidence-DJyEy3K0.js +94 -0
  1177. package/dist/mcp/analysisErrorCore-BqyeMw3_.js +201 -0
  1178. package/dist/mcp/analysisErrorProjection-B7pHef2y.js +724 -0
  1179. package/dist/mcp/artifactOperationError-B_jxO8at.js +27 -0
  1180. package/dist/mcp/artifactToolContracts-TXegBBr1.js +159 -0
  1181. package/dist/mcp/browserObservation-BCgaDRyQ.js +4398 -0
  1182. package/dist/mcp/browserObservationError-BKBEX85K.js +40 -0
  1183. package/dist/mcp/browserObservationSchemas-yzRJ90-E.js +573 -0
  1184. package/dist/mcp/browserScenario-z7jveI9P.js +2319 -0
  1185. package/dist/mcp/browserScenarioCapture-BvnKTmtZ.js +460 -0
  1186. package/dist/mcp/canonicalDigest-Bi_0_zGi.js +71 -0
  1187. package/dist/mcp/digests-Dugt3H71.js +199 -0
  1188. package/dist/mcp/electronActiveObservation-lDvQTMR0.js +226 -0
  1189. package/dist/mcp/electronObservation-DjQQYGw4.js +556 -0
  1190. package/dist/mcp/electronObservation-DuhMHCmQ.js +112 -0
  1191. package/dist/mcp/electronScenario-9mLG6h-g.js +586 -0
  1192. package/dist/mcp/emptyArraySchema-DEEefG2V.js +140 -0
  1193. package/dist/mcp/enhancedInputs-CLdEXv88.js +56 -0
  1194. package/dist/mcp/interfaceBuilderGraph-BOKqQzjK.js +2613 -0
  1195. package/dist/mcp/javascriptRuntimeObservation-C_wglsz_.js +661 -0
  1196. package/dist/mcp/javascriptRuntimeObservation-CxQ1UT_y.js +121 -0
  1197. package/dist/mcp/lipo-Do-2eBrl.js +465 -0
  1198. package/dist/mcp/localPath-AxvW9aPe.js +19 -0
  1199. package/dist/mcp/logger-CZ4Hlc6u.js +34 -0
  1200. package/dist/mcp/machoContainer-9En6pSkd.js +813 -0
  1201. package/dist/mcp/main-WQSCuTNt.js +52791 -0
  1202. package/dist/mcp/main.js +6 -0
  1203. package/dist/mcp/managedToolContracts-o5LHFwHc.js +81 -0
  1204. package/dist/mcp/plistValue-DsU7z4yF.js +47 -0
  1205. package/dist/mcp/propertyListKeys-cX-BUv2y.js +197 -0
  1206. package/dist/mcp/providerAdapterError-CdPaQ6-Z.js +27 -0
  1207. package/dist/mcp/providerCleanupError-DvE79aUX.js +49 -0
  1208. package/dist/mcp/providerIdentities--ptAh481.js +31 -0
  1209. package/dist/mcp/providerIdentity-BCQ5n5tw.js +16 -0
  1210. package/dist/mcp/providerOperationHealth-CUeCJZiP.js +212 -0
  1211. package/dist/mcp/rolldown-runtime-BjeaiXFo.js +121 -0
  1212. package/dist/mcp/safeJson-NeGfpkrI.js +25 -0
  1213. package/dist/mcp/scanCanonical-2GN0h-BE.js +3647 -0
  1214. package/dist/mcp/serverIdentity-rOY69sxc.js +633 -0
  1215. package/dist/mcp/sourceMapEnvelope-D8Zezqyi.js +252 -0
  1216. package/dist/mcp/toolContracts-CrfYDTUz.js +14561 -0
  1217. package/dist/mcp/toolOutputSchemaGroups-ChxVLGoy.js +11114 -0
  1218. package/dist/mcp/unicodeCodePointOrder-BezCbTpg.js +26 -0
  1219. package/dist/mcp/webContentArtifact-DUBgMzVO.js +185 -0
  1220. package/dist/mcp/webRuntime-C2Tx-fgS.js +74 -0
  1221. package/dist/mcp/webSourceLocation-Dnkpf0R2.js +8532 -0
  1222. package/dist/mcpDoctor.js +360 -0
  1223. package/dist/mcpStartupPolicy.js +14 -0
  1224. package/dist/native/AppleDispatchCoverage.js +112 -0
  1225. package/dist/native/AppleDispatchDecodeFacts.js +6 -0
  1226. package/dist/native/AppleDispatchMetadata.js +176 -0
  1227. package/dist/native/AppleMachoFixups.js +372 -0
  1228. package/dist/native/AppleMachoSelection.js +234 -0
  1229. package/dist/native/AppleObjcCategories.js +63 -0
  1230. package/dist/native/AppleObjcDispatchFacets.js +260 -0
  1231. package/dist/native/AppleObjcProperties.js +79 -0
  1232. package/dist/native/AppleObjcProtocols.js +89 -0
  1233. package/dist/native/AppleSwiftDispatchFacets.js +156 -0
  1234. package/dist/native/AppleSwiftVtables.js +92 -0
  1235. package/dist/native/CommandRunner.js +240 -0
  1236. package/dist/native/LldbCallTracer.js +713 -0
  1237. package/dist/native/LldbRetainedObservations.js +178 -0
  1238. package/dist/native/NativeCallObservation.js +195 -0
  1239. package/dist/native/NativeMacOSProvider.js +701 -0
  1240. package/dist/native/NativeMacOSProviderMetadata.js +46 -0
  1241. package/dist/native/NativeMachoInspection.js +273 -0
  1242. package/dist/native/NativeUiHelperRuntime.js +66 -0
  1243. package/dist/native/NativeUiObservation.js +183 -0
  1244. package/dist/native/NativeUiOutputBudget.js +8 -0
  1245. package/dist/native/SignatureTargetBinding.js +155 -0
  1246. package/dist/native/parsers/codesign.js +93 -0
  1247. package/dist/native/parsers/demangle.js +30 -0
  1248. package/dist/native/parsers/dyldInfo.js +60 -0
  1249. package/dist/native/parsers/echoedPath.js +14 -0
  1250. package/dist/native/parsers/lipo.js +177 -0
  1251. package/dist/native/parsers/machoUuid.js +150 -0
  1252. package/dist/native/parsers/otool.js +379 -0
  1253. package/dist/native/parsers/plist.js +187 -0
  1254. package/dist/native/pe/PeResourceLayout.js +120 -0
  1255. package/dist/native/pe/PeResourceParser.js +286 -0
  1256. package/dist/native/pe/PeResourcesProvider.js +63 -0
  1257. package/dist/native/pwndbg/PwndbgCoreContext.js +180 -0
  1258. package/dist/native/pwntools/PwntoolsDecoder.js +206 -0
  1259. package/dist/native/pwntools/PwntoolsFailures.js +180 -0
  1260. package/dist/native/pwntools/PwntoolsLayoutProvider.js +36 -0
  1261. package/dist/native/pwntools/PwntoolsRecordedCrashProvider.js +75 -0
  1262. package/dist/native/pwntools/PwntoolsRelease.js +19 -0
  1263. package/dist/native/pwntools/PwntoolsResourceLimits.js +76 -0
  1264. package/dist/native/pwntools/RecordedCrashSourceBindings.js +46 -0
  1265. package/dist/native/pwntools/RecordedCrashStructureBindings.js +103 -0
  1266. package/dist/process/BoundedFileBytes.js +40 -0
  1267. package/dist/process/DarwinProcessRunTokenReader.js +376 -0
  1268. package/dist/process/ExecFileOutput.js +124 -0
  1269. package/dist/process/JavaScriptWorkerMemoryLimit.js +25 -0
  1270. package/dist/process/OwnedCommand.js +131 -0
  1271. package/dist/process/PendingOperations.js +61 -0
  1272. package/dist/process/PrivateRuntimeRoot.js +61 -0
  1273. package/dist/process/ProcessCommandIdentity.js +19 -0
  1274. package/dist/process/ProcessOwnership.js +636 -0
  1275. package/dist/process/ProcessOwnershipIdentity.js +13 -0
  1276. package/dist/process/ProcessOwnershipObservation.js +407 -0
  1277. package/dist/process/ProcessOwnershipProcessTree.js +35 -0
  1278. package/dist/process/ProcessRunTokenObservations.js +48 -0
  1279. package/dist/process/ProviderDeadline.js +91 -0
  1280. package/dist/process/ProviderDiagnosticRedaction.js +17 -0
  1281. package/dist/process/ProviderProcess.js +381 -0
  1282. package/dist/process/ProviderRunLineage.js +21 -0
  1283. package/dist/process/WindowsAuthority.js +51 -0
  1284. package/dist/process/WindowsBatchCommand.js +46 -0
  1285. package/dist/process/boundedUtf8Text.js +13 -0
  1286. package/dist/process/capture/FilesystemSnapshot.js +268 -0
  1287. package/dist/process/capture/ProcessCaptureCapability.js +65 -0
  1288. package/dist/process/capture/ProcessCaptureEnvironment.js +9 -0
  1289. package/dist/process/capture/ProcessCaptureError.js +74 -0
  1290. package/dist/process/capture/ProcessCaptureJournal.js +61 -0
  1291. package/dist/process/capture/ProcessCaptureLifecycle.js +1050 -0
  1292. package/dist/process/capture/ProcessCaptureProgress.js +62 -0
  1293. package/dist/process/capture/ProcessFilesystemEffects.js +81 -0
  1294. package/dist/process/capture/ProcessHarness.js +602 -0
  1295. package/dist/process/capture/ProcessNormalization.js +88 -0
  1296. package/dist/process/capture/ProcessSampling.js +415 -0
  1297. package/dist/process/capture/ProcessScenarioRuntimeValidation.js +79 -0
  1298. package/dist/process/capture/ProcessTimer.js +39 -0
  1299. package/dist/process/capture/TerminalRenderer.js +124 -0
  1300. package/dist/process/snapshotEnvironment.js +14 -0
  1301. package/dist/reference/ReferenceSourceReader.js +73 -0
  1302. package/dist/reference/ReferenceSourceReaderEntries.js +273 -0
  1303. package/dist/reference/ReferenceSourceReaderErrors.js +54 -0
  1304. package/dist/reference/ReferenceSourceReaderFile.js +147 -0
  1305. package/dist/reference/ReferenceSourceReaderPaths.js +8 -0
  1306. package/dist/reference/ReferenceSourceReaderTypes.js +1 -0
  1307. package/dist/reference/ReferenceSourceReaderValidate.js +81 -0
  1308. package/dist/server/EvidenceMcpServer.js +216 -0
  1309. package/dist/server/admittedToolOperation.js +9 -0
  1310. package/dist/server/analysisAdmission.js +8 -0
  1311. package/dist/server/contractToolHandler.js +21 -0
  1312. package/dist/server/createServer.js +344 -0
  1313. package/dist/server/lifecycleProgress.js +10 -0
  1314. package/dist/server/mcpClientMetadata.js +42 -0
  1315. package/dist/server/mcpProgress.js +26 -0
  1316. package/dist/server/promptCompletion.js +141 -0
  1317. package/dist/server/recordDerivedEvidence.js +10 -0
  1318. package/dist/server/registerAdbTools.js +36 -0
  1319. package/dist/server/registerAnalysisViewTool.js +10 -0
  1320. package/dist/server/registerAndroidTools.js +31 -0
  1321. package/dist/server/registerApktoolTools.js +14 -0
  1322. package/dist/server/registerApplicationTools/compareExportShapes.js +29 -0
  1323. package/dist/server/registerApplicationTools/compareSourceToBundle.js +29 -0
  1324. package/dist/server/registerApplicationTools/compareVersions.js +34 -0
  1325. package/dist/server/registerApplicationTools/coverage.js +13 -0
  1326. package/dist/server/registerApplicationTools/helpers.js +37 -0
  1327. package/dist/server/registerApplicationTools/obligationLedger.js +23 -0
  1328. package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +50 -0
  1329. package/dist/server/registerApplicationTools/traceFeature.js +26 -0
  1330. package/dist/server/registerApplicationTools/traceSemantics.js +25 -0
  1331. package/dist/server/registerApplicationTools/types.js +1 -0
  1332. package/dist/server/registerApplicationTools.js +19 -0
  1333. package/dist/server/registerArtifactComparisonTool.js +71 -0
  1334. package/dist/server/registerArtifactTools.js +14 -0
  1335. package/dist/server/registerBinaryDiagnosticsTools.js +26 -0
  1336. package/dist/server/registerBrowserScenarioTool.js +26 -0
  1337. package/dist/server/registerBrowserTools.js +58 -0
  1338. package/dist/server/registerBundleComparisonTool.js +54 -0
  1339. package/dist/server/registerCloseLifecycleTool.js +55 -0
  1340. package/dist/server/registerElectronTools.js +70 -0
  1341. package/dist/server/registerEnhancedTools.js +169 -0
  1342. package/dist/server/registerEvidenceTools.js +68 -0
  1343. package/dist/server/registerEvmTools.js +9 -0
  1344. package/dist/server/registerFirmwareTools.js +11 -0
  1345. package/dist/server/registerFunctionComparisonTool.js +86 -0
  1346. package/dist/server/registerGoTools.js +9 -0
  1347. package/dist/server/registerInvestigationTools/helpers.js +46 -0
  1348. package/dist/server/registerInvestigationTools/types.js +1 -0
  1349. package/dist/server/registerInvestigationTools.js +168 -0
  1350. package/dist/server/registerJavaScriptRecoveryTool.js +9 -0
  1351. package/dist/server/registerJavaScriptRuntimeObservationTools.js +27 -0
  1352. package/dist/server/registerJebTools.js +16 -0
  1353. package/dist/server/registerManagedTools.js +40 -0
  1354. package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +53 -0
  1355. package/dist/server/registerManagedWorkflowTools/contract.js +7 -0
  1356. package/dist/server/registerManagedWorkflowTools/evidence.js +27 -0
  1357. package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +27 -0
  1358. package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +41 -0
  1359. package/dist/server/registerManagedWorkflowTools/types.js +1 -0
  1360. package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +62 -0
  1361. package/dist/server/registerManagedWorkflowTools.js +11 -0
  1362. package/dist/server/registerOfficialTools.js +74 -0
  1363. package/dist/server/registerPeResourcesTool.js +9 -0
  1364. package/dist/server/registerProcessComparisonTool.js +156 -0
  1365. package/dist/server/registerPrompts.js +73 -0
  1366. package/dist/server/registerRecordedCrashTools.js +9 -0
  1367. package/dist/server/registerSessionRecordTools.js +90 -0
  1368. package/dist/server/registerSessionStatusTool.js +61 -0
  1369. package/dist/server/registerSessionTools.js +217 -0
  1370. package/dist/server/registerWasmTools.js +9 -0
  1371. package/dist/server/registerWebModuleTool.js +9 -0
  1372. package/dist/server/registerWebNetworkCaptureTool.js +20 -0
  1373. package/dist/server/registerWebRuntimeTools.js +27 -0
  1374. package/dist/server/registerWebScriptTool.js +18 -0
  1375. package/dist/server/registerWebSourceLocationTool.js +9 -0
  1376. package/dist/server/runDerivedOperation.js +55 -0
  1377. package/dist/server/sessionAvailabilityPolicy.js +29 -0
  1378. package/dist/server/sessionEvidence.js +11 -0
  1379. package/dist/server/toolLogging.js +11 -0
  1380. package/dist/server/toolRegistrationOptions.js +9 -0
  1381. package/dist/server/toolResult.js +119 -0
  1382. package/dist/server/toolResultEncoding.js +34 -0
  1383. package/dist/serverIdentity.js +69 -0
  1384. package/dist/wasm/WabtArtifactProvider.js +313 -0
  1385. package/dist/wasm/WabtFailures.js +62 -0
  1386. package/dist/wasm/WabtOutput.js +60 -0
  1387. package/dist/wasm/WabtRelease.js +12 -0
  1388. package/dist/wasm/WabtWat.js +184 -0
  1389. package/dist/wasm/WasmGlueAdapter.js +51 -0
  1390. package/dist/windows/WindowsNativeLoader.js +124 -0
  1391. package/dist/windows/WindowsOwnedProcess.js +265 -0
  1392. package/dist/windows/WindowsPrivateRuntime.js +143 -0
  1393. package/hooks/hooks.json +17 -0
  1394. package/install.sh +172 -0
  1395. package/licenses/Apache-2.0.txt +202 -0
  1396. package/licenses/GCC-Runtime-Library-Exception-3.1.txt +73 -0
  1397. package/licenses/GPL-3.0.txt +674 -0
  1398. package/licenses/MIT-template.txt +18 -0
  1399. package/licenses/MinGW-w64-runtime.txt +240 -0
  1400. package/licenses/Node-22.19.0-LICENSE.txt +2666 -0
  1401. package/licenses/README.md +54 -0
  1402. package/licenses/cfworker-MIT.txt +21 -0
  1403. package/licenses/digfox-MIT.txt +21 -0
  1404. package/licenses/dotnet-runtime-MIT.txt +23 -0
  1405. package/licenses/ghidra-12.1.4-DISCLAIMER.txt +13 -0
  1406. package/licenses/ghidra-12.1.4-LICENSE.txt +201 -0
  1407. package/licenses/ghidra-12.1.4-NOTICE.txt +49 -0
  1408. package/licenses/nativeaot-parser-MIT.txt +28 -0
  1409. package/licenses/npm-dependencies.txt +2812 -0
  1410. package/licenses/npm-runtime-notices.txt +6632 -0
  1411. package/licenses/rea-jev-MIT.txt +21 -0
  1412. package/licenses/rea-lab-MIT.txt +21 -0
  1413. package/licenses/upstream-sources.json +62 -0
  1414. package/licenses/xterm-MIT.txt +21 -0
  1415. package/native/windows/README.md +156 -0
  1416. package/native/windows/build/manifest.json +9 -0
  1417. package/native/windows/build/rea-windows-x64.node +0 -0
  1418. package/package.json +371 -4
  1419. package/port/cli.mjs +210 -0
  1420. package/port/hooks/guard.mjs +140 -0
  1421. package/port/knowledge/engines.json +67 -0
  1422. package/port/knowledge/footprints.json +189 -0
  1423. package/port/knowledge/maps/godot-godot-csharp.json +38 -0
  1424. package/port/knowledge/maps/godot-threejs.json +42 -0
  1425. package/port/knowledge/maps/godot-unity.json +62 -0
  1426. package/port/knowledge/maps/godot-unreal.json +48 -0
  1427. package/port/knowledge/maps/unity-godot.json +52 -0
  1428. package/port/knowledge/maps/unity-unreal.json +33 -0
  1429. package/port/knowledge/systems.json +1554 -0
  1430. package/port/mcp.mjs +62 -0
  1431. package/port/plugin/mcp-launch.mjs +19 -0
  1432. package/port/server.mjs +129 -0
  1433. package/port/src/agent.mjs +257 -0
  1434. package/port/src/archive.mjs +324 -0
  1435. package/port/src/binary.mjs +606 -0
  1436. package/port/src/blueprint.mjs +225 -0
  1437. package/port/src/compare.mjs +165 -0
  1438. package/port/src/connect.mjs +58 -0
  1439. package/port/src/convert.mjs +134 -0
  1440. package/port/src/formats.mjs +229 -0
  1441. package/port/src/graph.mjs +275 -0
  1442. package/port/src/knowledge.mjs +90 -0
  1443. package/port/src/lookup.mjs +615 -0
  1444. package/port/src/main-module.mjs +10 -0
  1445. package/port/src/plan.mjs +606 -0
  1446. package/port/src/porters.mjs +360 -0
  1447. package/port/src/proofcase.mjs +343 -0
  1448. package/port/src/relay.mjs +493 -0
  1449. package/port/src/scan.mjs +189 -0
  1450. package/port/src/scene.mjs +338 -0
  1451. package/port/src/stashpad.mjs +114 -0
  1452. package/port/src/symbols.mjs +201 -0
  1453. package/port/src/tools.mjs +198 -0
  1454. package/port/src/util.mjs +162 -0
  1455. package/port/src/workspace.mjs +39 -0
  1456. package/port/templates/unity/ReversePortSceneBuilder.cs +258 -0
  1457. package/scripts/electron-active-hook-boundaries.cjs +392 -0
  1458. package/scripts/electron-active-hook.cjs +673 -0
  1459. package/scripts/hopper-demo-x11.py +787 -0
  1460. package/scripts/prepack.mjs +60 -0
  1461. package/scripts/prepare.mjs +28 -0
  1462. package/scripts/rea.mjs +110 -0
  1463. package/scripts/verify-windows-native-artifact.mjs +39 -0
  1464. package/skills/build-inspector/SKILL.md +44 -0
  1465. package/skills/godot-port/SKILL.md +42 -0
  1466. package/skills/port-project/SKILL.md +59 -0
  1467. package/skills/port-verify/SKILL.md +35 -0
  1468. package/skills/proof-case/SKILL.md +52 -0
  1469. package/skills/rebuild/SKILL.md +66 -0
  1470. package/skills/reverse-engineer/SKILL.md +67 -0
  1471. package/skills/reverse-engineer-anything/SKILL.md +204 -0
  1472. package/skills/reverse-engineer-anything/references/android-applications.md +34 -0
  1473. package/skills/reverse-engineer-anything/references/connection-and-recovery.md +130 -0
  1474. package/skills/reverse-engineer-anything/references/evidence-workflows.md +54 -0
  1475. package/skills/reverse-engineer-anything/references/godot-source.md +37 -0
  1476. package/skills/reverse-engineer-anything/references/javascript-applications.md +175 -0
  1477. package/skills/reverse-engineer-anything/references/native-and-artifacts.md +252 -0
  1478. package/skills/reverse-engineer-anything/references/porting-and-rebuilds.md +92 -0
  1479. package/skills/reverse-engineer-anything/references/runtime-observation.md +28 -0
  1480. package/skills/reverse-engineer-anything/references/unity-source.md +32 -0
  1481. package/skills/troubleshoot/SKILL.md +27 -0
  1482. package/skills/unity-to-godot/SKILL.md +37 -0
  1483. package/third_party/README.md +60 -0
  1484. package/third_party/evmole/LICENSE +21 -0
  1485. package/third_party/evmole/README.md +22 -0
  1486. package/third_party/pwndbg/LICENSE.md +21 -0
  1487. package/third_party/pwndbg/README.md +23 -0
  1488. package/third_party/pwntools/README.md +40 -0
  1489. package/third_party/wabt/README.md +24 -0
@@ -0,0 +1,1411 @@
1
+ import { t as __esmMin } from "./rolldown-runtime-BjeaiXFo.js";
2
+ import { d as init_analysisErrorCore, i as AnalysisCapabilityUnavailableError } from "./analysisErrorCore-BqyeMw3_.js";
3
+ import { n as safeParseJson, t as init_safeJson } from "./safeJson-NeGfpkrI.js";
4
+ import { r as init_unicodeCodePointOrder, t as compareUnicodeCodePoints } from "./unicodeCodePointOrder-BezCbTpg.js";
5
+ import { fileURLToPath } from "node:url";
6
+ import { rmSync } from "node:fs";
7
+ import { basename, join } from "node:path";
8
+ import { z } from "zod";
9
+ import { tmpdir } from "node:os";
10
+ import { execFile } from "node:child_process";
11
+ import { mkdir, mkdtemp, readFile, rm } from "node:fs/promises";
12
+ import { promisify } from "node:util";
13
+
14
+ //#region dist/process/ProcessCommandIdentity.js
15
+ var matchesOwnedProcessCommand;
16
+ function init_ProcessCommandIdentity() {
17
+ return (init_ProcessCommandIdentity = __esmMin((() => {
18
+ matchesOwnedProcessCommand = (actual, expected, platform = process.platform) => {
19
+ const actualCommand = actual.trim();
20
+ const expectedCommand = expected.trim();
21
+ if (actualCommand === expectedCommand || actualCommand.startsWith(`${expectedCommand} `)) return true;
22
+ if (platform !== "darwin") return false;
23
+ const actualExecutable = actualCommand.split(/\s+/u, 1)[0];
24
+ const expectedExecutable = expectedCommand.split(/\s+/u, 1)[0];
25
+ const normalizedActualExecutable = actualExecutable?.startsWith("(") === true && actualExecutable.endsWith(")") ? actualExecutable.slice(1, -1) : actualExecutable;
26
+ return normalizedActualExecutable !== undefined && expectedExecutable !== undefined && basename(normalizedActualExecutable) === basename(expectedExecutable);
27
+ };
28
+ })))();
29
+ }
30
+
31
+ //#endregion
32
+ //#region dist/process/ProcessOwnershipIdentity.js
33
+ var launcherIdentityFailure;
34
+ function init_ProcessOwnershipIdentity() {
35
+ return (init_ProcessOwnershipIdentity = __esmMin((() => {
36
+ init_ProcessCommandIdentity();
37
+ launcherIdentityFailure = (launcher, ownership) => {
38
+ if (launcher.processGroupId !== ownership.processGroupId) return "owned launcher process-group identity did not match";
39
+ if (ownership.expectedParentPid !== undefined && launcher.parentPid !== ownership.expectedParentPid) return "owned launcher parent identity did not match";
40
+ if (ownership.expectedCommand !== undefined && !matchesOwnedProcessCommand(launcher.command, ownership.expectedCommand)) return `owned launcher command identity did not match (observed=${launcher.command}; expected=${ownership.expectedCommand})`;
41
+ return null;
42
+ };
43
+ })))();
44
+ }
45
+
46
+ //#endregion
47
+ //#region dist/process/ProcessOwnershipProcessTree.js
48
+ var liveProcesses, descendantsOf, selectCapturedProcessGroupIds;
49
+ function init_ProcessOwnershipProcessTree() {
50
+ return (init_ProcessOwnershipProcessTree = __esmMin((() => {
51
+ liveProcesses = (members) => members.filter(({ state }) => !state.startsWith("Z"));
52
+ descendantsOf = (rootPids, processes) => {
53
+ const childrenByParent = new Map();
54
+ for (const process of processes) {
55
+ const siblings = childrenByParent.get(process.parentPid) ?? [];
56
+ siblings.push(process);
57
+ childrenByParent.set(process.parentPid, siblings);
58
+ }
59
+ const descendants = [];
60
+ const pending = rootPids.flatMap((pid) => childrenByParent.get(pid) ?? []);
61
+ const visited = new Set(rootPids);
62
+ for (const process of pending) {
63
+ if (visited.has(process.pid)) continue;
64
+ visited.add(process.pid);
65
+ descendants.push(process);
66
+ pending.push(...childrenByParent.get(process.pid) ?? []);
67
+ }
68
+ return descendants;
69
+ };
70
+ selectCapturedProcessGroupIds = (rootPid, samples) => {
71
+ const processGroupIds = new Set([rootPid]);
72
+ for (const sample of samples) {
73
+ if (sample.pid === sample.process_group_id) processGroupIds.add(sample.pid);
74
+ }
75
+ return [...processGroupIds];
76
+ };
77
+ })))();
78
+ }
79
+
80
+ //#endregion
81
+ //#region dist/process/ExecFileOutput.js
82
+ var STOP_GRACE_MS, abortError, timeoutError, invalidTimeout, execFileOutputFailure, execFileBytes, execFileOutput;
83
+ function init_ExecFileOutput() {
84
+ return (init_ExecFileOutput = __esmMin((() => {
85
+ STOP_GRACE_MS = 5e3;
86
+ abortError = (signal) => {
87
+ const error = new Error("The operation was aborted", { cause: signal.reason });
88
+ error.name = "AbortError";
89
+ Reflect.set(error, "code", "ABORT_ERR");
90
+ return error;
91
+ };
92
+ timeoutError = (command, timeout, exit) => {
93
+ const error = new Error(`Command timed out after ${String(timeout)} ms: ${command}`, exit === null ? undefined : { cause: exit });
94
+ Reflect.set(error, "code", "ETIMEDOUT");
95
+ Reflect.set(error, "killed", true);
96
+ Reflect.set(error, "signal", exit === null ? null : Reflect.get(exit, "signal") ?? null);
97
+ return error;
98
+ };
99
+ invalidTimeout = (timeout) => {
100
+ if (Number.isSafeInteger(timeout) && timeout >= 0) return undefined;
101
+ const error = new RangeError(`The value of "timeout" is out of range. It must be an unsigned integer. Received ${String(timeout)}`);
102
+ Reflect.set(error, "code", "ERR_OUT_OF_RANGE");
103
+ return error;
104
+ };
105
+ execFileOutputFailure = (cause) => {
106
+ if (!(cause instanceof Error)) return undefined;
107
+ const stdout = Reflect.get(cause, "stdout");
108
+ const stderr = Reflect.get(cause, "stderr");
109
+ const code = Reflect.get(cause, "code");
110
+ const signal = Reflect.get(cause, "signal");
111
+ const killed = Reflect.get(cause, "killed");
112
+ if (typeof stdout !== "string" || typeof stderr !== "string") return undefined;
113
+ return {
114
+ stdout,
115
+ stderr,
116
+ code: typeof code === "string" || typeof code === "number" ? code : null,
117
+ signal: typeof signal === "string" ? signal : null,
118
+ killed: killed === true,
119
+ outputTruncated: code === "ERR_CHILD_PROCESS_STDIO_MAXBUFFER"
120
+ };
121
+ };
122
+ execFileBytes = (command, arguments_, options = {}) => new Promise((resolve, reject) => {
123
+ const { stopSignal, signal, timeout, ...execOptions } = options;
124
+ const invalid = timeout === undefined ? undefined : invalidTimeout(timeout);
125
+ if (invalid !== undefined) {
126
+ reject(invalid);
127
+ return;
128
+ }
129
+ if (stopSignal !== undefined && signal?.aborted === true) {
130
+ reject(abortError(signal));
131
+ return;
132
+ }
133
+ let stopped;
134
+ let deadline;
135
+ let grace;
136
+ const child = execFile(command, [...arguments_], {
137
+ ...execOptions,
138
+ ...stopSignal === undefined ? {
139
+ ...signal === undefined ? {} : { signal },
140
+ ...timeout === undefined ? {} : { timeout }
141
+ } : { killSignal: stopSignal },
142
+ encoding: "buffer",
143
+ maxBuffer: options.maxBuffer ?? Number.POSITIVE_INFINITY
144
+ }, (error, stdout, stderr) => {
145
+ signal?.removeEventListener("abort", onAbort);
146
+ clearTimeout(deadline);
147
+ clearTimeout(grace);
148
+ const failure = stopped === "abort" && signal !== undefined ? abortError(signal) : stopped === "timeout" && timeout !== undefined ? timeoutError(command, timeout, error) : error;
149
+ if (failure !== null) {
150
+ Reflect.set(failure, "stdout", stdout.toString("utf8"));
151
+ Reflect.set(failure, "stderr", stderr.toString("utf8"));
152
+ reject(failure);
153
+ return;
154
+ }
155
+ resolve({
156
+ stdout,
157
+ stderr
158
+ });
159
+ });
160
+ const stop = (reason) => {
161
+ if (stopped !== undefined) return;
162
+ stopped = reason;
163
+ child.kill(stopSignal);
164
+ grace = setTimeout(() => child.kill("SIGKILL"), STOP_GRACE_MS);
165
+ };
166
+ const onAbort = () => {
167
+ stop("abort");
168
+ };
169
+ if (stopSignal === undefined) return;
170
+ signal?.addEventListener("abort", onAbort, { once: true });
171
+ if (timeout !== undefined && timeout > 0) deadline = setTimeout(() => {
172
+ stop("timeout");
173
+ }, timeout);
174
+ });
175
+ execFileOutput = (command, arguments_, options = {}) => execFileBytes(command, arguments_, options).then(({ stdout, stderr }) => ({
176
+ stdout: stdout.toString("utf8"),
177
+ stderr: stderr.toString("utf8")
178
+ }));
179
+ })))();
180
+ }
181
+
182
+ //#endregion
183
+ //#region dist/process/boundedUtf8Text.js
184
+ var boundedUtf8Text;
185
+ function init_boundedUtf8Text() {
186
+ return (init_boundedUtf8Text = __esmMin((() => {
187
+ boundedUtf8Text = (value, maximumBytes) => {
188
+ let bytes = 0;
189
+ let end = 0;
190
+ for (const codePoint of value) {
191
+ const codePointBytes = Buffer.byteLength(codePoint, "utf8");
192
+ if (bytes + codePointBytes > maximumBytes) return {
193
+ text: value.slice(0, end),
194
+ truncated: true
195
+ };
196
+ bytes += codePointBytes;
197
+ end += codePoint.length;
198
+ }
199
+ return {
200
+ text: value,
201
+ truncated: false
202
+ };
203
+ };
204
+ })))();
205
+ }
206
+
207
+ //#endregion
208
+ //#region dist/process/DarwinProcessRunTokenReader.js
209
+ var responseSchema, identityResponseSchema, sourceFiles, SWIFTC_INTERRUPT, COMPILER_TIMEOUT_MS, STDERR_EXCERPT_LIMIT, DarwinProcessOwnershipInspectionError, MAX_COMPILER_STDERR_BYTES, compilerOutcome, compilerOutcomeDescription, compilerInspectionError, abortReason, isExpectedAbort$1, waitForCompilation, createDarwinProcessRunTokenReader;
210
+ function init_DarwinProcessRunTokenReader() {
211
+ return (init_DarwinProcessRunTokenReader = __esmMin((() => {
212
+ init_safeJson();
213
+ init_boundedUtf8Text();
214
+ init_ExecFileOutput();
215
+ responseSchema = z.strictObject({ results: z.array(z.discriminatedUnion("state", [z.strictObject({
216
+ pid: z.number().int().positive(),
217
+ state: z.literal("readable"),
218
+ run_id: z.string().optional(),
219
+ reason: z.null().optional()
220
+ }), z.strictObject({
221
+ pid: z.number().int().positive(),
222
+ state: z.literal("unavailable"),
223
+ run_id: z.union([z.string(), z.null()]).optional(),
224
+ reason: z.string().min(1)
225
+ })])) });
226
+ identityResponseSchema = z.strictObject({ results: z.array(z.discriminatedUnion("state", [z.strictObject({
227
+ pid: z.number().int().positive(),
228
+ state: z.literal("readable"),
229
+ identity: z.string().min(1),
230
+ reason: z.null().optional()
231
+ }), z.strictObject({
232
+ pid: z.number().int().positive(),
233
+ state: z.literal("unavailable"),
234
+ identity: z.null().optional(),
235
+ reason: z.string().min(1)
236
+ })])) });
237
+ sourceFiles = [fileURLToPath(new URL("../../bridge/process/ProcessRunTokenReader.swift", new URL("../process/DarwinProcessRunTokenReader.js", import.meta.url).href)), fileURLToPath(new URL("../../bridge/process/ProcessRunTokenReaderMain.swift", new URL("../process/DarwinProcessRunTokenReader.js", import.meta.url).href))];
238
+ SWIFTC_INTERRUPT = "SIGINT";
239
+ COMPILER_TIMEOUT_MS = 6e4;
240
+ STDERR_EXCERPT_LIMIT = 512;
241
+ DarwinProcessOwnershipInspectionError = class extends Error {
242
+ constructor(message, options) {
243
+ const { compilerOutcome, ...errorOptions } = options ?? {};
244
+ super(message, errorOptions);
245
+ this.name = "DarwinProcessOwnershipInspectionError";
246
+ this.compilerOutcome = compilerOutcome;
247
+ }
248
+ compilerOutcome;
249
+ };
250
+ MAX_COMPILER_STDERR_BYTES = 8 * 1024;
251
+ compilerOutcome = (cause, timeoutMs) => {
252
+ const failure = execFileOutputFailure(cause);
253
+ if (failure === undefined) return undefined;
254
+ const stderr = boundedUtf8Text(failure.stderr, MAX_COMPILER_STDERR_BYTES);
255
+ const outcome = failure.code === "ETIMEDOUT" ? "timed_out" : typeof failure.code === "number" ? "exited" : failure.signal !== null ? "signaled" : failure.code === "ENOENT" ? "spawn_failed" : "failed";
256
+ return {
257
+ outcome,
258
+ code: failure.code,
259
+ signal: failure.signal,
260
+ stderr: stderr.text,
261
+ stderrBytes: Buffer.byteLength(failure.stderr, "utf8"),
262
+ stderrTruncated: stderr.truncated,
263
+ outputTruncated: failure.outputTruncated,
264
+ killed: failure.killed,
265
+ ...outcome === "timed_out" ? { timeoutMs } : {}
266
+ };
267
+ };
268
+ compilerOutcomeDescription = (outcome, fallbackCode) => {
269
+ if (outcome === undefined) return `compiler result: ${String(fallbackCode)}`;
270
+ if (outcome.outcome === "exited") return `compiler result: exit code ${String(outcome.code)}`;
271
+ if (outcome.outcome === "timed_out") return `compiler result: timed out after ${String(outcome.timeoutMs)} ms`;
272
+ if (outcome.outcome === "signaled") return `compiler result: stopped by signal ${outcome.signal ?? "an unknown signal"}`;
273
+ return `compiler result: ${String(outcome.code)}`;
274
+ };
275
+ compilerInspectionError = (cause, timeoutMs) => {
276
+ const outcome = compilerOutcome(cause, timeoutMs);
277
+ const code = outcome?.code ?? "unknown";
278
+ const description = compilerOutcomeDescription(outcome, code);
279
+ const prefix = code === "ENOENT" ? "macOS process ownership inspection requires the Apple Swift compiler via xcrun" : "macOS process ownership helper compilation failed via xcrun";
280
+ const stderr = boundedUtf8Text(outcome?.stderr ?? "", STDERR_EXCERPT_LIMIT);
281
+ const diagnostics = stderr.text.trim();
282
+ const truncated = stderr.truncated || outcome?.stderrTruncated === true || outcome?.outputTruncated === true;
283
+ const suffix = diagnostics ? `: ${diagnostics}${truncated ? "… [diagnostics truncated]" : ""}` : outcome === undefined ? `: ${cause instanceof Error ? cause.message : String(cause)}` : ": no compiler diagnostics were captured";
284
+ return new DarwinProcessOwnershipInspectionError(`${prefix} (${description})${suffix}`, {
285
+ cause,
286
+ ...outcome === undefined ? {} : { compilerOutcome: outcome }
287
+ });
288
+ };
289
+ abortReason = (signal) => {
290
+ if (signal.reason !== undefined) return signal.reason;
291
+ const error = new Error("The operation was aborted");
292
+ error.name = "AbortError";
293
+ return error;
294
+ };
295
+ isExpectedAbort$1 = (cause, signal) => signal.aborted && (cause === signal.reason || cause instanceof Error && cause.name === "AbortError");
296
+ waitForCompilation = async (promise, signal) => {
297
+ if (signal === undefined) return promise;
298
+ if (signal.aborted) throw abortReason(signal);
299
+ return new Promise((resolve, reject) => {
300
+ let completed = false;
301
+ const finish = (callback) => {
302
+ if (completed) return;
303
+ completed = true;
304
+ signal.removeEventListener("abort", onAbort);
305
+ callback();
306
+ };
307
+ const onAbort = () => finish(() => reject(abortReason(signal)));
308
+ signal.addEventListener("abort", onAbort, { once: true });
309
+ promise.then((value) => finish(() => resolve(value)), (cause) => finish(() => reject(cause)));
310
+ if (signal.aborted) onAbort();
311
+ });
312
+ };
313
+ createDarwinProcessRunTokenReader = (options = {}) => {
314
+ const compilerTimeoutMs = options.compileTimeoutMs ?? COMPILER_TIMEOUT_MS;
315
+ let root;
316
+ let executable;
317
+ let compilation;
318
+ let closePromise;
319
+ let closed = false;
320
+ let exitCleanupInstalled = false;
321
+ const cleanupAtExit = () => {
322
+ if (root !== undefined) rmSync(root, {
323
+ recursive: true,
324
+ force: true
325
+ });
326
+ };
327
+ const cleanupRoot = async (target = root) => {
328
+ if (target === undefined) return;
329
+ await rm(target, {
330
+ recursive: true,
331
+ force: true
332
+ });
333
+ if (root !== target) return;
334
+ root = undefined;
335
+ executable = undefined;
336
+ if (exitCleanupInstalled) process.removeListener("exit", cleanupAtExit);
337
+ exitCleanupInstalled = false;
338
+ };
339
+ const runCompilation = async (signal) => {
340
+ let operationRoot;
341
+ try {
342
+ operationRoot = await mkdtemp(join(tmpdir(), "rea-process-token-"));
343
+ root = operationRoot;
344
+ process.once("exit", cleanupAtExit);
345
+ exitCleanupInstalled = true;
346
+ if (signal.aborted || closed) throw abortReason(signal);
347
+ const output = join(operationRoot, "reader");
348
+ const compilerTemporary = join(operationRoot, "tmp");
349
+ await mkdir(compilerTemporary);
350
+ const compilerEnvironment = {
351
+ ...process.env,
352
+ TMPDIR: compilerTemporary
353
+ };
354
+ delete compilerEnvironment.CLANG_MODULE_CACHE_PATH;
355
+ try {
356
+ await execFileOutput(options.xcrun ?? "/usr/bin/xcrun", [
357
+ "swiftc",
358
+ ...sourceFiles,
359
+ "-o",
360
+ output
361
+ ], {
362
+ timeout: compilerTimeoutMs,
363
+ maxBuffer: 1024 * 1024,
364
+ signal,
365
+ stopSignal: SWIFTC_INTERRUPT,
366
+ env: compilerEnvironment
367
+ });
368
+ } catch (cause) {
369
+ if (isExpectedAbort$1(cause, signal)) throw cause;
370
+ throw compilerInspectionError(cause, compilerTimeoutMs);
371
+ }
372
+ if (signal.aborted || closed) throw abortReason(signal);
373
+ executable = output;
374
+ return output;
375
+ } catch (cause) {
376
+ const ownsRoot = operationRoot !== undefined && root === operationRoot;
377
+ if (operationRoot !== undefined) {
378
+ if (ownsRoot) await cleanupRoot(operationRoot);
379
+ else await rm(operationRoot, {
380
+ recursive: true,
381
+ force: true
382
+ });
383
+ }
384
+ throw cause;
385
+ }
386
+ };
387
+ const beginCompilation = () => {
388
+ const controller = new AbortController();
389
+ const operation = {
390
+ controller,
391
+ promise: runCompilation(controller.signal).finally(() => {
392
+ operation.settled = true;
393
+ if (compilation === operation) compilation = undefined;
394
+ }),
395
+ waiters: 0,
396
+ aborting: false,
397
+ settled: false
398
+ };
399
+ compilation = operation;
400
+ return operation;
401
+ };
402
+ const compile = async (signal) => {
403
+ if (closed) throw new Error("Darwin process token reader is closed");
404
+ signal?.throwIfAborted();
405
+ while (true) {
406
+ if (closed) throw new Error("Darwin process token reader is closed");
407
+ signal?.throwIfAborted();
408
+ if (executable !== undefined) return executable;
409
+ if (compilation === undefined && root !== undefined) {
410
+ await cleanupRoot();
411
+ continue;
412
+ }
413
+ let operation = compilation;
414
+ if (operation?.aborting === true) {
415
+ try {
416
+ await waitForCompilation(operation.promise, signal);
417
+ } catch (cause) {
418
+ if (signal !== undefined && isExpectedAbort$1(cause, signal)) throw cause;
419
+ }
420
+ continue;
421
+ }
422
+ operation ??= beginCompilation();
423
+ operation.waiters += 1;
424
+ try {
425
+ return await waitForCompilation(operation.promise, signal);
426
+ } finally {
427
+ operation.waiters -= 1;
428
+ if (operation.waiters === 0 && !operation.settled && !operation.aborting) {
429
+ operation.aborting = true;
430
+ operation.controller.abort();
431
+ await operation.promise.catch(() => undefined);
432
+ }
433
+ }
434
+ }
435
+ };
436
+ const read = async (processes, signal) => {
437
+ signal?.throwIfAborted();
438
+ if (processes.length === 0) return new Map();
439
+ const binary = await compile(signal);
440
+ const pids = processes.map(({ pid }) => String(pid));
441
+ const { stdout } = await execFileOutput(binary, pids, {
442
+ timeout: 15e3,
443
+ ...signal === undefined ? {} : { signal }
444
+ });
445
+ signal?.throwIfAborted();
446
+ const decoded = safeParseJson(stdout);
447
+ if (!decoded.ok) throw new Error(`macOS process token helper returned invalid JSON: ${decoded.error}`, { cause: decoded.cause });
448
+ const parsed = responseSchema.safeParse(decoded.value);
449
+ if (!parsed.success) throw new Error("macOS process token helper returned an invalid response", { cause: parsed.error });
450
+ const requested = new Set(processes.map(({ pid }) => pid));
451
+ const observations = new Map();
452
+ for (const result of parsed.data.results) {
453
+ if (!requested.has(result.pid) || observations.has(result.pid)) throw new Error("macOS process token helper returned an unexpected PID set");
454
+ observations.set(result.pid, result.state === "readable" ? {
455
+ state: "readable",
456
+ runId: result.run_id
457
+ } : {
458
+ state: "unavailable",
459
+ reason: result.reason ?? "process token observation is unavailable"
460
+ });
461
+ }
462
+ if (observations.size !== requested.size) throw new Error("macOS process token helper returned an incomplete PID set");
463
+ return observations;
464
+ };
465
+ const identities = async (processes, signal) => {
466
+ if (processes.length === 0) return new Map();
467
+ const binary = await compile(signal);
468
+ const pids = processes.map(({ pid }) => String(pid));
469
+ const { stdout } = await execFileOutput(binary, ["--identities", ...pids], {
470
+ timeout: 15e3,
471
+ ...signal === undefined ? {} : { signal }
472
+ });
473
+ const decoded = safeParseJson(stdout);
474
+ if (!decoded.ok) throw new Error(`macOS process identity helper returned invalid JSON: ${decoded.error}`, { cause: decoded.cause });
475
+ const parsed = identityResponseSchema.safeParse(decoded.value);
476
+ if (!parsed.success) throw new Error("macOS process identity helper returned an invalid response", { cause: parsed.error });
477
+ const requested = new Set(processes.map(({ pid }) => pid));
478
+ const observations = new Map();
479
+ for (const result of parsed.data.results) {
480
+ if (!requested.has(result.pid) || observations.has(result.pid)) throw new Error("macOS process identity helper returned an unexpected PID set");
481
+ observations.set(result.pid, result.state === "readable" ? {
482
+ state: "readable",
483
+ identity: result.identity
484
+ } : {
485
+ state: "unavailable",
486
+ reason: result.reason
487
+ });
488
+ }
489
+ if (observations.size !== requested.size) throw new Error("macOS process identity helper returned an incomplete PID set");
490
+ return observations;
491
+ };
492
+ const close = () => {
493
+ if (closePromise !== undefined) return closePromise;
494
+ closed = true;
495
+ const pendingClose = (async () => {
496
+ const operation = compilation;
497
+ if (operation !== undefined && !operation.settled) {
498
+ operation.aborting = true;
499
+ operation.controller.abort();
500
+ await operation.promise.catch(() => undefined);
501
+ }
502
+ await cleanupRoot();
503
+ })().catch((cause) => {
504
+ if (closePromise === pendingClose) closePromise = undefined;
505
+ throw cause;
506
+ });
507
+ closePromise = pendingClose;
508
+ return closePromise;
509
+ };
510
+ return {
511
+ read,
512
+ identities,
513
+ prepare: compile,
514
+ close
515
+ };
516
+ };
517
+ })))();
518
+ }
519
+
520
+ //#endregion
521
+ //#region dist/process/ProcessRunTokenObservations.js
522
+ /** Read only ownership tokens, using per-process fallback for missing batch rows. */
523
+ async function* readProcessRunTokens(host, processes, signal) {
524
+ signal?.throwIfAborted();
525
+ if (processes.length === 0) return;
526
+ let batch;
527
+ let batchFailure;
528
+ if (host.runTokens !== undefined) {
529
+ try {
530
+ batch = signal === undefined ? await host.runTokens(processes) : await host.runTokens(processes, signal);
531
+ } catch (cause) {
532
+ signal?.throwIfAborted();
533
+ batchFailure = errorMessage$1(cause);
534
+ }
535
+ }
536
+ for (const process of processes) {
537
+ signal?.throwIfAborted();
538
+ let observation = batch?.get(process.pid);
539
+ if (observation === undefined) {
540
+ try {
541
+ const environment = signal === undefined ? await host.environment(process.pid) : await host.environment(process.pid, signal);
542
+ observation = {
543
+ state: "readable",
544
+ runId: environment.REA_PROCESS_RUN_ID
545
+ };
546
+ } catch (cause) {
547
+ signal?.throwIfAborted();
548
+ const reason = errorMessage$1(cause);
549
+ observation = {
550
+ state: "unavailable",
551
+ reason: batchFailure === undefined ? reason : `${reason}; run-token batch failed: ${batchFailure}`
552
+ };
553
+ }
554
+ }
555
+ signal?.throwIfAborted();
556
+ yield {
557
+ process,
558
+ observation
559
+ };
560
+ }
561
+ }
562
+ var errorMessage$1;
563
+ function init_ProcessRunTokenObservations() {
564
+ return (init_ProcessRunTokenObservations = __esmMin((() => {
565
+ errorMessage$1 = (cause) => cause instanceof Error ? cause.message : String(cause);
566
+ })))();
567
+ }
568
+
569
+ //#endregion
570
+ //#region dist/process/ProcessOwnershipObservation.js
571
+ var observeOwnedProcessGroups, observeOwnedProcessLineage, unavailableLineage, parseProcessEnvironment, parseLinuxProcessStartTime, isExpectedAbort, createSystemProcessOwnershipHost, systemProcessOwnershipHost, observeProcessStartIdentity, signalProcessWithStartIdentity, prepareProcessOwnershipInspection, processIsGone, errorMessage;
572
+ function init_ProcessOwnershipObservation() {
573
+ return (init_ProcessOwnershipObservation = __esmMin((() => {
574
+ init_analysisErrorCore();
575
+ init_ProcessOwnershipIdentity();
576
+ init_ProcessOwnershipProcessTree();
577
+ init_ExecFileOutput();
578
+ init_DarwinProcessRunTokenReader();
579
+ init_ProcessRunTokenObservations();
580
+ observeOwnedProcessGroups = async (runId, processGroupIds, host = systemProcessOwnershipHost, signal) => {
581
+ signal?.throwIfAborted();
582
+ const groupIds = [...new Set(processGroupIds)];
583
+ if (groupIds.length === 0) return new Map();
584
+ let processes;
585
+ try {
586
+ processes = liveProcesses(await host.listProcesses(signal));
587
+ } catch (cause) {
588
+ signal?.throwIfAborted();
589
+ const failure = {
590
+ state: "unverifiable",
591
+ reason: `process group could not be inspected: ${errorMessage(cause)}`
592
+ };
593
+ return new Map(groupIds.map((groupId) => [groupId, failure]));
594
+ }
595
+ signal?.throwIfAborted();
596
+ const membersByGroup = new Map(groupIds.map((groupId) => [groupId, []]));
597
+ for (const process of processes) membersByGroup.get(process.processGroupId)?.push(process);
598
+ const observations = new Map(groupIds.map((groupId) => [groupId, (membersByGroup.get(groupId)?.length ?? 0) > 0 ? { state: "alive" } : { state: "empty" }]));
599
+ const liveMembers = groupIds.flatMap((groupId) => membersByGroup.get(groupId) ?? []);
600
+ const pendingGroups = new Set(groupIds.filter((groupId) => (membersByGroup.get(groupId)?.length ?? 0) > 0));
601
+ for await (const { process: member, observation } of readProcessRunTokens(host, liveMembers, signal)) {
602
+ if (!pendingGroups.has(member.processGroupId)) continue;
603
+ if (observation.state === "readable") {
604
+ if (observation.runId !== runId) {
605
+ observations.set(member.processGroupId, {
606
+ state: "unverifiable",
607
+ reason: "process ownership did not match"
608
+ });
609
+ pendingGroups.delete(member.processGroupId);
610
+ }
611
+ } else {
612
+ const gone = await processIsGone(host, member.pid);
613
+ signal?.throwIfAborted();
614
+ if (!gone) {
615
+ observations.set(member.processGroupId, {
616
+ state: "unverifiable",
617
+ reason: `process ownership could not be revalidated for PID ${member.pid}: ${observation.reason}`
618
+ });
619
+ pendingGroups.delete(member.processGroupId);
620
+ }
621
+ }
622
+ if (pendingGroups.size === 0) break;
623
+ }
624
+ signal?.throwIfAborted();
625
+ return observations;
626
+ };
627
+ observeOwnedProcessLineage = async (ownership, host = systemProcessOwnershipHost) => {
628
+ let processes;
629
+ try {
630
+ processes = liveProcesses(await host.listProcesses());
631
+ } catch (cause) {
632
+ return unavailableLineage(ownership, `process table could not be inspected: ${errorMessage(cause)}`);
633
+ }
634
+ const launcher = processes.find(({ pid }) => pid === ownership.leaderPid);
635
+ if (launcher === undefined) return unavailableLineage(ownership, "owned launcher is not live");
636
+ const identityFailure = launcherIdentityFailure(launcher, ownership);
637
+ if (identityFailure !== null) return unavailableLineage(ownership, identityFailure);
638
+ const descendants = descendantsOf([launcher.pid], processes);
639
+ const verifiedDescendants = [];
640
+ for await (const { process: member, observation } of readProcessRunTokens(host, [launcher, ...descendants])) {
641
+ if (observation.state === "readable") {
642
+ if (observation.runId !== ownership.runId) return unavailableLineage(ownership, "process lineage contains an unowned or PID-reused process");
643
+ if (member.pid !== launcher.pid) verifiedDescendants.push(member);
644
+ } else {
645
+ if (await processIsGone(host, member.pid)) {
646
+ if (member.pid === launcher.pid) return unavailableLineage(ownership, "owned launcher exited during lineage validation");
647
+ continue;
648
+ }
649
+ return unavailableLineage(ownership, `process ownership could not be revalidated for PID ${member.pid}: ${observation.reason}`);
650
+ }
651
+ }
652
+ return {
653
+ status: "verified",
654
+ observedAt: new Date().toISOString(),
655
+ lineage: {
656
+ runId: ownership.runId,
657
+ launcherPid: launcher.pid,
658
+ launcherParentPid: launcher.parentPid,
659
+ processGroupId: launcher.processGroupId,
660
+ descendants: verifiedDescendants.sort((left, right) => left.pid - right.pid).map(({ pid, parentPid, processGroupId }) => ({
661
+ pid,
662
+ parentPid,
663
+ processGroupId
664
+ }))
665
+ }
666
+ };
667
+ };
668
+ unavailableLineage = (ownership, reason) => ({
669
+ status: "unavailable",
670
+ observedAt: new Date().toISOString(),
671
+ runId: ownership.runId,
672
+ launcherPid: ownership.leaderPid,
673
+ processGroupId: ownership.processGroupId,
674
+ reason
675
+ });
676
+ parseProcessEnvironment = (value) => Object.fromEntries(value.split("\0").filter((entry) => entry.indexOf("=") > 0).map((entry) => {
677
+ const separator = entry.indexOf("=");
678
+ return [entry.slice(0, separator), entry.slice(separator + 1)];
679
+ }));
680
+ parseLinuxProcessStartTime = (value) => {
681
+ const commandEnd = value.lastIndexOf(")");
682
+ if (commandEnd < 0) return undefined;
683
+ const fields = value.slice(commandEnd + 1).trim().split(/\s+/u);
684
+ const startTime = fields[19];
685
+ return startTime !== undefined && /^\d+$/u.test(startTime) ? startTime : undefined;
686
+ };
687
+ isExpectedAbort = (cause, signal) => signal?.aborted === true && (cause === signal.reason || cause instanceof Error && cause.name === "AbortError");
688
+ createSystemProcessOwnershipHost = (platform = process.platform, hostEnvironment = process.env, options = {}) => {
689
+ const darwinTokens = platform === "darwin" ? createDarwinProcessRunTokenReader(options.darwinXcrun === undefined ? {} : { xcrun: options.darwinXcrun }) : undefined;
690
+ const listProcesses = async (signal) => {
691
+ if (platform === "win32") return [];
692
+ const { stdout } = await execFileOutput("ps", ["-axo", "pid=,ppid=,pgid=,uid=,stat=,command="], {
693
+ env: hostEnvironment,
694
+ ...signal === undefined ? {} : { signal }
695
+ });
696
+ return stdout.split("\n").map((line) => /\s*(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\S+)\s+(.*)/u.exec(line)).filter((match) => match !== null).map((match) => ({
697
+ pid: Number(match[1]),
698
+ parentPid: Number(match[2]),
699
+ processGroupId: Number(match[3]),
700
+ uid: Number(match[4]),
701
+ state: match[5] ?? "",
702
+ command: match[6] ?? ""
703
+ }));
704
+ };
705
+ const processIdentities = async (processes, signal) => {
706
+ if (processes.length === 0) return new Map();
707
+ if (platform === "linux") return new Map(await Promise.all(processes.map(async ({ pid }) => {
708
+ try {
709
+ const stat = await readFile(`/proc/${String(pid)}/stat`, {
710
+ encoding: "utf8",
711
+ ...signal === undefined ? {} : { signal }
712
+ });
713
+ const identity = parseLinuxProcessStartTime(stat);
714
+ return [pid, identity === undefined ? {
715
+ state: "unavailable",
716
+ reason: "malformed_proc_stat"
717
+ } : {
718
+ state: "readable",
719
+ identity: `linux-starttime:${identity}`
720
+ }];
721
+ } catch (cause) {
722
+ if (isExpectedAbort(cause, signal)) throw cause;
723
+ return [pid, {
724
+ state: "unavailable",
725
+ reason: errorMessage(cause)
726
+ }];
727
+ }
728
+ })));
729
+ if (darwinTokens === undefined) return new Map();
730
+ try {
731
+ return await darwinTokens.identities(processes, signal);
732
+ } catch (cause) {
733
+ if (isExpectedAbort(cause, signal)) throw cause;
734
+ const reason = errorMessage(cause);
735
+ return new Map(processes.map(({ pid }) => [pid, {
736
+ state: "unavailable",
737
+ reason
738
+ }]));
739
+ }
740
+ };
741
+ const captureBaseline = async (signal) => {
742
+ if (platform !== "linux" && darwinTokens === undefined) return [];
743
+ const processes = liveProcesses(await listProcesses(signal));
744
+ let identities = await processIdentities(processes, signal);
745
+ const unreadable = processes.filter(({ pid }) => identities.get(pid)?.state !== "readable");
746
+ if (unreadable.length > 0) {
747
+ const stillLive = liveProcesses(await listProcesses(signal)).filter(({ pid }) => unreadable.some((entry) => entry.pid === pid));
748
+ const retried = await processIdentities(stillLive, signal);
749
+ identities = new Map([...identities, ...retried]);
750
+ const unresolved = stillLive.filter(({ pid }) => identities.get(pid)?.state !== "readable");
751
+ const liveAfterRetry = liveProcesses(await listProcesses(signal));
752
+ const stillUnresolved = unresolved.filter(({ pid }) => liveAfterRetry.some((entry) => entry.pid === pid));
753
+ if (stillUnresolved.length > 0) throw new Error(`process identity snapshot is unavailable for ${String(stillUnresolved.length)} live processes`);
754
+ }
755
+ return processes.map(({ pid }) => {
756
+ const observation = identities.get(pid);
757
+ return {
758
+ pid,
759
+ identity: observation?.state === "readable" ? observation.identity : null
760
+ };
761
+ });
762
+ };
763
+ return {
764
+ platform,
765
+ prepare: async (signal) => {
766
+ await darwinTokens?.prepare(signal);
767
+ if (platform === "linux") {
768
+ try {
769
+ const processes = await listProcesses(signal);
770
+ if (!processes.some(({ pid }) => pid === process.pid)) throw new Error("ps did not report REA's current process");
771
+ } catch (cause) {
772
+ if (isExpectedAbort(cause, signal)) throw cause;
773
+ const reason = `Linux process ownership inspection requires a procps-compatible ps on REA's PATH before launching a child: ${errorMessage(cause)}`;
774
+ throw new AnalysisCapabilityUnavailableError("process-ownership", "prepare_owned_process", reason, {
775
+ cause,
776
+ userMessage: reason
777
+ });
778
+ }
779
+ }
780
+ },
781
+ listProcesses,
782
+ async environment(pid, signal) {
783
+ signal?.throwIfAborted();
784
+ if (platform === "linux") return parseProcessEnvironment(await readFile(`/proc/${pid}/environ`, {
785
+ encoding: "utf8",
786
+ signal
787
+ }));
788
+ if (platform === "darwin") {
789
+ const process = (await listProcesses(signal)).find((entry) => entry.pid === pid);
790
+ if (process === undefined) throw new Error(`process ${String(pid)} is not live`);
791
+ const observation = (await darwinTokens?.read([process], signal))?.get(pid);
792
+ if (observation === undefined || observation.state === "unavailable") throw new Error(observation?.reason ?? "process run token could not be read");
793
+ return observation.runId === undefined ? {} : { REA_PROCESS_RUN_ID: observation.runId };
794
+ }
795
+ const { stdout } = await execFileOutput("ps", [
796
+ "eww",
797
+ "-p",
798
+ String(pid)
799
+ ], {
800
+ env: hostEnvironment,
801
+ ...signal === undefined ? {} : { signal }
802
+ });
803
+ const observedEnvironment = {};
804
+ for (const match of stdout.matchAll(/(?:^|\s)([A-Za-z_][A-Za-z0-9_]*)=([^\s]*)/gu)) {
805
+ const name = match[1];
806
+ if (name !== undefined) observedEnvironment[name] = match[2] ?? "";
807
+ }
808
+ return observedEnvironment;
809
+ },
810
+ async runTokens(processes, signal) {
811
+ signal?.throwIfAborted();
812
+ if (platform !== "darwin" || processes.length === 0) return new Map();
813
+ try {
814
+ return await darwinTokens?.read(processes, signal) ?? new Map();
815
+ } catch (cause) {
816
+ if (isExpectedAbort(cause, signal)) throw cause;
817
+ void cause;
818
+ return new Map(processes.map(({ pid }) => [pid, {
819
+ state: "unavailable",
820
+ reason: "reader_failure"
821
+ }]));
822
+ }
823
+ },
824
+ ...platform !== "linux" && darwinTokens === undefined ? {} : {
825
+ processIdentities,
826
+ captureBaseline,
827
+ ...darwinTokens === undefined ? {} : { close: darwinTokens.close }
828
+ },
829
+ signalGroup(processGroupId, signal) {
830
+ process.kill(-processGroupId, signal);
831
+ }
832
+ };
833
+ };
834
+ systemProcessOwnershipHost = createSystemProcessOwnershipHost();
835
+ observeProcessStartIdentity = async (pid, host = systemProcessOwnershipHost, expectedRunId) => {
836
+ const process = (await host.listProcesses()).find((entry) => entry.pid === pid);
837
+ if (process === undefined || liveProcesses([process]).length === 0) return undefined;
838
+ if (host.processIdentities === undefined) return {
839
+ state: "unavailable",
840
+ reason: "process identity is unsupported"
841
+ };
842
+ const identity = (await host.processIdentities([process])).get(pid) ?? {
843
+ state: "unavailable",
844
+ reason: "process identity was not returned"
845
+ };
846
+ if (expectedRunId === undefined || identity.state !== "readable") return identity;
847
+ let owned = false;
848
+ for await (const { observation } of readProcessRunTokens(host, [process])) {
849
+ if (observation.state === "unavailable") return {
850
+ state: "unavailable",
851
+ reason: `process ownership token could not be read for PID ${String(pid)}: ${observation.reason}`
852
+ };
853
+ if (observation.runId !== expectedRunId) return {
854
+ state: "unavailable",
855
+ reason: `process ownership token did not match the captured run for PID ${String(pid)}`
856
+ };
857
+ owned = true;
858
+ }
859
+ if (!owned) return {
860
+ state: "unavailable",
861
+ reason: `process ownership token was not returned for PID ${String(pid)}`
862
+ };
863
+ const confirmed = await observeProcessStartIdentity(pid, host);
864
+ if (confirmed === undefined || confirmed.state !== "readable") return confirmed;
865
+ return confirmed.identity === identity.identity ? identity : {
866
+ state: "unavailable",
867
+ reason: `process identity changed while validating the captured run token for PID ${String(pid)}`
868
+ };
869
+ };
870
+ signalProcessWithStartIdentity = async (pid, expectedIdentity, signal, options = {}) => {
871
+ const host = options.host ?? systemProcessOwnershipHost;
872
+ try {
873
+ const observed = await observeProcessStartIdentity(pid, host);
874
+ if (observed === undefined) return "gone";
875
+ if (observed.state !== "readable") return "unverified";
876
+ if (observed.identity !== expectedIdentity) return "identity-changed";
877
+ (options.sendSignal ?? process.kill)(pid, signal);
878
+ return "signaled";
879
+ } catch {
880
+ return "unverified";
881
+ }
882
+ };
883
+ prepareProcessOwnershipInspection = async (signal) => {
884
+ await systemProcessOwnershipHost.prepare?.(signal);
885
+ };
886
+ processIsGone = async (host, pid) => {
887
+ try {
888
+ return !liveProcesses(await host.listProcesses()).some((process) => process.pid === pid);
889
+ } catch (cause) {
890
+ void cause;
891
+ return false;
892
+ }
893
+ };
894
+ errorMessage = (cause) => cause instanceof Error ? cause.message : String(cause);
895
+ })))();
896
+ }
897
+
898
+ //#endregion
899
+ //#region dist/process/ProcessOwnership.js
900
+ var execFileAsync, cleanupWindowsProcessTree, systemWindowsProcessTreeHost, readProcessRunId, cleanupOwnedProcessGroup, verifyNoTokenOwnedProcesses, readLiveProcessTable, settleLauncherExit, createOwnedCleanupPlan, revalidateOwnedProcessGroup, cleanupValidationFailure, sanitizedTokenReadFailure, processOwnershipFailures, processRunTokenFailures, recheckOwnershipFailures, TOKEN_READ_RETRY_ATTEMPTS, TOKEN_READ_RETRY_DELAY_MS, PLATFORM_BINARY_ENVIRONMENT_WITHHELD, RESTRICTED_PROCESS_ENVIRONMENT_WITHHELD, currentProcessUid, environmentWithheldFromInspection, scanTokenOwnedProcesses, settleUnreadableTokenCandidates;
901
+ function init_ProcessOwnership() {
902
+ return (init_ProcessOwnership = __esmMin((() => {
903
+ init_ProcessOwnershipObservation();
904
+ init_ProcessOwnershipIdentity();
905
+ init_ProcessOwnershipProcessTree();
906
+ init_ProcessRunTokenObservations();
907
+ init_unicodeCodePointOrder();
908
+ execFileAsync = promisify(execFile);
909
+ cleanupWindowsProcessTree = async (rootPid, host = systemWindowsProcessTreeHost) => {
910
+ if (!Number.isSafeInteger(rootPid) || rootPid <= 0) return {
911
+ cleaned: false,
912
+ reason: "Windows process-tree PID is invalid"
913
+ };
914
+ try {
915
+ const result = await host.terminateTree(rootPid);
916
+ return {
917
+ cleaned: true,
918
+ signaled: result === "terminated"
919
+ };
920
+ } catch (cause) {
921
+ return {
922
+ cleaned: false,
923
+ reason: `Windows process-tree termination failed for PID ${String(rootPid)}: ${errorMessage(cause)}`
924
+ };
925
+ }
926
+ };
927
+ systemWindowsProcessTreeHost = { async terminateTree(rootPid) {
928
+ try {
929
+ await execFileAsync("taskkill.exe", [
930
+ "/pid",
931
+ String(rootPid),
932
+ "/t",
933
+ "/f"
934
+ ], {
935
+ windowsHide: true,
936
+ timeout: 5e3
937
+ });
938
+ return "terminated";
939
+ } catch (cause) {
940
+ if (cause instanceof Error && "code" in cause && (cause.code === 128 || cause.code === "ESRCH")) return "missing";
941
+ throw cause;
942
+ }
943
+ } };
944
+ readProcessRunId = async (pid, host = systemProcessOwnershipHost, signal) => (await host.environment(pid, signal)).REA_PROCESS_RUN_ID;
945
+ cleanupOwnedProcessGroup = async (ownership, host = systemProcessOwnershipHost) => {
946
+ const processTable = await readLiveProcessTable(host);
947
+ if (!processTable.available) return {
948
+ cleaned: false,
949
+ reason: `process table could not be inspected: ${processTable.reason}`
950
+ };
951
+ const plan = await createOwnedCleanupPlan(ownership, processTable.processes, host);
952
+ if ("cleaned" in plan) return plan;
953
+ let signaled = false;
954
+ for (const processGroupId of plan.signalOrder) {
955
+ const revalidation = await revalidateOwnedProcessGroup(processGroupId, ownership, host, plan.tokenOwnedIdentities);
956
+ if ("cleaned" in revalidation) return revalidation;
957
+ if (revalidation.empty) continue;
958
+ try {
959
+ host.signalGroup(processGroupId, "SIGKILL");
960
+ signaled = true;
961
+ } catch (cause) {
962
+ const code = cause instanceof Error && "code" in cause ? cause.code : undefined;
963
+ if (code !== "ESRCH") return {
964
+ cleaned: false,
965
+ reason: `owned process group signal failed: ${errorMessage(cause)}`
966
+ };
967
+ }
968
+ }
969
+ if (plan.unresolved.length > 0) return cleanupValidationFailure(plan.unresolved, plan.unverified);
970
+ return {
971
+ cleaned: true,
972
+ signaled,
973
+ ...plan.unverified.length === 0 ? {} : { unverified: plan.unverified }
974
+ };
975
+ };
976
+ verifyNoTokenOwnedProcesses = async (runId, host = systemProcessOwnershipHost, captureBaseline, relation) => {
977
+ const processTable = await readLiveProcessTable(host);
978
+ if (!processTable.available) return {
979
+ cleaned: false,
980
+ reason: `process table could not be inspected: ${processTable.reason}`
981
+ };
982
+ const scan = await scanTokenOwnedProcesses(processTable.processes, runId, host, captureBaseline, relation);
983
+ if (scan.failures.length > 0) return cleanupValidationFailure(scan.failures, scan.unverified);
984
+ if (scan.owned.length > 0) return {
985
+ cleaned: false,
986
+ reason: "token-owned process remained after cleanup",
987
+ ...scan.unverified.length === 0 ? {} : { unverified: scan.unverified }
988
+ };
989
+ return {
990
+ cleaned: true,
991
+ signaled: false,
992
+ ...scan.unverified.length === 0 ? {} : { unverified: scan.unverified }
993
+ };
994
+ };
995
+ readLiveProcessTable = async (host) => {
996
+ try {
997
+ return {
998
+ available: true,
999
+ processes: liveProcesses(await host.listProcesses())
1000
+ };
1001
+ } catch (cause) {
1002
+ return {
1003
+ available: false,
1004
+ reason: errorMessage(cause)
1005
+ };
1006
+ }
1007
+ };
1008
+ settleLauncherExit = async (ownership, processes, host) => {
1009
+ const launcher = processes.find(({ pid }) => pid === ownership.leaderPid);
1010
+ if (launcher === undefined) return processes;
1011
+ const reason = launcherIdentityFailure(launcher, ownership);
1012
+ if (reason === null) return processes;
1013
+ const refreshed = await readLiveProcessTable(host);
1014
+ if (refreshed.available && !refreshed.processes.some(({ pid }) => pid === launcher.pid)) {
1015
+ const descendants = descendantsOf([launcher.pid], processes);
1016
+ const descendantPids = new Set(descendants.map(({ pid }) => pid));
1017
+ const descendantGroupIds = new Set(descendants.map(({ processGroupId }) => processGroupId));
1018
+ const refreshedDescendantPids = new Set(descendantsOf(descendants.map(({ pid }) => pid), refreshed.processes).map(({ pid }) => pid));
1019
+ if (refreshed.processes.some((process) => process.processGroupId !== ownership.processGroupId && (refreshedDescendantPids.has(process.pid) || descendantPids.has(process.pid) || descendantGroupIds.has(process.processGroupId)))) return {
1020
+ cleaned: false,
1021
+ reason
1022
+ };
1023
+ return refreshed.processes;
1024
+ }
1025
+ return {
1026
+ cleaned: false,
1027
+ reason
1028
+ };
1029
+ };
1030
+ createOwnedCleanupPlan = async (ownership, initialProcesses, host) => {
1031
+ const processes = await settleLauncherExit(ownership, initialProcesses, host);
1032
+ if ("cleaned" in processes) return processes;
1033
+ const sampledProcessGroupIds = new Set((ownership.sampledProcessGroupIds ?? []).filter((processGroupId) => Number.isSafeInteger(processGroupId) && processGroupId > 0));
1034
+ const tokenOwned = ownership.sweepTokenOwnedProcesses === true ? await scanTokenOwnedProcesses(processes, ownership.runId, host, ownership.captureBaseline, {
1035
+ leaderPid: ownership.leaderPid,
1036
+ processGroupId: ownership.processGroupId,
1037
+ ...sampledProcessGroupIds.size === 0 ? {} : { sampledProcessGroupIds: [...sampledProcessGroupIds] }
1038
+ }) : {
1039
+ owned: [],
1040
+ failures: [],
1041
+ unverified: [],
1042
+ identities: new Map()
1043
+ };
1044
+ const tokenOwnedGroupIds = new Set(tokenOwned.owned.map(({ processGroupId }) => processGroupId));
1045
+ const launcher = processes.find(({ pid }) => pid === ownership.leaderPid);
1046
+ const rootMembers = processes.filter(({ processGroupId }) => processGroupId === ownership.processGroupId);
1047
+ if (launcher === undefined && rootMembers.length === 0 && tokenOwned.owned.length === 0 && !processes.some(({ processGroupId }) => sampledProcessGroupIds.has(processGroupId))) return tokenOwned.failures.length > 0 ? {
1048
+ signalOrder: [],
1049
+ tokenOwnedIdentities: tokenOwned.identities,
1050
+ unresolved: tokenOwned.failures,
1051
+ unverified: tokenOwned.unverified
1052
+ } : {
1053
+ cleaned: true,
1054
+ signaled: false,
1055
+ ...tokenOwned.unverified.length === 0 ? {} : { unverified: tokenOwned.unverified }
1056
+ };
1057
+ let descendants = [];
1058
+ if (launcher !== undefined) {
1059
+ descendants = descendantsOf([launcher.pid], processes);
1060
+ }
1061
+ const descendantPids = new Set(descendants.map(({ pid }) => pid));
1062
+ const processGroupIds = new Set([ownership.processGroupId]);
1063
+ for (const descendant of descendants) processGroupIds.add(descendant.processGroupId);
1064
+ for (const process of tokenOwned.owned) processGroupIds.add(process.processGroupId);
1065
+ for (const processGroupId of sampledProcessGroupIds) processGroupIds.add(processGroupId);
1066
+ const signalableGroups = new Set();
1067
+ const unresolved = [...tokenOwned.failures];
1068
+ const unverifiableSampledGroups = new Set();
1069
+ for (const processGroupId of processGroupIds) {
1070
+ if (processGroupId === ownership.processGroupId) continue;
1071
+ const groupLeader = processes.find(({ pid, processGroupId: observedGroupId }) => pid === processGroupId && observedGroupId === processGroupId);
1072
+ if ((groupLeader === undefined || !descendantPids.has(groupLeader.pid)) && !tokenOwnedGroupIds.has(processGroupId) && !sampledProcessGroupIds.has(processGroupId)) return {
1073
+ cleaned: false,
1074
+ reason: "descendant process-group leader identity could not be verified"
1075
+ };
1076
+ if ((groupLeader === undefined || !descendantPids.has(groupLeader.pid)) && !tokenOwnedGroupIds.has(processGroupId)) unverifiableSampledGroups.add(processGroupId);
1077
+ }
1078
+ const liveMembers = processes.filter(({ processGroupId }) => processGroupIds.has(processGroupId));
1079
+ for (const processGroupId of processGroupIds) {
1080
+ const members = liveMembers.filter(({ processGroupId: observedGroupId }) => observedGroupId === processGroupId);
1081
+ if (members.length === 0) continue;
1082
+ const failures = await processOwnershipFailures(members, ownership.runId, host, tokenOwned.identities);
1083
+ if (failures.length === 0 && unverifiableSampledGroups.has(processGroupId)) unresolved.push(...members.map(({ pid }) => ({
1084
+ pid,
1085
+ reason: "process-identity-unavailable",
1086
+ diagnostic: "sampled process-group leader identity could not be verified"
1087
+ })));
1088
+ const scanFailures = tokenOwned.failures.filter(({ pid }) => members.some((member) => member.pid === pid));
1089
+ if (failures.length > 0) unresolved.push(...failures);
1090
+ if (failures.length === 0 && scanFailures.length === 0 && !unverifiableSampledGroups.has(processGroupId)) signalableGroups.add(processGroupId);
1091
+ }
1092
+ if (ownership.sweepTokenOwnedProcesses !== true && unresolved.length > 0) return cleanupValidationFailure(unresolved, tokenOwned.unverified);
1093
+ return {
1094
+ signalOrder: [...signalableGroups].filter((groupId) => processGroupIds.has(groupId)).sort((left, right) => left === ownership.processGroupId ? -1 : right === ownership.processGroupId ? 1 : left - right),
1095
+ tokenOwnedIdentities: tokenOwned.identities,
1096
+ unresolved,
1097
+ unverified: tokenOwned.unverified
1098
+ };
1099
+ };
1100
+ revalidateOwnedProcessGroup = async (processGroupId, ownership, host, expectedIdentities) => {
1101
+ let members;
1102
+ try {
1103
+ const processes = await settleLauncherExit(ownership, liveProcesses(await host.listProcesses()), host);
1104
+ if ("cleaned" in processes) return processes;
1105
+ members = processes.filter(({ processGroupId: observedGroupId }) => observedGroupId === processGroupId);
1106
+ } catch (cause) {
1107
+ return {
1108
+ cleaned: false,
1109
+ reason: `process ownership could not be revalidated: ${errorMessage(cause)}`
1110
+ };
1111
+ }
1112
+ const failures = await processOwnershipFailures(members, ownership.runId, host, expectedIdentities);
1113
+ if (failures.length > 0) return cleanupValidationFailure(failures);
1114
+ if (processGroupId !== ownership.processGroupId && members.length > 0 && !members.some(({ pid }) => pid === processGroupId) && ownership.sweepTokenOwnedProcesses !== true) return {
1115
+ cleaned: false,
1116
+ reason: "descendant process-group leader identity could not be revalidated"
1117
+ };
1118
+ return { empty: members.length === 0 };
1119
+ };
1120
+ cleanupValidationFailure = (failures, unverified = []) => {
1121
+ const unverifiedEntry = unverified.length === 0 ? {} : { unverified };
1122
+ const unreadable = failures.filter(({ reason }) => reason === "environment-unreadable");
1123
+ if (failures.some(({ reason }) => reason === "run-token-mismatch")) return {
1124
+ cleaned: false,
1125
+ reason: `process ownership token mismatch for PID(s): ${[...new Set(failures.filter(({ reason }) => reason === "run-token-mismatch").map(({ pid }) => pid))].sort((left, right) => left - right).join(", ")}`,
1126
+ failures,
1127
+ ...unverifiedEntry
1128
+ };
1129
+ if (failures.some(({ reason }) => reason === "process-identity-unavailable")) return {
1130
+ cleaned: false,
1131
+ reason: "process identity could not be revalidated",
1132
+ failures,
1133
+ ...unverifiedEntry
1134
+ };
1135
+ if (unreadable.length > 0) {
1136
+ const counts = new Map();
1137
+ for (const { diagnostic } of unreadable) {
1138
+ const category = sanitizedTokenReadFailure(diagnostic);
1139
+ counts.set(category, (counts.get(category) ?? 0) + 1);
1140
+ }
1141
+ const breakdown = [...counts].sort(([left], [right]) => compareUnicodeCodePoints(left, right)).map(([category, count]) => `${category}=${String(count)}`).join(", ");
1142
+ const candidates = unreadable.map(({ pid, diagnostic }) => `${String(pid)}=${sanitizedTokenReadFailure(diagnostic)}`).sort((left, right) => compareUnicodeCodePoints(left, right));
1143
+ return {
1144
+ cleaned: false,
1145
+ reason: `process ownership token could not be read for ${String(unreadable.length)} live process(es): ${breakdown}; live candidates ${candidates.join(", ")}`,
1146
+ failures,
1147
+ ...unverifiedEntry
1148
+ };
1149
+ }
1150
+ return {
1151
+ cleaned: false,
1152
+ reason: "process ownership could not be revalidated",
1153
+ failures,
1154
+ ...unverifiedEntry
1155
+ };
1156
+ };
1157
+ sanitizedTokenReadFailure = (diagnostic) => {
1158
+ if (diagnostic === "environment_unavailable") return diagnostic;
1159
+ if (diagnostic === "platform_binary_environment_withheld") return diagnostic;
1160
+ if (diagnostic === "restricted_process_environment_withheld") return diagnostic;
1161
+ const environmentErrno = /^(EACCES|EPERM|ENOENT|ESRCH):/u.exec(diagnostic ?? "");
1162
+ if (environmentErrno?.[1] !== undefined) return `environment_errno_${environmentErrno[1]}`;
1163
+ if (diagnostic === "apple_vector_unavailable") return diagnostic;
1164
+ if (diagnostic === "ambiguous_environment_boundary") return diagnostic;
1165
+ if (diagnostic === "malformed_procargs") return diagnostic;
1166
+ if (diagnostic === "process_identity_changed_during_token_read") return diagnostic;
1167
+ if (diagnostic === "process_not_in_snapshot") return diagnostic;
1168
+ const processTableFailure = /^process_table_failed_(\d+)$/u.exec(diagnostic ?? "");
1169
+ if (processTableFailure?.[1] !== undefined) return `process_table_errno_${processTableFailure[1]}`;
1170
+ const sysctlFailure = /^sysctl_failed_(\d+)$/u.exec(diagnostic ?? "");
1171
+ if (sysctlFailure?.[1] !== undefined) return `sysctl_errno_${sysctlFailure[1]}`;
1172
+ if (diagnostic === "reader_failure") return diagnostic;
1173
+ if (diagnostic === "duplicate_run_token") return diagnostic;
1174
+ if (diagnostic === "invalid_run_token_encoding") return diagnostic;
1175
+ return "other_unavailable";
1176
+ };
1177
+ processOwnershipFailures = async (members, runId, host, expectedIdentities = new Map()) => {
1178
+ const failures = [];
1179
+ if (expectedIdentities.size > 0 && host.processIdentities !== undefined) {
1180
+ const expectedMembers = members.filter(({ pid }) => expectedIdentities.has(pid));
1181
+ const observed = await host.processIdentities(expectedMembers);
1182
+ const identityFailures = [];
1183
+ for (const member of expectedMembers) {
1184
+ const expected = expectedIdentities.get(member.pid);
1185
+ const current = observed.get(member.pid);
1186
+ if (expected === null || current?.state !== "readable" || current.identity !== expected) {
1187
+ identityFailures.push({
1188
+ pid: member.pid,
1189
+ reason: "process-identity-unavailable",
1190
+ diagnostic: "process identity changed or became unavailable before signal"
1191
+ });
1192
+ }
1193
+ }
1194
+ failures.push(...await recheckOwnershipFailures(identityFailures, host));
1195
+ }
1196
+ failures.push(...await processRunTokenFailures(members, runId, host));
1197
+ if (failures.length === 0 && expectedIdentities.size > 0 && host.processIdentities !== undefined) {
1198
+ const expectedMembers = members.filter(({ pid }) => expectedIdentities.has(pid));
1199
+ const observed = await host.processIdentities(expectedMembers);
1200
+ const identityFailures = [];
1201
+ for (const member of expectedMembers) {
1202
+ const expected = expectedIdentities.get(member.pid);
1203
+ const current = observed.get(member.pid);
1204
+ if (expected !== null && current?.state === "readable" && current.identity === expected) continue;
1205
+ identityFailures.push({
1206
+ pid: member.pid,
1207
+ reason: "process-identity-unavailable",
1208
+ diagnostic: "process identity changed or became unavailable during token validation"
1209
+ });
1210
+ }
1211
+ failures.push(...await recheckOwnershipFailures(identityFailures, host));
1212
+ }
1213
+ return failures;
1214
+ };
1215
+ processRunTokenFailures = async (members, runId, host) => {
1216
+ const failures = [];
1217
+ for await (const { process: member, observation } of readProcessRunTokens(host, members)) {
1218
+ if (observation.state === "readable") {
1219
+ if (observation.runId !== runId) failures.push({
1220
+ pid: member.pid,
1221
+ reason: "run-token-mismatch"
1222
+ });
1223
+ continue;
1224
+ }
1225
+ failures.push({
1226
+ pid: member.pid,
1227
+ reason: "environment-unreadable",
1228
+ diagnostic: observation.reason
1229
+ });
1230
+ }
1231
+ return recheckOwnershipFailures(failures, host);
1232
+ };
1233
+ recheckOwnershipFailures = async (failures, host) => {
1234
+ if (!failures.some(({ reason }) => reason !== "run-token-mismatch")) return failures;
1235
+ try {
1236
+ const live = new Set(liveProcesses(await host.listProcesses()).map(({ pid }) => pid));
1237
+ return failures.filter(({ pid, reason }) => reason === "run-token-mismatch" || live.has(pid));
1238
+ } catch (cause) {
1239
+ return failures.map((failure) => failure.reason === "run-token-mismatch" ? failure : {
1240
+ ...failure,
1241
+ diagnostic: `${failure.diagnostic}; process liveness recheck failed: ${errorMessage(cause)}`
1242
+ });
1243
+ }
1244
+ };
1245
+ TOKEN_READ_RETRY_ATTEMPTS = 3;
1246
+ TOKEN_READ_RETRY_DELAY_MS = 40;
1247
+ PLATFORM_BINARY_ENVIRONMENT_WITHHELD = "platform_binary_environment_withheld";
1248
+ RESTRICTED_PROCESS_ENVIRONMENT_WITHHELD = "restricted_process_environment_withheld";
1249
+ currentProcessUid = () => typeof process.getuid === "function" ? process.getuid() : undefined;
1250
+ environmentWithheldFromInspection = (entry, diagnostic) => {
1251
+ const uid = currentProcessUid();
1252
+ if (uid !== undefined && entry.uid !== undefined && entry.uid !== uid) return true;
1253
+ return diagnostic === PLATFORM_BINARY_ENVIRONMENT_WITHHELD || diagnostic === RESTRICTED_PROCESS_ENVIRONMENT_WITHHELD;
1254
+ };
1255
+ scanTokenOwnedProcesses = async (processes, runId, host, captureBaseline, relation) => {
1256
+ let candidates = processes;
1257
+ let candidateIdentities = new Map();
1258
+ if (host.processIdentities !== undefined) {
1259
+ const current = await host.processIdentities(processes);
1260
+ candidateIdentities = current;
1261
+ if (captureBaseline !== undefined) {
1262
+ const baseline = new Map(captureBaseline.map(({ pid, identity }) => [pid, identity]));
1263
+ candidates = processes.filter((process) => {
1264
+ const before = baseline.get(process.pid);
1265
+ const now = current.get(process.pid);
1266
+ return !(before !== undefined && before !== null && now?.state === "readable" && now.identity === before);
1267
+ });
1268
+ }
1269
+ }
1270
+ const failures = [];
1271
+ if (captureBaseline !== undefined && host.processIdentities !== undefined) {
1272
+ const stableCandidates = [];
1273
+ const identityFailures = [];
1274
+ for (const process of candidates) {
1275
+ if (candidateIdentities.get(process.pid)?.state === "readable") {
1276
+ stableCandidates.push(process);
1277
+ continue;
1278
+ }
1279
+ identityFailures.push({
1280
+ pid: process.pid,
1281
+ reason: "process-identity-unavailable",
1282
+ diagnostic: "process identity was unavailable during token scan"
1283
+ });
1284
+ }
1285
+ failures.push(...await recheckOwnershipFailures(identityFailures, host));
1286
+ candidates = stableCandidates;
1287
+ }
1288
+ const owned = [];
1289
+ const ownedIdentities = new Map();
1290
+ const recordOwned = (process) => {
1291
+ owned.push(process);
1292
+ const identity = candidateIdentities.get(process.pid);
1293
+ ownedIdentities.set(process.pid, identity?.state === "readable" ? identity.identity : null);
1294
+ };
1295
+ const unreadable = [];
1296
+ for await (const { process, observation } of readProcessRunTokens(host, candidates)) {
1297
+ if (observation.state === "readable") {
1298
+ if (observation.runId === runId) recordOwned(process);
1299
+ } else unreadable.push({
1300
+ process,
1301
+ diagnostic: observation.reason
1302
+ });
1303
+ }
1304
+ const remaining = await settleUnreadableTokenCandidates(unreadable, runId, host, recordOwned);
1305
+ const relatedPids = new Set();
1306
+ const relatedGroupIds = new Set();
1307
+ if (relation !== undefined) {
1308
+ relatedPids.add(relation.leaderPid);
1309
+ for (const descendant of descendantsOf([relation.leaderPid], processes)) relatedPids.add(descendant.pid);
1310
+ relatedGroupIds.add(relation.processGroupId);
1311
+ for (const processGroupId of relation.sampledProcessGroupIds ?? []) if (Number.isSafeInteger(processGroupId) && processGroupId > 0) relatedGroupIds.add(processGroupId);
1312
+ for (const process of owned) relatedGroupIds.add(process.processGroupId);
1313
+ }
1314
+ const unverified = [];
1315
+ const strict = [];
1316
+ const withheld = [];
1317
+ for (const candidate of remaining) {
1318
+ const isRelated = relation === undefined || relatedPids.has(candidate.process.pid) || relatedGroupIds.has(candidate.process.processGroupId);
1319
+ if (!isRelated && environmentWithheldFromInspection(candidate.process, candidate.diagnostic)) {
1320
+ withheld.push(candidate);
1321
+ continue;
1322
+ }
1323
+ strict.push(candidate);
1324
+ }
1325
+ let finalLive;
1326
+ try {
1327
+ finalLive = new Set(liveProcesses(await host.listProcesses()).map(({ pid }) => pid));
1328
+ } catch (cause) {
1329
+ void cause;
1330
+ finalLive = undefined;
1331
+ }
1332
+ for (const candidate of strict) {
1333
+ if (finalLive !== undefined && !finalLive.has(candidate.process.pid)) continue;
1334
+ failures.push({
1335
+ pid: candidate.process.pid,
1336
+ reason: "environment-unreadable",
1337
+ diagnostic: candidate.diagnostic
1338
+ });
1339
+ }
1340
+ for (const candidate of withheld) {
1341
+ if (finalLive !== undefined && !finalLive.has(candidate.process.pid)) continue;
1342
+ unverified.push({
1343
+ pid: candidate.process.pid,
1344
+ diagnostic: candidate.diagnostic
1345
+ });
1346
+ }
1347
+ if (candidates.length > 0 && host.processIdentities !== undefined) {
1348
+ const afterRead = await host.processIdentities(candidates);
1349
+ const stillOwned = [];
1350
+ const identityFailures = [];
1351
+ const ownedPids = new Set(owned.map(({ pid }) => pid));
1352
+ for (const process of candidates) {
1353
+ const before = candidateIdentities.get(process.pid);
1354
+ const current = afterRead.get(process.pid);
1355
+ if (before?.state === "readable" && current?.state === "readable" && current.identity === before.identity) {
1356
+ if (ownedPids.has(process.pid)) stillOwned.push(process);
1357
+ continue;
1358
+ }
1359
+ identityFailures.push({
1360
+ pid: process.pid,
1361
+ reason: "process-identity-unavailable",
1362
+ diagnostic: "process identity changed or became unavailable during token validation"
1363
+ });
1364
+ }
1365
+ failures.push(...await recheckOwnershipFailures(identityFailures, host));
1366
+ return {
1367
+ owned: stillOwned,
1368
+ failures,
1369
+ unverified,
1370
+ identities: ownedIdentities
1371
+ };
1372
+ }
1373
+ return {
1374
+ owned,
1375
+ failures,
1376
+ unverified,
1377
+ identities: ownedIdentities
1378
+ };
1379
+ };
1380
+ settleUnreadableTokenCandidates = async (pending, runId, host, recordOwned) => {
1381
+ let remaining = pending;
1382
+ for (let attempt = 0; attempt < TOKEN_READ_RETRY_ATTEMPTS && remaining.length > 0; attempt += 1) {
1383
+ await new Promise((resolve) => setTimeout(resolve, TOKEN_READ_RETRY_DELAY_MS));
1384
+ let live;
1385
+ try {
1386
+ live = new Set(liveProcesses(await host.listProcesses()).map(({ pid }) => pid));
1387
+ } catch (cause) {
1388
+ void cause;
1389
+ live = undefined;
1390
+ }
1391
+ const stillUnreadable = [];
1392
+ const candidates = remaining.map(({ process }) => process).filter(({ pid }) => live === undefined || live.has(pid));
1393
+ for await (const { process, observation } of readProcessRunTokens(host, candidates)) {
1394
+ if (observation.state === "readable") {
1395
+ if (observation.runId === runId) recordOwned(process);
1396
+ continue;
1397
+ }
1398
+ stillUnreadable.push({
1399
+ process,
1400
+ diagnostic: observation.reason
1401
+ });
1402
+ }
1403
+ remaining = stillUnreadable;
1404
+ }
1405
+ return remaining;
1406
+ };
1407
+ })))();
1408
+ }
1409
+
1410
+ //#endregion
1411
+ export { selectCapturedProcessGroupIds as C, init_ProcessOwnershipProcessTree as S, init_boundedUtf8Text as _, verifyNoTokenOwnedProcesses as a, execFileOutputFailure as b, observeOwnedProcessLineage as c, signalProcessWithStartIdentity as d, systemProcessOwnershipHost as f, boundedUtf8Text as g, init_DarwinProcessRunTokenReader as h, readProcessRunId as i, observeProcessStartIdentity as l, SWIFTC_INTERRUPT as m, cleanupWindowsProcessTree as n, init_ProcessOwnershipObservation as o, DarwinProcessOwnershipInspectionError as p, init_ProcessOwnership as r, observeOwnedProcessGroups as s, cleanupOwnedProcessGroup as t, prepareProcessOwnershipInspection as u, execFileBytes as v, init_ExecFileOutput as x, execFileOutput as y };