open-agents-ai 0.138.76 → 0.138.78

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 +55 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -44523,10 +44523,16 @@ async function showExposeDashboard(gateway, rl, ctx) {
44523
44523
  }
44524
44524
  }
44525
44525
  };
44526
+ if (process.stdout.isTTY) {
44527
+ process.stdout.write("\x1B[?1002l\x1B[?1006l");
44528
+ }
44526
44529
  process.stdin.on("data", onData);
44527
44530
  const cleanup = () => {
44528
44531
  stopped = true;
44529
44532
  process.stdin.removeListener("data", onData);
44533
+ if (process.stdout.isTTY) {
44534
+ process.stdout.write("\x1B[?1002h\x1B[?1006h");
44535
+ }
44530
44536
  };
44531
44537
  const origResolve = resolve32;
44532
44538
  resolve32 = (() => {
@@ -54251,7 +54257,7 @@ function startTask(task, config, repoRoot, voice, stream, taskStores, bruteForce
54251
54257
  try {
54252
54258
  const { MemoryMetabolismTool: MemoryMetabolismTool2 } = __require("@open-agents/execution");
54253
54259
  const mm = new MemoryMetabolismTool2(repoRoot);
54254
- const metabolismMemories = mm.getTopMemoriesSync(5, taskType || void 0);
54260
+ const metabolismMemories = mm.getTopMemoriesSync(2, taskType || void 0);
54255
54261
  if (metabolismMemories) {
54256
54262
  dynamicContext += `
54257
54263
 
@@ -58072,6 +58078,54 @@ async function runWithTUI(task, config, repoPath) {
58072
58078
  }
58073
58079
  } catch {
58074
58080
  }
58081
+ try {
58082
+ const ts = handle.runner?.taskState;
58083
+ if (ts && ts.toolCallCount > 2) {
58084
+ let category = "strategy";
58085
+ let lesson = "";
58086
+ if (ts.failedApproaches && ts.failedApproaches.length > 0) {
58087
+ category = "recovery";
58088
+ const failed = ts.failedApproaches.slice(0, 2).join("; ");
58089
+ const worked = ts.completedSteps?.slice(-2).join(" \u2192 ") || "completed task";
58090
+ lesson = `[recovery] Avoid: ${failed}. Instead: ${worked}`;
58091
+ } else if (ts.completedSteps && ts.completedSteps.length > 1) {
58092
+ lesson = `[strategy] ${ts.completedSteps.slice(-3).join(" \u2192 ")}`;
58093
+ } else {
58094
+ lesson = `[strategy] Solved: ${task.slice(0, 150)}`;
58095
+ }
58096
+ if (lesson) {
58097
+ const metaDir = join59(repoRoot, ".oa", "memory", "metabolism");
58098
+ const storeFile = join59(metaDir, "store.json");
58099
+ let store = [];
58100
+ try {
58101
+ if (existsSync43(storeFile))
58102
+ store = JSON.parse(readFileSync32(storeFile, "utf8"));
58103
+ } catch {
58104
+ }
58105
+ store.push({
58106
+ id: `mem-traj-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 6)}`,
58107
+ type: "procedural",
58108
+ content: lesson.slice(0, 500),
58109
+ sourceTrace: "trajectory-extraction",
58110
+ scores: {
58111
+ novelty: 0.6,
58112
+ utility: category === "recovery" ? 0.8 : 0.6,
58113
+ confidence: 0.7,
58114
+ identityRelevance: 0.3
58115
+ },
58116
+ decision: { action: "admit", reason: `Auto-extracted ${category} from task (${ts.toolCallCount} tool calls)` },
58117
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
58118
+ lastAccessedAt: (/* @__PURE__ */ new Date()).toISOString(),
58119
+ accessCount: 0
58120
+ });
58121
+ if (store.length > 100)
58122
+ store = store.slice(-100);
58123
+ mkdirSync19(metaDir, { recursive: true });
58124
+ writeFileSync18(storeFile, JSON.stringify(store, null, 2));
58125
+ }
58126
+ }
58127
+ } catch {
58128
+ }
58075
58129
  } catch (err) {
58076
58130
  try {
58077
58131
  const ikFile = join59(repoRoot, ".oa", "identity", "self-state.json");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.138.76",
3
+ "version": "0.138.78",
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",