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

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 ? "8bb24b3b4363ee0c860be949d52f6606e3d0c288" : void 0) ?? "unknown";
418
- const commitShort = readInjected(true ? "8bb24b3b" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
419
- const version = readInjected(true ? "0.9.82-rc.530" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
420
- const builtAt = readInjected(true ? "2026-07-14T15:26:36.978Z" : void 0);
417
+ const commit = readInjected(true ? "2dcb1909a41f2358986e408601c8a1284c6f3685" : void 0) ?? "unknown";
418
+ const commitShort = readInjected(true ? "2dcb1909" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
419
+ const version = readInjected(true ? "0.9.82-rc.532" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
420
+ const builtAt = readInjected(true ? "2026-07-15T07:14:52.163Z" : void 0);
421
421
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
422
422
  return cached;
423
423
  }
@@ -24659,6 +24659,9 @@ function stripAnsi2(text) {
24659
24659
  function splitLines(text) {
24660
24660
  return stripAnsi2(text).replace(//g, "").split(/\r?\n/).map((l) => l.replace(/\s+$/, ""));
24661
24661
  }
24662
+ function splitRawLines(text) {
24663
+ return String(text || "").split(/\r?\n/).map((rawLine) => ({ raw: rawLine, text: stripAnsi2(rawLine).replace(/[\x00-\x08\x0b-\x1f\x7f]/g, "").replace(/\s+$/, "") }));
24664
+ }
24662
24665
  function pickInputText(input, scope) {
24663
24666
  if (!input) return "";
24664
24667
  if (scope === "screen") return String(input.screenText || input.screen?.text || "");
@@ -24707,6 +24710,11 @@ function buildParseSessionFromTui(spec) {
24707
24710
  const requireIndentForContinuation = spec.transcriptPty.continuationLine?.indented ?? false;
24708
24711
  const stripLeadingChrome = spec.transcriptPty.stripLeadingChrome ?? true;
24709
24712
  const scope = spec.transcriptPty.scope ?? "buffer";
24713
+ const userBgList = Array.isArray(spec.transcriptPty.userBackgroundSgr) ? spec.transcriptPty.userBackgroundSgr.map((s2) => String(s2).trim()).filter(Boolean) : [];
24714
+ const userBgRes = userBgList.map((code) => {
24715
+ const esc = code.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
24716
+ return new RegExp(`\\x1b\\[[0-9;]*${esc}[0-9;]*m`);
24717
+ });
24710
24718
  const detectStatus = spec.spinner || spec.settledPrompt || spec.modal || spec.dispatchOrder ? buildDetectStatusFromTui({
24711
24719
  spinner: spec.spinner,
24712
24720
  settledPrompt: spec.settledPrompt,
@@ -24723,11 +24731,11 @@ function buildParseSessionFromTui(spec) {
24723
24731
  const status = detectStatus(input) ?? "idle";
24724
24732
  const modal = parseApproval(input);
24725
24733
  const text = pickInputText(input, scope);
24726
- const lines = splitLines(text);
24734
+ const rawLines = userBgRes.length > 0 ? splitRawLines(text) : splitLines(text).map((t) => ({ raw: "", text: t }));
24727
24735
  const messages = [];
24728
24736
  let seenFirstRoleLine = !stripLeadingChrome;
24729
- for (const raw of lines) {
24730
- const line = raw;
24737
+ for (const entry of rawLines) {
24738
+ const line = entry.text;
24731
24739
  if (line.trim() === "") {
24732
24740
  continue;
24733
24741
  }
@@ -24739,6 +24747,12 @@ function buildParseSessionFromTui(spec) {
24739
24747
  }
24740
24748
  }
24741
24749
  if (isChrome) continue;
24750
+ if (userBgRes.length > 0 && entry.raw && userBgRes.some((re) => re.test(entry.raw))) {
24751
+ seenFirstRoleLine = true;
24752
+ const content = line.replace(/^\s*[→>›❯]\s*/, "").trim();
24753
+ if (content) messages.push({ role: "user", kind: "standard", content });
24754
+ continue;
24755
+ }
24742
24756
  const userMatch = userRe ? line.match(userRe) : null;
24743
24757
  const toolMatch = toolRe ? line.match(toolRe) : null;
24744
24758
  const assistMatch = line.match(assistantRe);
@@ -43837,11 +43851,16 @@ function executeSqlite(src, input) {
43837
43851
  let sessionRow;
43838
43852
  try {
43839
43853
  const sessionFloorSeconds = typeof input.sessionStartedAtMs === "number" ? Math.floor(input.sessionStartedAtMs / 1e3) : 0;
43854
+ const workspaceHint = typeof input.workspace === "string" ? input.workspace : "";
43840
43855
  const stmt = db.prepare(src.session_query);
43841
43856
  try {
43842
- sessionRow = stmt.get(sessionFloorSeconds);
43857
+ sessionRow = stmt.get({ floor: sessionFloorSeconds, workspace: workspaceHint });
43843
43858
  } catch {
43844
- sessionRow = stmt.get();
43859
+ try {
43860
+ sessionRow = stmt.get(sessionFloorSeconds);
43861
+ } catch {
43862
+ sessionRow = stmt.get();
43863
+ }
43845
43864
  }
43846
43865
  } catch {
43847
43866
  return "";
@@ -43874,12 +43893,14 @@ function executeSqlite(src, input) {
43874
43893
  }
43875
43894
  }
43876
43895
  if (messages.length === 0) return null;
43896
+ const resultWorkspace = messages.find((m) => m.workspace)?.workspace;
43877
43897
  return {
43878
43898
  messages,
43879
43899
  providerSessionId: sessionId,
43880
43900
  sourcePath: resolved,
43881
43901
  sourceMtimeMs: mtime,
43882
- nativeHistoryCoverage: "full"
43902
+ nativeHistoryCoverage: "full",
43903
+ ...resultWorkspace ? { workspace: resultWorkspace } : {}
43883
43904
  };
43884
43905
  } finally {
43885
43906
  try {
@@ -44345,9 +44366,11 @@ function projectMessages(record, map, index, total, sourceMtimeMs) {
44345
44366
  return out;
44346
44367
  }
44347
44368
  }
44369
+ const workspaceRaw = map.workspace ? jsonPathGet(record, map.workspace) : void 0;
44370
+ const workspace = typeof workspaceRaw === "string" && workspaceRaw.trim() ? workspaceRaw.trim() : void 0;
44348
44371
  const contentRaw = jsonPathGet(record, map.content);
44349
44372
  const content = cleanContent(stringifyContent(contentRaw), map);
44350
- if (content) out.push({ role, content, receivedAt, kind });
44373
+ if (content) out.push(workspace ? { role, content, receivedAt, kind, workspace } : { role, content, receivedAt, kind });
44351
44374
  if (map.tools && Array.isArray(contentRaw)) {
44352
44375
  let nudge = 1;
44353
44376
  for (const block2 of contentRaw) {