@travisennis/acai 0.0.7 → 0.0.9
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 +76 -27
- package/dist/agent/index.d.ts +21 -25
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +145 -103
- package/dist/cli.d.ts +2 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +23 -17
- 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-command.js → add-directory/index.js} +6 -10
- 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/types.js +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} +0 -2
- package/dist/commands/copy/index.d.ts +3 -0
- package/dist/commands/copy/index.d.ts.map +1 -0
- package/dist/commands/{copy-command.js → copy/index.js} +4 -26
- 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-command.d.ts → exit/index.d.ts} +4 -4
- 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} +57 -96
- 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-command.js → handoff/utils.js} +24 -92
- 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-command.d.ts → help/index.d.ts} +2 -2
- package/dist/commands/help/index.d.ts.map +1 -0
- package/dist/commands/{help-command.js → help/index.js} +1 -1
- 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} +16 -100
- 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} +16 -7
- 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} +1 -1
- 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-command.js → list-tools/index.js} +4 -16
- package/dist/commands/manager.d.ts +2 -2
- package/dist/commands/manager.d.ts.map +1 -1
- package/dist/commands/manager.js +35 -43
- package/dist/commands/model/index.d.ts +3 -0
- package/dist/commands/model/index.d.ts.map +1 -0
- package/dist/commands/{model-command.js → model/index.js} +15 -52
- 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-command.d.ts → paste/index.d.ts} +2 -2
- package/dist/commands/paste/index.d.ts.map +1 -0
- package/dist/commands/{paste-command.js → paste/index.js} +6 -111
- 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 +122 -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} +2 -2
- 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} +7 -2
- 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 -3
- 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 +230 -0
- package/dist/commands/session/types.d.ts +20 -0
- package/dist/commands/session/types.d.ts.map +1 -0
- package/dist/commands/session/types.js +7 -0
- package/dist/commands/share/html-renderer.d.ts +25 -0
- package/dist/commands/share/html-renderer.d.ts.map +1 -0
- package/dist/commands/share/html-renderer.js +384 -0
- package/dist/commands/share/index.d.ts +3 -0
- package/dist/commands/share/index.d.ts.map +1 -0
- package/dist/commands/share/index.js +122 -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} +3 -3
- package/dist/commands/types.d.ts +2 -2
- package/dist/commands/types.d.ts.map +1 -1
- package/dist/config.d.ts +25 -7
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +45 -20
- package/dist/dedent.d.ts.map +1 -1
- package/dist/dedent.js +7 -7
- package/dist/execution/index.d.ts +1 -0
- package/dist/execution/index.d.ts.map +1 -1
- package/dist/execution/index.js +60 -64
- package/dist/formatting.d.ts +27 -0
- package/dist/formatting.d.ts.map +1 -1
- package/dist/formatting.js +40 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +194 -95
- 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/deepseek-provider.d.ts +9 -8
- package/dist/models/deepseek-provider.d.ts.map +1 -1
- package/dist/models/google-provider.d.ts +10 -9
- package/dist/models/google-provider.d.ts.map +1 -1
- package/dist/models/groq-provider.d.ts +8 -7
- package/dist/models/groq-provider.d.ts.map +1 -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 +14 -10
- package/dist/models/openai-provider.d.ts.map +1 -1
- package/dist/models/openai-provider.js +39 -0
- package/dist/models/opencode-zen-provider.d.ts +24 -0
- package/dist/models/opencode-zen-provider.d.ts.map +1 -0
- package/dist/models/opencode-zen-provider.js +94 -0
- package/dist/models/openrouter-provider.d.ts +35 -29
- package/dist/models/openrouter-provider.d.ts.map +1 -1
- package/dist/models/openrouter-provider.js +108 -80
- package/dist/models/providers.d.ts +4 -4
- package/dist/models/providers.d.ts.map +1 -1
- package/dist/models/providers.js +7 -1
- package/dist/models/xai-provider.d.ts +9 -8
- package/dist/models/xai-provider.d.ts.map +1 -1
- 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 +12 -2
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +74 -411
- 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 +18 -4
- package/dist/repl-new.d.ts.map +1 -1
- package/dist/repl-new.js +256 -43
- package/dist/{messages.d.ts → sessions/manager.d.ts} +10 -4
- package/dist/sessions/manager.d.ts.map +1 -0
- package/dist/{messages.js → sessions/manager.js} +62 -14
- package/dist/skills.d.ts +0 -4
- package/dist/skills.d.ts.map +1 -1
- package/dist/skills.js +100 -59
- package/dist/stdin.d.ts +9 -0
- package/dist/stdin.d.ts.map +1 -0
- package/dist/stdin.js +26 -0
- package/dist/terminal/control.d.ts +1 -0
- package/dist/terminal/control.d.ts.map +1 -1
- package/dist/terminal/control.js +29 -6
- package/dist/terminal/formatting.d.ts +1 -2
- package/dist/terminal/formatting.d.ts.map +1 -1
- package/dist/terminal/formatting.js +1 -2
- 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/tokens/tracker.d.ts.map +1 -1
- package/dist/tokens/tracker.js +58 -16
- package/dist/tools/bash.d.ts +9 -11
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash.js +104 -123
- package/dist/tools/directory-tree.d.ts +9 -7
- package/dist/tools/directory-tree.d.ts.map +1 -1
- package/dist/tools/directory-tree.js +89 -70
- package/dist/tools/dynamic-tool-loader.d.ts +22 -4
- package/dist/tools/dynamic-tool-loader.d.ts.map +1 -1
- package/dist/tools/dynamic-tool-loader.js +39 -44
- 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 +19 -76
- package/dist/tools/glob.d.ts +15 -16
- package/dist/tools/glob.d.ts.map +1 -1
- package/dist/tools/glob.js +77 -119
- package/dist/tools/grep.d.ts +19 -22
- package/dist/tools/grep.d.ts.map +1 -1
- package/dist/tools/grep.js +61 -108
- package/dist/tools/index.d.ts +200 -179
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +17 -315
- 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 +49 -82
- package/dist/tools/save-file.d.ts +4 -4
- package/dist/tools/save-file.d.ts.map +1 -1
- package/dist/tools/save-file.js +37 -66
- package/dist/tools/think.d.ts +4 -4
- package/dist/tools/think.d.ts.map +1 -1
- package/dist/tools/think.js +9 -38
- package/dist/tools/types.d.ts +5 -25
- 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/box.d.ts.map +1 -1
- package/dist/tui/components/box.js +16 -10
- package/dist/tui/components/editor.d.ts +6 -2
- package/dist/tui/components/editor.d.ts.map +1 -1
- package/dist/tui/components/editor.js +166 -107
- package/dist/tui/components/footer.d.ts +20 -7
- package/dist/tui/components/footer.d.ts.map +1 -1
- package/dist/tui/components/footer.js +89 -196
- 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 +2 -1
- package/dist/tui/components/loader.d.ts.map +1 -1
- package/dist/tui/components/loader.js +7 -2
- package/dist/tui/components/markdown.d.ts +5 -4
- package/dist/tui/components/markdown.d.ts.map +1 -1
- package/dist/tui/components/markdown.js +51 -40
- package/dist/tui/components/modal.d.ts.map +1 -1
- package/dist/tui/components/modal.js +9 -8
- 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 +64 -0
- package/dist/tui/components/progress-bar.d.ts.map +1 -1
- package/dist/tui/components/progress-bar.js +3 -15
- package/dist/tui/components/select-list.d.ts +0 -15
- package/dist/tui/components/select-list.d.ts.map +1 -1
- package/dist/tui/components/select-list.js +5 -28
- package/dist/tui/components/tool-execution.d.ts +3 -6
- package/dist/tui/components/tool-execution.d.ts.map +1 -1
- package/dist/tui/components/tool-execution.js +26 -38
- 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/editor-launcher.d.ts +13 -0
- package/dist/tui/editor-launcher.d.ts.map +1 -0
- package/dist/tui/editor-launcher.js +39 -0
- package/dist/tui/index.d.ts +7 -3
- package/dist/tui/index.d.ts.map +1 -1
- package/dist/tui/index.js +3 -2
- package/dist/tui/terminal.d.ts +29 -2
- package/dist/tui/terminal.d.ts.map +1 -1
- package/dist/tui/terminal.js +153 -28
- package/dist/tui/tui.d.ts +2 -0
- package/dist/tui/tui.d.ts.map +1 -1
- package/dist/tui/tui.js +39 -29
- package/dist/tui/utils.d.ts.map +1 -1
- package/dist/tui/utils.js +2 -3
- package/dist/utils/filesystem/security.d.ts.map +1 -1
- package/dist/utils/filesystem/security.js +4 -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.d.ts +1 -0
- package/dist/utils/zod.d.ts.map +1 -1
- package/dist/utils/zod.js +17 -0
- package/package.json +31 -29
- package/bin/acai-wrapper.js +0 -26
- 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/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 -43
- 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 -55
- 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 -124
- package/dist/commands/copy-command.d.ts +0 -3
- package/dist/commands/copy-command.d.ts.map +0 -1
- 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 -42
- 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 -36
- package/dist/commands/exit-command.d.ts.map +0 -1
- package/dist/commands/exit-command.js +0 -30
- 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 -68
- 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/health-command.d.ts +0 -4
- package/dist/commands/health-command.d.ts.map +0 -1
- package/dist/commands/health-command.js +0 -118
- 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 -71
- 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/model-command.d.ts +0 -3
- package/dist/commands/model-command.d.ts.map +0 -1
- package/dist/commands/paste-command.d.ts.map +0 -1
- 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 -109
- package/dist/commands/prompt-command.d.ts +0 -21
- package/dist/commands/prompt-command.d.ts.map +0 -1
- package/dist/commands/prompt-command.js +0 -258
- 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 -73
- 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 -31
- package/dist/messages.d.ts.map +0 -1
- package/dist/repl/project-status-line.d.ts +0 -3
- package/dist/repl/project-status-line.d.ts.map +0 -1
- package/dist/repl/project-status-line.js +0 -61
- 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/terminal/markdown.d.ts +0 -2
- package/dist/terminal/markdown.d.ts.map +0 -1
- package/dist/terminal/markdown.js +0 -120
- package/dist/tokens/threshold.d.ts +0 -20
- package/dist/tokens/threshold.d.ts.map +0 -1
- package/dist/tokens/threshold.js +0 -67
- 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 -285
- package/dist/tools/agent.d.ts +0 -29
- package/dist/tools/agent.d.ts.map +0 -1
- package/dist/tools/agent.js +0 -117
- package/dist/tools/batch.d.ts +0 -34
- package/dist/tools/batch.d.ts.map +0 -1
- package/dist/tools/batch.js +0 -174
- 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 -183
- 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 -77
- 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/llm-edit-fixer.d.ts +0 -24
- package/dist/tools/llm-edit-fixer.d.ts.map +0 -1
- package/dist/tools/llm-edit-fixer.js +0 -136
- 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 -65
- 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 -196
- 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 -148
- package/dist/tui/components/prompt-status.d.ts +0 -17
- package/dist/tui/components/prompt-status.d.ts.map +0 -1
- package/dist/tui/components/prompt-status.js +0 -26
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Spacer, Text } from "../../tui/index.js";
|
|
2
|
+
import { ensureConfigFile, ensureProjectDirectory, isDevelopmentDirectory, } from "./utils.js";
|
|
3
|
+
export const initProjectCommand = (_options) => {
|
|
4
|
+
return {
|
|
5
|
+
command: "/init-project",
|
|
6
|
+
description: "Initialize a new acai project in the current directory. Creates missing directories and files without overwriting existing ones.",
|
|
7
|
+
getSubCommands: () => Promise.resolve([]),
|
|
8
|
+
async handle(_args, { tui, container, editor, }) {
|
|
9
|
+
const currentDir = process.cwd();
|
|
10
|
+
if (isDevelopmentDirectory(currentDir)) {
|
|
11
|
+
container.addChild(new Text("Cannot initialize project in acai-ts development directory.", 1, 0));
|
|
12
|
+
container.addChild(new Text("Run this command in a different project directory.", 2, 0));
|
|
13
|
+
tui.requestRender();
|
|
14
|
+
editor.setText("");
|
|
15
|
+
return "continue";
|
|
16
|
+
}
|
|
17
|
+
const projectDir = require("node:path").join(currentDir, ".acai");
|
|
18
|
+
const dirResult = ensureProjectDirectory(projectDir);
|
|
19
|
+
const configResult = ensureConfigFile(projectDir);
|
|
20
|
+
const created = [...dirResult.created, ...configResult.created];
|
|
21
|
+
const existing = [...dirResult.existing, ...configResult.existing];
|
|
22
|
+
container.addChild(new Text("Initializing acai project...", 1, 0));
|
|
23
|
+
if (created.length > 0) {
|
|
24
|
+
container.addChild(new Spacer(1));
|
|
25
|
+
container.addChild(new Text("Created:", 1, 0));
|
|
26
|
+
for (const item of created) {
|
|
27
|
+
container.addChild(new Text(` ${item}`, 2, 0));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (existing.length > 0) {
|
|
31
|
+
container.addChild(new Spacer(1));
|
|
32
|
+
container.addChild(new Text("Already existed:", 1, 0));
|
|
33
|
+
for (const item of existing) {
|
|
34
|
+
container.addChild(new Text(` ${item}`, 2, 0));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (created.length === 0 && existing.length > 0) {
|
|
38
|
+
container.addChild(new Spacer(1));
|
|
39
|
+
container.addChild(new Text("Project already fully initialized. No changes made.", 1, 0));
|
|
40
|
+
}
|
|
41
|
+
container.addChild(new Spacer(1));
|
|
42
|
+
container.addChild(new Text("Project initialized successfully. You can now:", 1, 0));
|
|
43
|
+
container.addChild(new Text(" • Add project-specific prompts to .acai/prompts/", 2, 0));
|
|
44
|
+
container.addChild(new Text(" • Configure settings in .acai/acai.json", 2, 0));
|
|
45
|
+
container.addChild(new Text(" • Add project skills to .acai/skills/", 2, 0));
|
|
46
|
+
tui.requestRender();
|
|
47
|
+
editor.setText("");
|
|
48
|
+
return "continue";
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const DEVELOPMENT_DIRECTORY = "/Users/travisennis/Github/acai-ts";
|
|
2
|
+
export interface InitializationResult {
|
|
3
|
+
created: string[];
|
|
4
|
+
existing: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare function ensureProjectDirectory(projectDir: string): InitializationResult;
|
|
7
|
+
export declare function ensureConfigFile(projectDir: string): InitializationResult;
|
|
8
|
+
export declare function isDevelopmentDirectory(dir: string): boolean;
|
|
9
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../source/commands/init-project/utils.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB,sCAAsC,CAAC;AAEzE,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,MAAM,GACjB,oBAAoB,CAuBtB;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,oBAAoB,CAazE;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE3D"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { defaultConfig } from "../../config.js";
|
|
4
|
+
export const DEVELOPMENT_DIRECTORY = "/Users/travisennis/Github/acai-ts";
|
|
5
|
+
export function ensureProjectDirectory(projectDir) {
|
|
6
|
+
const created = [];
|
|
7
|
+
const existing = [];
|
|
8
|
+
if (!existsSync(projectDir)) {
|
|
9
|
+
mkdirSync(projectDir, { recursive: true });
|
|
10
|
+
created.push(".acai/");
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
existing.push(".acai/");
|
|
14
|
+
}
|
|
15
|
+
const subdirs = ["prompts", "rules", "skills"];
|
|
16
|
+
for (const subdir of subdirs) {
|
|
17
|
+
const dirPath = path.join(projectDir, subdir);
|
|
18
|
+
if (!existsSync(dirPath)) {
|
|
19
|
+
mkdirSync(dirPath, { recursive: true });
|
|
20
|
+
created.push(`.acai/${subdir}/`);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
existing.push(`.acai/${subdir}/`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return { created, existing };
|
|
27
|
+
}
|
|
28
|
+
export function ensureConfigFile(projectDir) {
|
|
29
|
+
const created = [];
|
|
30
|
+
const existing = [];
|
|
31
|
+
const configPath = path.join(projectDir, "acai.json");
|
|
32
|
+
if (!existsSync(configPath)) {
|
|
33
|
+
writeFileSync(configPath, JSON.stringify(defaultConfig, null, 2), "utf8");
|
|
34
|
+
created.push(".acai/acai.json");
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
existing.push(".acai/acai.json");
|
|
38
|
+
}
|
|
39
|
+
return { created, existing };
|
|
40
|
+
}
|
|
41
|
+
export function isDevelopmentDirectory(dir) {
|
|
42
|
+
return dir === DEVELOPMENT_DIRECTORY;
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/commands/list-directories/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/D,eAAO,MAAM,sBAAsB,GAAI,gBAEpC,cAAc,KAAG,WAkDnB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Modal, Container as ModalContainer, ModalText } from "
|
|
1
|
+
import { Modal, Container as ModalContainer, ModalText, } from "../../tui/index.js";
|
|
2
2
|
export const listDirectoriesCommand = ({ workspace, }) => {
|
|
3
3
|
return {
|
|
4
4
|
command: "/list-directories",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/commands/list-tools/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/D,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,WAAW,CAoHrE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import style from "
|
|
2
|
-
import {
|
|
3
|
-
import { Modal, Container as ModalContainer, ModalText, TableComponent, } from "
|
|
1
|
+
import style from "../../terminal/style.js";
|
|
2
|
+
import { initTools } from "../../tools/index.js";
|
|
3
|
+
import { Modal, Container as ModalContainer, ModalText, TableComponent, } from "../../tui/index.js";
|
|
4
4
|
export function listToolsCommand(options) {
|
|
5
5
|
return {
|
|
6
6
|
command: "/list-tools",
|
|
@@ -13,21 +13,9 @@ export function listToolsCommand(options) {
|
|
|
13
13
|
const projectConfig = await options.config.getConfig();
|
|
14
14
|
const activeTools = projectConfig.tools.activeTools;
|
|
15
15
|
const tools = await initTools({
|
|
16
|
-
tokenCounter: options.tokenCounter,
|
|
17
16
|
workspace: options.workspace,
|
|
18
|
-
modelManager: options.modelManager,
|
|
19
|
-
tokenTracker: options.tokenTracker,
|
|
20
17
|
});
|
|
21
|
-
const
|
|
22
|
-
modelManager: options.modelManager,
|
|
23
|
-
tokenTracker: options.tokenTracker,
|
|
24
|
-
tokenCounter: options.tokenCounter,
|
|
25
|
-
workspace: options.workspace,
|
|
26
|
-
});
|
|
27
|
-
const toolNames = Object.keys({
|
|
28
|
-
...tools.toolDefs,
|
|
29
|
-
...agentTools.toolDefs,
|
|
30
|
-
}).sort();
|
|
18
|
+
const toolNames = Object.keys(tools).sort();
|
|
31
19
|
// Separate static and dynamic tools
|
|
32
20
|
const staticTools = [];
|
|
33
21
|
const dynamicTools = [];
|
|
@@ -4,14 +4,14 @@ export declare class CommandManager {
|
|
|
4
4
|
private commands;
|
|
5
5
|
private promptManager;
|
|
6
6
|
private modelManager;
|
|
7
|
-
private
|
|
7
|
+
private sessionManager;
|
|
8
8
|
private tokenTracker;
|
|
9
9
|
private config;
|
|
10
10
|
private tokenCounter;
|
|
11
11
|
private promptHistory;
|
|
12
12
|
private workspace;
|
|
13
13
|
private initialized;
|
|
14
|
-
constructor({ promptManager, modelManager, messageHistory, tokenTracker, config, tokenCounter, promptHistory, workspace, }: CommandOptions);
|
|
14
|
+
constructor({ promptManager, modelManager, sessionManager: messageHistory, tokenTracker, config, tokenCounter, promptHistory, workspace, }: CommandOptions);
|
|
15
15
|
initializeCommmands(): Promise<void>;
|
|
16
16
|
private ensureInitialized;
|
|
17
17
|
getCompletions(): Promise<SlashCommand[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../source/commands/manager.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAEV,SAAS,EACT,MAAM,EACN,YAAY,EACZ,GAAG,EACJ,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../source/commands/manager.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAEV,SAAS,EACT,MAAM,EACN,YAAY,EACZ,GAAG,EACJ,MAAM,iBAAiB,CAAC;AA0BzB,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,YAAY,CAAC;AAE9D,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAA2B;IAC3C,OAAO,CAAC,aAAa,CAAmB;IACxC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,aAAa,CAAW;IAChC,OAAO,CAAC,SAAS,CAAmB;IACpC,OAAO,CAAC,WAAW,CAAU;gBAEjB,EACV,aAAa,EACb,YAAY,EACZ,cAAc,EAAE,cAAc,EAC9B,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,aAAa,EACb,SAAS,GACV,EAAE,cAAc;IAaX,mBAAmB;IAsFzB,OAAO,CAAC,iBAAiB;IAQnB,cAAc,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAuB/C,WAAW;IAKL,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAKlD,MAAM,CACV,EAAE,SAAS,EAAE,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,EACpC,OAAO,EAAE;QACP,GAAG,EAAE,GAAG,CAAC;QACT,SAAS,EAAE,SAAS,CAAC;QACrB,cAAc,EAAE,SAAS,CAAC;QAC1B,MAAM,EAAE,MAAM,CAAC;KAChB;;;;CA8BJ"}
|
package/dist/commands/manager.js
CHANGED
|
@@ -1,48 +1,44 @@
|
|
|
1
|
-
import { addDirectoryCommand } from "./add-directory
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
// import { rulesCommand } from "./rules-command.ts";
|
|
27
|
-
import { saveCommand } from "./save-command.js";
|
|
28
|
-
import { shellCommand } from "./shell-command.js";
|
|
29
|
-
import { usageCommand } from "./usage-command.js";
|
|
1
|
+
import { addDirectoryCommand } from "./add-directory/index.js";
|
|
2
|
+
import { clearCommand } from "./clear/index.js";
|
|
3
|
+
import { copyCommand } from "./copy/index.js";
|
|
4
|
+
import { exitCommand } from "./exit/index.js";
|
|
5
|
+
import { generateRulesCommand } from "./generate-rules/index.js";
|
|
6
|
+
import { handoffCommand } from "./handoff/index.js";
|
|
7
|
+
import { healthCommand } from "./health/index.js";
|
|
8
|
+
import { helpCommand } from "./help/index.js";
|
|
9
|
+
import { historyCommand } from "./history/index.js";
|
|
10
|
+
import { initCommand } from "./init/index.js";
|
|
11
|
+
import { initProjectCommand } from "./init-project/index.js";
|
|
12
|
+
import { listDirectoriesCommand } from "./list-directories/index.js";
|
|
13
|
+
import { listToolsCommand } from "./list-tools/index.js";
|
|
14
|
+
import { modelCommand } from "./model/index.js";
|
|
15
|
+
import { pasteCommand } from "./paste/index.js";
|
|
16
|
+
import { pickupCommand } from "./pickup/index.js";
|
|
17
|
+
import { loadPrompts, promptCommand } from "./prompt/index.js";
|
|
18
|
+
import { removeDirectoryCommand } from "./remove-directory/index.js";
|
|
19
|
+
import { resetCommand } from "./reset/index.js";
|
|
20
|
+
import { resourcesCommand } from "./resources/index.js";
|
|
21
|
+
import { reviewCommand } from "./review/index.js";
|
|
22
|
+
import { saveCommand } from "./save/index.js";
|
|
23
|
+
import { sessionCommand } from "./session/index.js";
|
|
24
|
+
import { shareCommand } from "./share/index.js";
|
|
25
|
+
import { shellCommand } from "./shell/index.js";
|
|
30
26
|
export class CommandManager {
|
|
31
27
|
commands;
|
|
32
28
|
promptManager;
|
|
33
29
|
modelManager;
|
|
34
|
-
|
|
30
|
+
sessionManager;
|
|
35
31
|
tokenTracker;
|
|
36
32
|
config;
|
|
37
33
|
tokenCounter;
|
|
38
34
|
promptHistory;
|
|
39
35
|
workspace;
|
|
40
36
|
initialized;
|
|
41
|
-
constructor({ promptManager, modelManager, messageHistory, tokenTracker, config, tokenCounter, promptHistory, workspace, }) {
|
|
37
|
+
constructor({ promptManager, modelManager, sessionManager: messageHistory, tokenTracker, config, tokenCounter, promptHistory, workspace, }) {
|
|
42
38
|
this.commands = new Map();
|
|
43
39
|
this.promptManager = promptManager;
|
|
44
40
|
this.modelManager = modelManager;
|
|
45
|
-
this.
|
|
41
|
+
this.sessionManager = messageHistory;
|
|
46
42
|
this.tokenTracker = tokenTracker;
|
|
47
43
|
this.config = config;
|
|
48
44
|
this.tokenCounter = tokenCounter;
|
|
@@ -58,7 +54,7 @@ export class CommandManager {
|
|
|
58
54
|
const options = {
|
|
59
55
|
promptManager: this.promptManager,
|
|
60
56
|
modelManager: this.modelManager,
|
|
61
|
-
|
|
57
|
+
sessionManager: this.sessionManager,
|
|
62
58
|
tokenTracker: this.tokenTracker,
|
|
63
59
|
config: this.config,
|
|
64
60
|
tokenCounter: this.tokenCounter,
|
|
@@ -69,31 +65,27 @@ export class CommandManager {
|
|
|
69
65
|
const cmds = [
|
|
70
66
|
addDirectoryCommand(options),
|
|
71
67
|
clearCommand(options),
|
|
72
|
-
// compactCommand(options),
|
|
73
|
-
contextCommand(options),
|
|
74
|
-
// editCommand(options),
|
|
75
|
-
// editPromptCommand(options),
|
|
76
68
|
exitCommand(options),
|
|
77
|
-
// filesCommand(options),
|
|
78
69
|
healthCommand(options),
|
|
79
70
|
historyCommand(options),
|
|
80
71
|
initCommand(options),
|
|
72
|
+
initProjectCommand(options),
|
|
81
73
|
listDirectoriesCommand(options),
|
|
82
74
|
pasteCommand(options),
|
|
83
75
|
pickupCommand(options),
|
|
84
76
|
promptCommand(options),
|
|
85
77
|
removeDirectoryCommand(options),
|
|
86
78
|
resetCommand(options),
|
|
79
|
+
reviewCommand(options),
|
|
87
80
|
saveCommand(options),
|
|
88
|
-
// rulesCommand(options),
|
|
89
81
|
modelCommand(options),
|
|
90
|
-
|
|
91
|
-
// lastLogCommand(options),
|
|
82
|
+
sessionCommand(options),
|
|
92
83
|
generateRulesCommand(options),
|
|
93
84
|
handoffCommand(options),
|
|
94
|
-
// applicationLogCommand(options),
|
|
95
85
|
copyCommand(options),
|
|
96
86
|
listToolsCommand(options),
|
|
87
|
+
resourcesCommand(options),
|
|
88
|
+
shareCommand(options),
|
|
97
89
|
shellCommand(options),
|
|
98
90
|
];
|
|
99
91
|
// Add help command with access to all commands
|
|
@@ -161,7 +153,7 @@ export class CommandManager {
|
|
|
161
153
|
const commandArgs = userInput.split(" ");
|
|
162
154
|
const command = commandArgs.at(0);
|
|
163
155
|
const args = commandArgs.slice(1);
|
|
164
|
-
if (command) {
|
|
156
|
+
if (command !== undefined) {
|
|
165
157
|
const replCommand = this.commands.get(command);
|
|
166
158
|
if (replCommand) {
|
|
167
159
|
const result = await replCommand.handle(args, options);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/commands/model/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/D,wBAAgB,YAAY,CAAC,OAAO,EAAE,cAAc,GAAG,WAAW,CAqHjE"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { isValidModel, modelRegistry, models, } from "
|
|
2
|
-
import { getTerminalSize } from "
|
|
3
|
-
import style from "
|
|
4
|
-
import { Container, Input, Spacer, Text, } from "
|
|
1
|
+
import { isValidModel, modelRegistry, models, } from "../../models/providers.js";
|
|
2
|
+
import { getTerminalSize, isArrowDown, isArrowUp, isEnter, isEscape, } from "../../terminal/control.js";
|
|
3
|
+
import style from "../../terminal/style.js";
|
|
4
|
+
import { Container, Input, Spacer, Text, } from "../../tui/index.js";
|
|
5
|
+
import { hideModelSelector } from "./utils.js";
|
|
5
6
|
export function modelCommand(options) {
|
|
6
7
|
const { modelManager } = options;
|
|
7
8
|
return {
|
|
@@ -11,40 +12,31 @@ export function modelCommand(options) {
|
|
|
11
12
|
async handle(args, { tui, container, inputContainer, editor, }) {
|
|
12
13
|
const arg = args.join(" ").trim();
|
|
13
14
|
const modelConfig = modelManager.getModelMetadata("repl");
|
|
14
|
-
// No args - display model selector
|
|
15
15
|
if (!arg) {
|
|
16
|
-
// Create model selector with current model
|
|
17
16
|
const modelSelector = new ModelSelectorComponent(modelConfig.id, (model) => {
|
|
18
|
-
// Apply the selected model
|
|
19
17
|
modelManager.setModel("repl", model);
|
|
20
|
-
// Hide selector and show editor again
|
|
21
18
|
hideModelSelector(inputContainer, editor, tui);
|
|
22
19
|
tui.requestRender();
|
|
23
20
|
}, () => {
|
|
24
|
-
// Just hide the selector
|
|
25
21
|
hideModelSelector(inputContainer, editor, tui);
|
|
26
22
|
tui.requestRender();
|
|
27
23
|
});
|
|
28
|
-
// Replace editor with selector
|
|
29
24
|
inputContainer.clear();
|
|
30
25
|
inputContainer.addChild(modelSelector);
|
|
31
26
|
tui.setFocus(modelSelector);
|
|
32
27
|
tui.requestRender();
|
|
33
28
|
return "continue";
|
|
34
29
|
}
|
|
35
|
-
// Switch to a specific model
|
|
36
30
|
if (isValidModel(arg)) {
|
|
37
31
|
try {
|
|
38
|
-
// Get current and new model configs
|
|
39
32
|
const currentModelConfig = modelManager.getModelMetadata("repl");
|
|
40
33
|
const newModelConfig = modelRegistry[arg];
|
|
41
|
-
if (
|
|
34
|
+
if (newModelConfig === undefined) {
|
|
42
35
|
container.addChild(new Text(style.red(`Model configuration not found for: ${arg}`), 1, 0));
|
|
43
36
|
tui.requestRender();
|
|
44
37
|
editor.setText("");
|
|
45
38
|
return "continue";
|
|
46
39
|
}
|
|
47
|
-
// Check for capability differences
|
|
48
40
|
if (currentModelConfig.supportsToolCalling &&
|
|
49
41
|
!newModelConfig.supportsToolCalling) {
|
|
50
42
|
container.addChild(new Text(style.yellow("The new model doesn't support tool calling, which may limit functionality."), 1, 0));
|
|
@@ -53,11 +45,7 @@ export function modelCommand(options) {
|
|
|
53
45
|
!newModelConfig.supportsReasoning) {
|
|
54
46
|
container.addChild(new Text(style.yellow("The new model doesn't support reasoning, which may change response quality."), 2, 0));
|
|
55
47
|
}
|
|
56
|
-
// Update model in ModelManager
|
|
57
48
|
modelManager.setModel("repl", arg);
|
|
58
|
-
// container.addChild(
|
|
59
|
-
// new Text(style.green(`Model set to ${arg}.`), 3, 0),
|
|
60
|
-
// );
|
|
61
49
|
tui.requestRender();
|
|
62
50
|
editor.setText("");
|
|
63
51
|
return "continue";
|
|
@@ -75,15 +63,6 @@ export function modelCommand(options) {
|
|
|
75
63
|
},
|
|
76
64
|
};
|
|
77
65
|
}
|
|
78
|
-
function hideModelSelector(editorContainer, editor, tui) {
|
|
79
|
-
// Replace selector with editor in the container
|
|
80
|
-
editorContainer.clear();
|
|
81
|
-
editorContainer.addChild(editor);
|
|
82
|
-
tui.setFocus(editor);
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Component that renders a model selector with search
|
|
86
|
-
*/
|
|
87
66
|
class ModelSelectorComponent extends Container {
|
|
88
67
|
searchInput;
|
|
89
68
|
listContainer;
|
|
@@ -98,29 +77,23 @@ class ModelSelectorComponent extends Container {
|
|
|
98
77
|
this.currentModel = currentModel;
|
|
99
78
|
this.onSelectCallback = onSelect;
|
|
100
79
|
this.onCancelCallback = onCancel;
|
|
101
|
-
// Load all models
|
|
102
80
|
this.loadModels();
|
|
103
81
|
const { columns } = getTerminalSize();
|
|
104
|
-
// Add top border
|
|
105
82
|
this.addChild(new Text(style.blue("─".repeat(columns)), 0, 0));
|
|
106
83
|
this.addChild(new Spacer(1));
|
|
107
|
-
// Create search input
|
|
108
84
|
this.searchInput = new Input();
|
|
109
85
|
this.searchInput.onSubmit = () => {
|
|
110
|
-
|
|
111
|
-
if (
|
|
112
|
-
this.handleSelect(
|
|
86
|
+
const model = this.filteredModels[this.selectedIndex];
|
|
87
|
+
if (model !== undefined) {
|
|
88
|
+
this.handleSelect(model);
|
|
113
89
|
}
|
|
114
90
|
};
|
|
115
91
|
this.addChild(this.searchInput);
|
|
116
92
|
this.addChild(new Spacer(1));
|
|
117
|
-
// Create list container
|
|
118
93
|
this.listContainer = new Container();
|
|
119
94
|
this.addChild(this.listContainer);
|
|
120
95
|
this.addChild(new Spacer(1));
|
|
121
|
-
// Add bottom border
|
|
122
96
|
this.addChild(new Text(style.blue("─".repeat(columns)), 0, 0));
|
|
123
|
-
// Initial render
|
|
124
97
|
this.updateList();
|
|
125
98
|
}
|
|
126
99
|
loadModels() {
|
|
@@ -149,10 +122,9 @@ class ModelSelectorComponent extends Container {
|
|
|
149
122
|
const maxVisible = 10;
|
|
150
123
|
const startIndex = Math.max(0, Math.min(this.selectedIndex - Math.floor(maxVisible / 2), this.filteredModels.length - maxVisible));
|
|
151
124
|
const endIndex = Math.min(startIndex + maxVisible, this.filteredModels.length);
|
|
152
|
-
// Show visible slice of filtered models
|
|
153
125
|
for (let i = startIndex; i < endIndex; i++) {
|
|
154
126
|
const item = this.filteredModels[i];
|
|
155
|
-
if (
|
|
127
|
+
if (item === undefined)
|
|
156
128
|
continue;
|
|
157
129
|
const isSelected = i === this.selectedIndex;
|
|
158
130
|
const isCurrent = this.currentModel === item;
|
|
@@ -160,51 +132,42 @@ class ModelSelectorComponent extends Container {
|
|
|
160
132
|
if (isSelected) {
|
|
161
133
|
const prefix = style.blue("→ ");
|
|
162
134
|
const modelText = `${item}`;
|
|
163
|
-
// const providerBadge = style.gray(`[${item.provider}]`);
|
|
164
135
|
const checkmark = isCurrent ? style.green(" ✓") : "";
|
|
165
136
|
line = `${prefix + style.blue(modelText)} ${checkmark}`;
|
|
166
137
|
}
|
|
167
138
|
else {
|
|
168
139
|
const modelText = ` ${item}`;
|
|
169
|
-
// const providerBadge = style.gray(`[${item.provider}]`);
|
|
170
140
|
const checkmark = isCurrent ? style.green(" ✓") : "";
|
|
171
141
|
line = `${modelText} ${checkmark}`;
|
|
172
142
|
}
|
|
173
143
|
this.listContainer.addChild(new Text(line, 0, 0));
|
|
174
144
|
}
|
|
175
|
-
// Add scroll indicator if needed
|
|
176
145
|
if (startIndex > 0 || endIndex < this.filteredModels.length) {
|
|
177
146
|
const scrollInfo = style.gray(` (${this.selectedIndex + 1}/${this.filteredModels.length})`);
|
|
178
147
|
this.listContainer.addChild(new Text(scrollInfo, 0, 0));
|
|
179
148
|
}
|
|
180
|
-
// Show "no results" if empty
|
|
181
149
|
if (this.filteredModels.length === 0) {
|
|
182
150
|
this.listContainer.addChild(new Text(style.gray(" No matching models"), 0, 0));
|
|
183
151
|
}
|
|
184
152
|
}
|
|
185
153
|
handleInput(keyData) {
|
|
186
|
-
|
|
187
|
-
if (keyData === "\x1b[A") {
|
|
154
|
+
if (isArrowUp(keyData)) {
|
|
188
155
|
this.selectedIndex = Math.max(0, this.selectedIndex - 1);
|
|
189
156
|
this.updateList();
|
|
190
157
|
}
|
|
191
|
-
|
|
192
|
-
else if (keyData === "\x1b[B") {
|
|
158
|
+
else if (isArrowDown(keyData)) {
|
|
193
159
|
this.selectedIndex = Math.min(this.filteredModels.length - 1, this.selectedIndex + 1);
|
|
194
160
|
this.updateList();
|
|
195
161
|
}
|
|
196
|
-
|
|
197
|
-
else if (keyData === "\r") {
|
|
162
|
+
else if (isEnter(keyData)) {
|
|
198
163
|
const selectedModel = this.filteredModels[this.selectedIndex];
|
|
199
|
-
if (selectedModel) {
|
|
164
|
+
if (selectedModel !== undefined) {
|
|
200
165
|
this.handleSelect(selectedModel);
|
|
201
166
|
}
|
|
202
167
|
}
|
|
203
|
-
|
|
204
|
-
else if (keyData === "\x1b") {
|
|
168
|
+
else if (isEscape(keyData)) {
|
|
205
169
|
this.onCancelCallback();
|
|
206
170
|
}
|
|
207
|
-
// Pass everything else to search input
|
|
208
171
|
else {
|
|
209
172
|
this.searchInput.handleInput(keyData);
|
|
210
173
|
this.filterModels(this.searchInput.getValue());
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../source/commands/model/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAEjE,wBAAgB,iBAAiB,CAC/B,eAAe,EAAE,SAAS,EAC1B,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,GAAG,GACP,IAAI,CAIN"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { CommandOptions, ReplCommand } from "
|
|
1
|
+
import type { CommandOptions, ReplCommand } from "../types.ts";
|
|
2
2
|
export declare const pasteCommand: ({ modelManager, promptManager, tokenCounter, }: CommandOptions) => ReplCommand;
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/commands/paste/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAO/D,eAAO,MAAM,YAAY,GAAI,gDAI1B,cAAc,KAAG,WAiKnB,CAAC"}
|