@greppleai/grip 0.0.0-stage → 0.1.3
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/CHANGELOG.md +115 -0
- package/README.md +731 -2
- package/dist/bun/cli.d.ts +3 -0
- package/dist/bun/cli.d.ts.map +1 -0
- package/dist/bun/cli.js +13 -0
- package/dist/bun/cli.js.map +1 -0
- package/dist/bun/embedded-assets.d.ts +3 -0
- package/dist/bun/embedded-assets.d.ts.map +1 -0
- package/dist/bun/embedded-assets.js +52 -0
- package/dist/bun/embedded-assets.js.map +1 -0
- package/dist/bun/register-bedrock.d.ts +2 -0
- package/dist/bun/register-bedrock.d.ts.map +1 -0
- package/dist/bun/register-bedrock.js +4 -0
- package/dist/bun/register-bedrock.js.map +1 -0
- package/dist/bun/restore-sandbox-env.d.ts +13 -0
- package/dist/bun/restore-sandbox-env.d.ts.map +1 -0
- package/dist/bun/restore-sandbox-env.js +32 -0
- package/dist/bun/restore-sandbox-env.js.map +1 -0
- package/dist/cli/args.d.ts +70 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +442 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/config-selector.d.ts +14 -0
- package/dist/cli/config-selector.d.ts.map +1 -0
- package/dist/cli/config-selector.js +31 -0
- package/dist/cli/config-selector.js.map +1 -0
- package/dist/cli/file-processor.d.ts +15 -0
- package/dist/cli/file-processor.d.ts.map +1 -0
- package/dist/cli/file-processor.js +60 -0
- package/dist/cli/file-processor.js.map +1 -0
- package/dist/cli/initial-message.d.ts +18 -0
- package/dist/cli/initial-message.d.ts.map +1 -0
- package/dist/cli/initial-message.js +22 -0
- package/dist/cli/initial-message.js.map +1 -0
- package/dist/cli/list-models.d.ts +9 -0
- package/dist/cli/list-models.d.ts.map +1 -0
- package/dist/cli/list-models.js +98 -0
- package/dist/cli/list-models.js.map +1 -0
- package/dist/cli/session-picker.d.ts +9 -0
- package/dist/cli/session-picker.d.ts.map +1 -0
- package/dist/cli/session-picker.js +35 -0
- package/dist/cli/session-picker.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +14 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +82 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +406 -0
- package/dist/config.js.map +1 -0
- package/dist/core/agent-session.d.ts +970 -0
- package/dist/core/agent-session.d.ts.map +1 -0
- package/dist/core/agent-session.js +5191 -0
- package/dist/core/agent-session.js.map +1 -0
- package/dist/core/auth-guidance.d.ts +5 -0
- package/dist/core/auth-guidance.d.ts.map +1 -0
- package/dist/core/auth-guidance.js +21 -0
- package/dist/core/auth-guidance.js.map +1 -0
- package/dist/core/auth-storage.d.ts +150 -0
- package/dist/core/auth-storage.d.ts.map +1 -0
- package/dist/core/auth-storage.js +557 -0
- package/dist/core/auth-storage.js.map +1 -0
- package/dist/core/bash-executor.d.ts +26 -0
- package/dist/core/bash-executor.d.ts.map +1 -0
- package/dist/core/bash-executor.js +99 -0
- package/dist/core/bash-executor.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts +83 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -0
- package/dist/core/compaction/branch-summarization.js +220 -0
- package/dist/core/compaction/branch-summarization.js.map +1 -0
- package/dist/core/compaction/compaction.d.ts +65 -0
- package/dist/core/compaction/compaction.d.ts.map +1 -0
- package/dist/core/compaction/compaction.js +550 -0
- package/dist/core/compaction/compaction.js.map +1 -0
- package/dist/core/compaction/compression-detection-ledger.d.ts +34 -0
- package/dist/core/compaction/compression-detection-ledger.d.ts.map +1 -0
- package/dist/core/compaction/compression-detection-ledger.js +52 -0
- package/dist/core/compaction/compression-detection-ledger.js.map +1 -0
- package/dist/core/compaction/compression-detector.d.ts +71 -0
- package/dist/core/compaction/compression-detector.d.ts.map +1 -0
- package/dist/core/compaction/compression-detector.js +407 -0
- package/dist/core/compaction/compression-detector.js.map +1 -0
- package/dist/core/compaction/compression-economics.d.ts +55 -0
- package/dist/core/compaction/compression-economics.d.ts.map +1 -0
- package/dist/core/compaction/compression-economics.js +151 -0
- package/dist/core/compaction/compression-economics.js.map +1 -0
- package/dist/core/compaction/utils.d.ts +28 -0
- package/dist/core/compaction/utils.d.ts.map +1 -0
- package/dist/core/compaction/utils.js +165 -0
- package/dist/core/compaction/utils.js.map +1 -0
- package/dist/core/defaults.d.ts +3 -0
- package/dist/core/defaults.d.ts.map +1 -0
- package/dist/core/defaults.js +2 -0
- package/dist/core/defaults.js.map +1 -0
- package/dist/core/diagnostics.d.ts +18 -0
- package/dist/core/diagnostics.d.ts.map +1 -0
- package/dist/core/diagnostics.js +2 -0
- package/dist/core/diagnostics.js.map +1 -0
- package/dist/core/event-bus.d.ts +9 -0
- package/dist/core/event-bus.d.ts.map +1 -0
- package/dist/core/event-bus.js +25 -0
- package/dist/core/event-bus.js.map +1 -0
- package/dist/core/exec.d.ts +29 -0
- package/dist/core/exec.d.ts.map +1 -0
- package/dist/core/exec.js +75 -0
- package/dist/core/exec.js.map +1 -0
- package/dist/core/export-html/ansi-to-html.d.ts +22 -0
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
- package/dist/core/export-html/ansi-to-html.js +245 -0
- package/dist/core/export-html/ansi-to-html.js.map +1 -0
- package/dist/core/export-html/index.d.ts +21 -0
- package/dist/core/export-html/index.d.ts.map +1 -0
- package/dist/core/export-html/index.js +230 -0
- package/dist/core/export-html/index.js.map +1 -0
- package/dist/core/export-html/template.css +1066 -0
- package/dist/core/export-html/template.html +55 -0
- package/dist/core/export-html/template.js +1864 -0
- package/dist/core/export-html/tool-renderer.d.ts +32 -0
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -0
- package/dist/core/export-html/tool-renderer.js +108 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -0
- package/dist/core/export-html/vendor/highlight.min.js +1213 -0
- package/dist/core/export-html/vendor/marked.min.js +78 -0
- package/dist/core/extensions/loader.d.ts +24 -0
- package/dist/core/extensions/loader.d.ts.map +1 -0
- package/dist/core/extensions/loader.js +613 -0
- package/dist/core/extensions/loader.js.map +1 -0
- package/dist/core/extensions/runner.d.ts +160 -0
- package/dist/core/extensions/runner.d.ts.map +1 -0
- package/dist/core/extensions/runner.js +962 -0
- package/dist/core/extensions/runner.js.map +1 -0
- package/dist/core/extensions/types.d.ts +1311 -0
- package/dist/core/extensions/types.d.ts.map +1 -0
- package/dist/core/extensions/types.js +51 -0
- package/dist/core/extensions/types.js.map +1 -0
- package/dist/core/extensions/wrapper.d.ts +20 -0
- package/dist/core/extensions/wrapper.d.ts.map +1 -0
- package/dist/core/extensions/wrapper.js +22 -0
- package/dist/core/extensions/wrapper.js.map +1 -0
- package/dist/core/footer-data-provider.d.ts +52 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -0
- package/dist/core/footer-data-provider.js +318 -0
- package/dist/core/footer-data-provider.js.map +1 -0
- package/dist/core/grip-agent.d.ts +240 -0
- package/dist/core/grip-agent.d.ts.map +1 -0
- package/dist/core/grip-agent.js +1243 -0
- package/dist/core/grip-agent.js.map +1 -0
- package/dist/core/grip-manifest.d.ts +9 -0
- package/dist/core/grip-manifest.d.ts.map +1 -0
- package/dist/core/grip-manifest.js +25 -0
- package/dist/core/grip-manifest.js.map +1 -0
- package/dist/core/hooks/aggregate.d.ts +5 -0
- package/dist/core/hooks/aggregate.d.ts.map +1 -0
- package/dist/core/hooks/aggregate.js +226 -0
- package/dist/core/hooks/aggregate.js.map +1 -0
- package/dist/core/hooks/config.d.ts +14 -0
- package/dist/core/hooks/config.d.ts.map +1 -0
- package/dist/core/hooks/config.js +372 -0
- package/dist/core/hooks/config.js.map +1 -0
- package/dist/core/hooks/executor.d.ts +12 -0
- package/dist/core/hooks/executor.d.ts.map +1 -0
- package/dist/core/hooks/executor.js +708 -0
- package/dist/core/hooks/executor.js.map +1 -0
- package/dist/core/hooks/index.d.ts +9 -0
- package/dist/core/hooks/index.d.ts.map +1 -0
- package/dist/core/hooks/index.js +14 -0
- package/dist/core/hooks/index.js.map +1 -0
- package/dist/core/hooks/matcher.d.ts +10 -0
- package/dist/core/hooks/matcher.d.ts.map +1 -0
- package/dist/core/hooks/matcher.js +70 -0
- package/dist/core/hooks/matcher.js.map +1 -0
- package/dist/core/hooks/trust-store.d.ts +38 -0
- package/dist/core/hooks/trust-store.d.ts.map +1 -0
- package/dist/core/hooks/trust-store.js +167 -0
- package/dist/core/hooks/trust-store.js.map +1 -0
- package/dist/core/hooks/types.d.ts +234 -0
- package/dist/core/hooks/types.d.ts.map +1 -0
- package/dist/core/hooks/types.js +52 -0
- package/dist/core/hooks/types.js.map +1 -0
- package/dist/core/http-dispatcher.d.ts +21 -0
- package/dist/core/http-dispatcher.d.ts.map +1 -0
- package/dist/core/http-dispatcher.js +82 -0
- package/dist/core/http-dispatcher.js.map +1 -0
- package/dist/core/instruction-resource-loader.d.ts +81 -0
- package/dist/core/instruction-resource-loader.d.ts.map +1 -0
- package/dist/core/instruction-resource-loader.js +574 -0
- package/dist/core/instruction-resource-loader.js.map +1 -0
- package/dist/core/keybindings.d.ts +399 -0
- package/dist/core/keybindings.d.ts.map +1 -0
- package/dist/core/keybindings.js +299 -0
- package/dist/core/keybindings.js.map +1 -0
- package/dist/core/lsp/abort.d.ts +3 -0
- package/dist/core/lsp/abort.d.ts.map +1 -0
- package/dist/core/lsp/abort.js +28 -0
- package/dist/core/lsp/abort.js.map +1 -0
- package/dist/core/lsp/client.d.ts +108 -0
- package/dist/core/lsp/client.d.ts.map +1 -0
- package/dist/core/lsp/client.js +586 -0
- package/dist/core/lsp/client.js.map +1 -0
- package/dist/core/lsp/config-loader.d.ts +44 -0
- package/dist/core/lsp/config-loader.d.ts.map +1 -0
- package/dist/core/lsp/config-loader.js +223 -0
- package/dist/core/lsp/config-loader.js.map +1 -0
- package/dist/core/lsp/config.d.ts +134 -0
- package/dist/core/lsp/config.d.ts.map +1 -0
- package/dist/core/lsp/config.js +682 -0
- package/dist/core/lsp/config.js.map +1 -0
- package/dist/core/lsp/diagnostics.d.ts +18 -0
- package/dist/core/lsp/diagnostics.d.ts.map +1 -0
- package/dist/core/lsp/diagnostics.js +311 -0
- package/dist/core/lsp/diagnostics.js.map +1 -0
- package/dist/core/lsp/file-sync.d.ts +58 -0
- package/dist/core/lsp/file-sync.d.ts.map +1 -0
- package/dist/core/lsp/file-sync.js +432 -0
- package/dist/core/lsp/file-sync.js.map +1 -0
- package/dist/core/lsp/integration.d.ts +62 -0
- package/dist/core/lsp/integration.d.ts.map +1 -0
- package/dist/core/lsp/integration.js +145 -0
- package/dist/core/lsp/integration.js.map +1 -0
- package/dist/core/lsp/language-map.d.ts +54 -0
- package/dist/core/lsp/language-map.d.ts.map +1 -0
- package/dist/core/lsp/language-map.js +300 -0
- package/dist/core/lsp/language-map.js.map +1 -0
- package/dist/core/lsp/manager.d.ts +120 -0
- package/dist/core/lsp/manager.d.ts.map +1 -0
- package/dist/core/lsp/manager.js +636 -0
- package/dist/core/lsp/manager.js.map +1 -0
- package/dist/core/lsp/navigation.d.ts +32 -0
- package/dist/core/lsp/navigation.d.ts.map +1 -0
- package/dist/core/lsp/navigation.js +327 -0
- package/dist/core/lsp/navigation.js.map +1 -0
- package/dist/core/lsp/portable-path.d.ts +18 -0
- package/dist/core/lsp/portable-path.d.ts.map +1 -0
- package/dist/core/lsp/portable-path.js +83 -0
- package/dist/core/lsp/portable-path.js.map +1 -0
- package/dist/core/lsp/refactor.d.ts +32 -0
- package/dist/core/lsp/refactor.d.ts.map +1 -0
- package/dist/core/lsp/refactor.js +519 -0
- package/dist/core/lsp/refactor.js.map +1 -0
- package/dist/core/lsp/transport.d.ts +39 -0
- package/dist/core/lsp/transport.d.ts.map +1 -0
- package/dist/core/lsp/transport.js +261 -0
- package/dist/core/lsp/transport.js.map +1 -0
- package/dist/core/messages.d.ts +34 -0
- package/dist/core/messages.d.ts.map +1 -0
- package/dist/core/messages.js +140 -0
- package/dist/core/messages.js.map +1 -0
- package/dist/core/model-registry.d.ts +148 -0
- package/dist/core/model-registry.d.ts.map +1 -0
- package/dist/core/model-registry.js +812 -0
- package/dist/core/model-registry.js.map +1 -0
- package/dist/core/model-resolver.d.ts +115 -0
- package/dist/core/model-resolver.d.ts.map +1 -0
- package/dist/core/model-resolver.js +498 -0
- package/dist/core/model-resolver.js.map +1 -0
- package/dist/core/output-guard.d.ts +7 -0
- package/dist/core/output-guard.d.ts.map +1 -0
- package/dist/core/output-guard.js +89 -0
- package/dist/core/output-guard.js.map +1 -0
- package/dist/core/package-manager.d.ts +209 -0
- package/dist/core/package-manager.d.ts.map +1 -0
- package/dist/core/package-manager.js +2341 -0
- package/dist/core/package-manager.js.map +1 -0
- package/dist/core/prompt-templates.d.ts +57 -0
- package/dist/core/prompt-templates.d.ts.map +1 -0
- package/dist/core/prompt-templates.js +353 -0
- package/dist/core/prompt-templates.js.map +1 -0
- package/dist/core/provider-display-names.d.ts +2 -0
- package/dist/core/provider-display-names.d.ts.map +1 -0
- package/dist/core/provider-display-names.js +33 -0
- package/dist/core/provider-display-names.js.map +1 -0
- package/dist/core/remote-workspace-protocol/contract.d.ts +465 -0
- package/dist/core/remote-workspace-protocol/contract.d.ts.map +1 -0
- package/dist/core/remote-workspace-protocol/contract.js +825 -0
- package/dist/core/remote-workspace-protocol/contract.js.map +1 -0
- package/dist/core/remote-workspace-protocol/guest-shared-client.d.ts +16 -0
- package/dist/core/remote-workspace-protocol/guest-shared-client.d.ts.map +1 -0
- package/dist/core/remote-workspace-protocol/guest-shared-client.js +54 -0
- package/dist/core/remote-workspace-protocol/guest-shared-client.js.map +1 -0
- package/dist/core/remote-workspace-protocol/guest-shared-outbound-scheduler.d.ts +23 -0
- package/dist/core/remote-workspace-protocol/guest-shared-outbound-scheduler.d.ts.map +1 -0
- package/dist/core/remote-workspace-protocol/guest-shared-outbound-scheduler.js +112 -0
- package/dist/core/remote-workspace-protocol/guest-shared-outbound-scheduler.js.map +1 -0
- package/dist/core/remote-workspace-protocol/guest-shared-uplink.d.ts +30 -0
- package/dist/core/remote-workspace-protocol/guest-shared-uplink.d.ts.map +1 -0
- package/dist/core/remote-workspace-protocol/guest-shared-uplink.js +243 -0
- package/dist/core/remote-workspace-protocol/guest-shared-uplink.js.map +1 -0
- package/dist/core/remote-workspace-protocol/lima-owner-directory.d.ts +3 -0
- package/dist/core/remote-workspace-protocol/lima-owner-directory.d.ts.map +1 -0
- package/dist/core/remote-workspace-protocol/lima-owner-directory.js +31 -0
- package/dist/core/remote-workspace-protocol/lima-owner-directory.js.map +1 -0
- package/dist/core/remote-workspace-protocol/lima-owner-lock.d.ts +9 -0
- package/dist/core/remote-workspace-protocol/lima-owner-lock.d.ts.map +1 -0
- package/dist/core/remote-workspace-protocol/lima-owner-lock.js +89 -0
- package/dist/core/remote-workspace-protocol/lima-owner-lock.js.map +1 -0
- package/dist/core/remote-workspace-protocol/session.d.ts +249 -0
- package/dist/core/remote-workspace-protocol/session.d.ts.map +1 -0
- package/dist/core/remote-workspace-protocol/session.js +1842 -0
- package/dist/core/remote-workspace-protocol/session.js.map +1 -0
- package/dist/core/remote-workspace-protocol/shared-transport.d.ts +71 -0
- package/dist/core/remote-workspace-protocol/shared-transport.d.ts.map +1 -0
- package/dist/core/remote-workspace-protocol/shared-transport.js +68 -0
- package/dist/core/remote-workspace-protocol/shared-transport.js.map +1 -0
- package/dist/core/resolve-config-value.d.ts +32 -0
- package/dist/core/resolve-config-value.d.ts.map +1 -0
- package/dist/core/resolve-config-value.js +257 -0
- package/dist/core/resolve-config-value.js.map +1 -0
- package/dist/core/resource-loader.d.ts +200 -0
- package/dist/core/resource-loader.d.ts.map +1 -0
- package/dist/core/resource-loader.js +1209 -0
- package/dist/core/resource-loader.js.map +1 -0
- package/dist/core/rules.d.ts +40 -0
- package/dist/core/rules.d.ts.map +1 -0
- package/dist/core/rules.js +57 -0
- package/dist/core/rules.js.map +1 -0
- package/dist/core/sandbox/command.d.ts +25 -0
- package/dist/core/sandbox/command.d.ts.map +1 -0
- package/dist/core/sandbox/command.js +102 -0
- package/dist/core/sandbox/command.js.map +1 -0
- package/dist/core/sandbox/config.d.ts +91 -0
- package/dist/core/sandbox/config.d.ts.map +1 -0
- package/dist/core/sandbox/config.js +88 -0
- package/dist/core/sandbox/config.js.map +1 -0
- package/dist/core/sandbox/lima-guest-binary.d.ts +11 -0
- package/dist/core/sandbox/lima-guest-binary.d.ts.map +1 -0
- package/dist/core/sandbox/lima-guest-binary.js +140 -0
- package/dist/core/sandbox/lima-guest-binary.js.map +1 -0
- package/dist/core/sandbox/lima.d.ts +57 -0
- package/dist/core/sandbox/lima.d.ts.map +1 -0
- package/dist/core/sandbox/lima.js +716 -0
- package/dist/core/sandbox/lima.js.map +1 -0
- package/dist/core/sandbox/shared-lima-roots.d.ts +11 -0
- package/dist/core/sandbox/shared-lima-roots.d.ts.map +1 -0
- package/dist/core/sandbox/shared-lima-roots.js +25 -0
- package/dist/core/sandbox/shared-lima-roots.js.map +1 -0
- package/dist/core/sandbox/update-shared-guest-binary.d.ts +8 -0
- package/dist/core/sandbox/update-shared-guest-binary.d.ts.map +1 -0
- package/dist/core/sandbox/update-shared-guest-binary.js +100 -0
- package/dist/core/sandbox/update-shared-guest-binary.js.map +1 -0
- package/dist/core/session/constants.d.ts +2 -0
- package/dist/core/session/constants.d.ts.map +1 -0
- package/dist/core/session/constants.js +2 -0
- package/dist/core/session/constants.js.map +1 -0
- package/dist/core/session/context-metadata.d.ts +5 -0
- package/dist/core/session/context-metadata.d.ts.map +1 -0
- package/dist/core/session/context-metadata.js +55 -0
- package/dist/core/session/context-metadata.js.map +1 -0
- package/dist/core/session/context.d.ts +14 -0
- package/dist/core/session/context.d.ts.map +1 -0
- package/dist/core/session/context.js +117 -0
- package/dist/core/session/context.js.map +1 -0
- package/dist/core/session/ids.d.ts +9 -0
- package/dist/core/session/ids.d.ts.map +1 -0
- package/dist/core/session/ids.js +21 -0
- package/dist/core/session/ids.js.map +1 -0
- package/dist/core/session/in-memory-session-manager.d.ts +17 -0
- package/dist/core/session/in-memory-session-manager.d.ts.map +1 -0
- package/dist/core/session/in-memory-session-manager.js +40 -0
- package/dist/core/session/in-memory-session-manager.js.map +1 -0
- package/dist/core/session/in-memory-session.d.ts +7 -0
- package/dist/core/session/in-memory-session.d.ts.map +1 -0
- package/dist/core/session/in-memory-session.js +11 -0
- package/dist/core/session/in-memory-session.js.map +1 -0
- package/dist/core/session/jsonl-errors.d.ts +36 -0
- package/dist/core/session/jsonl-errors.d.ts.map +1 -0
- package/dist/core/session/jsonl-errors.js +49 -0
- package/dist/core/session/jsonl-errors.js.map +1 -0
- package/dist/core/session/jsonl-helpers.d.ts +20 -0
- package/dist/core/session/jsonl-helpers.d.ts.map +1 -0
- package/dist/core/session/jsonl-helpers.js +21 -0
- package/dist/core/session/jsonl-helpers.js.map +1 -0
- package/dist/core/session/local-session-manager.d.ts +30 -0
- package/dist/core/session/local-session-manager.d.ts.map +1 -0
- package/dist/core/session/local-session-manager.js +205 -0
- package/dist/core/session/local-session-manager.js.map +1 -0
- package/dist/core/session/local-session.d.ts +9 -0
- package/dist/core/session/local-session.d.ts.map +1 -0
- package/dist/core/session/local-session.js +15 -0
- package/dist/core/session/local-session.js.map +1 -0
- package/dist/core/session/migrations.d.ts +11 -0
- package/dist/core/session/migrations.d.ts.map +1 -0
- package/dist/core/session/migrations.js +78 -0
- package/dist/core/session/migrations.js.map +1 -0
- package/dist/core/session/remote-session-client.d.ts +83 -0
- package/dist/core/session/remote-session-client.d.ts.map +1 -0
- package/dist/core/session/remote-session-client.js +224 -0
- package/dist/core/session/remote-session-client.js.map +1 -0
- package/dist/core/session/remote-session-manager.d.ts +32 -0
- package/dist/core/session/remote-session-manager.d.ts.map +1 -0
- package/dist/core/session/remote-session-manager.js +124 -0
- package/dist/core/session/remote-session-manager.js.map +1 -0
- package/dist/core/session/remote-session.d.ts +20 -0
- package/dist/core/session/remote-session.d.ts.map +1 -0
- package/dist/core/session/remote-session.js +33 -0
- package/dist/core/session/remote-session.js.map +1 -0
- package/dist/core/session/session-manager.d.ts +18 -0
- package/dist/core/session/session-manager.d.ts.map +1 -0
- package/dist/core/session/session-manager.js +2 -0
- package/dist/core/session/session-manager.js.map +1 -0
- package/dist/core/session/session.d.ts +140 -0
- package/dist/core/session/session.d.ts.map +1 -0
- package/dist/core/session/session.js +461 -0
- package/dist/core/session/session.js.map +1 -0
- package/dist/core/session/stores/in-memory-session-store.d.ts +39 -0
- package/dist/core/session/stores/in-memory-session-store.d.ts.map +1 -0
- package/dist/core/session/stores/in-memory-session-store.js +168 -0
- package/dist/core/session/stores/in-memory-session-store.js.map +1 -0
- package/dist/core/session/stores/jsonl-session-store.d.ts +97 -0
- package/dist/core/session/stores/jsonl-session-store.d.ts.map +1 -0
- package/dist/core/session/stores/jsonl-session-store.js +1140 -0
- package/dist/core/session/stores/jsonl-session-store.js.map +1 -0
- package/dist/core/session/stores/remote-session-store.d.ts +44 -0
- package/dist/core/session/stores/remote-session-store.d.ts.map +1 -0
- package/dist/core/session/stores/remote-session-store.js +159 -0
- package/dist/core/session/stores/remote-session-store.js.map +1 -0
- package/dist/core/session/stores/session-store.d.ts +42 -0
- package/dist/core/session/stores/session-store.d.ts.map +1 -0
- package/dist/core/session/stores/session-store.js +2 -0
- package/dist/core/session/stores/session-store.js.map +1 -0
- package/dist/core/session/types.d.ts +141 -0
- package/dist/core/session/types.d.ts.map +1 -0
- package/dist/core/session/types.js +2 -0
- package/dist/core/session/types.js.map +1 -0
- package/dist/core/session/usage-ledger.d.ts +18 -0
- package/dist/core/session/usage-ledger.d.ts.map +1 -0
- package/dist/core/session/usage-ledger.js +68 -0
- package/dist/core/session/usage-ledger.js.map +1 -0
- package/dist/core/session-cwd.d.ts +19 -0
- package/dist/core/session-cwd.d.ts.map +1 -0
- package/dist/core/session-cwd.js +38 -0
- package/dist/core/session-cwd.js.map +1 -0
- package/dist/core/settings-manager.d.ts +314 -0
- package/dist/core/settings-manager.d.ts.map +1 -0
- package/dist/core/settings-manager.js +991 -0
- package/dist/core/settings-manager.js.map +1 -0
- package/dist/core/skills.d.ts +40 -0
- package/dist/core/skills.d.ts.map +1 -0
- package/dist/core/skills.js +57 -0
- package/dist/core/skills.js.map +1 -0
- package/dist/core/slash-commands.d.ts +15 -0
- package/dist/core/slash-commands.d.ts.map +1 -0
- package/dist/core/slash-commands.js +36 -0
- package/dist/core/slash-commands.js.map +1 -0
- package/dist/core/source-info.d.ts +26 -0
- package/dist/core/source-info.d.ts.map +1 -0
- package/dist/core/source-info.js +27 -0
- package/dist/core/source-info.js.map +1 -0
- package/dist/core/system-prompt.d.ts +32 -0
- package/dist/core/system-prompt.d.ts.map +1 -0
- package/dist/core/system-prompt.js +131 -0
- package/dist/core/system-prompt.js.map +1 -0
- package/dist/core/telemetry.d.ts +3 -0
- package/dist/core/telemetry.d.ts.map +1 -0
- package/dist/core/telemetry.js +9 -0
- package/dist/core/telemetry.js.map +1 -0
- package/dist/core/timings.d.ts +10 -0
- package/dist/core/timings.d.ts.map +1 -0
- package/dist/core/timings.js +41 -0
- package/dist/core/timings.js.map +1 -0
- package/dist/core/tools/bash.d.ts +51 -0
- package/dist/core/tools/bash.d.ts.map +1 -0
- package/dist/core/tools/bash.js +321 -0
- package/dist/core/tools/bash.js.map +1 -0
- package/dist/core/tools/compress-context.d.ts +27 -0
- package/dist/core/tools/compress-context.d.ts.map +1 -0
- package/dist/core/tools/compress-context.js +142 -0
- package/dist/core/tools/compress-context.js.map +1 -0
- package/dist/core/tools/edit-diff.d.ts +82 -0
- package/dist/core/tools/edit-diff.d.ts.map +1 -0
- package/dist/core/tools/edit-diff.js +327 -0
- package/dist/core/tools/edit-diff.js.map +1 -0
- package/dist/core/tools/edit.d.ts +50 -0
- package/dist/core/tools/edit.d.ts.map +1 -0
- package/dist/core/tools/edit.js +324 -0
- package/dist/core/tools/edit.js.map +1 -0
- package/dist/core/tools/file-mutation-queue.d.ts +8 -0
- package/dist/core/tools/file-mutation-queue.d.ts.map +1 -0
- package/dist/core/tools/file-mutation-queue.js +69 -0
- package/dist/core/tools/file-mutation-queue.js.map +1 -0
- package/dist/core/tools/find.d.ts +22 -0
- package/dist/core/tools/find.d.ts.map +1 -0
- package/dist/core/tools/find.js +268 -0
- package/dist/core/tools/find.js.map +1 -0
- package/dist/core/tools/grep.d.ts +27 -0
- package/dist/core/tools/grep.d.ts.map +1 -0
- package/dist/core/tools/grep.js +332 -0
- package/dist/core/tools/grep.js.map +1 -0
- package/dist/core/tools/hash-store.d.ts +12 -0
- package/dist/core/tools/hash-store.d.ts.map +1 -0
- package/dist/core/tools/hash-store.js +48 -0
- package/dist/core/tools/hash-store.js.map +1 -0
- package/dist/core/tools/hashline/apply.d.ts +40 -0
- package/dist/core/tools/hashline/apply.d.ts.map +1 -0
- package/dist/core/tools/hashline/apply.js +261 -0
- package/dist/core/tools/hashline/apply.js.map +1 -0
- package/dist/core/tools/hashline/hash.d.ts +56 -0
- package/dist/core/tools/hashline/hash.d.ts.map +1 -0
- package/dist/core/tools/hashline/hash.js +196 -0
- package/dist/core/tools/hashline/hash.js.map +1 -0
- package/dist/core/tools/hashline/parse.d.ts +8 -0
- package/dist/core/tools/hashline/parse.d.ts.map +1 -0
- package/dist/core/tools/hashline/parse.js +41 -0
- package/dist/core/tools/hashline/parse.js.map +1 -0
- package/dist/core/tools/hashline/resolve.d.ts +51 -0
- package/dist/core/tools/hashline/resolve.d.ts.map +1 -0
- package/dist/core/tools/hashline/resolve.js +187 -0
- package/dist/core/tools/hashline/resolve.js.map +1 -0
- package/dist/core/tools/hashline-utils.d.ts +6 -0
- package/dist/core/tools/hashline-utils.d.ts.map +1 -0
- package/dist/core/tools/hashline-utils.js +23 -0
- package/dist/core/tools/hashline-utils.js.map +1 -0
- package/dist/core/tools/index.d.ts +36 -0
- package/dist/core/tools/index.d.ts.map +1 -0
- package/dist/core/tools/index.js +141 -0
- package/dist/core/tools/index.js.map +1 -0
- package/dist/core/tools/ls.d.ts +21 -0
- package/dist/core/tools/ls.d.ts.map +1 -0
- package/dist/core/tools/ls.js +156 -0
- package/dist/core/tools/ls.js.map +1 -0
- package/dist/core/tools/operations.d.ts +212 -0
- package/dist/core/tools/operations.d.ts.map +1 -0
- package/dist/core/tools/operations.js +793 -0
- package/dist/core/tools/operations.js.map +1 -0
- package/dist/core/tools/output-accumulator.d.ts +54 -0
- package/dist/core/tools/output-accumulator.d.ts.map +1 -0
- package/dist/core/tools/output-accumulator.js +184 -0
- package/dist/core/tools/output-accumulator.js.map +1 -0
- package/dist/core/tools/path-utils.d.ts +9 -0
- package/dist/core/tools/path-utils.d.ts.map +1 -0
- package/dist/core/tools/path-utils.js +99 -0
- package/dist/core/tools/path-utils.js.map +1 -0
- package/dist/core/tools/read.d.ts +32 -0
- package/dist/core/tools/read.d.ts.map +1 -0
- package/dist/core/tools/read.js +318 -0
- package/dist/core/tools/read.js.map +1 -0
- package/dist/core/tools/render-utils.d.ts +33 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -0
- package/dist/core/tools/render-utils.js +61 -0
- package/dist/core/tools/render-utils.js.map +1 -0
- package/dist/core/tools/replace-diff.d.ts +16 -0
- package/dist/core/tools/replace-diff.d.ts.map +1 -0
- package/dist/core/tools/replace-diff.js +117 -0
- package/dist/core/tools/replace-diff.js.map +1 -0
- package/dist/core/tools/replace-normalize.d.ts +2 -0
- package/dist/core/tools/replace-normalize.d.ts.map +1 -0
- package/dist/core/tools/replace-normalize.js +73 -0
- package/dist/core/tools/replace-normalize.js.map +1 -0
- package/dist/core/tools/replace-render.d.ts +51 -0
- package/dist/core/tools/replace-render.d.ts.map +1 -0
- package/dist/core/tools/replace-render.js +162 -0
- package/dist/core/tools/replace-render.js.map +1 -0
- package/dist/core/tools/runtime.d.ts +2 -0
- package/dist/core/tools/runtime.d.ts.map +1 -0
- package/dist/core/tools/runtime.js +6 -0
- package/dist/core/tools/runtime.js.map +1 -0
- package/dist/core/tools/session-history.d.ts +55 -0
- package/dist/core/tools/session-history.d.ts.map +1 -0
- package/dist/core/tools/session-history.js +649 -0
- package/dist/core/tools/session-history.js.map +1 -0
- package/dist/core/tools/subagent-agents.d.ts +29 -0
- package/dist/core/tools/subagent-agents.d.ts.map +1 -0
- package/dist/core/tools/subagent-agents.js +223 -0
- package/dist/core/tools/subagent-agents.js.map +1 -0
- package/dist/core/tools/subagent.d.ts +185 -0
- package/dist/core/tools/subagent.d.ts.map +1 -0
- package/dist/core/tools/subagent.js +1309 -0
- package/dist/core/tools/subagent.js.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts +14 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.js +34 -0
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -0
- package/dist/core/tools/truncate.d.ts +39 -0
- package/dist/core/tools/truncate.d.ts.map +1 -0
- package/dist/core/tools/truncate.js +215 -0
- package/dist/core/tools/truncate.js.map +1 -0
- package/dist/core/tools/websearch.d.ts +33 -0
- package/dist/core/tools/websearch.d.ts.map +1 -0
- package/dist/core/tools/websearch.js +341 -0
- package/dist/core/tools/websearch.js.map +1 -0
- package/dist/core/tools/workspace-tool-host.d.ts +102 -0
- package/dist/core/tools/workspace-tool-host.d.ts.map +1 -0
- package/dist/core/tools/workspace-tool-host.js +348 -0
- package/dist/core/tools/workspace-tool-host.js.map +1 -0
- package/dist/core/tools/write.d.ts +16 -0
- package/dist/core/tools/write.d.ts.map +1 -0
- package/dist/core/tools/write.js +204 -0
- package/dist/core/tools/write.js.map +1 -0
- package/dist/core/workspace-identity.d.ts +7 -0
- package/dist/core/workspace-identity.d.ts.map +1 -0
- package/dist/core/workspace-identity.js +2 -0
- package/dist/core/workspace-identity.js.map +1 -0
- package/dist/daemon/activity-budget.d.ts +10 -0
- package/dist/daemon/activity-budget.d.ts.map +1 -0
- package/dist/daemon/activity-budget.js +34 -0
- package/dist/daemon/activity-budget.js.map +1 -0
- package/dist/daemon/command.d.ts +6 -0
- package/dist/daemon/command.d.ts.map +1 -0
- package/dist/daemon/command.js +58 -0
- package/dist/daemon/command.js.map +1 -0
- package/dist/daemon/config.d.ts +45 -0
- package/dist/daemon/config.d.ts.map +1 -0
- package/dist/daemon/config.js +319 -0
- package/dist/daemon/config.js.map +1 -0
- package/dist/daemon/help.d.ts +2 -0
- package/dist/daemon/help.d.ts.map +1 -0
- package/dist/daemon/help.js +42 -0
- package/dist/daemon/help.js.map +1 -0
- package/dist/daemon/lsp-config.d.ts +4 -0
- package/dist/daemon/lsp-config.d.ts.map +1 -0
- package/dist/daemon/lsp-config.js +155 -0
- package/dist/daemon/lsp-config.js.map +1 -0
- package/dist/daemon/outbound-budget.d.ts +10 -0
- package/dist/daemon/outbound-budget.d.ts.map +1 -0
- package/dist/daemon/outbound-budget.js +30 -0
- package/dist/daemon/outbound-budget.js.map +1 -0
- package/dist/daemon/security.d.ts +19 -0
- package/dist/daemon/security.d.ts.map +1 -0
- package/dist/daemon/security.js +177 -0
- package/dist/daemon/security.js.map +1 -0
- package/dist/daemon/server.d.ts +20 -0
- package/dist/daemon/server.d.ts.map +1 -0
- package/dist/daemon/server.js +480 -0
- package/dist/daemon/server.js.map +1 -0
- package/dist/daemon/shared-connection.d.ts +33 -0
- package/dist/daemon/shared-connection.d.ts.map +1 -0
- package/dist/daemon/shared-connection.js +271 -0
- package/dist/daemon/shared-connection.js.map +1 -0
- package/dist/daemon/shared-revision.d.ts +5 -0
- package/dist/daemon/shared-revision.d.ts.map +1 -0
- package/dist/daemon/shared-revision.js +61 -0
- package/dist/daemon/shared-revision.js.map +1 -0
- package/dist/daemon/shared-roots.d.ts +9 -0
- package/dist/daemon/shared-roots.d.ts.map +1 -0
- package/dist/daemon/shared-roots.js +33 -0
- package/dist/daemon/shared-roots.js.map +1 -0
- package/dist/daemon/workspace-runtime.d.ts +46 -0
- package/dist/daemon/workspace-runtime.d.ts.map +1 -0
- package/dist/daemon/workspace-runtime.js +705 -0
- package/dist/daemon/workspace-runtime.js.map +1 -0
- package/dist/index.d.ts +109 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +107 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +39 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +765 -0
- package/dist/main.js.map +1 -0
- package/dist/migrations.d.ts +35 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +412 -0
- package/dist/migrations.js.map +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +30 -0
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/assistant-message.js +159 -0
- package/dist/modes/interactive/components/assistant-message.js.map +1 -0
- package/dist/modes/interactive/components/bash-execution.d.ts +36 -0
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/bash-execution.js +173 -0
- package/dist/modes/interactive/components/bash-execution.js.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts +18 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.js +54 -0
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts +17 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.js +45 -0
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +17 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.js +46 -0
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/config-selector.d.ts +74 -0
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/config-selector.js +514 -0
- package/dist/modes/interactive/components/config-selector.js.map +1 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
- package/dist/modes/interactive/components/countdown-timer.js +33 -0
- package/dist/modes/interactive/components/countdown-timer.js.map +1 -0
- package/dist/modes/interactive/components/custom-editor.d.ts +25 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-editor.js +85 -0
- package/dist/modes/interactive/components/custom-editor.js.map +1 -0
- package/dist/modes/interactive/components/custom-message.d.ts +20 -0
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-message.js +81 -0
- package/dist/modes/interactive/components/custom-message.js.map +1 -0
- package/dist/modes/interactive/components/diff.d.ts +12 -0
- package/dist/modes/interactive/components/diff.d.ts.map +1 -0
- package/dist/modes/interactive/components/diff.js +118 -0
- package/dist/modes/interactive/components/diff.js.map +1 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
- package/dist/modes/interactive/components/dynamic-border.js +21 -0
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -0
- package/dist/modes/interactive/components/extension-editor.d.ts +22 -0
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-editor.js +128 -0
- package/dist/modes/interactive/components/extension-editor.js.map +1 -0
- package/dist/modes/interactive/components/extension-input.d.ts +23 -0
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-input.js +61 -0
- package/dist/modes/interactive/components/extension-input.js.map +1 -0
- package/dist/modes/interactive/components/extension-selector.d.ts +26 -0
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-selector.js +83 -0
- package/dist/modes/interactive/components/extension-selector.js.map +1 -0
- package/dist/modes/interactive/components/footer.d.ts +36 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -0
- package/dist/modes/interactive/components/footer.js +227 -0
- package/dist/modes/interactive/components/footer.js.map +1 -0
- package/dist/modes/interactive/components/hook-execution.d.ts +19 -0
- package/dist/modes/interactive/components/hook-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/hook-execution.js +185 -0
- package/dist/modes/interactive/components/hook-execution.js.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts +13 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.js +36 -0
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
- package/dist/modes/interactive/components/login-dialog.d.ts +55 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
- package/dist/modes/interactive/components/login-dialog.js +176 -0
- package/dist/modes/interactive/components/login-dialog.js.map +1 -0
- package/dist/modes/interactive/components/markdown-transform.d.ts +4 -0
- package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -0
- package/dist/modes/interactive/components/markdown-transform.js +19 -0
- package/dist/modes/interactive/components/markdown-transform.js.map +1 -0
- package/dist/modes/interactive/components/mermaid.d.ts +14 -0
- package/dist/modes/interactive/components/mermaid.d.ts.map +1 -0
- package/dist/modes/interactive/components/mermaid.js +228 -0
- package/dist/modes/interactive/components/mermaid.js.map +1 -0
- package/dist/modes/interactive/components/message-card.d.ts +9 -0
- package/dist/modes/interactive/components/message-card.d.ts.map +1 -0
- package/dist/modes/interactive/components/message-card.js +24 -0
- package/dist/modes/interactive/components/message-card.js.map +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts +52 -0
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/model-selector.js +296 -0
- package/dist/modes/interactive/components/model-selector.js.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts +33 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.js +165 -0
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +50 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.js +300 -0
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts +22 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.js +144 -0
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -0
- package/dist/modes/interactive/components/session-selector.d.ts +108 -0
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector.js +835 -0
- package/dist/modes/interactive/components/session-selector.js.map +1 -0
- package/dist/modes/interactive/components/settings-selector.d.ts +81 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/settings-selector.js +455 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/show-images-selector.js +39 -0
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +18 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.js +48 -0
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
- package/dist/modes/interactive/components/theme-selector.d.ts +11 -0
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/theme-selector.js +50 -0
- package/dist/modes/interactive/components/theme-selector.js.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.js +51 -0
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -0
- package/dist/modes/interactive/components/tool-execution.d.ts +67 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/tool-execution.js +312 -0
- package/dist/modes/interactive/components/tool-execution.js.map +1 -0
- package/dist/modes/interactive/components/tree-selector.d.ts +127 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/tree-selector.js +1098 -0
- package/dist/modes/interactive/components/tree-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.js +114 -0
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message.d.ts +16 -0
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message.js +50 -0
- package/dist/modes/interactive/components/user-message.js.map +1 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
- package/dist/modes/interactive/components/visual-truncate.js +33 -0
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +554 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-mode.js +5870 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -0
- package/dist/modes/interactive/theme/dark.json +86 -0
- package/dist/modes/interactive/theme/light.json +85 -0
- package/dist/modes/interactive/theme/theme-schema.json +335 -0
- package/dist/modes/interactive/theme/theme.d.ts +109 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme.js +1040 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -0
- package/dist/modes/json-event.d.ts +28 -0
- package/dist/modes/json-event.d.ts.map +1 -0
- package/dist/modes/json-event.js +12 -0
- package/dist/modes/json-event.js.map +1 -0
- package/dist/modes/print-mode.d.ts +29 -0
- package/dist/modes/print-mode.d.ts.map +1 -0
- package/dist/modes/print-mode.js +142 -0
- package/dist/modes/print-mode.js.map +1 -0
- package/dist/modes/rpc/jsonl.d.ts +17 -0
- package/dist/modes/rpc/jsonl.d.ts.map +1 -0
- package/dist/modes/rpc/jsonl.js +49 -0
- package/dist/modes/rpc/jsonl.js.map +1 -0
- package/dist/modes/rpc/rpc-client.d.ts +321 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-client.js +755 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -0
- package/dist/modes/rpc/rpc-mode.d.ts +20 -0
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-mode.js +963 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -0
- package/dist/modes/rpc/rpc-types.d.ts +652 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-types.js +8 -0
- package/dist/modes/rpc/rpc-types.js.map +1 -0
- package/dist/package-manager-cli.d.ts +4 -0
- package/dist/package-manager-cli.d.ts.map +1 -0
- package/dist/package-manager-cli.js +488 -0
- package/dist/package-manager-cli.js.map +1 -0
- package/dist/utils/ansi.d.ts +2 -0
- package/dist/utils/ansi.d.ts.map +1 -0
- package/dist/utils/ansi.js +25 -0
- package/dist/utils/ansi.js.map +1 -0
- package/dist/utils/changelog.d.ts +23 -0
- package/dist/utils/changelog.d.ts.map +1 -0
- package/dist/utils/changelog.js +74 -0
- package/dist/utils/changelog.js.map +1 -0
- package/dist/utils/child-process.d.ts +15 -0
- package/dist/utils/child-process.d.ts.map +1 -0
- package/dist/utils/child-process.js +88 -0
- package/dist/utils/child-process.js.map +1 -0
- package/dist/utils/clipboard-image.d.ts +13 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -0
- package/dist/utils/clipboard-image.js +248 -0
- package/dist/utils/clipboard-image.js.map +1 -0
- package/dist/utils/clipboard-native.d.ts +11 -0
- package/dist/utils/clipboard-native.d.ts.map +1 -0
- package/dist/utils/clipboard-native.js +20 -0
- package/dist/utils/clipboard-native.js.map +1 -0
- package/dist/utils/clipboard.d.ts +4 -0
- package/dist/utils/clipboard.d.ts.map +1 -0
- package/dist/utils/clipboard.js +171 -0
- package/dist/utils/clipboard.js.map +1 -0
- package/dist/utils/deprecation.d.ts +4 -0
- package/dist/utils/deprecation.d.ts.map +1 -0
- package/dist/utils/deprecation.js +13 -0
- package/dist/utils/deprecation.js.map +1 -0
- package/dist/utils/directory-completions.d.ts +5 -0
- package/dist/utils/directory-completions.d.ts.map +1 -0
- package/dist/utils/directory-completions.js +64 -0
- package/dist/utils/directory-completions.js.map +1 -0
- package/dist/utils/exif-orientation.d.ts +6 -0
- package/dist/utils/exif-orientation.d.ts.map +1 -0
- package/dist/utils/exif-orientation.js +166 -0
- package/dist/utils/exif-orientation.js.map +1 -0
- package/dist/utils/frontmatter.d.ts +8 -0
- package/dist/utils/frontmatter.d.ts.map +1 -0
- package/dist/utils/frontmatter.js +26 -0
- package/dist/utils/frontmatter.js.map +1 -0
- package/dist/utils/fs-watch.d.ts +5 -0
- package/dist/utils/fs-watch.d.ts.map +1 -0
- package/dist/utils/fs-watch.js +25 -0
- package/dist/utils/fs-watch.js.map +1 -0
- package/dist/utils/git.d.ts +27 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +237 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/grip-user-agent.d.ts +2 -0
- package/dist/utils/grip-user-agent.d.ts.map +1 -0
- package/dist/utils/grip-user-agent.js +5 -0
- package/dist/utils/grip-user-agent.js.map +1 -0
- package/dist/utils/html.d.ts +7 -0
- package/dist/utils/html.d.ts.map +1 -0
- package/dist/utils/html.js +40 -0
- package/dist/utils/html.js.map +1 -0
- package/dist/utils/image-convert.d.ts +12 -0
- package/dist/utils/image-convert.d.ts.map +1 -0
- package/dist/utils/image-convert.js +43 -0
- package/dist/utils/image-convert.js.map +1 -0
- package/dist/utils/image-process.d.ts +18 -0
- package/dist/utils/image-process.d.ts.map +1 -0
- package/dist/utils/image-process.js +83 -0
- package/dist/utils/image-process.js.map +1 -0
- package/dist/utils/image-resize-core.d.ts +30 -0
- package/dist/utils/image-resize-core.d.ts.map +1 -0
- package/dist/utils/image-resize-core.js +133 -0
- package/dist/utils/image-resize-core.js.map +1 -0
- package/dist/utils/image-resize-worker.d.ts +2 -0
- package/dist/utils/image-resize-worker.d.ts.map +1 -0
- package/dist/utils/image-resize-worker.js +31 -0
- package/dist/utils/image-resize-worker.js.map +1 -0
- package/dist/utils/image-resize.d.ts +19 -0
- package/dist/utils/image-resize.d.ts.map +1 -0
- package/dist/utils/image-resize.js +86 -0
- package/dist/utils/image-resize.js.map +1 -0
- package/dist/utils/json.d.ts +3 -0
- package/dist/utils/json.d.ts.map +1 -0
- package/dist/utils/json.js +7 -0
- package/dist/utils/json.js.map +1 -0
- package/dist/utils/mime.d.ts +3 -0
- package/dist/utils/mime.d.ts.map +1 -0
- package/dist/utils/mime.js +110 -0
- package/dist/utils/mime.js.map +1 -0
- package/dist/utils/open-browser.d.ts +9 -0
- package/dist/utils/open-browser.d.ts.map +1 -0
- package/dist/utils/open-browser.js +22 -0
- package/dist/utils/open-browser.js.map +1 -0
- package/dist/utils/paths.d.ts +31 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +87 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/photon.d.ts +22 -0
- package/dist/utils/photon.d.ts.map +1 -0
- package/dist/utils/photon.js +126 -0
- package/dist/utils/photon.js.map +1 -0
- package/dist/utils/shell.d.ts +28 -0
- package/dist/utils/shell.d.ts.map +1 -0
- package/dist/utils/shell.js +188 -0
- package/dist/utils/shell.js.map +1 -0
- package/dist/utils/sleep.d.ts +5 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/dist/utils/sleep.js +17 -0
- package/dist/utils/sleep.js.map +1 -0
- package/dist/utils/syntax-highlight.d.ts +12 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -0
- package/dist/utils/syntax-highlight.js +125 -0
- package/dist/utils/syntax-highlight.js.map +1 -0
- package/dist/utils/tools-manager.d.ts +5 -0
- package/dist/utils/tools-manager.d.ts.map +1 -0
- package/dist/utils/tools-manager.js +329 -0
- package/dist/utils/tools-manager.js.map +1 -0
- package/dist/utils/version-check.d.ts +14 -0
- package/dist/utils/version-check.d.ts.map +1 -0
- package/dist/utils/version-check.js +91 -0
- package/dist/utils/version-check.js.map +1 -0
- package/dist/utils/windows-self-update.d.ts +3 -0
- package/dist/utils/windows-self-update.d.ts.map +1 -0
- package/dist/utils/windows-self-update.js +77 -0
- package/dist/utils/windows-self-update.js.map +1 -0
- package/docs/compaction.md +408 -0
- package/docs/custom-provider.md +714 -0
- package/docs/daemon-architecture.md +399 -0
- package/docs/daemon.md +112 -0
- package/docs/development.md +72 -0
- package/docs/docs.json +164 -0
- package/docs/extensions.md +2745 -0
- package/docs/hooks.md +85 -0
- package/docs/images/doom-extension.png +0 -0
- package/docs/images/exy.png +0 -0
- package/docs/images/interactive-mode.png +0 -0
- package/docs/images/tree-view.png +0 -0
- package/docs/index.md +77 -0
- package/docs/json.md +89 -0
- package/docs/keybindings.md +230 -0
- package/docs/lsp.md +499 -0
- package/docs/migrating-to-grip.md +18 -0
- package/docs/models.md +496 -0
- package/docs/packages.md +228 -0
- package/docs/prompt-templates.md +88 -0
- package/docs/providers.md +251 -0
- package/docs/quickstart.md +159 -0
- package/docs/rpc.md +1492 -0
- package/docs/rules.md +117 -0
- package/docs/sandbox.md +104 -0
- package/docs/sdk.md +360 -0
- package/docs/session-format.md +414 -0
- package/docs/sessions.md +137 -0
- package/docs/settings.md +372 -0
- package/docs/shell-aliases.md +13 -0
- package/docs/skills.md +246 -0
- package/docs/terminal-setup.md +112 -0
- package/docs/termux.md +112 -0
- package/docs/themes.md +295 -0
- package/docs/tmux.md +61 -0
- package/docs/tui.md +918 -0
- package/docs/usage.md +304 -0
- package/docs/windows.md +17 -0
- package/examples/README.md +29 -0
- package/examples/daemon-docker/Dockerfile +43 -0
- package/examples/daemon-docker/README.md +45 -0
- package/examples/extensions/README.md +208 -0
- package/examples/extensions/auto-commit-on-exit.ts +46 -0
- package/examples/extensions/bash-spawn-hook.ts +30 -0
- package/examples/extensions/bookmark.ts +50 -0
- package/examples/extensions/border-status-editor.ts +145 -0
- package/examples/extensions/built-in-tool-renderer.ts +259 -0
- package/examples/extensions/claude-rules.ts +86 -0
- package/examples/extensions/commands.ts +82 -0
- package/examples/extensions/confirm-destructive.ts +59 -0
- package/examples/extensions/custom-compaction.ts +131 -0
- package/examples/extensions/custom-footer.ts +79 -0
- package/examples/extensions/custom-header.ts +73 -0
- package/examples/extensions/custom-provider-anthropic/index.ts +707 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
- package/examples/extensions/custom-provider-anthropic/package.json +19 -0
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +402 -0
- package/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +104 -0
- package/examples/extensions/dirty-repo-guard.ts +59 -0
- package/examples/extensions/doom-overlay/README.md +46 -0
- package/examples/extensions/doom-overlay/doom/build/doom.js +21 -0
- package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
- package/examples/extensions/doom-overlay/doom/build.sh +152 -0
- package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -0
- package/examples/extensions/doom-overlay/doom-component.ts +133 -0
- package/examples/extensions/doom-overlay/doom-engine.ts +173 -0
- package/examples/extensions/doom-overlay/doom-keys.ts +104 -0
- package/examples/extensions/doom-overlay/index.ts +74 -0
- package/examples/extensions/doom-overlay/wad-finder.ts +51 -0
- package/examples/extensions/dynamic-resources/RULES.md +8 -0
- package/examples/extensions/dynamic-resources/SKILL.md +8 -0
- package/examples/extensions/dynamic-resources/dynamic.json +79 -0
- package/examples/extensions/dynamic-resources/dynamic.md +5 -0
- package/examples/extensions/dynamic-resources/index.ts +16 -0
- package/examples/extensions/dynamic-tools.ts +74 -0
- package/examples/extensions/event-bus.ts +43 -0
- package/examples/extensions/file-trigger.ts +41 -0
- package/examples/extensions/git-checkpoint.ts +53 -0
- package/examples/extensions/git-merge-and-resolve.ts +125 -0
- package/examples/extensions/github-issue-autocomplete.ts +191 -0
- package/examples/extensions/handoff.ts +191 -0
- package/examples/extensions/hello.ts +26 -0
- package/examples/extensions/hidden-thinking-label.ts +53 -0
- package/examples/extensions/inline-bash.ts +104 -0
- package/examples/extensions/input-transform.ts +43 -0
- package/examples/extensions/interactive-shell.ts +194 -0
- package/examples/extensions/mac-system-theme.ts +47 -0
- package/examples/extensions/message-renderer.ts +59 -0
- package/examples/extensions/minimal-mode.ts +428 -0
- package/examples/extensions/modal-editor.ts +86 -0
- package/examples/extensions/model-status.ts +31 -0
- package/examples/extensions/notify.ts +55 -0
- package/examples/extensions/overlay-qa-tests.ts +1374 -0
- package/examples/extensions/overlay-test.ts +171 -0
- package/examples/extensions/permission-gate.ts +34 -0
- package/examples/extensions/pirate.ts +47 -0
- package/examples/extensions/plan-mode/README.md +65 -0
- package/examples/extensions/plan-mode/index.ts +346 -0
- package/examples/extensions/plan-mode/utils.ts +172 -0
- package/examples/extensions/preset.ts +426 -0
- package/examples/extensions/prompt-customizer.ts +97 -0
- package/examples/extensions/protected-paths.ts +29 -0
- package/examples/extensions/provider-payload.ts +18 -0
- package/examples/extensions/qna.ts +125 -0
- package/examples/extensions/question.ts +294 -0
- package/examples/extensions/questionnaire.ts +459 -0
- package/examples/extensions/rainbow-editor.ts +88 -0
- package/examples/extensions/reload-runtime.ts +37 -0
- package/examples/extensions/rpc-demo.ts +118 -0
- package/examples/extensions/sandbox/index.ts +320 -0
- package/examples/extensions/sandbox/package-lock.json +92 -0
- package/examples/extensions/sandbox/package.json +19 -0
- package/examples/extensions/send-user-message.ts +97 -0
- package/examples/extensions/session-name.ts +27 -0
- package/examples/extensions/shutdown-command.ts +63 -0
- package/examples/extensions/snake.ts +381 -0
- package/examples/extensions/space-invaders.ts +597 -0
- package/examples/extensions/status-line.ts +32 -0
- package/examples/extensions/structured-output.ts +65 -0
- package/examples/extensions/subagent/README.md +175 -0
- package/examples/extensions/subagent/agents/planner.md +37 -0
- package/examples/extensions/subagent/agents/reviewer.md +35 -0
- package/examples/extensions/subagent/agents/scout.md +50 -0
- package/examples/extensions/subagent/agents/worker.md +24 -0
- package/examples/extensions/subagent/agents.ts +126 -0
- package/examples/extensions/subagent/index.ts +1083 -0
- package/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
- package/examples/extensions/subagent/prompts/implement.md +10 -0
- package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
- package/examples/extensions/summarize.ts +186 -0
- package/examples/extensions/system-prompt-header.ts +17 -0
- package/examples/extensions/tic-tac-toe.ts +1091 -0
- package/examples/extensions/timed-confirm.ts +70 -0
- package/examples/extensions/titlebar-spinner.ts +58 -0
- package/examples/extensions/todo.ts +306 -0
- package/examples/extensions/tool-override.ts +144 -0
- package/examples/extensions/tools.ts +141 -0
- package/examples/extensions/trigger-compact.ts +50 -0
- package/examples/extensions/truncated-tool.ts +200 -0
- package/examples/extensions/widget-placement.ts +9 -0
- package/examples/extensions/with-deps/index.ts +32 -0
- package/examples/extensions/with-deps/package-lock.json +31 -0
- package/examples/extensions/with-deps/package.json +22 -0
- package/examples/extensions/working-indicator.ts +123 -0
- package/examples/extensions/working-message-test.ts +25 -0
- package/examples/remote-session-server/README.md +71 -0
- package/examples/remote-session-server/server.ts +353 -0
- package/examples/rpc-extension-ui.ts +642 -0
- package/examples/sdk/01-minimal.ts +27 -0
- package/examples/sdk/02-custom-model.ts +54 -0
- package/examples/sdk/03-custom-prompt.ts +76 -0
- package/examples/sdk/04-skills.ts +60 -0
- package/examples/sdk/05-tools.ts +55 -0
- package/examples/sdk/06-extensions.ts +94 -0
- package/examples/sdk/07-context-files.ts +47 -0
- package/examples/sdk/08-prompt-templates.ts +56 -0
- package/examples/sdk/09-api-keys-and-oauth.ts +50 -0
- package/examples/sdk/10-settings.ts +58 -0
- package/examples/sdk/11-sessions.ts +54 -0
- package/examples/sdk/12-full-control.ts +79 -0
- package/examples/sdk/13-session-runtime.ts +49 -0
- package/examples/sdk/README.md +94 -0
- package/npm-shrinkwrap.json +1878 -0
- package/package.json +101 -5
|
@@ -0,0 +1,682 @@
|
|
|
1
|
+
import { posix, win32 } from "node:path";
|
|
2
|
+
import { normalizePortablePath, pathApi, pathFlavor, relativeWithin } from "./portable-path.js";
|
|
3
|
+
const SERVER_KEYS = new Set([
|
|
4
|
+
"id",
|
|
5
|
+
"enabled",
|
|
6
|
+
"selectors",
|
|
7
|
+
"transport",
|
|
8
|
+
"lifecycle",
|
|
9
|
+
"workspace",
|
|
10
|
+
"pathMappings",
|
|
11
|
+
"initializationOptions",
|
|
12
|
+
"settings",
|
|
13
|
+
"clientInfo",
|
|
14
|
+
"locale",
|
|
15
|
+
"trace",
|
|
16
|
+
"features",
|
|
17
|
+
"priority",
|
|
18
|
+
"timeouts",
|
|
19
|
+
]);
|
|
20
|
+
const FEATURE_KEYS = ["diagnostics", "hover", "definition", "references", "rename", "codeActions"];
|
|
21
|
+
const TIMEOUT_KEYS = ["connectMs", "initializeMs", "requestMs", "shutdownMs"];
|
|
22
|
+
export function parseLspConfiguration(value) {
|
|
23
|
+
const diagnostics = [];
|
|
24
|
+
const object = parseObject(value, "$", diagnostics);
|
|
25
|
+
if (!object)
|
|
26
|
+
return { diagnostics };
|
|
27
|
+
rejectUnknownKeys(object, new Set(["enabled", "mode", "servers"]), "$", diagnostics);
|
|
28
|
+
const enabled = parseOptionalBoolean(object.enabled, "$.enabled", diagnostics);
|
|
29
|
+
const mode = parseOptionalEnum(object.mode, ["merge", "replace"], "$.mode", diagnostics);
|
|
30
|
+
const servers = parseServers(object.servers, diagnostics);
|
|
31
|
+
if (diagnostics.length > 0)
|
|
32
|
+
return { diagnostics };
|
|
33
|
+
return {
|
|
34
|
+
configuration: {
|
|
35
|
+
...(enabled === undefined ? {} : { enabled }),
|
|
36
|
+
...(mode === undefined ? {} : { mode }),
|
|
37
|
+
...(servers === undefined ? {} : { servers }),
|
|
38
|
+
},
|
|
39
|
+
diagnostics,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function applyLspServerLayer(servers, layer) {
|
|
43
|
+
if (layer.mode === "replace")
|
|
44
|
+
servers.clear();
|
|
45
|
+
for (const server of layer.servers ?? []) {
|
|
46
|
+
if (server.enabled === false)
|
|
47
|
+
servers.delete(server.id);
|
|
48
|
+
else
|
|
49
|
+
servers.set(server.id, server);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/** Resolve already validated layers from lowest to highest precedence. */
|
|
53
|
+
export function resolveLspConfiguration(layers) {
|
|
54
|
+
const servers = new Map();
|
|
55
|
+
let enabled = false;
|
|
56
|
+
let hasLayer = false;
|
|
57
|
+
for (const layer of layers) {
|
|
58
|
+
if (!layer)
|
|
59
|
+
continue;
|
|
60
|
+
if (!hasLayer)
|
|
61
|
+
enabled = layer.enabled ?? true;
|
|
62
|
+
hasLayer = true;
|
|
63
|
+
if (layer.enabled !== undefined)
|
|
64
|
+
enabled = layer.enabled;
|
|
65
|
+
applyLspServerLayer(servers, layer);
|
|
66
|
+
}
|
|
67
|
+
return { enabled: hasLayer && enabled, servers: [...servers.values()] };
|
|
68
|
+
}
|
|
69
|
+
function parseServers(value, diagnostics) {
|
|
70
|
+
if (value === undefined)
|
|
71
|
+
return undefined;
|
|
72
|
+
if (!Array.isArray(value)) {
|
|
73
|
+
addError(diagnostics, "$.servers", "must be an array");
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
const servers = [];
|
|
77
|
+
const ids = new Set();
|
|
78
|
+
for (const [index, entry] of value.entries()) {
|
|
79
|
+
const path = `$.servers[${index}]`;
|
|
80
|
+
const server = parseServer(entry, path, diagnostics);
|
|
81
|
+
if (!server)
|
|
82
|
+
continue;
|
|
83
|
+
if (ids.has(server.id))
|
|
84
|
+
addError(diagnostics, `${path}.id`, `duplicates server ID ${JSON.stringify(server.id)}`);
|
|
85
|
+
else
|
|
86
|
+
ids.add(server.id);
|
|
87
|
+
servers.push(server);
|
|
88
|
+
}
|
|
89
|
+
return servers;
|
|
90
|
+
}
|
|
91
|
+
function validateTransportLifecycle(transport, lifecycle, path, diagnostics) {
|
|
92
|
+
if (!transport || transport.type === "connection")
|
|
93
|
+
return;
|
|
94
|
+
const expectedLifecycle = transport.type === "spawn" ? "managed" : "attached";
|
|
95
|
+
if (lifecycle?.type === expectedLifecycle)
|
|
96
|
+
return;
|
|
97
|
+
addError(diagnostics, `${path}.lifecycle.type`, `must be '${expectedLifecycle}' when transport.type is '${transport.type}'`);
|
|
98
|
+
}
|
|
99
|
+
function parseServerId(value, path, diagnostics) {
|
|
100
|
+
const id = parseRequiredString(value, `${path}.id`, diagnostics);
|
|
101
|
+
if (!id || /^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(id))
|
|
102
|
+
return id;
|
|
103
|
+
addError(diagnostics, `${path}.id`, "must start with an alphanumeric character and contain only letters, numbers, '.', '_' or '-'");
|
|
104
|
+
return id;
|
|
105
|
+
}
|
|
106
|
+
function createDisabledServerEntry(object, id, path, diagnostics) {
|
|
107
|
+
rejectUnknownKeys(object, new Set(["id", "enabled"]), path, diagnostics);
|
|
108
|
+
if (!id)
|
|
109
|
+
return undefined;
|
|
110
|
+
return { id, enabled: false };
|
|
111
|
+
}
|
|
112
|
+
function parseServer(value, path, diagnostics) {
|
|
113
|
+
const object = parseObject(value, path, diagnostics);
|
|
114
|
+
if (!object)
|
|
115
|
+
return undefined;
|
|
116
|
+
const id = parseServerId(object.id, path, diagnostics);
|
|
117
|
+
const enabled = parseOptionalBoolean(object.enabled, `${path}.enabled`, diagnostics);
|
|
118
|
+
if (enabled === false)
|
|
119
|
+
return createDisabledServerEntry(object, id, path, diagnostics);
|
|
120
|
+
rejectUnknownKeys(object, SERVER_KEYS, path, diagnostics);
|
|
121
|
+
const selectors = parseSelectors(object.selectors, `${path}.selectors`, diagnostics);
|
|
122
|
+
const transport = parseTransport(object.transport, `${path}.transport`, diagnostics);
|
|
123
|
+
const lifecycle = parseLifecycle(object.lifecycle, `${path}.lifecycle`, diagnostics);
|
|
124
|
+
const workspace = parseWorkspace(object.workspace, `${path}.workspace`, diagnostics);
|
|
125
|
+
const pathMappings = parsePathMappings(object.pathMappings, `${path}.pathMappings`, diagnostics);
|
|
126
|
+
const initializationOptions = parseOptionalJson(object.initializationOptions, `${path}.initializationOptions`, diagnostics);
|
|
127
|
+
const settings = parseOptionalJson(object.settings, `${path}.settings`, diagnostics);
|
|
128
|
+
const clientInfo = parseClientInfo(object.clientInfo, `${path}.clientInfo`, diagnostics);
|
|
129
|
+
const locale = parseOptionalString(object.locale, `${path}.locale`, diagnostics);
|
|
130
|
+
const trace = parseOptionalEnum(object.trace, ["off", "messages", "verbose"], `${path}.trace`, diagnostics);
|
|
131
|
+
const features = parseFeatures(object.features, `${path}.features`, diagnostics);
|
|
132
|
+
const priority = parseOptionalInteger(object.priority, `${path}.priority`, diagnostics);
|
|
133
|
+
const timeouts = parseTimeouts(object.timeouts, `${path}.timeouts`, diagnostics);
|
|
134
|
+
validateTransportLifecycle(transport, lifecycle, path, diagnostics);
|
|
135
|
+
if (!id || !selectors || !transport || !lifecycle || !workspace)
|
|
136
|
+
return undefined;
|
|
137
|
+
return {
|
|
138
|
+
id,
|
|
139
|
+
...(enabled === true ? { enabled: true } : {}),
|
|
140
|
+
selectors,
|
|
141
|
+
transport,
|
|
142
|
+
lifecycle,
|
|
143
|
+
workspace,
|
|
144
|
+
...(pathMappings === undefined ? {} : { pathMappings }),
|
|
145
|
+
...(initializationOptions === undefined ? {} : { initializationOptions }),
|
|
146
|
+
...(settings === undefined ? {} : { settings }),
|
|
147
|
+
...(clientInfo === undefined ? {} : { clientInfo }),
|
|
148
|
+
...(locale === undefined ? {} : { locale }),
|
|
149
|
+
...(trace === undefined ? {} : { trace }),
|
|
150
|
+
...(features === undefined ? {} : { features }),
|
|
151
|
+
...(priority === undefined ? {} : { priority }),
|
|
152
|
+
...(timeouts === undefined ? {} : { timeouts }),
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
function registerSelectorSignature(signatures, signature, path, diagnostics) {
|
|
156
|
+
if (signatures.has(signature)) {
|
|
157
|
+
addError(diagnostics, path, "is ambiguous because another selector has the same scheme and pattern");
|
|
158
|
+
}
|
|
159
|
+
signatures.add(signature);
|
|
160
|
+
}
|
|
161
|
+
function parseSelectors(value, path, diagnostics) {
|
|
162
|
+
if (!Array.isArray(value) || value.length === 0) {
|
|
163
|
+
addError(diagnostics, path, "must be a non-empty array");
|
|
164
|
+
return undefined;
|
|
165
|
+
}
|
|
166
|
+
const selectors = [];
|
|
167
|
+
const signatures = new Set();
|
|
168
|
+
for (const [index, entry] of value.entries()) {
|
|
169
|
+
const itemPath = `${path}[${index}]`;
|
|
170
|
+
const object = parseObject(entry, itemPath, diagnostics);
|
|
171
|
+
if (!object)
|
|
172
|
+
continue;
|
|
173
|
+
rejectUnknownKeys(object, new Set(["languageId", "pattern", "scheme"]), itemPath, diagnostics);
|
|
174
|
+
const languageId = parseRequiredString(object.languageId, `${itemPath}.languageId`, diagnostics);
|
|
175
|
+
const pattern = parseRequiredString(object.pattern, `${itemPath}.pattern`, diagnostics);
|
|
176
|
+
const scheme = parseOptionalString(object.scheme, `${itemPath}.scheme`, diagnostics);
|
|
177
|
+
if (pattern && !isSafeRelativePath(pattern)) {
|
|
178
|
+
addError(diagnostics, `${itemPath}.pattern`, "must be a workspace-relative pattern without '..' segments");
|
|
179
|
+
}
|
|
180
|
+
if (!languageId || !pattern)
|
|
181
|
+
continue;
|
|
182
|
+
const signature = `${scheme ?? "file"}\u0000${pattern}`;
|
|
183
|
+
registerSelectorSignature(signatures, signature, itemPath, diagnostics);
|
|
184
|
+
selectors.push({ languageId, pattern, ...(scheme === undefined ? {} : { scheme }) });
|
|
185
|
+
}
|
|
186
|
+
return selectors;
|
|
187
|
+
}
|
|
188
|
+
function parseTransport(value, path, diagnostics) {
|
|
189
|
+
const object = parseObject(value, path, diagnostics);
|
|
190
|
+
if (!object)
|
|
191
|
+
return undefined;
|
|
192
|
+
const type = parseRequiredString(object.type, `${path}.type`, diagnostics);
|
|
193
|
+
switch (type) {
|
|
194
|
+
case "spawn":
|
|
195
|
+
return parseSpawnTransport(object, path, diagnostics);
|
|
196
|
+
case "tcp":
|
|
197
|
+
return parseTcpTransport(object, path, diagnostics);
|
|
198
|
+
case "unix":
|
|
199
|
+
return parseUnixSocketTransport(object, path, diagnostics);
|
|
200
|
+
case "pipe":
|
|
201
|
+
return parseNamedPipeTransport(object, path, diagnostics);
|
|
202
|
+
case "connection":
|
|
203
|
+
return parseProgrammaticTransport(object, path, diagnostics);
|
|
204
|
+
default:
|
|
205
|
+
if (type)
|
|
206
|
+
addError(diagnostics, `${path}.type`, "must be one of 'spawn', 'tcp', 'unix', 'pipe', or 'connection'");
|
|
207
|
+
return undefined;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
function parseSpawnTransport(object, path, diagnostics) {
|
|
211
|
+
rejectUnknownKeys(object, new Set(["type", "command", "args", "env", "cwd"]), path, diagnostics);
|
|
212
|
+
const command = parseRequiredString(object.command, `${path}.command`, diagnostics);
|
|
213
|
+
const args = parseOptionalStringArray(object.args, `${path}.args`, diagnostics);
|
|
214
|
+
const env = parseOptionalStringRecord(object.env, `${path}.env`, diagnostics);
|
|
215
|
+
const cwd = parseOptionalString(object.cwd, `${path}.cwd`, diagnostics);
|
|
216
|
+
return command
|
|
217
|
+
? { type: "spawn", command, ...(args ? { args } : {}), ...(env ? { env } : {}), ...(cwd ? { cwd } : {}) }
|
|
218
|
+
: undefined;
|
|
219
|
+
}
|
|
220
|
+
function parseTcpTransport(object, path, diagnostics) {
|
|
221
|
+
rejectUnknownKeys(object, new Set(["type", "host", "port"]), path, diagnostics);
|
|
222
|
+
const host = parseRequiredString(object.host, `${path}.host`, diagnostics);
|
|
223
|
+
const port = parseOptionalInteger(object.port, `${path}.port`, diagnostics);
|
|
224
|
+
if (port === undefined)
|
|
225
|
+
addError(diagnostics, `${path}.port`, "is required and must be an integer");
|
|
226
|
+
else if (port < 1 || port > 65535)
|
|
227
|
+
addError(diagnostics, `${path}.port`, "must be between 1 and 65535");
|
|
228
|
+
return host && port !== undefined ? { type: "tcp", host, port } : undefined;
|
|
229
|
+
}
|
|
230
|
+
function parseUnixSocketTransport(object, path, diagnostics) {
|
|
231
|
+
rejectUnknownKeys(object, new Set(["type", "path"]), path, diagnostics);
|
|
232
|
+
const endpointPath = parseRequiredString(object.path, `${path}.path`, diagnostics);
|
|
233
|
+
if (endpointPath && !posix.isAbsolute(endpointPath) && !isSafeRelativePath(endpointPath)) {
|
|
234
|
+
addError(diagnostics, `${path}.path`, "must be absolute or a safe source-relative Unix socket path");
|
|
235
|
+
}
|
|
236
|
+
return endpointPath ? { type: "unix", path: endpointPath } : undefined;
|
|
237
|
+
}
|
|
238
|
+
function parseNamedPipeTransport(object, path, diagnostics) {
|
|
239
|
+
rejectUnknownKeys(object, new Set(["type", "path"]), path, diagnostics);
|
|
240
|
+
const endpointPath = parseRequiredString(object.path, `${path}.path`, diagnostics);
|
|
241
|
+
if (endpointPath && !isAbsoluteNamedPipe(endpointPath)) {
|
|
242
|
+
addError(diagnostics, `${path}.path`, "must be an absolute Windows named-pipe path such as \\\\.\\pipe\\server");
|
|
243
|
+
}
|
|
244
|
+
return endpointPath ? { type: "pipe", path: endpointPath } : undefined;
|
|
245
|
+
}
|
|
246
|
+
function parseProgrammaticTransport(object, path, diagnostics) {
|
|
247
|
+
rejectUnknownKeys(object, new Set(["type", "id"]), path, diagnostics);
|
|
248
|
+
const id = parseRequiredString(object.id, `${path}.id`, diagnostics);
|
|
249
|
+
return id ? { type: "connection", id } : undefined;
|
|
250
|
+
}
|
|
251
|
+
function parseLifecycle(value, path, diagnostics) {
|
|
252
|
+
const object = parseObject(value, path, diagnostics);
|
|
253
|
+
if (!object)
|
|
254
|
+
return undefined;
|
|
255
|
+
const type = parseRequiredString(object.type, `${path}.type`, diagnostics);
|
|
256
|
+
if (type === "managed") {
|
|
257
|
+
rejectUnknownKeys(object, new Set(["type"]), path, diagnostics);
|
|
258
|
+
return { type };
|
|
259
|
+
}
|
|
260
|
+
if (type === "attached") {
|
|
261
|
+
rejectUnknownKeys(object, new Set(["type", "shutdown"]), path, diagnostics);
|
|
262
|
+
const shutdown = parseOptionalEnum(object.shutdown, ["disconnect", "protocol"], `${path}.shutdown`, diagnostics);
|
|
263
|
+
return { type, ...(shutdown === undefined ? {} : { shutdown }) };
|
|
264
|
+
}
|
|
265
|
+
if (type)
|
|
266
|
+
addError(diagnostics, `${path}.type`, "must be 'managed' or 'attached'");
|
|
267
|
+
return undefined;
|
|
268
|
+
}
|
|
269
|
+
function parseWorkspace(value, path, diagnostics) {
|
|
270
|
+
const object = parseObject(value, path, diagnostics);
|
|
271
|
+
if (!object)
|
|
272
|
+
return undefined;
|
|
273
|
+
const type = parseRequiredString(object.type, `${path}.type`, diagnostics);
|
|
274
|
+
if (type === "session") {
|
|
275
|
+
rejectUnknownKeys(object, new Set(["type"]), path, diagnostics);
|
|
276
|
+
return { type };
|
|
277
|
+
}
|
|
278
|
+
if (type === "fixed") {
|
|
279
|
+
rejectUnknownKeys(object, new Set(["type", "path"]), path, diagnostics);
|
|
280
|
+
const fixedPath = parseRequiredString(object.path, `${path}.path`, diagnostics);
|
|
281
|
+
return fixedPath ? { type, path: fixedPath } : undefined;
|
|
282
|
+
}
|
|
283
|
+
if (type === "markers") {
|
|
284
|
+
rejectUnknownKeys(object, new Set(["type", "markers", "fallback", "stopAt"]), path, diagnostics);
|
|
285
|
+
const markers = parseRequiredUniqueRelativePaths(object.markers, `${path}.markers`, diagnostics);
|
|
286
|
+
const fallback = parseOptionalEnum(object.fallback, ["session", "none"], `${path}.fallback`, diagnostics);
|
|
287
|
+
const stopAt = parseOptionalString(object.stopAt, `${path}.stopAt`, diagnostics);
|
|
288
|
+
return markers
|
|
289
|
+
? {
|
|
290
|
+
type,
|
|
291
|
+
markers,
|
|
292
|
+
...(fallback === undefined ? {} : { fallback }),
|
|
293
|
+
...(stopAt === undefined ? {} : { stopAt }),
|
|
294
|
+
}
|
|
295
|
+
: undefined;
|
|
296
|
+
}
|
|
297
|
+
if (type)
|
|
298
|
+
addError(diagnostics, `${path}.type`, "must be 'session', 'fixed', or 'markers'");
|
|
299
|
+
return undefined;
|
|
300
|
+
}
|
|
301
|
+
function parsePathMappingEntry(entry, index, path, diagnostics, state) {
|
|
302
|
+
const itemPath = `${path}[${index}]`;
|
|
303
|
+
const object = parseObject(entry, itemPath, diagnostics);
|
|
304
|
+
if (!object)
|
|
305
|
+
return;
|
|
306
|
+
rejectUnknownKeys(object, new Set(["agentRoot", "serverRootUri"]), itemPath, diagnostics);
|
|
307
|
+
const agentRoot = parseRequiredString(object.agentRoot, `${itemPath}.agentRoot`, diagnostics);
|
|
308
|
+
const serverRootUri = parseRequiredString(object.serverRootUri, `${itemPath}.serverRootUri`, diagnostics);
|
|
309
|
+
if (serverRootUri && !isAbsoluteFileUri(serverRootUri)) {
|
|
310
|
+
addError(diagnostics, `${itemPath}.serverRootUri`, "must be an absolute file URI without query or fragment components");
|
|
311
|
+
}
|
|
312
|
+
if (!agentRoot || !serverRootUri)
|
|
313
|
+
return;
|
|
314
|
+
const normalizedAgentRoot = normalizeAgentRoot(agentRoot);
|
|
315
|
+
const normalizedServerRoot = canonicalFileUri(serverRootUri);
|
|
316
|
+
if (state.agentRoots.has(normalizedAgentRoot))
|
|
317
|
+
addError(diagnostics, `${itemPath}.agentRoot`, "duplicates another mapping root");
|
|
318
|
+
if (normalizedServerRoot && state.serverRoots.has(normalizedServerRoot)) {
|
|
319
|
+
addError(diagnostics, `${itemPath}.serverRootUri`, "duplicates another mapping root");
|
|
320
|
+
}
|
|
321
|
+
state.agentRoots.add(normalizedAgentRoot);
|
|
322
|
+
if (normalizedServerRoot)
|
|
323
|
+
state.serverRoots.add(normalizedServerRoot);
|
|
324
|
+
state.mappings.push({ agentRoot, serverRootUri });
|
|
325
|
+
}
|
|
326
|
+
function validatePathMappingReversibility(mappings, path, diagnostics) {
|
|
327
|
+
for (let index = 0; index < mappings.length; index++) {
|
|
328
|
+
for (let previous = 0; previous < index; previous++) {
|
|
329
|
+
if (pathMappingsAreReversible(mappings[previous], mappings[index]))
|
|
330
|
+
continue;
|
|
331
|
+
addError(diagnostics, `${path}[${index}].agentRoot`, `overlaps mapping ${previous} without an equivalent server URI relationship`);
|
|
332
|
+
addError(diagnostics, `${path}[${index}].serverRootUri`, `overlaps mapping ${previous} without an equivalent agent path relationship`);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
function parsePathMappings(value, path, diagnostics) {
|
|
337
|
+
if (value === undefined)
|
|
338
|
+
return undefined;
|
|
339
|
+
if (!Array.isArray(value)) {
|
|
340
|
+
addError(diagnostics, path, "must be an array");
|
|
341
|
+
return undefined;
|
|
342
|
+
}
|
|
343
|
+
const state = {
|
|
344
|
+
mappings: [],
|
|
345
|
+
agentRoots: new Set(),
|
|
346
|
+
serverRoots: new Set(),
|
|
347
|
+
};
|
|
348
|
+
for (const [index, entry] of value.entries()) {
|
|
349
|
+
parsePathMappingEntry(entry, index, path, diagnostics, state);
|
|
350
|
+
}
|
|
351
|
+
validatePathMappingReversibility(state.mappings, path, diagnostics);
|
|
352
|
+
return state.mappings;
|
|
353
|
+
}
|
|
354
|
+
function parseClientInfo(value, path, diagnostics) {
|
|
355
|
+
if (value === undefined)
|
|
356
|
+
return undefined;
|
|
357
|
+
const object = parseObject(value, path, diagnostics);
|
|
358
|
+
if (!object)
|
|
359
|
+
return undefined;
|
|
360
|
+
rejectUnknownKeys(object, new Set(["name", "version"]), path, diagnostics);
|
|
361
|
+
const name = parseRequiredString(object.name, `${path}.name`, diagnostics);
|
|
362
|
+
const version = parseOptionalString(object.version, `${path}.version`, diagnostics);
|
|
363
|
+
return name ? { name, ...(version === undefined ? {} : { version }) } : undefined;
|
|
364
|
+
}
|
|
365
|
+
function parseFeatures(value, path, diagnostics) {
|
|
366
|
+
if (value === undefined)
|
|
367
|
+
return undefined;
|
|
368
|
+
const object = parseObject(value, path, diagnostics);
|
|
369
|
+
if (!object)
|
|
370
|
+
return undefined;
|
|
371
|
+
rejectUnknownKeys(object, new Set(FEATURE_KEYS), path, diagnostics);
|
|
372
|
+
const features = {};
|
|
373
|
+
for (const key of FEATURE_KEYS) {
|
|
374
|
+
const setting = parseOptionalBoolean(object[key], `${path}.${key}`, diagnostics);
|
|
375
|
+
if (setting !== undefined)
|
|
376
|
+
features[key] = setting;
|
|
377
|
+
}
|
|
378
|
+
return features;
|
|
379
|
+
}
|
|
380
|
+
function parseTimeouts(value, path, diagnostics) {
|
|
381
|
+
if (value === undefined)
|
|
382
|
+
return undefined;
|
|
383
|
+
const object = parseObject(value, path, diagnostics);
|
|
384
|
+
if (!object)
|
|
385
|
+
return undefined;
|
|
386
|
+
rejectUnknownKeys(object, new Set(TIMEOUT_KEYS), path, diagnostics);
|
|
387
|
+
const timeouts = {};
|
|
388
|
+
for (const key of TIMEOUT_KEYS) {
|
|
389
|
+
const timeout = parseOptionalInteger(object[key], `${path}.${key}`, diagnostics);
|
|
390
|
+
if (timeout !== undefined) {
|
|
391
|
+
if (timeout < 0)
|
|
392
|
+
addError(diagnostics, `${path}.${key}`, "must be zero or a positive integer");
|
|
393
|
+
else
|
|
394
|
+
timeouts[key] = timeout;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
return timeouts;
|
|
398
|
+
}
|
|
399
|
+
function parseOptionalJson(value, path, diagnostics) {
|
|
400
|
+
if (value === undefined)
|
|
401
|
+
return undefined;
|
|
402
|
+
const result = parseJson(value, path, diagnostics, new Set());
|
|
403
|
+
return result.ok ? result.value : undefined;
|
|
404
|
+
}
|
|
405
|
+
function parseJsonArray(value, path, diagnostics, ancestors) {
|
|
406
|
+
ancestors.add(value);
|
|
407
|
+
const output = [];
|
|
408
|
+
let valid = true;
|
|
409
|
+
for (const [index, item] of value.entries()) {
|
|
410
|
+
const parsed = parseJson(item, `${path}[${index}]`, diagnostics, ancestors);
|
|
411
|
+
if (parsed.ok)
|
|
412
|
+
output.push(parsed.value);
|
|
413
|
+
else
|
|
414
|
+
valid = false;
|
|
415
|
+
}
|
|
416
|
+
ancestors.delete(value);
|
|
417
|
+
return valid ? { ok: true, value: output } : { ok: false };
|
|
418
|
+
}
|
|
419
|
+
function parseJsonObject(value, path, diagnostics, ancestors) {
|
|
420
|
+
ancestors.add(value);
|
|
421
|
+
const output = {};
|
|
422
|
+
let valid = true;
|
|
423
|
+
for (const [key, item] of Object.entries(value)) {
|
|
424
|
+
const parsed = parseJson(item, `${path}.${key}`, diagnostics, ancestors);
|
|
425
|
+
if (parsed.ok)
|
|
426
|
+
output[key] = parsed.value;
|
|
427
|
+
else
|
|
428
|
+
valid = false;
|
|
429
|
+
}
|
|
430
|
+
ancestors.delete(value);
|
|
431
|
+
return valid ? { ok: true, value: output } : { ok: false };
|
|
432
|
+
}
|
|
433
|
+
function parseJson(value, path, diagnostics, ancestors) {
|
|
434
|
+
if (value === null || typeof value === "string" || typeof value === "boolean")
|
|
435
|
+
return { ok: true, value };
|
|
436
|
+
if (typeof value === "number") {
|
|
437
|
+
if (Number.isFinite(value))
|
|
438
|
+
return { ok: true, value };
|
|
439
|
+
addError(diagnostics, path, "must contain only finite JSON numbers");
|
|
440
|
+
return { ok: false };
|
|
441
|
+
}
|
|
442
|
+
if (typeof value !== "object") {
|
|
443
|
+
addError(diagnostics, path, "must be valid JSON data");
|
|
444
|
+
return { ok: false };
|
|
445
|
+
}
|
|
446
|
+
if (ancestors.has(value)) {
|
|
447
|
+
addError(diagnostics, path, "must not contain circular references");
|
|
448
|
+
return { ok: false };
|
|
449
|
+
}
|
|
450
|
+
return Array.isArray(value)
|
|
451
|
+
? parseJsonArray(value, path, diagnostics, ancestors)
|
|
452
|
+
: parseJsonObject(value, path, diagnostics, ancestors);
|
|
453
|
+
}
|
|
454
|
+
function parseObject(value, path, diagnostics) {
|
|
455
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value))
|
|
456
|
+
return value;
|
|
457
|
+
addError(diagnostics, path, "must be an object");
|
|
458
|
+
return undefined;
|
|
459
|
+
}
|
|
460
|
+
function parseRequiredString(value, path, diagnostics) {
|
|
461
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
462
|
+
addError(diagnostics, path, "is required and must be a non-empty string");
|
|
463
|
+
return undefined;
|
|
464
|
+
}
|
|
465
|
+
return value;
|
|
466
|
+
}
|
|
467
|
+
function parseOptionalString(value, path, diagnostics) {
|
|
468
|
+
if (value === undefined)
|
|
469
|
+
return undefined;
|
|
470
|
+
return parseRequiredString(value, path, diagnostics);
|
|
471
|
+
}
|
|
472
|
+
function parseOptionalBoolean(value, path, diagnostics) {
|
|
473
|
+
if (value === undefined)
|
|
474
|
+
return undefined;
|
|
475
|
+
if (typeof value !== "boolean") {
|
|
476
|
+
addError(diagnostics, path, "must be a boolean");
|
|
477
|
+
return undefined;
|
|
478
|
+
}
|
|
479
|
+
return value;
|
|
480
|
+
}
|
|
481
|
+
function parseOptionalInteger(value, path, diagnostics) {
|
|
482
|
+
if (value === undefined)
|
|
483
|
+
return undefined;
|
|
484
|
+
if (!Number.isSafeInteger(value)) {
|
|
485
|
+
addError(diagnostics, path, "must be a safe integer");
|
|
486
|
+
return undefined;
|
|
487
|
+
}
|
|
488
|
+
return value;
|
|
489
|
+
}
|
|
490
|
+
function parseOptionalEnum(value, allowed, path, diagnostics) {
|
|
491
|
+
if (value === undefined)
|
|
492
|
+
return undefined;
|
|
493
|
+
if (typeof value === "string" && allowed.includes(value))
|
|
494
|
+
return value;
|
|
495
|
+
addError(diagnostics, path, `must be one of ${allowed.map((item) => JSON.stringify(item)).join(", ")}`);
|
|
496
|
+
return undefined;
|
|
497
|
+
}
|
|
498
|
+
function parseOptionalStringArray(value, path, diagnostics) {
|
|
499
|
+
if (value === undefined)
|
|
500
|
+
return undefined;
|
|
501
|
+
if (!Array.isArray(value)) {
|
|
502
|
+
addError(diagnostics, path, "must be an array of strings");
|
|
503
|
+
return undefined;
|
|
504
|
+
}
|
|
505
|
+
const output = [];
|
|
506
|
+
for (const [index, item] of value.entries()) {
|
|
507
|
+
if (typeof item !== "string")
|
|
508
|
+
addError(diagnostics, `${path}[${index}]`, "must be a string");
|
|
509
|
+
else
|
|
510
|
+
output.push(item);
|
|
511
|
+
}
|
|
512
|
+
return output;
|
|
513
|
+
}
|
|
514
|
+
function parseOptionalStringRecord(value, path, diagnostics) {
|
|
515
|
+
if (value === undefined)
|
|
516
|
+
return undefined;
|
|
517
|
+
const object = parseObject(value, path, diagnostics);
|
|
518
|
+
if (!object)
|
|
519
|
+
return undefined;
|
|
520
|
+
const output = {};
|
|
521
|
+
for (const [key, item] of Object.entries(object)) {
|
|
522
|
+
if (typeof item !== "string")
|
|
523
|
+
addError(diagnostics, `${path}.${key}`, "must be a string");
|
|
524
|
+
else
|
|
525
|
+
output[key] = item;
|
|
526
|
+
}
|
|
527
|
+
return output;
|
|
528
|
+
}
|
|
529
|
+
function parseRequiredUniqueRelativePaths(value, path, diagnostics) {
|
|
530
|
+
if (!Array.isArray(value) || value.length === 0) {
|
|
531
|
+
addError(diagnostics, path, "must be a non-empty array of relative paths");
|
|
532
|
+
return undefined;
|
|
533
|
+
}
|
|
534
|
+
const output = [];
|
|
535
|
+
const seen = new Set();
|
|
536
|
+
for (const [index, item] of value.entries()) {
|
|
537
|
+
const itemPath = `${path}[${index}]`;
|
|
538
|
+
const marker = parseRequiredString(item, itemPath, diagnostics);
|
|
539
|
+
if (!marker)
|
|
540
|
+
continue;
|
|
541
|
+
if (!isSafeRelativePath(marker))
|
|
542
|
+
addError(diagnostics, itemPath, "must be a relative path without '..' segments");
|
|
543
|
+
if (seen.has(marker))
|
|
544
|
+
addError(diagnostics, itemPath, "duplicates another marker");
|
|
545
|
+
else
|
|
546
|
+
seen.add(marker);
|
|
547
|
+
output.push(marker);
|
|
548
|
+
}
|
|
549
|
+
return output;
|
|
550
|
+
}
|
|
551
|
+
function rejectUnknownKeys(object, allowed, path, diagnostics) {
|
|
552
|
+
for (const key of Object.keys(object)) {
|
|
553
|
+
if (!allowed.has(key))
|
|
554
|
+
addError(diagnostics, `${path}.${key}`, "is not a recognized property");
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
function isSafeRelativePath(value) {
|
|
558
|
+
if (posix.isAbsolute(value) || win32.isAbsolute(value))
|
|
559
|
+
return false;
|
|
560
|
+
return !value.split(/[\\/]/).includes("..");
|
|
561
|
+
}
|
|
562
|
+
function agentRootRelation(left, right) {
|
|
563
|
+
const leftFlavor = pathFlavor(left);
|
|
564
|
+
const rightFlavor = pathFlavor(right);
|
|
565
|
+
if (leftFlavor !== rightFlavor)
|
|
566
|
+
return undefined;
|
|
567
|
+
const normalizedLeft = normalizePortablePath(left, leftFlavor);
|
|
568
|
+
const normalizedRight = normalizePortablePath(right, rightFlavor);
|
|
569
|
+
const comparableLeft = leftFlavor === "windows" ? normalizedLeft.toLowerCase() : normalizedLeft;
|
|
570
|
+
const comparableRight = rightFlavor === "windows" ? normalizedRight.toLowerCase() : normalizedRight;
|
|
571
|
+
if (comparableLeft === comparableRight) {
|
|
572
|
+
return { direction: "equal", relative: "", caseInsensitive: leftFlavor === "windows" };
|
|
573
|
+
}
|
|
574
|
+
const fromLeft = relativeWithin(normalizedLeft, normalizedRight);
|
|
575
|
+
if (fromLeft !== undefined) {
|
|
576
|
+
return {
|
|
577
|
+
direction: "left-parent",
|
|
578
|
+
relative: fromLeft.replace(/\\/g, "/"),
|
|
579
|
+
caseInsensitive: leftFlavor === "windows",
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
const fromRight = relativeWithin(normalizedRight, normalizedLeft);
|
|
583
|
+
return fromRight === undefined
|
|
584
|
+
? undefined
|
|
585
|
+
: {
|
|
586
|
+
direction: "right-parent",
|
|
587
|
+
relative: fromRight.replace(/\\/g, "/"),
|
|
588
|
+
caseInsensitive: leftFlavor === "windows",
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
function serverRootRelation(leftValue, rightValue) {
|
|
592
|
+
if (!canonicalFileUri(leftValue) || !canonicalFileUri(rightValue))
|
|
593
|
+
return undefined;
|
|
594
|
+
const left = new URL(leftValue);
|
|
595
|
+
const right = new URL(rightValue);
|
|
596
|
+
if (left.hostname.toLowerCase() !== right.hostname.toLowerCase())
|
|
597
|
+
return undefined;
|
|
598
|
+
const leftSegments = left.pathname
|
|
599
|
+
.split("/")
|
|
600
|
+
.filter(Boolean)
|
|
601
|
+
.map((segment) => decodeURIComponent(segment));
|
|
602
|
+
const rightSegments = right.pathname
|
|
603
|
+
.split("/")
|
|
604
|
+
.filter(Boolean)
|
|
605
|
+
.map((segment) => decodeURIComponent(segment));
|
|
606
|
+
const caseInsensitive = left.hostname.length > 0 ||
|
|
607
|
+
right.hostname.length > 0 ||
|
|
608
|
+
leftSegments[0]?.endsWith(":") === true ||
|
|
609
|
+
rightSegments[0]?.endsWith(":") === true;
|
|
610
|
+
const comparable = (segment) => (caseInsensitive ? segment.toLowerCase() : segment);
|
|
611
|
+
let shared = 0;
|
|
612
|
+
while (shared < leftSegments.length &&
|
|
613
|
+
shared < rightSegments.length &&
|
|
614
|
+
comparable(leftSegments[shared]) === comparable(rightSegments[shared])) {
|
|
615
|
+
shared++;
|
|
616
|
+
}
|
|
617
|
+
if (shared < Math.min(leftSegments.length, rightSegments.length))
|
|
618
|
+
return undefined;
|
|
619
|
+
if (leftSegments.length === rightSegments.length)
|
|
620
|
+
return { direction: "equal", relative: "", caseInsensitive };
|
|
621
|
+
return leftSegments.length < rightSegments.length
|
|
622
|
+
? { direction: "left-parent", relative: rightSegments.slice(shared).join("/"), caseInsensitive }
|
|
623
|
+
: { direction: "right-parent", relative: leftSegments.slice(shared).join("/"), caseInsensitive };
|
|
624
|
+
}
|
|
625
|
+
function pathMappingsAreReversible(left, right) {
|
|
626
|
+
const agent = agentRootRelation(left.agentRoot, right.agentRoot);
|
|
627
|
+
const server = serverRootRelation(left.serverRootUri, right.serverRootUri);
|
|
628
|
+
if (!agent || !server)
|
|
629
|
+
return agent === undefined && server === undefined;
|
|
630
|
+
if (agent.direction !== server.direction)
|
|
631
|
+
return false;
|
|
632
|
+
return agent.caseInsensitive && server.caseInsensitive
|
|
633
|
+
? agent.relative.toLowerCase() === server.relative.toLowerCase()
|
|
634
|
+
: agent.relative === server.relative;
|
|
635
|
+
}
|
|
636
|
+
function normalizeAgentRoot(value) {
|
|
637
|
+
const flavor = pathFlavor(value);
|
|
638
|
+
const api = pathApi(flavor);
|
|
639
|
+
const normalized = normalizePortablePath(value, flavor);
|
|
640
|
+
const root = api.parse(normalized).root;
|
|
641
|
+
const trailingSeparator = flavor === "windows" ? /[\\/]+$/ : /\/+$/;
|
|
642
|
+
const withoutTrailingSeparators = normalized === root ? normalized : normalized.replace(trailingSeparator, "");
|
|
643
|
+
return flavor === "windows" ? withoutTrailingSeparators.toLowerCase() : withoutTrailingSeparators;
|
|
644
|
+
}
|
|
645
|
+
function isAbsoluteNamedPipe(value) {
|
|
646
|
+
const lower = value.toLowerCase();
|
|
647
|
+
const prefixes = ["\\\\.\\pipe\\", "\\\\?\\pipe\\"];
|
|
648
|
+
return prefixes.some((prefix) => lower.startsWith(prefix) && value.length > prefix.length);
|
|
649
|
+
}
|
|
650
|
+
function canonicalFileUri(value) {
|
|
651
|
+
if (!/^file:\//i.test(value))
|
|
652
|
+
return undefined;
|
|
653
|
+
try {
|
|
654
|
+
const url = new URL(value);
|
|
655
|
+
if (url.protocol !== "file:" || url.pathname.length === 0 || url.search !== "" || url.hash !== "")
|
|
656
|
+
return undefined;
|
|
657
|
+
const segments = url.pathname
|
|
658
|
+
.split("/")
|
|
659
|
+
.filter(Boolean)
|
|
660
|
+
.map((segment) => decodeURIComponent(segment));
|
|
661
|
+
if (segments.some((segment) => segment.includes("/") || segment === "." || segment === ".."))
|
|
662
|
+
return undefined;
|
|
663
|
+
if (url.hostname && segments.length === 0)
|
|
664
|
+
return undefined;
|
|
665
|
+
if (segments[0]?.endsWith(":") && segments.length === 1 && !url.pathname.endsWith("/"))
|
|
666
|
+
return undefined;
|
|
667
|
+
const driveRoot = segments[0]?.endsWith(":") && segments.length === 1;
|
|
668
|
+
url.pathname = `/${segments.map((segment) => encodeURIComponent(segment)).join("/")}${driveRoot ? "/" : ""}`;
|
|
669
|
+
url.hostname = url.hostname.toLowerCase();
|
|
670
|
+
return url.toString();
|
|
671
|
+
}
|
|
672
|
+
catch {
|
|
673
|
+
return undefined;
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
function isAbsoluteFileUri(value) {
|
|
677
|
+
return canonicalFileUri(value) !== undefined;
|
|
678
|
+
}
|
|
679
|
+
function addError(diagnostics, path, message) {
|
|
680
|
+
diagnostics.push({ severity: "error", path, message });
|
|
681
|
+
}
|
|
682
|
+
//# sourceMappingURL=config.js.map
|