orquesta-cli 0.1.2
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/LICENSE +21 -0
- package/README.md +280 -0
- package/SECURITY.md +290 -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 +205 -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 +56 -0
- package/dist/core/config/config-manager.d.ts.map +1 -0
- package/dist/core/config/config-manager.js +342 -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/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 +291 -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/config-sync.d.ts +73 -0
- package/dist/orquesta/config-sync.d.ts.map +1 -0
- package/dist/orquesta/config-sync.js +230 -0
- package/dist/orquesta/config-sync.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/orquesta/prompt-reporter.d.ts +16 -0
- package/dist/orquesta/prompt-reporter.d.ts.map +1 -0
- package/dist/orquesta/prompt-reporter.js +85 -0
- package/dist/orquesta/prompt-reporter.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/setup/first-run-setup.d.ts +15 -0
- package/dist/setup/first-run-setup.d.ts.map +1 -0
- package/dist/setup/first-run-setup.js +238 -0
- package/dist/setup/first-run-setup.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 +135 -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 +27 -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 +411 -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 +101 -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 +1371 -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 +277 -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 +600 -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 +433 -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/config-sync.ts +362 -0
- package/src/orquesta/connection.ts +291 -0
- package/src/orquesta/prompt-reporter.ts +147 -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/setup/first-run-setup.ts +337 -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 +201 -0
- package/src/ui/PlanExecuteView.tsx +114 -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 +686 -0
- package/src/ui/components/Logo.tsx +203 -0
- package/src/ui/components/MarkdownRenderer.tsx +358 -0
- package/src/ui/components/ModelSelector.tsx +203 -0
- package/src/ui/components/PlanExecuteApp.tsx +2075 -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
package/src/cli.ts
ADDED
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Orquesta CLI
|
|
5
|
+
* AI-powered coding assistant with local LLM support
|
|
6
|
+
*
|
|
7
|
+
* Entry Point: CLI application entry point
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { Command } from 'commander';
|
|
11
|
+
import chalk from 'chalk';
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { render } from 'ink';
|
|
14
|
+
import { createRequire } from 'module';
|
|
15
|
+
import { configManager } from './core/config/config-manager.js';
|
|
16
|
+
import { createLLMClient } from './core/llm/llm-client.js';
|
|
17
|
+
import { PlanExecuteApp } from './ui/components/PlanExecuteApp.js';
|
|
18
|
+
import { setupLogging, logger } from './utils/logger.js';
|
|
19
|
+
import { runEvalMode } from './eval/index.js';
|
|
20
|
+
import { initializeOptionalTools } from './tools/registry.js';
|
|
21
|
+
import { sessionManager } from './core/session/session-manager.js';
|
|
22
|
+
import { connectWithToken, showConnectionStatus, disconnectFromOrquesta, switchProject } from './setup/first-run-setup.js';
|
|
23
|
+
import { syncOrquestaConfigs } from './orquesta/config-sync.js';
|
|
24
|
+
|
|
25
|
+
// Read version from package.json (single source of truth)
|
|
26
|
+
const require = createRequire(import.meta.url);
|
|
27
|
+
const packageJson = require('../package.json') as { version: string };
|
|
28
|
+
|
|
29
|
+
const program = new Command();
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* CLI program configuration
|
|
33
|
+
*/
|
|
34
|
+
program
|
|
35
|
+
.name('orquesta')
|
|
36
|
+
.description('Orquesta CLI - AI-powered coding assistant with local LLM support')
|
|
37
|
+
.version(packageJson.version)
|
|
38
|
+
.helpOption(false); // Disable -h, --help (use /help command instead)
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Default command: Start interactive mode
|
|
42
|
+
*/
|
|
43
|
+
program
|
|
44
|
+
.option('-p, --print <prompt>', 'Execute a prompt and exit (non-interactive mode)')
|
|
45
|
+
.option('--dangerously-skip-permissions', 'Skip all permission prompts (auto-approve)')
|
|
46
|
+
.option('--verbose', 'Enable verbose logging')
|
|
47
|
+
.option('--debug', 'Enable debug logging')
|
|
48
|
+
.option('--llm-log', 'Enable LLM logging')
|
|
49
|
+
.option('--eval', 'Evaluation mode: read JSON from stdin, output NDJSON events')
|
|
50
|
+
.option('--token <token>', 'Connect to Orquesta dashboard with CLI token')
|
|
51
|
+
.option('--project <projectId>', 'Select project ID when connecting with token')
|
|
52
|
+
.option('--switch-project [projectId]', 'Switch to a different project')
|
|
53
|
+
.option('--status', 'Show Orquesta connection status and exit')
|
|
54
|
+
.option('--disconnect', 'Disconnect from Orquesta and exit')
|
|
55
|
+
.option('--sync', 'Sync configurations with Orquesta and exit')
|
|
56
|
+
.action(async (options: { print?: string; dangerouslySkipPermissions?: boolean; verbose?: boolean; debug?: boolean; llmLog?: boolean; eval?: boolean; token?: string; project?: string; switchProject?: string | boolean; status?: boolean; disconnect?: boolean; sync?: boolean }) => {
|
|
57
|
+
// --eval mode: stdin JSON input, stdout NDJSON event output
|
|
58
|
+
if (options.eval) {
|
|
59
|
+
await runEvalMode();
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Initialize ConfigManager early for Orquesta-related commands
|
|
64
|
+
await configManager.initialize();
|
|
65
|
+
|
|
66
|
+
// --status: Show connection status and exit
|
|
67
|
+
if (options.status) {
|
|
68
|
+
showConnectionStatus();
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// --disconnect: Disconnect from Orquesta and exit
|
|
73
|
+
if (options.disconnect) {
|
|
74
|
+
await disconnectFromOrquesta();
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// --switch-project: Switch to a different project and exit
|
|
79
|
+
if (options.switchProject !== undefined) {
|
|
80
|
+
const projectId = typeof options.switchProject === 'string' ? options.switchProject : undefined;
|
|
81
|
+
const success = await switchProject(projectId);
|
|
82
|
+
process.exit(success ? 0 : 1);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// --token: Connect to Orquesta with token
|
|
86
|
+
if (options.token) {
|
|
87
|
+
const result = await connectWithToken(options.token, options.project);
|
|
88
|
+
if (!result.connected) {
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
91
|
+
// Continue to start the CLI after connecting
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// --sync: Sync configurations and exit
|
|
95
|
+
if (options.sync) {
|
|
96
|
+
if (!configManager.hasOrquestaConnection()) {
|
|
97
|
+
console.log(chalk.yellow('Not connected to Orquesta. Use --token to connect first.'));
|
|
98
|
+
process.exit(1);
|
|
99
|
+
}
|
|
100
|
+
const ora = (await import('ora')).default;
|
|
101
|
+
const spinner = ora({ text: chalk.cyan('Syncing configurations...'), color: 'cyan' }).start();
|
|
102
|
+
const result = await syncOrquestaConfigs();
|
|
103
|
+
if (result.success) {
|
|
104
|
+
spinner.succeed(chalk.green(`Synced: ${result.added} added, ${result.updated} updated, ${result.unchanged} unchanged`));
|
|
105
|
+
} else {
|
|
106
|
+
spinner.fail(chalk.red(`Sync failed: ${result.error}`));
|
|
107
|
+
}
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// -p mode: Execute prompt and exit (orquesta-agent compatibility)
|
|
112
|
+
if (options.print) {
|
|
113
|
+
const { EvalRunner } = await import('./eval/eval-runner.js');
|
|
114
|
+
const runner = new EvalRunner();
|
|
115
|
+
await runner.run({
|
|
116
|
+
prompt: options.print,
|
|
117
|
+
working_dir: process.cwd(),
|
|
118
|
+
});
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
let cleanup: (() => Promise<void>) | null = null;
|
|
123
|
+
try {
|
|
124
|
+
// Clear terminal on start
|
|
125
|
+
process.stdout.write('\x1B[2J\x1B[0f');
|
|
126
|
+
|
|
127
|
+
// Show loading spinner immediately (before any async work)
|
|
128
|
+
const ora = (await import('ora')).default;
|
|
129
|
+
const spinner = ora({
|
|
130
|
+
text: chalk.cyan('Starting Orquesta CLI...'),
|
|
131
|
+
color: 'cyan',
|
|
132
|
+
}).start();
|
|
133
|
+
|
|
134
|
+
// Setup logging (log level, JSON stream logger, exit handlers)
|
|
135
|
+
const loggingSetup = await setupLogging({
|
|
136
|
+
verbose: options.verbose,
|
|
137
|
+
debug: options.debug,
|
|
138
|
+
llmLog: options.llmLog,
|
|
139
|
+
});
|
|
140
|
+
cleanup = loggingSetup.cleanup;
|
|
141
|
+
|
|
142
|
+
// Log session start
|
|
143
|
+
logger.sessionStart({
|
|
144
|
+
sessionId: sessionManager.getCurrentSessionId(),
|
|
145
|
+
verbose: options.verbose,
|
|
146
|
+
debug: options.debug,
|
|
147
|
+
llmLog: options.llmLog,
|
|
148
|
+
cwd: process.cwd(),
|
|
149
|
+
platform: process.platform,
|
|
150
|
+
nodeVersion: process.version,
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
// ConfigManager already initialized above (for Orquesta commands)
|
|
154
|
+
// Just log the flow
|
|
155
|
+
logger.flow('Config manager already initialized');
|
|
156
|
+
|
|
157
|
+
// Load saved optional tool states (e.g., browser tools, Office tools)
|
|
158
|
+
spinner.text = chalk.cyan('Loading tools...');
|
|
159
|
+
logger.flow('Initializing optional tools');
|
|
160
|
+
await initializeOptionalTools();
|
|
161
|
+
logger.flow('Optional tools initialized');
|
|
162
|
+
|
|
163
|
+
// Sync configs from Orquesta if connected and auto-sync enabled
|
|
164
|
+
if (configManager.hasOrquestaConnection() && configManager.shouldAutoSync()) {
|
|
165
|
+
spinner.text = chalk.cyan('Syncing with Orquesta...');
|
|
166
|
+
logger.flow('Auto-syncing with Orquesta');
|
|
167
|
+
try {
|
|
168
|
+
const syncResult = await syncOrquestaConfigs();
|
|
169
|
+
if (syncResult.success && (syncResult.added > 0 || syncResult.updated > 0)) {
|
|
170
|
+
logger.flow('Orquesta sync complete', { added: syncResult.added, updated: syncResult.updated });
|
|
171
|
+
}
|
|
172
|
+
} catch (error) {
|
|
173
|
+
// Don't fail startup on sync errors
|
|
174
|
+
logger.warn('Orquesta sync failed', { error: error instanceof Error ? error.message : String(error) });
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Create LLMClient (null if no endpoints)
|
|
179
|
+
spinner.text = chalk.cyan('Creating LLM client...');
|
|
180
|
+
let llmClient = null;
|
|
181
|
+
let modelInfo = { model: 'Not configured', endpoint: 'Not configured' };
|
|
182
|
+
|
|
183
|
+
if (configManager.hasEndpoints()) {
|
|
184
|
+
logger.flow('Creating LLM client');
|
|
185
|
+
try {
|
|
186
|
+
llmClient = createLLMClient();
|
|
187
|
+
modelInfo = llmClient.getModelInfo();
|
|
188
|
+
logger.flow('LLM client created', { model: modelInfo.model, endpoint: modelInfo.endpoint });
|
|
189
|
+
} catch (error) {
|
|
190
|
+
// Keep null on LLMClient creation failure
|
|
191
|
+
logger.warn('Failed to create LLM client', { error: error instanceof Error ? error.message : String(error) });
|
|
192
|
+
}
|
|
193
|
+
} else {
|
|
194
|
+
logger.flow('No LLM endpoints configured');
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Stop spinner before starting Ink UI
|
|
198
|
+
spinner.stop();
|
|
199
|
+
process.stdout.write('\x1B[2J\x1B[0f'); // Clear again for clean UI
|
|
200
|
+
|
|
201
|
+
// Start Ink UI (show start message only in verbose/debug/llm-log mode)
|
|
202
|
+
if (options.verbose || options.debug) {
|
|
203
|
+
console.log(chalk.cyan('🚀 Starting Orquesta CLI...\n'));
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Render Ink UI directly in same process (keep stdin raw mode)
|
|
207
|
+
try {
|
|
208
|
+
// Use PlanExecuteApp for enhanced functionality
|
|
209
|
+
// exitOnCtrlC: false - Ctrl+C is handled manually in PlanExecuteApp for smart behavior
|
|
210
|
+
const { waitUntilExit } = render(
|
|
211
|
+
React.createElement(PlanExecuteApp, { llmClient, modelInfo }),
|
|
212
|
+
{ exitOnCtrlC: false }
|
|
213
|
+
);
|
|
214
|
+
|
|
215
|
+
// Wait until the UI exits before cleanup
|
|
216
|
+
await waitUntilExit();
|
|
217
|
+
} catch (error) {
|
|
218
|
+
console.log(chalk.yellow('\n⚠️ Cannot start Ink UI.\n'));
|
|
219
|
+
console.log(chalk.dim(`Error: ${error instanceof Error ? error.message : String(error)}\n`));
|
|
220
|
+
process.exit(1);
|
|
221
|
+
}
|
|
222
|
+
} catch (error) {
|
|
223
|
+
console.error(chalk.red('\n❌ Error occurred:'));
|
|
224
|
+
if (error instanceof Error) {
|
|
225
|
+
console.error(chalk.red(error.message));
|
|
226
|
+
}
|
|
227
|
+
console.log();
|
|
228
|
+
process.exit(1);
|
|
229
|
+
} finally {
|
|
230
|
+
// Log session end
|
|
231
|
+
logger.sessionEnd({
|
|
232
|
+
sessionId: sessionManager.getCurrentSessionId(),
|
|
233
|
+
exitReason: 'normal',
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
// Cleanup JSON Stream Logger
|
|
237
|
+
if (cleanup) {
|
|
238
|
+
await cleanup();
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Error handling: unknown options
|
|
246
|
+
*/
|
|
247
|
+
program.showHelpAfterError(false);
|
|
248
|
+
program.configureOutput({
|
|
249
|
+
outputError: (str, write) => {
|
|
250
|
+
if (str.includes('--help') || str.includes('-h')) {
|
|
251
|
+
write(chalk.yellow('💡 For help, use /help command after starting the app.\n'));
|
|
252
|
+
} else {
|
|
253
|
+
write(chalk.red(str));
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
program.on('command:*', () => {
|
|
259
|
+
console.error(chalk.red('⚠️ Unknown command.'));
|
|
260
|
+
console.log(chalk.white('Usage: orquesta [options]\n'));
|
|
261
|
+
console.log(chalk.white(' -p, --print <prompt> Execute a prompt and exit\n'));
|
|
262
|
+
console.log(chalk.white(' --token <token> Connect to Orquesta dashboard\n'));
|
|
263
|
+
console.log(chalk.white(' --project <id> Select project when connecting\n'));
|
|
264
|
+
console.log(chalk.white(' --switch-project [id] Switch to a different project\n'));
|
|
265
|
+
console.log(chalk.white(' --status Show Orquesta connection status\n'));
|
|
266
|
+
console.log(chalk.white(' --sync Sync configurations with Orquesta\n'));
|
|
267
|
+
console.log(chalk.white(' --disconnect Disconnect from Orquesta\n'));
|
|
268
|
+
console.log(chalk.white(' --verbose Enable verbose logging\n'));
|
|
269
|
+
console.log(chalk.white(' --debug Enable debug logging\n'));
|
|
270
|
+
console.log(chalk.white('\nUse /help in interactive mode for more help.\n'));
|
|
271
|
+
process.exit(1);
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Run CLI program
|
|
276
|
+
*/
|
|
277
|
+
program.parse(process.argv);
|
package/src/constants.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Orquesta CLI Constants
|
|
3
|
+
*
|
|
4
|
+
* Global constants definition for the project
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as path from 'path';
|
|
8
|
+
import * as os from 'os';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Orquesta CLI home directory
|
|
12
|
+
* ~/.orquesta-cli/
|
|
13
|
+
*/
|
|
14
|
+
export const LOCAL_HOME_DIR = path.join(os.homedir(), '.orquesta-cli');
|
|
15
|
+
|
|
16
|
+
// Backward compatibility alias
|
|
17
|
+
export const OPEN_HOME_DIR = LOCAL_HOME_DIR;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Config file path
|
|
21
|
+
* ~/.orquesta-cli/config.json
|
|
22
|
+
*/
|
|
23
|
+
export const CONFIG_FILE_PATH = path.join(LOCAL_HOME_DIR, 'config.json');
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Documentation directory
|
|
27
|
+
* ~/.orquesta-cli/docs/
|
|
28
|
+
*/
|
|
29
|
+
export const DOCS_DIR = path.join(LOCAL_HOME_DIR, 'docs');
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Backup directory
|
|
33
|
+
* ~/.orquesta-cli/backups/
|
|
34
|
+
*/
|
|
35
|
+
export const BACKUPS_DIR = path.join(LOCAL_HOME_DIR, 'backups');
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Project-specific log directory
|
|
39
|
+
* ~/.orquesta-cli/projects/
|
|
40
|
+
*/
|
|
41
|
+
export const PROJECTS_DIR = path.join(LOCAL_HOME_DIR, 'projects');
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Application version (injected from package.json)
|
|
46
|
+
*/
|
|
47
|
+
export const APP_VERSION = '4.2.2';
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compact Manager
|
|
3
|
+
*
|
|
4
|
+
* Executes conversation compaction using LLM.
|
|
5
|
+
* Handles the compact workflow: build prompt → call LLM → parse result.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { LLMClient } from '../llm/llm-client.js';
|
|
9
|
+
import { Message } from '../../types/index.js';
|
|
10
|
+
import {
|
|
11
|
+
COMPACT_SYSTEM_PROMPT,
|
|
12
|
+
buildCompactUserPrompt,
|
|
13
|
+
buildCompactedMessages,
|
|
14
|
+
CompactContext,
|
|
15
|
+
} from './compact-prompts.js';
|
|
16
|
+
import { logger } from '../../utils/logger.js';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Result of compact operation
|
|
20
|
+
*/
|
|
21
|
+
export interface CompactResult {
|
|
22
|
+
/** Whether compact succeeded */
|
|
23
|
+
success: boolean;
|
|
24
|
+
/** Original message count */
|
|
25
|
+
originalMessageCount: number;
|
|
26
|
+
/** New message count after compact */
|
|
27
|
+
newMessageCount: number;
|
|
28
|
+
/** The compact summary generated */
|
|
29
|
+
compactedSummary?: string;
|
|
30
|
+
/** The compacted messages array (for caller to use) */
|
|
31
|
+
compactedMessages?: Message[];
|
|
32
|
+
/** Error message if failed */
|
|
33
|
+
error?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Minimum messages required for compact
|
|
38
|
+
*/
|
|
39
|
+
const MIN_MESSAGES_FOR_COMPACT = 5;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Compact Manager Class
|
|
43
|
+
*/
|
|
44
|
+
export class CompactManager {
|
|
45
|
+
constructor(private llmClient: LLMClient) {}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Execute conversation compaction
|
|
49
|
+
*/
|
|
50
|
+
async compact(
|
|
51
|
+
messages: Message[],
|
|
52
|
+
context: CompactContext
|
|
53
|
+
): Promise<CompactResult> {
|
|
54
|
+
logger.enter('CompactManager.compact', {
|
|
55
|
+
messageCount: messages.length,
|
|
56
|
+
hasTodos: !!context.todos?.length,
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// Validate minimum messages
|
|
60
|
+
const nonSystemMessages = messages.filter(m => m.role !== 'system');
|
|
61
|
+
if (nonSystemMessages.length < MIN_MESSAGES_FOR_COMPACT) {
|
|
62
|
+
logger.flow('Compact skipped - not enough messages');
|
|
63
|
+
logger.exit('CompactManager.compact', { skipped: true });
|
|
64
|
+
return {
|
|
65
|
+
success: false,
|
|
66
|
+
originalMessageCount: messages.length,
|
|
67
|
+
newMessageCount: messages.length,
|
|
68
|
+
error: `At least ${MIN_MESSAGES_FOR_COMPACT} messages required. (Current: ${nonSystemMessages.length})`,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
try {
|
|
73
|
+
logger.flow('Building compact prompt');
|
|
74
|
+
|
|
75
|
+
// Build the user prompt with context
|
|
76
|
+
const userPrompt = buildCompactUserPrompt(messages, context);
|
|
77
|
+
|
|
78
|
+
logger.vars(
|
|
79
|
+
{ name: 'promptLength', value: userPrompt.length },
|
|
80
|
+
{ name: 'todoCount', value: context.todos?.length || 0 },
|
|
81
|
+
{ name: 'recentFilesCount', value: context.recentFiles?.length || 0 }
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
// Call LLM for compaction
|
|
85
|
+
logger.flow('Calling LLM for compaction');
|
|
86
|
+
logger.startTimer('compact-llm');
|
|
87
|
+
|
|
88
|
+
const response = await this.llmClient.sendMessage(
|
|
89
|
+
userPrompt,
|
|
90
|
+
COMPACT_SYSTEM_PROMPT
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
const elapsed = logger.endTimer('compact-llm');
|
|
94
|
+
logger.debug('Compact LLM response received', { elapsed, responseLength: response.length });
|
|
95
|
+
|
|
96
|
+
// Validate response
|
|
97
|
+
if (!response || response.trim().length === 0) {
|
|
98
|
+
throw new Error('LLM returned empty response');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Build compacted messages
|
|
102
|
+
const compactedMessages = buildCompactedMessages(response, context);
|
|
103
|
+
|
|
104
|
+
// Note: contextTracker.reset() is called by PlanExecutor after applying final messages
|
|
105
|
+
// This keeps CompactManager focused on summary generation only
|
|
106
|
+
|
|
107
|
+
logger.flow('Compact completed successfully');
|
|
108
|
+
logger.vars(
|
|
109
|
+
{ name: 'originalCount', value: messages.length },
|
|
110
|
+
{ name: 'newCount', value: compactedMessages.length }
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
logger.exit('CompactManager.compact', { success: true });
|
|
114
|
+
|
|
115
|
+
return {
|
|
116
|
+
success: true,
|
|
117
|
+
originalMessageCount: messages.length,
|
|
118
|
+
newMessageCount: compactedMessages.length,
|
|
119
|
+
compactedSummary: response,
|
|
120
|
+
compactedMessages,
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
} catch (error) {
|
|
124
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
125
|
+
logger.error('Compact failed', error as Error);
|
|
126
|
+
logger.exit('CompactManager.compact', { success: false, error: errorMessage });
|
|
127
|
+
|
|
128
|
+
return {
|
|
129
|
+
success: false,
|
|
130
|
+
originalMessageCount: messages.length,
|
|
131
|
+
newMessageCount: messages.length,
|
|
132
|
+
error: `Compact failed: ${errorMessage}`,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Build compacted messages from summary
|
|
139
|
+
* Utility method for external use
|
|
140
|
+
*/
|
|
141
|
+
buildCompactedMessages(summary: string, context: CompactContext): Message[] {
|
|
142
|
+
return buildCompactedMessages(summary, context);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Check if compact is possible
|
|
147
|
+
*/
|
|
148
|
+
canCompact(messages: Message[]): { canCompact: boolean; reason?: string } {
|
|
149
|
+
const nonSystemMessages = messages.filter(m => m.role !== 'system');
|
|
150
|
+
|
|
151
|
+
if (nonSystemMessages.length < MIN_MESSAGES_FOR_COMPACT) {
|
|
152
|
+
return {
|
|
153
|
+
canCompact: false,
|
|
154
|
+
reason: `At least ${MIN_MESSAGES_FOR_COMPACT} messages required.`,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return { canCompact: true };
|
|
159
|
+
}
|
|
160
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compact Prompts
|
|
3
|
+
*
|
|
4
|
+
* System prompt and user prompt builder for conversation compaction.
|
|
5
|
+
* Implements dynamic context injection for TODOs, recent files, etc.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { Message, TodoItem } from '../../types/index.js';
|
|
9
|
+
|
|
10
|
+
// Re-export COMPACT_SYSTEM_PROMPT from centralized location
|
|
11
|
+
export { COMPACT_SYSTEM_PROMPT } from '../../prompts/system/compact.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Context to inject into compact prompt
|
|
15
|
+
*/
|
|
16
|
+
export interface CompactContext {
|
|
17
|
+
/** Current TODO list from system state */
|
|
18
|
+
todos?: TodoItem[];
|
|
19
|
+
/** Current working directory */
|
|
20
|
+
workingDirectory?: string;
|
|
21
|
+
/** Current model name */
|
|
22
|
+
currentModel?: string;
|
|
23
|
+
/** Recently accessed files */
|
|
24
|
+
recentFiles?: string[];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Build user prompt with dynamic context injection
|
|
29
|
+
*/
|
|
30
|
+
export function buildCompactUserPrompt(
|
|
31
|
+
messages: Message[],
|
|
32
|
+
context: CompactContext
|
|
33
|
+
): string {
|
|
34
|
+
const parts: string[] = [];
|
|
35
|
+
|
|
36
|
+
// 1. Current System State
|
|
37
|
+
parts.push('# Current System State');
|
|
38
|
+
parts.push(`Working Directory: ${context.workingDirectory || process.cwd()}`);
|
|
39
|
+
if (context.currentModel) {
|
|
40
|
+
parts.push(`Model: ${context.currentModel}`);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// 2. Recent Files (if any)
|
|
44
|
+
if (context.recentFiles && context.recentFiles.length > 0) {
|
|
45
|
+
parts.push('');
|
|
46
|
+
parts.push('Recent Files Accessed:');
|
|
47
|
+
context.recentFiles.forEach(f => parts.push(`- \`${f}\``));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// 3. Current TODO List (MUST PRESERVE - injected from system state)
|
|
51
|
+
if (context.todos && context.todos.length > 0) {
|
|
52
|
+
parts.push('');
|
|
53
|
+
parts.push('# Current TODO List (MUST PRESERVE)');
|
|
54
|
+
context.todos.forEach(todo => {
|
|
55
|
+
const statusIcon = todo.status === 'completed' ? 'x' :
|
|
56
|
+
todo.status === 'in_progress' ? '~' : ' ';
|
|
57
|
+
const statusLabel = todo.status === 'in_progress' ? ' [IN PROGRESS]' :
|
|
58
|
+
todo.status === 'completed' ? ' [DONE]' : '';
|
|
59
|
+
parts.push(`- [${statusIcon}] ${todo.title}${statusLabel}`);
|
|
60
|
+
if (todo.result) {
|
|
61
|
+
parts.push(` Result: ${todo.result}`);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// 4. Conversation History
|
|
67
|
+
parts.push('');
|
|
68
|
+
parts.push('# Conversation History to Compress');
|
|
69
|
+
parts.push('```');
|
|
70
|
+
|
|
71
|
+
let messageIndex = 0;
|
|
72
|
+
messages.forEach((msg) => {
|
|
73
|
+
// Skip system messages
|
|
74
|
+
if (msg.role === 'system') return;
|
|
75
|
+
|
|
76
|
+
messageIndex++;
|
|
77
|
+
const role = msg.role === 'user' ? 'USER'
|
|
78
|
+
: msg.role === 'tool' ? 'TOOL_RESULT'
|
|
79
|
+
: 'ASSISTANT';
|
|
80
|
+
|
|
81
|
+
// For assistant messages with tool_calls, show what tools were called
|
|
82
|
+
const toolCallInfo = msg.tool_calls?.length
|
|
83
|
+
? `\n[Called tools: ${msg.tool_calls.map((tc) => tc.function?.name).join(', ')}]`
|
|
84
|
+
: '';
|
|
85
|
+
|
|
86
|
+
const content = typeof msg.content === 'string'
|
|
87
|
+
? msg.content
|
|
88
|
+
: JSON.stringify(msg.content);
|
|
89
|
+
|
|
90
|
+
// Truncate very long messages (keep first 3000 chars)
|
|
91
|
+
const truncated = content.length > 3000
|
|
92
|
+
? content.slice(0, 3000) + '\n... [truncated]'
|
|
93
|
+
: content;
|
|
94
|
+
|
|
95
|
+
if (msg.role === 'tool') {
|
|
96
|
+
parts.push(`[${messageIndex}] ${role} (call_id: ${msg.tool_call_id || 'unknown'}):`);
|
|
97
|
+
} else {
|
|
98
|
+
parts.push(`[${messageIndex}] ${role}:${toolCallInfo}`);
|
|
99
|
+
}
|
|
100
|
+
parts.push(truncated);
|
|
101
|
+
parts.push('');
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
parts.push('```');
|
|
105
|
+
|
|
106
|
+
// 5. Compression Instructions
|
|
107
|
+
parts.push('');
|
|
108
|
+
parts.push('# Instructions');
|
|
109
|
+
parts.push('Compress the above conversation into the specified format.');
|
|
110
|
+
if (context.todos && context.todos.length > 0) {
|
|
111
|
+
parts.push('CRITICAL: The TODO list above is the CURRENT state - preserve it exactly in your Active Tasks section.');
|
|
112
|
+
}
|
|
113
|
+
parts.push('Focus on what matters for continuing the work.');
|
|
114
|
+
|
|
115
|
+
return parts.join('\n');
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Build messages array after compact
|
|
120
|
+
* Creates user message with session context, assistant acknowledgment, and continue prompt
|
|
121
|
+
* Note: System prompt will be added by plan-executor when needed
|
|
122
|
+
*/
|
|
123
|
+
export function buildCompactedMessages(
|
|
124
|
+
compactSummary: string,
|
|
125
|
+
context: CompactContext
|
|
126
|
+
): Message[] {
|
|
127
|
+
// Compact summary as user message (not system) to avoid multiple system messages
|
|
128
|
+
const contextMessage = `[SESSION CONTEXT - Previous conversation was compacted]
|
|
129
|
+
|
|
130
|
+
${compactSummary}
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
Working Directory: ${context.workingDirectory || process.cwd()}
|
|
134
|
+
`;
|
|
135
|
+
|
|
136
|
+
return [
|
|
137
|
+
{
|
|
138
|
+
role: 'user',
|
|
139
|
+
content: contextMessage,
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
role: 'assistant',
|
|
143
|
+
content: 'Understood. I have the session context.',
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
role: 'user',
|
|
147
|
+
content: 'Please continue your work.',
|
|
148
|
+
},
|
|
149
|
+
];
|
|
150
|
+
}
|