@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
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import { readdir, readFile } from "node:fs/promises";
|
|
2
|
-
import { basename } from "node:path";
|
|
3
|
-
import { createUserMessage } from "../messages.js";
|
|
4
|
-
import style from "../terminal/style.js";
|
|
5
|
-
import { Text } from "../tui/index.js";
|
|
6
|
-
export const pickupCommand = (options) => {
|
|
7
|
-
return {
|
|
8
|
-
command: "/pickup",
|
|
9
|
-
description: "Loads a handoff file into a new session to continue previous work. Usage: /pickup <filename>",
|
|
10
|
-
getSubCommands: async () => {
|
|
11
|
-
const getHandoffFileNames = async () => {
|
|
12
|
-
try {
|
|
13
|
-
const dirents = await readdir(options.workspace.primaryDir, {
|
|
14
|
-
withFileTypes: true,
|
|
15
|
-
});
|
|
16
|
-
return dirents
|
|
17
|
-
.filter((dirent) => dirent.isFile() && dirent.name.match(/^handoff-.*\.md$/))
|
|
18
|
-
.map((dirent) => basename(dirent.name, ".md"));
|
|
19
|
-
}
|
|
20
|
-
catch (error) {
|
|
21
|
-
if (error.code === "ENOENT") {
|
|
22
|
-
return []; // Directory doesn't exist, return empty array
|
|
23
|
-
}
|
|
24
|
-
options.terminal.error(`Error reading handoff files: ${error}`);
|
|
25
|
-
return []; // Return empty on other errors too, but log them
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
return await getHandoffFileNames();
|
|
29
|
-
},
|
|
30
|
-
execute: async (args) => {
|
|
31
|
-
const { terminal, messageHistory, modelManager } = options;
|
|
32
|
-
// Validate that filename is provided
|
|
33
|
-
const filename = args.join(" ").trim();
|
|
34
|
-
if (!filename) {
|
|
35
|
-
const availableFiles = await getAvailableHandoffFiles(options);
|
|
36
|
-
if (availableFiles.length === 0) {
|
|
37
|
-
terminal.error("No handoff files found. Create a handoff file first using /handoff <purpose>");
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
terminal.error("Please specify a handoff file to load.");
|
|
41
|
-
terminal.info("Available handoff files:");
|
|
42
|
-
availableFiles.forEach((file) => {
|
|
43
|
-
terminal.info(` • ${file}.md`);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
return "continue";
|
|
47
|
-
}
|
|
48
|
-
// Ensure filename has .md extension for file operations
|
|
49
|
-
const filenameWithExt = filename.endsWith(".md")
|
|
50
|
-
? filename
|
|
51
|
-
: `${filename}.md`;
|
|
52
|
-
const filepath = `${options.workspace.primaryDir}/${filenameWithExt}`;
|
|
53
|
-
try {
|
|
54
|
-
// Read the handoff file
|
|
55
|
-
const handoffContent = await readFile(filepath, "utf8");
|
|
56
|
-
terminal.info(`Loading handoff file: ${filenameWithExt}`);
|
|
57
|
-
// Create new session (like compact-command does)
|
|
58
|
-
messageHistory.create(modelManager.getModel("repl").modelId);
|
|
59
|
-
// Append handoff content as user message
|
|
60
|
-
messageHistory.appendUserMessage(createUserMessage([], handoffContent));
|
|
61
|
-
terminal.info("Handoff file loaded successfully into new session.");
|
|
62
|
-
terminal.info("You can now continue with your previous work.");
|
|
63
|
-
return "use";
|
|
64
|
-
}
|
|
65
|
-
catch (error) {
|
|
66
|
-
if (error.code === "ENOENT") {
|
|
67
|
-
terminal.error(`Handoff file not found: ${filenameWithExt}`);
|
|
68
|
-
// Show available files as helpful suggestion
|
|
69
|
-
const availableFiles = await getAvailableHandoffFiles(options);
|
|
70
|
-
if (availableFiles.length > 0) {
|
|
71
|
-
terminal.info("Available handoff files:");
|
|
72
|
-
availableFiles.forEach((file) => {
|
|
73
|
-
terminal.info(` • ${file}.md`);
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
terminal.error(`Error reading handoff file: ${error}`);
|
|
79
|
-
}
|
|
80
|
-
return "continue";
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
async handle(args, { tui, container, editor, }) {
|
|
84
|
-
const { messageHistory, modelManager } = options;
|
|
85
|
-
// Validate that filename is provided
|
|
86
|
-
const filename = args.join(" ").trim();
|
|
87
|
-
if (!filename) {
|
|
88
|
-
const availableFiles = await getAvailableHandoffFiles(options);
|
|
89
|
-
if (availableFiles.length === 0) {
|
|
90
|
-
container.addChild(new Text(style.red("No handoff files found. Create a handoff file first using /handoff <purpose>"), 1, 0));
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
container.addChild(new Text(style.red("Please specify a handoff file to load."), 0, 1));
|
|
94
|
-
container.addChild(new Text("Available handoff files:", 2, 0));
|
|
95
|
-
availableFiles.forEach((file, index) => {
|
|
96
|
-
container.addChild(new Text(` • ${file}.md`, 3 + index, 0));
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
tui.requestRender();
|
|
100
|
-
editor.setText("");
|
|
101
|
-
return "continue";
|
|
102
|
-
}
|
|
103
|
-
// Ensure filename has .md extension for file operations
|
|
104
|
-
const filenameWithExt = filename.endsWith(".md")
|
|
105
|
-
? filename
|
|
106
|
-
: `${filename}.md`;
|
|
107
|
-
const filepath = `${options.workspace.primaryDir}/${filenameWithExt}`;
|
|
108
|
-
try {
|
|
109
|
-
// Read the handoff file
|
|
110
|
-
const handoffContent = await readFile(filepath, "utf8");
|
|
111
|
-
container.addChild(new Text(`Loading handoff file: ${style.blue(filenameWithExt)}`, 1, 0));
|
|
112
|
-
// Create new session (like compact-command does)
|
|
113
|
-
messageHistory.create(modelManager.getModel("repl").modelId);
|
|
114
|
-
// Append handoff content as user message
|
|
115
|
-
messageHistory.appendUserMessage(createUserMessage([], handoffContent));
|
|
116
|
-
container.addChild(new Text(style.green("Handoff file loaded successfully into new session."), 2, 0));
|
|
117
|
-
container.addChild(new Text("You can now continue with your previous work.", 3, 0));
|
|
118
|
-
tui.requestRender();
|
|
119
|
-
editor.setText("");
|
|
120
|
-
return "use";
|
|
121
|
-
}
|
|
122
|
-
catch (error) {
|
|
123
|
-
if (error.code === "ENOENT") {
|
|
124
|
-
container.addChild(new Text(style.red(`Handoff file not found: ${filenameWithExt}`), 1, 0));
|
|
125
|
-
// Show available files as helpful suggestion
|
|
126
|
-
const availableFiles = await getAvailableHandoffFiles(options);
|
|
127
|
-
if (availableFiles.length > 0) {
|
|
128
|
-
container.addChild(new Text("Available handoff files:", 2, 0));
|
|
129
|
-
availableFiles.forEach((file, index) => {
|
|
130
|
-
container.addChild(new Text(` • ${file}.md`, 3 + index, 0));
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
container.addChild(new Text(style.red(`Error reading handoff file: ${error}`), 0, 1));
|
|
136
|
-
}
|
|
137
|
-
tui.requestRender();
|
|
138
|
-
editor.setText("");
|
|
139
|
-
return "continue";
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
};
|
|
143
|
-
};
|
|
144
|
-
async function getAvailableHandoffFiles(options) {
|
|
145
|
-
try {
|
|
146
|
-
const dirents = await readdir(options.workspace.primaryDir, {
|
|
147
|
-
withFileTypes: true,
|
|
148
|
-
});
|
|
149
|
-
return dirents
|
|
150
|
-
.filter((dirent) => dirent.isFile() && dirent.name.match(/^handoff-.*\.md$/))
|
|
151
|
-
.map((dirent) => basename(dirent.name, ".md"))
|
|
152
|
-
.sort();
|
|
153
|
-
}
|
|
154
|
-
catch (error) {
|
|
155
|
-
if (error.code === "ENOENT") {
|
|
156
|
-
return [];
|
|
157
|
-
}
|
|
158
|
-
options.terminal.error(`Error reading handoff files: ${error}`);
|
|
159
|
-
return [];
|
|
160
|
-
}
|
|
161
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-command.d.ts","sourceRoot":"","sources":["../../source/commands/prompt-command.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9D,eAAO,MAAM,aAAa,GAAI,8EAO3B,cAAc,KAAG,WAgPnB,CAAC"}
|
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
import { readdir, readFile } from "node:fs/promises";
|
|
2
|
-
import path, { basename } from "node:path";
|
|
3
|
-
import { processPrompt } from "../mentions.js";
|
|
4
|
-
import style from "../terminal/style.js";
|
|
5
|
-
import { Text } from "../tui/index.js";
|
|
6
|
-
export const promptCommand = ({ terminal, modelManager, promptManager, config, promptHistory, workspace, }) => {
|
|
7
|
-
return {
|
|
8
|
-
command: "/prompt",
|
|
9
|
-
description: "Loads and executes prompts. Project prompts override user prompts with the same name.",
|
|
10
|
-
getSubCommands: async () => {
|
|
11
|
-
const getPromptNamesFromDir = async (dirPath) => {
|
|
12
|
-
try {
|
|
13
|
-
const dirents = await readdir(dirPath, { withFileTypes: true });
|
|
14
|
-
return dirents
|
|
15
|
-
.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".md"))
|
|
16
|
-
.map((dirent) => basename(dirent.name, ".md"));
|
|
17
|
-
}
|
|
18
|
-
catch (error) {
|
|
19
|
-
if (error.code === "ENOENT") {
|
|
20
|
-
return []; // Directory doesn't exist, return empty array
|
|
21
|
-
}
|
|
22
|
-
terminal.error(`Error reading prompts from ${dirPath}: ${error}`);
|
|
23
|
-
return []; // Return empty on other errors too, but log them
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
const userPromptDir = config.app.ensurePathSync("prompts"); // User prompts are global (~/.acai/prompts)
|
|
27
|
-
const projectPromptDir = config.project.ensurePathSync("prompts"); // Project prompts are local (./.acai/prompts)
|
|
28
|
-
const userPrompts = await getPromptNamesFromDir(userPromptDir);
|
|
29
|
-
const projectPrompts = await getPromptNamesFromDir(projectPromptDir);
|
|
30
|
-
// Combine and deduplicate, with project prompts taking precedence
|
|
31
|
-
const allPrompts = new Set([...userPrompts, ...projectPrompts]);
|
|
32
|
-
const promptList = Array.from(allPrompts).sort();
|
|
33
|
-
// Add 'list' as a special subcommand for listing all prompts
|
|
34
|
-
return ["list", ...promptList];
|
|
35
|
-
},
|
|
36
|
-
execute: async (args) => {
|
|
37
|
-
const promptName = args?.[0];
|
|
38
|
-
if (!promptName) {
|
|
39
|
-
await listAllPrompts(terminal, config);
|
|
40
|
-
return "continue";
|
|
41
|
-
}
|
|
42
|
-
// Handle 'list' subcommand
|
|
43
|
-
if (promptName === "list") {
|
|
44
|
-
await listAllPrompts(terminal, config);
|
|
45
|
-
return "continue";
|
|
46
|
-
}
|
|
47
|
-
// Check for old format and provide helpful error
|
|
48
|
-
if (promptName.includes(":")) {
|
|
49
|
-
terminal.warn("The old format (user:name or project:name) is no longer supported. Use: /prompt <prompt-name> [input...]");
|
|
50
|
-
return "continue";
|
|
51
|
-
}
|
|
52
|
-
try {
|
|
53
|
-
const promptResult = await findPrompt(promptName, config);
|
|
54
|
-
if (!promptResult) {
|
|
55
|
-
terminal.error(`Prompt not found: ${promptName}. Available prompts can be seen with tab completion.`);
|
|
56
|
-
return "continue";
|
|
57
|
-
}
|
|
58
|
-
let promptContent;
|
|
59
|
-
try {
|
|
60
|
-
promptContent = await readFile(promptResult.path, "utf8");
|
|
61
|
-
}
|
|
62
|
-
catch (error) {
|
|
63
|
-
if (error.code === "ENOENT") {
|
|
64
|
-
terminal.error(`Prompt file not found: ${promptName} at ${promptResult.path}`);
|
|
65
|
-
return "continue";
|
|
66
|
-
}
|
|
67
|
-
throw error;
|
|
68
|
-
}
|
|
69
|
-
// Combine remaining arguments into a single string for input
|
|
70
|
-
const inputArgs = args.slice(1);
|
|
71
|
-
const inputString = inputArgs.join(" ");
|
|
72
|
-
// Replace {{INPUT}} placeholder with the input string
|
|
73
|
-
if (promptContent.includes("{{INPUT}}")) {
|
|
74
|
-
promptContent = promptContent.replace(/{{INPUT}}/g, inputString);
|
|
75
|
-
}
|
|
76
|
-
terminal.info(`Loaded ${promptResult.type} prompt: ${promptName}`);
|
|
77
|
-
if (inputArgs.length > 0) {
|
|
78
|
-
terminal.info(`Input: "${inputString}"`);
|
|
79
|
-
}
|
|
80
|
-
const processedPrompt = await processPrompt(promptContent, {
|
|
81
|
-
baseDir: workspace.primaryDir,
|
|
82
|
-
model: modelManager.getModelMetadata("repl"),
|
|
83
|
-
});
|
|
84
|
-
for (const context of processedPrompt.context) {
|
|
85
|
-
promptManager.addContext(context);
|
|
86
|
-
}
|
|
87
|
-
promptManager.set(processedPrompt.message);
|
|
88
|
-
// Add the loaded prompt to history
|
|
89
|
-
promptHistory.push(processedPrompt.message);
|
|
90
|
-
terminal.lineBreak();
|
|
91
|
-
terminal.display(processedPrompt.message);
|
|
92
|
-
terminal.lineBreak();
|
|
93
|
-
terminal.hr();
|
|
94
|
-
return "use";
|
|
95
|
-
}
|
|
96
|
-
catch (error) {
|
|
97
|
-
terminal.error(`Error loading prompt: ${error.message}`);
|
|
98
|
-
return "continue";
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
async handle(args, { tui, container, editor, }) {
|
|
102
|
-
const promptName = args?.[0];
|
|
103
|
-
// Handle no subcommand or 'list' subcommand
|
|
104
|
-
if (!promptName || promptName === "list") {
|
|
105
|
-
await listAllPromptsTui(container, config);
|
|
106
|
-
tui.requestRender();
|
|
107
|
-
editor.setText("");
|
|
108
|
-
return "continue";
|
|
109
|
-
}
|
|
110
|
-
// Check for old format and provide helpful error
|
|
111
|
-
if (promptName.includes(":")) {
|
|
112
|
-
container.addChild(new Text(style.yellow("The old format (user:name or project:name) is no longer supported. Use: /prompt <prompt-name> [input...]"), 1, 0));
|
|
113
|
-
tui.requestRender();
|
|
114
|
-
editor.setText("");
|
|
115
|
-
return "continue";
|
|
116
|
-
}
|
|
117
|
-
try {
|
|
118
|
-
const promptResult = await findPrompt(promptName, config);
|
|
119
|
-
if (!promptResult) {
|
|
120
|
-
container.addChild(new Text(style.red(`Prompt not found: ${promptName}. Available prompts can be seen with tab completion.`), 1, 0));
|
|
121
|
-
tui.requestRender();
|
|
122
|
-
editor.setText("");
|
|
123
|
-
return "continue";
|
|
124
|
-
}
|
|
125
|
-
let promptContent;
|
|
126
|
-
try {
|
|
127
|
-
promptContent = await readFile(promptResult.path, "utf8");
|
|
128
|
-
}
|
|
129
|
-
catch (error) {
|
|
130
|
-
if (error.code === "ENOENT") {
|
|
131
|
-
container.addChild(new Text(style.red(`Prompt file not found: ${promptName} at ${promptResult.path}`), 1, 0));
|
|
132
|
-
tui.requestRender();
|
|
133
|
-
editor.setText("");
|
|
134
|
-
return "continue";
|
|
135
|
-
}
|
|
136
|
-
throw error;
|
|
137
|
-
}
|
|
138
|
-
// Combine remaining arguments into a single string for input
|
|
139
|
-
const inputArgs = args.slice(1);
|
|
140
|
-
const inputString = inputArgs.join(" ");
|
|
141
|
-
// Replace {{INPUT}} placeholder with the input string
|
|
142
|
-
if (promptContent.includes("{{INPUT}}")) {
|
|
143
|
-
promptContent = promptContent.replace(/{{INPUT}}/g, inputString);
|
|
144
|
-
}
|
|
145
|
-
container.addChild(new Text(`Loaded ${promptResult.type} prompt: ${style.blue(promptName)}`, 1, 0));
|
|
146
|
-
if (inputArgs.length > 0) {
|
|
147
|
-
container.addChild(new Text(`Input: "${inputString}"`, 2, 0));
|
|
148
|
-
}
|
|
149
|
-
const processedPrompt = await processPrompt(promptContent, {
|
|
150
|
-
baseDir: workspace.primaryDir,
|
|
151
|
-
model: modelManager.getModelMetadata("repl"),
|
|
152
|
-
});
|
|
153
|
-
for (const context of processedPrompt.context) {
|
|
154
|
-
promptManager.addContext(context);
|
|
155
|
-
}
|
|
156
|
-
promptManager.set(processedPrompt.message);
|
|
157
|
-
// Add the loaded prompt to history
|
|
158
|
-
promptHistory.push(processedPrompt.message);
|
|
159
|
-
tui.requestRender();
|
|
160
|
-
editor.setText("");
|
|
161
|
-
return "use";
|
|
162
|
-
}
|
|
163
|
-
catch (error) {
|
|
164
|
-
container.addChild(new Text(style.red(`Error loading prompt: ${error.message}`), 1, 0));
|
|
165
|
-
tui.requestRender();
|
|
166
|
-
editor.setText("");
|
|
167
|
-
return "continue";
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
};
|
|
171
|
-
};
|
|
172
|
-
async function findPrompt(promptName, config) {
|
|
173
|
-
// Check project prompts first (they take precedence)
|
|
174
|
-
const projectPath = path.join(config.project.ensurePathSync("prompts"), `${promptName}.md`);
|
|
175
|
-
try {
|
|
176
|
-
await readFile(projectPath, "utf8");
|
|
177
|
-
return { path: projectPath, type: "project" };
|
|
178
|
-
}
|
|
179
|
-
catch (error) {
|
|
180
|
-
if (error.code !== "ENOENT") {
|
|
181
|
-
throw error; // Re-throw non-file-not-found errors
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
// Check user prompts if not found in project
|
|
185
|
-
const userPath = path.join(config.app.ensurePathSync("prompts"), `${promptName}.md`);
|
|
186
|
-
try {
|
|
187
|
-
await readFile(userPath, "utf8");
|
|
188
|
-
return { path: userPath, type: "user" };
|
|
189
|
-
}
|
|
190
|
-
catch (error) {
|
|
191
|
-
if (error.code !== "ENOENT") {
|
|
192
|
-
throw error; // Re-throw non-file-not-found errors
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
return null; // Prompt not found in either location
|
|
196
|
-
}
|
|
197
|
-
async function listAllPrompts(terminal, config) {
|
|
198
|
-
const getPromptNamesFromDir = async (dirPath) => {
|
|
199
|
-
try {
|
|
200
|
-
const dirents = await readdir(dirPath, { withFileTypes: true });
|
|
201
|
-
return dirents
|
|
202
|
-
.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".md"))
|
|
203
|
-
.map((dirent) => basename(dirent.name, ".md"));
|
|
204
|
-
}
|
|
205
|
-
catch (error) {
|
|
206
|
-
if (error.code === "ENOENT") {
|
|
207
|
-
return []; // Directory doesn't exist, return empty array
|
|
208
|
-
}
|
|
209
|
-
terminal.error(`Error reading prompts from ${dirPath}: ${error}`);
|
|
210
|
-
return []; // Return empty on other errors too, but log them
|
|
211
|
-
}
|
|
212
|
-
};
|
|
213
|
-
const userPromptDir = config.app.ensurePathSync("prompts");
|
|
214
|
-
const projectPromptDir = config.project.ensurePathSync("prompts");
|
|
215
|
-
const userPrompts = await getPromptNamesFromDir(userPromptDir);
|
|
216
|
-
const projectPrompts = await getPromptNamesFromDir(projectPromptDir);
|
|
217
|
-
if (userPrompts.length === 0 && projectPrompts.length === 0) {
|
|
218
|
-
terminal.warn("No prompts found. Create prompts in ~/.acai/prompts/ or ./.acai/prompts/");
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
terminal.info("Available prompts:");
|
|
222
|
-
if (projectPrompts.length > 0) {
|
|
223
|
-
terminal.info(" Project prompts (./.acai/prompts/):");
|
|
224
|
-
projectPrompts.sort().forEach((prompt) => {
|
|
225
|
-
terminal.info(` • ${prompt}`);
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
if (userPrompts.length > 0) {
|
|
229
|
-
terminal.info(" User prompts (~/.acai/prompts/):");
|
|
230
|
-
userPrompts.sort().forEach((prompt) => {
|
|
231
|
-
terminal.info(` • ${prompt}`);
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
terminal.info("\nUsage: /prompt <prompt-name> [input...]");
|
|
235
|
-
terminal.info("Example: /prompt project-status");
|
|
236
|
-
}
|
|
237
|
-
async function listAllPromptsTui(container, config) {
|
|
238
|
-
const getPromptNamesFromDir = async (dirPath) => {
|
|
239
|
-
try {
|
|
240
|
-
const dirents = await readdir(dirPath, { withFileTypes: true });
|
|
241
|
-
return dirents
|
|
242
|
-
.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".md"))
|
|
243
|
-
.map((dirent) => basename(dirent.name, ".md"));
|
|
244
|
-
}
|
|
245
|
-
catch (error) {
|
|
246
|
-
if (error.code === "ENOENT") {
|
|
247
|
-
return []; // Directory doesn't exist, return empty array
|
|
248
|
-
}
|
|
249
|
-
return []; // Return empty on other errors
|
|
250
|
-
}
|
|
251
|
-
};
|
|
252
|
-
const userPromptDir = config.app.ensurePathSync("prompts");
|
|
253
|
-
const projectPromptDir = config.project.ensurePathSync("prompts");
|
|
254
|
-
const userPrompts = await getPromptNamesFromDir(userPromptDir);
|
|
255
|
-
const projectPrompts = await getPromptNamesFromDir(projectPromptDir);
|
|
256
|
-
if (userPrompts.length === 0 && projectPrompts.length === 0) {
|
|
257
|
-
container.addChild(new Text(style.yellow("No prompts found. Create prompts in ~/.acai/prompts/ or ./.acai/prompts/"), 1, 0));
|
|
258
|
-
return;
|
|
259
|
-
}
|
|
260
|
-
container.addChild(new Text("Available prompts:", 0, 1));
|
|
261
|
-
let lineIndex = 2;
|
|
262
|
-
if (projectPrompts.length > 0) {
|
|
263
|
-
container.addChild(new Text(" Project prompts (./.acai/prompts/):", lineIndex, 0));
|
|
264
|
-
lineIndex++;
|
|
265
|
-
projectPrompts.sort().forEach((prompt) => {
|
|
266
|
-
container.addChild(new Text(` • ${prompt}`, lineIndex, 0));
|
|
267
|
-
lineIndex++;
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
if (userPrompts.length > 0) {
|
|
271
|
-
container.addChild(new Text(" User prompts (~/.acai/prompts/):", lineIndex, 0));
|
|
272
|
-
lineIndex++;
|
|
273
|
-
userPrompts.sort().forEach((prompt) => {
|
|
274
|
-
container.addChild(new Text(` • ${prompt}`, lineIndex, 0));
|
|
275
|
-
lineIndex++;
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
container.addChild(new Text("\nUsage: /prompt <prompt-name> [input...]", lineIndex, 0));
|
|
279
|
-
container.addChild(new Text("Example: /prompt project-status", lineIndex + 1, 1));
|
|
280
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remove-directory-command.d.ts","sourceRoot":"","sources":["../../source/commands/remove-directory-command.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9D,eAAO,MAAM,sBAAsB,GAAI,0BAGpC,cAAc,KAAG,WA6InB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reset-command.d.ts","sourceRoot":"","sources":["../../source/commands/reset-command.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9D,eAAO,MAAM,YAAY,GAAI,6CAI1B,cAAc,KAAG,WAqCnB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rules-command.d.ts","sourceRoot":"","sources":["../../source/commands/rules-command.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9D,eAAO,MAAM,YAAY,GAAI,cAAc,cAAc,KAAG,WA4L3D,CAAC"}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { config } from "../config.js";
|
|
2
|
-
import { editor } from "../terminal/editor-prompt.js";
|
|
3
|
-
import style from "../terminal/style.js";
|
|
4
|
-
import { Text } from "../tui/index.js";
|
|
5
|
-
export const rulesCommand = ({ terminal }) => {
|
|
6
|
-
return {
|
|
7
|
-
command: "/rules",
|
|
8
|
-
description: "View, add, or edit rules. Usage: /rules [view|add <text>|edit]",
|
|
9
|
-
getSubCommands: () => Promise.resolve(["view", "add", "edit"]),
|
|
10
|
-
execute: async (args) => {
|
|
11
|
-
const subCommand = args[0] ?? "view"; // Default to 'view'
|
|
12
|
-
const commandArgs = args.slice(1).join(" ");
|
|
13
|
-
try {
|
|
14
|
-
switch (subCommand) {
|
|
15
|
-
case "view": {
|
|
16
|
-
const currentContent = await config.readAgentsFile();
|
|
17
|
-
if (currentContent) {
|
|
18
|
-
terminal.writeln("--- Current Rules ---");
|
|
19
|
-
terminal.writeln(currentContent);
|
|
20
|
-
terminal.writeln("---------------------");
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
terminal.writeln("No rules defined yet. Use '/rules add' or '/rules edit'.");
|
|
24
|
-
}
|
|
25
|
-
break;
|
|
26
|
-
}
|
|
27
|
-
case "add": {
|
|
28
|
-
const newMemory = commandArgs.trim();
|
|
29
|
-
if (!newMemory) {
|
|
30
|
-
terminal.error("Error: Memory text cannot be empty for 'add'.");
|
|
31
|
-
terminal.writeln("Usage: /memory add <new memory text>");
|
|
32
|
-
return "continue";
|
|
33
|
-
}
|
|
34
|
-
const currentContent = await config.readAgentsFile();
|
|
35
|
-
const updatedContent = currentContent
|
|
36
|
-
? `${currentContent.trim()}\n- ${newMemory}` // Ensure space after dash
|
|
37
|
-
: `- ${newMemory}`; // Start with dash if new file
|
|
38
|
-
await config.writeAgentsFile(updatedContent);
|
|
39
|
-
break;
|
|
40
|
-
}
|
|
41
|
-
case "edit": {
|
|
42
|
-
const currentContent = await config.readAgentsFile();
|
|
43
|
-
const updatedContent = await editor({
|
|
44
|
-
message: "Edit rules:",
|
|
45
|
-
postfix: "md",
|
|
46
|
-
default: currentContent,
|
|
47
|
-
skipPrompt: true,
|
|
48
|
-
});
|
|
49
|
-
// Check if the user cancelled the edit (editor returns the original content)
|
|
50
|
-
// Or if the content is actually different
|
|
51
|
-
if (updatedContent !== currentContent) {
|
|
52
|
-
await config.writeAgentsFile(updatedContent);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
terminal.writeln("Edit cancelled or no changes made.");
|
|
56
|
-
}
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
default:
|
|
60
|
-
terminal.writeln("Invalid subcommand. Usage: /rules [view|add <text>|edit]");
|
|
61
|
-
break;
|
|
62
|
-
}
|
|
63
|
-
return "continue";
|
|
64
|
-
}
|
|
65
|
-
catch (_error) {
|
|
66
|
-
// Errors from read/write helpers are already logged
|
|
67
|
-
terminal.error("Failed to execute memory command.");
|
|
68
|
-
return "continue";
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
async handle(args, { tui, container, editor, }) {
|
|
72
|
-
const subCommand = args[0] ?? "view"; // Default to 'view'
|
|
73
|
-
const commandArgs = args.slice(1).join(" ");
|
|
74
|
-
try {
|
|
75
|
-
switch (subCommand) {
|
|
76
|
-
case "view": {
|
|
77
|
-
const currentContent = await config.readAgentsFile();
|
|
78
|
-
if (currentContent) {
|
|
79
|
-
container.addChild(new Text("--- Current Rules ---", 0, 1));
|
|
80
|
-
container.addChild(new Text(currentContent, 2, 0));
|
|
81
|
-
container.addChild(new Text("---------------------", 3, 0));
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
container.addChild(new Text(style.yellow("No rules defined yet. Use '/rules add' or '/rules edit'."), 1, 0));
|
|
85
|
-
}
|
|
86
|
-
break;
|
|
87
|
-
}
|
|
88
|
-
case "add": {
|
|
89
|
-
const newMemory = commandArgs.trim();
|
|
90
|
-
if (!newMemory) {
|
|
91
|
-
container.addChild(new Text(style.red("Error: Memory text cannot be empty for 'add'."), 1, 0));
|
|
92
|
-
container.addChild(new Text("Usage: /memory add <new memory text>", 2, 0));
|
|
93
|
-
tui.requestRender();
|
|
94
|
-
editor.setText("");
|
|
95
|
-
return "continue";
|
|
96
|
-
}
|
|
97
|
-
const currentContent = await config.readAgentsFile();
|
|
98
|
-
const updatedContent = currentContent
|
|
99
|
-
? `${currentContent.trim()}\n- ${newMemory}` // Ensure space after dash
|
|
100
|
-
: `- ${newMemory}`; // Start with dash if new file
|
|
101
|
-
await config.writeAgentsFile(updatedContent);
|
|
102
|
-
container.addChild(new Text(style.green("Rule added successfully"), 0, 1));
|
|
103
|
-
break;
|
|
104
|
-
}
|
|
105
|
-
case "edit": {
|
|
106
|
-
const currentContent = await config.readAgentsFile();
|
|
107
|
-
// For TUI mode, we can't use the editor prompt, so we'll just show current content
|
|
108
|
-
if (currentContent) {
|
|
109
|
-
container.addChild(new Text("Current rules:", 0, 1));
|
|
110
|
-
container.addChild(new Text(currentContent, 2, 0));
|
|
111
|
-
container.addChild(new Text(style.dim("Note: Rule editing not available in TUI mode"), 3, 0));
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
container.addChild(new Text(style.yellow("No rules defined yet. Use '/rules add' or '/rules edit'."), 1, 0));
|
|
115
|
-
}
|
|
116
|
-
break;
|
|
117
|
-
}
|
|
118
|
-
default:
|
|
119
|
-
container.addChild(new Text(style.red("Invalid subcommand. Usage: /rules [view|add <text>|edit]"), 1, 0));
|
|
120
|
-
break;
|
|
121
|
-
}
|
|
122
|
-
tui.requestRender();
|
|
123
|
-
editor.setText("");
|
|
124
|
-
return "continue";
|
|
125
|
-
}
|
|
126
|
-
catch (_error) {
|
|
127
|
-
// Errors from read/write helpers are already logged
|
|
128
|
-
container.addChild(new Text(style.red("Failed to execute memory command."), 0, 1));
|
|
129
|
-
tui.requestRender();
|
|
130
|
-
editor.setText("");
|
|
131
|
-
return "continue";
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
};
|
|
135
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"save-command.d.ts","sourceRoot":"","sources":["../../source/commands/save-command.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9D,eAAO,MAAM,WAAW,GAAI,+BAGzB,cAAc,KAAG,WAgCnB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shell-command.d.ts","sourceRoot":"","sources":["../../source/commands/shell-command.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAK9D,eAAO,MAAM,YAAY,GAAI,SAAS,cAAc,KAAG,WAgLtD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usage-command.d.ts","sourceRoot":"","sources":["../../source/commands/usage-command.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9D,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,YAAY,GACb,EAAE,cAAc,GAAG,WAAW,CA+C9B"}
|