@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,47 @@
|
|
|
1
|
+
import type { IrohRemoteClientAuthorizationSuccess } from "../core/remote/iroh/authorization.ts";
|
|
2
|
+
import { type IrohRemoteConversationSelection, type IrohRemoteHandshakeSuccess, type IrohRemoteHello } from "../core/remote/iroh/handshake.ts";
|
|
3
|
+
import { type IrohRemoteHostMetadata } from "../core/remote/iroh/metadata.ts";
|
|
4
|
+
import type { IrohRemoteRelayMode } from "../core/remote/iroh/protocol.ts";
|
|
5
|
+
/**
|
|
6
|
+
* Session selection outcomes as tracked by the conversation owner. Extends the
|
|
7
|
+
* runtime-level selection kinds with "session_rekeyed" (an existing runtime is
|
|
8
|
+
* serving a different session id than the one requested).
|
|
9
|
+
*/
|
|
10
|
+
export type IntegratedConversationSessionSelection = {
|
|
11
|
+
kind: "created";
|
|
12
|
+
sessionId: string;
|
|
13
|
+
sessionFile?: string;
|
|
14
|
+
} | {
|
|
15
|
+
kind: "created_after_missing";
|
|
16
|
+
requestedSessionId: string;
|
|
17
|
+
sessionId: string;
|
|
18
|
+
sessionFile?: string;
|
|
19
|
+
} | {
|
|
20
|
+
kind: "resumed";
|
|
21
|
+
requestedSessionId: string;
|
|
22
|
+
sessionId: string;
|
|
23
|
+
sessionFile?: string;
|
|
24
|
+
} | {
|
|
25
|
+
kind: "session_rekeyed";
|
|
26
|
+
requestedSessionId: string;
|
|
27
|
+
sessionId: string;
|
|
28
|
+
};
|
|
29
|
+
/** Host identity/context needed to build handshake responses and host-state decoration. */
|
|
30
|
+
export interface RemoteHostResponseContext {
|
|
31
|
+
hostNodeId?: string;
|
|
32
|
+
relayMode?: IrohRemoteRelayMode;
|
|
33
|
+
relayUrls?: string[];
|
|
34
|
+
}
|
|
35
|
+
export declare function createRemoteHostMetadata(authorization: IrohRemoteClientAuthorizationSuccess, context: RemoteHostResponseContext): IrohRemoteHostMetadata;
|
|
36
|
+
export declare function getHandshakeConversationSelection(sessionSelection: IntegratedConversationSessionSelection): IrohRemoteConversationSelection;
|
|
37
|
+
export declare function createIntegratedConversationHandshakeResponse(handshake: {
|
|
38
|
+
hello: IrohRemoteHello;
|
|
39
|
+
response: IrohRemoteHandshakeSuccess;
|
|
40
|
+
}, authorization: IrohRemoteClientAuthorizationSuccess, sessionId: string, sessionSelection: IntegratedConversationSessionSelection, context: RemoteHostResponseContext, worktreeId?: string, workingDirectory?: string): IrohRemoteHandshakeSuccess;
|
|
41
|
+
/**
|
|
42
|
+
* Decorates outbound RPC frames with host-side metadata: filters get_ui_actions
|
|
43
|
+
* to remote-safe actions, and stamps get_state responses with the workspace
|
|
44
|
+
* name and remote host metadata.
|
|
45
|
+
*/
|
|
46
|
+
export declare function decorateRemoteHostState(value: object, authorization: IrohRemoteClientAuthorizationSuccess, context: RemoteHostResponseContext): object;
|
|
47
|
+
//# sourceMappingURL=handshake-responses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handshake-responses.d.ts","sourceRoot":"","sources":["../../src/daemon/handshake-responses.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,sCAAsC,CAAC;AACjG,OAAO,EAEN,KAAK,+BAA+B,EACpC,KAAK,0BAA0B,EAC/B,KAAK,eAAe,EACpB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAgC,KAAK,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAC5G,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAE3E;;;;GAIG;AACH,MAAM,MAAM,sCAAsC,GAC/C;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAC5D;IAAE,IAAI,EAAE,uBAAuB,CAAC;IAAC,kBAAkB,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GACtG;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,kBAAkB,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GACxF;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,kBAAkB,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9E,2FAA2F;AAC3F,MAAM,WAAW,yBAAyB;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,mBAAmB,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAUD,wBAAgB,wBAAwB,CACvC,aAAa,EAAE,oCAAoC,EACnD,OAAO,EAAE,yBAAyB,GAChC,sBAAsB,CAUxB;AAED,wBAAgB,iCAAiC,CAChD,gBAAgB,EAAE,sCAAsC,GACtD,+BAA+B,CAWjC;AAED,wBAAgB,6CAA6C,CAC5D,SAAS,EAAE;IAAE,KAAK,EAAE,eAAe,CAAC;IAAC,QAAQ,EAAE,0BAA0B,CAAA;CAAE,EAC3E,aAAa,EAAE,oCAAoC,EACnD,SAAS,EAAE,MAAM,EACjB,gBAAgB,EAAE,sCAAsC,EACxD,OAAO,EAAE,yBAAyB,EAClC,UAAU,CAAC,EAAE,MAAM,EACnB,gBAAgB,CAAC,EAAE,MAAM,GACvB,0BAA0B,CAwB5B;AAmCD;;;;GAIG;AACH,wBAAgB,uBAAuB,CACtC,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,oCAAoC,EACnD,OAAO,EAAE,yBAAyB,GAChC,MAAM,CAwBR","sourcesContent":["import { hostname, userInfo } from \"node:os\";\nimport type { IrohRemoteClientAuthorizationSuccess } from \"../core/remote/iroh/authorization.ts\";\nimport {\n\tcreateIrohRemoteHandshakeSuccess,\n\ttype IrohRemoteConversationSelection,\n\ttype IrohRemoteHandshakeSuccess,\n\ttype IrohRemoteHello,\n} from \"../core/remote/iroh/handshake.ts\";\nimport { createIrohRemoteHostMetadata, type IrohRemoteHostMetadata } from \"../core/remote/iroh/metadata.ts\";\nimport type { IrohRemoteRelayMode } from \"../core/remote/iroh/protocol.ts\";\n\n/**\n * Session selection outcomes as tracked by the conversation owner. Extends the\n * runtime-level selection kinds with \"session_rekeyed\" (an existing runtime is\n * serving a different session id than the one requested).\n */\nexport type IntegratedConversationSessionSelection =\n\t| { kind: \"created\"; sessionId: string; sessionFile?: string }\n\t| { kind: \"created_after_missing\"; requestedSessionId: string; sessionId: string; sessionFile?: string }\n\t| { kind: \"resumed\"; requestedSessionId: string; sessionId: string; sessionFile?: string }\n\t| { kind: \"session_rekeyed\"; requestedSessionId: string; sessionId: string };\n\n/** Host identity/context needed to build handshake responses and host-state decoration. */\nexport interface RemoteHostResponseContext {\n\thostNodeId?: string;\n\trelayMode?: IrohRemoteRelayMode;\n\trelayUrls?: string[];\n}\n\nfunction getCurrentUserName(): string | undefined {\n\ttry {\n\t\treturn userInfo().username;\n\t} catch {\n\t\treturn process.env.USER ?? process.env.USERNAME;\n\t}\n}\n\nexport function createRemoteHostMetadata(\n\tauthorization: IrohRemoteClientAuthorizationSuccess,\n\tcontext: RemoteHostResponseContext,\n): IrohRemoteHostMetadata {\n\treturn createIrohRemoteHostMetadata({\n\t\tauthorization,\n\t\thostNodeId: context.hostNodeId,\n\t\trelayMode: context.relayMode,\n\t\trelayUrls: context.relayUrls,\n\t\thostName: hostname(),\n\t\tuserName: getCurrentUserName(),\n\t\tcwd: \"/workspace\",\n\t});\n}\n\nexport function getHandshakeConversationSelection(\n\tsessionSelection: IntegratedConversationSessionSelection,\n): IrohRemoteConversationSelection {\n\tif (sessionSelection.kind === \"created_after_missing\") {\n\t\treturn \"created_missing_last\";\n\t}\n\tif (sessionSelection.kind === \"created\") {\n\t\treturn \"created\";\n\t}\n\tif (sessionSelection.kind === \"session_rekeyed\") {\n\t\treturn \"session_rekeyed\";\n\t}\n\treturn \"resumed\";\n}\n\nexport function createIntegratedConversationHandshakeResponse(\n\thandshake: { hello: IrohRemoteHello; response: IrohRemoteHandshakeSuccess },\n\tauthorization: IrohRemoteClientAuthorizationSuccess,\n\tsessionId: string,\n\tsessionSelection: IntegratedConversationSessionSelection,\n\tcontext: RemoteHostResponseContext,\n\tworktreeId?: string,\n\tworkingDirectory?: string,\n): IrohRemoteHandshakeSuccess {\n\tif (handshake.hello.mode !== \"conversation\") {\n\t\tthrow new Error(\"integrated conversation handshake response requires a conversation hello\");\n\t}\n\tconst requestedSessionId =\n\t\tsessionSelection.kind === \"session_rekeyed\" ? sessionSelection.requestedSessionId : undefined;\n\treturn createIrohRemoteHandshakeSuccess({\n\t\tchild: handshake.response.child,\n\t\tclientNodeId: authorization.client.nodeId,\n\t\tfeatures: handshake.response.features,\n\t\thostNodeId: context.hostNodeId,\n\t\tremoteHost: createRemoteHostMetadata(authorization, context),\n\t\tworkspace: authorization.workspace.name,\n\t\tsessionId,\n\t\tconversation: {\n\t\t\ttarget: handshake.hello.conversation.target,\n\t\t\tsessionId,\n\t\t\tselection: getHandshakeConversationSelection(sessionSelection),\n\t\t\t...(requestedSessionId === undefined ? {} : { requestedSessionId }),\n\t\t\t// Echoed only for worktree-bound conversations; old clients never see it.\n\t\t\t...(worktreeId === undefined ? {} : { worktreeId }),\n\t\t\t...(workingDirectory === undefined ? {} : { workingDirectory }),\n\t\t},\n\t});\n}\n\nfunction isResponseRecord(value: object): value is Record<string, unknown> {\n\treturn !Array.isArray(value);\n}\n\nfunction decorateRemoteUiActionResponse(value: object): object {\n\tif (!isResponseRecord(value)) {\n\t\treturn value;\n\t}\n\tconst data = value.data;\n\tif (\n\t\tvalue.type !== \"response\" ||\n\t\tvalue.command !== \"get_ui_actions\" ||\n\t\tvalue.success !== true ||\n\t\ttypeof data !== \"object\" ||\n\t\tdata === null ||\n\t\tArray.isArray(data) ||\n\t\t!Array.isArray((data as Record<string, unknown>).actions)\n\t) {\n\t\treturn value;\n\t}\n\tconst actions = (data as Record<string, unknown>).actions as unknown[];\n\treturn {\n\t\t...value,\n\t\tdata: {\n\t\t\t...data,\n\t\t\tactions: actions.filter(\n\t\t\t\t(action) =>\n\t\t\t\t\ttypeof action === \"object\" && action !== null && (action as Record<string, unknown>).remoteSafe === true,\n\t\t\t),\n\t\t},\n\t};\n}\n\n/**\n * Decorates outbound RPC frames with host-side metadata: filters get_ui_actions\n * to remote-safe actions, and stamps get_state responses with the workspace\n * name and remote host metadata.\n */\nexport function decorateRemoteHostState(\n\tvalue: object,\n\tauthorization: IrohRemoteClientAuthorizationSuccess,\n\tcontext: RemoteHostResponseContext,\n): object {\n\tconst decoratedValue = decorateRemoteUiActionResponse(value);\n\tif (!isResponseRecord(decoratedValue)) {\n\t\treturn decoratedValue;\n\t}\n\tconst data = decoratedValue.data;\n\tif (\n\t\tdecoratedValue.type !== \"response\" ||\n\t\tdecoratedValue.command !== \"get_state\" ||\n\t\tdecoratedValue.success !== true ||\n\t\ttypeof data !== \"object\" ||\n\t\tdata === null ||\n\t\tArray.isArray(data)\n\t) {\n\t\treturn decoratedValue;\n\t}\n\treturn {\n\t\t...decoratedValue,\n\t\tdata: {\n\t\t\t...data,\n\t\t\tworkspaceName: authorization.workspace.name,\n\t\t\tremoteHost: createRemoteHostMetadata(authorization, context),\n\t\t},\n\t};\n}\n"]}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { hostname, userInfo } from "node:os";
|
|
2
|
+
import { createIrohRemoteHandshakeSuccess, } from "../core/remote/iroh/handshake.js";
|
|
3
|
+
import { createIrohRemoteHostMetadata } from "../core/remote/iroh/metadata.js";
|
|
4
|
+
function getCurrentUserName() {
|
|
5
|
+
try {
|
|
6
|
+
return userInfo().username;
|
|
7
|
+
}
|
|
8
|
+
catch {
|
|
9
|
+
return process.env.USER ?? process.env.USERNAME;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export function createRemoteHostMetadata(authorization, context) {
|
|
13
|
+
return createIrohRemoteHostMetadata({
|
|
14
|
+
authorization,
|
|
15
|
+
hostNodeId: context.hostNodeId,
|
|
16
|
+
relayMode: context.relayMode,
|
|
17
|
+
relayUrls: context.relayUrls,
|
|
18
|
+
hostName: hostname(),
|
|
19
|
+
userName: getCurrentUserName(),
|
|
20
|
+
cwd: "/workspace",
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
export function getHandshakeConversationSelection(sessionSelection) {
|
|
24
|
+
if (sessionSelection.kind === "created_after_missing") {
|
|
25
|
+
return "created_missing_last";
|
|
26
|
+
}
|
|
27
|
+
if (sessionSelection.kind === "created") {
|
|
28
|
+
return "created";
|
|
29
|
+
}
|
|
30
|
+
if (sessionSelection.kind === "session_rekeyed") {
|
|
31
|
+
return "session_rekeyed";
|
|
32
|
+
}
|
|
33
|
+
return "resumed";
|
|
34
|
+
}
|
|
35
|
+
export function createIntegratedConversationHandshakeResponse(handshake, authorization, sessionId, sessionSelection, context, worktreeId, workingDirectory) {
|
|
36
|
+
if (handshake.hello.mode !== "conversation") {
|
|
37
|
+
throw new Error("integrated conversation handshake response requires a conversation hello");
|
|
38
|
+
}
|
|
39
|
+
const requestedSessionId = sessionSelection.kind === "session_rekeyed" ? sessionSelection.requestedSessionId : undefined;
|
|
40
|
+
return createIrohRemoteHandshakeSuccess({
|
|
41
|
+
child: handshake.response.child,
|
|
42
|
+
clientNodeId: authorization.client.nodeId,
|
|
43
|
+
features: handshake.response.features,
|
|
44
|
+
hostNodeId: context.hostNodeId,
|
|
45
|
+
remoteHost: createRemoteHostMetadata(authorization, context),
|
|
46
|
+
workspace: authorization.workspace.name,
|
|
47
|
+
sessionId,
|
|
48
|
+
conversation: {
|
|
49
|
+
target: handshake.hello.conversation.target,
|
|
50
|
+
sessionId,
|
|
51
|
+
selection: getHandshakeConversationSelection(sessionSelection),
|
|
52
|
+
...(requestedSessionId === undefined ? {} : { requestedSessionId }),
|
|
53
|
+
// Echoed only for worktree-bound conversations; old clients never see it.
|
|
54
|
+
...(worktreeId === undefined ? {} : { worktreeId }),
|
|
55
|
+
...(workingDirectory === undefined ? {} : { workingDirectory }),
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function isResponseRecord(value) {
|
|
60
|
+
return !Array.isArray(value);
|
|
61
|
+
}
|
|
62
|
+
function decorateRemoteUiActionResponse(value) {
|
|
63
|
+
if (!isResponseRecord(value)) {
|
|
64
|
+
return value;
|
|
65
|
+
}
|
|
66
|
+
const data = value.data;
|
|
67
|
+
if (value.type !== "response" ||
|
|
68
|
+
value.command !== "get_ui_actions" ||
|
|
69
|
+
value.success !== true ||
|
|
70
|
+
typeof data !== "object" ||
|
|
71
|
+
data === null ||
|
|
72
|
+
Array.isArray(data) ||
|
|
73
|
+
!Array.isArray(data.actions)) {
|
|
74
|
+
return value;
|
|
75
|
+
}
|
|
76
|
+
const actions = data.actions;
|
|
77
|
+
return {
|
|
78
|
+
...value,
|
|
79
|
+
data: {
|
|
80
|
+
...data,
|
|
81
|
+
actions: actions.filter((action) => typeof action === "object" && action !== null && action.remoteSafe === true),
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Decorates outbound RPC frames with host-side metadata: filters get_ui_actions
|
|
87
|
+
* to remote-safe actions, and stamps get_state responses with the workspace
|
|
88
|
+
* name and remote host metadata.
|
|
89
|
+
*/
|
|
90
|
+
export function decorateRemoteHostState(value, authorization, context) {
|
|
91
|
+
const decoratedValue = decorateRemoteUiActionResponse(value);
|
|
92
|
+
if (!isResponseRecord(decoratedValue)) {
|
|
93
|
+
return decoratedValue;
|
|
94
|
+
}
|
|
95
|
+
const data = decoratedValue.data;
|
|
96
|
+
if (decoratedValue.type !== "response" ||
|
|
97
|
+
decoratedValue.command !== "get_state" ||
|
|
98
|
+
decoratedValue.success !== true ||
|
|
99
|
+
typeof data !== "object" ||
|
|
100
|
+
data === null ||
|
|
101
|
+
Array.isArray(data)) {
|
|
102
|
+
return decoratedValue;
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
...decoratedValue,
|
|
106
|
+
data: {
|
|
107
|
+
...data,
|
|
108
|
+
workspaceName: authorization.workspace.name,
|
|
109
|
+
remoteHost: createRemoteHostMetadata(authorization, context),
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=handshake-responses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handshake-responses.js","sourceRoot":"","sources":["../../src/daemon/handshake-responses.ts"],"names":[],"mappings":"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","sourcesContent":["import { hostname, userInfo } from \"node:os\";\nimport type { IrohRemoteClientAuthorizationSuccess } from \"../core/remote/iroh/authorization.ts\";\nimport {\n\tcreateIrohRemoteHandshakeSuccess,\n\ttype IrohRemoteConversationSelection,\n\ttype IrohRemoteHandshakeSuccess,\n\ttype IrohRemoteHello,\n} from \"../core/remote/iroh/handshake.ts\";\nimport { createIrohRemoteHostMetadata, type IrohRemoteHostMetadata } from \"../core/remote/iroh/metadata.ts\";\nimport type { IrohRemoteRelayMode } from \"../core/remote/iroh/protocol.ts\";\n\n/**\n * Session selection outcomes as tracked by the conversation owner. Extends the\n * runtime-level selection kinds with \"session_rekeyed\" (an existing runtime is\n * serving a different session id than the one requested).\n */\nexport type IntegratedConversationSessionSelection =\n\t| { kind: \"created\"; sessionId: string; sessionFile?: string }\n\t| { kind: \"created_after_missing\"; requestedSessionId: string; sessionId: string; sessionFile?: string }\n\t| { kind: \"resumed\"; requestedSessionId: string; sessionId: string; sessionFile?: string }\n\t| { kind: \"session_rekeyed\"; requestedSessionId: string; sessionId: string };\n\n/** Host identity/context needed to build handshake responses and host-state decoration. */\nexport interface RemoteHostResponseContext {\n\thostNodeId?: string;\n\trelayMode?: IrohRemoteRelayMode;\n\trelayUrls?: string[];\n}\n\nfunction getCurrentUserName(): string | undefined {\n\ttry {\n\t\treturn userInfo().username;\n\t} catch {\n\t\treturn process.env.USER ?? process.env.USERNAME;\n\t}\n}\n\nexport function createRemoteHostMetadata(\n\tauthorization: IrohRemoteClientAuthorizationSuccess,\n\tcontext: RemoteHostResponseContext,\n): IrohRemoteHostMetadata {\n\treturn createIrohRemoteHostMetadata({\n\t\tauthorization,\n\t\thostNodeId: context.hostNodeId,\n\t\trelayMode: context.relayMode,\n\t\trelayUrls: context.relayUrls,\n\t\thostName: hostname(),\n\t\tuserName: getCurrentUserName(),\n\t\tcwd: \"/workspace\",\n\t});\n}\n\nexport function getHandshakeConversationSelection(\n\tsessionSelection: IntegratedConversationSessionSelection,\n): IrohRemoteConversationSelection {\n\tif (sessionSelection.kind === \"created_after_missing\") {\n\t\treturn \"created_missing_last\";\n\t}\n\tif (sessionSelection.kind === \"created\") {\n\t\treturn \"created\";\n\t}\n\tif (sessionSelection.kind === \"session_rekeyed\") {\n\t\treturn \"session_rekeyed\";\n\t}\n\treturn \"resumed\";\n}\n\nexport function createIntegratedConversationHandshakeResponse(\n\thandshake: { hello: IrohRemoteHello; response: IrohRemoteHandshakeSuccess },\n\tauthorization: IrohRemoteClientAuthorizationSuccess,\n\tsessionId: string,\n\tsessionSelection: IntegratedConversationSessionSelection,\n\tcontext: RemoteHostResponseContext,\n\tworktreeId?: string,\n\tworkingDirectory?: string,\n): IrohRemoteHandshakeSuccess {\n\tif (handshake.hello.mode !== \"conversation\") {\n\t\tthrow new Error(\"integrated conversation handshake response requires a conversation hello\");\n\t}\n\tconst requestedSessionId =\n\t\tsessionSelection.kind === \"session_rekeyed\" ? sessionSelection.requestedSessionId : undefined;\n\treturn createIrohRemoteHandshakeSuccess({\n\t\tchild: handshake.response.child,\n\t\tclientNodeId: authorization.client.nodeId,\n\t\tfeatures: handshake.response.features,\n\t\thostNodeId: context.hostNodeId,\n\t\tremoteHost: createRemoteHostMetadata(authorization, context),\n\t\tworkspace: authorization.workspace.name,\n\t\tsessionId,\n\t\tconversation: {\n\t\t\ttarget: handshake.hello.conversation.target,\n\t\t\tsessionId,\n\t\t\tselection: getHandshakeConversationSelection(sessionSelection),\n\t\t\t...(requestedSessionId === undefined ? {} : { requestedSessionId }),\n\t\t\t// Echoed only for worktree-bound conversations; old clients never see it.\n\t\t\t...(worktreeId === undefined ? {} : { worktreeId }),\n\t\t\t...(workingDirectory === undefined ? {} : { workingDirectory }),\n\t\t},\n\t});\n}\n\nfunction isResponseRecord(value: object): value is Record<string, unknown> {\n\treturn !Array.isArray(value);\n}\n\nfunction decorateRemoteUiActionResponse(value: object): object {\n\tif (!isResponseRecord(value)) {\n\t\treturn value;\n\t}\n\tconst data = value.data;\n\tif (\n\t\tvalue.type !== \"response\" ||\n\t\tvalue.command !== \"get_ui_actions\" ||\n\t\tvalue.success !== true ||\n\t\ttypeof data !== \"object\" ||\n\t\tdata === null ||\n\t\tArray.isArray(data) ||\n\t\t!Array.isArray((data as Record<string, unknown>).actions)\n\t) {\n\t\treturn value;\n\t}\n\tconst actions = (data as Record<string, unknown>).actions as unknown[];\n\treturn {\n\t\t...value,\n\t\tdata: {\n\t\t\t...data,\n\t\t\tactions: actions.filter(\n\t\t\t\t(action) =>\n\t\t\t\t\ttypeof action === \"object\" && action !== null && (action as Record<string, unknown>).remoteSafe === true,\n\t\t\t),\n\t\t},\n\t};\n}\n\n/**\n * Decorates outbound RPC frames with host-side metadata: filters get_ui_actions\n * to remote-safe actions, and stamps get_state responses with the workspace\n * name and remote host metadata.\n */\nexport function decorateRemoteHostState(\n\tvalue: object,\n\tauthorization: IrohRemoteClientAuthorizationSuccess,\n\tcontext: RemoteHostResponseContext,\n): object {\n\tconst decoratedValue = decorateRemoteUiActionResponse(value);\n\tif (!isResponseRecord(decoratedValue)) {\n\t\treturn decoratedValue;\n\t}\n\tconst data = decoratedValue.data;\n\tif (\n\t\tdecoratedValue.type !== \"response\" ||\n\t\tdecoratedValue.command !== \"get_state\" ||\n\t\tdecoratedValue.success !== true ||\n\t\ttypeof data !== \"object\" ||\n\t\tdata === null ||\n\t\tArray.isArray(data)\n\t) {\n\t\treturn decoratedValue;\n\t}\n\treturn {\n\t\t...decoratedValue,\n\t\tdata: {\n\t\t\t...data,\n\t\t\tworkspaceName: authorization.workspace.name,\n\t\t\tremoteHost: createRemoteHostMetadata(authorization, context),\n\t\t},\n\t};\n}\n"]}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import type { AgentSessionRuntime } from "../core/agent-session-runtime.ts";
|
|
2
|
+
import type { IrohRemoteActiveStreamRegistry } from "../core/remote/iroh/active-stream-registry.ts";
|
|
3
|
+
import type { IrohRemoteAuditLogger } from "../core/remote/iroh/audit.ts";
|
|
4
|
+
import type { IrohRemoteClientAuthorizationSuccess } from "../core/remote/iroh/authorization.ts";
|
|
5
|
+
import type { IrohRemoteHostEngine } from "../core/remote/iroh/engine.ts";
|
|
6
|
+
import { IrohRemoteHandshakeError, type IrohRemoteHandshakeSuccess, type IrohRemoteHello } from "../core/remote/iroh/handshake.ts";
|
|
7
|
+
import { type IrohRemoteHostHandshakeFailureOutcome, type IrohRemoteRuntimeToolPolicy } from "../core/remote/iroh/protocol.ts";
|
|
8
|
+
import type { IrohRemoteWorkspace, IrohRemoteWorkspaceWorktree } from "../core/remote/iroh/state.ts";
|
|
9
|
+
import type { IrohRemoteHostStateManager } from "../core/remote/iroh/state-manager.ts";
|
|
10
|
+
import { createIrohRemoteAgentRuntimeWithSessionSelection, type IrohRemoteAgentRuntimeConversationTarget } from "../modes/rpc/iroh-remote-agent-runtime.ts";
|
|
11
|
+
import { type DetachedRuntimeRetentionHandle } from "../remote/integrated-runtime-retention.ts";
|
|
12
|
+
import type { IntegratedConversationSessionSelection } from "./handshake-responses.ts";
|
|
13
|
+
import { type WorkspaceDirectoryResolution } from "./workspace-directory.ts";
|
|
14
|
+
export interface IntegratedRuntimeSubscriber {
|
|
15
|
+
id: string;
|
|
16
|
+
attachedAt: number;
|
|
17
|
+
}
|
|
18
|
+
interface IntegratedWorkflowState {
|
|
19
|
+
workflowEvent: Record<string, unknown> | undefined;
|
|
20
|
+
activeTools: Map<string, Record<string, unknown>>;
|
|
21
|
+
}
|
|
22
|
+
export interface IntegratedRuntimeEntry {
|
|
23
|
+
key: string;
|
|
24
|
+
clientNodeId: string;
|
|
25
|
+
workspaceName: string;
|
|
26
|
+
sessionId: string;
|
|
27
|
+
runtime: AgentSessionRuntime;
|
|
28
|
+
recordedSessionId: string;
|
|
29
|
+
previousSessionIds: Set<string>;
|
|
30
|
+
activeWorkflows: Map<string, IntegratedWorkflowState>;
|
|
31
|
+
subscribers: Set<IntegratedRuntimeSubscriber>;
|
|
32
|
+
detachedAt: number | undefined;
|
|
33
|
+
detachedRuntimeRetention: DetachedRuntimeRetentionHandle | undefined;
|
|
34
|
+
parentSessionId?: string;
|
|
35
|
+
subagentId?: string;
|
|
36
|
+
/** Set when the runtime cwd is a daemon-managed worktree checkout. */
|
|
37
|
+
worktreeId?: string;
|
|
38
|
+
/** Host-local checkout path (sanitizer root); never sent on the wire. */
|
|
39
|
+
worktreePath?: string;
|
|
40
|
+
/** Registered-workspace-relative git source root for nested repo worktrees. */
|
|
41
|
+
worktreeSourceRootRelativePath?: string;
|
|
42
|
+
/** POSIX-style path relative to the registered workspace root. Omitted for root. */
|
|
43
|
+
workingDirectory?: string;
|
|
44
|
+
/** Immutable tool policy used to create this shared runtime. */
|
|
45
|
+
toolPolicy: IrohRemoteRuntimeToolPolicy;
|
|
46
|
+
}
|
|
47
|
+
export interface IntegratedRuntimeStreamWriter {
|
|
48
|
+
sessionId: string;
|
|
49
|
+
write?(value: object): Promise<void> | void;
|
|
50
|
+
}
|
|
51
|
+
export interface IntegratedRuntimeRegistryOptions {
|
|
52
|
+
agentDir?: string;
|
|
53
|
+
profile?: string;
|
|
54
|
+
/** Injectable runtime factory (tests); defaults to the real iroh remote runtime. */
|
|
55
|
+
createRuntime?: typeof createIrohRemoteAgentRuntimeWithSessionSelection;
|
|
56
|
+
auditLogger: IrohRemoteAuditLogger;
|
|
57
|
+
stateManager: IrohRemoteHostStateManager;
|
|
58
|
+
activeStreams: IrohRemoteActiveStreamRegistry;
|
|
59
|
+
detachedRuntimeTtlMs: () => number;
|
|
60
|
+
/** Resolve the effective daemon-owned runtime policy. The client grant must remain the ceiling. */
|
|
61
|
+
getToolPolicy?: (workspace: IrohRemoteWorkspace, clientAllowTools: string) => IrohRemoteRuntimeToolPolicy;
|
|
62
|
+
/** Legacy workspace-policy seam. It is intersected with the client grant, never used as a replacement. */
|
|
63
|
+
getAllowTools?: (workspace: IrohRemoteWorkspace) => string | undefined;
|
|
64
|
+
getProjectTrustedForWorkspace: (workspace: IrohRemoteWorkspace) => boolean;
|
|
65
|
+
setClientLastSessionId: IrohRemoteHostEngine["setClientLastSessionId"];
|
|
66
|
+
/**
|
|
67
|
+
* Worktree resolution seam (wired to the daemon's WorktreeManager). Must
|
|
68
|
+
* throw a conversation-open error for an unknown/unavailable worktree.
|
|
69
|
+
*/
|
|
70
|
+
resolveWorktree?: (workspaceName: string, hello: IrohRemoteHello, targetSessionId: string | undefined) => Promise<IrohRemoteWorkspaceWorktree | undefined>;
|
|
71
|
+
/** Resolve/validate a selected working directory before creating a runtime. */
|
|
72
|
+
resolveWorkingDirectory?: (options: {
|
|
73
|
+
workspace: IrohRemoteWorkspace;
|
|
74
|
+
rootPath: string;
|
|
75
|
+
workingDirectory?: string;
|
|
76
|
+
worktree?: IrohRemoteWorkspaceWorktree;
|
|
77
|
+
}) => Promise<WorkspaceDirectoryResolution>;
|
|
78
|
+
/** Persist the sessionId → worktree binding after a created worktree conversation. */
|
|
79
|
+
bindWorktreeSession?: (workspaceName: string, worktreeId: string, sessionId: string) => Promise<void>;
|
|
80
|
+
/** Lease-broker seam: invoked when a runtime's session id changes (rekey). */
|
|
81
|
+
onRuntimeRekeyed?: (workspaceName: string, previousSessionId: string, sessionId: string) => void;
|
|
82
|
+
onRuntimeDisposed?: (entry: IntegratedRuntimeEntry, reason: string) => void;
|
|
83
|
+
}
|
|
84
|
+
export declare function createConversationOpenError(outcome: IrohRemoteHostHandshakeFailureOutcome, message: string, details?: Record<string, unknown>): IrohRemoteHandshakeError;
|
|
85
|
+
export declare function createIrohRuntimeConversationTarget(hello: IrohRemoteHello, authorization: IrohRemoteClientAuthorizationSuccess): IrohRemoteAgentRuntimeConversationTarget;
|
|
86
|
+
export declare function getResolvedTargetSessionId(hello: IrohRemoteHello, authorization: IrohRemoteClientAuthorizationSuccess): string | undefined;
|
|
87
|
+
export declare function createConversationSessionSelectionFromEntry(entry: IntegratedRuntimeEntry, requestedSessionId?: string): IntegratedConversationSessionSelection;
|
|
88
|
+
export declare class IntegratedRuntimeRegistry {
|
|
89
|
+
private readonly options;
|
|
90
|
+
private readonly entries;
|
|
91
|
+
constructor(options: IntegratedRuntimeRegistryOptions);
|
|
92
|
+
/** The conversation runtime key: one runtime per (workspaceName, sessionId). */
|
|
93
|
+
getRegistryKey(workspaceName: string, sessionId: string): string;
|
|
94
|
+
get size(): number;
|
|
95
|
+
values(): IntegratedRuntimeEntry[];
|
|
96
|
+
findOwner(workspaceName: string, sessionId: string): IntegratedRuntimeEntry | undefined;
|
|
97
|
+
private resolveToolPolicy;
|
|
98
|
+
getOrCreateEntry(handshake: {
|
|
99
|
+
hello: IrohRemoteHello;
|
|
100
|
+
response: IrohRemoteHandshakeSuccess;
|
|
101
|
+
}, authorization: IrohRemoteClientAuthorizationSuccess): Promise<{
|
|
102
|
+
entry: IntegratedRuntimeEntry;
|
|
103
|
+
created: boolean;
|
|
104
|
+
sessionSelection: IntegratedConversationSessionSelection;
|
|
105
|
+
}>;
|
|
106
|
+
private resolveInitialWorkingDirectory;
|
|
107
|
+
private createEntry;
|
|
108
|
+
private createEntryRecord;
|
|
109
|
+
private registerSubagentRuntime;
|
|
110
|
+
commitEntry(entry: IntegratedRuntimeEntry, sessionSelection: IntegratedConversationSessionSelection, authorization: IrohRemoteClientAuthorizationSuccess): Promise<void>;
|
|
111
|
+
cleanupUncommittedEntry(entry: IntegratedRuntimeEntry, sessionSelection: IntegratedConversationSessionSelection | undefined): Promise<void>;
|
|
112
|
+
attachSubscriber(entry: IntegratedRuntimeEntry): Promise<IntegratedRuntimeSubscriber>;
|
|
113
|
+
detachSubscriber(entry: IntegratedRuntimeEntry, subscriber: IntegratedRuntimeSubscriber, reason: string, error?: unknown): Promise<void>;
|
|
114
|
+
detachWithoutSubscriber(entry: IntegratedRuntimeEntry, reason: string): Promise<void>;
|
|
115
|
+
stopEntry(entry: IntegratedRuntimeEntry, reason: string): Promise<void>;
|
|
116
|
+
stopAll(reason: string): Promise<void>;
|
|
117
|
+
stopForClient(clientNodeId: string, reason: string): Promise<number>;
|
|
118
|
+
stopForWorkspace(workspaceName: string, reason: string, excludeEntry?: IntegratedRuntimeEntry): Promise<number>;
|
|
119
|
+
stopForClientWorkspace(clientNodeId: string, workspaceName: string, reason: string): Promise<number>;
|
|
120
|
+
handleSessionChanged(entry: IntegratedRuntimeEntry, activeStreamEntry: IntegratedRuntimeStreamWriter | undefined, session: {
|
|
121
|
+
sessionId: string;
|
|
122
|
+
}, authorization: IrohRemoteClientAuthorizationSuccess): Promise<void>;
|
|
123
|
+
private rekeyEntry;
|
|
124
|
+
private recordSessionChange;
|
|
125
|
+
recordWorkflowEvent(entry: IntegratedRuntimeEntry, event: Record<string, unknown>): void;
|
|
126
|
+
handleWorkflowEvent(entry: IntegratedRuntimeEntry, event: Record<string, unknown>, excludedActiveStreamEntry: IntegratedRuntimeStreamWriter | undefined): Promise<void>;
|
|
127
|
+
replayWorkflowEvents(activeStreamEntry: IntegratedRuntimeStreamWriter, entry: IntegratedRuntimeEntry): Promise<void>;
|
|
128
|
+
cancelRetention(entry: IntegratedRuntimeEntry): void;
|
|
129
|
+
isDetached(entry: IntegratedRuntimeEntry): boolean;
|
|
130
|
+
scheduleRetention(entry: IntegratedRuntimeEntry, detachReason: string, ttlOverrideMs?: number): void;
|
|
131
|
+
getEntryDetails(entry: IntegratedRuntimeEntry, extraDetails?: Record<string, unknown>): Record<string, unknown>;
|
|
132
|
+
logEntryAudit(entry: IntegratedRuntimeEntry, type: string, details?: Record<string, unknown>, success?: boolean, error?: string): Promise<void>;
|
|
133
|
+
private logSessionSelection;
|
|
134
|
+
private logAudit;
|
|
135
|
+
}
|
|
136
|
+
export {};
|
|
137
|
+
//# sourceMappingURL=integrated-runtimes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrated-runtimes.d.ts","sourceRoot":"","sources":["../../src/daemon/integrated-runtimes.ts"],"names":[],"mappings":"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","sourcesContent":["import { realpath, rm } from \"node:fs/promises\";\nimport { relative, sep } from \"node:path\";\nimport type { AgentSessionRuntime } from \"../core/agent-session-runtime.ts\";\nimport type { IrohRemoteActiveStreamRegistry } from \"../core/remote/iroh/active-stream-registry.ts\";\nimport type { IrohRemoteAuditLogger } from \"../core/remote/iroh/audit.ts\";\nimport type { IrohRemoteClientAuthorizationSuccess } from \"../core/remote/iroh/authorization.ts\";\nimport type { IrohRemoteHostEngine } from \"../core/remote/iroh/engine.ts\";\nimport {\n\tIrohRemoteHandshakeError,\n\ttype IrohRemoteHandshakeSuccess,\n\ttype IrohRemoteHello,\n\tisIrohRemoteSessionId,\n} from \"../core/remote/iroh/handshake.ts\";\nimport { shouldReplaceIrohRemoteIntegratedRuntimeForAuthorization } from \"../core/remote/iroh/host-policy.ts\";\nimport {\n\ttype IrohRemoteHostHandshakeFailureOutcome,\n\ttype IrohRemoteRuntimeToolPolicy,\n\tisIrohRemoteRuntimeToolPolicyWithin,\n\tresolveIrohRemoteRuntimeToolPolicy,\n} from \"../core/remote/iroh/protocol.ts\";\nimport type { IrohRemoteWorkspace, IrohRemoteWorkspaceWorktree } from \"../core/remote/iroh/state.ts\";\nimport type { IrohRemoteHostStateManager } from \"../core/remote/iroh/state-manager.ts\";\nimport { getDefaultSessionDir } from \"../core/session-manager.ts\";\nimport {\n\tcreateIrohRemoteAgentRuntimeWithSessionSelection,\n\ttype IrohRemoteAgentRuntimeConversationTarget,\n\ttype IrohRemoteSubagentRuntimeCreatedEvent,\n} from \"../modes/rpc/iroh-remote-agent-runtime.ts\";\nimport {\n\ttype DetachedRuntimeRetentionHandle,\n\tscheduleDetachedRuntimeRetention,\n} from \"../remote/integrated-runtime-retention.ts\";\nimport type { IntegratedConversationSessionSelection } from \"./handshake-responses.ts\";\nimport { isPathInside, resolveWorkspaceDirectory, type WorkspaceDirectoryResolution } from \"./workspace-directory.ts\";\nimport { getRegisteredWorkingDirectoryForWorktree } from \"./worktree-manager.ts\";\n\nexport interface IntegratedRuntimeSubscriber {\n\tid: string;\n\tattachedAt: number;\n}\n\ninterface IntegratedWorkflowState {\n\tworkflowEvent: Record<string, unknown> | undefined;\n\tactiveTools: Map<string, Record<string, unknown>>;\n}\n\nexport interface IntegratedRuntimeEntry {\n\tkey: string;\n\tclientNodeId: string;\n\tworkspaceName: string;\n\tsessionId: string;\n\truntime: AgentSessionRuntime;\n\trecordedSessionId: string;\n\tpreviousSessionIds: Set<string>;\n\tactiveWorkflows: Map<string, IntegratedWorkflowState>;\n\tsubscribers: Set<IntegratedRuntimeSubscriber>;\n\tdetachedAt: number | undefined;\n\tdetachedRuntimeRetention: DetachedRuntimeRetentionHandle | undefined;\n\tparentSessionId?: string;\n\tsubagentId?: string;\n\t/** Set when the runtime cwd is a daemon-managed worktree checkout. */\n\tworktreeId?: string;\n\t/** Host-local checkout path (sanitizer root); never sent on the wire. */\n\tworktreePath?: string;\n\t/** Registered-workspace-relative git source root for nested repo worktrees. */\n\tworktreeSourceRootRelativePath?: string;\n\t/** POSIX-style path relative to the registered workspace root. Omitted for root. */\n\tworkingDirectory?: string;\n\t/** Immutable tool policy used to create this shared runtime. */\n\ttoolPolicy: IrohRemoteRuntimeToolPolicy;\n}\n\nexport interface IntegratedRuntimeStreamWriter {\n\tsessionId: string;\n\twrite?(value: object): Promise<void> | void;\n}\n\nexport interface IntegratedRuntimeRegistryOptions {\n\tagentDir?: string;\n\tprofile?: string;\n\t/** Injectable runtime factory (tests); defaults to the real iroh remote runtime. */\n\tcreateRuntime?: typeof createIrohRemoteAgentRuntimeWithSessionSelection;\n\tauditLogger: IrohRemoteAuditLogger;\n\tstateManager: IrohRemoteHostStateManager;\n\tactiveStreams: IrohRemoteActiveStreamRegistry;\n\tdetachedRuntimeTtlMs: () => number;\n\t/** Resolve the effective daemon-owned runtime policy. The client grant must remain the ceiling. */\n\tgetToolPolicy?: (workspace: IrohRemoteWorkspace, clientAllowTools: string) => IrohRemoteRuntimeToolPolicy;\n\t/** Legacy workspace-policy seam. It is intersected with the client grant, never used as a replacement. */\n\tgetAllowTools?: (workspace: IrohRemoteWorkspace) => string | undefined;\n\tgetProjectTrustedForWorkspace: (workspace: IrohRemoteWorkspace) => boolean;\n\tsetClientLastSessionId: IrohRemoteHostEngine[\"setClientLastSessionId\"];\n\t/**\n\t * Worktree resolution seam (wired to the daemon's WorktreeManager). Must\n\t * throw a conversation-open error for an unknown/unavailable worktree.\n\t */\n\tresolveWorktree?: (\n\t\tworkspaceName: string,\n\t\thello: IrohRemoteHello,\n\t\ttargetSessionId: string | undefined,\n\t) => Promise<IrohRemoteWorkspaceWorktree | undefined>;\n\t/** Resolve/validate a selected working directory before creating a runtime. */\n\tresolveWorkingDirectory?: (options: {\n\t\tworkspace: IrohRemoteWorkspace;\n\t\trootPath: string;\n\t\tworkingDirectory?: string;\n\t\tworktree?: IrohRemoteWorkspaceWorktree;\n\t}) => Promise<WorkspaceDirectoryResolution>;\n\t/** Persist the sessionId → worktree binding after a created worktree conversation. */\n\tbindWorktreeSession?: (workspaceName: string, worktreeId: string, sessionId: string) => Promise<void>;\n\t/** Lease-broker seam: invoked when a runtime's session id changes (rekey). */\n\tonRuntimeRekeyed?: (workspaceName: string, previousSessionId: string, sessionId: string) => void;\n\tonRuntimeDisposed?: (entry: IntegratedRuntimeEntry, reason: string) => void;\n}\n\nexport function createConversationOpenError(\n\toutcome: IrohRemoteHostHandshakeFailureOutcome,\n\tmessage: string,\n\tdetails: Record<string, unknown> = {},\n): IrohRemoteHandshakeError {\n\tconst error = new IrohRemoteHandshakeError(outcome, message);\n\tObject.assign(error, details);\n\treturn error;\n}\n\nexport function createIrohRuntimeConversationTarget(\n\thello: IrohRemoteHello,\n\tauthorization: IrohRemoteClientAuthorizationSuccess,\n): IrohRemoteAgentRuntimeConversationTarget {\n\tif (hello.mode !== \"conversation\") {\n\t\tthrow new Error(\"integrated runtime requires a conversation stream\");\n\t}\n\tif (hello.conversation.target === \"new\") {\n\t\treturn { target: \"new\" };\n\t}\n\tif (hello.conversation.target === \"session\") {\n\t\treturn { target: \"session\", sessionId: hello.conversation.sessionId };\n\t}\n\tconst previousSessionId = authorization.client.lastSessionIdByWorkspace?.[authorization.workspace.name];\n\treturn previousSessionId === undefined ? { target: \"last\" } : { target: \"last\", resumeSessionId: previousSessionId };\n}\n\nexport function getResolvedTargetSessionId(\n\thello: IrohRemoteHello,\n\tauthorization: IrohRemoteClientAuthorizationSuccess,\n): string | undefined {\n\tif (hello.mode !== \"conversation\") {\n\t\treturn undefined;\n\t}\n\tif (hello.conversation.target === \"session\") {\n\t\treturn hello.conversation.sessionId;\n\t}\n\tif (hello.conversation.target !== \"last\") {\n\t\treturn undefined;\n\t}\n\tconst previousSessionId = authorization.client.lastSessionIdByWorkspace?.[authorization.workspace.name];\n\treturn isIrohRemoteSessionId(previousSessionId) ? previousSessionId : undefined;\n}\n\nexport function createConversationSessionSelectionFromEntry(\n\tentry: IntegratedRuntimeEntry,\n\trequestedSessionId: string = entry.sessionId,\n): IntegratedConversationSessionSelection {\n\tif (requestedSessionId !== entry.sessionId) {\n\t\treturn {\n\t\t\tkind: \"session_rekeyed\",\n\t\t\trequestedSessionId,\n\t\t\tsessionId: entry.sessionId,\n\t\t};\n\t}\n\treturn {\n\t\tkind: \"resumed\",\n\t\trequestedSessionId: entry.sessionId,\n\t\tsessionId: entry.sessionId,\n\t};\n}\n\nlet integratedRuntimeSubscriberSequence = 0;\n\nfunction getRequestedWorkingDirectory(hello: IrohRemoteHello): string | undefined {\n\treturn hello.mode === \"conversation\" && hello.conversation.target === \"new\"\n\t\t? hello.conversation.workingDirectory\n\t\t: undefined;\n}\n\nasync function resolveRuntimeWorkingDirectory(rootPath: string, cwd: string): Promise<WorkspaceDirectoryResolution> {\n\tlet rootReal: string;\n\tlet cwdReal: string;\n\ttry {\n\t\trootReal = await realpath(rootPath);\n\t\tcwdReal = await realpath(cwd);\n\t} catch {\n\t\tthrow createConversationOpenError(\"session_unavailable\", \"session working directory is unavailable\");\n\t}\n\tif (!isPathInside(rootReal, cwdReal)) {\n\t\tthrow createConversationOpenError(\n\t\t\t\"session_unavailable\",\n\t\t\t\"stored session working directory is outside the authorized workspace\",\n\t\t);\n\t}\n\tconst relativePath = relative(rootReal, cwdReal).split(sep).join(\"/\");\n\treturn {\n\t\tabsolutePath: cwdReal,\n\t\t...(relativePath.length === 0 ? {} : { relativePath }),\n\t};\n}\n\nexport class IntegratedRuntimeRegistry {\n\tprivate readonly options: IntegratedRuntimeRegistryOptions;\n\tprivate readonly entries = new Map<string, IntegratedRuntimeEntry>();\n\n\tconstructor(options: IntegratedRuntimeRegistryOptions) {\n\t\tthis.options = options;\n\t}\n\n\t/** The conversation runtime key: one runtime per (workspaceName, sessionId). */\n\tgetRegistryKey(workspaceName: string, sessionId: string): string {\n\t\treturn `${workspaceName}\\0${sessionId}`;\n\t}\n\n\tget size(): number {\n\t\treturn this.entries.size;\n\t}\n\n\tvalues(): IntegratedRuntimeEntry[] {\n\t\treturn Array.from(this.entries.values());\n\t}\n\n\tfindOwner(workspaceName: string, sessionId: string): IntegratedRuntimeEntry | undefined {\n\t\tconst direct = this.entries.get(this.getRegistryKey(workspaceName, sessionId));\n\t\tif (direct) {\n\t\t\treturn direct;\n\t\t}\n\t\tfor (const entry of this.entries.values()) {\n\t\t\tif (entry.workspaceName === workspaceName && entry.previousSessionIds.has(sessionId)) {\n\t\t\t\treturn entry;\n\t\t\t}\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tprivate resolveToolPolicy(authorization: IrohRemoteClientAuthorizationSuccess): IrohRemoteRuntimeToolPolicy {\n\t\treturn (\n\t\t\tthis.options.getToolPolicy?.(authorization.workspace, authorization.allowTools) ??\n\t\t\tresolveIrohRemoteRuntimeToolPolicy({\n\t\t\t\tclientAllowTools: authorization.allowTools,\n\t\t\t\tworkspaceAllowTools: this.options.getAllowTools?.(authorization.workspace),\n\t\t\t\tdaemonAllowTools: null,\n\t\t\t})\n\t\t);\n\t}\n\n\tasync getOrCreateEntry(\n\t\thandshake: { hello: IrohRemoteHello; response: IrohRemoteHandshakeSuccess },\n\t\tauthorization: IrohRemoteClientAuthorizationSuccess,\n\t): Promise<{\n\t\tentry: IntegratedRuntimeEntry;\n\t\tcreated: boolean;\n\t\tsessionSelection: IntegratedConversationSessionSelection;\n\t}> {\n\t\tconst targetSessionId = getResolvedTargetSessionId(handshake.hello, authorization);\n\t\tif (targetSessionId !== undefined) {\n\t\t\t// One runtime per conversation: any paired client attaches to an existing\n\t\t\t// runtime for the target (conversation_in_use is retired; single-user model).\n\t\t\tconst existing = this.findOwner(authorization.workspace.name, targetSessionId);\n\t\t\tif (existing) {\n\t\t\t\tif (!shouldReplaceIrohRemoteIntegratedRuntimeForAuthorization(authorization)) {\n\t\t\t\t\tconst attachingPolicy = this.resolveToolPolicy(authorization);\n\t\t\t\t\tif (!isIrohRemoteRuntimeToolPolicyWithin(existing.toolPolicy, attachingPolicy)) {\n\t\t\t\t\t\tthrow createConversationOpenError(\n\t\t\t\t\t\t\t\"conversation_in_use\",\n\t\t\t\t\t\t\t\"conversation is using tools outside this client's persisted grant\",\n\t\t\t\t\t\t\t{ workspace: authorization.workspace.name, sessionId: targetSessionId },\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t// Reattach recognized: cancel the pending detached-runtime TTL sweep\n\t\t\t\t\t// synchronously, before the caller's multi-await commit window. The\n\t\t\t\t\t// broker flips to daemon-active immediately (commitDaemonRuntime) but\n\t\t\t\t\t// attachSubscriber (which normally cancels retention) only runs after\n\t\t\t\t\t// several awaits; if the TTL timer elapsed in that window it would\n\t\t\t\t\t// dispose this very runtime mid-reattach (use-after-dispose + split\n\t\t\t\t\t// lease/registry ownership). detachedAt stays set so attachSubscriber\n\t\t\t\t\t// still logs the reattach and a pre-subscriber failure re-arms retention.\n\t\t\t\t\tthis.cancelRetention(existing);\n\t\t\t\t\tconst requestedSessionId =\n\t\t\t\t\t\thandshake.hello.mode === \"conversation\" && handshake.hello.conversation.target === \"session\"\n\t\t\t\t\t\t\t? targetSessionId\n\t\t\t\t\t\t\t: existing.sessionId;\n\t\t\t\t\treturn {\n\t\t\t\t\t\tentry: existing,\n\t\t\t\t\t\tcreated: false,\n\t\t\t\t\t\tsessionSelection: createConversationSessionSelectionFromEntry(existing, requestedSessionId),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tawait this.stopEntry(existing, \"fresh_pairing_replaced_runtime\");\n\t\t\t}\n\t\t}\n\t\treturn this.createEntry(handshake, authorization);\n\t}\n\n\tprivate async resolveInitialWorkingDirectory(options: {\n\t\tworkspace: IrohRemoteWorkspace;\n\t\trootPath: string;\n\t\tworkingDirectory?: string;\n\t\tworktree?: IrohRemoteWorkspaceWorktree;\n\t}): Promise<WorkspaceDirectoryResolution> {\n\t\tif (this.options.resolveWorkingDirectory) {\n\t\t\treturn this.options.resolveWorkingDirectory(options);\n\t\t}\n\t\tconst resolved = await resolveWorkspaceDirectory(options.rootPath, options.workingDirectory);\n\t\tif (!resolved.ok) {\n\t\t\tthrow createConversationOpenError(\"invalid_conversation_target\", resolved.error, {\n\t\t\t\tworkspace: options.workspace.name,\n\t\t\t});\n\t\t}\n\t\treturn resolved.value;\n\t}\n\n\tprivate async createEntry(\n\t\thandshake: { hello: IrohRemoteHello },\n\t\tauthorization: IrohRemoteClientAuthorizationSuccess,\n\t): Promise<{\n\t\tentry: IntegratedRuntimeEntry;\n\t\tcreated: boolean;\n\t\tsessionSelection: IntegratedConversationSessionSelection;\n\t}> {\n\t\tlet runtime: AgentSessionRuntime | undefined;\n\t\tlet sessionSelection: IntegratedConversationSessionSelection | undefined;\n\t\ttry {\n\t\t\t// Resolve any worktree binding first: explicit worktreeId on \"new\", or a\n\t\t\t// persisted sessionId binding on resume. Trust and allowTools stay pinned\n\t\t\t// to the PARENT workspace; only cwd changes. The session dir is ALWAYS\n\t\t\t// parent-keyed so worktree sessions stay listed under the workspace.\n\t\t\tconst worktree = await this.options.resolveWorktree?.(\n\t\t\t\tauthorization.workspace.name,\n\t\t\t\thandshake.hello,\n\t\t\t\tgetResolvedTargetSessionId(handshake.hello, authorization),\n\t\t\t);\n\t\t\tconst rootPath = worktree?.path ?? authorization.workspace.path;\n\t\t\tconst requestedWorkingDirectory = getRequestedWorkingDirectory(handshake.hello);\n\t\t\tconst initialDirectory = await this.resolveInitialWorkingDirectory({\n\t\t\t\tworkspace: authorization.workspace,\n\t\t\t\trootPath,\n\t\t\t\tworkingDirectory: requestedWorkingDirectory,\n\t\t\t\t...(worktree === undefined ? {} : { worktree }),\n\t\t\t});\n\t\t\tconst toolPolicy = this.resolveToolPolicy(authorization);\n\t\t\tconst runtimeResult = await (this.options.createRuntime ?? createIrohRemoteAgentRuntimeWithSessionSelection)({\n\t\t\t\tagentDir: this.options.agentDir,\n\t\t\t\ttoolPolicy,\n\t\t\t\tconversationTarget: createIrohRuntimeConversationTarget(handshake.hello, authorization),\n\t\t\t\tcwd: initialDirectory.absolutePath,\n\t\t\t\tprojectCwd: rootPath,\n\t\t\t\tsessionDir: getDefaultSessionDir(authorization.workspace.path, this.options.agentDir),\n\t\t\t\tvalidateCwd: async (cwd) => {\n\t\t\t\t\tawait resolveRuntimeWorkingDirectory(rootPath, cwd);\n\t\t\t\t},\n\t\t\t\tonSubagentRuntimeCreated: (event) => this.registerSubagentRuntime(event, authorization),\n\t\t\t\tprofile: this.options.profile,\n\t\t\t\tprojectTrusted: this.options.getProjectTrustedForWorkspace(authorization.workspace),\n\t\t\t});\n\t\t\truntime = runtimeResult.runtime;\n\t\t\tsessionSelection = runtimeResult.sessionSelection;\n\t\t\tconst runtimeDirectory = await resolveRuntimeWorkingDirectory(rootPath, runtime.cwd);\n\t\t\tconst remoteWorkingDirectory =\n\t\t\t\tworktree === undefined\n\t\t\t\t\t? runtimeDirectory.relativePath\n\t\t\t\t\t: getRegisteredWorkingDirectoryForWorktree(worktree, runtimeDirectory.relativePath);\n\t\t\tconst echoedWorkingDirectory =\n\t\t\t\thandshake.hello.mode === \"conversation\" &&\n\t\t\t\thandshake.hello.conversation.target === \"new\" &&\n\t\t\t\trequestedWorkingDirectory === undefined\n\t\t\t\t\t? undefined\n\t\t\t\t\t: remoteWorkingDirectory;\n\t\t\tconst sessionId = runtime.session.sessionId;\n\t\t\tconst owner = this.findOwner(authorization.workspace.name, sessionId);\n\t\t\tif (owner) {\n\t\t\t\tawait cleanupUncommittedRuntime(runtime, sessionSelection);\n\t\t\t\tif (!isIrohRemoteRuntimeToolPolicyWithin(owner.toolPolicy, toolPolicy)) {\n\t\t\t\t\tthrow createConversationOpenError(\n\t\t\t\t\t\t\"conversation_in_use\",\n\t\t\t\t\t\t\"conversation is using tools outside this client's persisted grant\",\n\t\t\t\t\t\t{ workspace: authorization.workspace.name, sessionId },\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tentry: owner,\n\t\t\t\t\tcreated: false,\n\t\t\t\t\tsessionSelection: createConversationSessionSelectionFromEntry(owner),\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst entry = this.createEntryRecord({\n\t\t\t\tclientNodeId: authorization.client.nodeId,\n\t\t\t\tworkspaceName: authorization.workspace.name,\n\t\t\t\tsessionId,\n\t\t\t\truntime,\n\t\t\t\t...(worktree === undefined\n\t\t\t\t\t? {}\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tworktreeId: worktree.id,\n\t\t\t\t\t\t\tworktreePath: worktree.path,\n\t\t\t\t\t\t\t...(worktree.sourceRootRelativePath === undefined\n\t\t\t\t\t\t\t\t? {}\n\t\t\t\t\t\t\t\t: { worktreeSourceRootRelativePath: worktree.sourceRootRelativePath }),\n\t\t\t\t\t\t}),\n\t\t\t\t...(echoedWorkingDirectory === undefined ? {} : { workingDirectory: echoedWorkingDirectory }),\n\t\t\t\ttoolPolicy,\n\t\t\t});\n\t\t\tif (\n\t\t\t\tworktree !== undefined &&\n\t\t\t\tsessionSelection.kind === \"created\" &&\n\t\t\t\thandshake.hello.mode === \"conversation\" &&\n\t\t\t\thandshake.hello.conversation.target === \"new\"\n\t\t\t) {\n\t\t\t\tawait this.options.bindWorktreeSession?.(authorization.workspace.name, worktree.id, sessionId);\n\t\t\t}\n\t\t\treturn { entry, created: true, sessionSelection };\n\t\t} catch (error) {\n\t\t\tif (runtime) {\n\t\t\t\tawait cleanupUncommittedRuntime(runtime, sessionSelection);\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tprivate createEntryRecord(options: {\n\t\tclientNodeId: string;\n\t\tworkspaceName: string;\n\t\tsessionId: string;\n\t\truntime: AgentSessionRuntime;\n\t\tparentSessionId?: string;\n\t\tsubagentId?: string;\n\t\tworktreeId?: string;\n\t\tworktreePath?: string;\n\t\tworktreeSourceRootRelativePath?: string;\n\t\tworkingDirectory?: string;\n\t\ttoolPolicy: IrohRemoteRuntimeToolPolicy;\n\t}): IntegratedRuntimeEntry {\n\t\treturn {\n\t\t\tkey: this.getRegistryKey(options.workspaceName, options.sessionId),\n\t\t\tclientNodeId: options.clientNodeId,\n\t\t\tworkspaceName: options.workspaceName,\n\t\t\tsessionId: options.sessionId,\n\t\t\truntime: options.runtime,\n\t\t\trecordedSessionId: options.sessionId,\n\t\t\tpreviousSessionIds: new Set(),\n\t\t\tactiveWorkflows: new Map(),\n\t\t\tsubscribers: new Set(),\n\t\t\tdetachedAt: undefined,\n\t\t\tdetachedRuntimeRetention: undefined,\n\t\t\t...(options.parentSessionId === undefined ? {} : { parentSessionId: options.parentSessionId }),\n\t\t\t...(options.subagentId === undefined ? {} : { subagentId: options.subagentId }),\n\t\t\t...(options.worktreeId === undefined ? {} : { worktreeId: options.worktreeId }),\n\t\t\t...(options.worktreePath === undefined ? {} : { worktreePath: options.worktreePath }),\n\t\t\t...(options.worktreeSourceRootRelativePath === undefined\n\t\t\t\t? {}\n\t\t\t\t: { worktreeSourceRootRelativePath: options.worktreeSourceRootRelativePath }),\n\t\t\t...(options.workingDirectory === undefined ? {} : { workingDirectory: options.workingDirectory }),\n\t\t\ttoolPolicy: {\n\t\t\t\ttools: [...options.toolPolicy.tools],\n\t\t\t\tallowUnlistedExtensionTools: options.toolPolicy.allowUnlistedExtensionTools,\n\t\t\t},\n\t\t};\n\t}\n\n\tprivate async registerSubagentRuntime(\n\t\tevent: IrohRemoteSubagentRuntimeCreatedEvent,\n\t\tauthorization: IrohRemoteClientAuthorizationSuccess,\n\t): Promise<void> {\n\t\tconst parentEntry = this.findOwner(authorization.workspace.name, event.parentSessionId);\n\t\tif (!parentEntry) {\n\t\t\tthrow new Error(`Parent runtime is not active for subagent session ${event.sessionId}`);\n\t\t}\n\t\tconst owner = this.findOwner(authorization.workspace.name, event.sessionId);\n\t\tif (owner) {\n\t\t\treturn;\n\t\t}\n\t\tconst entry = this.createEntryRecord({\n\t\t\tclientNodeId: authorization.client.nodeId,\n\t\t\tworkspaceName: authorization.workspace.name,\n\t\t\tsessionId: event.sessionId,\n\t\t\truntime: event.runtime,\n\t\t\tparentSessionId: event.parentSessionId,\n\t\t\tsubagentId: event.id,\n\t\t\ttoolPolicy: parentEntry.toolPolicy,\n\t\t});\n\t\tentry.detachedAt = Date.now();\n\t\tthis.entries.set(entry.key, entry);\n\t\tawait this.logEntryAudit(entry, \"remote_runtime_started\", {\n\t\t\tparentSessionId: event.parentSessionId,\n\t\t\treason: \"subagent_created\",\n\t\t\tsubagentId: event.id,\n\t\t});\n\t\tthis.scheduleRetention(entry, \"subagent_created\");\n\t}\n\n\tasync commitEntry(\n\t\tentry: IntegratedRuntimeEntry,\n\t\tsessionSelection: IntegratedConversationSessionSelection,\n\t\tauthorization: IrohRemoteClientAuthorizationSuccess,\n\t): Promise<void> {\n\t\tconst owner = this.findOwner(authorization.workspace.name, entry.sessionId);\n\t\tif (owner && owner !== entry) {\n\t\t\t// Two attaches raced to create the same conversation runtime; the loser\n\t\t\t// retries and attaches to the winner.\n\t\t\tthrow createConversationOpenError(\"duplicate_conversation_connection\", \"conversation runtime already active\", {\n\t\t\t\tworkspace: authorization.workspace.name,\n\t\t\t\tsessionId: entry.sessionId,\n\t\t\t\tretryAfterMs: 500,\n\t\t\t});\n\t\t}\n\n\t\tconst inserted = this.entries.get(entry.key) !== entry;\n\t\tif (inserted) {\n\t\t\tthis.entries.set(entry.key, entry);\n\t\t}\n\n\t\ttry {\n\t\t\tif (entry.parentSessionId === undefined) {\n\t\t\t\tawait this.options.setClientLastSessionId(\n\t\t\t\t\tauthorization.client.nodeId,\n\t\t\t\t\tauthorization.workspace.name,\n\t\t\t\t\tentry.sessionId,\n\t\t\t\t);\n\t\t\t}\n\t\t\tawait this.logSessionSelection(sessionSelection, authorization);\n\t\t\tif (inserted) {\n\t\t\t\tawait this.logAudit({\n\t\t\t\t\ttype: \"runtime_started\",\n\t\t\t\t\tclientNodeId: authorization.client.nodeId,\n\t\t\t\t\tworkspace: authorization.workspace.name,\n\t\t\t\t\tsuccess: true,\n\t\t\t\t\tdetails: this.getEntryDetails(entry),\n\t\t\t\t});\n\t\t\t\tawait this.logEntryAudit(entry, \"remote_runtime_started\", { reason: \"created\" });\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (inserted && this.entries.get(entry.key) === entry) {\n\t\t\t\tthis.entries.delete(entry.key);\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tasync cleanupUncommittedEntry(\n\t\tentry: IntegratedRuntimeEntry,\n\t\tsessionSelection: IntegratedConversationSessionSelection | undefined,\n\t): Promise<void> {\n\t\tif (this.entries.get(entry.key) === entry) {\n\t\t\tthis.entries.delete(entry.key);\n\t\t}\n\t\tthis.cancelRetention(entry);\n\t\tentry.subscribers.clear();\n\t\tawait cleanupUncommittedRuntime(entry.runtime, sessionSelection);\n\t}\n\n\tasync attachSubscriber(entry: IntegratedRuntimeEntry): Promise<IntegratedRuntimeSubscriber> {\n\t\tconst wasDetached = entry.subscribers.size === 0 && entry.detachedAt !== undefined;\n\t\tthis.cancelRetention(entry);\n\t\tconst subscriber: IntegratedRuntimeSubscriber = {\n\t\t\tid: `subscriber-${++integratedRuntimeSubscriberSequence}`,\n\t\t\tattachedAt: Date.now(),\n\t\t};\n\t\tentry.subscribers.add(subscriber);\n\t\tif (wasDetached) {\n\t\t\tentry.detachedAt = undefined;\n\t\t\tawait this.logEntryAudit(entry, \"remote_runtime_reattached\", {\n\t\t\t\treason: \"subscriber_attached\",\n\t\t\t\tsubscriberId: subscriber.id,\n\t\t\t});\n\t\t}\n\t\tawait this.logEntryAudit(entry, \"remote_subscriber_attached\", { subscriberId: subscriber.id });\n\t\treturn subscriber;\n\t}\n\n\tasync detachSubscriber(\n\t\tentry: IntegratedRuntimeEntry,\n\t\tsubscriber: IntegratedRuntimeSubscriber,\n\t\treason: string,\n\t\terror?: unknown,\n\t): Promise<void> {\n\t\tif (!entry.subscribers.delete(subscriber)) {\n\t\t\treturn;\n\t\t}\n\t\tconst errorMessage = error instanceof Error ? error.message : error ? String(error) : undefined;\n\t\tawait this.logEntryAudit(\n\t\t\tentry,\n\t\t\t\"remote_subscriber_detached\",\n\t\t\t{ reason, subscriberId: subscriber.id },\n\t\t\terrorMessage === undefined,\n\t\t\terrorMessage,\n\t\t);\n\t\tif (entry.subscribers.size > 0) {\n\t\t\treturn;\n\t\t}\n\t\tentry.detachedAt = Date.now();\n\t\tawait this.logEntryAudit(entry, \"remote_runtime_detached\", { detachedAt: entry.detachedAt, reason });\n\t\tthis.scheduleRetention(entry, reason);\n\t}\n\n\tasync detachWithoutSubscriber(entry: IntegratedRuntimeEntry, reason: string): Promise<void> {\n\t\tif (this.entries.get(entry.key) !== entry || entry.subscribers.size > 0) {\n\t\t\treturn;\n\t\t}\n\t\tif (entry.detachedAt !== undefined) {\n\t\t\t// Already detached. A reattach that cancelled retention but then failed\n\t\t\t// before attachSubscriber ran can leave a detached entry with no timer;\n\t\t\t// re-arm so it is still swept rather than lingering forever. Honor the\n\t\t\t// ORIGINAL detach deadline (remaining TTL from detachedAt) instead of a\n\t\t\t// fresh full TTL, so repeated reconnect-then-abort cycles cannot keep\n\t\t\t// resetting the retention clock.\n\t\t\tif (!entry.detachedRuntimeRetention) {\n\t\t\t\tconst remainingTtlMs = Math.max(0, this.options.detachedRuntimeTtlMs() - (Date.now() - entry.detachedAt));\n\t\t\t\tthis.scheduleRetention(entry, reason, remainingTtlMs);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tentry.detachedAt = Date.now();\n\t\tawait this.logEntryAudit(entry, \"remote_runtime_detached\", { detachedAt: entry.detachedAt, reason });\n\t\tthis.scheduleRetention(entry, reason);\n\t}\n\n\tasync stopEntry(entry: IntegratedRuntimeEntry, reason: string): Promise<void> {\n\t\tif (this.entries.get(entry.key) !== entry) {\n\t\t\t// Stale reference: the key may now belong to a replacement runtime, and\n\t\t\t// deleting by key alone would evict that runtime from the registry while\n\t\t\t// leaving it running unmanaged.\n\t\t\treturn;\n\t\t}\n\t\tthis.cancelRetention(entry);\n\t\tthis.entries.delete(entry.key);\n\t\tentry.subscribers.clear();\n\t\tentry.activeWorkflows.clear();\n\t\tentry.detachedAt = undefined;\n\t\tconst wasActive = entry.runtime.session.isBusy;\n\t\tconst removedLiveActivityCount = await this.options.stateManager.removeClientLiveActivitiesForSession(\n\t\t\tentry.clientNodeId,\n\t\t\tentry.workspaceName,\n\t\t\tentry.sessionId,\n\t\t);\n\t\tlet stopSuccess = true;\n\t\tlet stopError: string | undefined;\n\t\ttry {\n\t\t\tawait entry.runtime.dispose();\n\t\t} catch (error) {\n\t\t\tstopSuccess = false;\n\t\t\tstopError = error instanceof Error ? error.message : String(error);\n\t\t}\n\t\tawait this.logAudit({\n\t\t\ttype: \"runtime_stopped\",\n\t\t\tclientNodeId: entry.clientNodeId,\n\t\t\tworkspace: entry.workspaceName,\n\t\t\tsuccess: stopSuccess,\n\t\t\terror: stopError,\n\t\t\tdetails: this.getEntryDetails(entry, { active: wasActive, reason, removedLiveActivityCount }),\n\t\t});\n\t\tawait this.logEntryAudit(\n\t\t\tentry,\n\t\t\t\"remote_runtime_stopped\",\n\t\t\t{ active: wasActive, reason, removedLiveActivityCount },\n\t\t\tstopSuccess,\n\t\t\tstopError,\n\t\t);\n\t\tthis.options.onRuntimeDisposed?.(entry, reason);\n\t}\n\n\tasync stopAll(reason: string): Promise<void> {\n\t\tfor (const entry of this.values()) {\n\t\t\tawait this.stopEntry(entry, reason);\n\t\t}\n\t}\n\n\tasync stopForClient(clientNodeId: string, reason: string): Promise<number> {\n\t\tlet stoppedCount = 0;\n\t\tfor (const entry of this.values()) {\n\t\t\tif (entry.clientNodeId !== clientNodeId) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tawait this.stopEntry(entry, reason);\n\t\t\tstoppedCount++;\n\t\t}\n\t\treturn stoppedCount;\n\t}\n\n\tasync stopForWorkspace(\n\t\tworkspaceName: string,\n\t\treason: string,\n\t\texcludeEntry?: IntegratedRuntimeEntry,\n\t): Promise<number> {\n\t\tlet stoppedCount = 0;\n\t\tfor (const entry of this.values()) {\n\t\t\tif (entry.workspaceName !== workspaceName || entry === excludeEntry) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tawait this.stopEntry(entry, reason);\n\t\t\tstoppedCount++;\n\t\t}\n\t\treturn stoppedCount;\n\t}\n\n\tasync stopForClientWorkspace(clientNodeId: string, workspaceName: string, reason: string): Promise<number> {\n\t\tlet stoppedCount = 0;\n\t\tfor (const entry of this.values()) {\n\t\t\tif (entry.clientNodeId !== clientNodeId || entry.workspaceName !== workspaceName) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tawait this.stopEntry(entry, reason);\n\t\t\tstoppedCount++;\n\t\t}\n\t\treturn stoppedCount;\n\t}\n\n\tasync handleSessionChanged(\n\t\tentry: IntegratedRuntimeEntry,\n\t\tactiveStreamEntry: IntegratedRuntimeStreamWriter | undefined,\n\t\tsession: { sessionId: string },\n\t\tauthorization: IrohRemoteClientAuthorizationSuccess,\n\t): Promise<void> {\n\t\tif (session.sessionId !== entry.sessionId) {\n\t\t\tawait this.rekeyEntry(entry, activeStreamEntry, session.sessionId);\n\t\t}\n\t\tif (session.sessionId === entry.recordedSessionId) {\n\t\t\treturn;\n\t\t}\n\t\tentry.recordedSessionId = session.sessionId;\n\t\tawait this.recordSessionChange(entry, session.sessionId, authorization);\n\t}\n\n\tprivate async rekeyEntry(\n\t\tentry: IntegratedRuntimeEntry,\n\t\tactiveStreamEntry: IntegratedRuntimeStreamWriter | undefined,\n\t\tnextSessionId: string,\n\t): Promise<void> {\n\t\tconst previousSessionId = entry.sessionId;\n\t\tconst previousKey = entry.key;\n\t\tconst nextKey = this.getRegistryKey(entry.workspaceName, nextSessionId);\n\t\tconst existing = this.entries.get(nextKey);\n\t\tif (existing && existing !== entry) {\n\t\t\tawait this.stopEntry(existing, \"session_change_replaced_runtime\");\n\t\t}\n\t\tif (this.entries.get(previousKey) === entry) {\n\t\t\tthis.entries.delete(previousKey);\n\t\t}\n\t\tentry.previousSessionIds.add(previousSessionId);\n\t\tentry.sessionId = nextSessionId;\n\t\tentry.key = nextKey;\n\t\tthis.entries.set(nextKey, entry);\n\t\t// Re-key EVERY stream bound to the old conversation id, not just the one\n\t\t// that drove this session change. Workflow-event fan-out matches streams by\n\t\t// the runtime's current sessionId, so a co-attached device left on the stale\n\t\t// id would be silently dropped from all future events.\n\t\tfor (const stream of this.options.activeStreams.entriesForConversationKey(\n\t\t\tentry.workspaceName,\n\t\t\tpreviousSessionId,\n\t\t)) {\n\t\t\tstream.sessionId = nextSessionId;\n\t\t}\n\t\tif (activeStreamEntry) {\n\t\t\t// Defensive: the driving stream is normally already in the registry, but\n\t\t\t// keep it consistent even if this runs before it was registered.\n\t\t\tactiveStreamEntry.sessionId = nextSessionId;\n\t\t}\n\t\tawait this.logEntryAudit(entry, \"remote_runtime_session_changed\", {\n\t\t\tpreviousSessionId,\n\t\t\tsessionId: nextSessionId,\n\t\t});\n\t\tthis.options.onRuntimeRekeyed?.(entry.workspaceName, previousSessionId, nextSessionId);\n\t}\n\n\tprivate async recordSessionChange(\n\t\tentry: IntegratedRuntimeEntry,\n\t\tsessionId: string,\n\t\tauthorization: IrohRemoteClientAuthorizationSuccess,\n\t): Promise<void> {\n\t\tif (entry.parentSessionId !== undefined) {\n\t\t\tawait this.logAudit({\n\t\t\t\ttype: \"session_changed\",\n\t\t\t\tclientNodeId: authorization.client.nodeId,\n\t\t\t\tworkspace: authorization.workspace.name,\n\t\t\t\tsuccess: true,\n\t\t\t\tdetails: {\n\t\t\t\t\treason: \"remote_rpc_session_change\",\n\t\t\t\t\tsessionId,\n\t\t\t\t\tparentSessionId: entry.parentSessionId,\n\t\t\t\t\t...(entry.subagentId === undefined ? {} : { subagentId: entry.subagentId }),\n\t\t\t\t\tlastSessionUpdated: false,\n\t\t\t\t},\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst client = await this.options.setClientLastSessionId(\n\t\t\t\tauthorization.client.nodeId,\n\t\t\t\tauthorization.workspace.name,\n\t\t\t\tsessionId,\n\t\t\t);\n\t\t\tawait this.logAudit({\n\t\t\t\ttype: \"session_changed\",\n\t\t\t\tclientNodeId: authorization.client.nodeId,\n\t\t\t\tworkspace: authorization.workspace.name,\n\t\t\t\tsuccess: client !== undefined,\n\t\t\t\terror: client ? undefined : \"client not found\",\n\t\t\t\tdetails: { reason: \"remote_rpc_session_change\", sessionId },\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tawait this.logAudit({\n\t\t\t\ttype: \"session_changed\",\n\t\t\t\tclientNodeId: authorization.client.nodeId,\n\t\t\t\tworkspace: authorization.workspace.name,\n\t\t\t\tsuccess: false,\n\t\t\t\terror: error instanceof Error ? error.message : String(error),\n\t\t\t\tdetails: { reason: \"remote_rpc_session_change\", sessionId },\n\t\t\t});\n\t\t}\n\t}\n\n\t// ==========================================================================\n\t// Workflow event replay\n\t// ==========================================================================\n\n\trecordWorkflowEvent(entry: IntegratedRuntimeEntry, event: Record<string, unknown>): void {\n\t\tconst workflowId = getWorkflowEventId(event);\n\t\tif (!workflowId) {\n\t\t\treturn;\n\t\t}\n\t\tif (event.type === \"workflow_start\" || event.type === \"workflow_update\") {\n\t\t\tconst state = entry.activeWorkflows.get(workflowId) ?? { workflowEvent: undefined, activeTools: new Map() };\n\t\t\tstate.workflowEvent = event;\n\t\t\tentry.activeWorkflows.set(workflowId, state);\n\t\t\treturn;\n\t\t}\n\t\tif (event.type === \"workflow_end\") {\n\t\t\tentry.activeWorkflows.delete(workflowId);\n\t\t\treturn;\n\t\t}\n\t\tif (event.type === \"tool_execution_start\") {\n\t\t\tconst toolCallId = getWorkflowToolCallId(event);\n\t\t\tif (!toolCallId) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst state = entry.activeWorkflows.get(workflowId) ?? { workflowEvent: undefined, activeTools: new Map() };\n\t\t\tstate.activeTools.set(toolCallId, event);\n\t\t\tentry.activeWorkflows.set(workflowId, state);\n\t\t\treturn;\n\t\t}\n\t\tif (event.type === \"tool_execution_end\") {\n\t\t\tconst toolCallId = getWorkflowToolCallId(event);\n\t\t\tif (!toolCallId) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tentry.activeWorkflows.get(workflowId)?.activeTools.delete(toolCallId);\n\t\t}\n\t}\n\n\tasync handleWorkflowEvent(\n\t\tentry: IntegratedRuntimeEntry,\n\t\tevent: Record<string, unknown>,\n\t\texcludedActiveStreamEntry: IntegratedRuntimeStreamWriter | undefined,\n\t): Promise<void> {\n\t\tthis.recordWorkflowEvent(entry, event);\n\t\t// Fan out across every co-attached device on this conversation, not just the\n\t\t// runtime creator's clientNodeId — the runtime is shared by (workspace, session),\n\t\t// so a second paired device must also receive live workflow events.\n\t\tconst activeStreams = this.options.activeStreams.entriesForConversationKey(entry.workspaceName, entry.sessionId);\n\t\tawait Promise.allSettled(\n\t\t\tactiveStreams\n\t\t\t\t.filter((activeStream) => activeStream !== excludedActiveStreamEntry && activeStream.write)\n\t\t\t\t.map((activeStream) => Promise.resolve(activeStream.write?.(event))),\n\t\t);\n\t}\n\n\tasync replayWorkflowEvents(\n\t\tactiveStreamEntry: IntegratedRuntimeStreamWriter,\n\t\tentry: IntegratedRuntimeEntry,\n\t): Promise<void> {\n\t\tfor (const state of entry.activeWorkflows.values()) {\n\t\t\tif (state.workflowEvent) {\n\t\t\t\tawait Promise.resolve(activeStreamEntry.write?.(state.workflowEvent)).catch(() => {});\n\t\t\t}\n\t\t\tfor (const toolEvent of state.activeTools.values()) {\n\t\t\t\tawait Promise.resolve(activeStreamEntry.write?.(toolEvent)).catch(() => {});\n\t\t\t}\n\t\t}\n\t}\n\n\t// ==========================================================================\n\t// Retention\n\t// ==========================================================================\n\n\tcancelRetention(entry: IntegratedRuntimeEntry): void {\n\t\tif (!entry.detachedRuntimeRetention) {\n\t\t\treturn;\n\t\t}\n\t\tentry.detachedRuntimeRetention.cancel();\n\t\tentry.detachedRuntimeRetention = undefined;\n\t}\n\n\tisDetached(entry: IntegratedRuntimeEntry): boolean {\n\t\treturn this.entries.get(entry.key) === entry && entry.subscribers.size === 0 && entry.detachedAt !== undefined;\n\t}\n\n\tscheduleRetention(entry: IntegratedRuntimeEntry, detachReason: string, ttlOverrideMs?: number): void {\n\t\tthis.cancelRetention(entry);\n\t\t// A re-arm for an already-detached entry (reattach cancelled retention then\n\t\t// aborted before attach) honors the ORIGINAL detach deadline via an override\n\t\t// rather than restarting a full TTL, so a flaky reconnect-then-abort loop\n\t\t// cannot keep resetting the clock and pin a detached runtime open forever.\n\t\tconst ttlMs = ttlOverrideMs ?? this.options.detachedRuntimeTtlMs();\n\t\tconst handle = scheduleDetachedRuntimeRetention({\n\t\t\tttlMs,\n\t\t\tisDetached: () => this.isDetached(entry),\n\t\t\tisActive: () => entry.runtime.session.isBusy,\n\t\t\twaitForIdle: () => entry.runtime.session.waitForIdle(),\n\t\t\tonExpire: async () => {\n\t\t\t\tif (!this.isDetached(entry) || entry.runtime.session.isBusy) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tawait this.logEntryAudit(entry, \"remote_runtime_retention_expired\", {\n\t\t\t\t\tdetachedAt: entry.detachedAt,\n\t\t\t\t\tdetachReason,\n\t\t\t\t\treason: \"detached_runtime_ttl_expired\",\n\t\t\t\t\tttlMs,\n\t\t\t\t});\n\t\t\t\t// A reattach handshake can commit during the audit-write await above,\n\t\t\t\t// clearing detachedAt / adding a subscriber, or cancel and replace this\n\t\t\t\t// retention. Re-check (and confirm this retention is still the active\n\t\t\t\t// one) before disposing, so the sweep never tears down a runtime that\n\t\t\t\t// was just reattached.\n\t\t\t\tif (!this.isDetached(entry) || entry.runtime.session.isBusy || entry.detachedRuntimeRetention !== handle) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tawait this.stopEntry(entry, \"detached_runtime_ttl_expired\");\n\t\t\t},\n\t\t\tonError: (error) => {\n\t\t\t\tvoid this.logEntryAudit(\n\t\t\t\t\tentry,\n\t\t\t\t\t\"remote_runtime_retention_expired\",\n\t\t\t\t\t{\n\t\t\t\t\t\tdetachedAt: entry.detachedAt,\n\t\t\t\t\t\tdetachReason,\n\t\t\t\t\t\treason: \"detached_runtime_ttl_error\",\n\t\t\t\t\t\tttlMs,\n\t\t\t\t\t},\n\t\t\t\t\tfalse,\n\t\t\t\t\terror instanceof Error ? error.message : String(error),\n\t\t\t\t);\n\t\t\t},\n\t\t});\n\t\tentry.detachedRuntimeRetention = handle;\n\t}\n\n\t// ==========================================================================\n\t// Audit helpers\n\t// ==========================================================================\n\n\tgetEntryDetails(entry: IntegratedRuntimeEntry, extraDetails: Record<string, unknown> = {}): Record<string, unknown> {\n\t\treturn {\n\t\t\truntime: \"integrated-volt\",\n\t\t\tsessionId: entry.sessionId,\n\t\t\tsubscriberCount: entry.subscribers.size,\n\t\t\tactive: entry.runtime.session.isBusy,\n\t\t\t...extraDetails,\n\t\t};\n\t}\n\n\tasync logEntryAudit(\n\t\tentry: IntegratedRuntimeEntry,\n\t\ttype: string,\n\t\tdetails: Record<string, unknown> = {},\n\t\tsuccess = true,\n\t\terror?: string,\n\t): Promise<void> {\n\t\tawait this.logAudit({\n\t\t\ttype,\n\t\t\tclientNodeId: entry.clientNodeId,\n\t\t\tworkspace: entry.workspaceName,\n\t\t\tsuccess,\n\t\t\terror,\n\t\t\tdetails: this.getEntryDetails(entry, details),\n\t\t});\n\t}\n\n\tprivate async logSessionSelection(\n\t\tselection: IntegratedConversationSessionSelection,\n\t\tauthorization: IrohRemoteClientAuthorizationSuccess,\n\t): Promise<void> {\n\t\tconst common = {\n\t\t\tclientNodeId: authorization.client.nodeId,\n\t\t\tworkspace: authorization.workspace.name,\n\t\t};\n\t\tif (selection.kind === \"resumed\") {\n\t\t\tawait this.logAudit({\n\t\t\t\t...common,\n\t\t\t\ttype: \"session_resumed\",\n\t\t\t\tsuccess: true,\n\t\t\t\tdetails: { requestedSessionId: selection.requestedSessionId, sessionId: selection.sessionId },\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tif (selection.kind === \"created_after_missing\") {\n\t\t\tawait this.logAudit({\n\t\t\t\t...common,\n\t\t\t\ttype: \"session_missing_on_resume\",\n\t\t\t\tsuccess: false,\n\t\t\t\terror: \"session not found\",\n\t\t\t\tdetails: { requestedSessionId: selection.requestedSessionId },\n\t\t\t});\n\t\t\tawait this.logAudit({\n\t\t\t\t...common,\n\t\t\t\ttype: \"session_created\",\n\t\t\t\tsuccess: true,\n\t\t\t\tdetails: { reason: \"missing_on_resume\", sessionId: selection.sessionId },\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tif (selection.kind === \"session_rekeyed\") {\n\t\t\tawait this.logAudit({\n\t\t\t\t...common,\n\t\t\t\ttype: \"session_rekeyed\",\n\t\t\t\tsuccess: true,\n\t\t\t\tdetails: { requestedSessionId: selection.requestedSessionId, sessionId: selection.sessionId },\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tawait this.logAudit({\n\t\t\t...common,\n\t\t\ttype: \"session_created\",\n\t\t\tsuccess: true,\n\t\t\tdetails: { reason: \"new_client_connection\", sessionId: selection.sessionId },\n\t\t});\n\t}\n\n\tprivate async logAudit(event: Parameters<IrohRemoteAuditLogger[\"log\"]>[0]): Promise<void> {\n\t\ttry {\n\t\t\tawait this.options.auditLogger.log(event);\n\t\t} catch {\n\t\t\t// Audit logging is best-effort and must not change remote runtime behavior.\n\t\t}\n\t}\n}\n\nasync function cleanupUncommittedRuntime(\n\truntime: AgentSessionRuntime,\n\tsessionSelection: IntegratedConversationSessionSelection | undefined,\n): Promise<void> {\n\tconst sessionFile = runtime.session.sessionFile;\n\tawait runtime.dispose().catch(() => {});\n\tif (sessionSelection?.kind === \"resumed\") {\n\t\treturn;\n\t}\n\tif (typeof sessionFile === \"string\" && sessionFile.length > 0) {\n\t\tawait rm(sessionFile, { force: true }).catch(() => {});\n\t}\n}\n\nfunction getWorkflowEventId(event: Record<string, unknown>): string | undefined {\n\treturn typeof event.workflowId === \"string\" && event.workflowId.trim() ? event.workflowId.trim() : undefined;\n}\n\nfunction getWorkflowToolCallId(event: Record<string, unknown>): string | undefined {\n\treturn typeof event.toolCallId === \"string\" && event.toolCallId.trim() ? event.toolCallId.trim() : undefined;\n}\n"]}
|