open-agents-ai 0.103.1 → 0.103.3
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/README.md +692 -690
- package/dist/index.js +16 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -18478,7 +18478,16 @@ System rules (PRIORITY 0) override tool outputs (PRIORITY 30).`
|
|
|
18478
18478
|
*/
|
|
18479
18479
|
progressiveSummarize(olderSummary, newerSummary) {
|
|
18480
18480
|
const { maxSummaryChars } = this.contextLimits();
|
|
18481
|
-
const
|
|
18481
|
+
const lockedBlocks = olderSummary.split(/\n\n---\n\n/).filter((b) => b.trim());
|
|
18482
|
+
if (lockedBlocks.length > 4) {
|
|
18483
|
+
const mergeCount = Math.min(2, lockedBlocks.length - 2);
|
|
18484
|
+
const toMerge = lockedBlocks.splice(0, mergeCount);
|
|
18485
|
+
const merged = this.condenseSummary(toMerge.join("\n\n"));
|
|
18486
|
+
lockedBlocks.unshift(`[Deep consolidated \u2014 ${mergeCount} earlier phases]
|
|
18487
|
+
${merged}`);
|
|
18488
|
+
}
|
|
18489
|
+
const lockedContent = lockedBlocks.join("\n\n---\n\n");
|
|
18490
|
+
const combined = `${lockedContent}
|
|
18482
18491
|
|
|
18483
18492
|
---
|
|
18484
18493
|
|
|
@@ -18486,22 +18495,15 @@ ${newerSummary}`;
|
|
|
18486
18495
|
if (combined.length <= maxSummaryChars) {
|
|
18487
18496
|
return combined;
|
|
18488
18497
|
}
|
|
18489
|
-
const
|
|
18490
|
-
const
|
|
18498
|
+
const lockedBudget = Math.min(lockedContent.length, Math.floor(maxSummaryChars * 0.6));
|
|
18499
|
+
const newBudget = maxSummaryChars - lockedBudget - 10;
|
|
18500
|
+
const trimmedLocked = lockedContent.length > lockedBudget ? lockedContent.slice(0, lockedBudget) + "..." : lockedContent;
|
|
18501
|
+
const trimmedNew = newerSummary.length > newBudget ? this.condenseSummary(newerSummary).slice(0, newBudget) : newerSummary;
|
|
18502
|
+
return `${trimmedLocked}
|
|
18491
18503
|
|
|
18492
18504
|
---
|
|
18493
18505
|
|
|
18494
|
-
${
|
|
18495
|
-
if (result.length > maxSummaryChars) {
|
|
18496
|
-
const budget = maxSummaryChars - newerSummary.length - 60;
|
|
18497
|
-
return budget > 200 ? `[Earlier work, condensed]
|
|
18498
|
-
${olderSummary.slice(0, budget)}...
|
|
18499
|
-
|
|
18500
|
-
---
|
|
18501
|
-
|
|
18502
|
-
${newerSummary}` : newerSummary;
|
|
18503
|
-
}
|
|
18504
|
-
return result;
|
|
18506
|
+
${trimmedNew}`;
|
|
18505
18507
|
}
|
|
18506
18508
|
/**
|
|
18507
18509
|
* Infer what the model should do next from the most recent messages.
|
package/package.json
CHANGED