@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,9 +1,11 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
2
|
import EventEmitter from "node:events";
|
|
3
|
-
import { readdir, readFile, stat, writeFile } from "node:fs/promises";
|
|
3
|
+
import { mkdir, readdir, readFile, rename, stat, unlink, writeFile, } from "node:fs/promises";
|
|
4
4
|
import { basename, join } from "node:path";
|
|
5
5
|
import { isString } from "@travisennis/stdlib/typeguards";
|
|
6
6
|
import { generateText, } from "ai";
|
|
7
|
+
import { dedent } from "../dedent.js";
|
|
8
|
+
import { logger } from "../logger.js";
|
|
7
9
|
export function createUserMessage(contentItems, prompt) {
|
|
8
10
|
const messageParts = [];
|
|
9
11
|
// Process content items (images and pre-defined texts)
|
|
@@ -37,7 +39,7 @@ function createAssistantMessage(content) {
|
|
|
37
39
|
],
|
|
38
40
|
};
|
|
39
41
|
}
|
|
40
|
-
export class
|
|
42
|
+
export class SessionManager extends EventEmitter {
|
|
41
43
|
history;
|
|
42
44
|
sessionId;
|
|
43
45
|
modelId;
|
|
@@ -45,17 +47,19 @@ export class MessageHistory extends EventEmitter {
|
|
|
45
47
|
createdAt;
|
|
46
48
|
updatedAt;
|
|
47
49
|
stateDir;
|
|
50
|
+
contextWindow;
|
|
48
51
|
modelManager;
|
|
49
52
|
tokenTracker;
|
|
50
53
|
constructor({ stateDir, modelManager, tokenTracker, }) {
|
|
51
54
|
super();
|
|
52
55
|
this.history = [];
|
|
53
56
|
this.sessionId = randomUUID();
|
|
54
|
-
this.modelId = "";
|
|
57
|
+
this.modelId = modelManager.getModel("repl").modelId;
|
|
55
58
|
this.title = "";
|
|
56
59
|
this.createdAt = new Date();
|
|
57
60
|
this.updatedAt = new Date();
|
|
58
61
|
this.stateDir = stateDir;
|
|
62
|
+
this.contextWindow = 0;
|
|
59
63
|
this.modelManager = modelManager;
|
|
60
64
|
this.tokenTracker = tokenTracker;
|
|
61
65
|
}
|
|
@@ -67,6 +71,9 @@ export class MessageHistory extends EventEmitter {
|
|
|
67
71
|
this.createdAt = new Date();
|
|
68
72
|
this.updatedAt = new Date();
|
|
69
73
|
}
|
|
74
|
+
setModelId(modelId) {
|
|
75
|
+
this.modelId = modelId;
|
|
76
|
+
}
|
|
70
77
|
validMessage(msg) {
|
|
71
78
|
// Filter out messages with empty content arrays
|
|
72
79
|
if (Array.isArray(msg.content) && msg.content.length === 0) {
|
|
@@ -87,8 +94,18 @@ export class MessageHistory extends EventEmitter {
|
|
|
87
94
|
}
|
|
88
95
|
clear() {
|
|
89
96
|
this.history.length = 0;
|
|
97
|
+
this.contextWindow = 0;
|
|
90
98
|
this.emit("clear-history");
|
|
91
99
|
}
|
|
100
|
+
setContextWindow(contextWindow) {
|
|
101
|
+
if (contextWindow < 0) {
|
|
102
|
+
throw new Error("Context window cannot be negative");
|
|
103
|
+
}
|
|
104
|
+
this.contextWindow = contextWindow;
|
|
105
|
+
}
|
|
106
|
+
getContextWindow() {
|
|
107
|
+
return this.contextWindow;
|
|
108
|
+
}
|
|
92
109
|
appendUserMessage(msg) {
|
|
93
110
|
const now = new Date();
|
|
94
111
|
const msgObj = isString(msg) ? createUserMessage([], msg) : msg;
|
|
@@ -97,7 +114,7 @@ export class MessageHistory extends EventEmitter {
|
|
|
97
114
|
msgObj.content.length > 0) {
|
|
98
115
|
const textPart = msgObj.content.at(-1);
|
|
99
116
|
if (textPart?.text && textPart.text.trim() !== "") {
|
|
100
|
-
this.generateTitle(textPart.text);
|
|
117
|
+
void this.generateTitle(textPart.text);
|
|
101
118
|
}
|
|
102
119
|
this.createdAt = now;
|
|
103
120
|
}
|
|
@@ -126,6 +143,14 @@ export class MessageHistory extends EventEmitter {
|
|
|
126
143
|
const msgHistoryDir = this.stateDir;
|
|
127
144
|
const fileName = `message-history-${this.sessionId}.json`;
|
|
128
145
|
const filePath = join(msgHistoryDir, fileName);
|
|
146
|
+
const tempFilePath = `${filePath}.tmp`;
|
|
147
|
+
// Validate data before writing
|
|
148
|
+
if (!this.sessionId || this.sessionId.trim() === "") {
|
|
149
|
+
throw new Error("Cannot save: sessionId is empty");
|
|
150
|
+
}
|
|
151
|
+
if (!Array.isArray(this.history)) {
|
|
152
|
+
throw new Error("Cannot save: history is not an array");
|
|
153
|
+
}
|
|
129
154
|
const project = basename(process.cwd());
|
|
130
155
|
const output = {
|
|
131
156
|
project,
|
|
@@ -136,7 +161,35 @@ export class MessageHistory extends EventEmitter {
|
|
|
136
161
|
updatedAt: this.updatedAt,
|
|
137
162
|
messages: this.history,
|
|
138
163
|
};
|
|
139
|
-
|
|
164
|
+
try {
|
|
165
|
+
// Ensure directory exists
|
|
166
|
+
await mkdir(msgHistoryDir, { recursive: true });
|
|
167
|
+
// Write to temporary file first
|
|
168
|
+
await writeFile(tempFilePath, JSON.stringify(output, null, 2));
|
|
169
|
+
// Atomically rename to final file
|
|
170
|
+
await rename(tempFilePath, filePath);
|
|
171
|
+
logger.info(`Message history saved to ${filePath}`);
|
|
172
|
+
}
|
|
173
|
+
catch (error) {
|
|
174
|
+
// Clean up temp file if it exists
|
|
175
|
+
try {
|
|
176
|
+
await unlink(tempFilePath);
|
|
177
|
+
}
|
|
178
|
+
catch (_cleanupError) {
|
|
179
|
+
// Ignore cleanup errors
|
|
180
|
+
}
|
|
181
|
+
// Check if it's an ENOENT error from rename (temp file doesn't exist)
|
|
182
|
+
if (error instanceof Error &&
|
|
183
|
+
"code" in error &&
|
|
184
|
+
error.code === "ENOENT") {
|
|
185
|
+
logger.warn(`Temp file missing during save for ${filePath}, write may have been interrupted`);
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
logger.error(error, `Failed to save message history to ${filePath}:`);
|
|
189
|
+
// Don't throw - just log. This is called from interrupt handlers
|
|
190
|
+
// and we don't want to crash the program on save failure.
|
|
191
|
+
}
|
|
192
|
+
}
|
|
140
193
|
}
|
|
141
194
|
async generateTitle(message) {
|
|
142
195
|
// Skip title generation if message is empty
|
|
@@ -144,23 +197,49 @@ export class MessageHistory extends EventEmitter {
|
|
|
144
197
|
return;
|
|
145
198
|
}
|
|
146
199
|
const app = "title-conversation";
|
|
147
|
-
const systemPrompt =
|
|
200
|
+
const systemPrompt = dedent `
|
|
201
|
+
You are an assistant who is tasked to analyze messages to generate a conversation topic that can be used as a conversation title. For each message, generate a short title that captures the topic. Return only the title with no other text.
|
|
202
|
+
|
|
203
|
+
## Examples:
|
|
204
|
+
|
|
205
|
+
<example>
|
|
206
|
+
Message:
|
|
207
|
+
How do I implement authentication in my Express app?
|
|
208
|
+
|
|
209
|
+
Title:
|
|
210
|
+
Express Authentication Implementation
|
|
211
|
+
</example>
|
|
212
|
+
|
|
213
|
+
<example>
|
|
214
|
+
Message:
|
|
215
|
+
Can you help me debug this React component that isn't rendering correctly?
|
|
216
|
+
|
|
217
|
+
Title:
|
|
218
|
+
React Component Rendering Debug";
|
|
219
|
+
</example>
|
|
220
|
+
`;
|
|
221
|
+
let title = "";
|
|
148
222
|
try {
|
|
149
|
-
const
|
|
150
|
-
|
|
223
|
+
const model = this.modelManager.getModel(app);
|
|
224
|
+
const result = await generateText({
|
|
225
|
+
model,
|
|
151
226
|
system: systemPrompt,
|
|
152
|
-
|
|
153
|
-
prompt: `Request:\n${message}\nTitle:`,
|
|
227
|
+
prompt: `Message:\n${message}\n\nTitle:`,
|
|
154
228
|
});
|
|
155
|
-
this.tokenTracker.trackUsage(app, usage);
|
|
156
|
-
if (text && text.
|
|
157
|
-
|
|
158
|
-
this.
|
|
229
|
+
this.tokenTracker.trackUsage(app, result.usage);
|
|
230
|
+
if (result.text && result.text.length > 0) {
|
|
231
|
+
title = result.text;
|
|
232
|
+
this.title = title;
|
|
159
233
|
}
|
|
160
234
|
}
|
|
161
235
|
catch (error) {
|
|
162
|
-
|
|
236
|
+
logger.error(error, "[generateTitle] Failed to generate conversation title:");
|
|
163
237
|
}
|
|
238
|
+
if (title.length === 0) {
|
|
239
|
+
this.title =
|
|
240
|
+
message.slice(0, 50).trim() + (message.length > 50 ? "..." : "");
|
|
241
|
+
}
|
|
242
|
+
this.emit("update-title", this.title);
|
|
164
243
|
}
|
|
165
244
|
getFirstUserMessage() {
|
|
166
245
|
const firstUser = this.get().find((msg) => msg.role === "user");
|
|
@@ -202,6 +281,22 @@ export class MessageHistory extends EventEmitter {
|
|
|
202
281
|
}
|
|
203
282
|
return null;
|
|
204
283
|
}
|
|
284
|
+
// Getter methods for session information
|
|
285
|
+
getSessionId() {
|
|
286
|
+
return this.sessionId;
|
|
287
|
+
}
|
|
288
|
+
getModelId() {
|
|
289
|
+
return this.modelId;
|
|
290
|
+
}
|
|
291
|
+
getTitle() {
|
|
292
|
+
return this.title;
|
|
293
|
+
}
|
|
294
|
+
getCreatedAt() {
|
|
295
|
+
return this.createdAt;
|
|
296
|
+
}
|
|
297
|
+
getUpdatedAt() {
|
|
298
|
+
return this.updatedAt;
|
|
299
|
+
}
|
|
205
300
|
static async load(stateDir, count = 10) {
|
|
206
301
|
try {
|
|
207
302
|
const files = await readdir(stateDir);
|
|
@@ -232,7 +327,17 @@ export class MessageHistory extends EventEmitter {
|
|
|
232
327
|
const fileReadPromises = sortedFiles.map(async (fileName) => {
|
|
233
328
|
const filePath = join(stateDir, fileName);
|
|
234
329
|
try {
|
|
330
|
+
// Check file stats first to avoid reading empty files
|
|
331
|
+
const stats = await stat(filePath);
|
|
332
|
+
if (stats.size === 0) {
|
|
333
|
+
// Silently skip empty files - they're likely from interrupted saves
|
|
334
|
+
return null;
|
|
335
|
+
}
|
|
235
336
|
const content = await readFile(filePath, "utf-8");
|
|
337
|
+
// Skip files that only contain whitespace
|
|
338
|
+
if (content.trim().length === 0) {
|
|
339
|
+
return null;
|
|
340
|
+
}
|
|
236
341
|
const parsed = JSON.parse(content);
|
|
237
342
|
const result = parsed;
|
|
238
343
|
// Basic validation - ensure messages array exists
|
|
@@ -244,7 +349,12 @@ export class MessageHistory extends EventEmitter {
|
|
|
244
349
|
}
|
|
245
350
|
}
|
|
246
351
|
catch (error) {
|
|
247
|
-
|
|
352
|
+
// Only log unexpected errors, not empty/malformed JSON files
|
|
353
|
+
// which are common from interrupted saves
|
|
354
|
+
if (!(error instanceof SyntaxError) ||
|
|
355
|
+
!error.message.includes("Unexpected end of JSON input")) {
|
|
356
|
+
console.error(`Error reading or parsing file ${filePath}:`, error);
|
|
357
|
+
}
|
|
248
358
|
}
|
|
249
359
|
return null; // Return null for failed reads/parses
|
|
250
360
|
});
|
package/dist/skills.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface Skill {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
filePath: string;
|
|
5
|
+
baseDir: string;
|
|
6
|
+
source: string;
|
|
7
|
+
}
|
|
8
|
+
export interface LoadSkillsFromDirOptions {
|
|
9
|
+
dir: string;
|
|
10
|
+
source: string;
|
|
11
|
+
useColonPath?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function loadSkillsFromDir(options: LoadSkillsFromDirOptions, subdir?: string): Promise<Skill[]>;
|
|
14
|
+
export declare function loadSkills(): Promise<Skill[]>;
|
|
15
|
+
export declare function formatSkillsForPrompt(skills: Skill[]): string;
|
|
16
|
+
//# sourceMappingURL=skills.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../source/skills.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,wBAAwB;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAwOD,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,wBAAwB,EACjC,MAAM,SAAK,GACV,OAAO,CAAC,KAAK,EAAE,CAAC,CASlB;AAED,wBAAsB,UAAU,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC,CAyDnD;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAkC7D"}
|
package/dist/skills.js
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { readdir, readFile, stat } from "node:fs/promises";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { basename, dirname, join, resolve } from "node:path";
|
|
4
|
+
import { logger } from "./logger.js";
|
|
5
|
+
import { parseFrontMatter } from "./utils/yaml.js";
|
|
6
|
+
const CONFIG_DIR_NAME = ".acai";
|
|
7
|
+
// Validation functions
|
|
8
|
+
function validateSkillName(name, directoryName) {
|
|
9
|
+
// Check required field
|
|
10
|
+
if (!name) {
|
|
11
|
+
return { valid: false, error: "Name field is required" };
|
|
12
|
+
}
|
|
13
|
+
// Check length (1-64 characters)
|
|
14
|
+
if (name.length < 1 || name.length > 64) {
|
|
15
|
+
return { valid: false, error: "Name must be 1-64 characters long" };
|
|
16
|
+
}
|
|
17
|
+
// Check allowed characters (lowercase letters, numbers, hyphens)
|
|
18
|
+
if (!/^[a-z0-9-]+$/.test(name)) {
|
|
19
|
+
return {
|
|
20
|
+
valid: false,
|
|
21
|
+
error: "Name can only contain lowercase letters, numbers, and hyphens",
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
// Check no leading or trailing hyphens
|
|
25
|
+
if (name.startsWith("-") || name.endsWith("-")) {
|
|
26
|
+
return { valid: false, error: "Name cannot start or end with a hyphen" };
|
|
27
|
+
}
|
|
28
|
+
// Check no consecutive hyphens
|
|
29
|
+
if (name.includes("--")) {
|
|
30
|
+
return { valid: false, error: "Name cannot contain consecutive hyphens" };
|
|
31
|
+
}
|
|
32
|
+
// Check matches directory name
|
|
33
|
+
if (name !== directoryName) {
|
|
34
|
+
return {
|
|
35
|
+
valid: false,
|
|
36
|
+
error: `Name "${name}" must match directory name "${directoryName}"`,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
return { valid: true };
|
|
40
|
+
}
|
|
41
|
+
function validateSkillDescription(description) {
|
|
42
|
+
// Check required field
|
|
43
|
+
if (!description) {
|
|
44
|
+
return { valid: false, error: "Description field is required" };
|
|
45
|
+
}
|
|
46
|
+
// Check length (1-1024 characters)
|
|
47
|
+
if (description.length < 1 || description.length > 1024) {
|
|
48
|
+
return {
|
|
49
|
+
valid: false,
|
|
50
|
+
error: "Description must be 1-1024 characters long",
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
return { valid: true };
|
|
54
|
+
}
|
|
55
|
+
function parseFrontmatter(content) {
|
|
56
|
+
const { data, content: body } = parseFrontMatter(content);
|
|
57
|
+
// Type cast and validate required fields
|
|
58
|
+
const name = data["name"];
|
|
59
|
+
const description = data["description"];
|
|
60
|
+
// Set default empty values for optional fields
|
|
61
|
+
const frontmatter = {
|
|
62
|
+
name: name || "",
|
|
63
|
+
description: description || "",
|
|
64
|
+
license: data["license"] || undefined,
|
|
65
|
+
compatibility: data["compatibility"] || undefined,
|
|
66
|
+
metadata: data["metadata"] || undefined,
|
|
67
|
+
"allowed-tools": data["allowed-tools"] || undefined,
|
|
68
|
+
};
|
|
69
|
+
return { frontmatter, body };
|
|
70
|
+
}
|
|
71
|
+
async function loadSkillsFromDirInternal(dir, source, mode, useColonPath, subdir = "") {
|
|
72
|
+
const skills = [];
|
|
73
|
+
const fullDir = join(dir, subdir);
|
|
74
|
+
try {
|
|
75
|
+
const entries = await readdir(fullDir, { withFileTypes: true });
|
|
76
|
+
for (const entry of entries) {
|
|
77
|
+
// Skip hidden files and directories
|
|
78
|
+
if (entry.name.startsWith(".")) {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
const entryPath = join(fullDir, entry.name);
|
|
82
|
+
// Skip symbolic links to avoid infinite recursion
|
|
83
|
+
try {
|
|
84
|
+
const stats = await stat(entryPath);
|
|
85
|
+
if (stats.isSymbolicLink()) {
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
// If we can't stat, skip it
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
if (entry.isDirectory()) {
|
|
94
|
+
if (mode === "recursive") {
|
|
95
|
+
// Recursively scan subdirectories
|
|
96
|
+
const newSubdir = subdir ? join(subdir, entry.name) : entry.name;
|
|
97
|
+
const subSkills = await loadSkillsFromDirInternal(dir, source, mode, useColonPath, newSubdir);
|
|
98
|
+
skills.push(...subSkills);
|
|
99
|
+
}
|
|
100
|
+
else if (mode === "claude") {
|
|
101
|
+
// Claude mode: only check immediate subdirectories for SKILL.md
|
|
102
|
+
const skillPath = join(entryPath, "SKILL.md");
|
|
103
|
+
try {
|
|
104
|
+
const content = await readFile(skillPath, "utf8");
|
|
105
|
+
const { frontmatter } = parseFrontmatter(content);
|
|
106
|
+
// Validate required fields
|
|
107
|
+
const nameValidation = validateSkillName(frontmatter.name, entry.name);
|
|
108
|
+
if (!nameValidation.valid) {
|
|
109
|
+
logger.warn(`Invalid skill name in ${skillPath}: ${nameValidation.error}`);
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
const descriptionValidation = validateSkillDescription(frontmatter.description);
|
|
113
|
+
if (!descriptionValidation.valid) {
|
|
114
|
+
logger.warn(`Invalid skill description in ${skillPath}: ${descriptionValidation.error}`);
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
skills.push({
|
|
118
|
+
name: frontmatter.name,
|
|
119
|
+
description: frontmatter.description,
|
|
120
|
+
filePath: skillPath,
|
|
121
|
+
baseDir: entryPath,
|
|
122
|
+
source,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
logger.warn(error, `Failed to load skill from ${skillPath}:`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
else if (entry.isFile() &&
|
|
131
|
+
entry.name === "SKILL.md" &&
|
|
132
|
+
mode === "recursive") {
|
|
133
|
+
// Found a SKILL.md file in recursive mode
|
|
134
|
+
try {
|
|
135
|
+
const content = await readFile(entryPath, "utf8");
|
|
136
|
+
const { frontmatter } = parseFrontmatter(content);
|
|
137
|
+
// Validate required fields
|
|
138
|
+
const nameValidation = validateSkillName(frontmatter.name, basename(dirname(entryPath)));
|
|
139
|
+
if (!nameValidation.valid) {
|
|
140
|
+
logger.warn(`Invalid skill name in ${entryPath}: ${nameValidation.error}`);
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
const descriptionValidation = validateSkillDescription(frontmatter.description);
|
|
144
|
+
if (!descriptionValidation.valid) {
|
|
145
|
+
logger.warn(`Invalid skill description in ${entryPath}: ${descriptionValidation.error}`);
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
// Base directory is the directory containing the SKILL.md file
|
|
149
|
+
const baseDir = subdir ? join(dir, subdir) : dir;
|
|
150
|
+
skills.push({
|
|
151
|
+
name: frontmatter.name,
|
|
152
|
+
description: frontmatter.description,
|
|
153
|
+
filePath: entryPath,
|
|
154
|
+
baseDir,
|
|
155
|
+
source,
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
logger.warn(error, `Failed to load skill from ${entryPath}:`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
// Directory doesn't exist or can't be read
|
|
166
|
+
if (error.code !== "ENOENT") {
|
|
167
|
+
logger.error(error, `Error reading skills directory ${fullDir}:`);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return skills;
|
|
171
|
+
}
|
|
172
|
+
export async function loadSkillsFromDir(options, subdir = "") {
|
|
173
|
+
const { dir, source, useColonPath = false } = options;
|
|
174
|
+
return await loadSkillsFromDirInternal(dir, source, "recursive", useColonPath, subdir);
|
|
175
|
+
}
|
|
176
|
+
export async function loadSkills() {
|
|
177
|
+
const skillMap = new Map();
|
|
178
|
+
// Codex: recursive, simple directory name
|
|
179
|
+
const codexUserDir = join(homedir(), ".codex", "skills");
|
|
180
|
+
for (const skill of await loadSkillsFromDirInternal(codexUserDir, "codex-user", "recursive", false)) {
|
|
181
|
+
skillMap.set(skill.name, skill);
|
|
182
|
+
}
|
|
183
|
+
// Claude: single level only
|
|
184
|
+
const claudeUserDir = join(homedir(), ".claude", "skills");
|
|
185
|
+
for (const skill of await loadSkillsFromDirInternal(claudeUserDir, "claude-user", "claude", false)) {
|
|
186
|
+
skillMap.set(skill.name, skill);
|
|
187
|
+
}
|
|
188
|
+
const claudeProjectDir = resolve(process.cwd(), ".claude", "skills");
|
|
189
|
+
for (const skill of await loadSkillsFromDirInternal(claudeProjectDir, "claude-project", "claude", false)) {
|
|
190
|
+
skillMap.set(skill.name, skill);
|
|
191
|
+
}
|
|
192
|
+
// acai: recursive, colon-separated path names
|
|
193
|
+
const globalSkillsDir = join(homedir(), CONFIG_DIR_NAME, "skills");
|
|
194
|
+
for (const skill of await loadSkillsFromDirInternal(globalSkillsDir, "user", "recursive", true)) {
|
|
195
|
+
skillMap.set(skill.name, skill);
|
|
196
|
+
}
|
|
197
|
+
const projectSkillsDir = resolve(process.cwd(), CONFIG_DIR_NAME, "skills");
|
|
198
|
+
for (const skill of await loadSkillsFromDirInternal(projectSkillsDir, "project", "recursive", true)) {
|
|
199
|
+
skillMap.set(skill.name, skill);
|
|
200
|
+
}
|
|
201
|
+
return Array.from(skillMap.values());
|
|
202
|
+
}
|
|
203
|
+
export function formatSkillsForPrompt(skills) {
|
|
204
|
+
if (skills.length === 0) {
|
|
205
|
+
return "";
|
|
206
|
+
}
|
|
207
|
+
const lines = [
|
|
208
|
+
"\n\n## Skills",
|
|
209
|
+
"",
|
|
210
|
+
"<skills_instructions>",
|
|
211
|
+
"When users ask you to perform tasks, check if any of the available skills below can help complete the task more effectively. Skills provide specialized capabilities and domain knowledge.",
|
|
212
|
+
"Use the readFile tool to load a skill's file when the task matches its description.",
|
|
213
|
+
"Skills may contain {baseDir} placeholders - replace them with the skill's base directory path.",
|
|
214
|
+
"</skills_instructions>",
|
|
215
|
+
"",
|
|
216
|
+
"<available_skills>",
|
|
217
|
+
];
|
|
218
|
+
for (const skill of skills) {
|
|
219
|
+
lines.push("<skill>");
|
|
220
|
+
lines.push("<name>");
|
|
221
|
+
lines.push(skill.name);
|
|
222
|
+
lines.push("</name>");
|
|
223
|
+
lines.push("<description>");
|
|
224
|
+
lines.push(skill.description);
|
|
225
|
+
lines.push("</description>");
|
|
226
|
+
lines.push("<location>");
|
|
227
|
+
lines.push(skill.filePath);
|
|
228
|
+
lines.push("</location>");
|
|
229
|
+
lines.push("</skill>");
|
|
230
|
+
}
|
|
231
|
+
lines.push("</available_skills>");
|
|
232
|
+
return lines.join("\n");
|
|
233
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terminal Control Module
|
|
3
|
+
*
|
|
4
|
+
* Provides functions for controlling terminal behavior and state.
|
|
5
|
+
*/
|
|
6
|
+
export { isAltBackspace, isAltEnter, isAltLeft, isAltRight, isArrowDown, isArrowLeft, isArrowRight, isArrowUp, isBackspace, isCtrlA, isCtrlC, isCtrlD, isCtrlE, isCtrlK, isCtrlL, isCtrlP, isCtrlT, isCtrlU, isCtrlW, isDelete, isEnd, isEnter, isEscape, isHome, isKittyCtrl, isKittyKey, isNavigationKey, isPageDown, isPageUp, isShiftCtrlD, isShiftCtrlO, isShiftCtrlP, isShiftEnter, isShiftTab, isTab, } from "./keys.ts";
|
|
7
|
+
/**
|
|
8
|
+
* Get the current shell
|
|
9
|
+
*/
|
|
10
|
+
export declare function getShell(): string;
|
|
11
|
+
/**
|
|
12
|
+
* Check if terminal is interactive
|
|
13
|
+
*/
|
|
14
|
+
export declare function isInteractive(): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Send terminal alert/notification
|
|
17
|
+
*/
|
|
18
|
+
export declare function alert(): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Clear the terminal screen
|
|
21
|
+
*/
|
|
22
|
+
export declare function clearScreen(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Clear the terminal screen including scrollback buffer
|
|
25
|
+
*
|
|
26
|
+
* Unlike clearScreen, this function:
|
|
27
|
+
* 1. Clears the entire screen (\x1b[2J)
|
|
28
|
+
* 2. Clears the scrollback buffer (\x1b[3J)
|
|
29
|
+
* 3. Moves cursor to home position (\x1b[H)
|
|
30
|
+
* 4. Returns a Promise that resolves when the write operation completes
|
|
31
|
+
*
|
|
32
|
+
* @returns Promise that resolves when the terminal has been cleared
|
|
33
|
+
*/
|
|
34
|
+
export declare function clearTerminal(): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Sets the terminal title
|
|
37
|
+
*/
|
|
38
|
+
export declare function setTerminalTitle(title: string): void;
|
|
39
|
+
/**
|
|
40
|
+
* Get the terminal size (rows and columns)
|
|
41
|
+
*/
|
|
42
|
+
export declare function getTerminalSize(): {
|
|
43
|
+
rows: number;
|
|
44
|
+
columns: number;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Start progress indicator in terminal
|
|
48
|
+
* Sends terminal escape sequence to show progress animation
|
|
49
|
+
*/
|
|
50
|
+
export declare function startProgress(): void;
|
|
51
|
+
/**
|
|
52
|
+
* Stop progress indicator in terminal
|
|
53
|
+
* Sends terminal escape sequence to hide progress animation
|
|
54
|
+
*/
|
|
55
|
+
export declare function stopProgress(): void;
|
|
56
|
+
//# sourceMappingURL=control.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control.d.ts","sourceRoot":"","sources":["../../source/terminal/control.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EACL,cAAc,EACd,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACX,WAAW,EACX,YAAY,EACZ,SAAS,EACT,WAAW,EACX,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,QAAQ,EACR,KAAK,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,WAAW,EACX,UAAU,EACV,eAAe,EACf,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,KAAK,GACN,MAAM,WAAW,CAAC;AAEnB;;GAEG;AACH,wBAAgB,QAAQ,WAEvB;AAED;;GAEG;AACH,wBAAgB,aAAa,YAE5B;AAED;;GAEG;AACH,wBAAsB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAkB3C;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAGlC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAM7C;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAMpD;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAgBnE;AAED;;;GAGG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAEpC;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAEnC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terminal Control Module
|
|
3
|
+
*
|
|
4
|
+
* Provides functions for controlling terminal behavior and state.
|
|
5
|
+
*/
|
|
6
|
+
import { config } from "../config.js";
|
|
7
|
+
import { logger } from "../logger.js";
|
|
8
|
+
// Re-export key functions from keys.ts for convenient imports
|
|
9
|
+
export { isAltBackspace, isAltEnter, isAltLeft, isAltRight, isArrowDown, isArrowLeft, isArrowRight, isArrowUp, isBackspace, isCtrlA, isCtrlC, isCtrlD, isCtrlE, isCtrlK, isCtrlL, isCtrlP, isCtrlT, isCtrlU, isCtrlW, isDelete, isEnd, isEnter, isEscape, isHome, isKittyCtrl, isKittyKey, isNavigationKey, isPageDown, isPageUp, isShiftCtrlD, isShiftCtrlO, isShiftCtrlP, isShiftEnter, isShiftTab, isTab, } from "./keys.js";
|
|
10
|
+
/**
|
|
11
|
+
* Get the current shell
|
|
12
|
+
*/
|
|
13
|
+
export function getShell() {
|
|
14
|
+
return process.env["ZSH_VERSION"] ? "zsh" : process.env["SHELL"] || "bash";
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Check if terminal is interactive
|
|
18
|
+
*/
|
|
19
|
+
export function isInteractive() {
|
|
20
|
+
return Boolean(process.stdout.isTTY && process.stdin.isTTY);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Send terminal alert/notification
|
|
24
|
+
*/
|
|
25
|
+
export async function alert() {
|
|
26
|
+
if (!(await config.getConfig()).notify) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const t = "acai";
|
|
30
|
+
const b = "";
|
|
31
|
+
try {
|
|
32
|
+
process.stdout.write("\x07");
|
|
33
|
+
const esc = "\u001b";
|
|
34
|
+
const bel = "\u0007";
|
|
35
|
+
const safe = (s) => s.replaceAll("\u0007", "").replaceAll("\u001b", "");
|
|
36
|
+
const payload = `${esc}]777;notify;${safe(t)};${safe(b)}${bel}`;
|
|
37
|
+
process.stdout.write(payload);
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
logger.warn({ err }, "Failed to emit alert");
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Clear the terminal screen
|
|
45
|
+
*/
|
|
46
|
+
export function clearScreen() {
|
|
47
|
+
// Clear screen and move cursor to top-left
|
|
48
|
+
process.stdout.write("\x1b[2J\x1b[0f");
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Clear the terminal screen including scrollback buffer
|
|
52
|
+
*
|
|
53
|
+
* Unlike clearScreen, this function:
|
|
54
|
+
* 1. Clears the entire screen (\x1b[2J)
|
|
55
|
+
* 2. Clears the scrollback buffer (\x1b[3J)
|
|
56
|
+
* 3. Moves cursor to home position (\x1b[H)
|
|
57
|
+
* 4. Returns a Promise that resolves when the write operation completes
|
|
58
|
+
*
|
|
59
|
+
* @returns Promise that resolves when the terminal has been cleared
|
|
60
|
+
*/
|
|
61
|
+
export function clearTerminal() {
|
|
62
|
+
return new Promise((resolve) => {
|
|
63
|
+
process.stdout.write("\x1b[2J\x1b[3J\x1b[H", () => {
|
|
64
|
+
resolve();
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Sets the terminal title
|
|
70
|
+
*/
|
|
71
|
+
export function setTerminalTitle(title) {
|
|
72
|
+
if (process.platform === "win32") {
|
|
73
|
+
process.title = title ? `✳✳ ${title}` : title;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
process.stdout.write(`\x1b]0;${title ? `✳✳ ${title}` : ""}\x07`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Get the terminal size (rows and columns)
|
|
81
|
+
*/
|
|
82
|
+
export function getTerminalSize() {
|
|
83
|
+
// Default to a reasonable size if we can't determine the actual size
|
|
84
|
+
const defaultSize = { rows: 24, columns: 80 };
|
|
85
|
+
try {
|
|
86
|
+
if (process.stdout.isTTY) {
|
|
87
|
+
return {
|
|
88
|
+
rows: process.stdout.rows || defaultSize.rows,
|
|
89
|
+
columns: process.stdout.columns || defaultSize.columns,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
catch (_error) {
|
|
94
|
+
// Ignore errors
|
|
95
|
+
}
|
|
96
|
+
return defaultSize;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Start progress indicator in terminal
|
|
100
|
+
* Sends terminal escape sequence to show progress animation
|
|
101
|
+
*/
|
|
102
|
+
export function startProgress() {
|
|
103
|
+
process.stdout.write("\u001b]9;4;3;0\u0007");
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Stop progress indicator in terminal
|
|
107
|
+
* Sends terminal escape sequence to hide progress animation
|
|
108
|
+
*/
|
|
109
|
+
export function stopProgress() {
|
|
110
|
+
process.stdout.write("\u001b]9;4;0;0\u0007");
|
|
111
|
+
}
|
|
@@ -2,5 +2,5 @@ import type { Theme } from "./highlight/theme.ts";
|
|
|
2
2
|
/**
|
|
3
3
|
* The default theme. It is possible to override just individual keys.
|
|
4
4
|
*/
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const DEFAULT_HIGHLIGHT_THEME: Theme;
|
|
6
6
|
//# sourceMappingURL=default-theme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-theme.d.ts","sourceRoot":"","sources":["../../source/terminal/default-theme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"default-theme.d.ts","sourceRoot":"","sources":["../../source/terminal/default-theme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAGlD;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,KAqNrC,CAAC"}
|