open-agents-ai 0.187.52 → 0.187.53

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 +44 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -276847,7 +276847,7 @@ function tuiSelect(opts) {
276847
276847
  const first2 = findSelectable(0, 1);
276848
276848
  cursor = first2 >= 0 ? first2 : 0;
276849
276849
  }
276850
- const reservedTopBottom = 6;
276850
+ const reservedTopBottom = 8;
276851
276851
  const hasCrumbs = opts.breadcrumbs && opts.breadcrumbs.length > 0;
276852
276852
  const selectChrome = (hasCrumbs ? 11 : 10) + 3;
276853
276853
  const contentArea = opts.availableRows ? opts.availableRows + reservedTopBottom : process.stdout.rows ?? 24;
@@ -301323,7 +301323,19 @@ ${CONTENT_BG_SEQ}`);
301323
301323
  const { line } = this.inputStateProvider();
301324
301324
  if (line.length <= availWidth)
301325
301325
  return 1;
301326
- return Math.ceil(line.length / availWidth);
301326
+ let count = 0;
301327
+ let remaining = line;
301328
+ while (remaining.length > 0) {
301329
+ count++;
301330
+ if (remaining.length <= availWidth)
301331
+ break;
301332
+ let breakAt = availWidth;
301333
+ const lastSpace = remaining.lastIndexOf(" ", availWidth);
301334
+ if (lastSpace > 0 && lastSpace >= availWidth * 0.3)
301335
+ breakAt = lastSpace + 1;
301336
+ remaining = remaining.slice(breakAt);
301337
+ }
301338
+ return Math.max(1, count);
301327
301339
  }
301328
301340
  /** Update _currentFooterHeight based on current input + suggestions. Returns true if height changed. */
301329
301341
  updateFooterHeight(termWidth) {
@@ -301399,13 +301411,38 @@ ${CONTENT_BG_SEQ}`);
301399
301411
  };
301400
301412
  }
301401
301413
  const rawLines = [];
301402
- for (let i2 = 0; i2 < fullLine.length; i2 += availWidth) {
301403
- rawLines.push(fullLine.slice(i2, i2 + availWidth));
301414
+ let remaining = fullLine;
301415
+ const charPositions = [];
301416
+ while (remaining.length > 0) {
301417
+ if (remaining.length <= availWidth) {
301418
+ charPositions.push(fullLine.length - remaining.length);
301419
+ rawLines.push(remaining);
301420
+ break;
301421
+ }
301422
+ let breakAt = availWidth;
301423
+ const lastSpace = remaining.lastIndexOf(" ", availWidth);
301424
+ if (lastSpace > 0 && lastSpace >= availWidth * 0.3) {
301425
+ breakAt = lastSpace + 1;
301426
+ }
301427
+ charPositions.push(fullLine.length - remaining.length);
301428
+ rawLines.push(remaining.slice(0, breakAt));
301429
+ remaining = remaining.slice(breakAt);
301404
301430
  }
301405
- if (rawLines.length === 0)
301431
+ if (rawLines.length === 0) {
301406
301432
  rawLines.push("");
301407
- const cursorLineIdx = Math.min(Math.floor(cursorPos / availWidth), rawLines.length - 1);
301408
- const cursorColInLine = cursorPos - cursorLineIdx * availWidth;
301433
+ charPositions.push(0);
301434
+ }
301435
+ let cursorLineIdx = rawLines.length - 1;
301436
+ let cursorColInLine = cursorPos;
301437
+ for (let i2 = 0; i2 < charPositions.length; i2++) {
301438
+ const lineStart = charPositions[i2];
301439
+ const lineEnd = lineStart + rawLines[i2].length;
301440
+ if (cursorPos >= lineStart && cursorPos <= lineEnd) {
301441
+ cursorLineIdx = i2;
301442
+ cursorColInLine = cursorPos - lineStart;
301443
+ break;
301444
+ }
301445
+ }
301409
301446
  const lines = rawLines.map((line, i2) => i2 === cursorLineIdx ? _StatusBar.insertVisualCursor(line, cursorColInLine) : line);
301410
301447
  return {
301411
301448
  lines,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.52",
3
+ "version": "0.187.53",
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",