open-agents-ai 0.139.7 → 0.139.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.
Files changed (2) hide show
  1. package/dist/index.js +84 -36
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -35512,6 +35512,34 @@ var init_dist6 = __esm({
35512
35512
  });
35513
35513
 
35514
35514
  // packages/cli/dist/tui/oa-directory.js
35515
+ var oa_directory_exports = {};
35516
+ __export(oa_directory_exports, {
35517
+ OA_DIR: () => OA_DIR,
35518
+ buildContextRestorePrompt: () => buildContextRestorePrompt,
35519
+ deleteUsageRecord: () => deleteUsageRecord,
35520
+ discoverContextFiles: () => discoverContextFiles,
35521
+ generateProjectMap: () => generateProjectMap,
35522
+ getLastTaskSummary: () => getLastTaskSummary,
35523
+ hasOaDirectory: () => hasOaDirectory,
35524
+ initOaDirectory: () => initOaDirectory,
35525
+ loadGlobalSettings: () => loadGlobalSettings,
35526
+ loadPendingTask: () => loadPendingTask,
35527
+ loadProjectSettings: () => loadProjectSettings,
35528
+ loadRecentSessions: () => loadRecentSessions,
35529
+ loadSessionContext: () => loadSessionContext,
35530
+ loadUsageHistory: () => loadUsageHistory,
35531
+ readIndexData: () => readIndexData,
35532
+ readIndexMeta: () => readIndexMeta,
35533
+ recordUsage: () => recordUsage,
35534
+ resolveSettings: () => resolveSettings,
35535
+ saveGlobalSettings: () => saveGlobalSettings,
35536
+ savePendingTask: () => savePendingTask,
35537
+ saveProjectSettings: () => saveProjectSettings,
35538
+ saveSession: () => saveSession,
35539
+ saveSessionContext: () => saveSessionContext,
35540
+ writeIndexData: () => writeIndexData,
35541
+ writeIndexMeta: () => writeIndexMeta
35542
+ });
35515
35543
  import { existsSync as existsSync31, mkdirSync as mkdirSync11, readFileSync as readFileSync22, writeFileSync as writeFileSync12, readdirSync as readdirSync8, statSync as statSync11, unlinkSync as unlinkSync6 } from "node:fs";
35516
35544
  import { join as join47, relative as relative2, basename as basename9, extname as extname8 } from "node:path";
35517
35545
  import { homedir as homedir9 } from "node:os";
@@ -35643,6 +35671,24 @@ function readIndexMeta(repoRoot) {
35643
35671
  return null;
35644
35672
  }
35645
35673
  }
35674
+ function writeIndexMeta(repoRoot, meta) {
35675
+ const metaPath = join47(repoRoot, OA_DIR, "index", "meta.json");
35676
+ mkdirSync11(join47(repoRoot, OA_DIR, "index"), { recursive: true });
35677
+ writeFileSync12(metaPath, JSON.stringify(meta, null, 2), "utf-8");
35678
+ }
35679
+ function readIndexData(repoRoot, filename) {
35680
+ const filePath = join47(repoRoot, OA_DIR, "index", filename);
35681
+ try {
35682
+ return JSON.parse(readFileSync22(filePath, "utf-8"));
35683
+ } catch {
35684
+ return null;
35685
+ }
35686
+ }
35687
+ function writeIndexData(repoRoot, filename, data) {
35688
+ const filePath = join47(repoRoot, OA_DIR, "index", filename);
35689
+ mkdirSync11(join47(repoRoot, OA_DIR, "index"), { recursive: true });
35690
+ writeFileSync12(filePath, JSON.stringify(data, null, 2), "utf-8");
35691
+ }
35646
35692
  function generateProjectMap(repoRoot) {
35647
35693
  const sections = [];
35648
35694
  const repoName2 = basename9(repoRoot);
@@ -35774,25 +35820,24 @@ function buildContextRestorePrompt(repoRoot) {
35774
35820
  const ctx = loadSessionContext(repoRoot);
35775
35821
  if (!ctx || ctx.entries.length === 0)
35776
35822
  return null;
35777
- const lines = [
35778
- "[RESTORED SESSION CONTEXT] Previous session history for this project:",
35779
- ""
35780
- ];
35781
- const recentEntries = ctx.entries.slice(-10);
35782
- for (const entry of recentEntries) {
35783
- const status = entry.completed ? "COMPLETED" : "INCOMPLETE";
35784
- const date = new Date(entry.savedAt).toLocaleString();
35785
- lines.push(`[${status}] ${date} \u2014 ${entry.task.slice(0, 200)}`);
35786
- if (entry.summary) {
35787
- lines.push(` Summary: ${entry.summary.slice(0, 300)}`);
35788
- }
35789
- if (entry.filesModified.length > 0) {
35790
- lines.push(` Files: ${entry.filesModified.slice(0, 10).join(", ")}`);
35791
- }
35792
- lines.push("");
35793
- }
35794
- lines.push("Use this context to understand what has been done previously. Do not repeat completed work.");
35795
- return lines.join("\n");
35823
+ const recent = ctx.entries.slice(-5);
35824
+ const lines = recent.map((e) => {
35825
+ const status = e.completed ? "done" : "partial";
35826
+ const summary = e.summary ? e.summary.slice(0, 100) : e.task.slice(0, 100);
35827
+ return `[${status}] ${summary}`;
35828
+ });
35829
+ return `Previous work in this project:
35830
+ ${lines.join("\n")}
35831
+ Do not repeat completed work.`;
35832
+ }
35833
+ function getLastTaskSummary(repoRoot) {
35834
+ const ctx = loadSessionContext(repoRoot);
35835
+ if (!ctx || ctx.entries.length === 0)
35836
+ return null;
35837
+ const last = ctx.entries[ctx.entries.length - 1];
35838
+ const text = last.summary || last.task;
35839
+ const clean = text.replace(/^\[.*?\]\s*/, "").replace(/\s+/g, " ").trim();
35840
+ return clean.length > 40 ? clean.slice(0, 37) + "..." : clean;
35796
35841
  }
35797
35842
  function detectManifests(repoRoot) {
35798
35843
  const manifests = [];
@@ -56510,7 +56555,9 @@ async function startInteractive(config, repoPath) {
56510
56555
  statusBar.renderHeaderButtons();
56511
56556
  if (isResumed) {
56512
56557
  statusBar.beginContentWrite();
56513
- const resumeMsg = hasTaskToResume ? `Updated to v${version} \u2014 picking up where you left off.` : `Updated to v${version}.`;
56558
+ const { getLastTaskSummary: getLastTaskSummary2 } = (init_oa_directory(), __toCommonJS(oa_directory_exports));
56559
+ const taskSummary = hasTaskToResume ? getLastTaskSummary2(repoRoot) : null;
56560
+ const resumeMsg = taskSummary ? `v${version} \u2014 picking up: ${taskSummary}` : `Updated to v${version}.`;
56514
56561
  renderInfo(resumeMsg);
56515
56562
  statusBar.endContentWrite();
56516
56563
  }
@@ -58291,13 +58338,13 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
58291
58338
  return false;
58292
58339
  setTimeout(() => {
58293
58340
  const resumeContext = [
58294
- `[RESUMED] Original task: ${pendingTask.prompt}`,
58295
- pendingTask.progressSummary ? `Progress so far: ${pendingTask.progressSummary}` : "",
58296
- pendingTask.filesModified.length > 0 ? `Files modified before stop: ${pendingTask.filesModified.join(", ")}` : "",
58297
- `Tool calls completed before stop: ${pendingTask.toolCallCount}`,
58298
- "Continue where you left off. Do not repeat work already done."
58299
- ].filter(Boolean).join("\n\n");
58300
- writeContent(() => renderInfo(`Resuming task: ${pendingTask.prompt.slice(0, 100)}${pendingTask.prompt.length > 100 ? "..." : ""}`));
58341
+ `Continuing previous task: ${pendingTask.prompt}`,
58342
+ pendingTask.progressSummary ? `Progress: ${pendingTask.progressSummary}` : "",
58343
+ pendingTask.filesModified.length > 0 ? `Modified: ${pendingTask.filesModified.slice(0, 5).join(", ")}` : "",
58344
+ "Continue where you left off."
58345
+ ].filter(Boolean).join("\n");
58346
+ const shortPrompt = pendingTask.prompt.slice(0, 40) + (pendingTask.prompt.length > 40 ? "..." : "");
58347
+ writeContent(() => renderInfo(`Picking up: ${shortPrompt}`));
58301
58348
  rl.emit("line", resumeContext);
58302
58349
  }, 100);
58303
58350
  return true;
@@ -58534,15 +58581,14 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
58534
58581
  setTimeout(() => {
58535
58582
  const sessionCtx = buildContextRestorePrompt(repoRoot);
58536
58583
  const resumeContext = [
58537
- sessionCtx ? `[SESSION CONTEXT RESTORED]
58538
- ${sessionCtx}` : "",
58539
- `[RESUMED AFTER UPDATE] Original task: ${pendingTask.prompt}`,
58540
- pendingTask.progressSummary ? `Progress so far: ${pendingTask.progressSummary}` : "",
58541
- pendingTask.filesModified.length > 0 ? `Files modified before update: ${pendingTask.filesModified.join(", ")}` : "",
58542
- `Tool calls completed before update: ${pendingTask.toolCallCount}`,
58543
- "Continue where you left off. Do not repeat work already done."
58544
- ].filter(Boolean).join("\n\n");
58545
- writeContent(() => renderInfo(`Resuming task: ${pendingTask.prompt.slice(0, 100)}${pendingTask.prompt.length > 100 ? "..." : ""}`));
58584
+ sessionCtx || "",
58585
+ `Continuing task after update: ${pendingTask.prompt}`,
58586
+ pendingTask.progressSummary ? `Progress: ${pendingTask.progressSummary}` : "",
58587
+ pendingTask.filesModified.length > 0 ? `Modified: ${pendingTask.filesModified.slice(0, 5).join(", ")}` : "",
58588
+ "Continue where you left off."
58589
+ ].filter(Boolean).join("\n");
58590
+ const shortPrompt = pendingTask.prompt.slice(0, 40) + (pendingTask.prompt.length > 40 ? "..." : "");
58591
+ writeContent(() => renderInfo(`Picking up: ${shortPrompt}`));
58546
58592
  rl.emit("line", resumeContext);
58547
58593
  }, 100);
58548
58594
  }
@@ -58732,6 +58778,7 @@ Execute this skill now. Follow the behavioral guidance above.`;
58732
58778
  }, bruteForceEnabled, statusBar, handleSudoRequest, costTracker, (summary, meta) => {
58733
58779
  lastCompletedSummary = summary;
58734
58780
  lastTaskMeta = meta ?? null;
58781
+ setTerminalTitle(summary?.slice(0, 60), version);
58735
58782
  }, currentTaskType, resolvedContextWindowSize, resolvedCaps, currentStyle, deepContextEnabled, compactionSNRCallback(), emotionEngine, flowEnabled, buildSlashCommandHandler(), thinkingEnabled, handleAskUser);
58736
58783
  activeTask = task;
58737
58784
  setTerminalTitle(input.slice(0, 60), version);
@@ -58985,6 +59032,7 @@ NEW TASK: ${fullInput}`;
58985
59032
  }, bruteForceEnabled, statusBar, handleSudoRequest, costTracker, (summary, meta) => {
58986
59033
  lastCompletedSummary = summary;
58987
59034
  lastTaskMeta = meta ?? null;
59035
+ setTerminalTitle(summary?.slice(0, 60), version);
58988
59036
  }, currentTaskType, resolvedContextWindowSize, resolvedCaps, currentStyle, deepContextEnabled, compactionSNRCallback(), emotionEngine, flowEnabled, buildSlashCommandHandler(), thinkingEnabled, handleAskUser);
58989
59037
  activeTask = task;
58990
59038
  setTerminalTitle(input.slice(0, 60), version);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.139.7",
3
+ "version": "0.139.8",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",