open-agents-ai 0.187.409 → 0.187.410

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 CHANGED
@@ -535188,8 +535188,13 @@ ${CONTENT_BG_SEQ}`);
535188
535188
  } else if (self2.writeDepth > 0 || self2._contentScrollOffset > 0) {
535189
535189
  self2.scrollContentUp(1);
535190
535190
  } else {
535191
- self2.notifyHistoryNavigation();
535192
- di.historyUp();
535191
+ const availWidth = Math.max(1, getTermWidth() - self2.promptWidth);
535192
+ if (di.cursorUpWrapped(availWidth)) {
535193
+ self2.renderFooterAndPositionInput();
535194
+ } else {
535195
+ self2.notifyHistoryNavigation();
535196
+ di.historyUp();
535197
+ }
535193
535198
  }
535194
535199
  });
535195
535200
  di.on("down", () => {
@@ -535200,8 +535205,13 @@ ${CONTENT_BG_SEQ}`);
535200
535205
  } else if (self2.writeDepth > 0 || self2._contentScrollOffset > 0) {
535201
535206
  self2.scrollContentDown(1);
535202
535207
  } else {
535203
- self2.notifyHistoryNavigation();
535204
- di.historyDown();
535208
+ const availWidth = Math.max(1, getTermWidth() - self2.promptWidth);
535209
+ if (di.cursorDownWrapped(availWidth)) {
535210
+ self2.renderFooterAndPositionInput();
535211
+ } else {
535212
+ self2.notifyHistoryNavigation();
535213
+ di.historyDown();
535214
+ }
535205
535215
  }
535206
535216
  });
535207
535217
  }
@@ -565166,6 +565176,85 @@ var init_direct_input = __esm({
565166
565176
  }
565167
565177
  this.cursor = this.line.length;
565168
565178
  }
565179
+ /**
565180
+ * Move cursor up one wrapped line. Returns true if moved, false if at top line.
565181
+ * Used by arrow-up to navigate within wrapped input before falling through to history.
565182
+ */
565183
+ cursorUpWrapped(availWidth) {
565184
+ if (this.line.length <= availWidth) return false;
565185
+ const { charPositions, rawLines } = this._computeWrappedLines(availWidth);
565186
+ if (rawLines.length <= 1) return false;
565187
+ let currentLineIdx = rawLines.length - 1;
565188
+ for (let i2 = 0; i2 < charPositions.length; i2++) {
565189
+ const lineStart = charPositions[i2];
565190
+ const lineEnd = lineStart + rawLines[i2].length;
565191
+ if (this.cursor >= lineStart && this.cursor <= lineEnd) {
565192
+ currentLineIdx = i2;
565193
+ break;
565194
+ }
565195
+ }
565196
+ if (currentLineIdx === 0) return false;
565197
+ const prevLineIdx = currentLineIdx - 1;
565198
+ const currentColInLine = this.cursor - charPositions[currentLineIdx];
565199
+ const prevLineLength = rawLines[prevLineIdx].length;
565200
+ const newColInLine = Math.min(currentColInLine, prevLineLength);
565201
+ this.cursor = charPositions[prevLineIdx] + newColInLine;
565202
+ return true;
565203
+ }
565204
+ /**
565205
+ * Move cursor down one wrapped line. Returns true if moved, false if at bottom line.
565206
+ * Used by arrow-down to navigate within wrapped input before falling through to history.
565207
+ */
565208
+ cursorDownWrapped(availWidth) {
565209
+ if (this.line.length <= availWidth) return false;
565210
+ const { charPositions, rawLines } = this._computeWrappedLines(availWidth);
565211
+ if (rawLines.length <= 1) return false;
565212
+ let currentLineIdx = rawLines.length - 1;
565213
+ for (let i2 = 0; i2 < charPositions.length; i2++) {
565214
+ const lineStart = charPositions[i2];
565215
+ const lineEnd = lineStart + rawLines[i2].length;
565216
+ if (this.cursor >= lineStart && this.cursor <= lineEnd) {
565217
+ currentLineIdx = i2;
565218
+ break;
565219
+ }
565220
+ }
565221
+ if (currentLineIdx === rawLines.length - 1) return false;
565222
+ const nextLineIdx = currentLineIdx + 1;
565223
+ const currentColInLine = this.cursor - charPositions[currentLineIdx];
565224
+ const nextLineLength = rawLines[nextLineIdx].length;
565225
+ const newColInLine = Math.min(currentColInLine, nextLineLength);
565226
+ this.cursor = charPositions[nextLineIdx] + newColInLine;
565227
+ return true;
565228
+ }
565229
+ /**
565230
+ * Compute wrapped lines (word-aware). Returns charPositions (start index of each line)
565231
+ * and rawLines (text of each line). Matches wrapInput logic in status-bar.ts.
565232
+ */
565233
+ _computeWrappedLines(availWidth) {
565234
+ const rawLines = [];
565235
+ const charPositions = [];
565236
+ let remaining = this.line;
565237
+ while (remaining.length > 0) {
565238
+ if (remaining.length <= availWidth) {
565239
+ charPositions.push(this.line.length - remaining.length);
565240
+ rawLines.push(remaining);
565241
+ break;
565242
+ }
565243
+ let breakAt = availWidth;
565244
+ const lastSpace = remaining.lastIndexOf(" ", availWidth);
565245
+ if (lastSpace > 0 && lastSpace >= availWidth * 0.3) {
565246
+ breakAt = lastSpace + 1;
565247
+ }
565248
+ charPositions.push(this.line.length - remaining.length);
565249
+ rawLines.push(remaining.slice(0, breakAt));
565250
+ remaining = remaining.slice(breakAt);
565251
+ }
565252
+ if (rawLines.length === 0) {
565253
+ rawLines.push("");
565254
+ charPositions.push(0);
565255
+ }
565256
+ return { charPositions, rawLines };
565257
+ }
565169
565258
  // ---------------------------------------------------------------------------
565170
565259
  // Private: buffer processing and escape sequence parsing
565171
565260
  // ---------------------------------------------------------------------------
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.409",
3
+ "version": "0.187.410",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "open-agents-ai",
9
- "version": "0.187.409",
9
+ "version": "0.187.410",
10
10
  "hasInstallScript": true,
11
11
  "license": "CC-BY-NC-4.0",
12
12
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.409",
3
+ "version": "0.187.410",
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",