junecoder 1.0.6 → 1.0.7
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/package.json +1 -1
- package/tui.mjs +19 -2
package/package.json
CHANGED
package/tui.mjs
CHANGED
|
@@ -331,6 +331,16 @@ export async function startTUI(agent, opts = {}) {
|
|
|
331
331
|
// ─── First-run setup: capture API key from input box ──────────────────────────
|
|
332
332
|
let setupMode = opts.needsSetup;
|
|
333
333
|
if (setupMode) {
|
|
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);
|
|
343
|
+
pushLine("", C.dim);
|
|
334
344
|
state.status = "Paste your DeepSeek API key and press Enter (https://platform.deepseek.com/api_keys)";
|
|
335
345
|
}
|
|
336
346
|
|
|
@@ -409,10 +419,17 @@ export async function startTUI(agent, opts = {}) {
|
|
|
409
419
|
async function handleSlash(text) {
|
|
410
420
|
const cmd = text.slice(1).split(/\s+/)[0].toLowerCase();
|
|
411
421
|
switch (cmd) {
|
|
412
|
-
case "help": for (const l of ["/help /plan /auto /model /session /clear /tasks /stats /new /distill /quit"]) pushLine(l, C.dim); break;
|
|
422
|
+
case "help": for (const l of ["/help /plan /auto /key /model /session /clear /tasks /stats /new /distill /quit"]) pushLine(l, C.dim); break;
|
|
413
423
|
case "plan": agent.planMode = !agent.planMode; pushLine(" Plan mode " + (agent.planMode ? "ON" : "OFF"), C.tool); break;
|
|
414
424
|
case "auto": agent.autoApprove = !agent.autoApprove; pushLine(" Auto-approve " + (agent.autoApprove ? "ON" : "OFF"), agent.autoApprove ? C.warn : C.tool); break;
|
|
415
425
|
case "model": pushLine(" Model: " + agent.provider.model + " | Provider: " + (agent.provider.type || "?"), C.dim); break;
|
|
426
|
+
case "key": {
|
|
427
|
+
pushLine(" Current key: " + (agent.provider.apiKey ? agent.provider.apiKey.slice(0, 8) + "..." : "(none)"), C.dim);
|
|
428
|
+
pushLine(" To change, paste your new API key and press Enter.", C.tool);
|
|
429
|
+
setupMode = true;
|
|
430
|
+
state.status = "Paste your DeepSeek API key and press Enter (https://platform.deepseek.com/api_keys)";
|
|
431
|
+
break;
|
|
432
|
+
}
|
|
416
433
|
case "session": { const slots = listSlots(agent.cwd); pushLine("Sessions:", C.tool); if (slots.length === 0) pushLine(" (none)", C.dim); else for (const s of slots) pushLine(" " + s.label, C.dim); break; }
|
|
417
434
|
case "clear": archiveCurrent(agent.cwd); agent.history = []; state.lines = []; state.streaming = ""; state.reasoning = ""; state.tasks = []; state.scroll = 0; pushLine("Cleared (archived).", C.warn); break;
|
|
418
435
|
case "new": archiveCurrent(agent.cwd); agent.history = []; state.lines = []; state.streaming = ""; state.reasoning = ""; state.toolStreams = {}; state.tasks = []; state.scroll = 0; state.tokens = { prompt: 0, completion: 0 }; pushLine("New session.", C.tool); break;
|
|
@@ -467,7 +484,7 @@ export async function startTUI(agent, opts = {}) {
|
|
|
467
484
|
if (restored.tasks) { state.tasks = restored.tasks; agent.tasks = restored.tasks; }
|
|
468
485
|
if (restored.planMode !== undefined) agent.planMode = restored.planMode;
|
|
469
486
|
state.status = "Session restored";
|
|
470
|
-
} else {
|
|
487
|
+
} else if (!setupMode) {
|
|
471
488
|
pushLine("", C.dim);
|
|
472
489
|
pushLine("JuneCoder TUI \u2014 " + (agent.provider.model || ""), ansi.bold + C.tool);
|
|
473
490
|
pushLine("Type /help for commands, Ctrl+C to quit.", C.dim);
|