open-agents-ai 0.138.74 → 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.
- package/dist/index.js +49 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -58047,6 +58047,55 @@ async function runWithTUI(task, config, repoPath) {
|
|
|
58047
58047
|
} catch {
|
|
58048
58048
|
}
|
|
58049
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
|
+
}
|
|
58050
58099
|
renderError(err instanceof Error ? err.message : String(err));
|
|
58051
58100
|
process.exit(1);
|
|
58052
58101
|
}
|
package/package.json
CHANGED