@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,13 +1,9 @@
|
|
|
1
|
+
import { id } from "../utils/funcs.js";
|
|
1
2
|
import style from "./style.js";
|
|
2
|
-
/**
|
|
3
|
-
* Identity function for tokens that should not be styled (returns the input string as-is).
|
|
4
|
-
* See [[Theme]] for an example.
|
|
5
|
-
*/
|
|
6
|
-
const plain = (codePart) => codePart;
|
|
7
3
|
/**
|
|
8
4
|
* The default theme. It is possible to override just individual keys.
|
|
9
5
|
*/
|
|
10
|
-
export const
|
|
6
|
+
export const DEFAULT_HIGHLIGHT_THEME = {
|
|
11
7
|
/**
|
|
12
8
|
* keyword in a regular Algol-style language
|
|
13
9
|
*/
|
|
@@ -41,11 +37,11 @@ export const DEFAULT_THEME = {
|
|
|
41
37
|
/**
|
|
42
38
|
* parsed section inside a literal string
|
|
43
39
|
*/
|
|
44
|
-
subst:
|
|
40
|
+
subst: id,
|
|
45
41
|
/**
|
|
46
42
|
* symbolic constant, interned string, goto label
|
|
47
43
|
*/
|
|
48
|
-
symbol:
|
|
44
|
+
symbol: id,
|
|
49
45
|
/**
|
|
50
46
|
* class or class-level declaration (interfaces, traits, modules, etc)
|
|
51
47
|
*/
|
|
@@ -57,11 +53,11 @@ export const DEFAULT_THEME = {
|
|
|
57
53
|
/**
|
|
58
54
|
* name of a class or a function at the place of declaration
|
|
59
55
|
*/
|
|
60
|
-
title:
|
|
56
|
+
title: id,
|
|
61
57
|
/**
|
|
62
58
|
* block of function arguments (parameters) at the place of declaration
|
|
63
59
|
*/
|
|
64
|
-
params:
|
|
60
|
+
params: id,
|
|
65
61
|
/**
|
|
66
62
|
* comment
|
|
67
63
|
*/
|
|
@@ -77,15 +73,15 @@ export const DEFAULT_THEME = {
|
|
|
77
73
|
/**
|
|
78
74
|
* keyword or built-in within meta construct
|
|
79
75
|
*/
|
|
80
|
-
"meta-keyword":
|
|
76
|
+
"meta-keyword": id,
|
|
81
77
|
/**
|
|
82
78
|
* string within meta construct
|
|
83
79
|
*/
|
|
84
|
-
"meta-string":
|
|
80
|
+
"meta-string": id,
|
|
85
81
|
/**
|
|
86
82
|
* heading of a section in a config file, heading in text markup
|
|
87
83
|
*/
|
|
88
|
-
section:
|
|
84
|
+
section: id,
|
|
89
85
|
/**
|
|
90
86
|
* XML/HTML tag
|
|
91
87
|
*/
|
|
@@ -97,7 +93,7 @@ export const DEFAULT_THEME = {
|
|
|
97
93
|
/**
|
|
98
94
|
* s-expression name from the language standard library
|
|
99
95
|
*/
|
|
100
|
-
"builtin-name":
|
|
96
|
+
"builtin-name": id,
|
|
101
97
|
/**
|
|
102
98
|
* name of an attribute with no language defined semantics (keys in JSON, setting names in
|
|
103
99
|
* .ini), also sub-attribute within another highlighted object, like XML tag
|
|
@@ -106,19 +102,19 @@ export const DEFAULT_THEME = {
|
|
|
106
102
|
/**
|
|
107
103
|
* name of an attribute followed by a structured value part, like CSS properties
|
|
108
104
|
*/
|
|
109
|
-
attribute:
|
|
105
|
+
attribute: id,
|
|
110
106
|
/**
|
|
111
107
|
* variable in a config or a template file, environment var expansion in a script
|
|
112
108
|
*/
|
|
113
|
-
variable:
|
|
109
|
+
variable: id,
|
|
114
110
|
/**
|
|
115
111
|
* list item bullet in text markup
|
|
116
112
|
*/
|
|
117
|
-
bullet:
|
|
113
|
+
bullet: id,
|
|
118
114
|
/**
|
|
119
115
|
* code block in text markup
|
|
120
116
|
*/
|
|
121
|
-
code:
|
|
117
|
+
code: id,
|
|
122
118
|
/**
|
|
123
119
|
* emphasis in text markup
|
|
124
120
|
*/
|
|
@@ -130,7 +126,7 @@ export const DEFAULT_THEME = {
|
|
|
130
126
|
/**
|
|
131
127
|
* mathematical formula in text markup
|
|
132
128
|
*/
|
|
133
|
-
formula:
|
|
129
|
+
formula: id,
|
|
134
130
|
/**
|
|
135
131
|
* hyperlink in text markup
|
|
136
132
|
*/
|
|
@@ -138,35 +134,35 @@ export const DEFAULT_THEME = {
|
|
|
138
134
|
/**
|
|
139
135
|
* quotation in text markup
|
|
140
136
|
*/
|
|
141
|
-
quote:
|
|
137
|
+
quote: id,
|
|
142
138
|
/**
|
|
143
139
|
* tag selector in CSS
|
|
144
140
|
*/
|
|
145
|
-
"selector-tag":
|
|
141
|
+
"selector-tag": id,
|
|
146
142
|
/**
|
|
147
143
|
* #id selector in CSS
|
|
148
144
|
*/
|
|
149
|
-
"selector-id":
|
|
145
|
+
"selector-id": id,
|
|
150
146
|
/**
|
|
151
147
|
* .class selector in CSS
|
|
152
148
|
*/
|
|
153
|
-
"selector-class":
|
|
149
|
+
"selector-class": id,
|
|
154
150
|
/**
|
|
155
151
|
* [attr] selector in CSS
|
|
156
152
|
*/
|
|
157
|
-
"selector-attr":
|
|
153
|
+
"selector-attr": id,
|
|
158
154
|
/**
|
|
159
155
|
* :pseudo selector in CSS
|
|
160
156
|
*/
|
|
161
|
-
"selector-pseudo":
|
|
157
|
+
"selector-pseudo": id,
|
|
162
158
|
/**
|
|
163
159
|
* tag of a template language
|
|
164
160
|
*/
|
|
165
|
-
"template-tag":
|
|
161
|
+
"template-tag": id,
|
|
166
162
|
/**
|
|
167
163
|
* variable in a template language
|
|
168
164
|
*/
|
|
169
|
-
"template-variable":
|
|
165
|
+
"template-variable": id,
|
|
170
166
|
/**
|
|
171
167
|
* added or changed line in a diff
|
|
172
168
|
*/
|
|
@@ -178,5 +174,5 @@ export const DEFAULT_THEME = {
|
|
|
178
174
|
/**
|
|
179
175
|
* things not matched by any token
|
|
180
176
|
*/
|
|
181
|
-
default:
|
|
177
|
+
default: id,
|
|
182
178
|
};
|
|
@@ -1,38 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Create a horizontal rule
|
|
3
3
|
*/
|
|
4
|
-
export declare function
|
|
5
|
-
/**
|
|
6
|
-
* Clear the terminal screen including scrollback buffer
|
|
7
|
-
*
|
|
8
|
-
* Unlike clearScreen, this function:
|
|
9
|
-
* 1. Clears the entire screen (\x1b[2J)
|
|
10
|
-
* 2. Clears the scrollback buffer (\x1b[3J)
|
|
11
|
-
* 3. Moves cursor to home position (\x1b[H)
|
|
12
|
-
* 4. Returns a Promise that resolves when the write operation completes
|
|
13
|
-
*
|
|
14
|
-
* @returns Promise that resolves when the terminal has been cleared
|
|
15
|
-
*/
|
|
16
|
-
export declare function clearTerminal(): Promise<void>;
|
|
17
|
-
/**
|
|
18
|
-
* Sets the terminal title
|
|
19
|
-
*/
|
|
20
|
-
export declare function setTerminalTitle(title: string): void;
|
|
21
|
-
/**
|
|
22
|
-
* Get the terminal size (rows and columns)
|
|
23
|
-
*/
|
|
24
|
-
export declare function getTerminalSize(): {
|
|
25
|
-
rows: number;
|
|
26
|
-
columns: number;
|
|
27
|
-
};
|
|
4
|
+
export declare function hr(width: number): string;
|
|
28
5
|
/**
|
|
29
6
|
* Word wrap text to the specified width
|
|
30
7
|
*/
|
|
31
8
|
export declare function wordWrap(text: string, width: number): string;
|
|
32
|
-
export declare const link: (text: string, url: string) => string;
|
|
9
|
+
export declare const link: (text: string, url: string) => string | null;
|
|
33
10
|
export declare const image: (data: string | Buffer, options?: {
|
|
34
11
|
width?: number | string;
|
|
35
12
|
height?: number | string;
|
|
36
13
|
preserveAspectRatio?: boolean;
|
|
37
14
|
}) => string;
|
|
15
|
+
/**
|
|
16
|
+
* Display a message with emphasis
|
|
17
|
+
*/
|
|
18
|
+
export declare function emphasize(message: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Display an informational message
|
|
21
|
+
*/
|
|
22
|
+
export declare function info(message: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Display a success message
|
|
25
|
+
*/
|
|
26
|
+
export declare function success(message: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* Display a warning message
|
|
29
|
+
*/
|
|
30
|
+
export declare function warn(message: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Display an error message
|
|
33
|
+
*/
|
|
34
|
+
export declare function error(message: string): string;
|
|
38
35
|
//# sourceMappingURL=formatting.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../source/terminal/formatting.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../source/terminal/formatting.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,wBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,UAE/B;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAI5D;AA2CD,eAAO,MAAM,IAAI,GAAI,MAAM,MAAM,EAAE,KAAK,MAAM,kBAO7C,CAAC;AAEF,eAAO,MAAM,KAAK,GAChB,MAAM,MAAM,GAAG,MAAM,EACrB,UAAS;IACP,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC1B,WAiBP,CAAC;AAEF;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE7C"}
|
|
@@ -3,61 +3,13 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Provides functions for formatting and displaying text in the terminal.
|
|
5
5
|
*/
|
|
6
|
+
import style from "./style.js";
|
|
6
7
|
import { supportsHyperlinks } from "./supports-hyperlinks.js";
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
+
* Create a horizontal rule
|
|
9
10
|
*/
|
|
10
|
-
export function
|
|
11
|
-
|
|
12
|
-
process.stdout.write("\x1b[2J\x1b[0f");
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Clear the terminal screen including scrollback buffer
|
|
16
|
-
*
|
|
17
|
-
* Unlike clearScreen, this function:
|
|
18
|
-
* 1. Clears the entire screen (\x1b[2J)
|
|
19
|
-
* 2. Clears the scrollback buffer (\x1b[3J)
|
|
20
|
-
* 3. Moves cursor to home position (\x1b[H)
|
|
21
|
-
* 4. Returns a Promise that resolves when the write operation completes
|
|
22
|
-
*
|
|
23
|
-
* @returns Promise that resolves when the terminal has been cleared
|
|
24
|
-
*/
|
|
25
|
-
export function clearTerminal() {
|
|
26
|
-
return new Promise((resolve) => {
|
|
27
|
-
process.stdout.write("\x1b[2J\x1b[3J\x1b[H", () => {
|
|
28
|
-
resolve();
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Sets the terminal title
|
|
34
|
-
*/
|
|
35
|
-
export function setTerminalTitle(title) {
|
|
36
|
-
if (process.platform === "win32") {
|
|
37
|
-
process.title = title ? `✳✳ ${title}` : title;
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
process.stdout.write(`\x1b]0;${title ? `✳✳ ${title}` : ""}\x07`);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Get the terminal size (rows and columns)
|
|
45
|
-
*/
|
|
46
|
-
export function getTerminalSize() {
|
|
47
|
-
// Default to a reasonable size if we can't determine the actual size
|
|
48
|
-
const defaultSize = { rows: 24, columns: 80 };
|
|
49
|
-
try {
|
|
50
|
-
if (process.stdout.isTTY) {
|
|
51
|
-
return {
|
|
52
|
-
rows: process.stdout.rows || defaultSize.rows,
|
|
53
|
-
columns: process.stdout.columns || defaultSize.columns,
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
catch (_error) {
|
|
58
|
-
// Ignore errors
|
|
59
|
-
}
|
|
60
|
-
return defaultSize;
|
|
11
|
+
export function hr(width) {
|
|
12
|
+
return `${style.gray("─").repeat(width)}`;
|
|
61
13
|
}
|
|
62
14
|
/**
|
|
63
15
|
* Word wrap text to the specified width
|
|
@@ -107,7 +59,7 @@ export const link = (text, url) => {
|
|
|
107
59
|
if (supportsHyperlinks.stdout) {
|
|
108
60
|
return [OSC, "8", SEP, SEP, url, BEL, text, OSC, "8", SEP, SEP, BEL].join("");
|
|
109
61
|
}
|
|
110
|
-
return
|
|
62
|
+
return null;
|
|
111
63
|
};
|
|
112
64
|
export const image = (data, options = {}) => {
|
|
113
65
|
let returnValue = `${OSC}1337;File=inline=1`;
|
|
@@ -122,3 +74,33 @@ export const image = (data, options = {}) => {
|
|
|
122
74
|
}
|
|
123
75
|
return `${returnValue}:${Buffer.from(data).toString("base64")}${BEL}`;
|
|
124
76
|
};
|
|
77
|
+
/**
|
|
78
|
+
* Display a message with emphasis
|
|
79
|
+
*/
|
|
80
|
+
export function emphasize(message) {
|
|
81
|
+
return style.cyan.bold(message);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Display an informational message
|
|
85
|
+
*/
|
|
86
|
+
export function info(message) {
|
|
87
|
+
return style.blue(`ℹ ${message}`);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Display a success message
|
|
91
|
+
*/
|
|
92
|
+
export function success(message) {
|
|
93
|
+
return style.green(`✓ ${message}`);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Display a warning message
|
|
97
|
+
*/
|
|
98
|
+
export function warn(message) {
|
|
99
|
+
return style.yellow(`⚠ ${message}`);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Display an error message
|
|
103
|
+
*/
|
|
104
|
+
export function error(message) {
|
|
105
|
+
return style.red(`✗ ${message}`);
|
|
106
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/terminal/highlight/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/terminal/highlight/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAoDxC;;GAEG;AACH,UAAU,gBAAgB;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B;;;OAGG;IACH,KAAK,EAAE,KAAK,CAAC;CACd;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAWzE;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,EAAE,CAExC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import hljs from "highlight.js";
|
|
2
2
|
import * as parse5 from "parse5";
|
|
3
3
|
import { adapter as htmlparser2Adapter } from "parse5-htmlparser2-tree-adapter";
|
|
4
|
-
|
|
5
|
-
* Identity function for tokens that should not be styled (returns the input string as-is).
|
|
6
|
-
*/
|
|
7
|
-
const plain = (codePart) => codePart;
|
|
4
|
+
import { id } from "../../utils/funcs.js";
|
|
8
5
|
function colorizeNode(node, theme, context) {
|
|
9
6
|
switch (node.type) {
|
|
10
7
|
case "text": {
|
|
11
8
|
const text = node.data;
|
|
12
9
|
if (context === undefined) {
|
|
13
|
-
return (theme.default ||
|
|
10
|
+
return (theme.default || id)(text);
|
|
14
11
|
}
|
|
15
12
|
return text;
|
|
16
13
|
}
|
|
@@ -24,7 +21,7 @@ function colorizeNode(node, theme, context) {
|
|
|
24
21
|
?.map((childNode) => colorizeNode(childNode, theme, token))
|
|
25
22
|
.join("") || "";
|
|
26
23
|
const themeToken = theme[token];
|
|
27
|
-
const themeFn = themeToken ||
|
|
24
|
+
const themeFn = themeToken || id;
|
|
28
25
|
return themeFn(nodeData);
|
|
29
26
|
}
|
|
30
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../source/terminal/highlight/theme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../source/terminal/highlight/theme.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
+
import { id } from "../../utils/funcs.js";
|
|
1
2
|
import style from "../style.js";
|
|
2
|
-
/**
|
|
3
|
-
* Identity function for tokens that should not be styled (returns the input string as-is).
|
|
4
|
-
* See [[Theme]] for an example.
|
|
5
|
-
*/
|
|
6
|
-
const plain = (codePart) => codePart;
|
|
7
3
|
/**
|
|
8
4
|
* Converts a [[JsonTheme]] with string values to a [[Theme]] with formatter functions. Used by [[parse]].
|
|
9
5
|
*/
|
|
@@ -16,7 +12,7 @@ function fromJson(json) {
|
|
|
16
12
|
// biome-ignore lint/suspicious/noExplicitAny: Dynamic theme access needed for highlight compatibility
|
|
17
13
|
theme[key] = styleValue.reduce((previous, current) =>
|
|
18
14
|
// biome-ignore lint/suspicious/noExplicitAny: Dynamic theme access needed for highlight compatibility
|
|
19
|
-
current === "plain" ?
|
|
15
|
+
current === "plain" ? id : previous[current], style);
|
|
20
16
|
}
|
|
21
17
|
else {
|
|
22
18
|
// biome-ignore lint/suspicious/noExplicitAny: Dynamic theme access needed for highlight compatibility
|
package/dist/terminal/index.d.ts
CHANGED
|
@@ -4,105 +4,6 @@
|
|
|
4
4
|
* Provides a user interface for interacting with Claude Code in the terminal.
|
|
5
5
|
* Handles input/output, formatting, and display.
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export declare function getShell(): string;
|
|
10
|
-
export declare function hr(width: number): string;
|
|
11
|
-
export declare function table(data: (string | number)[][], options: {
|
|
12
|
-
header?: string[];
|
|
13
|
-
colWidths?: number[];
|
|
14
|
-
width: number;
|
|
15
|
-
}): string;
|
|
16
|
-
export declare function displayProgressBar(current: number, total: number, width: number): string;
|
|
17
|
-
/**
|
|
18
|
-
* Initialize the terminal interface
|
|
19
|
-
*/
|
|
20
|
-
export declare function initTerminal(config?: Partial<TerminalConfig>): Terminal;
|
|
21
|
-
/**
|
|
22
|
-
* Terminal class for handling user interaction
|
|
23
|
-
*/
|
|
24
|
-
export declare class Terminal {
|
|
25
|
-
private config;
|
|
26
|
-
private terminalWidth;
|
|
27
|
-
private terminalHeight;
|
|
28
|
-
private isInteractive;
|
|
29
|
-
constructor(config: TerminalConfig);
|
|
30
|
-
/**
|
|
31
|
-
* Detect terminal capabilities
|
|
32
|
-
*/
|
|
33
|
-
detectCapabilities(): void;
|
|
34
|
-
setTitle(title: string): void;
|
|
35
|
-
getLogo(): string;
|
|
36
|
-
/**
|
|
37
|
-
* Display the welcome message
|
|
38
|
-
*/
|
|
39
|
-
displayWelcome(): void;
|
|
40
|
-
/**
|
|
41
|
-
* Clear the terminal screen
|
|
42
|
-
*/
|
|
43
|
-
clear(): void;
|
|
44
|
-
/**
|
|
45
|
-
* Start progress indicator in terminal
|
|
46
|
-
* Sends terminal escape sequence to show progress animation
|
|
47
|
-
*/
|
|
48
|
-
startProgress(): void;
|
|
49
|
-
/**
|
|
50
|
-
* Stop progress indicator in terminal
|
|
51
|
-
* Sends terminal escape sequence to hide progress animation
|
|
52
|
-
*/
|
|
53
|
-
stopProgress(): void;
|
|
54
|
-
/**
|
|
55
|
-
* Display formatted content
|
|
56
|
-
*/
|
|
57
|
-
display(content: string, wrap?: boolean): void;
|
|
58
|
-
/**
|
|
59
|
-
* Display a message with emphasis
|
|
60
|
-
*/
|
|
61
|
-
emphasize(message: string): void;
|
|
62
|
-
/**
|
|
63
|
-
* Display an informational message
|
|
64
|
-
*/
|
|
65
|
-
info(message: string): void;
|
|
66
|
-
/**
|
|
67
|
-
* Display a success message
|
|
68
|
-
*/
|
|
69
|
-
success(message: string): void;
|
|
70
|
-
/**
|
|
71
|
-
* Display a warning message
|
|
72
|
-
*/
|
|
73
|
-
warn(message: string): void;
|
|
74
|
-
/**
|
|
75
|
-
* Display an error message
|
|
76
|
-
*/
|
|
77
|
-
error(message: string): void;
|
|
78
|
-
/**
|
|
79
|
-
* Emits an alert.
|
|
80
|
-
*/
|
|
81
|
-
alert(): void;
|
|
82
|
-
write(input: string): void;
|
|
83
|
-
writeln(input: string): void;
|
|
84
|
-
lineBreak(): void;
|
|
85
|
-
header(header: string, styleFn?: StyleInstance): void;
|
|
86
|
-
box(header: string, content: string): Promise<void>;
|
|
87
|
-
hr(styleFn?: StyleInstance): void;
|
|
88
|
-
/**
|
|
89
|
-
* Create a clickable link in the terminal if supported
|
|
90
|
-
*/
|
|
91
|
-
link(text: string, url: string): string;
|
|
92
|
-
/**
|
|
93
|
-
* Display a table of data
|
|
94
|
-
*/
|
|
95
|
-
table(data: (string | number)[][], options?: {
|
|
96
|
-
header?: string[];
|
|
97
|
-
colWidths?: number[];
|
|
98
|
-
}): void;
|
|
99
|
-
/**
|
|
100
|
-
* Displays a horizontal progress bar in the console.
|
|
101
|
-
* @param current The current value.
|
|
102
|
-
* @param total The target value.
|
|
103
|
-
*/
|
|
104
|
-
displayProgressBar(current: number, total: number): void;
|
|
105
|
-
private formatMarkdown;
|
|
106
|
-
}
|
|
107
|
-
export * from "./types.ts";
|
|
7
|
+
export { alert, getShell, isInteractive } from "./control.ts";
|
|
8
|
+
export { emphasize, error, hr, info, success, warn } from "./formatting.ts";
|
|
108
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/terminal/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/terminal/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC"}
|