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,167 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @ File Processor
|
|
3
|
-
*
|
|
4
|
-
* Utilities for detecting @ triggers and processing file selections
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import * as fs from 'fs/promises';
|
|
8
|
-
import * as path from 'path';
|
|
9
|
-
|
|
10
|
-
export interface AtTriggerInfo {
|
|
11
|
-
detected: boolean;
|
|
12
|
-
position: number;
|
|
13
|
-
filter: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Detect '@' trigger in input string
|
|
18
|
-
* Returns position and filter text after @
|
|
19
|
-
*/
|
|
20
|
-
export function detectAtTrigger(input: string): AtTriggerInfo {
|
|
21
|
-
// Find '@' at start or after space
|
|
22
|
-
const atMatch = input.match(/(^|[\s])@([^\s]*?)$/);
|
|
23
|
-
|
|
24
|
-
if (!atMatch) {
|
|
25
|
-
return { detected: false, position: -1, filter: '' };
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const position = atMatch.index! + atMatch[1]!.length; // Position of '@'
|
|
29
|
-
const filter = atMatch[2] || ''; // Text after '@'
|
|
30
|
-
|
|
31
|
-
return {
|
|
32
|
-
detected: true,
|
|
33
|
-
position,
|
|
34
|
-
filter,
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Insert file paths into input string at cursor position
|
|
40
|
-
* Removes the '@' trigger and filter text
|
|
41
|
-
* Ensures cursor is positioned right after the inserted path for continued typing
|
|
42
|
-
*/
|
|
43
|
-
export function insertFilePaths(
|
|
44
|
-
input: string,
|
|
45
|
-
atPosition: number,
|
|
46
|
-
filterLength: number,
|
|
47
|
-
filePaths: string[]
|
|
48
|
-
): string {
|
|
49
|
-
// Remove '@filter' from input
|
|
50
|
-
const before = input.slice(0, atPosition);
|
|
51
|
-
const after = input.slice(atPosition + 1 + filterLength);
|
|
52
|
-
|
|
53
|
-
// Format file paths as @path1 @path2 @path3
|
|
54
|
-
const formattedPaths = filePaths.map((p) => `@${p}`).join(' ');
|
|
55
|
-
|
|
56
|
-
// Insert paths with space after for continued typing
|
|
57
|
-
// If there's text after the cursor, trim the result
|
|
58
|
-
// Otherwise, keep trailing space so user can continue typing immediately
|
|
59
|
-
if (after.trim()) {
|
|
60
|
-
return `${before}${formattedPaths} ${after}`.trim();
|
|
61
|
-
} else {
|
|
62
|
-
// No text after cursor - add space for continued typing
|
|
63
|
-
return `${before}${formattedPaths} `;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Result of processing @file references
|
|
69
|
-
*/
|
|
70
|
-
export interface ProcessedMessage {
|
|
71
|
-
/** The processed message with file contents included */
|
|
72
|
-
content: string;
|
|
73
|
-
/** List of files that were successfully read */
|
|
74
|
-
includedFiles: string[];
|
|
75
|
-
/** List of files that failed to read */
|
|
76
|
-
failedFiles: string[];
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Extract @path references from a message
|
|
81
|
-
* Matches patterns like @/path/to/file.ts or @relative/path.js
|
|
82
|
-
*/
|
|
83
|
-
export function extractFileReferences(input: string): string[] {
|
|
84
|
-
// Match @followed by a path (absolute or relative, with optional extension)
|
|
85
|
-
// Stops at whitespace or end of string
|
|
86
|
-
const regex = /@([^\s@]+)/g;
|
|
87
|
-
const matches: string[] = [];
|
|
88
|
-
let match;
|
|
89
|
-
|
|
90
|
-
while ((match = regex.exec(input)) !== null) {
|
|
91
|
-
const filePath = match[1];
|
|
92
|
-
// Filter out obvious non-paths (single characters, etc.)
|
|
93
|
-
if (filePath && filePath.length > 1 && (filePath.includes('/') || filePath.includes('.'))) {
|
|
94
|
-
matches.push(filePath);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return matches;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Process a message by reading @file references and including their contents
|
|
103
|
-
* Returns the processed message with file contents appended
|
|
104
|
-
*/
|
|
105
|
-
export async function processFileReferences(input: string): Promise<ProcessedMessage> {
|
|
106
|
-
const fileRefs = extractFileReferences(input);
|
|
107
|
-
|
|
108
|
-
if (fileRefs.length === 0) {
|
|
109
|
-
return {
|
|
110
|
-
content: input,
|
|
111
|
-
includedFiles: [],
|
|
112
|
-
failedFiles: [],
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const includedFiles: string[] = [];
|
|
117
|
-
const failedFiles: string[] = [];
|
|
118
|
-
const fileContents: string[] = [];
|
|
119
|
-
|
|
120
|
-
for (const filePath of fileRefs) {
|
|
121
|
-
try {
|
|
122
|
-
// Resolve path (relative to cwd)
|
|
123
|
-
const resolvedPath = path.resolve(process.cwd(), filePath);
|
|
124
|
-
|
|
125
|
-
// Security: Prevent path traversal attacks
|
|
126
|
-
if (!resolvedPath.startsWith(process.cwd())) {
|
|
127
|
-
failedFiles.push(filePath);
|
|
128
|
-
continue;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// Check if file exists
|
|
132
|
-
const stat = await fs.stat(resolvedPath);
|
|
133
|
-
|
|
134
|
-
if (stat.isDirectory()) {
|
|
135
|
-
// For directories, list contents instead
|
|
136
|
-
const entries = await fs.readdir(resolvedPath);
|
|
137
|
-
fileContents.push(`\n--- Directory: ${filePath} ---\n${entries.join('\n')}\n---`);
|
|
138
|
-
includedFiles.push(filePath);
|
|
139
|
-
} else {
|
|
140
|
-
// Read file content
|
|
141
|
-
const content = await fs.readFile(resolvedPath, 'utf-8');
|
|
142
|
-
const ext = path.extname(filePath).slice(1) || 'txt';
|
|
143
|
-
fileContents.push(`\n--- File: ${filePath} ---\n\`\`\`${ext}\n${content}\n\`\`\`\n---`);
|
|
144
|
-
includedFiles.push(filePath);
|
|
145
|
-
}
|
|
146
|
-
} catch (error) {
|
|
147
|
-
failedFiles.push(filePath);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// Build final message
|
|
152
|
-
// Remove @path references from original message and append file contents
|
|
153
|
-
let cleanedInput = input;
|
|
154
|
-
for (const filePath of new Set(fileRefs)) {
|
|
155
|
-
cleanedInput = cleanedInput.replaceAll(`@${filePath}`, `[${filePath}]`);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
const finalContent = fileContents.length > 0
|
|
159
|
-
? `${cleanedInput}\n\n<attached_files>${fileContents.join('\n')}</attached_files>`
|
|
160
|
-
: cleanedInput;
|
|
161
|
-
|
|
162
|
-
return {
|
|
163
|
-
content: finalContent,
|
|
164
|
-
includedFiles,
|
|
165
|
-
failedFiles,
|
|
166
|
-
};
|
|
167
|
-
}
|
package/src/ui/hooks/index.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hooks barrel export
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export * from './atFileProcessor.js';
|
|
6
|
-
export * from './useFileList.js';
|
|
7
|
-
export * from './slashCommandProcessor.js';
|
|
8
|
-
export * from './useFileBrowserState.js';
|
|
9
|
-
export * from './useCommandBrowserState.js';
|
|
10
|
-
export * from './usePlanExecution.js';
|
|
11
|
-
export * from './useInputHistory.js';
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Slash Command Processor
|
|
3
|
-
*
|
|
4
|
-
* Utilities for detecting slash command triggers and processing command selections
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export interface SlashCommandInfo {
|
|
8
|
-
detected: boolean;
|
|
9
|
-
position: number;
|
|
10
|
-
partialCommand: string;
|
|
11
|
-
fullCommand: string | null;
|
|
12
|
-
args: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface CommandMetadata {
|
|
16
|
-
name: string;
|
|
17
|
-
description: string;
|
|
18
|
-
argsHint?: string;
|
|
19
|
-
aliases?: string[];
|
|
20
|
-
handler?: (args: string) => void | Promise<void>;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Available slash commands with descriptions
|
|
25
|
-
*/
|
|
26
|
-
export const SLASH_COMMANDS: CommandMetadata[] = [
|
|
27
|
-
{
|
|
28
|
-
name: '/exit',
|
|
29
|
-
description: 'Exit the application',
|
|
30
|
-
aliases: ['/quit'],
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: '/clear',
|
|
34
|
-
description: 'Clear conversation and TODOs',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
name: '/compact',
|
|
38
|
-
description: 'Compact conversation to free up context',
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
name: '/settings',
|
|
42
|
-
description: 'Open settings menu',
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
name: '/model',
|
|
46
|
-
description: 'Switch between LLM models',
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
name: '/load',
|
|
50
|
-
description: 'Load a saved session',
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: '/docs',
|
|
54
|
-
description: 'Download framework documentation (agno, adk)',
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
name: '/tool',
|
|
58
|
-
description: 'Enable/disable optional tools (Browser, Background)',
|
|
59
|
-
aliases: ['/tools'],
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
name: '/usage',
|
|
63
|
-
description: 'Show token usage statistics',
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
name: '/help',
|
|
67
|
-
description: 'Show help message',
|
|
68
|
-
},
|
|
69
|
-
];
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Detect slash command trigger in input string
|
|
73
|
-
* Returns position, partial command, and full command if complete
|
|
74
|
-
*/
|
|
75
|
-
export function detectSlashTrigger(input: string): SlashCommandInfo {
|
|
76
|
-
// Only match a single '/' at the start of input (no spaces before)
|
|
77
|
-
// Explicitly reject '//' or multiple slashes
|
|
78
|
-
if (input.startsWith('//')) {
|
|
79
|
-
return {
|
|
80
|
-
detected: false,
|
|
81
|
-
position: -1,
|
|
82
|
-
partialCommand: '',
|
|
83
|
-
fullCommand: null,
|
|
84
|
-
args: '',
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const slashMatch = input.match(/^\/([^\s]*)([\s](.*))?$/);
|
|
89
|
-
|
|
90
|
-
if (!slashMatch) {
|
|
91
|
-
return {
|
|
92
|
-
detected: false,
|
|
93
|
-
position: -1,
|
|
94
|
-
partialCommand: '',
|
|
95
|
-
fullCommand: null,
|
|
96
|
-
args: '',
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
const partialCommand = slashMatch[1] || '';
|
|
101
|
-
const args = slashMatch[3] || '';
|
|
102
|
-
const fullInput = `/${partialCommand}`;
|
|
103
|
-
|
|
104
|
-
// Check if this is a complete command (including aliases)
|
|
105
|
-
const matchedCommand = SLASH_COMMANDS.find(
|
|
106
|
-
(cmd) => cmd.name === fullInput || cmd.aliases?.includes(fullInput)
|
|
107
|
-
);
|
|
108
|
-
|
|
109
|
-
return {
|
|
110
|
-
detected: true,
|
|
111
|
-
position: 0,
|
|
112
|
-
partialCommand,
|
|
113
|
-
fullCommand: matchedCommand ? matchedCommand.name : null,
|
|
114
|
-
args,
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Filter commands based on partial input
|
|
120
|
-
* Returns up to maxResults commands that match the partial command
|
|
121
|
-
* Includes both primary commands and aliases
|
|
122
|
-
*/
|
|
123
|
-
export function filterCommands(
|
|
124
|
-
partialCommand: string,
|
|
125
|
-
maxResults: number = 10
|
|
126
|
-
): CommandMetadata[] {
|
|
127
|
-
if (!partialCommand) {
|
|
128
|
-
return SLASH_COMMANDS.slice(0, maxResults);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
const filtered = SLASH_COMMANDS.filter((cmd) => {
|
|
132
|
-
const searchTerm = `/${partialCommand.toLowerCase()}`;
|
|
133
|
-
// Match primary command or any alias
|
|
134
|
-
return (
|
|
135
|
-
cmd.name.toLowerCase().startsWith(searchTerm) ||
|
|
136
|
-
cmd.aliases?.some((alias) => alias.toLowerCase().startsWith(searchTerm))
|
|
137
|
-
);
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
return filtered.slice(0, maxResults);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Check if a command is valid and complete
|
|
145
|
-
* Validates both primary commands and aliases
|
|
146
|
-
*/
|
|
147
|
-
export function isValidCommand(input: string): boolean {
|
|
148
|
-
const trimmed = input.trim();
|
|
149
|
-
return SLASH_COMMANDS.some(
|
|
150
|
-
(cmd) =>
|
|
151
|
-
trimmed.startsWith(cmd.name) ||
|
|
152
|
-
cmd.aliases?.some((alias) => trimmed.startsWith(alias))
|
|
153
|
-
);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Get argument hint for a specific command
|
|
158
|
-
*/
|
|
159
|
-
export function getCommandArgsHint(commandName: string): string | undefined {
|
|
160
|
-
const command = SLASH_COMMANDS.find((cmd) => cmd.name === commandName);
|
|
161
|
-
return command?.argsHint;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Insert selected command into input
|
|
166
|
-
* Replaces the partial command with the full command
|
|
167
|
-
*/
|
|
168
|
-
export function insertSlashCommand(
|
|
169
|
-
_input: string,
|
|
170
|
-
selectedCommand: string
|
|
171
|
-
): string {
|
|
172
|
-
// Replace everything with the selected command and add a space
|
|
173
|
-
return `${selectedCommand} `;
|
|
174
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* useCommandBrowserState Hook
|
|
3
|
-
*
|
|
4
|
-
* Manages command browser state for slash commands
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { useState, useEffect, useCallback } from 'react';
|
|
8
|
-
import { detectSlashTrigger, insertSlashCommand } from './slashCommandProcessor.js';
|
|
9
|
-
|
|
10
|
-
export interface CommandBrowserState {
|
|
11
|
-
showCommandBrowser: boolean;
|
|
12
|
-
partialCommand: string;
|
|
13
|
-
commandArgs: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface CommandBrowserActions {
|
|
17
|
-
handleCommandSelect: (command: string, shouldSubmit: boolean, input: string, onSubmit: (value: string) => void) => string | null;
|
|
18
|
-
handleCommandBrowserCancel: () => void;
|
|
19
|
-
resetCommandBrowser: () => void;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function useCommandBrowserState(
|
|
23
|
-
input: string,
|
|
24
|
-
isProcessing: boolean
|
|
25
|
-
): CommandBrowserState & CommandBrowserActions {
|
|
26
|
-
const [showCommandBrowser, setShowCommandBrowser] = useState(false);
|
|
27
|
-
const [partialCommand, setPartialCommand] = useState('');
|
|
28
|
-
const [commandArgs, setCommandArgs] = useState('');
|
|
29
|
-
|
|
30
|
-
// Monitor input for '/' slash command trigger
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
if (isProcessing) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if (!input) {
|
|
37
|
-
if (showCommandBrowser) {
|
|
38
|
-
setShowCommandBrowser(false);
|
|
39
|
-
setPartialCommand('');
|
|
40
|
-
setCommandArgs('');
|
|
41
|
-
}
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const slashInfo = detectSlashTrigger(input);
|
|
46
|
-
|
|
47
|
-
if (slashInfo.detected && !showCommandBrowser) {
|
|
48
|
-
setShowCommandBrowser(true);
|
|
49
|
-
setPartialCommand(slashInfo.partialCommand);
|
|
50
|
-
setCommandArgs(slashInfo.args);
|
|
51
|
-
} else if (slashInfo.detected && showCommandBrowser) {
|
|
52
|
-
setPartialCommand(slashInfo.partialCommand);
|
|
53
|
-
setCommandArgs(slashInfo.args);
|
|
54
|
-
} else if (!slashInfo.detected && showCommandBrowser) {
|
|
55
|
-
setShowCommandBrowser(false);
|
|
56
|
-
setPartialCommand('');
|
|
57
|
-
setCommandArgs('');
|
|
58
|
-
}
|
|
59
|
-
}, [input, isProcessing, showCommandBrowser]);
|
|
60
|
-
|
|
61
|
-
const handleCommandSelect = useCallback(
|
|
62
|
-
(command: string, shouldSubmit: boolean, currentInput: string, onSubmit: (value: string) => void): string | null => {
|
|
63
|
-
setShowCommandBrowser(false);
|
|
64
|
-
setPartialCommand('');
|
|
65
|
-
setCommandArgs('');
|
|
66
|
-
|
|
67
|
-
if (shouldSubmit) {
|
|
68
|
-
onSubmit(command);
|
|
69
|
-
return null;
|
|
70
|
-
} else {
|
|
71
|
-
return insertSlashCommand(currentInput, command);
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
[]
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
const handleCommandBrowserCancel = useCallback(() => {
|
|
78
|
-
setShowCommandBrowser(false);
|
|
79
|
-
setPartialCommand('');
|
|
80
|
-
setCommandArgs('');
|
|
81
|
-
}, []);
|
|
82
|
-
|
|
83
|
-
const resetCommandBrowser = useCallback(() => {
|
|
84
|
-
setShowCommandBrowser(false);
|
|
85
|
-
setPartialCommand('');
|
|
86
|
-
setCommandArgs('');
|
|
87
|
-
}, []);
|
|
88
|
-
|
|
89
|
-
return {
|
|
90
|
-
showCommandBrowser,
|
|
91
|
-
partialCommand,
|
|
92
|
-
commandArgs,
|
|
93
|
-
handleCommandSelect,
|
|
94
|
-
handleCommandBrowserCancel,
|
|
95
|
-
resetCommandBrowser,
|
|
96
|
-
};
|
|
97
|
-
}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* useFileBrowserState Hook
|
|
3
|
-
*
|
|
4
|
-
* Manages file browser state and file list caching
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { useState, useEffect, useCallback } from 'react';
|
|
8
|
-
import { loadFileList, FileItem } from './useFileList.js';
|
|
9
|
-
import { detectAtTrigger, insertFilePaths } from './atFileProcessor.js';
|
|
10
|
-
import { logger } from '../../utils/logger.js';
|
|
11
|
-
|
|
12
|
-
export interface FileBrowserState {
|
|
13
|
-
showFileBrowser: boolean;
|
|
14
|
-
atPosition: number;
|
|
15
|
-
filterText: string;
|
|
16
|
-
cachedFileList: FileItem[];
|
|
17
|
-
isLoadingFiles: boolean;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface FileBrowserActions {
|
|
21
|
-
handleFileSelect: (filePaths: string[], input: string) => string;
|
|
22
|
-
handleFileBrowserCancel: () => void;
|
|
23
|
-
resetFileBrowser: () => void;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function useFileBrowserState(
|
|
27
|
-
input: string,
|
|
28
|
-
isProcessing: boolean
|
|
29
|
-
): FileBrowserState & FileBrowserActions {
|
|
30
|
-
const [showFileBrowser, setShowFileBrowser] = useState(false);
|
|
31
|
-
const [atPosition, setAtPosition] = useState(-1);
|
|
32
|
-
const [filterText, setFilterText] = useState('');
|
|
33
|
-
const [cachedFileList, setCachedFileList] = useState<FileItem[]>([]);
|
|
34
|
-
const [isLoadingFiles, setIsLoadingFiles] = useState(true);
|
|
35
|
-
|
|
36
|
-
// Load file list once on mount (background loading)
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
let mounted = true;
|
|
39
|
-
|
|
40
|
-
const preloadFiles = async () => {
|
|
41
|
-
try {
|
|
42
|
-
const files = await loadFileList();
|
|
43
|
-
if (mounted) {
|
|
44
|
-
setCachedFileList(files);
|
|
45
|
-
setIsLoadingFiles(false);
|
|
46
|
-
}
|
|
47
|
-
} catch (error) {
|
|
48
|
-
if (mounted) {
|
|
49
|
-
logger.error('Failed to preload file list', error);
|
|
50
|
-
setIsLoadingFiles(false);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
preloadFiles();
|
|
56
|
-
|
|
57
|
-
return () => {
|
|
58
|
-
mounted = false;
|
|
59
|
-
};
|
|
60
|
-
}, []);
|
|
61
|
-
|
|
62
|
-
// Monitor input for '@' trigger
|
|
63
|
-
useEffect(() => {
|
|
64
|
-
if (isProcessing) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const triggerInfo = detectAtTrigger(input);
|
|
69
|
-
|
|
70
|
-
if (triggerInfo.detected && !showFileBrowser) {
|
|
71
|
-
setShowFileBrowser(true);
|
|
72
|
-
setAtPosition(triggerInfo.position);
|
|
73
|
-
setFilterText(triggerInfo.filter);
|
|
74
|
-
} else if (triggerInfo.detected && showFileBrowser) {
|
|
75
|
-
setFilterText(triggerInfo.filter);
|
|
76
|
-
} else if (!triggerInfo.detected && showFileBrowser) {
|
|
77
|
-
setShowFileBrowser(false);
|
|
78
|
-
setAtPosition(-1);
|
|
79
|
-
setFilterText('');
|
|
80
|
-
}
|
|
81
|
-
}, [input, isProcessing, showFileBrowser]);
|
|
82
|
-
|
|
83
|
-
const handleFileSelect = useCallback(
|
|
84
|
-
(filePaths: string[], currentInput: string): string => {
|
|
85
|
-
const newInput = insertFilePaths(currentInput, atPosition, filterText.length, filePaths);
|
|
86
|
-
setShowFileBrowser(false);
|
|
87
|
-
setAtPosition(-1);
|
|
88
|
-
setFilterText('');
|
|
89
|
-
return newInput;
|
|
90
|
-
},
|
|
91
|
-
[atPosition, filterText.length]
|
|
92
|
-
);
|
|
93
|
-
|
|
94
|
-
const handleFileBrowserCancel = useCallback(() => {
|
|
95
|
-
setShowFileBrowser(false);
|
|
96
|
-
setAtPosition(-1);
|
|
97
|
-
setFilterText('');
|
|
98
|
-
}, []);
|
|
99
|
-
|
|
100
|
-
const resetFileBrowser = useCallback(() => {
|
|
101
|
-
setShowFileBrowser(false);
|
|
102
|
-
setAtPosition(-1);
|
|
103
|
-
setFilterText('');
|
|
104
|
-
}, []);
|
|
105
|
-
|
|
106
|
-
return {
|
|
107
|
-
showFileBrowser,
|
|
108
|
-
atPosition,
|
|
109
|
-
filterText,
|
|
110
|
-
cachedFileList,
|
|
111
|
-
isLoadingFiles,
|
|
112
|
-
handleFileSelect,
|
|
113
|
-
handleFileBrowserCancel,
|
|
114
|
-
resetFileBrowser,
|
|
115
|
-
};
|
|
116
|
-
}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* useFileList Hook
|
|
3
|
-
*
|
|
4
|
-
* Load and filter file list for file browser
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { useMemo } from 'react';
|
|
8
|
-
import { listFilesTool } from '../../tools/llm/simple/file-tools.js';
|
|
9
|
-
import { logger } from '../../utils/logger.js';
|
|
10
|
-
|
|
11
|
-
export interface FileItem {
|
|
12
|
-
name: string;
|
|
13
|
-
type: 'file' | 'directory';
|
|
14
|
-
path: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
interface UseFileListOptions {
|
|
18
|
-
filter?: string;
|
|
19
|
-
maxResults?: number;
|
|
20
|
-
cachedFiles?: FileItem[]; // Use pre-loaded file list for instant display
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface UseFileListResult {
|
|
24
|
-
files: FileItem[];
|
|
25
|
-
loading: boolean;
|
|
26
|
-
error: string | null;
|
|
27
|
-
totalCount: number;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Load and process file list from file system
|
|
32
|
-
* This should be called once at app startup and cached
|
|
33
|
-
*/
|
|
34
|
-
export async function loadFileList(): Promise<FileItem[]> {
|
|
35
|
-
try {
|
|
36
|
-
// Get recursive file list from current directory
|
|
37
|
-
const result = await listFilesTool.execute({ directory_path: '.', recursive: true });
|
|
38
|
-
|
|
39
|
-
if (!result.success) {
|
|
40
|
-
logger.error('Failed to load files', new Error(result.error || 'Unknown error'));
|
|
41
|
-
return [];
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Parse JSON result
|
|
45
|
-
const files = JSON.parse(result.result || '[]') as FileItem[];
|
|
46
|
-
|
|
47
|
-
// Filter out node_modules and hidden files/directories
|
|
48
|
-
const filteredFiles = files.filter((file) => {
|
|
49
|
-
const pathParts = file.path.split('/');
|
|
50
|
-
// Exclude node_modules, .git, and other common exclusions
|
|
51
|
-
return !pathParts.some((part) =>
|
|
52
|
-
part.startsWith('.') ||
|
|
53
|
-
part === 'node_modules' ||
|
|
54
|
-
part === 'dist' ||
|
|
55
|
-
part === 'build' ||
|
|
56
|
-
part === 'coverage'
|
|
57
|
-
);
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
// ============================================================
|
|
61
|
-
// TODO: Directory Navigation Feature
|
|
62
|
-
// ============================================================
|
|
63
|
-
// Currently, directories are excluded from the file browser
|
|
64
|
-
// because there's no directory processing logic implemented yet.
|
|
65
|
-
//
|
|
66
|
-
// To enable directory navigation in the future:
|
|
67
|
-
// 1. Remove or comment out the filter below
|
|
68
|
-
// 2. Implement directory selection handler in FileBrowser.tsx
|
|
69
|
-
// 3. Add logic to navigate into selected directory
|
|
70
|
-
// 4. Update atFileProcessor.ts to handle directory paths
|
|
71
|
-
//
|
|
72
|
-
// For now, only show files to prevent errors when directories
|
|
73
|
-
// are selected.
|
|
74
|
-
// ============================================================
|
|
75
|
-
const filesOnly = filteredFiles.filter((file) => file.type === 'file');
|
|
76
|
-
|
|
77
|
-
// Sort files by depth first (root files first), then alphabetically
|
|
78
|
-
filesOnly.sort((a, b) => {
|
|
79
|
-
// Count path depth (number of slashes)
|
|
80
|
-
const depthA = a.path.split('/').length - 1;
|
|
81
|
-
const depthB = b.path.split('/').length - 1;
|
|
82
|
-
|
|
83
|
-
// Sort by depth first (shallower paths come first)
|
|
84
|
-
if (depthA !== depthB) {
|
|
85
|
-
return depthA - depthB;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// Same depth - sort alphabetically
|
|
89
|
-
return a.path.localeCompare(b.path);
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
return filesOnly;
|
|
93
|
-
} catch (err) {
|
|
94
|
-
logger.error('Error loading file list', err);
|
|
95
|
-
return [];
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Custom hook to filter pre-loaded file list
|
|
101
|
-
* This hook expects cachedFiles to be provided for instant filtering
|
|
102
|
-
*/
|
|
103
|
-
export function useFileList(options: UseFileListOptions = {}): UseFileListResult {
|
|
104
|
-
const { filter = '', maxResults = 10, cachedFiles = [] } = options;
|
|
105
|
-
|
|
106
|
-
// Use cached files if provided, otherwise empty (no loading in this hook)
|
|
107
|
-
const allFiles = cachedFiles;
|
|
108
|
-
const loading = false; // Loading is handled externally
|
|
109
|
-
const error = null;
|
|
110
|
-
|
|
111
|
-
// Filter files based on search pattern (memoized for performance)
|
|
112
|
-
const filteredFiles = useMemo(() => {
|
|
113
|
-
if (!filter) return allFiles;
|
|
114
|
-
|
|
115
|
-
const lowerFilter = filter.toLowerCase();
|
|
116
|
-
return allFiles.filter((file) =>
|
|
117
|
-
file.path.toLowerCase().includes(lowerFilter)
|
|
118
|
-
);
|
|
119
|
-
}, [allFiles, filter]);
|
|
120
|
-
|
|
121
|
-
// Limit results (memoized)
|
|
122
|
-
const limitedFiles = useMemo(() => {
|
|
123
|
-
return filteredFiles.slice(0, maxResults);
|
|
124
|
-
}, [filteredFiles, maxResults]);
|
|
125
|
-
|
|
126
|
-
return {
|
|
127
|
-
files: limitedFiles,
|
|
128
|
-
loading,
|
|
129
|
-
error,
|
|
130
|
-
totalCount: filteredFiles.length,
|
|
131
|
-
};
|
|
132
|
-
}
|