orquesta-cli 0.1.12
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/.eslintrc.json +26 -0
- package/.prettierrc.json +10 -0
- package/CLAUDE.md +199 -0
- package/LICENSE +21 -0
- package/README.md +280 -0
- package/SECURITY.md +290 -0
- package/TEST_LOCAL.md +245 -0
- package/dist/agents/base/base-agent.d.ts +38 -0
- package/dist/agents/base/base-agent.d.ts.map +1 -0
- package/dist/agents/base/base-agent.js +69 -0
- package/dist/agents/base/base-agent.js.map +1 -0
- package/dist/agents/docs-search/index.d.ts +33 -0
- package/dist/agents/docs-search/index.d.ts.map +1 -0
- package/dist/agents/docs-search/index.js +244 -0
- package/dist/agents/docs-search/index.js.map +1 -0
- package/dist/agents/index.d.ts +4 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +4 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/planner/index.d.ts +17 -0
- package/dist/agents/planner/index.d.ts.map +1 -0
- package/dist/agents/planner/index.js +250 -0
- package/dist/agents/planner/index.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +144 -0
- package/dist/cli.js.map +1 -0
- package/dist/constants.d.ts +8 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +10 -0
- package/dist/constants.js.map +1 -0
- package/dist/core/compact/compact-manager.d.ts +22 -0
- package/dist/core/compact/compact-manager.d.ts.map +1 -0
- package/dist/core/compact/compact-manager.js +75 -0
- package/dist/core/compact/compact-manager.js.map +1 -0
- package/dist/core/compact/compact-prompts.d.ts +11 -0
- package/dist/core/compact/compact-prompts.d.ts.map +1 -0
- package/dist/core/compact/compact-prompts.js +90 -0
- package/dist/core/compact/compact-prompts.js.map +1 -0
- package/dist/core/compact/context-tracker.d.ts +28 -0
- package/dist/core/compact/context-tracker.d.ts.map +1 -0
- package/dist/core/compact/context-tracker.js +71 -0
- package/dist/core/compact/context-tracker.js.map +1 -0
- package/dist/core/compact/index.d.ts +4 -0
- package/dist/core/compact/index.d.ts.map +1 -0
- package/dist/core/compact/index.js +4 -0
- package/dist/core/compact/index.js.map +1 -0
- package/dist/core/config/config-manager.d.ts +44 -0
- package/dist/core/config/config-manager.d.ts.map +1 -0
- package/dist/core/config/config-manager.js +259 -0
- package/dist/core/config/config-manager.js.map +1 -0
- package/dist/core/config/index.d.ts +2 -0
- package/dist/core/config/index.d.ts.map +1 -0
- package/dist/core/config/index.js +2 -0
- package/dist/core/config/index.js.map +1 -0
- package/dist/core/docs-manager.d.ts +46 -0
- package/dist/core/docs-manager.d.ts.map +1 -0
- package/dist/core/docs-manager.js +475 -0
- package/dist/core/docs-manager.js.map +1 -0
- package/dist/core/git-auto-updater.d.ts +58 -0
- package/dist/core/git-auto-updater.d.ts.map +1 -0
- package/dist/core/git-auto-updater.js +374 -0
- package/dist/core/git-auto-updater.js.map +1 -0
- package/dist/core/llm/index.d.ts +2 -0
- package/dist/core/llm/index.d.ts.map +1 -0
- package/dist/core/llm/index.js +2 -0
- package/dist/core/llm/index.js.map +1 -0
- package/dist/core/llm/llm-client.d.ts +97 -0
- package/dist/core/llm/llm-client.d.ts.map +1 -0
- package/dist/core/llm/llm-client.js +1000 -0
- package/dist/core/llm/llm-client.js.map +1 -0
- package/dist/core/session/index.d.ts +2 -0
- package/dist/core/session/index.d.ts.map +1 -0
- package/dist/core/session/index.js +2 -0
- package/dist/core/session/index.js.map +1 -0
- package/dist/core/session/session-manager.d.ts +71 -0
- package/dist/core/session/session-manager.d.ts.map +1 -0
- package/dist/core/session/session-manager.js +250 -0
- package/dist/core/session/session-manager.js.map +1 -0
- package/dist/core/slash-command-handler.d.ts +31 -0
- package/dist/core/slash-command-handler.d.ts.map +1 -0
- package/dist/core/slash-command-handler.js +302 -0
- package/dist/core/slash-command-handler.js.map +1 -0
- package/dist/core/usage-tracker.d.ts +70 -0
- package/dist/core/usage-tracker.d.ts.map +1 -0
- package/dist/core/usage-tracker.js +251 -0
- package/dist/core/usage-tracker.js.map +1 -0
- package/dist/errors/base.d.ts +22 -0
- package/dist/errors/base.d.ts.map +1 -0
- package/dist/errors/base.js +43 -0
- package/dist/errors/base.js.map +1 -0
- package/dist/errors/file.d.ts +31 -0
- package/dist/errors/file.d.ts.map +1 -0
- package/dist/errors/file.js +110 -0
- package/dist/errors/file.js.map +1 -0
- package/dist/errors/index.d.ts +10 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +41 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/errors/llm.d.ts +26 -0
- package/dist/errors/llm.d.ts.map +1 -0
- package/dist/errors/llm.js +86 -0
- package/dist/errors/llm.js.map +1 -0
- package/dist/errors/network.d.ts +19 -0
- package/dist/errors/network.d.ts.map +1 -0
- package/dist/errors/network.js +82 -0
- package/dist/errors/network.js.map +1 -0
- package/dist/errors/validation.d.ts +19 -0
- package/dist/errors/validation.d.ts.map +1 -0
- package/dist/errors/validation.js +62 -0
- package/dist/errors/validation.js.map +1 -0
- package/dist/eval/eval-runner.d.ts +24 -0
- package/dist/eval/eval-runner.d.ts.map +1 -0
- package/dist/eval/eval-runner.js +309 -0
- package/dist/eval/eval-runner.js.map +1 -0
- package/dist/eval/index.d.ts +3 -0
- package/dist/eval/index.d.ts.map +1 -0
- package/dist/eval/index.js +3 -0
- package/dist/eval/index.js.map +1 -0
- package/dist/eval/types.d.ts +77 -0
- package/dist/eval/types.d.ts.map +1 -0
- package/dist/eval/types.js +2 -0
- package/dist/eval/types.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/orchestration/index.d.ts +4 -0
- package/dist/orchestration/index.d.ts.map +1 -0
- package/dist/orchestration/index.js +3 -0
- package/dist/orchestration/index.js.map +1 -0
- package/dist/orchestration/plan-executor.d.ts +28 -0
- package/dist/orchestration/plan-executor.d.ts.map +1 -0
- package/dist/orchestration/plan-executor.js +382 -0
- package/dist/orchestration/plan-executor.js.map +1 -0
- package/dist/orchestration/types.d.ts +66 -0
- package/dist/orchestration/types.d.ts.map +1 -0
- package/dist/orchestration/types.js +2 -0
- package/dist/orchestration/types.js.map +1 -0
- package/dist/orchestration/utils.d.ts +13 -0
- package/dist/orchestration/utils.d.ts.map +1 -0
- package/dist/orchestration/utils.js +78 -0
- package/dist/orchestration/utils.js.map +1 -0
- package/dist/orquesta/connection.d.ts +35 -0
- package/dist/orquesta/connection.d.ts.map +1 -0
- package/dist/orquesta/connection.js +189 -0
- package/dist/orquesta/connection.js.map +1 -0
- package/dist/prompts/agents/docs-search-decision.d.ts +6 -0
- package/dist/prompts/agents/docs-search-decision.d.ts.map +1 -0
- package/dist/prompts/agents/docs-search-decision.js +46 -0
- package/dist/prompts/agents/docs-search-decision.js.map +1 -0
- package/dist/prompts/agents/docs-search.d.ts +4 -0
- package/dist/prompts/agents/docs-search.d.ts.map +1 -0
- package/dist/prompts/agents/docs-search.js +70 -0
- package/dist/prompts/agents/docs-search.js.map +1 -0
- package/dist/prompts/agents/planning.d.ts +4 -0
- package/dist/prompts/agents/planning.d.ts.map +1 -0
- package/dist/prompts/agents/planning.js +119 -0
- package/dist/prompts/agents/planning.js.map +1 -0
- package/dist/prompts/index.d.ts +10 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +10 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/shared/codebase-rules.d.ts +4 -0
- package/dist/prompts/shared/codebase-rules.d.ts.map +1 -0
- package/dist/prompts/shared/codebase-rules.js +16 -0
- package/dist/prompts/shared/codebase-rules.js.map +1 -0
- package/dist/prompts/shared/git-rules.d.ts +2 -0
- package/dist/prompts/shared/git-rules.d.ts.map +1 -0
- package/dist/prompts/shared/git-rules.js +87 -0
- package/dist/prompts/shared/git-rules.js.map +1 -0
- package/dist/prompts/shared/language-rules.d.ts +4 -0
- package/dist/prompts/shared/language-rules.d.ts.map +1 -0
- package/dist/prompts/shared/language-rules.js +22 -0
- package/dist/prompts/shared/language-rules.js.map +1 -0
- package/dist/prompts/shared/tool-usage.d.ts +12 -0
- package/dist/prompts/shared/tool-usage.d.ts.map +1 -0
- package/dist/prompts/shared/tool-usage.js +51 -0
- package/dist/prompts/shared/tool-usage.js.map +1 -0
- package/dist/prompts/system/compact.d.ts +3 -0
- package/dist/prompts/system/compact.d.ts.map +1 -0
- package/dist/prompts/system/compact.js +73 -0
- package/dist/prompts/system/compact.js.map +1 -0
- package/dist/prompts/system/plan-execute.d.ts +3 -0
- package/dist/prompts/system/plan-execute.d.ts.map +1 -0
- package/dist/prompts/system/plan-execute.js +83 -0
- package/dist/prompts/system/plan-execute.js.map +1 -0
- package/dist/tools/browser/browser-client.d.ts +107 -0
- package/dist/tools/browser/browser-client.d.ts.map +1 -0
- package/dist/tools/browser/browser-client.js +958 -0
- package/dist/tools/browser/browser-client.js.map +1 -0
- package/dist/tools/browser/browser-tools.d.ts +17 -0
- package/dist/tools/browser/browser-tools.d.ts.map +1 -0
- package/dist/tools/browser/browser-tools.js +972 -0
- package/dist/tools/browser/browser-tools.js.map +1 -0
- package/dist/tools/browser/index.d.ts +7 -0
- package/dist/tools/browser/index.d.ts.map +1 -0
- package/dist/tools/browser/index.js +17 -0
- package/dist/tools/browser/index.js.map +1 -0
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +4 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/llm/agents/docs-search-tools.d.ts +17 -0
- package/dist/tools/llm/agents/docs-search-tools.d.ts.map +1 -0
- package/dist/tools/llm/agents/docs-search-tools.js +265 -0
- package/dist/tools/llm/agents/docs-search-tools.js.map +1 -0
- package/dist/tools/llm/agents/index.d.ts +4 -0
- package/dist/tools/llm/agents/index.d.ts.map +1 -0
- package/dist/tools/llm/agents/index.js +3 -0
- package/dist/tools/llm/agents/index.js.map +1 -0
- package/dist/tools/llm/index.d.ts +3 -0
- package/dist/tools/llm/index.d.ts.map +1 -0
- package/dist/tools/llm/index.js +3 -0
- package/dist/tools/llm/index.js.map +1 -0
- package/dist/tools/llm/simple/ask-user-tool.d.ts +5 -0
- package/dist/tools/llm/simple/ask-user-tool.d.ts.map +1 -0
- package/dist/tools/llm/simple/ask-user-tool.js +7 -0
- package/dist/tools/llm/simple/ask-user-tool.js.map +1 -0
- package/dist/tools/llm/simple/background-bash-tool.d.ts +30 -0
- package/dist/tools/llm/simple/background-bash-tool.d.ts.map +1 -0
- package/dist/tools/llm/simple/background-bash-tool.js +323 -0
- package/dist/tools/llm/simple/background-bash-tool.js.map +1 -0
- package/dist/tools/llm/simple/background-powershell-tool.d.ts +30 -0
- package/dist/tools/llm/simple/background-powershell-tool.d.ts.map +1 -0
- package/dist/tools/llm/simple/background-powershell-tool.js +305 -0
- package/dist/tools/llm/simple/background-powershell-tool.js.map +1 -0
- package/dist/tools/llm/simple/bash-tool.d.ts +4 -0
- package/dist/tools/llm/simple/bash-tool.d.ts.map +1 -0
- package/dist/tools/llm/simple/bash-tool.js +178 -0
- package/dist/tools/llm/simple/bash-tool.js.map +1 -0
- package/dist/tools/llm/simple/docs-search-agent-tool.d.ts +6 -0
- package/dist/tools/llm/simple/docs-search-agent-tool.d.ts.map +1 -0
- package/dist/tools/llm/simple/docs-search-agent-tool.js +104 -0
- package/dist/tools/llm/simple/docs-search-agent-tool.js.map +1 -0
- package/dist/tools/llm/simple/file-tools.d.ts +13 -0
- package/dist/tools/llm/simple/file-tools.d.ts.map +1 -0
- package/dist/tools/llm/simple/file-tools.js +785 -0
- package/dist/tools/llm/simple/file-tools.js.map +1 -0
- package/dist/tools/llm/simple/final-response-tool.d.ts +12 -0
- package/dist/tools/llm/simple/final-response-tool.d.ts.map +1 -0
- package/dist/tools/llm/simple/final-response-tool.js +107 -0
- package/dist/tools/llm/simple/final-response-tool.js.map +1 -0
- package/dist/tools/llm/simple/index.d.ts +11 -0
- package/dist/tools/llm/simple/index.d.ts.map +1 -0
- package/dist/tools/llm/simple/index.js +20 -0
- package/dist/tools/llm/simple/index.js.map +1 -0
- package/dist/tools/llm/simple/planning-tools.d.ts +5 -0
- package/dist/tools/llm/simple/planning-tools.d.ts.map +1 -0
- package/dist/tools/llm/simple/planning-tools.js +117 -0
- package/dist/tools/llm/simple/planning-tools.js.map +1 -0
- package/dist/tools/llm/simple/powershell-tool.d.ts +4 -0
- package/dist/tools/llm/simple/powershell-tool.d.ts.map +1 -0
- package/dist/tools/llm/simple/powershell-tool.js +178 -0
- package/dist/tools/llm/simple/powershell-tool.js.map +1 -0
- package/dist/tools/llm/simple/simple-tool-executor.d.ts +38 -0
- package/dist/tools/llm/simple/simple-tool-executor.d.ts.map +1 -0
- package/dist/tools/llm/simple/simple-tool-executor.js +134 -0
- package/dist/tools/llm/simple/simple-tool-executor.js.map +1 -0
- package/dist/tools/llm/simple/todo-tools.d.ts +15 -0
- package/dist/tools/llm/simple/todo-tools.d.ts.map +1 -0
- package/dist/tools/llm/simple/todo-tools.js +145 -0
- package/dist/tools/llm/simple/todo-tools.js.map +1 -0
- package/dist/tools/llm/simple/user-interaction-tools.d.ts +22 -0
- package/dist/tools/llm/simple/user-interaction-tools.d.ts.map +1 -0
- package/dist/tools/llm/simple/user-interaction-tools.js +168 -0
- package/dist/tools/llm/simple/user-interaction-tools.js.map +1 -0
- package/dist/tools/office/common/constants.d.ts +194 -0
- package/dist/tools/office/common/constants.d.ts.map +1 -0
- package/dist/tools/office/common/constants.js +169 -0
- package/dist/tools/office/common/constants.js.map +1 -0
- package/dist/tools/office/common/index.d.ts +4 -0
- package/dist/tools/office/common/index.d.ts.map +1 -0
- package/dist/tools/office/common/index.js +3 -0
- package/dist/tools/office/common/index.js.map +1 -0
- package/dist/tools/office/common/types.d.ts +82 -0
- package/dist/tools/office/common/types.d.ts.map +1 -0
- package/dist/tools/office/common/types.js +2 -0
- package/dist/tools/office/common/types.js.map +1 -0
- package/dist/tools/office/common/utils.d.ts +14 -0
- package/dist/tools/office/common/utils.d.ts.map +1 -0
- package/dist/tools/office/common/utils.js +58 -0
- package/dist/tools/office/common/utils.js.map +1 -0
- package/dist/tools/office/excel-client.d.ts +123 -0
- package/dist/tools/office/excel-client.d.ts.map +1 -0
- package/dist/tools/office/excel-client.js +1037 -0
- package/dist/tools/office/excel-client.js.map +1 -0
- package/dist/tools/office/excel-tools/cells.d.ts +10 -0
- package/dist/tools/office/excel-tools/cells.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/cells.js +279 -0
- package/dist/tools/office/excel-tools/cells.js.map +1 -0
- package/dist/tools/office/excel-tools/charts.d.ts +6 -0
- package/dist/tools/office/excel-tools/charts.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/charts.js +124 -0
- package/dist/tools/office/excel-tools/charts.js.map +1 -0
- package/dist/tools/office/excel-tools/comments.d.ts +6 -0
- package/dist/tools/office/excel-tools/comments.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/comments.js +114 -0
- package/dist/tools/office/excel-tools/comments.js.map +1 -0
- package/dist/tools/office/excel-tools/data-ops.d.ts +10 -0
- package/dist/tools/office/excel-tools/data-ops.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/data-ops.js +266 -0
- package/dist/tools/office/excel-tools/data-ops.js.map +1 -0
- package/dist/tools/office/excel-tools/export.d.ts +5 -0
- package/dist/tools/office/excel-tools/export.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/export.js +75 -0
- package/dist/tools/office/excel-tools/export.js.map +1 -0
- package/dist/tools/office/excel-tools/formatting.d.ts +10 -0
- package/dist/tools/office/excel-tools/formatting.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/formatting.js +276 -0
- package/dist/tools/office/excel-tools/formatting.js.map +1 -0
- package/dist/tools/office/excel-tools/index.d.ts +16 -0
- package/dist/tools/office/excel-tools/index.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/index.js +42 -0
- package/dist/tools/office/excel-tools/index.js.map +1 -0
- package/dist/tools/office/excel-tools/launch.d.ts +10 -0
- package/dist/tools/office/excel-tools/launch.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/launch.js +248 -0
- package/dist/tools/office/excel-tools/launch.js.map +1 -0
- package/dist/tools/office/excel-tools/media.d.ts +5 -0
- package/dist/tools/office/excel-tools/media.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/media.js +84 -0
- package/dist/tools/office/excel-tools/media.js.map +1 -0
- package/dist/tools/office/excel-tools/named-ranges.d.ts +6 -0
- package/dist/tools/office/excel-tools/named-ranges.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/named-ranges.js +113 -0
- package/dist/tools/office/excel-tools/named-ranges.js.map +1 -0
- package/dist/tools/office/excel-tools/protection.d.ts +5 -0
- package/dist/tools/office/excel-tools/protection.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/protection.js +75 -0
- package/dist/tools/office/excel-tools/protection.js.map +1 -0
- package/dist/tools/office/excel-tools/rows-columns.d.ts +11 -0
- package/dist/tools/office/excel-tools/rows-columns.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/rows-columns.js +293 -0
- package/dist/tools/office/excel-tools/rows-columns.js.map +1 -0
- package/dist/tools/office/excel-tools/sheets.d.ts +8 -0
- package/dist/tools/office/excel-tools/sheets.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/sheets.js +177 -0
- package/dist/tools/office/excel-tools/sheets.js.map +1 -0
- package/dist/tools/office/excel-tools/validation.d.ts +7 -0
- package/dist/tools/office/excel-tools/validation.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/validation.js +175 -0
- package/dist/tools/office/excel-tools/validation.js.map +1 -0
- package/dist/tools/office/excel-tools.d.ts +3 -0
- package/dist/tools/office/excel-tools.d.ts.map +1 -0
- package/dist/tools/office/excel-tools.js +3 -0
- package/dist/tools/office/excel-tools.js.map +1 -0
- package/dist/tools/office/index.d.ts +6 -0
- package/dist/tools/office/index.d.ts.map +1 -0
- package/dist/tools/office/index.js +9 -0
- package/dist/tools/office/index.js.map +1 -0
- package/dist/tools/office/office-client-base.d.ts +31 -0
- package/dist/tools/office/office-client-base.d.ts.map +1 -0
- package/dist/tools/office/office-client-base.js +154 -0
- package/dist/tools/office/office-client-base.js.map +1 -0
- package/dist/tools/office/office-client.d.ts +196 -0
- package/dist/tools/office/office-client.d.ts.map +1 -0
- package/dist/tools/office/office-client.js +200 -0
- package/dist/tools/office/office-client.js.map +1 -0
- package/dist/tools/office/powerpoint-client.d.ts +135 -0
- package/dist/tools/office/powerpoint-client.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-client.js +1136 -0
- package/dist/tools/office/powerpoint-client.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/effects.d.ts +9 -0
- package/dist/tools/office/powerpoint-tools/effects.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/effects.js +246 -0
- package/dist/tools/office/powerpoint-tools/effects.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/export.d.ts +6 -0
- package/dist/tools/office/powerpoint-tools/export.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/export.js +108 -0
- package/dist/tools/office/powerpoint-tools/export.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/index.d.ts +13 -0
- package/dist/tools/office/powerpoint-tools/index.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/index.js +33 -0
- package/dist/tools/office/powerpoint-tools/index.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/launch.d.ts +9 -0
- package/dist/tools/office/powerpoint-tools/launch.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/launch.js +214 -0
- package/dist/tools/office/powerpoint-tools/launch.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/media.d.ts +8 -0
- package/dist/tools/office/powerpoint-tools/media.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/media.js +211 -0
- package/dist/tools/office/powerpoint-tools/media.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/notes.d.ts +8 -0
- package/dist/tools/office/powerpoint-tools/notes.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/notes.js +171 -0
- package/dist/tools/office/powerpoint-tools/notes.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/sections.d.ts +6 -0
- package/dist/tools/office/powerpoint-tools/sections.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/sections.js +104 -0
- package/dist/tools/office/powerpoint-tools/sections.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/shapes.d.ts +22 -0
- package/dist/tools/office/powerpoint-tools/shapes.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/shapes.js +681 -0
- package/dist/tools/office/powerpoint-tools/shapes.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/slides.d.ts +11 -0
- package/dist/tools/office/powerpoint-tools/slides.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/slides.js +283 -0
- package/dist/tools/office/powerpoint-tools/slides.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/tables.d.ts +6 -0
- package/dist/tools/office/powerpoint-tools/tables.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/tables.js +132 -0
- package/dist/tools/office/powerpoint-tools/tables.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/text.d.ts +12 -0
- package/dist/tools/office/powerpoint-tools/text.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/text.js +366 -0
- package/dist/tools/office/powerpoint-tools/text.js.map +1 -0
- package/dist/tools/office/powerpoint-tools.d.ts +3 -0
- package/dist/tools/office/powerpoint-tools.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools.js +3 -0
- package/dist/tools/office/powerpoint-tools.js.map +1 -0
- package/dist/tools/office/word-client.d.ts +147 -0
- package/dist/tools/office/word-client.d.ts.map +1 -0
- package/dist/tools/office/word-client.js +1341 -0
- package/dist/tools/office/word-client.js.map +1 -0
- package/dist/tools/office/word-tools/bookmarks.d.ts +7 -0
- package/dist/tools/office/word-tools/bookmarks.d.ts.map +1 -0
- package/dist/tools/office/word-tools/bookmarks.js +146 -0
- package/dist/tools/office/word-tools/bookmarks.js.map +1 -0
- package/dist/tools/office/word-tools/comments.d.ts +7 -0
- package/dist/tools/office/word-tools/comments.d.ts.map +1 -0
- package/dist/tools/office/word-tools/comments.js +146 -0
- package/dist/tools/office/word-tools/comments.js.map +1 -0
- package/dist/tools/office/word-tools/content.d.ts +7 -0
- package/dist/tools/office/word-tools/content.d.ts.map +1 -0
- package/dist/tools/office/word-tools/content.js +168 -0
- package/dist/tools/office/word-tools/content.js.map +1 -0
- package/dist/tools/office/word-tools/export.d.ts +5 -0
- package/dist/tools/office/word-tools/export.d.ts.map +1 -0
- package/dist/tools/office/word-tools/export.js +73 -0
- package/dist/tools/office/word-tools/export.js.map +1 -0
- package/dist/tools/office/word-tools/formatting.d.ts +6 -0
- package/dist/tools/office/word-tools/formatting.d.ts.map +1 -0
- package/dist/tools/office/word-tools/formatting.js +129 -0
- package/dist/tools/office/word-tools/formatting.js.map +1 -0
- package/dist/tools/office/word-tools/headers-footers.d.ts +6 -0
- package/dist/tools/office/word-tools/headers-footers.d.ts.map +1 -0
- package/dist/tools/office/word-tools/headers-footers.js +117 -0
- package/dist/tools/office/word-tools/headers-footers.js.map +1 -0
- package/dist/tools/office/word-tools/index.d.ts +16 -0
- package/dist/tools/office/word-tools/index.d.ts.map +1 -0
- package/dist/tools/office/word-tools/index.js +45 -0
- package/dist/tools/office/word-tools/index.js.map +1 -0
- package/dist/tools/office/word-tools/launch.d.ts +10 -0
- package/dist/tools/office/word-tools/launch.d.ts.map +1 -0
- package/dist/tools/office/word-tools/launch.js +255 -0
- package/dist/tools/office/word-tools/launch.js.map +1 -0
- package/dist/tools/office/word-tools/lists.d.ts +5 -0
- package/dist/tools/office/word-tools/lists.d.ts.map +1 -0
- package/dist/tools/office/word-tools/lists.js +73 -0
- package/dist/tools/office/word-tools/lists.js.map +1 -0
- package/dist/tools/office/word-tools/navigation.d.ts +5 -0
- package/dist/tools/office/word-tools/navigation.d.ts.map +1 -0
- package/dist/tools/office/word-tools/navigation.js +85 -0
- package/dist/tools/office/word-tools/navigation.js.map +1 -0
- package/dist/tools/office/word-tools/page-setup.d.ts +7 -0
- package/dist/tools/office/word-tools/page-setup.d.ts.map +1 -0
- package/dist/tools/office/word-tools/page-setup.js +152 -0
- package/dist/tools/office/word-tools/page-setup.js.map +1 -0
- package/dist/tools/office/word-tools/tables.d.ts +8 -0
- package/dist/tools/office/word-tools/tables.d.ts.map +1 -0
- package/dist/tools/office/word-tools/tables.js +197 -0
- package/dist/tools/office/word-tools/tables.js.map +1 -0
- package/dist/tools/office/word-tools/text.d.ts +9 -0
- package/dist/tools/office/word-tools/text.d.ts.map +1 -0
- package/dist/tools/office/word-tools/text.js +235 -0
- package/dist/tools/office/word-tools/text.js.map +1 -0
- package/dist/tools/office/word-tools/undo-redo.d.ts +5 -0
- package/dist/tools/office/word-tools/undo-redo.d.ts.map +1 -0
- package/dist/tools/office/word-tools/undo-redo.js +73 -0
- package/dist/tools/office/word-tools/undo-redo.js.map +1 -0
- package/dist/tools/office/word-tools/watermarks.d.ts +5 -0
- package/dist/tools/office/word-tools/watermarks.d.ts.map +1 -0
- package/dist/tools/office/word-tools/watermarks.js +81 -0
- package/dist/tools/office/word-tools/watermarks.js.map +1 -0
- package/dist/tools/office/word-tools.d.ts +3 -0
- package/dist/tools/office/word-tools.d.ts.map +1 -0
- package/dist/tools/office/word-tools.js +3 -0
- package/dist/tools/office/word-tools.js.map +1 -0
- package/dist/tools/registry.d.ts +53 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +278 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/types.d.ts +88 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +19 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/types/index.d.ts +126 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/ui/PlanExecuteView.d.ts +11 -0
- package/dist/ui/PlanExecuteView.d.ts.map +1 -0
- package/dist/ui/PlanExecuteView.js +29 -0
- package/dist/ui/PlanExecuteView.js.map +1 -0
- package/dist/ui/TodoPanel.d.ts +13 -0
- package/dist/ui/TodoPanel.d.ts.map +1 -0
- package/dist/ui/TodoPanel.js +135 -0
- package/dist/ui/TodoPanel.js.map +1 -0
- package/dist/ui/UpdateNotification.d.ts +13 -0
- package/dist/ui/UpdateNotification.d.ts.map +1 -0
- package/dist/ui/UpdateNotification.js +42 -0
- package/dist/ui/UpdateNotification.js.map +1 -0
- package/dist/ui/components/ActivityIndicator.d.ts +25 -0
- package/dist/ui/components/ActivityIndicator.d.ts.map +1 -0
- package/dist/ui/components/ActivityIndicator.js +115 -0
- package/dist/ui/components/ActivityIndicator.js.map +1 -0
- package/dist/ui/components/CommandBrowser.d.ts +10 -0
- package/dist/ui/components/CommandBrowser.d.ts.map +1 -0
- package/dist/ui/components/CommandBrowser.js +53 -0
- package/dist/ui/components/CommandBrowser.js.map +1 -0
- package/dist/ui/components/CustomTextInput.d.ts +13 -0
- package/dist/ui/components/CustomTextInput.d.ts.map +1 -0
- package/dist/ui/components/CustomTextInput.js +245 -0
- package/dist/ui/components/CustomTextInput.js.map +1 -0
- package/dist/ui/components/DocsSearchProgress.d.ts +13 -0
- package/dist/ui/components/DocsSearchProgress.d.ts.map +1 -0
- package/dist/ui/components/DocsSearchProgress.js +37 -0
- package/dist/ui/components/DocsSearchProgress.js.map +1 -0
- package/dist/ui/components/FileBrowser.d.ts +11 -0
- package/dist/ui/components/FileBrowser.d.ts.map +1 -0
- package/dist/ui/components/FileBrowser.js +45 -0
- package/dist/ui/components/FileBrowser.js.map +1 -0
- package/dist/ui/components/LLMSetupWizard.d.ts +8 -0
- package/dist/ui/components/LLMSetupWizard.d.ts.map +1 -0
- package/dist/ui/components/LLMSetupWizard.js +192 -0
- package/dist/ui/components/LLMSetupWizard.js.map +1 -0
- package/dist/ui/components/Logo.d.ts +19 -0
- package/dist/ui/components/Logo.d.ts.map +1 -0
- package/dist/ui/components/Logo.js +55 -0
- package/dist/ui/components/Logo.js.map +1 -0
- package/dist/ui/components/MarkdownRenderer.d.ts +9 -0
- package/dist/ui/components/MarkdownRenderer.d.ts.map +1 -0
- package/dist/ui/components/MarkdownRenderer.js +198 -0
- package/dist/ui/components/MarkdownRenderer.js.map +1 -0
- package/dist/ui/components/ModelSelector.d.ts +8 -0
- package/dist/ui/components/ModelSelector.d.ts.map +1 -0
- package/dist/ui/components/ModelSelector.js +111 -0
- package/dist/ui/components/ModelSelector.js.map +1 -0
- package/dist/ui/components/PlanExecuteApp.d.ts +23 -0
- package/dist/ui/components/PlanExecuteApp.d.ts.map +1 -0
- package/dist/ui/components/PlanExecuteApp.js +1324 -0
- package/dist/ui/components/PlanExecuteApp.js.map +1 -0
- package/dist/ui/components/ProgressBar.d.ts +10 -0
- package/dist/ui/components/ProgressBar.d.ts.map +1 -0
- package/dist/ui/components/ProgressBar.js +26 -0
- package/dist/ui/components/ProgressBar.js.map +1 -0
- package/dist/ui/components/StatusBar.d.ts +23 -0
- package/dist/ui/components/StatusBar.d.ts.map +1 -0
- package/dist/ui/components/StatusBar.js +162 -0
- package/dist/ui/components/StatusBar.js.map +1 -0
- package/dist/ui/components/ThinkingIndicator.d.ts +14 -0
- package/dist/ui/components/ThinkingIndicator.d.ts.map +1 -0
- package/dist/ui/components/ThinkingIndicator.js +63 -0
- package/dist/ui/components/ThinkingIndicator.js.map +1 -0
- package/dist/ui/components/TodoListView.d.ts +11 -0
- package/dist/ui/components/TodoListView.d.ts.map +1 -0
- package/dist/ui/components/TodoListView.js +69 -0
- package/dist/ui/components/TodoListView.js.map +1 -0
- package/dist/ui/components/ToolSelector.d.ts +7 -0
- package/dist/ui/components/ToolSelector.d.ts.map +1 -0
- package/dist/ui/components/ToolSelector.js +111 -0
- package/dist/ui/components/ToolSelector.js.map +1 -0
- package/dist/ui/components/dialogs/ApprovalDialog.d.ts +13 -0
- package/dist/ui/components/dialogs/ApprovalDialog.d.ts.map +1 -0
- package/dist/ui/components/dialogs/ApprovalDialog.js +173 -0
- package/dist/ui/components/dialogs/ApprovalDialog.js.map +1 -0
- package/dist/ui/components/dialogs/AskUserDialog.d.ts +9 -0
- package/dist/ui/components/dialogs/AskUserDialog.d.ts.map +1 -0
- package/dist/ui/components/dialogs/AskUserDialog.js +111 -0
- package/dist/ui/components/dialogs/AskUserDialog.js.map +1 -0
- package/dist/ui/components/dialogs/DocsBrowser.d.ts +8 -0
- package/dist/ui/components/dialogs/DocsBrowser.d.ts.map +1 -0
- package/dist/ui/components/dialogs/DocsBrowser.js +127 -0
- package/dist/ui/components/dialogs/DocsBrowser.js.map +1 -0
- package/dist/ui/components/dialogs/SettingsDialog.d.ts +10 -0
- package/dist/ui/components/dialogs/SettingsDialog.d.ts.map +1 -0
- package/dist/ui/components/dialogs/SettingsDialog.js +563 -0
- package/dist/ui/components/dialogs/SettingsDialog.js.map +1 -0
- package/dist/ui/components/dialogs/index.d.ts +4 -0
- package/dist/ui/components/dialogs/index.d.ts.map +1 -0
- package/dist/ui/components/dialogs/index.js +4 -0
- package/dist/ui/components/dialogs/index.js.map +1 -0
- package/dist/ui/components/index.d.ts +12 -0
- package/dist/ui/components/index.d.ts.map +1 -0
- package/dist/ui/components/index.js +9 -0
- package/dist/ui/components/index.js.map +1 -0
- package/dist/ui/components/panels/LogPanel.d.ts +7 -0
- package/dist/ui/components/panels/LogPanel.d.ts.map +1 -0
- package/dist/ui/components/panels/LogPanel.js +280 -0
- package/dist/ui/components/panels/LogPanel.js.map +1 -0
- package/dist/ui/components/panels/SessionPanel.d.ts +8 -0
- package/dist/ui/components/panels/SessionPanel.d.ts.map +1 -0
- package/dist/ui/components/panels/SessionPanel.js +81 -0
- package/dist/ui/components/panels/SessionPanel.js.map +1 -0
- package/dist/ui/components/panels/index.d.ts +4 -0
- package/dist/ui/components/panels/index.d.ts.map +1 -0
- package/dist/ui/components/panels/index.js +4 -0
- package/dist/ui/components/panels/index.js.map +1 -0
- package/dist/ui/components/views/ChatView.d.ts +12 -0
- package/dist/ui/components/views/ChatView.d.ts.map +1 -0
- package/dist/ui/components/views/ChatView.js +289 -0
- package/dist/ui/components/views/ChatView.js.map +1 -0
- package/dist/ui/components/views/index.d.ts +2 -0
- package/dist/ui/components/views/index.d.ts.map +1 -0
- package/dist/ui/components/views/index.js +2 -0
- package/dist/ui/components/views/index.js.map +1 -0
- package/dist/ui/contexts/TokenContext.d.ts +29 -0
- package/dist/ui/contexts/TokenContext.d.ts.map +1 -0
- package/dist/ui/contexts/TokenContext.js +79 -0
- package/dist/ui/contexts/TokenContext.js.map +1 -0
- package/dist/ui/hooks/atFileProcessor.d.ts +15 -0
- package/dist/ui/hooks/atFileProcessor.d.ts.map +1 -0
- package/dist/ui/hooks/atFileProcessor.js +88 -0
- package/dist/ui/hooks/atFileProcessor.js.map +1 -0
- package/dist/ui/hooks/index.d.ts +8 -0
- package/dist/ui/hooks/index.d.ts.map +1 -0
- package/dist/ui/hooks/index.js +8 -0
- package/dist/ui/hooks/index.js.map +1 -0
- package/dist/ui/hooks/slashCommandProcessor.d.ts +21 -0
- package/dist/ui/hooks/slashCommandProcessor.d.ts.map +1 -0
- package/dist/ui/hooks/slashCommandProcessor.js +100 -0
- package/dist/ui/hooks/slashCommandProcessor.js.map +1 -0
- package/dist/ui/hooks/useCommandBrowserState.d.ts +12 -0
- package/dist/ui/hooks/useCommandBrowserState.d.ts.map +1 -0
- package/dist/ui/hooks/useCommandBrowserState.js +66 -0
- package/dist/ui/hooks/useCommandBrowserState.js.map +1 -0
- package/dist/ui/hooks/useFileBrowserState.d.ts +15 -0
- package/dist/ui/hooks/useFileBrowserState.d.ts.map +1 -0
- package/dist/ui/hooks/useFileBrowserState.js +80 -0
- package/dist/ui/hooks/useFileBrowserState.js.map +1 -0
- package/dist/ui/hooks/useFileList.d.ts +20 -0
- package/dist/ui/hooks/useFileList.d.ts.map +1 -0
- package/dist/ui/hooks/useFileList.js +57 -0
- package/dist/ui/hooks/useFileList.js.map +1 -0
- package/dist/ui/hooks/useInputHistory.d.ts +9 -0
- package/dist/ui/hooks/useInputHistory.d.ts.map +1 -0
- package/dist/ui/hooks/useInputHistory.js +68 -0
- package/dist/ui/hooks/useInputHistory.js.map +1 -0
- package/dist/ui/hooks/usePlanExecution.d.ts +8 -0
- package/dist/ui/hooks/usePlanExecution.d.ts.map +1 -0
- package/dist/ui/hooks/usePlanExecution.js +214 -0
- package/dist/ui/hooks/usePlanExecution.js.map +1 -0
- package/dist/ui/index.d.ts +7 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +7 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/ink-entry.d.ts +3 -0
- package/dist/ui/ink-entry.d.ts.map +1 -0
- package/dist/ui/ink-entry.js +22 -0
- package/dist/ui/ink-entry.js.map +1 -0
- package/dist/utils/env-filter.d.ts +4 -0
- package/dist/utils/env-filter.d.ts.map +1 -0
- package/dist/utils/env-filter.js +101 -0
- package/dist/utils/env-filter.js.map +1 -0
- package/dist/utils/file-system.d.ts +9 -0
- package/dist/utils/file-system.d.ts.map +1 -0
- package/dist/utils/file-system.js +99 -0
- package/dist/utils/file-system.js.map +1 -0
- package/dist/utils/git-utils.d.ts +2 -0
- package/dist/utils/git-utils.d.ts.map +1 -0
- package/dist/utils/git-utils.js +16 -0
- package/dist/utils/git-utils.js.map +1 -0
- package/dist/utils/json-stream-logger.d.ts +74 -0
- package/dist/utils/json-stream-logger.d.ts.map +1 -0
- package/dist/utils/json-stream-logger.js +808 -0
- package/dist/utils/json-stream-logger.js.map +1 -0
- package/dist/utils/logger.d.ts +152 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +1672 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/platform-utils.d.ts +19 -0
- package/dist/utils/platform-utils.d.ts.map +1 -0
- package/dist/utils/platform-utils.js +134 -0
- package/dist/utils/platform-utils.js.map +1 -0
- package/dist/utils/wsl-utils.d.ts +4 -0
- package/dist/utils/wsl-utils.d.ts.map +1 -0
- package/dist/utils/wsl-utils.js +72 -0
- package/dist/utils/wsl-utils.js.map +1 -0
- package/electron.vite.config.ts +63 -0
- package/google374b9eba0c52b043.html +1 -0
- package/package.json +122 -0
- package/src/agents/base/base-agent.ts +159 -0
- package/src/agents/docs-search/index.ts +365 -0
- package/src/agents/index.ts +34 -0
- package/src/agents/planner/index.ts +544 -0
- package/src/cli.ts +201 -0
- package/src/constants.ts +47 -0
- package/src/core/compact/compact-manager.ts +160 -0
- package/src/core/compact/compact-prompts.ts +150 -0
- package/src/core/compact/context-tracker.ts +164 -0
- package/src/core/compact/index.ts +25 -0
- package/src/core/config/config-manager.ts +460 -0
- package/src/core/config/index.ts +5 -0
- package/src/core/docs-manager.ts +678 -0
- package/src/core/llm/index.ts +7 -0
- package/src/core/llm/llm-client.ts +1550 -0
- package/src/core/session/index.ts +5 -0
- package/src/core/session/session-manager.ts +464 -0
- package/src/core/slash-command-handler.ts +410 -0
- package/src/core/usage-tracker.ts +438 -0
- package/src/errors/base.ts +81 -0
- package/src/errors/file.ts +183 -0
- package/src/errors/index.ts +95 -0
- package/src/errors/llm.ts +151 -0
- package/src/errors/network.ts +124 -0
- package/src/errors/validation.ts +111 -0
- package/src/eval/eval-runner.ts +456 -0
- package/src/eval/index.ts +8 -0
- package/src/eval/types.ts +139 -0
- package/src/index.ts +22 -0
- package/src/orchestration/index.ts +30 -0
- package/src/orchestration/plan-executor.ts +652 -0
- package/src/orchestration/types.ts +127 -0
- package/src/orchestration/utils.ts +119 -0
- package/src/orquesta/connection.ts +291 -0
- package/src/prompts/agents/docs-search-decision.ts +74 -0
- package/src/prompts/agents/docs-search.ts +84 -0
- package/src/prompts/agents/planning.ts +143 -0
- package/src/prompts/index.ts +31 -0
- package/src/prompts/shared/codebase-rules.ts +29 -0
- package/src/prompts/shared/git-rules.ts +94 -0
- package/src/prompts/shared/language-rules.ts +36 -0
- package/src/prompts/shared/tool-usage.ts +72 -0
- package/src/prompts/system/compact.ts +80 -0
- package/src/prompts/system/plan-execute.ts +89 -0
- package/src/tools/browser/browser-client.ts +1363 -0
- package/src/tools/browser/browser-tools.ts +1139 -0
- package/src/tools/browser/index.ts +65 -0
- package/src/tools/index.ts +23 -0
- package/src/tools/llm/agents/docs-search-tools.ts +368 -0
- package/src/tools/llm/agents/index.ts +22 -0
- package/src/tools/llm/index.ts +11 -0
- package/src/tools/llm/simple/ask-user-tool.ts +25 -0
- package/src/tools/llm/simple/background-bash-tool.ts +443 -0
- package/src/tools/llm/simple/background-powershell-tool.ts +421 -0
- package/src/tools/llm/simple/bash-tool.ts +238 -0
- package/src/tools/llm/simple/docs-search-agent-tool.ts +146 -0
- package/src/tools/llm/simple/file-tools.ts +1051 -0
- package/src/tools/llm/simple/final-response-tool.ts +180 -0
- package/src/tools/llm/simple/index.ts +42 -0
- package/src/tools/llm/simple/planning-tools.ts +143 -0
- package/src/tools/llm/simple/powershell-tool.ts +241 -0
- package/src/tools/llm/simple/simple-tool-executor.ts +279 -0
- package/src/tools/llm/simple/todo-tools.ts +207 -0
- package/src/tools/llm/simple/user-interaction-tools.ts +277 -0
- package/src/tools/office/common/constants.ts +335 -0
- package/src/tools/office/common/index.ts +133 -0
- package/src/tools/office/common/types.ts +286 -0
- package/src/tools/office/common/utils.ts +116 -0
- package/src/tools/office/excel-client.ts +1336 -0
- package/src/tools/office/excel-tools/cells.ts +359 -0
- package/src/tools/office/excel-tools/charts.ts +166 -0
- package/src/tools/office/excel-tools/comments.ts +155 -0
- package/src/tools/office/excel-tools/data-ops.ts +349 -0
- package/src/tools/office/excel-tools/export.ts +105 -0
- package/src/tools/office/excel-tools/formatting.ts +357 -0
- package/src/tools/office/excel-tools/index.ts +55 -0
- package/src/tools/office/excel-tools/launch.ts +303 -0
- package/src/tools/office/excel-tools/media.ts +117 -0
- package/src/tools/office/excel-tools/named-ranges.ts +148 -0
- package/src/tools/office/excel-tools/protection.ts +105 -0
- package/src/tools/office/excel-tools/rows-columns.ts +386 -0
- package/src/tools/office/excel-tools/sheets.ts +228 -0
- package/src/tools/office/excel-tools/validation.ts +226 -0
- package/src/tools/office/excel-tools.ts +9 -0
- package/src/tools/office/index.ts +259 -0
- package/src/tools/office/office-client-base.ts +242 -0
- package/src/tools/office/office-client.ts +377 -0
- package/src/tools/office/powerpoint-client.ts +1498 -0
- package/src/tools/office/powerpoint-tools/effects.ts +315 -0
- package/src/tools/office/powerpoint-tools/export.ts +138 -0
- package/src/tools/office/powerpoint-tools/index.ts +45 -0
- package/src/tools/office/powerpoint-tools/launch.ts +263 -0
- package/src/tools/office/powerpoint-tools/media.ts +291 -0
- package/src/tools/office/powerpoint-tools/notes.ts +220 -0
- package/src/tools/office/powerpoint-tools/sections.ts +140 -0
- package/src/tools/office/powerpoint-tools/shapes.ts +870 -0
- package/src/tools/office/powerpoint-tools/slides.ts +350 -0
- package/src/tools/office/powerpoint-tools/tables.ts +182 -0
- package/src/tools/office/powerpoint-tools/text.ts +473 -0
- package/src/tools/office/powerpoint-tools.ts +9 -0
- package/src/tools/office/word-client.ts +1697 -0
- package/src/tools/office/word-tools/bookmarks.ts +186 -0
- package/src/tools/office/word-tools/comments.ts +185 -0
- package/src/tools/office/word-tools/content.ts +229 -0
- package/src/tools/office/word-tools/export.ts +97 -0
- package/src/tools/office/word-tools/formatting.ts +161 -0
- package/src/tools/office/word-tools/headers-footers.ts +155 -0
- package/src/tools/office/word-tools/index.ts +57 -0
- package/src/tools/office/word-tools/launch.ts +312 -0
- package/src/tools/office/word-tools/lists.ts +97 -0
- package/src/tools/office/word-tools/navigation.ts +114 -0
- package/src/tools/office/word-tools/page-setup.ts +195 -0
- package/src/tools/office/word-tools/tables.ts +262 -0
- package/src/tools/office/word-tools/text.ts +294 -0
- package/src/tools/office/word-tools/undo-redo.ts +97 -0
- package/src/tools/office/word-tools/watermarks.ts +105 -0
- package/src/tools/office/word-tools.ts +9 -0
- package/src/tools/registry.ts +527 -0
- package/src/tools/types.ts +231 -0
- package/src/types/index.ts +181 -0
- package/src/ui/PlanExecuteView.tsx +119 -0
- package/src/ui/TodoPanel.tsx +240 -0
- package/src/ui/UpdateNotification.tsx +105 -0
- package/src/ui/components/ActivityIndicator.tsx +234 -0
- package/src/ui/components/CommandBrowser.tsx +114 -0
- package/src/ui/components/CustomTextInput.tsx +389 -0
- package/src/ui/components/DocsSearchProgress.tsx +85 -0
- package/src/ui/components/FileBrowser.tsx +93 -0
- package/src/ui/components/LLMSetupWizard.tsx +333 -0
- package/src/ui/components/Logo.tsx +125 -0
- package/src/ui/components/MarkdownRenderer.tsx +358 -0
- package/src/ui/components/ModelSelector.tsx +203 -0
- package/src/ui/components/PlanExecuteApp.tsx +2007 -0
- package/src/ui/components/ProgressBar.tsx +51 -0
- package/src/ui/components/StatusBar.tsx +302 -0
- package/src/ui/components/ThinkingIndicator.tsx +120 -0
- package/src/ui/components/TodoListView.tsx +140 -0
- package/src/ui/components/ToolSelector.tsx +215 -0
- package/src/ui/components/dialogs/ApprovalDialog.tsx +259 -0
- package/src/ui/components/dialogs/AskUserDialog.tsx +159 -0
- package/src/ui/components/dialogs/DocsBrowser.tsx +222 -0
- package/src/ui/components/dialogs/SettingsDialog.tsx +939 -0
- package/src/ui/components/dialogs/index.ts +13 -0
- package/src/ui/components/index.ts +27 -0
- package/src/ui/components/panels/LogPanel.tsx +385 -0
- package/src/ui/components/panels/SessionPanel.tsx +146 -0
- package/src/ui/components/panels/index.ts +13 -0
- package/src/ui/components/views/ChatView.tsx +447 -0
- package/src/ui/components/views/index.ts +5 -0
- package/src/ui/contexts/TokenContext.tsx +139 -0
- package/src/ui/hooks/atFileProcessor.ts +167 -0
- package/src/ui/hooks/index.ts +11 -0
- package/src/ui/hooks/slashCommandProcessor.ts +174 -0
- package/src/ui/hooks/useCommandBrowserState.ts +97 -0
- package/src/ui/hooks/useFileBrowserState.ts +116 -0
- package/src/ui/hooks/useFileList.ts +132 -0
- package/src/ui/hooks/useInputHistory.ts +89 -0
- package/src/ui/hooks/usePlanExecution.ts +339 -0
- package/src/ui/index.ts +10 -0
- package/src/ui/ink-entry.tsx +36 -0
- package/src/utils/env-filter.ts +164 -0
- package/src/utils/file-system.ts +133 -0
- package/src/utils/git-utils.ts +30 -0
- package/src/utils/json-stream-logger.ts +1259 -0
- package/src/utils/logger.ts +2767 -0
- package/src/utils/platform-utils.ts +256 -0
- package/src/utils/wsl-utils.ts +113 -0
- package/tsconfig.electron.json +39 -0
- package/tsconfig.json +64 -0
|
@@ -0,0 +1,785 @@
|
|
|
1
|
+
import * as fs from 'fs/promises';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import { logger } from '../../../utils/logger.js';
|
|
4
|
+
const EXCLUDED_DIRS = new Set([
|
|
5
|
+
'node_modules',
|
|
6
|
+
'.git',
|
|
7
|
+
'dist',
|
|
8
|
+
'.next',
|
|
9
|
+
'coverage',
|
|
10
|
+
'.cache',
|
|
11
|
+
'build',
|
|
12
|
+
'__pycache__',
|
|
13
|
+
]);
|
|
14
|
+
const MAX_DEPTH = 5;
|
|
15
|
+
const MAX_FILES = 100;
|
|
16
|
+
const DEFAULT_LINE_LIMIT = 2000;
|
|
17
|
+
const MAX_LINE_LIMIT = 10000;
|
|
18
|
+
const MAX_FILE_SIZE = 100 * 1024 * 1024;
|
|
19
|
+
const MAX_WRITE_SIZE = 50 * 1024 * 1024;
|
|
20
|
+
const READ_FILE_DEFINITION = {
|
|
21
|
+
type: 'function',
|
|
22
|
+
function: {
|
|
23
|
+
name: 'read_file',
|
|
24
|
+
description: `Read the contents of a file. Only text files are supported.
|
|
25
|
+
By default, reads up to ${DEFAULT_LINE_LIMIT} lines. Use offset/limit for large files.`,
|
|
26
|
+
parameters: {
|
|
27
|
+
type: 'object',
|
|
28
|
+
properties: {
|
|
29
|
+
reason: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
description: `A natural, conversational explanation for the user about what you're doing.
|
|
32
|
+
Write as if you're talking to the user directly. Use the same language as the user.
|
|
33
|
+
Examples:
|
|
34
|
+
- "Checking how the current authentication logic is implemented"
|
|
35
|
+
- "Opening the file where the error occurred to find the problem"
|
|
36
|
+
- "Checking package.json to understand the project setup"
|
|
37
|
+
- "Looking at the existing code before making changes"`,
|
|
38
|
+
},
|
|
39
|
+
file_path: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
description: 'Absolute or relative path of the file to read',
|
|
42
|
+
},
|
|
43
|
+
offset: {
|
|
44
|
+
type: 'number',
|
|
45
|
+
description: 'Starting line number (1-based, default: 1)',
|
|
46
|
+
},
|
|
47
|
+
limit: {
|
|
48
|
+
type: 'number',
|
|
49
|
+
description: `Number of lines to read (default: ${DEFAULT_LINE_LIMIT}, max: ${MAX_LINE_LIMIT})`,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
required: ['reason', 'file_path'],
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
async function _executeReadFile(args) {
|
|
57
|
+
const filePath = args['file_path'];
|
|
58
|
+
const offset = Math.max(1, args['offset'] || 1);
|
|
59
|
+
const limit = Math.min(MAX_LINE_LIMIT, Math.max(1, args['limit'] || DEFAULT_LINE_LIMIT));
|
|
60
|
+
logger.toolStart('read_file', args);
|
|
61
|
+
try {
|
|
62
|
+
const cleanPath = filePath.startsWith('@') ? filePath.slice(1) : filePath;
|
|
63
|
+
const resolvedPath = path.resolve(cleanPath);
|
|
64
|
+
const displayPath = filePath.startsWith('@') ? filePath.slice(1) : filePath;
|
|
65
|
+
const stats = await fs.stat(resolvedPath);
|
|
66
|
+
if (stats.size > MAX_FILE_SIZE) {
|
|
67
|
+
logger.warn('File too large to read', { path: displayPath, size: stats.size, max: MAX_FILE_SIZE });
|
|
68
|
+
return {
|
|
69
|
+
success: false,
|
|
70
|
+
error: `File too large to read (${(stats.size / 1024 / 1024).toFixed(2)}MB). Maximum: ${MAX_FILE_SIZE / 1024 / 1024}MB`,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
const content = await fs.readFile(resolvedPath, 'utf-8');
|
|
74
|
+
const allLines = content.split('\n');
|
|
75
|
+
const totalLines = allLines.length;
|
|
76
|
+
const startIdx = offset - 1;
|
|
77
|
+
const endIdx = Math.min(startIdx + limit, totalLines);
|
|
78
|
+
const selectedLines = allLines.slice(startIdx, endIdx);
|
|
79
|
+
const formattedLines = selectedLines.map((line, idx) => {
|
|
80
|
+
const lineNum = startIdx + idx + 1;
|
|
81
|
+
const padding = String(totalLines).length;
|
|
82
|
+
return `${String(lineNum).padStart(padding)}→${line}`;
|
|
83
|
+
});
|
|
84
|
+
let result = formattedLines.join('\n');
|
|
85
|
+
if (totalLines > limit || offset > 1) {
|
|
86
|
+
const header = `[File: ${displayPath} | Lines ${offset}-${endIdx} of ${totalLines}]`;
|
|
87
|
+
const hasMore = endIdx < totalLines;
|
|
88
|
+
const footer = hasMore
|
|
89
|
+
? `\n[... ${totalLines - endIdx} more lines. Use offset=${endIdx + 1} to continue reading]`
|
|
90
|
+
: '';
|
|
91
|
+
result = `${header}\n${result}${footer}`;
|
|
92
|
+
}
|
|
93
|
+
logger.toolSuccess('read_file', args, { linesRead: selectedLines.length, totalLines }, 0);
|
|
94
|
+
return {
|
|
95
|
+
success: true,
|
|
96
|
+
result,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
const err = error;
|
|
101
|
+
const displayPath = filePath.startsWith('@') ? filePath.slice(1) : filePath;
|
|
102
|
+
if (err.code === 'ENOENT') {
|
|
103
|
+
logger.toolError('read_file', args, err, 0);
|
|
104
|
+
return {
|
|
105
|
+
success: false,
|
|
106
|
+
error: `File not found: ${displayPath}`,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
else if (err.code === 'EACCES') {
|
|
110
|
+
logger.toolError('read_file', args, err, 0);
|
|
111
|
+
return {
|
|
112
|
+
success: false,
|
|
113
|
+
error: `Permission denied reading file: ${displayPath}`,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
logger.toolError('read_file', args, err, 0);
|
|
118
|
+
return {
|
|
119
|
+
success: false,
|
|
120
|
+
error: `Failed to read file: ${err.message}`,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
export const readFileTool = {
|
|
126
|
+
definition: READ_FILE_DEFINITION,
|
|
127
|
+
execute: _executeReadFile,
|
|
128
|
+
categories: ['llm-simple'],
|
|
129
|
+
description: 'Read file contents',
|
|
130
|
+
};
|
|
131
|
+
const CREATE_FILE_DEFINITION = {
|
|
132
|
+
type: 'function',
|
|
133
|
+
function: {
|
|
134
|
+
name: 'create_file',
|
|
135
|
+
description: `Create a NEW file with the given content.
|
|
136
|
+
IMPORTANT: Only use this for files that do NOT exist yet.
|
|
137
|
+
For modifying existing files, use edit_file instead.
|
|
138
|
+
If the file already exists, this tool will fail.`,
|
|
139
|
+
parameters: {
|
|
140
|
+
type: 'object',
|
|
141
|
+
properties: {
|
|
142
|
+
reason: {
|
|
143
|
+
type: 'string',
|
|
144
|
+
description: `A natural, conversational explanation for the user about what you're doing.
|
|
145
|
+
Write as if you're talking to the user directly. Use the same language as the user.
|
|
146
|
+
Examples:
|
|
147
|
+
- "Creating a new file for the authentication service"
|
|
148
|
+
- "Creating a new test config file since one doesn't exist"
|
|
149
|
+
- "Creating a new file to separate the API router"
|
|
150
|
+
- "Adding a new component file"`,
|
|
151
|
+
},
|
|
152
|
+
file_path: {
|
|
153
|
+
type: 'string',
|
|
154
|
+
description: 'Absolute or relative path of the new file to create',
|
|
155
|
+
},
|
|
156
|
+
content: {
|
|
157
|
+
type: 'string',
|
|
158
|
+
description: 'Content to write to the new file',
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
required: ['reason', 'file_path', 'content'],
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
async function _executeCreateFile(args) {
|
|
166
|
+
const filePath = args['file_path'];
|
|
167
|
+
const content = args['content'];
|
|
168
|
+
logger.toolStart('create_file', { file_path: filePath, contentLength: content?.length || 0 });
|
|
169
|
+
try {
|
|
170
|
+
const cleanPath = filePath.startsWith('@') ? filePath.slice(1) : filePath;
|
|
171
|
+
const resolvedPath = path.resolve(cleanPath);
|
|
172
|
+
const displayPath = filePath.startsWith('@') ? filePath.slice(1) : filePath;
|
|
173
|
+
const contentSize = Buffer.byteLength(content, 'utf-8');
|
|
174
|
+
if (contentSize > MAX_WRITE_SIZE) {
|
|
175
|
+
logger.warn('Content too large to write', { path: displayPath, size: contentSize, max: MAX_WRITE_SIZE });
|
|
176
|
+
return {
|
|
177
|
+
success: false,
|
|
178
|
+
error: `Content too large to write (${(contentSize / 1024 / 1024).toFixed(2)}MB). Maximum: ${MAX_WRITE_SIZE / 1024 / 1024}MB`,
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
try {
|
|
182
|
+
await fs.access(resolvedPath);
|
|
183
|
+
logger.toolError('create_file', args, new Error('File already exists'), 0);
|
|
184
|
+
return {
|
|
185
|
+
success: false,
|
|
186
|
+
error: `File already exists: ${displayPath}. Use edit_file to modify existing files.`,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
catch {
|
|
190
|
+
}
|
|
191
|
+
const dir = path.dirname(resolvedPath);
|
|
192
|
+
await fs.mkdir(dir, { recursive: true });
|
|
193
|
+
await fs.writeFile(resolvedPath, content, 'utf-8');
|
|
194
|
+
const lines = content.split('\n').length;
|
|
195
|
+
logger.toolSuccess('create_file', args, { file: displayPath, lines }, 0);
|
|
196
|
+
return {
|
|
197
|
+
success: true,
|
|
198
|
+
result: JSON.stringify({
|
|
199
|
+
action: 'created',
|
|
200
|
+
file: displayPath,
|
|
201
|
+
lines: lines,
|
|
202
|
+
message: `Created ${displayPath} (${lines} lines)`,
|
|
203
|
+
}),
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
catch (error) {
|
|
207
|
+
const err = error;
|
|
208
|
+
const displayPath = filePath.startsWith('@') ? filePath.slice(1) : filePath;
|
|
209
|
+
logger.toolError('create_file', args, err, 0);
|
|
210
|
+
return {
|
|
211
|
+
success: false,
|
|
212
|
+
error: `Failed to create file (${displayPath}): ${err.message}`,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
export const createFileTool = {
|
|
217
|
+
definition: CREATE_FILE_DEFINITION,
|
|
218
|
+
execute: _executeCreateFile,
|
|
219
|
+
categories: ['llm-simple'],
|
|
220
|
+
description: 'Create a new file',
|
|
221
|
+
};
|
|
222
|
+
const EDIT_FILE_DEFINITION = {
|
|
223
|
+
type: 'function',
|
|
224
|
+
function: {
|
|
225
|
+
name: 'edit_file',
|
|
226
|
+
description: `Edit an EXISTING file by replacing a specific text block.
|
|
227
|
+
IMPORTANT: Only use this for files that already exist. For new files, use create_file.
|
|
228
|
+
|
|
229
|
+
HOW TO USE:
|
|
230
|
+
1. First use read_file to see the current content
|
|
231
|
+
2. Copy the EXACT text block you want to change (can be multiple lines)
|
|
232
|
+
3. Provide old_string (text to find) and new_string (replacement)
|
|
233
|
+
|
|
234
|
+
RULES:
|
|
235
|
+
- old_string must match EXACTLY (including whitespace and indentation)
|
|
236
|
+
- old_string must be UNIQUE in the file (if it appears multiple times, use replace_all: true)
|
|
237
|
+
- Both old_string and new_string can be multi-line
|
|
238
|
+
- To delete text, use empty string "" for new_string
|
|
239
|
+
|
|
240
|
+
EXAMPLES:
|
|
241
|
+
1. Change a single line:
|
|
242
|
+
old_string: "const x = 1;"
|
|
243
|
+
new_string: "const x = 2;"
|
|
244
|
+
|
|
245
|
+
2. Change multiple lines at once:
|
|
246
|
+
old_string: "function foo() {\\n return 1;\\n}"
|
|
247
|
+
new_string: "function foo() {\\n return 2;\\n}"
|
|
248
|
+
|
|
249
|
+
3. Delete a line:
|
|
250
|
+
old_string: "// delete this line\\n"
|
|
251
|
+
new_string: ""
|
|
252
|
+
|
|
253
|
+
4. Replace all occurrences:
|
|
254
|
+
old_string: "oldName"
|
|
255
|
+
new_string: "newName"
|
|
256
|
+
replace_all: true`,
|
|
257
|
+
parameters: {
|
|
258
|
+
type: 'object',
|
|
259
|
+
properties: {
|
|
260
|
+
reason: {
|
|
261
|
+
type: 'string',
|
|
262
|
+
description: `A natural, conversational explanation for the user about what you're doing.
|
|
263
|
+
Write as if you're talking to the user directly. Use the same language as the user.
|
|
264
|
+
Examples:
|
|
265
|
+
- "Fixing the buggy section"
|
|
266
|
+
- "Changing the function name as requested"
|
|
267
|
+
- "Adding the import statement"
|
|
268
|
+
- "Fixing the type error"`,
|
|
269
|
+
},
|
|
270
|
+
file_path: {
|
|
271
|
+
type: 'string',
|
|
272
|
+
description: 'Absolute or relative path of the existing file to edit',
|
|
273
|
+
},
|
|
274
|
+
old_string: {
|
|
275
|
+
type: 'string',
|
|
276
|
+
description: 'The exact text to find and replace (can be multi-line)',
|
|
277
|
+
},
|
|
278
|
+
new_string: {
|
|
279
|
+
type: 'string',
|
|
280
|
+
description: 'The new text to replace with (can be multi-line, use "" to delete)',
|
|
281
|
+
},
|
|
282
|
+
replace_all: {
|
|
283
|
+
type: 'boolean',
|
|
284
|
+
description: 'If true, replace ALL occurrences of old_string. Default is false (requires unique match).',
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
required: ['reason', 'file_path', 'old_string', 'new_string'],
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
};
|
|
291
|
+
async function _executeEditFile(args) {
|
|
292
|
+
const filePath = args['file_path'];
|
|
293
|
+
const oldString = args['old_string'];
|
|
294
|
+
const newString = args['new_string'];
|
|
295
|
+
const replaceAll = args['replace_all'];
|
|
296
|
+
logger.toolStart('edit_file', { file_path: filePath, oldStringLength: oldString?.length || 0, newStringLength: newString?.length || 0, replaceAll });
|
|
297
|
+
const cleanPath = filePath.startsWith('@') ? filePath.slice(1) : filePath;
|
|
298
|
+
const displayPath = cleanPath;
|
|
299
|
+
try {
|
|
300
|
+
const resolvedPath = path.resolve(cleanPath);
|
|
301
|
+
if (!oldString) {
|
|
302
|
+
return {
|
|
303
|
+
success: false,
|
|
304
|
+
error: 'old_string cannot be empty.',
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
try {
|
|
308
|
+
await fs.access(resolvedPath);
|
|
309
|
+
}
|
|
310
|
+
catch {
|
|
311
|
+
return {
|
|
312
|
+
success: false,
|
|
313
|
+
error: `File does not exist: ${displayPath}. Use create_file to create new files.`,
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
const stats = await fs.stat(resolvedPath);
|
|
317
|
+
if (stats.size > MAX_FILE_SIZE) {
|
|
318
|
+
logger.warn('File too large to edit', { path: displayPath, size: stats.size, max: MAX_FILE_SIZE });
|
|
319
|
+
return {
|
|
320
|
+
success: false,
|
|
321
|
+
error: `File too large to edit (${(stats.size / 1024 / 1024).toFixed(2)}MB). Maximum: ${MAX_FILE_SIZE / 1024 / 1024}MB`,
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
const originalContent = await fs.readFile(resolvedPath, 'utf-8');
|
|
325
|
+
if (!originalContent.includes(oldString)) {
|
|
326
|
+
const lines = originalContent.split('\n');
|
|
327
|
+
const preview = lines.slice(0, 20).map((l, i) => `${i + 1}: ${l}`).join('\n');
|
|
328
|
+
return {
|
|
329
|
+
success: false,
|
|
330
|
+
error: `old_string not found in file.\n\nSearched for:\n"${oldString.slice(0, 200)}${oldString.length > 200 ? '...' : ''}"\n\nFile preview (first 20 lines):\n${preview}\n\n💡 Use read_file to check the exact content and try again.`,
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
const occurrences = originalContent.split(oldString).length - 1;
|
|
334
|
+
if (!replaceAll && occurrences > 1) {
|
|
335
|
+
return {
|
|
336
|
+
success: false,
|
|
337
|
+
error: `old_string appears ${occurrences} times in the file. Either:\n1. Make old_string more specific (include more context)\n2. Use replace_all: true to replace all occurrences\n\n💡 Include surrounding lines to make the match unique.`,
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
let newContent;
|
|
341
|
+
if (replaceAll) {
|
|
342
|
+
newContent = originalContent.split(oldString).join(newString);
|
|
343
|
+
}
|
|
344
|
+
else {
|
|
345
|
+
newContent = originalContent.replace(oldString, newString);
|
|
346
|
+
}
|
|
347
|
+
const newContentSize = Buffer.byteLength(newContent, 'utf-8');
|
|
348
|
+
if (newContentSize > MAX_WRITE_SIZE) {
|
|
349
|
+
logger.warn('Modified content too large', { path: displayPath, size: newContentSize, max: MAX_WRITE_SIZE });
|
|
350
|
+
return {
|
|
351
|
+
success: false,
|
|
352
|
+
error: `Modified content too large (${(newContentSize / 1024 / 1024).toFixed(2)}MB). Maximum: ${MAX_WRITE_SIZE / 1024 / 1024}MB`,
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
await fs.writeFile(resolvedPath, newContent, 'utf-8');
|
|
356
|
+
const oldLinesArr = oldString.split('\n');
|
|
357
|
+
const newLinesArr = newString.split('\n');
|
|
358
|
+
const replacements = replaceAll ? occurrences : 1;
|
|
359
|
+
const diffPreview = [];
|
|
360
|
+
const oldPreview = oldLinesArr.slice(0, 5);
|
|
361
|
+
const newPreview = newLinesArr.slice(0, 5);
|
|
362
|
+
oldPreview.forEach(line => diffPreview.push(`- ${line}`));
|
|
363
|
+
if (oldLinesArr.length > 5)
|
|
364
|
+
diffPreview.push('- ...');
|
|
365
|
+
newPreview.forEach(line => diffPreview.push(`+ ${line}`));
|
|
366
|
+
if (newLinesArr.length > 5)
|
|
367
|
+
diffPreview.push('+ ...');
|
|
368
|
+
logger.toolSuccess('edit_file', args, { file: displayPath, replacements, oldLines: oldLinesArr.length, newLines: newLinesArr.length }, 0);
|
|
369
|
+
return {
|
|
370
|
+
success: true,
|
|
371
|
+
result: JSON.stringify({
|
|
372
|
+
action: 'edited',
|
|
373
|
+
file: displayPath,
|
|
374
|
+
replacements: replacements,
|
|
375
|
+
oldLines: oldLinesArr.length,
|
|
376
|
+
newLines: newLinesArr.length,
|
|
377
|
+
message: replaceAll
|
|
378
|
+
? `Replaced ${replacements} occurrence(s) in ${displayPath}`
|
|
379
|
+
: `Updated ${displayPath}`,
|
|
380
|
+
diff: diffPreview,
|
|
381
|
+
}),
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
catch (error) {
|
|
385
|
+
const err = error;
|
|
386
|
+
logger.toolError('edit_file', args, err, 0);
|
|
387
|
+
return {
|
|
388
|
+
success: false,
|
|
389
|
+
error: `File edit failed (${displayPath}): ${err.message}`,
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
export const editFileTool = {
|
|
394
|
+
definition: EDIT_FILE_DEFINITION,
|
|
395
|
+
execute: _executeEditFile,
|
|
396
|
+
categories: ['llm-simple'],
|
|
397
|
+
description: 'Edit an existing file',
|
|
398
|
+
};
|
|
399
|
+
const LIST_FILES_DEFINITION = {
|
|
400
|
+
type: 'function',
|
|
401
|
+
function: {
|
|
402
|
+
name: 'list_files',
|
|
403
|
+
description: 'List files and folders in a directory.',
|
|
404
|
+
parameters: {
|
|
405
|
+
type: 'object',
|
|
406
|
+
properties: {
|
|
407
|
+
reason: {
|
|
408
|
+
type: 'string',
|
|
409
|
+
description: `A natural, conversational explanation for the user about what you're doing.
|
|
410
|
+
Write as if you're talking to the user directly. Use the same language as the user.
|
|
411
|
+
Examples:
|
|
412
|
+
- "Looking at the folder structure to understand the project"
|
|
413
|
+
- "Checking what files are available"
|
|
414
|
+
- "Seeing what's inside the src folder"
|
|
415
|
+
- "Checking the directory to find related files"`,
|
|
416
|
+
},
|
|
417
|
+
directory_path: {
|
|
418
|
+
type: 'string',
|
|
419
|
+
description: 'Directory path to list (default: current directory)',
|
|
420
|
+
},
|
|
421
|
+
recursive: {
|
|
422
|
+
type: 'boolean',
|
|
423
|
+
description: 'Whether to list subdirectories recursively (default: false)',
|
|
424
|
+
},
|
|
425
|
+
},
|
|
426
|
+
required: ['reason'],
|
|
427
|
+
},
|
|
428
|
+
},
|
|
429
|
+
};
|
|
430
|
+
async function getFilesRecursively(dirPath, baseDir = dirPath, depth = 0, fileCount = { count: 0 }) {
|
|
431
|
+
if (depth > MAX_DEPTH) {
|
|
432
|
+
return [];
|
|
433
|
+
}
|
|
434
|
+
if (fileCount.count >= MAX_FILES) {
|
|
435
|
+
return [];
|
|
436
|
+
}
|
|
437
|
+
let entries;
|
|
438
|
+
try {
|
|
439
|
+
entries = await fs.readdir(dirPath, { withFileTypes: true });
|
|
440
|
+
}
|
|
441
|
+
catch {
|
|
442
|
+
return [];
|
|
443
|
+
}
|
|
444
|
+
const files = [];
|
|
445
|
+
for (const entry of entries) {
|
|
446
|
+
if (fileCount.count >= MAX_FILES) {
|
|
447
|
+
break;
|
|
448
|
+
}
|
|
449
|
+
if (entry.name.startsWith('.')) {
|
|
450
|
+
continue;
|
|
451
|
+
}
|
|
452
|
+
const fullPath = path.join(dirPath, entry.name);
|
|
453
|
+
const relativePath = path.relative(baseDir, fullPath);
|
|
454
|
+
if (entry.isDirectory()) {
|
|
455
|
+
if (EXCLUDED_DIRS.has(entry.name)) {
|
|
456
|
+
continue;
|
|
457
|
+
}
|
|
458
|
+
files.push({
|
|
459
|
+
name: entry.name,
|
|
460
|
+
type: 'directory',
|
|
461
|
+
path: relativePath,
|
|
462
|
+
});
|
|
463
|
+
fileCount.count++;
|
|
464
|
+
const subFiles = await getFilesRecursively(fullPath, baseDir, depth + 1, fileCount);
|
|
465
|
+
files.push(...subFiles);
|
|
466
|
+
}
|
|
467
|
+
else {
|
|
468
|
+
files.push({
|
|
469
|
+
name: entry.name,
|
|
470
|
+
type: 'file',
|
|
471
|
+
path: relativePath,
|
|
472
|
+
});
|
|
473
|
+
fileCount.count++;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
return files;
|
|
477
|
+
}
|
|
478
|
+
async function _executeListFilesInternal(args) {
|
|
479
|
+
const directoryPath = args['directory_path'] || '.';
|
|
480
|
+
const recursive = args['recursive'] || false;
|
|
481
|
+
logger.toolStart('list_files', { directory_path: directoryPath, recursive });
|
|
482
|
+
try {
|
|
483
|
+
const resolvedPath = path.resolve(directoryPath);
|
|
484
|
+
if (recursive) {
|
|
485
|
+
const files = await getFilesRecursively(resolvedPath);
|
|
486
|
+
logger.toolSuccess('list_files', args, { fileCount: files.length }, 0);
|
|
487
|
+
return {
|
|
488
|
+
success: true,
|
|
489
|
+
result: JSON.stringify(files, null, 2),
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
else {
|
|
493
|
+
const entries = await fs.readdir(resolvedPath, { withFileTypes: true });
|
|
494
|
+
const files = entries.map((entry) => ({
|
|
495
|
+
name: entry.name,
|
|
496
|
+
type: entry.isDirectory() ? 'directory' : 'file',
|
|
497
|
+
path: path.join(directoryPath, entry.name),
|
|
498
|
+
}));
|
|
499
|
+
logger.toolSuccess('list_files', args, { fileCount: files.length }, 0);
|
|
500
|
+
return {
|
|
501
|
+
success: true,
|
|
502
|
+
result: JSON.stringify(files, null, 2),
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
catch (error) {
|
|
507
|
+
const err = error;
|
|
508
|
+
logger.toolError('list_files', args, err, 0);
|
|
509
|
+
if (err.code === 'ENOENT') {
|
|
510
|
+
return {
|
|
511
|
+
success: false,
|
|
512
|
+
error: `Directory not found: ${directoryPath}`,
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
else {
|
|
516
|
+
return {
|
|
517
|
+
success: false,
|
|
518
|
+
error: `Failed to read directory: ${err.message}`,
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
export const listFilesTool = {
|
|
524
|
+
definition: LIST_FILES_DEFINITION,
|
|
525
|
+
execute: _executeListFilesInternal,
|
|
526
|
+
categories: ['llm-simple'],
|
|
527
|
+
description: 'List directory contents',
|
|
528
|
+
};
|
|
529
|
+
const FIND_FILES_DEFINITION = {
|
|
530
|
+
type: 'function',
|
|
531
|
+
function: {
|
|
532
|
+
name: 'find_files',
|
|
533
|
+
description: 'Search for files by filename pattern.',
|
|
534
|
+
parameters: {
|
|
535
|
+
type: 'object',
|
|
536
|
+
properties: {
|
|
537
|
+
reason: {
|
|
538
|
+
type: 'string',
|
|
539
|
+
description: `A natural, conversational explanation for the user about what you're doing (in user's language).
|
|
540
|
+
Write as if you're talking to the user directly.
|
|
541
|
+
Examples:
|
|
542
|
+
- "Looking for where the config files are located"
|
|
543
|
+
- "Searching for test files"
|
|
544
|
+
- "Checking where TypeScript files are"
|
|
545
|
+
- "Finding related component files"`,
|
|
546
|
+
},
|
|
547
|
+
pattern: {
|
|
548
|
+
type: 'string',
|
|
549
|
+
description: 'Filename pattern to search for (e.g., *.ts, package.json)',
|
|
550
|
+
},
|
|
551
|
+
directory_path: {
|
|
552
|
+
type: 'string',
|
|
553
|
+
description: 'Directory path to start search from (default: current directory)',
|
|
554
|
+
},
|
|
555
|
+
},
|
|
556
|
+
required: ['reason', 'pattern'],
|
|
557
|
+
},
|
|
558
|
+
},
|
|
559
|
+
};
|
|
560
|
+
async function findFilesRecursively(dirPath, regex, baseDir, depth = 0, fileCount = { count: 0 }) {
|
|
561
|
+
if (depth > MAX_DEPTH) {
|
|
562
|
+
return [];
|
|
563
|
+
}
|
|
564
|
+
if (fileCount.count >= MAX_FILES) {
|
|
565
|
+
return [];
|
|
566
|
+
}
|
|
567
|
+
let entries;
|
|
568
|
+
try {
|
|
569
|
+
entries = await fs.readdir(dirPath, { withFileTypes: true });
|
|
570
|
+
}
|
|
571
|
+
catch {
|
|
572
|
+
return [];
|
|
573
|
+
}
|
|
574
|
+
const matchedFiles = [];
|
|
575
|
+
for (const entry of entries) {
|
|
576
|
+
if (fileCount.count >= MAX_FILES) {
|
|
577
|
+
break;
|
|
578
|
+
}
|
|
579
|
+
if (entry.name.startsWith('.')) {
|
|
580
|
+
continue;
|
|
581
|
+
}
|
|
582
|
+
const fullPath = path.join(dirPath, entry.name);
|
|
583
|
+
if (entry.isDirectory()) {
|
|
584
|
+
if (EXCLUDED_DIRS.has(entry.name)) {
|
|
585
|
+
continue;
|
|
586
|
+
}
|
|
587
|
+
const subFiles = await findFilesRecursively(fullPath, regex, baseDir, depth + 1, fileCount);
|
|
588
|
+
matchedFiles.push(...subFiles);
|
|
589
|
+
}
|
|
590
|
+
else if (regex.test(entry.name)) {
|
|
591
|
+
const relativePath = path.relative(baseDir, fullPath);
|
|
592
|
+
matchedFiles.push({
|
|
593
|
+
name: entry.name,
|
|
594
|
+
path: relativePath,
|
|
595
|
+
});
|
|
596
|
+
fileCount.count++;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
return matchedFiles;
|
|
600
|
+
}
|
|
601
|
+
async function _executeFindFilesInternal(args) {
|
|
602
|
+
const pattern = args['pattern'];
|
|
603
|
+
const directoryPath = args['directory_path'] || '.';
|
|
604
|
+
logger.toolStart('find_files', { pattern, directory_path: directoryPath });
|
|
605
|
+
try {
|
|
606
|
+
const resolvedPath = path.resolve(directoryPath);
|
|
607
|
+
const regexPattern = pattern
|
|
608
|
+
.replace(/\./g, '\\.')
|
|
609
|
+
.replace(/\*/g, '.*')
|
|
610
|
+
.replace(/\?/g, '.');
|
|
611
|
+
const regex = new RegExp(`^${regexPattern}$`);
|
|
612
|
+
const matchedFiles = await findFilesRecursively(resolvedPath, regex, resolvedPath);
|
|
613
|
+
if (matchedFiles.length === 0) {
|
|
614
|
+
logger.toolSuccess('find_files', args, { matchCount: 0 }, 0);
|
|
615
|
+
return {
|
|
616
|
+
success: true,
|
|
617
|
+
result: `No files found matching pattern "${pattern}".`,
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
logger.toolSuccess('find_files', args, { matchCount: matchedFiles.length }, 0);
|
|
621
|
+
return {
|
|
622
|
+
success: true,
|
|
623
|
+
result: JSON.stringify(matchedFiles, null, 2),
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
catch (error) {
|
|
627
|
+
const err = error;
|
|
628
|
+
logger.toolError('find_files', args, err, 0);
|
|
629
|
+
return {
|
|
630
|
+
success: false,
|
|
631
|
+
error: `File search failed: ${err.message}`,
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
export const findFilesTool = {
|
|
636
|
+
definition: FIND_FILES_DEFINITION,
|
|
637
|
+
execute: _executeFindFilesInternal,
|
|
638
|
+
categories: ['llm-simple'],
|
|
639
|
+
description: 'Search files by pattern',
|
|
640
|
+
};
|
|
641
|
+
const SEARCH_CONTENT_DEFINITION = {
|
|
642
|
+
type: 'function',
|
|
643
|
+
function: {
|
|
644
|
+
name: 'search_content',
|
|
645
|
+
description: 'Search for text pattern inside files.',
|
|
646
|
+
parameters: {
|
|
647
|
+
type: 'object',
|
|
648
|
+
properties: {
|
|
649
|
+
reason: {
|
|
650
|
+
type: 'string',
|
|
651
|
+
description: `A natural, conversational explanation for the user about what you're doing.
|
|
652
|
+
Write as if you're talking to the user directly. Use the same language as the user.
|
|
653
|
+
Examples:
|
|
654
|
+
- "Searching for usages of the function"
|
|
655
|
+
- "Finding where the error message is defined"
|
|
656
|
+
- "Looking for references to the API endpoint"`,
|
|
657
|
+
},
|
|
658
|
+
pattern: {
|
|
659
|
+
type: 'string',
|
|
660
|
+
description: 'Text or regex pattern to search for',
|
|
661
|
+
},
|
|
662
|
+
directory_path: {
|
|
663
|
+
type: 'string',
|
|
664
|
+
description: 'Directory path to search in (default: current directory)',
|
|
665
|
+
},
|
|
666
|
+
file_pattern: {
|
|
667
|
+
type: 'string',
|
|
668
|
+
description: 'File pattern to filter (e.g., *.ts)',
|
|
669
|
+
},
|
|
670
|
+
max_results: {
|
|
671
|
+
type: 'number',
|
|
672
|
+
description: 'Maximum number of results (default: 50)',
|
|
673
|
+
},
|
|
674
|
+
},
|
|
675
|
+
required: ['reason', 'pattern'],
|
|
676
|
+
},
|
|
677
|
+
},
|
|
678
|
+
};
|
|
679
|
+
const TEXT_EXTENSIONS = [
|
|
680
|
+
'.ts', '.tsx', '.js', '.jsx', '.json', '.md', '.txt', '.css', '.scss',
|
|
681
|
+
'.html', '.xml', '.yaml', '.yml', '.toml', '.ini', '.cfg', '.conf',
|
|
682
|
+
'.sh', '.bash', '.ps1', '.py', '.rb', '.go', '.rs', '.java', '.c',
|
|
683
|
+
'.cpp', '.h', '.hpp', '.cs', '.php', '.vue', '.svelte',
|
|
684
|
+
];
|
|
685
|
+
async function searchContentRecursively(dirPath, searchRegex, baseDir, fileRegex, resultCount, maxResults, depth = 0) {
|
|
686
|
+
if (depth > MAX_DEPTH || resultCount.count >= maxResults) {
|
|
687
|
+
return [];
|
|
688
|
+
}
|
|
689
|
+
let entries;
|
|
690
|
+
try {
|
|
691
|
+
entries = await fs.readdir(dirPath, { withFileTypes: true });
|
|
692
|
+
}
|
|
693
|
+
catch {
|
|
694
|
+
return [];
|
|
695
|
+
}
|
|
696
|
+
const results = [];
|
|
697
|
+
for (const entry of entries) {
|
|
698
|
+
if (resultCount.count >= maxResults)
|
|
699
|
+
break;
|
|
700
|
+
if (entry.name.startsWith('.'))
|
|
701
|
+
continue;
|
|
702
|
+
const fullPath = path.join(dirPath, entry.name);
|
|
703
|
+
if (entry.isDirectory()) {
|
|
704
|
+
if (EXCLUDED_DIRS.has(entry.name))
|
|
705
|
+
continue;
|
|
706
|
+
const subResults = await searchContentRecursively(fullPath, searchRegex, baseDir, fileRegex, resultCount, maxResults, depth + 1);
|
|
707
|
+
results.push(...subResults);
|
|
708
|
+
}
|
|
709
|
+
else {
|
|
710
|
+
if (fileRegex && !fileRegex.test(entry.name))
|
|
711
|
+
continue;
|
|
712
|
+
const ext = path.extname(entry.name).toLowerCase();
|
|
713
|
+
if (!TEXT_EXTENSIONS.includes(ext))
|
|
714
|
+
continue;
|
|
715
|
+
try {
|
|
716
|
+
const content = await fs.readFile(fullPath, 'utf-8');
|
|
717
|
+
const lines = content.split('\n');
|
|
718
|
+
const relativePath = path.relative(baseDir, fullPath);
|
|
719
|
+
for (let i = 0; i < lines.length && resultCount.count < maxResults; i++) {
|
|
720
|
+
const line = lines[i] ?? '';
|
|
721
|
+
if (searchRegex.test(line)) {
|
|
722
|
+
results.push({
|
|
723
|
+
file: relativePath,
|
|
724
|
+
line: i + 1,
|
|
725
|
+
content: line.trim().substring(0, 200),
|
|
726
|
+
});
|
|
727
|
+
resultCount.count++;
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
catch {
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
return results;
|
|
736
|
+
}
|
|
737
|
+
async function executeSearchContent(args) {
|
|
738
|
+
const pattern = args['pattern'];
|
|
739
|
+
const directoryPath = args['directory_path'] || '.';
|
|
740
|
+
const filePattern = args['file_pattern'];
|
|
741
|
+
const maxResults = args['max_results'] || 50;
|
|
742
|
+
logger.toolStart('search_content', { pattern, directory_path: directoryPath, file_pattern: filePattern, maxResults });
|
|
743
|
+
try {
|
|
744
|
+
const resolvedPath = path.isAbsolute(directoryPath) ? directoryPath : path.resolve(process.cwd(), directoryPath);
|
|
745
|
+
const searchRegex = new RegExp(pattern, 'gi');
|
|
746
|
+
let fileRegex = null;
|
|
747
|
+
if (filePattern) {
|
|
748
|
+
const regexPattern = filePattern
|
|
749
|
+
.replace(/\./g, '\\.')
|
|
750
|
+
.replace(/\*/g, '.*')
|
|
751
|
+
.replace(/\?/g, '.');
|
|
752
|
+
fileRegex = new RegExp(`^${regexPattern}$`, 'i');
|
|
753
|
+
}
|
|
754
|
+
const results = await searchContentRecursively(resolvedPath, searchRegex, resolvedPath, fileRegex, { count: 0 }, maxResults);
|
|
755
|
+
logger.toolSuccess('search_content', args, { matchedCount: results.length }, 0);
|
|
756
|
+
if (results.length === 0) {
|
|
757
|
+
return { success: true, result: `No matches found for pattern "${pattern}".` };
|
|
758
|
+
}
|
|
759
|
+
return { success: true, result: JSON.stringify(results, null, 2) };
|
|
760
|
+
}
|
|
761
|
+
catch (error) {
|
|
762
|
+
const err = error;
|
|
763
|
+
logger.toolError('search_content', args, err, 0);
|
|
764
|
+
return { success: false, error: `Content search failed: ${err.message}` };
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
export const searchContentTool = {
|
|
768
|
+
definition: SEARCH_CONTENT_DEFINITION,
|
|
769
|
+
execute: executeSearchContent,
|
|
770
|
+
categories: ['llm-simple'],
|
|
771
|
+
description: 'Search content in files',
|
|
772
|
+
};
|
|
773
|
+
export const FILE_TOOLS = [
|
|
774
|
+
readFileTool,
|
|
775
|
+
createFileTool,
|
|
776
|
+
editFileTool,
|
|
777
|
+
listFilesTool,
|
|
778
|
+
findFilesTool,
|
|
779
|
+
searchContentTool,
|
|
780
|
+
];
|
|
781
|
+
export const SYSTEM_TOOLS = [];
|
|
782
|
+
export { USER_INTERACTION_TOOLS, tellToUserTool, askToUserTool, setTellToUserCallback, setAskUserCallback, clearAskUserCallback, hasAskUserCallback, } from './user-interaction-tools.js';
|
|
783
|
+
export { FILE_TOOLS as FILE_SIMPLE_TOOLS };
|
|
784
|
+
export { setToolExecutionCallback, setToolResponseCallback, setPlanCreatedCallback, setTodoStartCallback, setTodoCompleteCallback, setTodoFailCallback, setToolApprovalCallback, setCompactCallback, setAssistantResponseCallback, setReasoningCallback, getToolExecutionCallback, requestToolApproval, emitPlanCreated, emitTodoStart, emitTodoComplete, emitTodoFail, emitCompact, emitAssistantResponse, emitReasoning, executeSimpleTool, executeFileTool, } from './simple-tool-executor.js';
|
|
785
|
+
//# sourceMappingURL=file-tools.js.map
|