junecoder 1.0.7 → 1.0.9
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/cli.js +7 -2
- package/package.json +1 -1
- package/tui.mjs +9 -9
package/cli.js
CHANGED
|
@@ -152,9 +152,14 @@ if (existsSync(targetDir) && statSync(targetDir).isDirectory()) {
|
|
|
152
152
|
|
|
153
153
|
// Load config and API key
|
|
154
154
|
const config = loadConfig();
|
|
155
|
-
|
|
155
|
+
let apiKey = config.provider.apiKey || process.env.DEEPSEEK_API_KEY || '';
|
|
156
156
|
|
|
157
|
-
|
|
157
|
+
// Only treat as valid if it starts with sk- (DeepSeek key format)
|
|
158
|
+
if (apiKey && !apiKey.startsWith('sk-')) {
|
|
159
|
+
apiKey = ''; // invalid format, treat as not configured
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
config.provider.apiKey = apiKey;
|
|
158
163
|
|
|
159
164
|
// Create Agent instance with target cwd
|
|
160
165
|
const agent = createAgent({
|
package/package.json
CHANGED
package/tui.mjs
CHANGED
|
@@ -332,14 +332,9 @@ export async function startTUI(agent, opts = {}) {
|
|
|
332
332
|
let setupMode = opts.needsSetup;
|
|
333
333
|
if (setupMode) {
|
|
334
334
|
pushLine("", C.dim);
|
|
335
|
-
pushLine("
|
|
336
|
-
pushLine("
|
|
337
|
-
pushLine("
|
|
338
|
-
pushLine("\u2502 Before you start, you need a DeepSeek API key. \u2502", C.assistant);
|
|
339
|
-
pushLine("\u2502 Get one at: https://platform.deepseek.com/api_keys \u2502", C.assistant);
|
|
340
|
-
pushLine("\u2502 \u2502", C.assistant);
|
|
341
|
-
pushLine("\u2502 Paste your key below and press Enter. \u2502", C.assistant);
|
|
342
|
-
pushLine("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518", C.assistant);
|
|
335
|
+
pushLine("Welcome to JuneCoder!", ansi.bold + C.assistant);
|
|
336
|
+
pushLine("Before you start, you need a DeepSeek API key.", C.text);
|
|
337
|
+
pushLine("Get one at: https://platform.deepseek.com/api_keys", C.dim);
|
|
343
338
|
pushLine("", C.dim);
|
|
344
339
|
state.status = "Paste your DeepSeek API key and press Enter (https://platform.deepseek.com/api_keys)";
|
|
345
340
|
}
|
|
@@ -363,7 +358,12 @@ export async function startTUI(agent, opts = {}) {
|
|
|
363
358
|
}
|
|
364
359
|
|
|
365
360
|
if (!trimmed.startsWith("sk-")) {
|
|
366
|
-
pushLine("
|
|
361
|
+
pushLine("Invalid key — DeepSeek API keys must start with 'sk-'. Try again:", C.error);
|
|
362
|
+
pushLine("", C.dim);
|
|
363
|
+
setupMode = true; // stay in setup mode
|
|
364
|
+
state.status = "Paste your DeepSeek API key and press Enter (https://platform.deepseek.com/api_keys)";
|
|
365
|
+
render();
|
|
366
|
+
return;
|
|
367
367
|
}
|
|
368
368
|
|
|
369
369
|
const configDir = join(homedir(), '.junecoder');
|