orquesta-cli 0.1.13 → 0.1.15
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 +30 -4
- package/dist/cli.js +65 -4
- package/dist/core/config/config-manager.d.ts +13 -1
- package/dist/core/config/config-manager.js +83 -0
- package/dist/core/slash-command-handler.d.ts +1 -0
- package/dist/core/slash-command-handler.js +129 -0
- package/dist/orquesta/config-sync.d.ts +73 -0
- package/dist/orquesta/config-sync.js +230 -0
- package/dist/orquesta/prompt-reporter.d.ts +16 -0
- package/dist/orquesta/prompt-reporter.js +85 -0
- package/dist/setup/first-run-setup.d.ts +15 -0
- package/dist/setup/first-run-setup.js +238 -0
- package/dist/types/index.d.ts +11 -2
- package/dist/ui/TodoPanel.d.ts +1 -0
- package/dist/ui/TodoPanel.js +6 -1
- package/dist/ui/components/LLMSetupWizard.js +381 -7
- package/dist/ui/components/Logo.d.ts +2 -0
- package/dist/ui/components/Logo.js +10 -3
- package/dist/ui/components/OpenRouterModelBrowser.d.ts +13 -0
- package/dist/ui/components/OpenRouterModelBrowser.js +221 -0
- package/dist/ui/components/PlanExecuteApp.js +30 -4
- package/dist/ui/components/ProjectSelector.d.ts +8 -0
- package/dist/ui/components/ProjectSelector.js +119 -0
- package/dist/ui/components/StatusBar.d.ts +2 -0
- package/dist/ui/components/StatusBar.js +6 -1
- package/dist/ui/hooks/slashCommandProcessor.js +8 -4
- package/package.json +11 -5
- package/.eslintrc.json +0 -26
- package/.prettierrc.json +0 -10
- package/CLAUDE.md +0 -199
- package/SECURITY.md +0 -290
- package/TEST_LOCAL.md +0 -245
- package/dist/agents/base/base-agent.d.ts.map +0 -1
- package/dist/agents/base/base-agent.js.map +0 -1
- package/dist/agents/docs-search/index.d.ts.map +0 -1
- package/dist/agents/docs-search/index.js.map +0 -1
- package/dist/agents/index.d.ts.map +0 -1
- package/dist/agents/index.js.map +0 -1
- package/dist/agents/planner/index.d.ts.map +0 -1
- package/dist/agents/planner/index.js.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js.map +0 -1
- package/dist/core/compact/compact-manager.d.ts.map +0 -1
- package/dist/core/compact/compact-manager.js.map +0 -1
- package/dist/core/compact/compact-prompts.d.ts.map +0 -1
- package/dist/core/compact/compact-prompts.js.map +0 -1
- package/dist/core/compact/context-tracker.d.ts.map +0 -1
- package/dist/core/compact/context-tracker.js.map +0 -1
- package/dist/core/compact/index.d.ts.map +0 -1
- package/dist/core/compact/index.js.map +0 -1
- package/dist/core/config/config-manager.d.ts.map +0 -1
- package/dist/core/config/config-manager.js.map +0 -1
- package/dist/core/config/index.d.ts.map +0 -1
- package/dist/core/config/index.js.map +0 -1
- package/dist/core/docs-manager.d.ts.map +0 -1
- package/dist/core/docs-manager.js.map +0 -1
- package/dist/core/git-auto-updater.d.ts +0 -58
- package/dist/core/git-auto-updater.d.ts.map +0 -1
- package/dist/core/git-auto-updater.js +0 -374
- package/dist/core/git-auto-updater.js.map +0 -1
- package/dist/core/llm/index.d.ts.map +0 -1
- package/dist/core/llm/index.js.map +0 -1
- package/dist/core/llm/llm-client.d.ts.map +0 -1
- package/dist/core/llm/llm-client.js.map +0 -1
- package/dist/core/session/index.d.ts.map +0 -1
- package/dist/core/session/index.js.map +0 -1
- package/dist/core/session/session-manager.d.ts.map +0 -1
- package/dist/core/session/session-manager.js.map +0 -1
- package/dist/core/slash-command-handler.d.ts.map +0 -1
- package/dist/core/slash-command-handler.js.map +0 -1
- package/dist/core/usage-tracker.d.ts.map +0 -1
- package/dist/core/usage-tracker.js.map +0 -1
- package/dist/errors/base.d.ts.map +0 -1
- package/dist/errors/base.js.map +0 -1
- package/dist/errors/file.d.ts.map +0 -1
- package/dist/errors/file.js.map +0 -1
- package/dist/errors/index.d.ts.map +0 -1
- package/dist/errors/index.js.map +0 -1
- package/dist/errors/llm.d.ts.map +0 -1
- package/dist/errors/llm.js.map +0 -1
- package/dist/errors/network.d.ts.map +0 -1
- package/dist/errors/network.js.map +0 -1
- package/dist/errors/validation.d.ts.map +0 -1
- package/dist/errors/validation.js.map +0 -1
- package/dist/eval/eval-runner.d.ts.map +0 -1
- package/dist/eval/eval-runner.js.map +0 -1
- package/dist/eval/index.d.ts.map +0 -1
- package/dist/eval/index.js.map +0 -1
- package/dist/eval/types.d.ts.map +0 -1
- package/dist/eval/types.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/orchestration/index.d.ts.map +0 -1
- package/dist/orchestration/index.js.map +0 -1
- package/dist/orchestration/plan-executor.d.ts.map +0 -1
- package/dist/orchestration/plan-executor.js.map +0 -1
- package/dist/orchestration/types.d.ts.map +0 -1
- package/dist/orchestration/types.js.map +0 -1
- package/dist/orchestration/utils.d.ts.map +0 -1
- package/dist/orchestration/utils.js.map +0 -1
- package/dist/orquesta/connection.d.ts.map +0 -1
- package/dist/orquesta/connection.js.map +0 -1
- package/dist/prompts/agents/docs-search-decision.d.ts.map +0 -1
- package/dist/prompts/agents/docs-search-decision.js.map +0 -1
- package/dist/prompts/agents/docs-search.d.ts.map +0 -1
- package/dist/prompts/agents/docs-search.js.map +0 -1
- package/dist/prompts/agents/planning.d.ts.map +0 -1
- package/dist/prompts/agents/planning.js.map +0 -1
- package/dist/prompts/index.d.ts.map +0 -1
- package/dist/prompts/index.js.map +0 -1
- package/dist/prompts/shared/codebase-rules.d.ts.map +0 -1
- package/dist/prompts/shared/codebase-rules.js.map +0 -1
- package/dist/prompts/shared/git-rules.d.ts.map +0 -1
- package/dist/prompts/shared/git-rules.js.map +0 -1
- package/dist/prompts/shared/language-rules.d.ts.map +0 -1
- package/dist/prompts/shared/language-rules.js.map +0 -1
- package/dist/prompts/shared/tool-usage.d.ts.map +0 -1
- package/dist/prompts/shared/tool-usage.js.map +0 -1
- package/dist/prompts/system/compact.d.ts.map +0 -1
- package/dist/prompts/system/compact.js.map +0 -1
- package/dist/prompts/system/plan-execute.d.ts.map +0 -1
- package/dist/prompts/system/plan-execute.js.map +0 -1
- package/dist/tools/browser/browser-client.d.ts.map +0 -1
- package/dist/tools/browser/browser-client.js.map +0 -1
- package/dist/tools/browser/browser-tools.d.ts.map +0 -1
- package/dist/tools/browser/browser-tools.js.map +0 -1
- package/dist/tools/browser/index.d.ts.map +0 -1
- package/dist/tools/browser/index.js.map +0 -1
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/llm/agents/docs-search-tools.d.ts.map +0 -1
- package/dist/tools/llm/agents/docs-search-tools.js.map +0 -1
- package/dist/tools/llm/agents/index.d.ts.map +0 -1
- package/dist/tools/llm/agents/index.js.map +0 -1
- package/dist/tools/llm/index.d.ts.map +0 -1
- package/dist/tools/llm/index.js.map +0 -1
- package/dist/tools/llm/simple/ask-user-tool.d.ts.map +0 -1
- package/dist/tools/llm/simple/ask-user-tool.js.map +0 -1
- package/dist/tools/llm/simple/background-bash-tool.d.ts.map +0 -1
- package/dist/tools/llm/simple/background-bash-tool.js.map +0 -1
- package/dist/tools/llm/simple/background-powershell-tool.d.ts.map +0 -1
- package/dist/tools/llm/simple/background-powershell-tool.js.map +0 -1
- package/dist/tools/llm/simple/bash-tool.d.ts.map +0 -1
- package/dist/tools/llm/simple/bash-tool.js.map +0 -1
- package/dist/tools/llm/simple/docs-search-agent-tool.d.ts.map +0 -1
- package/dist/tools/llm/simple/docs-search-agent-tool.js.map +0 -1
- package/dist/tools/llm/simple/file-tools.d.ts.map +0 -1
- package/dist/tools/llm/simple/file-tools.js.map +0 -1
- package/dist/tools/llm/simple/final-response-tool.d.ts.map +0 -1
- package/dist/tools/llm/simple/final-response-tool.js.map +0 -1
- package/dist/tools/llm/simple/index.d.ts.map +0 -1
- package/dist/tools/llm/simple/index.js.map +0 -1
- package/dist/tools/llm/simple/planning-tools.d.ts.map +0 -1
- package/dist/tools/llm/simple/planning-tools.js.map +0 -1
- package/dist/tools/llm/simple/powershell-tool.d.ts.map +0 -1
- package/dist/tools/llm/simple/powershell-tool.js.map +0 -1
- package/dist/tools/llm/simple/simple-tool-executor.d.ts.map +0 -1
- package/dist/tools/llm/simple/simple-tool-executor.js.map +0 -1
- package/dist/tools/llm/simple/todo-tools.d.ts.map +0 -1
- package/dist/tools/llm/simple/todo-tools.js.map +0 -1
- package/dist/tools/llm/simple/user-interaction-tools.d.ts.map +0 -1
- package/dist/tools/llm/simple/user-interaction-tools.js.map +0 -1
- package/dist/tools/office/common/constants.d.ts.map +0 -1
- package/dist/tools/office/common/constants.js.map +0 -1
- package/dist/tools/office/common/index.d.ts.map +0 -1
- package/dist/tools/office/common/index.js.map +0 -1
- package/dist/tools/office/common/types.d.ts.map +0 -1
- package/dist/tools/office/common/types.js.map +0 -1
- package/dist/tools/office/common/utils.d.ts.map +0 -1
- package/dist/tools/office/common/utils.js.map +0 -1
- package/dist/tools/office/excel-client.d.ts.map +0 -1
- package/dist/tools/office/excel-client.js.map +0 -1
- package/dist/tools/office/excel-tools/cells.d.ts.map +0 -1
- package/dist/tools/office/excel-tools/cells.js.map +0 -1
- package/dist/tools/office/excel-tools/charts.d.ts.map +0 -1
- package/dist/tools/office/excel-tools/charts.js.map +0 -1
- package/dist/tools/office/excel-tools/comments.d.ts.map +0 -1
- package/dist/tools/office/excel-tools/comments.js.map +0 -1
- package/dist/tools/office/excel-tools/data-ops.d.ts.map +0 -1
- package/dist/tools/office/excel-tools/data-ops.js.map +0 -1
- package/dist/tools/office/excel-tools/export.d.ts.map +0 -1
- package/dist/tools/office/excel-tools/export.js.map +0 -1
- package/dist/tools/office/excel-tools/formatting.d.ts.map +0 -1
- package/dist/tools/office/excel-tools/formatting.js.map +0 -1
- package/dist/tools/office/excel-tools/index.d.ts.map +0 -1
- package/dist/tools/office/excel-tools/index.js.map +0 -1
- package/dist/tools/office/excel-tools/launch.d.ts.map +0 -1
- package/dist/tools/office/excel-tools/launch.js.map +0 -1
- package/dist/tools/office/excel-tools/media.d.ts.map +0 -1
- package/dist/tools/office/excel-tools/media.js.map +0 -1
- package/dist/tools/office/excel-tools/named-ranges.d.ts.map +0 -1
- package/dist/tools/office/excel-tools/named-ranges.js.map +0 -1
- package/dist/tools/office/excel-tools/protection.d.ts.map +0 -1
- package/dist/tools/office/excel-tools/protection.js.map +0 -1
- package/dist/tools/office/excel-tools/rows-columns.d.ts.map +0 -1
- package/dist/tools/office/excel-tools/rows-columns.js.map +0 -1
- package/dist/tools/office/excel-tools/sheets.d.ts.map +0 -1
- package/dist/tools/office/excel-tools/sheets.js.map +0 -1
- package/dist/tools/office/excel-tools/validation.d.ts.map +0 -1
- package/dist/tools/office/excel-tools/validation.js.map +0 -1
- package/dist/tools/office/excel-tools.d.ts.map +0 -1
- package/dist/tools/office/excel-tools.js.map +0 -1
- package/dist/tools/office/index.d.ts.map +0 -1
- package/dist/tools/office/index.js.map +0 -1
- package/dist/tools/office/office-client-base.d.ts.map +0 -1
- package/dist/tools/office/office-client-base.js.map +0 -1
- package/dist/tools/office/office-client.d.ts.map +0 -1
- package/dist/tools/office/office-client.js.map +0 -1
- package/dist/tools/office/powerpoint-client.d.ts.map +0 -1
- package/dist/tools/office/powerpoint-client.js.map +0 -1
- package/dist/tools/office/powerpoint-tools/effects.d.ts.map +0 -1
- package/dist/tools/office/powerpoint-tools/effects.js.map +0 -1
- package/dist/tools/office/powerpoint-tools/export.d.ts.map +0 -1
- package/dist/tools/office/powerpoint-tools/export.js.map +0 -1
- package/dist/tools/office/powerpoint-tools/index.d.ts.map +0 -1
- package/dist/tools/office/powerpoint-tools/index.js.map +0 -1
- package/dist/tools/office/powerpoint-tools/launch.d.ts.map +0 -1
- package/dist/tools/office/powerpoint-tools/launch.js.map +0 -1
- package/dist/tools/office/powerpoint-tools/media.d.ts.map +0 -1
- package/dist/tools/office/powerpoint-tools/media.js.map +0 -1
- package/dist/tools/office/powerpoint-tools/notes.d.ts.map +0 -1
- package/dist/tools/office/powerpoint-tools/notes.js.map +0 -1
- package/dist/tools/office/powerpoint-tools/sections.d.ts.map +0 -1
- package/dist/tools/office/powerpoint-tools/sections.js.map +0 -1
- package/dist/tools/office/powerpoint-tools/shapes.d.ts.map +0 -1
- package/dist/tools/office/powerpoint-tools/shapes.js.map +0 -1
- package/dist/tools/office/powerpoint-tools/slides.d.ts.map +0 -1
- package/dist/tools/office/powerpoint-tools/slides.js.map +0 -1
- package/dist/tools/office/powerpoint-tools/tables.d.ts.map +0 -1
- package/dist/tools/office/powerpoint-tools/tables.js.map +0 -1
- package/dist/tools/office/powerpoint-tools/text.d.ts.map +0 -1
- package/dist/tools/office/powerpoint-tools/text.js.map +0 -1
- package/dist/tools/office/powerpoint-tools.d.ts.map +0 -1
- package/dist/tools/office/powerpoint-tools.js.map +0 -1
- package/dist/tools/office/word-client.d.ts.map +0 -1
- package/dist/tools/office/word-client.js.map +0 -1
- package/dist/tools/office/word-tools/bookmarks.d.ts.map +0 -1
- package/dist/tools/office/word-tools/bookmarks.js.map +0 -1
- package/dist/tools/office/word-tools/comments.d.ts.map +0 -1
- package/dist/tools/office/word-tools/comments.js.map +0 -1
- package/dist/tools/office/word-tools/content.d.ts.map +0 -1
- package/dist/tools/office/word-tools/content.js.map +0 -1
- package/dist/tools/office/word-tools/export.d.ts.map +0 -1
- package/dist/tools/office/word-tools/export.js.map +0 -1
- package/dist/tools/office/word-tools/formatting.d.ts.map +0 -1
- package/dist/tools/office/word-tools/formatting.js.map +0 -1
- package/dist/tools/office/word-tools/headers-footers.d.ts.map +0 -1
- package/dist/tools/office/word-tools/headers-footers.js.map +0 -1
- package/dist/tools/office/word-tools/index.d.ts.map +0 -1
- package/dist/tools/office/word-tools/index.js.map +0 -1
- package/dist/tools/office/word-tools/launch.d.ts.map +0 -1
- package/dist/tools/office/word-tools/launch.js.map +0 -1
- package/dist/tools/office/word-tools/lists.d.ts.map +0 -1
- package/dist/tools/office/word-tools/lists.js.map +0 -1
- package/dist/tools/office/word-tools/navigation.d.ts.map +0 -1
- package/dist/tools/office/word-tools/navigation.js.map +0 -1
- package/dist/tools/office/word-tools/page-setup.d.ts.map +0 -1
- package/dist/tools/office/word-tools/page-setup.js.map +0 -1
- package/dist/tools/office/word-tools/tables.d.ts.map +0 -1
- package/dist/tools/office/word-tools/tables.js.map +0 -1
- package/dist/tools/office/word-tools/text.d.ts.map +0 -1
- package/dist/tools/office/word-tools/text.js.map +0 -1
- package/dist/tools/office/word-tools/undo-redo.d.ts.map +0 -1
- package/dist/tools/office/word-tools/undo-redo.js.map +0 -1
- package/dist/tools/office/word-tools/watermarks.d.ts.map +0 -1
- package/dist/tools/office/word-tools/watermarks.js.map +0 -1
- package/dist/tools/office/word-tools.d.ts.map +0 -1
- package/dist/tools/office/word-tools.js.map +0 -1
- package/dist/tools/registry.d.ts.map +0 -1
- package/dist/tools/registry.js.map +0 -1
- package/dist/tools/types.d.ts.map +0 -1
- package/dist/tools/types.js.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/ui/PlanExecuteView.d.ts.map +0 -1
- package/dist/ui/PlanExecuteView.js.map +0 -1
- package/dist/ui/TodoPanel.d.ts.map +0 -1
- package/dist/ui/TodoPanel.js.map +0 -1
- package/dist/ui/UpdateNotification.d.ts.map +0 -1
- package/dist/ui/UpdateNotification.js.map +0 -1
- package/dist/ui/components/ActivityIndicator.d.ts.map +0 -1
- package/dist/ui/components/ActivityIndicator.js.map +0 -1
- package/dist/ui/components/CommandBrowser.d.ts.map +0 -1
- package/dist/ui/components/CommandBrowser.js.map +0 -1
- package/dist/ui/components/CustomTextInput.d.ts.map +0 -1
- package/dist/ui/components/CustomTextInput.js.map +0 -1
- package/dist/ui/components/DocsSearchProgress.d.ts.map +0 -1
- package/dist/ui/components/DocsSearchProgress.js.map +0 -1
- package/dist/ui/components/FileBrowser.d.ts.map +0 -1
- package/dist/ui/components/FileBrowser.js.map +0 -1
- package/dist/ui/components/LLMSetupWizard.d.ts.map +0 -1
- package/dist/ui/components/LLMSetupWizard.js.map +0 -1
- package/dist/ui/components/Logo.d.ts.map +0 -1
- package/dist/ui/components/Logo.js.map +0 -1
- package/dist/ui/components/MarkdownRenderer.d.ts.map +0 -1
- package/dist/ui/components/MarkdownRenderer.js.map +0 -1
- package/dist/ui/components/ModelSelector.d.ts.map +0 -1
- package/dist/ui/components/ModelSelector.js.map +0 -1
- package/dist/ui/components/PlanExecuteApp.d.ts.map +0 -1
- package/dist/ui/components/PlanExecuteApp.js.map +0 -1
- package/dist/ui/components/ProgressBar.d.ts.map +0 -1
- package/dist/ui/components/ProgressBar.js.map +0 -1
- package/dist/ui/components/StatusBar.d.ts.map +0 -1
- package/dist/ui/components/StatusBar.js.map +0 -1
- package/dist/ui/components/ThinkingIndicator.d.ts.map +0 -1
- package/dist/ui/components/ThinkingIndicator.js.map +0 -1
- package/dist/ui/components/TodoListView.d.ts.map +0 -1
- package/dist/ui/components/TodoListView.js.map +0 -1
- package/dist/ui/components/ToolSelector.d.ts.map +0 -1
- package/dist/ui/components/ToolSelector.js.map +0 -1
- package/dist/ui/components/dialogs/ApprovalDialog.d.ts.map +0 -1
- package/dist/ui/components/dialogs/ApprovalDialog.js.map +0 -1
- package/dist/ui/components/dialogs/AskUserDialog.d.ts.map +0 -1
- package/dist/ui/components/dialogs/AskUserDialog.js.map +0 -1
- package/dist/ui/components/dialogs/DocsBrowser.d.ts.map +0 -1
- package/dist/ui/components/dialogs/DocsBrowser.js.map +0 -1
- package/dist/ui/components/dialogs/SettingsDialog.d.ts.map +0 -1
- package/dist/ui/components/dialogs/SettingsDialog.js.map +0 -1
- package/dist/ui/components/dialogs/index.d.ts.map +0 -1
- package/dist/ui/components/dialogs/index.js.map +0 -1
- package/dist/ui/components/index.d.ts.map +0 -1
- package/dist/ui/components/index.js.map +0 -1
- package/dist/ui/components/panels/LogPanel.d.ts.map +0 -1
- package/dist/ui/components/panels/LogPanel.js.map +0 -1
- package/dist/ui/components/panels/SessionPanel.d.ts.map +0 -1
- package/dist/ui/components/panels/SessionPanel.js.map +0 -1
- package/dist/ui/components/panels/index.d.ts.map +0 -1
- package/dist/ui/components/panels/index.js.map +0 -1
- package/dist/ui/components/views/ChatView.d.ts.map +0 -1
- package/dist/ui/components/views/ChatView.js.map +0 -1
- package/dist/ui/components/views/index.d.ts.map +0 -1
- package/dist/ui/components/views/index.js.map +0 -1
- package/dist/ui/contexts/TokenContext.d.ts.map +0 -1
- package/dist/ui/contexts/TokenContext.js.map +0 -1
- package/dist/ui/hooks/atFileProcessor.d.ts.map +0 -1
- package/dist/ui/hooks/atFileProcessor.js.map +0 -1
- package/dist/ui/hooks/index.d.ts.map +0 -1
- package/dist/ui/hooks/index.js.map +0 -1
- package/dist/ui/hooks/slashCommandProcessor.d.ts.map +0 -1
- package/dist/ui/hooks/slashCommandProcessor.js.map +0 -1
- package/dist/ui/hooks/useCommandBrowserState.d.ts.map +0 -1
- package/dist/ui/hooks/useCommandBrowserState.js.map +0 -1
- package/dist/ui/hooks/useFileBrowserState.d.ts.map +0 -1
- package/dist/ui/hooks/useFileBrowserState.js.map +0 -1
- package/dist/ui/hooks/useFileList.d.ts.map +0 -1
- package/dist/ui/hooks/useFileList.js.map +0 -1
- package/dist/ui/hooks/useInputHistory.d.ts.map +0 -1
- package/dist/ui/hooks/useInputHistory.js.map +0 -1
- package/dist/ui/hooks/usePlanExecution.d.ts.map +0 -1
- package/dist/ui/hooks/usePlanExecution.js.map +0 -1
- package/dist/ui/index.d.ts.map +0 -1
- package/dist/ui/index.js.map +0 -1
- package/dist/ui/ink-entry.d.ts.map +0 -1
- package/dist/ui/ink-entry.js.map +0 -1
- package/dist/utils/env-filter.d.ts.map +0 -1
- package/dist/utils/env-filter.js.map +0 -1
- package/dist/utils/file-system.d.ts.map +0 -1
- package/dist/utils/file-system.js.map +0 -1
- package/dist/utils/git-utils.d.ts.map +0 -1
- package/dist/utils/git-utils.js.map +0 -1
- package/dist/utils/json-stream-logger.d.ts.map +0 -1
- package/dist/utils/json-stream-logger.js.map +0 -1
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/platform-utils.d.ts.map +0 -1
- package/dist/utils/platform-utils.js.map +0 -1
- package/dist/utils/wsl-utils.d.ts.map +0 -1
- package/dist/utils/wsl-utils.js.map +0 -1
- package/electron.vite.config.ts +0 -63
- package/google374b9eba0c52b043.html +0 -1
- package/src/agents/base/base-agent.ts +0 -159
- package/src/agents/docs-search/index.ts +0 -365
- package/src/agents/index.ts +0 -34
- package/src/agents/planner/index.ts +0 -544
- package/src/cli.ts +0 -201
- package/src/constants.ts +0 -47
- package/src/core/compact/compact-manager.ts +0 -160
- package/src/core/compact/compact-prompts.ts +0 -150
- package/src/core/compact/context-tracker.ts +0 -164
- package/src/core/compact/index.ts +0 -25
- package/src/core/config/config-manager.ts +0 -460
- package/src/core/config/index.ts +0 -5
- package/src/core/docs-manager.ts +0 -678
- package/src/core/llm/index.ts +0 -7
- package/src/core/llm/llm-client.ts +0 -1550
- package/src/core/session/index.ts +0 -5
- package/src/core/session/session-manager.ts +0 -464
- package/src/core/slash-command-handler.ts +0 -410
- package/src/core/usage-tracker.ts +0 -438
- package/src/errors/base.ts +0 -81
- package/src/errors/file.ts +0 -183
- package/src/errors/index.ts +0 -95
- package/src/errors/llm.ts +0 -151
- package/src/errors/network.ts +0 -124
- package/src/errors/validation.ts +0 -111
- package/src/eval/eval-runner.ts +0 -456
- package/src/eval/index.ts +0 -8
- package/src/eval/types.ts +0 -139
- package/src/index.ts +0 -22
- package/src/orchestration/index.ts +0 -30
- package/src/orchestration/plan-executor.ts +0 -652
- package/src/orchestration/types.ts +0 -127
- package/src/orchestration/utils.ts +0 -119
- package/src/orquesta/connection.ts +0 -291
- package/src/prompts/agents/docs-search-decision.ts +0 -74
- package/src/prompts/agents/docs-search.ts +0 -84
- package/src/prompts/agents/planning.ts +0 -143
- package/src/prompts/index.ts +0 -31
- package/src/prompts/shared/codebase-rules.ts +0 -29
- package/src/prompts/shared/git-rules.ts +0 -94
- package/src/prompts/shared/language-rules.ts +0 -36
- package/src/prompts/shared/tool-usage.ts +0 -72
- package/src/prompts/system/compact.ts +0 -80
- package/src/prompts/system/plan-execute.ts +0 -89
- package/src/tools/browser/browser-client.ts +0 -1363
- package/src/tools/browser/browser-tools.ts +0 -1139
- package/src/tools/browser/index.ts +0 -65
- package/src/tools/index.ts +0 -23
- package/src/tools/llm/agents/docs-search-tools.ts +0 -368
- package/src/tools/llm/agents/index.ts +0 -22
- package/src/tools/llm/index.ts +0 -11
- package/src/tools/llm/simple/ask-user-tool.ts +0 -25
- package/src/tools/llm/simple/background-bash-tool.ts +0 -443
- package/src/tools/llm/simple/background-powershell-tool.ts +0 -421
- package/src/tools/llm/simple/bash-tool.ts +0 -238
- package/src/tools/llm/simple/docs-search-agent-tool.ts +0 -146
- package/src/tools/llm/simple/file-tools.ts +0 -1051
- package/src/tools/llm/simple/final-response-tool.ts +0 -180
- package/src/tools/llm/simple/index.ts +0 -42
- package/src/tools/llm/simple/planning-tools.ts +0 -143
- package/src/tools/llm/simple/powershell-tool.ts +0 -241
- package/src/tools/llm/simple/simple-tool-executor.ts +0 -279
- package/src/tools/llm/simple/todo-tools.ts +0 -207
- package/src/tools/llm/simple/user-interaction-tools.ts +0 -277
- package/src/tools/office/common/constants.ts +0 -335
- package/src/tools/office/common/index.ts +0 -133
- package/src/tools/office/common/types.ts +0 -286
- package/src/tools/office/common/utils.ts +0 -116
- package/src/tools/office/excel-client.ts +0 -1336
- package/src/tools/office/excel-tools/cells.ts +0 -359
- package/src/tools/office/excel-tools/charts.ts +0 -166
- package/src/tools/office/excel-tools/comments.ts +0 -155
- package/src/tools/office/excel-tools/data-ops.ts +0 -349
- package/src/tools/office/excel-tools/export.ts +0 -105
- package/src/tools/office/excel-tools/formatting.ts +0 -357
- package/src/tools/office/excel-tools/index.ts +0 -55
- package/src/tools/office/excel-tools/launch.ts +0 -303
- package/src/tools/office/excel-tools/media.ts +0 -117
- package/src/tools/office/excel-tools/named-ranges.ts +0 -148
- package/src/tools/office/excel-tools/protection.ts +0 -105
- package/src/tools/office/excel-tools/rows-columns.ts +0 -386
- package/src/tools/office/excel-tools/sheets.ts +0 -228
- package/src/tools/office/excel-tools/validation.ts +0 -226
- package/src/tools/office/excel-tools.ts +0 -9
- package/src/tools/office/index.ts +0 -259
- package/src/tools/office/office-client-base.ts +0 -242
- package/src/tools/office/office-client.ts +0 -377
- package/src/tools/office/powerpoint-client.ts +0 -1498
- package/src/tools/office/powerpoint-tools/effects.ts +0 -315
- package/src/tools/office/powerpoint-tools/export.ts +0 -138
- package/src/tools/office/powerpoint-tools/index.ts +0 -45
- package/src/tools/office/powerpoint-tools/launch.ts +0 -263
- package/src/tools/office/powerpoint-tools/media.ts +0 -291
- package/src/tools/office/powerpoint-tools/notes.ts +0 -220
- package/src/tools/office/powerpoint-tools/sections.ts +0 -140
- package/src/tools/office/powerpoint-tools/shapes.ts +0 -870
- package/src/tools/office/powerpoint-tools/slides.ts +0 -350
- package/src/tools/office/powerpoint-tools/tables.ts +0 -182
- package/src/tools/office/powerpoint-tools/text.ts +0 -473
- package/src/tools/office/powerpoint-tools.ts +0 -9
- package/src/tools/office/word-client.ts +0 -1697
- package/src/tools/office/word-tools/bookmarks.ts +0 -186
- package/src/tools/office/word-tools/comments.ts +0 -185
- package/src/tools/office/word-tools/content.ts +0 -229
- package/src/tools/office/word-tools/export.ts +0 -97
- package/src/tools/office/word-tools/formatting.ts +0 -161
- package/src/tools/office/word-tools/headers-footers.ts +0 -155
- package/src/tools/office/word-tools/index.ts +0 -57
- package/src/tools/office/word-tools/launch.ts +0 -312
- package/src/tools/office/word-tools/lists.ts +0 -97
- package/src/tools/office/word-tools/navigation.ts +0 -114
- package/src/tools/office/word-tools/page-setup.ts +0 -195
- package/src/tools/office/word-tools/tables.ts +0 -262
- package/src/tools/office/word-tools/text.ts +0 -294
- package/src/tools/office/word-tools/undo-redo.ts +0 -97
- package/src/tools/office/word-tools/watermarks.ts +0 -105
- package/src/tools/office/word-tools.ts +0 -9
- package/src/tools/registry.ts +0 -527
- package/src/tools/types.ts +0 -231
- package/src/types/index.ts +0 -181
- package/src/ui/PlanExecuteView.tsx +0 -119
- package/src/ui/TodoPanel.tsx +0 -240
- package/src/ui/UpdateNotification.tsx +0 -105
- package/src/ui/components/ActivityIndicator.tsx +0 -234
- package/src/ui/components/CommandBrowser.tsx +0 -114
- package/src/ui/components/CustomTextInput.tsx +0 -389
- package/src/ui/components/DocsSearchProgress.tsx +0 -85
- package/src/ui/components/FileBrowser.tsx +0 -93
- package/src/ui/components/LLMSetupWizard.tsx +0 -333
- package/src/ui/components/Logo.tsx +0 -125
- package/src/ui/components/MarkdownRenderer.tsx +0 -358
- package/src/ui/components/ModelSelector.tsx +0 -203
- package/src/ui/components/PlanExecuteApp.tsx +0 -2007
- package/src/ui/components/ProgressBar.tsx +0 -51
- package/src/ui/components/StatusBar.tsx +0 -302
- package/src/ui/components/ThinkingIndicator.tsx +0 -120
- package/src/ui/components/TodoListView.tsx +0 -140
- package/src/ui/components/ToolSelector.tsx +0 -215
- package/src/ui/components/dialogs/ApprovalDialog.tsx +0 -259
- package/src/ui/components/dialogs/AskUserDialog.tsx +0 -159
- package/src/ui/components/dialogs/DocsBrowser.tsx +0 -222
- package/src/ui/components/dialogs/SettingsDialog.tsx +0 -939
- package/src/ui/components/dialogs/index.ts +0 -13
- package/src/ui/components/index.ts +0 -27
- package/src/ui/components/panels/LogPanel.tsx +0 -385
- package/src/ui/components/panels/SessionPanel.tsx +0 -146
- package/src/ui/components/panels/index.ts +0 -13
- package/src/ui/components/views/ChatView.tsx +0 -447
- package/src/ui/components/views/index.ts +0 -5
- package/src/ui/contexts/TokenContext.tsx +0 -139
- package/src/ui/hooks/atFileProcessor.ts +0 -167
- package/src/ui/hooks/index.ts +0 -11
- package/src/ui/hooks/slashCommandProcessor.ts +0 -174
- package/src/ui/hooks/useCommandBrowserState.ts +0 -97
- package/src/ui/hooks/useFileBrowserState.ts +0 -116
- package/src/ui/hooks/useFileList.ts +0 -132
- package/src/ui/hooks/useInputHistory.ts +0 -89
- package/src/ui/hooks/usePlanExecution.ts +0 -339
- package/src/ui/index.ts +0 -10
- package/src/ui/ink-entry.tsx +0 -36
- package/src/utils/env-filter.ts +0 -164
- package/src/utils/file-system.ts +0 -133
- package/src/utils/git-utils.ts +0 -30
- package/src/utils/json-stream-logger.ts +0 -1259
- package/src/utils/logger.ts +0 -2767
- package/src/utils/platform-utils.ts +0 -256
- package/src/utils/wsl-utils.ts +0 -113
- package/tsconfig.electron.json +0 -39
- package/tsconfig.json +0 -64
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Simple Tool Executor
|
|
3
|
-
*
|
|
4
|
-
* Execution and callback management for LLM Simple Tools
|
|
5
|
-
* Module separated from file-tools.ts
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { ToolResult, isLLMSimpleTool } from '../../types.js';
|
|
9
|
-
import { getStreamLogger } from '../../../utils/json-stream-logger.js';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Callback for tool execution events (reason display to user)
|
|
13
|
-
*/
|
|
14
|
-
type ToolExecutionCallback = (toolName: string, reason: string, args: Record<string, unknown>) => void;
|
|
15
|
-
let toolExecutionCallback: ToolExecutionCallback | null = null;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Callback for tool response events
|
|
19
|
-
*/
|
|
20
|
-
type ToolResponseCallback = (toolName: string, success: boolean, result: string) => void;
|
|
21
|
-
let toolResponseCallback: ToolResponseCallback | null = null;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Callback for plan created events
|
|
25
|
-
*/
|
|
26
|
-
type PlanCreatedCallback = (todoTitles: string[]) => void;
|
|
27
|
-
let planCreatedCallback: PlanCreatedCallback | null = null;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Callback for todo start events
|
|
31
|
-
*/
|
|
32
|
-
type TodoStartCallback = (title: string) => void;
|
|
33
|
-
let todoStartCallback: TodoStartCallback | null = null;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Callback for todo complete events
|
|
37
|
-
*/
|
|
38
|
-
type TodoCompleteCallback = (title: string) => void;
|
|
39
|
-
let todoCompleteCallback: TodoCompleteCallback | null = null;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Callback for todo fail events
|
|
43
|
-
*/
|
|
44
|
-
type TodoFailCallback = (title: string) => void;
|
|
45
|
-
let todoFailCallback: TodoFailCallback | null = null;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Callback for tool approval (Supervised Mode)
|
|
49
|
-
* Returns: 'approve' | 'always' | { reject: true; comment: string }
|
|
50
|
-
*/
|
|
51
|
-
export type ToolApprovalResult = 'approve' | 'always' | { reject: true; comment: string };
|
|
52
|
-
type ToolApprovalCallback = (
|
|
53
|
-
toolName: string,
|
|
54
|
-
args: Record<string, unknown>,
|
|
55
|
-
reason?: string
|
|
56
|
-
) => Promise<ToolApprovalResult>;
|
|
57
|
-
let toolApprovalCallback: ToolApprovalCallback | null = null;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Callback for compact events
|
|
61
|
-
*/
|
|
62
|
-
type CompactCallback = (originalCount: number, newCount: number) => void;
|
|
63
|
-
let compactCallback: CompactCallback | null = null;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Callback for assistant response events (final LLM response)
|
|
67
|
-
*/
|
|
68
|
-
type AssistantResponseCallback = (content: string) => void;
|
|
69
|
-
let assistantResponseCallback: AssistantResponseCallback | null = null;
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Callback for reasoning/thinking events (extended thinking from o1 models)
|
|
73
|
-
*/
|
|
74
|
-
type ReasoningCallback = (content: string, isStreaming: boolean) => void;
|
|
75
|
-
let reasoningCallback: ReasoningCallback | null = null;
|
|
76
|
-
|
|
77
|
-
// ============================================
|
|
78
|
-
// Callback Setters
|
|
79
|
-
// ============================================
|
|
80
|
-
|
|
81
|
-
export function setToolExecutionCallback(callback: ToolExecutionCallback | null): void {
|
|
82
|
-
toolExecutionCallback = callback;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export function setToolResponseCallback(callback: ToolResponseCallback | null): void {
|
|
86
|
-
toolResponseCallback = callback;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export function setPlanCreatedCallback(callback: PlanCreatedCallback | null): void {
|
|
90
|
-
planCreatedCallback = callback;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export function setTodoStartCallback(callback: TodoStartCallback | null): void {
|
|
94
|
-
todoStartCallback = callback;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export function setTodoCompleteCallback(callback: TodoCompleteCallback | null): void {
|
|
98
|
-
todoCompleteCallback = callback;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export function setTodoFailCallback(callback: TodoFailCallback | null): void {
|
|
102
|
-
todoFailCallback = callback;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export function setToolApprovalCallback(callback: ToolApprovalCallback | null): void {
|
|
106
|
-
toolApprovalCallback = callback;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export function setCompactCallback(callback: CompactCallback | null): void {
|
|
110
|
-
compactCallback = callback;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export function setAssistantResponseCallback(callback: AssistantResponseCallback | null): void {
|
|
114
|
-
assistantResponseCallback = callback;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export function setReasoningCallback(callback: ReasoningCallback | null): void {
|
|
118
|
-
reasoningCallback = callback;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// ============================================
|
|
122
|
-
// Callback Getters & Emitters
|
|
123
|
-
// ============================================
|
|
124
|
-
|
|
125
|
-
export function getToolExecutionCallback(): ToolExecutionCallback | null {
|
|
126
|
-
return toolExecutionCallback;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export async function requestToolApproval(
|
|
130
|
-
toolName: string,
|
|
131
|
-
args: Record<string, unknown>,
|
|
132
|
-
reason?: string
|
|
133
|
-
): Promise<ToolApprovalResult | null> {
|
|
134
|
-
if (!toolApprovalCallback) {
|
|
135
|
-
return null;
|
|
136
|
-
}
|
|
137
|
-
return toolApprovalCallback(toolName, args, reason);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export function emitPlanCreated(todoTitles: string[]): void {
|
|
141
|
-
if (planCreatedCallback) {
|
|
142
|
-
planCreatedCallback(todoTitles);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export function emitTodoStart(title: string): void {
|
|
147
|
-
if (todoStartCallback) {
|
|
148
|
-
todoStartCallback(title);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export function emitTodoComplete(title: string): void {
|
|
153
|
-
if (todoCompleteCallback) {
|
|
154
|
-
todoCompleteCallback(title);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
export function emitTodoFail(title: string): void {
|
|
159
|
-
if (todoFailCallback) {
|
|
160
|
-
todoFailCallback(title);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
export function emitCompact(originalCount: number, newCount: number): void {
|
|
165
|
-
if (compactCallback) {
|
|
166
|
-
compactCallback(originalCount, newCount);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export function emitAssistantResponse(content: string): void {
|
|
171
|
-
// Skip empty content to prevent blank lines in UI
|
|
172
|
-
if (assistantResponseCallback && content && content.trim()) {
|
|
173
|
-
// Filter out <think>...</think> tags (used by some models like DeepSeek)
|
|
174
|
-
// Extract thinking content and emit as reasoning, then remove from main content
|
|
175
|
-
const thinkRegex = /<think>([\s\S]*?)<\/think>/g;
|
|
176
|
-
let thinkingContent = '';
|
|
177
|
-
let match;
|
|
178
|
-
while ((match = thinkRegex.exec(content)) !== null) {
|
|
179
|
-
if (match[1] && match[1].trim()) {
|
|
180
|
-
thinkingContent += match[1].trim() + '\n';
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
// Emit thinking as reasoning if present
|
|
185
|
-
if (thinkingContent && reasoningCallback) {
|
|
186
|
-
reasoningCallback(thinkingContent.trim(), false);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// Remove <think> tags from content
|
|
190
|
-
const cleanedContent = content.replace(/<think>[\s\S]*?<\/think>/g, '').trim();
|
|
191
|
-
|
|
192
|
-
if (cleanedContent) {
|
|
193
|
-
assistantResponseCallback(cleanedContent);
|
|
194
|
-
|
|
195
|
-
// Log assistant response (for Ctrl+O LogBrowser chat category)
|
|
196
|
-
const streamLogger = getStreamLogger();
|
|
197
|
-
streamLogger?.logAssistantResponse(cleanedContent);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
export function emitReasoning(content: string, isStreaming: boolean = false): void {
|
|
203
|
-
// Skip empty content to prevent blank lines in UI
|
|
204
|
-
if (reasoningCallback && content && content.trim()) {
|
|
205
|
-
reasoningCallback(content, isStreaming);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
// ============================================
|
|
210
|
-
// Tool Executor
|
|
211
|
-
// ============================================
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Execute a simple tool by name
|
|
215
|
-
* Uses tool registry to find and execute tools
|
|
216
|
-
*/
|
|
217
|
-
export async function executeSimpleTool(
|
|
218
|
-
toolName: string,
|
|
219
|
-
args: Record<string, unknown>
|
|
220
|
-
): Promise<ToolResult> {
|
|
221
|
-
const startTime = Date.now();
|
|
222
|
-
const logger = getStreamLogger();
|
|
223
|
-
|
|
224
|
-
// Dynamic import to avoid circular dependency
|
|
225
|
-
const { toolRegistry } = await import('../../registry.js');
|
|
226
|
-
const tool = toolRegistry.get(toolName);
|
|
227
|
-
|
|
228
|
-
if (!tool || !isLLMSimpleTool(tool)) {
|
|
229
|
-
const error = `Unknown or not a simple tool: ${toolName}`;
|
|
230
|
-
// Log tool execution failure
|
|
231
|
-
logger?.logToolEnd(toolName, false, undefined, error, Date.now() - startTime);
|
|
232
|
-
return {
|
|
233
|
-
success: false,
|
|
234
|
-
error,
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
// Extract reason from args (not required for TODO tools)
|
|
239
|
-
const reason = args['reason'] as string | undefined;
|
|
240
|
-
|
|
241
|
-
// Log tool execution start
|
|
242
|
-
logger?.logToolStart(toolName, args, reason);
|
|
243
|
-
|
|
244
|
-
// Call the callback to notify UI about tool execution (pass all args)
|
|
245
|
-
// Skip for TODO tools which don't have reason parameter
|
|
246
|
-
if (toolExecutionCallback && reason) {
|
|
247
|
-
toolExecutionCallback(toolName, reason, args);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
// Execute the tool
|
|
251
|
-
const result = await tool.execute(args);
|
|
252
|
-
const durationMs = Date.now() - startTime;
|
|
253
|
-
|
|
254
|
-
// Log tool execution end
|
|
255
|
-
logger?.logToolEnd(
|
|
256
|
-
toolName,
|
|
257
|
-
result.success,
|
|
258
|
-
result.success ? result.result : undefined,
|
|
259
|
-
result.success ? undefined : result.error,
|
|
260
|
-
durationMs
|
|
261
|
-
);
|
|
262
|
-
|
|
263
|
-
// Call the response callback to notify UI about tool result
|
|
264
|
-
// Skip response callback for TODO tools to avoid cluttering UI
|
|
265
|
-
const isTodoTool = ['update_todos', 'get_todo_list'].includes(toolName);
|
|
266
|
-
if (toolResponseCallback && !isTodoTool) {
|
|
267
|
-
const resultText = result.success
|
|
268
|
-
? (result.result || '')
|
|
269
|
-
: (result.error || 'Unknown error');
|
|
270
|
-
toolResponseCallback(toolName, result.success, resultText);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
return result;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* @deprecated Use executeSimpleTool instead
|
|
278
|
-
*/
|
|
279
|
-
export const executeFileTool = executeSimpleTool;
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TODO Management LLM Tools
|
|
3
|
-
*
|
|
4
|
-
* Tools that allow LLM to manage TODO lists
|
|
5
|
-
* Claude Code approach: Replace entire list with write_todos
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { LLMSimpleTool, ToolResult, ToolCategory } from '../../types.js';
|
|
9
|
-
import { ToolDefinition } from '../../../types/index.js';
|
|
10
|
-
import { logger } from '../../../utils/logger.js';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* TODO item (simplified: title + status only)
|
|
14
|
-
*/
|
|
15
|
-
export interface TodoInput {
|
|
16
|
-
id: string;
|
|
17
|
-
title: string;
|
|
18
|
-
status: 'pending' | 'in_progress' | 'completed' | 'failed';
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* TODO list replacement callback type
|
|
23
|
-
* Receives and replaces entire list
|
|
24
|
-
*/
|
|
25
|
-
export type TodoWriteCallback = (todos: TodoInput[]) => Promise<boolean>;
|
|
26
|
-
|
|
27
|
-
// Global callback - set by orchestrator
|
|
28
|
-
let todoWriteCallback: TodoWriteCallback | null = null;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Set the TODO write callback
|
|
32
|
-
*/
|
|
33
|
-
export function setTodoWriteCallback(callback: TodoWriteCallback): void {
|
|
34
|
-
logger.flow('Setting TODO write callback');
|
|
35
|
-
todoWriteCallback = callback;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Clear TODO callbacks
|
|
40
|
-
*/
|
|
41
|
-
export function clearTodoCallbacks(): void {
|
|
42
|
-
logger.flow('Clearing TODO callbacks');
|
|
43
|
-
todoWriteCallback = null;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* write_todos Tool Definition
|
|
48
|
-
* Replace entire TODO list (Claude Code approach)
|
|
49
|
-
*/
|
|
50
|
-
const WRITE_TODOS_DEFINITION: ToolDefinition = {
|
|
51
|
-
type: 'function',
|
|
52
|
-
function: {
|
|
53
|
-
name: 'write_todos',
|
|
54
|
-
description: `Replace the entire TODO list with a new list.
|
|
55
|
-
|
|
56
|
-
Use this to:
|
|
57
|
-
- Update TODO statuses (change status field)
|
|
58
|
-
- Add new TODOs (include in the array)
|
|
59
|
-
- Remove TODOs (omit from the array)
|
|
60
|
-
- Reorder TODOs (change array order)
|
|
61
|
-
|
|
62
|
-
IMPORTANT: You must include ALL TODOs you want to keep. Any TODO not in the array will be removed.
|
|
63
|
-
|
|
64
|
-
Example - Mark first task complete, second in progress:
|
|
65
|
-
{
|
|
66
|
-
"todos": [
|
|
67
|
-
{ "id": "1", "title": "Setup project", "status": "completed" },
|
|
68
|
-
{ "id": "2", "title": "Implement feature", "status": "in_progress" },
|
|
69
|
-
{ "id": "3", "title": "Write tests", "status": "pending" }
|
|
70
|
-
]
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
Example - Add a new task:
|
|
74
|
-
{
|
|
75
|
-
"todos": [
|
|
76
|
-
{ "id": "1", "title": "Existing task", "status": "completed" },
|
|
77
|
-
{ "id": "2", "title": "New task I just added", "status": "pending" }
|
|
78
|
-
]
|
|
79
|
-
}`,
|
|
80
|
-
parameters: {
|
|
81
|
-
type: 'object',
|
|
82
|
-
properties: {
|
|
83
|
-
todos: {
|
|
84
|
-
type: 'array',
|
|
85
|
-
description: 'The complete TODO list (replaces existing list)',
|
|
86
|
-
items: {
|
|
87
|
-
type: 'object',
|
|
88
|
-
properties: {
|
|
89
|
-
id: {
|
|
90
|
-
type: 'string',
|
|
91
|
-
description: 'Unique ID for the TODO',
|
|
92
|
-
},
|
|
93
|
-
title: {
|
|
94
|
-
type: 'string',
|
|
95
|
-
description: 'Short title describing the task',
|
|
96
|
-
},
|
|
97
|
-
status: {
|
|
98
|
-
type: 'string',
|
|
99
|
-
enum: ['pending', 'in_progress', 'completed', 'failed'],
|
|
100
|
-
description: 'Current status of the TODO',
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
required: ['id', 'title', 'status'],
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
required: ['todos'],
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* write_todos Tool Implementation
|
|
114
|
-
*/
|
|
115
|
-
async function executeWriteTodos(args: Record<string, unknown>): Promise<ToolResult> {
|
|
116
|
-
logger.enter('executeWriteTodos', args);
|
|
117
|
-
|
|
118
|
-
const todos = args['todos'] as TodoInput[];
|
|
119
|
-
|
|
120
|
-
if (!todos || !Array.isArray(todos)) {
|
|
121
|
-
logger.warn('Missing or invalid todos array');
|
|
122
|
-
return {
|
|
123
|
-
success: false,
|
|
124
|
-
error: 'Missing required parameter: todos array is required',
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
if (!todoWriteCallback) {
|
|
129
|
-
logger.warn('TODO write callback not set');
|
|
130
|
-
return {
|
|
131
|
-
success: false,
|
|
132
|
-
error: 'TODO management is not available in current context',
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// Validate each todo
|
|
137
|
-
for (const todo of todos) {
|
|
138
|
-
if (!todo.id || !todo.title || !todo.status) {
|
|
139
|
-
return {
|
|
140
|
-
success: false,
|
|
141
|
-
error: `Invalid TODO item: each item must have id, title, and status`,
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
if (!['pending', 'in_progress', 'completed', 'failed'].includes(todo.status)) {
|
|
145
|
-
return {
|
|
146
|
-
success: false,
|
|
147
|
-
error: `Invalid status "${todo.status}" for TODO "${todo.id}"`,
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
try {
|
|
153
|
-
logger.flow(`Writing ${todos.length} TODOs`);
|
|
154
|
-
const success = await todoWriteCallback(todos);
|
|
155
|
-
|
|
156
|
-
if (success) {
|
|
157
|
-
const completed = todos.filter(t => t.status === 'completed').length;
|
|
158
|
-
const inProgress = todos.filter(t => t.status === 'in_progress').length;
|
|
159
|
-
const pending = todos.filter(t => t.status === 'pending').length;
|
|
160
|
-
const failed = todos.filter(t => t.status === 'failed').length;
|
|
161
|
-
|
|
162
|
-
const summary = `TODO list updated (${todos.length} items): ${completed} completed, ${inProgress} in progress, ${pending} pending, ${failed} failed`;
|
|
163
|
-
|
|
164
|
-
logger.exit('executeWriteTodos', { success: true, count: todos.length });
|
|
165
|
-
return {
|
|
166
|
-
success: true,
|
|
167
|
-
result: summary,
|
|
168
|
-
metadata: { todoCount: todos.length, completed, inProgress, pending, failed },
|
|
169
|
-
};
|
|
170
|
-
} else {
|
|
171
|
-
return {
|
|
172
|
-
success: false,
|
|
173
|
-
error: 'Failed to update TODO list',
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
} catch (error) {
|
|
177
|
-
logger.error('Error writing TODOs', error as Error);
|
|
178
|
-
return {
|
|
179
|
-
success: false,
|
|
180
|
-
error: `Error writing TODOs: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* LLM Simple Tool: write_todos
|
|
187
|
-
*/
|
|
188
|
-
export const WriteTodosTool: LLMSimpleTool = {
|
|
189
|
-
definition: WRITE_TODOS_DEFINITION,
|
|
190
|
-
execute: executeWriteTodos,
|
|
191
|
-
categories: ['llm-simple'] as ToolCategory[],
|
|
192
|
-
description: 'Write/replace entire TODO list',
|
|
193
|
-
};
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* All TODO Tools
|
|
197
|
-
*/
|
|
198
|
-
export const TODO_TOOLS = [WriteTodosTool];
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Get TODO tool definitions for LLM
|
|
202
|
-
*/
|
|
203
|
-
export function getTodoToolDefinitions(): ToolDefinition[] {
|
|
204
|
-
return TODO_TOOLS.map(tool => tool.definition);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
export default TODO_TOOLS;
|