@travisennis/acai 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +225 -39
- package/dist/agent/index.d.ts +30 -21
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +237 -198
- package/dist/cli.d.ts +4 -3
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +56 -18
- package/dist/commands/add-directory/index.d.ts +3 -0
- package/dist/commands/add-directory/index.d.ts.map +1 -0
- package/dist/commands/add-directory/index.js +50 -0
- package/dist/commands/add-directory/types.d.ts +6 -0
- package/dist/commands/add-directory/types.d.ts.map +1 -0
- package/dist/commands/add-directory/utils.d.ts +3 -0
- package/dist/commands/add-directory/utils.d.ts.map +1 -0
- package/dist/commands/add-directory/utils.js +15 -0
- package/dist/commands/clear/index.d.ts +3 -0
- package/dist/commands/clear/index.d.ts.map +1 -0
- package/dist/commands/{clear-command.js → clear/index.js} +1 -7
- package/dist/commands/copy/index.d.ts +3 -0
- package/dist/commands/copy/index.d.ts.map +1 -0
- package/dist/commands/copy/index.js +39 -0
- package/dist/commands/copy/types.d.ts +3 -0
- package/dist/commands/copy/types.d.ts.map +1 -0
- package/dist/commands/copy/types.js +1 -0
- package/dist/commands/copy/utils.d.ts +3 -0
- package/dist/commands/copy/utils.d.ts.map +1 -0
- package/dist/commands/copy/utils.js +22 -0
- package/dist/commands/exit/index.d.ts +10 -0
- package/dist/commands/exit/index.d.ts.map +1 -0
- package/dist/commands/exit/index.js +21 -0
- package/dist/commands/exit/types.d.ts +8 -0
- package/dist/commands/exit/types.d.ts.map +1 -0
- package/dist/commands/exit/types.js +1 -0
- package/dist/commands/exit/utils.d.ts +2 -0
- package/dist/commands/exit/utils.d.ts.map +1 -0
- package/dist/commands/exit/utils.js +13 -0
- package/dist/commands/generate-rules/index.d.ts +3 -0
- package/dist/commands/generate-rules/index.d.ts.map +1 -0
- package/dist/commands/{generate-rules-command.js → generate-rules/index.js} +65 -147
- package/dist/commands/generate-rules/utils.d.ts +5 -0
- package/dist/commands/generate-rules/utils.d.ts.map +1 -0
- package/dist/commands/generate-rules/utils.js +25 -0
- package/dist/commands/handoff/index.d.ts +3 -0
- package/dist/commands/handoff/index.d.ts.map +1 -0
- package/dist/commands/handoff/index.js +97 -0
- package/dist/commands/handoff/utils.d.ts +4 -0
- package/dist/commands/handoff/utils.d.ts.map +1 -0
- package/dist/commands/handoff/utils.js +123 -0
- package/dist/commands/health/index.d.ts +3 -0
- package/dist/commands/health/index.d.ts.map +1 -0
- package/dist/commands/health/index.js +56 -0
- package/dist/commands/health/utils.d.ts +15 -0
- package/dist/commands/health/utils.d.ts.map +1 -0
- package/dist/commands/health/utils.js +52 -0
- package/dist/commands/help/index.d.ts +3 -0
- package/dist/commands/help/index.d.ts.map +1 -0
- package/dist/commands/{help-command.js → help/index.js} +6 -14
- package/dist/commands/history/index.d.ts +3 -0
- package/dist/commands/history/index.d.ts.map +1 -0
- package/dist/commands/{history-command.js → history/index.js} +40 -200
- package/dist/commands/history/types.d.ts +11 -0
- package/dist/commands/history/types.d.ts.map +1 -0
- package/dist/commands/history/types.js +1 -0
- package/dist/commands/history/utils.d.ts +4 -0
- package/dist/commands/history/utils.d.ts.map +1 -0
- package/dist/commands/history/utils.js +86 -0
- package/dist/commands/init/index.d.ts +3 -0
- package/dist/commands/init/index.d.ts.map +1 -0
- package/dist/commands/{init-command.js → init/index.js} +17 -27
- package/dist/commands/init-project/index.d.ts +3 -0
- package/dist/commands/init-project/index.d.ts.map +1 -0
- package/dist/commands/init-project/index.js +51 -0
- package/dist/commands/init-project/utils.d.ts +9 -0
- package/dist/commands/init-project/utils.d.ts.map +1 -0
- package/dist/commands/init-project/utils.js +43 -0
- package/dist/commands/list-directories/index.d.ts +3 -0
- package/dist/commands/list-directories/index.d.ts.map +1 -0
- package/dist/commands/{list-directories-command.js → list-directories/index.js} +2 -15
- package/dist/commands/list-tools/index.d.ts +3 -0
- package/dist/commands/list-tools/index.d.ts.map +1 -0
- package/dist/commands/list-tools/index.js +89 -0
- package/dist/commands/manager.d.ts +2 -9
- package/dist/commands/manager.d.ts.map +1 -1
- package/dist/commands/manager.js +38 -83
- package/dist/commands/model/index.d.ts +3 -0
- package/dist/commands/model/index.d.ts.map +1 -0
- package/dist/commands/model/index.js +182 -0
- package/dist/commands/model/utils.d.ts +3 -0
- package/dist/commands/model/utils.d.ts.map +1 -0
- package/dist/commands/model/utils.js +5 -0
- package/dist/commands/paste/index.d.ts +3 -0
- package/dist/commands/paste/index.d.ts.map +1 -0
- package/dist/commands/paste/index.js +94 -0
- package/dist/commands/paste/utils.d.ts +5 -0
- package/dist/commands/paste/utils.d.ts.map +1 -0
- package/dist/commands/paste/utils.js +86 -0
- package/dist/commands/pickup/index.d.ts +3 -0
- package/dist/commands/pickup/index.d.ts.map +1 -0
- package/dist/commands/pickup/index.js +138 -0
- package/dist/commands/pickup/types.d.ts +6 -0
- package/dist/commands/pickup/types.d.ts.map +1 -0
- package/dist/commands/pickup/types.js +1 -0
- package/dist/commands/pickup/utils.d.ts +7 -0
- package/dist/commands/pickup/utils.d.ts.map +1 -0
- package/dist/commands/pickup/utils.js +56 -0
- package/dist/commands/prompt/index.d.ts +5 -0
- package/dist/commands/prompt/index.d.ts.map +1 -0
- package/dist/commands/prompt/index.js +126 -0
- package/dist/commands/prompt/types.d.ts +15 -0
- package/dist/commands/prompt/types.d.ts.map +1 -0
- package/dist/commands/prompt/types.js +1 -0
- package/dist/commands/prompt/utils.d.ts +12 -0
- package/dist/commands/prompt/utils.d.ts.map +1 -0
- package/dist/commands/prompt/utils.js +107 -0
- package/dist/commands/remove-directory/index.d.ts +3 -0
- package/dist/commands/remove-directory/index.d.ts.map +1 -0
- package/dist/commands/{remove-directory-command.js → remove-directory/index.js} +3 -35
- package/dist/commands/reset/index.d.ts +3 -0
- package/dist/commands/reset/index.d.ts.map +1 -0
- package/dist/commands/{reset-command.js → reset/index.js} +8 -11
- package/dist/commands/reset/types.d.ts +1 -0
- package/dist/commands/reset/types.d.ts.map +1 -0
- package/dist/commands/reset/types.js +3 -0
- package/dist/commands/resources/index.d.ts +3 -0
- package/dist/commands/resources/index.d.ts.map +1 -0
- package/dist/commands/resources/index.js +84 -0
- package/dist/commands/review/index.d.ts +3 -0
- package/dist/commands/review/index.d.ts.map +1 -0
- package/dist/commands/review/index.js +126 -0
- package/dist/commands/review/types.d.ts +12 -0
- package/dist/commands/review/types.d.ts.map +1 -0
- package/dist/commands/review/types.js +1 -0
- package/dist/commands/review/utils.d.ts +4 -0
- package/dist/commands/review/utils.d.ts.map +1 -0
- package/dist/commands/review/utils.js +87 -0
- package/dist/commands/save/index.d.ts +3 -0
- package/dist/commands/save/index.d.ts.map +1 -0
- package/dist/commands/{save-command.js → save/index.js} +3 -10
- package/dist/commands/session/index.d.ts +3 -0
- package/dist/commands/session/index.d.ts.map +1 -0
- package/dist/commands/session/index.js +197 -0
- package/dist/commands/session/types.d.ts +13 -0
- package/dist/commands/session/types.d.ts.map +1 -0
- package/dist/commands/session/types.js +7 -0
- package/dist/commands/shell/index.d.ts +3 -0
- package/dist/commands/shell/index.d.ts.map +1 -0
- package/dist/commands/{shell-command.js → shell/index.js} +4 -51
- package/dist/commands/types.d.ts +2 -5
- package/dist/commands/types.d.ts.map +1 -1
- package/dist/config.d.ts +36 -7
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +118 -60
- package/dist/dedent.d.ts.map +1 -1
- package/dist/dedent.js +7 -7
- package/dist/execution/index.d.ts +18 -2
- package/dist/execution/index.d.ts.map +1 -1
- package/dist/execution/index.js +119 -81
- package/dist/formatting.d.ts +46 -0
- package/dist/formatting.d.ts.map +1 -1
- package/dist/formatting.js +94 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +299 -177
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +4 -11
- package/dist/mentions.d.ts.map +1 -1
- package/dist/mentions.js +3 -53
- package/dist/middleware/audit-message.d.ts +2 -2
- package/dist/middleware/audit-message.d.ts.map +1 -1
- package/dist/middleware/audit-message.js +40 -2
- package/dist/middleware/cache.d.ts +2 -2
- package/dist/middleware/cache.d.ts.map +1 -1
- package/dist/middleware/cache.js +111 -27
- package/dist/middleware/rate-limit.d.ts +2 -2
- package/dist/middleware/rate-limit.d.ts.map +1 -1
- package/dist/middleware/rate-limit.js +1 -0
- package/dist/models/ai-config.d.ts.map +1 -1
- package/dist/models/ai-config.js +46 -29
- package/dist/models/anthropic-provider.d.ts +14 -13
- package/dist/models/anthropic-provider.d.ts.map +1 -1
- package/dist/models/anthropic-provider.js +0 -7
- package/dist/models/deepseek-provider.d.ts +9 -8
- package/dist/models/deepseek-provider.d.ts.map +1 -1
- package/dist/models/deepseek-provider.js +0 -2
- package/dist/models/google-provider.d.ts +10 -9
- package/dist/models/google-provider.d.ts.map +1 -1
- package/dist/models/google-provider.js +0 -3
- package/dist/models/groq-provider.d.ts +8 -7
- package/dist/models/groq-provider.d.ts.map +1 -1
- package/dist/models/groq-provider.js +0 -1
- package/dist/models/manager.d.ts +7 -4
- package/dist/models/manager.d.ts.map +1 -1
- package/dist/models/manager.js +5 -25
- package/dist/models/openai-provider.d.ts +11 -10
- package/dist/models/openai-provider.d.ts.map +1 -1
- package/dist/models/openai-provider.js +0 -4
- package/dist/models/opencode-zen-provider.d.ts +23 -0
- package/dist/models/opencode-zen-provider.d.ts.map +1 -0
- package/dist/models/opencode-zen-provider.js +76 -0
- package/dist/models/openrouter-provider.d.ts +34 -28
- package/dist/models/openrouter-provider.d.ts.map +1 -1
- package/dist/models/openrouter-provider.js +148 -139
- package/dist/models/providers.d.ts +6 -16
- package/dist/models/providers.d.ts.map +1 -1
- package/dist/models/providers.js +8 -58
- package/dist/models/xai-provider.d.ts +9 -8
- package/dist/models/xai-provider.d.ts.map +1 -1
- package/dist/models/xai-provider.js +0 -2
- package/dist/prompts/manager.d.ts +1 -1
- package/dist/prompts/manager.d.ts.map +1 -1
- package/dist/prompts/manager.js +1 -1
- package/dist/prompts.d.ts +8 -4
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +155 -177
- package/dist/repl/project-status.d.ts +19 -0
- package/dist/repl/project-status.d.ts.map +1 -0
- package/dist/repl/project-status.js +78 -0
- package/dist/repl-new.d.ts +15 -6
- package/dist/repl-new.d.ts.map +1 -1
- package/dist/repl-new.js +266 -83
- package/dist/{messages.d.ts → sessions/manager.d.ts} +13 -4
- package/dist/sessions/manager.d.ts.map +1 -0
- package/dist/{messages.js → sessions/manager.js} +126 -16
- package/dist/skills.d.ts +16 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +233 -0
- package/dist/terminal/control.d.ts +56 -0
- package/dist/terminal/control.d.ts.map +1 -0
- package/dist/terminal/control.js +111 -0
- package/dist/terminal/default-theme.d.ts +1 -1
- package/dist/terminal/default-theme.d.ts.map +1 -1
- package/dist/terminal/default-theme.js +24 -28
- package/dist/terminal/formatting.d.ts +23 -26
- package/dist/terminal/formatting.d.ts.map +1 -1
- package/dist/terminal/formatting.js +35 -53
- package/dist/terminal/highlight/index.d.ts.map +1 -1
- package/dist/terminal/highlight/index.js +3 -6
- package/dist/terminal/highlight/theme.d.ts.map +1 -1
- package/dist/terminal/highlight/theme.js +2 -6
- package/dist/terminal/index.d.ts +2 -101
- package/dist/terminal/index.d.ts.map +1 -1
- package/dist/terminal/index.js +2 -464
- package/dist/terminal/keys.d.ts +211 -0
- package/dist/terminal/keys.d.ts.map +1 -0
- package/dist/terminal/keys.js +546 -0
- package/dist/terminal/segmenter.d.ts +6 -0
- package/dist/terminal/segmenter.d.ts.map +1 -0
- package/dist/terminal/segmenter.js +11 -0
- package/dist/terminal/select-prompt.d.ts.map +1 -1
- package/dist/terminal/select-prompt.js +9 -21
- package/dist/terminal/string-width.d.ts.map +1 -1
- package/dist/terminal/string-width.js +40 -21
- package/dist/terminal/strip-ansi.d.ts.map +1 -1
- package/dist/terminal/strip-ansi.js +9 -15
- package/dist/terminal/table/cell.d.ts +114 -0
- package/dist/terminal/table/cell.d.ts.map +1 -0
- package/dist/terminal/table/cell.js +407 -0
- package/dist/terminal/table/debug.d.ts +15 -0
- package/dist/terminal/table/debug.d.ts.map +1 -0
- package/dist/terminal/table/debug.js +32 -0
- package/dist/terminal/table/index.d.ts +3 -0
- package/dist/terminal/table/index.d.ts.map +1 -0
- package/dist/terminal/table/index.js +2 -0
- package/dist/terminal/table/layout-manager.d.ts +27 -0
- package/dist/terminal/table/layout-manager.d.ts.map +1 -0
- package/dist/terminal/table/layout-manager.js +257 -0
- package/dist/terminal/table/table.d.ts +9 -0
- package/dist/terminal/table/table.d.ts.map +1 -0
- package/dist/terminal/table/table.js +97 -0
- package/dist/terminal/table/utils.d.ts +63 -0
- package/dist/terminal/table/utils.d.ts.map +1 -0
- package/dist/terminal/table/utils.js +326 -0
- package/dist/tokens/tracker.d.ts.map +1 -1
- package/dist/tokens/tracker.js +58 -16
- package/dist/tools/bash.d.ts +11 -11
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash.js +189 -81
- package/dist/tools/directory-tree.d.ts +9 -13
- package/dist/tools/directory-tree.d.ts.map +1 -1
- package/dist/tools/directory-tree.js +90 -60
- package/dist/tools/dynamic-tool-loader.d.ts +22 -8
- package/dist/tools/dynamic-tool-loader.d.ts.map +1 -1
- package/dist/tools/dynamic-tool-loader.js +41 -46
- package/dist/tools/edit-file.d.ts +6 -16
- package/dist/tools/edit-file.d.ts.map +1 -1
- package/dist/tools/edit-file.js +22 -66
- package/dist/tools/glob.d.ts +15 -16
- package/dist/tools/glob.d.ts.map +1 -1
- package/dist/tools/glob.js +78 -109
- package/dist/tools/grep.d.ts +19 -22
- package/dist/tools/grep.d.ts.map +1 -1
- package/dist/tools/grep.js +61 -93
- package/dist/tools/index.d.ts +202 -167
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +17 -273
- package/dist/tools/ls.d.ts +26 -0
- package/dist/tools/ls.d.ts.map +1 -0
- package/dist/tools/ls.js +80 -0
- package/dist/tools/read-file.d.ts +15 -15
- package/dist/tools/read-file.d.ts.map +1 -1
- package/dist/tools/read-file.js +52 -76
- package/dist/tools/save-file.d.ts +8 -8
- package/dist/tools/save-file.d.ts.map +1 -1
- package/dist/tools/save-file.js +42 -53
- package/dist/tools/think.d.ts +4 -4
- package/dist/tools/think.d.ts.map +1 -1
- package/dist/tools/think.js +9 -32
- package/dist/tools/types.d.ts +5 -21
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/types.js +0 -9
- package/dist/tui/autocomplete/attachment-provider.d.ts +18 -0
- package/dist/tui/autocomplete/attachment-provider.d.ts.map +1 -0
- package/dist/tui/autocomplete/attachment-provider.js +159 -0
- package/dist/tui/autocomplete/base-provider.d.ts +17 -0
- package/dist/tui/autocomplete/base-provider.d.ts.map +1 -0
- package/dist/tui/autocomplete/base-provider.js +1 -0
- package/dist/tui/autocomplete/combined-provider.d.ts +20 -0
- package/dist/tui/autocomplete/combined-provider.d.ts.map +1 -0
- package/dist/tui/autocomplete/combined-provider.js +61 -0
- package/dist/tui/autocomplete/command-provider.d.ts +20 -0
- package/dist/tui/autocomplete/command-provider.d.ts.map +1 -0
- package/dist/tui/autocomplete/command-provider.js +90 -0
- package/dist/tui/autocomplete/file-search-provider.d.ts +16 -0
- package/dist/tui/autocomplete/file-search-provider.d.ts.map +1 -0
- package/dist/tui/autocomplete/file-search-provider.js +123 -0
- package/dist/tui/autocomplete/path-provider.d.ts +21 -0
- package/dist/tui/autocomplete/path-provider.d.ts.map +1 -0
- package/dist/tui/autocomplete/path-provider.js +164 -0
- package/dist/tui/autocomplete/utils.d.ts +16 -0
- package/dist/tui/autocomplete/utils.d.ts.map +1 -0
- package/dist/tui/autocomplete/utils.js +137 -0
- package/dist/tui/autocomplete.d.ts +12 -43
- package/dist/tui/autocomplete.d.ts.map +1 -1
- package/dist/tui/autocomplete.js +20 -465
- package/dist/tui/components/assistant-message.js +1 -1
- package/dist/tui/components/box.d.ts +20 -0
- package/dist/tui/components/box.d.ts.map +1 -0
- package/dist/tui/components/box.js +87 -0
- package/dist/tui/components/editor.d.ts +61 -7
- package/dist/tui/components/editor.d.ts.map +1 -1
- package/dist/tui/components/editor.js +630 -127
- package/dist/tui/components/footer.d.ts +19 -18
- package/dist/tui/components/footer.d.ts.map +1 -1
- package/dist/tui/components/footer.js +90 -185
- package/dist/tui/components/header.d.ts +21 -0
- package/dist/tui/components/header.d.ts.map +1 -0
- package/dist/tui/components/header.js +63 -0
- package/dist/tui/components/input.d.ts.map +1 -1
- package/dist/tui/components/input.js +8 -7
- package/dist/tui/components/loader.d.ts +6 -1
- package/dist/tui/components/loader.d.ts.map +1 -1
- package/dist/tui/components/loader.js +8 -3
- package/dist/tui/components/markdown.d.ts +31 -27
- package/dist/tui/components/markdown.d.ts.map +1 -1
- package/dist/tui/components/markdown.js +131 -67
- package/dist/tui/components/modal.d.ts +0 -11
- package/dist/tui/components/modal.d.ts.map +1 -1
- package/dist/tui/components/modal.js +9 -37
- package/dist/tui/components/notification.d.ts +28 -0
- package/dist/tui/components/notification.d.ts.map +1 -0
- package/dist/tui/components/notification.js +63 -0
- package/dist/tui/components/progress-bar.d.ts +19 -0
- package/dist/tui/components/progress-bar.d.ts.map +1 -0
- package/dist/tui/components/progress-bar.js +66 -0
- package/dist/tui/components/select-list.d.ts +12 -1
- package/dist/tui/components/select-list.d.ts.map +1 -1
- package/dist/tui/components/select-list.js +73 -32
- package/dist/tui/components/spacer.d.ts +1 -1
- package/dist/tui/components/spacer.d.ts.map +1 -1
- package/dist/tui/components/spacer.js +2 -2
- package/dist/tui/components/table.d.ts +27 -0
- package/dist/tui/components/table.d.ts.map +1 -0
- package/dist/tui/components/table.js +125 -0
- package/dist/tui/components/thinking-block.d.ts.map +1 -1
- package/dist/tui/components/thinking-block.js +4 -1
- package/dist/tui/components/tool-execution.d.ts +7 -6
- package/dist/tui/components/tool-execution.d.ts.map +1 -1
- package/dist/tui/components/tool-execution.js +81 -85
- package/dist/tui/components/user-message.d.ts.map +1 -1
- package/dist/tui/components/user-message.js +6 -4
- package/dist/tui/components/welcome.d.ts +8 -1
- package/dist/tui/components/welcome.d.ts.map +1 -1
- package/dist/tui/components/welcome.js +45 -6
- package/dist/tui/index.d.ts +12 -6
- package/dist/tui/index.d.ts.map +1 -1
- package/dist/tui/index.js +7 -3
- package/dist/tui/terminal.d.ts +4 -3
- package/dist/tui/terminal.d.ts.map +1 -1
- package/dist/tui/terminal.js +43 -49
- package/dist/tui/tui.d.ts +3 -0
- package/dist/tui/tui.d.ts.map +1 -1
- package/dist/tui/tui.js +58 -43
- package/dist/tui/utils.d.ts +5 -0
- package/dist/tui/utils.d.ts.map +1 -1
- package/dist/tui/utils.js +80 -1
- package/dist/{tools/bash-utils.d.ts → utils/bash.d.ts} +3 -3
- package/dist/utils/bash.d.ts.map +1 -0
- package/dist/{tools/bash-utils.js → utils/bash.js} +22 -11
- package/dist/utils/{filesystem.d.ts → filesystem/operations.d.ts} +1 -1
- package/dist/utils/filesystem/operations.d.ts.map +1 -0
- package/dist/{tools/filesystem-utils.d.ts → utils/filesystem/security.d.ts} +3 -2
- package/dist/utils/filesystem/security.d.ts.map +1 -0
- package/dist/{tools/filesystem-utils.js → utils/filesystem/security.js} +62 -4
- package/dist/utils/funcs.d.ts +6 -0
- package/dist/utils/funcs.d.ts.map +1 -0
- package/dist/utils/funcs.js +6 -0
- package/dist/{tools/git-utils.d.ts → utils/git.d.ts} +1 -1
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/{tools/git-utils.js → utils/git.js} +0 -6
- package/dist/utils/glob.js +1 -1
- package/dist/utils/yaml.d.ts +11 -0
- package/dist/utils/yaml.d.ts.map +1 -0
- package/dist/utils/yaml.js +207 -0
- package/dist/utils/{zod-utils.d.ts → zod.d.ts} +2 -1
- package/dist/utils/zod.d.ts.map +1 -0
- package/dist/utils/zod.js +24 -0
- package/package.json +31 -29
- package/dist/agent/manual-loop.d.ts +0 -41
- package/dist/agent/manual-loop.d.ts.map +0 -1
- package/dist/agent/manual-loop.js +0 -278
- package/dist/api/exa/index.d.ts +0 -177
- package/dist/api/exa/index.d.ts.map +0 -1
- package/dist/api/exa/index.js +0 -439
- package/dist/commands/add-directory-command.d.ts +0 -3
- package/dist/commands/add-directory-command.d.ts.map +0 -1
- package/dist/commands/add-directory-command.js +0 -85
- package/dist/commands/application-log-command.d.ts +0 -3
- package/dist/commands/application-log-command.d.ts.map +0 -1
- package/dist/commands/application-log-command.js +0 -79
- package/dist/commands/clear-command.d.ts +0 -3
- package/dist/commands/clear-command.d.ts.map +0 -1
- package/dist/commands/compact-command.d.ts +0 -3
- package/dist/commands/compact-command.d.ts.map +0 -1
- package/dist/commands/compact-command.js +0 -64
- package/dist/commands/context-command.d.ts +0 -3
- package/dist/commands/context-command.d.ts.map +0 -1
- package/dist/commands/context-command.js +0 -183
- package/dist/commands/copy-command.d.ts +0 -3
- package/dist/commands/copy-command.d.ts.map +0 -1
- package/dist/commands/copy-command.js +0 -80
- package/dist/commands/edit-command.d.ts +0 -3
- package/dist/commands/edit-command.d.ts.map +0 -1
- package/dist/commands/edit-command.js +0 -88
- package/dist/commands/edit-prompt-command.d.ts +0 -3
- package/dist/commands/edit-prompt-command.d.ts.map +0 -1
- package/dist/commands/edit-prompt-command.js +0 -61
- package/dist/commands/exit-command.d.ts +0 -13
- package/dist/commands/exit-command.d.ts.map +0 -1
- package/dist/commands/exit-command.js +0 -46
- package/dist/commands/files-command.d.ts +0 -3
- package/dist/commands/files-command.d.ts.map +0 -1
- package/dist/commands/files-command.js +0 -121
- package/dist/commands/generate-rules-command.d.ts +0 -3
- package/dist/commands/generate-rules-command.d.ts.map +0 -1
- package/dist/commands/handoff-command.d.ts +0 -3
- package/dist/commands/handoff-command.d.ts.map +0 -1
- package/dist/commands/handoff-command.js +0 -202
- package/dist/commands/health-command.d.ts +0 -4
- package/dist/commands/health-command.d.ts.map +0 -1
- package/dist/commands/health-command.js +0 -213
- package/dist/commands/help-command.d.ts +0 -3
- package/dist/commands/help-command.d.ts.map +0 -1
- package/dist/commands/history-command.d.ts +0 -3
- package/dist/commands/history-command.d.ts.map +0 -1
- package/dist/commands/init-command.d.ts +0 -3
- package/dist/commands/init-command.d.ts.map +0 -1
- package/dist/commands/last-log-command.d.ts +0 -3
- package/dist/commands/last-log-command.d.ts.map +0 -1
- package/dist/commands/last-log-command.js +0 -98
- package/dist/commands/list-directories-command.d.ts +0 -3
- package/dist/commands/list-directories-command.d.ts.map +0 -1
- package/dist/commands/list-tools-command.d.ts +0 -3
- package/dist/commands/list-tools-command.d.ts.map +0 -1
- package/dist/commands/list-tools-command.js +0 -124
- package/dist/commands/model-command.d.ts +0 -25
- package/dist/commands/model-command.d.ts.map +0 -1
- package/dist/commands/model-command.js +0 -340
- package/dist/commands/paste-command.d.ts +0 -3
- package/dist/commands/paste-command.d.ts.map +0 -1
- package/dist/commands/paste-command.js +0 -277
- package/dist/commands/pickup-command.d.ts +0 -3
- package/dist/commands/pickup-command.d.ts.map +0 -1
- package/dist/commands/pickup-command.js +0 -161
- package/dist/commands/prompt-command.d.ts +0 -3
- package/dist/commands/prompt-command.d.ts.map +0 -1
- package/dist/commands/prompt-command.js +0 -280
- package/dist/commands/remove-directory-command.d.ts +0 -3
- package/dist/commands/remove-directory-command.d.ts.map +0 -1
- package/dist/commands/reset-command.d.ts +0 -3
- package/dist/commands/reset-command.d.ts.map +0 -1
- package/dist/commands/rules-command.d.ts +0 -3
- package/dist/commands/rules-command.d.ts.map +0 -1
- package/dist/commands/rules-command.js +0 -135
- package/dist/commands/save-command.d.ts +0 -3
- package/dist/commands/save-command.d.ts.map +0 -1
- package/dist/commands/shell-command.d.ts +0 -3
- package/dist/commands/shell-command.d.ts.map +0 -1
- package/dist/commands/usage-command.d.ts +0 -3
- package/dist/commands/usage-command.d.ts.map +0 -1
- package/dist/commands/usage-command.js +0 -42
- package/dist/messages.d.ts.map +0 -1
- package/dist/repl/display-tool-messages.d.ts +0 -4
- package/dist/repl/display-tool-messages.d.ts.map +0 -1
- package/dist/repl/display-tool-messages.js +0 -58
- package/dist/repl/display-tool-use.d.ts +0 -14
- package/dist/repl/display-tool-use.d.ts.map +0 -1
- package/dist/repl/display-tool-use.js +0 -63
- package/dist/repl/get-prompt-header.d.ts +0 -8
- package/dist/repl/get-prompt-header.d.ts.map +0 -1
- package/dist/repl/get-prompt-header.js +0 -9
- package/dist/repl/project-status-line.d.ts +0 -2
- package/dist/repl/project-status-line.d.ts.map +0 -1
- package/dist/repl/project-status-line.js +0 -31
- package/dist/repl/prompt.d.ts +0 -21
- package/dist/repl/prompt.d.ts.map +0 -1
- package/dist/repl/prompt.js +0 -244
- package/dist/repl/tool-call-repair.d.ts +0 -4
- package/dist/repl/tool-call-repair.d.ts.map +0 -1
- package/dist/repl/tool-call-repair.js +0 -54
- package/dist/repl.d.ts +0 -29
- package/dist/repl.d.ts.map +0 -1
- package/dist/repl.js +0 -218
- package/dist/terminal/checkbox-prompt.d.ts +0 -36
- package/dist/terminal/checkbox-prompt.d.ts.map +0 -1
- package/dist/terminal/checkbox-prompt.js +0 -368
- package/dist/terminal/editor-prompt.d.ts +0 -10
- package/dist/terminal/editor-prompt.d.ts.map +0 -1
- package/dist/terminal/editor-prompt.js +0 -61
- package/dist/terminal/errors.d.ts +0 -19
- package/dist/terminal/errors.d.ts.map +0 -1
- package/dist/terminal/errors.js +0 -37
- package/dist/terminal/input-prompt.d.ts +0 -17
- package/dist/terminal/input-prompt.d.ts.map +0 -1
- package/dist/terminal/input-prompt.js +0 -181
- package/dist/terminal/markdown.d.ts +0 -2
- package/dist/terminal/markdown.d.ts.map +0 -1
- package/dist/terminal/markdown.js +0 -118
- package/dist/terminal/search-prompt.d.ts +0 -20
- package/dist/terminal/search-prompt.d.ts.map +0 -1
- package/dist/terminal/search-prompt.js +0 -280
- package/dist/terminal/types.d.ts +0 -35
- package/dist/terminal/types.d.ts.map +0 -1
- package/dist/tokens/threshold.d.ts +0 -35
- package/dist/tokens/threshold.d.ts.map +0 -1
- package/dist/tokens/threshold.js +0 -85
- package/dist/tools/advanced-edit-file.d.ts +0 -69
- package/dist/tools/advanced-edit-file.d.ts.map +0 -1
- package/dist/tools/advanced-edit-file.js +0 -281
- package/dist/tools/agent.d.ts +0 -29
- package/dist/tools/agent.d.ts.map +0 -1
- package/dist/tools/agent.js +0 -103
- package/dist/tools/bash-utils.d.ts.map +0 -1
- package/dist/tools/code-interpreter.d.ts +0 -25
- package/dist/tools/code-interpreter.d.ts.map +0 -1
- package/dist/tools/code-interpreter.js +0 -167
- package/dist/tools/delete-file.d.ts +0 -24
- package/dist/tools/delete-file.d.ts.map +0 -1
- package/dist/tools/delete-file.js +0 -70
- package/dist/tools/dynamic-tool-parser.d.ts +0 -21
- package/dist/tools/dynamic-tool-parser.d.ts.map +0 -1
- package/dist/tools/dynamic-tool-parser.js +0 -22
- package/dist/tools/filesystem-utils.d.ts.map +0 -1
- package/dist/tools/git-utils.d.ts.map +0 -1
- package/dist/tools/llm-edit-fixer.d.ts +0 -25
- package/dist/tools/llm-edit-fixer.d.ts.map +0 -1
- package/dist/tools/llm-edit-fixer.js +0 -150
- package/dist/tools/move-file.d.ts +0 -26
- package/dist/tools/move-file.d.ts.map +0 -1
- package/dist/tools/move-file.js +0 -58
- package/dist/tools/read-multiple-files.d.ts +0 -26
- package/dist/tools/read-multiple-files.d.ts.map +0 -1
- package/dist/tools/read-multiple-files.js +0 -139
- package/dist/tools/web-fetch.d.ts +0 -56
- package/dist/tools/web-fetch.d.ts.map +0 -1
- package/dist/tools/web-fetch.js +0 -247
- package/dist/tools/web-search.d.ts +0 -23
- package/dist/tools/web-search.d.ts.map +0 -1
- package/dist/tools/web-search.js +0 -133
- package/dist/tui/components/prompt-status.d.ts +0 -16
- package/dist/tui/components/prompt-status.d.ts.map +0 -1
- package/dist/tui/components/prompt-status.js +0 -21
- package/dist/utils/filesystem.d.ts.map +0 -1
- package/dist/utils/zod-utils.d.ts.map +0 -1
- package/dist/utils/zod-utils.js +0 -7
- /package/dist/{terminal → commands/add-directory}/types.js +0 -0
- /package/dist/utils/{filesystem.js → filesystem/operations.js} +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Spacer, Text } from "../../tui/index.js";
|
|
2
|
+
import { ensureConfigFile, ensureProjectDirectory, isDevelopmentDirectory, } from "./utils.js";
|
|
3
|
+
export const initProjectCommand = (_options) => {
|
|
4
|
+
return {
|
|
5
|
+
command: "/init-project",
|
|
6
|
+
description: "Initialize a new acai project in the current directory. Creates missing directories and files without overwriting existing ones.",
|
|
7
|
+
getSubCommands: () => Promise.resolve([]),
|
|
8
|
+
async handle(_args, { tui, container, editor, }) {
|
|
9
|
+
const currentDir = process.cwd();
|
|
10
|
+
if (isDevelopmentDirectory(currentDir)) {
|
|
11
|
+
container.addChild(new Text("Cannot initialize project in acai-ts development directory.", 1, 0));
|
|
12
|
+
container.addChild(new Text("Run this command in a different project directory.", 2, 0));
|
|
13
|
+
tui.requestRender();
|
|
14
|
+
editor.setText("");
|
|
15
|
+
return "continue";
|
|
16
|
+
}
|
|
17
|
+
const projectDir = require("node:path").join(currentDir, ".acai");
|
|
18
|
+
const dirResult = ensureProjectDirectory(projectDir);
|
|
19
|
+
const configResult = ensureConfigFile(projectDir);
|
|
20
|
+
const created = [...dirResult.created, ...configResult.created];
|
|
21
|
+
const existing = [...dirResult.existing, ...configResult.existing];
|
|
22
|
+
container.addChild(new Text("Initializing acai project...", 1, 0));
|
|
23
|
+
if (created.length > 0) {
|
|
24
|
+
container.addChild(new Spacer(1));
|
|
25
|
+
container.addChild(new Text("Created:", 1, 0));
|
|
26
|
+
for (const item of created) {
|
|
27
|
+
container.addChild(new Text(` ${item}`, 2, 0));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (existing.length > 0) {
|
|
31
|
+
container.addChild(new Spacer(1));
|
|
32
|
+
container.addChild(new Text("Already existed:", 1, 0));
|
|
33
|
+
for (const item of existing) {
|
|
34
|
+
container.addChild(new Text(` ${item}`, 2, 0));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (created.length === 0 && existing.length > 0) {
|
|
38
|
+
container.addChild(new Spacer(1));
|
|
39
|
+
container.addChild(new Text("Project already fully initialized. No changes made.", 1, 0));
|
|
40
|
+
}
|
|
41
|
+
container.addChild(new Spacer(1));
|
|
42
|
+
container.addChild(new Text("Project initialized successfully. You can now:", 1, 0));
|
|
43
|
+
container.addChild(new Text(" • Add project-specific prompts to .acai/prompts/", 2, 0));
|
|
44
|
+
container.addChild(new Text(" • Configure settings in .acai/acai.json", 2, 0));
|
|
45
|
+
container.addChild(new Text(" • Add project skills to .acai/skills/", 2, 0));
|
|
46
|
+
tui.requestRender();
|
|
47
|
+
editor.setText("");
|
|
48
|
+
return "continue";
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const DEVELOPMENT_DIRECTORY = "/Users/travisennis/Github/acai-ts";
|
|
2
|
+
export interface InitializationResult {
|
|
3
|
+
created: string[];
|
|
4
|
+
existing: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare function ensureProjectDirectory(projectDir: string): InitializationResult;
|
|
7
|
+
export declare function ensureConfigFile(projectDir: string): InitializationResult;
|
|
8
|
+
export declare function isDevelopmentDirectory(dir: string): boolean;
|
|
9
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../source/commands/init-project/utils.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB,sCAAsC,CAAC;AAEzE,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,MAAM,GACjB,oBAAoB,CAuBtB;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,oBAAoB,CAazE;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE3D"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { defaultConfig } from "../../config.js";
|
|
4
|
+
export const DEVELOPMENT_DIRECTORY = "/Users/travisennis/Github/acai-ts";
|
|
5
|
+
export function ensureProjectDirectory(projectDir) {
|
|
6
|
+
const created = [];
|
|
7
|
+
const existing = [];
|
|
8
|
+
if (!existsSync(projectDir)) {
|
|
9
|
+
mkdirSync(projectDir, { recursive: true });
|
|
10
|
+
created.push(".acai/");
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
existing.push(".acai/");
|
|
14
|
+
}
|
|
15
|
+
const subdirs = ["prompts", "rules", "skills"];
|
|
16
|
+
for (const subdir of subdirs) {
|
|
17
|
+
const dirPath = path.join(projectDir, subdir);
|
|
18
|
+
if (!existsSync(dirPath)) {
|
|
19
|
+
mkdirSync(dirPath, { recursive: true });
|
|
20
|
+
created.push(`.acai/${subdir}/`);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
existing.push(`.acai/${subdir}/`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return { created, existing };
|
|
27
|
+
}
|
|
28
|
+
export function ensureConfigFile(projectDir) {
|
|
29
|
+
const created = [];
|
|
30
|
+
const existing = [];
|
|
31
|
+
const configPath = path.join(projectDir, "acai.json");
|
|
32
|
+
if (!existsSync(configPath)) {
|
|
33
|
+
writeFileSync(configPath, JSON.stringify(defaultConfig, null, 2), "utf8");
|
|
34
|
+
created.push(".acai/acai.json");
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
existing.push(".acai/acai.json");
|
|
38
|
+
}
|
|
39
|
+
return { created, existing };
|
|
40
|
+
}
|
|
41
|
+
export function isDevelopmentDirectory(dir) {
|
|
42
|
+
return dir === DEVELOPMENT_DIRECTORY;
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/commands/list-directories/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/D,eAAO,MAAM,sBAAsB,GAAI,gBAEpC,cAAc,KAAG,WAkDnB,CAAC"}
|
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
import { Modal, Container as ModalContainer, ModalText } from "
|
|
2
|
-
export const listDirectoriesCommand = ({
|
|
1
|
+
import { Modal, Container as ModalContainer, ModalText, } from "../../tui/index.js";
|
|
2
|
+
export const listDirectoriesCommand = ({ workspace, }) => {
|
|
3
3
|
return {
|
|
4
4
|
command: "/list-directories",
|
|
5
5
|
description: "List all allowed working directories",
|
|
6
6
|
getSubCommands: async () => {
|
|
7
7
|
return [];
|
|
8
8
|
},
|
|
9
|
-
execute: async () => {
|
|
10
|
-
terminal.header("Current working directories:");
|
|
11
|
-
workspace.allowedDirs.forEach((dir) => {
|
|
12
|
-
const isPrimary = dir === workspace.primaryDir;
|
|
13
|
-
const prefix = isPrimary ? "● " : " ";
|
|
14
|
-
const indicator = isPrimary ? " (primary)" : "";
|
|
15
|
-
terminal.writeln(`${prefix}${dir}${indicator}`);
|
|
16
|
-
});
|
|
17
|
-
if (workspace.allowedDirs.length === 0) {
|
|
18
|
-
terminal.warn("No directories configured. Using current directory only.");
|
|
19
|
-
}
|
|
20
|
-
return "continue";
|
|
21
|
-
},
|
|
22
9
|
async handle(_args, { tui, editor }) {
|
|
23
10
|
// Build modal content
|
|
24
11
|
const modalContent = new ModalContainer();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/commands/list-tools/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/D,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,WAAW,CAoHrE"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import style from "../../terminal/style.js";
|
|
2
|
+
import { initTools } from "../../tools/index.js";
|
|
3
|
+
import { Modal, Container as ModalContainer, ModalText, TableComponent, } from "../../tui/index.js";
|
|
4
|
+
export function listToolsCommand(options) {
|
|
5
|
+
return {
|
|
6
|
+
command: "/list-tools",
|
|
7
|
+
description: "List all available static and dynamic tools.",
|
|
8
|
+
aliases: ["/lt"],
|
|
9
|
+
getSubCommands: async () => [],
|
|
10
|
+
async handle(_args, { tui, editor }) {
|
|
11
|
+
try {
|
|
12
|
+
// Get active tools from config
|
|
13
|
+
const projectConfig = await options.config.getConfig();
|
|
14
|
+
const activeTools = projectConfig.tools.activeTools;
|
|
15
|
+
const tools = await initTools({
|
|
16
|
+
workspace: options.workspace,
|
|
17
|
+
});
|
|
18
|
+
const toolNames = Object.keys(tools).sort();
|
|
19
|
+
// Separate static and dynamic tools
|
|
20
|
+
const staticTools = [];
|
|
21
|
+
const dynamicTools = [];
|
|
22
|
+
for (const toolName of toolNames) {
|
|
23
|
+
if (toolName.startsWith("dynamic-")) {
|
|
24
|
+
dynamicTools.push(toolName);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
staticTools.push(toolName);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
// Build modal content
|
|
31
|
+
const modalContent = new ModalContainer();
|
|
32
|
+
if (toolNames.length === 0) {
|
|
33
|
+
modalContent.addChild(new ModalText("No tools available.", 0, 1));
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
// Create table data
|
|
37
|
+
const tableData = [];
|
|
38
|
+
// Add static tools
|
|
39
|
+
for (const toolName of staticTools) {
|
|
40
|
+
const isActive = activeTools === undefined || activeTools.includes(toolName);
|
|
41
|
+
tableData.push([
|
|
42
|
+
toolName,
|
|
43
|
+
"Static",
|
|
44
|
+
isActive ? "Active" : "Inactive",
|
|
45
|
+
]);
|
|
46
|
+
}
|
|
47
|
+
// Add dynamic tools
|
|
48
|
+
for (const toolName of dynamicTools) {
|
|
49
|
+
const isActive = activeTools === undefined || activeTools.includes(toolName);
|
|
50
|
+
tableData.push([
|
|
51
|
+
toolName,
|
|
52
|
+
"Dynamic",
|
|
53
|
+
isActive ? "Active" : "Inactive",
|
|
54
|
+
]);
|
|
55
|
+
}
|
|
56
|
+
modalContent.addChild(new TableComponent(tableData, {
|
|
57
|
+
headers: ["Tool Name", "Type", "Status"],
|
|
58
|
+
colWidths: [60, 20, 20],
|
|
59
|
+
}));
|
|
60
|
+
// Add summary
|
|
61
|
+
modalContent.addChild(new ModalText("", 0, 1)); // Spacer
|
|
62
|
+
const activeCount = activeTools === undefined
|
|
63
|
+
? toolNames.length
|
|
64
|
+
: toolNames.filter((tool) => activeTools.includes(tool)).length;
|
|
65
|
+
modalContent.addChild(new ModalText(`Total: ${staticTools.length} static, ${dynamicTools.length} dynamic, ${activeCount} active`, 0, 1));
|
|
66
|
+
}
|
|
67
|
+
// Create and show modal
|
|
68
|
+
const modal = new Modal("Available Tools", modalContent, true, () => {
|
|
69
|
+
// Modal closed callback
|
|
70
|
+
editor.setText("");
|
|
71
|
+
tui.requestRender();
|
|
72
|
+
});
|
|
73
|
+
tui.showModal(modal);
|
|
74
|
+
return "continue";
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
// Show error in modal
|
|
78
|
+
const errorContent = new ModalContainer();
|
|
79
|
+
errorContent.addChild(new ModalText(style.red(`Error listing tools: ${error.message}`), 0, 1));
|
|
80
|
+
const errorModal = new Modal("Error", errorContent, true, () => {
|
|
81
|
+
editor.setText("");
|
|
82
|
+
tui.requestRender();
|
|
83
|
+
});
|
|
84
|
+
tui.showModal(errorModal);
|
|
85
|
+
return "continue";
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
}
|
|
@@ -4,15 +4,14 @@ export declare class CommandManager {
|
|
|
4
4
|
private commands;
|
|
5
5
|
private promptManager;
|
|
6
6
|
private modelManager;
|
|
7
|
-
private
|
|
7
|
+
private sessionManager;
|
|
8
8
|
private tokenTracker;
|
|
9
|
-
private terminal;
|
|
10
9
|
private config;
|
|
11
10
|
private tokenCounter;
|
|
12
11
|
private promptHistory;
|
|
13
12
|
private workspace;
|
|
14
13
|
private initialized;
|
|
15
|
-
constructor({ promptManager, modelManager,
|
|
14
|
+
constructor({ promptManager, modelManager, sessionManager: messageHistory, tokenTracker, config, tokenCounter, promptHistory, workspace, }: CommandOptions);
|
|
16
15
|
initializeCommmands(): Promise<void>;
|
|
17
16
|
private ensureInitialized;
|
|
18
17
|
getCompletions(): Promise<SlashCommand[]>;
|
|
@@ -20,12 +19,6 @@ export declare class CommandManager {
|
|
|
20
19
|
getSubCommands(command: string): Promise<string[]>;
|
|
21
20
|
handle({ userInput }: {
|
|
22
21
|
userInput: string;
|
|
23
|
-
}): Promise<{
|
|
24
|
-
continue: boolean;
|
|
25
|
-
break: boolean;
|
|
26
|
-
}>;
|
|
27
|
-
handle2({ userInput }: {
|
|
28
|
-
userInput: string;
|
|
29
22
|
}, options: {
|
|
30
23
|
tui: TUI;
|
|
31
24
|
container: Container;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../source/commands/manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../source/commands/manager.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAEV,SAAS,EACT,MAAM,EACN,YAAY,EACZ,GAAG,EACJ,MAAM,iBAAiB,CAAC;AAyBzB,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,YAAY,CAAC;AAE9D,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAA2B;IAC3C,OAAO,CAAC,aAAa,CAAmB;IACxC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,aAAa,CAAW;IAChC,OAAO,CAAC,SAAS,CAAmB;IACpC,OAAO,CAAC,WAAW,CAAU;gBAEjB,EACV,aAAa,EACb,YAAY,EACZ,cAAc,EAAE,cAAc,EAC9B,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,aAAa,EACb,SAAS,GACV,EAAE,cAAc;IAaX,mBAAmB;IAqFzB,OAAO,CAAC,iBAAiB;IAQnB,cAAc,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAuB/C,WAAW;IAKL,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAKlD,MAAM,CACV,EAAE,SAAS,EAAE,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,EACpC,OAAO,EAAE;QACP,GAAG,EAAE,GAAG,CAAC;QACT,SAAS,EAAE,SAAS,CAAC;QACrB,cAAc,EAAE,SAAS,CAAC;QAC1B,MAAM,EAAE,MAAM,CAAC;KAChB;;;;CA8BJ"}
|
package/dist/commands/manager.js
CHANGED
|
@@ -1,50 +1,43 @@
|
|
|
1
|
-
import { addDirectoryCommand } from "./add-directory
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { resetCommand } from "./reset-command.js";
|
|
26
|
-
// import { rulesCommand } from "./rules-command.ts";
|
|
27
|
-
import { saveCommand } from "./save-command.js";
|
|
28
|
-
import { shellCommand } from "./shell-command.js";
|
|
29
|
-
import { usageCommand } from "./usage-command.js";
|
|
1
|
+
import { addDirectoryCommand } from "./add-directory/index.js";
|
|
2
|
+
import { clearCommand } from "./clear/index.js";
|
|
3
|
+
import { copyCommand } from "./copy/index.js";
|
|
4
|
+
import { exitCommand } from "./exit/index.js";
|
|
5
|
+
import { generateRulesCommand } from "./generate-rules/index.js";
|
|
6
|
+
import { handoffCommand } from "./handoff/index.js";
|
|
7
|
+
import { healthCommand } from "./health/index.js";
|
|
8
|
+
import { helpCommand } from "./help/index.js";
|
|
9
|
+
import { historyCommand } from "./history/index.js";
|
|
10
|
+
import { initCommand } from "./init/index.js";
|
|
11
|
+
import { initProjectCommand } from "./init-project/index.js";
|
|
12
|
+
import { listDirectoriesCommand } from "./list-directories/index.js";
|
|
13
|
+
import { listToolsCommand } from "./list-tools/index.js";
|
|
14
|
+
import { modelCommand } from "./model/index.js";
|
|
15
|
+
import { pasteCommand } from "./paste/index.js";
|
|
16
|
+
import { pickupCommand } from "./pickup/index.js";
|
|
17
|
+
import { loadPrompts, promptCommand } from "./prompt/index.js";
|
|
18
|
+
import { removeDirectoryCommand } from "./remove-directory/index.js";
|
|
19
|
+
import { resetCommand } from "./reset/index.js";
|
|
20
|
+
import { resourcesCommand } from "./resources/index.js";
|
|
21
|
+
import { reviewCommand } from "./review/index.js";
|
|
22
|
+
import { saveCommand } from "./save/index.js";
|
|
23
|
+
import { sessionCommand } from "./session/index.js";
|
|
24
|
+
import { shellCommand } from "./shell/index.js";
|
|
30
25
|
export class CommandManager {
|
|
31
26
|
commands;
|
|
32
27
|
promptManager;
|
|
33
28
|
modelManager;
|
|
34
|
-
|
|
29
|
+
sessionManager;
|
|
35
30
|
tokenTracker;
|
|
36
|
-
terminal;
|
|
37
31
|
config;
|
|
38
32
|
tokenCounter;
|
|
39
33
|
promptHistory;
|
|
40
34
|
workspace;
|
|
41
35
|
initialized;
|
|
42
|
-
constructor({ promptManager, modelManager,
|
|
36
|
+
constructor({ promptManager, modelManager, sessionManager: messageHistory, tokenTracker, config, tokenCounter, promptHistory, workspace, }) {
|
|
43
37
|
this.commands = new Map();
|
|
44
38
|
this.promptManager = promptManager;
|
|
45
39
|
this.modelManager = modelManager;
|
|
46
|
-
this.
|
|
47
|
-
this.messageHistory = messageHistory;
|
|
40
|
+
this.sessionManager = messageHistory;
|
|
48
41
|
this.tokenTracker = tokenTracker;
|
|
49
42
|
this.config = config;
|
|
50
43
|
this.tokenCounter = tokenCounter;
|
|
@@ -60,8 +53,7 @@ export class CommandManager {
|
|
|
60
53
|
const options = {
|
|
61
54
|
promptManager: this.promptManager,
|
|
62
55
|
modelManager: this.modelManager,
|
|
63
|
-
|
|
64
|
-
messageHistory: this.messageHistory,
|
|
56
|
+
sessionManager: this.sessionManager,
|
|
65
57
|
tokenTracker: this.tokenTracker,
|
|
66
58
|
config: this.config,
|
|
67
59
|
tokenCounter: this.tokenCounter,
|
|
@@ -72,39 +64,31 @@ export class CommandManager {
|
|
|
72
64
|
const cmds = [
|
|
73
65
|
addDirectoryCommand(options),
|
|
74
66
|
clearCommand(options),
|
|
75
|
-
// compactCommand(options),
|
|
76
|
-
contextCommand(options),
|
|
77
|
-
// editCommand(options),
|
|
78
|
-
// editPromptCommand(options),
|
|
79
67
|
exitCommand(options),
|
|
80
|
-
// filesCommand(options),
|
|
81
68
|
healthCommand(options),
|
|
82
69
|
historyCommand(options),
|
|
83
70
|
initCommand(options),
|
|
71
|
+
initProjectCommand(options),
|
|
84
72
|
listDirectoriesCommand(options),
|
|
85
73
|
pasteCommand(options),
|
|
86
74
|
pickupCommand(options),
|
|
87
75
|
promptCommand(options),
|
|
88
76
|
removeDirectoryCommand(options),
|
|
89
77
|
resetCommand(options),
|
|
78
|
+
reviewCommand(options),
|
|
90
79
|
saveCommand(options),
|
|
91
|
-
// rulesCommand(options),
|
|
92
80
|
modelCommand(options),
|
|
93
|
-
|
|
94
|
-
// lastLogCommand(options),
|
|
81
|
+
sessionCommand(options),
|
|
95
82
|
generateRulesCommand(options),
|
|
96
83
|
handoffCommand(options),
|
|
97
|
-
// applicationLogCommand(options),
|
|
98
84
|
copyCommand(options),
|
|
99
85
|
listToolsCommand(options),
|
|
86
|
+
resourcesCommand(options),
|
|
100
87
|
shellCommand(options),
|
|
101
88
|
];
|
|
102
89
|
// Add help command with access to all commands
|
|
103
90
|
const helpCmd = helpCommand(options, this.commands);
|
|
104
|
-
cmds.push(
|
|
105
|
-
...helpCmd,
|
|
106
|
-
execute: () => helpCmd.execute([]),
|
|
107
|
-
});
|
|
91
|
+
cmds.push(helpCmd);
|
|
108
92
|
// Register all commands
|
|
109
93
|
for (const cmd of cmds) {
|
|
110
94
|
this.commands.set(cmd.command, cmd);
|
|
@@ -116,14 +100,13 @@ export class CommandManager {
|
|
|
116
100
|
const promptCmd = this.commands.get("/prompt");
|
|
117
101
|
if (promptCmd) {
|
|
118
102
|
const promptSubmCommands = await promptCmd.getSubCommands();
|
|
103
|
+
const prompts = await loadPrompts(options.config);
|
|
119
104
|
for (const cmd of promptSubmCommands) {
|
|
105
|
+
const prompt = prompts.get(cmd);
|
|
120
106
|
this.commands.set(`/${cmd}`, {
|
|
121
107
|
command: `/${cmd}`,
|
|
122
|
-
description: "",
|
|
108
|
+
description: prompt?.description ?? "",
|
|
123
109
|
getSubCommands: () => Promise.resolve([]),
|
|
124
|
-
execute: (args) => {
|
|
125
|
-
return promptCmd.execute([cmd, ...args]);
|
|
126
|
-
},
|
|
127
110
|
async handle(args, options) {
|
|
128
111
|
return promptCmd.handle([cmd, ...args], options);
|
|
129
112
|
},
|
|
@@ -163,40 +146,12 @@ export class CommandManager {
|
|
|
163
146
|
this.ensureInitialized();
|
|
164
147
|
return (await this.commands.get(command)?.getSubCommands()) ?? [];
|
|
165
148
|
}
|
|
166
|
-
async handle({ userInput }) {
|
|
167
|
-
this.ensureInitialized();
|
|
168
|
-
const commandArgs = userInput.split(" ");
|
|
169
|
-
const command = commandArgs.at(0);
|
|
170
|
-
const args = commandArgs.slice(1);
|
|
171
|
-
if (command) {
|
|
172
|
-
const replCommand = this.commands.get(command);
|
|
173
|
-
if (replCommand) {
|
|
174
|
-
const result = await replCommand.execute(args);
|
|
175
|
-
if (result === "continue") {
|
|
176
|
-
return {
|
|
177
|
-
continue: true,
|
|
178
|
-
break: false,
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
if (result === "break") {
|
|
182
|
-
return {
|
|
183
|
-
continue: false,
|
|
184
|
-
break: true,
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
return {
|
|
190
|
-
continue: false,
|
|
191
|
-
break: false,
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
async handle2({ userInput }, options) {
|
|
149
|
+
async handle({ userInput }, options) {
|
|
195
150
|
this.ensureInitialized();
|
|
196
151
|
const commandArgs = userInput.split(" ");
|
|
197
152
|
const command = commandArgs.at(0);
|
|
198
153
|
const args = commandArgs.slice(1);
|
|
199
|
-
if (command) {
|
|
154
|
+
if (command !== undefined) {
|
|
200
155
|
const replCommand = this.commands.get(command);
|
|
201
156
|
if (replCommand) {
|
|
202
157
|
const result = await replCommand.handle(args, options);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/commands/model/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/D,wBAAgB,YAAY,CAAC,OAAO,EAAE,cAAc,GAAG,WAAW,CAqHjE"}
|