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
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import { Spinner } from "../../chat/components/Spinner.tsx";
|
|
4
|
-
|
|
5
|
-
type BusyScreenProps = {
|
|
6
|
-
message: string;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export function BusyScreen({ message }: BusyScreenProps): React.JSX.Element {
|
|
10
|
-
return (
|
|
11
|
-
<Box flexDirection="column" marginTop={1}>
|
|
12
|
-
<Text bold>Working</Text>
|
|
13
|
-
<Box marginTop={1}>
|
|
14
|
-
<Spinner type="dots" color="cyan" />
|
|
15
|
-
<Text>{` ${message}`}</Text>
|
|
16
|
-
</Box>
|
|
17
|
-
<Box marginTop={1}>
|
|
18
|
-
<Text color="gray">Please wait...</Text>
|
|
19
|
-
</Box>
|
|
20
|
-
</Box>
|
|
21
|
-
);
|
|
22
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import type { MenuItem } from "../types.ts";
|
|
4
|
-
import { MenuScreen } from "./MenuScreen.tsx";
|
|
5
|
-
|
|
6
|
-
type HomeScreenProps = {
|
|
7
|
-
rootPath: string;
|
|
8
|
-
configPath: string;
|
|
9
|
-
instructionsPath: string;
|
|
10
|
-
mcpPath: string;
|
|
11
|
-
skillsPath: string;
|
|
12
|
-
items: MenuItem[];
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export function HomeScreen({
|
|
16
|
-
rootPath,
|
|
17
|
-
configPath,
|
|
18
|
-
instructionsPath,
|
|
19
|
-
mcpPath,
|
|
20
|
-
skillsPath,
|
|
21
|
-
items,
|
|
22
|
-
}: HomeScreenProps): React.JSX.Element {
|
|
23
|
-
return (
|
|
24
|
-
<Box flexDirection="column" marginTop={1}>
|
|
25
|
-
<Text color="gray">
|
|
26
|
-
<Text bold>root:</Text> {rootPath}
|
|
27
|
-
</Text>
|
|
28
|
-
<Text color="gray">
|
|
29
|
-
<Text bold>config.json:</Text> {configPath}
|
|
30
|
-
</Text>
|
|
31
|
-
<Text color="gray">
|
|
32
|
-
<Text bold>instructions.md:</Text> {instructionsPath}
|
|
33
|
-
</Text>
|
|
34
|
-
<Text color="gray">
|
|
35
|
-
<Text bold>mcp.json:</Text> {mcpPath}
|
|
36
|
-
</Text>
|
|
37
|
-
<Text color="gray">
|
|
38
|
-
<Text bold>skills/:</Text> {skillsPath}
|
|
39
|
-
</Text>
|
|
40
|
-
<MenuScreen items={items} footerHint="enter: select | ctrl+c: exit" />
|
|
41
|
-
</Box>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import SelectInput from "ink-select-input";
|
|
4
|
-
import type { MenuAction, MenuItem } from "../types.ts";
|
|
5
|
-
import { SelectMenuItem } from "./SelectMenuItem.tsx";
|
|
6
|
-
|
|
7
|
-
type MenuScreenProps = {
|
|
8
|
-
title?: string;
|
|
9
|
-
description?: string;
|
|
10
|
-
items: MenuItem[];
|
|
11
|
-
footerHint?: string;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export function MenuScreen({
|
|
15
|
-
title,
|
|
16
|
-
description,
|
|
17
|
-
items,
|
|
18
|
-
footerHint = "enter: select | esc: back | ctrl+c: exit",
|
|
19
|
-
}: MenuScreenProps): React.JSX.Element {
|
|
20
|
-
const hasHeader = Boolean(title?.trim()) || Boolean(description?.trim());
|
|
21
|
-
const keyedItems = items.map((item, index) => ({
|
|
22
|
-
...item,
|
|
23
|
-
key: item.key ?? `${title ?? "menu"}:${index}:${item.label}`,
|
|
24
|
-
}));
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<Box flexDirection="column" marginTop={1}>
|
|
28
|
-
{title?.trim() ? <Text bold>{title}</Text> : null}
|
|
29
|
-
{description ? <Text color="gray">{description}</Text> : null}
|
|
30
|
-
<Box marginTop={hasHeader ? 1 : 0}>
|
|
31
|
-
<SelectInput<MenuAction>
|
|
32
|
-
items={keyedItems}
|
|
33
|
-
itemComponent={SelectMenuItem}
|
|
34
|
-
onSelect={(item) => {
|
|
35
|
-
void item.value();
|
|
36
|
-
}}
|
|
37
|
-
/>
|
|
38
|
-
</Box>
|
|
39
|
-
<Box marginTop={1}>
|
|
40
|
-
<Text color="gray">{footerHint}</Text>
|
|
41
|
-
</Box>
|
|
42
|
-
</Box>
|
|
43
|
-
);
|
|
44
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from "react";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import TextInput from "ink-text-input";
|
|
4
|
-
import type { PromptState } from "../types.ts";
|
|
5
|
-
|
|
6
|
-
type PromptFormProps = {
|
|
7
|
-
prompt: PromptState;
|
|
8
|
-
onSubmit: (value: string) => void | Promise<void>;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export function PromptForm({
|
|
12
|
-
prompt,
|
|
13
|
-
onSubmit,
|
|
14
|
-
}: PromptFormProps): React.JSX.Element {
|
|
15
|
-
const [value, setValue] = useState(prompt.initialValue ?? "");
|
|
16
|
-
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
setValue(prompt.initialValue ?? "");
|
|
19
|
-
}, [prompt.initialValue, prompt.title, prompt.label]);
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<Box flexDirection="column" marginTop={1}>
|
|
23
|
-
<Text bold>{prompt.title}</Text>
|
|
24
|
-
<Text color="gray">{prompt.label}</Text>
|
|
25
|
-
{prompt.note ? <Text color="gray">{prompt.note}</Text> : null}
|
|
26
|
-
<Box marginTop={1} borderStyle="round" borderColor="cyan" paddingX={1}>
|
|
27
|
-
<Text color="gray">{"> "}</Text>
|
|
28
|
-
<TextInput
|
|
29
|
-
value={value}
|
|
30
|
-
onChange={setValue}
|
|
31
|
-
onSubmit={() => void onSubmit(value)}
|
|
32
|
-
placeholder={prompt.placeholder ?? ""}
|
|
33
|
-
/>
|
|
34
|
-
</Box>
|
|
35
|
-
<Box marginTop={1}>
|
|
36
|
-
<Text color="gray">enter: submit | esc: cancel | ctrl+c: exit</Text>
|
|
37
|
-
</Box>
|
|
38
|
-
</Box>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Text } from "ink";
|
|
3
|
-
|
|
4
|
-
/** Custom row for `ink-select-input` so we can bold part of the label. */
|
|
5
|
-
export function SelectMenuItem(props: {
|
|
6
|
-
isSelected?: boolean;
|
|
7
|
-
label: string;
|
|
8
|
-
boldSubstring?: string;
|
|
9
|
-
}): React.JSX.Element {
|
|
10
|
-
const { isSelected, label, boldSubstring } = props;
|
|
11
|
-
const color = isSelected ? "blue" : undefined;
|
|
12
|
-
if (!boldSubstring) {
|
|
13
|
-
return <Text color={color}>{label}</Text>;
|
|
14
|
-
}
|
|
15
|
-
const i = label.indexOf(boldSubstring);
|
|
16
|
-
if (i === -1) {
|
|
17
|
-
return <Text color={color}>{label}</Text>;
|
|
18
|
-
}
|
|
19
|
-
const before = label.slice(0, i);
|
|
20
|
-
const after = label.slice(i + boldSubstring.length);
|
|
21
|
-
return (
|
|
22
|
-
<Text color={color}>
|
|
23
|
-
{before}
|
|
24
|
-
<Text bold color={color}>
|
|
25
|
-
{boldSubstring}
|
|
26
|
-
</Text>
|
|
27
|
-
{after}
|
|
28
|
-
</Text>
|
|
29
|
-
);
|
|
30
|
-
}
|
package/src/configure/index.tsx
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { mkdir } from "node:fs/promises";
|
|
3
|
-
import { render } from "ink";
|
|
4
|
-
import { ConfigureApp } from "./app.tsx";
|
|
5
|
-
import { Config as AppConfig } from "../core/config.ts";
|
|
6
|
-
import { Config as McpConfig } from "../core/mcp/config.ts";
|
|
7
|
-
import { createSkillsRegistry } from "../core/skills/index.ts";
|
|
8
|
-
import {
|
|
9
|
-
basePath,
|
|
10
|
-
configJsonPath,
|
|
11
|
-
mcpJsonPath,
|
|
12
|
-
skillsPath,
|
|
13
|
-
} from "../core/utils/paths.ts";
|
|
14
|
-
|
|
15
|
-
export async function configure(): Promise<void> {
|
|
16
|
-
await mkdir(basePath(), { recursive: true });
|
|
17
|
-
await mkdir(skillsPath(), { recursive: true });
|
|
18
|
-
|
|
19
|
-
const config = new AppConfig(configJsonPath());
|
|
20
|
-
const mcpConfig = new McpConfig(mcpJsonPath());
|
|
21
|
-
const skills = createSkillsRegistry(basePath());
|
|
22
|
-
|
|
23
|
-
let done = false;
|
|
24
|
-
const { waitUntilExit, unmount } = render(
|
|
25
|
-
<ConfigureApp
|
|
26
|
-
config={config}
|
|
27
|
-
mcpConfig={mcpConfig}
|
|
28
|
-
skills={skills}
|
|
29
|
-
onExit={() => {
|
|
30
|
-
done = true;
|
|
31
|
-
}}
|
|
32
|
-
/>,
|
|
33
|
-
{ exitOnCtrlC: false },
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
try {
|
|
37
|
-
await waitUntilExit();
|
|
38
|
-
} finally {
|
|
39
|
-
if (!done) {
|
|
40
|
-
unmount();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { spawnSync } from "node:child_process";
|
|
2
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
|
-
import { dirname } from "node:path";
|
|
4
|
-
import tty from "node:tty";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Open a real file in VISUAL / EDITOR (or a sensible platform default),
|
|
8
|
-
* block until the editor exits, then return the updated contents.
|
|
9
|
-
*
|
|
10
|
-
* This temporarily releases TTY raw mode so Ink can coexist with full-screen
|
|
11
|
-
* terminal editors like vim / nano.
|
|
12
|
-
*/
|
|
13
|
-
export function openFileInEditor(
|
|
14
|
-
filePath: string,
|
|
15
|
-
initialContent: string,
|
|
16
|
-
): string {
|
|
17
|
-
mkdirSync(dirname(filePath), { recursive: true });
|
|
18
|
-
if (!existsSync(filePath)) {
|
|
19
|
-
writeFileSync(filePath, initialContent, "utf8");
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const restore = releaseStdinForSubprocess();
|
|
23
|
-
try {
|
|
24
|
-
const { command, args, options } = resolveEditorSpawn(filePath);
|
|
25
|
-
const result = spawnSync(command, args, options);
|
|
26
|
-
if (result.error) {
|
|
27
|
-
throw result.error;
|
|
28
|
-
}
|
|
29
|
-
if (result.status !== 0 && result.status !== null) {
|
|
30
|
-
throw new Error(`Editor exited with code ${result.status}`);
|
|
31
|
-
}
|
|
32
|
-
return readFileSync(filePath, "utf8");
|
|
33
|
-
} finally {
|
|
34
|
-
restore();
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function releaseStdinForSubprocess(): () => void {
|
|
39
|
-
if (!process.stdin.isTTY) {
|
|
40
|
-
return () => {};
|
|
41
|
-
}
|
|
42
|
-
const stdin = process.stdin as tty.ReadStream;
|
|
43
|
-
const wasRaw = stdin.isRaw;
|
|
44
|
-
if (wasRaw) {
|
|
45
|
-
stdin.setRawMode(false);
|
|
46
|
-
}
|
|
47
|
-
stdin.pause();
|
|
48
|
-
return () => {
|
|
49
|
-
stdin.resume();
|
|
50
|
-
if (wasRaw) {
|
|
51
|
-
stdin.setRawMode(true);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function resolveEditorSpawn(filePath: string): {
|
|
57
|
-
command: string;
|
|
58
|
-
args: string[];
|
|
59
|
-
options: { stdio: "inherit"; shell?: boolean };
|
|
60
|
-
} {
|
|
61
|
-
const spec = (process.env.VISUAL ?? process.env.EDITOR ?? "").trim();
|
|
62
|
-
if (!spec) {
|
|
63
|
-
if (process.platform === "win32") {
|
|
64
|
-
return {
|
|
65
|
-
command: "notepad",
|
|
66
|
-
args: [filePath],
|
|
67
|
-
options: { stdio: "inherit" },
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
return {
|
|
71
|
-
command: "vi",
|
|
72
|
-
args: [filePath],
|
|
73
|
-
options: { stdio: "inherit" },
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (process.platform === "win32") {
|
|
78
|
-
return {
|
|
79
|
-
command: `${spec} "${filePath.replace(/"/g, '\\"')}"`,
|
|
80
|
-
args: [],
|
|
81
|
-
options: { stdio: "inherit", shell: true },
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const parts = tokenizeEditorSpec(spec);
|
|
86
|
-
if (parts.length === 0) {
|
|
87
|
-
return {
|
|
88
|
-
command: "vi",
|
|
89
|
-
args: [filePath],
|
|
90
|
-
options: { stdio: "inherit" },
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return {
|
|
95
|
-
command: parts[0]!,
|
|
96
|
-
args: [...parts.slice(1), filePath],
|
|
97
|
-
options: { stdio: "inherit" },
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/** Split VISUAL/EDITOR on spaces with basic quoted-token support. */
|
|
102
|
-
function tokenizeEditorSpec(s: string): string[] {
|
|
103
|
-
const out: string[] = [];
|
|
104
|
-
let cur = "";
|
|
105
|
-
let quote: '"' | "'" | null = null;
|
|
106
|
-
for (let i = 0; i < s.length; i += 1) {
|
|
107
|
-
const c = s[i]!;
|
|
108
|
-
if (quote) {
|
|
109
|
-
if (c === quote) {
|
|
110
|
-
quote = null;
|
|
111
|
-
} else {
|
|
112
|
-
cur += c;
|
|
113
|
-
}
|
|
114
|
-
continue;
|
|
115
|
-
}
|
|
116
|
-
if (c === '"' || c === "'") {
|
|
117
|
-
quote = c as '"' | "'";
|
|
118
|
-
continue;
|
|
119
|
-
}
|
|
120
|
-
if (/\s/.test(c)) {
|
|
121
|
-
if (cur.length > 0) {
|
|
122
|
-
out.push(cur);
|
|
123
|
-
cur = "";
|
|
124
|
-
}
|
|
125
|
-
continue;
|
|
126
|
-
}
|
|
127
|
-
cur += c;
|
|
128
|
-
}
|
|
129
|
-
if (cur.length > 0) {
|
|
130
|
-
out.push(cur);
|
|
131
|
-
}
|
|
132
|
-
return out;
|
|
133
|
-
}
|
package/src/configure/types.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { Config as AppConfig } from "../core/config.ts";
|
|
2
|
-
import type { Config as McpConfig } from "../core/mcp/config.ts";
|
|
3
|
-
import type { Registry as SkillsRegistry } from "../core/skills/registry.ts";
|
|
4
|
-
|
|
5
|
-
export type ConfigureAppProps = {
|
|
6
|
-
config: AppConfig;
|
|
7
|
-
mcpConfig: McpConfig;
|
|
8
|
-
skills: SkillsRegistry;
|
|
9
|
-
onExit: () => void;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export type Screen =
|
|
13
|
-
| { kind: "home" }
|
|
14
|
-
| { kind: "config" }
|
|
15
|
-
| { kind: "config-tools" }
|
|
16
|
-
| { kind: "config-provider" }
|
|
17
|
-
| { kind: "config-prompts" }
|
|
18
|
-
| { kind: "config-search" }
|
|
19
|
-
| { kind: "config-search-provider" }
|
|
20
|
-
| { kind: "config-ltm" }
|
|
21
|
-
| { kind: "config-wiki" }
|
|
22
|
-
| { kind: "mcp" }
|
|
23
|
-
| { kind: "mcp-delete-confirm"; name: string }
|
|
24
|
-
| { kind: "skills" }
|
|
25
|
-
| { kind: "skills-delete-confirm"; folder: string; displayName: string }
|
|
26
|
-
| { kind: "skills-search-results"; query: string };
|
|
27
|
-
|
|
28
|
-
export type Notice = {
|
|
29
|
-
kind: "success" | "error" | "info";
|
|
30
|
-
text: string;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export type PromptState = {
|
|
34
|
-
title: string;
|
|
35
|
-
label: string;
|
|
36
|
-
initialValue?: string;
|
|
37
|
-
placeholder?: string;
|
|
38
|
-
note?: string;
|
|
39
|
-
onSubmit: (value: string) => void | Promise<void>;
|
|
40
|
-
onCancel?: () => void;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export type MenuAction = () => void | Promise<void>;
|
|
44
|
-
|
|
45
|
-
export type MenuItem = {
|
|
46
|
-
key?: string;
|
|
47
|
-
label: string;
|
|
48
|
-
/** First occurrence in `label` is rendered bold (MCP server name, skill title, etc.). */
|
|
49
|
-
boldSubstring?: string;
|
|
50
|
-
value: MenuAction;
|
|
51
|
-
};
|
package/src/configure/utils.ts
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { basename, dirname } from "node:path";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import type { McpTransport } from "../core/mcp/types.ts";
|
|
4
|
-
import type { SkillListEntry } from "../core/skills/registry.ts";
|
|
5
|
-
import type { Notice } from "./types.ts";
|
|
6
|
-
|
|
7
|
-
const StringArraySchema = z.array(z.string());
|
|
8
|
-
const StringRecordSchema = z.record(z.string(), z.string());
|
|
9
|
-
|
|
10
|
-
export const DEFAULT_INSTRUCTIONS = `# Instructions
|
|
11
|
-
|
|
12
|
-
You are Hooman.
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
export function compactJson(value: unknown): string {
|
|
16
|
-
return JSON.stringify(value);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const MASKED_PARAM_KEYS = new Set(["apikey", "clientconfig"]);
|
|
20
|
-
|
|
21
|
-
export function maskSensitiveParamsForDisplay(value: unknown): unknown {
|
|
22
|
-
if (Array.isArray(value)) {
|
|
23
|
-
return value.map((item) => maskSensitiveParamsForDisplay(item));
|
|
24
|
-
}
|
|
25
|
-
if (!value || typeof value !== "object") {
|
|
26
|
-
return value;
|
|
27
|
-
}
|
|
28
|
-
const input = value as Record<string, unknown>;
|
|
29
|
-
const output: Record<string, unknown> = {};
|
|
30
|
-
for (const [key, itemValue] of Object.entries(input)) {
|
|
31
|
-
if (MASKED_PARAM_KEYS.has(key.toLowerCase())) {
|
|
32
|
-
output[key] = "[REDACTED]";
|
|
33
|
-
continue;
|
|
34
|
-
}
|
|
35
|
-
output[key] = maskSensitiveParamsForDisplay(itemValue);
|
|
36
|
-
}
|
|
37
|
-
return output;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function truncate(text: string, max: number = 88): string {
|
|
41
|
-
return text.length > max ? `${text.slice(0, max - 1)}…` : text;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function folderNameForSkill(skill: SkillListEntry): string {
|
|
45
|
-
return basename(dirname(skill.path));
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function parseObjectRecord(
|
|
49
|
-
input: string,
|
|
50
|
-
label: string,
|
|
51
|
-
): Record<string, unknown> {
|
|
52
|
-
const trimmed = input.trim();
|
|
53
|
-
if (!trimmed) {
|
|
54
|
-
return {};
|
|
55
|
-
}
|
|
56
|
-
const parsed = JSON.parse(trimmed) as unknown;
|
|
57
|
-
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
58
|
-
throw new Error(`${label} must be a JSON object.`);
|
|
59
|
-
}
|
|
60
|
-
return parsed as Record<string, unknown>;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export function parseStringArray(input: string, label: string): string[] {
|
|
64
|
-
const trimmed = input.trim();
|
|
65
|
-
if (!trimmed) {
|
|
66
|
-
return [];
|
|
67
|
-
}
|
|
68
|
-
return StringArraySchema.parse(JSON.parse(trimmed), {
|
|
69
|
-
error: () => `${label} must be a JSON string array.`,
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export function parseStringRecord(
|
|
74
|
-
input: string,
|
|
75
|
-
label: string,
|
|
76
|
-
): Record<string, string> | undefined {
|
|
77
|
-
const trimmed = input.trim();
|
|
78
|
-
if (!trimmed) {
|
|
79
|
-
return undefined;
|
|
80
|
-
}
|
|
81
|
-
return StringRecordSchema.parse(JSON.parse(trimmed), {
|
|
82
|
-
error: () => `${label} must be a JSON object with string values.`,
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export function parseNumber(
|
|
87
|
-
input: string,
|
|
88
|
-
label: string,
|
|
89
|
-
options: { min?: number; max?: number; integer?: boolean } = {},
|
|
90
|
-
): number {
|
|
91
|
-
const value = Number(input.trim());
|
|
92
|
-
if (!Number.isFinite(value)) {
|
|
93
|
-
throw new Error(`${label} must be a number.`);
|
|
94
|
-
}
|
|
95
|
-
if (options.integer && !Number.isInteger(value)) {
|
|
96
|
-
throw new Error(`${label} must be an integer.`);
|
|
97
|
-
}
|
|
98
|
-
if (options.min !== undefined && value < options.min) {
|
|
99
|
-
throw new Error(`${label} must be >= ${options.min}.`);
|
|
100
|
-
}
|
|
101
|
-
if (options.max !== undefined && value > options.max) {
|
|
102
|
-
throw new Error(`${label} must be <= ${options.max}.`);
|
|
103
|
-
}
|
|
104
|
-
return value;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export function normalizeOptional(input: string): string | undefined {
|
|
108
|
-
const trimmed = input.trim();
|
|
109
|
-
return trimmed ? trimmed : undefined;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export function transportSummary(transport: McpTransport): string {
|
|
113
|
-
switch (transport.type) {
|
|
114
|
-
case "stdio":
|
|
115
|
-
return `${transport.type} • ${transport.command}`;
|
|
116
|
-
case "streamable-http":
|
|
117
|
-
case "sse":
|
|
118
|
-
return `${transport.type} • ${transport.url}`;
|
|
119
|
-
default:
|
|
120
|
-
return String(transport);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export function noticeColor(kind: Notice["kind"]): string {
|
|
125
|
-
switch (kind) {
|
|
126
|
-
case "success":
|
|
127
|
-
return "green";
|
|
128
|
-
case "error":
|
|
129
|
-
return "red";
|
|
130
|
-
case "info":
|
|
131
|
-
default:
|
|
132
|
-
return "cyan";
|
|
133
|
-
}
|
|
134
|
-
}
|
package/src/core/agent/index.ts
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { Agent, BeforeInvocationEvent } from "@strands-agents/sdk";
|
|
2
|
-
import type { Tool } from "@strands-agents/sdk";
|
|
3
|
-
import type { Config } from "../config.ts";
|
|
4
|
-
import { modelProviders } from "../models";
|
|
5
|
-
import {
|
|
6
|
-
createMcpTools,
|
|
7
|
-
type Config as McpConfig,
|
|
8
|
-
type Manager as McpManager,
|
|
9
|
-
} from "../mcp";
|
|
10
|
-
import type { System as SystemPrompt } from "../prompts";
|
|
11
|
-
import { skills as createSkillsPrompt } from "../prompts";
|
|
12
|
-
import {
|
|
13
|
-
createShortTermMemory,
|
|
14
|
-
createLongTermMemoryStore,
|
|
15
|
-
createLongTermMemoryTools,
|
|
16
|
-
} from "../memory";
|
|
17
|
-
import { createSkillsTools, type Registry } from "../skills";
|
|
18
|
-
import {
|
|
19
|
-
createRunAgentsTools,
|
|
20
|
-
loadBuiltInAgentDefinitions,
|
|
21
|
-
} from "../agents/index.ts";
|
|
22
|
-
import {
|
|
23
|
-
createTodoTools,
|
|
24
|
-
createFetchTools,
|
|
25
|
-
createFilesystemTools,
|
|
26
|
-
createSleepTools,
|
|
27
|
-
createShellTools,
|
|
28
|
-
createThinkingTools,
|
|
29
|
-
createTimeTools,
|
|
30
|
-
createWikiTools,
|
|
31
|
-
createWebSearchTools,
|
|
32
|
-
} from "../tools";
|
|
33
|
-
import { clearTodoState } from "../state/todos.ts";
|
|
34
|
-
|
|
35
|
-
const SECTION_BREAK = "\n\n---\n\n";
|
|
36
|
-
|
|
37
|
-
export async function create(
|
|
38
|
-
config: Config,
|
|
39
|
-
system: SystemPrompt,
|
|
40
|
-
registry: Registry,
|
|
41
|
-
mcp: { config: McpConfig; manager: McpManager },
|
|
42
|
-
print: boolean = false,
|
|
43
|
-
meta: {
|
|
44
|
-
userId?: string;
|
|
45
|
-
sessionId?: string;
|
|
46
|
-
systemPrompt?: string;
|
|
47
|
-
},
|
|
48
|
-
): Promise<Agent> {
|
|
49
|
-
const sessionId = meta.sessionId;
|
|
50
|
-
const userId = meta.userId ?? sessionId;
|
|
51
|
-
const llm = await modelProviders[config.llm.provider]!();
|
|
52
|
-
const stm = createShortTermMemory(sessionId);
|
|
53
|
-
const ltm = config.tools.ltm.enabled
|
|
54
|
-
? createLongTermMemoryStore(config)
|
|
55
|
-
: null;
|
|
56
|
-
const skills = (await createSkillsPrompt(registry)).content;
|
|
57
|
-
const prefixed = await mcp.manager.listPrefixedTools();
|
|
58
|
-
const append = await mcp.manager.listServerInstructions();
|
|
59
|
-
const prompt = [system.content, meta.systemPrompt, ...append, skills]
|
|
60
|
-
.filter((x) => !!x)
|
|
61
|
-
.join(SECTION_BREAK);
|
|
62
|
-
const model = llm.create(config.llm.model, config.llm.params);
|
|
63
|
-
const tools: Tool[] = [
|
|
64
|
-
...createTimeTools(),
|
|
65
|
-
...(config.tools.sleep.enabled ? createSleepTools() : []),
|
|
66
|
-
...(config.tools.todo.enabled ? createTodoTools() : []),
|
|
67
|
-
...(config.tools.fetch.enabled ? createFetchTools() : []),
|
|
68
|
-
...(ltm ? createLongTermMemoryTools(ltm) : []),
|
|
69
|
-
...(config.tools.filesystem.enabled ? createFilesystemTools() : []),
|
|
70
|
-
...(config.tools.shell.enabled ? createShellTools() : []),
|
|
71
|
-
...(config.search.enabled ? createWebSearchTools(config) : []),
|
|
72
|
-
...(config.tools.wiki.enabled ? createWikiTools(config) : []),
|
|
73
|
-
...(config.tools.mcp.enabled ? createMcpTools(mcp.config) : []),
|
|
74
|
-
...(config.tools.skills.enabled ? createSkillsTools(registry) : []),
|
|
75
|
-
...createThinkingTools(),
|
|
76
|
-
...prefixed,
|
|
77
|
-
];
|
|
78
|
-
if (config.tools.agents.enabled) {
|
|
79
|
-
const definitions = loadBuiltInAgentDefinitions(config, {
|
|
80
|
-
knownTools: tools.map((entry) => entry.name),
|
|
81
|
-
});
|
|
82
|
-
tools.push(
|
|
83
|
-
...createRunAgentsTools({
|
|
84
|
-
parent: config.name,
|
|
85
|
-
definitions,
|
|
86
|
-
tools,
|
|
87
|
-
createModel: () => llm.create(config.llm.model, config.llm.params),
|
|
88
|
-
defaultConcurrency: config.tools.agents.concurrency,
|
|
89
|
-
}),
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
const agent = new Agent({
|
|
93
|
-
name: config.name,
|
|
94
|
-
systemPrompt: prompt,
|
|
95
|
-
model,
|
|
96
|
-
appState: {
|
|
97
|
-
...(userId ? { userId } : {}),
|
|
98
|
-
...(sessionId ? { sessionId } : {}),
|
|
99
|
-
},
|
|
100
|
-
tools,
|
|
101
|
-
printer: print,
|
|
102
|
-
...stm,
|
|
103
|
-
});
|
|
104
|
-
agent.addHook(BeforeInvocationEvent, async (event) => {
|
|
105
|
-
clearTodoState(event.agent);
|
|
106
|
-
});
|
|
107
|
-
return agent;
|
|
108
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
export const BUILTIN_AGENT_KINDS = ["research", "plan"] as const;
|
|
2
|
-
|
|
3
|
-
export type AgentKind = (typeof BUILTIN_AGENT_KINDS)[number];
|
|
4
|
-
|
|
5
|
-
export type AgentConfig = {
|
|
6
|
-
id: AgentKind;
|
|
7
|
-
instructions: string;
|
|
8
|
-
description: string;
|
|
9
|
-
tools: readonly string[];
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export type AgentDefinition = AgentConfig & {
|
|
13
|
-
instructionsText: string;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const BUILTIN_AGENT_CONFIGS: readonly AgentConfig[] = [
|
|
17
|
-
{
|
|
18
|
-
id: "research",
|
|
19
|
-
instructions: "research.md",
|
|
20
|
-
description: "Investigates sources and context before the parent acts.",
|
|
21
|
-
tools: [
|
|
22
|
-
"read_file",
|
|
23
|
-
"read_multiple_files",
|
|
24
|
-
"list_directory",
|
|
25
|
-
"directory_tree",
|
|
26
|
-
"search_files",
|
|
27
|
-
"get_file_info",
|
|
28
|
-
"fetch",
|
|
29
|
-
"web_search",
|
|
30
|
-
"think",
|
|
31
|
-
],
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
id: "plan",
|
|
35
|
-
instructions: "plan.md",
|
|
36
|
-
description: "Produces plans, tradeoffs, risks, and validation steps.",
|
|
37
|
-
tools: [
|
|
38
|
-
"read_file",
|
|
39
|
-
"read_multiple_files",
|
|
40
|
-
"list_directory",
|
|
41
|
-
"directory_tree",
|
|
42
|
-
"search_files",
|
|
43
|
-
"get_file_info",
|
|
44
|
-
"web_search",
|
|
45
|
-
"think",
|
|
46
|
-
],
|
|
47
|
-
},
|
|
48
|
-
];
|