@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.js CHANGED
@@ -419,10 +419,10 @@ function readInjected(value) {
419
419
  }
420
420
  function getDaemonBuildInfo() {
421
421
  if (cached) return cached;
422
- const commit = readInjected(true ? "7b6411ebc267c71484a3f7d16c392b5bd3e71bd8" : void 0) ?? "unknown";
423
- const commitShort = readInjected(true ? "7b6411eb" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
424
- const version = readInjected(true ? "0.9.82-rc.534" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
425
- const builtAt = readInjected(true ? "2026-07-15T08:30:18.262Z" : void 0);
422
+ const commit = readInjected(true ? "e7001a2fe5b5af35d3710c964727f7e4d735e852" : void 0) ?? "unknown";
423
+ const commitShort = readInjected(true ? "e7001a2f" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
424
+ const version = readInjected(true ? "0.9.82-rc.536" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
425
+ const builtAt = readInjected(true ? "2026-07-15T11:34:59.318Z" : void 0);
426
426
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
427
427
  return cached;
428
428
  }
@@ -24808,7 +24808,11 @@ function buildParseSessionFromTui(spec) {
24808
24808
  const stripLeadingChrome = spec.transcriptPty.stripLeadingChrome ?? true;
24809
24809
  const scope = spec.transcriptPty.scope ?? "buffer";
24810
24810
  const userBgList = Array.isArray(spec.transcriptPty.userBackgroundSgr) ? spec.transcriptPty.userBackgroundSgr.map((s2) => String(s2).trim()).filter(Boolean) : [];
24811
+ const ANY_BG_SENTINELS = /* @__PURE__ */ new Set(["*", "48;*", "bg", "48"]);
24811
24812
  const userBgRes = userBgList.map((code) => {
24813
+ if (ANY_BG_SENTINELS.has(code.toLowerCase())) {
24814
+ return new RegExp("\\x1b\\[[0-9;]*\\b48;(?:5;\\d{1,3}|2;\\d{1,3};\\d{1,3};\\d{1,3})[0-9;]*m");
24815
+ }
24812
24816
  const esc = code.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
24813
24817
  return new RegExp(`\\x1b\\[[0-9;]*${esc}[0-9;]*m`);
24814
24818
  });
@@ -26181,7 +26185,7 @@ var init_cli_state_engine = __esm({
26181
26185
  if (!this.isWaitingForResponse || this.hasActionableApproval()) return false;
26182
26186
  const snap = this.transport.getSnapshot();
26183
26187
  const detectFn = typeof this.transport.runDetectStatus === "function" ? () => this.transport.runDetectStatus(snap.recentOutputBuffer) : () => this.runDetectStatus(snap);
26184
- const latestStatus = detectFn() || this.currentStatus;
26188
+ const latestStatus = detectFn();
26185
26189
  if (latestStatus === "generating") {
26186
26190
  this.evaluateSettled(snap);
26187
26191
  return true;
@@ -44256,7 +44260,7 @@ function executeJsonl(src, input) {
44256
44260
  const mtime = safeMtimeMs(sourcePath);
44257
44261
  const lines = readJsonlLines(sourcePath);
44258
44262
  if (lines.length === 0) return null;
44259
- const transcriptWorkspace = readSessionMetaWorkspace(lines);
44263
+ const transcriptWorkspace = readSessionMetaWorkspace(lines) ?? (src.workspace_from_input ? workspaceFromInputIfSlugMatches(sourcePath, input) : void 0);
44260
44264
  let providerSessionId;
44261
44265
  if (src.session_id_from === "first_record" && src.session_id_path) {
44262
44266
  const v = jsonPathGet(lines[0], src.session_id_path);
@@ -44339,6 +44343,32 @@ function readSessionMetaWorkspace(lines) {
44339
44343
  }
44340
44344
  return void 0;
44341
44345
  }
44346
+ function workspaceFromInputIfSlugMatches(sourcePath, input) {
44347
+ const wsRaw = typeof input.workspace === "string" ? input.workspace.trim() : "";
44348
+ if (!wsRaw) return void 0;
44349
+ let wsReal = wsRaw;
44350
+ try {
44351
+ wsReal = fs17.realpathSync(wsRaw);
44352
+ } catch {
44353
+ }
44354
+ const slugs = /* @__PURE__ */ new Set();
44355
+ for (const w of [wsReal, wsRaw]) {
44356
+ if (!w) continue;
44357
+ slugs.add(claudeProjectDirName(w));
44358
+ slugs.add(claudeProjectDirName(w.replace(/^\/+/, "")));
44359
+ }
44360
+ const segments = sourcePath.split(path24.sep);
44361
+ for (const seg of segments) {
44362
+ if (!seg) continue;
44363
+ for (const slug of slugs) {
44364
+ if (!slug) continue;
44365
+ if (seg === slug) return wsRaw;
44366
+ const m = seg.match(/^(.*)-[0-9a-f]{6,}$/);
44367
+ if (m && m[1] && m[1].length >= 8 && slug.startsWith(m[1])) return wsRaw;
44368
+ }
44369
+ }
44370
+ return void 0;
44371
+ }
44342
44372
  function readJsonlLines(p) {
44343
44373
  let text;
44344
44374
  try {
@@ -54943,10 +54973,10 @@ var ProviderLoader = class _ProviderLoader {
54943
54973
  candidates.push(path45.join(providerDir, "specs", "default.json"));
54944
54974
  candidates.push(path45.join(providerDir, "spec.json"));
54945
54975
  const specPath = candidates.find((p) => fs42.existsSync(p));
54976
+ let nh;
54946
54977
  if (specPath) {
54947
54978
  resolved._resolvedSpecPath = specPath;
54948
54979
  let specControls;
54949
- let nh;
54950
54980
  try {
54951
54981
  const rawSpec = JSON.parse(fs42.readFileSync(specPath, "utf8"));
54952
54982
  specControls = rawSpec.control_bar;
@@ -54972,42 +55002,48 @@ var ProviderLoader = class _ProviderLoader {
54972
55002
  }
54973
55003
  }
54974
55004
  }
54975
- if (nh) {
54976
- let reader = null;
54977
- let format = "spec";
54978
- if (nh.source) {
54979
- format = `spec-${nh.source.kind}`;
54980
- reader = (input) => executeNativeHistory(nh, input);
54981
- } else if (nh.override_path) {
54982
- const overrideFile = path45.resolve(providerDir, nh.override_path);
54983
- if (fs42.existsSync(overrideFile)) {
54984
- try {
54985
- registerProviderScriptRootSafely(path45.dirname(path45.dirname(providerDir)));
54986
- delete require.cache[require.resolve(overrideFile)];
54987
- const mod = require(overrideFile);
54988
- const fn = typeof mod === "function" ? mod : mod && typeof mod.default === "function" ? mod.default : null;
54989
- if (fn) {
54990
- format = "spec-override";
54991
- reader = (input) => fn(input);
54992
- }
54993
- } catch {
55005
+ }
55006
+ if (!nh) {
55007
+ const inlineNh = base?.nativeHistory || resolved?.nativeHistory;
55008
+ if (inlineNh && (inlineNh.source || inlineNh.override_path || inlineNh.reader)) {
55009
+ nh = inlineNh;
55010
+ }
55011
+ }
55012
+ if (nh) {
55013
+ let reader = null;
55014
+ let format = "spec";
55015
+ if (nh.source) {
55016
+ format = `spec-${nh.source.kind}`;
55017
+ reader = (input) => executeNativeHistory(nh, input);
55018
+ } else if (nh.override_path) {
55019
+ const overrideFile = path45.resolve(providerDir, nh.override_path);
55020
+ if (fs42.existsSync(overrideFile)) {
55021
+ try {
55022
+ registerProviderScriptRootSafely(path45.dirname(path45.dirname(providerDir)));
55023
+ delete require.cache[require.resolve(overrideFile)];
55024
+ const mod = require(overrideFile);
55025
+ const fn = typeof mod === "function" ? mod : mod && typeof mod.default === "function" ? mod.default : null;
55026
+ if (fn) {
55027
+ format = "spec-override";
55028
+ reader = (input) => fn(input);
54994
55029
  }
55030
+ } catch {
54995
55031
  }
54996
- } else if (nh.reader) {
54997
- const dispatch = createNativeHistoryDispatcher(nh.reader);
54998
- format = nh.reader;
54999
- reader = (input) => dispatch(input);
55000
- }
55001
- if (reader) {
55002
- resolved.scripts = { ...resolved.scripts || {} };
55003
- resolved.scripts.readNativeHistory = reader;
55004
- resolved.nativeHistory = {
55005
- format,
55006
- watchPath: void 0,
55007
- scripts: { readSession: "readNativeHistory" },
55008
- mode: "native-source"
55009
- };
55010
55032
  }
55033
+ } else if (nh.reader) {
55034
+ const dispatch = createNativeHistoryDispatcher(nh.reader);
55035
+ format = nh.reader;
55036
+ reader = (input) => dispatch(input);
55037
+ }
55038
+ if (reader) {
55039
+ resolved.scripts = { ...resolved.scripts || {} };
55040
+ resolved.scripts.readNativeHistory = reader;
55041
+ resolved.nativeHistory = {
55042
+ format,
55043
+ watchPath: void 0,
55044
+ scripts: { readSession: "readNativeHistory" },
55045
+ mode: "native-source"
55046
+ };
55011
55047
  }
55012
55048
  }
55013
55049
  } catch {