rea-agents 6.3.0 → 6.5.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.
- package/DISCLAIMER.md +136 -0
- package/README.md +72 -18
- package/THIRD_PARTY_NOTICES.md +134 -0
- package/bridge/android/ReaJadxBridge.java +123 -11
- package/bridge/cutter/rea_bridge.py +816 -0
- package/bridge/ghidra/ReaGhidraAnalysisOptions.java +38 -0
- package/bridge/ghidra/ReaGhidraApplySeeds.java +151 -0
- package/bridge/ghidra/ReaGhidraBridge.java +1729 -283
- package/bridge/ghidra/ReaGhidraBundleActivator.java +14 -0
- package/bridge/ghidra/ReaGhidraMipsSoftFloat.java +176 -0
- package/bridge/ghidra/ReaGhidraNoReturnFix.java +123 -0
- package/bridge/ghidra/ReaGhidraPrepareRaw.java +49 -0
- package/bridge/hopper_bridge.py +103 -69
- package/bridge/mitmproxy/capture.py +189 -13
- package/bridge/native/rea_lldb_tracer.py +40 -6
- package/bridge/process/ProcessRunTokenReader.swift +76 -34
- package/bridge/pwntools/layout_impl.py +5 -0
- package/bridge/pwntools/recorded_crash_impl.py +31 -10
- package/dist/adb/AdbConfiguration.js +100 -0
- package/dist/adb/AdbDeviceOutput.js +208 -0
- package/dist/adb/AdbDirectoryListing.js +80 -0
- package/dist/adb/AdbHostFileName.js +34 -0
- package/dist/adb/AdbProvider.js +1433 -0
- package/dist/adb/AdbShellOutput.js +307 -0
- package/dist/android/AndroidTargetSnapshot.js +104 -22
- package/dist/android/JadxAnalysis.js +32 -7
- package/dist/android/JadxConfiguration.js +163 -53
- package/dist/android/JadxDoctor.js +115 -0
- package/dist/android/JadxMcpTransport.js +5 -3
- package/dist/android/JadxProtocol.js +14 -0
- package/dist/android/JadxProvider.js +63 -25
- package/dist/android/JadxRelease.js +12 -1
- package/dist/android/JadxWorkspaceRoot.js +157 -0
- package/dist/apktool/ApktoolConfiguration.js +227 -0
- package/dist/apktool/ApktoolDecodeOutput.js +142 -0
- package/dist/apktool/ApktoolProvider.js +543 -0
- package/dist/application/AnalysisContextQueries.js +5 -8
- package/dist/application/AnalysisProvider.js +24 -14
- package/dist/application/AppBundleExecutable.js +30 -25
- package/dist/application/BinaryTargetResolver.js +210 -33
- package/dist/application/BrowserEvidence.js +1 -1
- package/dist/application/BrowserObservationService.js +13 -2
- package/dist/application/BrowserScenarioCaptureService.js +0 -1
- package/dist/application/CallPathTracing.js +52 -13
- package/dist/application/CapabilityInventory.js +179 -29
- package/dist/application/ClaudeDesktopConfigLocation.js +152 -0
- package/dist/application/ClientConfigurationDocument.js +154 -7
- package/dist/application/ClientConfigurationFiles.js +128 -0
- package/dist/application/ClientRegistrationEnvironment.js +41 -0
- package/dist/application/ClientRegistrationIdentity.js +94 -29
- package/dist/application/ClientRegistrationStatus.js +223 -67
- package/dist/application/DirectAnalysis.js +86 -31
- package/dist/application/DirectAnalysisCleanup.js +1 -1
- package/dist/application/DirectAnalysisStatus.js +14 -2
- package/dist/application/Doctor.js +117 -34
- package/dist/application/DoctorDiagnostics.js +34 -12
- package/dist/application/DoctorProviderIds.js +2 -0
- package/dist/application/DoctorScope.js +11 -2
- package/dist/application/DshCordisPatch.js +355 -0
- package/dist/application/DshCordisYaml.js +155 -0
- package/dist/application/EnhancedLiteralTracing.js +30 -16
- package/dist/application/EnhancedToolTypes.js +0 -1
- package/dist/application/EnhancedTools.js +164 -54
- package/dist/application/EvidenceBundleCommands.js +36 -19
- package/dist/application/EvidenceBundleFiles.js +29 -7
- package/dist/application/FunctionAnalysisEvidence.js +3 -0
- package/dist/application/GeminiClientSettings.js +151 -0
- package/dist/application/HermesClientHome.js +115 -0
- package/dist/application/HermesConfigurationYaml.js +272 -0
- package/dist/application/HopperDownload.js +39 -0
- package/dist/application/InventoryProjectionEvidence.js +0 -1
- package/dist/application/InvestigationProviders.js +19 -3
- package/dist/application/JsonFiles.js +114 -23
- package/dist/application/JsonInputFile.js +410 -0
- package/dist/application/LinuxHopper.js +130 -60
- package/dist/application/MacHopper.js +177 -150
- package/dist/application/MacHopperPaths.js +40 -0
- package/dist/application/MipsElfMetadata.js +201 -0
- package/dist/application/MipsElfSharedLoad.js +164 -0
- package/dist/application/MipsGnuAttributes.js +90 -0
- package/dist/application/MsixPackageStorage.js +133 -0
- package/dist/application/ProgressReporter.js +1 -1
- package/dist/application/ProviderOperationExecution.js +39 -0
- package/dist/application/ReconstructionCoverageService.js +0 -1
- package/dist/application/ReconstructionObligationCandidates.js +12 -5
- package/dist/application/ReconstructionObligationLedgerDiagnostics.js +2 -2
- package/dist/application/ReconstructionObligationLedgerEvaluation.js +15 -33
- package/dist/application/ReconstructionObligationLedgerProjection.js +3 -72
- package/dist/application/ReconstructionObligationLedgerService.js +3 -1
- package/dist/application/ReconstructionObligationOriginalCases.js +2 -1
- package/dist/application/ReferenceSourceImport.js +94 -31
- package/dist/application/ReferenceSourceImportEntries.js +40 -30
- package/dist/application/ReferenceSourceImportPolicy.js +99 -23
- package/dist/application/ReferenceSourceImportTypes.js +30 -23
- package/dist/application/ReferenceSourceVcsAdapter.js +163 -31
- package/dist/application/RegularFileRead.js +121 -7
- package/dist/application/Setup.js +88 -14
- package/dist/application/SetupClientConfiguration.js +307 -38
- package/dist/application/SetupClients.js +12 -6
- package/dist/application/SetupHost.js +158 -38
- package/dist/application/SetupInstallFailure.js +42 -2
- package/dist/application/SetupPlan.js +83 -57
- package/dist/application/SetupRecoveryBackup.js +66 -0
- package/dist/application/SetupRegistrationEnvironment.js +2 -1
- package/dist/application/SetupSkill.js +354 -88
- package/dist/application/SupportedClients.js +429 -70
- package/dist/application/TypeScriptEmittedSourceCandidates.js +26 -0
- package/dist/application/Uninstall.js +412 -73
- package/dist/application/UninstallFailure.js +14 -0
- package/dist/application/Update.js +54 -25
- package/dist/application/UpdateFailure.js +17 -0
- package/dist/application/UpdateMaintenance.js +25 -47
- package/dist/application/UpdateRuntime.js +141 -27
- package/dist/application/Utf8JsonInput.js +7 -0
- package/dist/application/WebModuleTraceService.js +7 -0
- package/dist/application/WebNetworkCaptureService.js +16 -7
- package/dist/application/WebScriptExportService.js +131 -65
- package/dist/application/WebSourceLocationService.js +22 -3
- package/dist/application/WindowsCapabilities.js +18 -15
- package/dist/application/WorkflowEvidence.js +24 -1
- package/dist/application/adb/AdbDeviceAnalysisPort.js +1 -0
- package/dist/application/adb/AdbDeviceAnalysisService.js +13 -0
- package/dist/application/analysisView/AnalysisViewService.js +122 -6
- package/dist/application/android/AndroidPackageInspection.js +25 -0
- package/dist/application/android/AndroidSearchEvidenceSummary.js +100 -0
- package/dist/application/apktool/ApktoolResourceAnalysisPort.js +1 -0
- package/dist/application/apktool/ApktoolResourceAnalysisService.js +13 -0
- package/dist/application/binary/AnalysisClientCleanup.js +0 -24
- package/dist/application/binary/AnalysisProviderEvaluation.js +1 -1
- package/dist/application/binary/AnalysisProviderRegistry.js +36 -21
- package/dist/application/binary/AnalysisSnapshotCache.js +41 -20
- package/dist/application/binary/AnalysisSnapshotFiles.js +75 -9
- package/dist/application/binary/BinarySession.js +250 -97
- package/dist/application/binary/BinarySessionExecution.js +5 -4
- package/dist/application/binary/BinarySessionOpen.js +13 -6
- package/dist/application/binary/BinarySessionRecords.js +33 -7
- package/dist/application/binary/BinarySessionStatus.js +93 -23
- package/dist/application/binary/BinaryTargetSummary.js +9 -0
- package/dist/application/binary/CompositeProvider.js +71 -28
- package/dist/application/binary/LazyAnalysisProvider.js +3 -1
- package/dist/application/binary/SessionProviderRouter.js +5 -2
- package/dist/application/binaryDiagnostics/BinaryLayoutService.js +13 -2
- package/dist/application/binaryDiagnostics/PeResourcesPort.js +1 -0
- package/dist/application/binaryDiagnostics/PeResourcesService.js +114 -0
- package/dist/application/binaryDiagnostics/RecordedCrashService.js +16 -4
- package/dist/application/captures/PacketCaptureService.js +83 -0
- package/dist/application/closeOwnedWebResources.js +7 -0
- package/dist/application/electron/ElectronFusePort.js +1 -0
- package/dist/application/electron/ElectronFuseService.js +80 -0
- package/dist/application/evm/EvmInterfaceService.js +4 -0
- package/dist/application/firmware/FirmwareAnalysisService.js +3 -0
- package/dist/application/flutter/DartAotInspection.js +26 -0
- package/dist/application/flutter/FlutterBuildAnalysisPort.js +1 -0
- package/dist/application/flutter/FlutterBuildAnalysisService.js +13 -0
- package/dist/application/frida/FridaInstrumentationPort.js +8 -0
- package/dist/application/frida/FridaInstrumentationService.js +310 -0
- package/dist/application/frida/fridaInputErrors.js +17 -0
- package/dist/application/go/GoBinaryPort.js +1 -0
- package/dist/application/go/GoBinaryService.js +80 -0
- package/dist/application/harmony/HarmonyApplicationService.js +17 -0
- package/dist/application/investigation/EvidenceLedger.js +40 -14
- package/dist/application/investigation/InspectEvidenceBundle.js +18 -0
- package/dist/application/investigation/InvestigationRecords.js +12 -21
- package/dist/application/investigation/UnknownEvidence.js +22 -18
- package/dist/application/javascript/ElectronActiveObservationService.js +55 -25
- package/dist/application/javascript/ElectronBoundaryAnalysis.js +17 -3
- package/dist/application/javascript/ElectronBoundaryGraph.js +2 -0
- package/dist/application/javascript/ElectronBoundaryGraphCallPaths.js +144 -0
- package/dist/application/javascript/ElectronBoundaryGraphContext.js +3 -2
- package/dist/application/javascript/ElectronBoundaryGraphIpc.js +28 -9
- package/dist/application/javascript/ElectronBoundaryGraphNative.js +20 -7
- package/dist/application/javascript/ElectronBoundaryGraphWindows.js +50 -12
- package/dist/application/javascript/ElectronObservationService.js +0 -1
- package/dist/application/javascript/JavaScriptApplicationEvidence.js +15 -0
- package/dist/application/javascript/JavaScriptApplicationService.js +44 -18
- package/dist/application/javascript/JavaScriptApplicationWorkflowEvidence.js +5 -6
- package/dist/application/javascript/JavaScriptApplicationWorkflowService.js +0 -1
- package/dist/application/javascript/JavaScriptArtifactAnalysis.js +253 -60
- package/dist/application/javascript/JavaScriptArtifactGraphAccumulator.js +51 -23
- package/dist/application/javascript/JavaScriptArtifactGraphBuilder.js +93 -21
- package/dist/application/javascript/JavaScriptArtifactGraphBundlers.js +4 -3
- package/dist/application/javascript/JavaScriptArtifactGraphContext.js +35 -8
- package/dist/application/javascript/JavaScriptArtifactGraphDocuments.js +25 -14
- package/dist/application/javascript/JavaScriptArtifactGraphFindings.js +163 -54
- package/dist/application/javascript/JavaScriptArtifactGraphStructure.js +246 -15
- package/dist/application/javascript/JavaScriptArtifactPathResolution.js +1057 -323
- package/dist/application/javascript/JavaScriptArtifactReconstruction.js +134 -32
- package/dist/application/javascript/JavaScriptArtifactReconstructionInput.js +6 -1
- package/dist/application/javascript/JavaScriptModuleRelationships.js +39 -15
- package/dist/application/javascript/JavaScriptRecoveryService.js +32 -9
- package/dist/application/javascript/JavaScriptRuntimeObservationService.js +2 -1
- package/dist/application/javascript/JavaScriptRuntimeReconciliationService.js +0 -1
- package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +9 -3
- package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +228 -74
- package/dist/application/javascript/JavaScriptSemanticGraphConstruction.js +12 -19
- package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +4 -1
- package/dist/application/javascript/JavaScriptSemanticGraphElectronProjection.js +67 -0
- package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +5 -3
- package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +5 -3
- package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +19 -8
- package/dist/application/javascript/JavaScriptSemanticTraceService.js +0 -1
- package/dist/application/jeb/JebAnalysisPort.js +1 -0
- package/dist/application/jeb/JebAnalysisService.js +13 -0
- package/dist/application/managed/ManagedApplicationGraphService.js +1 -2
- package/dist/application/managed/ManagedMemberComparisonService.js +72 -54
- package/dist/application/managed/ManagedNativeVerificationService.js +0 -1
- package/dist/application/managed/ManagedReconstructionService.js +0 -1
- package/dist/application/native/NativeCallRoutes.js +54 -34
- package/dist/application/native/NativeDispatchMetadataInspection.js +6 -2
- package/dist/application/native/NativeUiActionTrace.js +51 -30
- package/dist/application/native/NativeValueTrace.js +75 -24
- package/dist/application/pcap/PcapAnalysisPort.js +1 -0
- package/dist/application/pcap/PcapAnalysisService.js +24 -0
- package/dist/application/process/ProcessCli.js +57 -32
- package/dist/application/reverse/ReverseEngineeringCommandPort.js +1 -0
- package/dist/application/reverse/ReverseEngineeringService.js +688 -0
- package/dist/application/rust/RustBinaryPort.js +1 -0
- package/dist/application/rust/RustBinaryService.js +80 -0
- package/dist/application/signals/SignalRecordingService.js +83 -0
- package/dist/application/sqlite/SqliteDatabaseCapability.js +30 -0
- package/dist/application/sqlite/SqliteDatabasePort.js +1 -0
- package/dist/application/sqlite/SqliteDatabaseService.js +76 -0
- package/dist/application/wasm/WasmArtifactPort.js +1 -0
- package/dist/application/wasm/WasmArtifactService.js +77 -0
- package/dist/application/wasm/WasmInterfaceComparisonService.js +188 -0
- package/dist/artifacts/ArtifactHash.js +13 -2
- package/dist/artifacts/ArtifactPaths.js +133 -15
- package/dist/artifacts/ArtifactProvider.js +28 -19
- package/dist/artifacts/ArtifactReader.js +35 -0
- package/dist/artifacts/ArtifactResourceScope.js +109 -0
- package/dist/artifacts/AsarArtifactReader.js +295 -156
- package/dist/artifacts/AsarHeader.js +24 -0
- package/dist/artifacts/AsarListing.js +78 -0
- package/dist/artifacts/DirectoryArtifactReader.js +247 -74
- package/dist/artifacts/MachOSliceArtifactReader.js +198 -48
- package/dist/artifacts/NativeDmgArtifactReader.js +188 -78
- package/dist/artifacts/OrderedReads.js +57 -0
- package/dist/artifacts/SafeOutputTree.js +261 -71
- package/dist/artifacts/SafeOutputTreeCleanup.js +45 -0
- package/dist/artifacts/SafeOutputTreeCreationFailure.js +20 -0
- package/dist/artifacts/SafeOutputTreeIdentity.js +42 -0
- package/dist/artifacts/SafeOutputTreeReadback.js +33 -0
- package/dist/artifacts/ZipArtifactReader.js +186 -31
- package/dist/artifacts/apple/AppleAssetCatalogAnalysis.js +77 -68
- package/dist/artifacts/apple/DylibResolutionReader.js +11 -5
- package/dist/artifacts/apple/InterfaceBuilderAnalysis.js +114 -38
- package/dist/artifacts/apple/InterfaceBuilderDecodeBudget.js +125 -35
- package/dist/artifacts/apple/KeyedArchiveReader.js +35 -15
- package/dist/artifacts/apple/MachoLoadCommandReader.js +62 -61
- package/dist/artifacts/apple/NibArchive.js +11 -4
- package/dist/artifacts/apple/PlistNumberLiterals.js +2 -2
- package/dist/artifacts/extraction/ArtifactExtraction.js +115 -92
- package/dist/artifacts/hostExecutableMarking.js +16 -0
- package/dist/artifacts/inventory/ArtifactGraphConstruction.js +236 -69
- package/dist/artifacts/inventory/ArtifactInventory.js +7 -6
- package/dist/artifacts/inventory/classify.js +95 -35
- package/dist/artifacts/inventory/hashStableRootArtifact.js +48 -15
- package/dist/artifacts/inventory/reader.js +40 -17
- package/dist/artifacts/inventory/scanCanonical.js +84 -40
- package/dist/artifacts/inventory/scanReader.js +72 -19
- package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +177 -15
- package/dist/artifacts/javascript/JavaScriptSourceAnalysis.js +3 -0
- package/dist/artifacts/readStableArtifact.js +28 -4
- package/dist/browser/BrowserProcessStartup.js +20 -9
- package/dist/browser/BrowserScenarioPartialObservation.js +60 -38
- package/dist/browser/BrowserScenarioSecrets.js +193 -48
- package/dist/browser/CdpBrowserProvider.js +74 -98
- package/dist/browser/CdpCaptureDocuments.js +261 -65
- package/dist/browser/CdpCaptureDomSvg.js +243 -0
- package/dist/browser/CdpCaptureEventBodyShapes.js +12 -12
- package/dist/browser/CdpCaptureEventHandlers.js +49 -21
- package/dist/browser/CdpCaptureEvents.js +53 -19
- package/dist/browser/CdpCaptureStorage.js +22 -5
- package/dist/browser/CdpCaptureStorageFingerprints.js +54 -11
- package/dist/browser/CdpCaptureValues.js +0 -1
- package/dist/browser/CdpConnection.js +25 -9
- package/dist/browser/CdpElectronInspection.js +14 -4
- package/dist/browser/CdpElectronProvider.js +7 -2
- package/dist/browser/CdpElectronScripts.js +2 -1
- package/dist/browser/CdpElectronWorkers.js +7 -2
- package/dist/browser/CdpEndpoint.js +143 -17
- package/dist/browser/CdpObservationSession.js +24 -8
- package/dist/browser/CdpPageCapture.js +67 -17
- package/dist/browser/CdpPageCaptureScripts.js +4 -3
- package/dist/browser/CdpPageCaptureWorkers.js +5 -1
- package/dist/browser/CdpSafeMetadata.js +9 -5
- package/dist/browser/CdpScreenshot.js +5 -14
- package/dist/browser/CdpSnapshotStrings.js +21 -0
- package/dist/browser/CdpTargetSession.js +59 -36
- package/dist/browser/CdpWebMcpDiscovery.js +55 -16
- package/dist/browser/ElectronFileScope.js +99 -9
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +64 -8
- package/dist/browser/PlaywrightElectronActiveActions.js +4 -4
- package/dist/browser/PlaywrightElectronActiveProjection.js +16 -4
- package/dist/browser/PlaywrightElectronActiveProvider.js +114 -36
- package/dist/browser/PlaywrightExecutionBoundary.js +2 -2
- package/dist/browser/PlaywrightScenarioArtifacts.js +5 -5
- package/dist/browser/PlaywrightScenarioBrowser.js +78 -13
- package/dist/browser/PlaywrightScenarioEvents.js +198 -36
- package/dist/browser/PlaywrightScenarioServiceWorkers.js +249 -0
- package/dist/browser/PlaywrightScenarioSession.js +180 -75
- package/dist/browser/PlaywrightScenarioStorage.js +507 -0
- package/dist/browser/PngVisualDiff.js +198 -29
- package/dist/browser/WebSourceMapFetcher.js +164 -81
- package/dist/browser/assets/LocalWebScriptArtifacts.js +27 -4
- package/dist/browser/assets/PublishWebScripts.js +88 -22
- package/dist/browser/assets/ScenarioScriptCapture.js +2 -1
- package/dist/browser/assets/WebArtifactReads.js +34 -4
- package/dist/browser/assets/WebSourceLocationArtifacts.js +39 -3
- package/dist/browser/execution/CdpExecutionCapture.js +3 -3
- package/dist/browser/execution/CdpPreciseCoverage.js +5 -8
- package/dist/browser/history/CaptureFailures.js +22 -8
- package/dist/browser/history/CaptureFormatError.js +2 -2
- package/dist/browser/history/{HarJson.js → CaptureJson.js} +14 -4
- package/dist/browser/history/CaptureRedaction.js +16 -3
- package/dist/browser/history/CaptureRelease.js +20 -2
- package/dist/browser/history/HarCapture.js +16 -9
- package/dist/browser/history/HarSchema.js +36 -36
- package/dist/browser/history/HistoricalCaptureDecoder.js +93 -25
- package/dist/browser/history/MitmproxyCaptureAdapter.js +3 -1
- package/dist/browser/history/NodeCaptureAdapter.js +48 -0
- package/dist/browser/history/{HarCaptureProcess.js → NodeCaptureProcess.js} +16 -15
- package/dist/browser/history/QlogCapture.js +385 -0
- package/dist/browser/history/SazCapture.js +130 -0
- package/dist/browser/history/SazHttp.js +61 -0
- package/dist/browser/history/SazMetadata.js +92 -0
- package/dist/browser/history/SazProjection.js +90 -0
- package/dist/browser/modules/NativeModuleResolver.js +177 -110
- package/dist/browser/modules/WebModuleArtifacts.js +41 -3
- package/dist/browser/network/PlaywrightNetworkContent.js +40 -5
- package/dist/browser/network/PlaywrightScenarioNetwork.js +125 -11
- package/dist/captures/TsharkCaptureProvider.js +370 -0
- package/dist/captures/parseFieldDiscovery.js +66 -0
- package/dist/captures/parsePacketOutput.js +21 -0
- package/dist/catalogIdentity.js +46 -35
- package/dist/cli/adbCommands.js +337 -0
- package/dist/cli/analysisViewCommands.js +39 -1
- package/dist/cli/androidCommands.js +11 -2
- package/dist/cli/apktoolCommands.js +52 -0
- package/dist/cli/applicationCommands.js +44 -17
- package/dist/cli/artifactCommands.js +9 -12
- package/dist/cli/binaryDiagnosticsCommands.js +27 -5
- package/dist/cli/browserAdvancedCommands.js +97 -55
- package/dist/cli/browserCommands.js +46 -29
- package/dist/cli/captureCommands.js +72 -0
- package/dist/cli/cliResultOutput.js +188 -0
- package/dist/cli/coreBinaryCommands.js +73 -32
- package/dist/cli/coreNativeCommands.js +54 -45
- package/dist/cli/cutterCommands.js +50 -0
- package/dist/cli/electronCommands.js +51 -4
- package/dist/cli/evmCommands.js +16 -8
- package/dist/cli/finishAnalysisCommand.js +44 -0
- package/dist/cli/firmwareCommands.js +21 -38
- package/dist/cli/flutterCommands.js +69 -0
- package/dist/cli/fridaCommands.js +211 -0
- package/dist/cli/goCommands.js +20 -0
- package/dist/cli/interactiveSetup.js +11 -1
- package/dist/cli/javascriptApplicationAnalysis.js +18 -2
- package/dist/cli/javascriptRecoveryCommands.js +29 -15
- package/dist/cli/jebCommands.js +99 -0
- package/dist/cli/jsonOutput.js +13 -6
- package/dist/cli/managedCommands.js +31 -3
- package/dist/cli/options.js +20 -2
- package/dist/cli/pcapCommands.js +47 -0
- package/dist/cli/processCommands.js +1 -1
- package/dist/cli/referenceSourceImportStatus.js +7 -0
- package/dist/cli/reverseEngineeringCommands.js +268 -0
- package/dist/cli/rustCommands.js +21 -0
- package/dist/cli/setupCommands.js +55 -15
- package/dist/cli/signalCommands.js +72 -0
- package/dist/cli/sqliteCommands.js +79 -0
- package/dist/cli/utilityCommands.js +179 -89
- package/dist/cli/wasmCommands.js +61 -0
- package/dist/cli/webModuleCommands.js +36 -32
- package/dist/cli/webNetworkCaptureCommands.js +8 -8
- package/dist/cli/webScriptCommands.js +20 -1
- package/dist/cli/webSourceLocationCommands.js +21 -9
- package/dist/cli-runtime/AbortablePromise-BVBemxbD.js +123 -0
- package/dist/cli-runtime/AnalysisProvider-D0Us2OTk.js +27 -0
- package/dist/cli-runtime/AnalysisSnapshotCache-BXS0wRd2.js +710 -0
- package/dist/cli-runtime/ArtifactReader-BXkffc1D.js +55 -0
- package/dist/cli-runtime/ArtifactResourceScope-DQWTcUwE.js +114 -0
- package/dist/cli-runtime/AsarHeader-CnzOzYEH.js +31 -0
- package/dist/cli-runtime/BinarySessionStatus-DnMxMk-r.js +211 -0
- package/dist/cli-runtime/BinaryTargetResolver-CVIJ_s1A.js +1308 -0
- package/dist/cli-runtime/BoundedFileBytes-BU30odTm.js +39 -0
- package/dist/cli-runtime/CdpTargetSession-DGX5pV9w.js +650 -0
- package/dist/cli-runtime/ClientConfigPath-c6jr6INc.js +36 -0
- package/dist/cli-runtime/ClientConfigurationDocument-ffQ9X0Se.js +1957 -0
- package/dist/cli-runtime/ClientRegistrationStatus-DszCyPEU.js +509 -0
- package/dist/cli-runtime/CurrentEntrypointPath-D5FRNdkq.js +14 -0
- package/dist/cli-runtime/DirectAnalysis-BgvAtpN3.js +528 -0
- package/dist/cli-runtime/Doctor-DIpf_I7N.js +588 -0
- package/dist/cli-runtime/ElectronFileScope-dpHm2nrS.js +1054 -0
- package/dist/cli-runtime/ExecFileOutput-BEQs-lDD.js +117 -0
- package/dist/cli-runtime/IdaConfiguration-CtGP7EKo.js +1094 -0
- package/dist/cli-runtime/InterfaceBuilderDecodeBudget-D4omRUe4.js +279 -0
- package/dist/cli-runtime/InventoryProjectionEvidence-DIsI4DJ6.js +49 -0
- package/dist/cli-runtime/InvestigationProviders-DoQRIHii.js +117 -0
- package/dist/cli-runtime/JavaScriptApplicationEvidenceGraph-D5aI_FSJ.js +160 -0
- package/dist/cli-runtime/JavaScriptApplicationWorkflowEvidence-Bz4-V0Ct.js +75 -0
- package/dist/cli-runtime/JavaScriptWorkerMemoryLimit-B1bwMM1a.js +86 -0
- package/dist/cli-runtime/JebMcpEndpoint-DUytrn5G.js +428 -0
- package/dist/cli-runtime/JsonFiles-DQa1PRKy.js +708 -0
- package/dist/cli-runtime/MacCodeSignature-MgYbRK_H.js +24 -0
- package/dist/cli-runtime/MacHopperPaths-CwL5lYPX.js +434 -0
- package/dist/cli-runtime/MachoLoadCommandReader-C7e074Ze.js +510 -0
- package/dist/cli-runtime/ManagedSnapshot-rqyBHcdL.js +4185 -0
- package/dist/cli-runtime/OwnedCommand-Cj9GhmPR.js +112 -0
- package/dist/cli-runtime/PrivateRuntimeRoot-DAy0PiBM.js +263 -0
- package/dist/cli-runtime/ProcessOwnership-DXC5-UWt.js +1378 -0
- package/dist/cli-runtime/ProviderDeadline-8m2pFRDc.js +122 -0
- package/dist/cli-runtime/RegularFile-B_6KPCNQ.js +139 -0
- package/dist/cli-runtime/RegularFileRead-DVlC5faM.js +125 -0
- package/dist/cli-runtime/SafeOutputTree-D6U15GXd.js +524 -0
- package/dist/cli-runtime/SetupHost-FkYWswsq.js +1098 -0
- package/dist/cli-runtime/SupportedClients-DaX6Lt2d.js +1049 -0
- package/dist/cli-runtime/UninstallFailure-1blyKXHE.js +22 -0
- package/dist/cli-runtime/Update-CbTC_eg1.js +143 -0
- package/dist/cli-runtime/UpdateFailure-BcFNxEZZ.js +24 -0
- package/dist/cli-runtime/ZipArtifactReader-B8ZgNe4D.js +248 -0
- package/dist/cli-runtime/analysisErrorCleanup-Do6YeeoD.js +32 -0
- package/dist/cli-runtime/analysisErrorPresentation-DGt7TdsH.js +497 -0
- package/dist/cli-runtime/appleArchiveFormat-tVoI2ykA.js +263 -0
- package/dist/cli-runtime/application__DirectAnalysisStatus-DpOejOf0.js +150 -0
- package/dist/cli-runtime/application__EnhancedTools-oFE2bOjs.js +1787 -0
- package/dist/cli-runtime/application__FunctionAnalysisEvidence-B6osuhvW.js +41 -0
- package/dist/cli-runtime/application__ReconstructionCoverageService-DN3wTFQj.js +32 -0
- package/dist/cli-runtime/application__ReconstructionObligationLedgerService-CKcTppX9.js +815 -0
- package/dist/cli-runtime/application__Setup-XpMaRNjy.js +514 -0
- package/dist/cli-runtime/application__Uninstall-_23pU2yB.js +427 -0
- package/dist/cli-runtime/application__UpdateRuntime-DPvY8ohd.js +345 -0
- package/dist/cli-runtime/application__android__AndroidApplicationService-CFgIFPM4.js +31 -0
- package/dist/cli-runtime/application__apple__AppleApplicationService-Db6QCsun.js +31 -0
- package/dist/cli-runtime/application__harmony__HarmonyApplicationService-CFjocHoK.js +31 -0
- package/dist/cli-runtime/application__javascript__ElectronActiveObservationService-CmVDUI_Z.js +118 -0
- package/dist/cli-runtime/application__javascript__ElectronObservationService-DEsR8KDN.js +63 -0
- package/dist/cli-runtime/application__javascript__JavaScriptApplicationService-CCkp8KBh.js +11450 -0
- package/dist/cli-runtime/application__javascript__JavaScriptApplicationWorkflowService-lPy0tzr3.js +2329 -0
- package/dist/cli-runtime/application__javascript__JavaScriptRuntimeReconciliationService-DWleA8K9.js +88 -0
- package/dist/cli-runtime/application__javascript__JavaScriptSemanticTraceService-DkALH4rL.js +299 -0
- package/dist/cli-runtime/artifactOperationError-B7n03FbD.js +27 -0
- package/dist/cli-runtime/artifacts__ArtifactProvider-zXI0QjSL.js +2187 -0
- package/dist/cli-runtime/binary-BVOr2mgE.js +14206 -0
- package/dist/cli-runtime/browserObservationError-Dx6xRTjb.js +40 -0
- package/dist/cli-runtime/catalogIdentity-DLoXgfIR.js +933 -0
- package/dist/cli-runtime/cli.js +41848 -0
- package/dist/cli-runtime/cliOutput-BC1BdAcB.js +122 -0
- package/dist/cli-runtime/cliOutput.js +5 -0
- package/dist/cli-runtime/cliResultOutput-DsRMI8CJ.js +780 -0
- package/dist/cli-runtime/cliResultOutput.js +5 -0
- package/dist/cli-runtime/composition__browserScenario-DHXC1a8n.js +2927 -0
- package/dist/cli-runtime/composition__electronObservation-GecK2EID.js +555 -0
- package/dist/cli-runtime/composition__electronScenario-CEZnVrAL.js +653 -0
- package/dist/cli-runtime/cutterToolContracts-TZH9EHr5.js +5134 -0
- package/dist/cli-runtime/doctorRuntime-BE5ZX8it.js +258 -0
- package/dist/cli-runtime/dotnet__ManagedStaticProvider-C8_yZCDc.js +5 -0
- package/dist/cli-runtime/errorSchemas-CTRmvMl3.js +601 -0
- package/dist/cli-runtime/javascriptApplicationAnalysis-HgMzVMQw.js +2068 -0
- package/dist/cli-runtime/javascriptExportReturnShapeProjection-Dg00g35t.js +78 -0
- package/dist/cli-runtime/javascriptExportShapeComparisonSchemas-BYnoIqIk.js +1242 -0
- package/dist/cli-runtime/javascriptRuntimeReconciliation-DNjDoL3S.js +1507 -0
- package/dist/cli-runtime/javascriptRuntimeReconciliationSchemas-BWpGWNcI.js +247 -0
- package/dist/cli-runtime/javascriptSemanticTraceSchemas-BTCNcvbc.js +126 -0
- package/dist/cli-runtime/lipo-DSWP6fv-.js +396 -0
- package/dist/cli-runtime/logger-CQQCI4a2.js +48 -0
- package/dist/cli-runtime/machoContainer-C8BIkkq3.js +172 -0
- package/dist/cli-runtime/managedApplicationGraph-B08jb3jq.js +1130 -0
- package/dist/cli-runtime/managedToolContracts-D60QmIYj.js +99 -0
- package/dist/cli-runtime/mcpDoctor.js +359 -0
- package/dist/cli-runtime/mcpStartupPolicy-CVVSOmRc.js +21 -0
- package/dist/cli-runtime/native__NativeMacOSProvider-YBTvUeJO.js +4875 -0
- package/dist/cli-runtime/officialToolContracts-CCFF0an9.js +1501 -0
- package/dist/cli-runtime/propertyListKeys-G8e74YWb.js +248 -0
- package/dist/cli-runtime/providerAdapterError-DAjhICdr.js +25 -0
- package/dist/cli-runtime/providerCleanupError-Ceq8f0wK.js +27 -0
- package/dist/cli-runtime/providerIdentities-Ao1XTvwx.js +31 -0
- package/dist/cli-runtime/providerStartupTimeout-B2tF2LtZ.js +17 -0
- package/dist/cli-runtime/readFileHandleChunks-dp60iZ6v.js +38 -0
- package/dist/cli-runtime/reconstructionObligationLedgerSchemas-Bao0xMr-.js +19478 -0
- package/dist/cli-runtime/rolldown-runtime-DXoylpqc.js +121 -0
- package/dist/cli-runtime/runtimeVersion-CMGd0bDu.js +23 -0
- package/dist/cli-runtime/safeJson-DKKACtdy.js +25 -0
- package/dist/cli-runtime/scanCanonical-KP4T9jSl.js +2724 -0
- package/dist/cli-runtime/snapshotEnvironment-D_tWyOub.js +813 -0
- package/dist/cli-runtime/toolContracts-D2FOG_Nb.js +3721 -0
- package/dist/cli-runtime/toolOutputSchemaGroups-DRiYs1je.js +12070 -0
- package/dist/cli-runtime/workflowInputError-n8Oo-bLA.js +26 -0
- package/dist/cli.js +44 -5
- package/dist/cliBrowserScenarioCommands.js +41 -5
- package/dist/cliCommandNames.js +80 -0
- package/dist/cliEvidenceCommands.js +0 -1
- package/dist/cliJavaScriptRuntimeCommands.js +16 -14
- package/dist/cliJsonInput.js +14 -6
- package/dist/cliLogging.js +50 -14
- package/dist/cliObservationOptions.js +9 -0
- package/dist/cliOutput.js +38 -5
- package/dist/composition/adb.js +3 -0
- package/dist/composition/apktool.js +3 -0
- package/dist/composition/binary.js +4 -0
- package/dist/composition/binaryDiagnostics.js +4 -0
- package/dist/composition/captures.js +3 -0
- package/dist/composition/directAnalysis.js +36 -11
- package/dist/composition/electronFuses.js +4 -0
- package/dist/composition/evm.js +12 -0
- package/dist/composition/flutter.js +3 -0
- package/dist/composition/go.js +4 -0
- package/dist/composition/javascriptAnalysisWorkerProcess.js +49 -0
- package/dist/composition/jeb.js +35 -0
- package/dist/composition/pcap.js +3 -0
- package/dist/composition/resolveWindowsProviderExecutable.js +61 -0
- package/dist/composition/reverseEngineering.js +29 -0
- package/dist/composition/rust.js +4 -0
- package/dist/composition/signals.js +3 -0
- package/dist/composition/sqlite.js +4 -0
- package/dist/composition/wasm.js +22 -0
- package/dist/composition/webNetworkCaptures.js +7 -2
- package/dist/config/environment.js +55 -4
- package/dist/config/ghidraDisabledAnalyzers.js +25 -0
- package/dist/config/ghidraLanguageOverride.js +9 -0
- package/dist/config/homeDirectory.js +9 -6
- package/dist/config/mcpInputSchemaProfile.js +31 -0
- package/dist/config/mcpOutputSchemaProfile.js +22 -0
- package/dist/config/parseConfig.js +36 -19
- package/dist/config/parsers.js +4 -3
- package/dist/config/{ghidraStartupTimeout.js → providerStartupTimeout.js} +7 -3
- package/dist/contracts/adb/adbToolContracts.js +353 -0
- package/dist/contracts/advertisedInputExamples.js +48 -0
- package/dist/contracts/analysisDetail.js +13 -0
- package/dist/contracts/analysisViewApiSurfaceExample.js +68 -0
- package/dist/contracts/analysisViewToolContracts.js +39 -3
- package/dist/contracts/android/androidToolContracts.js +17 -8
- package/dist/contracts/apktool/apktoolToolContracts.js +33 -0
- package/dist/contracts/applicationToolContracts.js +17 -2
- package/dist/contracts/artifactToolContracts.js +21 -6
- package/dist/contracts/browserToolContracts.js +2 -1
- package/dist/contracts/captures/captureToolContracts.js +42 -0
- package/dist/contracts/compactInputSchema.js +276 -0
- package/dist/contracts/cutterToolContracts.js +84 -0
- package/dist/contracts/enhancedToolContracts.js +2 -2
- package/dist/contracts/evm/evmToolContracts.js +30 -15
- package/dist/contracts/firmware/firmwareToolContracts.js +1 -1
- package/dist/contracts/flutter/flutterToolContracts.js +47 -0
- package/dist/contracts/fridaRemoteAddress.js +23 -0
- package/dist/contracts/fridaToolContracts.js +273 -0
- package/dist/contracts/functionComparisonExample.js +12 -1
- package/dist/contracts/functionWorkflowToolContracts.js +1 -1
- package/dist/contracts/gdbToolContracts.js +103 -0
- package/dist/contracts/go/goToolContracts.js +20 -0
- package/dist/contracts/hopperMemoryContracts.js +15 -0
- package/dist/contracts/inputSchemaPresentation.js +91 -24
- package/dist/contracts/investigationExamples.js +1 -0
- package/dist/contracts/javascript/electronToolContracts.js +40 -3
- package/dist/contracts/javascript/javascriptRecoveryToolContracts.js +13 -1
- package/dist/contracts/jeb/jebToolContracts.js +64 -0
- package/dist/contracts/managed/managedToolContracts.js +43 -4
- package/dist/contracts/managed/managedWorkflowExamples.js +7 -1
- package/dist/contracts/managed/managedWorkflowToolContracts.js +4 -30
- package/dist/contracts/mobileApplicationGraphExamples.js +12 -0
- package/dist/contracts/native/binaryDiagnosticsToolContracts.js +27 -4
- package/dist/contracts/native/nativeToolContracts.js +10 -6
- package/dist/contracts/officialToolContracts.js +9 -9
- package/dist/contracts/pcap/pcapToolContracts.js +33 -0
- package/dist/contracts/providerSelection.js +1 -0
- package/dist/contracts/reconstructionReadinessExample.js +126 -119
- package/dist/contracts/reverseEngineeringToolContracts.js +52 -0
- package/dist/contracts/rizinDebugToolContracts.js +96 -0
- package/dist/contracts/rust/rustToolContracts.js +20 -0
- package/dist/contracts/sessionLifecycleInputs.js +34 -2
- package/dist/contracts/sessionToolContracts.js +4 -4
- package/dist/contracts/sessionToolSchemas.js +20 -2
- package/dist/contracts/signals/signalToolContracts.js +40 -0
- package/dist/contracts/sqlite/sqliteToolContracts.js +36 -0
- package/dist/contracts/toolContractExamples.js +35 -0
- package/dist/contracts/toolContractTypes.js +5 -0
- package/dist/contracts/toolContracts.js +32 -0
- package/dist/contracts/toolEffects.js +414 -8
- package/dist/contracts/toolOutputSchemaGroups.js +78 -33
- package/dist/contracts/toolOutputSchemaPrimitives.js +111 -10
- package/dist/contracts/toolSchemaMetadata.js +98 -9
- package/dist/contracts/unknownContractExamples.js +1 -1
- package/dist/contracts/wasm/wasmComparisonContracts.js +52 -0
- package/dist/contracts/wasm/wasmToolContracts.js +33 -0
- package/dist/contracts/webNetworkCaptureToolContracts.js +15 -4
- package/dist/cutter/CutterBridgeClient.js +621 -0
- package/dist/cutter/CutterBridgeService.js +139 -0
- package/dist/doctorRuntime.js +20 -8
- package/dist/domain/adb/adbDeviceAnalysis.js +605 -0
- package/dist/domain/analysisErrorBase.js +20 -0
- package/dist/domain/analysisErrorCleanup.js +29 -0
- package/dist/domain/analysisErrorCore.js +19 -0
- package/dist/domain/analysisErrorPresentation.js +75 -22
- package/dist/domain/analysisErrorProjection.js +35 -13
- package/dist/domain/analysisProfile.js +7 -3
- package/dist/domain/analysisSnapshot.js +313 -185
- package/dist/domain/analysisView/WebNetworkApiSurfaceAccumulator.js +414 -0
- package/dist/domain/analysisView/analysisView.js +417 -45
- package/dist/domain/analysisView/analysisViewCoverage.js +32 -0
- package/dist/domain/analysisView/analysisViewErrors.js +4 -0
- package/dist/domain/analysisView/analysisViewParent.js +12 -0
- package/dist/domain/analysisView/analysisViewText.js +29 -0
- package/dist/domain/analysisView/androidPackageView.js +102 -0
- package/dist/domain/analysisView/artifactInventoryView.js +140 -0
- package/dist/domain/analysisView/binaryLayoutView.js +13 -4
- package/dist/domain/analysisView/dartAotView.js +93 -0
- package/dist/domain/analysisView/evmInterfaceView.js +105 -0
- package/dist/domain/analysisView/interfaceBuilderView.js +182 -0
- package/dist/domain/analysisView/javascriptApplicationView.js +29 -26
- package/dist/domain/analysisView/machoView.js +186 -0
- package/dist/domain/analysisView/managedArtifactView.js +108 -0
- package/dist/domain/analysisView/managedMemberView.js +209 -0
- package/dist/domain/analysisView/nativeFunctionView.js +150 -0
- package/dist/domain/analysisView/pcapCaptureView.js +264 -0
- package/dist/domain/analysisView/qlogCaptureView.js +198 -0
- package/dist/domain/analysisView/wasmArtifactView.js +162 -0
- package/dist/domain/analysisView/webNetworkApiSurfaceView.js +123 -0
- package/dist/domain/analysisView/webNetworkCaptureView.js +388 -0
- package/dist/domain/android/androidAnalysis.js +36 -2
- package/dist/domain/android/androidApplication.js +57 -80
- package/dist/domain/apktool/apktoolResourceAnalysis.js +89 -0
- package/dist/domain/apple/appleApplication.js +71 -52
- package/dist/domain/apple/appleArchiveFormat.js +184 -0
- package/dist/domain/apple/appleAssetCatalog.js +15 -0
- package/dist/domain/apple/appleBundleAnatomy.js +96 -29
- package/dist/domain/apple/dyldPaths.js +18 -3
- package/dist/domain/apple/dylibResolution.js +21 -11
- package/dist/domain/apple/dylibResolutionFindings.js +8 -9
- package/dist/domain/apple/interfaceBuilderGraph.js +72 -45
- package/dist/domain/apple/interfaceBuilderKeyedArchive.js +38 -9
- package/dist/domain/apple/machoContainer.js +120 -8
- package/dist/domain/apple/machoCpuIdentity.js +4 -0
- package/dist/domain/apple/plistValue.js +6 -1
- package/dist/domain/artifactComparison.js +130 -25
- package/dist/domain/artifactDecompressionBudget.js +26 -0
- package/dist/domain/artifactGraph.js +28 -9
- package/dist/domain/artifactIdentity.js +33 -2
- package/dist/domain/artifactInspection.js +47 -45
- package/dist/domain/artifactIntegrityPolicy.js +10 -0
- package/dist/domain/artifactInventoryEvidence.js +148 -51
- package/dist/domain/artifactPathSyntax.js +1 -1
- package/dist/domain/binaryTarget.js +253 -80
- package/dist/domain/binaryTargetTypes.js +21 -1
- package/dist/domain/browserNetworkEvidence.js +4 -0
- package/dist/domain/browserObservation.js +88 -29
- package/dist/domain/browserObservationSchemas.js +12 -5
- package/dist/domain/browserScenarioCapture.js +2 -1
- package/dist/domain/browserScenarioCaptureValues.js +26 -2
- package/dist/domain/browserScenarioDiff.js +120 -11
- package/dist/domain/browserScenarioDiffEvidence.js +46 -13
- package/dist/domain/browserScenarioDiffValues.js +10 -3
- package/dist/domain/browserScenarioNetworkComparison.js +158 -0
- package/dist/domain/browserScenarioNormalization.js +10 -13
- package/dist/domain/browserScenarioValues.js +2 -12
- package/dist/domain/browserSession.js +2 -2
- package/dist/domain/bundleComparison.js +1 -5
- package/dist/domain/callPath.js +40 -3
- package/dist/domain/canonicalJsonDigestSteps.js +34 -12
- package/dist/domain/captures/packetCapture.js +138 -0
- package/dist/domain/captures/packetFields.js +81 -0
- package/dist/domain/changedBehavior.js +43 -41
- package/dist/domain/compactStringIdentity.js +9 -0
- package/dist/domain/comparisonSourceEvidence.js +6 -0
- package/dist/domain/dosCom.js +2 -2
- package/dist/domain/dosMz.js +52 -14
- package/dist/domain/electron/electronFuses.js +360 -0
- package/dist/domain/elfFixedHeader.js +42 -0
- package/dist/domain/evidence.js +104 -38
- package/dist/domain/evidenceBundle.js +58 -20
- package/dist/domain/evidenceErrors.js +5 -0
- package/dist/domain/evidenceRecordSummary.js +144 -0
- package/dist/domain/evm/evmInterface.js +18 -4
- package/dist/domain/evm/solidityMetadata.js +70 -0
- package/dist/domain/explicitSensitiveFailure.js +42 -24
- package/dist/domain/firmware/firmwareAnalysis.js +29 -0
- package/dist/domain/flutter/flutterBuildAnalysis.js +141 -0
- package/dist/domain/functionCallCoverage.js +60 -0
- package/dist/domain/functionComparisonDimensions.js +101 -10
- package/dist/domain/functionComparisonNormalization.js +66 -10
- package/dist/domain/functionComparisonResults.js +7 -6
- package/dist/domain/functionComparisonSchemas.js +14 -3
- package/dist/domain/functionDossierEvidence.js +3 -0
- package/dist/domain/go/goBinary.js +96 -0
- package/dist/domain/harmony/harmonyApplication.js +156 -0
- package/dist/domain/hopperErrors.js +15 -16
- package/dist/domain/hopperPublisher.js +12 -0
- package/dist/domain/hopperValues.js +112 -34
- package/dist/domain/inputIssueProjection.js +16 -1
- package/dist/domain/javascript/electronObservation.js +4 -1
- package/dist/domain/javascript/electronStaticAnalysisBrowser.js +24 -24
- package/dist/domain/javascript/electronStaticAnalysisIpc.js +13 -20
- package/dist/domain/javascript/electronStaticAnalysisNative.js +85 -41
- package/dist/domain/javascript/electronStaticAnalysisValues.js +30 -8
- package/dist/domain/javascript/electronWrappedCallPaths.js +498 -0
- package/dist/domain/javascript/htmlArtifactReferences.js +94 -4
- package/dist/domain/javascript/javascriptAnalysisResourceControls.js +65 -0
- package/dist/domain/javascript/javascriptApplicationAnalysis.js +7 -1
- package/dist/domain/javascript/javascriptApplicationChangeGraph.js +13 -8
- package/dist/domain/javascript/javascriptApplicationEvidenceSchemas.js +1 -1
- package/dist/domain/javascript/javascriptApplicationGraph.js +96 -19
- package/dist/domain/javascript/javascriptApplicationGraphSchemas.js +1 -0
- package/dist/domain/javascript/javascriptApplicationProjectionResources.js +43 -0
- package/dist/domain/javascript/javascriptApplicationVersionItems.js +28 -12
- package/dist/domain/javascript/javascriptApplicationVersionKeys.js +40 -19
- package/dist/domain/javascript/javascriptArtifactFiles.js +2 -1
- package/dist/domain/javascript/javascriptAstFingerprint.js +100 -39
- package/dist/domain/javascript/javascriptAstValues.js +81 -0
- package/dist/domain/javascript/javascriptBootstrap.js +94 -0
- package/dist/domain/javascript/javascriptBootstrapIntegrity.js +372 -0
- package/dist/domain/javascript/javascriptBuiltinResourceMethods.js +8 -0
- package/dist/domain/javascript/javascriptBundledRequireOrigin.js +291 -0
- package/dist/domain/javascript/javascriptContextBridgeExposure.js +23 -0
- package/dist/domain/javascript/javascriptElectronMemberWrites.js +114 -0
- package/dist/domain/javascript/javascriptExportShapeComparisonSchemas.js +6 -5
- package/dist/domain/javascript/javascriptExportShapeVariants.js +1 -1
- package/dist/domain/javascript/javascriptFeatureSeed.js +33 -16
- package/dist/domain/javascript/javascriptFeatureTrace.js +9 -3
- package/dist/domain/javascript/javascriptFeatureTraceSchemas.js +42 -11
- package/dist/domain/javascript/javascriptIntrinsicInvocation.js +132 -0
- package/dist/domain/javascript/javascriptModuleDeclaration.js +28 -0
- package/dist/domain/javascript/javascriptModuleInterop.js +618 -0
- package/dist/domain/javascript/javascriptModuleResolutionMode.js +18 -0
- package/dist/domain/javascript/javascriptModuleSemanticIr.js +15 -0
- package/dist/domain/javascript/javascriptModuleSpecifier.js +5 -0
- package/dist/domain/javascript/javascriptNativeHandoff.js +6 -2
- package/dist/domain/javascript/javascriptPackageImportAliases.js +58 -0
- package/dist/domain/javascript/javascriptRecovery.js +12 -5
- package/dist/domain/javascript/javascriptRpcEndpoints.js +331 -0
- package/dist/domain/javascript/javascriptRuntimeLoadState.js +12 -3
- package/dist/domain/javascript/javascriptRuntimeObservation.js +4 -1
- package/dist/domain/javascript/javascriptRuntimeReconciliationCaptureParsing.js +10 -4
- package/dist/domain/javascript/javascriptRuntimeReconciliationGraph.js +7 -2
- package/dist/domain/javascript/javascriptRuntimeReconciliationMatching.js +15 -2
- package/dist/domain/javascript/javascriptRuntimeReconciliationResult.js +0 -1
- package/dist/domain/javascript/javascriptRuntimeReconciliationSchemas.js +5 -4
- package/dist/domain/javascript/javascriptRuntimeStaticCandidates.js +121 -22
- package/dist/domain/javascript/javascriptSemanticAmbientWrites.js +251 -0
- package/dist/domain/javascript/javascriptSemanticAnalysis.js +493 -104
- package/dist/domain/javascript/javascriptSemanticAsyncEffects.js +17 -34
- package/dist/domain/javascript/javascriptSemanticCallResolution.js +4 -3
- package/dist/domain/javascript/javascriptSemanticCallableResults.js +42 -0
- package/dist/domain/javascript/javascriptSemanticCallableStack.js +52 -0
- package/dist/domain/javascript/javascriptSemanticCalls.js +14 -12
- package/dist/domain/javascript/javascriptSemanticChildProcesses.js +42 -55
- package/dist/domain/javascript/javascriptSemanticDataEffectHelpers.js +428 -32
- package/dist/domain/javascript/javascriptSemanticDataEffects.js +14 -20
- package/dist/domain/javascript/javascriptSemanticDependencies.js +69 -0
- package/dist/domain/javascript/javascriptSemanticDerivedAnalysis.js +15 -4
- package/dist/domain/javascript/javascriptSemanticFileProjection.js +1 -0
- package/dist/domain/javascript/javascriptSemanticFingerprints.js +51 -53
- package/dist/domain/javascript/javascriptSemanticGraph.js +74 -24
- package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +2 -11
- package/dist/domain/javascript/javascriptSemanticIterationSources.js +41 -8
- package/dist/domain/javascript/javascriptSemanticMemberMutations.js +538 -151
- package/dist/domain/javascript/javascriptSemanticMutationInitializers.js +199 -3
- package/dist/domain/javascript/javascriptSemanticMutationValues.js +78 -35
- package/dist/domain/javascript/javascriptSemanticObjectReferences.js +671 -0
- package/dist/domain/javascript/javascriptSemanticObjects.js +27 -17
- package/dist/domain/javascript/javascriptSemanticProjection.js +202 -56
- package/dist/domain/javascript/javascriptSemanticPromises.js +6 -9
- package/dist/domain/javascript/javascriptSemanticPropertyPaths.js +77 -0
- package/dist/domain/javascript/javascriptSemanticProvenance.js +5 -1
- package/dist/domain/javascript/javascriptSemanticQuery.js +34 -31
- package/dist/domain/javascript/javascriptSemanticQueryIdentity.js +1 -3
- package/dist/domain/javascript/javascriptSemanticReferenceSources.js +25 -0
- package/dist/domain/javascript/javascriptSemanticRequireOrigin.js +331 -8
- package/dist/domain/javascript/javascriptSemanticResources.js +6 -40
- package/dist/domain/javascript/javascriptSemanticReturnedReferences.js +233 -0
- package/dist/domain/javascript/javascriptSemanticReturns.js +49 -52
- package/dist/domain/javascript/javascriptSemanticState.js +61 -4
- package/dist/domain/javascript/javascriptSemanticTraversal.js +25 -5
- package/dist/domain/javascript/javascriptSemanticValues.js +260 -35
- package/dist/domain/javascript/javascriptSourceAnalysis.js +1 -0
- package/dist/domain/javascript/javascriptSourceMapPaths.js +44 -17
- package/dist/domain/javascript/javascriptSourceParser.js +72 -3
- package/dist/domain/javascript/javascriptSourceSelection.js +11 -0
- package/dist/domain/javascript/javascriptStaticAnalysis.js +72 -26
- package/dist/domain/javascript/javascriptStaticAnalysisBundler.js +100 -24
- package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +271 -47
- package/dist/domain/javascript/javascriptStaticAnalysisFindings.js +8 -4
- package/dist/domain/javascript/javascriptStaticAnalysisHelpers.js +166 -56
- package/dist/domain/javascript/javascriptStaticAnalysisState.js +2 -0
- package/dist/domain/javascript/javascriptStaticAnalysisTypes.js +2 -1
- package/dist/domain/javascript/javascriptSymbolicBindings.js +836 -0
- package/dist/domain/javascript/javascriptSymbolicControlFlow.js +40 -0
- package/dist/domain/javascript/javascriptSymbolicValues.js +34 -0
- package/dist/domain/javascript/sourceToBundleComparison.js +3 -1
- package/dist/domain/javascript/sourceToBundleComparisonSchemas.js +2 -0
- package/dist/domain/javascript/sourceToBundleSignals.js +47 -13
- package/dist/domain/jeb/jebAnalysis.js +114 -0
- package/dist/domain/jsonShape.js +63 -52
- package/dist/domain/jsonValue.js +40 -12
- package/dist/domain/localPath.js +6 -3
- package/dist/domain/managed/managedApplicationGraph.js +42 -0
- package/dist/domain/managed/managedApplicationGraphCoverage.js +12 -2
- package/dist/domain/managed/managedApplicationGraphNodes.js +32 -23
- package/dist/domain/managed/managedArtifact.js +52 -1
- package/dist/domain/managed/managedInspectionEvidence.js +12 -0
- package/dist/domain/managed/managedMemberComparison.js +3 -0
- package/dist/domain/managed/managedMemberComparisonCoverage.js +23 -3
- package/dist/domain/managed/managedMemberComparisonItems.js +23 -19
- package/dist/domain/managed/managedMemberComparisonMatch.js +209 -18
- package/dist/domain/managed/managedNativeVerificationMatch.js +49 -26
- package/dist/domain/managed/managedNativeVerificationSchemas.js +13 -2
- package/dist/domain/managed/managedReconstruction.js +5 -8
- package/dist/domain/mobileApplicationGraphProjection.js +80 -0
- package/dist/domain/native/addressCoordinate.js +11 -0
- package/dist/domain/native/binaryLayout.js +2 -4
- package/dist/domain/native/bytePattern.js +100 -0
- package/dist/domain/native/nativeAotPe.js +1408 -0
- package/dist/domain/native/nativeInspection.js +38 -4
- package/dist/domain/native/nativeInstruction.js +38 -2
- package/dist/domain/native/nativeInvestigationGraph.js +9 -5
- package/dist/domain/native/nativeLoadImage.js +19 -1
- package/dist/domain/native/nativeMetadataRecovery.js +79 -6
- package/dist/domain/native/nativeUiObservation.js +5 -6
- package/dist/domain/native/objcSwiftMetadata.js +4 -1
- package/dist/domain/native/peResources.js +100 -0
- package/dist/domain/native/recordedCrash.js +79 -10
- package/dist/domain/nativeConvention.js +33 -0
- package/dist/domain/offsetDateTime.js +60 -0
- package/dist/domain/pcap/pcapAnalysis.js +91 -0
- package/dist/domain/pcap/pcapEvidence.js +15 -0
- package/dist/domain/peMachine.js +36 -0
- package/dist/domain/pngHeader.js +18 -0
- package/dist/domain/process/processCapture.js +91 -1
- package/dist/domain/process/processCaptureCoverage.js +26 -3
- package/dist/domain/process/processCaptureExample.js +26 -0
- package/dist/domain/process/processCaptureValidation.js +112 -8
- package/dist/domain/process/processComparison.js +41 -13
- package/dist/domain/process/processScenario.js +66 -7
- package/dist/domain/process/processTraceEvaluation.js +54 -50
- package/dist/domain/process/processTraceSpecification.js +243 -89
- package/dist/domain/propertyListKeys.js +214 -12
- package/dist/domain/propertyListXmlText.js +20 -4
- package/dist/domain/providerAdapterError.js +0 -5
- package/dist/domain/providerConfigurationRefusal.js +12 -0
- package/dist/domain/providerSelectionError.js +2 -1
- package/dist/domain/qlogCapture.js +62 -0
- package/dist/domain/rawBinary.js +96 -0
- package/dist/domain/reconstructionCoverage.js +5 -1
- package/dist/domain/reconstructionCoverageEvaluation.js +18 -15
- package/dist/domain/reconstructionCoverageVerifierResults.js +35 -0
- package/dist/domain/reconstructionObligationLedgerIntegrity.js +114 -0
- package/dist/domain/reconstructionObligationLedgerSchemas.js +104 -1
- package/dist/domain/reconstructionReadiness.js +4 -8
- package/dist/domain/reconstructionReadinessJourneyFindings.js +4 -1
- package/dist/domain/reconstructionUnknowns.js +9 -1
- package/dist/domain/reconstructionVerification.js +54 -25
- package/dist/domain/recordedTransportUrl.js +59 -0
- package/dist/domain/referenceSourceClassification.js +27 -23
- package/dist/domain/referenceSourceGraph.js +70 -23
- package/dist/domain/referenceSourceImportParsing.js +29 -16
- package/dist/domain/referenceSourcePathIdentity.js +32 -0
- package/dist/domain/referenceSourceRequireBindings.js +130 -0
- package/dist/domain/referenceSourceSummary.js +92 -0
- package/dist/domain/relationshipCoverage.js +44 -0
- package/dist/domain/residualUnknown.js +93 -26
- package/dist/domain/reverseEngineering.js +31 -0
- package/dist/domain/runtimeVersion.js +8 -0
- package/dist/domain/rust/rustBinary.js +200 -0
- package/dist/domain/signals/annotationTextWindow.js +31 -0
- package/dist/domain/signals/signalDecoders.js +69 -0
- package/dist/domain/signals/signalRecording.js +115 -0
- package/dist/domain/sourceMapContents.js +10 -3
- package/dist/domain/sourceMapEnvelope.js +17 -11
- package/dist/domain/sqlite/sqliteDatabase.js +188 -0
- package/dist/domain/staticRuntimeCorrelation.js +7 -9
- package/dist/domain/swiftSymbolClassification.js +17 -0
- package/dist/domain/symbolAnalysis.js +16 -4
- package/dist/domain/urlComponents.js +6 -0
- package/dist/domain/wasm/wasmArtifact.js +119 -0
- package/dist/domain/wasm/wasmInterface.js +89 -0
- package/dist/domain/webBundleAnalysis.js +14 -3
- package/dist/domain/webBundleAnalyzerAst.js +7 -2
- package/dist/domain/webBundleAnalyzerInspection.js +68 -40
- package/dist/domain/webBundleAnalyzerResult.js +18 -6
- package/dist/domain/webCaptureDiff.js +233 -34
- package/dist/domain/webCaptureFrameComparison.js +49 -0
- package/dist/domain/webMcpDiscovery.js +5 -2
- package/dist/domain/webModuleImports.js +22 -27
- package/dist/domain/webModuleTrace.js +3 -8
- package/dist/domain/webNetworkCapture.js +101 -39
- package/dist/domain/webNetworkCaptureCoordinates.js +21 -0
- package/dist/domain/webRuntime.js +0 -1
- package/dist/domain/webScreenshot.js +2 -2
- package/dist/domain/webScriptArtifacts.js +2 -4
- package/dist/domain/webScriptExport.js +6 -8
- package/dist/domain/webScriptExportError.js +10 -4
- package/dist/domain/webScriptExportPlan.js +9 -15
- package/dist/domain/webSourceLocation.js +20 -9
- package/dist/domain/zipPackageFormat.js +31 -2
- package/dist/domain/zodCollectionSteps.js +24 -0
- package/dist/dotnet/ManagedArtifactInspector.js +81 -54
- package/dist/dotnet/ManagedDecodeBudget.js +138 -0
- package/dist/dotnet/ManagedMemberInspector.js +113 -26
- package/dist/dotnet/ManagedMemberInspectorCore.js +356 -140
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +112 -38
- package/dist/dotnet/ManagedMemberOwnership.js +65 -0
- package/dist/dotnet/ManagedMemberPointers.js +69 -0
- package/dist/dotnet/ManagedMemberRows.js +182 -44
- package/dist/dotnet/ManagedMetadataHeaps.js +123 -27
- package/dist/dotnet/ManagedMetadataInventory.js +5 -5
- package/dist/dotnet/ManagedMetadataInventoryRows.js +56 -63
- package/dist/dotnet/ManagedMetadataLayout.js +19 -5
- package/dist/dotnet/ManagedMetadataRowSizes.js +1 -1
- package/dist/dotnet/ManagedMethodBodyReader.js +34 -11
- package/dist/dotnet/ManagedMethodSpecs.js +78 -0
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +5 -4
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +52 -44
- package/dist/dotnet/ManagedPeReader.js +96 -52
- package/dist/dotnet/ManagedReaderFailure.js +11 -1
- package/dist/dotnet/ManagedSnapshot.js +88 -0
- package/dist/dotnet/ManagedStaticProvider.js +57 -35
- package/dist/dotnet/ManagedTypeMemberLists.js +105 -0
- package/dist/dotnet/ManagedTypeNames.js +98 -0
- package/dist/dotnet/ManagedUserStrings.js +75 -0
- package/dist/electron/ElectronFusePath.js +247 -0
- package/dist/electron/ElectronFuseProvider.js +113 -0
- package/dist/electron/ElectronFuseReader.js +317 -0
- package/dist/evaluation/AgentEvaluationFixtures.js +194 -11
- package/dist/evaluation/AgentEvaluationReport.js +9 -5
- package/dist/evaluation/CodexAgentEval.js +58 -49
- package/dist/evaluation/KnownAnswerEvaluation.js +126 -57
- package/dist/evm/EvmoleFailures.js +19 -16
- package/dist/evm/EvmoleInterfaceAdapter.js +5 -1
- package/dist/evm/EvmoleInterfaceProvider.js +198 -23
- package/dist/evm/EvmoleInterfaceWorker.js +2 -0
- package/dist/evm/SolidityMetadata.js +139 -0
- package/dist/filesystem/OwnedDirectoryHandle.js +29 -0
- package/dist/filesystem/OwnedFileHandle.js +36 -0
- package/dist/filesystem/OwnedStagedOutput.js +138 -0
- package/dist/filesystem/RegularFile.js +81 -5
- package/dist/filesystem/StableFileHash.js +46 -0
- package/dist/filesystem/readFileHandleChunks.js +35 -0
- package/dist/firmware/FirmwareCommand.js +27 -5
- package/dist/firmware/FirmwareFiles.js +18 -7
- package/dist/firmware/FirmwareProvider.js +158 -32
- package/dist/firmware/FirmwarePublication.js +242 -4
- package/dist/firmware/FirmwareRelease.js +1 -0
- package/dist/firmware/FirmwareReports.js +202 -12
- package/dist/flutter/DartElf.js +418 -0
- package/dist/flutter/ElfBuildId.js +137 -0
- package/dist/flutter/ElfLoadMap.js +91 -0
- package/dist/flutter/FlutterBuildProvider.js +826 -0
- package/dist/flutter/FlutterPayloadScan.js +180 -0
- package/dist/frida/FridaInstrumentationManager.js +1104 -0
- package/dist/gdb/GdbSessionManager.js +1451 -0
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraAnalysisProfile.js +175 -6
- package/dist/ghidra/GhidraAnalysisSeeds.js +211 -0
- package/dist/ghidra/GhidraClient.js +208 -29
- package/dist/ghidra/GhidraDiagnostics.js +18 -8
- package/dist/ghidra/GhidraDoctor.js +15 -12
- package/dist/ghidra/GhidraFunctionValues.js +73 -2
- package/dist/ghidra/GhidraInstallation.js +216 -20
- package/dist/ghidra/GhidraInstallationPolicy.js +79 -29
- package/dist/ghidra/GhidraInventoryValues.js +53 -1
- package/dist/ghidra/GhidraJavaLaunch.js +91 -10
- package/dist/ghidra/GhidraJavaProperties.js +117 -0
- package/dist/ghidra/GhidraLanguageCatalog.js +169 -0
- package/dist/ghidra/GhidraLauncher.js +306 -88
- package/dist/ghidra/GhidraLoadImageAttest.js +74 -7
- package/dist/ghidra/GhidraLoadImageValues.js +72 -0
- package/dist/ghidra/GhidraMipsProfile.js +315 -0
- package/dist/ghidra/GhidraPeProfile.js +21 -0
- package/dist/ghidra/GhidraPowerPcProfile.js +51 -0
- package/dist/ghidra/GhidraProvider.js +106 -20
- package/dist/ghidra/GhidraProviderCapabilities.js +30 -19
- package/dist/ghidra/GhidraProviderClient.js +520 -56
- package/dist/ghidra/GhidraPspExtension.js +140 -0
- package/dist/ghidra/GhidraPspProfile.js +59 -0
- package/dist/ghidra/GhidraRawBinaryLanguage.js +40 -0
- package/dist/ghidra/GhidraRiscvProfile.js +100 -0
- package/dist/ghidra/GhidraSessionError.js +155 -11
- package/dist/ghidra/GhidraSessionValues.js +75 -2
- package/dist/ghidra/GhidraTransport.js +2 -1
- package/dist/go/GoBinaryContainer.js +140 -0
- package/dist/go/GoBinaryImage.js +210 -0
- package/dist/go/GoBinaryProvider.js +151 -0
- package/dist/go/GoElfImage.js +211 -0
- package/dist/go/GoMachoImage.js +164 -0
- package/dist/go/GoModuleText.js +217 -0
- package/dist/go/GoPeImage.js +124 -0
- package/dist/hopper/BridgeLauncher.js +35 -2
- package/dist/hopper/HopperAnalysisProfile.js +21 -9
- package/dist/hopper/HopperCleanup.js +15 -3
- package/dist/hopper/HopperClient.js +203 -42
- package/dist/hopper/HopperMacPublisher.js +29 -0
- package/dist/hopper/HopperMachOImage.js +61 -27
- package/dist/hopper/HopperProcessDiagnostic.js +27 -0
- package/dist/hopper/HopperProvider.js +68 -26
- package/dist/hopper/HopperProviderCapabilities.js +7 -3
- package/dist/hopper/HopperRequestQueue.js +17 -5
- package/dist/hopper/HopperSessionValues.js +10 -1
- package/dist/hopper/HopperTargetLease.js +66 -19
- package/dist/ida/IdaBusyHealth.js +44 -0
- package/dist/ida/IdaCallGraph.js +134 -0
- package/dist/ida/IdaConfiguration.js +7 -2
- package/dist/ida/IdaDiagnosticRedactor.js +199 -0
- package/dist/ida/IdaDiagnosticWriter.js +62 -0
- package/dist/ida/IdaDoctor.js +7 -5
- package/dist/ida/IdaJsonDiagnostic.js +138 -0
- package/dist/ida/IdaMcpConnection.js +297 -27
- package/dist/ida/IdaNativeProtocol.js +93 -0
- package/dist/ida/IdaOperationRunner.js +249 -40
- package/dist/ida/IdaProtocolValues.js +86 -4
- package/dist/ida/IdaProvider.js +34 -8
- package/dist/ida/IdaProviderCapabilities.js +37 -8
- package/dist/ida/IdaSessionClient.js +332 -53
- package/dist/ida/IdaWorkspace.js +57 -7
- package/dist/inspector/V8InspectorCaptureProjection.js +7 -2
- package/dist/inspector/V8InspectorEndpoint.js +15 -13
- package/dist/inspector/V8InspectorProvider.js +41 -7
- package/dist/javascript/analysis/JavaScriptAnalysisTransfer.js +337 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorker.js +594 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerProtocol.js +65 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerSchemas.js +590 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerServer.js +126 -0
- package/dist/javascript/recovery/RecoveryFiles.js +68 -12
- package/dist/javascript/recovery/WakaruCommand.js +22 -9
- package/dist/javascript/recovery/WakaruExecution.js +30 -18
- package/dist/javascript/recovery/WakaruProvider.js +150 -24
- package/dist/javascript/recovery/WakaruPublication.js +38 -14
- package/dist/javascript/recovery/WakaruRelease.js +11 -4
- package/dist/javascript/recovery/WakaruReport.js +15 -9
- package/dist/javascript/recovery/WakaruVersion.js +24 -0
- package/dist/javascript/sourceMaps/DecodedSourceMap.js +2 -16
- package/dist/javascript/sourceMaps/SourceMapCommand.js +38 -7
- package/dist/javascript/sourceMaps/SourceMapDecoder.js +84 -10
- package/dist/javascript/sourceMaps/SourceMapFormat.js +26 -28
- package/dist/javascript/sourceMaps/TraceSourceMap.js +34 -6
- package/dist/jeb/JebMcpConnection.js +186 -0
- package/dist/jeb/JebMcpEndpoint.js +45 -0
- package/dist/jeb/JebProvider.js +297 -0
- package/dist/logger.js +14 -1
- package/dist/main/shutdown.js +3 -0
- package/dist/main/transport.js +48 -4
- package/dist/main.js +14 -3
- package/dist/mcp/AnalysisSnapshotFiles-BAbiJQOc.js +1412 -0
- package/dist/mcp/ArtifactProvider-DViCU_rn.js +2183 -0
- package/dist/mcp/ArtifactProviderMetadata-b7pOK5_t.js +76 -0
- package/dist/mcp/ArtifactReader-OyM03Gjn.js +55 -0
- package/dist/mcp/ArtifactResourceScope-P3tq5z8Z.js +162 -0
- package/dist/mcp/AsarHeader-WsPgoooH.js +31 -0
- package/dist/mcp/BinarySessionStatus-B4P9gf-S.js +212 -0
- package/dist/mcp/BinaryTargetResolver-BMaE_0H1.js +1427 -0
- package/dist/mcp/BoundedFileBytes-DuczXiQZ.js +68 -0
- package/dist/mcp/CdpCaptureDocuments-HDiF2O7k.js +746 -0
- package/dist/mcp/CdpCaptureValues-M-j6CIh1.js +90 -0
- package/dist/mcp/CdpConnection-BpDfz4MK.js +570 -0
- package/dist/mcp/CdpOptionalCommand-BPjRD9Kz.js +120 -0
- package/dist/mcp/CdpTargetSession-BsPoKhEU.js +86 -0
- package/dist/mcp/DirectAnalysis-DrafbXke.js +409 -0
- package/dist/mcp/DirectAnalysisStatus-CjjeDLzW.js +44 -0
- package/dist/mcp/ElectronFileScope-BPG_YoyU.js +110 -0
- package/dist/mcp/InterfaceBuilderDecodeBudget-5F2AkxJT.js +652 -0
- package/dist/mcp/ManagedStaticProvider-BthZbKyZ.js +5028 -0
- package/dist/mcp/NativeMacOSProvider-Bh79k8dI.js +4867 -0
- package/dist/mcp/NativeMacOSProviderMetadata-N1lPOaY_.js +307 -0
- package/dist/mcp/ProcedureAddressResolution-CQpuwm1h.js +19 -0
- package/dist/mcp/ProcessOwnership-Bl_3ejLe.js +1502 -0
- package/dist/mcp/ProviderDeadline-DskQ94YD.js +932 -0
- package/dist/mcp/WorkflowEvidence-umWrB_wm.js +111 -0
- package/dist/mcp/analysisErrorCore-DXRTvF_m.js +235 -0
- package/dist/mcp/analysisErrorProjection-BN0EPM-3.js +892 -0
- package/dist/mcp/artifactOperationError-CkHMMaf7.js +27 -0
- package/dist/mcp/artifactToolContracts-Di4qZlEt.js +72 -0
- package/dist/mcp/browserObservation-C0s4i8UI.js +4468 -0
- package/dist/mcp/browserObservationError-CyLugqX4.js +40 -0
- package/dist/mcp/browserObservationSchemas-tgqjH7aA.js +573 -0
- package/dist/mcp/browserScenario-CAQ8Fns9.js +2929 -0
- package/dist/mcp/browserScenarioCapture-CTNFN-FI.js +479 -0
- package/dist/mcp/canonicalDigest-Bi_0_zGi.js +71 -0
- package/dist/mcp/digests-BFoWUT_-.js +223 -0
- package/dist/mcp/electronActiveObservation-lDvQTMR0.js +226 -0
- package/dist/mcp/electronObservation-DFOFEood.js +112 -0
- package/dist/mcp/electronObservation-i7LcILQ-.js +562 -0
- package/dist/mcp/electronScenario-nCzE6IfJ.js +653 -0
- package/dist/mcp/emptyArraySchema-tL6Qymyd.js +140 -0
- package/dist/mcp/enhancedInputs-DgdEnzHy.js +56 -0
- package/dist/mcp/javascriptRuntimeObservation-61NhCf7H.js +690 -0
- package/dist/mcp/javascriptRuntimeObservation-PIUoLfX6.js +121 -0
- package/dist/mcp/jsonSerialization-V-wWiFRE.js +152 -0
- package/dist/mcp/lipo-Bnkoq_6W.js +502 -0
- package/dist/mcp/localPath-AxvW9aPe.js +19 -0
- package/dist/mcp/logger-BQY5ulYv.js +48 -0
- package/dist/mcp/main-kBXHZ8S5.js +69390 -0
- package/dist/mcp/main.js +6 -0
- package/dist/mcp/managedToolContracts-CK--I_s7.js +101 -0
- package/dist/mcp/nativeValueTrace-DR9UE62L.js +3439 -0
- package/dist/mcp/officialToolContracts-B67NJ2tC.js +1413 -0
- package/dist/mcp/pngHeader-DQ-ObyY2.js +147 -0
- package/dist/mcp/propertyListKeys-DD25WsjI.js +553 -0
- package/dist/mcp/providerAdapterError-sDxToNal.js +25 -0
- package/dist/mcp/providerIdentities--ptAh481.js +31 -0
- package/dist/mcp/providerIdentity-BCQ5n5tw.js +16 -0
- package/dist/mcp/providerOperationHealth-CTYa3iLf.js +48 -0
- package/dist/mcp/rolldown-runtime-BjeaiXFo.js +121 -0
- package/dist/mcp/safeJson-NeGfpkrI.js +25 -0
- package/dist/mcp/scanCanonical-CRXSpule.js +3982 -0
- package/dist/mcp/serverIdentity-Cio4iFV3.js +1328 -0
- package/dist/mcp/sourceMapEnvelope-C0uJlrOh.js +94 -0
- package/dist/mcp/toolContracts-BW05wpcr.js +12200 -0
- package/dist/mcp/toolOutputSchemaGroups-ColvNZ1r.js +17533 -0
- package/dist/mcp/unicodeCodePointOrder-BezCbTpg.js +26 -0
- package/dist/mcp/webContentArtifact-Dzjc1z-R.js +284 -0
- package/dist/mcp/webRuntime-K__NYzXm.js +74 -0
- package/dist/mcp/webSourceLocation-DbMAT2J9.js +11130 -0
- package/dist/mcpDoctor.js +108 -76
- package/dist/mcpStartupPolicy.js +3 -0
- package/dist/native/AppleDispatchCoverage.js +81 -28
- package/dist/native/AppleDispatchMetadata.js +20 -9
- package/dist/native/AppleMachoFixups.js +253 -34
- package/dist/native/AppleMachoSelection.js +44 -17
- package/dist/native/AppleObjcCategories.js +1 -2
- package/dist/native/AppleObjcDispatchFacets.js +76 -7
- package/dist/native/CommandRunner.js +142 -32
- package/dist/native/LldbCallTracer.js +5 -3
- package/dist/native/MachoArchitectureSelection.js +50 -0
- package/dist/native/NativeCallObservation.js +2 -1
- package/dist/native/NativeMacOSProvider.js +173 -37
- package/dist/native/NativeMachoInspection.js +142 -78
- package/dist/native/NativeUiHelperRuntime.js +6 -1
- package/dist/native/NativeUiObservation.js +6 -5
- package/dist/native/SignatureTargetBinding.js +118 -55
- package/dist/native/parsers/codesign.js +27 -10
- package/dist/native/parsers/demangle.js +7 -1
- package/dist/native/parsers/dyldInfo.js +73 -4
- package/dist/native/parsers/lipo.js +53 -19
- package/dist/native/parsers/machoUuid.js +150 -0
- package/dist/native/parsers/otool.js +232 -29
- package/dist/native/pe/PeResourceLayout.js +120 -0
- package/dist/native/pe/PeResourceParser.js +286 -0
- package/dist/native/pe/PeResourcesProvider.js +77 -0
- package/dist/native/pwndbg/PwndbgCoreContext.js +20 -20
- package/dist/native/pwntools/PwntoolsDecoder.js +264 -40
- package/dist/native/pwntools/PwntoolsFailures.js +2 -1
- package/dist/native/pwntools/PwntoolsInputLimit.js +27 -0
- package/dist/native/pwntools/PwntoolsRecordedCrashProvider.js +27 -15
- package/dist/native/pwntools/PwntoolsResourceLimits.js +3 -3
- package/dist/native/pwntools/RecordedCrashSourceBindings.js +12 -8
- package/dist/native/pwntools/RecordedCrashStructureBindings.js +3 -1
- package/dist/objdump/ObjdumpCommand.js +21 -0
- package/dist/pcap/PcapCommand.js +146 -0
- package/dist/pcap/PcapConfiguration.js +93 -0
- package/dist/pcap/PcapNativeBound.js +58 -0
- package/dist/pcap/PcapOutput.js +240 -0
- package/dist/pcap/PcapProvider.js +424 -0
- package/dist/pcap/PcapSnapshot.js +171 -0
- package/dist/process/ArtifactAnalysisResources.js +213 -0
- package/dist/process/BoundedFileBytes.js +30 -7
- package/dist/process/CurrentEntrypointPath.js +6 -0
- package/dist/process/DarwinProcessRunTokenReader.js +125 -16
- package/dist/process/ExecFileBoundedOutput.js +44 -0
- package/dist/process/ExecFileOutput.js +30 -6
- package/dist/process/JavaScriptWorkerMemoryLimit.js +25 -0
- package/dist/process/LinuxResourceLimits.js +80 -0
- package/dist/process/MacCodeSignature.js +3 -0
- package/dist/process/OwnedCommand.js +40 -15
- package/dist/process/PrivateRuntimeRoot.js +9 -19
- package/dist/process/PrivateRuntimeRootUnavailableError.js +10 -0
- package/dist/process/ProcessOwnership.js +173 -128
- package/dist/process/ProcessOwnershipObservation.js +131 -43
- package/dist/process/ProcessOwnershipProcessTree.js +4 -4
- package/dist/process/ProcessRunTokenObservations.js +48 -0
- package/dist/process/ProviderDeadline.js +58 -12
- package/dist/process/ProviderDiagnosticRedaction.js +17 -0
- package/dist/process/ProviderProcess.js +112 -14
- package/dist/process/WindowsAuthority.js +48 -39
- package/dist/process/WindowsBatchCommand.js +46 -0
- package/dist/process/boundedUtf8Text.js +13 -0
- package/dist/process/capture/FilesystemSnapshot.js +87 -12
- package/dist/process/capture/ProcessCaptureClock.js +2 -0
- package/dist/process/capture/ProcessCaptureError.js +22 -3
- package/dist/process/capture/ProcessCaptureJournal.js +2 -1
- package/dist/process/capture/ProcessCaptureLifecycle.js +433 -91
- package/dist/process/capture/ProcessCaptureProgress.js +63 -0
- package/dist/process/capture/ProcessHarness.js +209 -38
- package/dist/process/capture/ProcessNormalization.js +278 -34
- package/dist/process/capture/ProcessSampling.js +3 -2
- package/dist/process/capture/ProcessScenarioRuntimeValidation.js +18 -15
- package/dist/process/capture/TerminalRenderer.js +52 -14
- package/dist/process/ownedDebuggerSession.js +203 -0
- package/dist/reference/ReferenceSourceReader.js +22 -6
- package/dist/reference/ReferenceSourceReaderEntries.js +182 -105
- package/dist/reference/ReferenceSourceReaderErrors.js +17 -1
- package/dist/reference/ReferenceSourceReaderFile.js +50 -11
- package/dist/reference/ReferenceSourceReaderTypes.js +1 -2
- package/dist/reference/ReferenceSourceReaderValidate.js +4 -5
- package/dist/rizin/RizinCommand.js +14 -0
- package/dist/rizin/RizinDebugSessionManager.js +1072 -0
- package/dist/rust/RustAuditableReader.js +309 -0
- package/dist/rust/RustBinaryImage.js +116 -0
- package/dist/rust/RustBinaryProvider.js +162 -0
- package/dist/server/EvidenceMcpServer.js +185 -27
- package/dist/server/admittedToolOperation.js +14 -0
- package/dist/server/contractToolHandler.js +28 -0
- package/dist/server/createServer.js +238 -36
- package/dist/server/externalMutationAdmission.js +50 -0
- package/dist/server/mcpProgress.js +4 -2
- package/dist/server/promptCompletion.js +19 -6
- package/dist/server/providerEnvironment.js +3 -0
- package/dist/server/registerAdbTools.js +36 -0
- package/dist/server/registerAnalysisViewTool.js +9 -10
- package/dist/server/registerAndroidTools.js +22 -13
- package/dist/server/registerApktoolTools.js +14 -0
- package/dist/server/registerApplicationTools/compareExportShapes.js +4 -6
- package/dist/server/registerApplicationTools/compareSourceToBundle.js +4 -5
- package/dist/server/registerApplicationTools/compareVersions.js +3 -2
- package/dist/server/registerApplicationTools/coverage.js +3 -2
- package/dist/server/registerApplicationTools/obligationLedger.js +3 -2
- package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +11 -3
- package/dist/server/registerApplicationTools/traceFeature.js +3 -2
- package/dist/server/registerApplicationTools/traceSemantics.js +4 -5
- package/dist/server/registerArtifactComparisonTool.js +5 -2
- package/dist/server/registerArtifactTools.js +21 -1
- package/dist/server/registerBinaryDiagnosticsTools.js +16 -4
- package/dist/server/registerBrowserScenarioTool.js +10 -7
- package/dist/server/registerBrowserTools.js +14 -13
- package/dist/server/registerBundleComparisonTool.js +20 -6
- package/dist/server/registerCaptureTools.js +12 -0
- package/dist/server/registerCloseLifecycleTool.js +32 -3
- package/dist/server/registerCutterTools.js +33 -0
- package/dist/server/registerElectronTools.js +38 -17
- package/dist/server/registerEnhancedTools.js +7 -6
- package/dist/server/registerEvidenceTools.js +14 -10
- package/dist/server/registerEvmTools.js +24 -11
- package/dist/server/registerFirmwareTools.js +3 -11
- package/dist/server/registerFlutterTools.js +17 -0
- package/dist/server/registerFridaTools.js +205 -0
- package/dist/server/registerFunctionComparisonTool.js +34 -11
- package/dist/server/registerGdbTools.js +64 -0
- package/dist/server/registerGoTools.js +9 -0
- package/dist/server/registerInvestigationTools/helpers.js +2 -2
- package/dist/server/registerInvestigationTools.js +12 -8
- package/dist/server/registerJavaScriptRecoveryTool.js +4 -9
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +10 -11
- package/dist/server/registerJebTools.js +16 -0
- package/dist/server/registerManagedTools.js +11 -1
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +4 -6
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +3 -2
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +3 -2
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +3 -2
- package/dist/server/registerNativeTools.js +14 -0
- package/dist/server/registerOfficialTools.js +5 -0
- package/dist/server/registerPcapTools.js +35 -0
- package/dist/server/registerPeResourcesTool.js +9 -0
- package/dist/server/registerProcessComparisonTool.js +14 -4
- package/dist/server/registerRecordedCrashTools.js +4 -9
- package/dist/server/registerReverseEngineeringTools.js +86 -0
- package/dist/server/registerRizinDebugTools.js +53 -0
- package/dist/server/registerRustTools.js +9 -0
- package/dist/server/registerSessionRecordTools.js +21 -14
- package/dist/server/registerSessionStatusTool.js +22 -4
- package/dist/server/registerSessionTools.js +78 -34
- package/dist/server/registerSignalTools.js +12 -0
- package/dist/server/registerSqliteTools.js +9 -0
- package/dist/server/registerWasmTools.js +46 -0
- package/dist/server/registerWebModuleTool.js +4 -9
- package/dist/server/registerWebNetworkCaptureTool.js +26 -17
- package/dist/server/registerWebRuntimeTools.js +6 -5
- package/dist/server/registerWebScriptTool.js +6 -3
- package/dist/server/registerWebSourceLocationTool.js +4 -9
- package/dist/server/retainedSummaryDelivery.js +28 -0
- package/dist/server/sessionAvailabilityPolicy.js +3 -0
- package/dist/server/toolRegistrationOptions.js +8 -0
- package/dist/server/toolResult.js +68 -16
- package/dist/server/toolResultEncoding.js +36 -3
- package/dist/serverIdentity.js +17 -8
- package/dist/signals/SigrokRecordingProvider.js +339 -0
- package/dist/signals/parseDecoderDiscovery.js +65 -0
- package/dist/sqlite/SqliteDatabaseFailures.js +134 -0
- package/dist/sqlite/SqliteDatabaseInspection.js +421 -0
- package/dist/sqlite/SqliteDatabaseLimits.js +16 -0
- package/dist/sqlite/SqliteDatabaseProvider.js +295 -0
- package/dist/sqlite/SqliteDatabaseSnapshot.js +156 -0
- package/dist/sqlite/SqliteDatabaseWorker.js +46 -0
- package/dist/sqlite/SqliteDatabaseWorkerExecution.js +112 -0
- package/dist/wasm/WabtArtifactProvider.js +336 -0
- package/dist/wasm/WabtFailures.js +101 -0
- package/dist/wasm/WabtInterface.js +309 -0
- package/dist/wasm/WabtOutput.js +60 -0
- package/dist/wasm/WabtRelease.js +12 -0
- package/dist/wasm/WabtString.js +48 -0
- package/dist/wasm/WabtWat.js +147 -0
- package/dist/wasm/WasmGlueAdapter.js +53 -0
- package/dist/wasm/WasmInterfaceBudget.js +11 -0
- package/dist/windows/WindowsNativeLoader.js +37 -7
- package/dist/windows/WindowsOwnedProcess.js +150 -17
- package/dist/windows/WindowsPrivateRuntime.js +34 -6
- package/install.sh +157 -95
- package/licenses/Apache-2.0.txt +202 -0
- package/licenses/GCC-Runtime-Library-Exception-3.1.txt +73 -0
- package/licenses/GPL-3.0.txt +674 -0
- package/licenses/LGPL-2.0.txt +480 -0
- package/licenses/MIT-template.txt +18 -0
- package/licenses/MinGW-w64-runtime.txt +240 -0
- package/licenses/Node-22.19.0-LICENSE.txt +2666 -0
- package/licenses/README.md +68 -0
- package/licenses/cfworker-MIT.txt +21 -0
- package/licenses/dotnet-runtime-MIT.txt +23 -0
- package/licenses/frida-17.23.2-COPYING.txt +50 -0
- package/licenses/ghidra-12.1.4-DISCLAIMER.txt +13 -0
- package/licenses/ghidra-12.1.4-LICENSE.txt +201 -0
- package/licenses/ghidra-12.1.4-NOTICE.txt +49 -0
- package/licenses/nativeaot-parser-MIT.txt +28 -0
- package/licenses/npm-dependencies.txt +3612 -0
- package/licenses/npm-runtime-notices.txt +8548 -0
- package/licenses/upstream-sources.json +72 -0
- package/licenses/xterm-MIT.txt +21 -0
- package/native/windows/README.md +92 -11
- package/native/windows/build/manifest.json +2 -2
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +117 -22
- package/scripts/electron-active-hook.cjs +4 -1
- package/scripts/hopper-demo-x11.py +53 -3
- package/scripts/prepack.mjs +5 -0
- package/scripts/rea-android-workspace-guardian.mjs +46 -0
- package/scripts/rea.mjs +44 -13
- package/scripts/verify-windows-native-artifact.mjs +2 -2
- package/skills/reverse-engineer-anything/SKILL.md +142 -20
- package/skills/reverse-engineer-anything/references/connection-and-recovery.md +127 -0
- package/skills/reverse-engineer-anything/references/evidence-workflows.md +31 -0
- package/skills/reverse-engineer-anything/references/javascript-applications.md +118 -13
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +147 -16
- package/skills/reverse-engineer-anything/references/runtime-observation.md +57 -7
- package/third_party/README.md +1 -1
- package/third_party/wabt/README.md +24 -0
- package/dist/browser/history/HarCaptureAdapter.js +0 -20
- package/dist/cli/streamedJsonOutput.js +0 -135
- package/dist/cliJsonFile.js +0 -179
- /package/dist/{application/binary → process}/AbortablePromise.js +0 -0
|
@@ -0,0 +1,1957 @@
|
|
|
1
|
+
import { __esmMin } from "./rolldown-runtime-DXoylpqc.js";
|
|
2
|
+
import { PRODUCT_IDENTITY, compareUnicodeCodePoints, err, init_identity, init_result, init_unicodeCodePointOrder, ok } from "./reconstructionObligationLedgerSchemas-Bao0xMr-.js";
|
|
3
|
+
import { ConfigurationError, init_configurationErrors } from "./errorSchemas-CTRmvMl3.js";
|
|
4
|
+
import { ArtifactReaderFailure, init_ArtifactReader } from "./ArtifactReader-BXkffc1D.js";
|
|
5
|
+
import { NonRegularFileReadError, RegularFileChangedError, init_RegularFile } from "./RegularFile-B_6KPCNQ.js";
|
|
6
|
+
import { init_BoundedFileBytes, readBoundedFileBytes } from "./BoundedFileBytes-BU30odTm.js";
|
|
7
|
+
import { RegularFileCleanupFailure, init_RegularFileRead, readRegularFile, withRegularFile } from "./RegularFileRead-DVlC5faM.js";
|
|
8
|
+
import { clientSkillDirectories, init_SupportedClients, init_environment, parseEnvironment, parseEnvironmentValues } from "./SupportedClients-DaX6Lt2d.js";
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
import { dirname, join } from "node:path";
|
|
11
|
+
import { createHash } from "node:crypto";
|
|
12
|
+
import { isDeepStrictEqual } from "node:util";
|
|
13
|
+
import { copyFile, lstat, mkdir, readFile, rm } from "node:fs/promises";
|
|
14
|
+
import { constants } from "node:fs";
|
|
15
|
+
import { Document, Schema, isAlias, isMap, isNode, isScalar, isSeq, parseDocument, visit } from "yaml";
|
|
16
|
+
import writeFileAtomic from "write-file-atomic";
|
|
17
|
+
import { applyEdits, findNodeAtLocation, modify, parse, parseTree, printParseErrorCode } from "jsonc-parser";
|
|
18
|
+
import { parse as parse$1, stringify } from "smol-toml";
|
|
19
|
+
|
|
20
|
+
//#region dist/application/SetupRecoveryBackup.js
|
|
21
|
+
var isMissing, errorDetail, selectCurrentRecoveryBackup, preserveRecoveryBackup;
|
|
22
|
+
function init_SetupRecoveryBackup() {
|
|
23
|
+
return (init_SetupRecoveryBackup = __esmMin((() => {
|
|
24
|
+
init_result();
|
|
25
|
+
init_RegularFileRead();
|
|
26
|
+
isMissing = (cause) => cause instanceof Error && "code" in cause && cause.code === "ENOENT";
|
|
27
|
+
errorDetail = (cause) => cause instanceof Error ? cause.message : String(cause);
|
|
28
|
+
selectCurrentRecoveryBackup = async (firstBackupPath, original) => {
|
|
29
|
+
const expected = Buffer.isBuffer(original) ? original : Buffer.from(original, "utf8");
|
|
30
|
+
let firstBackup;
|
|
31
|
+
try {
|
|
32
|
+
firstBackup = await readRegularFile(firstBackupPath, { symlinks: "reject" });
|
|
33
|
+
} catch (cause) {
|
|
34
|
+
if (cause instanceof RegularFileCleanupFailure) throw cause;
|
|
35
|
+
if (!isMissing(cause)) return err({
|
|
36
|
+
kind: "unreadable",
|
|
37
|
+
path: firstBackupPath,
|
|
38
|
+
detail: `The recovery backup could not be checked: ${errorDetail(cause)}`
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (firstBackup === undefined) return ok({
|
|
42
|
+
backupPath: firstBackupPath,
|
|
43
|
+
present: false
|
|
44
|
+
});
|
|
45
|
+
if (firstBackup.equals(expected)) return ok({
|
|
46
|
+
backupPath: firstBackupPath,
|
|
47
|
+
present: true
|
|
48
|
+
});
|
|
49
|
+
const digest = createHash("sha256").update(expected).digest("hex");
|
|
50
|
+
const recoveryPath = `${firstBackupPath}.${digest}.recovery`;
|
|
51
|
+
let recovery;
|
|
52
|
+
try {
|
|
53
|
+
recovery = await readRegularFile(recoveryPath, { symlinks: "reject" });
|
|
54
|
+
} catch (cause) {
|
|
55
|
+
if (cause instanceof RegularFileCleanupFailure) throw cause;
|
|
56
|
+
if (!isMissing(cause)) return err({
|
|
57
|
+
kind: "unreadable",
|
|
58
|
+
path: recoveryPath,
|
|
59
|
+
detail: `The recovery backup could not be checked: ${errorDetail(cause)}`
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
if (recovery !== undefined && !recovery.equals(expected)) return err({
|
|
63
|
+
kind: "occupied",
|
|
64
|
+
path: recoveryPath,
|
|
65
|
+
detail: `The recovery path already contains different data: ${recoveryPath}`
|
|
66
|
+
});
|
|
67
|
+
return ok({
|
|
68
|
+
backupPath: recoveryPath,
|
|
69
|
+
present: recovery !== undefined
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
preserveRecoveryBackup = async (source, destination) => {
|
|
73
|
+
try {
|
|
74
|
+
await copyFile(source, destination, constants.COPYFILE_EXCL);
|
|
75
|
+
return true;
|
|
76
|
+
} catch (cause) {
|
|
77
|
+
return cause instanceof Error && "code" in cause && cause.code === "EEXIST";
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
})))();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region dist/application/SetupSkill.js
|
|
85
|
+
var MANAGED_SKILL_FILES, isManagedSkillManifest, readSkillFile, readSkillFileState, canonicalSkillContent, SetupSkillInstallError, systemSkillInstallFileOperations, skillDestinations, existingSkillDestinations, readOptionalSkillState, inspectSkillDirectory, skillDirectoryIssues, skillDirectoryFailure, validateCanonicalSkillDirectories, canonicalSkillFiles, inspectCanonicalSkill, canonicalSkillNeedsInstall, causeReason, causePath, restoreSkillFiles, preserveCurrentSkillBackup, installCanonicalSkill, readInstalledSkillIdentity;
|
|
86
|
+
function init_SetupSkill() {
|
|
87
|
+
return (init_SetupSkill = __esmMin((() => {
|
|
88
|
+
init_result();
|
|
89
|
+
init_BoundedFileBytes();
|
|
90
|
+
init_ArtifactReader();
|
|
91
|
+
init_identity();
|
|
92
|
+
init_RegularFile();
|
|
93
|
+
init_RegularFileRead();
|
|
94
|
+
init_SupportedClients();
|
|
95
|
+
init_SetupRecoveryBackup();
|
|
96
|
+
MANAGED_SKILL_FILES = [
|
|
97
|
+
"SKILL.md",
|
|
98
|
+
"references/connection-and-recovery.md",
|
|
99
|
+
"references/native-and-artifacts.md",
|
|
100
|
+
"references/javascript-applications.md",
|
|
101
|
+
"references/android-applications.md",
|
|
102
|
+
"references/runtime-observation.md",
|
|
103
|
+
"references/evidence-workflows.md"
|
|
104
|
+
];
|
|
105
|
+
isManagedSkillManifest = (content) => content.startsWith(`---\nname: ${PRODUCT_IDENTITY.skillName}\n`) || content.startsWith(`---\r\nname: ${PRODUCT_IDENTITY.skillName}\r\n`);
|
|
106
|
+
readSkillFile = (path, resources) => readSkillFileState(path, resources).then(({ bytes }) => bytes.toString("utf8"));
|
|
107
|
+
readSkillFileState = async (path, resources) => withRegularFile(path, async (handle, stats) => {
|
|
108
|
+
const bytes = await readBoundedFileBytes(handle, stats.size, undefined, stats.size);
|
|
109
|
+
if (bytes === undefined || bytes.length !== stats.size) throw new RegularFileChangedError(path);
|
|
110
|
+
return {
|
|
111
|
+
bytes,
|
|
112
|
+
mode: stats.mode & 4095
|
|
113
|
+
};
|
|
114
|
+
}, {
|
|
115
|
+
symlinks: "reject",
|
|
116
|
+
...resources === undefined ? {} : { resources }
|
|
117
|
+
});
|
|
118
|
+
canonicalSkillContent = (relativePath) => readFile(new URL(`../../skills/${PRODUCT_IDENTITY.skillName}/${relativePath}`, new URL("../application/SetupSkill.js", import.meta.url).href), "utf8");
|
|
119
|
+
SetupSkillInstallError = class extends Error {
|
|
120
|
+
_tag = "SetupSkillInstallError";
|
|
121
|
+
path;
|
|
122
|
+
stage;
|
|
123
|
+
reason;
|
|
124
|
+
rollbackFailures;
|
|
125
|
+
recoveryBackupPaths;
|
|
126
|
+
constructor(input) {
|
|
127
|
+
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(" ");
|
|
128
|
+
super(message, { cause: input.cause });
|
|
129
|
+
this.path = input.path;
|
|
130
|
+
this.stage = input.stage;
|
|
131
|
+
this.reason = input.reason;
|
|
132
|
+
this.rollbackFailures = input.rollbackFailures;
|
|
133
|
+
this.recoveryBackupPaths = input.recoveryBackupPaths;
|
|
134
|
+
}
|
|
135
|
+
get remediation() {
|
|
136
|
+
return `${this.message} Check permissions and rerun setup.`;
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
systemSkillInstallFileOperations = {
|
|
140
|
+
mkdir: async (path) => {
|
|
141
|
+
await mkdir(path, { recursive: true });
|
|
142
|
+
},
|
|
143
|
+
backup: async (source, destination) => {
|
|
144
|
+
try {
|
|
145
|
+
await copyFile(source, destination, constants.COPYFILE_EXCL);
|
|
146
|
+
} catch (cause) {
|
|
147
|
+
if (cause instanceof Error && "code" in cause && cause.code === "EEXIST") return;
|
|
148
|
+
throw cause;
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
write: (path, content, mode) => writeFileAtomic(path, content, {
|
|
152
|
+
encoding: "utf8",
|
|
153
|
+
mode
|
|
154
|
+
}),
|
|
155
|
+
remove: (path) => rm(path, { force: true })
|
|
156
|
+
};
|
|
157
|
+
skillDestinations = (home, clientIds, environment = {}, platform = process.platform) => clientSkillDirectories(home, clientIds, environment, platform).map(({ client, directory }) => ({
|
|
158
|
+
client,
|
|
159
|
+
path: join(directory, PRODUCT_IDENTITY.skillName)
|
|
160
|
+
}));
|
|
161
|
+
existingSkillDestinations = async (home, environment = {}, platform = process.platform, resources) => {
|
|
162
|
+
const existing = [];
|
|
163
|
+
for (const destination of skillDestinations(home, undefined, environment, platform)) {
|
|
164
|
+
try {
|
|
165
|
+
const issues = await skillDirectoryIssues([destination]);
|
|
166
|
+
if (issues.some(({ kind }) => kind === "unreadable")) throw skillDirectoryFailure(issues);
|
|
167
|
+
if (issues.length > 0) continue;
|
|
168
|
+
const manifest = join(destination.path, "SKILL.md");
|
|
169
|
+
const content = await readSkillFile(manifest, resources);
|
|
170
|
+
if (isManagedSkillManifest(content)) existing.push(destination);
|
|
171
|
+
} catch (cause) {
|
|
172
|
+
if (cause instanceof Error && "code" in cause && cause.code === "ENOENT") continue;
|
|
173
|
+
if (cause instanceof RegularFileCleanupFailure || cause instanceof ArtifactReaderFailure) throw cause;
|
|
174
|
+
if (cause instanceof NonRegularFileReadError) continue;
|
|
175
|
+
throw cause;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return existing;
|
|
179
|
+
};
|
|
180
|
+
readOptionalSkillState = async (path, resources) => {
|
|
181
|
+
try {
|
|
182
|
+
return await readSkillFileState(path, resources);
|
|
183
|
+
} catch (cause) {
|
|
184
|
+
if (cause instanceof Error && "code" in cause && cause.code === "ENOENT") return undefined;
|
|
185
|
+
throw cause;
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
inspectSkillDirectory = async (path) => {
|
|
189
|
+
try {
|
|
190
|
+
const directory = await lstat(path);
|
|
191
|
+
if (directory.isSymbolicLink()) return err({
|
|
192
|
+
path,
|
|
193
|
+
kind: "symbolic_link",
|
|
194
|
+
detail: "Skill directory is a symbolic link."
|
|
195
|
+
});
|
|
196
|
+
if (!directory.isDirectory()) return err({
|
|
197
|
+
path,
|
|
198
|
+
kind: "not_directory",
|
|
199
|
+
detail: "Skill path is not a directory."
|
|
200
|
+
});
|
|
201
|
+
return ok(undefined);
|
|
202
|
+
} catch (cause) {
|
|
203
|
+
if (cause instanceof Error && "code" in cause && cause.code === "ENOENT") return ok(undefined);
|
|
204
|
+
return err({
|
|
205
|
+
path,
|
|
206
|
+
kind: "unreadable",
|
|
207
|
+
detail: cause instanceof Error ? cause.message : String(cause)
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
skillDirectoryIssues = async (destinations) => {
|
|
212
|
+
const issues = [];
|
|
213
|
+
for (const { path } of destinations) {
|
|
214
|
+
const root = await inspectSkillDirectory(path);
|
|
215
|
+
if (!root.ok) {
|
|
216
|
+
issues.push(root.error);
|
|
217
|
+
continue;
|
|
218
|
+
}
|
|
219
|
+
const references = await inspectSkillDirectory(join(path, "references"));
|
|
220
|
+
if (!references.ok) issues.push(references.error);
|
|
221
|
+
}
|
|
222
|
+
return issues;
|
|
223
|
+
};
|
|
224
|
+
skillDirectoryFailure = (issues) => new SetupSkillInstallError({
|
|
225
|
+
path: issues[0]?.path ?? "skill bundle",
|
|
226
|
+
stage: "prepare",
|
|
227
|
+
reason: `${issues.map(({ path, detail }) => `${detail} (${path})`).join(" ")} Use a regular skill directory, or run setup with --skill=false to configure the client without installing the skill`,
|
|
228
|
+
rollbackFailures: [],
|
|
229
|
+
recoveryBackupPaths: [],
|
|
230
|
+
cause: issues
|
|
231
|
+
});
|
|
232
|
+
validateCanonicalSkillDirectories = async (home, clientIds, environment = {}, platform = process.platform) => {
|
|
233
|
+
const issues = await skillDirectoryIssues(skillDestinations(home, clientIds, environment, platform));
|
|
234
|
+
return issues.length === 0 ? ok(undefined) : err(skillDirectoryFailure(issues));
|
|
235
|
+
};
|
|
236
|
+
canonicalSkillFiles = async (home, clientIds, environment = {}, platform = process.platform, resources) => {
|
|
237
|
+
const destinations = skillDestinations(home, clientIds, environment, platform);
|
|
238
|
+
const admission = await validateCanonicalSkillDirectories(home, clientIds, environment, platform);
|
|
239
|
+
if (!admission.ok) throw admission.error;
|
|
240
|
+
return Promise.all(destinations.flatMap(({ path: root }) => MANAGED_SKILL_FILES.map(async (relativePath) => {
|
|
241
|
+
const destination = join(root, relativePath);
|
|
242
|
+
return {
|
|
243
|
+
destination,
|
|
244
|
+
content: await canonicalSkillContent(relativePath),
|
|
245
|
+
original: await readOptionalSkillState(destination, resources)
|
|
246
|
+
};
|
|
247
|
+
})));
|
|
248
|
+
};
|
|
249
|
+
inspectCanonicalSkill = async (home, clientIds, environment, platform, resources) => {
|
|
250
|
+
const destinations = skillDestinations(home, clientIds, environment, platform);
|
|
251
|
+
const issues = clientIds === undefined ? [] : [...await skillDirectoryIssues(destinations)];
|
|
252
|
+
if (issues.length > 0) return err({
|
|
253
|
+
_tag: "SkillInspectionFailure",
|
|
254
|
+
issues,
|
|
255
|
+
cause: issues,
|
|
256
|
+
manifest: undefined
|
|
257
|
+
});
|
|
258
|
+
let canonical = true;
|
|
259
|
+
let manifest;
|
|
260
|
+
let failureCause;
|
|
261
|
+
let installedDestination = false;
|
|
262
|
+
for (const destination of destinations) {
|
|
263
|
+
const { path: root } = destination;
|
|
264
|
+
const pathIssues = clientIds === undefined ? await skillDirectoryIssues([destination]) : [];
|
|
265
|
+
if (pathIssues.length > 0) {
|
|
266
|
+
issues.push(...pathIssues);
|
|
267
|
+
if (failureCause === undefined) failureCause = pathIssues;
|
|
268
|
+
installedDestination = true;
|
|
269
|
+
canonical = false;
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
272
|
+
let rootCanonical = true;
|
|
273
|
+
let rootHasFiles = false;
|
|
274
|
+
const rootIssues = [];
|
|
275
|
+
for (const relativePath of MANAGED_SKILL_FILES) {
|
|
276
|
+
const destination = join(root, relativePath);
|
|
277
|
+
let original;
|
|
278
|
+
try {
|
|
279
|
+
original = await readOptionalSkillState(destination, resources);
|
|
280
|
+
} catch (cause) {
|
|
281
|
+
if (cause instanceof RegularFileCleanupFailure || cause instanceof ArtifactReaderFailure) throw cause;
|
|
282
|
+
rootIssues.push({
|
|
283
|
+
path: destination,
|
|
284
|
+
kind: "unreadable",
|
|
285
|
+
detail: causeReason(cause)
|
|
286
|
+
});
|
|
287
|
+
if (failureCause === undefined) failureCause = cause;
|
|
288
|
+
rootCanonical = false;
|
|
289
|
+
rootHasFiles = true;
|
|
290
|
+
continue;
|
|
291
|
+
}
|
|
292
|
+
if (original !== undefined) rootHasFiles = true;
|
|
293
|
+
if (relativePath === "SKILL.md" && manifest === undefined) manifest = original?.bytes.toString("utf8");
|
|
294
|
+
if (original === undefined) rootCanonical = false;
|
|
295
|
+
else if (rootCanonical) {
|
|
296
|
+
const content = await canonicalSkillContent(relativePath);
|
|
297
|
+
rootCanonical = original.bytes.equals(Buffer.from(content, "utf8"));
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
if (clientIds !== undefined || rootHasFiles || rootIssues.length > 0) {
|
|
301
|
+
installedDestination = true;
|
|
302
|
+
canonical = canonical && rootCanonical;
|
|
303
|
+
issues.push(...rootIssues);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
return issues.length === 0 ? ok({
|
|
307
|
+
canonical,
|
|
308
|
+
manifest,
|
|
309
|
+
installedDestination
|
|
310
|
+
}) : err({
|
|
311
|
+
_tag: "SkillInspectionFailure",
|
|
312
|
+
issues,
|
|
313
|
+
cause: failureCause,
|
|
314
|
+
manifest
|
|
315
|
+
});
|
|
316
|
+
};
|
|
317
|
+
canonicalSkillNeedsInstall = async (home, clientIds = [], environment = {}, platform = process.platform, resources) => {
|
|
318
|
+
try {
|
|
319
|
+
const inspection = await inspectCanonicalSkill(home, clientIds, environment, platform, resources);
|
|
320
|
+
return !inspection.ok || !inspection.value.canonical;
|
|
321
|
+
} catch (cause) {
|
|
322
|
+
if (cause instanceof RegularFileCleanupFailure || cause instanceof ArtifactReaderFailure) throw cause;
|
|
323
|
+
void cause;
|
|
324
|
+
return true;
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
causeReason = (cause) => cause instanceof Error ? cause.message : String(cause);
|
|
328
|
+
causePath = (cause) => cause instanceof Error && "path" in cause && typeof cause.path === "string" ? cause.path : undefined;
|
|
329
|
+
restoreSkillFiles = async (attempted, operations) => {
|
|
330
|
+
const failures = [];
|
|
331
|
+
for (const { destination, original } of [...attempted].reverse()) {
|
|
332
|
+
try {
|
|
333
|
+
if (original === undefined) await operations.remove(destination);
|
|
334
|
+
else await operations.write(destination, original.bytes, original.mode);
|
|
335
|
+
} catch (cause) {
|
|
336
|
+
failures.push({
|
|
337
|
+
path: destination,
|
|
338
|
+
reason: causeReason(cause)
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
return failures;
|
|
343
|
+
};
|
|
344
|
+
preserveCurrentSkillBackup = async (destination, original, operations) => {
|
|
345
|
+
const firstBackupPath = `${destination}.rea.backup`;
|
|
346
|
+
const selection = await selectCurrentRecoveryBackup(firstBackupPath, original);
|
|
347
|
+
if (!selection.ok) throw new Error(selection.error.detail);
|
|
348
|
+
if (selection.value.present) return selection.value.backupPath;
|
|
349
|
+
await operations.backup(destination, selection.value.backupPath);
|
|
350
|
+
const verified = await selectCurrentRecoveryBackup(firstBackupPath, original);
|
|
351
|
+
if (!verified.ok || verified.value.backupPath !== selection.value.backupPath || !verified.value.present) throw new Error(`The current file was not preserved at ${selection.value.backupPath}`);
|
|
352
|
+
return verified.value.backupPath;
|
|
353
|
+
};
|
|
354
|
+
installCanonicalSkill = async (home, clientIds = [], environment = {}, platform = process.platform, operations = systemSkillInstallFileOperations, resources) => {
|
|
355
|
+
let attempted = [];
|
|
356
|
+
let stage = "prepare";
|
|
357
|
+
let failingPath = "skill bundle";
|
|
358
|
+
const recoveryPaths = new Map();
|
|
359
|
+
try {
|
|
360
|
+
const canonical = await canonicalSkillFiles(home, clientIds, environment, platform, resources);
|
|
361
|
+
const changed = canonical.filter(({ content, original }) => original?.bytes.equals(Buffer.from(content, "utf8")) !== true);
|
|
362
|
+
if (changed.length === 0) return ok("unchanged");
|
|
363
|
+
stage = "backup";
|
|
364
|
+
for (const { destination, original } of changed) {
|
|
365
|
+
failingPath = destination;
|
|
366
|
+
await operations.mkdir(dirname(destination));
|
|
367
|
+
if (original !== undefined) {
|
|
368
|
+
recoveryPaths.set(destination, await preserveCurrentSkillBackup(destination, original.bytes, operations));
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
stage = "write";
|
|
372
|
+
for (const file of changed) {
|
|
373
|
+
failingPath = file.destination;
|
|
374
|
+
attempted.push(file);
|
|
375
|
+
await operations.write(file.destination, file.content, file.original?.mode ?? 384);
|
|
376
|
+
}
|
|
377
|
+
stage = "readback";
|
|
378
|
+
for (const { destination, content } of changed) {
|
|
379
|
+
failingPath = destination;
|
|
380
|
+
if (!(await readSkillFileState(destination, resources)).bytes.equals(Buffer.from(content, "utf8"))) throw new Error(`skill readback mismatch: ${destination}`);
|
|
381
|
+
}
|
|
382
|
+
return ok("installed");
|
|
383
|
+
} catch (cause) {
|
|
384
|
+
if (stage === "prepare" && cause instanceof SetupSkillInstallError) return err(cause);
|
|
385
|
+
failingPath = causePath(cause) ?? failingPath;
|
|
386
|
+
const rollbackFailures = await restoreSkillFiles(attempted, operations);
|
|
387
|
+
return err(new SetupSkillInstallError({
|
|
388
|
+
path: failingPath,
|
|
389
|
+
stage,
|
|
390
|
+
reason: causeReason(cause),
|
|
391
|
+
rollbackFailures,
|
|
392
|
+
recoveryBackupPaths: attempted.flatMap(({ destination, original }) => original === undefined || recoveryPaths.get(destination) === undefined ? [] : [recoveryPaths.get(destination)]),
|
|
393
|
+
cause
|
|
394
|
+
}));
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
readInstalledSkillIdentity = async (home, clientIds, environment = {}, platform = process.platform, resources) => {
|
|
398
|
+
const inspection = await inspectCanonicalSkill(home, clientIds, environment, platform, resources);
|
|
399
|
+
if (inspection.ok && !inspection.value.installedDestination) return undefined;
|
|
400
|
+
const content = inspection.ok ? inspection.value.manifest : inspection.error.manifest;
|
|
401
|
+
const issues = inspection.ok ? [] : inspection.error.issues;
|
|
402
|
+
if (content === undefined && issues.length === 0) return undefined;
|
|
403
|
+
const toolCount = content === undefined ? undefined : /^\s{2}tool_count:\s*(\d+)\s*$/mu.exec(content)?.[1];
|
|
404
|
+
return {
|
|
405
|
+
canonical: inspection.ok && inspection.value.canonical,
|
|
406
|
+
version: content === undefined ? null : /^\s{2}version:\s*"([^"]+)"\s*$/mu.exec(content)?.[1] ?? null,
|
|
407
|
+
toolCount: toolCount === undefined ? null : Number.parseInt(toolCount, 10),
|
|
408
|
+
...issues.length === 0 ? {} : { issues }
|
|
409
|
+
};
|
|
410
|
+
};
|
|
411
|
+
})))();
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
//#endregion
|
|
415
|
+
//#region dist/application/DshCordisYaml.js
|
|
416
|
+
var CordisExpression, DshCordisYaml;
|
|
417
|
+
function init_DshCordisYaml() {
|
|
418
|
+
return (init_DshCordisYaml = __esmMin((() => {
|
|
419
|
+
init_configurationErrors();
|
|
420
|
+
CordisExpression = class {
|
|
421
|
+
source;
|
|
422
|
+
kind = "cordis-expression";
|
|
423
|
+
constructor(source) {
|
|
424
|
+
this.source = source;
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
DshCordisYaml = class {
|
|
428
|
+
document;
|
|
429
|
+
#values = new Map();
|
|
430
|
+
#visiting = new Set();
|
|
431
|
+
constructor(text) {
|
|
432
|
+
this.document = parseDocument(text, {
|
|
433
|
+
customTags: [{
|
|
434
|
+
tag: "tag:yaml.org,2002:js",
|
|
435
|
+
resolve: (source) => source
|
|
436
|
+
}],
|
|
437
|
+
logLevel: "silent"
|
|
438
|
+
});
|
|
439
|
+
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] });
|
|
440
|
+
if (this.document.contents === null) this.document.contents = this.document.createNode([]);
|
|
441
|
+
if (!isSeq(this.document.contents)) throw new ConfigurationError("Cordis patches must be a YAML operation list");
|
|
442
|
+
this.value(this.document.contents);
|
|
443
|
+
try {
|
|
444
|
+
this.document.toJS();
|
|
445
|
+
} catch (cause) {
|
|
446
|
+
throw new ConfigurationError("Unsafe Cordis YAML alias expansion", { cause });
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
resolve(node) {
|
|
450
|
+
if (!isAlias(node)) return node;
|
|
451
|
+
const resolved = node.resolve(this.document);
|
|
452
|
+
if (resolved === undefined) throw new ConfigurationError("Cordis YAML contains an unresolved alias");
|
|
453
|
+
return resolved;
|
|
454
|
+
}
|
|
455
|
+
value(node) {
|
|
456
|
+
const resolved = this.resolve(node);
|
|
457
|
+
if (!isNode(resolved)) return resolved;
|
|
458
|
+
if (this.#values.has(resolved)) return this.#values.get(resolved);
|
|
459
|
+
if (this.#visiting.has(resolved)) throw new ConfigurationError("Cyclic Cordis YAML cannot be safely edited");
|
|
460
|
+
this.#visiting.add(resolved);
|
|
461
|
+
let value;
|
|
462
|
+
if (isScalar(resolved)) value = resolved.tag === "tag:yaml.org,2002:js" ? new CordisExpression(String(resolved.value)) : resolved.value;
|
|
463
|
+
else if (isSeq(resolved)) value = resolved.items.map((item) => this.value(item));
|
|
464
|
+
else if (isMap(resolved)) {
|
|
465
|
+
const entries = [];
|
|
466
|
+
for (const pair of resolved.items) {
|
|
467
|
+
entries.push([this.#key(pair.key), this.value(pair.value)]);
|
|
468
|
+
}
|
|
469
|
+
value = Object.fromEntries(entries);
|
|
470
|
+
}
|
|
471
|
+
this.#visiting.delete(resolved);
|
|
472
|
+
this.#values.set(resolved, value);
|
|
473
|
+
return value;
|
|
474
|
+
}
|
|
475
|
+
#key(node) {
|
|
476
|
+
const key = this.value(node);
|
|
477
|
+
if (typeof key === "object" && key !== null) throw new ConfigurationError("Cordis YAML mapping keys must be literal scalars");
|
|
478
|
+
return key === null ? "" : String(key);
|
|
479
|
+
}
|
|
480
|
+
field(map, key) {
|
|
481
|
+
return map?.items.findLast((pair) => this.#key(pair.key) === key)?.value;
|
|
482
|
+
}
|
|
483
|
+
/** Preserve unchanged nodes and carry their comments when replacing values. */
|
|
484
|
+
setValue(map, key, value) {
|
|
485
|
+
const original = this.field(map, key);
|
|
486
|
+
if (isDeepStrictEqual(this.value(original), value)) return;
|
|
487
|
+
const replacement = this.document.createNode(value);
|
|
488
|
+
if (isNode(original) && isNode(replacement)) {
|
|
489
|
+
if (original.comment !== undefined) replacement.comment = original.comment;
|
|
490
|
+
if (original.commentBefore !== undefined) replacement.commentBefore = original.commentBefore;
|
|
491
|
+
}
|
|
492
|
+
map.set(key, replacement);
|
|
493
|
+
}
|
|
494
|
+
/** Copy from the source before edits; materialized nodes own no anchors. */
|
|
495
|
+
copy(node, invalidated) {
|
|
496
|
+
if (isAlias(node)) {
|
|
497
|
+
const target = this.resolve(node);
|
|
498
|
+
return invalidated === undefined || isNode(target) && invalidated.has(target) ? this.copy(target) : node.clone();
|
|
499
|
+
}
|
|
500
|
+
if (!isNode(node)) return node;
|
|
501
|
+
const copied = node.clone();
|
|
502
|
+
if ((invalidated === undefined || invalidated.has(node)) && (isScalar(copied) || isMap(copied) || isSeq(copied))) delete copied.anchor;
|
|
503
|
+
if (isSeq(node) && isSeq(copied)) copied.items = node.items.map((item) => this.copy(item, invalidated));
|
|
504
|
+
if (isMap(node) && isMap(copied)) copied.items.forEach((pair, index) => {
|
|
505
|
+
pair.key = this.copy(node.items[index].key, invalidated);
|
|
506
|
+
pair.value = this.copy(node.items[index].value, invalidated);
|
|
507
|
+
});
|
|
508
|
+
return copied;
|
|
509
|
+
}
|
|
510
|
+
/** Replacing an anchor must not change untouched consumers of its old value. */
|
|
511
|
+
detach(node, invalidated) {
|
|
512
|
+
const copied = this.copy(node, invalidated);
|
|
513
|
+
if (isNode(copied)) visit(copied, {
|
|
514
|
+
Pair: (_key, pair) => {
|
|
515
|
+
if (isAlias(pair.key)) pair.key = this.copy(this.resolve(pair.key));
|
|
516
|
+
},
|
|
517
|
+
Value: (_key, value) => {
|
|
518
|
+
delete value.anchor;
|
|
519
|
+
}
|
|
520
|
+
});
|
|
521
|
+
return copied;
|
|
522
|
+
}
|
|
523
|
+
anchors(node) {
|
|
524
|
+
if (!isNode(node)) return [];
|
|
525
|
+
const anchors = [];
|
|
526
|
+
visit(node, { Value: (_key, value) => {
|
|
527
|
+
if (value.anchor) anchors.push(value);
|
|
528
|
+
} });
|
|
529
|
+
return anchors;
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
})))();
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
//#endregion
|
|
536
|
+
//#region dist/application/DshCordisPatch.js
|
|
537
|
+
var DSH_ENTRY_ID, DSH_CLIENT_PACKAGE, LAUNCHER_KEYS, SELECTOR_KEYS, isRecord, DshCordisDocument, DshCordisEdit, dshDocument, parseDshCordisDocument, editDshDocument, serializeDshDocument, dshClientRegistrationEntry;
|
|
538
|
+
function init_DshCordisPatch() {
|
|
539
|
+
return (init_DshCordisPatch = __esmMin((() => {
|
|
540
|
+
init_environment();
|
|
541
|
+
init_configurationErrors();
|
|
542
|
+
init_result();
|
|
543
|
+
init_DshCordisYaml();
|
|
544
|
+
DSH_ENTRY_ID = "rea-mcp";
|
|
545
|
+
DSH_CLIENT_PACKAGE = "@deepseek-ai/dsh-mcp-client";
|
|
546
|
+
LAUNCHER_KEYS = new Set([
|
|
547
|
+
"serverName",
|
|
548
|
+
"transport",
|
|
549
|
+
"command",
|
|
550
|
+
"args"
|
|
551
|
+
]);
|
|
552
|
+
SELECTOR_KEYS = new Set(["id", "name"]);
|
|
553
|
+
isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value) && !(value instanceof CordisExpression);
|
|
554
|
+
DshCordisDocument = class {
|
|
555
|
+
#yaml;
|
|
556
|
+
#operations;
|
|
557
|
+
#fields = new Map();
|
|
558
|
+
#entryNode;
|
|
559
|
+
#insertions;
|
|
560
|
+
#unknownSelector = false;
|
|
561
|
+
#unknownStructure = false;
|
|
562
|
+
#editabilityError;
|
|
563
|
+
config;
|
|
564
|
+
constructor(text) {
|
|
565
|
+
this.#yaml = new DshCordisYaml(text);
|
|
566
|
+
const root = this.#yaml.document.contents;
|
|
567
|
+
if (!isSeq(root)) throw new ConfigurationError("Cordis patches must be a list");
|
|
568
|
+
const operations = [];
|
|
569
|
+
let insertions = 0;
|
|
570
|
+
let malformedStructure = false;
|
|
571
|
+
for (const source of root.items) {
|
|
572
|
+
const map = this.#map(source);
|
|
573
|
+
if (map === undefined) {
|
|
574
|
+
if (this.#yaml.value(source) instanceof CordisExpression) this.#unknownStructure = true;
|
|
575
|
+
else malformedStructure = true;
|
|
576
|
+
continue;
|
|
577
|
+
}
|
|
578
|
+
const inserted = this.#yaml.resolve(this.#yaml.field(map, "insert"));
|
|
579
|
+
const targetId = this.#id(map);
|
|
580
|
+
const unknownApplicability = targetId !== undefined;
|
|
581
|
+
const insertedValue = this.#yaml.value(inserted);
|
|
582
|
+
const invalidEntries = isSeq(inserted) ? inserted.items.filter((entry) => this.#map(entry) === undefined) : [];
|
|
583
|
+
if (insertedValue instanceof CordisExpression || invalidEntries.some((entry) => this.#yaml.value(entry) instanceof CordisExpression)) this.#unknownStructure = true;
|
|
584
|
+
else if (insertedValue != null && !isSeq(inserted)) malformedStructure = true;
|
|
585
|
+
else if (invalidEntries.length > 0) malformedStructure = true;
|
|
586
|
+
const ownedRows = isSeq(inserted) ? inserted.items.flatMap((entry, index) => this.#id(entry) === "rea-mcp" ? [index] : []) : [];
|
|
587
|
+
const direct = !isSeq(inserted) && targetId === "rea-mcp";
|
|
588
|
+
operations.push({
|
|
589
|
+
source,
|
|
590
|
+
map,
|
|
591
|
+
ownedRows,
|
|
592
|
+
direct,
|
|
593
|
+
unknownApplicability
|
|
594
|
+
});
|
|
595
|
+
if (isSeq(inserted)) {
|
|
596
|
+
for (const index of ownedRows) {
|
|
597
|
+
const entry = this.#map(inserted.items[index]);
|
|
598
|
+
if (entry === undefined) continue;
|
|
599
|
+
insertions += 1;
|
|
600
|
+
this.#entryNode = entry;
|
|
601
|
+
this.#fields.clear();
|
|
602
|
+
this.#unknownSelector = false;
|
|
603
|
+
this.#readFields(entry);
|
|
604
|
+
}
|
|
605
|
+
} else if (direct) {
|
|
606
|
+
if (insertions === 0) continue;
|
|
607
|
+
const selector = this.#yaml.value(this.#yaml.field(map, "name"));
|
|
608
|
+
if (selector instanceof CordisExpression || selector && this.#field("name") instanceof CordisExpression) {
|
|
609
|
+
this.#unknownSelector = true;
|
|
610
|
+
continue;
|
|
611
|
+
}
|
|
612
|
+
if (selector && selector !== this.#field("name")) continue;
|
|
613
|
+
this.#readFields(map, new Set(["id", "name"]));
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
this.#operations = operations;
|
|
617
|
+
this.#insertions = insertions;
|
|
618
|
+
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: [{
|
|
619
|
+
setting: "name",
|
|
620
|
+
constraint: "Use literal selectors before setup"
|
|
621
|
+
}] }) : undefined;
|
|
622
|
+
const config = this.#field("config");
|
|
623
|
+
this.config = insertions === 0 ? undefined : isRecord(config) ? config : {};
|
|
624
|
+
}
|
|
625
|
+
#map(node) {
|
|
626
|
+
const map = this.#yaml.resolve(node);
|
|
627
|
+
return isMap(map) ? map : undefined;
|
|
628
|
+
}
|
|
629
|
+
#id(node) {
|
|
630
|
+
const id = this.#yaml.value(this.#yaml.field(this.#map(node), "id"));
|
|
631
|
+
if (id instanceof CordisExpression) throw new ConfigurationError("Expression-backed Cordis IDs have unknown ownership; use literal IDs before changing registrations");
|
|
632
|
+
return id;
|
|
633
|
+
}
|
|
634
|
+
#field(key) {
|
|
635
|
+
return this.#yaml.value(this.#fields.get(key));
|
|
636
|
+
}
|
|
637
|
+
#readFields(map, omitted = new Set()) {
|
|
638
|
+
for (const pair of map.items) {
|
|
639
|
+
const key = this.#yaml.value(pair.key);
|
|
640
|
+
if (typeof key === "string" && !omitted.has(key)) this.#fields.set(key, pair.value);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
get carriesEntry() {
|
|
644
|
+
return this.#operations.some((op) => op.direct || op.ownedRows.length > 0);
|
|
645
|
+
}
|
|
646
|
+
get hasUnknownStructure() {
|
|
647
|
+
return this.#unknownStructure;
|
|
648
|
+
}
|
|
649
|
+
get editabilityError() {
|
|
650
|
+
return this.#editabilityError;
|
|
651
|
+
}
|
|
652
|
+
get ready() {
|
|
653
|
+
const disabled = this.#field("disabled");
|
|
654
|
+
return this.#insertions === 1 && this.#editabilityError === undefined && this.#field("name") === "@deepseek-ai/dsh-mcp-client" && (disabled === undefined || disabled === false);
|
|
655
|
+
}
|
|
656
|
+
/** Validate literals without treating expression source as an environment value. */
|
|
657
|
+
environment(overrides = {}, validation = "effective") {
|
|
658
|
+
const config = this.#field("config");
|
|
659
|
+
if (config instanceof CordisExpression) return err(new ConfigurationError("Expression-backed Cordis config cannot be safely edited", { settings: [{
|
|
660
|
+
setting: "config",
|
|
661
|
+
constraint: "Use a literal mapping to preserve caller fields during setup"
|
|
662
|
+
}] }));
|
|
663
|
+
if (config !== undefined && !isRecord(config)) return err(new ConfigurationError("Cordis REA config must be a mapping", { settings: [{
|
|
664
|
+
setting: "config",
|
|
665
|
+
constraint: "Use a literal mapping before setup"
|
|
666
|
+
}] }));
|
|
667
|
+
const raw = this.config?.env;
|
|
668
|
+
if (raw !== undefined && !isRecord(raw)) return err(new ConfigurationError("Cordis server environment must be a mapping"));
|
|
669
|
+
const literals = {};
|
|
670
|
+
const unresolvedSettings = new Set();
|
|
671
|
+
for (const [key, value] of Object.entries(raw ?? {})) {
|
|
672
|
+
if (value instanceof CordisExpression) {
|
|
673
|
+
if (overrides[key] === undefined) unresolvedSettings.add(key);
|
|
674
|
+
continue;
|
|
675
|
+
}
|
|
676
|
+
if (typeof value !== "string") return err(new ConfigurationError("Invalid Cordis server environment", { settings: [{
|
|
677
|
+
setting: `env.${key}`,
|
|
678
|
+
constraint: "Environment values must be strings or Cordis expressions"
|
|
679
|
+
}] }));
|
|
680
|
+
literals[key] = value;
|
|
681
|
+
}
|
|
682
|
+
const environment = {
|
|
683
|
+
...literals,
|
|
684
|
+
...overrides
|
|
685
|
+
};
|
|
686
|
+
const validated = validation === "fragment" ? parseEnvironmentValues(environment) : parseEnvironment(environment, unresolvedSettings);
|
|
687
|
+
return validated.ok ? ok(environment) : validated;
|
|
688
|
+
}
|
|
689
|
+
desired(command, overrides) {
|
|
690
|
+
if (this.#editabilityError !== undefined) return err(this.#editabilityError);
|
|
691
|
+
const environment = this.environment(overrides);
|
|
692
|
+
if (!environment.ok) return environment;
|
|
693
|
+
const env = {
|
|
694
|
+
...isRecord(this.config?.env) ? this.config.env : {},
|
|
695
|
+
...overrides
|
|
696
|
+
};
|
|
697
|
+
const desired = {
|
|
698
|
+
...this.config,
|
|
699
|
+
...dshClientRegistrationEntry(command)
|
|
700
|
+
};
|
|
701
|
+
delete desired.env;
|
|
702
|
+
if (Object.keys(env).length > 0) desired.env = env;
|
|
703
|
+
return ok(desired);
|
|
704
|
+
}
|
|
705
|
+
/** Plan every replacement from source snapshots before changing an output tree. */
|
|
706
|
+
serialize(desired) {
|
|
707
|
+
if (this.#editabilityError !== undefined && (this.#unknownStructure || desired !== undefined)) throw this.#editabilityError;
|
|
708
|
+
const root = this.#yaml.document.contents;
|
|
709
|
+
if (!isSeq(root)) throw new ConfigurationError("Cordis patches must be a list");
|
|
710
|
+
const replacements = new Map();
|
|
711
|
+
const invalidated = new Set(this.#operations.flatMap((op) => op.direct || op.ownedRows.length > 0 ? this.#yaml.anchors(op.source) : []));
|
|
712
|
+
let carried = false;
|
|
713
|
+
for (const op of this.#operations) {
|
|
714
|
+
if (op.direct) {
|
|
715
|
+
replacements.set(op.source, undefined);
|
|
716
|
+
continue;
|
|
717
|
+
}
|
|
718
|
+
if (op.ownedRows.length === 0) continue;
|
|
719
|
+
const copy = this.#yaml.detach(op.map, invalidated);
|
|
720
|
+
if (!isMap(copy)) throw new ConfigurationError("Cordis operation is not a mapping");
|
|
721
|
+
const inserted = this.#yaml.detach(this.#yaml.resolve(this.#yaml.field(op.map, "insert")), invalidated);
|
|
722
|
+
if (!isSeq(inserted)) throw new ConfigurationError("Cordis insertion is not a list");
|
|
723
|
+
copy.set("insert", inserted);
|
|
724
|
+
const owned = new Set(op.ownedRows);
|
|
725
|
+
inserted.items = inserted.items.flatMap((entry, index) => {
|
|
726
|
+
if (!owned.has(index)) return [entry];
|
|
727
|
+
if (carried || desired === undefined) return [];
|
|
728
|
+
carried = true;
|
|
729
|
+
return [this.#entry(desired, invalidated)];
|
|
730
|
+
});
|
|
731
|
+
if (inserted.items.length === 0) copy.delete("insert");
|
|
732
|
+
const kept = inserted.items.length > 0 || this.#id(op.map) !== "rea-mcp" && copy.items.some((pair) => !SELECTOR_KEYS.has(this.#yaml.value(pair.key)));
|
|
733
|
+
replacements.set(op.source, kept ? copy : undefined);
|
|
734
|
+
}
|
|
735
|
+
const output = this.#yaml.document.clone();
|
|
736
|
+
const outputRoot = output.contents;
|
|
737
|
+
if (!isSeq(outputRoot)) throw new ConfigurationError("Cordis patches must be a list");
|
|
738
|
+
outputRoot.items = root.items.flatMap((source) => {
|
|
739
|
+
const copy = replacements.has(source) ? replacements.get(source) : this.#yaml.copy(source, invalidated);
|
|
740
|
+
return copy === undefined ? [] : [copy];
|
|
741
|
+
});
|
|
742
|
+
if (!carried && desired !== undefined) outputRoot.items.push(output.createNode({ insert: [{
|
|
743
|
+
id: DSH_ENTRY_ID,
|
|
744
|
+
name: DSH_CLIENT_PACKAGE,
|
|
745
|
+
config: desired
|
|
746
|
+
}] }));
|
|
747
|
+
return output.toString({ lineWidth: 0 });
|
|
748
|
+
}
|
|
749
|
+
#entry(desired, invalidated) {
|
|
750
|
+
const entry = this.#yaml.detach(this.#entryNode, invalidated);
|
|
751
|
+
if (!isMap(entry)) throw new ConfigurationError("Cordis entry is not a mapping");
|
|
752
|
+
this.#yaml.setValue(entry, "id", DSH_ENTRY_ID);
|
|
753
|
+
this.#yaml.setValue(entry, "name", DSH_CLIENT_PACKAGE);
|
|
754
|
+
entry.delete("disabled");
|
|
755
|
+
for (const [key, value] of this.#fields) {
|
|
756
|
+
if ([
|
|
757
|
+
"id",
|
|
758
|
+
"name",
|
|
759
|
+
"config",
|
|
760
|
+
"disabled"
|
|
761
|
+
].includes(key)) continue;
|
|
762
|
+
entry.set(key, this.#yaml.detach(value, invalidated));
|
|
763
|
+
}
|
|
764
|
+
const sourceConfig = this.#map(this.#fields.get("config"));
|
|
765
|
+
const config = sourceConfig === undefined ? this.#yaml.document.createNode({}) : this.#yaml.detach(sourceConfig, invalidated);
|
|
766
|
+
if (!isMap(config)) throw new ConfigurationError("Cordis registration config is not a mapping");
|
|
767
|
+
for (const key of LAUNCHER_KEYS) this.#yaml.setValue(config, key, desired[key]);
|
|
768
|
+
const env = this.#map(this.#yaml.field(sourceConfig, "env"));
|
|
769
|
+
const desiredEnv = desired.env;
|
|
770
|
+
if (isRecord(desiredEnv)) {
|
|
771
|
+
const nextEnv = env === undefined ? this.#yaml.document.createNode({}) : this.#yaml.detach(env, invalidated);
|
|
772
|
+
if (!isMap(nextEnv)) throw new ConfigurationError("Cordis environment is not a mapping");
|
|
773
|
+
for (const [key, value] of Object.entries(desiredEnv)) {
|
|
774
|
+
this.#yaml.setValue(nextEnv, key, value);
|
|
775
|
+
}
|
|
776
|
+
config.set("env", nextEnv);
|
|
777
|
+
} else config.delete("env");
|
|
778
|
+
entry.set("config", config);
|
|
779
|
+
return entry;
|
|
780
|
+
}
|
|
781
|
+
};
|
|
782
|
+
DshCordisEdit = class {
|
|
783
|
+
source;
|
|
784
|
+
desired;
|
|
785
|
+
constructor(source, desired) {
|
|
786
|
+
this.source = source;
|
|
787
|
+
this.desired = desired;
|
|
788
|
+
}
|
|
789
|
+
};
|
|
790
|
+
dshDocument = (document) => {
|
|
791
|
+
if (!(document.cordis instanceof DshCordisDocument)) throw new ConfigurationError("Missing Cordis document owner");
|
|
792
|
+
return document.cordis;
|
|
793
|
+
};
|
|
794
|
+
parseDshCordisDocument = (text) => {
|
|
795
|
+
const source = new DshCordisDocument(text);
|
|
796
|
+
return {
|
|
797
|
+
document: { cordis: source },
|
|
798
|
+
servers: source.config === undefined ? {} : { rea: source.config },
|
|
799
|
+
serversPath: [],
|
|
800
|
+
dialect: "dsh",
|
|
801
|
+
legacyServers: {}
|
|
802
|
+
};
|
|
803
|
+
};
|
|
804
|
+
editDshDocument = (parsed, desired) => ({ cordis: new DshCordisEdit(dshDocument(parsed.document), desired) });
|
|
805
|
+
serializeDshDocument = (document) => {
|
|
806
|
+
if (!(document.cordis instanceof DshCordisEdit)) throw new ConfigurationError("Missing Cordis edit plan");
|
|
807
|
+
return document.cordis.source.serialize(document.cordis.desired);
|
|
808
|
+
};
|
|
809
|
+
dshClientRegistrationEntry = (command, environment = {}) => {
|
|
810
|
+
const [executable = "rea", ...args] = command;
|
|
811
|
+
return {
|
|
812
|
+
serverName: "rea",
|
|
813
|
+
transport: "stdio",
|
|
814
|
+
command: executable,
|
|
815
|
+
args,
|
|
816
|
+
...Object.keys(environment).length === 0 ? {} : { env: { ...environment } }
|
|
817
|
+
};
|
|
818
|
+
};
|
|
819
|
+
})))();
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
//#endregion
|
|
823
|
+
//#region dist/application/HermesConfigurationYaml.js
|
|
824
|
+
var SOURCE_SCALAR_TAGS, timestampTag, timestampSource, hermesTimestampImplicit, floorDivide, civilDay, parseHermesTimestamp, numericValue, numericValuesEqual, sameResolvedScalarValue, keepScalarSource, createHermesYamlOptions, stringifyHermesConfigurationYaml, isEmptyYamlRoot, parseHermesDocument, parseHermesConfigurationYaml, editHermesConfigurationYaml;
|
|
825
|
+
function init_HermesConfigurationYaml() {
|
|
826
|
+
return (init_HermesConfigurationYaml = __esmMin((() => {
|
|
827
|
+
SOURCE_SCALAR_TAGS = new Set([
|
|
828
|
+
"tag:yaml.org,2002:int",
|
|
829
|
+
"tag:yaml.org,2002:float",
|
|
830
|
+
"tag:yaml.org,2002:timestamp"
|
|
831
|
+
]);
|
|
832
|
+
timestampTag = new Schema({ schema: "yaml-1.1" }).tags.find((tag) => tag.tag === "tag:yaml.org,2002:timestamp" && tag.collection === undefined);
|
|
833
|
+
if (timestampTag === undefined) throw new Error("The YAML 1.1 schema must provide its timestamp tag");
|
|
834
|
+
timestampSource = /^(\d{4})-(\d{1,2})-(\d{1,2})(?:(?:[Tt]|[ \t]+)(\d{1,2}):(\d{2}):(\d{2})(?:\.([0-9]*))?(?:[ \t]*(Z|([-+])(\d{1,2})(?::(\d{2}))?))?)?$/;
|
|
835
|
+
hermesTimestampImplicit = /^(?:\d{4}-\d{2}-\d{2}|\d{4}-\d{1,2}-\d{1,2}(?:[Tt]|[ \t]+)\d{1,2}:\d{2}:\d{2}(?:\.[0-9]*)?(?:[ \t]*(?:Z|[-+]\d{1,2}(?::\d{2})?))?)$/;
|
|
836
|
+
floorDivide = (value, divisor) => Math.floor(value / divisor);
|
|
837
|
+
civilDay = (year, month, day) => {
|
|
838
|
+
const adjustedYear = year - (month <= 2 ? 1 : 0);
|
|
839
|
+
const era = floorDivide(adjustedYear, 400);
|
|
840
|
+
const yearOfEra = adjustedYear - era * 400;
|
|
841
|
+
const adjustedMonth = month + (month > 2 ? -3 : 9);
|
|
842
|
+
const dayOfYear = floorDivide(153 * adjustedMonth + 2, 5) + day - 1;
|
|
843
|
+
const dayOfEra = yearOfEra * 365 + floorDivide(yearOfEra, 4) - floorDivide(yearOfEra, 100) + dayOfYear;
|
|
844
|
+
return era * 146097 + dayOfEra - 719468;
|
|
845
|
+
};
|
|
846
|
+
parseHermesTimestamp = (source) => {
|
|
847
|
+
const match = timestampSource.exec(source);
|
|
848
|
+
if (match === null) return undefined;
|
|
849
|
+
const [, yearText, monthText, dayText, hourText, minuteText, secondText, fraction, zone, sign, zoneHourText, zoneMinuteText] = match;
|
|
850
|
+
if (yearText === undefined || monthText === undefined || dayText === undefined) return undefined;
|
|
851
|
+
const year = Number(yearText);
|
|
852
|
+
const month = Number(monthText);
|
|
853
|
+
const dayOfMonth = Number(dayText);
|
|
854
|
+
if (year < 1 || year > 9999 || month < 1 || month > 12) return undefined;
|
|
855
|
+
const leapYear = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
856
|
+
const monthDays = [
|
|
857
|
+
31,
|
|
858
|
+
leapYear ? 29 : 28,
|
|
859
|
+
31,
|
|
860
|
+
30,
|
|
861
|
+
31,
|
|
862
|
+
30,
|
|
863
|
+
31,
|
|
864
|
+
31,
|
|
865
|
+
30,
|
|
866
|
+
31,
|
|
867
|
+
30,
|
|
868
|
+
31
|
|
869
|
+
];
|
|
870
|
+
if (dayOfMonth < 1 || dayOfMonth > (monthDays[month - 1] ?? 0)) return undefined;
|
|
871
|
+
const date = `${yearText}-${monthText.padStart(2, "0")}-${dayText.padStart(2, "0")}`;
|
|
872
|
+
const day = civilDay(year, month, dayOfMonth);
|
|
873
|
+
if (hourText === undefined) {
|
|
874
|
+
const micros = BigInt(day) * 86400000000n;
|
|
875
|
+
return {
|
|
876
|
+
key: `date:${date}`,
|
|
877
|
+
value: new Date(Number(micros / 1000n))
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
const hour = Number(hourText);
|
|
881
|
+
const minute = Number(minuteText);
|
|
882
|
+
const second = Number(secondText);
|
|
883
|
+
if (hour > 23 || minute > 59 || second > 59) return undefined;
|
|
884
|
+
const zoneHour = Number(zoneHourText ?? 0);
|
|
885
|
+
const zoneMinute = Number(zoneMinuteText ?? 0);
|
|
886
|
+
if (zoneHour > 23 || zoneMinute > 59) return undefined;
|
|
887
|
+
let microseconds = 0;
|
|
888
|
+
if (fraction !== undefined && fraction.length > 0) {
|
|
889
|
+
microseconds = Number((fraction.slice(0, 6) + "000000").slice(0, 6));
|
|
890
|
+
if (fraction.length > 6 && Number(fraction[6]) > 4) microseconds += 1;
|
|
891
|
+
}
|
|
892
|
+
const wholeSeconds = hour * 3600 + minute * 60 + second;
|
|
893
|
+
if (year === 9999 && month === 12 && dayOfMonth === 31 && wholeSeconds === 86399 && microseconds === 1e6) return undefined;
|
|
894
|
+
let micros = BigInt(day) * 86400000000n + BigInt(wholeSeconds) * 1000000n + BigInt(microseconds);
|
|
895
|
+
if (zone !== undefined && zone !== "Z") {
|
|
896
|
+
const offset = (zoneHour * 60 + zoneMinute) * (sign === "+" ? 1 : -1);
|
|
897
|
+
micros -= BigInt(offset) * 60000000n;
|
|
898
|
+
}
|
|
899
|
+
return {
|
|
900
|
+
key: zone === undefined ? `datetime-local:${micros}` : `datetime-utc:${micros}`,
|
|
901
|
+
value: new Date(Number(micros / 1000n - (micros % 1000n < 0n ? 1n : 0n)))
|
|
902
|
+
};
|
|
903
|
+
};
|
|
904
|
+
numericValue = (value) => {
|
|
905
|
+
if (typeof value === "boolean") return value ? 1n : 0n;
|
|
906
|
+
if (typeof value === "bigint" || typeof value === "number") return value;
|
|
907
|
+
return undefined;
|
|
908
|
+
};
|
|
909
|
+
numericValuesEqual = (left, right) => {
|
|
910
|
+
if (typeof left === "bigint" && typeof right === "bigint") return left === right;
|
|
911
|
+
if (typeof left === "number" && typeof right === "number") return left === right || Number.isNaN(left) && Number.isNaN(right);
|
|
912
|
+
const integer = typeof left === "bigint" ? left : right;
|
|
913
|
+
const number = typeof left === "number" ? left : right;
|
|
914
|
+
return Number.isFinite(number) && Number.isInteger(number) && BigInt(number) === integer;
|
|
915
|
+
};
|
|
916
|
+
sameResolvedScalarValue = (left, right) => Object.is(left, right) || left instanceof Date && right instanceof Date && left.getTime() === right.getTime();
|
|
917
|
+
keepScalarSource = (tag) => {
|
|
918
|
+
if (typeof tag === "string" || tag.collection !== undefined) return tag;
|
|
919
|
+
const { stringify } = tag;
|
|
920
|
+
if (!SOURCE_SCALAR_TAGS.has(tag.tag) || stringify === undefined) return tag;
|
|
921
|
+
return {
|
|
922
|
+
...tag,
|
|
923
|
+
stringify: (item, context, ...rest) => {
|
|
924
|
+
const { source } = item;
|
|
925
|
+
if (source === undefined) return stringify(item, context, ...rest);
|
|
926
|
+
const reader = context.doc.schema.tags.find((candidate) => candidate.default === true && candidate.test?.test(source) === true);
|
|
927
|
+
const read = reader?.resolve(source, () => undefined, context.doc.options);
|
|
928
|
+
return sameResolvedScalarValue(isScalar(read) ? read.value : read, item.value) ? source : stringify(item, context, ...rest);
|
|
929
|
+
}
|
|
930
|
+
};
|
|
931
|
+
};
|
|
932
|
+
createHermesYamlOptions = () => {
|
|
933
|
+
const timestamps = new Map();
|
|
934
|
+
const timestampFacts = (source) => {
|
|
935
|
+
if (timestamps.has(source)) return timestamps.get(source);
|
|
936
|
+
const facts = parseHermesTimestamp(source);
|
|
937
|
+
timestamps.set(source, facts);
|
|
938
|
+
return facts;
|
|
939
|
+
};
|
|
940
|
+
const hermesTimestampTag = {
|
|
941
|
+
...timestampTag,
|
|
942
|
+
test: hermesTimestampImplicit,
|
|
943
|
+
resolve: (source) => {
|
|
944
|
+
const facts = timestampFacts(source);
|
|
945
|
+
if (facts === undefined) throw new Error(`Invalid Hermes YAML timestamp: ${source}`);
|
|
946
|
+
return facts.value;
|
|
947
|
+
}
|
|
948
|
+
};
|
|
949
|
+
const keyFacts = new WeakMap();
|
|
950
|
+
const hermesKey = (node) => {
|
|
951
|
+
const cached = keyFacts.get(node);
|
|
952
|
+
if (cached !== undefined) return cached;
|
|
953
|
+
if (!isScalar(node)) return {
|
|
954
|
+
kind: "other",
|
|
955
|
+
value: node
|
|
956
|
+
};
|
|
957
|
+
const numeric = numericValue(node.value);
|
|
958
|
+
const key = numeric !== undefined ? {
|
|
959
|
+
kind: "numeric",
|
|
960
|
+
value: numeric
|
|
961
|
+
} : node.value instanceof Date ? {
|
|
962
|
+
kind: "timestamp",
|
|
963
|
+
value: timestampFacts(node.source ?? "")?.key ?? `invalid:${node.source ?? ""}`
|
|
964
|
+
} : {
|
|
965
|
+
kind: "other",
|
|
966
|
+
value: node.value
|
|
967
|
+
};
|
|
968
|
+
keyFacts.set(node, key);
|
|
969
|
+
return key;
|
|
970
|
+
};
|
|
971
|
+
/** Python dict key equality is Hermes' duplicate-key behavior (bool is int). */
|
|
972
|
+
const hermesKeysEqual = (leftNode, rightNode) => {
|
|
973
|
+
const left = hermesKey(leftNode);
|
|
974
|
+
const right = hermesKey(rightNode);
|
|
975
|
+
if (left.kind !== right.kind) return false;
|
|
976
|
+
if (left.kind === "numeric" && right.kind === "numeric") return numericValuesEqual(left.value, right.value);
|
|
977
|
+
return left.value === right.value;
|
|
978
|
+
};
|
|
979
|
+
return {
|
|
980
|
+
version: "1.1",
|
|
981
|
+
intAsBigInt: true,
|
|
982
|
+
customTags: (tags) => {
|
|
983
|
+
const hasTimestamp = tags.some((tag) => typeof tag !== "string" && tag.tag === timestampTag.tag);
|
|
984
|
+
const withHermesTimestamp = hasTimestamp ? tags.map((tag) => typeof tag !== "string" && tag.tag === timestampTag.tag ? hermesTimestampTag : tag) : [...tags, hermesTimestampTag];
|
|
985
|
+
return withHermesTimestamp.map(keepScalarSource);
|
|
986
|
+
},
|
|
987
|
+
uniqueKeys: hermesKeysEqual
|
|
988
|
+
};
|
|
989
|
+
};
|
|
990
|
+
stringifyHermesConfigurationYaml = (document) => new Document(document, createHermesYamlOptions()).toString({ lineWidth: 0 });
|
|
991
|
+
isEmptyYamlRoot = (root) => root === null || isScalar(root) && root.value === null && root.source === "" && root.tag === undefined && root.anchor === undefined;
|
|
992
|
+
parseHermesDocument = (text) => {
|
|
993
|
+
const document = parseDocument(text, createHermesYamlOptions());
|
|
994
|
+
const error = document.errors[0];
|
|
995
|
+
if (error !== undefined) throw error;
|
|
996
|
+
return document;
|
|
997
|
+
};
|
|
998
|
+
parseHermesConfigurationYaml = (text) => {
|
|
999
|
+
const document = parseHermesDocument(text);
|
|
1000
|
+
return isEmptyYamlRoot(document.contents) ? {} : document.toJS({ reviver: (_key, value) => typeof value === "bigint" ? Number(value) : value });
|
|
1001
|
+
};
|
|
1002
|
+
editHermesConfigurationYaml = (text, path, value) => {
|
|
1003
|
+
const document = parseHermesDocument(text);
|
|
1004
|
+
const root = document.contents;
|
|
1005
|
+
if (isEmptyYamlRoot(root)) {
|
|
1006
|
+
const map = document.createNode({});
|
|
1007
|
+
if (isScalar(root)) map.commentBefore = [root.commentBefore, root.comment].filter((comment) => comment !== undefined).join("\n");
|
|
1008
|
+
document.contents = map;
|
|
1009
|
+
}
|
|
1010
|
+
if (value === undefined) document.deleteIn(path);
|
|
1011
|
+
else {
|
|
1012
|
+
for (let length = 1; length < path.length; length++) {
|
|
1013
|
+
const parent = path.slice(0, length);
|
|
1014
|
+
if (!document.hasIn(parent)) document.setIn(parent, document.createNode({}));
|
|
1015
|
+
}
|
|
1016
|
+
document.setIn(path, value);
|
|
1017
|
+
}
|
|
1018
|
+
return document.toString({ lineWidth: 0 });
|
|
1019
|
+
};
|
|
1020
|
+
})))();
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
//#endregion
|
|
1024
|
+
//#region dist/application/ClientConfigurationDocument.js
|
|
1025
|
+
var objectSchema, clientConfigurationValuesEqual, normalizeConfigurationValue, clientConfigurationServersKey, isEmptyClientConfigurationText, parseDocument$1, ClientConfigurationShapeError, requireObject, parseZcodeFallbackConfiguration, 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, normalizeGeminiServerName, geminiServerPolicyBlock;
|
|
1026
|
+
function init_ClientConfigurationDocument() {
|
|
1027
|
+
return (init_ClientConfigurationDocument = __esmMin((() => {
|
|
1028
|
+
init_DshCordisPatch();
|
|
1029
|
+
init_HermesConfigurationYaml();
|
|
1030
|
+
init_identity();
|
|
1031
|
+
init_unicodeCodePointOrder();
|
|
1032
|
+
objectSchema = z.record(z.string(), z.unknown());
|
|
1033
|
+
clientConfigurationValuesEqual = (left, right) => isDeepStrictEqual(normalizeConfigurationValue(left), normalizeConfigurationValue(right));
|
|
1034
|
+
normalizeConfigurationValue = (value) => {
|
|
1035
|
+
if (Array.isArray(value)) return value.map(normalizeConfigurationValue);
|
|
1036
|
+
if (typeof value !== "object" || value === null || value instanceof Date) return value;
|
|
1037
|
+
return Object.fromEntries(Object.entries(value).sort(([left], [right]) => compareUnicodeCodePoints(left, right)).map(([key, nested]) => [key, normalizeConfigurationValue(nested)]));
|
|
1038
|
+
};
|
|
1039
|
+
clientConfigurationServersKey = (format) => {
|
|
1040
|
+
switch (format) {
|
|
1041
|
+
case "toml":
|
|
1042
|
+
case "grok":
|
|
1043
|
+
case "hermes": return "mcp_servers";
|
|
1044
|
+
case "opencode":
|
|
1045
|
+
case "zcode": return "mcp";
|
|
1046
|
+
case "vscode": return "servers";
|
|
1047
|
+
default: return "mcpServers";
|
|
1048
|
+
}
|
|
1049
|
+
};
|
|
1050
|
+
isEmptyClientConfigurationText = (text) => text.replace(/^\uFEFF/, "").trim() === "";
|
|
1051
|
+
parseDocument$1 = (text, format) => {
|
|
1052
|
+
if (format === "toml" || format === "grok") return requireObject(parse$1(text), "The configuration root");
|
|
1053
|
+
if (format === "pi" || format === "kimi") {
|
|
1054
|
+
if (format === "kimi" && text.trim().length === 0) return {};
|
|
1055
|
+
return requireObject(JSON.parse(text), "The configuration root");
|
|
1056
|
+
}
|
|
1057
|
+
if (isEmptyClientConfigurationText(text)) return {};
|
|
1058
|
+
if (format === "hermes") return requireObject(parseHermesConfigurationYaml(text), "The configuration root");
|
|
1059
|
+
if (format === "zcode") return requireObject(JSON.parse(text), "The configuration root");
|
|
1060
|
+
const errors = [];
|
|
1061
|
+
const jsonText = text.startsWith("") ? ` ${text.slice(1)}` : text;
|
|
1062
|
+
const document = parse(jsonText, errors, { allowTrailingComma: true });
|
|
1063
|
+
const firstError = errors[0];
|
|
1064
|
+
if (firstError !== undefined) throw new SyntaxError(`Invalid JSON/JSONC at offset ${firstError.offset}: ${printParseErrorCode(firstError.error)}`);
|
|
1065
|
+
return requireObject(document, "The configuration root");
|
|
1066
|
+
};
|
|
1067
|
+
ClientConfigurationShapeError = class extends TypeError {};
|
|
1068
|
+
requireObject = (value, description) => {
|
|
1069
|
+
const parsed = objectSchema.safeParse(value);
|
|
1070
|
+
if (parsed.success) return parsed.data;
|
|
1071
|
+
throw new ClientConfigurationShapeError(`${description} must be an object`, { cause: parsed.error });
|
|
1072
|
+
};
|
|
1073
|
+
parseZcodeFallbackConfiguration = (text) => {
|
|
1074
|
+
const document = requireObject(JSON.parse(text), "ZCode fallback root");
|
|
1075
|
+
return {
|
|
1076
|
+
document,
|
|
1077
|
+
servers: document.mcpServers === undefined ? {} : requireObject(document.mcpServers, "ZCode fallback mcpServers"),
|
|
1078
|
+
serversPath: ["mcpServers"],
|
|
1079
|
+
dialect: "zcode_fallback",
|
|
1080
|
+
legacyServers: {}
|
|
1081
|
+
};
|
|
1082
|
+
};
|
|
1083
|
+
OPENCODE_V2_MCP_SETTINGS = new Set(["servers", "timeout"]);
|
|
1084
|
+
parseClientConfiguration = (text, format) => {
|
|
1085
|
+
if (format === undefined || format === "unsupported") throw new TypeError("client does not have a supported MCP config format");
|
|
1086
|
+
if (format === "zcode_fallback") return parseZcodeFallbackConfiguration(text);
|
|
1087
|
+
if (format === "dsh") return parseDshCordisDocument(text);
|
|
1088
|
+
const document = parseDocument$1(text, format);
|
|
1089
|
+
const serversKey = clientConfigurationServersKey(format);
|
|
1090
|
+
const value = document[serversKey];
|
|
1091
|
+
const servers = value === undefined ? {} : requireObject(value, `"${serversKey}"`);
|
|
1092
|
+
if (format === "zcode") {
|
|
1093
|
+
const nested = servers.servers;
|
|
1094
|
+
return {
|
|
1095
|
+
document,
|
|
1096
|
+
servers: nested === undefined ? {} : requireObject(nested, `"${serversKey}.servers"`),
|
|
1097
|
+
serversPath: [serversKey, "servers"],
|
|
1098
|
+
dialect: format,
|
|
1099
|
+
legacyServers: {}
|
|
1100
|
+
};
|
|
1101
|
+
}
|
|
1102
|
+
const native = servers.servers;
|
|
1103
|
+
if (format !== "opencode" || native === undefined || typeof native === "object" && native !== null && "type" in native && typeof native.type === "string") return {
|
|
1104
|
+
document,
|
|
1105
|
+
servers,
|
|
1106
|
+
serversPath: [serversKey],
|
|
1107
|
+
dialect: format,
|
|
1108
|
+
legacyServers: {}
|
|
1109
|
+
};
|
|
1110
|
+
return {
|
|
1111
|
+
document,
|
|
1112
|
+
servers: requireObject(native, `"${serversKey}.servers"`),
|
|
1113
|
+
serversPath: [serversKey, "servers"],
|
|
1114
|
+
dialect: "opencode_v2",
|
|
1115
|
+
legacyServers: Object.fromEntries(Object.entries(servers).filter(([name]) => !OPENCODE_V2_MCP_SETTINGS.has(name)))
|
|
1116
|
+
};
|
|
1117
|
+
};
|
|
1118
|
+
effectiveClientServer = (parsed, name) => Object.hasOwn(parsed.servers, name) ? parsed.servers[name] : parsed.legacyServers[name];
|
|
1119
|
+
withClientServers = (parsed, servers, removeLegacy) => {
|
|
1120
|
+
if (parsed.dialect === "dsh") return Object.hasOwn(servers, PRODUCT_IDENTITY.mcpServerKey) ? editDshDocument(parsed, objectSchema.parse(servers[PRODUCT_IDENTITY.mcpServerKey])) : editDshDocument(parsed);
|
|
1121
|
+
const [key = "", nested] = parsed.serversPath;
|
|
1122
|
+
if (nested === undefined) return {
|
|
1123
|
+
...parsed.document,
|
|
1124
|
+
[key]: servers
|
|
1125
|
+
};
|
|
1126
|
+
const outerValue = parsed.document[key];
|
|
1127
|
+
const outer = outerValue === undefined ? {} : { ...objectSchema.parse(outerValue) };
|
|
1128
|
+
if (parsed.dialect === "opencode_v2" && removeLegacy !== undefined && !OPENCODE_V2_MCP_SETTINGS.has(removeLegacy)) delete outer[removeLegacy];
|
|
1129
|
+
return {
|
|
1130
|
+
...parsed.document,
|
|
1131
|
+
[key]: {
|
|
1132
|
+
...outer,
|
|
1133
|
+
[nested]: servers
|
|
1134
|
+
}
|
|
1135
|
+
};
|
|
1136
|
+
};
|
|
1137
|
+
valueAt = (document, path) => {
|
|
1138
|
+
let current = document;
|
|
1139
|
+
for (const key of path) {
|
|
1140
|
+
const object = objectSchema.safeParse(current);
|
|
1141
|
+
if (!object.success || !Object.hasOwn(object.data, key)) return undefined;
|
|
1142
|
+
current = object.data[key];
|
|
1143
|
+
}
|
|
1144
|
+
return current;
|
|
1145
|
+
};
|
|
1146
|
+
TOML_BASIC_ESCAPES = {
|
|
1147
|
+
b: "\b",
|
|
1148
|
+
t: " ",
|
|
1149
|
+
n: "\n",
|
|
1150
|
+
f: "\f",
|
|
1151
|
+
r: "\r",
|
|
1152
|
+
e: "\x1B",
|
|
1153
|
+
"\"": "\"",
|
|
1154
|
+
"\\": "\\"
|
|
1155
|
+
};
|
|
1156
|
+
skipHorizontalSpace = (line, index) => {
|
|
1157
|
+
let next = index;
|
|
1158
|
+
while (line[next] === " " || line[next] === " ") next += 1;
|
|
1159
|
+
return next;
|
|
1160
|
+
};
|
|
1161
|
+
decodeBasicEscape = (line, slash) => {
|
|
1162
|
+
const escape = line[slash + 1];
|
|
1163
|
+
if (escape === undefined) return undefined;
|
|
1164
|
+
const simple = TOML_BASIC_ESCAPES[escape];
|
|
1165
|
+
if (simple !== undefined) return {
|
|
1166
|
+
value: simple,
|
|
1167
|
+
next: slash + 2
|
|
1168
|
+
};
|
|
1169
|
+
if (escape === "x") {
|
|
1170
|
+
const hex = line.slice(slash + 2, slash + 4);
|
|
1171
|
+
if (!/^[0-9A-Fa-f]{2}$/u.test(hex)) return undefined;
|
|
1172
|
+
return {
|
|
1173
|
+
value: String.fromCodePoint(Number.parseInt(hex, 16)),
|
|
1174
|
+
next: slash + 4
|
|
1175
|
+
};
|
|
1176
|
+
}
|
|
1177
|
+
if (escape !== "u" && escape !== "U") return undefined;
|
|
1178
|
+
const length = escape === "u" ? 4 : 8;
|
|
1179
|
+
const hex = line.slice(slash + 2, slash + 2 + length);
|
|
1180
|
+
if (!new RegExp(`^[0-9A-Fa-f]{${String(length)}}$`, "u").test(hex)) return undefined;
|
|
1181
|
+
const code = Number.parseInt(hex, 16);
|
|
1182
|
+
if (code > 1114111 || code >= 55296 && code <= 57343) return undefined;
|
|
1183
|
+
return {
|
|
1184
|
+
value: String.fromCodePoint(code),
|
|
1185
|
+
next: slash + 2 + length
|
|
1186
|
+
};
|
|
1187
|
+
};
|
|
1188
|
+
parseQuotedKey = (line, start) => {
|
|
1189
|
+
const quote = line[start];
|
|
1190
|
+
if (quote !== "\"" && quote !== "'" || line.startsWith(quote === "\"" ? "\"\"\"" : "'''", start)) return undefined;
|
|
1191
|
+
if (quote === "'") {
|
|
1192
|
+
const end = line.indexOf("'", start + 1);
|
|
1193
|
+
if (end < 0 || line.slice(start + 1, end).includes("\n")) return undefined;
|
|
1194
|
+
return {
|
|
1195
|
+
value: line.slice(start + 1, end),
|
|
1196
|
+
next: end + 1
|
|
1197
|
+
};
|
|
1198
|
+
}
|
|
1199
|
+
let value = "";
|
|
1200
|
+
let index = start + 1;
|
|
1201
|
+
while (index < line.length) {
|
|
1202
|
+
const char = line[index];
|
|
1203
|
+
if (char === "\n" || char === "\r") return undefined;
|
|
1204
|
+
if (char === "\"") return {
|
|
1205
|
+
value,
|
|
1206
|
+
next: index + 1
|
|
1207
|
+
};
|
|
1208
|
+
if (char !== "\\") {
|
|
1209
|
+
value += char ?? "";
|
|
1210
|
+
index += 1;
|
|
1211
|
+
continue;
|
|
1212
|
+
}
|
|
1213
|
+
const decoded = decodeBasicEscape(line, index);
|
|
1214
|
+
if (decoded === undefined) return undefined;
|
|
1215
|
+
value += decoded.value;
|
|
1216
|
+
index = decoded.next;
|
|
1217
|
+
}
|
|
1218
|
+
return undefined;
|
|
1219
|
+
};
|
|
1220
|
+
parseBareKey = (line, start) => {
|
|
1221
|
+
let index = start;
|
|
1222
|
+
while (/[A-Za-z0-9_-]/u.test(line[index] ?? "")) index += 1;
|
|
1223
|
+
if (index === start) return undefined;
|
|
1224
|
+
return {
|
|
1225
|
+
value: line.slice(start, index),
|
|
1226
|
+
next: index
|
|
1227
|
+
};
|
|
1228
|
+
};
|
|
1229
|
+
parseTomlTableHeader = (line) => {
|
|
1230
|
+
let index = skipHorizontalSpace(line, 0);
|
|
1231
|
+
const array = line.startsWith("[[", index);
|
|
1232
|
+
if (!array && line[index] !== "[") return undefined;
|
|
1233
|
+
index += array ? 2 : 1;
|
|
1234
|
+
const path = [];
|
|
1235
|
+
for (;;) {
|
|
1236
|
+
index = skipHorizontalSpace(line, index);
|
|
1237
|
+
const key = line[index] === "\"" || line[index] === "'" ? parseQuotedKey(line, index) : parseBareKey(line, index);
|
|
1238
|
+
if (key === undefined) return undefined;
|
|
1239
|
+
path.push(key.value);
|
|
1240
|
+
index = skipHorizontalSpace(line, key.next);
|
|
1241
|
+
if (line[index] !== ".") break;
|
|
1242
|
+
index += 1;
|
|
1243
|
+
}
|
|
1244
|
+
const close = array ? "]]" : "]";
|
|
1245
|
+
if (!line.startsWith(close, index)) return undefined;
|
|
1246
|
+
index = skipHorizontalSpace(line, index + close.length);
|
|
1247
|
+
if (index < line.length && line[index] !== "#") return undefined;
|
|
1248
|
+
return { path };
|
|
1249
|
+
};
|
|
1250
|
+
tomlStringModeAfter = (line, mode, start = 0) => {
|
|
1251
|
+
if (mode === "ml-basic" || mode === "ml-literal") {
|
|
1252
|
+
const delimiter = mode === "ml-basic" ? "\"\"\"" : "'''";
|
|
1253
|
+
const closed = closeMultiline(line, start, delimiter, mode === "ml-basic");
|
|
1254
|
+
if (closed === undefined) return mode;
|
|
1255
|
+
return tomlStringModeAfter(line, "none", closed);
|
|
1256
|
+
}
|
|
1257
|
+
let index = start;
|
|
1258
|
+
while (index < line.length) {
|
|
1259
|
+
if (line[index] === "#") return "none";
|
|
1260
|
+
if (line.startsWith("\"\"\"", index)) {
|
|
1261
|
+
const closed = closeMultiline(line, index + 3, "\"\"\"", true);
|
|
1262
|
+
if (closed === undefined) return "ml-basic";
|
|
1263
|
+
index = closed;
|
|
1264
|
+
continue;
|
|
1265
|
+
}
|
|
1266
|
+
if (line.startsWith("'''", index)) {
|
|
1267
|
+
const closed = closeMultiline(line, index + 3, "'''", false);
|
|
1268
|
+
if (closed === undefined) return "ml-literal";
|
|
1269
|
+
index = closed;
|
|
1270
|
+
continue;
|
|
1271
|
+
}
|
|
1272
|
+
const quote = line[index];
|
|
1273
|
+
if (quote === "\"" || quote === "'") {
|
|
1274
|
+
const quoted = parseQuotedKey(line, index);
|
|
1275
|
+
if (quoted === undefined) return "none";
|
|
1276
|
+
index = quoted.next;
|
|
1277
|
+
continue;
|
|
1278
|
+
}
|
|
1279
|
+
index += 1;
|
|
1280
|
+
}
|
|
1281
|
+
return "none";
|
|
1282
|
+
};
|
|
1283
|
+
closeMultiline = (line, start, delimiter, escapes) => {
|
|
1284
|
+
let index = start;
|
|
1285
|
+
while (index < line.length) {
|
|
1286
|
+
if (escapes && line[index] === "\\") {
|
|
1287
|
+
if (line[index + 1] === undefined) return undefined;
|
|
1288
|
+
index += 2;
|
|
1289
|
+
continue;
|
|
1290
|
+
}
|
|
1291
|
+
if (line.startsWith(delimiter, index)) {
|
|
1292
|
+
let end = index + delimiter.length;
|
|
1293
|
+
const quote = delimiter[0];
|
|
1294
|
+
let extra = 0;
|
|
1295
|
+
while (extra < 2 && line[end] === quote) {
|
|
1296
|
+
extra += 1;
|
|
1297
|
+
end += 1;
|
|
1298
|
+
}
|
|
1299
|
+
return end;
|
|
1300
|
+
}
|
|
1301
|
+
index += 1;
|
|
1302
|
+
}
|
|
1303
|
+
return undefined;
|
|
1304
|
+
};
|
|
1305
|
+
isBlankOrComment = (line) => {
|
|
1306
|
+
const trimmed = line.trimStart();
|
|
1307
|
+
return trimmed === "" || trimmed.startsWith("#");
|
|
1308
|
+
};
|
|
1309
|
+
looksLikeTomlHeader = (line) => line.trimStart().startsWith("[");
|
|
1310
|
+
isTomlServerTable = (path, serverKey) => path[0] === "mcp_servers" && path[1] === serverKey;
|
|
1311
|
+
parseKeyPath = (text, start) => {
|
|
1312
|
+
const segments = [];
|
|
1313
|
+
let index = start;
|
|
1314
|
+
for (;;) {
|
|
1315
|
+
index = skipHorizontalSpace(text, index);
|
|
1316
|
+
const current = text[index];
|
|
1317
|
+
if (current === undefined || current === "\n" || current === "\r") return undefined;
|
|
1318
|
+
const key = current === "\"" || current === "'" ? parseQuotedKey(text, index) : parseBareKey(text, index);
|
|
1319
|
+
if (key === undefined) return undefined;
|
|
1320
|
+
segments.push(key.value);
|
|
1321
|
+
index = skipHorizontalSpace(text, key.next);
|
|
1322
|
+
if (text[index] !== ".") return {
|
|
1323
|
+
segments,
|
|
1324
|
+
next: index
|
|
1325
|
+
};
|
|
1326
|
+
index += 1;
|
|
1327
|
+
}
|
|
1328
|
+
};
|
|
1329
|
+
parseAssignment = (line) => {
|
|
1330
|
+
const key = parseKeyPath(line, 0);
|
|
1331
|
+
if (key === undefined) return undefined;
|
|
1332
|
+
const equals = skipHorizontalSpace(line, key.next);
|
|
1333
|
+
if (line[equals] !== "=") return undefined;
|
|
1334
|
+
return {
|
|
1335
|
+
segments: key.segments,
|
|
1336
|
+
equals
|
|
1337
|
+
};
|
|
1338
|
+
};
|
|
1339
|
+
skipWsAndComments = (text, start) => {
|
|
1340
|
+
let index = start;
|
|
1341
|
+
while (index < text.length) {
|
|
1342
|
+
const char = text[index];
|
|
1343
|
+
if (char === " " || char === " " || char === "\n" || char === "\r") {
|
|
1344
|
+
index += 1;
|
|
1345
|
+
continue;
|
|
1346
|
+
}
|
|
1347
|
+
if (char === "#") {
|
|
1348
|
+
while (index < text.length && text[index] !== "\n") index += 1;
|
|
1349
|
+
continue;
|
|
1350
|
+
}
|
|
1351
|
+
return index;
|
|
1352
|
+
}
|
|
1353
|
+
return index;
|
|
1354
|
+
};
|
|
1355
|
+
endOfTomlValue = (text, start) => {
|
|
1356
|
+
const index = skipWsAndComments(text, start);
|
|
1357
|
+
if (index >= text.length) return index;
|
|
1358
|
+
if (text.startsWith("\"\"\"", index)) {
|
|
1359
|
+
const closed = closeMultiline(text, index + 3, "\"\"\"", true);
|
|
1360
|
+
return closed ?? text.length;
|
|
1361
|
+
}
|
|
1362
|
+
if (text.startsWith("'''", index)) {
|
|
1363
|
+
const closed = closeMultiline(text, index + 3, "'''", false);
|
|
1364
|
+
return closed ?? text.length;
|
|
1365
|
+
}
|
|
1366
|
+
const quote = text[index];
|
|
1367
|
+
if (quote === "\"" || quote === "'") {
|
|
1368
|
+
const quoted = parseQuotedKey(text, index);
|
|
1369
|
+
return quoted === undefined ? text.length : quoted.next;
|
|
1370
|
+
}
|
|
1371
|
+
if (quote === "{" || quote === "[") return endOfContainer(text, index);
|
|
1372
|
+
let cursor = index;
|
|
1373
|
+
while (cursor < text.length) {
|
|
1374
|
+
const char = text[cursor];
|
|
1375
|
+
if (char === "\n" || char === "#" || char === "," || char === "}" || char === "]") break;
|
|
1376
|
+
cursor += 1;
|
|
1377
|
+
}
|
|
1378
|
+
return cursor;
|
|
1379
|
+
};
|
|
1380
|
+
endOfContainer = (text, open) => {
|
|
1381
|
+
const closers = [text[open] === "{" ? "}" : "]"];
|
|
1382
|
+
let index = open + 1;
|
|
1383
|
+
while (index < text.length && closers.length > 0) {
|
|
1384
|
+
if (text.startsWith("\"\"\"", index)) {
|
|
1385
|
+
const closed = closeMultiline(text, index + 3, "\"\"\"", true);
|
|
1386
|
+
if (closed === undefined) return text.length;
|
|
1387
|
+
index = closed;
|
|
1388
|
+
continue;
|
|
1389
|
+
}
|
|
1390
|
+
if (text.startsWith("'''", index)) {
|
|
1391
|
+
const closed = closeMultiline(text, index + 3, "'''", false);
|
|
1392
|
+
if (closed === undefined) return text.length;
|
|
1393
|
+
index = closed;
|
|
1394
|
+
continue;
|
|
1395
|
+
}
|
|
1396
|
+
const quote = text[index];
|
|
1397
|
+
if (quote === "\"" || quote === "'") {
|
|
1398
|
+
const quoted = parseQuotedKey(text, index);
|
|
1399
|
+
if (quoted === undefined) return text.length;
|
|
1400
|
+
index = quoted.next;
|
|
1401
|
+
continue;
|
|
1402
|
+
}
|
|
1403
|
+
if (quote === "#") {
|
|
1404
|
+
while (index < text.length && text[index] !== "\n") index += 1;
|
|
1405
|
+
continue;
|
|
1406
|
+
}
|
|
1407
|
+
if (quote === "{" || quote === "[") {
|
|
1408
|
+
closers.push(quote === "{" ? "}" : "]");
|
|
1409
|
+
index += 1;
|
|
1410
|
+
continue;
|
|
1411
|
+
}
|
|
1412
|
+
if (quote === closers[closers.length - 1]) {
|
|
1413
|
+
closers.pop();
|
|
1414
|
+
index += 1;
|
|
1415
|
+
continue;
|
|
1416
|
+
}
|
|
1417
|
+
index += 1;
|
|
1418
|
+
}
|
|
1419
|
+
return index;
|
|
1420
|
+
};
|
|
1421
|
+
tomlBasicString = (value) => JSON.stringify(value).replaceAll("", "\\u007f");
|
|
1422
|
+
tomlInlineKey = (key) => /^[A-Za-z0-9_-]+$/u.test(key) ? key : tomlBasicString(key);
|
|
1423
|
+
tomlInlineValue = (value) => {
|
|
1424
|
+
if (typeof value === "string") return tomlBasicString(value);
|
|
1425
|
+
if (typeof value === "boolean") return value ? "true" : "false";
|
|
1426
|
+
if (typeof value === "number" && Number.isFinite(value)) return String(value);
|
|
1427
|
+
if (Array.isArray(value)) return `[${value.map((item) => tomlInlineValue(item)).join(", ")}]`;
|
|
1428
|
+
if (typeof value === "object" && value !== null) {
|
|
1429
|
+
const body = Object.entries(value).map(([key, nested]) => `${tomlInlineKey(key)} = ${tomlInlineValue(nested)}`).join(", ");
|
|
1430
|
+
return `{ ${body} }`;
|
|
1431
|
+
}
|
|
1432
|
+
return "\"\"";
|
|
1433
|
+
};
|
|
1434
|
+
readTrivia = (text, start, limit) => {
|
|
1435
|
+
let index = start;
|
|
1436
|
+
while (index < limit) {
|
|
1437
|
+
const char = text[index];
|
|
1438
|
+
if (char === " " || char === " " || char === "\n" || char === "\r" || char === ",") {
|
|
1439
|
+
index += 1;
|
|
1440
|
+
continue;
|
|
1441
|
+
}
|
|
1442
|
+
if (char === "#") {
|
|
1443
|
+
while (index < limit && text[index] !== "\n") index += 1;
|
|
1444
|
+
continue;
|
|
1445
|
+
}
|
|
1446
|
+
break;
|
|
1447
|
+
}
|
|
1448
|
+
return {
|
|
1449
|
+
text: text.slice(start, index),
|
|
1450
|
+
next: index
|
|
1451
|
+
};
|
|
1452
|
+
};
|
|
1453
|
+
commasOutsideComments = (trivia) => trivia.split("\n").map((part) => {
|
|
1454
|
+
const comment = part.indexOf("#");
|
|
1455
|
+
if (comment < 0) return part.replaceAll(",", "");
|
|
1456
|
+
return `${part.slice(0, comment).replaceAll(",", "")}${part.slice(comment)}`;
|
|
1457
|
+
}).join("\n");
|
|
1458
|
+
hasSeparatorComma = (trivia) => trivia.split("\n").some((part) => {
|
|
1459
|
+
const comment = part.indexOf("#");
|
|
1460
|
+
const code = comment < 0 ? part : part.slice(0, comment);
|
|
1461
|
+
return code.includes(",");
|
|
1462
|
+
});
|
|
1463
|
+
editInlineServerTable = (table, serverKey, entry) => {
|
|
1464
|
+
if (!table.startsWith("{")) return undefined;
|
|
1465
|
+
const end = endOfContainer(table, 0);
|
|
1466
|
+
if (table[end - 1] !== "}") return undefined;
|
|
1467
|
+
const pairs = [];
|
|
1468
|
+
let index = 1;
|
|
1469
|
+
let trailing = "";
|
|
1470
|
+
while (index < end - 1) {
|
|
1471
|
+
const trivia = readTrivia(table, index, end - 1);
|
|
1472
|
+
if (trivia.next >= end - 1) {
|
|
1473
|
+
trailing = trivia.text;
|
|
1474
|
+
break;
|
|
1475
|
+
}
|
|
1476
|
+
const key = parseKeyPath(table, trivia.next);
|
|
1477
|
+
if (key === undefined) return undefined;
|
|
1478
|
+
const equals = skipWsAndComments(table, key.next);
|
|
1479
|
+
if (table[equals] !== "=") return undefined;
|
|
1480
|
+
const valueEnd = endOfTomlValue(table, equals + 1);
|
|
1481
|
+
if (valueEnd > end - 1) return undefined;
|
|
1482
|
+
pairs.push({
|
|
1483
|
+
leading: trivia.text,
|
|
1484
|
+
text: table.slice(trivia.next, valueEnd),
|
|
1485
|
+
drop: key.segments[0] === serverKey
|
|
1486
|
+
});
|
|
1487
|
+
index = valueEnd;
|
|
1488
|
+
}
|
|
1489
|
+
const insertion = entry === undefined ? undefined : `${tomlInlineKey(serverKey)} = ${tomlInlineValue(entry)}`;
|
|
1490
|
+
if (insertion === undefined && pairs.every((pair) => !pair.drop)) return table;
|
|
1491
|
+
return rebuildInlineTable(pairs, trailing, insertion);
|
|
1492
|
+
};
|
|
1493
|
+
rebuildInlineTable = (pairs, trailing, insertion) => rebuildDelimitedEntries(pairs, trailing, insertion, "{", "}");
|
|
1494
|
+
rebuildDelimitedEntries = (pairs, trailing, insertion, open, close) => {
|
|
1495
|
+
const parts = [open];
|
|
1496
|
+
let emitted = false;
|
|
1497
|
+
let separatorPending = false;
|
|
1498
|
+
for (const pair of pairs) {
|
|
1499
|
+
if (pair.drop) {
|
|
1500
|
+
if (!pair.leading.includes("#")) continue;
|
|
1501
|
+
const dropped = !emitted || separatorPending ? commasOutsideComments(pair.leading) : pair.leading;
|
|
1502
|
+
parts.push(dropped);
|
|
1503
|
+
separatorPending = separatorPending || hasSeparatorComma(dropped);
|
|
1504
|
+
continue;
|
|
1505
|
+
}
|
|
1506
|
+
const kept = emitted ? pair.leading : commasOutsideComments(pair.leading);
|
|
1507
|
+
parts.push(separatorPending ? commasOutsideComments(kept) : kept);
|
|
1508
|
+
if (emitted && !separatorPending && !pair.leading.includes(",")) parts.push(", ");
|
|
1509
|
+
separatorPending = false;
|
|
1510
|
+
parts.push(pair.text);
|
|
1511
|
+
emitted = true;
|
|
1512
|
+
}
|
|
1513
|
+
if (insertion !== undefined) {
|
|
1514
|
+
if (!(emitted && separatorPending)) parts.push(emitted ? ", " : " ");
|
|
1515
|
+
parts.push(insertion);
|
|
1516
|
+
emitted = true;
|
|
1517
|
+
}
|
|
1518
|
+
if (!emitted) {
|
|
1519
|
+
const retained = `${parts.slice(1).join("")}${commasOutsideComments(trailing)}`;
|
|
1520
|
+
return retained.includes("#") ? `${open}${retained}${close}` : `${open}${close}`;
|
|
1521
|
+
}
|
|
1522
|
+
const tail = commasOutsideComments(trailing);
|
|
1523
|
+
parts.push(tail);
|
|
1524
|
+
if (tail === "" && open === "{") parts.push(" ");
|
|
1525
|
+
parts.push(close);
|
|
1526
|
+
return parts.join("");
|
|
1527
|
+
};
|
|
1528
|
+
tomlStringValue = (text) => {
|
|
1529
|
+
try {
|
|
1530
|
+
const value = parse$1(`value = ${text}`)["value"];
|
|
1531
|
+
return typeof value === "string" ? value : undefined;
|
|
1532
|
+
} catch (cause) {
|
|
1533
|
+
void cause;
|
|
1534
|
+
return undefined;
|
|
1535
|
+
}
|
|
1536
|
+
};
|
|
1537
|
+
tomlArrayWithoutString = (array, serverKey) => {
|
|
1538
|
+
if (!array.startsWith("[")) return undefined;
|
|
1539
|
+
const end = endOfContainer(array, 0);
|
|
1540
|
+
if (end !== array.length || array[end - 1] !== "]") return undefined;
|
|
1541
|
+
const pairs = [];
|
|
1542
|
+
let index = 1;
|
|
1543
|
+
let trailing = "";
|
|
1544
|
+
while (index < end - 1) {
|
|
1545
|
+
const trivia = readTrivia(array, index, end - 1);
|
|
1546
|
+
if (trivia.next >= end - 1) {
|
|
1547
|
+
trailing = trivia.text;
|
|
1548
|
+
break;
|
|
1549
|
+
}
|
|
1550
|
+
const valueEnd = endOfTomlValue(array, trivia.next);
|
|
1551
|
+
if (valueEnd > end - 1) return undefined;
|
|
1552
|
+
const text = array.slice(trivia.next, valueEnd);
|
|
1553
|
+
pairs.push({
|
|
1554
|
+
leading: trivia.text,
|
|
1555
|
+
text,
|
|
1556
|
+
drop: tomlStringValue(text) === serverKey
|
|
1557
|
+
});
|
|
1558
|
+
index = valueEnd;
|
|
1559
|
+
}
|
|
1560
|
+
if (pairs.every((pair) => !pair.drop)) return array;
|
|
1561
|
+
const rebuilt = rebuildDelimitedEntries(pairs, trailing, undefined, "[", "]");
|
|
1562
|
+
return rebuilt === "[]" ? "" : rebuilt;
|
|
1563
|
+
};
|
|
1564
|
+
disabledServerListEdit = (input) => {
|
|
1565
|
+
if (input.entry === undefined || input.tablePath.length !== 0 || input.segments.length !== 1 || input.segments[0] !== "disabled_mcp_servers") return { kind: "ignore" };
|
|
1566
|
+
const open = skipWsAndComments(input.text, input.valueOffset);
|
|
1567
|
+
if (input.text[open] !== "[") return { kind: "ignore" };
|
|
1568
|
+
const arrayText = input.text.slice(open, input.valueEnd);
|
|
1569
|
+
const edited = tomlArrayWithoutString(arrayText, input.serverKey);
|
|
1570
|
+
if (edited === undefined || edited === arrayText) return { kind: "keep" };
|
|
1571
|
+
if (edited === "") {
|
|
1572
|
+
const suffix = input.text.slice(input.valueEnd, input.statementEnd);
|
|
1573
|
+
const hash = suffix.indexOf("#");
|
|
1574
|
+
return {
|
|
1575
|
+
kind: "delete",
|
|
1576
|
+
comment: hash < 0 ? undefined : suffix.slice(hash)
|
|
1577
|
+
};
|
|
1578
|
+
}
|
|
1579
|
+
return {
|
|
1580
|
+
kind: "replace",
|
|
1581
|
+
text: `${input.text.slice(input.lineStart, open)}${edited}${input.text.slice(input.valueEnd, input.statementEnd)}`
|
|
1582
|
+
};
|
|
1583
|
+
};
|
|
1584
|
+
disabledServerListLines = (edit, lines, lineIndex, endLine) => {
|
|
1585
|
+
switch (edit.kind) {
|
|
1586
|
+
case "ignore": return undefined;
|
|
1587
|
+
case "keep": return lines.slice(lineIndex, endLine + 1);
|
|
1588
|
+
case "replace": return edit.text.split("\n");
|
|
1589
|
+
case "delete": return edit.comment === undefined ? [] : [edit.comment];
|
|
1590
|
+
default: {
|
|
1591
|
+
const unreachable = edit;
|
|
1592
|
+
return unreachable;
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
};
|
|
1596
|
+
upsertTomlServerSection = (originalText, serverKey, entry, format) => {
|
|
1597
|
+
const bom = originalText.startsWith("");
|
|
1598
|
+
const source = bom ? originalText.slice(1) : originalText;
|
|
1599
|
+
const crlf = source.includes("\r\n") && !source.replaceAll("\r\n", "").includes("\n");
|
|
1600
|
+
const text = source;
|
|
1601
|
+
const lines = text.split("\n");
|
|
1602
|
+
const lineStarts = [];
|
|
1603
|
+
let cursor = 0;
|
|
1604
|
+
for (const line of lines) {
|
|
1605
|
+
lineStarts.push(cursor);
|
|
1606
|
+
cursor += line.length + 1;
|
|
1607
|
+
}
|
|
1608
|
+
const kept = [];
|
|
1609
|
+
const pending = [];
|
|
1610
|
+
let skipping = false;
|
|
1611
|
+
let inlineServerTable = false;
|
|
1612
|
+
let mode = "none";
|
|
1613
|
+
let tablePath = [];
|
|
1614
|
+
const discardPending = () => {
|
|
1615
|
+
pending.length = 0;
|
|
1616
|
+
};
|
|
1617
|
+
const flushPending = () => {
|
|
1618
|
+
kept.push(...pending);
|
|
1619
|
+
pending.length = 0;
|
|
1620
|
+
};
|
|
1621
|
+
const lineIndexAt = (offset) => {
|
|
1622
|
+
let line = 0;
|
|
1623
|
+
for (let index = 0; index < lineStarts.length; index += 1) if ((lineStarts[index] ?? 0) <= offset) line = index;
|
|
1624
|
+
return line;
|
|
1625
|
+
};
|
|
1626
|
+
let lineIndex = 0;
|
|
1627
|
+
while (lineIndex < lines.length) {
|
|
1628
|
+
const physical = lines[lineIndex] ?? "";
|
|
1629
|
+
const line = physical.endsWith("\r") ? physical.slice(0, -1) : physical;
|
|
1630
|
+
if (mode !== "none") {
|
|
1631
|
+
mode = tomlStringModeAfter(line, mode);
|
|
1632
|
+
if (skipping) discardPending();
|
|
1633
|
+
else kept.push(physical);
|
|
1634
|
+
lineIndex += 1;
|
|
1635
|
+
continue;
|
|
1636
|
+
}
|
|
1637
|
+
const header = parseTomlTableHeader(line);
|
|
1638
|
+
if (header !== undefined) {
|
|
1639
|
+
tablePath = header.path;
|
|
1640
|
+
if (isTomlServerTable(header.path, serverKey)) {
|
|
1641
|
+
discardPending();
|
|
1642
|
+
skipping = true;
|
|
1643
|
+
lineIndex += 1;
|
|
1644
|
+
continue;
|
|
1645
|
+
}
|
|
1646
|
+
skipping = false;
|
|
1647
|
+
flushPending();
|
|
1648
|
+
kept.push(physical);
|
|
1649
|
+
lineIndex += 1;
|
|
1650
|
+
continue;
|
|
1651
|
+
}
|
|
1652
|
+
const assignment = parseAssignment(line);
|
|
1653
|
+
if (assignment !== undefined) {
|
|
1654
|
+
const lineStart = lineStarts[lineIndex] ?? 0;
|
|
1655
|
+
const valueOffset = lineStart + assignment.equals + 1;
|
|
1656
|
+
const valueEnd = endOfTomlValue(text, valueOffset);
|
|
1657
|
+
let statementEnd = valueEnd;
|
|
1658
|
+
while (statementEnd < text.length && text[statementEnd] !== "\n") statementEnd += 1;
|
|
1659
|
+
const endLine = lineIndexAt(Math.max(statementEnd - 1, lineStart));
|
|
1660
|
+
if (skipping) {
|
|
1661
|
+
discardPending();
|
|
1662
|
+
lineIndex = endLine + 1;
|
|
1663
|
+
mode = "none";
|
|
1664
|
+
continue;
|
|
1665
|
+
}
|
|
1666
|
+
const disabledLines = format === "grok" ? disabledServerListLines(disabledServerListEdit({
|
|
1667
|
+
text,
|
|
1668
|
+
lineStart,
|
|
1669
|
+
valueOffset,
|
|
1670
|
+
valueEnd,
|
|
1671
|
+
statementEnd,
|
|
1672
|
+
tablePath,
|
|
1673
|
+
segments: assignment.segments,
|
|
1674
|
+
serverKey,
|
|
1675
|
+
entry
|
|
1676
|
+
}), lines, lineIndex, endLine) : undefined;
|
|
1677
|
+
if (disabledLines !== undefined) {
|
|
1678
|
+
flushPending();
|
|
1679
|
+
kept.push(...disabledLines);
|
|
1680
|
+
lineIndex = endLine + 1;
|
|
1681
|
+
mode = "none";
|
|
1682
|
+
continue;
|
|
1683
|
+
}
|
|
1684
|
+
const absolute = [...tablePath, ...assignment.segments];
|
|
1685
|
+
const open = skipWsAndComments(text, valueOffset);
|
|
1686
|
+
const closesServerTable = absolute.length === 1 && absolute[0] === "mcp_servers" && text[open] === "{";
|
|
1687
|
+
if (closesServerTable || isTomlServerTable(absolute, serverKey)) {
|
|
1688
|
+
if (closesServerTable) {
|
|
1689
|
+
flushPending();
|
|
1690
|
+
const edited = editInlineServerTable(text.slice(open, valueEnd), serverKey, entry);
|
|
1691
|
+
const prefix = text.slice(lineStart, open);
|
|
1692
|
+
const suffix = text.slice(valueEnd, statementEnd);
|
|
1693
|
+
const replacement = edited === undefined ? text.slice(lineStart, statementEnd) : `${prefix}${edited}${suffix}`;
|
|
1694
|
+
kept.push(...replacement.split("\n"));
|
|
1695
|
+
inlineServerTable = true;
|
|
1696
|
+
} else discardPending();
|
|
1697
|
+
} else {
|
|
1698
|
+
flushPending();
|
|
1699
|
+
for (let index = lineIndex; index <= endLine; index += 1) kept.push(lines[index] ?? "");
|
|
1700
|
+
}
|
|
1701
|
+
lineIndex = endLine + 1;
|
|
1702
|
+
mode = "none";
|
|
1703
|
+
continue;
|
|
1704
|
+
}
|
|
1705
|
+
if (isBlankOrComment(line)) {
|
|
1706
|
+
if (format === "toml" && line.trimStart().startsWith("#")) {
|
|
1707
|
+
flushPending();
|
|
1708
|
+
kept.push(physical);
|
|
1709
|
+
} else pending.push(physical);
|
|
1710
|
+
lineIndex += 1;
|
|
1711
|
+
continue;
|
|
1712
|
+
}
|
|
1713
|
+
mode = tomlStringModeAfter(line, "none");
|
|
1714
|
+
if (skipping) {
|
|
1715
|
+
if (looksLikeTomlHeader(line)) {
|
|
1716
|
+
flushPending();
|
|
1717
|
+
skipping = false;
|
|
1718
|
+
tablePath = ["\0"];
|
|
1719
|
+
kept.push(physical);
|
|
1720
|
+
} else discardPending();
|
|
1721
|
+
} else {
|
|
1722
|
+
flushPending();
|
|
1723
|
+
kept.push(physical);
|
|
1724
|
+
}
|
|
1725
|
+
lineIndex += 1;
|
|
1726
|
+
}
|
|
1727
|
+
if (!skipping) flushPending();
|
|
1728
|
+
let body = kept.join("\n");
|
|
1729
|
+
if (body.endsWith("\r")) body += "\n";
|
|
1730
|
+
if (entry !== undefined && !inlineServerTable) {
|
|
1731
|
+
let fragment = stringify({ mcp_servers: { [serverKey]: entry } }).replace(/\n+$/u, "");
|
|
1732
|
+
if (crlf) fragment = fragment.replaceAll("\n", "\r\n");
|
|
1733
|
+
const nl = crlf ? "\r\n" : "\n";
|
|
1734
|
+
const endedWithNewline = body.endsWith("\n");
|
|
1735
|
+
const base = body.replace(/\n+$/u, "");
|
|
1736
|
+
const trimmed = endedWithNewline && base.endsWith("\r") ? base.slice(0, -1) : base;
|
|
1737
|
+
body = trimmed.length === 0 ? `${fragment}${nl}` : `${trimmed}${nl}${nl}${fragment}${nl}`;
|
|
1738
|
+
}
|
|
1739
|
+
return bom ? `\uFEFF${body}` : body;
|
|
1740
|
+
};
|
|
1741
|
+
tomlServerEntry = (document, serverKey) => {
|
|
1742
|
+
const servers = objectSchema.safeParse(document.mcp_servers);
|
|
1743
|
+
if (!servers.success || !Object.hasOwn(servers.data, serverKey)) return undefined;
|
|
1744
|
+
return servers.data[serverKey];
|
|
1745
|
+
};
|
|
1746
|
+
grokServerListedDisabled = (document, serverKey) => Array.isArray(document.disabled_mcp_servers) && document.disabled_mcp_servers.includes(serverKey);
|
|
1747
|
+
OMP_DISABLED_SERVERS_KEY = "disabledServers";
|
|
1748
|
+
ompServerListedDisabled = (document, serverKey) => {
|
|
1749
|
+
const listed = document[OMP_DISABLED_SERVERS_KEY];
|
|
1750
|
+
return Array.isArray(listed) && listed.includes(serverKey);
|
|
1751
|
+
};
|
|
1752
|
+
OMP_ENABLED_SERVERS_KEY = "enabledServers";
|
|
1753
|
+
clientServerForcedEnabled = (parsed, serverKey) => {
|
|
1754
|
+
if (parsed.dialect !== "omp") return false;
|
|
1755
|
+
const listed = parsed.document[OMP_ENABLED_SERVERS_KEY];
|
|
1756
|
+
return Array.isArray(listed) && listed.includes(serverKey);
|
|
1757
|
+
};
|
|
1758
|
+
clientServerListedDisabled = (parsed, serverKey) => parsed.dialect === "grok" && grokServerListedDisabled(parsed.document, serverKey) || parsed.dialect === "omp" && ompServerListedDisabled(parsed.document, serverKey);
|
|
1759
|
+
serializeGrokConfiguration = (document, originalText) => {
|
|
1760
|
+
const entry = tomlServerEntry(document, PRODUCT_IDENTITY.mcpServerKey);
|
|
1761
|
+
if (originalText === undefined) return stringify(document);
|
|
1762
|
+
return upsertTomlServerSection(originalText, PRODUCT_IDENTITY.mcpServerKey, entry, "grok");
|
|
1763
|
+
};
|
|
1764
|
+
withoutEmptyServerTable = (document) => {
|
|
1765
|
+
const servers = objectSchema.safeParse(document.mcp_servers);
|
|
1766
|
+
if (!servers.success || Object.keys(servers.data).length > 0) return document;
|
|
1767
|
+
const { mcp_servers: empty, ...rest } = document;
|
|
1768
|
+
void empty;
|
|
1769
|
+
return rest;
|
|
1770
|
+
};
|
|
1771
|
+
serializeCodexConfiguration = (document, originalText) => {
|
|
1772
|
+
if (originalText === undefined || isEmptyClientConfigurationText(originalText)) return stringify(document);
|
|
1773
|
+
const upserted = upsertTomlServerSection(originalText, PRODUCT_IDENTITY.mcpServerKey, tomlServerEntry(document, PRODUCT_IDENTITY.mcpServerKey), "toml");
|
|
1774
|
+
const edited = originalText.endsWith("\n") && !upserted.endsWith("\n") ? `${upserted}${originalText.endsWith("\r\n") ? "\r\n" : "\n"}` : upserted;
|
|
1775
|
+
return tomlTextHolds(edited, document) ? edited : stringify(document);
|
|
1776
|
+
};
|
|
1777
|
+
tomlTextHolds = (text, document) => {
|
|
1778
|
+
try {
|
|
1779
|
+
return clientConfigurationValuesEqual(withoutEmptyServerTable(objectSchema.parse(parse$1(text))), withoutEmptyServerTable(document));
|
|
1780
|
+
} catch (cause) {
|
|
1781
|
+
void cause;
|
|
1782
|
+
return false;
|
|
1783
|
+
}
|
|
1784
|
+
};
|
|
1785
|
+
commentsBetweenProperties = (gap) => {
|
|
1786
|
+
const pieces = [];
|
|
1787
|
+
let index = 0;
|
|
1788
|
+
while (index < gap.length) {
|
|
1789
|
+
const line = gap.indexOf("//", index);
|
|
1790
|
+
const block = gap.indexOf("/*", index);
|
|
1791
|
+
if (line < 0 && block < 0) break;
|
|
1792
|
+
const start = line < 0 ? block : block < 0 ? line : Math.min(line, block);
|
|
1793
|
+
const lineComment = start === line;
|
|
1794
|
+
const close = lineComment ? gap.indexOf("\n", start) : gap.indexOf("*/", start + 2);
|
|
1795
|
+
if (!lineComment && close < 0) return undefined;
|
|
1796
|
+
const end = lineComment ? close < 0 ? gap.length : close : close + 2;
|
|
1797
|
+
const comment = gap.slice(start, end);
|
|
1798
|
+
const lineBreak = gap.lastIndexOf("\n", start - 1);
|
|
1799
|
+
if (lineBreak < 0) pieces.push(` ${comment}`);
|
|
1800
|
+
else {
|
|
1801
|
+
const prefix = gap.slice(lineBreak + 1, start);
|
|
1802
|
+
let indentEnd = 0;
|
|
1803
|
+
while (prefix[indentEnd] === " " || prefix[indentEnd] === " ") indentEnd += 1;
|
|
1804
|
+
const newline = lineBreak > 0 && gap[lineBreak - 1] === "\r" ? "\r\n" : "\n";
|
|
1805
|
+
pieces.push(`${newline}${prefix.slice(0, indentEnd)}${comment}`);
|
|
1806
|
+
}
|
|
1807
|
+
index = end;
|
|
1808
|
+
}
|
|
1809
|
+
return pieces.length === 0 ? undefined : pieces.join("");
|
|
1810
|
+
};
|
|
1811
|
+
deleteJsonPropertyPreservingComments = (text, path) => {
|
|
1812
|
+
const root = parseTree(text, [], { allowTrailingComma: true });
|
|
1813
|
+
const value = root === undefined ? undefined : findNodeAtLocation(root, [...path]);
|
|
1814
|
+
const property = value?.parent;
|
|
1815
|
+
const parent = property?.parent;
|
|
1816
|
+
if (property === undefined || parent?.type !== "object" || property.type !== "property" || parent.children === undefined) return undefined;
|
|
1817
|
+
const propertyIndex = parent.children.indexOf(property);
|
|
1818
|
+
const previous = parent.children[propertyIndex - 1];
|
|
1819
|
+
if (propertyIndex <= 0 || previous === undefined) return undefined;
|
|
1820
|
+
const comments = commentsBetweenProperties(text.slice(previous.offset + previous.length, property.offset));
|
|
1821
|
+
if (comments === undefined) return undefined;
|
|
1822
|
+
let removeEnd = property.offset + property.length;
|
|
1823
|
+
const hasNext = parent.children[propertyIndex + 1] !== undefined;
|
|
1824
|
+
if (hasNext) {
|
|
1825
|
+
let comma = removeEnd;
|
|
1826
|
+
while (comma < text.length) {
|
|
1827
|
+
const char = text[comma];
|
|
1828
|
+
if (char === " " || char === " " || char === "\r" || char === "\n") {
|
|
1829
|
+
comma += 1;
|
|
1830
|
+
continue;
|
|
1831
|
+
}
|
|
1832
|
+
if (text.startsWith("/*", comma)) {
|
|
1833
|
+
const close = text.indexOf("*/", comma + 2);
|
|
1834
|
+
if (close < 0) return undefined;
|
|
1835
|
+
comma = close + 2;
|
|
1836
|
+
continue;
|
|
1837
|
+
}
|
|
1838
|
+
if (text.startsWith("//", comma)) {
|
|
1839
|
+
while (comma < text.length && text[comma] !== "\n" && text[comma] !== "\r") comma += 1;
|
|
1840
|
+
continue;
|
|
1841
|
+
}
|
|
1842
|
+
break;
|
|
1843
|
+
}
|
|
1844
|
+
if (text[comma] !== ",") return undefined;
|
|
1845
|
+
removeEnd = comma + 1;
|
|
1846
|
+
}
|
|
1847
|
+
const remainder = text.slice(removeEnd);
|
|
1848
|
+
let suffix = `${hasNext ? "," : ""}${comments}`;
|
|
1849
|
+
if (suffix.includes("//") && !suffix.endsWith("\n") && !suffix.endsWith("\r") && !remainder.startsWith("\n") && !remainder.startsWith("\r")) suffix += "\n";
|
|
1850
|
+
return `${text.slice(0, previous.offset + previous.length)}${suffix}${remainder}`;
|
|
1851
|
+
};
|
|
1852
|
+
serializeClientConfiguration = (document, format, originalText, editedPaths) => {
|
|
1853
|
+
if (format === undefined || format === "unsupported") throw new TypeError("client does not have a supported MCP config format");
|
|
1854
|
+
if (format === "toml") return serializeCodexConfiguration(document, originalText);
|
|
1855
|
+
if (format === "grok") return serializeGrokConfiguration(document, originalText);
|
|
1856
|
+
if (format === "hermes") return serializeHermesConfiguration(document, originalText);
|
|
1857
|
+
if (format === "dsh") return serializeDshDocument(document);
|
|
1858
|
+
if (originalText !== undefined && !isEmptyClientConfigurationText(originalText) && editedPaths !== undefined) return editedPaths.reduce((text, path) => {
|
|
1859
|
+
const value = valueAt(document, path);
|
|
1860
|
+
if (value === undefined) {
|
|
1861
|
+
const preserved = deleteJsonPropertyPreservingComments(text, path);
|
|
1862
|
+
if (preserved !== undefined) return preserved;
|
|
1863
|
+
}
|
|
1864
|
+
return applyEdits(text, modify(text, [...path], value, { formattingOptions: {
|
|
1865
|
+
insertSpaces: true,
|
|
1866
|
+
tabSize: 2,
|
|
1867
|
+
eol: "\n"
|
|
1868
|
+
} }));
|
|
1869
|
+
}, originalText);
|
|
1870
|
+
return `${JSON.stringify(document, null, 2)}\n`;
|
|
1871
|
+
};
|
|
1872
|
+
clientServerPath = (parsed, name) => [...parsed.serversPath, name];
|
|
1873
|
+
legacyClientServerPath = (parsed, name) => Object.hasOwn(parsed.legacyServers, name) ? [parsed.serversPath[0] ?? "mcp", name] : undefined;
|
|
1874
|
+
serializeHermesConfiguration = (document, originalText) => {
|
|
1875
|
+
if (originalText === undefined || isEmptyClientConfigurationText(originalText)) return stringifyHermesConfigurationYaml(document);
|
|
1876
|
+
const serversKey = clientConfigurationServersKey("hermes");
|
|
1877
|
+
const servers = document[serversKey];
|
|
1878
|
+
const entry = typeof servers === "object" && servers !== null ? servers[PRODUCT_IDENTITY.mcpServerKey] : undefined;
|
|
1879
|
+
return editHermesConfigurationYaml(originalText, [serversKey, PRODUCT_IDENTITY.mcpServerKey], entry);
|
|
1880
|
+
};
|
|
1881
|
+
clientRegistrationEntry = (format, command, environment) => {
|
|
1882
|
+
const [executable = "rea", ...args] = command;
|
|
1883
|
+
switch (format) {
|
|
1884
|
+
case "opencode": return {
|
|
1885
|
+
type: "local",
|
|
1886
|
+
command: [...command],
|
|
1887
|
+
enabled: true,
|
|
1888
|
+
...Object.keys(environment).length === 0 ? {} : { environment: { ...environment } }
|
|
1889
|
+
};
|
|
1890
|
+
case "kimi": return {
|
|
1891
|
+
command: executable,
|
|
1892
|
+
args,
|
|
1893
|
+
...Object.keys(environment).length === 0 ? {} : { env: environment }
|
|
1894
|
+
};
|
|
1895
|
+
case "opencode_v2": return {
|
|
1896
|
+
type: "local",
|
|
1897
|
+
command: [...command],
|
|
1898
|
+
...Object.keys(environment).length === 0 ? {} : { environment: { ...environment } }
|
|
1899
|
+
};
|
|
1900
|
+
case "vscode":
|
|
1901
|
+
case "omp":
|
|
1902
|
+
case "pi": return {
|
|
1903
|
+
type: "stdio",
|
|
1904
|
+
command: executable,
|
|
1905
|
+
args,
|
|
1906
|
+
...Object.keys(environment).length === 0 ? {} : { env: environment }
|
|
1907
|
+
};
|
|
1908
|
+
case "copilot_cli": return {
|
|
1909
|
+
type: "stdio",
|
|
1910
|
+
command: executable,
|
|
1911
|
+
args,
|
|
1912
|
+
tools: ["*"],
|
|
1913
|
+
...Object.keys(environment).length === 0 ? {} : { env: environment }
|
|
1914
|
+
};
|
|
1915
|
+
case "commandcode": return {
|
|
1916
|
+
transport: "stdio",
|
|
1917
|
+
enabled: true,
|
|
1918
|
+
command: executable,
|
|
1919
|
+
args,
|
|
1920
|
+
...Object.keys(environment).length === 0 ? {} : { env: environment }
|
|
1921
|
+
};
|
|
1922
|
+
case "dsh": return dshClientRegistrationEntry(command, environment);
|
|
1923
|
+
case "hermes": return {
|
|
1924
|
+
command: executable,
|
|
1925
|
+
args,
|
|
1926
|
+
...Object.keys(environment).length === 0 ? {} : { env: environment },
|
|
1927
|
+
enabled: true
|
|
1928
|
+
};
|
|
1929
|
+
default: return {
|
|
1930
|
+
command: executable,
|
|
1931
|
+
args,
|
|
1932
|
+
...Object.keys(environment).length === 0 ? {} : { env: environment }
|
|
1933
|
+
};
|
|
1934
|
+
}
|
|
1935
|
+
};
|
|
1936
|
+
parseGeminiMcpPolicy = (parsed) => z.object({
|
|
1937
|
+
allowed: z.array(z.string()).optional(),
|
|
1938
|
+
excluded: z.array(z.string()).optional()
|
|
1939
|
+
}).passthrough().parse(parsed.document.mcp ?? {});
|
|
1940
|
+
normalizeGeminiServerName = (name) => name.toLowerCase().trim();
|
|
1941
|
+
geminiServerPolicyBlock = (policies, serverKey) => {
|
|
1942
|
+
const key = normalizeGeminiServerName(serverKey);
|
|
1943
|
+
if (policies.some(({ excluded }) => excluded?.some((name) => normalizeGeminiServerName(name) === key))) return `Gemini mcp.excluded blocks ${serverKey}. Review the selected settings policies before rerunning setup.`;
|
|
1944
|
+
const allowlists = policies.flatMap(({ allowed }) => allowed === undefined ? [] : [allowed]);
|
|
1945
|
+
const allowed = allowlists.reduce((previous, current) => {
|
|
1946
|
+
if (previous === undefined) return current;
|
|
1947
|
+
const normalized = new Set(current.map(normalizeGeminiServerName));
|
|
1948
|
+
return previous.filter((name) => normalized.has(normalizeGeminiServerName(name)));
|
|
1949
|
+
}, undefined);
|
|
1950
|
+
if (allowed !== undefined && allowed.length > 0 && !allowed.some((name) => normalizeGeminiServerName(name) === key)) return `Gemini mcp.allowed does not include ${serverKey}. Review the selected settings policies before rerunning setup.`;
|
|
1951
|
+
return undefined;
|
|
1952
|
+
};
|
|
1953
|
+
})))();
|
|
1954
|
+
}
|
|
1955
|
+
|
|
1956
|
+
//#endregion
|
|
1957
|
+
export { ClientConfigurationShapeError, DshCordisDocument, MANAGED_SKILL_FILES, OMP_DISABLED_SERVERS_KEY, canonicalSkillNeedsInstall, clientConfigurationValuesEqual, clientRegistrationEntry, clientServerForcedEnabled, clientServerListedDisabled, clientServerPath, dshDocument, effectiveClientServer, existingSkillDestinations, geminiServerPolicyBlock, init_ClientConfigurationDocument, init_DshCordisPatch, init_SetupRecoveryBackup, init_SetupSkill, installCanonicalSkill, isManagedSkillManifest, legacyClientServerPath, parseClientConfiguration, parseGeminiMcpPolicy, parseZcodeFallbackConfiguration, preserveRecoveryBackup, readInstalledSkillIdentity, readSkillFile, selectCurrentRecoveryBackup, serializeClientConfiguration, skillDestinations, validateCanonicalSkillDirectories, withClientServers };
|