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

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 ? "00b0b1bba6930ac68b6c43e87795cbe63e59b323" : void 0) ?? "unknown";
393
+ const commitShort = readInjected(true ? "00b0b1bb" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
394
+ const version = readInjected(true ? "0.9.82-rc.419" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
395
+ const builtAt = readInjected(true ? "2026-06-28T18:13:37.481Z" : void 0);
396
396
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
397
397
  return cached;
398
398
  }
@@ -8626,6 +8626,36 @@ __export(worktree_bootstrap_config_exports, {
8626
8626
  runMeshWorktreeBootstrap: () => runMeshWorktreeBootstrap,
8627
8627
  validateMeshWorktreeBootstrapConfig: () => validateMeshWorktreeBootstrapConfig
8628
8628
  });
8629
+ function getRegisteredSubmodulePaths(workspace) {
8630
+ const paths = /* @__PURE__ */ new Set();
8631
+ try {
8632
+ const out = (0, import_node_child_process3.execFileSync)(
8633
+ resolveWin32Executable("git"),
8634
+ ["config", "--file", ".gitmodules", "--get-regexp", "path"],
8635
+ { cwd: workspace, encoding: "utf8", timeout: 1e4, windowsHide: true }
8636
+ );
8637
+ for (const line of String(out).split(/\r?\n/)) {
8638
+ const trimmed = line.trim();
8639
+ if (!trimmed) continue;
8640
+ const spaceIdx = trimmed.indexOf(" ");
8641
+ if (spaceIdx < 0) continue;
8642
+ const value = trimmed.slice(spaceIdx + 1).trim().replace(/\\/g, "/").replace(/\/+$/, "");
8643
+ if (value) paths.add(value);
8644
+ }
8645
+ } catch {
8646
+ }
8647
+ return paths;
8648
+ }
8649
+ function isCleanIgnoringSubmoduleGitlinks(porcelain, submodulePaths) {
8650
+ const lines = porcelain.split(/\r?\n/).filter((line) => line.length > 0);
8651
+ for (const line of lines) {
8652
+ const status = line.slice(0, 2);
8653
+ const path43 = line.slice(3).trim().replace(/\\/g, "/").replace(/\/+$/, "");
8654
+ const isGitlinkPointerMove = (status === " M" || status === "M ") && submodulePaths.has(path43);
8655
+ if (!isGitlinkPointerMove) return false;
8656
+ }
8657
+ return true;
8658
+ }
8629
8659
  function isWorktreeBootstrapStaleRunning(node, nowMs = Date.now()) {
8630
8660
  const wb = node?.worktreeBootstrap;
8631
8661
  if (!wb || wb.status !== "running") return false;
@@ -8643,7 +8673,11 @@ function isWorktreeBootstrapStaleRunning(node, nowMs = Date.now()) {
8643
8673
  timeout: 1e4,
8644
8674
  windowsHide: true
8645
8675
  });
8646
- return String(out).trim() === "";
8676
+ const porcelain = String(out).replace(/\r?\n$/, "");
8677
+ if (porcelain.trim() === "") return true;
8678
+ const submodulePaths = getRegisteredSubmodulePaths(workspace);
8679
+ if (submodulePaths.size === 0) return false;
8680
+ return isCleanIgnoringSubmoduleGitlinks(porcelain, submodulePaths);
8647
8681
  } catch {
8648
8682
  return false;
8649
8683
  }
@@ -8729,6 +8763,7 @@ function evaluateWorktreeBootstrapState(mesh, workspace, persisted) {
8729
8763
  }
8730
8764
  if (persisted?.status === "running") return { ...persisted, required };
8731
8765
  if (persisted?.status === "failed") return { ...persisted, required };
8766
+ if (persisted?.status === "complete") return { ...persisted, required };
8732
8767
  if (persisted?.status === "ready") {
8733
8768
  const staleInputs = loaded.config.staleInputs ?? persisted.staleInputs ?? [];
8734
8769
  if (staleInputs.length > 0 && persisted.staleInputsDigest) {
@@ -37392,6 +37427,12 @@ var WIN32_SUBMIT_SETTLE_MS = 500;
37392
37427
  var WIN32_SUBMIT_SETTLE_POLL_MS = 120;
37393
37428
  var WIN32_ECHO_PROBE_CHARS = 16;
37394
37429
  var WIN32_ECHO_MAX_WAIT_MS = 2e4;
37430
+ var WIN32_BRACKETED_PASTE_OPEN = "\x1B[200~";
37431
+ var WIN32_BRACKETED_PASTE_CLOSE = "\x1B[201~";
37432
+ var WIN32_SOFT_NEWLINE = "\x1B[27;2;13~";
37433
+ function resolveWin32SubmitMode(env = process.env) {
37434
+ return env.ADHDEV_WIN32_SUBMIT_MODE === "soft_newline" ? "soft_newline" : "paste";
37435
+ }
37395
37436
  function normalizeForEcho(s2) {
37396
37437
  return s2.replace(/\s+/g, "");
37397
37438
  }
@@ -38070,28 +38111,55 @@ var FsmDriver = class {
38070
38111
  * single unbounded ConPTY write can overflow the input pipe and drop leading
38071
38112
  * bytes; splitting it with a short inter-chunk gap keeps the console input
38072
38113
  * 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.
38114
+ * write advances lastWin32WriteAt so the submit settle-gate keeps waiting until
38115
+ * the final segment is out and echoed.
38116
+ *
38117
+ * FIX-B-v2: a body that contains an embedded newline cannot be written raw —
38118
+ * on the real win32 Ink/ConPTY composer each '\n' SUBMITS the preceding line as
38119
+ * its own entry, truncating the prompt to only the tail fragment. So a
38120
+ * newline-bearing body is rewritten so its embedded newlines never submit:
38121
+ * - 'paste' (default): wrap the body in a bracketed-paste (ESC[200~ … ESC[201~)
38122
+ * — the composer takes the whole thing, newlines and all, as pasted text.
38123
+ * - 'soft_newline': replace each embedded newline with a non-submitting
38124
+ * Shift+Enter (CSI-u) so the body is typed as one multi-line entry.
38125
+ * The trailing submit CR is NOT written here — it stays separate and is fired
38126
+ * later by scheduleWin32Submit (concern (A)). The bracketed-paste markers are
38127
+ * written as their own atomic segments (never chunked), so chunking can never
38128
+ * split ESC[200~ / ESC[201~ mid-sequence regardless of body length.
38075
38129
  */
38076
38130
  writeWin32Body(text) {
38077
38131
  if (this.win32WriteTimer) {
38078
38132
  clearTimeout(this.win32WriteTimer);
38079
38133
  this.win32WriteTimer = null;
38080
38134
  }
38081
- if (text.length <= WIN32_PTY_WRITE_CHUNK_CHARS) {
38135
+ const hasNewline = /\r?\n/.test(text);
38136
+ const mode = resolveWin32SubmitMode();
38137
+ let segments;
38138
+ if (!hasNewline) {
38139
+ segments = chunkPreservingSurrogates2(text, WIN32_PTY_WRITE_CHUNK_CHARS);
38140
+ } else if (mode === "soft_newline") {
38141
+ const rewritten = text.split(/\r?\n/).join(WIN32_SOFT_NEWLINE);
38142
+ segments = chunkPreservingSurrogates2(rewritten, WIN32_PTY_WRITE_CHUNK_CHARS);
38143
+ } else {
38144
+ segments = [
38145
+ WIN32_BRACKETED_PASTE_OPEN,
38146
+ ...chunkPreservingSurrogates2(text, WIN32_PTY_WRITE_CHUNK_CHARS),
38147
+ WIN32_BRACKETED_PASTE_CLOSE
38148
+ ];
38149
+ }
38150
+ if (segments.length <= 1) {
38082
38151
  this.markWin32Write();
38083
- this.adapter.send_keys(text);
38152
+ this.adapter.send_keys(segments[0] ?? text);
38084
38153
  return;
38085
38154
  }
38086
- const chunks = chunkPreservingSurrogates2(text, WIN32_PTY_WRITE_CHUNK_CHARS);
38087
38155
  let idx = 0;
38088
38156
  const writeNext = () => {
38089
38157
  this.win32WriteTimer = null;
38090
- if (idx >= chunks.length) return;
38158
+ if (idx >= segments.length) return;
38091
38159
  this.markWin32Write();
38092
- this.adapter.send_keys(chunks[idx]);
38160
+ this.adapter.send_keys(segments[idx]);
38093
38161
  idx += 1;
38094
- if (idx < chunks.length) {
38162
+ if (idx < segments.length) {
38095
38163
  this.win32WriteTimer = setTimeout(writeNext, WIN32_PTY_WRITE_CHUNK_GAP_MS);
38096
38164
  }
38097
38165
  };