@travisennis/acai 0.0.8 → 0.0.10
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 +48 -729
- package/bin/acai +52 -0
- package/dist/agent/index.d.ts +12 -2
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +378 -168
- package/dist/agent/sub-agent.d.ts +23 -0
- package/dist/agent/sub-agent.d.ts.map +1 -0
- package/dist/agent/sub-agent.js +109 -0
- package/dist/cli/index.d.ts +26 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/{cli.js → cli/index.js} +84 -76
- package/dist/cli/stdin.d.ts +9 -0
- package/dist/cli/stdin.d.ts.map +1 -0
- package/dist/cli/stdin.js +37 -0
- package/dist/commands/copy/index.js +2 -2
- package/dist/commands/copy/utils.d.ts.map +1 -1
- package/dist/commands/copy/utils.js +15 -13
- package/dist/commands/generate-rules/index.d.ts +1 -1
- package/dist/commands/generate-rules/index.d.ts.map +1 -1
- package/dist/commands/generate-rules/index.js +16 -100
- package/dist/commands/generate-rules/service.d.ts +21 -0
- package/dist/commands/generate-rules/service.d.ts.map +1 -0
- package/dist/commands/generate-rules/service.js +103 -0
- package/dist/commands/handoff/index.js +2 -2
- package/dist/commands/health/index.js +1 -1
- package/dist/commands/health/utils.d.ts.map +1 -1
- package/dist/commands/health/utils.js +6 -0
- package/dist/commands/history/index.d.ts +1 -1
- package/dist/commands/history/index.d.ts.map +1 -1
- package/dist/commands/history/index.js +17 -18
- package/dist/commands/history/types.d.ts +38 -0
- package/dist/commands/history/types.d.ts.map +1 -1
- package/dist/commands/history/utils.d.ts.map +1 -1
- package/dist/commands/history/utils.js +63 -58
- package/dist/commands/init/index.d.ts.map +1 -1
- package/dist/commands/init/index.js +3 -8
- package/dist/commands/init-project/index.d.ts.map +1 -1
- package/dist/commands/init-project/index.js +3 -3
- package/dist/commands/init-project/utils.d.ts.map +1 -1
- package/dist/commands/init-project/utils.js +10 -2
- package/dist/commands/list-tools/index.d.ts.map +1 -1
- package/dist/commands/list-tools/index.js +7 -31
- package/dist/commands/manager.d.ts +2 -2
- package/dist/commands/manager.d.ts.map +1 -1
- package/dist/commands/manager.js +57 -33
- package/dist/commands/model/index.d.ts.map +1 -1
- package/dist/commands/model/index.js +20 -151
- package/dist/commands/model/model-panel.d.ts +4 -0
- package/dist/commands/model/model-panel.d.ts.map +1 -0
- package/dist/commands/model/model-panel.js +144 -0
- package/dist/commands/paste/index.d.ts.map +1 -1
- package/dist/commands/paste/index.js +59 -62
- package/dist/commands/paste/utils.d.ts.map +1 -1
- package/dist/commands/paste/utils.js +88 -58
- package/dist/commands/pickup/index.d.ts.map +1 -1
- package/dist/commands/pickup/index.js +6 -3
- package/dist/commands/pickup/utils.js +3 -3
- package/dist/commands/resources/index.d.ts.map +1 -1
- package/dist/commands/resources/index.js +33 -50
- package/dist/commands/review/index.d.ts.map +1 -1
- package/dist/commands/review/index.js +3 -117
- package/dist/commands/review/review-panel.d.ts +3 -0
- package/dist/commands/review/review-panel.d.ts.map +1 -0
- package/dist/commands/review/review-panel.js +186 -0
- package/dist/commands/review/utils.d.ts +9 -0
- package/dist/commands/review/utils.d.ts.map +1 -1
- package/dist/commands/review/utils.js +127 -68
- package/dist/commands/session/index.d.ts +1 -1
- package/dist/commands/session/index.d.ts.map +1 -1
- package/dist/commands/session/index.js +134 -112
- package/dist/commands/session/types.d.ts +7 -0
- package/dist/commands/session/types.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/commands/shell/index.js +16 -1
- package/dist/commands/types.d.ts +2 -2
- package/dist/commands/types.d.ts.map +1 -1
- package/dist/{config.d.ts → config/index.d.ts} +20 -9
- package/dist/config/index.d.ts.map +1 -0
- package/dist/{config.js → config/index.js} +43 -42
- package/dist/execution/index.d.ts.map +1 -1
- package/dist/execution/index.js +75 -55
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +170 -127
- package/dist/middleware/cache.d.ts.map +1 -1
- package/dist/middleware/cache.js +18 -36
- package/dist/models/ai-config.d.ts +1 -0
- package/dist/models/ai-config.d.ts.map +1 -1
- package/dist/models/ai-config.js +4 -3
- package/dist/models/anthropic-provider.d.ts +2 -5
- package/dist/models/anthropic-provider.d.ts.map +1 -1
- package/dist/models/anthropic-provider.js +3 -70
- package/dist/models/deepseek-provider.d.ts +1 -0
- package/dist/models/deepseek-provider.d.ts.map +1 -1
- package/dist/models/google-provider.d.ts +2 -3
- package/dist/models/google-provider.d.ts.map +1 -1
- package/dist/models/google-provider.js +0 -26
- package/dist/models/groq-provider.d.ts +1 -0
- package/dist/models/groq-provider.d.ts.map +1 -1
- package/dist/models/manager.d.ts +13 -2
- package/dist/models/manager.d.ts.map +1 -1
- package/dist/models/manager.js +20 -8
- package/dist/models/openai-provider.d.ts +5 -5
- package/dist/models/openai-provider.d.ts.map +1 -1
- package/dist/models/openai-provider.js +27 -40
- package/dist/models/opencode-zen-provider.d.ts +8 -3
- package/dist/models/opencode-zen-provider.d.ts.map +1 -1
- package/dist/models/opencode-zen-provider.js +68 -11
- package/dist/models/openrouter-provider.d.ts +24 -30
- package/dist/models/openrouter-provider.d.ts.map +1 -1
- package/dist/models/openrouter-provider.js +92 -177
- package/dist/models/providers.d.ts +1 -1
- package/dist/models/providers.d.ts.map +1 -1
- package/dist/models/xai-provider.d.ts +4 -3
- package/dist/models/xai-provider.d.ts.map +1 -1
- package/dist/models/xai-provider.js +18 -18
- package/dist/modes/manager.d.ts +23 -0
- package/dist/modes/manager.d.ts.map +1 -0
- package/dist/modes/manager.js +77 -0
- package/dist/modes/prompts.d.ts +2 -0
- package/dist/modes/prompts.d.ts.map +1 -0
- package/dist/modes/prompts.js +143 -0
- package/dist/prompts/mentions.d.ts +11 -0
- package/dist/prompts/mentions.d.ts.map +1 -0
- package/dist/{mentions.js → prompts/mentions.js} +21 -80
- package/dist/prompts/system-prompt.d.ts +26 -0
- package/dist/prompts/system-prompt.d.ts.map +1 -0
- package/dist/{prompts.js → prompts/system-prompt.js} +50 -22
- package/dist/repl/index.d.ts +174 -0
- package/dist/repl/index.d.ts.map +1 -0
- package/dist/{repl-new.js → repl/index.js} +399 -76
- package/dist/repl/project-status.d.ts +1 -0
- package/dist/repl/project-status.d.ts.map +1 -1
- package/dist/repl/project-status.js +4 -1
- package/dist/sessions/manager.d.ts +93 -1
- package/dist/sessions/manager.d.ts.map +1 -1
- package/dist/sessions/manager.js +264 -9
- package/dist/sessions/summary.d.ts +4 -0
- package/dist/sessions/summary.d.ts.map +1 -0
- package/dist/sessions/summary.js +30 -0
- package/dist/{skills.d.ts → skills/index.d.ts} +14 -2
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +294 -0
- package/dist/subagents/index.d.ts +15 -0
- package/dist/subagents/index.d.ts.map +1 -0
- package/dist/subagents/index.js +231 -0
- package/dist/terminal/control.d.ts +1 -1
- package/dist/terminal/control.d.ts.map +1 -1
- package/dist/terminal/control.js +30 -9
- package/dist/terminal/east-asian-width.d.ts.map +1 -1
- package/dist/terminal/east-asian-width.js +404 -351
- package/dist/terminal/keys.d.ts +17 -0
- package/dist/terminal/keys.d.ts.map +1 -1
- package/dist/terminal/keys.js +37 -0
- package/dist/terminal/select-prompt.d.ts.map +1 -1
- package/dist/terminal/select-prompt.js +24 -12
- package/dist/terminal/string-width.d.ts.map +1 -1
- package/dist/terminal/string-width.js +25 -27
- package/dist/terminal/style.d.ts.map +1 -1
- package/dist/terminal/style.js +4 -7
- package/dist/terminal/supports-color.d.ts.map +1 -1
- package/dist/terminal/supports-color.js +41 -27
- package/dist/terminal/table/cell.d.ts +12 -0
- package/dist/terminal/table/cell.d.ts.map +1 -1
- package/dist/terminal/table/cell.js +40 -25
- package/dist/terminal/table/layout-manager.d.ts.map +1 -1
- package/dist/terminal/table/layout-manager.js +100 -68
- package/dist/terminal/table/utils.d.ts.map +1 -1
- package/dist/terminal/table/utils.js +17 -10
- package/dist/terminal/wrap-ansi.d.ts.map +1 -1
- package/dist/terminal/wrap-ansi.js +172 -103
- package/dist/tokens/tracker.d.ts +1 -0
- package/dist/tokens/tracker.d.ts.map +1 -1
- package/dist/tokens/tracker.js +3 -0
- package/dist/tools/agent.d.ts +27 -0
- package/dist/tools/agent.d.ts.map +1 -0
- package/dist/tools/agent.js +81 -0
- package/dist/tools/bash.d.ts +4 -3
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash.js +343 -121
- package/dist/tools/code-search.d.ts +41 -0
- package/dist/tools/code-search.d.ts.map +1 -0
- package/dist/tools/code-search.js +195 -0
- package/dist/tools/directory-tree.d.ts +3 -3
- package/dist/tools/directory-tree.d.ts.map +1 -1
- package/dist/tools/directory-tree.js +8 -5
- package/dist/tools/dynamic-tool-loader.d.ts +2 -5
- package/dist/tools/dynamic-tool-loader.d.ts.map +1 -1
- package/dist/tools/dynamic-tool-loader.js +20 -4
- package/dist/tools/edit-file.d.ts +7 -7
- package/dist/tools/edit-file.d.ts.map +1 -1
- package/dist/tools/edit-file.js +164 -66
- package/dist/tools/glob.d.ts +6 -6
- package/dist/tools/glob.d.ts.map +1 -1
- package/dist/tools/glob.js +95 -55
- package/dist/tools/grep.d.ts +15 -12
- package/dist/tools/grep.d.ts.map +1 -1
- package/dist/tools/grep.js +300 -192
- package/dist/tools/index.d.ts +143 -5
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +39 -24
- package/dist/tools/ls.d.ts +2 -2
- package/dist/tools/ls.d.ts.map +1 -1
- package/dist/tools/ls.js +7 -5
- package/dist/tools/read-file.d.ts +3 -3
- package/dist/tools/read-file.d.ts.map +1 -1
- package/dist/tools/read-file.js +74 -34
- package/dist/tools/save-file.d.ts +3 -3
- package/dist/tools/save-file.d.ts.map +1 -1
- package/dist/tools/save-file.js +11 -11
- package/dist/tools/skill.d.ts +23 -0
- package/dist/tools/skill.d.ts.map +1 -0
- package/dist/tools/skill.js +65 -0
- package/dist/tools/think.d.ts.map +1 -1
- package/dist/tools/think.js +2 -9
- package/dist/tools/utils.d.ts +2 -0
- package/dist/tools/utils.d.ts.map +1 -1
- package/dist/tools/utils.js +12 -0
- package/dist/tools/web-fetch.d.ts +62 -0
- package/dist/tools/web-fetch.d.ts.map +1 -0
- package/dist/tools/web-fetch.js +429 -0
- package/dist/tools/web-search.d.ts +62 -0
- package/dist/tools/web-search.d.ts.map +1 -0
- package/dist/tools/web-search.js +226 -0
- package/dist/tui/autocomplete/attachment-provider.d.ts +3 -6
- package/dist/tui/autocomplete/attachment-provider.d.ts.map +1 -1
- package/dist/tui/autocomplete/attachment-provider.js +25 -78
- package/dist/tui/autocomplete/base-provider.d.ts +1 -0
- package/dist/tui/autocomplete/base-provider.d.ts.map +1 -1
- package/dist/tui/autocomplete/combined-provider.d.ts +1 -4
- package/dist/tui/autocomplete/combined-provider.d.ts.map +1 -1
- package/dist/tui/autocomplete/combined-provider.js +3 -17
- package/dist/tui/autocomplete/command-provider.d.ts +1 -0
- package/dist/tui/autocomplete/command-provider.d.ts.map +1 -1
- package/dist/tui/autocomplete/command-provider.js +3 -0
- package/dist/tui/autocomplete/file-search-provider.d.ts +2 -1
- package/dist/tui/autocomplete/file-search-provider.d.ts.map +1 -1
- package/dist/tui/autocomplete/file-search-provider.js +36 -16
- package/dist/tui/autocomplete/skill-provider.d.ts +17 -0
- package/dist/tui/autocomplete/skill-provider.d.ts.map +1 -0
- package/dist/tui/autocomplete/skill-provider.js +49 -0
- package/dist/tui/autocomplete.d.ts +2 -2
- package/dist/tui/autocomplete.d.ts.map +1 -1
- package/dist/tui/autocomplete.js +3 -5
- package/dist/tui/components/assistant-message.d.ts.map +1 -1
- package/dist/tui/components/assistant-message.js +0 -4
- package/dist/tui/components/editor.d.ts +21 -2
- package/dist/tui/components/editor.d.ts.map +1 -1
- package/dist/tui/components/editor.js +228 -236
- package/dist/tui/components/footer.d.ts +6 -4
- package/dist/tui/components/footer.d.ts.map +1 -1
- package/dist/tui/components/footer.js +49 -25
- package/dist/tui/components/markdown.d.ts +8 -5
- package/dist/tui/components/markdown.d.ts.map +1 -1
- package/dist/tui/components/markdown.js +57 -39
- package/dist/tui/components/modal.d.ts.map +1 -1
- package/dist/tui/components/modal.js +35 -33
- package/dist/tui/components/notification.d.ts +13 -2
- package/dist/tui/components/notification.d.ts.map +1 -1
- package/dist/tui/components/notification.js +37 -2
- package/dist/tui/components/progress-bar.js +1 -1
- package/dist/tui/components/select-list.d.ts +1 -0
- package/dist/tui/components/select-list.d.ts.map +1 -1
- package/dist/tui/components/select-list.js +14 -11
- package/dist/tui/components/text.d.ts +16 -0
- package/dist/tui/components/text.d.ts.map +1 -1
- package/dist/tui/components/text.js +72 -57
- package/dist/tui/components/thinking-block.d.ts +9 -0
- package/dist/tui/components/thinking-block.d.ts.map +1 -1
- package/dist/tui/components/thinking-block.js +43 -11
- package/dist/tui/components/tool-execution.d.ts +5 -1
- package/dist/tui/components/tool-execution.d.ts.map +1 -1
- package/dist/tui/components/tool-execution.js +19 -10
- package/dist/tui/components/user-message.d.ts.map +1 -1
- package/dist/tui/components/user-message.js +0 -3
- package/dist/tui/components/welcome.js +2 -2
- 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 +3 -1
- package/dist/tui/index.d.ts.map +1 -1
- package/dist/tui/index.js +1 -0
- package/dist/tui/terminal.d.ts +27 -0
- package/dist/tui/terminal.d.ts.map +1 -1
- package/dist/tui/terminal.js +144 -15
- package/dist/tui/tui.d.ts +43 -0
- package/dist/tui/tui.d.ts.map +1 -1
- package/dist/tui/tui.js +172 -41
- package/dist/utils/bash/parse.d.ts +19 -0
- package/dist/utils/bash/parse.d.ts.map +1 -0
- package/dist/utils/bash/parse.js +223 -0
- package/dist/utils/bash/quote.d.ts +6 -0
- package/dist/utils/bash/quote.d.ts.map +1 -0
- package/dist/utils/bash/quote.js +23 -0
- package/dist/utils/bash.d.ts.map +1 -1
- package/dist/utils/bash.js +211 -126
- package/dist/utils/command-protection.d.ts +28 -0
- package/dist/utils/command-protection.d.ts.map +1 -0
- package/dist/utils/command-protection.js +324 -0
- package/dist/utils/dedent.d.ts.map +1 -0
- package/dist/utils/env-expand.d.ts +2 -0
- package/dist/utils/env-expand.d.ts.map +1 -0
- package/dist/utils/env-expand.js +8 -0
- package/dist/utils/filesystem/path-display.d.ts +11 -0
- package/dist/utils/filesystem/path-display.d.ts.map +1 -0
- package/dist/utils/filesystem/path-display.js +32 -0
- package/dist/utils/filesystem/security.d.ts +2 -2
- package/dist/utils/filesystem/security.d.ts.map +1 -1
- package/dist/utils/filesystem/security.js +32 -31
- package/dist/utils/formatting.d.ts.map +1 -0
- package/dist/{formatting.js → utils/formatting.js} +1 -1
- package/dist/utils/git.d.ts +4 -0
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js +30 -0
- package/dist/utils/glob.d.ts +1 -1
- package/dist/utils/glob.d.ts.map +1 -1
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/{logger.js → utils/logger.js} +1 -1
- package/dist/utils/parsing.d.ts.map +1 -0
- package/dist/utils/process.d.ts.map +1 -1
- package/dist/utils/process.js +90 -37
- package/dist/utils/templates.d.ts +2 -0
- package/dist/utils/templates.d.ts.map +1 -0
- package/dist/utils/templates.js +24 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/dist/{version.js → utils/version.js} +1 -1
- package/package.json +34 -25
- package/dist/cli.d.ts +0 -23
- package/dist/cli.d.ts.map +0 -1
- package/dist/commands/exit/index.d.ts +0 -10
- package/dist/commands/exit/index.d.ts.map +0 -1
- package/dist/commands/exit/index.js +0 -21
- package/dist/commands/exit/types.d.ts +0 -8
- package/dist/commands/exit/types.d.ts.map +0 -1
- package/dist/commands/exit/types.js +0 -1
- package/dist/commands/exit/utils.d.ts +0 -2
- package/dist/commands/exit/utils.d.ts.map +0 -1
- package/dist/commands/exit/utils.js +0 -13
- package/dist/commands/prompt/index.d.ts +0 -5
- package/dist/commands/prompt/index.d.ts.map +0 -1
- package/dist/commands/prompt/index.js +0 -126
- package/dist/commands/prompt/types.d.ts +0 -15
- package/dist/commands/prompt/types.d.ts.map +0 -1
- package/dist/commands/prompt/types.js +0 -1
- package/dist/commands/prompt/utils.d.ts +0 -12
- package/dist/commands/prompt/utils.d.ts.map +0 -1
- package/dist/commands/prompt/utils.js +0 -107
- package/dist/commands/reset/index.d.ts +0 -3
- package/dist/commands/reset/index.d.ts.map +0 -1
- package/dist/commands/reset/index.js +0 -25
- package/dist/commands/reset/types.d.ts +0 -1
- package/dist/commands/reset/types.d.ts.map +0 -1
- package/dist/commands/reset/types.js +0 -3
- package/dist/commands/save/index.d.ts +0 -3
- package/dist/commands/save/index.d.ts.map +0 -1
- package/dist/commands/save/index.js +0 -19
- package/dist/config.d.ts.map +0 -1
- package/dist/dedent.d.ts.map +0 -1
- package/dist/formatting.d.ts.map +0 -1
- package/dist/logger.d.ts.map +0 -1
- package/dist/mentions.d.ts +0 -14
- package/dist/mentions.d.ts.map +0 -1
- package/dist/parsing.d.ts.map +0 -1
- package/dist/prompts.d.ts +0 -10
- package/dist/prompts.d.ts.map +0 -1
- package/dist/repl-new.d.ts +0 -62
- package/dist/repl-new.d.ts.map +0 -1
- package/dist/skills.d.ts.map +0 -1
- package/dist/skills.js +0 -233
- package/dist/tui/autocomplete/path-provider.d.ts +0 -21
- package/dist/tui/autocomplete/path-provider.d.ts.map +0 -1
- package/dist/tui/autocomplete/path-provider.js +0 -164
- package/dist/version.d.ts.map +0 -1
- /package/dist/{dedent.d.ts → utils/dedent.d.ts} +0 -0
- /package/dist/{dedent.js → utils/dedent.js} +0 -0
- /package/dist/{formatting.d.ts → utils/formatting.d.ts} +0 -0
- /package/dist/{logger.d.ts → utils/logger.d.ts} +0 -0
- /package/dist/{parsing.d.ts → utils/parsing.d.ts} +0 -0
- /package/dist/{parsing.js → utils/parsing.js} +0 -0
- /package/dist/{version.d.ts → utils/version.d.ts} +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { createOpenResponses } from "@ai-sdk/open-responses";
|
|
2
2
|
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
|
|
3
3
|
import { objectKeys } from "@travisennis/stdlib/object";
|
|
4
4
|
import { customProvider } from "ai";
|
|
5
|
+
// Original OpenAI-compatible client for most models
|
|
5
6
|
const openRouterClient = createOpenAICompatible({
|
|
6
7
|
name: "openrouter",
|
|
7
8
|
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
@@ -12,65 +13,51 @@ const openRouterClient = createOpenAICompatible({
|
|
|
12
13
|
"X-Title": "acai",
|
|
13
14
|
},
|
|
14
15
|
});
|
|
15
|
-
//
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
// Open Responses client for GPT models
|
|
17
|
+
const openResponses = createOpenResponses({
|
|
18
|
+
name: "openrouter",
|
|
19
|
+
url: "https://openrouter.ai/api/v1/responses",
|
|
20
|
+
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
|
|
21
|
+
headers: {
|
|
22
|
+
"HTTP-Referer": "https://github.com/travisennis/acai-ts",
|
|
23
|
+
"X-Title": "acai",
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
// Models using OpenAI-compatible API
|
|
25
27
|
const openrouterModels = {
|
|
26
|
-
"claude-3-5-sonnet": openRouterClient("anthropic/claude-3.5-sonnet"),
|
|
27
28
|
"deepseek-v3-2": openRouterClient("deepseek/deepseek-v3.2"),
|
|
28
|
-
"gemini-3-pro": openRouterClient("google/gemini-3-pro-preview"),
|
|
29
29
|
"glm-4-7": openRouterClient("z-ai/glm-4.7"),
|
|
30
|
-
"
|
|
31
|
-
"minimax-m2-
|
|
30
|
+
"glm-4-7-flash": openRouterClient("z-ai/glm-4.7-flash"),
|
|
31
|
+
"minimax-m2-5": openRouterClient("minimax/minimax-m2.5"),
|
|
32
32
|
"sonnet-4.5": openRouterClient("anthropic/claude-sonnet-4.5"),
|
|
33
|
-
"opus-4.
|
|
33
|
+
"opus-4.6": openRouterClient("anthropic/claude-opus-4.6"),
|
|
34
34
|
"haiku-4.5": openRouterClient("anthropic/claude-haiku-4.5"),
|
|
35
|
-
"kimi-k2": openRouterClient("moonshotai/kimi-k2
|
|
36
|
-
"kimi-k2-thinking": openRouterClient("moonshotai/kimi-k2-thinking"),
|
|
37
|
-
"devstral-medium": openRouterClient("mistralai/devstral-medium"),
|
|
38
|
-
"devstral-2512-free": openRouterClient("mistralai/devstral-2512:free"),
|
|
39
|
-
"qwen3-coder": openRouterClient("qwen/qwen3-coder:exacto"),
|
|
40
|
-
"qwen3-coder-plus": openRouterClient("qwen/qwen3-coder-plus"),
|
|
35
|
+
"kimi-k2-5": openRouterClient("moonshotai/kimi-k2.5"),
|
|
41
36
|
"qwen3-max": openRouterClient("qwen/qwen3-max"),
|
|
42
|
-
"
|
|
43
|
-
"
|
|
37
|
+
"qwen3-max-thinking": openRouterClient("qwen/qwen3-max-thinking"),
|
|
38
|
+
"qwen3-coder-next": openRouterClient("qwen/qwen3-coder-next"),
|
|
39
|
+
"glm-5": openRouterClient("z-ai/glm-5"),
|
|
44
40
|
"grok-code-fast-1": openRouterClient("x-ai/grok-code-fast-1"),
|
|
45
|
-
"grok-4-fast": openRouterClient("x-ai/grok-4-fast"),
|
|
46
|
-
"gpt-5.1": openRouterClient("openai/gpt-5.1"),
|
|
47
|
-
"gpt-5.1-codex": openRouterClient("openai/gpt-5.1-codex"),
|
|
48
|
-
"gpt-5.1-codex-mini": openRouterClient("openai/gpt-5.1-codex-mini"),
|
|
49
|
-
"gpt-5.1-codex-max": openRouterClient("openai/gpt-5.1-codex-max"),
|
|
50
|
-
"gpt-5.2": openRouterClient("openai/gpt-5.2"),
|
|
51
|
-
"minimax-m2": openRouterClient("minimax/minimax-m2"),
|
|
52
|
-
"gemini-3-flash-preview": openRouterClient("google/gemini-3-flash-preview"),
|
|
41
|
+
"grok-4-1-fast": openRouterClient("x-ai/grok-4.1-fast"),
|
|
53
42
|
};
|
|
54
|
-
|
|
43
|
+
// Models using Open Responses API (GPT models)
|
|
44
|
+
const openResponsesModels = {
|
|
45
|
+
"gpt-oss-120b": openResponses("openai/gpt-oss-120b:exacto"),
|
|
46
|
+
"gpt-5.1-codex-mini": openResponses("openai/gpt-5.1-codex-mini"),
|
|
47
|
+
"gpt-5.1-codex-max": openResponses("openai/gpt-5.1-codex-max"),
|
|
48
|
+
"gpt-5.2": openResponses("openai/gpt-5.2"),
|
|
49
|
+
"gpt-5.2-codex": openResponses("openai/gpt-5.2-codex"),
|
|
50
|
+
"gpt-5-3-codex": openResponses("openai/gpt-5.3-codex"),
|
|
51
|
+
};
|
|
52
|
+
const allModels = { ...openrouterModels, ...openResponsesModels };
|
|
53
|
+
export const openrouterModelNames = objectKeys(allModels).map((key) => `openrouter:${key}`);
|
|
55
54
|
export const openrouterProvider = {
|
|
56
55
|
openrouter: customProvider({
|
|
57
|
-
languageModels:
|
|
56
|
+
languageModels: allModels,
|
|
58
57
|
fallbackProvider: openRouterClient,
|
|
59
58
|
}),
|
|
60
59
|
};
|
|
61
60
|
export const openrouterModelRegistry = {
|
|
62
|
-
"openrouter:claude-3-5-sonnet": {
|
|
63
|
-
id: "openrouter:claude-3-5-sonnet",
|
|
64
|
-
provider: "openrouter",
|
|
65
|
-
contextWindow: 200000,
|
|
66
|
-
maxOutputTokens: 8192,
|
|
67
|
-
defaultTemperature: 0.5,
|
|
68
|
-
promptFormat: "markdown",
|
|
69
|
-
supportsReasoning: false,
|
|
70
|
-
supportsToolCalling: true,
|
|
71
|
-
costPerInputToken: 0.000006,
|
|
72
|
-
costPerOutputToken: 0.00003,
|
|
73
|
-
},
|
|
74
61
|
"openrouter:deepseek-v3-2": {
|
|
75
62
|
id: "openrouter:deepseek-v3-2",
|
|
76
63
|
provider: "openrouter",
|
|
@@ -83,18 +70,6 @@ export const openrouterModelRegistry = {
|
|
|
83
70
|
costPerInputToken: 0.00000027,
|
|
84
71
|
costPerOutputToken: 0.0000004,
|
|
85
72
|
},
|
|
86
|
-
"openrouter:gemini-3-pro": {
|
|
87
|
-
id: "openrouter:gemini-3-pro",
|
|
88
|
-
provider: "openrouter",
|
|
89
|
-
contextWindow: 1048576,
|
|
90
|
-
maxOutputTokens: 65536,
|
|
91
|
-
defaultTemperature: 0.5,
|
|
92
|
-
promptFormat: "markdown",
|
|
93
|
-
supportsReasoning: true,
|
|
94
|
-
supportsToolCalling: true,
|
|
95
|
-
costPerInputToken: 0.000002,
|
|
96
|
-
costPerOutputToken: 0.000012,
|
|
97
|
-
},
|
|
98
73
|
"openrouter:glm-4-7": {
|
|
99
74
|
id: "openrouter:glm-4-7",
|
|
100
75
|
provider: "openrouter",
|
|
@@ -107,20 +82,20 @@ export const openrouterModelRegistry = {
|
|
|
107
82
|
costPerInputToken: 1.1e-7,
|
|
108
83
|
costPerOutputToken: 0.0000022,
|
|
109
84
|
},
|
|
110
|
-
"openrouter:
|
|
111
|
-
id: "openrouter:
|
|
85
|
+
"openrouter:glm-4-7-flash": {
|
|
86
|
+
id: "openrouter:glm-4-7-flash",
|
|
112
87
|
provider: "openrouter",
|
|
113
|
-
contextWindow:
|
|
114
|
-
maxOutputTokens:
|
|
115
|
-
defaultTemperature:
|
|
88
|
+
contextWindow: 200000,
|
|
89
|
+
maxOutputTokens: 131072,
|
|
90
|
+
defaultTemperature: 0.5,
|
|
116
91
|
promptFormat: "markdown",
|
|
117
|
-
supportsReasoning:
|
|
92
|
+
supportsReasoning: true,
|
|
118
93
|
supportsToolCalling: true,
|
|
119
|
-
costPerInputToken:
|
|
120
|
-
costPerOutputToken:
|
|
94
|
+
costPerInputToken: 7e-8,
|
|
95
|
+
costPerOutputToken: 4e-7,
|
|
121
96
|
},
|
|
122
|
-
"openrouter:minimax-m2-
|
|
123
|
-
id: "openrouter:minimax-m2-
|
|
97
|
+
"openrouter:minimax-m2-5": {
|
|
98
|
+
id: "openrouter:minimax-m2-5",
|
|
124
99
|
provider: "openrouter",
|
|
125
100
|
contextWindow: 204800,
|
|
126
101
|
maxOutputTokens: 131072,
|
|
@@ -131,8 +106,8 @@ export const openrouterModelRegistry = {
|
|
|
131
106
|
costPerInputToken: 3e-7,
|
|
132
107
|
costPerOutputToken: 0.0000012,
|
|
133
108
|
},
|
|
134
|
-
"openrouter:opus-4.
|
|
135
|
-
id: "openrouter:opus-4.
|
|
109
|
+
"openrouter:opus-4.6": {
|
|
110
|
+
id: "openrouter:opus-4.6",
|
|
136
111
|
provider: "openrouter",
|
|
137
112
|
contextWindow: 200000,
|
|
138
113
|
maxOutputTokens: 32000,
|
|
@@ -155,77 +130,17 @@ export const openrouterModelRegistry = {
|
|
|
155
130
|
costPerInputToken: 0.000003,
|
|
156
131
|
costPerOutputToken: 0.000015,
|
|
157
132
|
},
|
|
158
|
-
"openrouter:kimi-k2": {
|
|
159
|
-
id: "openrouter:kimi-k2",
|
|
160
|
-
provider: "openrouter",
|
|
161
|
-
contextWindow: 262144,
|
|
162
|
-
maxOutputTokens: 8192,
|
|
163
|
-
defaultTemperature: 0.6,
|
|
164
|
-
promptFormat: "markdown",
|
|
165
|
-
supportsReasoning: false,
|
|
166
|
-
supportsToolCalling: true,
|
|
167
|
-
costPerInputToken: 0.0000006,
|
|
168
|
-
costPerOutputToken: 0.0000025,
|
|
169
|
-
},
|
|
170
|
-
"openrouter:kimi-k2-thinking": {
|
|
171
|
-
id: "openrouter:kimi-k2-thinking",
|
|
133
|
+
"openrouter:kimi-k2-5": {
|
|
134
|
+
id: "openrouter:kimi-k2-5",
|
|
172
135
|
provider: "openrouter",
|
|
173
136
|
contextWindow: 262144,
|
|
174
|
-
maxOutputTokens:
|
|
175
|
-
defaultTemperature: 0
|
|
137
|
+
maxOutputTokens: 262144,
|
|
138
|
+
defaultTemperature: 1.0,
|
|
176
139
|
promptFormat: "markdown",
|
|
177
140
|
supportsReasoning: true,
|
|
178
141
|
supportsToolCalling: true,
|
|
179
|
-
costPerInputToken:
|
|
180
|
-
costPerOutputToken: 0.
|
|
181
|
-
},
|
|
182
|
-
"openrouter:devstral-medium": {
|
|
183
|
-
id: "openrouter:devstral-medium",
|
|
184
|
-
provider: "openrouter",
|
|
185
|
-
contextWindow: 131000,
|
|
186
|
-
maxOutputTokens: 8192,
|
|
187
|
-
defaultTemperature: 0.3,
|
|
188
|
-
promptFormat: "markdown",
|
|
189
|
-
supportsReasoning: false,
|
|
190
|
-
supportsToolCalling: true,
|
|
191
|
-
costPerInputToken: 0.0000004,
|
|
192
|
-
costPerOutputToken: 0.000002,
|
|
193
|
-
},
|
|
194
|
-
"openrouter:devstral-2512-free": {
|
|
195
|
-
id: "openrouter:devstral-2512-free",
|
|
196
|
-
provider: "openrouter",
|
|
197
|
-
contextWindow: 262144,
|
|
198
|
-
maxOutputTokens: 32768,
|
|
199
|
-
defaultTemperature: 0.3,
|
|
200
|
-
promptFormat: "markdown",
|
|
201
|
-
supportsReasoning: false,
|
|
202
|
-
supportsToolCalling: true,
|
|
203
|
-
costPerInputToken: 0,
|
|
204
|
-
costPerOutputToken: 0,
|
|
205
|
-
},
|
|
206
|
-
"openrouter:qwen3-coder": {
|
|
207
|
-
id: "openrouter:qwen3-coder",
|
|
208
|
-
provider: "openrouter",
|
|
209
|
-
contextWindow: 262000,
|
|
210
|
-
maxOutputTokens: 66000,
|
|
211
|
-
defaultTemperature: 0.55,
|
|
212
|
-
promptFormat: "markdown",
|
|
213
|
-
supportsReasoning: false,
|
|
214
|
-
supportsToolCalling: true,
|
|
215
|
-
costPerInputToken: 0.0000004,
|
|
216
|
-
costPerOutputToken: 0.000002,
|
|
217
|
-
},
|
|
218
|
-
"openrouter:qwen3-coder-plus": {
|
|
219
|
-
id: "openrouter:qwen3-coder-plus",
|
|
220
|
-
provider: "openrouter",
|
|
221
|
-
contextWindow: 128000,
|
|
222
|
-
maxOutputTokens: 65536,
|
|
223
|
-
defaultTemperature: 0.55,
|
|
224
|
-
promptFormat: "markdown",
|
|
225
|
-
supportsReasoning: false,
|
|
226
|
-
supportsToolCalling: true,
|
|
227
|
-
costPerInputToken: 0.000001,
|
|
228
|
-
costPerOutputToken: 0.000005,
|
|
142
|
+
costPerInputToken: 6e-7,
|
|
143
|
+
costPerOutputToken: 0.000003,
|
|
229
144
|
},
|
|
230
145
|
"openrouter:qwen3-max": {
|
|
231
146
|
id: "openrouter:qwen3-max",
|
|
@@ -239,41 +154,41 @@ export const openrouterModelRegistry = {
|
|
|
239
154
|
costPerInputToken: 0.0000012,
|
|
240
155
|
costPerOutputToken: 0.000006,
|
|
241
156
|
},
|
|
242
|
-
"openrouter:
|
|
243
|
-
id: "openrouter:
|
|
157
|
+
"openrouter:qwen3-max-thinking": {
|
|
158
|
+
id: "openrouter:qwen3-max-thinking",
|
|
244
159
|
provider: "openrouter",
|
|
245
|
-
contextWindow:
|
|
246
|
-
maxOutputTokens:
|
|
247
|
-
defaultTemperature: 0.
|
|
160
|
+
contextWindow: 262144,
|
|
161
|
+
maxOutputTokens: 65536,
|
|
162
|
+
defaultTemperature: 0.5,
|
|
248
163
|
promptFormat: "markdown",
|
|
249
164
|
supportsReasoning: true,
|
|
250
165
|
supportsToolCalling: true,
|
|
251
|
-
costPerInputToken: 0.
|
|
252
|
-
costPerOutputToken: 0.
|
|
166
|
+
costPerInputToken: 0.0000012,
|
|
167
|
+
costPerOutputToken: 0.000006,
|
|
253
168
|
},
|
|
254
|
-
"openrouter:
|
|
255
|
-
id: "openrouter:
|
|
169
|
+
"openrouter:glm-5": {
|
|
170
|
+
id: "openrouter:glm-5",
|
|
256
171
|
provider: "openrouter",
|
|
257
|
-
contextWindow:
|
|
258
|
-
maxOutputTokens:
|
|
259
|
-
defaultTemperature:
|
|
260
|
-
promptFormat: "
|
|
172
|
+
contextWindow: 204800,
|
|
173
|
+
maxOutputTokens: 64800,
|
|
174
|
+
defaultTemperature: 0.5,
|
|
175
|
+
promptFormat: "markdown",
|
|
261
176
|
supportsReasoning: true,
|
|
262
177
|
supportsToolCalling: true,
|
|
263
|
-
costPerInputToken: 0.
|
|
264
|
-
costPerOutputToken: 0.
|
|
178
|
+
costPerInputToken: 0.000001,
|
|
179
|
+
costPerOutputToken: 0.0000032,
|
|
265
180
|
},
|
|
266
|
-
"openrouter:
|
|
267
|
-
id: "openrouter:
|
|
181
|
+
"openrouter:qwen3-coder-next": {
|
|
182
|
+
id: "openrouter:qwen3-coder-next",
|
|
268
183
|
provider: "openrouter",
|
|
269
|
-
contextWindow:
|
|
270
|
-
maxOutputTokens:
|
|
184
|
+
contextWindow: 262144,
|
|
185
|
+
maxOutputTokens: 65536,
|
|
271
186
|
defaultTemperature: -1,
|
|
272
|
-
promptFormat: "
|
|
273
|
-
supportsReasoning:
|
|
187
|
+
promptFormat: "markdown",
|
|
188
|
+
supportsReasoning: false,
|
|
274
189
|
supportsToolCalling: true,
|
|
275
|
-
costPerInputToken: 0.
|
|
276
|
-
costPerOutputToken: 0.
|
|
190
|
+
costPerInputToken: 0.00000007,
|
|
191
|
+
costPerOutputToken: 0.0000003,
|
|
277
192
|
},
|
|
278
193
|
"openrouter:gpt-5.1-codex-mini": {
|
|
279
194
|
id: "openrouter:gpt-5.1-codex-mini",
|
|
@@ -323,8 +238,8 @@ export const openrouterModelRegistry = {
|
|
|
323
238
|
costPerInputToken: 0.00000007256312,
|
|
324
239
|
costPerOutputToken: 0.0000002903936,
|
|
325
240
|
},
|
|
326
|
-
"openrouter:grok-4-fast": {
|
|
327
|
-
id: "openrouter:grok-4-fast",
|
|
241
|
+
"openrouter:grok-4-1-fast": {
|
|
242
|
+
id: "openrouter:grok-4-1-fast",
|
|
328
243
|
provider: "openrouter",
|
|
329
244
|
contextWindow: 2000000,
|
|
330
245
|
maxOutputTokens: 30000,
|
|
@@ -359,28 +274,28 @@ export const openrouterModelRegistry = {
|
|
|
359
274
|
costPerInputToken: 0.00000175,
|
|
360
275
|
costPerOutputToken: 0.000014,
|
|
361
276
|
},
|
|
362
|
-
"openrouter:
|
|
363
|
-
id: "openrouter:
|
|
277
|
+
"openrouter:gpt-5.2-codex": {
|
|
278
|
+
id: "openrouter:gpt-5.2-codex",
|
|
364
279
|
provider: "openrouter",
|
|
365
|
-
contextWindow:
|
|
366
|
-
maxOutputTokens:
|
|
367
|
-
defaultTemperature:
|
|
368
|
-
promptFormat: "
|
|
280
|
+
contextWindow: 400000,
|
|
281
|
+
maxOutputTokens: 128000,
|
|
282
|
+
defaultTemperature: -1,
|
|
283
|
+
promptFormat: "xml",
|
|
369
284
|
supportsReasoning: true,
|
|
370
285
|
supportsToolCalling: true,
|
|
371
|
-
costPerInputToken: 0.
|
|
372
|
-
costPerOutputToken: 0.
|
|
286
|
+
costPerInputToken: 0.00000175,
|
|
287
|
+
costPerOutputToken: 0.000014,
|
|
373
288
|
},
|
|
374
|
-
"openrouter:
|
|
375
|
-
id: "openrouter:
|
|
289
|
+
"openrouter:gpt-5-3-codex": {
|
|
290
|
+
id: "openrouter:gpt-5-3-codex",
|
|
376
291
|
provider: "openrouter",
|
|
377
|
-
contextWindow:
|
|
378
|
-
maxOutputTokens:
|
|
379
|
-
defaultTemperature:
|
|
380
|
-
promptFormat: "
|
|
292
|
+
contextWindow: 400000,
|
|
293
|
+
maxOutputTokens: 128000,
|
|
294
|
+
defaultTemperature: -1,
|
|
295
|
+
promptFormat: "xml",
|
|
381
296
|
supportsReasoning: true,
|
|
382
297
|
supportsToolCalling: true,
|
|
383
|
-
costPerInputToken: 0.
|
|
384
|
-
costPerOutputToken: 0.
|
|
298
|
+
costPerInputToken: 0.00000175,
|
|
299
|
+
costPerOutputToken: 0.000014,
|
|
385
300
|
},
|
|
386
301
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const providers: readonly ["anthropic", "openai", "google", "groq", "deepseek", "openrouter", "xai", "opencode"];
|
|
2
2
|
type ModelProvider = (typeof providers)[number];
|
|
3
|
-
export declare const models: readonly ("anthropic:opus" | "anthropic:sonnet" | "anthropic:
|
|
3
|
+
export declare const models: readonly ("anthropic:opus" | "anthropic:sonnet" | "anthropic:haiku" | "deepseek:deepseek-chat" | "deepseek:deepseek-reasoner" | "google:flash25lite" | "groq:kimi-k2-instruct-0905" | "openai:gpt-5.1-codex-mini" | "openai:gpt-5.2" | "openai:gpt-5.2-codex" | "opencode:gpt-5.2-codex" | "opencode:glm-5" | "opencode:minimax-m2.5-free" | "opencode:glm-4-7" | "opencode:opus-4-6" | "opencode:kimi-k2-5-free" | "opencode:kimi-k2-5" | "openrouter:gpt-5.1-codex-mini" | "openrouter:gpt-5.1-codex-max" | "openrouter:gpt-5.2" | "openrouter:gpt-5.2-codex" | "openrouter:glm-5" | "openrouter:glm-4-7" | "openrouter:kimi-k2-5" | "openrouter:gpt-oss-120b" | "openrouter:gpt-5-3-codex" | "openrouter:deepseek-v3-2" | "openrouter:glm-4-7-flash" | "openrouter:minimax-m2-5" | "openrouter:sonnet-4.5" | "openrouter:opus-4.6" | "openrouter:haiku-4.5" | "openrouter:qwen3-max" | "openrouter:qwen3-max-thinking" | "openrouter:qwen3-coder-next" | "openrouter:grok-code-fast-1" | "openrouter:grok-4-1-fast" | "xai:grok-code-fast-1" | "xai:grok-4-1-fast")[];
|
|
4
4
|
export type ModelName = (typeof models)[number] | (`xai:${string}` & {}) | (`openai:${string}` & {}) | (`anthropic:${string}` & {}) | (`google:${string}` & {}) | (`groq:${string}` & {}) | (`deepseek:${string}` & {}) | (`openrouter:${string}` & {}) | (`opencode:${string}` & {});
|
|
5
5
|
export declare function isSupportedModel(model: unknown): model is ModelName;
|
|
6
6
|
export declare function languageModel(model: ModelName): import("@ai-sdk/provider").LanguageModelV3;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../source/models/providers.ts"],"names":[],"mappings":"AA2CA,QAAA,MAAM,SAAS,iGASL,CAAC;AAEX,KAAK,aAAa,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAahD,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../source/models/providers.ts"],"names":[],"mappings":"AA2CA,QAAA,MAAM,SAAS,iGASL,CAAC;AAEX,KAAK,aAAa,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAahD,eAAO,MAAM,MAAM,0gCAST,CAAC;AAEX,MAAM,MAAM,SAAS,GACjB,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,GACvB,CAAC,OAAO,MAAM,EAAE,GAAG,EAAE,CAAC,GACtB,CAAC,UAAU,MAAM,EAAE,GAAG,EAAE,CAAC,GACzB,CAAC,aAAa,MAAM,EAAE,GAAG,EAAE,CAAC,GAC5B,CAAC,UAAU,MAAM,EAAE,GAAG,EAAE,CAAC,GACzB,CAAC,QAAQ,MAAM,EAAE,GAAG,EAAE,CAAC,GACvB,CAAC,YAAY,MAAM,EAAE,GAAG,EAAE,CAAC,GAC3B,CAAC,cAAc,MAAM,EAAE,GAAG,EAAE,CAAC,GAC7B,CAAC,YAAY,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;AAEhC,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAanE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,8CAE7C;AAED,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,SAAS;IAC1C,EAAE,EAAE,CAAC,CAAC;IACN,QAAQ,EAAE,aAAa,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,YAAY,EAAE,KAAK,GAAG,UAAU,GAAG,SAAS,CAAC;CAC9C;AAGD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,SAAS,EAAE,aAAa,CAS1D,CAAC;AAGF,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,IAAI,SAAS,CAEtE"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import type { ModelMetadata } from "./providers.ts";
|
|
2
2
|
declare const xaiModels: {
|
|
3
|
-
readonly
|
|
4
|
-
readonly "
|
|
3
|
+
readonly "grok-4-1-fast": import("@ai-sdk/provider").LanguageModelV3;
|
|
4
|
+
readonly "grok-code-fast-1": import("@ai-sdk/provider").LanguageModelV3;
|
|
5
5
|
};
|
|
6
6
|
type ModelName = `xai:${keyof typeof xaiModels}`;
|
|
7
7
|
export declare const xaiModelNames: ModelName[];
|
|
8
8
|
export declare const xaiProvider: {
|
|
9
9
|
xai: import("@ai-sdk/provider").ProviderV3 & {
|
|
10
|
-
languageModel(modelId: "
|
|
10
|
+
languageModel(modelId: "grok-code-fast-1" | "grok-4-1-fast"): import("@ai-sdk/provider").LanguageModelV3;
|
|
11
11
|
embeddingModel(modelId: string): import("@ai-sdk/provider").EmbeddingModelV3;
|
|
12
12
|
imageModel(modelId: string): import("@ai-sdk/provider").ImageModelV3;
|
|
13
13
|
transcriptionModel(modelId: string): import("@ai-sdk/provider").TranscriptionModelV3;
|
|
14
14
|
rerankingModel(modelId: string): import("@ai-sdk/provider").RerankingModelV3;
|
|
15
15
|
speechModel(modelId: string): import("@ai-sdk/provider").SpeechModelV3;
|
|
16
|
+
videoModel(modelId: string): import("@ai-sdk/provider").Experimental_VideoModelV3;
|
|
16
17
|
};
|
|
17
18
|
};
|
|
18
19
|
export declare const xaiModelRegistry: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xai-provider.d.ts","sourceRoot":"","sources":["../../source/models/xai-provider.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAQpD,QAAA,MAAM,SAAS;;;CAGL,CAAC;AAEX,KAAK,SAAS,GAAG,OAAO,MAAM,OAAO,SAAS,EAAE,CAAC;AAEjD,eAAO,MAAM,aAAa,EAAE,SAAS,EAEpC,CAAC;AAEF,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"xai-provider.d.ts","sourceRoot":"","sources":["../../source/models/xai-provider.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAQpD,QAAA,MAAM,SAAS;;;CAGL,CAAC;AAEX,KAAK,SAAS,GAAG,OAAO,MAAM,OAAO,SAAS,EAAE,CAAC;AAEjD,eAAO,MAAM,aAAa,EAAE,SAAS,EAEpC,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;CAKvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE;KAC5B,CAAC,IAAI,SAAS,GAAG,aAAa,CAAC,SAAS,CAAC;CA0B3C,CAAC"}
|
|
@@ -7,8 +7,8 @@ const xaiClient = createOpenAI({
|
|
|
7
7
|
baseURL: "https://api.x.ai/v1",
|
|
8
8
|
});
|
|
9
9
|
const xaiModels = {
|
|
10
|
-
|
|
11
|
-
"
|
|
10
|
+
"grok-4-1-fast": xaiClient("grok-4.1-fast"),
|
|
11
|
+
"grok-code-fast-1": xaiClient("grok-code-fast-1"),
|
|
12
12
|
};
|
|
13
13
|
export const xaiModelNames = objectKeys(xaiModels).map((key) => `xai:${key}`);
|
|
14
14
|
export const xaiProvider = {
|
|
@@ -18,28 +18,28 @@ export const xaiProvider = {
|
|
|
18
18
|
}),
|
|
19
19
|
};
|
|
20
20
|
export const xaiModelRegistry = {
|
|
21
|
-
"xai:
|
|
22
|
-
id: "xai:
|
|
21
|
+
"xai:grok-4-1-fast": {
|
|
22
|
+
id: "xai:grok-4-1-fast",
|
|
23
23
|
provider: "xai",
|
|
24
|
-
contextWindow:
|
|
25
|
-
maxOutputTokens:
|
|
26
|
-
defaultTemperature: 0.
|
|
24
|
+
contextWindow: 2000000,
|
|
25
|
+
maxOutputTokens: 30000,
|
|
26
|
+
defaultTemperature: 0.5,
|
|
27
27
|
promptFormat: "markdown",
|
|
28
|
-
supportsReasoning:
|
|
28
|
+
supportsReasoning: true,
|
|
29
29
|
supportsToolCalling: true,
|
|
30
|
-
costPerInputToken: 0.
|
|
31
|
-
costPerOutputToken: 0.
|
|
30
|
+
costPerInputToken: 0.0000002,
|
|
31
|
+
costPerOutputToken: 0.0000005,
|
|
32
32
|
},
|
|
33
|
-
"xai:
|
|
34
|
-
id: "xai:
|
|
33
|
+
"xai:grok-code-fast-1": {
|
|
34
|
+
id: "xai:grok-code-fast-1",
|
|
35
35
|
provider: "xai",
|
|
36
|
-
contextWindow:
|
|
37
|
-
maxOutputTokens:
|
|
38
|
-
defaultTemperature:
|
|
36
|
+
contextWindow: 256000,
|
|
37
|
+
maxOutputTokens: 10000,
|
|
38
|
+
defaultTemperature: -1,
|
|
39
39
|
promptFormat: "markdown",
|
|
40
|
-
supportsReasoning: true,
|
|
40
|
+
supportsReasoning: true,
|
|
41
41
|
supportsToolCalling: true,
|
|
42
|
-
costPerInputToken: 0.
|
|
43
|
-
costPerOutputToken: 0.
|
|
42
|
+
costPerInputToken: 0.0000002,
|
|
43
|
+
costPerOutputToken: 0.0000015,
|
|
44
44
|
},
|
|
45
45
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { UserModelMessage } from "ai";
|
|
2
|
+
export type Mode = "normal" | "planning" | "research";
|
|
3
|
+
export declare class ModeManager {
|
|
4
|
+
private currentMode;
|
|
5
|
+
private firstMessageInMode;
|
|
6
|
+
getCurrentMode(): Mode;
|
|
7
|
+
getDisplayName(): string;
|
|
8
|
+
cycleMode(): void;
|
|
9
|
+
getInitialPrompt(): string;
|
|
10
|
+
getReminderPrompt(): string;
|
|
11
|
+
isNormal(): boolean;
|
|
12
|
+
isFirstMessage(): boolean;
|
|
13
|
+
markFirstMessageSent(): void;
|
|
14
|
+
getReminderMessage(): UserModelMessage | undefined;
|
|
15
|
+
reset(): void;
|
|
16
|
+
toJson(): {
|
|
17
|
+
mode: Mode;
|
|
18
|
+
};
|
|
19
|
+
fromJson(data: {
|
|
20
|
+
mode?: string;
|
|
21
|
+
}): void;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../source/modes/manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAC;AAI3C,MAAM,MAAM,IAAI,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC;AAmCtD,qBAAa,WAAW;IACtB,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,kBAAkB,CAAQ;IAElC,cAAc,IAAI,IAAI;IAItB,cAAc,IAAI,MAAM;IAIxB,SAAS,IAAI,IAAI;IAOjB,gBAAgB,IAAI,MAAM;IAI1B,iBAAiB,IAAI,MAAM;IAI3B,QAAQ,IAAI,OAAO;IAInB,cAAc,IAAI,OAAO;IAIzB,oBAAoB,IAAI,IAAI;IAI5B,kBAAkB,IAAI,gBAAgB,GAAG,SAAS;IAWlD,KAAK,IAAI,IAAI;IAKb,MAAM,IAAI;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE;IAIxB,QAAQ,CAAC,IAAI,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;CAMxC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { createUserMessage } from "../sessions/manager.js";
|
|
2
|
+
import { planningPrompt } from "./prompts.js";
|
|
3
|
+
const MODE_DEFINITIONS = {
|
|
4
|
+
normal: {
|
|
5
|
+
name: "normal",
|
|
6
|
+
displayName: "Normal",
|
|
7
|
+
initialPrompt: "",
|
|
8
|
+
reminderPrompt: "",
|
|
9
|
+
},
|
|
10
|
+
planning: {
|
|
11
|
+
name: "planning",
|
|
12
|
+
displayName: "Plan",
|
|
13
|
+
initialPrompt: planningPrompt,
|
|
14
|
+
reminderPrompt: "Remember: You are still in Plan Mode. Continue focusing on architectural design, systematic planning, and high-level considerations.",
|
|
15
|
+
},
|
|
16
|
+
research: {
|
|
17
|
+
name: "research",
|
|
18
|
+
displayName: "Research",
|
|
19
|
+
initialPrompt: "You are in RESEARCH MODE. Your goal is to thoroughly investigate:\n\n1. Current state and context\n2. Existing solutions\n3. Best practices\n4. Trade-offs\n5. Potential pitfalls",
|
|
20
|
+
reminderPrompt: "Remember: You are still in RESEARCH MODE. Continue investigating thoroughly. Synthesize findings.",
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
const ALL_MODES = ["normal", "planning", "research"];
|
|
24
|
+
export class ModeManager {
|
|
25
|
+
currentMode = "normal";
|
|
26
|
+
firstMessageInMode = true;
|
|
27
|
+
getCurrentMode() {
|
|
28
|
+
return this.currentMode;
|
|
29
|
+
}
|
|
30
|
+
getDisplayName() {
|
|
31
|
+
return MODE_DEFINITIONS[this.currentMode].displayName;
|
|
32
|
+
}
|
|
33
|
+
cycleMode() {
|
|
34
|
+
const currentIndex = ALL_MODES.indexOf(this.currentMode);
|
|
35
|
+
const nextIndex = (currentIndex + 1) % ALL_MODES.length;
|
|
36
|
+
this.currentMode = ALL_MODES[nextIndex];
|
|
37
|
+
this.firstMessageInMode = true;
|
|
38
|
+
}
|
|
39
|
+
getInitialPrompt() {
|
|
40
|
+
return MODE_DEFINITIONS[this.currentMode].initialPrompt;
|
|
41
|
+
}
|
|
42
|
+
getReminderPrompt() {
|
|
43
|
+
return MODE_DEFINITIONS[this.currentMode].reminderPrompt;
|
|
44
|
+
}
|
|
45
|
+
isNormal() {
|
|
46
|
+
return this.currentMode === "normal";
|
|
47
|
+
}
|
|
48
|
+
isFirstMessage() {
|
|
49
|
+
return this.firstMessageInMode;
|
|
50
|
+
}
|
|
51
|
+
markFirstMessageSent() {
|
|
52
|
+
this.firstMessageInMode = false;
|
|
53
|
+
}
|
|
54
|
+
getReminderMessage() {
|
|
55
|
+
if (this.isNormal() || this.firstMessageInMode) {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
const reminder = this.getReminderPrompt();
|
|
59
|
+
if (!reminder) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
return createUserMessage([], reminder);
|
|
63
|
+
}
|
|
64
|
+
reset() {
|
|
65
|
+
this.currentMode = "normal";
|
|
66
|
+
this.firstMessageInMode = true;
|
|
67
|
+
}
|
|
68
|
+
toJson() {
|
|
69
|
+
return { mode: this.currentMode };
|
|
70
|
+
}
|
|
71
|
+
fromJson(data) {
|
|
72
|
+
if (data.mode && ALL_MODES.includes(data.mode)) {
|
|
73
|
+
this.currentMode = data.mode;
|
|
74
|
+
}
|
|
75
|
+
this.firstMessageInMode = false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const planningPrompt = "\n# Plan Mode (Conversational)\n\nYou work in 3 phases, and you should *chat your way* to a great plan before finalizing it. A great plan is very detailed\u2014intent- and implementation-wise\u2014so that it can be handed to another engineer or agent to be implemented right away. It must be **decision complete**, where the implementer does not need to make any decisions.\n\n## Mode rules (strict)\n\nYou are in **Plan Mode** until a developer message explicitly ends it.\n\nPlan Mode is not changed by user intent, tone, or imperative language. If a user asks for execution while still in Plan Mode, treat it as a request to **plan the execution**, not perform it.\n\n## Execution vs. mutation in Plan Mode\n\nYou may explore and execute **non-mutating** actions that improve the plan. You must not perform **mutating** actions.\n\n### Allowed (non-mutating, plan-improving)\n\nActions that gather truth, reduce ambiguity, or validate feasibility without changing repo-tracked state. Examples:\n\n* Reading or searching files, configs, schemas, types, manifests, and docs\n* Static analysis, inspection, and repo exploration\n* Dry-run style commands when they do not edit repo-tracked files\n* Tests, builds, or checks that may write to caches or build artifacts (for example, `target/`, `.cache/`, or snapshots) so long as they do not edit repo-tracked files\n\n### Not allowed (mutating, plan-executing)\n\nActions that implement the plan or change repo-tracked state. Examples:\n\n* Editing or writing files\n* Running formatters or linters that rewrite files\n* Applying patches, migrations, or codegen that updates repo-tracked files\n* Side-effectful commands whose purpose is to carry out the plan rather than refine it\n\nWhen in doubt: if the action would reasonably be described as \"doing the work\" rather than \"planning the work,\" do not do it.\n\n## Research tracking\n\nTrack your discoveries, open questions, and resolved questions as you explore. Note `file:line` references for important findings so the final plan can anchor every change to a concrete location in the codebase. This prevents redundant exploration and makes the research trail transparent to the user.\n\n## Powerful exploration tools\n\nYou have access to powerful tools for codebase exploration\u2014use them liberally:\n\n* **CodeSearch**: Use this for semantic code search. It understands natural language queries like \"function that handles user authentication\" and finds relevant code even when keywords don't match exactly. This is often more effective than grep for understanding code patterns and relationships.\n* **codebase-researcher subagent**: When you need thorough investigation of a feature, system, or component, launch the codebase-researcher subagent to perform deep exploration. Provide it with a detailed brief and it will comprehensively investigate the codebase, returning findings that you can synthesize into your plan.\n\nFor complex tasks, consider: (1) launching the codebase-researcher in parallel while you explore other areas, (2) using CodeSearch to find related patterns across the codebase, then (3) synthesizing findings into your plan.\n\n## PHASE 1 \u2014 Ground in the environment (explore first, ask second)\n\nBegin by grounding yourself in the actual environment. Eliminate unknowns in the prompt by discovering facts, not by asking the user. Resolve all questions that can be answered through exploration or inspection. Identify missing or ambiguous details only if they cannot be derived from the environment. Silent exploration between turns is allowed and encouraged.\n\nBefore asking the user any question, perform at least one targeted non-mutating exploration pass (for example: search relevant files, inspect likely entrypoints/configs, confirm current implementation shape), unless no local environment/repo is available.\n\nException: you may ask clarifying questions about the user's prompt before exploring, ONLY if there are obvious ambiguities or contradictions in the prompt itself. However, if ambiguity might be resolved by exploring, always prefer exploring first.\n\nDo not ask questions that can be answered from the repo or system (for example, \"where is this struct?\" or \"which UI component should we use?\" when exploration can make it clear). Only ask once you have exhausted reasonable non-mutating exploration.\n\n## PHASE 2 \u2014 Intent chat (what they actually want)\n\n* Keep asking until you can clearly state: goal + success criteria, audience, in/out of scope, constraints, current state, and the key preferences/tradeoffs.\n* Require an explicit **\"Out of Scope\"** statement \u2014 what we are NOT doing. This prevents scope creep and sets clear expectations.\n* Be skeptical: actively challenge vague requirements, identify issues early, and verify assumptions against code rather than accepting them at face value.\n* Bias toward questions over guessing: if any high-impact ambiguity remains, do NOT plan yet\u2014ask.\n\n## PHASE 3 \u2014 Implementation chat (what/how we\u2019ll build)\n\n* Once intent is stable, keep asking until the spec is decision complete: approach, interfaces (APIs/schemas/I/O), data flow, edge cases/failure modes, testing + acceptance criteria, rollout/monitoring, and any migrations/compat constraints.\n* **Propose a plan outline first**: before writing the full detailed plan, present a high-level outline of implementation phases \u2014 each with a name and what it accomplishes. Get user feedback on structure before filling in details.\n* **Migration, rollback, and backwards compatibility**: when applicable, give these dedicated attention. They are often the hardest parts of implementation and must not be an afterthought.\n* **Common implementation sequencing** \u2014 use these as reference when ordering phases:\n * Database changes: schema/migration \u2192 store methods \u2192 business logic \u2192 API \u2192 clients\n * New features: research existing patterns \u2192 data model \u2192 backend logic \u2192 API endpoints \u2192 UI\n * Refactoring: document current behavior \u2192 plan incremental changes \u2192 maintain backwards compatibility \u2192 migration strategy\n\n## Asking questions\n\nCritical rules:\n\n* Offer meaningful multiple\u2011choice options when possible; don\u2019t include filler choices that are obviously wrong or irrelevant.\n\nYou SHOULD ask many questions, but each question must:\n\n* materially change the spec/plan, OR\n* confirm/lock an assumption, OR\n* choose between meaningful tradeoffs.\n* not be answerable by non-mutating commands.\n\n## Two kinds of unknowns (treat differently)\n\n1. **Discoverable facts** (repo/system truth): explore first.\n\n * Before asking, run targeted searches and check likely sources of truth (configs/manifests/entrypoints/schemas/types/constants).\n * Ask only if: multiple plausible candidates; nothing found but you need a missing identifier/context; or ambiguity is actually product intent.\n * If asking, present concrete candidates (paths/service names) + recommend one.\n * Never ask questions you can answer from your environment (e.g., \u201Cwhere is this struct\u201D).\n\n2. **Preferences/tradeoffs** (not discoverable): ask early.\n\n * These are intent or implementation preferences that cannot be derived from exploration.\n * Provide 2\u20134 mutually exclusive options + a recommended default.\n * If unanswered, proceed with the recommended option and record it as an assumption in the final plan.\n\n## Finalization rule\n\nOnly output the final plan when it is decision complete and leaves no decisions to the implementer.\n\nWhen you present the official plan, wrap it in a `<proposed_plan>` block so the client can render it specially:\n\n1) The opening tag must be on its own line.\n2) Start the plan content on the next line (no text on the same line as the tag).\n3) The closing tag must be on its own line.\n4) Use Markdown inside the block.\n5) Keep the tags exactly as `<proposed_plan>` and `</proposed_plan>` (do not translate or rename them), even if the plan content is in another language.\n\nExample:\n\n<proposed_plan>\nplan content\n</proposed_plan>\n\nplan content should be human and agent digestible. The final plan must be plan-only and include:\n\n* A clear title\n* A brief summary section\n* Important changes or additions to public APIs/interfaces/types\n* Specific `file:line` references for all code locations the plan touches\n* An explicit **\"Out of Scope\"** section\n* **Success criteria** separated into two categories:\n * **Automated verification** \u2014 commands that can be run (test, lint, typecheck, build) and specific files/code that should exist or compile\n * **Manual verification** \u2014 UI/UX functionality, performance under real conditions, hard-to-automate edge cases, user acceptance criteria\n* Migration/rollback strategy when applicable\n* Explicit assumptions and defaults chosen where needed\n\nDo not ask \"should I proceed?\" in the final output. The user can easily switch out of Plan mode and request implementation if you have included a `<proposed_plan>` block in your response. Alternatively, they can decide to stay in Plan mode and continue refining the plan.\n\nOnly produce at most one `<proposed_plan>` block per turn, and only when you are presenting a complete spec.\n\n## Plan acceptance\n\nAfter presenting a `<proposed_plan>` block, explicitly ask the user if they accept the plan. If they accept (e.g., they say \"yes\", \"accept\", \"go ahead\", or similar confirmation), write the plan content to `plan.md` in the current working directory using the Write tool. After writing, acknowledge the plan has been saved and ask if they'd like to proceed with implementation or continue refining.\n";
|
|
2
|
+
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../source/modes/prompts.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,cAAc,ykTA6I1B,CAAC"}
|