@hansjm10/volt-coding-agent 0.0.0-bootstrap.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BINARY-CAPABILITIES.md +28 -0
- package/CHANGELOG.md +4845 -0
- package/LICENSE +1 -1
- package/README.md +716 -3
- package/THIRD-PARTY-NOTICES.md +55 -0
- package/dist/LICENSES/clipboard-image-MIT.txt +9 -0
- package/dist/LICENSES/highlight.js-10.7.3-BSD-3-Clause.txt +29 -0
- package/dist/LICENSES/highlight.js-11.9.0-BSD-3-Clause.txt +29 -0
- package/dist/LICENSES/marked-18.0.5-LICENSE.txt +44 -0
- package/dist/LICENSES/run-jxa-MIT.txt +9 -0
- package/dist/cli/args.d.ts +60 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +414 -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 +85 -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/project-trust.d.ts +10 -0
- package/dist/cli/project-trust.d.ts.map +1 -0
- package/dist/cli/project-trust.js +48 -0
- package/dist/cli/project-trust.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/startup-ui.d.ts +17 -0
- package/dist/cli/startup-ui.d.ts.map +1 -0
- package/dist/cli/startup-ui.js +133 -0
- package/dist/cli/startup-ui.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +18 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +85 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +487 -0
- package/dist/config.js.map +1 -0
- package/dist/core/agent-session-runtime.d.ts +160 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -0
- package/dist/core/agent-session-runtime.js +397 -0
- package/dist/core/agent-session-runtime.js.map +1 -0
- package/dist/core/agent-session-services.d.ts +98 -0
- package/dist/core/agent-session-services.d.ts.map +1 -0
- package/dist/core/agent-session-services.js +125 -0
- package/dist/core/agent-session-services.js.map +1 -0
- package/dist/core/agent-session.d.ts +739 -0
- package/dist/core/agent-session.d.ts.map +1 -0
- package/dist/core/agent-session.js +3158 -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 +159 -0
- package/dist/core/auth-storage.d.ts.map +1 -0
- package/dist/core/auth-storage.js +509 -0
- package/dist/core/auth-storage.js.map +1 -0
- package/dist/core/bash-executor.d.ts +32 -0
- package/dist/core/bash-executor.d.ts.map +1 -0
- package/dist/core/bash-executor.js +111 -0
- package/dist/core/bash-executor.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts +92 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -0
- package/dist/core/compaction/branch-summarization.js +257 -0
- package/dist/core/compaction/branch-summarization.js.map +1 -0
- package/dist/core/compaction/compaction.d.ts +121 -0
- package/dist/core/compaction/compaction.d.ts.map +1 -0
- package/dist/core/compaction/compaction.js +658 -0
- package/dist/core/compaction/compaction.js.map +1 -0
- package/dist/core/compaction/index.d.ts +7 -0
- package/dist/core/compaction/index.d.ts.map +1 -0
- package/dist/core/compaction/index.js +7 -0
- package/dist/core/compaction/index.js.map +1 -0
- package/dist/core/compaction/utils.d.ts +56 -0
- package/dist/core/compaction/utils.d.ts.map +1 -0
- package/dist/core/compaction/utils.js +271 -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 +15 -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/experimental.d.ts +2 -0
- package/dist/core/experimental.d.ts.map +1 -0
- package/dist/core/experimental.js +4 -0
- package/dist/core/experimental.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 +249 -0
- package/dist/core/export-html/ansi-to-html.js.map +1 -0
- package/dist/core/export-html/index.d.ts +37 -0
- package/dist/core/export-html/index.d.ts.map +1 -0
- package/dist/core/export-html/index.js +234 -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 +34 -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/index.d.ts +12 -0
- package/dist/core/extensions/index.d.ts.map +1 -0
- package/dist/core/extensions/index.js +9 -0
- package/dist/core/extensions/index.js.map +1 -0
- package/dist/core/extensions/loader.d.ts +25 -0
- package/dist/core/extensions/loader.d.ts.map +1 -0
- package/dist/core/extensions/loader.js +516 -0
- package/dist/core/extensions/loader.js.map +1 -0
- package/dist/core/extensions/runner.d.ts +180 -0
- package/dist/core/extensions/runner.d.ts.map +1 -0
- package/dist/core/extensions/runner.js +938 -0
- package/dist/core/extensions/runner.js.map +1 -0
- package/dist/core/extensions/types.d.ts +1215 -0
- package/dist/core/extensions/types.d.ts.map +1 -0
- package/dist/core/extensions/types.js +48 -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 +54 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -0
- package/dist/core/footer-data-provider.js +338 -0
- package/dist/core/footer-data-provider.js.map +1 -0
- package/dist/core/host-actions.d.ts +107 -0
- package/dist/core/host-actions.d.ts.map +1 -0
- package/dist/core/host-actions.js +632 -0
- package/dist/core/host-actions.js.map +1 -0
- package/dist/core/host-interaction.d.ts +35 -0
- package/dist/core/host-interaction.d.ts.map +1 -0
- package/dist/core/host-interaction.js +2 -0
- package/dist/core/host-interaction.js.map +1 -0
- package/dist/core/http-dispatcher.d.ts +22 -0
- package/dist/core/http-dispatcher.d.ts.map +1 -0
- package/dist/core/http-dispatcher.js +64 -0
- package/dist/core/http-dispatcher.js.map +1 -0
- package/dist/core/index.d.ts +18 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +17 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/keybindings.d.ts +373 -0
- package/dist/core/keybindings.d.ts.map +1 -0
- package/dist/core/keybindings.js +303 -0
- package/dist/core/keybindings.js.map +1 -0
- package/dist/core/lsp/client.d.ts +119 -0
- package/dist/core/lsp/client.d.ts.map +1 -0
- package/dist/core/lsp/client.js +711 -0
- package/dist/core/lsp/client.js.map +1 -0
- package/dist/core/lsp/config.d.ts +96 -0
- package/dist/core/lsp/config.d.ts.map +1 -0
- package/dist/core/lsp/config.js +206 -0
- package/dist/core/lsp/config.js.map +1 -0
- package/dist/core/lsp/index.d.ts +6 -0
- package/dist/core/lsp/index.d.ts.map +1 -0
- package/dist/core/lsp/index.js +6 -0
- package/dist/core/lsp/index.js.map +1 -0
- package/dist/core/lsp/manager.d.ts +122 -0
- package/dist/core/lsp/manager.d.ts.map +1 -0
- package/dist/core/lsp/manager.js +1136 -0
- package/dist/core/lsp/manager.js.map +1 -0
- package/dist/core/lsp/trace.d.ts +26 -0
- package/dist/core/lsp/trace.d.ts.map +1 -0
- package/dist/core/lsp/trace.js +98 -0
- package/dist/core/lsp/trace.js.map +1 -0
- package/dist/core/lsp/workspace-edit.d.ts +60 -0
- package/dist/core/lsp/workspace-edit.d.ts.map +1 -0
- package/dist/core/lsp/workspace-edit.js +71 -0
- package/dist/core/lsp/workspace-edit.js.map +1 -0
- package/dist/core/mcp/audit.d.ts +39 -0
- package/dist/core/mcp/audit.d.ts.map +1 -0
- package/dist/core/mcp/audit.js +35 -0
- package/dist/core/mcp/audit.js.map +1 -0
- package/dist/core/mcp/auth.d.ts +7 -0
- package/dist/core/mcp/auth.d.ts.map +1 -0
- package/dist/core/mcp/auth.js +56 -0
- package/dist/core/mcp/auth.js.map +1 -0
- package/dist/core/mcp/client-factory.d.ts +20 -0
- package/dist/core/mcp/client-factory.d.ts.map +1 -0
- package/dist/core/mcp/client-factory.js +200 -0
- package/dist/core/mcp/client-factory.js.map +1 -0
- package/dist/core/mcp/config-loader.d.ts +9 -0
- package/dist/core/mcp/config-loader.d.ts.map +1 -0
- package/dist/core/mcp/config-loader.js +104 -0
- package/dist/core/mcp/config-loader.js.map +1 -0
- package/dist/core/mcp/config-writer.d.ts +21 -0
- package/dist/core/mcp/config-writer.d.ts.map +1 -0
- package/dist/core/mcp/config-writer.js +124 -0
- package/dist/core/mcp/config-writer.js.map +1 -0
- package/dist/core/mcp/config.d.ts +32 -0
- package/dist/core/mcp/config.d.ts.map +1 -0
- package/dist/core/mcp/config.js +385 -0
- package/dist/core/mcp/config.js.map +1 -0
- package/dist/core/mcp/direct-tools.d.ts +11 -0
- package/dist/core/mcp/direct-tools.d.ts.map +1 -0
- package/dist/core/mcp/direct-tools.js +47 -0
- package/dist/core/mcp/direct-tools.js.map +1 -0
- package/dist/core/mcp/gateway-tool.d.ts +29 -0
- package/dist/core/mcp/gateway-tool.d.ts.map +1 -0
- package/dist/core/mcp/gateway-tool.js +108 -0
- package/dist/core/mcp/gateway-tool.js.map +1 -0
- package/dist/core/mcp/index.d.ts +19 -0
- package/dist/core/mcp/index.d.ts.map +1 -0
- package/dist/core/mcp/index.js +18 -0
- package/dist/core/mcp/index.js.map +1 -0
- package/dist/core/mcp/manager.d.ts +117 -0
- package/dist/core/mcp/manager.d.ts.map +1 -0
- package/dist/core/mcp/manager.js +819 -0
- package/dist/core/mcp/manager.js.map +1 -0
- package/dist/core/mcp/metadata-cache.d.ts +27 -0
- package/dist/core/mcp/metadata-cache.d.ts.map +1 -0
- package/dist/core/mcp/metadata-cache.js +152 -0
- package/dist/core/mcp/metadata-cache.js.map +1 -0
- package/dist/core/mcp/oauth-flow.d.ts +94 -0
- package/dist/core/mcp/oauth-flow.d.ts.map +1 -0
- package/dist/core/mcp/oauth-flow.js +473 -0
- package/dist/core/mcp/oauth-flow.js.map +1 -0
- package/dist/core/mcp/oauth-provider.d.ts +39 -0
- package/dist/core/mcp/oauth-provider.d.ts.map +1 -0
- package/dist/core/mcp/oauth-provider.js +149 -0
- package/dist/core/mcp/oauth-provider.js.map +1 -0
- package/dist/core/mcp/oauth-store.d.ts +27 -0
- package/dist/core/mcp/oauth-store.d.ts.map +1 -0
- package/dist/core/mcp/oauth-store.js +111 -0
- package/dist/core/mcp/oauth-store.js.map +1 -0
- package/dist/core/mcp/output-store.d.ts +55 -0
- package/dist/core/mcp/output-store.d.ts.map +1 -0
- package/dist/core/mcp/output-store.js +206 -0
- package/dist/core/mcp/output-store.js.map +1 -0
- package/dist/core/mcp/rpc.d.ts +13 -0
- package/dist/core/mcp/rpc.d.ts.map +1 -0
- package/dist/core/mcp/rpc.js +29 -0
- package/dist/core/mcp/rpc.js.map +1 -0
- package/dist/core/mcp/safety.d.ts +6 -0
- package/dist/core/mcp/safety.d.ts.map +1 -0
- package/dist/core/mcp/safety.js +65 -0
- package/dist/core/mcp/safety.js.map +1 -0
- package/dist/core/mcp/search.d.ts +8 -0
- package/dist/core/mcp/search.d.ts.map +1 -0
- package/dist/core/mcp/search.js +85 -0
- package/dist/core/mcp/search.js.map +1 -0
- package/dist/core/mcp/server-supervisor.d.ts +59 -0
- package/dist/core/mcp/server-supervisor.d.ts.map +1 -0
- package/dist/core/mcp/server-supervisor.js +331 -0
- package/dist/core/mcp/server-supervisor.js.map +1 -0
- package/dist/core/mcp/types.d.ts +321 -0
- package/dist/core/mcp/types.d.ts.map +1 -0
- package/dist/core/mcp/types.js +2 -0
- package/dist/core/mcp/types.js.map +1 -0
- package/dist/core/messages.d.ts +78 -0
- package/dist/core/messages.d.ts.map +1 -0
- package/dist/core/messages.js +138 -0
- package/dist/core/messages.js.map +1 -0
- package/dist/core/model-catalog-watcher.d.ts +36 -0
- package/dist/core/model-catalog-watcher.d.ts.map +1 -0
- package/dist/core/model-catalog-watcher.js +101 -0
- package/dist/core/model-catalog-watcher.js.map +1 -0
- package/dist/core/model-registry.d.ts +160 -0
- package/dist/core/model-registry.d.ts.map +1 -0
- package/dist/core/model-registry.js +754 -0
- package/dist/core/model-registry.js.map +1 -0
- package/dist/core/model-resolver.d.ts +111 -0
- package/dist/core/model-resolver.d.ts.map +1 -0
- package/dist/core/model-resolver.js +534 -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 +220 -0
- package/dist/core/package-manager.d.ts.map +1 -0
- package/dist/core/package-manager.js +2217 -0
- package/dist/core/package-manager.js.map +1 -0
- package/dist/core/project-trust.d.ts +15 -0
- package/dist/core/project-trust.d.ts.map +1 -0
- package/dist/core/project-trust.js +58 -0
- package/dist/core/project-trust.js.map +1 -0
- package/dist/core/prompt-templates.d.ts +53 -0
- package/dist/core/prompt-templates.d.ts.map +1 -0
- package/dist/core/prompt-templates.js +236 -0
- package/dist/core/prompt-templates.js.map +1 -0
- package/dist/core/provider-attribution.d.ts +4 -0
- package/dist/core/provider-attribution.d.ts.map +1 -0
- package/dist/core/provider-attribution.js +81 -0
- package/dist/core/provider-attribution.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 +36 -0
- package/dist/core/provider-display-names.js.map +1 -0
- package/dist/core/remote/iroh/access-grant.d.ts +40 -0
- package/dist/core/remote/iroh/access-grant.d.ts.map +1 -0
- package/dist/core/remote/iroh/access-grant.js +199 -0
- package/dist/core/remote/iroh/access-grant.js.map +1 -0
- package/dist/core/remote/iroh/active-stream-registry.d.ts +39 -0
- package/dist/core/remote/iroh/active-stream-registry.d.ts.map +1 -0
- package/dist/core/remote/iroh/active-stream-registry.js +109 -0
- package/dist/core/remote/iroh/active-stream-registry.js.map +1 -0
- package/dist/core/remote/iroh/audit.d.ts +67 -0
- package/dist/core/remote/iroh/audit.d.ts.map +1 -0
- package/dist/core/remote/iroh/audit.js +274 -0
- package/dist/core/remote/iroh/audit.js.map +1 -0
- package/dist/core/remote/iroh/authorization.d.ts +46 -0
- package/dist/core/remote/iroh/authorization.d.ts.map +1 -0
- package/dist/core/remote/iroh/authorization.js +327 -0
- package/dist/core/remote/iroh/authorization.js.map +1 -0
- package/dist/core/remote/iroh/control.d.ts +64 -0
- package/dist/core/remote/iroh/control.d.ts.map +1 -0
- package/dist/core/remote/iroh/control.js +326 -0
- package/dist/core/remote/iroh/control.js.map +1 -0
- package/dist/core/remote/iroh/device-log-rpc.d.ts +22 -0
- package/dist/core/remote/iroh/device-log-rpc.d.ts.map +1 -0
- package/dist/core/remote/iroh/device-log-rpc.js +152 -0
- package/dist/core/remote/iroh/device-log-rpc.js.map +1 -0
- package/dist/core/remote/iroh/engine.d.ts +148 -0
- package/dist/core/remote/iroh/engine.d.ts.map +1 -0
- package/dist/core/remote/iroh/engine.js +499 -0
- package/dist/core/remote/iroh/engine.js.map +1 -0
- package/dist/core/remote/iroh/handshake-reader.d.ts +19 -0
- package/dist/core/remote/iroh/handshake-reader.d.ts.map +1 -0
- package/dist/core/remote/iroh/handshake-reader.js +91 -0
- package/dist/core/remote/iroh/handshake-reader.js.map +1 -0
- package/dist/core/remote/iroh/handshake.d.ts +119 -0
- package/dist/core/remote/iroh/handshake.d.ts.map +1 -0
- package/dist/core/remote/iroh/handshake.js +621 -0
- package/dist/core/remote/iroh/handshake.js.map +1 -0
- package/dist/core/remote/iroh/host-policy.d.ts +13 -0
- package/dist/core/remote/iroh/host-policy.d.ts.map +1 -0
- package/dist/core/remote/iroh/host-policy.js +15 -0
- package/dist/core/remote/iroh/host-policy.js.map +1 -0
- package/dist/core/remote/iroh/index.d.ts +25 -0
- package/dist/core/remote/iroh/index.d.ts.map +1 -0
- package/dist/core/remote/iroh/index.js +25 -0
- package/dist/core/remote/iroh/index.js.map +1 -0
- package/dist/core/remote/iroh/metadata.d.ts +28 -0
- package/dist/core/remote/iroh/metadata.d.ts.map +1 -0
- package/dist/core/remote/iroh/metadata.js +16 -0
- package/dist/core/remote/iroh/metadata.js.map +1 -0
- package/dist/core/remote/iroh/outbound-filter.d.ts +29 -0
- package/dist/core/remote/iroh/outbound-filter.d.ts.map +1 -0
- package/dist/core/remote/iroh/outbound-filter.js +692 -0
- package/dist/core/remote/iroh/outbound-filter.js.map +1 -0
- package/dist/core/remote/iroh/protocol.d.ts +60 -0
- package/dist/core/remote/iroh/protocol.d.ts.map +1 -0
- package/dist/core/remote/iroh/protocol.js +204 -0
- package/dist/core/remote/iroh/protocol.js.map +1 -0
- package/dist/core/remote/iroh/push.d.ts +179 -0
- package/dist/core/remote/iroh/push.d.ts.map +1 -0
- package/dist/core/remote/iroh/push.js +662 -0
- package/dist/core/remote/iroh/push.js.map +1 -0
- package/dist/core/remote/iroh/qr.d.ts +12 -0
- package/dist/core/remote/iroh/qr.d.ts.map +1 -0
- package/dist/core/remote/iroh/qr.js +27 -0
- package/dist/core/remote/iroh/qr.js.map +1 -0
- package/dist/core/remote/iroh/rpc-command-filter.d.ts +47 -0
- package/dist/core/remote/iroh/rpc-command-filter.d.ts.map +1 -0
- package/dist/core/remote/iroh/rpc-command-filter.js +188 -0
- package/dist/core/remote/iroh/rpc-command-filter.js.map +1 -0
- package/dist/core/remote/iroh/rpc-transport.d.ts +21 -0
- package/dist/core/remote/iroh/rpc-transport.d.ts.map +1 -0
- package/dist/core/remote/iroh/rpc-transport.js +106 -0
- package/dist/core/remote/iroh/rpc-transport.js.map +1 -0
- package/dist/core/remote/iroh/state-manager.d.ts +141 -0
- package/dist/core/remote/iroh/state-manager.d.ts.map +1 -0
- package/dist/core/remote/iroh/state-manager.js +744 -0
- package/dist/core/remote/iroh/state-manager.js.map +1 -0
- package/dist/core/remote/iroh/state.d.ts +141 -0
- package/dist/core/remote/iroh/state.d.ts.map +1 -0
- package/dist/core/remote/iroh/state.js +433 -0
- package/dist/core/remote/iroh/state.js.map +1 -0
- package/dist/core/remote/iroh/ticket.d.ts +46 -0
- package/dist/core/remote/iroh/ticket.d.ts.map +1 -0
- package/dist/core/remote/iroh/ticket.js +267 -0
- package/dist/core/remote/iroh/ticket.js.map +1 -0
- package/dist/core/remote/iroh/transcript-text.d.ts +8 -0
- package/dist/core/remote/iroh/transcript-text.d.ts.map +1 -0
- package/dist/core/remote/iroh/transcript-text.js +26 -0
- package/dist/core/remote/iroh/transcript-text.js.map +1 -0
- package/dist/core/remote/iroh/workspace-rpc.d.ts +31 -0
- package/dist/core/remote/iroh/workspace-rpc.d.ts.map +1 -0
- package/dist/core/remote/iroh/workspace-rpc.js +73 -0
- package/dist/core/remote/iroh/workspace-rpc.js.map +1 -0
- package/dist/core/remote/iroh/workspace.d.ts +16 -0
- package/dist/core/remote/iroh/workspace.d.ts.map +1 -0
- package/dist/core/remote/iroh/workspace.js +104 -0
- package/dist/core/remote/iroh/workspace.js.map +1 -0
- package/dist/core/remote/iroh/worktree-rpc.d.ts +83 -0
- package/dist/core/remote/iroh/worktree-rpc.d.ts.map +1 -0
- package/dist/core/remote/iroh/worktree-rpc.js +148 -0
- package/dist/core/remote/iroh/worktree-rpc.js.map +1 -0
- package/dist/core/resolve-config-value.d.ts +30 -0
- package/dist/core/resolve-config-value.d.ts.map +1 -0
- package/dist/core/resolve-config-value.js +245 -0
- package/dist/core/resolve-config-value.js.map +1 -0
- package/dist/core/resource-loader.d.ts +214 -0
- package/dist/core/resource-loader.d.ts.map +1 -0
- package/dist/core/resource-loader.js +824 -0
- package/dist/core/resource-loader.js.map +1 -0
- package/dist/core/review.d.ts +318 -0
- package/dist/core/review.d.ts.map +1 -0
- package/dist/core/review.js +1271 -0
- package/dist/core/review.js.map +1 -0
- package/dist/core/rpc/duplex-write-gate.d.ts +29 -0
- package/dist/core/rpc/duplex-write-gate.d.ts.map +1 -0
- package/dist/core/rpc/duplex-write-gate.js +124 -0
- package/dist/core/rpc/duplex-write-gate.js.map +1 -0
- package/dist/core/rpc/index.d.ts +6 -0
- package/dist/core/rpc/index.d.ts.map +1 -0
- package/dist/core/rpc/index.js +5 -0
- package/dist/core/rpc/index.js.map +1 -0
- package/dist/core/rpc/iroh-transport.d.ts +58 -0
- package/dist/core/rpc/iroh-transport.d.ts.map +1 -0
- package/dist/core/rpc/iroh-transport.js +278 -0
- package/dist/core/rpc/iroh-transport.js.map +1 -0
- package/dist/core/rpc/jsonl.d.ts +17 -0
- package/dist/core/rpc/jsonl.d.ts.map +1 -0
- package/dist/core/rpc/jsonl.js +49 -0
- package/dist/core/rpc/jsonl.js.map +1 -0
- package/dist/core/rpc/loopback-transport.d.ts +14 -0
- package/dist/core/rpc/loopback-transport.d.ts.map +1 -0
- package/dist/core/rpc/loopback-transport.js +120 -0
- package/dist/core/rpc/loopback-transport.js.map +1 -0
- package/dist/core/rpc/transcript.d.ts +37 -0
- package/dist/core/rpc/transcript.d.ts.map +1 -0
- package/dist/core/rpc/transcript.js +624 -0
- package/dist/core/rpc/transcript.js.map +1 -0
- package/dist/core/rpc/transport.d.ts +41 -0
- package/dist/core/rpc/transport.d.ts.map +1 -0
- package/dist/core/rpc/transport.js +155 -0
- package/dist/core/rpc/transport.js.map +1 -0
- package/dist/core/rpc/types.d.ts +1254 -0
- package/dist/core/rpc/types.d.ts.map +1 -0
- package/dist/core/rpc/types.js +8 -0
- package/dist/core/rpc/types.js.map +1 -0
- package/dist/core/rpc/ui-action-args.d.ts +3 -0
- package/dist/core/rpc/ui-action-args.d.ts.map +1 -0
- package/dist/core/rpc/ui-action-args.js +66 -0
- package/dist/core/rpc/ui-action-args.js.map +1 -0
- package/dist/core/rpc/ui-actions.d.ts +43 -0
- package/dist/core/rpc/ui-actions.d.ts.map +1 -0
- package/dist/core/rpc/ui-actions.js +362 -0
- package/dist/core/rpc/ui-actions.js.map +1 -0
- package/dist/core/sdk.d.ts +138 -0
- package/dist/core/sdk.d.ts.map +1 -0
- package/dist/core/sdk.js +324 -0
- package/dist/core/sdk.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/session-manager.d.ts +346 -0
- package/dist/core/session-manager.d.ts.map +1 -0
- package/dist/core/session-manager.js +1280 -0
- package/dist/core/session-manager.js.map +1 -0
- package/dist/core/settings-manager.d.ts +359 -0
- package/dist/core/settings-manager.d.ts.map +1 -0
- package/dist/core/settings-manager.js +1277 -0
- package/dist/core/settings-manager.js.map +1 -0
- package/dist/core/skills.d.ts +60 -0
- package/dist/core/skills.d.ts.map +1 -0
- package/dist/core/skills.js +387 -0
- package/dist/core/skills.js.map +1 -0
- package/dist/core/slash-commands.d.ts +14 -0
- package/dist/core/slash-commands.d.ts.map +1 -0
- package/dist/core/slash-commands.js +51 -0
- package/dist/core/slash-commands.js.map +1 -0
- package/dist/core/source-info.d.ts +18 -0
- package/dist/core/source-info.d.ts.map +1 -0
- package/dist/core/source-info.js +19 -0
- package/dist/core/source-info.js.map +1 -0
- package/dist/core/subagents/delegation-scope.d.ts +47 -0
- package/dist/core/subagents/delegation-scope.d.ts.map +1 -0
- package/dist/core/subagents/delegation-scope.js +134 -0
- package/dist/core/subagents/delegation-scope.js.map +1 -0
- package/dist/core/subagents/index.d.ts +46 -0
- package/dist/core/subagents/index.d.ts.map +1 -0
- package/dist/core/subagents/index.js +369 -0
- package/dist/core/subagents/index.js.map +1 -0
- package/dist/core/subagents/manager.d.ts +183 -0
- package/dist/core/subagents/manager.d.ts.map +1 -0
- package/dist/core/subagents/manager.js +820 -0
- package/dist/core/subagents/manager.js.map +1 -0
- package/dist/core/system-prompt.d.ts +28 -0
- package/dist/core/system-prompt.d.ts.map +1 -0
- package/dist/core/system-prompt.js +180 -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/theme/dark.json +86 -0
- package/dist/core/theme/discovery.d.ts +48 -0
- package/dist/core/theme/discovery.d.ts.map +1 -0
- package/dist/core/theme/discovery.js +239 -0
- package/dist/core/theme/discovery.js.map +1 -0
- package/dist/core/theme/index.d.ts +6 -0
- package/dist/core/theme/index.d.ts.map +1 -0
- package/dist/core/theme/index.js +5 -0
- package/dist/core/theme/index.js.map +1 -0
- package/dist/core/theme/light.json +85 -0
- package/dist/core/theme/runtime.d.ts +55 -0
- package/dist/core/theme/runtime.d.ts.map +1 -0
- package/dist/core/theme/runtime.js +555 -0
- package/dist/core/theme/runtime.js.map +1 -0
- package/dist/core/theme/theme-schema.json +335 -0
- package/dist/core/theme/theme-service.d.ts +37 -0
- package/dist/core/theme/theme-service.d.ts.map +1 -0
- package/dist/core/theme/theme-service.js +222 -0
- package/dist/core/theme/theme-service.js.map +1 -0
- package/dist/core/theme/theme.d.ts +100 -0
- package/dist/core/theme/theme.d.ts.map +1 -0
- package/dist/core/theme/theme.js +243 -0
- package/dist/core/theme/theme.js.map +1 -0
- package/dist/core/theme/tokens.d.ts +20 -0
- package/dist/core/theme/tokens.d.ts.map +1 -0
- package/dist/core/theme/tokens.js +178 -0
- package/dist/core/theme/tokens.js.map +1 -0
- package/dist/core/theme/types.d.ts +21 -0
- package/dist/core/theme/types.d.ts.map +1 -0
- package/dist/core/theme/types.js +2 -0
- package/dist/core/theme/types.js.map +1 -0
- package/dist/core/timings.d.ts +8 -0
- package/dist/core/timings.d.ts.map +1 -0
- package/dist/core/timings.js +31 -0
- package/dist/core/timings.js.map +1 -0
- package/dist/core/tools/bash.d.ts +68 -0
- package/dist/core/tools/bash.d.ts.map +1 -0
- package/dist/core/tools/bash.js +345 -0
- package/dist/core/tools/bash.js.map +1 -0
- package/dist/core/tools/diagnostics-provider.d.ts +12 -0
- package/dist/core/tools/diagnostics-provider.d.ts.map +1 -0
- package/dist/core/tools/diagnostics-provider.js +2 -0
- package/dist/core/tools/diagnostics-provider.js.map +1 -0
- package/dist/core/tools/edit-diff.d.ts +77 -0
- package/dist/core/tools/edit-diff.d.ts.map +1 -0
- package/dist/core/tools/edit-diff.js +506 -0
- package/dist/core/tools/edit-diff.js.map +1 -0
- package/dist/core/tools/edit.d.ts +56 -0
- package/dist/core/tools/edit.d.ts.map +1 -0
- package/dist/core/tools/edit.js +300 -0
- package/dist/core/tools/edit.js.map +1 -0
- package/dist/core/tools/file-mutation-queue.d.ts +6 -0
- package/dist/core/tools/file-mutation-queue.d.ts.map +1 -0
- package/dist/core/tools/file-mutation-queue.js +52 -0
- package/dist/core/tools/file-mutation-queue.js.map +1 -0
- package/dist/core/tools/find.d.ts +35 -0
- package/dist/core/tools/find.d.ts.map +1 -0
- package/dist/core/tools/find.js +337 -0
- package/dist/core/tools/find.js.map +1 -0
- package/dist/core/tools/grep.d.ts +37 -0
- package/dist/core/tools/grep.d.ts.map +1 -0
- package/dist/core/tools/grep.js +305 -0
- package/dist/core/tools/grep.js.map +1 -0
- package/dist/core/tools/index.d.ts +56 -0
- package/dist/core/tools/index.d.ts.map +1 -0
- package/dist/core/tools/index.js +174 -0
- package/dist/core/tools/index.js.map +1 -0
- package/dist/core/tools/ls.d.ts +37 -0
- package/dist/core/tools/ls.d.ts.map +1 -0
- package/dist/core/tools/ls.js +167 -0
- package/dist/core/tools/ls.js.map +1 -0
- package/dist/core/tools/lsp.d.ts +59 -0
- package/dist/core/tools/lsp.d.ts.map +1 -0
- package/dist/core/tools/lsp.js +157 -0
- package/dist/core/tools/lsp.js.map +1 -0
- package/dist/core/tools/output-accumulator.d.ts +52 -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 +10 -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 +35 -0
- package/dist/core/tools/read.d.ts.map +1 -0
- package/dist/core/tools/read.js +292 -0
- package/dist/core/tools/read.js.map +1 -0
- package/dist/core/tools/render-utils.d.ts +26 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -0
- package/dist/core/tools/render-utils.js +69 -0
- package/dist/core/tools/render-utils.js.map +1 -0
- package/dist/core/tools/subagent.d.ts +219 -0
- package/dist/core/tools/subagent.d.ts.map +1 -0
- package/dist/core/tools/subagent.js +1445 -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 +70 -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/web-search.d.ts +69 -0
- package/dist/core/tools/web-search.d.ts.map +1 -0
- package/dist/core/tools/web-search.js +634 -0
- package/dist/core/tools/web-search.js.map +1 -0
- package/dist/core/tools/write.d.ts +33 -0
- package/dist/core/tools/write.d.ts.map +1 -0
- package/dist/core/tools/write.js +210 -0
- package/dist/core/tools/write.js.map +1 -0
- package/dist/core/trust-manager.d.ts +36 -0
- package/dist/core/trust-manager.d.ts.map +1 -0
- package/dist/core/trust-manager.js +220 -0
- package/dist/core/trust-manager.js.map +1 -0
- package/dist/daemon/cli.d.ts +8 -0
- package/dist/daemon/cli.d.ts.map +1 -0
- package/dist/daemon/cli.js +468 -0
- package/dist/daemon/cli.js.map +1 -0
- package/dist/daemon/control-client.d.ts +60 -0
- package/dist/daemon/control-client.d.ts.map +1 -0
- package/dist/daemon/control-client.js +411 -0
- package/dist/daemon/control-client.js.map +1 -0
- package/dist/daemon/control-protocol.d.ts +507 -0
- package/dist/daemon/control-protocol.d.ts.map +1 -0
- package/dist/daemon/control-protocol.js +395 -0
- package/dist/daemon/control-protocol.js.map +1 -0
- package/dist/daemon/control-server.d.ts +77 -0
- package/dist/daemon/control-server.d.ts.map +1 -0
- package/dist/daemon/control-server.js +327 -0
- package/dist/daemon/control-server.js.map +1 -0
- package/dist/daemon/conversation-commands.d.ts +176 -0
- package/dist/daemon/conversation-commands.d.ts.map +1 -0
- package/dist/daemon/conversation-commands.js +1268 -0
- package/dist/daemon/conversation-commands.js.map +1 -0
- package/dist/daemon/daemon-lock.d.ts +27 -0
- package/dist/daemon/daemon-lock.d.ts.map +1 -0
- package/dist/daemon/daemon-lock.js +238 -0
- package/dist/daemon/daemon-lock.js.map +1 -0
- package/dist/daemon/handshake-responses.d.ts +47 -0
- package/dist/daemon/handshake-responses.d.ts.map +1 -0
- package/dist/daemon/handshake-responses.js +113 -0
- package/dist/daemon/handshake-responses.js.map +1 -0
- package/dist/daemon/integrated-runtimes.d.ts +137 -0
- package/dist/daemon/integrated-runtimes.d.ts.map +1 -0
- package/dist/daemon/integrated-runtimes.js +763 -0
- package/dist/daemon/integrated-runtimes.js.map +1 -0
- package/dist/daemon/iroh-native.d.ts +76 -0
- package/dist/daemon/iroh-native.d.ts.map +1 -0
- package/dist/daemon/iroh-native.js +18 -0
- package/dist/daemon/iroh-native.js.map +1 -0
- package/dist/daemon/iroh-resource-guard.d.ts +57 -0
- package/dist/daemon/iroh-resource-guard.d.ts.map +1 -0
- package/dist/daemon/iroh-resource-guard.js +134 -0
- package/dist/daemon/iroh-resource-guard.js.map +1 -0
- package/dist/daemon/iroh-service.d.ts +51 -0
- package/dist/daemon/iroh-service.d.ts.map +1 -0
- package/dist/daemon/iroh-service.js +2604 -0
- package/dist/daemon/iroh-service.js.map +1 -0
- package/dist/daemon/keep-awake.d.ts +62 -0
- package/dist/daemon/keep-awake.d.ts.map +1 -0
- package/dist/daemon/keep-awake.js +190 -0
- package/dist/daemon/keep-awake.js.map +1 -0
- package/dist/daemon/lease-broker.d.ts +139 -0
- package/dist/daemon/lease-broker.d.ts.map +1 -0
- package/dist/daemon/lease-broker.js +504 -0
- package/dist/daemon/lease-broker.js.map +1 -0
- package/dist/daemon/log.d.ts +16 -0
- package/dist/daemon/log.d.ts.map +1 -0
- package/dist/daemon/log.js +40 -0
- package/dist/daemon/log.js.map +1 -0
- package/dist/daemon/main.d.ts +70 -0
- package/dist/daemon/main.d.ts.map +1 -0
- package/dist/daemon/main.js +781 -0
- package/dist/daemon/main.js.map +1 -0
- package/dist/daemon/paths.d.ts +32 -0
- package/dist/daemon/paths.d.ts.map +1 -0
- package/dist/daemon/paths.js +208 -0
- package/dist/daemon/paths.js.map +1 -0
- package/dist/daemon/process-identity.d.ts +58 -0
- package/dist/daemon/process-identity.d.ts.map +1 -0
- package/dist/daemon/process-identity.js +185 -0
- package/dist/daemon/process-identity.js.map +1 -0
- package/dist/daemon/relay-stream.d.ts +89 -0
- package/dist/daemon/relay-stream.d.ts.map +1 -0
- package/dist/daemon/relay-stream.js +202 -0
- package/dist/daemon/relay-stream.js.map +1 -0
- package/dist/daemon/remote-cli.d.ts +7 -0
- package/dist/daemon/remote-cli.d.ts.map +1 -0
- package/dist/daemon/remote-cli.js +774 -0
- package/dist/daemon/remote-cli.js.map +1 -0
- package/dist/daemon/service-install.d.ts +43 -0
- package/dist/daemon/service-install.d.ts.map +1 -0
- package/dist/daemon/service-install.js +198 -0
- package/dist/daemon/service-install.js.map +1 -0
- package/dist/daemon/session-target.d.ts +62 -0
- package/dist/daemon/session-target.d.ts.map +1 -0
- package/dist/daemon/session-target.js +66 -0
- package/dist/daemon/session-target.js.map +1 -0
- package/dist/daemon/spawn.d.ts +53 -0
- package/dist/daemon/spawn.d.ts.map +1 -0
- package/dist/daemon/spawn.js +205 -0
- package/dist/daemon/spawn.js.map +1 -0
- package/dist/daemon/state.d.ts +145 -0
- package/dist/daemon/state.d.ts.map +1 -0
- package/dist/daemon/state.js +454 -0
- package/dist/daemon/state.js.map +1 -0
- package/dist/daemon/theme-push.d.ts +23 -0
- package/dist/daemon/theme-push.d.ts.map +1 -0
- package/dist/daemon/theme-push.js +30 -0
- package/dist/daemon/theme-push.js.map +1 -0
- package/dist/daemon/viewer-feed.d.ts +42 -0
- package/dist/daemon/viewer-feed.d.ts.map +1 -0
- package/dist/daemon/viewer-feed.js +138 -0
- package/dist/daemon/viewer-feed.js.map +1 -0
- package/dist/daemon/workspace-directory.d.ts +35 -0
- package/dist/daemon/workspace-directory.d.ts.map +1 -0
- package/dist/daemon/workspace-directory.js +105 -0
- package/dist/daemon/workspace-directory.js.map +1 -0
- package/dist/daemon/workspace-streams.d.ts +70 -0
- package/dist/daemon/workspace-streams.d.ts.map +1 -0
- package/dist/daemon/workspace-streams.js +289 -0
- package/dist/daemon/workspace-streams.js.map +1 -0
- package/dist/daemon/worktree-manager.d.ts +219 -0
- package/dist/daemon/worktree-manager.d.ts.map +1 -0
- package/dist/daemon/worktree-manager.js +1204 -0
- package/dist/daemon/worktree-manager.js.map +1 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +57 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +12 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +773 -0
- package/dist/main.js.map +1 -0
- package/dist/mcp-cli.d.ts +6 -0
- package/dist/mcp-cli.d.ts.map +1 -0
- package/dist/mcp-cli.js +347 -0
- package/dist/mcp-cli.js.map +1 -0
- package/dist/migrations.d.ts +33 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +281 -0
- package/dist/migrations.js.map +1 -0
- package/dist/modes/index.d.ts +13 -0
- package/dist/modes/index.d.ts.map +1 -0
- package/dist/modes/index.js +12 -0
- package/dist/modes/index.js.map +1 -0
- package/dist/modes/interactive/components/armin.d.ts +34 -0
- package/dist/modes/interactive/components/armin.d.ts.map +1 -0
- package/dist/modes/interactive/components/armin.js +333 -0
- package/dist/modes/interactive/components/armin.js.map +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +22 -0
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/assistant-message.js +129 -0
- package/dist/modes/interactive/components/assistant-message.js.map +1 -0
- package/dist/modes/interactive/components/bash-execution.d.ts +39 -0
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/bash-execution.js +212 -0
- package/dist/modes/interactive/components/bash-execution.js.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts +17 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.js +57 -0
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.js +44 -0
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.js +45 -0
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/config-selector.d.ts +71 -0
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/config-selector.js +510 -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 +21 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-editor.js +70 -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 +76 -0
- package/dist/modes/interactive/components/custom-message.js.map +1 -0
- package/dist/modes/interactive/components/daxnuts.d.ts +23 -0
- package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -0
- package/dist/modes/interactive/components/daxnuts.js +140 -0
- package/dist/modes/interactive/components/daxnuts.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 +133 -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 +20 -0
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-editor.js +116 -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 +27 -0
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-selector.js +98 -0
- package/dist/modes/interactive/components/extension-selector.js.map +1 -0
- package/dist/modes/interactive/components/first-time-setup.d.ts +25 -0
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -0
- package/dist/modes/interactive/components/first-time-setup.js +103 -0
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -0
- package/dist/modes/interactive/components/footer.d.ts +27 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -0
- package/dist/modes/interactive/components/footer.js +180 -0
- package/dist/modes/interactive/components/footer.js.map +1 -0
- package/dist/modes/interactive/components/hotkeys.d.ts +24 -0
- package/dist/modes/interactive/components/hotkeys.d.ts.map +1 -0
- package/dist/modes/interactive/components/hotkeys.js +97 -0
- package/dist/modes/interactive/components/hotkeys.js.map +1 -0
- package/dist/modes/interactive/components/index.d.ts +35 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -0
- package/dist/modes/interactive/components/index.js +36 -0
- package/dist/modes/interactive/components/index.js.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts +19 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.js +48 -0
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
- package/dist/modes/interactive/components/login-dialog.d.ts +52 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
- package/dist/modes/interactive/components/login-dialog.js +179 -0
- package/dist/modes/interactive/components/login-dialog.js.map +1 -0
- package/dist/modes/interactive/components/logo.d.ts +25 -0
- package/dist/modes/interactive/components/logo.d.ts.map +1 -0
- package/dist/modes/interactive/components/logo.js +89 -0
- package/dist/modes/interactive/components/logo.js.map +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts +47 -0
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/model-selector.js +278 -0
- package/dist/modes/interactive/components/model-selector.js.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts +31 -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/remote-control-center.d.ts +110 -0
- package/dist/modes/interactive/components/remote-control-center.d.ts.map +1 -0
- package/dist/modes/interactive/components/remote-control-center.js +1217 -0
- package/dist/modes/interactive/components/remote-control-center.js.map +1 -0
- package/dist/modes/interactive/components/review-tools-selector.d.ts +24 -0
- package/dist/modes/interactive/components/review-tools-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/review-tools-selector.js +93 -0
- package/dist/modes/interactive/components/review-tools-selector.js.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +42 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.js +290 -0
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.js +155 -0
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -0
- package/dist/modes/interactive/components/session-selector.d.ts +95 -0
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector.js +856 -0
- package/dist/modes/interactive/components/session-selector.js.map +1 -0
- package/dist/modes/interactive/components/settings-selector.d.ts +77 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/settings-selector.js +484 -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 +17 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.js +47 -0
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
- package/dist/modes/interactive/components/streaming-render-coalescer.d.ts +29 -0
- package/dist/modes/interactive/components/streaming-render-coalescer.d.ts.map +1 -0
- package/dist/modes/interactive/components/streaming-render-coalescer.js +98 -0
- package/dist/modes/interactive/components/streaming-render-coalescer.js.map +1 -0
- package/dist/modes/interactive/components/subagent-inspector.d.ts +32 -0
- package/dist/modes/interactive/components/subagent-inspector.d.ts.map +1 -0
- package/dist/modes/interactive/components/subagent-inspector.js +439 -0
- package/dist/modes/interactive/components/subagent-inspector.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 +52 -0
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -0
- package/dist/modes/interactive/components/tool-execution.d.ts +83 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/tool-execution.js +421 -0
- package/dist/modes/interactive/components/tool-execution.js.map +1 -0
- package/dist/modes/interactive/components/tree-selector.d.ts +89 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/tree-selector.js +1208 -0
- package/dist/modes/interactive/components/tree-selector.js.map +1 -0
- package/dist/modes/interactive/components/trust-selector.d.ts +23 -0
- package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/trust-selector.js +91 -0
- package/dist/modes/interactive/components/trust-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 +9 -0
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message.js +42 -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/components/volt-announcement.d.ts +5 -0
- package/dist/modes/interactive/components/volt-announcement.d.ts.map +1 -0
- package/dist/modes/interactive/components/volt-announcement.js +15 -0
- package/dist/modes/interactive/components/volt-announcement.js.map +1 -0
- package/dist/modes/interactive/daemon-attach.d.ts +154 -0
- package/dist/modes/interactive/daemon-attach.d.ts.map +1 -0
- package/dist/modes/interactive/daemon-attach.js +552 -0
- package/dist/modes/interactive/daemon-attach.js.map +1 -0
- package/dist/modes/interactive/drain-viewer.d.ts +31 -0
- package/dist/modes/interactive/drain-viewer.d.ts.map +1 -0
- package/dist/modes/interactive/drain-viewer.js +166 -0
- package/dist/modes/interactive/drain-viewer.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +502 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-mode.js +7007 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -0
- package/dist/modes/interactive/prompt-image-attachments.d.ts +34 -0
- package/dist/modes/interactive/prompt-image-attachments.d.ts.map +1 -0
- package/dist/modes/interactive/prompt-image-attachments.js +120 -0
- package/dist/modes/interactive/prompt-image-attachments.js.map +1 -0
- package/dist/modes/interactive/relay-stream-adapter.d.ts +19 -0
- package/dist/modes/interactive/relay-stream-adapter.d.ts.map +1 -0
- package/dist/modes/interactive/relay-stream-adapter.js +107 -0
- package/dist/modes/interactive/relay-stream-adapter.js.map +1 -0
- package/dist/modes/print-mode.d.ts +28 -0
- package/dist/modes/print-mode.d.ts.map +1 -0
- package/dist/modes/print-mode.js +132 -0
- package/dist/modes/print-mode.js.map +1 -0
- package/dist/modes/rpc/in-process-rpc-client.d.ts +31 -0
- package/dist/modes/rpc/in-process-rpc-client.d.ts.map +1 -0
- package/dist/modes/rpc/in-process-rpc-client.js +63 -0
- package/dist/modes/rpc/in-process-rpc-client.js.map +1 -0
- package/dist/modes/rpc/iroh-remote-agent-runtime.d.ts +61 -0
- package/dist/modes/rpc/iroh-remote-agent-runtime.d.ts.map +1 -0
- package/dist/modes/rpc/iroh-remote-agent-runtime.js +155 -0
- package/dist/modes/rpc/iroh-remote-agent-runtime.js.map +1 -0
- package/dist/modes/rpc/iroh-remote-rpc-mode.d.ts +69 -0
- package/dist/modes/rpc/iroh-remote-rpc-mode.d.ts.map +1 -0
- package/dist/modes/rpc/iroh-remote-rpc-mode.js +1223 -0
- package/dist/modes/rpc/iroh-remote-rpc-mode.js.map +1 -0
- package/dist/modes/rpc/jsonl.d.ts +2 -0
- package/dist/modes/rpc/jsonl.d.ts.map +1 -0
- package/dist/modes/rpc/jsonl.js +2 -0
- package/dist/modes/rpc/jsonl.js.map +1 -0
- package/dist/modes/rpc/rpc-client-base.d.ts +209 -0
- package/dist/modes/rpc/rpc-client-base.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-client-base.js +530 -0
- package/dist/modes/rpc/rpc-client-base.js.map +1 -0
- package/dist/modes/rpc/rpc-client.d.ts +50 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-client.js +190 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -0
- package/dist/modes/rpc/rpc-command-dispatcher.d.ts +43 -0
- package/dist/modes/rpc/rpc-command-dispatcher.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-command-dispatcher.js +613 -0
- package/dist/modes/rpc/rpc-command-dispatcher.js.map +1 -0
- package/dist/modes/rpc/rpc-command-validation.d.ts +2 -0
- package/dist/modes/rpc/rpc-command-validation.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-command-validation.js +207 -0
- package/dist/modes/rpc/rpc-command-validation.js.map +1 -0
- package/dist/modes/rpc/rpc-mode.d.ts +48 -0
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-mode.js +1089 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -0
- package/dist/modes/rpc/rpc-transport-client.d.ts +26 -0
- package/dist/modes/rpc/rpc-transport-client.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-transport-client.js +76 -0
- package/dist/modes/rpc/rpc-transport-client.js.map +1 -0
- package/dist/modes/rpc/rpc-types.d.ts +2 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-types.js +2 -0
- package/dist/modes/rpc/rpc-types.js.map +1 -0
- package/dist/package-manager-cli.d.ts +28 -0
- package/dist/package-manager-cli.d.ts.map +1 -0
- package/dist/package-manager-cli.js +667 -0
- package/dist/package-manager-cli.js.map +1 -0
- package/dist/remote/integrated-runtime-retention.d.ts +17 -0
- package/dist/remote/integrated-runtime-retention.d.ts.map +1 -0
- package/dist/remote/integrated-runtime-retention.js +62 -0
- package/dist/remote/integrated-runtime-retention.js.map +1 -0
- package/dist/remote/iroh-native-adapter.cjs +19 -0
- package/dist/sea/cli.d.ts +4 -0
- package/dist/sea/cli.d.ts.map +1 -0
- package/dist/sea/cli.js +4 -0
- package/dist/sea/cli.js.map +1 -0
- package/dist/sea/register-bedrock.d.ts +2 -0
- package/dist/sea/register-bedrock.d.ts.map +1 -0
- package/dist/sea/register-bedrock.js +4 -0
- package/dist/sea/register-bedrock.js.map +1 -0
- package/dist/store/catalog.d.ts +57 -0
- package/dist/store/catalog.d.ts.map +1 -0
- package/dist/store/catalog.js +331 -0
- package/dist/store/catalog.js.map +1 -0
- package/dist/store/inspector.d.ts +36 -0
- package/dist/store/inspector.d.ts.map +1 -0
- package/dist/store/inspector.js +578 -0
- package/dist/store/inspector.js.map +1 -0
- package/dist/store/install-plan.d.ts +26 -0
- package/dist/store/install-plan.d.ts.map +1 -0
- package/dist/store/install-plan.js +80 -0
- package/dist/store/install-plan.js.map +1 -0
- package/dist/store/render.d.ts +11 -0
- package/dist/store/render.d.ts.map +1 -0
- package/dist/store/render.js +153 -0
- package/dist/store/render.js.map +1 -0
- package/dist/store/resolver.d.ts +22 -0
- package/dist/store/resolver.d.ts.map +1 -0
- package/dist/store/resolver.js +207 -0
- package/dist/store/resolver.js.map +1 -0
- package/dist/store/store-cli.d.ts +7 -0
- package/dist/store/store-cli.d.ts.map +1 -0
- package/dist/store/store-cli.js +636 -0
- package/dist/store/store-cli.js.map +1 -0
- package/dist/store/targets.d.ts +21 -0
- package/dist/store/targets.d.ts.map +1 -0
- package/dist/store/targets.js +55 -0
- package/dist/store/targets.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 +52 -0
- package/dist/utils/ansi.js.map +1 -0
- package/dist/utils/changelog.d.ts +22 -0
- package/dist/utils/changelog.d.ts.map +1 -0
- package/dist/utils/changelog.js +165 -0
- package/dist/utils/changelog.js.map +1 -0
- package/dist/utils/child-process.d.ts +18 -0
- package/dist/utils/child-process.d.ts.map +1 -0
- package/dist/utils/child-process.js +106 -0
- package/dist/utils/child-process.js.map +1 -0
- package/dist/utils/clipboard-image.d.ts +11 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -0
- package/dist/utils/clipboard-image.js +245 -0
- package/dist/utils/clipboard-image.js.map +1 -0
- package/dist/utils/clipboard.d.ts +2 -0
- package/dist/utils/clipboard.d.ts.map +1 -0
- package/dist/utils/clipboard.js +94 -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/durable-atomic-write.d.ts +46 -0
- package/dist/utils/durable-atomic-write.d.ts.map +1 -0
- package/dist/utils/durable-atomic-write.js +104 -0
- package/dist/utils/durable-atomic-write.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 +26 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +195 -0
- package/dist/utils/git.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/ignore-files.d.ts +5 -0
- package/dist/utils/ignore-files.d.ts.map +1 -0
- package/dist/utils/ignore-files.js +58 -0
- package/dist/utils/ignore-files.js.map +1 -0
- package/dist/utils/image-codec.d.ts +22 -0
- package/dist/utils/image-codec.d.ts.map +1 -0
- package/dist/utils/image-codec.js +35 -0
- package/dist/utils/image-codec.js.map +1 -0
- package/dist/utils/image-convert.d.ts +9 -0
- package/dist/utils/image-convert.d.ts.map +1 -0
- package/dist/utils/image-convert.js +26 -0
- package/dist/utils/image-convert.js.map +1 -0
- package/dist/utils/image-resize-core.d.ts +31 -0
- package/dist/utils/image-resize-core.d.ts.map +1 -0
- package/dist/utils/image-resize-core.js +181 -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 +15 -0
- package/dist/utils/image-resize.d.ts.map +1 -0
- package/dist/utils/image-resize.js +92 -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 +69 -0
- package/dist/utils/mime.js.map +1 -0
- package/dist/utils/npm-spec.d.ts +9 -0
- package/dist/utils/npm-spec.d.ts.map +1 -0
- package/dist/utils/npm-spec.js +15 -0
- package/dist/utils/npm-spec.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 +92 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/private-files.d.ts +21 -0
- package/dist/utils/private-files.d.ts.map +1 -0
- package/dist/utils/private-files.js +103 -0
- package/dist/utils/private-files.js.map +1 -0
- package/dist/utils/process-env.d.ts +2 -0
- package/dist/utils/process-env.d.ts.map +1 -0
- package/dist/utils/process-env.js +31 -0
- package/dist/utils/process-env.js.map +1 -0
- package/dist/utils/shell.d.ts +30 -0
- package/dist/utils/shell.d.ts.map +1 -0
- package/dist/utils/shell.js +195 -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 +18 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -0
- package/dist/utils/syntax-highlight.js +139 -0
- package/dist/utils/syntax-highlight.js.map +1 -0
- package/dist/utils/tools-manager.d.ts +3 -0
- package/dist/utils/tools-manager.d.ts.map +1 -0
- package/dist/utils/tools-manager.js +328 -0
- package/dist/utils/tools-manager.js.map +1 -0
- package/dist/utils/version-check.d.ts +15 -0
- package/dist/utils/version-check.d.ts.map +1 -0
- package/dist/utils/version-check.js +61 -0
- package/dist/utils/version-check.js.map +1 -0
- package/dist/utils/volt-user-agent.d.ts +2 -0
- package/dist/utils/volt-user-agent.d.ts.map +1 -0
- package/dist/utils/volt-user-agent.js +5 -0
- package/dist/utils/volt-user-agent.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 +394 -0
- package/docs/containerization.md +111 -0
- package/docs/custom-provider.md +737 -0
- package/docs/daemon.md +190 -0
- package/docs/development.md +70 -0
- package/docs/docs.json +176 -0
- package/docs/extensions.md +2692 -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 +82 -0
- package/docs/iroh-remote-access-design.md +340 -0
- package/docs/iroh-remote-protocol.md +431 -0
- package/docs/json.md +87 -0
- package/docs/keybindings.md +200 -0
- package/docs/live-shared-session-daemon-design.md +1090 -0
- package/docs/lsp.md +143 -0
- package/docs/mcp.md +1044 -0
- package/docs/models.md +495 -0
- package/docs/packages.md +230 -0
- package/docs/prompt-templates.md +108 -0
- package/docs/providers.md +274 -0
- package/docs/quickstart.md +165 -0
- package/docs/rpc.md +2050 -0
- package/docs/sdk.md +1267 -0
- package/docs/security.md +139 -0
- package/docs/session-format.md +412 -0
- package/docs/sessions.md +145 -0
- package/docs/settings.md +371 -0
- package/docs/shell-aliases.md +13 -0
- package/docs/skills.md +243 -0
- package/docs/subagents-design.md +419 -0
- package/docs/terminal-setup.md +148 -0
- package/docs/termux.md +127 -0
- package/docs/themes.md +295 -0
- package/docs/tla/ClientAuth.cfg +16 -0
- package/docs/tla/ClientAuth.tla +205 -0
- package/docs/tla/ClientConn.cfg +16 -0
- package/docs/tla/ClientConn.tla +265 -0
- package/docs/tla/LeaseBroker.cfg +43 -0
- package/docs/tla/LeaseBroker.tla +563 -0
- package/docs/tla/PLAN.md +240 -0
- package/docs/tla/PushOrdering.cfg +17 -0
- package/docs/tla/PushOrdering.tla +183 -0
- package/docs/tla/README.md +205 -0
- package/docs/tla/RelayViewer.cfg +26 -0
- package/docs/tla/RelayViewer.tla +299 -0
- package/docs/tla/SessionTarget.cfg +18 -0
- package/docs/tla/SessionTarget.tla +192 -0
- package/docs/tla/check.sh +34 -0
- package/docs/tmux.md +63 -0
- package/docs/tui.md +949 -0
- package/docs/usage.md +482 -0
- package/docs/windows.md +17 -0
- package/docs/worktrees-design.md +605 -0
- package/examples/README.md +28 -0
- package/examples/extensions/README.md +211 -0
- package/examples/extensions/auto-commit-on-exit.ts +49 -0
- package/examples/extensions/bash-spawn-hook.ts +30 -0
- package/examples/extensions/bookmark.ts +50 -0
- package/examples/extensions/border-status-editor.ts +150 -0
- package/examples/extensions/built-in-tool-renderer.ts +249 -0
- package/examples/extensions/claude-rules.ts +86 -0
- package/examples/extensions/commands.ts +72 -0
- package/examples/extensions/confirm-destructive.ts +59 -0
- package/examples/extensions/custom-compaction.ts +127 -0
- package/examples/extensions/custom-footer.ts +64 -0
- package/examples/extensions/custom-header.ts +72 -0
- package/examples/extensions/custom-provider-anthropic/index.ts +604 -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 +400 -0
- package/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +82 -0
- package/examples/extensions/dirty-repo-guard.ts +56 -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 +15 -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 +115 -0
- package/examples/extensions/github-issue-autocomplete.ts +185 -0
- package/examples/extensions/gondolin/index.ts +531 -0
- package/examples/extensions/gondolin/package-lock.json +185 -0
- package/examples/extensions/gondolin/package.json +19 -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 +94 -0
- package/examples/extensions/input-transform-streaming.ts +39 -0
- package/examples/extensions/input-transform.ts +43 -0
- package/examples/extensions/interactive-shell.ts +196 -0
- package/examples/extensions/mac-system-theme.ts +47 -0
- package/examples/extensions/message-renderer.ts +59 -0
- package/examples/extensions/minimal-mode.ts +426 -0
- package/examples/extensions/modal-editor.ts +85 -0
- package/examples/extensions/model-status.ts +31 -0
- package/examples/extensions/notify.ts +55 -0
- package/examples/extensions/overlay-qa-tests.ts +1450 -0
- package/examples/extensions/overlay-test.ts +153 -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 +340 -0
- package/examples/extensions/plan-mode/utils.ts +168 -0
- package/examples/extensions/preset.ts +436 -0
- package/examples/extensions/project-trust.ts +64 -0
- package/examples/extensions/prompt-customizer.ts +97 -0
- package/examples/extensions/protected-paths.ts +30 -0
- package/examples/extensions/provider-payload.ts +18 -0
- package/examples/extensions/qna.ts +122 -0
- package/examples/extensions/question.ts +277 -0
- package/examples/extensions/questionnaire.ts +440 -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 +321 -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 +343 -0
- package/examples/extensions/space-invaders.ts +560 -0
- package/examples/extensions/ssh.ts +220 -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 +1009 -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 +206 -0
- package/examples/extensions/system-prompt-header.ts +17 -0
- package/examples/extensions/tic-tac-toe.ts +1008 -0
- package/examples/extensions/timed-confirm.ts +70 -0
- package/examples/extensions/titlebar-spinner.ts +58 -0
- package/examples/extensions/todo.ts +297 -0
- package/examples/extensions/tool-override.ts +144 -0
- package/examples/extensions/tools.ts +146 -0
- package/examples/extensions/trigger-compact.ts +50 -0
- package/examples/extensions/truncated-tool.ts +195 -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/firebase-push-relay/README.md +79 -0
- package/examples/remote/firebase-push-relay/firebase.json +12 -0
- package/examples/remote/firebase-push-relay/firestore.indexes.json +11 -0
- package/examples/remote/firebase-push-relay/firestore.rules +9 -0
- package/examples/remote/firebase-push-relay/functions/core.js +511 -0
- package/examples/remote/firebase-push-relay/functions/core.test.js +273 -0
- package/examples/remote/firebase-push-relay/functions/index.js +413 -0
- package/examples/remote/firebase-push-relay/functions/package-lock.json +2974 -0
- package/examples/remote/firebase-push-relay/functions/package.json +18 -0
- package/examples/remote/iroh-sidecar/README.md +211 -0
- package/examples/remote/iroh-sidecar/client.mjs +554 -0
- package/examples/remote/iroh-sidecar/common.mjs +195 -0
- package/examples/remote/iroh-sidecar/host.mjs +4 -0
- package/examples/remote/iroh-sidecar/package-lock.json +213 -0
- package/examples/remote/iroh-sidecar/package.json +13 -0
- package/examples/remote/iroh-sidecar/source-aware-run.mjs +41 -0
- package/examples/rpc-extension-ui.ts +632 -0
- package/examples/sdk/01-minimal.ts +26 -0
- package/examples/sdk/02-custom-model.ts +53 -0
- package/examples/sdk/03-custom-prompt.ts +70 -0
- package/examples/sdk/04-skills.ts +55 -0
- package/examples/sdk/05-tools.ts +48 -0
- package/examples/sdk/06-extensions.ts +94 -0
- package/examples/sdk/07-context-files.ts +42 -0
- package/examples/sdk/08-prompt-templates.ts +51 -0
- package/examples/sdk/09-api-keys-and-oauth.ts +52 -0
- package/examples/sdk/10-settings.ts +53 -0
- package/examples/sdk/11-sessions.ts +52 -0
- package/examples/sdk/12-full-control.ts +78 -0
- package/examples/sdk/13-session-runtime.ts +67 -0
- package/examples/sdk/README.md +147 -0
- package/npm-shrinkwrap.json +3442 -0
- package/package.json +125 -19
|
@@ -0,0 +1,1204 @@
|
|
|
1
|
+
import { createHash, randomInt } from "node:crypto";
|
|
2
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
3
|
+
import { mkdir, readdir, realpath, rename } from "node:fs/promises";
|
|
4
|
+
import { basename, dirname, isAbsolute, join, posix, relative, resolve, sep } from "node:path";
|
|
5
|
+
import { IROH_REMOTE_WORKTREE_ID_PATTERN } from "../core/remote/iroh/protocol.js";
|
|
6
|
+
import { isIrohRemoteWorktreeParentWorkspaceNotFoundError, isIrohRemoteWorktreePersistenceError, } from "../core/remote/iroh/state-manager.js";
|
|
7
|
+
import { spawnProcess, waitForChildProcess } from "../utils/child-process.js";
|
|
8
|
+
import { resolveWorkspaceDirectory } from "./workspace-directory.js";
|
|
9
|
+
/** join(agentDir, "worktrees") — sibling of sessions/, daemon/, trust.json. */
|
|
10
|
+
export function getWorktreesRoot(agentDir) {
|
|
11
|
+
return join(resolve(agentDir), "worktrees");
|
|
12
|
+
}
|
|
13
|
+
export const WORKTREE_ID_PATTERN = IROH_REMOTE_WORKTREE_ID_PATTERN;
|
|
14
|
+
/**
|
|
15
|
+
* Encode a workspace path into the per-workspace worktrees directory segment,
|
|
16
|
+
* reusing the `--<encoded-cwd>--` scheme from the session dirs so the layout
|
|
17
|
+
* survives workspace renames. Long encodings are shortened with a hash suffix
|
|
18
|
+
* to stay clear of Windows MAX_PATH limits.
|
|
19
|
+
*/
|
|
20
|
+
function getWorkspaceWorktreesSegment(workspacePath) {
|
|
21
|
+
const encoded = resolve(workspacePath)
|
|
22
|
+
.replace(/^[/\\]/, "")
|
|
23
|
+
.replace(/[/\\:]/g, "-");
|
|
24
|
+
if (encoded.length <= 80) {
|
|
25
|
+
return `--${encoded}--`;
|
|
26
|
+
}
|
|
27
|
+
const digest = createHash("sha1").update(encoded).digest("hex").slice(0, 8);
|
|
28
|
+
return `--${encoded.slice(0, 72)}-${digest}--`;
|
|
29
|
+
}
|
|
30
|
+
/** Per-workspace directory holding that workspace's worktree checkouts. */
|
|
31
|
+
export function getWorkspaceWorktreesDir(agentDir, workspacePath) {
|
|
32
|
+
return join(getWorktreesRoot(agentDir), getWorkspaceWorktreesSegment(workspacePath));
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Deterministic checkout path; the ONLY producer of checkout paths. Validates
|
|
36
|
+
* the id and asserts the resolved path stays under the worktrees root — never
|
|
37
|
+
* accepts a caller-supplied path.
|
|
38
|
+
*/
|
|
39
|
+
export function getWorktreeCheckoutPath(agentDir, workspacePath, worktreeId) {
|
|
40
|
+
if (!WORKTREE_ID_PATTERN.test(worktreeId)) {
|
|
41
|
+
throw new Error(`invalid worktree id: ${worktreeId}`);
|
|
42
|
+
}
|
|
43
|
+
const root = resolve(getWorktreesRoot(agentDir));
|
|
44
|
+
const checkoutPath = resolve(join(getWorkspaceWorktreesDir(agentDir, workspacePath), worktreeId));
|
|
45
|
+
const rootPrefix = `${root}${sep}`;
|
|
46
|
+
const contained = process.platform === "win32"
|
|
47
|
+
? checkoutPath.toLowerCase().startsWith(rootPrefix.toLowerCase())
|
|
48
|
+
: checkoutPath.startsWith(rootPrefix);
|
|
49
|
+
if (!contained) {
|
|
50
|
+
throw new Error("worktree checkout path escapes the worktrees root");
|
|
51
|
+
}
|
|
52
|
+
return checkoutPath;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Convert a path relative to a daemon-managed worktree checkout back into the
|
|
56
|
+
* registered-workspace-relative path used on the remote protocol. Nested repo
|
|
57
|
+
* worktrees store sourceRootRelativePath (e.g. `Volt`), so a worktree cwd of
|
|
58
|
+
* `packages/coding-agent` displays as `Volt/packages/coding-agent`.
|
|
59
|
+
*/
|
|
60
|
+
export function getRegisteredWorkingDirectoryForWorktree(worktree, worktreeRelativePath) {
|
|
61
|
+
if (worktree.sourceRootRelativePath === undefined) {
|
|
62
|
+
return worktreeRelativePath;
|
|
63
|
+
}
|
|
64
|
+
return worktreeRelativePath === undefined
|
|
65
|
+
? worktree.sourceRootRelativePath
|
|
66
|
+
: posix.join(worktree.sourceRootRelativePath, worktreeRelativePath);
|
|
67
|
+
}
|
|
68
|
+
/** win32-aware "path is inside root" prefix check on resolved paths. */
|
|
69
|
+
function isPathContained(root, path) {
|
|
70
|
+
const resolvedRoot = resolve(root);
|
|
71
|
+
const resolvedPath = resolve(path);
|
|
72
|
+
const rootPrefix = `${resolvedRoot}${sep}`;
|
|
73
|
+
if (process.platform === "win32") {
|
|
74
|
+
const lowerPath = resolvedPath.toLowerCase();
|
|
75
|
+
return lowerPath === resolvedRoot.toLowerCase() || lowerPath.startsWith(rootPrefix.toLowerCase());
|
|
76
|
+
}
|
|
77
|
+
return resolvedPath === resolvedRoot || resolvedPath.startsWith(rootPrefix);
|
|
78
|
+
}
|
|
79
|
+
/** True when path is inside the daemon's worktrees root (a daemon-managed checkout or below). */
|
|
80
|
+
export function isPathUnderWorktreesRoot(agentDir, path) {
|
|
81
|
+
const root = resolve(getWorktreesRoot(agentDir));
|
|
82
|
+
const resolved = resolve(path);
|
|
83
|
+
return resolved !== root && isPathContained(root, resolved);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Resolve the PARENT checkout of a daemon-managed worktree from the checkout's
|
|
87
|
+
* `.git` gitdir pointer (`gitdir: <parent>/.git/worktrees/<id>`), without a
|
|
88
|
+
* daemon round-trip or a git subprocess. Returns undefined when the path is
|
|
89
|
+
* not under the worktrees root or the pointer cannot be parsed. Used by the
|
|
90
|
+
* TUI to pin trust decisions to the parent workspace path — trust entries are
|
|
91
|
+
* never prompted for or persisted on worktree paths (design §5.1.9/§5.2.1).
|
|
92
|
+
*/
|
|
93
|
+
export function resolveWorktreeParentCheckout(agentDir, path) {
|
|
94
|
+
if (!isPathUnderWorktreesRoot(agentDir, path)) {
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
const root = resolve(getWorktreesRoot(agentDir));
|
|
98
|
+
const relativeSegments = resolve(path)
|
|
99
|
+
.slice(root.length + 1)
|
|
100
|
+
.split(sep)
|
|
101
|
+
.filter((segment) => segment.length > 0);
|
|
102
|
+
if (relativeSegments.length < 2) {
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
// Layout: <root>/<encoded-workspace-segment>/<worktreeId>/...
|
|
106
|
+
const checkoutPath = join(root, relativeSegments[0] ?? "", relativeSegments[1] ?? "");
|
|
107
|
+
let gitFileContents;
|
|
108
|
+
try {
|
|
109
|
+
gitFileContents = readFileSync(join(checkoutPath, ".git"), "utf8");
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
return undefined;
|
|
113
|
+
}
|
|
114
|
+
const match = gitFileContents.match(/^gitdir:\s*(.+)\s*$/m);
|
|
115
|
+
if (!match?.[1]) {
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
const gitDir = match[1].trim();
|
|
119
|
+
if (!isAbsolute(gitDir)) {
|
|
120
|
+
return undefined;
|
|
121
|
+
}
|
|
122
|
+
// gitDir is <parent>/.git/worktrees/<name>; the parent checkout is three levels up.
|
|
123
|
+
const worktreesDir = dirname(resolve(gitDir));
|
|
124
|
+
const dotGitDir = dirname(worktreesDir);
|
|
125
|
+
if (worktreesDir.split(sep).pop() !== "worktrees" || dotGitDir.split(sep).pop() !== ".git") {
|
|
126
|
+
return undefined;
|
|
127
|
+
}
|
|
128
|
+
return dirname(dotGitDir);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Gate a worktree-bound conversation relay: the checkout must exist and the
|
|
132
|
+
* owning TUI must have advertised the worktrees control capability. Old TUIs
|
|
133
|
+
* (no capability) are never offered worktree-session relays (design §5.2.3).
|
|
134
|
+
*/
|
|
135
|
+
export function evaluateWorktreeRelayGate(worktree, tuiCapabilities, worktreesCapability) {
|
|
136
|
+
if (worktree === undefined) {
|
|
137
|
+
return { ok: true };
|
|
138
|
+
}
|
|
139
|
+
if (!existsSync(worktree.path)) {
|
|
140
|
+
return { ok: false, reason: "checkout_missing" };
|
|
141
|
+
}
|
|
142
|
+
if (tuiCapabilities === undefined || !tuiCapabilities.has(worktreesCapability)) {
|
|
143
|
+
return { ok: false, reason: "tui_not_capable" };
|
|
144
|
+
}
|
|
145
|
+
return { ok: true };
|
|
146
|
+
}
|
|
147
|
+
const DEFAULT_MAX_WORKTREES_PER_WORKSPACE = 16;
|
|
148
|
+
const SLUG_ADJECTIVES = ["amber", "brisk", "calm", "dusky", "eager", "fresh", "keen", "lucid", "quiet", "swift"];
|
|
149
|
+
const SLUG_NOUNS = ["basin", "cedar", "delta", "ember", "grove", "harbor", "mesa", "ridge", "summit", "vale"];
|
|
150
|
+
function generateWorktreeIdSlug() {
|
|
151
|
+
const adjective = SLUG_ADJECTIVES[randomInt(SLUG_ADJECTIVES.length)];
|
|
152
|
+
const noun = SLUG_NOUNS[randomInt(SLUG_NOUNS.length)];
|
|
153
|
+
return `${adjective}-${noun}-${String(randomInt(100)).padStart(2, "0")}`;
|
|
154
|
+
}
|
|
155
|
+
/** Default runner: no shell, argv only, captured stdio. */
|
|
156
|
+
export function createDefaultWorktreeGitRunner() {
|
|
157
|
+
return async (args, cwd) => {
|
|
158
|
+
try {
|
|
159
|
+
const child = spawnProcess("git", args, { cwd, stdio: ["ignore", "pipe", "pipe"] });
|
|
160
|
+
let stdout = "";
|
|
161
|
+
let stderr = "";
|
|
162
|
+
child.stdout?.setEncoding("utf8");
|
|
163
|
+
child.stderr?.setEncoding("utf8");
|
|
164
|
+
child.stdout?.on("data", (chunk) => {
|
|
165
|
+
stdout += chunk;
|
|
166
|
+
});
|
|
167
|
+
child.stderr?.on("data", (chunk) => {
|
|
168
|
+
stderr += chunk;
|
|
169
|
+
});
|
|
170
|
+
const code = await waitForChildProcess(child);
|
|
171
|
+
return { ok: code === 0, code, stdout, stderr };
|
|
172
|
+
}
|
|
173
|
+
catch (error) {
|
|
174
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
175
|
+
const detail = message.includes("ENOENT") ? "git not found on daemon PATH; see docs/daemon.md" : message;
|
|
176
|
+
return { ok: false, code: null, stdout: "", stderr: detail };
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Basic `git check-ref-format`-equivalent syntax gate for branch/baseRef
|
|
182
|
+
* values. Rejects option injection (leading '-') and git-invalid ref
|
|
183
|
+
* sequences; values are always passed as separate argv entries.
|
|
184
|
+
*/
|
|
185
|
+
export function isValidGitRefSyntax(ref) {
|
|
186
|
+
if (ref.length === 0 || ref.length > 255 || ref.startsWith("-")) {
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
if (/[\s~^:?*[\\\x00-\x1f\x7f]/.test(ref)) {
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
if (ref.includes("..") || ref.includes("@{") || ref.includes("//")) {
|
|
193
|
+
return false;
|
|
194
|
+
}
|
|
195
|
+
if (ref.startsWith("/") || ref.endsWith("/") || ref.endsWith(".") || ref.endsWith(".lock")) {
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
198
|
+
return true;
|
|
199
|
+
}
|
|
200
|
+
export class WorktreeManager {
|
|
201
|
+
agentDir;
|
|
202
|
+
stateManager;
|
|
203
|
+
auditLogger;
|
|
204
|
+
runGit;
|
|
205
|
+
maxWorktreesPerWorkspace;
|
|
206
|
+
hasActiveRuntimeForSession;
|
|
207
|
+
flushState;
|
|
208
|
+
now;
|
|
209
|
+
constructor(options) {
|
|
210
|
+
this.agentDir = options.agentDir;
|
|
211
|
+
this.stateManager = options.stateManager;
|
|
212
|
+
this.auditLogger = options.auditLogger;
|
|
213
|
+
this.runGit = options.runGit ?? createDefaultWorktreeGitRunner();
|
|
214
|
+
this.maxWorktreesPerWorkspace = options.maxWorktreesPerWorkspace ?? DEFAULT_MAX_WORKTREES_PER_WORKSPACE;
|
|
215
|
+
this.hasActiveRuntimeForSession = options.hasActiveRuntimeForSession;
|
|
216
|
+
this.flushState = options.flushState;
|
|
217
|
+
this.now = options.now ?? Date.now;
|
|
218
|
+
}
|
|
219
|
+
/** git worktree add; persists the record durably after git succeeds. */
|
|
220
|
+
async create(workspace, options = {}) {
|
|
221
|
+
const id = options.id ?? generateWorktreeIdSlug();
|
|
222
|
+
if (!WORKTREE_ID_PATTERN.test(id)) {
|
|
223
|
+
return { ok: false, error: "invalid_worktree_id" };
|
|
224
|
+
}
|
|
225
|
+
const branch = options.branch ?? `volt/${id}`;
|
|
226
|
+
const baseRef = options.baseRef ?? "HEAD";
|
|
227
|
+
if (!isValidGitRefSyntax(branch)) {
|
|
228
|
+
return { ok: false, error: "git_failed", detail: "invalid branch ref syntax" };
|
|
229
|
+
}
|
|
230
|
+
if (!isValidGitRefSyntax(baseRef)) {
|
|
231
|
+
return { ok: false, error: "git_failed", detail: "invalid baseRef ref syntax" };
|
|
232
|
+
}
|
|
233
|
+
try {
|
|
234
|
+
const result = await this.stateManager.runWorkspaceWorktreeLifecycle(workspace.name, async ({ workspace: registeredWorkspace, worktrees: existing }) => {
|
|
235
|
+
if (existing.length >= this.maxWorktreesPerWorkspace) {
|
|
236
|
+
return { result: { ok: false, error: "worktree_limit_reached" } };
|
|
237
|
+
}
|
|
238
|
+
const checkoutPath = getWorktreeCheckoutPath(this.agentDir, registeredWorkspace.path, id);
|
|
239
|
+
if (existing.some((entry) => entry.id === id) || existsSync(checkoutPath)) {
|
|
240
|
+
return { result: { ok: false, error: "worktree_exists" } };
|
|
241
|
+
}
|
|
242
|
+
const source = await this.resolveCreateSource(registeredWorkspace, options.workingDirectory);
|
|
243
|
+
if (!source.ok) {
|
|
244
|
+
return { result: source };
|
|
245
|
+
}
|
|
246
|
+
const repoCheck = await this.runGit(["rev-parse", "--git-common-dir"], source.source.sourceRootPath);
|
|
247
|
+
if (!repoCheck.ok) {
|
|
248
|
+
return {
|
|
249
|
+
result: this.mapGitFailure(repoCheck.stderr, registeredWorkspace, checkoutPath, [
|
|
250
|
+
source.source.sourceRootPath,
|
|
251
|
+
]),
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
// Resolve a defaulted base to a concrete ref (the source checkout's branch,
|
|
255
|
+
// falling back to its commit sha) so merge-back guidance — aheadBehind,
|
|
256
|
+
// retention merge checks, `worktree diff` — has a stable base later.
|
|
257
|
+
const recordedBaseRef = options.baseRef ?? (await this.resolveDefaultBaseRef(source.source.sourceRootPath));
|
|
258
|
+
await mkdir(getWorkspaceWorktreesDir(this.agentDir, registeredWorkspace.path), {
|
|
259
|
+
recursive: true,
|
|
260
|
+
mode: 0o700,
|
|
261
|
+
});
|
|
262
|
+
const added = await this.runGit(["worktree", "add", checkoutPath, "-b", branch, baseRef], source.source.sourceRootPath);
|
|
263
|
+
if (!added.ok) {
|
|
264
|
+
return {
|
|
265
|
+
result: this.mapGitFailure(added.stderr, registeredWorkspace, checkoutPath, [
|
|
266
|
+
source.source.sourceRootPath,
|
|
267
|
+
]),
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
const worktree = {
|
|
271
|
+
id,
|
|
272
|
+
workspaceName: registeredWorkspace.name,
|
|
273
|
+
path: checkoutPath,
|
|
274
|
+
...(source.source.sourceRootRelativePath === undefined
|
|
275
|
+
? {}
|
|
276
|
+
: { sourceRootRelativePath: source.source.sourceRootRelativePath }),
|
|
277
|
+
branch,
|
|
278
|
+
...(recordedBaseRef === undefined ? {} : { baseRef: recordedBaseRef }),
|
|
279
|
+
createdAt: this.now(),
|
|
280
|
+
sessionIds: [],
|
|
281
|
+
};
|
|
282
|
+
return { result: { ok: true, worktree }, worktree };
|
|
283
|
+
});
|
|
284
|
+
if (result.ok) {
|
|
285
|
+
try {
|
|
286
|
+
await this.flushState?.();
|
|
287
|
+
}
|
|
288
|
+
catch {
|
|
289
|
+
return {
|
|
290
|
+
ok: false,
|
|
291
|
+
error: "git_failed",
|
|
292
|
+
detail: "worktree state could not be flushed; the checkout and daemon record were preserved",
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
return result;
|
|
297
|
+
}
|
|
298
|
+
catch (error) {
|
|
299
|
+
if (isIrohRemoteWorktreeParentWorkspaceNotFoundError(error)) {
|
|
300
|
+
return { ok: false, error: "worktree_source_unregistered" };
|
|
301
|
+
}
|
|
302
|
+
if (isIrohRemoteWorktreePersistenceError(error)) {
|
|
303
|
+
return {
|
|
304
|
+
ok: false,
|
|
305
|
+
error: "git_failed",
|
|
306
|
+
detail: "worktree state could not be persisted; the created checkout was preserved for recovery",
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
throw error;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
/** Adopt an existing git worktree checkout into daemon state; local control socket only. */
|
|
313
|
+
async adopt(workspace, options) {
|
|
314
|
+
const requestedPath = resolve(options.path);
|
|
315
|
+
if (options.id !== undefined && !WORKTREE_ID_PATTERN.test(options.id)) {
|
|
316
|
+
return { ok: false, error: "invalid_worktree_id" };
|
|
317
|
+
}
|
|
318
|
+
if (options.baseRef !== undefined && !isValidGitRefSyntax(options.baseRef)) {
|
|
319
|
+
return { ok: false, error: "git_failed", detail: "invalid baseRef ref syntax" };
|
|
320
|
+
}
|
|
321
|
+
if (!existsSync(requestedPath)) {
|
|
322
|
+
return { ok: false, error: "worktree_not_found", detail: "checkout path does not exist" };
|
|
323
|
+
}
|
|
324
|
+
try {
|
|
325
|
+
const result = await this.stateManager.runWorkspaceWorktreeLifecycle(workspace.name, async ({ workspace: registeredWorkspace, worktrees: existing }) => {
|
|
326
|
+
if (existing.length >= this.maxWorktreesPerWorkspace) {
|
|
327
|
+
return { result: { ok: false, error: "worktree_limit_reached" } };
|
|
328
|
+
}
|
|
329
|
+
const topLevel = await this.runGit(["rev-parse", "--show-toplevel"], requestedPath);
|
|
330
|
+
if (!topLevel.ok) {
|
|
331
|
+
return {
|
|
332
|
+
result: this.mapGitFailure(topLevel.stderr, registeredWorkspace, requestedPath, [requestedPath]),
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
const targetRootPath = await realpathOrResolve(topLevel.stdout.trim());
|
|
336
|
+
if (existing.some((entry) => entry.id === options.id || isSamePath(entry.path, targetRootPath))) {
|
|
337
|
+
return { result: { ok: false, error: "worktree_exists" } };
|
|
338
|
+
}
|
|
339
|
+
const id = options.id ?? deriveAdoptedWorktreeId(targetRootPath, new Set(existing.map((entry) => entry.id)));
|
|
340
|
+
if (!WORKTREE_ID_PATTERN.test(id)) {
|
|
341
|
+
return { result: { ok: false, error: "invalid_worktree_id" } };
|
|
342
|
+
}
|
|
343
|
+
const gitList = await this.runGit(["worktree", "list", "--porcelain"], targetRootPath);
|
|
344
|
+
if (!gitList.ok) {
|
|
345
|
+
return {
|
|
346
|
+
result: this.mapGitFailure(gitList.stderr, registeredWorkspace, targetRootPath, [
|
|
347
|
+
requestedPath,
|
|
348
|
+
targetRootPath,
|
|
349
|
+
]),
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
const entries = parseWorktreeListEntries(gitList.stdout);
|
|
353
|
+
const targetEntry = await findWorktreeListEntryByPath(entries, targetRootPath);
|
|
354
|
+
if (targetEntry === undefined) {
|
|
355
|
+
return {
|
|
356
|
+
result: {
|
|
357
|
+
ok: false,
|
|
358
|
+
error: "worktree_not_found",
|
|
359
|
+
detail: "checkout is not listed by git worktree",
|
|
360
|
+
},
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
const workspaceRootPath = await realpathOrResolve(registeredWorkspace.path);
|
|
364
|
+
const sourceRootPath = await findAdoptSourceRootPath(entries, workspaceRootPath, targetRootPath);
|
|
365
|
+
if (sourceRootPath === undefined) {
|
|
366
|
+
return {
|
|
367
|
+
result: {
|
|
368
|
+
ok: false,
|
|
369
|
+
error: "worktree_source_unregistered",
|
|
370
|
+
detail: "worktree source checkout is not inside the registered workspace",
|
|
371
|
+
},
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
const sourceRootRelativePath = await findWorkspaceRelativePathForRealpath(workspaceRootPath, undefined, sourceRootPath);
|
|
375
|
+
if (sourceRootRelativePath === null) {
|
|
376
|
+
return {
|
|
377
|
+
result: {
|
|
378
|
+
ok: false,
|
|
379
|
+
error: "worktree_source_unregistered",
|
|
380
|
+
detail: "worktree source checkout is not inside the registered workspace",
|
|
381
|
+
},
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
const branch = targetEntry.branch ?? targetEntry.detached ?? "HEAD";
|
|
385
|
+
if (!isValidGitRefSyntax(branch)) {
|
|
386
|
+
return {
|
|
387
|
+
result: { ok: false, error: "git_failed", detail: "invalid worktree branch ref syntax" },
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
const baseRef = options.baseRef ?? (await this.resolveDefaultBaseRef(sourceRootPath));
|
|
391
|
+
const worktree = {
|
|
392
|
+
id,
|
|
393
|
+
workspaceName: registeredWorkspace.name,
|
|
394
|
+
path: targetRootPath,
|
|
395
|
+
...(sourceRootRelativePath === undefined ? {} : { sourceRootRelativePath }),
|
|
396
|
+
branch,
|
|
397
|
+
...(baseRef === undefined ? {} : { baseRef }),
|
|
398
|
+
createdAt: this.now(),
|
|
399
|
+
sessionIds: [],
|
|
400
|
+
};
|
|
401
|
+
return { result: { ok: true, worktree }, worktree };
|
|
402
|
+
});
|
|
403
|
+
if (result.ok) {
|
|
404
|
+
try {
|
|
405
|
+
await this.flushState?.();
|
|
406
|
+
}
|
|
407
|
+
catch {
|
|
408
|
+
return {
|
|
409
|
+
ok: false,
|
|
410
|
+
error: "git_failed",
|
|
411
|
+
detail: "worktree state could not be flushed; the existing checkout and daemon record were preserved",
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
return result;
|
|
416
|
+
}
|
|
417
|
+
catch (error) {
|
|
418
|
+
if (isIrohRemoteWorktreeParentWorkspaceNotFoundError(error)) {
|
|
419
|
+
return { ok: false, error: "worktree_source_unregistered" };
|
|
420
|
+
}
|
|
421
|
+
if (isIrohRemoteWorktreePersistenceError(error)) {
|
|
422
|
+
return {
|
|
423
|
+
ok: false,
|
|
424
|
+
error: "git_failed",
|
|
425
|
+
detail: "worktree state could not be persisted; the existing checkout was left unchanged",
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
throw error;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
async validateWorkingDirectory(workspace, workingDirectory) {
|
|
432
|
+
const resolved = await resolveWorkspaceDirectory(workspace.path, workingDirectory);
|
|
433
|
+
if (!resolved.ok) {
|
|
434
|
+
return { ok: false, error: "invalid_working_directory", detail: resolved.error };
|
|
435
|
+
}
|
|
436
|
+
return { ok: true, directory: resolved.value };
|
|
437
|
+
}
|
|
438
|
+
async resolveWorktreeWorkingDirectory(workspace, worktree, workingDirectory) {
|
|
439
|
+
if (workingDirectory === undefined) {
|
|
440
|
+
const rootDirectory = await resolveWorkspaceDirectory(worktree.path);
|
|
441
|
+
return rootDirectory.ok
|
|
442
|
+
? { ok: true, directory: rootDirectory.value }
|
|
443
|
+
: { ok: false, error: "invalid_working_directory", detail: rootDirectory.error };
|
|
444
|
+
}
|
|
445
|
+
const parentDirectory = await this.validateWorkingDirectory(workspace, workingDirectory);
|
|
446
|
+
if (!parentDirectory.ok) {
|
|
447
|
+
return parentDirectory;
|
|
448
|
+
}
|
|
449
|
+
const sourceRootPath = await this.resolveRecordSourceRootPath(workspace, worktree);
|
|
450
|
+
if (sourceRootPath === undefined || !isPathContained(sourceRootPath, parentDirectory.directory.absolutePath)) {
|
|
451
|
+
return {
|
|
452
|
+
ok: false,
|
|
453
|
+
error: "invalid_working_directory",
|
|
454
|
+
detail: "workingDirectory is outside the worktree source repository",
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
const worktreeRelativePath = getContainedRelativePath(sourceRootPath, parentDirectory.directory.absolutePath);
|
|
458
|
+
if (worktreeRelativePath === null) {
|
|
459
|
+
return {
|
|
460
|
+
ok: false,
|
|
461
|
+
error: "invalid_working_directory",
|
|
462
|
+
detail: "workingDirectory is outside the worktree source repository",
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
const worktreeDirectory = await resolveWorkspaceDirectory(worktree.path, worktreeRelativePath);
|
|
466
|
+
return worktreeDirectory.ok
|
|
467
|
+
? { ok: true, directory: worktreeDirectory.value }
|
|
468
|
+
: { ok: false, error: "invalid_working_directory", detail: worktreeDirectory.error };
|
|
469
|
+
}
|
|
470
|
+
async resolveCreateSource(workspace, workingDirectory) {
|
|
471
|
+
const workspaceDirectory = await this.validateWorkingDirectory(workspace, workingDirectory);
|
|
472
|
+
if (!workspaceDirectory.ok) {
|
|
473
|
+
return workspaceDirectory;
|
|
474
|
+
}
|
|
475
|
+
const topLevel = await this.runGit(["-C", workspaceDirectory.directory.absolutePath, "rev-parse", "--show-toplevel"], workspace.path);
|
|
476
|
+
if (!topLevel.ok) {
|
|
477
|
+
const detail = sanitizeGitDetail(topLevel.stderr, [
|
|
478
|
+
workspace.path,
|
|
479
|
+
workspaceDirectory.directory.absolutePath,
|
|
480
|
+
getWorktreesRoot(this.agentDir),
|
|
481
|
+
]);
|
|
482
|
+
return {
|
|
483
|
+
ok: false,
|
|
484
|
+
error: topLevel.stderr.toLowerCase().includes("not a git repository")
|
|
485
|
+
? "not_a_git_repository"
|
|
486
|
+
: "git_failed",
|
|
487
|
+
...(detail.length === 0 ? {} : { detail }),
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
const workspaceRootPath = await realpathOrResolve(workspace.path);
|
|
491
|
+
const sourceRootPath = await realpathOrResolve(topLevel.stdout.trim());
|
|
492
|
+
if (!isPathContained(workspaceRootPath, sourceRootPath)) {
|
|
493
|
+
return {
|
|
494
|
+
ok: false,
|
|
495
|
+
error: "invalid_working_directory",
|
|
496
|
+
detail: "git repository is outside the registered workspace",
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
const sourceRootRelativePath = await findWorkspaceRelativePathForRealpath(workspaceRootPath, workspaceDirectory.directory.relativePath, sourceRootPath);
|
|
500
|
+
if (sourceRootRelativePath === null) {
|
|
501
|
+
return {
|
|
502
|
+
ok: false,
|
|
503
|
+
error: "invalid_working_directory",
|
|
504
|
+
detail: "git repository is outside the registered workspace",
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
const workingDirectoryRelativePath = getContainedRelativePath(sourceRootPath, workspaceDirectory.directory.absolutePath);
|
|
508
|
+
if (workingDirectoryRelativePath === null) {
|
|
509
|
+
return {
|
|
510
|
+
ok: false,
|
|
511
|
+
error: "invalid_working_directory",
|
|
512
|
+
detail: "workingDirectory is outside the source repository",
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
return {
|
|
516
|
+
ok: true,
|
|
517
|
+
source: {
|
|
518
|
+
workspaceDirectory: workspaceDirectory.directory,
|
|
519
|
+
sourceRootPath,
|
|
520
|
+
...(sourceRootRelativePath === undefined ? {} : { sourceRootRelativePath }),
|
|
521
|
+
...(workingDirectoryRelativePath === undefined ? {} : { workingDirectoryRelativePath }),
|
|
522
|
+
},
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
async list(workspace) {
|
|
526
|
+
const records = await this.stateManager.listWorktrees(workspace.name);
|
|
527
|
+
const gitListBySourceRoot = new Map();
|
|
528
|
+
const statuses = [];
|
|
529
|
+
for (const record of records) {
|
|
530
|
+
const sourceRootPath = await this.resolveRecordSourceRootPath(workspace, record);
|
|
531
|
+
const knownCheckouts = sourceRootPath === undefined
|
|
532
|
+
? undefined
|
|
533
|
+
: await this.getKnownWorktreeCheckouts(sourceRootPath, gitListBySourceRoot);
|
|
534
|
+
const onDisk = existsSync(record.path);
|
|
535
|
+
const available = onDisk &&
|
|
536
|
+
sourceRootPath !== undefined &&
|
|
537
|
+
(knownCheckouts === undefined || knownCheckouts.has(resolve(record.path)));
|
|
538
|
+
let dirty;
|
|
539
|
+
let aheadBehind;
|
|
540
|
+
if (available) {
|
|
541
|
+
// --no-optional-locks is a git-level option and must precede the subcommand.
|
|
542
|
+
const status = await this.runGit(["-C", record.path, "--no-optional-locks", "status", "--porcelain"], sourceRootPath);
|
|
543
|
+
dirty = status.ok ? status.stdout.trim().length > 0 : undefined;
|
|
544
|
+
aheadBehind = await this.computeAheadBehind(sourceRootPath, record);
|
|
545
|
+
}
|
|
546
|
+
statuses.push({
|
|
547
|
+
...record,
|
|
548
|
+
available,
|
|
549
|
+
...(dirty === undefined ? {} : { dirty }),
|
|
550
|
+
...(aheadBehind === undefined ? {} : { aheadBehind }),
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
return statuses;
|
|
554
|
+
}
|
|
555
|
+
async getKnownWorktreeCheckouts(sourceRootPath, cache) {
|
|
556
|
+
const key = resolve(sourceRootPath);
|
|
557
|
+
if (cache.has(key)) {
|
|
558
|
+
return cache.get(key);
|
|
559
|
+
}
|
|
560
|
+
const gitList = await this.runGit(["worktree", "list", "--porcelain"], sourceRootPath);
|
|
561
|
+
const knownCheckouts = gitList.ok ? parseWorktreeListCheckouts(gitList.stdout) : undefined;
|
|
562
|
+
cache.set(key, knownCheckouts);
|
|
563
|
+
return knownCheckouts;
|
|
564
|
+
}
|
|
565
|
+
async resolveRecordSourceRootPath(workspace, record) {
|
|
566
|
+
const resolved = await resolveWorkspaceDirectory(workspace.path, record.sourceRootRelativePath);
|
|
567
|
+
return resolved.ok ? resolved.value.absolutePath : undefined;
|
|
568
|
+
}
|
|
569
|
+
/** Concrete base for a defaulted create: current branch name, else commit sha. */
|
|
570
|
+
async resolveDefaultBaseRef(sourceRootPath) {
|
|
571
|
+
const symbolic = await this.runGit(["symbolic-ref", "--short", "-q", "HEAD"], sourceRootPath);
|
|
572
|
+
const shortRef = symbolic.ok ? symbolic.stdout.trim() : "";
|
|
573
|
+
if (shortRef.length > 0 && isValidGitRefSyntax(shortRef)) {
|
|
574
|
+
return shortRef;
|
|
575
|
+
}
|
|
576
|
+
const sha = await this.runGit(["rev-parse", "HEAD"], sourceRootPath);
|
|
577
|
+
const shaValue = sha.ok ? sha.stdout.trim() : "";
|
|
578
|
+
return /^[0-9a-f]{4,64}$/i.test(shaValue) ? shaValue : undefined;
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Merge-back guidance (design §5.3): branch commits relative to the base
|
|
582
|
+
* ref, computed read-only in the source checkout. `left...right` with
|
|
583
|
+
* left = base and right = branch yields "behind<TAB>ahead".
|
|
584
|
+
*/
|
|
585
|
+
async computeAheadBehind(sourceRootPath, record) {
|
|
586
|
+
const baseRef = record.baseRef ?? "HEAD";
|
|
587
|
+
const counted = await this.runGit(["rev-list", "--left-right", "--count", `${baseRef}...${record.branch}`], sourceRootPath);
|
|
588
|
+
if (!counted.ok) {
|
|
589
|
+
return undefined;
|
|
590
|
+
}
|
|
591
|
+
const match = counted.stdout.trim().match(/^(\d+)\s+(\d+)$/);
|
|
592
|
+
if (!match?.[1] || !match[2]) {
|
|
593
|
+
return undefined;
|
|
594
|
+
}
|
|
595
|
+
return { behind: Number.parseInt(match[1], 10), ahead: Number.parseInt(match[2], 10) };
|
|
596
|
+
}
|
|
597
|
+
/** Refuses dirty/busy unless force; `git worktree remove [--force]`, then drops the record. */
|
|
598
|
+
async remove(workspace, worktreeId, options = {}) {
|
|
599
|
+
const force = options.force === true;
|
|
600
|
+
const records = await this.stateManager.listWorktrees(workspace.name);
|
|
601
|
+
const record = records.find((entry) => entry.id === worktreeId);
|
|
602
|
+
if (!record) {
|
|
603
|
+
return { ok: false, error: "worktree_not_found" };
|
|
604
|
+
}
|
|
605
|
+
if (!force && this.hasActiveRuntimeForSession) {
|
|
606
|
+
const busy = record.sessionIds.some((sessionId) => this.hasActiveRuntimeForSession?.(workspace.name, sessionId));
|
|
607
|
+
if (busy) {
|
|
608
|
+
return { ok: false, error: "worktree_busy" };
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
const sourceRootPath = await this.resolveRecordSourceRootPath(workspace, record);
|
|
612
|
+
if (existsSync(record.path)) {
|
|
613
|
+
if (sourceRootPath === undefined) {
|
|
614
|
+
return { ok: false, error: "not_a_git_repository", detail: "worktree source repository is unavailable" };
|
|
615
|
+
}
|
|
616
|
+
if (!force) {
|
|
617
|
+
const status = await this.runGit(["-C", record.path, "--no-optional-locks", "status", "--porcelain"], sourceRootPath);
|
|
618
|
+
if (status.ok && status.stdout.trim().length > 0) {
|
|
619
|
+
return { ok: false, error: "worktree_dirty", detail: "dirty" };
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
const args = force ? ["worktree", "remove", "--force", record.path] : ["worktree", "remove", record.path];
|
|
623
|
+
const removed = await this.runGit(args, sourceRootPath);
|
|
624
|
+
if (!removed.ok) {
|
|
625
|
+
return this.mapGitFailure(removed.stderr, workspace, record.path, [sourceRootPath]);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
else {
|
|
629
|
+
// Checkout vanished out-of-band: clear the stale gitdir entry best-effort.
|
|
630
|
+
if (sourceRootPath !== undefined) {
|
|
631
|
+
await this.runGit(["worktree", "prune"], sourceRootPath).catch(() => undefined);
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
await this.stateManager.removeWorktree(workspace.name, worktreeId);
|
|
635
|
+
await this.flushState?.();
|
|
636
|
+
return { ok: true };
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Reconcile persisted records vs filesystem vs `git worktree list`. Drops
|
|
640
|
+
* records without checkouts, quarantines unrecognized checkout directories
|
|
641
|
+
* (rename, never delete), and runs `git worktree prune` in each known source checkout.
|
|
642
|
+
*/
|
|
643
|
+
async prune(workspace) {
|
|
644
|
+
const records = await this.stateManager.listWorktrees(workspace.name);
|
|
645
|
+
const removedRecords = [];
|
|
646
|
+
const sourceRootPaths = new Set();
|
|
647
|
+
for (const record of records) {
|
|
648
|
+
const sourceRootPath = await this.resolveRecordSourceRootPath(workspace, record);
|
|
649
|
+
if (sourceRootPath !== undefined) {
|
|
650
|
+
sourceRootPaths.add(sourceRootPath);
|
|
651
|
+
}
|
|
652
|
+
if (!existsSync(record.path)) {
|
|
653
|
+
await this.stateManager.removeWorktree(workspace.name, record.id);
|
|
654
|
+
removedRecords.push(record.id);
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
const parentSourceRootPath = await this.resolveRecordSourceRootPath(workspace, {
|
|
658
|
+
id: "root",
|
|
659
|
+
workspaceName: workspace.name,
|
|
660
|
+
path: workspace.path,
|
|
661
|
+
branch: "HEAD",
|
|
662
|
+
createdAt: 0,
|
|
663
|
+
sessionIds: [],
|
|
664
|
+
});
|
|
665
|
+
if (parentSourceRootPath !== undefined) {
|
|
666
|
+
sourceRootPaths.add(parentSourceRootPath);
|
|
667
|
+
}
|
|
668
|
+
const orphanCheckouts = [];
|
|
669
|
+
const workspaceDir = getWorkspaceWorktreesDir(this.agentDir, workspace.path);
|
|
670
|
+
const recordedPaths = new Set(records.map((record) => resolve(record.path)));
|
|
671
|
+
if (existsSync(workspaceDir)) {
|
|
672
|
+
for (const entry of await readdir(workspaceDir, { withFileTypes: true })) {
|
|
673
|
+
if (!entry.isDirectory() || entry.name.includes(".orphan-")) {
|
|
674
|
+
continue;
|
|
675
|
+
}
|
|
676
|
+
const entryPath = resolve(join(workspaceDir, entry.name));
|
|
677
|
+
if (recordedPaths.has(entryPath)) {
|
|
678
|
+
continue;
|
|
679
|
+
}
|
|
680
|
+
const quarantinePath = `${entryPath}.orphan-${this.now()}`;
|
|
681
|
+
try {
|
|
682
|
+
await rename(entryPath, quarantinePath);
|
|
683
|
+
orphanCheckouts.push(entry.name);
|
|
684
|
+
}
|
|
685
|
+
catch {
|
|
686
|
+
// Quarantine is best-effort; a busy directory stays put for the next prune.
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
for (const sourceRootPath of sourceRootPaths) {
|
|
691
|
+
await this.runGit(["worktree", "prune"], sourceRootPath).catch(() => undefined);
|
|
692
|
+
}
|
|
693
|
+
if (removedRecords.length > 0) {
|
|
694
|
+
await this.flushState?.();
|
|
695
|
+
}
|
|
696
|
+
await this.logAudit({
|
|
697
|
+
type: "worktree_pruned",
|
|
698
|
+
workspace: workspace.name,
|
|
699
|
+
success: true,
|
|
700
|
+
details: { removedRecords, orphanCheckouts },
|
|
701
|
+
});
|
|
702
|
+
return { removedRecords, orphanCheckouts };
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
* Retention removal (design §5.3): remove a worktree ONLY when it is not
|
|
706
|
+
* busy, has no uncommitted work, and its branch is fully merged into the
|
|
707
|
+
* base ref. Never forces; a skip returns the reason for the audit trail.
|
|
708
|
+
*/
|
|
709
|
+
async removeIfCleanAndMerged(workspace, worktreeId) {
|
|
710
|
+
const record = (await this.stateManager.listWorktrees(workspace.name)).find((entry) => entry.id === worktreeId);
|
|
711
|
+
if (!record) {
|
|
712
|
+
return { removed: false, reason: "worktree_not_found" };
|
|
713
|
+
}
|
|
714
|
+
if (this.hasActiveRuntimeForSession &&
|
|
715
|
+
record.sessionIds.some((sessionId) => this.hasActiveRuntimeForSession?.(workspace.name, sessionId))) {
|
|
716
|
+
return { removed: false, reason: "busy" };
|
|
717
|
+
}
|
|
718
|
+
if (!existsSync(record.path)) {
|
|
719
|
+
return { removed: false, reason: "checkout_missing" };
|
|
720
|
+
}
|
|
721
|
+
const sourceRootPath = await this.resolveRecordSourceRootPath(workspace, record);
|
|
722
|
+
if (sourceRootPath === undefined) {
|
|
723
|
+
return { removed: false, reason: "source_unavailable" };
|
|
724
|
+
}
|
|
725
|
+
const status = await this.runGit(["-C", record.path, "--no-optional-locks", "status", "--porcelain"], sourceRootPath);
|
|
726
|
+
if (!status.ok || status.stdout.trim().length > 0) {
|
|
727
|
+
return { removed: false, reason: "dirty" };
|
|
728
|
+
}
|
|
729
|
+
const merged = await this.runGit(["merge-base", "--is-ancestor", record.branch, record.baseRef ?? "HEAD"], sourceRootPath);
|
|
730
|
+
if (!merged.ok) {
|
|
731
|
+
return { removed: false, reason: "unmerged" };
|
|
732
|
+
}
|
|
733
|
+
const removedResult = await this.remove(workspace, worktreeId, { force: false });
|
|
734
|
+
if (!removedResult.ok) {
|
|
735
|
+
return { removed: false, reason: removedResult.error };
|
|
736
|
+
}
|
|
737
|
+
return { removed: true };
|
|
738
|
+
}
|
|
739
|
+
/** Lookup used by conversation open/resume and relay preamble resolution. */
|
|
740
|
+
async resolveSessionWorktree(workspaceName, sessionId) {
|
|
741
|
+
return this.stateManager.findWorktreeForSession(workspaceName, sessionId);
|
|
742
|
+
}
|
|
743
|
+
async bindSession(workspaceName, worktreeId, sessionId) {
|
|
744
|
+
await this.stateManager.bindWorktreeSession(workspaceName, worktreeId, sessionId);
|
|
745
|
+
await this.flushState?.();
|
|
746
|
+
}
|
|
747
|
+
async findWorktree(workspaceName, worktreeId) {
|
|
748
|
+
const records = await this.stateManager.listWorktrees(workspaceName);
|
|
749
|
+
return records.find((entry) => entry.id === worktreeId);
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* Compatibility guard for post-unregister callers. Workspace unregister is
|
|
753
|
+
* deliberately non-destructive: persisted worktrees block the state mutation,
|
|
754
|
+
* and unknown checkout directories are preserved for manual reconciliation.
|
|
755
|
+
*/
|
|
756
|
+
async cleanupUnregisteredWorkspace(workspace) {
|
|
757
|
+
const workspaceDir = getWorkspaceWorktreesDir(this.agentDir, workspace.path);
|
|
758
|
+
if (!existsSync(workspaceDir)) {
|
|
759
|
+
return;
|
|
760
|
+
}
|
|
761
|
+
let preservedEntryCount = 0;
|
|
762
|
+
try {
|
|
763
|
+
preservedEntryCount = (await readdir(workspaceDir)).length;
|
|
764
|
+
}
|
|
765
|
+
catch {
|
|
766
|
+
// Inspection is best-effort. Failure still leaves every path untouched.
|
|
767
|
+
}
|
|
768
|
+
const persistedWorktreeIds = (await this.stateManager.listWorktrees(workspace.name))
|
|
769
|
+
.map((worktree) => worktree.id)
|
|
770
|
+
.sort();
|
|
771
|
+
await this.logAudit({
|
|
772
|
+
type: "worktree_unregister_cleanup_skipped",
|
|
773
|
+
workspace: workspace.name,
|
|
774
|
+
success: false,
|
|
775
|
+
error: "workspace unregister never removes worktree checkouts",
|
|
776
|
+
details: {
|
|
777
|
+
persistedWorktreeIds,
|
|
778
|
+
preservedEntryCount,
|
|
779
|
+
reason: "non_destructive_workspace_unregister",
|
|
780
|
+
},
|
|
781
|
+
});
|
|
782
|
+
}
|
|
783
|
+
mapGitFailure(stderr, workspace, checkoutPath, extraPaths = []) {
|
|
784
|
+
const detail = sanitizeGitDetail(stderr, [
|
|
785
|
+
checkoutPath,
|
|
786
|
+
workspace.path,
|
|
787
|
+
...extraPaths,
|
|
788
|
+
getWorktreesRoot(this.agentDir),
|
|
789
|
+
]);
|
|
790
|
+
const lower = stderr.toLowerCase();
|
|
791
|
+
if (lower.includes("not a git repository")) {
|
|
792
|
+
return { ok: false, error: "not_a_git_repository", detail };
|
|
793
|
+
}
|
|
794
|
+
if (lower.includes("already exists")) {
|
|
795
|
+
return lower.includes("branch") || lower.includes("-b")
|
|
796
|
+
? { ok: false, error: "worktree_branch_conflict", detail }
|
|
797
|
+
: { ok: false, error: "worktree_exists", detail };
|
|
798
|
+
}
|
|
799
|
+
if (lower.includes("contains modified or untracked files")) {
|
|
800
|
+
return { ok: false, error: "worktree_dirty", detail };
|
|
801
|
+
}
|
|
802
|
+
return { ok: false, error: "git_failed", detail };
|
|
803
|
+
}
|
|
804
|
+
async logAudit(event) {
|
|
805
|
+
try {
|
|
806
|
+
await this.auditLogger.log(event);
|
|
807
|
+
}
|
|
808
|
+
catch {
|
|
809
|
+
// Audit logging is best-effort.
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
async function realpathOrResolve(path) {
|
|
814
|
+
try {
|
|
815
|
+
return await realpath(path);
|
|
816
|
+
}
|
|
817
|
+
catch {
|
|
818
|
+
return resolve(path);
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
function getContainedRelativePath(root, child) {
|
|
822
|
+
const relativePath = relative(resolve(root), resolve(child));
|
|
823
|
+
if (relativePath.length === 0 || relativePath === ".") {
|
|
824
|
+
return undefined;
|
|
825
|
+
}
|
|
826
|
+
if (relativePath === ".." || relativePath.startsWith(`..${sep}`) || isAbsolute(relativePath)) {
|
|
827
|
+
return null;
|
|
828
|
+
}
|
|
829
|
+
return relativePath.split(sep).join("/");
|
|
830
|
+
}
|
|
831
|
+
async function findWorkspaceRelativePathForRealpath(workspaceRootPath, selectedRelativePath, targetRealpath) {
|
|
832
|
+
const selectedSegments = selectedRelativePath?.split("/") ?? [];
|
|
833
|
+
for (let count = selectedSegments.length; count >= 0; count -= 1) {
|
|
834
|
+
const candidateRelativePath = count === 0 ? undefined : selectedSegments.slice(0, count).join("/");
|
|
835
|
+
const candidatePath = candidateRelativePath === undefined ? workspaceRootPath : resolve(workspaceRootPath, candidateRelativePath);
|
|
836
|
+
try {
|
|
837
|
+
const candidateRealpath = await realpath(candidatePath);
|
|
838
|
+
if (isSamePath(candidateRealpath, targetRealpath)) {
|
|
839
|
+
return candidateRelativePath;
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
catch {
|
|
843
|
+
// Ignore missing ancestors and fall back to the canonical realpath-relative form below.
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
return getContainedRelativePath(workspaceRootPath, targetRealpath);
|
|
847
|
+
}
|
|
848
|
+
function isSamePath(left, right) {
|
|
849
|
+
const resolvedLeft = resolve(left);
|
|
850
|
+
const resolvedRight = resolve(right);
|
|
851
|
+
return process.platform === "win32"
|
|
852
|
+
? resolvedLeft.toLowerCase() === resolvedRight.toLowerCase()
|
|
853
|
+
: resolvedLeft === resolvedRight;
|
|
854
|
+
}
|
|
855
|
+
function parseWorktreeListEntries(porcelainOutput) {
|
|
856
|
+
const entries = [];
|
|
857
|
+
let current;
|
|
858
|
+
const pushCurrent = () => {
|
|
859
|
+
if (current !== undefined) {
|
|
860
|
+
entries.push(current);
|
|
861
|
+
current = undefined;
|
|
862
|
+
}
|
|
863
|
+
};
|
|
864
|
+
for (const line of porcelainOutput.split("\n")) {
|
|
865
|
+
if (line.length === 0) {
|
|
866
|
+
pushCurrent();
|
|
867
|
+
continue;
|
|
868
|
+
}
|
|
869
|
+
if (line.startsWith("worktree ")) {
|
|
870
|
+
pushCurrent();
|
|
871
|
+
current = { path: line.slice("worktree ".length).trim() };
|
|
872
|
+
continue;
|
|
873
|
+
}
|
|
874
|
+
if (current === undefined) {
|
|
875
|
+
continue;
|
|
876
|
+
}
|
|
877
|
+
if (line.startsWith("branch ")) {
|
|
878
|
+
const ref = line.slice("branch ".length).trim();
|
|
879
|
+
current.branch = ref.startsWith("refs/heads/") ? ref.slice("refs/heads/".length) : ref;
|
|
880
|
+
continue;
|
|
881
|
+
}
|
|
882
|
+
if (line.startsWith("detached ")) {
|
|
883
|
+
current.detached = line.slice("detached ".length).trim();
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
pushCurrent();
|
|
887
|
+
return entries;
|
|
888
|
+
}
|
|
889
|
+
function parseWorktreeListCheckouts(porcelainOutput) {
|
|
890
|
+
return new Set(parseWorktreeListEntries(porcelainOutput).map((entry) => resolve(entry.path)));
|
|
891
|
+
}
|
|
892
|
+
async function findWorktreeListEntryByPath(entries, path) {
|
|
893
|
+
for (const entry of entries) {
|
|
894
|
+
if (isSamePath(await realpathOrResolve(entry.path), path)) {
|
|
895
|
+
return entry;
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
return undefined;
|
|
899
|
+
}
|
|
900
|
+
async function findAdoptSourceRootPath(entries, workspaceRootPath, targetRootPath) {
|
|
901
|
+
for (const entry of entries) {
|
|
902
|
+
const entryPath = await realpathOrResolve(entry.path);
|
|
903
|
+
if (!isSamePath(entryPath, targetRootPath) && isPathContained(workspaceRootPath, entryPath)) {
|
|
904
|
+
return entryPath;
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
return undefined;
|
|
908
|
+
}
|
|
909
|
+
function deriveAdoptedWorktreeId(path, usedIds) {
|
|
910
|
+
const baseName = basename(path)
|
|
911
|
+
.toLowerCase()
|
|
912
|
+
.replace(/[^a-z0-9._-]+/g, "-")
|
|
913
|
+
.replace(/^[^a-z0-9]+/, "")
|
|
914
|
+
.slice(0, 64);
|
|
915
|
+
const base = WORKTREE_ID_PATTERN.test(baseName) ? baseName : "adopted";
|
|
916
|
+
for (let index = 0; index < 100; index++) {
|
|
917
|
+
const suffix = index === 0 ? "" : `-${index}`;
|
|
918
|
+
const candidate = `${base.slice(0, 64 - suffix.length)}${suffix}`;
|
|
919
|
+
if (WORKTREE_ID_PATTERN.test(candidate) && !usedIds.has(candidate)) {
|
|
920
|
+
return candidate;
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
return generateWorktreeIdSlug();
|
|
924
|
+
}
|
|
925
|
+
/** Strip host paths from git stderr before it lands in an RPC detail field. */
|
|
926
|
+
function sanitizeGitDetail(stderr, paths) {
|
|
927
|
+
let detail = stderr.trim();
|
|
928
|
+
for (const path of paths) {
|
|
929
|
+
while (detail.includes(path)) {
|
|
930
|
+
detail = detail.replace(path, "<redacted>");
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
return detail;
|
|
934
|
+
}
|
|
935
|
+
/**
|
|
936
|
+
* Opt-in worktree retention (design §5.3): when a worktree-bound runtime is
|
|
937
|
+
* disposed, schedule a TTL sweep that removes the worktree ONLY when it is
|
|
938
|
+
* clean and fully merged into its base ref; otherwise the skip is audited as
|
|
939
|
+
* worktree_retention_skipped_dirty and the checkout stays put.
|
|
940
|
+
*/
|
|
941
|
+
export class WorktreeRetentionSweeper {
|
|
942
|
+
options;
|
|
943
|
+
timers = new Map();
|
|
944
|
+
disposed = false;
|
|
945
|
+
constructor(options) {
|
|
946
|
+
this.options = options;
|
|
947
|
+
}
|
|
948
|
+
/** Hooked to IntegratedRuntimeRegistry.onRuntimeDisposed for worktree-bound entries. */
|
|
949
|
+
onRuntimeDisposed(workspaceName, worktreeId) {
|
|
950
|
+
if (this.disposed) {
|
|
951
|
+
return;
|
|
952
|
+
}
|
|
953
|
+
const policy = this.options.getRetentionPolicy();
|
|
954
|
+
if (policy === undefined || !policy.enabled) {
|
|
955
|
+
return;
|
|
956
|
+
}
|
|
957
|
+
const key = `${workspaceName}\0${worktreeId}`;
|
|
958
|
+
const existing = this.timers.get(key);
|
|
959
|
+
if (existing !== undefined) {
|
|
960
|
+
(this.options.clearTimer ?? clearTimeout)(existing);
|
|
961
|
+
}
|
|
962
|
+
const timer = (this.options.setTimer ?? setTimeout)(() => {
|
|
963
|
+
this.timers.delete(key);
|
|
964
|
+
void this.sweep(workspaceName, worktreeId);
|
|
965
|
+
}, policy.ttlMs);
|
|
966
|
+
timer.unref?.();
|
|
967
|
+
this.timers.set(key, timer);
|
|
968
|
+
}
|
|
969
|
+
async sweep(workspaceName, worktreeId) {
|
|
970
|
+
if (this.disposed) {
|
|
971
|
+
return;
|
|
972
|
+
}
|
|
973
|
+
try {
|
|
974
|
+
const state = await this.options.stateManager.getState();
|
|
975
|
+
const workspace = state.workspaces.find((entry) => entry.name === workspaceName);
|
|
976
|
+
if (!workspace) {
|
|
977
|
+
return;
|
|
978
|
+
}
|
|
979
|
+
const result = await this.options.manager.removeIfCleanAndMerged(workspace, worktreeId);
|
|
980
|
+
if (result.removed) {
|
|
981
|
+
await this.options.auditLogger.log({
|
|
982
|
+
type: "worktree_retention_removed",
|
|
983
|
+
workspace: workspaceName,
|
|
984
|
+
success: true,
|
|
985
|
+
details: { worktreeId },
|
|
986
|
+
});
|
|
987
|
+
return;
|
|
988
|
+
}
|
|
989
|
+
if (result.reason === "worktree_not_found") {
|
|
990
|
+
return;
|
|
991
|
+
}
|
|
992
|
+
await this.options.auditLogger.log({
|
|
993
|
+
type: "worktree_retention_skipped_dirty",
|
|
994
|
+
workspace: workspaceName,
|
|
995
|
+
success: false,
|
|
996
|
+
details: { worktreeId, reason: result.reason },
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
catch {
|
|
1000
|
+
// Retention is best-effort; the next disposal reschedules.
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
dispose() {
|
|
1004
|
+
this.disposed = true;
|
|
1005
|
+
for (const timer of this.timers.values()) {
|
|
1006
|
+
(this.options.clearTimer ?? clearTimeout)(timer);
|
|
1007
|
+
}
|
|
1008
|
+
this.timers.clear();
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
export function isWorktreeControlRequest(request) {
|
|
1012
|
+
return (request.type === "worktree_create" ||
|
|
1013
|
+
request.type === "worktree_adopt" ||
|
|
1014
|
+
request.type === "worktree_list" ||
|
|
1015
|
+
request.type === "worktree_remove" ||
|
|
1016
|
+
request.type === "worktree_prune" ||
|
|
1017
|
+
request.type === "worktree_resolve" ||
|
|
1018
|
+
request.type === "worktree_bind");
|
|
1019
|
+
}
|
|
1020
|
+
/**
|
|
1021
|
+
* Shared `worktree_*` control-socket handler: used by the daemon skeleton
|
|
1022
|
+
* (main.ts fallback) and the iroh service (which layers runtime-aware remove
|
|
1023
|
+
* on top via hooks.removeWorktree). Control responses MAY include checkout
|
|
1024
|
+
* paths — the no-paths rule applies to the iroh wire, not the local socket.
|
|
1025
|
+
*/
|
|
1026
|
+
export async function handleWorktreeControlRequest(connection, request, hooks) {
|
|
1027
|
+
const state = await hooks.stateManager.getState();
|
|
1028
|
+
const findWorkspace = (name) => state.workspaces.find((workspace) => workspace.name === name);
|
|
1029
|
+
const sendWorkspaceNotFound = (name) => {
|
|
1030
|
+
connection.send({
|
|
1031
|
+
type: "error",
|
|
1032
|
+
id: request.id,
|
|
1033
|
+
code: "not_found",
|
|
1034
|
+
message: `No registered workspace named ${name}`,
|
|
1035
|
+
});
|
|
1036
|
+
};
|
|
1037
|
+
if (request.type === "worktree_create") {
|
|
1038
|
+
const workspace = findWorkspace(request.workspaceName);
|
|
1039
|
+
if (!workspace) {
|
|
1040
|
+
sendWorkspaceNotFound(request.workspaceName);
|
|
1041
|
+
return;
|
|
1042
|
+
}
|
|
1043
|
+
const created = await hooks.manager.create(workspace, {
|
|
1044
|
+
...(request.worktreeName === undefined ? {} : { id: request.worktreeName }),
|
|
1045
|
+
...(request.branch === undefined ? {} : { branch: request.branch }),
|
|
1046
|
+
...(request.baseRef === undefined ? {} : { baseRef: request.baseRef }),
|
|
1047
|
+
});
|
|
1048
|
+
if (!created.ok) {
|
|
1049
|
+
connection.send({
|
|
1050
|
+
type: "error",
|
|
1051
|
+
id: request.id,
|
|
1052
|
+
code: created.error,
|
|
1053
|
+
message: created.detail ?? created.error,
|
|
1054
|
+
});
|
|
1055
|
+
return;
|
|
1056
|
+
}
|
|
1057
|
+
connection.send({
|
|
1058
|
+
type: "worktree_result",
|
|
1059
|
+
id: request.id,
|
|
1060
|
+
worktree: toControlWorktreeStatus(created.worktree, true),
|
|
1061
|
+
});
|
|
1062
|
+
return;
|
|
1063
|
+
}
|
|
1064
|
+
if (request.type === "worktree_adopt") {
|
|
1065
|
+
const workspace = findWorkspace(request.workspaceName);
|
|
1066
|
+
if (!workspace) {
|
|
1067
|
+
sendWorkspaceNotFound(request.workspaceName);
|
|
1068
|
+
return;
|
|
1069
|
+
}
|
|
1070
|
+
const adopted = await hooks.manager.adopt(workspace, {
|
|
1071
|
+
path: request.path,
|
|
1072
|
+
...(request.worktreeName === undefined ? {} : { id: request.worktreeName }),
|
|
1073
|
+
...(request.baseRef === undefined ? {} : { baseRef: request.baseRef }),
|
|
1074
|
+
});
|
|
1075
|
+
if (!adopted.ok) {
|
|
1076
|
+
connection.send({
|
|
1077
|
+
type: "error",
|
|
1078
|
+
id: request.id,
|
|
1079
|
+
code: adopted.error,
|
|
1080
|
+
message: adopted.detail ?? adopted.error,
|
|
1081
|
+
});
|
|
1082
|
+
return;
|
|
1083
|
+
}
|
|
1084
|
+
connection.send({
|
|
1085
|
+
type: "worktree_result",
|
|
1086
|
+
id: request.id,
|
|
1087
|
+
worktree: toControlWorktreeStatus(adopted.worktree, true),
|
|
1088
|
+
});
|
|
1089
|
+
return;
|
|
1090
|
+
}
|
|
1091
|
+
if (request.type === "worktree_list") {
|
|
1092
|
+
const workspaces = resolveRequestWorkspaces(state.workspaces, request.workspaceName);
|
|
1093
|
+
if (!workspaces.ok) {
|
|
1094
|
+
sendWorkspaceNotFound(workspaces.missing);
|
|
1095
|
+
return;
|
|
1096
|
+
}
|
|
1097
|
+
const worktrees = [];
|
|
1098
|
+
for (const workspace of workspaces.workspaces) {
|
|
1099
|
+
for (const status of await hooks.manager.list(workspace)) {
|
|
1100
|
+
worktrees.push(toControlWorktreeStatus(status, status.available, status.dirty));
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
connection.send({ type: "worktrees_result", id: request.id, worktrees });
|
|
1104
|
+
return;
|
|
1105
|
+
}
|
|
1106
|
+
if (request.type === "worktree_resolve") {
|
|
1107
|
+
const worktrees = await hooks.stateManager.listWorktrees();
|
|
1108
|
+
const match = worktrees.find((worktree) => isPathContained(worktree.path, request.path));
|
|
1109
|
+
const workspace = match ? findWorkspace(match.workspaceName) : undefined;
|
|
1110
|
+
if (!match || !workspace) {
|
|
1111
|
+
connection.send({
|
|
1112
|
+
type: "error",
|
|
1113
|
+
id: request.id,
|
|
1114
|
+
code: "not_found",
|
|
1115
|
+
message: "path is not inside a daemon-managed worktree",
|
|
1116
|
+
});
|
|
1117
|
+
return;
|
|
1118
|
+
}
|
|
1119
|
+
connection.send({
|
|
1120
|
+
type: "worktree_resolve_result",
|
|
1121
|
+
id: request.id,
|
|
1122
|
+
workspaceName: workspace.name,
|
|
1123
|
+
workspacePath: workspace.path,
|
|
1124
|
+
worktreeId: match.id,
|
|
1125
|
+
worktreePath: match.path,
|
|
1126
|
+
});
|
|
1127
|
+
return;
|
|
1128
|
+
}
|
|
1129
|
+
if (request.type === "worktree_bind") {
|
|
1130
|
+
const workspace = findWorkspace(request.workspaceName);
|
|
1131
|
+
if (!workspace) {
|
|
1132
|
+
sendWorkspaceNotFound(request.workspaceName);
|
|
1133
|
+
return;
|
|
1134
|
+
}
|
|
1135
|
+
const record = await hooks.manager.findWorktree(request.workspaceName, request.worktreeId);
|
|
1136
|
+
if (!record) {
|
|
1137
|
+
connection.send({
|
|
1138
|
+
type: "error",
|
|
1139
|
+
id: request.id,
|
|
1140
|
+
code: "worktree_not_found",
|
|
1141
|
+
message: `No worktree ${request.worktreeId} in workspace ${request.workspaceName}`,
|
|
1142
|
+
});
|
|
1143
|
+
return;
|
|
1144
|
+
}
|
|
1145
|
+
await hooks.manager.bindSession(request.workspaceName, request.worktreeId, request.sessionId);
|
|
1146
|
+
connection.send({ type: "ok", id: request.id });
|
|
1147
|
+
return;
|
|
1148
|
+
}
|
|
1149
|
+
if (request.type === "worktree_remove") {
|
|
1150
|
+
const workspace = findWorkspace(request.workspaceName);
|
|
1151
|
+
if (!workspace) {
|
|
1152
|
+
sendWorkspaceNotFound(request.workspaceName);
|
|
1153
|
+
return;
|
|
1154
|
+
}
|
|
1155
|
+
const force = request.force === true;
|
|
1156
|
+
const removed = hooks.removeWorktree
|
|
1157
|
+
? await hooks.removeWorktree(workspace, request.worktreeId, force)
|
|
1158
|
+
: await hooks.manager.remove(workspace, request.worktreeId, { force });
|
|
1159
|
+
if (!removed.ok) {
|
|
1160
|
+
connection.send({
|
|
1161
|
+
type: "error",
|
|
1162
|
+
id: request.id,
|
|
1163
|
+
code: removed.error,
|
|
1164
|
+
message: removed.detail ?? removed.error,
|
|
1165
|
+
});
|
|
1166
|
+
return;
|
|
1167
|
+
}
|
|
1168
|
+
connection.send({ type: "ok", id: request.id });
|
|
1169
|
+
return;
|
|
1170
|
+
}
|
|
1171
|
+
const workspaces = resolveRequestWorkspaces(state.workspaces, request.workspaceName);
|
|
1172
|
+
if (!workspaces.ok) {
|
|
1173
|
+
sendWorkspaceNotFound(workspaces.missing);
|
|
1174
|
+
return;
|
|
1175
|
+
}
|
|
1176
|
+
const results = [];
|
|
1177
|
+
for (const workspace of workspaces.workspaces) {
|
|
1178
|
+
const pruned = await hooks.manager.prune(workspace);
|
|
1179
|
+
results.push({ workspaceName: workspace.name, ...pruned });
|
|
1180
|
+
}
|
|
1181
|
+
connection.send({ type: "worktree_prune_result", id: request.id, results });
|
|
1182
|
+
}
|
|
1183
|
+
function resolveRequestWorkspaces(workspaces, workspaceName) {
|
|
1184
|
+
if (workspaceName === undefined) {
|
|
1185
|
+
return { ok: true, workspaces };
|
|
1186
|
+
}
|
|
1187
|
+
const workspace = workspaces.find((entry) => entry.name === workspaceName);
|
|
1188
|
+
return workspace ? { ok: true, workspaces: [workspace] } : { ok: false, missing: workspaceName };
|
|
1189
|
+
}
|
|
1190
|
+
function toControlWorktreeStatus(worktree, available, dirty) {
|
|
1191
|
+
return {
|
|
1192
|
+
id: worktree.id,
|
|
1193
|
+
workspaceName: worktree.workspaceName,
|
|
1194
|
+
path: worktree.path,
|
|
1195
|
+
branch: worktree.branch,
|
|
1196
|
+
...(worktree.baseRef === undefined ? {} : { baseRef: worktree.baseRef }),
|
|
1197
|
+
createdAt: worktree.createdAt,
|
|
1198
|
+
sessionIds: [...worktree.sessionIds],
|
|
1199
|
+
...(available === undefined ? {} : { available }),
|
|
1200
|
+
...(dirty === undefined ? {} : { dirty }),
|
|
1201
|
+
...(worktree.aheadBehind === undefined ? {} : { aheadBehind: worktree.aheadBehind }),
|
|
1202
|
+
};
|
|
1203
|
+
}
|
|
1204
|
+
//# sourceMappingURL=worktree-manager.js.map
|