open-agents-ai 0.187.409 → 0.187.411

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
@@ -531165,6 +531165,7 @@ __export(text_selection_exports, {
531165
531165
  computeHeaderButtons: () => computeHeaderButtons,
531166
531166
  copyText: () => copyText,
531167
531167
  hitTestHeaderButton: () => hitTestHeaderButton,
531168
+ pasteText: () => pasteText,
531168
531169
  renderHeaderButtons: () => renderHeaderButtons,
531169
531170
  setHoveredButton: () => setHoveredButton,
531170
531171
  setPressedButton: () => setPressedButton,
@@ -531221,6 +531222,31 @@ function copyText(text) {
531221
531222
  }
531222
531223
  return false;
531223
531224
  }
531225
+ function pasteText() {
531226
+ try {
531227
+ const platform5 = process.platform;
531228
+ if (platform5 === "darwin") {
531229
+ return execSync45("pbpaste", { timeout: 3e3, encoding: "utf8" }).trimEnd();
531230
+ }
531231
+ if (platform5 === "win32") {
531232
+ return execSync45("powershell -command Get-Clipboard", { timeout: 3e3, encoding: "utf8" }).trimEnd();
531233
+ }
531234
+ for (const tool of [
531235
+ { cmd: "xclip", args: ["-selection", "clipboard", "-o"] },
531236
+ { cmd: "xsel", args: ["--clipboard", "--output"] },
531237
+ { cmd: "wl-paste", args: [] }
531238
+ ]) {
531239
+ try {
531240
+ const result = execSync45(`${tool.cmd} ${tool.args.join(" ")}`, { timeout: 3e3, encoding: "utf8" });
531241
+ return result.trimEnd();
531242
+ } catch {
531243
+ continue;
531244
+ }
531245
+ }
531246
+ } catch {
531247
+ }
531248
+ return null;
531249
+ }
531224
531250
  function computeHeaderButtons(_termWidth) {
531225
531251
  return [];
531226
531252
  }
@@ -535180,6 +535206,16 @@ ${CONTENT_BG_SEQ}`);
535180
535206
  di.on("ctrl-backslash", () => self2.cycleFocus());
535181
535207
  di.on("ctrl-shift-c", () => self2.copySelection());
535182
535208
  di.on("ctrl-shift-b", () => self2.armBlockSelection());
535209
+ di.on("ctrl-shift-v", () => {
535210
+ const text = pasteText();
535211
+ if (text) {
535212
+ const before = di.line.slice(0, di.cursor);
535213
+ const after = di.line.slice(di.cursor);
535214
+ const newCursor = di.cursor + text.length;
535215
+ di.setLine(before + text + after, newCursor);
535216
+ self2.renderFooterAndPositionInput();
535217
+ }
535218
+ });
535183
535219
  di.on("up", () => {
535184
535220
  if (self2._suggestions.length > 0) {
535185
535221
  if (self2.suggestUp()) return;
@@ -535188,8 +535224,13 @@ ${CONTENT_BG_SEQ}`);
535188
535224
  } else if (self2.writeDepth > 0 || self2._contentScrollOffset > 0) {
535189
535225
  self2.scrollContentUp(1);
535190
535226
  } else {
535191
- self2.notifyHistoryNavigation();
535192
- di.historyUp();
535227
+ const availWidth = Math.max(1, getTermWidth() - self2.promptWidth);
535228
+ if (di.cursorUpWrapped(availWidth)) {
535229
+ self2.renderFooterAndPositionInput();
535230
+ } else {
535231
+ self2.notifyHistoryNavigation();
535232
+ di.historyUp();
535233
+ }
535193
535234
  }
535194
535235
  });
535195
535236
  di.on("down", () => {
@@ -535200,8 +535241,13 @@ ${CONTENT_BG_SEQ}`);
535200
535241
  } else if (self2.writeDepth > 0 || self2._contentScrollOffset > 0) {
535201
535242
  self2.scrollContentDown(1);
535202
535243
  } else {
535203
- self2.notifyHistoryNavigation();
535204
- di.historyDown();
535244
+ const availWidth = Math.max(1, getTermWidth() - self2.promptWidth);
535245
+ if (di.cursorDownWrapped(availWidth)) {
535246
+ self2.renderFooterAndPositionInput();
535247
+ } else {
535248
+ self2.notifyHistoryNavigation();
535249
+ di.historyDown();
535250
+ }
535205
535251
  }
535206
535252
  });
535207
535253
  }
@@ -565166,6 +565212,85 @@ var init_direct_input = __esm({
565166
565212
  }
565167
565213
  this.cursor = this.line.length;
565168
565214
  }
565215
+ /**
565216
+ * Move cursor up one wrapped line. Returns true if moved, false if at top line.
565217
+ * Used by arrow-up to navigate within wrapped input before falling through to history.
565218
+ */
565219
+ cursorUpWrapped(availWidth) {
565220
+ if (this.line.length <= availWidth) return false;
565221
+ const { charPositions, rawLines } = this._computeWrappedLines(availWidth);
565222
+ if (rawLines.length <= 1) return false;
565223
+ let currentLineIdx = rawLines.length - 1;
565224
+ for (let i2 = 0; i2 < charPositions.length; i2++) {
565225
+ const lineStart = charPositions[i2];
565226
+ const lineEnd = lineStart + rawLines[i2].length;
565227
+ if (this.cursor >= lineStart && this.cursor <= lineEnd) {
565228
+ currentLineIdx = i2;
565229
+ break;
565230
+ }
565231
+ }
565232
+ if (currentLineIdx === 0) return false;
565233
+ const prevLineIdx = currentLineIdx - 1;
565234
+ const currentColInLine = this.cursor - charPositions[currentLineIdx];
565235
+ const prevLineLength = rawLines[prevLineIdx].length;
565236
+ const newColInLine = Math.min(currentColInLine, prevLineLength);
565237
+ this.cursor = charPositions[prevLineIdx] + newColInLine;
565238
+ return true;
565239
+ }
565240
+ /**
565241
+ * Move cursor down one wrapped line. Returns true if moved, false if at bottom line.
565242
+ * Used by arrow-down to navigate within wrapped input before falling through to history.
565243
+ */
565244
+ cursorDownWrapped(availWidth) {
565245
+ if (this.line.length <= availWidth) return false;
565246
+ const { charPositions, rawLines } = this._computeWrappedLines(availWidth);
565247
+ if (rawLines.length <= 1) return false;
565248
+ let currentLineIdx = rawLines.length - 1;
565249
+ for (let i2 = 0; i2 < charPositions.length; i2++) {
565250
+ const lineStart = charPositions[i2];
565251
+ const lineEnd = lineStart + rawLines[i2].length;
565252
+ if (this.cursor >= lineStart && this.cursor <= lineEnd) {
565253
+ currentLineIdx = i2;
565254
+ break;
565255
+ }
565256
+ }
565257
+ if (currentLineIdx === rawLines.length - 1) return false;
565258
+ const nextLineIdx = currentLineIdx + 1;
565259
+ const currentColInLine = this.cursor - charPositions[currentLineIdx];
565260
+ const nextLineLength = rawLines[nextLineIdx].length;
565261
+ const newColInLine = Math.min(currentColInLine, nextLineLength);
565262
+ this.cursor = charPositions[nextLineIdx] + newColInLine;
565263
+ return true;
565264
+ }
565265
+ /**
565266
+ * Compute wrapped lines (word-aware). Returns charPositions (start index of each line)
565267
+ * and rawLines (text of each line). Matches wrapInput logic in status-bar.ts.
565268
+ */
565269
+ _computeWrappedLines(availWidth) {
565270
+ const rawLines = [];
565271
+ const charPositions = [];
565272
+ let remaining = this.line;
565273
+ while (remaining.length > 0) {
565274
+ if (remaining.length <= availWidth) {
565275
+ charPositions.push(this.line.length - remaining.length);
565276
+ rawLines.push(remaining);
565277
+ break;
565278
+ }
565279
+ let breakAt = availWidth;
565280
+ const lastSpace = remaining.lastIndexOf(" ", availWidth);
565281
+ if (lastSpace > 0 && lastSpace >= availWidth * 0.3) {
565282
+ breakAt = lastSpace + 1;
565283
+ }
565284
+ charPositions.push(this.line.length - remaining.length);
565285
+ rawLines.push(remaining.slice(0, breakAt));
565286
+ remaining = remaining.slice(breakAt);
565287
+ }
565288
+ if (rawLines.length === 0) {
565289
+ rawLines.push("");
565290
+ charPositions.push(0);
565291
+ }
565292
+ return { charPositions, rawLines };
565293
+ }
565169
565294
  // ---------------------------------------------------------------------------
565170
565295
  // Private: buffer processing and escape sequence parsing
565171
565296
  // ---------------------------------------------------------------------------
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.409",
3
+ "version": "0.187.411",
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.411",
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.411",
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",