@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
package/README.md
CHANGED
|
@@ -10,27 +10,30 @@ Acai is a powerful **AI-driven command-line interface (CLI) tool** designed to a
|
|
|
10
10
|
|
|
11
11
|
### Core Functionality:
|
|
12
12
|
|
|
13
|
-
* **Interactive AI Assistant:** Engage in a conversational REPL (Read-Eval-Print Loop) to get assistance with coding, debugging, refactoring, and more.
|
|
13
|
+
* **Interactive AI Assistant:** Engage in a conversational REPL (Read-Eval-Print Loop) or TUI (Terminal User Interface) to get assistance with coding, debugging, refactoring, and more.
|
|
14
14
|
* **Codebase Interaction:** Read, edit, and navigate files; search code; and understand project structure.
|
|
15
15
|
* **Git Integration:** Generate conventional commits, review pull requests, and manage local changes.
|
|
16
16
|
* **Extensible Tooling:** Utilizes a suite of internal tools (e.g., `bash`, `codeInterpreter`, `webSearch`) to perform actions.
|
|
17
17
|
* **Multi-Model Support:** Seamlessly switch between various AI providers (e.g., OpenAI, Google, Anthropic, DeepSeek, Groq, OpenRouter).
|
|
18
18
|
* **Context Management:** Automatically incorporates relevant file content, clipboard data, and conversation history into AI prompts.
|
|
19
19
|
* **Configurable & Learnable:** Customize behavior through project-specific rules and learn from user corrections.
|
|
20
|
+
* **Terminal User Interface:** Modern TUI with modal dialogs, autocomplete, and rich text formatting.
|
|
20
21
|
|
|
21
22
|
## ✨ Features
|
|
22
23
|
|
|
23
|
-
* **Conversational REPL:** Intuitive command-line interface for interacting with the AI.
|
|
24
|
+
* **Conversational REPL/TUI:** Intuitive command-line interface and modern terminal UI for interacting with the AI.
|
|
24
25
|
* **File System Operations:** Read, write, edit, move, and delete files.
|
|
25
26
|
* **File & Directory Mentions:** Include file contents and entire directories in prompts using `@filename` and `@dirname` syntax.
|
|
26
|
-
* **Code Navigation & Analysis:**
|
|
27
|
+
* **Code Navigation & Analysis:** Advanced file searching and code analysis capabilities.
|
|
27
28
|
* **Git Workflow Automation:** Streamline commit messages and code reviews.
|
|
28
|
-
* **
|
|
29
|
-
* **
|
|
30
|
-
* **Token Usage Tracking:** Monitor AI token consumption.
|
|
29
|
+
* **Extensible Commands:** A rich set of built-in commands (`/help`, `/model`, `/session`, `/list-tools`, etc.).
|
|
30
|
+
* **Token Usage Tracking:** Monitor AI token consumption with comprehensive session overview.
|
|
31
31
|
* **Configurable AI Models:** Easily switch between different LLM providers and models.
|
|
32
|
-
* **Shell Integration:** Execute shell commands inline using `!`command`` syntax.
|
|
32
|
+
* **Shell Integration:** Execute shell commands inline using `!`command`` syntax or via `/shell` command.
|
|
33
33
|
* **Dynamic Tools:** Create and load custom tools from JavaScript files in your project or user directory.
|
|
34
|
+
* **Multi-workspace Support:** Work across multiple project directories simultaneously.
|
|
35
|
+
* **Skills System:** Discover and load specialized instruction files for specific tasks (PDF extraction, database migrations, etc.).
|
|
36
|
+
|
|
34
37
|
|
|
35
38
|
## 🛠️ Technologies Used
|
|
36
39
|
|
|
@@ -129,17 +132,9 @@ X_AI_API_KEY=your_xai_api_key_here
|
|
|
129
132
|
|
|
130
133
|
# OpenRouter (Access to multiple models)
|
|
131
134
|
OPENROUTER_API_KEY=your_openrouter_api_key_here
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
### Web Service API Keys (Optional)
|
|
135
|
-
|
|
136
|
-
```bash
|
|
137
|
-
# Exa (for enhanced web search functionality)
|
|
138
|
-
# Optional: Falls back to DuckDuckGo search if not provided
|
|
139
|
-
EXA_API_KEY=your_exa_api_key_here
|
|
140
135
|
|
|
141
|
-
#
|
|
142
|
-
|
|
136
|
+
# OpenCode Zen
|
|
137
|
+
OPENCODE_ZEN_API_TOKEN=your_opencode_zen_api_token_here
|
|
143
138
|
```
|
|
144
139
|
|
|
145
140
|
### Application Configuration
|
|
@@ -162,16 +157,12 @@ GOOGLE_GENERATIVE_AI_API_KEY=...
|
|
|
162
157
|
GROQ_API_KEY=...
|
|
163
158
|
OPENROUTER_API_KEY=sk-or-...
|
|
164
159
|
|
|
165
|
-
# Optional: Web services (fallbacks available if not provided)
|
|
166
|
-
EXA_API_KEY=... # Falls back to DuckDuckGo search
|
|
167
|
-
|
|
168
160
|
# Optional: Application settings
|
|
169
161
|
LOG_LEVEL=info
|
|
170
162
|
```
|
|
171
163
|
|
|
172
164
|
**Note:** You need at least one AI provider API key to use Acai. The tool will work with any combination of the supported providers.
|
|
173
165
|
|
|
174
|
-
**Web Search:** The web search functionality works without any API keys by using DuckDuckGo as a fallback. Providing an EXA_API_KEY enables enhanced search capabilities with more detailed content extraction.
|
|
175
166
|
|
|
176
167
|
### Usage
|
|
177
168
|
|
|
@@ -187,14 +178,33 @@ acai -p "What files contain the term 'toolCallRepair'?"
|
|
|
187
178
|
|
|
188
179
|
# Pipe input
|
|
189
180
|
echo "How many TypeScript files are in this project?" | acai
|
|
181
|
+
|
|
182
|
+
# Disable skills discovery
|
|
183
|
+
acai --no-skills
|
|
184
|
+
|
|
185
|
+
# Add additional working directories
|
|
186
|
+
acai --add-dir /path/to/project1 --add-dir /path/to/project2
|
|
187
|
+
|
|
188
|
+
# Resume a previous session by selecting from a list
|
|
189
|
+
acai --continue
|
|
190
|
+
|
|
191
|
+
# Resume the most recent session
|
|
192
|
+
acai --resume
|
|
193
|
+
|
|
194
|
+
# Resume a specific session by ID
|
|
195
|
+
acai --resume a1b2c3d4-e5f6-7890-1234-567890abcdef
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**Note:** When exiting a session with messages, Acai will display a resume command with the session ID:
|
|
199
|
+
```
|
|
200
|
+
To resume this session call acai --resume <session-id>
|
|
190
201
|
```
|
|
191
202
|
|
|
192
203
|
Once in the REPL, you can type your prompts or use commands:
|
|
193
204
|
|
|
194
205
|
```
|
|
195
206
|
> How do I read a file in Node.js?
|
|
196
|
-
>
|
|
197
|
-
> /edit source/cli.ts "Change this function name"
|
|
207
|
+
> @source/index.ts
|
|
198
208
|
> /help
|
|
199
209
|
```
|
|
200
210
|
|
|
@@ -216,6 +226,54 @@ You can reference files and directories directly in your prompts:
|
|
|
216
226
|
- `@http://example.com` - Fetch and include web content
|
|
217
227
|
- ``!`command` `` - Execute shell command and include output
|
|
218
228
|
|
|
229
|
+
### Prompt Arguments
|
|
230
|
+
|
|
231
|
+
Pass dynamic values to commands using argument placeholders in custom prompts:
|
|
232
|
+
|
|
233
|
+
#### All arguments with `$ARGUMENTS`
|
|
234
|
+
|
|
235
|
+
The `$ARGUMENTS` placeholder captures all arguments passed to the command:
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
# Command definition
|
|
239
|
+
echo 'Fix issue #$ARGUMENTS following our coding standards' > .acai/prompts/fix-issue.md
|
|
240
|
+
|
|
241
|
+
# Usage
|
|
242
|
+
> /fix-issue 123 high-priority
|
|
243
|
+
# $ARGUMENTS becomes: "123 high-priority"
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
#### Individual arguments with `$1`, `$2`, `$3`, etc.
|
|
247
|
+
|
|
248
|
+
Access specific arguments individually using positional parameters (similar to shell scripts):
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
# Command definition
|
|
252
|
+
echo 'Review PR #$1 with priority $2 and assign to $3' > .acai/prompts/review-pr.md
|
|
253
|
+
|
|
254
|
+
# Usage
|
|
255
|
+
> /review-pr 456 high alice
|
|
256
|
+
# $1 becomes "456", $2 becomes "high", $3 becomes "alice"
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
Use positional arguments when you need to:
|
|
260
|
+
- Access arguments individually in different parts of your command
|
|
261
|
+
- Provide defaults for missing arguments
|
|
262
|
+
- Build more structured commands with specific parameter roles
|
|
263
|
+
|
|
264
|
+
#### Backward compatibility with `{{INPUT}}`
|
|
265
|
+
|
|
266
|
+
The legacy `{{INPUT}}` placeholder is still supported and works the same as `$ARGUMENTS`:
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
# Command definition
|
|
270
|
+
echo 'Analyze the following code: {{INPUT}}' > .acai/prompts/analyze.md
|
|
271
|
+
|
|
272
|
+
# Usage
|
|
273
|
+
> /analyze src/file.ts
|
|
274
|
+
# {{INPUT}} becomes: "src/file.ts"
|
|
275
|
+
```
|
|
276
|
+
|
|
219
277
|
**Note:** Using `-p/--prompt` runs in CLI mode (one-shot execution), while running without a prompt starts interactive REPL mode.
|
|
220
278
|
|
|
221
279
|
For a list of available commands, type `/help` within the REPL.
|
|
@@ -225,23 +283,26 @@ For a list of available commands, type `/help` within the REPL.
|
|
|
225
283
|
- `/help` - Shows usage information
|
|
226
284
|
- `/reset` - Saves chat history and resets the conversation
|
|
227
285
|
- `/save` - Saves chat history
|
|
228
|
-
- `/compact` - Saves, summarizes and resets the chat history
|
|
229
286
|
- `/exit` or `/bye` - Exits and saves chat history
|
|
230
|
-
- `/files [pattern]` - Select files interactively or by pattern, adding content to prompt
|
|
231
287
|
- `/init` - Generate or improve `AGENTS.md`
|
|
232
|
-
- `/editPrompt` - Edit the current prompt
|
|
233
288
|
- `/paste` - Add clipboard contents to the next prompt
|
|
234
|
-
- `/prompt <name
|
|
235
|
-
- `/rules [view|add <text>|edit]` - View or edit persistent project rules/memories (formerly /memory)
|
|
289
|
+
- `/prompt <name> [arguments...]` - Load saved prompts with optional arguments. Project prompts override user prompts. Supports argument placeholders (`$ARGUMENTS`, `$1`, `$2`, etc.) in prompt files.
|
|
236
290
|
- `/model [provider:model|category|provider]` - List or switch models
|
|
237
|
-
- `/
|
|
291
|
+
- `/session` - Show comprehensive session information including usage and costs
|
|
238
292
|
- `/clear` - Clears the terminal screen for the current session
|
|
239
|
-
- `/lastLog` - Show the last application log entries
|
|
240
|
-
- `/appLog` - Show or follow the application log
|
|
241
293
|
- `/generateRules` - Analyze the current conversation and suggest project rules
|
|
242
|
-
- `/edit <path> "<change description>"` - Edit a file with AI assistance
|
|
243
294
|
- `/copy` - Copy the last assistant response to the system clipboard
|
|
244
295
|
- `/list-tools` or `/lt` - List all available static and dynamic tools
|
|
296
|
+
- `/add-dir <path>` - Add additional working directory
|
|
297
|
+
- `/list-dirs` - List all working directories
|
|
298
|
+
- `/remove-dir <path>` - Remove a working directory
|
|
299
|
+
- `/health` - Check system health and dependencies
|
|
300
|
+
- `/history` - View and manage conversation history
|
|
301
|
+
- `/pickup` - Resume a previous conversation
|
|
302
|
+
- `/handoff` - Hand off conversation to another agent
|
|
303
|
+
- `/shell` - Execute shell commands
|
|
304
|
+
|
|
305
|
+
**Note**: Some commands mentioned in older documentation may no longer be available. Use `/help` to see current commands.
|
|
245
306
|
|
|
246
307
|
Clipboard notes:
|
|
247
308
|
- macOS: uses `pbcopy`
|
|
@@ -465,6 +526,105 @@ Available tools:
|
|
|
465
526
|
Total: 14 static, 2 dynamic
|
|
466
527
|
```
|
|
467
528
|
|
|
529
|
+
## Skills System
|
|
530
|
+
|
|
531
|
+
Acai includes a powerful skills system that allows you to create and use specialized instruction files for specific tasks. Skills are markdown files with YAML frontmatter that provide detailed instructions for particular domains (e.g., database migrations, PDF extraction, code review).
|
|
532
|
+
|
|
533
|
+
### How Skills Work
|
|
534
|
+
|
|
535
|
+
1. **Discovery**: At startup, Acai scans multiple locations for skills
|
|
536
|
+
2. **Listing**: Available skills are listed in the system prompt
|
|
537
|
+
3. **On-demand loading**: When a task matches a skill's description, the agent uses the `read` tool to load the skill file
|
|
538
|
+
4. **Execution**: The agent follows the instructions in the skill file
|
|
539
|
+
|
|
540
|
+
### Skill File Format
|
|
541
|
+
|
|
542
|
+
Skills are markdown files named `SKILL.md` with YAML frontmatter:
|
|
543
|
+
|
|
544
|
+
```markdown
|
|
545
|
+
---
|
|
546
|
+
description: Extract text and tables from PDF files
|
|
547
|
+
name: pdf-extract # Optional, defaults to directory name
|
|
548
|
+
---
|
|
549
|
+
|
|
550
|
+
# PDF Processing Instructions
|
|
551
|
+
|
|
552
|
+
1. Use `pdftotext` to extract plain text
|
|
553
|
+
2. For tables, use `tabula-py` or similar
|
|
554
|
+
3. Always verify extraction quality
|
|
555
|
+
|
|
556
|
+
Scripts are in: {baseDir}/scripts/
|
|
557
|
+
Configuration: {baseDir}/config.json
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
**Required fields:**
|
|
561
|
+
- `description`: Short description shown in system prompt
|
|
562
|
+
|
|
563
|
+
**Optional fields:**
|
|
564
|
+
- `name`: Override the skill name (defaults to directory name or colon-separated path)
|
|
565
|
+
|
|
566
|
+
**Placeholder:**
|
|
567
|
+
- `{baseDir}`: Replaced with the skill's base directory path
|
|
568
|
+
|
|
569
|
+
### Skill Locations
|
|
570
|
+
|
|
571
|
+
Skills are loaded from these locations (later sources override earlier ones):
|
|
572
|
+
|
|
573
|
+
1. `~/.codex/skills/**/SKILL.md` (Codex CLI user skills)
|
|
574
|
+
2. `~/.claude/skills/*/SKILL.md` (Claude Code user skills)
|
|
575
|
+
3. `<cwd>/.claude/skills/*/SKILL.md` (Claude Code project skills)
|
|
576
|
+
4. `~/.acai/skills/**/SKILL.md` (Acai user skills)
|
|
577
|
+
5. `<cwd>/.acai/skills/**/SKILL.md` (Acai project skills)
|
|
578
|
+
|
|
579
|
+
### Directory Structure
|
|
580
|
+
|
|
581
|
+
Skills can be organized hierarchically with colon-separated names:
|
|
582
|
+
|
|
583
|
+
```
|
|
584
|
+
~/.acai/skills/
|
|
585
|
+
├── pdf-extract/
|
|
586
|
+
│ ├── SKILL.md # Becomes "pdf-extract" skill
|
|
587
|
+
│ └── scripts/ # Optional: supporting files
|
|
588
|
+
├── db/
|
|
589
|
+
│ └── migrate/
|
|
590
|
+
│ └── SKILL.md # Becomes "db:migrate" skill
|
|
591
|
+
└── aws/
|
|
592
|
+
└── s3/
|
|
593
|
+
└── upload/
|
|
594
|
+
└── SKILL.md # Becomes "aws:s3:upload" skill
|
|
595
|
+
```
|
|
596
|
+
|
|
597
|
+
### Compatibility
|
|
598
|
+
|
|
599
|
+
Acai's skills system is compatible with:
|
|
600
|
+
- **Pi Native Format**: `~/.acai/skills/**/SKILL.md` (recursive, colon-separated paths)
|
|
601
|
+
- **Claude Code Format**: `~/.claude/skills/*/SKILL.md` (single level only)
|
|
602
|
+
- **Codex CLI Format**: `~/.codex/skills/**/SKILL.md` (recursive, simple names)
|
|
603
|
+
|
|
604
|
+
### Configuration
|
|
605
|
+
|
|
606
|
+
Skills are enabled by default. You can disable them via:
|
|
607
|
+
|
|
608
|
+
1. **CLI flag**: `acai --no-skills`
|
|
609
|
+
2. **Settings file**: Add to `~/.acai/acai.json` or `.acai/acai.json`:
|
|
610
|
+
```json
|
|
611
|
+
{
|
|
612
|
+
"skills": {
|
|
613
|
+
"enabled": false
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
### Usage Example
|
|
619
|
+
|
|
620
|
+
1. **Agent startup**: Scans all skill locations
|
|
621
|
+
2. **System prompt**: Lists available skills
|
|
622
|
+
3. **User request**: "Extract text from this PDF"
|
|
623
|
+
4. **Agent matches**: Sees "pdf-extract: Extract text and tables from PDF files"
|
|
624
|
+
5. **Skill loading**: Uses `read` tool to load `~/.acai/skills/pdf-extract/SKILL.md`
|
|
625
|
+
6. **Placeholder substitution**: Replaces `{baseDir}` with skill directory path
|
|
626
|
+
7. **Execution**: Follows instructions in skill file
|
|
627
|
+
|
|
468
628
|
## Configuration
|
|
469
629
|
|
|
470
630
|
### Project Configuration
|
|
@@ -479,15 +639,22 @@ Acai supports project-specific configuration through a `.acai/acai.json` file in
|
|
|
479
639
|
"notify": true, // Optional: Enable system notifications (default: false)
|
|
480
640
|
"tools": {
|
|
481
641
|
"maxTokens": 30000 // Optional: Global max token limit for tools
|
|
482
|
-
}
|
|
642
|
+
},
|
|
643
|
+
"skills": {
|
|
644
|
+
"enabled": true // Optional: Enable/disable skills discovery (default: true)
|
|
645
|
+
},
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
|
|
483
649
|
}
|
|
484
650
|
```
|
|
485
651
|
|
|
486
652
|
### Project-Specific Customization
|
|
487
653
|
|
|
488
654
|
- **Rules/Guidelines**: Add project-specific AI behavior rules in `AGENTS.md`
|
|
489
|
-
- **Custom Prompts**: Store reusable prompts in `.acai/prompts
|
|
490
|
-
|
|
655
|
+
- **Custom Prompts**: Store reusable prompts in `.acai/prompts/`. Supports argument placeholders (`$ARGUMENTS`, `$1`, `$2`, etc.) for dynamic content.
|
|
656
|
+
|
|
657
|
+
- **File Selections**: Save file/directory selections in `.acai/selections/`
|
|
491
658
|
- **Memory/Rules**: Persistent project rules stored in `.acai/rules/`
|
|
492
659
|
|
|
493
660
|
### Global Configuration
|
|
@@ -512,6 +679,19 @@ acai
|
|
|
512
679
|
LOG_LEVEL=warn acai
|
|
513
680
|
```
|
|
514
681
|
|
|
682
|
+
## Web Skills
|
|
683
|
+
|
|
684
|
+
Acai's web functionality has been moved to standalone skills that operate independently of the core codebase. These skills provide web-related capabilities while keeping the main acai-ts project lightweight and focused.
|
|
685
|
+
|
|
686
|
+
### Skill Locations
|
|
687
|
+
|
|
688
|
+
Web skills are located in:
|
|
689
|
+
- `~/.acai/skills/web-fetch/` - User-level web fetch skill
|
|
690
|
+
- `~/.acai/skills/web-search/` - User-level web search skill
|
|
691
|
+
- `<project>/.acai/skills/web-fetch/` - Project-level web fetch skill
|
|
692
|
+
- `<project>/.acai/skills/web-search/` - Project-level web search skill
|
|
693
|
+
|
|
694
|
+
|
|
515
695
|
## ⚙️ Development
|
|
516
696
|
|
|
517
697
|
### Development Environment Setup
|
|
@@ -562,6 +742,7 @@ Here's a list of useful `npm` scripts for development:
|
|
|
562
742
|
| `npm run knip` | Detects unused files, dependencies, and exports. |
|
|
563
743
|
| `npm run check` | Interactively checks for and updates outdated npm packages. |
|
|
564
744
|
| `npm run cpd` | Checks for copy-pasted code using `jscpd`. |
|
|
745
|
+
| `npm run typecheck` | Type checks the codebase without emitting files. |
|
|
565
746
|
|
|
566
747
|
### Code Structure
|
|
567
748
|
|
|
@@ -569,17 +750,22 @@ The project is organized as follows:
|
|
|
569
750
|
|
|
570
751
|
```
|
|
571
752
|
.
|
|
572
|
-
├── .acai/ # Internal configuration
|
|
753
|
+
├── .acai/ # Internal configuration and temporary files
|
|
573
754
|
├── source/ # Main application source code
|
|
755
|
+
│ ├── agent/ # Agent loop and manual execution
|
|
756
|
+
│ ├── api/ # External API integrations (e.g., Exa)
|
|
574
757
|
│ ├── cli.ts # CLI entry point
|
|
575
|
-
│ ├──
|
|
576
|
-
│ ├──
|
|
758
|
+
│ ├── commands/ # Implementations of REPL commands
|
|
759
|
+
│ ├── execution/ # Command execution utilities
|
|
577
760
|
│ ├── middleware/ # AI request/response middleware (logging, rate limiting)
|
|
578
761
|
│ ├── models/ # AI model providers and management
|
|
579
762
|
│ ├── prompts/ # Prompt generation and management
|
|
763
|
+
│ ├── repl/ # REPL interface components
|
|
580
764
|
│ ├── terminal/ # Terminal output formatting and rendering
|
|
765
|
+
│ ├── tui/ # Terminal User Interface components
|
|
581
766
|
│ ├── tools/ # AI-callable tools (filesystem, git, web, bash, etc.)
|
|
582
|
-
│
|
|
767
|
+
│ ├── tokens/ # Token counting and tracking
|
|
768
|
+
│ └── utils/ # Utility functions
|
|
583
769
|
├── test/ # Unit tests
|
|
584
770
|
├── ARCHITECTURE.md # Detailed architectural overview and flow diagrams
|
|
585
771
|
├── AGENTS.md # Project-specific AI rules and guidelines
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
import type { LanguageModelUsage, ToolExecuteFunction } from "ai";
|
|
2
|
-
import { type ToolCallRepairFunction } from "ai";
|
|
3
|
-
import type { MessageHistory } from "../messages.ts";
|
|
4
1
|
import type { ModelManager } from "../models/manager.ts";
|
|
5
2
|
import type { ModelMetadata } from "../models/providers.ts";
|
|
3
|
+
import type { SessionManager } from "../sessions/manager.ts";
|
|
6
4
|
import type { TokenTracker } from "../tokens/tracker.ts";
|
|
7
|
-
import type { CompleteToolSet } from "../tools/index.ts";
|
|
5
|
+
import type { CompleteToolNames, CompleteToolSet } from "../tools/index.ts";
|
|
8
6
|
type AgentOptions = {
|
|
9
7
|
modelManager: ModelManager;
|
|
10
8
|
tokenTracker: TokenTracker;
|
|
11
|
-
|
|
9
|
+
sessionManager: SessionManager;
|
|
12
10
|
maxIterations?: number;
|
|
13
11
|
maxRetries?: number;
|
|
14
|
-
toolCallRepair?: ToolCallRepairFunction<CompleteToolSet>;
|
|
15
12
|
};
|
|
16
13
|
type RunOptions = {
|
|
17
14
|
systemPrompt: string;
|
|
18
15
|
input: string;
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
tools: CompleteToolSet;
|
|
17
|
+
activeTools?: CompleteToolNames[];
|
|
21
18
|
abortSignal?: AbortSignal;
|
|
22
19
|
};
|
|
23
20
|
export type ToolEvent = {
|
|
@@ -26,12 +23,6 @@ export type ToolEvent = {
|
|
|
26
23
|
toolCallId: string;
|
|
27
24
|
msg: string;
|
|
28
25
|
args: unknown;
|
|
29
|
-
} | {
|
|
30
|
-
type: "tool-call-update";
|
|
31
|
-
name: string;
|
|
32
|
-
toolCallId: string;
|
|
33
|
-
msg: string;
|
|
34
|
-
args: unknown;
|
|
35
26
|
} | {
|
|
36
27
|
type: "tool-call-end";
|
|
37
28
|
name: string;
|
|
@@ -45,6 +36,11 @@ export type ToolEvent = {
|
|
|
45
36
|
msg: string;
|
|
46
37
|
args: unknown;
|
|
47
38
|
};
|
|
39
|
+
type ToolCallLifeCycle = {
|
|
40
|
+
type: "tool-call-lifecycle";
|
|
41
|
+
toolCallId: string;
|
|
42
|
+
events: ToolEvent[];
|
|
43
|
+
};
|
|
48
44
|
export type AgentEvent = {
|
|
49
45
|
type: "agent-start";
|
|
50
46
|
} | {
|
|
@@ -81,7 +77,23 @@ export type AgentEvent = {
|
|
|
81
77
|
type: "message-end";
|
|
82
78
|
role: "assistant";
|
|
83
79
|
content: string;
|
|
84
|
-
} |
|
|
80
|
+
} | ToolCallLifeCycle;
|
|
81
|
+
type ModelUsage = {
|
|
82
|
+
inputTokens: number;
|
|
83
|
+
outputTokens: number;
|
|
84
|
+
totalTokens: number;
|
|
85
|
+
cachedInputTokens: number;
|
|
86
|
+
reasoningTokens: number;
|
|
87
|
+
inputTokenDetails: {
|
|
88
|
+
noCacheTokens: number;
|
|
89
|
+
cacheReadTokens: number;
|
|
90
|
+
cacheWriteTokens: number;
|
|
91
|
+
};
|
|
92
|
+
outputTokenDetails: {
|
|
93
|
+
textTokens: number;
|
|
94
|
+
reasoningTokens: number;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
85
97
|
export type AgentState = {
|
|
86
98
|
modelId: string;
|
|
87
99
|
modelConfig: ModelMetadata;
|
|
@@ -93,12 +105,8 @@ export type AgentState = {
|
|
|
93
105
|
toolName: string;
|
|
94
106
|
}>;
|
|
95
107
|
}[];
|
|
96
|
-
usage:
|
|
97
|
-
|
|
98
|
-
};
|
|
99
|
-
totalUsage: {
|
|
100
|
-
[K in keyof LanguageModelUsage]-?: number;
|
|
101
|
-
};
|
|
108
|
+
usage: ModelUsage;
|
|
109
|
+
totalUsage: ModelUsage;
|
|
102
110
|
timestamps: {
|
|
103
111
|
start: number;
|
|
104
112
|
stop: number;
|
|
@@ -114,6 +122,7 @@ export declare class Agent {
|
|
|
114
122
|
run(args: RunOptions): AsyncGenerator<AgentEvent>;
|
|
115
123
|
abort(): void;
|
|
116
124
|
resetState(): AgentState;
|
|
125
|
+
private processToolEvent;
|
|
117
126
|
}
|
|
118
127
|
export {};
|
|
119
128
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/agent/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/agent/index.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EAEhB,MAAM,mBAAmB,CAAC;AAE3B,KAAK,YAAY,GAAG;IAClB,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,cAAc,EAAE,cAAc,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,eAAe,CAAC;IACvB,WAAW,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAClC,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,SAAS,GACjB;IACE,IAAI,EAAE,iBAAiB,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;CACf,GACD;IACE,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;CACf,GACD;IACE,IAAI,EAAE,iBAAiB,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAEN,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,qBAAqB,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,SAAS,EAAE,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,UAAU,GAElB;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,GACvB;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,GACtB;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAExC;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,GACtB;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GAErB;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACzC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAClD;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAC7D;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAE3D,iBAAiB,CAAC;AActB,KAAK,UAAU,GAAG;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE;QACjB,aAAa,EAAE,MAAM,CAAC;QACtB,eAAe,EAAE,MAAM,CAAC;QACxB,gBAAgB,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF,kBAAkB,EAAE;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,aAAa,CAAC;IAC3B,KAAK,EAAE;QACL,WAAW,EAAE,KAAK,CAAC;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QACzC,SAAS,EAAE,KAAK,CAAC;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACxC,EAAE,CAAC;IACJ,KAAK,EAAE,UAAU,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH,CAAC;AAEF,qBAAa,KAAK;IAChB,OAAO,CAAC,IAAI,CAAe;IAC3B,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,eAAe,CAAkB;gBAE7B,IAAI,EAAE,YAAY;IAM9B,IAAI,KAAK,eAER;IAED,IAAI,WAAW,gBAEd;IAEM,GAAG,CAAC,IAAI,EAAE,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC;IAqVxD,KAAK;IAML,UAAU;IAmDV,OAAO,CAAC,gBAAgB;CAyBzB"}
|