junecoder 1.0.7 → 1.0.8
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 +6 -1
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
|
@@ -363,7 +363,12 @@ export async function startTUI(agent, opts = {}) {
|
|
|
363
363
|
}
|
|
364
364
|
|
|
365
365
|
if (!trimmed.startsWith("sk-")) {
|
|
366
|
-
pushLine("
|
|
366
|
+
pushLine("Invalid key — DeepSeek API keys must start with 'sk-'. Try again:", C.error);
|
|
367
|
+
pushLine("", C.dim);
|
|
368
|
+
setupMode = true; // stay in setup mode
|
|
369
|
+
state.status = "Paste your DeepSeek API key and press Enter (https://platform.deepseek.com/api_keys)";
|
|
370
|
+
render();
|
|
371
|
+
return;
|
|
367
372
|
}
|
|
368
373
|
|
|
369
374
|
const configDir = join(homedir(), '.junecoder');
|