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,2090 @@
1
+ import { t as __esmMin } from "./rolldown-runtime-BjeaiXFo.js";
2
+ import { g as snapshotEnvironment, h as init_snapshotEnvironment } from "./machoContainer-9En6pSkd.js";
3
+ import { a as AnalysisInputError, d as init_analysisErrorCore, f as err, i as AnalysisCapabilityUnavailableError, m as ok, p as init_result, u as AnalysisUnsupportedTargetError } from "./analysisErrorCore-BqyeMw3_.js";
4
+ import { Bt as projectKeyedArchive, Ft as projectAppleAssetCatalogPage, Gn as artifactInventoryResultSchema, Gt as init_dyldPaths, Ht as dylibResolutionResultSchema, It as KeyedArchiveKindError, Jt as createArtifactInspection, Kn as init_artifactGraph, Kt as resolveTreePath, Lt as init_keyedArchive, Mt as appleAssetCatalogInputSchema, Nt as init_appleAssetCatalog, Pt as parseAppleAssetCatalogRecords, Rt as keyedArchiveInputSchema, Ut as init_dylibResolution, Vt as dylibResolutionInputSchema, Wn as artifactExtractionResultSchema, Wt as traceDylibLoading, Yt as init_artifactInspection, zt as keyedArchiveResultSchema } from "./toolOutputSchemaGroups-ChxVLGoy.js";
5
+ import { c as jsonValueSchema, o as init_jsonValue } from "./digests-Dugt3H71.js";
6
+ import { S as init_evidence, _ as createEvidence, dt as init_binaryTargetTypes, ft as isMachOFormat, i as interfaceBuilderLimitsSchema, n as init_interfaceBuilderGraph, t as buildInterfaceBuilderAnalysis } from "./interfaceBuilderGraph-BOKqQzjK.js";
7
+ import { i as init_AnalysisProvider, n as init_providerCleanupError, r as createAnalysisExecution, t as ProviderCleanupError } from "./providerCleanupError-DvE79aUX.js";
8
+ import { x as init_ExecFileOutput, y as execFileOutput } from "./ProcessOwnership-nOFZsmD3.js";
9
+ import { r as init_unicodeCodePointOrder, t as compareUnicodeCodePoints } from "./unicodeCodePointOrder-BezCbTpg.js";
10
+ import { n as init_artifactOperationError, t as ArtifactOperationError } from "./artifactOperationError-B_jxO8at.js";
11
+ import { O as init_InvestigationProviders, a as preflightPropertyListDecode, f as ARTIFACT_GRAPH_PROVIDER, i as init_InterfaceBuilderDecodeBudget, n as InterfaceBuilderDecodeBudgetExceeded, o as decodeXmlPlistText, r as estimateBinaryPlistExpansion, s as init_propertyListXmlText, t as InterfaceBuilderDecodeBudget } from "./InterfaceBuilderDecodeBudget-CUrOtfNo.js";
12
+ import { a as parseXmlPropertyList, i as omittedPrototypeKeysLimitation, n as init_propertyListKeys, t as decodeXmlText } from "./propertyListKeys-cX-BUv2y.js";
13
+ import { a as init_artifactToolContracts, i as artifactInventoryInputSchema, l as init_inputIssueProjection, r as artifactExtractionExecutionSchema, t as ARTIFACT_ANALYSIS_OPERATIONS, u as projectInputIssues } from "./artifactToolContracts-TXegBBr1.js";
14
+ import { n as init_ArtifactProviderMetadata, t as artifactCapabilities } from "./ArtifactProviderMetadata--hy-wyJK.js";
15
+ import { n as init_canonicalDigest, t as digestCanonicalValue } from "./canonicalDigest-Bi_0_zGi.js";
16
+ import { a as sameArtifactSourceIdentity, r as init_ArtifactReader, t as ArtifactReaderFailure } from "./ArtifactReader-OyM03Gjn.js";
17
+ import { n as init_ArtifactResourceScope, t as ArtifactResourceScope } from "./ArtifactResourceScope-CBR5q4aK.js";
18
+ import { C as init_ArtifactPaths, E as init_ZipArtifactReader, T as ZipArtifactReader, _ as SafeOutputTreeCreationFailure, a as hasMachoMagic, c as abortIfNeeded, d as DirectoryArtifactReader, f as init_DirectoryArtifactReader, g as init_SafeOutputTree, h as SafeOutputTree, i as init_MachOSliceArtifactReader, m as init_AsarArtifactReader, n as scanCanonicalArtifactInventoryInScope, o as init_MachoLoadCommandReader, p as AsarArtifactReader, r as MachOSliceArtifactReader, s as readMachoImage, t as init_scanCanonical, u as init_ArtifactHash, v as init_SafeOutputTreeCreationFailure, w as normalizeArtifactPath, x as ArtifactPathRegistry } from "./scanCanonical-2GN0h-BE.js";
19
+ import { n as projectPlistValue, t as init_plistValue } from "./plistValue-DsU7z4yF.js";
20
+ import { constants } from "node:fs";
21
+ import { basename, dirname, join, relative, sep } from "node:path";
22
+ import { z } from "zod";
23
+ import { lstat, open, readlink, realpath } from "node:fs/promises";
24
+ import { TextDecoder } from "node:util";
25
+ import { createHash } from "node:crypto";
26
+ import { parseBinary } from "plist";
27
+
28
+ //#region dist/domain/apple/plistNumbers.js
29
+ var createPlistNumberProjection;
30
+ function init_plistNumbers() {
31
+ return (init_plistNumbers = __esmMin((() => {
32
+ createPlistNumberProjection = (literals) => {
33
+ let exactIntegerCount = 0;
34
+ let ambiguousNumberCount = 0;
35
+ const mapNumber = (item) => {
36
+ if (Number.isSafeInteger(item) || !Number.isInteger(item)) return item;
37
+ if (literals.incomplete) {
38
+ ambiguousNumberCount += 1;
39
+ return item;
40
+ }
41
+ const decimals = literals.integers.get(item);
42
+ if (decimals === undefined) {
43
+ if (!literals.reals.has(item)) ambiguousNumberCount += 1;
44
+ return item;
45
+ }
46
+ const [decimal] = decimals;
47
+ if (decimals.size !== 1 || decimal === undefined || literals.reals.has(item)) {
48
+ ambiguousNumberCount += 1;
49
+ return item;
50
+ }
51
+ exactIntegerCount += 1;
52
+ return {
53
+ $plist_type: "integer",
54
+ decimal
55
+ };
56
+ };
57
+ const map = (item) => {
58
+ if (typeof item === "number") return mapNumber(item);
59
+ if (Array.isArray(item)) return item.map(map);
60
+ if (item !== null && typeof item === "object") {
61
+ const keys = Object.keys(item);
62
+ const marker = item[keys[0] ?? ""];
63
+ const reference = keys.length === 1 && (keys[0] === "UID" || keys[0] === "CF$UID") && typeof marker === "number";
64
+ if (reference) {
65
+ if (typeof marker === "number" && !Number.isSafeInteger(marker) && (literals.integers.has(marker) || !literals.reals.has(marker))) ambiguousNumberCount += 1;
66
+ return item;
67
+ }
68
+ return Object.fromEntries(Object.entries(item).map(([key, child]) => [key, map(child)]));
69
+ }
70
+ return item;
71
+ };
72
+ return {
73
+ project: map,
74
+ limitations: () => [
75
+ ...literals.incomplete ? ["Original archive number metadata could not be completely observed; decoded numbers may lose integer precision and exact integer/real association is unavailable."] : [],
76
+ ...literals.unsafeIntegerLiterals === 0 ? [] : [`${String(literals.unsafeIntegerLiterals)} observed integer literal(s) in the original archive exceed the exact range of a JSON number. Decoded numbers may lose integer precision unless represented as { "$plist_type": "integer", "decimal": "<exact digits>" }; the original archive bytes retain those literals.`],
77
+ ...exactIntegerCount === 0 ? [] : [`${String(exactIntegerCount)} unambiguous integer value(s) are reported with exact decimal text as { "$plist_type": "integer", "decimal": "<exact digits>" }.`],
78
+ ...ambiguousNumberCount === 0 ? [] : [`${String(ambiguousNumberCount)} number(s) beyond the exact integer range remain as decoded because their source integer/real type or reference marker cannot be associated unambiguously; integer precision loss remains possible.`]
79
+ ]
80
+ };
81
+ };
82
+ })))();
83
+ }
84
+
85
+ //#endregion
86
+ //#region dist/artifacts/apple/PlistNumberLiterals.js
87
+ var collector, XML_TOKEN, OPAQUE_ELEMENTS, xmlPlistNumberLiterals, binaryPlistNumberLiterals;
88
+ function init_PlistNumberLiterals() {
89
+ return (init_PlistNumberLiterals = __esmMin((() => {
90
+ init_propertyListKeys();
91
+ collector = () => {
92
+ const integers = new Map();
93
+ const reals = new Set();
94
+ let unsafeIntegerLiterals = 0;
95
+ let incompleteMetadata = false;
96
+ return {
97
+ integer: (literal) => {
98
+ if (!/^[+-]?\d+$/u.test(literal)) {
99
+ incompleteMetadata = true;
100
+ return;
101
+ }
102
+ const exact = BigInt(literal);
103
+ if (exact >= BigInt(Number.MIN_SAFE_INTEGER) && exact <= BigInt(Number.MAX_SAFE_INTEGER)) return;
104
+ unsafeIntegerLiterals += 1;
105
+ const rounded = Number(exact);
106
+ integers.set(rounded, (integers.get(rounded) ?? new Set()).add(exact.toString()));
107
+ },
108
+ real: (value) => {
109
+ reals.add(value);
110
+ },
111
+ markIncomplete: () => {
112
+ incompleteMetadata = true;
113
+ },
114
+ result: (incomplete = false) => ({
115
+ incomplete: incomplete || incompleteMetadata,
116
+ integers,
117
+ reals,
118
+ unsafeIntegerLiterals
119
+ })
120
+ };
121
+ };
122
+ XML_TOKEN = /<!--[\s\S]*?-->|<!\[CDATA\[[\s\S]*?\]\]>|<(?:[^>"']|"[^"]*"|'[^']*')*>/gu;
123
+ OPAQUE_ELEMENTS = new Set([
124
+ "string",
125
+ "key",
126
+ "data",
127
+ "date"
128
+ ]);
129
+ xmlPlistNumberLiterals = (xml) => {
130
+ const output = collector();
131
+ const elements = [];
132
+ let number;
133
+ let cursor = 0;
134
+ for (const match of xml.matchAll(XML_TOKEN)) {
135
+ const index = match.index;
136
+ if (number !== undefined) number.text += xml.slice(cursor, index);
137
+ const token = match[0];
138
+ cursor = index + token.length;
139
+ if (token.startsWith("<!--") || token.startsWith("<![CDATA[")) {
140
+ if (number !== undefined) {
141
+ number.plainText = false;
142
+ output.markIncomplete();
143
+ }
144
+ continue;
145
+ }
146
+ const tag = /^<\s*(\/?)\s*([\w:-]+)/u.exec(token);
147
+ if (tag === null) {
148
+ if (number !== undefined) {
149
+ number.plainText = false;
150
+ output.markIncomplete();
151
+ }
152
+ continue;
153
+ }
154
+ const closing = tag[1] === "/";
155
+ const name = tag[2];
156
+ if (name === undefined) continue;
157
+ if (closing) {
158
+ if (number !== undefined && number.kind === name && number.depth === elements.length) {
159
+ if (number.plainText) {
160
+ const text = decodeXmlText(number.text).trim();
161
+ if (number.kind === "integer") output.integer(text);
162
+ else output.real(Number.parseFloat(text));
163
+ }
164
+ number = undefined;
165
+ }
166
+ elements.pop();
167
+ continue;
168
+ }
169
+ if (number !== undefined) {
170
+ number.plainText = false;
171
+ output.markIncomplete();
172
+ }
173
+ if (/\/\s*>$/u.test(token)) continue;
174
+ if (number === undefined && (name === "integer" || name === "real") && !elements.some((parent) => OPAQUE_ELEMENTS.has(parent))) number = {
175
+ kind: name,
176
+ text: "",
177
+ depth: elements.length + 1,
178
+ plainText: true
179
+ };
180
+ elements.push(name);
181
+ }
182
+ return output.result();
183
+ };
184
+ binaryPlistNumberLiterals = (bytes) => {
185
+ const output = collector();
186
+ if (bytes.length < 40 || bytes.subarray(0, 8).toString("ascii") !== "bplist00") return output.result(true);
187
+ const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
188
+ const trailer = bytes.length - 32;
189
+ const offsetWidth = bytes[trailer + 6] ?? 0;
190
+ if (![
191
+ 1,
192
+ 2,
193
+ 4,
194
+ 8
195
+ ].includes(offsetWidth)) return output.result(true);
196
+ const countRaw = view.getBigUint64(trailer + 8);
197
+ const tableRaw = view.getBigUint64(trailer + 24);
198
+ const safeMaximum = BigInt(Number.MAX_SAFE_INTEGER);
199
+ if (countRaw === 0n || countRaw > safeMaximum || tableRaw > safeMaximum) return output.result(true);
200
+ if (tableRaw < 8n || tableRaw >= BigInt(trailer)) return output.result(true);
201
+ const offsetTable = Number(tableRaw);
202
+ const capacity = Math.floor((trailer - offsetTable) / offsetWidth);
203
+ if (countRaw > BigInt(capacity)) return output.result(true);
204
+ const count = Number(countRaw);
205
+ const unsigned = (offset) => {
206
+ if (offset < offsetTable || offset + offsetWidth > trailer) return undefined;
207
+ if (offsetWidth === 1) return view.getUint8(offset);
208
+ if (offsetWidth === 2) return view.getUint16(offset);
209
+ if (offsetWidth === 4) return view.getUint32(offset);
210
+ const value = view.getBigUint64(offset);
211
+ return value > safeMaximum ? undefined : Number(value);
212
+ };
213
+ for (let index = 0; index < count; index += 1) {
214
+ const offset = unsigned(offsetTable + index * offsetWidth);
215
+ if (offset === undefined || offset < 8 || offset >= offsetTable) return output.result(true);
216
+ const marker = bytes[offset] ?? 0;
217
+ const type = marker >> 4;
218
+ if (type !== 1 && type !== 2) continue;
219
+ const width = 2 ** (marker & 15);
220
+ if (offset + 1 + width > offsetTable) return output.result(true);
221
+ if (type === 1 && width === 8) output.integer(view.getBigInt64(offset + 1).toString());
222
+ else if (type === 1 && width > 4) return output.result(true);
223
+ else if (type === 2 && width === 4) output.real(view.getFloat32(offset + 1));
224
+ else if (type === 2 && width === 8) output.real(view.getFloat64(offset + 1));
225
+ else if (type === 2) return output.result(true);
226
+ }
227
+ return output.result();
228
+ };
229
+ })))();
230
+ }
231
+
232
+ //#endregion
233
+ //#region dist/artifacts/apple/KeyedArchiveReader.js
234
+ var MAX_BYTES, MAX_DECODE_BYTES, decodeKeyedArchiveBytes, keyedArchiveKindRemediation, inspectBundleKeyedArchive, archivePathError;
235
+ function init_KeyedArchiveReader() {
236
+ return (init_KeyedArchiveReader = __esmMin((() => {
237
+ init_analysisErrorCore();
238
+ init_plistValue();
239
+ init_plistNumbers();
240
+ init_PlistNumberLiterals();
241
+ init_propertyListKeys();
242
+ init_keyedArchive();
243
+ init_DirectoryArtifactReader();
244
+ init_ArtifactReader();
245
+ init_propertyListXmlText();
246
+ init_InterfaceBuilderDecodeBudget();
247
+ MAX_BYTES = 64 * 1024 * 1024;
248
+ MAX_DECODE_BYTES = 8 * MAX_BYTES;
249
+ decodeKeyedArchiveBytes = (bytes, selection) => {
250
+ if (bytes.length > MAX_BYTES) throw new RangeError("Keyed archive exceeds 64 MiB");
251
+ if (bytes.subarray(0, 10).toString("ascii") === "NIBArchive") throw new KeyedArchiveKindError("Selected file is a compiled NIBArchive, not a Foundation plist archive; decode it with decode_interface_builder", "nib-archive");
252
+ const binary = bytes.subarray(0, 8).toString("ascii") === "bplist00";
253
+ const xmlText = binary ? undefined : decodeXmlPlistText(bytes);
254
+ const binaryExpansion = binary ? estimateBinaryPlistExpansion(bytes, MAX_DECODE_BYTES, {
255
+ budget: "the keyed archive decode budget",
256
+ fail: (kind, message) => kind === "cycle" ? new TypeError("binary plist object references form a cycle, which a property list cannot represent") : new RangeError(message),
257
+ bounds: "decoder"
258
+ }) : undefined;
259
+ const parsed = binaryExpansion !== undefined ? {
260
+ value: parseBinary(bytes),
261
+ omittedPrototypeKeys: binaryExpansion.binaryPrototypeKeyObserved ? null : 0
262
+ } : parseXmlPropertyList(xmlText ?? "");
263
+ const { value: plistValue, unknownRealCount } = projectPlistValue(parsed.value);
264
+ const graph = projectKeyedArchive(plistValue, selection);
265
+ const numbers = createPlistNumberProjection(binary ? binaryPlistNumberLiterals(bytes) : xmlPlistNumberLiterals(xmlText ?? ""));
266
+ const roots = Object.fromEntries(Object.entries(graph.roots).map(([name, value]) => [name, numbers.project(value)]));
267
+ const objects = graph.objects.map((object) => ({
268
+ ...object,
269
+ value: numbers.project(object.value)
270
+ }));
271
+ return {
272
+ archive_format: binary ? "binary-plist" : "xml-plist",
273
+ ...graph,
274
+ roots,
275
+ objects,
276
+ limitations: [
277
+ ...graph.limitations,
278
+ ...numbers.limitations(),
279
+ ...parsed.omittedPrototypeKeys === 0 ? [] : [omittedPrototypeKeysLimitation(parsed.omittedPrototypeKeys)],
280
+ ...unknownRealCount === 0 ? [] : [`${String(unknownRealCount)} non-finite real value(s) are reported as { "$plist_type": "real", "value": null } because JSON evidence cannot preserve NaN vs infinity.`]
281
+ ]
282
+ };
283
+ };
284
+ keyedArchiveKindRemediation = (kind, platform) => {
285
+ if (kind === "nib-archive") return "Decode compiled NIBArchive files with decode_interface_builder on the app bundle.";
286
+ return platform === "darwin" ? "Inspect an ordinary property list with inspect_plist; inspect_keyed_archive decodes NSKeyedArchiver archives only." : "Select an NSKeyedArchiver archive; inspect_keyed_archive decodes only those. inspect_plist, which reads ordinary property lists, requires a macOS host.";
287
+ };
288
+ inspectBundleKeyedArchive = async (input) => {
289
+ const selected = keyedArchiveInputSchema.parse(input.parameters);
290
+ if (selected.path.startsWith("/") || selected.path.split("/").some((part) => part === ".." || part === "." || part.length === 0)) throw archivePathError("invalid_format", selected.path === "." ? "Select a keyed archive path relative to the active app bundle." : `Archive path must be a canonical relative bundle path without empty, '.', or '..' segments: ${selected.path}`);
291
+ const reader = new DirectoryArtifactReader(input.bundlePath);
292
+ try {
293
+ const wanted = selected.path.normalize("NFC");
294
+ let entry;
295
+ for await (const candidate of reader.entries(input.signal, (directory) => wanted.startsWith(`${directory.normalize("NFC")}/`))) {
296
+ if (candidate.path.normalize("NFC") !== wanted) continue;
297
+ if (candidate.kind !== "file") throw archivePathError("invalid_value", `Archive path selects a ${candidate.kind}, not a regular file: ${selected.path}`);
298
+ if ((candidate.declaredSize ?? 0) > MAX_BYTES) throw new ArtifactReaderFailure("limit", "Keyed archive exceeds 64 MiB");
299
+ if (entry !== undefined) throw archivePathError("invalid_value", `Archive path matches multiple Unicode-equivalent bundle entries; selection is ambiguous: ${selected.path}`);
300
+ entry = candidate;
301
+ }
302
+ if (entry === undefined) throw archivePathError("invalid_value", `No regular file exists at ${selected.path} in the active app bundle.`);
303
+ const stream = await reader.open(entry, input.signal);
304
+ const chunks = [];
305
+ let size = 0;
306
+ for await (const chunk of stream) {
307
+ if (input.signal?.aborted) {
308
+ stream.destroy();
309
+ throw new ArtifactReaderFailure("cancelled", "Archive inspection cancelled");
310
+ }
311
+ const bytes = z.instanceof(Buffer).parse(chunk);
312
+ size += bytes.length;
313
+ if (size > MAX_BYTES) {
314
+ stream.destroy();
315
+ throw new ArtifactReaderFailure("limit", "Keyed archive exceeds 64 MiB");
316
+ }
317
+ chunks.push(bytes);
318
+ }
319
+ const bytes = Buffer.concat(chunks, size);
320
+ try {
321
+ return keyedArchiveResultSchema.parse({
322
+ target_sha256: input.targetSha256,
323
+ archive_path: entry.path,
324
+ archive_sha256: createHash("sha256").update(bytes).digest("hex"),
325
+ ...decodeKeyedArchiveBytes(bytes, selected)
326
+ });
327
+ } catch (cause) {
328
+ if (cause instanceof AnalysisInputError) throw cause;
329
+ if (cause instanceof KeyedArchiveKindError) throw new AnalysisUnsupportedTargetError("inspect_keyed_archive", join(input.bundlePath, entry.path), cause.message, {
330
+ cause,
331
+ remediationAction: keyedArchiveKindRemediation(cause.kind, input.platform ?? process.platform)
332
+ });
333
+ throw new ArtifactReaderFailure(cause instanceof RangeError ? "limit" : "format", `Cannot decode selected Foundation keyed archive: ${cause instanceof Error ? cause.message : String(cause)}`, { cause });
334
+ }
335
+ } finally {
336
+ await reader.close();
337
+ }
338
+ };
339
+ archivePathError = (reason, message) => new AnalysisInputError("inspect_keyed_archive", undefined, [{
340
+ path: ["path"],
341
+ reason,
342
+ message
343
+ }]);
344
+ })))();
345
+ }
346
+
347
+ //#endregion
348
+ //#region dist/artifacts/apple/DylibResolutionReader.js
349
+ var OPERATION, HASH_CHUNK_BYTES, FilesystemTreeView, traceDylibResolution, executableRoots, compare, requireMachoRoots, startsWithMachoMagic, identityOf, readImage, fileSha256, cancelled, deniedPath, permissionDenied, missing;
350
+ function init_DylibResolutionReader() {
351
+ return (init_DylibResolutionReader = __esmMin((() => {
352
+ init_analysisErrorCore();
353
+ init_dyldPaths();
354
+ init_dylibResolution();
355
+ init_inputIssueProjection();
356
+ init_ArtifactReader();
357
+ init_DirectoryArtifactReader();
358
+ init_MachoLoadCommandReader();
359
+ OPERATION = "trace_dylib_resolution";
360
+ HASH_CHUNK_BYTES = 1024 * 1024;
361
+ FilesystemTreeView = class {
362
+ root;
363
+ signal;
364
+ #entries = new Map();
365
+ #images = new Map();
366
+ #identities = new Map();
367
+ constructor(root, signal) {
368
+ this.root = root;
369
+ this.signal = signal;
370
+ }
371
+ entry(path) {
372
+ const cached = this.#entries.get(path);
373
+ if (cached !== undefined) return cached;
374
+ const pending = this.#readEntry(path);
375
+ this.#entries.set(path, pending);
376
+ return pending;
377
+ }
378
+ image(path) {
379
+ const cached = this.#images.get(path);
380
+ if (cached !== undefined) return cached;
381
+ const pending = readImage(join(this.root, path), this.signal).then(({ facts, identity }) => {
382
+ this.#identities.set(path, identity);
383
+ return facts;
384
+ });
385
+ this.#images.set(path, pending);
386
+ return pending;
387
+ }
388
+ /** Identity of the file whose header bytes `image()` parsed. */
389
+ identity(path) {
390
+ return this.#identities.get(path);
391
+ }
392
+ async #readEntry(path) {
393
+ cancelled(this.signal);
394
+ const absolute = join(this.root, path);
395
+ try {
396
+ const metadata = await lstat(absolute);
397
+ if (metadata.isSymbolicLink()) return {
398
+ kind: "symlink",
399
+ target: await readlink(absolute)
400
+ };
401
+ if (metadata.isDirectory()) return { kind: "directory" };
402
+ return metadata.isFile() ? { kind: "file" } : undefined;
403
+ } catch (cause) {
404
+ if (missing(cause)) return undefined;
405
+ throw cause;
406
+ }
407
+ }
408
+ };
409
+ traceDylibResolution = async (options) => {
410
+ const parsed = dylibResolutionInputSchema.safeParse(options.parameters);
411
+ if (!parsed.success) throw new AnalysisInputError(OPERATION, { cause: parsed.error }, projectInputIssues(parsed.error.issues, options.parameters));
412
+ let root = options.rootPath;
413
+ try {
414
+ root = await realpath(options.rootPath);
415
+ const target = relative(root, await realpath(options.targetPath)).split(sep).join("/");
416
+ const view = new FilesystemTreeView(root, options.signal);
417
+ const { roots: requested, unclassified } = parsed.data.roots !== undefined ? {
418
+ roots: parsed.data.roots,
419
+ unclassified: []
420
+ } : options.enumerateRoots ? await executableRoots(root, view, options.signal) : {
421
+ roots: [target],
422
+ unclassified: []
423
+ };
424
+ const roots = await requireMachoRoots(view, requested, parsed.data.roots !== undefined);
425
+ const trace = await traceDylibLoading(view, {
426
+ roots,
427
+ unclassified,
428
+ ...parsed.data.architecture === undefined ? {} : { architecture: parsed.data.architecture },
429
+ ...options.signal === undefined ? {} : { signal: options.signal }
430
+ });
431
+ const digests = new Map();
432
+ for (const { path } of trace.images) digests.set(path, await fileSha256(join(root, path), {
433
+ path,
434
+ expected: view.identity(path),
435
+ ...options.signal === undefined ? {} : { signal: options.signal }
436
+ }));
437
+ const targetDigest = digests.get(target) ?? await fileSha256(join(root, target), {
438
+ path: target,
439
+ expected: undefined,
440
+ ...options.signal === undefined ? {} : { signal: options.signal }
441
+ });
442
+ if (targetDigest !== options.targetSha256) throw new ArtifactReaderFailure("integrity", `Active target digest changed: expected ${options.targetSha256}, observed ${targetDigest}`);
443
+ return dylibResolutionResultSchema.parse({
444
+ ...trace,
445
+ root_path: options.rootPath,
446
+ target_sha256: options.targetSha256,
447
+ images: trace.images.map((image) => ({
448
+ ...image,
449
+ sha256: digests.get(image.path)
450
+ }))
451
+ });
452
+ } catch (cause) {
453
+ if (options.signal?.aborted === true) throw new ArtifactReaderFailure("cancelled", "Dylib resolution was cancelled", { cause });
454
+ const denied = permissionDenied(cause);
455
+ if (denied !== undefined) throw new ArtifactReaderFailure("unavailable", `Permission denied (${denied.code}) reading ${deniedPath(root, denied.path)}`, { cause });
456
+ throw cause;
457
+ }
458
+ };
459
+ executableRoots = async (root, view, signal) => {
460
+ const roots = [];
461
+ const unclassified = [];
462
+ for await (const entry of new DirectoryArtifactReader(root).entries(signal)) {
463
+ if (entry.kind !== "file" || !await startsWithMachoMagic(entry.adapterKey)) continue;
464
+ const facts = await view.image(entry.path);
465
+ if (facts.status === "malformed" || facts.status === "unsupported") unclassified.push(entry.path);
466
+ else if (facts.status === "parsed" && facts.slices.some(({ file_type: type }) => type === "execute")) roots.push(entry.path);
467
+ }
468
+ return {
469
+ roots: roots.sort(compare),
470
+ unclassified: unclassified.sort(compare)
471
+ };
472
+ };
473
+ compare = (left, right) => left < right ? -1 : left > right ? 1 : 0;
474
+ requireMachoRoots = async (view, roots, callerSelected) => {
475
+ const resolved = [];
476
+ for (const [index, path] of roots.entries()) {
477
+ const reject = (reason, message) => callerSelected ? new AnalysisInputError(OPERATION, undefined, [{
478
+ path: ["roots", index],
479
+ reason: "invalid_value",
480
+ message
481
+ }]) : new ArtifactReaderFailure(reason, message);
482
+ const lookup = await resolveTreePath(view, path);
483
+ if (lookup.kind === "escapes") throw reject("path", `Root ${path} resolves outside the analyzed root`);
484
+ if (lookup.kind !== "file") throw reject("path", `Root ${path} is not a regular file in the analyzed root`);
485
+ if ((await view.image(lookup.path)).status === "not-mach-o") throw reject("format", `Root ${path} is not a Mach-O image`);
486
+ if (!resolved.includes(lookup.path)) resolved.push(lookup.path);
487
+ }
488
+ return resolved;
489
+ };
490
+ startsWithMachoMagic = async (path) => {
491
+ const handle = await open(path, constants.O_RDONLY | constants.O_NOFOLLOW);
492
+ try {
493
+ const buffer = new Uint8Array(4);
494
+ const { bytesRead } = await handle.read(buffer, 0, 4, 0);
495
+ return hasMachoMagic(buffer.subarray(0, bytesRead));
496
+ } finally {
497
+ await handle.close();
498
+ }
499
+ };
500
+ identityOf = (metadata) => [
501
+ metadata.dev,
502
+ metadata.ino,
503
+ metadata.size,
504
+ metadata.mtimeNs,
505
+ metadata.ctimeNs
506
+ ].join(":");
507
+ readImage = async (path, signal) => {
508
+ cancelled(signal);
509
+ const handle = await open(path, constants.O_RDONLY | constants.O_NOFOLLOW);
510
+ try {
511
+ const metadata = await handle.stat({ bigint: true });
512
+ const size = Number(metadata.size);
513
+ const facts = await readMachoImage(async (offset, length) => {
514
+ cancelled(signal);
515
+ const buffer = new Uint8Array(Math.max(0, Math.min(length, size - offset)));
516
+ const { bytesRead } = await handle.read(buffer, 0, buffer.length, offset);
517
+ return buffer.subarray(0, bytesRead);
518
+ }, size);
519
+ return {
520
+ facts,
521
+ identity: identityOf(metadata)
522
+ };
523
+ } finally {
524
+ await handle.close();
525
+ }
526
+ };
527
+ fileSha256 = async (absolute, options) => {
528
+ const { signal } = options;
529
+ const handle = await open(absolute, constants.O_RDONLY | constants.O_NOFOLLOW);
530
+ const unchanged = async () => {
531
+ if (options.expected !== undefined && identityOf(await handle.stat({ bigint: true })) !== options.expected) throw new ArtifactReaderFailure("integrity", `${options.path} changed while its dyld load commands were traced`);
532
+ };
533
+ try {
534
+ await unchanged();
535
+ const hash = createHash("sha256");
536
+ const buffer = new Uint8Array(HASH_CHUNK_BYTES);
537
+ for (;;) {
538
+ cancelled(signal);
539
+ const { bytesRead } = await handle.read(buffer, 0, buffer.length, null);
540
+ if (bytesRead === 0) break;
541
+ hash.update(buffer.subarray(0, bytesRead));
542
+ }
543
+ await unchanged();
544
+ return hash.digest("hex");
545
+ } finally {
546
+ await handle.close();
547
+ }
548
+ };
549
+ cancelled = (signal) => {
550
+ if (signal?.aborted === true) throw new ArtifactReaderFailure("cancelled", "Dylib resolution was cancelled");
551
+ };
552
+ deniedPath = (root, path) => {
553
+ if (path === undefined) return "a file in the analyzed root";
554
+ const inside = relative(root, path);
555
+ return inside === "" || inside.startsWith("..") ? path : inside;
556
+ };
557
+ permissionDenied = (cause) => {
558
+ if (!(cause instanceof Error) || !("code" in cause)) return undefined;
559
+ if (cause.code !== "EACCES" && cause.code !== "EPERM") return undefined;
560
+ return {
561
+ code: cause.code,
562
+ path: "path" in cause && typeof cause.path === "string" ? cause.path : undefined
563
+ };
564
+ };
565
+ missing = (cause) => cause instanceof Error && "code" in cause && (cause.code === "ENOENT" || cause.code === "ENOTDIR");
566
+ })))();
567
+ }
568
+
569
+ //#endregion
570
+ //#region dist/artifacts/inventory/ArtifactInventory.js
571
+ var inventoryArtifact, scanArtifactInventory, scanArtifactInventoryInScope;
572
+ function init_ArtifactInventory() {
573
+ return (init_ArtifactInventory = __esmMin((() => {
574
+ init_artifactGraph();
575
+ init_ArtifactHash();
576
+ init_scanCanonical();
577
+ inventoryArtifact = async (inputPath, options) => {
578
+ const snapshot = await scanArtifactInventory(inputPath, options);
579
+ return artifactInventoryResultSchema.parse(snapshot);
580
+ };
581
+ scanArtifactInventory = async (inputPath, options) => options.resourceScope.run(() => scanArtifactInventoryInScope(inputPath, options));
582
+ scanArtifactInventoryInScope = async (inputPath, options) => {
583
+ abortIfNeeded(options.signal);
584
+ const path = await realpath(inputPath);
585
+ return scanCanonicalArtifactInventoryInScope(path, options);
586
+ };
587
+ })))();
588
+ }
589
+
590
+ //#endregion
591
+ //#region dist/artifacts/extraction/ArtifactExtraction.js
592
+ var extractArtifact, extractArtifactInScope, materializeArtifactInventory, materializeArtifactInventoryInScope, materializeSelection, writeSelectedEntries, releaseExtractionOwners, createExtractionResult, ZIP_FORMATS, isZipFormat, requireExtractableFormat, createReader, preflight;
593
+ function init_ArtifactExtraction() {
594
+ return (init_ArtifactExtraction = __esmMin((() => {
595
+ init_unicodeCodePointOrder();
596
+ init_canonicalDigest();
597
+ init_AsarArtifactReader();
598
+ init_ArtifactPaths();
599
+ init_ArtifactReader();
600
+ init_ArtifactHash();
601
+ init_DirectoryArtifactReader();
602
+ init_SafeOutputTree();
603
+ init_SafeOutputTreeCreationFailure();
604
+ init_ZipArtifactReader();
605
+ init_MachOSliceArtifactReader();
606
+ init_artifactGraph();
607
+ init_analysisErrorCore();
608
+ init_binaryTargetTypes();
609
+ init_ArtifactInventory();
610
+ extractArtifact = async (input, signal) => input.resourceScope.run(() => extractArtifactInScope(input, signal));
611
+ extractArtifactInScope = async (input, signal) => {
612
+ abortIfNeeded(signal);
613
+ const sourcePath = await realpath(input.inputPath);
614
+ await requireExtractableFormat(sourcePath, input);
615
+ const snapshot = await scanArtifactInventoryInScope(sourcePath, {
616
+ resourceScope: input.resourceScope,
617
+ signal,
618
+ environment: input.environment,
619
+ integrity: { mode: input.integrityPolicy }
620
+ });
621
+ return materializeArtifactInventoryInScope(input, sourcePath, snapshot, signal);
622
+ };
623
+ materializeArtifactInventory = async (input, sourcePath, snapshot, signal) => {
624
+ return input.resourceScope.run(() => materializeArtifactInventoryInScope(input, sourcePath, snapshot, signal));
625
+ };
626
+ materializeArtifactInventoryInScope = async (input, sourcePath, snapshot, signal) => {
627
+ abortIfNeeded(signal);
628
+ const selectedOccurrences = snapshot.occurrences.filter((occurrence) => (occurrence.entry_kind === "file" || occurrence.entry_kind === "slice") && occurrence.logical_path !== ".");
629
+ const regularPaths = new Set(selectedOccurrences.map(({ logical_path: path }) => path));
630
+ const activeOccurrences = selectedOccurrences.filter(({ logical_path }) => {
631
+ let path = logical_path;
632
+ for (let slash = path.lastIndexOf("/"); slash >= 0; slash = path.lastIndexOf("/")) {
633
+ path = path.slice(0, slash);
634
+ if (regularPaths.has(path)) return false;
635
+ }
636
+ return true;
637
+ });
638
+ const selectedIds = new Set(activeOccurrences.map(({ occurrence_id: id }) => id));
639
+ const neededNodes = new Set(activeOccurrences.map(({ artifact_id: id }) => id));
640
+ const nodes = new Map();
641
+ for (const node of snapshot.nodes) if (neededNodes.has(node.artifact_id)) nodes.set(node.artifact_id, node);
642
+ const inventory = {
643
+ manifest: snapshot.manifest,
644
+ integrityContradictions: snapshot.integrity_contradictions.filter(({ occurrence_id: id }) => selectedIds.has(id))
645
+ };
646
+ const selected = activeOccurrences.map((occurrence) => {
647
+ if (occurrence.encrypted) throw new AnalysisUnsupportedTargetError("extract_artifact", input.inputPath, `Archive entry ${occurrence.logical_path} is encrypted; REA does not decrypt archive entries, so the archive cannot be extracted completely`);
648
+ if (occurrence.entry_kind === "file" && occurrence.artifact_id === null && occurrence.hash_status === "unavailable") throw new ArtifactReaderFailure("unavailable", `ASAR unpacked companion bytes are unavailable for ${occurrence.logical_path}`, undefined, {
649
+ logicalPath: occurrence.logical_path,
650
+ declaredSha256: null,
651
+ calculatedSha256: null,
652
+ unpacked: true
653
+ });
654
+ if (occurrence.entry_kind !== "file" && occurrence.entry_kind !== "slice" || occurrence.artifact_id === null || occurrence.logical_path === ".") throw new ArtifactReaderFailure("format", `Selected occurrence is not an extractable regular child file: ${occurrence.logical_path} (${occurrence.occurrence_id})`);
655
+ const node = nodes.get(occurrence.artifact_id);
656
+ if (node === undefined) throw new ArtifactReaderFailure("integrity", `Selected occurrence has no inventory node: ${occurrence.occurrence_id}`);
657
+ return {
658
+ occurrence,
659
+ node
660
+ };
661
+ });
662
+ return materializeSelection({
663
+ input,
664
+ sourcePath,
665
+ inventory,
666
+ selected,
667
+ signal
668
+ });
669
+ };
670
+ materializeSelection = async ({ input, sourcePath, inventory, selected, signal }) => {
671
+ const byPath = new Map(selected.map((item) => [item.occurrence.logical_path, item]));
672
+ const reader = await createReader(sourcePath, input);
673
+ const readerOwner = {
674
+ kind: "reader",
675
+ reader,
676
+ resource: `artifact reader for ${sourcePath}`
677
+ };
678
+ let localReaderOwner = readerOwner;
679
+ let output;
680
+ let completed;
681
+ const extracted = [];
682
+ try {
683
+ try {
684
+ output = await SafeOutputTree.create(input.outputRoot);
685
+ } catch (cause) {
686
+ if (cause instanceof SafeOutputTreeCreationFailure) output = cause.tree;
687
+ throw cause;
688
+ }
689
+ await writeSelectedEntries({
690
+ reader,
691
+ output,
692
+ byPath,
693
+ extracted,
694
+ signal
695
+ });
696
+ localReaderOwner = undefined;
697
+ const closeAttempt = await input.resourceScope.release(readerOwner);
698
+ if (closeAttempt.kind === "failed") throw ArtifactReaderFailure.withCleanup(closeAttempt.cause, ArtifactReaderFailure.cleanupObservation(closeAttempt.cause, readerOwner.resource));
699
+ extracted.sort((left, right) => compareUnicodeCodePoints(left.relative_path, right.relative_path));
700
+ completed = createExtractionResult(input, inventory, selected, extracted);
701
+ await output.commit();
702
+ return completed;
703
+ } catch (cause) {
704
+ const cleanupFailures = await releaseExtractionOwners(input.resourceScope, localReaderOwner, output, input.outputRoot);
705
+ if (cleanupFailures.length > 0) {
706
+ const observations = cleanupFailures.map(({ cause: cleanupCause, resource }) => ArtifactReaderFailure.cleanupObservation(cleanupCause, resource));
707
+ throw ArtifactReaderFailure.withCleanup(cause, {
708
+ reason: observations.map(({ reason }) => reason).join("; "),
709
+ resources: [...new Set(observations.flatMap(({ resources }) => resources))]
710
+ }, output?.published === true && completed !== undefined ? {
711
+ kind: "artifact-extraction",
712
+ extraction: completed
713
+ } : undefined);
714
+ }
715
+ if (output?.published === true && completed !== undefined) return completed;
716
+ throw cause;
717
+ }
718
+ };
719
+ writeSelectedEntries = async ({ reader, output, byPath, extracted, signal }) => {
720
+ const registry = new ArtifactPathRegistry();
721
+ for await (const entry of reader.entries(signal)) {
722
+ const path = normalizeArtifactPath(entry.path);
723
+ registry.add(path, entry.kind);
724
+ const selectedItem = byPath.get(path);
725
+ if (selectedItem === undefined) {
726
+ if (entry.kind === "file" || entry.kind === "slice") throw new ArtifactReaderFailure("integrity", `Regular artifact entry is missing from inventory: ${path}`);
727
+ continue;
728
+ }
729
+ preflight(entry);
730
+ const stream = await reader.open(entry, signal);
731
+ const written = await output.write(path, stream, {
732
+ sha256: selectedItem.node.sha256,
733
+ bytes: selectedItem.node.size
734
+ }, signal);
735
+ extracted.push({
736
+ artifact_id: selectedItem.node.artifact_id,
737
+ relative_path: written.relativePath,
738
+ sha256: written.sha256,
739
+ bytes_written: written.bytesWritten,
740
+ created: true
741
+ });
742
+ byPath.delete(path);
743
+ }
744
+ if (byPath.size > 0) throw new ArtifactReaderFailure("integrity", `Inventoried regular artifact entries were not materialized: ${[...byPath.keys()].sort(compareUnicodeCodePoints).join(", ")}`);
745
+ };
746
+ releaseExtractionOwners = async (resourceScope, readerOwner, output, outputRoot) => {
747
+ const failures = [];
748
+ if (readerOwner !== undefined) {
749
+ const attempt = await resourceScope.release(readerOwner);
750
+ if (attempt.kind === "failed") failures.push({
751
+ cause: attempt.cause,
752
+ resource: readerOwner.resource
753
+ });
754
+ }
755
+ if (output !== undefined) {
756
+ const owner = {
757
+ kind: "output-tree",
758
+ tree: output,
759
+ resource: outputRoot
760
+ };
761
+ const attempt = await resourceScope.release(owner);
762
+ if (attempt.kind === "failed") failures.push({
763
+ cause: attempt.cause,
764
+ resource: owner.resource
765
+ });
766
+ }
767
+ return failures;
768
+ };
769
+ createExtractionResult = (input, inventory, selected, extracted) => {
770
+ const extractionSemantic = {
771
+ source_manifest_id: inventory.manifest.manifest_id,
772
+ selected_occurrence_ids: selected.map(({ occurrence }) => occurrence.occurrence_id).sort(compareUnicodeCodePoints),
773
+ files_sha256: digestCanonicalValue(extracted, "Artifact"),
774
+ output_root_alias: "$OUTPUT_ROOT"
775
+ };
776
+ return artifactExtractionResultSchema.parse({
777
+ manifest: inventory.manifest,
778
+ extraction_manifest: {
779
+ ...extractionSemantic,
780
+ extraction_id: `aex_${digestCanonicalValue(extractionSemantic, "Artifact")}`
781
+ },
782
+ output_root: input.outputRoot,
783
+ artifacts: extracted,
784
+ containment_verified: true,
785
+ cleanup: {
786
+ attempted: false,
787
+ verified: true,
788
+ residual_paths: []
789
+ },
790
+ provenance: [],
791
+ integrity_contradictions: inventory.integrityContradictions,
792
+ limitations: ["All regular files in the active artifact were materialized; nested archive contents remain represented by their containing file.", ...inventory.integrityContradictions.length === 0 ? [] : [`${String(inventory.integrityContradictions.length)} extracted file(s) contradict declared integrity metadata; their bytes are observed-untrusted.`]]
793
+ });
794
+ };
795
+ ZIP_FORMATS = [
796
+ "ipa",
797
+ "apk",
798
+ "msix",
799
+ "appx",
800
+ "zip"
801
+ ];
802
+ isZipFormat = (format) => ZIP_FORMATS.includes(format);
803
+ requireExtractableFormat = async (path, input) => {
804
+ const format = input.inputFormat;
805
+ const directory = (await lstat(path)).isDirectory();
806
+ if (!directory && format !== "asar" && !isMachOFormat(format) && !isZipFormat(format)) throw new AnalysisUnsupportedTargetError("extract_artifact", input.inputPath, `Artifact format has no extraction reader: ${format}`);
807
+ return directory;
808
+ };
809
+ createReader = async (path, input) => {
810
+ const format = input.inputFormat;
811
+ if (await requireExtractableFormat(path, input)) return new DirectoryArtifactReader(path);
812
+ if (format === "asar") return new AsarArtifactReader(path);
813
+ if (isZipFormat(format)) return new ZipArtifactReader(path, format);
814
+ return new MachOSliceArtifactReader(path, input.environment);
815
+ };
816
+ preflight = (entry) => {
817
+ if (entry.kind !== "file" && entry.kind !== "slice" || entry.encrypted) throw new ArtifactReaderFailure("format", `Selected artifact entry cannot be read: ${entry.path}`);
818
+ };
819
+ })))();
820
+ }
821
+
822
+ //#endregion
823
+ //#region dist/artifacts/apple/NibArchive.js
824
+ var MAGIC, DEFAULT_DECODE_BUDGET_BYTES, decodeNibArchive, parseObjects, preflightProjectedFieldCount, parseStrings, parseClasses, parseValues, readValue, skipValue, valueIndexes, readCount, readOffset, readU32, decodeUtf8, readVarint, checkedEnd, ensureRange, assertOrderedOffsets;
825
+ function init_NibArchive() {
826
+ return (init_NibArchive = __esmMin((() => {
827
+ init_InterfaceBuilderDecodeBudget();
828
+ MAGIC = Buffer.from("NIBArchive", "ascii");
829
+ DEFAULT_DECODE_BUDGET_BYTES = 128 * 1024 * 1024;
830
+ decodeNibArchive = (bytes, budget = new InterfaceBuilderDecodeBudget(DEFAULT_DECODE_BUDGET_BYTES)) => {
831
+ if (bytes.length < 50 || !bytes.subarray(0, MAGIC.length).equals(MAGIC)) throw new TypeError("NIBArchive magic or header is invalid");
832
+ const formatVersion = readU32(bytes, 10);
833
+ const coderVersion = readU32(bytes, 14);
834
+ if (formatVersion !== 1) throw new TypeError(`Unsupported NIBArchive format version ${formatVersion}`);
835
+ const objectCount = readCount(bytes, 18, "object");
836
+ const objectsOffset = readOffset(bytes, 22, bytes.length, "object");
837
+ const keyCount = readCount(bytes, 26, "key");
838
+ const keysOffset = readOffset(bytes, 30, bytes.length, "key");
839
+ const valueCount = readCount(bytes, 34, "value");
840
+ const valuesOffset = readOffset(bytes, 38, bytes.length, "value");
841
+ const classCount = readCount(bytes, 42, "class");
842
+ const classesOffset = readOffset(bytes, 46, bytes.length, "class");
843
+ assertOrderedOffsets(bytes.length, [
844
+ objectsOffset,
845
+ keysOffset,
846
+ valuesOffset,
847
+ classesOffset
848
+ ]);
849
+ const projectedFieldCount = preflightProjectedFieldCount(bytes, objectsOffset, keysOffset, objectCount, valueCount, classCount, budget.remainingBytes);
850
+ budget.reserve(objectCount * 96 + projectedFieldCount * 96, "NIBArchive object and projected field counts exceed the aggregate Interface Builder decode budget");
851
+ const objectRecords = parseObjects(bytes, objectsOffset, keysOffset, objectCount, valueCount, classCount);
852
+ const keys = parseStrings(bytes, keysOffset, valuesOffset, keyCount, "key", budget);
853
+ const classes = parseClasses(bytes, classesOffset, bytes.length, classCount, budget);
854
+ const neededValues = valueIndexes(objectRecords, valueCount);
855
+ const values = parseValues(bytes, valuesOffset, classesOffset, valueCount, keyCount, neededValues, budget);
856
+ for (const { value } of values.values()) {
857
+ if (typeof value === "object" && value !== null && !Array.isArray(value) && typeof value.$nib_object_ref === "number" && value.$nib_object_ref >= objectCount) throw new TypeError("NIBArchive object reference is outside the object table");
858
+ }
859
+ const objects = objectRecords.flatMap((object, id) => {
860
+ const className = classes[object.class_index];
861
+ if (className === undefined) return [];
862
+ const fields = {};
863
+ for (let index = object.value_start; index < object.value_start + object.value_count; index += 1) {
864
+ const value = values.get(index);
865
+ if (value === undefined) continue;
866
+ const key = keys[value.key_index];
867
+ if (key !== undefined) fields[key] = value.value;
868
+ }
869
+ return [{
870
+ id,
871
+ class_name: className,
872
+ values: fields
873
+ }];
874
+ });
875
+ let connectionObjectCount = 0;
876
+ for (const object of objects) if (/(?:Outlet|Connection|Segue|ActionConnection)/iu.test(object.class_name)) connectionObjectCount += 1;
877
+ return {
878
+ format_version: formatVersion,
879
+ coder_version: coderVersion,
880
+ object_count: objectCount,
881
+ connection_object_count: connectionObjectCount,
882
+ objects,
883
+ classes,
884
+ limitations: ["NIBArchive class extensions and unsupported value encodings are retained as unavailable fields.", "NIBArchive object relationships are decoded from serialized references; runtime object creation and execution are not performed."]
885
+ };
886
+ };
887
+ parseObjects = (bytes, start, end, count, valueCount, classCount) => {
888
+ const cursor = { offset: start };
889
+ const output = [];
890
+ for (let index = 0; index < count; index += 1) {
891
+ const classIndex = readVarint(bytes, cursor, end);
892
+ const valueStart = readVarint(bytes, cursor, end);
893
+ const countForObject = readVarint(bytes, cursor, end);
894
+ if (classIndex >= classCount || valueStart > valueCount || countForObject > valueCount - valueStart) throw new TypeError(`NIBArchive object ${index} references an invalid table range`);
895
+ output.push({
896
+ class_index: classIndex,
897
+ value_start: valueStart,
898
+ value_count: countForObject
899
+ });
900
+ }
901
+ if (cursor.offset > end) throw new TypeError("NIBArchive object table overlaps the next table");
902
+ return output;
903
+ };
904
+ preflightProjectedFieldCount = (bytes, start, end, objectCount, valueCount, classCount, maxBytes) => {
905
+ if (objectCount * 96 > maxBytes) throw new InterfaceBuilderDecodeBudgetExceeded("aggregate_decode_budget_exhausted", "NIBArchive object count exceeds the aggregate Interface Builder decode budget");
906
+ const cursor = { offset: start };
907
+ let projectedFields = 0;
908
+ for (let index = 0; index < objectCount; index += 1) {
909
+ const classIndex = readVarint(bytes, cursor, end);
910
+ const valueStart = readVarint(bytes, cursor, end);
911
+ const fieldCount = readVarint(bytes, cursor, end);
912
+ if (classIndex >= classCount || valueStart > valueCount || fieldCount > valueCount - valueStart) throw new TypeError(`NIBArchive object ${index} references an invalid table range`);
913
+ projectedFields += fieldCount;
914
+ if (!Number.isSafeInteger(projectedFields) || projectedFields * 96 > maxBytes - objectCount * 96) throw new InterfaceBuilderDecodeBudgetExceeded("aggregate_decode_budget_exhausted", "NIBArchive projected field ranges exceed the aggregate Interface Builder decode budget");
915
+ }
916
+ return projectedFields;
917
+ };
918
+ parseStrings = (bytes, start, end, count, label, budget) => {
919
+ const cursor = { offset: start };
920
+ const output = [];
921
+ for (let index = 0; index < count; index += 1) {
922
+ const length = readVarint(bytes, cursor, end);
923
+ const next = checkedEnd(cursor.offset, length, end, `${label} ${index}`);
924
+ budget.reserve(32 + length * 2, `NIBArchive ${label} strings exceed the aggregate Interface Builder decode budget`);
925
+ const value = decodeUtf8(bytes, cursor.offset, next, `${label} ${index}`);
926
+ cursor.offset = next;
927
+ output.push(value);
928
+ }
929
+ return output;
930
+ };
931
+ parseClasses = (bytes, start, end, count, budget) => {
932
+ const cursor = { offset: start };
933
+ const output = [];
934
+ for (let index = 0; index < count; index += 1) {
935
+ const length = readVarint(bytes, cursor, end);
936
+ const extraCount = readVarint(bytes, cursor, end);
937
+ if (extraCount > 16) throw new TypeError(`NIBArchive class ${index} has too many extension values`);
938
+ ensureRange(cursor.offset, extraCount * 4, end, `class ${index} extensions`);
939
+ cursor.offset += extraCount * 4;
940
+ const next = checkedEnd(cursor.offset, length, end, `class ${index}`);
941
+ budget.reserve(32 + length * 2, "NIBArchive class names exceed the aggregate Interface Builder decode budget");
942
+ const name = decodeUtf8(bytes, cursor.offset, next, `class ${index}`).replace(/\0+$/u, "");
943
+ cursor.offset = next;
944
+ output.push(name);
945
+ }
946
+ return output;
947
+ };
948
+ parseValues = (bytes, start, end, count, keyCount, needed, budget) => {
949
+ const cursor = { offset: start };
950
+ const output = new Map();
951
+ for (let index = 0; index < count; index += 1) {
952
+ const keyIndex = readVarint(bytes, cursor, end);
953
+ if (keyIndex >= keyCount) throw new TypeError(`NIBArchive value ${index} references an invalid key`);
954
+ ensureRange(cursor.offset, 1, end, `value ${index} type`);
955
+ const type = bytes[cursor.offset++] ?? -1;
956
+ if (!needed.has(index)) {
957
+ skipValue(bytes, cursor, end, type, index);
958
+ continue;
959
+ }
960
+ budget.reserve(64, "NIBArchive decoded values exceed the aggregate Interface Builder decode budget");
961
+ const value = readValue(bytes, cursor, end, type, index, budget);
962
+ output.set(index, {
963
+ key_index: keyIndex,
964
+ value
965
+ });
966
+ }
967
+ if (cursor.offset > end) throw new TypeError("NIBArchive value table overlaps the next table");
968
+ return output;
969
+ };
970
+ readValue = (bytes, cursor, end, type, index, budget) => {
971
+ switch (type) {
972
+ case 0:
973
+ ensureRange(cursor.offset, 1, end, `value ${index}`);
974
+ return bytes.readInt8(cursor.offset++);
975
+ case 1:
976
+ ensureRange(cursor.offset, 2, end, `value ${index}`);
977
+ {
978
+ const value = bytes.readInt16LE(cursor.offset);
979
+ cursor.offset += 2;
980
+ return value;
981
+ }
982
+ case 2:
983
+ ensureRange(cursor.offset, 4, end, `value ${index}`);
984
+ {
985
+ const value = bytes.readInt32LE(cursor.offset);
986
+ cursor.offset += 4;
987
+ return value;
988
+ }
989
+ case 3:
990
+ ensureRange(cursor.offset, 8, end, `value ${index}`);
991
+ {
992
+ const value = bytes.readBigInt64LE(cursor.offset);
993
+ cursor.offset += 8;
994
+ return value <= BigInt(Number.MAX_SAFE_INTEGER) && value >= BigInt(Number.MIN_SAFE_INTEGER) ? Number(value) : value.toString();
995
+ }
996
+ case 4: return true;
997
+ case 5: return false;
998
+ case 6:
999
+ ensureRange(cursor.offset, 4, end, `value ${index}`);
1000
+ {
1001
+ const value = bytes.readFloatLE(cursor.offset);
1002
+ cursor.offset += 4;
1003
+ return Number.isFinite(value) ? value : null;
1004
+ }
1005
+ case 7:
1006
+ ensureRange(cursor.offset, 8, end, `value ${index}`);
1007
+ {
1008
+ const value = bytes.readDoubleLE(cursor.offset);
1009
+ cursor.offset += 8;
1010
+ return Number.isFinite(value) ? value : null;
1011
+ }
1012
+ case 8: {
1013
+ const length = readVarint(bytes, cursor, end);
1014
+ const next = checkedEnd(cursor.offset, length, end, `value ${index} data`);
1015
+ budget.reserve(32 + 4 * Math.ceil(length / 3), `NIBArchive data value ${index} exceeds the aggregate Interface Builder decode budget`);
1016
+ const encoded = bytes.subarray(cursor.offset, next).toString("base64");
1017
+ cursor.offset = next;
1018
+ return { $nib_data_base64: encoded };
1019
+ }
1020
+ case 9: return null;
1021
+ case 10:
1022
+ ensureRange(cursor.offset, 4, end, `value ${index} reference`);
1023
+ {
1024
+ const objectIndex = bytes.readUInt32LE(cursor.offset);
1025
+ cursor.offset += 4;
1026
+ return { $nib_object_ref: objectIndex };
1027
+ }
1028
+ default: throw new TypeError(`NIBArchive value ${index} has unsupported type ${type}`);
1029
+ }
1030
+ };
1031
+ skipValue = (bytes, cursor, end, type, index) => {
1032
+ switch (type) {
1033
+ case 0:
1034
+ ensureRange(cursor.offset, 1, end, `value ${index}`);
1035
+ cursor.offset += 1;
1036
+ return;
1037
+ case 1:
1038
+ ensureRange(cursor.offset, 2, end, `value ${index}`);
1039
+ cursor.offset += 2;
1040
+ return;
1041
+ case 2:
1042
+ case 10:
1043
+ ensureRange(cursor.offset, 4, end, `value ${index}`);
1044
+ cursor.offset += 4;
1045
+ return;
1046
+ case 3:
1047
+ case 7:
1048
+ ensureRange(cursor.offset, 8, end, `value ${index}`);
1049
+ cursor.offset += 8;
1050
+ return;
1051
+ case 6:
1052
+ ensureRange(cursor.offset, 4, end, `value ${index}`);
1053
+ cursor.offset += 4;
1054
+ return;
1055
+ case 4:
1056
+ case 5:
1057
+ case 9: return;
1058
+ case 8: {
1059
+ const length = readVarint(bytes, cursor, end);
1060
+ cursor.offset = checkedEnd(cursor.offset, length, end, `value ${index} data`);
1061
+ return;
1062
+ }
1063
+ default: throw new TypeError(`NIBArchive value ${index} has unsupported type ${type}`);
1064
+ }
1065
+ };
1066
+ valueIndexes = (objects, total) => {
1067
+ const indexes = new Set();
1068
+ for (const object of objects) for (let index = object.value_start; index < object.value_start + object.value_count; index += 1) indexes.add(index);
1069
+ if (indexes.size > total) throw new TypeError("NIBArchive object value ranges exceed the value table");
1070
+ return indexes;
1071
+ };
1072
+ readCount = (bytes, offset, label) => {
1073
+ const count = readU32(bytes, offset);
1074
+ if (count > bytes.length) throw new TypeError(`NIBArchive ${label} count exceeds the archive length`);
1075
+ return count;
1076
+ };
1077
+ readOffset = (bytes, offset, fileLength, label) => {
1078
+ const value = readU32(bytes, offset);
1079
+ if (value < 50 || value > fileLength) throw new TypeError(`NIBArchive ${label} table offset is invalid`);
1080
+ return value;
1081
+ };
1082
+ readU32 = (bytes, offset) => {
1083
+ ensureRange(offset, 4, bytes.length, "header");
1084
+ return bytes.readUInt32LE(offset);
1085
+ };
1086
+ decodeUtf8 = (bytes, start, end, label) => {
1087
+ try {
1088
+ return new TextDecoder("utf-8", { fatal: true }).decode(bytes.subarray(start, end));
1089
+ } catch (cause) {
1090
+ throw new TypeError(`NIBArchive ${label} is not valid UTF-8`, { cause });
1091
+ }
1092
+ };
1093
+ readVarint = (bytes, cursor, end) => {
1094
+ let value = 0;
1095
+ let shift = 0;
1096
+ for (let index = 0; index < 5; index += 1) {
1097
+ ensureRange(cursor.offset, 1, end, "variable integer");
1098
+ const byte = bytes[cursor.offset++] ?? 0;
1099
+ value += (byte & 127) * 2 ** shift;
1100
+ if ((byte & 128) !== 0) {
1101
+ if (value > 2147483647) throw new TypeError("NIBArchive variable integer is out of range");
1102
+ return value;
1103
+ }
1104
+ shift += 7;
1105
+ }
1106
+ throw new TypeError("NIBArchive variable integer is too long");
1107
+ };
1108
+ checkedEnd = (start, length, limit, label) => {
1109
+ if (!Number.isSafeInteger(length) || length < 0 || start + length > limit) throw new TypeError(`NIBArchive ${label} exceeds its table`);
1110
+ return start + length;
1111
+ };
1112
+ ensureRange = (start, length, limit, label) => {
1113
+ checkedEnd(start, length, limit, label);
1114
+ };
1115
+ assertOrderedOffsets = (length, offsets) => {
1116
+ let previous = 50;
1117
+ for (const offset of offsets) {
1118
+ if (offset < previous || offset > length) throw new TypeError("NIBArchive table offsets are out of order");
1119
+ previous = offset;
1120
+ }
1121
+ };
1122
+ })))();
1123
+ }
1124
+
1125
+ //#endregion
1126
+ //#region dist/artifacts/apple/NibViewHierarchy.js
1127
+ var projectNibViewHierarchy, mergeNibHierarchies, wouldCycle, reference, collectNibParents, invalidReference;
1128
+ function init_NibViewHierarchy() {
1129
+ return (init_NibViewHierarchy = __esmMin((() => {
1130
+ projectNibViewHierarchy = (objects, retainedIds, reserveNode = () => true, maxNodes = 2e4) => {
1131
+ const { parents, involved, invalid } = collectNibParents(objects, retainedIds);
1132
+ if (parents.size === 0) return {
1133
+ hierarchy: null,
1134
+ omitted: invalid
1135
+ };
1136
+ const children = new Map();
1137
+ for (const [child, parent] of parents) {
1138
+ if (!retainedIds.has(parent) || !retainedIds.has(child)) continue;
1139
+ const siblings = children.get(parent) ?? [];
1140
+ siblings.push(child);
1141
+ children.set(parent, siblings);
1142
+ }
1143
+ const roots = [];
1144
+ const pending = [];
1145
+ for (const id of involved) if (!parents.has(id)) pending.push({
1146
+ id,
1147
+ depth: 0,
1148
+ output: roots
1149
+ });
1150
+ const visited = new Set();
1151
+ while (pending.length > 0) {
1152
+ const item = pending.pop();
1153
+ if (item === undefined) break;
1154
+ if (visited.has(item.id) || item.depth > 128 || visited.size >= maxNodes || !reserveNode()) continue;
1155
+ visited.add(item.id);
1156
+ const node = {
1157
+ objectID: String(item.id),
1158
+ children: []
1159
+ };
1160
+ item.output.push(node);
1161
+ for (const child of [...children.get(item.id) ?? []].reverse()) pending.push({
1162
+ id: child,
1163
+ depth: item.depth + 1,
1164
+ output: node.children
1165
+ });
1166
+ }
1167
+ return {
1168
+ hierarchy: roots,
1169
+ omitted: involved.size - visited.size + invalid
1170
+ };
1171
+ };
1172
+ mergeNibHierarchies = (legacy, recovered, reserveNode = () => true, maxNodes = 2e4) => {
1173
+ const existing = new Map();
1174
+ const owners = new Map();
1175
+ const parents = new Map();
1176
+ const pending = legacy.map((node) => ({
1177
+ node,
1178
+ output: legacy,
1179
+ parent: null
1180
+ }));
1181
+ while (pending.length > 0) {
1182
+ const entry = pending.pop();
1183
+ if (entry === undefined || existing.has(entry.node.objectID)) continue;
1184
+ existing.set(entry.node.objectID, entry.node);
1185
+ owners.set(entry.node.objectID, entry.output);
1186
+ if (entry.parent !== null) parents.set(entry.node.objectID, entry.parent);
1187
+ pending.push(...entry.node.children.map((node) => ({
1188
+ node,
1189
+ output: entry.node.children,
1190
+ parent: entry.node.objectID
1191
+ })));
1192
+ }
1193
+ let omitted = 0;
1194
+ const additions = recovered.map((node) => ({
1195
+ node,
1196
+ output: legacy,
1197
+ parent: null
1198
+ }));
1199
+ while (additions.length > 0) {
1200
+ const entry = additions.pop();
1201
+ if (entry === undefined) break;
1202
+ let target = existing.get(entry.node.objectID);
1203
+ if (target === undefined) {
1204
+ if (existing.size >= maxNodes || !reserveNode()) {
1205
+ omitted += 1;
1206
+ continue;
1207
+ }
1208
+ target = {
1209
+ objectID: entry.node.objectID,
1210
+ children: []
1211
+ };
1212
+ existing.set(target.objectID, target);
1213
+ entry.output.push(target);
1214
+ owners.set(target.objectID, entry.output);
1215
+ if (entry.parent !== null) parents.set(target.objectID, entry.parent);
1216
+ } else if (entry.parent !== null && owners.get(target.objectID) !== entry.output) {
1217
+ const owner = owners.get(target.objectID);
1218
+ if (owner !== legacy || wouldCycle(target.objectID, entry.parent, parents)) {
1219
+ omitted += 1;
1220
+ } else {
1221
+ owner.splice(owner.indexOf(target), 1);
1222
+ entry.output.push(target);
1223
+ owners.set(target.objectID, entry.output);
1224
+ parents.set(target.objectID, entry.parent);
1225
+ }
1226
+ }
1227
+ for (const node of [...entry.node.children].reverse()) additions.push({
1228
+ node,
1229
+ output: target.children,
1230
+ parent: target.objectID
1231
+ });
1232
+ }
1233
+ return {
1234
+ hierarchy: legacy,
1235
+ omitted
1236
+ };
1237
+ };
1238
+ wouldCycle = (child, parent, parents) => {
1239
+ const seen = new Set();
1240
+ let current = parent;
1241
+ while (current !== undefined && !seen.has(current)) {
1242
+ if (current === child) return true;
1243
+ seen.add(current);
1244
+ current = parents.get(current);
1245
+ }
1246
+ return false;
1247
+ };
1248
+ reference = (value) => {
1249
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return null;
1250
+ return typeof value.$nib_object_ref === "number" ? value.$nib_object_ref : null;
1251
+ };
1252
+ collectNibParents = (objects, retainedIds) => {
1253
+ const parents = new Map();
1254
+ const involved = new Set();
1255
+ let invalid = 0;
1256
+ for (const object of objects) {
1257
+ if (!retainedIds.has(object.id)) continue;
1258
+ const child = reference(object.values.NSWindowView);
1259
+ if (object.class_name.replace(/\0+$/u, "") === "NSWindowTemplate" && invalidReference(object.values.NSWindowView)) invalid += 1;
1260
+ if (object.class_name.replace(/\0+$/u, "") === "NSWindowTemplate" && child !== null) {
1261
+ parents.set(child, object.id);
1262
+ involved.add(object.id);
1263
+ involved.add(child);
1264
+ }
1265
+ const parent = reference(object.values.NSSuperview);
1266
+ if (invalidReference(object.values.NSSuperview)) invalid += 1;
1267
+ if (parent === null) continue;
1268
+ parents.set(object.id, parent);
1269
+ involved.add(object.id);
1270
+ if (retainedIds.has(parent)) involved.add(parent);
1271
+ }
1272
+ return {
1273
+ parents,
1274
+ involved,
1275
+ invalid
1276
+ };
1277
+ };
1278
+ invalidReference = (value) => value !== undefined && value !== null && reference(value) === null;
1279
+ })))();
1280
+ }
1281
+
1282
+ //#endregion
1283
+ //#region dist/artifacts/apple/InterfaceBuilderAnalysis.js
1284
+ var MAX_AGGREGATE_INPUT_BYTES, MAX_AGGREGATE_DECODE_BYTES, MAX_REPORTED_OMITTED_ARCHIVES, analyzeInterfaceBuilderBundle, selectInterfaceBuilderCandidates, retainCandidate, finalizeHierarchyCoverage, projectNibArchive, isInterfaceBuilderArchive, readEntry, decodePlist;
1285
+ function init_InterfaceBuilderAnalysis() {
1286
+ return (init_InterfaceBuilderAnalysis = __esmMin((() => {
1287
+ init_DirectoryArtifactReader();
1288
+ init_plistValue();
1289
+ init_propertyListKeys();
1290
+ init_NibArchive();
1291
+ init_InterfaceBuilderDecodeBudget();
1292
+ init_interfaceBuilderGraph();
1293
+ init_NibViewHierarchy();
1294
+ init_jsonValue();
1295
+ init_unicodeCodePointOrder();
1296
+ init_propertyListXmlText();
1297
+ MAX_AGGREGATE_INPUT_BYTES = 32 * 1024 * 1024;
1298
+ MAX_AGGREGATE_DECODE_BYTES = 256 * 1024 * 1024;
1299
+ MAX_REPORTED_OMITTED_ARCHIVES = 64;
1300
+ analyzeInterfaceBuilderBundle = async (input) => {
1301
+ const limits = interfaceBuilderLimitsSchema.parse(input.limits ?? {});
1302
+ const reader = new DirectoryArtifactReader(input.bundlePath);
1303
+ const documents = [];
1304
+ const invalid = [];
1305
+ const omittedArchives = [];
1306
+ let unreportedOmittedArchives = 0;
1307
+ const incompleteHierarchies = new Map();
1308
+ const prototypeKeyOmissions = new Map();
1309
+ let omitted = 0;
1310
+ let attempted = 0;
1311
+ let aggregateInputBytes = 0;
1312
+ const decodeBudget = new InterfaceBuilderDecodeBudget(MAX_AGGREGATE_DECODE_BYTES);
1313
+ const recordOmittedArchive = (path, reason) => {
1314
+ if (omittedArchives.length < MAX_REPORTED_OMITTED_ARCHIVES) omittedArchives.push({
1315
+ path,
1316
+ reason
1317
+ });
1318
+ else unreportedOmittedArchives += 1;
1319
+ };
1320
+ try {
1321
+ const selection = await selectInterfaceBuilderCandidates(reader, input.signal, limits.max_documents);
1322
+ omitted = selection.omitted;
1323
+ for (const entry of selection.omittedSamples) recordOmittedArchive(entry.path, "max_documents");
1324
+ unreportedOmittedArchives += selection.unreportedOmitted;
1325
+ for (const entry of selection.selected) {
1326
+ try {
1327
+ const remainingInputBytes = MAX_AGGREGATE_INPUT_BYTES - aggregateInputBytes;
1328
+ if (entry.declaredSize !== null && entry.declaredSize > remainingInputBytes) {
1329
+ omitted += 1;
1330
+ recordOmittedArchive(entry.path, "aggregate_decode_budget_exhausted");
1331
+ continue;
1332
+ }
1333
+ attempted += 1;
1334
+ const bytes = await readEntry(reader, entry, input.signal, remainingInputBytes);
1335
+ aggregateInputBytes += bytes.length;
1336
+ const isNibArchive = bytes.subarray(0, 10).toString("ascii") === "NIBArchive";
1337
+ let nib = null;
1338
+ let xmlText;
1339
+ let binaryPrototypeKeyObserved = false;
1340
+ if (isNibArchive) {
1341
+ const documentBudget = new InterfaceBuilderDecodeBudget(decodeBudget.remainingBytes);
1342
+ nib = projectNibArchive(decodeNibArchive(bytes, documentBudget), documentBudget, limits.max_objects);
1343
+ decodeBudget.reserve(documentBudget.usedBytes, "NIBArchive representation exceeds the aggregate Interface Builder decode budget");
1344
+ } else {
1345
+ if (bytes.subarray(0, 8).toString("ascii") !== "bplist00") xmlText = decodeXmlPlistText(bytes);
1346
+ const decodedReservation = preflightPropertyListDecode(bytes, decodeBudget.remainingBytes, xmlText);
1347
+ decodeBudget.reserve(decodedReservation.estimatedBytes, "plist representation exceeds the aggregate Interface Builder decode budget");
1348
+ binaryPrototypeKeyObserved = decodedReservation.binaryPrototypeKeyObserved;
1349
+ }
1350
+ const { value: raw, omittedPrototypeKeys } = nib === null ? decodePlist(bytes, xmlText, binaryPrototypeKeyObserved) : {
1351
+ value: nib.raw,
1352
+ omittedPrototypeKeys: 0
1353
+ };
1354
+ if (nib !== null && nib.omitted > 0) incompleteHierarchies.set(entry.path, nib.omitted);
1355
+ if (omittedPrototypeKeys !== 0) prototypeKeyOmissions.set(entry.path, omittedPrototypeKeys);
1356
+ const documentHash = createHash("sha256").update(bytes).digest("hex");
1357
+ documents.push({
1358
+ relativePath: entry.path,
1359
+ archiveSha256: documentHash,
1360
+ documentKind: entry.path.includes(".storyboardc/") ? "storyboard_scene" : "nib",
1361
+ raw
1362
+ });
1363
+ } catch (cause) {
1364
+ if (input.signal?.aborted === true) throw cause;
1365
+ if (cause instanceof InterfaceBuilderDecodeBudgetExceeded) {
1366
+ omitted += 1;
1367
+ recordOmittedArchive(entry.path, cause.reason);
1368
+ continue;
1369
+ }
1370
+ invalid.push(`${entry.path}: ${cause instanceof Error ? cause.message : "archive decode failed"}`);
1371
+ }
1372
+ }
1373
+ } finally {
1374
+ await reader.close();
1375
+ }
1376
+ const result = buildInterfaceBuilderAnalysis({
1377
+ targetSha256: input.targetSha256,
1378
+ toolVersion: "rea-interface-builder/1",
1379
+ documents,
1380
+ limits
1381
+ });
1382
+ return finalizeHierarchyCoverage(result, {
1383
+ incompleteHierarchies,
1384
+ prototypeKeyOmissions,
1385
+ invalid,
1386
+ omittedArchives,
1387
+ unreportedOmittedArchives,
1388
+ attempted,
1389
+ omitted
1390
+ });
1391
+ };
1392
+ selectInterfaceBuilderCandidates = async (reader, signal, maximumDocuments) => {
1393
+ const capacity = maximumDocuments + MAX_REPORTED_OMITTED_ARCHIVES;
1394
+ const candidates = [];
1395
+ let total = 0;
1396
+ for await (const entry of reader.entries(signal)) {
1397
+ if (entry.kind !== "file" || !isInterfaceBuilderArchive(entry.path)) continue;
1398
+ total += 1;
1399
+ retainCandidate(candidates, entry, capacity);
1400
+ }
1401
+ const omittedSamples = candidates.slice(maximumDocuments, capacity);
1402
+ return {
1403
+ selected: candidates.slice(0, maximumDocuments),
1404
+ omittedSamples,
1405
+ omitted: Math.max(0, total - maximumDocuments),
1406
+ unreportedOmitted: Math.max(0, total - maximumDocuments - omittedSamples.length)
1407
+ };
1408
+ };
1409
+ retainCandidate = (candidates, entry, maximum) => {
1410
+ let low = 0;
1411
+ let high = candidates.length;
1412
+ while (low < high) {
1413
+ const middle = Math.floor((low + high) / 2);
1414
+ const existing = candidates[middle];
1415
+ if (existing !== undefined && compareUnicodeCodePoints(existing.path, entry.path) < 0) low = middle + 1;
1416
+ else high = middle;
1417
+ }
1418
+ candidates.splice(low, 0, entry);
1419
+ if (candidates.length > maximum) candidates.pop();
1420
+ };
1421
+ finalizeHierarchyCoverage = (result, counts) => {
1422
+ const { incompleteHierarchies, prototypeKeyOmissions, invalid, omittedArchives, unreportedOmittedArchives } = counts;
1423
+ const archiveDecodePartial = invalid.length > 0 || prototypeKeyOmissions.size > 0 || omittedArchives.length > 0;
1424
+ return {
1425
+ ...result,
1426
+ documents: result.documents.map((document) => ({
1427
+ ...document,
1428
+ hierarchy_complete: document.hierarchy_complete && !incompleteHierarchies.has(document.relative_path)
1429
+ })),
1430
+ graph: {
1431
+ ...result.graph,
1432
+ coverage: [...result.graph.coverage.map((facet) => {
1433
+ const omitted = incompleteHierarchies.get(facet.facet.replace(/^hierarchy:/u, ""));
1434
+ return facet.facet.startsWith("hierarchy:") && omitted !== undefined ? {
1435
+ ...facet,
1436
+ status: "partial",
1437
+ reason: "serialized_view_hierarchy_incomplete",
1438
+ omitted: facet.omitted + omitted
1439
+ } : facet;
1440
+ }), {
1441
+ facet: "archive_decode",
1442
+ status: archiveDecodePartial ? "partial" : "complete",
1443
+ reason: omittedArchives.some(({ reason }) => reason === "aggregate_decode_budget_exhausted") ? "aggregate_decode_budget_exhausted" : omittedArchives.some(({ reason }) => reason === "max_documents") ? "document_limit_reached" : omittedArchives.length > 0 ? "archive_decode_budget_exhausted" : invalid.length > 0 ? "one_or_more_archives_invalid" : prototypeKeyOmissions.size > 0 ? "dictionary_entries_omitted" : null,
1444
+ examined: counts.attempted,
1445
+ omitted: counts.omitted
1446
+ }],
1447
+ truncated: result.graph.truncated || counts.omitted > 0 || archiveDecodePartial || incompleteHierarchies.size > 0
1448
+ },
1449
+ limitations: [
1450
+ ...result.limitations,
1451
+ "Compiled Interface Builder archives are private serialized object graphs. The decoder reports only recognized keyed-archive objects and connections; unrecognized object classes and fields remain unknown.",
1452
+ ...incompleteHierarchies.size === 0 ? [] : ["Some serialized hierarchy links could not be projected within the bounded hierarchy; their parentage remains unknown."],
1453
+ ...invalid.length === 0 ? [] : [`Some Interface Builder archives could not be decoded: ${invalid.slice(0, 16).join("; ")}`],
1454
+ ...[...prototypeKeyOmissions].map(([path, count]) => `${path}: ${omittedPrototypeKeysLimitation(count)}`),
1455
+ ...omittedArchives.map(({ path, reason }) => `${path}: omitted because ${reason.replaceAll("_", " ")}.`),
1456
+ ...unreportedOmittedArchives === 0 ? [] : [`${unreportedOmittedArchives} additional omitted archive path(s) and their reasons were not retained; reporting is bounded to ${MAX_REPORTED_OMITTED_ARCHIVES} paths.`]
1457
+ ]
1458
+ };
1459
+ };
1460
+ projectNibArchive = (archive, budget, maxHierarchyNodes) => {
1461
+ const byId = new Map(archive.objects.map((object) => [object.id, object]));
1462
+ const normalizedClassNames = new Map();
1463
+ const normalizeClassName = (value) => {
1464
+ const known = normalizedClassNames.get(value);
1465
+ if (known !== undefined) return known;
1466
+ const normalized = value.replace(/\0+$/u, "");
1467
+ normalizedClassNames.set(value, normalized);
1468
+ return normalized;
1469
+ };
1470
+ const decodedStrings = new Map();
1471
+ const decodedString = (objectId, object) => {
1472
+ if (decodedStrings.has(objectId)) return decodedStrings.get(objectId) ?? null;
1473
+ const data = object.values["NS.bytes"];
1474
+ if (typeof data !== "object" || data === null || Array.isArray(data)) {
1475
+ decodedStrings.set(objectId, null);
1476
+ return null;
1477
+ }
1478
+ const encoded = data.$nib_data_base64;
1479
+ if (typeof encoded !== "string") {
1480
+ decodedStrings.set(objectId, null);
1481
+ return null;
1482
+ }
1483
+ budget.reserve(64 + encoded.length * 2, "NIBArchive string projection exceeds the aggregate Interface Builder decode budget");
1484
+ const value = Buffer.from(encoded, "base64").toString("utf8");
1485
+ decodedStrings.set(objectId, value);
1486
+ return value;
1487
+ };
1488
+ let projectedFields = 0;
1489
+ for (const object of archive.objects) projectedFields += Object.keys(object.values).length;
1490
+ budget.reserve(archive.objects.length * 128 + projectedFields * 128, "NIBArchive graph projection exceeds the aggregate Interface Builder decode budget");
1491
+ budget.reserve(archive.classes.length * 96, "NIBArchive class projection exceeds the aggregate Interface Builder decode budget");
1492
+ const dereference = (value) => {
1493
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return value;
1494
+ const encodedData = value.$nib_data_base64;
1495
+ if (typeof encodedData === "string") {
1496
+ budget.reserveBase64JsonStringOccurrence(encodedData);
1497
+ return value;
1498
+ }
1499
+ const ref = value.$nib_object_ref;
1500
+ if (typeof ref !== "number") return value;
1501
+ const target = byId.get(ref);
1502
+ if (target === undefined) return undefined;
1503
+ if (normalizeClassName(target.class_name) === "NSString") {
1504
+ const string = decodedString(ref, target);
1505
+ if (string !== null) {
1506
+ budget.reserveJsonStringOccurrence(string);
1507
+ return string;
1508
+ }
1509
+ }
1510
+ return { objectID: String(ref) };
1511
+ };
1512
+ const referencedString = (value) => {
1513
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return null;
1514
+ const ref = value.$nib_object_ref;
1515
+ if (typeof ref !== "number") return null;
1516
+ const target = byId.get(ref);
1517
+ if (target === undefined || normalizeClassName(target.class_name) !== "NSString") return null;
1518
+ const string = decodedString(ref, target);
1519
+ if (string === null) return null;
1520
+ budget.reserveJsonStringOccurrence(string);
1521
+ return string;
1522
+ };
1523
+ const runtimeClasses = new Map();
1524
+ const runtimeClass = (objectId) => {
1525
+ if (runtimeClasses.has(objectId)) return runtimeClasses.get(objectId) ?? null;
1526
+ const object = byId.get(objectId);
1527
+ if (object === undefined) return null;
1528
+ const storedClass = normalizeClassName(object.class_name);
1529
+ const resolvedClass = storedClass === "NSClassSwapper" ? referencedString(object.values.NSClassName) ?? storedClass : storedClass === "UIClassSwapper" ? referencedString(object.values.UIClassName) ?? storedClass : storedClass;
1530
+ runtimeClasses.set(objectId, resolvedClass);
1531
+ return resolvedClass;
1532
+ };
1533
+ const objects = Object.fromEntries(archive.objects.filter((object) => {
1534
+ const name = runtimeClass(object.id) ?? "";
1535
+ return !/^(?:NSObject|NSIBObjectData|NSString|NSMutableString|NSNumber|NSArray|NSMutableArray|NSSet|NSMutableSet|NSDictionary|NSMutableDictionary|NSApplication|NSNib.*Connector|UIRuntime\w*Connection)$/u.test(name);
1536
+ }).map((object) => {
1537
+ const className = runtimeClass(object.id) ?? normalizeClassName(object.class_name);
1538
+ budget.reserveJsonStringOccurrence(className);
1539
+ let name = className;
1540
+ for (const [key, value] of Object.entries(object.values)) {
1541
+ if (!/(?:title|label|identifier|accessibility|name|contents)/iu.test(key)) continue;
1542
+ const resolved = dereference(value);
1543
+ if (typeof resolved !== "string") continue;
1544
+ name = resolved;
1545
+ break;
1546
+ }
1547
+ budget.reserveJsonStringOccurrence(name);
1548
+ return [String(object.id), {
1549
+ customClass: className,
1550
+ label: name,
1551
+ objectID: String(object.id),
1552
+ nibValues: Object.fromEntries(Object.entries(object.values).map(([key, value]) => {
1553
+ budget.reserveJsonPropertyNameOccurrence(key);
1554
+ return [key, dereference(value) ?? null];
1555
+ }))
1556
+ }];
1557
+ }));
1558
+ const connections = {};
1559
+ const hierarchy = [];
1560
+ const reference = (value) => {
1561
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return null;
1562
+ return typeof value.$nib_object_ref === "number" ? value.$nib_object_ref : null;
1563
+ };
1564
+ for (const object of archive.objects) {
1565
+ const className = normalizeClassName(object.class_name);
1566
+ const uiKit = /^UIRuntime\w*Connection$/u.test(className);
1567
+ if (!uiKit && !className.includes("Connector")) continue;
1568
+ const values = object.values;
1569
+ const source = reference(uiKit ? values.UISource : values.NSSource);
1570
+ if (source === null) continue;
1571
+ const destination = reference(uiKit ? values.UIDestination : values.NSDestination);
1572
+ const label = referencedString(uiKit ? values.UILabel : values.NSLabel);
1573
+ const type = className.includes("Outlet") ? "outlet" : className.includes("Control") || className.includes("Event") ? "action" : className;
1574
+ budget.reserveJsonStringOccurrence(type);
1575
+ const eventMask = values.UIEventMask;
1576
+ (connections[String(source)] ??= []).push({
1577
+ type,
1578
+ "destination-id": destination === null ? null : String(destination),
1579
+ label,
1580
+ source_id: String(source),
1581
+ archive_object_id: String(object.id),
1582
+ ...typeof eventMask === "number" ? { ui_event_mask: eventMask } : {}
1583
+ });
1584
+ }
1585
+ let hierarchyOmitted = 0;
1586
+ let hierarchyNodeCount = 0;
1587
+ const hierarchyFor = (objectId, seen, depth) => {
1588
+ if (depth > 32 || seen.has(objectId)) {
1589
+ hierarchyOmitted += 1;
1590
+ return null;
1591
+ }
1592
+ if (hierarchyNodeCount >= maxHierarchyNodes) {
1593
+ hierarchyOmitted += 1;
1594
+ return null;
1595
+ }
1596
+ if (!budget.tryReserve(128)) {
1597
+ hierarchyOmitted += 1;
1598
+ return null;
1599
+ }
1600
+ const object = byId.get(objectId);
1601
+ if (object === undefined) {
1602
+ hierarchyOmitted += 1;
1603
+ return null;
1604
+ }
1605
+ hierarchyNodeCount += 1;
1606
+ const nextSeen = new Set(seen).add(objectId);
1607
+ const children = [];
1608
+ for (const [key, value] of Object.entries(object.values)) {
1609
+ if (!/(?:subviews|contentview|childviewcontrollers|view)$/iu.test(key)) continue;
1610
+ const direct = reference(value);
1611
+ if (direct === null) continue;
1612
+ const target = byId.get(direct);
1613
+ if (target === undefined) {
1614
+ hierarchyOmitted += 1;
1615
+ continue;
1616
+ }
1617
+ if (/array|set/iu.test(target.class_name)) {
1618
+ for (const candidate of Object.values(target.values)) {
1619
+ const child = reference(candidate);
1620
+ const nested = child === null ? null : hierarchyFor(child, nextSeen, depth + 1);
1621
+ if (nested !== null) children.push(nested);
1622
+ }
1623
+ } else {
1624
+ const nested = hierarchyFor(direct, nextSeen, depth + 1);
1625
+ if (nested !== null) children.push(nested);
1626
+ }
1627
+ }
1628
+ return {
1629
+ objectID: String(objectId),
1630
+ children
1631
+ };
1632
+ };
1633
+ const ibData = archive.objects.find(({ class_name }) => normalizeClassName(class_name) === "NSIBObjectData");
1634
+ const rootId = reference(ibData?.values.NSRoot);
1635
+ const hierarchyRoots = rootId === null ? [] : [rootId];
1636
+ for (const hierarchyRoot of hierarchyRoots) {
1637
+ const root = hierarchyFor(hierarchyRoot, new Set(), 0);
1638
+ if (root !== null) hierarchy.push(root);
1639
+ }
1640
+ const viewHierarchy = projectNibViewHierarchy(archive.objects, new Set(Object.keys(objects).map(Number)), () => budget.tryReserve(128), maxHierarchyNodes);
1641
+ const merged = mergeNibHierarchies(hierarchy, viewHierarchy.hierarchy ?? [], () => budget.tryReserve(96), maxHierarchyNodes);
1642
+ return {
1643
+ omitted: viewHierarchy.omitted + hierarchyOmitted + merged.omitted,
1644
+ raw: jsonValueSchema.parse({
1645
+ "com.apple.ibtool.document.objects": objects,
1646
+ "com.apple.ibtool.document.connections": connections,
1647
+ "com.apple.ibtool.document.hierarchy": merged.hierarchy,
1648
+ "com.apple.ibtool.document.classes": Object.fromEntries(archive.classes.map((name) => {
1649
+ const className = normalizeClassName(name);
1650
+ budget.reserveJsonPropertyNameOccurrence(className);
1651
+ return [className, {}];
1652
+ }))
1653
+ })
1654
+ };
1655
+ };
1656
+ isInterfaceBuilderArchive = (path) => {
1657
+ const lower = path.toLowerCase();
1658
+ return lower.endsWith(".nib") || lower.endsWith("/objects.nib");
1659
+ };
1660
+ readEntry = async (reader, entry, signal, maxInputBytes = MAX_AGGREGATE_INPUT_BYTES) => {
1661
+ if (entry.declaredSize !== null && entry.declaredSize > maxInputBytes) throw new InterfaceBuilderDecodeBudgetExceeded("aggregate_decode_budget_exhausted", "archive exceeds the aggregate Interface Builder decode budget");
1662
+ const stream = await reader.open(entry, signal);
1663
+ const chunks = [];
1664
+ let length = 0;
1665
+ for await (const chunk of stream) {
1666
+ const bytes = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
1667
+ length += bytes.length;
1668
+ if (length > maxInputBytes) {
1669
+ stream.destroy();
1670
+ throw new InterfaceBuilderDecodeBudgetExceeded("aggregate_decode_budget_exhausted", "archive exceeded the aggregate Interface Builder decode budget");
1671
+ }
1672
+ chunks.push(bytes);
1673
+ }
1674
+ return Buffer.concat(chunks, length);
1675
+ };
1676
+ decodePlist = (bytes, xmlText, binaryPrototypeKeyObserved) => {
1677
+ const binary = bytes.subarray(0, 8).toString("ascii") === "bplist00";
1678
+ const { value, omittedPrototypeKeys } = binary ? {
1679
+ value: parseBinary(bytes),
1680
+ omittedPrototypeKeys: binaryPrototypeKeyObserved ? null : 0
1681
+ } : parseXmlPropertyList(xmlText ?? decodeXmlPlistText(bytes));
1682
+ return {
1683
+ value: projectPlistValue(value).value,
1684
+ omittedPrototypeKeys
1685
+ };
1686
+ };
1687
+ })))();
1688
+ }
1689
+
1690
+ //#endregion
1691
+ //#region dist/artifacts/apple/AppleAssetCatalogAnalysis.js
1692
+ var ASSETUTIL, MAX_CATALOG_BYTES, MAX_TOTAL_METADATA_BYTES, RESOURCE_KEY_FIELDS, analyzeAppleAssetCatalogs, inspectAssetCatalogEntry, collectInterfaceBuilderResourceKeys, runAssetUtil, digestBounded;
1693
+ function init_AppleAssetCatalogAnalysis() {
1694
+ return (init_AppleAssetCatalogAnalysis = __esmMin((() => {
1695
+ init_DirectoryArtifactReader();
1696
+ init_ArtifactReader();
1697
+ init_InterfaceBuilderAnalysis();
1698
+ init_appleAssetCatalog();
1699
+ init_ExecFileOutput();
1700
+ ASSETUTIL = "/usr/bin/assetutil";
1701
+ MAX_CATALOG_BYTES = 64 * 1024 * 1024;
1702
+ MAX_TOTAL_METADATA_BYTES = 64 * 1024 * 1024;
1703
+ RESOURCE_KEY_FIELDS = new Set([
1704
+ "image",
1705
+ "imageName",
1706
+ "image_name",
1707
+ "resourceName",
1708
+ "resource_name",
1709
+ "assetName",
1710
+ "asset_name",
1711
+ "UIImageName",
1712
+ "NSImageName"
1713
+ ]);
1714
+ analyzeAppleAssetCatalogs = async (input) => {
1715
+ if (process.platform !== "darwin" && input.runAssetUtil === undefined) throw new ArtifactReaderFailure("unavailable", "Apple asset catalog inspection requires macOS assetutil");
1716
+ const page = appleAssetCatalogInputSchema.parse(input.page ?? {});
1717
+ const reader = new DirectoryArtifactReader(input.bundlePath);
1718
+ const catalogs = [];
1719
+ const uninspected = [];
1720
+ let totalMetadataBytes = 0;
1721
+ try {
1722
+ for await (const entry of reader.entries(input.signal)) {
1723
+ if (!entry.path.endsWith("Assets.car")) continue;
1724
+ if (entry.kind !== "file") {
1725
+ uninspected.push(`${entry.path} (${entry.kind})`);
1726
+ continue;
1727
+ }
1728
+ const inspected = await inspectAssetCatalogEntry({
1729
+ reader,
1730
+ entry,
1731
+ runAssetUtil: input.runAssetUtil ?? ((path, signal) => runAssetUtil(path, input.environment, signal)),
1732
+ ...input.signal === undefined ? {} : { signal: input.signal }
1733
+ });
1734
+ totalMetadataBytes += inspected.metadataBytes;
1735
+ if (totalMetadataBytes > MAX_TOTAL_METADATA_BYTES) throw new ArtifactReaderFailure("limit", `Combined asset catalog metadata exceeds ${MAX_TOTAL_METADATA_BYTES} bytes`);
1736
+ catalogs.push(inspected.catalog);
1737
+ }
1738
+ } finally {
1739
+ await reader.close();
1740
+ }
1741
+ if (catalogs.length === 0 && uninspected.length > 0) throw new ArtifactReaderFailure("path", `Asset catalog entries are not regular files and were not inspected: ${uninspected.join(", ")}`);
1742
+ const interfaceBuilder = await analyzeInterfaceBuilderBundle({
1743
+ bundlePath: input.bundlePath,
1744
+ targetSha256: input.targetSha256,
1745
+ ...input.signal === undefined ? {} : { signal: input.signal }
1746
+ });
1747
+ const resourceReferences = collectInterfaceBuilderResourceKeys(interfaceBuilder.graph.nodes);
1748
+ const result = projectAppleAssetCatalogPage({
1749
+ targetSha256: input.targetSha256,
1750
+ catalogs,
1751
+ offset: page.offset,
1752
+ limit: page.limit,
1753
+ resourceReferences
1754
+ });
1755
+ return {
1756
+ ...result,
1757
+ limitations: [
1758
+ ...result.limitations,
1759
+ ...catalogs.length === 0 ? ["No compiled Assets.car catalog was found among the app bundle's regular files (symlinks are not followed); any resource keys are reported as unmatched."] : [],
1760
+ ...uninspected.length === 0 ? [] : [`Asset catalog entries that are not regular files were not inspected, so resource keys reported as unmatched may resolve there: ${uninspected.join(", ")}`],
1761
+ "Exact resource-key joins use only recognized image or asset key fields on decoded Interface Builder resource objects; other archive resource references are not inferred.",
1762
+ ...interfaceBuilder.graph.truncated ? ["Interface Builder resource-key joins may be incomplete because the decoded UI graph was truncated."] : []
1763
+ ]
1764
+ };
1765
+ };
1766
+ inspectAssetCatalogEntry = async (input) => {
1767
+ const { entry, reader, signal } = input;
1768
+ const sha256 = await digestBounded(reader, entry, signal);
1769
+ const before = await lstat(entry.adapterKey, { bigint: true });
1770
+ if (!before.isFile() || !sameArtifactSourceIdentity(entry.sourceIdentity, before)) throw new ArtifactReaderFailure("integrity", `Asset catalog changed before inspection: ${entry.path}`);
1771
+ const output = await input.runAssetUtil(entry.adapterKey, signal);
1772
+ const after = await lstat(entry.adapterKey, { bigint: true });
1773
+ if (!after.isFile() || !sameArtifactSourceIdentity(entry.sourceIdentity, after) || await digestBounded(reader, entry, signal) !== sha256) throw new ArtifactReaderFailure("integrity", `Asset catalog changed during inspection: ${entry.path}`);
1774
+ let parsed;
1775
+ try {
1776
+ parsed = JSON.parse(output);
1777
+ } catch (cause) {
1778
+ throw new ArtifactReaderFailure("format", `assetutil returned invalid JSON for ${entry.path}`, { cause });
1779
+ }
1780
+ try {
1781
+ return {
1782
+ catalog: {
1783
+ path: entry.path,
1784
+ sha256,
1785
+ records: parseAppleAssetCatalogRecords(parsed)
1786
+ },
1787
+ metadataBytes: Buffer.byteLength(output, "utf8")
1788
+ };
1789
+ } catch (cause) {
1790
+ throw new ArtifactReaderFailure("format", `assetutil returned an unsupported record for ${entry.path}`, { cause });
1791
+ }
1792
+ };
1793
+ collectInterfaceBuilderResourceKeys = (nodes) => nodes.flatMap((node) => {
1794
+ const source = node.evidence.find((item) => item.artifact_path !== null && item.artifact_sha256 !== null);
1795
+ const sourcePath = source?.artifact_path;
1796
+ const sourceArchiveSha256 = source?.artifact_sha256;
1797
+ if (sourcePath == null || sourceArchiveSha256 == null) return [];
1798
+ return Object.entries(node.attributes).flatMap(([field, value]) => RESOURCE_KEY_FIELDS.has(field) && typeof value === "string" && value.length > 0 ? [{
1799
+ sourceNodeId: node.id,
1800
+ sourcePath,
1801
+ sourceArchiveSha256,
1802
+ field,
1803
+ key: value
1804
+ }] : []);
1805
+ });
1806
+ runAssetUtil = async (path, environment, signal) => {
1807
+ try {
1808
+ return (await execFileOutput(ASSETUTIL, ["--info", path], {
1809
+ env: environment,
1810
+ timeout: 6e4,
1811
+ maxBuffer: MAX_CATALOG_BYTES,
1812
+ ...signal === undefined ? {} : { signal }
1813
+ })).stdout;
1814
+ } catch (cause) {
1815
+ if (signal?.aborted === true) throw new ArtifactReaderFailure("cancelled", "Asset catalog inspection cancelled");
1816
+ const code = typeof cause === "object" && cause !== null && "code" in cause ? cause.code : undefined;
1817
+ throw new ArtifactReaderFailure(code === "ENOENT" ? "unavailable" : code === "ETIMEDOUT" || code === "ERR_CHILD_PROCESS_STDIO_MAXBUFFER" ? "limit" : "io", `assetutil failed${code === undefined ? "" : ` (${String(code)})`}`, { cause });
1818
+ }
1819
+ };
1820
+ digestBounded = async (reader, entry, signal) => {
1821
+ if (entry.declaredSize === null || entry.declaredSize > MAX_CATALOG_BYTES) throw new ArtifactReaderFailure("limit", `Asset catalog exceeds ${MAX_CATALOG_BYTES} bytes: ${entry.path}`);
1822
+ const stream = await reader.open(entry, signal);
1823
+ const hash = createHash("sha256");
1824
+ let length = 0;
1825
+ for await (const chunk of stream) {
1826
+ if (signal?.aborted === true) throw new ArtifactReaderFailure("cancelled", "Asset catalog inspection cancelled");
1827
+ const bytes = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
1828
+ length += bytes.length;
1829
+ if (length > MAX_CATALOG_BYTES) throw new ArtifactReaderFailure("limit", `Asset catalog exceeds byte limit: ${entry.path}`);
1830
+ hash.update(bytes);
1831
+ }
1832
+ return hash.digest("hex");
1833
+ };
1834
+ })))();
1835
+ }
1836
+
1837
+ //#endregion
1838
+ //#region dist/artifacts/ArtifactProvider.js
1839
+ var ArtifactProvider, ArtifactClient, isArtifactOperation, translateArtifactFailure, subjectFor;
1840
+ function init_ArtifactProvider() {
1841
+ return (init_ArtifactProvider = __esmMin((() => {
1842
+ init_snapshotEnvironment();
1843
+ init_AnalysisProvider();
1844
+ init_KeyedArchiveReader();
1845
+ init_DylibResolutionReader();
1846
+ init_ArtifactInventory();
1847
+ init_ArtifactExtraction();
1848
+ init_InterfaceBuilderAnalysis();
1849
+ init_AppleAssetCatalogAnalysis();
1850
+ init_artifactToolContracts();
1851
+ init_binaryTargetTypes();
1852
+ init_analysisErrorCore();
1853
+ init_artifactOperationError();
1854
+ init_interfaceBuilderGraph();
1855
+ init_result();
1856
+ init_ArtifactReader();
1857
+ init_ArtifactResourceScope();
1858
+ init_ArtifactProviderMetadata();
1859
+ init_InvestigationProviders();
1860
+ init_evidence();
1861
+ init_artifactInspection();
1862
+ init_providerCleanupError();
1863
+ ArtifactProvider = class {
1864
+ #capabilities;
1865
+ #platform;
1866
+ environment;
1867
+ constructor(environment, platform = process.platform) {
1868
+ this.environment = snapshotEnvironment(environment, platform);
1869
+ this.#capabilities = artifactCapabilities(platform);
1870
+ this.#platform = platform;
1871
+ }
1872
+ identity() {
1873
+ return ARTIFACT_GRAPH_PROVIDER;
1874
+ }
1875
+ capabilities() {
1876
+ return this.#capabilities;
1877
+ }
1878
+ createClient(target) {
1879
+ return new ArtifactClient(target, this.environment, this.#platform);
1880
+ }
1881
+ };
1882
+ ArtifactClient = class {
1883
+ target;
1884
+ environment;
1885
+ platform;
1886
+ #resourceScope = new ArtifactResourceScope();
1887
+ constructor(target, environment, platform) {
1888
+ this.target = target;
1889
+ this.environment = environment;
1890
+ this.platform = platform;
1891
+ }
1892
+ async execute(operation, parameters, options) {
1893
+ if (operation === "health") return ok(createAnalysisExecution(null, ARTIFACT_GRAPH_PROVIDER));
1894
+ if (!isArtifactOperation(operation)) return err(new AnalysisCapabilityUnavailableError(ARTIFACT_GRAPH_PROVIDER.id, operation, "Operation is not implemented by artifact graph provider."));
1895
+ try {
1896
+ if (operation === "inspect_artifact") {
1897
+ const inspected = await this.inspectArtifact(parameters, options);
1898
+ return inspected;
1899
+ }
1900
+ if (operation === "decode_interface_builder") {
1901
+ if (this.target.kind !== "executable" || this.target.sourcePath === undefined || !this.target.sourcePath.toLowerCase().endsWith(".app")) throw this.unsupportedTarget(operation, "decode_interface_builder requires an active .app bundle target");
1902
+ const limits = interfaceBuilderLimitsSchema.parse(parameters);
1903
+ const result = await analyzeInterfaceBuilderBundle({
1904
+ bundlePath: this.target.sourcePath,
1905
+ targetSha256: this.target.sha256,
1906
+ limits,
1907
+ ...options?.signal === undefined ? {} : { signal: options.signal }
1908
+ });
1909
+ return ok(createAnalysisExecution(result, ARTIFACT_GRAPH_PROVIDER, {
1910
+ limitations: result.limitations,
1911
+ locations: result.documents.map(({ relative_path: path }) => ({
1912
+ kind: "artifact-path",
1913
+ path
1914
+ }))
1915
+ }));
1916
+ }
1917
+ if (operation === "inspect_keyed_archive") {
1918
+ const standalone = this.target.kind === "artifact" && this.target.format === "plist";
1919
+ if (standalone && parameters.path !== undefined && parameters.path !== "." && parameters.path !== basename(this.target.path)) throw new AnalysisInputError(operation, undefined, [{
1920
+ path: ["path"],
1921
+ reason: "invalid_value",
1922
+ message: "For an active plist, path must select that archive (omit path or use its basename).",
1923
+ expected: basename(this.target.path)
1924
+ }]);
1925
+ const bundlePath = standalone ? dirname(this.target.path) : this.target.sourcePath;
1926
+ if (bundlePath === undefined || !standalone && !bundlePath.toLowerCase().endsWith(".app")) throw this.unsupportedTarget(operation, "inspect_keyed_archive requires an active plist or .app bundle");
1927
+ const result = await inspectBundleKeyedArchive({
1928
+ bundlePath,
1929
+ targetSha256: this.target.sha256,
1930
+ parameters: standalone ? {
1931
+ ...parameters,
1932
+ path: basename(this.target.path)
1933
+ } : parameters,
1934
+ platform: this.platform,
1935
+ ...options?.signal === undefined ? {} : { signal: options.signal }
1936
+ });
1937
+ if (standalone && result.archive_sha256 !== this.target.sha256) throw new ArtifactReaderFailure("integrity", `Active archive digest changed: expected ${this.target.sha256}, observed ${result.archive_sha256}`);
1938
+ return ok(createAnalysisExecution(result, ARTIFACT_GRAPH_PROVIDER, {
1939
+ limitations: result.limitations,
1940
+ locations: [{
1941
+ kind: "artifact-path",
1942
+ path: result.archive_path
1943
+ }]
1944
+ }));
1945
+ }
1946
+ if (operation === "inspect_asset_catalog") {
1947
+ return await this.inspectAssetCatalog(parameters, options);
1948
+ }
1949
+ if (operation === "trace_dylib_resolution") return await this.traceDylibResolution(parameters, options);
1950
+ if (operation === "extract_artifact") {
1951
+ const parsed = artifactExtractionExecutionSchema.parse(parameters);
1952
+ const result = await extractArtifact({
1953
+ inputPath: this.target.sourcePath ?? this.target.path,
1954
+ inputFormat: this.target.format,
1955
+ outputRoot: parsed.output_root,
1956
+ environment: this.environment,
1957
+ integrityPolicy: parsed.integrity_policy,
1958
+ resourceScope: this.#resourceScope
1959
+ }, options?.signal);
1960
+ return ok(createAnalysisExecution(result, ARTIFACT_GRAPH_PROVIDER, {
1961
+ rawResult: null,
1962
+ limitations: result.limitations,
1963
+ subject: subjectFor(this.target.sourcePath ?? this.target.path, result.manifest),
1964
+ locations: []
1965
+ }));
1966
+ }
1967
+ const parsed = artifactInventoryInputSchema.parse(parameters);
1968
+ const result = await this.inventory(parsed, options);
1969
+ return ok(createAnalysisExecution(result, ARTIFACT_GRAPH_PROVIDER, {
1970
+ rawResult: null,
1971
+ limitations: result.limitations,
1972
+ subject: subjectFor(this.target.sourcePath ?? this.target.path, result.manifest),
1973
+ locations: []
1974
+ }));
1975
+ } catch (cause) {
1976
+ return err(translateArtifactFailure(operation, cause));
1977
+ }
1978
+ }
1979
+ close() {
1980
+ return this.#resourceScope.close().then(() => ok(null), (cause) => {
1981
+ const failure = cause instanceof ArtifactReaderFailure ? cause : undefined;
1982
+ return err(new ProviderCleanupError(ARTIFACT_GRAPH_PROVIDER.id, failure?.cleanup?.resources ?? ["artifact resources"], { reason: failure?.cleanup?.reason ?? (cause instanceof Error ? cause.message : String(cause)) }, {
1983
+ cause,
1984
+ operation: "close_binary"
1985
+ }));
1986
+ });
1987
+ }
1988
+ /** The active target's kind is outside this operation's supported targets. */
1989
+ unsupportedTarget(operation, reason) {
1990
+ return new AnalysisUnsupportedTargetError(operation, this.target.sourcePath ?? this.target.path, reason);
1991
+ }
1992
+ async inspectAssetCatalog(parameters, options) {
1993
+ const bundlePath = this.target.sourcePath;
1994
+ if (this.target.kind !== "executable" || bundlePath === undefined || !bundlePath.toLowerCase().endsWith(".app")) throw this.unsupportedTarget("inspect_asset_catalog", "inspect_asset_catalog requires an active .app bundle target");
1995
+ const result = await analyzeAppleAssetCatalogs({
1996
+ environment: this.environment,
1997
+ bundlePath,
1998
+ targetSha256: this.target.sha256,
1999
+ page: parameters,
2000
+ ...options?.signal === undefined ? {} : { signal: options.signal }
2001
+ });
2002
+ return ok(createAnalysisExecution(result, ARTIFACT_GRAPH_PROVIDER, {
2003
+ limitations: result.limitations,
2004
+ locations: result.catalogs.map(({ path }) => ({
2005
+ kind: "artifact-path",
2006
+ path
2007
+ }))
2008
+ }));
2009
+ }
2010
+ async traceDylibResolution(parameters, options) {
2011
+ if (this.target.kind !== "executable" || !isMachOFormat(this.target.format)) throw this.unsupportedTarget("trace_dylib_resolution", "trace_dylib_resolution requires an active Mach-O or .app bundle target");
2012
+ const bundle = this.target.bundleInfoPlist === undefined ? undefined : this.target.sourcePath;
2013
+ const result = await traceDylibResolution({
2014
+ rootPath: bundle ?? dirname(this.target.path),
2015
+ targetPath: this.target.path,
2016
+ targetSha256: this.target.sha256,
2017
+ enumerateRoots: bundle !== undefined,
2018
+ parameters,
2019
+ ...options?.signal === undefined ? {} : { signal: options.signal }
2020
+ });
2021
+ return ok(createAnalysisExecution(result, ARTIFACT_GRAPH_PROVIDER, {
2022
+ limitations: result.limitations,
2023
+ locations: result.images.map(({ path }) => ({
2024
+ kind: "artifact-path",
2025
+ path
2026
+ }))
2027
+ }));
2028
+ }
2029
+ async inspectArtifact(parameters, options) {
2030
+ const parsed = artifactInventoryInputSchema.parse(parameters);
2031
+ const inventoryParameters = { integrity_policy: parsed.integrity_policy };
2032
+ await options?.progress?.report({
2033
+ phase: "inspect_artifact.inventory",
2034
+ completed: 0,
2035
+ total: 1,
2036
+ message: "inventory substep started"
2037
+ });
2038
+ const inventory = await this.inventory(inventoryParameters, options);
2039
+ const subject = subjectFor(this.target.sourcePath ?? this.target.path, inventory.manifest);
2040
+ const inventoryEvidence = createEvidence(subject, ARTIFACT_GRAPH_PROVIDER, {
2041
+ operation: "inventory_artifact",
2042
+ parameters: inventoryParameters,
2043
+ result: inventory,
2044
+ rawResult: null,
2045
+ limitations: inventory.limitations,
2046
+ locations: []
2047
+ });
2048
+ const result = createArtifactInspection(inventoryEvidence);
2049
+ await options?.progress?.report({
2050
+ phase: "inspect_artifact.inventory",
2051
+ completed: 1,
2052
+ total: 1,
2053
+ message: "inventory substep completed"
2054
+ });
2055
+ return ok(createAnalysisExecution(result, ARTIFACT_GRAPH_PROVIDER, {
2056
+ rawResult: null,
2057
+ limitations: result.limitations,
2058
+ subject,
2059
+ locations: []
2060
+ }));
2061
+ }
2062
+ inventory(parsed, options) {
2063
+ return inventoryArtifact(this.target.sourcePath ?? this.target.path, {
2064
+ resourceScope: this.#resourceScope,
2065
+ environment: this.environment,
2066
+ ...options?.signal === undefined ? {} : { signal: options.signal },
2067
+ integrity: { mode: parsed.integrity_policy }
2068
+ });
2069
+ }
2070
+ };
2071
+ isArtifactOperation = (operation) => ARTIFACT_ANALYSIS_OPERATIONS.includes(operation);
2072
+ translateArtifactFailure = (operation, cause) => {
2073
+ if (cause instanceof ArtifactReaderFailure) return new ArtifactOperationError(operation, cause.reason, cause.details, cause.message, {
2074
+ ...cause.cleanup === undefined ? {} : { cleanup: cause.cleanup },
2075
+ ...cause.partialObservation === undefined ? {} : { partialObservation: cause.partialObservation }
2076
+ });
2077
+ if (cause instanceof AnalysisInputError || cause instanceof AnalysisUnsupportedTargetError) return cause;
2078
+ return new ArtifactOperationError(operation, "io");
2079
+ };
2080
+ subjectFor = (path, manifest) => ({
2081
+ path,
2082
+ sha256: manifest.root_sha256,
2083
+ format: manifest.root_format
2084
+ });
2085
+ })))();
2086
+ }
2087
+
2088
+ //#endregion
2089
+ init_ArtifactProvider();
2090
+ export { ArtifactProvider };