open-agents-ai 0.138.73 → 0.138.74

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/README.md +0 -12
  2. package/dist/index.js +61 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,15 +1,3 @@
1
- <p align="center">
2
- <pre align="center">
3
- ██████╗ █████╗
4
- ██╔═══██╗██╔══██╗ ░▒▓█▓▒░ ░▒▓▓▒░ ░▒▓▓▒░
5
- ██║ ██║███████║ ░▒▓█▓▒░▒▓▓▒░▒▓▓▒░▒▓▓▒░
6
- ██║ ██║██╔══██║ ░▒▓█▓▒░▒▓▓▒░░▒▓▓▒░
7
- ╚██████╔╝██║ ██║ ░▒▓▓▒░▒▓▓▒░▒▓▓▒░
8
- ╚═════╝ ╚═╝ ╚═╝ ░▒▓▓▒░░▒▓▓▒░
9
- /help /voice /cohere /model
10
- </pre>
11
- </p>
12
-
13
1
  <h1 align="center">Open Agents</h1>
14
2
 
15
3
  <p align="center">
package/dist/index.js CHANGED
@@ -12915,7 +12915,48 @@ ${issues.map((i) => ` - ${i}`).join("\n")}` : " No issues found."),
12915
12915
  const top = items.slice(0, k);
12916
12916
  if (top.length === 0)
12917
12917
  return "";
12918
- return top.map((m) => `- [${m.type}] ${m.content.slice(0, 200)} (confidence: ${m.scores.confidence.toFixed(2)}, utility: ${m.scores.utility.toFixed(2)})`).join("\n");
12918
+ return top.map((m) => `- [${m.type}][${m.id}] ${m.content.slice(0, 200)} (confidence: ${m.scores.confidence.toFixed(2)}, utility: ${m.scores.utility.toFixed(2)})`).join("\n");
12919
+ }
12920
+ // ── Outcome-weighted feedback (WO-FL5) ───────────────────────────────
12921
+ // Per ExpeL (arXiv:2308.10144): contrastive learning from success/failure.
12922
+ // Per MemRL (arXiv:2601.03192): environmental feedback > text similarity.
12923
+ /** Update memory scores based on task outcome. Called after task completion.
12924
+ * Memories used in successful tasks get boosted. Memories present during failures get decayed. */
12925
+ updateFromOutcomeSync(surfacedMemoryText, succeeded) {
12926
+ const { readFileSync: readFileSync33, writeFileSync: writeFileSync20, existsSync: existsSync45, mkdirSync: mkdirSync21 } = __require("node:fs");
12927
+ const metaDir = join21(this.cwd, ".oa", "memory", "metabolism");
12928
+ const storeFile = join21(metaDir, "store.json");
12929
+ if (!existsSync45(storeFile))
12930
+ return;
12931
+ let store = [];
12932
+ try {
12933
+ store = JSON.parse(readFileSync33(storeFile, "utf8"));
12934
+ } catch {
12935
+ return;
12936
+ }
12937
+ const idMatches = surfacedMemoryText.match(/\[(mem-[a-zA-Z0-9-]+)\]/g);
12938
+ if (!idMatches || idMatches.length === 0)
12939
+ return;
12940
+ const surfacedIds = new Set(idMatches.map((m) => m.slice(1, -1)));
12941
+ let updated = false;
12942
+ for (const item of store) {
12943
+ if (!surfacedIds.has(item.id))
12944
+ continue;
12945
+ item.accessCount++;
12946
+ item.lastAccessedAt = (/* @__PURE__ */ new Date()).toISOString();
12947
+ if (succeeded) {
12948
+ item.scores.utility = Math.min(1, item.scores.utility + 0.1);
12949
+ item.scores.confidence = Math.min(1, item.scores.confidence + 0.05);
12950
+ } else {
12951
+ item.scores.utility = Math.max(0, item.scores.utility - 0.05);
12952
+ item.scores.confidence = Math.max(0, item.scores.confidence - 0.02);
12953
+ }
12954
+ updated = true;
12955
+ }
12956
+ if (updated) {
12957
+ mkdirSync21(metaDir, { recursive: true });
12958
+ writeFileSync20(storeFile, JSON.stringify(store, null, 2));
12959
+ }
12919
12960
  }
12920
12961
  // ── Storage ──────────────────────────────────────────────────────────
12921
12962
  async loadStore(dir) {
@@ -57986,6 +58027,25 @@ async function runWithTUI(task, config, repoPath) {
57986
58027
  } catch {
57987
58028
  }
57988
58029
  }
58030
+ try {
58031
+ const metaFile = join59(repoRoot, ".oa", "memory", "metabolism", "store.json");
58032
+ if (existsSync43(metaFile)) {
58033
+ const store = JSON.parse(readFileSync32(metaFile, "utf8"));
58034
+ const surfaced = store.filter((m) => m.type !== "quarantine" && m.scores?.confidence > 0.15).sort((a, b) => b.scores.utility * b.scores.confidence - a.scores.utility * a.scores.confidence).slice(0, 5);
58035
+ let updated = false;
58036
+ for (const item of surfaced) {
58037
+ item.accessCount = (item.accessCount || 0) + 1;
58038
+ item.lastAccessedAt = (/* @__PURE__ */ new Date()).toISOString();
58039
+ item.scores.utility = Math.min(1, (item.scores.utility || 0.5) + 0.1);
58040
+ item.scores.confidence = Math.min(1, (item.scores.confidence || 0.5) + 0.05);
58041
+ updated = true;
58042
+ }
58043
+ if (updated) {
58044
+ writeFileSync18(metaFile, JSON.stringify(store, null, 2));
58045
+ }
58046
+ }
58047
+ } catch {
58048
+ }
57989
58049
  } catch (err) {
57990
58050
  renderError(err instanceof Error ? err.message : String(err));
57991
58051
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.138.73",
3
+ "version": "0.138.74",
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",