@oxecli/oxe 1.0.29 → 1.0.31

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/ui.js +8 -11
  2. package/package.json +1 -1
package/dist/ui.js CHANGED
@@ -300,16 +300,11 @@ export function tickDuration(seconds) {
300
300
  // ---------------------------------------------------------------------------
301
301
  const FENCE_MARKER_RE = /`{3,}/g;
302
302
  export function printAiChunk(chunk) {
303
- // A streaming commit can leave the next chunk beginning with the newlines
304
- // that separate two paragraphs. Keep one of them so the response retains
305
- // its intentional empty row without accumulating multiple blank rows.
306
- const leading = chunk.match(/^\n+/)?.[0].length ?? 0;
307
- const body = chunk.slice(leading);
308
- if (!body)
303
+ // Streaming commits are slices of the model's exact text. Do not trim or
304
+ // append newlines here, otherwise paragraph breaks from the AI disappear.
305
+ if (!chunk)
309
306
  return;
310
- process.stdout.write((leading ? "\n" : "") + markdownToAnsi(body) + "\n");
311
- if (/^```/m.test(body))
312
- process.stdout.write("\n");
307
+ process.stdout.write(markdownToAnsi(chunk));
313
308
  }
314
309
  export function safeCommitPoint(text) {
315
310
  let idx = text.lastIndexOf("\n\n");
@@ -720,8 +715,10 @@ export function askBottomPrompt(label = "You", prefix = "❯", history = []) {
720
715
  process.stdin.setEncoding("utf-8");
721
716
  process.stdin.on("data", (d) => chunks.push(Buffer.from(String(d))));
722
717
  process.stdin.on("end", () => {
723
- const text = Buffer.concat(chunks).toString();
724
- resolve([text.trim(), []]);
718
+ const text = Buffer.concat(chunks).toString().replace(/\r\n/g, "\n").replace(/\r/g, "\n");
719
+ // Piped input commonly ends with the transport newline from the
720
+ // shell. Preserve every newline the user supplied before it.
721
+ resolve([text.endsWith("\n") ? text.slice(0, -1) : text, []]);
725
722
  });
726
723
  return;
727
724
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxecli/oxe",
3
- "version": "1.0.29",
3
+ "version": "1.0.31",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },