hoomanjs 1.18.0 → 1.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -26
- package/dist/acp/acp-agent.d.ts +69 -0
- package/dist/acp/acp-agent.js +628 -0
- package/dist/acp/acp-agent.js.map +1 -0
- package/dist/acp/approvals.d.ts +5 -0
- package/dist/acp/approvals.js +130 -0
- package/dist/acp/approvals.js.map +1 -0
- package/dist/acp/index.d.ts +1 -0
- package/dist/acp/index.js +2 -0
- package/dist/acp/index.js.map +1 -0
- package/dist/acp/mcp-servers.d.ts +7 -0
- package/dist/acp/mcp-servers.js +57 -0
- package/dist/acp/mcp-servers.js.map +1 -0
- package/dist/acp/meta/system-prompt.d.ts +12 -0
- package/dist/acp/meta/system-prompt.js +41 -0
- package/dist/acp/meta/system-prompt.js.map +1 -0
- package/dist/acp/meta/user-id.d.ts +12 -0
- package/dist/acp/meta/user-id.js +43 -0
- package/dist/acp/meta/user-id.js.map +1 -0
- package/dist/acp/prompt-invoke.d.ts +10 -0
- package/dist/acp/prompt-invoke.js +131 -0
- package/dist/acp/prompt-invoke.js.map +1 -0
- package/dist/acp/sessions/config-options.d.ts +7 -0
- package/dist/acp/sessions/config-options.js +101 -0
- package/dist/acp/sessions/config-options.js.map +1 -0
- package/dist/acp/sessions/replay.d.ts +7 -0
- package/dist/acp/sessions/replay.js +117 -0
- package/dist/acp/sessions/replay.js.map +1 -0
- package/dist/acp/sessions/store.d.ts +24 -0
- package/dist/acp/sessions/store.js +96 -0
- package/dist/acp/sessions/store.js.map +1 -0
- package/dist/acp/sessions/title.d.ts +5 -0
- package/dist/acp/sessions/title.js +22 -0
- package/dist/acp/sessions/title.js.map +1 -0
- package/dist/acp/utils/paths.d.ts +2 -0
- package/{src/acp/utils/paths.ts → dist/acp/utils/paths.js} +2 -2
- package/dist/acp/utils/paths.js.map +1 -0
- package/dist/acp/utils/tool-kind.d.ts +6 -0
- package/dist/acp/utils/tool-kind.js +53 -0
- package/dist/acp/utils/tool-kind.js.map +1 -0
- package/dist/acp/utils/tool-locations.d.ts +3 -0
- package/dist/acp/utils/tool-locations.js +44 -0
- package/dist/acp/utils/tool-locations.js.map +1 -0
- package/dist/acp/utils/tool-result-content.d.ts +8 -0
- package/dist/acp/utils/tool-result-content.js +14 -0
- package/dist/acp/utils/tool-result-content.js.map +1 -0
- package/dist/chat/app.d.ts +15 -0
- package/dist/chat/app.js +458 -0
- package/dist/chat/app.js.map +1 -0
- package/dist/chat/approvals.d.ts +15 -0
- package/dist/chat/approvals.js +74 -0
- package/dist/chat/approvals.js.map +1 -0
- package/dist/chat/components/ApprovalPrompt.d.ts +6 -0
- package/dist/chat/components/ApprovalPrompt.js +11 -0
- package/dist/chat/components/ApprovalPrompt.js.map +1 -0
- package/dist/chat/components/ChatMessage.d.ts +7 -0
- package/dist/chat/components/ChatMessage.js +19 -0
- package/dist/chat/components/ChatMessage.js.map +1 -0
- package/dist/chat/components/Composer.d.ts +11 -0
- package/dist/chat/components/Composer.js +9 -0
- package/dist/chat/components/Composer.js.map +1 -0
- package/dist/chat/components/EmptyChatBanner.d.ts +2 -0
- package/dist/chat/components/EmptyChatBanner.js +8 -0
- package/dist/chat/components/EmptyChatBanner.js.map +1 -0
- package/dist/chat/components/PromptInput.d.ts +11 -0
- package/dist/chat/components/PromptInput.js +26 -0
- package/dist/chat/components/PromptInput.js.map +1 -0
- package/dist/chat/components/QueuedPrompts.d.ts +10 -0
- package/dist/chat/components/QueuedPrompts.js +38 -0
- package/dist/chat/components/QueuedPrompts.js.map +1 -0
- package/dist/chat/components/ReasoningStrip.d.ts +6 -0
- package/dist/chat/components/ReasoningStrip.js +13 -0
- package/dist/chat/components/ReasoningStrip.js.map +1 -0
- package/dist/chat/components/ScrollView.d.ts +101 -0
- package/dist/chat/components/ScrollView.js +74 -0
- package/dist/chat/components/ScrollView.js.map +1 -0
- package/dist/chat/components/Spinner.d.ts +8 -0
- package/dist/chat/components/Spinner.js +19 -0
- package/dist/chat/components/Spinner.js.map +1 -0
- package/dist/chat/components/StatusBar.d.ts +20 -0
- package/dist/chat/components/StatusBar.js +20 -0
- package/dist/chat/components/StatusBar.js.map +1 -0
- package/dist/chat/components/ThinkingStatus.d.ts +1 -0
- package/dist/chat/components/ThinkingStatus.js +119 -0
- package/dist/chat/components/ThinkingStatus.js.map +1 -0
- package/dist/chat/components/TodoPanel.d.ts +6 -0
- package/dist/chat/components/TodoPanel.js +27 -0
- package/dist/chat/components/TodoPanel.js.map +1 -0
- package/dist/chat/components/ToolEvent.d.ts +6 -0
- package/dist/chat/components/ToolEvent.js +18 -0
- package/dist/chat/components/ToolEvent.js.map +1 -0
- package/dist/chat/components/ToolEventFileResult.d.ts +9 -0
- package/dist/chat/components/ToolEventFileResult.js +50 -0
- package/dist/chat/components/ToolEventFileResult.js.map +1 -0
- package/dist/chat/components/Transcript.d.ts +7 -0
- package/dist/chat/components/Transcript.js +9 -0
- package/dist/chat/components/Transcript.js.map +1 -0
- package/dist/chat/components/TranscriptViewport.d.ts +9 -0
- package/dist/chat/components/TranscriptViewport.js +124 -0
- package/dist/chat/components/TranscriptViewport.js.map +1 -0
- package/dist/chat/components/ascii-logo.d.ts +1 -0
- package/{src/chat/components/ascii-logo.ts → dist/chat/components/ascii-logo.js} +3 -2
- package/dist/chat/components/ascii-logo.js.map +1 -0
- package/dist/chat/components/file-tool-diff/file-tool-result.d.ts +26 -0
- package/dist/chat/components/file-tool-diff/file-tool-result.js +73 -0
- package/dist/chat/components/file-tool-diff/file-tool-result.js.map +1 -0
- package/dist/chat/components/markdown/BlockRenderer.d.ts +8 -0
- package/dist/chat/components/markdown/BlockRenderer.js +87 -0
- package/dist/chat/components/markdown/BlockRenderer.js.map +1 -0
- package/dist/chat/components/markdown/CodeBlock.d.ts +7 -0
- package/dist/chat/components/markdown/CodeBlock.js +55 -0
- package/dist/chat/components/markdown/CodeBlock.js.map +1 -0
- package/dist/chat/components/markdown/InlineRenderer.d.ts +8 -0
- package/dist/chat/components/markdown/InlineRenderer.js +96 -0
- package/dist/chat/components/markdown/InlineRenderer.js.map +1 -0
- package/dist/chat/components/markdown/MarkdownMessage.d.ts +6 -0
- package/dist/chat/components/markdown/MarkdownMessage.js +13 -0
- package/dist/chat/components/markdown/MarkdownMessage.js.map +1 -0
- package/dist/chat/components/markdown/MarkdownTable.d.ts +6 -0
- package/dist/chat/components/markdown/MarkdownTable.js +12 -0
- package/dist/chat/components/markdown/MarkdownTable.js.map +1 -0
- package/dist/chat/components/markdown/hooks/useMarkdownTableLayout.d.ts +7 -0
- package/dist/chat/components/markdown/hooks/useMarkdownTableLayout.js +186 -0
- package/dist/chat/components/markdown/hooks/useMarkdownTableLayout.js.map +1 -0
- package/dist/chat/components/markdown/hooks/useMarkdownTokens.d.ts +9 -0
- package/dist/chat/components/markdown/hooks/useMarkdownTokens.js +25 -0
- package/dist/chat/components/markdown/hooks/useMarkdownTokens.js.map +1 -0
- package/dist/chat/components/markdown/lexer.d.ts +7 -0
- package/dist/chat/components/markdown/lexer.js +89 -0
- package/dist/chat/components/markdown/lexer.js.map +1 -0
- package/dist/chat/components/prompt-input/clipboard-image.d.ts +1 -0
- package/dist/chat/components/prompt-input/clipboard-image.js +112 -0
- package/dist/chat/components/prompt-input/clipboard-image.js.map +1 -0
- package/dist/chat/components/prompt-input/hooks/usePromptInputController.d.ts +1 -0
- package/dist/chat/components/prompt-input/hooks/usePromptInputController.js +2 -0
- package/dist/chat/components/prompt-input/hooks/usePromptInputController.js.map +1 -0
- package/dist/chat/components/prompt-input/input-model.d.ts +28 -0
- package/dist/chat/components/prompt-input/input-model.js +231 -0
- package/dist/chat/components/prompt-input/input-model.js.map +1 -0
- package/dist/chat/components/prompt-input/paste.d.ts +11 -0
- package/dist/chat/components/prompt-input/paste.js +85 -0
- package/dist/chat/components/prompt-input/paste.js.map +1 -0
- package/dist/chat/components/prompt-input/render.d.ts +13 -0
- package/dist/chat/components/prompt-input/render.js +54 -0
- package/dist/chat/components/prompt-input/render.js.map +1 -0
- package/dist/chat/components/prompt-input/usePromptInputController.d.ts +17 -0
- package/dist/chat/components/prompt-input/usePromptInputController.js +366 -0
- package/dist/chat/components/prompt-input/usePromptInputController.js.map +1 -0
- package/dist/chat/components/shared.d.ts +6 -0
- package/dist/chat/components/shared.js +66 -0
- package/dist/chat/components/shared.js.map +1 -0
- package/dist/chat/index.d.ts +13 -0
- package/dist/chat/index.js +18 -0
- package/dist/chat/index.js.map +1 -0
- package/dist/chat/mouse.d.ts +5 -0
- package/dist/chat/mouse.js +9 -0
- package/dist/chat/mouse.js.map +1 -0
- package/dist/chat/types.d.ts +20 -0
- package/dist/chat/types.js +2 -0
- package/dist/chat/types.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +126 -0
- package/dist/cli.js.map +1 -0
- package/dist/configure/app.d.ts +3 -0
- package/dist/configure/app.js +1036 -0
- package/dist/configure/app.js.map +1 -0
- package/dist/configure/components/BusyScreen.d.ts +6 -0
- package/dist/configure/components/BusyScreen.js +7 -0
- package/dist/configure/components/BusyScreen.js.map +1 -0
- package/dist/configure/components/HomeScreen.d.ts +12 -0
- package/dist/configure/components/HomeScreen.js +7 -0
- package/dist/configure/components/HomeScreen.js.map +1 -0
- package/dist/configure/components/MenuScreen.d.ts +10 -0
- package/dist/configure/components/MenuScreen.js +15 -0
- package/dist/configure/components/MenuScreen.js.map +1 -0
- package/dist/configure/components/PromptForm.d.ts +8 -0
- package/dist/configure/components/PromptForm.js +12 -0
- package/dist/configure/components/PromptForm.js.map +1 -0
- package/dist/configure/components/SelectMenuItem.d.ts +7 -0
- package/dist/configure/components/SelectMenuItem.js +18 -0
- package/dist/configure/components/SelectMenuItem.js.map +1 -0
- package/dist/configure/index.d.ts +1 -0
- package/dist/configure/index.js +28 -0
- package/dist/configure/index.js.map +1 -0
- package/dist/configure/open-in-editor.d.ts +8 -0
- package/dist/configure/open-in-editor.js +120 -0
- package/dist/configure/open-in-editor.js.map +1 -0
- package/dist/configure/types.d.ts +63 -0
- package/dist/configure/types.js +2 -0
- package/dist/configure/types.js.map +1 -0
- package/dist/configure/utils.d.ts +19 -0
- package/dist/configure/utils.js +108 -0
- package/dist/configure/utils.js.map +1 -0
- package/dist/core/agent/index.d.ts +13 -0
- package/dist/core/agent/index.js +70 -0
- package/dist/core/agent/index.js.map +1 -0
- package/dist/core/agents/definitions.d.ts +12 -0
- package/dist/core/agents/definitions.js +35 -0
- package/dist/core/agents/definitions.js.map +1 -0
- package/dist/core/agents/index.d.ts +4 -0
- package/dist/core/agents/index.js +5 -0
- package/dist/core/agents/index.js.map +1 -0
- package/dist/core/agents/registry.d.ts +5 -0
- package/dist/core/agents/registry.js +84 -0
- package/dist/core/agents/registry.js.map +1 -0
- package/dist/core/agents/runner.d.ts +36 -0
- package/dist/core/agents/runner.js +275 -0
- package/dist/core/agents/runner.js.map +1 -0
- package/dist/core/agents/tools.d.ts +20 -0
- package/dist/core/agents/tools.js +66 -0
- package/dist/core/agents/tools.js.map +1 -0
- package/dist/core/config.d.ts +272 -0
- package/dist/core/config.js +334 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/index.d.ts +23 -0
- package/dist/core/index.js +21 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/mcp/config.d.ts +44 -0
- package/dist/core/mcp/config.js +65 -0
- package/dist/core/mcp/config.js.map +1 -0
- package/dist/core/mcp/index.d.ts +8 -0
- package/dist/core/mcp/index.js +12 -0
- package/dist/core/mcp/index.js.map +1 -0
- package/dist/core/mcp/manager.d.ts +69 -0
- package/dist/core/mcp/manager.js +376 -0
- package/dist/core/mcp/manager.js.map +1 -0
- package/dist/core/mcp/prefixed-mcp-tool.d.ts +14 -0
- package/dist/core/mcp/prefixed-mcp-tool.js +38 -0
- package/dist/core/mcp/prefixed-mcp-tool.js.map +1 -0
- package/dist/core/mcp/tools.d.ts +5 -0
- package/dist/core/mcp/tools.js +82 -0
- package/dist/core/mcp/tools.js.map +1 -0
- package/dist/core/mcp/types.d.ts +40 -0
- package/dist/core/mcp/types.js +28 -0
- package/dist/core/mcp/types.js.map +1 -0
- package/dist/core/memory/index.d.ts +3 -0
- package/dist/core/memory/index.js +3 -0
- package/dist/core/memory/index.js.map +1 -0
- package/dist/core/memory/ltm/embed.d.ts +16 -0
- package/dist/core/memory/ltm/embed.js +49 -0
- package/dist/core/memory/ltm/embed.js.map +1 -0
- package/dist/core/memory/ltm/index.d.ts +3 -0
- package/dist/core/memory/ltm/index.js +3 -0
- package/dist/core/memory/ltm/index.js.map +1 -0
- package/dist/core/memory/ltm/store.d.ts +20 -0
- package/dist/core/memory/ltm/store.js +271 -0
- package/dist/core/memory/ltm/store.js.map +1 -0
- package/dist/core/memory/ltm/tools.d.ts +21 -0
- package/dist/core/memory/ltm/tools.js +127 -0
- package/dist/core/memory/ltm/tools.js.map +1 -0
- package/dist/core/memory/ltm/types.d.ts +79 -0
- package/dist/core/memory/ltm/types.js +2 -0
- package/dist/core/memory/ltm/types.js.map +1 -0
- package/dist/core/memory/ltm/utils.d.ts +40 -0
- package/dist/core/memory/ltm/utils.js +145 -0
- package/dist/core/memory/ltm/utils.js.map +1 -0
- package/dist/core/memory/stm/flat-file-storage.d.ts +27 -0
- package/dist/core/memory/stm/flat-file-storage.js +63 -0
- package/dist/core/memory/stm/flat-file-storage.js.map +1 -0
- package/dist/core/memory/stm/index.d.ts +13 -0
- package/dist/core/memory/stm/index.js +24 -0
- package/dist/core/memory/stm/index.js.map +1 -0
- package/dist/core/memory/stm/lazy-session-manager.d.ts +37 -0
- package/dist/core/memory/stm/lazy-session-manager.js +163 -0
- package/dist/core/memory/stm/lazy-session-manager.js.map +1 -0
- package/dist/core/models/anthropic.d.ts +10 -0
- package/dist/core/models/anthropic.js +38 -0
- package/dist/core/models/anthropic.js.map +1 -0
- package/dist/core/models/bedrock.d.ts +21 -0
- package/dist/core/models/bedrock.js +24 -0
- package/dist/core/models/bedrock.js.map +1 -0
- package/dist/core/models/google.d.ts +10 -0
- package/dist/core/models/google.js +36 -0
- package/dist/core/models/google.js.map +1 -0
- package/dist/core/models/groq.d.ts +10 -0
- package/dist/core/models/groq.js +33 -0
- package/dist/core/models/groq.js.map +1 -0
- package/dist/core/models/index.d.ts +5 -0
- package/dist/core/models/index.js +11 -0
- package/dist/core/models/index.js.map +1 -0
- package/dist/core/models/moonshot.d.ts +11 -0
- package/dist/core/models/moonshot.js +39 -0
- package/dist/core/models/moonshot.js.map +1 -0
- package/dist/core/models/ollama/index.d.ts +3 -0
- package/dist/core/models/ollama/index.js +9 -0
- package/dist/core/models/ollama/index.js.map +1 -0
- package/dist/core/models/ollama/strands-ollama.d.ts +30 -0
- package/dist/core/models/ollama/strands-ollama.js +336 -0
- package/dist/core/models/ollama/strands-ollama.js.map +1 -0
- package/dist/core/models/openai.d.ts +4 -0
- package/dist/core/models/openai.js +9 -0
- package/dist/core/models/openai.js.map +1 -0
- package/dist/core/models/xai.d.ts +10 -0
- package/dist/core/models/xai.js +33 -0
- package/dist/core/models/xai.js.map +1 -0
- package/dist/core/prompts/environment.d.ts +11 -0
- package/dist/core/prompts/environment.js +51 -0
- package/dist/core/prompts/environment.js.map +1 -0
- package/dist/core/prompts/index.d.ts +7 -0
- package/dist/core/prompts/index.js +14 -0
- package/dist/core/prompts/index.js.map +1 -0
- package/dist/core/prompts/skills.d.ts +15 -0
- package/dist/core/prompts/skills.js +86 -0
- package/dist/core/prompts/skills.js.map +1 -0
- package/dist/core/prompts/system.d.ts +22 -0
- package/dist/core/prompts/system.js +164 -0
- package/dist/core/prompts/system.js.map +1 -0
- package/dist/core/skills/built-in/hooman-config/SKILL.md +9 -0
- package/dist/core/skills/index.d.ts +2 -0
- package/dist/core/skills/index.js +3 -0
- package/dist/core/skills/index.js.map +1 -0
- package/dist/core/skills/metadata.d.ts +8 -0
- package/dist/core/skills/metadata.js +20 -0
- package/dist/core/skills/metadata.js.map +1 -0
- package/dist/core/skills/registry.d.ts +38 -0
- package/dist/core/skills/registry.js +165 -0
- package/dist/core/skills/registry.js.map +1 -0
- package/dist/core/skills/tools.d.ts +9 -0
- package/dist/core/skills/tools.js +73 -0
- package/dist/core/skills/tools.js.map +1 -0
- package/dist/core/state/file-tool-display.d.ts +20 -0
- package/dist/core/state/file-tool-display.js +35 -0
- package/dist/core/state/file-tool-display.js.map +1 -0
- package/dist/core/state/thought-process.d.ts +18 -0
- package/dist/core/state/thought-process.js +21 -0
- package/dist/core/state/thought-process.js.map +1 -0
- package/dist/core/state/todos.d.ts +39 -0
- package/dist/core/state/todos.js +53 -0
- package/dist/core/state/todos.js.map +1 -0
- package/dist/core/state/tool-approvals.d.ts +12 -0
- package/dist/core/state/tool-approvals.js +81 -0
- package/dist/core/state/tool-approvals.js.map +1 -0
- package/dist/core/tools/fetch.d.ts +9 -0
- package/dist/core/tools/fetch.js +228 -0
- package/dist/core/tools/fetch.js.map +1 -0
- package/dist/core/tools/filesystem.d.ts +35 -0
- package/dist/core/tools/filesystem.js +791 -0
- package/dist/core/tools/filesystem.js.map +1 -0
- package/dist/core/tools/index.d.ts +9 -0
- package/dist/core/tools/index.js +10 -0
- package/dist/core/tools/index.js.map +1 -0
- package/dist/core/tools/shell.d.ts +18 -0
- package/dist/core/tools/shell.js +308 -0
- package/dist/core/tools/shell.js.map +1 -0
- package/dist/core/tools/sleep.d.ts +4 -0
- package/dist/core/tools/sleep.js +46 -0
- package/dist/core/tools/sleep.js.map +1 -0
- package/dist/core/tools/thinking.d.ts +12 -0
- package/dist/core/tools/thinking.js +119 -0
- package/dist/core/tools/thinking.js.map +1 -0
- package/dist/core/tools/time.d.ts +8 -0
- package/dist/core/tools/time.js +94 -0
- package/dist/core/tools/time.js.map +1 -0
- package/dist/core/tools/todo.d.ts +9 -0
- package/dist/core/tools/todo.js +33 -0
- package/dist/core/tools/todo.js.map +1 -0
- package/dist/core/tools/web-search.d.ts +11 -0
- package/dist/core/tools/web-search.js +211 -0
- package/dist/core/tools/web-search.js.map +1 -0
- package/dist/core/tools/wiki.d.ts +11 -0
- package/dist/core/tools/wiki.js +566 -0
- package/dist/core/tools/wiki.js.map +1 -0
- package/dist/core/utils/attachments.d.ts +23 -0
- package/dist/core/utils/attachments.js +125 -0
- package/dist/core/utils/attachments.js.map +1 -0
- package/dist/core/utils/cwd-context.d.ts +2 -0
- package/dist/core/utils/cwd-context.js +9 -0
- package/dist/core/utils/cwd-context.js.map +1 -0
- package/dist/core/utils/file-formats.d.ts +4 -0
- package/dist/core/utils/file-formats.js +48 -0
- package/dist/core/utils/file-formats.js.map +1 -0
- package/dist/core/utils/paths.d.ts +7 -0
- package/dist/core/utils/paths.js +25 -0
- package/dist/core/utils/paths.js.map +1 -0
- package/dist/daemon/approvals.d.ts +5 -0
- package/dist/daemon/approvals.js +95 -0
- package/dist/daemon/approvals.js.map +1 -0
- package/dist/daemon/index.d.ts +11 -0
- package/dist/daemon/index.js +106 -0
- package/dist/daemon/index.js.map +1 -0
- package/dist/daemon/queue.d.ts +5 -0
- package/dist/daemon/queue.js +38 -0
- package/dist/daemon/queue.js.map +1 -0
- package/dist/exec/approvals.d.ts +6 -0
- package/dist/exec/approvals.js +74 -0
- package/dist/exec/approvals.js.map +1 -0
- package/package.json +20 -9
- package/.github/screenshot.png +0 -0
- package/.github/workflows/build-publish.yml +0 -49
- package/docker-compose.yml +0 -13
- package/src/acp/acp-agent.ts +0 -814
- package/src/acp/approvals.ts +0 -146
- package/src/acp/index.ts +0 -1
- package/src/acp/mcp-servers.ts +0 -64
- package/src/acp/meta/system-prompt.ts +0 -44
- package/src/acp/meta/user-id.ts +0 -44
- package/src/acp/prompt-invoke.ts +0 -149
- package/src/acp/sessions/config-options.ts +0 -120
- package/src/acp/sessions/replay.ts +0 -131
- package/src/acp/sessions/store.ts +0 -161
- package/src/acp/sessions/title.ts +0 -22
- package/src/acp/utils/tool-kind.ts +0 -61
- package/src/acp/utils/tool-locations.ts +0 -48
- package/src/acp/utils/tool-result-content.ts +0 -27
- package/src/chat/app.tsx +0 -636
- package/src/chat/approvals.ts +0 -97
- package/src/chat/components/ApprovalPrompt.tsx +0 -25
- package/src/chat/components/ChatMessage.tsx +0 -50
- package/src/chat/components/Composer.tsx +0 -45
- package/src/chat/components/EmptyChatBanner.tsx +0 -26
- package/src/chat/components/PromptInput.tsx +0 -62
- package/src/chat/components/QueuedPrompts.tsx +0 -76
- package/src/chat/components/ReasoningStrip.tsx +0 -30
- package/src/chat/components/Spinner.tsx +0 -34
- package/src/chat/components/StatusBar.tsx +0 -67
- package/src/chat/components/ThinkingStatus.tsx +0 -128
- package/src/chat/components/TodoPanel.tsx +0 -49
- package/src/chat/components/ToolEvent.tsx +0 -41
- package/src/chat/components/ToolEventFileResult.tsx +0 -116
- package/src/chat/components/Transcript.tsx +0 -34
- package/src/chat/components/TranscriptViewport.tsx +0 -170
- package/src/chat/components/file-tool-diff/file-tool-result.ts +0 -155
- package/src/chat/components/markdown/BlockRenderer.tsx +0 -207
- package/src/chat/components/markdown/CodeBlock.tsx +0 -100
- package/src/chat/components/markdown/InlineRenderer.tsx +0 -122
- package/src/chat/components/markdown/MarkdownMessage.tsx +0 -35
- package/src/chat/components/markdown/MarkdownTable.tsx +0 -23
- package/src/chat/components/markdown/hooks/useMarkdownTableLayout.ts +0 -242
- package/src/chat/components/markdown/hooks/useMarkdownTokens.ts +0 -46
- package/src/chat/components/markdown/lexer.ts +0 -100
- package/src/chat/components/prompt-input/clipboard-image.ts +0 -119
- package/src/chat/components/prompt-input/hooks/usePromptInputController.ts +0 -4
- package/src/chat/components/prompt-input/input-model.ts +0 -294
- package/src/chat/components/prompt-input/paste.ts +0 -105
- package/src/chat/components/prompt-input/render.ts +0 -83
- package/src/chat/components/prompt-input/usePromptInputController.ts +0 -498
- package/src/chat/components/shared.ts +0 -70
- package/src/chat/index.tsx +0 -41
- package/src/chat/mouse.ts +0 -17
- package/src/chat/types.ts +0 -24
- package/src/cli.ts +0 -181
- package/src/configure/app.tsx +0 -1349
- package/src/configure/components/BusyScreen.tsx +0 -22
- package/src/configure/components/HomeScreen.tsx +0 -43
- package/src/configure/components/MenuScreen.tsx +0 -44
- package/src/configure/components/PromptForm.tsx +0 -40
- package/src/configure/components/SelectMenuItem.tsx +0 -30
- package/src/configure/index.tsx +0 -43
- package/src/configure/open-in-editor.ts +0 -133
- package/src/configure/types.ts +0 -51
- package/src/configure/utils.ts +0 -134
- package/src/core/agent/index.ts +0 -108
- package/src/core/agents/definitions.ts +0 -48
- package/src/core/agents/index.ts +0 -15
- package/src/core/agents/registry.ts +0 -106
- package/src/core/agents/runner.ts +0 -375
- package/src/core/agents/tools.ts +0 -100
- package/src/core/config.ts +0 -377
- package/src/core/index.ts +0 -60
- package/src/core/mcp/config.ts +0 -80
- package/src/core/mcp/index.ts +0 -33
- package/src/core/mcp/manager.ts +0 -491
- package/src/core/mcp/prefixed-mcp-tool.ts +0 -45
- package/src/core/mcp/tools.ts +0 -92
- package/src/core/mcp/types.ts +0 -37
- package/src/core/memory/index.ts +0 -17
- package/src/core/memory/ltm/embed.ts +0 -67
- package/src/core/memory/ltm/index.ts +0 -18
- package/src/core/memory/ltm/store.ts +0 -376
- package/src/core/memory/ltm/tools.ts +0 -146
- package/src/core/memory/ltm/types.ts +0 -111
- package/src/core/memory/ltm/utils.ts +0 -218
- package/src/core/memory/stm/flat-file-storage.ts +0 -89
- package/src/core/memory/stm/index.ts +0 -32
- package/src/core/memory/stm/lazy-session-manager.ts +0 -220
- package/src/core/models/anthropic.ts +0 -53
- package/src/core/models/bedrock.ts +0 -54
- package/src/core/models/google.ts +0 -51
- package/src/core/models/groq.ts +0 -48
- package/src/core/models/index.ts +0 -19
- package/src/core/models/moonshot.ts +0 -54
- package/src/core/models/ollama/index.ts +0 -13
- package/src/core/models/ollama/strands-ollama.ts +0 -439
- package/src/core/models/openai.ts +0 -12
- package/src/core/models/xai.ts +0 -47
- package/src/core/prompts/environment.ts +0 -71
- package/src/core/prompts/index.ts +0 -22
- package/src/core/prompts/skills.ts +0 -66
- package/src/core/prompts/system.ts +0 -183
- package/src/core/skills/index.ts +0 -2
- package/src/core/skills/registry.ts +0 -239
- package/src/core/skills/tools.ts +0 -80
- package/src/core/state/file-tool-display.ts +0 -70
- package/src/core/state/thought-process.ts +0 -49
- package/src/core/state/todos.ts +0 -84
- package/src/core/state/tool-approvals.ts +0 -100
- package/src/core/tools/fetch.ts +0 -288
- package/src/core/tools/filesystem.ts +0 -1105
- package/src/core/tools/index.ts +0 -9
- package/src/core/tools/shell.ts +0 -426
- package/src/core/tools/sleep.ts +0 -51
- package/src/core/tools/thinking.ts +0 -149
- package/src/core/tools/time.ts +0 -121
- package/src/core/tools/todo.ts +0 -44
- package/src/core/tools/web-search.ts +0 -278
- package/src/core/tools/wiki.ts +0 -703
- package/src/core/utils/attachments.ts +0 -201
- package/src/core/utils/cwd-context.ts +0 -11
- package/src/core/utils/file-formats.ts +0 -60
- package/src/core/utils/paths.ts +0 -37
- package/src/daemon/approvals.ts +0 -127
- package/src/daemon/index.ts +0 -153
- package/src/daemon/queue.ts +0 -48
- package/src/exec/approvals.ts +0 -90
- package/tsconfig.json +0 -30
- /package/{src → dist}/core/prompts/agents/plan.md +0 -0
- /package/{src → dist}/core/prompts/agents/research.md +0 -0
- /package/{src → dist}/core/prompts/harness/behaviour.md +0 -0
- /package/{src → dist}/core/prompts/harness/communication.md +0 -0
- /package/{src → dist}/core/prompts/harness/engineering.md +0 -0
- /package/{src → dist}/core/prompts/harness/execution.md +0 -0
- /package/{src → dist}/core/prompts/harness/guardrails.md +0 -0
- /package/{src → dist}/core/prompts/static/daemon.md +0 -0
- /package/{src → dist}/core/prompts/static/environment.md +0 -0
- /package/{src → dist}/core/prompts/static/fetch.md +0 -0
- /package/{src → dist}/core/prompts/static/filesystem.md +0 -0
- /package/{src → dist}/core/prompts/static/identity.md +0 -0
- /package/{src → dist}/core/prompts/static/ltm.md +0 -0
- /package/{src → dist}/core/prompts/static/shell.md +0 -0
- /package/{src → dist}/core/prompts/static/skills.md +0 -0
- /package/{src → dist}/core/prompts/static/sleep.md +0 -0
- /package/{src → dist}/core/prompts/static/subagents.md +0 -0
- /package/{src → dist}/core/prompts/static/thinking.md +0 -0
- /package/{src → dist}/core/prompts/static/todo.md +0 -0
- /package/{src → dist}/core/prompts/static/web-search.md +0 -0
- /package/{src → dist}/core/prompts/static/wiki.md +0 -0
package/src/chat/approvals.ts
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { BeforeToolCallEvent } from "@strands-agents/sdk";
|
|
2
|
-
import {
|
|
3
|
-
INTERNAL_ALWAYS_ALLOWED,
|
|
4
|
-
allowToolForSession,
|
|
5
|
-
isToolSessionAllowed,
|
|
6
|
-
} from "../core/state/tool-approvals.ts";
|
|
7
|
-
import type { ApprovalDecision, ApprovalRequest } from "./types.ts";
|
|
8
|
-
const INPUT_PREVIEW_LIMIT = 256;
|
|
9
|
-
|
|
10
|
-
function previewInput(input: unknown): string {
|
|
11
|
-
try {
|
|
12
|
-
const text = JSON.stringify(input, null, 2) ?? "null";
|
|
13
|
-
return text.length > INPUT_PREVIEW_LIMIT
|
|
14
|
-
? `${text.slice(0, INPUT_PREVIEW_LIMIT)}\n... (truncated)`
|
|
15
|
-
: text;
|
|
16
|
-
} catch {
|
|
17
|
-
return String(input);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
type QueueItem = {
|
|
22
|
-
request: ApprovalRequest;
|
|
23
|
-
resolve: (decision: ApprovalDecision) => void;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export class ChatApprovalController {
|
|
27
|
-
private readonly queue: QueueItem[] = [];
|
|
28
|
-
private readonly listeners = new Set<() => void>();
|
|
29
|
-
private nextId = 0;
|
|
30
|
-
|
|
31
|
-
public subscribe(listener: () => void): () => void {
|
|
32
|
-
this.listeners.add(listener);
|
|
33
|
-
return () => {
|
|
34
|
-
this.listeners.delete(listener);
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
public get pending(): ApprovalRequest | null {
|
|
39
|
-
return this.queue[0]?.request ?? null;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
public request(event: BeforeToolCallEvent): Promise<ApprovalDecision> {
|
|
43
|
-
const request: ApprovalRequest = {
|
|
44
|
-
id: String(this.nextId++),
|
|
45
|
-
toolName: event.toolUse.name,
|
|
46
|
-
description: event.tool?.description?.trim(),
|
|
47
|
-
inputPreview: previewInput(event.toolUse.input),
|
|
48
|
-
};
|
|
49
|
-
return new Promise<ApprovalDecision>((resolve) => {
|
|
50
|
-
this.queue.push({ request, resolve });
|
|
51
|
-
this.emit();
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
public decide(decision: ApprovalDecision): void {
|
|
56
|
-
const item = this.queue.shift();
|
|
57
|
-
if (!item) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
item.resolve(decision);
|
|
61
|
-
this.emit();
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
private emit(): void {
|
|
65
|
-
for (const listener of this.listeners) {
|
|
66
|
-
listener();
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export function createChatApprovalHandler(
|
|
72
|
-
controller: ChatApprovalController,
|
|
73
|
-
options?: { yolo?: boolean },
|
|
74
|
-
): (event: BeforeToolCallEvent) => Promise<void> {
|
|
75
|
-
return async (event: BeforeToolCallEvent) => {
|
|
76
|
-
const toolName = event.toolUse.name;
|
|
77
|
-
if (options?.yolo) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
if (
|
|
81
|
-
INTERNAL_ALWAYS_ALLOWED.has(toolName) ||
|
|
82
|
-
isToolSessionAllowed(event.agent, toolName)
|
|
83
|
-
) {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const decision = await controller.request(event);
|
|
88
|
-
if (decision === "allow") {
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
if (decision === "always") {
|
|
92
|
-
allowToolForSession(event.agent, toolName);
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
event.cancel = `Tool "${toolName}" was rejected by the user.`;
|
|
96
|
-
};
|
|
97
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Box, Text } from "ink";
|
|
2
|
-
import SelectInput from "ink-select-input";
|
|
3
|
-
import type { ApprovalDecision } from "../types.ts";
|
|
4
|
-
|
|
5
|
-
type ApprovalPromptProps = {
|
|
6
|
-
onDecision: (decision: ApprovalDecision) => void;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export function ApprovalPrompt({ onDecision }: ApprovalPromptProps) {
|
|
10
|
-
return (
|
|
11
|
-
<Box flexDirection="column">
|
|
12
|
-
<SelectInput<ApprovalDecision>
|
|
13
|
-
items={[
|
|
14
|
-
{ label: "Allow", value: "allow" },
|
|
15
|
-
{ label: "Always", value: "always" },
|
|
16
|
-
{ label: "Deny", value: "reject" },
|
|
17
|
-
]}
|
|
18
|
-
onSelect={(item) => onDecision(item.value)}
|
|
19
|
-
/>
|
|
20
|
-
<Box marginTop={1}>
|
|
21
|
-
<Text color="gray">up/down - choose - enter select</Text>
|
|
22
|
-
</Box>
|
|
23
|
-
</Box>
|
|
24
|
-
);
|
|
25
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Box, Text } from "ink";
|
|
2
|
-
import type { ChatLine } from "../types.ts";
|
|
3
|
-
import { lineColor } from "./shared.ts";
|
|
4
|
-
import { MarkdownMessage } from "./markdown/MarkdownMessage.tsx";
|
|
5
|
-
import { ReasoningStrip } from "./ReasoningStrip.tsx";
|
|
6
|
-
import { ThinkingStatus } from "./ThinkingStatus.tsx";
|
|
7
|
-
|
|
8
|
-
type ChatMessageProps = {
|
|
9
|
-
line: ChatLine;
|
|
10
|
-
liveReasoning?: string;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export function ChatMessage({ line, liveReasoning = "" }: ChatMessageProps) {
|
|
14
|
-
const roleName =
|
|
15
|
-
line.role === "user"
|
|
16
|
-
? "You"
|
|
17
|
-
: line.role === "assistant"
|
|
18
|
-
? "Assistant"
|
|
19
|
-
: (line.title ?? "System");
|
|
20
|
-
const isPendingAssistant = line.role === "assistant" && !line.done;
|
|
21
|
-
const rawText =
|
|
22
|
-
line.role === "assistant" ? line.content : line.content.trim();
|
|
23
|
-
const text = rawText || (line.done ? "(empty)" : "");
|
|
24
|
-
const shouldShowBody = Boolean(text) || !isPendingAssistant;
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<Box flexDirection="column" marginBottom={1}>
|
|
28
|
-
<Box flexDirection="row">
|
|
29
|
-
<Text bold color={lineColor(line)}>
|
|
30
|
-
{roleName}
|
|
31
|
-
</Text>
|
|
32
|
-
{isPendingAssistant ? <ThinkingStatus /> : null}
|
|
33
|
-
</Box>
|
|
34
|
-
{isPendingAssistant && liveReasoning ? (
|
|
35
|
-
<ReasoningStrip text={liveReasoning} maxVisibleLines={2} />
|
|
36
|
-
) : null}
|
|
37
|
-
{shouldShowBody ? (
|
|
38
|
-
line.role === "assistant" ? (
|
|
39
|
-
<MarkdownMessage streaming={isPendingAssistant}>
|
|
40
|
-
{text}
|
|
41
|
-
</MarkdownMessage>
|
|
42
|
-
) : (
|
|
43
|
-
<Text color={line.role === "user" ? undefined : lineColor(line)}>
|
|
44
|
-
{text}
|
|
45
|
-
</Text>
|
|
46
|
-
)
|
|
47
|
-
) : null}
|
|
48
|
-
</Box>
|
|
49
|
-
);
|
|
50
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Box, Text } from "ink";
|
|
2
|
-
import { PromptInput } from "./PromptInput.tsx";
|
|
3
|
-
import type { PromptSubmission } from "./prompt-input/hooks/usePromptInputController.ts";
|
|
4
|
-
|
|
5
|
-
type ComposerProps = {
|
|
6
|
-
input: string;
|
|
7
|
-
running: boolean;
|
|
8
|
-
disabled: boolean;
|
|
9
|
-
hint: string;
|
|
10
|
-
onChange: (value: string) => void;
|
|
11
|
-
onSubmit: (value: PromptSubmission) => void;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export function Composer({
|
|
15
|
-
input,
|
|
16
|
-
running,
|
|
17
|
-
disabled,
|
|
18
|
-
hint,
|
|
19
|
-
onChange,
|
|
20
|
-
onSubmit,
|
|
21
|
-
}: ComposerProps) {
|
|
22
|
-
return (
|
|
23
|
-
<>
|
|
24
|
-
<Box borderStyle="round" borderColor="gray" paddingX={1}>
|
|
25
|
-
<Text color="gray">{"> "}</Text>
|
|
26
|
-
<PromptInput
|
|
27
|
-
value={input}
|
|
28
|
-
onChange={onChange}
|
|
29
|
-
onSubmit={onSubmit}
|
|
30
|
-
placeholder={
|
|
31
|
-
running
|
|
32
|
-
? "Type a message (queued after current turn)"
|
|
33
|
-
: "Type a message"
|
|
34
|
-
}
|
|
35
|
-
focus={!disabled}
|
|
36
|
-
maxVisibleLines={4}
|
|
37
|
-
/>
|
|
38
|
-
</Box>
|
|
39
|
-
|
|
40
|
-
<Box>
|
|
41
|
-
<Text color="gray">{hint}</Text>
|
|
42
|
-
</Box>
|
|
43
|
-
</>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Box, Text, useWindowSize } from "ink";
|
|
3
|
-
import { ASCII_ART } from "./ascii-logo.ts";
|
|
4
|
-
|
|
5
|
-
export function EmptyChatBanner(): React.JSX.Element {
|
|
6
|
-
const { columns } = useWindowSize();
|
|
7
|
-
|
|
8
|
-
return (
|
|
9
|
-
<Box flexDirection="column" width={columns}>
|
|
10
|
-
<Box
|
|
11
|
-
width={columns}
|
|
12
|
-
flexDirection="row"
|
|
13
|
-
justifyContent="center"
|
|
14
|
-
paddingY={2}
|
|
15
|
-
>
|
|
16
|
-
<Box flexDirection="column">
|
|
17
|
-
{ASCII_ART.map((line, i) => (
|
|
18
|
-
<Text key={i} color="cyan" bold>
|
|
19
|
-
{line}
|
|
20
|
-
</Text>
|
|
21
|
-
))}
|
|
22
|
-
</Box>
|
|
23
|
-
</Box>
|
|
24
|
-
</Box>
|
|
25
|
-
);
|
|
26
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import { splitLineAtCursor } from "./prompt-input/render.ts";
|
|
4
|
-
import {
|
|
5
|
-
usePromptInputController,
|
|
6
|
-
type PromptSubmission,
|
|
7
|
-
} from "./prompt-input/hooks/usePromptInputController.ts";
|
|
8
|
-
|
|
9
|
-
export type PromptInputProps = {
|
|
10
|
-
value: string;
|
|
11
|
-
onChange: (value: string) => void;
|
|
12
|
-
onSubmit: (value: PromptSubmission) => void;
|
|
13
|
-
placeholder?: string;
|
|
14
|
-
focus?: boolean;
|
|
15
|
-
maxVisibleLines?: number;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export function PromptInput({
|
|
19
|
-
value,
|
|
20
|
-
onChange,
|
|
21
|
-
onSubmit,
|
|
22
|
-
placeholder = "",
|
|
23
|
-
focus = true,
|
|
24
|
-
maxVisibleLines = 4,
|
|
25
|
-
}: PromptInputProps): React.JSX.Element {
|
|
26
|
-
const { view } = usePromptInputController({
|
|
27
|
-
value,
|
|
28
|
-
onChange,
|
|
29
|
-
onSubmit,
|
|
30
|
-
focus,
|
|
31
|
-
maxVisibleLines,
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
if (view.showPlaceholder) {
|
|
35
|
-
return (
|
|
36
|
-
<Text>
|
|
37
|
-
{focus ? <Text inverse> </Text> : null}
|
|
38
|
-
{placeholder ? <Text color="gray">{placeholder}</Text> : null}
|
|
39
|
-
</Text>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<Box flexDirection="column">
|
|
45
|
-
{view.visibleLines.map((line, index) => {
|
|
46
|
-
const isCursorLine = focus && index === view.cursorLineInView;
|
|
47
|
-
if (!isCursorLine) {
|
|
48
|
-
return <Text key={`${view.lineOffset + index}`}>{line}</Text>;
|
|
49
|
-
}
|
|
50
|
-
const safeColumn = Math.min(Math.max(0, view.cursorCol), line.length);
|
|
51
|
-
const parts = splitLineAtCursor(line, safeColumn);
|
|
52
|
-
return (
|
|
53
|
-
<Text key={`${view.lineOffset + index}`}>
|
|
54
|
-
{parts.left}
|
|
55
|
-
<Text inverse>{parts.at}</Text>
|
|
56
|
-
{parts.right}
|
|
57
|
-
</Text>
|
|
58
|
-
);
|
|
59
|
-
})}
|
|
60
|
-
</Box>
|
|
61
|
-
);
|
|
62
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Box, Text, useStdout } from "ink";
|
|
3
|
-
import type { PromptSubmission } from "./prompt-input/hooks/usePromptInputController.ts";
|
|
4
|
-
|
|
5
|
-
type QueuedPromptsProps = {
|
|
6
|
-
prompts: readonly { id: string; prompt: PromptSubmission }[];
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
const MIN_PROMPT_PREVIEW_CHARS = 16;
|
|
10
|
-
const MAX_PROMPT_PREVIEW_CHARS = 120;
|
|
11
|
-
const ELLIPSIS = "...";
|
|
12
|
-
|
|
13
|
-
function normalizePrompt(prompt: string): string {
|
|
14
|
-
return prompt.replace(/\s+/g, " ").trim();
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function promptPreview(prompt: PromptSubmission): string {
|
|
18
|
-
const text = normalizePrompt(prompt.text);
|
|
19
|
-
if (prompt.attachments.length === 0) {
|
|
20
|
-
return text;
|
|
21
|
-
}
|
|
22
|
-
const suffix = `${prompt.attachments.length} attachment${
|
|
23
|
-
prompt.attachments.length === 1 ? "" : "s"
|
|
24
|
-
}`;
|
|
25
|
-
return text ? `${text} (${suffix})` : suffix;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function truncatePrompt(prompt: string, maxChars: number): string {
|
|
29
|
-
if (prompt.length <= maxChars) {
|
|
30
|
-
return prompt;
|
|
31
|
-
}
|
|
32
|
-
if (maxChars <= ELLIPSIS.length) {
|
|
33
|
-
return ELLIPSIS.slice(0, maxChars);
|
|
34
|
-
}
|
|
35
|
-
return `${prompt.slice(0, maxChars - ELLIPSIS.length)}${ELLIPSIS}`;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function QueuedPrompts({
|
|
39
|
-
prompts,
|
|
40
|
-
}: QueuedPromptsProps): React.JSX.Element | null {
|
|
41
|
-
const { stdout } = useStdout();
|
|
42
|
-
if (prompts.length === 0) {
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const columns = stdout?.columns ?? 80;
|
|
47
|
-
const maxPromptChars = Math.max(
|
|
48
|
-
MIN_PROMPT_PREVIEW_CHARS,
|
|
49
|
-
Math.min(MAX_PROMPT_PREVIEW_CHARS, columns - 8),
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<Box
|
|
54
|
-
flexDirection="column"
|
|
55
|
-
borderStyle="round"
|
|
56
|
-
borderColor="gray"
|
|
57
|
-
paddingX={1}
|
|
58
|
-
>
|
|
59
|
-
<Text color="gray">
|
|
60
|
-
queued {prompts.length === 1 ? "prompt" : "prompts"}
|
|
61
|
-
</Text>
|
|
62
|
-
{prompts.map((item) => {
|
|
63
|
-
const preview = truncatePrompt(
|
|
64
|
-
promptPreview(item.prompt),
|
|
65
|
-
maxPromptChars,
|
|
66
|
-
);
|
|
67
|
-
return (
|
|
68
|
-
<Text key={item.id} color="gray">
|
|
69
|
-
{"\u25cb "}
|
|
70
|
-
{preview}
|
|
71
|
-
</Text>
|
|
72
|
-
);
|
|
73
|
-
})}
|
|
74
|
-
</Box>
|
|
75
|
-
);
|
|
76
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Box, Text, useWindowSize } from "ink";
|
|
2
|
-
import { wrapTextToLines } from "./shared.ts";
|
|
3
|
-
|
|
4
|
-
type ReasoningStripProps = {
|
|
5
|
-
text: string;
|
|
6
|
-
maxVisibleLines?: number;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export function ReasoningStrip({
|
|
10
|
-
text,
|
|
11
|
-
maxVisibleLines = 2,
|
|
12
|
-
}: ReasoningStripProps) {
|
|
13
|
-
const { columns } = useWindowSize();
|
|
14
|
-
const wrapped = wrapTextToLines(text, Math.max(20, columns - 6));
|
|
15
|
-
const visibleLines = wrapped.slice(-maxVisibleLines);
|
|
16
|
-
|
|
17
|
-
if (visibleLines.length === 0) {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<Box flexDirection="column">
|
|
23
|
-
{visibleLines.map((line, index) => (
|
|
24
|
-
<Text key={index} color="gray" wrap="wrap">
|
|
25
|
-
{line || " "}
|
|
26
|
-
</Text>
|
|
27
|
-
))}
|
|
28
|
-
</Box>
|
|
29
|
-
);
|
|
30
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
|
-
import { Text } from "ink";
|
|
3
|
-
import cliSpinners, { type SpinnerName } from "cli-spinners";
|
|
4
|
-
|
|
5
|
-
type SpinnerProps = {
|
|
6
|
-
type?: SpinnerName;
|
|
7
|
-
color?: string;
|
|
8
|
-
bold?: boolean;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export function Spinner({
|
|
12
|
-
type = "star",
|
|
13
|
-
color = "cyan",
|
|
14
|
-
bold = true,
|
|
15
|
-
}: SpinnerProps) {
|
|
16
|
-
const spinner = cliSpinners[type] || cliSpinners.dots;
|
|
17
|
-
const { frames, interval } = spinner;
|
|
18
|
-
const [index, setIndex] = useState(0);
|
|
19
|
-
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
const timer = setInterval(() => {
|
|
22
|
-
setIndex((value) => (value + 1) % frames.length);
|
|
23
|
-
}, interval);
|
|
24
|
-
return () => {
|
|
25
|
-
clearInterval(timer);
|
|
26
|
-
};
|
|
27
|
-
}, [frames.length, interval]);
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<Text color={color} bold={bold}>
|
|
31
|
-
{frames[index]}
|
|
32
|
-
</Text>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { Box, Text } from "ink";
|
|
2
|
-
import type { Manager as McpManager } from "../../core/mcp/index.ts";
|
|
3
|
-
|
|
4
|
-
type StatusBarProps = {
|
|
5
|
-
running: boolean;
|
|
6
|
-
status: string;
|
|
7
|
-
statusLabel?: string;
|
|
8
|
-
sessionId: string;
|
|
9
|
-
elapsedLabel: string;
|
|
10
|
-
turnCount: number;
|
|
11
|
-
totalTools: number;
|
|
12
|
-
skillsFound: number;
|
|
13
|
-
manager: McpManager;
|
|
14
|
-
usage: {
|
|
15
|
-
inputTokens: number;
|
|
16
|
-
outputTokens: number;
|
|
17
|
-
totalTokens: number;
|
|
18
|
-
latencyMs: number;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
/** Ink color for the live status token only (labels stay `gray`). */
|
|
23
|
-
function statusValueColor(status: string): string {
|
|
24
|
-
switch (status) {
|
|
25
|
-
case "ready":
|
|
26
|
-
return "green";
|
|
27
|
-
case "thinking":
|
|
28
|
-
case "streaming":
|
|
29
|
-
case "running tool":
|
|
30
|
-
case "cancel requested":
|
|
31
|
-
return "yellow";
|
|
32
|
-
default:
|
|
33
|
-
return "gray";
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export function StatusBar({
|
|
38
|
-
running,
|
|
39
|
-
status,
|
|
40
|
-
statusLabel,
|
|
41
|
-
sessionId,
|
|
42
|
-
elapsedLabel,
|
|
43
|
-
turnCount,
|
|
44
|
-
totalTools,
|
|
45
|
-
skillsFound,
|
|
46
|
-
manager,
|
|
47
|
-
usage,
|
|
48
|
-
}: StatusBarProps) {
|
|
49
|
-
return (
|
|
50
|
-
<Box marginTop={1} flexDirection="column">
|
|
51
|
-
<Text>
|
|
52
|
-
<Text color="gray">status: </Text>
|
|
53
|
-
<Text color={statusValueColor(status)}>{statusLabel ?? status}</Text>
|
|
54
|
-
<Text color="gray"> • session: {sessionId}</Text>
|
|
55
|
-
</Text>
|
|
56
|
-
<Text color="gray">
|
|
57
|
-
turns: {turnCount} • tokens in/out/total: {usage.inputTokens}/
|
|
58
|
-
{usage.outputTokens}/{usage.totalTokens}
|
|
59
|
-
{usage.latencyMs > 0 ? ` • latency: ${usage.latencyMs}ms` : ""}
|
|
60
|
-
{running ? <Text color="gray"> • elapsed {elapsedLabel}</Text> : null}
|
|
61
|
-
</Text>
|
|
62
|
-
<Text color="gray">
|
|
63
|
-
{`mcp servers: ${manager.clients.size} • tools: ${totalTools} • skills: ${skillsFound}`}
|
|
64
|
-
</Text>
|
|
65
|
-
</Box>
|
|
66
|
-
);
|
|
67
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import { Spinner } from "./Spinner.tsx";
|
|
4
|
-
|
|
5
|
-
const THINKING_VERBS = [
|
|
6
|
-
"is thinking",
|
|
7
|
-
"is analyzing contextual data",
|
|
8
|
-
"is pondering",
|
|
9
|
-
"is exploring possibilities",
|
|
10
|
-
"is synthesizing ideas",
|
|
11
|
-
"is computing paths",
|
|
12
|
-
"is resolving logic",
|
|
13
|
-
"is parsing semantics",
|
|
14
|
-
"is constructing responses",
|
|
15
|
-
"is interpreting intent",
|
|
16
|
-
"is weaving thoughts",
|
|
17
|
-
"is processing inputs",
|
|
18
|
-
"is evaluating constraints",
|
|
19
|
-
"is assembling paradigms",
|
|
20
|
-
"is calibrating tensors",
|
|
21
|
-
"is indexing memories",
|
|
22
|
-
"is extrapolating vectors",
|
|
23
|
-
"is connecting dots",
|
|
24
|
-
"is deciphering queries",
|
|
25
|
-
"is aligning objectives",
|
|
26
|
-
"is routing thoughts",
|
|
27
|
-
"is optimizing heuristic bounds",
|
|
28
|
-
"is unrolling loops",
|
|
29
|
-
"is querying knowledge graphs",
|
|
30
|
-
"is bridging concepts",
|
|
31
|
-
"is formulating strategies",
|
|
32
|
-
"is reviewing context windows",
|
|
33
|
-
"is distilling facts",
|
|
34
|
-
"is structuring syntax",
|
|
35
|
-
"is generating potential worlds",
|
|
36
|
-
"is rendering concepts",
|
|
37
|
-
"is simulating outcomes",
|
|
38
|
-
"is drafting narratives",
|
|
39
|
-
"is tracing execution flows",
|
|
40
|
-
"is projecting scenarios",
|
|
41
|
-
"is expanding context networks",
|
|
42
|
-
"is cross-referencing archives",
|
|
43
|
-
"is mapping algorithms",
|
|
44
|
-
"is building semantic bridges",
|
|
45
|
-
"is decoding symbols",
|
|
46
|
-
"is unwinding recursive thoughts",
|
|
47
|
-
"is fetching relevant insights",
|
|
48
|
-
"is analyzing edge cases",
|
|
49
|
-
"is establishing connections",
|
|
50
|
-
"is evaluating syntax trees",
|
|
51
|
-
"is navigating logical gates",
|
|
52
|
-
"is deducing conclusions",
|
|
53
|
-
"is searching the latent space",
|
|
54
|
-
"is inferring implicit meaning",
|
|
55
|
-
"is mapping dimensions",
|
|
56
|
-
"is assessing probability",
|
|
57
|
-
"is calculating next steps",
|
|
58
|
-
"is traversing conceptual graphs",
|
|
59
|
-
"is examining edge variables",
|
|
60
|
-
"is verifying constraints",
|
|
61
|
-
"is scanning mental databases",
|
|
62
|
-
"is aggregating ideas",
|
|
63
|
-
"is refining logic structures",
|
|
64
|
-
"is projecting logic",
|
|
65
|
-
"is analyzing potential solutions",
|
|
66
|
-
"is calculating vector spaces",
|
|
67
|
-
"is synthesizing paradigms",
|
|
68
|
-
"is reviewing previous statements",
|
|
69
|
-
"is mapping causal links",
|
|
70
|
-
"is deriving corollaries",
|
|
71
|
-
"is simulating dialogue",
|
|
72
|
-
"is mapping logical spaces",
|
|
73
|
-
"is assembling puzzle pieces",
|
|
74
|
-
"is generating possibilities",
|
|
75
|
-
"is weighing alternatives",
|
|
76
|
-
"is constructing arguments",
|
|
77
|
-
"is decoding ambiguity",
|
|
78
|
-
"is inferring patterns",
|
|
79
|
-
"is clustering relevant topics",
|
|
80
|
-
"is exploring latent variables",
|
|
81
|
-
"is extracting semantic cores",
|
|
82
|
-
"is balancing equations",
|
|
83
|
-
"is translating concepts",
|
|
84
|
-
"is modeling realities",
|
|
85
|
-
"is connecting synapses",
|
|
86
|
-
"is activating neural pathways",
|
|
87
|
-
"is fine-tuning outputs",
|
|
88
|
-
"is tracing linguistic roots",
|
|
89
|
-
"is measuring semantic proximity",
|
|
90
|
-
"is formulating plans",
|
|
91
|
-
"is constructing frameworks",
|
|
92
|
-
"is organizing thought streams",
|
|
93
|
-
"is linking references",
|
|
94
|
-
"is analyzing tone",
|
|
95
|
-
"is scanning knowledge bases",
|
|
96
|
-
"is piecing together models",
|
|
97
|
-
"is building cognitive structures",
|
|
98
|
-
"is generating insights",
|
|
99
|
-
"is forecasting responses",
|
|
100
|
-
"is evaluating trade-offs",
|
|
101
|
-
"is mapping inference paths",
|
|
102
|
-
"is predicting user intent",
|
|
103
|
-
"is resolving paradoxes",
|
|
104
|
-
"is unpacking meaning",
|
|
105
|
-
"is tracing references",
|
|
106
|
-
];
|
|
107
|
-
|
|
108
|
-
export function ThinkingStatus() {
|
|
109
|
-
const [verbIndex, setVerbIndex] = useState(() =>
|
|
110
|
-
Math.floor(Math.random() * THINKING_VERBS.length),
|
|
111
|
-
);
|
|
112
|
-
|
|
113
|
-
useEffect(() => {
|
|
114
|
-
const timer = setInterval(() => {
|
|
115
|
-
setVerbIndex((value) => (value + 1) % THINKING_VERBS.length);
|
|
116
|
-
}, 1500);
|
|
117
|
-
return () => {
|
|
118
|
-
clearInterval(timer);
|
|
119
|
-
};
|
|
120
|
-
}, []);
|
|
121
|
-
|
|
122
|
-
return (
|
|
123
|
-
<Box marginLeft={1}>
|
|
124
|
-
<Spinner type="star" color="cyan" />
|
|
125
|
-
<Text color="gray">{` ${THINKING_VERBS[verbIndex]}...`}</Text>
|
|
126
|
-
</Box>
|
|
127
|
-
);
|
|
128
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { Box, Text } from "ink";
|
|
2
|
-
import type { TodoItem } from "../../core/state/todos.ts";
|
|
3
|
-
|
|
4
|
-
type TodoPanelProps = {
|
|
5
|
-
todos: TodoItem[];
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
function markerForStatus(status: TodoItem["status"]): string {
|
|
9
|
-
switch (status) {
|
|
10
|
-
case "completed":
|
|
11
|
-
return "[x]";
|
|
12
|
-
case "in_progress":
|
|
13
|
-
return "[~]";
|
|
14
|
-
case "pending":
|
|
15
|
-
return "[ ]";
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function TodoPanel({ todos }: TodoPanelProps) {
|
|
20
|
-
if (todos.length === 0) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<Box flexDirection="column" marginTop={1}>
|
|
26
|
-
<Text bold color="cyan">
|
|
27
|
-
Todos
|
|
28
|
-
</Text>
|
|
29
|
-
{todos.map((todo, index) => {
|
|
30
|
-
const completed = todo.status === "completed";
|
|
31
|
-
const inProgress = todo.status === "in_progress";
|
|
32
|
-
const marker = markerForStatus(todo.status);
|
|
33
|
-
const suffix =
|
|
34
|
-
inProgress && todo.activeForm.trim().length > 0
|
|
35
|
-
? ` — ${todo.activeForm}`
|
|
36
|
-
: "";
|
|
37
|
-
return (
|
|
38
|
-
<Text
|
|
39
|
-
key={`${index}-${todo.content}`}
|
|
40
|
-
dimColor={completed}
|
|
41
|
-
bold={inProgress}
|
|
42
|
-
>
|
|
43
|
-
{`${index + 1}. ${marker} ${todo.content}${suffix}`}
|
|
44
|
-
</Text>
|
|
45
|
-
);
|
|
46
|
-
})}
|
|
47
|
-
</Box>
|
|
48
|
-
);
|
|
49
|
-
}
|