open-agents-ai 0.187.377 → 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 +32 -75
- 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;
|
|
@@ -558741,6 +558686,28 @@ var init_stream_renderer = __esm({
|
|
|
558741
558686
|
/** Toggle visibility of full thinking content */
|
|
558742
558687
|
setThinkingVisible(visible) {
|
|
558743
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;
|
|
558744
558711
|
}
|
|
558745
558712
|
getThinkingVisible() {
|
|
558746
558713
|
return this.showThinking;
|
|
@@ -581945,18 +581912,8 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
581945
581912
|
}
|
|
581946
581913
|
statusBar.beginContentWrite();
|
|
581947
581914
|
if (!current) {
|
|
581948
|
-
const
|
|
581949
|
-
if (
|
|
581950
|
-
process.stdout.write(`
|
|
581951
|
-
${c3.dim(c3.italic("[expanded thinking]"))}
|
|
581952
|
-
`);
|
|
581953
|
-
for (const line of dump.split("\n")) {
|
|
581954
|
-
if (line.trim().length === 0) continue;
|
|
581955
|
-
process.stdout.write(" " + c3.dim(c3.italic(line)) + "\n");
|
|
581956
|
-
}
|
|
581957
|
-
} else {
|
|
581958
|
-
renderInfo2("Thinking visibility: shown");
|
|
581959
|
-
}
|
|
581915
|
+
const emitted = streamRenderer.flushCachedThinking?.();
|
|
581916
|
+
if (!emitted) renderInfo2("Thinking visibility: shown");
|
|
581960
581917
|
} else {
|
|
581961
581918
|
renderInfo2("Thinking visibility: hidden");
|
|
581962
581919
|
}
|
package/package.json
CHANGED