open-agents-ai 0.117.0 → 0.119.0
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 +67 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -8573,6 +8573,13 @@ Homeostasis: uncertainty=${h.uncertainty.toFixed(2)} coherence=${h.coherence.toF
|
|
|
8573
8573
|
durationMs: performance.now() - start
|
|
8574
8574
|
};
|
|
8575
8575
|
}
|
|
8576
|
+
// ── Reflection Gate (COHERE cross-layer invariant p.7) ──────────────────
|
|
8577
|
+
/** Optional reflection callback — must pass constitutional review before identity update */
|
|
8578
|
+
reflectionGate = null;
|
|
8579
|
+
/** Set the reflection gate for constitutional review of identity updates */
|
|
8580
|
+
setReflectionGate(gate) {
|
|
8581
|
+
this.reflectionGate = gate;
|
|
8582
|
+
}
|
|
8576
8583
|
// ── Propose Update ───────────────────────────────────────────────────────
|
|
8577
8584
|
async proposeUpdate(args, start) {
|
|
8578
8585
|
const changeType = String(args.change_type ?? "new_fact");
|
|
@@ -8582,6 +8589,23 @@ Homeostasis: uncertainty=${h.uncertainty.toFixed(2)} coherence=${h.coherence.toF
|
|
|
8582
8589
|
if (!field || !value) {
|
|
8583
8590
|
return { success: false, output: "field and value required", durationMs: performance.now() - start };
|
|
8584
8591
|
}
|
|
8592
|
+
if (this.reflectionGate) {
|
|
8593
|
+
try {
|
|
8594
|
+
const proposal = `${changeType}: ${field} = ${value}. Justification: ${justification}`;
|
|
8595
|
+
const verdict = await this.reflectionGate(proposal, `Identity update to ${field}`);
|
|
8596
|
+
if (verdict.status === "block") {
|
|
8597
|
+
return {
|
|
8598
|
+
success: false,
|
|
8599
|
+
output: `Identity update BLOCKED by reflection gate:
|
|
8600
|
+
Proposal: ${changeType} on ${field}
|
|
8601
|
+
Findings: ${verdict.findings.join("; ")}
|
|
8602
|
+
The reflection layer vetoed this self-update per COHERE invariant.`,
|
|
8603
|
+
durationMs: performance.now() - start
|
|
8604
|
+
};
|
|
8605
|
+
}
|
|
8606
|
+
} catch {
|
|
8607
|
+
}
|
|
8608
|
+
}
|
|
8585
8609
|
if (!this.selfState)
|
|
8586
8610
|
await this.hydrate(start);
|
|
8587
8611
|
const oldVersion = this.selfState.version;
|
|
@@ -29626,6 +29650,7 @@ function renderSlashHelp() {
|
|
|
29626
29650
|
["/telegram", "Toggle Telegram bridge on/off (uses saved key)"],
|
|
29627
29651
|
["/telegram status", "Show Telegram bridge status"],
|
|
29628
29652
|
["/telegram stop", "Disconnect Telegram bridge"],
|
|
29653
|
+
["/cohere", "Toggle COHERE cognitive commons \u2014 join distributed memory/identity mesh"],
|
|
29629
29654
|
["/nexus", "Show nexus P2P network status"],
|
|
29630
29655
|
["/nexus connect", "Connect to the agent mesh network"],
|
|
29631
29656
|
["/nexus restart", "Kill daemon and reconnect (picks up new version)"],
|
|
@@ -40526,6 +40551,21 @@ async function handleSlashCommand(input, ctx) {
|
|
|
40526
40551
|
}
|
|
40527
40552
|
return "handled";
|
|
40528
40553
|
}
|
|
40554
|
+
case "cohere": {
|
|
40555
|
+
if (ctx.cohereToggle) {
|
|
40556
|
+
const active = ctx.cohereToggle();
|
|
40557
|
+
if (active) {
|
|
40558
|
+
renderInfo("COHERE enabled \u2014 participating in distributed cognitive commons");
|
|
40559
|
+
renderInfo("Your identity kernel and memory deltas will be shared with the mesh");
|
|
40560
|
+
renderInfo("Use /cohere again to disconnect");
|
|
40561
|
+
} else {
|
|
40562
|
+
renderInfo("COHERE disabled \u2014 disconnected from cognitive commons");
|
|
40563
|
+
}
|
|
40564
|
+
} else {
|
|
40565
|
+
renderWarning("COHERE not available \u2014 requires nexus connection (/expose or /p2p)");
|
|
40566
|
+
}
|
|
40567
|
+
return "handled";
|
|
40568
|
+
}
|
|
40529
40569
|
case "listen":
|
|
40530
40570
|
case "mic": {
|
|
40531
40571
|
if (!ctx.listenToggle) {
|
|
@@ -50136,6 +50176,8 @@ var init_status_bar = __esm({
|
|
|
50136
50176
|
active = false;
|
|
50137
50177
|
scrollRegionTop = 1;
|
|
50138
50178
|
stdinHooked = false;
|
|
50179
|
+
/** COHERE distributed cognitive commons active flag */
|
|
50180
|
+
_cohereActive = false;
|
|
50139
50181
|
/** Track previous terminal dimensions to clear ghost separators on resize */
|
|
50140
50182
|
_prevTermRows = 0;
|
|
50141
50183
|
_prevTermCols = 0;
|
|
@@ -50722,6 +50764,15 @@ var init_status_bar = __esm({
|
|
|
50722
50764
|
get isActive() {
|
|
50723
50765
|
return this.active;
|
|
50724
50766
|
}
|
|
50767
|
+
/** Set/get COHERE participation state — shows 🌐 in metrics when active */
|
|
50768
|
+
setCohereActive(active) {
|
|
50769
|
+
this._cohereActive = active;
|
|
50770
|
+
if (this.active)
|
|
50771
|
+
this.renderFooterAndPositionInput();
|
|
50772
|
+
}
|
|
50773
|
+
get cohereActive() {
|
|
50774
|
+
return this._cohereActive;
|
|
50775
|
+
}
|
|
50725
50776
|
/** Whether content is currently being written to the scroll region */
|
|
50726
50777
|
get isWritingContent() {
|
|
50727
50778
|
return this.writeDepth > 0;
|
|
@@ -50904,6 +50955,10 @@ var init_status_bar = __esm({
|
|
|
50904
50955
|
const compactOrder = [];
|
|
50905
50956
|
let modelSectionIdx = -1;
|
|
50906
50957
|
let versionSectionIdx = -1;
|
|
50958
|
+
if (this._cohereActive) {
|
|
50959
|
+
const cohereExpanded = "\x1B[38;5;214m\u{1F310}\x1B[0m";
|
|
50960
|
+
sections.push({ expanded: cohereExpanded, compact: cohereExpanded, expandedW: 2, compactW: 2, empty: false });
|
|
50961
|
+
}
|
|
50907
50962
|
const tokInRaw = m.promptTokens > 0 ? m.promptTokens : Math.max(m.estimatedContextTokens, 0);
|
|
50908
50963
|
const effectiveOut = this.effectiveCompletionTokens;
|
|
50909
50964
|
const tokOutRaw = effectiveOut > 0 ? effectiveOut : Math.ceil(m.totalTokens > 0 ? m.totalTokens - m.promptTokens : m.estimatedContextTokens * 0.3);
|
|
@@ -52021,6 +52076,18 @@ Content: ${content.slice(0, 500)}` }
|
|
|
52021
52076
|
});
|
|
52022
52077
|
}
|
|
52023
52078
|
}
|
|
52079
|
+
const identityTool = tools.find((t) => t.name === "identity_kernel");
|
|
52080
|
+
const reflectTool = tools.find((t) => t.name === "reflect");
|
|
52081
|
+
if (identityTool && reflectTool && "setReflectionGate" in identityTool) {
|
|
52082
|
+
identityTool.setReflectionGate(async (target, context) => {
|
|
52083
|
+
const result = await reflectTool.execute({ mode: "constitutional", target, context });
|
|
52084
|
+
const statusMatch = result.output.match(/\b(pass|revise|block)\b/i);
|
|
52085
|
+
const status = statusMatch ? statusMatch[1].toLowerCase() : "pass";
|
|
52086
|
+
const findingsMatch = result.output.match(/Findings:\n([\s\S]*?)(?:\n\n|$)/);
|
|
52087
|
+
const findings = findingsMatch ? findingsMatch[1].split("\n").map((l) => l.trim()).filter(Boolean) : [];
|
|
52088
|
+
return { status, findings };
|
|
52089
|
+
});
|
|
52090
|
+
}
|
|
52024
52091
|
const replToolForFinalVar = tools.find((t) => t.name === "repl_exec");
|
|
52025
52092
|
if (replToolForFinalVar && "readVariable" in replToolForFinalVar) {
|
|
52026
52093
|
runner.options.finalVarResolver = async (varName) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "open-agents-ai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.119.0",
|
|
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",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"moondream": "^0.2.0",
|
|
86
86
|
"neovim": "^5.3.0",
|
|
87
87
|
"node-pty": "^1.0.0",
|
|
88
|
-
"open-agents-nexus": "^1.
|
|
88
|
+
"open-agents-nexus": "^1.10.0",
|
|
89
89
|
"viem": "^2.47.4"
|
|
90
90
|
}
|
|
91
91
|
}
|