@travisennis/acai 0.0.7 → 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 +42 -25
- package/dist/agent/index.d.ts +21 -25
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +115 -104
- package/dist/cli.d.ts +2 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +21 -16
- 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} +55 -95
- 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 +33 -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 +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} +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 +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} +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 +138 -75
- 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 +11 -10
- package/dist/models/openai-provider.d.ts.map +1 -1
- 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 -29
- package/dist/models/openrouter-provider.d.ts.map +1 -1
- package/dist/models/openrouter-provider.js +95 -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 +0 -1
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +56 -406
- 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 -4
- package/dist/repl-new.d.ts.map +1 -1
- package/dist/repl-new.js +245 -42
- 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} +60 -14
- package/dist/skills.d.ts +0 -4
- package/dist/skills.d.ts.map +1 -1
- package/dist/skills.js +100 -59
- package/dist/terminal/control.d.ts +1 -0
- package/dist/terminal/control.d.ts.map +1 -1
- package/dist/terminal/control.js +2 -0
- 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 +69 -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 +1 -2
- package/dist/tui/components/editor.d.ts.map +1 -1
- package/dist/tui/components/editor.js +148 -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 +63 -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/index.d.ts +4 -2
- package/dist/tui/index.d.ts.map +1 -1
- package/dist/tui/index.js +2 -2
- package/dist/tui/terminal.d.ts +2 -2
- package/dist/tui/terminal.d.ts.map +1 -1
- package/dist/tui/terminal.js +23 -19
- package/dist/tui/tui.d.ts +1 -0
- package/dist/tui/tui.d.ts.map +1 -1
- package/dist/tui/tui.js +24 -29
- package/dist/tui/utils.d.ts.map +1 -1
- package/dist/tui/utils.js +2 -3
- 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,52 @@
|
|
|
1
|
+
import { execSync } from "node:child_process";
|
|
2
|
+
export const ENVIRONMENT_VARIABLES = [
|
|
3
|
+
{ name: "OPENAI_API_KEY", description: "OpenAI (GPT models)" },
|
|
4
|
+
{ name: "ANTHROPIC_API_KEY", description: "Anthropic (Claude models)" },
|
|
5
|
+
{
|
|
6
|
+
name: "GOOGLE_GENERATIVE_AI_API_KEY",
|
|
7
|
+
description: "Google (Gemini models)",
|
|
8
|
+
},
|
|
9
|
+
{ name: "DEEPSEEK_API_KEY", description: "DeepSeek" },
|
|
10
|
+
{ name: "GROQ_API_KEY", description: "Groq (multiple models)" },
|
|
11
|
+
{ name: "X_AI_API_KEY", description: "X.AI (Grok models)" },
|
|
12
|
+
{ name: "XAI_API_KEY", description: "X.AI (Grok models - alt)" },
|
|
13
|
+
{ name: "OPENROUTER_API_KEY", description: "OpenRouter (multiple models)" },
|
|
14
|
+
{ name: "OPENCODE_ZEN_API_TOKEN", description: "OpenCode Zen" },
|
|
15
|
+
{ name: "LOG_LEVEL", description: "Logging level" },
|
|
16
|
+
];
|
|
17
|
+
export const BASH_TOOLS = [
|
|
18
|
+
{ name: "git", command: "git --version" },
|
|
19
|
+
{ name: "gh", command: "gh --version" },
|
|
20
|
+
{ name: "rg", command: "rg --version" },
|
|
21
|
+
{ name: "fd", command: "fd --version" },
|
|
22
|
+
{ name: "ast-grep", command: "ast-grep --version" },
|
|
23
|
+
{ name: "jq", command: "jq --version" },
|
|
24
|
+
{ name: "yq", command: "yq --version" },
|
|
25
|
+
];
|
|
26
|
+
export function checkEnvironmentVariables() {
|
|
27
|
+
return ENVIRONMENT_VARIABLES.map((envVar) => {
|
|
28
|
+
const value = process.env[envVar.name];
|
|
29
|
+
const hasValue = value !== undefined && value !== null && value.trim() !== "";
|
|
30
|
+
const status = hasValue ? "✓ Set" : "✗ Not set";
|
|
31
|
+
return [envVar.name, status, envVar.description];
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
export function checkTools(execFn = execSync) {
|
|
35
|
+
return BASH_TOOLS.map((tool) => {
|
|
36
|
+
let status = "✗ Not installed";
|
|
37
|
+
try {
|
|
38
|
+
execFn(tool.command, { stdio: "ignore", timeout: 5000 });
|
|
39
|
+
status = "✓ Installed";
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
// Ignore error, tool is not installed
|
|
43
|
+
}
|
|
44
|
+
return [tool.name, status];
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
export function formatEnvStatus(status) {
|
|
48
|
+
return status;
|
|
49
|
+
}
|
|
50
|
+
export function formatToolStatus(status) {
|
|
51
|
+
return status;
|
|
52
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { CommandOptions, ReplCommand } from "
|
|
1
|
+
import type { CommandOptions, ReplCommand } from "../types.ts";
|
|
2
2
|
export declare const helpCommand: (_options: CommandOptions, cmds: Map<string, ReplCommand>) => ReplCommand;
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/commands/help/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/D,eAAO,MAAM,WAAW,GACtB,UAAU,cAAc,EACxB,MAAM,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,KAC7B,WA6CF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Modal, Container as ModalContainer, ModalText, TableComponent, } from "
|
|
1
|
+
import { Modal, Container as ModalContainer, ModalText, TableComponent, } from "../../tui/index.js";
|
|
2
2
|
export const helpCommand = (_options, cmds) => {
|
|
3
3
|
return {
|
|
4
4
|
command: "/help",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/commands/history/index.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAwD/D,eAAO,MAAM,cAAc,GAAI,yEAK5B,cAAc,KAAG,WAkJnB,CAAC"}
|
|
@@ -1,94 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/* biome-ignore-all lint/suspicious/noExplicitAny: internal function uses simplified types */
|
|
2
2
|
import { generateText } from "ai";
|
|
3
|
-
import {
|
|
4
|
-
import { getTerminalSize, setTerminalTitle } from "
|
|
5
|
-
import style from "
|
|
6
|
-
import { Container, Input, Markdown, Spacer, Text } from "
|
|
7
|
-
|
|
8
|
-
const sanitizedTitle = history.title
|
|
9
|
-
.replace(/[^a-zA-Z0-9\s-_]/g, "")
|
|
10
|
-
.replace(/\s+/g, "-")
|
|
11
|
-
.toLowerCase();
|
|
12
|
-
const timestamp = new Date().toISOString().replace(/[:.]/g, "-").slice(0, -5);
|
|
13
|
-
const filename = `${sanitizedTitle}_${timestamp}.md`;
|
|
14
|
-
const markdownContent = generateMarkdown(history);
|
|
15
|
-
await writeFile(filename, markdownContent);
|
|
16
|
-
return filename;
|
|
17
|
-
}
|
|
18
|
-
function generateMarkdown(history) {
|
|
19
|
-
const lines = [];
|
|
20
|
-
// Header
|
|
21
|
-
lines.push(`# ${history.title}`);
|
|
22
|
-
lines.push("");
|
|
23
|
-
lines.push("## Conversation Metadata");
|
|
24
|
-
lines.push(`- **Session ID**: ${history.sessionId}`);
|
|
25
|
-
lines.push(`- **Model**: ${history.modelId}`);
|
|
26
|
-
lines.push(`- **Created**: ${history.createdAt.toISOString()}`);
|
|
27
|
-
lines.push(`- **Last Updated**: ${history.updatedAt.toISOString()}`);
|
|
28
|
-
lines.push(`- **Total Messages**: ${history.messages.length}`);
|
|
29
|
-
lines.push("");
|
|
30
|
-
// Messages
|
|
31
|
-
lines.push("## Conversation History");
|
|
32
|
-
lines.push("");
|
|
33
|
-
history.messages.forEach((message, index) => {
|
|
34
|
-
const role = message.role.toUpperCase();
|
|
35
|
-
lines.push(`### ${role} (Message ${index + 1})`);
|
|
36
|
-
lines.push("");
|
|
37
|
-
if (Array.isArray(message.content)) {
|
|
38
|
-
message.content.forEach((part) => {
|
|
39
|
-
if (part.type === "text" && part.text?.trim()) {
|
|
40
|
-
lines.push(part.text);
|
|
41
|
-
lines.push("");
|
|
42
|
-
}
|
|
43
|
-
else if (part.type === "tool-call") {
|
|
44
|
-
lines.push(`**Tool Call**: ${part.toolName}`);
|
|
45
|
-
lines.push(`**Call ID**: ${part.toolCallId}`);
|
|
46
|
-
lines.push("**Input**:");
|
|
47
|
-
lines.push("```json");
|
|
48
|
-
lines.push(JSON.stringify(part.input, null, 2));
|
|
49
|
-
lines.push("```");
|
|
50
|
-
lines.push("");
|
|
51
|
-
}
|
|
52
|
-
else if (part.type === "tool-result") {
|
|
53
|
-
lines.push(`**Tool Result**: ${part.toolName}`);
|
|
54
|
-
lines.push(`**Call ID**: ${part.toolCallId}`);
|
|
55
|
-
lines.push("**Output**:");
|
|
56
|
-
if (typeof part.output === "object" &&
|
|
57
|
-
part.output !== null &&
|
|
58
|
-
"type" in part.output &&
|
|
59
|
-
part.output.type === "text" &&
|
|
60
|
-
"text" in part.output) {
|
|
61
|
-
lines.push("```");
|
|
62
|
-
lines.push(String(part.output.text));
|
|
63
|
-
lines.push("```");
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
lines.push("```json");
|
|
67
|
-
lines.push(JSON.stringify(part.output, null, 2));
|
|
68
|
-
lines.push("```");
|
|
69
|
-
}
|
|
70
|
-
lines.push("");
|
|
71
|
-
}
|
|
72
|
-
else if (part.type === "tool-error") {
|
|
73
|
-
lines.push(`**Tool Error**: ${part.toolName}`);
|
|
74
|
-
lines.push(`**Call ID**: ${part.toolCallId}`);
|
|
75
|
-
lines.push("**Error**:");
|
|
76
|
-
lines.push("```");
|
|
77
|
-
lines.push(String(part.output));
|
|
78
|
-
lines.push("```");
|
|
79
|
-
lines.push("");
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
else if (typeof message.content === "string" && message.content.trim()) {
|
|
84
|
-
lines.push(message.content);
|
|
85
|
-
lines.push("");
|
|
86
|
-
}
|
|
87
|
-
lines.push("---");
|
|
88
|
-
lines.push("");
|
|
89
|
-
});
|
|
90
|
-
return lines.join("\n");
|
|
91
|
-
}
|
|
3
|
+
import { SessionManager } from "../../sessions/manager.js";
|
|
4
|
+
import { getTerminalSize, isArrowDown, isArrowUp, isEnter, isEscape, setTerminalTitle, } from "../../terminal/control.js";
|
|
5
|
+
import style from "../../terminal/style.js";
|
|
6
|
+
import { Container, Input, Markdown, Spacer, Text } from "../../tui/index.js";
|
|
7
|
+
import { exportConversation } from "./utils.js";
|
|
92
8
|
async function summarizeConversation(history, modelManager, tokenTracker) {
|
|
93
9
|
const systemPrompt = `You are an expert at summarizing conversations between a coding assistant and a user. Your task is to provide a clear, concise summary of the conversation that captures:
|
|
94
10
|
|
|
@@ -128,7 +44,7 @@ Keep the summary focused and informative, around 3-5 paragraphs. Use plain text
|
|
|
128
44
|
results.push("");
|
|
129
45
|
return results.join("\n");
|
|
130
46
|
}
|
|
131
|
-
export const historyCommand = ({ messageHistory, config, modelManager, tokenTracker, }) => {
|
|
47
|
+
export const historyCommand = ({ sessionManager: messageHistory, config, modelManager, tokenTracker, }) => {
|
|
132
48
|
return {
|
|
133
49
|
command: "/history",
|
|
134
50
|
description: "Browse and manage previous conversations.",
|
|
@@ -137,7 +53,7 @@ export const historyCommand = ({ messageHistory, config, modelManager, tokenTrac
|
|
|
137
53
|
const appDir = config.app;
|
|
138
54
|
const messageHistoryDir = await appDir.ensurePath("message-history");
|
|
139
55
|
// Load all histories (use a large number to get all)
|
|
140
|
-
const histories = await
|
|
56
|
+
const histories = await SessionManager.load(messageHistoryDir, 1000);
|
|
141
57
|
if (histories.length === 0) {
|
|
142
58
|
container.addChild(new Text(style.yellow("No previous conversations found."), 0, 1));
|
|
143
59
|
tui.requestRender();
|
|
@@ -313,24 +229,24 @@ class ConversationSelectorComponent extends Container {
|
|
|
313
229
|
}
|
|
314
230
|
handleInput(keyData) {
|
|
315
231
|
// Up arrow
|
|
316
|
-
if (keyData
|
|
232
|
+
if (isArrowUp(keyData)) {
|
|
317
233
|
this.selectedIndex = Math.max(0, this.selectedIndex - 1);
|
|
318
234
|
this.updateList();
|
|
319
235
|
}
|
|
320
236
|
// Down arrow
|
|
321
|
-
else if (keyData
|
|
237
|
+
else if (isArrowDown(keyData)) {
|
|
322
238
|
this.selectedIndex = Math.min(this.filteredConversations.length - 1, this.selectedIndex + 1);
|
|
323
239
|
this.updateList();
|
|
324
240
|
}
|
|
325
241
|
// Enter
|
|
326
|
-
else if (keyData
|
|
242
|
+
else if (isEnter(keyData)) {
|
|
327
243
|
const selectedConversation = this.filteredConversations[this.selectedIndex];
|
|
328
244
|
if (selectedConversation) {
|
|
329
245
|
this.handleSelect(selectedConversation);
|
|
330
246
|
}
|
|
331
247
|
}
|
|
332
248
|
// Escape
|
|
333
|
-
else if (keyData
|
|
249
|
+
else if (isEscape(keyData)) {
|
|
334
250
|
this.onCancelCallback();
|
|
335
251
|
}
|
|
336
252
|
// Pass everything else to search input
|
|
@@ -394,17 +310,17 @@ class ActionSelectorComponent extends Container {
|
|
|
394
310
|
}
|
|
395
311
|
handleInput(keyData) {
|
|
396
312
|
// Up arrow
|
|
397
|
-
if (keyData
|
|
313
|
+
if (isArrowUp(keyData)) {
|
|
398
314
|
this.selectedIndex = Math.max(0, this.selectedIndex - 1);
|
|
399
315
|
this.updateList();
|
|
400
316
|
}
|
|
401
317
|
// Down arrow
|
|
402
|
-
else if (keyData
|
|
318
|
+
else if (isArrowDown(keyData)) {
|
|
403
319
|
this.selectedIndex = Math.min(2, this.selectedIndex + 1);
|
|
404
320
|
this.updateList();
|
|
405
321
|
}
|
|
406
322
|
// Enter
|
|
407
|
-
else if (keyData
|
|
323
|
+
else if (isEnter(keyData)) {
|
|
408
324
|
const actions = ["resume", "export", "summarize"];
|
|
409
325
|
const selectedAction = actions[this.selectedIndex];
|
|
410
326
|
if (selectedAction) {
|
|
@@ -412,7 +328,7 @@ class ActionSelectorComponent extends Container {
|
|
|
412
328
|
}
|
|
413
329
|
}
|
|
414
330
|
// Escape
|
|
415
|
-
else if (keyData
|
|
331
|
+
else if (isEscape(keyData)) {
|
|
416
332
|
this.onCancelCallback();
|
|
417
333
|
}
|
|
418
334
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ModelMessage } from "ai";
|
|
2
|
+
export interface ConversationHistory {
|
|
3
|
+
title: string;
|
|
4
|
+
createdAt: Date;
|
|
5
|
+
updatedAt: Date;
|
|
6
|
+
messages: ModelMessage[];
|
|
7
|
+
sessionId: string;
|
|
8
|
+
modelId: string;
|
|
9
|
+
project: string;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../source/commands/history/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAEvC,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../source/commands/history/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,MAAM,CAAC,CAYjB;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAyFrE"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { writeFile } from "node:fs/promises";
|
|
2
|
+
export async function exportConversation(history) {
|
|
3
|
+
const sanitizedTitle = history.title
|
|
4
|
+
.replace(/[^a-zA-Z0-9\s-_]/g, "")
|
|
5
|
+
.replace(/\s+/g, "-")
|
|
6
|
+
.toLowerCase();
|
|
7
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, "-").slice(0, -5);
|
|
8
|
+
const filename = `${sanitizedTitle}_${timestamp}.md`;
|
|
9
|
+
const markdownContent = generateMarkdown(history);
|
|
10
|
+
await writeFile(filename, markdownContent);
|
|
11
|
+
return filename;
|
|
12
|
+
}
|
|
13
|
+
export function generateMarkdown(history) {
|
|
14
|
+
const lines = [];
|
|
15
|
+
// Header
|
|
16
|
+
lines.push(`# ${history.title}`);
|
|
17
|
+
lines.push("");
|
|
18
|
+
lines.push("## Conversation Metadata");
|
|
19
|
+
lines.push(`- **Session ID**: ${history.sessionId}`);
|
|
20
|
+
lines.push(`- **Model**: ${history.modelId}`);
|
|
21
|
+
lines.push(`- **Created**: ${history.createdAt.toISOString()}`);
|
|
22
|
+
lines.push(`- **Last Updated**: ${history.updatedAt.toISOString()}`);
|
|
23
|
+
lines.push(`- **Total Messages**: ${history.messages.length}`);
|
|
24
|
+
lines.push("");
|
|
25
|
+
// Messages
|
|
26
|
+
lines.push("## Conversation History");
|
|
27
|
+
lines.push("");
|
|
28
|
+
history.messages.forEach((message, index) => {
|
|
29
|
+
const role = message.role.toUpperCase();
|
|
30
|
+
lines.push(`### ${role} (Message ${index + 1})`);
|
|
31
|
+
lines.push("");
|
|
32
|
+
if (Array.isArray(message.content)) {
|
|
33
|
+
message.content.forEach((part) => {
|
|
34
|
+
if (part.type === "text" && part.text?.trim()) {
|
|
35
|
+
lines.push(part.text);
|
|
36
|
+
lines.push("");
|
|
37
|
+
}
|
|
38
|
+
else if (part.type === "tool-call") {
|
|
39
|
+
lines.push(`**Tool Call**: ${part.toolName}`);
|
|
40
|
+
lines.push(`**Call ID**: ${part.toolCallId}`);
|
|
41
|
+
lines.push("**Input**:");
|
|
42
|
+
lines.push("```json");
|
|
43
|
+
lines.push(JSON.stringify(part.input, null, 2));
|
|
44
|
+
lines.push("```");
|
|
45
|
+
lines.push("");
|
|
46
|
+
}
|
|
47
|
+
else if (part.type === "tool-result") {
|
|
48
|
+
lines.push(`**Tool Result**: ${part.toolName}`);
|
|
49
|
+
lines.push(`**Call ID**: ${part.toolCallId}`);
|
|
50
|
+
lines.push("**Output**:");
|
|
51
|
+
if (typeof part.output === "object" &&
|
|
52
|
+
part.output !== null &&
|
|
53
|
+
"type" in part.output &&
|
|
54
|
+
part.output.type === "text" &&
|
|
55
|
+
"text" in part.output) {
|
|
56
|
+
lines.push("```");
|
|
57
|
+
lines.push(String(part.output.text));
|
|
58
|
+
lines.push("```");
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
lines.push("```json");
|
|
62
|
+
lines.push(JSON.stringify(part.output, null, 2));
|
|
63
|
+
lines.push("```");
|
|
64
|
+
}
|
|
65
|
+
lines.push("");
|
|
66
|
+
}
|
|
67
|
+
else if (part.type === "tool-error") {
|
|
68
|
+
lines.push(`**Tool Error**: ${part.toolName}`);
|
|
69
|
+
lines.push(`**Call ID**: ${part.toolCallId}`);
|
|
70
|
+
lines.push("**Error**:");
|
|
71
|
+
lines.push("```");
|
|
72
|
+
lines.push(String(part.output));
|
|
73
|
+
lines.push("```");
|
|
74
|
+
lines.push("");
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
else if (typeof message.content === "string" && message.content.trim()) {
|
|
79
|
+
lines.push(message.content);
|
|
80
|
+
lines.push("");
|
|
81
|
+
}
|
|
82
|
+
lines.push("---");
|
|
83
|
+
lines.push("");
|
|
84
|
+
});
|
|
85
|
+
return lines.join("\n");
|
|
86
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/commands/init/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAqB/D,eAAO,MAAM,WAAW,GAAI,8BAGzB,cAAc,KAAG,WAiEnB,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { platform } from "node:os";
|
|
2
|
-
import { stepCountIs, streamText } from "ai";
|
|
3
|
-
import style from "
|
|
4
|
-
import {
|
|
5
|
-
import { Markdown, Spacer, Text } from "
|
|
6
|
-
import { inGitDirectory } from "
|
|
2
|
+
import { stepCountIs, streamText, tool } from "ai";
|
|
3
|
+
import style from "../../terminal/style.js";
|
|
4
|
+
import { initTools } from "../../tools/index.js";
|
|
5
|
+
import { Markdown, Spacer, Text } from "../../tui/index.js";
|
|
6
|
+
import { inGitDirectory } from "../../utils/git.js";
|
|
7
7
|
const initPrompt = `Please analyze this codebase and create a AGENTS.md file containing:
|
|
8
8
|
1. An overview of the project including how the project is structured and the tech stack used.
|
|
9
9
|
2. Build/lint/test commands - especially for running a single test
|
|
@@ -22,7 +22,7 @@ If there are Cursor rules (in .cursor/rules/ or .cursorrules), Copilot rules (in
|
|
|
22
22
|
Your current working directory is ${process.cwd()}
|
|
23
23
|
Is directory a git repo: ${(await inGitDirectory()) ? "Yes" : "No"}
|
|
24
24
|
Platform: ${platform()}`;
|
|
25
|
-
export const initCommand = ({ modelManager,
|
|
25
|
+
export const initCommand = ({ modelManager, workspace, }) => {
|
|
26
26
|
return {
|
|
27
27
|
command: "/init",
|
|
28
28
|
description: "Creates the AGENTS.md file.",
|
|
@@ -30,12 +30,21 @@ export const initCommand = ({ modelManager, tokenCounter, workspace, }) => {
|
|
|
30
30
|
async handle(_args, { tui, container, editor, }) {
|
|
31
31
|
container.addChild(new Text("Initializing project and creating AGENTS.md...", 1, 1));
|
|
32
32
|
tui.requestRender();
|
|
33
|
+
const tools = await initTools({
|
|
34
|
+
workspace,
|
|
35
|
+
});
|
|
33
36
|
const result = streamText({
|
|
34
37
|
model: modelManager.getModel("init-project"),
|
|
35
38
|
temperature: 0.5,
|
|
36
39
|
prompt: initPrompt,
|
|
37
40
|
stopWhen: stepCountIs(40),
|
|
38
|
-
tools: (
|
|
41
|
+
tools: Object.fromEntries(Object.entries(tools).map((t) => [
|
|
42
|
+
t[0],
|
|
43
|
+
tool({
|
|
44
|
+
...t[1]["toolDef"],
|
|
45
|
+
execute: t[1]["execute"],
|
|
46
|
+
}),
|
|
47
|
+
])),
|
|
39
48
|
});
|
|
40
49
|
container.addChild(new Spacer(1));
|
|
41
50
|
let output = "";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/commands/init-project/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAO/D,eAAO,MAAM,kBAAkB,GAAI,UAAU,cAAc,KAAG,WAqF7D,CAAC"}
|
|
@@ -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;AAyBzB,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,YAAY,CAAC;AAE9D,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAA2B;IAC3C,OAAO,CAAC,aAAa,CAAmB;IACxC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,aAAa,CAAW;IAChC,OAAO,CAAC,SAAS,CAAmB;IACpC,OAAO,CAAC,WAAW,CAAU;gBAEjB,EACV,aAAa,EACb,YAAY,EACZ,cAAc,EAAE,cAAc,EAC9B,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,aAAa,EACb,SAAS,GACV,EAAE,cAAc;IAaX,mBAAmB;IAqFzB,OAAO,CAAC,iBAAiB;IAQnB,cAAc,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAuB/C,WAAW;IAKL,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAKlD,MAAM,CACV,EAAE,SAAS,EAAE,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,EACpC,OAAO,EAAE;QACP,GAAG,EAAE,GAAG,CAAC;QACT,SAAS,EAAE,SAAS,CAAC;QACrB,cAAc,EAAE,SAAS,CAAC;QAC1B,MAAM,EAAE,MAAM,CAAC;KAChB;;;;CA8BJ"}
|