@travisennis/acai 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +76 -27
- package/dist/agent/index.d.ts +21 -25
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +145 -103
- package/dist/cli.d.ts +2 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +23 -17
- package/dist/commands/add-directory/index.d.ts +3 -0
- package/dist/commands/add-directory/index.d.ts.map +1 -0
- package/dist/commands/{add-directory-command.js → add-directory/index.js} +6 -10
- package/dist/commands/add-directory/types.d.ts +6 -0
- package/dist/commands/add-directory/types.d.ts.map +1 -0
- package/dist/commands/add-directory/types.js +1 -0
- package/dist/commands/add-directory/utils.d.ts +3 -0
- package/dist/commands/add-directory/utils.d.ts.map +1 -0
- package/dist/commands/add-directory/utils.js +15 -0
- package/dist/commands/clear/index.d.ts +3 -0
- package/dist/commands/clear/index.d.ts.map +1 -0
- package/dist/commands/{clear-command.js → clear/index.js} +0 -2
- package/dist/commands/copy/index.d.ts +3 -0
- package/dist/commands/copy/index.d.ts.map +1 -0
- package/dist/commands/{copy-command.js → copy/index.js} +4 -26
- package/dist/commands/copy/types.d.ts +3 -0
- package/dist/commands/copy/types.d.ts.map +1 -0
- package/dist/commands/copy/types.js +1 -0
- package/dist/commands/copy/utils.d.ts +3 -0
- package/dist/commands/copy/utils.d.ts.map +1 -0
- package/dist/commands/copy/utils.js +22 -0
- package/dist/commands/{exit-command.d.ts → exit/index.d.ts} +4 -4
- package/dist/commands/exit/index.d.ts.map +1 -0
- package/dist/commands/exit/index.js +21 -0
- package/dist/commands/exit/types.d.ts +8 -0
- package/dist/commands/exit/types.d.ts.map +1 -0
- package/dist/commands/exit/types.js +1 -0
- package/dist/commands/exit/utils.d.ts +2 -0
- package/dist/commands/exit/utils.d.ts.map +1 -0
- package/dist/commands/exit/utils.js +13 -0
- package/dist/commands/generate-rules/index.d.ts +3 -0
- package/dist/commands/generate-rules/index.d.ts.map +1 -0
- package/dist/commands/{generate-rules-command.js → generate-rules/index.js} +57 -96
- package/dist/commands/generate-rules/utils.d.ts +5 -0
- package/dist/commands/generate-rules/utils.d.ts.map +1 -0
- package/dist/commands/generate-rules/utils.js +25 -0
- package/dist/commands/handoff/index.d.ts +3 -0
- package/dist/commands/handoff/index.d.ts.map +1 -0
- package/dist/commands/handoff/index.js +97 -0
- package/dist/commands/handoff/utils.d.ts +4 -0
- package/dist/commands/handoff/utils.d.ts.map +1 -0
- package/dist/commands/{handoff-command.js → handoff/utils.js} +24 -92
- package/dist/commands/health/index.d.ts +3 -0
- package/dist/commands/health/index.d.ts.map +1 -0
- package/dist/commands/health/index.js +56 -0
- package/dist/commands/health/utils.d.ts +15 -0
- package/dist/commands/health/utils.d.ts.map +1 -0
- package/dist/commands/health/utils.js +52 -0
- package/dist/commands/{help-command.d.ts → help/index.d.ts} +2 -2
- package/dist/commands/help/index.d.ts.map +1 -0
- package/dist/commands/{help-command.js → help/index.js} +1 -1
- package/dist/commands/history/index.d.ts +3 -0
- package/dist/commands/history/index.d.ts.map +1 -0
- package/dist/commands/{history-command.js → history/index.js} +16 -100
- package/dist/commands/history/types.d.ts +11 -0
- package/dist/commands/history/types.d.ts.map +1 -0
- package/dist/commands/history/types.js +1 -0
- package/dist/commands/history/utils.d.ts +4 -0
- package/dist/commands/history/utils.d.ts.map +1 -0
- package/dist/commands/history/utils.js +86 -0
- package/dist/commands/init/index.d.ts +3 -0
- package/dist/commands/init/index.d.ts.map +1 -0
- package/dist/commands/{init-command.js → init/index.js} +16 -7
- package/dist/commands/init-project/index.d.ts +3 -0
- package/dist/commands/init-project/index.d.ts.map +1 -0
- package/dist/commands/init-project/index.js +51 -0
- package/dist/commands/init-project/utils.d.ts +9 -0
- package/dist/commands/init-project/utils.d.ts.map +1 -0
- package/dist/commands/init-project/utils.js +43 -0
- package/dist/commands/list-directories/index.d.ts +3 -0
- package/dist/commands/list-directories/index.d.ts.map +1 -0
- package/dist/commands/{list-directories-command.js → list-directories/index.js} +1 -1
- package/dist/commands/list-tools/index.d.ts +3 -0
- package/dist/commands/list-tools/index.d.ts.map +1 -0
- package/dist/commands/{list-tools-command.js → list-tools/index.js} +4 -16
- package/dist/commands/manager.d.ts +2 -2
- package/dist/commands/manager.d.ts.map +1 -1
- package/dist/commands/manager.js +35 -43
- package/dist/commands/model/index.d.ts +3 -0
- package/dist/commands/model/index.d.ts.map +1 -0
- package/dist/commands/{model-command.js → model/index.js} +15 -52
- package/dist/commands/model/utils.d.ts +3 -0
- package/dist/commands/model/utils.d.ts.map +1 -0
- package/dist/commands/model/utils.js +5 -0
- package/dist/commands/{paste-command.d.ts → paste/index.d.ts} +2 -2
- package/dist/commands/paste/index.d.ts.map +1 -0
- package/dist/commands/{paste-command.js → paste/index.js} +6 -111
- package/dist/commands/paste/utils.d.ts +5 -0
- package/dist/commands/paste/utils.d.ts.map +1 -0
- package/dist/commands/paste/utils.js +86 -0
- package/dist/commands/pickup/index.d.ts +3 -0
- package/dist/commands/pickup/index.d.ts.map +1 -0
- package/dist/commands/pickup/index.js +138 -0
- package/dist/commands/pickup/types.d.ts +6 -0
- package/dist/commands/pickup/types.d.ts.map +1 -0
- package/dist/commands/pickup/types.js +1 -0
- package/dist/commands/pickup/utils.d.ts +7 -0
- package/dist/commands/pickup/utils.d.ts.map +1 -0
- package/dist/commands/pickup/utils.js +56 -0
- package/dist/commands/prompt/index.d.ts +5 -0
- package/dist/commands/prompt/index.d.ts.map +1 -0
- package/dist/commands/prompt/index.js +122 -0
- package/dist/commands/prompt/types.d.ts +15 -0
- package/dist/commands/prompt/types.d.ts.map +1 -0
- package/dist/commands/prompt/types.js +1 -0
- package/dist/commands/prompt/utils.d.ts +12 -0
- package/dist/commands/prompt/utils.d.ts.map +1 -0
- package/dist/commands/prompt/utils.js +107 -0
- package/dist/commands/remove-directory/index.d.ts +3 -0
- package/dist/commands/remove-directory/index.d.ts.map +1 -0
- package/dist/commands/{remove-directory-command.js → remove-directory/index.js} +2 -2
- package/dist/commands/reset/index.d.ts +3 -0
- package/dist/commands/reset/index.d.ts.map +1 -0
- package/dist/commands/{reset-command.js → reset/index.js} +7 -2
- package/dist/commands/reset/types.d.ts +1 -0
- package/dist/commands/reset/types.d.ts.map +1 -0
- package/dist/commands/reset/types.js +3 -0
- package/dist/commands/resources/index.d.ts +3 -0
- package/dist/commands/resources/index.d.ts.map +1 -0
- package/dist/commands/resources/index.js +84 -0
- package/dist/commands/review/index.d.ts +3 -0
- package/dist/commands/review/index.d.ts.map +1 -0
- package/dist/commands/review/index.js +126 -0
- package/dist/commands/review/types.d.ts +12 -0
- package/dist/commands/review/types.d.ts.map +1 -0
- package/dist/commands/review/types.js +1 -0
- package/dist/commands/review/utils.d.ts +4 -0
- package/dist/commands/review/utils.d.ts.map +1 -0
- package/dist/commands/review/utils.js +87 -0
- package/dist/commands/save/index.d.ts +3 -0
- package/dist/commands/save/index.d.ts.map +1 -0
- package/dist/commands/{save-command.js → save/index.js} +3 -3
- package/dist/commands/session/index.d.ts +3 -0
- package/dist/commands/session/index.d.ts.map +1 -0
- package/dist/commands/session/index.js +230 -0
- package/dist/commands/session/types.d.ts +20 -0
- package/dist/commands/session/types.d.ts.map +1 -0
- package/dist/commands/session/types.js +7 -0
- package/dist/commands/share/html-renderer.d.ts +25 -0
- package/dist/commands/share/html-renderer.d.ts.map +1 -0
- package/dist/commands/share/html-renderer.js +384 -0
- package/dist/commands/share/index.d.ts +3 -0
- package/dist/commands/share/index.d.ts.map +1 -0
- package/dist/commands/share/index.js +122 -0
- package/dist/commands/shell/index.d.ts +3 -0
- package/dist/commands/shell/index.d.ts.map +1 -0
- package/dist/commands/{shell-command.js → shell/index.js} +3 -3
- package/dist/commands/types.d.ts +2 -2
- package/dist/commands/types.d.ts.map +1 -1
- package/dist/config.d.ts +25 -7
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +45 -20
- package/dist/dedent.d.ts.map +1 -1
- package/dist/dedent.js +7 -7
- package/dist/execution/index.d.ts +1 -0
- package/dist/execution/index.d.ts.map +1 -1
- package/dist/execution/index.js +60 -64
- package/dist/formatting.d.ts +27 -0
- package/dist/formatting.d.ts.map +1 -1
- package/dist/formatting.js +40 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +194 -95
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +4 -11
- package/dist/mentions.d.ts.map +1 -1
- package/dist/mentions.js +3 -53
- package/dist/middleware/audit-message.d.ts +2 -2
- package/dist/middleware/audit-message.d.ts.map +1 -1
- package/dist/middleware/audit-message.js +40 -2
- package/dist/middleware/cache.d.ts +2 -2
- package/dist/middleware/cache.d.ts.map +1 -1
- package/dist/middleware/cache.js +111 -27
- package/dist/middleware/rate-limit.d.ts +2 -2
- package/dist/middleware/rate-limit.d.ts.map +1 -1
- package/dist/middleware/rate-limit.js +1 -0
- package/dist/models/ai-config.d.ts.map +1 -1
- package/dist/models/ai-config.js +46 -29
- package/dist/models/anthropic-provider.d.ts +14 -13
- package/dist/models/anthropic-provider.d.ts.map +1 -1
- package/dist/models/deepseek-provider.d.ts +9 -8
- package/dist/models/deepseek-provider.d.ts.map +1 -1
- package/dist/models/google-provider.d.ts +10 -9
- package/dist/models/google-provider.d.ts.map +1 -1
- package/dist/models/groq-provider.d.ts +8 -7
- package/dist/models/groq-provider.d.ts.map +1 -1
- package/dist/models/manager.d.ts +7 -4
- package/dist/models/manager.d.ts.map +1 -1
- package/dist/models/manager.js +5 -25
- package/dist/models/openai-provider.d.ts +14 -10
- package/dist/models/openai-provider.d.ts.map +1 -1
- package/dist/models/openai-provider.js +39 -0
- package/dist/models/opencode-zen-provider.d.ts +24 -0
- package/dist/models/opencode-zen-provider.d.ts.map +1 -0
- package/dist/models/opencode-zen-provider.js +94 -0
- package/dist/models/openrouter-provider.d.ts +35 -29
- package/dist/models/openrouter-provider.d.ts.map +1 -1
- package/dist/models/openrouter-provider.js +108 -80
- package/dist/models/providers.d.ts +4 -4
- package/dist/models/providers.d.ts.map +1 -1
- package/dist/models/providers.js +7 -1
- package/dist/models/xai-provider.d.ts +9 -8
- package/dist/models/xai-provider.d.ts.map +1 -1
- package/dist/prompts/manager.d.ts +1 -1
- package/dist/prompts/manager.d.ts.map +1 -1
- package/dist/prompts/manager.js +1 -1
- package/dist/prompts.d.ts +12 -2
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +74 -411
- package/dist/repl/project-status.d.ts +19 -0
- package/dist/repl/project-status.d.ts.map +1 -0
- package/dist/repl/project-status.js +78 -0
- package/dist/repl-new.d.ts +18 -4
- package/dist/repl-new.d.ts.map +1 -1
- package/dist/repl-new.js +256 -43
- package/dist/{messages.d.ts → sessions/manager.d.ts} +10 -4
- package/dist/sessions/manager.d.ts.map +1 -0
- package/dist/{messages.js → sessions/manager.js} +62 -14
- package/dist/skills.d.ts +0 -4
- package/dist/skills.d.ts.map +1 -1
- package/dist/skills.js +100 -59
- package/dist/stdin.d.ts +9 -0
- package/dist/stdin.d.ts.map +1 -0
- package/dist/stdin.js +26 -0
- package/dist/terminal/control.d.ts +1 -0
- package/dist/terminal/control.d.ts.map +1 -1
- package/dist/terminal/control.js +29 -6
- package/dist/terminal/formatting.d.ts +1 -2
- package/dist/terminal/formatting.d.ts.map +1 -1
- package/dist/terminal/formatting.js +1 -2
- package/dist/terminal/keys.d.ts +211 -0
- package/dist/terminal/keys.d.ts.map +1 -0
- package/dist/terminal/keys.js +546 -0
- package/dist/terminal/segmenter.d.ts +6 -0
- package/dist/terminal/segmenter.d.ts.map +1 -0
- package/dist/terminal/segmenter.js +11 -0
- package/dist/terminal/select-prompt.d.ts.map +1 -1
- package/dist/terminal/select-prompt.js +9 -21
- package/dist/terminal/string-width.d.ts.map +1 -1
- package/dist/terminal/string-width.js +40 -21
- package/dist/terminal/strip-ansi.d.ts.map +1 -1
- package/dist/terminal/strip-ansi.js +9 -15
- package/dist/tokens/tracker.d.ts.map +1 -1
- package/dist/tokens/tracker.js +58 -16
- package/dist/tools/bash.d.ts +9 -11
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash.js +104 -123
- package/dist/tools/directory-tree.d.ts +9 -7
- package/dist/tools/directory-tree.d.ts.map +1 -1
- package/dist/tools/directory-tree.js +89 -70
- package/dist/tools/dynamic-tool-loader.d.ts +22 -4
- package/dist/tools/dynamic-tool-loader.d.ts.map +1 -1
- package/dist/tools/dynamic-tool-loader.js +39 -44
- package/dist/tools/edit-file.d.ts +6 -16
- package/dist/tools/edit-file.d.ts.map +1 -1
- package/dist/tools/edit-file.js +19 -76
- package/dist/tools/glob.d.ts +15 -16
- package/dist/tools/glob.d.ts.map +1 -1
- package/dist/tools/glob.js +77 -119
- package/dist/tools/grep.d.ts +19 -22
- package/dist/tools/grep.d.ts.map +1 -1
- package/dist/tools/grep.js +61 -108
- package/dist/tools/index.d.ts +200 -179
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +17 -315
- package/dist/tools/ls.d.ts +26 -0
- package/dist/tools/ls.d.ts.map +1 -0
- package/dist/tools/ls.js +80 -0
- package/dist/tools/read-file.d.ts +15 -15
- package/dist/tools/read-file.d.ts.map +1 -1
- package/dist/tools/read-file.js +49 -82
- package/dist/tools/save-file.d.ts +4 -4
- package/dist/tools/save-file.d.ts.map +1 -1
- package/dist/tools/save-file.js +37 -66
- package/dist/tools/think.d.ts +4 -4
- package/dist/tools/think.d.ts.map +1 -1
- package/dist/tools/think.js +9 -38
- package/dist/tools/types.d.ts +5 -25
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/types.js +0 -9
- package/dist/tui/autocomplete/attachment-provider.d.ts +18 -0
- package/dist/tui/autocomplete/attachment-provider.d.ts.map +1 -0
- package/dist/tui/autocomplete/attachment-provider.js +159 -0
- package/dist/tui/autocomplete/base-provider.d.ts +17 -0
- package/dist/tui/autocomplete/base-provider.d.ts.map +1 -0
- package/dist/tui/autocomplete/base-provider.js +1 -0
- package/dist/tui/autocomplete/combined-provider.d.ts +20 -0
- package/dist/tui/autocomplete/combined-provider.d.ts.map +1 -0
- package/dist/tui/autocomplete/combined-provider.js +61 -0
- package/dist/tui/autocomplete/command-provider.d.ts +20 -0
- package/dist/tui/autocomplete/command-provider.d.ts.map +1 -0
- package/dist/tui/autocomplete/command-provider.js +90 -0
- package/dist/tui/autocomplete/file-search-provider.d.ts +16 -0
- package/dist/tui/autocomplete/file-search-provider.d.ts.map +1 -0
- package/dist/tui/autocomplete/file-search-provider.js +123 -0
- package/dist/tui/autocomplete/path-provider.d.ts +21 -0
- package/dist/tui/autocomplete/path-provider.d.ts.map +1 -0
- package/dist/tui/autocomplete/path-provider.js +164 -0
- package/dist/tui/autocomplete/utils.d.ts +16 -0
- package/dist/tui/autocomplete/utils.d.ts.map +1 -0
- package/dist/tui/autocomplete/utils.js +137 -0
- package/dist/tui/autocomplete.d.ts +12 -43
- package/dist/tui/autocomplete.d.ts.map +1 -1
- package/dist/tui/autocomplete.js +20 -465
- package/dist/tui/components/box.d.ts.map +1 -1
- package/dist/tui/components/box.js +16 -10
- package/dist/tui/components/editor.d.ts +6 -2
- package/dist/tui/components/editor.d.ts.map +1 -1
- package/dist/tui/components/editor.js +166 -107
- package/dist/tui/components/footer.d.ts +20 -7
- package/dist/tui/components/footer.d.ts.map +1 -1
- package/dist/tui/components/footer.js +89 -196
- package/dist/tui/components/input.d.ts.map +1 -1
- package/dist/tui/components/input.js +8 -7
- package/dist/tui/components/loader.d.ts +2 -1
- package/dist/tui/components/loader.d.ts.map +1 -1
- package/dist/tui/components/loader.js +7 -2
- package/dist/tui/components/markdown.d.ts +5 -4
- package/dist/tui/components/markdown.d.ts.map +1 -1
- package/dist/tui/components/markdown.js +51 -40
- package/dist/tui/components/modal.d.ts.map +1 -1
- package/dist/tui/components/modal.js +9 -8
- package/dist/tui/components/notification.d.ts +28 -0
- package/dist/tui/components/notification.d.ts.map +1 -0
- package/dist/tui/components/notification.js +64 -0
- package/dist/tui/components/progress-bar.d.ts.map +1 -1
- package/dist/tui/components/progress-bar.js +3 -15
- package/dist/tui/components/select-list.d.ts +0 -15
- package/dist/tui/components/select-list.d.ts.map +1 -1
- package/dist/tui/components/select-list.js +5 -28
- package/dist/tui/components/tool-execution.d.ts +3 -6
- package/dist/tui/components/tool-execution.d.ts.map +1 -1
- package/dist/tui/components/tool-execution.js +26 -38
- package/dist/tui/components/welcome.d.ts +8 -1
- package/dist/tui/components/welcome.d.ts.map +1 -1
- package/dist/tui/components/welcome.js +45 -6
- package/dist/tui/editor-launcher.d.ts +13 -0
- package/dist/tui/editor-launcher.d.ts.map +1 -0
- package/dist/tui/editor-launcher.js +39 -0
- package/dist/tui/index.d.ts +7 -3
- package/dist/tui/index.d.ts.map +1 -1
- package/dist/tui/index.js +3 -2
- package/dist/tui/terminal.d.ts +29 -2
- package/dist/tui/terminal.d.ts.map +1 -1
- package/dist/tui/terminal.js +153 -28
- package/dist/tui/tui.d.ts +2 -0
- package/dist/tui/tui.d.ts.map +1 -1
- package/dist/tui/tui.js +39 -29
- package/dist/tui/utils.d.ts.map +1 -1
- package/dist/tui/utils.js +2 -3
- package/dist/utils/filesystem/security.d.ts.map +1 -1
- package/dist/utils/filesystem/security.js +4 -1
- package/dist/utils/yaml.d.ts +11 -0
- package/dist/utils/yaml.d.ts.map +1 -0
- package/dist/utils/yaml.js +207 -0
- package/dist/utils/zod.d.ts +1 -0
- package/dist/utils/zod.d.ts.map +1 -1
- package/dist/utils/zod.js +17 -0
- package/package.json +31 -29
- package/bin/acai-wrapper.js +0 -26
- package/dist/api/exa/index.d.ts +0 -177
- package/dist/api/exa/index.d.ts.map +0 -1
- package/dist/api/exa/index.js +0 -439
- package/dist/commands/add-directory-command.d.ts +0 -3
- package/dist/commands/add-directory-command.d.ts.map +0 -1
- package/dist/commands/application-log-command.d.ts +0 -3
- package/dist/commands/application-log-command.d.ts.map +0 -1
- package/dist/commands/application-log-command.js +0 -43
- package/dist/commands/clear-command.d.ts +0 -3
- package/dist/commands/clear-command.d.ts.map +0 -1
- package/dist/commands/compact-command.d.ts +0 -3
- package/dist/commands/compact-command.d.ts.map +0 -1
- package/dist/commands/compact-command.js +0 -55
- package/dist/commands/context-command.d.ts +0 -3
- package/dist/commands/context-command.d.ts.map +0 -1
- package/dist/commands/context-command.js +0 -124
- package/dist/commands/copy-command.d.ts +0 -3
- package/dist/commands/copy-command.d.ts.map +0 -1
- package/dist/commands/edit-command.d.ts +0 -3
- package/dist/commands/edit-command.d.ts.map +0 -1
- package/dist/commands/edit-command.js +0 -42
- package/dist/commands/edit-prompt-command.d.ts +0 -3
- package/dist/commands/edit-prompt-command.d.ts.map +0 -1
- package/dist/commands/edit-prompt-command.js +0 -36
- package/dist/commands/exit-command.d.ts.map +0 -1
- package/dist/commands/exit-command.js +0 -30
- package/dist/commands/files-command.d.ts +0 -3
- package/dist/commands/files-command.d.ts.map +0 -1
- package/dist/commands/files-command.js +0 -68
- package/dist/commands/generate-rules-command.d.ts +0 -3
- package/dist/commands/generate-rules-command.d.ts.map +0 -1
- package/dist/commands/handoff-command.d.ts +0 -3
- package/dist/commands/handoff-command.d.ts.map +0 -1
- package/dist/commands/health-command.d.ts +0 -4
- package/dist/commands/health-command.d.ts.map +0 -1
- package/dist/commands/health-command.js +0 -118
- package/dist/commands/help-command.d.ts.map +0 -1
- package/dist/commands/history-command.d.ts +0 -3
- package/dist/commands/history-command.d.ts.map +0 -1
- package/dist/commands/init-command.d.ts +0 -3
- package/dist/commands/init-command.d.ts.map +0 -1
- package/dist/commands/last-log-command.d.ts +0 -3
- package/dist/commands/last-log-command.d.ts.map +0 -1
- package/dist/commands/last-log-command.js +0 -71
- package/dist/commands/list-directories-command.d.ts +0 -3
- package/dist/commands/list-directories-command.d.ts.map +0 -1
- package/dist/commands/list-tools-command.d.ts +0 -3
- package/dist/commands/list-tools-command.d.ts.map +0 -1
- package/dist/commands/model-command.d.ts +0 -3
- package/dist/commands/model-command.d.ts.map +0 -1
- package/dist/commands/paste-command.d.ts.map +0 -1
- package/dist/commands/pickup-command.d.ts +0 -3
- package/dist/commands/pickup-command.d.ts.map +0 -1
- package/dist/commands/pickup-command.js +0 -109
- package/dist/commands/prompt-command.d.ts +0 -21
- package/dist/commands/prompt-command.d.ts.map +0 -1
- package/dist/commands/prompt-command.js +0 -258
- package/dist/commands/remove-directory-command.d.ts +0 -3
- package/dist/commands/remove-directory-command.d.ts.map +0 -1
- package/dist/commands/reset-command.d.ts +0 -3
- package/dist/commands/reset-command.d.ts.map +0 -1
- package/dist/commands/rules-command.d.ts +0 -3
- package/dist/commands/rules-command.d.ts.map +0 -1
- package/dist/commands/rules-command.js +0 -73
- package/dist/commands/save-command.d.ts +0 -3
- package/dist/commands/save-command.d.ts.map +0 -1
- package/dist/commands/shell-command.d.ts +0 -3
- package/dist/commands/shell-command.d.ts.map +0 -1
- package/dist/commands/usage-command.d.ts +0 -3
- package/dist/commands/usage-command.d.ts.map +0 -1
- package/dist/commands/usage-command.js +0 -31
- package/dist/messages.d.ts.map +0 -1
- package/dist/repl/project-status-line.d.ts +0 -3
- package/dist/repl/project-status-line.d.ts.map +0 -1
- package/dist/repl/project-status-line.js +0 -61
- package/dist/repl/tool-call-repair.d.ts +0 -4
- package/dist/repl/tool-call-repair.d.ts.map +0 -1
- package/dist/repl/tool-call-repair.js +0 -54
- package/dist/terminal/markdown.d.ts +0 -2
- package/dist/terminal/markdown.d.ts.map +0 -1
- package/dist/terminal/markdown.js +0 -120
- package/dist/tokens/threshold.d.ts +0 -20
- package/dist/tokens/threshold.d.ts.map +0 -1
- package/dist/tokens/threshold.js +0 -67
- package/dist/tools/advanced-edit-file.d.ts +0 -69
- package/dist/tools/advanced-edit-file.d.ts.map +0 -1
- package/dist/tools/advanced-edit-file.js +0 -285
- package/dist/tools/agent.d.ts +0 -29
- package/dist/tools/agent.d.ts.map +0 -1
- package/dist/tools/agent.js +0 -117
- package/dist/tools/batch.d.ts +0 -34
- package/dist/tools/batch.d.ts.map +0 -1
- package/dist/tools/batch.js +0 -174
- package/dist/tools/code-interpreter.d.ts +0 -25
- package/dist/tools/code-interpreter.d.ts.map +0 -1
- package/dist/tools/code-interpreter.js +0 -183
- package/dist/tools/delete-file.d.ts +0 -24
- package/dist/tools/delete-file.d.ts.map +0 -1
- package/dist/tools/delete-file.js +0 -77
- package/dist/tools/dynamic-tool-parser.d.ts +0 -21
- package/dist/tools/dynamic-tool-parser.d.ts.map +0 -1
- package/dist/tools/dynamic-tool-parser.js +0 -22
- package/dist/tools/llm-edit-fixer.d.ts +0 -24
- package/dist/tools/llm-edit-fixer.d.ts.map +0 -1
- package/dist/tools/llm-edit-fixer.js +0 -136
- package/dist/tools/move-file.d.ts +0 -26
- package/dist/tools/move-file.d.ts.map +0 -1
- package/dist/tools/move-file.js +0 -65
- package/dist/tools/read-multiple-files.d.ts +0 -26
- package/dist/tools/read-multiple-files.d.ts.map +0 -1
- package/dist/tools/read-multiple-files.js +0 -196
- package/dist/tools/web-fetch.d.ts +0 -56
- package/dist/tools/web-fetch.d.ts.map +0 -1
- package/dist/tools/web-fetch.js +0 -247
- package/dist/tools/web-search.d.ts +0 -23
- package/dist/tools/web-search.d.ts.map +0 -1
- package/dist/tools/web-search.js +0 -148
- package/dist/tui/components/prompt-status.d.ts +0 -17
- package/dist/tui/components/prompt-status.d.ts.map +0 -1
- package/dist/tui/components/prompt-status.js +0 -26
|
@@ -1,32 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import style from "../terminal/style.js";
|
|
3
|
-
import { initCliTools } from "../tools/index.js";
|
|
4
|
-
import { Text } from "../tui/index.js";
|
|
5
|
-
export const handoffCommand = (options) => {
|
|
6
|
-
return {
|
|
7
|
-
command: "/handoff",
|
|
8
|
-
description: "Creates a detailed handoff plan of the conversation for continuing the work in a new session. Usage: /handoff <the purpose of the handoff>",
|
|
9
|
-
getSubCommands: () => Promise.resolve([]),
|
|
10
|
-
async handle(args, { tui, container, editor, }) {
|
|
11
|
-
// Validate that purpose is provided
|
|
12
|
-
const purpose = args.join(" ").trim();
|
|
13
|
-
if (!purpose) {
|
|
14
|
-
container.addChild(new Text(style.red("Please provide a purpose for the handoff. Usage: /handoff <the purpose of the handoff>"), 1, 0));
|
|
15
|
-
tui.requestRender();
|
|
16
|
-
editor.setText("");
|
|
17
|
-
return "continue";
|
|
18
|
-
}
|
|
19
|
-
container.addChild(new Text(`Creating handoff document for purpose: ${style.blue(purpose)}`, 1, 0));
|
|
20
|
-
tui.requestRender();
|
|
21
|
-
await createHandoffDocument(options, purpose);
|
|
22
|
-
container.addChild(new Text(style.green("Handoff document created"), 2, 0));
|
|
23
|
-
tui.requestRender();
|
|
24
|
-
editor.setText("");
|
|
25
|
-
return "continue";
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
const handoffPrompt = (purpose) => {
|
|
1
|
+
export const handoffPrompt = (purpose) => {
|
|
30
2
|
return `Creates a detailed handoff plan of the conversation for continuing the work in a new session.
|
|
31
3
|
|
|
32
4
|
The user specified purpose:
|
|
@@ -124,68 +96,28 @@ Here's an example of how your output should be structured:
|
|
|
124
96
|
|
|
125
97
|
## Final Step
|
|
126
98
|
|
|
127
|
-
|
|
99
|
+
Provide your complete handoff summary with all the sections above. The system will save it to a file automatically.
|
|
128
100
|
|
|
129
|
-
|
|
101
|
+
Make sure to include both the slug and readable summary in your response as described.`;
|
|
102
|
+
};
|
|
103
|
+
export const generateHandoffSlug = (purpose, maxLength = 20) => {
|
|
104
|
+
let slug = purpose
|
|
105
|
+
.toLowerCase()
|
|
106
|
+
.replace(/[^a-z0-9\s-]/g, "")
|
|
107
|
+
.replace(/\s+/g, "-")
|
|
108
|
+
.replace(/-+/g, "-")
|
|
109
|
+
.trim();
|
|
110
|
+
// Remove leading and trailing hyphens
|
|
111
|
+
slug = slug.replace(/^-+|-+$/g, "");
|
|
112
|
+
// Apply maxLength after trimming hyphens
|
|
113
|
+
slug = slug.slice(0, maxLength);
|
|
114
|
+
if (!slug) {
|
|
115
|
+
slug = "session";
|
|
116
|
+
}
|
|
117
|
+
return slug;
|
|
118
|
+
};
|
|
119
|
+
export const generateHandoffFilename = (slug) => {
|
|
120
|
+
const now = new Date();
|
|
121
|
+
const timestamp = now.toISOString().split("T")[0];
|
|
122
|
+
return `${timestamp}-${slug}.md`;
|
|
130
123
|
};
|
|
131
|
-
async function createHandoffDocument({ modelManager, tokenTracker, tokenCounter, workspace }, purpose) {
|
|
132
|
-
const app = "handoff-agent";
|
|
133
|
-
const { text, usage } = await generateText({
|
|
134
|
-
model: modelManager.getModel(app),
|
|
135
|
-
system: "You are a helpful AI assistant tasked with creating detailed handoff summaries for coding agents. Focus on technical accuracy and completeness so that another agent can seamlessly continue the work.",
|
|
136
|
-
prompt: handoffPrompt(purpose),
|
|
137
|
-
tools: (await initCliTools({ tokenCounter, workspace })).toolDefs,
|
|
138
|
-
});
|
|
139
|
-
tokenTracker.trackUsage(app, usage);
|
|
140
|
-
console.info(text);
|
|
141
|
-
// // Parse the response to extract the readable summary and slug
|
|
142
|
-
// const lines = text.split("\n");
|
|
143
|
-
// let readableSummary = "";
|
|
144
|
-
// let slug = "";
|
|
145
|
-
// const planContent = text;
|
|
146
|
-
// // Extract readable summary (first heading after markdown)
|
|
147
|
-
// for (let i = 0; i < lines.length; i++) {
|
|
148
|
-
// const line = lines[i].trim();
|
|
149
|
-
// if (line.startsWith("# ") && !readableSummary) {
|
|
150
|
-
// readableSummary = line.substring(2).trim();
|
|
151
|
-
// break;
|
|
152
|
-
// }
|
|
153
|
-
// }
|
|
154
|
-
// // Create slug from readable summary
|
|
155
|
-
// if (readableSummary) {
|
|
156
|
-
// slug = readableSummary
|
|
157
|
-
// .toLowerCase()
|
|
158
|
-
// .replace(/[^a-z0-9\s-]/g, "")
|
|
159
|
-
// .replace(/\s+/g, "-")
|
|
160
|
-
// .replace(/-+/g, "-")
|
|
161
|
-
// .trim();
|
|
162
|
-
// }
|
|
163
|
-
// // Generate filename with timestamp
|
|
164
|
-
// const now = new Date();
|
|
165
|
-
// const timestamp = now.toISOString().split("T")[0]; // YYYY-MM-DD format
|
|
166
|
-
// const filename = `handoff-${timestamp}-${slug || "session"}.md`;
|
|
167
|
-
// // Create the final handoff document
|
|
168
|
-
// const handoffDocument = `# ${readableSummary || "Session Handoff"}
|
|
169
|
-
// ${planContent}
|
|
170
|
-
// ---
|
|
171
|
-
// *Generated on ${now.toISOString()} for purpose: ${purpose}*
|
|
172
|
-
// *This handoff file can be used to continue the work using the /pickup command*`;
|
|
173
|
-
// // Save the handoff document using the saveFile tool
|
|
174
|
-
// const saveFileTool = await createSaveFileTool({
|
|
175
|
-
// workingDir: workspace.primaryDir,
|
|
176
|
-
// allowedDirs: workspace.allowedDirs,
|
|
177
|
-
// });
|
|
178
|
-
// saveFileTool.execute(
|
|
179
|
-
// {
|
|
180
|
-
// path: `./${filename}`,
|
|
181
|
-
// content: handoffDocument,
|
|
182
|
-
// encoding: "utf-8",
|
|
183
|
-
// },
|
|
184
|
-
// {
|
|
185
|
-
// toolCallId: `handoff-${Date.now()}`,
|
|
186
|
-
// abortSignal: undefined,
|
|
187
|
-
// messages: messageHistory.get(),
|
|
188
|
-
// },
|
|
189
|
-
// );
|
|
190
|
-
// console.info(`Handoff document created: ${filename}`);
|
|
191
|
-
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/commands/health/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAQ/D,wBAAgB,aAAa,CAAC,QAAQ,EAAE,cAAc,GAAG,WAAW,CA6FnE"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Container, Modal, ModalText, TableComponent, } from "../../tui/index.js";
|
|
2
|
+
import { checkEnvironmentVariables, checkTools, formatEnvStatus, formatToolStatus, } from "./utils.js";
|
|
3
|
+
export function healthCommand(_options) {
|
|
4
|
+
return {
|
|
5
|
+
command: "/health",
|
|
6
|
+
description: "Show application health status and environment variables",
|
|
7
|
+
getSubCommands: () => Promise.resolve([]),
|
|
8
|
+
async handle(_args, { tui, editor }) {
|
|
9
|
+
const envStatus = checkEnvironmentVariables();
|
|
10
|
+
const toolStatus = checkTools();
|
|
11
|
+
const setCount = envStatus.filter((row) => row[1] === "✓ Set").length;
|
|
12
|
+
const totalCount = envStatus.length;
|
|
13
|
+
const installedCount = toolStatus.filter((row) => row[1] === "✓ Installed").length;
|
|
14
|
+
const totalTools = toolStatus.length;
|
|
15
|
+
const usage = process.memoryUsage().rss;
|
|
16
|
+
const modalContent = new Container();
|
|
17
|
+
modalContent.addChild(new ModalText("Environment Variables Status:", 0, 1));
|
|
18
|
+
modalContent.addChild(new TableComponent(formatEnvStatus(envStatus), {
|
|
19
|
+
headers: ["Variable", "Status", "Description"],
|
|
20
|
+
}));
|
|
21
|
+
const envSummary = `Summary: ${setCount}/${totalCount} environment variables are set`;
|
|
22
|
+
modalContent.addChild(new ModalText(envSummary, 0, 1));
|
|
23
|
+
if (setCount === 0) {
|
|
24
|
+
modalContent.addChild(new ModalText("⚠️ No AI provider API keys are configured. The app may not function properly.", 0, 1));
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
modalContent.addChild(new ModalText("✓ At least one AI provider is configured.", 0, 1));
|
|
28
|
+
}
|
|
29
|
+
modalContent.addChild(new ModalText("", 0, 1));
|
|
30
|
+
modalContent.addChild(new ModalText("Bash Tools Status:", 0, 1));
|
|
31
|
+
modalContent.addChild(new TableComponent(formatToolStatus(toolStatus), {
|
|
32
|
+
headers: ["Tool", "Status"],
|
|
33
|
+
}));
|
|
34
|
+
const toolSummary = `Tool Summary: ${installedCount}/${totalTools} tools are installed.`;
|
|
35
|
+
modalContent.addChild(new ModalText(toolSummary, 0, 1));
|
|
36
|
+
if (installedCount < totalTools) {
|
|
37
|
+
modalContent.addChild(new ModalText("⚠️ Some tools are missing. Install them for full functionality.", 0, 1));
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
modalContent.addChild(new ModalText("✓ All required tools are installed.", 0, 1));
|
|
41
|
+
}
|
|
42
|
+
modalContent.addChild(new ModalText("", 0, 1));
|
|
43
|
+
modalContent.addChild(new ModalText("Current Process:", 0, 1));
|
|
44
|
+
const { formatMemoryUsage } = await import("../../formatting.js");
|
|
45
|
+
const formattedUsage = formatMemoryUsage(usage);
|
|
46
|
+
const memoryText = `Memory Usage: ${formattedUsage}`;
|
|
47
|
+
modalContent.addChild(new ModalText(memoryText, 0, 1));
|
|
48
|
+
const modal = new Modal("Health Status", modalContent, true, () => {
|
|
49
|
+
editor.setText("");
|
|
50
|
+
tui.requestRender();
|
|
51
|
+
});
|
|
52
|
+
tui.showModal(modal);
|
|
53
|
+
return "continue";
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface EnvVarInfo {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ToolInfo {
|
|
6
|
+
name: string;
|
|
7
|
+
command: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const ENVIRONMENT_VARIABLES: EnvVarInfo[];
|
|
10
|
+
export declare const BASH_TOOLS: ToolInfo[];
|
|
11
|
+
export declare function checkEnvironmentVariables(): (string | number)[][];
|
|
12
|
+
export declare function checkTools(execFn?: (command: string, options: object) => void): string[][];
|
|
13
|
+
export declare function formatEnvStatus(status: (string | number)[][]): (string | number)[][];
|
|
14
|
+
export declare function formatToolStatus(status: string[][]): string[][];
|
|
15
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../source/commands/health/utils.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,qBAAqB,EAAE,UAAU,EAc7C,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,QAAQ,EAQhC,CAAC;AAEF,wBAAgB,yBAAyB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EAAE,CASjE;AAED,wBAAgB,UAAU,CACxB,MAAM,GAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAe,GAC5D,MAAM,EAAE,EAAE,CAWZ;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EAAE,GAC5B,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EAAE,CAEvB;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAE/D"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { execSync } from "node:child_process";
|
|
2
|
+
export const ENVIRONMENT_VARIABLES = [
|
|
3
|
+
{ name: "OPENAI_API_KEY", description: "OpenAI (GPT models)" },
|
|
4
|
+
{ name: "ANTHROPIC_API_KEY", description: "Anthropic (Claude models)" },
|
|
5
|
+
{
|
|
6
|
+
name: "GOOGLE_GENERATIVE_AI_API_KEY",
|
|
7
|
+
description: "Google (Gemini models)",
|
|
8
|
+
},
|
|
9
|
+
{ name: "DEEPSEEK_API_KEY", description: "DeepSeek" },
|
|
10
|
+
{ name: "GROQ_API_KEY", description: "Groq (multiple models)" },
|
|
11
|
+
{ name: "X_AI_API_KEY", description: "X.AI (Grok models)" },
|
|
12
|
+
{ name: "XAI_API_KEY", description: "X.AI (Grok models - alt)" },
|
|
13
|
+
{ name: "OPENROUTER_API_KEY", description: "OpenRouter (multiple models)" },
|
|
14
|
+
{ name: "OPENCODE_ZEN_API_TOKEN", description: "OpenCode Zen" },
|
|
15
|
+
{ name: "LOG_LEVEL", description: "Logging level" },
|
|
16
|
+
];
|
|
17
|
+
export const BASH_TOOLS = [
|
|
18
|
+
{ name: "git", command: "git --version" },
|
|
19
|
+
{ name: "gh", command: "gh --version" },
|
|
20
|
+
{ name: "rg", command: "rg --version" },
|
|
21
|
+
{ name: "fd", command: "fd --version" },
|
|
22
|
+
{ name: "ast-grep", command: "ast-grep --version" },
|
|
23
|
+
{ name: "jq", command: "jq --version" },
|
|
24
|
+
{ name: "yq", command: "yq --version" },
|
|
25
|
+
];
|
|
26
|
+
export function checkEnvironmentVariables() {
|
|
27
|
+
return ENVIRONMENT_VARIABLES.map((envVar) => {
|
|
28
|
+
const value = process.env[envVar.name];
|
|
29
|
+
const hasValue = value !== undefined && value !== null && value.trim() !== "";
|
|
30
|
+
const status = hasValue ? "✓ Set" : "✗ Not set";
|
|
31
|
+
return [envVar.name, status, envVar.description];
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
export function checkTools(execFn = execSync) {
|
|
35
|
+
return BASH_TOOLS.map((tool) => {
|
|
36
|
+
let status = "✗ Not installed";
|
|
37
|
+
try {
|
|
38
|
+
execFn(tool.command, { stdio: "ignore", timeout: 5000 });
|
|
39
|
+
status = "✓ Installed";
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
// Ignore error, tool is not installed
|
|
43
|
+
}
|
|
44
|
+
return [tool.name, status];
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
export function formatEnvStatus(status) {
|
|
48
|
+
return status;
|
|
49
|
+
}
|
|
50
|
+
export function formatToolStatus(status) {
|
|
51
|
+
return status;
|
|
52
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { CommandOptions, ReplCommand } from "
|
|
1
|
+
import type { CommandOptions, ReplCommand } from "../types.ts";
|
|
2
2
|
export declare const helpCommand: (_options: CommandOptions, cmds: Map<string, ReplCommand>) => ReplCommand;
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/commands/help/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/D,eAAO,MAAM,WAAW,GACtB,UAAU,cAAc,EACxB,MAAM,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,KAC7B,WA6CF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Modal, Container as ModalContainer, ModalText, TableComponent, } from "
|
|
1
|
+
import { Modal, Container as ModalContainer, ModalText, TableComponent, } from "../../tui/index.js";
|
|
2
2
|
export const helpCommand = (_options, cmds) => {
|
|
3
3
|
return {
|
|
4
4
|
command: "/help",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/commands/history/index.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAwD/D,eAAO,MAAM,cAAc,GAAI,yEAK5B,cAAc,KAAG,WAkJnB,CAAC"}
|
|
@@ -1,94 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/* biome-ignore-all lint/suspicious/noExplicitAny: internal function uses simplified types */
|
|
2
2
|
import { generateText } from "ai";
|
|
3
|
-
import {
|
|
4
|
-
import { getTerminalSize, setTerminalTitle } from "
|
|
5
|
-
import style from "
|
|
6
|
-
import { Container, Input, Markdown, Spacer, Text } from "
|
|
7
|
-
|
|
8
|
-
const sanitizedTitle = history.title
|
|
9
|
-
.replace(/[^a-zA-Z0-9\s-_]/g, "")
|
|
10
|
-
.replace(/\s+/g, "-")
|
|
11
|
-
.toLowerCase();
|
|
12
|
-
const timestamp = new Date().toISOString().replace(/[:.]/g, "-").slice(0, -5);
|
|
13
|
-
const filename = `${sanitizedTitle}_${timestamp}.md`;
|
|
14
|
-
const markdownContent = generateMarkdown(history);
|
|
15
|
-
await writeFile(filename, markdownContent);
|
|
16
|
-
return filename;
|
|
17
|
-
}
|
|
18
|
-
function generateMarkdown(history) {
|
|
19
|
-
const lines = [];
|
|
20
|
-
// Header
|
|
21
|
-
lines.push(`# ${history.title}`);
|
|
22
|
-
lines.push("");
|
|
23
|
-
lines.push("## Conversation Metadata");
|
|
24
|
-
lines.push(`- **Session ID**: ${history.sessionId}`);
|
|
25
|
-
lines.push(`- **Model**: ${history.modelId}`);
|
|
26
|
-
lines.push(`- **Created**: ${history.createdAt.toISOString()}`);
|
|
27
|
-
lines.push(`- **Last Updated**: ${history.updatedAt.toISOString()}`);
|
|
28
|
-
lines.push(`- **Total Messages**: ${history.messages.length}`);
|
|
29
|
-
lines.push("");
|
|
30
|
-
// Messages
|
|
31
|
-
lines.push("## Conversation History");
|
|
32
|
-
lines.push("");
|
|
33
|
-
history.messages.forEach((message, index) => {
|
|
34
|
-
const role = message.role.toUpperCase();
|
|
35
|
-
lines.push(`### ${role} (Message ${index + 1})`);
|
|
36
|
-
lines.push("");
|
|
37
|
-
if (Array.isArray(message.content)) {
|
|
38
|
-
message.content.forEach((part) => {
|
|
39
|
-
if (part.type === "text" && part.text?.trim()) {
|
|
40
|
-
lines.push(part.text);
|
|
41
|
-
lines.push("");
|
|
42
|
-
}
|
|
43
|
-
else if (part.type === "tool-call") {
|
|
44
|
-
lines.push(`**Tool Call**: ${part.toolName}`);
|
|
45
|
-
lines.push(`**Call ID**: ${part.toolCallId}`);
|
|
46
|
-
lines.push("**Input**:");
|
|
47
|
-
lines.push("```json");
|
|
48
|
-
lines.push(JSON.stringify(part.input, null, 2));
|
|
49
|
-
lines.push("```");
|
|
50
|
-
lines.push("");
|
|
51
|
-
}
|
|
52
|
-
else if (part.type === "tool-result") {
|
|
53
|
-
lines.push(`**Tool Result**: ${part.toolName}`);
|
|
54
|
-
lines.push(`**Call ID**: ${part.toolCallId}`);
|
|
55
|
-
lines.push("**Output**:");
|
|
56
|
-
if (typeof part.output === "object" &&
|
|
57
|
-
part.output !== null &&
|
|
58
|
-
"type" in part.output &&
|
|
59
|
-
part.output.type === "text" &&
|
|
60
|
-
"text" in part.output) {
|
|
61
|
-
lines.push("```");
|
|
62
|
-
lines.push(String(part.output.text));
|
|
63
|
-
lines.push("```");
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
lines.push("```json");
|
|
67
|
-
lines.push(JSON.stringify(part.output, null, 2));
|
|
68
|
-
lines.push("```");
|
|
69
|
-
}
|
|
70
|
-
lines.push("");
|
|
71
|
-
}
|
|
72
|
-
else if (part.type === "tool-error") {
|
|
73
|
-
lines.push(`**Tool Error**: ${part.toolName}`);
|
|
74
|
-
lines.push(`**Call ID**: ${part.toolCallId}`);
|
|
75
|
-
lines.push("**Error**:");
|
|
76
|
-
lines.push("```");
|
|
77
|
-
lines.push(String(part.output));
|
|
78
|
-
lines.push("```");
|
|
79
|
-
lines.push("");
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
else if (typeof message.content === "string" && message.content.trim()) {
|
|
84
|
-
lines.push(message.content);
|
|
85
|
-
lines.push("");
|
|
86
|
-
}
|
|
87
|
-
lines.push("---");
|
|
88
|
-
lines.push("");
|
|
89
|
-
});
|
|
90
|
-
return lines.join("\n");
|
|
91
|
-
}
|
|
3
|
+
import { SessionManager } from "../../sessions/manager.js";
|
|
4
|
+
import { getTerminalSize, isArrowDown, isArrowUp, isEnter, isEscape, setTerminalTitle, } from "../../terminal/control.js";
|
|
5
|
+
import style from "../../terminal/style.js";
|
|
6
|
+
import { Container, Input, Markdown, Spacer, Text } from "../../tui/index.js";
|
|
7
|
+
import { exportConversation } from "./utils.js";
|
|
92
8
|
async function summarizeConversation(history, modelManager, tokenTracker) {
|
|
93
9
|
const systemPrompt = `You are an expert at summarizing conversations between a coding assistant and a user. Your task is to provide a clear, concise summary of the conversation that captures:
|
|
94
10
|
|
|
@@ -128,7 +44,7 @@ Keep the summary focused and informative, around 3-5 paragraphs. Use plain text
|
|
|
128
44
|
results.push("");
|
|
129
45
|
return results.join("\n");
|
|
130
46
|
}
|
|
131
|
-
export const historyCommand = ({ messageHistory, config, modelManager, tokenTracker, }) => {
|
|
47
|
+
export const historyCommand = ({ sessionManager: messageHistory, config, modelManager, tokenTracker, }) => {
|
|
132
48
|
return {
|
|
133
49
|
command: "/history",
|
|
134
50
|
description: "Browse and manage previous conversations.",
|
|
@@ -137,7 +53,7 @@ export const historyCommand = ({ messageHistory, config, modelManager, tokenTrac
|
|
|
137
53
|
const appDir = config.app;
|
|
138
54
|
const messageHistoryDir = await appDir.ensurePath("message-history");
|
|
139
55
|
// Load all histories (use a large number to get all)
|
|
140
|
-
const histories = await
|
|
56
|
+
const histories = await SessionManager.load(messageHistoryDir, 1000);
|
|
141
57
|
if (histories.length === 0) {
|
|
142
58
|
container.addChild(new Text(style.yellow("No previous conversations found."), 0, 1));
|
|
143
59
|
tui.requestRender();
|
|
@@ -313,24 +229,24 @@ class ConversationSelectorComponent extends Container {
|
|
|
313
229
|
}
|
|
314
230
|
handleInput(keyData) {
|
|
315
231
|
// Up arrow
|
|
316
|
-
if (keyData
|
|
232
|
+
if (isArrowUp(keyData)) {
|
|
317
233
|
this.selectedIndex = Math.max(0, this.selectedIndex - 1);
|
|
318
234
|
this.updateList();
|
|
319
235
|
}
|
|
320
236
|
// Down arrow
|
|
321
|
-
else if (keyData
|
|
237
|
+
else if (isArrowDown(keyData)) {
|
|
322
238
|
this.selectedIndex = Math.min(this.filteredConversations.length - 1, this.selectedIndex + 1);
|
|
323
239
|
this.updateList();
|
|
324
240
|
}
|
|
325
241
|
// Enter
|
|
326
|
-
else if (keyData
|
|
242
|
+
else if (isEnter(keyData)) {
|
|
327
243
|
const selectedConversation = this.filteredConversations[this.selectedIndex];
|
|
328
244
|
if (selectedConversation) {
|
|
329
245
|
this.handleSelect(selectedConversation);
|
|
330
246
|
}
|
|
331
247
|
}
|
|
332
248
|
// Escape
|
|
333
|
-
else if (keyData
|
|
249
|
+
else if (isEscape(keyData)) {
|
|
334
250
|
this.onCancelCallback();
|
|
335
251
|
}
|
|
336
252
|
// Pass everything else to search input
|
|
@@ -394,17 +310,17 @@ class ActionSelectorComponent extends Container {
|
|
|
394
310
|
}
|
|
395
311
|
handleInput(keyData) {
|
|
396
312
|
// Up arrow
|
|
397
|
-
if (keyData
|
|
313
|
+
if (isArrowUp(keyData)) {
|
|
398
314
|
this.selectedIndex = Math.max(0, this.selectedIndex - 1);
|
|
399
315
|
this.updateList();
|
|
400
316
|
}
|
|
401
317
|
// Down arrow
|
|
402
|
-
else if (keyData
|
|
318
|
+
else if (isArrowDown(keyData)) {
|
|
403
319
|
this.selectedIndex = Math.min(2, this.selectedIndex + 1);
|
|
404
320
|
this.updateList();
|
|
405
321
|
}
|
|
406
322
|
// Enter
|
|
407
|
-
else if (keyData
|
|
323
|
+
else if (isEnter(keyData)) {
|
|
408
324
|
const actions = ["resume", "export", "summarize"];
|
|
409
325
|
const selectedAction = actions[this.selectedIndex];
|
|
410
326
|
if (selectedAction) {
|
|
@@ -412,7 +328,7 @@ class ActionSelectorComponent extends Container {
|
|
|
412
328
|
}
|
|
413
329
|
}
|
|
414
330
|
// Escape
|
|
415
|
-
else if (keyData
|
|
331
|
+
else if (isEscape(keyData)) {
|
|
416
332
|
this.onCancelCallback();
|
|
417
333
|
}
|
|
418
334
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ModelMessage } from "ai";
|
|
2
|
+
export interface ConversationHistory {
|
|
3
|
+
title: string;
|
|
4
|
+
createdAt: Date;
|
|
5
|
+
updatedAt: Date;
|
|
6
|
+
messages: ModelMessage[];
|
|
7
|
+
sessionId: string;
|
|
8
|
+
modelId: string;
|
|
9
|
+
project: string;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../source/commands/history/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAEvC,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../source/commands/history/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,MAAM,CAAC,CAYjB;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAyFrE"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { writeFile } from "node:fs/promises";
|
|
2
|
+
export async function exportConversation(history) {
|
|
3
|
+
const sanitizedTitle = history.title
|
|
4
|
+
.replace(/[^a-zA-Z0-9\s-_]/g, "")
|
|
5
|
+
.replace(/\s+/g, "-")
|
|
6
|
+
.toLowerCase();
|
|
7
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, "-").slice(0, -5);
|
|
8
|
+
const filename = `${sanitizedTitle}_${timestamp}.md`;
|
|
9
|
+
const markdownContent = generateMarkdown(history);
|
|
10
|
+
await writeFile(filename, markdownContent);
|
|
11
|
+
return filename;
|
|
12
|
+
}
|
|
13
|
+
export function generateMarkdown(history) {
|
|
14
|
+
const lines = [];
|
|
15
|
+
// Header
|
|
16
|
+
lines.push(`# ${history.title}`);
|
|
17
|
+
lines.push("");
|
|
18
|
+
lines.push("## Conversation Metadata");
|
|
19
|
+
lines.push(`- **Session ID**: ${history.sessionId}`);
|
|
20
|
+
lines.push(`- **Model**: ${history.modelId}`);
|
|
21
|
+
lines.push(`- **Created**: ${history.createdAt.toISOString()}`);
|
|
22
|
+
lines.push(`- **Last Updated**: ${history.updatedAt.toISOString()}`);
|
|
23
|
+
lines.push(`- **Total Messages**: ${history.messages.length}`);
|
|
24
|
+
lines.push("");
|
|
25
|
+
// Messages
|
|
26
|
+
lines.push("## Conversation History");
|
|
27
|
+
lines.push("");
|
|
28
|
+
history.messages.forEach((message, index) => {
|
|
29
|
+
const role = message.role.toUpperCase();
|
|
30
|
+
lines.push(`### ${role} (Message ${index + 1})`);
|
|
31
|
+
lines.push("");
|
|
32
|
+
if (Array.isArray(message.content)) {
|
|
33
|
+
message.content.forEach((part) => {
|
|
34
|
+
if (part.type === "text" && part.text?.trim()) {
|
|
35
|
+
lines.push(part.text);
|
|
36
|
+
lines.push("");
|
|
37
|
+
}
|
|
38
|
+
else if (part.type === "tool-call") {
|
|
39
|
+
lines.push(`**Tool Call**: ${part.toolName}`);
|
|
40
|
+
lines.push(`**Call ID**: ${part.toolCallId}`);
|
|
41
|
+
lines.push("**Input**:");
|
|
42
|
+
lines.push("```json");
|
|
43
|
+
lines.push(JSON.stringify(part.input, null, 2));
|
|
44
|
+
lines.push("```");
|
|
45
|
+
lines.push("");
|
|
46
|
+
}
|
|
47
|
+
else if (part.type === "tool-result") {
|
|
48
|
+
lines.push(`**Tool Result**: ${part.toolName}`);
|
|
49
|
+
lines.push(`**Call ID**: ${part.toolCallId}`);
|
|
50
|
+
lines.push("**Output**:");
|
|
51
|
+
if (typeof part.output === "object" &&
|
|
52
|
+
part.output !== null &&
|
|
53
|
+
"type" in part.output &&
|
|
54
|
+
part.output.type === "text" &&
|
|
55
|
+
"text" in part.output) {
|
|
56
|
+
lines.push("```");
|
|
57
|
+
lines.push(String(part.output.text));
|
|
58
|
+
lines.push("```");
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
lines.push("```json");
|
|
62
|
+
lines.push(JSON.stringify(part.output, null, 2));
|
|
63
|
+
lines.push("```");
|
|
64
|
+
}
|
|
65
|
+
lines.push("");
|
|
66
|
+
}
|
|
67
|
+
else if (part.type === "tool-error") {
|
|
68
|
+
lines.push(`**Tool Error**: ${part.toolName}`);
|
|
69
|
+
lines.push(`**Call ID**: ${part.toolCallId}`);
|
|
70
|
+
lines.push("**Error**:");
|
|
71
|
+
lines.push("```");
|
|
72
|
+
lines.push(String(part.output));
|
|
73
|
+
lines.push("```");
|
|
74
|
+
lines.push("");
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
else if (typeof message.content === "string" && message.content.trim()) {
|
|
79
|
+
lines.push(message.content);
|
|
80
|
+
lines.push("");
|
|
81
|
+
}
|
|
82
|
+
lines.push("---");
|
|
83
|
+
lines.push("");
|
|
84
|
+
});
|
|
85
|
+
return lines.join("\n");
|
|
86
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/commands/init/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAqB/D,eAAO,MAAM,WAAW,GAAI,8BAGzB,cAAc,KAAG,WAiEnB,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { platform } from "node:os";
|
|
2
|
-
import { stepCountIs, streamText } from "ai";
|
|
3
|
-
import style from "
|
|
4
|
-
import {
|
|
5
|
-
import { Markdown, Spacer, Text } from "
|
|
6
|
-
import { inGitDirectory } from "
|
|
2
|
+
import { stepCountIs, streamText, tool } from "ai";
|
|
3
|
+
import style from "../../terminal/style.js";
|
|
4
|
+
import { initTools } from "../../tools/index.js";
|
|
5
|
+
import { Markdown, Spacer, Text } from "../../tui/index.js";
|
|
6
|
+
import { inGitDirectory } from "../../utils/git.js";
|
|
7
7
|
const initPrompt = `Please analyze this codebase and create a AGENTS.md file containing:
|
|
8
8
|
1. An overview of the project including how the project is structured and the tech stack used.
|
|
9
9
|
2. Build/lint/test commands - especially for running a single test
|
|
@@ -22,7 +22,7 @@ If there are Cursor rules (in .cursor/rules/ or .cursorrules), Copilot rules (in
|
|
|
22
22
|
Your current working directory is ${process.cwd()}
|
|
23
23
|
Is directory a git repo: ${(await inGitDirectory()) ? "Yes" : "No"}
|
|
24
24
|
Platform: ${platform()}`;
|
|
25
|
-
export const initCommand = ({ modelManager,
|
|
25
|
+
export const initCommand = ({ modelManager, workspace, }) => {
|
|
26
26
|
return {
|
|
27
27
|
command: "/init",
|
|
28
28
|
description: "Creates the AGENTS.md file.",
|
|
@@ -30,12 +30,21 @@ export const initCommand = ({ modelManager, tokenCounter, workspace, }) => {
|
|
|
30
30
|
async handle(_args, { tui, container, editor, }) {
|
|
31
31
|
container.addChild(new Text("Initializing project and creating AGENTS.md...", 1, 1));
|
|
32
32
|
tui.requestRender();
|
|
33
|
+
const tools = await initTools({
|
|
34
|
+
workspace,
|
|
35
|
+
});
|
|
33
36
|
const result = streamText({
|
|
34
37
|
model: modelManager.getModel("init-project"),
|
|
35
38
|
temperature: 0.5,
|
|
36
39
|
prompt: initPrompt,
|
|
37
40
|
stopWhen: stepCountIs(40),
|
|
38
|
-
tools: (
|
|
41
|
+
tools: Object.fromEntries(Object.entries(tools).map((t) => [
|
|
42
|
+
t[0],
|
|
43
|
+
tool({
|
|
44
|
+
...t[1]["toolDef"],
|
|
45
|
+
execute: t[1]["execute"],
|
|
46
|
+
}),
|
|
47
|
+
])),
|
|
39
48
|
});
|
|
40
49
|
container.addChild(new Spacer(1));
|
|
41
50
|
let output = "";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/commands/init-project/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAO/D,eAAO,MAAM,kBAAkB,GAAI,UAAU,cAAc,KAAG,WAqF7D,CAAC"}
|