@austinthesing/magic-shell 1.1.6 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +78 -14
- package/dist/index.js +94 -18
- package/dist/tui.js +78 -14
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -33059,6 +33059,42 @@ import { cwd as getCwd } from "process";
|
|
|
33059
33059
|
|
|
33060
33060
|
// src/lib/models.ts
|
|
33061
33061
|
var OPENROUTER_MODELS = [
|
|
33062
|
+
{
|
|
33063
|
+
id: "xiaomi/mimo-v2.6-flash",
|
|
33064
|
+
name: "MiMo V2.6 Flash",
|
|
33065
|
+
description: "Xiaomi's open-source mixture-of-experts model with long-context support.",
|
|
33066
|
+
category: "fast",
|
|
33067
|
+
provider: "openrouter",
|
|
33068
|
+
contextLength: 1048576,
|
|
33069
|
+
cost: "lower-cost"
|
|
33070
|
+
},
|
|
33071
|
+
{
|
|
33072
|
+
id: "openai/gpt-6-luna",
|
|
33073
|
+
name: "GPT 6 Luna",
|
|
33074
|
+
description: "Efficient GPT-6 model for focused, high-volume tasks.",
|
|
33075
|
+
category: "fast",
|
|
33076
|
+
provider: "openrouter",
|
|
33077
|
+
contextLength: 1050000,
|
|
33078
|
+
cost: "lower-cost"
|
|
33079
|
+
},
|
|
33080
|
+
{
|
|
33081
|
+
id: "openai/gpt-6-sol",
|
|
33082
|
+
name: "GPT 6 Sol",
|
|
33083
|
+
description: "GPT-6 model for complex coding and agentic workflows.",
|
|
33084
|
+
category: "reasoning",
|
|
33085
|
+
provider: "openrouter",
|
|
33086
|
+
contextLength: 1050000,
|
|
33087
|
+
cost: "premium"
|
|
33088
|
+
},
|
|
33089
|
+
{
|
|
33090
|
+
id: "anthropic/claude-opus-5.5",
|
|
33091
|
+
name: "Claude Opus 5.5",
|
|
33092
|
+
description: "Claude model for agentic coding with always-on adaptive thinking.",
|
|
33093
|
+
category: "reasoning",
|
|
33094
|
+
provider: "openrouter",
|
|
33095
|
+
contextLength: 1e6,
|
|
33096
|
+
cost: "premium"
|
|
33097
|
+
},
|
|
33062
33098
|
{
|
|
33063
33099
|
id: "openai/gpt-6-astra",
|
|
33064
33100
|
name: "GPT 6 Astra",
|
|
@@ -33280,6 +33316,10 @@ var VERCEL_AI_GATEWAY_MODELS = [
|
|
|
33280
33316
|
...OPENROUTER_MODELS.filter((model) => [
|
|
33281
33317
|
"openai/gpt-5.6-luna",
|
|
33282
33318
|
"openai/gpt-6-astra",
|
|
33319
|
+
"openai/gpt-6-luna",
|
|
33320
|
+
"xiaomi/mimo-v2.6-flash",
|
|
33321
|
+
"openai/gpt-6-sol",
|
|
33322
|
+
"anthropic/claude-opus-5.5",
|
|
33283
33323
|
"deepseek/deepseek-v4.1-flash",
|
|
33284
33324
|
"openai/gpt-5.6-terra",
|
|
33285
33325
|
"openai/gpt-5.6-sol",
|
|
@@ -33344,7 +33384,7 @@ var CLOUDFLARE_AI_GATEWAY_MODELS = [
|
|
|
33344
33384
|
contextLength: 32000,
|
|
33345
33385
|
cost: "lower-cost"
|
|
33346
33386
|
},
|
|
33347
|
-
...VERCEL_AI_GATEWAY_MODELS.filter((model) =>
|
|
33387
|
+
...VERCEL_AI_GATEWAY_MODELS.filter((model) => !["deepseek/deepseek-v4.1-flash", "xiaomi/mimo-v2.6-flash"].includes(model.id)).map((model) => ({
|
|
33348
33388
|
...model,
|
|
33349
33389
|
id: model.id.startsWith("anthropic/") ? model.id.replaceAll(".", "-") : model.id,
|
|
33350
33390
|
provider: "cloudflare-ai-gateway"
|
|
@@ -33482,16 +33522,6 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
33482
33522
|
contextLength: 1e6,
|
|
33483
33523
|
cost: "free"
|
|
33484
33524
|
},
|
|
33485
|
-
{
|
|
33486
|
-
id: "laguna-s-2.1-free",
|
|
33487
|
-
name: "Laguna S 2.1 (Free)",
|
|
33488
|
-
description: "Open-weight coding model for long-horizon agentic work.",
|
|
33489
|
-
category: "reasoning",
|
|
33490
|
-
provider: "opencode-zen",
|
|
33491
|
-
zenApiType: "openai-compatible",
|
|
33492
|
-
contextLength: 262144,
|
|
33493
|
-
cost: "free"
|
|
33494
|
-
},
|
|
33495
33525
|
{
|
|
33496
33526
|
id: "minimax-m3",
|
|
33497
33527
|
name: "MiniMax M3",
|
|
@@ -33535,6 +33565,8 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
33535
33565
|
...[
|
|
33536
33566
|
["gpt-5.6-luna", "GPT 5.6 Luna", "fast", "lower-cost"],
|
|
33537
33567
|
["gpt-6-astra", "GPT 6 Astra", "reasoning", "premium"],
|
|
33568
|
+
["gpt-6-luna", "GPT 6 Luna", "fast", "lower-cost"],
|
|
33569
|
+
["gpt-6-sol", "GPT 6 Sol", "reasoning", "premium"],
|
|
33538
33570
|
["gpt-5.6-terra", "GPT 5.6 Terra", "smart", "premium"],
|
|
33539
33571
|
["gpt-5.6-sol", "GPT 5.6 Sol", "reasoning", "premium"]
|
|
33540
33572
|
].map(([id, name, category, cost]) => ({
|
|
@@ -33547,6 +33579,16 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
33547
33579
|
contextLength: 1050000,
|
|
33548
33580
|
cost
|
|
33549
33581
|
})),
|
|
33582
|
+
{
|
|
33583
|
+
id: "claude-opus-5-5",
|
|
33584
|
+
name: "Claude Opus 5.5",
|
|
33585
|
+
description: "Claude model for agentic coding with always-on adaptive thinking.",
|
|
33586
|
+
category: "reasoning",
|
|
33587
|
+
provider: "opencode-zen",
|
|
33588
|
+
zenApiType: "anthropic",
|
|
33589
|
+
contextLength: 1e6,
|
|
33590
|
+
cost: "premium"
|
|
33591
|
+
},
|
|
33550
33592
|
{
|
|
33551
33593
|
id: "claude-sonnet-5",
|
|
33552
33594
|
name: "Claude Sonnet 5",
|
|
@@ -33612,7 +33654,10 @@ function getProviderModels(provider) {
|
|
|
33612
33654
|
}
|
|
33613
33655
|
}
|
|
33614
33656
|
function getConfiguredModel(config) {
|
|
33615
|
-
return getProviderModels(config.provider).find((model) => model.id === config.defaultModel);
|
|
33657
|
+
return getProviderModels(config.provider).find((model) => model.id === config.defaultModel && !model.disabled);
|
|
33658
|
+
}
|
|
33659
|
+
function getProviderDefaultModel(provider) {
|
|
33660
|
+
return getProviderModels(provider).find((model) => !model.disabled);
|
|
33616
33661
|
}
|
|
33617
33662
|
function getProviderDisplayName(provider) {
|
|
33618
33663
|
switch (provider) {
|
|
@@ -34035,7 +34080,7 @@ var DEFAULT_CONFIG = {
|
|
|
34035
34080
|
workersAiApiKey: "",
|
|
34036
34081
|
cloudflareAccountId: "",
|
|
34037
34082
|
cloudflareAiGatewayId: "default",
|
|
34038
|
-
defaultModel: "
|
|
34083
|
+
defaultModel: getProviderDefaultModel("opencode-zen").id,
|
|
34039
34084
|
thinkingLevel: "low",
|
|
34040
34085
|
safetyLevel: "moderate",
|
|
34041
34086
|
dryRunByDefault: false,
|
|
@@ -34066,7 +34111,18 @@ function loadConfig() {
|
|
|
34066
34111
|
try {
|
|
34067
34112
|
const data = readFileSync(CONFIG_FILE, "utf-8");
|
|
34068
34113
|
const loaded = JSON.parse(data);
|
|
34069
|
-
|
|
34114
|
+
const config = { ...DEFAULT_CONFIG, ...loaded };
|
|
34115
|
+
const isCustom = config.customModels?.some((model) => model.id === config.defaultModel);
|
|
34116
|
+
if (config.provider !== "custom" && !isCustom && !getConfiguredModel(config)) {
|
|
34117
|
+
const fallback = getProviderDefaultModel(config.provider);
|
|
34118
|
+
if (fallback) {
|
|
34119
|
+
config.defaultModel = fallback.id;
|
|
34120
|
+
try {
|
|
34121
|
+
writeFileSync3(CONFIG_FILE, JSON.stringify({ ...loaded, defaultModel: fallback.id }, null, 2));
|
|
34122
|
+
} catch {}
|
|
34123
|
+
}
|
|
34124
|
+
}
|
|
34125
|
+
return config;
|
|
34070
34126
|
} catch {
|
|
34071
34127
|
return { ...DEFAULT_CONFIG };
|
|
34072
34128
|
}
|
|
@@ -74826,6 +74882,9 @@ function buildOpenAICompatibleThinkingOptions(modelId, thinkingLevel) {
|
|
|
74826
74882
|
};
|
|
74827
74883
|
}
|
|
74828
74884
|
function buildAiSdkProviderOptions(modelId, thinkingLevel, providerOptionsName) {
|
|
74885
|
+
if (modelId === "claude-opus-5-5") {
|
|
74886
|
+
return { anthropic: { effort: thinkingLevel === "off" ? "low" : thinkingLevel } };
|
|
74887
|
+
}
|
|
74829
74888
|
if (thinkingLevel === "off" || !supportsThinkingControl(modelId)) {
|
|
74830
74889
|
return;
|
|
74831
74890
|
}
|
|
@@ -74884,6 +74943,8 @@ function buildAiSdkProviderOptions(modelId, thinkingLevel, providerOptionsName)
|
|
|
74884
74943
|
return;
|
|
74885
74944
|
}
|
|
74886
74945
|
function shouldOmitTemperature(modelId, thinkingLevel) {
|
|
74946
|
+
if (/claude-opus-5[.-]5/.test(modelId))
|
|
74947
|
+
return true;
|
|
74887
74948
|
if (modelId.includes("gpt-6"))
|
|
74888
74949
|
return true;
|
|
74889
74950
|
return thinkingLevel !== "off" && (modelId.startsWith("claude-") || modelId.includes("gpt-5"));
|
|
@@ -75623,6 +75684,9 @@ async function main() {
|
|
|
75623
75684
|
const savedModel = getConfiguredModel(config2);
|
|
75624
75685
|
if (savedModel) {
|
|
75625
75686
|
currentModel = savedModel;
|
|
75687
|
+
} else {
|
|
75688
|
+
console.error("No supported default model configured. Run msh --setup or select a custom model with msh --model <id>.");
|
|
75689
|
+
process.exit(1);
|
|
75626
75690
|
}
|
|
75627
75691
|
}
|
|
75628
75692
|
renderer = await createCliRenderer({
|
package/dist/index.js
CHANGED
|
@@ -717,6 +717,42 @@ import { cwd as getCwd } from "process";
|
|
|
717
717
|
|
|
718
718
|
// src/lib/models.ts
|
|
719
719
|
var OPENROUTER_MODELS = [
|
|
720
|
+
{
|
|
721
|
+
id: "xiaomi/mimo-v2.6-flash",
|
|
722
|
+
name: "MiMo V2.6 Flash",
|
|
723
|
+
description: "Xiaomi's open-source mixture-of-experts model with long-context support.",
|
|
724
|
+
category: "fast",
|
|
725
|
+
provider: "openrouter",
|
|
726
|
+
contextLength: 1048576,
|
|
727
|
+
cost: "lower-cost"
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
id: "openai/gpt-6-luna",
|
|
731
|
+
name: "GPT 6 Luna",
|
|
732
|
+
description: "Efficient GPT-6 model for focused, high-volume tasks.",
|
|
733
|
+
category: "fast",
|
|
734
|
+
provider: "openrouter",
|
|
735
|
+
contextLength: 1050000,
|
|
736
|
+
cost: "lower-cost"
|
|
737
|
+
},
|
|
738
|
+
{
|
|
739
|
+
id: "openai/gpt-6-sol",
|
|
740
|
+
name: "GPT 6 Sol",
|
|
741
|
+
description: "GPT-6 model for complex coding and agentic workflows.",
|
|
742
|
+
category: "reasoning",
|
|
743
|
+
provider: "openrouter",
|
|
744
|
+
contextLength: 1050000,
|
|
745
|
+
cost: "premium"
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
id: "anthropic/claude-opus-5.5",
|
|
749
|
+
name: "Claude Opus 5.5",
|
|
750
|
+
description: "Claude model for agentic coding with always-on adaptive thinking.",
|
|
751
|
+
category: "reasoning",
|
|
752
|
+
provider: "openrouter",
|
|
753
|
+
contextLength: 1e6,
|
|
754
|
+
cost: "premium"
|
|
755
|
+
},
|
|
720
756
|
{
|
|
721
757
|
id: "openai/gpt-6-astra",
|
|
722
758
|
name: "GPT 6 Astra",
|
|
@@ -938,6 +974,10 @@ var VERCEL_AI_GATEWAY_MODELS = [
|
|
|
938
974
|
...OPENROUTER_MODELS.filter((model) => [
|
|
939
975
|
"openai/gpt-5.6-luna",
|
|
940
976
|
"openai/gpt-6-astra",
|
|
977
|
+
"openai/gpt-6-luna",
|
|
978
|
+
"xiaomi/mimo-v2.6-flash",
|
|
979
|
+
"openai/gpt-6-sol",
|
|
980
|
+
"anthropic/claude-opus-5.5",
|
|
941
981
|
"deepseek/deepseek-v4.1-flash",
|
|
942
982
|
"openai/gpt-5.6-terra",
|
|
943
983
|
"openai/gpt-5.6-sol",
|
|
@@ -1002,7 +1042,7 @@ var CLOUDFLARE_AI_GATEWAY_MODELS = [
|
|
|
1002
1042
|
contextLength: 32000,
|
|
1003
1043
|
cost: "lower-cost"
|
|
1004
1044
|
},
|
|
1005
|
-
...VERCEL_AI_GATEWAY_MODELS.filter((model) =>
|
|
1045
|
+
...VERCEL_AI_GATEWAY_MODELS.filter((model) => !["deepseek/deepseek-v4.1-flash", "xiaomi/mimo-v2.6-flash"].includes(model.id)).map((model) => ({
|
|
1006
1046
|
...model,
|
|
1007
1047
|
id: model.id.startsWith("anthropic/") ? model.id.replaceAll(".", "-") : model.id,
|
|
1008
1048
|
provider: "cloudflare-ai-gateway"
|
|
@@ -1140,16 +1180,6 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
1140
1180
|
contextLength: 1e6,
|
|
1141
1181
|
cost: "free"
|
|
1142
1182
|
},
|
|
1143
|
-
{
|
|
1144
|
-
id: "laguna-s-2.1-free",
|
|
1145
|
-
name: "Laguna S 2.1 (Free)",
|
|
1146
|
-
description: "Open-weight coding model for long-horizon agentic work.",
|
|
1147
|
-
category: "reasoning",
|
|
1148
|
-
provider: "opencode-zen",
|
|
1149
|
-
zenApiType: "openai-compatible",
|
|
1150
|
-
contextLength: 262144,
|
|
1151
|
-
cost: "free"
|
|
1152
|
-
},
|
|
1153
1183
|
{
|
|
1154
1184
|
id: "minimax-m3",
|
|
1155
1185
|
name: "MiniMax M3",
|
|
@@ -1193,6 +1223,8 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
1193
1223
|
...[
|
|
1194
1224
|
["gpt-5.6-luna", "GPT 5.6 Luna", "fast", "lower-cost"],
|
|
1195
1225
|
["gpt-6-astra", "GPT 6 Astra", "reasoning", "premium"],
|
|
1226
|
+
["gpt-6-luna", "GPT 6 Luna", "fast", "lower-cost"],
|
|
1227
|
+
["gpt-6-sol", "GPT 6 Sol", "reasoning", "premium"],
|
|
1196
1228
|
["gpt-5.6-terra", "GPT 5.6 Terra", "smart", "premium"],
|
|
1197
1229
|
["gpt-5.6-sol", "GPT 5.6 Sol", "reasoning", "premium"]
|
|
1198
1230
|
].map(([id, name, category, cost]) => ({
|
|
@@ -1205,6 +1237,16 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
1205
1237
|
contextLength: 1050000,
|
|
1206
1238
|
cost
|
|
1207
1239
|
})),
|
|
1240
|
+
{
|
|
1241
|
+
id: "claude-opus-5-5",
|
|
1242
|
+
name: "Claude Opus 5.5",
|
|
1243
|
+
description: "Claude model for agentic coding with always-on adaptive thinking.",
|
|
1244
|
+
category: "reasoning",
|
|
1245
|
+
provider: "opencode-zen",
|
|
1246
|
+
zenApiType: "anthropic",
|
|
1247
|
+
contextLength: 1e6,
|
|
1248
|
+
cost: "premium"
|
|
1249
|
+
},
|
|
1208
1250
|
{
|
|
1209
1251
|
id: "claude-sonnet-5",
|
|
1210
1252
|
name: "Claude Sonnet 5",
|
|
@@ -1270,7 +1312,10 @@ function getProviderModels(provider) {
|
|
|
1270
1312
|
}
|
|
1271
1313
|
}
|
|
1272
1314
|
function getConfiguredModel(config) {
|
|
1273
|
-
return getProviderModels(config.provider).find((model) => model.id === config.defaultModel);
|
|
1315
|
+
return getProviderModels(config.provider).find((model) => model.id === config.defaultModel && !model.disabled);
|
|
1316
|
+
}
|
|
1317
|
+
function getProviderDefaultModel(provider) {
|
|
1318
|
+
return getProviderModels(provider).find((model) => !model.disabled);
|
|
1274
1319
|
}
|
|
1275
1320
|
function getProviderDisplayName(provider) {
|
|
1276
1321
|
switch (provider) {
|
|
@@ -1687,7 +1732,7 @@ var DEFAULT_CONFIG = {
|
|
|
1687
1732
|
workersAiApiKey: "",
|
|
1688
1733
|
cloudflareAccountId: "",
|
|
1689
1734
|
cloudflareAiGatewayId: "default",
|
|
1690
|
-
defaultModel: "
|
|
1735
|
+
defaultModel: getProviderDefaultModel("opencode-zen").id,
|
|
1691
1736
|
thinkingLevel: "low",
|
|
1692
1737
|
safetyLevel: "moderate",
|
|
1693
1738
|
dryRunByDefault: false,
|
|
@@ -1718,7 +1763,18 @@ function loadConfig() {
|
|
|
1718
1763
|
try {
|
|
1719
1764
|
const data = readFileSync(CONFIG_FILE, "utf-8");
|
|
1720
1765
|
const loaded = JSON.parse(data);
|
|
1721
|
-
|
|
1766
|
+
const config = { ...DEFAULT_CONFIG, ...loaded };
|
|
1767
|
+
const isCustom = config.customModels?.some((model) => model.id === config.defaultModel);
|
|
1768
|
+
if (config.provider !== "custom" && !isCustom && !getConfiguredModel(config)) {
|
|
1769
|
+
const fallback = getProviderDefaultModel(config.provider);
|
|
1770
|
+
if (fallback) {
|
|
1771
|
+
config.defaultModel = fallback.id;
|
|
1772
|
+
try {
|
|
1773
|
+
writeFileSync(CONFIG_FILE, JSON.stringify({ ...loaded, defaultModel: fallback.id }, null, 2));
|
|
1774
|
+
} catch {}
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
return config;
|
|
1722
1778
|
} catch {
|
|
1723
1779
|
return { ...DEFAULT_CONFIG };
|
|
1724
1780
|
}
|
|
@@ -42147,7 +42203,7 @@ var DEFAULT_CONFIG2 = {
|
|
|
42147
42203
|
workersAiApiKey: "",
|
|
42148
42204
|
cloudflareAccountId: "",
|
|
42149
42205
|
cloudflareAiGatewayId: "default",
|
|
42150
|
-
defaultModel: "
|
|
42206
|
+
defaultModel: getProviderDefaultModel("opencode-zen").id,
|
|
42151
42207
|
thinkingLevel: "low",
|
|
42152
42208
|
safetyLevel: "moderate",
|
|
42153
42209
|
dryRunByDefault: false,
|
|
@@ -42178,7 +42234,18 @@ function loadConfig2() {
|
|
|
42178
42234
|
try {
|
|
42179
42235
|
const data = readFileSync2(CONFIG_FILE2, "utf-8");
|
|
42180
42236
|
const loaded = JSON.parse(data);
|
|
42181
|
-
|
|
42237
|
+
const config = { ...DEFAULT_CONFIG2, ...loaded };
|
|
42238
|
+
const isCustom = config.customModels?.some((model) => model.id === config.defaultModel);
|
|
42239
|
+
if (config.provider !== "custom" && !isCustom && !getConfiguredModel(config)) {
|
|
42240
|
+
const fallback = getProviderDefaultModel(config.provider);
|
|
42241
|
+
if (fallback) {
|
|
42242
|
+
config.defaultModel = fallback.id;
|
|
42243
|
+
try {
|
|
42244
|
+
writeFileSync2(CONFIG_FILE2, JSON.stringify({ ...loaded, defaultModel: fallback.id }, null, 2));
|
|
42245
|
+
} catch {}
|
|
42246
|
+
}
|
|
42247
|
+
}
|
|
42248
|
+
return config;
|
|
42182
42249
|
} catch {
|
|
42183
42250
|
return { ...DEFAULT_CONFIG2 };
|
|
42184
42251
|
}
|
|
@@ -42744,6 +42811,9 @@ function buildOpenAICompatibleThinkingOptions(modelId, thinkingLevel) {
|
|
|
42744
42811
|
};
|
|
42745
42812
|
}
|
|
42746
42813
|
function buildAiSdkProviderOptions(modelId, thinkingLevel, providerOptionsName) {
|
|
42814
|
+
if (modelId === "claude-opus-5-5") {
|
|
42815
|
+
return { anthropic: { effort: thinkingLevel === "off" ? "low" : thinkingLevel } };
|
|
42816
|
+
}
|
|
42747
42817
|
if (thinkingLevel === "off" || !supportsThinkingControl(modelId)) {
|
|
42748
42818
|
return;
|
|
42749
42819
|
}
|
|
@@ -42802,6 +42872,8 @@ function buildAiSdkProviderOptions(modelId, thinkingLevel, providerOptionsName)
|
|
|
42802
42872
|
return;
|
|
42803
42873
|
}
|
|
42804
42874
|
function shouldOmitTemperature(modelId, thinkingLevel) {
|
|
42875
|
+
if (/claude-opus-5[.-]5/.test(modelId))
|
|
42876
|
+
return true;
|
|
42805
42877
|
if (modelId.includes("gpt-6"))
|
|
42806
42878
|
return true;
|
|
42807
42879
|
return thinkingLevel !== "off" && (modelId.startsWith("claude-") || modelId.includes("gpt-5"));
|
|
@@ -43918,8 +43990,12 @@ async function translate(query, options) {
|
|
|
43918
43990
|
const apiKey = await getApiKey(config.provider);
|
|
43919
43991
|
const customModel = await getCustomModel(config.defaultModel);
|
|
43920
43992
|
const builtInModel = getConfiguredModel(config);
|
|
43921
|
-
const
|
|
43922
|
-
|
|
43993
|
+
const model = customModel || builtInModel;
|
|
43994
|
+
if (!model) {
|
|
43995
|
+
console.error(`${colors.red}Error: No supported default model configured.${colors.reset}`);
|
|
43996
|
+
console.error(`Run: ${colors.cyan}msh --setup${colors.reset}`);
|
|
43997
|
+
process.exit(1);
|
|
43998
|
+
}
|
|
43923
43999
|
if (!customModel && !apiKey) {
|
|
43924
44000
|
console.error(`${colors.red}Error: No API key configured.${colors.reset}`);
|
|
43925
44001
|
console.error(`Run: ${colors.cyan}msh --setup${colors.reset}`);
|
package/dist/tui.js
CHANGED
|
@@ -33059,6 +33059,42 @@ import { cwd as getCwd } from "process";
|
|
|
33059
33059
|
|
|
33060
33060
|
// src/lib/models.ts
|
|
33061
33061
|
var OPENROUTER_MODELS = [
|
|
33062
|
+
{
|
|
33063
|
+
id: "xiaomi/mimo-v2.6-flash",
|
|
33064
|
+
name: "MiMo V2.6 Flash",
|
|
33065
|
+
description: "Xiaomi's open-source mixture-of-experts model with long-context support.",
|
|
33066
|
+
category: "fast",
|
|
33067
|
+
provider: "openrouter",
|
|
33068
|
+
contextLength: 1048576,
|
|
33069
|
+
cost: "lower-cost"
|
|
33070
|
+
},
|
|
33071
|
+
{
|
|
33072
|
+
id: "openai/gpt-6-luna",
|
|
33073
|
+
name: "GPT 6 Luna",
|
|
33074
|
+
description: "Efficient GPT-6 model for focused, high-volume tasks.",
|
|
33075
|
+
category: "fast",
|
|
33076
|
+
provider: "openrouter",
|
|
33077
|
+
contextLength: 1050000,
|
|
33078
|
+
cost: "lower-cost"
|
|
33079
|
+
},
|
|
33080
|
+
{
|
|
33081
|
+
id: "openai/gpt-6-sol",
|
|
33082
|
+
name: "GPT 6 Sol",
|
|
33083
|
+
description: "GPT-6 model for complex coding and agentic workflows.",
|
|
33084
|
+
category: "reasoning",
|
|
33085
|
+
provider: "openrouter",
|
|
33086
|
+
contextLength: 1050000,
|
|
33087
|
+
cost: "premium"
|
|
33088
|
+
},
|
|
33089
|
+
{
|
|
33090
|
+
id: "anthropic/claude-opus-5.5",
|
|
33091
|
+
name: "Claude Opus 5.5",
|
|
33092
|
+
description: "Claude model for agentic coding with always-on adaptive thinking.",
|
|
33093
|
+
category: "reasoning",
|
|
33094
|
+
provider: "openrouter",
|
|
33095
|
+
contextLength: 1e6,
|
|
33096
|
+
cost: "premium"
|
|
33097
|
+
},
|
|
33062
33098
|
{
|
|
33063
33099
|
id: "openai/gpt-6-astra",
|
|
33064
33100
|
name: "GPT 6 Astra",
|
|
@@ -33280,6 +33316,10 @@ var VERCEL_AI_GATEWAY_MODELS = [
|
|
|
33280
33316
|
...OPENROUTER_MODELS.filter((model) => [
|
|
33281
33317
|
"openai/gpt-5.6-luna",
|
|
33282
33318
|
"openai/gpt-6-astra",
|
|
33319
|
+
"openai/gpt-6-luna",
|
|
33320
|
+
"xiaomi/mimo-v2.6-flash",
|
|
33321
|
+
"openai/gpt-6-sol",
|
|
33322
|
+
"anthropic/claude-opus-5.5",
|
|
33283
33323
|
"deepseek/deepseek-v4.1-flash",
|
|
33284
33324
|
"openai/gpt-5.6-terra",
|
|
33285
33325
|
"openai/gpt-5.6-sol",
|
|
@@ -33344,7 +33384,7 @@ var CLOUDFLARE_AI_GATEWAY_MODELS = [
|
|
|
33344
33384
|
contextLength: 32000,
|
|
33345
33385
|
cost: "lower-cost"
|
|
33346
33386
|
},
|
|
33347
|
-
...VERCEL_AI_GATEWAY_MODELS.filter((model) =>
|
|
33387
|
+
...VERCEL_AI_GATEWAY_MODELS.filter((model) => !["deepseek/deepseek-v4.1-flash", "xiaomi/mimo-v2.6-flash"].includes(model.id)).map((model) => ({
|
|
33348
33388
|
...model,
|
|
33349
33389
|
id: model.id.startsWith("anthropic/") ? model.id.replaceAll(".", "-") : model.id,
|
|
33350
33390
|
provider: "cloudflare-ai-gateway"
|
|
@@ -33482,16 +33522,6 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
33482
33522
|
contextLength: 1e6,
|
|
33483
33523
|
cost: "free"
|
|
33484
33524
|
},
|
|
33485
|
-
{
|
|
33486
|
-
id: "laguna-s-2.1-free",
|
|
33487
|
-
name: "Laguna S 2.1 (Free)",
|
|
33488
|
-
description: "Open-weight coding model for long-horizon agentic work.",
|
|
33489
|
-
category: "reasoning",
|
|
33490
|
-
provider: "opencode-zen",
|
|
33491
|
-
zenApiType: "openai-compatible",
|
|
33492
|
-
contextLength: 262144,
|
|
33493
|
-
cost: "free"
|
|
33494
|
-
},
|
|
33495
33525
|
{
|
|
33496
33526
|
id: "minimax-m3",
|
|
33497
33527
|
name: "MiniMax M3",
|
|
@@ -33535,6 +33565,8 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
33535
33565
|
...[
|
|
33536
33566
|
["gpt-5.6-luna", "GPT 5.6 Luna", "fast", "lower-cost"],
|
|
33537
33567
|
["gpt-6-astra", "GPT 6 Astra", "reasoning", "premium"],
|
|
33568
|
+
["gpt-6-luna", "GPT 6 Luna", "fast", "lower-cost"],
|
|
33569
|
+
["gpt-6-sol", "GPT 6 Sol", "reasoning", "premium"],
|
|
33538
33570
|
["gpt-5.6-terra", "GPT 5.6 Terra", "smart", "premium"],
|
|
33539
33571
|
["gpt-5.6-sol", "GPT 5.6 Sol", "reasoning", "premium"]
|
|
33540
33572
|
].map(([id, name, category, cost]) => ({
|
|
@@ -33547,6 +33579,16 @@ var OPENCODE_ZEN_MODELS = [
|
|
|
33547
33579
|
contextLength: 1050000,
|
|
33548
33580
|
cost
|
|
33549
33581
|
})),
|
|
33582
|
+
{
|
|
33583
|
+
id: "claude-opus-5-5",
|
|
33584
|
+
name: "Claude Opus 5.5",
|
|
33585
|
+
description: "Claude model for agentic coding with always-on adaptive thinking.",
|
|
33586
|
+
category: "reasoning",
|
|
33587
|
+
provider: "opencode-zen",
|
|
33588
|
+
zenApiType: "anthropic",
|
|
33589
|
+
contextLength: 1e6,
|
|
33590
|
+
cost: "premium"
|
|
33591
|
+
},
|
|
33550
33592
|
{
|
|
33551
33593
|
id: "claude-sonnet-5",
|
|
33552
33594
|
name: "Claude Sonnet 5",
|
|
@@ -33612,7 +33654,10 @@ function getProviderModels(provider) {
|
|
|
33612
33654
|
}
|
|
33613
33655
|
}
|
|
33614
33656
|
function getConfiguredModel(config) {
|
|
33615
|
-
return getProviderModels(config.provider).find((model) => model.id === config.defaultModel);
|
|
33657
|
+
return getProviderModels(config.provider).find((model) => model.id === config.defaultModel && !model.disabled);
|
|
33658
|
+
}
|
|
33659
|
+
function getProviderDefaultModel(provider) {
|
|
33660
|
+
return getProviderModels(provider).find((model) => !model.disabled);
|
|
33616
33661
|
}
|
|
33617
33662
|
function getProviderDisplayName(provider) {
|
|
33618
33663
|
switch (provider) {
|
|
@@ -34035,7 +34080,7 @@ var DEFAULT_CONFIG = {
|
|
|
34035
34080
|
workersAiApiKey: "",
|
|
34036
34081
|
cloudflareAccountId: "",
|
|
34037
34082
|
cloudflareAiGatewayId: "default",
|
|
34038
|
-
defaultModel: "
|
|
34083
|
+
defaultModel: getProviderDefaultModel("opencode-zen").id,
|
|
34039
34084
|
thinkingLevel: "low",
|
|
34040
34085
|
safetyLevel: "moderate",
|
|
34041
34086
|
dryRunByDefault: false,
|
|
@@ -34066,7 +34111,18 @@ function loadConfig() {
|
|
|
34066
34111
|
try {
|
|
34067
34112
|
const data = readFileSync(CONFIG_FILE, "utf-8");
|
|
34068
34113
|
const loaded = JSON.parse(data);
|
|
34069
|
-
|
|
34114
|
+
const config = { ...DEFAULT_CONFIG, ...loaded };
|
|
34115
|
+
const isCustom = config.customModels?.some((model) => model.id === config.defaultModel);
|
|
34116
|
+
if (config.provider !== "custom" && !isCustom && !getConfiguredModel(config)) {
|
|
34117
|
+
const fallback = getProviderDefaultModel(config.provider);
|
|
34118
|
+
if (fallback) {
|
|
34119
|
+
config.defaultModel = fallback.id;
|
|
34120
|
+
try {
|
|
34121
|
+
writeFileSync3(CONFIG_FILE, JSON.stringify({ ...loaded, defaultModel: fallback.id }, null, 2));
|
|
34122
|
+
} catch {}
|
|
34123
|
+
}
|
|
34124
|
+
}
|
|
34125
|
+
return config;
|
|
34070
34126
|
} catch {
|
|
34071
34127
|
return { ...DEFAULT_CONFIG };
|
|
34072
34128
|
}
|
|
@@ -74826,6 +74882,9 @@ function buildOpenAICompatibleThinkingOptions(modelId, thinkingLevel) {
|
|
|
74826
74882
|
};
|
|
74827
74883
|
}
|
|
74828
74884
|
function buildAiSdkProviderOptions(modelId, thinkingLevel, providerOptionsName) {
|
|
74885
|
+
if (modelId === "claude-opus-5-5") {
|
|
74886
|
+
return { anthropic: { effort: thinkingLevel === "off" ? "low" : thinkingLevel } };
|
|
74887
|
+
}
|
|
74829
74888
|
if (thinkingLevel === "off" || !supportsThinkingControl(modelId)) {
|
|
74830
74889
|
return;
|
|
74831
74890
|
}
|
|
@@ -74884,6 +74943,8 @@ function buildAiSdkProviderOptions(modelId, thinkingLevel, providerOptionsName)
|
|
|
74884
74943
|
return;
|
|
74885
74944
|
}
|
|
74886
74945
|
function shouldOmitTemperature(modelId, thinkingLevel) {
|
|
74946
|
+
if (/claude-opus-5[.-]5/.test(modelId))
|
|
74947
|
+
return true;
|
|
74887
74948
|
if (modelId.includes("gpt-6"))
|
|
74888
74949
|
return true;
|
|
74889
74950
|
return thinkingLevel !== "off" && (modelId.startsWith("claude-") || modelId.includes("gpt-5"));
|
|
@@ -75623,6 +75684,9 @@ async function main() {
|
|
|
75623
75684
|
const savedModel = getConfiguredModel(config2);
|
|
75624
75685
|
if (savedModel) {
|
|
75625
75686
|
currentModel = savedModel;
|
|
75687
|
+
} else {
|
|
75688
|
+
console.error("No supported default model configured. Run msh --setup or select a custom model with msh --model <id>.");
|
|
75689
|
+
process.exit(1);
|
|
75626
75690
|
}
|
|
75627
75691
|
}
|
|
75628
75692
|
renderer = await createCliRenderer({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@austinthesing/magic-shell",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
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",
|