@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,281 +0,0 @@
|
|
|
1
|
-
import { execSync } from "node:child_process";
|
|
2
|
-
import { readFile, writeFile } from "node:fs/promises";
|
|
3
|
-
import { createTwoFilesPatch } from "diff";
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
import style from "../terminal/style.js";
|
|
6
|
-
import { joinWorkingDir, validatePath } from "./filesystem-utils.js";
|
|
7
|
-
export const AdvancedEditFileTool = {
|
|
8
|
-
name: "advancedEditFile",
|
|
9
|
-
};
|
|
10
|
-
const inputSchema = z.object({
|
|
11
|
-
path: z.string().describe("The path of the file to edit."),
|
|
12
|
-
mode: z
|
|
13
|
-
.enum(["exact", "regex", "ast"])
|
|
14
|
-
.default("exact")
|
|
15
|
-
.describe("Editing mode: exact (literal text), regex (pattern matching), or ast (AST-aware)"),
|
|
16
|
-
operations: z.array(z.object({
|
|
17
|
-
type: z
|
|
18
|
-
.enum(["replace", "insert-before", "insert-after", "delete"])
|
|
19
|
-
.describe("Type of operation to perform"),
|
|
20
|
-
pattern: z
|
|
21
|
-
.string()
|
|
22
|
-
.describe("Pattern to match (text, regex, or AST pattern depending on mode)"),
|
|
23
|
-
replacement: z
|
|
24
|
-
.string()
|
|
25
|
-
.optional()
|
|
26
|
-
.describe("Replacement text (required for replace operations)"),
|
|
27
|
-
flags: z
|
|
28
|
-
.string()
|
|
29
|
-
.optional()
|
|
30
|
-
.describe("Regex flags for regex mode (e.g., 'g', 'i', 'm')"),
|
|
31
|
-
})),
|
|
32
|
-
astPattern: z
|
|
33
|
-
.string()
|
|
34
|
-
.optional()
|
|
35
|
-
.describe("AST-grep search pattern for AST mode (e.g., 'var $V = $VAL')"),
|
|
36
|
-
astReplacement: z
|
|
37
|
-
.string()
|
|
38
|
-
.optional()
|
|
39
|
-
.describe("AST-grep replacement pattern for AST mode (e.g., 'let $V = $VAL')"),
|
|
40
|
-
dryRun: z.boolean().default(false).describe("Show changes without writing"),
|
|
41
|
-
});
|
|
42
|
-
export const createAdvancedEditFileTool = async ({ workingDir, allowedDirs, }) => {
|
|
43
|
-
const allowedDirectory = allowedDirs ?? [workingDir];
|
|
44
|
-
return {
|
|
45
|
-
toolDef: {
|
|
46
|
-
description: "Advanced file editing with multiple modes: exact text matching, regex pattern matching, and AST-aware editing. " +
|
|
47
|
-
"Supports replace, insert-before, insert-after, and delete operations. AST mode requires ast-grep to be installed.",
|
|
48
|
-
inputSchema,
|
|
49
|
-
},
|
|
50
|
-
async *execute({ path, mode, operations, astPattern, astReplacement, dryRun, }, { toolCallId, abortSignal }) {
|
|
51
|
-
try {
|
|
52
|
-
if (abortSignal?.aborted) {
|
|
53
|
-
throw new Error("File editing aborted");
|
|
54
|
-
}
|
|
55
|
-
yield {
|
|
56
|
-
name: AdvancedEditFileTool.name,
|
|
57
|
-
id: toolCallId,
|
|
58
|
-
event: "tool-init",
|
|
59
|
-
data: `${style.cyan(path)} (mode: ${mode})`,
|
|
60
|
-
};
|
|
61
|
-
const validPath = await validatePath(joinWorkingDir(path, workingDir), allowedDirectory, { abortSignal });
|
|
62
|
-
const result = await applyAdvancedFileEdits(validPath, mode, operations, astPattern, astReplacement, dryRun, abortSignal);
|
|
63
|
-
yield {
|
|
64
|
-
name: AdvancedEditFileTool.name,
|
|
65
|
-
id: toolCallId,
|
|
66
|
-
event: "tool-completion",
|
|
67
|
-
data: `Applied ${operations.length} edits`,
|
|
68
|
-
};
|
|
69
|
-
yield result;
|
|
70
|
-
}
|
|
71
|
-
catch (error) {
|
|
72
|
-
yield {
|
|
73
|
-
name: AdvancedEditFileTool.name,
|
|
74
|
-
event: "tool-error",
|
|
75
|
-
id: toolCallId,
|
|
76
|
-
data: error.message,
|
|
77
|
-
};
|
|
78
|
-
yield `Failed to edit file: ${error.message}`;
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
// file editing and diffing utilities
|
|
84
|
-
function normalizeLineEndings(text) {
|
|
85
|
-
return text.replace(/\r\n/g, "\n");
|
|
86
|
-
}
|
|
87
|
-
function createUnifiedDiff(originalContent, newContent, filepath = "file") {
|
|
88
|
-
// Ensure consistent line endings for diff
|
|
89
|
-
const normalizedOriginal = normalizeLineEndings(originalContent);
|
|
90
|
-
const normalizedNew = normalizeLineEndings(newContent);
|
|
91
|
-
return createTwoFilesPatch(filepath, filepath, normalizedOriginal, normalizedNew, "original", "modified");
|
|
92
|
-
}
|
|
93
|
-
function applyExactModeEdits(content, operations) {
|
|
94
|
-
let modifiedContent = content;
|
|
95
|
-
for (const op of operations) {
|
|
96
|
-
switch (op.type) {
|
|
97
|
-
case "replace": {
|
|
98
|
-
if (!op.replacement) {
|
|
99
|
-
throw new Error("Replacement text required for replace operation");
|
|
100
|
-
}
|
|
101
|
-
// Exact text replacement (global)
|
|
102
|
-
let currentIndex = 0;
|
|
103
|
-
let matchCount = 0;
|
|
104
|
-
while (currentIndex < modifiedContent.length) {
|
|
105
|
-
const matchIndex = modifiedContent.indexOf(op.pattern, currentIndex);
|
|
106
|
-
if (matchIndex === -1) {
|
|
107
|
-
break;
|
|
108
|
-
}
|
|
109
|
-
matchCount++;
|
|
110
|
-
modifiedContent =
|
|
111
|
-
modifiedContent.slice(0, matchIndex) +
|
|
112
|
-
op.replacement +
|
|
113
|
-
modifiedContent.slice(matchIndex + op.pattern.length);
|
|
114
|
-
currentIndex = matchIndex + op.replacement.length;
|
|
115
|
-
}
|
|
116
|
-
if (matchCount === 0) {
|
|
117
|
-
throw new Error(`Pattern not found in content: ${op.pattern}`);
|
|
118
|
-
}
|
|
119
|
-
break;
|
|
120
|
-
}
|
|
121
|
-
case "insert-before": {
|
|
122
|
-
if (!op.replacement) {
|
|
123
|
-
throw new Error("Replacement text required for insert-before operation");
|
|
124
|
-
}
|
|
125
|
-
const beforeIndex = modifiedContent.indexOf(op.pattern);
|
|
126
|
-
if (beforeIndex === -1) {
|
|
127
|
-
throw new Error(`Pattern not found for insert-before: ${op.pattern}`);
|
|
128
|
-
}
|
|
129
|
-
modifiedContent =
|
|
130
|
-
modifiedContent.slice(0, beforeIndex) +
|
|
131
|
-
op.replacement +
|
|
132
|
-
"\n" +
|
|
133
|
-
modifiedContent.slice(beforeIndex);
|
|
134
|
-
break;
|
|
135
|
-
}
|
|
136
|
-
case "insert-after": {
|
|
137
|
-
if (!op.replacement) {
|
|
138
|
-
throw new Error("Replacement text required for insert-after operation");
|
|
139
|
-
}
|
|
140
|
-
const afterIndex = modifiedContent.indexOf(op.pattern);
|
|
141
|
-
if (afterIndex === -1) {
|
|
142
|
-
throw new Error(`Pattern not found for insert-after: ${op.pattern}`);
|
|
143
|
-
}
|
|
144
|
-
const insertPosition = afterIndex + op.pattern.length;
|
|
145
|
-
modifiedContent =
|
|
146
|
-
modifiedContent.slice(0, insertPosition) +
|
|
147
|
-
"\n" +
|
|
148
|
-
op.replacement +
|
|
149
|
-
modifiedContent.slice(insertPosition);
|
|
150
|
-
break;
|
|
151
|
-
}
|
|
152
|
-
case "delete": {
|
|
153
|
-
// For delete operations, use line-based approach to handle newlines properly
|
|
154
|
-
const lines = modifiedContent.split("\n");
|
|
155
|
-
const filteredLines = lines.filter((line) => !line.includes(op.pattern));
|
|
156
|
-
if (filteredLines.length === lines.length) {
|
|
157
|
-
throw new Error(`Pattern not found for delete: ${op.pattern}`);
|
|
158
|
-
}
|
|
159
|
-
modifiedContent = filteredLines.join("\n");
|
|
160
|
-
break;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
return modifiedContent;
|
|
165
|
-
}
|
|
166
|
-
function applyRegexModeEdits(content, operations) {
|
|
167
|
-
let modifiedContent = content;
|
|
168
|
-
for (const op of operations) {
|
|
169
|
-
const flags = op.flags || "g";
|
|
170
|
-
const regex = new RegExp(op.pattern, flags);
|
|
171
|
-
switch (op.type) {
|
|
172
|
-
case "replace":
|
|
173
|
-
if (!op.replacement) {
|
|
174
|
-
throw new Error("Replacement text required for replace operation");
|
|
175
|
-
}
|
|
176
|
-
modifiedContent = modifiedContent.replace(regex, op.replacement);
|
|
177
|
-
break;
|
|
178
|
-
case "insert-before":
|
|
179
|
-
if (!op.replacement) {
|
|
180
|
-
throw new Error("Replacement text required for insert-before operation");
|
|
181
|
-
}
|
|
182
|
-
modifiedContent = modifiedContent.replace(regex, `${op.replacement}\n$&`);
|
|
183
|
-
break;
|
|
184
|
-
case "insert-after":
|
|
185
|
-
if (!op.replacement) {
|
|
186
|
-
throw new Error("Replacement text required for insert-after operation");
|
|
187
|
-
}
|
|
188
|
-
modifiedContent = modifiedContent.replace(regex, `$&\n${op.replacement}`);
|
|
189
|
-
break;
|
|
190
|
-
case "delete":
|
|
191
|
-
modifiedContent = modifiedContent.replace(regex, "");
|
|
192
|
-
break;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
return modifiedContent;
|
|
196
|
-
}
|
|
197
|
-
function applyAstModeEdits(filePath, astPattern, astReplacement, dryRun) {
|
|
198
|
-
if (!astPattern || !astReplacement) {
|
|
199
|
-
throw new Error("AST mode requires both astPattern and astReplacement");
|
|
200
|
-
}
|
|
201
|
-
try {
|
|
202
|
-
const cmd = [
|
|
203
|
-
"ast-grep",
|
|
204
|
-
"--pattern",
|
|
205
|
-
`"${astPattern}"`,
|
|
206
|
-
"--rewrite",
|
|
207
|
-
`"${astReplacement}"`,
|
|
208
|
-
dryRun ? "--dry-run" : "--write",
|
|
209
|
-
filePath,
|
|
210
|
-
].join(" ");
|
|
211
|
-
if (dryRun) {
|
|
212
|
-
const output = execSync(cmd, { encoding: "utf-8" });
|
|
213
|
-
return `AST edit preview:\n${output}`;
|
|
214
|
-
}
|
|
215
|
-
execSync(cmd, { stdio: "inherit" });
|
|
216
|
-
return `AST edit applied to ${filePath}`;
|
|
217
|
-
}
|
|
218
|
-
catch (err) {
|
|
219
|
-
throw new Error(`AST edit failed: ${err.message}`);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
export async function applyAdvancedFileEdits(filePath, mode, operations, astPattern, astReplacement, dryRun = false, abortSignal) {
|
|
223
|
-
if (abortSignal?.aborted) {
|
|
224
|
-
throw new Error("File edit operation aborted");
|
|
225
|
-
}
|
|
226
|
-
// Read file content literally with signal
|
|
227
|
-
const originalContent = await readFile(filePath, {
|
|
228
|
-
encoding: "utf-8",
|
|
229
|
-
signal: abortSignal,
|
|
230
|
-
});
|
|
231
|
-
let modifiedContent = originalContent;
|
|
232
|
-
let resultMessage = "";
|
|
233
|
-
if (mode === "ast") {
|
|
234
|
-
// AST mode uses external ast-grep tool
|
|
235
|
-
if (!astPattern || !astReplacement) {
|
|
236
|
-
throw new Error("AST mode requires both astPattern and astReplacement");
|
|
237
|
-
}
|
|
238
|
-
resultMessage = applyAstModeEdits(filePath, astPattern, astReplacement, dryRun);
|
|
239
|
-
if (dryRun) {
|
|
240
|
-
return resultMessage;
|
|
241
|
-
}
|
|
242
|
-
// For actual AST edits, read the modified content back
|
|
243
|
-
modifiedContent = await readFile(filePath, {
|
|
244
|
-
encoding: "utf-8",
|
|
245
|
-
signal: abortSignal,
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
else {
|
|
249
|
-
// Text-based modes (exact and regex)
|
|
250
|
-
if (operations.length === 0) {
|
|
251
|
-
throw new Error("No operations specified for text-based editing mode");
|
|
252
|
-
}
|
|
253
|
-
switch (mode) {
|
|
254
|
-
case "exact":
|
|
255
|
-
modifiedContent = applyExactModeEdits(originalContent, operations);
|
|
256
|
-
break;
|
|
257
|
-
case "regex":
|
|
258
|
-
modifiedContent = applyRegexModeEdits(originalContent, operations);
|
|
259
|
-
break;
|
|
260
|
-
}
|
|
261
|
-
// Create unified diff
|
|
262
|
-
const diff = createUnifiedDiff(originalContent, modifiedContent, filePath);
|
|
263
|
-
// Format diff with appropriate number of backticks
|
|
264
|
-
let numBackticks = 3;
|
|
265
|
-
while (diff.includes("`".repeat(numBackticks))) {
|
|
266
|
-
numBackticks++;
|
|
267
|
-
}
|
|
268
|
-
resultMessage = `${"`".repeat(numBackticks)}diff\n${diff}${"`".repeat(numBackticks)}\n\n`;
|
|
269
|
-
if (!dryRun) {
|
|
270
|
-
if (abortSignal?.aborted) {
|
|
271
|
-
throw new Error("File edit operation aborted before writing");
|
|
272
|
-
}
|
|
273
|
-
// Write the modified content with signal
|
|
274
|
-
await writeFile(filePath, modifiedContent, {
|
|
275
|
-
encoding: "utf-8",
|
|
276
|
-
signal: abortSignal,
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
return resultMessage;
|
|
281
|
-
}
|
package/dist/tools/agent.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { type ToolCallOptions } from "ai";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import type { WorkspaceContext } from "../index.ts";
|
|
4
|
-
import type { ModelManager } from "../models/manager.ts";
|
|
5
|
-
import type { TokenCounter } from "../tokens/counter.ts";
|
|
6
|
-
import type { TokenTracker } from "../tokens/tracker.ts";
|
|
7
|
-
import type { ToolResult } from "./types.ts";
|
|
8
|
-
export declare const AgentTool: {
|
|
9
|
-
name: "agent";
|
|
10
|
-
};
|
|
11
|
-
declare const inputSchema: z.ZodObject<{
|
|
12
|
-
prompt: z.ZodString;
|
|
13
|
-
}, z.core.$strip>;
|
|
14
|
-
export declare const createAgentTools: (options: {
|
|
15
|
-
modelManager: ModelManager;
|
|
16
|
-
tokenTracker: TokenTracker;
|
|
17
|
-
tokenCounter: TokenCounter;
|
|
18
|
-
workspace: WorkspaceContext;
|
|
19
|
-
}) => {
|
|
20
|
-
toolDef: {
|
|
21
|
-
description: string;
|
|
22
|
-
inputSchema: z.ZodObject<{
|
|
23
|
-
prompt: z.ZodString;
|
|
24
|
-
}, z.core.$strip>;
|
|
25
|
-
};
|
|
26
|
-
execute: ({ prompt }: z.infer<typeof inputSchema>, { toolCallId, abortSignal }: ToolCallOptions) => AsyncGenerator<ToolResult>;
|
|
27
|
-
};
|
|
28
|
-
export {};
|
|
29
|
-
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../source/tools/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,eAAe,EAAE,MAAM,IAAI,CAAC;AACrE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAOzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,eAAO,MAAM,SAAS;;CAErB,CAAC;AAiCF,QAAA,MAAM,WAAW;;iBAEf,CAAC;AAEH,eAAO,MAAM,gBAAgB,GAAI,SAAS;IACxC,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,SAAS,EAAE,gBAAgB,CAAC;CAC7B;;;;;;;0BASe,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,+BACV,eAAe,KAC3C,cAAc,CAAC,UAAU,CAAC;CA8D9B,CAAC"}
|
package/dist/tools/agent.js
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { generateText, stepCountIs } from "ai";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { AiConfig } from "../models/ai-config.js";
|
|
4
|
-
import style from "../terminal/style.js";
|
|
5
|
-
import { DirectoryTreeTool } from "./directory-tree.js";
|
|
6
|
-
import { GlobTool } from "./glob.js";
|
|
7
|
-
import { GrepTool } from "./grep.js";
|
|
8
|
-
import { initCliTools } from "./index.js";
|
|
9
|
-
import { ReadFileTool } from "./read-file.js";
|
|
10
|
-
import { ReadMultipleFilesTool } from "./read-multiple-files.js";
|
|
11
|
-
export const AgentTool = {
|
|
12
|
-
name: "agent",
|
|
13
|
-
};
|
|
14
|
-
const TOOLS = [
|
|
15
|
-
GrepTool.name,
|
|
16
|
-
GlobTool.name,
|
|
17
|
-
ReadFileTool.name,
|
|
18
|
-
ReadMultipleFilesTool.name,
|
|
19
|
-
DirectoryTreeTool.name,
|
|
20
|
-
];
|
|
21
|
-
function getToolDescription() {
|
|
22
|
-
const toolNames = TOOLS.join(", ");
|
|
23
|
-
return `Launch a new agent that has access to the following tools: ${toolNames}. This agent is specifically designed for file discovery and code search tasks. Use the ${AgentTool.name} tool when you need to search for files or code patterns across the codebase.
|
|
24
|
-
|
|
25
|
-
Use cases:
|
|
26
|
-
- Search for files matching specific patterns (e.g., "*.ts", "**/*.test.ts") using ${GlobTool.name}
|
|
27
|
-
- Find code patterns or text within files using ${GrepTool.name}
|
|
28
|
-
- Read specific files or multiple files using ${ReadFileTool.name} and ${ReadMultipleFilesTool.name}
|
|
29
|
-
|
|
30
|
-
Important limitations:
|
|
31
|
-
- This agent cannot execute shell commands or run external tools
|
|
32
|
-
- It is focused purely on file discovery and content reading
|
|
33
|
-
- For complex operations or command execution, use the main assistant directly
|
|
34
|
-
|
|
35
|
-
Usage notes:
|
|
36
|
-
1. Launch multiple agents concurrently whenever possible, to maximize performance; to do that, use a single message with multiple tool uses
|
|
37
|
-
2. When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.
|
|
38
|
-
3. Each agent invocation is stateless. You will not be able to send additional messages to the agent, nor will the agent be able to communicate with you outside of its final report. Therefore, your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you.
|
|
39
|
-
4. The agent's outputs should generally be trusted.`;
|
|
40
|
-
}
|
|
41
|
-
const inputSchema = z.object({
|
|
42
|
-
prompt: z.string().describe("The task for the agent to perform"),
|
|
43
|
-
});
|
|
44
|
-
export const createAgentTools = (options) => {
|
|
45
|
-
const { modelManager, tokenTracker, tokenCounter } = options;
|
|
46
|
-
const toolDef = {
|
|
47
|
-
description: getToolDescription(),
|
|
48
|
-
inputSchema,
|
|
49
|
-
};
|
|
50
|
-
async function* execute({ prompt }, { toolCallId, abortSignal }) {
|
|
51
|
-
if (abortSignal?.aborted) {
|
|
52
|
-
throw new Error("Agent execution aborted");
|
|
53
|
-
}
|
|
54
|
-
yield {
|
|
55
|
-
name: AgentTool.name,
|
|
56
|
-
event: "tool-init",
|
|
57
|
-
id: toolCallId,
|
|
58
|
-
data: `\n${style.cyan(prompt)}`,
|
|
59
|
-
};
|
|
60
|
-
try {
|
|
61
|
-
const modelConfig = modelManager.getModelMetadata("task-agent");
|
|
62
|
-
const aiConfig = new AiConfig({
|
|
63
|
-
modelMetadata: modelConfig,
|
|
64
|
-
prompt: prompt,
|
|
65
|
-
});
|
|
66
|
-
const { text, usage } = await generateText({
|
|
67
|
-
model: modelManager.getModel("task-agent"),
|
|
68
|
-
maxOutputTokens: aiConfig.maxOutputTokens(),
|
|
69
|
-
system: "You are a code search assistant that will be given a task that will require you to search a code base to find relevant code and files.",
|
|
70
|
-
prompt: prompt,
|
|
71
|
-
temperature: aiConfig.temperature(),
|
|
72
|
-
topP: aiConfig.topP(),
|
|
73
|
-
stopWhen: stepCountIs(30),
|
|
74
|
-
providerOptions: aiConfig.providerOptions(),
|
|
75
|
-
tools: (await initCliTools({ tokenCounter, workspace: options.workspace })).toolDefs,
|
|
76
|
-
abortSignal: abortSignal,
|
|
77
|
-
// biome-ignore lint/style/useNamingConvention: third-party code
|
|
78
|
-
experimental_activeTools: [...TOOLS],
|
|
79
|
-
});
|
|
80
|
-
tokenTracker.trackUsage("task-agent", usage);
|
|
81
|
-
yield {
|
|
82
|
-
name: AgentTool.name,
|
|
83
|
-
event: "tool-completion",
|
|
84
|
-
id: toolCallId,
|
|
85
|
-
data: `Finished running the agent tool (${usage.totalTokens} tokens)`,
|
|
86
|
-
};
|
|
87
|
-
yield text;
|
|
88
|
-
}
|
|
89
|
-
catch (error) {
|
|
90
|
-
yield {
|
|
91
|
-
name: AgentTool.name,
|
|
92
|
-
event: "tool-error",
|
|
93
|
-
id: toolCallId,
|
|
94
|
-
data: error.message,
|
|
95
|
-
};
|
|
96
|
-
yield error.message;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
return {
|
|
100
|
-
toolDef,
|
|
101
|
-
execute,
|
|
102
|
-
};
|
|
103
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bash-utils.d.ts","sourceRoot":"","sources":["../../source/tools/bash-utils.ts"],"names":[],"mappings":"AAMA,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EAAE,EACrB,GAAG,EAAE,MAAM,EACX,YAAY,CAAC,EAAE,MAAM,EAAE,GACtB;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAgFtC;AAED,eAAO,MAAM,UAAU,GACrB,UAAU,MAAM,GAAG,IAAI,GAAG,SAAS,EACnC,YAAY,MAAM,KACjB,MAiDF,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,YAAY,MAAM,KAAG,OAmHtD,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ToolCallOptions } from "ai";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import type { TokenCounter } from "../tokens/counter.ts";
|
|
4
|
-
import type { ToolResult } from "./types.ts";
|
|
5
|
-
export declare const CodeInterpreterTool: {
|
|
6
|
-
name: "codeInterpreter";
|
|
7
|
-
};
|
|
8
|
-
declare const inputSchema: z.ZodObject<{
|
|
9
|
-
code: z.ZodString;
|
|
10
|
-
timeoutSeconds: z.ZodNullable<z.ZodNumber>;
|
|
11
|
-
}, z.core.$strip>;
|
|
12
|
-
export declare const createCodeInterpreterTool: ({ tokenCounter, }: {
|
|
13
|
-
tokenCounter: TokenCounter;
|
|
14
|
-
}) => Promise<{
|
|
15
|
-
toolDef: {
|
|
16
|
-
description: string;
|
|
17
|
-
inputSchema: z.ZodObject<{
|
|
18
|
-
code: z.ZodString;
|
|
19
|
-
timeoutSeconds: z.ZodNullable<z.ZodNumber>;
|
|
20
|
-
}, z.core.$strip>;
|
|
21
|
-
};
|
|
22
|
-
execute: ({ code, timeoutSeconds }: z.infer<typeof inputSchema>, { toolCallId, abortSignal }: ToolCallOptions) => AsyncGenerator<ToolResult>;
|
|
23
|
-
}>;
|
|
24
|
-
export {};
|
|
25
|
-
//# sourceMappingURL=code-interpreter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"code-interpreter.d.ts","sourceRoot":"","sources":["../../source/tools/code-interpreter.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,eAAO,MAAM,mBAAmB;;CAE/B,CAAC;AAmBF,QAAA,MAAM,WAAW;;;iBASf,CAAC;AAEH,eAAO,MAAM,yBAAyB,GAAU,mBAE7C;IACD,YAAY,EAAE,YAAY,CAAC;CAC5B;;;;;;;;wCAO6B,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,+BACxB,eAAe,KAC3C,cAAc,CAAC,UAAU,CAAC;EAqK9B,CAAC"}
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { spawn } from "node:child_process";
|
|
2
|
-
import { randomUUID } from "node:crypto";
|
|
3
|
-
import { mkdir, rm, writeFile } from "node:fs/promises";
|
|
4
|
-
import { join } from "node:path";
|
|
5
|
-
import process from "node:process";
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
import { manageTokenLimit } from "../tokens/threshold.js";
|
|
8
|
-
export const CodeInterpreterTool = {
|
|
9
|
-
name: "codeInterpreter",
|
|
10
|
-
};
|
|
11
|
-
const toolDescription = `Executes Typescript code in a separate Node.js process using Node's Permission Model.
|
|
12
|
-
|
|
13
|
-
⚠️ **IMPORTANT**: This tool uses ES Modules (ESM) only.
|
|
14
|
-
- Use \`import\` statements, NOT \`require()\`
|
|
15
|
-
- Examples: \`import fs from 'node:fs'\` NOT \`const fs = require('fs')\`
|
|
16
|
-
- Add file extensions for relative imports: \`import { utils } from './utils.js'\`
|
|
17
|
-
|
|
18
|
-
These scripts are run in the \`${process.cwd()}/.acai-ci-tmp\`. You can import project source files using relative paths from the project root with .ts extensions:
|
|
19
|
-
|
|
20
|
-
\`\`\` typescript
|
|
21
|
-
import { functionName } from '../source/path/to/module.ts';
|
|
22
|
-
\`\`\`
|
|
23
|
-
|
|
24
|
-
The interpreter supports ES Modules with TypeScript files directly.
|
|
25
|
-
|
|
26
|
-
Timeout defaults to 5 seconds and can be extended up to 60 seconds.`;
|
|
27
|
-
const inputSchema = z.object({
|
|
28
|
-
code: z.string().describe("The Typescript code to be executed."),
|
|
29
|
-
timeoutSeconds: z
|
|
30
|
-
.number()
|
|
31
|
-
.int()
|
|
32
|
-
.min(1)
|
|
33
|
-
.max(60)
|
|
34
|
-
.nullable()
|
|
35
|
-
.describe("Execution timeout in seconds (1-60). Default 5."),
|
|
36
|
-
});
|
|
37
|
-
export const createCodeInterpreterTool = async ({ tokenCounter, }) => {
|
|
38
|
-
const toolDef = {
|
|
39
|
-
description: toolDescription,
|
|
40
|
-
inputSchema,
|
|
41
|
-
};
|
|
42
|
-
async function* execute({ code, timeoutSeconds }, { toolCallId, abortSignal }) {
|
|
43
|
-
// Check if execution has been aborted
|
|
44
|
-
if (abortSignal?.aborted) {
|
|
45
|
-
throw new Error("Code interpretation aborted");
|
|
46
|
-
}
|
|
47
|
-
const workingDirectory = process.cwd();
|
|
48
|
-
const lines = code.split("\n");
|
|
49
|
-
try {
|
|
50
|
-
yield {
|
|
51
|
-
name: CodeInterpreterTool.name,
|
|
52
|
-
event: "tool-init",
|
|
53
|
-
id: toolCallId,
|
|
54
|
-
data: `Executing ${lines.length} lines of code.`,
|
|
55
|
-
};
|
|
56
|
-
if (code.trim().length === 0) {
|
|
57
|
-
throw new Error("No code provided");
|
|
58
|
-
}
|
|
59
|
-
if (abortSignal?.aborted) {
|
|
60
|
-
throw new Error("Code interpretation aborted before execution");
|
|
61
|
-
}
|
|
62
|
-
const timeoutMs = Math.min(Math.max((timeoutSeconds ?? 5) * 1000, 1000), 60000);
|
|
63
|
-
const tmpBase = join(workingDirectory, ".acai-ci-tmp");
|
|
64
|
-
await mkdir(tmpBase, { recursive: true });
|
|
65
|
-
const ext = ".ts";
|
|
66
|
-
const scriptPath = join(tmpBase, `temp_script_${Date.now()}_${randomUUID()}${ext}`);
|
|
67
|
-
await writeFile(scriptPath, code, { encoding: "utf8" });
|
|
68
|
-
const args = [
|
|
69
|
-
"--permission",
|
|
70
|
-
`--allow-fs-read=${workingDirectory}`,
|
|
71
|
-
`--allow-fs-write=${workingDirectory}`,
|
|
72
|
-
scriptPath,
|
|
73
|
-
];
|
|
74
|
-
const child = spawn(process.execPath, args, {
|
|
75
|
-
cwd: workingDirectory,
|
|
76
|
-
// do not rely solely on spawn's timeout; we implement manual timeout below
|
|
77
|
-
stdio: "pipe",
|
|
78
|
-
env: Object.assign({}, process.env, {
|
|
79
|
-
// biome-ignore lint/style/useNamingConvention: Environment variable keys are uppercase by convention
|
|
80
|
-
NO_COLOR: "true",
|
|
81
|
-
// biome-ignore lint/style/useNamingConvention: Environment variable keys are uppercase by convention
|
|
82
|
-
NODE_OPTIONS: "",
|
|
83
|
-
// biome-ignore lint/style/useNamingConvention: Environment variable keys are uppercase by convention
|
|
84
|
-
ACAI_CODE_INTERPRETER: "true",
|
|
85
|
-
}),
|
|
86
|
-
});
|
|
87
|
-
// Handle abort signal by killing the child process
|
|
88
|
-
if (abortSignal) {
|
|
89
|
-
const abortHandler = () => {
|
|
90
|
-
try {
|
|
91
|
-
child.kill("SIGKILL");
|
|
92
|
-
}
|
|
93
|
-
catch { }
|
|
94
|
-
throw new Error("Code interpretation aborted during execution");
|
|
95
|
-
};
|
|
96
|
-
abortSignal.addEventListener("abort", abortHandler);
|
|
97
|
-
}
|
|
98
|
-
let stdout = "";
|
|
99
|
-
let stderr = "";
|
|
100
|
-
let timedOut = false;
|
|
101
|
-
const timer = setTimeout(() => {
|
|
102
|
-
timedOut = true;
|
|
103
|
-
try {
|
|
104
|
-
child.kill("SIGKILL");
|
|
105
|
-
}
|
|
106
|
-
catch { }
|
|
107
|
-
}, timeoutMs);
|
|
108
|
-
child.stdout.setEncoding("utf8");
|
|
109
|
-
child.stderr.setEncoding("utf8");
|
|
110
|
-
child.stdout.on("data", (chunk) => {
|
|
111
|
-
stdout += String(chunk);
|
|
112
|
-
});
|
|
113
|
-
child.stderr.on("data", (chunk) => {
|
|
114
|
-
stderr += String(chunk);
|
|
115
|
-
});
|
|
116
|
-
const completed = await new Promise((resolve, reject) => {
|
|
117
|
-
child.on("error", (err) => reject(err));
|
|
118
|
-
child.on("close", (code, signal) => resolve({ code, signal }));
|
|
119
|
-
});
|
|
120
|
-
clearTimeout(timer);
|
|
121
|
-
// Cleanup temp file/directory
|
|
122
|
-
await rm(scriptPath, { force: true });
|
|
123
|
-
await rm(tmpBase, { force: true, recursive: true });
|
|
124
|
-
if (timedOut) {
|
|
125
|
-
throw new Error("Script timed out");
|
|
126
|
-
}
|
|
127
|
-
if (completed.code === null) {
|
|
128
|
-
throw new Error(`Process terminated by signal ${completed.signal ?? "unknown"}`);
|
|
129
|
-
}
|
|
130
|
-
if (completed.code !== 0) {
|
|
131
|
-
const message = `Process exited with code ${completed.code}. Stderr:\n${stderr.trim()}`;
|
|
132
|
-
throw new Error(message);
|
|
133
|
-
}
|
|
134
|
-
const result = {
|
|
135
|
-
stdout: stdout.trim(),
|
|
136
|
-
stderr: stderr.trim(),
|
|
137
|
-
exitCode: completed.code ?? -1,
|
|
138
|
-
};
|
|
139
|
-
const resultJson = JSON.stringify(result, null, 2);
|
|
140
|
-
const managedResult = await manageTokenLimit(resultJson, tokenCounter, "CodeInterpreter", "Reduce script complexity or output size");
|
|
141
|
-
yield {
|
|
142
|
-
name: CodeInterpreterTool.name,
|
|
143
|
-
event: "tool-completion",
|
|
144
|
-
id: toolCallId,
|
|
145
|
-
data: `Completed successfully${managedResult.tokenCount > 0 ? ` (${managedResult.tokenCount} tokens)` : ""}`,
|
|
146
|
-
};
|
|
147
|
-
yield managedResult.content;
|
|
148
|
-
}
|
|
149
|
-
catch (err) {
|
|
150
|
-
const errorMessage = err.name === "ETIMEDOUT" ||
|
|
151
|
-
err.message.includes("timed out")
|
|
152
|
-
? "Script timed out"
|
|
153
|
-
: err.message;
|
|
154
|
-
yield {
|
|
155
|
-
name: CodeInterpreterTool.name,
|
|
156
|
-
event: "tool-error",
|
|
157
|
-
id: toolCallId,
|
|
158
|
-
data: errorMessage,
|
|
159
|
-
};
|
|
160
|
-
yield errorMessage;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
return {
|
|
164
|
-
toolDef,
|
|
165
|
-
execute,
|
|
166
|
-
};
|
|
167
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { ToolCallOptions } from "ai";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import type { ToolResult } from "./types.ts";
|
|
4
|
-
export declare const DeleteFileTool: {
|
|
5
|
-
name: "deleteFile";
|
|
6
|
-
};
|
|
7
|
-
declare const inputSchema: z.ZodObject<{
|
|
8
|
-
path: z.ZodString;
|
|
9
|
-
}, z.core.$strip>;
|
|
10
|
-
type DeleteFileInputSchema = z.infer<typeof inputSchema>;
|
|
11
|
-
export declare const createDeleteFileTool: ({ workingDir, allowedDirs, }: {
|
|
12
|
-
workingDir: string;
|
|
13
|
-
allowedDirs?: string[];
|
|
14
|
-
}) => Promise<{
|
|
15
|
-
toolDef: {
|
|
16
|
-
description: string;
|
|
17
|
-
inputSchema: z.ZodObject<{
|
|
18
|
-
path: z.ZodString;
|
|
19
|
-
}, z.core.$strip>;
|
|
20
|
-
};
|
|
21
|
-
execute({ path: userPath }: DeleteFileInputSchema, { toolCallId, abortSignal }: ToolCallOptions): AsyncGenerator<ToolResult>;
|
|
22
|
-
}>;
|
|
23
|
-
export {};
|
|
24
|
-
//# sourceMappingURL=delete-file.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-file.d.ts","sourceRoot":"","sources":["../../source/tools/delete-file.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,eAAO,MAAM,cAAc;;CAE1B,CAAC;AAEF,QAAA,MAAM,WAAW;;iBAEf,CAAC;AAEH,KAAK,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEzD,eAAO,MAAM,oBAAoB,GAAU,8BAGxC;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;;;;;;;gCASyB,qBAAqB,+BACZ,eAAe,GAC3C,cAAc,CAAC,UAAU,CAAC;EA2DhC,CAAC"}
|