open-agents-ai 0.187.372 → 0.187.373

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 +61 -3
  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;
@@ -546416,6 +546439,32 @@ Clone a new voice: /voice clone <wav-file> [name]`);
546416
546439
  }
546417
546440
  return "handled";
546418
546441
  }
546442
+ case "mouse": {
546443
+ const t2 = (arg || "").trim().toLowerCase();
546444
+ const isOnNow = ctx3.isMouseEnabled?.() ?? true;
546445
+ if (t2 === "off" || t2 === "0" || t2 === "false" || t2 === "no") {
546446
+ ctx3.disableMouse?.();
546447
+ renderInfo2("Mouse tracking: off — click-drag to select text natively. Re-enable with /mouse on.");
546448
+ return "handled";
546449
+ }
546450
+ if (t2 === "on" || t2 === "1" || t2 === "true" || t2 === "yes") {
546451
+ ctx3.enableMouse?.();
546452
+ renderInfo2("Mouse tracking: on — header buttons + scroll wheel active. Disable with /mouse off for native text selection.");
546453
+ return "handled";
546454
+ }
546455
+ if (t2 === "status" || t2 === "?") {
546456
+ renderInfo2(`Mouse tracking: ${isOnNow ? "on" : "off"}`);
546457
+ return "handled";
546458
+ }
546459
+ if (isOnNow) {
546460
+ ctx3.disableMouse?.();
546461
+ renderInfo2("Mouse tracking: off — click-drag to select text natively. Re-enable with /mouse on.");
546462
+ } else {
546463
+ ctx3.enableMouse?.();
546464
+ renderInfo2("Mouse tracking: on — header buttons + scroll wheel active.");
546465
+ }
546466
+ return "handled";
546467
+ }
546419
546468
  case "tools": {
546420
546469
  const tools = listCustomToolFiles(ctx3.repoRoot);
546421
546470
  if (tools.length === 0) {
@@ -582626,6 +582675,15 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
582626
582675
  deactivateStatusBar() {
582627
582676
  statusBar.deactivate();
582628
582677
  },
582678
+ disableMouse() {
582679
+ statusBar.disableMouseTracking();
582680
+ },
582681
+ enableMouse() {
582682
+ statusBar.enableMouseTracking();
582683
+ },
582684
+ isMouseEnabled() {
582685
+ return statusBar.isMouseTrackingEnabled?.() ?? true;
582686
+ },
582629
582687
  stopBanner() {
582630
582688
  banner.stop();
582631
582689
  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.373",
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",