@adhdev/daemon-standalone 1.0.58-rc.40 → 1.0.58-rc.41

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
@@ -36911,10 +36911,10 @@ var require_dist3 = __commonJS({
36911
36911
  }
36912
36912
  function getDaemonBuildInfo() {
36913
36913
  if (cached2) return cached2;
36914
- const commit = readInjected(true ? "5921978d3a1d5394648991c58ba1eaa4ddcdf15f" : void 0) ?? "unknown";
36915
- const commitShort = readInjected(true ? "5921978d" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
36916
- const version2 = readInjected(true ? "1.0.58-rc.40" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
36917
- const builtAt = readInjected(true ? "2026-08-29T09:16:34.881Z" : void 0);
36914
+ const commit = readInjected(true ? "384bdc1ff5122cbff80c9a54e478fcc80827b0c8" : void 0) ?? "unknown";
36915
+ const commitShort = readInjected(true ? "384bdc1f" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
36916
+ const version2 = readInjected(true ? "1.0.58-rc.41" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
36917
+ const builtAt = readInjected(true ? "2026-08-29T12:46:51.807Z" : void 0);
36918
36918
  cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
36919
36919
  return cached2;
36920
36920
  }
@@ -38708,6 +38708,48 @@ var require_dist3 = __commonJS({
38708
38708
  MONTHLY_WINDOW_MINUTES = 43200;
38709
38709
  }
38710
38710
  });
38711
+ function isSecretLikeEnvKey(key2) {
38712
+ return SECRET_LIKE_KEY_PATTERN.test(key2);
38713
+ }
38714
+ function applyDaemonEnvOverrides(overrides, env2 = process.env, logFn = () => {
38715
+ }) {
38716
+ const result = {
38717
+ applied: {},
38718
+ skippedRejected: [],
38719
+ skippedExplicitEnv: [],
38720
+ unknownKeys: []
38721
+ };
38722
+ if (!overrides) return result;
38723
+ for (const [key2, value] of Object.entries(overrides)) {
38724
+ if (typeof key2 !== "string" || !key2.trim()) continue;
38725
+ if (typeof value !== "string") continue;
38726
+ if (isSecretLikeEnvKey(key2)) {
38727
+ result.skippedRejected.push(key2);
38728
+ logFn(`rejected secret-shaped key "${key2}" from config.envOverrides \u2014 identity/secret persistence is out of scope for this map`);
38729
+ continue;
38730
+ }
38731
+ if (typeof env2[key2] === "string" && env2[key2] !== "") {
38732
+ result.skippedExplicitEnv.push(key2);
38733
+ continue;
38734
+ }
38735
+ if (!KNOWN_FLAG_KEYS.has(key2)) {
38736
+ result.unknownKeys.push(key2);
38737
+ logFn(`applying unrecognized key "${key2}" from config.envOverrides \u2014 verify spelling if this doesn't take effect`);
38738
+ }
38739
+ env2[key2] = value;
38740
+ result.applied[key2] = value;
38741
+ }
38742
+ return result;
38743
+ }
38744
+ var SECRET_LIKE_KEY_PATTERN;
38745
+ var KNOWN_FLAG_KEYS;
38746
+ var init_env_overrides = __esm2({
38747
+ "src/config/env-overrides.ts"() {
38748
+ "use strict";
38749
+ SECRET_LIKE_KEY_PATTERN = /TOKEN|SECRET|PASSWORD|PASSWD|CREDENTIAL|API[_-]?KEY|PRIVATE[_-]?KEY|COOKIE/i;
38750
+ KNOWN_FLAG_KEYS = /* @__PURE__ */ new Set(["ADHDEV_WORKER_MCP"]);
38751
+ }
38752
+ });
38711
38753
  var config_exports = {};
38712
38754
  __export2(config_exports, {
38713
38755
  clearAuthCredentials: () => clearAuthCredentials,
@@ -38753,6 +38795,17 @@ var require_dist3 = __commonJS({
38753
38795
  }
38754
38796
  return fallback;
38755
38797
  }
38798
+ function normalizeEnvOverrides(value) {
38799
+ if (!isPlainObject2(value)) return {};
38800
+ const result = {};
38801
+ for (const [key2, raw] of Object.entries(value)) {
38802
+ if (typeof key2 !== "string" || !key2.trim()) continue;
38803
+ if (typeof raw !== "string") continue;
38804
+ if (isSecretLikeEnvKey(key2)) continue;
38805
+ result[key2] = raw;
38806
+ }
38807
+ return result;
38808
+ }
38756
38809
  function normalizeMachineProviders(value) {
38757
38810
  if (!isPlainObject2(value)) return {};
38758
38811
  const result = {};
@@ -38813,7 +38866,8 @@ var require_dist3 = __commonJS({
38813
38866
  // behavior-neutral for stale configs; anything absent or unknown
38814
38867
  // resolves to THIS binary's build track instead of failing.
38815
38868
  updateChannel: parsed.updateChannel === "preview" || parsed.updateChannel === "next" ? "preview" : parsed.updateChannel === "stable" || parsed.updateChannel === "latest" ? "stable" : TRACK,
38816
- terminalSizingMode: parsed.terminalSizingMode === "fit" ? "fit" : "measured"
38869
+ terminalSizingMode: parsed.terminalSizingMode === "fit" ? "fit" : "measured",
38870
+ envOverrides: normalizeEnvOverrides(parsed.envOverrides)
38817
38871
  };
38818
38872
  }
38819
38873
  function generateMachineId() {
@@ -38966,6 +39020,7 @@ var require_dist3 = __commonJS({
38966
39020
  import_crypto2 = require("crypto");
38967
39021
  init_config_dir();
38968
39022
  init_track_identity();
39023
+ init_env_overrides();
38969
39024
  DEFAULT_CONFIG = {
38970
39025
  // Track-stamped default origin: identical to the historical literal on
38971
39026
  // stable builds ('https://api.adhf.dev'); preview builds default to the
@@ -38992,7 +39047,8 @@ var require_dist3 = __commonJS({
38992
39047
  ideSettings: {},
38993
39048
  providerSourceMode: "normal",
38994
39049
  updateChannel: "stable",
38995
- terminalSizingMode: "measured"
39050
+ terminalSizingMode: "measured",
39051
+ envOverrides: {}
38996
39052
  };
38997
39053
  MACHINE_ID_PREFIX = "mach_";
38998
39054
  }
@@ -65502,7 +65558,7 @@ CREATE TABLE IF NOT EXISTS sq_archive (
65502
65558
  `).run(meshId, nodeId, sessionId, providerType, expiresAt, metadata ? JSON.stringify(metadata) : null);
65503
65559
  }
65504
65560
  getRemoteIdleSessions(meshId) {
65505
- const rows = this.db.prepare("SELECT node_id, session_id, provider_type, expires_at, metadata FROM remote_idle_sessions WHERE mesh_id = ?").all(meshId);
65561
+ const rows = this.db.prepare("SELECT node_id, session_id, provider_type, expires_at, metadata FROM remote_idle_sessions WHERE mesh_id = ? AND expires_at > ?").all(meshId, Date.now());
65506
65562
  return rows.map((r) => ({
65507
65563
  nodeId: r.node_id,
65508
65564
  sessionId: r.session_id,
@@ -65514,6 +65570,11 @@ CREATE TABLE IF NOT EXISTS sq_archive (
65514
65570
  deleteRemoteIdleSession(meshId, nodeId, sessionId) {
65515
65571
  this.db.prepare("DELETE FROM remote_idle_sessions WHERE mesh_id = ? AND node_id = ? AND session_id = ?").run(meshId, nodeId, sessionId);
65516
65572
  }
65573
+ // CLAIM-RETRY-LOOP-LIFECYCLE: deleteRemoteIdleSession above fires only on a successful
65574
+ // claim; called from remove_mesh_node to clear a node's row on removal instead.
65575
+ deleteRemoteIdleSessionsForNode(meshId, nodeId) {
65576
+ this.db.prepare("DELETE FROM remote_idle_sessions WHERE mesh_id = ? AND node_id = ?").run(meshId, nodeId);
65577
+ }
65517
65578
  pruneExpiredRemoteIdleSessions() {
65518
65579
  this.db.prepare("DELETE FROM remote_idle_sessions WHERE expires_at <= ?").run(Date.now());
65519
65580
  }
@@ -88213,6 +88274,97 @@ ${cleanBody}`;
88213
88274
  init_chat_message_normalization();
88214
88275
  }
88215
88276
  });
88277
+ function flattenMessage(message) {
88278
+ const meta3 = message.meta && typeof message.meta === "object" ? message.meta : void 0;
88279
+ return {
88280
+ role: message.role,
88281
+ kind: message.kind,
88282
+ content: flattenContent(message.content),
88283
+ receivedAt: message.receivedAt,
88284
+ timestamp: message.timestamp,
88285
+ turnKey: message._turnKey,
88286
+ bubbleState: message.bubbleState,
88287
+ senderName: message.senderName,
88288
+ toolName: void 0,
88289
+ meta: meta3
88290
+ };
88291
+ }
88292
+ function buildTranscriptObservationFromReadChat(input) {
88293
+ if (!input.sessionId || !input.providerType) return null;
88294
+ return {
88295
+ sessionId: input.sessionId,
88296
+ historySessionId: input.historySessionId ?? null,
88297
+ providerType: input.providerType,
88298
+ providerSessionId: input.providerSessionId ?? null,
88299
+ status: input.status,
88300
+ providerObservedStatus: input.providerObservedStatus,
88301
+ title: input.title ?? null,
88302
+ activeModal: input.activeModal ?? null,
88303
+ activeInteractivePrompt: input.activeInteractivePrompt ?? null,
88304
+ turn: input.turn,
88305
+ provenance: input.provenance,
88306
+ messages: input.messages.map(flattenMessage),
88307
+ terminalMarkers: [],
88308
+ coverage: input.coverage
88309
+ };
88310
+ }
88311
+ var init_transcript_observation_builder = __esm2({
88312
+ "src/commands/transcript-observation-builder.ts"() {
88313
+ "use strict";
88314
+ init_contracts2();
88315
+ }
88316
+ });
88317
+ var TRANSCRIPT_REVISION_CHUNK_BYTES;
88318
+ var MAX_TRANSCRIPT_REVISION_ROWS;
88319
+ var MAX_TRANSCRIPT_REVISION_CHUNKS;
88320
+ var init_transcript_revision_codec = __esm2({
88321
+ "src/seqscribe/transcript-revision-codec.ts"() {
88322
+ "use strict";
88323
+ init_dist();
88324
+ init_dist2();
88325
+ TRANSCRIPT_REVISION_CHUNK_BYTES = 36 * 1024;
88326
+ MAX_TRANSCRIPT_REVISION_ROWS = 240;
88327
+ MAX_TRANSCRIPT_REVISION_CHUNKS = MAX_TRANSCRIPT_REVISION_ROWS - 2;
88328
+ }
88329
+ });
88330
+ var init_transcript_projection = __esm2({
88331
+ "src/seqscribe/transcript-projection.ts"() {
88332
+ "use strict";
88333
+ init_dist2();
88334
+ }
88335
+ });
88336
+ var init_transcript_observation = __esm2({
88337
+ "src/seqscribe/transcript-observation.ts"() {
88338
+ "use strict";
88339
+ init_dist2();
88340
+ }
88341
+ });
88342
+ var init_transcript_mode = __esm2({
88343
+ "src/seqscribe/transcript-mode.ts"() {
88344
+ "use strict";
88345
+ init_logger();
88346
+ }
88347
+ });
88348
+ function notifyTranscriptObservation(sessionId, observation) {
88349
+ activeService?.observe(sessionId, observation);
88350
+ }
88351
+ function markTranscriptSessionDirty(sessionId) {
88352
+ activeService?.markDirty(sessionId);
88353
+ }
88354
+ var import_node_crypto4;
88355
+ var activeService;
88356
+ var init_transcript_publisher = __esm2({
88357
+ "src/seqscribe/transcript-publisher.ts"() {
88358
+ "use strict";
88359
+ import_node_crypto4 = require("crypto");
88360
+ init_logger();
88361
+ init_transcript_revision_codec();
88362
+ init_transcript_projection();
88363
+ init_transcript_observation();
88364
+ init_transcript_mode();
88365
+ activeService = null;
88366
+ }
88367
+ });
88216
88368
  function shouldPreserveReadChatPayloadField(key2) {
88217
88369
  return key2 === "messageSource" || key2 === "transcriptProvenance";
88218
88370
  }
@@ -88347,6 +88499,30 @@ ${cleanBody}`;
88347
88499
  if (preservedPayloadFields.transcriptProvenance) {
88348
88500
  preservedPayloadFields.transcriptProvenance = updateMessageSourceReturnedCount(preservedPayloadFields.transcriptProvenance, sync.messages.length);
88349
88501
  }
88502
+ try {
88503
+ const observation = buildTranscriptObservationFromReadChat({
88504
+ sessionId: sessionIdHint || presentationSessionIdHint,
88505
+ historySessionId: typeof validatedPayload.historySessionId === "string" ? validatedPayload.historySessionId : null,
88506
+ providerType: providerHint || turnPresentation.providerType || "",
88507
+ providerSessionId: typeof validatedPayload.providerSessionId === "string" ? validatedPayload.providerSessionId : null,
88508
+ status: effectiveStatus,
88509
+ providerObservedStatus: legacyStatus,
88510
+ title: typeof validatedPayload.title === "string" ? validatedPayload.title : null,
88511
+ activeModal: validatedPayload.activeModal ?? null,
88512
+ activeInteractivePrompt: validatedPayload.activeInteractivePrompt ?? null,
88513
+ turn: turnPresentation.authority === "turn_reducer" ? turnPresentation : null,
88514
+ provenance: preservedPayloadFields,
88515
+ messages: visibleMessages,
88516
+ coverage: {
88517
+ mode: "full",
88518
+ totalMessageCount: messages.length,
88519
+ returnedMessageCount: visibleMessages.length,
88520
+ omittedBefore: false
88521
+ }
88522
+ });
88523
+ if (observation) notifyTranscriptObservation(observation.sessionId, observation);
88524
+ } catch {
88525
+ }
88350
88526
  const returnedDebugReadChat = debugReadChat ? {
88351
88527
  ...debugReadChat,
88352
88528
  fullMsgCount: typeof debugReadChat.fullMsgCount === "number" ? debugReadChat.fullMsgCount : messages.length,
@@ -88395,6 +88571,8 @@ ${cleanBody}`;
88395
88571
  init_mesh_turn_presentation();
88396
88572
  init_chat_message_normalization();
88397
88573
  init_read_chat_message_filters();
88574
+ init_transcript_observation_builder();
88575
+ init_transcript_publisher();
88398
88576
  }
88399
88577
  });
88400
88578
  function getMeshV2BackstopCounters() {
@@ -90685,8 +90863,9 @@ ${cleanBody}`;
90685
90863
  for (const mesh of listMeshes()) {
90686
90864
  const selfIds = resolveCoordinatorSelfIds(mesh, drainDaemonIds);
90687
90865
  if (!daemonHostsMesh(mesh, selfIds)) continue;
90866
+ const nodeAwareMesh = getMeshWithCache(components, mesh.id) ?? mesh;
90688
90867
  try {
90689
- await pullRemoteNodeQueues(components, mesh, localDaemonId, selfIds);
90868
+ await pullRemoteNodeQueues(components, nodeAwareMesh, localDaemonId, selfIds);
90690
90869
  } catch (e) {
90691
90870
  LOG2.warn("MeshReconcile", `Remote node pull failed for mesh ${mesh.id}: ${e?.message || e}`);
90692
90871
  }
@@ -99723,6 +99902,7 @@ ${e?.stderr || ""}`;
99723
99902
  appendLedgerEntry: () => appendLedgerEntry,
99724
99903
  appendRecentActivity: () => appendRecentActivity,
99725
99904
  appendRemoteLedgerEntries: () => appendRemoteLedgerEntries,
99905
+ applyDaemonEnvOverrides: () => applyDaemonEnvOverrides,
99726
99906
  armBeacon: () => armBeacon,
99727
99907
  assertNoDependencyCycle: () => assertNoDependencyCycle,
99728
99908
  assertNoPlaintextHintTopics: () => assertNoPlaintextHintTopics,
@@ -99985,6 +100165,7 @@ ${e?.stderr || ""}`;
99985
100165
  isPreviewReleaseChannel: () => isPreviewReleaseChannel,
99986
100166
  isProjectedPayloadKey: () => isProjectedPayloadKey,
99987
100167
  isRestartBlockingPresentation: () => isRestartBlockingPresentation,
100168
+ isSecretLikeEnvKey: () => isSecretLikeEnvKey,
99988
100169
  isSessionHostLiveRuntime: () => import_session_host_core32.isSessionHostLiveRuntime,
99989
100170
  isSessionHostRecoverySnapshot: () => import_session_host_core32.isSessionHostRecoverySnapshot,
99990
100171
  isSetupComplete: () => isSetupComplete,
@@ -101617,6 +101798,7 @@ ${e?.stderr || ""}`;
101617
101798
  };
101618
101799
  init_git_worktree();
101619
101800
  init_config();
101801
+ init_env_overrides();
101620
101802
  init_config_dir();
101621
101803
  init_embedded_path_health();
101622
101804
  var os11 = __toESM2(require("os"));
@@ -106962,7 +107144,7 @@ ${effect.notification.body || ""}`.trim();
106962
107144
  }
106963
107145
  var fs21 = __toESM2(require("fs"));
106964
107146
  var path30 = __toESM2(require("path"));
106965
- var import_node_crypto4 = require("crypto");
107147
+ var import_node_crypto5 = require("crypto");
106966
107148
  init_config();
106967
107149
  init_logger();
106968
107150
  init_debug_trace();
@@ -109105,7 +109287,7 @@ ${effect.notification.body || ""}`.trim();
109105
109287
  function createChatDebugBundleId(targetSessionId) {
109106
109288
  const timestamp2 = (/* @__PURE__ */ new Date()).toISOString().replace(/[-:.]/g, "").replace("T", "T").replace("Z", "Z");
109107
109289
  const sessionSegment = safeBundleIdSegment(targetSessionId, "unknown-session");
109108
- return `chat-debug-${timestamp2}-${sessionSegment}-${(0, import_node_crypto4.randomUUID)().slice(0, 8)}`;
109290
+ return `chat-debug-${timestamp2}-${sessionSegment}-${(0, import_node_crypto5.randomUUID)().slice(0, 8)}`;
109109
109291
  }
109110
109292
  function buildChatDebugBundleSummary(bundle) {
109111
109293
  const target = bundle.target && typeof bundle.target === "object" ? bundle.target : {};
@@ -121553,7 +121735,7 @@ ${marker}`,
121553
121735
  return out;
121554
121736
  }
121555
121737
  var fs40 = __toESM2(require("fs"));
121556
- var import_node_crypto5 = require("crypto");
121738
+ var import_node_crypto6 = require("crypto");
121557
121739
  init_provider_cli_shared();
121558
121740
  init_logger();
121559
121741
  init_logger();
@@ -122121,7 +122303,7 @@ ${marker}`,
122121
122303
  } catch {
122122
122304
  }
122123
122305
  const truncation = truncateToByteTailByLine(rawViewport, cap);
122124
- const hash2 = (0, import_node_crypto5.createHash)("sha256").update(rawViewport, "utf8").digest("hex").slice(0, 16);
122306
+ const hash2 = (0, import_node_crypto6.createHash)("sha256").update(rawViewport, "utf8").digest("hex").slice(0, 16);
122125
122307
  return {
122126
122308
  text: truncation.text,
122127
122309
  cursor: { col: cursor.col, row: cursor.row },
@@ -135396,6 +135578,7 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
135396
135578
  init_worktree_bootstrap_config();
135397
135579
  init_mesh_events();
135398
135580
  init_mesh_clone_grace();
135581
+ init_mesh_events_utils();
135399
135582
  init_config();
135400
135583
  async function decideOssCloneSync(ossCtx, worktreeOssSha, sourceSha, rg) {
135401
135584
  if (!worktreeOssSha || !sourceSha || worktreeOssSha === sourceSha) return "noop";
@@ -136311,6 +136494,13 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
136311
136494
  if (cachedMesh) ctx.removeInlineMeshNode(meshId, cachedMesh, nodeId);
136312
136495
  }
136313
136496
  }
136497
+ if (removed) {
136498
+ try {
136499
+ const { MeshRuntimeStore: MeshRuntimeStore2 } = await Promise.resolve().then(() => (init_mesh_runtime_store(), mesh_runtime_store_exports));
136500
+ MeshRuntimeStore2.getInstance().deleteRemoteIdleSessionsForNode(meshId, nodeId);
136501
+ } catch {
136502
+ }
136503
+ }
136314
136504
  if (worktreeCleanup && worktreeCleanup.success === true && worktreeCleanup.skipped !== true) {
136315
136505
  try {
136316
136506
  const { appendLedgerEntry: appendLedgerEntry2 } = await Promise.resolve().then(() => (init_mesh_ledger(), mesh_ledger_exports));
@@ -136411,6 +136601,14 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
136411
136601
  if (forwardedNodeId) noteRecentlyClonedNode(forwardedNodeId);
136412
136602
  return forwarded ?? { success: false, error: "no response from remote node" };
136413
136603
  }
136604
+ const effectiveDaemonId = readMeshNodeDaemonId(sourceNode) || readNonEmptyString(ctx.deps.statusInstanceId) || void 0;
136605
+ const effectiveMachineId = readMeshNodeMachineId(sourceNode) || (() => {
136606
+ try {
136607
+ return readNonEmptyString(loadConfig2().machineId);
136608
+ } catch {
136609
+ return "";
136610
+ }
136611
+ })() || void 0;
136414
136612
  const repoRoot = sourceNode.repoRoot || sourceNode.workspace;
136415
136613
  const worktreeBaseDir = typeof mesh.policy?.worktreeBaseDir === "string" && mesh.policy.worktreeBaseDir.trim() ? mesh.policy.worktreeBaseDir.trim() : void 0;
136416
136614
  const { createWorktree: createWorktree2 } = await Promise.resolve().then(() => (init_git_worktree(), git_worktree_exports));
@@ -136429,15 +136627,15 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
136429
136627
  let node;
136430
136628
  const { migrateProviderRolesToSlots: migrateProviderRolesToSlots2 } = await Promise.resolve().then(() => (init_mesh_config(), mesh_config_exports));
136431
136629
  if (meshRecord.inline) {
136432
- const { randomUUID: randomUUID22 } = await import("crypto");
136630
+ const { randomUUID: randomUUID23 } = await import("crypto");
136433
136631
  const clonedPolicy = { ...sourceNode.policy || {} };
136434
136632
  migrateProviderRolesToSlots2(clonedPolicy);
136435
136633
  node = {
136436
- id: `node_${randomUUID22().replace(/-/g, "")}`,
136634
+ id: `node_${randomUUID23().replace(/-/g, "")}`,
136437
136635
  workspace: result.worktreePath,
136438
136636
  repoRoot: result.worktreePath,
136439
- daemonId: sourceNode.daemonId,
136440
- machineId: sourceNode.machineId ?? sourceNode.machine_id,
136637
+ daemonId: effectiveDaemonId,
136638
+ machineId: effectiveMachineId,
136441
136639
  userOverrides: { ...sourceNode.userOverrides || {} },
136442
136640
  policy: clonedPolicy,
136443
136641
  isLocalWorktree: true,
@@ -136451,8 +136649,8 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
136451
136649
  id: node.id,
136452
136650
  workspace: result.worktreePath,
136453
136651
  repoRoot: result.worktreePath,
136454
- daemonId: sourceNode.daemonId,
136455
- machineId: sourceNode.machineId ?? sourceNode.machine_id,
136652
+ daemonId: effectiveDaemonId,
136653
+ machineId: effectiveMachineId,
136456
136654
  userOverrides: { ...sourceNode.userOverrides || {} },
136457
136655
  isLocalWorktree: true,
136458
136656
  worktreeBranch: result.branch,
@@ -136468,8 +136666,8 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
136468
136666
  node = addNode2(meshId, {
136469
136667
  workspace: result.worktreePath,
136470
136668
  repoRoot: result.worktreePath,
136471
- daemonId: sourceNode.daemonId,
136472
- machineId: sourceNode.machineId ?? sourceNode.machine_id,
136669
+ daemonId: effectiveDaemonId,
136670
+ machineId: effectiveMachineId,
136473
136671
  userOverrides: { ...sourceNode.userOverrides || {} },
136474
136672
  isLocalWorktree: true,
136475
136673
  worktreeBranch: result.branch,
@@ -141406,6 +141604,7 @@ ${ptyResult.output.slice(-2e3)}`);
141406
141604
  }
141407
141605
  init_snapshot3();
141408
141606
  init_runtime_defaults();
141607
+ init_transcript_publisher();
141409
141608
  var DEFAULT_GIT_REFRESH_CONCURRENCY = 2;
141410
141609
  var DEFAULT_CHAT_TAIL_FLUSH_DEBOUNCE_MS = 700;
141411
141610
  var PUSH_TOPICS = ["machine.runtime", "session_host.diagnostics", "session.modal", "daemon.metadata"];
@@ -141759,6 +141958,7 @@ ${ptyResult.output.slice(-2e3)}`);
141759
141958
  markChatOutputActivity(sessionId) {
141760
141959
  const cfg = this.opts.chatTail;
141761
141960
  if (!sessionId || !(cfg?.isCliSession?.(sessionId) ?? false)) return;
141961
+ markTranscriptSessionDirty(sessionId);
141762
141962
  this.chatOutputActiveAt.set(sessionId, this.now());
141763
141963
  if (this.chatOutputFlushTimer) return;
141764
141964
  if (cfg?.scheduleGate && !cfg.scheduleGate()) return;
@@ -142252,7 +142452,17 @@ ${ptyResult.output.slice(-2e3)}`);
142252
142452
  parityRan: seqscribe.parityRan === true,
142253
142453
  parityMissingInShadowBucket: count(seqscribe.parityMissingInShadowBucket),
142254
142454
  parityExtraInShadowBucket: count(seqscribe.parityExtraInShadowBucket),
142255
- parityFieldMismatchBucket: count(seqscribe.parityFieldMismatchBucket)
142455
+ parityFieldMismatchBucket: count(seqscribe.parityFieldMismatchBucket),
142456
+ // §8 unit 2. transcriptParityPersistentMismatchBucket stays LOCAL-ONLY,
142457
+ // absent here — same asymmetry as parityPersistentMismatchBucket above.
142458
+ transcriptPublish: seqscribe.transcriptPublish === true,
142459
+ transcriptPublishedBucket: count(seqscribe.transcriptPublishedBucket),
142460
+ transcriptPublishFailedBucket: count(seqscribe.transcriptPublishFailedBucket),
142461
+ transcriptDedupedBucket: count(seqscribe.transcriptDedupedBucket),
142462
+ transcriptOversizedBucket: count(seqscribe.transcriptOversizedBucket),
142463
+ transcriptDroppedBucket: count(seqscribe.transcriptDroppedBucket),
142464
+ transcriptParityRan: seqscribe.transcriptParityRan === true,
142465
+ transcriptParityMismatchBucket: count(seqscribe.transcriptParityMismatchBucket)
142256
142466
  };
142257
142467
  }
142258
142468
  function buildCloudStatusReportPayload(sessions, p2p, timestamp2, seqscribe) {
@@ -150234,6 +150444,7 @@ data: ${JSON.stringify(msg.data)}
150234
150444
  init_logger();
150235
150445
  init_runtime_defaults();
150236
150446
  init_config();
150447
+ init_env_overrides();
150237
150448
  init_config_dir();
150238
150449
  init_contract();
150239
150450
  init_mesh_events();
@@ -151107,6 +151318,18 @@ data: ${JSON.stringify(msg.data)}
151107
151318
  parityMissingInShadowBucket: bucket(opts.parity?.missingInShadow ?? 0, BACKLOG_BUCKETS),
151108
151319
  parityExtraInShadowBucket: bucket(opts.parity?.extraInShadow ?? 0, BACKLOG_BUCKETS),
151109
151320
  parityFieldMismatchBucket: bucket(opts.parity?.fieldMismatch ?? 0, BACKLOG_BUCKETS),
151321
+ transcriptPublish: opts.transcript?.active ?? false,
151322
+ transcriptPublishedBucket: bucket(opts.transcript?.published ?? 0, BACKLOG_BUCKETS),
151323
+ transcriptPublishFailedBucket: bucket(opts.transcript?.publishFailed ?? 0, BACKLOG_BUCKETS),
151324
+ transcriptDedupedBucket: bucket(opts.transcript?.deduped ?? 0, BACKLOG_BUCKETS),
151325
+ transcriptOversizedBucket: bucket(opts.transcript?.oversized ?? 0, BACKLOG_BUCKETS),
151326
+ transcriptDroppedBucket: bucket(opts.transcript?.dropped ?? 0, BACKLOG_BUCKETS),
151327
+ transcriptParityRan: (opts.transcriptParity?.runs ?? 0) > 0,
151328
+ transcriptParityMismatchBucket: bucket(opts.transcriptParity?.mismatches ?? 0, BACKLOG_BUCKETS),
151329
+ transcriptParityPersistentMismatchBucket: bucket(
151330
+ opts.transcriptParity?.persistentMismatches ?? 0,
151331
+ BACKLOG_BUCKETS
151332
+ ),
151110
151333
  ...localDiagnostics
151111
151334
  };
151112
151335
  }
@@ -151532,6 +151755,15 @@ data: ${JSON.stringify(msg.data)}
151532
151755
  installProviderProcessShim();
151533
151756
  installGlobalInterceptor();
151534
151757
  loadMeshCoordinatorRegistry();
151758
+ const envOverrideResult = applyDaemonEnvOverrides(
151759
+ loadConfig2().envOverrides,
151760
+ process.env,
151761
+ (msg) => LOG2.warn("EnvOverrides", msg)
151762
+ );
151763
+ const appliedOverrideKeys = Object.keys(envOverrideResult.applied);
151764
+ if (appliedOverrideKeys.length > 0) {
151765
+ LOG2.info("EnvOverrides", `Applied ${appliedOverrideKeys.length} persisted env override(s) from config.json: ${appliedOverrideKeys.join(", ")}`);
151766
+ }
151535
151767
  const upgradeFailureNotice = readUpgradeFailureNotice();
151536
151768
  if (upgradeFailureNotice) {
151537
151769
  const age = upgradeFailureNotice.ageLabel ? `${upgradeFailureNotice.ageLabel}, recorded ${upgradeFailureNotice.recordedAt}` : "recorded at an unknown time";