@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 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/core/lsp/config.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,EAAE,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAA;CAAE,CAAC;AAE/G,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,SAAS,CAAC;AAEvD,MAAM,WAAW,mBAAmB;IACnC,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAC;IACnB,gEAAgE;IAChE,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,sBAAsB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,qBAAqB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,wBAAwB;IACxC,IAAI,EAAE,YAAY,CAAC;IACnB,mFAAmF;IACnF,EAAE,EAAE,MAAM,CAAC;CACX;AAED,MAAM,MAAM,YAAY,GACrB,iBAAiB,GACjB,eAAe,GACf,sBAAsB,GACtB,qBAAqB,GACrB,wBAAwB,CAAC;AAE5B,MAAM,MAAM,gBAAgB,GACzB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC/B;IACA,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEL,MAAM,WAAW,cAAc;IAC9B,mGAAmG;IACnG,SAAS,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,aAAa,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,kBAAkB,GAAG;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;CAAE,CAAC;AAElH,MAAM,WAAW,iBAAiB;IACjC,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS,CAAC;AAE3D,MAAM,WAAW,iBAAiB;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,SAAS,EAAE,mBAAmB,EAAE,CAAC;IACjC,SAAS,EAAE,YAAY,CAAC;IACxB,SAAS,EAAE,kBAAkB,CAAC;IAC9B,SAAS,EAAE,gBAAgB,CAAC;IAC5B,YAAY,CAAC,EAAE,cAAc,EAAE,CAAC;IAChC,qBAAqB,CAAC,EAAE,YAAY,CAAC;IACrC,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC7B;AAED,MAAM,WAAW,iBAAiB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,KAAK,CAAC;CACf;AAED,MAAM,MAAM,cAAc,GAAG,mBAAmB,GAAG,iBAAiB,CAAC;AAErE;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAqB;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAC5B,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,wBAAwB;IACxC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,mBAAmB,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,2BAA2B;IAC3C,aAAa,CAAC,EAAE,qBAAqB,CAAC;IACtC,WAAW,EAAE,0BAA0B,EAAE,CAAC;CAC1C;AAsBD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,2BAA2B,CAmBjF;AAUD,0EAA0E;AAC1E,wBAAgB,uBAAuB,CACtC,MAAM,EAAE,SAAS,CAAC,qBAAqB,GAAG,SAAS,CAAC,EAAE,GACpD,wBAAwB,CAc1B","sourcesContent":["import { posix, win32 } from \"node:path\";\nimport { normalizePortablePath, pathApi, pathFlavor, relativeWithin } from \"./portable-path.ts\";\n\nexport type LspJsonValue = null | boolean | number | string | LspJsonValue[] | { [key: string]: LspJsonValue };\n\nexport type LspConfigurationMode = \"merge\" | \"replace\";\n\nexport interface LspDocumentSelector {\n\t/** Language ID sent to the server in textDocument/didOpen. */\n\tlanguageId: string;\n\t/** Workspace-relative glob pattern used to select documents. */\n\tpattern: string;\n\t/** URI scheme to match. Defaults to file. */\n\tscheme?: string;\n}\n\nexport interface LspSpawnTransport {\n\ttype: \"spawn\";\n\tcommand: string;\n\targs?: string[];\n\tenv?: Record<string, string>;\n\tcwd?: string;\n}\n\nexport interface LspTcpTransport {\n\ttype: \"tcp\";\n\thost: string;\n\tport: number;\n}\n\nexport interface LspUnixSocketTransport {\n\ttype: \"unix\";\n\tpath: string;\n}\n\nexport interface LspNamedPipeTransport {\n\ttype: \"pipe\";\n\tpath: string;\n}\n\nexport interface LspProgrammaticTransport {\n\ttype: \"connection\";\n\t/** Host-registered connection factory ID. Functions are never loaded from JSON. */\n\tid: string;\n}\n\nexport type LspTransport =\n\t| LspSpawnTransport\n\t| LspTcpTransport\n\t| LspUnixSocketTransport\n\t| LspNamedPipeTransport\n\t| LspProgrammaticTransport;\n\nexport type LspWorkspaceRoot =\n\t| { type: \"session\" }\n\t| { type: \"fixed\"; path: string }\n\t| {\n\t\t\ttype: \"markers\";\n\t\t\tmarkers: string[];\n\t\t\tfallback?: \"session\" | \"none\";\n\t\t\tstopAt?: string;\n\t };\n\nexport interface LspPathMapping {\n\t/** Agent-visible filesystem root. Relative roots are resolved against the configuration source. */\n\tagentRoot: string;\n\t/** Absolute file URI for the same root as observed by the language server. */\n\tserverRootUri: string;\n}\n\nexport type LspServerLifecycle = { type: \"managed\" } | { type: \"attached\"; shutdown?: \"disconnect\" | \"protocol\" };\n\nexport interface LspServerTimeouts {\n\t/** Zero disables the corresponding timeout. */\n\tconnectMs?: number;\n\tinitializeMs?: number;\n\trequestMs?: number;\n\tshutdownMs?: number;\n}\n\nexport interface LspClientInfo {\n\tname: string;\n\tversion?: string;\n}\n\nexport type LspTraceValue = \"off\" | \"messages\" | \"verbose\";\n\nexport interface LspServerFeatures {\n\tdiagnostics?: boolean;\n\thover?: boolean;\n\tdefinition?: boolean;\n\treferences?: boolean;\n\trename?: boolean;\n\tcodeActions?: boolean;\n}\n\nexport interface LspConfiguredServer {\n\tid: string;\n\tenabled?: true;\n\tselectors: LspDocumentSelector[];\n\ttransport: LspTransport;\n\tlifecycle: LspServerLifecycle;\n\tworkspace: LspWorkspaceRoot;\n\tpathMappings?: LspPathMapping[];\n\tinitializationOptions?: LspJsonValue;\n\tsettings?: LspJsonValue;\n\tclientInfo?: LspClientInfo;\n\tlocale?: string;\n\ttrace?: LspTraceValue;\n\tfeatures?: LspServerFeatures;\n\tpriority?: number;\n\ttimeouts?: LspServerTimeouts;\n}\n\nexport interface LspDisabledServer {\n\tid: string;\n\tenabled: false;\n}\n\nexport type LspServerEntry = LspConfiguredServer | LspDisabledServer;\n\n/**\n * One externally supplied configuration layer.\n *\n * - An absent layer leaves lower-precedence configuration unchanged.\n * - `merge` (the default) replaces complete server definitions by ID.\n * - `replace` clears lower-precedence servers before applying this layer.\n * - `{ id, enabled: false }` removes a server inherited from a lower layer.\n * - `enabled: false` disables the resolved runtime without discarding server definitions.\n */\nexport interface LspConfigurationLayer {\n\tenabled?: boolean;\n\tmode?: LspConfigurationMode;\n\tservers?: LspServerEntry[];\n}\n\nexport interface ResolvedLspConfiguration {\n\tenabled: boolean;\n\tservers: LspConfiguredServer[];\n}\n\nexport interface LspConfigurationDiagnostic {\n\tseverity: \"error\";\n\tpath: string;\n\tmessage: string;\n}\n\nexport interface ParseLspConfigurationResult {\n\tconfiguration?: LspConfigurationLayer;\n\tdiagnostics: LspConfigurationDiagnostic[];\n}\n\nconst SERVER_KEYS = new Set([\n\t\"id\",\n\t\"enabled\",\n\t\"selectors\",\n\t\"transport\",\n\t\"lifecycle\",\n\t\"workspace\",\n\t\"pathMappings\",\n\t\"initializationOptions\",\n\t\"settings\",\n\t\"clientInfo\",\n\t\"locale\",\n\t\"trace\",\n\t\"features\",\n\t\"priority\",\n\t\"timeouts\",\n]);\nconst FEATURE_KEYS = [\"diagnostics\", \"hover\", \"definition\", \"references\", \"rename\", \"codeActions\"] as const;\nconst TIMEOUT_KEYS = [\"connectMs\", \"initializeMs\", \"requestMs\", \"shutdownMs\"] as const;\n\nexport function parseLspConfiguration(value: unknown): ParseLspConfigurationResult {\n\tconst diagnostics: LspConfigurationDiagnostic[] = [];\n\tconst object = parseObject(value, \"$\", diagnostics);\n\tif (!object) return { diagnostics };\n\trejectUnknownKeys(object, new Set([\"enabled\", \"mode\", \"servers\"]), \"$\", diagnostics);\n\n\tconst enabled = parseOptionalBoolean(object.enabled, \"$.enabled\", diagnostics);\n\tconst mode = parseOptionalEnum(object.mode, [\"merge\", \"replace\"], \"$.mode\", diagnostics);\n\tconst servers = parseServers(object.servers, diagnostics);\n\tif (diagnostics.length > 0) return { diagnostics };\n\n\treturn {\n\t\tconfiguration: {\n\t\t\t...(enabled === undefined ? {} : { enabled }),\n\t\t\t...(mode === undefined ? {} : { mode }),\n\t\t\t...(servers === undefined ? {} : { servers }),\n\t\t},\n\t\tdiagnostics,\n\t};\n}\n\nfunction applyLspServerLayer(servers: Map<string, LspConfiguredServer>, layer: LspConfigurationLayer): void {\n\tif (layer.mode === \"replace\") servers.clear();\n\tfor (const server of layer.servers ?? []) {\n\t\tif (server.enabled === false) servers.delete(server.id);\n\t\telse servers.set(server.id, server);\n\t}\n}\n\n/** Resolve already validated layers from lowest to highest precedence. */\nexport function resolveLspConfiguration(\n\tlayers: readonly (LspConfigurationLayer | undefined)[],\n): ResolvedLspConfiguration {\n\tconst servers = new Map<string, LspConfiguredServer>();\n\tlet enabled = false;\n\tlet hasLayer = false;\n\n\tfor (const layer of layers) {\n\t\tif (!layer) continue;\n\t\tif (!hasLayer) enabled = layer.enabled ?? true;\n\t\thasLayer = true;\n\t\tif (layer.enabled !== undefined) enabled = layer.enabled;\n\t\tapplyLspServerLayer(servers, layer);\n\t}\n\n\treturn { enabled: hasLayer && enabled, servers: [...servers.values()] };\n}\n\nfunction parseServers(value: unknown, diagnostics: LspConfigurationDiagnostic[]): LspServerEntry[] | undefined {\n\tif (value === undefined) return undefined;\n\tif (!Array.isArray(value)) {\n\t\taddError(diagnostics, \"$.servers\", \"must be an array\");\n\t\treturn undefined;\n\t}\n\tconst servers: LspServerEntry[] = [];\n\tconst ids = new Set<string>();\n\tfor (const [index, entry] of value.entries()) {\n\t\tconst path = `$.servers[${index}]`;\n\t\tconst server = parseServer(entry, path, diagnostics);\n\t\tif (!server) continue;\n\t\tif (ids.has(server.id)) addError(diagnostics, `${path}.id`, `duplicates server ID ${JSON.stringify(server.id)}`);\n\t\telse ids.add(server.id);\n\t\tservers.push(server);\n\t}\n\treturn servers;\n}\nfunction validateTransportLifecycle(\n\ttransport: LspTransport | undefined,\n\tlifecycle: LspServerLifecycle | undefined,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): void {\n\tif (!transport || transport.type === \"connection\") return;\n\tconst expectedLifecycle = transport.type === \"spawn\" ? \"managed\" : \"attached\";\n\tif (lifecycle?.type === expectedLifecycle) return;\n\taddError(\n\t\tdiagnostics,\n\t\t`${path}.lifecycle.type`,\n\t\t`must be '${expectedLifecycle}' when transport.type is '${transport.type}'`,\n\t);\n}\nfunction parseServerId(value: unknown, path: string, diagnostics: LspConfigurationDiagnostic[]): string | undefined {\n\tconst id = parseRequiredString(value, `${path}.id`, diagnostics);\n\tif (!id || /^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(id)) return id;\n\taddError(\n\t\tdiagnostics,\n\t\t`${path}.id`,\n\t\t\"must start with an alphanumeric character and contain only letters, numbers, '.', '_' or '-'\",\n\t);\n\treturn id;\n}\nfunction createDisabledServerEntry(\n\tobject: Record<string, unknown>,\n\tid: string | undefined,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): LspDisabledServer | undefined {\n\trejectUnknownKeys(object, new Set([\"id\", \"enabled\"]), path, diagnostics);\n\tif (!id) return undefined;\n\treturn { id, enabled: false };\n}\n\nfunction parseServer(\n\tvalue: unknown,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): LspServerEntry | undefined {\n\tconst object = parseObject(value, path, diagnostics);\n\tif (!object) return undefined;\n\tconst id = parseServerId(object.id, path, diagnostics);\n\tconst enabled = parseOptionalBoolean(object.enabled, `${path}.enabled`, diagnostics);\n\tif (enabled === false) return createDisabledServerEntry(object, id, path, diagnostics);\n\trejectUnknownKeys(object, SERVER_KEYS, path, diagnostics);\n\n\tconst selectors = parseSelectors(object.selectors, `${path}.selectors`, diagnostics);\n\tconst transport = parseTransport(object.transport, `${path}.transport`, diagnostics);\n\tconst lifecycle = parseLifecycle(object.lifecycle, `${path}.lifecycle`, diagnostics);\n\tconst workspace = parseWorkspace(object.workspace, `${path}.workspace`, diagnostics);\n\tconst pathMappings = parsePathMappings(object.pathMappings, `${path}.pathMappings`, diagnostics);\n\tconst initializationOptions = parseOptionalJson(\n\t\tobject.initializationOptions,\n\t\t`${path}.initializationOptions`,\n\t\tdiagnostics,\n\t);\n\tconst settings = parseOptionalJson(object.settings, `${path}.settings`, diagnostics);\n\tconst clientInfo = parseClientInfo(object.clientInfo, `${path}.clientInfo`, diagnostics);\n\tconst locale = parseOptionalString(object.locale, `${path}.locale`, diagnostics);\n\tconst trace = parseOptionalEnum(object.trace, [\"off\", \"messages\", \"verbose\"], `${path}.trace`, diagnostics);\n\tconst features = parseFeatures(object.features, `${path}.features`, diagnostics);\n\tconst priority = parseOptionalInteger(object.priority, `${path}.priority`, diagnostics);\n\tconst timeouts = parseTimeouts(object.timeouts, `${path}.timeouts`, diagnostics);\n\n\tvalidateTransportLifecycle(transport, lifecycle, path, diagnostics);\n\tif (!id || !selectors || !transport || !lifecycle || !workspace) return undefined;\n\n\treturn {\n\t\tid,\n\t\t...(enabled === true ? { enabled: true as const } : {}),\n\t\tselectors,\n\t\ttransport,\n\t\tlifecycle,\n\t\tworkspace,\n\t\t...(pathMappings === undefined ? {} : { pathMappings }),\n\t\t...(initializationOptions === undefined ? {} : { initializationOptions }),\n\t\t...(settings === undefined ? {} : { settings }),\n\t\t...(clientInfo === undefined ? {} : { clientInfo }),\n\t\t...(locale === undefined ? {} : { locale }),\n\t\t...(trace === undefined ? {} : { trace }),\n\t\t...(features === undefined ? {} : { features }),\n\t\t...(priority === undefined ? {} : { priority }),\n\t\t...(timeouts === undefined ? {} : { timeouts }),\n\t};\n}\n\nfunction registerSelectorSignature(\n\tsignatures: Set<string>,\n\tsignature: string,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): void {\n\tif (signatures.has(signature)) {\n\t\taddError(diagnostics, path, \"is ambiguous because another selector has the same scheme and pattern\");\n\t}\n\tsignatures.add(signature);\n}\n\nfunction parseSelectors(\n\tvalue: unknown,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): LspDocumentSelector[] | undefined {\n\tif (!Array.isArray(value) || value.length === 0) {\n\t\taddError(diagnostics, path, \"must be a non-empty array\");\n\t\treturn undefined;\n\t}\n\tconst selectors: LspDocumentSelector[] = [];\n\tconst signatures = new Set<string>();\n\tfor (const [index, entry] of value.entries()) {\n\t\tconst itemPath = `${path}[${index}]`;\n\t\tconst object = parseObject(entry, itemPath, diagnostics);\n\t\tif (!object) continue;\n\t\trejectUnknownKeys(object, new Set([\"languageId\", \"pattern\", \"scheme\"]), itemPath, diagnostics);\n\t\tconst languageId = parseRequiredString(object.languageId, `${itemPath}.languageId`, diagnostics);\n\t\tconst pattern = parseRequiredString(object.pattern, `${itemPath}.pattern`, diagnostics);\n\t\tconst scheme = parseOptionalString(object.scheme, `${itemPath}.scheme`, diagnostics);\n\t\tif (pattern && !isSafeRelativePath(pattern)) {\n\t\t\taddError(diagnostics, `${itemPath}.pattern`, \"must be a workspace-relative pattern without '..' segments\");\n\t\t}\n\t\tif (!languageId || !pattern) continue;\n\t\tconst signature = `${scheme ?? \"file\"}\\u0000${pattern}`;\n\t\tregisterSelectorSignature(signatures, signature, itemPath, diagnostics);\n\t\tselectors.push({ languageId, pattern, ...(scheme === undefined ? {} : { scheme }) });\n\t}\n\treturn selectors;\n}\n\nfunction parseTransport(\n\tvalue: unknown,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): LspTransport | undefined {\n\tconst object = parseObject(value, path, diagnostics);\n\tif (!object) return undefined;\n\tconst type = parseRequiredString(object.type, `${path}.type`, diagnostics);\n\tswitch (type) {\n\t\tcase \"spawn\":\n\t\t\treturn parseSpawnTransport(object, path, diagnostics);\n\t\tcase \"tcp\":\n\t\t\treturn parseTcpTransport(object, path, diagnostics);\n\t\tcase \"unix\":\n\t\t\treturn parseUnixSocketTransport(object, path, diagnostics);\n\t\tcase \"pipe\":\n\t\t\treturn parseNamedPipeTransport(object, path, diagnostics);\n\t\tcase \"connection\":\n\t\t\treturn parseProgrammaticTransport(object, path, diagnostics);\n\t\tdefault:\n\t\t\tif (type)\n\t\t\t\taddError(diagnostics, `${path}.type`, \"must be one of 'spawn', 'tcp', 'unix', 'pipe', or 'connection'\");\n\t\t\treturn undefined;\n\t}\n}\n\nfunction parseSpawnTransport(\n\tobject: Record<string, unknown>,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): LspSpawnTransport | undefined {\n\trejectUnknownKeys(object, new Set([\"type\", \"command\", \"args\", \"env\", \"cwd\"]), path, diagnostics);\n\tconst command = parseRequiredString(object.command, `${path}.command`, diagnostics);\n\tconst args = parseOptionalStringArray(object.args, `${path}.args`, diagnostics);\n\tconst env = parseOptionalStringRecord(object.env, `${path}.env`, diagnostics);\n\tconst cwd = parseOptionalString(object.cwd, `${path}.cwd`, diagnostics);\n\treturn command\n\t\t? { type: \"spawn\", command, ...(args ? { args } : {}), ...(env ? { env } : {}), ...(cwd ? { cwd } : {}) }\n\t\t: undefined;\n}\n\nfunction parseTcpTransport(\n\tobject: Record<string, unknown>,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): LspTcpTransport | undefined {\n\trejectUnknownKeys(object, new Set([\"type\", \"host\", \"port\"]), path, diagnostics);\n\tconst host = parseRequiredString(object.host, `${path}.host`, diagnostics);\n\tconst port = parseOptionalInteger(object.port, `${path}.port`, diagnostics);\n\tif (port === undefined) addError(diagnostics, `${path}.port`, \"is required and must be an integer\");\n\telse if (port < 1 || port > 65535) addError(diagnostics, `${path}.port`, \"must be between 1 and 65535\");\n\treturn host && port !== undefined ? { type: \"tcp\", host, port } : undefined;\n}\n\nfunction parseUnixSocketTransport(\n\tobject: Record<string, unknown>,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): LspUnixSocketTransport | undefined {\n\trejectUnknownKeys(object, new Set([\"type\", \"path\"]), path, diagnostics);\n\tconst endpointPath = parseRequiredString(object.path, `${path}.path`, diagnostics);\n\tif (endpointPath && !posix.isAbsolute(endpointPath) && !isSafeRelativePath(endpointPath)) {\n\t\taddError(diagnostics, `${path}.path`, \"must be absolute or a safe source-relative Unix socket path\");\n\t}\n\treturn endpointPath ? { type: \"unix\", path: endpointPath } : undefined;\n}\n\nfunction parseNamedPipeTransport(\n\tobject: Record<string, unknown>,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): LspNamedPipeTransport | undefined {\n\trejectUnknownKeys(object, new Set([\"type\", \"path\"]), path, diagnostics);\n\tconst endpointPath = parseRequiredString(object.path, `${path}.path`, diagnostics);\n\tif (endpointPath && !isAbsoluteNamedPipe(endpointPath)) {\n\t\taddError(diagnostics, `${path}.path`, \"must be an absolute Windows named-pipe path such as \\\\\\\\.\\\\pipe\\\\server\");\n\t}\n\treturn endpointPath ? { type: \"pipe\", path: endpointPath } : undefined;\n}\n\nfunction parseProgrammaticTransport(\n\tobject: Record<string, unknown>,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): LspProgrammaticTransport | undefined {\n\trejectUnknownKeys(object, new Set([\"type\", \"id\"]), path, diagnostics);\n\tconst id = parseRequiredString(object.id, `${path}.id`, diagnostics);\n\treturn id ? { type: \"connection\", id } : undefined;\n}\nfunction parseLifecycle(\n\tvalue: unknown,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): LspServerLifecycle | undefined {\n\tconst object = parseObject(value, path, diagnostics);\n\tif (!object) return undefined;\n\tconst type = parseRequiredString(object.type, `${path}.type`, diagnostics);\n\tif (type === \"managed\") {\n\t\trejectUnknownKeys(object, new Set([\"type\"]), path, diagnostics);\n\t\treturn { type };\n\t}\n\tif (type === \"attached\") {\n\t\trejectUnknownKeys(object, new Set([\"type\", \"shutdown\"]), path, diagnostics);\n\t\tconst shutdown = parseOptionalEnum(object.shutdown, [\"disconnect\", \"protocol\"], `${path}.shutdown`, diagnostics);\n\t\treturn { type, ...(shutdown === undefined ? {} : { shutdown }) };\n\t}\n\tif (type) addError(diagnostics, `${path}.type`, \"must be 'managed' or 'attached'\");\n\treturn undefined;\n}\n\nfunction parseWorkspace(\n\tvalue: unknown,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): LspWorkspaceRoot | undefined {\n\tconst object = parseObject(value, path, diagnostics);\n\tif (!object) return undefined;\n\tconst type = parseRequiredString(object.type, `${path}.type`, diagnostics);\n\tif (type === \"session\") {\n\t\trejectUnknownKeys(object, new Set([\"type\"]), path, diagnostics);\n\t\treturn { type };\n\t}\n\tif (type === \"fixed\") {\n\t\trejectUnknownKeys(object, new Set([\"type\", \"path\"]), path, diagnostics);\n\t\tconst fixedPath = parseRequiredString(object.path, `${path}.path`, diagnostics);\n\t\treturn fixedPath ? { type, path: fixedPath } : undefined;\n\t}\n\tif (type === \"markers\") {\n\t\trejectUnknownKeys(object, new Set([\"type\", \"markers\", \"fallback\", \"stopAt\"]), path, diagnostics);\n\t\tconst markers = parseRequiredUniqueRelativePaths(object.markers, `${path}.markers`, diagnostics);\n\t\tconst fallback = parseOptionalEnum(object.fallback, [\"session\", \"none\"], `${path}.fallback`, diagnostics);\n\t\tconst stopAt = parseOptionalString(object.stopAt, `${path}.stopAt`, diagnostics);\n\t\treturn markers\n\t\t\t? {\n\t\t\t\t\ttype,\n\t\t\t\t\tmarkers,\n\t\t\t\t\t...(fallback === undefined ? {} : { fallback }),\n\t\t\t\t\t...(stopAt === undefined ? {} : { stopAt }),\n\t\t\t\t}\n\t\t\t: undefined;\n\t}\n\tif (type) addError(diagnostics, `${path}.type`, \"must be 'session', 'fixed', or 'markers'\");\n\treturn undefined;\n}\n\ninterface PathMappingParseState {\n\tmappings: LspPathMapping[];\n\tagentRoots: Set<string>;\n\tserverRoots: Set<string>;\n}\n\nfunction parsePathMappingEntry(\n\tentry: unknown,\n\tindex: number,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n\tstate: PathMappingParseState,\n): void {\n\tconst itemPath = `${path}[${index}]`;\n\tconst object = parseObject(entry, itemPath, diagnostics);\n\tif (!object) return;\n\trejectUnknownKeys(object, new Set([\"agentRoot\", \"serverRootUri\"]), itemPath, diagnostics);\n\tconst agentRoot = parseRequiredString(object.agentRoot, `${itemPath}.agentRoot`, diagnostics);\n\tconst serverRootUri = parseRequiredString(object.serverRootUri, `${itemPath}.serverRootUri`, diagnostics);\n\tif (serverRootUri && !isAbsoluteFileUri(serverRootUri)) {\n\t\taddError(\n\t\t\tdiagnostics,\n\t\t\t`${itemPath}.serverRootUri`,\n\t\t\t\"must be an absolute file URI without query or fragment components\",\n\t\t);\n\t}\n\tif (!agentRoot || !serverRootUri) return;\n\n\tconst normalizedAgentRoot = normalizeAgentRoot(agentRoot);\n\tconst normalizedServerRoot = canonicalFileUri(serverRootUri);\n\tif (state.agentRoots.has(normalizedAgentRoot))\n\t\taddError(diagnostics, `${itemPath}.agentRoot`, \"duplicates another mapping root\");\n\tif (normalizedServerRoot && state.serverRoots.has(normalizedServerRoot)) {\n\t\taddError(diagnostics, `${itemPath}.serverRootUri`, \"duplicates another mapping root\");\n\t}\n\tstate.agentRoots.add(normalizedAgentRoot);\n\tif (normalizedServerRoot) state.serverRoots.add(normalizedServerRoot);\n\tstate.mappings.push({ agentRoot, serverRootUri });\n}\n\nfunction validatePathMappingReversibility(\n\tmappings: LspPathMapping[],\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): void {\n\tfor (let index = 0; index < mappings.length; index++) {\n\t\tfor (let previous = 0; previous < index; previous++) {\n\t\t\tif (pathMappingsAreReversible(mappings[previous], mappings[index])) continue;\n\t\t\taddError(\n\t\t\t\tdiagnostics,\n\t\t\t\t`${path}[${index}].agentRoot`,\n\t\t\t\t`overlaps mapping ${previous} without an equivalent server URI relationship`,\n\t\t\t);\n\t\t\taddError(\n\t\t\t\tdiagnostics,\n\t\t\t\t`${path}[${index}].serverRootUri`,\n\t\t\t\t`overlaps mapping ${previous} without an equivalent agent path relationship`,\n\t\t\t);\n\t\t}\n\t}\n}\n\nfunction parsePathMappings(\n\tvalue: unknown,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): LspPathMapping[] | undefined {\n\tif (value === undefined) return undefined;\n\tif (!Array.isArray(value)) {\n\t\taddError(diagnostics, path, \"must be an array\");\n\t\treturn undefined;\n\t}\n\tconst state: PathMappingParseState = {\n\t\tmappings: [],\n\t\tagentRoots: new Set<string>(),\n\t\tserverRoots: new Set<string>(),\n\t};\n\tfor (const [index, entry] of value.entries()) {\n\t\tparsePathMappingEntry(entry, index, path, diagnostics, state);\n\t}\n\tvalidatePathMappingReversibility(state.mappings, path, diagnostics);\n\treturn state.mappings;\n}\n\nfunction parseClientInfo(\n\tvalue: unknown,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): LspClientInfo | undefined {\n\tif (value === undefined) return undefined;\n\tconst object = parseObject(value, path, diagnostics);\n\tif (!object) return undefined;\n\trejectUnknownKeys(object, new Set([\"name\", \"version\"]), path, diagnostics);\n\tconst name = parseRequiredString(object.name, `${path}.name`, diagnostics);\n\tconst version = parseOptionalString(object.version, `${path}.version`, diagnostics);\n\treturn name ? { name, ...(version === undefined ? {} : { version }) } : undefined;\n}\n\nfunction parseFeatures(\n\tvalue: unknown,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): LspServerFeatures | undefined {\n\tif (value === undefined) return undefined;\n\tconst object = parseObject(value, path, diagnostics);\n\tif (!object) return undefined;\n\trejectUnknownKeys(object, new Set(FEATURE_KEYS), path, diagnostics);\n\tconst features: LspServerFeatures = {};\n\tfor (const key of FEATURE_KEYS) {\n\t\tconst setting = parseOptionalBoolean(object[key], `${path}.${key}`, diagnostics);\n\t\tif (setting !== undefined) features[key] = setting;\n\t}\n\treturn features;\n}\n\nfunction parseTimeouts(\n\tvalue: unknown,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): LspServerTimeouts | undefined {\n\tif (value === undefined) return undefined;\n\tconst object = parseObject(value, path, diagnostics);\n\tif (!object) return undefined;\n\trejectUnknownKeys(object, new Set(TIMEOUT_KEYS), path, diagnostics);\n\tconst timeouts: LspServerTimeouts = {};\n\tfor (const key of TIMEOUT_KEYS) {\n\t\tconst timeout = parseOptionalInteger(object[key], `${path}.${key}`, diagnostics);\n\t\tif (timeout !== undefined) {\n\t\t\tif (timeout < 0) addError(diagnostics, `${path}.${key}`, \"must be zero or a positive integer\");\n\t\t\telse timeouts[key] = timeout;\n\t\t}\n\t}\n\treturn timeouts;\n}\n\ntype LspJsonParseResult = { ok: true; value: LspJsonValue } | { ok: false };\n\nfunction parseOptionalJson(\n\tvalue: unknown,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): LspJsonValue | undefined {\n\tif (value === undefined) return undefined;\n\tconst result = parseJson(value, path, diagnostics, new Set<object>());\n\treturn result.ok ? result.value : undefined;\n}\n\nfunction parseJsonArray(\n\tvalue: unknown[],\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n\tancestors: Set<object>,\n): LspJsonParseResult {\n\tancestors.add(value);\n\tconst output: LspJsonValue[] = [];\n\tlet valid = true;\n\tfor (const [index, item] of value.entries()) {\n\t\tconst parsed = parseJson(item, `${path}[${index}]`, diagnostics, ancestors);\n\t\tif (parsed.ok) output.push(parsed.value);\n\t\telse valid = false;\n\t}\n\tancestors.delete(value);\n\treturn valid ? { ok: true, value: output } : { ok: false };\n}\n\nfunction parseJsonObject(\n\tvalue: object,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n\tancestors: Set<object>,\n): LspJsonParseResult {\n\tancestors.add(value);\n\tconst output: { [key: string]: LspJsonValue } = {};\n\tlet valid = true;\n\tfor (const [key, item] of Object.entries(value)) {\n\t\tconst parsed = parseJson(item, `${path}.${key}`, diagnostics, ancestors);\n\t\tif (parsed.ok) output[key] = parsed.value;\n\t\telse valid = false;\n\t}\n\tancestors.delete(value);\n\treturn valid ? { ok: true, value: output } : { ok: false };\n}\n\nfunction parseJson(\n\tvalue: unknown,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n\tancestors: Set<object>,\n): LspJsonParseResult {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return { ok: true, value };\n\tif (typeof value === \"number\") {\n\t\tif (Number.isFinite(value)) return { ok: true, value };\n\t\taddError(diagnostics, path, \"must contain only finite JSON numbers\");\n\t\treturn { ok: false };\n\t}\n\tif (typeof value !== \"object\") {\n\t\taddError(diagnostics, path, \"must be valid JSON data\");\n\t\treturn { ok: false };\n\t}\n\tif (ancestors.has(value)) {\n\t\taddError(diagnostics, path, \"must not contain circular references\");\n\t\treturn { ok: false };\n\t}\n\treturn Array.isArray(value)\n\t\t? parseJsonArray(value, path, diagnostics, ancestors)\n\t\t: parseJsonObject(value, path, diagnostics, ancestors);\n}\n\nfunction parseObject(\n\tvalue: unknown,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): Record<string, unknown> | undefined {\n\tif (typeof value === \"object\" && value !== null && !Array.isArray(value)) return value as Record<string, unknown>;\n\taddError(diagnostics, path, \"must be an object\");\n\treturn undefined;\n}\n\nfunction parseRequiredString(\n\tvalue: unknown,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): string | undefined {\n\tif (typeof value !== \"string\" || value.trim().length === 0) {\n\t\taddError(diagnostics, path, \"is required and must be a non-empty string\");\n\t\treturn undefined;\n\t}\n\treturn value;\n}\n\nfunction parseOptionalString(\n\tvalue: unknown,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): string | undefined {\n\tif (value === undefined) return undefined;\n\treturn parseRequiredString(value, path, diagnostics);\n}\n\nfunction parseOptionalBoolean(\n\tvalue: unknown,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): boolean | undefined {\n\tif (value === undefined) return undefined;\n\tif (typeof value !== \"boolean\") {\n\t\taddError(diagnostics, path, \"must be a boolean\");\n\t\treturn undefined;\n\t}\n\treturn value;\n}\n\nfunction parseOptionalInteger(\n\tvalue: unknown,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): number | undefined {\n\tif (value === undefined) return undefined;\n\tif (!Number.isSafeInteger(value)) {\n\t\taddError(diagnostics, path, \"must be a safe integer\");\n\t\treturn undefined;\n\t}\n\treturn value as number;\n}\n\nfunction parseOptionalEnum<const T extends string>(\n\tvalue: unknown,\n\tallowed: readonly T[],\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): T | undefined {\n\tif (value === undefined) return undefined;\n\tif (typeof value === \"string\" && allowed.includes(value as T)) return value as T;\n\taddError(diagnostics, path, `must be one of ${allowed.map((item) => JSON.stringify(item)).join(\", \")}`);\n\treturn undefined;\n}\n\nfunction parseOptionalStringArray(\n\tvalue: unknown,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): string[] | undefined {\n\tif (value === undefined) return undefined;\n\tif (!Array.isArray(value)) {\n\t\taddError(diagnostics, path, \"must be an array of strings\");\n\t\treturn undefined;\n\t}\n\tconst output: string[] = [];\n\tfor (const [index, item] of value.entries()) {\n\t\tif (typeof item !== \"string\") addError(diagnostics, `${path}[${index}]`, \"must be a string\");\n\t\telse output.push(item);\n\t}\n\treturn output;\n}\n\nfunction parseOptionalStringRecord(\n\tvalue: unknown,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): Record<string, string> | undefined {\n\tif (value === undefined) return undefined;\n\tconst object = parseObject(value, path, diagnostics);\n\tif (!object) return undefined;\n\tconst output: Record<string, string> = {};\n\tfor (const [key, item] of Object.entries(object)) {\n\t\tif (typeof item !== \"string\") addError(diagnostics, `${path}.${key}`, \"must be a string\");\n\t\telse output[key] = item;\n\t}\n\treturn output;\n}\n\nfunction parseRequiredUniqueRelativePaths(\n\tvalue: unknown,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): string[] | undefined {\n\tif (!Array.isArray(value) || value.length === 0) {\n\t\taddError(diagnostics, path, \"must be a non-empty array of relative paths\");\n\t\treturn undefined;\n\t}\n\tconst output: string[] = [];\n\tconst seen = new Set<string>();\n\tfor (const [index, item] of value.entries()) {\n\t\tconst itemPath = `${path}[${index}]`;\n\t\tconst marker = parseRequiredString(item, itemPath, diagnostics);\n\t\tif (!marker) continue;\n\t\tif (!isSafeRelativePath(marker)) addError(diagnostics, itemPath, \"must be a relative path without '..' segments\");\n\t\tif (seen.has(marker)) addError(diagnostics, itemPath, \"duplicates another marker\");\n\t\telse seen.add(marker);\n\t\toutput.push(marker);\n\t}\n\treturn output;\n}\n\nfunction rejectUnknownKeys(\n\tobject: Record<string, unknown>,\n\tallowed: ReadonlySet<string>,\n\tpath: string,\n\tdiagnostics: LspConfigurationDiagnostic[],\n): void {\n\tfor (const key of Object.keys(object)) {\n\t\tif (!allowed.has(key)) addError(diagnostics, `${path}.${key}`, \"is not a recognized property\");\n\t}\n}\n\nfunction isSafeRelativePath(value: string): boolean {\n\tif (posix.isAbsolute(value) || win32.isAbsolute(value)) return false;\n\treturn !value.split(/[\\\\/]/).includes(\"..\");\n}\n\ntype MappingRootDirection = \"left-parent\" | \"right-parent\" | \"equal\";\n\ninterface MappingRootRelation {\n\tdirection: MappingRootDirection;\n\trelative: string;\n\tcaseInsensitive: boolean;\n}\n\nfunction agentRootRelation(left: string, right: string): MappingRootRelation | undefined {\n\tconst leftFlavor = pathFlavor(left);\n\tconst rightFlavor = pathFlavor(right);\n\tif (leftFlavor !== rightFlavor) return undefined;\n\tconst normalizedLeft = normalizePortablePath(left, leftFlavor);\n\tconst normalizedRight = normalizePortablePath(right, rightFlavor);\n\tconst comparableLeft = leftFlavor === \"windows\" ? normalizedLeft.toLowerCase() : normalizedLeft;\n\tconst comparableRight = rightFlavor === \"windows\" ? normalizedRight.toLowerCase() : normalizedRight;\n\tif (comparableLeft === comparableRight) {\n\t\treturn { direction: \"equal\", relative: \"\", caseInsensitive: leftFlavor === \"windows\" };\n\t}\n\tconst fromLeft = relativeWithin(normalizedLeft, normalizedRight);\n\tif (fromLeft !== undefined) {\n\t\treturn {\n\t\t\tdirection: \"left-parent\",\n\t\t\trelative: fromLeft.replace(/\\\\/g, \"/\"),\n\t\t\tcaseInsensitive: leftFlavor === \"windows\",\n\t\t};\n\t}\n\tconst fromRight = relativeWithin(normalizedRight, normalizedLeft);\n\treturn fromRight === undefined\n\t\t? undefined\n\t\t: {\n\t\t\t\tdirection: \"right-parent\",\n\t\t\t\trelative: fromRight.replace(/\\\\/g, \"/\"),\n\t\t\t\tcaseInsensitive: leftFlavor === \"windows\",\n\t\t\t};\n}\n\nfunction serverRootRelation(leftValue: string, rightValue: string): MappingRootRelation | undefined {\n\tif (!canonicalFileUri(leftValue) || !canonicalFileUri(rightValue)) return undefined;\n\tconst left = new URL(leftValue);\n\tconst right = new URL(rightValue);\n\tif (left.hostname.toLowerCase() !== right.hostname.toLowerCase()) return undefined;\n\tconst leftSegments = left.pathname\n\t\t.split(\"/\")\n\t\t.filter(Boolean)\n\t\t.map((segment) => decodeURIComponent(segment));\n\tconst rightSegments = right.pathname\n\t\t.split(\"/\")\n\t\t.filter(Boolean)\n\t\t.map((segment) => decodeURIComponent(segment));\n\tconst caseInsensitive =\n\t\tleft.hostname.length > 0 ||\n\t\tright.hostname.length > 0 ||\n\t\tleftSegments[0]?.endsWith(\":\") === true ||\n\t\trightSegments[0]?.endsWith(\":\") === true;\n\tconst comparable = (segment: string) => (caseInsensitive ? segment.toLowerCase() : segment);\n\tlet shared = 0;\n\twhile (\n\t\tshared < leftSegments.length &&\n\t\tshared < rightSegments.length &&\n\t\tcomparable(leftSegments[shared]) === comparable(rightSegments[shared])\n\t) {\n\t\tshared++;\n\t}\n\tif (shared < Math.min(leftSegments.length, rightSegments.length)) return undefined;\n\tif (leftSegments.length === rightSegments.length) return { direction: \"equal\", relative: \"\", caseInsensitive };\n\treturn leftSegments.length < rightSegments.length\n\t\t? { direction: \"left-parent\", relative: rightSegments.slice(shared).join(\"/\"), caseInsensitive }\n\t\t: { direction: \"right-parent\", relative: leftSegments.slice(shared).join(\"/\"), caseInsensitive };\n}\n\nfunction pathMappingsAreReversible(left: LspPathMapping, right: LspPathMapping): boolean {\n\tconst agent = agentRootRelation(left.agentRoot, right.agentRoot);\n\tconst server = serverRootRelation(left.serverRootUri, right.serverRootUri);\n\tif (!agent || !server) return agent === undefined && server === undefined;\n\tif (agent.direction !== server.direction) return false;\n\treturn agent.caseInsensitive && server.caseInsensitive\n\t\t? agent.relative.toLowerCase() === server.relative.toLowerCase()\n\t\t: agent.relative === server.relative;\n}\n\nfunction normalizeAgentRoot(value: string): string {\n\tconst flavor = pathFlavor(value);\n\tconst api = pathApi(flavor);\n\tconst normalized = normalizePortablePath(value, flavor);\n\tconst root = api.parse(normalized).root;\n\tconst trailingSeparator = flavor === \"windows\" ? /[\\\\/]+$/ : /\\/+$/;\n\tconst withoutTrailingSeparators = normalized === root ? normalized : normalized.replace(trailingSeparator, \"\");\n\treturn flavor === \"windows\" ? withoutTrailingSeparators.toLowerCase() : withoutTrailingSeparators;\n}\n\nfunction isAbsoluteNamedPipe(value: string): boolean {\n\tconst lower = value.toLowerCase();\n\tconst prefixes = [\"\\\\\\\\.\\\\pipe\\\\\", \"\\\\\\\\?\\\\pipe\\\\\"];\n\treturn prefixes.some((prefix) => lower.startsWith(prefix) && value.length > prefix.length);\n}\n\nfunction canonicalFileUri(value: string): string | undefined {\n\tif (!/^file:\\//i.test(value)) return undefined;\n\ttry {\n\t\tconst url = new URL(value);\n\t\tif (url.protocol !== \"file:\" || url.pathname.length === 0 || url.search !== \"\" || url.hash !== \"\")\n\t\t\treturn undefined;\n\t\tconst segments = url.pathname\n\t\t\t.split(\"/\")\n\t\t\t.filter(Boolean)\n\t\t\t.map((segment) => decodeURIComponent(segment));\n\t\tif (segments.some((segment) => segment.includes(\"/\") || segment === \".\" || segment === \"..\")) return undefined;\n\t\tif (url.hostname && segments.length === 0) return undefined;\n\t\tif (segments[0]?.endsWith(\":\") && segments.length === 1 && !url.pathname.endsWith(\"/\")) return undefined;\n\t\tconst driveRoot = segments[0]?.endsWith(\":\") && segments.length === 1;\n\t\turl.pathname = `/${segments.map((segment) => encodeURIComponent(segment)).join(\"/\")}${driveRoot ? \"/\" : \"\"}`;\n\t\turl.hostname = url.hostname.toLowerCase();\n\t\treturn url.toString();\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nfunction isAbsoluteFileUri(value: string): boolean {\n\treturn canonicalFileUri(value) !== undefined;\n}\n\nfunction addError(diagnostics: LspConfigurationDiagnostic[], path: string, message: string): void {\n\tdiagnostics.push({ severity: \"error\", path, message });\n}\n"]}
|