careervivid 1.11.2 → 1.11.4
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":"agent.d.ts","sourceRoot":"","sources":["../../src/commands/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyFpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/commands/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyFpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,QAwMpD"}
|
package/dist/commands/agent.js
CHANGED
|
@@ -69,8 +69,9 @@ export function registerAgentCommand(program) {
|
|
|
69
69
|
.command("agent")
|
|
70
70
|
.description("Start an interactive autonomous AI agent in your terminal.")
|
|
71
71
|
.option("--coding", "Enable full coding tool suite (file I/O, shell, search).")
|
|
72
|
+
.option("--pro", "Use gemini-3.1-pro-preview with thinking mode (recommended for complex tasks).")
|
|
72
73
|
.option("--think <budget>", "Enable Gemini thinking mode with the given token budget (e.g. 8192).", parseInt)
|
|
73
|
-
.option("--verbose", "Show thinking tokens in the output (requires --think).")
|
|
74
|
+
.option("--verbose", "Show thinking tokens in the output (requires --think or --pro).")
|
|
74
75
|
.option("--project <id>", "GCP project ID for Vertex AI mode (uses gcloud ADC, no API key needed).")
|
|
75
76
|
.action(async (options) => {
|
|
76
77
|
const apiKey = getGeminiKey();
|
|
@@ -101,14 +102,38 @@ export function registerAgentCommand(program) {
|
|
|
101
102
|
tools.push(...ALL_CODING_TOOLS, PublishArticleTool, GenerateDiagramTool);
|
|
102
103
|
}
|
|
103
104
|
// ------------------------------------------------------------------
|
|
104
|
-
//
|
|
105
|
+
// Model + thinking config
|
|
105
106
|
// ------------------------------------------------------------------
|
|
106
|
-
const
|
|
107
|
+
const isPro = Boolean(options.pro);
|
|
108
|
+
// --pro and the local execution model (flash-lite) REQUIRE a personal
|
|
109
|
+
// Gemini API key. Public/Vertex-only users always fall back to 2.5-flash.
|
|
110
|
+
if (isPro && !apiKey) {
|
|
111
|
+
console.log(chalk.red("\n❌ --pro requires a personal Gemini API key."));
|
|
112
|
+
console.log("");
|
|
113
|
+
console.log(chalk.bold("The gemini-3.1-pro-preview model is only available to users"));
|
|
114
|
+
console.log(chalk.bold("who provide their own Gemini API key."));
|
|
115
|
+
console.log("");
|
|
116
|
+
console.log(chalk.cyan("To set up your API key:"));
|
|
117
|
+
console.log(chalk.yellow(" 1. Get a free key: https://aistudio.google.com/app/apikey"));
|
|
118
|
+
console.log(chalk.yellow(" 2. cv config set geminiKey YOUR_KEY"));
|
|
119
|
+
console.log(chalk.yellow(" 3. cv agent --pro"));
|
|
120
|
+
console.log();
|
|
121
|
+
process.exit(1);
|
|
122
|
+
}
|
|
123
|
+
let selectedModel = "gemini-2.5-flash"; // Public (Default) — no API key required
|
|
124
|
+
if (isPro && apiKey) {
|
|
125
|
+
selectedModel = "gemini-3.1-pro-preview"; // Local (Thinking) — requires user API key
|
|
126
|
+
}
|
|
127
|
+
else if (!isPro && apiKey) {
|
|
128
|
+
selectedModel = "gemini-3.0-flash-lite-preview"; // Local (Execution) — requires user API key
|
|
129
|
+
}
|
|
130
|
+
// --pro implies thinking; --think <N> overrides the budget
|
|
131
|
+
const thinkingBudget = options.think ?? (isPro ? 8192 : 0);
|
|
107
132
|
const includeThoughts = Boolean(options.verbose);
|
|
108
133
|
const engine = new QueryEngine({
|
|
109
134
|
apiKey: apiKey || undefined,
|
|
110
135
|
project: project || undefined,
|
|
111
|
-
model:
|
|
136
|
+
model: selectedModel,
|
|
112
137
|
systemInstruction: CODING_AGENT_SYSTEM_PROMPT,
|
|
113
138
|
tools,
|
|
114
139
|
thinkingBudget,
|
|
@@ -125,10 +150,13 @@ export function registerAgentCommand(program) {
|
|
|
125
150
|
if (options.coding) {
|
|
126
151
|
console.log(chalk.green(" ✔ Coding mode: file I/O, shell, search tools active"));
|
|
127
152
|
}
|
|
128
|
-
if (
|
|
153
|
+
if (isPro) {
|
|
154
|
+
console.log(chalk.magenta(` ✔ Pro mode: ${selectedModel} + thinking (${thinkingBudget} tokens)`));
|
|
155
|
+
}
|
|
156
|
+
else if (thinkingBudget > 0) {
|
|
129
157
|
console.log(chalk.yellow(` ✔ Thinking mode: ${thinkingBudget} token budget`));
|
|
130
158
|
}
|
|
131
|
-
console.log(chalk.gray(` Model:
|
|
159
|
+
console.log(chalk.gray(` Model: ${selectedModel}`));
|
|
132
160
|
console.log(chalk.gray(` Type 'exit' to quit.\n`));
|
|
133
161
|
// ------------------------------------------------------------------
|
|
134
162
|
// REPL
|