@gajae-code/coding-agent 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8662 -0
- package/README.md +37 -0
- package/dist/types/async/index.d.ts +2 -0
- package/dist/types/async/job-manager.d.ts +101 -0
- package/dist/types/async/support.d.ts +2 -0
- package/dist/types/autoresearch/dashboard.d.ts +4 -0
- package/dist/types/autoresearch/git.d.ts +36 -0
- package/dist/types/autoresearch/helpers.d.ts +24 -0
- package/dist/types/autoresearch/index.d.ts +2 -0
- package/dist/types/autoresearch/state.d.ts +17 -0
- package/dist/types/autoresearch/storage.d.ts +142 -0
- package/dist/types/autoresearch/tools/init-experiment.d.ts +31 -0
- package/dist/types/autoresearch/tools/log-experiment.d.ts +23 -0
- package/dist/types/autoresearch/tools/run-experiment.d.ts +8 -0
- package/dist/types/autoresearch/tools/update-notes.d.ts +12 -0
- package/dist/types/autoresearch/types.d.ts +154 -0
- package/dist/types/capability/context-file.d.ts +17 -0
- package/dist/types/capability/extension-module.d.ts +15 -0
- package/dist/types/capability/extension.d.ts +28 -0
- package/dist/types/capability/fs.d.ts +20 -0
- package/dist/types/capability/hook.d.ts +19 -0
- package/dist/types/capability/index.d.ts +80 -0
- package/dist/types/capability/instruction.d.ts +17 -0
- package/dist/types/capability/mcp.d.ts +45 -0
- package/dist/types/capability/prompt.d.ts +15 -0
- package/dist/types/capability/rule.d.ts +61 -0
- package/dist/types/capability/settings.d.ts +15 -0
- package/dist/types/capability/skill.d.ts +36 -0
- package/dist/types/capability/slash-command.d.ts +17 -0
- package/dist/types/capability/ssh.d.ts +23 -0
- package/dist/types/capability/system-prompt.d.ts +15 -0
- package/dist/types/capability/tool.d.ts +19 -0
- package/dist/types/capability/types.d.ts +154 -0
- package/dist/types/cli/agents-cli.d.ts +12 -0
- package/dist/types/cli/args.d.ts +53 -0
- package/dist/types/cli/auth-broker-cli.d.ts +25 -0
- package/dist/types/cli/auth-gateway-cli.d.ts +18 -0
- package/dist/types/cli/classify-install-target.d.ts +18 -0
- package/dist/types/cli/commands/init-xdg.d.ts +1 -0
- package/dist/types/cli/config-cli.d.ts +22 -0
- package/dist/types/cli/file-processor.d.ts +11 -0
- package/dist/types/cli/grep-cli.d.ts +17 -0
- package/dist/types/cli/initial-message.d.ts +17 -0
- package/dist/types/cli/list-models.d.ts +30 -0
- package/dist/types/cli/plugin-cli.d.ts +32 -0
- package/dist/types/cli/read-cli.d.ts +4 -0
- package/dist/types/cli/session-picker.d.ts +3 -0
- package/dist/types/cli/setup-cli.d.ts +31 -0
- package/dist/types/cli/shell-cli.d.ts +8 -0
- package/dist/types/cli/ssh-cli.d.ts +21 -0
- package/dist/types/cli/stats-cli.d.ts +17 -0
- package/dist/types/cli/update-cli.d.ts +38 -0
- package/dist/types/cli/web-search-cli.d.ts +20 -0
- package/dist/types/cli/worktree-cli.d.ts +26 -0
- package/dist/types/cli.d.ts +3 -0
- package/dist/types/commands/acp.d.ts +12 -0
- package/dist/types/commands/agents.d.ts +34 -0
- package/dist/types/commands/auth-broker.d.ts +54 -0
- package/dist/types/commands/auth-gateway.d.ts +32 -0
- package/dist/types/commands/codex-native-hook.d.ts +6 -0
- package/dist/types/commands/commit.d.ts +27 -0
- package/dist/types/commands/config.d.ts +30 -0
- package/dist/types/commands/deep-interview.d.ts +7 -0
- package/dist/types/commands/gjc-runtime-bridge.d.ts +6 -0
- package/dist/types/commands/grep.d.ts +42 -0
- package/dist/types/commands/launch.d.ts +121 -0
- package/dist/types/commands/plugin.d.ts +52 -0
- package/dist/types/commands/question.d.ts +7 -0
- package/dist/types/commands/ralplan.d.ts +7 -0
- package/dist/types/commands/read.d.ts +15 -0
- package/dist/types/commands/setup.d.ts +48 -0
- package/dist/types/commands/shell.d.ts +21 -0
- package/dist/types/commands/ssh.d.ts +48 -0
- package/dist/types/commands/state.d.ts +7 -0
- package/dist/types/commands/stats.d.ts +25 -0
- package/dist/types/commands/team.d.ts +24 -0
- package/dist/types/commands/ultragoal.d.ts +7 -0
- package/dist/types/commands/update.d.ts +20 -0
- package/dist/types/commands/web-search.d.ts +33 -0
- package/dist/types/commands/worktree.d.ts +34 -0
- package/dist/types/commit/agentic/agent.d.ts +31 -0
- package/dist/types/commit/agentic/fallback.d.ts +5 -0
- package/dist/types/commit/agentic/index.d.ts +2 -0
- package/dist/types/commit/agentic/state.d.ts +58 -0
- package/dist/types/commit/agentic/tools/analyze-file.d.ts +19 -0
- package/dist/types/commit/agentic/tools/git-file-diff.d.ts +10 -0
- package/dist/types/commit/agentic/tools/git-hunk.d.ts +9 -0
- package/dist/types/commit/agentic/tools/git-overview.d.ts +9 -0
- package/dist/types/commit/agentic/tools/index.d.ts +16 -0
- package/dist/types/commit/agentic/tools/propose-changelog.d.ts +28 -0
- package/dist/types/commit/agentic/tools/propose-commit.d.ts +36 -0
- package/dist/types/commit/agentic/tools/recent-commits.d.ts +7 -0
- package/dist/types/commit/agentic/tools/schemas.d.ts +27 -0
- package/dist/types/commit/agentic/tools/split-commit.d.ts +53 -0
- package/dist/types/commit/agentic/topo-sort.d.ts +4 -0
- package/dist/types/commit/agentic/trivial.d.ts +7 -0
- package/dist/types/commit/agentic/validation.d.ts +20 -0
- package/dist/types/commit/analysis/conventional.d.ts +22 -0
- package/dist/types/commit/analysis/index.d.ts +4 -0
- package/dist/types/commit/analysis/scope.d.ts +6 -0
- package/dist/types/commit/analysis/summary.d.ts +19 -0
- package/dist/types/commit/analysis/validation.d.ts +8 -0
- package/dist/types/commit/changelog/detect.d.ts +2 -0
- package/dist/types/commit/changelog/generate.d.ts +30 -0
- package/dist/types/commit/changelog/index.d.ts +30 -0
- package/dist/types/commit/changelog/parse.d.ts +2 -0
- package/dist/types/commit/cli.d.ts +3 -0
- package/dist/types/commit/git/diff.d.ts +5 -0
- package/dist/types/commit/index.d.ts +4 -0
- package/dist/types/commit/map-reduce/index.d.ts +28 -0
- package/dist/types/commit/map-reduce/map-phase.d.ts +17 -0
- package/dist/types/commit/map-reduce/reduce-phase.d.ts +13 -0
- package/dist/types/commit/map-reduce/utils.d.ts +2 -0
- package/dist/types/commit/message.d.ts +2 -0
- package/dist/types/commit/model-selection.d.ts +15 -0
- package/dist/types/commit/pipeline.d.ts +5 -0
- package/dist/types/commit/shared-llm.d.ts +54 -0
- package/dist/types/commit/types.d.ts +78 -0
- package/dist/types/commit/utils/exclusions.d.ts +4 -0
- package/dist/types/commit/utils.d.ts +20 -0
- package/dist/types/config/config-file.d.ts +58 -0
- package/dist/types/config/file-lock.d.ts +6 -0
- package/dist/types/config/keybindings.d.ts +334 -0
- package/dist/types/config/model-equivalence.d.ts +24 -0
- package/dist/types/config/model-registry.d.ts +390 -0
- package/dist/types/config/model-resolver.d.ts +230 -0
- package/dist/types/config/models-config-schema.d.ts +504 -0
- package/dist/types/config/prompt-templates.d.ts +32 -0
- package/dist/types/config/resolve-config-value.d.ts +17 -0
- package/dist/types/config/settings-schema.d.ts +3337 -0
- package/dist/types/config/settings.d.ts +132 -0
- package/dist/types/config/skill-settings-defaults.d.ts +14 -0
- package/dist/types/config.d.ts +66 -0
- package/dist/types/cursor.d.ts +24 -0
- package/dist/types/dap/client.d.ts +38 -0
- package/dist/types/dap/config.d.ts +6 -0
- package/dist/types/dap/index.d.ts +4 -0
- package/dist/types/dap/session.d.ts +108 -0
- package/dist/types/dap/types.d.ts +524 -0
- package/dist/types/debug/index.d.ts +15 -0
- package/dist/types/debug/log-formatting.d.ts +4 -0
- package/dist/types/debug/log-viewer.d.ts +68 -0
- package/dist/types/debug/profiler.d.ts +24 -0
- package/dist/types/debug/raw-sse-buffer.d.ts +44 -0
- package/dist/types/debug/raw-sse.d.ts +16 -0
- package/dist/types/debug/report-bundle.d.ts +55 -0
- package/dist/types/debug/system-info.d.ts +26 -0
- package/dist/types/defaults/gjc-defaults.d.ts +44 -0
- package/dist/types/discovery/agents-md.d.ts +1 -0
- package/dist/types/discovery/agents.d.ts +12 -0
- package/dist/types/discovery/builtin.d.ts +1 -0
- package/dist/types/discovery/claude-plugins.d.ts +1 -0
- package/dist/types/discovery/claude.d.ts +1 -0
- package/dist/types/discovery/cline.d.ts +1 -0
- package/dist/types/discovery/codex.d.ts +1 -0
- package/dist/types/discovery/cursor.d.ts +16 -0
- package/dist/types/discovery/gemini.d.ts +1 -0
- package/dist/types/discovery/github.d.ts +1 -0
- package/dist/types/discovery/helpers.d.ts +268 -0
- package/dist/types/discovery/index.d.ts +48 -0
- package/dist/types/discovery/mcp-json.d.ts +1 -0
- package/dist/types/discovery/opencode.d.ts +1 -0
- package/dist/types/discovery/plugin-dir-roots.d.ts +15 -0
- package/dist/types/discovery/ssh.d.ts +1 -0
- package/dist/types/discovery/substitute-plugin-root.d.ts +5 -0
- package/dist/types/discovery/vscode.d.ts +1 -0
- package/dist/types/discovery/windsurf.d.ts +13 -0
- package/dist/types/edit/apply-patch/index.d.ts +35 -0
- package/dist/types/edit/apply-patch/parser.d.ts +34 -0
- package/dist/types/edit/diff.d.ts +59 -0
- package/dist/types/edit/file-read-cache.d.ts +25 -0
- package/dist/types/edit/index.d.ts +58 -0
- package/dist/types/edit/modes/apply-patch.d.ts +24 -0
- package/dist/types/edit/modes/patch.d.ts +99 -0
- package/dist/types/edit/modes/replace.d.ts +142 -0
- package/dist/types/edit/normalize.d.ts +43 -0
- package/dist/types/edit/notebook.d.ts +23 -0
- package/dist/types/edit/read-file.d.ts +2 -0
- package/dist/types/edit/renderer.d.ts +110 -0
- package/dist/types/edit/streaming.d.ts +66 -0
- package/dist/types/eval/backend.d.ts +40 -0
- package/dist/types/eval/index.d.ts +4 -0
- package/dist/types/eval/js/context-manager.d.ts +24 -0
- package/dist/types/eval/js/executor.d.ts +28 -0
- package/dist/types/eval/js/index.d.ts +10 -0
- package/dist/types/eval/js/shared/helpers.d.ts +38 -0
- package/dist/types/eval/js/shared/indirect-eval.d.ts +14 -0
- package/dist/types/eval/js/shared/prelude.d.ts +1 -0
- package/dist/types/eval/js/shared/rewrite-imports.d.ts +6 -0
- package/dist/types/eval/js/shared/runtime.d.ts +47 -0
- package/dist/types/eval/js/shared/types.d.ts +24 -0
- package/dist/types/eval/js/tool-bridge.d.ts +18 -0
- package/dist/types/eval/js/worker-core.d.ts +5 -0
- package/dist/types/eval/js/worker-entry.d.ts +1 -0
- package/dist/types/eval/js/worker-protocol.d.ts +77 -0
- package/dist/types/eval/py/display.d.ts +25 -0
- package/dist/types/eval/py/executor.d.ts +83 -0
- package/dist/types/eval/py/index.d.ts +10 -0
- package/dist/types/eval/py/kernel.d.ts +61 -0
- package/dist/types/eval/py/prelude.d.ts +1 -0
- package/dist/types/eval/py/runtime.d.ts +21 -0
- package/dist/types/eval/py/tool-bridge.d.ts +20 -0
- package/dist/types/eval/types.d.ts +52 -0
- package/dist/types/exa/factory.d.ts +13 -0
- package/dist/types/exa/index.d.ts +20 -0
- package/dist/types/exa/mcp-client.d.ts +45 -0
- package/dist/types/exa/render.d.ts +19 -0
- package/dist/types/exa/researcher.d.ts +9 -0
- package/dist/types/exa/search.d.ts +9 -0
- package/dist/types/exa/types.d.ts +155 -0
- package/dist/types/exa/websets.d.ts +9 -0
- package/dist/types/exec/bash-executor.d.ts +41 -0
- package/dist/types/exec/exec.d.ts +25 -0
- package/dist/types/exec/idle-timeout-watchdog.d.ts +18 -0
- package/dist/types/exec/non-interactive-env.d.ts +1 -0
- package/dist/types/export/custom-share.d.ts +20 -0
- package/dist/types/export/html/index.d.ts +10 -0
- package/dist/types/export/html/template.generated.d.ts +1 -0
- package/dist/types/export/html/template.macro.d.ts +5 -0
- package/dist/types/export/ttsr.d.ts +44 -0
- package/dist/types/extensibility/custom-commands/bundled/ci-green/index.d.ts +9 -0
- package/dist/types/extensibility/custom-commands/bundled/review/index.d.ts +10 -0
- package/dist/types/extensibility/custom-commands/index.d.ts +2 -0
- package/dist/types/extensibility/custom-commands/loader.d.ts +29 -0
- package/dist/types/extensibility/custom-commands/types.d.ts +106 -0
- package/dist/types/extensibility/custom-tools/index.d.ts +6 -0
- package/dist/types/extensibility/custom-tools/loader.d.ts +69 -0
- package/dist/types/extensibility/custom-tools/types.d.ts +226 -0
- package/dist/types/extensibility/custom-tools/wrapper.d.ts +23 -0
- package/dist/types/extensibility/extensions/compact-handler.d.ts +26 -0
- package/dist/types/extensibility/extensions/get-commands-handler.d.ts +29 -0
- package/dist/types/extensibility/extensions/index.d.ts +8 -0
- package/dist/types/extensibility/extensions/loader.d.ts +43 -0
- package/dist/types/extensibility/extensions/runner.d.ts +134 -0
- package/dist/types/extensibility/extensions/types.d.ts +864 -0
- package/dist/types/extensibility/extensions/wrapper.d.ts +54 -0
- package/dist/types/extensibility/hooks/index.d.ts +5 -0
- package/dist/types/extensibility/hooks/loader.d.ts +89 -0
- package/dist/types/extensibility/hooks/runner.d.ts +126 -0
- package/dist/types/extensibility/hooks/tool-wrapper.d.ts +25 -0
- package/dist/types/extensibility/hooks/types.d.ts +431 -0
- package/dist/types/extensibility/plugins/doctor.d.ts +3 -0
- package/dist/types/extensibility/plugins/git-url.d.ts +34 -0
- package/dist/types/extensibility/plugins/index.d.ts +7 -0
- package/dist/types/extensibility/plugins/installer.d.ts +5 -0
- package/dist/types/extensibility/plugins/legacy-pi-compat.d.ts +2 -0
- package/dist/types/extensibility/plugins/loader.d.ts +31 -0
- package/dist/types/extensibility/plugins/manager.d.ts +65 -0
- package/dist/types/extensibility/plugins/marketplace/cache.d.ts +41 -0
- package/dist/types/extensibility/plugins/marketplace/fetcher.d.ts +48 -0
- package/dist/types/extensibility/plugins/marketplace/index.d.ts +6 -0
- package/dist/types/extensibility/plugins/marketplace/manager.d.ts +57 -0
- package/dist/types/extensibility/plugins/marketplace/registry.d.ts +34 -0
- package/dist/types/extensibility/plugins/marketplace/source-resolver.d.ts +28 -0
- package/dist/types/extensibility/plugins/marketplace/types.d.ts +130 -0
- package/dist/types/extensibility/plugins/parser.d.ts +52 -0
- package/dist/types/extensibility/plugins/types.d.ts +149 -0
- package/dist/types/extensibility/shared-events.d.ts +279 -0
- package/dist/types/extensibility/skills.d.ts +74 -0
- package/dist/types/extensibility/slash-commands.d.ts +48 -0
- package/dist/types/extensibility/tool-proxy.d.ts +4 -0
- package/dist/types/extensibility/typebox.d.ts +155 -0
- package/dist/types/extensibility/utils.d.ts +12 -0
- package/dist/types/gjc-runtime/goal-mode-request.d.ts +46 -0
- package/dist/types/gjc-runtime/launch-tmux.d.ts +45 -0
- package/dist/types/gjc-runtime/launch-worktree.d.ts +46 -0
- package/dist/types/gjc-runtime/team-runtime.d.ts +204 -0
- package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +85 -0
- package/dist/types/goals/index.d.ts +3 -0
- package/dist/types/goals/runtime.d.ts +68 -0
- package/dist/types/goals/state.d.ts +35 -0
- package/dist/types/goals/tools/goal-tool.d.ts +128 -0
- package/dist/types/hashline/anchors.d.ts +20 -0
- package/dist/types/hashline/apply.d.ts +14 -0
- package/dist/types/hashline/constants.d.ts +19 -0
- package/dist/types/hashline/diff-preview.d.ts +2 -0
- package/dist/types/hashline/diff.d.ts +17 -0
- package/dist/types/hashline/execute.d.ts +4 -0
- package/dist/types/hashline/hash.d.ts +123 -0
- package/dist/types/hashline/index.d.ts +13 -0
- package/dist/types/hashline/input.d.ts +11 -0
- package/dist/types/hashline/parser.d.ts +7 -0
- package/dist/types/hashline/prefixes.d.ts +7 -0
- package/dist/types/hashline/recovery.d.ts +27 -0
- package/dist/types/hashline/stream.d.ts +2 -0
- package/dist/types/hashline/types.d.ts +77 -0
- package/dist/types/hindsight/backend.d.ts +13 -0
- package/dist/types/hindsight/bank.d.ts +54 -0
- package/dist/types/hindsight/client.d.ts +224 -0
- package/dist/types/hindsight/config.d.ts +51 -0
- package/dist/types/hindsight/content.d.ts +70 -0
- package/dist/types/hindsight/index.d.ts +8 -0
- package/dist/types/hindsight/mental-models.d.ts +125 -0
- package/dist/types/hindsight/state.d.ts +99 -0
- package/dist/types/hindsight/transcript.d.ts +28 -0
- package/dist/types/hooks/codex-native-hooks-config.d.ts +29 -0
- package/dist/types/hooks/native-skill-hook.d.ts +16 -0
- package/dist/types/hooks/skill-keywords.d.ts +17 -0
- package/dist/types/hooks/skill-state.d.ts +80 -0
- package/dist/types/index.d.ts +33 -0
- package/dist/types/internal-urls/agent-protocol.d.ts +12 -0
- package/dist/types/internal-urls/artifact-protocol.d.ts +6 -0
- package/dist/types/internal-urls/docs-index.generated.d.ts +2 -0
- package/dist/types/internal-urls/gjc-protocol.d.ts +12 -0
- package/dist/types/internal-urls/index.d.ts +20 -0
- package/dist/types/internal-urls/issue-pr-protocol.d.ts +17 -0
- package/dist/types/internal-urls/json-query.d.ts +30 -0
- package/dist/types/internal-urls/local-protocol.d.ts +39 -0
- package/dist/types/internal-urls/mcp-protocol.d.ts +12 -0
- package/dist/types/internal-urls/memory-protocol.d.ts +23 -0
- package/dist/types/internal-urls/parse.d.ts +19 -0
- package/dist/types/internal-urls/registry-helpers.d.ts +10 -0
- package/dist/types/internal-urls/router.d.ts +14 -0
- package/dist/types/internal-urls/rule-protocol.d.ts +6 -0
- package/dist/types/internal-urls/skill-protocol.d.ts +13 -0
- package/dist/types/internal-urls/types.d.ts +105 -0
- package/dist/types/lsp/client.d.ts +65 -0
- package/dist/types/lsp/clients/biome-client.d.ts +16 -0
- package/dist/types/lsp/clients/index.d.ts +19 -0
- package/dist/types/lsp/clients/lsp-linter-client.d.ts +16 -0
- package/dist/types/lsp/clients/swiftlint-client.d.ts +20 -0
- package/dist/types/lsp/config.d.ts +65 -0
- package/dist/types/lsp/edits.d.ts +23 -0
- package/dist/types/lsp/index.d.ts +130 -0
- package/dist/types/lsp/lspmux.d.ts +58 -0
- package/dist/types/lsp/render.d.ts +32 -0
- package/dist/types/lsp/startup-events.d.ts +11 -0
- package/dist/types/lsp/types.d.ts +302 -0
- package/dist/types/lsp/utils.d.ts +108 -0
- package/dist/types/main.d.ts +50 -0
- package/dist/types/memories/index.d.ts +28 -0
- package/dist/types/memories/storage.d.ts +110 -0
- package/dist/types/memory-backend/index.d.ts +4 -0
- package/dist/types/memory-backend/local-backend.d.ts +9 -0
- package/dist/types/memory-backend/off-backend.d.ts +7 -0
- package/dist/types/memory-backend/resolve.d.ts +15 -0
- package/dist/types/memory-backend/types.d.ts +61 -0
- package/dist/types/modes/acp/acp-agent.d.ts +61 -0
- package/dist/types/modes/acp/acp-client-bridge.d.ts +9 -0
- package/dist/types/modes/acp/acp-event-mapper.d.ts +32 -0
- package/dist/types/modes/acp/acp-mode.d.ts +5 -0
- package/dist/types/modes/acp/index.d.ts +2 -0
- package/dist/types/modes/acp/terminal-auth.d.ts +6 -0
- package/dist/types/modes/components/agent-dashboard.d.ts +21 -0
- package/dist/types/modes/components/assistant-message.d.ts +16 -0
- package/dist/types/modes/components/bash-execution.d.ts +29 -0
- package/dist/types/modes/components/bordered-loader.d.ts +11 -0
- package/dist/types/modes/components/branch-summary-message.d.ts +13 -0
- package/dist/types/modes/components/btw-panel.d.ts +16 -0
- package/dist/types/modes/components/compaction-summary-message.d.ts +13 -0
- package/dist/types/modes/components/countdown-timer.d.ts +14 -0
- package/dist/types/modes/components/custom-editor.d.ts +47 -0
- package/dist/types/modes/components/custom-message.d.ts +15 -0
- package/dist/types/modes/components/diff.d.ts +11 -0
- package/dist/types/modes/components/dynamic-border.d.ts +14 -0
- package/dist/types/modes/components/eval-execution.d.ts +23 -0
- package/dist/types/modes/components/execution-shared.d.ts +46 -0
- package/dist/types/modes/components/extensions/extension-dashboard.d.ts +26 -0
- package/dist/types/modes/components/extensions/extension-list.d.ts +39 -0
- package/dist/types/modes/components/extensions/index.d.ts +8 -0
- package/dist/types/modes/components/extensions/inspector-panel.d.ts +8 -0
- package/dist/types/modes/components/extensions/state-manager.d.ts +50 -0
- package/dist/types/modes/components/extensions/types.d.ts +151 -0
- package/dist/types/modes/components/footer.d.ts +30 -0
- package/dist/types/modes/components/history-search.d.ts +7 -0
- package/dist/types/modes/components/hook-editor.d.ts +18 -0
- package/dist/types/modes/components/hook-input.d.ts +15 -0
- package/dist/types/modes/components/hook-message.d.ts +15 -0
- package/dist/types/modes/components/hook-selector.d.ts +23 -0
- package/dist/types/modes/components/index.d.ts +35 -0
- package/dist/types/modes/components/keybinding-hints.d.ts +40 -0
- package/dist/types/modes/components/login-dialog.d.ts +32 -0
- package/dist/types/modes/components/message-frame.d.ts +42 -0
- package/dist/types/modes/components/model-selector.d.ts +26 -0
- package/dist/types/modes/components/oauth-selector.d.ts +14 -0
- package/dist/types/modes/components/plugin-selector.d.ts +26 -0
- package/dist/types/modes/components/plugin-settings.d.ts +66 -0
- package/dist/types/modes/components/provider-onboarding-selector.d.ts +7 -0
- package/dist/types/modes/components/queue-mode-selector.d.ts +9 -0
- package/dist/types/modes/components/read-tool-group.d.ts +30 -0
- package/dist/types/modes/components/runtime-mcp-add-wizard.d.ts +25 -0
- package/dist/types/modes/components/session-observer-overlay.d.ts +11 -0
- package/dist/types/modes/components/session-selector.d.ts +30 -0
- package/dist/types/modes/components/settings-defs.d.ts +50 -0
- package/dist/types/modes/components/settings-selector.d.ts +54 -0
- package/dist/types/modes/components/show-images-selector.d.ts +9 -0
- package/dist/types/modes/components/skill-hud/render.d.ts +2 -0
- package/dist/types/modes/components/skill-message.d.ts +9 -0
- package/dist/types/modes/components/status-line/context-thresholds.d.ts +4 -0
- package/dist/types/modes/components/status-line/git-utils.d.ts +22 -0
- package/dist/types/modes/components/status-line/index.d.ts +4 -0
- package/dist/types/modes/components/status-line/presets.d.ts +3 -0
- package/dist/types/modes/components/status-line/segments.d.ts +5 -0
- package/dist/types/modes/components/status-line/separators.d.ts +3 -0
- package/dist/types/modes/components/status-line/token-rate.d.ts +10 -0
- package/dist/types/modes/components/status-line/types.d.ts +80 -0
- package/dist/types/modes/components/status-line.d.ts +80 -0
- package/dist/types/modes/components/theme-selector.d.ts +10 -0
- package/dist/types/modes/components/thinking-selector.d.ts +10 -0
- package/dist/types/modes/components/todo-reminder.d.ts +13 -0
- package/dist/types/modes/components/tool-execution.d.ts +53 -0
- package/dist/types/modes/components/tree-selector.d.ts +31 -0
- package/dist/types/modes/components/ttsr-notification.d.ts +13 -0
- package/dist/types/modes/components/user-message-selector.d.ts +28 -0
- package/dist/types/modes/components/user-message.d.ts +7 -0
- package/dist/types/modes/components/visual-truncate.d.ts +19 -0
- package/dist/types/modes/components/welcome.d.ts +34 -0
- package/dist/types/modes/controllers/btw-controller.d.ts +10 -0
- package/dist/types/modes/controllers/command-controller-shared.d.ts +47 -0
- package/dist/types/modes/controllers/command-controller.d.ts +36 -0
- package/dist/types/modes/controllers/event-controller.d.ts +12 -0
- package/dist/types/modes/controllers/extension-ui-controller.d.ts +80 -0
- package/dist/types/modes/controllers/input-controller.d.ts +35 -0
- package/dist/types/modes/controllers/runtime-mcp-command-controller.d.ts +10 -0
- package/dist/types/modes/controllers/selector-controller.d.ts +46 -0
- package/dist/types/modes/controllers/ssh-command-controller.d.ts +10 -0
- package/dist/types/modes/controllers/todo-command-controller.d.ts +7 -0
- package/dist/types/modes/emoji-autocomplete.d.ts +16 -0
- package/dist/types/modes/index.d.ts +9 -0
- package/dist/types/modes/interactive-mode.d.ts +271 -0
- package/dist/types/modes/loop-limit.d.ts +22 -0
- package/dist/types/modes/oauth-manual-input.d.ts +8 -0
- package/dist/types/modes/print-mode.d.ts +27 -0
- package/dist/types/modes/prompt-action-autocomplete.d.ts +46 -0
- package/dist/types/modes/rpc/host-tools.d.ts +16 -0
- package/dist/types/modes/rpc/host-uris.d.ts +38 -0
- package/dist/types/modes/rpc/rpc-client.d.ts +249 -0
- package/dist/types/modes/rpc/rpc-mode.d.ts +17 -0
- package/dist/types/modes/rpc/rpc-types.d.ts +586 -0
- package/dist/types/modes/runtime-init.d.ts +21 -0
- package/dist/types/modes/session-observer-registry.d.ts +26 -0
- package/dist/types/modes/shared.d.ts +15 -0
- package/dist/types/modes/theme/defaults/index.d.ts +9559 -0
- package/dist/types/modes/theme/mermaid-cache.d.ts +9 -0
- package/dist/types/modes/theme/shimmer.d.ts +38 -0
- package/dist/types/modes/theme/theme.d.ts +273 -0
- package/dist/types/modes/types.d.ts +278 -0
- package/dist/types/modes/utils/context-usage.d.ts +47 -0
- package/dist/types/modes/utils/hotkeys-markdown.d.ts +5 -0
- package/dist/types/modes/utils/keybinding-matchers.d.ts +10 -0
- package/dist/types/modes/utils/tools-markdown.d.ts +5 -0
- package/dist/types/modes/utils/ui-helpers.d.ts +53 -0
- package/dist/types/plan-mode/approved-plan.d.ts +49 -0
- package/dist/types/plan-mode/state.d.ts +6 -0
- package/dist/types/registry/agent-registry.d.ts +62 -0
- package/dist/types/runtime-mcp/client.d.ts +74 -0
- package/dist/types/runtime-mcp/config-writer.d.ts +53 -0
- package/dist/types/runtime-mcp/config.d.ts +75 -0
- package/dist/types/runtime-mcp/discoverable-tool-metadata.d.ts +7 -0
- package/dist/types/runtime-mcp/index.d.ts +18 -0
- package/dist/types/runtime-mcp/json-rpc.d.ts +22 -0
- package/dist/types/runtime-mcp/loader.d.ts +43 -0
- package/dist/types/runtime-mcp/manager.d.ts +193 -0
- package/dist/types/runtime-mcp/oauth-discovery.d.ts +40 -0
- package/dist/types/runtime-mcp/oauth-flow.d.ts +59 -0
- package/dist/types/runtime-mcp/render.d.ts +25 -0
- package/dist/types/runtime-mcp/smithery-auth.d.ts +16 -0
- package/dist/types/runtime-mcp/smithery-connect.d.ts +38 -0
- package/dist/types/runtime-mcp/smithery-registry.d.ts +51 -0
- package/dist/types/runtime-mcp/tool-bridge.d.ts +86 -0
- package/dist/types/runtime-mcp/tool-cache.d.ts +8 -0
- package/dist/types/runtime-mcp/transports/http.d.ts +36 -0
- package/dist/types/runtime-mcp/transports/index.d.ts +5 -0
- package/dist/types/runtime-mcp/transports/stdio.d.ts +32 -0
- package/dist/types/runtime-mcp/types.d.ts +333 -0
- package/dist/types/sdk.d.ts +216 -0
- package/dist/types/secrets/index.d.ts +9 -0
- package/dist/types/secrets/obfuscator.d.ts +23 -0
- package/dist/types/secrets/regex.d.ts +2 -0
- package/dist/types/session/agent-session.d.ts +930 -0
- package/dist/types/session/agent-storage.d.ts +100 -0
- package/dist/types/session/artifacts.d.ts +61 -0
- package/dist/types/session/auth-broker-config.d.ts +13 -0
- package/dist/types/session/auth-storage.d.ts +6 -0
- package/dist/types/session/blob-store.d.ts +63 -0
- package/dist/types/session/client-bridge.d.ts +88 -0
- package/dist/types/session/history-storage.d.ts +16 -0
- package/dist/types/session/messages.d.ts +162 -0
- package/dist/types/session/session-dump-format.d.ts +22 -0
- package/dist/types/session/session-manager.d.ts +549 -0
- package/dist/types/session/session-storage.d.ts +82 -0
- package/dist/types/session/streaming-output.d.ts +185 -0
- package/dist/types/session/tool-choice-queue.d.ts +78 -0
- package/dist/types/session/yield-queue.d.ts +24 -0
- package/dist/types/setup/model-onboarding-guidance.d.ts +8 -0
- package/dist/types/setup/provider-onboarding.d.ts +28 -0
- package/dist/types/skill-state/active-state.d.ts +50 -0
- package/dist/types/slash-commands/acp-builtins.d.ts +18 -0
- package/dist/types/slash-commands/builtin-registry.d.ts +23 -0
- package/dist/types/slash-commands/helpers/context-report.d.ts +7 -0
- package/dist/types/slash-commands/helpers/format.d.ts +10 -0
- package/dist/types/slash-commands/helpers/mcp.d.ts +3 -0
- package/dist/types/slash-commands/helpers/parse.d.ts +33 -0
- package/dist/types/slash-commands/helpers/ssh.d.ts +3 -0
- package/dist/types/slash-commands/helpers/todo.d.ts +3 -0
- package/dist/types/slash-commands/helpers/usage-report.d.ts +7 -0
- package/dist/types/slash-commands/types.d.ts +118 -0
- package/dist/types/ssh/config-writer.d.ts +49 -0
- package/dist/types/ssh/connection-manager.d.ts +33 -0
- package/dist/types/ssh/ssh-executor.d.ts +37 -0
- package/dist/types/ssh/sshfs-mount.d.ts +6 -0
- package/dist/types/ssh/utils.d.ts +2 -0
- package/dist/types/stt/downloader.d.ts +9 -0
- package/dist/types/stt/index.d.ts +3 -0
- package/dist/types/stt/recorder.d.ts +13 -0
- package/dist/types/stt/setup.d.ts +18 -0
- package/dist/types/stt/stt-controller.d.ts +16 -0
- package/dist/types/stt/transcriber.d.ts +16 -0
- package/dist/types/system-prompt.d.ts +93 -0
- package/dist/types/task/agents.d.ts +28 -0
- package/dist/types/task/commands.d.ts +35 -0
- package/dist/types/task/discovery.d.ts +19 -0
- package/dist/types/task/executor.d.ts +106 -0
- package/dist/types/task/gjc-command.d.ts +7 -0
- package/dist/types/task/index.d.ts +38 -0
- package/dist/types/task/name-generator.d.ts +16 -0
- package/dist/types/task/output-manager.d.ts +36 -0
- package/dist/types/task/parallel.d.ts +34 -0
- package/dist/types/task/render.d.ts +22 -0
- package/dist/types/task/simple-mode.d.ts +8 -0
- package/dist/types/task/subprocess-tool-registry.d.ts +72 -0
- package/dist/types/task/types.d.ts +295 -0
- package/dist/types/task/worktree.d.ts +94 -0
- package/dist/types/thinking.d.ts +30 -0
- package/dist/types/tool-discovery/tool-index.d.ts +112 -0
- package/dist/types/tools/archive-reader.d.ts +40 -0
- package/dist/types/tools/ask.d.ts +109 -0
- package/dist/types/tools/ast-edit.d.ts +77 -0
- package/dist/types/tools/ast-grep.d.ts +69 -0
- package/dist/types/tools/auto-generated-guard.d.ts +17 -0
- package/dist/types/tools/bash-command-fixup.d.ts +11 -0
- package/dist/types/tools/bash-interactive.d.ts +16 -0
- package/dist/types/tools/bash-interceptor.d.ts +24 -0
- package/dist/types/tools/bash-pty-selection.d.ts +7 -0
- package/dist/types/tools/bash-skill-urls.d.ts +31 -0
- package/dist/types/tools/bash.d.ts +130 -0
- package/dist/types/tools/browser/attach.d.ts +34 -0
- package/dist/types/tools/browser/launch.d.ts +62 -0
- package/dist/types/tools/browser/readable.d.ts +17 -0
- package/dist/types/tools/browser/registry.d.ts +42 -0
- package/dist/types/tools/browser/render.d.ts +50 -0
- package/dist/types/tools/browser/tab-protocol.d.ts +144 -0
- package/dist/types/tools/browser/tab-supervisor.d.ts +63 -0
- package/dist/types/tools/browser/tab-worker-entry.d.ts +1 -0
- package/dist/types/tools/browser/tab-worker.d.ts +19 -0
- package/dist/types/tools/browser.d.ts +114 -0
- package/dist/types/tools/calculator.d.ts +76 -0
- package/dist/types/tools/checkpoint.d.ts +63 -0
- package/dist/types/tools/conflict-detect.d.ts +205 -0
- package/dist/types/tools/context.d.ts +19 -0
- package/dist/types/tools/debug.d.ts +209 -0
- package/dist/types/tools/eval.d.ts +108 -0
- package/dist/types/tools/fetch.d.ts +61 -0
- package/dist/types/tools/file-recorder.d.ts +13 -0
- package/dist/types/tools/find.d.ts +95 -0
- package/dist/types/tools/fs-cache-invalidation.d.ts +15 -0
- package/dist/types/tools/gh-format.d.ts +6 -0
- package/dist/types/tools/gh-renderer.d.ts +25 -0
- package/dist/types/tools/gh.d.ts +356 -0
- package/dist/types/tools/github-cache.d.ts +103 -0
- package/dist/types/tools/grouped-file-output.d.ts +36 -0
- package/dist/types/tools/hindsight-recall.d.ts +23 -0
- package/dist/types/tools/hindsight-reflect.d.ts +25 -0
- package/dist/types/tools/hindsight-retain.d.ts +29 -0
- package/dist/types/tools/image-gen.d.ts +78 -0
- package/dist/types/tools/index.d.ts +242 -0
- package/dist/types/tools/inspect-image-renderer.d.ts +26 -0
- package/dist/types/tools/inspect-image.d.ts +31 -0
- package/dist/types/tools/irc.d.ts +79 -0
- package/dist/types/tools/job.d.ts +65 -0
- package/dist/types/tools/json-tree.d.ts +23 -0
- package/dist/types/tools/jtd-to-json-schema.d.ts +29 -0
- package/dist/types/tools/jtd-to-typescript.d.ts +26 -0
- package/dist/types/tools/jtd-utils.d.ts +42 -0
- package/dist/types/tools/list-limit.d.ts +12 -0
- package/dist/types/tools/match-line-format.d.ts +11 -0
- package/dist/types/tools/output-meta.d.ts +204 -0
- package/dist/types/tools/path-utils.d.ts +146 -0
- package/dist/types/tools/plan-mode-guard.d.ts +18 -0
- package/dist/types/tools/read.d.ts +85 -0
- package/dist/types/tools/recipe/index.d.ts +45 -0
- package/dist/types/tools/recipe/render.d.ts +36 -0
- package/dist/types/tools/recipe/runner.d.ts +60 -0
- package/dist/types/tools/recipe/runners/cargo.d.ts +16 -0
- package/dist/types/tools/recipe/runners/index.d.ts +2 -0
- package/dist/types/tools/recipe/runners/just.d.ts +2 -0
- package/dist/types/tools/recipe/runners/make.d.ts +2 -0
- package/dist/types/tools/recipe/runners/pkg.d.ts +2 -0
- package/dist/types/tools/recipe/runners/task.d.ts +2 -0
- package/dist/types/tools/render-mermaid.d.ts +37 -0
- package/dist/types/tools/render-utils.d.ts +158 -0
- package/dist/types/tools/renderers.d.ts +26 -0
- package/dist/types/tools/resolve.d.ts +90 -0
- package/dist/types/tools/review.d.ts +63 -0
- package/dist/types/tools/search-tool-bm25.d.ts +65 -0
- package/dist/types/tools/search.d.ts +93 -0
- package/dist/types/tools/sqlite-reader.d.ts +93 -0
- package/dist/types/tools/ssh.d.ts +67 -0
- package/dist/types/tools/subagent.d.ts +58 -0
- package/dist/types/tools/todo-write.d.ts +120 -0
- package/dist/types/tools/tool-errors.d.ts +33 -0
- package/dist/types/tools/tool-result.d.ts +30 -0
- package/dist/types/tools/tool-timeouts.d.ts +51 -0
- package/dist/types/tools/vim.d.ts +58 -0
- package/dist/types/tools/write.d.ts +59 -0
- package/dist/types/tools/yield.d.ts +25 -0
- package/dist/types/tui/code-cell.d.ts +32 -0
- package/dist/types/tui/file-list.d.ts +22 -0
- package/dist/types/tui/hyperlink.d.ts +42 -0
- package/dist/types/tui/index.d.ts +11 -0
- package/dist/types/tui/output-block.d.ts +28 -0
- package/dist/types/tui/status-line.d.ts +18 -0
- package/dist/types/tui/tree-list.d.ts +19 -0
- package/dist/types/tui/types.d.ts +13 -0
- package/dist/types/tui/utils.d.ts +36 -0
- package/dist/types/utils/changelog.d.ts +20 -0
- package/dist/types/utils/clipboard.d.ts +22 -0
- package/dist/types/utils/command-args.d.ts +9 -0
- package/dist/types/utils/commit-message-generator.d.ts +7 -0
- package/dist/types/utils/edit-mode.d.ts +13 -0
- package/dist/types/utils/event-bus.d.ts +6 -0
- package/dist/types/utils/external-editor.d.ts +17 -0
- package/dist/types/utils/file-display-mode.d.ts +27 -0
- package/dist/types/utils/file-mentions.d.ts +11 -0
- package/dist/types/utils/git.d.ts +361 -0
- package/dist/types/utils/image-loading.d.ts +26 -0
- package/dist/types/utils/image-resize.d.ts +39 -0
- package/dist/types/utils/lang-from-path.d.ts +8 -0
- package/dist/types/utils/markit.d.ts +7 -0
- package/dist/types/utils/open.d.ts +2 -0
- package/dist/types/utils/session-color.d.ts +10 -0
- package/dist/types/utils/shell-snapshot.d.ts +5 -0
- package/dist/types/utils/sixel.d.ts +21 -0
- package/dist/types/utils/title-generator.d.ts +31 -0
- package/dist/types/utils/tool-choice.d.ts +7 -0
- package/dist/types/utils/tools-manager.d.ts +9 -0
- package/dist/types/vim/buffer.d.ts +41 -0
- package/dist/types/vim/commands.d.ts +6 -0
- package/dist/types/vim/engine.d.ts +47 -0
- package/dist/types/vim/parser.d.ts +3 -0
- package/dist/types/vim/render.d.ts +25 -0
- package/dist/types/vim/types.d.ts +182 -0
- package/dist/types/web/kagi.d.ts +23 -0
- package/dist/types/web/parallel.d.ts +58 -0
- package/dist/types/web/scrapers/artifacthub.d.ts +6 -0
- package/dist/types/web/scrapers/arxiv.d.ts +5 -0
- package/dist/types/web/scrapers/aur.d.ts +5 -0
- package/dist/types/web/scrapers/biorxiv.d.ts +5 -0
- package/dist/types/web/scrapers/bluesky.d.ts +5 -0
- package/dist/types/web/scrapers/brew.d.ts +5 -0
- package/dist/types/web/scrapers/cheatsh.d.ts +8 -0
- package/dist/types/web/scrapers/chocolatey.d.ts +5 -0
- package/dist/types/web/scrapers/choosealicense.d.ts +2 -0
- package/dist/types/web/scrapers/cisa-kev.d.ts +5 -0
- package/dist/types/web/scrapers/clojars.d.ts +5 -0
- package/dist/types/web/scrapers/coingecko.d.ts +5 -0
- package/dist/types/web/scrapers/crates-io.d.ts +5 -0
- package/dist/types/web/scrapers/crossref.d.ts +2 -0
- package/dist/types/web/scrapers/devto.d.ts +5 -0
- package/dist/types/web/scrapers/discogs.d.ts +8 -0
- package/dist/types/web/scrapers/discourse.d.ts +5 -0
- package/dist/types/web/scrapers/dockerhub.d.ts +5 -0
- package/dist/types/web/scrapers/docs-rs.d.ts +2 -0
- package/dist/types/web/scrapers/fdroid.d.ts +5 -0
- package/dist/types/web/scrapers/firefox-addons.d.ts +2 -0
- package/dist/types/web/scrapers/flathub.d.ts +2 -0
- package/dist/types/web/scrapers/github-gist.d.ts +5 -0
- package/dist/types/web/scrapers/github.d.ts +12 -0
- package/dist/types/web/scrapers/gitlab.d.ts +5 -0
- package/dist/types/web/scrapers/go-pkg.d.ts +5 -0
- package/dist/types/web/scrapers/hackage.d.ts +5 -0
- package/dist/types/web/scrapers/hackernews.d.ts +2 -0
- package/dist/types/web/scrapers/hex.d.ts +5 -0
- package/dist/types/web/scrapers/huggingface.d.ts +2 -0
- package/dist/types/web/scrapers/iacr.d.ts +5 -0
- package/dist/types/web/scrapers/index.d.ts +84 -0
- package/dist/types/web/scrapers/jetbrains-marketplace.d.ts +2 -0
- package/dist/types/web/scrapers/lemmy.d.ts +2 -0
- package/dist/types/web/scrapers/lobsters.d.ts +5 -0
- package/dist/types/web/scrapers/mastodon.d.ts +5 -0
- package/dist/types/web/scrapers/maven.d.ts +6 -0
- package/dist/types/web/scrapers/mdn.d.ts +2 -0
- package/dist/types/web/scrapers/metacpan.d.ts +5 -0
- package/dist/types/web/scrapers/musicbrainz.d.ts +5 -0
- package/dist/types/web/scrapers/npm.d.ts +5 -0
- package/dist/types/web/scrapers/nuget.d.ts +5 -0
- package/dist/types/web/scrapers/nvd.d.ts +5 -0
- package/dist/types/web/scrapers/ollama.d.ts +2 -0
- package/dist/types/web/scrapers/open-vsx.d.ts +5 -0
- package/dist/types/web/scrapers/opencorporates.d.ts +5 -0
- package/dist/types/web/scrapers/openlibrary.d.ts +5 -0
- package/dist/types/web/scrapers/orcid.d.ts +5 -0
- package/dist/types/web/scrapers/osv.d.ts +5 -0
- package/dist/types/web/scrapers/packagist.d.ts +5 -0
- package/dist/types/web/scrapers/pub-dev.d.ts +5 -0
- package/dist/types/web/scrapers/pubmed.d.ts +5 -0
- package/dist/types/web/scrapers/pypi.d.ts +5 -0
- package/dist/types/web/scrapers/rawg.d.ts +2 -0
- package/dist/types/web/scrapers/readthedocs.d.ts +2 -0
- package/dist/types/web/scrapers/reddit.d.ts +5 -0
- package/dist/types/web/scrapers/repology.d.ts +5 -0
- package/dist/types/web/scrapers/rfc.d.ts +5 -0
- package/dist/types/web/scrapers/rubygems.d.ts +5 -0
- package/dist/types/web/scrapers/searchcode.d.ts +2 -0
- package/dist/types/web/scrapers/sec-edgar.d.ts +5 -0
- package/dist/types/web/scrapers/semantic-scholar.d.ts +2 -0
- package/dist/types/web/scrapers/snapcraft.d.ts +2 -0
- package/dist/types/web/scrapers/sourcegraph.d.ts +2 -0
- package/dist/types/web/scrapers/spdx.d.ts +5 -0
- package/dist/types/web/scrapers/spotify.d.ts +8 -0
- package/dist/types/web/scrapers/stackoverflow.d.ts +6 -0
- package/dist/types/web/scrapers/terraform.d.ts +5 -0
- package/dist/types/web/scrapers/tldr.d.ts +7 -0
- package/dist/types/web/scrapers/twitter.d.ts +5 -0
- package/dist/types/web/scrapers/types.d.ts +78 -0
- package/dist/types/web/scrapers/utils.d.ts +26 -0
- package/dist/types/web/scrapers/vimeo.d.ts +5 -0
- package/dist/types/web/scrapers/vscode-marketplace.d.ts +5 -0
- package/dist/types/web/scrapers/w3c.d.ts +2 -0
- package/dist/types/web/scrapers/wikidata.d.ts +5 -0
- package/dist/types/web/scrapers/wikipedia.d.ts +5 -0
- package/dist/types/web/scrapers/youtube.d.ts +5 -0
- package/dist/types/web/search/index.d.ts +84 -0
- package/dist/types/web/search/provider.d.ts +21 -0
- package/dist/types/web/search/providers/anthropic.d.ts +32 -0
- package/dist/types/web/search/providers/base.d.ts +67 -0
- package/dist/types/web/search/providers/brave.d.ts +27 -0
- package/dist/types/web/search/providers/codex.d.ts +35 -0
- package/dist/types/web/search/providers/exa.d.ts +52 -0
- package/dist/types/web/search/providers/gemini.d.ts +57 -0
- package/dist/types/web/search/providers/jina.d.ts +26 -0
- package/dist/types/web/search/providers/kagi.d.ts +24 -0
- package/dist/types/web/search/providers/kimi.d.ts +27 -0
- package/dist/types/web/search/providers/parallel.d.ts +15 -0
- package/dist/types/web/search/providers/perplexity.d.ts +38 -0
- package/dist/types/web/search/providers/searxng.d.ts +44 -0
- package/dist/types/web/search/providers/synthetic.d.ts +21 -0
- package/dist/types/web/search/providers/tavily.d.ts +29 -0
- package/dist/types/web/search/providers/utils.d.ts +52 -0
- package/dist/types/web/search/providers/zai.d.ts +28 -0
- package/dist/types/web/search/render.d.ts +35 -0
- package/dist/types/web/search/types.d.ts +344 -0
- package/dist/types/web/search/utils.d.ts +4 -0
- package/dist/types/workspace-tree.d.ts +42 -0
- package/examples/README.md +21 -0
- package/examples/custom-tools/README.md +104 -0
- package/examples/custom-tools/hello/index.ts +20 -0
- package/examples/extensions/README.md +141 -0
- package/examples/extensions/api-demo.ts +79 -0
- package/examples/extensions/chalk-logger.ts +25 -0
- package/examples/extensions/hello.ts +31 -0
- package/examples/extensions/pirate.ts +43 -0
- package/examples/extensions/plan-mode.ts +549 -0
- package/examples/extensions/reload-runtime.ts +38 -0
- package/examples/extensions/tools.ts +144 -0
- package/examples/extensions/with-deps/index.ts +36 -0
- package/examples/extensions/with-deps/package-lock.json +31 -0
- package/examples/extensions/with-deps/package.json +16 -0
- package/examples/hooks/README.md +56 -0
- package/examples/hooks/auto-commit-on-exit.ts +48 -0
- package/examples/hooks/confirm-destructive.ts +58 -0
- package/examples/hooks/custom-compaction.ts +115 -0
- package/examples/hooks/dirty-repo-guard.ts +51 -0
- package/examples/hooks/file-trigger.ts +40 -0
- package/examples/hooks/git-checkpoint.ts +52 -0
- package/examples/hooks/handoff.ts +149 -0
- package/examples/hooks/permission-gate.ts +33 -0
- package/examples/hooks/protected-paths.ts +29 -0
- package/examples/hooks/qna.ts +118 -0
- package/examples/hooks/status-line.ts +39 -0
- package/examples/sdk/01-minimal.ts +21 -0
- package/examples/sdk/02-custom-model.ts +49 -0
- package/examples/sdk/03-custom-prompt.ts +46 -0
- package/examples/sdk/04-skills.ts +43 -0
- package/examples/sdk/06-extensions.ts +82 -0
- package/examples/sdk/06-hooks.ts +61 -0
- package/examples/sdk/07-context-files.ts +35 -0
- package/examples/sdk/08-prompt-templates.ts +41 -0
- package/examples/sdk/08-slash-commands.ts +46 -0
- package/examples/sdk/09-api-keys-and-oauth.ts +54 -0
- package/examples/sdk/11-sessions.ts +47 -0
- package/examples/sdk/README.md +172 -0
- package/package.json +533 -0
- package/scripts/build-binary.ts +77 -0
- package/scripts/format-prompts.ts +68 -0
- package/scripts/generate-docs-index.ts +71 -0
- package/scripts/generate-template.ts +33 -0
- package/src/async/index.ts +2 -0
- package/src/async/job-manager.ts +586 -0
- package/src/async/support.ts +6 -0
- package/src/autoresearch/command-resume.md +14 -0
- package/src/autoresearch/dashboard.ts +446 -0
- package/src/autoresearch/git.ts +319 -0
- package/src/autoresearch/helpers.ts +218 -0
- package/src/autoresearch/index.ts +536 -0
- package/src/autoresearch/prompt-setup.md +43 -0
- package/src/autoresearch/prompt.md +103 -0
- package/src/autoresearch/resume-message.md +10 -0
- package/src/autoresearch/state.ts +273 -0
- package/src/autoresearch/storage.ts +699 -0
- package/src/autoresearch/tools/init-experiment.ts +272 -0
- package/src/autoresearch/tools/log-experiment.ts +524 -0
- package/src/autoresearch/tools/run-experiment.ts +475 -0
- package/src/autoresearch/tools/update-notes.ts +109 -0
- package/src/autoresearch/types.ts +168 -0
- package/src/bun-imports.d.ts +28 -0
- package/src/capability/context-file.ts +44 -0
- package/src/capability/extension-module.ts +34 -0
- package/src/capability/extension.ts +47 -0
- package/src/capability/fs.ts +107 -0
- package/src/capability/hook.ts +40 -0
- package/src/capability/index.ts +436 -0
- package/src/capability/instruction.ts +37 -0
- package/src/capability/mcp.ts +74 -0
- package/src/capability/prompt.ts +35 -0
- package/src/capability/rule.ts +244 -0
- package/src/capability/settings.ts +34 -0
- package/src/capability/skill.ts +56 -0
- package/src/capability/slash-command.ts +40 -0
- package/src/capability/ssh.ts +41 -0
- package/src/capability/system-prompt.ts +34 -0
- package/src/capability/tool.ts +38 -0
- package/src/capability/types.ts +168 -0
- package/src/cli/agents-cli.ts +138 -0
- package/src/cli/args.ts +269 -0
- package/src/cli/auth-broker-cli.ts +746 -0
- package/src/cli/auth-gateway-cli.ts +411 -0
- package/src/cli/classify-install-target.ts +50 -0
- package/src/cli/commands/init-xdg.ts +27 -0
- package/src/cli/config-cli.ts +418 -0
- package/src/cli/file-processor.ts +123 -0
- package/src/cli/grep-cli.ts +160 -0
- package/src/cli/initial-message.ts +58 -0
- package/src/cli/list-models.ts +194 -0
- package/src/cli/plugin-cli.ts +942 -0
- package/src/cli/read-cli.ts +57 -0
- package/src/cli/session-picker.ts +52 -0
- package/src/cli/setup-cli.ts +433 -0
- package/src/cli/shell-cli.ts +176 -0
- package/src/cli/ssh-cli.ts +179 -0
- package/src/cli/stats-cli.ts +238 -0
- package/src/cli/update-cli.ts +408 -0
- package/src/cli/web-search-cli.ts +133 -0
- package/src/cli/worktree-cli.ts +291 -0
- package/src/cli.ts +99 -0
- package/src/commands/acp.ts +24 -0
- package/src/commands/agents.ts +57 -0
- package/src/commands/auth-broker.ts +96 -0
- package/src/commands/auth-gateway.ts +63 -0
- package/src/commands/codex-native-hook.ts +11 -0
- package/src/commands/commit.ts +46 -0
- package/src/commands/config.ts +51 -0
- package/src/commands/deep-interview.ts +12 -0
- package/src/commands/gjc-runtime-bridge.ts +81 -0
- package/src/commands/grep.ts +48 -0
- package/src/commands/launch.ts +161 -0
- package/src/commands/plugin.ts +78 -0
- package/src/commands/question.ts +12 -0
- package/src/commands/ralplan.ts +12 -0
- package/src/commands/read.ts +35 -0
- package/src/commands/setup.ts +52 -0
- package/src/commands/shell.ts +29 -0
- package/src/commands/ssh.ts +60 -0
- package/src/commands/state.ts +12 -0
- package/src/commands/stats.ts +29 -0
- package/src/commands/team.ts +130 -0
- package/src/commands/ultragoal.ts +32 -0
- package/src/commands/update.ts +21 -0
- package/src/commands/web-search.ts +42 -0
- package/src/commands/worktree.ts +56 -0
- package/src/commit/agentic/agent.ts +316 -0
- package/src/commit/agentic/fallback.ts +96 -0
- package/src/commit/agentic/index.ts +355 -0
- package/src/commit/agentic/prompts/analyze-file.md +22 -0
- package/src/commit/agentic/prompts/session-user.md +25 -0
- package/src/commit/agentic/prompts/split-confirm.md +1 -0
- package/src/commit/agentic/prompts/system.md +38 -0
- package/src/commit/agentic/state.ts +60 -0
- package/src/commit/agentic/tools/analyze-file.ts +127 -0
- package/src/commit/agentic/tools/git-file-diff.ts +191 -0
- package/src/commit/agentic/tools/git-hunk.ts +50 -0
- package/src/commit/agentic/tools/git-overview.ts +81 -0
- package/src/commit/agentic/tools/index.ts +54 -0
- package/src/commit/agentic/tools/propose-changelog.ts +144 -0
- package/src/commit/agentic/tools/propose-commit.ts +109 -0
- package/src/commit/agentic/tools/recent-commits.ts +81 -0
- package/src/commit/agentic/tools/schemas.ts +23 -0
- package/src/commit/agentic/tools/split-commit.ts +238 -0
- package/src/commit/agentic/topo-sort.ts +44 -0
- package/src/commit/agentic/trivial.ts +51 -0
- package/src/commit/agentic/validation.ts +183 -0
- package/src/commit/analysis/conventional.ts +64 -0
- package/src/commit/analysis/index.ts +4 -0
- package/src/commit/analysis/scope.ts +242 -0
- package/src/commit/analysis/summary.ts +105 -0
- package/src/commit/analysis/validation.ts +66 -0
- package/src/commit/changelog/detect.ts +40 -0
- package/src/commit/changelog/generate.ts +97 -0
- package/src/commit/changelog/index.ts +234 -0
- package/src/commit/changelog/parse.ts +44 -0
- package/src/commit/cli.ts +85 -0
- package/src/commit/git/diff.ts +148 -0
- package/src/commit/index.ts +5 -0
- package/src/commit/map-reduce/index.ts +69 -0
- package/src/commit/map-reduce/map-phase.ts +193 -0
- package/src/commit/map-reduce/reduce-phase.ts +49 -0
- package/src/commit/map-reduce/utils.ts +9 -0
- package/src/commit/message.ts +11 -0
- package/src/commit/model-selection.ts +66 -0
- package/src/commit/pipeline.ts +243 -0
- package/src/commit/prompts/analysis-system.md +148 -0
- package/src/commit/prompts/analysis-user.md +38 -0
- package/src/commit/prompts/changelog-system.md +50 -0
- package/src/commit/prompts/changelog-user.md +18 -0
- package/src/commit/prompts/file-observer-system.md +24 -0
- package/src/commit/prompts/file-observer-user.md +8 -0
- package/src/commit/prompts/reduce-system.md +50 -0
- package/src/commit/prompts/reduce-user.md +17 -0
- package/src/commit/prompts/summary-retry.md +3 -0
- package/src/commit/prompts/summary-system.md +38 -0
- package/src/commit/prompts/summary-user.md +13 -0
- package/src/commit/prompts/types-description.md +2 -0
- package/src/commit/shared-llm.ts +77 -0
- package/src/commit/types.ts +118 -0
- package/src/commit/utils/exclusions.ts +42 -0
- package/src/commit/utils.ts +58 -0
- package/src/config/config-file.ts +232 -0
- package/src/config/file-lock.ts +121 -0
- package/src/config/keybindings.ts +493 -0
- package/src/config/mcp-schema.json +230 -0
- package/src/config/model-equivalence.ts +811 -0
- package/src/config/model-registry.ts +2384 -0
- package/src/config/model-resolver.ts +1398 -0
- package/src/config/models-config-schema.ts +175 -0
- package/src/config/prompt-templates.ts +310 -0
- package/src/config/resolve-config-value.ts +94 -0
- package/src/config/settings-schema.ts +2939 -0
- package/src/config/settings.ts +919 -0
- package/src/config/skill-settings-defaults.ts +27 -0
- package/src/config.ts +212 -0
- package/src/cursor.ts +350 -0
- package/src/dap/client.ts +675 -0
- package/src/dap/config.ts +150 -0
- package/src/dap/defaults.json +211 -0
- package/src/dap/index.ts +4 -0
- package/src/dap/session.ts +1306 -0
- package/src/dap/types.ts +600 -0
- package/src/debug/index.ts +459 -0
- package/src/debug/log-formatting.ts +58 -0
- package/src/debug/log-viewer.ts +908 -0
- package/src/debug/profiler.ts +162 -0
- package/src/debug/raw-sse-buffer.ts +270 -0
- package/src/debug/raw-sse.ts +213 -0
- package/src/debug/report-bundle.ts +365 -0
- package/src/debug/system-info.ts +111 -0
- package/src/defaults/gjc/skills/deep-interview/SKILL.md +795 -0
- package/src/defaults/gjc/skills/ralplan/SKILL.md +142 -0
- package/src/defaults/gjc/skills/team/SKILL.md +373 -0
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +176 -0
- package/src/defaults/gjc-defaults.ts +151 -0
- package/src/discovery/agents-md.ts +67 -0
- package/src/discovery/agents.ts +230 -0
- package/src/discovery/builtin.ts +932 -0
- package/src/discovery/claude-plugins.ts +387 -0
- package/src/discovery/claude.ts +313 -0
- package/src/discovery/cline.ts +83 -0
- package/src/discovery/codex.ts +330 -0
- package/src/discovery/cursor.ts +220 -0
- package/src/discovery/gemini.ts +383 -0
- package/src/discovery/github.ts +118 -0
- package/src/discovery/helpers.ts +964 -0
- package/src/discovery/index.ts +76 -0
- package/src/discovery/mcp-json.ts +171 -0
- package/src/discovery/opencode.ts +398 -0
- package/src/discovery/plugin-dir-roots.ts +28 -0
- package/src/discovery/ssh.ts +153 -0
- package/src/discovery/substitute-plugin-root.ts +29 -0
- package/src/discovery/vscode.ts +105 -0
- package/src/discovery/windsurf.ts +147 -0
- package/src/edit/apply-patch/index.ts +87 -0
- package/src/edit/apply-patch/parser.ts +174 -0
- package/src/edit/diff.ts +810 -0
- package/src/edit/file-read-cache.ts +95 -0
- package/src/edit/index.ts +528 -0
- package/src/edit/modes/apply-patch.lark +19 -0
- package/src/edit/modes/apply-patch.ts +53 -0
- package/src/edit/modes/patch.ts +1835 -0
- package/src/edit/modes/replace.ts +1103 -0
- package/src/edit/normalize.ts +375 -0
- package/src/edit/notebook.ts +222 -0
- package/src/edit/read-file.ts +25 -0
- package/src/edit/renderer.ts +683 -0
- package/src/edit/streaming.ts +561 -0
- package/src/eval/backend.ts +43 -0
- package/src/eval/index.ts +4 -0
- package/src/eval/js/context-manager.ts +414 -0
- package/src/eval/js/executor.ts +134 -0
- package/src/eval/js/index.ts +46 -0
- package/src/eval/js/shared/helpers.ts +237 -0
- package/src/eval/js/shared/indirect-eval.ts +30 -0
- package/src/eval/js/shared/prelude.ts +2 -0
- package/src/eval/js/shared/prelude.txt +70 -0
- package/src/eval/js/shared/rewrite-imports.ts +416 -0
- package/src/eval/js/shared/runtime.ts +301 -0
- package/src/eval/js/shared/types.ts +18 -0
- package/src/eval/js/tool-bridge.ts +144 -0
- package/src/eval/js/worker-core.ts +146 -0
- package/src/eval/js/worker-entry.ts +24 -0
- package/src/eval/js/worker-protocol.ts +41 -0
- package/src/eval/py/display.ts +71 -0
- package/src/eval/py/executor.ts +602 -0
- package/src/eval/py/index.ts +58 -0
- package/src/eval/py/kernel.ts +668 -0
- package/src/eval/py/prelude.py +462 -0
- package/src/eval/py/prelude.ts +3 -0
- package/src/eval/py/runner.py +910 -0
- package/src/eval/py/runtime.ts +210 -0
- package/src/eval/py/tool-bridge.ts +137 -0
- package/src/eval/types.ts +48 -0
- package/src/exa/factory.ts +60 -0
- package/src/exa/index.ts +27 -0
- package/src/exa/mcp-client.ts +364 -0
- package/src/exa/render.ts +244 -0
- package/src/exa/researcher.ts +36 -0
- package/src/exa/search.ts +47 -0
- package/src/exa/types.ts +166 -0
- package/src/exa/websets.ts +248 -0
- package/src/exec/bash-executor.ts +309 -0
- package/src/exec/exec.ts +53 -0
- package/src/exec/idle-timeout-watchdog.ts +126 -0
- package/src/exec/non-interactive-env.ts +48 -0
- package/src/export/custom-share.ts +65 -0
- package/src/export/html/index.ts +164 -0
- package/src/export/html/template.css +1060 -0
- package/src/export/html/template.generated.ts +2 -0
- package/src/export/html/template.html +47 -0
- package/src/export/html/template.js +2268 -0
- package/src/export/html/template.macro.ts +25 -0
- package/src/export/html/vendor/highlight.min.js +1213 -0
- package/src/export/html/vendor/marked.min.js +6 -0
- package/src/export/ttsr.ts +434 -0
- package/src/extensibility/custom-commands/bundled/ci-green/index.ts +25 -0
- package/src/extensibility/custom-commands/bundled/review/index.ts +456 -0
- package/src/extensibility/custom-commands/index.ts +2 -0
- package/src/extensibility/custom-commands/loader.ts +238 -0
- package/src/extensibility/custom-commands/types.ts +113 -0
- package/src/extensibility/custom-tools/index.ts +7 -0
- package/src/extensibility/custom-tools/loader.ts +245 -0
- package/src/extensibility/custom-tools/types.ts +254 -0
- package/src/extensibility/custom-tools/wrapper.ts +47 -0
- package/src/extensibility/extensions/compact-handler.ts +40 -0
- package/src/extensibility/extensions/get-commands-handler.ts +80 -0
- package/src/extensibility/extensions/index.ts +15 -0
- package/src/extensibility/extensions/loader.ts +545 -0
- package/src/extensibility/extensions/runner.ts +900 -0
- package/src/extensibility/extensions/types.ts +1259 -0
- package/src/extensibility/extensions/wrapper.ts +189 -0
- package/src/extensibility/hooks/index.ts +5 -0
- package/src/extensibility/hooks/loader.ts +257 -0
- package/src/extensibility/hooks/runner.ts +425 -0
- package/src/extensibility/hooks/tool-wrapper.ts +107 -0
- package/src/extensibility/hooks/types.ts +599 -0
- package/src/extensibility/plugins/doctor.ts +66 -0
- package/src/extensibility/plugins/git-url.ts +281 -0
- package/src/extensibility/plugins/index.ts +9 -0
- package/src/extensibility/plugins/installer.ts +192 -0
- package/src/extensibility/plugins/legacy-pi-compat.ts +336 -0
- package/src/extensibility/plugins/loader.ts +288 -0
- package/src/extensibility/plugins/manager.ts +731 -0
- package/src/extensibility/plugins/marketplace/cache.ts +136 -0
- package/src/extensibility/plugins/marketplace/fetcher.ts +317 -0
- package/src/extensibility/plugins/marketplace/index.ts +6 -0
- package/src/extensibility/plugins/marketplace/manager.ts +770 -0
- package/src/extensibility/plugins/marketplace/registry.ts +196 -0
- package/src/extensibility/plugins/marketplace/source-resolver.ts +147 -0
- package/src/extensibility/plugins/marketplace/types.ts +191 -0
- package/src/extensibility/plugins/parser.ts +105 -0
- package/src/extensibility/plugins/types.ts +194 -0
- package/src/extensibility/shared-events.ts +343 -0
- package/src/extensibility/skills.ts +391 -0
- package/src/extensibility/slash-commands.ts +227 -0
- package/src/extensibility/tool-proxy.ts +25 -0
- package/src/extensibility/typebox.ts +418 -0
- package/src/extensibility/utils.ts +44 -0
- package/src/gjc-runtime/goal-mode-request.ts +212 -0
- package/src/gjc-runtime/launch-tmux.ts +162 -0
- package/src/gjc-runtime/launch-worktree.ts +291 -0
- package/src/gjc-runtime/team-runtime.ts +2025 -0
- package/src/gjc-runtime/ultragoal-runtime.ts +564 -0
- package/src/goals/index.ts +3 -0
- package/src/goals/runtime.ts +524 -0
- package/src/goals/state.ts +37 -0
- package/src/goals/tools/goal-tool.ts +371 -0
- package/src/hashline/anchors.ts +113 -0
- package/src/hashline/apply.ts +737 -0
- package/src/hashline/bigrams.json +649 -0
- package/src/hashline/constants.ts +25 -0
- package/src/hashline/diff-preview.ts +43 -0
- package/src/hashline/diff.ts +56 -0
- package/src/hashline/execute.ts +267 -0
- package/src/hashline/grammar.lark +21 -0
- package/src/hashline/hash.ts +173 -0
- package/src/hashline/index.ts +13 -0
- package/src/hashline/input.ts +130 -0
- package/src/hashline/parser.ts +246 -0
- package/src/hashline/prefixes.ts +101 -0
- package/src/hashline/recovery.ts +113 -0
- package/src/hashline/stream.ts +123 -0
- package/src/hashline/types.ts +68 -0
- package/src/hindsight/backend.ts +205 -0
- package/src/hindsight/bank.ts +131 -0
- package/src/hindsight/client.ts +598 -0
- package/src/hindsight/config.ts +175 -0
- package/src/hindsight/content.ts +210 -0
- package/src/hindsight/index.ts +8 -0
- package/src/hindsight/mental-models.ts +382 -0
- package/src/hindsight/seeds.json +32 -0
- package/src/hindsight/state.ts +469 -0
- package/src/hindsight/transcript.ts +71 -0
- package/src/hooks/codex-native-hooks-config.ts +143 -0
- package/src/hooks/native-skill-hook.ts +279 -0
- package/src/hooks/skill-keywords.ts +86 -0
- package/src/hooks/skill-state.ts +416 -0
- package/src/index.ts +56 -0
- package/src/internal-urls/agent-protocol.ts +129 -0
- package/src/internal-urls/artifact-protocol.ts +80 -0
- package/src/internal-urls/docs-index.generated.ts +81 -0
- package/src/internal-urls/gjc-protocol.ts +83 -0
- package/src/internal-urls/index.ts +21 -0
- package/src/internal-urls/issue-pr-protocol.ts +577 -0
- package/src/internal-urls/json-query.ts +126 -0
- package/src/internal-urls/local-protocol.ts +249 -0
- package/src/internal-urls/mcp-protocol.ts +151 -0
- package/src/internal-urls/memory-protocol.ts +164 -0
- package/src/internal-urls/parse.ts +72 -0
- package/src/internal-urls/registry-helpers.ts +25 -0
- package/src/internal-urls/router.ts +78 -0
- package/src/internal-urls/rule-protocol.ts +38 -0
- package/src/internal-urls/skill-protocol.ts +103 -0
- package/src/internal-urls/types.ts +110 -0
- package/src/lsp/client.ts +951 -0
- package/src/lsp/clients/biome-client.ts +202 -0
- package/src/lsp/clients/index.ts +50 -0
- package/src/lsp/clients/lsp-linter-client.ts +93 -0
- package/src/lsp/clients/swiftlint-client.ts +120 -0
- package/src/lsp/config.ts +492 -0
- package/src/lsp/defaults.json +493 -0
- package/src/lsp/edits.ts +166 -0
- package/src/lsp/index.ts +2282 -0
- package/src/lsp/lspmux.ts +233 -0
- package/src/lsp/render.ts +692 -0
- package/src/lsp/startup-events.ts +13 -0
- package/src/lsp/types.ts +443 -0
- package/src/lsp/utils.ts +678 -0
- package/src/main.ts +961 -0
- package/src/memories/index.ts +1135 -0
- package/src/memories/storage.ts +577 -0
- package/src/memory-backend/index.ts +4 -0
- package/src/memory-backend/local-backend.ts +30 -0
- package/src/memory-backend/off-backend.ts +16 -0
- package/src/memory-backend/resolve.ts +24 -0
- package/src/memory-backend/types.ts +79 -0
- package/src/modes/acp/acp-agent.ts +2170 -0
- package/src/modes/acp/acp-client-bridge.ts +154 -0
- package/src/modes/acp/acp-event-mapper.ts +879 -0
- package/src/modes/acp/acp-mode.ts +23 -0
- package/src/modes/acp/index.ts +2 -0
- package/src/modes/acp/terminal-auth.ts +37 -0
- package/src/modes/components/agent-dashboard.ts +1120 -0
- package/src/modes/components/assistant-message.ts +231 -0
- package/src/modes/components/bash-execution.ts +228 -0
- package/src/modes/components/bordered-loader.ts +41 -0
- package/src/modes/components/branch-summary-message.ts +45 -0
- package/src/modes/components/btw-panel.ts +104 -0
- package/src/modes/components/compaction-summary-message.ts +51 -0
- package/src/modes/components/countdown-timer.ts +75 -0
- package/src/modes/components/custom-editor.ts +237 -0
- package/src/modes/components/custom-message.ts +65 -0
- package/src/modes/components/diff.ts +266 -0
- package/src/modes/components/dynamic-border.ts +25 -0
- package/src/modes/components/eval-execution.ts +164 -0
- package/src/modes/components/execution-shared.ts +102 -0
- package/src/modes/components/extensions/extension-dashboard.ts +350 -0
- package/src/modes/components/extensions/extension-list.ts +492 -0
- package/src/modes/components/extensions/index.ts +9 -0
- package/src/modes/components/extensions/inspector-panel.ts +317 -0
- package/src/modes/components/extensions/state-manager.ts +628 -0
- package/src/modes/components/extensions/types.ts +191 -0
- package/src/modes/components/footer.ts +270 -0
- package/src/modes/components/history-search.ts +158 -0
- package/src/modes/components/hook-editor.ts +151 -0
- package/src/modes/components/hook-input.ts +79 -0
- package/src/modes/components/hook-message.ts +68 -0
- package/src/modes/components/hook-selector.ts +190 -0
- package/src/modes/components/index.ts +36 -0
- package/src/modes/components/keybinding-hints.ts +65 -0
- package/src/modes/components/login-dialog.ts +164 -0
- package/src/modes/components/message-frame.ts +88 -0
- package/src/modes/components/model-selector.ts +794 -0
- package/src/modes/components/oauth-selector.ts +248 -0
- package/src/modes/components/plugin-selector.ts +95 -0
- package/src/modes/components/plugin-settings.ts +488 -0
- package/src/modes/components/provider-onboarding-selector.ts +88 -0
- package/src/modes/components/queue-mode-selector.ts +56 -0
- package/src/modes/components/read-tool-group.ts +267 -0
- package/src/modes/components/runtime-mcp-add-wizard.ts +1341 -0
- package/src/modes/components/session-observer-overlay.ts +839 -0
- package/src/modes/components/session-selector.ts +343 -0
- package/src/modes/components/settings-defs.ts +175 -0
- package/src/modes/components/settings-selector.ts +635 -0
- package/src/modes/components/show-images-selector.ts +45 -0
- package/src/modes/components/skill-hud/render.ts +47 -0
- package/src/modes/components/skill-message.ts +90 -0
- package/src/modes/components/status-line/context-thresholds.ts +68 -0
- package/src/modes/components/status-line/git-utils.ts +42 -0
- package/src/modes/components/status-line/index.ts +4 -0
- package/src/modes/components/status-line/presets.ts +105 -0
- package/src/modes/components/status-line/segments.ts +560 -0
- package/src/modes/components/status-line/separators.ts +55 -0
- package/src/modes/components/status-line/token-rate.ts +66 -0
- package/src/modes/components/status-line/types.ts +93 -0
- package/src/modes/components/status-line.ts +839 -0
- package/src/modes/components/theme-selector.ts +63 -0
- package/src/modes/components/thinking-selector.ts +52 -0
- package/src/modes/components/todo-reminder.ts +40 -0
- package/src/modes/components/tool-execution.ts +830 -0
- package/src/modes/components/tree-selector.ts +930 -0
- package/src/modes/components/ttsr-notification.ts +80 -0
- package/src/modes/components/user-message-selector.ts +141 -0
- package/src/modes/components/user-message.ts +51 -0
- package/src/modes/components/visual-truncate.ts +63 -0
- package/src/modes/components/welcome.ts +389 -0
- package/src/modes/controllers/btw-controller.ts +105 -0
- package/src/modes/controllers/command-controller-shared.ts +108 -0
- package/src/modes/controllers/command-controller.ts +1630 -0
- package/src/modes/controllers/event-controller.ts +786 -0
- package/src/modes/controllers/extension-ui-controller.ts +927 -0
- package/src/modes/controllers/input-controller.ts +858 -0
- package/src/modes/controllers/runtime-mcp-command-controller.ts +1934 -0
- package/src/modes/controllers/selector-controller.ts +1039 -0
- package/src/modes/controllers/ssh-command-controller.ts +384 -0
- package/src/modes/controllers/todo-command-controller.ts +485 -0
- package/src/modes/data/emojis.json +1 -0
- package/src/modes/emoji-autocomplete.ts +285 -0
- package/src/modes/index.ts +34 -0
- package/src/modes/interactive-mode.ts +2756 -0
- package/src/modes/loop-limit.ts +140 -0
- package/src/modes/oauth-manual-input.ts +42 -0
- package/src/modes/print-mode.ts +121 -0
- package/src/modes/prompt-action-autocomplete.ts +345 -0
- package/src/modes/rpc/host-tools.ts +186 -0
- package/src/modes/rpc/host-uris.ts +235 -0
- package/src/modes/rpc/rpc-client.ts +810 -0
- package/src/modes/rpc/rpc-mode.ts +851 -0
- package/src/modes/rpc/rpc-types.ts +378 -0
- package/src/modes/runtime-init.ts +116 -0
- package/src/modes/session-observer-registry.ts +146 -0
- package/src/modes/shared.ts +55 -0
- package/src/modes/theme/dark.json +95 -0
- package/src/modes/theme/defaults/alabaster.json +93 -0
- package/src/modes/theme/defaults/amethyst.json +96 -0
- package/src/modes/theme/defaults/anthracite.json +93 -0
- package/src/modes/theme/defaults/basalt.json +91 -0
- package/src/modes/theme/defaults/birch.json +95 -0
- package/src/modes/theme/defaults/dark-abyss.json +91 -0
- package/src/modes/theme/defaults/dark-arctic.json +104 -0
- package/src/modes/theme/defaults/dark-aurora.json +95 -0
- package/src/modes/theme/defaults/dark-catppuccin.json +107 -0
- package/src/modes/theme/defaults/dark-cavern.json +91 -0
- package/src/modes/theme/defaults/dark-copper.json +95 -0
- package/src/modes/theme/defaults/dark-cosmos.json +90 -0
- package/src/modes/theme/defaults/dark-cyberpunk.json +102 -0
- package/src/modes/theme/defaults/dark-dracula.json +98 -0
- package/src/modes/theme/defaults/dark-eclipse.json +91 -0
- package/src/modes/theme/defaults/dark-ember.json +95 -0
- package/src/modes/theme/defaults/dark-equinox.json +90 -0
- package/src/modes/theme/defaults/dark-forest.json +96 -0
- package/src/modes/theme/defaults/dark-github.json +105 -0
- package/src/modes/theme/defaults/dark-gruvbox.json +112 -0
- package/src/modes/theme/defaults/dark-lavender.json +95 -0
- package/src/modes/theme/defaults/dark-lunar.json +89 -0
- package/src/modes/theme/defaults/dark-midnight.json +95 -0
- package/src/modes/theme/defaults/dark-monochrome.json +94 -0
- package/src/modes/theme/defaults/dark-monokai.json +98 -0
- package/src/modes/theme/defaults/dark-nebula.json +90 -0
- package/src/modes/theme/defaults/dark-nord.json +97 -0
- package/src/modes/theme/defaults/dark-ocean.json +101 -0
- package/src/modes/theme/defaults/dark-one.json +100 -0
- package/src/modes/theme/defaults/dark-poimandres.json +142 -0
- package/src/modes/theme/defaults/dark-rainforest.json +91 -0
- package/src/modes/theme/defaults/dark-reef.json +91 -0
- package/src/modes/theme/defaults/dark-retro.json +92 -0
- package/src/modes/theme/defaults/dark-rose-pine.json +96 -0
- package/src/modes/theme/defaults/dark-sakura.json +95 -0
- package/src/modes/theme/defaults/dark-slate.json +95 -0
- package/src/modes/theme/defaults/dark-solarized.json +97 -0
- package/src/modes/theme/defaults/dark-solstice.json +90 -0
- package/src/modes/theme/defaults/dark-starfall.json +91 -0
- package/src/modes/theme/defaults/dark-sunset.json +99 -0
- package/src/modes/theme/defaults/dark-swamp.json +90 -0
- package/src/modes/theme/defaults/dark-synthwave.json +103 -0
- package/src/modes/theme/defaults/dark-taiga.json +91 -0
- package/src/modes/theme/defaults/dark-terminal.json +95 -0
- package/src/modes/theme/defaults/dark-tokyo-night.json +101 -0
- package/src/modes/theme/defaults/dark-tundra.json +91 -0
- package/src/modes/theme/defaults/dark-twilight.json +91 -0
- package/src/modes/theme/defaults/dark-volcanic.json +91 -0
- package/src/modes/theme/defaults/graphite.json +92 -0
- package/src/modes/theme/defaults/index.ts +201 -0
- package/src/modes/theme/defaults/light-arctic.json +107 -0
- package/src/modes/theme/defaults/light-aurora-day.json +91 -0
- package/src/modes/theme/defaults/light-canyon.json +91 -0
- package/src/modes/theme/defaults/light-catppuccin.json +106 -0
- package/src/modes/theme/defaults/light-cirrus.json +90 -0
- package/src/modes/theme/defaults/light-coral.json +95 -0
- package/src/modes/theme/defaults/light-cyberpunk.json +96 -0
- package/src/modes/theme/defaults/light-dawn.json +90 -0
- package/src/modes/theme/defaults/light-dunes.json +91 -0
- package/src/modes/theme/defaults/light-eucalyptus.json +95 -0
- package/src/modes/theme/defaults/light-forest.json +100 -0
- package/src/modes/theme/defaults/light-frost.json +95 -0
- package/src/modes/theme/defaults/light-github.json +115 -0
- package/src/modes/theme/defaults/light-glacier.json +91 -0
- package/src/modes/theme/defaults/light-gruvbox.json +108 -0
- package/src/modes/theme/defaults/light-haze.json +90 -0
- package/src/modes/theme/defaults/light-honeycomb.json +95 -0
- package/src/modes/theme/defaults/light-lagoon.json +91 -0
- package/src/modes/theme/defaults/light-lavender.json +95 -0
- package/src/modes/theme/defaults/light-meadow.json +91 -0
- package/src/modes/theme/defaults/light-mint.json +95 -0
- package/src/modes/theme/defaults/light-monochrome.json +101 -0
- package/src/modes/theme/defaults/light-ocean.json +99 -0
- package/src/modes/theme/defaults/light-one.json +99 -0
- package/src/modes/theme/defaults/light-opal.json +91 -0
- package/src/modes/theme/defaults/light-orchard.json +91 -0
- package/src/modes/theme/defaults/light-paper.json +95 -0
- package/src/modes/theme/defaults/light-poimandres.json +142 -0
- package/src/modes/theme/defaults/light-prism.json +90 -0
- package/src/modes/theme/defaults/light-retro.json +98 -0
- package/src/modes/theme/defaults/light-sand.json +95 -0
- package/src/modes/theme/defaults/light-savanna.json +91 -0
- package/src/modes/theme/defaults/light-solarized.json +102 -0
- package/src/modes/theme/defaults/light-soleil.json +90 -0
- package/src/modes/theme/defaults/light-sunset.json +99 -0
- package/src/modes/theme/defaults/light-synthwave.json +98 -0
- package/src/modes/theme/defaults/light-tokyo-night.json +111 -0
- package/src/modes/theme/defaults/light-wetland.json +91 -0
- package/src/modes/theme/defaults/light-zenith.json +89 -0
- package/src/modes/theme/defaults/limestone.json +94 -0
- package/src/modes/theme/defaults/mahogany.json +97 -0
- package/src/modes/theme/defaults/marble.json +93 -0
- package/src/modes/theme/defaults/obsidian.json +91 -0
- package/src/modes/theme/defaults/onyx.json +91 -0
- package/src/modes/theme/defaults/pearl.json +93 -0
- package/src/modes/theme/defaults/porcelain.json +91 -0
- package/src/modes/theme/defaults/quartz.json +96 -0
- package/src/modes/theme/defaults/red-claw.json +123 -0
- package/src/modes/theme/defaults/sandstone.json +95 -0
- package/src/modes/theme/defaults/titanium.json +90 -0
- package/src/modes/theme/light.json +93 -0
- package/src/modes/theme/mermaid-cache.ts +29 -0
- package/src/modes/theme/shimmer.ts +219 -0
- package/src/modes/theme/theme-schema.json +429 -0
- package/src/modes/theme/theme.ts +2413 -0
- package/src/modes/types.ts +313 -0
- package/src/modes/utils/context-usage.ts +335 -0
- package/src/modes/utils/hotkeys-markdown.ts +59 -0
- package/src/modes/utils/keybinding-matchers.ts +30 -0
- package/src/modes/utils/tools-markdown.ts +27 -0
- package/src/modes/utils/ui-helpers.ts +741 -0
- package/src/plan-mode/approved-plan.ts +163 -0
- package/src/plan-mode/state.ts +6 -0
- package/src/priority.json +37 -0
- package/src/prompts/agents/architect.md +79 -0
- package/src/prompts/agents/critic.md +55 -0
- package/src/prompts/agents/executor.md +45 -0
- package/src/prompts/agents/explore.md +58 -0
- package/src/prompts/agents/frontmatter.md +12 -0
- package/src/prompts/agents/init.md +34 -0
- package/src/prompts/agents/plan.md +49 -0
- package/src/prompts/agents/planner.md +49 -0
- package/src/prompts/agents/reviewer.md +141 -0
- package/src/prompts/agents/task.md +16 -0
- package/src/prompts/ci-green-request.md +36 -0
- package/src/prompts/commands/orchestrate.md +49 -0
- package/src/prompts/goals/goal-budget-limit.md +16 -0
- package/src/prompts/goals/goal-continuation.md +28 -0
- package/src/prompts/goals/goal-mode-active.md +23 -0
- package/src/prompts/memories/consolidation.md +30 -0
- package/src/prompts/memories/read-path.md +11 -0
- package/src/prompts/memories/stage_one_input.md +6 -0
- package/src/prompts/memories/stage_one_system.md +21 -0
- package/src/prompts/review-request.md +70 -0
- package/src/prompts/system/agent-creation-architect.md +75 -0
- package/src/prompts/system/agent-creation-user.md +6 -0
- package/src/prompts/system/auto-continue.md +1 -0
- package/src/prompts/system/btw-user.md +8 -0
- package/src/prompts/system/commit-message-system.md +2 -0
- package/src/prompts/system/custom-system-prompt.md +64 -0
- package/src/prompts/system/eager-todo.md +13 -0
- package/src/prompts/system/irc-incoming.md +8 -0
- package/src/prompts/system/plan-mode-active.md +116 -0
- package/src/prompts/system/plan-mode-approved.md +28 -0
- package/src/prompts/system/plan-mode-compact-instructions.md +16 -0
- package/src/prompts/system/plan-mode-reference.md +14 -0
- package/src/prompts/system/plan-mode-subagent.md +34 -0
- package/src/prompts/system/plan-mode-tool-decision-reminder.md +9 -0
- package/src/prompts/system/project-prompt.md +46 -0
- package/src/prompts/system/subagent-system-prompt.md +54 -0
- package/src/prompts/system/subagent-user-prompt.md +3 -0
- package/src/prompts/system/subagent-yield-reminder.md +12 -0
- package/src/prompts/system/system-prompt.md +267 -0
- package/src/prompts/system/title-system.md +2 -0
- package/src/prompts/system/ttsr-interrupt.md +7 -0
- package/src/prompts/system/ttsr-tool-reminder.md +5 -0
- package/src/prompts/system/web-search.md +25 -0
- package/src/prompts/tools/apply-patch.md +65 -0
- package/src/prompts/tools/ask.md +29 -0
- package/src/prompts/tools/ast-edit.md +39 -0
- package/src/prompts/tools/ast-grep.md +42 -0
- package/src/prompts/tools/async-result.md +8 -0
- package/src/prompts/tools/bash.md +39 -0
- package/src/prompts/tools/browser.md +70 -0
- package/src/prompts/tools/calculator.md +10 -0
- package/src/prompts/tools/checkpoint.md +16 -0
- package/src/prompts/tools/create-goal.md +3 -0
- package/src/prompts/tools/debug.md +33 -0
- package/src/prompts/tools/eval.md +75 -0
- package/src/prompts/tools/find.md +34 -0
- package/src/prompts/tools/get-goal.md +3 -0
- package/src/prompts/tools/github.md +20 -0
- package/src/prompts/tools/goal.md +18 -0
- package/src/prompts/tools/hashline.md +130 -0
- package/src/prompts/tools/image-gen.md +7 -0
- package/src/prompts/tools/inspect-image-system.md +20 -0
- package/src/prompts/tools/inspect-image.md +32 -0
- package/src/prompts/tools/irc.md +49 -0
- package/src/prompts/tools/job.md +19 -0
- package/src/prompts/tools/lsp.md +42 -0
- package/src/prompts/tools/patch.md +70 -0
- package/src/prompts/tools/read.md +82 -0
- package/src/prompts/tools/recall.md +5 -0
- package/src/prompts/tools/recipe.md +16 -0
- package/src/prompts/tools/reflect.md +5 -0
- package/src/prompts/tools/render-mermaid.md +9 -0
- package/src/prompts/tools/replace.md +36 -0
- package/src/prompts/tools/resolve.md +9 -0
- package/src/prompts/tools/retain.md +6 -0
- package/src/prompts/tools/rewind.md +13 -0
- package/src/prompts/tools/search-tool-bm25.md +33 -0
- package/src/prompts/tools/search.md +25 -0
- package/src/prompts/tools/ssh.md +35 -0
- package/src/prompts/tools/subagent.md +21 -0
- package/src/prompts/tools/task-summary.md +28 -0
- package/src/prompts/tools/task.md +79 -0
- package/src/prompts/tools/todo-write.md +50 -0
- package/src/prompts/tools/update-goal.md +3 -0
- package/src/prompts/tools/vim.md +98 -0
- package/src/prompts/tools/web-search.md +10 -0
- package/src/prompts/tools/write.md +14 -0
- package/src/registry/agent-registry.ts +140 -0
- package/src/runtime-mcp/client.ts +482 -0
- package/src/runtime-mcp/config-writer.ts +225 -0
- package/src/runtime-mcp/config.ts +365 -0
- package/src/runtime-mcp/discoverable-tool-metadata.ts +25 -0
- package/src/runtime-mcp/index.ts +29 -0
- package/src/runtime-mcp/json-rpc.ts +84 -0
- package/src/runtime-mcp/loader.ts +124 -0
- package/src/runtime-mcp/manager.ts +1172 -0
- package/src/runtime-mcp/oauth-discovery.ts +349 -0
- package/src/runtime-mcp/oauth-flow.ts +407 -0
- package/src/runtime-mcp/render.ts +123 -0
- package/src/runtime-mcp/smithery-auth.ts +104 -0
- package/src/runtime-mcp/smithery-connect.ts +145 -0
- package/src/runtime-mcp/smithery-registry.ts +477 -0
- package/src/runtime-mcp/tool-bridge.ts +416 -0
- package/src/runtime-mcp/tool-cache.ts +117 -0
- package/src/runtime-mcp/transports/http.ts +477 -0
- package/src/runtime-mcp/transports/index.ts +6 -0
- package/src/runtime-mcp/transports/stdio.ts +325 -0
- package/src/runtime-mcp/types.ts +423 -0
- package/src/sdk.ts +2064 -0
- package/src/secrets/index.ts +116 -0
- package/src/secrets/obfuscator.ts +277 -0
- package/src/secrets/regex.ts +21 -0
- package/src/session/agent-session.ts +8794 -0
- package/src/session/agent-storage.ts +466 -0
- package/src/session/artifacts.ts +135 -0
- package/src/session/auth-broker-config.ts +102 -0
- package/src/session/auth-storage.ts +23 -0
- package/src/session/blob-store.ts +168 -0
- package/src/session/client-bridge.ts +85 -0
- package/src/session/history-storage.ts +311 -0
- package/src/session/messages.ts +403 -0
- package/src/session/session-dump-format.ts +209 -0
- package/src/session/session-manager.ts +3333 -0
- package/src/session/session-storage.ts +389 -0
- package/src/session/streaming-output.ts +1093 -0
- package/src/session/tool-choice-queue.ts +213 -0
- package/src/session/yield-queue.ts +155 -0
- package/src/setup/model-onboarding-guidance.ts +36 -0
- package/src/setup/provider-onboarding.ts +195 -0
- package/src/skill-state/active-state.ts +272 -0
- package/src/slash-commands/acp-builtins.ts +46 -0
- package/src/slash-commands/builtin-registry.ts +955 -0
- package/src/slash-commands/helpers/context-report.ts +39 -0
- package/src/slash-commands/helpers/format.ts +46 -0
- package/src/slash-commands/helpers/mcp.ts +532 -0
- package/src/slash-commands/helpers/parse.ts +85 -0
- package/src/slash-commands/helpers/ssh.ts +195 -0
- package/src/slash-commands/helpers/todo.ts +279 -0
- package/src/slash-commands/helpers/usage-report.ts +91 -0
- package/src/slash-commands/types.ts +125 -0
- package/src/ssh/config-writer.ts +183 -0
- package/src/ssh/connection-manager.ts +482 -0
- package/src/ssh/ssh-executor.ts +133 -0
- package/src/ssh/sshfs-mount.ts +140 -0
- package/src/ssh/utils.ts +8 -0
- package/src/stt/downloader.ts +71 -0
- package/src/stt/index.ts +3 -0
- package/src/stt/recorder.ts +351 -0
- package/src/stt/setup.ts +52 -0
- package/src/stt/stt-controller.ts +160 -0
- package/src/stt/transcribe.py +70 -0
- package/src/stt/transcriber.ts +91 -0
- package/src/system-prompt.ts +581 -0
- package/src/task/agents.ts +162 -0
- package/src/task/commands.ts +135 -0
- package/src/task/discovery.ts +130 -0
- package/src/task/executor.ts +1564 -0
- package/src/task/gjc-command.ts +26 -0
- package/src/task/index.ts +1366 -0
- package/src/task/name-generator.ts +1577 -0
- package/src/task/output-manager.ts +107 -0
- package/src/task/parallel.ts +116 -0
- package/src/task/render.ts +1136 -0
- package/src/task/simple-mode.ts +27 -0
- package/src/task/subprocess-tool-registry.ts +88 -0
- package/src/task/types.ts +315 -0
- package/src/task/worktree.ts +506 -0
- package/src/thinking.ts +87 -0
- package/src/tool-discovery/tool-index.ts +400 -0
- package/src/tools/archive-reader.ts +321 -0
- package/src/tools/ask.ts +790 -0
- package/src/tools/ast-edit.ts +542 -0
- package/src/tools/ast-grep.ts +423 -0
- package/src/tools/auto-generated-guard.ts +305 -0
- package/src/tools/bash-command-fixup.ts +37 -0
- package/src/tools/bash-interactive.ts +388 -0
- package/src/tools/bash-interceptor.ts +67 -0
- package/src/tools/bash-pty-selection.ts +14 -0
- package/src/tools/bash-skill-urls.ts +248 -0
- package/src/tools/bash.ts +1061 -0
- package/src/tools/browser/attach.ts +175 -0
- package/src/tools/browser/launch.ts +651 -0
- package/src/tools/browser/readable.ts +95 -0
- package/src/tools/browser/registry.ts +194 -0
- package/src/tools/browser/render.ts +212 -0
- package/src/tools/browser/tab-protocol.ts +105 -0
- package/src/tools/browser/tab-supervisor.ts +577 -0
- package/src/tools/browser/tab-worker-entry.ts +21 -0
- package/src/tools/browser/tab-worker.ts +1054 -0
- package/src/tools/browser.ts +301 -0
- package/src/tools/calculator.ts +540 -0
- package/src/tools/checkpoint.ts +134 -0
- package/src/tools/conflict-detect.ts +672 -0
- package/src/tools/context.ts +39 -0
- package/src/tools/debug.ts +1014 -0
- package/src/tools/eval.ts +1101 -0
- package/src/tools/fetch.ts +1482 -0
- package/src/tools/file-recorder.ts +35 -0
- package/src/tools/find.ts +540 -0
- package/src/tools/fs-cache-invalidation.ts +28 -0
- package/src/tools/gh-format.ts +12 -0
- package/src/tools/gh-renderer.ts +428 -0
- package/src/tools/gh.ts +3499 -0
- package/src/tools/github-cache.ts +548 -0
- package/src/tools/grouped-file-output.ts +96 -0
- package/src/tools/hindsight-recall.ts +68 -0
- package/src/tools/hindsight-reflect.ts +57 -0
- package/src/tools/hindsight-retain.ts +56 -0
- package/src/tools/image-gen.ts +1248 -0
- package/src/tools/index.ts +519 -0
- package/src/tools/inspect-image-renderer.ts +103 -0
- package/src/tools/inspect-image.ts +165 -0
- package/src/tools/irc.ts +239 -0
- package/src/tools/job.ts +520 -0
- package/src/tools/json-tree.ts +243 -0
- package/src/tools/jtd-to-json-schema.ts +219 -0
- package/src/tools/jtd-to-typescript.ts +136 -0
- package/src/tools/jtd-utils.ts +102 -0
- package/src/tools/list-limit.ts +40 -0
- package/src/tools/match-line-format.ts +22 -0
- package/src/tools/output-meta.ts +754 -0
- package/src/tools/path-utils.ts +739 -0
- package/src/tools/plan-mode-guard.ts +68 -0
- package/src/tools/puppeteer/00_stealth_tampering.txt +63 -0
- package/src/tools/puppeteer/01_stealth_activity.txt +20 -0
- package/src/tools/puppeteer/02_stealth_hairline.txt +11 -0
- package/src/tools/puppeteer/03_stealth_botd.txt +384 -0
- package/src/tools/puppeteer/04_stealth_iframe.txt +81 -0
- package/src/tools/puppeteer/05_stealth_webgl.txt +75 -0
- package/src/tools/puppeteer/06_stealth_screen.txt +72 -0
- package/src/tools/puppeteer/07_stealth_fonts.txt +97 -0
- package/src/tools/puppeteer/08_stealth_audio.txt +51 -0
- package/src/tools/puppeteer/09_stealth_locale.txt +46 -0
- package/src/tools/puppeteer/10_stealth_plugins.txt +206 -0
- package/src/tools/puppeteer/11_stealth_hardware.txt +8 -0
- package/src/tools/puppeteer/12_stealth_codecs.txt +40 -0
- package/src/tools/puppeteer/13_stealth_worker.txt +74 -0
- package/src/tools/read.ts +2332 -0
- package/src/tools/recipe/index.ts +80 -0
- package/src/tools/recipe/render.ts +19 -0
- package/src/tools/recipe/runner.ts +219 -0
- package/src/tools/recipe/runners/cargo.ts +131 -0
- package/src/tools/recipe/runners/index.ts +8 -0
- package/src/tools/recipe/runners/just.ts +73 -0
- package/src/tools/recipe/runners/make.ts +101 -0
- package/src/tools/recipe/runners/pkg.ts +167 -0
- package/src/tools/recipe/runners/task.ts +72 -0
- package/src/tools/render-mermaid.ts +68 -0
- package/src/tools/render-utils.ts +774 -0
- package/src/tools/renderers.ts +75 -0
- package/src/tools/resolve.ts +258 -0
- package/src/tools/review.ts +252 -0
- package/src/tools/search-tool-bm25.ts +360 -0
- package/src/tools/search.ts +786 -0
- package/src/tools/sqlite-reader.ts +736 -0
- package/src/tools/ssh.ts +310 -0
- package/src/tools/subagent.ts +312 -0
- package/src/tools/todo-write.ts +695 -0
- package/src/tools/tool-errors.ts +62 -0
- package/src/tools/tool-result.ts +86 -0
- package/src/tools/tool-timeouts.ts +30 -0
- package/src/tools/vim.ts +949 -0
- package/src/tools/write.ts +953 -0
- package/src/tools/yield.ts +268 -0
- package/src/tui/code-cell.ts +201 -0
- package/src/tui/file-list.ts +55 -0
- package/src/tui/hyperlink.ts +126 -0
- package/src/tui/index.ts +12 -0
- package/src/tui/output-block.ts +150 -0
- package/src/tui/status-line.ts +39 -0
- package/src/tui/tree-list.ts +84 -0
- package/src/tui/types.ts +15 -0
- package/src/tui/utils.ts +103 -0
- package/src/utils/changelog.ts +98 -0
- package/src/utils/clipboard.ts +156 -0
- package/src/utils/command-args.ts +76 -0
- package/src/utils/commit-message-generator.ts +142 -0
- package/src/utils/edit-mode.ts +42 -0
- package/src/utils/event-bus.ts +33 -0
- package/src/utils/external-editor.ts +65 -0
- package/src/utils/file-display-mode.ts +45 -0
- package/src/utils/file-mentions.ts +376 -0
- package/src/utils/git.ts +1536 -0
- package/src/utils/image-loading.ts +102 -0
- package/src/utils/image-resize.ts +309 -0
- package/src/utils/lang-from-path.ts +239 -0
- package/src/utils/markit.ts +89 -0
- package/src/utils/open.ts +20 -0
- package/src/utils/session-color.ts +43 -0
- package/src/utils/shell-snapshot.ts +187 -0
- package/src/utils/sixel.ts +69 -0
- package/src/utils/title-generator.ts +223 -0
- package/src/utils/tool-choice.ts +33 -0
- package/src/utils/tools-manager.ts +363 -0
- package/src/vim/buffer.ts +309 -0
- package/src/vim/commands.ts +382 -0
- package/src/vim/engine.ts +2409 -0
- package/src/vim/parser.ts +134 -0
- package/src/vim/render.ts +252 -0
- package/src/vim/types.ts +197 -0
- package/src/web/kagi.ts +183 -0
- package/src/web/parallel.ts +349 -0
- package/src/web/scrapers/artifacthub.ts +207 -0
- package/src/web/scrapers/arxiv.ts +83 -0
- package/src/web/scrapers/aur.ts +162 -0
- package/src/web/scrapers/biorxiv.ts +133 -0
- package/src/web/scrapers/bluesky.ts +262 -0
- package/src/web/scrapers/brew.ts +172 -0
- package/src/web/scrapers/cheatsh.ts +68 -0
- package/src/web/scrapers/chocolatey.ts +196 -0
- package/src/web/scrapers/choosealicense.ts +95 -0
- package/src/web/scrapers/cisa-kev.ts +87 -0
- package/src/web/scrapers/clojars.ts +154 -0
- package/src/web/scrapers/coingecko.ts +177 -0
- package/src/web/scrapers/crates-io.ts +97 -0
- package/src/web/scrapers/crossref.ts +136 -0
- package/src/web/scrapers/devto.ts +147 -0
- package/src/web/scrapers/discogs.ts +306 -0
- package/src/web/scrapers/discourse.ts +197 -0
- package/src/web/scrapers/dockerhub.ts +138 -0
- package/src/web/scrapers/docs-rs.ts +653 -0
- package/src/web/scrapers/fdroid.ts +134 -0
- package/src/web/scrapers/firefox-addons.ts +191 -0
- package/src/web/scrapers/flathub.ts +223 -0
- package/src/web/scrapers/github-gist.ts +58 -0
- package/src/web/scrapers/github.ts +452 -0
- package/src/web/scrapers/gitlab.ts +401 -0
- package/src/web/scrapers/go-pkg.ts +266 -0
- package/src/web/scrapers/hackage.ts +140 -0
- package/src/web/scrapers/hackernews.ts +189 -0
- package/src/web/scrapers/hex.ts +105 -0
- package/src/web/scrapers/huggingface.ts +321 -0
- package/src/web/scrapers/iacr.ts +89 -0
- package/src/web/scrapers/index.ts +252 -0
- package/src/web/scrapers/jetbrains-marketplace.ts +159 -0
- package/src/web/scrapers/lemmy.ts +203 -0
- package/src/web/scrapers/lobsters.ts +175 -0
- package/src/web/scrapers/mastodon.ts +292 -0
- package/src/web/scrapers/maven.ts +138 -0
- package/src/web/scrapers/mdn.ts +173 -0
- package/src/web/scrapers/metacpan.ts +222 -0
- package/src/web/scrapers/musicbrainz.ts +250 -0
- package/src/web/scrapers/npm.ts +98 -0
- package/src/web/scrapers/nuget.ts +183 -0
- package/src/web/scrapers/nvd.ts +222 -0
- package/src/web/scrapers/ollama.ts +239 -0
- package/src/web/scrapers/open-vsx.ts +106 -0
- package/src/web/scrapers/opencorporates.ts +292 -0
- package/src/web/scrapers/openlibrary.ts +336 -0
- package/src/web/scrapers/orcid.ts +286 -0
- package/src/web/scrapers/osv.ts +176 -0
- package/src/web/scrapers/packagist.ts +160 -0
- package/src/web/scrapers/pub-dev.ts +143 -0
- package/src/web/scrapers/pubmed.ts +211 -0
- package/src/web/scrapers/pypi.ts +112 -0
- package/src/web/scrapers/rawg.ts +110 -0
- package/src/web/scrapers/readthedocs.ts +120 -0
- package/src/web/scrapers/reddit.ts +95 -0
- package/src/web/scrapers/repology.ts +251 -0
- package/src/web/scrapers/rfc.ts +201 -0
- package/src/web/scrapers/rubygems.ts +103 -0
- package/src/web/scrapers/searchcode.ts +189 -0
- package/src/web/scrapers/sec-edgar.ts +261 -0
- package/src/web/scrapers/semantic-scholar.ts +171 -0
- package/src/web/scrapers/snapcraft.ts +187 -0
- package/src/web/scrapers/sourcegraph.ts +336 -0
- package/src/web/scrapers/spdx.ts +108 -0
- package/src/web/scrapers/spotify.ts +198 -0
- package/src/web/scrapers/stackoverflow.ts +120 -0
- package/src/web/scrapers/terraform.ts +277 -0
- package/src/web/scrapers/tldr.ts +47 -0
- package/src/web/scrapers/twitter.ts +93 -0
- package/src/web/scrapers/types.ts +318 -0
- package/src/web/scrapers/utils.ts +109 -0
- package/src/web/scrapers/vimeo.ts +133 -0
- package/src/web/scrapers/vscode-marketplace.ts +187 -0
- package/src/web/scrapers/w3c.ts +156 -0
- package/src/web/scrapers/wikidata.ts +344 -0
- package/src/web/scrapers/wikipedia.ts +84 -0
- package/src/web/scrapers/youtube.ts +319 -0
- package/src/web/search/index.ts +288 -0
- package/src/web/search/provider.ts +173 -0
- package/src/web/search/providers/anthropic.ts +302 -0
- package/src/web/search/providers/base.ts +71 -0
- package/src/web/search/providers/brave.ts +149 -0
- package/src/web/search/providers/codex.ts +556 -0
- package/src/web/search/providers/exa.ts +193 -0
- package/src/web/search/providers/gemini.ts +455 -0
- package/src/web/search/providers/jina.ts +101 -0
- package/src/web/search/providers/kagi.ts +75 -0
- package/src/web/search/providers/kimi.ts +171 -0
- package/src/web/search/providers/parallel.ts +210 -0
- package/src/web/search/providers/perplexity.ts +575 -0
- package/src/web/search/providers/searxng.ts +309 -0
- package/src/web/search/providers/synthetic.ts +108 -0
- package/src/web/search/providers/tavily.ts +173 -0
- package/src/web/search/providers/utils.ts +128 -0
- package/src/web/search/providers/zai.ts +320 -0
- package/src/web/search/render.ts +299 -0
- package/src/web/search/types.ts +436 -0
- package/src/web/search/utils.ts +17 -0
- package/src/workspace-tree.ts +286 -0
|
@@ -0,0 +1,1101 @@
|
|
|
1
|
+
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@gajae-code/agent-core";
|
|
2
|
+
import type { ImageContent } from "@gajae-code/ai";
|
|
3
|
+
import type { Component } from "@gajae-code/tui";
|
|
4
|
+
import { Markdown, Text } from "@gajae-code/tui";
|
|
5
|
+
import { prompt } from "@gajae-code/utils";
|
|
6
|
+
import * as z from "zod/v4";
|
|
7
|
+
import { jsBackend, pythonBackend } from "../eval";
|
|
8
|
+
import type { ExecutorBackend } from "../eval/backend";
|
|
9
|
+
import type { EvalCellResult, EvalDisplayOutput, EvalLanguage, EvalStatusEvent, EvalToolDetails } from "../eval/types";
|
|
10
|
+
import type { RenderResultOptions } from "../extensibility/custom-tools/types";
|
|
11
|
+
import { truncateToVisualLines } from "../modes/components/visual-truncate";
|
|
12
|
+
import { getMarkdownTheme, type Theme } from "../modes/theme/theme";
|
|
13
|
+
import evalDescription from "../prompts/tools/eval.md" with { type: "text" };
|
|
14
|
+
import { DEFAULT_MAX_BYTES, OutputSink, type OutputSummary, TailBuffer } from "../session/streaming-output";
|
|
15
|
+
import { getTreeBranch, getTreeContinuePrefix, renderCodeCell } from "../tui";
|
|
16
|
+
import { resolveEvalBackends, type ToolSession } from ".";
|
|
17
|
+
import {
|
|
18
|
+
formatStyledTruncationWarning,
|
|
19
|
+
resolveOutputMaxColumns,
|
|
20
|
+
resolveOutputSinkHeadBytes,
|
|
21
|
+
stripOutputNotice,
|
|
22
|
+
} from "./output-meta";
|
|
23
|
+
import { formatTitle, replaceTabs, shortenPath, truncateToWidth, wrapBrackets } from "./render-utils";
|
|
24
|
+
import { ToolAbortError, ToolError } from "./tool-errors";
|
|
25
|
+
import { toolResult } from "./tool-result";
|
|
26
|
+
import { clampTimeout } from "./tool-timeouts";
|
|
27
|
+
|
|
28
|
+
export const EVAL_DEFAULT_PREVIEW_LINES = 10;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Per-cell input. Each cell runs in order; state persists within a language
|
|
32
|
+
* across cells and across tool calls.
|
|
33
|
+
*/
|
|
34
|
+
const evalCellSchema = z.object({
|
|
35
|
+
language: z.enum(["py", "js"]).describe('runtime: "py" for the IPython kernel, "js" for the persistent JS VM'),
|
|
36
|
+
code: z.string().describe("cell body, verbatim. Use top-level await freely."),
|
|
37
|
+
title: z.string().optional().describe('short label shown in transcript (e.g. "imports", "load config")'),
|
|
38
|
+
timeout: z.number().int().min(1).max(600).optional().describe("per-cell timeout in seconds (1-600, default 30)"),
|
|
39
|
+
reset: z
|
|
40
|
+
.boolean()
|
|
41
|
+
.optional()
|
|
42
|
+
.describe("wipe this cell's language kernel before running. Other languages are untouched."),
|
|
43
|
+
});
|
|
44
|
+
export type EvalCellInput = z.infer<typeof evalCellSchema>;
|
|
45
|
+
|
|
46
|
+
export const evalSchema = z.object({
|
|
47
|
+
cells: z
|
|
48
|
+
.array(evalCellSchema)
|
|
49
|
+
.min(1)
|
|
50
|
+
.describe("cells executed in order. State persists within each language across cells and tool calls."),
|
|
51
|
+
});
|
|
52
|
+
export type EvalToolParams = z.infer<typeof evalSchema>;
|
|
53
|
+
|
|
54
|
+
export type EvalToolResult = {
|
|
55
|
+
content: Array<{ type: "text"; text: string }>;
|
|
56
|
+
details: EvalToolDetails | undefined;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export type EvalProxyExecutor = (params: EvalToolParams, signal?: AbortSignal) => Promise<EvalToolResult>;
|
|
60
|
+
|
|
61
|
+
function formatJsonScalar(value: unknown): string {
|
|
62
|
+
if (value === null) return "null";
|
|
63
|
+
if (value === undefined) return "undefined";
|
|
64
|
+
if (typeof value === "string") return JSON.stringify(value);
|
|
65
|
+
if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") return String(value);
|
|
66
|
+
if (typeof value === "function") return "[function]";
|
|
67
|
+
return "[object]";
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Cap per `display()` value sent back to the model. */
|
|
71
|
+
const MAX_DISPLAY_TEXT_BYTES = 8000;
|
|
72
|
+
|
|
73
|
+
function formatDisplayJsonForText(value: unknown): string {
|
|
74
|
+
let text: string;
|
|
75
|
+
try {
|
|
76
|
+
text = JSON.stringify(value, null, 2) ?? String(value);
|
|
77
|
+
} catch {
|
|
78
|
+
text = String(value);
|
|
79
|
+
}
|
|
80
|
+
if (text.length > MAX_DISPLAY_TEXT_BYTES) {
|
|
81
|
+
text = `${text.slice(0, MAX_DISPLAY_TEXT_BYTES)}\n… (${text.length - MAX_DISPLAY_TEXT_BYTES} chars truncated)`;
|
|
82
|
+
}
|
|
83
|
+
return text;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Format display() JSON values into text the model can see. Images are surfaced
|
|
88
|
+
* separately as ImageContent so the model can actually inspect them; this helper
|
|
89
|
+
* intentionally does not touch images.
|
|
90
|
+
*/
|
|
91
|
+
function formatDisplayOutputsForText(outputs: EvalDisplayOutput[]): string {
|
|
92
|
+
const chunks: string[] = [];
|
|
93
|
+
let displayIndex = 0;
|
|
94
|
+
for (const output of outputs) {
|
|
95
|
+
if (output.type !== "json") continue;
|
|
96
|
+
displayIndex++;
|
|
97
|
+
chunks.push(`display[${displayIndex}]:\n${formatDisplayJsonForText(output.data)}`);
|
|
98
|
+
}
|
|
99
|
+
return chunks.join("\n\n");
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function renderJsonTree(value: unknown, theme: Theme, expanded: boolean, maxDepth = expanded ? 6 : 2): string[] {
|
|
103
|
+
const maxItems = expanded ? 20 : 5;
|
|
104
|
+
|
|
105
|
+
const renderNode = (node: unknown, prefix: string, depth: number, isLast: boolean, label?: string): string[] => {
|
|
106
|
+
const branch = getTreeBranch(isLast, theme);
|
|
107
|
+
const displayLabel = label ? `${label}: ` : "";
|
|
108
|
+
|
|
109
|
+
if (depth >= maxDepth || node === null || typeof node !== "object") {
|
|
110
|
+
return [`${prefix}${branch} ${displayLabel}${formatJsonScalar(node)}`];
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const isArray = Array.isArray(node);
|
|
114
|
+
const entries = isArray
|
|
115
|
+
? node.map((val, index) => [String(index), val] as const)
|
|
116
|
+
: Object.entries(node as object);
|
|
117
|
+
const header = `${prefix}${branch} ${displayLabel}${isArray ? `Array(${entries.length})` : `Object(${entries.length})`}`;
|
|
118
|
+
const lines = [header];
|
|
119
|
+
|
|
120
|
+
const childPrefix = prefix + getTreeContinuePrefix(isLast, theme);
|
|
121
|
+
const visible = entries.slice(0, maxItems);
|
|
122
|
+
for (let i = 0; i < visible.length; i++) {
|
|
123
|
+
const [key, val] = visible[i];
|
|
124
|
+
const childLast = i === visible.length - 1 && (expanded || entries.length <= maxItems);
|
|
125
|
+
lines.push(...renderNode(val, childPrefix, depth + 1, childLast, isArray ? `[${key}]` : key));
|
|
126
|
+
}
|
|
127
|
+
if (!expanded && entries.length > maxItems) {
|
|
128
|
+
const moreBranch = theme.tree.last;
|
|
129
|
+
lines.push(`${childPrefix}${moreBranch} ${entries.length - maxItems} more item(s)`);
|
|
130
|
+
}
|
|
131
|
+
return lines;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
return renderNode(value, "", 0, true);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface EvalToolDescriptionOptions {
|
|
138
|
+
py?: boolean;
|
|
139
|
+
js?: boolean;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export function getEvalToolDescription(options: EvalToolDescriptionOptions = {}): string {
|
|
143
|
+
const py = options.py ?? true;
|
|
144
|
+
const js = options.js ?? true;
|
|
145
|
+
return prompt.render(evalDescription, { py, js });
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export interface EvalToolOptions {
|
|
149
|
+
proxyExecutor?: EvalProxyExecutor;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
interface ResolvedBackend {
|
|
153
|
+
backend: ExecutorBackend;
|
|
154
|
+
notice?: string;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
interface ResolvedEvalCell {
|
|
158
|
+
index: number;
|
|
159
|
+
title?: string;
|
|
160
|
+
code: string;
|
|
161
|
+
timeoutMs: number;
|
|
162
|
+
reset: boolean;
|
|
163
|
+
resolved: ResolvedBackend;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function uniqueEvalLanguages(cells: ResolvedEvalCell[]): EvalLanguage[] {
|
|
167
|
+
return [...new Set(cells.map(cell => cell.resolved.backend.id))];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function detailsNotice(cells: ResolvedEvalCell[]): string | undefined {
|
|
171
|
+
const notices = [
|
|
172
|
+
...new Set(cells.map(cell => cell.resolved.notice).filter((notice): notice is string => Boolean(notice))),
|
|
173
|
+
];
|
|
174
|
+
return notices.length > 0 ? notices.join(" ") : undefined;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function languageForHighlighter(language: EvalLanguage | undefined): "python" | "javascript" {
|
|
178
|
+
return language === "js" ? "javascript" : "python";
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function timeoutSecondsFromMs(timeoutMs: number): number {
|
|
182
|
+
return clampTimeout("eval", timeoutMs / 1000);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
async function resolveBackend(session: ToolSession, language: EvalLanguage): Promise<ResolvedBackend> {
|
|
186
|
+
const allowPy = (session.settings.get("eval.py") as boolean | undefined) ?? true;
|
|
187
|
+
const allowJs = (session.settings.get("eval.js") as boolean | undefined) ?? true;
|
|
188
|
+
|
|
189
|
+
if (language === "python") {
|
|
190
|
+
if (!allowPy) throw new ToolError("Python backend is disabled (eval.py = false).");
|
|
191
|
+
if (!(await pythonBackend.isAvailable(session))) {
|
|
192
|
+
throw new ToolError(
|
|
193
|
+
'Python backend is unavailable in this session. Pass language: "js" or install the python kernel.',
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
return { backend: pythonBackend };
|
|
197
|
+
}
|
|
198
|
+
if (!allowJs) throw new ToolError("JavaScript backend is disabled (eval.js = false).");
|
|
199
|
+
return { backend: jsBackend };
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export class EvalTool implements AgentTool<typeof evalSchema> {
|
|
203
|
+
readonly name = "eval";
|
|
204
|
+
readonly summary = "Execute Python or JavaScript code in an in-process eval backend";
|
|
205
|
+
readonly loadMode = "discoverable";
|
|
206
|
+
readonly label = "Eval";
|
|
207
|
+
get description(): string {
|
|
208
|
+
if (!this.session) return getEvalToolDescription();
|
|
209
|
+
const backends = resolveEvalBackends(this.session);
|
|
210
|
+
return getEvalToolDescription({ py: backends.python, js: backends.js });
|
|
211
|
+
}
|
|
212
|
+
readonly parameters = evalSchema;
|
|
213
|
+
readonly concurrency = "exclusive";
|
|
214
|
+
readonly strict = true;
|
|
215
|
+
readonly intent = (args: Partial<z.infer<typeof evalSchema>>): string | undefined => {
|
|
216
|
+
const cells = Array.isArray(args.cells) ? args.cells : [];
|
|
217
|
+
const first = cells.find(c => c && typeof c === "object");
|
|
218
|
+
if (!first) return "evaluating";
|
|
219
|
+
const title = typeof first.title === "string" ? first.title : undefined;
|
|
220
|
+
const language = typeof first.language === "string" ? first.language : "?";
|
|
221
|
+
const label = title || `running ${language}`;
|
|
222
|
+
return cells.length > 1 ? `${label} (+${cells.length - 1})` : label;
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
readonly #proxyExecutor?: EvalProxyExecutor;
|
|
226
|
+
|
|
227
|
+
constructor(
|
|
228
|
+
private readonly session: ToolSession | null,
|
|
229
|
+
options?: EvalToolOptions,
|
|
230
|
+
) {
|
|
231
|
+
this.#proxyExecutor = options?.proxyExecutor;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
async execute(
|
|
235
|
+
_toolCallId: string,
|
|
236
|
+
params: z.infer<typeof evalSchema>,
|
|
237
|
+
signal?: AbortSignal,
|
|
238
|
+
onUpdate?: AgentToolUpdateCallback,
|
|
239
|
+
_ctx?: AgentToolContext,
|
|
240
|
+
): Promise<AgentToolResult<EvalToolDetails | undefined>> {
|
|
241
|
+
if (this.#proxyExecutor) {
|
|
242
|
+
return this.#proxyExecutor(params, signal);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if (!this.session) {
|
|
246
|
+
throw new ToolError("Eval tool requires a session when not using proxy executor");
|
|
247
|
+
}
|
|
248
|
+
const session = this.session;
|
|
249
|
+
|
|
250
|
+
const cells: ResolvedEvalCell[] = [];
|
|
251
|
+
for (let i = 0; i < params.cells.length; i++) {
|
|
252
|
+
const cell = params.cells[i];
|
|
253
|
+
const language: EvalLanguage = cell.language === "py" ? "python" : "js";
|
|
254
|
+
const resolved = await resolveBackend(session, language);
|
|
255
|
+
cells.push({
|
|
256
|
+
index: i,
|
|
257
|
+
title: cell.title,
|
|
258
|
+
code: cell.code,
|
|
259
|
+
timeoutMs: (cell.timeout ?? 30) * 1000,
|
|
260
|
+
reset: cell.reset ?? false,
|
|
261
|
+
resolved,
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
const languages = uniqueEvalLanguages(cells);
|
|
265
|
+
const notice = detailsNotice(cells);
|
|
266
|
+
const sessionAbortController = new AbortController();
|
|
267
|
+
let outputSink: OutputSink | undefined;
|
|
268
|
+
let outputSummary: OutputSummary | undefined;
|
|
269
|
+
let outputDumped = false;
|
|
270
|
+
const finalizeOutput = async (): Promise<OutputSummary | undefined> => {
|
|
271
|
+
if (outputDumped || !outputSink) return outputSummary;
|
|
272
|
+
outputSummary = await outputSink.dump();
|
|
273
|
+
outputDumped = true;
|
|
274
|
+
return outputSummary;
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
const execution = (async (): Promise<AgentToolResult<EvalToolDetails | undefined>> => {
|
|
278
|
+
try {
|
|
279
|
+
if (signal?.aborted) {
|
|
280
|
+
throw new ToolAbortError();
|
|
281
|
+
}
|
|
282
|
+
session.assertEvalExecutionAllowed?.();
|
|
283
|
+
|
|
284
|
+
const tailBuffer = new TailBuffer(DEFAULT_MAX_BYTES * 2);
|
|
285
|
+
const jsonOutputs: unknown[] = [];
|
|
286
|
+
const images: ImageContent[] = [];
|
|
287
|
+
const statusEvents: EvalStatusEvent[] = [];
|
|
288
|
+
|
|
289
|
+
const cellResults: EvalCellResult[] = cells.map(cell => ({
|
|
290
|
+
index: cell.index,
|
|
291
|
+
title: cell.title,
|
|
292
|
+
code: cell.code,
|
|
293
|
+
language: cell.resolved.backend.id,
|
|
294
|
+
output: "",
|
|
295
|
+
status: "pending",
|
|
296
|
+
}));
|
|
297
|
+
const cellOutputs: string[] = [];
|
|
298
|
+
|
|
299
|
+
const appendTail = (text: string) => {
|
|
300
|
+
tailBuffer.append(text);
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
const buildUpdateDetails = (): EvalToolDetails => {
|
|
304
|
+
const details: EvalToolDetails = {
|
|
305
|
+
language: languages[0],
|
|
306
|
+
languages,
|
|
307
|
+
cells: cellResults.map(cell => ({
|
|
308
|
+
...cell,
|
|
309
|
+
statusEvents: cell.statusEvents ? [...cell.statusEvents] : undefined,
|
|
310
|
+
})),
|
|
311
|
+
};
|
|
312
|
+
if (jsonOutputs.length > 0) {
|
|
313
|
+
details.jsonOutputs = jsonOutputs;
|
|
314
|
+
}
|
|
315
|
+
if (images.length > 0) {
|
|
316
|
+
details.images = images;
|
|
317
|
+
}
|
|
318
|
+
if (statusEvents.length > 0) {
|
|
319
|
+
details.statusEvents = statusEvents;
|
|
320
|
+
}
|
|
321
|
+
if (notice) {
|
|
322
|
+
details.notice = notice;
|
|
323
|
+
}
|
|
324
|
+
return details;
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
const pushUpdate = () => {
|
|
328
|
+
if (!onUpdate) return;
|
|
329
|
+
const tailText = tailBuffer.text();
|
|
330
|
+
onUpdate({
|
|
331
|
+
content: [{ type: "text", text: tailText }],
|
|
332
|
+
details: buildUpdateDetails(),
|
|
333
|
+
});
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
const sessionFile = session.getSessionFile?.() ?? undefined;
|
|
337
|
+
const kernelOwnerId = session.getEvalKernelOwnerId?.() ?? undefined;
|
|
338
|
+
const { path: artifactPath, id: artifactId } = (await session.allocateOutputArtifact?.("eval")) ?? {};
|
|
339
|
+
session.assertEvalExecutionAllowed?.();
|
|
340
|
+
outputSink = new OutputSink({
|
|
341
|
+
artifactPath,
|
|
342
|
+
artifactId,
|
|
343
|
+
headBytes: resolveOutputSinkHeadBytes(session.settings),
|
|
344
|
+
maxColumns: resolveOutputMaxColumns(session.settings),
|
|
345
|
+
onChunk: chunk => {
|
|
346
|
+
appendTail(chunk);
|
|
347
|
+
pushUpdate();
|
|
348
|
+
},
|
|
349
|
+
});
|
|
350
|
+
const sessionId = sessionFile ? `session:${sessionFile}:cwd:${session.cwd}` : `cwd:${session.cwd}`;
|
|
351
|
+
|
|
352
|
+
for (let i = 0; i < cells.length; i++) {
|
|
353
|
+
const cell = cells[i];
|
|
354
|
+
const backend = cell.resolved.backend;
|
|
355
|
+
const timeoutSec = timeoutSecondsFromMs(cell.timeoutMs);
|
|
356
|
+
const deadlineMs = Date.now() + timeoutSec * 1000;
|
|
357
|
+
const timeoutSignal = AbortSignal.timeout(Math.max(0, deadlineMs - Date.now()));
|
|
358
|
+
const combinedSignal = signal
|
|
359
|
+
? AbortSignal.any([signal, timeoutSignal, sessionAbortController.signal])
|
|
360
|
+
: AbortSignal.any([timeoutSignal, sessionAbortController.signal]);
|
|
361
|
+
|
|
362
|
+
const cellResult = cellResults[i];
|
|
363
|
+
cellResult.status = "running";
|
|
364
|
+
cellResult.output = "";
|
|
365
|
+
cellResult.statusEvents = undefined;
|
|
366
|
+
cellResult.exitCode = undefined;
|
|
367
|
+
cellResult.durationMs = undefined;
|
|
368
|
+
pushUpdate();
|
|
369
|
+
|
|
370
|
+
const startTime = Date.now();
|
|
371
|
+
const result = await backend.execute(cell.code, {
|
|
372
|
+
cwd: session.cwd,
|
|
373
|
+
sessionId,
|
|
374
|
+
sessionFile: sessionFile ?? undefined,
|
|
375
|
+
kernelOwnerId,
|
|
376
|
+
signal: combinedSignal,
|
|
377
|
+
session,
|
|
378
|
+
deadlineMs,
|
|
379
|
+
reset: cell.reset,
|
|
380
|
+
artifactPath,
|
|
381
|
+
artifactId,
|
|
382
|
+
onChunk: chunk => {
|
|
383
|
+
outputSink!.push(chunk);
|
|
384
|
+
},
|
|
385
|
+
});
|
|
386
|
+
const durationMs = Date.now() - startTime;
|
|
387
|
+
|
|
388
|
+
const cellStatusEvents: EvalStatusEvent[] = [];
|
|
389
|
+
const cellDisplayOutputs: EvalDisplayOutput[] = [];
|
|
390
|
+
let cellHasMarkdown = false;
|
|
391
|
+
for (const output of result.displayOutputs) {
|
|
392
|
+
if (output.type === "json") {
|
|
393
|
+
jsonOutputs.push(output.data);
|
|
394
|
+
cellDisplayOutputs.push(output);
|
|
395
|
+
}
|
|
396
|
+
if (output.type === "image") {
|
|
397
|
+
images.push({ type: "image", data: output.data, mimeType: output.mimeType });
|
|
398
|
+
cellDisplayOutputs.push(output);
|
|
399
|
+
}
|
|
400
|
+
if (output.type === "status") {
|
|
401
|
+
statusEvents.push(output.event);
|
|
402
|
+
cellStatusEvents.push(output.event);
|
|
403
|
+
}
|
|
404
|
+
if (output.type === "markdown") {
|
|
405
|
+
cellHasMarkdown = true;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
const stdoutTrimmed = result.output.trim();
|
|
410
|
+
const displayText = formatDisplayOutputsForText(cellDisplayOutputs);
|
|
411
|
+
const cellOutput =
|
|
412
|
+
stdoutTrimmed && displayText ? `${stdoutTrimmed}\n\n${displayText}` : stdoutTrimmed || displayText;
|
|
413
|
+
cellResult.output = cellOutput;
|
|
414
|
+
cellResult.exitCode = result.exitCode;
|
|
415
|
+
cellResult.durationMs = durationMs;
|
|
416
|
+
cellResult.statusEvents = cellStatusEvents.length > 0 ? cellStatusEvents : undefined;
|
|
417
|
+
cellResult.hasMarkdown = cellHasMarkdown || undefined;
|
|
418
|
+
|
|
419
|
+
let combinedCellOutput = "";
|
|
420
|
+
if (cells.length > 1) {
|
|
421
|
+
const cellHeader = `[${i + 1}/${cells.length}]`;
|
|
422
|
+
const cellTitle = cell.title ? ` ${cell.title}` : "";
|
|
423
|
+
if (cellOutput) {
|
|
424
|
+
combinedCellOutput = `${cellHeader}${cellTitle}\n${cellOutput}`;
|
|
425
|
+
} else {
|
|
426
|
+
combinedCellOutput = `${cellHeader}${cellTitle} (ok)`;
|
|
427
|
+
}
|
|
428
|
+
cellOutputs.push(combinedCellOutput);
|
|
429
|
+
} else if (cellOutput) {
|
|
430
|
+
combinedCellOutput = cellOutput;
|
|
431
|
+
cellOutputs.push(combinedCellOutput);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
if (combinedCellOutput) {
|
|
435
|
+
const prefix = cellOutputs.length > 1 ? "\n\n" : "";
|
|
436
|
+
appendTail(`${prefix}${combinedCellOutput}`);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
if (result.cancelled) {
|
|
440
|
+
cellResult.status = "error";
|
|
441
|
+
pushUpdate();
|
|
442
|
+
const errorMsg = result.output || "Command aborted";
|
|
443
|
+
const combinedOutput = cellOutputs.join("\n\n");
|
|
444
|
+
const outputText =
|
|
445
|
+
cells.length > 1
|
|
446
|
+
? `${combinedOutput}\n\nCell ${i + 1} aborted: ${errorMsg}`
|
|
447
|
+
: combinedOutput || errorMsg;
|
|
448
|
+
|
|
449
|
+
const summaryForMeta = await summarizeFinal(combinedOutput, finalizeOutput);
|
|
450
|
+
const details: EvalToolDetails = {
|
|
451
|
+
language: languages[0],
|
|
452
|
+
languages,
|
|
453
|
+
cells: cellResults,
|
|
454
|
+
jsonOutputs: jsonOutputs.length > 0 ? jsonOutputs : undefined,
|
|
455
|
+
statusEvents: statusEvents.length > 0 ? statusEvents : undefined,
|
|
456
|
+
isError: true,
|
|
457
|
+
};
|
|
458
|
+
if (notice) details.notice = notice;
|
|
459
|
+
|
|
460
|
+
return toolResult(details)
|
|
461
|
+
.content([{ type: "text", text: outputText }, ...images])
|
|
462
|
+
.truncationFromSummary(summaryForMeta, { direction: "tail" })
|
|
463
|
+
.done();
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
if (result.exitCode !== 0 && result.exitCode !== undefined) {
|
|
467
|
+
cellResult.status = "error";
|
|
468
|
+
pushUpdate();
|
|
469
|
+
const combinedOutput = cellOutputs.join("\n\n");
|
|
470
|
+
const outputText =
|
|
471
|
+
cells.length > 1
|
|
472
|
+
? `${combinedOutput}\n\nCell ${i + 1} failed (exit code ${result.exitCode}). Earlier cells succeeded—their state persists. Fix only cell ${i + 1}.`
|
|
473
|
+
: combinedOutput
|
|
474
|
+
? `${combinedOutput}\n\nCommand exited with code ${result.exitCode}`
|
|
475
|
+
: `Command exited with code ${result.exitCode}`;
|
|
476
|
+
|
|
477
|
+
const summaryForMeta = await summarizeFinal(combinedOutput, finalizeOutput);
|
|
478
|
+
const details: EvalToolDetails = {
|
|
479
|
+
language: languages[0],
|
|
480
|
+
languages,
|
|
481
|
+
cells: cellResults,
|
|
482
|
+
jsonOutputs: jsonOutputs.length > 0 ? jsonOutputs : undefined,
|
|
483
|
+
statusEvents: statusEvents.length > 0 ? statusEvents : undefined,
|
|
484
|
+
isError: true,
|
|
485
|
+
};
|
|
486
|
+
if (notice) details.notice = notice;
|
|
487
|
+
|
|
488
|
+
return toolResult(details)
|
|
489
|
+
.content([{ type: "text", text: outputText }, ...images])
|
|
490
|
+
.truncationFromSummary(summaryForMeta, { direction: "tail" })
|
|
491
|
+
.done();
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
cellResult.status = "complete";
|
|
495
|
+
pushUpdate();
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
const combinedOutput = cellOutputs.join("\n\n");
|
|
499
|
+
const hasImages = images.length > 0;
|
|
500
|
+
const outputText =
|
|
501
|
+
combinedOutput ||
|
|
502
|
+
(hasImages
|
|
503
|
+
? `(displayed ${images.length} image${images.length === 1 ? "" : "s"}; no text output)`
|
|
504
|
+
: "(no output)");
|
|
505
|
+
const summaryForMeta = await summarizeFinal(combinedOutput, finalizeOutput);
|
|
506
|
+
|
|
507
|
+
const details: EvalToolDetails = {
|
|
508
|
+
language: languages[0],
|
|
509
|
+
languages,
|
|
510
|
+
cells: cellResults,
|
|
511
|
+
jsonOutputs: jsonOutputs.length > 0 ? jsonOutputs : undefined,
|
|
512
|
+
statusEvents: statusEvents.length > 0 ? statusEvents : undefined,
|
|
513
|
+
};
|
|
514
|
+
if (notice) details.notice = notice;
|
|
515
|
+
|
|
516
|
+
return toolResult(details)
|
|
517
|
+
.content([{ type: "text", text: outputText }, ...images])
|
|
518
|
+
.truncationFromSummary(summaryForMeta, { direction: "tail" })
|
|
519
|
+
.done();
|
|
520
|
+
} finally {
|
|
521
|
+
if (!outputDumped) {
|
|
522
|
+
try {
|
|
523
|
+
await finalizeOutput();
|
|
524
|
+
} catch {}
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
})();
|
|
528
|
+
|
|
529
|
+
return await (session.trackEvalExecution?.(execution, sessionAbortController) ?? execution);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
async function summarizeFinal(
|
|
534
|
+
combinedOutput: string,
|
|
535
|
+
finalizeOutput: () => Promise<OutputSummary | undefined>,
|
|
536
|
+
): Promise<OutputSummary> {
|
|
537
|
+
const rawSummary = (await finalizeOutput()) ?? {
|
|
538
|
+
output: "",
|
|
539
|
+
truncated: false,
|
|
540
|
+
totalLines: 0,
|
|
541
|
+
totalBytes: 0,
|
|
542
|
+
outputLines: 0,
|
|
543
|
+
outputBytes: 0,
|
|
544
|
+
};
|
|
545
|
+
const outputLines = combinedOutput.length > 0 ? combinedOutput.split("\n").length : 0;
|
|
546
|
+
const outputBytes = Buffer.byteLength(combinedOutput, "utf-8");
|
|
547
|
+
const missingLines = Math.max(0, rawSummary.totalLines - rawSummary.outputLines);
|
|
548
|
+
const missingBytes = Math.max(0, rawSummary.totalBytes - rawSummary.outputBytes);
|
|
549
|
+
return {
|
|
550
|
+
output: combinedOutput,
|
|
551
|
+
truncated: rawSummary.truncated,
|
|
552
|
+
totalLines: outputLines + missingLines,
|
|
553
|
+
totalBytes: outputBytes + missingBytes,
|
|
554
|
+
outputLines,
|
|
555
|
+
outputBytes,
|
|
556
|
+
artifactId: rawSummary.artifactId,
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
interface EvalRenderCellArg {
|
|
561
|
+
language?: string;
|
|
562
|
+
code?: string;
|
|
563
|
+
title?: string;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
interface EvalRenderArgs {
|
|
567
|
+
cells?: EvalRenderCellArg[];
|
|
568
|
+
__partialJson?: string;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
interface EvalRenderContext {
|
|
572
|
+
output?: string;
|
|
573
|
+
expanded?: boolean;
|
|
574
|
+
previewLines?: number;
|
|
575
|
+
timeout?: number;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
interface EvalRenderCell {
|
|
579
|
+
language: EvalLanguage;
|
|
580
|
+
code: string;
|
|
581
|
+
title?: string;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
function normalizeRenderLanguage(value: string | undefined): EvalLanguage {
|
|
585
|
+
return value === "js" ? "js" : "python";
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
function getRenderCells(args: EvalRenderArgs | undefined): EvalRenderCell[] {
|
|
589
|
+
const raw = args?.cells;
|
|
590
|
+
if (!Array.isArray(raw)) return [];
|
|
591
|
+
const out: EvalRenderCell[] = [];
|
|
592
|
+
for (const cell of raw) {
|
|
593
|
+
if (!cell || typeof cell !== "object") continue;
|
|
594
|
+
const code = typeof cell.code === "string" ? cell.code : "";
|
|
595
|
+
out.push({
|
|
596
|
+
language: normalizeRenderLanguage(typeof cell.language === "string" ? cell.language : undefined),
|
|
597
|
+
code,
|
|
598
|
+
title: typeof cell.title === "string" ? cell.title : undefined,
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
return out;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
/** Format a status event as a single line for display. */
|
|
605
|
+
function formatStatusEvent(event: EvalStatusEvent, theme: Theme): string {
|
|
606
|
+
const { op, ...data } = event;
|
|
607
|
+
|
|
608
|
+
type AvailableIcon = "icon.file" | "icon.folder" | "icon.git" | "icon.package";
|
|
609
|
+
const opIcons: Record<string, AvailableIcon> = {
|
|
610
|
+
read: "icon.file",
|
|
611
|
+
write: "icon.file",
|
|
612
|
+
append: "icon.file",
|
|
613
|
+
cat: "icon.file",
|
|
614
|
+
touch: "icon.file",
|
|
615
|
+
ls: "icon.folder",
|
|
616
|
+
cd: "icon.folder",
|
|
617
|
+
pwd: "icon.folder",
|
|
618
|
+
mkdir: "icon.folder",
|
|
619
|
+
tree: "icon.folder",
|
|
620
|
+
git_status: "icon.git",
|
|
621
|
+
git_diff: "icon.git",
|
|
622
|
+
git_log: "icon.git",
|
|
623
|
+
git_show: "icon.git",
|
|
624
|
+
git_branch: "icon.git",
|
|
625
|
+
git_file_at: "icon.git",
|
|
626
|
+
git_has_changes: "icon.git",
|
|
627
|
+
run: "icon.package",
|
|
628
|
+
sh: "icon.package",
|
|
629
|
+
env: "icon.package",
|
|
630
|
+
batch: "icon.package",
|
|
631
|
+
};
|
|
632
|
+
|
|
633
|
+
const iconKey = opIcons[op] ?? "icon.file";
|
|
634
|
+
const icon = theme.styledSymbol(iconKey, "muted");
|
|
635
|
+
|
|
636
|
+
const parts: string[] = [];
|
|
637
|
+
|
|
638
|
+
if (data.error) {
|
|
639
|
+
return `${icon} ${theme.fg("warning", op)}: ${theme.fg("dim", String(data.error))}`;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
switch (op) {
|
|
643
|
+
case "read":
|
|
644
|
+
parts.push(`${data.chars ?? data.bytes ?? 0} chars`);
|
|
645
|
+
if (data.path) parts.push(`from ${shortenPath(String(data.path))}`);
|
|
646
|
+
break;
|
|
647
|
+
case "write":
|
|
648
|
+
case "append":
|
|
649
|
+
parts.push(`${data.chars ?? data.bytes ?? 0} chars`);
|
|
650
|
+
if (data.path) parts.push(`to ${shortenPath(String(data.path))}`);
|
|
651
|
+
break;
|
|
652
|
+
case "cat":
|
|
653
|
+
parts.push(`${data.files} file${(data.files as number) !== 1 ? "s" : ""}`);
|
|
654
|
+
parts.push(`${data.chars} chars`);
|
|
655
|
+
break;
|
|
656
|
+
case "ls":
|
|
657
|
+
parts.push(`${data.count} entr${(data.count as number) !== 1 ? "ies" : "y"}`);
|
|
658
|
+
break;
|
|
659
|
+
case "env":
|
|
660
|
+
if (data.action === "set") {
|
|
661
|
+
parts.push(`set ${data.key}=${truncateToWidth(String(data.value ?? ""), 30)}`);
|
|
662
|
+
} else if (data.action === "get") {
|
|
663
|
+
parts.push(`${data.key}=${truncateToWidth(String(data.value ?? ""), 30)}`);
|
|
664
|
+
} else {
|
|
665
|
+
parts.push(`${data.count} variable${(data.count as number) !== 1 ? "s" : ""}`);
|
|
666
|
+
}
|
|
667
|
+
break;
|
|
668
|
+
case "git_status":
|
|
669
|
+
if (data.clean) {
|
|
670
|
+
parts.push("clean");
|
|
671
|
+
} else {
|
|
672
|
+
const statusParts: string[] = [];
|
|
673
|
+
if (data.staged) statusParts.push(`${data.staged} staged`);
|
|
674
|
+
if (data.modified) statusParts.push(`${data.modified} modified`);
|
|
675
|
+
if (data.untracked) statusParts.push(`${data.untracked} untracked`);
|
|
676
|
+
parts.push(statusParts.join(", ") || "unknown");
|
|
677
|
+
}
|
|
678
|
+
if (data.branch) parts.push(`on ${data.branch}`);
|
|
679
|
+
break;
|
|
680
|
+
case "git_log":
|
|
681
|
+
parts.push(`${data.commits} commit${(data.commits as number) !== 1 ? "s" : ""}`);
|
|
682
|
+
break;
|
|
683
|
+
case "git_diff":
|
|
684
|
+
parts.push(`${data.lines} line${(data.lines as number) !== 1 ? "s" : ""}`);
|
|
685
|
+
if (data.staged) parts.push("(staged)");
|
|
686
|
+
break;
|
|
687
|
+
case "diff":
|
|
688
|
+
if (data.identical) {
|
|
689
|
+
parts.push("files identical");
|
|
690
|
+
} else {
|
|
691
|
+
parts.push("files differ");
|
|
692
|
+
}
|
|
693
|
+
break;
|
|
694
|
+
case "batch":
|
|
695
|
+
parts.push(`${data.files} file${(data.files as number) !== 1 ? "s" : ""} processed`);
|
|
696
|
+
break;
|
|
697
|
+
case "wc":
|
|
698
|
+
parts.push(`${data.lines}L ${data.words}W ${data.chars}C`);
|
|
699
|
+
break;
|
|
700
|
+
case "cd":
|
|
701
|
+
case "pwd":
|
|
702
|
+
case "mkdir":
|
|
703
|
+
case "touch":
|
|
704
|
+
if (data.path) parts.push(shortenPath(String(data.path)));
|
|
705
|
+
break;
|
|
706
|
+
default:
|
|
707
|
+
if (data.count !== undefined) {
|
|
708
|
+
parts.push(String(data.count));
|
|
709
|
+
}
|
|
710
|
+
if (data.path) {
|
|
711
|
+
parts.push(shortenPath(String(data.path)));
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
const desc = parts.length > 0 ? parts.join(" · ") : "";
|
|
716
|
+
return `${icon} ${theme.fg("muted", op)}${desc ? ` ${theme.fg("dim", desc)}` : ""}`;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
/** Format status event with expanded detail lines. */
|
|
720
|
+
function formatStatusEventExpanded(event: EvalStatusEvent, theme: Theme): string[] {
|
|
721
|
+
const lines: string[] = [];
|
|
722
|
+
const { op, ...data } = event;
|
|
723
|
+
|
|
724
|
+
lines.push(formatStatusEvent(event, theme));
|
|
725
|
+
|
|
726
|
+
const addItems = (items: unknown[], formatter: (item: unknown) => string, max = 5) => {
|
|
727
|
+
const arr = Array.isArray(items) ? items : [];
|
|
728
|
+
for (let i = 0; i < Math.min(arr.length, max); i++) {
|
|
729
|
+
lines.push(` ${theme.fg("dim", formatter(arr[i]))}`);
|
|
730
|
+
}
|
|
731
|
+
if (arr.length > max) {
|
|
732
|
+
lines.push(` ${theme.fg("dim", `… ${arr.length - max} more`)}`);
|
|
733
|
+
}
|
|
734
|
+
};
|
|
735
|
+
|
|
736
|
+
const addPreview = (preview: string, maxLines = 3) => {
|
|
737
|
+
const previewLines = String(preview).split("\n").slice(0, maxLines);
|
|
738
|
+
for (const line of previewLines) {
|
|
739
|
+
lines.push(` ${theme.fg("toolOutput", truncateToWidth(replaceTabs(line), 80))}`);
|
|
740
|
+
}
|
|
741
|
+
const totalLines = String(preview).split("\n").length;
|
|
742
|
+
if (totalLines > maxLines) {
|
|
743
|
+
lines.push(` ${theme.fg("dim", `… ${totalLines - maxLines} more lines`)}`);
|
|
744
|
+
}
|
|
745
|
+
};
|
|
746
|
+
|
|
747
|
+
switch (op) {
|
|
748
|
+
case "ls":
|
|
749
|
+
if (data.items) addItems(data.items as unknown[], m => String(m));
|
|
750
|
+
break;
|
|
751
|
+
case "env":
|
|
752
|
+
if (data.keys) addItems(data.keys as unknown[], k => String(k), 10);
|
|
753
|
+
break;
|
|
754
|
+
case "git_log":
|
|
755
|
+
if (data.entries) {
|
|
756
|
+
addItems(data.entries as unknown[], e => {
|
|
757
|
+
const entry = e as { sha: string; subject: string };
|
|
758
|
+
return `${entry.sha} ${truncateToWidth(entry.subject, 50)}`;
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
break;
|
|
762
|
+
case "git_status":
|
|
763
|
+
if (data.files) addItems(data.files as unknown[], f => String(f));
|
|
764
|
+
break;
|
|
765
|
+
case "git_branch":
|
|
766
|
+
if (data.branches) addItems(data.branches as unknown[], b => String(b));
|
|
767
|
+
break;
|
|
768
|
+
case "read":
|
|
769
|
+
case "cat":
|
|
770
|
+
case "head":
|
|
771
|
+
case "tail":
|
|
772
|
+
case "tree":
|
|
773
|
+
case "diff":
|
|
774
|
+
case "git_diff":
|
|
775
|
+
case "sh":
|
|
776
|
+
if (data.preview) addPreview(String(data.preview));
|
|
777
|
+
break;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
return lines;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
/** Render status events as tree lines. */
|
|
784
|
+
function renderStatusEvents(events: EvalStatusEvent[], theme: Theme, expanded: boolean): string[] {
|
|
785
|
+
if (events.length === 0) return [];
|
|
786
|
+
|
|
787
|
+
const maxCollapsed = 3;
|
|
788
|
+
const maxExpanded = 10;
|
|
789
|
+
const displayCount = expanded ? Math.min(events.length, maxExpanded) : Math.min(events.length, maxCollapsed);
|
|
790
|
+
|
|
791
|
+
const lines: string[] = [];
|
|
792
|
+
for (let i = 0; i < displayCount; i++) {
|
|
793
|
+
const isLast = i === displayCount - 1 && (expanded || events.length <= maxCollapsed);
|
|
794
|
+
const branch = isLast ? theme.tree.last : theme.tree.branch;
|
|
795
|
+
|
|
796
|
+
if (expanded) {
|
|
797
|
+
const eventLines = formatStatusEventExpanded(events[i], theme);
|
|
798
|
+
lines.push(`${theme.fg("dim", branch)} ${eventLines[0]}`);
|
|
799
|
+
const continueBranch = isLast ? " " : `${theme.tree.vertical} `;
|
|
800
|
+
for (let j = 1; j < eventLines.length; j++) {
|
|
801
|
+
lines.push(`${theme.fg("dim", continueBranch)}${eventLines[j]}`);
|
|
802
|
+
}
|
|
803
|
+
} else {
|
|
804
|
+
lines.push(`${theme.fg("dim", branch)} ${formatStatusEvent(events[i], theme)}`);
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
if (!expanded && events.length > maxCollapsed) {
|
|
809
|
+
lines.push(`${theme.fg("dim", theme.tree.last)} ${theme.fg("dim", `… ${events.length - maxCollapsed} more`)}`);
|
|
810
|
+
} else if (expanded && events.length > maxExpanded) {
|
|
811
|
+
lines.push(`${theme.fg("dim", theme.tree.last)} ${theme.fg("dim", `… ${events.length - maxExpanded} more`)}`);
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
return lines;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
function formatCellOutputLines(
|
|
818
|
+
cell: EvalCellResult,
|
|
819
|
+
expanded: boolean,
|
|
820
|
+
previewLines: number,
|
|
821
|
+
theme: Theme,
|
|
822
|
+
width: number,
|
|
823
|
+
): { lines: string[]; hiddenCount: number } {
|
|
824
|
+
if (!cell.output) {
|
|
825
|
+
return { lines: [], hiddenCount: 0 };
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
if (cell.hasMarkdown && cell.status !== "error") {
|
|
829
|
+
const md = new Markdown(cell.output, 0, 0, getMarkdownTheme());
|
|
830
|
+
const allLines = md.render(width);
|
|
831
|
+
const displayLines = expanded ? allLines : allLines.slice(-previewLines);
|
|
832
|
+
const hiddenCount = allLines.length - displayLines.length;
|
|
833
|
+
return { lines: displayLines, hiddenCount };
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
const rawLines = cell.output.split("\n");
|
|
837
|
+
const displayLines = expanded ? rawLines : rawLines.slice(-previewLines);
|
|
838
|
+
const hiddenCount = rawLines.length - displayLines.length;
|
|
839
|
+
const outputLines = displayLines.map(line => {
|
|
840
|
+
const cleaned = replaceTabs(line);
|
|
841
|
+
return cell.status === "error" ? theme.fg("error", cleaned) : theme.fg("toolOutput", cleaned);
|
|
842
|
+
});
|
|
843
|
+
|
|
844
|
+
return { lines: outputLines, hiddenCount };
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
export const evalToolRenderer = {
|
|
848
|
+
renderCall(args: EvalRenderArgs, _options: RenderResultOptions, uiTheme: Theme): Component {
|
|
849
|
+
const cells = getRenderCells(args);
|
|
850
|
+
|
|
851
|
+
if (cells.length === 0) {
|
|
852
|
+
const promptSym = uiTheme.fg("accent", ">>>");
|
|
853
|
+
const text = formatTitle(`${promptSym} …`, uiTheme);
|
|
854
|
+
return new Text(text, 0, 0);
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
let cached: { key: string; width: number; result: string[] } | undefined;
|
|
858
|
+
|
|
859
|
+
return {
|
|
860
|
+
render: (width: number): string[] => {
|
|
861
|
+
const key = cells.map(c => `${c.language}:${c.title ?? ""}:${c.code.length}`).join("|");
|
|
862
|
+
if (cached && cached.key === key && cached.width === width) {
|
|
863
|
+
return cached.result;
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
const lines: string[] = [];
|
|
867
|
+
for (let i = 0; i < cells.length; i++) {
|
|
868
|
+
const cell = cells[i];
|
|
869
|
+
const cellLines = renderCodeCell(
|
|
870
|
+
{
|
|
871
|
+
code: cell.code,
|
|
872
|
+
language: languageForHighlighter(cell.language),
|
|
873
|
+
index: i,
|
|
874
|
+
total: cells.length,
|
|
875
|
+
title: cell.title,
|
|
876
|
+
status: "pending",
|
|
877
|
+
width,
|
|
878
|
+
codeMaxLines: EVAL_DEFAULT_PREVIEW_LINES,
|
|
879
|
+
expanded: true,
|
|
880
|
+
},
|
|
881
|
+
uiTheme,
|
|
882
|
+
);
|
|
883
|
+
lines.push(...cellLines);
|
|
884
|
+
if (i < cells.length - 1) {
|
|
885
|
+
lines.push("");
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
cached = { key, width, result: lines };
|
|
889
|
+
return lines;
|
|
890
|
+
},
|
|
891
|
+
invalidate: () => {
|
|
892
|
+
cached = undefined;
|
|
893
|
+
},
|
|
894
|
+
};
|
|
895
|
+
},
|
|
896
|
+
|
|
897
|
+
renderResult(
|
|
898
|
+
result: { content: Array<{ type: string; text?: string }>; details?: EvalToolDetails },
|
|
899
|
+
options: RenderResultOptions & { renderContext?: EvalRenderContext },
|
|
900
|
+
uiTheme: Theme,
|
|
901
|
+
_args?: EvalRenderArgs,
|
|
902
|
+
): Component {
|
|
903
|
+
const details = result.details;
|
|
904
|
+
|
|
905
|
+
const rawOutput =
|
|
906
|
+
options.renderContext?.output ?? (result.content?.find(c => c.type === "text")?.text ?? "").trimEnd();
|
|
907
|
+
// Strip the LLM-facing notice (appended by wrappedExecute) before display;
|
|
908
|
+
// the styled `warningLine` below carries the same text in ⟨…⟩ form.
|
|
909
|
+
const output = stripOutputNotice(rawOutput, details?.meta).trimEnd();
|
|
910
|
+
|
|
911
|
+
const jsonOutputs = details?.jsonOutputs ?? [];
|
|
912
|
+
const jsonLines = jsonOutputs.flatMap((value, index) => {
|
|
913
|
+
const header = `JSON output ${index + 1}`;
|
|
914
|
+
const treeLines = renderJsonTree(value, uiTheme, options.renderContext?.expanded ?? options.expanded);
|
|
915
|
+
return [header, ...treeLines];
|
|
916
|
+
});
|
|
917
|
+
|
|
918
|
+
const timeoutSeconds = options.renderContext?.timeout;
|
|
919
|
+
const timeoutLine =
|
|
920
|
+
typeof timeoutSeconds === "number"
|
|
921
|
+
? uiTheme.fg("dim", wrapBrackets(`Timeout: ${timeoutSeconds}s`, uiTheme))
|
|
922
|
+
: undefined;
|
|
923
|
+
let warningLine: string | undefined;
|
|
924
|
+
if (details?.meta?.truncation) {
|
|
925
|
+
warningLine = formatStyledTruncationWarning(details.meta, uiTheme) ?? undefined;
|
|
926
|
+
}
|
|
927
|
+
const noticeLine = details?.notice ? uiTheme.fg("dim", wrapBrackets(details.notice, uiTheme)) : undefined;
|
|
928
|
+
|
|
929
|
+
const cellResults = details?.cells;
|
|
930
|
+
if (cellResults && cellResults.length > 0) {
|
|
931
|
+
let cached: { key: string; width: number; result: string[] } | undefined;
|
|
932
|
+
|
|
933
|
+
return {
|
|
934
|
+
render: (width: number): string[] => {
|
|
935
|
+
const expanded = options.renderContext?.expanded ?? options.expanded;
|
|
936
|
+
const previewLines = options.renderContext?.previewLines ?? EVAL_DEFAULT_PREVIEW_LINES;
|
|
937
|
+
const key = `${expanded}|${previewLines}|${options.spinnerFrame}`;
|
|
938
|
+
if (cached && cached.key === key && cached.width === width) {
|
|
939
|
+
return cached.result;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
const lines: string[] = [];
|
|
943
|
+
for (let i = 0; i < cellResults.length; i++) {
|
|
944
|
+
const cell = cellResults[i];
|
|
945
|
+
const statusLines = renderStatusEvents(cell.statusEvents ?? [], uiTheme, expanded);
|
|
946
|
+
const outputContent = formatCellOutputLines(cell, expanded, previewLines, uiTheme, width);
|
|
947
|
+
const outputLines = [...outputContent.lines];
|
|
948
|
+
if (!expanded && outputContent.hiddenCount > 0) {
|
|
949
|
+
outputLines.push(
|
|
950
|
+
uiTheme.fg("dim", `… ${outputContent.hiddenCount} more lines (ctrl+o to expand)`),
|
|
951
|
+
);
|
|
952
|
+
}
|
|
953
|
+
if (statusLines.length > 0) {
|
|
954
|
+
if (outputLines.length > 0) {
|
|
955
|
+
outputLines.push(uiTheme.fg("dim", "Status"));
|
|
956
|
+
}
|
|
957
|
+
outputLines.push(...statusLines);
|
|
958
|
+
}
|
|
959
|
+
const cellLines = renderCodeCell(
|
|
960
|
+
{
|
|
961
|
+
code: cell.code,
|
|
962
|
+
language: languageForHighlighter(cell.language ?? details?.language),
|
|
963
|
+
index: i,
|
|
964
|
+
total: cellResults.length,
|
|
965
|
+
title: cell.title,
|
|
966
|
+
status: cell.status,
|
|
967
|
+
spinnerFrame: options.spinnerFrame,
|
|
968
|
+
duration: cell.durationMs,
|
|
969
|
+
output: outputLines.length > 0 ? outputLines.join("\n") : undefined,
|
|
970
|
+
outputMaxLines: outputLines.length,
|
|
971
|
+
codeMaxLines: expanded ? Number.POSITIVE_INFINITY : EVAL_DEFAULT_PREVIEW_LINES,
|
|
972
|
+
expanded,
|
|
973
|
+
width,
|
|
974
|
+
},
|
|
975
|
+
uiTheme,
|
|
976
|
+
);
|
|
977
|
+
lines.push(...cellLines);
|
|
978
|
+
if (i < cellResults.length - 1) {
|
|
979
|
+
lines.push("");
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
if (jsonLines.length > 0) {
|
|
983
|
+
if (lines.length > 0) {
|
|
984
|
+
lines.push("");
|
|
985
|
+
}
|
|
986
|
+
lines.push(...jsonLines);
|
|
987
|
+
}
|
|
988
|
+
if (timeoutLine) {
|
|
989
|
+
lines.push(timeoutLine);
|
|
990
|
+
}
|
|
991
|
+
if (noticeLine) {
|
|
992
|
+
lines.push(noticeLine);
|
|
993
|
+
}
|
|
994
|
+
if (warningLine) {
|
|
995
|
+
lines.push(warningLine);
|
|
996
|
+
}
|
|
997
|
+
cached = { key, width, result: lines };
|
|
998
|
+
return lines;
|
|
999
|
+
},
|
|
1000
|
+
invalidate: () => {
|
|
1001
|
+
cached = undefined;
|
|
1002
|
+
},
|
|
1003
|
+
};
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
const displayOutput = output;
|
|
1007
|
+
const combinedOutput = [displayOutput, ...jsonLines].filter(Boolean).join("\n");
|
|
1008
|
+
|
|
1009
|
+
const statusEvents = details?.statusEvents ?? [];
|
|
1010
|
+
const statusLines = renderStatusEvents(
|
|
1011
|
+
statusEvents,
|
|
1012
|
+
uiTheme,
|
|
1013
|
+
options.renderContext?.expanded ?? options.expanded,
|
|
1014
|
+
);
|
|
1015
|
+
|
|
1016
|
+
if (!combinedOutput && statusLines.length === 0) {
|
|
1017
|
+
const lines = [timeoutLine, noticeLine, warningLine].filter(Boolean) as string[];
|
|
1018
|
+
return new Text(lines.join("\n"), 0, 0);
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
if (!combinedOutput && statusLines.length > 0) {
|
|
1022
|
+
const lines = [uiTheme.fg("dim", "Status"), ...statusLines, timeoutLine, noticeLine, warningLine].filter(
|
|
1023
|
+
Boolean,
|
|
1024
|
+
) as string[];
|
|
1025
|
+
return new Text(lines.join("\n"), 0, 0);
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
if (options.renderContext?.expanded ?? options.expanded) {
|
|
1029
|
+
const styledOutput = combinedOutput
|
|
1030
|
+
.split("\n")
|
|
1031
|
+
.map(line => uiTheme.fg("toolOutput", line))
|
|
1032
|
+
.join("\n");
|
|
1033
|
+
const lines = [
|
|
1034
|
+
styledOutput,
|
|
1035
|
+
...(statusLines.length > 0 ? [uiTheme.fg("dim", "Status"), ...statusLines] : []),
|
|
1036
|
+
timeoutLine,
|
|
1037
|
+
noticeLine,
|
|
1038
|
+
warningLine,
|
|
1039
|
+
].filter(Boolean) as string[];
|
|
1040
|
+
return new Text(lines.join("\n"), 0, 0);
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
const styledOutput = combinedOutput
|
|
1044
|
+
.split("\n")
|
|
1045
|
+
.map(line => uiTheme.fg("toolOutput", line))
|
|
1046
|
+
.join("\n");
|
|
1047
|
+
const textContent = `\n${styledOutput}`;
|
|
1048
|
+
|
|
1049
|
+
let cachedWidth: number | undefined;
|
|
1050
|
+
let cachedLines: string[] | undefined;
|
|
1051
|
+
let cachedSkipped: number | undefined;
|
|
1052
|
+
let cachedPreviewLines: number | undefined;
|
|
1053
|
+
|
|
1054
|
+
return {
|
|
1055
|
+
render: (width: number): string[] => {
|
|
1056
|
+
const previewLines = options.renderContext?.previewLines ?? EVAL_DEFAULT_PREVIEW_LINES;
|
|
1057
|
+
if (cachedLines === undefined || cachedWidth !== width || cachedPreviewLines !== previewLines) {
|
|
1058
|
+
const result = truncateToVisualLines(textContent, previewLines, width);
|
|
1059
|
+
cachedLines = result.visualLines;
|
|
1060
|
+
cachedSkipped = result.skippedCount;
|
|
1061
|
+
cachedWidth = width;
|
|
1062
|
+
cachedPreviewLines = previewLines;
|
|
1063
|
+
}
|
|
1064
|
+
const outputLines: string[] = [];
|
|
1065
|
+
if (cachedSkipped && cachedSkipped > 0) {
|
|
1066
|
+
outputLines.push("");
|
|
1067
|
+
const skippedLine = uiTheme.fg(
|
|
1068
|
+
"dim",
|
|
1069
|
+
`… (${cachedSkipped} earlier lines, showing ${cachedLines.length} of ${cachedSkipped + cachedLines.length}) (ctrl+o to expand)`,
|
|
1070
|
+
);
|
|
1071
|
+
outputLines.push(truncateToWidth(skippedLine, width));
|
|
1072
|
+
}
|
|
1073
|
+
outputLines.push(...cachedLines);
|
|
1074
|
+
if (statusLines.length > 0) {
|
|
1075
|
+
outputLines.push(truncateToWidth(uiTheme.fg("dim", "Status"), width));
|
|
1076
|
+
for (const statusLine of statusLines) {
|
|
1077
|
+
outputLines.push(truncateToWidth(statusLine, width));
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
if (timeoutLine) {
|
|
1081
|
+
outputLines.push(truncateToWidth(timeoutLine, width));
|
|
1082
|
+
}
|
|
1083
|
+
if (noticeLine) {
|
|
1084
|
+
outputLines.push(truncateToWidth(noticeLine, width));
|
|
1085
|
+
}
|
|
1086
|
+
if (warningLine) {
|
|
1087
|
+
outputLines.push(truncateToWidth(warningLine, width));
|
|
1088
|
+
}
|
|
1089
|
+
return outputLines;
|
|
1090
|
+
},
|
|
1091
|
+
invalidate: () => {
|
|
1092
|
+
cachedWidth = undefined;
|
|
1093
|
+
cachedLines = undefined;
|
|
1094
|
+
cachedSkipped = undefined;
|
|
1095
|
+
cachedPreviewLines = undefined;
|
|
1096
|
+
},
|
|
1097
|
+
};
|
|
1098
|
+
},
|
|
1099
|
+
mergeCallAndResult: true,
|
|
1100
|
+
inline: true,
|
|
1101
|
+
};
|