@adhdev/daemon-core 0.9.82-rc.417 → 0.9.82-rc.418

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.mjs CHANGED
@@ -384,10 +384,10 @@ function readInjected(value) {
384
384
  }
385
385
  function getDaemonBuildInfo() {
386
386
  if (cached) return cached;
387
- const commit = readInjected(true ? "aebe69a58bc80d5e1db908141ea4d03792bd0b5d" : void 0) ?? "unknown";
388
- const commitShort = readInjected(true ? "aebe69a5" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
389
- const version = readInjected(true ? "0.9.82-rc.417" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
390
- const builtAt = readInjected(true ? "2026-06-28T16:29:44.906Z" : void 0);
387
+ const commit = readInjected(true ? "143c6a0cea61d764bf955548c73cdd3dd28c5849" : void 0) ?? "unknown";
388
+ const commitShort = readInjected(true ? "143c6a0c" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
389
+ const version = readInjected(true ? "0.9.82-rc.418" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
390
+ const builtAt = readInjected(true ? "2026-06-28T17:20:10.661Z" : void 0);
391
391
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
392
392
  return cached;
393
393
  }
@@ -36997,6 +36997,12 @@ var WIN32_SUBMIT_SETTLE_MS = 500;
36997
36997
  var WIN32_SUBMIT_SETTLE_POLL_MS = 120;
36998
36998
  var WIN32_ECHO_PROBE_CHARS = 16;
36999
36999
  var WIN32_ECHO_MAX_WAIT_MS = 2e4;
37000
+ var WIN32_BRACKETED_PASTE_OPEN = "\x1B[200~";
37001
+ var WIN32_BRACKETED_PASTE_CLOSE = "\x1B[201~";
37002
+ var WIN32_SOFT_NEWLINE = "\x1B[27;2;13~";
37003
+ function resolveWin32SubmitMode(env = process.env) {
37004
+ return env.ADHDEV_WIN32_SUBMIT_MODE === "soft_newline" ? "soft_newline" : "paste";
37005
+ }
37000
37006
  function normalizeForEcho(s2) {
37001
37007
  return s2.replace(/\s+/g, "");
37002
37008
  }
@@ -37675,28 +37681,55 @@ var FsmDriver = class {
37675
37681
  * single unbounded ConPTY write can overflow the input pipe and drop leading
37676
37682
  * bytes; splitting it with a short inter-chunk gap keeps the console input
37677
37683
  * buffer from overflowing. Small bodies still go out in a single write. Each
37678
- * chunk advances lastWin32WriteAt so the submit settle-gate keeps waiting until
37679
- * the final chunk is out and echoed.
37684
+ * write advances lastWin32WriteAt so the submit settle-gate keeps waiting until
37685
+ * the final segment is out and echoed.
37686
+ *
37687
+ * FIX-B-v2: a body that contains an embedded newline cannot be written raw —
37688
+ * on the real win32 Ink/ConPTY composer each '\n' SUBMITS the preceding line as
37689
+ * its own entry, truncating the prompt to only the tail fragment. So a
37690
+ * newline-bearing body is rewritten so its embedded newlines never submit:
37691
+ * - 'paste' (default): wrap the body in a bracketed-paste (ESC[200~ … ESC[201~)
37692
+ * — the composer takes the whole thing, newlines and all, as pasted text.
37693
+ * - 'soft_newline': replace each embedded newline with a non-submitting
37694
+ * Shift+Enter (CSI-u) so the body is typed as one multi-line entry.
37695
+ * The trailing submit CR is NOT written here — it stays separate and is fired
37696
+ * later by scheduleWin32Submit (concern (A)). The bracketed-paste markers are
37697
+ * written as their own atomic segments (never chunked), so chunking can never
37698
+ * split ESC[200~ / ESC[201~ mid-sequence regardless of body length.
37680
37699
  */
37681
37700
  writeWin32Body(text) {
37682
37701
  if (this.win32WriteTimer) {
37683
37702
  clearTimeout(this.win32WriteTimer);
37684
37703
  this.win32WriteTimer = null;
37685
37704
  }
37686
- if (text.length <= WIN32_PTY_WRITE_CHUNK_CHARS) {
37705
+ const hasNewline = /\r?\n/.test(text);
37706
+ const mode = resolveWin32SubmitMode();
37707
+ let segments;
37708
+ if (!hasNewline) {
37709
+ segments = chunkPreservingSurrogates2(text, WIN32_PTY_WRITE_CHUNK_CHARS);
37710
+ } else if (mode === "soft_newline") {
37711
+ const rewritten = text.split(/\r?\n/).join(WIN32_SOFT_NEWLINE);
37712
+ segments = chunkPreservingSurrogates2(rewritten, WIN32_PTY_WRITE_CHUNK_CHARS);
37713
+ } else {
37714
+ segments = [
37715
+ WIN32_BRACKETED_PASTE_OPEN,
37716
+ ...chunkPreservingSurrogates2(text, WIN32_PTY_WRITE_CHUNK_CHARS),
37717
+ WIN32_BRACKETED_PASTE_CLOSE
37718
+ ];
37719
+ }
37720
+ if (segments.length <= 1) {
37687
37721
  this.markWin32Write();
37688
- this.adapter.send_keys(text);
37722
+ this.adapter.send_keys(segments[0] ?? text);
37689
37723
  return;
37690
37724
  }
37691
- const chunks = chunkPreservingSurrogates2(text, WIN32_PTY_WRITE_CHUNK_CHARS);
37692
37725
  let idx = 0;
37693
37726
  const writeNext = () => {
37694
37727
  this.win32WriteTimer = null;
37695
- if (idx >= chunks.length) return;
37728
+ if (idx >= segments.length) return;
37696
37729
  this.markWin32Write();
37697
- this.adapter.send_keys(chunks[idx]);
37730
+ this.adapter.send_keys(segments[idx]);
37698
37731
  idx += 1;
37699
- if (idx < chunks.length) {
37732
+ if (idx < segments.length) {
37700
37733
  this.win32WriteTimer = setTimeout(writeNext, WIN32_PTY_WRITE_CHUNK_GAP_MS);
37701
37734
  }
37702
37735
  };