@travisennis/acai 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +225 -39
- package/dist/agent/index.d.ts +30 -21
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +237 -198
- package/dist/cli.d.ts +4 -3
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +56 -18
- package/dist/commands/add-directory/index.d.ts +3 -0
- package/dist/commands/add-directory/index.d.ts.map +1 -0
- package/dist/commands/add-directory/index.js +50 -0
- package/dist/commands/add-directory/types.d.ts +6 -0
- package/dist/commands/add-directory/types.d.ts.map +1 -0
- package/dist/commands/add-directory/utils.d.ts +3 -0
- package/dist/commands/add-directory/utils.d.ts.map +1 -0
- package/dist/commands/add-directory/utils.js +15 -0
- package/dist/commands/clear/index.d.ts +3 -0
- package/dist/commands/clear/index.d.ts.map +1 -0
- package/dist/commands/{clear-command.js → clear/index.js} +1 -7
- package/dist/commands/copy/index.d.ts +3 -0
- package/dist/commands/copy/index.d.ts.map +1 -0
- package/dist/commands/copy/index.js +39 -0
- package/dist/commands/copy/types.d.ts +3 -0
- package/dist/commands/copy/types.d.ts.map +1 -0
- package/dist/commands/copy/types.js +1 -0
- package/dist/commands/copy/utils.d.ts +3 -0
- package/dist/commands/copy/utils.d.ts.map +1 -0
- package/dist/commands/copy/utils.js +22 -0
- package/dist/commands/exit/index.d.ts +10 -0
- package/dist/commands/exit/index.d.ts.map +1 -0
- package/dist/commands/exit/index.js +21 -0
- package/dist/commands/exit/types.d.ts +8 -0
- package/dist/commands/exit/types.d.ts.map +1 -0
- package/dist/commands/exit/types.js +1 -0
- package/dist/commands/exit/utils.d.ts +2 -0
- package/dist/commands/exit/utils.d.ts.map +1 -0
- package/dist/commands/exit/utils.js +13 -0
- package/dist/commands/generate-rules/index.d.ts +3 -0
- package/dist/commands/generate-rules/index.d.ts.map +1 -0
- package/dist/commands/{generate-rules-command.js → generate-rules/index.js} +65 -147
- package/dist/commands/generate-rules/utils.d.ts +5 -0
- package/dist/commands/generate-rules/utils.d.ts.map +1 -0
- package/dist/commands/generate-rules/utils.js +25 -0
- package/dist/commands/handoff/index.d.ts +3 -0
- package/dist/commands/handoff/index.d.ts.map +1 -0
- package/dist/commands/handoff/index.js +97 -0
- package/dist/commands/handoff/utils.d.ts +4 -0
- package/dist/commands/handoff/utils.d.ts.map +1 -0
- package/dist/commands/handoff/utils.js +123 -0
- package/dist/commands/health/index.d.ts +3 -0
- package/dist/commands/health/index.d.ts.map +1 -0
- package/dist/commands/health/index.js +56 -0
- package/dist/commands/health/utils.d.ts +15 -0
- package/dist/commands/health/utils.d.ts.map +1 -0
- package/dist/commands/health/utils.js +52 -0
- package/dist/commands/help/index.d.ts +3 -0
- package/dist/commands/help/index.d.ts.map +1 -0
- package/dist/commands/{help-command.js → help/index.js} +6 -14
- package/dist/commands/history/index.d.ts +3 -0
- package/dist/commands/history/index.d.ts.map +1 -0
- package/dist/commands/{history-command.js → history/index.js} +40 -200
- package/dist/commands/history/types.d.ts +11 -0
- package/dist/commands/history/types.d.ts.map +1 -0
- package/dist/commands/history/types.js +1 -0
- package/dist/commands/history/utils.d.ts +4 -0
- package/dist/commands/history/utils.d.ts.map +1 -0
- package/dist/commands/history/utils.js +86 -0
- package/dist/commands/init/index.d.ts +3 -0
- package/dist/commands/init/index.d.ts.map +1 -0
- package/dist/commands/{init-command.js → init/index.js} +17 -27
- package/dist/commands/init-project/index.d.ts +3 -0
- package/dist/commands/init-project/index.d.ts.map +1 -0
- package/dist/commands/init-project/index.js +51 -0
- package/dist/commands/init-project/utils.d.ts +9 -0
- package/dist/commands/init-project/utils.d.ts.map +1 -0
- package/dist/commands/init-project/utils.js +43 -0
- package/dist/commands/list-directories/index.d.ts +3 -0
- package/dist/commands/list-directories/index.d.ts.map +1 -0
- package/dist/commands/{list-directories-command.js → list-directories/index.js} +2 -15
- package/dist/commands/list-tools/index.d.ts +3 -0
- package/dist/commands/list-tools/index.d.ts.map +1 -0
- package/dist/commands/list-tools/index.js +89 -0
- package/dist/commands/manager.d.ts +2 -9
- package/dist/commands/manager.d.ts.map +1 -1
- package/dist/commands/manager.js +38 -83
- package/dist/commands/model/index.d.ts +3 -0
- package/dist/commands/model/index.d.ts.map +1 -0
- package/dist/commands/model/index.js +182 -0
- package/dist/commands/model/utils.d.ts +3 -0
- package/dist/commands/model/utils.d.ts.map +1 -0
- package/dist/commands/model/utils.js +5 -0
- package/dist/commands/paste/index.d.ts +3 -0
- package/dist/commands/paste/index.d.ts.map +1 -0
- package/dist/commands/paste/index.js +94 -0
- package/dist/commands/paste/utils.d.ts +5 -0
- package/dist/commands/paste/utils.d.ts.map +1 -0
- package/dist/commands/paste/utils.js +86 -0
- package/dist/commands/pickup/index.d.ts +3 -0
- package/dist/commands/pickup/index.d.ts.map +1 -0
- package/dist/commands/pickup/index.js +138 -0
- package/dist/commands/pickup/types.d.ts +6 -0
- package/dist/commands/pickup/types.d.ts.map +1 -0
- package/dist/commands/pickup/types.js +1 -0
- package/dist/commands/pickup/utils.d.ts +7 -0
- package/dist/commands/pickup/utils.d.ts.map +1 -0
- package/dist/commands/pickup/utils.js +56 -0
- package/dist/commands/prompt/index.d.ts +5 -0
- package/dist/commands/prompt/index.d.ts.map +1 -0
- package/dist/commands/prompt/index.js +126 -0
- package/dist/commands/prompt/types.d.ts +15 -0
- package/dist/commands/prompt/types.d.ts.map +1 -0
- package/dist/commands/prompt/types.js +1 -0
- package/dist/commands/prompt/utils.d.ts +12 -0
- package/dist/commands/prompt/utils.d.ts.map +1 -0
- package/dist/commands/prompt/utils.js +107 -0
- package/dist/commands/remove-directory/index.d.ts +3 -0
- package/dist/commands/remove-directory/index.d.ts.map +1 -0
- package/dist/commands/{remove-directory-command.js → remove-directory/index.js} +3 -35
- package/dist/commands/reset/index.d.ts +3 -0
- package/dist/commands/reset/index.d.ts.map +1 -0
- package/dist/commands/{reset-command.js → reset/index.js} +8 -11
- package/dist/commands/reset/types.d.ts +1 -0
- package/dist/commands/reset/types.d.ts.map +1 -0
- package/dist/commands/reset/types.js +3 -0
- package/dist/commands/resources/index.d.ts +3 -0
- package/dist/commands/resources/index.d.ts.map +1 -0
- package/dist/commands/resources/index.js +84 -0
- package/dist/commands/review/index.d.ts +3 -0
- package/dist/commands/review/index.d.ts.map +1 -0
- package/dist/commands/review/index.js +126 -0
- package/dist/commands/review/types.d.ts +12 -0
- package/dist/commands/review/types.d.ts.map +1 -0
- package/dist/commands/review/types.js +1 -0
- package/dist/commands/review/utils.d.ts +4 -0
- package/dist/commands/review/utils.d.ts.map +1 -0
- package/dist/commands/review/utils.js +87 -0
- package/dist/commands/save/index.d.ts +3 -0
- package/dist/commands/save/index.d.ts.map +1 -0
- package/dist/commands/{save-command.js → save/index.js} +3 -10
- package/dist/commands/session/index.d.ts +3 -0
- package/dist/commands/session/index.d.ts.map +1 -0
- package/dist/commands/session/index.js +197 -0
- package/dist/commands/session/types.d.ts +13 -0
- package/dist/commands/session/types.d.ts.map +1 -0
- package/dist/commands/session/types.js +7 -0
- package/dist/commands/shell/index.d.ts +3 -0
- package/dist/commands/shell/index.d.ts.map +1 -0
- package/dist/commands/{shell-command.js → shell/index.js} +4 -51
- package/dist/commands/types.d.ts +2 -5
- package/dist/commands/types.d.ts.map +1 -1
- package/dist/config.d.ts +36 -7
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +118 -60
- package/dist/dedent.d.ts.map +1 -1
- package/dist/dedent.js +7 -7
- package/dist/execution/index.d.ts +18 -2
- package/dist/execution/index.d.ts.map +1 -1
- package/dist/execution/index.js +119 -81
- package/dist/formatting.d.ts +46 -0
- package/dist/formatting.d.ts.map +1 -1
- package/dist/formatting.js +94 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +299 -177
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +4 -11
- package/dist/mentions.d.ts.map +1 -1
- package/dist/mentions.js +3 -53
- package/dist/middleware/audit-message.d.ts +2 -2
- package/dist/middleware/audit-message.d.ts.map +1 -1
- package/dist/middleware/audit-message.js +40 -2
- package/dist/middleware/cache.d.ts +2 -2
- package/dist/middleware/cache.d.ts.map +1 -1
- package/dist/middleware/cache.js +111 -27
- package/dist/middleware/rate-limit.d.ts +2 -2
- package/dist/middleware/rate-limit.d.ts.map +1 -1
- package/dist/middleware/rate-limit.js +1 -0
- package/dist/models/ai-config.d.ts.map +1 -1
- package/dist/models/ai-config.js +46 -29
- package/dist/models/anthropic-provider.d.ts +14 -13
- package/dist/models/anthropic-provider.d.ts.map +1 -1
- package/dist/models/anthropic-provider.js +0 -7
- package/dist/models/deepseek-provider.d.ts +9 -8
- package/dist/models/deepseek-provider.d.ts.map +1 -1
- package/dist/models/deepseek-provider.js +0 -2
- package/dist/models/google-provider.d.ts +10 -9
- package/dist/models/google-provider.d.ts.map +1 -1
- package/dist/models/google-provider.js +0 -3
- package/dist/models/groq-provider.d.ts +8 -7
- package/dist/models/groq-provider.d.ts.map +1 -1
- package/dist/models/groq-provider.js +0 -1
- package/dist/models/manager.d.ts +7 -4
- package/dist/models/manager.d.ts.map +1 -1
- package/dist/models/manager.js +5 -25
- package/dist/models/openai-provider.d.ts +11 -10
- package/dist/models/openai-provider.d.ts.map +1 -1
- package/dist/models/openai-provider.js +0 -4
- package/dist/models/opencode-zen-provider.d.ts +23 -0
- package/dist/models/opencode-zen-provider.d.ts.map +1 -0
- package/dist/models/opencode-zen-provider.js +76 -0
- package/dist/models/openrouter-provider.d.ts +34 -28
- package/dist/models/openrouter-provider.d.ts.map +1 -1
- package/dist/models/openrouter-provider.js +148 -139
- package/dist/models/providers.d.ts +6 -16
- package/dist/models/providers.d.ts.map +1 -1
- package/dist/models/providers.js +8 -58
- package/dist/models/xai-provider.d.ts +9 -8
- package/dist/models/xai-provider.d.ts.map +1 -1
- package/dist/models/xai-provider.js +0 -2
- package/dist/prompts/manager.d.ts +1 -1
- package/dist/prompts/manager.d.ts.map +1 -1
- package/dist/prompts/manager.js +1 -1
- package/dist/prompts.d.ts +8 -4
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +155 -177
- package/dist/repl/project-status.d.ts +19 -0
- package/dist/repl/project-status.d.ts.map +1 -0
- package/dist/repl/project-status.js +78 -0
- package/dist/repl-new.d.ts +15 -6
- package/dist/repl-new.d.ts.map +1 -1
- package/dist/repl-new.js +266 -83
- package/dist/{messages.d.ts → sessions/manager.d.ts} +13 -4
- package/dist/sessions/manager.d.ts.map +1 -0
- package/dist/{messages.js → sessions/manager.js} +126 -16
- package/dist/skills.d.ts +16 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +233 -0
- package/dist/terminal/control.d.ts +56 -0
- package/dist/terminal/control.d.ts.map +1 -0
- package/dist/terminal/control.js +111 -0
- package/dist/terminal/default-theme.d.ts +1 -1
- package/dist/terminal/default-theme.d.ts.map +1 -1
- package/dist/terminal/default-theme.js +24 -28
- package/dist/terminal/formatting.d.ts +23 -26
- package/dist/terminal/formatting.d.ts.map +1 -1
- package/dist/terminal/formatting.js +35 -53
- package/dist/terminal/highlight/index.d.ts.map +1 -1
- package/dist/terminal/highlight/index.js +3 -6
- package/dist/terminal/highlight/theme.d.ts.map +1 -1
- package/dist/terminal/highlight/theme.js +2 -6
- package/dist/terminal/index.d.ts +2 -101
- package/dist/terminal/index.d.ts.map +1 -1
- package/dist/terminal/index.js +2 -464
- package/dist/terminal/keys.d.ts +211 -0
- package/dist/terminal/keys.d.ts.map +1 -0
- package/dist/terminal/keys.js +546 -0
- package/dist/terminal/segmenter.d.ts +6 -0
- package/dist/terminal/segmenter.d.ts.map +1 -0
- package/dist/terminal/segmenter.js +11 -0
- package/dist/terminal/select-prompt.d.ts.map +1 -1
- package/dist/terminal/select-prompt.js +9 -21
- package/dist/terminal/string-width.d.ts.map +1 -1
- package/dist/terminal/string-width.js +40 -21
- package/dist/terminal/strip-ansi.d.ts.map +1 -1
- package/dist/terminal/strip-ansi.js +9 -15
- package/dist/terminal/table/cell.d.ts +114 -0
- package/dist/terminal/table/cell.d.ts.map +1 -0
- package/dist/terminal/table/cell.js +407 -0
- package/dist/terminal/table/debug.d.ts +15 -0
- package/dist/terminal/table/debug.d.ts.map +1 -0
- package/dist/terminal/table/debug.js +32 -0
- package/dist/terminal/table/index.d.ts +3 -0
- package/dist/terminal/table/index.d.ts.map +1 -0
- package/dist/terminal/table/index.js +2 -0
- package/dist/terminal/table/layout-manager.d.ts +27 -0
- package/dist/terminal/table/layout-manager.d.ts.map +1 -0
- package/dist/terminal/table/layout-manager.js +257 -0
- package/dist/terminal/table/table.d.ts +9 -0
- package/dist/terminal/table/table.d.ts.map +1 -0
- package/dist/terminal/table/table.js +97 -0
- package/dist/terminal/table/utils.d.ts +63 -0
- package/dist/terminal/table/utils.d.ts.map +1 -0
- package/dist/terminal/table/utils.js +326 -0
- package/dist/tokens/tracker.d.ts.map +1 -1
- package/dist/tokens/tracker.js +58 -16
- package/dist/tools/bash.d.ts +11 -11
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash.js +189 -81
- package/dist/tools/directory-tree.d.ts +9 -13
- package/dist/tools/directory-tree.d.ts.map +1 -1
- package/dist/tools/directory-tree.js +90 -60
- package/dist/tools/dynamic-tool-loader.d.ts +22 -8
- package/dist/tools/dynamic-tool-loader.d.ts.map +1 -1
- package/dist/tools/dynamic-tool-loader.js +41 -46
- package/dist/tools/edit-file.d.ts +6 -16
- package/dist/tools/edit-file.d.ts.map +1 -1
- package/dist/tools/edit-file.js +22 -66
- package/dist/tools/glob.d.ts +15 -16
- package/dist/tools/glob.d.ts.map +1 -1
- package/dist/tools/glob.js +78 -109
- package/dist/tools/grep.d.ts +19 -22
- package/dist/tools/grep.d.ts.map +1 -1
- package/dist/tools/grep.js +61 -93
- package/dist/tools/index.d.ts +202 -167
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +17 -273
- package/dist/tools/ls.d.ts +26 -0
- package/dist/tools/ls.d.ts.map +1 -0
- package/dist/tools/ls.js +80 -0
- package/dist/tools/read-file.d.ts +15 -15
- package/dist/tools/read-file.d.ts.map +1 -1
- package/dist/tools/read-file.js +52 -76
- package/dist/tools/save-file.d.ts +8 -8
- package/dist/tools/save-file.d.ts.map +1 -1
- package/dist/tools/save-file.js +42 -53
- package/dist/tools/think.d.ts +4 -4
- package/dist/tools/think.d.ts.map +1 -1
- package/dist/tools/think.js +9 -32
- package/dist/tools/types.d.ts +5 -21
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/types.js +0 -9
- package/dist/tui/autocomplete/attachment-provider.d.ts +18 -0
- package/dist/tui/autocomplete/attachment-provider.d.ts.map +1 -0
- package/dist/tui/autocomplete/attachment-provider.js +159 -0
- package/dist/tui/autocomplete/base-provider.d.ts +17 -0
- package/dist/tui/autocomplete/base-provider.d.ts.map +1 -0
- package/dist/tui/autocomplete/base-provider.js +1 -0
- package/dist/tui/autocomplete/combined-provider.d.ts +20 -0
- package/dist/tui/autocomplete/combined-provider.d.ts.map +1 -0
- package/dist/tui/autocomplete/combined-provider.js +61 -0
- package/dist/tui/autocomplete/command-provider.d.ts +20 -0
- package/dist/tui/autocomplete/command-provider.d.ts.map +1 -0
- package/dist/tui/autocomplete/command-provider.js +90 -0
- package/dist/tui/autocomplete/file-search-provider.d.ts +16 -0
- package/dist/tui/autocomplete/file-search-provider.d.ts.map +1 -0
- package/dist/tui/autocomplete/file-search-provider.js +123 -0
- package/dist/tui/autocomplete/path-provider.d.ts +21 -0
- package/dist/tui/autocomplete/path-provider.d.ts.map +1 -0
- package/dist/tui/autocomplete/path-provider.js +164 -0
- package/dist/tui/autocomplete/utils.d.ts +16 -0
- package/dist/tui/autocomplete/utils.d.ts.map +1 -0
- package/dist/tui/autocomplete/utils.js +137 -0
- package/dist/tui/autocomplete.d.ts +12 -43
- package/dist/tui/autocomplete.d.ts.map +1 -1
- package/dist/tui/autocomplete.js +20 -465
- package/dist/tui/components/assistant-message.js +1 -1
- package/dist/tui/components/box.d.ts +20 -0
- package/dist/tui/components/box.d.ts.map +1 -0
- package/dist/tui/components/box.js +87 -0
- package/dist/tui/components/editor.d.ts +61 -7
- package/dist/tui/components/editor.d.ts.map +1 -1
- package/dist/tui/components/editor.js +630 -127
- package/dist/tui/components/footer.d.ts +19 -18
- package/dist/tui/components/footer.d.ts.map +1 -1
- package/dist/tui/components/footer.js +90 -185
- package/dist/tui/components/header.d.ts +21 -0
- package/dist/tui/components/header.d.ts.map +1 -0
- package/dist/tui/components/header.js +63 -0
- package/dist/tui/components/input.d.ts.map +1 -1
- package/dist/tui/components/input.js +8 -7
- package/dist/tui/components/loader.d.ts +6 -1
- package/dist/tui/components/loader.d.ts.map +1 -1
- package/dist/tui/components/loader.js +8 -3
- package/dist/tui/components/markdown.d.ts +31 -27
- package/dist/tui/components/markdown.d.ts.map +1 -1
- package/dist/tui/components/markdown.js +131 -67
- package/dist/tui/components/modal.d.ts +0 -11
- package/dist/tui/components/modal.d.ts.map +1 -1
- package/dist/tui/components/modal.js +9 -37
- package/dist/tui/components/notification.d.ts +28 -0
- package/dist/tui/components/notification.d.ts.map +1 -0
- package/dist/tui/components/notification.js +63 -0
- package/dist/tui/components/progress-bar.d.ts +19 -0
- package/dist/tui/components/progress-bar.d.ts.map +1 -0
- package/dist/tui/components/progress-bar.js +66 -0
- package/dist/tui/components/select-list.d.ts +12 -1
- package/dist/tui/components/select-list.d.ts.map +1 -1
- package/dist/tui/components/select-list.js +73 -32
- package/dist/tui/components/spacer.d.ts +1 -1
- package/dist/tui/components/spacer.d.ts.map +1 -1
- package/dist/tui/components/spacer.js +2 -2
- package/dist/tui/components/table.d.ts +27 -0
- package/dist/tui/components/table.d.ts.map +1 -0
- package/dist/tui/components/table.js +125 -0
- package/dist/tui/components/thinking-block.d.ts.map +1 -1
- package/dist/tui/components/thinking-block.js +4 -1
- package/dist/tui/components/tool-execution.d.ts +7 -6
- package/dist/tui/components/tool-execution.d.ts.map +1 -1
- package/dist/tui/components/tool-execution.js +81 -85
- package/dist/tui/components/user-message.d.ts.map +1 -1
- package/dist/tui/components/user-message.js +6 -4
- package/dist/tui/components/welcome.d.ts +8 -1
- package/dist/tui/components/welcome.d.ts.map +1 -1
- package/dist/tui/components/welcome.js +45 -6
- package/dist/tui/index.d.ts +12 -6
- package/dist/tui/index.d.ts.map +1 -1
- package/dist/tui/index.js +7 -3
- package/dist/tui/terminal.d.ts +4 -3
- package/dist/tui/terminal.d.ts.map +1 -1
- package/dist/tui/terminal.js +43 -49
- package/dist/tui/tui.d.ts +3 -0
- package/dist/tui/tui.d.ts.map +1 -1
- package/dist/tui/tui.js +58 -43
- package/dist/tui/utils.d.ts +5 -0
- package/dist/tui/utils.d.ts.map +1 -1
- package/dist/tui/utils.js +80 -1
- package/dist/{tools/bash-utils.d.ts → utils/bash.d.ts} +3 -3
- package/dist/utils/bash.d.ts.map +1 -0
- package/dist/{tools/bash-utils.js → utils/bash.js} +22 -11
- package/dist/utils/{filesystem.d.ts → filesystem/operations.d.ts} +1 -1
- package/dist/utils/filesystem/operations.d.ts.map +1 -0
- package/dist/{tools/filesystem-utils.d.ts → utils/filesystem/security.d.ts} +3 -2
- package/dist/utils/filesystem/security.d.ts.map +1 -0
- package/dist/{tools/filesystem-utils.js → utils/filesystem/security.js} +62 -4
- package/dist/utils/funcs.d.ts +6 -0
- package/dist/utils/funcs.d.ts.map +1 -0
- package/dist/utils/funcs.js +6 -0
- package/dist/{tools/git-utils.d.ts → utils/git.d.ts} +1 -1
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/{tools/git-utils.js → utils/git.js} +0 -6
- package/dist/utils/glob.js +1 -1
- package/dist/utils/yaml.d.ts +11 -0
- package/dist/utils/yaml.d.ts.map +1 -0
- package/dist/utils/yaml.js +207 -0
- package/dist/utils/{zod-utils.d.ts → zod.d.ts} +2 -1
- package/dist/utils/zod.d.ts.map +1 -0
- package/dist/utils/zod.js +24 -0
- package/package.json +31 -29
- package/dist/agent/manual-loop.d.ts +0 -41
- package/dist/agent/manual-loop.d.ts.map +0 -1
- package/dist/agent/manual-loop.js +0 -278
- package/dist/api/exa/index.d.ts +0 -177
- package/dist/api/exa/index.d.ts.map +0 -1
- package/dist/api/exa/index.js +0 -439
- package/dist/commands/add-directory-command.d.ts +0 -3
- package/dist/commands/add-directory-command.d.ts.map +0 -1
- package/dist/commands/add-directory-command.js +0 -85
- package/dist/commands/application-log-command.d.ts +0 -3
- package/dist/commands/application-log-command.d.ts.map +0 -1
- package/dist/commands/application-log-command.js +0 -79
- package/dist/commands/clear-command.d.ts +0 -3
- package/dist/commands/clear-command.d.ts.map +0 -1
- package/dist/commands/compact-command.d.ts +0 -3
- package/dist/commands/compact-command.d.ts.map +0 -1
- package/dist/commands/compact-command.js +0 -64
- package/dist/commands/context-command.d.ts +0 -3
- package/dist/commands/context-command.d.ts.map +0 -1
- package/dist/commands/context-command.js +0 -183
- package/dist/commands/copy-command.d.ts +0 -3
- package/dist/commands/copy-command.d.ts.map +0 -1
- package/dist/commands/copy-command.js +0 -80
- package/dist/commands/edit-command.d.ts +0 -3
- package/dist/commands/edit-command.d.ts.map +0 -1
- package/dist/commands/edit-command.js +0 -88
- package/dist/commands/edit-prompt-command.d.ts +0 -3
- package/dist/commands/edit-prompt-command.d.ts.map +0 -1
- package/dist/commands/edit-prompt-command.js +0 -61
- package/dist/commands/exit-command.d.ts +0 -13
- package/dist/commands/exit-command.d.ts.map +0 -1
- package/dist/commands/exit-command.js +0 -46
- package/dist/commands/files-command.d.ts +0 -3
- package/dist/commands/files-command.d.ts.map +0 -1
- package/dist/commands/files-command.js +0 -121
- package/dist/commands/generate-rules-command.d.ts +0 -3
- package/dist/commands/generate-rules-command.d.ts.map +0 -1
- package/dist/commands/handoff-command.d.ts +0 -3
- package/dist/commands/handoff-command.d.ts.map +0 -1
- package/dist/commands/handoff-command.js +0 -202
- package/dist/commands/health-command.d.ts +0 -4
- package/dist/commands/health-command.d.ts.map +0 -1
- package/dist/commands/health-command.js +0 -213
- package/dist/commands/help-command.d.ts +0 -3
- package/dist/commands/help-command.d.ts.map +0 -1
- package/dist/commands/history-command.d.ts +0 -3
- package/dist/commands/history-command.d.ts.map +0 -1
- package/dist/commands/init-command.d.ts +0 -3
- package/dist/commands/init-command.d.ts.map +0 -1
- package/dist/commands/last-log-command.d.ts +0 -3
- package/dist/commands/last-log-command.d.ts.map +0 -1
- package/dist/commands/last-log-command.js +0 -98
- package/dist/commands/list-directories-command.d.ts +0 -3
- package/dist/commands/list-directories-command.d.ts.map +0 -1
- package/dist/commands/list-tools-command.d.ts +0 -3
- package/dist/commands/list-tools-command.d.ts.map +0 -1
- package/dist/commands/list-tools-command.js +0 -124
- package/dist/commands/model-command.d.ts +0 -25
- package/dist/commands/model-command.d.ts.map +0 -1
- package/dist/commands/model-command.js +0 -340
- package/dist/commands/paste-command.d.ts +0 -3
- package/dist/commands/paste-command.d.ts.map +0 -1
- package/dist/commands/paste-command.js +0 -277
- package/dist/commands/pickup-command.d.ts +0 -3
- package/dist/commands/pickup-command.d.ts.map +0 -1
- package/dist/commands/pickup-command.js +0 -161
- package/dist/commands/prompt-command.d.ts +0 -3
- package/dist/commands/prompt-command.d.ts.map +0 -1
- package/dist/commands/prompt-command.js +0 -280
- package/dist/commands/remove-directory-command.d.ts +0 -3
- package/dist/commands/remove-directory-command.d.ts.map +0 -1
- package/dist/commands/reset-command.d.ts +0 -3
- package/dist/commands/reset-command.d.ts.map +0 -1
- package/dist/commands/rules-command.d.ts +0 -3
- package/dist/commands/rules-command.d.ts.map +0 -1
- package/dist/commands/rules-command.js +0 -135
- package/dist/commands/save-command.d.ts +0 -3
- package/dist/commands/save-command.d.ts.map +0 -1
- package/dist/commands/shell-command.d.ts +0 -3
- package/dist/commands/shell-command.d.ts.map +0 -1
- package/dist/commands/usage-command.d.ts +0 -3
- package/dist/commands/usage-command.d.ts.map +0 -1
- package/dist/commands/usage-command.js +0 -42
- package/dist/messages.d.ts.map +0 -1
- package/dist/repl/display-tool-messages.d.ts +0 -4
- package/dist/repl/display-tool-messages.d.ts.map +0 -1
- package/dist/repl/display-tool-messages.js +0 -58
- package/dist/repl/display-tool-use.d.ts +0 -14
- package/dist/repl/display-tool-use.d.ts.map +0 -1
- package/dist/repl/display-tool-use.js +0 -63
- package/dist/repl/get-prompt-header.d.ts +0 -8
- package/dist/repl/get-prompt-header.d.ts.map +0 -1
- package/dist/repl/get-prompt-header.js +0 -9
- package/dist/repl/project-status-line.d.ts +0 -2
- package/dist/repl/project-status-line.d.ts.map +0 -1
- package/dist/repl/project-status-line.js +0 -31
- package/dist/repl/prompt.d.ts +0 -21
- package/dist/repl/prompt.d.ts.map +0 -1
- package/dist/repl/prompt.js +0 -244
- package/dist/repl/tool-call-repair.d.ts +0 -4
- package/dist/repl/tool-call-repair.d.ts.map +0 -1
- package/dist/repl/tool-call-repair.js +0 -54
- package/dist/repl.d.ts +0 -29
- package/dist/repl.d.ts.map +0 -1
- package/dist/repl.js +0 -218
- package/dist/terminal/checkbox-prompt.d.ts +0 -36
- package/dist/terminal/checkbox-prompt.d.ts.map +0 -1
- package/dist/terminal/checkbox-prompt.js +0 -368
- package/dist/terminal/editor-prompt.d.ts +0 -10
- package/dist/terminal/editor-prompt.d.ts.map +0 -1
- package/dist/terminal/editor-prompt.js +0 -61
- package/dist/terminal/errors.d.ts +0 -19
- package/dist/terminal/errors.d.ts.map +0 -1
- package/dist/terminal/errors.js +0 -37
- package/dist/terminal/input-prompt.d.ts +0 -17
- package/dist/terminal/input-prompt.d.ts.map +0 -1
- package/dist/terminal/input-prompt.js +0 -181
- package/dist/terminal/markdown.d.ts +0 -2
- package/dist/terminal/markdown.d.ts.map +0 -1
- package/dist/terminal/markdown.js +0 -118
- package/dist/terminal/search-prompt.d.ts +0 -20
- package/dist/terminal/search-prompt.d.ts.map +0 -1
- package/dist/terminal/search-prompt.js +0 -280
- package/dist/terminal/types.d.ts +0 -35
- package/dist/terminal/types.d.ts.map +0 -1
- package/dist/tokens/threshold.d.ts +0 -35
- package/dist/tokens/threshold.d.ts.map +0 -1
- package/dist/tokens/threshold.js +0 -85
- package/dist/tools/advanced-edit-file.d.ts +0 -69
- package/dist/tools/advanced-edit-file.d.ts.map +0 -1
- package/dist/tools/advanced-edit-file.js +0 -281
- package/dist/tools/agent.d.ts +0 -29
- package/dist/tools/agent.d.ts.map +0 -1
- package/dist/tools/agent.js +0 -103
- package/dist/tools/bash-utils.d.ts.map +0 -1
- package/dist/tools/code-interpreter.d.ts +0 -25
- package/dist/tools/code-interpreter.d.ts.map +0 -1
- package/dist/tools/code-interpreter.js +0 -167
- package/dist/tools/delete-file.d.ts +0 -24
- package/dist/tools/delete-file.d.ts.map +0 -1
- package/dist/tools/delete-file.js +0 -70
- package/dist/tools/dynamic-tool-parser.d.ts +0 -21
- package/dist/tools/dynamic-tool-parser.d.ts.map +0 -1
- package/dist/tools/dynamic-tool-parser.js +0 -22
- package/dist/tools/filesystem-utils.d.ts.map +0 -1
- package/dist/tools/git-utils.d.ts.map +0 -1
- package/dist/tools/llm-edit-fixer.d.ts +0 -25
- package/dist/tools/llm-edit-fixer.d.ts.map +0 -1
- package/dist/tools/llm-edit-fixer.js +0 -150
- package/dist/tools/move-file.d.ts +0 -26
- package/dist/tools/move-file.d.ts.map +0 -1
- package/dist/tools/move-file.js +0 -58
- package/dist/tools/read-multiple-files.d.ts +0 -26
- package/dist/tools/read-multiple-files.d.ts.map +0 -1
- package/dist/tools/read-multiple-files.js +0 -139
- package/dist/tools/web-fetch.d.ts +0 -56
- package/dist/tools/web-fetch.d.ts.map +0 -1
- package/dist/tools/web-fetch.js +0 -247
- package/dist/tools/web-search.d.ts +0 -23
- package/dist/tools/web-search.d.ts.map +0 -1
- package/dist/tools/web-search.js +0 -133
- package/dist/tui/components/prompt-status.d.ts +0 -16
- package/dist/tui/components/prompt-status.d.ts.map +0 -1
- package/dist/tui/components/prompt-status.js +0 -21
- package/dist/utils/filesystem.d.ts.map +0 -1
- package/dist/utils/zod-utils.d.ts.map +0 -1
- package/dist/utils/zod-utils.js +0 -7
- /package/dist/{terminal → commands/add-directory}/types.js +0 -0
- /package/dist/utils/{filesystem.js → filesystem/operations.js} +0 -0
|
@@ -1,69 +1,16 @@
|
|
|
1
1
|
import { generateText } from "ai";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { createUserMessage } from "
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
async function _processAndSaveRules(newRules, terminal, config) {
|
|
11
|
-
if (!newRules || newRules.length === 0) {
|
|
12
|
-
terminal.warn("No new generalizable rules were identified.");
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
terminal.info("Generated potential rules:");
|
|
16
|
-
terminal.lineBreak();
|
|
17
|
-
const rulesToKeep = await checkbox({
|
|
18
|
-
message: "Select the rules you want to keep:",
|
|
19
|
-
choices: newRules.map((rule) => ({ name: rule, value: rule })),
|
|
20
|
-
});
|
|
21
|
-
if (rulesToKeep.length === 0) {
|
|
22
|
-
terminal.warn("No rules selected to save.");
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
terminal.info("Saving selected rules...");
|
|
26
|
-
const existingRules = await config.readProjectLearnedRulesFile();
|
|
27
|
-
const rulesToAdd = rulesToKeep.join("\n");
|
|
28
|
-
const updatedProjectRules = existingRules.endsWith("\n") || existingRules.length === 0
|
|
29
|
-
? `${existingRules}${rulesToAdd}`
|
|
30
|
-
: `${existingRules}\n${rulesToAdd}`;
|
|
31
|
-
await config.writeProjectLearnedRulesFile(updatedProjectRules);
|
|
32
|
-
terminal.success("Selected rules saved to project learned rules.");
|
|
33
|
-
terminal.lineBreak();
|
|
34
|
-
terminal.display(rulesToAdd); // Display only the saved rules
|
|
35
|
-
}
|
|
36
|
-
export const generateRulesCommand = ({ terminal, messageHistory, modelManager, tokenTracker, config, // This is the config module from CommandOptions
|
|
37
|
-
}) => {
|
|
2
|
+
import { logger } from "../../logger.js";
|
|
3
|
+
import { systemPrompt } from "../../prompts.js";
|
|
4
|
+
import { createUserMessage } from "../../sessions/manager.js";
|
|
5
|
+
import { getTerminalSize, isArrowDown, isArrowUp, isEnter, isEscape, } from "../../terminal/control.js";
|
|
6
|
+
import style from "../../terminal/style.js";
|
|
7
|
+
import { Container, Input, Spacer, Text, } from "../../tui/index.js";
|
|
8
|
+
import { hideRuleSelector } from "./utils.js";
|
|
9
|
+
export const generateRulesCommand = ({ sessionManager: messageHistory, modelManager, tokenTracker, config, workspace, }) => {
|
|
38
10
|
return {
|
|
39
11
|
command: "/generate-rules",
|
|
40
12
|
description: "Analyzes the current conversation to generate and save new interaction rules, then displays them.",
|
|
41
13
|
getSubCommands: () => Promise.resolve([]),
|
|
42
|
-
execute: async () => {
|
|
43
|
-
if (messageHistory.isEmpty()) {
|
|
44
|
-
terminal.writeln("Cannot generate rules from an empty conversation.");
|
|
45
|
-
return "continue";
|
|
46
|
-
}
|
|
47
|
-
terminal.lineBreak();
|
|
48
|
-
terminal.info("Analyzing conversation to generate rules...");
|
|
49
|
-
try {
|
|
50
|
-
const newRules = await analyzeConversation({
|
|
51
|
-
modelManager,
|
|
52
|
-
messages: messageHistory.get(),
|
|
53
|
-
tokenTracker,
|
|
54
|
-
terminal,
|
|
55
|
-
});
|
|
56
|
-
// Pass the config object available in CommandOptions scope
|
|
57
|
-
await _processAndSaveRules(newRules, terminal, config);
|
|
58
|
-
}
|
|
59
|
-
catch (error) {
|
|
60
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
61
|
-
terminal.error(`Error generating rules: ${errorMessage}`);
|
|
62
|
-
logger.error(error, "Error during rule generation:");
|
|
63
|
-
return "continue";
|
|
64
|
-
}
|
|
65
|
-
return "continue";
|
|
66
|
-
},
|
|
67
14
|
async handle(_args, { tui, container, inputContainer, editor, }) {
|
|
68
15
|
if (messageHistory.isEmpty()) {
|
|
69
16
|
container.addChild(new Text(style.yellow("Cannot generate rules from an empty conversation."), 1, 0));
|
|
@@ -78,17 +25,16 @@ export const generateRulesCommand = ({ terminal, messageHistory, modelManager, t
|
|
|
78
25
|
modelManager,
|
|
79
26
|
messages: messageHistory.get(),
|
|
80
27
|
tokenTracker,
|
|
81
|
-
|
|
28
|
+
config,
|
|
29
|
+
workspace,
|
|
82
30
|
});
|
|
83
|
-
if (
|
|
31
|
+
if (newRules == null || newRules.length === 0) {
|
|
84
32
|
container.addChild(new Text(style.yellow("No new generalizable rules were identified."), 2, 0));
|
|
85
33
|
tui.requestRender();
|
|
86
34
|
editor.setText("");
|
|
87
35
|
return "continue";
|
|
88
36
|
}
|
|
89
|
-
// Create rule selector for TUI mode
|
|
90
37
|
const ruleSelector = new RuleSelectorComponent(newRules, async (selectedRules) => {
|
|
91
|
-
// Handle rule selection
|
|
92
38
|
if (selectedRules.length === 0) {
|
|
93
39
|
container.addChild(new Text(style.yellow("No rules selected to save."), 2, 0));
|
|
94
40
|
}
|
|
@@ -110,15 +56,12 @@ export const generateRulesCommand = ({ terminal, messageHistory, modelManager, t
|
|
|
110
56
|
container.addChild(new Text(style.red(`Failed to save rules: ${error}`), 2, 0));
|
|
111
57
|
}
|
|
112
58
|
}
|
|
113
|
-
// Hide selector and show editor again
|
|
114
59
|
hideRuleSelector(inputContainer, editor, tui);
|
|
115
60
|
tui.requestRender();
|
|
116
61
|
}, () => {
|
|
117
|
-
// Cancel selection - just hide selector
|
|
118
62
|
hideRuleSelector(inputContainer, editor, tui);
|
|
119
63
|
tui.requestRender();
|
|
120
64
|
});
|
|
121
|
-
// Replace editor with rule selector
|
|
122
65
|
inputContainer.clear();
|
|
123
66
|
inputContainer.addChild(ruleSelector);
|
|
124
67
|
tui.setFocus(ruleSelector);
|
|
@@ -136,8 +79,55 @@ export const generateRulesCommand = ({ terminal, messageHistory, modelManager, t
|
|
|
136
79
|
},
|
|
137
80
|
};
|
|
138
81
|
};
|
|
139
|
-
|
|
140
|
-
const
|
|
82
|
+
async function analyzeConversation({ modelManager, messages, tokenTracker, config: configManager, workspace, }) {
|
|
83
|
+
const learnedRules = await configManager.readCachedLearnedRulesFile();
|
|
84
|
+
messages.push(createUserMessage([
|
|
85
|
+
`Analyze this conversation based on the system instructions. Identify points where the user made significant corrections revealing general principles for agent improvement. Infer concise, broadly applicable rules (Always/Never) based *only* on these corrections.
|
|
86
|
+
|
|
87
|
+
**Key Requirements:**
|
|
88
|
+
- Focus on *generalizable* rules applicable to future, different tasks.
|
|
89
|
+
- Avoid rules tied to the specifics of *this* conversation.
|
|
90
|
+
- Ensure rules don't already exist in <existing-rules>.
|
|
91
|
+
- If no *new, general* rules can be inferred, return an empty list or response.
|
|
92
|
+
- Return *only* the Markdown list of rules, with no preamble or explanation.
|
|
93
|
+
|
|
94
|
+
<existing-rules>
|
|
95
|
+
${learnedRules}
|
|
96
|
+
</existing-rules>`,
|
|
97
|
+
]));
|
|
98
|
+
const systemPromptText = await createSystemPrompt(configManager, workspace);
|
|
99
|
+
const { text, usage } = await generateText({
|
|
100
|
+
model: modelManager.getModel("conversation-analyzer"),
|
|
101
|
+
maxOutputTokens: 8192,
|
|
102
|
+
system: systemPromptText,
|
|
103
|
+
messages: messages,
|
|
104
|
+
});
|
|
105
|
+
tokenTracker.trackUsage("conversation-analyzer", usage);
|
|
106
|
+
const potentialRulesText = text.trim();
|
|
107
|
+
if (!potentialRulesText || potentialRulesText.length === 0) {
|
|
108
|
+
return [];
|
|
109
|
+
}
|
|
110
|
+
const potentialRulesList = potentialRulesText
|
|
111
|
+
.split("\n")
|
|
112
|
+
.map((rule) => rule.trim())
|
|
113
|
+
.filter((rule) => rule.length > 0);
|
|
114
|
+
if (potentialRulesList.length === 0) {
|
|
115
|
+
return [];
|
|
116
|
+
}
|
|
117
|
+
const updatedRules = learnedRules.endsWith("\n") || learnedRules.length === 0
|
|
118
|
+
? `${learnedRules}${potentialRulesList.join("\n")}`
|
|
119
|
+
: `${learnedRules}\n${potentialRulesList.join("\n")}`;
|
|
120
|
+
await configManager.writeCachedLearnedRulesFile(updatedRules);
|
|
121
|
+
return potentialRulesList;
|
|
122
|
+
}
|
|
123
|
+
async function createSystemPrompt(configManager, workspace) {
|
|
124
|
+
const projectConfig = await configManager.getConfig();
|
|
125
|
+
const sys = await systemPrompt({
|
|
126
|
+
activeTools: projectConfig.tools.activeTools,
|
|
127
|
+
includeRules: true,
|
|
128
|
+
allowedDirs: workspace.allowedDirs,
|
|
129
|
+
});
|
|
130
|
+
return `You are an expert analyst reviewing conversations between a coding agent and a software engineer. Your goal is to identify instances where the engineer corrected the agent's approach or understanding in a way that reveals a *generalizable principle* for improving the agent's future behavior across *different* tasks.
|
|
141
131
|
|
|
142
132
|
**Your Task:**
|
|
143
133
|
1. Analyze the conversation provided.
|
|
@@ -171,64 +161,9 @@ const system = async () => `You are an expert analyst reviewing conversations be
|
|
|
171
161
|
|
|
172
162
|
This is the original system prompt the agent operated under:
|
|
173
163
|
<systemPrompt>
|
|
174
|
-
${
|
|
164
|
+
${sys}
|
|
175
165
|
</systemPrompt>`;
|
|
176
|
-
async function analyzeConversation({ modelManager, messages, tokenTracker, }) {
|
|
177
|
-
const learnedRules = await config.readCachedLearnedRulesFile();
|
|
178
|
-
// Modified User Message within analyzeConversation
|
|
179
|
-
messages.push(createUserMessage([
|
|
180
|
-
`Analyze this conversation based on the system instructions. Identify points where the user made significant corrections revealing general principles for agent improvement. Infer concise, broadly applicable rules (Always/Never) based *only* on these corrections.
|
|
181
|
-
|
|
182
|
-
**Key Requirements:**
|
|
183
|
-
- Focus on *generalizable* rules applicable to future, different tasks.
|
|
184
|
-
- Avoid rules tied to the specifics of *this* conversation.
|
|
185
|
-
- Ensure rules don't already exist in <existing-rules>.
|
|
186
|
-
- If no *new, general* rules can be inferred, return an empty list or response.
|
|
187
|
-
- Return *only* the Markdown list of rules, with no preamble or explanation.
|
|
188
|
-
|
|
189
|
-
<existing-rules>
|
|
190
|
-
${learnedRules}
|
|
191
|
-
</existing-rules>`,
|
|
192
|
-
]));
|
|
193
|
-
const { text, usage } = await generateText({
|
|
194
|
-
model: modelManager.getModel("conversation-analyzer"),
|
|
195
|
-
maxOutputTokens: 8192,
|
|
196
|
-
system: await system(),
|
|
197
|
-
messages: messages,
|
|
198
|
-
});
|
|
199
|
-
tokenTracker.trackUsage("conversation-analyzer", usage);
|
|
200
|
-
// Trim whitespace and check if the response is effectively empty or just whitespace
|
|
201
|
-
const potentialRulesText = text.trim();
|
|
202
|
-
// Basic check to prevent adding empty lines or just formatting
|
|
203
|
-
if (!potentialRulesText || potentialRulesText.length === 0) {
|
|
204
|
-
return []; // Return empty array if no valid rules generated
|
|
205
|
-
}
|
|
206
|
-
// Split into individual rules, filter out empty lines
|
|
207
|
-
const potentialRulesList = potentialRulesText
|
|
208
|
-
.split("\n")
|
|
209
|
-
.map((rule) => rule.trim())
|
|
210
|
-
.filter((rule) => rule.length > 0);
|
|
211
|
-
if (potentialRulesList.length === 0) {
|
|
212
|
-
return []; // Return empty array if splitting results in no rules
|
|
213
|
-
}
|
|
214
|
-
// Further validation could be added here (e.g., check if it starts with '- ', etc.)
|
|
215
|
-
// before writing to the file.
|
|
216
|
-
// Append only if there are non-empty potential rules
|
|
217
|
-
const updatedRules = learnedRules.endsWith("\n") || learnedRules.length === 0
|
|
218
|
-
? `${learnedRules}${potentialRulesList.join("\n")}`
|
|
219
|
-
: `${learnedRules}\n${potentialRulesList.join("\n")}`;
|
|
220
|
-
await config.writeCachedLearnedRulesFile(updatedRules);
|
|
221
|
-
return potentialRulesList; // Return the list of rules that were added
|
|
222
|
-
}
|
|
223
|
-
function hideRuleSelector(editorContainer, editor, tui) {
|
|
224
|
-
// Replace selector with editor in the container
|
|
225
|
-
editorContainer.clear();
|
|
226
|
-
editorContainer.addChild(editor);
|
|
227
|
-
tui.setFocus(editor);
|
|
228
166
|
}
|
|
229
|
-
/**
|
|
230
|
-
* Component that renders a rule selector with search and multi-selection
|
|
231
|
-
*/
|
|
232
167
|
class RuleSelectorComponent extends Container {
|
|
233
168
|
searchInput;
|
|
234
169
|
listContainer;
|
|
@@ -242,31 +177,23 @@ class RuleSelectorComponent extends Container {
|
|
|
242
177
|
super();
|
|
243
178
|
this.onSelectCallback = onSelect;
|
|
244
179
|
this.onCancelCallback = onCancel;
|
|
245
|
-
// Load all rules
|
|
246
180
|
this.allRules = rules;
|
|
247
181
|
this.filteredRules = rules;
|
|
248
182
|
const { columns } = getTerminalSize();
|
|
249
|
-
// Add top border
|
|
250
183
|
this.addChild(new Text(style.blue("─".repeat(columns)), 0, 0));
|
|
251
184
|
this.addChild(new Spacer(1));
|
|
252
|
-
// Create search input
|
|
253
185
|
this.searchInput = new Input();
|
|
254
186
|
this.searchInput.onSubmit = () => {
|
|
255
|
-
// Enter on search input toggles selection of current item
|
|
256
187
|
this.toggleSelection(this.selectedIndex);
|
|
257
188
|
};
|
|
258
189
|
this.addChild(this.searchInput);
|
|
259
190
|
this.addChild(new Spacer(1));
|
|
260
|
-
// Create list container
|
|
261
191
|
this.listContainer = new Container();
|
|
262
192
|
this.addChild(this.listContainer);
|
|
263
193
|
this.addChild(new Spacer(1));
|
|
264
|
-
// Add instructions
|
|
265
194
|
this.addChild(new Text(style.dim("Space: toggle selection, Enter: confirm, Escape: cancel"), 0, 0));
|
|
266
195
|
this.addChild(new Spacer(1));
|
|
267
|
-
// Add bottom border
|
|
268
196
|
this.addChild(new Text(style.blue("─".repeat(columns)), 0, 0));
|
|
269
|
-
// Initial render
|
|
270
197
|
this.updateList();
|
|
271
198
|
}
|
|
272
199
|
filterRules(query) {
|
|
@@ -291,7 +218,6 @@ class RuleSelectorComponent extends Container {
|
|
|
291
218
|
const maxVisible = 10;
|
|
292
219
|
const startIndex = Math.max(0, Math.min(this.selectedIndex - Math.floor(maxVisible / 2), this.filteredRules.length - maxVisible));
|
|
293
220
|
const endIndex = Math.min(startIndex + maxVisible, this.filteredRules.length);
|
|
294
|
-
// Show visible slice of filtered rules
|
|
295
221
|
for (let i = startIndex; i < endIndex; i++) {
|
|
296
222
|
const rule = this.filteredRules[i];
|
|
297
223
|
if (!rule)
|
|
@@ -312,40 +238,32 @@ class RuleSelectorComponent extends Container {
|
|
|
312
238
|
}
|
|
313
239
|
this.listContainer.addChild(new Text(line, 0, 0));
|
|
314
240
|
}
|
|
315
|
-
// Add scroll indicator if needed
|
|
316
241
|
if (startIndex > 0 || endIndex < this.filteredRules.length) {
|
|
317
242
|
const scrollInfo = style.gray(` (${this.selectedIndex + 1}/${this.filteredRules.length})`);
|
|
318
243
|
this.listContainer.addChild(new Text(scrollInfo, 0, 0));
|
|
319
244
|
}
|
|
320
|
-
// Show "no results" if empty
|
|
321
245
|
if (this.filteredRules.length === 0) {
|
|
322
246
|
this.listContainer.addChild(new Text(style.gray(" No matching rules"), 0, 0));
|
|
323
247
|
}
|
|
324
248
|
}
|
|
325
249
|
handleInput(keyData) {
|
|
326
|
-
|
|
327
|
-
if (keyData === "\x1b[A") {
|
|
250
|
+
if (isArrowUp(keyData)) {
|
|
328
251
|
this.selectedIndex = Math.max(0, this.selectedIndex - 1);
|
|
329
252
|
this.updateList();
|
|
330
253
|
}
|
|
331
|
-
|
|
332
|
-
else if (keyData === "\x1b[B") {
|
|
254
|
+
else if (isArrowDown(keyData)) {
|
|
333
255
|
this.selectedIndex = Math.min(this.filteredRules.length - 1, this.selectedIndex + 1);
|
|
334
256
|
this.updateList();
|
|
335
257
|
}
|
|
336
|
-
// Space - toggle selection
|
|
337
258
|
else if (keyData === " ") {
|
|
338
259
|
this.toggleSelection(this.selectedIndex);
|
|
339
260
|
}
|
|
340
|
-
|
|
341
|
-
else if (keyData === "\r") {
|
|
261
|
+
else if (isEnter(keyData)) {
|
|
342
262
|
this.handleConfirm();
|
|
343
263
|
}
|
|
344
|
-
|
|
345
|
-
else if (keyData === "\x1b") {
|
|
264
|
+
else if (isEscape(keyData)) {
|
|
346
265
|
this.onCancelCallback();
|
|
347
266
|
}
|
|
348
|
-
// Pass everything else to search input
|
|
349
267
|
else {
|
|
350
268
|
this.searchInput.handleInput(keyData);
|
|
351
269
|
this.filterRules(this.searchInput.getValue());
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Container, Editor, TUI } from "../../tui/index.ts";
|
|
2
|
+
export declare function hideRuleSelector(editorContainer: Container, editor: Editor, tui: TUI): void;
|
|
3
|
+
export declare function parseRulesText(text: string): string[];
|
|
4
|
+
export declare function formatRulesForStorage(existingRules: string, newRules: string[]): string;
|
|
5
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../source/commands/generate-rules/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAEjE,wBAAgB,gBAAgB,CAC9B,eAAe,EAAE,SAAS,EAC1B,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,GAAG,GACP,IAAI,CAIN;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAUrD;AAED,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,EAAE,GACjB,MAAM,CAUR"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export function hideRuleSelector(editorContainer, editor, tui) {
|
|
2
|
+
editorContainer.clear();
|
|
3
|
+
editorContainer.addChild(editor);
|
|
4
|
+
tui.setFocus(editor);
|
|
5
|
+
}
|
|
6
|
+
export function parseRulesText(text) {
|
|
7
|
+
const trimmed = text.trim();
|
|
8
|
+
if (!trimmed || trimmed.length === 0) {
|
|
9
|
+
return [];
|
|
10
|
+
}
|
|
11
|
+
return trimmed
|
|
12
|
+
.split("\n")
|
|
13
|
+
.map((rule) => rule.trim())
|
|
14
|
+
.filter((rule) => rule.length > 0);
|
|
15
|
+
}
|
|
16
|
+
export function formatRulesForStorage(existingRules, newRules) {
|
|
17
|
+
if (newRules.length === 0) {
|
|
18
|
+
return existingRules;
|
|
19
|
+
}
|
|
20
|
+
const rulesToAdd = newRules.join("\n");
|
|
21
|
+
if (existingRules.endsWith("\n") || existingRules.length === 0) {
|
|
22
|
+
return `${existingRules}${rulesToAdd}`;
|
|
23
|
+
}
|
|
24
|
+
return `${existingRules}\n${rulesToAdd}`;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/commands/handoff/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAO/D,eAAO,MAAM,cAAc,GAAI,SAAS,cAAc,KAAG,WA2DxD,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
|
+
import { generateText } from "ai";
|
|
3
|
+
import { AiConfig } from "../../models/ai-config.js";
|
|
4
|
+
import style from "../../terminal/style.js";
|
|
5
|
+
import { Spacer, Text } from "../../tui/index.js";
|
|
6
|
+
import { generateHandoffFilename, generateHandoffSlug, handoffPrompt, } from "./utils.js";
|
|
7
|
+
export const handoffCommand = (options) => {
|
|
8
|
+
return {
|
|
9
|
+
command: "/handoff",
|
|
10
|
+
description: "Creates a detailed handoff plan of the conversation for continuing the work in a new session. Usage: /handoff <the purpose of the handoff>",
|
|
11
|
+
getSubCommands: () => Promise.resolve([]),
|
|
12
|
+
async handle(args, { tui, container, editor, }) {
|
|
13
|
+
const purpose = args.join(" ").trim();
|
|
14
|
+
if (!purpose) {
|
|
15
|
+
container.addChild(new Text(style.red("Please provide a purpose for the handoff. Usage: /handoff <the purpose of the handoff>"), 1, 0));
|
|
16
|
+
tui.requestRender();
|
|
17
|
+
editor.setText("");
|
|
18
|
+
return "continue";
|
|
19
|
+
}
|
|
20
|
+
container.addChild(new Spacer(1));
|
|
21
|
+
container.addChild(new Text(`Creating handoff document for purpose: ${style.blue(purpose)}`, 1, 0));
|
|
22
|
+
tui.requestRender();
|
|
23
|
+
const filename = await createHandoffDocument(options, purpose);
|
|
24
|
+
container.addChild(new Text(style.green(`Handoff document created: ${filename}`), 2, 0));
|
|
25
|
+
container.addChild(new Text(`Use /pickup ${filename.replace(".md", "")} to continue this work.`, 3, 0));
|
|
26
|
+
tui.requestRender();
|
|
27
|
+
editor.setText("");
|
|
28
|
+
return "continue";
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
async function createHandoffDocument({ modelManager, tokenTracker, sessionManager: messageHistory, }, purpose) {
|
|
33
|
+
const app = "handoff-agent";
|
|
34
|
+
const model = modelManager.getModel(app);
|
|
35
|
+
const modelConfig = modelManager.getModelMetadata(app);
|
|
36
|
+
const messages = messageHistory.get();
|
|
37
|
+
const conversationText = messages
|
|
38
|
+
.map((msg) => {
|
|
39
|
+
let content = "";
|
|
40
|
+
if (Array.isArray(msg.content)) {
|
|
41
|
+
content = msg.content
|
|
42
|
+
.filter((part) => part.type === "text")
|
|
43
|
+
.map((part) => part.text)
|
|
44
|
+
.join("\n");
|
|
45
|
+
}
|
|
46
|
+
else if (typeof msg.content === "string") {
|
|
47
|
+
content = msg.content;
|
|
48
|
+
}
|
|
49
|
+
return `${msg.role}: ${content}`;
|
|
50
|
+
})
|
|
51
|
+
.filter((text) => text?.trim())
|
|
52
|
+
.join("\n\n");
|
|
53
|
+
const fullPrompt = `${handoffPrompt(purpose)}\n\n## Conversation History\n\n${conversationText}`;
|
|
54
|
+
const aiConfig = new AiConfig({
|
|
55
|
+
modelMetadata: modelConfig,
|
|
56
|
+
prompt: fullPrompt,
|
|
57
|
+
});
|
|
58
|
+
let result;
|
|
59
|
+
try {
|
|
60
|
+
result = await generateText({
|
|
61
|
+
model,
|
|
62
|
+
maxOutputTokens: aiConfig.maxOutputTokens(),
|
|
63
|
+
system: "You are a helpful AI assistant tasked with creating detailed handoff summaries for coding agents. Focus on technical accuracy and completeness so that another agent can seamlessly continue the work.",
|
|
64
|
+
prompt: fullPrompt,
|
|
65
|
+
temperature: aiConfig.temperature(),
|
|
66
|
+
topP: aiConfig.topP(),
|
|
67
|
+
providerOptions: aiConfig.providerOptions(),
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
console.error(`Error generating handoff text: ${error}`);
|
|
72
|
+
throw new Error(`Failed to generate handoff summary: ${error.message}`);
|
|
73
|
+
}
|
|
74
|
+
const { text, usage } = result;
|
|
75
|
+
tokenTracker.trackUsage(app, usage);
|
|
76
|
+
if (!text || text.trim().length === 0) {
|
|
77
|
+
throw new Error("AI returned empty response");
|
|
78
|
+
}
|
|
79
|
+
const slug = generateHandoffSlug(purpose);
|
|
80
|
+
const filename = generateHandoffFilename(slug);
|
|
81
|
+
const handoffsDir = ".acai/handoffs";
|
|
82
|
+
const filepath = `${handoffsDir}/${filename}`;
|
|
83
|
+
const handoffDocument = `${text}
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
*Generated on ${new Date().toISOString()} for purpose: ${purpose}*
|
|
87
|
+
*This handoff file can be used to continue the work using the /pickup command*`;
|
|
88
|
+
try {
|
|
89
|
+
await mkdir(handoffsDir, { recursive: true });
|
|
90
|
+
await writeFile(filepath, handoffDocument, "utf-8");
|
|
91
|
+
return filename;
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
console.error(`Failed to save handoff file: ${error}`);
|
|
95
|
+
throw new Error(`Failed to save handoff file: ${error.message}`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../source/commands/handoff/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,GAAI,SAAS,MAAM,KAAG,MAqG/C,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,SAAS,MAAM,EACf,kBAAc,KACb,MAmBF,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,MAAM,MAAM,KAAG,MAItD,CAAC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
export const handoffPrompt = (purpose) => {
|
|
2
|
+
return `Creates a detailed handoff plan of the conversation for continuing the work in a new session.
|
|
3
|
+
|
|
4
|
+
The user specified purpose:
|
|
5
|
+
|
|
6
|
+
<purpose>${purpose}</purpose>
|
|
7
|
+
|
|
8
|
+
You are creating a summary specifically so that it can be continued by another agent. For this to work you MUST have a purpose. If no specified purpose was provided in the \`<purpose>...</purpose>\` tag you must STOP IMMEDIATELY and ask the user what the purpose is.
|
|
9
|
+
|
|
10
|
+
Do not continue before asking for the purpose as you will otherwise not understand the instructions and do not assume a purpose!
|
|
11
|
+
|
|
12
|
+
## Goal
|
|
13
|
+
|
|
14
|
+
Your task is to create a detailed summary of the conversation so far, paying close attention to the user's explicit purpose for the next steps.
|
|
15
|
+
This handoff plan should be thorough in capturing technical details, code patterns, and architectural decisions that will be essential for continuing development work without losing context.
|
|
16
|
+
|
|
17
|
+
## Process
|
|
18
|
+
|
|
19
|
+
Before providing your final plan, wrap your analysis in <analysis> tags to organize your thoughts and ensure you've covered all necessary points. In your analysis process:
|
|
20
|
+
|
|
21
|
+
1. Chronologically analyze each message and section of the conversation. For each section thoroughly identify:
|
|
22
|
+
- The user's explicit requests and intents
|
|
23
|
+
- Your approach to addressing the user's requests
|
|
24
|
+
- Key decisions, technical concepts and code patterns
|
|
25
|
+
- Specific details like file names, full code snippets, function signatures, file edits, etc
|
|
26
|
+
2. Double-check for technical accuracy and completeness, addressing each required element thoroughly.
|
|
27
|
+
|
|
28
|
+
Your plan should include the following sections:
|
|
29
|
+
|
|
30
|
+
1. **Primary Request and Intent**: Capture all of the user's explicit requests and intents in detail
|
|
31
|
+
2. **Key Technical Concepts**: List all important technical concepts, technologies, and frameworks discussed.
|
|
32
|
+
3. **Files and Code Sections**: Enumerate specific files and code sections examined, modified, or created. Pay special attention to the most recent messages and include full code snippets where applicable and include a summary of why this file read or edit is important.
|
|
33
|
+
4. **Problem Solving**: Document problems solved and any ongoing troubleshooting efforts.
|
|
34
|
+
5. **Pending Tasks**: Outline any pending tasks that you have explicitly been asked to work on.
|
|
35
|
+
6. **Current Work**: Describe in detail precisely what was being worked on immediately before this handoff request, paying special attention to the most recent messages from both user and assistant. Include file names and code snippets where applicable.
|
|
36
|
+
7. **Optional Next Step**: List the next step that you will take that is related to the most recent work you were doing. IMPORTANT: ensure that this step is DIRECTLY in line with the user's explicit requests, and the task you were working on immediately before this handoff request. If your last task was concluded, then only list next steps if they are explicitly in line with the users request. Do not start on tangential requests without confirming with the user first.
|
|
37
|
+
|
|
38
|
+
Additionally create a "slug" for this handoff. The "slug" is how we will refer to it later in a few places. Examples:
|
|
39
|
+
|
|
40
|
+
* current-user-api-handler
|
|
41
|
+
* implement-auth
|
|
42
|
+
* fix-issue-42
|
|
43
|
+
|
|
44
|
+
Together with the slug create a "Readable Summary". Examples:
|
|
45
|
+
|
|
46
|
+
* Implement Currnet User API Handler
|
|
47
|
+
* Implement Authentication
|
|
48
|
+
* Fix Issue #42
|
|
49
|
+
|
|
50
|
+
## Output Structure
|
|
51
|
+
|
|
52
|
+
Here's an example of how your output should be structured:
|
|
53
|
+
|
|
54
|
+
\`\`\` markdown
|
|
55
|
+
# Readable Summary
|
|
56
|
+
|
|
57
|
+
<analysis>
|
|
58
|
+
[Your thought process, ensuring all points are covered thoroughly and accurately]
|
|
59
|
+
</analysis>
|
|
60
|
+
|
|
61
|
+
<plan>
|
|
62
|
+
# Session Handoff Plan
|
|
63
|
+
|
|
64
|
+
## 1. Primary Request and Intent
|
|
65
|
+
[Detailed description of all user requests and intents]
|
|
66
|
+
|
|
67
|
+
## 2. Key Technical Concepts
|
|
68
|
+
- [Concept 1]
|
|
69
|
+
- [Concept 2]
|
|
70
|
+
- [...]
|
|
71
|
+
|
|
72
|
+
## 3. Files and Code Sections
|
|
73
|
+
### [File Name 1]
|
|
74
|
+
- **Why important**: [Summary of why this file is important]
|
|
75
|
+
- **Changes made**: [Summary of the changes made to this file, if any]
|
|
76
|
+
- **Code snippet**:
|
|
77
|
+
\`\`\` language
|
|
78
|
+
[Important Code Snippet]
|
|
79
|
+
\`\`\`
|
|
80
|
+
|
|
81
|
+
### [File Name 2]
|
|
82
|
+
- **Code snippet**:
|
|
83
|
+
\`\`\` language
|
|
84
|
+
[Important Code Snippet]
|
|
85
|
+
\`\`\`
|
|
86
|
+
|
|
87
|
+
[...]
|
|
88
|
+
|
|
89
|
+
## 4. Problem Solving
|
|
90
|
+
[Description of solved problems and ongoing troubleshooting]
|
|
91
|
+
|
|
92
|
+
## 5. Next Step
|
|
93
|
+
[Required next step to take, directly aligned with user's explicit handoff purpose]
|
|
94
|
+
</plan>
|
|
95
|
+
\`\`\`
|
|
96
|
+
|
|
97
|
+
## Final Step
|
|
98
|
+
|
|
99
|
+
Provide your complete handoff summary with all the sections above. The system will save it to a file automatically.
|
|
100
|
+
|
|
101
|
+
Make sure to include both the slug and readable summary in your response as described.`;
|
|
102
|
+
};
|
|
103
|
+
export const generateHandoffSlug = (purpose, maxLength = 20) => {
|
|
104
|
+
let slug = purpose
|
|
105
|
+
.toLowerCase()
|
|
106
|
+
.replace(/[^a-z0-9\s-]/g, "")
|
|
107
|
+
.replace(/\s+/g, "-")
|
|
108
|
+
.replace(/-+/g, "-")
|
|
109
|
+
.trim();
|
|
110
|
+
// Remove leading and trailing hyphens
|
|
111
|
+
slug = slug.replace(/^-+|-+$/g, "");
|
|
112
|
+
// Apply maxLength after trimming hyphens
|
|
113
|
+
slug = slug.slice(0, maxLength);
|
|
114
|
+
if (!slug) {
|
|
115
|
+
slug = "session";
|
|
116
|
+
}
|
|
117
|
+
return slug;
|
|
118
|
+
};
|
|
119
|
+
export const generateHandoffFilename = (slug) => {
|
|
120
|
+
const now = new Date();
|
|
121
|
+
const timestamp = now.toISOString().split("T")[0];
|
|
122
|
+
return `${timestamp}-${slug}.md`;
|
|
123
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/commands/health/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAQ/D,wBAAgB,aAAa,CAAC,QAAQ,EAAE,cAAc,GAAG,WAAW,CA6FnE"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Container, Modal, ModalText, TableComponent, } from "../../tui/index.js";
|
|
2
|
+
import { checkEnvironmentVariables, checkTools, formatEnvStatus, formatToolStatus, } from "./utils.js";
|
|
3
|
+
export function healthCommand(_options) {
|
|
4
|
+
return {
|
|
5
|
+
command: "/health",
|
|
6
|
+
description: "Show application health status and environment variables",
|
|
7
|
+
getSubCommands: () => Promise.resolve([]),
|
|
8
|
+
async handle(_args, { tui, editor }) {
|
|
9
|
+
const envStatus = checkEnvironmentVariables();
|
|
10
|
+
const toolStatus = checkTools();
|
|
11
|
+
const setCount = envStatus.filter((row) => row[1] === "✓ Set").length;
|
|
12
|
+
const totalCount = envStatus.length;
|
|
13
|
+
const installedCount = toolStatus.filter((row) => row[1] === "✓ Installed").length;
|
|
14
|
+
const totalTools = toolStatus.length;
|
|
15
|
+
const usage = process.memoryUsage().rss;
|
|
16
|
+
const modalContent = new Container();
|
|
17
|
+
modalContent.addChild(new ModalText("Environment Variables Status:", 0, 1));
|
|
18
|
+
modalContent.addChild(new TableComponent(formatEnvStatus(envStatus), {
|
|
19
|
+
headers: ["Variable", "Status", "Description"],
|
|
20
|
+
}));
|
|
21
|
+
const envSummary = `Summary: ${setCount}/${totalCount} environment variables are set`;
|
|
22
|
+
modalContent.addChild(new ModalText(envSummary, 0, 1));
|
|
23
|
+
if (setCount === 0) {
|
|
24
|
+
modalContent.addChild(new ModalText("⚠️ No AI provider API keys are configured. The app may not function properly.", 0, 1));
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
modalContent.addChild(new ModalText("✓ At least one AI provider is configured.", 0, 1));
|
|
28
|
+
}
|
|
29
|
+
modalContent.addChild(new ModalText("", 0, 1));
|
|
30
|
+
modalContent.addChild(new ModalText("Bash Tools Status:", 0, 1));
|
|
31
|
+
modalContent.addChild(new TableComponent(formatToolStatus(toolStatus), {
|
|
32
|
+
headers: ["Tool", "Status"],
|
|
33
|
+
}));
|
|
34
|
+
const toolSummary = `Tool Summary: ${installedCount}/${totalTools} tools are installed.`;
|
|
35
|
+
modalContent.addChild(new ModalText(toolSummary, 0, 1));
|
|
36
|
+
if (installedCount < totalTools) {
|
|
37
|
+
modalContent.addChild(new ModalText("⚠️ Some tools are missing. Install them for full functionality.", 0, 1));
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
modalContent.addChild(new ModalText("✓ All required tools are installed.", 0, 1));
|
|
41
|
+
}
|
|
42
|
+
modalContent.addChild(new ModalText("", 0, 1));
|
|
43
|
+
modalContent.addChild(new ModalText("Current Process:", 0, 1));
|
|
44
|
+
const { formatMemoryUsage } = await import("../../formatting.js");
|
|
45
|
+
const formattedUsage = formatMemoryUsage(usage);
|
|
46
|
+
const memoryText = `Memory Usage: ${formattedUsage}`;
|
|
47
|
+
modalContent.addChild(new ModalText(memoryText, 0, 1));
|
|
48
|
+
const modal = new Modal("Health Status", modalContent, true, () => {
|
|
49
|
+
editor.setText("");
|
|
50
|
+
tui.requestRender();
|
|
51
|
+
});
|
|
52
|
+
tui.showModal(modal);
|
|
53
|
+
return "continue";
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
}
|