@adhdev/daemon-standalone 0.9.82-rc.535 → 0.9.82-rc.537

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
@@ -30208,10 +30208,10 @@ var require_dist3 = __commonJS({
30208
30208
  }
30209
30209
  function getDaemonBuildInfo() {
30210
30210
  if (cached2) return cached2;
30211
- const commit = readInjected(true ? "207830c90b06f2f738a85f74079a2460d53767c8" : void 0) ?? "unknown";
30212
- const commitShort = readInjected(true ? "207830c9" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
30213
- const version2 = readInjected(true ? "0.9.82-rc.535" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
30214
- const builtAt = readInjected(true ? "2026-07-15T10:23:33.822Z" : void 0);
30211
+ const commit = readInjected(true ? "b47ad45cf2b2ad404d911162a9cadd7db2e274a6" : void 0) ?? "unknown";
30212
+ const commitShort = readInjected(true ? "b47ad45c" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
30213
+ const version2 = readInjected(true ? "0.9.82-rc.537" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
30214
+ const builtAt = readInjected(true ? "2026-07-15T13:13:29.115Z" : void 0);
30215
30215
  cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
30216
30216
  return cached2;
30217
30217
  }
@@ -54488,6 +54488,70 @@ ${cleanBody}`;
54488
54488
  if (buttonBlockApprovalCue(spec, text)) return true;
54489
54489
  return false;
54490
54490
  }
54491
+ function lastModalCueLine(spec, screenText) {
54492
+ if (!screenText) return -1;
54493
+ const lines = screenText.split("\n");
54494
+ const question = compile2(spec.questionPattern, spec.questionFlags ?? "i");
54495
+ const variants = (spec.questionVariants ?? []).map((v) => compile2(v.regex, v.flags ?? "i"));
54496
+ const buttonFlags = spec.buttonFlags && spec.buttonFlags.includes("m") ? spec.buttonFlags : `${spec.buttonFlags ?? ""}m`;
54497
+ const buttonRe = compile2(spec.buttonPattern, buttonFlags);
54498
+ let last = -1;
54499
+ for (let i = 0; i < lines.length; i++) {
54500
+ const line = lines[i];
54501
+ question.lastIndex = 0;
54502
+ if (question.test(line)) {
54503
+ last = i;
54504
+ continue;
54505
+ }
54506
+ if (variants.some((re) => {
54507
+ re.lastIndex = 0;
54508
+ return re.test(line);
54509
+ })) {
54510
+ last = i;
54511
+ continue;
54512
+ }
54513
+ buttonRe.lastIndex = 0;
54514
+ if (buttonRe.test(line)) {
54515
+ last = i;
54516
+ continue;
54517
+ }
54518
+ }
54519
+ return last;
54520
+ }
54521
+ function modalSupersededBySettledPrompt(modalSpec, settledSpec, settled, input) {
54522
+ if (!settled || !settledSpec) return false;
54523
+ if (settledSpec.scope === "whole-screen") return false;
54524
+ const screenText = input.screenText ?? "";
54525
+ if (!screenText) return false;
54526
+ const modalLine = lastModalCueLine(modalSpec, screenText);
54527
+ if (modalLine < 0) return false;
54528
+ const lines = screenText.split("\n");
54529
+ const below = lines.slice(modalLine + 1);
54530
+ if (below.length === 0) return false;
54531
+ const belowText = below.join("\n");
54532
+ if (!settled.prompt.test(belowText)) return false;
54533
+ if (settled.footers.length > 0 && !settled.footers.every((f) => f.test(belowText))) return false;
54534
+ const question = compile2(modalSpec.questionPattern, modalSpec.questionFlags ?? "i");
54535
+ const variants = (modalSpec.questionVariants ?? []).map((v) => compile2(v.regex, v.flags ?? "i"));
54536
+ const buttonFlags = modalSpec.buttonFlags && modalSpec.buttonFlags.includes("m") ? modalSpec.buttonFlags : `${modalSpec.buttonFlags ?? ""}m`;
54537
+ const buttonRe = compile2(modalSpec.buttonPattern, buttonFlags);
54538
+ const isModalCueLine = (line) => {
54539
+ question.lastIndex = 0;
54540
+ if (question.test(line)) return true;
54541
+ if (variants.some((re) => {
54542
+ re.lastIndex = 0;
54543
+ return re.test(line);
54544
+ })) return true;
54545
+ buttonRe.lastIndex = 0;
54546
+ return buttonRe.test(line);
54547
+ };
54548
+ const settledPromptLineRe = compile2(settledSpec.regex, (settledSpec.flags ?? "m").includes("m") ? settledSpec.flags ?? "m" : `${settledSpec.flags ?? ""}m`);
54549
+ const isSettledLine = (line) => {
54550
+ settledPromptLineRe.lastIndex = 0;
54551
+ return settledPromptLineRe.test(line);
54552
+ };
54553
+ return below.some((line) => line.trim() !== "" && !isModalCueLine(line) && !isSettledLine(line));
54554
+ }
54491
54555
  function evaluateGroup(group, spec, input, compiled) {
54492
54556
  switch (group) {
54493
54557
  case "spinner": {
@@ -54497,7 +54561,9 @@ ${cleanBody}`;
54497
54561
  }
54498
54562
  case "modal": {
54499
54563
  if (!spec.modal) return null;
54500
- return modalMatches(spec.modal, input) ? "waiting_approval" : null;
54564
+ if (!modalMatches(spec.modal, input)) return null;
54565
+ if (modalSupersededBySettledPrompt(spec.modal, spec.settledPrompt, compiled.settled, input)) return null;
54566
+ return "waiting_approval";
54501
54567
  }
54502
54568
  case "settled-prompt": {
54503
54569
  if (!spec.settledPrompt || !compiled.settled) return null;
@@ -54741,7 +54807,11 @@ ${cleanBody}`;
54741
54807
  const stripLeadingChrome = spec.transcriptPty.stripLeadingChrome ?? true;
54742
54808
  const scope = spec.transcriptPty.scope ?? "buffer";
54743
54809
  const userBgList = Array.isArray(spec.transcriptPty.userBackgroundSgr) ? spec.transcriptPty.userBackgroundSgr.map((s2) => String(s2).trim()).filter(Boolean) : [];
54810
+ const ANY_BG_SENTINELS = /* @__PURE__ */ new Set(["*", "48;*", "bg", "48"]);
54744
54811
  const userBgRes = userBgList.map((code) => {
54812
+ if (ANY_BG_SENTINELS.has(code.toLowerCase())) {
54813
+ return new RegExp("\\x1b\\[[0-9;]*\\b48;(?:5;\\d{1,3}|2;\\d{1,3};\\d{1,3};\\d{1,3})[0-9;]*m");
54814
+ }
54745
54815
  const esc2 = code.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
54746
54816
  return new RegExp(`\\x1b\\[[0-9;]*${esc2}[0-9;]*m`);
54747
54817
  });
@@ -56665,6 +56735,7 @@ ${cont}` : cont;
56665
56735
  const staleSnapshotLooksActive = activeScreenPattern.test(lastSnapshot);
56666
56736
  const currentScreenLooksIdle = /(?:^|\n|\r)\s*[❯›>]\s*(?:Try\s+["“][^\n\r"”]+["”])?\s*(?:\n|\r|$)/.test(screenText) && !activeScreenPattern.test(screenText);
56667
56737
  if (staleSnapshotLooksActive && currentScreenLooksIdle) return screenText;
56738
+ if (this.runDetectStatus(screenText) === "idle") return screenText;
56668
56739
  if (currentSnapshot.length >= lastSnapshot.length) return screenText;
56669
56740
  return `${screenText}
56670
56741
  ${lastSnapshot}`;
@@ -74023,7 +74094,7 @@ ${body}
74023
74094
  const mtime = safeMtimeMs(sourcePath);
74024
74095
  const lines = readJsonlLines(sourcePath);
74025
74096
  if (lines.length === 0) return null;
74026
- const transcriptWorkspace = readSessionMetaWorkspace(lines);
74097
+ const transcriptWorkspace = readSessionMetaWorkspace(lines) ?? (src.workspace_from_input ? workspaceFromInputIfSlugMatches(sourcePath, input) : void 0);
74027
74098
  let providerSessionId;
74028
74099
  if (src.session_id_from === "first_record" && src.session_id_path) {
74029
74100
  const v = jsonPathGet(lines[0], src.session_id_path);
@@ -74106,6 +74177,32 @@ ${body}
74106
74177
  }
74107
74178
  return void 0;
74108
74179
  }
74180
+ function workspaceFromInputIfSlugMatches(sourcePath, input) {
74181
+ const wsRaw = typeof input.workspace === "string" ? input.workspace.trim() : "";
74182
+ if (!wsRaw) return void 0;
74183
+ let wsReal = wsRaw;
74184
+ try {
74185
+ wsReal = fs17.realpathSync(wsRaw);
74186
+ } catch {
74187
+ }
74188
+ const slugs = /* @__PURE__ */ new Set();
74189
+ for (const w of [wsReal, wsRaw]) {
74190
+ if (!w) continue;
74191
+ slugs.add(claudeProjectDirName(w));
74192
+ slugs.add(claudeProjectDirName(w.replace(/^\/+/, "")));
74193
+ }
74194
+ const segments = sourcePath.split(path24.sep);
74195
+ for (const seg of segments) {
74196
+ if (!seg) continue;
74197
+ for (const slug of slugs) {
74198
+ if (!slug) continue;
74199
+ if (seg === slug) return wsRaw;
74200
+ const m = seg.match(/^(.*)-[0-9a-f]{6,}$/);
74201
+ if (m && m[1] && m[1].length >= 8 && slug.startsWith(m[1])) return wsRaw;
74202
+ }
74203
+ }
74204
+ return void 0;
74205
+ }
74109
74206
  function readJsonlLines(p) {
74110
74207
  let text;
74111
74208
  try {