open-agents-ai 0.187.588 → 0.187.590
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 +148 -8
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -529296,6 +529296,21 @@ ${body}`;
|
|
|
529296
529296
|
continue;
|
|
529297
529297
|
}
|
|
529298
529298
|
seen.set(fp, { turn: scanTurn, idx: resultIdx });
|
|
529299
|
+
const rkey = this._buildResourceKey(name10, parsedArgs);
|
|
529300
|
+
if (rkey) {
|
|
529301
|
+
const priorResource = seenResource.get(rkey);
|
|
529302
|
+
if (priorResource && priorResource.idx !== resultIdx) {
|
|
529303
|
+
const priorContent = typeof messages2[priorResource.idx]?.content === "string" ? messages2[priorResource.idx].content : "";
|
|
529304
|
+
if (!priorContent.startsWith(PRUNE_PREFIX) && !priorContent.startsWith(DEDUPE_PREFIX) && !priorContent.startsWith(FILE_AGED_PREFIX)) {
|
|
529305
|
+
pending.push({
|
|
529306
|
+
idx: priorResource.idx,
|
|
529307
|
+
reason: "dedupe",
|
|
529308
|
+
replacement: `${DEDUPE_PREFIX} ${scanTurn} — semantic duplicate ${name10}() (same resource: ${rkey})]`
|
|
529309
|
+
});
|
|
529310
|
+
}
|
|
529311
|
+
}
|
|
529312
|
+
seenResource.set(rkey, { turn: scanTurn, idx: resultIdx });
|
|
529313
|
+
}
|
|
529299
529314
|
const ageTurns = currentTurn - scanTurn;
|
|
529300
529315
|
const wasRecentlyWritten = (() => {
|
|
529301
529316
|
try {
|
|
@@ -530438,7 +530453,14 @@ ${blob}
|
|
|
530438
530453
|
const a2 = args ?? {};
|
|
530439
530454
|
if (name10 === "file_read") {
|
|
530440
530455
|
const p2 = String(a2.path ?? a2.file ?? "");
|
|
530441
|
-
|
|
530456
|
+
if (!p2)
|
|
530457
|
+
return "";
|
|
530458
|
+
const offset = a2.offset != null ? Number(a2.offset) : void 0;
|
|
530459
|
+
const limit = a2.limit != null ? Number(a2.limit) : void 0;
|
|
530460
|
+
if (offset !== void 0 || limit !== void 0) {
|
|
530461
|
+
return `resource:file:${p2}@${offset ?? 0}:${limit ?? "end"}`;
|
|
530462
|
+
}
|
|
530463
|
+
return `resource:file:${p2}`;
|
|
530442
530464
|
}
|
|
530443
530465
|
if (name10 === "shell" || name10 === "shell_async") {
|
|
530444
530466
|
const cmd = String(a2.command ?? a2.cmd ?? "");
|
|
@@ -588317,19 +588339,21 @@ After synthesis, call task_complete with the final prioritized summary.`,
|
|
|
588317
588339
|
new GrepSearchTool(this.repoRoot),
|
|
588318
588340
|
new GlobFindTool(this.repoRoot),
|
|
588319
588341
|
new MemoryReadTool(this.repoRoot),
|
|
588320
|
-
new MemorySearchTool(this.repoRoot)
|
|
588342
|
+
new MemorySearchTool(this.repoRoot),
|
|
588343
|
+
new MemoryWriteTool(this.repoRoot)
|
|
588321
588344
|
];
|
|
588322
|
-
return [...tools.map(adaptTool2), taskComplete];
|
|
588345
|
+
return [...tools.map(adaptTool2), this.createDreamTodoWriteTool(), this.createDreamWorkingNotesTool(), taskComplete];
|
|
588323
588346
|
}
|
|
588324
588347
|
case "monitor": {
|
|
588325
588348
|
const tools = [
|
|
588326
588349
|
new FileReadTool(this.repoRoot),
|
|
588327
588350
|
new DreamShellTool(this.repoRoot),
|
|
588328
588351
|
// read-only shell
|
|
588329
|
-
new AutoresearchTool(this.repoRoot)
|
|
588352
|
+
new AutoresearchTool(this.repoRoot),
|
|
588330
588353
|
// status-only in prompt
|
|
588354
|
+
new MemoryReadTool(this.repoRoot)
|
|
588331
588355
|
];
|
|
588332
|
-
return [...tools.map(adaptTool2), taskComplete];
|
|
588356
|
+
return [...tools.map(adaptTool2), this.createDreamTodoWriteTool(), taskComplete];
|
|
588333
588357
|
}
|
|
588334
588358
|
case "evaluator": {
|
|
588335
588359
|
const tools = [
|
|
@@ -588341,7 +588365,7 @@ After synthesis, call task_complete with the final prioritized summary.`,
|
|
|
588341
588365
|
new MemoryWriteTool(this.repoRoot),
|
|
588342
588366
|
new GrepSearchTool(this.repoRoot)
|
|
588343
588367
|
];
|
|
588344
|
-
return [...tools.map(adaptTool2), taskComplete];
|
|
588368
|
+
return [...tools.map(adaptTool2), this.createDreamTodoWriteTool(), this.createDreamWorkingNotesTool(), taskComplete];
|
|
588345
588369
|
}
|
|
588346
588370
|
case "critic": {
|
|
588347
588371
|
const tools = [
|
|
@@ -588350,7 +588374,7 @@ After synthesis, call task_complete with the final prioritized summary.`,
|
|
|
588350
588374
|
new MemorySearchTool(this.repoRoot),
|
|
588351
588375
|
new GrepSearchTool(this.repoRoot)
|
|
588352
588376
|
];
|
|
588353
|
-
return [...tools.map(adaptTool2), taskComplete];
|
|
588377
|
+
return [...tools.map(adaptTool2), this.createDreamTodoWriteTool(), taskComplete];
|
|
588354
588378
|
}
|
|
588355
588379
|
case "flow_maintainer": {
|
|
588356
588380
|
const tools = [
|
|
@@ -588358,7 +588382,7 @@ After synthesis, call task_complete with the final prioritized summary.`,
|
|
|
588358
588382
|
new MemoryWriteTool(this.repoRoot),
|
|
588359
588383
|
new MemorySearchTool(this.repoRoot)
|
|
588360
588384
|
];
|
|
588361
|
-
return [...tools.map(adaptTool2), taskComplete];
|
|
588385
|
+
return [...tools.map(adaptTool2), this.createDreamTodoWriteTool(), this.createDreamWorkingNotesTool(), taskComplete];
|
|
588362
588386
|
}
|
|
588363
588387
|
}
|
|
588364
588388
|
}
|
|
@@ -588735,6 +588759,13 @@ ${summaryResult}
|
|
|
588735
588759
|
}
|
|
588736
588760
|
/** Build tools appropriate for the dream mode */
|
|
588737
588761
|
buildDreamTools(toolMode) {
|
|
588762
|
+
const memoryAndPlanTools = [
|
|
588763
|
+
new MemoryReadTool(this.repoRoot),
|
|
588764
|
+
new MemoryWriteTool(this.repoRoot),
|
|
588765
|
+
new MemorySearchTool(this.repoRoot)
|
|
588766
|
+
].map(adaptTool2);
|
|
588767
|
+
const todoWriteTool = this.createDreamTodoWriteTool();
|
|
588768
|
+
const workingNotesTool = this.createDreamWorkingNotesTool();
|
|
588738
588769
|
if (toolMode === "full") {
|
|
588739
588770
|
const tools = [
|
|
588740
588771
|
new FileReadTool(this.repoRoot),
|
|
@@ -588752,6 +588783,9 @@ ${summaryResult}
|
|
|
588752
588783
|
];
|
|
588753
588784
|
return [
|
|
588754
588785
|
...tools.map(adaptTool2),
|
|
588786
|
+
...memoryAndPlanTools,
|
|
588787
|
+
todoWriteTool,
|
|
588788
|
+
workingNotesTool,
|
|
588755
588789
|
this.createTaskCompleteTool()
|
|
588756
588790
|
];
|
|
588757
588791
|
}
|
|
@@ -588772,9 +588806,113 @@ ${summaryResult}
|
|
|
588772
588806
|
return [
|
|
588773
588807
|
...readTools.map(adaptTool2),
|
|
588774
588808
|
...dreamWriteTools.map(adaptTool2),
|
|
588809
|
+
...memoryAndPlanTools,
|
|
588810
|
+
todoWriteTool,
|
|
588811
|
+
workingNotesTool,
|
|
588775
588812
|
this.createTaskCompleteTool()
|
|
588776
588813
|
];
|
|
588777
588814
|
}
|
|
588815
|
+
/** Dream-scoped todo_write — persists to .oa/dreams/todo-state.json */
|
|
588816
|
+
createDreamTodoWriteTool() {
|
|
588817
|
+
const todoPath3 = join114(this.dreamsDir, "todo-state.json");
|
|
588818
|
+
return {
|
|
588819
|
+
name: "todo_write",
|
|
588820
|
+
description: "Update the task checklist for this dream session. Mark items in_progress/completed/pending as you work through stages.",
|
|
588821
|
+
parameters: {
|
|
588822
|
+
type: "object",
|
|
588823
|
+
properties: {
|
|
588824
|
+
todos: {
|
|
588825
|
+
type: "array",
|
|
588826
|
+
description: "Full list of todo items for this dream session",
|
|
588827
|
+
items: {
|
|
588828
|
+
type: "object",
|
|
588829
|
+
properties: {
|
|
588830
|
+
id: { type: "string", description: "Stable id for this item" },
|
|
588831
|
+
content: { type: "string", description: "What needs to be done" },
|
|
588832
|
+
status: { type: "string", enum: ["pending", "in_progress", "completed", "blocked"] }
|
|
588833
|
+
},
|
|
588834
|
+
required: ["content", "status"]
|
|
588835
|
+
}
|
|
588836
|
+
}
|
|
588837
|
+
},
|
|
588838
|
+
required: ["todos"]
|
|
588839
|
+
},
|
|
588840
|
+
async execute(args) {
|
|
588841
|
+
const todos = args["todos"];
|
|
588842
|
+
if (!Array.isArray(todos)) {
|
|
588843
|
+
return { success: false, output: "", error: "todos must be an array" };
|
|
588844
|
+
}
|
|
588845
|
+
try {
|
|
588846
|
+
writeFileSync52(todoPath3, JSON.stringify({ todos, updatedAt: (/* @__PURE__ */ new Date()).toISOString() }, null, 2), "utf-8");
|
|
588847
|
+
const summary = todos.map(
|
|
588848
|
+
(t2, i2) => ` ${t2.status === "completed" ? "✓" : t2.status === "in_progress" ? "▶" : "◯"} ${i2 + 1}: ${t2.content || "(untitled)"}`
|
|
588849
|
+
).join("\n");
|
|
588850
|
+
return { success: true, output: `Todo list updated (${todos.length} items):
|
|
588851
|
+
${summary}` };
|
|
588852
|
+
} catch (err) {
|
|
588853
|
+
return { success: false, output: "", error: String(err) };
|
|
588854
|
+
}
|
|
588855
|
+
}
|
|
588856
|
+
};
|
|
588857
|
+
}
|
|
588858
|
+
/** Dream-scoped working_notes — persists to .oa/dreams/working-notes.json */
|
|
588859
|
+
createDreamWorkingNotesTool() {
|
|
588860
|
+
const notesPath = join114(this.dreamsDir, "working-notes.json");
|
|
588861
|
+
return {
|
|
588862
|
+
name: "working_notes",
|
|
588863
|
+
description: "Track discoveries, decisions, and findings across dream stages. Notes persist within this dream session.",
|
|
588864
|
+
parameters: {
|
|
588865
|
+
type: "object",
|
|
588866
|
+
properties: {
|
|
588867
|
+
action: {
|
|
588868
|
+
type: "string",
|
|
588869
|
+
enum: ["add", "list", "search", "clear", "summary"],
|
|
588870
|
+
description: "Action to perform (default: list)"
|
|
588871
|
+
},
|
|
588872
|
+
content: { type: "string", description: "Note content (for add action)" },
|
|
588873
|
+
category: {
|
|
588874
|
+
type: "string",
|
|
588875
|
+
enum: ["finding", "todo", "question", "decision", "blocker"],
|
|
588876
|
+
description: "Note category (for add action, default: finding)"
|
|
588877
|
+
}
|
|
588878
|
+
}
|
|
588879
|
+
},
|
|
588880
|
+
async execute(args) {
|
|
588881
|
+
const action = args["action"] || "list";
|
|
588882
|
+
try {
|
|
588883
|
+
let notes2 = [];
|
|
588884
|
+
if (existsSync97(notesPath)) {
|
|
588885
|
+
notes2 = JSON.parse(readFileSync80(notesPath, "utf-8"));
|
|
588886
|
+
}
|
|
588887
|
+
if (action === "add") {
|
|
588888
|
+
const note = {
|
|
588889
|
+
content: String(args["content"] ?? ""),
|
|
588890
|
+
category: String(args["category"] ?? "finding"),
|
|
588891
|
+
addedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
588892
|
+
};
|
|
588893
|
+
notes2.push(note);
|
|
588894
|
+
writeFileSync52(notesPath, JSON.stringify(notes2, null, 2), "utf-8");
|
|
588895
|
+
return { success: true, output: `Note added: [${note.category}] ${note.content.slice(0, 80)}` };
|
|
588896
|
+
}
|
|
588897
|
+
if (action === "clear") {
|
|
588898
|
+
writeFileSync52(notesPath, "[]", "utf-8");
|
|
588899
|
+
return { success: true, output: "All notes cleared." };
|
|
588900
|
+
}
|
|
588901
|
+
if (action === "search") {
|
|
588902
|
+
const q = String(args["content"] ?? "").toLowerCase();
|
|
588903
|
+
const matches = notes2.filter((n2) => n2.content.toLowerCase().includes(q));
|
|
588904
|
+
return { success: true, output: matches.length ? matches.map((n2) => `[${n2.category}] ${n2.content}`).join("\n") : "No matching notes." };
|
|
588905
|
+
}
|
|
588906
|
+
if (notes2.length === 0) {
|
|
588907
|
+
return { success: true, output: "No working notes yet." };
|
|
588908
|
+
}
|
|
588909
|
+
return { success: true, output: notes2.map((n2) => `[${n2.category}] ${n2.content}`).join("\n") };
|
|
588910
|
+
} catch (err) {
|
|
588911
|
+
return { success: false, output: "", error: String(err) };
|
|
588912
|
+
}
|
|
588913
|
+
}
|
|
588914
|
+
};
|
|
588915
|
+
}
|
|
588778
588916
|
createTaskCompleteTool() {
|
|
588779
588917
|
return {
|
|
588780
588918
|
name: "task_complete",
|
|
@@ -588954,6 +589092,8 @@ ${files.map((f2) => `- [\`${f2}\`](./${f2})`).join("\n")}
|
|
|
588954
589092
|
parameters: t2.parameters,
|
|
588955
589093
|
execute: t2.execute.bind(t2)
|
|
588956
589094
|
}));
|
|
589095
|
+
tools.push(this.createDreamTodoWriteTool());
|
|
589096
|
+
tools.push(this.createDreamWorkingNotesTool());
|
|
588957
589097
|
tools.push({
|
|
588958
589098
|
name: "task_complete",
|
|
588959
589099
|
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.590",
|
|
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.590",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "CC-BY-NC-4.0",
|
|
12
12
|
"dependencies": {
|
package/package.json
CHANGED