open-agents-ai 0.187.181 → 0.187.182
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 +62 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -265356,6 +265356,45 @@ var init_ralphLoop = __esm({
|
|
|
265356
265356
|
}
|
|
265357
265357
|
});
|
|
265358
265358
|
|
|
265359
|
+
// packages/orchestrator/dist/textSanitize.js
|
|
265360
|
+
function cleanScaffolding(text) {
|
|
265361
|
+
if (text == null)
|
|
265362
|
+
return "";
|
|
265363
|
+
let out = String(text);
|
|
265364
|
+
out = out.replace(SIGNPOST_RE, "");
|
|
265365
|
+
out = out.replace(RESTORED_BLOCK_RE, "");
|
|
265366
|
+
out = out.replace(NEW_TASK_RE, "");
|
|
265367
|
+
out = out.replace(SYSTEM_BLOCK_RE, "");
|
|
265368
|
+
return out.trim();
|
|
265369
|
+
}
|
|
265370
|
+
function stripThinkTags(text) {
|
|
265371
|
+
if (text == null)
|
|
265372
|
+
return "";
|
|
265373
|
+
return String(text).replace(THINK_BLOCK_RE, "").trim();
|
|
265374
|
+
}
|
|
265375
|
+
function cleanForStorage(text) {
|
|
265376
|
+
if (text == null)
|
|
265377
|
+
return "";
|
|
265378
|
+
let out = String(text);
|
|
265379
|
+
out = cleanScaffolding(out);
|
|
265380
|
+
out = stripThinkTags(out);
|
|
265381
|
+
out = out.replace(ANSI_ESCAPE_RE, "");
|
|
265382
|
+
out = out.replace(/\s+/g, " ").trim();
|
|
265383
|
+
return out;
|
|
265384
|
+
}
|
|
265385
|
+
var SIGNPOST_RE, NEW_TASK_RE, RESTORED_BLOCK_RE, SYSTEM_BLOCK_RE, THINK_BLOCK_RE, ANSI_ESCAPE_RE;
|
|
265386
|
+
var init_textSanitize = __esm({
|
|
265387
|
+
"packages/orchestrator/dist/textSanitize.js"() {
|
|
265388
|
+
"use strict";
|
|
265389
|
+
SIGNPOST_RE = /^\[Previous sessions exist[^\]]*\]\s*\n*/m;
|
|
265390
|
+
NEW_TASK_RE = /^NEW TASK:\s*/m;
|
|
265391
|
+
RESTORED_BLOCK_RE = /^[\s\S]*?\n---\s*\n\s*NEW TASK:\s*/m;
|
|
265392
|
+
SYSTEM_BLOCK_RE = /^<system>[\s\S]*?<\/system>\s*\n*/m;
|
|
265393
|
+
THINK_BLOCK_RE = /<think>[\s\S]*?<\/think>/g;
|
|
265394
|
+
ANSI_ESCAPE_RE = /\x1b\[[0-9;]*[a-zA-Z]|\x1b\][^\x07]*\x07/g;
|
|
265395
|
+
}
|
|
265396
|
+
});
|
|
265397
|
+
|
|
265359
265398
|
// packages/orchestrator/dist/personality.js
|
|
265360
265399
|
function compilePersonalityPrompt(profile, presetName) {
|
|
265361
265400
|
if (presetName === "stark") {
|
|
@@ -267638,6 +267677,7 @@ var SYSTEM_PROMPT, SYSTEM_PROMPT_MEDIUM, SYSTEM_PROMPT_SMALL, AgenticRunner, Oll
|
|
|
267638
267677
|
var init_agenticRunner = __esm({
|
|
267639
267678
|
"packages/orchestrator/dist/agenticRunner.js"() {
|
|
267640
267679
|
"use strict";
|
|
267680
|
+
init_textSanitize();
|
|
267641
267681
|
init_dist();
|
|
267642
267682
|
init_personality();
|
|
267643
267683
|
init_promptLoader();
|
|
@@ -268279,6 +268319,7 @@ Respond with your assessment, then take action.`;
|
|
|
268279
268319
|
if (typeof this.backend.setAbortSignal === "function") {
|
|
268280
268320
|
this.backend.setAbortSignal(this._abortController.signal);
|
|
268281
268321
|
}
|
|
268322
|
+
const cleanedTask = cleanForStorage(task) || task.slice(0, 500);
|
|
268282
268323
|
const start2 = Date.now();
|
|
268283
268324
|
const taskTimeoutMs = this.options.taskTimeoutMs;
|
|
268284
268325
|
const selfEvalInterval = taskTimeoutMs;
|
|
@@ -268328,7 +268369,7 @@ Respond with your assessment, then take action.`;
|
|
|
268328
268369
|
this._pauseResolve = null;
|
|
268329
268370
|
this.pendingUserMessages.length = 0;
|
|
268330
268371
|
this._taskState = {
|
|
268331
|
-
goal:
|
|
268372
|
+
goal: cleanedTask.slice(0, 500),
|
|
268332
268373
|
completedSteps: [],
|
|
268333
268374
|
pendingSteps: [],
|
|
268334
268375
|
currentStep: "",
|
|
@@ -268652,7 +268693,7 @@ If you're stuck, try a completely different approach. Do NOT repeat what failed
|
|
|
268652
268693
|
}
|
|
268653
268694
|
if (turn > 0 && turn % 3 === 0 && this._temporalGraph && this._episodeStore) {
|
|
268654
268695
|
try {
|
|
268655
|
-
const taskGoal = this._taskState.goal ||
|
|
268696
|
+
const taskGoal = this._taskState.goal || cleanedTask.slice(0, 200);
|
|
268656
268697
|
const pprResult = retrieveByPPR(taskGoal, this._temporalGraph, this._episodeStore, { topK: 3 });
|
|
268657
268698
|
if (pprResult.episodes.length > 0) {
|
|
268658
268699
|
const memoryLines = pprResult.episodes.map(({ episode, pprScore, matchedNodes }) => `- [${episode.toolName ?? episode.modality}] ${episode.content.slice(0, 120)} (via: ${matchedNodes.slice(0, 2).join(", ")})`);
|
|
@@ -269907,7 +269948,7 @@ Full content available via: repl_exec(code="data = retrieve('${handleId}')") or
|
|
|
269907
269948
|
};
|
|
269908
269949
|
const consolidation = {
|
|
269909
269950
|
sessionId: this._sessionId,
|
|
269910
|
-
task:
|
|
269951
|
+
task: cleanedTask.slice(0, 500),
|
|
269911
269952
|
outcome: completed ? "success" : this.aborted ? "aborted" : "timeout",
|
|
269912
269953
|
turns: messages2.filter((m2) => m2.role === "assistant").length,
|
|
269913
269954
|
toolsUsed: [...new Set(toolCallLog.map((tc) => tc.name))],
|
|
@@ -269926,7 +269967,7 @@ Full content available via: repl_exec(code="data = retrieve('${handleId}')") or
|
|
|
269926
269967
|
fs4.mkdirSync(provenanceDir, { recursive: true });
|
|
269927
269968
|
const provenanceGraph = {
|
|
269928
269969
|
sessionId: this._sessionId,
|
|
269929
|
-
task:
|
|
269970
|
+
task: cleanedTask.slice(0, 500),
|
|
269930
269971
|
outcome: consolidation.outcome,
|
|
269931
269972
|
timestamp: consolidation.timestamp,
|
|
269932
269973
|
// Full action trace — every tool call with sequence ordering
|
|
@@ -269970,7 +270011,7 @@ Full content available via: repl_exec(code="data = retrieve('${handleId}')") or
|
|
|
269970
270011
|
fs4.writeFileSync(path5.join(provenanceDir, `${this._sessionId}.json`), JSON.stringify(provenanceGraph, null, 2));
|
|
269971
270012
|
if (completed && this.tools.has("memory_write")) {
|
|
269972
270013
|
const memTool = this.tools.get("memory_write");
|
|
269973
|
-
const lessonContent = `Task "${
|
|
270014
|
+
const lessonContent = `Task "${cleanedTask.slice(0, 100)}" completed successfully. Tools: ${consolidation.toolsUsed.join(", ")}. Files: ${consolidation.filesModified.slice(0, 3).join(", ")}. Duration: ${Math.round(durationMs / 1e3)}s, ${consolidation.turns} turns.`;
|
|
269974
270015
|
try {
|
|
269975
270016
|
await memTool.execute({
|
|
269976
270017
|
topic: "task_lessons",
|
|
@@ -269993,7 +270034,7 @@ Full content available via: repl_exec(code="data = retrieve('${handleId}')") or
|
|
|
269993
270034
|
sessionId: this._sessionId,
|
|
269994
270035
|
modality: "gist",
|
|
269995
270036
|
toolName: "task_complete",
|
|
269996
|
-
content: `Task "${
|
|
270037
|
+
content: `Task "${cleanedTask.slice(0, 200)}" ${completed ? "completed" : "ended"}: ${cleanForStorage(summary).slice(0, 300)}`,
|
|
269997
270038
|
importance: 9,
|
|
269998
270039
|
decayClass: "procedural"
|
|
269999
270040
|
});
|
|
@@ -270040,7 +270081,10 @@ Full content available via: repl_exec(code="data = retrieve('${handleId}')") or
|
|
|
270040
270081
|
fs4.mkdirSync(trajDir, { recursive: true });
|
|
270041
270082
|
const trajectory = {
|
|
270042
270083
|
id: this._sessionId,
|
|
270043
|
-
|
|
270084
|
+
// CLEAN task — this file is the prerequisite for ALL future RL/RFT
|
|
270085
|
+
// training. Storing the scaffolded version would teach future models
|
|
270086
|
+
// to reproduce signpost text as part of their task understanding.
|
|
270087
|
+
task: cleanedTask.slice(0, 1e3),
|
|
270044
270088
|
outcome: completed ? "pass" : this.aborted ? "aborted" : "timeout",
|
|
270045
270089
|
model: this.backend.model ?? "unknown",
|
|
270046
270090
|
modelTier: this.options.modelTier ?? "large",
|
|
@@ -273597,6 +273641,7 @@ var init_sessionMetrics = __esm({
|
|
|
273597
273641
|
var init_taskLearning = __esm({
|
|
273598
273642
|
"packages/orchestrator/dist/taskLearning.js"() {
|
|
273599
273643
|
"use strict";
|
|
273644
|
+
init_textSanitize();
|
|
273600
273645
|
}
|
|
273601
273646
|
});
|
|
273602
273647
|
|
|
@@ -274200,6 +274245,7 @@ var init_dist8 = __esm({
|
|
|
274200
274245
|
init_skill_fork();
|
|
274201
274246
|
init_streaming_executor();
|
|
274202
274247
|
init_app_state();
|
|
274248
|
+
init_textSanitize();
|
|
274203
274249
|
}
|
|
274204
274250
|
});
|
|
274205
274251
|
|
|
@@ -303940,9 +303986,11 @@ function loadSessionHistory2(repoRoot) {
|
|
|
303940
303986
|
if (!s2.startedAt || !s2.task) continue;
|
|
303941
303987
|
const status = s2.completed ? "completed" : "incomplete";
|
|
303942
303988
|
const date = s2.startedAt.split("T")[0];
|
|
303943
|
-
|
|
303989
|
+
const cleanTask = cleanForStorage(s2.task) || s2.task;
|
|
303990
|
+
lines.push(`- [${date}] ${cleanTask.slice(0, 80)} (${status}, ${s2.turns ?? 0} turns)`);
|
|
303944
303991
|
if (s2.summary) {
|
|
303945
|
-
|
|
303992
|
+
const cleanSummary = cleanForStorage(s2.summary) || s2.summary;
|
|
303993
|
+
lines.push(` Summary: ${cleanSummary.slice(0, 120)}`);
|
|
303946
303994
|
}
|
|
303947
303995
|
}
|
|
303948
303996
|
return lines.join("\n");
|
|
@@ -304111,6 +304159,7 @@ These patterns have been repeated 3+ times. Consider using create_tool to automa
|
|
|
304111
304159
|
var init_project_context = __esm({
|
|
304112
304160
|
"packages/cli/src/tui/project-context.ts"() {
|
|
304113
304161
|
"use strict";
|
|
304162
|
+
init_dist8();
|
|
304114
304163
|
init_oa_directory();
|
|
304115
304164
|
init_dist4();
|
|
304116
304165
|
}
|
|
@@ -316618,7 +316667,7 @@ When done, either call task_complete with your answer, or use FINAL_VAR(variable
|
|
|
316618
316667
|
ikState.stats.tool_use_count = (ikState.stats.tool_use_count || 0) + result.toolCalls;
|
|
316619
316668
|
}
|
|
316620
316669
|
ikState.version = (ikState.version || 1) + 1;
|
|
316621
|
-
ikState.version_history.push({ version: ikState.version, change: "query_served: " + result.summary.slice(0, 60), timestamp: (/* @__PURE__ */ new Date()).toISOString() });
|
|
316670
|
+
ikState.version_history.push({ version: ikState.version, change: "query_served: " + cleanForStorage(result.summary).slice(0, 60), timestamp: (/* @__PURE__ */ new Date()).toISOString() });
|
|
316622
316671
|
if (ikState.version_history.length > 200) ikState.version_history = ikState.version_history.slice(-200);
|
|
316623
316672
|
if (ikState.version % 10 === 0) {
|
|
316624
316673
|
const specList = (ikState.specializations || []).join(", ") || "general-purpose";
|
|
@@ -316674,11 +316723,11 @@ When done, either call task_complete with your answer, or use FINAL_VAR(variable
|
|
|
316674
316723
|
id: sessionId,
|
|
316675
316724
|
startedAt: new Date(Date.now() - result.durationMs).toISOString(),
|
|
316676
316725
|
completedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
316677
|
-
task,
|
|
316726
|
+
task: cleanForStorage(task) || task.slice(0, 500),
|
|
316678
316727
|
turns: result.turns,
|
|
316679
316728
|
toolCalls: result.toolCalls,
|
|
316680
316729
|
completed: result.completed,
|
|
316681
|
-
summary: result.summary.slice(0, 500)
|
|
316730
|
+
summary: cleanForStorage(result.summary).slice(0, 500)
|
|
316682
316731
|
});
|
|
316683
316732
|
} catch {
|
|
316684
316733
|
}
|
|
@@ -320672,6 +320721,7 @@ var init_interactive = __esm({
|
|
|
320672
320721
|
init_dist8();
|
|
320673
320722
|
init_dist8();
|
|
320674
320723
|
init_dist8();
|
|
320724
|
+
init_dist8();
|
|
320675
320725
|
init_dist4();
|
|
320676
320726
|
init_dist();
|
|
320677
320727
|
init_listen();
|
package/package.json
CHANGED