@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,165 @@
|
|
|
1
|
+
import { Container, fuzzyFilter, getKeybindings, Input, Spacer, TruncatedText, } from "@hansjm10/volt-tui";
|
|
2
|
+
import { theme } from "../../../core/theme/runtime.js";
|
|
3
|
+
import { DynamicBorder } from "./dynamic-border.js";
|
|
4
|
+
/**
|
|
5
|
+
* Component that renders an auth provider selector
|
|
6
|
+
*/
|
|
7
|
+
export class OAuthSelectorComponent extends Container {
|
|
8
|
+
searchInput;
|
|
9
|
+
// Focusable implementation - propagate to search input for IME cursor positioning
|
|
10
|
+
_focused = false;
|
|
11
|
+
get focused() {
|
|
12
|
+
return this._focused;
|
|
13
|
+
}
|
|
14
|
+
set focused(value) {
|
|
15
|
+
this._focused = value;
|
|
16
|
+
this.searchInput.focused = value;
|
|
17
|
+
}
|
|
18
|
+
listContainer;
|
|
19
|
+
allProviders;
|
|
20
|
+
filteredProviders;
|
|
21
|
+
selectedIndex = 0;
|
|
22
|
+
mode;
|
|
23
|
+
authStorage;
|
|
24
|
+
getAuthStatus;
|
|
25
|
+
onSelectCallback;
|
|
26
|
+
onCancelCallback;
|
|
27
|
+
constructor(mode, authStorage, providers, onSelect, onCancel, getAuthStatus) {
|
|
28
|
+
super();
|
|
29
|
+
this.mode = mode;
|
|
30
|
+
this.authStorage = authStorage;
|
|
31
|
+
this.getAuthStatus = getAuthStatus ?? ((providerId) => this.authStorage.getAuthStatus(providerId));
|
|
32
|
+
this.allProviders = providers;
|
|
33
|
+
this.filteredProviders = providers;
|
|
34
|
+
this.onSelectCallback = onSelect;
|
|
35
|
+
this.onCancelCallback = onCancel;
|
|
36
|
+
// Add top border
|
|
37
|
+
this.addChild(new DynamicBorder());
|
|
38
|
+
this.addChild(new Spacer(1));
|
|
39
|
+
// Add title
|
|
40
|
+
const title = mode === "login" ? "Select provider to configure:" : "Select provider to logout:";
|
|
41
|
+
this.addChild(new TruncatedText(theme.fg("accent", theme.bold(title)), 1, 0));
|
|
42
|
+
this.addChild(new Spacer(1));
|
|
43
|
+
this.searchInput = new Input();
|
|
44
|
+
this.searchInput.onSubmit = () => {
|
|
45
|
+
const selectedProvider = this.filteredProviders[this.selectedIndex];
|
|
46
|
+
if (selectedProvider) {
|
|
47
|
+
this.onSelectCallback(selectedProvider.id);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
this.addChild(this.searchInput);
|
|
51
|
+
this.addChild(new Spacer(1));
|
|
52
|
+
// Create list container
|
|
53
|
+
this.listContainer = new Container();
|
|
54
|
+
this.addChild(this.listContainer);
|
|
55
|
+
this.addChild(new Spacer(1));
|
|
56
|
+
// Add bottom border
|
|
57
|
+
this.addChild(new DynamicBorder());
|
|
58
|
+
// Initial render
|
|
59
|
+
this.filterProviders("");
|
|
60
|
+
}
|
|
61
|
+
filterProviders(query) {
|
|
62
|
+
this.filteredProviders = query
|
|
63
|
+
? fuzzyFilter(this.allProviders, query, (provider) => `${provider.name} ${provider.id} ${provider.authType}`)
|
|
64
|
+
: this.allProviders;
|
|
65
|
+
this.selectedIndex = Math.max(0, Math.min(this.selectedIndex, Math.max(0, this.filteredProviders.length - 1)));
|
|
66
|
+
this.updateList();
|
|
67
|
+
}
|
|
68
|
+
updateList() {
|
|
69
|
+
this.listContainer.clear();
|
|
70
|
+
const maxVisible = 8;
|
|
71
|
+
const startIndex = Math.max(0, Math.min(this.selectedIndex - Math.floor(maxVisible / 2), this.filteredProviders.length - maxVisible));
|
|
72
|
+
const endIndex = Math.min(startIndex + maxVisible, this.filteredProviders.length);
|
|
73
|
+
for (let i = startIndex; i < endIndex; i++) {
|
|
74
|
+
const provider = this.filteredProviders[i];
|
|
75
|
+
if (!provider)
|
|
76
|
+
continue;
|
|
77
|
+
const isSelected = i === this.selectedIndex;
|
|
78
|
+
const statusIndicator = this.formatStatusIndicator(provider);
|
|
79
|
+
let line = "";
|
|
80
|
+
if (isSelected) {
|
|
81
|
+
const prefix = theme.fg("accent", "→ ");
|
|
82
|
+
const text = theme.fg("accent", provider.name);
|
|
83
|
+
line = prefix + text + statusIndicator;
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
const text = ` ${theme.fg("text", provider.name)}`;
|
|
87
|
+
line = text + statusIndicator;
|
|
88
|
+
}
|
|
89
|
+
this.listContainer.addChild(new TruncatedText(line, 1, 0));
|
|
90
|
+
}
|
|
91
|
+
if (startIndex > 0 || endIndex < this.filteredProviders.length) {
|
|
92
|
+
const scrollInfo = theme.fg("muted", ` (${this.selectedIndex + 1}/${this.filteredProviders.length})`);
|
|
93
|
+
this.listContainer.addChild(new TruncatedText(scrollInfo, 1, 0));
|
|
94
|
+
}
|
|
95
|
+
// Show "no providers" if empty
|
|
96
|
+
if (this.filteredProviders.length === 0) {
|
|
97
|
+
const message = this.allProviders.length === 0
|
|
98
|
+
? this.mode === "login"
|
|
99
|
+
? "No providers available"
|
|
100
|
+
: "No providers logged in. Use /login first."
|
|
101
|
+
: "No matching providers";
|
|
102
|
+
this.listContainer.addChild(new TruncatedText(theme.fg("muted", ` ${message}`), 1, 0));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
formatStatusIndicator(provider) {
|
|
106
|
+
const credential = this.authStorage.get(provider.id);
|
|
107
|
+
if (credential?.type === provider.authType)
|
|
108
|
+
return theme.fg("success", " ✓ configured");
|
|
109
|
+
if (credential) {
|
|
110
|
+
const label = credential.type === "oauth" ? "subscription configured" : "API key configured";
|
|
111
|
+
return theme.fg("muted", " • ") + theme.fg("warning", label);
|
|
112
|
+
}
|
|
113
|
+
if (provider.authType !== "api_key")
|
|
114
|
+
return theme.fg("muted", " • unconfigured");
|
|
115
|
+
const status = this.getAuthStatus(provider.id);
|
|
116
|
+
switch (status.source) {
|
|
117
|
+
case "environment":
|
|
118
|
+
return theme.fg("success", ` ✓ env: ${status.label ?? "API key"}`);
|
|
119
|
+
case "runtime":
|
|
120
|
+
return theme.fg("success", " ✓ runtime API key");
|
|
121
|
+
case "fallback":
|
|
122
|
+
return theme.fg("success", " ✓ custom API key");
|
|
123
|
+
case "models_json_key":
|
|
124
|
+
return theme.fg("success", " ✓ key in models.json");
|
|
125
|
+
case "models_json_command":
|
|
126
|
+
return theme.fg("success", " ✓ command in models.json");
|
|
127
|
+
default:
|
|
128
|
+
return theme.fg("muted", " • unconfigured");
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
handleInput(keyData) {
|
|
132
|
+
const kb = getKeybindings();
|
|
133
|
+
// Up arrow
|
|
134
|
+
if (kb.matches(keyData, "tui.select.up")) {
|
|
135
|
+
if (this.filteredProviders.length === 0)
|
|
136
|
+
return;
|
|
137
|
+
this.selectedIndex = Math.max(0, this.selectedIndex - 1);
|
|
138
|
+
this.updateList();
|
|
139
|
+
}
|
|
140
|
+
// Down arrow
|
|
141
|
+
else if (kb.matches(keyData, "tui.select.down")) {
|
|
142
|
+
if (this.filteredProviders.length === 0)
|
|
143
|
+
return;
|
|
144
|
+
this.selectedIndex = Math.min(this.filteredProviders.length - 1, this.selectedIndex + 1);
|
|
145
|
+
this.updateList();
|
|
146
|
+
}
|
|
147
|
+
// Enter
|
|
148
|
+
else if (kb.matches(keyData, "tui.select.confirm")) {
|
|
149
|
+
const selectedProvider = this.filteredProviders[this.selectedIndex];
|
|
150
|
+
if (selectedProvider) {
|
|
151
|
+
this.onSelectCallback(selectedProvider.id);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
// Escape or Ctrl+C
|
|
155
|
+
else if (kb.matches(keyData, "tui.select.cancel")) {
|
|
156
|
+
this.onCancelCallback();
|
|
157
|
+
}
|
|
158
|
+
// Pass everything else to search input
|
|
159
|
+
else {
|
|
160
|
+
this.searchInput.handleInput(keyData);
|
|
161
|
+
this.filterProviders(this.searchInput.getValue());
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=oauth-selector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-selector.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/oauth-selector.ts"],"names":[],"mappings":"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","sourcesContent":["import {\n\tContainer,\n\ttype Focusable,\n\tfuzzyFilter,\n\tgetKeybindings,\n\tInput,\n\tSpacer,\n\tTruncatedText,\n} from \"@hansjm10/volt-tui\";\nimport type { AuthStatus, AuthStorage } from \"../../../core/auth-storage.ts\";\nimport { theme } from \"../../../core/theme/runtime.ts\";\nimport { DynamicBorder } from \"./dynamic-border.ts\";\n\nexport type AuthSelectorProvider = {\n\tid: string;\n\tname: string;\n\tauthType: \"oauth\" | \"api_key\";\n};\n\n/**\n * Component that renders an auth provider selector\n */\nexport class OAuthSelectorComponent extends Container implements Focusable {\n\tprivate searchInput: Input;\n\n\t// Focusable implementation - propagate to search input for IME cursor positioning\n\tprivate _focused = false;\n\tget focused(): boolean {\n\t\treturn this._focused;\n\t}\n\tset focused(value: boolean) {\n\t\tthis._focused = value;\n\t\tthis.searchInput.focused = value;\n\t}\n\n\tprivate listContainer: Container;\n\tprivate allProviders: AuthSelectorProvider[];\n\tprivate filteredProviders: AuthSelectorProvider[];\n\tprivate selectedIndex: number = 0;\n\tprivate mode: \"login\" | \"logout\";\n\tprivate authStorage: AuthStorage;\n\tprivate getAuthStatus: (providerId: string) => AuthStatus;\n\tprivate onSelectCallback: (providerId: string) => void;\n\tprivate onCancelCallback: () => void;\n\n\tconstructor(\n\t\tmode: \"login\" | \"logout\",\n\t\tauthStorage: AuthStorage,\n\t\tproviders: AuthSelectorProvider[],\n\t\tonSelect: (providerId: string) => void,\n\t\tonCancel: () => void,\n\t\tgetAuthStatus?: (providerId: string) => AuthStatus,\n\t) {\n\t\tsuper();\n\n\t\tthis.mode = mode;\n\t\tthis.authStorage = authStorage;\n\t\tthis.getAuthStatus = getAuthStatus ?? ((providerId) => this.authStorage.getAuthStatus(providerId));\n\t\tthis.allProviders = providers;\n\t\tthis.filteredProviders = providers;\n\t\tthis.onSelectCallback = onSelect;\n\t\tthis.onCancelCallback = onCancel;\n\n\t\t// Add top border\n\t\tthis.addChild(new DynamicBorder());\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Add title\n\t\tconst title = mode === \"login\" ? \"Select provider to configure:\" : \"Select provider to logout:\";\n\t\tthis.addChild(new TruncatedText(theme.fg(\"accent\", theme.bold(title)), 1, 0));\n\t\tthis.addChild(new Spacer(1));\n\n\t\tthis.searchInput = new Input();\n\t\tthis.searchInput.onSubmit = () => {\n\t\t\tconst selectedProvider = this.filteredProviders[this.selectedIndex];\n\t\t\tif (selectedProvider) {\n\t\t\t\tthis.onSelectCallback(selectedProvider.id);\n\t\t\t}\n\t\t};\n\t\tthis.addChild(this.searchInput);\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Create list container\n\t\tthis.listContainer = new Container();\n\t\tthis.addChild(this.listContainer);\n\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Add bottom border\n\t\tthis.addChild(new DynamicBorder());\n\n\t\t// Initial render\n\t\tthis.filterProviders(\"\");\n\t}\n\n\tprivate filterProviders(query: string): void {\n\t\tthis.filteredProviders = query\n\t\t\t? fuzzyFilter(this.allProviders, query, (provider) => `${provider.name} ${provider.id} ${provider.authType}`)\n\t\t\t: this.allProviders;\n\t\tthis.selectedIndex = Math.max(0, Math.min(this.selectedIndex, Math.max(0, this.filteredProviders.length - 1)));\n\t\tthis.updateList();\n\t}\n\n\tprivate updateList(): void {\n\t\tthis.listContainer.clear();\n\n\t\tconst maxVisible = 8;\n\t\tconst startIndex = Math.max(\n\t\t\t0,\n\t\t\tMath.min(this.selectedIndex - Math.floor(maxVisible / 2), this.filteredProviders.length - maxVisible),\n\t\t);\n\t\tconst endIndex = Math.min(startIndex + maxVisible, this.filteredProviders.length);\n\n\t\tfor (let i = startIndex; i < endIndex; i++) {\n\t\t\tconst provider = this.filteredProviders[i];\n\t\t\tif (!provider) continue;\n\n\t\t\tconst isSelected = i === this.selectedIndex;\n\n\t\t\tconst statusIndicator = this.formatStatusIndicator(provider);\n\t\t\tlet line = \"\";\n\t\t\tif (isSelected) {\n\t\t\t\tconst prefix = theme.fg(\"accent\", \"→ \");\n\t\t\t\tconst text = theme.fg(\"accent\", provider.name);\n\t\t\t\tline = prefix + text + statusIndicator;\n\t\t\t} else {\n\t\t\t\tconst text = ` ${theme.fg(\"text\", provider.name)}`;\n\t\t\t\tline = text + statusIndicator;\n\t\t\t}\n\n\t\t\tthis.listContainer.addChild(new TruncatedText(line, 1, 0));\n\t\t}\n\n\t\tif (startIndex > 0 || endIndex < this.filteredProviders.length) {\n\t\t\tconst scrollInfo = theme.fg(\"muted\", ` (${this.selectedIndex + 1}/${this.filteredProviders.length})`);\n\t\t\tthis.listContainer.addChild(new TruncatedText(scrollInfo, 1, 0));\n\t\t}\n\n\t\t// Show \"no providers\" if empty\n\t\tif (this.filteredProviders.length === 0) {\n\t\t\tconst message =\n\t\t\t\tthis.allProviders.length === 0\n\t\t\t\t\t? this.mode === \"login\"\n\t\t\t\t\t\t? \"No providers available\"\n\t\t\t\t\t\t: \"No providers logged in. Use /login first.\"\n\t\t\t\t\t: \"No matching providers\";\n\t\t\tthis.listContainer.addChild(new TruncatedText(theme.fg(\"muted\", ` ${message}`), 1, 0));\n\t\t}\n\t}\n\n\tprivate formatStatusIndicator(provider: AuthSelectorProvider): string {\n\t\tconst credential = this.authStorage.get(provider.id);\n\t\tif (credential?.type === provider.authType) return theme.fg(\"success\", \" ✓ configured\");\n\t\tif (credential) {\n\t\t\tconst label = credential.type === \"oauth\" ? \"subscription configured\" : \"API key configured\";\n\t\t\treturn theme.fg(\"muted\", \" • \") + theme.fg(\"warning\", label);\n\t\t}\n\t\tif (provider.authType !== \"api_key\") return theme.fg(\"muted\", \" • unconfigured\");\n\n\t\tconst status = this.getAuthStatus(provider.id);\n\t\tswitch (status.source) {\n\t\t\tcase \"environment\":\n\t\t\t\treturn theme.fg(\"success\", ` ✓ env: ${status.label ?? \"API key\"}`);\n\t\t\tcase \"runtime\":\n\t\t\t\treturn theme.fg(\"success\", \" ✓ runtime API key\");\n\t\t\tcase \"fallback\":\n\t\t\t\treturn theme.fg(\"success\", \" ✓ custom API key\");\n\t\t\tcase \"models_json_key\":\n\t\t\t\treturn theme.fg(\"success\", \" ✓ key in models.json\");\n\t\t\tcase \"models_json_command\":\n\t\t\t\treturn theme.fg(\"success\", \" ✓ command in models.json\");\n\t\t\tdefault:\n\t\t\t\treturn theme.fg(\"muted\", \" • unconfigured\");\n\t\t}\n\t}\n\n\thandleInput(keyData: string): void {\n\t\tconst kb = getKeybindings();\n\t\t// Up arrow\n\t\tif (kb.matches(keyData, \"tui.select.up\")) {\n\t\t\tif (this.filteredProviders.length === 0) return;\n\t\t\tthis.selectedIndex = Math.max(0, this.selectedIndex - 1);\n\t\t\tthis.updateList();\n\t\t}\n\t\t// Down arrow\n\t\telse if (kb.matches(keyData, \"tui.select.down\")) {\n\t\t\tif (this.filteredProviders.length === 0) return;\n\t\t\tthis.selectedIndex = Math.min(this.filteredProviders.length - 1, this.selectedIndex + 1);\n\t\t\tthis.updateList();\n\t\t}\n\t\t// Enter\n\t\telse if (kb.matches(keyData, \"tui.select.confirm\")) {\n\t\t\tconst selectedProvider = this.filteredProviders[this.selectedIndex];\n\t\t\tif (selectedProvider) {\n\t\t\t\tthis.onSelectCallback(selectedProvider.id);\n\t\t\t}\n\t\t}\n\t\t// Escape or Ctrl+C\n\t\telse if (kb.matches(keyData, \"tui.select.cancel\")) {\n\t\t\tthis.onCancelCallback();\n\t\t}\n\t\t// Pass everything else to search input\n\t\telse {\n\t\t\tthis.searchInput.handleInput(keyData);\n\t\t\tthis.filterProviders(this.searchInput.getValue());\n\t\t}\n\t}\n}\n"]}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { type Component } from "@hansjm10/volt-tui";
|
|
2
|
+
import { type IrohRemoteAccessPresetName } from "../../../core/remote/iroh/access-grant.ts";
|
|
3
|
+
import { type ControlEvent, type ControlResponse } from "../../../daemon/control-protocol.ts";
|
|
4
|
+
import { type DaemonProbeState } from "../../../daemon/spawn.ts";
|
|
5
|
+
type RemoteStatus = Extract<ControlResponse, {
|
|
6
|
+
type: "status_result";
|
|
7
|
+
}>;
|
|
8
|
+
type PairingProgress = Extract<ControlEvent, {
|
|
9
|
+
type: "pairing_progress";
|
|
10
|
+
}>;
|
|
11
|
+
export declare class RemoteControlRequestError extends Error {
|
|
12
|
+
readonly code: string;
|
|
13
|
+
constructor(code: string, message: string);
|
|
14
|
+
}
|
|
15
|
+
export type RemoteControlSnapshot = {
|
|
16
|
+
kind: "offline";
|
|
17
|
+
state: DaemonProbeState;
|
|
18
|
+
error?: string;
|
|
19
|
+
invalidState?: {
|
|
20
|
+
path: string;
|
|
21
|
+
error: string;
|
|
22
|
+
};
|
|
23
|
+
} | {
|
|
24
|
+
kind: "online";
|
|
25
|
+
status: RemoteStatus;
|
|
26
|
+
};
|
|
27
|
+
export interface RemotePairingHandle {
|
|
28
|
+
requestId: string;
|
|
29
|
+
dispose(): void;
|
|
30
|
+
}
|
|
31
|
+
export interface RemoteControlBackend {
|
|
32
|
+
load(): Promise<RemoteControlSnapshot>;
|
|
33
|
+
startDaemon(): Promise<void>;
|
|
34
|
+
regenerateState(): Promise<{
|
|
35
|
+
backupPath: string;
|
|
36
|
+
preservedIdentity: boolean;
|
|
37
|
+
}>;
|
|
38
|
+
findRecoveryBackup(): Promise<{
|
|
39
|
+
path: string;
|
|
40
|
+
preservedIdentity: boolean;
|
|
41
|
+
} | undefined>;
|
|
42
|
+
recoverStateBackup(path: string): Promise<{
|
|
43
|
+
preservedIdentity: boolean;
|
|
44
|
+
}>;
|
|
45
|
+
registerCurrentWorkspace(path: string): Promise<{
|
|
46
|
+
name: string;
|
|
47
|
+
path: string;
|
|
48
|
+
}>;
|
|
49
|
+
beginPairing(workspaceName: string, access: IrohRemoteAccessPresetName, onProgress: (event: PairingProgress) => void): Promise<RemotePairingHandle>;
|
|
50
|
+
revokeClient(clientNodeId: string): Promise<void>;
|
|
51
|
+
approveClientRepair(clientNodeId: string): Promise<void>;
|
|
52
|
+
close(): Promise<void>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* A management-only daemon client. It never acquires or releases a conversation
|
|
56
|
+
* lease, so opening and closing /remote cannot transfer ownership of the active
|
|
57
|
+
* session.
|
|
58
|
+
*/
|
|
59
|
+
export declare function createRemoteControlBackend(agentDir?: string): RemoteControlBackend;
|
|
60
|
+
export interface RemoteControlCenterOptions {
|
|
61
|
+
getTerminalRows(): number;
|
|
62
|
+
getCurrentWorkspaceName(): string | undefined;
|
|
63
|
+
getCurrentWorkspacePath(): string;
|
|
64
|
+
currentSessionId: string;
|
|
65
|
+
requestRender(): void;
|
|
66
|
+
copyText(text: string): Promise<void>;
|
|
67
|
+
onClose(): void;
|
|
68
|
+
}
|
|
69
|
+
/** Full-viewport control center for daemon health, phone pairing, and access. */
|
|
70
|
+
export declare class RemoteControlCenterComponent implements Component {
|
|
71
|
+
private readonly backend;
|
|
72
|
+
private readonly options;
|
|
73
|
+
private view;
|
|
74
|
+
private selectedKey;
|
|
75
|
+
private scrollOffset;
|
|
76
|
+
private manualScroll;
|
|
77
|
+
private lastRows;
|
|
78
|
+
private lastPageSize;
|
|
79
|
+
private pairingHandle;
|
|
80
|
+
private pairingAttempt;
|
|
81
|
+
private generation;
|
|
82
|
+
private disposed;
|
|
83
|
+
constructor(backend: RemoteControlBackend, options: RemoteControlCenterOptions);
|
|
84
|
+
start(): Promise<void>;
|
|
85
|
+
invalidate(): void;
|
|
86
|
+
dispose(): void;
|
|
87
|
+
render(width: number): string[];
|
|
88
|
+
handleInput(data: string): void;
|
|
89
|
+
private refresh;
|
|
90
|
+
private startDaemon;
|
|
91
|
+
private regenerateState;
|
|
92
|
+
private recoverStateBackup;
|
|
93
|
+
private registerCurrentWorkspace;
|
|
94
|
+
private beginPairing;
|
|
95
|
+
private onPairingProgress;
|
|
96
|
+
private copyPairingTicket;
|
|
97
|
+
private revokeClient;
|
|
98
|
+
private approveClientRepair;
|
|
99
|
+
private activateSelection;
|
|
100
|
+
private moveSelection;
|
|
101
|
+
private scrollRows;
|
|
102
|
+
private ensureSelection;
|
|
103
|
+
private renderHeader;
|
|
104
|
+
private renderFooter;
|
|
105
|
+
private buildRows;
|
|
106
|
+
private buildPairingRows;
|
|
107
|
+
private renderRow;
|
|
108
|
+
}
|
|
109
|
+
export {};
|
|
110
|
+
//# sourceMappingURL=remote-control-center.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-control-center.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/remote-control-center.ts"],"names":[],"mappings":"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","sourcesContent":["import { isAbsolute, relative, resolve } from \"node:path\";\nimport { type Component, getKeybindings, truncateToWidth, visibleWidth, wrapTextWithAnsi } from \"@hansjm10/volt-tui\";\nimport { getAgentDir, VERSION } from \"../../../config.ts\";\nimport {\n\tIROH_REMOTE_ACCESS_PRESET_NAMES,\n\ttype IrohRemoteAccessPresetName,\n\tisIrohRemoteAccessPresetName,\n} from \"../../../core/remote/iroh/access-grant.ts\";\nimport { formatIrohRemoteTicketQrCode } from \"../../../core/remote/iroh/qr.ts\";\nimport { getIrohRemotePairingVerificationDetails } from \"../../../core/remote/iroh/ticket.ts\";\nimport { theme } from \"../../../core/theme/runtime.ts\";\nimport { createDaemonClient, type DaemonClient } from \"../../../daemon/control-client.ts\";\nimport {\n\tCONTROL_PAIR_CANCEL_CAPABILITY,\n\tCONTROL_RPC_GRANTS_CAPABILITY,\n\ttype ControlEvent,\n\ttype ControlResponse,\n\ttype DaemonRemotePolicyStatus,\n} from \"../../../daemon/control-protocol.ts\";\nimport { type DaemonProbeState, ensureDaemonRunning, probeDaemon, waitForDaemonExit } from \"../../../daemon/spawn.ts\";\nimport {\n\tfindRecoverableVoltdStateBackup,\n\tinspectVoltdStateFiles,\n\trecoverVoltdStateFromBackup,\n\tregenerateInvalidVoltdState,\n} from \"../../../daemon/state.ts\";\nimport { DEFAULT_INTEGRATED_DETACHED_RUNTIME_TTL_MS } from \"../../../remote/integrated-runtime-retention.ts\";\nimport { stripAnsi } from \"../../../utils/ansi.ts\";\nimport { resolveDaemonWorkspaceForCwd } from \"../daemon-attach.ts\";\nimport { DynamicBorder } from \"./dynamic-border.ts\";\nimport { keyHint } from \"./keybinding-hints.ts\";\n\ntype RemoteStatus = Extract<ControlResponse, { type: \"status_result\" }>;\ntype PairingProgress = Extract<ControlEvent, { type: \"pairing_progress\" }>;\n\nexport class RemoteControlRequestError extends Error {\n\treadonly code: string;\n\n\tconstructor(code: string, message: string) {\n\t\tsuper(message);\n\t\tthis.name = \"RemoteControlRequestError\";\n\t\tthis.code = code;\n\t}\n}\n\nconst UNSAFE_TERMINAL_CHARACTERS = /[\\u0000-\\u001f\\u007f-\\u009f\\u202a-\\u202e\\u2066-\\u2069]/g;\n\nexport type RemoteControlSnapshot =\n\t| {\n\t\t\tkind: \"offline\";\n\t\t\tstate: DaemonProbeState;\n\t\t\terror?: string;\n\t\t\tinvalidState?: { path: string; error: string };\n\t }\n\t| { kind: \"online\"; status: RemoteStatus };\n\nexport interface RemotePairingHandle {\n\trequestId: string;\n\tdispose(): void;\n}\n\nexport interface RemoteControlBackend {\n\tload(): Promise<RemoteControlSnapshot>;\n\tstartDaemon(): Promise<void>;\n\tregenerateState(): Promise<{ backupPath: string; preservedIdentity: boolean }>;\n\tfindRecoveryBackup(): Promise<{ path: string; preservedIdentity: boolean } | undefined>;\n\trecoverStateBackup(path: string): Promise<{ preservedIdentity: boolean }>;\n\tregisterCurrentWorkspace(path: string): Promise<{ name: string; path: string }>;\n\tbeginPairing(\n\t\tworkspaceName: string,\n\t\taccess: IrohRemoteAccessPresetName,\n\t\tonProgress: (event: PairingProgress) => void,\n\t): Promise<RemotePairingHandle>;\n\trevokeClient(clientNodeId: string): Promise<void>;\n\tapproveClientRepair(clientNodeId: string): Promise<void>;\n\tclose(): Promise<void>;\n}\n\n/**\n * A management-only daemon client. It never acquires or releases a conversation\n * lease, so opening and closing /remote cannot transfer ownership of the active\n * session.\n */\nexport function createRemoteControlBackend(agentDir: string = getAgentDir()): RemoteControlBackend {\n\tlet client: DaemonClient | undefined;\n\tconst eventHandlers = new Set<(event: ControlEvent) => void>();\n\tconst pendingPairingRequestIds = new Set<string>();\n\tconst pairingCancellations = new Map<string, Promise<void>>();\n\n\tconst cancelPairing = (active: DaemonClient, requestId: string): Promise<void> => {\n\t\tconst existing = pairingCancellations.get(requestId);\n\t\tif (existing) return existing;\n\t\tif (!pendingPairingRequestIds.has(requestId)) return Promise.resolve();\n\t\tconst cancellation = (async () => {\n\t\t\ttry {\n\t\t\t\tif (active.connectionState === \"connected\") {\n\t\t\t\t\tconst response = await active.request({ type: \"pair_cancel\", requestId });\n\t\t\t\t\tif (response.type === \"error\") throw new Error(response.message);\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// A current daemon also invalidates tickets when the owning control connection closes.\n\t\t\t\tawait active.close().catch(() => {});\n\t\t\t} finally {\n\t\t\t\tpendingPairingRequestIds.delete(requestId);\n\t\t\t\tpairingCancellations.delete(requestId);\n\t\t\t}\n\t\t})();\n\t\tpairingCancellations.set(requestId, cancellation);\n\t\treturn cancellation;\n\t};\n\n\tconst closeClient = async (): Promise<void> => {\n\t\tconst active = client;\n\t\tclient = undefined;\n\t\tif (active) {\n\t\t\tawait Promise.all([...pendingPairingRequestIds].map((requestId) => cancelPairing(active, requestId)));\n\t\t}\n\t\tpendingPairingRequestIds.clear();\n\t\tpairingCancellations.clear();\n\t\tawait active?.close();\n\t};\n\n\tconst connect = async (): Promise<DaemonClient> => {\n\t\tif (client?.connectionState === \"connected\") return client;\n\t\tawait closeClient();\n\t\tconst probe = await probeDaemon(agentDir);\n\t\tif (!probe.healthy) throw new Error(`voltd is ${probe.state}`);\n\t\tconst connected = createDaemonClient({\n\t\t\tsocketPath: probe.socketPath,\n\t\t\tauthToken: probe.authToken,\n\t\t\tclient: \"cli\",\n\t\t\tversion: VERSION,\n\t\t\treconnect: false,\n\t\t\tonEvent: (event) => {\n\t\t\t\tfor (const handler of eventHandlers) handler(event);\n\t\t\t},\n\t\t});\n\t\tclient = connected;\n\t\ttry {\n\t\t\tawait connected.connect();\n\t\t\treturn connected;\n\t\t} catch (error) {\n\t\t\tawait closeClient();\n\t\t\tthrow error;\n\t\t}\n\t};\n\n\treturn {\n\t\tasync load() {\n\t\t\tconst probe = await probeDaemon(agentDir);\n\t\t\tif (!probe.healthy) {\n\t\t\t\tconst invalidState = inspectVoltdStateFiles(agentDir);\n\t\t\t\treturn {\n\t\t\t\t\tkind: \"offline\",\n\t\t\t\t\tstate: probe.state,\n\t\t\t\t\t...(invalidState === undefined ? {} : { error: invalidState.error, invalidState }),\n\t\t\t\t};\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst response = await (await connect()).request({ type: \"status\" });\n\t\t\t\tif (response.type === \"error\") throw new Error(response.message);\n\t\t\t\tif (response.type !== \"status_result\") throw new Error(`unexpected ${response.type} response`);\n\t\t\t\treturn { kind: \"online\", status: response };\n\t\t\t} catch (error) {\n\t\t\t\tawait closeClient();\n\t\t\t\treturn {\n\t\t\t\t\tkind: \"offline\",\n\t\t\t\t\tstate: \"unresponsive\",\n\t\t\t\t\terror: error instanceof Error ? error.message : String(error),\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t\tasync startDaemon() {\n\t\t\tconst result = await ensureDaemonRunning(agentDir);\n\t\t\tif (!result.healthy) throw new Error(result.error ?? `voltd did not start (${result.state})`);\n\t\t\tawait closeClient();\n\t\t},\n\t\tasync regenerateState() {\n\t\t\tconst probe = await probeDaemon(agentDir);\n\t\t\tif (probe.healthy || probe.state !== \"not-running\") {\n\t\t\t\tthrow new Error(`voltd must be fully stopped before regenerating state (currently ${probe.state})`);\n\t\t\t}\n\t\t\treturn regenerateInvalidVoltdState(agentDir);\n\t\t},\n\t\tasync findRecoveryBackup() {\n\t\t\treturn findRecoverableVoltdStateBackup(agentDir);\n\t\t},\n\t\tasync recoverStateBackup(path) {\n\t\t\tconst probe = await probeDaemon(agentDir);\n\t\t\tif (probe.healthy) {\n\t\t\t\tconst response = await (await connect()).request({ type: \"shutdown\" });\n\t\t\t\tif (response.type === \"error\") throw new Error(response.message);\n\t\t\t\tawait closeClient();\n\t\t\t\tconst exit = await waitForDaemonExit({\n\t\t\t\t\tagentDir,\n\t\t\t\t\tpid: probe.pid,\n\t\t\t\t\tsocketPath: probe.socketPath,\n\t\t\t\t});\n\t\t\t\tif (exit !== \"exited\") throw new Error(\"voltd did not stop before state recovery\");\n\t\t\t} else if (probe.state !== \"not-running\") {\n\t\t\t\tthrow new Error(`voltd must be stopped before state recovery (currently ${probe.state})`);\n\t\t\t}\n\t\t\tconst recovered = await recoverVoltdStateFromBackup(agentDir, path);\n\t\t\tconst restarted = await ensureDaemonRunning(agentDir);\n\t\t\tif (!restarted.healthy) {\n\t\t\t\tthrow new Error(restarted.error ?? `voltd did not restart (${restarted.state})`);\n\t\t\t}\n\t\t\treturn { preservedIdentity: recovered.preservedIdentity };\n\t\t},\n\t\tasync registerCurrentWorkspace(path) {\n\t\t\tconst workspace = await resolveDaemonWorkspaceForCwd(await connect(), path);\n\t\t\tif (!workspace) throw new Error(\"could not register the current directory with voltd\");\n\t\t\treturn workspace;\n\t\t},\n\t\tasync beginPairing(workspaceName, access, onProgress) {\n\t\t\tconst queued: PairingProgress[] = [];\n\t\t\tlet requestId: string | undefined;\n\t\t\tlet terminal = false;\n\t\t\tconst handler = (event: ControlEvent): void => {\n\t\t\t\tif (event.type !== \"pairing_progress\") return;\n\t\t\t\tif (requestId === undefined) {\n\t\t\t\t\tqueued.push(event);\n\t\t\t\t} else if (event.requestId === requestId) {\n\t\t\t\t\tif (event.phase === \"completed\" || event.phase === \"failed\") {\n\t\t\t\t\t\tterminal = true;\n\t\t\t\t\t\tpendingPairingRequestIds.delete(requestId);\n\t\t\t\t\t}\n\t\t\t\t\tonProgress(event);\n\t\t\t\t}\n\t\t\t};\n\t\t\teventHandlers.add(handler);\n\t\t\ttry {\n\t\t\t\tconst response = await (await connect()).request({ type: \"pair_request\", workspaceName, access });\n\t\t\t\tif (response.type === \"error\") throw new RemoteControlRequestError(response.code, response.message);\n\t\t\t\tif (response.type !== \"pair_started\") throw new Error(`unexpected ${response.type} response`);\n\t\t\t\tconst startedRequestId = response.requestId;\n\t\t\t\trequestId = startedRequestId;\n\t\t\t\tfor (const event of queued) {\n\t\t\t\t\tif (event.requestId !== startedRequestId) continue;\n\t\t\t\t\tif (event.phase === \"completed\" || event.phase === \"failed\") terminal = true;\n\t\t\t\t\tonProgress(event);\n\t\t\t\t}\n\t\t\t\tif (!terminal) pendingPairingRequestIds.add(startedRequestId);\n\t\t\t\treturn {\n\t\t\t\t\trequestId: startedRequestId,\n\t\t\t\t\tdispose: () => {\n\t\t\t\t\t\teventHandlers.delete(handler);\n\t\t\t\t\t\tif (terminal) return;\n\t\t\t\t\t\tterminal = true;\n\t\t\t\t\t\tconst activeClient = client;\n\t\t\t\t\t\tif (activeClient) void cancelPairing(activeClient, startedRequestId);\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t} catch (error) {\n\t\t\t\teventHandlers.delete(handler);\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t},\n\t\tasync revokeClient(clientNodeId) {\n\t\t\tconst response = await (await connect()).request({ type: \"client_revoke\", clientNodeId });\n\t\t\tif (response.type === \"error\") throw new Error(response.message);\n\t\t\tif (response.type !== \"ok\") throw new Error(`unexpected ${response.type} response`);\n\t\t},\n\t\tasync approveClientRepair(clientNodeId) {\n\t\t\tconst response = await (await connect()).request({ type: \"client_approve_repair\", clientNodeId });\n\t\t\tif (response.type === \"error\") throw new Error(response.message);\n\t\t\tif (response.type !== \"ok\") throw new Error(`unexpected ${response.type} response`);\n\t\t},\n\t\tclose: closeClient,\n\t};\n}\n\nexport interface RemoteControlCenterOptions {\n\tgetTerminalRows(): number;\n\tgetCurrentWorkspaceName(): string | undefined;\n\tgetCurrentWorkspacePath(): string;\n\tcurrentSessionId: string;\n\trequestRender(): void;\n\tcopyText(text: string): Promise<void>;\n\tonClose(): void;\n}\n\ntype View =\n\t| { kind: \"loading\"; label: string }\n\t| { kind: \"offline\"; snapshot: Extract<RemoteControlSnapshot, { kind: \"offline\" }> }\n\t| { kind: \"overview\"; status: RemoteStatus; notice?: string }\n\t| { kind: \"access-picker\"; status: RemoteStatus }\n\t| { kind: \"workspace-picker\"; status: RemoteStatus; access: IrohRemoteAccessPresetName }\n\t| { kind: \"confirm-regenerate\"; snapshot: Extract<RemoteControlSnapshot, { kind: \"offline\" }> }\n\t| {\n\t\t\tkind: \"confirm-recover\";\n\t\t\tstatus: RemoteStatus;\n\t\t\tworkspaceName: string;\n\t\t\taccess: IrohRemoteAccessPresetName;\n\t\t\tbackupPath: string;\n\t }\n\t| { kind: \"confirm-revoke\"; status: RemoteStatus; clientNodeId: string }\n\t| { kind: \"confirm-repair\"; status: RemoteStatus; clientNodeId: string }\n\t| {\n\t\t\tkind: \"pairing\";\n\t\t\tstatus: RemoteStatus;\n\t\t\tworkspaceName: string;\n\t\t\taccess: IrohRemoteAccessPresetName;\n\t\t\tphase: \"starting\" | \"ticket\" | \"waiting\" | \"completed\" | \"failed\";\n\t\t\tticket?: string;\n\t\t\tmessage?: string;\n\t\t\trecoveryBackupPath?: string;\n\t\t\tshowQr?: boolean;\n\t };\n\ntype DisplayRow = {\n\tkey?: string;\n\ttext: string;\n\traw?: boolean;\n\ttone?: \"text\" | \"muted\" | \"dim\" | \"accent\" | \"success\" | \"warning\" | \"error\";\n};\n\nfunction formatDuration(ms: number): string {\n\tconst seconds = Math.max(0, Math.floor(ms / 1000));\n\tif (seconds < 60) return `${seconds}s`;\n\tconst minutes = Math.floor(seconds / 60);\n\tif (minutes < 60) return `${minutes}m`;\n\tconst hours = Math.floor(minutes / 60);\n\tif (hours < 48) return `${hours}h ${minutes % 60}m`;\n\treturn `${Math.floor(hours / 24)}d ${hours % 24}h`;\n}\n\nfunction abbreviatedId(value: string, width = 12): string {\n\treturn value.length <= width ? value : `${value.slice(0, Math.max(4, width - 1))}…`;\n}\n\nfunction supportsSafePairing(status: RemoteStatus): boolean {\n\treturn (\n\t\tstatus.capabilities?.includes(CONTROL_PAIR_CANCEL_CAPABILITY) === true &&\n\t\tstatus.capabilities.includes(CONTROL_RPC_GRANTS_CAPABILITY)\n\t);\n}\n\nconst ACCESS_PRESET_DETAILS: Readonly<Record<IrohRemoteAccessPresetName, { label: string; description: string }>> =\n\tObject.freeze({\n\t\tcoding: {\n\t\t\tlabel: \"Coding\",\n\t\t\tdescription: \"Coding tools plus conversation and model controls.\",\n\t\t},\n\t\treview: {\n\t\t\tlabel: \"Review\",\n\t\t\tdescription: \"Read-only tools plus conversation and model controls.\",\n\t\t},\n\t\tchat: {\n\t\t\tlabel: \"Chat\",\n\t\t\tdescription: \"Conversation and model controls without tool access.\",\n\t\t},\n\t\tfull: {\n\t\t\tlabel: \"Full access\",\n\t\t\tdescription: \"Everything: API keys, log upload, host control, worktrees, and workspaces.\",\n\t\t},\n\t});\n\nfunction workspaceForPath(status: RemoteStatus, path: string): RemoteStatus[\"workspaces\"][number] | undefined {\n\tconst currentPath = resolve(path);\n\treturn status.workspaces\n\t\t.filter((workspace) => {\n\t\t\tconst workspacePath = resolve(workspace.path);\n\t\t\tconst pathFromWorkspace = relative(workspacePath, currentPath);\n\t\t\treturn pathFromWorkspace === \"\" || (!pathFromWorkspace.startsWith(\"..\") && !isAbsolute(pathFromWorkspace));\n\t\t})\n\t\t.sort((left, right) => right.path.length - left.path.length)[0];\n}\n\nfunction policyTools(policy: DaemonRemotePolicyStatus, fallback?: string[]): string {\n\tif (policy.allowTools !== null) return policy.allowTools.join(\", \") || \"none\";\n\tif (fallback !== undefined) return fallback.join(\", \") || \"none\";\n\treturn \"per-device grant\";\n}\n\n/** Full-viewport control center for daemon health, phone pairing, and access. */\nexport class RemoteControlCenterComponent implements Component {\n\tprivate readonly backend: RemoteControlBackend;\n\tprivate readonly options: RemoteControlCenterOptions;\n\tprivate view: View = { kind: \"loading\", label: \"Loading remote access…\" };\n\tprivate selectedKey = \"refresh\";\n\tprivate scrollOffset = 0;\n\tprivate manualScroll = false;\n\tprivate lastRows: DisplayRow[] = [];\n\tprivate lastPageSize = 1;\n\tprivate pairingHandle: RemotePairingHandle | undefined;\n\tprivate pairingAttempt = 0;\n\tprivate generation = 0;\n\tprivate disposed = false;\n\n\tconstructor(backend: RemoteControlBackend, options: RemoteControlCenterOptions) {\n\t\tthis.backend = backend;\n\t\tthis.options = options;\n\t}\n\n\tasync start(): Promise<void> {\n\t\tawait this.refresh();\n\t}\n\n\tinvalidate(): void {\n\t\t// Theme styling is resolved during render.\n\t}\n\n\tdispose(): void {\n\t\tif (this.disposed) return;\n\t\tthis.disposed = true;\n\t\tthis.generation++;\n\t\tthis.pairingAttempt++;\n\t\tthis.pairingHandle?.dispose();\n\t\tthis.pairingHandle = undefined;\n\t\tvoid this.backend.close();\n\t}\n\n\trender(width: number): string[] {\n\t\tif (width <= 0) return [];\n\t\tconst height = Math.max(6, this.options.getTerminalRows() || 24);\n\t\tconst header = this.renderHeader(width);\n\t\tconst footer = this.renderFooter(width);\n\t\tconst pageSize = Math.max(1, height - header.length - footer.length);\n\t\tthis.lastPageSize = pageSize;\n\t\tconst rows = this.buildRows(width, pageSize);\n\t\tthis.lastRows = rows;\n\t\tthis.ensureSelection(rows);\n\t\tconst selectedIndex = rows.findIndex((row) => row.key === this.selectedKey);\n\t\tconst maxOffset = Math.max(0, rows.length - pageSize);\n\t\tif (!this.manualScroll && selectedIndex >= 0) {\n\t\t\tif (selectedIndex < this.scrollOffset) this.scrollOffset = selectedIndex;\n\t\t\tif (selectedIndex >= this.scrollOffset + pageSize) this.scrollOffset = selectedIndex - pageSize + 1;\n\t\t}\n\t\tthis.scrollOffset = Math.max(0, Math.min(this.scrollOffset, maxOffset));\n\t\tconst body = rows.slice(this.scrollOffset, this.scrollOffset + pageSize).map((row) => this.renderRow(row, width));\n\t\twhile (body.length < pageSize) body.push(\"\");\n\t\treturn [...header, ...body, ...footer];\n\t}\n\n\thandleInput(data: string): void {\n\t\tconst keybindings = getKeybindings();\n\t\tif (keybindings.matches(data, \"tui.select.cancel\")) {\n\t\t\tif (\n\t\t\t\tthis.view.kind === \"access-picker\" ||\n\t\t\t\tthis.view.kind === \"workspace-picker\" ||\n\t\t\t\tthis.view.kind === \"confirm-regenerate\" ||\n\t\t\t\tthis.view.kind === \"confirm-recover\" ||\n\t\t\t\tthis.view.kind === \"confirm-revoke\" ||\n\t\t\t\tthis.view.kind === \"confirm-repair\" ||\n\t\t\t\tthis.view.kind === \"pairing\"\n\t\t\t) {\n\t\t\t\tif (this.view.kind === \"pairing\") this.pairingAttempt++;\n\t\t\t\tthis.pairingHandle?.dispose();\n\t\t\t\tthis.pairingHandle = undefined;\n\t\t\t\tif (this.view.kind === \"confirm-regenerate\") {\n\t\t\t\t\tthis.view = { kind: \"offline\", snapshot: this.view.snapshot };\n\t\t\t\t\tthis.selectedKey = \"regenerate-state\";\n\t\t\t\t} else if (this.view.kind === \"confirm-recover\") {\n\t\t\t\t\tthis.view = {\n\t\t\t\t\t\tkind: \"pairing\",\n\t\t\t\t\t\tstatus: this.view.status,\n\t\t\t\t\t\tworkspaceName: this.view.workspaceName,\n\t\t\t\t\t\taccess: this.view.access,\n\t\t\t\t\t\tphase: \"failed\",\n\t\t\t\t\t\tmessage: \"Iroh endpoint unavailable\",\n\t\t\t\t\t\trecoveryBackupPath: this.view.backupPath,\n\t\t\t\t\t};\n\t\t\t\t\tthis.selectedKey = \"pairing-recover\";\n\t\t\t\t} else if (this.view.kind === \"workspace-picker\") {\n\t\t\t\t\tconst { status, access } = this.view;\n\t\t\t\t\tthis.view = { kind: \"access-picker\", status };\n\t\t\t\t\tthis.selectedKey = `access:${access}`;\n\t\t\t\t} else {\n\t\t\t\t\tconst returnKey =\n\t\t\t\t\t\tthis.view.kind === \"confirm-revoke\"\n\t\t\t\t\t\t\t? `client:${this.view.clientNodeId}`\n\t\t\t\t\t\t\t: this.view.kind === \"confirm-repair\"\n\t\t\t\t\t\t\t\t? `revoked:${this.view.clientNodeId}`\n\t\t\t\t\t\t\t\t: \"pair\";\n\t\t\t\t\tthis.view = { kind: \"overview\", status: this.view.status };\n\t\t\t\t\tthis.selectedKey = returnKey;\n\t\t\t\t}\n\t\t\t\tthis.scrollOffset = 0;\n\t\t\t\tthis.manualScroll = false;\n\t\t\t\tthis.options.requestRender();\n\t\t\t} else {\n\t\t\t\tthis.options.onClose();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (keybindings.matches(data, \"tui.select.up\")) {\n\t\t\tthis.moveSelection(-1);\n\t\t} else if (keybindings.matches(data, \"tui.select.down\")) {\n\t\t\tthis.moveSelection(1);\n\t\t} else if (keybindings.matches(data, \"tui.select.pageUp\")) {\n\t\t\tthis.scrollRows(-this.lastPageSize);\n\t\t} else if (keybindings.matches(data, \"tui.select.pageDown\")) {\n\t\t\tthis.scrollRows(this.lastPageSize);\n\t\t} else if (keybindings.matches(data, \"tui.select.confirm\")) {\n\t\t\tthis.activateSelection();\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t\tthis.options.requestRender();\n\t}\n\n\tprivate async refresh(notice?: string): Promise<void> {\n\t\tconst generation = ++this.generation;\n\t\tthis.pairingAttempt++;\n\t\tthis.pairingHandle?.dispose();\n\t\tthis.pairingHandle = undefined;\n\t\tthis.view = { kind: \"loading\", label: \"Refreshing remote access…\" };\n\t\tthis.options.requestRender();\n\t\tconst snapshot = await this.backend.load();\n\t\tif (this.disposed || generation !== this.generation) return;\n\t\tthis.view =\n\t\t\tsnapshot.kind === \"online\"\n\t\t\t\t? { kind: \"overview\", status: snapshot.status, ...(notice === undefined ? {} : { notice }) }\n\t\t\t\t: { kind: \"offline\", snapshot };\n\t\tthis.selectedKey = snapshot.kind === \"online\" ? \"refresh\" : \"start\";\n\t\tthis.scrollOffset = 0;\n\t\tthis.manualScroll = false;\n\t\tthis.options.requestRender();\n\t}\n\n\tprivate async startDaemon(): Promise<void> {\n\t\tconst generation = ++this.generation;\n\t\tthis.view = { kind: \"loading\", label: \"Starting voltd…\" };\n\t\tthis.options.requestRender();\n\t\ttry {\n\t\t\tawait this.backend.startDaemon();\n\t\t\tif (this.disposed || generation !== this.generation) return;\n\t\t\tawait this.refresh(\"Daemon started\");\n\t\t} catch (error) {\n\t\t\tif (this.disposed || generation !== this.generation) return;\n\t\t\tthis.view = {\n\t\t\t\tkind: \"offline\",\n\t\t\t\tsnapshot: {\n\t\t\t\t\tkind: \"offline\",\n\t\t\t\t\tstate: \"not-running\",\n\t\t\t\t\terror: error instanceof Error ? error.message : String(error),\n\t\t\t\t},\n\t\t\t};\n\t\t\tthis.selectedKey = \"start\";\n\t\t\tthis.options.requestRender();\n\t\t}\n\t}\n\n\tprivate async regenerateState(): Promise<void> {\n\t\tconst generation = ++this.generation;\n\t\tthis.view = { kind: \"loading\", label: \"Backing up and regenerating daemon state…\" };\n\t\tthis.options.requestRender();\n\t\ttry {\n\t\t\tconst result = await this.backend.regenerateState();\n\t\t\tawait this.backend.startDaemon();\n\t\t\tif (this.disposed || generation !== this.generation) return;\n\t\t\tawait this.refresh(\n\t\t\t\t`Daemon state regenerated; backup saved to ${result.backupPath}${result.preservedIdentity ? \" · Iroh identity preserved\" : \" · new Iroh identity created\"}`,\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tif (this.disposed || generation !== this.generation) return;\n\t\t\tconst snapshot = await this.backend.load();\n\t\t\tif (this.disposed || generation !== this.generation) return;\n\t\t\tthis.view =\n\t\t\t\tsnapshot.kind === \"online\"\n\t\t\t\t\t? { kind: \"overview\", status: snapshot.status, notice: \"Daemon state was regenerated\" }\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tkind: \"offline\",\n\t\t\t\t\t\t\tsnapshot: {\n\t\t\t\t\t\t\t\t...snapshot,\n\t\t\t\t\t\t\t\terror: error instanceof Error ? error.message : String(error),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\tthis.selectedKey =\n\t\t\t\tsnapshot.kind === \"online\" ? \"refresh\" : snapshot.invalidState ? \"regenerate-state\" : \"start\";\n\t\t\tthis.options.requestRender();\n\t\t}\n\t}\n\n\tprivate async recoverStateBackup(backupPath: string): Promise<void> {\n\t\tconst generation = ++this.generation;\n\t\tthis.view = { kind: \"loading\", label: \"Stopping voltd and recovering daemon state…\" };\n\t\tthis.options.requestRender();\n\t\ttry {\n\t\t\tconst result = await this.backend.recoverStateBackup(backupPath);\n\t\t\tif (this.disposed || generation !== this.generation) return;\n\t\t\tawait this.refresh(\n\t\t\t\tresult.preservedIdentity\n\t\t\t\t\t? \"Recovered daemon state and preserved the Iroh identity\"\n\t\t\t\t\t: \"Recovered daemon state with a new Iroh identity; pair phones again\",\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tif (this.disposed || generation !== this.generation) return;\n\t\t\tconst snapshot = await this.backend.load();\n\t\t\tif (this.disposed || generation !== this.generation) return;\n\t\t\tthis.view =\n\t\t\t\tsnapshot.kind === \"online\"\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tkind: \"overview\",\n\t\t\t\t\t\t\tstatus: snapshot.status,\n\t\t\t\t\t\t\tnotice: `State recovery failed: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t\t\t\t}\n\t\t\t\t\t: { kind: \"offline\", snapshot };\n\t\t\tthis.selectedKey = \"refresh\";\n\t\t\tthis.options.requestRender();\n\t\t}\n\t}\n\n\tprivate async registerCurrentWorkspace(): Promise<void> {\n\t\tconst generation = ++this.generation;\n\t\tconst currentPath = this.options.getCurrentWorkspacePath();\n\t\tthis.view = { kind: \"loading\", label: \"Registering current directory…\" };\n\t\tthis.options.requestRender();\n\t\ttry {\n\t\t\tconst workspace = await this.backend.registerCurrentWorkspace(currentPath);\n\t\t\tif (this.disposed || generation !== this.generation) return;\n\t\t\tawait this.refresh(`Workspace ${workspace.name} is available`);\n\t\t} catch (error) {\n\t\t\tif (this.disposed || generation !== this.generation) return;\n\t\t\tconst snapshot = await this.backend.load();\n\t\t\tif (this.disposed || generation !== this.generation) return;\n\t\t\tthis.view =\n\t\t\t\tsnapshot.kind === \"online\"\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tkind: \"overview\",\n\t\t\t\t\t\t\tstatus: snapshot.status,\n\t\t\t\t\t\t\tnotice: `Workspace registration failed: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t\t\t\t}\n\t\t\t\t\t: { kind: \"offline\", snapshot };\n\t\t\tthis.selectedKey = snapshot.kind === \"online\" ? \"register-current\" : \"start\";\n\t\t\tthis.options.requestRender();\n\t\t}\n\t}\n\n\tprivate async beginPairing(\n\t\tworkspaceName: string,\n\t\taccess: IrohRemoteAccessPresetName,\n\t\tstatus: RemoteStatus,\n\t): Promise<void> {\n\t\tconst pairingAttempt = ++this.pairingAttempt;\n\t\tthis.pairingHandle?.dispose();\n\t\tthis.pairingHandle = undefined;\n\t\tthis.view = { kind: \"pairing\", status, workspaceName, access, phase: \"starting\" };\n\t\tthis.selectedKey = \"pairing-back\";\n\t\tthis.scrollOffset = 0;\n\t\tthis.manualScroll = false;\n\t\tthis.options.requestRender();\n\t\ttry {\n\t\t\tconst handle = await this.backend.beginPairing(workspaceName, access, (event) =>\n\t\t\t\tthis.onPairingProgress(event, pairingAttempt),\n\t\t\t);\n\t\t\tif (\n\t\t\t\tthis.disposed ||\n\t\t\t\tpairingAttempt !== this.pairingAttempt ||\n\t\t\t\tthis.view.kind !== \"pairing\" ||\n\t\t\t\tthis.view.workspaceName !== workspaceName ||\n\t\t\t\tthis.view.access !== access\n\t\t\t) {\n\t\t\t\thandle.dispose();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (this.view.phase === \"completed\" || this.view.phase === \"failed\") {\n\t\t\t\thandle.dispose();\n\t\t\t} else {\n\t\t\t\tthis.pairingHandle = handle;\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconst recoveryBackup =\n\t\t\t\terror instanceof RemoteControlRequestError && error.code === \"iroh_unavailable\"\n\t\t\t\t\t? await this.backend.findRecoveryBackup()\n\t\t\t\t\t: undefined;\n\t\t\tif (this.disposed || pairingAttempt !== this.pairingAttempt || this.view.kind !== \"pairing\") return;\n\t\t\tthis.view = {\n\t\t\t\t...this.view,\n\t\t\t\tphase: \"failed\",\n\t\t\t\tmessage: error instanceof Error ? error.message : String(error),\n\t\t\t\t...(recoveryBackup === undefined ? {} : { recoveryBackupPath: recoveryBackup.path }),\n\t\t\t};\n\t\t\tthis.selectedKey = recoveryBackup === undefined ? \"pairing-back\" : \"pairing-recover\";\n\t\t\tthis.options.requestRender();\n\t\t}\n\t}\n\n\tprivate onPairingProgress(event: PairingProgress, pairingAttempt: number): void {\n\t\tif (this.disposed || pairingAttempt !== this.pairingAttempt || this.view.kind !== \"pairing\") return;\n\t\tif (event.phase === \"ticket\" && event.ticket) {\n\t\t\tthis.view = { ...this.view, phase: \"ticket\", ticket: event.ticket };\n\t\t} else if (event.phase === \"waiting\") {\n\t\t\tthis.view = { ...this.view, phase: \"waiting\" };\n\t\t} else if (event.phase === \"completed\") {\n\t\t\tthis.view = {\n\t\t\t\t...this.view,\n\t\t\t\tphase: \"completed\",\n\t\t\t\tmessage: `Paired ${event.clientNodeId ? abbreviatedId(event.clientNodeId, 20) : \"device\"}`,\n\t\t\t\tshowQr: false,\n\t\t\t};\n\t\t\tthis.pairingHandle?.dispose();\n\t\t\tthis.pairingHandle = undefined;\n\t\t} else if (event.phase === \"failed\") {\n\t\t\tthis.view = { ...this.view, phase: \"failed\", message: event.error ?? \"Pairing failed\", showQr: false };\n\t\t\tthis.pairingHandle?.dispose();\n\t\t\tthis.pairingHandle = undefined;\n\t\t}\n\t\tthis.options.requestRender();\n\t}\n\n\tprivate async copyPairingTicket(): Promise<void> {\n\t\tif (this.view.kind !== \"pairing\" || !this.view.ticket) return;\n\t\tconst pairingAttempt = this.pairingAttempt;\n\t\tconst ticket = this.view.ticket;\n\t\ttry {\n\t\t\tawait this.options.copyText(ticket);\n\t\t\tif (\n\t\t\t\t!this.disposed &&\n\t\t\t\tpairingAttempt === this.pairingAttempt &&\n\t\t\t\tthis.view.kind === \"pairing\" &&\n\t\t\t\tthis.view.ticket === ticket\n\t\t\t) {\n\t\t\t\tthis.view = { ...this.view, message: \"Pairing ticket copied\" };\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (\n\t\t\t\t!this.disposed &&\n\t\t\t\tpairingAttempt === this.pairingAttempt &&\n\t\t\t\tthis.view.kind === \"pairing\" &&\n\t\t\t\tthis.view.ticket === ticket\n\t\t\t) {\n\t\t\t\tthis.view = { ...this.view, message: error instanceof Error ? error.message : String(error) };\n\t\t\t}\n\t\t}\n\t\tif (!this.disposed) this.options.requestRender();\n\t}\n\n\tprivate async revokeClient(clientNodeId: string): Promise<void> {\n\t\tconst generation = ++this.generation;\n\t\tthis.view = { kind: \"loading\", label: \"Revoking device…\" };\n\t\tthis.options.requestRender();\n\t\ttry {\n\t\t\tawait this.backend.revokeClient(clientNodeId);\n\t\t\tif (this.disposed || generation !== this.generation) return;\n\t\t\tawait this.refresh(`Revoked ${abbreviatedId(clientNodeId, 20)}`);\n\t\t} catch (error) {\n\t\t\tif (this.disposed || generation !== this.generation) return;\n\t\t\tconst snapshot = await this.backend.load();\n\t\t\tif (this.disposed || generation !== this.generation) return;\n\t\t\tthis.view =\n\t\t\t\tsnapshot.kind === \"online\"\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tkind: \"overview\",\n\t\t\t\t\t\t\tstatus: snapshot.status,\n\t\t\t\t\t\t\tnotice: `Revoke failed: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t\t\t\t}\n\t\t\t\t\t: { kind: \"offline\", snapshot };\n\t\t\tthis.options.requestRender();\n\t\t}\n\t}\n\n\tprivate async approveClientRepair(clientNodeId: string): Promise<void> {\n\t\tconst generation = ++this.generation;\n\t\tthis.view = { kind: \"loading\", label: \"Allowing device to re-pair…\" };\n\t\tthis.options.requestRender();\n\t\ttry {\n\t\t\tawait this.backend.approveClientRepair(clientNodeId);\n\t\t\tif (this.disposed || generation !== this.generation) return;\n\t\t\tawait this.refresh(\"Re-pair approved. Choose Pair a phone and scan a fresh QR.\");\n\t\t} catch (error) {\n\t\t\tif (this.disposed || generation !== this.generation) return;\n\t\t\tconst snapshot = await this.backend.load();\n\t\t\tif (this.disposed || generation !== this.generation) return;\n\t\t\tthis.view =\n\t\t\t\tsnapshot.kind === \"online\"\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tkind: \"overview\",\n\t\t\t\t\t\t\tstatus: snapshot.status,\n\t\t\t\t\t\t\tnotice: `Repair approval failed: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t\t\t\t}\n\t\t\t\t\t: { kind: \"offline\", snapshot };\n\t\t\tthis.selectedKey = snapshot.kind === \"online\" ? `revoked:${clientNodeId}` : \"start\";\n\t\t\tthis.options.requestRender();\n\t\t}\n\t}\n\n\tprivate activateSelection(): void {\n\t\tif (this.view.kind === \"loading\") return;\n\t\tconst key = this.selectedKey;\n\t\tif (key === \"refresh\") {\n\t\t\tvoid this.refresh();\n\t\t\treturn;\n\t\t}\n\t\tif (key === \"start\") {\n\t\t\tvoid this.startDaemon();\n\t\t\treturn;\n\t\t}\n\t\tif (key === \"regenerate-state\" && this.view.kind === \"offline\" && this.view.snapshot.invalidState) {\n\t\t\tthis.view = { kind: \"confirm-regenerate\", snapshot: this.view.snapshot };\n\t\t\tthis.selectedKey = \"confirm-regenerate-state\";\n\t\t\tthis.scrollOffset = 0;\n\t\t\tthis.manualScroll = false;\n\t\t\treturn;\n\t\t}\n\t\tif (key === \"confirm-regenerate-state\" && this.view.kind === \"confirm-regenerate\") {\n\t\t\tvoid this.regenerateState();\n\t\t\treturn;\n\t\t}\n\t\tif (key === \"pairing-recover\" && this.view.kind === \"pairing\" && this.view.recoveryBackupPath) {\n\t\t\tthis.view = {\n\t\t\t\tkind: \"confirm-recover\",\n\t\t\t\tstatus: this.view.status,\n\t\t\t\tworkspaceName: this.view.workspaceName,\n\t\t\t\taccess: this.view.access,\n\t\t\t\tbackupPath: this.view.recoveryBackupPath,\n\t\t\t};\n\t\t\tthis.selectedKey = \"confirm-recover-state\";\n\t\t\tthis.scrollOffset = 0;\n\t\t\tthis.manualScroll = false;\n\t\t\treturn;\n\t\t}\n\t\tif (key === \"confirm-recover-state\" && this.view.kind === \"confirm-recover\") {\n\t\t\tvoid this.recoverStateBackup(this.view.backupPath);\n\t\t\treturn;\n\t\t}\n\t\tif (key === \"register-current\") {\n\t\t\tif (this.view.kind === \"overview\") void this.registerCurrentWorkspace();\n\t\t\treturn;\n\t\t}\n\t\tif (key === \"pair\") {\n\t\t\tif (this.view.kind !== \"overview\" || !supportsSafePairing(this.view.status)) return;\n\t\t\tthis.view = { kind: \"access-picker\", status: this.view.status };\n\t\t\tthis.selectedKey = \"access:coding\";\n\t\t\tthis.scrollOffset = 0;\n\t\t\tthis.manualScroll = false;\n\t\t\treturn;\n\t\t}\n\t\tif (key.startsWith(\"access:\") && this.view.kind === \"access-picker\") {\n\t\t\tconst selectedAccess = key.slice(\"access:\".length);\n\t\t\tif (!isIrohRemoteAccessPresetName(selectedAccess)) return;\n\t\t\tconst currentWorkspace = this.options.getCurrentWorkspaceName();\n\t\t\tconst match = this.view.status.workspaces.find((workspace) => workspace.name === currentWorkspace);\n\t\t\tif (match) {\n\t\t\t\tvoid this.beginPairing(match.name, selectedAccess, this.view.status);\n\t\t\t} else if (this.view.status.workspaces.length === 1) {\n\t\t\t\tvoid this.beginPairing(this.view.status.workspaces[0]!.name, selectedAccess, this.view.status);\n\t\t\t} else if (this.view.status.workspaces.length > 1) {\n\t\t\t\tthis.view = { kind: \"workspace-picker\", status: this.view.status, access: selectedAccess };\n\t\t\t\tthis.selectedKey = `workspace:${this.view.status.workspaces[0]!.name}`;\n\t\t\t\tthis.scrollOffset = 0;\n\t\t\t\tthis.manualScroll = false;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (key.startsWith(\"workspace:\") && this.view.kind === \"workspace-picker\") {\n\t\t\tvoid this.beginPairing(key.slice(\"workspace:\".length), this.view.access, this.view.status);\n\t\t\treturn;\n\t\t}\n\t\tif (key.startsWith(\"client:\") && this.view.kind === \"overview\") {\n\t\t\tconst clientNodeId = key.slice(\"client:\".length);\n\t\t\tthis.view = { kind: \"confirm-revoke\", status: this.view.status, clientNodeId };\n\t\t\tthis.selectedKey = `revoke:${clientNodeId}`;\n\t\t\tthis.scrollOffset = 0;\n\t\t\tthis.manualScroll = false;\n\t\t\treturn;\n\t\t}\n\t\tif (key.startsWith(\"revoked:\") && this.view.kind === \"overview\") {\n\t\t\tconst clientNodeId = key.slice(\"revoked:\".length);\n\t\t\tthis.view = { kind: \"confirm-repair\", status: this.view.status, clientNodeId };\n\t\t\tthis.selectedKey = `approve-repair:${clientNodeId}`;\n\t\t\tthis.scrollOffset = 0;\n\t\t\tthis.manualScroll = false;\n\t\t\treturn;\n\t\t}\n\t\tif (key.startsWith(\"revoke:\") && this.view.kind === \"confirm-revoke\") {\n\t\t\tvoid this.revokeClient(this.view.clientNodeId);\n\t\t\treturn;\n\t\t}\n\t\tif (key.startsWith(\"approve-repair:\") && this.view.kind === \"confirm-repair\") {\n\t\t\tvoid this.approveClientRepair(this.view.clientNodeId);\n\t\t\treturn;\n\t\t}\n\t\tif (key === \"pairing-copy\" && this.view.kind === \"pairing\" && this.view.ticket) {\n\t\t\tvoid this.copyPairingTicket();\n\t\t\treturn;\n\t\t}\n\t\tif (key === \"pairing-show-qr\" && this.view.kind === \"pairing\" && this.view.ticket) {\n\t\t\tthis.view = { ...this.view, showQr: true };\n\t\t\tthis.selectedKey = \"pairing-verification\";\n\t\t\tthis.scrollOffset = 0;\n\t\t\tthis.manualScroll = false;\n\t\t\treturn;\n\t\t}\n\t\tif (key === \"pairing-verification\" && this.view.kind === \"pairing\") {\n\t\t\tthis.view = { ...this.view, showQr: false };\n\t\t\tthis.selectedKey = \"pairing-show-qr\";\n\t\t\tthis.scrollOffset = 0;\n\t\t\tthis.manualScroll = false;\n\t\t\treturn;\n\t\t}\n\t\tif (key === \"pairing-back\" && this.view.kind === \"pairing\") {\n\t\t\tif (this.view.phase === \"completed\") {\n\t\t\t\tvoid this.refresh(this.view.message);\n\t\t\t} else {\n\t\t\t\tthis.pairingAttempt++;\n\t\t\t\tthis.pairingHandle?.dispose();\n\t\t\t\tthis.pairingHandle = undefined;\n\t\t\t\tthis.view = { kind: \"overview\", status: this.view.status };\n\t\t\t\tthis.selectedKey = \"pair\";\n\t\t\t\tthis.scrollOffset = 0;\n\t\t\t\tthis.manualScroll = false;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate moveSelection(delta: number): void {\n\t\tconst selectable = this.lastRows.filter((row) => row.key);\n\t\tif (selectable.length === 0) return;\n\t\tconst index = selectable.findIndex((row) => row.key === this.selectedKey);\n\t\tconst next = Math.max(0, Math.min(selectable.length - 1, (index < 0 ? 0 : index) + delta));\n\t\tthis.selectedKey = selectable[next]!.key!;\n\t\tthis.manualScroll = false;\n\t}\n\n\tprivate scrollRows(delta: number): void {\n\t\tconst maxOffset = Math.max(0, this.lastRows.length - this.lastPageSize);\n\t\tthis.scrollOffset = Math.max(0, Math.min(maxOffset, this.scrollOffset + delta));\n\t\tthis.manualScroll = true;\n\t}\n\n\tprivate ensureSelection(rows: DisplayRow[]): void {\n\t\tif (rows.some((row) => row.key === this.selectedKey)) return;\n\t\tthis.selectedKey = rows.find((row) => row.key)?.key ?? \"\";\n\t}\n\n\tprivate renderHeader(width: number): string[] {\n\t\tlet state = \"loading\";\n\t\tif (this.view.kind === \"offline\") state = this.view.snapshot.state;\n\t\telse if (this.view.kind === \"confirm-regenerate\" || this.view.kind === \"confirm-recover\") state = \"confirmation\";\n\t\telse if (\"status\" in this.view)\n\t\t\tstate = `online · ${this.view.status.phoneConnections} phone${this.view.status.phoneConnections === 1 ? \"\" : \"s\"}`;\n\t\tconst title = theme.bold(theme.fg(\"accent\", \"Remote Access\"));\n\t\tconst right = theme.fg(this.view.kind === \"offline\" ? \"warning\" : \"muted\", state);\n\t\tconst gap = \" \".repeat(Math.max(1, width - visibleWidth(title) - visibleWidth(right) - 2));\n\t\treturn [new DynamicBorder().render(width)[0]!, truncateToWidth(` ${title}${gap}${right} `, width, \"\"), \"\"];\n\t}\n\n\tprivate renderFooter(width: number): string[] {\n\t\tconst hints = [keyHint(\"tui.select.up\", \"navigate\"), keyHint(\"tui.select.pageDown\", \"scroll\")];\n\t\thints.push(keyHint(\"tui.select.confirm\", \"select\"));\n\t\thints.push(\n\t\t\tkeyHint(\"tui.select.cancel\", this.view.kind === \"overview\" || this.view.kind === \"offline\" ? \"close\" : \"back\"),\n\t\t);\n\t\treturn [truncateToWidth(` ${hints.join(\" \")}`, width, \"\"), new DynamicBorder().render(width)[0]!];\n\t}\n\n\tprivate buildRows(width: number, pageSize: number): DisplayRow[] {\n\t\tif (this.view.kind === \"loading\") return [{ text: this.view.label, tone: \"muted\" }];\n\t\tif (this.view.kind === \"offline\") {\n\t\t\treturn [\n\t\t\t\t{ text: \"DAEMON\", tone: \"accent\" },\n\t\t\t\t{ text: `voltd is ${this.view.snapshot.state}`, tone: \"warning\" },\n\t\t\t\t...(this.view.snapshot.error ? [{ text: this.view.snapshot.error, tone: \"error\" as const }] : []),\n\t\t\t\t...(this.view.snapshot.invalidState\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttext: \"Regeneration creates a backup, preserves validated settings/identity when possible, and may require phones to pair again.\",\n\t\t\t\t\t\t\t\ttone: \"warning\" as const,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{ key: \"regenerate-state\", text: \"Regenerate daemon state…\", tone: \"warning\" as const },\n\t\t\t\t\t\t]\n\t\t\t\t\t: [{ key: \"start\", text: \"Start daemon\", tone: \"text\" as const }]),\n\t\t\t\t{ key: \"refresh\", text: \"Refresh status\", tone: \"text\" },\n\t\t\t];\n\t\t}\n\t\tif (this.view.kind === \"confirm-regenerate\") {\n\t\t\treturn [\n\t\t\t\t{ text: \"REGENERATE DAEMON STATE\", tone: \"warning\" },\n\t\t\t\t{ text: this.view.snapshot.invalidState?.path ?? \"Unknown state file\", tone: \"dim\" },\n\t\t\t\t{ text: \"The invalid file will be kept as a timestamped backup.\", tone: \"text\" },\n\t\t\t\t{ text: \"Validated identity, workspace, and settings data will be preserved when safe.\", tone: \"text\" },\n\t\t\t\t{ text: \"Invalid access records are dropped; phones may need to pair again.\", tone: \"warning\" },\n\t\t\t\t{ key: \"confirm-regenerate-state\", text: \"Confirm regenerate state\", tone: \"warning\" },\n\t\t\t];\n\t\t}\n\t\tif (this.view.kind === \"confirm-recover\") {\n\t\t\treturn [\n\t\t\t\t{ text: \"RECOVER PREVIOUS DAEMON STATE\", tone: \"warning\" },\n\t\t\t\t{ text: this.view.backupPath, tone: \"dim\" },\n\t\t\t\t{ text: \"The current daemon will stop and its state will be backed up.\", tone: \"text\" },\n\t\t\t\t{ text: \"Validated identity, workspace, and settings data will be restored.\", tone: \"text\" },\n\t\t\t\t{ text: \"Legacy access records are dropped; phones may need to pair again.\", tone: \"warning\" },\n\t\t\t\t{ key: \"confirm-recover-state\", text: \"Confirm recover and restart\", tone: \"warning\" },\n\t\t\t];\n\t\t}\n\t\tif (this.view.kind === \"access-picker\") {\n\t\t\treturn [\n\t\t\t\t{ text: \"PAIR A PHONE · ACCESS\", tone: \"accent\" },\n\t\t\t\t{ text: \"Choose what this phone may do. Access can be changed later.\", tone: \"muted\" },\n\t\t\t\t...IROH_REMOTE_ACCESS_PRESET_NAMES.flatMap((name) => {\n\t\t\t\t\tconst details = ACCESS_PRESET_DETAILS[name];\n\t\t\t\t\treturn [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tkey: `access:${name}`,\n\t\t\t\t\t\t\ttext: details.label,\n\t\t\t\t\t\t\ttone: name === \"full\" ? (\"warning\" as const) : (\"text\" as const),\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ text: ` ${details.description}`, tone: \"dim\" as const },\n\t\t\t\t\t];\n\t\t\t\t}),\n\t\t\t];\n\t\t}\n\t\tif (this.view.kind === \"workspace-picker\") {\n\t\t\treturn [\n\t\t\t\t{ text: `PAIR A PHONE · ${ACCESS_PRESET_DETAILS[this.view.access].label}`, tone: \"accent\" },\n\t\t\t\t{ text: \"Choose the phone's initial workspace.\", tone: \"muted\" },\n\t\t\t\t...this.view.status.workspaces.map((workspace) => ({\n\t\t\t\t\tkey: `workspace:${workspace.name}`,\n\t\t\t\t\ttext: `${workspace.name} ${workspace.path}`,\n\t\t\t\t\ttone: \"text\" as const,\n\t\t\t\t})),\n\t\t\t];\n\t\t}\n\t\tif (this.view.kind === \"confirm-revoke\") {\n\t\t\tconst revokeView = this.view;\n\t\t\tconst client = revokeView.status.clients.find(\n\t\t\t\t(candidate) => candidate.clientNodeId === revokeView.clientNodeId,\n\t\t\t);\n\t\t\treturn [\n\t\t\t\t{ text: \"REVOKE DEVICE\", tone: \"error\" },\n\t\t\t\t{ text: client?.label || \"Unnamed phone\", tone: \"text\" },\n\t\t\t\t{ text: revokeView.clientNodeId, tone: \"dim\" },\n\t\t\t\t{ text: \"This immediately closes the device's active remote connections.\", tone: \"warning\" },\n\t\t\t\t{ key: `revoke:${revokeView.clientNodeId}`, text: \"Confirm revoke\", tone: \"error\" },\n\t\t\t];\n\t\t}\n\t\tif (this.view.kind === \"confirm-repair\") {\n\t\t\tconst repairView = this.view;\n\t\t\tconst client = repairView.status.revokedClients?.find(\n\t\t\t\t(candidate) => candidate.clientNodeId === repairView.clientNodeId,\n\t\t\t);\n\t\t\treturn [\n\t\t\t\t{ text: \"ALLOW DEVICE TO RE-PAIR\", tone: \"warning\" },\n\t\t\t\t{ text: client?.label || \"Unnamed phone\", tone: \"text\" },\n\t\t\t\t{ text: repairView.clientNodeId, tone: \"dim\" },\n\t\t\t\t{ text: \"This identity may use one fresh pairing ticket after approval.\", tone: \"warning\" },\n\t\t\t\t{ text: \"The device remains revoked until fresh pairing succeeds.\", tone: \"muted\" },\n\t\t\t\t{ key: `approve-repair:${repairView.clientNodeId}`, text: \"Confirm allow re-pair\", tone: \"warning\" },\n\t\t\t];\n\t\t}\n\t\tif (this.view.kind === \"pairing\") return this.buildPairingRows(width, pageSize);\n\n\t\tconst status = this.view.status;\n\t\tconst remotePolicy = status.remotePolicy ?? {\n\t\t\tallowTools: null,\n\t\t\tdetachedRuntimeTtlMs: DEFAULT_INTEGRATED_DETACHED_RUNTIME_TTL_MS,\n\t\t};\n\t\tconst currentLease = status.leases.find((lease) => lease.sessionId === this.options.currentSessionId);\n\t\tconst currentWorkspace =\n\t\t\tstatus.workspaces.find((workspace) => workspace.name === this.options.getCurrentWorkspaceName()) ??\n\t\t\tworkspaceForPath(status, this.options.getCurrentWorkspacePath());\n\t\tconst rows: DisplayRow[] = [\n\t\t\t...(this.view.notice\n\t\t\t\t? [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttext: this.view.notice,\n\t\t\t\t\t\t\ttone: this.view.notice.includes(\"failed\") ? (\"error\" as const) : (\"success\" as const),\n\t\t\t\t\t\t},\n\t\t\t\t\t]\n\t\t\t\t: []),\n\t\t\t{ text: \"CONNECTION\", tone: \"accent\" },\n\t\t\t{\n\t\t\t\ttext: `voltd ${status.version} · pid ${status.pid} · up ${formatDuration(Date.now() - status.startedAtMs)}`,\n\t\t\t\ttone: \"text\",\n\t\t\t},\n\t\t\t{\n\t\t\t\ttext: `${status.phoneConnections} attached phone${status.phoneConnections === 1 ? \"\" : \"s\"} · ${status.clients.length} paired device${status.clients.length === 1 ? \"\" : \"s\"}${status.revokedClients === undefined ? \"\" : ` · ${status.revokedClients.length} revoked`}`,\n\t\t\t\ttone: status.phoneConnections > 0 ? \"success\" : \"muted\",\n\t\t\t},\n\t\t\t{\n\t\t\t\ttext: currentLease\n\t\t\t\t\t? `Current lease: ${currentLease.state} · ${currentLease.streamCount} stream${currentLease.streamCount === 1 ? \"\" : \"s\"} · ${currentLease.relayCount} relay${currentLease.relayCount === 1 ? \"\" : \"s\"}`\n\t\t\t\t\t: \"Current lease: not reported by daemon\",\n\t\t\t\ttone: currentLease ? \"text\" : \"muted\",\n\t\t\t},\n\t\t\t{ text: \"ACTIONS\", tone: \"accent\" },\n\t\t\t{ key: \"refresh\", text: \"Refresh status\", tone: \"text\" },\n\t\t\t{ key: \"register-current\", text: \"Register current directory\", tone: \"text\" },\n\t\t\t...(status.workspaces.length === 0\n\t\t\t\t? [{ text: \"Pairing needs a registered workspace.\", tone: \"warning\" as const }]\n\t\t\t\t: supportsSafePairing(status)\n\t\t\t\t\t? [{ key: \"pair\", text: \"Pair a phone\", tone: \"text\" as const }]\n\t\t\t\t\t: [{ text: \"Restart voltd to pair with explicit access grants.\", tone: \"warning\" as const }]),\n\t\t\t{ text: \"HEADLESS POLICY\", tone: \"accent\" },\n\t\t\t...(status.remotePolicy\n\t\t\t\t? [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttext: `Tools: ${policyTools(remotePolicy, currentWorkspace?.allowedTools)}`,\n\t\t\t\t\t\t\ttone: \"text\" as const,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttext: `Source: ${remotePolicy.allowTools !== null ? \"daemon override\" : currentWorkspace?.allowedTools ? `workspace ${currentWorkspace.name}` : \"paired device grant\"}`,\n\t\t\t\t\t\t\ttone: \"dim\" as const,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttext: `Detached runtime retention: ${formatDuration(remotePolicy.detachedRuntimeTtlMs)}`,\n\t\t\t\t\t\t\ttone: \"text\" as const,\n\t\t\t\t\t\t},\n\t\t\t\t\t]\n\t\t\t\t: [\n\t\t\t\t\t\t{ text: \"Tools: not reported by this running daemon\", tone: \"muted\" as const },\n\t\t\t\t\t\t{ text: \"Detached runtime retention: not reported\", tone: \"muted\" as const },\n\t\t\t\t\t]),\n\t\t\t{ text: \"PAIRED DEVICES\", tone: \"accent\" },\n\t\t];\n\t\tif (status.clients.length === 0) rows.push({ text: \"No paired devices.\", tone: \"muted\" });\n\t\tfor (const client of status.clients) {\n\t\t\trows.push({\n\t\t\t\tkey: `client:${client.clientNodeId}`,\n\t\t\t\ttext: `${client.label || \"Unnamed phone\"} · ${abbreviatedId(client.clientNodeId, width < 60 ? 10 : 20)} · last seen ${formatDuration(Date.now() - (client.lastSeenAtMs ?? client.pairedAtMs))} ago`,\n\t\t\t\ttone: \"text\",\n\t\t\t});\n\t\t\trows.push({\n\t\t\t\ttext: ` Tools: ${client.allowedTools ? client.allowedTools.join(\", \") || \"none\" : \"not reported\"}`,\n\t\t\t\ttone: \"dim\",\n\t\t\t});\n\t\t}\n\t\tif (status.revokedClients !== undefined) {\n\t\t\trows.push({ text: \"REVOKED DEVICES\", tone: \"accent\" });\n\t\t\tif (status.revokedClients.length === 0) rows.push({ text: \"No revoked devices.\", tone: \"muted\" });\n\t\t\tfor (const client of status.revokedClients) {\n\t\t\t\tconst approved = client.rePairApprovedAtMs !== undefined;\n\t\t\t\trows.push({\n\t\t\t\t\t...(approved ? {} : { key: `revoked:${client.clientNodeId}` }),\n\t\t\t\t\ttext: `${client.label || \"Unnamed phone\"} · ${abbreviatedId(client.clientNodeId, width < 60 ? 10 : 20)} · revoked ${formatDuration(Date.now() - client.revokedAtMs)} ago`,\n\t\t\t\t\ttone: approved ? \"success\" : \"warning\",\n\t\t\t\t});\n\t\t\t\trows.push({\n\t\t\t\t\ttext: approved ? \" Re-pair approved · scan a fresh QR\" : \" Select to allow fresh pairing\",\n\t\t\t\t\ttone: approved ? \"success\" : \"dim\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\trows.push({ text: \"WORKSPACES\", tone: \"accent\" });\n\t\tif (status.workspaces.length === 0) rows.push({ text: \"No registered workspaces.\", tone: \"muted\" });\n\t\tfor (const workspace of status.workspaces) {\n\t\t\trows.push({\n\t\t\t\ttext: `${workspace.name === currentWorkspace?.name ? \"Current · \" : \"\"}${workspace.name} · ${workspace.path}`,\n\t\t\t\ttone: workspace.name === currentWorkspace?.name ? \"accent\" : \"text\",\n\t\t\t});\n\t\t\tif (workspace.allowedTools)\n\t\t\t\trows.push({ text: ` Tools: ${workspace.allowedTools.join(\", \") || \"none\"}`, tone: \"dim\" });\n\t\t}\n\t\trows.push({ text: \"LEASES\", tone: \"accent\" });\n\t\tif (status.leases.length === 0) rows.push({ text: \"No active conversation leases.\", tone: \"muted\" });\n\t\tfor (const lease of status.leases) {\n\t\t\tconst current = lease.sessionId === this.options.currentSessionId;\n\t\t\trows.push({\n\t\t\t\ttext: `${current ? \"Current · \" : \"\"}${lease.workspaceName}/${abbreviatedId(lease.sessionId, width < 60 ? 10 : 18)} · ${lease.state} · ${lease.streamCount} streams · ${lease.relayCount} relays`,\n\t\t\t\ttone: current ? \"accent\" : \"text\",\n\t\t\t});\n\t\t}\n\t\treturn rows;\n\t}\n\n\tprivate buildPairingRows(width: number, pageSize: number): DisplayRow[] {\n\t\tif (this.view.kind !== \"pairing\") return [];\n\t\tconst phaseLabel = {\n\t\t\tstarting: \"Creating one-time ticket…\",\n\t\t\tticket: \"Ticket ready\",\n\t\t\twaiting: \"Scan with Volt on your phone\",\n\t\t\tcompleted: \"Pairing complete\",\n\t\t\tfailed: \"Pairing failed\",\n\t\t}[this.view.phase];\n\t\tconst rows: DisplayRow[] = [\n\t\t\t{\n\t\t\t\ttext: `PAIR PHONE · ${this.view.workspaceName} · ${ACCESS_PRESET_DETAILS[this.view.access].label}`,\n\t\t\t\ttone: \"accent\",\n\t\t\t},\n\t\t\t{\n\t\t\t\ttext:\n\t\t\t\t\tthis.view.phase === \"waiting\"\n\t\t\t\t\t\t? \"Scan with Volt, then compare these values before confirming\"\n\t\t\t\t\t\t: phaseLabel,\n\t\t\t\ttone: this.view.phase === \"failed\" ? \"error\" : this.view.phase === \"completed\" ? \"success\" : \"text\",\n\t\t\t},\n\t\t];\n\t\tif (this.view.message)\n\t\t\trows.push({ text: this.view.message, tone: this.view.phase === \"failed\" ? \"error\" : \"muted\" });\n\n\t\tlet qrLines: string[] | undefined;\n\t\tlet qrError: string | undefined;\n\t\tif (this.view.ticket) {\n\t\t\ttry {\n\t\t\t\tqrLines = formatIrohRemoteTicketQrCode(this.view.ticket)\n\t\t\t\t\t.split(\"\\n\")\n\t\t\t\t\t.filter((line, index, lines) => line.length > 0 || (index > 0 && index < lines.length - 1));\n\t\t\t} catch (error) {\n\t\t\t\tqrError = error instanceof Error ? error.message : String(error);\n\t\t\t}\n\t\t}\n\t\tconst qrFits =\n\t\t\tqrLines !== undefined &&\n\t\t\tqrLines.length + 4 <= pageSize &&\n\t\t\tqrLines.every((line) => visibleWidth(line) <= width);\n\t\tif (this.view.showQr) {\n\t\t\tif (qrFits && qrLines !== undefined) {\n\t\t\t\treturn [\n\t\t\t\t\t{ text: `PAIR QR · ${this.view.workspaceName}`, tone: \"accent\" },\n\t\t\t\t\t...qrLines.map((line) => ({ text: line, raw: true })),\n\t\t\t\t\t{ key: \"pairing-verification\", text: \"Show verification details\", tone: \"text\" },\n\t\t\t\t\t{ key: \"pairing-copy\", text: \"Copy pairing ticket\", tone: \"text\" },\n\t\t\t\t\t{ key: \"pairing-back\", text: \"Cancel pairing\", tone: \"text\" },\n\t\t\t\t];\n\t\t\t}\n\t\t\trows.push({ text: \"The terminal is no longer large enough to show the complete QR code.\", tone: \"warning\" });\n\t\t\trows.push({ key: \"pairing-verification\", text: \"Show verification details\", tone: \"text\" });\n\t\t} else if (this.view.ticket) {\n\t\t\ttry {\n\t\t\t\tconst details = getIrohRemotePairingVerificationDetails(this.view.ticket);\n\t\t\t\tconst addDetail = (label: string, value: string | string[]): void => {\n\t\t\t\t\trows.push({ text: label, tone: \"dim\" });\n\t\t\t\t\tfor (const item of typeof value === \"string\" ? [value] : value) {\n\t\t\t\t\t\tconst safeValue = stripAnsi(item).replace(UNSAFE_TERMINAL_CHARACTERS, \"\");\n\t\t\t\t\t\trows.push(\n\t\t\t\t\t\t\t...wrapTextWithAnsi(safeValue, Math.max(1, width - 2)).map((line) => ({\n\t\t\t\t\t\t\t\ttext: line,\n\t\t\t\t\t\t\t\ttone: \"text\" as const,\n\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\taddDetail(\"Fingerprint\", details.hostFingerprint);\n\t\t\t\taddDetail(\"Host ID\", details.hostNodeId);\n\t\t\t\taddDetail(\"Workspace\", details.workspace);\n\t\t\t\taddDetail(\"Relay mode\", details.relayMode);\n\t\t\t\taddDetail(\"HTTPS relay origins\", details.relayOrigins.length === 0 ? \"none\" : details.relayOrigins);\n\t\t\t\taddDetail(\n\t\t\t\t\t\"Expires (UTC)\",\n\t\t\t\t\tdetails.expiresAt === undefined ? \"not specified\" : new Date(details.expiresAt).toISOString(),\n\t\t\t\t);\n\t\t\t} catch (error) {\n\t\t\t\trows.push({\n\t\t\t\t\ttext: `Verification unavailable: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t\t\ttone: \"error\",\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (qrFits) {\n\t\t\t\trows.push({ key: \"pairing-show-qr\", text: \"Show pairing QR\", tone: \"text\" });\n\t\t\t} else if (qrError) {\n\t\t\t\trows.push({ text: `QR unavailable: ${qrError}`, tone: \"warning\" });\n\t\t\t} else {\n\t\t\t\trows.push({ text: \"Enlarge the terminal to show the complete QR code.\", tone: \"warning\" });\n\t\t\t\trows.push({ text: \"Use Copy pairing ticket instead of exposing it in scrollback.\", tone: \"dim\" });\n\t\t\t}\n\t\t}\n\t\tif (this.view.ticket) rows.push({ key: \"pairing-copy\", text: \"Copy pairing ticket\", tone: \"text\" });\n\t\tif (this.view.recoveryBackupPath) {\n\t\t\trows.push({\n\t\t\t\ttext: \"A recoverable daemon-state backup is available from before the endpoint failure.\",\n\t\t\t\ttone: \"warning\",\n\t\t\t});\n\t\t\trows.push({ key: \"pairing-recover\", text: \"Recover previous daemon state…\", tone: \"warning\" });\n\t\t}\n\t\trows.push({\n\t\t\tkey: \"pairing-back\",\n\t\t\ttext:\n\t\t\t\tthis.view.phase === \"completed\"\n\t\t\t\t\t? \"Return to overview\"\n\t\t\t\t\t: this.view.phase === \"starting\"\n\t\t\t\t\t\t? \"Back to overview\"\n\t\t\t\t\t\t: \"Cancel pairing\",\n\t\t\ttone: \"text\",\n\t\t});\n\t\treturn rows;\n\t}\n\n\tprivate renderRow(row: DisplayRow, width: number): string {\n\t\tconst marker = row.raw ? \"\" : row.key ? (row.key === this.selectedKey ? \"› \" : \" \") : \" \";\n\t\tconst color = row.tone ?? \"text\";\n\t\tconst safeText = row.raw ? row.text : stripAnsi(row.text).replace(UNSAFE_TERMINAL_CHARACTERS, \"\");\n\t\tconst content = truncateToWidth(`${marker}${safeText}`, width, \"…\");\n\t\tlet styled = theme.fg(color, content);\n\t\tif (row.key === this.selectedKey) {\n\t\t\tstyled = theme.bg(\"selectedBg\", `${styled}${\" \".repeat(Math.max(0, width - visibleWidth(content)))}`);\n\t\t}\n\t\treturn truncateToWidth(styled, width, \"\");\n\t}\n}\n"]}
|