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,1310 @@
1
+ import { __esmMin } from "./rolldown-runtime-DXoylpqc.js";
2
+ import { AnalysisCapabilityUnavailableError, init_analysisErrorCore } from "./providerOperationHealth-DSTcYPJe.js";
3
+ import { compareUnicodeCodePoints, init_unicodeCodePointOrder } from "./reconstructionObligationLedgerSchemas-dvp6PEnZ.js";
4
+ import { execFileOutput, execFileOutputFailure, init_ExecFileOutput } from "./ExecFileOutput-Czbj-HpV.js";
5
+ import { init_safeJson, safeParseJson } from "./safeJson-DKKACtdy.js";
6
+ import { basename, join } from "node:path";
7
+ import { z } from "zod";
8
+ import { mkdir, mkdtemp, readFile, rm } from "node:fs/promises";
9
+ import { rmSync } from "node:fs";
10
+ import { execFile } from "node:child_process";
11
+ import { fileURLToPath } from "node:url";
12
+ import { tmpdir } from "node:os";
13
+ import { promisify } from "node:util";
14
+
15
+ //#region dist/process/ProcessCommandIdentity.js
16
+ var matchesOwnedProcessCommand;
17
+ function init_ProcessCommandIdentity() {
18
+ return (init_ProcessCommandIdentity = __esmMin((() => {
19
+ matchesOwnedProcessCommand = (actual, expected, platform = process.platform) => {
20
+ const actualCommand = actual.trim();
21
+ const expectedCommand = expected.trim();
22
+ if (actualCommand === expectedCommand || actualCommand.startsWith(`${expectedCommand} `)) return true;
23
+ if (platform !== "darwin") return false;
24
+ const actualExecutable = actualCommand.split(/\s+/u, 1)[0];
25
+ const expectedExecutable = expectedCommand.split(/\s+/u, 1)[0];
26
+ const normalizedActualExecutable = actualExecutable?.startsWith("(") === true && actualExecutable.endsWith(")") ? actualExecutable.slice(1, -1) : actualExecutable;
27
+ return normalizedActualExecutable !== undefined && expectedExecutable !== undefined && basename(normalizedActualExecutable) === basename(expectedExecutable);
28
+ };
29
+ })))();
30
+ }
31
+
32
+ //#endregion
33
+ //#region dist/process/ProcessOwnershipIdentity.js
34
+ var launcherIdentityFailure;
35
+ function init_ProcessOwnershipIdentity() {
36
+ return (init_ProcessOwnershipIdentity = __esmMin((() => {
37
+ init_ProcessCommandIdentity();
38
+ launcherIdentityFailure = (launcher, ownership) => {
39
+ if (launcher.processGroupId !== ownership.processGroupId) return "owned launcher process-group identity did not match";
40
+ if (ownership.expectedParentPid !== undefined && launcher.parentPid !== ownership.expectedParentPid) return "owned launcher parent identity did not match";
41
+ if (ownership.expectedCommand !== undefined && !matchesOwnedProcessCommand(launcher.command, ownership.expectedCommand)) return `owned launcher command identity did not match (observed=${launcher.command}; expected=${ownership.expectedCommand})`;
42
+ return null;
43
+ };
44
+ })))();
45
+ }
46
+
47
+ //#endregion
48
+ //#region dist/process/ProcessOwnershipProcessTree.js
49
+ var liveProcesses, descendantsOf, selectCapturedProcessGroupIds;
50
+ function init_ProcessOwnershipProcessTree() {
51
+ return (init_ProcessOwnershipProcessTree = __esmMin((() => {
52
+ liveProcesses = (members) => members.filter(({ state }) => !state.startsWith("Z"));
53
+ descendantsOf = (rootPids, processes) => {
54
+ const childrenByParent = new Map();
55
+ for (const process of processes) {
56
+ const siblings = childrenByParent.get(process.parentPid) ?? [];
57
+ siblings.push(process);
58
+ childrenByParent.set(process.parentPid, siblings);
59
+ }
60
+ const descendants = [];
61
+ const pending = rootPids.flatMap((pid) => childrenByParent.get(pid) ?? []);
62
+ const visited = new Set(rootPids);
63
+ for (const process of pending) {
64
+ if (visited.has(process.pid)) continue;
65
+ visited.add(process.pid);
66
+ descendants.push(process);
67
+ pending.push(...childrenByParent.get(process.pid) ?? []);
68
+ }
69
+ return descendants;
70
+ };
71
+ selectCapturedProcessGroupIds = (rootPid, samples) => {
72
+ const processGroupIds = new Set([rootPid]);
73
+ for (const sample of samples) {
74
+ if (sample.pid === sample.process_group_id) processGroupIds.add(sample.pid);
75
+ }
76
+ return [...processGroupIds];
77
+ };
78
+ })))();
79
+ }
80
+
81
+ //#endregion
82
+ //#region dist/process/boundedUtf8Text.js
83
+ var boundedUtf8Text;
84
+ function init_boundedUtf8Text() {
85
+ return (init_boundedUtf8Text = __esmMin((() => {
86
+ boundedUtf8Text = (value, maximumBytes) => {
87
+ let bytes = 0;
88
+ let end = 0;
89
+ for (const codePoint of value) {
90
+ const codePointBytes = Buffer.byteLength(codePoint, "utf8");
91
+ if (bytes + codePointBytes > maximumBytes) return {
92
+ text: value.slice(0, end),
93
+ truncated: true
94
+ };
95
+ bytes += codePointBytes;
96
+ end += codePoint.length;
97
+ }
98
+ return {
99
+ text: value,
100
+ truncated: false
101
+ };
102
+ };
103
+ })))();
104
+ }
105
+
106
+ //#endregion
107
+ //#region dist/process/DarwinProcessRunTokenReader.js
108
+ 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;
109
+ function init_DarwinProcessRunTokenReader() {
110
+ return (init_DarwinProcessRunTokenReader = __esmMin((() => {
111
+ init_safeJson();
112
+ init_boundedUtf8Text();
113
+ init_ExecFileOutput();
114
+ responseSchema = z.strictObject({ results: z.array(z.discriminatedUnion("state", [z.strictObject({
115
+ pid: z.number().int().positive(),
116
+ state: z.literal("readable"),
117
+ run_id: z.string().optional(),
118
+ reason: z.null().optional()
119
+ }), z.strictObject({
120
+ pid: z.number().int().positive(),
121
+ state: z.literal("unavailable"),
122
+ run_id: z.union([z.string(), z.null()]).optional(),
123
+ reason: z.string().min(1)
124
+ })])) });
125
+ identityResponseSchema = z.strictObject({ results: z.array(z.discriminatedUnion("state", [z.strictObject({
126
+ pid: z.number().int().positive(),
127
+ state: z.literal("readable"),
128
+ identity: z.string().min(1),
129
+ reason: z.null().optional()
130
+ }), z.strictObject({
131
+ pid: z.number().int().positive(),
132
+ state: z.literal("unavailable"),
133
+ identity: z.null().optional(),
134
+ reason: z.string().min(1)
135
+ })])) });
136
+ 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))];
137
+ SWIFTC_INTERRUPT = "SIGINT";
138
+ COMPILER_TIMEOUT_MS = 6e4;
139
+ STDERR_EXCERPT_LIMIT = 512;
140
+ DarwinProcessOwnershipInspectionError = class extends Error {
141
+ constructor(message, options) {
142
+ const { compilerOutcome, ...errorOptions } = options ?? {};
143
+ super(message, errorOptions);
144
+ this.name = "DarwinProcessOwnershipInspectionError";
145
+ this.compilerOutcome = compilerOutcome;
146
+ }
147
+ compilerOutcome;
148
+ };
149
+ MAX_COMPILER_STDERR_BYTES = 8 * 1024;
150
+ compilerOutcome = (cause, timeoutMs) => {
151
+ const failure = execFileOutputFailure(cause);
152
+ if (failure === undefined) return undefined;
153
+ const stderr = boundedUtf8Text(failure.stderr, MAX_COMPILER_STDERR_BYTES);
154
+ const outcome = failure.code === "ETIMEDOUT" ? "timed_out" : typeof failure.code === "number" ? "exited" : failure.signal !== null ? "signaled" : failure.code === "ENOENT" ? "spawn_failed" : "failed";
155
+ return {
156
+ outcome,
157
+ code: failure.code,
158
+ signal: failure.signal,
159
+ stderr: stderr.text,
160
+ stderrBytes: Buffer.byteLength(failure.stderr, "utf8"),
161
+ stderrTruncated: stderr.truncated,
162
+ outputTruncated: failure.outputTruncated,
163
+ killed: failure.killed,
164
+ ...outcome === "timed_out" ? { timeoutMs } : {}
165
+ };
166
+ };
167
+ compilerOutcomeDescription = (outcome, fallbackCode) => {
168
+ if (outcome === undefined) return `compiler result: ${String(fallbackCode)}`;
169
+ if (outcome.outcome === "exited") return `compiler result: exit code ${String(outcome.code)}`;
170
+ if (outcome.outcome === "timed_out") return `compiler result: timed out after ${String(outcome.timeoutMs)} ms`;
171
+ if (outcome.outcome === "signaled") return `compiler result: stopped by signal ${outcome.signal ?? "an unknown signal"}`;
172
+ return `compiler result: ${String(outcome.code)}`;
173
+ };
174
+ compilerInspectionError = (cause, timeoutMs) => {
175
+ const outcome = compilerOutcome(cause, timeoutMs);
176
+ const code = outcome?.code ?? "unknown";
177
+ const description = compilerOutcomeDescription(outcome, code);
178
+ const prefix = code === "ENOENT" ? "macOS process ownership inspection requires the Apple Swift compiler via xcrun" : "macOS process ownership helper compilation failed via xcrun";
179
+ const stderr = boundedUtf8Text(outcome?.stderr ?? "", STDERR_EXCERPT_LIMIT);
180
+ const diagnostics = stderr.text.trim();
181
+ const truncated = stderr.truncated || outcome?.stderrTruncated === true || outcome?.outputTruncated === true;
182
+ const suffix = diagnostics ? `: ${diagnostics}${truncated ? "… [diagnostics truncated]" : ""}` : outcome === undefined ? `: ${cause instanceof Error ? cause.message : String(cause)}` : ": no compiler diagnostics were captured";
183
+ return new DarwinProcessOwnershipInspectionError(`${prefix} (${description})${suffix}`, {
184
+ cause,
185
+ ...outcome === undefined ? {} : { compilerOutcome: outcome }
186
+ });
187
+ };
188
+ abortReason = (signal) => {
189
+ if (signal.reason !== undefined) return signal.reason;
190
+ const error = new Error("The operation was aborted");
191
+ error.name = "AbortError";
192
+ return error;
193
+ };
194
+ isExpectedAbort$1 = (cause, signal) => signal.aborted && (cause === signal.reason || cause instanceof Error && cause.name === "AbortError");
195
+ waitForCompilation = async (promise, signal) => {
196
+ if (signal === undefined) return promise;
197
+ if (signal.aborted) throw abortReason(signal);
198
+ return new Promise((resolve, reject) => {
199
+ let completed = false;
200
+ const finish = (callback) => {
201
+ if (completed) return;
202
+ completed = true;
203
+ signal.removeEventListener("abort", onAbort);
204
+ callback();
205
+ };
206
+ const onAbort = () => finish(() => reject(abortReason(signal)));
207
+ signal.addEventListener("abort", onAbort, { once: true });
208
+ promise.then((value) => finish(() => resolve(value)), (cause) => finish(() => reject(cause)));
209
+ if (signal.aborted) onAbort();
210
+ });
211
+ };
212
+ createDarwinProcessRunTokenReader = (options = {}) => {
213
+ const compilerTimeoutMs = options.compileTimeoutMs ?? COMPILER_TIMEOUT_MS;
214
+ let root;
215
+ let executable;
216
+ let compilation;
217
+ let closePromise;
218
+ let closed = false;
219
+ let exitCleanupInstalled = false;
220
+ const cleanupAtExit = () => {
221
+ if (root !== undefined) rmSync(root, {
222
+ recursive: true,
223
+ force: true
224
+ });
225
+ };
226
+ const cleanupRoot = async (target = root) => {
227
+ if (target === undefined) return;
228
+ await rm(target, {
229
+ recursive: true,
230
+ force: true
231
+ });
232
+ if (root !== target) return;
233
+ root = undefined;
234
+ executable = undefined;
235
+ if (exitCleanupInstalled) process.removeListener("exit", cleanupAtExit);
236
+ exitCleanupInstalled = false;
237
+ };
238
+ const runCompilation = async (signal) => {
239
+ let operationRoot;
240
+ try {
241
+ operationRoot = await mkdtemp(join(tmpdir(), "rea-process-token-"));
242
+ root = operationRoot;
243
+ process.once("exit", cleanupAtExit);
244
+ exitCleanupInstalled = true;
245
+ if (signal.aborted || closed) throw abortReason(signal);
246
+ const output = join(operationRoot, "reader");
247
+ const compilerTemporary = join(operationRoot, "tmp");
248
+ await mkdir(compilerTemporary);
249
+ const compilerEnvironment = {
250
+ ...process.env,
251
+ TMPDIR: compilerTemporary
252
+ };
253
+ delete compilerEnvironment.CLANG_MODULE_CACHE_PATH;
254
+ try {
255
+ await execFileOutput(options.xcrun ?? "/usr/bin/xcrun", [
256
+ "swiftc",
257
+ ...sourceFiles,
258
+ "-o",
259
+ output
260
+ ], {
261
+ timeout: compilerTimeoutMs,
262
+ maxBuffer: 1024 * 1024,
263
+ signal,
264
+ stopSignal: SWIFTC_INTERRUPT,
265
+ env: compilerEnvironment
266
+ });
267
+ } catch (cause) {
268
+ if (isExpectedAbort$1(cause, signal)) throw cause;
269
+ throw compilerInspectionError(cause, compilerTimeoutMs);
270
+ }
271
+ if (signal.aborted || closed) throw abortReason(signal);
272
+ executable = output;
273
+ return output;
274
+ } catch (cause) {
275
+ const ownsRoot = operationRoot !== undefined && root === operationRoot;
276
+ if (operationRoot !== undefined) {
277
+ if (ownsRoot) await cleanupRoot(operationRoot);
278
+ else await rm(operationRoot, {
279
+ recursive: true,
280
+ force: true
281
+ });
282
+ }
283
+ throw cause;
284
+ }
285
+ };
286
+ const beginCompilation = () => {
287
+ const controller = new AbortController();
288
+ const operation = {
289
+ controller,
290
+ promise: runCompilation(controller.signal).finally(() => {
291
+ operation.settled = true;
292
+ if (compilation === operation) compilation = undefined;
293
+ }),
294
+ waiters: 0,
295
+ aborting: false,
296
+ settled: false
297
+ };
298
+ compilation = operation;
299
+ return operation;
300
+ };
301
+ const compile = async (signal) => {
302
+ if (closed) throw new Error("Darwin process token reader is closed");
303
+ signal?.throwIfAborted();
304
+ while (true) {
305
+ if (closed) throw new Error("Darwin process token reader is closed");
306
+ signal?.throwIfAborted();
307
+ if (executable !== undefined) return executable;
308
+ if (compilation === undefined && root !== undefined) {
309
+ await cleanupRoot();
310
+ continue;
311
+ }
312
+ let operation = compilation;
313
+ if (operation?.aborting === true) {
314
+ try {
315
+ await waitForCompilation(operation.promise, signal);
316
+ } catch (cause) {
317
+ if (signal !== undefined && isExpectedAbort$1(cause, signal)) throw cause;
318
+ }
319
+ continue;
320
+ }
321
+ operation ??= beginCompilation();
322
+ operation.waiters += 1;
323
+ try {
324
+ return await waitForCompilation(operation.promise, signal);
325
+ } finally {
326
+ operation.waiters -= 1;
327
+ if (operation.waiters === 0 && !operation.settled && !operation.aborting) {
328
+ operation.aborting = true;
329
+ operation.controller.abort();
330
+ await operation.promise.catch(() => undefined);
331
+ }
332
+ }
333
+ }
334
+ };
335
+ const read = async (processes, signal) => {
336
+ signal?.throwIfAborted();
337
+ if (processes.length === 0) return new Map();
338
+ const binary = await compile(signal);
339
+ const pids = processes.map(({ pid }) => String(pid));
340
+ const { stdout } = await execFileOutput(binary, pids, {
341
+ timeout: 15e3,
342
+ ...signal === undefined ? {} : { signal }
343
+ });
344
+ signal?.throwIfAborted();
345
+ const decoded = safeParseJson(stdout);
346
+ if (!decoded.ok) throw new Error(`macOS process token helper returned invalid JSON: ${decoded.error}`, { cause: decoded.cause });
347
+ const parsed = responseSchema.safeParse(decoded.value);
348
+ if (!parsed.success) throw new Error("macOS process token helper returned an invalid response", { cause: parsed.error });
349
+ const requested = new Set(processes.map(({ pid }) => pid));
350
+ const observations = new Map();
351
+ for (const result of parsed.data.results) {
352
+ if (!requested.has(result.pid) || observations.has(result.pid)) throw new Error("macOS process token helper returned an unexpected PID set");
353
+ observations.set(result.pid, result.state === "readable" ? {
354
+ state: "readable",
355
+ runId: result.run_id
356
+ } : {
357
+ state: "unavailable",
358
+ reason: result.reason ?? "process token observation is unavailable"
359
+ });
360
+ }
361
+ if (observations.size !== requested.size) throw new Error("macOS process token helper returned an incomplete PID set");
362
+ return observations;
363
+ };
364
+ const identities = async (processes, signal) => {
365
+ if (processes.length === 0) return new Map();
366
+ const binary = await compile(signal);
367
+ const pids = processes.map(({ pid }) => String(pid));
368
+ const { stdout } = await execFileOutput(binary, ["--identities", ...pids], {
369
+ timeout: 15e3,
370
+ ...signal === undefined ? {} : { signal }
371
+ });
372
+ const decoded = safeParseJson(stdout);
373
+ if (!decoded.ok) throw new Error(`macOS process identity helper returned invalid JSON: ${decoded.error}`, { cause: decoded.cause });
374
+ const parsed = identityResponseSchema.safeParse(decoded.value);
375
+ if (!parsed.success) throw new Error("macOS process identity helper returned an invalid response", { cause: parsed.error });
376
+ const requested = new Set(processes.map(({ pid }) => pid));
377
+ const observations = new Map();
378
+ for (const result of parsed.data.results) {
379
+ if (!requested.has(result.pid) || observations.has(result.pid)) throw new Error("macOS process identity helper returned an unexpected PID set");
380
+ observations.set(result.pid, result.state === "readable" ? {
381
+ state: "readable",
382
+ identity: result.identity
383
+ } : {
384
+ state: "unavailable",
385
+ reason: result.reason
386
+ });
387
+ }
388
+ if (observations.size !== requested.size) throw new Error("macOS process identity helper returned an incomplete PID set");
389
+ return observations;
390
+ };
391
+ const close = () => {
392
+ if (closePromise !== undefined) return closePromise;
393
+ closed = true;
394
+ const pendingClose = (async () => {
395
+ const operation = compilation;
396
+ if (operation !== undefined && !operation.settled) {
397
+ operation.aborting = true;
398
+ operation.controller.abort();
399
+ await operation.promise.catch(() => undefined);
400
+ }
401
+ await cleanupRoot();
402
+ })().catch((cause) => {
403
+ if (closePromise === pendingClose) closePromise = undefined;
404
+ throw cause;
405
+ });
406
+ closePromise = pendingClose;
407
+ return closePromise;
408
+ };
409
+ return {
410
+ read,
411
+ identities,
412
+ prepare: compile,
413
+ close
414
+ };
415
+ };
416
+ })))();
417
+ }
418
+
419
+ //#endregion
420
+ //#region dist/process/ProcessRunTokenObservations.js
421
+ /** Read only ownership tokens, using per-process fallback for missing batch rows. */
422
+ async function* readProcessRunTokens(host, processes, signal) {
423
+ signal?.throwIfAborted();
424
+ if (processes.length === 0) return;
425
+ let batch;
426
+ let batchFailure;
427
+ if (host.runTokens !== undefined) {
428
+ try {
429
+ batch = signal === undefined ? await host.runTokens(processes) : await host.runTokens(processes, signal);
430
+ } catch (cause) {
431
+ signal?.throwIfAborted();
432
+ batchFailure = errorMessage$1(cause);
433
+ }
434
+ }
435
+ for (const process of processes) {
436
+ signal?.throwIfAborted();
437
+ let observation = batch?.get(process.pid);
438
+ if (observation === undefined) {
439
+ try {
440
+ const environment = signal === undefined ? await host.environment(process.pid) : await host.environment(process.pid, signal);
441
+ observation = {
442
+ state: "readable",
443
+ runId: environment.REA_PROCESS_RUN_ID
444
+ };
445
+ } catch (cause) {
446
+ signal?.throwIfAborted();
447
+ const reason = errorMessage$1(cause);
448
+ observation = {
449
+ state: "unavailable",
450
+ reason: batchFailure === undefined ? reason : `${reason}; run-token batch failed: ${batchFailure}`
451
+ };
452
+ }
453
+ }
454
+ signal?.throwIfAborted();
455
+ yield {
456
+ process,
457
+ observation
458
+ };
459
+ }
460
+ }
461
+ var errorMessage$1;
462
+ function init_ProcessRunTokenObservations() {
463
+ return (init_ProcessRunTokenObservations = __esmMin((() => {
464
+ errorMessage$1 = (cause) => cause instanceof Error ? cause.message : String(cause);
465
+ })))();
466
+ }
467
+
468
+ //#endregion
469
+ //#region dist/process/ProcessOwnershipObservation.js
470
+ var observeOwnedProcessGroups, observeOwnedProcessLineage, unavailableLineage, parseProcessEnvironment, parseLinuxProcessStartTime, isExpectedAbort, createSystemProcessOwnershipHost, systemProcessOwnershipHost, observeProcessStartIdentity, signalProcessWithStartIdentity, prepareProcessOwnershipInspection, processIsGone, errorMessage;
471
+ function init_ProcessOwnershipObservation() {
472
+ return (init_ProcessOwnershipObservation = __esmMin((() => {
473
+ init_analysisErrorCore();
474
+ init_ProcessOwnershipIdentity();
475
+ init_ProcessOwnershipProcessTree();
476
+ init_ExecFileOutput();
477
+ init_DarwinProcessRunTokenReader();
478
+ init_ProcessRunTokenObservations();
479
+ observeOwnedProcessGroups = async (runId, processGroupIds, host = systemProcessOwnershipHost, signal) => {
480
+ signal?.throwIfAborted();
481
+ const groupIds = [...new Set(processGroupIds)];
482
+ if (groupIds.length === 0) return new Map();
483
+ let processes;
484
+ try {
485
+ processes = liveProcesses(await host.listProcesses(signal));
486
+ } catch (cause) {
487
+ signal?.throwIfAborted();
488
+ const failure = {
489
+ state: "unverifiable",
490
+ reason: `process group could not be inspected: ${errorMessage(cause)}`
491
+ };
492
+ return new Map(groupIds.map((groupId) => [groupId, failure]));
493
+ }
494
+ signal?.throwIfAborted();
495
+ const membersByGroup = new Map(groupIds.map((groupId) => [groupId, []]));
496
+ for (const process of processes) membersByGroup.get(process.processGroupId)?.push(process);
497
+ const observations = new Map(groupIds.map((groupId) => [groupId, (membersByGroup.get(groupId)?.length ?? 0) > 0 ? { state: "alive" } : { state: "empty" }]));
498
+ const liveMembers = groupIds.flatMap((groupId) => membersByGroup.get(groupId) ?? []);
499
+ const pendingGroups = new Set(groupIds.filter((groupId) => (membersByGroup.get(groupId)?.length ?? 0) > 0));
500
+ for await (const { process: member, observation } of readProcessRunTokens(host, liveMembers, signal)) {
501
+ if (!pendingGroups.has(member.processGroupId)) continue;
502
+ if (observation.state === "readable") {
503
+ if (observation.runId !== runId) {
504
+ observations.set(member.processGroupId, {
505
+ state: "unverifiable",
506
+ reason: "process ownership did not match"
507
+ });
508
+ pendingGroups.delete(member.processGroupId);
509
+ }
510
+ } else {
511
+ const gone = await processIsGone(host, member.pid);
512
+ signal?.throwIfAborted();
513
+ if (!gone) {
514
+ observations.set(member.processGroupId, {
515
+ state: "unverifiable",
516
+ reason: `process ownership could not be revalidated for PID ${member.pid}: ${observation.reason}`
517
+ });
518
+ pendingGroups.delete(member.processGroupId);
519
+ }
520
+ }
521
+ if (pendingGroups.size === 0) break;
522
+ }
523
+ signal?.throwIfAborted();
524
+ return observations;
525
+ };
526
+ observeOwnedProcessLineage = async (ownership, host = systemProcessOwnershipHost) => {
527
+ let processes;
528
+ try {
529
+ processes = liveProcesses(await host.listProcesses());
530
+ } catch (cause) {
531
+ return unavailableLineage(ownership, `process table could not be inspected: ${errorMessage(cause)}`);
532
+ }
533
+ const launcher = processes.find(({ pid }) => pid === ownership.leaderPid);
534
+ if (launcher === undefined) return unavailableLineage(ownership, "owned launcher is not live");
535
+ const identityFailure = launcherIdentityFailure(launcher, ownership);
536
+ if (identityFailure !== null) return unavailableLineage(ownership, identityFailure);
537
+ const descendants = descendantsOf([launcher.pid], processes);
538
+ const verifiedDescendants = [];
539
+ for await (const { process: member, observation } of readProcessRunTokens(host, [launcher, ...descendants])) {
540
+ if (observation.state === "readable") {
541
+ if (observation.runId !== ownership.runId) return unavailableLineage(ownership, "process lineage contains an unowned or PID-reused process");
542
+ if (member.pid !== launcher.pid) verifiedDescendants.push(member);
543
+ } else {
544
+ if (await processIsGone(host, member.pid)) {
545
+ if (member.pid === launcher.pid) return unavailableLineage(ownership, "owned launcher exited during lineage validation");
546
+ continue;
547
+ }
548
+ return unavailableLineage(ownership, `process ownership could not be revalidated for PID ${member.pid}: ${observation.reason}`);
549
+ }
550
+ }
551
+ return {
552
+ status: "verified",
553
+ observedAt: new Date().toISOString(),
554
+ lineage: {
555
+ runId: ownership.runId,
556
+ launcherPid: launcher.pid,
557
+ launcherParentPid: launcher.parentPid,
558
+ processGroupId: launcher.processGroupId,
559
+ descendants: verifiedDescendants.sort((left, right) => left.pid - right.pid).map(({ pid, parentPid, processGroupId }) => ({
560
+ pid,
561
+ parentPid,
562
+ processGroupId
563
+ }))
564
+ }
565
+ };
566
+ };
567
+ unavailableLineage = (ownership, reason) => ({
568
+ status: "unavailable",
569
+ observedAt: new Date().toISOString(),
570
+ runId: ownership.runId,
571
+ launcherPid: ownership.leaderPid,
572
+ processGroupId: ownership.processGroupId,
573
+ reason
574
+ });
575
+ parseProcessEnvironment = (value) => Object.fromEntries(value.split("\0").filter((entry) => entry.indexOf("=") > 0).map((entry) => {
576
+ const separator = entry.indexOf("=");
577
+ return [entry.slice(0, separator), entry.slice(separator + 1)];
578
+ }));
579
+ parseLinuxProcessStartTime = (value) => {
580
+ const commandEnd = value.lastIndexOf(")");
581
+ if (commandEnd < 0) return undefined;
582
+ const fields = value.slice(commandEnd + 1).trim().split(/\s+/u);
583
+ const startTime = fields[19];
584
+ return startTime !== undefined && /^\d+$/u.test(startTime) ? startTime : undefined;
585
+ };
586
+ isExpectedAbort = (cause, signal) => signal?.aborted === true && (cause === signal.reason || cause instanceof Error && cause.name === "AbortError");
587
+ createSystemProcessOwnershipHost = (platform = process.platform, hostEnvironment = process.env, options = {}) => {
588
+ const darwinTokens = platform === "darwin" ? createDarwinProcessRunTokenReader(options.darwinXcrun === undefined ? {} : { xcrun: options.darwinXcrun }) : undefined;
589
+ const listProcesses = async (signal) => {
590
+ if (platform === "win32") return [];
591
+ const { stdout } = await execFileOutput("ps", ["-axo", "pid=,ppid=,pgid=,uid=,stat=,command="], {
592
+ env: hostEnvironment,
593
+ ...signal === undefined ? {} : { signal }
594
+ });
595
+ 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) => ({
596
+ pid: Number(match[1]),
597
+ parentPid: Number(match[2]),
598
+ processGroupId: Number(match[3]),
599
+ uid: Number(match[4]),
600
+ state: match[5] ?? "",
601
+ command: match[6] ?? ""
602
+ }));
603
+ };
604
+ const processIdentities = async (processes, signal) => {
605
+ if (processes.length === 0) return new Map();
606
+ if (platform === "linux") return new Map(await Promise.all(processes.map(async ({ pid }) => {
607
+ try {
608
+ const stat = await readFile(`/proc/${String(pid)}/stat`, {
609
+ encoding: "utf8",
610
+ ...signal === undefined ? {} : { signal }
611
+ });
612
+ const identity = parseLinuxProcessStartTime(stat);
613
+ return [pid, identity === undefined ? {
614
+ state: "unavailable",
615
+ reason: "malformed_proc_stat"
616
+ } : {
617
+ state: "readable",
618
+ identity: `linux-starttime:${identity}`
619
+ }];
620
+ } catch (cause) {
621
+ if (isExpectedAbort(cause, signal)) throw cause;
622
+ return [pid, {
623
+ state: "unavailable",
624
+ reason: errorMessage(cause)
625
+ }];
626
+ }
627
+ })));
628
+ if (darwinTokens === undefined) return new Map();
629
+ try {
630
+ return await darwinTokens.identities(processes, signal);
631
+ } catch (cause) {
632
+ if (isExpectedAbort(cause, signal)) throw cause;
633
+ const reason = errorMessage(cause);
634
+ return new Map(processes.map(({ pid }) => [pid, {
635
+ state: "unavailable",
636
+ reason
637
+ }]));
638
+ }
639
+ };
640
+ const captureBaseline = async (signal) => {
641
+ if (platform !== "linux" && darwinTokens === undefined) return [];
642
+ const processes = liveProcesses(await listProcesses(signal));
643
+ let identities = await processIdentities(processes, signal);
644
+ const unreadable = processes.filter(({ pid }) => identities.get(pid)?.state !== "readable");
645
+ if (unreadable.length > 0) {
646
+ const stillLive = liveProcesses(await listProcesses(signal)).filter(({ pid }) => unreadable.some((entry) => entry.pid === pid));
647
+ const retried = await processIdentities(stillLive, signal);
648
+ identities = new Map([...identities, ...retried]);
649
+ const unresolved = stillLive.filter(({ pid }) => identities.get(pid)?.state !== "readable");
650
+ const liveAfterRetry = liveProcesses(await listProcesses(signal));
651
+ const stillUnresolved = unresolved.filter(({ pid }) => liveAfterRetry.some((entry) => entry.pid === pid));
652
+ if (stillUnresolved.length > 0) throw new Error(`process identity snapshot is unavailable for ${String(stillUnresolved.length)} live processes`);
653
+ }
654
+ return processes.map(({ pid }) => {
655
+ const observation = identities.get(pid);
656
+ return {
657
+ pid,
658
+ identity: observation?.state === "readable" ? observation.identity : null
659
+ };
660
+ });
661
+ };
662
+ return {
663
+ platform,
664
+ prepare: async (signal) => {
665
+ await darwinTokens?.prepare(signal);
666
+ if (platform === "linux") {
667
+ try {
668
+ const processes = await listProcesses(signal);
669
+ if (!processes.some(({ pid }) => pid === process.pid)) throw new Error("ps did not report REA's current process");
670
+ } catch (cause) {
671
+ if (isExpectedAbort(cause, signal)) throw cause;
672
+ const reason = `Linux process ownership inspection requires a procps-compatible ps on REA's PATH before launching a child: ${errorMessage(cause)}`;
673
+ throw new AnalysisCapabilityUnavailableError("process-ownership", "prepare_owned_process", reason, {
674
+ cause,
675
+ userMessage: reason
676
+ });
677
+ }
678
+ }
679
+ },
680
+ listProcesses,
681
+ async environment(pid, signal) {
682
+ signal?.throwIfAborted();
683
+ if (platform === "linux") return parseProcessEnvironment(await readFile(`/proc/${pid}/environ`, {
684
+ encoding: "utf8",
685
+ signal
686
+ }));
687
+ if (platform === "darwin") {
688
+ const process = (await listProcesses(signal)).find((entry) => entry.pid === pid);
689
+ if (process === undefined) throw new Error(`process ${String(pid)} is not live`);
690
+ const observation = (await darwinTokens?.read([process], signal))?.get(pid);
691
+ if (observation === undefined || observation.state === "unavailable") throw new Error(observation?.reason ?? "process run token could not be read");
692
+ return observation.runId === undefined ? {} : { REA_PROCESS_RUN_ID: observation.runId };
693
+ }
694
+ const { stdout } = await execFileOutput("ps", [
695
+ "eww",
696
+ "-p",
697
+ String(pid)
698
+ ], {
699
+ env: hostEnvironment,
700
+ ...signal === undefined ? {} : { signal }
701
+ });
702
+ const observedEnvironment = {};
703
+ for (const match of stdout.matchAll(/(?:^|\s)([A-Za-z_][A-Za-z0-9_]*)=([^\s]*)/gu)) {
704
+ const name = match[1];
705
+ if (name !== undefined) observedEnvironment[name] = match[2] ?? "";
706
+ }
707
+ return observedEnvironment;
708
+ },
709
+ async runTokens(processes, signal) {
710
+ signal?.throwIfAborted();
711
+ if (platform !== "darwin" || processes.length === 0) return new Map();
712
+ try {
713
+ return await darwinTokens?.read(processes, signal) ?? new Map();
714
+ } catch (cause) {
715
+ if (isExpectedAbort(cause, signal)) throw cause;
716
+ void cause;
717
+ return new Map(processes.map(({ pid }) => [pid, {
718
+ state: "unavailable",
719
+ reason: "reader_failure"
720
+ }]));
721
+ }
722
+ },
723
+ ...platform !== "linux" && darwinTokens === undefined ? {} : {
724
+ processIdentities,
725
+ captureBaseline,
726
+ ...darwinTokens === undefined ? {} : { close: darwinTokens.close }
727
+ },
728
+ signalGroup(processGroupId, signal) {
729
+ process.kill(-processGroupId, signal);
730
+ }
731
+ };
732
+ };
733
+ systemProcessOwnershipHost = createSystemProcessOwnershipHost();
734
+ observeProcessStartIdentity = async (pid, host = systemProcessOwnershipHost, expectedRunId) => {
735
+ const process = (await host.listProcesses()).find((entry) => entry.pid === pid);
736
+ if (process === undefined || liveProcesses([process]).length === 0) return undefined;
737
+ if (host.processIdentities === undefined) return {
738
+ state: "unavailable",
739
+ reason: "process identity is unsupported"
740
+ };
741
+ const identity = (await host.processIdentities([process])).get(pid) ?? {
742
+ state: "unavailable",
743
+ reason: "process identity was not returned"
744
+ };
745
+ if (expectedRunId === undefined || identity.state !== "readable") return identity;
746
+ let owned = false;
747
+ for await (const { observation } of readProcessRunTokens(host, [process])) {
748
+ if (observation.state === "unavailable") return {
749
+ state: "unavailable",
750
+ reason: `process ownership token could not be read for PID ${String(pid)}: ${observation.reason}`
751
+ };
752
+ if (observation.runId !== expectedRunId) return {
753
+ state: "unavailable",
754
+ reason: `process ownership token did not match the captured run for PID ${String(pid)}`
755
+ };
756
+ owned = true;
757
+ }
758
+ if (!owned) return {
759
+ state: "unavailable",
760
+ reason: `process ownership token was not returned for PID ${String(pid)}`
761
+ };
762
+ const confirmed = await observeProcessStartIdentity(pid, host);
763
+ if (confirmed === undefined || confirmed.state !== "readable") return confirmed;
764
+ return confirmed.identity === identity.identity ? identity : {
765
+ state: "unavailable",
766
+ reason: `process identity changed while validating the captured run token for PID ${String(pid)}`
767
+ };
768
+ };
769
+ signalProcessWithStartIdentity = async (pid, expectedIdentity, signal, options = {}) => {
770
+ const host = options.host ?? systemProcessOwnershipHost;
771
+ try {
772
+ const observed = await observeProcessStartIdentity(pid, host);
773
+ if (observed === undefined) return "gone";
774
+ if (observed.state !== "readable") return "unverified";
775
+ if (observed.identity !== expectedIdentity) return "identity-changed";
776
+ (options.sendSignal ?? process.kill)(pid, signal);
777
+ return "signaled";
778
+ } catch {
779
+ return "unverified";
780
+ }
781
+ };
782
+ prepareProcessOwnershipInspection = async (signal) => {
783
+ await systemProcessOwnershipHost.prepare?.(signal);
784
+ };
785
+ processIsGone = async (host, pid) => {
786
+ try {
787
+ return !liveProcesses(await host.listProcesses()).some((process) => process.pid === pid);
788
+ } catch (cause) {
789
+ void cause;
790
+ return false;
791
+ }
792
+ };
793
+ errorMessage = (cause) => cause instanceof Error ? cause.message : String(cause);
794
+ })))();
795
+ }
796
+
797
+ //#endregion
798
+ //#region dist/process/ProcessOwnership.js
799
+ 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;
800
+ function init_ProcessOwnership() {
801
+ return (init_ProcessOwnership = __esmMin((() => {
802
+ init_ProcessOwnershipObservation();
803
+ init_ProcessOwnershipIdentity();
804
+ init_ProcessOwnershipProcessTree();
805
+ init_ProcessRunTokenObservations();
806
+ init_unicodeCodePointOrder();
807
+ execFileAsync = promisify(execFile);
808
+ cleanupWindowsProcessTree = async (rootPid, host = systemWindowsProcessTreeHost) => {
809
+ if (!Number.isSafeInteger(rootPid) || rootPid <= 0) return {
810
+ cleaned: false,
811
+ reason: "Windows process-tree PID is invalid"
812
+ };
813
+ try {
814
+ const result = await host.terminateTree(rootPid);
815
+ return {
816
+ cleaned: true,
817
+ signaled: result === "terminated"
818
+ };
819
+ } catch (cause) {
820
+ return {
821
+ cleaned: false,
822
+ reason: `Windows process-tree termination failed for PID ${String(rootPid)}: ${errorMessage(cause)}`
823
+ };
824
+ }
825
+ };
826
+ systemWindowsProcessTreeHost = { async terminateTree(rootPid) {
827
+ try {
828
+ await execFileAsync("taskkill.exe", [
829
+ "/pid",
830
+ String(rootPid),
831
+ "/t",
832
+ "/f"
833
+ ], {
834
+ windowsHide: true,
835
+ timeout: 5e3
836
+ });
837
+ return "terminated";
838
+ } catch (cause) {
839
+ if (cause instanceof Error && "code" in cause && (cause.code === 128 || cause.code === "ESRCH")) return "missing";
840
+ throw cause;
841
+ }
842
+ } };
843
+ readProcessRunId = async (pid, host = systemProcessOwnershipHost, signal) => (await host.environment(pid, signal)).REA_PROCESS_RUN_ID;
844
+ cleanupOwnedProcessGroup = async (ownership, host = systemProcessOwnershipHost) => {
845
+ const processTable = await readLiveProcessTable(host);
846
+ if (!processTable.available) return {
847
+ cleaned: false,
848
+ reason: `process table could not be inspected: ${processTable.reason}`
849
+ };
850
+ const plan = await createOwnedCleanupPlan(ownership, processTable.processes, host);
851
+ if ("cleaned" in plan) return plan;
852
+ let signaled = false;
853
+ for (const processGroupId of plan.signalOrder) {
854
+ const revalidation = await revalidateOwnedProcessGroup(processGroupId, ownership, host, plan.tokenOwnedIdentities);
855
+ if ("cleaned" in revalidation) return revalidation;
856
+ if (revalidation.empty) continue;
857
+ try {
858
+ host.signalGroup(processGroupId, "SIGKILL");
859
+ signaled = true;
860
+ } catch (cause) {
861
+ const code = cause instanceof Error && "code" in cause ? cause.code : undefined;
862
+ if (code !== "ESRCH") return {
863
+ cleaned: false,
864
+ reason: `owned process group signal failed: ${errorMessage(cause)}`
865
+ };
866
+ }
867
+ }
868
+ if (plan.unresolved.length > 0) return cleanupValidationFailure(plan.unresolved, plan.unverified);
869
+ return {
870
+ cleaned: true,
871
+ signaled,
872
+ ...plan.unverified.length === 0 ? {} : { unverified: plan.unverified }
873
+ };
874
+ };
875
+ verifyNoTokenOwnedProcesses = async (runId, host = systemProcessOwnershipHost, captureBaseline, relation) => {
876
+ const processTable = await readLiveProcessTable(host);
877
+ if (!processTable.available) return {
878
+ cleaned: false,
879
+ reason: `process table could not be inspected: ${processTable.reason}`
880
+ };
881
+ const scan = await scanTokenOwnedProcesses(processTable.processes, runId, host, captureBaseline, relation);
882
+ if (scan.failures.length > 0) return cleanupValidationFailure(scan.failures, scan.unverified);
883
+ if (scan.owned.length > 0) return {
884
+ cleaned: false,
885
+ reason: "token-owned process remained after cleanup",
886
+ ...scan.unverified.length === 0 ? {} : { unverified: scan.unverified }
887
+ };
888
+ return {
889
+ cleaned: true,
890
+ signaled: false,
891
+ ...scan.unverified.length === 0 ? {} : { unverified: scan.unverified }
892
+ };
893
+ };
894
+ readLiveProcessTable = async (host) => {
895
+ try {
896
+ return {
897
+ available: true,
898
+ processes: liveProcesses(await host.listProcesses())
899
+ };
900
+ } catch (cause) {
901
+ return {
902
+ available: false,
903
+ reason: errorMessage(cause)
904
+ };
905
+ }
906
+ };
907
+ settleLauncherExit = async (ownership, processes, host) => {
908
+ const launcher = processes.find(({ pid }) => pid === ownership.leaderPid);
909
+ if (launcher === undefined) return processes;
910
+ const reason = launcherIdentityFailure(launcher, ownership);
911
+ if (reason === null) return processes;
912
+ const refreshed = await readLiveProcessTable(host);
913
+ if (refreshed.available && !refreshed.processes.some(({ pid }) => pid === launcher.pid)) {
914
+ const descendants = descendantsOf([launcher.pid], processes);
915
+ const descendantPids = new Set(descendants.map(({ pid }) => pid));
916
+ const descendantGroupIds = new Set(descendants.map(({ processGroupId }) => processGroupId));
917
+ const refreshedDescendantPids = new Set(descendantsOf(descendants.map(({ pid }) => pid), refreshed.processes).map(({ pid }) => pid));
918
+ if (refreshed.processes.some((process) => process.processGroupId !== ownership.processGroupId && (refreshedDescendantPids.has(process.pid) || descendantPids.has(process.pid) || descendantGroupIds.has(process.processGroupId)))) return {
919
+ cleaned: false,
920
+ reason
921
+ };
922
+ return refreshed.processes;
923
+ }
924
+ return {
925
+ cleaned: false,
926
+ reason
927
+ };
928
+ };
929
+ createOwnedCleanupPlan = async (ownership, initialProcesses, host) => {
930
+ const processes = await settleLauncherExit(ownership, initialProcesses, host);
931
+ if ("cleaned" in processes) return processes;
932
+ const sampledProcessGroupIds = new Set((ownership.sampledProcessGroupIds ?? []).filter((processGroupId) => Number.isSafeInteger(processGroupId) && processGroupId > 0));
933
+ const tokenOwned = ownership.sweepTokenOwnedProcesses === true ? await scanTokenOwnedProcesses(processes, ownership.runId, host, ownership.captureBaseline, {
934
+ leaderPid: ownership.leaderPid,
935
+ processGroupId: ownership.processGroupId,
936
+ ...sampledProcessGroupIds.size === 0 ? {} : { sampledProcessGroupIds: [...sampledProcessGroupIds] }
937
+ }) : {
938
+ owned: [],
939
+ failures: [],
940
+ unverified: [],
941
+ identities: new Map()
942
+ };
943
+ const tokenOwnedGroupIds = new Set(tokenOwned.owned.map(({ processGroupId }) => processGroupId));
944
+ const launcher = processes.find(({ pid }) => pid === ownership.leaderPid);
945
+ const rootMembers = processes.filter(({ processGroupId }) => processGroupId === ownership.processGroupId);
946
+ if (launcher === undefined && rootMembers.length === 0 && tokenOwned.owned.length === 0 && !processes.some(({ processGroupId }) => sampledProcessGroupIds.has(processGroupId))) return tokenOwned.failures.length > 0 ? {
947
+ signalOrder: [],
948
+ tokenOwnedIdentities: tokenOwned.identities,
949
+ unresolved: tokenOwned.failures,
950
+ unverified: tokenOwned.unverified
951
+ } : {
952
+ cleaned: true,
953
+ signaled: false,
954
+ ...tokenOwned.unverified.length === 0 ? {} : { unverified: tokenOwned.unverified }
955
+ };
956
+ let descendants = [];
957
+ if (launcher !== undefined) {
958
+ descendants = descendantsOf([launcher.pid], processes);
959
+ }
960
+ const descendantPids = new Set(descendants.map(({ pid }) => pid));
961
+ const processGroupIds = new Set([ownership.processGroupId]);
962
+ for (const descendant of descendants) processGroupIds.add(descendant.processGroupId);
963
+ for (const process of tokenOwned.owned) processGroupIds.add(process.processGroupId);
964
+ for (const processGroupId of sampledProcessGroupIds) processGroupIds.add(processGroupId);
965
+ const signalableGroups = new Set();
966
+ const unresolved = [...tokenOwned.failures];
967
+ const unverifiableSampledGroups = new Set();
968
+ for (const processGroupId of processGroupIds) {
969
+ if (processGroupId === ownership.processGroupId) continue;
970
+ const groupLeader = processes.find(({ pid, processGroupId: observedGroupId }) => pid === processGroupId && observedGroupId === processGroupId);
971
+ if ((groupLeader === undefined || !descendantPids.has(groupLeader.pid)) && !tokenOwnedGroupIds.has(processGroupId) && !sampledProcessGroupIds.has(processGroupId)) return {
972
+ cleaned: false,
973
+ reason: "descendant process-group leader identity could not be verified"
974
+ };
975
+ if ((groupLeader === undefined || !descendantPids.has(groupLeader.pid)) && !tokenOwnedGroupIds.has(processGroupId)) unverifiableSampledGroups.add(processGroupId);
976
+ }
977
+ const liveMembers = processes.filter(({ processGroupId }) => processGroupIds.has(processGroupId));
978
+ for (const processGroupId of processGroupIds) {
979
+ const members = liveMembers.filter(({ processGroupId: observedGroupId }) => observedGroupId === processGroupId);
980
+ if (members.length === 0) continue;
981
+ const failures = await processOwnershipFailures(members, ownership.runId, host, tokenOwned.identities);
982
+ if (failures.length === 0 && unverifiableSampledGroups.has(processGroupId)) unresolved.push(...members.map(({ pid }) => ({
983
+ pid,
984
+ reason: "process-identity-unavailable",
985
+ diagnostic: "sampled process-group leader identity could not be verified"
986
+ })));
987
+ const scanFailures = tokenOwned.failures.filter(({ pid }) => members.some((member) => member.pid === pid));
988
+ if (failures.length > 0) unresolved.push(...failures);
989
+ if (failures.length === 0 && scanFailures.length === 0 && !unverifiableSampledGroups.has(processGroupId)) signalableGroups.add(processGroupId);
990
+ }
991
+ if (ownership.sweepTokenOwnedProcesses !== true && unresolved.length > 0) return cleanupValidationFailure(unresolved, tokenOwned.unverified);
992
+ return {
993
+ signalOrder: [...signalableGroups].filter((groupId) => processGroupIds.has(groupId)).sort((left, right) => left === ownership.processGroupId ? -1 : right === ownership.processGroupId ? 1 : left - right),
994
+ tokenOwnedIdentities: tokenOwned.identities,
995
+ unresolved,
996
+ unverified: tokenOwned.unverified
997
+ };
998
+ };
999
+ revalidateOwnedProcessGroup = async (processGroupId, ownership, host, expectedIdentities) => {
1000
+ let members;
1001
+ try {
1002
+ const processes = await settleLauncherExit(ownership, liveProcesses(await host.listProcesses()), host);
1003
+ if ("cleaned" in processes) return processes;
1004
+ members = processes.filter(({ processGroupId: observedGroupId }) => observedGroupId === processGroupId);
1005
+ } catch (cause) {
1006
+ return {
1007
+ cleaned: false,
1008
+ reason: `process ownership could not be revalidated: ${errorMessage(cause)}`
1009
+ };
1010
+ }
1011
+ const failures = await processOwnershipFailures(members, ownership.runId, host, expectedIdentities);
1012
+ if (failures.length > 0) return cleanupValidationFailure(failures);
1013
+ if (processGroupId !== ownership.processGroupId && members.length > 0 && !members.some(({ pid }) => pid === processGroupId) && ownership.sweepTokenOwnedProcesses !== true) return {
1014
+ cleaned: false,
1015
+ reason: "descendant process-group leader identity could not be revalidated"
1016
+ };
1017
+ return { empty: members.length === 0 };
1018
+ };
1019
+ cleanupValidationFailure = (failures, unverified = []) => {
1020
+ const unverifiedEntry = unverified.length === 0 ? {} : { unverified };
1021
+ const unreadable = failures.filter(({ reason }) => reason === "environment-unreadable");
1022
+ if (failures.some(({ reason }) => reason === "run-token-mismatch")) return {
1023
+ cleaned: false,
1024
+ 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(", ")}`,
1025
+ failures,
1026
+ ...unverifiedEntry
1027
+ };
1028
+ if (failures.some(({ reason }) => reason === "process-identity-unavailable")) return {
1029
+ cleaned: false,
1030
+ reason: "process identity could not be revalidated",
1031
+ failures,
1032
+ ...unverifiedEntry
1033
+ };
1034
+ if (unreadable.length > 0) {
1035
+ const counts = new Map();
1036
+ for (const { diagnostic } of unreadable) {
1037
+ const category = sanitizedTokenReadFailure(diagnostic);
1038
+ counts.set(category, (counts.get(category) ?? 0) + 1);
1039
+ }
1040
+ const breakdown = [...counts].sort(([left], [right]) => compareUnicodeCodePoints(left, right)).map(([category, count]) => `${category}=${String(count)}`).join(", ");
1041
+ const candidates = unreadable.map(({ pid, diagnostic }) => `${String(pid)}=${sanitizedTokenReadFailure(diagnostic)}`).sort((left, right) => compareUnicodeCodePoints(left, right));
1042
+ return {
1043
+ cleaned: false,
1044
+ reason: `process ownership token could not be read for ${String(unreadable.length)} live process(es): ${breakdown}; live candidates ${candidates.join(", ")}`,
1045
+ failures,
1046
+ ...unverifiedEntry
1047
+ };
1048
+ }
1049
+ return {
1050
+ cleaned: false,
1051
+ reason: "process ownership could not be revalidated",
1052
+ failures,
1053
+ ...unverifiedEntry
1054
+ };
1055
+ };
1056
+ sanitizedTokenReadFailure = (diagnostic) => {
1057
+ if (diagnostic === "environment_unavailable") return diagnostic;
1058
+ if (diagnostic === "platform_binary_environment_withheld") return diagnostic;
1059
+ if (diagnostic === "restricted_process_environment_withheld") return diagnostic;
1060
+ const environmentErrno = /^(EACCES|EPERM|ENOENT|ESRCH):/u.exec(diagnostic ?? "");
1061
+ if (environmentErrno?.[1] !== undefined) return `environment_errno_${environmentErrno[1]}`;
1062
+ if (diagnostic === "apple_vector_unavailable") return diagnostic;
1063
+ if (diagnostic === "ambiguous_environment_boundary") return diagnostic;
1064
+ if (diagnostic === "malformed_procargs") return diagnostic;
1065
+ if (diagnostic === "process_identity_changed_during_token_read") return diagnostic;
1066
+ if (diagnostic === "process_not_in_snapshot") return diagnostic;
1067
+ const processTableFailure = /^process_table_failed_(\d+)$/u.exec(diagnostic ?? "");
1068
+ if (processTableFailure?.[1] !== undefined) return `process_table_errno_${processTableFailure[1]}`;
1069
+ const sysctlFailure = /^sysctl_failed_(\d+)$/u.exec(diagnostic ?? "");
1070
+ if (sysctlFailure?.[1] !== undefined) return `sysctl_errno_${sysctlFailure[1]}`;
1071
+ if (diagnostic === "reader_failure") return diagnostic;
1072
+ if (diagnostic === "duplicate_run_token") return diagnostic;
1073
+ if (diagnostic === "invalid_run_token_encoding") return diagnostic;
1074
+ return "other_unavailable";
1075
+ };
1076
+ processOwnershipFailures = async (members, runId, host, expectedIdentities = new Map()) => {
1077
+ const failures = [];
1078
+ if (expectedIdentities.size > 0 && host.processIdentities !== undefined) {
1079
+ const expectedMembers = members.filter(({ pid }) => expectedIdentities.has(pid));
1080
+ const observed = await host.processIdentities(expectedMembers);
1081
+ const identityFailures = [];
1082
+ for (const member of expectedMembers) {
1083
+ const expected = expectedIdentities.get(member.pid);
1084
+ const current = observed.get(member.pid);
1085
+ if (expected === null || current?.state !== "readable" || current.identity !== expected) {
1086
+ identityFailures.push({
1087
+ pid: member.pid,
1088
+ reason: "process-identity-unavailable",
1089
+ diagnostic: "process identity changed or became unavailable before signal"
1090
+ });
1091
+ }
1092
+ }
1093
+ failures.push(...await recheckOwnershipFailures(identityFailures, host));
1094
+ }
1095
+ failures.push(...await processRunTokenFailures(members, runId, host));
1096
+ if (failures.length === 0 && expectedIdentities.size > 0 && host.processIdentities !== undefined) {
1097
+ const expectedMembers = members.filter(({ pid }) => expectedIdentities.has(pid));
1098
+ const observed = await host.processIdentities(expectedMembers);
1099
+ const identityFailures = [];
1100
+ for (const member of expectedMembers) {
1101
+ const expected = expectedIdentities.get(member.pid);
1102
+ const current = observed.get(member.pid);
1103
+ if (expected !== null && current?.state === "readable" && current.identity === expected) continue;
1104
+ identityFailures.push({
1105
+ pid: member.pid,
1106
+ reason: "process-identity-unavailable",
1107
+ diagnostic: "process identity changed or became unavailable during token validation"
1108
+ });
1109
+ }
1110
+ failures.push(...await recheckOwnershipFailures(identityFailures, host));
1111
+ }
1112
+ return failures;
1113
+ };
1114
+ processRunTokenFailures = async (members, runId, host) => {
1115
+ const failures = [];
1116
+ for await (const { process: member, observation } of readProcessRunTokens(host, members)) {
1117
+ if (observation.state === "readable") {
1118
+ if (observation.runId !== runId) failures.push({
1119
+ pid: member.pid,
1120
+ reason: "run-token-mismatch"
1121
+ });
1122
+ continue;
1123
+ }
1124
+ failures.push({
1125
+ pid: member.pid,
1126
+ reason: "environment-unreadable",
1127
+ diagnostic: observation.reason
1128
+ });
1129
+ }
1130
+ return recheckOwnershipFailures(failures, host);
1131
+ };
1132
+ recheckOwnershipFailures = async (failures, host) => {
1133
+ if (!failures.some(({ reason }) => reason !== "run-token-mismatch")) return failures;
1134
+ try {
1135
+ const live = new Set(liveProcesses(await host.listProcesses()).map(({ pid }) => pid));
1136
+ return failures.filter(({ pid, reason }) => reason === "run-token-mismatch" || live.has(pid));
1137
+ } catch (cause) {
1138
+ return failures.map((failure) => failure.reason === "run-token-mismatch" ? failure : {
1139
+ ...failure,
1140
+ diagnostic: `${failure.diagnostic}; process liveness recheck failed: ${errorMessage(cause)}`
1141
+ });
1142
+ }
1143
+ };
1144
+ TOKEN_READ_RETRY_ATTEMPTS = 3;
1145
+ TOKEN_READ_RETRY_DELAY_MS = 40;
1146
+ PLATFORM_BINARY_ENVIRONMENT_WITHHELD = "platform_binary_environment_withheld";
1147
+ RESTRICTED_PROCESS_ENVIRONMENT_WITHHELD = "restricted_process_environment_withheld";
1148
+ currentProcessUid = () => typeof process.getuid === "function" ? process.getuid() : undefined;
1149
+ environmentWithheldFromInspection = (entry, diagnostic) => {
1150
+ const uid = currentProcessUid();
1151
+ if (uid !== undefined && entry.uid !== undefined && entry.uid !== uid) return true;
1152
+ return diagnostic === PLATFORM_BINARY_ENVIRONMENT_WITHHELD || diagnostic === RESTRICTED_PROCESS_ENVIRONMENT_WITHHELD;
1153
+ };
1154
+ scanTokenOwnedProcesses = async (processes, runId, host, captureBaseline, relation) => {
1155
+ let candidates = processes;
1156
+ let candidateIdentities = new Map();
1157
+ if (host.processIdentities !== undefined) {
1158
+ const current = await host.processIdentities(processes);
1159
+ candidateIdentities = current;
1160
+ if (captureBaseline !== undefined) {
1161
+ const baseline = new Map(captureBaseline.map(({ pid, identity }) => [pid, identity]));
1162
+ candidates = processes.filter((process) => {
1163
+ const before = baseline.get(process.pid);
1164
+ const now = current.get(process.pid);
1165
+ return !(before !== undefined && before !== null && now?.state === "readable" && now.identity === before);
1166
+ });
1167
+ }
1168
+ }
1169
+ const failures = [];
1170
+ if (captureBaseline !== undefined && host.processIdentities !== undefined) {
1171
+ const stableCandidates = [];
1172
+ const identityFailures = [];
1173
+ for (const process of candidates) {
1174
+ if (candidateIdentities.get(process.pid)?.state === "readable") {
1175
+ stableCandidates.push(process);
1176
+ continue;
1177
+ }
1178
+ identityFailures.push({
1179
+ pid: process.pid,
1180
+ reason: "process-identity-unavailable",
1181
+ diagnostic: "process identity was unavailable during token scan"
1182
+ });
1183
+ }
1184
+ failures.push(...await recheckOwnershipFailures(identityFailures, host));
1185
+ candidates = stableCandidates;
1186
+ }
1187
+ const owned = [];
1188
+ const ownedIdentities = new Map();
1189
+ const recordOwned = (process) => {
1190
+ owned.push(process);
1191
+ const identity = candidateIdentities.get(process.pid);
1192
+ ownedIdentities.set(process.pid, identity?.state === "readable" ? identity.identity : null);
1193
+ };
1194
+ const unreadable = [];
1195
+ for await (const { process, observation } of readProcessRunTokens(host, candidates)) {
1196
+ if (observation.state === "readable") {
1197
+ if (observation.runId === runId) recordOwned(process);
1198
+ } else unreadable.push({
1199
+ process,
1200
+ diagnostic: observation.reason
1201
+ });
1202
+ }
1203
+ const remaining = await settleUnreadableTokenCandidates(unreadable, runId, host, recordOwned);
1204
+ const relatedPids = new Set();
1205
+ const relatedGroupIds = new Set();
1206
+ if (relation !== undefined) {
1207
+ relatedPids.add(relation.leaderPid);
1208
+ for (const descendant of descendantsOf([relation.leaderPid], processes)) relatedPids.add(descendant.pid);
1209
+ relatedGroupIds.add(relation.processGroupId);
1210
+ for (const processGroupId of relation.sampledProcessGroupIds ?? []) if (Number.isSafeInteger(processGroupId) && processGroupId > 0) relatedGroupIds.add(processGroupId);
1211
+ for (const process of owned) relatedGroupIds.add(process.processGroupId);
1212
+ }
1213
+ const unverified = [];
1214
+ const strict = [];
1215
+ const withheld = [];
1216
+ for (const candidate of remaining) {
1217
+ const isRelated = relation === undefined || relatedPids.has(candidate.process.pid) || relatedGroupIds.has(candidate.process.processGroupId);
1218
+ if (!isRelated && environmentWithheldFromInspection(candidate.process, candidate.diagnostic)) {
1219
+ withheld.push(candidate);
1220
+ continue;
1221
+ }
1222
+ strict.push(candidate);
1223
+ }
1224
+ let finalLive;
1225
+ try {
1226
+ finalLive = new Set(liveProcesses(await host.listProcesses()).map(({ pid }) => pid));
1227
+ } catch (cause) {
1228
+ void cause;
1229
+ finalLive = undefined;
1230
+ }
1231
+ for (const candidate of strict) {
1232
+ if (finalLive !== undefined && !finalLive.has(candidate.process.pid)) continue;
1233
+ failures.push({
1234
+ pid: candidate.process.pid,
1235
+ reason: "environment-unreadable",
1236
+ diagnostic: candidate.diagnostic
1237
+ });
1238
+ }
1239
+ for (const candidate of withheld) {
1240
+ if (finalLive !== undefined && !finalLive.has(candidate.process.pid)) continue;
1241
+ unverified.push({
1242
+ pid: candidate.process.pid,
1243
+ diagnostic: candidate.diagnostic
1244
+ });
1245
+ }
1246
+ if (candidates.length > 0 && host.processIdentities !== undefined) {
1247
+ const afterRead = await host.processIdentities(candidates);
1248
+ const stillOwned = [];
1249
+ const identityFailures = [];
1250
+ const ownedPids = new Set(owned.map(({ pid }) => pid));
1251
+ for (const process of candidates) {
1252
+ const before = candidateIdentities.get(process.pid);
1253
+ const current = afterRead.get(process.pid);
1254
+ if (before?.state === "readable" && current?.state === "readable" && current.identity === before.identity) {
1255
+ if (ownedPids.has(process.pid)) stillOwned.push(process);
1256
+ continue;
1257
+ }
1258
+ identityFailures.push({
1259
+ pid: process.pid,
1260
+ reason: "process-identity-unavailable",
1261
+ diagnostic: "process identity changed or became unavailable during token validation"
1262
+ });
1263
+ }
1264
+ failures.push(...await recheckOwnershipFailures(identityFailures, host));
1265
+ return {
1266
+ owned: stillOwned,
1267
+ failures,
1268
+ unverified,
1269
+ identities: ownedIdentities
1270
+ };
1271
+ }
1272
+ return {
1273
+ owned,
1274
+ failures,
1275
+ unverified,
1276
+ identities: ownedIdentities
1277
+ };
1278
+ };
1279
+ settleUnreadableTokenCandidates = async (pending, runId, host, recordOwned) => {
1280
+ let remaining = pending;
1281
+ for (let attempt = 0; attempt < TOKEN_READ_RETRY_ATTEMPTS && remaining.length > 0; attempt += 1) {
1282
+ await new Promise((resolve) => setTimeout(resolve, TOKEN_READ_RETRY_DELAY_MS));
1283
+ let live;
1284
+ try {
1285
+ live = new Set(liveProcesses(await host.listProcesses()).map(({ pid }) => pid));
1286
+ } catch (cause) {
1287
+ void cause;
1288
+ live = undefined;
1289
+ }
1290
+ const stillUnreadable = [];
1291
+ const candidates = remaining.map(({ process }) => process).filter(({ pid }) => live === undefined || live.has(pid));
1292
+ for await (const { process, observation } of readProcessRunTokens(host, candidates)) {
1293
+ if (observation.state === "readable") {
1294
+ if (observation.runId === runId) recordOwned(process);
1295
+ continue;
1296
+ }
1297
+ stillUnreadable.push({
1298
+ process,
1299
+ diagnostic: observation.reason
1300
+ });
1301
+ }
1302
+ remaining = stillUnreadable;
1303
+ }
1304
+ return remaining;
1305
+ };
1306
+ })))();
1307
+ }
1308
+
1309
+ //#endregion
1310
+ export { DarwinProcessOwnershipInspectionError, SWIFTC_INTERRUPT, boundedUtf8Text, cleanupOwnedProcessGroup, cleanupWindowsProcessTree, init_DarwinProcessRunTokenReader, init_ProcessOwnership, init_ProcessOwnershipObservation, init_ProcessOwnershipProcessTree, init_boundedUtf8Text, observeOwnedProcessGroups, observeOwnedProcessLineage, observeProcessStartIdentity, prepareProcessOwnershipInspection, readProcessRunId, selectCapturedProcessGroupIds, signalProcessWithStartIdentity, systemProcessOwnershipHost, verifyNoTokenOwnedProcesses };