@adhdev/daemon-core 0.9.82-rc.530 → 0.9.82-rc.531

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 ? "8bb24b3b4363ee0c860be949d52f6606e3d0c288" : void 0) ?? "unknown";
423
- const commitShort = readInjected(true ? "8bb24b3b" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
424
- const version = readInjected(true ? "0.9.82-rc.530" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
425
- const builtAt = readInjected(true ? "2026-07-14T15:26:36.978Z" : void 0);
422
+ const commit = readInjected(true ? "e3fc80a7e951a782e3a4e192d432e9b5fc3ee1ab" : void 0) ?? "unknown";
423
+ const commitShort = readInjected(true ? "e3fc80a7" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
424
+ const version = readInjected(true ? "0.9.82-rc.531" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
425
+ const builtAt = readInjected(true ? "2026-07-15T05:51:27.948Z" : void 0);
426
426
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
427
427
  return cached;
428
428
  }
@@ -24657,6 +24657,9 @@ function stripAnsi2(text) {
24657
24657
  function splitLines(text) {
24658
24658
  return stripAnsi2(text).replace(//g, "").split(/\r?\n/).map((l) => l.replace(/\s+$/, ""));
24659
24659
  }
24660
+ function splitRawLines(text) {
24661
+ return String(text || "").split(/\r?\n/).map((rawLine) => ({ raw: rawLine, text: stripAnsi2(rawLine).replace(/[\x00-\x08\x0b-\x1f\x7f]/g, "").replace(/\s+$/, "") }));
24662
+ }
24660
24663
  function pickInputText(input, scope) {
24661
24664
  if (!input) return "";
24662
24665
  if (scope === "screen") return String(input.screenText || input.screen?.text || "");
@@ -24705,6 +24708,11 @@ function buildParseSessionFromTui(spec) {
24705
24708
  const requireIndentForContinuation = spec.transcriptPty.continuationLine?.indented ?? false;
24706
24709
  const stripLeadingChrome = spec.transcriptPty.stripLeadingChrome ?? true;
24707
24710
  const scope = spec.transcriptPty.scope ?? "buffer";
24711
+ const userBgList = Array.isArray(spec.transcriptPty.userBackgroundSgr) ? spec.transcriptPty.userBackgroundSgr.map((s2) => String(s2).trim()).filter(Boolean) : [];
24712
+ const userBgRes = userBgList.map((code) => {
24713
+ const esc = code.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
24714
+ return new RegExp(`\\x1b\\[[0-9;]*${esc}[0-9;]*m`);
24715
+ });
24708
24716
  const detectStatus = spec.spinner || spec.settledPrompt || spec.modal || spec.dispatchOrder ? buildDetectStatusFromTui({
24709
24717
  spinner: spec.spinner,
24710
24718
  settledPrompt: spec.settledPrompt,
@@ -24721,11 +24729,11 @@ function buildParseSessionFromTui(spec) {
24721
24729
  const status = detectStatus(input) ?? "idle";
24722
24730
  const modal = parseApproval(input);
24723
24731
  const text = pickInputText(input, scope);
24724
- const lines = splitLines(text);
24732
+ const rawLines = userBgRes.length > 0 ? splitRawLines(text) : splitLines(text).map((t) => ({ raw: "", text: t }));
24725
24733
  const messages = [];
24726
24734
  let seenFirstRoleLine = !stripLeadingChrome;
24727
- for (const raw of lines) {
24728
- const line = raw;
24735
+ for (const entry of rawLines) {
24736
+ const line = entry.text;
24729
24737
  if (line.trim() === "") {
24730
24738
  continue;
24731
24739
  }
@@ -24737,6 +24745,12 @@ function buildParseSessionFromTui(spec) {
24737
24745
  }
24738
24746
  }
24739
24747
  if (isChrome) continue;
24748
+ if (userBgRes.length > 0 && entry.raw && userBgRes.some((re) => re.test(entry.raw))) {
24749
+ seenFirstRoleLine = true;
24750
+ const content = line.replace(/^\s*[→>›❯]\s*/, "").trim();
24751
+ if (content) messages.push({ role: "user", kind: "standard", content });
24752
+ continue;
24753
+ }
24740
24754
  const userMatch = userRe ? line.match(userRe) : null;
24741
24755
  const toolMatch = toolRe ? line.match(toolRe) : null;
24742
24756
  const assistMatch = line.match(assistantRe);
@@ -44265,11 +44279,16 @@ function executeSqlite(src, input) {
44265
44279
  let sessionRow;
44266
44280
  try {
44267
44281
  const sessionFloorSeconds = typeof input.sessionStartedAtMs === "number" ? Math.floor(input.sessionStartedAtMs / 1e3) : 0;
44282
+ const workspaceHint = typeof input.workspace === "string" ? input.workspace : "";
44268
44283
  const stmt = db.prepare(src.session_query);
44269
44284
  try {
44270
- sessionRow = stmt.get(sessionFloorSeconds);
44285
+ sessionRow = stmt.get({ floor: sessionFloorSeconds, workspace: workspaceHint });
44271
44286
  } catch {
44272
- sessionRow = stmt.get();
44287
+ try {
44288
+ sessionRow = stmt.get(sessionFloorSeconds);
44289
+ } catch {
44290
+ sessionRow = stmt.get();
44291
+ }
44273
44292
  }
44274
44293
  } catch {
44275
44294
  return "";
@@ -44302,12 +44321,14 @@ function executeSqlite(src, input) {
44302
44321
  }
44303
44322
  }
44304
44323
  if (messages.length === 0) return null;
44324
+ const resultWorkspace = messages.find((m) => m.workspace)?.workspace;
44305
44325
  return {
44306
44326
  messages,
44307
44327
  providerSessionId: sessionId,
44308
44328
  sourcePath: resolved,
44309
44329
  sourceMtimeMs: mtime,
44310
- nativeHistoryCoverage: "full"
44330
+ nativeHistoryCoverage: "full",
44331
+ ...resultWorkspace ? { workspace: resultWorkspace } : {}
44311
44332
  };
44312
44333
  } finally {
44313
44334
  try {
@@ -44773,9 +44794,11 @@ function projectMessages(record, map, index, total, sourceMtimeMs) {
44773
44794
  return out;
44774
44795
  }
44775
44796
  }
44797
+ const workspaceRaw = map.workspace ? jsonPathGet(record, map.workspace) : void 0;
44798
+ const workspace = typeof workspaceRaw === "string" && workspaceRaw.trim() ? workspaceRaw.trim() : void 0;
44776
44799
  const contentRaw = jsonPathGet(record, map.content);
44777
44800
  const content = cleanContent(stringifyContent(contentRaw), map);
44778
- if (content) out.push({ role, content, receivedAt, kind });
44801
+ if (content) out.push(workspace ? { role, content, receivedAt, kind, workspace } : { role, content, receivedAt, kind });
44779
44802
  if (map.tools && Array.isArray(contentRaw)) {
44780
44803
  let nudge = 1;
44781
44804
  for (const block2 of contentRaw) {