@austinthesing/magic-shell 0.2.23 → 0.2.25
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/dist/cli.js +96 -66
- package/dist/index.js +97 -106
- package/dist/tui.js +96 -66
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -33058,11 +33058,11 @@ var OPENROUTER_MODELS = [
|
|
|
33058
33058
|
{
|
|
33059
33059
|
id: "deepseek/deepseek-v4-flash:free",
|
|
33060
33060
|
name: "DeepSeek V4 Flash (Free)",
|
|
33061
|
-
description: "DeepSeek's fast open-source model on OpenRouter's free tier (limited
|
|
33061
|
+
description: "DeepSeek's fast open-source model on OpenRouter's free tier (rate-limited)",
|
|
33062
33062
|
category: "fast",
|
|
33063
33063
|
provider: "openrouter",
|
|
33064
33064
|
contextLength: 1048576,
|
|
33065
|
-
|
|
33065
|
+
cost: "free"
|
|
33066
33066
|
},
|
|
33067
33067
|
{
|
|
33068
33068
|
id: "deepseek/deepseek-v4-flash",
|
|
@@ -33070,15 +33070,17 @@ var OPENROUTER_MODELS = [
|
|
|
33070
33070
|
description: "DeepSeek's latest fast open-source model",
|
|
33071
33071
|
category: "fast",
|
|
33072
33072
|
provider: "openrouter",
|
|
33073
|
-
contextLength: 1048576
|
|
33073
|
+
contextLength: 1048576,
|
|
33074
|
+
cost: "lower-cost"
|
|
33074
33075
|
},
|
|
33075
33076
|
{
|
|
33076
|
-
id: "z-ai/glm-5
|
|
33077
|
-
name: "GLM 5
|
|
33077
|
+
id: "z-ai/glm-5.2",
|
|
33078
|
+
name: "GLM 5.2",
|
|
33078
33079
|
description: "Z.ai's latest fast GLM model",
|
|
33079
33080
|
category: "fast",
|
|
33080
33081
|
provider: "openrouter",
|
|
33081
|
-
contextLength: 202752
|
|
33082
|
+
contextLength: 202752,
|
|
33083
|
+
cost: "lower-cost"
|
|
33082
33084
|
},
|
|
33083
33085
|
{
|
|
33084
33086
|
id: "moonshotai/kimi-k2.7-code",
|
|
@@ -33086,7 +33088,8 @@ var OPENROUTER_MODELS = [
|
|
|
33086
33088
|
description: "Moonshot's latest open-weight coding model",
|
|
33087
33089
|
category: "smart",
|
|
33088
33090
|
provider: "openrouter",
|
|
33089
|
-
contextLength: 262144
|
|
33091
|
+
contextLength: 262144,
|
|
33092
|
+
cost: "lower-cost"
|
|
33090
33093
|
},
|
|
33091
33094
|
{
|
|
33092
33095
|
id: "deepseek/deepseek-v4-pro",
|
|
@@ -33094,7 +33097,8 @@ var OPENROUTER_MODELS = [
|
|
|
33094
33097
|
description: "DeepSeek's latest high-context open-source model",
|
|
33095
33098
|
category: "smart",
|
|
33096
33099
|
provider: "openrouter",
|
|
33097
|
-
contextLength: 1048576
|
|
33100
|
+
contextLength: 1048576,
|
|
33101
|
+
cost: "lower-cost"
|
|
33098
33102
|
},
|
|
33099
33103
|
{
|
|
33100
33104
|
id: "anthropic/claude-sonnet-4.6",
|
|
@@ -33102,7 +33106,8 @@ var OPENROUTER_MODELS = [
|
|
|
33102
33106
|
description: "Anthropic's latest Sonnet model",
|
|
33103
33107
|
category: "smart",
|
|
33104
33108
|
provider: "openrouter",
|
|
33105
|
-
contextLength: 1e6
|
|
33109
|
+
contextLength: 1e6,
|
|
33110
|
+
cost: "premium"
|
|
33106
33111
|
},
|
|
33107
33112
|
{
|
|
33108
33113
|
id: "openai/gpt-5.5",
|
|
@@ -33110,7 +33115,8 @@ var OPENROUTER_MODELS = [
|
|
|
33110
33115
|
description: "OpenAI's latest flagship GPT model",
|
|
33111
33116
|
category: "smart",
|
|
33112
33117
|
provider: "openrouter",
|
|
33113
|
-
contextLength: 1050000
|
|
33118
|
+
contextLength: 1050000,
|
|
33119
|
+
cost: "premium"
|
|
33114
33120
|
},
|
|
33115
33121
|
{
|
|
33116
33122
|
id: "anthropic/claude-opus-4.8",
|
|
@@ -33118,15 +33124,8 @@ var OPENROUTER_MODELS = [
|
|
|
33118
33124
|
description: "Anthropic's latest Opus model",
|
|
33119
33125
|
category: "reasoning",
|
|
33120
33126
|
provider: "openrouter",
|
|
33121
|
-
contextLength: 1e6
|
|
33122
|
-
|
|
33123
|
-
{
|
|
33124
|
-
id: "openai/gpt-5.5-pro",
|
|
33125
|
-
name: "GPT 5.5 Pro",
|
|
33126
|
-
description: "OpenAI's latest high-capability reasoning model",
|
|
33127
|
-
category: "reasoning",
|
|
33128
|
-
provider: "openrouter",
|
|
33129
|
-
contextLength: 1050000
|
|
33127
|
+
contextLength: 1e6,
|
|
33128
|
+
cost: "premium"
|
|
33130
33129
|
}
|
|
33131
33130
|
];
|
|
33132
33131
|
var VERCEL_AI_GATEWAY_MODELS = [
|
|
@@ -33136,7 +33135,8 @@ var VERCEL_AI_GATEWAY_MODELS = [
|
|
|
33136
33135
|
description: "OpenAI's latest flagship GPT model",
|
|
33137
33136
|
category: "smart",
|
|
33138
33137
|
provider: "vercel-ai-gateway",
|
|
33139
|
-
contextLength: 1050000
|
|
33138
|
+
contextLength: 1050000,
|
|
33139
|
+
cost: "premium"
|
|
33140
33140
|
},
|
|
33141
33141
|
{
|
|
33142
33142
|
id: "anthropic/claude-sonnet-4.6",
|
|
@@ -33144,15 +33144,8 @@ var VERCEL_AI_GATEWAY_MODELS = [
|
|
|
33144
33144
|
description: "Anthropic's latest Sonnet model",
|
|
33145
33145
|
category: "smart",
|
|
33146
33146
|
provider: "vercel-ai-gateway",
|
|
33147
|
-
contextLength: 1e6
|
|
33148
|
-
|
|
33149
|
-
{
|
|
33150
|
-
id: "openai/gpt-5.5-pro",
|
|
33151
|
-
name: "GPT 5.5 Pro",
|
|
33152
|
-
description: "OpenAI's latest high-capability reasoning model",
|
|
33153
|
-
category: "reasoning",
|
|
33154
|
-
provider: "vercel-ai-gateway",
|
|
33155
|
-
contextLength: 1050000
|
|
33147
|
+
contextLength: 1e6,
|
|
33148
|
+
cost: "premium"
|
|
33156
33149
|
},
|
|
33157
33150
|
{
|
|
33158
33151
|
id: "anthropic/claude-opus-4.8",
|
|
@@ -33160,17 +33153,28 @@ var VERCEL_AI_GATEWAY_MODELS = [
|
|
|
33160
33153
|
description: "Anthropic's latest Opus model",
|
|
33161
33154
|
category: "reasoning",
|
|
33162
33155
|
provider: "vercel-ai-gateway",
|
|
33163
|
-
contextLength: 1e6
|
|
33156
|
+
contextLength: 1e6,
|
|
33157
|
+
cost: "premium"
|
|
33164
33158
|
}
|
|
33165
33159
|
];
|
|
33166
33160
|
var CLOUDFLARE_AI_GATEWAY_MODELS = [
|
|
33161
|
+
{
|
|
33162
|
+
id: "workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast",
|
|
33163
|
+
name: "Workers AI Llama 3.3 70B Fast",
|
|
33164
|
+
description: "Cloudflare Workers AI fast Llama model routed through AI Gateway",
|
|
33165
|
+
category: "smart",
|
|
33166
|
+
provider: "cloudflare-ai-gateway",
|
|
33167
|
+
contextLength: 24000,
|
|
33168
|
+
cost: "lower-cost"
|
|
33169
|
+
},
|
|
33167
33170
|
{
|
|
33168
33171
|
id: "openai/gpt-5.5",
|
|
33169
33172
|
name: "GPT 5.5",
|
|
33170
33173
|
description: "OpenAI's latest flagship GPT model through Cloudflare AI Gateway",
|
|
33171
33174
|
category: "smart",
|
|
33172
33175
|
provider: "cloudflare-ai-gateway",
|
|
33173
|
-
contextLength: 1050000
|
|
33176
|
+
contextLength: 1050000,
|
|
33177
|
+
cost: "premium"
|
|
33174
33178
|
},
|
|
33175
33179
|
{
|
|
33176
33180
|
id: "anthropic/claude-sonnet-4-6",
|
|
@@ -33178,7 +33182,8 @@ var CLOUDFLARE_AI_GATEWAY_MODELS = [
|
|
|
33178
33182
|
description: "Anthropic's latest Sonnet model through Cloudflare AI Gateway",
|
|
33179
33183
|
category: "smart",
|
|
33180
33184
|
provider: "cloudflare-ai-gateway",
|
|
33181
|
-
contextLength: 1e6
|
|
33185
|
+
contextLength: 1e6,
|
|
33186
|
+
cost: "premium"
|
|
33182
33187
|
},
|
|
33183
33188
|
{
|
|
33184
33189
|
id: "anthropic/claude-opus-4-8",
|
|
@@ -33186,15 +33191,8 @@ var CLOUDFLARE_AI_GATEWAY_MODELS = [
|
|
|
33186
33191
|
description: "Anthropic's latest Opus model through Cloudflare AI Gateway",
|
|
33187
33192
|
category: "reasoning",
|
|
33188
33193
|
provider: "cloudflare-ai-gateway",
|
|
33189
|
-
contextLength: 1e6
|
|
33190
|
-
|
|
33191
|
-
{
|
|
33192
|
-
id: "workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast",
|
|
33193
|
-
name: "Workers AI Llama 3.3 70B Fast",
|
|
33194
|
-
description: "Cloudflare Workers AI fast Llama model routed through AI Gateway",
|
|
33195
|
-
category: "smart",
|
|
33196
|
-
provider: "cloudflare-ai-gateway",
|
|
33197
|
-
contextLength: 24000
|
|
33194
|
+
contextLength: 1e6,
|
|
33195
|
+
cost: "premium"
|
|
33198
33196
|
}
|
|
33199
33197
|
];
|
|
33200
33198
|
var WORKERS_AI_MODELS = [
|
|
@@ -33204,7 +33202,8 @@ var WORKERS_AI_MODELS = [
|
|
|
33204
33202
|
description: "Cloudflare Workers AI lightweight Llama instruct model",
|
|
33205
33203
|
category: "fast",
|
|
33206
33204
|
provider: "workers-ai",
|
|
33207
|
-
contextLength: 8000
|
|
33205
|
+
contextLength: 8000,
|
|
33206
|
+
cost: "lower-cost"
|
|
33208
33207
|
},
|
|
33209
33208
|
{
|
|
33210
33209
|
id: "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
|
|
@@ -33212,7 +33211,8 @@ var WORKERS_AI_MODELS = [
|
|
|
33212
33211
|
description: "Cloudflare Workers AI fast Llama instruct model",
|
|
33213
33212
|
category: "smart",
|
|
33214
33213
|
provider: "workers-ai",
|
|
33215
|
-
contextLength: 24000
|
|
33214
|
+
contextLength: 24000,
|
|
33215
|
+
cost: "lower-cost"
|
|
33216
33216
|
},
|
|
33217
33217
|
{
|
|
33218
33218
|
id: "@cf/openai/gpt-oss-120b",
|
|
@@ -33220,7 +33220,8 @@ var WORKERS_AI_MODELS = [
|
|
|
33220
33220
|
description: "OpenAI open-weight model hosted by Cloudflare Workers AI",
|
|
33221
33221
|
category: "reasoning",
|
|
33222
33222
|
provider: "workers-ai",
|
|
33223
|
-
contextLength: 32000
|
|
33223
|
+
contextLength: 32000,
|
|
33224
|
+
cost: "lower-cost"
|
|
33224
33225
|
}
|
|
33225
33226
|
];
|
|
33226
33227
|
var OPENCODE_ZEN_MODELS = [
|
|
@@ -33232,16 +33233,17 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
33232
33233
|
provider: "opencode-zen",
|
|
33233
33234
|
zenApiType: "openai-compatible",
|
|
33234
33235
|
contextLength: 1048576,
|
|
33235
|
-
|
|
33236
|
+
cost: "free"
|
|
33236
33237
|
},
|
|
33237
33238
|
{
|
|
33238
33239
|
id: "gpt-5-nano",
|
|
33239
33240
|
name: "GPT 5 Nano",
|
|
33240
|
-
description: "OpenAI's lightweight GPT model
|
|
33241
|
+
description: "OpenAI's lightweight GPT model",
|
|
33241
33242
|
category: "fast",
|
|
33242
33243
|
provider: "opencode-zen",
|
|
33243
33244
|
zenApiType: "openai-responses",
|
|
33244
|
-
contextLength: 400000
|
|
33245
|
+
contextLength: 400000,
|
|
33246
|
+
cost: "lower-cost"
|
|
33245
33247
|
},
|
|
33246
33248
|
{
|
|
33247
33249
|
id: "claude-haiku-4-5",
|
|
@@ -33250,7 +33252,8 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
33250
33252
|
category: "fast",
|
|
33251
33253
|
provider: "opencode-zen",
|
|
33252
33254
|
zenApiType: "anthropic",
|
|
33253
|
-
contextLength: 200000
|
|
33255
|
+
contextLength: 200000,
|
|
33256
|
+
cost: "lower-cost"
|
|
33254
33257
|
},
|
|
33255
33258
|
{
|
|
33256
33259
|
id: "gemini-3.5-flash",
|
|
@@ -33259,7 +33262,8 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
33259
33262
|
category: "fast",
|
|
33260
33263
|
provider: "opencode-zen",
|
|
33261
33264
|
zenApiType: "google",
|
|
33262
|
-
contextLength: 1048576
|
|
33265
|
+
contextLength: 1048576,
|
|
33266
|
+
cost: "lower-cost"
|
|
33263
33267
|
},
|
|
33264
33268
|
{
|
|
33265
33269
|
id: "claude-sonnet-4-6",
|
|
@@ -33268,7 +33272,8 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
33268
33272
|
category: "smart",
|
|
33269
33273
|
provider: "opencode-zen",
|
|
33270
33274
|
zenApiType: "anthropic",
|
|
33271
|
-
contextLength: 1e6
|
|
33275
|
+
contextLength: 1e6,
|
|
33276
|
+
cost: "premium"
|
|
33272
33277
|
},
|
|
33273
33278
|
{
|
|
33274
33279
|
id: "gpt-5.5",
|
|
@@ -33277,7 +33282,8 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
33277
33282
|
category: "smart",
|
|
33278
33283
|
provider: "opencode-zen",
|
|
33279
33284
|
zenApiType: "openai-responses",
|
|
33280
|
-
contextLength: 1050000
|
|
33285
|
+
contextLength: 1050000,
|
|
33286
|
+
cost: "premium"
|
|
33281
33287
|
},
|
|
33282
33288
|
{
|
|
33283
33289
|
id: "claude-opus-4-8",
|
|
@@ -33286,16 +33292,8 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
33286
33292
|
category: "reasoning",
|
|
33287
33293
|
provider: "opencode-zen",
|
|
33288
33294
|
zenApiType: "anthropic",
|
|
33289
|
-
contextLength: 1e6
|
|
33290
|
-
|
|
33291
|
-
{
|
|
33292
|
-
id: "gpt-5.5-pro",
|
|
33293
|
-
name: "GPT 5.5 Pro",
|
|
33294
|
-
description: "OpenAI's latest high-capability reasoning model",
|
|
33295
|
-
category: "reasoning",
|
|
33296
|
-
provider: "opencode-zen",
|
|
33297
|
-
zenApiType: "openai-responses",
|
|
33298
|
-
contextLength: 1050000
|
|
33295
|
+
contextLength: 1e6,
|
|
33296
|
+
cost: "premium"
|
|
33299
33297
|
}
|
|
33300
33298
|
];
|
|
33301
33299
|
var ALL_MODELS = [
|
|
@@ -33345,6 +33343,27 @@ function getProviderDisplayName(provider) {
|
|
|
33345
33343
|
}
|
|
33346
33344
|
}
|
|
33347
33345
|
}
|
|
33346
|
+
var COST_TIER_ORDER = {
|
|
33347
|
+
free: 0,
|
|
33348
|
+
"lower-cost": 1,
|
|
33349
|
+
premium: 2
|
|
33350
|
+
};
|
|
33351
|
+
var CATEGORY_ORDER = {
|
|
33352
|
+
fast: 0,
|
|
33353
|
+
smart: 1,
|
|
33354
|
+
reasoning: 2
|
|
33355
|
+
};
|
|
33356
|
+
function sortModelsByCost(models) {
|
|
33357
|
+
return [...models].sort((a, b2) => {
|
|
33358
|
+
const costDiff = COST_TIER_ORDER[a.cost] - COST_TIER_ORDER[b2.cost];
|
|
33359
|
+
if (costDiff !== 0)
|
|
33360
|
+
return costDiff;
|
|
33361
|
+
const catDiff = CATEGORY_ORDER[a.category] - CATEGORY_ORDER[b2.category];
|
|
33362
|
+
if (catDiff !== 0)
|
|
33363
|
+
return catDiff;
|
|
33364
|
+
return a.name.localeCompare(b2.name);
|
|
33365
|
+
});
|
|
33366
|
+
}
|
|
33348
33367
|
|
|
33349
33368
|
// src/lib/types.ts
|
|
33350
33369
|
function isCustomModel(model) {
|
|
@@ -76804,7 +76823,17 @@ function generateMessageId() {
|
|
|
76804
76823
|
return `msg-${++messageIdCounter}`;
|
|
76805
76824
|
}
|
|
76806
76825
|
function isFreeModel(model) {
|
|
76807
|
-
return !isCustomModel(model) &&
|
|
76826
|
+
return !isCustomModel(model) && model.cost === "free";
|
|
76827
|
+
}
|
|
76828
|
+
function costTierLabel(tier) {
|
|
76829
|
+
switch (tier) {
|
|
76830
|
+
case "free":
|
|
76831
|
+
return "FREE";
|
|
76832
|
+
case "lower-cost":
|
|
76833
|
+
return "lower-cost";
|
|
76834
|
+
case "premium":
|
|
76835
|
+
return "premium";
|
|
76836
|
+
}
|
|
76808
76837
|
}
|
|
76809
76838
|
async function main() {
|
|
76810
76839
|
config2 = loadConfig();
|
|
@@ -77768,16 +77797,17 @@ function showModelSelector() {
|
|
|
77768
77797
|
});
|
|
77769
77798
|
renderer.root.add(container);
|
|
77770
77799
|
const allModels = getProviderModels(config2.provider);
|
|
77771
|
-
const availableModels = allModels.filter((m2) => !m2.disabled)
|
|
77800
|
+
const availableModels = allModels.filter((m2) => !m2.disabled);
|
|
77801
|
+
const sortedModels = sortModelsByCost(availableModels);
|
|
77772
77802
|
const customModels = getCustomModels().sort((a, b2) => a.name.localeCompare(b2.name));
|
|
77773
77803
|
const options = [
|
|
77774
|
-
...
|
|
77775
|
-
name: `${model.name} [${model.
|
|
77804
|
+
...sortedModels.map((model) => ({
|
|
77805
|
+
name: `${model.name} [${costTierLabel(model.cost)}]`,
|
|
77776
77806
|
description: model.description,
|
|
77777
77807
|
value: model
|
|
77778
77808
|
})),
|
|
77779
77809
|
...customModels.map((model) => ({
|
|
77780
|
-
name: `${model.name} [
|
|
77810
|
+
name: `${model.name} [custom]`,
|
|
77781
77811
|
description: `${model.baseUrl} - ${model.modelId}`,
|
|
77782
77812
|
value: model
|
|
77783
77813
|
}))
|
package/dist/index.js
CHANGED
|
@@ -2119,11 +2119,11 @@ var OPENROUTER_MODELS = [
|
|
|
2119
2119
|
{
|
|
2120
2120
|
id: "deepseek/deepseek-v4-flash:free",
|
|
2121
2121
|
name: "DeepSeek V4 Flash (Free)",
|
|
2122
|
-
description: "DeepSeek's fast open-source model on OpenRouter's free tier (limited
|
|
2122
|
+
description: "DeepSeek's fast open-source model on OpenRouter's free tier (rate-limited)",
|
|
2123
2123
|
category: "fast",
|
|
2124
2124
|
provider: "openrouter",
|
|
2125
2125
|
contextLength: 1048576,
|
|
2126
|
-
|
|
2126
|
+
cost: "free"
|
|
2127
2127
|
},
|
|
2128
2128
|
{
|
|
2129
2129
|
id: "deepseek/deepseek-v4-flash",
|
|
@@ -2131,15 +2131,17 @@ var OPENROUTER_MODELS = [
|
|
|
2131
2131
|
description: "DeepSeek's latest fast open-source model",
|
|
2132
2132
|
category: "fast",
|
|
2133
2133
|
provider: "openrouter",
|
|
2134
|
-
contextLength: 1048576
|
|
2134
|
+
contextLength: 1048576,
|
|
2135
|
+
cost: "lower-cost"
|
|
2135
2136
|
},
|
|
2136
2137
|
{
|
|
2137
|
-
id: "z-ai/glm-5
|
|
2138
|
-
name: "GLM 5
|
|
2138
|
+
id: "z-ai/glm-5.2",
|
|
2139
|
+
name: "GLM 5.2",
|
|
2139
2140
|
description: "Z.ai's latest fast GLM model",
|
|
2140
2141
|
category: "fast",
|
|
2141
2142
|
provider: "openrouter",
|
|
2142
|
-
contextLength: 202752
|
|
2143
|
+
contextLength: 202752,
|
|
2144
|
+
cost: "lower-cost"
|
|
2143
2145
|
},
|
|
2144
2146
|
{
|
|
2145
2147
|
id: "moonshotai/kimi-k2.7-code",
|
|
@@ -2147,7 +2149,8 @@ var OPENROUTER_MODELS = [
|
|
|
2147
2149
|
description: "Moonshot's latest open-weight coding model",
|
|
2148
2150
|
category: "smart",
|
|
2149
2151
|
provider: "openrouter",
|
|
2150
|
-
contextLength: 262144
|
|
2152
|
+
contextLength: 262144,
|
|
2153
|
+
cost: "lower-cost"
|
|
2151
2154
|
},
|
|
2152
2155
|
{
|
|
2153
2156
|
id: "deepseek/deepseek-v4-pro",
|
|
@@ -2155,7 +2158,8 @@ var OPENROUTER_MODELS = [
|
|
|
2155
2158
|
description: "DeepSeek's latest high-context open-source model",
|
|
2156
2159
|
category: "smart",
|
|
2157
2160
|
provider: "openrouter",
|
|
2158
|
-
contextLength: 1048576
|
|
2161
|
+
contextLength: 1048576,
|
|
2162
|
+
cost: "lower-cost"
|
|
2159
2163
|
},
|
|
2160
2164
|
{
|
|
2161
2165
|
id: "anthropic/claude-sonnet-4.6",
|
|
@@ -2163,7 +2167,8 @@ var OPENROUTER_MODELS = [
|
|
|
2163
2167
|
description: "Anthropic's latest Sonnet model",
|
|
2164
2168
|
category: "smart",
|
|
2165
2169
|
provider: "openrouter",
|
|
2166
|
-
contextLength: 1e6
|
|
2170
|
+
contextLength: 1e6,
|
|
2171
|
+
cost: "premium"
|
|
2167
2172
|
},
|
|
2168
2173
|
{
|
|
2169
2174
|
id: "openai/gpt-5.5",
|
|
@@ -2171,7 +2176,8 @@ var OPENROUTER_MODELS = [
|
|
|
2171
2176
|
description: "OpenAI's latest flagship GPT model",
|
|
2172
2177
|
category: "smart",
|
|
2173
2178
|
provider: "openrouter",
|
|
2174
|
-
contextLength: 1050000
|
|
2179
|
+
contextLength: 1050000,
|
|
2180
|
+
cost: "premium"
|
|
2175
2181
|
},
|
|
2176
2182
|
{
|
|
2177
2183
|
id: "anthropic/claude-opus-4.8",
|
|
@@ -2179,15 +2185,8 @@ var OPENROUTER_MODELS = [
|
|
|
2179
2185
|
description: "Anthropic's latest Opus model",
|
|
2180
2186
|
category: "reasoning",
|
|
2181
2187
|
provider: "openrouter",
|
|
2182
|
-
contextLength: 1e6
|
|
2183
|
-
|
|
2184
|
-
{
|
|
2185
|
-
id: "openai/gpt-5.5-pro",
|
|
2186
|
-
name: "GPT 5.5 Pro",
|
|
2187
|
-
description: "OpenAI's latest high-capability reasoning model",
|
|
2188
|
-
category: "reasoning",
|
|
2189
|
-
provider: "openrouter",
|
|
2190
|
-
contextLength: 1050000
|
|
2188
|
+
contextLength: 1e6,
|
|
2189
|
+
cost: "premium"
|
|
2191
2190
|
}
|
|
2192
2191
|
];
|
|
2193
2192
|
var VERCEL_AI_GATEWAY_MODELS = [
|
|
@@ -2197,7 +2196,8 @@ var VERCEL_AI_GATEWAY_MODELS = [
|
|
|
2197
2196
|
description: "OpenAI's latest flagship GPT model",
|
|
2198
2197
|
category: "smart",
|
|
2199
2198
|
provider: "vercel-ai-gateway",
|
|
2200
|
-
contextLength: 1050000
|
|
2199
|
+
contextLength: 1050000,
|
|
2200
|
+
cost: "premium"
|
|
2201
2201
|
},
|
|
2202
2202
|
{
|
|
2203
2203
|
id: "anthropic/claude-sonnet-4.6",
|
|
@@ -2205,15 +2205,8 @@ var VERCEL_AI_GATEWAY_MODELS = [
|
|
|
2205
2205
|
description: "Anthropic's latest Sonnet model",
|
|
2206
2206
|
category: "smart",
|
|
2207
2207
|
provider: "vercel-ai-gateway",
|
|
2208
|
-
contextLength: 1e6
|
|
2209
|
-
|
|
2210
|
-
{
|
|
2211
|
-
id: "openai/gpt-5.5-pro",
|
|
2212
|
-
name: "GPT 5.5 Pro",
|
|
2213
|
-
description: "OpenAI's latest high-capability reasoning model",
|
|
2214
|
-
category: "reasoning",
|
|
2215
|
-
provider: "vercel-ai-gateway",
|
|
2216
|
-
contextLength: 1050000
|
|
2208
|
+
contextLength: 1e6,
|
|
2209
|
+
cost: "premium"
|
|
2217
2210
|
},
|
|
2218
2211
|
{
|
|
2219
2212
|
id: "anthropic/claude-opus-4.8",
|
|
@@ -2221,17 +2214,28 @@ var VERCEL_AI_GATEWAY_MODELS = [
|
|
|
2221
2214
|
description: "Anthropic's latest Opus model",
|
|
2222
2215
|
category: "reasoning",
|
|
2223
2216
|
provider: "vercel-ai-gateway",
|
|
2224
|
-
contextLength: 1e6
|
|
2217
|
+
contextLength: 1e6,
|
|
2218
|
+
cost: "premium"
|
|
2225
2219
|
}
|
|
2226
2220
|
];
|
|
2227
2221
|
var CLOUDFLARE_AI_GATEWAY_MODELS = [
|
|
2222
|
+
{
|
|
2223
|
+
id: "workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast",
|
|
2224
|
+
name: "Workers AI Llama 3.3 70B Fast",
|
|
2225
|
+
description: "Cloudflare Workers AI fast Llama model routed through AI Gateway",
|
|
2226
|
+
category: "smart",
|
|
2227
|
+
provider: "cloudflare-ai-gateway",
|
|
2228
|
+
contextLength: 24000,
|
|
2229
|
+
cost: "lower-cost"
|
|
2230
|
+
},
|
|
2228
2231
|
{
|
|
2229
2232
|
id: "openai/gpt-5.5",
|
|
2230
2233
|
name: "GPT 5.5",
|
|
2231
2234
|
description: "OpenAI's latest flagship GPT model through Cloudflare AI Gateway",
|
|
2232
2235
|
category: "smart",
|
|
2233
2236
|
provider: "cloudflare-ai-gateway",
|
|
2234
|
-
contextLength: 1050000
|
|
2237
|
+
contextLength: 1050000,
|
|
2238
|
+
cost: "premium"
|
|
2235
2239
|
},
|
|
2236
2240
|
{
|
|
2237
2241
|
id: "anthropic/claude-sonnet-4-6",
|
|
@@ -2239,7 +2243,8 @@ var CLOUDFLARE_AI_GATEWAY_MODELS = [
|
|
|
2239
2243
|
description: "Anthropic's latest Sonnet model through Cloudflare AI Gateway",
|
|
2240
2244
|
category: "smart",
|
|
2241
2245
|
provider: "cloudflare-ai-gateway",
|
|
2242
|
-
contextLength: 1e6
|
|
2246
|
+
contextLength: 1e6,
|
|
2247
|
+
cost: "premium"
|
|
2243
2248
|
},
|
|
2244
2249
|
{
|
|
2245
2250
|
id: "anthropic/claude-opus-4-8",
|
|
@@ -2247,15 +2252,8 @@ var CLOUDFLARE_AI_GATEWAY_MODELS = [
|
|
|
2247
2252
|
description: "Anthropic's latest Opus model through Cloudflare AI Gateway",
|
|
2248
2253
|
category: "reasoning",
|
|
2249
2254
|
provider: "cloudflare-ai-gateway",
|
|
2250
|
-
contextLength: 1e6
|
|
2251
|
-
|
|
2252
|
-
{
|
|
2253
|
-
id: "workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast",
|
|
2254
|
-
name: "Workers AI Llama 3.3 70B Fast",
|
|
2255
|
-
description: "Cloudflare Workers AI fast Llama model routed through AI Gateway",
|
|
2256
|
-
category: "smart",
|
|
2257
|
-
provider: "cloudflare-ai-gateway",
|
|
2258
|
-
contextLength: 24000
|
|
2255
|
+
contextLength: 1e6,
|
|
2256
|
+
cost: "premium"
|
|
2259
2257
|
}
|
|
2260
2258
|
];
|
|
2261
2259
|
var WORKERS_AI_MODELS = [
|
|
@@ -2265,7 +2263,8 @@ var WORKERS_AI_MODELS = [
|
|
|
2265
2263
|
description: "Cloudflare Workers AI lightweight Llama instruct model",
|
|
2266
2264
|
category: "fast",
|
|
2267
2265
|
provider: "workers-ai",
|
|
2268
|
-
contextLength: 8000
|
|
2266
|
+
contextLength: 8000,
|
|
2267
|
+
cost: "lower-cost"
|
|
2269
2268
|
},
|
|
2270
2269
|
{
|
|
2271
2270
|
id: "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
|
|
@@ -2273,7 +2272,8 @@ var WORKERS_AI_MODELS = [
|
|
|
2273
2272
|
description: "Cloudflare Workers AI fast Llama instruct model",
|
|
2274
2273
|
category: "smart",
|
|
2275
2274
|
provider: "workers-ai",
|
|
2276
|
-
contextLength: 24000
|
|
2275
|
+
contextLength: 24000,
|
|
2276
|
+
cost: "lower-cost"
|
|
2277
2277
|
},
|
|
2278
2278
|
{
|
|
2279
2279
|
id: "@cf/openai/gpt-oss-120b",
|
|
@@ -2281,7 +2281,8 @@ var WORKERS_AI_MODELS = [
|
|
|
2281
2281
|
description: "OpenAI open-weight model hosted by Cloudflare Workers AI",
|
|
2282
2282
|
category: "reasoning",
|
|
2283
2283
|
provider: "workers-ai",
|
|
2284
|
-
contextLength: 32000
|
|
2284
|
+
contextLength: 32000,
|
|
2285
|
+
cost: "lower-cost"
|
|
2285
2286
|
}
|
|
2286
2287
|
];
|
|
2287
2288
|
var OPENCODE_ZEN_MODELS = [
|
|
@@ -2293,16 +2294,17 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
2293
2294
|
provider: "opencode-zen",
|
|
2294
2295
|
zenApiType: "openai-compatible",
|
|
2295
2296
|
contextLength: 1048576,
|
|
2296
|
-
|
|
2297
|
+
cost: "free"
|
|
2297
2298
|
},
|
|
2298
2299
|
{
|
|
2299
2300
|
id: "gpt-5-nano",
|
|
2300
2301
|
name: "GPT 5 Nano",
|
|
2301
|
-
description: "OpenAI's lightweight GPT model
|
|
2302
|
+
description: "OpenAI's lightweight GPT model",
|
|
2302
2303
|
category: "fast",
|
|
2303
2304
|
provider: "opencode-zen",
|
|
2304
2305
|
zenApiType: "openai-responses",
|
|
2305
|
-
contextLength: 400000
|
|
2306
|
+
contextLength: 400000,
|
|
2307
|
+
cost: "lower-cost"
|
|
2306
2308
|
},
|
|
2307
2309
|
{
|
|
2308
2310
|
id: "claude-haiku-4-5",
|
|
@@ -2311,7 +2313,8 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
2311
2313
|
category: "fast",
|
|
2312
2314
|
provider: "opencode-zen",
|
|
2313
2315
|
zenApiType: "anthropic",
|
|
2314
|
-
contextLength: 200000
|
|
2316
|
+
contextLength: 200000,
|
|
2317
|
+
cost: "lower-cost"
|
|
2315
2318
|
},
|
|
2316
2319
|
{
|
|
2317
2320
|
id: "gemini-3.5-flash",
|
|
@@ -2320,7 +2323,8 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
2320
2323
|
category: "fast",
|
|
2321
2324
|
provider: "opencode-zen",
|
|
2322
2325
|
zenApiType: "google",
|
|
2323
|
-
contextLength: 1048576
|
|
2326
|
+
contextLength: 1048576,
|
|
2327
|
+
cost: "lower-cost"
|
|
2324
2328
|
},
|
|
2325
2329
|
{
|
|
2326
2330
|
id: "claude-sonnet-4-6",
|
|
@@ -2329,7 +2333,8 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
2329
2333
|
category: "smart",
|
|
2330
2334
|
provider: "opencode-zen",
|
|
2331
2335
|
zenApiType: "anthropic",
|
|
2332
|
-
contextLength: 1e6
|
|
2336
|
+
contextLength: 1e6,
|
|
2337
|
+
cost: "premium"
|
|
2333
2338
|
},
|
|
2334
2339
|
{
|
|
2335
2340
|
id: "gpt-5.5",
|
|
@@ -2338,7 +2343,8 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
2338
2343
|
category: "smart",
|
|
2339
2344
|
provider: "opencode-zen",
|
|
2340
2345
|
zenApiType: "openai-responses",
|
|
2341
|
-
contextLength: 1050000
|
|
2346
|
+
contextLength: 1050000,
|
|
2347
|
+
cost: "premium"
|
|
2342
2348
|
},
|
|
2343
2349
|
{
|
|
2344
2350
|
id: "claude-opus-4-8",
|
|
@@ -2347,16 +2353,8 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
2347
2353
|
category: "reasoning",
|
|
2348
2354
|
provider: "opencode-zen",
|
|
2349
2355
|
zenApiType: "anthropic",
|
|
2350
|
-
contextLength: 1e6
|
|
2351
|
-
|
|
2352
|
-
{
|
|
2353
|
-
id: "gpt-5.5-pro",
|
|
2354
|
-
name: "GPT 5.5 Pro",
|
|
2355
|
-
description: "OpenAI's latest high-capability reasoning model",
|
|
2356
|
-
category: "reasoning",
|
|
2357
|
-
provider: "opencode-zen",
|
|
2358
|
-
zenApiType: "openai-responses",
|
|
2359
|
-
contextLength: 1050000
|
|
2356
|
+
contextLength: 1e6,
|
|
2357
|
+
cost: "premium"
|
|
2360
2358
|
}
|
|
2361
2359
|
];
|
|
2362
2360
|
var ALL_MODELS = [
|
|
@@ -2406,6 +2404,27 @@ function getProviderDisplayName(provider) {
|
|
|
2406
2404
|
}
|
|
2407
2405
|
}
|
|
2408
2406
|
}
|
|
2407
|
+
var COST_TIER_ORDER = {
|
|
2408
|
+
free: 0,
|
|
2409
|
+
"lower-cost": 1,
|
|
2410
|
+
premium: 2
|
|
2411
|
+
};
|
|
2412
|
+
var CATEGORY_ORDER = {
|
|
2413
|
+
fast: 0,
|
|
2414
|
+
smart: 1,
|
|
2415
|
+
reasoning: 2
|
|
2416
|
+
};
|
|
2417
|
+
function sortModelsByCost(models) {
|
|
2418
|
+
return [...models].sort((a, b) => {
|
|
2419
|
+
const costDiff = COST_TIER_ORDER[a.cost] - COST_TIER_ORDER[b.cost];
|
|
2420
|
+
if (costDiff !== 0)
|
|
2421
|
+
return costDiff;
|
|
2422
|
+
const catDiff = CATEGORY_ORDER[a.category] - CATEGORY_ORDER[b.category];
|
|
2423
|
+
if (catDiff !== 0)
|
|
2424
|
+
return catDiff;
|
|
2425
|
+
return a.name.localeCompare(b.name);
|
|
2426
|
+
});
|
|
2427
|
+
}
|
|
2409
2428
|
// src/lib/config.ts
|
|
2410
2429
|
import { homedir } from "os";
|
|
2411
2430
|
import { join } from "path";
|
|
@@ -46310,44 +46329,16 @@ ${colors.bold}CONFIG${colors.reset}
|
|
|
46310
46329
|
function printModels() {
|
|
46311
46330
|
const config2 = loadConfig();
|
|
46312
46331
|
const customModels = getCustomModels();
|
|
46313
|
-
|
|
46314
|
-
|
|
46315
|
-
|
|
46316
|
-
|
|
46317
|
-
|
|
46318
|
-
|
|
46319
|
-
|
|
46320
|
-
const marker24 = isCurrent ? colors.success + "\u2192 " : " ";
|
|
46321
|
-
const free = model.free ? colors.success + " *" + colors.reset : "";
|
|
46322
|
-
const disabled = model.disabled ? colors.error + " X" + colors.reset : "";
|
|
46323
|
-
const category = colors.dim + `[${model.category}]` + colors.reset;
|
|
46324
|
-
const name24 = model.disabled ? colors.dim + model.id + colors.reset : model.id;
|
|
46325
|
-
console.log(`${marker24}${name24}${free}${disabled} ${category}`);
|
|
46326
|
-
if (model.disabled && model.disabledReason) {
|
|
46327
|
-
console.log(` ${colors.error}${model.disabledReason}${colors.reset}`);
|
|
46328
|
-
} else {
|
|
46329
|
-
console.log(` ${colors.dim}${model.description}${colors.reset}`);
|
|
46330
|
-
}
|
|
46331
|
-
}
|
|
46332
|
-
console.log(`
|
|
46333
|
-
${colors.bold}OpenRouter Models${colors.reset}
|
|
46334
|
-
`);
|
|
46335
|
-
const sortedRouterModels = [...OPENROUTER_MODELS].sort((a, b) => a.name.localeCompare(b.name));
|
|
46336
|
-
for (const model of sortedRouterModels) {
|
|
46337
|
-
const isCurrent = config2.provider === "openrouter" && config2.defaultModel === model.id;
|
|
46338
|
-
const marker24 = isCurrent ? colors.success + "\u2192 " : " ";
|
|
46339
|
-
const free = model.free ? colors.success + " *" + colors.reset : "";
|
|
46340
|
-
const disabled = model.disabled ? colors.error + " X" + colors.reset : "";
|
|
46341
|
-
const category = colors.dim + `[${model.category}]` + colors.reset;
|
|
46342
|
-
const name24 = model.disabled ? colors.dim + model.id + colors.reset : model.id;
|
|
46343
|
-
console.log(`${marker24}${name24}${free}${disabled} ${category}`);
|
|
46344
|
-
if (model.disabled && model.disabledReason) {
|
|
46345
|
-
console.log(` ${colors.error}${model.disabledReason}${colors.reset}`);
|
|
46346
|
-
} else {
|
|
46347
|
-
console.log(` ${colors.dim}${model.description}${colors.reset}`);
|
|
46348
|
-
}
|
|
46349
|
-
}
|
|
46332
|
+
const costLabel = (cost) => {
|
|
46333
|
+
if (cost === "free")
|
|
46334
|
+
return colors.success + "[free]" + colors.reset;
|
|
46335
|
+
if (cost === "lower-cost")
|
|
46336
|
+
return colors.dim + "[lower-cost]" + colors.reset;
|
|
46337
|
+
return colors.dim + "[premium]" + colors.reset;
|
|
46338
|
+
};
|
|
46350
46339
|
const providerSections = [
|
|
46340
|
+
["OpenCode Zen Models", OPENCODE_ZEN_MODELS, "opencode-zen"],
|
|
46341
|
+
["OpenRouter Models", OPENROUTER_MODELS, "openrouter"],
|
|
46351
46342
|
["Vercel AI Gateway Models", VERCEL_AI_GATEWAY_MODELS, "vercel-ai-gateway"],
|
|
46352
46343
|
["Cloudflare AI Gateway Models", CLOUDFLARE_AI_GATEWAY_MODELS, "cloudflare-ai-gateway"],
|
|
46353
46344
|
["Cloudflare Workers AI Models", WORKERS_AI_MODELS, "workers-ai"]
|
|
@@ -46356,12 +46347,13 @@ ${colors.bold}OpenRouter Models${colors.reset}
|
|
|
46356
46347
|
console.log(`
|
|
46357
46348
|
${colors.bold}${title}${colors.reset}
|
|
46358
46349
|
`);
|
|
46359
|
-
const
|
|
46360
|
-
for (const model of
|
|
46350
|
+
const sorted = sortModelsByCost(models.filter((m) => !m.disabled));
|
|
46351
|
+
for (const model of sorted) {
|
|
46361
46352
|
const isCurrent = config2.provider === provider && config2.defaultModel === model.id;
|
|
46362
46353
|
const marker24 = isCurrent ? colors.success + "\u2192 " : " ";
|
|
46363
|
-
const
|
|
46364
|
-
|
|
46354
|
+
const name24 = model.id;
|
|
46355
|
+
const cost = costLabel(model.cost);
|
|
46356
|
+
console.log(`${marker24}${name24} ${cost}`);
|
|
46365
46357
|
console.log(` ${colors.dim}${model.description}${colors.reset}`);
|
|
46366
46358
|
}
|
|
46367
46359
|
}
|
|
@@ -46373,8 +46365,7 @@ ${colors.bold}Custom Models${colors.reset} ${colors.info}(custom)${colors.reset}
|
|
|
46373
46365
|
for (const model of sortedCustomModels) {
|
|
46374
46366
|
const isCurrent = config2.defaultModel === model.id;
|
|
46375
46367
|
const marker24 = isCurrent ? colors.success + "\u2192 " : " ";
|
|
46376
|
-
|
|
46377
|
-
console.log(`${marker24}${model.id} ${colors.info}(custom)${colors.reset} ${category}`);
|
|
46368
|
+
console.log(`${marker24}${model.id} ${colors.info}[custom]${colors.reset}`);
|
|
46378
46369
|
console.log(` ${colors.dim}${model.name} - ${model.baseUrl}${colors.reset}`);
|
|
46379
46370
|
}
|
|
46380
46371
|
}
|
|
@@ -46515,12 +46506,12 @@ Cloudflare account ID: `);
|
|
|
46515
46506
|
config2.cloudflareAiGatewayId = gatewayId.trim() || config2.cloudflareAiGatewayId || "default";
|
|
46516
46507
|
}
|
|
46517
46508
|
const models = getProviderModels(provider);
|
|
46518
|
-
const freeModels = models.filter((m) => m.free);
|
|
46509
|
+
const freeModels = models.filter((m) => m.cost === "free");
|
|
46519
46510
|
console.log(`
|
|
46520
46511
|
Recommended models:`);
|
|
46521
46512
|
const displayModels = freeModels.length > 0 ? freeModels.slice(0, 5) : models.slice(0, 5);
|
|
46522
46513
|
displayModels.forEach((m, i) => {
|
|
46523
|
-
const free = m.free ? colors.green + " (free)" + colors.reset : "";
|
|
46514
|
+
const free = m.cost === "free" ? colors.green + " (free)" + colors.reset : "";
|
|
46524
46515
|
console.log(` ${i + 1}. ${m.name}${free} - ${m.description}`);
|
|
46525
46516
|
});
|
|
46526
46517
|
const modelChoice = await question(`
|
package/dist/tui.js
CHANGED
|
@@ -33058,11 +33058,11 @@ var OPENROUTER_MODELS = [
|
|
|
33058
33058
|
{
|
|
33059
33059
|
id: "deepseek/deepseek-v4-flash:free",
|
|
33060
33060
|
name: "DeepSeek V4 Flash (Free)",
|
|
33061
|
-
description: "DeepSeek's fast open-source model on OpenRouter's free tier (limited
|
|
33061
|
+
description: "DeepSeek's fast open-source model on OpenRouter's free tier (rate-limited)",
|
|
33062
33062
|
category: "fast",
|
|
33063
33063
|
provider: "openrouter",
|
|
33064
33064
|
contextLength: 1048576,
|
|
33065
|
-
|
|
33065
|
+
cost: "free"
|
|
33066
33066
|
},
|
|
33067
33067
|
{
|
|
33068
33068
|
id: "deepseek/deepseek-v4-flash",
|
|
@@ -33070,15 +33070,17 @@ var OPENROUTER_MODELS = [
|
|
|
33070
33070
|
description: "DeepSeek's latest fast open-source model",
|
|
33071
33071
|
category: "fast",
|
|
33072
33072
|
provider: "openrouter",
|
|
33073
|
-
contextLength: 1048576
|
|
33073
|
+
contextLength: 1048576,
|
|
33074
|
+
cost: "lower-cost"
|
|
33074
33075
|
},
|
|
33075
33076
|
{
|
|
33076
|
-
id: "z-ai/glm-5
|
|
33077
|
-
name: "GLM 5
|
|
33077
|
+
id: "z-ai/glm-5.2",
|
|
33078
|
+
name: "GLM 5.2",
|
|
33078
33079
|
description: "Z.ai's latest fast GLM model",
|
|
33079
33080
|
category: "fast",
|
|
33080
33081
|
provider: "openrouter",
|
|
33081
|
-
contextLength: 202752
|
|
33082
|
+
contextLength: 202752,
|
|
33083
|
+
cost: "lower-cost"
|
|
33082
33084
|
},
|
|
33083
33085
|
{
|
|
33084
33086
|
id: "moonshotai/kimi-k2.7-code",
|
|
@@ -33086,7 +33088,8 @@ var OPENROUTER_MODELS = [
|
|
|
33086
33088
|
description: "Moonshot's latest open-weight coding model",
|
|
33087
33089
|
category: "smart",
|
|
33088
33090
|
provider: "openrouter",
|
|
33089
|
-
contextLength: 262144
|
|
33091
|
+
contextLength: 262144,
|
|
33092
|
+
cost: "lower-cost"
|
|
33090
33093
|
},
|
|
33091
33094
|
{
|
|
33092
33095
|
id: "deepseek/deepseek-v4-pro",
|
|
@@ -33094,7 +33097,8 @@ var OPENROUTER_MODELS = [
|
|
|
33094
33097
|
description: "DeepSeek's latest high-context open-source model",
|
|
33095
33098
|
category: "smart",
|
|
33096
33099
|
provider: "openrouter",
|
|
33097
|
-
contextLength: 1048576
|
|
33100
|
+
contextLength: 1048576,
|
|
33101
|
+
cost: "lower-cost"
|
|
33098
33102
|
},
|
|
33099
33103
|
{
|
|
33100
33104
|
id: "anthropic/claude-sonnet-4.6",
|
|
@@ -33102,7 +33106,8 @@ var OPENROUTER_MODELS = [
|
|
|
33102
33106
|
description: "Anthropic's latest Sonnet model",
|
|
33103
33107
|
category: "smart",
|
|
33104
33108
|
provider: "openrouter",
|
|
33105
|
-
contextLength: 1e6
|
|
33109
|
+
contextLength: 1e6,
|
|
33110
|
+
cost: "premium"
|
|
33106
33111
|
},
|
|
33107
33112
|
{
|
|
33108
33113
|
id: "openai/gpt-5.5",
|
|
@@ -33110,7 +33115,8 @@ var OPENROUTER_MODELS = [
|
|
|
33110
33115
|
description: "OpenAI's latest flagship GPT model",
|
|
33111
33116
|
category: "smart",
|
|
33112
33117
|
provider: "openrouter",
|
|
33113
|
-
contextLength: 1050000
|
|
33118
|
+
contextLength: 1050000,
|
|
33119
|
+
cost: "premium"
|
|
33114
33120
|
},
|
|
33115
33121
|
{
|
|
33116
33122
|
id: "anthropic/claude-opus-4.8",
|
|
@@ -33118,15 +33124,8 @@ var OPENROUTER_MODELS = [
|
|
|
33118
33124
|
description: "Anthropic's latest Opus model",
|
|
33119
33125
|
category: "reasoning",
|
|
33120
33126
|
provider: "openrouter",
|
|
33121
|
-
contextLength: 1e6
|
|
33122
|
-
|
|
33123
|
-
{
|
|
33124
|
-
id: "openai/gpt-5.5-pro",
|
|
33125
|
-
name: "GPT 5.5 Pro",
|
|
33126
|
-
description: "OpenAI's latest high-capability reasoning model",
|
|
33127
|
-
category: "reasoning",
|
|
33128
|
-
provider: "openrouter",
|
|
33129
|
-
contextLength: 1050000
|
|
33127
|
+
contextLength: 1e6,
|
|
33128
|
+
cost: "premium"
|
|
33130
33129
|
}
|
|
33131
33130
|
];
|
|
33132
33131
|
var VERCEL_AI_GATEWAY_MODELS = [
|
|
@@ -33136,7 +33135,8 @@ var VERCEL_AI_GATEWAY_MODELS = [
|
|
|
33136
33135
|
description: "OpenAI's latest flagship GPT model",
|
|
33137
33136
|
category: "smart",
|
|
33138
33137
|
provider: "vercel-ai-gateway",
|
|
33139
|
-
contextLength: 1050000
|
|
33138
|
+
contextLength: 1050000,
|
|
33139
|
+
cost: "premium"
|
|
33140
33140
|
},
|
|
33141
33141
|
{
|
|
33142
33142
|
id: "anthropic/claude-sonnet-4.6",
|
|
@@ -33144,15 +33144,8 @@ var VERCEL_AI_GATEWAY_MODELS = [
|
|
|
33144
33144
|
description: "Anthropic's latest Sonnet model",
|
|
33145
33145
|
category: "smart",
|
|
33146
33146
|
provider: "vercel-ai-gateway",
|
|
33147
|
-
contextLength: 1e6
|
|
33148
|
-
|
|
33149
|
-
{
|
|
33150
|
-
id: "openai/gpt-5.5-pro",
|
|
33151
|
-
name: "GPT 5.5 Pro",
|
|
33152
|
-
description: "OpenAI's latest high-capability reasoning model",
|
|
33153
|
-
category: "reasoning",
|
|
33154
|
-
provider: "vercel-ai-gateway",
|
|
33155
|
-
contextLength: 1050000
|
|
33147
|
+
contextLength: 1e6,
|
|
33148
|
+
cost: "premium"
|
|
33156
33149
|
},
|
|
33157
33150
|
{
|
|
33158
33151
|
id: "anthropic/claude-opus-4.8",
|
|
@@ -33160,17 +33153,28 @@ var VERCEL_AI_GATEWAY_MODELS = [
|
|
|
33160
33153
|
description: "Anthropic's latest Opus model",
|
|
33161
33154
|
category: "reasoning",
|
|
33162
33155
|
provider: "vercel-ai-gateway",
|
|
33163
|
-
contextLength: 1e6
|
|
33156
|
+
contextLength: 1e6,
|
|
33157
|
+
cost: "premium"
|
|
33164
33158
|
}
|
|
33165
33159
|
];
|
|
33166
33160
|
var CLOUDFLARE_AI_GATEWAY_MODELS = [
|
|
33161
|
+
{
|
|
33162
|
+
id: "workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast",
|
|
33163
|
+
name: "Workers AI Llama 3.3 70B Fast",
|
|
33164
|
+
description: "Cloudflare Workers AI fast Llama model routed through AI Gateway",
|
|
33165
|
+
category: "smart",
|
|
33166
|
+
provider: "cloudflare-ai-gateway",
|
|
33167
|
+
contextLength: 24000,
|
|
33168
|
+
cost: "lower-cost"
|
|
33169
|
+
},
|
|
33167
33170
|
{
|
|
33168
33171
|
id: "openai/gpt-5.5",
|
|
33169
33172
|
name: "GPT 5.5",
|
|
33170
33173
|
description: "OpenAI's latest flagship GPT model through Cloudflare AI Gateway",
|
|
33171
33174
|
category: "smart",
|
|
33172
33175
|
provider: "cloudflare-ai-gateway",
|
|
33173
|
-
contextLength: 1050000
|
|
33176
|
+
contextLength: 1050000,
|
|
33177
|
+
cost: "premium"
|
|
33174
33178
|
},
|
|
33175
33179
|
{
|
|
33176
33180
|
id: "anthropic/claude-sonnet-4-6",
|
|
@@ -33178,7 +33182,8 @@ var CLOUDFLARE_AI_GATEWAY_MODELS = [
|
|
|
33178
33182
|
description: "Anthropic's latest Sonnet model through Cloudflare AI Gateway",
|
|
33179
33183
|
category: "smart",
|
|
33180
33184
|
provider: "cloudflare-ai-gateway",
|
|
33181
|
-
contextLength: 1e6
|
|
33185
|
+
contextLength: 1e6,
|
|
33186
|
+
cost: "premium"
|
|
33182
33187
|
},
|
|
33183
33188
|
{
|
|
33184
33189
|
id: "anthropic/claude-opus-4-8",
|
|
@@ -33186,15 +33191,8 @@ var CLOUDFLARE_AI_GATEWAY_MODELS = [
|
|
|
33186
33191
|
description: "Anthropic's latest Opus model through Cloudflare AI Gateway",
|
|
33187
33192
|
category: "reasoning",
|
|
33188
33193
|
provider: "cloudflare-ai-gateway",
|
|
33189
|
-
contextLength: 1e6
|
|
33190
|
-
|
|
33191
|
-
{
|
|
33192
|
-
id: "workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast",
|
|
33193
|
-
name: "Workers AI Llama 3.3 70B Fast",
|
|
33194
|
-
description: "Cloudflare Workers AI fast Llama model routed through AI Gateway",
|
|
33195
|
-
category: "smart",
|
|
33196
|
-
provider: "cloudflare-ai-gateway",
|
|
33197
|
-
contextLength: 24000
|
|
33194
|
+
contextLength: 1e6,
|
|
33195
|
+
cost: "premium"
|
|
33198
33196
|
}
|
|
33199
33197
|
];
|
|
33200
33198
|
var WORKERS_AI_MODELS = [
|
|
@@ -33204,7 +33202,8 @@ var WORKERS_AI_MODELS = [
|
|
|
33204
33202
|
description: "Cloudflare Workers AI lightweight Llama instruct model",
|
|
33205
33203
|
category: "fast",
|
|
33206
33204
|
provider: "workers-ai",
|
|
33207
|
-
contextLength: 8000
|
|
33205
|
+
contextLength: 8000,
|
|
33206
|
+
cost: "lower-cost"
|
|
33208
33207
|
},
|
|
33209
33208
|
{
|
|
33210
33209
|
id: "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
|
|
@@ -33212,7 +33211,8 @@ var WORKERS_AI_MODELS = [
|
|
|
33212
33211
|
description: "Cloudflare Workers AI fast Llama instruct model",
|
|
33213
33212
|
category: "smart",
|
|
33214
33213
|
provider: "workers-ai",
|
|
33215
|
-
contextLength: 24000
|
|
33214
|
+
contextLength: 24000,
|
|
33215
|
+
cost: "lower-cost"
|
|
33216
33216
|
},
|
|
33217
33217
|
{
|
|
33218
33218
|
id: "@cf/openai/gpt-oss-120b",
|
|
@@ -33220,7 +33220,8 @@ var WORKERS_AI_MODELS = [
|
|
|
33220
33220
|
description: "OpenAI open-weight model hosted by Cloudflare Workers AI",
|
|
33221
33221
|
category: "reasoning",
|
|
33222
33222
|
provider: "workers-ai",
|
|
33223
|
-
contextLength: 32000
|
|
33223
|
+
contextLength: 32000,
|
|
33224
|
+
cost: "lower-cost"
|
|
33224
33225
|
}
|
|
33225
33226
|
];
|
|
33226
33227
|
var OPENCODE_ZEN_MODELS = [
|
|
@@ -33232,16 +33233,17 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
33232
33233
|
provider: "opencode-zen",
|
|
33233
33234
|
zenApiType: "openai-compatible",
|
|
33234
33235
|
contextLength: 1048576,
|
|
33235
|
-
|
|
33236
|
+
cost: "free"
|
|
33236
33237
|
},
|
|
33237
33238
|
{
|
|
33238
33239
|
id: "gpt-5-nano",
|
|
33239
33240
|
name: "GPT 5 Nano",
|
|
33240
|
-
description: "OpenAI's lightweight GPT model
|
|
33241
|
+
description: "OpenAI's lightweight GPT model",
|
|
33241
33242
|
category: "fast",
|
|
33242
33243
|
provider: "opencode-zen",
|
|
33243
33244
|
zenApiType: "openai-responses",
|
|
33244
|
-
contextLength: 400000
|
|
33245
|
+
contextLength: 400000,
|
|
33246
|
+
cost: "lower-cost"
|
|
33245
33247
|
},
|
|
33246
33248
|
{
|
|
33247
33249
|
id: "claude-haiku-4-5",
|
|
@@ -33250,7 +33252,8 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
33250
33252
|
category: "fast",
|
|
33251
33253
|
provider: "opencode-zen",
|
|
33252
33254
|
zenApiType: "anthropic",
|
|
33253
|
-
contextLength: 200000
|
|
33255
|
+
contextLength: 200000,
|
|
33256
|
+
cost: "lower-cost"
|
|
33254
33257
|
},
|
|
33255
33258
|
{
|
|
33256
33259
|
id: "gemini-3.5-flash",
|
|
@@ -33259,7 +33262,8 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
33259
33262
|
category: "fast",
|
|
33260
33263
|
provider: "opencode-zen",
|
|
33261
33264
|
zenApiType: "google",
|
|
33262
|
-
contextLength: 1048576
|
|
33265
|
+
contextLength: 1048576,
|
|
33266
|
+
cost: "lower-cost"
|
|
33263
33267
|
},
|
|
33264
33268
|
{
|
|
33265
33269
|
id: "claude-sonnet-4-6",
|
|
@@ -33268,7 +33272,8 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
33268
33272
|
category: "smart",
|
|
33269
33273
|
provider: "opencode-zen",
|
|
33270
33274
|
zenApiType: "anthropic",
|
|
33271
|
-
contextLength: 1e6
|
|
33275
|
+
contextLength: 1e6,
|
|
33276
|
+
cost: "premium"
|
|
33272
33277
|
},
|
|
33273
33278
|
{
|
|
33274
33279
|
id: "gpt-5.5",
|
|
@@ -33277,7 +33282,8 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
33277
33282
|
category: "smart",
|
|
33278
33283
|
provider: "opencode-zen",
|
|
33279
33284
|
zenApiType: "openai-responses",
|
|
33280
|
-
contextLength: 1050000
|
|
33285
|
+
contextLength: 1050000,
|
|
33286
|
+
cost: "premium"
|
|
33281
33287
|
},
|
|
33282
33288
|
{
|
|
33283
33289
|
id: "claude-opus-4-8",
|
|
@@ -33286,16 +33292,8 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
33286
33292
|
category: "reasoning",
|
|
33287
33293
|
provider: "opencode-zen",
|
|
33288
33294
|
zenApiType: "anthropic",
|
|
33289
|
-
contextLength: 1e6
|
|
33290
|
-
|
|
33291
|
-
{
|
|
33292
|
-
id: "gpt-5.5-pro",
|
|
33293
|
-
name: "GPT 5.5 Pro",
|
|
33294
|
-
description: "OpenAI's latest high-capability reasoning model",
|
|
33295
|
-
category: "reasoning",
|
|
33296
|
-
provider: "opencode-zen",
|
|
33297
|
-
zenApiType: "openai-responses",
|
|
33298
|
-
contextLength: 1050000
|
|
33295
|
+
contextLength: 1e6,
|
|
33296
|
+
cost: "premium"
|
|
33299
33297
|
}
|
|
33300
33298
|
];
|
|
33301
33299
|
var ALL_MODELS = [
|
|
@@ -33345,6 +33343,27 @@ function getProviderDisplayName(provider) {
|
|
|
33345
33343
|
}
|
|
33346
33344
|
}
|
|
33347
33345
|
}
|
|
33346
|
+
var COST_TIER_ORDER = {
|
|
33347
|
+
free: 0,
|
|
33348
|
+
"lower-cost": 1,
|
|
33349
|
+
premium: 2
|
|
33350
|
+
};
|
|
33351
|
+
var CATEGORY_ORDER = {
|
|
33352
|
+
fast: 0,
|
|
33353
|
+
smart: 1,
|
|
33354
|
+
reasoning: 2
|
|
33355
|
+
};
|
|
33356
|
+
function sortModelsByCost(models) {
|
|
33357
|
+
return [...models].sort((a, b2) => {
|
|
33358
|
+
const costDiff = COST_TIER_ORDER[a.cost] - COST_TIER_ORDER[b2.cost];
|
|
33359
|
+
if (costDiff !== 0)
|
|
33360
|
+
return costDiff;
|
|
33361
|
+
const catDiff = CATEGORY_ORDER[a.category] - CATEGORY_ORDER[b2.category];
|
|
33362
|
+
if (catDiff !== 0)
|
|
33363
|
+
return catDiff;
|
|
33364
|
+
return a.name.localeCompare(b2.name);
|
|
33365
|
+
});
|
|
33366
|
+
}
|
|
33348
33367
|
|
|
33349
33368
|
// src/lib/types.ts
|
|
33350
33369
|
function isCustomModel(model) {
|
|
@@ -76804,7 +76823,17 @@ function generateMessageId() {
|
|
|
76804
76823
|
return `msg-${++messageIdCounter}`;
|
|
76805
76824
|
}
|
|
76806
76825
|
function isFreeModel(model) {
|
|
76807
|
-
return !isCustomModel(model) &&
|
|
76826
|
+
return !isCustomModel(model) && model.cost === "free";
|
|
76827
|
+
}
|
|
76828
|
+
function costTierLabel(tier) {
|
|
76829
|
+
switch (tier) {
|
|
76830
|
+
case "free":
|
|
76831
|
+
return "FREE";
|
|
76832
|
+
case "lower-cost":
|
|
76833
|
+
return "lower-cost";
|
|
76834
|
+
case "premium":
|
|
76835
|
+
return "premium";
|
|
76836
|
+
}
|
|
76808
76837
|
}
|
|
76809
76838
|
async function main() {
|
|
76810
76839
|
config2 = loadConfig();
|
|
@@ -77768,16 +77797,17 @@ function showModelSelector() {
|
|
|
77768
77797
|
});
|
|
77769
77798
|
renderer.root.add(container);
|
|
77770
77799
|
const allModels = getProviderModels(config2.provider);
|
|
77771
|
-
const availableModels = allModels.filter((m2) => !m2.disabled)
|
|
77800
|
+
const availableModels = allModels.filter((m2) => !m2.disabled);
|
|
77801
|
+
const sortedModels = sortModelsByCost(availableModels);
|
|
77772
77802
|
const customModels = getCustomModels().sort((a, b2) => a.name.localeCompare(b2.name));
|
|
77773
77803
|
const options = [
|
|
77774
|
-
...
|
|
77775
|
-
name: `${model.name} [${model.
|
|
77804
|
+
...sortedModels.map((model) => ({
|
|
77805
|
+
name: `${model.name} [${costTierLabel(model.cost)}]`,
|
|
77776
77806
|
description: model.description,
|
|
77777
77807
|
value: model
|
|
77778
77808
|
})),
|
|
77779
77809
|
...customModels.map((model) => ({
|
|
77780
|
-
name: `${model.name} [
|
|
77810
|
+
name: `${model.name} [custom]`,
|
|
77781
77811
|
description: `${model.baseUrl} - ${model.modelId}`,
|
|
77782
77812
|
value: model
|
|
77783
77813
|
}))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@austinthesing/magic-shell",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.25",
|
|
4
4
|
"description": "Natural language to terminal commands with safety features. Supports OpenCode Zen, OpenRouter, AI gateways, Workers AI, and custom models.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|