open-agents-ai 0.187.587 → 0.187.589
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 +258 -18
- package/npm-shrinkwrap.json +9 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -514656,7 +514656,8 @@ function evaluate(inputs) {
|
|
|
514656
514656
|
return {
|
|
514657
514657
|
decision: "observer_block",
|
|
514658
514658
|
reason: "Littleman observer flagged this fingerprint as redundant",
|
|
514659
|
-
cachedResult: cached ?
|
|
514659
|
+
cachedResult: cached ? `[CACHED RESULT — you already have this information from a prior call. Do NOT call this tool again with the same arguments.]
|
|
514660
|
+
${cached.result}` : null
|
|
514660
514661
|
};
|
|
514661
514662
|
}
|
|
514662
514663
|
if (isReadLike) {
|
|
@@ -514672,10 +514673,12 @@ function evaluate(inputs) {
|
|
|
514672
514673
|
blockMessage: buildForceProgressBlockMessage(proposedCall, hits)
|
|
514673
514674
|
};
|
|
514674
514675
|
}
|
|
514676
|
+
const cachedEnvelope = `[CACHED RESULT — you already have this information from a prior call. Do NOT call this tool again with the same arguments.]
|
|
514677
|
+
${cached.result}`;
|
|
514675
514678
|
return {
|
|
514676
514679
|
decision: "serve_cached",
|
|
514677
514680
|
reason: cached.compacted ? "post-compaction cache re-serve" : `duplicate call #${hits} (still under ${threshold}-hit gate)`,
|
|
514678
|
-
cachedResult:
|
|
514681
|
+
cachedResult: cachedEnvelope,
|
|
514679
514682
|
compacted: cached.compacted,
|
|
514680
514683
|
hitNumber: hits
|
|
514681
514684
|
};
|
|
@@ -529241,14 +529244,15 @@ ${body}`;
|
|
|
529241
529244
|
proactivePrune(messages2, currentTurn) {
|
|
529242
529245
|
if (process.env["OA_DISABLE_PROACTIVE_PRUNE"] === "1")
|
|
529243
529246
|
return;
|
|
529244
|
-
const AGED_FILE_READ_TURNS =
|
|
529245
|
-
const AGED_SHELL_TURNS =
|
|
529247
|
+
const AGED_FILE_READ_TURNS = 20;
|
|
529248
|
+
const AGED_SHELL_TURNS = 12;
|
|
529246
529249
|
const ERROR_MARKERS = /(?:error|fail|exception|traceback|enoent|enotfound|exit code [^0]|status[: ]+1\d?\d?)/i;
|
|
529247
529250
|
const PRUNE_PREFIX = "[Tool result cleared";
|
|
529248
529251
|
const DEDUPE_PREFIX = "[deduped — same call as turn";
|
|
529249
529252
|
const FILE_AGED_PREFIX = "[file_read aged out, summary:";
|
|
529250
529253
|
const SHELL_AGED_PREFIX = "[shell succeeded, output pruned —";
|
|
529251
529254
|
const seen = /* @__PURE__ */ new Map();
|
|
529255
|
+
const seenResource = /* @__PURE__ */ new Map();
|
|
529252
529256
|
const pending = [];
|
|
529253
529257
|
let scanTurn = 0;
|
|
529254
529258
|
for (let i2 = 0; i2 < messages2.length; i2++) {
|
|
@@ -529293,7 +529297,26 @@ ${body}`;
|
|
|
529293
529297
|
}
|
|
529294
529298
|
seen.set(fp, { turn: scanTurn, idx: resultIdx });
|
|
529295
529299
|
const ageTurns = currentTurn - scanTurn;
|
|
529296
|
-
|
|
529300
|
+
const wasRecentlyWritten = (() => {
|
|
529301
|
+
try {
|
|
529302
|
+
const o2 = JSON.parse(tc.function.arguments || "{}");
|
|
529303
|
+
const p2 = String(o2.path ?? o2.file ?? "");
|
|
529304
|
+
for (let k = Math.max(0, i2 - 20); k < i2; k++) {
|
|
529305
|
+
const m2 = messages2[k];
|
|
529306
|
+
if (m2.role === "assistant" && m2.tool_calls) {
|
|
529307
|
+
for (const tc2 of m2.tool_calls) {
|
|
529308
|
+
if ((tc2.function.name === "file_edit" || tc2.function.name === "file_write" || tc2.function.name === "file_patch") && tc2.function.arguments?.includes(p2)) {
|
|
529309
|
+
return true;
|
|
529310
|
+
}
|
|
529311
|
+
}
|
|
529312
|
+
}
|
|
529313
|
+
}
|
|
529314
|
+
return false;
|
|
529315
|
+
} catch {
|
|
529316
|
+
return false;
|
|
529317
|
+
}
|
|
529318
|
+
})();
|
|
529319
|
+
if (name10 === "file_read" && ageTurns > AGED_FILE_READ_TURNS && content.length > 200 && !wasRecentlyWritten) {
|
|
529297
529320
|
const pathArg = (() => {
|
|
529298
529321
|
try {
|
|
529299
529322
|
const o2 = JSON.parse(tc.function.arguments || "{}");
|
|
@@ -529302,11 +529325,15 @@ ${body}`;
|
|
|
529302
529325
|
return "?";
|
|
529303
529326
|
}
|
|
529304
529327
|
})();
|
|
529305
|
-
const
|
|
529328
|
+
const lines = content.split("\n");
|
|
529329
|
+
const lineCount = lines.length;
|
|
529330
|
+
const contentPreview = content.slice(0, 500);
|
|
529306
529331
|
pending.push({
|
|
529307
529332
|
idx: resultIdx,
|
|
529308
529333
|
reason: "aged_file",
|
|
529309
|
-
replacement: `${FILE_AGED_PREFIX} path=${pathArg},
|
|
529334
|
+
replacement: `${FILE_AGED_PREFIX} path=${pathArg}, ${lineCount} lines, ${content.length} chars]
|
|
529335
|
+
${contentPreview}
|
|
529336
|
+
[End of aged file_read preview — do NOT re-read this file, use the content above]`
|
|
529310
529337
|
});
|
|
529311
529338
|
continue;
|
|
529312
529339
|
}
|
|
@@ -530113,6 +530140,61 @@ ${latest.output || ""}`.trim();
|
|
|
530113
530140
|
sections.push(`(turn ${turn} — this block is regenerated every turn from your tool history)`);
|
|
530114
530141
|
return sections.join("\n");
|
|
530115
530142
|
}
|
|
530143
|
+
/**
|
|
530144
|
+
* REG-62: Pre-call knowledge injection. Builds a concise system message
|
|
530145
|
+
* summarizing what the model has already read/searched/listed so it
|
|
530146
|
+
* doesn't re-call those tools. This is the PRIMARY fix for duplicate
|
|
530147
|
+
* tool calls — the model re-reads because it can't find prior results
|
|
530148
|
+
* in the long transcript. By injecting a summary right before the LLM
|
|
530149
|
+
* call, the model knows what it already has.
|
|
530150
|
+
*/
|
|
530151
|
+
_renderKnowledgeBlock(recentToolResults) {
|
|
530152
|
+
if (recentToolResults.size === 0)
|
|
530153
|
+
return null;
|
|
530154
|
+
const filesRead = [];
|
|
530155
|
+
const dirsListed = [];
|
|
530156
|
+
const searches = [];
|
|
530157
|
+
const shells = [];
|
|
530158
|
+
for (const [fingerprint, entry] of recentToolResults) {
|
|
530159
|
+
if (entry.compacted)
|
|
530160
|
+
continue;
|
|
530161
|
+
const colonIdx = fingerprint.indexOf(":");
|
|
530162
|
+
const toolName = colonIdx > 0 ? fingerprint.slice(0, colonIdx) : fingerprint;
|
|
530163
|
+
if (toolName === "file_read") {
|
|
530164
|
+
const pathMatch = fingerprint.match(/path=([^,\s]+)/);
|
|
530165
|
+
if (pathMatch?.[1])
|
|
530166
|
+
filesRead.push(pathMatch[1]);
|
|
530167
|
+
} else if (toolName === "list_directory") {
|
|
530168
|
+
const pathMatch = fingerprint.match(/path=([^,\s]+)/);
|
|
530169
|
+
if (pathMatch?.[1])
|
|
530170
|
+
dirsListed.push(pathMatch[1]);
|
|
530171
|
+
} else if (toolName === "grep_search" || toolName === "find_files") {
|
|
530172
|
+
searches.push(toolName);
|
|
530173
|
+
} else if (toolName === "shell" || toolName === "shell_async") {
|
|
530174
|
+
const cmdMatch = fingerprint.match(/cmd=([^,\s]+)/);
|
|
530175
|
+
shells.push(cmdMatch?.[1] ?? toolName);
|
|
530176
|
+
}
|
|
530177
|
+
}
|
|
530178
|
+
const sections = ["[KNOWLEDGE — you already have these results in context above. Do NOT re-call these tools for the same targets:]"];
|
|
530179
|
+
if (filesRead.length > 0) {
|
|
530180
|
+
const unique = [...new Set(filesRead)].slice(0, 30);
|
|
530181
|
+
sections.push(`Files already read (${unique.length}): ${unique.join(", ")}`);
|
|
530182
|
+
}
|
|
530183
|
+
if (dirsListed.length > 0) {
|
|
530184
|
+
const unique = [...new Set(dirsListed)].slice(0, 15);
|
|
530185
|
+
sections.push(`Directories already listed (${unique.length}): ${unique.join(", ")}`);
|
|
530186
|
+
}
|
|
530187
|
+
if (searches.length > 0) {
|
|
530188
|
+
sections.push(`Searches already run: ${searches.length}`);
|
|
530189
|
+
}
|
|
530190
|
+
if (shells.length > 0) {
|
|
530191
|
+
const unique = [...new Set(shells)].slice(0, 15);
|
|
530192
|
+
sections.push(`Shell commands already executed (${unique.length}): ${unique.join(", ")}`);
|
|
530193
|
+
}
|
|
530194
|
+
if (sections.length <= 1)
|
|
530195
|
+
return null;
|
|
530196
|
+
return sections.join("\n");
|
|
530197
|
+
}
|
|
530116
530198
|
makePhaseSummarizer() {
|
|
530117
530199
|
if (process.env["OA_DISABLE_PHASE_SUMMARIZER"] === "1")
|
|
530118
530200
|
return null;
|
|
@@ -530341,6 +530423,46 @@ ${blob}
|
|
|
530341
530423
|
_buildToolFingerprint(name10, args) {
|
|
530342
530424
|
return `${name10}:${this._buildExactArgsKey(args)}`;
|
|
530343
530425
|
}
|
|
530426
|
+
/**
|
|
530427
|
+
* REG-62: Build a resource-level key for semantic dedup.
|
|
530428
|
+
*
|
|
530429
|
+
* Unlike _buildToolFingerprint (exact args match), this normalizes
|
|
530430
|
+
* different calls that target the SAME resource:
|
|
530431
|
+
* file_read("foo.ts") == file_read("foo.ts", offset=10)
|
|
530432
|
+
* file_read("foo.ts") == shell("cat foo.ts")
|
|
530433
|
+
* grep_search("x", path="src") == grep_search("x", path="src", include="*.ts")
|
|
530434
|
+
*
|
|
530435
|
+
* Returns empty string if no resource key can be extracted (non-dedupable).
|
|
530436
|
+
*/
|
|
530437
|
+
_buildResourceKey(name10, args) {
|
|
530438
|
+
const a2 = args ?? {};
|
|
530439
|
+
if (name10 === "file_read") {
|
|
530440
|
+
const p2 = String(a2.path ?? a2.file ?? "");
|
|
530441
|
+
return p2 ? `resource:file:${p2}` : "";
|
|
530442
|
+
}
|
|
530443
|
+
if (name10 === "shell" || name10 === "shell_async") {
|
|
530444
|
+
const cmd = String(a2.command ?? a2.cmd ?? "");
|
|
530445
|
+
const catMatch = cmd.match(/(?:cat|head|tail|type|less|more)\s+["']?([^\s"';&|>]+)/);
|
|
530446
|
+
if (catMatch?.[1])
|
|
530447
|
+
return `resource:file:${catMatch[1]}`;
|
|
530448
|
+
return "";
|
|
530449
|
+
}
|
|
530450
|
+
if (name10 === "grep_search") {
|
|
530451
|
+
const p2 = String(a2.path ?? ".");
|
|
530452
|
+
const pat = String(a2.pattern ?? "");
|
|
530453
|
+
return `resource:grep:${p2}:${pat}`;
|
|
530454
|
+
}
|
|
530455
|
+
if (name10 === "find_files") {
|
|
530456
|
+
const p2 = String(a2.path ?? ".");
|
|
530457
|
+
const pat = String(a2.pattern ?? "");
|
|
530458
|
+
return `resource:find:${p2}:${pat}`;
|
|
530459
|
+
}
|
|
530460
|
+
if (name10 === "list_directory") {
|
|
530461
|
+
const p2 = String(a2.path ?? ".");
|
|
530462
|
+
return `resource:ls:${p2}`;
|
|
530463
|
+
}
|
|
530464
|
+
return "";
|
|
530465
|
+
}
|
|
530344
530466
|
_formatExactArgValue(value2) {
|
|
530345
530467
|
const canonical = this._canonicalArgValue(value2);
|
|
530346
530468
|
const oneLine = canonical.replace(/\r/g, "\\r").replace(/\n/g, "\\n");
|
|
@@ -532566,6 +532688,9 @@ ${memoryLines.join("\n")}`
|
|
|
532566
532688
|
const progressBlock = this._renderProgressNudgeBlock(turn);
|
|
532567
532689
|
if (progressBlock)
|
|
532568
532690
|
_injections.push(progressBlock);
|
|
532691
|
+
const knowledgeBlock = this._renderKnowledgeBlock(recentToolResults);
|
|
532692
|
+
if (knowledgeBlock)
|
|
532693
|
+
_injections.push(knowledgeBlock);
|
|
532569
532694
|
if (_injections.length > 0) {
|
|
532570
532695
|
const reqMsgs = chatRequest.messages;
|
|
532571
532696
|
if (Array.isArray(reqMsgs)) {
|
|
@@ -579023,12 +579148,9 @@ sleep 1
|
|
|
579023
579148
|
if (ctx3.isBlessed?.()) {
|
|
579024
579149
|
ctx3.blessStop?.();
|
|
579025
579150
|
}
|
|
579026
|
-
if (ctx3.isTelegramActive?.()) {
|
|
579027
|
-
ctx3.telegramStop?.();
|
|
579028
|
-
}
|
|
579029
579151
|
const clearedQueue = ctx3.clearQueuedPrompts?.() ?? 0;
|
|
579030
579152
|
if (!ctx3.hasActiveTask?.()) {
|
|
579031
|
-
if (!ctx3.isBlessed?.()
|
|
579153
|
+
if (!ctx3.isBlessed?.()) {
|
|
579032
579154
|
renderWarning(clearedQueue > 0 ? `No active task to stop. Cleared ${clearedQueue} queued prompt(s).` : "No active task to stop.");
|
|
579033
579155
|
}
|
|
579034
579156
|
return "handled";
|
|
@@ -588195,19 +588317,21 @@ After synthesis, call task_complete with the final prioritized summary.`,
|
|
|
588195
588317
|
new GrepSearchTool(this.repoRoot),
|
|
588196
588318
|
new GlobFindTool(this.repoRoot),
|
|
588197
588319
|
new MemoryReadTool(this.repoRoot),
|
|
588198
|
-
new MemorySearchTool(this.repoRoot)
|
|
588320
|
+
new MemorySearchTool(this.repoRoot),
|
|
588321
|
+
new MemoryWriteTool(this.repoRoot)
|
|
588199
588322
|
];
|
|
588200
|
-
return [...tools.map(adaptTool2), taskComplete];
|
|
588323
|
+
return [...tools.map(adaptTool2), this.createDreamTodoWriteTool(), this.createDreamWorkingNotesTool(), taskComplete];
|
|
588201
588324
|
}
|
|
588202
588325
|
case "monitor": {
|
|
588203
588326
|
const tools = [
|
|
588204
588327
|
new FileReadTool(this.repoRoot),
|
|
588205
588328
|
new DreamShellTool(this.repoRoot),
|
|
588206
588329
|
// read-only shell
|
|
588207
|
-
new AutoresearchTool(this.repoRoot)
|
|
588330
|
+
new AutoresearchTool(this.repoRoot),
|
|
588208
588331
|
// status-only in prompt
|
|
588332
|
+
new MemoryReadTool(this.repoRoot)
|
|
588209
588333
|
];
|
|
588210
|
-
return [...tools.map(adaptTool2), taskComplete];
|
|
588334
|
+
return [...tools.map(adaptTool2), this.createDreamTodoWriteTool(), taskComplete];
|
|
588211
588335
|
}
|
|
588212
588336
|
case "evaluator": {
|
|
588213
588337
|
const tools = [
|
|
@@ -588219,7 +588343,7 @@ After synthesis, call task_complete with the final prioritized summary.`,
|
|
|
588219
588343
|
new MemoryWriteTool(this.repoRoot),
|
|
588220
588344
|
new GrepSearchTool(this.repoRoot)
|
|
588221
588345
|
];
|
|
588222
|
-
return [...tools.map(adaptTool2), taskComplete];
|
|
588346
|
+
return [...tools.map(adaptTool2), this.createDreamTodoWriteTool(), this.createDreamWorkingNotesTool(), taskComplete];
|
|
588223
588347
|
}
|
|
588224
588348
|
case "critic": {
|
|
588225
588349
|
const tools = [
|
|
@@ -588228,7 +588352,7 @@ After synthesis, call task_complete with the final prioritized summary.`,
|
|
|
588228
588352
|
new MemorySearchTool(this.repoRoot),
|
|
588229
588353
|
new GrepSearchTool(this.repoRoot)
|
|
588230
588354
|
];
|
|
588231
|
-
return [...tools.map(adaptTool2), taskComplete];
|
|
588355
|
+
return [...tools.map(adaptTool2), this.createDreamTodoWriteTool(), taskComplete];
|
|
588232
588356
|
}
|
|
588233
588357
|
case "flow_maintainer": {
|
|
588234
588358
|
const tools = [
|
|
@@ -588236,7 +588360,7 @@ After synthesis, call task_complete with the final prioritized summary.`,
|
|
|
588236
588360
|
new MemoryWriteTool(this.repoRoot),
|
|
588237
588361
|
new MemorySearchTool(this.repoRoot)
|
|
588238
588362
|
];
|
|
588239
|
-
return [...tools.map(adaptTool2), taskComplete];
|
|
588363
|
+
return [...tools.map(adaptTool2), this.createDreamTodoWriteTool(), this.createDreamWorkingNotesTool(), taskComplete];
|
|
588240
588364
|
}
|
|
588241
588365
|
}
|
|
588242
588366
|
}
|
|
@@ -588613,6 +588737,13 @@ ${summaryResult}
|
|
|
588613
588737
|
}
|
|
588614
588738
|
/** Build tools appropriate for the dream mode */
|
|
588615
588739
|
buildDreamTools(toolMode) {
|
|
588740
|
+
const memoryAndPlanTools = [
|
|
588741
|
+
new MemoryReadTool(this.repoRoot),
|
|
588742
|
+
new MemoryWriteTool(this.repoRoot),
|
|
588743
|
+
new MemorySearchTool(this.repoRoot)
|
|
588744
|
+
].map(adaptTool2);
|
|
588745
|
+
const todoWriteTool = this.createDreamTodoWriteTool();
|
|
588746
|
+
const workingNotesTool = this.createDreamWorkingNotesTool();
|
|
588616
588747
|
if (toolMode === "full") {
|
|
588617
588748
|
const tools = [
|
|
588618
588749
|
new FileReadTool(this.repoRoot),
|
|
@@ -588630,6 +588761,9 @@ ${summaryResult}
|
|
|
588630
588761
|
];
|
|
588631
588762
|
return [
|
|
588632
588763
|
...tools.map(adaptTool2),
|
|
588764
|
+
...memoryAndPlanTools,
|
|
588765
|
+
todoWriteTool,
|
|
588766
|
+
workingNotesTool,
|
|
588633
588767
|
this.createTaskCompleteTool()
|
|
588634
588768
|
];
|
|
588635
588769
|
}
|
|
@@ -588650,9 +588784,113 @@ ${summaryResult}
|
|
|
588650
588784
|
return [
|
|
588651
588785
|
...readTools.map(adaptTool2),
|
|
588652
588786
|
...dreamWriteTools.map(adaptTool2),
|
|
588787
|
+
...memoryAndPlanTools,
|
|
588788
|
+
todoWriteTool,
|
|
588789
|
+
workingNotesTool,
|
|
588653
588790
|
this.createTaskCompleteTool()
|
|
588654
588791
|
];
|
|
588655
588792
|
}
|
|
588793
|
+
/** Dream-scoped todo_write — persists to .oa/dreams/todo-state.json */
|
|
588794
|
+
createDreamTodoWriteTool() {
|
|
588795
|
+
const todoPath3 = join114(this.dreamsDir, "todo-state.json");
|
|
588796
|
+
return {
|
|
588797
|
+
name: "todo_write",
|
|
588798
|
+
description: "Update the task checklist for this dream session. Mark items in_progress/completed/pending as you work through stages.",
|
|
588799
|
+
parameters: {
|
|
588800
|
+
type: "object",
|
|
588801
|
+
properties: {
|
|
588802
|
+
todos: {
|
|
588803
|
+
type: "array",
|
|
588804
|
+
description: "Full list of todo items for this dream session",
|
|
588805
|
+
items: {
|
|
588806
|
+
type: "object",
|
|
588807
|
+
properties: {
|
|
588808
|
+
id: { type: "string", description: "Stable id for this item" },
|
|
588809
|
+
content: { type: "string", description: "What needs to be done" },
|
|
588810
|
+
status: { type: "string", enum: ["pending", "in_progress", "completed", "blocked"] }
|
|
588811
|
+
},
|
|
588812
|
+
required: ["content", "status"]
|
|
588813
|
+
}
|
|
588814
|
+
}
|
|
588815
|
+
},
|
|
588816
|
+
required: ["todos"]
|
|
588817
|
+
},
|
|
588818
|
+
async execute(args) {
|
|
588819
|
+
const todos = args["todos"];
|
|
588820
|
+
if (!Array.isArray(todos)) {
|
|
588821
|
+
return { success: false, output: "", error: "todos must be an array" };
|
|
588822
|
+
}
|
|
588823
|
+
try {
|
|
588824
|
+
writeFileSync52(todoPath3, JSON.stringify({ todos, updatedAt: (/* @__PURE__ */ new Date()).toISOString() }, null, 2), "utf-8");
|
|
588825
|
+
const summary = todos.map(
|
|
588826
|
+
(t2, i2) => ` ${t2.status === "completed" ? "✓" : t2.status === "in_progress" ? "▶" : "◯"} ${i2 + 1}: ${t2.content || "(untitled)"}`
|
|
588827
|
+
).join("\n");
|
|
588828
|
+
return { success: true, output: `Todo list updated (${todos.length} items):
|
|
588829
|
+
${summary}` };
|
|
588830
|
+
} catch (err) {
|
|
588831
|
+
return { success: false, output: "", error: String(err) };
|
|
588832
|
+
}
|
|
588833
|
+
}
|
|
588834
|
+
};
|
|
588835
|
+
}
|
|
588836
|
+
/** Dream-scoped working_notes — persists to .oa/dreams/working-notes.json */
|
|
588837
|
+
createDreamWorkingNotesTool() {
|
|
588838
|
+
const notesPath = join114(this.dreamsDir, "working-notes.json");
|
|
588839
|
+
return {
|
|
588840
|
+
name: "working_notes",
|
|
588841
|
+
description: "Track discoveries, decisions, and findings across dream stages. Notes persist within this dream session.",
|
|
588842
|
+
parameters: {
|
|
588843
|
+
type: "object",
|
|
588844
|
+
properties: {
|
|
588845
|
+
action: {
|
|
588846
|
+
type: "string",
|
|
588847
|
+
enum: ["add", "list", "search", "clear", "summary"],
|
|
588848
|
+
description: "Action to perform (default: list)"
|
|
588849
|
+
},
|
|
588850
|
+
content: { type: "string", description: "Note content (for add action)" },
|
|
588851
|
+
category: {
|
|
588852
|
+
type: "string",
|
|
588853
|
+
enum: ["finding", "todo", "question", "decision", "blocker"],
|
|
588854
|
+
description: "Note category (for add action, default: finding)"
|
|
588855
|
+
}
|
|
588856
|
+
}
|
|
588857
|
+
},
|
|
588858
|
+
async execute(args) {
|
|
588859
|
+
const action = args["action"] || "list";
|
|
588860
|
+
try {
|
|
588861
|
+
let notes2 = [];
|
|
588862
|
+
if (existsSync97(notesPath)) {
|
|
588863
|
+
notes2 = JSON.parse(readFileSync80(notesPath, "utf-8"));
|
|
588864
|
+
}
|
|
588865
|
+
if (action === "add") {
|
|
588866
|
+
const note = {
|
|
588867
|
+
content: String(args["content"] ?? ""),
|
|
588868
|
+
category: String(args["category"] ?? "finding"),
|
|
588869
|
+
addedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
588870
|
+
};
|
|
588871
|
+
notes2.push(note);
|
|
588872
|
+
writeFileSync52(notesPath, JSON.stringify(notes2, null, 2), "utf-8");
|
|
588873
|
+
return { success: true, output: `Note added: [${note.category}] ${note.content.slice(0, 80)}` };
|
|
588874
|
+
}
|
|
588875
|
+
if (action === "clear") {
|
|
588876
|
+
writeFileSync52(notesPath, "[]", "utf-8");
|
|
588877
|
+
return { success: true, output: "All notes cleared." };
|
|
588878
|
+
}
|
|
588879
|
+
if (action === "search") {
|
|
588880
|
+
const q = String(args["content"] ?? "").toLowerCase();
|
|
588881
|
+
const matches = notes2.filter((n2) => n2.content.toLowerCase().includes(q));
|
|
588882
|
+
return { success: true, output: matches.length ? matches.map((n2) => `[${n2.category}] ${n2.content}`).join("\n") : "No matching notes." };
|
|
588883
|
+
}
|
|
588884
|
+
if (notes2.length === 0) {
|
|
588885
|
+
return { success: true, output: "No working notes yet." };
|
|
588886
|
+
}
|
|
588887
|
+
return { success: true, output: notes2.map((n2) => `[${n2.category}] ${n2.content}`).join("\n") };
|
|
588888
|
+
} catch (err) {
|
|
588889
|
+
return { success: false, output: "", error: String(err) };
|
|
588890
|
+
}
|
|
588891
|
+
}
|
|
588892
|
+
};
|
|
588893
|
+
}
|
|
588656
588894
|
createTaskCompleteTool() {
|
|
588657
588895
|
return {
|
|
588658
588896
|
name: "task_complete",
|
|
@@ -588832,6 +589070,8 @@ ${files.map((f2) => `- [\`${f2}\`](./${f2})`).join("\n")}
|
|
|
588832
589070
|
parameters: t2.parameters,
|
|
588833
589071
|
execute: t2.execute.bind(t2)
|
|
588834
589072
|
}));
|
|
589073
|
+
tools.push(this.createDreamTodoWriteTool());
|
|
589074
|
+
tools.push(this.createDreamWorkingNotesTool());
|
|
588835
589075
|
tools.push({
|
|
588836
589076
|
name: "task_complete",
|
|
588837
589077
|
description: "Signal consolidation is done. Args: {summary: string}",
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "open-agents-ai",
|
|
3
|
-
"version": "0.187.
|
|
3
|
+
"version": "0.187.589",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "open-agents-ai",
|
|
9
|
-
"version": "0.187.
|
|
9
|
+
"version": "0.187.589",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "CC-BY-NC-4.0",
|
|
12
12
|
"dependencies": {
|
|
@@ -1914,12 +1914,12 @@
|
|
|
1914
1914
|
}
|
|
1915
1915
|
},
|
|
1916
1916
|
"node_modules/@types/node": {
|
|
1917
|
-
"version": "25.
|
|
1918
|
-
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.
|
|
1919
|
-
"integrity": "sha512-
|
|
1917
|
+
"version": "25.8.0",
|
|
1918
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.8.0.tgz",
|
|
1919
|
+
"integrity": "sha512-TCFSk8IZh+iLX1xtksoBVtdmgL+1IX0fC9BeU4QqFSuNdN/K+HUlhqOzEmSYYpZUVsLYcPqc9KX+60iDuninSQ==",
|
|
1920
1920
|
"license": "MIT",
|
|
1921
1921
|
"dependencies": {
|
|
1922
|
-
"undici-types": "
|
|
1922
|
+
"undici-types": ">=7.24.0 <7.24.7"
|
|
1923
1923
|
}
|
|
1924
1924
|
},
|
|
1925
1925
|
"node_modules/@types/sinon": {
|
|
@@ -6994,9 +6994,9 @@
|
|
|
6994
6994
|
}
|
|
6995
6995
|
},
|
|
6996
6996
|
"node_modules/undici-types": {
|
|
6997
|
-
"version": "7.
|
|
6998
|
-
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.
|
|
6999
|
-
"integrity": "sha512-
|
|
6997
|
+
"version": "7.24.6",
|
|
6998
|
+
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz",
|
|
6999
|
+
"integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==",
|
|
7000
7000
|
"license": "MIT"
|
|
7001
7001
|
},
|
|
7002
7002
|
"node_modules/unlimited-timeout": {
|
package/package.json
CHANGED