open-agents-ai 0.187.376 → 0.187.378
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 +38 -77
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13708,10 +13708,9 @@ function buildSkillsSummary(skills) {
|
|
|
13708
13708
|
if (skills.length === 0)
|
|
13709
13709
|
return "";
|
|
13710
13710
|
const lines = [
|
|
13711
|
-
"##
|
|
13711
|
+
"## Skills Index",
|
|
13712
13712
|
"",
|
|
13713
|
-
|
|
13714
|
-
"Skills provide detailed behavioral guidance for specific tasks.",
|
|
13713
|
+
`${skills.length} skills available. Call \`skill_list\` to search, \`skill_execute <name>\` to load full instructions.`,
|
|
13715
13714
|
""
|
|
13716
13715
|
];
|
|
13717
13716
|
const bySource = /* @__PURE__ */ new Map();
|
|
@@ -13721,14 +13720,12 @@ function buildSkillsSummary(skills) {
|
|
|
13721
13720
|
bySource.set(s2.source, group);
|
|
13722
13721
|
}
|
|
13723
13722
|
for (const [source, group] of bySource) {
|
|
13724
|
-
|
|
13725
|
-
|
|
13726
|
-
|
|
13727
|
-
|
|
13728
|
-
}
|
|
13729
|
-
lines.push("");
|
|
13723
|
+
const names = group.map((s2) => {
|
|
13724
|
+
const t2 = s2.triggers[0];
|
|
13725
|
+
return t2 ? `${s2.name}(${t2})` : s2.name;
|
|
13726
|
+
});
|
|
13727
|
+
lines.push(`**${source}** (${group.length}): ${names.join(", ")}`);
|
|
13730
13728
|
}
|
|
13731
|
-
lines.push("Use `skill_execute` with a skill name to load its full instructions when a task matches a trigger pattern.");
|
|
13732
13729
|
return lines.join("\n");
|
|
13733
13730
|
}
|
|
13734
13731
|
function safeReaddir(dir, dirsOnly = false) {
|
|
@@ -529773,22 +529770,6 @@ function discoverContextFiles(repoRoot, maxContentLen = 8e3) {
|
|
|
529773
529770
|
}
|
|
529774
529771
|
}
|
|
529775
529772
|
}
|
|
529776
|
-
const projectMap = join76(dir, OA_DIR, "context", "project-map.md");
|
|
529777
|
-
if (existsSync58(projectMap) && !seen.has(projectMap)) {
|
|
529778
|
-
seen.add(projectMap);
|
|
529779
|
-
try {
|
|
529780
|
-
let content = readFileSync45(projectMap, "utf-8");
|
|
529781
|
-
if (content.length > maxContentLen) {
|
|
529782
|
-
content = content.slice(0, maxContentLen) + "\n\n...(truncated)";
|
|
529783
|
-
}
|
|
529784
|
-
found.push({
|
|
529785
|
-
path: relative6(repoRoot, projectMap),
|
|
529786
|
-
content,
|
|
529787
|
-
type: "oa"
|
|
529788
|
-
});
|
|
529789
|
-
} catch {
|
|
529790
|
-
}
|
|
529791
|
-
}
|
|
529792
529773
|
const parent = join76(dir, "..");
|
|
529793
529774
|
if (parent === dir) break;
|
|
529794
529775
|
dir = parent;
|
|
@@ -557181,32 +557162,6 @@ function buildProjectContext(repoRoot, stores) {
|
|
|
557181
557162
|
skillsSummary: buildSkillsSummary(discoverSkills(repoRoot))
|
|
557182
557163
|
};
|
|
557183
557164
|
}
|
|
557184
|
-
function dedupeTaskMemoriesAgainstHistory(taskMemories, sessionHistory) {
|
|
557185
|
-
if (!taskMemories) return "";
|
|
557186
|
-
if (!sessionHistory) return taskMemories;
|
|
557187
|
-
const historyText = sessionHistory.toLowerCase();
|
|
557188
|
-
const kept = [];
|
|
557189
|
-
const lines = taskMemories.split("\n");
|
|
557190
|
-
let skipNext = false;
|
|
557191
|
-
for (const line of lines) {
|
|
557192
|
-
if (skipNext) {
|
|
557193
|
-
skipNext = line.startsWith(" ");
|
|
557194
|
-
if (skipNext) continue;
|
|
557195
|
-
}
|
|
557196
|
-
const m2 = line.match(/^- \[[^\]]+\]\s+(.+?)\s+→/);
|
|
557197
|
-
if (m2) {
|
|
557198
|
-
const goalFrag = m2[1].toLowerCase().slice(0, 40);
|
|
557199
|
-
if (goalFrag && historyText.includes(goalFrag)) {
|
|
557200
|
-
skipNext = true;
|
|
557201
|
-
continue;
|
|
557202
|
-
}
|
|
557203
|
-
}
|
|
557204
|
-
kept.push(line);
|
|
557205
|
-
}
|
|
557206
|
-
const out = kept.join("\n").trim();
|
|
557207
|
-
if (out.split("\n").filter((l2) => l2.trim().startsWith("-")).length === 0) return "";
|
|
557208
|
-
return out;
|
|
557209
|
-
}
|
|
557210
557165
|
function formatContextForPrompt(ctx3, modelTier = "large") {
|
|
557211
557166
|
const sections = [];
|
|
557212
557167
|
if (ctx3.environment) {
|
|
@@ -557254,16 +557209,6 @@ ${compactHistory}`);
|
|
|
557254
557209
|
${ctx3.sessionHistory}`);
|
|
557255
557210
|
}
|
|
557256
557211
|
}
|
|
557257
|
-
if (modelTier !== "small" && ctx3.taskMemories) {
|
|
557258
|
-
const deduped = dedupeTaskMemoriesAgainstHistory(ctx3.taskMemories, ctx3.sessionHistory);
|
|
557259
|
-
if (deduped) {
|
|
557260
|
-
sections.push(`## Cross-Session Task Memory
|
|
557261
|
-
|
|
557262
|
-
${deduped}
|
|
557263
|
-
|
|
557264
|
-
Use this history to avoid re-doing completed work and to learn from past approaches.`);
|
|
557265
|
-
}
|
|
557266
|
-
}
|
|
557267
557212
|
if (ctx3.failurePatterns) {
|
|
557268
557213
|
sections.push(`## Known Failure Patterns
|
|
557269
557214
|
|
|
@@ -558526,7 +558471,7 @@ var init_stream_renderer = __esm({
|
|
|
558526
558471
|
this.tokenCount++;
|
|
558527
558472
|
if (kind === "thinking") {
|
|
558528
558473
|
this.thinkingTokenCount++;
|
|
558529
|
-
if (token) this.thinkingCache += token;
|
|
558474
|
+
if (token && !this.showThinking) this.thinkingCache += token;
|
|
558530
558475
|
if (this.showThinking) {
|
|
558531
558476
|
for (const char of token) {
|
|
558532
558477
|
this.lineBuffer += char;
|
|
@@ -558582,6 +558527,7 @@ var init_stream_renderer = __esm({
|
|
|
558582
558527
|
this.lineStarted = false;
|
|
558583
558528
|
}
|
|
558584
558529
|
this.enabled = false;
|
|
558530
|
+
this.thinkingCache = "";
|
|
558585
558531
|
}
|
|
558586
558532
|
/** Get streaming stats */
|
|
558587
558533
|
getStats() {
|
|
@@ -558636,9 +558582,12 @@ var init_stream_renderer = __esm({
|
|
|
558636
558582
|
const effectiveKind = this.inThinkBlock ? "thinking" : kind;
|
|
558637
558583
|
this.writeHighlighted(line, effectiveKind);
|
|
558638
558584
|
}
|
|
558639
|
-
/** Return accumulated thinking content so far
|
|
558585
|
+
/** Return accumulated thinking content so far, and clear it so subsequent
|
|
558586
|
+
* toggles only emit the new delta rather than re-printing history. */
|
|
558640
558587
|
dumpThinkingCache() {
|
|
558641
|
-
|
|
558588
|
+
const cache8 = this.thinkingCache;
|
|
558589
|
+
this.thinkingCache = "";
|
|
558590
|
+
return cache8;
|
|
558642
558591
|
}
|
|
558643
558592
|
/**
|
|
558644
558593
|
* Write a highlighted line/fragment to stdout.
|
|
@@ -558737,6 +558686,28 @@ var init_stream_renderer = __esm({
|
|
|
558737
558686
|
/** Toggle visibility of full thinking content */
|
|
558738
558687
|
setThinkingVisible(visible) {
|
|
558739
558688
|
this.showThinking = visible;
|
|
558689
|
+
if (visible) this.thinkingCache = "";
|
|
558690
|
+
}
|
|
558691
|
+
/** Emit the cached (pre-toggle) thinking content to stdout as dim italic
|
|
558692
|
+
* lines. Uses writeRaw so _cursorCol / lineStarted tracking stays in sync
|
|
558693
|
+
* with the in-flight stream — this prevents the "cursor stuck N lines
|
|
558694
|
+
* from bottom" artifact where subsequent tokens rendered at the wrong row.
|
|
558695
|
+
* Returns true if something was dumped. */
|
|
558696
|
+
flushCachedThinking() {
|
|
558697
|
+
const cache8 = this.thinkingCache;
|
|
558698
|
+
this.thinkingCache = "";
|
|
558699
|
+
if (!cache8.trim()) return false;
|
|
558700
|
+
if (this.lineStarted) {
|
|
558701
|
+
this.writeRaw("\n");
|
|
558702
|
+
this.lineStarted = false;
|
|
558703
|
+
}
|
|
558704
|
+
this.writeRaw(" " + dimItalic("[expanded thinking]") + "\n");
|
|
558705
|
+
for (const line of cache8.split("\n")) {
|
|
558706
|
+
if (line.trim().length === 0) continue;
|
|
558707
|
+
this.writeRaw(" " + dimItalic(line) + "\n");
|
|
558708
|
+
}
|
|
558709
|
+
this.lineStarted = false;
|
|
558710
|
+
return true;
|
|
558740
558711
|
}
|
|
558741
558712
|
getThinkingVisible() {
|
|
558742
558713
|
return this.showThinking;
|
|
@@ -581941,18 +581912,8 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
581941
581912
|
}
|
|
581942
581913
|
statusBar.beginContentWrite();
|
|
581943
581914
|
if (!current) {
|
|
581944
|
-
const
|
|
581945
|
-
if (
|
|
581946
|
-
process.stdout.write(`
|
|
581947
|
-
${c3.dim(c3.italic("[expanded thinking]"))}
|
|
581948
|
-
`);
|
|
581949
|
-
for (const line of dump.split("\n")) {
|
|
581950
|
-
if (line.trim().length === 0) continue;
|
|
581951
|
-
process.stdout.write(" " + c3.dim(c3.italic(line)) + "\n");
|
|
581952
|
-
}
|
|
581953
|
-
} else {
|
|
581954
|
-
renderInfo2("Thinking visibility: shown");
|
|
581955
|
-
}
|
|
581915
|
+
const emitted = streamRenderer.flushCachedThinking?.();
|
|
581916
|
+
if (!emitted) renderInfo2("Thinking visibility: shown");
|
|
581956
581917
|
} else {
|
|
581957
581918
|
renderInfo2("Thinking visibility: hidden");
|
|
581958
581919
|
}
|
package/package.json
CHANGED