junecoder 1.0.15 → 1.0.17

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/package.json +1 -1
  2. package/session.mjs +0 -1
  3. package/tui.mjs +4 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "junecoder",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "description": "Zero Npm Dependencies Agent Framework",
5
5
  "main": "agent.mjs",
6
6
  "type": "module",
package/session.mjs CHANGED
@@ -33,7 +33,6 @@ export function saveSession(agent, displayLines) {
33
33
  history: agent.history,
34
34
  displayLines: displayLines || [],
35
35
  planMode: agent.planMode,
36
- tasks: agent.tasks,
37
36
  goal: agent.goal,
38
37
  savedAt: Date.now(),
39
38
  };
package/tui.mjs CHANGED
@@ -485,8 +485,8 @@ export async function startTUI(agent, opts = {}) {
485
485
  break;
486
486
  }
487
487
  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; }
488
- case "clear": archiveCurrent(agent.cwd); agent.history = []; state.lines = []; state.streaming = ""; state.reasoning = ""; state.tasks = []; state.scroll = 0; pushLine("Cleared (archived).", C.warn); break;
489
- 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;
488
+ case "clear": archiveCurrent(agent.cwd); agent.history = []; state.lines = []; state.streaming = ""; state.reasoning = ""; state.tasks = []; agent.tasks = []; state.scroll = 0; pushLine("Cleared (archived).", C.warn); break;
489
+ case "new": archiveCurrent(agent.cwd); agent.history = []; state.lines = []; state.streaming = ""; state.reasoning = ""; state.toolStreams = {}; state.tasks = []; agent.tasks = []; state.scroll = 0; state.tokens = { prompt: 0, completion: 0 }; pushLine("New session.", C.tool); break;
490
490
  case "tasks": if (state.tasks.length === 0) pushLine("No tasks.", C.dim); else for (const t of state.tasks) pushLine(" " + (t.status === "done" ? "\u2713" : t.status === "in_progress" ? "\u25b6" : "\u25cb") + " " + t.title, C.dim); break;
491
491
  case "stats": pushLine("Tokens: \u2191" + state.tokens.prompt + " \u2193" + state.tokens.completion + " | History: " + agent.history.length + " msgs (~" + estimateTokens(agent.history) + " t) | Lines: " + state.lines.length, C.dim); break;
492
492
  case "quit": case "exit": cleanup(); process.exit(0); return;
@@ -535,7 +535,8 @@ export async function startTUI(agent, opts = {}) {
535
535
  if (typeof raw === "string") state.lines.push({ text: raw, color: C.text });
536
536
  else if (raw && typeof raw.text === "string") state.lines.push(raw);
537
537
  }
538
- if (restored.tasks) { state.tasks = restored.tasks; agent.tasks = restored.tasks; }
538
+ if (restored.history) agent.history = restored.history;
539
+ if (restored.goal) agent.goal = restored.goal;
539
540
  if (restored.planMode !== undefined) agent.planMode = restored.planMode;
540
541
  state.status = "Session restored";
541
542
  } else if (!setupMode) {