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.
Files changed (3) hide show
  1. package/cli.js +7 -2
  2. package/package.json +1 -1
  3. 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
- const apiKey = config.provider.apiKey || process.env.DEEPSEEK_API_KEY;
155
+ let apiKey = config.provider.apiKey || process.env.DEEPSEEK_API_KEY || '';
156
156
 
157
- config.provider.apiKey = apiKey || '';
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "junecoder",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Zero Npm Dependencies Agent Framework",
5
5
  "main": "agent.mjs",
6
6
  "type": "module",
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("\u250c\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\u2510", C.assistant);
336
- pushLine("\u2502 Welcome to JuneCoder! \u2502", C.assistant);
337
- pushLine("\u2502 \u2502", C.assistant);
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("Warning: API key doesn't start with 'sk-'. It may not work.", C.warn);
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');