careervivid 1.12.9 → 1.12.12
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configurator.d.ts","sourceRoot":"","sources":["../../../src/commands/agent/configurator.ts"],"names":[],"mappings":"AAEA,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI3E,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAKpD,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;GAyBrB,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;GA+BtB,CAAC;AAEF,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAsEpD;AAED,wBAAsB,mBAAmB,CAAC,OAAO,GAAE,GAAQ,GAAG,OAAO,CAAC;IACpE,gBAAgB,EAAE,WAAW,CAAC;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC,
|
|
1
|
+
{"version":3,"file":"configurator.d.ts","sourceRoot":"","sources":["../../../src/commands/agent/configurator.ts"],"names":[],"mappings":"AAEA,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI3E,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAKpD,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;GAyBrB,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;GA+BtB,CAAC;AAEF,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAsEpD;AAED,wBAAsB,mBAAmB,CAAC,OAAO,GAAE,GAAQ,GAAG,OAAO,CAAC;IACpE,gBAAgB,EAAE,WAAW,CAAC;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC,CA6HD"}
|
|
@@ -149,6 +149,9 @@ export async function promptForAgentModel(options = {}) {
|
|
|
149
149
|
})),
|
|
150
150
|
});
|
|
151
151
|
const picked = modelAnswer.model;
|
|
152
|
+
if (!picked) {
|
|
153
|
+
process.exit(0);
|
|
154
|
+
}
|
|
152
155
|
let selectedProvider;
|
|
153
156
|
let selectedModel;
|
|
154
157
|
let thinkingBudget;
|
|
@@ -174,6 +177,45 @@ export async function promptForAgentModel(options = {}) {
|
|
|
174
177
|
});
|
|
175
178
|
apiKey = keyAnswer.key.trim();
|
|
176
179
|
}
|
|
180
|
+
if (!apiKey) {
|
|
181
|
+
apiKey = savedKey; // Keep existing api key fallback
|
|
182
|
+
}
|
|
183
|
+
// Attempt to automatically fetch and display Free OpenRouter models that support tools
|
|
184
|
+
if (selectedProvider === "openrouter") {
|
|
185
|
+
try {
|
|
186
|
+
console.log(chalk.dim(" Fetching 100% free OpenRouter models with tool support..."));
|
|
187
|
+
// Using global fetch (available in Node 18+)
|
|
188
|
+
const res = await fetch("https://openrouter.ai/api/v1/models");
|
|
189
|
+
if (res.ok) {
|
|
190
|
+
const json = await res.json();
|
|
191
|
+
const freeToolModels = json.data
|
|
192
|
+
.filter((m) => m.pricing?.prompt === "0" &&
|
|
193
|
+
m.pricing?.completion === "0" &&
|
|
194
|
+
m.supported_parameters?.includes("tools"))
|
|
195
|
+
.map((m) => m.id);
|
|
196
|
+
if (freeToolModels.length > 0) {
|
|
197
|
+
const customChoice = "__custom__";
|
|
198
|
+
const orAnswer = await prompt({
|
|
199
|
+
type: "select",
|
|
200
|
+
name: "or_model",
|
|
201
|
+
message: "Select a free tool-compatible model:",
|
|
202
|
+
// @ts-ignore
|
|
203
|
+
limit: 15,
|
|
204
|
+
choices: [
|
|
205
|
+
{ name: customChoice, message: "✏️ Type a custom/paid model name instead..." },
|
|
206
|
+
...freeToolModels.map((id) => ({ name: id, message: `🤖 ${id}` })),
|
|
207
|
+
],
|
|
208
|
+
});
|
|
209
|
+
if (orAnswer.or_model !== customChoice) {
|
|
210
|
+
return { selectedProvider, selectedModel: orAnswer.or_model, thinkingBudget: 0, apiKey };
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
catch (err) {
|
|
216
|
+
console.log(chalk.yellow(" Could not fetch models. Falling back to manual entry."));
|
|
217
|
+
}
|
|
218
|
+
}
|
|
177
219
|
// Pre-fill with the saved model when provider matches, otherwise use sensible defaults
|
|
178
220
|
const defaultModel = savedCfg.llmProvider === selectedProvider && savedCfg.llmModel
|
|
179
221
|
? savedCfg.llmModel
|
|
@@ -183,7 +225,7 @@ export async function promptForAgentModel(options = {}) {
|
|
|
183
225
|
? "claude-opus-4-5"
|
|
184
226
|
: selectedProvider === "gemini"
|
|
185
227
|
? "gemini-2.5-flash"
|
|
186
|
-
: "
|
|
228
|
+
: "openai/gpt-oss-120b:free"; // Stable OpenRouter tool-calling free model
|
|
187
229
|
const modelAnswer2 = await prompt({
|
|
188
230
|
type: "input",
|
|
189
231
|
name: "model",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAwK3D"}
|
package/dist/commands/login.js
CHANGED
|
@@ -11,7 +11,7 @@ import { createServer } from "http";
|
|
|
11
11
|
import chalk from "chalk";
|
|
12
12
|
import ora from "ora";
|
|
13
13
|
import boxen from "boxen";
|
|
14
|
-
import { saveConfig } from "../config.js";
|
|
14
|
+
import { saveConfig, loadConfig } from "../config.js";
|
|
15
15
|
import { verifyKey, isApiError } from "../api.js";
|
|
16
16
|
import { COLORS } from "../branding.js";
|
|
17
17
|
const TIMEOUT_MS = 120_000; // 2 minutes
|
|
@@ -110,8 +110,10 @@ export function registerLoginCommand(program) {
|
|
|
110
110
|
console.error(`\n ${chalk.red("✖")} ${chalk.bold.red("Login failed:")} ${result.message}\n`);
|
|
111
111
|
process.exit(1);
|
|
112
112
|
}
|
|
113
|
-
// Save the key
|
|
114
|
-
|
|
113
|
+
// Save the key while preserving other config
|
|
114
|
+
const cfg = loadConfig();
|
|
115
|
+
cfg.apiKey = apiKey;
|
|
116
|
+
saveConfig(cfg);
|
|
115
117
|
const adminBadge = result.isAdmin
|
|
116
118
|
? ` ${chalk.bgYellow.black(" ADMIN ")}`
|
|
117
119
|
: "";
|
|
@@ -144,7 +146,9 @@ export function registerLoginCommand(program) {
|
|
|
144
146
|
console.log(JSON.stringify({ success: false, error: result.message }));
|
|
145
147
|
process.exit(1);
|
|
146
148
|
}
|
|
147
|
-
|
|
149
|
+
const cfg = loadConfig();
|
|
150
|
+
cfg.apiKey = apiKey;
|
|
151
|
+
saveConfig(cfg);
|
|
148
152
|
console.log(JSON.stringify({ success: true, ...result }));
|
|
149
153
|
}
|
|
150
154
|
catch (err) {
|