open-agents-ai 0.187.270 → 0.187.272
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 +78 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -270619,6 +270619,7 @@ TASK: ${task}` : task;
|
|
|
270619
270619
|
content: `Littleman triage: activity detected (${recentSuccesses} recent successes, ${uniqueResults} unique results) — extending turn limit by ${extension2} (now ${this.options.maxTurns})`,
|
|
270620
270620
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
270621
270621
|
});
|
|
270622
|
+
const detailsLines = recentOutcomes.map((o2) => `- ${o2.tool}: ${o2.succeeded ? "OK" : "ERR"} — ${o2.preview}`);
|
|
270622
270623
|
this.emit({
|
|
270623
270624
|
type: "debug_littleman",
|
|
270624
270625
|
turn,
|
|
@@ -270628,7 +270629,11 @@ TASK: ${task}` : task;
|
|
|
270628
270629
|
detection: "none",
|
|
270629
270630
|
recentSuccesses,
|
|
270630
270631
|
recentFailures: recentOutcomes.length - recentSuccesses,
|
|
270631
|
-
intervention: `Extended maxTurns to ${this.options.maxTurns}
|
|
270632
|
+
intervention: `Extended maxTurns to ${this.options.maxTurns}`,
|
|
270633
|
+
details: [
|
|
270634
|
+
`Recent outcomes:`,
|
|
270635
|
+
...detailsLines
|
|
270636
|
+
].join("\n")
|
|
270632
270637
|
}
|
|
270633
270638
|
});
|
|
270634
270639
|
}
|
|
@@ -272319,27 +272324,45 @@ Full content available via: repl_exec(code="data = retrieve('${handleId}')") or
|
|
|
272319
272324
|
const { join: join106 } = __require("node:path");
|
|
272320
272325
|
const contextDir = join106(this._workingDirectory || process.cwd(), ".oa", "context");
|
|
272321
272326
|
mkdirSync55(contextDir, { recursive: true });
|
|
272322
|
-
const topEntities = this._temporalGraph.nodesByType("entity",
|
|
272323
|
-
const topFiles = this._temporalGraph.nodesByType("file",
|
|
272324
|
-
const topConcepts = this._temporalGraph.nodesByType("concept",
|
|
272327
|
+
const topEntities = this._temporalGraph.nodesByType("entity", 3);
|
|
272328
|
+
const topFiles = this._temporalGraph.nodesByType("file", 3);
|
|
272329
|
+
const topConcepts = this._temporalGraph.nodesByType("concept", 3);
|
|
272325
272330
|
const lines = [];
|
|
272326
272331
|
lines.push(`# Knowledge Graph Summary — ${this._sessionId}`);
|
|
272327
272332
|
lines.push("");
|
|
272328
272333
|
lines.push(`Nodes: ${nodes} Active edges: ${edges}`);
|
|
272329
272334
|
lines.push("");
|
|
272335
|
+
const g = this._temporalGraph;
|
|
272330
272336
|
const section = (title, items) => {
|
|
272331
272337
|
if (!items || items.length === 0)
|
|
272332
272338
|
return;
|
|
272333
272339
|
lines.push(`## ${title}`);
|
|
272334
272340
|
for (const n2 of items) {
|
|
272335
|
-
|
|
272341
|
+
const suffix = n2.mentionCount ? ` (${n2.mentionCount})` : "";
|
|
272342
|
+
lines.push(`- ${n2.text}${suffix}`);
|
|
272343
|
+
try {
|
|
272344
|
+
if (!g)
|
|
272345
|
+
break;
|
|
272346
|
+
const edges2 = g.currentEdges(n2.id);
|
|
272347
|
+
const rel = edges2.filter((e2) => e2.relation === "related_to").slice(0, 2);
|
|
272348
|
+
const picks = rel.length > 0 ? rel : edges2.slice(0, 2);
|
|
272349
|
+
for (const e2 of picks) {
|
|
272350
|
+
const neighborId = e2.srcId === n2.id ? e2.dstId : e2.srcId;
|
|
272351
|
+
const neighbor = g.getNode(neighborId);
|
|
272352
|
+
const neighborText = neighbor && neighbor.text ? neighbor.text.slice(0, 60) : neighborId.slice(0, 8);
|
|
272353
|
+
const relStr = e2.relation.replace(/_/g, " ");
|
|
272354
|
+
const fact = e2.fact ? ` — ${e2.fact.slice(0, 60)}` : "";
|
|
272355
|
+
lines.push(` · ${relStr} → ${neighborText}${fact}`);
|
|
272356
|
+
}
|
|
272357
|
+
} catch {
|
|
272358
|
+
}
|
|
272336
272359
|
}
|
|
272337
272360
|
lines.push("");
|
|
272338
272361
|
};
|
|
272339
272362
|
section("Top Entities", topEntities);
|
|
272340
272363
|
section("Top Files", topFiles);
|
|
272341
272364
|
section("Top Concepts", topConcepts);
|
|
272342
|
-
lines.push("(Use file_read on this file for quick recall. See
|
|
272365
|
+
lines.push("(Use file_read on this file for quick recall. See provenance JSON for full edge detail.)");
|
|
272343
272366
|
const outPath = join106(contextDir, `kg-summary-${this._sessionId}.md`);
|
|
272344
272367
|
writeFileSync49(outPath, lines.join("\n"), "utf-8");
|
|
272345
272368
|
writeFileSync49(join106(contextDir, `kg-summary-latest.md`), lines.join("\n"), "utf-8");
|
|
@@ -273139,6 +273162,11 @@ Do NOT re-run it. Use the result you already have and proceed to the next step.`
|
|
|
273139
273162
|
}
|
|
273140
273163
|
const succCount = this._littlemanToolOutcomes.filter((o2) => o2.succeeded).length;
|
|
273141
273164
|
const failCount = this._littlemanToolOutcomes.filter((o2) => !o2.succeeded).length;
|
|
273165
|
+
const lastFour = this._littlemanToolOutcomes.slice(-4);
|
|
273166
|
+
const details = [
|
|
273167
|
+
`Recent tool outcomes:`,
|
|
273168
|
+
...lastFour.map((o2) => `- ${o2.tool}: ${o2.succeeded ? "OK" : "ERR"} — ${o2.preview}`)
|
|
273169
|
+
].join("\n");
|
|
273142
273170
|
this.emit({
|
|
273143
273171
|
type: "debug_littleman",
|
|
273144
273172
|
turn,
|
|
@@ -273148,7 +273176,8 @@ Do NOT re-run it. Use the result you already have and proceed to the next step.`
|
|
|
273148
273176
|
detection: "none",
|
|
273149
273177
|
recentSuccesses: succCount,
|
|
273150
273178
|
recentFailures: failCount,
|
|
273151
|
-
intervention: this.pendingUserMessages.length > 0 ? this.pendingUserMessages[this.pendingUserMessages.length - 1]?.slice(0, 120) ?? null : null
|
|
273179
|
+
intervention: this.pendingUserMessages.length > 0 ? this.pendingUserMessages[this.pendingUserMessages.length - 1]?.slice(0, 120) ?? null : null,
|
|
273180
|
+
details
|
|
273152
273181
|
}
|
|
273153
273182
|
});
|
|
273154
273183
|
}
|
|
@@ -287766,10 +287795,11 @@ ${CONTENT_BG_SEQ}`);
|
|
|
287766
287795
|
* Hook into DirectInput — the blessed-style replacement for readline.
|
|
287767
287796
|
* DirectInput emits named events for all special keys, so no monkey-patching needed.
|
|
287768
287797
|
*/
|
|
287769
|
-
hookDirectInput(di, onEscape, onCtrlO) {
|
|
287798
|
+
hookDirectInput(di, onEscape, onCtrlO, onCtrlL) {
|
|
287770
287799
|
const self2 = this;
|
|
287771
287800
|
if (onEscape) di.on("escape", () => onEscape());
|
|
287772
287801
|
if (onCtrlO) di.on("ctrl-o", () => onCtrlO());
|
|
287802
|
+
if (onCtrlL) di.on("ctrl-l", () => onCtrlL());
|
|
287773
287803
|
di.on("pageup", () => self2.pageUpContent());
|
|
287774
287804
|
di.on("pagedown", () => self2.pageDownContent());
|
|
287775
287805
|
di.on("shiftup", () => self2.scrollContentUp(3));
|
|
@@ -316023,6 +316053,9 @@ var init_direct_input = __esm({
|
|
|
316023
316053
|
case 15:
|
|
316024
316054
|
this.emit("ctrl-o");
|
|
316025
316055
|
return;
|
|
316056
|
+
case 12:
|
|
316057
|
+
this.emit("ctrl-l");
|
|
316058
|
+
return;
|
|
316026
316059
|
case 28:
|
|
316027
316060
|
this.emit("ctrl-backslash");
|
|
316028
316061
|
return;
|
|
@@ -329867,6 +329900,8 @@ ${entry.fullContent}`
|
|
|
329867
329900
|
let streamStartMs = 0;
|
|
329868
329901
|
let streamTextBuffer = "";
|
|
329869
329902
|
let lastProvenancePath = null;
|
|
329903
|
+
let showLittleman = false;
|
|
329904
|
+
const littlemanBuffer = [];
|
|
329870
329905
|
const contentWrite = (fn) => {
|
|
329871
329906
|
if (isNeovimActive()) {
|
|
329872
329907
|
const origWrite = process.stdout.write;
|
|
@@ -330187,12 +330222,21 @@ ${entry.fullContent}`
|
|
|
330187
330222
|
}
|
|
330188
330223
|
break;
|
|
330189
330224
|
case "debug_littleman":
|
|
330190
|
-
if (
|
|
330225
|
+
if (event.littlemanAction) {
|
|
330191
330226
|
const lm = event.littlemanAction;
|
|
330192
330227
|
const intervention = lm.intervention ? ` | INTERVENTION: ${lm.intervention}` : "";
|
|
330193
|
-
|
|
330194
|
-
|
|
330195
|
-
)
|
|
330228
|
+
const compact = `\x1B[38;5;178m[littleman] ${lm.recentSuccesses} ok, ${lm.recentFailures} err${intervention}\x1B[0m`;
|
|
330229
|
+
contentWrite(() => renderInfo2(compact));
|
|
330230
|
+
if (lm.details) {
|
|
330231
|
+
littlemanBuffer.push(lm.details);
|
|
330232
|
+
if (littlemanBuffer.length > 50) littlemanBuffer.splice(0, littlemanBuffer.length - 50);
|
|
330233
|
+
if (showLittleman) {
|
|
330234
|
+
const det = String(lm.details);
|
|
330235
|
+
contentWrite(() => {
|
|
330236
|
+
process.stdout.write(c3.dim(det) + "\n");
|
|
330237
|
+
});
|
|
330238
|
+
}
|
|
330239
|
+
}
|
|
330196
330240
|
}
|
|
330197
330241
|
break;
|
|
330198
330242
|
}
|
|
@@ -331416,6 +331460,8 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
331416
331460
|
origTtyWriteRef = null;
|
|
331417
331461
|
statusBar.setNeovimFocusChecker(() => isNeovimFocused());
|
|
331418
331462
|
let _escapeHandler = null;
|
|
331463
|
+
let showLittleman = false;
|
|
331464
|
+
const littlemanBuffer = [];
|
|
331419
331465
|
statusBar.hookDirectInput(rl, () => {
|
|
331420
331466
|
_escapeHandler?.();
|
|
331421
331467
|
}, () => {
|
|
@@ -331449,6 +331495,26 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
331449
331495
|
statusBar.enableMouseTracking();
|
|
331450
331496
|
statusBar.refreshHeaderContent();
|
|
331451
331497
|
}
|
|
331498
|
+
}, () => {
|
|
331499
|
+
showLittleman = !showLittleman;
|
|
331500
|
+
if (statusBar.isActive) {
|
|
331501
|
+
statusBar.beginContentWrite();
|
|
331502
|
+
if (showLittleman) {
|
|
331503
|
+
renderInfo2("Littleman details: shown");
|
|
331504
|
+
const dump = littlemanBuffer.slice(-10).join("\n");
|
|
331505
|
+
if (dump.trim()) {
|
|
331506
|
+
process.stdout.write(`
|
|
331507
|
+
${c3.dim("[littleman recap]")}
|
|
331508
|
+
`);
|
|
331509
|
+
for (const line of dump.split("\n")) {
|
|
331510
|
+
process.stdout.write(" " + c3.dim(line) + "\n");
|
|
331511
|
+
}
|
|
331512
|
+
}
|
|
331513
|
+
} else {
|
|
331514
|
+
renderInfo2("Littleman details: hidden");
|
|
331515
|
+
}
|
|
331516
|
+
statusBar.endContentWrite();
|
|
331517
|
+
}
|
|
331452
331518
|
});
|
|
331453
331519
|
let commandCtxRef = null;
|
|
331454
331520
|
let headerBtnActive = null;
|
package/package.json
CHANGED