open-agents-ai 0.138.74 → 0.138.76
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 +79 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -44490,10 +44490,36 @@ async function showExposeDashboard(gateway, rl, ctx) {
|
|
|
44490
44490
|
const id = gateway.tunnelUrl ?? gateway.peerId ?? null;
|
|
44491
44491
|
if (id) {
|
|
44492
44492
|
const cmd = `/endpoint ${id} --auth ${gateway.authKey ?? ""}`;
|
|
44493
|
-
|
|
44494
|
-
|
|
44495
|
-
|
|
44496
|
-
|
|
44493
|
+
let copied = false;
|
|
44494
|
+
try {
|
|
44495
|
+
const { execSync: execSync30 } = __require("node:child_process");
|
|
44496
|
+
const platform5 = process.platform;
|
|
44497
|
+
if (platform5 === "darwin") {
|
|
44498
|
+
execSync30("pbcopy", { input: cmd, timeout: 3e3 });
|
|
44499
|
+
copied = true;
|
|
44500
|
+
} else if (platform5 === "win32") {
|
|
44501
|
+
execSync30("clip", { input: cmd, timeout: 3e3 });
|
|
44502
|
+
copied = true;
|
|
44503
|
+
} else {
|
|
44504
|
+
for (const tool of ["xclip -selection clipboard", "xsel --clipboard --input", "wl-copy"]) {
|
|
44505
|
+
try {
|
|
44506
|
+
execSync30(tool, { input: cmd, timeout: 3e3, stdio: ["pipe", "pipe", "pipe"] });
|
|
44507
|
+
copied = true;
|
|
44508
|
+
break;
|
|
44509
|
+
} catch {
|
|
44510
|
+
continue;
|
|
44511
|
+
}
|
|
44512
|
+
}
|
|
44513
|
+
}
|
|
44514
|
+
} catch {
|
|
44515
|
+
}
|
|
44516
|
+
if (!copied) {
|
|
44517
|
+
const b64 = Buffer.from(cmd).toString("base64");
|
|
44518
|
+
overlayWrite(`\x1B]52;c;${b64}\x07`);
|
|
44519
|
+
copied = true;
|
|
44520
|
+
}
|
|
44521
|
+
overlayWrite(`\x1B[${rows()}H\x1B[2K ${c2.green("\u2713 Copied to clipboard: ")}${c2.dim(cmd.slice(0, 60))}${cmd.length > 60 ? "..." : ""}`);
|
|
44522
|
+
setTimeout(() => scheduleRender(), 2e3);
|
|
44497
44523
|
}
|
|
44498
44524
|
}
|
|
44499
44525
|
};
|
|
@@ -58047,6 +58073,55 @@ async function runWithTUI(task, config, repoPath) {
|
|
|
58047
58073
|
} catch {
|
|
58048
58074
|
}
|
|
58049
58075
|
} catch (err) {
|
|
58076
|
+
try {
|
|
58077
|
+
const ikFile = join59(repoRoot, ".oa", "identity", "self-state.json");
|
|
58078
|
+
if (existsSync43(ikFile)) {
|
|
58079
|
+
const ikState = JSON.parse(readFileSync32(ikFile, "utf8"));
|
|
58080
|
+
ikState.homeostasis.uncertainty = Math.min(1, ikState.homeostasis.uncertainty + 0.1);
|
|
58081
|
+
ikState.homeostasis.coherence = Math.max(0, ikState.homeostasis.coherence - 0.05);
|
|
58082
|
+
ikState.session_count = (ikState.session_count || 0) + 1;
|
|
58083
|
+
ikState.updated_at = (/* @__PURE__ */ new Date()).toISOString();
|
|
58084
|
+
writeFileSync18(ikFile, JSON.stringify(ikState, null, 2));
|
|
58085
|
+
}
|
|
58086
|
+
const metaFile = join59(repoRoot, ".oa", "memory", "metabolism", "store.json");
|
|
58087
|
+
if (existsSync43(metaFile)) {
|
|
58088
|
+
const store = JSON.parse(readFileSync32(metaFile, "utf8"));
|
|
58089
|
+
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);
|
|
58090
|
+
for (const item of surfaced) {
|
|
58091
|
+
item.accessCount = (item.accessCount || 0) + 1;
|
|
58092
|
+
item.lastAccessedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
58093
|
+
item.scores.utility = Math.max(0, (item.scores.utility || 0.5) - 0.05);
|
|
58094
|
+
item.scores.confidence = Math.max(0, (item.scores.confidence || 0.5) - 0.02);
|
|
58095
|
+
}
|
|
58096
|
+
writeFileSync18(metaFile, JSON.stringify(store, null, 2));
|
|
58097
|
+
}
|
|
58098
|
+
try {
|
|
58099
|
+
const archeDir = join59(repoRoot, ".oa", "arche");
|
|
58100
|
+
const archeFile = join59(archeDir, "variants.json");
|
|
58101
|
+
let variants = [];
|
|
58102
|
+
try {
|
|
58103
|
+
if (existsSync43(archeFile))
|
|
58104
|
+
variants = JSON.parse(readFileSync32(archeFile, "utf8"));
|
|
58105
|
+
} catch {
|
|
58106
|
+
}
|
|
58107
|
+
variants.push({
|
|
58108
|
+
id: `var-${Date.now().toString(36)}`,
|
|
58109
|
+
strategy: `Task: ${task.slice(0, 300)}`,
|
|
58110
|
+
context: "",
|
|
58111
|
+
outcome: `failure \u2014 ${err instanceof Error ? err.message.slice(0, 100) : "unknown"}`,
|
|
58112
|
+
confidence: 0.2,
|
|
58113
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
58114
|
+
reuse_count: 0,
|
|
58115
|
+
tags: ["general"]
|
|
58116
|
+
});
|
|
58117
|
+
if (variants.length > 50)
|
|
58118
|
+
variants = variants.slice(-50);
|
|
58119
|
+
mkdirSync19(archeDir, { recursive: true });
|
|
58120
|
+
writeFileSync18(archeFile, JSON.stringify(variants, null, 2));
|
|
58121
|
+
} catch {
|
|
58122
|
+
}
|
|
58123
|
+
} catch {
|
|
58124
|
+
}
|
|
58050
58125
|
renderError(err instanceof Error ? err.message : String(err));
|
|
58051
58126
|
process.exit(1);
|
|
58052
58127
|
}
|
package/package.json
CHANGED