@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.js CHANGED
@@ -389,10 +389,10 @@ function readInjected(value) {
389
389
  }
390
390
  function getDaemonBuildInfo() {
391
391
  if (cached) return cached;
392
- const commit = readInjected(true ? "aebe69a58bc80d5e1db908141ea4d03792bd0b5d" : void 0) ?? "unknown";
393
- const commitShort = readInjected(true ? "aebe69a5" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
394
- const version = readInjected(true ? "0.9.82-rc.417" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
395
- const builtAt = readInjected(true ? "2026-06-28T16:29:44.906Z" : void 0);
392
+ const commit = readInjected(true ? "143c6a0cea61d764bf955548c73cdd3dd28c5849" : void 0) ?? "unknown";
393
+ const commitShort = readInjected(true ? "143c6a0c" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
394
+ const version = readInjected(true ? "0.9.82-rc.418" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
395
+ const builtAt = readInjected(true ? "2026-06-28T17:20:10.661Z" : void 0);
396
396
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
397
397
  return cached;
398
398
  }
@@ -37392,6 +37392,12 @@ var WIN32_SUBMIT_SETTLE_MS = 500;
37392
37392
  var WIN32_SUBMIT_SETTLE_POLL_MS = 120;
37393
37393
  var WIN32_ECHO_PROBE_CHARS = 16;
37394
37394
  var WIN32_ECHO_MAX_WAIT_MS = 2e4;
37395
+ var WIN32_BRACKETED_PASTE_OPEN = "\x1B[200~";
37396
+ var WIN32_BRACKETED_PASTE_CLOSE = "\x1B[201~";
37397
+ var WIN32_SOFT_NEWLINE = "\x1B[27;2;13~";
37398
+ function resolveWin32SubmitMode(env = process.env) {
37399
+ return env.ADHDEV_WIN32_SUBMIT_MODE === "soft_newline" ? "soft_newline" : "paste";
37400
+ }
37395
37401
  function normalizeForEcho(s2) {
37396
37402
  return s2.replace(/\s+/g, "");
37397
37403
  }
@@ -38070,28 +38076,55 @@ var FsmDriver = class {
38070
38076
  * single unbounded ConPTY write can overflow the input pipe and drop leading
38071
38077
  * bytes; splitting it with a short inter-chunk gap keeps the console input
38072
38078
  * buffer from overflowing. Small bodies still go out in a single write. Each
38073
- * chunk advances lastWin32WriteAt so the submit settle-gate keeps waiting until
38074
- * the final chunk is out and echoed.
38079
+ * write advances lastWin32WriteAt so the submit settle-gate keeps waiting until
38080
+ * the final segment is out and echoed.
38081
+ *
38082
+ * FIX-B-v2: a body that contains an embedded newline cannot be written raw —
38083
+ * on the real win32 Ink/ConPTY composer each '\n' SUBMITS the preceding line as
38084
+ * its own entry, truncating the prompt to only the tail fragment. So a
38085
+ * newline-bearing body is rewritten so its embedded newlines never submit:
38086
+ * - 'paste' (default): wrap the body in a bracketed-paste (ESC[200~ … ESC[201~)
38087
+ * — the composer takes the whole thing, newlines and all, as pasted text.
38088
+ * - 'soft_newline': replace each embedded newline with a non-submitting
38089
+ * Shift+Enter (CSI-u) so the body is typed as one multi-line entry.
38090
+ * The trailing submit CR is NOT written here — it stays separate and is fired
38091
+ * later by scheduleWin32Submit (concern (A)). The bracketed-paste markers are
38092
+ * written as their own atomic segments (never chunked), so chunking can never
38093
+ * split ESC[200~ / ESC[201~ mid-sequence regardless of body length.
38075
38094
  */
38076
38095
  writeWin32Body(text) {
38077
38096
  if (this.win32WriteTimer) {
38078
38097
  clearTimeout(this.win32WriteTimer);
38079
38098
  this.win32WriteTimer = null;
38080
38099
  }
38081
- if (text.length <= WIN32_PTY_WRITE_CHUNK_CHARS) {
38100
+ const hasNewline = /\r?\n/.test(text);
38101
+ const mode = resolveWin32SubmitMode();
38102
+ let segments;
38103
+ if (!hasNewline) {
38104
+ segments = chunkPreservingSurrogates2(text, WIN32_PTY_WRITE_CHUNK_CHARS);
38105
+ } else if (mode === "soft_newline") {
38106
+ const rewritten = text.split(/\r?\n/).join(WIN32_SOFT_NEWLINE);
38107
+ segments = chunkPreservingSurrogates2(rewritten, WIN32_PTY_WRITE_CHUNK_CHARS);
38108
+ } else {
38109
+ segments = [
38110
+ WIN32_BRACKETED_PASTE_OPEN,
38111
+ ...chunkPreservingSurrogates2(text, WIN32_PTY_WRITE_CHUNK_CHARS),
38112
+ WIN32_BRACKETED_PASTE_CLOSE
38113
+ ];
38114
+ }
38115
+ if (segments.length <= 1) {
38082
38116
  this.markWin32Write();
38083
- this.adapter.send_keys(text);
38117
+ this.adapter.send_keys(segments[0] ?? text);
38084
38118
  return;
38085
38119
  }
38086
- const chunks = chunkPreservingSurrogates2(text, WIN32_PTY_WRITE_CHUNK_CHARS);
38087
38120
  let idx = 0;
38088
38121
  const writeNext = () => {
38089
38122
  this.win32WriteTimer = null;
38090
- if (idx >= chunks.length) return;
38123
+ if (idx >= segments.length) return;
38091
38124
  this.markWin32Write();
38092
- this.adapter.send_keys(chunks[idx]);
38125
+ this.adapter.send_keys(segments[idx]);
38093
38126
  idx += 1;
38094
- if (idx < chunks.length) {
38127
+ if (idx < segments.length) {
38095
38128
  this.win32WriteTimer = setTimeout(writeNext, WIN32_PTY_WRITE_CHUNK_GAP_MS);
38096
38129
  }
38097
38130
  };