@adhdev/daemon-core 0.9.82-rc.534 → 0.9.82-rc.536

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
@@ -414,10 +414,10 @@ function readInjected(value) {
414
414
  }
415
415
  function getDaemonBuildInfo() {
416
416
  if (cached) return cached;
417
- const commit = readInjected(true ? "7b6411ebc267c71484a3f7d16c392b5bd3e71bd8" : void 0) ?? "unknown";
418
- const commitShort = readInjected(true ? "7b6411eb" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
419
- const version = readInjected(true ? "0.9.82-rc.534" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
420
- const builtAt = readInjected(true ? "2026-07-15T08:30:18.262Z" : void 0);
417
+ const commit = readInjected(true ? "e7001a2fe5b5af35d3710c964727f7e4d735e852" : void 0) ?? "unknown";
418
+ const commitShort = readInjected(true ? "e7001a2f" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
419
+ const version = readInjected(true ? "0.9.82-rc.536" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
420
+ const builtAt = readInjected(true ? "2026-07-15T11:34:59.318Z" : void 0);
421
421
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
422
422
  return cached;
423
423
  }
@@ -24810,7 +24810,11 @@ function buildParseSessionFromTui(spec) {
24810
24810
  const stripLeadingChrome = spec.transcriptPty.stripLeadingChrome ?? true;
24811
24811
  const scope = spec.transcriptPty.scope ?? "buffer";
24812
24812
  const userBgList = Array.isArray(spec.transcriptPty.userBackgroundSgr) ? spec.transcriptPty.userBackgroundSgr.map((s2) => String(s2).trim()).filter(Boolean) : [];
24813
+ const ANY_BG_SENTINELS = /* @__PURE__ */ new Set(["*", "48;*", "bg", "48"]);
24813
24814
  const userBgRes = userBgList.map((code) => {
24815
+ if (ANY_BG_SENTINELS.has(code.toLowerCase())) {
24816
+ return new RegExp("\\x1b\\[[0-9;]*\\b48;(?:5;\\d{1,3}|2;\\d{1,3};\\d{1,3};\\d{1,3})[0-9;]*m");
24817
+ }
24814
24818
  const esc = code.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
24815
24819
  return new RegExp(`\\x1b\\[[0-9;]*${esc}[0-9;]*m`);
24816
24820
  });
@@ -26182,7 +26186,7 @@ var init_cli_state_engine = __esm({
26182
26186
  if (!this.isWaitingForResponse || this.hasActionableApproval()) return false;
26183
26187
  const snap = this.transport.getSnapshot();
26184
26188
  const detectFn = typeof this.transport.runDetectStatus === "function" ? () => this.transport.runDetectStatus(snap.recentOutputBuffer) : () => this.runDetectStatus(snap);
26185
- const latestStatus = detectFn() || this.currentStatus;
26189
+ const latestStatus = detectFn();
26186
26190
  if (latestStatus === "generating") {
26187
26191
  this.evaluateSettled(snap);
26188
26192
  return true;
@@ -43828,7 +43832,7 @@ function executeJsonl(src, input) {
43828
43832
  const mtime = safeMtimeMs(sourcePath);
43829
43833
  const lines = readJsonlLines(sourcePath);
43830
43834
  if (lines.length === 0) return null;
43831
- const transcriptWorkspace = readSessionMetaWorkspace(lines);
43835
+ const transcriptWorkspace = readSessionMetaWorkspace(lines) ?? (src.workspace_from_input ? workspaceFromInputIfSlugMatches(sourcePath, input) : void 0);
43832
43836
  let providerSessionId;
43833
43837
  if (src.session_id_from === "first_record" && src.session_id_path) {
43834
43838
  const v = jsonPathGet(lines[0], src.session_id_path);
@@ -43911,6 +43915,32 @@ function readSessionMetaWorkspace(lines) {
43911
43915
  }
43912
43916
  return void 0;
43913
43917
  }
43918
+ function workspaceFromInputIfSlugMatches(sourcePath, input) {
43919
+ const wsRaw = typeof input.workspace === "string" ? input.workspace.trim() : "";
43920
+ if (!wsRaw) return void 0;
43921
+ let wsReal = wsRaw;
43922
+ try {
43923
+ wsReal = fs17.realpathSync(wsRaw);
43924
+ } catch {
43925
+ }
43926
+ const slugs = /* @__PURE__ */ new Set();
43927
+ for (const w of [wsReal, wsRaw]) {
43928
+ if (!w) continue;
43929
+ slugs.add(claudeProjectDirName(w));
43930
+ slugs.add(claudeProjectDirName(w.replace(/^\/+/, "")));
43931
+ }
43932
+ const segments = sourcePath.split(path24.sep);
43933
+ for (const seg of segments) {
43934
+ if (!seg) continue;
43935
+ for (const slug of slugs) {
43936
+ if (!slug) continue;
43937
+ if (seg === slug) return wsRaw;
43938
+ const m = seg.match(/^(.*)-[0-9a-f]{6,}$/);
43939
+ if (m && m[1] && m[1].length >= 8 && slug.startsWith(m[1])) return wsRaw;
43940
+ }
43941
+ }
43942
+ return void 0;
43943
+ }
43914
43944
  function readJsonlLines(p) {
43915
43945
  let text;
43916
43946
  try {
@@ -54520,10 +54550,10 @@ var ProviderLoader = class _ProviderLoader {
54520
54550
  candidates.push(path45.join(providerDir, "specs", "default.json"));
54521
54551
  candidates.push(path45.join(providerDir, "spec.json"));
54522
54552
  const specPath = candidates.find((p) => fs42.existsSync(p));
54553
+ let nh;
54523
54554
  if (specPath) {
54524
54555
  resolved._resolvedSpecPath = specPath;
54525
54556
  let specControls;
54526
- let nh;
54527
54557
  try {
54528
54558
  const rawSpec = JSON.parse(fs42.readFileSync(specPath, "utf8"));
54529
54559
  specControls = rawSpec.control_bar;
@@ -54549,42 +54579,48 @@ var ProviderLoader = class _ProviderLoader {
54549
54579
  }
54550
54580
  }
54551
54581
  }
54552
- if (nh) {
54553
- let reader = null;
54554
- let format = "spec";
54555
- if (nh.source) {
54556
- format = `spec-${nh.source.kind}`;
54557
- reader = (input) => executeNativeHistory(nh, input);
54558
- } else if (nh.override_path) {
54559
- const overrideFile = path45.resolve(providerDir, nh.override_path);
54560
- if (fs42.existsSync(overrideFile)) {
54561
- try {
54562
- registerProviderScriptRootSafely(path45.dirname(path45.dirname(providerDir)));
54563
- delete __require.cache[__require.resolve(overrideFile)];
54564
- const mod = __require(overrideFile);
54565
- const fn = typeof mod === "function" ? mod : mod && typeof mod.default === "function" ? mod.default : null;
54566
- if (fn) {
54567
- format = "spec-override";
54568
- reader = (input) => fn(input);
54569
- }
54570
- } catch {
54582
+ }
54583
+ if (!nh) {
54584
+ const inlineNh = base?.nativeHistory || resolved?.nativeHistory;
54585
+ if (inlineNh && (inlineNh.source || inlineNh.override_path || inlineNh.reader)) {
54586
+ nh = inlineNh;
54587
+ }
54588
+ }
54589
+ if (nh) {
54590
+ let reader = null;
54591
+ let format = "spec";
54592
+ if (nh.source) {
54593
+ format = `spec-${nh.source.kind}`;
54594
+ reader = (input) => executeNativeHistory(nh, input);
54595
+ } else if (nh.override_path) {
54596
+ const overrideFile = path45.resolve(providerDir, nh.override_path);
54597
+ if (fs42.existsSync(overrideFile)) {
54598
+ try {
54599
+ registerProviderScriptRootSafely(path45.dirname(path45.dirname(providerDir)));
54600
+ delete __require.cache[__require.resolve(overrideFile)];
54601
+ const mod = __require(overrideFile);
54602
+ const fn = typeof mod === "function" ? mod : mod && typeof mod.default === "function" ? mod.default : null;
54603
+ if (fn) {
54604
+ format = "spec-override";
54605
+ reader = (input) => fn(input);
54571
54606
  }
54607
+ } catch {
54572
54608
  }
54573
- } else if (nh.reader) {
54574
- const dispatch = createNativeHistoryDispatcher(nh.reader);
54575
- format = nh.reader;
54576
- reader = (input) => dispatch(input);
54577
- }
54578
- if (reader) {
54579
- resolved.scripts = { ...resolved.scripts || {} };
54580
- resolved.scripts.readNativeHistory = reader;
54581
- resolved.nativeHistory = {
54582
- format,
54583
- watchPath: void 0,
54584
- scripts: { readSession: "readNativeHistory" },
54585
- mode: "native-source"
54586
- };
54587
54609
  }
54610
+ } else if (nh.reader) {
54611
+ const dispatch = createNativeHistoryDispatcher(nh.reader);
54612
+ format = nh.reader;
54613
+ reader = (input) => dispatch(input);
54614
+ }
54615
+ if (reader) {
54616
+ resolved.scripts = { ...resolved.scripts || {} };
54617
+ resolved.scripts.readNativeHistory = reader;
54618
+ resolved.nativeHistory = {
54619
+ format,
54620
+ watchPath: void 0,
54621
+ scripts: { readSession: "readNativeHistory" },
54622
+ mode: "native-source"
54623
+ };
54588
54624
  }
54589
54625
  }
54590
54626
  } catch {