@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,1271 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in /review support.
|
|
3
|
+
*
|
|
4
|
+
* Resolves a review target (uncommitted changes, branch diff, GitHub PR, or a
|
|
5
|
+
* single commit) into a diff, runs an isolated in-process review session over
|
|
6
|
+
* it, and parses the structured findings from the reviewer's final message.
|
|
7
|
+
*
|
|
8
|
+
* The review session is intentionally separate from the user's session: it has
|
|
9
|
+
* its own context window and its own reviewer system prompt. It loads the
|
|
10
|
+
* project's context files (AGENTS.md) and inherits the user's configured
|
|
11
|
+
* extension tools, but excludes user extensions, skills, prompt templates,
|
|
12
|
+
* themes, and subagents, and does not start MCP servers. After the review
|
|
13
|
+
* completes the caller starts a fresh session seeded only with the findings.
|
|
14
|
+
*/
|
|
15
|
+
import { spawn } from "node:child_process";
|
|
16
|
+
import { randomUUID } from "node:crypto";
|
|
17
|
+
import { mkdtemp, rm } from "node:fs/promises";
|
|
18
|
+
import { tmpdir } from "node:os";
|
|
19
|
+
import { join } from "node:path";
|
|
20
|
+
import { createExtensionRuntime } from "./extensions/loader.js";
|
|
21
|
+
import { findExactModelReferenceMatch } from "./model-resolver.js";
|
|
22
|
+
import { loadProjectContextFiles } from "./resource-loader.js";
|
|
23
|
+
import { createAgentSession } from "./sdk.js";
|
|
24
|
+
import { SessionManager } from "./session-manager.js";
|
|
25
|
+
export const REVIEW_USAGE = "Usage: /review [tools | uncommitted | branch [base] | pr [number] | commit [sha]] (no arguments opens a selector)";
|
|
26
|
+
export const REMOTE_REVIEW_TOOL_NAMES = ["read", "grep", "find", "ls"];
|
|
27
|
+
/**
|
|
28
|
+
* Parse the argument text after "/review".
|
|
29
|
+
* Returns an empty object when no arguments were given (caller shows a selector).
|
|
30
|
+
*/
|
|
31
|
+
export function parseReviewCommandArgs(argsText) {
|
|
32
|
+
const tokens = argsText.trim().split(/\s+/).filter(Boolean);
|
|
33
|
+
if (tokens.length === 0) {
|
|
34
|
+
return {};
|
|
35
|
+
}
|
|
36
|
+
const keyword = tokens[0].toLowerCase();
|
|
37
|
+
// Reject trailing tokens beyond the keyword's expected arity so mistakes like
|
|
38
|
+
// `/review pr 42 foo` fail loudly instead of silently dropping the extra args.
|
|
39
|
+
const tooManyArgs = (max) => tokens.length > max ? { error: `Unexpected arguments after "${tokens[0]}". ${REVIEW_USAGE}` } : undefined;
|
|
40
|
+
switch (keyword) {
|
|
41
|
+
case "tools":
|
|
42
|
+
return tooManyArgs(1) ?? { configureTools: true };
|
|
43
|
+
case "uncommitted":
|
|
44
|
+
case "unstaged":
|
|
45
|
+
case "working":
|
|
46
|
+
return tooManyArgs(1) ?? { target: { kind: "uncommitted" } };
|
|
47
|
+
case "branch":
|
|
48
|
+
return tooManyArgs(2) ?? { target: { kind: "branch", base: tokens[1] } };
|
|
49
|
+
case "pr":
|
|
50
|
+
return tooManyArgs(2) ?? { target: { kind: "pr", number: tokens[1] } };
|
|
51
|
+
case "commit":
|
|
52
|
+
// Without a SHA the caller shows a commit picker.
|
|
53
|
+
return tooManyArgs(2) ?? { target: { kind: "commit", sha: tokens[1] } };
|
|
54
|
+
default:
|
|
55
|
+
return { error: `Unknown review target "${tokens[0]}". ${REVIEW_USAGE}` };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/** Maximum diff characters embedded inline in the review prompt. */
|
|
59
|
+
export const MAX_REVIEW_DIFF_CHARS = 150_000;
|
|
60
|
+
function runCommand(command, args, cwd, env) {
|
|
61
|
+
return new Promise((resolve) => {
|
|
62
|
+
const proc = spawn(command, args, {
|
|
63
|
+
cwd,
|
|
64
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
65
|
+
env: env ? { ...process.env, ...env } : process.env,
|
|
66
|
+
});
|
|
67
|
+
let stdout = "";
|
|
68
|
+
let stderr = "";
|
|
69
|
+
proc.stdout.on("data", (data) => {
|
|
70
|
+
stdout += data.toString();
|
|
71
|
+
});
|
|
72
|
+
proc.stderr.on("data", (data) => {
|
|
73
|
+
stderr += data.toString();
|
|
74
|
+
});
|
|
75
|
+
proc.on("error", (error) => {
|
|
76
|
+
resolve({ ok: false, stdout, stderr: error.message });
|
|
77
|
+
});
|
|
78
|
+
proc.on("close", (code) => {
|
|
79
|
+
resolve({ ok: code === 0, stdout, stderr });
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function isHighSurrogate(codeUnit) {
|
|
84
|
+
return codeUnit >= 0xd800 && codeUnit <= 0xdbff;
|
|
85
|
+
}
|
|
86
|
+
export function truncateDiff(diff) {
|
|
87
|
+
if (diff.length <= MAX_REVIEW_DIFF_CHARS) {
|
|
88
|
+
return { diff, truncated: false };
|
|
89
|
+
}
|
|
90
|
+
let end = MAX_REVIEW_DIFF_CHARS;
|
|
91
|
+
// Prefer cutting on a line boundary so the preview ends with whole diff lines
|
|
92
|
+
// rather than a partial hunk. For a single line longer than the limit there is
|
|
93
|
+
// no boundary, so fall back to a raw cut that does not split a surrogate pair.
|
|
94
|
+
const lastNewline = diff.lastIndexOf("\n", end - 1);
|
|
95
|
+
if (lastNewline >= 0) {
|
|
96
|
+
end = lastNewline + 1;
|
|
97
|
+
}
|
|
98
|
+
else if (isHighSurrogate(diff.charCodeAt(end - 1))) {
|
|
99
|
+
end -= 1;
|
|
100
|
+
}
|
|
101
|
+
return { diff: diff.slice(0, end), truncated: true };
|
|
102
|
+
}
|
|
103
|
+
async function detectBaseBranch(cwd) {
|
|
104
|
+
const originHead = await runCommand("git", ["symbolic-ref", "--short", "refs/remotes/origin/HEAD"], cwd);
|
|
105
|
+
if (originHead.ok) {
|
|
106
|
+
const ref = originHead.stdout.trim();
|
|
107
|
+
if (ref) {
|
|
108
|
+
// Keep the remote-tracking ref (e.g. "origin/main") rather than stripping
|
|
109
|
+
// to "main": it always resolves and reflects the fetched upstream instead
|
|
110
|
+
// of a possibly stale or missing local branch (single-branch/shallow checkouts).
|
|
111
|
+
return ref;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
for (const candidate of ["main", "master"]) {
|
|
115
|
+
const exists = await runCommand("git", ["rev-parse", "--verify", "--quiet", candidate], cwd);
|
|
116
|
+
if (exists.ok) {
|
|
117
|
+
return candidate;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return undefined;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Resolve a base ref to something that exists. Returns the ref itself when it
|
|
124
|
+
* resolves, otherwise the matching remote-tracking ref (`origin/<base>`) when
|
|
125
|
+
* only that exists (e.g. a checkout that has no local copy of the base branch).
|
|
126
|
+
*/
|
|
127
|
+
async function resolveBaseRef(base, cwd) {
|
|
128
|
+
const direct = await runCommand("git", ["rev-parse", "--verify", "--quiet", base], cwd);
|
|
129
|
+
if (direct.ok) {
|
|
130
|
+
return base;
|
|
131
|
+
}
|
|
132
|
+
if (!base.startsWith("origin/")) {
|
|
133
|
+
const remote = `origin/${base}`;
|
|
134
|
+
const remoteExists = await runCommand("git", ["rev-parse", "--verify", "--quiet", remote], cwd);
|
|
135
|
+
if (remoteExists.ok) {
|
|
136
|
+
return remote;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return undefined;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Resolve a review target into a concrete diff.
|
|
143
|
+
* Returns `{ error }` for user-facing failures (not a git repo, empty diff, gh missing, ...).
|
|
144
|
+
*/
|
|
145
|
+
export async function resolveReviewTarget(target, cwd) {
|
|
146
|
+
const inRepo = await runCommand("git", ["rev-parse", "--is-inside-work-tree"], cwd);
|
|
147
|
+
if (!inRepo.ok) {
|
|
148
|
+
return { error: "Not inside a git repository." };
|
|
149
|
+
}
|
|
150
|
+
switch (target.kind) {
|
|
151
|
+
case "uncommitted": {
|
|
152
|
+
let diffResult = await runCommand("git", ["diff", "HEAD"], cwd);
|
|
153
|
+
let diffCommand = "git diff HEAD";
|
|
154
|
+
if (!diffResult.ok) {
|
|
155
|
+
// No commits yet: combine the staged diff (index vs the empty tree)
|
|
156
|
+
// with the worktree diff so staged changes are not missed.
|
|
157
|
+
const stagedResult = await runCommand("git", ["diff", "--cached"], cwd);
|
|
158
|
+
const worktreeResult = await runCommand("git", ["diff"], cwd);
|
|
159
|
+
if (!stagedResult.ok || !worktreeResult.ok) {
|
|
160
|
+
const failed = stagedResult.ok ? worktreeResult : stagedResult;
|
|
161
|
+
return { error: `git diff failed: ${failed.stderr.trim()}` };
|
|
162
|
+
}
|
|
163
|
+
diffResult = { ok: true, stdout: stagedResult.stdout + worktreeResult.stdout, stderr: "" };
|
|
164
|
+
diffCommand = "git diff --cached; git diff";
|
|
165
|
+
}
|
|
166
|
+
const untrackedResult = await runCommand("git", ["ls-files", "--others", "--exclude-standard"], cwd);
|
|
167
|
+
const untracked = untrackedResult.ok
|
|
168
|
+
? untrackedResult.stdout
|
|
169
|
+
.split("\n")
|
|
170
|
+
.map((line) => line.trim())
|
|
171
|
+
.filter(Boolean)
|
|
172
|
+
: [];
|
|
173
|
+
if (!diffResult.stdout.trim() && untracked.length === 0) {
|
|
174
|
+
return { error: "No uncommitted changes to review." };
|
|
175
|
+
}
|
|
176
|
+
const { diff, truncated } = truncateDiff(diffResult.stdout);
|
|
177
|
+
return {
|
|
178
|
+
description: "uncommitted changes",
|
|
179
|
+
diffCommand,
|
|
180
|
+
diff,
|
|
181
|
+
truncated,
|
|
182
|
+
extraContext: untracked.length > 0
|
|
183
|
+
? `Untracked files (not in the diff; read them directly):\n${untracked.map((file) => `- ${file}`).join("\n")}`
|
|
184
|
+
: undefined,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
case "branch": {
|
|
188
|
+
const requestedBase = target.base ?? (await detectBaseBranch(cwd));
|
|
189
|
+
if (!requestedBase) {
|
|
190
|
+
return { error: "Could not detect a base branch. Use /review branch <base>." };
|
|
191
|
+
}
|
|
192
|
+
const base = await resolveBaseRef(requestedBase, cwd);
|
|
193
|
+
if (!base) {
|
|
194
|
+
return { error: `Base branch "${requestedBase}" not found.` };
|
|
195
|
+
}
|
|
196
|
+
const diffResult = await runCommand("git", ["diff", `${base}...HEAD`], cwd);
|
|
197
|
+
if (!diffResult.ok) {
|
|
198
|
+
return { error: `git diff failed: ${diffResult.stderr.trim()}` };
|
|
199
|
+
}
|
|
200
|
+
if (!diffResult.stdout.trim()) {
|
|
201
|
+
return { error: `No changes between ${base} and HEAD.` };
|
|
202
|
+
}
|
|
203
|
+
const logResult = await runCommand("git", ["log", "--oneline", `${base}..HEAD`], cwd);
|
|
204
|
+
const { diff, truncated } = truncateDiff(diffResult.stdout);
|
|
205
|
+
return {
|
|
206
|
+
description: `branch changes vs ${base}`,
|
|
207
|
+
diffCommand: `git diff ${base}...HEAD`,
|
|
208
|
+
diff,
|
|
209
|
+
truncated,
|
|
210
|
+
extraContext: logResult.ok && logResult.stdout.trim() ? `Commits:\n${logResult.stdout.trim()}` : undefined,
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
case "pr": {
|
|
214
|
+
const numberArgs = target.number ? [target.number] : [];
|
|
215
|
+
const viewResult = await runCommand("gh", ["pr", "view", ...numberArgs, "--json", "number,title,body,baseRefName,headRefName,url"], cwd);
|
|
216
|
+
if (!viewResult.ok) {
|
|
217
|
+
const stderr = viewResult.stderr.trim();
|
|
218
|
+
if (/ENOENT|not found|not recognized/i.test(stderr)) {
|
|
219
|
+
return { error: "GitHub CLI (gh) is not installed. Install it from https://cli.github.com/" };
|
|
220
|
+
}
|
|
221
|
+
return { error: `gh pr view failed: ${stderr}` };
|
|
222
|
+
}
|
|
223
|
+
let prInfo;
|
|
224
|
+
try {
|
|
225
|
+
prInfo = JSON.parse(viewResult.stdout);
|
|
226
|
+
}
|
|
227
|
+
catch {
|
|
228
|
+
return { error: "Could not parse gh pr view output." };
|
|
229
|
+
}
|
|
230
|
+
const diffResult = await runCommand("gh", ["pr", "diff", String(prInfo.number)], cwd);
|
|
231
|
+
if (!diffResult.ok) {
|
|
232
|
+
return { error: `gh pr diff failed: ${diffResult.stderr.trim()}` };
|
|
233
|
+
}
|
|
234
|
+
if (!diffResult.stdout.trim()) {
|
|
235
|
+
return { error: `PR #${prInfo.number} has an empty diff.` };
|
|
236
|
+
}
|
|
237
|
+
const { diff, truncated } = truncateDiff(diffResult.stdout);
|
|
238
|
+
const bodyText = prInfo.body?.trim();
|
|
239
|
+
return {
|
|
240
|
+
description: `PR #${prInfo.number} (${prInfo.title})`,
|
|
241
|
+
diffCommand: `gh pr diff ${prInfo.number}`,
|
|
242
|
+
diff,
|
|
243
|
+
truncated,
|
|
244
|
+
extraContext: [
|
|
245
|
+
`PR #${prInfo.number}: ${prInfo.title}`,
|
|
246
|
+
`Base branch: ${prInfo.baseRefName}`,
|
|
247
|
+
`Head branch: ${prInfo.headRefName}`,
|
|
248
|
+
`URL: ${prInfo.url}`,
|
|
249
|
+
`Note: the local worktree may not have the PR head checked out. Do not assume local files match the diff; inspect PR file contents against fetched refs instead (e.g. \`git fetch origin ${prInfo.headRefName}\` then \`git show FETCH_HEAD:<path>\`).`,
|
|
250
|
+
bodyText ? `Description:\n${bodyText}` : undefined,
|
|
251
|
+
]
|
|
252
|
+
.filter(Boolean)
|
|
253
|
+
.join("\n"),
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
case "commit": {
|
|
257
|
+
if (!target.sha) {
|
|
258
|
+
return { error: "Missing commit SHA." };
|
|
259
|
+
}
|
|
260
|
+
// --diff-merges=first-parent: plain `git show` prints no patch hunks
|
|
261
|
+
// for merge commits; diff against the first parent shows what the
|
|
262
|
+
// merge brought into the branch. Non-merge commits are unaffected.
|
|
263
|
+
const diffResult = await runCommand("git", ["show", "--stat", "--patch", "--diff-merges=first-parent", target.sha], cwd);
|
|
264
|
+
if (!diffResult.ok) {
|
|
265
|
+
return { error: `git show failed: ${diffResult.stderr.trim()}` };
|
|
266
|
+
}
|
|
267
|
+
const { diff, truncated } = truncateDiff(diffResult.stdout);
|
|
268
|
+
return {
|
|
269
|
+
description: `commit ${target.sha}`,
|
|
270
|
+
diffCommand: `git show --stat --patch --diff-merges=first-parent ${target.sha}`,
|
|
271
|
+
diff,
|
|
272
|
+
truncated,
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Order base-branch candidates for the picker. Canonical bases come first
|
|
279
|
+
* (local main/master, then their origin/ equivalents), then other local
|
|
280
|
+
* branches, then other remote-tracking branches; each tier is sorted
|
|
281
|
+
* alphabetically. Local vs remote is known from the source lists, so branch
|
|
282
|
+
* names containing slashes (e.g. `feature/login`) are classified correctly.
|
|
283
|
+
*/
|
|
284
|
+
function orderBaseBranches(local, remote) {
|
|
285
|
+
const scored = [];
|
|
286
|
+
const seen = new Set();
|
|
287
|
+
const add = (ref, tier) => {
|
|
288
|
+
if (!ref || seen.has(ref)) {
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
seen.add(ref);
|
|
292
|
+
scored.push({ ref, tier });
|
|
293
|
+
};
|
|
294
|
+
for (const ref of local) {
|
|
295
|
+
add(ref, ref === "main" ? 0 : ref === "master" ? 1 : 4);
|
|
296
|
+
}
|
|
297
|
+
for (const ref of remote) {
|
|
298
|
+
add(ref, ref === "origin/main" ? 2 : ref === "origin/master" ? 3 : 5);
|
|
299
|
+
}
|
|
300
|
+
return scored
|
|
301
|
+
.sort((a, b) => (a.tier === b.tier ? a.ref.localeCompare(b.ref) : a.tier - b.tier))
|
|
302
|
+
.map((entry) => entry.ref);
|
|
303
|
+
}
|
|
304
|
+
function splitBranchLines(stdout) {
|
|
305
|
+
return stdout
|
|
306
|
+
.split("\n")
|
|
307
|
+
.map((line) => line.trim())
|
|
308
|
+
.filter(Boolean);
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* List candidate base branches for the /review base-branch picker: local
|
|
312
|
+
* branches plus remote-tracking branches (e.g. `origin/main`). The `origin/HEAD`
|
|
313
|
+
* alias (which `%(refname:short)` renders as the bare remote name) is skipped.
|
|
314
|
+
*/
|
|
315
|
+
export async function listBaseBranches(cwd) {
|
|
316
|
+
const localResult = await runCommand("git", ["for-each-ref", "--format=%(refname:short)", "refs/heads"], cwd);
|
|
317
|
+
if (!localResult.ok) {
|
|
318
|
+
return { error: `git branch failed: ${localResult.stderr.trim()}` };
|
|
319
|
+
}
|
|
320
|
+
const local = splitBranchLines(localResult.stdout);
|
|
321
|
+
const remoteResult = await runCommand("git", ["for-each-ref", "--format=%(refname:short)", "refs/remotes"], cwd);
|
|
322
|
+
const remote = remoteResult.ok
|
|
323
|
+
? splitBranchLines(remoteResult.stdout).filter((ref) => ref.includes("/") && !ref.endsWith("/HEAD"))
|
|
324
|
+
: [];
|
|
325
|
+
return orderBaseBranches(local, remote);
|
|
326
|
+
}
|
|
327
|
+
/** List recent commits on HEAD for the /review commit picker. */
|
|
328
|
+
export async function listRecentCommits(cwd, limit = 30) {
|
|
329
|
+
const result = await runCommand("git", ["log", "-n", String(limit), "--pretty=format:%h%x09%cr%x09%s"], cwd);
|
|
330
|
+
if (!result.ok) {
|
|
331
|
+
return { error: `git log failed: ${result.stderr.trim()}` };
|
|
332
|
+
}
|
|
333
|
+
const commits = [];
|
|
334
|
+
for (const line of result.stdout.split("\n")) {
|
|
335
|
+
const [sha, date, ...subjectParts] = line.split("\t");
|
|
336
|
+
if (!sha?.trim()) {
|
|
337
|
+
continue;
|
|
338
|
+
}
|
|
339
|
+
commits.push({ sha: sha.trim(), date: date?.trim() ?? "", subject: subjectParts.join("\t").trim() });
|
|
340
|
+
}
|
|
341
|
+
return commits;
|
|
342
|
+
}
|
|
343
|
+
// ============================================================================
|
|
344
|
+
// Review prompt
|
|
345
|
+
// ============================================================================
|
|
346
|
+
export const REVIEW_SYSTEM_PROMPT = `<reviewer_prompt>
|
|
347
|
+
<role>
|
|
348
|
+
You are an expert code reviewer operating inside volt, a coding agent harness.
|
|
349
|
+
You review a code change comprehensively and report every substantiated finding that matters.
|
|
350
|
+
</role>
|
|
351
|
+
|
|
352
|
+
<goal>
|
|
353
|
+
Complete the whole review, not a first-hit bug hunt. Do not stop after finding one or two issues.
|
|
354
|
+
Continue until you have reviewed the full diff and the relevant surrounding code.
|
|
355
|
+
</goal>
|
|
356
|
+
|
|
357
|
+
<tool_use>
|
|
358
|
+
<instruction>Build a map of the changed files, changed symbols, and intended behavior before judging individual hunks.</instruction>
|
|
359
|
+
<instruction>Read the full files around changed hunks, or enough of each file to understand its invariants; never judge a hunk in isolation.</instruction>
|
|
360
|
+
<instruction>Trace callers, callees, tests, configuration, and related code when a change could break an invariant elsewhere.</instruction>
|
|
361
|
+
<instruction>If the inline diff is truncated, run the provided diff command and review the full diff before finalizing.</instruction>
|
|
362
|
+
<instruction>If you suspect a behavioral bug, verify it when feasible: run the relevant tests, or write a small scratch test/script to confirm.</instruction>
|
|
363
|
+
<instruction>Delete any scratch files you create and revert any temporary edits before finishing, leaving the working tree as you found it.</instruction>
|
|
364
|
+
</tool_use>
|
|
365
|
+
|
|
366
|
+
<review_workflow>
|
|
367
|
+
<step id="1" name="scope">Identify all changed files, changed entry points, and the intended behavior.</step>
|
|
368
|
+
<step id="2" name="context">Read surrounding code and project instructions relevant to each change.</step>
|
|
369
|
+
<step id="3" name="trace">Follow call sites, data flow, configuration, and tests for changes that affect contracts or invariants.</step>
|
|
370
|
+
<step id="4" name="verify">Run targeted commands or scratch checks for suspected behavioral bugs when feasible.</step>
|
|
371
|
+
<step id="5" name="coverage">Apply the checklist below across the whole diff before finalizing.</step>
|
|
372
|
+
<step id="6" name="report">Report all independent substantiated findings in the required payload.</step>
|
|
373
|
+
</review_workflow>
|
|
374
|
+
|
|
375
|
+
<coverage_checklist>
|
|
376
|
+
<item>Runtime correctness, logic errors, regressions, and broken invariants.</item>
|
|
377
|
+
<item>Missed call sites, API/contract compatibility, migrations, and configuration changes.</item>
|
|
378
|
+
<item>Edge cases: empty input, partial failure, cancellation/abort, retries, large inputs, platform differences, and boundary values.</item>
|
|
379
|
+
<item>Error handling, cleanup, data loss, concurrency, async ordering, and race conditions.</item>
|
|
380
|
+
<item>Security and privacy issues: trust boundaries, injection, path traversal, credential exposure, unsafe file/network operations.</item>
|
|
381
|
+
<item>Tests: missing or weakened coverage for changed behavior, and whether existing tests still exercise the intended behavior.</item>
|
|
382
|
+
<item>Project-specific conventions and instructions from project context.</item>
|
|
383
|
+
</coverage_checklist>
|
|
384
|
+
|
|
385
|
+
<finding_rules>
|
|
386
|
+
<flag>Bugs and logic errors that affect behavior.</flag>
|
|
387
|
+
<flag>Security issues, data loss, race conditions, broken error handling.</flag>
|
|
388
|
+
<flag>Changes that contradict explicit project conventions from project context.</flag>
|
|
389
|
+
<flag>Regressions: removed checks, broken invariants, missed call sites.</flag>
|
|
390
|
+
<flag>All independent, substantiated priority 0, 1, or 2 findings. Include priority 3 only when it meaningfully helps the author.</flag>
|
|
391
|
+
<do_not_flag>Style nits, formatting, or naming preferences.</do_not_flag>
|
|
392
|
+
<do_not_flag>Speculative concerns you could not substantiate from the code.</do_not_flag>
|
|
393
|
+
<do_not_flag>Pre-existing issues in code the change does not touch, unless the change makes them worse.</do_not_flag>
|
|
394
|
+
<grouping>If multiple hunks share one root cause, group them into one finding; otherwise do not omit independent issues.</grouping>
|
|
395
|
+
<empty_findings>Use an empty findings array only after completing the workflow and checklist.</empty_findings>
|
|
396
|
+
</finding_rules>
|
|
397
|
+
|
|
398
|
+
<priority_scale>
|
|
399
|
+
<priority value="0">Must fix before landing.</priority>
|
|
400
|
+
<priority value="1">Should fix.</priority>
|
|
401
|
+
<priority value="2">Worth fixing.</priority>
|
|
402
|
+
<priority value="3">Optional.</priority>
|
|
403
|
+
</priority_scale>
|
|
404
|
+
|
|
405
|
+
<output_contract>
|
|
406
|
+
<format>End your final message with one XML response envelope. Do not put anything after the closing response tag.</format>
|
|
407
|
+
<summary>Before the payload, include a short summary of what you reviewed, what you verified, and any important areas you could not verify.</summary>
|
|
408
|
+
<payload_rules>
|
|
409
|
+
<rule>The payload content must be valid JSON. Do not wrap it in markdown fences.</rule>
|
|
410
|
+
<rule>overall_correctness must be "correct" or "incorrect".</rule>
|
|
411
|
+
<rule>Confidence is a number from 0.0 to 1.0 and must be grounded in code you read or executed.</rule>
|
|
412
|
+
<rule>Use empty arrays in coverage when nothing applies.</rule>
|
|
413
|
+
</payload_rules>
|
|
414
|
+
<response_shape>
|
|
415
|
+
<response>
|
|
416
|
+
<summary>Short prose summary.</summary>
|
|
417
|
+
<payload>
|
|
418
|
+
{
|
|
419
|
+
"findings": [
|
|
420
|
+
{
|
|
421
|
+
"title": "Short imperative summary",
|
|
422
|
+
"body": "Explanation with evidence: what is wrong, why, and the concrete impact. Reference files and lines.",
|
|
423
|
+
"priority": 1,
|
|
424
|
+
"confidence": 0.9,
|
|
425
|
+
"file": "relative/path/to/file.ts",
|
|
426
|
+
"line": "120-134"
|
|
427
|
+
}
|
|
428
|
+
],
|
|
429
|
+
"coverage": {
|
|
430
|
+
"files_reviewed": ["relative/path/to/file.ts"],
|
|
431
|
+
"commands_run": ["npm run check"],
|
|
432
|
+
"unchecked_areas": ["Integration tests not run: reason"]
|
|
433
|
+
},
|
|
434
|
+
"overall_correctness": "correct",
|
|
435
|
+
"overall_explanation": "One or two sentences on whether the change is safe to land."
|
|
436
|
+
}
|
|
437
|
+
</payload>
|
|
438
|
+
</response>
|
|
439
|
+
</response_shape>
|
|
440
|
+
</output_contract>
|
|
441
|
+
</reviewer_prompt>`;
|
|
442
|
+
function escapeXml(value) {
|
|
443
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
444
|
+
}
|
|
445
|
+
function wrapXmlCdata(value) {
|
|
446
|
+
return `<![CDATA[${value.replace(/\]\]>/g, "]]]]><![CDATA[>")}]]>`;
|
|
447
|
+
}
|
|
448
|
+
/** Build the user prompt for the review session. */
|
|
449
|
+
export function buildReviewPrompt(resolved) {
|
|
450
|
+
const diffNote = resolved.truncated
|
|
451
|
+
? `The diff is too large to include inline. Run \`${resolved.diffCommand}\` yourself to read the full diff. A truncated preview is included in the diff node.`
|
|
452
|
+
: `Reproduce this diff with \`${resolved.diffCommand}\`.`;
|
|
453
|
+
const parts = [
|
|
454
|
+
"<review_request>",
|
|
455
|
+
" <target>",
|
|
456
|
+
` <description>${escapeXml(resolved.description)}</description>`,
|
|
457
|
+
` <diff_command>${escapeXml(resolved.diffCommand)}</diff_command>`,
|
|
458
|
+
` <diff_truncated>${resolved.truncated ? "true" : "false"}</diff_truncated>`,
|
|
459
|
+
" </target>",
|
|
460
|
+
];
|
|
461
|
+
if (resolved.extraContext) {
|
|
462
|
+
parts.push(` <extra_context>${wrapXmlCdata(resolved.extraContext)}</extra_context>`);
|
|
463
|
+
}
|
|
464
|
+
parts.push(` <diff_note>${escapeXml(diffNote)}</diff_note>`, ` <diff>${wrapXmlCdata(resolved.diff)}</diff>`, " <task>Investigate the surrounding code before judging any hunk. Complete the review workflow across the whole diff before finalizing; do not stop after the first finding. Verify suspected bugs when feasible. Then produce your findings in the required XML response envelope with a JSON payload.</task>", "</review_request>");
|
|
465
|
+
return parts.join("\n");
|
|
466
|
+
}
|
|
467
|
+
function coerceFinding(raw) {
|
|
468
|
+
if (typeof raw !== "object" || raw === null) {
|
|
469
|
+
return undefined;
|
|
470
|
+
}
|
|
471
|
+
const record = raw;
|
|
472
|
+
const title = typeof record.title === "string" ? record.title.trim() : "";
|
|
473
|
+
const body = typeof record.body === "string" ? record.body.trim() : "";
|
|
474
|
+
if (!title && !body) {
|
|
475
|
+
return undefined;
|
|
476
|
+
}
|
|
477
|
+
return {
|
|
478
|
+
title: title || body.slice(0, 80),
|
|
479
|
+
body,
|
|
480
|
+
priority: typeof record.priority === "number" ? record.priority : undefined,
|
|
481
|
+
confidence: typeof record.confidence === "number" ? record.confidence : undefined,
|
|
482
|
+
file: typeof record.file === "string" && record.file.trim() ? record.file.trim() : undefined,
|
|
483
|
+
line: typeof record.line === "string" && record.line.trim()
|
|
484
|
+
? record.line.trim()
|
|
485
|
+
: typeof record.line === "number"
|
|
486
|
+
? String(record.line)
|
|
487
|
+
: undefined,
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
function coerceStringArray(raw) {
|
|
491
|
+
if (!Array.isArray(raw)) {
|
|
492
|
+
return [];
|
|
493
|
+
}
|
|
494
|
+
return raw
|
|
495
|
+
.filter((value) => typeof value === "string")
|
|
496
|
+
.map((value) => value.trim())
|
|
497
|
+
.filter(Boolean);
|
|
498
|
+
}
|
|
499
|
+
function coerceCoverage(raw) {
|
|
500
|
+
if (typeof raw !== "object" || raw === null) {
|
|
501
|
+
return undefined;
|
|
502
|
+
}
|
|
503
|
+
const record = raw;
|
|
504
|
+
const coverage = {
|
|
505
|
+
filesReviewed: coerceStringArray(record.files_reviewed),
|
|
506
|
+
commandsRun: coerceStringArray(record.commands_run),
|
|
507
|
+
uncheckedAreas: coerceStringArray(record.unchecked_areas),
|
|
508
|
+
};
|
|
509
|
+
if (coverage.filesReviewed.length === 0 &&
|
|
510
|
+
coverage.commandsRun.length === 0 &&
|
|
511
|
+
coverage.uncheckedAreas.length === 0) {
|
|
512
|
+
return undefined;
|
|
513
|
+
}
|
|
514
|
+
return coverage;
|
|
515
|
+
}
|
|
516
|
+
const NAMED_XML_ENTITIES = {
|
|
517
|
+
quot: '"',
|
|
518
|
+
apos: "'",
|
|
519
|
+
lt: "<",
|
|
520
|
+
gt: ">",
|
|
521
|
+
amp: "&",
|
|
522
|
+
};
|
|
523
|
+
// Matches the five named entities plus decimal (&) and hex (&/&)
|
|
524
|
+
// character references. A single global pass decodes each reference exactly once
|
|
525
|
+
// left-to-right, so `&lt;` yields `<` (no double-decode).
|
|
526
|
+
const XML_ENTITY_PATTERN = /&(?:#(\d+)|#[xX]([0-9a-fA-F]+)|(quot|apos|lt|gt|amp));/g;
|
|
527
|
+
function decodeXmlEntities(value) {
|
|
528
|
+
return value.replace(XML_ENTITY_PATTERN, (match, dec, hex, named) => {
|
|
529
|
+
if (named !== undefined) {
|
|
530
|
+
return NAMED_XML_ENTITIES[named] ?? match;
|
|
531
|
+
}
|
|
532
|
+
const code = dec !== undefined ? Number.parseInt(dec, 10) : Number.parseInt(hex ?? "", 16);
|
|
533
|
+
// Leave invalid, out-of-range, or surrogate code points as-is rather than
|
|
534
|
+
// producing replacement or lone-surrogate characters that could break JSON.
|
|
535
|
+
if (!Number.isFinite(code) || code < 0 || code > 0x10ffff || (code >= 0xd800 && code <= 0xdfff)) {
|
|
536
|
+
return match;
|
|
537
|
+
}
|
|
538
|
+
return String.fromCodePoint(code);
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
/** Unwrap CDATA sections; the enclosed text is literal and needs no entity decoding. */
|
|
542
|
+
function unwrapCdata(value) {
|
|
543
|
+
return value.replace(/<!\[CDATA\[([\s\S]*?)\]\]>/g, "$1");
|
|
544
|
+
}
|
|
545
|
+
function stripJsonMarkdownFence(value) {
|
|
546
|
+
const trimmed = value.trim();
|
|
547
|
+
const match = /^```(?:json)?[ \t]*(?:\r?\n)?([\s\S]*?)\r?\n?```$/i.exec(trimmed);
|
|
548
|
+
return match?.[1]?.trim() ?? trimmed;
|
|
549
|
+
}
|
|
550
|
+
function collectXmlPayloadCandidates(text) {
|
|
551
|
+
const candidates = [];
|
|
552
|
+
const payloadRegex = /<payload\b[^>]*>([\s\S]*?)<\/payload>/gi;
|
|
553
|
+
let match = payloadRegex.exec(text);
|
|
554
|
+
while (match !== null) {
|
|
555
|
+
candidates.push({ index: match.index, text: unwrapCdata(match[1] ?? "").trim() });
|
|
556
|
+
match = payloadRegex.exec(text);
|
|
557
|
+
}
|
|
558
|
+
return candidates;
|
|
559
|
+
}
|
|
560
|
+
/** Parse one JSON candidate into a ParsedReview, or undefined if it lacks a findings array. */
|
|
561
|
+
function tryParseFindingsObject(candidate) {
|
|
562
|
+
let parsed;
|
|
563
|
+
try {
|
|
564
|
+
parsed = JSON.parse(candidate);
|
|
565
|
+
}
|
|
566
|
+
catch {
|
|
567
|
+
return undefined;
|
|
568
|
+
}
|
|
569
|
+
if (typeof parsed !== "object" || parsed === null) {
|
|
570
|
+
return undefined;
|
|
571
|
+
}
|
|
572
|
+
const record = parsed;
|
|
573
|
+
if (!Array.isArray(record.findings)) {
|
|
574
|
+
return undefined;
|
|
575
|
+
}
|
|
576
|
+
const findings = record.findings
|
|
577
|
+
.map(coerceFinding)
|
|
578
|
+
.filter((finding) => finding !== undefined);
|
|
579
|
+
return {
|
|
580
|
+
findings,
|
|
581
|
+
coverage: coerceCoverage(record.coverage),
|
|
582
|
+
overallCorrectness: typeof record.overall_correctness === "string" ? record.overall_correctness : undefined,
|
|
583
|
+
overallExplanation: typeof record.overall_explanation === "string" ? record.overall_explanation : undefined,
|
|
584
|
+
};
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* Parse a JSON candidate, retrying with XML entities decoded only when the raw
|
|
588
|
+
* text does not parse. Trying raw first avoids corrupting payloads whose string
|
|
589
|
+
* values legitimately contain entity-like text (e.g. a finding that mentions
|
|
590
|
+
* `&` or `"`), while still recovering payloads that a model XML-escaped
|
|
591
|
+
* to keep them valid inside the <payload> tag.
|
|
592
|
+
*/
|
|
593
|
+
function parseFindingsCandidate(candidate) {
|
|
594
|
+
const parsed = tryParseFindingsObject(candidate);
|
|
595
|
+
if (parsed) {
|
|
596
|
+
return parsed;
|
|
597
|
+
}
|
|
598
|
+
const decoded = decodeXmlEntities(candidate);
|
|
599
|
+
return decoded === candidate ? undefined : tryParseFindingsObject(decoded);
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* Parse the reviewer's final message. Looks for the last XML payload, fenced json block,
|
|
603
|
+
* or bare JSON object containing a findings array. Returns undefined when no parseable block exists.
|
|
604
|
+
*/
|
|
605
|
+
export function parseReviewOutput(text) {
|
|
606
|
+
// Extract XML payloads first so the preferred response envelope can contain prose safely.
|
|
607
|
+
const candidates = collectXmlPayloadCandidates(text);
|
|
608
|
+
// Extract fenced blocks line by line. Any info string opens a block (so a
|
|
609
|
+
// ```ts block in prose doesn't pair fences off-by-one), but only json or
|
|
610
|
+
// untagged blocks become candidates. A closer must be a bare ``` line, so
|
|
611
|
+
// fences embedded inside JSON strings don't terminate the block early.
|
|
612
|
+
let blockLines;
|
|
613
|
+
let blockIsCandidate = false;
|
|
614
|
+
let blockStartIndex = 0;
|
|
615
|
+
let lineStartIndex = 0;
|
|
616
|
+
for (const line of text.split("\n")) {
|
|
617
|
+
const trimmed = line.trim();
|
|
618
|
+
if (blockLines === undefined) {
|
|
619
|
+
if (trimmed.startsWith("```")) {
|
|
620
|
+
const infoString = trimmed.slice(3).trim();
|
|
621
|
+
blockLines = [];
|
|
622
|
+
blockIsCandidate = infoString === "" || infoString === "json";
|
|
623
|
+
blockStartIndex = lineStartIndex;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
else if (trimmed === "```") {
|
|
627
|
+
if (blockIsCandidate) {
|
|
628
|
+
candidates.push({ index: blockStartIndex, text: blockLines.join("\n") });
|
|
629
|
+
}
|
|
630
|
+
blockLines = undefined;
|
|
631
|
+
}
|
|
632
|
+
else {
|
|
633
|
+
blockLines.push(line);
|
|
634
|
+
}
|
|
635
|
+
lineStartIndex += line.length + 1;
|
|
636
|
+
}
|
|
637
|
+
// An unterminated trailing block is still worth trying.
|
|
638
|
+
if (blockLines !== undefined && blockIsCandidate) {
|
|
639
|
+
candidates.push({ index: blockStartIndex, text: blockLines.join("\n") });
|
|
640
|
+
}
|
|
641
|
+
// Also try the whole text in case the model emitted bare JSON.
|
|
642
|
+
candidates.push({ index: 0, text });
|
|
643
|
+
for (const candidateEntry of candidates.sort((a, b) => b.index - a.index)) {
|
|
644
|
+
const candidate = stripJsonMarkdownFence(candidateEntry.text);
|
|
645
|
+
if (!candidate.startsWith("{")) {
|
|
646
|
+
continue;
|
|
647
|
+
}
|
|
648
|
+
const parsed = parseFindingsCandidate(candidate);
|
|
649
|
+
if (parsed) {
|
|
650
|
+
return parsed;
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
return undefined;
|
|
654
|
+
}
|
|
655
|
+
// ============================================================================
|
|
656
|
+
// Seeding the fresh session
|
|
657
|
+
// ============================================================================
|
|
658
|
+
/**
|
|
659
|
+
* Strip the machine-readable `<response>…</response>` envelope (summary + JSON
|
|
660
|
+
* payload) from reviewer assistant text so a live in-process render shows the
|
|
661
|
+
* reviewer's prose and tool activity instead of raw markup. Also drops a
|
|
662
|
+
* trailing unterminated `<response>` so a mid-stream partial envelope never
|
|
663
|
+
* flashes. The formatted findings are surfaced separately after the handoff.
|
|
664
|
+
*/
|
|
665
|
+
export function stripReviewEnvelopeForDisplay(text) {
|
|
666
|
+
return text
|
|
667
|
+
.replace(/<response\b[\s\S]*?<\/response>/gi, "")
|
|
668
|
+
.replace(/<response\b[\s\S]*$/i, "")
|
|
669
|
+
.trim();
|
|
670
|
+
}
|
|
671
|
+
/**
|
|
672
|
+
* Format the review result as the seed message for the fresh post-review session.
|
|
673
|
+
* This text is both displayed and sent to the LLM as context.
|
|
674
|
+
*/
|
|
675
|
+
export function formatReviewForNewSession(resolved, parsed, raw) {
|
|
676
|
+
const lines = [
|
|
677
|
+
`An automated code review of ${resolved.description} was completed in a separate session.`,
|
|
678
|
+
"",
|
|
679
|
+
];
|
|
680
|
+
if (!parsed) {
|
|
681
|
+
lines.push("The reviewer's report (unstructured):", "", raw.trim());
|
|
682
|
+
}
|
|
683
|
+
else {
|
|
684
|
+
if (parsed.overallCorrectness || parsed.overallExplanation) {
|
|
685
|
+
const verdict = [parsed.overallCorrectness, parsed.overallExplanation].filter(Boolean).join(" — ");
|
|
686
|
+
lines.push(`Overall: ${verdict}`, "");
|
|
687
|
+
}
|
|
688
|
+
if (parsed.coverage) {
|
|
689
|
+
const coverageLines = [];
|
|
690
|
+
if (parsed.coverage.filesReviewed.length > 0) {
|
|
691
|
+
coverageLines.push(`Files reviewed: ${parsed.coverage.filesReviewed.join(", ")}`);
|
|
692
|
+
}
|
|
693
|
+
if (parsed.coverage.commandsRun.length > 0) {
|
|
694
|
+
coverageLines.push(`Commands run: ${parsed.coverage.commandsRun.join("; ")}`);
|
|
695
|
+
}
|
|
696
|
+
if (parsed.coverage.uncheckedAreas.length > 0) {
|
|
697
|
+
coverageLines.push(`Unchecked areas: ${parsed.coverage.uncheckedAreas.join("; ")}`);
|
|
698
|
+
}
|
|
699
|
+
if (coverageLines.length > 0) {
|
|
700
|
+
lines.push("Coverage:", ...coverageLines.map((line) => `- ${line}`), "");
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
if (parsed.findings.length === 0) {
|
|
704
|
+
lines.push("The review found no issues worth flagging.");
|
|
705
|
+
}
|
|
706
|
+
else {
|
|
707
|
+
lines.push("Findings:", "");
|
|
708
|
+
parsed.findings.forEach((finding, index) => {
|
|
709
|
+
const meta = [];
|
|
710
|
+
if (finding.priority !== undefined) {
|
|
711
|
+
meta.push(`P${finding.priority}`);
|
|
712
|
+
}
|
|
713
|
+
if (finding.confidence !== undefined) {
|
|
714
|
+
meta.push(`confidence ${Math.round(finding.confidence * 100)}%`);
|
|
715
|
+
}
|
|
716
|
+
const location = finding.file ? ` (${finding.file}${finding.line ? `:${finding.line}` : ""})` : "";
|
|
717
|
+
const metaText = meta.length > 0 ? ` [${meta.join(", ")}]` : "";
|
|
718
|
+
lines.push(`### ${index + 1}. ${finding.title}${metaText}${location}`, "");
|
|
719
|
+
if (finding.body) {
|
|
720
|
+
lines.push(finding.body, "");
|
|
721
|
+
}
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
// Collapse any trailing blank lines (the findings loop appends one after each
|
|
726
|
+
// entry) so the footer is always separated by exactly one blank line.
|
|
727
|
+
while (lines.length > 0 && lines[lines.length - 1] === "") {
|
|
728
|
+
lines.pop();
|
|
729
|
+
}
|
|
730
|
+
lines.push("", `Reproduce the reviewed diff with \`${resolved.diffCommand}\`.`, 'The user may refer to findings by number (e.g. "fix 1 and 3"). When asked to fix findings, read the relevant code first and apply minimal, correct fixes.');
|
|
731
|
+
return lines.join("\n");
|
|
732
|
+
}
|
|
733
|
+
// ============================================================================
|
|
734
|
+
// Running the review
|
|
735
|
+
// ============================================================================
|
|
736
|
+
/**
|
|
737
|
+
* Minimal resource loader for the isolated review session: it loads the
|
|
738
|
+
* project's context files (AGENTS.md) but provides no user extensions, skills,
|
|
739
|
+
* prompt templates, themes, or subagents. Configured extension *tools* are
|
|
740
|
+
* inherited separately (see collectParentExtensionTools) and passed as
|
|
741
|
+
* customTools in runReviewSession.
|
|
742
|
+
*/
|
|
743
|
+
export function createReviewResourceLoader(cwd, agentDir) {
|
|
744
|
+
const extensionsResult = { extensions: [], errors: [], runtime: createExtensionRuntime() };
|
|
745
|
+
const agentsFiles = loadProjectContextFiles({ cwd, agentDir });
|
|
746
|
+
return {
|
|
747
|
+
getExtensions: () => extensionsResult,
|
|
748
|
+
getSkills: () => ({ skills: [], diagnostics: [] }),
|
|
749
|
+
getPrompts: () => ({ prompts: [], diagnostics: [] }),
|
|
750
|
+
getThemes: () => ({ themes: [], diagnostics: [] }),
|
|
751
|
+
getSubagents: () => ({ definitions: [], diagnostics: [] }),
|
|
752
|
+
getAgentsFiles: () => ({ agentsFiles }),
|
|
753
|
+
getSystemPrompt: () => REVIEW_SYSTEM_PROMPT,
|
|
754
|
+
getAppendSystemPrompt: () => [],
|
|
755
|
+
extendResources: () => { },
|
|
756
|
+
reload: async () => { },
|
|
757
|
+
};
|
|
758
|
+
}
|
|
759
|
+
function collectParentExtensionTools(parentResourceLoader) {
|
|
760
|
+
const parentExtensions = parentResourceLoader?.getExtensions();
|
|
761
|
+
if (!parentExtensions) {
|
|
762
|
+
return [];
|
|
763
|
+
}
|
|
764
|
+
const toolsByName = new Map();
|
|
765
|
+
for (const extension of parentExtensions.extensions) {
|
|
766
|
+
for (const tool of extension.tools.values()) {
|
|
767
|
+
if (!toolsByName.has(tool.definition.name)) {
|
|
768
|
+
toolsByName.set(tool.definition.name, tool.definition);
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
return Array.from(toolsByName.values());
|
|
773
|
+
}
|
|
774
|
+
export function createReviewConfirmationMessage(resolution) {
|
|
775
|
+
return [
|
|
776
|
+
`Review ${resolution.description}?`,
|
|
777
|
+
"",
|
|
778
|
+
"Volt will inspect the selected git diff, may read related project files with host-approved read-only tools, consume model tokens, and create a fresh session seeded with the findings.",
|
|
779
|
+
`Diff command: ${resolution.diffCommand}`,
|
|
780
|
+
].join("\n");
|
|
781
|
+
}
|
|
782
|
+
export function resolveReviewModel(options) {
|
|
783
|
+
const reference = options.settingsManager.getReviewModel();
|
|
784
|
+
if (reference) {
|
|
785
|
+
options.modelRegistry.refresh();
|
|
786
|
+
const available = options.modelRegistry.getAvailable();
|
|
787
|
+
const match = findExactModelReferenceMatch(reference, available);
|
|
788
|
+
if (match) {
|
|
789
|
+
return { model: match };
|
|
790
|
+
}
|
|
791
|
+
return {
|
|
792
|
+
model: options.currentModel,
|
|
793
|
+
warning: `reviewModel "${reference}" not found or not authenticated; using the current model.`,
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
return { model: options.currentModel };
|
|
797
|
+
}
|
|
798
|
+
function reviewActionIdForTarget(target) {
|
|
799
|
+
switch (target.kind) {
|
|
800
|
+
case "uncommitted":
|
|
801
|
+
return "review.uncommitted";
|
|
802
|
+
case "branch":
|
|
803
|
+
return "review.branch";
|
|
804
|
+
case "pr":
|
|
805
|
+
return "review.pr";
|
|
806
|
+
case "commit":
|
|
807
|
+
return "review.commit";
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
function createReviewWorkflowId() {
|
|
811
|
+
return `review:${randomUUID()}`;
|
|
812
|
+
}
|
|
813
|
+
function emitReviewWorkflowEvent(emit, event) {
|
|
814
|
+
emit?.(event);
|
|
815
|
+
}
|
|
816
|
+
export async function runReviewWorkflow(options) {
|
|
817
|
+
assertReviewCanStart(options.session);
|
|
818
|
+
if (options.requireProjectTrust && !options.settingsManager.isProjectTrusted()) {
|
|
819
|
+
throw new Error("Project trust is required before running a remote review.");
|
|
820
|
+
}
|
|
821
|
+
const resolution = await resolveReviewTarget(options.target, options.cwd);
|
|
822
|
+
if ("error" in resolution) {
|
|
823
|
+
throw new Error(resolution.error);
|
|
824
|
+
}
|
|
825
|
+
if (options.requireConfirmation) {
|
|
826
|
+
const confirmed = await options.confirm?.({
|
|
827
|
+
title: "Review changes",
|
|
828
|
+
message: createReviewConfirmationMessage(resolution),
|
|
829
|
+
resolution,
|
|
830
|
+
});
|
|
831
|
+
if (!confirmed) {
|
|
832
|
+
return { status: "cancelled", resolution };
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
const reviewModel = resolveReviewModel({
|
|
836
|
+
settingsManager: options.settingsManager,
|
|
837
|
+
modelRegistry: options.session.modelRegistry,
|
|
838
|
+
currentModel: options.session.model,
|
|
839
|
+
});
|
|
840
|
+
if (reviewModel.warning) {
|
|
841
|
+
options.onReviewModelWarning?.(reviewModel.warning);
|
|
842
|
+
}
|
|
843
|
+
const model = reviewModel.model;
|
|
844
|
+
if (!model) {
|
|
845
|
+
throw new Error("No model available for review. Use /model to select one.");
|
|
846
|
+
}
|
|
847
|
+
assertReviewCanStart(options.session);
|
|
848
|
+
const workflowId = createReviewWorkflowId();
|
|
849
|
+
const workflowAction = reviewActionIdForTarget(options.target);
|
|
850
|
+
const hooks = await options.onBeforeReview?.(resolution, model);
|
|
851
|
+
const emitEvent = (event) => {
|
|
852
|
+
options.onEvent?.(event);
|
|
853
|
+
hooks?.onEvent?.(event);
|
|
854
|
+
};
|
|
855
|
+
emitReviewWorkflowEvent(emitEvent, {
|
|
856
|
+
type: "workflow_start",
|
|
857
|
+
workflowId,
|
|
858
|
+
kind: "review",
|
|
859
|
+
action: workflowAction,
|
|
860
|
+
title: "Review",
|
|
861
|
+
message: `Reviewing ${resolution.description}.`,
|
|
862
|
+
status: "running",
|
|
863
|
+
});
|
|
864
|
+
let terminalWorkflowEmitted = false;
|
|
865
|
+
const emitTerminalWorkflowEvent = (event) => {
|
|
866
|
+
terminalWorkflowEmitted = true;
|
|
867
|
+
emitReviewWorkflowEvent(emitEvent, event);
|
|
868
|
+
};
|
|
869
|
+
try {
|
|
870
|
+
let result;
|
|
871
|
+
try {
|
|
872
|
+
result = await runReview({
|
|
873
|
+
cwd: options.cwd,
|
|
874
|
+
agentDir: options.agentDir,
|
|
875
|
+
model,
|
|
876
|
+
thinkingLevel: options.session.thinkingLevel,
|
|
877
|
+
authStorage: options.authStorage,
|
|
878
|
+
modelRegistry: options.session.modelRegistry,
|
|
879
|
+
settingsManager: options.settingsManager,
|
|
880
|
+
resolved: resolution,
|
|
881
|
+
parentResourceLoader: options.session.resourceLoader,
|
|
882
|
+
tools: options.tools ? [...options.tools] : undefined,
|
|
883
|
+
signal: hooks?.signal,
|
|
884
|
+
onProgress: hooks?.onProgress,
|
|
885
|
+
onSessionEvent: hooks?.onSessionEvent,
|
|
886
|
+
onEvent: emitEvent,
|
|
887
|
+
workflowId,
|
|
888
|
+
workflowAction,
|
|
889
|
+
});
|
|
890
|
+
}
|
|
891
|
+
finally {
|
|
892
|
+
hooks?.cleanup?.();
|
|
893
|
+
}
|
|
894
|
+
if (result.aborted || hooks?.signal?.aborted) {
|
|
895
|
+
emitTerminalWorkflowEvent({
|
|
896
|
+
type: "workflow_end",
|
|
897
|
+
workflowId,
|
|
898
|
+
kind: "review",
|
|
899
|
+
action: workflowAction,
|
|
900
|
+
title: "Review",
|
|
901
|
+
message: "Review cancelled.",
|
|
902
|
+
status: "cancelled",
|
|
903
|
+
});
|
|
904
|
+
return { status: "cancelled", resolution };
|
|
905
|
+
}
|
|
906
|
+
if (result.errorMessage) {
|
|
907
|
+
emitTerminalWorkflowEvent({
|
|
908
|
+
type: "workflow_end",
|
|
909
|
+
workflowId,
|
|
910
|
+
kind: "review",
|
|
911
|
+
action: workflowAction,
|
|
912
|
+
title: "Review",
|
|
913
|
+
message: `Review failed: ${result.errorMessage}`,
|
|
914
|
+
status: "failed",
|
|
915
|
+
});
|
|
916
|
+
throw new Error(`Review failed: ${result.errorMessage}`);
|
|
917
|
+
}
|
|
918
|
+
emitReviewWorkflowEvent(emitEvent, {
|
|
919
|
+
type: "workflow_update",
|
|
920
|
+
workflowId,
|
|
921
|
+
kind: "review",
|
|
922
|
+
action: workflowAction,
|
|
923
|
+
title: "Review",
|
|
924
|
+
message: "Finalizing findings.",
|
|
925
|
+
status: "finalizing",
|
|
926
|
+
});
|
|
927
|
+
const reviewMessage = createReviewSeedMessage(resolution, result);
|
|
928
|
+
const newSessionResult = await options.newSession({
|
|
929
|
+
withSession: async (ctx) => {
|
|
930
|
+
await ctx.sendMessage(reviewMessage);
|
|
931
|
+
},
|
|
932
|
+
});
|
|
933
|
+
if (newSessionResult.cancelled) {
|
|
934
|
+
await options.session.sendCustomMessage(reviewMessage);
|
|
935
|
+
}
|
|
936
|
+
const completedResult = {
|
|
937
|
+
status: "completed",
|
|
938
|
+
resolution,
|
|
939
|
+
findingsCount: result.parsed?.findings.length,
|
|
940
|
+
sessionSwitchCancelled: newSessionResult.cancelled,
|
|
941
|
+
};
|
|
942
|
+
emitTerminalWorkflowEvent({
|
|
943
|
+
type: "workflow_end",
|
|
944
|
+
workflowId,
|
|
945
|
+
kind: "review",
|
|
946
|
+
action: workflowAction,
|
|
947
|
+
title: "Review",
|
|
948
|
+
message: newSessionResult.cancelled
|
|
949
|
+
? `${formatReviewWorkflowSummary(completedResult)} Findings were added to the current session.`
|
|
950
|
+
: `${formatReviewWorkflowSummary(completedResult)} Opening review session.`,
|
|
951
|
+
status: "completed",
|
|
952
|
+
});
|
|
953
|
+
return completedResult;
|
|
954
|
+
}
|
|
955
|
+
catch (error) {
|
|
956
|
+
if (!terminalWorkflowEmitted) {
|
|
957
|
+
emitTerminalWorkflowEvent({
|
|
958
|
+
type: "workflow_end",
|
|
959
|
+
workflowId,
|
|
960
|
+
kind: "review",
|
|
961
|
+
action: workflowAction,
|
|
962
|
+
title: "Review",
|
|
963
|
+
message: "Review failed.",
|
|
964
|
+
status: "failed",
|
|
965
|
+
});
|
|
966
|
+
}
|
|
967
|
+
throw error;
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
export function formatReviewWorkflowSummary(result) {
|
|
971
|
+
const findingCount = result.findingsCount;
|
|
972
|
+
if (findingCount === undefined) {
|
|
973
|
+
return "Review complete.";
|
|
974
|
+
}
|
|
975
|
+
if (findingCount === 0) {
|
|
976
|
+
return "Review complete: no issues found.";
|
|
977
|
+
}
|
|
978
|
+
return `Review complete: ${findingCount} finding${findingCount === 1 ? "" : "s"}.`;
|
|
979
|
+
}
|
|
980
|
+
function assertReviewCanStart(session) {
|
|
981
|
+
if ((session.isBusy ?? session.isStreaming) || session.isCompacting) {
|
|
982
|
+
throw new Error("Wait for the current response to finish before starting a review.");
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
function createReviewSeedMessage(resolution, result) {
|
|
986
|
+
return {
|
|
987
|
+
customType: "review",
|
|
988
|
+
content: formatReviewForNewSession(resolution, result.parsed, result.raw),
|
|
989
|
+
display: true,
|
|
990
|
+
details: { target: resolution.description, findings: result.parsed?.findings ?? [] },
|
|
991
|
+
};
|
|
992
|
+
}
|
|
993
|
+
function summarizeToolArgs(args) {
|
|
994
|
+
if (typeof args !== "object" || args === null) {
|
|
995
|
+
return undefined;
|
|
996
|
+
}
|
|
997
|
+
for (const value of Object.values(args)) {
|
|
998
|
+
if (typeof value === "string" && value.trim()) {
|
|
999
|
+
const oneLine = value.replace(/\s+/g, " ").trim();
|
|
1000
|
+
return oneLine.length > 60 ? `${oneLine.slice(0, 57)}...` : oneLine;
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
return undefined;
|
|
1004
|
+
}
|
|
1005
|
+
const REVIEW_WORKFLOW_ARG_STRING_LIMIT = 240;
|
|
1006
|
+
function createReviewWorkflowToolCallId(workflowId, toolCallId) {
|
|
1007
|
+
const id = typeof toolCallId === "string" && toolCallId.trim() ? toolCallId.trim() : "unknown";
|
|
1008
|
+
return workflowId ? `${workflowId}:${id}` : id;
|
|
1009
|
+
}
|
|
1010
|
+
function sanitizeReviewWorkflowToolArgs(toolName, args) {
|
|
1011
|
+
if (typeof args !== "object" || args === null || Array.isArray(args)) {
|
|
1012
|
+
return undefined;
|
|
1013
|
+
}
|
|
1014
|
+
const record = args;
|
|
1015
|
+
const normalizedToolName = toolName?.trim().toLowerCase();
|
|
1016
|
+
const keysByTool = {
|
|
1017
|
+
read: ["path", "file_path", "offset", "limit"],
|
|
1018
|
+
grep: ["pattern", "path", "glob", "ignoreCase", "literal", "context", "limit"],
|
|
1019
|
+
find: ["pattern", "query", "path", "limit"],
|
|
1020
|
+
ls: ["path", "limit"],
|
|
1021
|
+
bash: ["command"],
|
|
1022
|
+
lsp: ["action", "symbol", "line", "path"],
|
|
1023
|
+
};
|
|
1024
|
+
const allowedKeys = keysByTool[normalizedToolName ?? ""] ?? [
|
|
1025
|
+
"action",
|
|
1026
|
+
"command",
|
|
1027
|
+
"file_path",
|
|
1028
|
+
"glob",
|
|
1029
|
+
"line",
|
|
1030
|
+
"path",
|
|
1031
|
+
"pattern",
|
|
1032
|
+
"query",
|
|
1033
|
+
"symbol",
|
|
1034
|
+
];
|
|
1035
|
+
const sanitized = {};
|
|
1036
|
+
for (const key of allowedKeys) {
|
|
1037
|
+
if (!Object.hasOwn(record, key)) {
|
|
1038
|
+
continue;
|
|
1039
|
+
}
|
|
1040
|
+
const value = sanitizeReviewWorkflowArgValue(record[key]);
|
|
1041
|
+
if (value !== undefined) {
|
|
1042
|
+
sanitized[key] = value;
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
return Object.keys(sanitized).length > 0 ? sanitized : undefined;
|
|
1046
|
+
}
|
|
1047
|
+
function sanitizeReviewWorkflowArgValue(value) {
|
|
1048
|
+
if (typeof value === "string") {
|
|
1049
|
+
const trimmed = value.replace(/\s+/g, " ").trim();
|
|
1050
|
+
if (!trimmed) {
|
|
1051
|
+
return undefined;
|
|
1052
|
+
}
|
|
1053
|
+
return trimmed.length <= REVIEW_WORKFLOW_ARG_STRING_LIMIT
|
|
1054
|
+
? trimmed
|
|
1055
|
+
: `${trimmed.slice(0, REVIEW_WORKFLOW_ARG_STRING_LIMIT - 1)}…`;
|
|
1056
|
+
}
|
|
1057
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
1058
|
+
return value;
|
|
1059
|
+
}
|
|
1060
|
+
if (typeof value === "boolean") {
|
|
1061
|
+
return value;
|
|
1062
|
+
}
|
|
1063
|
+
return undefined;
|
|
1064
|
+
}
|
|
1065
|
+
function emitReviewWorkflowToolEvent(emit, options, event) {
|
|
1066
|
+
if (!emit || !options.workflowId || !options.workflowAction || !event.toolName) {
|
|
1067
|
+
return;
|
|
1068
|
+
}
|
|
1069
|
+
if (event.type === "tool_execution_start") {
|
|
1070
|
+
emit({
|
|
1071
|
+
type: "tool_execution_start",
|
|
1072
|
+
workflowId: options.workflowId,
|
|
1073
|
+
workflowKind: "review",
|
|
1074
|
+
workflowAction: options.workflowAction,
|
|
1075
|
+
toolCallId: createReviewWorkflowToolCallId(options.workflowId, event.toolCallId),
|
|
1076
|
+
toolName: event.toolName,
|
|
1077
|
+
args: sanitizeReviewWorkflowToolArgs(event.toolName, event.args),
|
|
1078
|
+
});
|
|
1079
|
+
return;
|
|
1080
|
+
}
|
|
1081
|
+
if (event.type === "tool_execution_end") {
|
|
1082
|
+
emit({
|
|
1083
|
+
type: "tool_execution_end",
|
|
1084
|
+
workflowId: options.workflowId,
|
|
1085
|
+
workflowKind: "review",
|
|
1086
|
+
workflowAction: options.workflowAction,
|
|
1087
|
+
toolCallId: createReviewWorkflowToolCallId(options.workflowId, event.toolCallId),
|
|
1088
|
+
toolName: event.toolName,
|
|
1089
|
+
isError: event.isError === true,
|
|
1090
|
+
});
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
export async function createWorkingTreeGuard(cwd) {
|
|
1094
|
+
const root = await gitRepoRoot(cwd);
|
|
1095
|
+
const snapshot = root ? await captureWorkingTree(root) : undefined;
|
|
1096
|
+
let restored = false;
|
|
1097
|
+
return {
|
|
1098
|
+
async restore() {
|
|
1099
|
+
if (restored || !root || !snapshot) {
|
|
1100
|
+
return;
|
|
1101
|
+
}
|
|
1102
|
+
restored = true;
|
|
1103
|
+
await restoreWorkingTree(root, snapshot);
|
|
1104
|
+
},
|
|
1105
|
+
};
|
|
1106
|
+
}
|
|
1107
|
+
async function gitRepoRoot(cwd) {
|
|
1108
|
+
const result = await runCommand("git", ["rev-parse", "--show-toplevel"], cwd);
|
|
1109
|
+
return result.ok ? result.stdout.trim() || undefined : undefined;
|
|
1110
|
+
}
|
|
1111
|
+
/** Write a tree object capturing every non-ignored file in the working tree. */
|
|
1112
|
+
async function captureWorkingTree(root) {
|
|
1113
|
+
return withTempIndex(async (indexFile) => {
|
|
1114
|
+
const env = { GIT_INDEX_FILE: indexFile };
|
|
1115
|
+
const add = await runCommand("git", ["add", "-A"], root, env);
|
|
1116
|
+
if (!add.ok) {
|
|
1117
|
+
return undefined;
|
|
1118
|
+
}
|
|
1119
|
+
const tree = await runCommand("git", ["write-tree"], root, env);
|
|
1120
|
+
return tree.ok ? tree.stdout.trim() || undefined : undefined;
|
|
1121
|
+
});
|
|
1122
|
+
}
|
|
1123
|
+
/** Revert the working tree back to the snapshot, touching only changed paths. */
|
|
1124
|
+
async function restoreWorkingTree(root, snapshotTree) {
|
|
1125
|
+
await withTempIndex(async (indexFile) => {
|
|
1126
|
+
const env = { GIT_INDEX_FILE: indexFile };
|
|
1127
|
+
const add = await runCommand("git", ["add", "-A"], root, env);
|
|
1128
|
+
if (!add.ok) {
|
|
1129
|
+
return;
|
|
1130
|
+
}
|
|
1131
|
+
const endTreeResult = await runCommand("git", ["write-tree"], root, env);
|
|
1132
|
+
const endTree = endTreeResult.ok ? endTreeResult.stdout.trim() : "";
|
|
1133
|
+
if (!endTree || endTree === snapshotTree) {
|
|
1134
|
+
return; // The reviewer left the working tree as it found it.
|
|
1135
|
+
}
|
|
1136
|
+
const diff = await runCommand("git", ["diff-tree", "-r", "-z", "--no-renames", "--name-status", snapshotTree, endTree], root);
|
|
1137
|
+
if (!diff.ok) {
|
|
1138
|
+
return;
|
|
1139
|
+
}
|
|
1140
|
+
const { added, changed } = parseNameStatusZ(diff.stdout);
|
|
1141
|
+
// Restore modified/deleted paths from the snapshot, then remove additions.
|
|
1142
|
+
if (changed.length > 0) {
|
|
1143
|
+
await runCommand("git", ["read-tree", snapshotTree], root, env);
|
|
1144
|
+
await runCommand("git", ["checkout-index", "-f", "--", ...changed], root, env);
|
|
1145
|
+
}
|
|
1146
|
+
for (const path of added) {
|
|
1147
|
+
await rm(join(root, path), { force: true });
|
|
1148
|
+
}
|
|
1149
|
+
});
|
|
1150
|
+
}
|
|
1151
|
+
/** Split a `-z --name-status` diff-tree stream into added vs modified/deleted paths. */
|
|
1152
|
+
function parseNameStatusZ(stdout) {
|
|
1153
|
+
const tokens = stdout.split("\0").filter((token) => token.length > 0);
|
|
1154
|
+
const added = [];
|
|
1155
|
+
const changed = [];
|
|
1156
|
+
for (let i = 0; i + 1 < tokens.length; i += 2) {
|
|
1157
|
+
const status = tokens[i];
|
|
1158
|
+
const path = tokens[i + 1];
|
|
1159
|
+
if (status.startsWith("A")) {
|
|
1160
|
+
added.push(path);
|
|
1161
|
+
}
|
|
1162
|
+
else {
|
|
1163
|
+
changed.push(path);
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
return { added, changed };
|
|
1167
|
+
}
|
|
1168
|
+
async function withTempIndex(fn) {
|
|
1169
|
+
const dir = await mkdtemp(join(tmpdir(), "volt-review-index-"));
|
|
1170
|
+
const indexFile = join(dir, "index");
|
|
1171
|
+
try {
|
|
1172
|
+
return await fn(indexFile);
|
|
1173
|
+
}
|
|
1174
|
+
finally {
|
|
1175
|
+
await rm(dir, { recursive: true, force: true }).catch(() => { });
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
/**
|
|
1179
|
+
* Run a review in an isolated in-process agent session.
|
|
1180
|
+
* The session is in-memory (not persisted) and disposed when done.
|
|
1181
|
+
*
|
|
1182
|
+
* The reviewer executes in the user's real cwd so it can run the project's
|
|
1183
|
+
* tests and reproduce bugs with real dependencies. A working-tree guard
|
|
1184
|
+
* snapshots the tree first and reverts anything the reviewer adds, modifies,
|
|
1185
|
+
* or deletes once the review finishes — including on error or abort.
|
|
1186
|
+
*/
|
|
1187
|
+
export async function runReview(options) {
|
|
1188
|
+
const guard = await createWorkingTreeGuard(options.cwd);
|
|
1189
|
+
try {
|
|
1190
|
+
return await runReviewSession(options);
|
|
1191
|
+
}
|
|
1192
|
+
finally {
|
|
1193
|
+
await guard.restore();
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
async function runReviewSession(options) {
|
|
1197
|
+
const inheritedTools = collectParentExtensionTools(options.parentResourceLoader);
|
|
1198
|
+
const resourceLoader = createReviewResourceLoader(options.cwd, options.agentDir);
|
|
1199
|
+
const { session } = await createAgentSession({
|
|
1200
|
+
cwd: options.cwd,
|
|
1201
|
+
agentDir: options.agentDir,
|
|
1202
|
+
authStorage: options.authStorage,
|
|
1203
|
+
modelRegistry: options.modelRegistry,
|
|
1204
|
+
settingsManager: options.settingsManager,
|
|
1205
|
+
model: options.model,
|
|
1206
|
+
thinkingLevel: options.thinkingLevel,
|
|
1207
|
+
sessionManager: SessionManager.inMemory(options.cwd),
|
|
1208
|
+
resourceLoader,
|
|
1209
|
+
customTools: inheritedTools.length > 0 ? inheritedTools : undefined,
|
|
1210
|
+
tools: options.tools,
|
|
1211
|
+
// Isolated reviewer: never spin up (or tear down) the user's MCP servers.
|
|
1212
|
+
disableMcp: true,
|
|
1213
|
+
});
|
|
1214
|
+
// An abort during session creation fires before the listener below is
|
|
1215
|
+
// attached, and AbortSignal does not invoke listeners added after the fact.
|
|
1216
|
+
if (options.signal?.aborted) {
|
|
1217
|
+
session.dispose();
|
|
1218
|
+
return { aborted: true, raw: "" };
|
|
1219
|
+
}
|
|
1220
|
+
const onAbort = () => {
|
|
1221
|
+
void session.abort();
|
|
1222
|
+
};
|
|
1223
|
+
options.signal?.addEventListener("abort", onAbort, { once: true });
|
|
1224
|
+
const unsubscribe = session.subscribe((event) => {
|
|
1225
|
+
options.onSessionEvent?.(event);
|
|
1226
|
+
if (event.type === "tool_execution_start") {
|
|
1227
|
+
const summary = summarizeToolArgs(event.args);
|
|
1228
|
+
options.onProgress?.(summary ? `${event.toolName}: ${summary}` : event.toolName);
|
|
1229
|
+
emitReviewWorkflowToolEvent(options.onEvent, options, event);
|
|
1230
|
+
}
|
|
1231
|
+
else if (event.type === "tool_execution_end") {
|
|
1232
|
+
emitReviewWorkflowToolEvent(options.onEvent, options, event);
|
|
1233
|
+
}
|
|
1234
|
+
});
|
|
1235
|
+
try {
|
|
1236
|
+
await session.prompt(buildReviewPrompt(options.resolved), { expandPromptTemplates: false });
|
|
1237
|
+
if (options.signal?.aborted) {
|
|
1238
|
+
return { aborted: true, raw: "" };
|
|
1239
|
+
}
|
|
1240
|
+
const lastAssistant = [...session.messages]
|
|
1241
|
+
.reverse()
|
|
1242
|
+
.find((message) => message.role === "assistant");
|
|
1243
|
+
if (lastAssistant?.stopReason === "aborted") {
|
|
1244
|
+
return { aborted: true, raw: "" };
|
|
1245
|
+
}
|
|
1246
|
+
if (lastAssistant?.stopReason === "error") {
|
|
1247
|
+
return { aborted: false, raw: "", errorMessage: lastAssistant.errorMessage ?? "Review failed" };
|
|
1248
|
+
}
|
|
1249
|
+
const raw = session.getLastAssistantText() ?? "";
|
|
1250
|
+
if (!raw.trim()) {
|
|
1251
|
+
return { aborted: false, raw: "", errorMessage: "Review produced no output" };
|
|
1252
|
+
}
|
|
1253
|
+
return { aborted: false, raw, parsed: parseReviewOutput(raw) };
|
|
1254
|
+
}
|
|
1255
|
+
catch (error) {
|
|
1256
|
+
if (options.signal?.aborted) {
|
|
1257
|
+
return { aborted: true, raw: "" };
|
|
1258
|
+
}
|
|
1259
|
+
return {
|
|
1260
|
+
aborted: false,
|
|
1261
|
+
raw: "",
|
|
1262
|
+
errorMessage: error instanceof Error ? error.message : String(error),
|
|
1263
|
+
};
|
|
1264
|
+
}
|
|
1265
|
+
finally {
|
|
1266
|
+
unsubscribe();
|
|
1267
|
+
options.signal?.removeEventListener("abort", onAbort);
|
|
1268
|
+
session.dispose();
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
//# sourceMappingURL=review.js.map
|