open-agents-ai 0.187.372 → 0.187.374

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 +69 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -515675,10 +515675,13 @@ function computeEffectiveThink(params) {
515675
515675
  return false;
515676
515676
  if (params.suppressed)
515677
515677
  return false;
515678
+ const userOptedIn = params.requestThink === true || params.requestThink === void 0 && params.defaultThink === true;
515679
+ if (userOptedIn)
515680
+ return true;
515681
+ if (params.requestThink === false)
515682
+ return false;
515678
515683
  if (params.hasTools)
515679
515684
  return false;
515680
- if (typeof params.requestThink === "boolean")
515681
- return params.requestThink;
515682
515685
  if (process.env["OA_THINK_AUTO"] !== "0" && Array.isArray(params.messages)) {
515683
515686
  const blob = params.messages.filter((m2) => m2.role === "user" || m2.role === "system").map((m2) => typeof m2.content === "string" ? m2.content : "").join("\n").toLowerCase();
515684
515687
  if (/\b(plan|decompose|analyze(?:\s+complex)?|step\s*by\s*step|reason through|think through|reason step)\b/.test(blob)) {
@@ -515687,6 +515690,22 @@ function computeEffectiveThink(params) {
515687
515690
  }
515688
515691
  return params.defaultThink;
515689
515692
  }
515693
+ function sanitizeHistoryThink(messages2) {
515694
+ let lastAsstIdx = -1;
515695
+ for (let i2 = messages2.length - 1; i2 >= 0; i2--) {
515696
+ if (messages2[i2]?.role === "assistant") {
515697
+ lastAsstIdx = i2;
515698
+ break;
515699
+ }
515700
+ }
515701
+ return messages2.map((m2, i2) => {
515702
+ if (m2.role !== "assistant" || typeof m2.content !== "string")
515703
+ return m2;
515704
+ if (i2 === lastAsstIdx)
515705
+ return m2;
515706
+ return { ...m2, content: stripThinkBlocks(m2.content) };
515707
+ });
515708
+ }
515690
515709
  function classifyThinkOutcome(raw) {
515691
515710
  if (!raw)
515692
515711
  return "empty_after_strip";
@@ -521293,7 +521312,7 @@ ${description}`
521293
521312
  if (this._isAnthropic) {
521294
521313
  return this._anthropicChatCompletion(request);
521295
521314
  }
521296
- const cleanedMessages = request.messages.map((m2) => m2.role === "assistant" && typeof m2.content === "string" ? { ...m2, content: stripThinkBlocks(m2.content) } : m2);
521315
+ const cleanedMessages = sanitizeHistoryThink(request.messages);
521297
521316
  const effectiveThink = computeEffectiveThink({
521298
521317
  requestThink: request.think,
521299
521318
  defaultThink: this.thinking,
@@ -533249,6 +533268,10 @@ var init_status_bar = __esm({
533249
533268
  setNeovimFocusChecker(checker) {
533250
533269
  this._isNeovimFocused = checker;
533251
533270
  }
533271
+ /** Expose current mouse-tracking state for /mouse status display. */
533272
+ isMouseTrackingEnabled() {
533273
+ return this._mouseTrackingEnabled;
533274
+ }
533252
533275
  /** Enable mouse tracking — respects neovim focus state */
533253
533276
  enableMouseTracking() {
533254
533277
  if (this._mouseTrackingEnabled || isOverlayActive()) return;
@@ -534456,7 +534479,14 @@ ${CONTENT_BG_SEQ}`);
534456
534479
  this.termWrite(`\x1B[${this.scrollRegionTop};${pos.scrollEnd}r`);
534457
534480
  } else {
534458
534481
  const absD = Math.abs(heightDelta);
534459
- this.termWrite(`\x1B[${this.scrollRegionTop};${pos.scrollEnd}r`);
534482
+ const oldScrollEnd = Math.max(rows - oldFooterHeight, this.scrollRegionTop);
534483
+ const newScrollEnd = pos.scrollEnd;
534484
+ this.termWrite(`\x1B[${this.scrollRegionTop};${newScrollEnd}r`);
534485
+ let wipeTransition = "";
534486
+ for (let r2 = oldScrollEnd + 1; r2 <= newScrollEnd; r2++) {
534487
+ wipeTransition += `\x1B[${r2};1H${CONTENT_BG_SEQ}\x1B[2K`;
534488
+ }
534489
+ if (wipeTransition) this.termWrite(wipeTransition);
534460
534490
  let scrollDown = `\x1B[${this.scrollRegionTop};1H`;
534461
534491
  for (let i2 = 0; i2 < absD; i2++) scrollDown += "\x1BM";
534462
534492
  this.termWrite(scrollDown);
@@ -546416,6 +546446,32 @@ Clone a new voice: /voice clone <wav-file> [name]`);
546416
546446
  }
546417
546447
  return "handled";
546418
546448
  }
546449
+ case "mouse": {
546450
+ const t2 = (arg || "").trim().toLowerCase();
546451
+ const isOnNow = ctx3.isMouseEnabled?.() ?? true;
546452
+ if (t2 === "off" || t2 === "0" || t2 === "false" || t2 === "no") {
546453
+ ctx3.disableMouse?.();
546454
+ renderInfo2("Mouse tracking: off — click-drag to select text natively. Re-enable with /mouse on.");
546455
+ return "handled";
546456
+ }
546457
+ if (t2 === "on" || t2 === "1" || t2 === "true" || t2 === "yes") {
546458
+ ctx3.enableMouse?.();
546459
+ renderInfo2("Mouse tracking: on — header buttons + scroll wheel active. Disable with /mouse off for native text selection.");
546460
+ return "handled";
546461
+ }
546462
+ if (t2 === "status" || t2 === "?") {
546463
+ renderInfo2(`Mouse tracking: ${isOnNow ? "on" : "off"}`);
546464
+ return "handled";
546465
+ }
546466
+ if (isOnNow) {
546467
+ ctx3.disableMouse?.();
546468
+ renderInfo2("Mouse tracking: off — click-drag to select text natively. Re-enable with /mouse on.");
546469
+ } else {
546470
+ ctx3.enableMouse?.();
546471
+ renderInfo2("Mouse tracking: on — header buttons + scroll wheel active.");
546472
+ }
546473
+ return "handled";
546474
+ }
546419
546475
  case "tools": {
546420
546476
  const tools = listCustomToolFiles(ctx3.repoRoot);
546421
546477
  if (tools.length === 0) {
@@ -582626,6 +582682,15 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
582626
582682
  deactivateStatusBar() {
582627
582683
  statusBar.deactivate();
582628
582684
  },
582685
+ disableMouse() {
582686
+ statusBar.disableMouseTracking();
582687
+ },
582688
+ enableMouse() {
582689
+ statusBar.enableMouseTracking();
582690
+ },
582691
+ isMouseEnabled() {
582692
+ return statusBar.isMouseTrackingEnabled?.() ?? true;
582693
+ },
582629
582694
  stopBanner() {
582630
582695
  banner.stop();
582631
582696
  if (carousel.isRunning) carousel.stop();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.372",
3
+ "version": "0.187.374",
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",