archondev 2.19.4 → 2.19.5
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/{chunk-3UOMLERV.js → chunk-KDWIKBM2.js} +1 -1
- package/dist/{chunk-K3XN7PN6.js → chunk-KETUHDUE.js} +114 -15
- package/dist/{chunk-IKMCIWK3.js → chunk-OTODLPY4.js} +177 -104
- package/dist/{chunk-C4HVI2NJ.js → chunk-W6TYXCZA.js} +1 -1
- package/dist/{chunk-HQBF3VTN.js → chunk-X5ZZCJBQ.js} +52 -11
- package/dist/{execute-JAHXFYXL.js → execute-DBNVIJ3P.js} +3 -2
- package/dist/index.js +243 -79
- package/dist/{list-Q4HLHQJI.js → list-SKRHIZ5T.js} +3 -2
- package/dist/{parallel-QLKYSZZ3.js → parallel-KRBYFJ4O.js} +3 -2
- package/dist/{plan-7M27X3OD.js → plan-7SCZH7EA.js} +2 -1
- package/dist/{preferences-SFXRVXT3.js → preferences-YOSAIHGM.js} +3 -1
- package/package.json +1 -1
|
@@ -763,6 +763,7 @@ async function interactiveSettings() {
|
|
|
763
763
|
}
|
|
764
764
|
await displayCurrentSettings(profile, usage, providers);
|
|
765
765
|
console.log(chalk.bold("\nOptions:\n"));
|
|
766
|
+
console.log(chalk.dim("Type naturally (recommended) or use a shortcut:\n"));
|
|
766
767
|
console.log(` ${chalk.cyan("1")}) Change billing mode (BYOK / Credits)`);
|
|
767
768
|
console.log(` ${chalk.cyan("2")}) Set default models`);
|
|
768
769
|
console.log(` ${chalk.cyan("x")}) Smart Routing (cost optimization)`);
|
|
@@ -771,7 +772,8 @@ async function interactiveSettings() {
|
|
|
771
772
|
console.log(` ${chalk.cyan("5")}) Reset to defaults`);
|
|
772
773
|
console.log(` ${chalk.cyan("b")}) Back to project`);
|
|
773
774
|
console.log();
|
|
774
|
-
const
|
|
775
|
+
const rawChoice = await prompt("What would you like to do?");
|
|
776
|
+
const choice = resolveSettingsChoice(rawChoice);
|
|
775
777
|
switch (choice.toLowerCase()) {
|
|
776
778
|
case "1":
|
|
777
779
|
await changeBillingMode(profile.tier);
|
|
@@ -801,7 +803,7 @@ async function interactiveSettings() {
|
|
|
801
803
|
console.log(chalk.dim("\nReturning to project...\n"));
|
|
802
804
|
return;
|
|
803
805
|
default:
|
|
804
|
-
console.log(chalk.yellow("
|
|
806
|
+
console.log(chalk.yellow("I did not catch that. Try again or describe what you need."));
|
|
805
807
|
await interactiveSettings();
|
|
806
808
|
}
|
|
807
809
|
}
|
|
@@ -843,7 +845,8 @@ async function changeBillingMode(currentTier) {
|
|
|
843
845
|
console.log(chalk.dim(" 10% service fee applied.\n"));
|
|
844
846
|
console.log(` ${chalk.cyan("b")}) Back`);
|
|
845
847
|
console.log();
|
|
846
|
-
const
|
|
848
|
+
const rawChoice = await prompt("How do you want to pay?");
|
|
849
|
+
const choice = resolveBillingChoice(rawChoice);
|
|
847
850
|
if (choice === "1" && !byokSelected) {
|
|
848
851
|
const spinner = ora("Switching to BYOK...").start();
|
|
849
852
|
const result = await updateUserTier("BYOK");
|
|
@@ -861,9 +864,11 @@ async function changeBillingMode(currentTier) {
|
|
|
861
864
|
} else {
|
|
862
865
|
spinner.fail(chalk.red(result.error ?? "Failed to update"));
|
|
863
866
|
}
|
|
864
|
-
} else if (choice
|
|
867
|
+
} else if (choice !== "b") {
|
|
865
868
|
if (choice === "1" && byokSelected || choice === "2" && creditsSelected) {
|
|
866
869
|
console.log(chalk.dim("Already using this billing mode."));
|
|
870
|
+
} else {
|
|
871
|
+
console.log(chalk.yellow("I did not catch that."));
|
|
867
872
|
}
|
|
868
873
|
}
|
|
869
874
|
}
|
|
@@ -877,7 +882,8 @@ async function setDefaultModelsMenu(profile, providers) {
|
|
|
877
882
|
console.log();
|
|
878
883
|
console.log(` ${chalk.cyan("b")}) Back`);
|
|
879
884
|
console.log();
|
|
880
|
-
const
|
|
885
|
+
const rawChoice = await prompt("Which default model should change?");
|
|
886
|
+
const choice = resolveDefaultModelSlotChoice(rawChoice);
|
|
881
887
|
const keyMap = {
|
|
882
888
|
"1": "fast-model",
|
|
883
889
|
"2": "thinking-model",
|
|
@@ -889,7 +895,7 @@ async function setDefaultModelsMenu(profile, providers) {
|
|
|
889
895
|
}
|
|
890
896
|
const prefKey = keyMap[choice];
|
|
891
897
|
if (!prefKey) {
|
|
892
|
-
console.log(chalk.yellow("
|
|
898
|
+
console.log(chalk.yellow("I did not catch that."));
|
|
893
899
|
return;
|
|
894
900
|
}
|
|
895
901
|
const models = getAllActiveModels();
|
|
@@ -906,8 +912,8 @@ async function setDefaultModelsMenu(profile, providers) {
|
|
|
906
912
|
console.log(` ${chalk.cyan(String(i + 1))}) ${m.modelName} ${categoryLabel}`);
|
|
907
913
|
});
|
|
908
914
|
console.log();
|
|
909
|
-
const modelChoice = await prompt("
|
|
910
|
-
const modelIndex =
|
|
915
|
+
const modelChoice = await prompt("Which model do you want? (number or model name)");
|
|
916
|
+
const modelIndex = resolveModelChoice(modelChoice, availableModels);
|
|
911
917
|
if (modelIndex >= 0 && modelIndex < availableModels.length) {
|
|
912
918
|
const selectedModel = availableModels[modelIndex];
|
|
913
919
|
if (selectedModel) {
|
|
@@ -940,7 +946,8 @@ async function setSmartRoutingMenu(profile, providers) {
|
|
|
940
946
|
console.log(` ${chalk.cyan("5")}) View operations by tier`);
|
|
941
947
|
console.log(` ${chalk.cyan("b")}) Back`);
|
|
942
948
|
console.log();
|
|
943
|
-
const
|
|
949
|
+
const rawChoice = await prompt("What would you like to change?");
|
|
950
|
+
const choice = resolveSmartRoutingChoice(rawChoice);
|
|
944
951
|
if (choice.toLowerCase() === "b") {
|
|
945
952
|
return;
|
|
946
953
|
}
|
|
@@ -963,7 +970,8 @@ async function setSmartRoutingMenu(profile, providers) {
|
|
|
963
970
|
console.log(` ${chalk.cyan("3")}) google`);
|
|
964
971
|
console.log(` ${chalk.cyan("0")}) Clear preference (auto)`);
|
|
965
972
|
console.log();
|
|
966
|
-
const
|
|
973
|
+
const provChoiceRaw = await prompt("Which provider should be preferred?");
|
|
974
|
+
const provChoice = resolveProviderChoice(provChoiceRaw);
|
|
967
975
|
const providerMap = {
|
|
968
976
|
"0": null,
|
|
969
977
|
"1": "anthropic",
|
|
@@ -997,12 +1005,12 @@ Select model for ${selectedTier.tier} tier:
|
|
|
997
1005
|
console.log(` ${chalk.cyan(String(i + 1))}) ${m.modelName} ${categoryLabel}`);
|
|
998
1006
|
});
|
|
999
1007
|
console.log();
|
|
1000
|
-
const modelChoice = await prompt("
|
|
1008
|
+
const modelChoice = await prompt("Which model do you want for this tier? (number or model name)");
|
|
1001
1009
|
if (modelChoice === "0") {
|
|
1002
1010
|
await setTierPreference(selectedTier.key, null);
|
|
1003
1011
|
return;
|
|
1004
1012
|
}
|
|
1005
|
-
const modelIndex =
|
|
1013
|
+
const modelIndex = resolveModelChoice(modelChoice, availableModels);
|
|
1006
1014
|
if (modelIndex >= 0 && modelIndex < availableModels.length) {
|
|
1007
1015
|
const selectedModel = availableModels[modelIndex];
|
|
1008
1016
|
if (selectedModel) {
|
|
@@ -1057,7 +1065,8 @@ async function manageApiKeys() {
|
|
|
1057
1065
|
console.log(` ${chalk.cyan("4")}) Remove a key`);
|
|
1058
1066
|
console.log(` ${chalk.cyan("b")}) Back`);
|
|
1059
1067
|
console.log();
|
|
1060
|
-
const
|
|
1068
|
+
const rawChoice = await prompt("What do you want to do with API keys?");
|
|
1069
|
+
const choice = resolveApiKeysChoice(rawChoice);
|
|
1061
1070
|
const providerMap = {
|
|
1062
1071
|
"1": "anthropic",
|
|
1063
1072
|
"2": "openai",
|
|
@@ -1073,8 +1082,8 @@ async function manageApiKeys() {
|
|
|
1073
1082
|
}
|
|
1074
1083
|
console.log("\nWhich provider to remove?");
|
|
1075
1084
|
providers.forEach((p, i) => console.log(` ${chalk.cyan(String(i + 1))}) ${p}`));
|
|
1076
|
-
const removeChoice = await prompt("
|
|
1077
|
-
const removeIndex =
|
|
1085
|
+
const removeChoice = await prompt("Which provider key should be removed?");
|
|
1086
|
+
const removeIndex = resolveProviderIndexChoice(removeChoice, providers);
|
|
1078
1087
|
if (removeIndex >= 0 && removeIndex < providers.length) {
|
|
1079
1088
|
const providerToRemove = providers[removeIndex];
|
|
1080
1089
|
if (providerToRemove) {
|
|
@@ -1088,8 +1097,97 @@ async function manageApiKeys() {
|
|
|
1088
1097
|
if (provider) {
|
|
1089
1098
|
const { addKey } = await import("./keys-T2VPHE7Z.js");
|
|
1090
1099
|
await addKey(provider);
|
|
1100
|
+
} else if (choice !== "b") {
|
|
1101
|
+
console.log(chalk.yellow("I did not catch that."));
|
|
1091
1102
|
}
|
|
1092
1103
|
}
|
|
1104
|
+
function resolveSettingsChoice(input) {
|
|
1105
|
+
const normalized = input.trim().toLowerCase();
|
|
1106
|
+
if (!normalized) return "";
|
|
1107
|
+
if (normalized === "1" || normalized.includes("billing") || normalized.includes("tier") || normalized.includes("pay")) return "1";
|
|
1108
|
+
if (normalized === "2" || normalized.includes("default model") || normalized.includes("model")) return "2";
|
|
1109
|
+
if (normalized === "x" || normalized === "smart" || normalized.includes("routing") || normalized.includes("cost optimization")) return "x";
|
|
1110
|
+
if (normalized === "3" || normalized.includes("key")) return "3";
|
|
1111
|
+
if (normalized === "4" || normalized.includes("usage") || normalized.includes("spend") || normalized.includes("cost details")) return "4";
|
|
1112
|
+
if (normalized === "5" || normalized.includes("reset") || normalized.includes("defaults")) return "5";
|
|
1113
|
+
if (normalized === "b" || normalized.includes("back") || normalized.includes("return")) return "b";
|
|
1114
|
+
return normalized;
|
|
1115
|
+
}
|
|
1116
|
+
function resolveBillingChoice(input) {
|
|
1117
|
+
const normalized = input.trim().toLowerCase();
|
|
1118
|
+
if (!normalized) return "";
|
|
1119
|
+
if (normalized === "1" || normalized.includes("byok") || normalized.includes("own key")) return "1";
|
|
1120
|
+
if (normalized === "2" || normalized.includes("credit") || normalized.includes("managed")) return "2";
|
|
1121
|
+
if (normalized === "b" || normalized.includes("back")) return "b";
|
|
1122
|
+
return normalized;
|
|
1123
|
+
}
|
|
1124
|
+
function resolveDefaultModelSlotChoice(input) {
|
|
1125
|
+
const normalized = input.trim().toLowerCase();
|
|
1126
|
+
if (!normalized) return "";
|
|
1127
|
+
if (normalized === "1" || normalized.includes("fast")) return "1";
|
|
1128
|
+
if (normalized === "2" || normalized.includes("thinking")) return "2";
|
|
1129
|
+
if (normalized === "3" || normalized.includes("primary")) return "3";
|
|
1130
|
+
if (normalized === "4" || normalized.includes("secondary")) return "4";
|
|
1131
|
+
if (normalized === "b" || normalized.includes("back")) return "b";
|
|
1132
|
+
return normalized;
|
|
1133
|
+
}
|
|
1134
|
+
function resolveModelChoice(choice, models) {
|
|
1135
|
+
const normalized = choice.trim().toLowerCase();
|
|
1136
|
+
const numeric = parseInt(normalized, 10);
|
|
1137
|
+
if (!Number.isNaN(numeric)) {
|
|
1138
|
+
return numeric - 1;
|
|
1139
|
+
}
|
|
1140
|
+
const idx = models.findIndex(
|
|
1141
|
+
(m) => m.modelId.toLowerCase() === normalized || m.modelName.toLowerCase() === normalized || m.modelName.toLowerCase().includes(normalized) || normalized.includes(m.modelName.toLowerCase())
|
|
1142
|
+
);
|
|
1143
|
+
return idx;
|
|
1144
|
+
}
|
|
1145
|
+
function resolveSmartRoutingChoice(input) {
|
|
1146
|
+
const normalized = input.trim().toLowerCase();
|
|
1147
|
+
if (!normalized) return "";
|
|
1148
|
+
if (normalized === "1" || normalized.includes("planning")) return "1";
|
|
1149
|
+
if (normalized === "2" || normalized.includes("reasoning")) return "2";
|
|
1150
|
+
if (normalized === "3" || normalized.includes("execution")) return "3";
|
|
1151
|
+
if (normalized === "4" || normalized.includes("provider")) return "4";
|
|
1152
|
+
if (normalized === "5" || normalized.includes("operation")) return "5";
|
|
1153
|
+
if (normalized === "b" || normalized.includes("back")) return "b";
|
|
1154
|
+
return normalized;
|
|
1155
|
+
}
|
|
1156
|
+
function resolveProviderChoice(input) {
|
|
1157
|
+
const normalized = input.trim().toLowerCase();
|
|
1158
|
+
if (!normalized) return "";
|
|
1159
|
+
if (normalized === "0" || normalized.includes("auto") || normalized.includes("clear")) return "0";
|
|
1160
|
+
if (normalized === "1" || normalized.includes("anthropic")) return "1";
|
|
1161
|
+
if (normalized === "2" || normalized.includes("openai")) return "2";
|
|
1162
|
+
if (normalized === "3" || normalized.includes("google") || normalized.includes("gemini")) return "3";
|
|
1163
|
+
return normalized;
|
|
1164
|
+
}
|
|
1165
|
+
function resolveApiKeysChoice(input) {
|
|
1166
|
+
const normalized = input.trim().toLowerCase();
|
|
1167
|
+
if (!normalized) return "";
|
|
1168
|
+
if (normalized === "1" || normalized.includes("add") && normalized.includes("anthropic")) return "1";
|
|
1169
|
+
if (normalized === "2" || normalized.includes("add") && normalized.includes("openai")) return "2";
|
|
1170
|
+
if (normalized === "3" || normalized.includes("add") && (normalized.includes("google") || normalized.includes("gemini"))) return "3";
|
|
1171
|
+
if (normalized === "4" || normalized.includes("remove") || normalized.includes("delete")) return "4";
|
|
1172
|
+
if (normalized === "b" || normalized.includes("back")) return "b";
|
|
1173
|
+
return normalized;
|
|
1174
|
+
}
|
|
1175
|
+
function resolveProviderIndexChoice(choice, providers) {
|
|
1176
|
+
const normalized = choice.trim().toLowerCase();
|
|
1177
|
+
const numeric = parseInt(normalized, 10);
|
|
1178
|
+
if (!Number.isNaN(numeric)) return numeric - 1;
|
|
1179
|
+
return providers.findIndex((p) => normalized.includes(p));
|
|
1180
|
+
}
|
|
1181
|
+
var __preferencesChoiceHelpers = {
|
|
1182
|
+
resolveSettingsChoice,
|
|
1183
|
+
resolveBillingChoice,
|
|
1184
|
+
resolveDefaultModelSlotChoice,
|
|
1185
|
+
resolveSmartRoutingChoice,
|
|
1186
|
+
resolveProviderChoice,
|
|
1187
|
+
resolveApiKeysChoice,
|
|
1188
|
+
resolveProviderIndexChoice,
|
|
1189
|
+
resolveModelChoice
|
|
1190
|
+
};
|
|
1093
1191
|
async function showUsageDetails() {
|
|
1094
1192
|
console.log(chalk.bold("\n-- Usage Details --\n"));
|
|
1095
1193
|
const spinner = ora("Loading usage data...").start();
|
|
@@ -1236,5 +1334,6 @@ export {
|
|
|
1236
1334
|
resetPreferences,
|
|
1237
1335
|
listModels,
|
|
1238
1336
|
interactiveSettings,
|
|
1337
|
+
__preferencesChoiceHelpers,
|
|
1239
1338
|
showUsageDetails
|
|
1240
1339
|
};
|