reverseport 0.0.0-stage → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1489) hide show
  1. package/DISCLAIMER.md +136 -0
  2. package/LICENSE +22 -0
  3. package/README.md +289 -2
  4. package/RESPONSIBLE-USE.md +22 -0
  5. package/THIRD_PARTY_NOTICES.md +130 -0
  6. package/bin/reverseport.mjs +136 -0
  7. package/bridge/android/ReaJadxBridge.java +270 -0
  8. package/bridge/ghidra/ReaGhidraAnalysisOptions.java +38 -0
  9. package/bridge/ghidra/ReaGhidraApplySeeds.java +151 -0
  10. package/bridge/ghidra/ReaGhidraBridge.java +3858 -0
  11. package/bridge/ghidra/ReaGhidraBundleActivator.java +14 -0
  12. package/bridge/ghidra/ReaGhidraExtensions.java +113 -0
  13. package/bridge/ghidra/ReaGhidraMipsSoftFloat.java +176 -0
  14. package/bridge/ghidra/ReaGhidraNoReturnFix.java +123 -0
  15. package/bridge/ghidra/ReaGhidraPrepareCom.java +32 -0
  16. package/bridge/ghidra/ReaGhidraPrepareRaw.java +36 -0
  17. package/bridge/hopper_bridge.py +1162 -0
  18. package/bridge/mitmproxy/capture.py +208 -0
  19. package/bridge/native/NativeUIChildren.swift +27 -0
  20. package/bridge/native/ReaNativeUI.swift +171 -0
  21. package/bridge/native/rea_lldb_tracer.py +839 -0
  22. package/bridge/process/ProcessRunTokenReader.swift +339 -0
  23. package/bridge/process/ProcessRunTokenReaderMain.swift +35 -0
  24. package/bridge/pwndbg/core_context.py +101 -0
  25. package/bridge/pwndbg/launch.py +39 -0
  26. package/bridge/pwndbg/launch_impl.py +34 -0
  27. package/bridge/pwntools/decoder_runtime.py +59 -0
  28. package/bridge/pwntools/layout.py +39 -0
  29. package/bridge/pwntools/layout_impl.py +314 -0
  30. package/bridge/pwntools/recorded_crash.py +39 -0
  31. package/bridge/pwntools/recorded_crash_impl.py +147 -0
  32. package/dist/adb/AdbConfiguration.js +88 -0
  33. package/dist/adb/AdbDeviceOutput.js +191 -0
  34. package/dist/adb/AdbDirectoryListing.js +80 -0
  35. package/dist/adb/AdbHostFileName.js +34 -0
  36. package/dist/adb/AdbProvider.js +1227 -0
  37. package/dist/adb/AdbShellOutput.js +267 -0
  38. package/dist/android/AndroidTargetSnapshot.js +118 -0
  39. package/dist/android/JadxAnalysis.js +201 -0
  40. package/dist/android/JadxConfiguration.js +320 -0
  41. package/dist/android/JadxMcpTransport.js +188 -0
  42. package/dist/android/JadxProtocol.js +115 -0
  43. package/dist/android/JadxProvider.js +337 -0
  44. package/dist/android/JadxRelease.js +27 -0
  45. package/dist/android/JadxSession.js +172 -0
  46. package/dist/apktool/ApktoolConfiguration.js +120 -0
  47. package/dist/apktool/ApktoolDecodeOutput.js +142 -0
  48. package/dist/apktool/ApktoolProvider.js +522 -0
  49. package/dist/application/AnalysisContextQueries.js +128 -0
  50. package/dist/application/AnalysisDocument.js +32 -0
  51. package/dist/application/AnalysisProvider.js +27 -0
  52. package/dist/application/AppBundleExecutable.js +192 -0
  53. package/dist/application/BinaryTargetResolver.js +356 -0
  54. package/dist/application/BrowserEvidence.js +127 -0
  55. package/dist/application/BrowserObservationPort.js +1 -0
  56. package/dist/application/BrowserObservationService.js +86 -0
  57. package/dist/application/BrowserScenarioCapturePort.js +1 -0
  58. package/dist/application/BrowserScenarioCaptureService.js +17 -0
  59. package/dist/application/BrowserScenarioEvidence.js +28 -0
  60. package/dist/application/CallPathTracing.js +182 -0
  61. package/dist/application/CapabilityClientRequirements.js +17 -0
  62. package/dist/application/CapabilityInventory.js +525 -0
  63. package/dist/application/ClientConfigPath.js +35 -0
  64. package/dist/application/ClientConfigurationDocument.js +1196 -0
  65. package/dist/application/ClientConfigurationFiles.js +91 -0
  66. package/dist/application/ClientRegistrationEnvironment.js +39 -0
  67. package/dist/application/ClientRegistrationIdentity.js +80 -0
  68. package/dist/application/ClientRegistrationStatus.js +233 -0
  69. package/dist/application/DirectAnalysis.js +371 -0
  70. package/dist/application/DirectAnalysisCleanup.js +71 -0
  71. package/dist/application/DirectAnalysisDependencies.js +1 -0
  72. package/dist/application/DirectAnalysisStatus.js +22 -0
  73. package/dist/application/Doctor.js +349 -0
  74. package/dist/application/DoctorDiagnostics.js +169 -0
  75. package/dist/application/DoctorProviderIds.js +2 -0
  76. package/dist/application/DoctorScope.js +113 -0
  77. package/dist/application/DshCordisPatch.js +342 -0
  78. package/dist/application/DshCordisYaml.js +155 -0
  79. package/dist/application/EnhancedLiteralTracing.js +88 -0
  80. package/dist/application/EnhancedToolTypes.js +4 -0
  81. package/dist/application/EnhancedTools.js +428 -0
  82. package/dist/application/EvidenceBundleCommands.js +70 -0
  83. package/dist/application/EvidenceBundleFiles.js +79 -0
  84. package/dist/application/EvidenceInputResolver.js +30 -0
  85. package/dist/application/FunctionAnalysisEvidence.js +34 -0
  86. package/dist/application/GeminiClientSettings.js +139 -0
  87. package/dist/application/HermesClientHome.js +115 -0
  88. package/dist/application/HopperDownload.js +39 -0
  89. package/dist/application/InventoryProjectionEvidence.js +44 -0
  90. package/dist/application/InvestigationProviders.js +130 -0
  91. package/dist/application/JsonFiles.js +225 -0
  92. package/dist/application/JsonInputFile.js +410 -0
  93. package/dist/application/LinuxHopper.js +232 -0
  94. package/dist/application/MacHopper.js +235 -0
  95. package/dist/application/MipsElfMetadata.js +175 -0
  96. package/dist/application/MipsElfSharedLoad.js +164 -0
  97. package/dist/application/OptionalObservationProviders.js +3 -0
  98. package/dist/application/ProcedureAddressResolution.js +11 -0
  99. package/dist/application/ProgressReporter.js +30 -0
  100. package/dist/application/ProviderOperationExecution.js +31 -0
  101. package/dist/application/RealHopperAssertions.js +135 -0
  102. package/dist/application/ReconstructionCoverageService.js +22 -0
  103. package/dist/application/ReconstructionObligationAuthority.js +72 -0
  104. package/dist/application/ReconstructionObligationCandidates.js +286 -0
  105. package/dist/application/ReconstructionObligationLedgerDiagnostics.js +47 -0
  106. package/dist/application/ReconstructionObligationLedgerEvaluation.js +238 -0
  107. package/dist/application/ReconstructionObligationLedgerProjection.js +15 -0
  108. package/dist/application/ReconstructionObligationLedgerService.js +54 -0
  109. package/dist/application/ReconstructionObligationOriginalCases.js +34 -0
  110. package/dist/application/ReconstructionObligationPolicies.js +132 -0
  111. package/dist/application/ReferenceSourceImport.js +200 -0
  112. package/dist/application/ReferenceSourceImportEntries.js +151 -0
  113. package/dist/application/ReferenceSourceImportPolicy.js +125 -0
  114. package/dist/application/ReferenceSourceImportTypes.js +47 -0
  115. package/dist/application/ReferenceSourceVcsAdapter.js +180 -0
  116. package/dist/application/RegularFileRead.js +120 -0
  117. package/dist/application/Setup.js +408 -0
  118. package/dist/application/SetupClientConfiguration.js +314 -0
  119. package/dist/application/SetupClients.js +44 -0
  120. package/dist/application/SetupHost.js +203 -0
  121. package/dist/application/SetupInstallFailure.js +77 -0
  122. package/dist/application/SetupPlan.js +210 -0
  123. package/dist/application/SetupRegistrationEnvironment.js +5 -0
  124. package/dist/application/SetupSkill.js +248 -0
  125. package/dist/application/SetupTypes.js +17 -0
  126. package/dist/application/SupportedClients.js +469 -0
  127. package/dist/application/TypeScriptEmittedSourceCandidates.js +23 -0
  128. package/dist/application/Uninstall.js +452 -0
  129. package/dist/application/UninstallFailure.js +14 -0
  130. package/dist/application/Update.js +137 -0
  131. package/dist/application/UpdateFailure.js +17 -0
  132. package/dist/application/UpdateMaintenance.js +111 -0
  133. package/dist/application/UpdateRuntime.js +264 -0
  134. package/dist/application/Utf8JsonInput.js +71 -0
  135. package/dist/application/ValidateSelectedWebScript.js +27 -0
  136. package/dist/application/WebModulePorts.js +1 -0
  137. package/dist/application/WebModuleTraceService.js +214 -0
  138. package/dist/application/WebNetworkCapturePort.js +1 -0
  139. package/dist/application/WebNetworkCaptureService.js +134 -0
  140. package/dist/application/WebRuntimePort.js +1 -0
  141. package/dist/application/WebRuntimeService.js +75 -0
  142. package/dist/application/WebScriptArtifactPort.js +1 -0
  143. package/dist/application/WebScriptExportService.js +214 -0
  144. package/dist/application/WebSourceLocationPorts.js +1 -0
  145. package/dist/application/WebSourceLocationService.js +177 -0
  146. package/dist/application/WindowsCapabilities.js +87 -0
  147. package/dist/application/WorkflowEvidence.js +105 -0
  148. package/dist/application/XrefsAddressResolution.js +45 -0
  149. package/dist/application/adb/AdbDeviceAnalysisPort.js +1 -0
  150. package/dist/application/adb/AdbDeviceAnalysisService.js +13 -0
  151. package/dist/application/analysisView/AnalysisViewService.js +133 -0
  152. package/dist/application/android/AndroidAnalysisPort.js +1 -0
  153. package/dist/application/android/AndroidAnalysisService.js +37 -0
  154. package/dist/application/android/AndroidApplicationService.js +17 -0
  155. package/dist/application/android/AndroidSearchEvidenceSummary.js +100 -0
  156. package/dist/application/apktool/ApktoolResourceAnalysisPort.js +1 -0
  157. package/dist/application/apktool/ApktoolResourceAnalysisService.js +13 -0
  158. package/dist/application/apple/AppleApplicationService.js +17 -0
  159. package/dist/application/artifacts/ArtifactExtractionDestination.js +5 -0
  160. package/dist/application/binary/AbortablePromise.js +28 -0
  161. package/dist/application/binary/AnalysisClientCleanup.js +15 -0
  162. package/dist/application/binary/AnalysisProviderEvaluation.js +77 -0
  163. package/dist/application/binary/AnalysisProviderRegistry.js +235 -0
  164. package/dist/application/binary/AnalysisSnapshotCache.js +232 -0
  165. package/dist/application/binary/AnalysisSnapshotFiles.js +96 -0
  166. package/dist/application/binary/BinarySession.js +605 -0
  167. package/dist/application/binary/BinarySessionComposition.js +9 -0
  168. package/dist/application/binary/BinarySessionExecution.js +66 -0
  169. package/dist/application/binary/BinarySessionOpen.js +66 -0
  170. package/dist/application/binary/BinarySessionPort.js +1 -0
  171. package/dist/application/binary/BinarySessionRecords.js +216 -0
  172. package/dist/application/binary/BinarySessionStatus.js +219 -0
  173. package/dist/application/binary/BinaryTargetSummary.js +9 -0
  174. package/dist/application/binary/CompositeProvider.js +103 -0
  175. package/dist/application/binary/LazyAnalysisProvider.js +105 -0
  176. package/dist/application/binary/SessionProviderRouter.js +118 -0
  177. package/dist/application/binaryDiagnostics/BinaryLayoutPort.js +1 -0
  178. package/dist/application/binaryDiagnostics/BinaryLayoutService.js +60 -0
  179. package/dist/application/binaryDiagnostics/PeResourcesPort.js +1 -0
  180. package/dist/application/binaryDiagnostics/PeResourcesService.js +111 -0
  181. package/dist/application/binaryDiagnostics/RecordedCrashPort.js +1 -0
  182. package/dist/application/binaryDiagnostics/RecordedCrashService.js +63 -0
  183. package/dist/application/evm/EvmInterfacePort.js +1 -0
  184. package/dist/application/evm/EvmInterfaceService.js +67 -0
  185. package/dist/application/firmware/FirmwareAnalysisPort.js +1 -0
  186. package/dist/application/firmware/FirmwareAnalysisService.js +38 -0
  187. package/dist/application/go/GoBinaryPort.js +1 -0
  188. package/dist/application/go/GoBinaryService.js +77 -0
  189. package/dist/application/harmony/HarmonyApplicationService.js +17 -0
  190. package/dist/application/homebrew.js +67 -0
  191. package/dist/application/investigation/EvidenceLedger.js +338 -0
  192. package/dist/application/investigation/InspectEvidenceBundle.js +18 -0
  193. package/dist/application/investigation/InvestigationRecordPort.js +1 -0
  194. package/dist/application/investigation/InvestigationRecords.js +65 -0
  195. package/dist/application/investigation/UnknownEvidence.js +37 -0
  196. package/dist/application/javascript/ElectronActiveEvidence.js +29 -0
  197. package/dist/application/javascript/ElectronActiveObservationPort.js +1 -0
  198. package/dist/application/javascript/ElectronActiveObservationService.js +51 -0
  199. package/dist/application/javascript/ElectronBoundaryAnalysis.js +118 -0
  200. package/dist/application/javascript/ElectronBoundaryGraph.js +11 -0
  201. package/dist/application/javascript/ElectronBoundaryGraphCallPaths.js +134 -0
  202. package/dist/application/javascript/ElectronBoundaryGraphContext.js +63 -0
  203. package/dist/application/javascript/ElectronBoundaryGraphIpc.js +261 -0
  204. package/dist/application/javascript/ElectronBoundaryGraphNative.js +102 -0
  205. package/dist/application/javascript/ElectronBoundaryGraphWindows.js +224 -0
  206. package/dist/application/javascript/ElectronEvidence.js +37 -0
  207. package/dist/application/javascript/ElectronObservationPort.js +1 -0
  208. package/dist/application/javascript/ElectronObservationService.js +26 -0
  209. package/dist/application/javascript/JavaScriptAnalysisControl.js +34 -0
  210. package/dist/application/javascript/JavaScriptApplicationEvidence.js +49 -0
  211. package/dist/application/javascript/JavaScriptApplicationEvidenceGraph.js +173 -0
  212. package/dist/application/javascript/JavaScriptApplicationService.js +170 -0
  213. package/dist/application/javascript/JavaScriptApplicationWorkflowEvidence.js +67 -0
  214. package/dist/application/javascript/JavaScriptApplicationWorkflowService.js +194 -0
  215. package/dist/application/javascript/JavaScriptArtifactAnalysis.js +431 -0
  216. package/dist/application/javascript/JavaScriptArtifactAnalysisTypes.js +1 -0
  217. package/dist/application/javascript/JavaScriptArtifactGraphAccumulator.js +89 -0
  218. package/dist/application/javascript/JavaScriptArtifactGraphBuilder.js +193 -0
  219. package/dist/application/javascript/JavaScriptArtifactGraphBundlers.js +229 -0
  220. package/dist/application/javascript/JavaScriptArtifactGraphContext.js +194 -0
  221. package/dist/application/javascript/JavaScriptArtifactGraphDocuments.js +160 -0
  222. package/dist/application/javascript/JavaScriptArtifactGraphEvidence.js +85 -0
  223. package/dist/application/javascript/JavaScriptArtifactGraphFindings.js +349 -0
  224. package/dist/application/javascript/JavaScriptArtifactGraphStructure.js +424 -0
  225. package/dist/application/javascript/JavaScriptArtifactPathResolution.js +836 -0
  226. package/dist/application/javascript/JavaScriptArtifactReconstruction.js +245 -0
  227. package/dist/application/javascript/JavaScriptArtifactReconstructionInput.js +12 -0
  228. package/dist/application/javascript/JavaScriptJsonModules.js +40 -0
  229. package/dist/application/javascript/JavaScriptModuleRelationships.js +304 -0
  230. package/dist/application/javascript/JavaScriptRecoveryPort.js +1 -0
  231. package/dist/application/javascript/JavaScriptRecoveryService.js +77 -0
  232. package/dist/application/javascript/JavaScriptRuntimeObservationEvidence.js +36 -0
  233. package/dist/application/javascript/JavaScriptRuntimeObservationPort.js +1 -0
  234. package/dist/application/javascript/JavaScriptRuntimeObservationService.js +28 -0
  235. package/dist/application/javascript/JavaScriptRuntimeReconciliationEvidence.js +24 -0
  236. package/dist/application/javascript/JavaScriptRuntimeReconciliationService.js +52 -0
  237. package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +163 -0
  238. package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +527 -0
  239. package/dist/application/javascript/JavaScriptSemanticGraphChildProcessProjection.js +165 -0
  240. package/dist/application/javascript/JavaScriptSemanticGraphConstruction.js +156 -0
  241. package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +216 -0
  242. package/dist/application/javascript/JavaScriptSemanticGraphElectronProjection.js +61 -0
  243. package/dist/application/javascript/JavaScriptSemanticGraphEvidence.js +86 -0
  244. package/dist/application/javascript/JavaScriptSemanticGraphFingerprintProjection.js +25 -0
  245. package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +183 -0
  246. package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +112 -0
  247. package/dist/application/javascript/JavaScriptSemanticGraphProjection.js +144 -0
  248. package/dist/application/javascript/JavaScriptSemanticGraphResourceProjection.js +58 -0
  249. package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +136 -0
  250. package/dist/application/javascript/JavaScriptSemanticTraceService.js +41 -0
  251. package/dist/application/jeb/JebAnalysisPort.js +1 -0
  252. package/dist/application/jeb/JebAnalysisService.js +13 -0
  253. package/dist/application/managed/ManagedApplicationGraphService.js +55 -0
  254. package/dist/application/managed/ManagedMemberComparisonService.js +125 -0
  255. package/dist/application/managed/ManagedNativeVerificationService.js +40 -0
  256. package/dist/application/managed/ManagedReconstructionService.js +59 -0
  257. package/dist/application/native/NativeApiInspection.js +77 -0
  258. package/dist/application/native/NativeCallRoutes.js +73 -0
  259. package/dist/application/native/NativeDispatchMetadataInspection.js +33 -0
  260. package/dist/application/native/NativeUiActionTrace.js +427 -0
  261. package/dist/application/native/NativeValueTrace.js +340 -0
  262. package/dist/application/process/ProcessCli.js +190 -0
  263. package/dist/application/process/ProcessEvidence.js +30 -0
  264. package/dist/application/wasm/WasmArtifactPort.js +1 -0
  265. package/dist/application/wasm/WasmArtifactService.js +72 -0
  266. package/dist/application/workflowInputError.js +18 -0
  267. package/dist/artifacts/ArtifactHash.js +29 -0
  268. package/dist/artifacts/ArtifactPaths.js +167 -0
  269. package/dist/artifacts/ArtifactProvider.js +280 -0
  270. package/dist/artifacts/ArtifactProviderMetadata.js +34 -0
  271. package/dist/artifacts/ArtifactReader.js +77 -0
  272. package/dist/artifacts/ArtifactResourceScope.js +103 -0
  273. package/dist/artifacts/AsarArtifactReader.js +518 -0
  274. package/dist/artifacts/AsarEntryStream.js +76 -0
  275. package/dist/artifacts/AsarHeader.js +24 -0
  276. package/dist/artifacts/DirectoryArtifactReader.js +292 -0
  277. package/dist/artifacts/MachOSliceArtifactReader.js +342 -0
  278. package/dist/artifacts/NativeDmgArtifactReader.js +508 -0
  279. package/dist/artifacts/NativeDmgOwnership.js +109 -0
  280. package/dist/artifacts/SafeOutputTree.js +394 -0
  281. package/dist/artifacts/SafeOutputTreeCleanup.js +45 -0
  282. package/dist/artifacts/SafeOutputTreeCreationFailure.js +20 -0
  283. package/dist/artifacts/SafeOutputTreeIdentity.js +42 -0
  284. package/dist/artifacts/SafeOutputTreeReadback.js +33 -0
  285. package/dist/artifacts/StreamBytes.js +10 -0
  286. package/dist/artifacts/ZipArtifactReader.js +222 -0
  287. package/dist/artifacts/apple/AppleAssetCatalogAnalysis.js +190 -0
  288. package/dist/artifacts/apple/DylibResolutionReader.js +269 -0
  289. package/dist/artifacts/apple/InterfaceBuilderAnalysis.js +500 -0
  290. package/dist/artifacts/apple/InterfaceBuilderDecodeBudget.js +233 -0
  291. package/dist/artifacts/apple/KeyedArchiveReader.js +163 -0
  292. package/dist/artifacts/apple/MachoLoadCommandReader.js +393 -0
  293. package/dist/artifacts/apple/NibArchive.js +338 -0
  294. package/dist/artifacts/apple/NibViewHierarchy.js +157 -0
  295. package/dist/artifacts/apple/PlistNumberLiterals.js +164 -0
  296. package/dist/artifacts/extraction/ArtifactExtraction.js +253 -0
  297. package/dist/artifacts/hostExecutableMarking.js +16 -0
  298. package/dist/artifacts/inventory/ArtifactGraphConstruction.js +343 -0
  299. package/dist/artifacts/inventory/ArtifactInventory.js +16 -0
  300. package/dist/artifacts/inventory/classify.js +94 -0
  301. package/dist/artifacts/inventory/hashStableRootArtifact.js +70 -0
  302. package/dist/artifacts/inventory/reader.js +40 -0
  303. package/dist/artifacts/inventory/scanCanonical.js +213 -0
  304. package/dist/artifacts/inventory/scanReader.js +169 -0
  305. package/dist/artifacts/inventory/types.js +3 -0
  306. package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +317 -0
  307. package/dist/artifacts/javascript/JavaScriptArtifactReader.js +6 -0
  308. package/dist/artifacts/javascript/JavaScriptSourceAnalysis.js +3 -0
  309. package/dist/artifacts/readStableArtifact.js +68 -0
  310. package/dist/browser/BrowserProcessStartup.js +89 -0
  311. package/dist/browser/BrowserScenarioPartialObservation.js +127 -0
  312. package/dist/browser/BrowserScenarioSecrets.js +137 -0
  313. package/dist/browser/BrowserScenarioSessionPort.js +1 -0
  314. package/dist/browser/CdpAuthorizedMainFrame.js +16 -0
  315. package/dist/browser/CdpAuthorizedTarget.js +22 -0
  316. package/dist/browser/CdpBrowserProvider.js +276 -0
  317. package/dist/browser/CdpCaptureCompleteness.js +92 -0
  318. package/dist/browser/CdpCaptureDocuments.js +375 -0
  319. package/dist/browser/CdpCaptureDomSvg.js +210 -0
  320. package/dist/browser/CdpCaptureEventBodyShapes.js +55 -0
  321. package/dist/browser/CdpCaptureEventHandlers.js +463 -0
  322. package/dist/browser/CdpCaptureEventHelpers.js +84 -0
  323. package/dist/browser/CdpCaptureEventState.js +1 -0
  324. package/dist/browser/CdpCaptureEventTypes.js +5 -0
  325. package/dist/browser/CdpCaptureEvents.js +199 -0
  326. package/dist/browser/CdpCaptureStorage.js +86 -0
  327. package/dist/browser/CdpCaptureStorageFingerprints.js +320 -0
  328. package/dist/browser/CdpCaptureValues.js +91 -0
  329. package/dist/browser/CdpCommandRejection.js +17 -0
  330. package/dist/browser/CdpConnection.js +303 -0
  331. package/dist/browser/CdpElectronInspection.js +253 -0
  332. package/dist/browser/CdpElectronProvider.js +115 -0
  333. package/dist/browser/CdpElectronScriptEvents.js +55 -0
  334. package/dist/browser/CdpElectronScripts.js +65 -0
  335. package/dist/browser/CdpElectronWorkers.js +57 -0
  336. package/dist/browser/CdpEndpoint.js +217 -0
  337. package/dist/browser/CdpObservationSession.js +332 -0
  338. package/dist/browser/CdpOptionalCommand.js +14 -0
  339. package/dist/browser/CdpPageCapture.js +278 -0
  340. package/dist/browser/CdpPageCaptureScripts.js +79 -0
  341. package/dist/browser/CdpPageCaptureWorkers.js +46 -0
  342. package/dist/browser/CdpSafeMetadata.js +284 -0
  343. package/dist/browser/CdpScreenshot.js +110 -0
  344. package/dist/browser/CdpTargetEvents.js +8 -0
  345. package/dist/browser/CdpTargetSession.js +65 -0
  346. package/dist/browser/CdpWebMcpDiscovery.js +361 -0
  347. package/dist/browser/ElectronFileScope.js +135 -0
  348. package/dist/browser/PlaywrightBrowserScenarioProvider.js +301 -0
  349. package/dist/browser/PlaywrightElectronActiveActions.js +257 -0
  350. package/dist/browser/PlaywrightElectronActiveProjection.js +141 -0
  351. package/dist/browser/PlaywrightElectronActiveProvider.js +293 -0
  352. package/dist/browser/PlaywrightExecutionBoundary.js +53 -0
  353. package/dist/browser/PlaywrightScenarioActions.js +58 -0
  354. package/dist/browser/PlaywrightScenarioArtifacts.js +162 -0
  355. package/dist/browser/PlaywrightScenarioBrowser.js +412 -0
  356. package/dist/browser/PlaywrightScenarioEvents.js +253 -0
  357. package/dist/browser/PlaywrightScenarioSession.js +279 -0
  358. package/dist/browser/PlaywrightScenarioStorage.js +507 -0
  359. package/dist/browser/PngVisualDiff.js +380 -0
  360. package/dist/browser/WebSourceMapFetcher.js +718 -0
  361. package/dist/browser/assets/LocalWebScriptArtifacts.js +89 -0
  362. package/dist/browser/assets/PageScriptCapture.js +32 -0
  363. package/dist/browser/assets/PublishWebScripts.js +140 -0
  364. package/dist/browser/assets/ScenarioScriptCapture.js +73 -0
  365. package/dist/browser/assets/ScriptCaptureAdapters.js +57 -0
  366. package/dist/browser/assets/WebArtifactReads.js +78 -0
  367. package/dist/browser/assets/WebSourceLocationArtifacts.js +41 -0
  368. package/dist/browser/execution/CdpEventListeners.js +79 -0
  369. package/dist/browser/execution/CdpExecutionCapture.js +135 -0
  370. package/dist/browser/execution/CdpExecutionCollection.js +57 -0
  371. package/dist/browser/execution/CdpExecutionWindow.js +100 -0
  372. package/dist/browser/execution/CdpListenerSelector.js +22 -0
  373. package/dist/browser/execution/CdpPreciseCoverage.js +45 -0
  374. package/dist/browser/execution/CdpRuntimeInitiator.js +18 -0
  375. package/dist/browser/execution/CdpRuntimeProtocol.js +106 -0
  376. package/dist/browser/execution/CdpRuntimeRequests.js +81 -0
  377. package/dist/browser/execution/CdpRuntimeSession.js +163 -0
  378. package/dist/browser/execution/CdpRuntimeSources.js +223 -0
  379. package/dist/browser/execution/CdpWebRuntimeProvider.js +51 -0
  380. package/dist/browser/history/CaptureFailures.js +153 -0
  381. package/dist/browser/history/CaptureFormatError.js +10 -0
  382. package/dist/browser/history/CaptureRedaction.js +68 -0
  383. package/dist/browser/history/CaptureRelease.js +23 -0
  384. package/dist/browser/history/HarCapture.js +179 -0
  385. package/dist/browser/history/HarCaptureAdapter.js +23 -0
  386. package/dist/browser/history/HarCaptureProcess.js +49 -0
  387. package/dist/browser/history/HarJson.js +92 -0
  388. package/dist/browser/history/HarSchema.js +72 -0
  389. package/dist/browser/history/HistoricalCaptureDecoder.js +198 -0
  390. package/dist/browser/history/HistoricalCaptureFormatAdapter.js +1 -0
  391. package/dist/browser/history/MitmproxyCaptureAdapter.js +46 -0
  392. package/dist/browser/modules/NativeModuleResolver.js +277 -0
  393. package/dist/browser/modules/WebModuleArtifacts.js +41 -0
  394. package/dist/browser/network/PlaywrightNetworkContent.js +71 -0
  395. package/dist/browser/network/PlaywrightScenarioNetwork.js +180 -0
  396. package/dist/browser/providerIdentities.js +24 -0
  397. package/dist/catalogIdentity.js +65 -0
  398. package/dist/cli/adbCommands.js +337 -0
  399. package/dist/cli/analysisSelector.js +23 -0
  400. package/dist/cli/analysisViewCommands.js +74 -0
  401. package/dist/cli/androidCommands.js +91 -0
  402. package/dist/cli/apktoolCommands.js +53 -0
  403. package/dist/cli/applicationCommands.js +173 -0
  404. package/dist/cli/artifactCommands.js +160 -0
  405. package/dist/cli/binaryDiagnosticsCommands.js +57 -0
  406. package/dist/cli/browserAdvancedCommands.js +189 -0
  407. package/dist/cli/browserCommands.js +125 -0
  408. package/dist/cli/commandCancellation.js +24 -0
  409. package/dist/cli/coreAnalysisCommands.js +7 -0
  410. package/dist/cli/coreBinaryCommands.js +283 -0
  411. package/dist/cli/coreNativeCommands.js +269 -0
  412. package/dist/cli/electronCommands.js +150 -0
  413. package/dist/cli/evmCommands.js +33 -0
  414. package/dist/cli/firmwareCommands.js +61 -0
  415. package/dist/cli/goCommands.js +21 -0
  416. package/dist/cli/interactiveSetup.js +236 -0
  417. package/dist/cli/javascriptApplicationAnalysis.js +34 -0
  418. package/dist/cli/javascriptRecoveryCommands.js +59 -0
  419. package/dist/cli/jebCommands.js +99 -0
  420. package/dist/cli/jsonOutput.js +46 -0
  421. package/dist/cli/managedCommands.js +129 -0
  422. package/dist/cli/managedProjectGraphCommand.js +24 -0
  423. package/dist/cli/nativeCallCommands.js +33 -0
  424. package/dist/cli/omittableDefaults.js +50 -0
  425. package/dist/cli/options.js +33 -0
  426. package/dist/cli/processCommands.js +25 -0
  427. package/dist/cli/referenceSourceImportStatus.js +22 -0
  428. package/dist/cli/setupCommands.js +189 -0
  429. package/dist/cli/streamedJsonOutput.js +134 -0
  430. package/dist/cli/types.js +1 -0
  431. package/dist/cli/utilityCommands.js +226 -0
  432. package/dist/cli/wasmCommands.js +44 -0
  433. package/dist/cli/webModuleCommands.js +60 -0
  434. package/dist/cli/webNetworkCaptureCommands.js +40 -0
  435. package/dist/cli/webRuntimeCommands.js +60 -0
  436. package/dist/cli/webScriptCommands.js +50 -0
  437. package/dist/cli/webSourceLocationCommands.js +54 -0
  438. package/dist/cli-runtime/AnalysisProvider-CeyX2u-b.js +25 -0
  439. package/dist/cli-runtime/AnalysisSnapshotFiles-BuK_ymw5.js +523 -0
  440. package/dist/cli-runtime/ArtifactReader-BXkffc1D.js +55 -0
  441. package/dist/cli-runtime/ArtifactResourceScope-CZqLEfbb.js +108 -0
  442. package/dist/cli-runtime/AsarHeader-CnzOzYEH.js +31 -0
  443. package/dist/cli-runtime/BinaryTargetResolver-CKRfFhLj.js +965 -0
  444. package/dist/cli-runtime/BoundedFileBytes-BU30odTm.js +39 -0
  445. package/dist/cli-runtime/ClientConfigPath-c6jr6INc.js +36 -0
  446. package/dist/cli-runtime/ClientConfigurationDocument-D0ZqgTCv.js +1522 -0
  447. package/dist/cli-runtime/ClientRegistrationStatus-DGpwJ4ry.js +422 -0
  448. package/dist/cli-runtime/DirectAnalysis-DW3MvxW0.js +500 -0
  449. package/dist/cli-runtime/Doctor-CzwYS9nB.js +862 -0
  450. package/dist/cli-runtime/ElectronFileScope-C1hUEp36.js +1419 -0
  451. package/dist/cli-runtime/ExecFileOutput-Czbj-HpV.js +106 -0
  452. package/dist/cli-runtime/IdaConfiguration-rEjpuRQ1.js +854 -0
  453. package/dist/cli-runtime/InterfaceBuilderDecodeBudget-DT74BY9z.js +225 -0
  454. package/dist/cli-runtime/InventoryProjectionEvidence-Dt4Og45O.js +49 -0
  455. package/dist/cli-runtime/InvestigationProviders-D-QCy-4c.js +117 -0
  456. package/dist/cli-runtime/JavaScriptApplicationEvidenceGraph-CODAjVru.js +160 -0
  457. package/dist/cli-runtime/JavaScriptApplicationWorkflowEvidence-CCtwSg8r.js +75 -0
  458. package/dist/cli-runtime/JavaScriptWorkerMemoryLimit-CJeBSMPx.js +83 -0
  459. package/dist/cli-runtime/JsonFiles-Ce_O5NcH.js +708 -0
  460. package/dist/cli-runtime/ManagedSnapshot-DthWfmy9.js +3622 -0
  461. package/dist/cli-runtime/OwnedCommand-CnK8-h3N.js +106 -0
  462. package/dist/cli-runtime/PrivateRuntimeRoot-KNg6qLwo.js +237 -0
  463. package/dist/cli-runtime/ProcessOwnership-AOJaszxt.js +1310 -0
  464. package/dist/cli-runtime/ProviderDeadline-BSbNOmuW.js +89 -0
  465. package/dist/cli-runtime/RegularFile-CL6meBxi.js +114 -0
  466. package/dist/cli-runtime/RegularFileRead-BMh5FMXd.js +115 -0
  467. package/dist/cli-runtime/SafeOutputTree-D8z2Zrnu.js +512 -0
  468. package/dist/cli-runtime/SetupHost-CzzRF89z.js +842 -0
  469. package/dist/cli-runtime/SupportedClients-BrZ2qZVg.js +671 -0
  470. package/dist/cli-runtime/UninstallFailure-1blyKXHE.js +22 -0
  471. package/dist/cli-runtime/Update-DF55X_N2.js +143 -0
  472. package/dist/cli-runtime/UpdateFailure-BcFNxEZZ.js +24 -0
  473. package/dist/cli-runtime/WindowsBatchCommand-5gT-d7O4.js +45 -0
  474. package/dist/cli-runtime/ZipArtifactReader-Db65WuM_.js +380 -0
  475. package/dist/cli-runtime/analysisErrorCleanup-DaUQNiQd.js +32 -0
  476. package/dist/cli-runtime/analysisErrorPresentation-DZrKL8kS.js +331 -0
  477. package/dist/cli-runtime/application__DirectAnalysisStatus-OZFIFjZr.js +93 -0
  478. package/dist/cli-runtime/application__EnhancedTools-C__HAdqG.js +1728 -0
  479. package/dist/cli-runtime/application__FunctionAnalysisEvidence-fWSgvV74.js +41 -0
  480. package/dist/cli-runtime/application__ReconstructionCoverageService-DlNt-4TY.js +32 -0
  481. package/dist/cli-runtime/application__ReconstructionObligationLedgerService-CEpbUv-7.js +813 -0
  482. package/dist/cli-runtime/application__Setup-BExVGpqG.js +540 -0
  483. package/dist/cli-runtime/application__Uninstall-BVgWDCPN.js +349 -0
  484. package/dist/cli-runtime/application__UpdateRuntime-Dj6UIhHQ.js +358 -0
  485. package/dist/cli-runtime/application__android__AndroidApplicationService-CyynwW6Z.js +31 -0
  486. package/dist/cli-runtime/application__apple__AppleApplicationService-BNPcWeL8.js +31 -0
  487. package/dist/cli-runtime/application__harmony__HarmonyApplicationService-W66PwMvx.js +31 -0
  488. package/dist/cli-runtime/application__javascript__ElectronActiveObservationService-D8VbeCxz.js +85 -0
  489. package/dist/cli-runtime/application__javascript__ElectronObservationService-FmXFG4f2.js +63 -0
  490. package/dist/cli-runtime/application__javascript__JavaScriptApplicationService-D-dVrmAY.js +10467 -0
  491. package/dist/cli-runtime/application__javascript__JavaScriptApplicationWorkflowService-Cb0jmh8J.js +2284 -0
  492. package/dist/cli-runtime/application__javascript__JavaScriptRuntimeReconciliationService-D55gO7Gq.js +88 -0
  493. package/dist/cli-runtime/application__javascript__JavaScriptSemanticTraceService-DivM-Ym-.js +298 -0
  494. package/dist/cli-runtime/artifactOperationError-Wd0PRLIZ.js +27 -0
  495. package/dist/cli-runtime/artifacts__ArtifactProvider-B_4h3RAw.js +2091 -0
  496. package/dist/cli-runtime/binary-9Gt3vJ1P.js +12990 -0
  497. package/dist/cli-runtime/browserObservationError-D73SM55P.js +40 -0
  498. package/dist/cli-runtime/browserScenario-CTNr5ISp.js +5543 -0
  499. package/dist/cli-runtime/catalogIdentity-EYVhBUYJ.js +339 -0
  500. package/dist/cli-runtime/cli.js +28528 -0
  501. package/dist/cli-runtime/cliOutput-CoDmWVu5.js +98 -0
  502. package/dist/cli-runtime/cliOutput.js +5 -0
  503. package/dist/cli-runtime/composition__browserScenario-DNr3A_BM.js +2318 -0
  504. package/dist/cli-runtime/composition__electronObservation-DNw1f38M.js +550 -0
  505. package/dist/cli-runtime/composition__electronScenario-Cu7PX270.js +586 -0
  506. package/dist/cli-runtime/configurationErrors-ByuF6gMR.js +49 -0
  507. package/dist/cli-runtime/doctorRuntime-D5y43lEp.js +162 -0
  508. package/dist/cli-runtime/dosMz-pwwUuxyC.js +65 -0
  509. package/dist/cli-runtime/dotnet__ManagedStaticProvider-BSnWggeb.js +5 -0
  510. package/dist/cli-runtime/enhancedInputs-K8C_o3b4.js +56 -0
  511. package/dist/cli-runtime/javascriptApplicationGraph-DUWeec4O.js +940 -0
  512. package/dist/cli-runtime/javascriptExportReturnShapeProjection-BVbnAdOd.js +78 -0
  513. package/dist/cli-runtime/javascriptExportShapeComparisonSchemas-BzSil7ft.js +1153 -0
  514. package/dist/cli-runtime/javascriptRuntimeObservation-9xTNoKY2.js +1215 -0
  515. package/dist/cli-runtime/javascriptRuntimeReconciliation-CneBtMvx.js +1437 -0
  516. package/dist/cli-runtime/javascriptRuntimeReconciliationSchemas-D1Mrb_Y0.js +245 -0
  517. package/dist/cli-runtime/javascriptSemanticTraceSchemas-BHItrqIA.js +126 -0
  518. package/dist/cli-runtime/lipo-BCA3wVyN.js +365 -0
  519. package/dist/cli-runtime/logger-CKq3JfbZ.js +34 -0
  520. package/dist/cli-runtime/machoContainer-DxxkB2b0.js +52 -0
  521. package/dist/cli-runtime/managedApplicationGraph-BqOr01E6.js +1116 -0
  522. package/dist/cli-runtime/managedToolContracts-BSy4TRaK.js +80 -0
  523. package/dist/cli-runtime/mcpDoctor.js +342 -0
  524. package/dist/cli-runtime/mcpStartupPolicy-Bb7TMLzn.js +18 -0
  525. package/dist/cli-runtime/native__NativeMacOSProvider-BIG9iCcj.js +4415 -0
  526. package/dist/cli-runtime/plistValue-KM-SqiXe.js +47 -0
  527. package/dist/cli-runtime/propertyListKeys-DejfMb-U.js +86 -0
  528. package/dist/cli-runtime/providerAdapterError-SRSE_gzN.js +27 -0
  529. package/dist/cli-runtime/providerCleanupError-Do66qCEp.js +27 -0
  530. package/dist/cli-runtime/providerIdentities-Ao1XTvwx.js +31 -0
  531. package/dist/cli-runtime/providerOperationHealth-DSTcYPJe.js +577 -0
  532. package/dist/cli-runtime/providerStartupTimeout-Be8B1Ro8.js +16 -0
  533. package/dist/cli-runtime/readFileHandleChunks-dp60iZ6v.js +38 -0
  534. package/dist/cli-runtime/reconstructionObligationLedgerSchemas-dvp6PEnZ.js +15839 -0
  535. package/dist/cli-runtime/rolldown-runtime-DXoylpqc.js +121 -0
  536. package/dist/cli-runtime/runtimeVersion-CMGd0bDu.js +23 -0
  537. package/dist/cli-runtime/safeJson-DKKACtdy.js +25 -0
  538. package/dist/cli-runtime/scanCanonical-Bi6si9nb.js +2773 -0
  539. package/dist/cli-runtime/snapshotEnvironment-B5Ai0mha.js +678 -0
  540. package/dist/cli-runtime/streamedJsonOutput-VYlQZsM7.js +654 -0
  541. package/dist/cli-runtime/streamedJsonOutput.js +5 -0
  542. package/dist/cli-runtime/toolContracts-C7pvYKxF.js +4516 -0
  543. package/dist/cli-runtime/toolEffects-DW31yTSx.js +7004 -0
  544. package/dist/cli-runtime/workflowInputError-26EGiDpx.js +26 -0
  545. package/dist/cli.js +91 -0
  546. package/dist/cliBrowserContext.js +11 -0
  547. package/dist/cliBrowserScenarioCommands.js +73 -0
  548. package/dist/cliCommandNames.js +205 -0
  549. package/dist/cliEvidenceCommands.js +51 -0
  550. package/dist/cliJavaScriptRuntimeCommands.js +69 -0
  551. package/dist/cliJsonInput.js +129 -0
  552. package/dist/cliLogging.js +48 -0
  553. package/dist/cliObservationOptions.js +73 -0
  554. package/dist/cliOutput.js +97 -0
  555. package/dist/composition/adb.js +3 -0
  556. package/dist/composition/android.js +3 -0
  557. package/dist/composition/apktool.js +3 -0
  558. package/dist/composition/auxiliaryAnalysisProviders.js +35 -0
  559. package/dist/composition/binary.js +25 -0
  560. package/dist/composition/binaryDiagnostics.js +12 -0
  561. package/dist/composition/browserObservation.js +3 -0
  562. package/dist/composition/browserScenario.js +4 -0
  563. package/dist/composition/directAnalysis.js +44 -0
  564. package/dist/composition/electronObservation.js +3 -0
  565. package/dist/composition/electronScenario.js +3 -0
  566. package/dist/composition/evm.js +4 -0
  567. package/dist/composition/firmware.js +3 -0
  568. package/dist/composition/go.js +4 -0
  569. package/dist/composition/javascriptAnalysisWorkerProcess.js +48 -0
  570. package/dist/composition/javascriptRecovery.js +3 -0
  571. package/dist/composition/javascriptRuntimeObservation.js +3 -0
  572. package/dist/composition/jeb.js +6 -0
  573. package/dist/composition/optionalObservationProviders.js +54 -0
  574. package/dist/composition/wasm.js +4 -0
  575. package/dist/composition/webModules.js +5 -0
  576. package/dist/composition/webNetworkCaptures.js +6 -0
  577. package/dist/composition/webRuntime.js +4 -0
  578. package/dist/composition/webSourceLocations.js +5 -0
  579. package/dist/config/environment.js +73 -0
  580. package/dist/config/ghidraDisabledAnalyzers.js +25 -0
  581. package/dist/config/ghidraLanguageOverride.js +9 -0
  582. package/dist/config/homeDirectory.js +12 -0
  583. package/dist/config/mcpInputSchemaProfile.js +27 -0
  584. package/dist/config/mcpResponseBudget.js +30 -0
  585. package/dist/config/parseConfig.js +93 -0
  586. package/dist/config/parsers.js +30 -0
  587. package/dist/config/providerStartupTimeout.js +13 -0
  588. package/dist/config/types.js +1 -0
  589. package/dist/contracts/adb/adbToolContracts.js +353 -0
  590. package/dist/contracts/advertisedInputExamples.js +48 -0
  591. package/dist/contracts/analysisDetail.js +13 -0
  592. package/dist/contracts/analysisSearchContract.js +14 -0
  593. package/dist/contracts/analysisViewApiSurfaceExample.js +68 -0
  594. package/dist/contracts/analysisViewToolContracts.js +76 -0
  595. package/dist/contracts/android/androidToolContracts.js +77 -0
  596. package/dist/contracts/apktool/apktoolToolContracts.js +33 -0
  597. package/dist/contracts/applicationToolContracts.js +261 -0
  598. package/dist/contracts/artifactComparisonExample.js +86 -0
  599. package/dist/contracts/artifactToolContracts.js +68 -0
  600. package/dist/contracts/browserProviderToolContracts.js +7 -0
  601. package/dist/contracts/browserScenarioToolContracts.js +32 -0
  602. package/dist/contracts/browserToolContracts.js +256 -0
  603. package/dist/contracts/compactInputSchema.js +256 -0
  604. package/dist/contracts/enhancedInputs.js +74 -0
  605. package/dist/contracts/enhancedToolContracts.js +32 -0
  606. package/dist/contracts/errorSchemas.js +87 -0
  607. package/dist/contracts/evidenceInputContracts.js +13 -0
  608. package/dist/contracts/evm/evmToolContracts.js +20 -0
  609. package/dist/contracts/firmware/firmwareToolContracts.js +38 -0
  610. package/dist/contracts/functionComparisonExample.js +51 -0
  611. package/dist/contracts/functionInstructionContract.js +6 -0
  612. package/dist/contracts/functionWorkflowToolContracts.js +29 -0
  613. package/dist/contracts/go/goToolContracts.js +20 -0
  614. package/dist/contracts/hopperMemoryContracts.js +19 -0
  615. package/dist/contracts/inputSchemaPresentation.js +181 -0
  616. package/dist/contracts/investigationExamples.js +116 -0
  617. package/dist/contracts/javascript/applicationWorkflowInputContracts.js +52 -0
  618. package/dist/contracts/javascript/electronToolContracts.js +118 -0
  619. package/dist/contracts/javascript/javascriptApplicationWorkflowExamples.js +85 -0
  620. package/dist/contracts/javascript/javascriptExportShapeComparisonExample.js +248 -0
  621. package/dist/contracts/javascript/javascriptRecoveryToolContracts.js +35 -0
  622. package/dist/contracts/javascript/javascriptRuntimeObservationToolContracts.js +40 -0
  623. package/dist/contracts/javascript/javascriptRuntimeReconciliationExample.js +242 -0
  624. package/dist/contracts/jeb/jebToolContracts.js +64 -0
  625. package/dist/contracts/managed/managedToolContracts.js +87 -0
  626. package/dist/contracts/managed/managedWorkflowExamples.js +281 -0
  627. package/dist/contracts/managed/managedWorkflowToolContracts.js +165 -0
  628. package/dist/contracts/mobileApplicationGraphExamples.js +117 -0
  629. package/dist/contracts/native/binaryDiagnosticsToolContracts.js +65 -0
  630. package/dist/contracts/native/nativeToolContracts.js +77 -0
  631. package/dist/contracts/officialToolContracts.js +69 -0
  632. package/dist/contracts/promptContracts.js +253 -0
  633. package/dist/contracts/providerSelection.js +29 -0
  634. package/dist/contracts/reconstructionReadinessExample.js +438 -0
  635. package/dist/contracts/sessionLifecycleInputs.js +63 -0
  636. package/dist/contracts/sessionStatusContract.js +17 -0
  637. package/dist/contracts/sessionToolContracts.js +61 -0
  638. package/dist/contracts/sessionToolSchemas.js +51 -0
  639. package/dist/contracts/toolContractExamples.js +77 -0
  640. package/dist/contracts/toolContractHelpers.js +22 -0
  641. package/dist/contracts/toolContractTypes.js +18 -0
  642. package/dist/contracts/toolContracts.js +60 -0
  643. package/dist/contracts/toolEffects.js +544 -0
  644. package/dist/contracts/toolOutputSchemaGroups.js +411 -0
  645. package/dist/contracts/toolOutputSchemaPrimitives.js +532 -0
  646. package/dist/contracts/toolSchemaMetadata.js +197 -0
  647. package/dist/contracts/unknownContractExamples.js +31 -0
  648. package/dist/contracts/wasm/wasmToolContracts.js +24 -0
  649. package/dist/contracts/webNetworkCaptureToolContracts.js +24 -0
  650. package/dist/contracts/webRuntimeToolContracts.js +43 -0
  651. package/dist/contracts/webScriptToolContracts.js +68 -0
  652. package/dist/doctorRuntime.js +53 -0
  653. package/dist/domain/adb/adbDeviceAnalysis.js +583 -0
  654. package/dist/domain/analysisErrorBase.js +58 -0
  655. package/dist/domain/analysisErrorCleanup.js +29 -0
  656. package/dist/domain/analysisErrorCore.js +123 -0
  657. package/dist/domain/analysisErrorPresentation.js +372 -0
  658. package/dist/domain/analysisErrorProjection.js +454 -0
  659. package/dist/domain/analysisProfile.js +50 -0
  660. package/dist/domain/analysisSnapshot.js +538 -0
  661. package/dist/domain/analysisView/WebNetworkApiSurfaceAccumulator.js +362 -0
  662. package/dist/domain/analysisView/analysisView.js +340 -0
  663. package/dist/domain/analysisView/analysisViewCoverage.js +19 -0
  664. package/dist/domain/analysisView/binaryLayoutView.js +161 -0
  665. package/dist/domain/analysisView/javascriptApplicationView.js +245 -0
  666. package/dist/domain/analysisView/nativeFunctionView.js +155 -0
  667. package/dist/domain/analysisView/webNetworkApiSurfaceView.js +108 -0
  668. package/dist/domain/android/androidAnalysis.js +143 -0
  669. package/dist/domain/android/androidApplication.js +144 -0
  670. package/dist/domain/android/androidPartialObservation.js +36 -0
  671. package/dist/domain/apktool/apktoolResourceAnalysis.js +75 -0
  672. package/dist/domain/apple/appleApplication.js +315 -0
  673. package/dist/domain/apple/appleAssetCatalog.js +127 -0
  674. package/dist/domain/apple/appleBundleAnatomy.js +303 -0
  675. package/dist/domain/apple/dyldEnvironment.js +73 -0
  676. package/dist/domain/apple/dyldPaths.js +89 -0
  677. package/dist/domain/apple/dylibResolution.js +485 -0
  678. package/dist/domain/apple/dylibResolutionFindings.js +77 -0
  679. package/dist/domain/apple/interfaceBuilderGraph.js +403 -0
  680. package/dist/domain/apple/interfaceBuilderKeyedArchive.js +430 -0
  681. package/dist/domain/apple/keyedArchive.js +214 -0
  682. package/dist/domain/apple/machoContainer.js +54 -0
  683. package/dist/domain/apple/plistNumbers.js +76 -0
  684. package/dist/domain/apple/plistValue.js +35 -0
  685. package/dist/domain/artifactComparison.js +348 -0
  686. package/dist/domain/artifactGraph.js +213 -0
  687. package/dist/domain/artifactIdentity.js +57 -0
  688. package/dist/domain/artifactInspection.js +279 -0
  689. package/dist/domain/artifactIntegrityPolicy.js +10 -0
  690. package/dist/domain/artifactInventoryEvidence.js +166 -0
  691. package/dist/domain/artifactInventorySnapshot.js +1 -0
  692. package/dist/domain/artifactOperationError.js +20 -0
  693. package/dist/domain/artifactPartialObservation.js +1 -0
  694. package/dist/domain/artifactPathSyntax.js +75 -0
  695. package/dist/domain/binaryTarget.js +233 -0
  696. package/dist/domain/binaryTargetTypes.js +10 -0
  697. package/dist/domain/bridgeCandidateProjection.js +71 -0
  698. package/dist/domain/browserCaptureComparison.js +21 -0
  699. package/dist/domain/browserCompleteness.js +103 -0
  700. package/dist/domain/browserNetworkEvidence.js +92 -0
  701. package/dist/domain/browserObservation.js +187 -0
  702. package/dist/domain/browserObservationError.js +44 -0
  703. package/dist/domain/browserObservationErrors.js +1 -0
  704. package/dist/domain/browserObservationSchemas.js +327 -0
  705. package/dist/domain/browserScenario.js +61 -0
  706. package/dist/domain/browserScenarioCapture.js +76 -0
  707. package/dist/domain/browserScenarioCaptureValues.js +292 -0
  708. package/dist/domain/browserScenarioDiff.js +266 -0
  709. package/dist/domain/browserScenarioDiffEvidence.js +73 -0
  710. package/dist/domain/browserScenarioDiffValues.js +140 -0
  711. package/dist/domain/browserScenarioNormalization.js +40 -0
  712. package/dist/domain/browserScenarioValues.js +268 -0
  713. package/dist/domain/browserSession.js +55 -0
  714. package/dist/domain/bundleComparison.js +243 -0
  715. package/dist/domain/callPath.js +301 -0
  716. package/dist/domain/callPathSchemas.js +89 -0
  717. package/dist/domain/canonicalDigest.js +83 -0
  718. package/dist/domain/canonicalJsonDigestSteps.js +155 -0
  719. package/dist/domain/canonicalOrdering.js +3 -0
  720. package/dist/domain/changedBehavior.js +282 -0
  721. package/dist/domain/compactStringIdentity.js +9 -0
  722. package/dist/domain/comparisonSemantics.js +12 -0
  723. package/dist/domain/comparisonSourceEvidence.js +40 -0
  724. package/dist/domain/comparisonStatus.js +11 -0
  725. package/dist/domain/completionLedgerGeneration.js +186 -0
  726. package/dist/domain/configurationErrors.js +37 -0
  727. package/dist/domain/conformancePackage.js +200 -0
  728. package/dist/domain/conformanceReplay.js +132 -0
  729. package/dist/domain/conformanceTrustGate.js +319 -0
  730. package/dist/domain/digests.js +27 -0
  731. package/dist/domain/dosCom.js +8 -0
  732. package/dist/domain/dosMz.js +83 -0
  733. package/dist/domain/emptyArraySchema.js +3 -0
  734. package/dist/domain/evidence.js +305 -0
  735. package/dist/domain/evidenceBundle.js +413 -0
  736. package/dist/domain/evidenceCompletionLedger.js +113 -0
  737. package/dist/domain/evidenceErrors.js +46 -0
  738. package/dist/domain/evidenceRecordSummary.js +144 -0
  739. package/dist/domain/evm/evmInterface.js +61 -0
  740. package/dist/domain/explicitSensitiveFailure.js +108 -0
  741. package/dist/domain/explicitSensitiveValues.js +10 -0
  742. package/dist/domain/firmware/firmwareAnalysis.js +128 -0
  743. package/dist/domain/functionComparison.js +38 -0
  744. package/dist/domain/functionComparisonDimensions.js +199 -0
  745. package/dist/domain/functionComparisonNormalization.js +150 -0
  746. package/dist/domain/functionComparisonResults.js +54 -0
  747. package/dist/domain/functionComparisonSchemas.js +88 -0
  748. package/dist/domain/functionDossierEvidence.js +20 -0
  749. package/dist/domain/go/goBinary.js +96 -0
  750. package/dist/domain/harmony/harmonyApplication.js +169 -0
  751. package/dist/domain/hopperErrors.js +98 -0
  752. package/dist/domain/hopperStartupFailure.js +64 -0
  753. package/dist/domain/hopperValues.js +368 -0
  754. package/dist/domain/immutableJson.js +114 -0
  755. package/dist/domain/inputIssueProjection.js +94 -0
  756. package/dist/domain/javascript/electronActiveObservation.js +237 -0
  757. package/dist/domain/javascript/electronObservation.js +122 -0
  758. package/dist/domain/javascript/electronStaticAnalysis.js +9 -0
  759. package/dist/domain/javascript/electronStaticAnalysisBrowser.js +187 -0
  760. package/dist/domain/javascript/electronStaticAnalysisIpc.js +197 -0
  761. package/dist/domain/javascript/electronStaticAnalysisNative.js +199 -0
  762. package/dist/domain/javascript/electronStaticAnalysisTypes.js +1 -0
  763. package/dist/domain/javascript/electronStaticAnalysisValues.js +134 -0
  764. package/dist/domain/javascript/electronWrappedCallPaths.js +399 -0
  765. package/dist/domain/javascript/htmlArtifactReferences.js +40 -0
  766. package/dist/domain/javascript/javascriptAnalysisResourceControls.js +65 -0
  767. package/dist/domain/javascript/javascriptApplicationAnalysis.js +146 -0
  768. package/dist/domain/javascript/javascriptApplicationChangeGraph.js +175 -0
  769. package/dist/domain/javascript/javascriptApplicationEvidenceSchemas.js +400 -0
  770. package/dist/domain/javascript/javascriptApplicationGraph.js +378 -0
  771. package/dist/domain/javascript/javascriptApplicationGraphSchemas.js +126 -0
  772. package/dist/domain/javascript/javascriptApplicationProjectionResources.js +43 -0
  773. package/dist/domain/javascript/javascriptApplicationVersionComparison.js +104 -0
  774. package/dist/domain/javascript/javascriptApplicationVersionComparisonSchemas.js +211 -0
  775. package/dist/domain/javascript/javascriptApplicationVersionItems.js +324 -0
  776. package/dist/domain/javascript/javascriptApplicationVersionKeys.js +199 -0
  777. package/dist/domain/javascript/javascriptArtifactFiles.js +1 -0
  778. package/dist/domain/javascript/javascriptAstFingerprint.js +153 -0
  779. package/dist/domain/javascript/javascriptAstValues.js +99 -0
  780. package/dist/domain/javascript/javascriptBootstrap.js +94 -0
  781. package/dist/domain/javascript/javascriptElectronMemberWrites.js +119 -0
  782. package/dist/domain/javascript/javascriptExportReturnShapeProjection.js +81 -0
  783. package/dist/domain/javascript/javascriptExportShapeComparison.js +161 -0
  784. package/dist/domain/javascript/javascriptExportShapeComparisonIdentity.js +16 -0
  785. package/dist/domain/javascript/javascriptExportShapeComparisonSchemas.js +302 -0
  786. package/dist/domain/javascript/javascriptExportShapeSelection.js +130 -0
  787. package/dist/domain/javascript/javascriptExportShapeVariants.js +333 -0
  788. package/dist/domain/javascript/javascriptFeatureSeed.js +193 -0
  789. package/dist/domain/javascript/javascriptFeatureTrace.js +177 -0
  790. package/dist/domain/javascript/javascriptFeatureTraceSchemas.js +131 -0
  791. package/dist/domain/javascript/javascriptFeatureTraversal.js +61 -0
  792. package/dist/domain/javascript/javascriptIntrinsicInvocation.js +93 -0
  793. package/dist/domain/javascript/javascriptModuleInterop.js +617 -0
  794. package/dist/domain/javascript/javascriptModuleSemanticIr.js +15 -0
  795. package/dist/domain/javascript/javascriptNativeHandoff.js +90 -0
  796. package/dist/domain/javascript/javascriptPackageImportAliases.js +58 -0
  797. package/dist/domain/javascript/javascriptRecovery.js +90 -0
  798. package/dist/domain/javascript/javascriptRpcEndpoints.js +253 -0
  799. package/dist/domain/javascript/javascriptRuntimeLoadState.js +98 -0
  800. package/dist/domain/javascript/javascriptRuntimeObservation.js +136 -0
  801. package/dist/domain/javascript/javascriptRuntimeReconciliation.js +46 -0
  802. package/dist/domain/javascript/javascriptRuntimeReconciliationActive.js +74 -0
  803. package/dist/domain/javascript/javascriptRuntimeReconciliationCaptureParsing.js +212 -0
  804. package/dist/domain/javascript/javascriptRuntimeReconciliationGraph.js +163 -0
  805. package/dist/domain/javascript/javascriptRuntimeReconciliationInputValidation.js +28 -0
  806. package/dist/domain/javascript/javascriptRuntimeReconciliationMatching.js +270 -0
  807. package/dist/domain/javascript/javascriptRuntimeReconciliationParsing.js +39 -0
  808. package/dist/domain/javascript/javascriptRuntimeReconciliationResult.js +126 -0
  809. package/dist/domain/javascript/javascriptRuntimeReconciliationRuntime.js +334 -0
  810. package/dist/domain/javascript/javascriptRuntimeReconciliationSchemas.js +234 -0
  811. package/dist/domain/javascript/javascriptRuntimeStaticCandidates.js +206 -0
  812. package/dist/domain/javascript/javascriptSemanticAnalysis.js +910 -0
  813. package/dist/domain/javascript/javascriptSemanticAsyncEffects.js +246 -0
  814. package/dist/domain/javascript/javascriptSemanticCallResolution.js +127 -0
  815. package/dist/domain/javascript/javascriptSemanticCallableResults.js +42 -0
  816. package/dist/domain/javascript/javascriptSemanticCalls.js +272 -0
  817. package/dist/domain/javascript/javascriptSemanticChildProcesses.js +224 -0
  818. package/dist/domain/javascript/javascriptSemanticCoverage.js +32 -0
  819. package/dist/domain/javascript/javascriptSemanticDataEffectHelpers.js +182 -0
  820. package/dist/domain/javascript/javascriptSemanticDataEffects.js +299 -0
  821. package/dist/domain/javascript/javascriptSemanticDerivedAnalysis.js +52 -0
  822. package/dist/domain/javascript/javascriptSemanticFileProjection.js +1 -0
  823. package/dist/domain/javascript/javascriptSemanticFingerprints.js +187 -0
  824. package/dist/domain/javascript/javascriptSemanticGraph.js +575 -0
  825. package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +316 -0
  826. package/dist/domain/javascript/javascriptSemanticGraphSerialization.js +12 -0
  827. package/dist/domain/javascript/javascriptSemanticIr.js +31 -0
  828. package/dist/domain/javascript/javascriptSemanticIterationSources.js +139 -0
  829. package/dist/domain/javascript/javascriptSemanticMemberMutations.js +865 -0
  830. package/dist/domain/javascript/javascriptSemanticMutationInitializers.js +190 -0
  831. package/dist/domain/javascript/javascriptSemanticMutationValues.js +104 -0
  832. package/dist/domain/javascript/javascriptSemanticObjectReferences.js +381 -0
  833. package/dist/domain/javascript/javascriptSemanticObjects.js +164 -0
  834. package/dist/domain/javascript/javascriptSemanticPrimitives.js +38 -0
  835. package/dist/domain/javascript/javascriptSemanticProjection.js +571 -0
  836. package/dist/domain/javascript/javascriptSemanticPromises.js +321 -0
  837. package/dist/domain/javascript/javascriptSemanticPropertyPaths.js +100 -0
  838. package/dist/domain/javascript/javascriptSemanticProvenance.js +29 -0
  839. package/dist/domain/javascript/javascriptSemanticQuery.js +175 -0
  840. package/dist/domain/javascript/javascriptSemanticQueryAssessment.js +45 -0
  841. package/dist/domain/javascript/javascriptSemanticQueryIdentity.js +63 -0
  842. package/dist/domain/javascript/javascriptSemanticQueryRelations.js +15 -0
  843. package/dist/domain/javascript/javascriptSemanticQuerySchemas.js +95 -0
  844. package/dist/domain/javascript/javascriptSemanticRequireOrigin.js +34 -0
  845. package/dist/domain/javascript/javascriptSemanticResourceLimits.js +77 -0
  846. package/dist/domain/javascript/javascriptSemanticResources.js +129 -0
  847. package/dist/domain/javascript/javascriptSemanticReturnedReferences.js +219 -0
  848. package/dist/domain/javascript/javascriptSemanticReturns.js +159 -0
  849. package/dist/domain/javascript/javascriptSemanticSlots.js +72 -0
  850. package/dist/domain/javascript/javascriptSemanticState.js +116 -0
  851. package/dist/domain/javascript/javascriptSemanticTraceSchemas.js +15 -0
  852. package/dist/domain/javascript/javascriptSemanticTraversal.js +80 -0
  853. package/dist/domain/javascript/javascriptSemanticValueTypes.js +1 -0
  854. package/dist/domain/javascript/javascriptSemanticValues.js +581 -0
  855. package/dist/domain/javascript/javascriptSourceAnalysis.js +1 -0
  856. package/dist/domain/javascript/javascriptSourceMapPaths.js +114 -0
  857. package/dist/domain/javascript/javascriptSourceParser.js +50 -0
  858. package/dist/domain/javascript/javascriptSourceSelection.js +11 -0
  859. package/dist/domain/javascript/javascriptStaticAnalysis.js +142 -0
  860. package/dist/domain/javascript/javascriptStaticAnalysisBundler.js +239 -0
  861. package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +271 -0
  862. package/dist/domain/javascript/javascriptStaticAnalysisFindings.js +86 -0
  863. package/dist/domain/javascript/javascriptStaticAnalysisHelpers.js +561 -0
  864. package/dist/domain/javascript/javascriptStaticAnalysisState.js +21 -0
  865. package/dist/domain/javascript/javascriptStaticAnalysisTypes.js +2 -0
  866. package/dist/domain/javascript/javascriptSymbolicBindings.js +795 -0
  867. package/dist/domain/javascript/javascriptSymbolicControlFlow.js +40 -0
  868. package/dist/domain/javascript/javascriptSymbolicValues.js +34 -0
  869. package/dist/domain/javascript/sourceToBundleComparison.js +261 -0
  870. package/dist/domain/javascript/sourceToBundleComparisonSchemas.js +109 -0
  871. package/dist/domain/javascript/sourceToBundleSignals.js +231 -0
  872. package/dist/domain/jeb/jebAnalysis.js +114 -0
  873. package/dist/domain/jsonSerialization.js +163 -0
  874. package/dist/domain/jsonShape.js +141 -0
  875. package/dist/domain/jsonValue.js +96 -0
  876. package/dist/domain/localPath.js +24 -0
  877. package/dist/domain/managed/managedApplicationGraph.js +221 -0
  878. package/dist/domain/managed/managedApplicationGraphCoverage.js +48 -0
  879. package/dist/domain/managed/managedApplicationGraphNodes.js +367 -0
  880. package/dist/domain/managed/managedArtifact.js +465 -0
  881. package/dist/domain/managed/managedInspectionEvidence.js +28 -0
  882. package/dist/domain/managed/managedMemberComparison.js +211 -0
  883. package/dist/domain/managed/managedMemberComparisonCoverage.js +71 -0
  884. package/dist/domain/managed/managedMemberComparisonItems.js +304 -0
  885. package/dist/domain/managed/managedMemberComparisonMatch.js +204 -0
  886. package/dist/domain/managed/managedNativeVerification.js +35 -0
  887. package/dist/domain/managed/managedNativeVerificationMatch.js +276 -0
  888. package/dist/domain/managed/managedNativeVerificationSchemas.js +180 -0
  889. package/dist/domain/managed/managedReconstruction.js +190 -0
  890. package/dist/domain/mobileApplicationGraphProjection.js +61 -0
  891. package/dist/domain/native/binaryLayout.js +354 -0
  892. package/dist/domain/native/fileOffsetPartialObservation.js +1 -0
  893. package/dist/domain/native/nativeAotPe.js +1408 -0
  894. package/dist/domain/native/nativeApiBoundary.js +140 -0
  895. package/dist/domain/native/nativeCallObservation.js +186 -0
  896. package/dist/domain/native/nativeCallPartialObservation.js +33 -0
  897. package/dist/domain/native/nativeDataType.js +53 -0
  898. package/dist/domain/native/nativeFunctionAnnotations.js +43 -0
  899. package/dist/domain/native/nativeInspection.js +174 -0
  900. package/dist/domain/native/nativeInstruction.js +125 -0
  901. package/dist/domain/native/nativeInvestigationGraph.js +364 -0
  902. package/dist/domain/native/nativeLoadImage.js +112 -0
  903. package/dist/domain/native/nativeMetadataRecovery.js +128 -0
  904. package/dist/domain/native/nativeUiObservation.js +137 -0
  905. package/dist/domain/native/nativeValueFlow.js +72 -0
  906. package/dist/domain/native/nativeValueTrace.js +64 -0
  907. package/dist/domain/native/objcSwiftMetadata.js +419 -0
  908. package/dist/domain/native/peResources.js +100 -0
  909. package/dist/domain/native/recordedCrash.js +263 -0
  910. package/dist/domain/native/recordedCrashNoteCoverage.js +73 -0
  911. package/dist/domain/nativeConvention.js +33 -0
  912. package/dist/domain/offsetDateTime.js +17 -0
  913. package/dist/domain/peMachine.js +36 -0
  914. package/dist/domain/process/processCapture.js +412 -0
  915. package/dist/domain/process/processCaptureCoverage.js +70 -0
  916. package/dist/domain/process/processCaptureExample.js +132 -0
  917. package/dist/domain/process/processCaptureParsing.js +21 -0
  918. package/dist/domain/process/processCaptureValidation.js +246 -0
  919. package/dist/domain/process/processComparison.js +315 -0
  920. package/dist/domain/process/processEvidenceProvider.js +11 -0
  921. package/dist/domain/process/processObservation.js +140 -0
  922. package/dist/domain/process/processScenario.js +247 -0
  923. package/dist/domain/process/processTraceComparison.js +34 -0
  924. package/dist/domain/process/processTraceDimensionProjection.js +35 -0
  925. package/dist/domain/process/processTraceEvaluation.js +320 -0
  926. package/dist/domain/process/processTraceSpecification.js +382 -0
  927. package/dist/domain/propertyListKeys.js +107 -0
  928. package/dist/domain/propertyListXmlText.js +19 -0
  929. package/dist/domain/providerAdapterError.js +19 -0
  930. package/dist/domain/providerCleanupError.js +18 -0
  931. package/dist/domain/providerConfigurationRefusal.js +12 -0
  932. package/dist/domain/providerOperationHealth.js +54 -0
  933. package/dist/domain/providerSelectionError.js +46 -0
  934. package/dist/domain/rawBinary.js +93 -0
  935. package/dist/domain/reconstructionCoverage.js +325 -0
  936. package/dist/domain/reconstructionCoverageEvaluation.js +234 -0
  937. package/dist/domain/reconstructionCoverageInput.js +7 -0
  938. package/dist/domain/reconstructionObligationLedgerIntegrity.js +114 -0
  939. package/dist/domain/reconstructionObligationLedgerSchemas.js +347 -0
  940. package/dist/domain/reconstructionReadiness.js +116 -0
  941. package/dist/domain/reconstructionReadinessFindingHelpers.js +17 -0
  942. package/dist/domain/reconstructionReadinessIntegrityFindings.js +118 -0
  943. package/dist/domain/reconstructionReadinessJourneyFindings.js +193 -0
  944. package/dist/domain/reconstructionReadinessSchemas.js +268 -0
  945. package/dist/domain/reconstructionUnknowns.js +91 -0
  946. package/dist/domain/reconstructionVerification.js +218 -0
  947. package/dist/domain/reconstructionVerificationSchemas.js +141 -0
  948. package/dist/domain/recordedTransportUrl.js +51 -0
  949. package/dist/domain/referenceSourceClassification.js +385 -0
  950. package/dist/domain/referenceSourceGraph.js +380 -0
  951. package/dist/domain/referenceSourceImportParsing.js +238 -0
  952. package/dist/domain/referenceSourcePathIdentity.js +22 -0
  953. package/dist/domain/referenceSourcePolicy.js +1 -0
  954. package/dist/domain/referenceSourceRequireBindings.js +137 -0
  955. package/dist/domain/relationshipCoverage.js +20 -0
  956. package/dist/domain/residualUnknown.js +252 -0
  957. package/dist/domain/result.js +4 -0
  958. package/dist/domain/runtimeVersion.js +15 -0
  959. package/dist/domain/safeJson.js +13 -0
  960. package/dist/domain/sourceMapContents.js +6 -0
  961. package/dist/domain/sourceMapEnvelope.js +44 -0
  962. package/dist/domain/staticRuntimeCorrelation.js +334 -0
  963. package/dist/domain/stringPatterns.js +6 -0
  964. package/dist/domain/swiftSymbolClassification.js +66 -0
  965. package/dist/domain/symbolAnalysis.js +122 -0
  966. package/dist/domain/unicodeCodePointOrder.js +23 -0
  967. package/dist/domain/unknownRegistryError.js +10 -0
  968. package/dist/domain/wasm/wasmArtifact.js +105 -0
  969. package/dist/domain/webBundleAnalysis.js +192 -0
  970. package/dist/domain/webBundleAnalyzer.js +15 -0
  971. package/dist/domain/webBundleAnalyzerAst.js +49 -0
  972. package/dist/domain/webBundleAnalyzerInspection.js +315 -0
  973. package/dist/domain/webBundleAnalyzerResult.js +142 -0
  974. package/dist/domain/webCaptureDiff.js +423 -0
  975. package/dist/domain/webCaptureDiffSchemas.js +84 -0
  976. package/dist/domain/webContentArtifact.js +38 -0
  977. package/dist/domain/webEventListeners.js +29 -0
  978. package/dist/domain/webExecution.js +75 -0
  979. package/dist/domain/webInventory.js +62 -0
  980. package/dist/domain/webMcpDiscovery.js +53 -0
  981. package/dist/domain/webModuleImports.js +99 -0
  982. package/dist/domain/webModuleTrace.js +101 -0
  983. package/dist/domain/webNetworkCapture.js +142 -0
  984. package/dist/domain/webNetworkCaptureCoordinates.js +58 -0
  985. package/dist/domain/webRuntime.js +80 -0
  986. package/dist/domain/webScreenshot.js +132 -0
  987. package/dist/domain/webScriptArtifacts.js +37 -0
  988. package/dist/domain/webScriptExport.js +84 -0
  989. package/dist/domain/webScriptExportError.js +19 -0
  990. package/dist/domain/webScriptExportPlan.js +104 -0
  991. package/dist/domain/webSourceLocation.js +118 -0
  992. package/dist/domain/webSourcePosition.js +21 -0
  993. package/dist/domain/zipPackageFormat.js +52 -0
  994. package/dist/domain/zodCollectionSteps.js +24 -0
  995. package/dist/dotnet/ManagedArtifactInspector.js +308 -0
  996. package/dist/dotnet/ManagedDecodeBudget.js +138 -0
  997. package/dist/dotnet/ManagedExceptionRegionValidation.js +41 -0
  998. package/dist/dotnet/ManagedMemberInspector.js +173 -0
  999. package/dist/dotnet/ManagedMemberInspectorCore.js +446 -0
  1000. package/dist/dotnet/ManagedMemberInstructionDecoder.js +468 -0
  1001. package/dist/dotnet/ManagedMemberOwnership.js +71 -0
  1002. package/dist/dotnet/ManagedMemberPointers.js +62 -0
  1003. package/dist/dotnet/ManagedMemberRows.js +227 -0
  1004. package/dist/dotnet/ManagedMetadataHeaps.js +179 -0
  1005. package/dist/dotnet/ManagedMetadataInventory.js +99 -0
  1006. package/dist/dotnet/ManagedMetadataInventoryRows.js +295 -0
  1007. package/dist/dotnet/ManagedMetadataLayout.js +270 -0
  1008. package/dist/dotnet/ManagedMetadataRowSizes.js +54 -0
  1009. package/dist/dotnet/ManagedMethodBodyReader.js +155 -0
  1010. package/dist/dotnet/ManagedNativeBoundaryHelpers.js +314 -0
  1011. package/dist/dotnet/ManagedNativeBoundaryInspector.js +128 -0
  1012. package/dist/dotnet/ManagedPeReader.js +233 -0
  1013. package/dist/dotnet/ManagedReaderFailure.js +27 -0
  1014. package/dist/dotnet/ManagedSnapshot.js +88 -0
  1015. package/dist/dotnet/ManagedStaticProvider.js +158 -0
  1016. package/dist/dotnet/ManagedStaticProviderMetadata.js +33 -0
  1017. package/dist/evaluation/AgentEvaluationFixtures.js +250 -0
  1018. package/dist/evaluation/AgentEvaluationReport.js +32 -0
  1019. package/dist/evaluation/CodexAgentEval.js +188 -0
  1020. package/dist/evaluation/KnownAnswerEvaluation.js +323 -0
  1021. package/dist/evm/EvmBytecodeCarrier.js +21 -0
  1022. package/dist/evm/EvmWorkerLimits.js +40 -0
  1023. package/dist/evm/EvmoleFailures.js +124 -0
  1024. package/dist/evm/EvmoleInterfaceAdapter.js +53 -0
  1025. package/dist/evm/EvmoleInterfaceProvider.js +339 -0
  1026. package/dist/evm/EvmoleInterfaceWorker.js +87 -0
  1027. package/dist/evm/EvmoleRelease.js +16 -0
  1028. package/dist/filesystem/OwnedDirectoryHandle.js +29 -0
  1029. package/dist/filesystem/OwnedFileHandle.js +36 -0
  1030. package/dist/filesystem/OwnedStagedOutput.js +138 -0
  1031. package/dist/filesystem/RegularFile.js +73 -0
  1032. package/dist/filesystem/StableFileHash.js +46 -0
  1033. package/dist/filesystem/readFileHandleChunks.js +35 -0
  1034. package/dist/firmware/FirmwareCommand.js +190 -0
  1035. package/dist/firmware/FirmwareFiles.js +206 -0
  1036. package/dist/firmware/FirmwareProvider.js +388 -0
  1037. package/dist/firmware/FirmwarePublication.js +105 -0
  1038. package/dist/firmware/FirmwareRelease.js +33 -0
  1039. package/dist/firmware/FirmwareReports.js +287 -0
  1040. package/dist/firmware/FirmwareVersion.js +80 -0
  1041. package/dist/generatedPackageMetadata.js +9 -0
  1042. package/dist/ghidra/GhidraAnalysisProfile.js +219 -0
  1043. package/dist/ghidra/GhidraAnalysisSeeds.js +211 -0
  1044. package/dist/ghidra/GhidraClient.js +725 -0
  1045. package/dist/ghidra/GhidraClientStartup.js +27 -0
  1046. package/dist/ghidra/GhidraClientTypes.js +1 -0
  1047. package/dist/ghidra/GhidraClientWire.js +38 -0
  1048. package/dist/ghidra/GhidraDiagnostics.js +53 -0
  1049. package/dist/ghidra/GhidraDoctor.js +88 -0
  1050. package/dist/ghidra/GhidraFunctionValues.js +328 -0
  1051. package/dist/ghidra/GhidraInstallation.js +443 -0
  1052. package/dist/ghidra/GhidraInstallationPolicy.js +140 -0
  1053. package/dist/ghidra/GhidraInventoryValues.js +262 -0
  1054. package/dist/ghidra/GhidraJavaLaunch.js +66 -0
  1055. package/dist/ghidra/GhidraLanguageCatalog.js +99 -0
  1056. package/dist/ghidra/GhidraLauncher.js +490 -0
  1057. package/dist/ghidra/GhidraLoadImageAttest.js +103 -0
  1058. package/dist/ghidra/GhidraLoadImageValues.js +260 -0
  1059. package/dist/ghidra/GhidraMipsProfile.js +187 -0
  1060. package/dist/ghidra/GhidraProvider.js +250 -0
  1061. package/dist/ghidra/GhidraProviderCapabilities.js +208 -0
  1062. package/dist/ghidra/GhidraProviderClient.js +613 -0
  1063. package/dist/ghidra/GhidraPspExtension.js +144 -0
  1064. package/dist/ghidra/GhidraPspProfile.js +50 -0
  1065. package/dist/ghidra/GhidraRawBinaryLanguage.js +18 -0
  1066. package/dist/ghidra/GhidraRequestQueue.js +115 -0
  1067. package/dist/ghidra/GhidraResponseBuffer.js +31 -0
  1068. package/dist/ghidra/GhidraResponseRouter.js +24 -0
  1069. package/dist/ghidra/GhidraSessionError.js +180 -0
  1070. package/dist/ghidra/GhidraSessionRoot.js +39 -0
  1071. package/dist/ghidra/GhidraSessionValues.js +86 -0
  1072. package/dist/ghidra/GhidraSocketConnection.js +83 -0
  1073. package/dist/ghidra/GhidraTargetSnapshot.js +79 -0
  1074. package/dist/ghidra/GhidraTransport.js +101 -0
  1075. package/dist/ghidra/extensions/GhidraExtensionFailures.js +20 -0
  1076. package/dist/ghidra/extensions/GhidraExtensions.js +177 -0
  1077. package/dist/ghidra/extensions/nativeaot/NativeAotAdapter.js +27 -0
  1078. package/dist/ghidra/extensions/nativeaot/NativeAotReport.js +100 -0
  1079. package/dist/ghidra/protocol.js +46 -0
  1080. package/dist/go/GoBinaryContainer.js +125 -0
  1081. package/dist/go/GoBinaryImage.js +172 -0
  1082. package/dist/go/GoBinaryProvider.js +137 -0
  1083. package/dist/go/GoElfImage.js +149 -0
  1084. package/dist/go/GoMachoImage.js +113 -0
  1085. package/dist/go/GoModuleText.js +217 -0
  1086. package/dist/go/GoPeImage.js +102 -0
  1087. package/dist/hopper/BridgeLauncher.js +305 -0
  1088. package/dist/hopper/HopperAnalysisProfile.js +168 -0
  1089. package/dist/hopper/HopperCleanup.js +245 -0
  1090. package/dist/hopper/HopperClient.js +767 -0
  1091. package/dist/hopper/HopperDiagnostics.js +14 -0
  1092. package/dist/hopper/HopperFileOffset.js +237 -0
  1093. package/dist/hopper/HopperMachOImage.js +200 -0
  1094. package/dist/hopper/HopperOperationStage.js +6 -0
  1095. package/dist/hopper/HopperProcessDiagnostic.js +26 -0
  1096. package/dist/hopper/HopperProvider.js +269 -0
  1097. package/dist/hopper/HopperProviderCapabilities.js +91 -0
  1098. package/dist/hopper/HopperRegexSearch.js +134 -0
  1099. package/dist/hopper/HopperRegexWorker.js +27 -0
  1100. package/dist/hopper/HopperRequestQueue.js +261 -0
  1101. package/dist/hopper/HopperResponseStream.js +44 -0
  1102. package/dist/hopper/HopperSessionValues.js +30 -0
  1103. package/dist/hopper/HopperSocketConnection.js +31 -0
  1104. package/dist/hopper/HopperTargetLease.js +233 -0
  1105. package/dist/hopper/LinuxPrivateDisplayDiagnostic.js +64 -0
  1106. package/dist/hopper/LinuxPrivateDisplayProbe.js +224 -0
  1107. package/dist/hopper/protocol.js +88 -0
  1108. package/dist/ida/IdaBusyHealth.js +44 -0
  1109. package/dist/ida/IdaCallGraph.js +134 -0
  1110. package/dist/ida/IdaConfiguration.js +61 -0
  1111. package/dist/ida/IdaDoctor.js +53 -0
  1112. package/dist/ida/IdaInput.js +56 -0
  1113. package/dist/ida/IdaMcpConnection.js +115 -0
  1114. package/dist/ida/IdaOperationRunner.js +376 -0
  1115. package/dist/ida/IdaProtocolValues.js +208 -0
  1116. package/dist/ida/IdaProvider.js +136 -0
  1117. package/dist/ida/IdaProviderCapabilities.js +64 -0
  1118. package/dist/ida/IdaSessionClient.js +444 -0
  1119. package/dist/ida/IdaWorkspace.js +55 -0
  1120. package/dist/identity.js +25 -0
  1121. package/dist/inspector/JavaScriptRuntimeScope.js +89 -0
  1122. package/dist/inspector/V8InspectorCaptureProjection.js +197 -0
  1123. package/dist/inspector/V8InspectorEndpoint.js +70 -0
  1124. package/dist/inspector/V8InspectorProvider.js +378 -0
  1125. package/dist/inspector/providerIdentity.js +6 -0
  1126. package/dist/javascript/analysis/JavaScriptAnalysisTransfer.js +337 -0
  1127. package/dist/javascript/analysis/JavaScriptAnalysisWorker.js +574 -0
  1128. package/dist/javascript/analysis/JavaScriptAnalysisWorkerProtocol.js +64 -0
  1129. package/dist/javascript/analysis/JavaScriptAnalysisWorkerSchemas.js +558 -0
  1130. package/dist/javascript/analysis/JavaScriptAnalysisWorkerServer.js +121 -0
  1131. package/dist/javascript/recovery/RecoveryFiles.js +175 -0
  1132. package/dist/javascript/recovery/WakaruCommand.js +137 -0
  1133. package/dist/javascript/recovery/WakaruExecution.js +115 -0
  1134. package/dist/javascript/recovery/WakaruProvider.js +218 -0
  1135. package/dist/javascript/recovery/WakaruPublication.js +126 -0
  1136. package/dist/javascript/recovery/WakaruRelease.js +36 -0
  1137. package/dist/javascript/recovery/WakaruReport.js +140 -0
  1138. package/dist/javascript/recovery/WakaruVersion.js +24 -0
  1139. package/dist/javascript/sourceMaps/DecodedSourceMap.js +47 -0
  1140. package/dist/javascript/sourceMaps/SourceMapCodecProcess.js +37 -0
  1141. package/dist/javascript/sourceMaps/SourceMapCodecProtocol.js +20 -0
  1142. package/dist/javascript/sourceMaps/SourceMapCommand.js +223 -0
  1143. package/dist/javascript/sourceMaps/SourceMapDecoder.js +135 -0
  1144. package/dist/javascript/sourceMaps/SourceMapFormat.js +238 -0
  1145. package/dist/javascript/sourceMaps/TraceSourceMap.js +152 -0
  1146. package/dist/jeb/JebMcpConnection.js +186 -0
  1147. package/dist/jeb/JebMcpEndpoint.js +40 -0
  1148. package/dist/jeb/JebProvider.js +297 -0
  1149. package/dist/logger.js +14 -0
  1150. package/dist/main/messages.js +4 -0
  1151. package/dist/main/shutdown.js +102 -0
  1152. package/dist/main/startup.js +21 -0
  1153. package/dist/main/transport.js +72 -0
  1154. package/dist/main/types.js +1 -0
  1155. package/dist/main.js +92 -0
  1156. package/dist/mcp/AnalysisSnapshotFiles-DbgHi36O.js +1225 -0
  1157. package/dist/mcp/ArtifactProvider-BNxKlaKX.js +2090 -0
  1158. package/dist/mcp/ArtifactProviderMetadata--hy-wyJK.js +76 -0
  1159. package/dist/mcp/ArtifactReader-OyM03Gjn.js +55 -0
  1160. package/dist/mcp/ArtifactResourceScope-CBR5q4aK.js +108 -0
  1161. package/dist/mcp/AsarHeader-WsPgoooH.js +31 -0
  1162. package/dist/mcp/BinaryTargetResolver-DbiUzRLh.js +1073 -0
  1163. package/dist/mcp/BoundedFileBytes-CJPW_TzE.js +68 -0
  1164. package/dist/mcp/CdpConnection-CM0tkVfW.js +557 -0
  1165. package/dist/mcp/CdpOptionalCommand-H8_fL7Q_.js +120 -0
  1166. package/dist/mcp/CdpTargetSession-OYD1d6XM.js +647 -0
  1167. package/dist/mcp/DirectAnalysis-BWAu8Ro5.js +395 -0
  1168. package/dist/mcp/DirectAnalysisStatus-DofNPhKd.js +33 -0
  1169. package/dist/mcp/ElectronFileScope-DEayib6K.js +110 -0
  1170. package/dist/mcp/InterfaceBuilderDecodeBudget-CUrOtfNo.js +401 -0
  1171. package/dist/mcp/ManagedStaticProvider-CXE93Bow.js +4460 -0
  1172. package/dist/mcp/NativeMacOSProvider-BbITFLHW.js +4408 -0
  1173. package/dist/mcp/NativeMacOSProviderMetadata-mxDhaNJf.js +281 -0
  1174. package/dist/mcp/ProcedureAddressResolution-Gnjf9Hya.js +19 -0
  1175. package/dist/mcp/ProcessOwnership-nOFZsmD3.js +1411 -0
  1176. package/dist/mcp/WorkflowEvidence-DJyEy3K0.js +94 -0
  1177. package/dist/mcp/analysisErrorCore-BqyeMw3_.js +201 -0
  1178. package/dist/mcp/analysisErrorProjection-B7pHef2y.js +724 -0
  1179. package/dist/mcp/artifactOperationError-B_jxO8at.js +27 -0
  1180. package/dist/mcp/artifactToolContracts-TXegBBr1.js +159 -0
  1181. package/dist/mcp/browserObservation-BCgaDRyQ.js +4398 -0
  1182. package/dist/mcp/browserObservationError-BKBEX85K.js +40 -0
  1183. package/dist/mcp/browserObservationSchemas-yzRJ90-E.js +573 -0
  1184. package/dist/mcp/browserScenario-z7jveI9P.js +2319 -0
  1185. package/dist/mcp/browserScenarioCapture-BvnKTmtZ.js +460 -0
  1186. package/dist/mcp/canonicalDigest-Bi_0_zGi.js +71 -0
  1187. package/dist/mcp/digests-Dugt3H71.js +199 -0
  1188. package/dist/mcp/electronActiveObservation-lDvQTMR0.js +226 -0
  1189. package/dist/mcp/electronObservation-DjQQYGw4.js +556 -0
  1190. package/dist/mcp/electronObservation-DuhMHCmQ.js +112 -0
  1191. package/dist/mcp/electronScenario-9mLG6h-g.js +586 -0
  1192. package/dist/mcp/emptyArraySchema-DEEefG2V.js +140 -0
  1193. package/dist/mcp/enhancedInputs-CLdEXv88.js +56 -0
  1194. package/dist/mcp/interfaceBuilderGraph-BOKqQzjK.js +2613 -0
  1195. package/dist/mcp/javascriptRuntimeObservation-C_wglsz_.js +661 -0
  1196. package/dist/mcp/javascriptRuntimeObservation-CxQ1UT_y.js +121 -0
  1197. package/dist/mcp/lipo-Do-2eBrl.js +465 -0
  1198. package/dist/mcp/localPath-AxvW9aPe.js +19 -0
  1199. package/dist/mcp/logger-CZ4Hlc6u.js +34 -0
  1200. package/dist/mcp/machoContainer-9En6pSkd.js +813 -0
  1201. package/dist/mcp/main-WQSCuTNt.js +52791 -0
  1202. package/dist/mcp/main.js +6 -0
  1203. package/dist/mcp/managedToolContracts-o5LHFwHc.js +81 -0
  1204. package/dist/mcp/plistValue-DsU7z4yF.js +47 -0
  1205. package/dist/mcp/propertyListKeys-cX-BUv2y.js +197 -0
  1206. package/dist/mcp/providerAdapterError-CdPaQ6-Z.js +27 -0
  1207. package/dist/mcp/providerCleanupError-DvE79aUX.js +49 -0
  1208. package/dist/mcp/providerIdentities--ptAh481.js +31 -0
  1209. package/dist/mcp/providerIdentity-BCQ5n5tw.js +16 -0
  1210. package/dist/mcp/providerOperationHealth-CUeCJZiP.js +212 -0
  1211. package/dist/mcp/rolldown-runtime-BjeaiXFo.js +121 -0
  1212. package/dist/mcp/safeJson-NeGfpkrI.js +25 -0
  1213. package/dist/mcp/scanCanonical-2GN0h-BE.js +3647 -0
  1214. package/dist/mcp/serverIdentity-rOY69sxc.js +633 -0
  1215. package/dist/mcp/sourceMapEnvelope-D8Zezqyi.js +252 -0
  1216. package/dist/mcp/toolContracts-CrfYDTUz.js +14561 -0
  1217. package/dist/mcp/toolOutputSchemaGroups-ChxVLGoy.js +11114 -0
  1218. package/dist/mcp/unicodeCodePointOrder-BezCbTpg.js +26 -0
  1219. package/dist/mcp/webContentArtifact-DUBgMzVO.js +185 -0
  1220. package/dist/mcp/webRuntime-C2Tx-fgS.js +74 -0
  1221. package/dist/mcp/webSourceLocation-Dnkpf0R2.js +8532 -0
  1222. package/dist/mcpDoctor.js +360 -0
  1223. package/dist/mcpStartupPolicy.js +14 -0
  1224. package/dist/native/AppleDispatchCoverage.js +112 -0
  1225. package/dist/native/AppleDispatchDecodeFacts.js +6 -0
  1226. package/dist/native/AppleDispatchMetadata.js +176 -0
  1227. package/dist/native/AppleMachoFixups.js +372 -0
  1228. package/dist/native/AppleMachoSelection.js +234 -0
  1229. package/dist/native/AppleObjcCategories.js +63 -0
  1230. package/dist/native/AppleObjcDispatchFacets.js +260 -0
  1231. package/dist/native/AppleObjcProperties.js +79 -0
  1232. package/dist/native/AppleObjcProtocols.js +89 -0
  1233. package/dist/native/AppleSwiftDispatchFacets.js +156 -0
  1234. package/dist/native/AppleSwiftVtables.js +92 -0
  1235. package/dist/native/CommandRunner.js +240 -0
  1236. package/dist/native/LldbCallTracer.js +713 -0
  1237. package/dist/native/LldbRetainedObservations.js +178 -0
  1238. package/dist/native/NativeCallObservation.js +195 -0
  1239. package/dist/native/NativeMacOSProvider.js +701 -0
  1240. package/dist/native/NativeMacOSProviderMetadata.js +46 -0
  1241. package/dist/native/NativeMachoInspection.js +273 -0
  1242. package/dist/native/NativeUiHelperRuntime.js +66 -0
  1243. package/dist/native/NativeUiObservation.js +183 -0
  1244. package/dist/native/NativeUiOutputBudget.js +8 -0
  1245. package/dist/native/SignatureTargetBinding.js +155 -0
  1246. package/dist/native/parsers/codesign.js +93 -0
  1247. package/dist/native/parsers/demangle.js +30 -0
  1248. package/dist/native/parsers/dyldInfo.js +60 -0
  1249. package/dist/native/parsers/echoedPath.js +14 -0
  1250. package/dist/native/parsers/lipo.js +177 -0
  1251. package/dist/native/parsers/machoUuid.js +150 -0
  1252. package/dist/native/parsers/otool.js +379 -0
  1253. package/dist/native/parsers/plist.js +187 -0
  1254. package/dist/native/pe/PeResourceLayout.js +120 -0
  1255. package/dist/native/pe/PeResourceParser.js +286 -0
  1256. package/dist/native/pe/PeResourcesProvider.js +63 -0
  1257. package/dist/native/pwndbg/PwndbgCoreContext.js +180 -0
  1258. package/dist/native/pwntools/PwntoolsDecoder.js +206 -0
  1259. package/dist/native/pwntools/PwntoolsFailures.js +180 -0
  1260. package/dist/native/pwntools/PwntoolsLayoutProvider.js +36 -0
  1261. package/dist/native/pwntools/PwntoolsRecordedCrashProvider.js +75 -0
  1262. package/dist/native/pwntools/PwntoolsRelease.js +19 -0
  1263. package/dist/native/pwntools/PwntoolsResourceLimits.js +76 -0
  1264. package/dist/native/pwntools/RecordedCrashSourceBindings.js +46 -0
  1265. package/dist/native/pwntools/RecordedCrashStructureBindings.js +103 -0
  1266. package/dist/process/BoundedFileBytes.js +40 -0
  1267. package/dist/process/DarwinProcessRunTokenReader.js +376 -0
  1268. package/dist/process/ExecFileOutput.js +124 -0
  1269. package/dist/process/JavaScriptWorkerMemoryLimit.js +25 -0
  1270. package/dist/process/OwnedCommand.js +131 -0
  1271. package/dist/process/PendingOperations.js +61 -0
  1272. package/dist/process/PrivateRuntimeRoot.js +61 -0
  1273. package/dist/process/ProcessCommandIdentity.js +19 -0
  1274. package/dist/process/ProcessOwnership.js +636 -0
  1275. package/dist/process/ProcessOwnershipIdentity.js +13 -0
  1276. package/dist/process/ProcessOwnershipObservation.js +407 -0
  1277. package/dist/process/ProcessOwnershipProcessTree.js +35 -0
  1278. package/dist/process/ProcessRunTokenObservations.js +48 -0
  1279. package/dist/process/ProviderDeadline.js +91 -0
  1280. package/dist/process/ProviderDiagnosticRedaction.js +17 -0
  1281. package/dist/process/ProviderProcess.js +381 -0
  1282. package/dist/process/ProviderRunLineage.js +21 -0
  1283. package/dist/process/WindowsAuthority.js +51 -0
  1284. package/dist/process/WindowsBatchCommand.js +46 -0
  1285. package/dist/process/boundedUtf8Text.js +13 -0
  1286. package/dist/process/capture/FilesystemSnapshot.js +268 -0
  1287. package/dist/process/capture/ProcessCaptureCapability.js +65 -0
  1288. package/dist/process/capture/ProcessCaptureEnvironment.js +9 -0
  1289. package/dist/process/capture/ProcessCaptureError.js +74 -0
  1290. package/dist/process/capture/ProcessCaptureJournal.js +61 -0
  1291. package/dist/process/capture/ProcessCaptureLifecycle.js +1050 -0
  1292. package/dist/process/capture/ProcessCaptureProgress.js +62 -0
  1293. package/dist/process/capture/ProcessFilesystemEffects.js +81 -0
  1294. package/dist/process/capture/ProcessHarness.js +602 -0
  1295. package/dist/process/capture/ProcessNormalization.js +88 -0
  1296. package/dist/process/capture/ProcessSampling.js +415 -0
  1297. package/dist/process/capture/ProcessScenarioRuntimeValidation.js +79 -0
  1298. package/dist/process/capture/ProcessTimer.js +39 -0
  1299. package/dist/process/capture/TerminalRenderer.js +124 -0
  1300. package/dist/process/snapshotEnvironment.js +14 -0
  1301. package/dist/reference/ReferenceSourceReader.js +73 -0
  1302. package/dist/reference/ReferenceSourceReaderEntries.js +273 -0
  1303. package/dist/reference/ReferenceSourceReaderErrors.js +54 -0
  1304. package/dist/reference/ReferenceSourceReaderFile.js +147 -0
  1305. package/dist/reference/ReferenceSourceReaderPaths.js +8 -0
  1306. package/dist/reference/ReferenceSourceReaderTypes.js +1 -0
  1307. package/dist/reference/ReferenceSourceReaderValidate.js +81 -0
  1308. package/dist/server/EvidenceMcpServer.js +216 -0
  1309. package/dist/server/admittedToolOperation.js +9 -0
  1310. package/dist/server/analysisAdmission.js +8 -0
  1311. package/dist/server/contractToolHandler.js +21 -0
  1312. package/dist/server/createServer.js +344 -0
  1313. package/dist/server/lifecycleProgress.js +10 -0
  1314. package/dist/server/mcpClientMetadata.js +42 -0
  1315. package/dist/server/mcpProgress.js +26 -0
  1316. package/dist/server/promptCompletion.js +141 -0
  1317. package/dist/server/recordDerivedEvidence.js +10 -0
  1318. package/dist/server/registerAdbTools.js +36 -0
  1319. package/dist/server/registerAnalysisViewTool.js +10 -0
  1320. package/dist/server/registerAndroidTools.js +31 -0
  1321. package/dist/server/registerApktoolTools.js +14 -0
  1322. package/dist/server/registerApplicationTools/compareExportShapes.js +29 -0
  1323. package/dist/server/registerApplicationTools/compareSourceToBundle.js +29 -0
  1324. package/dist/server/registerApplicationTools/compareVersions.js +34 -0
  1325. package/dist/server/registerApplicationTools/coverage.js +13 -0
  1326. package/dist/server/registerApplicationTools/helpers.js +37 -0
  1327. package/dist/server/registerApplicationTools/obligationLedger.js +23 -0
  1328. package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +50 -0
  1329. package/dist/server/registerApplicationTools/traceFeature.js +26 -0
  1330. package/dist/server/registerApplicationTools/traceSemantics.js +25 -0
  1331. package/dist/server/registerApplicationTools/types.js +1 -0
  1332. package/dist/server/registerApplicationTools.js +19 -0
  1333. package/dist/server/registerArtifactComparisonTool.js +71 -0
  1334. package/dist/server/registerArtifactTools.js +14 -0
  1335. package/dist/server/registerBinaryDiagnosticsTools.js +26 -0
  1336. package/dist/server/registerBrowserScenarioTool.js +26 -0
  1337. package/dist/server/registerBrowserTools.js +58 -0
  1338. package/dist/server/registerBundleComparisonTool.js +54 -0
  1339. package/dist/server/registerCloseLifecycleTool.js +55 -0
  1340. package/dist/server/registerElectronTools.js +70 -0
  1341. package/dist/server/registerEnhancedTools.js +169 -0
  1342. package/dist/server/registerEvidenceTools.js +68 -0
  1343. package/dist/server/registerEvmTools.js +9 -0
  1344. package/dist/server/registerFirmwareTools.js +11 -0
  1345. package/dist/server/registerFunctionComparisonTool.js +86 -0
  1346. package/dist/server/registerGoTools.js +9 -0
  1347. package/dist/server/registerInvestigationTools/helpers.js +46 -0
  1348. package/dist/server/registerInvestigationTools/types.js +1 -0
  1349. package/dist/server/registerInvestigationTools.js +168 -0
  1350. package/dist/server/registerJavaScriptRecoveryTool.js +9 -0
  1351. package/dist/server/registerJavaScriptRuntimeObservationTools.js +27 -0
  1352. package/dist/server/registerJebTools.js +16 -0
  1353. package/dist/server/registerManagedTools.js +40 -0
  1354. package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +53 -0
  1355. package/dist/server/registerManagedWorkflowTools/contract.js +7 -0
  1356. package/dist/server/registerManagedWorkflowTools/evidence.js +27 -0
  1357. package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +27 -0
  1358. package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +41 -0
  1359. package/dist/server/registerManagedWorkflowTools/types.js +1 -0
  1360. package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +62 -0
  1361. package/dist/server/registerManagedWorkflowTools.js +11 -0
  1362. package/dist/server/registerOfficialTools.js +74 -0
  1363. package/dist/server/registerPeResourcesTool.js +9 -0
  1364. package/dist/server/registerProcessComparisonTool.js +156 -0
  1365. package/dist/server/registerPrompts.js +73 -0
  1366. package/dist/server/registerRecordedCrashTools.js +9 -0
  1367. package/dist/server/registerSessionRecordTools.js +90 -0
  1368. package/dist/server/registerSessionStatusTool.js +61 -0
  1369. package/dist/server/registerSessionTools.js +217 -0
  1370. package/dist/server/registerWasmTools.js +9 -0
  1371. package/dist/server/registerWebModuleTool.js +9 -0
  1372. package/dist/server/registerWebNetworkCaptureTool.js +20 -0
  1373. package/dist/server/registerWebRuntimeTools.js +27 -0
  1374. package/dist/server/registerWebScriptTool.js +18 -0
  1375. package/dist/server/registerWebSourceLocationTool.js +9 -0
  1376. package/dist/server/runDerivedOperation.js +55 -0
  1377. package/dist/server/sessionAvailabilityPolicy.js +29 -0
  1378. package/dist/server/sessionEvidence.js +11 -0
  1379. package/dist/server/toolLogging.js +11 -0
  1380. package/dist/server/toolRegistrationOptions.js +9 -0
  1381. package/dist/server/toolResult.js +119 -0
  1382. package/dist/server/toolResultEncoding.js +34 -0
  1383. package/dist/serverIdentity.js +69 -0
  1384. package/dist/wasm/WabtArtifactProvider.js +313 -0
  1385. package/dist/wasm/WabtFailures.js +62 -0
  1386. package/dist/wasm/WabtOutput.js +60 -0
  1387. package/dist/wasm/WabtRelease.js +12 -0
  1388. package/dist/wasm/WabtWat.js +184 -0
  1389. package/dist/wasm/WasmGlueAdapter.js +51 -0
  1390. package/dist/windows/WindowsNativeLoader.js +124 -0
  1391. package/dist/windows/WindowsOwnedProcess.js +265 -0
  1392. package/dist/windows/WindowsPrivateRuntime.js +143 -0
  1393. package/hooks/hooks.json +17 -0
  1394. package/install.sh +172 -0
  1395. package/licenses/Apache-2.0.txt +202 -0
  1396. package/licenses/GCC-Runtime-Library-Exception-3.1.txt +73 -0
  1397. package/licenses/GPL-3.0.txt +674 -0
  1398. package/licenses/MIT-template.txt +18 -0
  1399. package/licenses/MinGW-w64-runtime.txt +240 -0
  1400. package/licenses/Node-22.19.0-LICENSE.txt +2666 -0
  1401. package/licenses/README.md +54 -0
  1402. package/licenses/cfworker-MIT.txt +21 -0
  1403. package/licenses/digfox-MIT.txt +21 -0
  1404. package/licenses/dotnet-runtime-MIT.txt +23 -0
  1405. package/licenses/ghidra-12.1.4-DISCLAIMER.txt +13 -0
  1406. package/licenses/ghidra-12.1.4-LICENSE.txt +201 -0
  1407. package/licenses/ghidra-12.1.4-NOTICE.txt +49 -0
  1408. package/licenses/nativeaot-parser-MIT.txt +28 -0
  1409. package/licenses/npm-dependencies.txt +2812 -0
  1410. package/licenses/npm-runtime-notices.txt +6632 -0
  1411. package/licenses/rea-jev-MIT.txt +21 -0
  1412. package/licenses/rea-lab-MIT.txt +21 -0
  1413. package/licenses/upstream-sources.json +62 -0
  1414. package/licenses/xterm-MIT.txt +21 -0
  1415. package/native/windows/README.md +156 -0
  1416. package/native/windows/build/manifest.json +9 -0
  1417. package/native/windows/build/rea-windows-x64.node +0 -0
  1418. package/package.json +371 -4
  1419. package/port/cli.mjs +210 -0
  1420. package/port/hooks/guard.mjs +140 -0
  1421. package/port/knowledge/engines.json +67 -0
  1422. package/port/knowledge/footprints.json +189 -0
  1423. package/port/knowledge/maps/godot-godot-csharp.json +38 -0
  1424. package/port/knowledge/maps/godot-threejs.json +42 -0
  1425. package/port/knowledge/maps/godot-unity.json +62 -0
  1426. package/port/knowledge/maps/godot-unreal.json +48 -0
  1427. package/port/knowledge/maps/unity-godot.json +52 -0
  1428. package/port/knowledge/maps/unity-unreal.json +33 -0
  1429. package/port/knowledge/systems.json +1554 -0
  1430. package/port/mcp.mjs +62 -0
  1431. package/port/plugin/mcp-launch.mjs +19 -0
  1432. package/port/server.mjs +129 -0
  1433. package/port/src/agent.mjs +257 -0
  1434. package/port/src/archive.mjs +324 -0
  1435. package/port/src/binary.mjs +606 -0
  1436. package/port/src/blueprint.mjs +225 -0
  1437. package/port/src/compare.mjs +165 -0
  1438. package/port/src/connect.mjs +58 -0
  1439. package/port/src/convert.mjs +134 -0
  1440. package/port/src/formats.mjs +229 -0
  1441. package/port/src/graph.mjs +275 -0
  1442. package/port/src/knowledge.mjs +90 -0
  1443. package/port/src/lookup.mjs +615 -0
  1444. package/port/src/main-module.mjs +10 -0
  1445. package/port/src/plan.mjs +606 -0
  1446. package/port/src/porters.mjs +360 -0
  1447. package/port/src/proofcase.mjs +343 -0
  1448. package/port/src/relay.mjs +493 -0
  1449. package/port/src/scan.mjs +189 -0
  1450. package/port/src/scene.mjs +338 -0
  1451. package/port/src/stashpad.mjs +114 -0
  1452. package/port/src/symbols.mjs +201 -0
  1453. package/port/src/tools.mjs +198 -0
  1454. package/port/src/util.mjs +162 -0
  1455. package/port/src/workspace.mjs +39 -0
  1456. package/port/templates/unity/ReversePortSceneBuilder.cs +258 -0
  1457. package/scripts/electron-active-hook-boundaries.cjs +392 -0
  1458. package/scripts/electron-active-hook.cjs +673 -0
  1459. package/scripts/hopper-demo-x11.py +787 -0
  1460. package/scripts/prepack.mjs +60 -0
  1461. package/scripts/prepare.mjs +28 -0
  1462. package/scripts/rea.mjs +110 -0
  1463. package/scripts/verify-windows-native-artifact.mjs +39 -0
  1464. package/skills/build-inspector/SKILL.md +44 -0
  1465. package/skills/godot-port/SKILL.md +42 -0
  1466. package/skills/port-project/SKILL.md +59 -0
  1467. package/skills/port-verify/SKILL.md +35 -0
  1468. package/skills/proof-case/SKILL.md +52 -0
  1469. package/skills/rebuild/SKILL.md +66 -0
  1470. package/skills/reverse-engineer/SKILL.md +67 -0
  1471. package/skills/reverse-engineer-anything/SKILL.md +204 -0
  1472. package/skills/reverse-engineer-anything/references/android-applications.md +34 -0
  1473. package/skills/reverse-engineer-anything/references/connection-and-recovery.md +130 -0
  1474. package/skills/reverse-engineer-anything/references/evidence-workflows.md +54 -0
  1475. package/skills/reverse-engineer-anything/references/godot-source.md +37 -0
  1476. package/skills/reverse-engineer-anything/references/javascript-applications.md +175 -0
  1477. package/skills/reverse-engineer-anything/references/native-and-artifacts.md +252 -0
  1478. package/skills/reverse-engineer-anything/references/porting-and-rebuilds.md +92 -0
  1479. package/skills/reverse-engineer-anything/references/runtime-observation.md +28 -0
  1480. package/skills/reverse-engineer-anything/references/unity-source.md +32 -0
  1481. package/skills/troubleshoot/SKILL.md +27 -0
  1482. package/skills/unity-to-godot/SKILL.md +37 -0
  1483. package/third_party/README.md +60 -0
  1484. package/third_party/evmole/LICENSE +21 -0
  1485. package/third_party/evmole/README.md +22 -0
  1486. package/third_party/pwndbg/LICENSE.md +21 -0
  1487. package/third_party/pwndbg/README.md +23 -0
  1488. package/third_party/pwntools/README.md +40 -0
  1489. package/third_party/wabt/README.md +24 -0
@@ -0,0 +1,1522 @@
1
+ import { __esmMin } from "./rolldown-runtime-DXoylpqc.js";
2
+ import { PRODUCT_IDENTITY, compareUnicodeCodePoints, err, init_identity, init_result, init_unicodeCodePointOrder, ok } from "./reconstructionObligationLedgerSchemas-dvp6PEnZ.js";
3
+ import { ArtifactReaderFailure, init_ArtifactReader } from "./ArtifactReader-BXkffc1D.js";
4
+ import { ConfigurationError, init_configurationErrors } from "./configurationErrors-ByuF6gMR.js";
5
+ import { clientSkillDirectories, init_SupportedClients, init_environment, parseEnvironment } from "./SupportedClients-BrZ2qZVg.js";
6
+ import { NonRegularFileReadError, RegularFileChangedError, init_RegularFile } from "./RegularFile-CL6meBxi.js";
7
+ import { init_BoundedFileBytes, readBoundedFileBytes } from "./BoundedFileBytes-BU30odTm.js";
8
+ import { RegularFileCleanupFailure, init_RegularFileRead, withRegularFile } from "./RegularFileRead-BMh5FMXd.js";
9
+ import { dirname, join } from "node:path";
10
+ import { z } from "zod";
11
+ import { copyFile, lstat, mkdir, readFile, rm } from "node:fs/promises";
12
+ import { constants } from "node:fs";
13
+ import { isDeepStrictEqual } from "node:util";
14
+ import { isAlias, isMap, isNode, isScalar, isSeq, parse, parseDocument, stringify, visit } from "yaml";
15
+ import writeFileAtomic from "write-file-atomic";
16
+ import { applyEdits, findNodeAtLocation, modify, parse as parse$1, parseTree, printParseErrorCode } from "jsonc-parser";
17
+ import { parse as parse$2, stringify as stringify$1 } from "smol-toml";
18
+
19
+ //#region dist/application/SetupSkill.js
20
+ var MANAGED_SKILL_FILES, isManagedSkillManifest, readSkillFile, readSkillFileState, SetupSkillInstallError, systemSkillInstallFileOperations, skillDestinations, existingSkillDestinations, readOptionalSkillState, canonicalSkillFiles, canonicalSkillNeedsInstall, causeReason, causePath, restoreSkillFiles, installCanonicalSkill, readInstalledSkillIdentity;
21
+ function init_SetupSkill() {
22
+ return (init_SetupSkill = __esmMin((() => {
23
+ init_result();
24
+ init_BoundedFileBytes();
25
+ init_ArtifactReader();
26
+ init_identity();
27
+ init_RegularFile();
28
+ init_RegularFileRead();
29
+ init_SupportedClients();
30
+ MANAGED_SKILL_FILES = [
31
+ "SKILL.md",
32
+ "references/connection-and-recovery.md",
33
+ "references/native-and-artifacts.md",
34
+ "references/javascript-applications.md",
35
+ "references/android-applications.md",
36
+ "references/runtime-observation.md",
37
+ "references/evidence-workflows.md",
38
+ "references/porting-and-rebuilds.md",
39
+ "references/godot-source.md",
40
+ "references/unity-source.md"
41
+ ];
42
+ isManagedSkillManifest = (content) => content.startsWith(`---\nname: ${PRODUCT_IDENTITY.skillName}\n`) || content.startsWith(`---\r\nname: ${PRODUCT_IDENTITY.skillName}\r\n`);
43
+ readSkillFile = (path, resources) => readSkillFileState(path, resources).then(({ content }) => content);
44
+ readSkillFileState = async (path, resources) => withRegularFile(path, async (handle, stats) => {
45
+ const bytes = await readBoundedFileBytes(handle, stats.size, undefined, stats.size);
46
+ if (bytes === undefined || bytes.length !== stats.size) throw new RegularFileChangedError(path);
47
+ return {
48
+ content: bytes.toString("utf8"),
49
+ mode: stats.mode & 4095
50
+ };
51
+ }, {
52
+ symlinks: "reject",
53
+ ...resources === undefined ? {} : { resources }
54
+ });
55
+ SetupSkillInstallError = class extends Error {
56
+ _tag = "SetupSkillInstallError";
57
+ path;
58
+ stage;
59
+ reason;
60
+ rollbackFailures;
61
+ recoveryBackupPaths;
62
+ constructor(input) {
63
+ const message = [`REA skill ${input.stage} failed at ${input.path}: ${input.reason}.`, ...input.rollbackFailures.length === 0 ? [] : [`Rollback also failed for ${input.rollbackFailures.map(({ path, reason }) => `${path} (${reason})`).join(", ")}.`, ...input.recoveryBackupPaths.length === 0 ? [] : [`Existing-file backups remain at ${input.recoveryBackupPaths.join(", ")}.`]]].join(" ");
64
+ super(message, { cause: input.cause });
65
+ this.path = input.path;
66
+ this.stage = input.stage;
67
+ this.reason = input.reason;
68
+ this.rollbackFailures = input.rollbackFailures;
69
+ this.recoveryBackupPaths = input.recoveryBackupPaths;
70
+ }
71
+ get remediation() {
72
+ return `${this.message} Check permissions and rerun setup.`;
73
+ }
74
+ };
75
+ systemSkillInstallFileOperations = {
76
+ mkdir: async (path) => {
77
+ await mkdir(path, { recursive: true });
78
+ },
79
+ backup: async (source, destination) => {
80
+ try {
81
+ await copyFile(source, destination, constants.COPYFILE_EXCL);
82
+ } catch (cause) {
83
+ if (cause instanceof Error && "code" in cause && cause.code === "EEXIST") return;
84
+ throw cause;
85
+ }
86
+ },
87
+ write: (path, content, mode) => writeFileAtomic(path, content, {
88
+ encoding: "utf8",
89
+ mode
90
+ }),
91
+ remove: (path) => rm(path, { force: true })
92
+ };
93
+ skillDestinations = (home, clientIds, environment = {}, platform = process.platform) => clientSkillDirectories(home, clientIds, environment, platform).map(({ client, directory }) => ({
94
+ client,
95
+ path: join(directory, PRODUCT_IDENTITY.skillName)
96
+ }));
97
+ existingSkillDestinations = async (home, environment = {}, platform = process.platform, resources) => {
98
+ const existing = [];
99
+ for (const destination of skillDestinations(home, undefined, environment, platform)) {
100
+ try {
101
+ const root = await lstat(destination.path);
102
+ if (root.isSymbolicLink() || !root.isDirectory()) continue;
103
+ const manifest = join(destination.path, "SKILL.md");
104
+ const content = await readSkillFile(manifest, resources);
105
+ if (isManagedSkillManifest(content)) existing.push(destination);
106
+ } catch (cause) {
107
+ if (cause instanceof Error && "code" in cause && cause.code === "ENOENT") continue;
108
+ if (cause instanceof RegularFileCleanupFailure || cause instanceof ArtifactReaderFailure) throw cause;
109
+ if (cause instanceof NonRegularFileReadError) continue;
110
+ throw cause;
111
+ }
112
+ }
113
+ return existing;
114
+ };
115
+ readOptionalSkillState = async (path, resources) => {
116
+ try {
117
+ return await readSkillFileState(path, resources);
118
+ } catch (cause) {
119
+ if (cause instanceof Error && "code" in cause && cause.code === "ENOENT") return undefined;
120
+ throw cause;
121
+ }
122
+ };
123
+ canonicalSkillFiles = async (home, clientIds, environment = {}, platform = process.platform, resources) => Promise.all(skillDestinations(home, clientIds, environment, platform).flatMap(({ path: root }) => MANAGED_SKILL_FILES.map(async (relativePath) => {
124
+ const destination = join(root, relativePath);
125
+ return {
126
+ destination,
127
+ content: await readFile(new URL(`../../skills/${PRODUCT_IDENTITY.skillName}/${relativePath}`, new URL("../application/SetupSkill.js", import.meta.url).href), "utf8"),
128
+ original: await readOptionalSkillState(destination, resources)
129
+ };
130
+ })));
131
+ canonicalSkillNeedsInstall = async (home, clientIds = [], environment = {}, platform = process.platform, resources) => {
132
+ try {
133
+ return (await canonicalSkillFiles(home, clientIds, environment, platform, resources)).some(({ content, original }) => original?.content !== content);
134
+ } catch (cause) {
135
+ if (cause instanceof RegularFileCleanupFailure || cause instanceof ArtifactReaderFailure) throw cause;
136
+ void cause;
137
+ return true;
138
+ }
139
+ };
140
+ causeReason = (cause) => cause instanceof Error ? cause.message : String(cause);
141
+ causePath = (cause) => cause instanceof Error && "path" in cause && typeof cause.path === "string" ? cause.path : undefined;
142
+ restoreSkillFiles = async (attempted, operations) => {
143
+ const failures = [];
144
+ for (const { destination, original } of [...attempted].reverse()) {
145
+ try {
146
+ if (original === undefined) await operations.remove(destination);
147
+ else await operations.write(destination, original.content, original.mode);
148
+ } catch (cause) {
149
+ failures.push({
150
+ path: destination,
151
+ reason: causeReason(cause)
152
+ });
153
+ }
154
+ }
155
+ return failures;
156
+ };
157
+ installCanonicalSkill = async (home, clientIds = [], environment = {}, platform = process.platform, operations = systemSkillInstallFileOperations, resources) => {
158
+ let attempted = [];
159
+ let stage = "prepare";
160
+ let failingPath = "skill bundle";
161
+ try {
162
+ const canonical = await canonicalSkillFiles(home, clientIds, environment, platform, resources);
163
+ const changed = canonical.filter(({ content, original }) => original?.content !== content);
164
+ if (changed.length === 0) return ok("unchanged");
165
+ stage = "backup";
166
+ for (const { destination, original } of changed) {
167
+ failingPath = destination;
168
+ await operations.mkdir(dirname(destination));
169
+ if (original !== undefined) await operations.backup(destination, `${destination}.rea.backup`);
170
+ }
171
+ stage = "write";
172
+ for (const file of changed) {
173
+ failingPath = file.destination;
174
+ attempted.push(file);
175
+ await operations.write(file.destination, file.content, file.original?.mode ?? 384);
176
+ }
177
+ stage = "readback";
178
+ for (const { destination, content } of changed) {
179
+ failingPath = destination;
180
+ if (await readSkillFile(destination, resources) !== content) throw new Error(`skill readback mismatch: ${destination}`);
181
+ }
182
+ return ok("installed");
183
+ } catch (cause) {
184
+ failingPath = causePath(cause) ?? failingPath;
185
+ const rollbackFailures = await restoreSkillFiles(attempted, operations);
186
+ return err(new SetupSkillInstallError({
187
+ path: failingPath,
188
+ stage,
189
+ reason: causeReason(cause),
190
+ rollbackFailures,
191
+ recoveryBackupPaths: attempted.flatMap(({ destination, original }) => original === undefined ? [] : [`${destination}.rea.backup`]),
192
+ cause
193
+ }));
194
+ }
195
+ };
196
+ readInstalledSkillIdentity = async (home, clientIds, environment = {}, platform = process.platform, resources) => {
197
+ const destinations = skillDestinations(home, clientIds, environment, platform);
198
+ let content;
199
+ for (const destination of destinations) {
200
+ try {
201
+ content = await readSkillFile(join(destination.path, "SKILL.md"), resources);
202
+ break;
203
+ } catch (cause) {
204
+ if (cause instanceof RegularFileCleanupFailure || cause instanceof ArtifactReaderFailure) throw cause;
205
+ }
206
+ }
207
+ if (content === undefined) return undefined;
208
+ const toolCount = /^\s{2}tool_count:\s*(\d+)\s*$/mu.exec(content)?.[1];
209
+ let canonical;
210
+ try {
211
+ canonical = !await canonicalSkillNeedsInstall(home, clientIds, environment, platform, resources);
212
+ } catch (cause) {
213
+ if (!(cause instanceof ArtifactReaderFailure)) throw cause;
214
+ canonical = false;
215
+ }
216
+ return {
217
+ canonical,
218
+ version: /^\s{2}version:\s*"([^"]+)"\s*$/mu.exec(content)?.[1] ?? null,
219
+ toolCount: toolCount === undefined ? null : Number.parseInt(toolCount, 10)
220
+ };
221
+ };
222
+ })))();
223
+ }
224
+
225
+ //#endregion
226
+ //#region dist/application/DshCordisYaml.js
227
+ var CordisExpression, DshCordisYaml;
228
+ function init_DshCordisYaml() {
229
+ return (init_DshCordisYaml = __esmMin((() => {
230
+ init_configurationErrors();
231
+ CordisExpression = class {
232
+ source;
233
+ kind = "cordis-expression";
234
+ constructor(source) {
235
+ this.source = source;
236
+ }
237
+ };
238
+ DshCordisYaml = class {
239
+ document;
240
+ #values = new Map();
241
+ #visiting = new Set();
242
+ constructor(text) {
243
+ this.document = parseDocument(text, {
244
+ customTags: [{
245
+ tag: "tag:yaml.org,2002:js",
246
+ resolve: (source) => source
247
+ }],
248
+ logLevel: "silent"
249
+ });
250
+ if (this.document.errors.length > 0 || this.document.warnings.length > 0) throw new ConfigurationError("Invalid or unsupported Cordis YAML", { cause: this.document.errors[0] ?? this.document.warnings[0] });
251
+ if (this.document.contents === null) this.document.contents = this.document.createNode([]);
252
+ if (!isSeq(this.document.contents)) throw new ConfigurationError("Cordis patches must be a YAML operation list");
253
+ this.value(this.document.contents);
254
+ try {
255
+ this.document.toJS();
256
+ } catch (cause) {
257
+ throw new ConfigurationError("Unsafe Cordis YAML alias expansion", { cause });
258
+ }
259
+ }
260
+ resolve(node) {
261
+ if (!isAlias(node)) return node;
262
+ const resolved = node.resolve(this.document);
263
+ if (resolved === undefined) throw new ConfigurationError("Cordis YAML contains an unresolved alias");
264
+ return resolved;
265
+ }
266
+ value(node) {
267
+ const resolved = this.resolve(node);
268
+ if (!isNode(resolved)) return resolved;
269
+ if (this.#values.has(resolved)) return this.#values.get(resolved);
270
+ if (this.#visiting.has(resolved)) throw new ConfigurationError("Cyclic Cordis YAML cannot be safely edited");
271
+ this.#visiting.add(resolved);
272
+ let value;
273
+ if (isScalar(resolved)) value = resolved.tag === "tag:yaml.org,2002:js" ? new CordisExpression(String(resolved.value)) : resolved.value;
274
+ else if (isSeq(resolved)) value = resolved.items.map((item) => this.value(item));
275
+ else if (isMap(resolved)) {
276
+ const entries = [];
277
+ for (const pair of resolved.items) {
278
+ entries.push([this.#key(pair.key), this.value(pair.value)]);
279
+ }
280
+ value = Object.fromEntries(entries);
281
+ }
282
+ this.#visiting.delete(resolved);
283
+ this.#values.set(resolved, value);
284
+ return value;
285
+ }
286
+ #key(node) {
287
+ const key = this.value(node);
288
+ if (typeof key === "object" && key !== null) throw new ConfigurationError("Cordis YAML mapping keys must be literal scalars");
289
+ return key === null ? "" : String(key);
290
+ }
291
+ field(map, key) {
292
+ return map?.items.findLast((pair) => this.#key(pair.key) === key)?.value;
293
+ }
294
+ /** Preserve unchanged nodes and carry their comments when replacing values. */
295
+ setValue(map, key, value) {
296
+ const original = this.field(map, key);
297
+ if (isDeepStrictEqual(this.value(original), value)) return;
298
+ const replacement = this.document.createNode(value);
299
+ if (isNode(original) && isNode(replacement)) {
300
+ if (original.comment !== undefined) replacement.comment = original.comment;
301
+ if (original.commentBefore !== undefined) replacement.commentBefore = original.commentBefore;
302
+ }
303
+ map.set(key, replacement);
304
+ }
305
+ /** Copy from the source before edits; materialized nodes own no anchors. */
306
+ copy(node, invalidated) {
307
+ if (isAlias(node)) {
308
+ const target = this.resolve(node);
309
+ return invalidated === undefined || isNode(target) && invalidated.has(target) ? this.copy(target) : node.clone();
310
+ }
311
+ if (!isNode(node)) return node;
312
+ const copied = node.clone();
313
+ if ((invalidated === undefined || invalidated.has(node)) && (isScalar(copied) || isMap(copied) || isSeq(copied))) delete copied.anchor;
314
+ if (isSeq(node) && isSeq(copied)) copied.items = node.items.map((item) => this.copy(item, invalidated));
315
+ if (isMap(node) && isMap(copied)) copied.items.forEach((pair, index) => {
316
+ pair.key = this.copy(node.items[index].key, invalidated);
317
+ pair.value = this.copy(node.items[index].value, invalidated);
318
+ });
319
+ return copied;
320
+ }
321
+ /** Replacing an anchor must not change untouched consumers of its old value. */
322
+ detach(node, invalidated) {
323
+ const copied = this.copy(node, invalidated);
324
+ if (isNode(copied)) visit(copied, {
325
+ Pair: (_key, pair) => {
326
+ if (isAlias(pair.key)) pair.key = this.copy(this.resolve(pair.key));
327
+ },
328
+ Value: (_key, value) => {
329
+ delete value.anchor;
330
+ }
331
+ });
332
+ return copied;
333
+ }
334
+ anchors(node) {
335
+ if (!isNode(node)) return [];
336
+ const anchors = [];
337
+ visit(node, { Value: (_key, value) => {
338
+ if (value.anchor) anchors.push(value);
339
+ } });
340
+ return anchors;
341
+ }
342
+ };
343
+ })))();
344
+ }
345
+
346
+ //#endregion
347
+ //#region dist/application/DshCordisPatch.js
348
+ var DSH_ENTRY_ID, DSH_CLIENT_PACKAGE, LAUNCHER_KEYS, isRecord, DshCordisDocument, DshCordisEdit, dshDocument, parseDshCordisDocument, editDshDocument, serializeDshDocument, dshClientRegistrationEntry;
349
+ function init_DshCordisPatch() {
350
+ return (init_DshCordisPatch = __esmMin((() => {
351
+ init_environment();
352
+ init_configurationErrors();
353
+ init_result();
354
+ init_DshCordisYaml();
355
+ DSH_ENTRY_ID = "rea-mcp";
356
+ DSH_CLIENT_PACKAGE = "@deepseek-ai/dsh-mcp-client";
357
+ LAUNCHER_KEYS = new Set([
358
+ "serverName",
359
+ "transport",
360
+ "command",
361
+ "args"
362
+ ]);
363
+ isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value) && !(value instanceof CordisExpression);
364
+ DshCordisDocument = class {
365
+ #yaml;
366
+ #operations;
367
+ #fields = new Map();
368
+ #entryNode;
369
+ #insertions;
370
+ #unknownSelector = false;
371
+ #unknownStructure = false;
372
+ #editabilityError;
373
+ config;
374
+ constructor(text) {
375
+ this.#yaml = new DshCordisYaml(text);
376
+ const root = this.#yaml.document.contents;
377
+ if (!isSeq(root)) throw new ConfigurationError("Cordis patches must be a list");
378
+ const operations = [];
379
+ let insertions = 0;
380
+ let malformedStructure = false;
381
+ for (const source of root.items) {
382
+ const map = this.#map(source);
383
+ if (map === undefined) {
384
+ if (this.#yaml.value(source) instanceof CordisExpression) this.#unknownStructure = true;
385
+ else malformedStructure = true;
386
+ continue;
387
+ }
388
+ const inserted = this.#yaml.resolve(this.#yaml.field(map, "insert"));
389
+ const targetId = this.#id(map);
390
+ const unknownApplicability = targetId !== undefined;
391
+ const insertedValue = this.#yaml.value(inserted);
392
+ const invalidEntries = isSeq(inserted) ? inserted.items.filter((entry) => this.#map(entry) === undefined) : [];
393
+ if (insertedValue instanceof CordisExpression || invalidEntries.some((entry) => this.#yaml.value(entry) instanceof CordisExpression)) this.#unknownStructure = true;
394
+ else if (insertedValue != null && !isSeq(inserted)) malformedStructure = true;
395
+ else if (invalidEntries.length > 0) malformedStructure = true;
396
+ const ownedRows = isSeq(inserted) ? inserted.items.flatMap((entry, index) => this.#id(entry) === "rea-mcp" ? [index] : []) : [];
397
+ const direct = !isSeq(inserted) && targetId === "rea-mcp";
398
+ operations.push({
399
+ source,
400
+ map,
401
+ ownedRows,
402
+ direct,
403
+ unknownApplicability
404
+ });
405
+ if (isSeq(inserted)) {
406
+ for (const index of ownedRows) {
407
+ const entry = this.#map(inserted.items[index]);
408
+ if (entry === undefined) continue;
409
+ insertions += 1;
410
+ this.#entryNode = entry;
411
+ this.#fields.clear();
412
+ this.#unknownSelector = false;
413
+ this.#readFields(entry);
414
+ }
415
+ } else if (direct) {
416
+ if (insertions === 0) continue;
417
+ const selector = this.#yaml.value(this.#yaml.field(map, "name"));
418
+ if (selector instanceof CordisExpression || selector && this.#field("name") instanceof CordisExpression) {
419
+ this.#unknownSelector = true;
420
+ continue;
421
+ }
422
+ if (selector && selector !== this.#field("name")) continue;
423
+ this.#readFields(map, new Set(["id", "name"]));
424
+ }
425
+ }
426
+ this.#operations = operations;
427
+ this.#insertions = insertions;
428
+ this.#editabilityError = this.#unknownStructure ? new ConfigurationError("Expression-backed Cordis patches have unknown structure; use literal patches before setup") : malformedStructure ? new ConfigurationError("Malformed Cordis patches cannot be edited safely; use mapping entries and insert lists before setup") : operations.some((op) => op.unknownApplicability && op.ownedRows.length > 0) ? new ConfigurationError("Cordis REA insertion targets a group with unknown activity; use a direct insertion before setup") : this.#unknownSelector ? new ConfigurationError("Expression-backed Cordis name selectors have unknown applicability; use literal selectors before setup", { settings: [{
429
+ setting: "name",
430
+ constraint: "Use literal selectors before setup"
431
+ }] }) : undefined;
432
+ const config = this.#field("config");
433
+ this.config = insertions === 0 ? undefined : isRecord(config) ? config : {};
434
+ }
435
+ #map(node) {
436
+ const map = this.#yaml.resolve(node);
437
+ return isMap(map) ? map : undefined;
438
+ }
439
+ #id(node) {
440
+ const id = this.#yaml.value(this.#yaml.field(this.#map(node), "id"));
441
+ if (id instanceof CordisExpression) throw new ConfigurationError("Expression-backed Cordis IDs have unknown ownership; use literal IDs before changing registrations");
442
+ return id;
443
+ }
444
+ #field(key) {
445
+ return this.#yaml.value(this.#fields.get(key));
446
+ }
447
+ #readFields(map, omitted = new Set()) {
448
+ for (const pair of map.items) {
449
+ const key = this.#yaml.value(pair.key);
450
+ if (typeof key === "string" && !omitted.has(key)) this.#fields.set(key, pair.value);
451
+ }
452
+ }
453
+ get carriesEntry() {
454
+ return this.#operations.some((op) => op.direct || op.ownedRows.length > 0);
455
+ }
456
+ get hasUnknownStructure() {
457
+ return this.#unknownStructure;
458
+ }
459
+ get editabilityError() {
460
+ return this.#editabilityError;
461
+ }
462
+ get ready() {
463
+ const disabled = this.#field("disabled");
464
+ return this.#insertions === 1 && this.#editabilityError === undefined && this.#field("name") === "@deepseek-ai/dsh-mcp-client" && (disabled === undefined || disabled === false);
465
+ }
466
+ /** Validate literals without treating expression source as an environment value. */
467
+ environment(overrides = {}) {
468
+ const config = this.#field("config");
469
+ if (config instanceof CordisExpression) return err(new ConfigurationError("Expression-backed Cordis config cannot be safely edited", { settings: [{
470
+ setting: "config",
471
+ constraint: "Use a literal mapping to preserve caller fields during setup"
472
+ }] }));
473
+ if (config !== undefined && !isRecord(config)) return err(new ConfigurationError("Cordis REA config must be a mapping", { settings: [{
474
+ setting: "config",
475
+ constraint: "Use a literal mapping before setup"
476
+ }] }));
477
+ const raw = this.config?.env;
478
+ if (raw !== undefined && !isRecord(raw)) return err(new ConfigurationError("Cordis server environment must be a mapping"));
479
+ const literals = {};
480
+ for (const [key, value] of Object.entries(raw ?? {})) {
481
+ if (value instanceof CordisExpression) continue;
482
+ if (typeof value !== "string") return err(new ConfigurationError("Invalid Cordis server environment", { settings: [{
483
+ setting: `env.${key}`,
484
+ constraint: "Environment values must be strings or Cordis expressions"
485
+ }] }));
486
+ literals[key] = value;
487
+ }
488
+ const environment = {
489
+ ...literals,
490
+ ...overrides
491
+ };
492
+ const validated = parseEnvironment(environment);
493
+ return validated.ok ? ok(environment) : validated;
494
+ }
495
+ desired(command, overrides) {
496
+ if (this.#editabilityError !== undefined) return err(this.#editabilityError);
497
+ const environment = this.environment(overrides);
498
+ if (!environment.ok) return environment;
499
+ const env = {
500
+ ...isRecord(this.config?.env) ? this.config.env : {},
501
+ ...overrides
502
+ };
503
+ const desired = {
504
+ ...this.config,
505
+ ...dshClientRegistrationEntry(command)
506
+ };
507
+ delete desired.env;
508
+ if (Object.keys(env).length > 0) desired.env = env;
509
+ return ok(desired);
510
+ }
511
+ /** Plan every replacement from source snapshots before changing an output tree. */
512
+ serialize(desired) {
513
+ if (this.#editabilityError !== undefined && (this.#unknownStructure || desired !== undefined)) throw this.#editabilityError;
514
+ const root = this.#yaml.document.contents;
515
+ if (!isSeq(root)) throw new ConfigurationError("Cordis patches must be a list");
516
+ const replacements = new Map();
517
+ const invalidated = new Set(this.#operations.flatMap((op) => op.direct || op.ownedRows.length > 0 ? this.#yaml.anchors(op.source) : []));
518
+ let carried = false;
519
+ for (const op of this.#operations) {
520
+ if (op.direct) {
521
+ replacements.set(op.source, undefined);
522
+ continue;
523
+ }
524
+ if (op.ownedRows.length === 0) continue;
525
+ const copy = this.#yaml.detach(op.map, invalidated);
526
+ if (!isMap(copy)) throw new ConfigurationError("Cordis operation is not a mapping");
527
+ const inserted = this.#yaml.detach(this.#yaml.resolve(this.#yaml.field(op.map, "insert")), invalidated);
528
+ if (!isSeq(inserted)) throw new ConfigurationError("Cordis insertion is not a list");
529
+ copy.set("insert", inserted);
530
+ const owned = new Set(op.ownedRows);
531
+ inserted.items = inserted.items.flatMap((entry, index) => {
532
+ if (!owned.has(index)) return [entry];
533
+ if (carried || desired === undefined) return [];
534
+ carried = true;
535
+ return [this.#entry(desired, invalidated)];
536
+ });
537
+ replacements.set(op.source, inserted.items.length === 0 ? undefined : copy);
538
+ }
539
+ const output = this.#yaml.document.clone();
540
+ const outputRoot = output.contents;
541
+ if (!isSeq(outputRoot)) throw new ConfigurationError("Cordis patches must be a list");
542
+ outputRoot.items = root.items.flatMap((source) => {
543
+ const copy = replacements.has(source) ? replacements.get(source) : this.#yaml.copy(source, invalidated);
544
+ return copy === undefined ? [] : [copy];
545
+ });
546
+ if (!carried && desired !== undefined) outputRoot.items.push(output.createNode({ insert: [{
547
+ id: DSH_ENTRY_ID,
548
+ name: DSH_CLIENT_PACKAGE,
549
+ config: desired
550
+ }] }));
551
+ return output.toString({ lineWidth: 0 });
552
+ }
553
+ #entry(desired, invalidated) {
554
+ const entry = this.#yaml.detach(this.#entryNode, invalidated);
555
+ if (!isMap(entry)) throw new ConfigurationError("Cordis entry is not a mapping");
556
+ this.#yaml.setValue(entry, "id", DSH_ENTRY_ID);
557
+ this.#yaml.setValue(entry, "name", DSH_CLIENT_PACKAGE);
558
+ entry.delete("disabled");
559
+ for (const [key, value] of this.#fields) {
560
+ if ([
561
+ "id",
562
+ "name",
563
+ "config",
564
+ "disabled"
565
+ ].includes(key)) continue;
566
+ entry.set(key, this.#yaml.detach(value, invalidated));
567
+ }
568
+ const sourceConfig = this.#map(this.#fields.get("config"));
569
+ const config = sourceConfig === undefined ? this.#yaml.document.createNode({}) : this.#yaml.detach(sourceConfig, invalidated);
570
+ if (!isMap(config)) throw new ConfigurationError("Cordis registration config is not a mapping");
571
+ for (const key of LAUNCHER_KEYS) this.#yaml.setValue(config, key, desired[key]);
572
+ const env = this.#map(this.#yaml.field(sourceConfig, "env"));
573
+ const desiredEnv = desired.env;
574
+ if (isRecord(desiredEnv)) {
575
+ const nextEnv = env === undefined ? this.#yaml.document.createNode({}) : this.#yaml.detach(env, invalidated);
576
+ if (!isMap(nextEnv)) throw new ConfigurationError("Cordis environment is not a mapping");
577
+ for (const [key, value] of Object.entries(desiredEnv)) {
578
+ this.#yaml.setValue(nextEnv, key, value);
579
+ }
580
+ config.set("env", nextEnv);
581
+ } else config.delete("env");
582
+ entry.set("config", config);
583
+ return entry;
584
+ }
585
+ };
586
+ DshCordisEdit = class {
587
+ source;
588
+ desired;
589
+ constructor(source, desired) {
590
+ this.source = source;
591
+ this.desired = desired;
592
+ }
593
+ };
594
+ dshDocument = (document) => {
595
+ if (!(document.cordis instanceof DshCordisDocument)) throw new ConfigurationError("Missing Cordis document owner");
596
+ return document.cordis;
597
+ };
598
+ parseDshCordisDocument = (text) => {
599
+ const source = new DshCordisDocument(text);
600
+ return {
601
+ document: { cordis: source },
602
+ servers: source.config === undefined ? {} : { rea: source.config },
603
+ serversPath: [],
604
+ dialect: "dsh",
605
+ legacyServers: {}
606
+ };
607
+ };
608
+ editDshDocument = (parsed, desired) => ({ cordis: new DshCordisEdit(dshDocument(parsed.document), desired) });
609
+ serializeDshDocument = (document) => {
610
+ if (!(document.cordis instanceof DshCordisEdit)) throw new ConfigurationError("Missing Cordis edit plan");
611
+ return document.cordis.source.serialize(document.cordis.desired);
612
+ };
613
+ dshClientRegistrationEntry = (command, environment = {}) => {
614
+ const [executable = "rea", ...args] = command;
615
+ return {
616
+ serverName: "rea",
617
+ transport: "stdio",
618
+ command: executable,
619
+ args,
620
+ ...Object.keys(environment).length === 0 ? {} : { env: { ...environment } }
621
+ };
622
+ };
623
+ })))();
624
+ }
625
+
626
+ //#endregion
627
+ //#region dist/application/ClientConfigurationDocument.js
628
+ var objectSchema, clientConfigurationValuesEqual, normalizeConfigurationValue, clientConfigurationServersKey, isEmptyClientConfigurationText, parseDocument$1, OPENCODE_V2_MCP_SETTINGS, parseClientConfiguration, effectiveClientServer, withClientServers, valueAt, TOML_BASIC_ESCAPES, skipHorizontalSpace, decodeBasicEscape, parseQuotedKey, parseBareKey, parseTomlTableHeader, tomlStringModeAfter, closeMultiline, isBlankOrComment, looksLikeTomlHeader, isTomlServerTable, parseKeyPath, parseAssignment, skipWsAndComments, endOfTomlValue, endOfContainer, tomlBasicString, tomlInlineKey, tomlInlineValue, readTrivia, commasOutsideComments, hasSeparatorComma, editInlineServerTable, rebuildInlineTable, rebuildDelimitedEntries, tomlStringValue, tomlArrayWithoutString, disabledServerListEdit, disabledServerListLines, upsertTomlServerSection, tomlServerEntry, grokServerListedDisabled, OMP_DISABLED_SERVERS_KEY, ompServerListedDisabled, OMP_ENABLED_SERVERS_KEY, clientServerForcedEnabled, clientServerListedDisabled, serializeGrokConfiguration, withoutEmptyServerTable, serializeCodexConfiguration, tomlTextHolds, commentsBetweenProperties, deleteJsonPropertyPreservingComments, serializeClientConfiguration, clientServerPath, legacyClientServerPath, serializeHermesConfiguration, clientRegistrationEntry, parseGeminiMcpPolicy, geminiServerPolicyBlock;
629
+ function init_ClientConfigurationDocument() {
630
+ return (init_ClientConfigurationDocument = __esmMin((() => {
631
+ init_DshCordisPatch();
632
+ init_identity();
633
+ init_unicodeCodePointOrder();
634
+ objectSchema = z.record(z.string(), z.unknown());
635
+ clientConfigurationValuesEqual = (left, right) => isDeepStrictEqual(normalizeConfigurationValue(left), normalizeConfigurationValue(right));
636
+ normalizeConfigurationValue = (value) => {
637
+ if (Array.isArray(value)) return value.map(normalizeConfigurationValue);
638
+ if (typeof value !== "object" || value === null || value instanceof Date) return value;
639
+ return Object.fromEntries(Object.entries(value).sort(([left], [right]) => compareUnicodeCodePoints(left, right)).map(([key, nested]) => [key, normalizeConfigurationValue(nested)]));
640
+ };
641
+ clientConfigurationServersKey = (format) => {
642
+ switch (format) {
643
+ case "toml":
644
+ case "grok":
645
+ case "hermes": return "mcp_servers";
646
+ case "opencode": return "mcp";
647
+ case "vscode": return "servers";
648
+ default: return "mcpServers";
649
+ }
650
+ };
651
+ isEmptyClientConfigurationText = (text) => text.replace(/^\uFEFF/, "").trim() === "";
652
+ parseDocument$1 = (text, format) => {
653
+ if (format === "toml" || format === "grok") return objectSchema.parse(parse$2(text));
654
+ if (format === "pi") return objectSchema.parse(JSON.parse(text));
655
+ if (isEmptyClientConfigurationText(text)) return {};
656
+ if (format === "hermes") return objectSchema.parse(parse(text));
657
+ const errors = [];
658
+ const jsonText = text.startsWith("") ? ` ${text.slice(1)}` : text;
659
+ const document = parse$1(jsonText, errors, { allowTrailingComma: true });
660
+ const firstError = errors[0];
661
+ if (firstError !== undefined) throw new SyntaxError(`Invalid JSON/JSONC at offset ${firstError.offset}: ${printParseErrorCode(firstError.error)}`);
662
+ return objectSchema.parse(document);
663
+ };
664
+ OPENCODE_V2_MCP_SETTINGS = new Set(["servers", "timeout"]);
665
+ parseClientConfiguration = (text, format) => {
666
+ if (format === undefined || format === "unsupported") throw new TypeError("client does not have a supported MCP config format");
667
+ if (format === "dsh") return parseDshCordisDocument(text);
668
+ const document = parseDocument$1(text, format);
669
+ const serversKey = clientConfigurationServersKey(format);
670
+ const value = document[serversKey];
671
+ const servers = value === undefined ? {} : objectSchema.parse(value);
672
+ const native = servers.servers;
673
+ if (format !== "opencode" || native === undefined || typeof native === "object" && native !== null && "type" in native && typeof native.type === "string") return {
674
+ document,
675
+ servers,
676
+ serversPath: [serversKey],
677
+ dialect: format,
678
+ legacyServers: {}
679
+ };
680
+ return {
681
+ document,
682
+ servers: objectSchema.parse(native),
683
+ serversPath: [serversKey, "servers"],
684
+ dialect: "opencode_v2",
685
+ legacyServers: Object.fromEntries(Object.entries(servers).filter(([name]) => !OPENCODE_V2_MCP_SETTINGS.has(name)))
686
+ };
687
+ };
688
+ effectiveClientServer = (parsed, name) => Object.hasOwn(parsed.servers, name) ? parsed.servers[name] : parsed.legacyServers[name];
689
+ withClientServers = (parsed, servers, removeLegacy) => {
690
+ if (parsed.dialect === "dsh") return Object.hasOwn(servers, PRODUCT_IDENTITY.mcpServerKey) ? editDshDocument(parsed, objectSchema.parse(servers[PRODUCT_IDENTITY.mcpServerKey])) : editDshDocument(parsed);
691
+ const [key = "", nested] = parsed.serversPath;
692
+ if (nested === undefined) return {
693
+ ...parsed.document,
694
+ [key]: servers
695
+ };
696
+ const outer = { ...objectSchema.parse(parsed.document[key]) };
697
+ if (removeLegacy !== undefined && !OPENCODE_V2_MCP_SETTINGS.has(removeLegacy)) delete outer[removeLegacy];
698
+ return {
699
+ ...parsed.document,
700
+ [key]: {
701
+ ...outer,
702
+ [nested]: servers
703
+ }
704
+ };
705
+ };
706
+ valueAt = (document, path) => {
707
+ let current = document;
708
+ for (const key of path) {
709
+ const object = objectSchema.safeParse(current);
710
+ if (!object.success || !Object.hasOwn(object.data, key)) return undefined;
711
+ current = object.data[key];
712
+ }
713
+ return current;
714
+ };
715
+ TOML_BASIC_ESCAPES = {
716
+ b: "\b",
717
+ t: " ",
718
+ n: "\n",
719
+ f: "\f",
720
+ r: "\r",
721
+ e: "\x1B",
722
+ "\"": "\"",
723
+ "\\": "\\"
724
+ };
725
+ skipHorizontalSpace = (line, index) => {
726
+ let next = index;
727
+ while (line[next] === " " || line[next] === " ") next += 1;
728
+ return next;
729
+ };
730
+ decodeBasicEscape = (line, slash) => {
731
+ const escape = line[slash + 1];
732
+ if (escape === undefined) return undefined;
733
+ const simple = TOML_BASIC_ESCAPES[escape];
734
+ if (simple !== undefined) return {
735
+ value: simple,
736
+ next: slash + 2
737
+ };
738
+ if (escape === "x") {
739
+ const hex = line.slice(slash + 2, slash + 4);
740
+ if (!/^[0-9A-Fa-f]{2}$/u.test(hex)) return undefined;
741
+ return {
742
+ value: String.fromCodePoint(Number.parseInt(hex, 16)),
743
+ next: slash + 4
744
+ };
745
+ }
746
+ if (escape !== "u" && escape !== "U") return undefined;
747
+ const length = escape === "u" ? 4 : 8;
748
+ const hex = line.slice(slash + 2, slash + 2 + length);
749
+ if (!new RegExp(`^[0-9A-Fa-f]{${String(length)}}$`, "u").test(hex)) return undefined;
750
+ const code = Number.parseInt(hex, 16);
751
+ if (code > 1114111 || code >= 55296 && code <= 57343) return undefined;
752
+ return {
753
+ value: String.fromCodePoint(code),
754
+ next: slash + 2 + length
755
+ };
756
+ };
757
+ parseQuotedKey = (line, start) => {
758
+ const quote = line[start];
759
+ if (quote !== "\"" && quote !== "'" || line.startsWith(quote === "\"" ? "\"\"\"" : "'''", start)) return undefined;
760
+ if (quote === "'") {
761
+ const end = line.indexOf("'", start + 1);
762
+ if (end < 0 || line.slice(start + 1, end).includes("\n")) return undefined;
763
+ return {
764
+ value: line.slice(start + 1, end),
765
+ next: end + 1
766
+ };
767
+ }
768
+ let value = "";
769
+ let index = start + 1;
770
+ while (index < line.length) {
771
+ const char = line[index];
772
+ if (char === "\n" || char === "\r") return undefined;
773
+ if (char === "\"") return {
774
+ value,
775
+ next: index + 1
776
+ };
777
+ if (char !== "\\") {
778
+ value += char ?? "";
779
+ index += 1;
780
+ continue;
781
+ }
782
+ const decoded = decodeBasicEscape(line, index);
783
+ if (decoded === undefined) return undefined;
784
+ value += decoded.value;
785
+ index = decoded.next;
786
+ }
787
+ return undefined;
788
+ };
789
+ parseBareKey = (line, start) => {
790
+ let index = start;
791
+ while (/[A-Za-z0-9_-]/u.test(line[index] ?? "")) index += 1;
792
+ if (index === start) return undefined;
793
+ return {
794
+ value: line.slice(start, index),
795
+ next: index
796
+ };
797
+ };
798
+ parseTomlTableHeader = (line) => {
799
+ let index = skipHorizontalSpace(line, 0);
800
+ const array = line.startsWith("[[", index);
801
+ if (!array && line[index] !== "[") return undefined;
802
+ index += array ? 2 : 1;
803
+ const path = [];
804
+ for (;;) {
805
+ index = skipHorizontalSpace(line, index);
806
+ const key = line[index] === "\"" || line[index] === "'" ? parseQuotedKey(line, index) : parseBareKey(line, index);
807
+ if (key === undefined) return undefined;
808
+ path.push(key.value);
809
+ index = skipHorizontalSpace(line, key.next);
810
+ if (line[index] !== ".") break;
811
+ index += 1;
812
+ }
813
+ const close = array ? "]]" : "]";
814
+ if (!line.startsWith(close, index)) return undefined;
815
+ index = skipHorizontalSpace(line, index + close.length);
816
+ if (index < line.length && line[index] !== "#") return undefined;
817
+ return { path };
818
+ };
819
+ tomlStringModeAfter = (line, mode, start = 0) => {
820
+ if (mode === "ml-basic" || mode === "ml-literal") {
821
+ const delimiter = mode === "ml-basic" ? "\"\"\"" : "'''";
822
+ const closed = closeMultiline(line, start, delimiter, mode === "ml-basic");
823
+ if (closed === undefined) return mode;
824
+ return tomlStringModeAfter(line, "none", closed);
825
+ }
826
+ let index = start;
827
+ while (index < line.length) {
828
+ if (line[index] === "#") return "none";
829
+ if (line.startsWith("\"\"\"", index)) {
830
+ const closed = closeMultiline(line, index + 3, "\"\"\"", true);
831
+ if (closed === undefined) return "ml-basic";
832
+ index = closed;
833
+ continue;
834
+ }
835
+ if (line.startsWith("'''", index)) {
836
+ const closed = closeMultiline(line, index + 3, "'''", false);
837
+ if (closed === undefined) return "ml-literal";
838
+ index = closed;
839
+ continue;
840
+ }
841
+ const quote = line[index];
842
+ if (quote === "\"" || quote === "'") {
843
+ const quoted = parseQuotedKey(line, index);
844
+ if (quoted === undefined) return "none";
845
+ index = quoted.next;
846
+ continue;
847
+ }
848
+ index += 1;
849
+ }
850
+ return "none";
851
+ };
852
+ closeMultiline = (line, start, delimiter, escapes) => {
853
+ let index = start;
854
+ while (index < line.length) {
855
+ if (escapes && line[index] === "\\") {
856
+ if (line[index + 1] === undefined) return undefined;
857
+ index += 2;
858
+ continue;
859
+ }
860
+ if (line.startsWith(delimiter, index)) {
861
+ let end = index + delimiter.length;
862
+ const quote = delimiter[0];
863
+ let extra = 0;
864
+ while (extra < 2 && line[end] === quote) {
865
+ extra += 1;
866
+ end += 1;
867
+ }
868
+ return end;
869
+ }
870
+ index += 1;
871
+ }
872
+ return undefined;
873
+ };
874
+ isBlankOrComment = (line) => {
875
+ const trimmed = line.trimStart();
876
+ return trimmed === "" || trimmed.startsWith("#");
877
+ };
878
+ looksLikeTomlHeader = (line) => line.trimStart().startsWith("[");
879
+ isTomlServerTable = (path, serverKey) => path[0] === "mcp_servers" && path[1] === serverKey;
880
+ parseKeyPath = (text, start) => {
881
+ const segments = [];
882
+ let index = start;
883
+ for (;;) {
884
+ index = skipHorizontalSpace(text, index);
885
+ const current = text[index];
886
+ if (current === undefined || current === "\n" || current === "\r") return undefined;
887
+ const key = current === "\"" || current === "'" ? parseQuotedKey(text, index) : parseBareKey(text, index);
888
+ if (key === undefined) return undefined;
889
+ segments.push(key.value);
890
+ index = skipHorizontalSpace(text, key.next);
891
+ if (text[index] !== ".") return {
892
+ segments,
893
+ next: index
894
+ };
895
+ index += 1;
896
+ }
897
+ };
898
+ parseAssignment = (line) => {
899
+ const key = parseKeyPath(line, 0);
900
+ if (key === undefined) return undefined;
901
+ const equals = skipHorizontalSpace(line, key.next);
902
+ if (line[equals] !== "=") return undefined;
903
+ return {
904
+ segments: key.segments,
905
+ equals
906
+ };
907
+ };
908
+ skipWsAndComments = (text, start) => {
909
+ let index = start;
910
+ while (index < text.length) {
911
+ const char = text[index];
912
+ if (char === " " || char === " " || char === "\n" || char === "\r") {
913
+ index += 1;
914
+ continue;
915
+ }
916
+ if (char === "#") {
917
+ while (index < text.length && text[index] !== "\n") index += 1;
918
+ continue;
919
+ }
920
+ return index;
921
+ }
922
+ return index;
923
+ };
924
+ endOfTomlValue = (text, start) => {
925
+ const index = skipWsAndComments(text, start);
926
+ if (index >= text.length) return index;
927
+ if (text.startsWith("\"\"\"", index)) {
928
+ const closed = closeMultiline(text, index + 3, "\"\"\"", true);
929
+ return closed ?? text.length;
930
+ }
931
+ if (text.startsWith("'''", index)) {
932
+ const closed = closeMultiline(text, index + 3, "'''", false);
933
+ return closed ?? text.length;
934
+ }
935
+ const quote = text[index];
936
+ if (quote === "\"" || quote === "'") {
937
+ const quoted = parseQuotedKey(text, index);
938
+ return quoted === undefined ? text.length : quoted.next;
939
+ }
940
+ if (quote === "{" || quote === "[") return endOfContainer(text, index);
941
+ let cursor = index;
942
+ while (cursor < text.length) {
943
+ const char = text[cursor];
944
+ if (char === "\n" || char === "#" || char === "," || char === "}" || char === "]") break;
945
+ cursor += 1;
946
+ }
947
+ return cursor;
948
+ };
949
+ endOfContainer = (text, open) => {
950
+ const closers = [text[open] === "{" ? "}" : "]"];
951
+ let index = open + 1;
952
+ while (index < text.length && closers.length > 0) {
953
+ if (text.startsWith("\"\"\"", index)) {
954
+ const closed = closeMultiline(text, index + 3, "\"\"\"", true);
955
+ if (closed === undefined) return text.length;
956
+ index = closed;
957
+ continue;
958
+ }
959
+ if (text.startsWith("'''", index)) {
960
+ const closed = closeMultiline(text, index + 3, "'''", false);
961
+ if (closed === undefined) return text.length;
962
+ index = closed;
963
+ continue;
964
+ }
965
+ const quote = text[index];
966
+ if (quote === "\"" || quote === "'") {
967
+ const quoted = parseQuotedKey(text, index);
968
+ if (quoted === undefined) return text.length;
969
+ index = quoted.next;
970
+ continue;
971
+ }
972
+ if (quote === "#") {
973
+ while (index < text.length && text[index] !== "\n") index += 1;
974
+ continue;
975
+ }
976
+ if (quote === "{" || quote === "[") {
977
+ closers.push(quote === "{" ? "}" : "]");
978
+ index += 1;
979
+ continue;
980
+ }
981
+ if (quote === closers[closers.length - 1]) {
982
+ closers.pop();
983
+ index += 1;
984
+ continue;
985
+ }
986
+ index += 1;
987
+ }
988
+ return index;
989
+ };
990
+ tomlBasicString = (value) => JSON.stringify(value).replaceAll("", "\\u007f");
991
+ tomlInlineKey = (key) => /^[A-Za-z0-9_-]+$/u.test(key) ? key : tomlBasicString(key);
992
+ tomlInlineValue = (value) => {
993
+ if (typeof value === "string") return tomlBasicString(value);
994
+ if (typeof value === "boolean") return value ? "true" : "false";
995
+ if (typeof value === "number" && Number.isFinite(value)) return String(value);
996
+ if (Array.isArray(value)) return `[${value.map((item) => tomlInlineValue(item)).join(", ")}]`;
997
+ if (typeof value === "object" && value !== null) {
998
+ const body = Object.entries(value).map(([key, nested]) => `${tomlInlineKey(key)} = ${tomlInlineValue(nested)}`).join(", ");
999
+ return `{ ${body} }`;
1000
+ }
1001
+ return "\"\"";
1002
+ };
1003
+ readTrivia = (text, start, limit) => {
1004
+ let index = start;
1005
+ while (index < limit) {
1006
+ const char = text[index];
1007
+ if (char === " " || char === " " || char === "\n" || char === "\r" || char === ",") {
1008
+ index += 1;
1009
+ continue;
1010
+ }
1011
+ if (char === "#") {
1012
+ while (index < limit && text[index] !== "\n") index += 1;
1013
+ continue;
1014
+ }
1015
+ break;
1016
+ }
1017
+ return {
1018
+ text: text.slice(start, index),
1019
+ next: index
1020
+ };
1021
+ };
1022
+ commasOutsideComments = (trivia) => trivia.split("\n").map((part) => {
1023
+ const comment = part.indexOf("#");
1024
+ if (comment < 0) return part.replaceAll(",", "");
1025
+ return `${part.slice(0, comment).replaceAll(",", "")}${part.slice(comment)}`;
1026
+ }).join("\n");
1027
+ hasSeparatorComma = (trivia) => trivia.split("\n").some((part) => {
1028
+ const comment = part.indexOf("#");
1029
+ const code = comment < 0 ? part : part.slice(0, comment);
1030
+ return code.includes(",");
1031
+ });
1032
+ editInlineServerTable = (table, serverKey, entry) => {
1033
+ if (!table.startsWith("{")) return undefined;
1034
+ const end = endOfContainer(table, 0);
1035
+ if (table[end - 1] !== "}") return undefined;
1036
+ const pairs = [];
1037
+ let index = 1;
1038
+ let trailing = "";
1039
+ while (index < end - 1) {
1040
+ const trivia = readTrivia(table, index, end - 1);
1041
+ if (trivia.next >= end - 1) {
1042
+ trailing = trivia.text;
1043
+ break;
1044
+ }
1045
+ const key = parseKeyPath(table, trivia.next);
1046
+ if (key === undefined) return undefined;
1047
+ const equals = skipWsAndComments(table, key.next);
1048
+ if (table[equals] !== "=") return undefined;
1049
+ const valueEnd = endOfTomlValue(table, equals + 1);
1050
+ if (valueEnd > end - 1) return undefined;
1051
+ pairs.push({
1052
+ leading: trivia.text,
1053
+ text: table.slice(trivia.next, valueEnd),
1054
+ drop: key.segments[0] === serverKey
1055
+ });
1056
+ index = valueEnd;
1057
+ }
1058
+ const insertion = entry === undefined ? undefined : `${tomlInlineKey(serverKey)} = ${tomlInlineValue(entry)}`;
1059
+ if (insertion === undefined && pairs.every((pair) => !pair.drop)) return table;
1060
+ return rebuildInlineTable(pairs, trailing, insertion);
1061
+ };
1062
+ rebuildInlineTable = (pairs, trailing, insertion) => rebuildDelimitedEntries(pairs, trailing, insertion, "{", "}");
1063
+ rebuildDelimitedEntries = (pairs, trailing, insertion, open, close) => {
1064
+ const parts = [open];
1065
+ let emitted = false;
1066
+ let separatorPending = false;
1067
+ for (const pair of pairs) {
1068
+ if (pair.drop) {
1069
+ if (!pair.leading.includes("#")) continue;
1070
+ const dropped = !emitted || separatorPending ? commasOutsideComments(pair.leading) : pair.leading;
1071
+ parts.push(dropped);
1072
+ separatorPending = separatorPending || hasSeparatorComma(dropped);
1073
+ continue;
1074
+ }
1075
+ const kept = emitted ? pair.leading : commasOutsideComments(pair.leading);
1076
+ parts.push(separatorPending ? commasOutsideComments(kept) : kept);
1077
+ if (emitted && !separatorPending && !pair.leading.includes(",")) parts.push(", ");
1078
+ separatorPending = false;
1079
+ parts.push(pair.text);
1080
+ emitted = true;
1081
+ }
1082
+ if (insertion !== undefined) {
1083
+ if (!(emitted && separatorPending)) parts.push(emitted ? ", " : " ");
1084
+ parts.push(insertion);
1085
+ emitted = true;
1086
+ }
1087
+ if (!emitted) {
1088
+ const retained = `${parts.slice(1).join("")}${commasOutsideComments(trailing)}`;
1089
+ return retained.includes("#") ? `${open}${retained}${close}` : `${open}${close}`;
1090
+ }
1091
+ const tail = commasOutsideComments(trailing);
1092
+ parts.push(tail);
1093
+ if (tail === "" && open === "{") parts.push(" ");
1094
+ parts.push(close);
1095
+ return parts.join("");
1096
+ };
1097
+ tomlStringValue = (text) => {
1098
+ try {
1099
+ const value = parse$2(`value = ${text}`)["value"];
1100
+ return typeof value === "string" ? value : undefined;
1101
+ } catch (cause) {
1102
+ void cause;
1103
+ return undefined;
1104
+ }
1105
+ };
1106
+ tomlArrayWithoutString = (array, serverKey) => {
1107
+ if (!array.startsWith("[")) return undefined;
1108
+ const end = endOfContainer(array, 0);
1109
+ if (end !== array.length || array[end - 1] !== "]") return undefined;
1110
+ const pairs = [];
1111
+ let index = 1;
1112
+ let trailing = "";
1113
+ while (index < end - 1) {
1114
+ const trivia = readTrivia(array, index, end - 1);
1115
+ if (trivia.next >= end - 1) {
1116
+ trailing = trivia.text;
1117
+ break;
1118
+ }
1119
+ const valueEnd = endOfTomlValue(array, trivia.next);
1120
+ if (valueEnd > end - 1) return undefined;
1121
+ const text = array.slice(trivia.next, valueEnd);
1122
+ pairs.push({
1123
+ leading: trivia.text,
1124
+ text,
1125
+ drop: tomlStringValue(text) === serverKey
1126
+ });
1127
+ index = valueEnd;
1128
+ }
1129
+ if (pairs.every((pair) => !pair.drop)) return array;
1130
+ const rebuilt = rebuildDelimitedEntries(pairs, trailing, undefined, "[", "]");
1131
+ return rebuilt === "[]" ? "" : rebuilt;
1132
+ };
1133
+ disabledServerListEdit = (input) => {
1134
+ if (input.entry === undefined || input.tablePath.length !== 0 || input.segments.length !== 1 || input.segments[0] !== "disabled_mcp_servers") return { kind: "ignore" };
1135
+ const open = skipWsAndComments(input.text, input.valueOffset);
1136
+ if (input.text[open] !== "[") return { kind: "ignore" };
1137
+ const arrayText = input.text.slice(open, input.valueEnd);
1138
+ const edited = tomlArrayWithoutString(arrayText, input.serverKey);
1139
+ if (edited === undefined || edited === arrayText) return { kind: "keep" };
1140
+ if (edited === "") {
1141
+ const suffix = input.text.slice(input.valueEnd, input.statementEnd);
1142
+ const hash = suffix.indexOf("#");
1143
+ return {
1144
+ kind: "delete",
1145
+ comment: hash < 0 ? undefined : suffix.slice(hash)
1146
+ };
1147
+ }
1148
+ return {
1149
+ kind: "replace",
1150
+ text: `${input.text.slice(input.lineStart, open)}${edited}${input.text.slice(input.valueEnd, input.statementEnd)}`
1151
+ };
1152
+ };
1153
+ disabledServerListLines = (edit, lines, lineIndex, endLine) => {
1154
+ switch (edit.kind) {
1155
+ case "ignore": return undefined;
1156
+ case "keep": return lines.slice(lineIndex, endLine + 1);
1157
+ case "replace": return edit.text.split("\n");
1158
+ case "delete": return edit.comment === undefined ? [] : [edit.comment];
1159
+ default: {
1160
+ const unreachable = edit;
1161
+ return unreachable;
1162
+ }
1163
+ }
1164
+ };
1165
+ upsertTomlServerSection = (originalText, serverKey, entry, format) => {
1166
+ const bom = originalText.startsWith("");
1167
+ const source = bom ? originalText.slice(1) : originalText;
1168
+ const crlf = source.includes("\r\n") && !source.replaceAll("\r\n", "").includes("\n");
1169
+ const text = source;
1170
+ const lines = text.split("\n");
1171
+ const lineStarts = [];
1172
+ let cursor = 0;
1173
+ for (const line of lines) {
1174
+ lineStarts.push(cursor);
1175
+ cursor += line.length + 1;
1176
+ }
1177
+ const kept = [];
1178
+ const pending = [];
1179
+ let skipping = false;
1180
+ let inlineServerTable = false;
1181
+ let mode = "none";
1182
+ let tablePath = [];
1183
+ const discardPending = () => {
1184
+ pending.length = 0;
1185
+ };
1186
+ const flushPending = () => {
1187
+ kept.push(...pending);
1188
+ pending.length = 0;
1189
+ };
1190
+ const lineIndexAt = (offset) => {
1191
+ let line = 0;
1192
+ for (let index = 0; index < lineStarts.length; index += 1) if ((lineStarts[index] ?? 0) <= offset) line = index;
1193
+ return line;
1194
+ };
1195
+ let lineIndex = 0;
1196
+ while (lineIndex < lines.length) {
1197
+ const physical = lines[lineIndex] ?? "";
1198
+ const line = physical.endsWith("\r") ? physical.slice(0, -1) : physical;
1199
+ if (mode !== "none") {
1200
+ mode = tomlStringModeAfter(line, mode);
1201
+ if (skipping) discardPending();
1202
+ else kept.push(physical);
1203
+ lineIndex += 1;
1204
+ continue;
1205
+ }
1206
+ const header = parseTomlTableHeader(line);
1207
+ if (header !== undefined) {
1208
+ tablePath = header.path;
1209
+ if (isTomlServerTable(header.path, serverKey)) {
1210
+ discardPending();
1211
+ skipping = true;
1212
+ lineIndex += 1;
1213
+ continue;
1214
+ }
1215
+ skipping = false;
1216
+ flushPending();
1217
+ kept.push(physical);
1218
+ lineIndex += 1;
1219
+ continue;
1220
+ }
1221
+ const assignment = parseAssignment(line);
1222
+ if (assignment !== undefined) {
1223
+ const lineStart = lineStarts[lineIndex] ?? 0;
1224
+ const valueOffset = lineStart + assignment.equals + 1;
1225
+ const valueEnd = endOfTomlValue(text, valueOffset);
1226
+ let statementEnd = valueEnd;
1227
+ while (statementEnd < text.length && text[statementEnd] !== "\n") statementEnd += 1;
1228
+ const endLine = lineIndexAt(Math.max(statementEnd - 1, lineStart));
1229
+ if (skipping) {
1230
+ discardPending();
1231
+ lineIndex = endLine + 1;
1232
+ mode = "none";
1233
+ continue;
1234
+ }
1235
+ const disabledLines = format === "grok" ? disabledServerListLines(disabledServerListEdit({
1236
+ text,
1237
+ lineStart,
1238
+ valueOffset,
1239
+ valueEnd,
1240
+ statementEnd,
1241
+ tablePath,
1242
+ segments: assignment.segments,
1243
+ serverKey,
1244
+ entry
1245
+ }), lines, lineIndex, endLine) : undefined;
1246
+ if (disabledLines !== undefined) {
1247
+ flushPending();
1248
+ kept.push(...disabledLines);
1249
+ lineIndex = endLine + 1;
1250
+ mode = "none";
1251
+ continue;
1252
+ }
1253
+ const absolute = [...tablePath, ...assignment.segments];
1254
+ const open = skipWsAndComments(text, valueOffset);
1255
+ const closesServerTable = absolute.length === 1 && absolute[0] === "mcp_servers" && text[open] === "{";
1256
+ if (closesServerTable || isTomlServerTable(absolute, serverKey)) {
1257
+ if (closesServerTable) {
1258
+ flushPending();
1259
+ const edited = editInlineServerTable(text.slice(open, valueEnd), serverKey, entry);
1260
+ const prefix = text.slice(lineStart, open);
1261
+ const suffix = text.slice(valueEnd, statementEnd);
1262
+ const replacement = edited === undefined ? text.slice(lineStart, statementEnd) : `${prefix}${edited}${suffix}`;
1263
+ kept.push(...replacement.split("\n"));
1264
+ inlineServerTable = true;
1265
+ } else discardPending();
1266
+ } else {
1267
+ flushPending();
1268
+ for (let index = lineIndex; index <= endLine; index += 1) kept.push(lines[index] ?? "");
1269
+ }
1270
+ lineIndex = endLine + 1;
1271
+ mode = "none";
1272
+ continue;
1273
+ }
1274
+ if (isBlankOrComment(line)) {
1275
+ if (format === "toml" && line.trimStart().startsWith("#")) {
1276
+ flushPending();
1277
+ kept.push(physical);
1278
+ } else pending.push(physical);
1279
+ lineIndex += 1;
1280
+ continue;
1281
+ }
1282
+ mode = tomlStringModeAfter(line, "none");
1283
+ if (skipping) {
1284
+ if (looksLikeTomlHeader(line)) {
1285
+ flushPending();
1286
+ skipping = false;
1287
+ tablePath = ["\0"];
1288
+ kept.push(physical);
1289
+ } else discardPending();
1290
+ } else {
1291
+ flushPending();
1292
+ kept.push(physical);
1293
+ }
1294
+ lineIndex += 1;
1295
+ }
1296
+ if (!skipping) flushPending();
1297
+ let body = kept.join("\n");
1298
+ if (body.endsWith("\r")) body += "\n";
1299
+ if (entry !== undefined && !inlineServerTable) {
1300
+ let fragment = stringify$1({ mcp_servers: { [serverKey]: entry } }).replace(/\n+$/u, "");
1301
+ if (crlf) fragment = fragment.replaceAll("\n", "\r\n");
1302
+ const nl = crlf ? "\r\n" : "\n";
1303
+ const endedWithNewline = body.endsWith("\n");
1304
+ const base = body.replace(/\n+$/u, "");
1305
+ const trimmed = endedWithNewline && base.endsWith("\r") ? base.slice(0, -1) : base;
1306
+ body = trimmed.length === 0 ? `${fragment}${nl}` : `${trimmed}${nl}${nl}${fragment}${nl}`;
1307
+ }
1308
+ return bom ? `\uFEFF${body}` : body;
1309
+ };
1310
+ tomlServerEntry = (document, serverKey) => {
1311
+ const servers = objectSchema.safeParse(document.mcp_servers);
1312
+ if (!servers.success || !Object.hasOwn(servers.data, serverKey)) return undefined;
1313
+ return servers.data[serverKey];
1314
+ };
1315
+ grokServerListedDisabled = (document, serverKey) => Array.isArray(document.disabled_mcp_servers) && document.disabled_mcp_servers.includes(serverKey);
1316
+ OMP_DISABLED_SERVERS_KEY = "disabledServers";
1317
+ ompServerListedDisabled = (document, serverKey) => {
1318
+ const listed = document[OMP_DISABLED_SERVERS_KEY];
1319
+ return Array.isArray(listed) && listed.includes(serverKey);
1320
+ };
1321
+ OMP_ENABLED_SERVERS_KEY = "enabledServers";
1322
+ clientServerForcedEnabled = (parsed, serverKey) => {
1323
+ if (parsed.dialect !== "omp") return false;
1324
+ const listed = parsed.document[OMP_ENABLED_SERVERS_KEY];
1325
+ return Array.isArray(listed) && listed.includes(serverKey);
1326
+ };
1327
+ clientServerListedDisabled = (parsed, serverKey) => parsed.dialect === "grok" && grokServerListedDisabled(parsed.document, serverKey) || parsed.dialect === "omp" && ompServerListedDisabled(parsed.document, serverKey);
1328
+ serializeGrokConfiguration = (document, originalText) => {
1329
+ const entry = tomlServerEntry(document, PRODUCT_IDENTITY.mcpServerKey);
1330
+ if (originalText === undefined) return stringify$1(document);
1331
+ return upsertTomlServerSection(originalText, PRODUCT_IDENTITY.mcpServerKey, entry, "grok");
1332
+ };
1333
+ withoutEmptyServerTable = (document) => {
1334
+ const servers = objectSchema.safeParse(document.mcp_servers);
1335
+ if (!servers.success || Object.keys(servers.data).length > 0) return document;
1336
+ const { mcp_servers: empty, ...rest } = document;
1337
+ void empty;
1338
+ return rest;
1339
+ };
1340
+ serializeCodexConfiguration = (document, originalText) => {
1341
+ if (originalText === undefined || isEmptyClientConfigurationText(originalText)) return stringify$1(document);
1342
+ const upserted = upsertTomlServerSection(originalText, PRODUCT_IDENTITY.mcpServerKey, tomlServerEntry(document, PRODUCT_IDENTITY.mcpServerKey), "toml");
1343
+ const edited = originalText.endsWith("\n") && !upserted.endsWith("\n") ? `${upserted}${originalText.endsWith("\r\n") ? "\r\n" : "\n"}` : upserted;
1344
+ return tomlTextHolds(edited, document) ? edited : stringify$1(document);
1345
+ };
1346
+ tomlTextHolds = (text, document) => {
1347
+ try {
1348
+ return clientConfigurationValuesEqual(withoutEmptyServerTable(objectSchema.parse(parse$2(text))), withoutEmptyServerTable(document));
1349
+ } catch (cause) {
1350
+ void cause;
1351
+ return false;
1352
+ }
1353
+ };
1354
+ commentsBetweenProperties = (gap) => {
1355
+ const pieces = [];
1356
+ let index = 0;
1357
+ while (index < gap.length) {
1358
+ const line = gap.indexOf("//", index);
1359
+ const block = gap.indexOf("/*", index);
1360
+ if (line < 0 && block < 0) break;
1361
+ const start = line < 0 ? block : block < 0 ? line : Math.min(line, block);
1362
+ const lineComment = start === line;
1363
+ const close = lineComment ? gap.indexOf("\n", start) : gap.indexOf("*/", start + 2);
1364
+ if (!lineComment && close < 0) return undefined;
1365
+ const end = lineComment ? close < 0 ? gap.length : close : close + 2;
1366
+ const comment = gap.slice(start, end);
1367
+ const lineBreak = gap.lastIndexOf("\n", start - 1);
1368
+ if (lineBreak < 0) pieces.push(` ${comment}`);
1369
+ else {
1370
+ const prefix = gap.slice(lineBreak + 1, start);
1371
+ let indentEnd = 0;
1372
+ while (prefix[indentEnd] === " " || prefix[indentEnd] === " ") indentEnd += 1;
1373
+ const newline = lineBreak > 0 && gap[lineBreak - 1] === "\r" ? "\r\n" : "\n";
1374
+ pieces.push(`${newline}${prefix.slice(0, indentEnd)}${comment}`);
1375
+ }
1376
+ index = end;
1377
+ }
1378
+ return pieces.length === 0 ? undefined : pieces.join("");
1379
+ };
1380
+ deleteJsonPropertyPreservingComments = (text, path) => {
1381
+ const root = parseTree(text, [], { allowTrailingComma: true });
1382
+ const value = root === undefined ? undefined : findNodeAtLocation(root, [...path]);
1383
+ const property = value?.parent;
1384
+ const parent = property?.parent;
1385
+ if (property === undefined || parent?.type !== "object" || property.type !== "property" || parent.children === undefined) return undefined;
1386
+ const propertyIndex = parent.children.indexOf(property);
1387
+ const previous = parent.children[propertyIndex - 1];
1388
+ if (propertyIndex <= 0 || previous === undefined) return undefined;
1389
+ const comments = commentsBetweenProperties(text.slice(previous.offset + previous.length, property.offset));
1390
+ if (comments === undefined) return undefined;
1391
+ let removeEnd = property.offset + property.length;
1392
+ const hasNext = parent.children[propertyIndex + 1] !== undefined;
1393
+ if (hasNext) {
1394
+ let comma = removeEnd;
1395
+ while (comma < text.length) {
1396
+ const char = text[comma];
1397
+ if (char === " " || char === " " || char === "\r" || char === "\n") {
1398
+ comma += 1;
1399
+ continue;
1400
+ }
1401
+ if (text.startsWith("/*", comma)) {
1402
+ const close = text.indexOf("*/", comma + 2);
1403
+ if (close < 0) return undefined;
1404
+ comma = close + 2;
1405
+ continue;
1406
+ }
1407
+ if (text.startsWith("//", comma)) {
1408
+ while (comma < text.length && text[comma] !== "\n" && text[comma] !== "\r") comma += 1;
1409
+ continue;
1410
+ }
1411
+ break;
1412
+ }
1413
+ if (text[comma] !== ",") return undefined;
1414
+ removeEnd = comma + 1;
1415
+ }
1416
+ const remainder = text.slice(removeEnd);
1417
+ let suffix = `${hasNext ? "," : ""}${comments}`;
1418
+ if (suffix.includes("//") && !suffix.endsWith("\n") && !suffix.endsWith("\r") && !remainder.startsWith("\n") && !remainder.startsWith("\r")) suffix += "\n";
1419
+ return `${text.slice(0, previous.offset + previous.length)}${suffix}${remainder}`;
1420
+ };
1421
+ serializeClientConfiguration = (document, format, originalText, editedPaths) => {
1422
+ if (format === undefined || format === "unsupported") throw new TypeError("client does not have a supported MCP config format");
1423
+ if (format === "toml") return serializeCodexConfiguration(document, originalText);
1424
+ if (format === "grok") return serializeGrokConfiguration(document, originalText);
1425
+ if (format === "hermes") return serializeHermesConfiguration(document, originalText);
1426
+ if (format === "dsh") return serializeDshDocument(document);
1427
+ if (originalText !== undefined && !isEmptyClientConfigurationText(originalText) && editedPaths !== undefined) return editedPaths.reduce((text, path) => {
1428
+ const value = valueAt(document, path);
1429
+ if (value === undefined) {
1430
+ const preserved = deleteJsonPropertyPreservingComments(text, path);
1431
+ if (preserved !== undefined) return preserved;
1432
+ }
1433
+ return applyEdits(text, modify(text, [...path], value, { formattingOptions: {
1434
+ insertSpaces: true,
1435
+ tabSize: 2,
1436
+ eol: "\n"
1437
+ } }));
1438
+ }, originalText);
1439
+ return `${JSON.stringify(document, null, 2)}\n`;
1440
+ };
1441
+ clientServerPath = (parsed, name) => [...parsed.serversPath, name];
1442
+ legacyClientServerPath = (parsed, name) => Object.hasOwn(parsed.legacyServers, name) ? [parsed.serversPath[0] ?? "mcp", name] : undefined;
1443
+ serializeHermesConfiguration = (document, originalText) => {
1444
+ if (originalText === undefined || isEmptyClientConfigurationText(originalText)) return stringify(document);
1445
+ const serversKey = clientConfigurationServersKey("hermes");
1446
+ const servers = document[serversKey];
1447
+ const entry = typeof servers === "object" && servers !== null ? servers[PRODUCT_IDENTITY.mcpServerKey] : undefined;
1448
+ const yamlDocument = parseDocument(originalText);
1449
+ if (entry === undefined) yamlDocument.deleteIn([serversKey, PRODUCT_IDENTITY.mcpServerKey]);
1450
+ else yamlDocument.setIn([serversKey, PRODUCT_IDENTITY.mcpServerKey], entry);
1451
+ return yamlDocument.toString({ lineWidth: 0 });
1452
+ };
1453
+ clientRegistrationEntry = (format, command, environment) => {
1454
+ const [executable = "rea", ...args] = command;
1455
+ switch (format) {
1456
+ case "opencode": return {
1457
+ type: "local",
1458
+ command: [...command],
1459
+ enabled: true,
1460
+ ...Object.keys(environment).length === 0 ? {} : { environment: { ...environment } }
1461
+ };
1462
+ case "opencode_v2": return {
1463
+ type: "local",
1464
+ command: [...command],
1465
+ ...Object.keys(environment).length === 0 ? {} : { environment: { ...environment } }
1466
+ };
1467
+ case "vscode":
1468
+ case "omp":
1469
+ case "pi": return {
1470
+ type: "stdio",
1471
+ command: executable,
1472
+ args,
1473
+ ...Object.keys(environment).length === 0 ? {} : { env: environment }
1474
+ };
1475
+ case "copilot_cli": return {
1476
+ type: "stdio",
1477
+ command: executable,
1478
+ args,
1479
+ tools: ["*"],
1480
+ ...Object.keys(environment).length === 0 ? {} : { env: environment }
1481
+ };
1482
+ case "commandcode": return {
1483
+ transport: "stdio",
1484
+ enabled: true,
1485
+ command: executable,
1486
+ args,
1487
+ ...Object.keys(environment).length === 0 ? {} : { env: environment }
1488
+ };
1489
+ case "dsh": return dshClientRegistrationEntry(command, environment);
1490
+ case "hermes": return {
1491
+ command: executable,
1492
+ args,
1493
+ ...Object.keys(environment).length === 0 ? {} : { env: environment },
1494
+ enabled: true
1495
+ };
1496
+ default: return {
1497
+ command: executable,
1498
+ args,
1499
+ ...Object.keys(environment).length === 0 ? {} : { env: environment }
1500
+ };
1501
+ }
1502
+ };
1503
+ parseGeminiMcpPolicy = (parsed) => z.object({
1504
+ allowed: z.array(z.string()).optional(),
1505
+ excluded: z.array(z.string()).optional()
1506
+ }).passthrough().parse(parsed.document.mcp ?? {});
1507
+ geminiServerPolicyBlock = (policies, serverKey) => {
1508
+ if (policies.some(({ excluded }) => excluded?.includes(serverKey))) return `Gemini mcp.excluded blocks ${serverKey}. Review the selected settings policies before rerunning setup.`;
1509
+ const allowlists = policies.flatMap(({ allowed }) => allowed === undefined ? [] : [allowed]);
1510
+ const allowed = allowlists.reduce((previous, current) => {
1511
+ if (previous === undefined) return current;
1512
+ const normalized = new Set(current.map((name) => name.toLowerCase().trim()));
1513
+ return previous.filter((name) => normalized.has(name.toLowerCase().trim()));
1514
+ }, undefined);
1515
+ if (allowed !== undefined && allowed.length > 0 && !allowed.includes(serverKey)) return `Gemini mcp.allowed does not include ${serverKey}. Review the selected settings policies before rerunning setup.`;
1516
+ return undefined;
1517
+ };
1518
+ })))();
1519
+ }
1520
+
1521
+ //#endregion
1522
+ export { DshCordisDocument, MANAGED_SKILL_FILES, OMP_DISABLED_SERVERS_KEY, canonicalSkillNeedsInstall, clientConfigurationValuesEqual, clientRegistrationEntry, clientServerForcedEnabled, clientServerListedDisabled, clientServerPath, dshDocument, effectiveClientServer, existingSkillDestinations, geminiServerPolicyBlock, init_ClientConfigurationDocument, init_DshCordisPatch, init_SetupSkill, installCanonicalSkill, isManagedSkillManifest, legacyClientServerPath, parseClientConfiguration, parseGeminiMcpPolicy, readInstalledSkillIdentity, readSkillFile, serializeClientConfiguration, skillDestinations, withClientServers };