rea-agents 6.4.0 → 6.7.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 (1420) hide show
  1. package/DISCLAIMER.md +136 -0
  2. package/README.md +76 -16
  3. package/THIRD_PARTY_NOTICES.md +135 -0
  4. package/bridge/android/ReaJadxBridge.java +281 -25
  5. package/bridge/cutter/rea_bridge.py +825 -0
  6. package/bridge/ghidra/ReaGhidraAnalysisOptions.java +38 -0
  7. package/bridge/ghidra/ReaGhidraBridge.java +1232 -142
  8. package/bridge/ghidra/ReaGhidraBundleActivator.java +14 -0
  9. package/bridge/ghidra/ReaGhidraMipsSoftFloat.java +176 -0
  10. package/bridge/ghidra/ReaGhidraPrepareRaw.java +49 -0
  11. package/bridge/hopper_bridge.py +111 -69
  12. package/bridge/mitmproxy/capture.py +189 -13
  13. package/bridge/native/rea_lldb_tracer.py +88 -10
  14. package/bridge/process/ProcessRunTokenReader.swift +76 -34
  15. package/bridge/pwndbg/core_context.py +15 -2
  16. package/bridge/pwntools/layout_impl.py +5 -0
  17. package/bridge/pwntools/recorded_crash_impl.py +31 -10
  18. package/dist/adb/AdbCommand.js +148 -0
  19. package/dist/adb/AdbConfiguration.js +41 -7
  20. package/dist/adb/AdbDeviceOutput.js +59 -37
  21. package/dist/adb/AdbDirectoryListing.js +80 -0
  22. package/dist/adb/AdbHostFileName.js +34 -0
  23. package/dist/adb/AdbInputSnapshot.js +126 -0
  24. package/dist/adb/AdbProvider.js +1106 -346
  25. package/dist/adb/AdbShellOutput.js +146 -77
  26. package/dist/android/AndroidTargetSnapshot.js +7 -7
  27. package/dist/android/JadxAnalysis.js +53 -33
  28. package/dist/android/JadxConfiguration.js +283 -145
  29. package/dist/android/JadxDoctor.js +123 -0
  30. package/dist/android/JadxFailure.js +154 -0
  31. package/dist/android/JadxInterruption.js +13 -0
  32. package/dist/android/JadxJavaProbe.js +246 -0
  33. package/dist/android/JadxMcpTransport.js +53 -18
  34. package/dist/android/JadxProtocol.js +43 -2
  35. package/dist/android/JadxProvider.js +183 -102
  36. package/dist/android/JadxRelease.js +17 -2
  37. package/dist/android/JadxSession.js +35 -14
  38. package/dist/android/JadxWorkspaceRoot.js +157 -0
  39. package/dist/apktool/ApktoolCommandCleanup.js +134 -0
  40. package/dist/apktool/ApktoolCommandOutput.js +22 -0
  41. package/dist/apktool/ApktoolConfiguration.js +306 -45
  42. package/dist/apktool/ApktoolDecodeOutput.js +131 -42
  43. package/dist/apktool/ApktoolDecodedInventory.js +52 -0
  44. package/dist/apktool/ApktoolProvider.js +296 -340
  45. package/dist/apktool/ApktoolStringTables.js +178 -0
  46. package/dist/apktool/ApktoolWorkspace.js +162 -0
  47. package/dist/application/AnalysisContextQueries.js +5 -8
  48. package/dist/application/AnalysisDocument.js +19 -4
  49. package/dist/application/AnalysisProvider.js +36 -18
  50. package/dist/application/AppBundleExecutable.js +16 -9
  51. package/dist/application/BinaryTargetResolver.js +204 -40
  52. package/dist/application/BrowserEvidence.js +1 -1
  53. package/dist/application/BrowserObservationService.js +54 -9
  54. package/dist/application/BrowserScenarioCaptureService.js +26 -7
  55. package/dist/application/CallPathTracing.js +52 -13
  56. package/dist/application/CapabilityInventory.js +182 -36
  57. package/dist/application/ClaudeDesktopConfigLocation.js +152 -0
  58. package/dist/application/ClientConfigurationCleanup.js +73 -0
  59. package/dist/application/ClientConfigurationDocument.js +270 -151
  60. package/dist/application/ClientConfigurationFiles.js +51 -14
  61. package/dist/application/ClientConfigurationPublication.js +167 -0
  62. package/dist/application/ClientRegistrationEnvironment.js +40 -4
  63. package/dist/application/ClientRegistrationIdentity.js +112 -32
  64. package/dist/application/ClientRegistrationStatus.js +280 -84
  65. package/dist/application/DirectAnalysis.js +98 -30
  66. package/dist/application/DirectAnalysisCleanup.js +5 -1
  67. package/dist/application/DirectAnalysisStatus.js +13 -1
  68. package/dist/application/Doctor.js +192 -37
  69. package/dist/application/DoctorDiagnostics.js +59 -16
  70. package/dist/application/DoctorProviderIds.js +8 -0
  71. package/dist/application/DoctorScope.js +11 -2
  72. package/dist/application/DshCordisPatch.js +355 -0
  73. package/dist/application/DshCordisYaml.js +155 -0
  74. package/dist/application/EnhancedLiteralTracing.js +30 -16
  75. package/dist/application/EnhancedToolTypes.js +0 -1
  76. package/dist/application/EnhancedTools.js +154 -56
  77. package/dist/application/EvidenceBundleCommands.js +30 -7
  78. package/dist/application/EvidenceBundleFiles.js +29 -7
  79. package/dist/application/FunctionAnalysisEvidence.js +3 -0
  80. package/dist/application/GeminiClientSettings.js +25 -13
  81. package/dist/application/HermesClientHome.js +20 -0
  82. package/dist/application/HermesConfigurationYaml.js +312 -0
  83. package/dist/application/HopperDownload.js +11 -3
  84. package/dist/application/HopperReleaseFeed.js +71 -0
  85. package/dist/application/InventoryProjectionEvidence.js +0 -1
  86. package/dist/application/InvestigationProviders.js +14 -3
  87. package/dist/application/JsonFiles.js +110 -20
  88. package/dist/application/JsonInputFile.js +220 -62
  89. package/dist/application/LinuxHopper.js +218 -115
  90. package/dist/application/LinuxHopperPublisher.js +656 -0
  91. package/dist/application/MacHopper.js +203 -83
  92. package/dist/application/MacHopperPaths.js +40 -0
  93. package/dist/application/{MipsElfAbiFlags.js → MipsElfMetadata.js} +71 -10
  94. package/dist/application/MipsElfSharedLoad.js +164 -0
  95. package/dist/application/MipsGnuAttributes.js +90 -0
  96. package/dist/application/MsixPackageStorage.js +140 -0
  97. package/dist/application/ProgressReporter.js +1 -1
  98. package/dist/application/ProviderOperationExecution.js +15 -14
  99. package/dist/application/ReconstructionCoverageService.js +0 -1
  100. package/dist/application/ReconstructionObligationCandidates.js +20 -4
  101. package/dist/application/ReconstructionObligationLedgerDiagnostics.js +2 -2
  102. package/dist/application/ReconstructionObligationLedgerEvaluation.js +19 -33
  103. package/dist/application/ReconstructionObligationLedgerProjection.js +3 -72
  104. package/dist/application/ReconstructionObligationLedgerService.js +6 -2
  105. package/dist/application/ReconstructionObligationOriginalCases.js +10 -1
  106. package/dist/application/ReferenceSourceImport.js +24 -8
  107. package/dist/application/ReferenceSourceImportEntries.js +180 -37
  108. package/dist/application/ReferenceSourceImportPolicy.js +5 -3
  109. package/dist/application/ReferenceSourceImportTypes.js +0 -1
  110. package/dist/application/ReferenceSourceVcsAdapter.js +36 -17
  111. package/dist/application/RegularFileRead.js +117 -70
  112. package/dist/application/Setup.js +59 -21
  113. package/dist/application/SetupClientConfiguration.js +301 -66
  114. package/dist/application/SetupClients.js +25 -10
  115. package/dist/application/SetupHost.js +149 -51
  116. package/dist/application/SetupInstallFailure.js +58 -3
  117. package/dist/application/SetupPlan.js +94 -55
  118. package/dist/application/SetupRecoveryBackup.js +93 -0
  119. package/dist/application/SetupRegistrationEnvironment.js +14 -1
  120. package/dist/application/SetupSkill.js +303 -76
  121. package/dist/application/SourceLimitations.js +35 -0
  122. package/dist/application/SupportedClients.js +166 -32
  123. package/dist/application/TypeScriptEmittedSourceCandidates.js +26 -0
  124. package/dist/application/Uninstall.js +356 -110
  125. package/dist/application/UninstallFailure.js +14 -0
  126. package/dist/application/Update.js +54 -25
  127. package/dist/application/UpdateCommandProgress.js +66 -0
  128. package/dist/application/UpdateFailure.js +17 -0
  129. package/dist/application/UpdateMaintenance.js +18 -31
  130. package/dist/application/UpdateRuntime.js +198 -54
  131. package/dist/application/WebModuleTraceService.js +42 -22
  132. package/dist/application/WebNetworkCaptureService.js +24 -12
  133. package/dist/application/WebRuntimeService.js +41 -8
  134. package/dist/application/WebScriptExportService.js +6 -4
  135. package/dist/application/WebSourceLocationService.js +23 -8
  136. package/dist/application/WindowsCapabilities.js +18 -15
  137. package/dist/application/WorkflowEvidence.js +31 -1
  138. package/dist/application/analysisView/AnalysisViewService.js +46 -11
  139. package/dist/application/android/AndroidAnalysisService.js +5 -4
  140. package/dist/application/android/AndroidPackageInspection.js +25 -0
  141. package/dist/application/android/AndroidSearchEvidenceSummary.js +98 -0
  142. package/dist/application/artifacts/ArtifactComparisonEvidence.js +32 -0
  143. package/dist/application/binary/AnalysisProviderEvaluation.js +14 -11
  144. package/dist/application/binary/AnalysisProviderRegistry.js +365 -60
  145. package/dist/application/binary/AnalysisSnapshotCache.js +41 -20
  146. package/dist/application/binary/AnalysisSnapshotFiles.js +75 -9
  147. package/dist/application/binary/BinarySession.js +308 -117
  148. package/dist/application/binary/BinarySessionExecution.js +5 -4
  149. package/dist/application/binary/BinarySessionOpen.js +13 -6
  150. package/dist/application/binary/BinarySessionRecords.js +36 -7
  151. package/dist/application/binary/BinarySessionStatus.js +96 -27
  152. package/dist/application/binary/BinaryTargetSummary.js +9 -0
  153. package/dist/application/binary/CompositeProvider.js +116 -28
  154. package/dist/application/binary/LazyAnalysisProvider.js +6 -66
  155. package/dist/application/binary/SessionProviderRouter.js +16 -4
  156. package/dist/application/binaryDiagnostics/BinaryLayoutService.js +14 -5
  157. package/dist/application/binaryDiagnostics/PeResourcesService.js +25 -5
  158. package/dist/application/binaryDiagnostics/RecordedCrashService.js +17 -7
  159. package/dist/application/captures/PacketCaptureService.js +84 -0
  160. package/dist/application/closeOwnedWebResources.js +37 -0
  161. package/dist/application/electron/ElectronFusePort.js +1 -0
  162. package/dist/application/electron/ElectronFuseService.js +45 -0
  163. package/dist/application/evm/EvmInterfaceEvidence.js +11 -0
  164. package/dist/application/evm/EvmInterfaceService.js +5 -15
  165. package/dist/application/firmware/FirmwareAnalysisService.js +4 -3
  166. package/dist/application/flutter/DartAotInspection.js +26 -0
  167. package/dist/application/flutter/FlutterBuildAnalysisPort.js +1 -0
  168. package/dist/application/flutter/FlutterBuildAnalysisService.js +13 -0
  169. package/dist/application/frida/FridaInstrumentationPort.js +8 -0
  170. package/dist/application/frida/FridaInstrumentationService.js +310 -0
  171. package/dist/application/frida/fridaInputErrors.js +17 -0
  172. package/dist/application/go/GoBinaryPort.js +1 -0
  173. package/dist/application/go/GoBinaryService.js +79 -0
  174. package/dist/application/harmony/HarmonyApplicationService.js +17 -0
  175. package/dist/application/investigation/EvidenceLedger.js +43 -18
  176. package/dist/application/investigation/InvestigationRecords.js +12 -21
  177. package/dist/application/investigation/UnknownEvidence.js +22 -18
  178. package/dist/application/javascript/ElectronActiveObservationService.js +55 -25
  179. package/dist/application/javascript/ElectronBoundaryAnalysis.js +17 -3
  180. package/dist/application/javascript/ElectronBoundaryGraph.js +2 -0
  181. package/dist/application/javascript/ElectronBoundaryGraphCallPaths.js +144 -0
  182. package/dist/application/javascript/ElectronBoundaryGraphIpc.js +26 -7
  183. package/dist/application/javascript/ElectronBoundaryGraphNative.js +1 -1
  184. package/dist/application/javascript/ElectronBoundaryGraphWindows.js +61 -11
  185. package/dist/application/javascript/ElectronEvidence.js +1 -2
  186. package/dist/application/javascript/ElectronObservationService.js +41 -8
  187. package/dist/application/javascript/JavaScriptApplicationEvidence.js +21 -0
  188. package/dist/application/javascript/JavaScriptApplicationService.js +29 -14
  189. package/dist/application/javascript/JavaScriptApplicationWorkflowService.js +0 -1
  190. package/dist/application/javascript/JavaScriptArtifactAnalysis.js +119 -49
  191. package/dist/application/javascript/JavaScriptArtifactAnalysisTypes.js +30 -1
  192. package/dist/application/javascript/JavaScriptArtifactGraphAccumulator.js +51 -21
  193. package/dist/application/javascript/JavaScriptArtifactGraphBuilder.js +31 -7
  194. package/dist/application/javascript/JavaScriptArtifactGraphContext.js +28 -6
  195. package/dist/application/javascript/JavaScriptArtifactGraphDocuments.js +25 -14
  196. package/dist/application/javascript/JavaScriptArtifactGraphEvidence.js +3 -3
  197. package/dist/application/javascript/JavaScriptArtifactGraphFindings.js +186 -50
  198. package/dist/application/javascript/JavaScriptArtifactGraphStructure.js +173 -14
  199. package/dist/application/javascript/JavaScriptArtifactPathResolution.js +959 -188
  200. package/dist/application/javascript/JavaScriptArtifactReconstruction.js +57 -32
  201. package/dist/application/javascript/JavaScriptArtifactReconstructionInput.js +2 -0
  202. package/dist/application/javascript/JavaScriptModuleRelationships.js +34 -12
  203. package/dist/application/javascript/JavaScriptRecoveryService.js +29 -9
  204. package/dist/application/javascript/JavaScriptRuntimeObservationEvidence.js +1 -2
  205. package/dist/application/javascript/JavaScriptRuntimeObservationService.js +33 -9
  206. package/dist/application/javascript/JavaScriptRuntimeReconciliationService.js +0 -1
  207. package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +4 -5
  208. package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +138 -43
  209. package/dist/application/javascript/JavaScriptSemanticGraphChildProcessProjection.js +13 -4
  210. package/dist/application/javascript/JavaScriptSemanticGraphConstruction.js +23 -3
  211. package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +18 -5
  212. package/dist/application/javascript/JavaScriptSemanticGraphElectronProjection.js +67 -0
  213. package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +4 -6
  214. package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +2 -3
  215. package/dist/application/javascript/JavaScriptSemanticGraphResourceProjection.js +2 -3
  216. package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +5 -8
  217. package/dist/application/javascript/JavaScriptSemanticTraceService.js +0 -1
  218. package/dist/application/managed/ManagedApplicationGraphService.js +0 -1
  219. package/dist/application/managed/ManagedMemberComparisonService.js +72 -54
  220. package/dist/application/managed/ManagedNativeVerificationService.js +0 -1
  221. package/dist/application/managed/ManagedReconstructionService.js +0 -1
  222. package/dist/application/native/NativeCallRoutes.js +78 -41
  223. package/dist/application/native/NativeDispatchMetadataInspection.js +6 -2
  224. package/dist/application/native/NativeUiActionTrace.js +43 -22
  225. package/dist/application/native/NativeValueTrace.js +65 -23
  226. package/dist/application/pcap/PcapAnalysisPort.js +1 -0
  227. package/dist/application/pcap/PcapAnalysisService.js +24 -0
  228. package/dist/application/process/ProcessCli.js +33 -13
  229. package/dist/application/reverse/ReverseEngineeringCommandPort.js +1 -0
  230. package/dist/application/reverse/ReverseEngineeringService.js +688 -0
  231. package/dist/application/rust/RustBinaryPort.js +1 -0
  232. package/dist/application/rust/RustBinaryService.js +82 -0
  233. package/dist/application/signals/SignalRecordingService.js +84 -0
  234. package/dist/application/sqlite/SqliteDatabaseCapability.js +30 -0
  235. package/dist/application/sqlite/SqliteDatabasePort.js +1 -0
  236. package/dist/application/sqlite/SqliteDatabaseService.js +76 -0
  237. package/dist/application/wasm/WasmArtifactPort.js +1 -0
  238. package/dist/application/wasm/WasmArtifactService.js +76 -0
  239. package/dist/application/wasm/WasmInterfaceComparisonService.js +188 -0
  240. package/dist/artifacts/AnalysisCleanupLease.js +119 -0
  241. package/dist/artifacts/ArtifactFileOperation.js +150 -0
  242. package/dist/artifacts/ArtifactHash.js +15 -3
  243. package/dist/artifacts/ArtifactPaths.js +4 -7
  244. package/dist/artifacts/ArtifactProvider.js +24 -9
  245. package/dist/artifacts/ArtifactReader.js +63 -5
  246. package/dist/artifacts/ArtifactResourceScope.js +92 -9
  247. package/dist/artifacts/AsarArtifactReader.js +186 -120
  248. package/dist/artifacts/AsarEntryStream.js +49 -17
  249. package/dist/artifacts/AsarListing.js +78 -0
  250. package/dist/artifacts/DirectoryArtifactReader.js +119 -28
  251. package/dist/artifacts/MachOSliceArtifactReader.js +153 -23
  252. package/dist/artifacts/NativeDmgArtifactReader.js +264 -62
  253. package/dist/artifacts/OrderedReads.js +57 -0
  254. package/dist/artifacts/SafeOutputTree.js +24 -7
  255. package/dist/artifacts/SafeOutputTreeCreationFailure.js +1 -0
  256. package/dist/artifacts/SafeOutputTreeReadback.js +10 -16
  257. package/dist/artifacts/ZipArtifactReader.js +150 -25
  258. package/dist/artifacts/apple/AppleAssetCatalogAnalysis.js +79 -68
  259. package/dist/artifacts/apple/DylibFileAccess.js +106 -0
  260. package/dist/artifacts/apple/DylibResolutionReader.js +72 -157
  261. package/dist/artifacts/apple/InterfaceBuilderAnalysis.js +108 -29
  262. package/dist/artifacts/apple/InterfaceBuilderDecodeBudget.js +81 -28
  263. package/dist/artifacts/apple/KeyedArchiveReader.js +23 -13
  264. package/dist/artifacts/apple/MachoLoadCommandReader.js +77 -61
  265. package/dist/artifacts/apple/NibArchive.js +11 -4
  266. package/dist/artifacts/apple/PlistNumberLiterals.js +106 -118
  267. package/dist/artifacts/extraction/ArtifactExtraction.js +21 -19
  268. package/dist/artifacts/hostExecutableMarking.js +16 -0
  269. package/dist/artifacts/inventory/ArtifactGraphConstruction.js +139 -41
  270. package/dist/artifacts/inventory/classify.js +36 -17
  271. package/dist/artifacts/inventory/hashStableRootArtifact.js +14 -7
  272. package/dist/artifacts/inventory/reader.js +36 -21
  273. package/dist/artifacts/inventory/scanCanonical.js +27 -21
  274. package/dist/artifacts/inventory/scanReader.js +36 -10
  275. package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +166 -8
  276. package/dist/artifacts/readArtifactFileChunks.js +9 -0
  277. package/dist/artifacts/readStableArtifact.js +13 -11
  278. package/dist/browser/BrowserProcessStartup.js +20 -9
  279. package/dist/browser/BrowserScenarioPartialObservation.js +74 -92
  280. package/dist/browser/BrowserScenarioSecrets.js +176 -46
  281. package/dist/browser/CdpBrowserProvider.js +124 -102
  282. package/dist/browser/CdpCaptureDocuments.js +232 -102
  283. package/dist/browser/CdpCaptureDomSvg.js +80 -76
  284. package/dist/browser/CdpCaptureEventBodyShapes.js +9 -5
  285. package/dist/browser/CdpCaptureEventHandlers.js +23 -12
  286. package/dist/browser/CdpCaptureEvents.js +49 -10
  287. package/dist/browser/CdpCaptureStorage.js +22 -5
  288. package/dist/browser/CdpCaptureStorageFingerprints.js +54 -11
  289. package/dist/browser/CdpCaptureValues.js +12 -1
  290. package/dist/browser/CdpConnection.js +135 -30
  291. package/dist/browser/CdpElectronInspection.js +74 -64
  292. package/dist/browser/CdpElectronProvider.js +63 -6
  293. package/dist/browser/CdpElectronScriptEvents.js +4 -1
  294. package/dist/browser/CdpElectronScripts.js +4 -6
  295. package/dist/browser/CdpElectronWorkers.js +20 -4
  296. package/dist/browser/CdpEndpoint.js +143 -17
  297. package/dist/browser/CdpObservationSession.js +24 -8
  298. package/dist/browser/CdpPageCapture.js +68 -17
  299. package/dist/browser/CdpPageCaptureScripts.js +18 -13
  300. package/dist/browser/CdpPageCaptureWorkers.js +46 -11
  301. package/dist/browser/CdpSafeMetadata.js +32 -24
  302. package/dist/browser/CdpScreenshot.js +5 -14
  303. package/dist/browser/CdpSnapshotNodes.js +103 -0
  304. package/dist/browser/CdpSnapshotStrings.js +15 -0
  305. package/dist/browser/CdpTargetSession.js +76 -7
  306. package/dist/browser/CdpTargetSessionOwner.js +198 -0
  307. package/dist/browser/CdpWebMcpDiscovery.js +23 -6
  308. package/dist/browser/ElectronCaptureCleanup.js +82 -0
  309. package/dist/browser/ElectronProcessCleanup.js +91 -0
  310. package/dist/browser/PlaywrightBrowserScenarioProvider.js +75 -20
  311. package/dist/browser/PlaywrightElectronActiveActions.js +57 -9
  312. package/dist/browser/PlaywrightElectronActiveFuses.js +86 -0
  313. package/dist/browser/PlaywrightElectronActiveProjection.js +21 -4
  314. package/dist/browser/PlaywrightElectronActiveProvider.js +237 -175
  315. package/dist/browser/PlaywrightExecutionBoundary.js +6 -4
  316. package/dist/browser/PlaywrightScenarioBrowser.js +240 -91
  317. package/dist/browser/PlaywrightScenarioEvents.js +287 -38
  318. package/dist/browser/PlaywrightScenarioServiceWorkers.js +336 -0
  319. package/dist/browser/PlaywrightScenarioSession.js +151 -46
  320. package/dist/browser/PlaywrightScenarioStorage.js +15 -7
  321. package/dist/browser/StructuredFieldToken.js +53 -0
  322. package/dist/browser/WebArtifactCleanup.js +53 -0
  323. package/dist/browser/WebSourceMapFetcher.js +181 -89
  324. package/dist/browser/assets/LocalWebScriptArtifacts.js +24 -3
  325. package/dist/browser/assets/PublishWebScripts.js +13 -2
  326. package/dist/browser/assets/ScenarioScriptCapture.js +2 -1
  327. package/dist/browser/assets/WebArtifactReads.js +15 -3
  328. package/dist/browser/assets/WebSourceLocationArtifacts.js +47 -3
  329. package/dist/browser/execution/CdpRuntimeSession.js +36 -7
  330. package/dist/browser/execution/CdpWebRuntimeProvider.js +22 -4
  331. package/dist/browser/history/CaptureFailures.js +29 -10
  332. package/dist/browser/history/CaptureFormatError.js +2 -2
  333. package/dist/browser/history/{HarJson.js → CaptureJson.js} +14 -4
  334. package/dist/browser/history/CaptureRedaction.js +16 -3
  335. package/dist/browser/history/CaptureRelease.js +20 -2
  336. package/dist/browser/history/HarCapture.js +54 -30
  337. package/dist/browser/history/HarSchema.js +36 -36
  338. package/dist/browser/history/HistoricalCaptureDecoder.js +93 -25
  339. package/dist/browser/history/NodeCaptureAdapter.js +48 -0
  340. package/dist/browser/history/{HarCaptureProcess.js → NodeCaptureProcess.js} +18 -9
  341. package/dist/browser/history/QlogCapture.js +385 -0
  342. package/dist/browser/history/SazCapture.js +130 -0
  343. package/dist/browser/history/SazHttp.js +61 -0
  344. package/dist/browser/history/SazMetadata.js +55 -0
  345. package/dist/browser/history/SazProjection.js +90 -0
  346. package/dist/browser/modules/NativeModuleResolver.js +248 -131
  347. package/dist/browser/modules/WebModuleArtifacts.js +49 -3
  348. package/dist/browser/network/PlaywrightNetworkContent.js +67 -9
  349. package/dist/browser/network/PlaywrightScenarioNetwork.js +249 -26
  350. package/dist/captures/TsharkCaptureProvider.js +377 -0
  351. package/dist/captures/parseFieldDiscovery.js +66 -0
  352. package/dist/captures/parsePacketOutput.js +21 -0
  353. package/dist/catalogIdentity.js +58 -42
  354. package/dist/cli/adbCommands.js +20 -21
  355. package/dist/cli/analysisViewCommands.js +1 -1
  356. package/dist/cli/androidCommands.js +13 -16
  357. package/dist/cli/apktoolCommands.js +14 -25
  358. package/dist/cli/applicationCommands.js +44 -17
  359. package/dist/cli/artifactCommands.js +1 -1
  360. package/dist/cli/binaryDiagnosticsCommands.js +17 -13
  361. package/dist/cli/browserAdvancedCommands.js +46 -26
  362. package/dist/cli/browserCommands.js +59 -33
  363. package/dist/cli/captureCommands.js +72 -0
  364. package/dist/cli/cliResultOutput.js +274 -0
  365. package/dist/cli/coreBinaryCommands.js +77 -30
  366. package/dist/cli/coreNativeCommands.js +53 -31
  367. package/dist/cli/cutterCommands.js +88 -0
  368. package/dist/cli/electronCommands.js +76 -13
  369. package/dist/cli/evmCommands.js +9 -19
  370. package/dist/cli/finishAnalysisCommand.js +52 -0
  371. package/dist/cli/firmwareCommands.js +20 -50
  372. package/dist/cli/flutterCommands.js +53 -0
  373. package/dist/cli/fridaCommands.js +219 -0
  374. package/dist/cli/goCommands.js +20 -0
  375. package/dist/cli/interactiveSetup.js +11 -1
  376. package/dist/cli/javascriptApplicationAnalysis.js +1 -1
  377. package/dist/cli/javascriptRecoveryCommands.js +18 -23
  378. package/dist/cli/jebCommands.js +2 -14
  379. package/dist/cli/jsonOutput.js +2 -2
  380. package/dist/cli/managedCommands.js +31 -3
  381. package/dist/cli/options.js +26 -2
  382. package/dist/cli/pcapCommands.js +29 -0
  383. package/dist/cli/processCommands.js +1 -1
  384. package/dist/cli/reverseEngineeringCommands.js +268 -0
  385. package/dist/cli/rustCommands.js +20 -0
  386. package/dist/cli/setupCommands.js +41 -12
  387. package/dist/cli/signalCommands.js +72 -0
  388. package/dist/cli/sqliteCommands.js +52 -0
  389. package/dist/cli/utilityCommands.js +116 -74
  390. package/dist/cli/wasmCommands.js +50 -0
  391. package/dist/cli/webModuleCommands.js +27 -38
  392. package/dist/cli/webNetworkCaptureCommands.js +10 -9
  393. package/dist/cli/webRuntimeCommands.js +15 -6
  394. package/dist/cli/webSourceLocationCommands.js +14 -33
  395. package/dist/cli-runtime/AnalysisCleanupLease-CWfTGYKd.js +103 -0
  396. package/dist/cli-runtime/AnalysisProvider-BGrYaMVo.js +38 -0
  397. package/dist/cli-runtime/AnalysisSnapshotCache-BjRlXeUS.js +711 -0
  398. package/dist/cli-runtime/ArtifactFileOperation-Dg4BcoEM.js +122 -0
  399. package/dist/cli-runtime/ArtifactReader-DMwm42bk.js +78 -0
  400. package/dist/cli-runtime/ArtifactResourceScope-CokZGcII.js +175 -0
  401. package/dist/cli-runtime/AsarHeader-BxwU17DJ.js +31 -0
  402. package/dist/cli-runtime/BinarySessionStatus-DRhjr7Vb.js +212 -0
  403. package/dist/cli-runtime/BinaryTargetResolver-tuCTjBlQ.js +1238 -0
  404. package/dist/cli-runtime/BoundedFileBytes-DRtiQNAQ.js +43 -0
  405. package/dist/cli-runtime/CdpTargetSession-CQ08KHbh.js +925 -0
  406. package/dist/cli-runtime/ClientConfigPath-Dn-V_GUf.js +255 -0
  407. package/dist/cli-runtime/ClientConfigurationDocument-C9T8MNGc.js +2021 -0
  408. package/dist/cli-runtime/ClientRegistrationStatus-PnD29RTX.js +585 -0
  409. package/dist/cli-runtime/CurrentEntrypointPath-m7QCIVN0.js +14 -0
  410. package/dist/cli-runtime/DirectAnalysis-C5NyUryV.js +581 -0
  411. package/dist/cli-runtime/DirectoryArtifactReader-CokAJ8vo.js +448 -0
  412. package/dist/cli-runtime/Doctor-DrkWsav4.js +668 -0
  413. package/dist/cli-runtime/ElectronFileScope-AP7VoVr7.js +1109 -0
  414. package/dist/cli-runtime/ElectronFuseFailures-DsjXR7Xp.js +609 -0
  415. package/dist/cli-runtime/ExecFileOutput-D6KLYTve.js +119 -0
  416. package/dist/cli-runtime/InterfaceBuilderDecodeBudget-CW1IO3dG.js +298 -0
  417. package/dist/cli-runtime/InventoryProjectionEvidence-DTH5QAqL.js +49 -0
  418. package/dist/cli-runtime/InvestigationProviders-CFh4a64d.js +118 -0
  419. package/dist/cli-runtime/JavaScriptApplicationEvidenceGraph-gOmPB2L6.js +160 -0
  420. package/dist/cli-runtime/JavaScriptApplicationWorkflowEvidence-WZgtK_Ok.js +75 -0
  421. package/dist/cli-runtime/JavaScriptWorkerMemoryLimit-B1bwMM1a.js +86 -0
  422. package/dist/cli-runtime/JebMcpEndpoint-BEalGZh9.js +710 -0
  423. package/dist/cli-runtime/JsonFiles-uvd6ZyQi.js +600 -0
  424. package/dist/cli-runtime/KunaInstallation-P0j3x851.js +1781 -0
  425. package/dist/cli-runtime/MacCodeSignature-MgYbRK_H.js +24 -0
  426. package/dist/cli-runtime/MacHopperPaths-bGzqjF1Z.js +34 -0
  427. package/dist/cli-runtime/MachoLoadCommandReader-CZm6N5vF.js +330 -0
  428. package/dist/cli-runtime/ManagedSnapshot-CPE9C3OD.js +4481 -0
  429. package/dist/cli-runtime/OwnedCommandCleanup-BN_V6Erc.js +187 -0
  430. package/dist/cli-runtime/OwnedRegularFile-D1f5nUCx.js +256 -0
  431. package/dist/cli-runtime/OwnedStagedOutput-D31dOozz.js +126 -0
  432. package/dist/cli-runtime/PrivateRuntimeRoot-Cd23u6jd.js +296 -0
  433. package/dist/cli-runtime/ProcessOwnership-CtrNr6ee.js +545 -0
  434. package/dist/cli-runtime/ProcessOwnershipObservation-C006iCtZ.js +920 -0
  435. package/dist/cli-runtime/ProviderDeadline-rSuH4Pm8.js +148 -0
  436. package/dist/cli-runtime/ProviderOperationExecution-CmU-XrQr.js +38 -0
  437. package/dist/cli-runtime/ProviderProcess-D87A7ctp.js +770 -0
  438. package/dist/cli-runtime/RegularFileRead-mbgGYtxe.js +125 -0
  439. package/dist/cli-runtime/SafeOutputTree-i904hd_2.js +525 -0
  440. package/dist/cli-runtime/SetupHost-CMPmPraB.js +1268 -0
  441. package/dist/cli-runtime/SharedStartupAttempt-BxKyf3Uv.js +1424 -0
  442. package/dist/cli-runtime/StableFileHash-Ame_h3lY.js +61 -0
  443. package/dist/cli-runtime/SupportedClients-DMafjitv.js +1066 -0
  444. package/dist/cli-runtime/UninstallFailure-1blyKXHE.js +22 -0
  445. package/dist/cli-runtime/Update-DAsASWlE.js +143 -0
  446. package/dist/cli-runtime/UpdateFailure-BcFNxEZZ.js +24 -0
  447. package/dist/cli-runtime/WindowsBatchCommand-Cx9kaVNf.js +97 -0
  448. package/dist/cli-runtime/WindowsNativeLoader-BqyZO0ZD.js +142 -0
  449. package/dist/cli-runtime/ZipArtifactReader-Jed69LEL.js +252 -0
  450. package/dist/cli-runtime/analysisErrorCleanup-COdAmDsb.js +33 -0
  451. package/dist/cli-runtime/appleArchiveFormat-Bb3G5CCI.js +269 -0
  452. package/dist/cli-runtime/application__DirectAnalysisStatus-F74bu9oy.js +150 -0
  453. package/dist/cli-runtime/application__EnhancedTools-Bg51b0Yp.js +1820 -0
  454. package/dist/cli-runtime/application__FunctionAnalysisEvidence-DBWIaYCh.js +41 -0
  455. package/dist/cli-runtime/application__ReconstructionCoverageService-AEPNpZqJ.js +32 -0
  456. package/dist/cli-runtime/application__ReconstructionObligationLedgerService-Cl9cPEZf.js +828 -0
  457. package/dist/cli-runtime/application__Setup-DwQzEewK.js +526 -0
  458. package/dist/cli-runtime/application__Uninstall-BOf9oyvQ.js +468 -0
  459. package/dist/cli-runtime/application__UpdateRuntime-CzWkRJHa.js +435 -0
  460. package/dist/cli-runtime/application__android__AndroidApplicationService-shW_aKlj.js +31 -0
  461. package/dist/cli-runtime/application__apple__AppleApplicationService-DIv6d3wB.js +31 -0
  462. package/dist/cli-runtime/application__harmony__HarmonyApplicationService-OIUFVQFV.js +31 -0
  463. package/dist/cli-runtime/application__javascript__ElectronActiveObservationService-wvCh72hK.js +118 -0
  464. package/dist/cli-runtime/application__javascript__ElectronObservationService-SydXPCwM.js +88 -0
  465. package/dist/cli-runtime/application__javascript__JavaScriptApplicationService-o0uEsjEc.js +12254 -0
  466. package/dist/cli-runtime/application__javascript__JavaScriptApplicationWorkflowService-BAheG_71.js +2336 -0
  467. package/dist/cli-runtime/application__javascript__JavaScriptRuntimeReconciliationService-Cnn4GP8q.js +88 -0
  468. package/dist/cli-runtime/application__javascript__JavaScriptSemanticTraceService-CmvLfV1A.js +299 -0
  469. package/dist/cli-runtime/artifacts__ArtifactProvider-wx2K0F2I.js +2205 -0
  470. package/dist/cli-runtime/binary-CWVNJhAC.js +19608 -0
  471. package/dist/cli-runtime/catalogIdentity-DAEEsOdX.js +1112 -0
  472. package/dist/cli-runtime/cli.js +44469 -0
  473. package/dist/cli-runtime/cliOutput-CgSuw782.js +163 -0
  474. package/dist/cli-runtime/cliOutput.js +5 -0
  475. package/dist/cli-runtime/cliResultOutput-10sd6xGx.js +1453 -0
  476. package/dist/cli-runtime/cliResultOutput.js +6 -0
  477. package/dist/cli-runtime/composition__browserScenario-BtPb1c1y.js +3414 -0
  478. package/dist/cli-runtime/composition__electronObservation-Bk8R6DJo.js +614 -0
  479. package/dist/cli-runtime/composition__electronScenario-BVF0qStH.js +916 -0
  480. package/dist/cli-runtime/cutterToolContracts-BQtG_Nzo.js +5267 -0
  481. package/dist/cli-runtime/doctorRuntime-B__SIpm-.js +478 -0
  482. package/dist/cli-runtime/dotnet__ManagedStaticProvider-DO5Yzcp4.js +5 -0
  483. package/dist/cli-runtime/errorSchemas-Ixz_q7qt.js +655 -0
  484. package/dist/cli-runtime/homeDirectory-DC_DeJIg.js +18 -0
  485. package/dist/cli-runtime/javascriptApplicationAnalysis-Dk6yBV8g.js +2088 -0
  486. package/dist/cli-runtime/javascriptExportReturnShapeProjection-CObOIiQ6.js +78 -0
  487. package/dist/cli-runtime/javascriptExportShapeComparisonSchemas-DpwuBenh.js +1244 -0
  488. package/dist/cli-runtime/javascriptRuntimeReconciliation-C6ZgWMys.js +1509 -0
  489. package/dist/cli-runtime/javascriptRuntimeReconciliationSchemas-D6tZKUQs.js +247 -0
  490. package/dist/cli-runtime/javascriptSemanticTraceSchemas-C7m0b6_w.js +126 -0
  491. package/dist/cli-runtime/lipo-DPQ6qurH.js +394 -0
  492. package/dist/cli-runtime/logger-BuDJ9xxO.js +48 -0
  493. package/dist/cli-runtime/machoContainer-Cy98bkFm.js +352 -0
  494. package/dist/cli-runtime/managedApplicationGraph-BazVqpJv.js +1136 -0
  495. package/dist/cli-runtime/managedToolContracts-BuFkMBH5.js +99 -0
  496. package/dist/cli-runtime/mcpDoctor.js +361 -0
  497. package/dist/cli-runtime/mcpStartupPolicy-imCbM3qo.js +28 -0
  498. package/dist/cli-runtime/native__NativeMacOSProvider-DTcRhuGA.js +5502 -0
  499. package/dist/cli-runtime/officialToolContracts-CzzVLx8I.js +1522 -0
  500. package/dist/cli-runtime/peMachine-B9ggfSJJ.js +95 -0
  501. package/dist/cli-runtime/propertyListKeys-D5dSASEy.js +355 -0
  502. package/dist/cli-runtime/providerCleanupError-BhsJyAhk.js +25 -0
  503. package/dist/cli-runtime/providerIdentities-Ao1XTvwx.js +31 -0
  504. package/dist/cli-runtime/providerStartupTimeout-B2tF2LtZ.js +17 -0
  505. package/dist/cli-runtime/readArtifactFileChunks-BbTL_PtB.js +129 -0
  506. package/dist/cli-runtime/reconstructionObligationLedgerSchemas-Bi6sect1.js +22156 -0
  507. package/dist/cli-runtime/rolldown-runtime-DXoylpqc.js +121 -0
  508. package/dist/cli-runtime/runtimeVersion-CMGd0bDu.js +23 -0
  509. package/dist/cli-runtime/safeJson-DKKACtdy.js +25 -0
  510. package/dist/cli-runtime/scanCanonical-CcDFUr-w.js +2594 -0
  511. package/dist/cli-runtime/snapshotEnvironment-Yvx5qwsl.js +196 -0
  512. package/dist/cli-runtime/toolContracts-CJzEyZ38.js +3795 -0
  513. package/dist/cli-runtime/toolOutputSchemaGroups-BqdSzySu.js +12249 -0
  514. package/dist/cli-runtime/workflowInputError-BP8z9Wxl.js +26 -0
  515. package/dist/cli.js +48 -5
  516. package/dist/cliBrowserScenarioCommands.js +41 -7
  517. package/dist/cliCommandNames.js +48 -0
  518. package/dist/cliEvidenceCommands.js +0 -1
  519. package/dist/cliJavaScriptRuntimeCommands.js +16 -14
  520. package/dist/cliJsonInput.js +12 -4
  521. package/dist/cliLogging.js +66 -15
  522. package/dist/cliObservationOptions.js +9 -0
  523. package/dist/cliOutput.js +105 -7
  524. package/dist/composition/binary.js +19 -2
  525. package/dist/composition/captures.js +3 -0
  526. package/dist/composition/directAnalysis.js +36 -11
  527. package/dist/composition/electronFuses.js +4 -0
  528. package/dist/composition/evm.js +12 -0
  529. package/dist/composition/flutter.js +3 -0
  530. package/dist/composition/go.js +4 -0
  531. package/dist/composition/javascriptAnalysisWorkerProcess.js +8 -8
  532. package/dist/composition/jeb.js +45 -5
  533. package/dist/composition/pcap.js +3 -0
  534. package/dist/composition/resolveWindowsProviderExecutable.js +61 -0
  535. package/dist/composition/reverseEngineering.js +29 -0
  536. package/dist/composition/rust.js +4 -0
  537. package/dist/composition/signals.js +3 -0
  538. package/dist/composition/sqlite.js +4 -0
  539. package/dist/composition/wasm.js +22 -0
  540. package/dist/composition/webNetworkCaptures.js +7 -2
  541. package/dist/config/environment.js +79 -4
  542. package/dist/config/ghidraDisabledAnalyzers.js +25 -0
  543. package/dist/config/homeDirectory.js +9 -6
  544. package/dist/config/mcpInputSchemaProfile.js +5 -1
  545. package/dist/config/mcpOutputSchemaProfile.js +22 -0
  546. package/dist/config/parseConfig.js +28 -34
  547. package/dist/config/parsers.js +4 -3
  548. package/dist/config/{ghidraStartupTimeout.js → providerStartupTimeout.js} +7 -3
  549. package/dist/contracts/adb/adbToolContracts.js +8 -8
  550. package/dist/contracts/analysisDetail.js +6 -3
  551. package/dist/contracts/analysisViewApiSurfaceExample.js +68 -0
  552. package/dist/contracts/analysisViewToolContracts.js +65 -3
  553. package/dist/contracts/android/androidToolContracts.js +17 -8
  554. package/dist/contracts/apktool/apktoolToolContracts.js +5 -1
  555. package/dist/contracts/applicationToolContracts.js +17 -2
  556. package/dist/contracts/artifactComparisonExample.js +18 -14
  557. package/dist/contracts/artifactToolContracts.js +16 -3
  558. package/dist/contracts/browserScenarioToolContracts.js +1 -1
  559. package/dist/contracts/browserToolContracts.js +13 -1
  560. package/dist/contracts/captures/captureToolContracts.js +42 -0
  561. package/dist/contracts/compactInputSchema.js +39 -12
  562. package/dist/contracts/cutterToolContracts.js +84 -0
  563. package/dist/contracts/enhancedToolContracts.js +2 -2
  564. package/dist/contracts/evm/evmToolContracts.js +30 -15
  565. package/dist/contracts/firmware/firmwareToolContracts.js +1 -1
  566. package/dist/contracts/flutter/flutterToolContracts.js +47 -0
  567. package/dist/contracts/fridaRemoteAddress.js +23 -0
  568. package/dist/contracts/fridaToolContracts.js +274 -0
  569. package/dist/contracts/functionComparisonExample.js +12 -1
  570. package/dist/contracts/gdbToolContracts.js +102 -0
  571. package/dist/contracts/go/goToolContracts.js +20 -0
  572. package/dist/contracts/hopperMemoryContracts.js +15 -0
  573. package/dist/contracts/inputSchemaPresentation.js +199 -38
  574. package/dist/contracts/investigationExamples.js +1 -0
  575. package/dist/contracts/javascript/electronToolContracts.js +27 -2
  576. package/dist/contracts/javascript/javascriptExportShapeComparisonExample.js +1 -0
  577. package/dist/contracts/javascript/javascriptRecoveryToolContracts.js +13 -1
  578. package/dist/contracts/javascript/javascriptRuntimeReconciliationExample.js +1 -0
  579. package/dist/contracts/jsonSchemaKeywords.js +29 -0
  580. package/dist/contracts/managed/managedToolContracts.js +43 -4
  581. package/dist/contracts/managed/managedWorkflowExamples.js +10 -1
  582. package/dist/contracts/managed/managedWorkflowToolContracts.js +4 -30
  583. package/dist/contracts/mobileApplicationGraphExamples.js +27 -12
  584. package/dist/contracts/native/binaryDiagnosticsToolContracts.js +3 -2
  585. package/dist/contracts/native/nativeToolContracts.js +10 -6
  586. package/dist/contracts/officialToolContracts.js +7 -7
  587. package/dist/contracts/pcap/pcapToolContracts.js +33 -0
  588. package/dist/contracts/providerSelection.js +1 -0
  589. package/dist/contracts/reconstructionReadinessExample.js +126 -119
  590. package/dist/contracts/reverseEngineeringToolContracts.js +52 -0
  591. package/dist/contracts/rizinDebugToolContracts.js +97 -0
  592. package/dist/contracts/rust/rustToolContracts.js +20 -0
  593. package/dist/contracts/sessionLifecycleInputs.js +34 -2
  594. package/dist/contracts/sessionToolContracts.js +4 -4
  595. package/dist/contracts/sessionToolSchemas.js +14 -0
  596. package/dist/contracts/signals/signalToolContracts.js +40 -0
  597. package/dist/contracts/sqlite/sqliteToolContracts.js +36 -0
  598. package/dist/contracts/toolContractExamples.js +29 -0
  599. package/dist/contracts/toolContractTypes.js +2 -0
  600. package/dist/contracts/toolContracts.js +26 -0
  601. package/dist/contracts/toolEffects.js +252 -9
  602. package/dist/contracts/toolOutputSchemaGroups.js +78 -32
  603. package/dist/contracts/toolOutputSchemaPrimitives.js +118 -10
  604. package/dist/contracts/toolSchemaMetadata.js +102 -16
  605. package/dist/contracts/unknownContractExamples.js +1 -1
  606. package/dist/contracts/wasm/wasmComparisonContracts.js +52 -0
  607. package/dist/contracts/wasm/wasmToolContracts.js +33 -0
  608. package/dist/contracts/webNetworkCaptureToolContracts.js +15 -4
  609. package/dist/cutter/CutterBridgeClient.js +760 -0
  610. package/dist/cutter/CutterBridgeService.js +187 -0
  611. package/dist/doctorRuntime.js +41 -8
  612. package/dist/domain/adb/adbDeviceAnalysis.js +45 -5
  613. package/dist/domain/analysisErrorBase.js +79 -2
  614. package/dist/domain/analysisErrorCleanup.js +4 -2
  615. package/dist/domain/analysisErrorCore.js +32 -0
  616. package/dist/domain/analysisErrorPresentation.js +80 -20
  617. package/dist/domain/analysisErrorProjection.js +72 -37
  618. package/dist/domain/analysisProfile.js +7 -3
  619. package/dist/domain/analysisSearch.js +26 -0
  620. package/dist/domain/analysisSnapshot.js +312 -185
  621. package/dist/domain/analysisView/WebNetworkApiSurfaceAccumulator.js +353 -0
  622. package/dist/domain/analysisView/analysisView.js +391 -44
  623. package/dist/domain/analysisView/analysisViewCoverage.js +32 -0
  624. package/dist/domain/analysisView/analysisViewDataAdmission.js +86 -0
  625. package/dist/domain/analysisView/analysisViewErrors.js +4 -0
  626. package/dist/domain/analysisView/analysisViewParent.js +12 -0
  627. package/dist/domain/analysisView/analysisViewText.js +29 -0
  628. package/dist/domain/analysisView/androidPackageView.js +102 -0
  629. package/dist/domain/analysisView/artifactInventoryView.js +126 -0
  630. package/dist/domain/analysisView/binaryLayoutView.js +11 -4
  631. package/dist/domain/analysisView/dartAotView.js +93 -0
  632. package/dist/domain/analysisView/evmInterfaceView.js +105 -0
  633. package/dist/domain/analysisView/interfaceBuilderView.js +182 -0
  634. package/dist/domain/analysisView/javascriptApplicationCoverage.js +27 -0
  635. package/dist/domain/analysisView/javascriptApplicationView.js +123 -49
  636. package/dist/domain/analysisView/javascriptFactsView.js +92 -0
  637. package/dist/domain/analysisView/javascriptModuleReferences.js +37 -0
  638. package/dist/domain/analysisView/machoView.js +186 -0
  639. package/dist/domain/analysisView/managedArtifactView.js +108 -0
  640. package/dist/domain/analysisView/managedMemberView.js +215 -0
  641. package/dist/domain/analysisView/nativeFunctionView.js +20 -25
  642. package/dist/domain/analysisView/pcapCaptureView.js +264 -0
  643. package/dist/domain/analysisView/qlogCaptureView.js +198 -0
  644. package/dist/domain/analysisView/wasmArtifactView.js +162 -0
  645. package/dist/domain/analysisView/webNetworkApiSurfaceView.js +123 -0
  646. package/dist/domain/analysisView/webNetworkCaptureView.js +388 -0
  647. package/dist/domain/android/androidAnalysis.js +36 -2
  648. package/dist/domain/android/androidApplication.js +37 -64
  649. package/dist/domain/apktool/apktoolResourceAnalysis.js +70 -8
  650. package/dist/domain/apple/appleApplication.js +70 -87
  651. package/dist/domain/apple/appleArchiveFormat.js +184 -0
  652. package/dist/domain/apple/appleAssetCatalog.js +15 -0
  653. package/dist/domain/apple/appleBundleAnatomy.js +57 -69
  654. package/dist/domain/apple/dyldPaths.js +9 -2
  655. package/dist/domain/apple/dylibResolution.js +24 -10
  656. package/dist/domain/apple/dylibResolutionFindings.js +8 -9
  657. package/dist/domain/apple/interfaceBuilderGraph.js +78 -33
  658. package/dist/domain/apple/interfaceBuilderKeyedArchive.js +39 -12
  659. package/dist/domain/apple/jvmClassFile.js +226 -0
  660. package/dist/domain/apple/keyedArchive.js +39 -17
  661. package/dist/domain/apple/machoContainer.js +123 -8
  662. package/dist/domain/apple/machoCpuIdentity.js +4 -0
  663. package/dist/domain/apple/plistNumbers.js +67 -5
  664. package/dist/domain/apple/plistValue.js +95 -19
  665. package/dist/domain/artifactComparison.js +116 -37
  666. package/dist/domain/artifactDecompressionBudget.js +26 -0
  667. package/dist/domain/artifactGraph.js +18 -9
  668. package/dist/domain/artifactIdentity.js +4 -1
  669. package/dist/domain/artifactInspection.js +34 -3
  670. package/dist/domain/artifactInventoryEvidence.js +146 -40
  671. package/dist/domain/binaryTarget.js +251 -109
  672. package/dist/domain/binaryTargetTypes.js +24 -1
  673. package/dist/domain/browserNetworkEvidence.js +24 -3
  674. package/dist/domain/browserObservation.js +92 -56
  675. package/dist/domain/browserObservationError.js +4 -4
  676. package/dist/domain/browserObservationSchemas.js +4 -1
  677. package/dist/domain/browserScenarioCapture.js +11 -1
  678. package/dist/domain/browserScenarioCaptureLimits.js +34 -0
  679. package/dist/domain/browserScenarioCaptureValues.js +76 -2
  680. package/dist/domain/browserScenarioDiff.js +120 -11
  681. package/dist/domain/browserScenarioDiffEvidence.js +44 -13
  682. package/dist/domain/browserScenarioDiffValues.js +10 -3
  683. package/dist/domain/browserScenarioNetworkComparison.js +158 -0
  684. package/dist/domain/browserScenarioNormalization.js +10 -13
  685. package/dist/domain/browserScenarioValues.js +7 -13
  686. package/dist/domain/browserSession.js +2 -2
  687. package/dist/domain/bundleComparison.js +1 -5
  688. package/dist/domain/callPath.js +40 -3
  689. package/dist/domain/captures/packetCapture.js +139 -0
  690. package/dist/domain/captures/packetFields.js +81 -0
  691. package/dist/domain/changedBehavior.js +43 -41
  692. package/dist/domain/comparisonSourceEvidence.js +6 -0
  693. package/dist/domain/dosCom.js +2 -2
  694. package/dist/domain/dosMz.js +66 -19
  695. package/dist/domain/electron/electronFuseEvidence.js +42 -0
  696. package/dist/domain/electron/electronFuses.js +360 -0
  697. package/dist/domain/elfFixedHeader.js +66 -0
  698. package/dist/domain/evidence.js +105 -39
  699. package/dist/domain/evidenceBundle.js +67 -22
  700. package/dist/domain/evidenceErrors.js +5 -0
  701. package/dist/domain/evm/evmInterface.js +18 -4
  702. package/dist/domain/evm/solidityMetadata.js +70 -0
  703. package/dist/domain/explicitSensitiveFailure.js +44 -23
  704. package/dist/domain/fileSnapshotObservation.js +25 -0
  705. package/dist/domain/firmware/firmwareAnalysis.js +29 -0
  706. package/dist/domain/fixedTupleSchema.js +9 -0
  707. package/dist/domain/flutter/flutterBuildAnalysis.js +141 -0
  708. package/dist/domain/functionCallCoverage.js +60 -0
  709. package/dist/domain/functionComparisonDimensions.js +136 -18
  710. package/dist/domain/functionComparisonNormalization.js +83 -19
  711. package/dist/domain/functionComparisonResults.js +7 -6
  712. package/dist/domain/functionComparisonSchemas.js +14 -3
  713. package/dist/domain/functionDossierEvidence.js +4 -0
  714. package/dist/domain/go/goBinary.js +96 -0
  715. package/dist/domain/harmony/harmonyApplication.js +156 -0
  716. package/dist/domain/hopperErrors.js +19 -18
  717. package/dist/domain/hopperPublisher.js +12 -0
  718. package/dist/domain/hopperValues.js +135 -34
  719. package/dist/domain/javascript/electronActiveObservation.js +1 -0
  720. package/dist/domain/javascript/electronObservation.js +4 -1
  721. package/dist/domain/javascript/electronStaticAnalysisBrowser.js +94 -33
  722. package/dist/domain/javascript/electronStaticAnalysisIpc.js +3 -1
  723. package/dist/domain/javascript/electronStaticAnalysisNative.js +19 -5
  724. package/dist/domain/javascript/electronStaticAnalysisValues.js +14 -28
  725. package/dist/domain/javascript/electronStaticOptionObjects.js +45 -0
  726. package/dist/domain/javascript/electronWrappedCallPaths.js +551 -0
  727. package/dist/domain/javascript/htmlArtifactReferences.js +94 -4
  728. package/dist/domain/javascript/javascriptAnalysisResourceControls.js +37 -1
  729. package/dist/domain/javascript/javascriptApplicationAnalysis.js +7 -0
  730. package/dist/domain/javascript/javascriptApplicationChangeGraph.js +10 -2
  731. package/dist/domain/javascript/javascriptApplicationEvidenceSchemas.js +1 -1
  732. package/dist/domain/javascript/javascriptApplicationGraph.js +17 -1
  733. package/dist/domain/javascript/javascriptApplicationGraphSchemas.js +1 -0
  734. package/dist/domain/javascript/javascriptApplicationProjectionResources.js +8 -0
  735. package/dist/domain/javascript/javascriptApplicationVersionComparisonSchemas.js +3 -1
  736. package/dist/domain/javascript/javascriptApplicationVersionItems.js +49 -21
  737. package/dist/domain/javascript/javascriptApplicationVersionKeys.js +31 -18
  738. package/dist/domain/javascript/javascriptArtifactFiles.js +2 -1
  739. package/dist/domain/javascript/javascriptAstFingerprint.js +89 -24
  740. package/dist/domain/javascript/javascriptAstValues.js +132 -5
  741. package/dist/domain/javascript/javascriptBootstrap.js +94 -0
  742. package/dist/domain/javascript/javascriptBootstrapIntegrity.js +372 -0
  743. package/dist/domain/javascript/javascriptBuiltinResourceMethods.js +8 -0
  744. package/dist/domain/javascript/javascriptBundledRequireOrigin.js +278 -0
  745. package/dist/domain/javascript/javascriptCommonJsExportReceivers.js +231 -0
  746. package/dist/domain/javascript/javascriptContextBridgeExposure.js +23 -0
  747. package/dist/domain/javascript/javascriptElectronMemberWrites.js +96 -22
  748. package/dist/domain/javascript/javascriptExportShapeComparisonSchemas.js +6 -5
  749. package/dist/domain/javascript/javascriptExportShapeVariants.js +1 -1
  750. package/dist/domain/javascript/javascriptFeatureSeed.js +34 -17
  751. package/dist/domain/javascript/javascriptFeatureTrace.js +9 -3
  752. package/dist/domain/javascript/javascriptFeatureTraceSchemas.js +42 -11
  753. package/dist/domain/javascript/javascriptGraphqlOperations.js +382 -0
  754. package/dist/domain/javascript/javascriptIntrinsicInvocation.js +132 -0
  755. package/dist/domain/javascript/javascriptModuleDeclaration.js +48 -0
  756. package/dist/domain/javascript/javascriptModuleInterop.js +618 -0
  757. package/dist/domain/javascript/javascriptModuleResolutionMode.js +18 -0
  758. package/dist/domain/javascript/javascriptModuleSpecifier.js +5 -0
  759. package/dist/domain/javascript/javascriptNativeHandoff.js +7 -12
  760. package/dist/domain/javascript/javascriptPackageImportAliases.js +58 -0
  761. package/dist/domain/javascript/javascriptRecovery.js +12 -5
  762. package/dist/domain/javascript/javascriptRpcEndpoints.js +7 -93
  763. package/dist/domain/javascript/javascriptRuntimeLoadState.js +16 -0
  764. package/dist/domain/javascript/javascriptRuntimeObservation.js +4 -1
  765. package/dist/domain/javascript/javascriptRuntimeReconciliationCaptureParsing.js +45 -16
  766. package/dist/domain/javascript/javascriptRuntimeReconciliationMatching.js +65 -47
  767. package/dist/domain/javascript/javascriptRuntimeReconciliationResult.js +0 -1
  768. package/dist/domain/javascript/javascriptRuntimeReconciliationSchemas.js +5 -4
  769. package/dist/domain/javascript/javascriptRuntimeStaticCandidates.js +113 -11
  770. package/dist/domain/javascript/javascriptSemanticAmbientWrites.js +511 -0
  771. package/dist/domain/javascript/javascriptSemanticAnalysis.js +706 -204
  772. package/dist/domain/javascript/javascriptSemanticAsyncEffects.js +54 -54
  773. package/dist/domain/javascript/javascriptSemanticCallResolution.js +59 -30
  774. package/dist/domain/javascript/javascriptSemanticCallableStack.js +52 -0
  775. package/dist/domain/javascript/javascriptSemanticCalls.js +10 -15
  776. package/dist/domain/javascript/javascriptSemanticChildProcesses.js +163 -92
  777. package/dist/domain/javascript/javascriptSemanticCoverage.js +5 -1
  778. package/dist/domain/javascript/javascriptSemanticDataEffectHelpers.js +435 -45
  779. package/dist/domain/javascript/javascriptSemanticDataEffects.js +46 -29
  780. package/dist/domain/javascript/javascriptSemanticDependencies.js +69 -0
  781. package/dist/domain/javascript/javascriptSemanticDerivedAnalysis.js +1 -1
  782. package/dist/domain/javascript/javascriptSemanticEvaluationOrder.js +126 -0
  783. package/dist/domain/javascript/javascriptSemanticExpressionShapes.js +111 -0
  784. package/dist/domain/javascript/javascriptSemanticFingerprints.js +11 -14
  785. package/dist/domain/javascript/javascriptSemanticGetterQueries.js +147 -0
  786. package/dist/domain/javascript/javascriptSemanticGetterResults.js +264 -0
  787. package/dist/domain/javascript/javascriptSemanticGraph.js +22 -1
  788. package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +13 -1
  789. package/dist/domain/javascript/javascriptSemanticIterationSources.js +5 -4
  790. package/dist/domain/javascript/javascriptSemanticMapOperations.js +51 -0
  791. package/dist/domain/javascript/javascriptSemanticMemberMutations.js +421 -154
  792. package/dist/domain/javascript/javascriptSemanticMutationInitializers.js +500 -27
  793. package/dist/domain/javascript/javascriptSemanticObjectReferences.js +377 -174
  794. package/dist/domain/javascript/javascriptSemanticObjects.js +53 -43
  795. package/dist/domain/javascript/javascriptSemanticOpaqueEffects.js +163 -0
  796. package/dist/domain/javascript/javascriptSemanticPrimitives.js +11 -1
  797. package/dist/domain/javascript/javascriptSemanticProjection.js +180 -95
  798. package/dist/domain/javascript/javascriptSemanticPromises.js +6 -9
  799. package/dist/domain/javascript/javascriptSemanticProvenance.js +5 -1
  800. package/dist/domain/javascript/javascriptSemanticQuery.js +7 -2
  801. package/dist/domain/javascript/javascriptSemanticQueryIdentity.js +2 -1
  802. package/dist/domain/javascript/javascriptSemanticQuerySchemas.js +1 -1
  803. package/dist/domain/javascript/javascriptSemanticReferenceSources.js +25 -0
  804. package/dist/domain/javascript/javascriptSemanticRequireOrigin.js +369 -8
  805. package/dist/domain/javascript/javascriptSemanticResourceLimits.js +3 -19
  806. package/dist/domain/javascript/javascriptSemanticResources.js +33 -44
  807. package/dist/domain/javascript/javascriptSemanticReturnedReferences.js +81 -26
  808. package/dist/domain/javascript/javascriptSemanticReturns.js +37 -30
  809. package/dist/domain/javascript/javascriptSemanticState.js +225 -39
  810. package/dist/domain/javascript/javascriptSemanticTraversal.js +6 -4
  811. package/dist/domain/javascript/javascriptSemanticValues.js +379 -56
  812. package/dist/domain/javascript/javascriptSourceMapPaths.js +44 -17
  813. package/dist/domain/javascript/javascriptSourceParser.js +121 -7
  814. package/dist/domain/javascript/javascriptSourceSelection.js +11 -0
  815. package/dist/domain/javascript/javascriptStaticAnalysis.js +69 -24
  816. package/dist/domain/javascript/javascriptStaticAnalysisBundler.js +97 -23
  817. package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +488 -48
  818. package/dist/domain/javascript/javascriptStaticAnalysisHelpers.js +196 -78
  819. package/dist/domain/javascript/javascriptStaticAnalysisState.js +4 -0
  820. package/dist/domain/javascript/javascriptStaticAnalysisTypes.js +2 -1
  821. package/dist/domain/javascript/javascriptSymbolicBindings.js +1118 -0
  822. package/dist/domain/javascript/javascriptSymbolicControlFlow.js +44 -0
  823. package/dist/domain/javascript/javascriptSymbolicValues.js +45 -0
  824. package/dist/domain/javascript/sourceToBundleComparison.js +3 -1
  825. package/dist/domain/javascript/sourceToBundleComparisonSchemas.js +2 -0
  826. package/dist/domain/javascript/sourceToBundleSignals.js +50 -13
  827. package/dist/domain/jsonValue.js +37 -12
  828. package/dist/domain/localPath.js +6 -3
  829. package/dist/domain/managed/managedApplicationGraph.js +5 -0
  830. package/dist/domain/managed/managedApplicationGraphCoverage.js +6 -2
  831. package/dist/domain/managed/managedApplicationGraphNodes.js +14 -10
  832. package/dist/domain/managed/managedArtifact.js +77 -1
  833. package/dist/domain/managed/managedInspectionEvidence.js +5 -6
  834. package/dist/domain/managed/managedMemberComparison.js +6 -0
  835. package/dist/domain/managed/managedMemberComparisonCoverage.js +36 -3
  836. package/dist/domain/managed/managedMemberComparisonItems.js +135 -59
  837. package/dist/domain/managed/managedMemberComparisonMatch.js +237 -42
  838. package/dist/domain/managed/managedMemberSignatureIdentity.js +40 -0
  839. package/dist/domain/managed/managedNativeVerificationMatch.js +54 -31
  840. package/dist/domain/managed/managedNativeVerificationSchemas.js +15 -4
  841. package/dist/domain/managed/managedReconstruction.js +5 -8
  842. package/dist/domain/mobileApplicationGraphProjection.js +95 -0
  843. package/dist/domain/native/addressCoordinate.js +11 -0
  844. package/dist/domain/native/binaryLayout.js +2 -4
  845. package/dist/domain/native/bytePattern.js +121 -0
  846. package/dist/domain/native/nativeAotPe.js +31 -4
  847. package/dist/domain/native/nativeAotSnapshotObservation.js +18 -0
  848. package/dist/domain/native/nativeCallPartialObservation.js +14 -12
  849. package/dist/domain/native/nativeInspection.js +38 -4
  850. package/dist/domain/native/nativeInstruction.js +17 -2
  851. package/dist/domain/native/nativeInvestigationGraph.js +9 -5
  852. package/dist/domain/native/nativeLoadImage.js +32 -1
  853. package/dist/domain/native/nativeUiObservation.js +5 -6
  854. package/dist/domain/native/objcSwiftMetadata.js +19 -9
  855. package/dist/domain/native/peResources.js +14 -4
  856. package/dist/domain/native/recordedCrash.js +79 -10
  857. package/dist/domain/offsetDateTime.js +60 -0
  858. package/dist/domain/pcap/pcapAnalysis.js +91 -0
  859. package/dist/domain/pcap/pcapEvidence.js +15 -0
  860. package/dist/domain/peMachine.js +38 -0
  861. package/dist/domain/pngHeader.js +18 -0
  862. package/dist/domain/process/processCaptureCoverage.js +26 -3
  863. package/dist/domain/process/processCaptureExample.js +2 -0
  864. package/dist/domain/process/processCaptureValidation.js +33 -8
  865. package/dist/domain/process/processComparison.js +41 -13
  866. package/dist/domain/process/processScenario.js +7 -0
  867. package/dist/domain/process/processTraceDimensionProjection.js +1 -1
  868. package/dist/domain/process/processTraceEvaluation.js +119 -74
  869. package/dist/domain/process/processTraceSpecification.js +243 -89
  870. package/dist/domain/propertyListKeys.js +238 -23
  871. package/dist/domain/propertyListXml.js +149 -0
  872. package/dist/domain/propertyListXmlText.js +20 -4
  873. package/dist/domain/providerAdapterError.js +2 -5
  874. package/dist/domain/providerCleanupError.js +2 -4
  875. package/dist/domain/providerConfigurationRefusal.js +12 -0
  876. package/dist/domain/providerSelectionError.js +2 -1
  877. package/dist/domain/qlogCapture.js +62 -0
  878. package/dist/domain/rawBinary.js +105 -0
  879. package/dist/domain/reconstructionCoverage.js +40 -24
  880. package/dist/domain/reconstructionCoverageEvaluation.js +50 -47
  881. package/dist/domain/reconstructionCoverageEvidence.js +26 -0
  882. package/dist/domain/reconstructionCoverageVerifierResults.js +35 -0
  883. package/dist/domain/reconstructionObligationLedgerIntegrity.js +114 -0
  884. package/dist/domain/reconstructionObligationLedgerSchemas.js +104 -1
  885. package/dist/domain/reconstructionReadiness.js +4 -8
  886. package/dist/domain/reconstructionReadinessJourneyFindings.js +4 -1
  887. package/dist/domain/reconstructionUnknowns.js +9 -1
  888. package/dist/domain/reconstructionVerification.js +86 -43
  889. package/dist/domain/recordedTransportUrl.js +59 -0
  890. package/dist/domain/referenceSourceClassification.js +27 -23
  891. package/dist/domain/referenceSourceGraph.js +51 -13
  892. package/dist/domain/referenceSourceImportParsing.js +27 -13
  893. package/dist/domain/referenceSourcePathIdentity.js +13 -1
  894. package/dist/domain/referenceSourceRequireBindings.js +40 -108
  895. package/dist/domain/referenceSourceSummary.js +92 -0
  896. package/dist/domain/relationshipCoverage.js +43 -0
  897. package/dist/domain/residualUnknown.js +93 -26
  898. package/dist/domain/reverseEngineering.js +31 -0
  899. package/dist/domain/runtimeVersion.js +8 -0
  900. package/dist/domain/rust/rustBinary.js +200 -0
  901. package/dist/domain/signals/annotationTextWindow.js +31 -0
  902. package/dist/domain/signals/signalDecoders.js +69 -0
  903. package/dist/domain/signals/signalRecording.js +115 -0
  904. package/dist/domain/sourceMapContents.js +10 -3
  905. package/dist/domain/sourceMapEnvelope.js +17 -11
  906. package/dist/domain/sqlite/sqliteDatabase.js +189 -0
  907. package/dist/domain/staticRuntimeCorrelation.js +7 -9
  908. package/dist/domain/swiftSymbolClassification.js +17 -0
  909. package/dist/domain/symbolAnalysis.js +20 -7
  910. package/dist/domain/urlComponents.js +6 -0
  911. package/dist/domain/wasm/wasmArtifact.js +119 -0
  912. package/dist/domain/wasm/wasmInterface.js +89 -0
  913. package/dist/domain/webBundleAnalysis.js +14 -3
  914. package/dist/domain/webBundleAnalyzerAst.js +7 -2
  915. package/dist/domain/webBundleAnalyzerInspection.js +113 -57
  916. package/dist/domain/webBundleAnalyzerResult.js +18 -6
  917. package/dist/domain/webCaptureDiff.js +235 -51
  918. package/dist/domain/webCaptureFrameComparison.js +49 -0
  919. package/dist/domain/webInventory.js +28 -14
  920. package/dist/domain/webMcpDiscovery.js +5 -2
  921. package/dist/domain/webModuleImports.js +22 -27
  922. package/dist/domain/webModuleTrace.js +25 -8
  923. package/dist/domain/webNetworkCapture.js +101 -39
  924. package/dist/domain/webNetworkCaptureCoordinates.js +21 -0
  925. package/dist/domain/webRuntime.js +0 -1
  926. package/dist/domain/webScreenshot.js +2 -2
  927. package/dist/domain/webScriptArtifacts.js +2 -4
  928. package/dist/domain/webScriptExport.js +6 -8
  929. package/dist/domain/webScriptExportError.js +2 -3
  930. package/dist/domain/webScriptExportPlan.js +2 -2
  931. package/dist/domain/webSourceLocation.js +20 -9
  932. package/dist/domain/xmlDocument.js +41 -0
  933. package/dist/domain/zipPackageFormat.js +25 -3
  934. package/dist/dotnet/ManagedArtifactInspector.js +25 -12
  935. package/dist/dotnet/ManagedDecodeBudget.js +87 -9
  936. package/dist/dotnet/ManagedMemberInspector.js +127 -22
  937. package/dist/dotnet/ManagedMemberInspectorCore.js +408 -141
  938. package/dist/dotnet/ManagedMemberInstructionDecoder.js +109 -37
  939. package/dist/dotnet/ManagedMemberOwnership.js +65 -0
  940. package/dist/dotnet/ManagedMemberPointers.js +69 -0
  941. package/dist/dotnet/ManagedMemberRows.js +181 -48
  942. package/dist/dotnet/ManagedMetadataHeaps.js +110 -25
  943. package/dist/dotnet/ManagedMetadataInventory.js +5 -5
  944. package/dist/dotnet/ManagedMetadataInventoryRows.js +36 -52
  945. package/dist/dotnet/ManagedMetadataLayout.js +26 -16
  946. package/dist/dotnet/ManagedMetadataRowSizes.js +1 -1
  947. package/dist/dotnet/ManagedMethodBodyReader.js +29 -11
  948. package/dist/dotnet/ManagedMethodSpecs.js +78 -0
  949. package/dist/dotnet/ManagedNativeBoundaryHelpers.js +20 -19
  950. package/dist/dotnet/ManagedNativeBoundaryInspector.js +13 -21
  951. package/dist/dotnet/ManagedPeReader.js +60 -27
  952. package/dist/dotnet/ManagedReaderFailure.js +9 -0
  953. package/dist/dotnet/ManagedSnapshot.js +93 -0
  954. package/dist/dotnet/ManagedStaticProvider.js +55 -64
  955. package/dist/dotnet/ManagedTypeMemberLists.js +105 -0
  956. package/dist/dotnet/ManagedTypeNameDigests.js +177 -0
  957. package/dist/dotnet/ManagedTypeNames.js +58 -0
  958. package/dist/dotnet/ManagedTypeNesting.js +25 -0
  959. package/dist/dotnet/ManagedTypeReferences.js +94 -0
  960. package/dist/dotnet/ManagedUserStrings.js +75 -0
  961. package/dist/electron/ElectronFuseFailures.js +105 -0
  962. package/dist/electron/ElectronFusePath.js +248 -0
  963. package/dist/electron/ElectronFuseProvider.js +88 -0
  964. package/dist/electron/ElectronFuseReader.js +333 -0
  965. package/dist/evaluation/AgentEvaluationFixtures.js +194 -11
  966. package/dist/evaluation/CodexAgentEval.js +19 -40
  967. package/dist/evaluation/KnownAnswerEvaluation.js +126 -57
  968. package/dist/evm/EvmoleFailures.js +20 -14
  969. package/dist/evm/EvmoleInterfaceAdapter.js +5 -1
  970. package/dist/evm/EvmoleInterfaceProvider.js +142 -35
  971. package/dist/evm/EvmoleInterfaceWorker.js +2 -0
  972. package/dist/evm/SolidityMetadata.js +139 -0
  973. package/dist/filesystem/OwnedRegularFile.js +116 -0
  974. package/dist/filesystem/OwnedStagedOutput.js +155 -0
  975. package/dist/filesystem/RegularFile.js +65 -9
  976. package/dist/filesystem/StableFileHash.js +56 -38
  977. package/dist/filesystem/callerPath.js +26 -0
  978. package/dist/filesystem/readFileHandleChunks.js +72 -13
  979. package/dist/filesystem/readStableFileBytes.js +85 -0
  980. package/dist/firmware/FirmwareCommand.js +15 -9
  981. package/dist/firmware/FirmwareFailures.js +56 -0
  982. package/dist/firmware/FirmwareFiles.js +136 -110
  983. package/dist/firmware/FirmwareProvider.js +122 -65
  984. package/dist/firmware/FirmwarePublication.js +244 -12
  985. package/dist/firmware/FirmwareReports.js +202 -12
  986. package/dist/flutter/DartElf.js +445 -0
  987. package/dist/flutter/ElfBuildId.js +137 -0
  988. package/dist/flutter/ElfLoadMap.js +91 -0
  989. package/dist/flutter/FlutterBuildProvider.js +866 -0
  990. package/dist/flutter/FlutterPayloadScan.js +180 -0
  991. package/dist/frida/FridaInstrumentationManager.js +1104 -0
  992. package/dist/gdb/GdbSessionManager.js +1639 -0
  993. package/dist/generatedPackageMetadata.js +2 -2
  994. package/dist/ghidra/GhidraAnalysisProfile.js +146 -14
  995. package/dist/ghidra/GhidraAnalysisSeeds.js +39 -55
  996. package/dist/ghidra/GhidraBridgeSources.js +12 -0
  997. package/dist/ghidra/GhidraClient.js +501 -180
  998. package/dist/ghidra/GhidraClientStartup.js +5 -3
  999. package/dist/ghidra/GhidraClientWire.js +5 -2
  1000. package/dist/ghidra/GhidraDiagnostics.js +23 -5
  1001. package/dist/ghidra/GhidraDoctor.js +60 -26
  1002. package/dist/ghidra/GhidraDosSnapshot.js +83 -0
  1003. package/dist/ghidra/GhidraExecutableHeader.js +54 -0
  1004. package/dist/ghidra/GhidraFileArtifacts.js +93 -0
  1005. package/dist/ghidra/GhidraFunctionValues.js +50 -2
  1006. package/dist/ghidra/GhidraInstallation.js +305 -108
  1007. package/dist/ghidra/GhidraInstallationPolicy.js +94 -103
  1008. package/dist/ghidra/GhidraInstallationProperties.js +57 -0
  1009. package/dist/ghidra/GhidraInventoryValues.js +52 -6
  1010. package/dist/ghidra/GhidraJavaLaunch.js +99 -11
  1011. package/dist/ghidra/GhidraJavaProbe.js +267 -0
  1012. package/dist/ghidra/GhidraJavaProperties.js +119 -0
  1013. package/dist/ghidra/GhidraLanguageCatalog.js +83 -8
  1014. package/dist/ghidra/GhidraLauncher.js +325 -85
  1015. package/dist/ghidra/GhidraLoadImageAttest.js +82 -65
  1016. package/dist/ghidra/GhidraLoadImageValues.js +109 -27
  1017. package/dist/ghidra/GhidraMipsProfile.js +258 -14
  1018. package/dist/ghidra/GhidraNativeAotSnapshotOwner.js +221 -0
  1019. package/dist/ghidra/GhidraPeProfile.js +91 -0
  1020. package/dist/ghidra/GhidraPowerPcProfile.js +51 -0
  1021. package/dist/ghidra/GhidraProvider.js +267 -42
  1022. package/dist/ghidra/GhidraProviderCapabilities.js +29 -15
  1023. package/dist/ghidra/GhidraProviderClient.js +439 -276
  1024. package/dist/ghidra/GhidraPspExtension.js +210 -0
  1025. package/dist/ghidra/GhidraPspProfile.js +62 -0
  1026. package/dist/ghidra/GhidraRawBinaryLanguage.js +49 -0
  1027. package/dist/ghidra/GhidraReleasePolicy.js +93 -0
  1028. package/dist/ghidra/GhidraRequestQueue.js +64 -40
  1029. package/dist/ghidra/GhidraRiscvProfile.js +100 -0
  1030. package/dist/ghidra/GhidraSessionError.js +301 -24
  1031. package/dist/ghidra/GhidraSessionValues.js +76 -0
  1032. package/dist/ghidra/GhidraSocketConnection.js +25 -11
  1033. package/dist/ghidra/GhidraTargetSnapshot.js +67 -50
  1034. package/dist/ghidra/GhidraTransport.js +86 -62
  1035. package/dist/ghidra/extensions/GhidraExtensions.js +30 -45
  1036. package/dist/go/GoBinaryContainer.js +140 -0
  1037. package/dist/go/GoBinaryImage.js +210 -0
  1038. package/dist/go/GoBinaryProvider.js +180 -0
  1039. package/dist/go/GoElfImage.js +211 -0
  1040. package/dist/go/GoMachoImage.js +164 -0
  1041. package/dist/go/GoModuleText.js +217 -0
  1042. package/dist/go/GoPeImage.js +124 -0
  1043. package/dist/hopper/BridgeLauncher.js +78 -6
  1044. package/dist/hopper/HopperAnalysisProfile.js +23 -11
  1045. package/dist/hopper/HopperCleanup.js +29 -4
  1046. package/dist/hopper/HopperClient.js +317 -93
  1047. package/dist/hopper/HopperMacPublisher.js +29 -0
  1048. package/dist/hopper/HopperMachOImage.js +61 -29
  1049. package/dist/hopper/HopperProcessDiagnostic.js +27 -0
  1050. package/dist/hopper/HopperProvider.js +57 -29
  1051. package/dist/hopper/HopperProviderCapabilities.js +9 -4
  1052. package/dist/hopper/HopperRegexSearch.js +21 -60
  1053. package/dist/hopper/HopperRequestQueue.js +17 -5
  1054. package/dist/hopper/HopperSessionValues.js +10 -1
  1055. package/dist/ida/IdaBusyHealth.js +78 -0
  1056. package/dist/ida/IdaCallGraph.js +134 -0
  1057. package/dist/ida/IdaConfiguration.js +7 -2
  1058. package/dist/ida/IdaDiagnosticRedactor.js +199 -0
  1059. package/dist/ida/IdaDiagnosticWriter.js +62 -0
  1060. package/dist/ida/IdaDoctor.js +7 -5
  1061. package/dist/ida/IdaJsonDiagnostic.js +138 -0
  1062. package/dist/ida/IdaMcpConnection.js +308 -32
  1063. package/dist/ida/IdaNativeProtocol.js +85 -0
  1064. package/dist/ida/IdaOperationRunner.js +246 -61
  1065. package/dist/ida/IdaProtocolValues.js +88 -5
  1066. package/dist/ida/IdaProvider.js +45 -10
  1067. package/dist/ida/IdaProviderCapabilities.js +37 -8
  1068. package/dist/ida/IdaSessionClient.js +379 -60
  1069. package/dist/ida/IdaWorkspace.js +54 -6
  1070. package/dist/inspector/V8InspectorCaptureProjection.js +14 -2
  1071. package/dist/inspector/V8InspectorEndpoint.js +15 -13
  1072. package/dist/inspector/V8InspectorProvider.js +43 -7
  1073. package/dist/javascript/analysis/JavaScriptAnalysisTransfer.js +44 -12
  1074. package/dist/javascript/analysis/JavaScriptAnalysisWorker.js +107 -32
  1075. package/dist/javascript/analysis/JavaScriptAnalysisWorkerProtocol.js +7 -4
  1076. package/dist/javascript/analysis/JavaScriptAnalysisWorkerSchemas.js +85 -10
  1077. package/dist/javascript/analysis/JavaScriptAnalysisWorkerServer.js +16 -6
  1078. package/dist/javascript/recovery/RecoveryFiles.js +107 -13
  1079. package/dist/javascript/recovery/WakaruExecution.js +19 -11
  1080. package/dist/javascript/recovery/WakaruProvider.js +12 -9
  1081. package/dist/javascript/recovery/WakaruPublication.js +24 -10
  1082. package/dist/javascript/recovery/WakaruRelease.js +1 -1
  1083. package/dist/javascript/recovery/WakaruReport.js +3 -2
  1084. package/dist/javascript/sourceMaps/DecodedSourceMap.js +2 -16
  1085. package/dist/javascript/sourceMaps/SourceMapCommand.js +22 -4
  1086. package/dist/javascript/sourceMaps/SourceMapDecoder.js +22 -4
  1087. package/dist/javascript/sourceMaps/SourceMapFormat.js +25 -38
  1088. package/dist/javascript/sourceMaps/TraceSourceMap.js +34 -6
  1089. package/dist/jeb/JebMcpConnection.js +148 -82
  1090. package/dist/jeb/JebMcpConnectionOwner.js +116 -0
  1091. package/dist/jeb/JebMcpDeadline.js +46 -0
  1092. package/dist/jeb/JebMcpEndpoint.js +6 -1
  1093. package/dist/jeb/JebProvider.js +82 -58
  1094. package/dist/kuna/KunaAddress.js +11 -0
  1095. package/dist/kuna/KunaCommand.js +217 -0
  1096. package/dist/kuna/KunaConfiguration.js +90 -0
  1097. package/dist/kuna/KunaDoctor.js +198 -0
  1098. package/dist/kuna/KunaInstallation.js +137 -0
  1099. package/dist/kuna/KunaJson.js +23 -0
  1100. package/dist/kuna/KunaJsonStream.js +433 -0
  1101. package/dist/kuna/KunaLimits.js +5 -0
  1102. package/dist/kuna/KunaProjectCache.js +804 -0
  1103. package/dist/kuna/KunaProjectExport.js +202 -0
  1104. package/dist/kuna/KunaProjectFiles.js +191 -0
  1105. package/dist/kuna/KunaProjectReader.js +115 -0
  1106. package/dist/kuna/KunaProvider.js +217 -0
  1107. package/dist/kuna/KunaProviderCapabilities.js +102 -0
  1108. package/dist/kuna/KunaQueryErrors.js +12 -0
  1109. package/dist/kuna/KunaQueryWork.js +113 -0
  1110. package/dist/kuna/KunaReferenceFiles.js +258 -0
  1111. package/dist/kuna/KunaReferenceQueries.js +211 -0
  1112. package/dist/kuna/KunaRelease.js +10 -0
  1113. package/dist/kuna/KunaRunSlots.js +56 -0
  1114. package/dist/kuna/KunaSessionClient.js +1162 -0
  1115. package/dist/kuna/KunaStringInventory.js +145 -0
  1116. package/dist/kuna/KunaStringQueries.js +133 -0
  1117. package/dist/kuna/KunaTargetCommands.js +205 -0
  1118. package/dist/kuna/KunaUnavailable.js +11 -0
  1119. package/dist/logger.js +14 -1
  1120. package/dist/main/processShutdown.js +17 -0
  1121. package/dist/main/shutdown.js +3 -0
  1122. package/dist/main/transport.js +68 -4
  1123. package/dist/main.js +16 -15
  1124. package/dist/mcp/AnalysisProvider-BABWbLoM.js +38 -0
  1125. package/dist/mcp/AnalysisSnapshotFiles-BXz0c37-.js +1423 -0
  1126. package/dist/mcp/ArtifactFileOperation-64cQKI7B.js +1704 -0
  1127. package/dist/mcp/ArtifactProvider-Dx6pmil1.js +2200 -0
  1128. package/dist/mcp/ArtifactProviderMetadata-UCJr2oZW.js +167 -0
  1129. package/dist/mcp/ArtifactReader-BrnwNaKY.js +78 -0
  1130. package/dist/mcp/ArtifactResourceScope-zi3Dkqzy.js +175 -0
  1131. package/dist/mcp/AsarHeader-B_IbppTz.js +31 -0
  1132. package/dist/mcp/BinarySessionStatus-CZ9nnXMt.js +213 -0
  1133. package/dist/mcp/BinaryTargetResolver-BUncASDP.js +1358 -0
  1134. package/dist/mcp/BoundedFileBytes-DYt5q9G2.js +43 -0
  1135. package/dist/mcp/CdpCaptureDocuments-Y2uFcBpl.js +795 -0
  1136. package/dist/mcp/CdpCaptureValues-tNIg-gQK.js +97 -0
  1137. package/dist/mcp/CdpEndpoint-BrhMhpSi.js +641 -0
  1138. package/dist/mcp/CdpOptionalCommand-PZZhlqxv.js +120 -0
  1139. package/dist/mcp/CdpTargetSession-BmmDC3XO.js +290 -0
  1140. package/dist/mcp/DirectAnalysis-B9KuCHTG.js +417 -0
  1141. package/dist/mcp/DirectAnalysisStatus-BgzopkIt.js +44 -0
  1142. package/dist/mcp/ElectronFileScope-FXtK0d6I.js +110 -0
  1143. package/dist/mcp/ElectronFuseFailures-uZ_wOV6T.js +610 -0
  1144. package/dist/mcp/MachoLoadCommandReader-C2VGgHA3.js +330 -0
  1145. package/dist/mcp/ManagedStaticProvider-CZuoPme2.js +5326 -0
  1146. package/dist/mcp/NativeMacOSProvider-CMguKrvN.js +5495 -0
  1147. package/dist/mcp/NativeMacOSProviderMetadata-B_RH4KXF.js +397 -0
  1148. package/dist/mcp/OwnedCommand-BW1jBSt9.js +1241 -0
  1149. package/dist/mcp/ProcedureAddressResolution-H6Qwpb_Y.js +59 -0
  1150. package/dist/mcp/WorkflowEvidence-CO4C7ALz.js +118 -0
  1151. package/dist/mcp/analysisErrorCleanup-Q344SnTO.js +34 -0
  1152. package/dist/mcp/analysisErrorCore-BIEP7tvF.js +509 -0
  1153. package/dist/mcp/analysisErrorProjection-B8teQwwD.js +942 -0
  1154. package/dist/mcp/artifactToolContracts-C9dRDo-D.js +74 -0
  1155. package/dist/mcp/browserObservation-DUraZs62.js +4633 -0
  1156. package/dist/mcp/browserObservationError-C5okJ5el.js +63 -0
  1157. package/dist/mcp/browserObservationSchemas-DwGGxBpu.js +573 -0
  1158. package/dist/mcp/browserScenario-BRUz7yN0.js +3415 -0
  1159. package/dist/mcp/browserScenarioCapture-CiMAsMx8.js +595 -0
  1160. package/dist/mcp/callerPath-CpPnMZyN.js +678 -0
  1161. package/dist/mcp/canonicalDigest-Bi_0_zGi.js +71 -0
  1162. package/dist/mcp/electronActiveObservation-DV0Ffy9X.js +227 -0
  1163. package/dist/mcp/electronFuses-D5SS7XXw.js +367 -0
  1164. package/dist/mcp/electronObservation-DsN-NqY1.js +621 -0
  1165. package/dist/mcp/electronObservation-wOYWwqgF.js +112 -0
  1166. package/dist/mcp/electronScenario-CYrt2zBK.js +913 -0
  1167. package/dist/mcp/emptyArraySchema-C0o2Sxwp.js +140 -0
  1168. package/dist/mcp/enhancedInputs-6CCgB3VB.js +56 -0
  1169. package/dist/mcp/javascriptRuntimeObservation-BVbhkO2-.js +693 -0
  1170. package/dist/mcp/javascriptRuntimeObservation-Cu0Yedqq.js +121 -0
  1171. package/dist/mcp/jsonSerialization-V-wWiFRE.js +152 -0
  1172. package/dist/mcp/lipo-DSTgUqL1.js +395 -0
  1173. package/dist/mcp/localPath-AxvW9aPe.js +19 -0
  1174. package/dist/mcp/logger-BGdGHadX.js +48 -0
  1175. package/dist/mcp/machoContainer-CMSxUBlK.js +605 -0
  1176. package/dist/mcp/main-Cx-Z7m_n.js +80276 -0
  1177. package/dist/mcp/main.js +6 -0
  1178. package/dist/mcp/managedToolContracts-CSlbKJP-.js +101 -0
  1179. package/dist/mcp/nativeValueTrace-BEZbDieM.js +3601 -0
  1180. package/dist/mcp/officialToolContracts-CauCcSsc.js +1432 -0
  1181. package/dist/mcp/peMachine-aP1iYnHq.js +95 -0
  1182. package/dist/mcp/pngHeader-DQ-ObyY2.js +147 -0
  1183. package/dist/mcp/propertyListKeys-BfCo0k4w.js +356 -0
  1184. package/dist/mcp/providerCleanupError-DIRHxzWo.js +125 -0
  1185. package/dist/mcp/providerIdentities--ptAh481.js +31 -0
  1186. package/dist/mcp/providerIdentity-BCQ5n5tw.js +16 -0
  1187. package/dist/mcp/providerOperationHealth-9DRSGM8N.js +71 -0
  1188. package/dist/mcp/rolldown-runtime-BjeaiXFo.js +121 -0
  1189. package/dist/mcp/safeJson-NeGfpkrI.js +25 -0
  1190. package/dist/mcp/scanCanonical-CF3ATd1V.js +3788 -0
  1191. package/dist/mcp/serverIdentity-BK0Ejd_Y.js +1507 -0
  1192. package/dist/mcp/sourceMapEnvelope-DAaRUIGj.js +94 -0
  1193. package/dist/mcp/toolContracts-BPoHQdlC.js +12414 -0
  1194. package/dist/mcp/toolOutputSchemaGroups-MJ_f-PMK.js +17730 -0
  1195. package/dist/mcp/webContentArtifact-DfGkgDcI.js +269 -0
  1196. package/dist/mcp/webRuntime-ccyhkRru.js +74 -0
  1197. package/dist/mcp/webSourceLocation-DKIum0vJ.js +13167 -0
  1198. package/dist/mcpDoctor.js +95 -70
  1199. package/dist/mcpStartupPolicy.js +20 -2
  1200. package/dist/native/AppleDispatchCoverage.js +57 -17
  1201. package/dist/native/AppleDispatchMetadata.js +82 -29
  1202. package/dist/native/AppleMachoFixups.js +208 -35
  1203. package/dist/native/AppleMachoSelection.js +30 -23
  1204. package/dist/native/AppleObjcCategories.js +13 -3
  1205. package/dist/native/AppleObjcDispatchFacets.js +95 -17
  1206. package/dist/native/AppleObjcProperties.js +61 -17
  1207. package/dist/native/AppleObjcProtocols.js +25 -7
  1208. package/dist/native/AppleSwiftVtables.js +2 -0
  1209. package/dist/native/CommandRunner.js +146 -32
  1210. package/dist/native/LldbCallTracer.js +235 -179
  1211. package/dist/native/LldbReadbackFiles.js +70 -0
  1212. package/dist/native/LldbRetainedObservations.js +28 -56
  1213. package/dist/native/MachoArchitectureSelection.js +50 -0
  1214. package/dist/native/NativeCallObservation.js +55 -53
  1215. package/dist/native/NativeCallTarget.js +95 -0
  1216. package/dist/native/NativeMacOSProvider.js +318 -188
  1217. package/dist/native/NativeMachoInspection.js +155 -81
  1218. package/dist/native/NativePlistSource.js +179 -0
  1219. package/dist/native/NativeUiCleanupError.js +30 -0
  1220. package/dist/native/NativeUiHelperRuntime.js +48 -35
  1221. package/dist/native/NativeUiObservation.js +69 -47
  1222. package/dist/native/SignatureTargetBinding.js +147 -65
  1223. package/dist/native/parsers/codesign.js +27 -10
  1224. package/dist/native/parsers/demangle.js +22 -12
  1225. package/dist/native/parsers/dyldInfo.js +73 -4
  1226. package/dist/native/parsers/lipo.js +53 -19
  1227. package/dist/native/parsers/machoUuid.js +150 -0
  1228. package/dist/native/parsers/otool.js +275 -32
  1229. package/dist/native/parsers/plist.js +40 -25
  1230. package/dist/native/pe/PeResourceLayout.js +22 -7
  1231. package/dist/native/pe/PeResourceParser.js +10 -9
  1232. package/dist/native/pe/PeResourcesProvider.js +76 -15
  1233. package/dist/native/pwndbg/CoreFileMappingAuthority.js +51 -0
  1234. package/dist/native/pwndbg/PwndbgCoreContext.js +39 -28
  1235. package/dist/native/pwntools/PwntoolsDecoder.js +339 -52
  1236. package/dist/native/pwntools/PwntoolsFailures.js +19 -4
  1237. package/dist/native/pwntools/PwntoolsInputLimit.js +27 -0
  1238. package/dist/native/pwntools/PwntoolsRecordedCrashProvider.js +38 -16
  1239. package/dist/native/pwntools/PwntoolsResourceLimits.js +3 -3
  1240. package/dist/native/pwntools/RecordedCrashSourceBindings.js +12 -8
  1241. package/dist/native/pwntools/RecordedCrashStructureBindings.js +3 -1
  1242. package/dist/objdump/ObjdumpCommand.js +24 -0
  1243. package/dist/pcap/PcapCommand.js +146 -0
  1244. package/dist/pcap/PcapConfiguration.js +93 -0
  1245. package/dist/pcap/PcapNativeBound.js +58 -0
  1246. package/dist/pcap/PcapOutput.js +276 -0
  1247. package/dist/pcap/PcapProvider.js +454 -0
  1248. package/dist/pcap/PcapSnapshot.js +191 -0
  1249. package/dist/process/ArtifactAnalysisResources.js +306 -0
  1250. package/dist/process/BoundedFileBytes.js +8 -3
  1251. package/dist/process/CurrentEntrypointPath.js +8 -0
  1252. package/dist/process/DarwinProcessRunTokenReader.js +276 -61
  1253. package/dist/process/DetachedPgpSignature.js +57 -0
  1254. package/dist/process/ExecFileBoundedOutput.js +44 -0
  1255. package/dist/process/ExecFileOutput.js +44 -17
  1256. package/dist/{hopper/HopperTargetLease.js → process/HopperLease.js} +76 -19
  1257. package/dist/process/JavaScriptWorkerMemoryLimit.js +25 -0
  1258. package/dist/process/LinuxResourceLimits.js +60 -0
  1259. package/dist/process/MacCodeSignature.js +3 -0
  1260. package/dist/process/OwnedCommand.js +144 -25
  1261. package/dist/process/PrivateRuntimeRoot.js +9 -19
  1262. package/dist/process/PrivateRuntimeRootUnavailableError.js +10 -0
  1263. package/dist/process/ProcessOwnership.js +70 -17
  1264. package/dist/process/ProcessOwnershipObservation.js +35 -4
  1265. package/dist/process/ProviderDeadline.js +58 -12
  1266. package/dist/process/ProviderProcess.js +233 -17
  1267. package/dist/process/RegexMatcher.js +96 -0
  1268. package/dist/process/SharedStartupAttempt.js +59 -0
  1269. package/dist/process/WindowsAuthority.js +48 -39
  1270. package/dist/process/WindowsBatchCommand.js +46 -0
  1271. package/dist/process/boundedUtf8Text.js +13 -0
  1272. package/dist/process/capture/FilesystemSnapshot.js +63 -11
  1273. package/dist/process/capture/ProcessCaptureClock.js +2 -0
  1274. package/dist/process/capture/ProcessCaptureError.js +64 -7
  1275. package/dist/process/capture/ProcessCaptureJournal.js +2 -1
  1276. package/dist/process/capture/ProcessCaptureLifecycle.js +104 -56
  1277. package/dist/process/capture/ProcessCaptureProgress.js +7 -4
  1278. package/dist/process/capture/ProcessHarness.js +34 -17
  1279. package/dist/process/capture/ProcessNormalization.js +278 -36
  1280. package/dist/process/capture/ProcessSampling.js +3 -2
  1281. package/dist/process/capture/ProcessScenarioRuntimeValidation.js +13 -13
  1282. package/dist/process/capture/TerminalRenderer.js +31 -10
  1283. package/dist/process/ownedDebuggerSession.js +203 -0
  1284. package/dist/process/snapshotEnvironment.js +8 -8
  1285. package/dist/{application/binary → providers}/AnalysisClientCleanup.js +3 -3
  1286. package/dist/providers/AnalysisClientCreation.js +193 -0
  1287. package/dist/providers/AnalysisClientFailure.js +191 -0
  1288. package/dist/providers/DeferredAnalysisClient.js +48 -0
  1289. package/dist/providers/OwnedCommandCleanup.js +65 -0
  1290. package/dist/providers/ProviderInspectionScope.js +10 -0
  1291. package/dist/recordedCatalogDigests.js +2 -0
  1292. package/dist/reference/ReferenceSourceReader.js +64 -1
  1293. package/dist/reference/ReferenceSourceReaderEntries.js +79 -56
  1294. package/dist/reference/ReferenceSourceReaderErrors.js +5 -1
  1295. package/dist/reference/ReferenceSourceReaderFile.js +2 -2
  1296. package/dist/reference/ReferenceSourceReaderTypes.js +1 -2
  1297. package/dist/reference/ReferenceSourceReaderValidate.js +0 -1
  1298. package/dist/rizin/RizinCommand.js +14 -0
  1299. package/dist/rizin/RizinDebugSessionManager.js +1111 -0
  1300. package/dist/rust/RustAuditableReader.js +309 -0
  1301. package/dist/rust/RustBinaryImage.js +116 -0
  1302. package/dist/rust/RustBinaryProvider.js +194 -0
  1303. package/dist/server/EvidenceMcpServer.js +160 -37
  1304. package/dist/server/admittedToolOperation.js +7 -2
  1305. package/dist/server/contractToolHandler.js +17 -4
  1306. package/dist/server/createServer.js +179 -30
  1307. package/dist/server/externalMutationAdmission.js +50 -0
  1308. package/dist/server/mcpProgress.js +4 -2
  1309. package/dist/server/promptCompletion.js +43 -28
  1310. package/dist/server/providerEnvironment.js +3 -0
  1311. package/dist/server/registerAnalysisViewTool.js +6 -2
  1312. package/dist/server/registerAndroidTools.js +22 -4
  1313. package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +8 -1
  1314. package/dist/server/registerArtifactComparisonTool.js +13 -2
  1315. package/dist/server/registerArtifactTools.js +21 -1
  1316. package/dist/server/registerBrowserScenarioTool.js +7 -5
  1317. package/dist/server/registerBrowserTools.js +4 -8
  1318. package/dist/server/registerBundleComparisonTool.js +4 -4
  1319. package/dist/server/registerCaptureTools.js +12 -0
  1320. package/dist/server/registerCutterTools.js +32 -0
  1321. package/dist/server/registerElectronTools.js +13 -21
  1322. package/dist/server/registerEnhancedTools.js +7 -6
  1323. package/dist/server/registerEvidenceTools.js +14 -10
  1324. package/dist/server/registerEvmTools.js +22 -4
  1325. package/dist/server/registerFlutterTools.js +17 -0
  1326. package/dist/server/registerFridaTools.js +201 -0
  1327. package/dist/server/registerFunctionComparisonTool.js +29 -9
  1328. package/dist/server/registerGdbTools.js +64 -0
  1329. package/dist/server/registerGoTools.js +9 -0
  1330. package/dist/server/registerInvestigationTools/helpers.js +2 -2
  1331. package/dist/server/registerInvestigationTools.js +31 -27
  1332. package/dist/server/registerJavaScriptRuntimeObservationTools.js +3 -9
  1333. package/dist/server/registerManagedTools.js +11 -1
  1334. package/dist/server/registerManagedWorkflowTools/evidence.js +14 -7
  1335. package/dist/server/registerNativeTools.js +14 -0
  1336. package/dist/server/registerOfficialTools.js +5 -0
  1337. package/dist/server/registerPcapTools.js +35 -0
  1338. package/dist/server/registerProcessComparisonTool.js +12 -2
  1339. package/dist/server/registerReverseEngineeringTools.js +86 -0
  1340. package/dist/server/registerRizinDebugTools.js +53 -0
  1341. package/dist/server/registerRustTools.js +9 -0
  1342. package/dist/server/registerSessionRecordTools.js +19 -13
  1343. package/dist/server/registerSessionStatusTool.js +33 -8
  1344. package/dist/server/registerSessionTools.js +31 -31
  1345. package/dist/server/registerSignalTools.js +12 -0
  1346. package/dist/server/registerSqliteTools.js +9 -0
  1347. package/dist/server/registerWasmTools.js +46 -0
  1348. package/dist/server/registerWebNetworkCaptureTool.js +24 -10
  1349. package/dist/server/retainedSummaryDelivery.js +28 -0
  1350. package/dist/server/runDerivedOperation.js +2 -0
  1351. package/dist/server/sessionAvailabilityPolicy.js +3 -0
  1352. package/dist/server/toolRegistrationOptions.js +8 -0
  1353. package/dist/server/toolResult.js +52 -19
  1354. package/dist/server/toolResultEncoding.js +36 -3
  1355. package/dist/serverIdentity.js +17 -8
  1356. package/dist/signals/SigrokRecordingProvider.js +346 -0
  1357. package/dist/signals/parseDecoderDiscovery.js +65 -0
  1358. package/dist/sqlite/SqliteDatabaseFailures.js +147 -0
  1359. package/dist/sqlite/SqliteDatabaseInspection.js +436 -0
  1360. package/dist/sqlite/SqliteDatabaseLimits.js +16 -0
  1361. package/dist/sqlite/SqliteDatabaseProvider.js +295 -0
  1362. package/dist/sqlite/SqliteDatabaseSnapshot.js +182 -0
  1363. package/dist/sqlite/SqliteDatabaseWorker.js +46 -0
  1364. package/dist/sqlite/SqliteDatabaseWorkerExecution.js +127 -0
  1365. package/dist/wasm/WabtArtifactProvider.js +358 -0
  1366. package/dist/wasm/WabtFailures.js +119 -0
  1367. package/dist/wasm/WabtInterface.js +309 -0
  1368. package/dist/wasm/WabtOutput.js +60 -0
  1369. package/dist/wasm/WabtRelease.js +12 -0
  1370. package/dist/wasm/WabtRuntime.js +58 -0
  1371. package/dist/wasm/WabtString.js +48 -0
  1372. package/dist/wasm/WabtWat.js +147 -0
  1373. package/dist/wasm/WasmGlueAdapter.js +66 -0
  1374. package/dist/wasm/WasmInterfaceBudget.js +11 -0
  1375. package/dist/windows/WindowsNativeLoader.js +53 -9
  1376. package/dist/windows/WindowsOwnedProcess.js +150 -17
  1377. package/dist/windows/WindowsPrivateRuntime.js +66 -2
  1378. package/install.sh +157 -98
  1379. package/licenses/Apache-2.0.txt +202 -0
  1380. package/licenses/GCC-Runtime-Library-Exception-3.1.txt +73 -0
  1381. package/licenses/GPL-3.0.txt +674 -0
  1382. package/licenses/LGPL-2.0.txt +480 -0
  1383. package/licenses/MIT-template.txt +18 -0
  1384. package/licenses/MinGW-w64-runtime.txt +240 -0
  1385. package/licenses/Node-22.19.0-LICENSE.txt +2666 -0
  1386. package/licenses/README.md +68 -0
  1387. package/licenses/cfworker-MIT.txt +21 -0
  1388. package/licenses/dotnet-runtime-MIT.txt +23 -0
  1389. package/licenses/frida-17.23.2-COPYING.txt +50 -0
  1390. package/licenses/ghidra-12.1.4-DISCLAIMER.txt +13 -0
  1391. package/licenses/ghidra-12.1.4-LICENSE.txt +201 -0
  1392. package/licenses/ghidra-12.1.4-NOTICE.txt +49 -0
  1393. package/licenses/npm-dependencies.txt +3757 -0
  1394. package/licenses/npm-runtime-notices.txt +8722 -0
  1395. package/licenses/upstream-sources.json +72 -0
  1396. package/licenses/xterm-MIT.txt +21 -0
  1397. package/native/windows/README.md +130 -12
  1398. package/native/windows/build/manifest.json +2 -2
  1399. package/native/windows/build/rea-windows-x64.node +0 -0
  1400. package/package.json +97 -22
  1401. package/scripts/electron-active-hook-boundaries.cjs +15 -2
  1402. package/scripts/electron-active-hook.cjs +412 -47
  1403. package/scripts/hopper-demo-x11.py +65 -13
  1404. package/scripts/prepack.mjs +5 -0
  1405. package/scripts/rea-android-workspace-guardian.mjs +46 -0
  1406. package/scripts/rea.mjs +89 -26
  1407. package/scripts/verify-windows-native-artifact.mjs +2 -2
  1408. package/skills/reverse-engineer-anything/SKILL.md +146 -11
  1409. package/skills/reverse-engineer-anything/references/android-applications.md +3 -1
  1410. package/skills/reverse-engineer-anything/references/connection-and-recovery.md +10 -10
  1411. package/skills/reverse-engineer-anything/references/evidence-workflows.md +23 -0
  1412. package/skills/reverse-engineer-anything/references/javascript-applications.md +72 -3
  1413. package/skills/reverse-engineer-anything/references/native-and-artifacts.md +149 -19
  1414. package/skills/reverse-engineer-anything/references/runtime-observation.md +57 -7
  1415. package/third_party/README.md +1 -1
  1416. package/third_party/wabt/README.md +24 -0
  1417. package/dist/browser/history/HarCaptureAdapter.js +0 -20
  1418. package/dist/cli/streamedJsonOutput.js +0 -135
  1419. package/dist/hopper/HopperRegexWorker.js +0 -27
  1420. /package/dist/{application/binary → process}/AbortablePromise.js +0 -0
@@ -0,0 +1,2205 @@
1
+ import { __esmMin } from "./rolldown-runtime-DXoylpqc.js";
2
+ import { artifactExtractionResultSchema, artifactInventoryResultSchema, buildInterfaceBuilderAnalysis, compareUnicodeCodePoints, createArtifactInspection, createEvidence, createPlistNumberCollector, createPlistNumberProjection, digestCanonicalValue, err, init_artifactGraph, init_artifactInspection, init_binaryTargetTypes, init_canonicalDigest, init_evidence, init_inputIssueProjection, init_interfaceBuilderGraph, init_interfaceBuilderKeyedArchive, init_plistNumbers, init_result, init_unicodeCodePointOrder, init_zipPackageFormat, interfaceBuilderConnectionFieldNames, interfaceBuilderLimitsSchema, isMachOFormat, isUIKitRuntimeConnectionClass, isZipPackageFormat, ok, projectInputIssues } from "./reconstructionObligationLedgerSchemas-Bi6sect1.js";
3
+ import { AnalysisCancelledError, AnalysisCapabilityUnavailableError, AnalysisInputError, AnalysisUnsupportedTargetError, freezeJsonSnapshot, init_analysisErrorCore, init_immutableJson, init_jsonValue, jsonValueSchema } from "./errorSchemas-Ixz_q7qt.js";
4
+ import { NonRegularFileReadError, init_RegularFile, sameRegularFileState } from "./OwnedRegularFile-D1f5nUCx.js";
5
+ import { ArtifactReaderFailure, init_ArtifactReader, sameArtifactSourceIdentity } from "./ArtifactReader-DMwm42bk.js";
6
+ import { artifactFileCancellationCause, assertArtifactReadActive, bindArtifactFileCleanup, init_ArtifactFileOperation, mapArtifactFileFailure, withArtifactRegularFile } from "./ArtifactFileOperation-Dg4BcoEM.js";
7
+ import { createAnalysisExecution, init_AnalysisProvider } from "./AnalysisProvider-BGrYaMVo.js";
8
+ import { ArtifactResourceScope, init_ArtifactResourceScope } from "./ArtifactResourceScope-CokZGcII.js";
9
+ import { ArtifactOperationError, init_artifactOperationError } from "./cliResultOutput-10sd6xGx.js";
10
+ import { ProviderCleanupError, init_providerCleanupError } from "./providerCleanupError-BhsJyAhk.js";
11
+ import { execFileOutput, init_ExecFileOutput } from "./ExecFileOutput-D6KLYTve.js";
12
+ import { init_snapshotEnvironment, snapshotEnvironment } from "./snapshotEnvironment-Yvx5qwsl.js";
13
+ import { InterfaceBuilderDecodeBudget, InterfaceBuilderDecodeBudgetExceeded, decodeXmlPlistText, estimateBinaryPlistExpansion, init_InterfaceBuilderDecodeBudget, init_propertyListXmlText, preflightPropertyListDecode } from "./InterfaceBuilderDecodeBudget-CW1IO3dG.js";
14
+ import { KeyedArchiveKindError, appleAssetCatalogInputSchema, appleResourceKeyFields, dylibResolutionInputSchema, dylibResolutionResultSchema, init_appleAssetCatalog, init_dyldPaths, init_dylibResolution, init_keyedArchive, init_plistValue, keyedArchiveInputSchema, keyedArchiveResultSchema, negativeZeroRealLimitation, nonFiniteRealLimitation, parseAppleAssetCatalogRecords, projectAppleAssetCatalogPage, projectKeyedArchive, projectPlistValue, resolveTreePath, traceDylibLoading, unknownDateLimitation, unknownRealLimitation } from "./toolOutputSchemaGroups-BqdSzySu.js";
15
+ import { ARTIFACT_GRAPH_PROVIDER, init_InvestigationProviders } from "./InvestigationProviders-CFh4a64d.js";
16
+ import { hasBinaryPlistSignature, hasNibArchiveSignature, init_appleArchiveFormat } from "./appleArchiveFormat-Bb3G5CCI.js";
17
+ import { init_readArtifactFileChunks, readArtifactFileChunks } from "./readArtifactFileChunks-BbTL_PtB.js";
18
+ import { init_propertyListKeys, omittedPrototypeKeysLimitation, parseXmlPropertyList } from "./propertyListKeys-D5dSASEy.js";
19
+ import { ArtifactPathRegistry, DirectoryArtifactReader, init_ArtifactPaths, init_DirectoryArtifactReader, normalizeArtifactPath } from "./DirectoryArtifactReader-CokAJ8vo.js";
20
+ import { SafeOutputTree, SafeOutputTreeCreationFailure, init_SafeOutputTree, init_SafeOutputTreeCreationFailure } from "./SafeOutputTree-i904hd_2.js";
21
+ import { ZipArtifactReader, init_ZipArtifactReader } from "./ZipArtifactReader-Jed69LEL.js";
22
+ import { hasMachoMagic, init_MachoLoadCommandReader, readMachoImage } from "./MachoLoadCommandReader-CZm6N5vF.js";
23
+ import { ARTIFACT_ANALYSIS_OPERATIONS, artifactExtractionExecutionSchema, artifactInventoryInputSchema, init_artifactToolContracts } from "./officialToolContracts-CzzVLx8I.js";
24
+ import { AsarArtifactReader, MachOSliceArtifactReader, abortIfNeeded, init_ArtifactHash, init_AsarArtifactReader, init_MachOSliceArtifactReader, init_scanCanonical, scanCanonicalArtifactInventoryInScope } from "./scanCanonical-CcDFUr-w.js";
25
+ import { artifactCapabilities, init_ArtifactProviderMetadata } from "./binary-CWVNJhAC.js";
26
+ import { z } from "zod";
27
+ import { basename, dirname, isAbsolute, join, relative, sep } from "node:path";
28
+ import { createHash } from "node:crypto";
29
+ import { TextDecoder } from "node:util";
30
+ import { lstat, readlink, realpath } from "node:fs/promises";
31
+ import { parseBinary } from "plist";
32
+
33
+ //#region dist/artifacts/apple/PlistNumberLiterals.js
34
+ var binaryObjectEnd, scanBinaryPlistNumberLiterals, decodeBinaryPlistNumbers;
35
+ function init_PlistNumberLiterals() {
36
+ return (init_PlistNumberLiterals = __esmMin((() => {
37
+ init_plistNumbers();
38
+ init_appleArchiveFormat();
39
+ binaryObjectEnd = (bytes, offset, objectEnd, referenceWidth) => {
40
+ const marker = bytes[offset];
41
+ if (marker === undefined) return undefined;
42
+ const type = marker >> 4;
43
+ let length = marker & 15;
44
+ let cursor = offset + 1;
45
+ if (length === 15 && type !== 0 && type !== 8) {
46
+ const extendedMarker = bytes[cursor];
47
+ if (extendedMarker === undefined || extendedMarker >> 4 !== 1) return undefined;
48
+ const width = 1 << (extendedMarker & 15);
49
+ if (width > 8 || cursor + 1 + width > objectEnd) return undefined;
50
+ cursor += 1;
51
+ let extendedLength = 0n;
52
+ for (let index = 0; index < width; index += 1) extendedLength = extendedLength << 8n | BigInt(bytes[cursor + index] ?? 0);
53
+ if (extendedLength > BigInt(Number.MAX_SAFE_INTEGER)) return undefined;
54
+ length = Number(extendedLength);
55
+ cursor += width;
56
+ }
57
+ let payloadLength;
58
+ if (type === 0) payloadLength = 0;
59
+ else if (type === 1 || type === 2) {
60
+ if ((marker & 15) > 4) return undefined;
61
+ payloadLength = 1 << (marker & 15);
62
+ } else if (type === 3) {
63
+ if (marker !== 51) return undefined;
64
+ payloadLength = 8;
65
+ } else if (type === 4 || type === 5 || type === 7) {
66
+ payloadLength = length;
67
+ } else if (type === 6) {
68
+ payloadLength = length * 2;
69
+ } else if (type === 8) {
70
+ payloadLength = (marker & 15) + 1;
71
+ } else if (type === 10 || type === 11 || type === 12) {
72
+ payloadLength = length * referenceWidth;
73
+ } else if (type === 13) {
74
+ payloadLength = length * 2 * referenceWidth;
75
+ } else return undefined;
76
+ const end = cursor + payloadLength;
77
+ return Number.isSafeInteger(end) && end <= objectEnd ? end : undefined;
78
+ };
79
+ scanBinaryPlistNumberLiterals = (bytes) => {
80
+ const output = createPlistNumberCollector();
81
+ const wideIntegers = [];
82
+ if (bytes.length < 40 || !hasBinaryPlistSignature(bytes)) return {
83
+ literals: output.result(true),
84
+ wideIntegers
85
+ };
86
+ const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
87
+ const trailer = bytes.length - 32;
88
+ const offsetWidth = bytes[trailer + 6] ?? 0;
89
+ if (![
90
+ 1,
91
+ 2,
92
+ 4,
93
+ 8
94
+ ].includes(offsetWidth)) return {
95
+ literals: output.result(true),
96
+ wideIntegers
97
+ };
98
+ const countRaw = view.getBigUint64(trailer + 8);
99
+ const tableRaw = view.getBigUint64(trailer + 24);
100
+ const safeMaximum = BigInt(Number.MAX_SAFE_INTEGER);
101
+ if (countRaw === 0n || countRaw > safeMaximum || tableRaw > safeMaximum) return {
102
+ literals: output.result(true),
103
+ wideIntegers
104
+ };
105
+ if (tableRaw < 8n || tableRaw >= BigInt(trailer)) return {
106
+ literals: output.result(true),
107
+ wideIntegers
108
+ };
109
+ const offsetTable = Number(tableRaw);
110
+ const capacity = Math.floor((trailer - offsetTable) / offsetWidth);
111
+ if (countRaw > BigInt(capacity)) return {
112
+ literals: output.result(true),
113
+ wideIntegers
114
+ };
115
+ const count = Number(countRaw);
116
+ const referenceWidth = bytes[trailer + 7] ?? 0;
117
+ if (![
118
+ 1,
119
+ 2,
120
+ 4,
121
+ 8
122
+ ].includes(referenceWidth)) return {
123
+ literals: output.result(true),
124
+ wideIntegers
125
+ };
126
+ const unsigned = (offset) => {
127
+ if (offset < offsetTable || offset + offsetWidth > trailer) return undefined;
128
+ if (offsetWidth === 1) return view.getUint8(offset);
129
+ if (offsetWidth === 2) return view.getUint16(offset);
130
+ if (offsetWidth === 4) return view.getUint32(offset);
131
+ const value = view.getBigUint64(offset);
132
+ return value > safeMaximum ? undefined : Number(value);
133
+ };
134
+ const objectOffsets = [];
135
+ for (let index = 0; index < count; index += 1) {
136
+ const offset = unsigned(offsetTable + index * offsetWidth);
137
+ if (offset === undefined || offset < 8 || offset >= offsetTable) return {
138
+ literals: output.result(true),
139
+ wideIntegers
140
+ };
141
+ objectOffsets.push(offset);
142
+ }
143
+ const sortedOffsets = [...new Set(objectOffsets)].sort((a, b) => a - b);
144
+ for (let index = 0; index < sortedOffsets.length; index += 1) {
145
+ const offset = sortedOffsets[index];
146
+ if (offset === undefined) continue;
147
+ const nextOffset = sortedOffsets[index + 1] ?? offsetTable;
148
+ if (binaryObjectEnd(bytes, offset, nextOffset, referenceWidth) === undefined) return {
149
+ literals: output.result(true),
150
+ wideIntegers: []
151
+ };
152
+ }
153
+ for (const offset of objectOffsets) {
154
+ const marker = bytes[offset] ?? 0;
155
+ const type = marker >> 4;
156
+ if (type !== 1 && type !== 2) continue;
157
+ const width = 2 ** (marker & 15);
158
+ if (offset + 1 + width > offsetTable) return {
159
+ literals: output.result(true),
160
+ wideIntegers
161
+ };
162
+ if (type === 1 && width === 8) output.integer(view.getBigInt64(offset + 1));
163
+ else if (type === 1 && width === 16) {
164
+ const value = BigInt.asIntN(128, view.getBigUint64(offset + 1) << 64n | view.getBigUint64(offset + 9));
165
+ output.integer(value);
166
+ wideIntegers.push({
167
+ offset,
168
+ value
169
+ });
170
+ } else if (type === 1 && width > 4) return {
171
+ literals: output.result(true),
172
+ wideIntegers
173
+ };
174
+ else if (type === 2 && width === 4) output.real(view.getFloat32(offset + 1));
175
+ else if (type === 2 && width === 8) output.real(view.getFloat64(offset + 1));
176
+ else if (type === 2) return {
177
+ literals: output.result(true),
178
+ wideIntegers
179
+ };
180
+ }
181
+ return {
182
+ literals: output.result(),
183
+ wideIntegers
184
+ };
185
+ };
186
+ decodeBinaryPlistNumbers = (bytes, metadata) => {
187
+ if (metadata.wideIntegers.length === 0) return bytes;
188
+ const compatible = Buffer.from(bytes);
189
+ for (const { offset, value } of metadata.wideIntegers) {
190
+ compatible[offset] = 35;
191
+ compatible.writeDoubleBE(Number(value), offset + 1);
192
+ }
193
+ return compatible;
194
+ };
195
+ })))();
196
+ }
197
+
198
+ //#endregion
199
+ //#region dist/artifacts/apple/KeyedArchiveReader.js
200
+ var MAX_BYTES, MAX_DECODE_BYTES, decodeKeyedArchiveBytes, keyedArchiveKindRemediation, inspectBundleKeyedArchive, archivePathError;
201
+ function init_KeyedArchiveReader() {
202
+ return (init_KeyedArchiveReader = __esmMin((() => {
203
+ init_analysisErrorCore();
204
+ init_plistValue();
205
+ init_plistNumbers();
206
+ init_PlistNumberLiterals();
207
+ init_propertyListKeys();
208
+ init_keyedArchive();
209
+ init_DirectoryArtifactReader();
210
+ init_ArtifactReader();
211
+ init_propertyListXmlText();
212
+ init_appleArchiveFormat();
213
+ init_InterfaceBuilderDecodeBudget();
214
+ MAX_BYTES = 64 * 1024 * 1024;
215
+ MAX_DECODE_BYTES = 8 * MAX_BYTES;
216
+ decodeKeyedArchiveBytes = (bytes, selection) => {
217
+ if (bytes.length > MAX_BYTES) throw new RangeError("Keyed archive exceeds 64 MiB");
218
+ if (hasNibArchiveSignature(bytes)) throw new KeyedArchiveKindError("Selected file is a compiled NIBArchive, not a Foundation plist archive; decode it with decode_interface_builder", "nib-archive");
219
+ const binary = hasBinaryPlistSignature(bytes);
220
+ const xmlText = binary ? undefined : decodeXmlPlistText(bytes);
221
+ const binaryExpansion = binary ? estimateBinaryPlistExpansion(bytes, MAX_DECODE_BYTES, {
222
+ budget: "the keyed archive decode budget",
223
+ fail: (kind, message) => kind === "cycle" ? new TypeError("binary plist object references form a cycle, which a property list cannot represent") : new RangeError(message),
224
+ bounds: "decoder",
225
+ numberProjection: true
226
+ }) : undefined;
227
+ const binaryNumberMetadata = binary ? scanBinaryPlistNumberLiterals(bytes) : undefined;
228
+ const parsed = binaryExpansion !== undefined ? {
229
+ value: parseBinary(decodeBinaryPlistNumbers(bytes, binaryNumberMetadata)),
230
+ numberLiterals: binaryNumberMetadata.literals,
231
+ omittedPrototypeKeys: binaryExpansion.binaryPrototypeKeyObserved ? null : 0
232
+ } : parseXmlPropertyList(xmlText ?? "");
233
+ const { nonFiniteRealCount, unknownRealCount, negativeZeroRealCount, unknownDateCount, ...graph } = projectKeyedArchive(parsed.value, selection);
234
+ const numbers = createPlistNumberProjection(parsed.numberLiterals);
235
+ const roots = Object.fromEntries(Object.entries(graph.roots).map(([name, value]) => [name, numbers.project(value)]));
236
+ const objects = graph.objects.map((object) => ({
237
+ ...object,
238
+ value: numbers.project(object.value)
239
+ }));
240
+ return {
241
+ archive_format: binary ? "binary-plist" : "xml-plist",
242
+ ...graph,
243
+ roots,
244
+ objects,
245
+ limitations: [
246
+ ...graph.limitations,
247
+ ...numbers.limitations(),
248
+ ...parsed.omittedPrototypeKeys === 0 ? [] : [omittedPrototypeKeysLimitation(parsed.omittedPrototypeKeys)],
249
+ ...nonFiniteRealCount === 0 ? [] : [nonFiniteRealLimitation(nonFiniteRealCount)],
250
+ ...unknownRealCount === 0 ? [] : [unknownRealLimitation(unknownRealCount)],
251
+ ...negativeZeroRealCount === 0 ? [] : [negativeZeroRealLimitation(negativeZeroRealCount)],
252
+ ...unknownDateCount === 0 ? [] : [unknownDateLimitation(unknownDateCount)]
253
+ ]
254
+ };
255
+ };
256
+ keyedArchiveKindRemediation = (kind, platform) => {
257
+ if (kind === "nib-archive") return "Decode compiled NIBArchive files with decode_interface_builder on the app bundle.";
258
+ 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.";
259
+ };
260
+ inspectBundleKeyedArchive = async (input) => {
261
+ const selected = keyedArchiveInputSchema.parse(input.parameters);
262
+ 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}`);
263
+ const reader = new DirectoryArtifactReader(input.bundlePath);
264
+ try {
265
+ const wanted = selected.path.normalize("NFC");
266
+ let entry;
267
+ for await (const candidate of reader.entries(input.signal, (directory) => wanted.startsWith(`${directory.normalize("NFC")}/`))) {
268
+ if (candidate.path.normalize("NFC") !== wanted) continue;
269
+ if (candidate.kind !== "file") throw archivePathError("invalid_value", `Archive path selects a ${candidate.kind}, not a regular file: ${selected.path}`);
270
+ if ((candidate.declaredSize ?? 0) > MAX_BYTES) throw new ArtifactReaderFailure("limit", "Keyed archive exceeds 64 MiB");
271
+ if (entry !== undefined) throw archivePathError("invalid_value", `Archive path matches multiple Unicode-equivalent bundle entries; selection is ambiguous: ${selected.path}`);
272
+ entry = candidate;
273
+ }
274
+ if (entry === undefined) throw archivePathError("invalid_value", `No regular file exists at ${selected.path} in the active app bundle.`);
275
+ const stream = await reader.open(entry, input.signal);
276
+ const chunks = [];
277
+ let size = 0;
278
+ for await (const chunk of stream) {
279
+ if (input.signal?.aborted) {
280
+ stream.destroy();
281
+ throw new ArtifactReaderFailure("cancelled", "Archive inspection cancelled");
282
+ }
283
+ const bytes = z.instanceof(Buffer).parse(chunk);
284
+ size += bytes.length;
285
+ if (size > MAX_BYTES) {
286
+ stream.destroy();
287
+ throw new ArtifactReaderFailure("limit", "Keyed archive exceeds 64 MiB");
288
+ }
289
+ chunks.push(bytes);
290
+ }
291
+ const bytes = Buffer.concat(chunks, size);
292
+ try {
293
+ return keyedArchiveResultSchema.parse({
294
+ target_sha256: input.targetSha256,
295
+ archive_path: entry.path,
296
+ archive_sha256: createHash("sha256").update(bytes).digest("hex"),
297
+ ...decodeKeyedArchiveBytes(bytes, selected)
298
+ });
299
+ } catch (cause) {
300
+ if (cause instanceof AnalysisInputError) throw cause;
301
+ if (cause instanceof KeyedArchiveKindError) throw new AnalysisUnsupportedTargetError("inspect_keyed_archive", join(input.bundlePath, entry.path), cause.message, {
302
+ cause,
303
+ remediationAction: keyedArchiveKindRemediation(cause.kind, input.platform ?? process.platform)
304
+ });
305
+ throw new ArtifactReaderFailure(cause instanceof RangeError ? "limit" : "format", `Cannot decode selected Foundation keyed archive: ${cause instanceof Error ? cause.message : String(cause)}`, { cause });
306
+ }
307
+ } finally {
308
+ await reader.close();
309
+ }
310
+ };
311
+ archivePathError = (reason, message) => new AnalysisInputError("inspect_keyed_archive", undefined, [{
312
+ path: ["path"],
313
+ reason,
314
+ message
315
+ }]);
316
+ })))();
317
+ }
318
+
319
+ //#endregion
320
+ //#region dist/artifacts/OrderedReads.js
321
+ var consumeWithOrderedReads;
322
+ function init_OrderedReads() {
323
+ return (init_OrderedReads = __esmMin((() => {
324
+ consumeWithOrderedReads = async (items, width, read, consume) => {
325
+ const pending = [];
326
+ const consumeNext = async () => {
327
+ const next = pending.shift();
328
+ if (next === undefined) return;
329
+ const result = await next.result;
330
+ if (!result.ok) throw result.error;
331
+ await consume(next.item, result.value);
332
+ };
333
+ const iterator = items[Symbol.asyncIterator]();
334
+ let iterating = true;
335
+ try {
336
+ while (iterating) {
337
+ let step;
338
+ try {
339
+ step = await iterator.next();
340
+ } catch (cause) {
341
+ iterating = false;
342
+ while (pending.length > 0) await consumeNext();
343
+ throw cause;
344
+ }
345
+ if (step.done === true) {
346
+ iterating = false;
347
+ break;
348
+ }
349
+ const started = read(step.value);
350
+ if (started === undefined) continue;
351
+ pending.push({
352
+ item: step.value,
353
+ result: started.then((value) => ({
354
+ ok: true,
355
+ value
356
+ }), (error) => ({
357
+ ok: false,
358
+ error
359
+ }))
360
+ });
361
+ if (pending.length >= width) await consumeNext();
362
+ }
363
+ while (pending.length > 0) await consumeNext();
364
+ } finally {
365
+ if (iterating) await iterator.return?.().catch(() => undefined);
366
+ await Promise.all(pending.map(({ result }) => result));
367
+ }
368
+ };
369
+ })))();
370
+ }
371
+
372
+ //#endregion
373
+ //#region dist/artifacts/apple/DylibFileAccess.js
374
+ var DylibFileAccess, classifyDylibReadFailure, deniedDisplayPath, changed;
375
+ function init_DylibFileAccess() {
376
+ return (init_DylibFileAccess = __esmMin((() => {
377
+ init_RegularFile();
378
+ init_ArtifactReader();
379
+ init_ArtifactFileOperation();
380
+ init_readArtifactFileChunks();
381
+ init_MachoLoadCommandReader();
382
+ DylibFileAccess = class {
383
+ resources;
384
+ root;
385
+ signal;
386
+ constructor(resources, root, signal) {
387
+ this.resources = resources;
388
+ this.root = root;
389
+ this.signal = signal;
390
+ }
391
+ startsWithMachoMagic(entry) {
392
+ return this.#read(entry.adapterKey, async (file, initial) => {
393
+ if (!sameArtifactSourceIdentity(entry.sourceIdentity, initial)) throw changed(entry.adapterKey);
394
+ const bytes = new Uint8Array(4);
395
+ const { bytesRead } = await file.read(bytes, 0, bytes.length, 0);
396
+ return hasMachoMagic(bytes.subarray(0, bytesRead));
397
+ });
398
+ }
399
+ image(path) {
400
+ return this.#read(path, async (file, identity) => {
401
+ const size = Number(identity.size);
402
+ if (!Number.isSafeInteger(size)) throw new ArtifactReaderFailure("limit", `Mach-O file extent is not safely addressable: ${path}`);
403
+ const facts = await readMachoImage(async (offset, length) => {
404
+ assertArtifactReadActive(this.signal);
405
+ const bytes = new Uint8Array(Math.max(0, Math.min(length, size - offset)));
406
+ const { bytesRead } = await file.read(bytes, 0, bytes.length, offset);
407
+ assertArtifactReadActive(this.signal);
408
+ return bytes.subarray(0, bytesRead);
409
+ }, size);
410
+ return {
411
+ facts,
412
+ identity
413
+ };
414
+ });
415
+ }
416
+ sha256(path, expected) {
417
+ return this.#read(path, async (file, initial) => {
418
+ if (expected !== undefined && !sameRegularFileState(expected, initial)) throw changed(path);
419
+ const hash = createHash("sha256");
420
+ const source = readArtifactFileChunks(file, {
421
+ end: initial.size,
422
+ signal: this.signal
423
+ });
424
+ for await (const chunk of source) hash.update(chunk);
425
+ const coverage = source.readCoverage();
426
+ if (coverage.kind !== "complete" || coverage.bytes !== initial.size) throw changed(path);
427
+ return hash.digest("hex");
428
+ });
429
+ }
430
+ async #read(path, operation) {
431
+ try {
432
+ return await withArtifactRegularFile(path, this.resources, this.signal, async (file) => {
433
+ const initial = await file.stat({ bigint: true });
434
+ assertArtifactReadActive(this.signal);
435
+ const result = await operation(file, initial);
436
+ const opened = await file.stat({ bigint: true });
437
+ const named = await lstat(path, { bigint: true });
438
+ if (!sameRegularFileState(initial, opened) || !sameRegularFileState(initial, named)) throw changed(path);
439
+ assertArtifactReadActive(this.signal);
440
+ return result;
441
+ });
442
+ } catch (cause) {
443
+ throw classifyDylibReadFailure(this.root, cause);
444
+ }
445
+ }
446
+ };
447
+ classifyDylibReadFailure = (root, cause) => mapArtifactFileFailure(cause, (primary) => {
448
+ if (primary instanceof NonRegularFileReadError) return new ArtifactReaderFailure("format", `Dyld input is not a regular file: ${primary.path}`, { cause: primary });
449
+ if (primary instanceof Error && "code" in primary && (primary.code === "EACCES" || primary.code === "EPERM")) {
450
+ const path = "path" in primary && typeof primary.path === "string" ? primary.path : undefined;
451
+ const display = path === undefined ? "a file in the analyzed root" : deniedDisplayPath(root, path);
452
+ return new ArtifactReaderFailure("unavailable", `Permission denied (${primary.code}) reading ${display}`, { cause: primary });
453
+ }
454
+ return primary;
455
+ });
456
+ deniedDisplayPath = (root, path) => {
457
+ const inside = relative(root, path);
458
+ const outside = isAbsolute(inside) || inside === ".." || inside.startsWith(`..${sep}`);
459
+ return inside === "" || outside ? path : inside;
460
+ };
461
+ changed = (path) => new ArtifactReaderFailure("integrity", `${path} changed while its dyld load commands were traced`);
462
+ })))();
463
+ }
464
+
465
+ //#endregion
466
+ //#region dist/artifacts/apple/DylibResolutionReader.js
467
+ var OPERATION, MAGIC_READ_CONCURRENCY, FilesystemTreeView, traceDylibResolution, executableRoots, compare, requireMachoRoots, missing;
468
+ function init_DylibResolutionReader() {
469
+ return (init_DylibResolutionReader = __esmMin((() => {
470
+ init_analysisErrorCore();
471
+ init_dyldPaths();
472
+ init_dylibResolution();
473
+ init_inputIssueProjection();
474
+ init_ArtifactReader();
475
+ init_DirectoryArtifactReader();
476
+ init_OrderedReads();
477
+ init_DylibFileAccess();
478
+ init_ArtifactResourceScope();
479
+ init_ArtifactFileOperation();
480
+ OPERATION = "trace_dylib_resolution";
481
+ MAGIC_READ_CONCURRENCY = 8;
482
+ FilesystemTreeView = class {
483
+ root;
484
+ files;
485
+ signal;
486
+ #entries = new Map();
487
+ #images = new Map();
488
+ #identities = new Map();
489
+ constructor(root, files, signal) {
490
+ this.root = root;
491
+ this.files = files;
492
+ this.signal = signal;
493
+ }
494
+ entry(path) {
495
+ const cached = this.#entries.get(path);
496
+ if (cached !== undefined) return cached;
497
+ const pending = this.#readEntry(path);
498
+ this.#entries.set(path, pending);
499
+ return pending;
500
+ }
501
+ image(path) {
502
+ const cached = this.#images.get(path);
503
+ if (cached !== undefined) return cached;
504
+ const pending = this.files.image(join(this.root, path)).then(({ facts, identity }) => {
505
+ this.#identities.set(path, identity);
506
+ return facts;
507
+ });
508
+ this.#images.set(path, pending);
509
+ return pending;
510
+ }
511
+ /** Identity of the file whose header bytes `image()` parsed. */
512
+ identity(path) {
513
+ return this.#identities.get(path);
514
+ }
515
+ async #readEntry(path) {
516
+ assertArtifactReadActive(this.signal);
517
+ const absolute = join(this.root, path);
518
+ try {
519
+ const metadata = await lstat(absolute);
520
+ if (metadata.isSymbolicLink()) return {
521
+ kind: "symlink",
522
+ target: await readlink(absolute)
523
+ };
524
+ if (metadata.isDirectory()) return { kind: "directory" };
525
+ return metadata.isFile() ? { kind: "file" } : undefined;
526
+ } catch (cause) {
527
+ if (missing(cause)) return undefined;
528
+ throw cause;
529
+ }
530
+ }
531
+ };
532
+ traceDylibResolution = async (options) => {
533
+ const parsed = dylibResolutionInputSchema.safeParse(options.parameters);
534
+ if (!parsed.success) throw new AnalysisInputError(OPERATION, { cause: parsed.error }, projectInputIssues(parsed.error.issues, options.parameters));
535
+ const resources = options.resourceScope ?? new ArtifactResourceScope();
536
+ return await resources.run(async () => {
537
+ let root = options.rootPath;
538
+ try {
539
+ assertArtifactReadActive(options.signal);
540
+ root = await realpath(options.rootPath);
541
+ assertArtifactReadActive(options.signal);
542
+ const files = new DylibFileAccess(resources, root, options.signal);
543
+ const target = relative(root, await realpath(options.targetPath)).split(sep).join("/");
544
+ assertArtifactReadActive(options.signal);
545
+ const view = new FilesystemTreeView(root, files, options.signal);
546
+ const { roots: requested, unclassified } = parsed.data.roots !== undefined ? {
547
+ roots: parsed.data.roots,
548
+ unclassified: []
549
+ } : options.enumerateRoots ? await executableRoots(root, view, files, options.signal) : {
550
+ roots: [target],
551
+ unclassified: []
552
+ };
553
+ const roots = await requireMachoRoots(view, requested, parsed.data.roots !== undefined);
554
+ const trace = await traceDylibLoading(view, {
555
+ roots,
556
+ unclassified,
557
+ ...parsed.data.architecture === undefined ? {} : { architecture: parsed.data.architecture },
558
+ ...options.signal === undefined ? {} : { signal: options.signal }
559
+ });
560
+ const digests = new Map();
561
+ for (const { path } of trace.images) digests.set(path, await files.sha256(join(root, path), view.identity(path)));
562
+ const targetDigest = digests.get(target) ?? await files.sha256(join(root, target), undefined);
563
+ if (targetDigest !== options.targetSha256) throw new ArtifactReaderFailure("integrity", `Active target digest changed: expected ${options.targetSha256}, observed ${targetDigest}`);
564
+ assertArtifactReadActive(options.signal);
565
+ return dylibResolutionResultSchema.parse({
566
+ ...trace,
567
+ root_path: options.rootPath,
568
+ target_sha256: options.targetSha256,
569
+ images: trace.images.map((image) => ({
570
+ ...image,
571
+ sha256: digests.get(image.path)
572
+ }))
573
+ });
574
+ } catch (cause) {
575
+ throw classifyDylibReadFailure(root, cause);
576
+ }
577
+ });
578
+ };
579
+ executableRoots = async (root, view, files, signal) => {
580
+ const roots = [];
581
+ const unclassified = [];
582
+ await consumeWithOrderedReads(new DirectoryArtifactReader(root).entries(signal), MAGIC_READ_CONCURRENCY, (entry) => entry.kind === "file" ? files.startsWithMachoMagic(entry) : undefined, async (entry, macho) => {
583
+ if (!macho) return;
584
+ const facts = await view.image(entry.path);
585
+ if (facts.status === "malformed" || facts.status === "unsupported") unclassified.push(entry.path);
586
+ else if (facts.status === "parsed" && facts.slices.some(({ file_type: type }) => type === "execute")) roots.push(entry.path);
587
+ });
588
+ return {
589
+ roots: roots.sort(compare),
590
+ unclassified: unclassified.sort(compare)
591
+ };
592
+ };
593
+ compare = (left, right) => left < right ? -1 : left > right ? 1 : 0;
594
+ requireMachoRoots = async (view, roots, callerSelected) => {
595
+ const resolved = [];
596
+ for (const [index, path] of roots.entries()) {
597
+ const reject = (reason, message) => callerSelected ? new AnalysisInputError(OPERATION, undefined, [{
598
+ path: ["roots", index],
599
+ reason: "invalid_value",
600
+ message
601
+ }]) : new ArtifactReaderFailure(reason, message);
602
+ const lookup = await resolveTreePath(view, path);
603
+ if (lookup.kind === "escapes") throw reject("path", `Root ${path} resolves outside the analyzed root`);
604
+ if (lookup.kind !== "file") throw reject("path", `Root ${path} is not a regular file in the analyzed root`);
605
+ if ((await view.image(lookup.path)).status === "not-mach-o") throw reject("format", `Root ${path} is not a Mach-O image`);
606
+ if (!resolved.includes(lookup.path)) resolved.push(lookup.path);
607
+ }
608
+ return resolved;
609
+ };
610
+ missing = (cause) => cause instanceof Error && "code" in cause && (cause.code === "ENOENT" || cause.code === "ENOTDIR");
611
+ })))();
612
+ }
613
+
614
+ //#endregion
615
+ //#region dist/artifacts/inventory/ArtifactInventory.js
616
+ var inventoryArtifact, scanArtifactInventory, scanArtifactInventoryInScope;
617
+ function init_ArtifactInventory() {
618
+ return (init_ArtifactInventory = __esmMin((() => {
619
+ init_artifactGraph();
620
+ init_ArtifactHash();
621
+ init_scanCanonical();
622
+ inventoryArtifact = async (inputPath, options) => {
623
+ const snapshot = await scanArtifactInventory(inputPath, options);
624
+ return artifactInventoryResultSchema.parse(snapshot);
625
+ };
626
+ scanArtifactInventory = async (inputPath, options) => options.resourceScope.run(() => scanArtifactInventoryInScope(inputPath, options));
627
+ scanArtifactInventoryInScope = async (inputPath, options) => {
628
+ abortIfNeeded(options.signal);
629
+ const path = await realpath(inputPath);
630
+ return scanCanonicalArtifactInventoryInScope(path, options);
631
+ };
632
+ })))();
633
+ }
634
+
635
+ //#endregion
636
+ //#region dist/artifacts/extraction/ArtifactExtraction.js
637
+ var extractArtifact, extractArtifactInScope, materializeArtifactInventory, materializeArtifactInventoryInScope, materializeSelection, writeSelectedEntries, releaseExtractionOwners, createExtractionResult, requireExtractableFormat, createReader, preflight;
638
+ function init_ArtifactExtraction() {
639
+ return (init_ArtifactExtraction = __esmMin((() => {
640
+ init_unicodeCodePointOrder();
641
+ init_canonicalDigest();
642
+ init_AsarArtifactReader();
643
+ init_ArtifactPaths();
644
+ init_ArtifactReader();
645
+ init_ArtifactHash();
646
+ init_DirectoryArtifactReader();
647
+ init_SafeOutputTree();
648
+ init_SafeOutputTreeCreationFailure();
649
+ init_ZipArtifactReader();
650
+ init_zipPackageFormat();
651
+ init_MachOSliceArtifactReader();
652
+ init_artifactGraph();
653
+ init_analysisErrorCore();
654
+ init_binaryTargetTypes();
655
+ init_ArtifactInventory();
656
+ extractArtifact = async (input, signal) => input.resourceScope.run(() => extractArtifactInScope(input, signal));
657
+ extractArtifactInScope = async (input, signal) => {
658
+ abortIfNeeded(signal);
659
+ const sourcePath = await realpath(input.inputPath);
660
+ await requireExtractableFormat(sourcePath, input);
661
+ const snapshot = await scanArtifactInventoryInScope(sourcePath, {
662
+ resourceScope: input.resourceScope,
663
+ signal,
664
+ environment: input.environment,
665
+ integrity: { mode: input.integrityPolicy }
666
+ });
667
+ return materializeArtifactInventoryInScope(input, sourcePath, snapshot, signal);
668
+ };
669
+ materializeArtifactInventory = async (input, sourcePath, snapshot, signal) => {
670
+ return input.resourceScope.run(() => materializeArtifactInventoryInScope(input, sourcePath, snapshot, signal));
671
+ };
672
+ materializeArtifactInventoryInScope = async (input, sourcePath, snapshot, signal) => {
673
+ abortIfNeeded(signal);
674
+ const selectedOccurrences = snapshot.occurrences.filter((occurrence) => (occurrence.entry_kind === "file" || occurrence.entry_kind === "slice") && occurrence.logical_path !== ".");
675
+ const regularPaths = new Set(selectedOccurrences.map(({ logical_path: path }) => path));
676
+ const activeOccurrences = selectedOccurrences.filter(({ logical_path }) => {
677
+ let path = logical_path;
678
+ for (let slash = path.lastIndexOf("/"); slash >= 0; slash = path.lastIndexOf("/")) {
679
+ path = path.slice(0, slash);
680
+ if (regularPaths.has(path)) return false;
681
+ }
682
+ return true;
683
+ });
684
+ const selectedIds = new Set(activeOccurrences.map(({ occurrence_id: id }) => id));
685
+ const neededNodes = new Set(activeOccurrences.map(({ artifact_id: id }) => id));
686
+ const nodes = new Map();
687
+ for (const node of snapshot.nodes) if (neededNodes.has(node.artifact_id)) nodes.set(node.artifact_id, node);
688
+ const inventory = {
689
+ manifest: snapshot.manifest,
690
+ integrityContradictions: snapshot.integrity_contradictions.filter(({ occurrence_id: id }) => selectedIds.has(id))
691
+ };
692
+ const selected = activeOccurrences.map((occurrence) => {
693
+ 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`);
694
+ 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, {
695
+ logicalPath: occurrence.logical_path,
696
+ declaredSha256: null,
697
+ calculatedSha256: null,
698
+ unpacked: true
699
+ });
700
+ 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})`);
701
+ const node = nodes.get(occurrence.artifact_id);
702
+ if (node === undefined) throw new ArtifactReaderFailure("integrity", `Selected occurrence has no inventory node: ${occurrence.occurrence_id}`);
703
+ return {
704
+ occurrence,
705
+ node
706
+ };
707
+ });
708
+ return materializeSelection({
709
+ input,
710
+ sourcePath,
711
+ inventory,
712
+ selected,
713
+ signal
714
+ });
715
+ };
716
+ materializeSelection = async ({ input, sourcePath, inventory, selected, signal }) => {
717
+ const byPath = new Map();
718
+ for (const item of selected) {
719
+ const path = item.occurrence.logical_path;
720
+ if (byPath.has(path)) throw new ArtifactReaderFailure("path", `Artifact extraction path collision: ${JSON.stringify(path)}. Multiple selected occurrences share this normalized logical path; they cannot be materialized at the same destination path, even when the archive is valid. Inventory retains each occurrence.`);
721
+ byPath.set(path, item);
722
+ }
723
+ const reader = await createReader(sourcePath, input);
724
+ const readerOwner = {
725
+ kind: "reader",
726
+ reader,
727
+ resource: `artifact reader for ${sourcePath}`
728
+ };
729
+ let localReaderOwner = readerOwner;
730
+ let output;
731
+ let completed;
732
+ const extracted = [];
733
+ try {
734
+ try {
735
+ output = await SafeOutputTree.create(input.outputRoot);
736
+ } catch (cause) {
737
+ if (cause instanceof SafeOutputTreeCreationFailure) output = cause.tree;
738
+ throw cause;
739
+ }
740
+ await writeSelectedEntries({
741
+ reader,
742
+ output,
743
+ byPath,
744
+ extracted,
745
+ signal
746
+ });
747
+ localReaderOwner = undefined;
748
+ const closeAttempt = await input.resourceScope.release(readerOwner);
749
+ if (closeAttempt.kind === "failed") throw input.resourceScope.cleanupFailure({ kind: "completed" }, [closeAttempt]);
750
+ extracted.sort((left, right) => compareUnicodeCodePoints(left.relative_path, right.relative_path));
751
+ completed = createExtractionResult(input, inventory, selected, extracted);
752
+ await output.commit(signal);
753
+ return completed;
754
+ } catch (cause) {
755
+ const cleanupFailures = await releaseExtractionOwners(input.resourceScope, localReaderOwner, output, input.outputRoot);
756
+ const [firstCleanup, ...remainingCleanup] = cleanupFailures;
757
+ if (firstCleanup !== undefined) {
758
+ throw input.resourceScope.cleanupFailure({
759
+ kind: "failed",
760
+ cause
761
+ }, [firstCleanup, ...remainingCleanup], output?.published === true && completed !== undefined ? {
762
+ kind: "artifact-extraction",
763
+ extraction: completed
764
+ } : undefined);
765
+ }
766
+ if (output?.published === true && completed !== undefined) return completed;
767
+ throw cause;
768
+ }
769
+ };
770
+ writeSelectedEntries = async ({ reader, output, byPath, extracted, signal }) => {
771
+ const registry = new ArtifactPathRegistry();
772
+ for await (const entry of reader.entries(signal)) {
773
+ const path = normalizeArtifactPath(entry.path);
774
+ registry.add(path, entry.kind);
775
+ const selectedItem = byPath.get(path);
776
+ if (selectedItem === undefined) {
777
+ if (entry.kind === "file" || entry.kind === "slice") throw new ArtifactReaderFailure("integrity", `Regular artifact entry is missing from inventory: ${path}`);
778
+ continue;
779
+ }
780
+ preflight(entry);
781
+ const stream = await reader.open(entry, signal);
782
+ const written = await output.write(path, stream, {
783
+ sha256: selectedItem.node.sha256,
784
+ bytes: selectedItem.node.size
785
+ }, signal);
786
+ extracted.push({
787
+ artifact_id: selectedItem.node.artifact_id,
788
+ relative_path: written.relativePath,
789
+ sha256: written.sha256,
790
+ bytes_written: written.bytesWritten,
791
+ created: true
792
+ });
793
+ byPath.delete(path);
794
+ }
795
+ if (byPath.size > 0) throw new ArtifactReaderFailure("integrity", `Inventoried regular artifact entries were not materialized: ${[...byPath.keys()].sort(compareUnicodeCodePoints).join(", ")}`);
796
+ };
797
+ releaseExtractionOwners = async (resourceScope, readerOwner, output, outputRoot) => {
798
+ const failures = [];
799
+ if (readerOwner !== undefined) {
800
+ const attempt = await resourceScope.release(readerOwner);
801
+ if (attempt.kind === "failed") failures.push(attempt);
802
+ }
803
+ if (output !== undefined) {
804
+ const owner = {
805
+ kind: "output-tree",
806
+ tree: output,
807
+ resource: outputRoot
808
+ };
809
+ const attempt = await resourceScope.release(owner);
810
+ if (attempt.kind === "failed") failures.push(attempt);
811
+ }
812
+ return failures;
813
+ };
814
+ createExtractionResult = (input, inventory, selected, extracted) => {
815
+ const extractionSemantic = {
816
+ source_manifest_id: inventory.manifest.manifest_id,
817
+ selected_occurrence_ids: selected.map(({ occurrence }) => occurrence.occurrence_id).sort(compareUnicodeCodePoints),
818
+ files_sha256: digestCanonicalValue(extracted, "Artifact"),
819
+ output_root_alias: "$OUTPUT_ROOT"
820
+ };
821
+ return artifactExtractionResultSchema.parse({
822
+ manifest: inventory.manifest,
823
+ extraction_manifest: {
824
+ ...extractionSemantic,
825
+ extraction_id: `aex_${digestCanonicalValue(extractionSemantic, "Artifact")}`
826
+ },
827
+ output_root: input.outputRoot,
828
+ artifacts: extracted,
829
+ containment_verified: true,
830
+ cleanup: {
831
+ attempted: false,
832
+ verified: true,
833
+ residual_paths: []
834
+ },
835
+ provenance: [],
836
+ integrity_contradictions: inventory.integrityContradictions,
837
+ 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.`]]
838
+ });
839
+ };
840
+ requireExtractableFormat = async (path, input) => {
841
+ const format = input.inputFormat;
842
+ const directory = (await lstat(path)).isDirectory();
843
+ if (!directory && format !== "asar" && !isMachOFormat(format) && !isZipPackageFormat(format)) throw new AnalysisUnsupportedTargetError("extract_artifact", input.inputPath, `Artifact format has no extraction reader: ${format}`);
844
+ return directory;
845
+ };
846
+ createReader = async (path, input) => {
847
+ const format = input.inputFormat;
848
+ if (await requireExtractableFormat(path, input)) return new DirectoryArtifactReader(path);
849
+ if (format === "asar") return new AsarArtifactReader(path);
850
+ if (isZipPackageFormat(format)) return new ZipArtifactReader(path, format);
851
+ return new MachOSliceArtifactReader(path, input.environment);
852
+ };
853
+ preflight = (entry) => {
854
+ if (entry.kind !== "file" && entry.kind !== "slice" || entry.encrypted) throw new ArtifactReaderFailure("format", `Selected artifact entry cannot be read: ${entry.path}`);
855
+ };
856
+ })))();
857
+ }
858
+
859
+ //#endregion
860
+ //#region dist/artifacts/apple/NibArchive.js
861
+ var DEFAULT_DECODE_BUDGET_BYTES, decodeNibArchive, parseObjects, preflightProjectedFieldCount, parseStrings, parseClasses, parseValues, readValue, skipValue, valueIndexes, readCount, readOffset, readU32, decodeUtf8, readVarint, checkedEnd, ensureRange, assertOrderedOffsets;
862
+ function init_NibArchive() {
863
+ return (init_NibArchive = __esmMin((() => {
864
+ init_appleArchiveFormat();
865
+ init_InterfaceBuilderDecodeBudget();
866
+ DEFAULT_DECODE_BUDGET_BYTES = 128 * 1024 * 1024;
867
+ decodeNibArchive = (bytes, budget = new InterfaceBuilderDecodeBudget(DEFAULT_DECODE_BUDGET_BYTES)) => {
868
+ if (bytes.length < 50 || !hasNibArchiveSignature(bytes)) throw new TypeError("NIBArchive magic or header is invalid");
869
+ const formatVersion = readU32(bytes, 10);
870
+ const coderVersion = readU32(bytes, 14);
871
+ if (formatVersion !== 1) throw new TypeError(`Unsupported NIBArchive format version ${formatVersion}`);
872
+ const objectCount = readCount(bytes, 18, "object");
873
+ const objectsOffset = readOffset(bytes, 22, bytes.length, "object");
874
+ const keyCount = readCount(bytes, 26, "key");
875
+ const keysOffset = readOffset(bytes, 30, bytes.length, "key");
876
+ const valueCount = readCount(bytes, 34, "value");
877
+ const valuesOffset = readOffset(bytes, 38, bytes.length, "value");
878
+ const classCount = readCount(bytes, 42, "class");
879
+ const classesOffset = readOffset(bytes, 46, bytes.length, "class");
880
+ assertOrderedOffsets(bytes.length, [
881
+ objectsOffset,
882
+ keysOffset,
883
+ valuesOffset,
884
+ classesOffset
885
+ ]);
886
+ const projectedFieldCount = preflightProjectedFieldCount(bytes, objectsOffset, keysOffset, objectCount, valueCount, classCount, budget.remainingBytes);
887
+ budget.reserve(objectCount * 96 + projectedFieldCount * 96, "NIBArchive object and projected field counts exceed the aggregate Interface Builder decode budget");
888
+ const objectRecords = parseObjects(bytes, objectsOffset, keysOffset, objectCount, valueCount, classCount);
889
+ const keys = parseStrings(bytes, keysOffset, valuesOffset, keyCount, "key", budget);
890
+ const classes = parseClasses(bytes, classesOffset, bytes.length, classCount, budget);
891
+ const neededValues = valueIndexes(objectRecords, valueCount);
892
+ const values = parseValues(bytes, valuesOffset, classesOffset, valueCount, keyCount, neededValues, budget);
893
+ for (const { value } of values.values()) {
894
+ 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");
895
+ }
896
+ const objects = objectRecords.flatMap((object, id) => {
897
+ const className = classes[object.class_index];
898
+ if (className === undefined) return [];
899
+ const fields = {};
900
+ for (let index = object.value_start; index < object.value_start + object.value_count; index += 1) {
901
+ const value = values.get(index);
902
+ if (value === undefined) continue;
903
+ const key = keys[value.key_index];
904
+ if (key !== undefined) Object.defineProperty(fields, key, {
905
+ value: value.value,
906
+ enumerable: true,
907
+ configurable: true,
908
+ writable: true
909
+ });
910
+ }
911
+ return [{
912
+ id,
913
+ class_name: className,
914
+ values: fields
915
+ }];
916
+ });
917
+ let connectionObjectCount = 0;
918
+ for (const object of objects) if (/(?:Outlet|Connection|Segue|ActionConnection)/iu.test(object.class_name)) connectionObjectCount += 1;
919
+ return {
920
+ format_version: formatVersion,
921
+ coder_version: coderVersion,
922
+ object_count: objectCount,
923
+ connection_object_count: connectionObjectCount,
924
+ objects,
925
+ classes,
926
+ 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."]
927
+ };
928
+ };
929
+ parseObjects = (bytes, start, end, count, valueCount, classCount) => {
930
+ const cursor = { offset: start };
931
+ const output = [];
932
+ for (let index = 0; index < count; index += 1) {
933
+ const classIndex = readVarint(bytes, cursor, end);
934
+ const valueStart = readVarint(bytes, cursor, end);
935
+ const countForObject = readVarint(bytes, cursor, end);
936
+ if (classIndex >= classCount || valueStart > valueCount || countForObject > valueCount - valueStart) throw new TypeError(`NIBArchive object ${index} references an invalid table range`);
937
+ output.push({
938
+ class_index: classIndex,
939
+ value_start: valueStart,
940
+ value_count: countForObject
941
+ });
942
+ }
943
+ if (cursor.offset > end) throw new TypeError("NIBArchive object table overlaps the next table");
944
+ return output;
945
+ };
946
+ preflightProjectedFieldCount = (bytes, start, end, objectCount, valueCount, classCount, maxBytes) => {
947
+ if (objectCount * 96 > maxBytes) throw new InterfaceBuilderDecodeBudgetExceeded("aggregate_decode_budget_exhausted", "NIBArchive object count exceeds the aggregate Interface Builder decode budget");
948
+ const cursor = { offset: start };
949
+ let projectedFields = 0;
950
+ for (let index = 0; index < objectCount; index += 1) {
951
+ const classIndex = readVarint(bytes, cursor, end);
952
+ const valueStart = readVarint(bytes, cursor, end);
953
+ const fieldCount = readVarint(bytes, cursor, end);
954
+ if (classIndex >= classCount || valueStart > valueCount || fieldCount > valueCount - valueStart) throw new TypeError(`NIBArchive object ${index} references an invalid table range`);
955
+ projectedFields += fieldCount;
956
+ 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");
957
+ }
958
+ return projectedFields;
959
+ };
960
+ parseStrings = (bytes, start, end, count, label, budget) => {
961
+ const cursor = { offset: start };
962
+ const output = [];
963
+ for (let index = 0; index < count; index += 1) {
964
+ const length = readVarint(bytes, cursor, end);
965
+ const next = checkedEnd(cursor.offset, length, end, `${label} ${index}`);
966
+ budget.reserve(32 + length * 2, `NIBArchive ${label} strings exceed the aggregate Interface Builder decode budget`);
967
+ const value = decodeUtf8(bytes, cursor.offset, next, `${label} ${index}`);
968
+ cursor.offset = next;
969
+ output.push(value);
970
+ }
971
+ return output;
972
+ };
973
+ parseClasses = (bytes, start, end, count, budget) => {
974
+ const cursor = { offset: start };
975
+ const output = [];
976
+ for (let index = 0; index < count; index += 1) {
977
+ const length = readVarint(bytes, cursor, end);
978
+ const extraCount = readVarint(bytes, cursor, end);
979
+ if (extraCount > 16) throw new TypeError(`NIBArchive class ${index} has too many extension values`);
980
+ ensureRange(cursor.offset, extraCount * 4, end, `class ${index} extensions`);
981
+ cursor.offset += extraCount * 4;
982
+ const next = checkedEnd(cursor.offset, length, end, `class ${index}`);
983
+ budget.reserve(32 + length * 2, "NIBArchive class names exceed the aggregate Interface Builder decode budget");
984
+ const name = decodeUtf8(bytes, cursor.offset, next, `class ${index}`).replace(/\0+$/u, "");
985
+ cursor.offset = next;
986
+ output.push(name);
987
+ }
988
+ return output;
989
+ };
990
+ parseValues = (bytes, start, end, count, keyCount, needed, budget) => {
991
+ const cursor = { offset: start };
992
+ const output = new Map();
993
+ for (let index = 0; index < count; index += 1) {
994
+ const keyIndex = readVarint(bytes, cursor, end);
995
+ if (keyIndex >= keyCount) throw new TypeError(`NIBArchive value ${index} references an invalid key`);
996
+ ensureRange(cursor.offset, 1, end, `value ${index} type`);
997
+ const type = bytes[cursor.offset++] ?? -1;
998
+ if (!needed.has(index)) {
999
+ skipValue(bytes, cursor, end, type, index);
1000
+ continue;
1001
+ }
1002
+ budget.reserve(64, "NIBArchive decoded values exceed the aggregate Interface Builder decode budget");
1003
+ const value = readValue(bytes, cursor, end, type, index, budget);
1004
+ output.set(index, {
1005
+ key_index: keyIndex,
1006
+ value
1007
+ });
1008
+ }
1009
+ if (cursor.offset > end) throw new TypeError("NIBArchive value table overlaps the next table");
1010
+ return output;
1011
+ };
1012
+ readValue = (bytes, cursor, end, type, index, budget) => {
1013
+ switch (type) {
1014
+ case 0:
1015
+ ensureRange(cursor.offset, 1, end, `value ${index}`);
1016
+ return bytes.readInt8(cursor.offset++);
1017
+ case 1:
1018
+ ensureRange(cursor.offset, 2, end, `value ${index}`);
1019
+ {
1020
+ const value = bytes.readInt16LE(cursor.offset);
1021
+ cursor.offset += 2;
1022
+ return value;
1023
+ }
1024
+ case 2:
1025
+ ensureRange(cursor.offset, 4, end, `value ${index}`);
1026
+ {
1027
+ const value = bytes.readInt32LE(cursor.offset);
1028
+ cursor.offset += 4;
1029
+ return value;
1030
+ }
1031
+ case 3:
1032
+ ensureRange(cursor.offset, 8, end, `value ${index}`);
1033
+ {
1034
+ const value = bytes.readBigInt64LE(cursor.offset);
1035
+ cursor.offset += 8;
1036
+ return value <= BigInt(Number.MAX_SAFE_INTEGER) && value >= BigInt(Number.MIN_SAFE_INTEGER) ? Number(value) : value.toString();
1037
+ }
1038
+ case 4: return true;
1039
+ case 5: return false;
1040
+ case 6:
1041
+ ensureRange(cursor.offset, 4, end, `value ${index}`);
1042
+ {
1043
+ const value = bytes.readFloatLE(cursor.offset);
1044
+ cursor.offset += 4;
1045
+ return Number.isFinite(value) ? value : null;
1046
+ }
1047
+ case 7:
1048
+ ensureRange(cursor.offset, 8, end, `value ${index}`);
1049
+ {
1050
+ const value = bytes.readDoubleLE(cursor.offset);
1051
+ cursor.offset += 8;
1052
+ return Number.isFinite(value) ? value : null;
1053
+ }
1054
+ case 8: {
1055
+ const length = readVarint(bytes, cursor, end);
1056
+ const next = checkedEnd(cursor.offset, length, end, `value ${index} data`);
1057
+ budget.reserve(32 + 4 * Math.ceil(length / 3), `NIBArchive data value ${index} exceeds the aggregate Interface Builder decode budget`);
1058
+ const encoded = bytes.subarray(cursor.offset, next).toString("base64");
1059
+ cursor.offset = next;
1060
+ return { $nib_data_base64: encoded };
1061
+ }
1062
+ case 9: return null;
1063
+ case 10:
1064
+ ensureRange(cursor.offset, 4, end, `value ${index} reference`);
1065
+ {
1066
+ const objectIndex = bytes.readUInt32LE(cursor.offset);
1067
+ cursor.offset += 4;
1068
+ return { $nib_object_ref: objectIndex };
1069
+ }
1070
+ default: throw new TypeError(`NIBArchive value ${index} has unsupported type ${type}`);
1071
+ }
1072
+ };
1073
+ skipValue = (bytes, cursor, end, type, index) => {
1074
+ switch (type) {
1075
+ case 0:
1076
+ ensureRange(cursor.offset, 1, end, `value ${index}`);
1077
+ cursor.offset += 1;
1078
+ return;
1079
+ case 1:
1080
+ ensureRange(cursor.offset, 2, end, `value ${index}`);
1081
+ cursor.offset += 2;
1082
+ return;
1083
+ case 2:
1084
+ case 10:
1085
+ ensureRange(cursor.offset, 4, end, `value ${index}`);
1086
+ cursor.offset += 4;
1087
+ return;
1088
+ case 3:
1089
+ case 7:
1090
+ ensureRange(cursor.offset, 8, end, `value ${index}`);
1091
+ cursor.offset += 8;
1092
+ return;
1093
+ case 6:
1094
+ ensureRange(cursor.offset, 4, end, `value ${index}`);
1095
+ cursor.offset += 4;
1096
+ return;
1097
+ case 4:
1098
+ case 5:
1099
+ case 9: return;
1100
+ case 8: {
1101
+ const length = readVarint(bytes, cursor, end);
1102
+ cursor.offset = checkedEnd(cursor.offset, length, end, `value ${index} data`);
1103
+ return;
1104
+ }
1105
+ default: throw new TypeError(`NIBArchive value ${index} has unsupported type ${type}`);
1106
+ }
1107
+ };
1108
+ valueIndexes = (objects, total) => {
1109
+ const indexes = new Set();
1110
+ for (const object of objects) for (let index = object.value_start; index < object.value_start + object.value_count; index += 1) indexes.add(index);
1111
+ if (indexes.size > total) throw new TypeError("NIBArchive object value ranges exceed the value table");
1112
+ return indexes;
1113
+ };
1114
+ readCount = (bytes, offset, label) => {
1115
+ const count = readU32(bytes, offset);
1116
+ if (count > bytes.length) throw new TypeError(`NIBArchive ${label} count exceeds the archive length`);
1117
+ return count;
1118
+ };
1119
+ readOffset = (bytes, offset, fileLength, label) => {
1120
+ const value = readU32(bytes, offset);
1121
+ if (value < 50 || value > fileLength) throw new TypeError(`NIBArchive ${label} table offset is invalid`);
1122
+ return value;
1123
+ };
1124
+ readU32 = (bytes, offset) => {
1125
+ ensureRange(offset, 4, bytes.length, "header");
1126
+ return bytes.readUInt32LE(offset);
1127
+ };
1128
+ decodeUtf8 = (bytes, start, end, label) => {
1129
+ try {
1130
+ return new TextDecoder("utf-8", {
1131
+ fatal: true,
1132
+ ignoreBOM: true
1133
+ }).decode(bytes.subarray(start, end));
1134
+ } catch (cause) {
1135
+ throw new TypeError(`NIBArchive ${label} is not valid UTF-8`, { cause });
1136
+ }
1137
+ };
1138
+ readVarint = (bytes, cursor, end) => {
1139
+ let value = 0;
1140
+ let shift = 0;
1141
+ for (let index = 0; index < 5; index += 1) {
1142
+ ensureRange(cursor.offset, 1, end, "variable integer");
1143
+ const byte = bytes[cursor.offset++] ?? 0;
1144
+ value += (byte & 127) * 2 ** shift;
1145
+ if ((byte & 128) !== 0) {
1146
+ if (value > 2147483647) throw new TypeError("NIBArchive variable integer is out of range");
1147
+ return value;
1148
+ }
1149
+ shift += 7;
1150
+ }
1151
+ throw new TypeError("NIBArchive variable integer is too long");
1152
+ };
1153
+ checkedEnd = (start, length, limit, label) => {
1154
+ if (!Number.isSafeInteger(length) || length < 0 || start + length > limit) throw new TypeError(`NIBArchive ${label} exceeds its table`);
1155
+ return start + length;
1156
+ };
1157
+ ensureRange = (start, length, limit, label) => {
1158
+ checkedEnd(start, length, limit, label);
1159
+ };
1160
+ assertOrderedOffsets = (length, offsets) => {
1161
+ let previous = 50;
1162
+ for (const offset of offsets) {
1163
+ if (offset < previous || offset > length) throw new TypeError("NIBArchive table offsets are out of order");
1164
+ previous = offset;
1165
+ }
1166
+ };
1167
+ })))();
1168
+ }
1169
+
1170
+ //#endregion
1171
+ //#region dist/artifacts/apple/NibViewHierarchy.js
1172
+ var projectNibViewHierarchy, mergeNibHierarchies, wouldCycle, reference, collectNibParents, invalidReference;
1173
+ function init_NibViewHierarchy() {
1174
+ return (init_NibViewHierarchy = __esmMin((() => {
1175
+ projectNibViewHierarchy = (objects, retainedIds, reserveNode = () => true, maxNodes = 2e4) => {
1176
+ const { parents, involved, invalid } = collectNibParents(objects, retainedIds);
1177
+ if (parents.size === 0) return {
1178
+ hierarchy: null,
1179
+ omitted: invalid
1180
+ };
1181
+ const children = new Map();
1182
+ for (const [child, parent] of parents) {
1183
+ if (!retainedIds.has(parent) || !retainedIds.has(child)) continue;
1184
+ const siblings = children.get(parent) ?? [];
1185
+ siblings.push(child);
1186
+ children.set(parent, siblings);
1187
+ }
1188
+ const roots = [];
1189
+ const pending = [];
1190
+ for (const id of involved) if (!parents.has(id)) pending.push({
1191
+ id,
1192
+ depth: 0,
1193
+ output: roots
1194
+ });
1195
+ const visited = new Set();
1196
+ while (pending.length > 0) {
1197
+ const item = pending.pop();
1198
+ if (item === undefined) break;
1199
+ if (visited.has(item.id) || item.depth > 128 || visited.size >= maxNodes || !reserveNode()) continue;
1200
+ visited.add(item.id);
1201
+ const node = {
1202
+ objectID: String(item.id),
1203
+ children: []
1204
+ };
1205
+ item.output.push(node);
1206
+ for (const child of [...children.get(item.id) ?? []].reverse()) pending.push({
1207
+ id: child,
1208
+ depth: item.depth + 1,
1209
+ output: node.children
1210
+ });
1211
+ }
1212
+ return {
1213
+ hierarchy: roots,
1214
+ omitted: involved.size - visited.size + invalid
1215
+ };
1216
+ };
1217
+ mergeNibHierarchies = (legacy, recovered, reserveNode = () => true, maxNodes = 2e4) => {
1218
+ const existing = new Map();
1219
+ const owners = new Map();
1220
+ const parents = new Map();
1221
+ const pending = legacy.map((node) => ({
1222
+ node,
1223
+ output: legacy,
1224
+ parent: null
1225
+ }));
1226
+ while (pending.length > 0) {
1227
+ const entry = pending.pop();
1228
+ if (entry === undefined || existing.has(entry.node.objectID)) continue;
1229
+ existing.set(entry.node.objectID, entry.node);
1230
+ owners.set(entry.node.objectID, entry.output);
1231
+ if (entry.parent !== null) parents.set(entry.node.objectID, entry.parent);
1232
+ pending.push(...entry.node.children.map((node) => ({
1233
+ node,
1234
+ output: entry.node.children,
1235
+ parent: entry.node.objectID
1236
+ })));
1237
+ }
1238
+ let omitted = 0;
1239
+ const additions = recovered.map((node) => ({
1240
+ node,
1241
+ output: legacy,
1242
+ parent: null
1243
+ }));
1244
+ while (additions.length > 0) {
1245
+ const entry = additions.pop();
1246
+ if (entry === undefined) break;
1247
+ let target = existing.get(entry.node.objectID);
1248
+ if (target === undefined) {
1249
+ if (existing.size >= maxNodes || !reserveNode()) {
1250
+ omitted += 1;
1251
+ continue;
1252
+ }
1253
+ target = {
1254
+ objectID: entry.node.objectID,
1255
+ children: []
1256
+ };
1257
+ existing.set(target.objectID, target);
1258
+ entry.output.push(target);
1259
+ owners.set(target.objectID, entry.output);
1260
+ if (entry.parent !== null) parents.set(target.objectID, entry.parent);
1261
+ } else if (entry.parent !== null && owners.get(target.objectID) !== entry.output) {
1262
+ const owner = owners.get(target.objectID);
1263
+ if (owner !== legacy || wouldCycle(target.objectID, entry.parent, parents)) {
1264
+ omitted += 1;
1265
+ } else {
1266
+ owner.splice(owner.indexOf(target), 1);
1267
+ entry.output.push(target);
1268
+ owners.set(target.objectID, entry.output);
1269
+ parents.set(target.objectID, entry.parent);
1270
+ }
1271
+ }
1272
+ for (const node of [...entry.node.children].reverse()) additions.push({
1273
+ node,
1274
+ output: target.children,
1275
+ parent: target.objectID
1276
+ });
1277
+ }
1278
+ return {
1279
+ hierarchy: legacy,
1280
+ omitted
1281
+ };
1282
+ };
1283
+ wouldCycle = (child, parent, parents) => {
1284
+ const seen = new Set();
1285
+ let current = parent;
1286
+ while (current !== undefined && !seen.has(current)) {
1287
+ if (current === child) return true;
1288
+ seen.add(current);
1289
+ current = parents.get(current);
1290
+ }
1291
+ return false;
1292
+ };
1293
+ reference = (value) => {
1294
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return null;
1295
+ return typeof value.$nib_object_ref === "number" ? value.$nib_object_ref : null;
1296
+ };
1297
+ collectNibParents = (objects, retainedIds) => {
1298
+ const parents = new Map();
1299
+ const involved = new Set();
1300
+ let invalid = 0;
1301
+ for (const object of objects) {
1302
+ if (!retainedIds.has(object.id)) continue;
1303
+ const child = reference(object.values.NSWindowView);
1304
+ if (object.class_name.replace(/\0+$/u, "") === "NSWindowTemplate" && invalidReference(object.values.NSWindowView)) invalid += 1;
1305
+ if (object.class_name.replace(/\0+$/u, "") === "NSWindowTemplate" && child !== null) {
1306
+ parents.set(child, object.id);
1307
+ involved.add(object.id);
1308
+ involved.add(child);
1309
+ }
1310
+ const parent = reference(object.values.NSSuperview);
1311
+ if (invalidReference(object.values.NSSuperview)) invalid += 1;
1312
+ if (parent === null) continue;
1313
+ parents.set(object.id, parent);
1314
+ involved.add(object.id);
1315
+ if (retainedIds.has(parent)) involved.add(parent);
1316
+ }
1317
+ return {
1318
+ parents,
1319
+ involved,
1320
+ invalid
1321
+ };
1322
+ };
1323
+ invalidReference = (value) => value !== undefined && value !== null && reference(value) === null;
1324
+ })))();
1325
+ }
1326
+
1327
+ //#endregion
1328
+ //#region dist/artifacts/apple/InterfaceBuilderAnalysis.js
1329
+ var MAX_AGGREGATE_INPUT_BYTES, MAX_AGGREGATE_DECODE_BYTES, MAX_REPORTED_OMITTED_ARCHIVES, analyzeInterfaceBuilderBundle, selectInterfaceBuilderCandidates, retainCandidate, finalizeHierarchyCoverage, projectNibArchive, isInterfaceBuilderArchive, readEntry, parseXmlWithinDecodeBudget, decodePlist;
1330
+ function init_InterfaceBuilderAnalysis() {
1331
+ return (init_InterfaceBuilderAnalysis = __esmMin((() => {
1332
+ init_appleAssetCatalog();
1333
+ init_interfaceBuilderKeyedArchive();
1334
+ init_DirectoryArtifactReader();
1335
+ init_plistValue();
1336
+ init_propertyListKeys();
1337
+ init_NibArchive();
1338
+ init_InterfaceBuilderDecodeBudget();
1339
+ init_interfaceBuilderGraph();
1340
+ init_NibViewHierarchy();
1341
+ init_jsonValue();
1342
+ init_unicodeCodePointOrder();
1343
+ init_propertyListXmlText();
1344
+ init_PlistNumberLiterals();
1345
+ init_appleArchiveFormat();
1346
+ MAX_AGGREGATE_INPUT_BYTES = 32 * 1024 * 1024;
1347
+ MAX_AGGREGATE_DECODE_BYTES = 256 * 1024 * 1024;
1348
+ MAX_REPORTED_OMITTED_ARCHIVES = 64;
1349
+ analyzeInterfaceBuilderBundle = async (input) => {
1350
+ const limits = interfaceBuilderLimitsSchema.parse(input.limits ?? {});
1351
+ const reader = new DirectoryArtifactReader(input.bundlePath);
1352
+ const documents = [];
1353
+ const invalid = [];
1354
+ const omittedArchives = [];
1355
+ let unreportedOmittedArchives = 0;
1356
+ const incompleteHierarchies = new Map();
1357
+ const unresolvedConnections = new Map();
1358
+ const prototypeKeyOmissions = new Map();
1359
+ const unknownDates = new Map();
1360
+ let omitted = 0;
1361
+ let attempted = 0;
1362
+ let aggregateInputBytes = 0;
1363
+ const decodeBudget = new InterfaceBuilderDecodeBudget(MAX_AGGREGATE_DECODE_BYTES);
1364
+ const recordOmittedArchive = (path, reason) => {
1365
+ if (omittedArchives.length < MAX_REPORTED_OMITTED_ARCHIVES) omittedArchives.push({
1366
+ path,
1367
+ reason
1368
+ });
1369
+ else unreportedOmittedArchives += 1;
1370
+ };
1371
+ try {
1372
+ const selection = await selectInterfaceBuilderCandidates(reader, input.signal, limits.max_documents);
1373
+ omitted = selection.omitted;
1374
+ for (const entry of selection.omittedSamples) recordOmittedArchive(entry.path, "max_documents");
1375
+ unreportedOmittedArchives += selection.unreportedOmitted;
1376
+ for (const entry of selection.selected) {
1377
+ let plistReservation = 0;
1378
+ try {
1379
+ const remainingInputBytes = MAX_AGGREGATE_INPUT_BYTES - aggregateInputBytes;
1380
+ if (entry.declaredSize !== null && entry.declaredSize > remainingInputBytes) {
1381
+ omitted += 1;
1382
+ recordOmittedArchive(entry.path, "aggregate_decode_budget_exhausted");
1383
+ continue;
1384
+ }
1385
+ attempted += 1;
1386
+ const bytes = await readEntry(reader, entry, input.signal, remainingInputBytes);
1387
+ aggregateInputBytes += bytes.length;
1388
+ const isNibArchive = hasNibArchiveSignature(bytes);
1389
+ let nib = null;
1390
+ let xmlText;
1391
+ let binaryPrototypeKeyObserved = false;
1392
+ if (isNibArchive) {
1393
+ const documentBudget = new InterfaceBuilderDecodeBudget(decodeBudget.remainingBytes);
1394
+ nib = projectNibArchive(decodeNibArchive(bytes, documentBudget), documentBudget, limits.max_objects);
1395
+ decodeBudget.reserve(documentBudget.usedBytes, "NIBArchive representation exceeds the aggregate Interface Builder decode budget");
1396
+ } else {
1397
+ if (!hasBinaryPlistSignature(bytes)) xmlText = decodeXmlPlistText(bytes);
1398
+ const decodedReservation = preflightPropertyListDecode(bytes, decodeBudget.remainingBytes, xmlText, { numberProjection: true });
1399
+ decodeBudget.reserve(decodedReservation.estimatedBytes, "plist representation exceeds the aggregate Interface Builder decode budget");
1400
+ plistReservation = decodedReservation.estimatedBytes;
1401
+ binaryPrototypeKeyObserved = decodedReservation.binaryPrototypeKeyObserved;
1402
+ }
1403
+ const { value: raw, omittedPrototypeKeys, unknownDateCount, numberLiterals } = nib === null ? decodePlist(bytes, xmlText, binaryPrototypeKeyObserved) : {
1404
+ value: nib.raw,
1405
+ omittedPrototypeKeys: 0,
1406
+ unknownDateCount: 0,
1407
+ numberLiterals: undefined
1408
+ };
1409
+ if (nib !== null && nib.omitted > 0) incompleteHierarchies.set(entry.path, nib.omitted);
1410
+ if (nib !== null && nib.unresolvedConnections > 0) unresolvedConnections.set(entry.path, nib.unresolvedConnections);
1411
+ if (omittedPrototypeKeys !== 0) prototypeKeyOmissions.set(entry.path, omittedPrototypeKeys);
1412
+ if (unknownDateCount !== 0) unknownDates.set(entry.path, unknownDateCount);
1413
+ const documentHash = createHash("sha256").update(bytes).digest("hex");
1414
+ documents.push({
1415
+ relativePath: entry.path,
1416
+ archiveSha256: documentHash,
1417
+ documentKind: entry.path.includes(".storyboardc/") ? "storyboard_scene" : "nib",
1418
+ raw,
1419
+ ...numberLiterals === undefined ? {} : { numberLiterals },
1420
+ ...nib === null || nib.omitted === 0 ? {} : { omittedSerializedHierarchyReferences: nib.omitted }
1421
+ });
1422
+ } catch (cause) {
1423
+ if (input.signal?.aborted === true) throw cause;
1424
+ if (cause instanceof InterfaceBuilderDecodeBudgetExceeded) {
1425
+ decodeBudget.release(plistReservation);
1426
+ omitted += 1;
1427
+ recordOmittedArchive(entry.path, cause.reason);
1428
+ continue;
1429
+ }
1430
+ invalid.push(`${entry.path}: ${cause instanceof Error ? cause.message : "archive decode failed"}`);
1431
+ }
1432
+ }
1433
+ } finally {
1434
+ await reader.close();
1435
+ }
1436
+ const result = buildInterfaceBuilderAnalysis({
1437
+ targetSha256: input.targetSha256,
1438
+ toolVersion: "rea-interface-builder/1",
1439
+ documents,
1440
+ limits
1441
+ });
1442
+ return finalizeHierarchyCoverage(result, {
1443
+ incompleteHierarchies,
1444
+ unresolvedConnections,
1445
+ prototypeKeyOmissions,
1446
+ unknownDates,
1447
+ invalid,
1448
+ omittedArchives,
1449
+ unreportedOmittedArchives,
1450
+ attempted,
1451
+ omitted
1452
+ });
1453
+ };
1454
+ selectInterfaceBuilderCandidates = async (reader, signal, maximumDocuments) => {
1455
+ const capacity = maximumDocuments + MAX_REPORTED_OMITTED_ARCHIVES;
1456
+ const candidates = [];
1457
+ let total = 0;
1458
+ for await (const entry of reader.entries(signal)) {
1459
+ if (entry.kind !== "file" || !isInterfaceBuilderArchive(entry.path)) continue;
1460
+ total += 1;
1461
+ retainCandidate(candidates, entry, capacity);
1462
+ }
1463
+ const omittedSamples = candidates.slice(maximumDocuments, capacity);
1464
+ return {
1465
+ selected: candidates.slice(0, maximumDocuments),
1466
+ omittedSamples,
1467
+ omitted: Math.max(0, total - maximumDocuments),
1468
+ unreportedOmitted: Math.max(0, total - maximumDocuments - omittedSamples.length)
1469
+ };
1470
+ };
1471
+ retainCandidate = (candidates, entry, maximum) => {
1472
+ let low = 0;
1473
+ let high = candidates.length;
1474
+ while (low < high) {
1475
+ const middle = Math.floor((low + high) / 2);
1476
+ const existing = candidates[middle];
1477
+ if (existing !== undefined && compareUnicodeCodePoints(existing.path, entry.path) < 0) low = middle + 1;
1478
+ else high = middle;
1479
+ }
1480
+ candidates.splice(low, 0, entry);
1481
+ if (candidates.length > maximum) candidates.pop();
1482
+ };
1483
+ finalizeHierarchyCoverage = (result, counts) => {
1484
+ const { incompleteHierarchies, unresolvedConnections, prototypeKeyOmissions, unknownDates, invalid, omittedArchives, unreportedOmittedArchives } = counts;
1485
+ const archiveDecodePartial = invalid.length > 0 || prototypeKeyOmissions.size > 0 || omittedArchives.length > 0;
1486
+ return {
1487
+ ...result,
1488
+ documents: result.documents.map((document) => ({
1489
+ ...document,
1490
+ connection_count: document.connection_count + (unresolvedConnections.get(document.relative_path) ?? 0)
1491
+ })),
1492
+ graph: {
1493
+ ...result.graph,
1494
+ coverage: [...result.graph.coverage.map((facet) => {
1495
+ const omittedConnection = unresolvedConnections.get(facet.facet.replace(/^connections:/u, ""));
1496
+ return facet.facet.startsWith("connections:") && omittedConnection !== undefined ? {
1497
+ ...facet,
1498
+ status: "partial",
1499
+ reason: facet.reason ?? "connection_unresolved",
1500
+ omitted: facet.omitted + omittedConnection
1501
+ } : facet;
1502
+ }), {
1503
+ facet: "archive_decode",
1504
+ status: archiveDecodePartial ? "partial" : "complete",
1505
+ 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,
1506
+ examined: counts.attempted,
1507
+ omitted: counts.omitted
1508
+ }],
1509
+ truncated: result.graph.truncated || counts.omitted > 0 || archiveDecodePartial || unresolvedConnections.size > 0
1510
+ },
1511
+ limitations: [
1512
+ ...result.limitations,
1513
+ "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.",
1514
+ ...incompleteHierarchies.size === 0 ? [] : ["Some serialized hierarchy links could not be projected within the bounded hierarchy; their parentage remains unknown."],
1515
+ ...unresolvedConnections.size === 0 ? [] : ["Some recognized NIBArchive connectors declare no resolvable owner; they carry no connection evidence and are reported as omissions."],
1516
+ ...invalid.length === 0 ? [] : [`Some Interface Builder archives could not be decoded: ${invalid.slice(0, 16).join("; ")}`],
1517
+ ...[...prototypeKeyOmissions].map(([path, count]) => `${path}: ${omittedPrototypeKeysLimitation(count)}`),
1518
+ ...[...unknownDates].map(([path, count]) => `${path}: ${unknownDateLimitation(count)}`),
1519
+ ...omittedArchives.map(({ path, reason }) => `${path}: omitted because ${reason.replaceAll("_", " ")}.`),
1520
+ ...unreportedOmittedArchives === 0 ? [] : [`${unreportedOmittedArchives} additional omitted archive path(s) and their reasons were not retained; reporting is bounded to ${MAX_REPORTED_OMITTED_ARCHIVES} paths.`]
1521
+ ]
1522
+ };
1523
+ };
1524
+ projectNibArchive = (archive, budget, maxHierarchyNodes) => {
1525
+ const byId = new Map(archive.objects.map((object) => [object.id, object]));
1526
+ const normalizedClassNames = new Map();
1527
+ const normalizeClassName = (value) => {
1528
+ const known = normalizedClassNames.get(value);
1529
+ if (known !== undefined) return known;
1530
+ const normalized = value.replace(/\0+$/u, "");
1531
+ normalizedClassNames.set(value, normalized);
1532
+ return normalized;
1533
+ };
1534
+ const decodedStrings = new Map();
1535
+ const decodedString = (objectId, object) => {
1536
+ if (decodedStrings.has(objectId)) return decodedStrings.get(objectId) ?? null;
1537
+ const data = object.values["NS.bytes"];
1538
+ if (typeof data !== "object" || data === null || Array.isArray(data)) {
1539
+ decodedStrings.set(objectId, null);
1540
+ return null;
1541
+ }
1542
+ const encoded = data.$nib_data_base64;
1543
+ if (typeof encoded !== "string") {
1544
+ decodedStrings.set(objectId, null);
1545
+ return null;
1546
+ }
1547
+ budget.reserve(64 + encoded.length * 2, "NIBArchive string projection exceeds the aggregate Interface Builder decode budget");
1548
+ const value = Buffer.from(encoded, "base64").toString("utf8");
1549
+ decodedStrings.set(objectId, value);
1550
+ return value;
1551
+ };
1552
+ let projectedFields = 0;
1553
+ for (const object of archive.objects) projectedFields += Object.keys(object.values).length;
1554
+ budget.reserve(archive.objects.length * 128 + projectedFields * 128, "NIBArchive graph projection exceeds the aggregate Interface Builder decode budget");
1555
+ budget.reserve(archive.classes.length * 96, "NIBArchive class projection exceeds the aggregate Interface Builder decode budget");
1556
+ const dereference = (value) => {
1557
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return value;
1558
+ const encodedData = value.$nib_data_base64;
1559
+ if (typeof encodedData === "string") {
1560
+ budget.reserveBase64JsonStringOccurrence(encodedData);
1561
+ return value;
1562
+ }
1563
+ const ref = value.$nib_object_ref;
1564
+ if (typeof ref !== "number") return value;
1565
+ const target = byId.get(ref);
1566
+ if (target === undefined) return undefined;
1567
+ if (normalizeClassName(target.class_name) === "NSString") {
1568
+ const string = decodedString(ref, target);
1569
+ if (string !== null) {
1570
+ budget.reserveJsonStringOccurrence(string);
1571
+ return string;
1572
+ }
1573
+ }
1574
+ return { objectID: String(ref) };
1575
+ };
1576
+ const referencedString = (value) => {
1577
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return null;
1578
+ const ref = value.$nib_object_ref;
1579
+ if (typeof ref !== "number") return null;
1580
+ const target = byId.get(ref);
1581
+ if (target === undefined || normalizeClassName(target.class_name) !== "NSString") return null;
1582
+ const string = decodedString(ref, target);
1583
+ if (string === null) return null;
1584
+ budget.reserveJsonStringOccurrence(string);
1585
+ return string;
1586
+ };
1587
+ const runtimeClasses = new Map();
1588
+ const runtimeClass = (objectId) => {
1589
+ if (runtimeClasses.has(objectId)) return runtimeClasses.get(objectId) ?? null;
1590
+ const object = byId.get(objectId);
1591
+ if (object === undefined) return null;
1592
+ const storedClass = normalizeClassName(object.class_name);
1593
+ const resolvedClass = storedClass === "NSClassSwapper" ? referencedString(object.values.NSClassName) ?? storedClass : storedClass === "UIClassSwapper" ? referencedString(object.values.UIClassName) ?? storedClass : storedClass;
1594
+ runtimeClasses.set(objectId, resolvedClass);
1595
+ return resolvedClass;
1596
+ };
1597
+ const objects = Object.fromEntries(archive.objects.filter((object) => {
1598
+ const name = runtimeClass(object.id) ?? "";
1599
+ return !/^(?:NSObject|NSIBObjectData|NSString|NSMutableString|NSNumber|NSArray|NSMutableArray|NSSet|NSMutableSet|NSDictionary|NSMutableDictionary|NSApplication|NSNib.*Connector)$/u.test(name) && !isUIKitRuntimeConnectionClass(name);
1600
+ }).map((object) => {
1601
+ const className = runtimeClass(object.id) ?? normalizeClassName(object.class_name);
1602
+ budget.reserveJsonStringOccurrence(className);
1603
+ let name = className;
1604
+ for (const [key, value] of Object.entries(object.values)) {
1605
+ if (!/(?:title|label|identifier|accessibility|name|contents)/iu.test(key)) continue;
1606
+ const resolved = dereference(value);
1607
+ if (typeof resolved !== "string") continue;
1608
+ name = resolved;
1609
+ break;
1610
+ }
1611
+ budget.reserveJsonStringOccurrence(name);
1612
+ const nibValues = Object.fromEntries(Object.entries(object.values).map(([key, value]) => {
1613
+ budget.reserveJsonPropertyNameOccurrence(key);
1614
+ return [key, dereference(value) ?? null];
1615
+ }));
1616
+ const resourceFields = appleResourceKeyFields(nibValues);
1617
+ for (const [field, value] of resourceFields) {
1618
+ budget.reserveJsonPropertyNameOccurrence(field);
1619
+ budget.reserveJsonStringOccurrence(value);
1620
+ }
1621
+ return [String(object.id), {
1622
+ customClass: className,
1623
+ label: name,
1624
+ objectID: String(object.id),
1625
+ nibValues,
1626
+ ...Object.fromEntries(resourceFields)
1627
+ }];
1628
+ }));
1629
+ const connections = {};
1630
+ const hierarchy = [];
1631
+ let unresolvedConnections = 0;
1632
+ const reference = (value) => {
1633
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return null;
1634
+ return typeof value.$nib_object_ref === "number" ? value.$nib_object_ref : null;
1635
+ };
1636
+ for (const object of archive.objects) {
1637
+ const className = normalizeClassName(object.class_name);
1638
+ const uiKit = isUIKitRuntimeConnectionClass(className);
1639
+ if (!uiKit && !className.includes("Connector")) continue;
1640
+ const values = object.values;
1641
+ const connectionFields = interfaceBuilderConnectionFieldNames(className);
1642
+ const source = reference(values[connectionFields.source]);
1643
+ if (source === null) {
1644
+ unresolvedConnections += 1;
1645
+ continue;
1646
+ }
1647
+ const destination = reference(values[connectionFields.destination]);
1648
+ const label = referencedString(values[connectionFields.label]);
1649
+ const type = className.includes("Outlet") ? "outlet" : className.includes("Control") || className.includes("Event") ? "action" : className;
1650
+ budget.reserveJsonStringOccurrence(type);
1651
+ const eventMask = values.UIEventMask;
1652
+ (connections[String(source)] ??= []).push({
1653
+ type,
1654
+ "destination-id": destination === null ? null : String(destination),
1655
+ label,
1656
+ source_id: String(source),
1657
+ archive_object_id: String(object.id),
1658
+ ...typeof eventMask === "number" ? { ui_event_mask: eventMask } : {}
1659
+ });
1660
+ }
1661
+ let hierarchyOmitted = 0;
1662
+ let hierarchyNodeCount = 0;
1663
+ const hierarchyFor = (objectId, seen, depth) => {
1664
+ if (depth > 32 || seen.has(objectId)) {
1665
+ hierarchyOmitted += 1;
1666
+ return null;
1667
+ }
1668
+ if (hierarchyNodeCount >= maxHierarchyNodes) {
1669
+ hierarchyOmitted += 1;
1670
+ return null;
1671
+ }
1672
+ if (!budget.tryReserve(128)) {
1673
+ hierarchyOmitted += 1;
1674
+ return null;
1675
+ }
1676
+ const object = byId.get(objectId);
1677
+ if (object === undefined) {
1678
+ hierarchyOmitted += 1;
1679
+ return null;
1680
+ }
1681
+ hierarchyNodeCount += 1;
1682
+ const nextSeen = new Set(seen).add(objectId);
1683
+ const children = [];
1684
+ for (const [key, value] of Object.entries(object.values)) {
1685
+ if (!/(?:subviews|contentview|childviewcontrollers|view)$/iu.test(key)) continue;
1686
+ const direct = reference(value);
1687
+ if (direct === null) continue;
1688
+ const target = byId.get(direct);
1689
+ if (target === undefined) {
1690
+ hierarchyOmitted += 1;
1691
+ continue;
1692
+ }
1693
+ if (/array|set/iu.test(target.class_name)) {
1694
+ for (const candidate of Object.values(target.values)) {
1695
+ const child = reference(candidate);
1696
+ const nested = child === null ? null : hierarchyFor(child, nextSeen, depth + 1);
1697
+ if (nested !== null) children.push(nested);
1698
+ }
1699
+ } else {
1700
+ const nested = hierarchyFor(direct, nextSeen, depth + 1);
1701
+ if (nested !== null) children.push(nested);
1702
+ }
1703
+ }
1704
+ return {
1705
+ objectID: String(objectId),
1706
+ children
1707
+ };
1708
+ };
1709
+ const ibData = archive.objects.find(({ class_name }) => normalizeClassName(class_name) === "NSIBObjectData");
1710
+ const rootId = reference(ibData?.values.NSRoot);
1711
+ const hierarchyRoots = rootId === null ? [] : [rootId];
1712
+ for (const hierarchyRoot of hierarchyRoots) {
1713
+ const root = hierarchyFor(hierarchyRoot, new Set(), 0);
1714
+ if (root !== null) hierarchy.push(root);
1715
+ }
1716
+ const viewHierarchy = projectNibViewHierarchy(archive.objects, new Set(Object.keys(objects).map(Number)), () => budget.tryReserve(128), maxHierarchyNodes);
1717
+ const merged = mergeNibHierarchies(hierarchy, viewHierarchy.hierarchy ?? [], () => budget.tryReserve(96), maxHierarchyNodes);
1718
+ return {
1719
+ omitted: viewHierarchy.omitted + hierarchyOmitted + merged.omitted,
1720
+ unresolvedConnections,
1721
+ raw: jsonValueSchema.parse({
1722
+ "com.apple.ibtool.document.objects": objects,
1723
+ "com.apple.ibtool.document.connections": connections,
1724
+ "com.apple.ibtool.document.hierarchy": merged.hierarchy,
1725
+ "com.apple.ibtool.document.classes": Object.fromEntries(archive.classes.map((name) => {
1726
+ const className = normalizeClassName(name);
1727
+ budget.reserveJsonPropertyNameOccurrence(className);
1728
+ return [className, {}];
1729
+ }))
1730
+ })
1731
+ };
1732
+ };
1733
+ isInterfaceBuilderArchive = (path) => {
1734
+ const lower = path.toLowerCase();
1735
+ return lower.endsWith(".nib") || lower.endsWith("/objects.nib");
1736
+ };
1737
+ readEntry = async (reader, entry, signal, maxInputBytes = MAX_AGGREGATE_INPUT_BYTES) => {
1738
+ if (entry.declaredSize !== null && entry.declaredSize > maxInputBytes) throw new InterfaceBuilderDecodeBudgetExceeded("aggregate_decode_budget_exhausted", "archive exceeds the aggregate Interface Builder decode budget");
1739
+ const stream = await reader.open(entry, signal);
1740
+ const chunks = [];
1741
+ let length = 0;
1742
+ for await (const chunk of stream) {
1743
+ const bytes = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
1744
+ length += bytes.length;
1745
+ if (length > maxInputBytes) {
1746
+ stream.destroy();
1747
+ throw new InterfaceBuilderDecodeBudgetExceeded("aggregate_decode_budget_exhausted", "archive exceeded the aggregate Interface Builder decode budget");
1748
+ }
1749
+ chunks.push(bytes);
1750
+ }
1751
+ return Buffer.concat(chunks, length);
1752
+ };
1753
+ parseXmlWithinDecodeBudget = (text) => {
1754
+ try {
1755
+ return parseXmlPropertyList(text);
1756
+ } catch (cause) {
1757
+ if (cause instanceof RangeError) throw new InterfaceBuilderDecodeBudgetExceeded("aggregate_decode_budget_exhausted", cause.message);
1758
+ throw cause;
1759
+ }
1760
+ };
1761
+ decodePlist = (bytes, xmlText, binaryPrototypeKeyObserved) => {
1762
+ const binary = hasBinaryPlistSignature(bytes);
1763
+ const binaryNumberMetadata = binary ? scanBinaryPlistNumberLiterals(bytes) : undefined;
1764
+ const { value, omittedPrototypeKeys, numberLiterals } = binary ? {
1765
+ value: parseBinary(decodeBinaryPlistNumbers(bytes, binaryNumberMetadata)),
1766
+ omittedPrototypeKeys: binaryPrototypeKeyObserved ? null : 0,
1767
+ numberLiterals: binaryNumberMetadata.literals
1768
+ } : parseXmlWithinDecodeBudget(xmlText ?? decodeXmlPlistText(bytes));
1769
+ const projected = projectPlistValue(value);
1770
+ return {
1771
+ value: projected.value,
1772
+ omittedPrototypeKeys,
1773
+ unknownDateCount: projected.unknownDateCount,
1774
+ numberLiterals
1775
+ };
1776
+ };
1777
+ })))();
1778
+ }
1779
+
1780
+ //#endregion
1781
+ //#region dist/artifacts/apple/AppleAssetCatalogAnalysis.js
1782
+ var ASSETUTIL, MAX_CATALOG_BYTES, MAX_TOTAL_METADATA_BYTES, analyzeAppleAssetCatalogs, collectAssetCatalogs, inspectAssetCatalogEntry, collectInterfaceBuilderResourceKeys, runAssetUtil, digestBounded;
1783
+ function init_AppleAssetCatalogAnalysis() {
1784
+ return (init_AppleAssetCatalogAnalysis = __esmMin((() => {
1785
+ init_DirectoryArtifactReader();
1786
+ init_ArtifactReader();
1787
+ init_InterfaceBuilderAnalysis();
1788
+ init_appleAssetCatalog();
1789
+ init_ExecFileOutput();
1790
+ ASSETUTIL = "/usr/bin/assetutil";
1791
+ MAX_CATALOG_BYTES = 64 * 1024 * 1024;
1792
+ MAX_TOTAL_METADATA_BYTES = 64 * 1024 * 1024;
1793
+ analyzeAppleAssetCatalogs = async (input) => {
1794
+ if (process.platform !== "darwin" && input.runAssetUtil === undefined) throw new ArtifactReaderFailure("unavailable", "Apple asset catalog inspection requires macOS assetutil");
1795
+ const page = appleAssetCatalogInputSchema.parse(input.page ?? {});
1796
+ const interfaceBuilderCancel = new AbortController();
1797
+ const interfaceBuilderAnalysis = (input.analyzeInterfaceBuilder ?? analyzeInterfaceBuilderBundle)({
1798
+ bundlePath: input.bundlePath,
1799
+ targetSha256: input.targetSha256,
1800
+ signal: input.signal === undefined ? interfaceBuilderCancel.signal : AbortSignal.any([input.signal, interfaceBuilderCancel.signal])
1801
+ }).then((value) => ({
1802
+ ok: true,
1803
+ value
1804
+ }), (error) => ({
1805
+ ok: false,
1806
+ error
1807
+ }));
1808
+ let catalogs;
1809
+ let uninspected;
1810
+ try {
1811
+ ({catalogs, uninspected} = await collectAssetCatalogs(input));
1812
+ } catch (cause) {
1813
+ interfaceBuilderCancel.abort();
1814
+ await interfaceBuilderAnalysis;
1815
+ throw cause;
1816
+ }
1817
+ const analyzed = await interfaceBuilderAnalysis;
1818
+ if (!analyzed.ok) throw analyzed.error;
1819
+ const interfaceBuilder = analyzed.value;
1820
+ const resourceReferences = collectInterfaceBuilderResourceKeys(interfaceBuilder.graph.nodes);
1821
+ const result = projectAppleAssetCatalogPage({
1822
+ targetSha256: input.targetSha256,
1823
+ catalogs,
1824
+ offset: page.offset,
1825
+ limit: page.limit,
1826
+ resourceReferences
1827
+ });
1828
+ return {
1829
+ ...result,
1830
+ limitations: [
1831
+ ...result.limitations,
1832
+ ...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."] : [],
1833
+ ...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(", ")}`],
1834
+ "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.",
1835
+ ...interfaceBuilder.graph.truncated ? ["Interface Builder resource-key joins may be incomplete because the decoded UI graph was truncated."] : []
1836
+ ]
1837
+ };
1838
+ };
1839
+ collectAssetCatalogs = async (input) => {
1840
+ const reader = new DirectoryArtifactReader(input.bundlePath);
1841
+ const catalogs = [];
1842
+ const uninspected = [];
1843
+ let totalMetadataBytes = 0;
1844
+ try {
1845
+ for await (const entry of reader.entries(input.signal)) {
1846
+ if (entry.path.split("/").at(-1) !== "Assets.car") continue;
1847
+ if (entry.kind !== "file") {
1848
+ uninspected.push(`${entry.path} (${entry.kind})`);
1849
+ continue;
1850
+ }
1851
+ const inspected = await inspectAssetCatalogEntry({
1852
+ reader,
1853
+ entry,
1854
+ runAssetUtil: input.runAssetUtil ?? ((path, signal) => runAssetUtil(path, input.environment, signal)),
1855
+ ...input.signal === undefined ? {} : { signal: input.signal }
1856
+ });
1857
+ totalMetadataBytes += inspected.metadataBytes;
1858
+ if (totalMetadataBytes > MAX_TOTAL_METADATA_BYTES) throw new ArtifactReaderFailure("limit", `Combined asset catalog metadata exceeds ${MAX_TOTAL_METADATA_BYTES} bytes`);
1859
+ catalogs.push(inspected.catalog);
1860
+ }
1861
+ } finally {
1862
+ await reader.close();
1863
+ }
1864
+ if (catalogs.length === 0 && uninspected.length > 0) throw new ArtifactReaderFailure("path", `Asset catalog entries are not regular files and were not inspected: ${uninspected.join(", ")}`);
1865
+ return {
1866
+ catalogs,
1867
+ uninspected
1868
+ };
1869
+ };
1870
+ inspectAssetCatalogEntry = async (input) => {
1871
+ const { entry, reader, signal } = input;
1872
+ const sha256 = await digestBounded(reader, entry, signal);
1873
+ const before = await lstat(entry.adapterKey, { bigint: true });
1874
+ if (!before.isFile() || !sameArtifactSourceIdentity(entry.sourceIdentity, before)) throw new ArtifactReaderFailure("integrity", `Asset catalog changed before inspection: ${entry.path}`);
1875
+ const output = await input.runAssetUtil(entry.adapterKey, signal);
1876
+ const after = await lstat(entry.adapterKey, { bigint: true });
1877
+ if (!after.isFile() || !sameArtifactSourceIdentity(entry.sourceIdentity, after) || await digestBounded(reader, entry, signal) !== sha256) throw new ArtifactReaderFailure("integrity", `Asset catalog changed during inspection: ${entry.path}`);
1878
+ let parsed;
1879
+ try {
1880
+ parsed = JSON.parse(output);
1881
+ } catch (cause) {
1882
+ throw new ArtifactReaderFailure("format", `assetutil returned invalid JSON for ${entry.path}`, { cause });
1883
+ }
1884
+ try {
1885
+ return {
1886
+ catalog: {
1887
+ path: entry.path,
1888
+ sha256,
1889
+ records: parseAppleAssetCatalogRecords(parsed)
1890
+ },
1891
+ metadataBytes: Buffer.byteLength(output, "utf8")
1892
+ };
1893
+ } catch (cause) {
1894
+ throw new ArtifactReaderFailure("format", `assetutil returned an unsupported record for ${entry.path}`, { cause });
1895
+ }
1896
+ };
1897
+ collectInterfaceBuilderResourceKeys = (nodes) => nodes.flatMap((node) => {
1898
+ if (node.kind !== "resource") return [];
1899
+ const source = node.evidence.find((item) => item.artifact_path !== null && item.artifact_sha256 !== null);
1900
+ const sourcePath = source?.artifact_path;
1901
+ const sourceArchiveSha256 = source?.artifact_sha256;
1902
+ if (sourcePath == null || sourceArchiveSha256 == null) return [];
1903
+ return appleResourceKeyFields(node.attributes).flatMap(([field, value]) => [{
1904
+ sourceNodeId: node.id,
1905
+ sourcePath,
1906
+ sourceArchiveSha256,
1907
+ field,
1908
+ key: value
1909
+ }]);
1910
+ });
1911
+ runAssetUtil = async (path, environment, signal) => {
1912
+ try {
1913
+ return (await execFileOutput(ASSETUTIL, ["--info", path], {
1914
+ env: environment,
1915
+ timeout: 6e4,
1916
+ maxBuffer: MAX_CATALOG_BYTES,
1917
+ ...signal === undefined ? {} : { signal }
1918
+ })).stdout;
1919
+ } catch (cause) {
1920
+ if (signal?.aborted === true) throw new ArtifactReaderFailure("cancelled", "Asset catalog inspection cancelled");
1921
+ const code = typeof cause === "object" && cause !== null && "code" in cause ? cause.code : undefined;
1922
+ throw new ArtifactReaderFailure(code === "ENOENT" ? "unavailable" : code === "ETIMEDOUT" || code === "ERR_CHILD_PROCESS_STDIO_MAXBUFFER" ? "limit" : "io", `assetutil failed${code === undefined ? "" : ` (${String(code)})`}`, { cause });
1923
+ }
1924
+ };
1925
+ digestBounded = async (reader, entry, signal) => {
1926
+ if (entry.declaredSize === null || entry.declaredSize > MAX_CATALOG_BYTES) throw new ArtifactReaderFailure("limit", `Asset catalog exceeds ${MAX_CATALOG_BYTES} bytes: ${entry.path}`);
1927
+ const stream = await reader.open(entry, signal);
1928
+ const hash = createHash("sha256");
1929
+ let length = 0;
1930
+ for await (const chunk of stream) {
1931
+ if (signal?.aborted === true) throw new ArtifactReaderFailure("cancelled", "Asset catalog inspection cancelled");
1932
+ const bytes = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
1933
+ length += bytes.length;
1934
+ if (length > MAX_CATALOG_BYTES) throw new ArtifactReaderFailure("limit", `Asset catalog exceeds byte limit: ${entry.path}`);
1935
+ hash.update(bytes);
1936
+ }
1937
+ return hash.digest("hex");
1938
+ };
1939
+ })))();
1940
+ }
1941
+
1942
+ //#endregion
1943
+ //#region dist/artifacts/ArtifactProvider.js
1944
+ var ArtifactProvider, ArtifactClient, isArtifactOperation, translateArtifactFailure, subjectFor;
1945
+ function init_ArtifactProvider() {
1946
+ return (init_ArtifactProvider = __esmMin((() => {
1947
+ init_snapshotEnvironment();
1948
+ init_AnalysisProvider();
1949
+ init_KeyedArchiveReader();
1950
+ init_DylibResolutionReader();
1951
+ init_ArtifactInventory();
1952
+ init_ArtifactExtraction();
1953
+ init_InterfaceBuilderAnalysis();
1954
+ init_AppleAssetCatalogAnalysis();
1955
+ init_artifactToolContracts();
1956
+ init_binaryTargetTypes();
1957
+ init_analysisErrorCore();
1958
+ init_artifactOperationError();
1959
+ init_interfaceBuilderGraph();
1960
+ init_result();
1961
+ init_ArtifactReader();
1962
+ init_ArtifactResourceScope();
1963
+ init_ArtifactFileOperation();
1964
+ init_ArtifactProviderMetadata();
1965
+ init_InvestigationProviders();
1966
+ init_evidence();
1967
+ init_immutableJson();
1968
+ init_artifactInspection();
1969
+ init_providerCleanupError();
1970
+ ArtifactProvider = class {
1971
+ #capabilities;
1972
+ #platform;
1973
+ environment;
1974
+ constructor(environment, platform = process.platform) {
1975
+ this.environment = snapshotEnvironment(environment, platform);
1976
+ this.#capabilities = artifactCapabilities(platform);
1977
+ this.#platform = platform;
1978
+ }
1979
+ identity() {
1980
+ return ARTIFACT_GRAPH_PROVIDER;
1981
+ }
1982
+ capabilities() {
1983
+ return this.#capabilities;
1984
+ }
1985
+ createClient(target) {
1986
+ return new ArtifactClient(target, this.environment, this.#platform);
1987
+ }
1988
+ };
1989
+ ArtifactClient = class {
1990
+ target;
1991
+ environment;
1992
+ platform;
1993
+ #resourceScope = new ArtifactResourceScope();
1994
+ constructor(target, environment, platform) {
1995
+ this.target = target;
1996
+ this.environment = environment;
1997
+ this.platform = platform;
1998
+ }
1999
+ async execute(operation, parameters, options) {
2000
+ if (operation === "health") return ok(createAnalysisExecution(null, ARTIFACT_GRAPH_PROVIDER));
2001
+ if (!isArtifactOperation(operation)) return err(new AnalysisCapabilityUnavailableError(ARTIFACT_GRAPH_PROVIDER.id, operation, "Operation is not implemented by artifact graph provider."));
2002
+ try {
2003
+ if (operation === "inspect_artifact") {
2004
+ const inspected = await this.inspectArtifact(parameters, options);
2005
+ return inspected;
2006
+ }
2007
+ if (operation === "decode_interface_builder") {
2008
+ 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");
2009
+ const limits = interfaceBuilderLimitsSchema.parse(parameters);
2010
+ const result = await analyzeInterfaceBuilderBundle({
2011
+ bundlePath: this.target.sourcePath,
2012
+ targetSha256: this.target.sha256,
2013
+ limits,
2014
+ ...options?.signal === undefined ? {} : { signal: options.signal }
2015
+ });
2016
+ return ok(createAnalysisExecution(result, ARTIFACT_GRAPH_PROVIDER, {
2017
+ limitations: result.limitations,
2018
+ locations: result.documents.map(({ relative_path: path }) => ({
2019
+ kind: "artifact-path",
2020
+ path
2021
+ }))
2022
+ }));
2023
+ }
2024
+ if (operation === "inspect_keyed_archive") {
2025
+ const standalone = this.target.kind === "artifact" && this.target.format === "plist";
2026
+ if (standalone && parameters.path !== undefined && parameters.path !== "." && parameters.path !== basename(this.target.path)) throw new AnalysisInputError(operation, undefined, [{
2027
+ path: ["path"],
2028
+ reason: "invalid_value",
2029
+ message: "For an active plist, path must select that archive (omit path or use its basename).",
2030
+ expected: basename(this.target.path)
2031
+ }]);
2032
+ const bundlePath = standalone ? dirname(this.target.path) : this.target.sourcePath;
2033
+ if (bundlePath === undefined || !standalone && !bundlePath.toLowerCase().endsWith(".app")) throw this.unsupportedTarget(operation, "inspect_keyed_archive requires an active plist or .app bundle");
2034
+ const result = await inspectBundleKeyedArchive({
2035
+ bundlePath,
2036
+ targetSha256: this.target.sha256,
2037
+ parameters: standalone ? {
2038
+ ...parameters,
2039
+ path: basename(this.target.path)
2040
+ } : parameters,
2041
+ platform: this.platform,
2042
+ ...options?.signal === undefined ? {} : { signal: options.signal }
2043
+ });
2044
+ if (standalone && result.archive_sha256 !== this.target.sha256) throw new ArtifactReaderFailure("integrity", `Active archive digest changed: expected ${this.target.sha256}, observed ${result.archive_sha256}`);
2045
+ return ok(createAnalysisExecution(result, ARTIFACT_GRAPH_PROVIDER, {
2046
+ limitations: result.limitations,
2047
+ locations: [{
2048
+ kind: "artifact-path",
2049
+ path: result.archive_path
2050
+ }]
2051
+ }));
2052
+ }
2053
+ if (operation === "inspect_asset_catalog") {
2054
+ return await this.inspectAssetCatalog(parameters, options);
2055
+ }
2056
+ if (operation === "trace_dylib_resolution") return await this.traceDylibResolution(parameters, options);
2057
+ if (operation === "extract_artifact") {
2058
+ const parsed = artifactExtractionExecutionSchema.parse(parameters);
2059
+ const result = await extractArtifact({
2060
+ inputPath: this.target.sourcePath ?? this.target.path,
2061
+ inputFormat: this.target.format,
2062
+ outputRoot: parsed.output_root,
2063
+ environment: this.environment,
2064
+ integrityPolicy: parsed.integrity_policy,
2065
+ resourceScope: this.#resourceScope
2066
+ }, options?.signal);
2067
+ return ok(createAnalysisExecution(result, ARTIFACT_GRAPH_PROVIDER, {
2068
+ rawResult: null,
2069
+ limitations: result.limitations,
2070
+ subject: subjectFor(this.target.sourcePath ?? this.target.path, result.manifest),
2071
+ locations: []
2072
+ }));
2073
+ }
2074
+ const parsed = artifactInventoryInputSchema.parse(parameters);
2075
+ const result = await this.inventory(parsed, options);
2076
+ return ok(createAnalysisExecution(result, ARTIFACT_GRAPH_PROVIDER, {
2077
+ rawResult: null,
2078
+ limitations: result.limitations,
2079
+ subject: subjectFor(this.target.sourcePath ?? this.target.path, result.manifest),
2080
+ locations: []
2081
+ }));
2082
+ } catch (cause) {
2083
+ return err(translateArtifactFailure(operation, cause));
2084
+ }
2085
+ }
2086
+ close() {
2087
+ return this.#resourceScope.close().then(() => ok(null), (cause) => {
2088
+ const failure = cause instanceof ArtifactReaderFailure ? cause : undefined;
2089
+ const error = new ProviderCleanupError(ARTIFACT_GRAPH_PROVIDER.id, failure?.cleanup?.resources ?? ["artifact resources"], { reason: failure?.cleanup?.reason ?? (cause instanceof Error ? cause.message : String(cause)) }, {
2090
+ cause,
2091
+ operation: "close_binary"
2092
+ });
2093
+ bindArtifactFileCleanup(cause, error);
2094
+ return err(error);
2095
+ });
2096
+ }
2097
+ /** The active target's kind is outside this operation's supported targets. */
2098
+ unsupportedTarget(operation, reason) {
2099
+ return new AnalysisUnsupportedTargetError(operation, this.target.sourcePath ?? this.target.path, reason);
2100
+ }
2101
+ async inspectAssetCatalog(parameters, options) {
2102
+ const bundlePath = this.target.sourcePath;
2103
+ 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");
2104
+ const result = await analyzeAppleAssetCatalogs({
2105
+ environment: this.environment,
2106
+ bundlePath,
2107
+ targetSha256: this.target.sha256,
2108
+ page: parameters,
2109
+ ...options?.signal === undefined ? {} : { signal: options.signal }
2110
+ });
2111
+ return ok(createAnalysisExecution(result, ARTIFACT_GRAPH_PROVIDER, {
2112
+ limitations: result.limitations,
2113
+ locations: result.catalogs.map(({ path }) => ({
2114
+ kind: "artifact-path",
2115
+ path
2116
+ }))
2117
+ }));
2118
+ }
2119
+ async traceDylibResolution(parameters, options) {
2120
+ 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");
2121
+ const bundle = this.target.bundleInfoPlist === undefined ? undefined : this.target.sourcePath;
2122
+ const result = await traceDylibResolution({
2123
+ rootPath: bundle ?? dirname(this.target.path),
2124
+ targetPath: this.target.path,
2125
+ targetSha256: this.target.sha256,
2126
+ enumerateRoots: bundle !== undefined,
2127
+ parameters,
2128
+ resourceScope: this.#resourceScope,
2129
+ ...options?.signal === undefined ? {} : { signal: options.signal }
2130
+ });
2131
+ return ok(createAnalysisExecution(result, ARTIFACT_GRAPH_PROVIDER, {
2132
+ limitations: result.limitations,
2133
+ locations: result.images.map(({ path }) => ({
2134
+ kind: "artifact-path",
2135
+ path
2136
+ }))
2137
+ }));
2138
+ }
2139
+ async inspectArtifact(parameters, options) {
2140
+ const parsed = artifactInventoryInputSchema.parse(parameters);
2141
+ const inventoryParameters = { integrity_policy: parsed.integrity_policy };
2142
+ await options?.progress?.report({
2143
+ phase: "inspect_artifact.inventory",
2144
+ completed: 0,
2145
+ total: 1,
2146
+ message: "inventory substep started"
2147
+ });
2148
+ const inventory = freezeJsonSnapshot(await this.inventory(inventoryParameters, options));
2149
+ const subject = subjectFor(this.target.sourcePath ?? this.target.path, inventory.manifest);
2150
+ const inventoryEvidence = createEvidence(subject, ARTIFACT_GRAPH_PROVIDER, {
2151
+ operation: "inventory_artifact",
2152
+ parameters: inventoryParameters,
2153
+ result: inventory,
2154
+ rawResult: null,
2155
+ limitations: inventory.limitations,
2156
+ locations: []
2157
+ });
2158
+ const result = freezeJsonSnapshot(createArtifactInspection(inventoryEvidence));
2159
+ await options?.progress?.report({
2160
+ phase: "inspect_artifact.inventory",
2161
+ completed: 1,
2162
+ total: 1,
2163
+ message: "inventory substep completed"
2164
+ });
2165
+ return ok(createAnalysisExecution(result, ARTIFACT_GRAPH_PROVIDER, {
2166
+ rawResult: null,
2167
+ limitations: result.limitations,
2168
+ subject,
2169
+ locations: []
2170
+ }));
2171
+ }
2172
+ inventory(parsed, options) {
2173
+ return inventoryArtifact(this.target.sourcePath ?? this.target.path, {
2174
+ resourceScope: this.#resourceScope,
2175
+ environment: this.environment,
2176
+ ...options?.signal === undefined ? {} : { signal: options.signal },
2177
+ integrity: { mode: parsed.integrity_policy }
2178
+ });
2179
+ }
2180
+ };
2181
+ isArtifactOperation = (operation) => ARTIFACT_ANALYSIS_OPERATIONS.includes(operation);
2182
+ translateArtifactFailure = (operation, cause) => {
2183
+ if (cause instanceof ArtifactReaderFailure) {
2184
+ const error = new ArtifactOperationError(operation, cause.reason, cause.details, cause.message, {
2185
+ cause: cause.reason === "cancelled" ? artifactFileCancellationCause(cause) : cause,
2186
+ ...cause.cleanup === undefined ? {} : { cleanup: cause.cleanup },
2187
+ ...cause.partialObservation === undefined ? {} : { partialObservation: cause.partialObservation }
2188
+ });
2189
+ bindArtifactFileCleanup(cause, error);
2190
+ return error;
2191
+ }
2192
+ if (cause instanceof AnalysisInputError || cause instanceof AnalysisCancelledError || cause instanceof AnalysisUnsupportedTargetError) return cause;
2193
+ return new ArtifactOperationError(operation, "io");
2194
+ };
2195
+ subjectFor = (path, manifest) => ({
2196
+ path,
2197
+ sha256: manifest.root_sha256,
2198
+ format: manifest.root_format
2199
+ });
2200
+ })))();
2201
+ }
2202
+
2203
+ //#endregion
2204
+ init_ArtifactProvider();
2205
+ export { ArtifactProvider };