open-agents-ai 0.15.8 → 0.15.9

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
@@ -15736,12 +15736,57 @@ async function startInteractive(config, repoPath) {
15736
15736
  }, 100);
15737
15737
  }
15738
15738
  }
15739
- rl.on("line", async (line) => {
15739
+ let pasteBuffer = [];
15740
+ let pasteTimer = null;
15741
+ let pasteIndicatorShown = false;
15742
+ function flushPasteBuffer() {
15743
+ if (pasteBuffer.length === 0)
15744
+ return;
15745
+ const lines = pasteBuffer.slice();
15746
+ pasteBuffer = [];
15747
+ pasteIndicatorShown = false;
15748
+ if (pasteTimer) {
15749
+ clearTimeout(pasteTimer);
15750
+ pasteTimer = null;
15751
+ }
15752
+ const combined = lines.join("\n");
15753
+ processLine(combined);
15754
+ }
15755
+ function showPasteIndicator() {
15756
+ const count = pasteBuffer.length;
15757
+ const label = ` ${c2.dim("[")}${c2.bold(c2.cyan(String(count)))}${c2.dim(" pasted line" + (count !== 1 ? "s" : "") + " \u2014 press Enter to submit]")}`;
15758
+ process.stdout.write(`\r\x1B[K${label}`);
15759
+ pasteIndicatorShown = true;
15760
+ }
15761
+ rl.on("line", (line) => {
15740
15762
  const input = line.trim();
15741
15763
  if (!input) {
15764
+ if (pasteBuffer.length > 0) {
15765
+ flushPasteBuffer();
15766
+ return;
15767
+ }
15742
15768
  showPrompt();
15743
15769
  return;
15744
15770
  }
15771
+ if (pasteBuffer.length === 0 && input.startsWith("/")) {
15772
+ processLine(input);
15773
+ return;
15774
+ }
15775
+ pasteBuffer.push(input);
15776
+ if (pasteTimer)
15777
+ clearTimeout(pasteTimer);
15778
+ pasteTimer = setTimeout(() => {
15779
+ pasteTimer = null;
15780
+ if (pasteBuffer.length === 1) {
15781
+ const solo = pasteBuffer.shift();
15782
+ pasteIndicatorShown = false;
15783
+ processLine(solo);
15784
+ } else {
15785
+ showPasteIndicator();
15786
+ }
15787
+ }, 50);
15788
+ });
15789
+ async function processLine(input) {
15745
15790
  if (input.startsWith("/")) {
15746
15791
  if (statusBar.isActive)
15747
15792
  statusBar.beginContentWrite();
@@ -15836,7 +15881,12 @@ ${result.text}`;
15836
15881
  }
15837
15882
  } else {
15838
15883
  activeTask.runner.injectUserMessage(input);
15839
- writeContent(() => renderUserInterrupt(input));
15884
+ const lineCount = input.split("\n").length;
15885
+ if (lineCount > 1) {
15886
+ writeContent(() => renderUserInterrupt(`[pasted ${lineCount} lines]`));
15887
+ } else {
15888
+ writeContent(() => renderUserInterrupt(input));
15889
+ }
15840
15890
  }
15841
15891
  showPrompt();
15842
15892
  return;
@@ -15871,7 +15921,9 @@ Summarize or analyze this transcription as appropriate.`;
15871
15921
  if (statusBar.isActive)
15872
15922
  statusBar.setScrollRegionTop(1);
15873
15923
  }
15874
- writeContent(() => renderUserMessage(isImage ? `[Image: ${cleanPath}]` : fullInput));
15924
+ const inputLineCount = fullInput.split("\n").length;
15925
+ const displayText = isImage ? `[Image: ${cleanPath}]` : inputLineCount > 1 ? `[pasted ${inputLineCount} lines]` : fullInput;
15926
+ writeContent(() => renderUserMessage(displayText));
15875
15927
  lastSubmittedPrompt = fullInput;
15876
15928
  try {
15877
15929
  const task = startTask(fullInput, currentConfig, repoRoot, voiceEngine, {
@@ -15931,7 +15983,7 @@ Summarize or analyze this transcription as appropriate.`;
15931
15983
  }
15932
15984
  }
15933
15985
  showPrompt();
15934
- });
15986
+ }
15935
15987
  rl.on("close", () => {
15936
15988
  statusBar.deactivate();
15937
15989
  const closeRows = process.stdout.rows ?? 24;
@@ -15941,6 +15993,19 @@ ${c2.dim("Goodbye!")}
15941
15993
  process.exit(0);
15942
15994
  });
15943
15995
  rl.on("SIGINT", () => {
15996
+ if (pasteBuffer.length > 0) {
15997
+ pasteBuffer = [];
15998
+ pasteIndicatorShown = false;
15999
+ if (pasteTimer) {
16000
+ clearTimeout(pasteTimer);
16001
+ pasteTimer = null;
16002
+ }
16003
+ writeContent(() => process.stdout.write(`
16004
+ ${c2.dim("(paste cancelled)")}
16005
+ `));
16006
+ showPrompt();
16007
+ return;
16008
+ }
15944
16009
  if (activeTask) {
15945
16010
  activeTask.runner.abort();
15946
16011
  writeContent(() => renderTaskAborted());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.15.8",
3
+ "version": "0.15.9",
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",