indusagi-coding-agent 0.1.40 → 0.1.42
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 +18 -1
- package/README.md +2 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/command-line/args.d.ts +56 -0
- package/dist/command-line/args.d.ts.map +1 -0
- package/dist/command-line/args.js.map +1 -0
- package/dist/command-line/config-selector.d.ts +17 -0
- package/dist/command-line/config-selector.d.ts.map +1 -0
- package/dist/command-line/config-selector.js.map +1 -0
- package/dist/command-line/file-processor.d.ts.map +1 -0
- package/dist/command-line/file-processor.js.map +1 -0
- package/dist/command-line/list-models.d.ts +9 -0
- package/dist/command-line/list-models.d.ts.map +1 -0
- package/dist/command-line/list-models.js.map +1 -0
- package/dist/command-line/login-handler.d.ts.map +1 -0
- package/dist/command-line/login-handler.js +746 -0
- package/dist/command-line/login-handler.js.map +1 -0
- package/dist/command-line/session-picker.d.ts.map +1 -0
- package/dist/command-line/session-picker.js.map +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +9 -5
- package/dist/config.js.map +1 -1
- package/dist/helpers/array.d.ts.map +1 -0
- package/dist/helpers/array.js.map +1 -0
- package/dist/helpers/changelog.d.ts.map +1 -0
- package/dist/helpers/changelog.js.map +1 -0
- package/dist/helpers/clipboard-image.d.ts.map +1 -0
- package/dist/helpers/clipboard-image.js.map +1 -0
- package/dist/helpers/clipboard.d.ts.map +1 -0
- package/dist/helpers/clipboard.js.map +1 -0
- package/dist/helpers/color-formatter.d.ts.map +1 -0
- package/dist/helpers/color-formatter.js.map +1 -0
- package/dist/helpers/data-transformer.d.ts.map +1 -0
- package/dist/helpers/data-transformer.js.map +1 -0
- package/dist/helpers/date-formatter.d.ts.map +1 -0
- package/dist/helpers/date-formatter.js.map +1 -0
- package/dist/helpers/error-handler.d.ts.map +1 -0
- package/dist/helpers/error-handler.js.map +1 -0
- package/dist/helpers/file-operations.d.ts.map +1 -0
- package/dist/helpers/file-operations.js.map +1 -0
- package/dist/helpers/frontmatter.d.ts.map +1 -0
- package/dist/helpers/frontmatter.js.map +1 -0
- package/dist/helpers/git.d.ts.map +1 -0
- package/dist/helpers/git.js.map +1 -0
- package/dist/helpers/image-convert.d.ts.map +1 -0
- package/dist/helpers/image-convert.js.map +1 -0
- package/dist/helpers/image-resize.d.ts.map +1 -0
- package/dist/helpers/image-resize.js.map +1 -0
- package/dist/helpers/json-formatter.d.ts.map +1 -0
- package/dist/helpers/json-formatter.js.map +1 -0
- package/dist/helpers/logger.d.ts.map +1 -0
- package/dist/helpers/logger.js.map +1 -0
- package/dist/helpers/markdown-formatter.d.ts.map +1 -0
- package/dist/helpers/markdown-formatter.js.map +1 -0
- package/dist/helpers/mime.d.ts.map +1 -0
- package/dist/helpers/mime.js.map +1 -0
- package/dist/helpers/path-validator.d.ts.map +1 -0
- package/dist/helpers/path-validator.js.map +1 -0
- package/dist/helpers/photon.d.ts.map +1 -0
- package/dist/helpers/photon.js.map +1 -0
- package/dist/helpers/shell.d.ts.map +1 -0
- package/dist/helpers/shell.js +142 -0
- package/dist/helpers/shell.js.map +1 -0
- package/dist/helpers/sleep.d.ts.map +1 -0
- package/dist/helpers/sleep.js.map +1 -0
- package/dist/helpers/string-formatter.d.ts.map +1 -0
- package/dist/helpers/string-formatter.js.map +1 -0
- package/dist/helpers/tools-manager.d.ts.map +1 -0
- package/dist/helpers/tools-manager.js.map +1 -0
- package/dist/helpers/type-guards.d.ts.map +1 -0
- package/dist/helpers/type-guards.js.map +1 -0
- package/dist/index.d.ts +34 -34
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +34 -34
- package/dist/index.js.map +1 -1
- package/dist/interfaces/index.d.ts +16 -0
- package/dist/interfaces/index.d.ts.map +1 -0
- package/dist/interfaces/index.js +14 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/interfaces/print-mode.d.ts +561 -0
- package/dist/interfaces/print-mode.d.ts.map +1 -0
- package/dist/interfaces/print-mode.js.map +1 -0
- package/dist/interfaces/service-api/rpc-client.d.ts +1129 -0
- package/dist/interfaces/service-api/rpc-client.d.ts.map +1 -0
- package/dist/interfaces/service-api/rpc-client.js.map +1 -0
- package/dist/interfaces/service-api/rpc-mode.d.ts +813 -0
- package/dist/interfaces/service-api/rpc-mode.d.ts.map +1 -0
- package/dist/interfaces/service-api/rpc-mode.js +1229 -0
- package/dist/interfaces/service-api/rpc-mode.js.map +1 -0
- package/dist/interfaces/service-api/rpc-types.d.ts +392 -0
- package/dist/interfaces/service-api/rpc-types.d.ts.map +1 -0
- package/dist/interfaces/service-api/rpc-types.js.map +1 -0
- package/dist/interfaces/shared.d.ts.map +1 -0
- package/dist/interfaces/shared.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/armin.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/armin.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/assistant-message.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/assistant-message.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/bash-execution.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/bash-execution.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/bordered-loader.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/bordered-loader.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/branch-summary-message.d.ts +16 -0
- package/dist/interfaces/terminal-ui/components/branch-summary-message.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/branch-summary-message.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/compaction-summary-message.d.ts +16 -0
- package/dist/interfaces/terminal-ui/components/compaction-summary-message.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/compaction-summary-message.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/config-selector.d.ts +71 -0
- package/dist/interfaces/terminal-ui/components/config-selector.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/config-selector.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/countdown-timer.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/countdown-timer.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/custom-editor.d.ts +17 -0
- package/dist/interfaces/terminal-ui/components/custom-editor.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/custom-editor.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/custom-message.d.ts +19 -0
- package/dist/interfaces/terminal-ui/components/custom-message.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/custom-message.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/diff.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/diff.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/dynamic-border.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/dynamic-border.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/extension-editor.d.ts +13 -0
- package/dist/interfaces/terminal-ui/components/extension-editor.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/extension-editor.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/extension-input.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/extension-input.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/extension-selector.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/extension-selector.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/footer.d.ts +17 -0
- package/dist/interfaces/terminal-ui/components/footer.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/footer.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/index.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/index.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/keybinding-hints.d.ts +23 -0
- package/dist/interfaces/terminal-ui/components/keybinding-hints.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/keybinding-hints.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/login-dialog.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/login-dialog.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/model-selector.d.ts +43 -0
- package/dist/interfaces/terminal-ui/components/model-selector.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/model-selector.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/oauth-selector.d.ts +75 -0
- package/dist/interfaces/terminal-ui/components/oauth-selector.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/oauth-selector.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/scoped-models-selector.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/scoped-models-selector.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/session-selector-search.d.ts +21 -0
- package/dist/interfaces/terminal-ui/components/session-selector-search.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/session-selector-search.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/session-selector.d.ts +85 -0
- package/dist/interfaces/terminal-ui/components/session-selector.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/session-selector.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/settings-selector.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/settings-selector.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/show-images-selector.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/show-images-selector.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/skill-invocation-message.d.ts +17 -0
- package/dist/interfaces/terminal-ui/components/skill-invocation-message.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/skill-invocation-message.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/theme-selector.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/theme-selector.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/thinking-selector.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/thinking-selector.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/tool-execution.d.ts +72 -0
- package/dist/interfaces/terminal-ui/components/tool-execution.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/tool-execution.js +1001 -0
- package/dist/interfaces/terminal-ui/components/tool-execution.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/tree-selector.d.ts +62 -0
- package/dist/interfaces/terminal-ui/components/tree-selector.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/tree-selector.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/user-message-selector.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/user-message-selector.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/user-message.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/user-message.js.map +1 -0
- package/dist/interfaces/terminal-ui/components/visual-truncate.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/components/visual-truncate.js.map +1 -0
- package/dist/interfaces/terminal-ui/interactive-mode.d.ts +1931 -0
- package/dist/interfaces/terminal-ui/interactive-mode.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/interactive-mode.js +5733 -0
- package/dist/interfaces/terminal-ui/interactive-mode.js.map +1 -0
- package/dist/interfaces/terminal-ui/theme/dark.json +91 -0
- package/dist/interfaces/terminal-ui/theme/light.json +90 -0
- package/dist/interfaces/terminal-ui/theme/theme-schema.json +339 -0
- package/dist/interfaces/terminal-ui/theme/theme.d.ts.map +1 -0
- package/dist/interfaces/terminal-ui/theme/theme.js.map +1 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +21 -21
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js.map +1 -1
- package/dist/runtime/agent-session.d.ts +936 -0
- package/dist/runtime/agent-session.d.ts.map +1 -0
- package/dist/runtime/agent-session.js +2737 -0
- package/dist/runtime/agent-session.js.map +1 -0
- package/dist/runtime/auth-storage.d.ts.map +1 -0
- package/dist/runtime/auth-storage.js.map +1 -0
- package/dist/runtime/bash-executor.d.ts.map +1 -0
- package/dist/runtime/bash-executor.js.map +1 -0
- package/dist/runtime/context-compression/branch-summarization.d.ts.map +1 -0
- package/dist/runtime/context-compression/branch-summarization.js.map +1 -0
- package/dist/runtime/context-compression/compaction.d.ts.map +1 -0
- package/dist/runtime/context-compression/compaction.js.map +1 -0
- package/dist/runtime/context-compression/index.d.ts.map +1 -0
- package/dist/runtime/context-compression/index.js.map +1 -0
- package/dist/runtime/context-compression/utils.d.ts.map +1 -0
- package/dist/runtime/context-compression/utils.js.map +1 -0
- package/dist/runtime/diagnostics.d.ts.map +1 -0
- package/dist/runtime/diagnostics.js.map +1 -0
- package/dist/runtime/discover-packages.d.ts.map +1 -0
- package/dist/runtime/discover-packages.js.map +1 -0
- package/dist/runtime/event-bus.d.ts.map +1 -0
- package/dist/runtime/event-bus.js.map +1 -0
- package/dist/runtime/exec.d.ts.map +1 -0
- package/dist/runtime/exec.js.map +1 -0
- package/dist/runtime/footer-data-provider.d.ts.map +1 -0
- package/dist/runtime/footer-data-provider.js.map +1 -0
- package/dist/runtime/html-export/ansi-to-html.d.ts.map +1 -0
- package/dist/runtime/html-export/ansi-to-html.js.map +1 -0
- package/dist/runtime/html-export/index.d.ts.map +1 -0
- package/dist/runtime/html-export/index.js +350 -0
- package/dist/runtime/html-export/index.js.map +1 -0
- package/dist/runtime/html-export/index.ts +433 -0
- package/dist/runtime/html-export/tool-renderer.d.ts +18 -0
- package/dist/runtime/html-export/tool-renderer.d.ts.map +1 -0
- package/dist/runtime/html-export/tool-renderer.js.map +1 -0
- package/dist/runtime/html-export/tool-renderer.ts +80 -0
- package/dist/runtime/index.d.ts +30 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +30 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/keybindings.d.ts.map +1 -0
- package/dist/runtime/keybindings.js.map +1 -0
- package/dist/runtime/lifecycle/index.d.ts.map +1 -0
- package/dist/runtime/lifecycle/index.js.map +1 -0
- package/dist/runtime/lifecycle/loader.d.ts.map +1 -0
- package/dist/runtime/lifecycle/loader.js.map +1 -0
- package/dist/runtime/lifecycle/runner.d.ts.map +1 -0
- package/dist/runtime/lifecycle/runner.js.map +1 -0
- package/dist/runtime/lifecycle/types.d.ts.map +1 -0
- package/dist/runtime/lifecycle/types.js.map +1 -0
- package/dist/runtime/messages.d.ts.map +1 -0
- package/dist/runtime/messages.js.map +1 -0
- package/dist/runtime/model-registry.d.ts.map +1 -0
- package/dist/runtime/model-registry.js.map +1 -0
- package/dist/runtime/model-resolver.d.ts.map +1 -0
- package/dist/runtime/model-resolver.js +227 -0
- package/dist/runtime/model-resolver.js.map +1 -0
- package/dist/runtime/package-manager.d.ts.map +1 -0
- package/dist/runtime/package-manager.js.map +1 -0
- package/dist/runtime/plugins/index.d.ts.map +1 -0
- package/dist/runtime/plugins/index.js.map +1 -0
- package/dist/runtime/plugins/loader.d.ts.map +1 -0
- package/dist/runtime/plugins/loader.js.map +1 -0
- package/dist/runtime/plugins/runner.d.ts.map +1 -0
- package/dist/runtime/plugins/runner.js +468 -0
- package/dist/runtime/plugins/runner.js.map +1 -0
- package/dist/runtime/plugins/types.d.ts +859 -0
- package/dist/runtime/plugins/types.d.ts.map +1 -0
- package/dist/runtime/plugins/types.js.map +1 -0
- package/dist/runtime/plugins/wrapper.d.ts +29 -0
- package/dist/runtime/plugins/wrapper.d.ts.map +1 -0
- package/dist/runtime/plugins/wrapper.js.map +1 -0
- package/dist/runtime/prompt-templates.d.ts.map +1 -0
- package/dist/runtime/prompt-templates.js +203 -0
- package/dist/runtime/prompt-templates.js.map +1 -0
- package/dist/runtime/resource-loader.d.ts +180 -0
- package/dist/runtime/resource-loader.d.ts.map +1 -0
- package/dist/runtime/resource-loader.js +530 -0
- package/dist/runtime/resource-loader.js.map +1 -0
- package/dist/runtime/sdk.d.ts +49 -0
- package/dist/runtime/sdk.d.ts.map +1 -0
- package/dist/runtime/sdk.js +306 -0
- package/dist/runtime/sdk.js.map +1 -0
- package/dist/runtime/session-manager.d.ts.map +1 -0
- package/dist/runtime/session-manager.js.map +1 -0
- package/dist/runtime/settings-manager.d.ts.map +1 -0
- package/dist/runtime/settings-manager.js.map +1 -0
- package/dist/runtime/skills.d.ts.map +1 -0
- package/dist/runtime/skills.js +277 -0
- package/dist/runtime/skills.js.map +1 -0
- package/dist/runtime/subagents.d.ts.map +1 -0
- package/dist/runtime/subagents.js +163 -0
- package/dist/runtime/subagents.js.map +1 -0
- package/dist/runtime/system-prompt.d.ts.map +1 -0
- package/dist/runtime/system-prompt.js.map +1 -0
- package/dist/runtime/task-session-manager.d.ts.map +1 -0
- package/dist/runtime/task-session-manager.js.map +1 -0
- package/dist/runtime/timings.d.ts.map +1 -0
- package/dist/runtime/timings.js.map +1 -0
- package/dist/runtime/todo-store.d.ts.map +1 -0
- package/dist/runtime/todo-store.js.map +1 -0
- package/dist/runtime/tooling/bash.d.ts.map +1 -0
- package/dist/runtime/tooling/bash.js.map +1 -0
- package/dist/runtime/tooling/bg-process.d.ts.map +1 -0
- package/dist/runtime/tooling/bg-process.js.map +1 -0
- package/dist/runtime/tooling/edit-diff.d.ts.map +1 -0
- package/dist/runtime/tooling/edit-diff.js.map +1 -0
- package/dist/runtime/tooling/edit.d.ts.map +1 -0
- package/dist/runtime/tooling/edit.js.map +1 -0
- package/dist/runtime/tooling/find.d.ts.map +1 -0
- package/dist/runtime/tooling/find.js.map +1 -0
- package/dist/runtime/tooling/grep.d.ts.map +1 -0
- package/dist/runtime/tooling/grep.js.map +1 -0
- package/dist/runtime/tooling/index.d.ts +208 -0
- package/dist/runtime/tooling/index.d.ts.map +1 -0
- package/dist/runtime/tooling/index.js.map +1 -0
- package/dist/runtime/tooling/ls.d.ts.map +1 -0
- package/dist/runtime/tooling/ls.js.map +1 -0
- package/dist/runtime/tooling/memory.d.ts.map +1 -0
- package/dist/runtime/tooling/memory.js.map +1 -0
- package/dist/runtime/tooling/path-utils.d.ts.map +1 -0
- package/dist/runtime/tooling/path-utils.js.map +1 -0
- package/dist/runtime/tooling/read.d.ts.map +1 -0
- package/dist/runtime/tooling/read.js.map +1 -0
- package/dist/runtime/tooling/registry.d.ts.map +1 -0
- package/dist/runtime/tooling/registry.js.map +1 -0
- package/dist/runtime/tooling/task.d.ts.map +1 -0
- package/dist/runtime/tooling/task.js.map +1 -0
- package/dist/runtime/tooling/todo.d.ts.map +1 -0
- package/dist/runtime/tooling/todo.js.map +1 -0
- package/dist/runtime/tooling/truncate.d.ts.map +1 -0
- package/dist/runtime/tooling/truncate.js.map +1 -0
- package/dist/runtime/tooling/webfetch.d.ts.map +1 -0
- package/dist/runtime/tooling/webfetch.js.map +1 -0
- package/dist/runtime/tooling/websearch.d.ts.map +1 -0
- package/dist/runtime/tooling/websearch.js.map +1 -0
- package/dist/runtime/tooling/write.d.ts.map +1 -0
- package/dist/runtime/tooling/write.js.map +1 -0
- package/dist/telemetry/core/config.d.ts.map +1 -0
- package/dist/telemetry/core/config.js.map +1 -0
- package/dist/telemetry/core/event-bus.d.ts.map +1 -0
- package/dist/telemetry/core/event-bus.js.map +1 -0
- package/dist/telemetry/core/index.d.ts.map +1 -0
- package/dist/telemetry/core/index.js.map +1 -0
- package/dist/telemetry/core/observability.d.ts.map +1 -0
- package/dist/telemetry/core/observability.js.map +1 -0
- package/dist/telemetry/core/span.d.ts.map +1 -0
- package/dist/telemetry/core/span.js.map +1 -0
- package/dist/telemetry/core/tracer.d.ts.map +1 -0
- package/dist/telemetry/core/tracer.js.map +1 -0
- package/dist/telemetry/core/types.d.ts.map +1 -0
- package/dist/telemetry/core/types.js.map +1 -0
- package/dist/telemetry/exporters/base-exporter.d.ts.map +1 -0
- package/dist/telemetry/exporters/base-exporter.js.map +1 -0
- package/dist/telemetry/exporters/console-exporter.d.ts.map +1 -0
- package/dist/telemetry/exporters/console-exporter.js.map +1 -0
- package/dist/telemetry/exporters/file-exporter.d.ts.map +1 -0
- package/dist/telemetry/exporters/file-exporter.js.map +1 -0
- package/dist/telemetry/exporters/index.d.ts.map +1 -0
- package/dist/telemetry/exporters/index.js.map +1 -0
- package/dist/telemetry/exporters/langfuse-exporter.d.ts.map +1 -0
- package/dist/telemetry/exporters/langfuse-exporter.js.map +1 -0
- package/dist/telemetry/exporters/sentry-exporter.d.ts.map +1 -0
- package/dist/telemetry/exporters/sentry-exporter.js.map +1 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js.map +1 -0
- package/package.json +7 -7
- package/dist/cli/args.d.ts +0 -56
- package/dist/cli/args.d.ts.map +0 -1
- package/dist/cli/args.js.map +0 -1
- package/dist/cli/config-selector.d.ts +0 -17
- package/dist/cli/config-selector.d.ts.map +0 -1
- package/dist/cli/config-selector.js.map +0 -1
- package/dist/cli/file-processor.d.ts.map +0 -1
- package/dist/cli/file-processor.js.map +0 -1
- package/dist/cli/list-models.d.ts +0 -9
- package/dist/cli/list-models.d.ts.map +0 -1
- package/dist/cli/list-models.js.map +0 -1
- package/dist/cli/login-handler.d.ts.map +0 -1
- package/dist/cli/login-handler.js +0 -746
- package/dist/cli/login-handler.js.map +0 -1
- package/dist/cli/session-picker.d.ts.map +0 -1
- package/dist/cli/session-picker.js.map +0 -1
- package/dist/core/agent-session.d.ts +0 -936
- package/dist/core/agent-session.d.ts.map +0 -1
- package/dist/core/agent-session.js +0 -2737
- package/dist/core/agent-session.js.map +0 -1
- package/dist/core/auth-storage.d.ts.map +0 -1
- package/dist/core/auth-storage.js.map +0 -1
- package/dist/core/bash-executor.d.ts.map +0 -1
- package/dist/core/bash-executor.js.map +0 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +0 -1
- package/dist/core/compaction/branch-summarization.js.map +0 -1
- package/dist/core/compaction/compaction.d.ts.map +0 -1
- package/dist/core/compaction/compaction.js.map +0 -1
- package/dist/core/compaction/index.d.ts.map +0 -1
- package/dist/core/compaction/index.js.map +0 -1
- package/dist/core/compaction/utils.d.ts.map +0 -1
- package/dist/core/compaction/utils.js.map +0 -1
- package/dist/core/diagnostics.d.ts.map +0 -1
- package/dist/core/diagnostics.js.map +0 -1
- package/dist/core/discover-packages.d.ts.map +0 -1
- package/dist/core/discover-packages.js.map +0 -1
- package/dist/core/event-bus.d.ts.map +0 -1
- package/dist/core/event-bus.js.map +0 -1
- package/dist/core/exec.d.ts.map +0 -1
- package/dist/core/exec.js.map +0 -1
- package/dist/core/export-html/ansi-to-html.d.ts.map +0 -1
- package/dist/core/export-html/ansi-to-html.js.map +0 -1
- package/dist/core/export-html/index.d.ts.map +0 -1
- package/dist/core/export-html/index.js +0 -350
- package/dist/core/export-html/index.js.map +0 -1
- package/dist/core/export-html/index.ts +0 -433
- package/dist/core/export-html/tool-renderer.d.ts +0 -18
- package/dist/core/export-html/tool-renderer.d.ts.map +0 -1
- package/dist/core/export-html/tool-renderer.js.map +0 -1
- package/dist/core/export-html/tool-renderer.ts +0 -80
- package/dist/core/extensions/index.d.ts.map +0 -1
- package/dist/core/extensions/index.js.map +0 -1
- package/dist/core/extensions/loader.d.ts.map +0 -1
- package/dist/core/extensions/loader.js.map +0 -1
- package/dist/core/extensions/runner.d.ts.map +0 -1
- package/dist/core/extensions/runner.js +0 -468
- package/dist/core/extensions/runner.js.map +0 -1
- package/dist/core/extensions/types.d.ts +0 -859
- package/dist/core/extensions/types.d.ts.map +0 -1
- package/dist/core/extensions/types.js.map +0 -1
- package/dist/core/extensions/wrapper.d.ts +0 -29
- package/dist/core/extensions/wrapper.d.ts.map +0 -1
- package/dist/core/extensions/wrapper.js.map +0 -1
- package/dist/core/footer-data-provider.d.ts.map +0 -1
- package/dist/core/footer-data-provider.js.map +0 -1
- package/dist/core/hooks/index.d.ts.map +0 -1
- package/dist/core/hooks/index.js.map +0 -1
- package/dist/core/hooks/loader.d.ts.map +0 -1
- package/dist/core/hooks/loader.js.map +0 -1
- package/dist/core/hooks/runner.d.ts.map +0 -1
- package/dist/core/hooks/runner.js.map +0 -1
- package/dist/core/hooks/types.d.ts.map +0 -1
- package/dist/core/hooks/types.js.map +0 -1
- package/dist/core/index.d.ts +0 -30
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -30
- package/dist/core/index.js.map +0 -1
- package/dist/core/keybindings.d.ts.map +0 -1
- package/dist/core/keybindings.js.map +0 -1
- package/dist/core/messages.d.ts.map +0 -1
- package/dist/core/messages.js.map +0 -1
- package/dist/core/model-registry.d.ts.map +0 -1
- package/dist/core/model-registry.js.map +0 -1
- package/dist/core/model-resolver.d.ts.map +0 -1
- package/dist/core/model-resolver.js +0 -227
- package/dist/core/model-resolver.js.map +0 -1
- package/dist/core/package-manager.d.ts.map +0 -1
- package/dist/core/package-manager.js.map +0 -1
- package/dist/core/prompt-templates.d.ts.map +0 -1
- package/dist/core/prompt-templates.js +0 -203
- package/dist/core/prompt-templates.js.map +0 -1
- package/dist/core/resource-loader.d.ts +0 -180
- package/dist/core/resource-loader.d.ts.map +0 -1
- package/dist/core/resource-loader.js +0 -530
- package/dist/core/resource-loader.js.map +0 -1
- package/dist/core/sdk.d.ts +0 -49
- package/dist/core/sdk.d.ts.map +0 -1
- package/dist/core/sdk.js +0 -306
- package/dist/core/sdk.js.map +0 -1
- package/dist/core/session-manager.d.ts.map +0 -1
- package/dist/core/session-manager.js.map +0 -1
- package/dist/core/settings-manager.d.ts.map +0 -1
- package/dist/core/settings-manager.js.map +0 -1
- package/dist/core/skills.d.ts.map +0 -1
- package/dist/core/skills.js +0 -277
- package/dist/core/skills.js.map +0 -1
- package/dist/core/subagents.d.ts.map +0 -1
- package/dist/core/subagents.js +0 -163
- package/dist/core/subagents.js.map +0 -1
- package/dist/core/system-prompt.d.ts.map +0 -1
- package/dist/core/system-prompt.js.map +0 -1
- package/dist/core/task-session-manager.d.ts.map +0 -1
- package/dist/core/task-session-manager.js.map +0 -1
- package/dist/core/timings.d.ts.map +0 -1
- package/dist/core/timings.js.map +0 -1
- package/dist/core/todo-store.d.ts.map +0 -1
- package/dist/core/todo-store.js.map +0 -1
- package/dist/core/tools/bash.d.ts.map +0 -1
- package/dist/core/tools/bash.js.map +0 -1
- package/dist/core/tools/bg-process.d.ts.map +0 -1
- package/dist/core/tools/bg-process.js.map +0 -1
- package/dist/core/tools/edit-diff.d.ts.map +0 -1
- package/dist/core/tools/edit-diff.js.map +0 -1
- package/dist/core/tools/edit.d.ts.map +0 -1
- package/dist/core/tools/edit.js.map +0 -1
- package/dist/core/tools/find.d.ts.map +0 -1
- package/dist/core/tools/find.js.map +0 -1
- package/dist/core/tools/grep.d.ts.map +0 -1
- package/dist/core/tools/grep.js.map +0 -1
- package/dist/core/tools/index.d.ts +0 -208
- package/dist/core/tools/index.d.ts.map +0 -1
- package/dist/core/tools/index.js.map +0 -1
- package/dist/core/tools/ls.d.ts.map +0 -1
- package/dist/core/tools/ls.js.map +0 -1
- package/dist/core/tools/memory.d.ts.map +0 -1
- package/dist/core/tools/memory.js.map +0 -1
- package/dist/core/tools/path-utils.d.ts.map +0 -1
- package/dist/core/tools/path-utils.js.map +0 -1
- package/dist/core/tools/read.d.ts.map +0 -1
- package/dist/core/tools/read.js.map +0 -1
- package/dist/core/tools/registry.d.ts.map +0 -1
- package/dist/core/tools/registry.js.map +0 -1
- package/dist/core/tools/task.d.ts.map +0 -1
- package/dist/core/tools/task.js.map +0 -1
- package/dist/core/tools/todo.d.ts.map +0 -1
- package/dist/core/tools/todo.js.map +0 -1
- package/dist/core/tools/truncate.d.ts.map +0 -1
- package/dist/core/tools/truncate.js.map +0 -1
- package/dist/core/tools/webfetch.d.ts.map +0 -1
- package/dist/core/tools/webfetch.js.map +0 -1
- package/dist/core/tools/websearch.d.ts.map +0 -1
- package/dist/core/tools/websearch.js.map +0 -1
- package/dist/core/tools/write.d.ts.map +0 -1
- package/dist/core/tools/write.js.map +0 -1
- package/dist/modes/index.d.ts +0 -16
- package/dist/modes/index.d.ts.map +0 -1
- package/dist/modes/index.js +0 -14
- package/dist/modes/index.js.map +0 -1
- package/dist/modes/interactive/components/armin.d.ts.map +0 -1
- package/dist/modes/interactive/components/armin.js.map +0 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/assistant-message.js.map +0 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +0 -1
- package/dist/modes/interactive/components/bash-execution.js.map +0 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +0 -1
- package/dist/modes/interactive/components/bordered-loader.js.map +0 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts +0 -16
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/branch-summary-message.js.map +0 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +0 -16
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/compaction-summary-message.js.map +0 -1
- package/dist/modes/interactive/components/config-selector.d.ts +0 -71
- package/dist/modes/interactive/components/config-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/config-selector.js.map +0 -1
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +0 -1
- package/dist/modes/interactive/components/countdown-timer.js.map +0 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +0 -17
- package/dist/modes/interactive/components/custom-editor.d.ts.map +0 -1
- package/dist/modes/interactive/components/custom-editor.js.map +0 -1
- package/dist/modes/interactive/components/custom-message.d.ts +0 -19
- package/dist/modes/interactive/components/custom-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/custom-message.js.map +0 -1
- package/dist/modes/interactive/components/diff.d.ts.map +0 -1
- package/dist/modes/interactive/components/diff.js.map +0 -1
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +0 -1
- package/dist/modes/interactive/components/dynamic-border.js.map +0 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +0 -13
- package/dist/modes/interactive/components/extension-editor.d.ts.map +0 -1
- package/dist/modes/interactive/components/extension-editor.js.map +0 -1
- package/dist/modes/interactive/components/extension-input.d.ts.map +0 -1
- package/dist/modes/interactive/components/extension-input.js.map +0 -1
- package/dist/modes/interactive/components/extension-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/extension-selector.js.map +0 -1
- package/dist/modes/interactive/components/footer.d.ts +0 -17
- package/dist/modes/interactive/components/footer.d.ts.map +0 -1
- package/dist/modes/interactive/components/footer.js.map +0 -1
- package/dist/modes/interactive/components/index.d.ts.map +0 -1
- package/dist/modes/interactive/components/index.js.map +0 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts +0 -23
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +0 -1
- package/dist/modes/interactive/components/keybinding-hints.js.map +0 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +0 -1
- package/dist/modes/interactive/components/login-dialog.js.map +0 -1
- package/dist/modes/interactive/components/model-selector.d.ts +0 -43
- package/dist/modes/interactive/components/model-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/model-selector.js.map +0 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +0 -75
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/oauth-selector.js.map +0 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/scoped-models-selector.js.map +0 -1
- package/dist/modes/interactive/components/session-selector-search.d.ts +0 -21
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +0 -1
- package/dist/modes/interactive/components/session-selector-search.js.map +0 -1
- package/dist/modes/interactive/components/session-selector.d.ts +0 -85
- package/dist/modes/interactive/components/session-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/session-selector.js.map +0 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/settings-selector.js.map +0 -1
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/show-images-selector.js.map +0 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +0 -17
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/skill-invocation-message.js.map +0 -1
- package/dist/modes/interactive/components/theme-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/theme-selector.js.map +0 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/thinking-selector.js.map +0 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +0 -72
- package/dist/modes/interactive/components/tool-execution.d.ts.map +0 -1
- package/dist/modes/interactive/components/tool-execution.js +0 -1001
- package/dist/modes/interactive/components/tool-execution.js.map +0 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +0 -62
- package/dist/modes/interactive/components/tree-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/tree-selector.js.map +0 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/user-message-selector.js.map +0 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +0 -1
- package/dist/modes/interactive/components/user-message.js.map +0 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +0 -1
- package/dist/modes/interactive/components/visual-truncate.js.map +0 -1
- package/dist/modes/interactive/interactive-mode.d.ts +0 -1931
- package/dist/modes/interactive/interactive-mode.d.ts.map +0 -1
- package/dist/modes/interactive/interactive-mode.js +0 -5733
- package/dist/modes/interactive/interactive-mode.js.map +0 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +0 -1
- package/dist/modes/interactive/theme/theme.js.map +0 -1
- package/dist/modes/print-mode.d.ts +0 -561
- package/dist/modes/print-mode.d.ts.map +0 -1
- package/dist/modes/print-mode.js.map +0 -1
- package/dist/modes/rpc/rpc-client.d.ts +0 -1129
- package/dist/modes/rpc/rpc-client.d.ts.map +0 -1
- package/dist/modes/rpc/rpc-client.js.map +0 -1
- package/dist/modes/rpc/rpc-mode.d.ts +0 -813
- package/dist/modes/rpc/rpc-mode.d.ts.map +0 -1
- package/dist/modes/rpc/rpc-mode.js +0 -1229
- package/dist/modes/rpc/rpc-mode.js.map +0 -1
- package/dist/modes/rpc/rpc-types.d.ts +0 -392
- package/dist/modes/rpc/rpc-types.d.ts.map +0 -1
- package/dist/modes/rpc/rpc-types.js.map +0 -1
- package/dist/modes/shared.d.ts.map +0 -1
- package/dist/modes/shared.js.map +0 -1
- package/dist/observability/core/config.d.ts.map +0 -1
- package/dist/observability/core/config.js.map +0 -1
- package/dist/observability/core/event-bus.d.ts.map +0 -1
- package/dist/observability/core/event-bus.js.map +0 -1
- package/dist/observability/core/index.d.ts.map +0 -1
- package/dist/observability/core/index.js.map +0 -1
- package/dist/observability/core/observability.d.ts.map +0 -1
- package/dist/observability/core/observability.js.map +0 -1
- package/dist/observability/core/span.d.ts.map +0 -1
- package/dist/observability/core/span.js.map +0 -1
- package/dist/observability/core/tracer.d.ts.map +0 -1
- package/dist/observability/core/tracer.js.map +0 -1
- package/dist/observability/core/types.d.ts.map +0 -1
- package/dist/observability/core/types.js.map +0 -1
- package/dist/observability/exporters/base-exporter.d.ts.map +0 -1
- package/dist/observability/exporters/base-exporter.js.map +0 -1
- package/dist/observability/exporters/console-exporter.d.ts.map +0 -1
- package/dist/observability/exporters/console-exporter.js.map +0 -1
- package/dist/observability/exporters/file-exporter.d.ts.map +0 -1
- package/dist/observability/exporters/file-exporter.js.map +0 -1
- package/dist/observability/exporters/index.d.ts.map +0 -1
- package/dist/observability/exporters/index.js.map +0 -1
- package/dist/observability/exporters/langfuse-exporter.d.ts.map +0 -1
- package/dist/observability/exporters/langfuse-exporter.js.map +0 -1
- package/dist/observability/exporters/sentry-exporter.d.ts.map +0 -1
- package/dist/observability/exporters/sentry-exporter.js.map +0 -1
- package/dist/observability/index.d.ts.map +0 -1
- package/dist/observability/index.js.map +0 -1
- package/dist/utils/array.d.ts.map +0 -1
- package/dist/utils/array.js.map +0 -1
- package/dist/utils/changelog.d.ts.map +0 -1
- package/dist/utils/changelog.js.map +0 -1
- package/dist/utils/clipboard-image.d.ts.map +0 -1
- package/dist/utils/clipboard-image.js.map +0 -1
- package/dist/utils/clipboard.d.ts.map +0 -1
- package/dist/utils/clipboard.js.map +0 -1
- package/dist/utils/color-formatter.d.ts.map +0 -1
- package/dist/utils/color-formatter.js.map +0 -1
- package/dist/utils/data-transformer.d.ts.map +0 -1
- package/dist/utils/data-transformer.js.map +0 -1
- package/dist/utils/date-formatter.d.ts.map +0 -1
- package/dist/utils/date-formatter.js.map +0 -1
- package/dist/utils/error-handler.d.ts.map +0 -1
- package/dist/utils/error-handler.js.map +0 -1
- package/dist/utils/file-operations.d.ts.map +0 -1
- package/dist/utils/file-operations.js.map +0 -1
- package/dist/utils/frontmatter.d.ts.map +0 -1
- package/dist/utils/frontmatter.js.map +0 -1
- package/dist/utils/git.d.ts.map +0 -1
- package/dist/utils/git.js.map +0 -1
- package/dist/utils/image-convert.d.ts.map +0 -1
- package/dist/utils/image-convert.js.map +0 -1
- package/dist/utils/image-resize.d.ts.map +0 -1
- package/dist/utils/image-resize.js.map +0 -1
- package/dist/utils/json-formatter.d.ts.map +0 -1
- package/dist/utils/json-formatter.js.map +0 -1
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/markdown-formatter.d.ts.map +0 -1
- package/dist/utils/markdown-formatter.js.map +0 -1
- package/dist/utils/mime.d.ts.map +0 -1
- package/dist/utils/mime.js.map +0 -1
- package/dist/utils/path-validator.d.ts.map +0 -1
- package/dist/utils/path-validator.js.map +0 -1
- package/dist/utils/photon.d.ts.map +0 -1
- package/dist/utils/photon.js.map +0 -1
- package/dist/utils/shell.d.ts.map +0 -1
- package/dist/utils/shell.js +0 -142
- package/dist/utils/shell.js.map +0 -1
- package/dist/utils/sleep.d.ts.map +0 -1
- package/dist/utils/sleep.js.map +0 -1
- package/dist/utils/string-formatter.d.ts.map +0 -1
- package/dist/utils/string-formatter.js.map +0 -1
- package/dist/utils/tools-manager.d.ts.map +0 -1
- package/dist/utils/tools-manager.js.map +0 -1
- package/dist/utils/type-guards.d.ts.map +0 -1
- package/dist/utils/type-guards.js.map +0 -1
- /package/{examples → demos}/README.md +0 -0
- /package/dist/{cli → command-line}/args.js +0 -0
- /package/dist/{cli → command-line}/config-selector.js +0 -0
- /package/dist/{cli → command-line}/file-processor.d.ts +0 -0
- /package/dist/{cli → command-line}/file-processor.js +0 -0
- /package/dist/{cli → command-line}/list-models.js +0 -0
- /package/dist/{cli → command-line}/login-handler.d.ts +0 -0
- /package/dist/{cli → command-line}/session-picker.d.ts +0 -0
- /package/dist/{cli → command-line}/session-picker.js +0 -0
- /package/dist/{utils → helpers}/array.d.ts +0 -0
- /package/dist/{utils → helpers}/array.js +0 -0
- /package/dist/{utils → helpers}/changelog.d.ts +0 -0
- /package/dist/{utils → helpers}/changelog.js +0 -0
- /package/dist/{utils → helpers}/clipboard-image.d.ts +0 -0
- /package/dist/{utils → helpers}/clipboard-image.js +0 -0
- /package/dist/{utils → helpers}/clipboard.d.ts +0 -0
- /package/dist/{utils → helpers}/clipboard.js +0 -0
- /package/dist/{utils → helpers}/color-formatter.d.ts +0 -0
- /package/dist/{utils → helpers}/color-formatter.js +0 -0
- /package/dist/{utils → helpers}/data-transformer.d.ts +0 -0
- /package/dist/{utils → helpers}/data-transformer.js +0 -0
- /package/dist/{utils → helpers}/date-formatter.d.ts +0 -0
- /package/dist/{utils → helpers}/date-formatter.js +0 -0
- /package/dist/{utils → helpers}/error-handler.d.ts +0 -0
- /package/dist/{utils → helpers}/error-handler.js +0 -0
- /package/dist/{utils → helpers}/file-operations.d.ts +0 -0
- /package/dist/{utils → helpers}/file-operations.js +0 -0
- /package/dist/{utils → helpers}/frontmatter.d.ts +0 -0
- /package/dist/{utils → helpers}/frontmatter.js +0 -0
- /package/dist/{utils → helpers}/git.d.ts +0 -0
- /package/dist/{utils → helpers}/git.js +0 -0
- /package/dist/{utils → helpers}/image-convert.d.ts +0 -0
- /package/dist/{utils → helpers}/image-convert.js +0 -0
- /package/dist/{utils → helpers}/image-resize.d.ts +0 -0
- /package/dist/{utils → helpers}/image-resize.js +0 -0
- /package/dist/{utils → helpers}/json-formatter.d.ts +0 -0
- /package/dist/{utils → helpers}/json-formatter.js +0 -0
- /package/dist/{utils → helpers}/logger.d.ts +0 -0
- /package/dist/{utils → helpers}/logger.js +0 -0
- /package/dist/{utils → helpers}/markdown-formatter.d.ts +0 -0
- /package/dist/{utils → helpers}/markdown-formatter.js +0 -0
- /package/dist/{utils → helpers}/mime.d.ts +0 -0
- /package/dist/{utils → helpers}/mime.js +0 -0
- /package/dist/{utils → helpers}/path-validator.d.ts +0 -0
- /package/dist/{utils → helpers}/path-validator.js +0 -0
- /package/dist/{utils → helpers}/photon.d.ts +0 -0
- /package/dist/{utils → helpers}/photon.js +0 -0
- /package/dist/{utils → helpers}/shell.d.ts +0 -0
- /package/dist/{utils → helpers}/sleep.d.ts +0 -0
- /package/dist/{utils → helpers}/sleep.js +0 -0
- /package/dist/{utils → helpers}/string-formatter.d.ts +0 -0
- /package/dist/{utils → helpers}/string-formatter.js +0 -0
- /package/dist/{utils → helpers}/tools-manager.d.ts +0 -0
- /package/dist/{utils → helpers}/tools-manager.js +0 -0
- /package/dist/{utils → helpers}/type-guards.d.ts +0 -0
- /package/dist/{utils → helpers}/type-guards.js +0 -0
- /package/dist/{modes → interfaces}/print-mode.js +0 -0
- /package/dist/{modes/rpc → interfaces/service-api}/rpc-client.js +0 -0
- /package/dist/{modes/rpc → interfaces/service-api}/rpc-types.js +0 -0
- /package/dist/{modes → interfaces}/shared.d.ts +0 -0
- /package/dist/{modes → interfaces}/shared.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/armin.d.ts +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/armin.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/assistant-message.d.ts +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/assistant-message.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/bash-execution.d.ts +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/bash-execution.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/bordered-loader.d.ts +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/bordered-loader.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/branch-summary-message.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/compaction-summary-message.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/config-selector.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/countdown-timer.d.ts +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/countdown-timer.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/custom-editor.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/custom-message.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/diff.d.ts +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/diff.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/dynamic-border.d.ts +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/dynamic-border.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/extension-editor.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/extension-input.d.ts +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/extension-input.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/extension-selector.d.ts +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/extension-selector.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/footer.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/index.d.ts +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/index.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/keybinding-hints.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/login-dialog.d.ts +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/login-dialog.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/model-selector.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/oauth-selector.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/scoped-models-selector.d.ts +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/scoped-models-selector.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/session-selector-search.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/session-selector.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/settings-selector.d.ts +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/settings-selector.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/show-images-selector.d.ts +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/show-images-selector.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/skill-invocation-message.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/theme-selector.d.ts +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/theme-selector.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/thinking-selector.d.ts +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/thinking-selector.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/tree-selector.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/user-message-selector.d.ts +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/user-message-selector.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/user-message.d.ts +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/user-message.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/visual-truncate.d.ts +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/components/visual-truncate.js +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/theme/theme.d.ts +0 -0
- /package/dist/{modes/interactive → interfaces/terminal-ui}/theme/theme.js +0 -0
- /package/dist/{core → runtime}/auth-storage.d.ts +0 -0
- /package/dist/{core → runtime}/auth-storage.js +0 -0
- /package/dist/{core → runtime}/bash-executor.d.ts +0 -0
- /package/dist/{core → runtime}/bash-executor.js +0 -0
- /package/dist/{core/compaction → runtime/context-compression}/branch-summarization.d.ts +0 -0
- /package/dist/{core/compaction → runtime/context-compression}/branch-summarization.js +0 -0
- /package/dist/{core/compaction → runtime/context-compression}/compaction.d.ts +0 -0
- /package/dist/{core/compaction → runtime/context-compression}/compaction.js +0 -0
- /package/dist/{core/compaction → runtime/context-compression}/index.d.ts +0 -0
- /package/dist/{core/compaction → runtime/context-compression}/index.js +0 -0
- /package/dist/{core/compaction → runtime/context-compression}/utils.d.ts +0 -0
- /package/dist/{core/compaction → runtime/context-compression}/utils.js +0 -0
- /package/dist/{core → runtime}/diagnostics.d.ts +0 -0
- /package/dist/{core → runtime}/diagnostics.js +0 -0
- /package/dist/{core → runtime}/discover-packages.d.ts +0 -0
- /package/dist/{core → runtime}/discover-packages.js +0 -0
- /package/dist/{core → runtime}/event-bus.d.ts +0 -0
- /package/dist/{core → runtime}/event-bus.js +0 -0
- /package/dist/{core → runtime}/exec.d.ts +0 -0
- /package/dist/{core → runtime}/exec.js +0 -0
- /package/dist/{core → runtime}/footer-data-provider.d.ts +0 -0
- /package/dist/{core → runtime}/footer-data-provider.js +0 -0
- /package/dist/{core/export-html → runtime/html-export}/ansi-to-html.d.ts +0 -0
- /package/dist/{core/export-html → runtime/html-export}/ansi-to-html.js +0 -0
- /package/dist/{core/export-html → runtime/html-export}/ansi-to-html.ts +0 -0
- /package/dist/{core/export-html → runtime/html-export}/index.d.ts +0 -0
- /package/dist/{core/export-html → runtime/html-export}/template.css +0 -0
- /package/dist/{core/export-html → runtime/html-export}/template.html +0 -0
- /package/dist/{core/export-html → runtime/html-export}/template.js +0 -0
- /package/dist/{core/export-html → runtime/html-export}/tool-renderer.js +0 -0
- /package/dist/{core/export-html → runtime/html-export}/vendor/highlight.min.js +0 -0
- /package/dist/{core/export-html → runtime/html-export}/vendor/marked.min.js +0 -0
- /package/dist/{core → runtime}/keybindings.d.ts +0 -0
- /package/dist/{core → runtime}/keybindings.js +0 -0
- /package/dist/{core/hooks → runtime/lifecycle}/index.d.ts +0 -0
- /package/dist/{core/hooks → runtime/lifecycle}/index.js +0 -0
- /package/dist/{core/hooks → runtime/lifecycle}/loader.d.ts +0 -0
- /package/dist/{core/hooks → runtime/lifecycle}/loader.js +0 -0
- /package/dist/{core/hooks → runtime/lifecycle}/runner.d.ts +0 -0
- /package/dist/{core/hooks → runtime/lifecycle}/runner.js +0 -0
- /package/dist/{core/hooks → runtime/lifecycle}/types.d.ts +0 -0
- /package/dist/{core/hooks → runtime/lifecycle}/types.js +0 -0
- /package/dist/{core → runtime}/messages.d.ts +0 -0
- /package/dist/{core → runtime}/messages.js +0 -0
- /package/dist/{core → runtime}/model-registry.d.ts +0 -0
- /package/dist/{core → runtime}/model-registry.js +0 -0
- /package/dist/{core → runtime}/model-resolver.d.ts +0 -0
- /package/dist/{core → runtime}/package-manager.d.ts +0 -0
- /package/dist/{core → runtime}/package-manager.js +0 -0
- /package/dist/{core/extensions → runtime/plugins}/index.d.ts +0 -0
- /package/dist/{core/extensions → runtime/plugins}/index.js +0 -0
- /package/dist/{core/extensions → runtime/plugins}/loader.d.ts +0 -0
- /package/dist/{core/extensions → runtime/plugins}/loader.js +0 -0
- /package/dist/{core/extensions → runtime/plugins}/runner.d.ts +0 -0
- /package/dist/{core/extensions → runtime/plugins}/types.js +0 -0
- /package/dist/{core/extensions → runtime/plugins}/wrapper.js +0 -0
- /package/dist/{core → runtime}/prompt-templates.d.ts +0 -0
- /package/dist/{core → runtime}/session-manager.d.ts +0 -0
- /package/dist/{core → runtime}/session-manager.js +0 -0
- /package/dist/{core → runtime}/settings-manager.d.ts +0 -0
- /package/dist/{core → runtime}/settings-manager.js +0 -0
- /package/dist/{core → runtime}/skills.d.ts +0 -0
- /package/dist/{core → runtime}/subagents.d.ts +0 -0
- /package/dist/{core → runtime}/system-prompt.d.ts +0 -0
- /package/dist/{core → runtime}/system-prompt.js +0 -0
- /package/dist/{core → runtime}/task-session-manager.d.ts +0 -0
- /package/dist/{core → runtime}/task-session-manager.js +0 -0
- /package/dist/{core → runtime}/timings.d.ts +0 -0
- /package/dist/{core → runtime}/timings.js +0 -0
- /package/dist/{core → runtime}/todo-store.d.ts +0 -0
- /package/dist/{core → runtime}/todo-store.js +0 -0
- /package/dist/{core/tools → runtime/tooling}/bash.d.ts +0 -0
- /package/dist/{core/tools → runtime/tooling}/bash.js +0 -0
- /package/dist/{core/tools → runtime/tooling}/bg-process.d.ts +0 -0
- /package/dist/{core/tools → runtime/tooling}/bg-process.js +0 -0
- /package/dist/{core/tools → runtime/tooling}/edit-diff.d.ts +0 -0
- /package/dist/{core/tools → runtime/tooling}/edit-diff.js +0 -0
- /package/dist/{core/tools → runtime/tooling}/edit.d.ts +0 -0
- /package/dist/{core/tools → runtime/tooling}/edit.js +0 -0
- /package/dist/{core/tools → runtime/tooling}/find.d.ts +0 -0
- /package/dist/{core/tools → runtime/tooling}/find.js +0 -0
- /package/dist/{core/tools → runtime/tooling}/grep.d.ts +0 -0
- /package/dist/{core/tools → runtime/tooling}/grep.js +0 -0
- /package/dist/{core/tools → runtime/tooling}/index.js +0 -0
- /package/dist/{core/tools → runtime/tooling}/ls.d.ts +0 -0
- /package/dist/{core/tools → runtime/tooling}/ls.js +0 -0
- /package/dist/{core/tools → runtime/tooling}/memory.d.ts +0 -0
- /package/dist/{core/tools → runtime/tooling}/memory.js +0 -0
- /package/dist/{core/tools → runtime/tooling}/path-utils.d.ts +0 -0
- /package/dist/{core/tools → runtime/tooling}/path-utils.js +0 -0
- /package/dist/{core/tools → runtime/tooling}/read.d.ts +0 -0
- /package/dist/{core/tools → runtime/tooling}/read.js +0 -0
- /package/dist/{core/tools → runtime/tooling}/registry.d.ts +0 -0
- /package/dist/{core/tools → runtime/tooling}/registry.js +0 -0
- /package/dist/{core/tools → runtime/tooling}/task.d.ts +0 -0
- /package/dist/{core/tools → runtime/tooling}/task.js +0 -0
- /package/dist/{core/tools → runtime/tooling}/todo.d.ts +0 -0
- /package/dist/{core/tools → runtime/tooling}/todo.js +0 -0
- /package/dist/{core/tools → runtime/tooling}/truncate.d.ts +0 -0
- /package/dist/{core/tools → runtime/tooling}/truncate.js +0 -0
- /package/dist/{core/tools → runtime/tooling}/webfetch.d.ts +0 -0
- /package/dist/{core/tools → runtime/tooling}/webfetch.js +0 -0
- /package/dist/{core/tools → runtime/tooling}/websearch.d.ts +0 -0
- /package/dist/{core/tools → runtime/tooling}/websearch.js +0 -0
- /package/dist/{core/tools → runtime/tooling}/write.d.ts +0 -0
- /package/dist/{core/tools → runtime/tooling}/write.js +0 -0
- /package/dist/{observability → telemetry}/core/config.d.ts +0 -0
- /package/dist/{observability → telemetry}/core/config.js +0 -0
- /package/dist/{observability → telemetry}/core/event-bus.d.ts +0 -0
- /package/dist/{observability → telemetry}/core/event-bus.js +0 -0
- /package/dist/{observability → telemetry}/core/index.d.ts +0 -0
- /package/dist/{observability → telemetry}/core/index.js +0 -0
- /package/dist/{observability → telemetry}/core/observability.d.ts +0 -0
- /package/dist/{observability → telemetry}/core/observability.js +0 -0
- /package/dist/{observability → telemetry}/core/span.d.ts +0 -0
- /package/dist/{observability → telemetry}/core/span.js +0 -0
- /package/dist/{observability → telemetry}/core/tracer.d.ts +0 -0
- /package/dist/{observability → telemetry}/core/tracer.js +0 -0
- /package/dist/{observability → telemetry}/core/types.d.ts +0 -0
- /package/dist/{observability → telemetry}/core/types.js +0 -0
- /package/dist/{observability → telemetry}/exporters/base-exporter.d.ts +0 -0
- /package/dist/{observability → telemetry}/exporters/base-exporter.js +0 -0
- /package/dist/{observability → telemetry}/exporters/console-exporter.d.ts +0 -0
- /package/dist/{observability → telemetry}/exporters/console-exporter.js +0 -0
- /package/dist/{observability → telemetry}/exporters/file-exporter.d.ts +0 -0
- /package/dist/{observability → telemetry}/exporters/file-exporter.js +0 -0
- /package/dist/{observability → telemetry}/exporters/index.d.ts +0 -0
- /package/dist/{observability → telemetry}/exporters/index.js +0 -0
- /package/dist/{observability → telemetry}/exporters/langfuse-exporter.d.ts +0 -0
- /package/dist/{observability → telemetry}/exporters/langfuse-exporter.js +0 -0
- /package/dist/{observability → telemetry}/exporters/sentry-exporter.d.ts +0 -0
- /package/dist/{observability → telemetry}/exporters/sentry-exporter.js +0 -0
- /package/dist/{observability → telemetry}/index.d.ts +0 -0
- /package/dist/{observability → telemetry}/index.js +0 -0
- /package/{docs → guides}/PI_MONO_MIT_REMOVAL_GUIDE.md +0 -0
- /package/{docs → guides}/SAME_TO_SAME_PARITY_REPORT.md +0 -0
|
@@ -1,1001 +0,0 @@
|
|
|
1
|
-
import * as os from "node:os";
|
|
2
|
-
import { Box, Container, getCapabilities, getImageDimensions, Image, imageFallback, Spacer, Text, truncateToWidth, } from "indusagi/tui";
|
|
3
|
-
import stripAnsi from "strip-ansi";
|
|
4
|
-
import { computeEditDiff } from "indusagi/agent";
|
|
5
|
-
import { allTools } from "../../../core/tools/index.js";
|
|
6
|
-
import { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize } from "indusagi/agent";
|
|
7
|
-
import { convertToPng } from "../../../utils/image-convert.js";
|
|
8
|
-
import { sanitizeBinaryOutput } from "../../../utils/shell.js";
|
|
9
|
-
import { getLanguageFromPath, highlightCode, theme } from "../theme/theme.js";
|
|
10
|
-
import { renderDiff } from "./diff.js";
|
|
11
|
-
import { keyHint } from "./keybinding-hints.js";
|
|
12
|
-
import { truncateToVisualLines } from "./visual-truncate.js";
|
|
13
|
-
// Preview line limit for bash when not expanded
|
|
14
|
-
const BASH_PREVIEW_LINES = 5;
|
|
15
|
-
/**
|
|
16
|
-
* ============================================================================
|
|
17
|
-
* TOOL EXECUTION COMPONENT - COMPREHENSIVE RENDERING MODULE
|
|
18
|
-
* ============================================================================
|
|
19
|
-
*
|
|
20
|
-
* PURPOSE:
|
|
21
|
-
* ============================================================================
|
|
22
|
-
* Renders tool call invocations and their results in the interactive chat
|
|
23
|
-
* interface. This component is the primary display system for all tool
|
|
24
|
-
* execution in the agent, supporting:
|
|
25
|
-
*
|
|
26
|
-
* - Built-in tools (read, write, edit, bash, ls, find, grep, task, todos)
|
|
27
|
-
* - Custom tools with extension renderers
|
|
28
|
-
* - Real-time result streaming and updates
|
|
29
|
-
* - Expandable/collapsible output (respects toolOutputExpanded setting)
|
|
30
|
-
* - Syntax highlighting (code blocks, diffs, file paths)
|
|
31
|
-
* - Image rendering (with format conversion for compatibility)
|
|
32
|
-
* - Error states and partial results
|
|
33
|
-
* - Truncation warnings (context limit, output limit)
|
|
34
|
-
*
|
|
35
|
-
* TOOL-SPECIFIC RENDERING:
|
|
36
|
-
* Each tool has specialized rendering logic:
|
|
37
|
-
* - read: File contents with line numbers, highlighting
|
|
38
|
-
* - write: File creation preview, error display
|
|
39
|
-
* - edit: Visual diff (added/removed lines), line numbers
|
|
40
|
-
* - bash: Command + output with visual line truncation
|
|
41
|
-
* - ls/find/grep: Formatted output with entry limits
|
|
42
|
-
* - task: Metadata (subagent, duration, tool count)
|
|
43
|
-
* - todos: Status icons, priority coloring, completion count
|
|
44
|
-
*
|
|
45
|
-
* DATA FLOW:
|
|
46
|
-
* ============================================================================
|
|
47
|
-
* Tool Execution Pipeline:
|
|
48
|
-
* Assistant message with tool call content
|
|
49
|
-
* ↓
|
|
50
|
-
* InteractiveMode.renderSessionContext() encounters tool call
|
|
51
|
-
* ↓
|
|
52
|
-
* ToolExecutionComponent created with tool name + args
|
|
53
|
-
* ↓
|
|
54
|
-
* updateDisplay() renders pending state (no result yet)
|
|
55
|
-
* ↓
|
|
56
|
-
* Tool executes in background (on agent server)
|
|
57
|
-
* ↓
|
|
58
|
-
* AgentSession emits tool_output event
|
|
59
|
-
* ↓
|
|
60
|
-
* InteractiveMode.subscribeToAgent() receives tool_output
|
|
61
|
-
* ↓
|
|
62
|
-
* component.updateResult() called with result content
|
|
63
|
-
* ↓
|
|
64
|
-
* updateDisplay() re-renders with result + background color
|
|
65
|
-
* ↓
|
|
66
|
-
* TUI invalidate() and requestRender()
|
|
67
|
-
* ↓
|
|
68
|
-
* Terminal displays complete tool execution
|
|
69
|
-
*
|
|
70
|
-
* Streaming Tool Output:
|
|
71
|
-
* Some tools (bash, read, find) stream output:
|
|
72
|
-
* 1. tool_output event arrives with isPartial=true
|
|
73
|
-
* 2. updateResult() called, still showing pending background
|
|
74
|
-
* 3. Later, tool_output event with isPartial=false (complete)
|
|
75
|
-
* 4. updateDisplay() shows final result + success/error background
|
|
76
|
-
*
|
|
77
|
-
* Async Operations:
|
|
78
|
-
* - Edit diff computation: async computeEditDiff() with caching
|
|
79
|
-
* - Image format conversion: async convertToPng() for Kitty protocol
|
|
80
|
-
* - Both update display when complete via ui.requestRender()
|
|
81
|
-
*
|
|
82
|
-
* RENDERING PIPELINE:
|
|
83
|
-
* ============================================================================
|
|
84
|
-
* Component Structure (ASCII):
|
|
85
|
-
* ┌───────────────────────────────────────────────────────────┐
|
|
86
|
-
* │ [Spacer 1 line] │ ← Top margin
|
|
87
|
-
* ├───────────────────────────────────────────────────────────┤
|
|
88
|
-
* │ PENDING STATE (while tool executing) │
|
|
89
|
-
* │ ████████████████████████████████████████████████████████ │ ← toolPendingBg
|
|
90
|
-
* │ █ read /path/to/file.ts:10-20 █
|
|
91
|
-
* │ █ (Executing...) █
|
|
92
|
-
* │ ████████████████████████████████████████████████████████ │
|
|
93
|
-
* ├───────────────────────────────────────────────────────────┤
|
|
94
|
-
* │ COMPLETE STATE (after result arrives) │
|
|
95
|
-
* │ ████████████████████████████████████████████████████████ │ ← toolSuccessBg or toolErrorBg
|
|
96
|
-
* │ █ read /path/to/file.ts:10-20 │
|
|
97
|
-
* │ █ │
|
|
98
|
-
* │ █ 10 | import { foo } from 'bar'; │
|
|
99
|
-
* │ █ 11 | const x = foo(); │
|
|
100
|
-
* │ █ 12 | export { x }; │
|
|
101
|
-
* │ █ ... (5 more lines, to expand) │
|
|
102
|
-
* │ ████████████████████████████████████████████████████████ │
|
|
103
|
-
* ├───────────────────────────────────────────────────────────┤
|
|
104
|
-
* │ [Image 1: 640×480 pixels] │ ← Images (optional)
|
|
105
|
-
* ├───────────────────────────────────────────────────────────┤
|
|
106
|
-
* │ [Image 2: 800×600 pixels] │
|
|
107
|
-
* └───────────────────────────────────────────────────────────┘
|
|
108
|
-
*
|
|
109
|
-
* Background Color State Machine:
|
|
110
|
-
* 1. Initial: toolPendingBg (dark, neutral color)
|
|
111
|
-
* 2. Streaming: toolPendingBg (stays same while partial=true)
|
|
112
|
-
* 3. Success: toolSuccessBg (green tint, indicates success)
|
|
113
|
-
* 4. Error: toolErrorBg (red tint, indicates failure)
|
|
114
|
-
* 5. Partial: toolPendingBg (still running, don't show final color)
|
|
115
|
-
*
|
|
116
|
-
* Rendering Decision Tree:
|
|
117
|
-
* Tool in allTools? (built-in)
|
|
118
|
-
* ├─ Yes + tool=bash → Box with visual truncation
|
|
119
|
-
* ├─ Yes + tool=edit → Text with diff rendering
|
|
120
|
-
* ├─ Yes + tool=read → Text with syntax highlighting
|
|
121
|
-
* ├─ Yes + others → Text with formatted output
|
|
122
|
-
* └─ No → Check for custom renderer
|
|
123
|
-
* Custom tool with renderCall?
|
|
124
|
-
* ├─ Yes → Use custom renderCall component
|
|
125
|
-
* └─ No → Show tool name
|
|
126
|
-
* Custom tool with renderResult?
|
|
127
|
-
* ├─ Yes → Use custom renderResult component
|
|
128
|
-
* └─ No → Show formatted text output
|
|
129
|
-
*
|
|
130
|
-
* STYLING/FORMATTING:
|
|
131
|
-
* ============================================================================
|
|
132
|
-
* Background Colors:
|
|
133
|
-
* - Pending: theme.bg("toolPendingBg", text) [neutral gray]
|
|
134
|
-
* - Success: theme.bg("toolSuccessBg", text) [subtle green]
|
|
135
|
-
* - Error: theme.bg("toolErrorBg", text) [subtle red]
|
|
136
|
-
* - Colors apply to entire tool execution box
|
|
137
|
-
*
|
|
138
|
-
* Text Colors (within background):
|
|
139
|
-
* - Tool name: theme.fg("toolTitle", theme.bold(name))
|
|
140
|
-
* - File path: theme.fg("accent", path)
|
|
141
|
-
* - Line numbers: theme.fg("warning", ":10-20")
|
|
142
|
-
* - Output: theme.fg("toolOutput", output)
|
|
143
|
-
* - Error text: theme.fg("error", message)
|
|
144
|
-
* - Warning: theme.fg("warning", "[Truncated...]")
|
|
145
|
-
* - Muted: theme.fg("muted", "... (5 more lines,")
|
|
146
|
-
*
|
|
147
|
-
* Code Highlighting:
|
|
148
|
-
* - getLanguageFromPath(): Detect language from file extension
|
|
149
|
-
* - highlightCode(): ANSI syntax highlighting via highlight.js
|
|
150
|
-
* - Tabs replaced with 3 spaces for consistent rendering
|
|
151
|
-
* - Applied to read, write, and custom tool outputs
|
|
152
|
-
*
|
|
153
|
-
* Diff Rendering (edit tool):
|
|
154
|
-
* - renderDiff(): Specialized diff component
|
|
155
|
-
* - Shows added/removed lines with colors
|
|
156
|
-
* - Line numbers with context
|
|
157
|
-
* - File path with first changed line number
|
|
158
|
-
*
|
|
159
|
-
* Layout Spacing:
|
|
160
|
-
* - paddingY=1, paddingX=1 for Box/Text components
|
|
161
|
-
* - Spacer(1) above tool execution
|
|
162
|
-
* - Spacer(1) between tool and images
|
|
163
|
-
* - Blank lines in output for readability
|
|
164
|
-
*
|
|
165
|
-
* EXAMPLES:
|
|
166
|
-
* ============================================================================
|
|
167
|
-
*
|
|
168
|
-
* Example 1: Read Tool - File Contents
|
|
169
|
-
* ─────────────────────────────────────
|
|
170
|
-
* Input: read file="/src/main.ts" limit=5
|
|
171
|
-
* Rendered:
|
|
172
|
-
* ┌──────────────────────────────────┐
|
|
173
|
-
* │ read ~/src/main.ts:1-5 │
|
|
174
|
-
* │ │
|
|
175
|
-
* │ 1 | import { foo } from 'bar'; │
|
|
176
|
-
* │ 2 | const x = 42; │
|
|
177
|
-
* │ 3 | export { x }; │
|
|
178
|
-
* │ ... (27 more lines, to expand) │
|
|
179
|
-
* └──────────────────────────────────┘
|
|
180
|
-
*
|
|
181
|
-
* Example 2: Edit Tool - Visual Diff
|
|
182
|
-
* ──────────────────────────────────
|
|
183
|
-
* Input: edit path="/src/main.ts" oldText="const x = 1;" newText="const x = 42;"
|
|
184
|
-
* Rendered:
|
|
185
|
-
* ┌──────────────────────────────────────┐
|
|
186
|
-
* │ edit ~/src/main.ts:10 │
|
|
187
|
-
* │ │
|
|
188
|
-
* │ 10 - const x = 1; │
|
|
189
|
-
* │ 10 + const x = 42; │
|
|
190
|
-
* └──────────────────────────────────────┘
|
|
191
|
-
*
|
|
192
|
-
* Example 3: Bash Tool - Command Output
|
|
193
|
-
* ────────────────────────────────────
|
|
194
|
-
* Input: bash command="ls -la" timeout=5
|
|
195
|
-
* Rendered (collapsed):
|
|
196
|
-
* ┌──────────────────────────────────────┐
|
|
197
|
-
* │ $ ls -la (timeout 5s) │
|
|
198
|
-
* │ │
|
|
199
|
-
* │ total 128 │
|
|
200
|
-
* │ drwxr-xr-x 5 user wheel 160 │
|
|
201
|
-
* │ -rw-r--r-- 1 user wheel 1234 │
|
|
202
|
-
* │ ... (7 more lines, to expand) │
|
|
203
|
-
* └──────────────────────────────────────┘
|
|
204
|
-
*
|
|
205
|
-
* Example 4: Error Result
|
|
206
|
-
* ──────────────────────
|
|
207
|
-
* Tool fails, returns error
|
|
208
|
-
* Rendered:
|
|
209
|
-
* ┌──────────────────────────────────────┐ ← toolErrorBg (red tint)
|
|
210
|
-
* │ read ~/nonexistent/file.txt │
|
|
211
|
-
* │ │
|
|
212
|
-
* │ Error: ENOENT: no such file or dir │
|
|
213
|
-
* └──────────────────────────────────────┘
|
|
214
|
-
*
|
|
215
|
-
* Example 5: Tool with Images
|
|
216
|
-
* ───────────────────────────
|
|
217
|
-
* Bash tool that outputs PNG image
|
|
218
|
-
* Rendered:
|
|
219
|
-
* ┌──────────────────────────────────────┐
|
|
220
|
-
* │ $ generate_chart.sh │
|
|
221
|
-
* │ │
|
|
222
|
-
* │ Chart generated successfully │
|
|
223
|
-
* └──────────────────────────────────────┘
|
|
224
|
-
* [Image: 640×480 pixels, PNG]
|
|
225
|
-
*
|
|
226
|
-
* INTEGRATION:
|
|
227
|
-
* ============================================================================
|
|
228
|
-
* TUI Integration:
|
|
229
|
-
* - Extends Container (indusagi/tui base component)
|
|
230
|
-
* - Uses Box, Text, Image, Spacer components
|
|
231
|
-
* - Theme system: theme.fg(), theme.bg()
|
|
232
|
-
* - Automatic text wrapping to terminal width
|
|
233
|
-
* - Image rendering via indusagi/tui Image component
|
|
234
|
-
*
|
|
235
|
-
* Session Integration:
|
|
236
|
-
* - Created in InteractiveMode.renderSessionContext()
|
|
237
|
-
* - Updates come from AgentSession.on('tool_output')
|
|
238
|
-
* - Stored in chatContainer with tool calls
|
|
239
|
-
* - pendingTools map tracks incomplete tools
|
|
240
|
-
* - Expandable via toolOutputExpanded setting
|
|
241
|
-
*
|
|
242
|
-
* Extension Integration:
|
|
243
|
-
* - Supports custom renderCall() and renderResult()
|
|
244
|
-
* - Custom tools can provide their own renderers
|
|
245
|
-
* - Falls back to built-in rendering if no custom renderer
|
|
246
|
-
* - Passes theme object to custom renderers
|
|
247
|
-
*
|
|
248
|
-
* Image Integration:
|
|
249
|
-
* - Terminal capability detection via getCapabilities()
|
|
250
|
-
* - Kitty protocol requires PNG (auto-converts JPEG/GIF/WebP)
|
|
251
|
-
* - Image fallback for terminals without image support
|
|
252
|
-
* - Respects showImages setting
|
|
253
|
-
* - Image dimensions cached after first render
|
|
254
|
-
*
|
|
255
|
-
* Diff Integration:
|
|
256
|
-
* - computeEditDiff() runs async before tool execution
|
|
257
|
-
* - Preview diff shown while tool running (cached)
|
|
258
|
-
* - Final diff from tool result overrides preview (post-execution)
|
|
259
|
-
* - Handles race conditions (file modified between preview/execution)
|
|
260
|
-
*
|
|
261
|
-
* Performance Considerations:
|
|
262
|
-
* - Bash visual line truncation: Width-aware caching
|
|
263
|
-
* - Image conversion: Lazy async (doesn't block rendering)
|
|
264
|
-
* - Diff computation: Async with result override (non-blocking)
|
|
265
|
-
* - Tool output formatting: Cached in formatToolExecution()
|
|
266
|
-
* - Suitable for 50+ tools in conversation without lag
|
|
267
|
-
*/
|
|
268
|
-
function shortenPath(path) {
|
|
269
|
-
const home = os.homedir();
|
|
270
|
-
if (path.startsWith(home)) {
|
|
271
|
-
return `~${path.slice(home.length)}`;
|
|
272
|
-
}
|
|
273
|
-
return path;
|
|
274
|
-
}
|
|
275
|
-
/**
|
|
276
|
-
* Replace tabs with spaces for consistent rendering
|
|
277
|
-
*/
|
|
278
|
-
function replaceTabs(text) {
|
|
279
|
-
return text.replace(/\t/g, " ");
|
|
280
|
-
}
|
|
281
|
-
function resolveToolBackground(result, isPartial) {
|
|
282
|
-
if (isPartial) {
|
|
283
|
-
return (text) => theme.bg("toolPendingBg", text);
|
|
284
|
-
}
|
|
285
|
-
return result?.isError
|
|
286
|
-
? (text) => theme.bg("toolErrorBg", text)
|
|
287
|
-
: (text) => theme.bg("toolSuccessBg", text);
|
|
288
|
-
}
|
|
289
|
-
function getImageBlocks(result) {
|
|
290
|
-
return result?.content?.filter((content) => content.type === "image") || [];
|
|
291
|
-
}
|
|
292
|
-
/**
|
|
293
|
-
* Component that renders a tool call with its result (updateable)
|
|
294
|
-
*/
|
|
295
|
-
export class ToolExecutionComponent extends Container {
|
|
296
|
-
constructor(toolName, args, options = {}, toolDefinition, ui, cwd = process.cwd()) {
|
|
297
|
-
super();
|
|
298
|
-
this.imageComponents = [];
|
|
299
|
-
this.imageSpacers = [];
|
|
300
|
-
this.expanded = false;
|
|
301
|
-
this.isPartial = true;
|
|
302
|
-
// Cached converted images for Kitty protocol (which requires PNG), keyed by index
|
|
303
|
-
this.convertedImages = new Map();
|
|
304
|
-
this.toolName = toolName;
|
|
305
|
-
this.args = args;
|
|
306
|
-
this.showImages = options.showImages ?? true;
|
|
307
|
-
this.toolDefinition = toolDefinition;
|
|
308
|
-
this.ui = ui;
|
|
309
|
-
this.cwd = cwd;
|
|
310
|
-
this.addChild(new Spacer(1));
|
|
311
|
-
// Always create both - contentBox for custom tools/bash, contentText for other built-ins
|
|
312
|
-
this.contentBox = new Box(1, 1, (text) => theme.bg("toolPendingBg", text));
|
|
313
|
-
this.contentText = new Text("", 1, 1, (text) => theme.bg("toolPendingBg", text));
|
|
314
|
-
// Use contentBox for bash (visual truncation) or custom tools with custom renderers
|
|
315
|
-
// Use contentText for built-in tools (including overrides without custom renderers)
|
|
316
|
-
if (toolName === "bash" || (toolDefinition && !this.shouldUseBuiltInRenderer())) {
|
|
317
|
-
this.addChild(this.contentBox);
|
|
318
|
-
}
|
|
319
|
-
else {
|
|
320
|
-
this.addChild(this.contentText);
|
|
321
|
-
}
|
|
322
|
-
this.updateDisplay();
|
|
323
|
-
}
|
|
324
|
-
/**
|
|
325
|
-
* Check if we should use built-in rendering for this tool.
|
|
326
|
-
* Returns true if the tool name is a built-in AND either there's no toolDefinition
|
|
327
|
-
* or the toolDefinition doesn't provide custom renderers.
|
|
328
|
-
*/
|
|
329
|
-
shouldUseBuiltInRenderer() {
|
|
330
|
-
const isBuiltInName = this.toolName in allTools;
|
|
331
|
-
const hasCustomRenderers = this.toolDefinition?.renderCall || this.toolDefinition?.renderResult;
|
|
332
|
-
return isBuiltInName && !hasCustomRenderers;
|
|
333
|
-
}
|
|
334
|
-
updateArgs(args) {
|
|
335
|
-
this.args = args;
|
|
336
|
-
this.updateDisplay();
|
|
337
|
-
}
|
|
338
|
-
/**
|
|
339
|
-
* Signal that args are complete (tool is about to execute).
|
|
340
|
-
* This triggers diff computation for edit tool.
|
|
341
|
-
*/
|
|
342
|
-
setArgsComplete() {
|
|
343
|
-
this.maybeComputeEditDiff();
|
|
344
|
-
}
|
|
345
|
-
/**
|
|
346
|
-
* Compute edit diff preview when we have complete args.
|
|
347
|
-
* This runs async and updates display when done.
|
|
348
|
-
*/
|
|
349
|
-
maybeComputeEditDiff() {
|
|
350
|
-
if (this.toolName !== "edit")
|
|
351
|
-
return;
|
|
352
|
-
const path = this.args?.path;
|
|
353
|
-
const oldText = this.args?.oldText;
|
|
354
|
-
const newText = this.args?.newText;
|
|
355
|
-
// Need all three params to compute diff
|
|
356
|
-
if (!path || oldText === undefined || newText === undefined)
|
|
357
|
-
return;
|
|
358
|
-
// Create a key to track which args this computation is for
|
|
359
|
-
const argsKey = JSON.stringify({ path, oldText, newText });
|
|
360
|
-
// Skip if we already computed for these exact args
|
|
361
|
-
if (this.editDiffArgsKey === argsKey)
|
|
362
|
-
return;
|
|
363
|
-
this.editDiffArgsKey = argsKey;
|
|
364
|
-
// Compute diff async
|
|
365
|
-
computeEditDiff(path, oldText, newText, this.cwd).then((result) => {
|
|
366
|
-
// Only update if args haven't changed since we started
|
|
367
|
-
if (this.editDiffArgsKey === argsKey) {
|
|
368
|
-
this.editDiffPreview = result;
|
|
369
|
-
this.updateDisplay();
|
|
370
|
-
this.ui.requestRender();
|
|
371
|
-
}
|
|
372
|
-
});
|
|
373
|
-
}
|
|
374
|
-
updateResult(result, isPartial = false) {
|
|
375
|
-
this.result = result;
|
|
376
|
-
this.isPartial = isPartial;
|
|
377
|
-
this.updateDisplay();
|
|
378
|
-
// Convert non-PNG images to PNG for Kitty protocol (async)
|
|
379
|
-
this.maybeConvertImagesForKitty();
|
|
380
|
-
}
|
|
381
|
-
/**
|
|
382
|
-
* Convert non-PNG images to PNG for Kitty graphics protocol.
|
|
383
|
-
* Kitty requires PNG format (f=100), so JPEG/GIF/WebP won't display.
|
|
384
|
-
*/
|
|
385
|
-
maybeConvertImagesForKitty() {
|
|
386
|
-
const caps = getCapabilities();
|
|
387
|
-
// Only needed for Kitty protocol
|
|
388
|
-
if (caps.images !== "kitty")
|
|
389
|
-
return;
|
|
390
|
-
if (!this.result)
|
|
391
|
-
return;
|
|
392
|
-
const imageBlocks = getImageBlocks(this.result);
|
|
393
|
-
for (let i = 0; i < imageBlocks.length; i++) {
|
|
394
|
-
const img = imageBlocks[i];
|
|
395
|
-
if (!img.data || !img.mimeType)
|
|
396
|
-
continue;
|
|
397
|
-
// Skip if already PNG or already converted
|
|
398
|
-
if (img.mimeType === "image/png")
|
|
399
|
-
continue;
|
|
400
|
-
if (this.convertedImages.has(i))
|
|
401
|
-
continue;
|
|
402
|
-
// Convert async
|
|
403
|
-
const index = i;
|
|
404
|
-
convertToPng(img.data, img.mimeType).then((converted) => {
|
|
405
|
-
if (converted) {
|
|
406
|
-
this.convertedImages.set(index, converted);
|
|
407
|
-
this.updateDisplay();
|
|
408
|
-
this.ui.requestRender();
|
|
409
|
-
}
|
|
410
|
-
});
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
setExpanded(expanded) {
|
|
414
|
-
this.expanded = expanded;
|
|
415
|
-
this.updateDisplay();
|
|
416
|
-
}
|
|
417
|
-
setShowImages(show) {
|
|
418
|
-
this.showImages = show;
|
|
419
|
-
this.updateDisplay();
|
|
420
|
-
}
|
|
421
|
-
invalidate() {
|
|
422
|
-
super.invalidate();
|
|
423
|
-
this.updateDisplay();
|
|
424
|
-
}
|
|
425
|
-
updateDisplay() {
|
|
426
|
-
const bgFn = resolveToolBackground(this.result, this.isPartial);
|
|
427
|
-
// Use built-in rendering for built-in tools (or overrides without custom renderers)
|
|
428
|
-
if (this.shouldUseBuiltInRenderer()) {
|
|
429
|
-
if (this.toolName === "bash") {
|
|
430
|
-
// Bash uses Box with visual line truncation
|
|
431
|
-
this.contentBox.setBgFn(bgFn);
|
|
432
|
-
this.contentBox.clear();
|
|
433
|
-
this.renderBashContent();
|
|
434
|
-
}
|
|
435
|
-
else {
|
|
436
|
-
// Other built-in tools: use Text directly with caching
|
|
437
|
-
this.contentText.setCustomBgFn(bgFn);
|
|
438
|
-
this.contentText.setText(this.formatToolExecution());
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
else if (this.toolDefinition) {
|
|
442
|
-
// Custom tools use Box for flexible component rendering
|
|
443
|
-
this.contentBox.setBgFn(bgFn);
|
|
444
|
-
this.contentBox.clear();
|
|
445
|
-
// Render call component
|
|
446
|
-
if (this.toolDefinition.renderCall) {
|
|
447
|
-
try {
|
|
448
|
-
const callComponent = this.toolDefinition.renderCall(this.args, theme);
|
|
449
|
-
if (callComponent) {
|
|
450
|
-
this.contentBox.addChild(callComponent);
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
catch {
|
|
454
|
-
// Fall back to default on error
|
|
455
|
-
this.contentBox.addChild(new Text(theme.fg("toolTitle", theme.bold(this.toolName)), 0, 0));
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
else {
|
|
459
|
-
// No custom renderCall, show tool name
|
|
460
|
-
this.contentBox.addChild(new Text(theme.fg("toolTitle", theme.bold(this.toolName)), 0, 0));
|
|
461
|
-
}
|
|
462
|
-
// Render result component if we have a result
|
|
463
|
-
if (this.result && this.toolDefinition.renderResult) {
|
|
464
|
-
try {
|
|
465
|
-
const resultComponent = this.toolDefinition.renderResult({ content: this.result.content, details: this.result.details }, { expanded: this.expanded, isPartial: this.isPartial }, theme);
|
|
466
|
-
if (resultComponent) {
|
|
467
|
-
this.contentBox.addChild(resultComponent);
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
catch {
|
|
471
|
-
// Fall back to showing raw output on error
|
|
472
|
-
const output = this.getTextOutput();
|
|
473
|
-
if (output) {
|
|
474
|
-
this.contentBox.addChild(new Text(theme.fg("toolOutput", output), 0, 0));
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
else if (this.result) {
|
|
479
|
-
// Has result but no custom renderResult
|
|
480
|
-
const output = this.getTextOutput();
|
|
481
|
-
if (output) {
|
|
482
|
-
this.contentBox.addChild(new Text(theme.fg("toolOutput", output), 0, 0));
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
// Handle images (same for both custom and built-in)
|
|
487
|
-
for (const img of this.imageComponents) {
|
|
488
|
-
this.removeChild(img);
|
|
489
|
-
}
|
|
490
|
-
this.imageComponents = [];
|
|
491
|
-
for (const spacer of this.imageSpacers) {
|
|
492
|
-
this.removeChild(spacer);
|
|
493
|
-
}
|
|
494
|
-
this.imageSpacers = [];
|
|
495
|
-
if (this.result) {
|
|
496
|
-
const imageBlocks = getImageBlocks(this.result);
|
|
497
|
-
const caps = getCapabilities();
|
|
498
|
-
for (let i = 0; i < imageBlocks.length; i++) {
|
|
499
|
-
const img = imageBlocks[i];
|
|
500
|
-
if (caps.images && this.showImages && img.data && img.mimeType) {
|
|
501
|
-
// Use converted PNG for Kitty protocol if available
|
|
502
|
-
const converted = this.convertedImages.get(i);
|
|
503
|
-
const imageData = converted?.data ?? img.data;
|
|
504
|
-
const imageMimeType = converted?.mimeType ?? img.mimeType;
|
|
505
|
-
// For Kitty, skip non-PNG images that haven't been converted yet
|
|
506
|
-
if (caps.images === "kitty" && imageMimeType !== "image/png") {
|
|
507
|
-
continue;
|
|
508
|
-
}
|
|
509
|
-
const spacer = new Spacer(1);
|
|
510
|
-
this.addChild(spacer);
|
|
511
|
-
this.imageSpacers.push(spacer);
|
|
512
|
-
const imageComponent = new Image(imageData, imageMimeType, { fallbackColor: (s) => theme.fg("toolOutput", s) }, { maxWidthCells: 60 });
|
|
513
|
-
this.imageComponents.push(imageComponent);
|
|
514
|
-
this.addChild(imageComponent);
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
/**
|
|
520
|
-
* Render bash content using visual line truncation (like bash-execution.ts)
|
|
521
|
-
*/
|
|
522
|
-
renderBashContent() {
|
|
523
|
-
const command = this.args?.command || "";
|
|
524
|
-
const timeout = this.args?.timeout;
|
|
525
|
-
// Header
|
|
526
|
-
const timeoutSuffix = timeout ? theme.fg("muted", ` (timeout ${timeout}s)`) : "";
|
|
527
|
-
this.contentBox.addChild(new Text(theme.fg("toolTitle", theme.bold(`$ ${command || theme.fg("toolOutput", "...")}`)) + timeoutSuffix, 0, 0));
|
|
528
|
-
if (this.result) {
|
|
529
|
-
const output = this.getTextOutput().trim();
|
|
530
|
-
if (output) {
|
|
531
|
-
// Style each line for the output
|
|
532
|
-
const styledOutput = output
|
|
533
|
-
.split("\n")
|
|
534
|
-
.map((line) => theme.fg("toolOutput", line))
|
|
535
|
-
.join("\n");
|
|
536
|
-
if (this.expanded) {
|
|
537
|
-
// Show all lines when expanded
|
|
538
|
-
this.contentBox.addChild(new Text(`\n${styledOutput}`, 0, 0));
|
|
539
|
-
}
|
|
540
|
-
else {
|
|
541
|
-
// Use visual line truncation when collapsed with width-aware caching
|
|
542
|
-
let cachedWidth;
|
|
543
|
-
let cachedLines;
|
|
544
|
-
let cachedSkipped;
|
|
545
|
-
this.contentBox.addChild({
|
|
546
|
-
render: (width) => {
|
|
547
|
-
if (cachedLines === undefined || cachedWidth !== width) {
|
|
548
|
-
const result = truncateToVisualLines(styledOutput, BASH_PREVIEW_LINES, width);
|
|
549
|
-
cachedLines = result.visualLines;
|
|
550
|
-
cachedSkipped = result.skippedCount;
|
|
551
|
-
cachedWidth = width;
|
|
552
|
-
}
|
|
553
|
-
if (cachedSkipped && cachedSkipped > 0) {
|
|
554
|
-
const hint = theme.fg("muted", `... (${cachedSkipped} earlier lines,`) +
|
|
555
|
-
` ${keyHint("expandTools", "to expand")})`;
|
|
556
|
-
return ["", truncateToWidth(hint, width, "..."), ...cachedLines];
|
|
557
|
-
}
|
|
558
|
-
// Add blank line for spacing (matches expanded case)
|
|
559
|
-
return ["", ...cachedLines];
|
|
560
|
-
},
|
|
561
|
-
invalidate: () => {
|
|
562
|
-
cachedWidth = undefined;
|
|
563
|
-
cachedLines = undefined;
|
|
564
|
-
cachedSkipped = undefined;
|
|
565
|
-
},
|
|
566
|
-
});
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
// Truncation warnings
|
|
570
|
-
const truncation = this.result.details?.truncation;
|
|
571
|
-
const fullOutputPath = this.result.details?.fullOutputPath;
|
|
572
|
-
if (truncation?.truncated || fullOutputPath) {
|
|
573
|
-
const warnings = [];
|
|
574
|
-
if (fullOutputPath) {
|
|
575
|
-
warnings.push(`Full output: ${fullOutputPath}`);
|
|
576
|
-
}
|
|
577
|
-
if (truncation?.truncated) {
|
|
578
|
-
if (truncation.truncatedBy === "lines") {
|
|
579
|
-
warnings.push(`Truncated: showing ${truncation.outputLines} of ${truncation.totalLines} lines`);
|
|
580
|
-
}
|
|
581
|
-
else {
|
|
582
|
-
warnings.push(`Truncated: ${truncation.outputLines} lines shown (${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit)`);
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
this.contentBox.addChild(new Text(`\n${theme.fg("warning", `[${warnings.join(". ")}]`)}`, 0, 0));
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
getTextOutput() {
|
|
590
|
-
if (!this.result)
|
|
591
|
-
return "";
|
|
592
|
-
const textBlocks = this.result.content?.filter((c) => c.type === "text") || [];
|
|
593
|
-
const imageBlocks = this.result.content?.filter((c) => c.type === "image") || [];
|
|
594
|
-
let output = textBlocks
|
|
595
|
-
.map((c) => {
|
|
596
|
-
// Use sanitizeBinaryOutput to handle binary data that crashes string-width
|
|
597
|
-
return sanitizeBinaryOutput(stripAnsi(c.text || "")).replace(/\r/g, "");
|
|
598
|
-
})
|
|
599
|
-
.join("\n");
|
|
600
|
-
const caps = getCapabilities();
|
|
601
|
-
if (imageBlocks.length > 0 && (!caps.images || !this.showImages)) {
|
|
602
|
-
const imageIndicators = imageBlocks
|
|
603
|
-
.map((img) => {
|
|
604
|
-
const dims = img.data ? (getImageDimensions(img.data, img.mimeType) ?? undefined) : undefined;
|
|
605
|
-
return imageFallback(img.mimeType, dims);
|
|
606
|
-
})
|
|
607
|
-
.join("\n");
|
|
608
|
-
output = output ? `${output}\n${imageIndicators}` : imageIndicators;
|
|
609
|
-
}
|
|
610
|
-
return output;
|
|
611
|
-
}
|
|
612
|
-
formatToolExecution() {
|
|
613
|
-
let text = "";
|
|
614
|
-
if (this.toolName === "read") {
|
|
615
|
-
const path = shortenPath(this.args?.file_path || this.args?.path || "");
|
|
616
|
-
const offset = this.args?.offset;
|
|
617
|
-
const limit = this.args?.limit;
|
|
618
|
-
let pathDisplay = path ? theme.fg("accent", path) : theme.fg("toolOutput", "...");
|
|
619
|
-
if (offset !== undefined || limit !== undefined) {
|
|
620
|
-
const startLine = offset ?? 1;
|
|
621
|
-
const endLine = limit !== undefined ? startLine + limit - 1 : "";
|
|
622
|
-
pathDisplay += theme.fg("warning", `:${startLine}${endLine ? `-${endLine}` : ""}`);
|
|
623
|
-
}
|
|
624
|
-
text = `${theme.fg("toolTitle", theme.bold("read"))} ${pathDisplay}`;
|
|
625
|
-
if (this.result) {
|
|
626
|
-
const output = this.getTextOutput();
|
|
627
|
-
const rawPath = this.args?.file_path || this.args?.path || "";
|
|
628
|
-
const lang = getLanguageFromPath(rawPath);
|
|
629
|
-
const lines = lang ? highlightCode(replaceTabs(output), lang) : output.split("\n");
|
|
630
|
-
const maxLines = this.expanded ? lines.length : 10;
|
|
631
|
-
const displayLines = lines.slice(0, maxLines);
|
|
632
|
-
const remaining = lines.length - maxLines;
|
|
633
|
-
text +=
|
|
634
|
-
"\n\n" +
|
|
635
|
-
displayLines
|
|
636
|
-
.map((line) => (lang ? replaceTabs(line) : theme.fg("toolOutput", replaceTabs(line))))
|
|
637
|
-
.join("\n");
|
|
638
|
-
if (remaining > 0) {
|
|
639
|
-
text += `${theme.fg("muted", `\n... (${remaining} more lines,`)} ${keyHint("expandTools", "to expand")})`;
|
|
640
|
-
}
|
|
641
|
-
const truncation = this.result.details?.truncation;
|
|
642
|
-
if (truncation?.truncated) {
|
|
643
|
-
if (truncation.firstLineExceedsLimit) {
|
|
644
|
-
text +=
|
|
645
|
-
"\n" +
|
|
646
|
-
theme.fg("warning", `[First line exceeds ${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit]`);
|
|
647
|
-
}
|
|
648
|
-
else if (truncation.truncatedBy === "lines") {
|
|
649
|
-
text +=
|
|
650
|
-
"\n" +
|
|
651
|
-
theme.fg("warning", `[Truncated: showing ${truncation.outputLines} of ${truncation.totalLines} lines (${truncation.maxLines ?? DEFAULT_MAX_LINES} line limit)]`);
|
|
652
|
-
}
|
|
653
|
-
else {
|
|
654
|
-
text +=
|
|
655
|
-
"\n" +
|
|
656
|
-
theme.fg("warning", `[Truncated: ${truncation.outputLines} lines shown (${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit)]`);
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
else if (this.toolName === "write") {
|
|
662
|
-
const rawPath = this.args?.file_path || this.args?.path || "";
|
|
663
|
-
const path = shortenPath(rawPath);
|
|
664
|
-
const fileContent = this.args?.content || "";
|
|
665
|
-
const lang = getLanguageFromPath(rawPath);
|
|
666
|
-
const lines = fileContent
|
|
667
|
-
? lang
|
|
668
|
-
? highlightCode(replaceTabs(fileContent), lang)
|
|
669
|
-
: fileContent.split("\n")
|
|
670
|
-
: [];
|
|
671
|
-
const totalLines = lines.length;
|
|
672
|
-
text =
|
|
673
|
-
theme.fg("toolTitle", theme.bold("write")) +
|
|
674
|
-
" " +
|
|
675
|
-
(path ? theme.fg("accent", path) : theme.fg("toolOutput", "..."));
|
|
676
|
-
if (fileContent) {
|
|
677
|
-
const maxLines = this.expanded ? lines.length : 10;
|
|
678
|
-
const displayLines = lines.slice(0, maxLines);
|
|
679
|
-
const remaining = lines.length - maxLines;
|
|
680
|
-
text +=
|
|
681
|
-
"\n\n" +
|
|
682
|
-
displayLines
|
|
683
|
-
.map((line) => (lang ? replaceTabs(line) : theme.fg("toolOutput", replaceTabs(line))))
|
|
684
|
-
.join("\n");
|
|
685
|
-
if (remaining > 0) {
|
|
686
|
-
text +=
|
|
687
|
-
theme.fg("muted", `\n... (${remaining} more lines, ${totalLines} total,`) +
|
|
688
|
-
` ${keyHint("expandTools", "to expand")})`;
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
// Show error if tool execution failed
|
|
692
|
-
if (this.result?.isError) {
|
|
693
|
-
const errorText = this.getTextOutput();
|
|
694
|
-
if (errorText) {
|
|
695
|
-
text += `\n\n${theme.fg("error", errorText)}`;
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
else if (this.toolName === "edit") {
|
|
700
|
-
const rawPath = this.args?.file_path || this.args?.path || "";
|
|
701
|
-
const path = shortenPath(rawPath);
|
|
702
|
-
// Build path display, appending :line if we have diff info
|
|
703
|
-
let pathDisplay = path ? theme.fg("accent", path) : theme.fg("toolOutput", "...");
|
|
704
|
-
const firstChangedLine = (this.editDiffPreview && "firstChangedLine" in this.editDiffPreview
|
|
705
|
-
? this.editDiffPreview.firstChangedLine
|
|
706
|
-
: undefined) ||
|
|
707
|
-
(this.result && !this.result.isError ? this.result.details?.firstChangedLine : undefined);
|
|
708
|
-
if (firstChangedLine) {
|
|
709
|
-
pathDisplay += theme.fg("warning", `:${firstChangedLine}`);
|
|
710
|
-
}
|
|
711
|
-
text = `${theme.fg("toolTitle", theme.bold("edit"))} ${pathDisplay}`;
|
|
712
|
-
if (this.result?.isError) {
|
|
713
|
-
// Show error from result
|
|
714
|
-
const errorText = this.getTextOutput();
|
|
715
|
-
if (errorText) {
|
|
716
|
-
text += `\n\n${theme.fg("error", errorText)}`;
|
|
717
|
-
}
|
|
718
|
-
}
|
|
719
|
-
else if (this.result?.details?.diff) {
|
|
720
|
-
// Tool executed successfully - use the diff from result
|
|
721
|
-
// This takes priority over editDiffPreview which may have a stale error
|
|
722
|
-
// due to race condition (async preview computed after file was modified)
|
|
723
|
-
text += `\n\n${renderDiff(this.result.details.diff, { filePath: rawPath })}`;
|
|
724
|
-
}
|
|
725
|
-
else if (this.editDiffPreview) {
|
|
726
|
-
// Use cached diff preview (before tool executes)
|
|
727
|
-
if ("error" in this.editDiffPreview) {
|
|
728
|
-
text += `\n\n${theme.fg("error", this.editDiffPreview.error)}`;
|
|
729
|
-
}
|
|
730
|
-
else if (this.editDiffPreview.diff) {
|
|
731
|
-
text += `\n\n${renderDiff(this.editDiffPreview.diff, { filePath: rawPath })}`;
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
else if (this.toolName === "ls") {
|
|
736
|
-
const path = shortenPath(this.args?.path || ".");
|
|
737
|
-
const limit = this.args?.limit;
|
|
738
|
-
text = `${theme.fg("toolTitle", theme.bold("ls"))} ${theme.fg("accent", path)}`;
|
|
739
|
-
if (limit !== undefined) {
|
|
740
|
-
text += theme.fg("toolOutput", ` (limit ${limit})`);
|
|
741
|
-
}
|
|
742
|
-
if (this.result) {
|
|
743
|
-
const output = this.getTextOutput().trim();
|
|
744
|
-
if (output) {
|
|
745
|
-
const lines = output.split("\n");
|
|
746
|
-
const maxLines = this.expanded ? lines.length : 20;
|
|
747
|
-
const displayLines = lines.slice(0, maxLines);
|
|
748
|
-
const remaining = lines.length - maxLines;
|
|
749
|
-
text += `\n\n${displayLines.map((line) => theme.fg("toolOutput", line)).join("\n")}`;
|
|
750
|
-
if (remaining > 0) {
|
|
751
|
-
text += `${theme.fg("muted", `\n... (${remaining} more lines,`)} ${keyHint("expandTools", "to expand")})`;
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
const entryLimit = this.result.details?.entryLimitReached;
|
|
755
|
-
const truncation = this.result.details?.truncation;
|
|
756
|
-
if (entryLimit || truncation?.truncated) {
|
|
757
|
-
const warnings = [];
|
|
758
|
-
if (entryLimit) {
|
|
759
|
-
warnings.push(`${entryLimit} entries limit`);
|
|
760
|
-
}
|
|
761
|
-
if (truncation?.truncated) {
|
|
762
|
-
warnings.push(`${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit`);
|
|
763
|
-
}
|
|
764
|
-
text += `\n${theme.fg("warning", `[Truncated: ${warnings.join(", ")}]`)}`;
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
else if (this.toolName === "find") {
|
|
769
|
-
const pattern = this.args?.pattern || "";
|
|
770
|
-
const path = shortenPath(this.args?.path || ".");
|
|
771
|
-
const limit = this.args?.limit;
|
|
772
|
-
text =
|
|
773
|
-
theme.fg("toolTitle", theme.bold("find")) +
|
|
774
|
-
" " +
|
|
775
|
-
theme.fg("accent", pattern) +
|
|
776
|
-
theme.fg("toolOutput", ` in ${path}`);
|
|
777
|
-
if (limit !== undefined) {
|
|
778
|
-
text += theme.fg("toolOutput", ` (limit ${limit})`);
|
|
779
|
-
}
|
|
780
|
-
if (this.result) {
|
|
781
|
-
const output = this.getTextOutput().trim();
|
|
782
|
-
if (output) {
|
|
783
|
-
const lines = output.split("\n");
|
|
784
|
-
const maxLines = this.expanded ? lines.length : 20;
|
|
785
|
-
const displayLines = lines.slice(0, maxLines);
|
|
786
|
-
const remaining = lines.length - maxLines;
|
|
787
|
-
text += `\n\n${displayLines.map((line) => theme.fg("toolOutput", line)).join("\n")}`;
|
|
788
|
-
if (remaining > 0) {
|
|
789
|
-
text += `${theme.fg("muted", `\n... (${remaining} more lines,`)} ${keyHint("expandTools", "to expand")})`;
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
const resultLimit = this.result.details?.resultLimitReached;
|
|
793
|
-
const truncation = this.result.details?.truncation;
|
|
794
|
-
if (resultLimit || truncation?.truncated) {
|
|
795
|
-
const warnings = [];
|
|
796
|
-
if (resultLimit) {
|
|
797
|
-
warnings.push(`${resultLimit} results limit`);
|
|
798
|
-
}
|
|
799
|
-
if (truncation?.truncated) {
|
|
800
|
-
warnings.push(`${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit`);
|
|
801
|
-
}
|
|
802
|
-
text += `\n${theme.fg("warning", `[Truncated: ${warnings.join(", ")}]`)}`;
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
else if (this.toolName === "grep") {
|
|
807
|
-
const pattern = this.args?.pattern || "";
|
|
808
|
-
const path = shortenPath(this.args?.path || ".");
|
|
809
|
-
const glob = this.args?.glob;
|
|
810
|
-
const limit = this.args?.limit;
|
|
811
|
-
text =
|
|
812
|
-
theme.fg("toolTitle", theme.bold("grep")) +
|
|
813
|
-
" " +
|
|
814
|
-
theme.fg("accent", `/${pattern}/`) +
|
|
815
|
-
theme.fg("toolOutput", ` in ${path}`);
|
|
816
|
-
if (glob) {
|
|
817
|
-
text += theme.fg("toolOutput", ` (${glob})`);
|
|
818
|
-
}
|
|
819
|
-
if (limit !== undefined) {
|
|
820
|
-
text += theme.fg("toolOutput", ` limit ${limit}`);
|
|
821
|
-
}
|
|
822
|
-
if (this.result) {
|
|
823
|
-
const output = this.getTextOutput().trim();
|
|
824
|
-
if (output) {
|
|
825
|
-
const lines = output.split("\n");
|
|
826
|
-
const maxLines = this.expanded ? lines.length : 15;
|
|
827
|
-
const displayLines = lines.slice(0, maxLines);
|
|
828
|
-
const remaining = lines.length - maxLines;
|
|
829
|
-
text += `\n\n${displayLines.map((line) => theme.fg("toolOutput", line)).join("\n")}`;
|
|
830
|
-
if (remaining > 0) {
|
|
831
|
-
text += `${theme.fg("muted", `\n... (${remaining} more lines,`)} ${keyHint("expandTools", "to expand")})`;
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
const matchLimit = this.result.details?.matchLimitReached;
|
|
835
|
-
const truncation = this.result.details?.truncation;
|
|
836
|
-
const linesTruncated = this.result.details?.linesTruncated;
|
|
837
|
-
if (matchLimit || truncation?.truncated || linesTruncated) {
|
|
838
|
-
const warnings = [];
|
|
839
|
-
if (matchLimit) {
|
|
840
|
-
warnings.push(`${matchLimit} matches limit`);
|
|
841
|
-
}
|
|
842
|
-
if (truncation?.truncated) {
|
|
843
|
-
warnings.push(`${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit`);
|
|
844
|
-
}
|
|
845
|
-
if (linesTruncated) {
|
|
846
|
-
warnings.push("some lines truncated");
|
|
847
|
-
}
|
|
848
|
-
text += `\n${theme.fg("warning", `[Truncated: ${warnings.join(", ")}]`)}`;
|
|
849
|
-
}
|
|
850
|
-
}
|
|
851
|
-
}
|
|
852
|
-
else if (this.toolName === "task") {
|
|
853
|
-
const details = this.result?.details ?? {};
|
|
854
|
-
const subagentType = details.subagentType || this.args?.subagent_type || "subagent";
|
|
855
|
-
const description = details.description || this.args?.description;
|
|
856
|
-
const taskId = details.taskId || details.task_id;
|
|
857
|
-
const toolCalls = typeof details.toolCalls === "number" ? details.toolCalls : undefined;
|
|
858
|
-
const durationMs = typeof details.durationMs === "number" ? details.durationMs : undefined;
|
|
859
|
-
const resultText = typeof details.result === "string" ? details.result : "";
|
|
860
|
-
text = `${theme.fg("toolTitle", theme.bold("task"))} ${theme.fg("accent", subagentType)}`;
|
|
861
|
-
if (description) {
|
|
862
|
-
text += theme.fg("toolOutput", ` - ${description}`);
|
|
863
|
-
}
|
|
864
|
-
const metaParts = [];
|
|
865
|
-
if (taskId) {
|
|
866
|
-
metaParts.push(`task_id: ${taskId}`);
|
|
867
|
-
}
|
|
868
|
-
if (typeof toolCalls === "number") {
|
|
869
|
-
metaParts.push(`tools: ${toolCalls}`);
|
|
870
|
-
}
|
|
871
|
-
if (typeof durationMs === "number") {
|
|
872
|
-
metaParts.push(`duration: ${Math.round(durationMs)}ms`);
|
|
873
|
-
}
|
|
874
|
-
if (metaParts.length > 0) {
|
|
875
|
-
text += `\n${theme.fg("muted", metaParts.join(" | "))}`;
|
|
876
|
-
}
|
|
877
|
-
if (!this.result) {
|
|
878
|
-
text += `\n\n${theme.fg("muted", "Delegating to subagent...")}`;
|
|
879
|
-
return text;
|
|
880
|
-
}
|
|
881
|
-
const output = resultText || this.getTextOutput().trim();
|
|
882
|
-
if (output) {
|
|
883
|
-
const lines = output.split("\n");
|
|
884
|
-
const maxLines = this.expanded ? lines.length : 12;
|
|
885
|
-
const displayLines = lines.slice(0, maxLines);
|
|
886
|
-
const remaining = lines.length - maxLines;
|
|
887
|
-
const lineColor = this.result.isError ? "error" : "toolOutput";
|
|
888
|
-
text += `\n\n${displayLines.map((line) => theme.fg(lineColor, line)).join("\n")}`;
|
|
889
|
-
if (remaining > 0) {
|
|
890
|
-
text += `${theme.fg("muted", `\n... (${remaining} more lines,`)} ${keyHint("expandTools", "to expand")})`;
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
else {
|
|
894
|
-
text += `\n\n${theme.fg("muted", this.result.isError ? "Task failed" : "No task result")}`;
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
else if (this.toolName === "todoread" || this.toolName === "todowrite") {
|
|
898
|
-
const detailTodos = this.result?.details?.todos;
|
|
899
|
-
const argTodos = this.args?.todos;
|
|
900
|
-
const todoItems = Array.isArray(detailTodos)
|
|
901
|
-
? detailTodos
|
|
902
|
-
: Array.isArray(argTodos)
|
|
903
|
-
? argTodos
|
|
904
|
-
: [];
|
|
905
|
-
const normalizeStatus = (status) => {
|
|
906
|
-
switch (status) {
|
|
907
|
-
case "completed":
|
|
908
|
-
case "in_progress":
|
|
909
|
-
case "cancelled":
|
|
910
|
-
case "pending":
|
|
911
|
-
return status;
|
|
912
|
-
default:
|
|
913
|
-
return "pending";
|
|
914
|
-
}
|
|
915
|
-
};
|
|
916
|
-
const normalizePriority = (priority) => {
|
|
917
|
-
switch (priority) {
|
|
918
|
-
case "high":
|
|
919
|
-
case "medium":
|
|
920
|
-
case "low":
|
|
921
|
-
return priority;
|
|
922
|
-
default:
|
|
923
|
-
return "medium";
|
|
924
|
-
}
|
|
925
|
-
};
|
|
926
|
-
const normalizeContent = (content) => typeof content === "string" ? content : "";
|
|
927
|
-
const normalizedTodos = todoItems.map((todo) => ({
|
|
928
|
-
status: normalizeStatus(todo?.status),
|
|
929
|
-
priority: normalizePriority(todo?.priority),
|
|
930
|
-
content: normalizeContent(todo?.content),
|
|
931
|
-
}));
|
|
932
|
-
const incompleteCount = typeof this.result?.details?.incompleteCount === "number"
|
|
933
|
-
? this.result.details.incompleteCount
|
|
934
|
-
: normalizedTodos.filter((todo) => todo.status !== "completed").length;
|
|
935
|
-
text = theme.fg("toolTitle", theme.bold(this.toolName));
|
|
936
|
-
if (normalizedTodos.length === 0) {
|
|
937
|
-
text += `\n\n${theme.fg("muted", "No todos")}`;
|
|
938
|
-
}
|
|
939
|
-
else {
|
|
940
|
-
text += `\n\n${theme.fg("muted", `${incompleteCount} incomplete`)}\n`;
|
|
941
|
-
const maxItems = this.expanded ? normalizedTodos.length : Math.min(normalizedTodos.length, 10);
|
|
942
|
-
const displayItems = normalizedTodos.slice(0, maxItems);
|
|
943
|
-
const statusIcon = (status) => {
|
|
944
|
-
switch (status) {
|
|
945
|
-
case "completed":
|
|
946
|
-
return theme.fg("success", "✓");
|
|
947
|
-
case "in_progress":
|
|
948
|
-
return theme.fg("warning", "•");
|
|
949
|
-
case "cancelled":
|
|
950
|
-
return theme.fg("error", "✕");
|
|
951
|
-
default:
|
|
952
|
-
return theme.fg("dim", "○");
|
|
953
|
-
}
|
|
954
|
-
};
|
|
955
|
-
const priorityText = (priority) => {
|
|
956
|
-
switch (priority) {
|
|
957
|
-
case "high":
|
|
958
|
-
return theme.fg("warning", priority);
|
|
959
|
-
case "medium":
|
|
960
|
-
return theme.fg("accent", priority);
|
|
961
|
-
default:
|
|
962
|
-
return theme.fg("muted", priority);
|
|
963
|
-
}
|
|
964
|
-
};
|
|
965
|
-
const formatStatus = (status) => {
|
|
966
|
-
const textLabel = status.replace(/_/g, " ");
|
|
967
|
-
if (status === "completed")
|
|
968
|
-
return theme.fg("success", textLabel);
|
|
969
|
-
if (status === "in_progress")
|
|
970
|
-
return theme.fg("warning", textLabel);
|
|
971
|
-
if (status === "cancelled")
|
|
972
|
-
return theme.fg("error", textLabel);
|
|
973
|
-
return theme.fg("dim", textLabel);
|
|
974
|
-
};
|
|
975
|
-
const lines = displayItems.map((todo) => {
|
|
976
|
-
const contentText = todo.status === "completed" || todo.status === "cancelled"
|
|
977
|
-
? theme.fg("dim", todo.content)
|
|
978
|
-
: theme.fg("toolOutput", todo.content);
|
|
979
|
-
return `${statusIcon(todo.status)} ${formatStatus(todo.status)} ${priorityText(todo.priority)} ${contentText}`;
|
|
980
|
-
});
|
|
981
|
-
text += lines.join("\n");
|
|
982
|
-
if (!this.expanded && normalizedTodos.length > maxItems) {
|
|
983
|
-
const remaining = normalizedTodos.length - maxItems;
|
|
984
|
-
text += `${theme.fg("muted", `\n... (${remaining} more items,`)} ${keyHint("expandTools", "to expand")})`;
|
|
985
|
-
}
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
else {
|
|
989
|
-
// Generic tool (shouldn't reach here for custom tools)
|
|
990
|
-
text = theme.fg("toolTitle", theme.bold(this.toolName));
|
|
991
|
-
const content = JSON.stringify(this.args, null, 2);
|
|
992
|
-
text += `\n\n${content}`;
|
|
993
|
-
const output = this.getTextOutput();
|
|
994
|
-
if (output) {
|
|
995
|
-
text += `\n${output}`;
|
|
996
|
-
}
|
|
997
|
-
}
|
|
998
|
-
return text;
|
|
999
|
-
}
|
|
1000
|
-
}
|
|
1001
|
-
//# sourceMappingURL=tool-execution.js.map
|