@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,5 +1,5 @@
|
|
|
1
1
|
import type { UserModelMessage } from "ai";
|
|
2
|
-
import { type UserMessageContentItem } from "../
|
|
2
|
+
import { type UserMessageContentItem } from "../sessions/manager.ts";
|
|
3
3
|
import type { TokenCounter } from "../tokens/counter.ts";
|
|
4
4
|
export type ContextItem = UserMessageContentItem;
|
|
5
5
|
export interface PromptManagerApi {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../source/prompts/manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAY,gBAAgB,EAAE,MAAM,IAAI,CAAC;AACrD,OAAO,
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../source/prompts/manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAY,gBAAgB,EAAE,MAAM,IAAI,CAAC;AACrD,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,MAAM,WAAW,GAAG,sBAAsB,CAAC;AAEjD,MAAM,WAAW,gBAAgB;IAC/B,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,GAAG,IAAI,MAAM,CAAC;IACd,cAAc,IAAI,gBAAgB,CAAC;IACnC,SAAS,IAAI,OAAO,CAAC;IACrB,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;IACpC,UAAU,IAAI,OAAO,CAAC;IACtB,YAAY,IAAI,IAAI,CAAC;IACrB,QAAQ,IAAI,IAAI,CAAC;IACjB,oBAAoB,IAAI,MAAM,CAAC;CAChC;AAED,qBAAa,aAAc,YAAW,gBAAgB;IACpD,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,YAAY,CAAe;gBAEvB,YAAY,EAAE,YAAY;IAMtC,GAAG,CAAC,MAAM,EAAE,MAAM;IAIlB,GAAG;IAQH,cAAc,IAAI,gBAAgB;IAmBlC,OAAO,CAAC,8BAA8B;IAoBtC,SAAS;IAIT,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAInC,UAAU;IAIV,YAAY;IAIZ,QAAQ;IAKR,oBAAoB,IAAI,MAAM;CAY/B"}
|
package/dist/prompts/manager.js
CHANGED
package/dist/prompts.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { CompleteToolNames } from "./tools/index.ts";
|
|
2
|
+
type SystemPromptOptions = {
|
|
3
|
+
allowedDirs?: string[];
|
|
4
|
+
activeTools?: CompleteToolNames[];
|
|
3
5
|
includeRules?: boolean;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
skillsEnabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare function systemPrompt(options?: SystemPromptOptions): Promise<string>;
|
|
9
|
+
export {};
|
|
6
10
|
//# sourceMappingURL=prompts.d.ts.map
|
package/dist/prompts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../source/prompts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../source/prompts.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAwD1D,KAAK,mBAAmB,GAAG;IACzB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAClC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAIF,wBAAsB,YAAY,CAAC,OAAO,CAAC,EAAE,mBAAmB,mBAmJ/D"}
|
package/dist/prompts.js
CHANGED
|
@@ -1,147 +1,35 @@
|
|
|
1
|
-
import { execSync } from "node:child_process";
|
|
2
|
-
import { readFile } from "node:fs/promises";
|
|
3
1
|
import { platform } from "node:os";
|
|
4
|
-
import path from "node:path";
|
|
5
2
|
import { config } from "./config.js";
|
|
6
3
|
import { dedent } from "./dedent.js";
|
|
4
|
+
import { formatSkillsForPrompt, loadSkills } from "./skills.js";
|
|
7
5
|
import { getShell } from "./terminal/index.js";
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import { GrepTool } from "./tools/grep.js";
|
|
16
|
-
import { ReadFileTool } from "./tools/read-file.js";
|
|
17
|
-
import { ReadMultipleFilesTool } from "./tools/read-multiple-files.js";
|
|
18
|
-
import { SaveFileTool } from "./tools/save-file.js";
|
|
19
|
-
import { ThinkTool } from "./tools/think.js";
|
|
20
|
-
import { WebFetchTool } from "./tools/web-fetch.js";
|
|
21
|
-
import { WebSearchTool } from "./tools/web-search.js";
|
|
22
|
-
function intro() {
|
|
23
|
-
return "You are acai, an AI-powered CLI assistant that accelerates software engineering workflows through intelligent command-line assistance.";
|
|
24
|
-
}
|
|
25
|
-
async function instructions() {
|
|
26
|
-
const systemMdPath = path.join(config.project.getPath(), "system.md");
|
|
27
|
-
try {
|
|
28
|
-
const content = await readFile(systemMdPath, "utf8");
|
|
29
|
-
if (content.trim()) {
|
|
30
|
-
return content;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
catch {
|
|
34
|
-
// system.md doesn't exist or is empty, use default instructions
|
|
35
|
-
}
|
|
36
|
-
return `## Core Principles
|
|
37
|
-
|
|
38
|
-
- **CLI-Optimized**: Be concise and direct - responses appear in a terminal. Be extremely concise. Sacrifice grammar for the sake of concision.
|
|
39
|
-
- **Progressive Problem Solving**: Work through problems methodically until resolution.
|
|
40
|
-
- **User Authority**: NEVER commit changes or add dependencies without explicit user approval.
|
|
41
|
-
- **Security-First**: Prioritize secure coding practices in all suggestions.
|
|
42
|
-
- **Completion Focus**: Continue working until the user's query is completely resolved.
|
|
43
|
-
- **Expert Level**: Assume the user is an experienced software engineer.
|
|
44
|
-
|
|
45
|
-
## Response Format
|
|
46
|
-
|
|
47
|
-
- **Direct Answers**: One-word or concise answers when possible.
|
|
48
|
-
- **Code First**: Lead with code snippets for code-related queries.
|
|
49
|
-
- **No Fluff**: Avoid preambles or phrases like "Here is the content..."
|
|
50
|
-
- **Error Reporting**: Specify error, location, and fix (e.g., \`Error: TypeError at auth.ts:42. Fix: Add null check.\`).
|
|
51
|
-
|
|
52
|
-
## Work Standards
|
|
53
|
-
|
|
54
|
-
### Code Quality
|
|
55
|
-
- Match existing code conventions and patterns
|
|
56
|
-
- Use libraries/utilities already in the project
|
|
57
|
-
- Prioritize maintainable, readable code over clever solutions
|
|
58
|
-
|
|
59
|
-
### Security & Error Handling
|
|
60
|
-
- Validate/sanitize all inputs and outputs
|
|
61
|
-
- Use parameterized queries for databases
|
|
62
|
-
- Never hardcode secrets; prevent injection attacks, XSS, unauthorized access
|
|
63
|
-
- Apply principle of least privilege in API integrations
|
|
64
|
-
- If a tool fails, ask the user how to proceed
|
|
65
|
-
- Report errors with specific locations and suggested fixes`;
|
|
66
|
-
}
|
|
67
|
-
function toolUsage() {
|
|
68
|
-
return `## Tool Usage Guidelines
|
|
69
|
-
|
|
70
|
-
### Information Gathering
|
|
71
|
-
- Prefer targeted queries: use \`${GrepTool.name}\` for code pattern searches and \`${ReadMultipleFilesTool.name}\` to fetch files. Avoid full directory dumps for large repositories.
|
|
72
|
-
- Use \`${ReadFileTool.name}\` or \`${ReadMultipleFilesTool.name}\` for file contents if filenames are provided in the prompt
|
|
73
|
-
- Use \`${GrepTool.name}\` for code pattern searches
|
|
74
|
-
- Use \`${WebFetchTool.name}\` for text-based URLs provided in the prompt
|
|
75
|
-
- Use \`${WebSearchTool.name}\` for external research (e.g., libraries, errors)
|
|
76
|
-
- Use \`${AgentTool.name}\` for iterative keyword/file searches. Use this if you need to explore the project to find what you are looking for.
|
|
77
|
-
- Use \`${DirectoryTreeTool.name}\` if you need a high-level overview of the project.
|
|
78
|
-
- If file contents or URLs are provided in the prompt, use them directly without re-fetching
|
|
79
|
-
- Always verify file contents before suggesting changes unless provided in the prompt
|
|
80
|
-
|
|
81
|
-
### Code Modification
|
|
82
|
-
- Use \`${EditFileTool.name}\` to edit existing files
|
|
83
|
-
- Use \`${SaveFileTool.name}\` to create new files only
|
|
84
|
-
- Use \`${DeleteFileTool.name}\` to delete files
|
|
85
|
-
|
|
86
|
-
### Planning & Complex Tasks
|
|
87
|
-
- Use \`${ThinkTool.name}\` for structured reasoning on complex problems
|
|
88
|
-
- Outline multi-step tasks before execution
|
|
89
|
-
|
|
90
|
-
### Bash Commands (\`${BashTool.name}\`)
|
|
91
|
-
- Execute commands with a sandboxed executor that supports pipes (|), conditional chaining (&&, ||, ;), and redirection (> >> < 2> 2>>).
|
|
92
|
-
- Run single commands or compose multi-step flows using shell operators.
|
|
93
|
-
- For extremely large gh/git messages:
|
|
94
|
-
1. Create temp file with ${SaveFileTool.name} in the project's .tmp directory
|
|
95
|
-
2. Use git commit --file path/to/temp/file or gh pr create --title "Title of PR" --body-file path/to/temp/file
|
|
96
|
-
- Note: The .tmp directory in the current working directory is deleted each time the agent shuts down.
|
|
97
|
-
- Commands execute only within the project directory; always use absolute paths.
|
|
98
|
-
- Avoid interactive commands; prefer non-interactive flags (e.g., npm init -y).
|
|
99
|
-
|
|
100
|
-
#### Additional Installed Tools
|
|
101
|
-
|
|
102
|
-
${getInstalledTools()}
|
|
103
|
-
|
|
104
|
-
### Code Interpreter (\`${CodeInterpreterTool.name}\`)
|
|
105
|
-
- Executes JavaScript code in a separate Node.js process using Node's Permission Model
|
|
106
|
-
- By default, the child process has no permissions except read/write within the current working directory
|
|
107
|
-
- Returns stdout, stderr, and exitCode
|
|
108
|
-
- Use console.log/console.error to produce output
|
|
109
|
-
|
|
110
|
-
### Git Workflow
|
|
111
|
-
- Always stage changes before attempting to commit them
|
|
112
|
-
- Never amend git commits without approval from the user
|
|
113
|
-
- Never use \`git add -A\` when preparing for multiple, distinct commits; instead, selectively add files or hunks relevant to each commit
|
|
114
|
-
- Always use \`git checkout -b <branch-name>\` with a branch name that accurately reflects the *type* of changes being made
|
|
115
|
-
- Never stage changes for files that are specified in \`.gitignore\`
|
|
116
|
-
- Always stage changes after running a formatter that modifies files, before attempting to commit
|
|
117
|
-
|
|
118
|
-
### Efficiency Guidelines
|
|
119
|
-
- Always use the most efficient workflow to complete tasks
|
|
120
|
-
- Never re-read file content that has already been provided in the current turn or is directly accessible via a tool; instead, reuse the provided content or reference the file path directly
|
|
121
|
-
- Always use direct file paths or established methods to pass content to tools that accept file input, rather than re-creating content in command strings
|
|
122
|
-
- Always run a build after making code changes to verify correctness`;
|
|
123
|
-
}
|
|
124
|
-
function escalationProcedures() {
|
|
125
|
-
return `## Escalation
|
|
126
|
-
|
|
127
|
-
- If stuck, state the limitation, suggest alternatives, and ask the user for guidance`;
|
|
128
|
-
}
|
|
129
|
-
async function getRules() {
|
|
130
|
-
const rules = (await config.readAgentsFile()).trim();
|
|
6
|
+
import { getCurrentBranch, inGitDirectory } from "./utils/git.js";
|
|
7
|
+
async function getProjectContext() {
|
|
8
|
+
const agentsFiles = await config.readAgentsFiles();
|
|
9
|
+
const userAgentsFile = agentsFiles.find((f) => f.path === "~/.acai/AGENTS.md");
|
|
10
|
+
const cwdAgentsFile = agentsFiles.find((f) => f.path === "./AGENTS.md");
|
|
11
|
+
const userRules = (userAgentsFile?.content ?? "").trim();
|
|
12
|
+
const cwdRules = (cwdAgentsFile?.content ?? "").trim();
|
|
131
13
|
const learnedRules = (await config.readProjectLearnedRulesFile()).trim();
|
|
132
14
|
let result = "";
|
|
133
|
-
if (
|
|
134
|
-
result +=
|
|
15
|
+
if (userRules || cwdRules) {
|
|
16
|
+
result += "## Project Context:\n\n";
|
|
17
|
+
if (userRules) {
|
|
18
|
+
result += `### ~/.acai/AGENTS.md\n\n<instructions>\n${userRules}\n</instructions>\n\n`;
|
|
19
|
+
}
|
|
20
|
+
if (cwdRules) {
|
|
21
|
+
result += `### ./AGENTS.md\n\n<instructions>\n${cwdRules}\n</instructions>\n\n`;
|
|
22
|
+
}
|
|
135
23
|
}
|
|
136
24
|
if (learnedRules) {
|
|
137
|
-
if (!
|
|
25
|
+
if (!userRules && !cwdRules) {
|
|
138
26
|
result += "## Project Rules:\n\n";
|
|
139
27
|
}
|
|
140
28
|
result += `### Important rules to follow\n\n${learnedRules}`;
|
|
141
29
|
}
|
|
142
30
|
return result.trim();
|
|
143
31
|
}
|
|
144
|
-
async function environmentInfo() {
|
|
32
|
+
async function environmentInfo(allowedDirs) {
|
|
145
33
|
const gitDirectory = await inGitDirectory();
|
|
146
34
|
let gitSection = `- **Is directory a git repo**: ${gitDirectory ? "Yes" : "No"}`;
|
|
147
35
|
if (gitDirectory) {
|
|
@@ -149,67 +37,157 @@ async function environmentInfo() {
|
|
|
149
37
|
}
|
|
150
38
|
return `## Environment
|
|
151
39
|
|
|
152
|
-
|
|
40
|
+
### Allowed directories:
|
|
41
|
+
|
|
42
|
+
${allowedDirs.map((dir) => `- ${dir}`).join("\n")}
|
|
43
|
+
|
|
44
|
+
### Information:
|
|
45
|
+
|
|
153
46
|
${gitSection}
|
|
154
47
|
- **Platform**: ${platform()}
|
|
155
48
|
- **Shell**: ${getShell()}
|
|
156
|
-
- **Today's date**: ${
|
|
49
|
+
- **Today's date**: ${new Date().toISOString().split("T")[0]}
|
|
50
|
+
|
|
157
51
|
- Note: The .tmp directory in the current working directory is deleted each time the agent shuts down.`;
|
|
158
52
|
}
|
|
53
|
+
const DEFAULT_ALLOWED_DIRS = [process.cwd()];
|
|
159
54
|
export async function systemPrompt(options) {
|
|
160
|
-
const {
|
|
55
|
+
const { allowedDirs = DEFAULT_ALLOWED_DIRS, includeRules = true, skillsEnabled = true, } = options ?? {};
|
|
56
|
+
const projectContextText = includeRules ? await getProjectContext() : "";
|
|
57
|
+
const environmentInfoText = await environmentInfo(allowedDirs);
|
|
58
|
+
let skillsText = "";
|
|
59
|
+
if (skillsEnabled) {
|
|
60
|
+
const skills = await loadSkills();
|
|
61
|
+
skillsText = formatSkillsForPrompt(skills);
|
|
62
|
+
}
|
|
161
63
|
const prompt = dedent `
|
|
162
|
-
|
|
64
|
+
You are acai. You are running as a coding agent in a CLI on the user's computer.
|
|
163
65
|
|
|
164
|
-
|
|
66
|
+
## Core Principles
|
|
165
67
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
68
|
+
- **CLI-Optimized**: Be concise and direct - responses appear in a terminal. Be extremely concise. Sacrifice grammar for the sake of concision.
|
|
69
|
+
- **Progressive Problem Solving**: Work through problems methodically until resolution.
|
|
70
|
+
- **User Authority**: NEVER commit changes or add dependencies without explicit user approval.
|
|
71
|
+
- **Security-First**: Prioritize secure coding practices in all suggestions.
|
|
72
|
+
- **Completion Focus**: Continue working until the user's query is completely resolved.
|
|
73
|
+
- **Expert Level**: Assume the user is an experienced software engineer.
|
|
74
|
+
- **Be Efficient**: When multiple tool calls can be parallelized, make these tool calls in parallel instead of sequential. Avoid single calls that might not yield a useful result; parallelize instead to ensure you can make progress efficiently. Always use the most efficient workflow to complete tasks
|
|
75
|
+
- **Default expectation**: Deliver working code, not just a plan. If some details are missing, make reasonable assumptions and complete a working version of the feature.
|
|
76
|
+
|
|
77
|
+
## Autonomy and Persistence
|
|
78
|
+
|
|
79
|
+
- You are autonomous senior engineer: once the user gives a direction, proactively gather context, plan, implement, test, and refine without waiting for additional prompts at each step.
|
|
80
|
+
- Persist until the task is fully handled end-to-end within the current turn whenever feasible: do not stop at analysis or partial fixes; carry changes through implementation, verification, and a clear explanation of outcomes unless the user explicitly pauses or redirects you.
|
|
81
|
+
- Bias to action: default to implementing with reasonable assumptions; do not end your turn with clarifications unless truly blocked.
|
|
82
|
+
- Avoid excessive looping or repetition; if you find yourself re-reading or re-editing the same files without clear progress, stop and end the turn with a concise summary and any clarifying questions needed.
|
|
83
|
+
|
|
84
|
+
## Exploration and reading files
|
|
85
|
+
|
|
86
|
+
- **Think first.** Before any tool call, decide ALL files/resources you will need.
|
|
87
|
+
- **Batch everything.** If you need multiple files (even from different places), read them together.
|
|
88
|
+
- **Only make sequential calls if you truly cannot know the next file without seeing a result first.**
|
|
89
|
+
- **Workflow:** (a) plan all needed reads → (b) issue one parallel batch → (c) analyze results → (d) repeat if new, unpredictable reads arise.
|
|
90
|
+
- Additional notes:
|
|
91
|
+
- Always maximize parallelism. Never read files one-by-one unless logically unavoidable.
|
|
92
|
+
- This concerns every read/list/search operations including, but not only, \`cat\`, \`rg\`, \`sed\`, \`ls\`, \`git show\`, \`nl\`, \`wc\`, ...
|
|
93
|
+
|
|
94
|
+
## Presenting your work and final message
|
|
95
|
+
|
|
96
|
+
You are producing plain text that will later be styled by the CLI. Follow these rules exactly. Formatting should make results easy to scan, but not feel mechanical. Use judgment to decide how much structure adds value.
|
|
97
|
+
- Default: be very concise; friendly coding teammate tone.
|
|
98
|
+
- Format: Use natural language with high-level headings.
|
|
99
|
+
- Ask only when needed; suggest ideas; mirror the user's style.
|
|
100
|
+
- For substantial work, summarize clearly; follow final‑answer formatting.
|
|
101
|
+
- Skip heavy formatting for simple confirmations.
|
|
102
|
+
- Don't dump large files you've written; reference paths only.
|
|
103
|
+
- No "save/copy this file" - User is on the same machine.
|
|
104
|
+
- Offer logical next steps (tests, commits, build) briefly; add verify steps if you couldn't do something.
|
|
105
|
+
- For code changes:
|
|
106
|
+
* Lead with a quick explanation of the change, and then give more details on the context covering where and why a change was made. Do not start this explanation with "summary", just jump right in.
|
|
107
|
+
* If there are natural next steps the user may want to take, suggest them at the end of your response. Do not make suggestions if there are no natural next steps.
|
|
108
|
+
* When suggesting multiple options, use numeric lists for the suggestions so the user can quickly respond with a single number.
|
|
109
|
+
- The user does not command execution outputs. When asked to show the output of a command (e.g. \`git show\`), relay the important details in your answer or summarize the key lines so the user understands the result.
|
|
110
|
+
|
|
111
|
+
### Final answer structure and style guidelines
|
|
112
|
+
|
|
113
|
+
- Plain text; CLI handles styling. Use structure only when it helps scanability.
|
|
114
|
+
- Headers: optional; short Title Case (1-3 words) wrapped in **…**; no blank line before the first bullet; add only if they truly help.
|
|
115
|
+
- Bullets: use - ; merge related points; keep to one line when possible; 4–6 per list ordered by importance; keep phrasing consistent.
|
|
116
|
+
- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **.
|
|
117
|
+
- Code samples or multi-line snippets should be wrapped in fenced code blocks; include an info string as often as possible.
|
|
118
|
+
- Structure: group related bullets; order sections general → specific → supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task.
|
|
119
|
+
- Tone: collaborative, concise, factual; present tense, active voice; self‑contained; no "above/below"; parallel wording.
|
|
120
|
+
- Don'ts: no nested bullets/hierarchies; no ANSI codes; don't cram unrelated keywords; keep keyword lists short—wrap/reformat if long; avoid naming formatting styles in answers.
|
|
121
|
+
- Adaptation: code explanations → precise, structured with code refs; simple tasks → lead with outcome; big changes → logical walkthrough + rationale + next actions; casual one-offs → plain sentences, no headers/bullets.
|
|
122
|
+
- File References: When referencing files in your response follow the below rules:
|
|
123
|
+
* Use inline code to make file paths clickable.
|
|
124
|
+
* Each reference should have a stand alone path. Even if it's the same file.
|
|
125
|
+
* Accepted: absolute, workspace‑relative, a/ or b/ diff prefixes, or bare filename/suffix.
|
|
126
|
+
* Optionally include line/column (1‑based): :line[:column] or #Lline[Ccolumn] (column defaults to 1).
|
|
127
|
+
* Do not use URIs like file://, vscode://, or https://.
|
|
128
|
+
* Do not provide range of lines
|
|
129
|
+
* Examples: src/app.ts, src/app.ts:42, b/server/index.js#L10, C:\\repo\\project\\main.rs:12:5
|
|
130
|
+
|
|
131
|
+
## Tool Calling
|
|
132
|
+
|
|
133
|
+
<tool_calling>
|
|
134
|
+
1. Use only provided tools; follow their schemas exactly.
|
|
135
|
+
2. Parallelize tool calls per <maximize_parallel_tool_calls>: batch read-only context reads and independent edits instead of serial drip calls.
|
|
136
|
+
3. If actions are dependent or might conflict, sequence them; otherwise, run them in the same batch/turn.
|
|
137
|
+
4. Don't mention tool names to the user; describe actions naturally.
|
|
138
|
+
5. If info is discoverable via tools, prefer that over asking the user.
|
|
139
|
+
6. Read multiple files as needed; don't guess.
|
|
140
|
+
7. Give a brief progress note before the first tool call each turn; add another before any new batch and before ending your turn.
|
|
141
|
+
8. After any substantive code edit or schema change, run tests/build; fix failures before proceeding or marking tasks complete.
|
|
142
|
+
9. Before closing the goal, ensure a green test/build run.
|
|
143
|
+
</tool_calling>
|
|
144
|
+
|
|
145
|
+
<context_understanding>
|
|
146
|
+
Grep search (grep and ripgrep) is your MAIN exploration tool.
|
|
147
|
+
- CRITICAL: Start with a broad set of queries that capture keywords based on the USER's request and provided context.
|
|
148
|
+
- MANDATORY: Run multiple Grep searches in parallel with different patterns and variations; exact matches often miss related code.
|
|
149
|
+
- Keep searching new areas until you're CONFIDENT nothing important remains.
|
|
150
|
+
- When you have found some relevant code, narrow your search and read the most likely important files.
|
|
151
|
+
If you've performed an edit that may partially fulfill the USER's query, but you're not confident, gather more information or use more tools before ending your turn.
|
|
152
|
+
Bias towards not asking the user for help if you can find the answer yourself.
|
|
153
|
+
</context_understanding>
|
|
154
|
+
|
|
155
|
+
<maximize_parallel_tool_calls>
|
|
156
|
+
CRITICAL INSTRUCTION: For maximum efficiency, whenever you perform multiple operations, invoke all relevant tools concurrently rather than sequentially. Prioritize calling tools in parallel whenever possible. For example, when reading 3 files, run 3 tool calls in parallel to read all 3 files into context at the same time. When running multiple read-only commands, always run all of the commands in parallel. Err on the side of maximizing parallel tool calls rather than running too many tools sequentially.
|
|
157
|
+
|
|
158
|
+
When gathering information about a topic, plan your searches upfront in your thinking and then execute all tool calls together. For instance, all of these cases SHOULD use parallel tool calls:
|
|
159
|
+
|
|
160
|
+
- Searching for different patterns (imports, usage, definitions) should happen in parallel
|
|
161
|
+
- Multiple grep searches with different regex patterns should run simultaneously
|
|
162
|
+
- Reading multiple files or searching different directories can be done all at once
|
|
163
|
+
- Combining Glob with Grep for comprehensive results
|
|
164
|
+
- Any information gathering where you know upfront what you're looking for
|
|
165
|
+
|
|
166
|
+
And you should use parallel tool calls in many more cases beyond those listed above.
|
|
167
|
+
|
|
168
|
+
Before making tool calls, briefly consider: What information do I need to fully answer this question? Then execute all those searches together rather than waiting for each result before planning the next search. Most of the time, parallel tool calls can be used rather than sequential. Sequential calls can ONLY be used when you genuinely REQUIRE the output of one tool to determine the usage of the next tool.
|
|
169
|
+
|
|
170
|
+
DEFAULT TO PARALLEL: Unless you have a specific reason why operations MUST be sequential (output of A required for input of B), always execute multiple tools simultaneously. This is not just an optimization - it's the expected behavior. Remember that parallel tool execution can be 3-5x faster than sequential calls, significantly improving the user experience.
|
|
171
|
+
</maximize_parallel_tool_calls>
|
|
169
172
|
|
|
170
|
-
|
|
173
|
+
## Work Standards
|
|
171
174
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
export async function minSystemPrompt() {
|
|
177
|
-
const prompt = dedent `
|
|
178
|
-
${intro()}
|
|
175
|
+
### Code Quality
|
|
176
|
+
- Match existing code conventions and patterns
|
|
177
|
+
- Use libraries/utilities already in the project
|
|
178
|
+
- Prioritize maintainable, readable code over clever solutions
|
|
179
179
|
|
|
180
|
-
|
|
180
|
+
### Security & Error Handling
|
|
181
|
+
- Validate/sanitize all inputs and outputs
|
|
182
|
+
- Use parameterized queries for databases
|
|
183
|
+
- Never hardcode secrets; prevent injection attacks, XSS, unauthorized access
|
|
184
|
+
- Apply principle of least privilege in API integrations
|
|
185
|
+
- If a tool fails, ask the user how to proceed
|
|
186
|
+
- Report errors with specific locations and suggested fixes
|
|
181
187
|
|
|
182
|
-
${
|
|
188
|
+
${projectContextText}
|
|
183
189
|
|
|
184
|
-
${
|
|
190
|
+
${environmentInfoText}${skillsText}
|
|
185
191
|
`;
|
|
186
192
|
return prompt;
|
|
187
193
|
}
|
|
188
|
-
function getInstalledTools() {
|
|
189
|
-
// Check for required bash tools
|
|
190
|
-
const tools = [
|
|
191
|
-
{ name: "git", command: "git --version" },
|
|
192
|
-
{ name: "gh", command: "gh --version" },
|
|
193
|
-
{ name: "rg", command: "rg --version" },
|
|
194
|
-
{ name: "fd", command: "fd --version" },
|
|
195
|
-
{ name: "ast-grep", command: "ast-grep --version" },
|
|
196
|
-
{ name: "jq", command: "jq --version" },
|
|
197
|
-
{ name: "yq", command: "yq --version" },
|
|
198
|
-
];
|
|
199
|
-
const toolStatus = tools
|
|
200
|
-
.map((tool) => {
|
|
201
|
-
let status = false;
|
|
202
|
-
try {
|
|
203
|
-
execSync(tool.command, { stdio: "ignore", timeout: 5000 });
|
|
204
|
-
status = true;
|
|
205
|
-
}
|
|
206
|
-
catch (_error) {
|
|
207
|
-
// Ignore error, tool is not installed
|
|
208
|
-
}
|
|
209
|
-
return [tool.name, status];
|
|
210
|
-
})
|
|
211
|
-
.filter((tool) => tool[1])
|
|
212
|
-
.map((tool) => tool[0])
|
|
213
|
-
.join("\n");
|
|
214
|
-
return toolStatus;
|
|
215
|
-
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface ProjectStatusData {
|
|
2
|
+
path: string;
|
|
3
|
+
isGitRepository: boolean;
|
|
4
|
+
branch?: string;
|
|
5
|
+
hasChanges: boolean;
|
|
6
|
+
fileChanges: {
|
|
7
|
+
added: number;
|
|
8
|
+
modified: number;
|
|
9
|
+
deleted: number;
|
|
10
|
+
untracked: number;
|
|
11
|
+
};
|
|
12
|
+
diffStats: {
|
|
13
|
+
insertions: number;
|
|
14
|
+
deletions: number;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export declare function getProjectStatus(): Promise<ProjectStatusData>;
|
|
18
|
+
export declare function clearProjectStatusCache(): void;
|
|
19
|
+
//# sourceMappingURL=project-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-status.d.ts","sourceRoot":"","sources":["../../source/repl/project-status.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,OAAO,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE;QACX,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,SAAS,EAAE;QACT,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAqFD,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAEnE;AAID,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { getCurrentBranch, getDiffStat, getGitStatus, inGitDirectory, } from "../utils/git.js";
|
|
2
|
+
// Cache for project status to prevent excessive Git operations
|
|
3
|
+
class ProjectStatus {
|
|
4
|
+
cachedStatus = null;
|
|
5
|
+
cacheTime = 0;
|
|
6
|
+
cacheTtl = 2000; // 2 seconds
|
|
7
|
+
async get() {
|
|
8
|
+
const now = Date.now();
|
|
9
|
+
// Return cached status if it's still valid
|
|
10
|
+
if (this.cachedStatus && now - this.cacheTime < this.cacheTtl) {
|
|
11
|
+
return this.cachedStatus;
|
|
12
|
+
}
|
|
13
|
+
// const currentDir = process.cwd().split("/").pop() || process.cwd();
|
|
14
|
+
let pwd = process.cwd();
|
|
15
|
+
const home = process.env["HOME"] || process.env["USERPROFILE"];
|
|
16
|
+
if (home && pwd.startsWith(home)) {
|
|
17
|
+
pwd = `~${pwd.slice(home.length)}`;
|
|
18
|
+
}
|
|
19
|
+
const currentDir = pwd;
|
|
20
|
+
let status = {
|
|
21
|
+
path: currentDir,
|
|
22
|
+
isGitRepository: false,
|
|
23
|
+
fileChanges: {
|
|
24
|
+
added: 0,
|
|
25
|
+
modified: 0,
|
|
26
|
+
deleted: 0,
|
|
27
|
+
untracked: 0,
|
|
28
|
+
},
|
|
29
|
+
diffStats: {
|
|
30
|
+
insertions: 0,
|
|
31
|
+
deletions: 0,
|
|
32
|
+
},
|
|
33
|
+
hasChanges: false,
|
|
34
|
+
};
|
|
35
|
+
if (await inGitDirectory()) {
|
|
36
|
+
// Generate fresh status
|
|
37
|
+
const branch = await getCurrentBranch();
|
|
38
|
+
const fileChanges = await getGitStatus();
|
|
39
|
+
const hasChanges = fileChanges.added > 0 ||
|
|
40
|
+
fileChanges.deleted > 0 ||
|
|
41
|
+
fileChanges.modified > 0;
|
|
42
|
+
const stats = await getDiffStat();
|
|
43
|
+
status = {
|
|
44
|
+
path: currentDir,
|
|
45
|
+
isGitRepository: true,
|
|
46
|
+
branch: branch ?? undefined,
|
|
47
|
+
hasChanges,
|
|
48
|
+
fileChanges: {
|
|
49
|
+
added: fileChanges.added,
|
|
50
|
+
modified: fileChanges.modified,
|
|
51
|
+
deleted: fileChanges.deleted,
|
|
52
|
+
untracked: fileChanges.untracked,
|
|
53
|
+
},
|
|
54
|
+
diffStats: {
|
|
55
|
+
insertions: stats.insertions,
|
|
56
|
+
deletions: stats.deletions,
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
this.cachedStatus = status;
|
|
61
|
+
this.cacheTime = now;
|
|
62
|
+
return this.cachedStatus;
|
|
63
|
+
}
|
|
64
|
+
// Clear cache (call this when you know the status has changed)
|
|
65
|
+
clear() {
|
|
66
|
+
this.cachedStatus = null;
|
|
67
|
+
this.cacheTime = 0;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
const projectStatus = new ProjectStatus();
|
|
71
|
+
export async function getProjectStatus() {
|
|
72
|
+
return await projectStatus.get();
|
|
73
|
+
}
|
|
74
|
+
// Export clear function for cases where we know the status changed
|
|
75
|
+
// (e.g., after file operations, git operations)
|
|
76
|
+
export function clearProjectStatusCache() {
|
|
77
|
+
projectStatus.clear();
|
|
78
|
+
}
|
package/dist/repl-new.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import type { Agent, AgentEvent, AgentState } from "./agent/index.ts";
|
|
2
2
|
import type { CommandManager } from "./commands/manager.ts";
|
|
3
3
|
import type { WorkspaceContext } from "./index.ts";
|
|
4
|
-
import type { MessageHistory } from "./messages.ts";
|
|
5
4
|
import type { ModelManager } from "./models/manager.ts";
|
|
6
5
|
import type { PromptManager } from "./prompts/manager.ts";
|
|
7
|
-
import type {
|
|
6
|
+
import type { SessionManager } from "./sessions/manager.ts";
|
|
8
7
|
import type { TokenCounter } from "./tokens/counter.ts";
|
|
9
8
|
import type { TokenTracker } from "./tokens/tracker.ts";
|
|
9
|
+
import type { CompleteToolSet } from "./tools/index.ts";
|
|
10
10
|
interface ReplOptions {
|
|
11
11
|
agent: Agent;
|
|
12
|
-
messageHistory:
|
|
12
|
+
messageHistory: SessionManager;
|
|
13
13
|
promptManager: PromptManager;
|
|
14
14
|
modelManager: ModelManager;
|
|
15
15
|
tokenTracker: TokenTracker;
|
|
16
|
-
terminal: Terminal;
|
|
17
16
|
commands: CommandManager;
|
|
18
17
|
config: Record<PropertyKey, unknown>;
|
|
19
18
|
tokenCounter: TokenCounter;
|
|
20
19
|
promptHistory: string[];
|
|
21
20
|
workspace: WorkspaceContext;
|
|
21
|
+
tools?: CompleteToolSet;
|
|
22
22
|
}
|
|
23
23
|
export declare class NewRepl {
|
|
24
24
|
private options;
|
|
@@ -27,15 +27,18 @@ export declare class NewRepl {
|
|
|
27
27
|
private editor;
|
|
28
28
|
private chatContainer;
|
|
29
29
|
private statusContainer;
|
|
30
|
-
private promptStatus;
|
|
31
30
|
private footer;
|
|
32
31
|
private editorContainer;
|
|
32
|
+
private notification;
|
|
33
33
|
private isInitialized;
|
|
34
34
|
private onInputCallback?;
|
|
35
35
|
private loadingAnimation;
|
|
36
36
|
private onInterruptCallback?;
|
|
37
|
+
private onExitCallback?;
|
|
37
38
|
private lastSigintTime;
|
|
39
|
+
private exitNotificationTimer?;
|
|
38
40
|
private pendingTools;
|
|
41
|
+
private tools?;
|
|
39
42
|
private streamingComponent;
|
|
40
43
|
private thinkingBlockComponent;
|
|
41
44
|
constructor(options: ReplOptions);
|
|
@@ -45,9 +48,15 @@ export declare class NewRepl {
|
|
|
45
48
|
getUserInput(): Promise<string>;
|
|
46
49
|
clearEditor(): void;
|
|
47
50
|
setInterruptCallback(callback: () => void): void;
|
|
51
|
+
setExitCallback(callback: (sessionId: string) => void): void;
|
|
48
52
|
rerender(): Promise<void>;
|
|
53
|
+
private reconstructSession;
|
|
54
|
+
private extractUserMessageText;
|
|
55
|
+
private renderAssistantMessage;
|
|
56
|
+
private extractToolCallsFromAssistant;
|
|
57
|
+
private createToolEvents;
|
|
49
58
|
private handleCtrlC;
|
|
50
|
-
stop(): void;
|
|
59
|
+
stop(showExitMessage?: boolean): void;
|
|
51
60
|
}
|
|
52
61
|
export {};
|
|
53
62
|
//# sourceMappingURL=repl-new.d.ts.map
|
package/dist/repl-new.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repl-new.d.ts","sourceRoot":"","sources":["../source/repl-new.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"repl-new.d.ts","sourceRoot":"","sources":["../source/repl-new.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,UAAU,EACV,UAAU,EAEX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAK1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAkBxD,UAAU,WAAW;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,cAAc,EAAE,cAAc,CAAC;IAC/B,aAAa,EAAE,aAAa,CAAC;IAC7B,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,QAAQ,EAAE,cAAc,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACrC,YAAY,EAAE,YAAY,CAAC;IAC3B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB;AAED,qBAAa,OAAO;IAClB,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,GAAG,CAAM;IACjB,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,aAAa,CAAY;IACjC,OAAO,CAAC,eAAe,CAAY;IACnC,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,eAAe,CAAY;IACnC,OAAO,CAAC,YAAY,CAAwB;IAC5C,OAAO,CAAC,aAAa,CAAU;IAC/B,OAAO,CAAC,eAAe,CAAC,CAAyB;IACjD,OAAO,CAAC,gBAAgB,CAAuB;IAC/C,OAAO,CAAC,mBAAmB,CAAC,CAAa;IACzC,OAAO,CAAC,cAAc,CAAC,CAA8B;IACrD,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,qBAAqB,CAAC,CAAiB;IAC/C,OAAO,CAAC,YAAY,CAAsC;IAC1D,OAAO,CAAC,KAAK,CAAC,CAAkB;IAGhC,OAAO,CAAC,kBAAkB,CAA0C;IAGpE,OAAO,CAAC,sBAAsB,CAAuC;gBAEzD,OAAO,EAAE,WAAW;IAoC1B,IAAI;IAoJJ,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU;IAqKjD,OAAO,CAAC,gBAAgB;IAWlB,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC;IASrC,WAAW,IAAI,IAAI;IAKnB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAIhD,eAAe,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI;IAItD,QAAQ;IAed,OAAO,CAAC,kBAAkB;IA6E1B,OAAO,CAAC,sBAAsB;IAsB9B,OAAO,CAAC,sBAAsB;IAmC9B,OAAO,CAAC,6BAA6B;IAwDrC,OAAO,CAAC,gBAAgB;IAwCxB,OAAO,CAAC,WAAW;IAwCnB,IAAI,CAAC,eAAe,UAAQ,GAAG,IAAI;CAoBpC"}
|