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/core/config.ts
DELETED
|
@@ -1,377 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
/** LLM backend; extend as you add providers. */
|
|
5
|
-
export enum LlmProvider {
|
|
6
|
-
Anthropic = "anthropic",
|
|
7
|
-
Google = "google",
|
|
8
|
-
Groq = "groq",
|
|
9
|
-
Moonshot = "moonshot",
|
|
10
|
-
OpenAI = "openai",
|
|
11
|
-
Ollama = "ollama",
|
|
12
|
-
Bedrock = "bedrock",
|
|
13
|
-
Xai = "xai",
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const LlmSchema = z.object({
|
|
17
|
-
provider: z.nativeEnum(LlmProvider),
|
|
18
|
-
model: z.string().min(1),
|
|
19
|
-
params: z.record(z.string(), z.any()).default({}),
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
/** Partial compaction overrides from JSON; missing fields use defaults below. */
|
|
23
|
-
const CompactionPartialSchema = z.object({
|
|
24
|
-
/** Fraction of context to target after compaction (e.g. 0.75 = keep ~75% budget). */
|
|
25
|
-
ratio: z.number().min(0).max(1).optional(),
|
|
26
|
-
/** Minimum number of recent turns / message groups to preserve verbatim when compacting. */
|
|
27
|
-
keep: z.number().int().nonnegative().optional(),
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
const DEFAULT_COMPACTION = { ratio: 0.75, keep: 5 } as const;
|
|
31
|
-
|
|
32
|
-
const DEFAULT_PROMPTS = {
|
|
33
|
-
behaviour: true,
|
|
34
|
-
communication: true,
|
|
35
|
-
execution: true,
|
|
36
|
-
engineering: true,
|
|
37
|
-
guardrails: true,
|
|
38
|
-
} as const;
|
|
39
|
-
|
|
40
|
-
const DEFAULT_CHROMA = {
|
|
41
|
-
url: "http://127.0.0.1:8000",
|
|
42
|
-
collection: { memory: "memory" },
|
|
43
|
-
} as const;
|
|
44
|
-
|
|
45
|
-
const DEFAULT_WIKI_CHROMA = {
|
|
46
|
-
url: "http://127.0.0.1:8000",
|
|
47
|
-
collection: { wiki: "wiki" },
|
|
48
|
-
} as const;
|
|
49
|
-
|
|
50
|
-
const LtmChromaPartialSchema = z.object({
|
|
51
|
-
url: z.string().min(1).optional(),
|
|
52
|
-
collection: z
|
|
53
|
-
.object({
|
|
54
|
-
memory: z.string().min(1).optional(),
|
|
55
|
-
})
|
|
56
|
-
.optional(),
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
const LtmPartialSchema = z.object({
|
|
60
|
-
enabled: z.boolean().optional(),
|
|
61
|
-
chroma: LtmChromaPartialSchema.optional(),
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
const WikiChromaPartialSchema = z.object({
|
|
65
|
-
url: z.string().min(1).optional(),
|
|
66
|
-
collection: z
|
|
67
|
-
.object({
|
|
68
|
-
wiki: z.string().min(1).optional(),
|
|
69
|
-
})
|
|
70
|
-
.optional(),
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
const WikiPartialSchema = z.object({
|
|
74
|
-
enabled: z.boolean().optional(),
|
|
75
|
-
chroma: WikiChromaPartialSchema.optional(),
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
const ToolTogglePartialSchema = z.object({
|
|
79
|
-
enabled: z.boolean().optional(),
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
const PromptsPartialSchema = z.object({
|
|
83
|
-
behaviour: z.boolean().optional(),
|
|
84
|
-
communication: z.boolean().optional(),
|
|
85
|
-
execution: z.boolean().optional(),
|
|
86
|
-
engineering: z.boolean().optional(),
|
|
87
|
-
guardrails: z.boolean().optional(),
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
const AgentsPartialSchema = z.object({
|
|
91
|
-
enabled: z.boolean().optional(),
|
|
92
|
-
concurrency: z.number().int().min(1).optional(),
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
const SearchProviderSchema = z.enum(["brave", "tavily"]);
|
|
96
|
-
|
|
97
|
-
const SearchPartialSchema = z.object({
|
|
98
|
-
enabled: z.boolean().optional(),
|
|
99
|
-
provider: SearchProviderSchema.optional(),
|
|
100
|
-
brave: z
|
|
101
|
-
.object({
|
|
102
|
-
apiKey: z.string().min(1).optional(),
|
|
103
|
-
})
|
|
104
|
-
.optional(),
|
|
105
|
-
tavily: z
|
|
106
|
-
.object({
|
|
107
|
-
apiKey: z.string().min(1).optional(),
|
|
108
|
-
})
|
|
109
|
-
.optional(),
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
const ToolsPartialSchema = z.object({
|
|
113
|
-
todo: ToolTogglePartialSchema.optional(),
|
|
114
|
-
fetch: ToolTogglePartialSchema.optional(),
|
|
115
|
-
filesystem: ToolTogglePartialSchema.optional(),
|
|
116
|
-
shell: ToolTogglePartialSchema.optional(),
|
|
117
|
-
sleep: ToolTogglePartialSchema.optional(),
|
|
118
|
-
ltm: LtmPartialSchema.optional(),
|
|
119
|
-
wiki: WikiPartialSchema.optional(),
|
|
120
|
-
mcp: ToolTogglePartialSchema.optional(),
|
|
121
|
-
skills: ToolTogglePartialSchema.optional(),
|
|
122
|
-
agents: AgentsPartialSchema.optional(),
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
const ConfigSchema = z
|
|
126
|
-
.object({
|
|
127
|
-
name: z.string().min(1),
|
|
128
|
-
llm: LlmSchema,
|
|
129
|
-
search: SearchPartialSchema.nullish(),
|
|
130
|
-
prompts: PromptsPartialSchema.nullish(),
|
|
131
|
-
tools: ToolsPartialSchema.nullish(),
|
|
132
|
-
compaction: CompactionPartialSchema.nullish().transform((c) => ({
|
|
133
|
-
ratio: c?.ratio ?? DEFAULT_COMPACTION.ratio,
|
|
134
|
-
keep: c?.keep ?? DEFAULT_COMPACTION.keep,
|
|
135
|
-
})),
|
|
136
|
-
})
|
|
137
|
-
.transform((input) => {
|
|
138
|
-
const ltm = input.tools?.ltm;
|
|
139
|
-
const wiki = input.tools?.wiki;
|
|
140
|
-
return {
|
|
141
|
-
name: input.name,
|
|
142
|
-
llm: input.llm,
|
|
143
|
-
search: {
|
|
144
|
-
enabled: input.search?.enabled ?? false,
|
|
145
|
-
provider: input.search?.provider ?? "brave",
|
|
146
|
-
brave: {
|
|
147
|
-
apiKey: input.search?.brave?.apiKey,
|
|
148
|
-
},
|
|
149
|
-
tavily: {
|
|
150
|
-
apiKey: input.search?.tavily?.apiKey,
|
|
151
|
-
},
|
|
152
|
-
},
|
|
153
|
-
prompts: {
|
|
154
|
-
behaviour: input.prompts?.behaviour ?? DEFAULT_PROMPTS.behaviour,
|
|
155
|
-
communication:
|
|
156
|
-
input.prompts?.communication ?? DEFAULT_PROMPTS.communication,
|
|
157
|
-
execution: input.prompts?.execution ?? DEFAULT_PROMPTS.execution,
|
|
158
|
-
engineering: input.prompts?.engineering ?? DEFAULT_PROMPTS.engineering,
|
|
159
|
-
guardrails: input.prompts?.guardrails ?? DEFAULT_PROMPTS.guardrails,
|
|
160
|
-
},
|
|
161
|
-
tools: {
|
|
162
|
-
todo: {
|
|
163
|
-
enabled: input.tools?.todo?.enabled ?? true,
|
|
164
|
-
},
|
|
165
|
-
fetch: {
|
|
166
|
-
enabled: input.tools?.fetch?.enabled ?? true,
|
|
167
|
-
},
|
|
168
|
-
filesystem: {
|
|
169
|
-
enabled: input.tools?.filesystem?.enabled ?? true,
|
|
170
|
-
},
|
|
171
|
-
shell: {
|
|
172
|
-
enabled: input.tools?.shell?.enabled ?? true,
|
|
173
|
-
},
|
|
174
|
-
sleep: {
|
|
175
|
-
enabled: input.tools?.sleep?.enabled ?? true,
|
|
176
|
-
},
|
|
177
|
-
ltm: {
|
|
178
|
-
enabled: ltm?.enabled ?? false,
|
|
179
|
-
chroma: {
|
|
180
|
-
url: ltm?.chroma?.url ?? DEFAULT_CHROMA.url,
|
|
181
|
-
collection: {
|
|
182
|
-
memory:
|
|
183
|
-
ltm?.chroma?.collection?.memory ??
|
|
184
|
-
DEFAULT_CHROMA.collection.memory,
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
wiki: {
|
|
189
|
-
enabled: wiki?.enabled ?? false,
|
|
190
|
-
chroma: {
|
|
191
|
-
url: wiki?.chroma?.url ?? DEFAULT_WIKI_CHROMA.url,
|
|
192
|
-
collection: {
|
|
193
|
-
wiki:
|
|
194
|
-
wiki?.chroma?.collection?.wiki ??
|
|
195
|
-
DEFAULT_WIKI_CHROMA.collection.wiki,
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
},
|
|
199
|
-
mcp: {
|
|
200
|
-
enabled: input.tools?.mcp?.enabled ?? false,
|
|
201
|
-
},
|
|
202
|
-
skills: {
|
|
203
|
-
enabled: input.tools?.skills?.enabled ?? false,
|
|
204
|
-
},
|
|
205
|
-
agents: {
|
|
206
|
-
enabled: input.tools?.agents?.enabled ?? true,
|
|
207
|
-
concurrency: input.tools?.agents?.concurrency ?? 3,
|
|
208
|
-
},
|
|
209
|
-
},
|
|
210
|
-
compaction: input.compaction,
|
|
211
|
-
};
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
export type ConfigData = z.infer<typeof ConfigSchema>;
|
|
215
|
-
export type LlmConfig = z.infer<typeof LlmSchema>;
|
|
216
|
-
export type CompactionConfig = ConfigData["compaction"];
|
|
217
|
-
export type PromptsConfig = ConfigData["prompts"];
|
|
218
|
-
export type LtmConfig = ConfigData["tools"]["ltm"];
|
|
219
|
-
export type WikiConfig = ConfigData["tools"]["wiki"];
|
|
220
|
-
export type SearchConfig = ConfigData["search"];
|
|
221
|
-
export type ToolsConfig = ConfigData["tools"];
|
|
222
|
-
|
|
223
|
-
const defaultConfigData = (): ConfigData => ({
|
|
224
|
-
name: "Hooman",
|
|
225
|
-
llm: {
|
|
226
|
-
provider: LlmProvider.Ollama,
|
|
227
|
-
model: "gemma4:e4b",
|
|
228
|
-
params: {},
|
|
229
|
-
},
|
|
230
|
-
search: {
|
|
231
|
-
enabled: false,
|
|
232
|
-
provider: "brave",
|
|
233
|
-
brave: { apiKey: undefined },
|
|
234
|
-
tavily: { apiKey: undefined },
|
|
235
|
-
},
|
|
236
|
-
prompts: { ...DEFAULT_PROMPTS },
|
|
237
|
-
tools: {
|
|
238
|
-
todo: {
|
|
239
|
-
enabled: true,
|
|
240
|
-
},
|
|
241
|
-
fetch: {
|
|
242
|
-
enabled: true,
|
|
243
|
-
},
|
|
244
|
-
filesystem: {
|
|
245
|
-
enabled: true,
|
|
246
|
-
},
|
|
247
|
-
shell: {
|
|
248
|
-
enabled: true,
|
|
249
|
-
},
|
|
250
|
-
sleep: {
|
|
251
|
-
enabled: true,
|
|
252
|
-
},
|
|
253
|
-
ltm: {
|
|
254
|
-
enabled: false,
|
|
255
|
-
chroma: {
|
|
256
|
-
url: "http://127.0.0.1:8000",
|
|
257
|
-
collection: { memory: "memory" },
|
|
258
|
-
},
|
|
259
|
-
},
|
|
260
|
-
wiki: {
|
|
261
|
-
enabled: false,
|
|
262
|
-
chroma: {
|
|
263
|
-
url: "http://127.0.0.1:8000",
|
|
264
|
-
collection: { wiki: "wiki" },
|
|
265
|
-
},
|
|
266
|
-
},
|
|
267
|
-
mcp: {
|
|
268
|
-
enabled: false,
|
|
269
|
-
},
|
|
270
|
-
skills: {
|
|
271
|
-
enabled: false,
|
|
272
|
-
},
|
|
273
|
-
agents: {
|
|
274
|
-
enabled: true,
|
|
275
|
-
concurrency: 2,
|
|
276
|
-
},
|
|
277
|
-
},
|
|
278
|
-
compaction: {
|
|
279
|
-
ratio: 0.75,
|
|
280
|
-
keep: 5,
|
|
281
|
-
},
|
|
282
|
-
});
|
|
283
|
-
|
|
284
|
-
export class Config {
|
|
285
|
-
private data!: ConfigData;
|
|
286
|
-
private readonly path: string;
|
|
287
|
-
|
|
288
|
-
public constructor(path: string) {
|
|
289
|
-
this.path = path;
|
|
290
|
-
this.reload();
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
get name(): string {
|
|
294
|
-
return this.data.name;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
get llm(): LlmConfig {
|
|
298
|
-
return this.data.llm;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
get search(): SearchConfig {
|
|
302
|
-
return {
|
|
303
|
-
...this.data.search,
|
|
304
|
-
brave: { ...this.data.search.brave },
|
|
305
|
-
tavily: { ...this.data.search.tavily },
|
|
306
|
-
};
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
get prompts(): PromptsConfig {
|
|
310
|
-
return { ...this.data.prompts };
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
get tools(): ToolsConfig {
|
|
314
|
-
return {
|
|
315
|
-
...this.data.tools,
|
|
316
|
-
todo: { ...this.data.tools.todo },
|
|
317
|
-
fetch: { ...this.data.tools.fetch },
|
|
318
|
-
filesystem: { ...this.data.tools.filesystem },
|
|
319
|
-
shell: { ...this.data.tools.shell },
|
|
320
|
-
sleep: { ...this.data.tools.sleep },
|
|
321
|
-
ltm: {
|
|
322
|
-
...this.data.tools.ltm,
|
|
323
|
-
chroma: {
|
|
324
|
-
...this.data.tools.ltm.chroma,
|
|
325
|
-
collection: { ...this.data.tools.ltm.chroma.collection },
|
|
326
|
-
},
|
|
327
|
-
},
|
|
328
|
-
wiki: {
|
|
329
|
-
...this.data.tools.wiki,
|
|
330
|
-
chroma: {
|
|
331
|
-
...this.data.tools.wiki.chroma,
|
|
332
|
-
collection: { ...this.data.tools.wiki.chroma.collection },
|
|
333
|
-
},
|
|
334
|
-
},
|
|
335
|
-
mcp: { ...this.data.tools.mcp },
|
|
336
|
-
skills: { ...this.data.tools.skills },
|
|
337
|
-
agents: { ...this.data.tools.agents },
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
get compaction(): CompactionConfig {
|
|
342
|
-
return this.data.compaction;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
get ltm(): LtmConfig {
|
|
346
|
-
return this.tools.ltm;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
get wiki(): WikiConfig {
|
|
350
|
-
return this.tools.wiki;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
private readJson(): unknown {
|
|
354
|
-
if (!existsSync(this.path)) {
|
|
355
|
-
return defaultConfigData();
|
|
356
|
-
}
|
|
357
|
-
return JSON.parse(readFileSync(this.path, "utf8"));
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
public reload(): void {
|
|
361
|
-
const wasMissing = !existsSync(this.path);
|
|
362
|
-
this.data = ConfigSchema.parse(this.readJson());
|
|
363
|
-
if (wasMissing) {
|
|
364
|
-
this.persist();
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
public persist(): void {
|
|
369
|
-
writeFileSync(this.path, JSON.stringify(this.data, null, 2), "utf8");
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
public update(partial: Partial<ConfigData>): void {
|
|
373
|
-
const updated = { ...this.data, ...partial };
|
|
374
|
-
this.data = ConfigSchema.parse(updated);
|
|
375
|
-
this.persist();
|
|
376
|
-
}
|
|
377
|
-
}
|
package/src/core/index.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { Agent } from "@strands-agents/sdk";
|
|
2
|
-
import { Config } from "./config.ts";
|
|
3
|
-
import { create as createAgent } from "./agent/index.ts";
|
|
4
|
-
import {
|
|
5
|
-
createMcpConfig,
|
|
6
|
-
createMcpManager,
|
|
7
|
-
type Config as McpServersConfig,
|
|
8
|
-
type Manager as McpConnectionManager,
|
|
9
|
-
type NamedMcpTransport,
|
|
10
|
-
} from "./mcp/index.ts";
|
|
11
|
-
import { createSkillsRegistry } from "./skills/index.ts";
|
|
12
|
-
import type { Registry } from "./skills/index.ts";
|
|
13
|
-
import { system as createSystemPrompt } from "./prompts/index.ts";
|
|
14
|
-
import {
|
|
15
|
-
basePath,
|
|
16
|
-
configJsonPath,
|
|
17
|
-
instructionsMdPath,
|
|
18
|
-
mcpJsonPath,
|
|
19
|
-
} from "./utils/paths.ts";
|
|
20
|
-
|
|
21
|
-
export type BootstrapMeta = {
|
|
22
|
-
userId?: string;
|
|
23
|
-
sessionId?: string;
|
|
24
|
-
acp?: AcpMeta;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export type BootstrapMode = "default" | "daemon" | "acp";
|
|
28
|
-
|
|
29
|
-
export type AcpMeta = {
|
|
30
|
-
systemPrompt?: string;
|
|
31
|
-
mcpServers?: NamedMcpTransport[];
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export async function bootstrap(
|
|
35
|
-
mode: BootstrapMode,
|
|
36
|
-
meta: BootstrapMeta,
|
|
37
|
-
print: boolean = false,
|
|
38
|
-
): Promise<{
|
|
39
|
-
config: Config;
|
|
40
|
-
agent: Agent;
|
|
41
|
-
mcp: { config: McpServersConfig; manager: McpConnectionManager };
|
|
42
|
-
registry: Registry;
|
|
43
|
-
}> {
|
|
44
|
-
const config = new Config(configJsonPath());
|
|
45
|
-
const mcpConfig = createMcpConfig(mcpJsonPath());
|
|
46
|
-
const mcpManager = createMcpManager(
|
|
47
|
-
mcpConfig,
|
|
48
|
-
mode === "acp",
|
|
49
|
-
meta.acp?.mcpServers ?? [],
|
|
50
|
-
);
|
|
51
|
-
const mcp = { config: mcpConfig, manager: mcpManager };
|
|
52
|
-
const registry = createSkillsRegistry(basePath());
|
|
53
|
-
const system = await createSystemPrompt(instructionsMdPath(), config, mode);
|
|
54
|
-
const agent = await createAgent(config, system, registry, mcp, print, {
|
|
55
|
-
userId: meta?.userId ?? meta?.sessionId,
|
|
56
|
-
sessionId: meta?.sessionId,
|
|
57
|
-
systemPrompt: meta?.acp?.systemPrompt,
|
|
58
|
-
});
|
|
59
|
-
return { config, agent, mcp, registry };
|
|
60
|
-
}
|
package/src/core/mcp/config.ts
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { McpTransportSchema, type McpTransport } from "./types.ts";
|
|
4
|
-
|
|
5
|
-
const McpServersFileSchema = z.object({
|
|
6
|
-
mcpServers: z.record(z.string().min(1), McpTransportSchema).default({}),
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
export type McpServersFile = z.infer<typeof McpServersFileSchema>;
|
|
10
|
-
|
|
11
|
-
/** One named MCP transport from the config file. */
|
|
12
|
-
export type NamedMcpTransport = { name: string; transport: McpTransport };
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Read/write `{"mcpServers": { "<name>": <transport> }}` on disk.
|
|
16
|
-
*/
|
|
17
|
-
export class Config {
|
|
18
|
-
private readonly path: string;
|
|
19
|
-
private servers: Record<string, McpTransport>;
|
|
20
|
-
|
|
21
|
-
public constructor(path: string) {
|
|
22
|
-
this.path = path;
|
|
23
|
-
this.servers = {};
|
|
24
|
-
this.reload();
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
private readJson(): McpServersFile {
|
|
28
|
-
if (!existsSync(this.path)) {
|
|
29
|
-
return { mcpServers: {} };
|
|
30
|
-
}
|
|
31
|
-
const raw = readFileSync(this.path, "utf8");
|
|
32
|
-
return JSON.parse(raw) as McpServersFile;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/** Reload servers from disk (overwrites unsaved in-memory changes). */
|
|
36
|
-
public reload(): void {
|
|
37
|
-
const parsed = McpServersFileSchema.parse(this.readJson());
|
|
38
|
-
this.servers = { ...parsed.mcpServers };
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
private persist(): void {
|
|
42
|
-
const payload: McpServersFile = { mcpServers: { ...this.servers } };
|
|
43
|
-
writeFileSync(this.path, JSON.stringify(payload, null, 2), "utf8");
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/** All configured servers, stable sort by name. */
|
|
47
|
-
public list(): NamedMcpTransport[] {
|
|
48
|
-
return Object.entries(this.servers)
|
|
49
|
-
.sort(([a], [b]) => a.localeCompare(b))
|
|
50
|
-
.map(([name, transport]) => ({ name, transport }));
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
public get(name: string): McpTransport | undefined {
|
|
54
|
-
return this.servers[name];
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
public add(name: string, transport: McpTransport): void {
|
|
58
|
-
if (Object.hasOwn(this.servers, name)) {
|
|
59
|
-
throw new Error(`MCP server "${name}" already exists`);
|
|
60
|
-
}
|
|
61
|
-
this.servers[name] = transport;
|
|
62
|
-
this.persist();
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
public update(name: string, transport: McpTransport): void {
|
|
66
|
-
if (!Object.hasOwn(this.servers, name)) {
|
|
67
|
-
throw new Error(`MCP server "${name}" not found`);
|
|
68
|
-
}
|
|
69
|
-
this.servers[name] = transport;
|
|
70
|
-
this.persist();
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
public remove(name: string): void {
|
|
74
|
-
if (!Object.hasOwn(this.servers, name)) {
|
|
75
|
-
throw new Error(`MCP server "${name}" not found`);
|
|
76
|
-
}
|
|
77
|
-
delete this.servers[name];
|
|
78
|
-
this.persist();
|
|
79
|
-
}
|
|
80
|
-
}
|
package/src/core/mcp/index.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Config, type NamedMcpTransport } from "./config.ts";
|
|
2
|
-
import {
|
|
3
|
-
Manager,
|
|
4
|
-
HOOMAN_CHANNEL,
|
|
5
|
-
HOOMAN_CHANNEL_PERMISSION,
|
|
6
|
-
type ChannelMessage,
|
|
7
|
-
type ChannelPermissionBehavior,
|
|
8
|
-
type ChannelSubscription,
|
|
9
|
-
type ChannelSubscriptionHandle,
|
|
10
|
-
} from "./manager.ts";
|
|
11
|
-
|
|
12
|
-
export { Config, Manager };
|
|
13
|
-
export { HOOMAN_CHANNEL, HOOMAN_CHANNEL_PERMISSION };
|
|
14
|
-
export type {
|
|
15
|
-
ChannelMessage,
|
|
16
|
-
ChannelPermissionBehavior,
|
|
17
|
-
ChannelSubscription,
|
|
18
|
-
ChannelSubscriptionHandle,
|
|
19
|
-
NamedMcpTransport,
|
|
20
|
-
};
|
|
21
|
-
export { createMcpTools } from "./tools.ts";
|
|
22
|
-
|
|
23
|
-
export function createMcpConfig(path: string): Config {
|
|
24
|
-
return new Config(path);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function createMcpManager(
|
|
28
|
-
config: Config,
|
|
29
|
-
acp = false,
|
|
30
|
-
mcpServers: readonly NamedMcpTransport[] = [],
|
|
31
|
-
): Manager {
|
|
32
|
-
return new Manager(config, acp, mcpServers);
|
|
33
|
-
}
|