open-agents-ai 0.159.0 → 0.161.0

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.
Files changed (2) hide show
  1. package/dist/index.js +53 -47
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -27435,8 +27435,15 @@ ${transcript}`
27435
27435
  }
27436
27436
  if (chunk.type === "content" && chunk.content) {
27437
27437
  content += chunk.content;
27438
- let kind = inThinkTag ? "thinking" : "content";
27439
27438
  const fragment = chunk.content;
27439
+ let kind;
27440
+ if (chunk.thinking) {
27441
+ kind = "thinking";
27442
+ } else if (inThinkTag) {
27443
+ kind = "thinking";
27444
+ } else {
27445
+ kind = "content";
27446
+ }
27440
27447
  if (fragment.includes("<think>")) {
27441
27448
  inThinkTag = true;
27442
27449
  kind = "thinking";
@@ -27637,6 +27644,9 @@ ${transcript}`
27637
27644
  continue;
27638
27645
  const delta = choice.delta;
27639
27646
  const finishReason = choice.finish_reason;
27647
+ if (delta?.reasoning) {
27648
+ yield { type: "content", content: delta.reasoning, thinking: true };
27649
+ }
27640
27650
  if (delta?.content) {
27641
27651
  yield { type: "content", content: delta.content };
27642
27652
  }
@@ -52985,15 +52995,22 @@ function buildDMNGatherPrompt(recentTaskSummaries, dueReminders, attentionItems,
52985
52995
  return ` - ${c3.taskType}: ${c3.attempts} attempts, ${rate}% success`;
52986
52996
  }).join("\n") : " (no data yet \u2014 this is a fresh start)";
52987
52997
  const reflectionsText = reflectionBuffer.length > 0 ? reflectionBuffer.map((r, i) => ` ${i + 1}. ${r}`).join("\n") : " (none)";
52988
- return loadPrompt3("tui/dmn-gather.md", {
52989
- recentTaskSummaries: recentTaskSummaries.length > 0 ? recentTaskSummaries.map((s, i) => ` ${i + 1}. ${s}`).join("\n") : " (no recent tasks)",
52990
- reflectionsText,
52991
- competenceReport,
52992
- dueReminders: dueReminders.length > 0 ? dueReminders.map((r) => ` - ${r}`).join("\n") : " (none)",
52993
- attentionItems: attentionItems.length > 0 ? attentionItems.map((a) => ` - ${a}`).join("\n") : " (none)",
52994
- memoryTopics: memoryTopics.length > 0 ? memoryTopics.map((t) => ` - ${t}`).join("\n") : " (none \u2014 fresh start)",
52995
- capabilities: capabilities.map((c3) => ` - ${c3}`).join("\n")
52996
- });
52998
+ try {
52999
+ return loadPrompt3("tui/dmn-gather.md", {
53000
+ recentTaskSummaries: recentTaskSummaries.length > 0 ? recentTaskSummaries.map((s, i) => ` ${i + 1}. ${s}`).join("\n") : " (no recent tasks)",
53001
+ reflectionsText,
53002
+ competenceReport,
53003
+ dueReminders: dueReminders.length > 0 ? dueReminders.map((r) => ` - ${r}`).join("\n") : " (none)",
53004
+ attentionItems: attentionItems.length > 0 ? attentionItems.map((a) => ` - ${a}`).join("\n") : " (none)",
53005
+ memoryTopics: memoryTopics.length > 0 ? memoryTopics.map((t) => ` - ${t}`).join("\n") : " (none \u2014 fresh start)",
53006
+ capabilities: capabilities.map((c3) => ` - ${c3}`).join("\n")
53007
+ });
53008
+ } catch {
53009
+ return `Gather observations about the agent's recent work:
53010
+ ${competenceReport}
53011
+
53012
+ Reflect on what went well and what could improve.`;
53013
+ }
52997
53014
  }
52998
53015
  function adaptTool3(tool) {
52999
53016
  return {
@@ -57608,20 +57625,8 @@ var init_status_bar = __esm({
57608
57625
  if (row >= footerStart)
57609
57626
  return;
57610
57627
  if (type === "press") {
57611
- this._textSelection.clear();
57612
- this._textSelection.onMousePress(row, col);
57613
- this.repaintContent();
57614
- } else if (type === "drag") {
57615
- this._textSelection.onMouseDrag(row, col);
57616
- if (this._textSelection.isDragging)
57617
- this.repaintContent();
57618
- } else if (type === "release") {
57619
- this._textSelection.onMouseRelease(row, col);
57620
- if (this._textSelection.hasSelection) {
57621
- this.copySelection();
57622
- } else {
57623
- this.repaintContent();
57624
- }
57628
+ this.disableMouseTracking();
57629
+ this._scheduleMouseReEnable();
57625
57630
  }
57626
57631
  }
57627
57632
  /** Copy current selection to clipboard. Returns true if copied. */
@@ -57657,6 +57662,26 @@ var init_status_bar = __esm({
57657
57662
  this.renderFooterAndPositionInput();
57658
57663
  }, 1500);
57659
57664
  }
57665
+ /** Timer for re-enabling mouse tracking after content area click */
57666
+ _mouseReEnableTimer = null;
57667
+ /** Schedule re-enabling mouse tracking after content area selection.
57668
+ * Called when user clicks in content area (which disables tracking). */
57669
+ _scheduleMouseReEnable() {
57670
+ if (this._mouseReEnableTimer)
57671
+ clearTimeout(this._mouseReEnableTimer);
57672
+ this._mouseReEnableTimer = setTimeout(() => {
57673
+ this._mouseReEnableTimer = null;
57674
+ this.enableMouseTracking();
57675
+ }, 5e3);
57676
+ }
57677
+ /** Re-enable mouse tracking immediately (called from keyboard handler) */
57678
+ reEnableMouseTracking() {
57679
+ if (this._mouseReEnableTimer) {
57680
+ clearTimeout(this._mouseReEnableTimer);
57681
+ this._mouseReEnableTimer = null;
57682
+ }
57683
+ this.enableMouseTracking();
57684
+ }
57660
57685
  // ── Agent View Management (WO-NA1) ────────────────────────────
57661
57686
  /** Register a new sub-agent view with its own content buffer */
57662
57687
  registerAgentView(id, label, type, taskSummary) {
@@ -58078,18 +58103,10 @@ ${CONTENT_BG_SEQ}`);
58078
58103
  let buf = "\x1B[?2026h";
58079
58104
  buf += "\x1B7";
58080
58105
  buf += "\x1B[?25l";
58081
- const selRanges = this._textSelection.hasSelection ? this._textSelection.getSelectedRanges() : [];
58082
- const selByBuf = /* @__PURE__ */ new Map();
58083
- for (const r of selRanges)
58084
- selByBuf.set(r.bufferIdx, r);
58085
58106
  for (let row = 0; row < h; row++) {
58086
58107
  const lineIdx = startIdx + row;
58087
58108
  let line = lineIdx < totalLines ? this._contentLines[lineIdx] : "";
58088
58109
  const screenRow = this.scrollRegionTop + row;
58089
- const sel = selByBuf.get(lineIdx);
58090
- if (sel) {
58091
- line = TextSelection.applyHighlight(line, sel.startCol, sel.endCol);
58092
- }
58093
58110
  line = line.replace(/\x1B\[0m/g, `\x1B[0m${CONTENT_BG_SEQ}`);
58094
58111
  buf += `\x1B[${screenRow};1H${CONTENT_BG_SEQ}\x1B[2K${line}`;
58095
58112
  }
@@ -58756,18 +58773,6 @@ ${CONTENT_BG_SEQ}`);
58756
58773
  onCtrlO();
58757
58774
  return;
58758
58775
  }
58759
- if (key?.ctrl && key?.shift && key?.name === "c") {
58760
- self.copySelection();
58761
- return;
58762
- }
58763
- if (s === "\x1B[67;6u" || s === "\x1B[27;6;67~") {
58764
- self.copySelection();
58765
- return;
58766
- }
58767
- if (s === "" && key?.shift) {
58768
- self.copySelection();
58769
- return;
58770
- }
58771
58776
  if (key?.ctrl && key?.shift && key?.name === "b") {
58772
58777
  self.armBlockSelection();
58773
58778
  return;
@@ -58782,9 +58787,8 @@ ${CONTENT_BG_SEQ}`);
58782
58787
  if (key?.name === "escape" || s === "\x1B") {
58783
58788
  sawEscape = true;
58784
58789
  sawEscapeTime = Date.now();
58785
- if (self._textSelection.hasSelection && s.length === 1) {
58786
- self._textSelection.clear();
58787
- self.repaintContent();
58790
+ if (self._mouseReEnableTimer && s.length === 1) {
58791
+ self.reEnableMouseTracking();
58788
58792
  return;
58789
58793
  }
58790
58794
  if (onEscape && s.length === 1)
@@ -58867,6 +58871,8 @@ ${CONTENT_BG_SEQ}`);
58867
58871
  self.renderFooterAndPositionInput();
58868
58872
  }
58869
58873
  }
58874
+ if (self._mouseReEnableTimer)
58875
+ self.reEnableMouseTracking();
58870
58876
  return origTtyWrite(s, key);
58871
58877
  } catch {
58872
58878
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.159.0",
3
+ "version": "0.161.0",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",