open-agents-ai 0.138.73 → 0.138.75

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 +110 -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,7 +58027,75 @@ 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) {
58050
+ try {
58051
+ const ikFile = join59(repoRoot, ".oa", "identity", "self-state.json");
58052
+ if (existsSync43(ikFile)) {
58053
+ const ikState = JSON.parse(readFileSync32(ikFile, "utf8"));
58054
+ ikState.homeostasis.uncertainty = Math.min(1, ikState.homeostasis.uncertainty + 0.1);
58055
+ ikState.homeostasis.coherence = Math.max(0, ikState.homeostasis.coherence - 0.05);
58056
+ ikState.session_count = (ikState.session_count || 0) + 1;
58057
+ ikState.updated_at = (/* @__PURE__ */ new Date()).toISOString();
58058
+ writeFileSync18(ikFile, JSON.stringify(ikState, null, 2));
58059
+ }
58060
+ const metaFile = join59(repoRoot, ".oa", "memory", "metabolism", "store.json");
58061
+ if (existsSync43(metaFile)) {
58062
+ const store = JSON.parse(readFileSync32(metaFile, "utf8"));
58063
+ 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);
58064
+ for (const item of surfaced) {
58065
+ item.accessCount = (item.accessCount || 0) + 1;
58066
+ item.lastAccessedAt = (/* @__PURE__ */ new Date()).toISOString();
58067
+ item.scores.utility = Math.max(0, (item.scores.utility || 0.5) - 0.05);
58068
+ item.scores.confidence = Math.max(0, (item.scores.confidence || 0.5) - 0.02);
58069
+ }
58070
+ writeFileSync18(metaFile, JSON.stringify(store, null, 2));
58071
+ }
58072
+ try {
58073
+ const archeDir = join59(repoRoot, ".oa", "arche");
58074
+ const archeFile = join59(archeDir, "variants.json");
58075
+ let variants = [];
58076
+ try {
58077
+ if (existsSync43(archeFile))
58078
+ variants = JSON.parse(readFileSync32(archeFile, "utf8"));
58079
+ } catch {
58080
+ }
58081
+ variants.push({
58082
+ id: `var-${Date.now().toString(36)}`,
58083
+ strategy: `Task: ${task.slice(0, 300)}`,
58084
+ context: "",
58085
+ outcome: `failure \u2014 ${err instanceof Error ? err.message.slice(0, 100) : "unknown"}`,
58086
+ confidence: 0.2,
58087
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
58088
+ reuse_count: 0,
58089
+ tags: ["general"]
58090
+ });
58091
+ if (variants.length > 50)
58092
+ variants = variants.slice(-50);
58093
+ mkdirSync19(archeDir, { recursive: true });
58094
+ writeFileSync18(archeFile, JSON.stringify(variants, null, 2));
58095
+ } catch {
58096
+ }
58097
+ } catch {
58098
+ }
57990
58099
  renderError(err instanceof Error ? err.message : String(err));
57991
58100
  process.exit(1);
57992
58101
  }
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.75",
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",