@adhdev/daemon-standalone 0.9.77-rc.50 → 0.9.77-rc.57

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/public/index.html CHANGED
@@ -7,9 +7,9 @@
7
7
  <meta name="description" content="ADHDev self-hosted dashboard for controlling AI agents" />
8
8
  <link rel="icon" href="/otter-logo.png" />
9
9
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet" />
10
- <script type="module" crossorigin src="/assets/index-BWLH33S7.js"></script>
11
- <link rel="modulepreload" crossorigin href="/assets/vendor-CLec0455.js">
12
- <link rel="stylesheet" crossorigin href="/assets/index-BdY6qPu0.css">
10
+ <script type="module" crossorigin src="/assets/index-m6K5hfST.js"></script>
11
+ <link rel="modulepreload" crossorigin href="/assets/vendor-BoAU5RMW.js">
12
+ <link rel="stylesheet" crossorigin href="/assets/index-01wE493H.css">
13
13
  </head>
14
14
  <body>
15
15
  <!-- Apply theme immediately to prevent FOIT (Flash of Incorrect Theme) -->
@@ -35,6 +35,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
35
35
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
36
36
 
37
37
  // ../session-host-core/dist/index.mjs
38
+ function generateUUID2() {
39
+ if (typeof crypto !== "undefined" && crypto.randomUUID) {
40
+ return crypto.randomUUID();
41
+ }
42
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
43
+ const r = Math.random() * 16 | 0;
44
+ const v = c === "x" ? r : r & 3 | 8;
45
+ return v.toString(16);
46
+ });
47
+ }
38
48
  function getDefaultSessionHostEndpoint(appName = "adhdev") {
39
49
  if (process.platform === "win32") {
40
50
  return {
@@ -111,14 +121,13 @@ function ensureNodePtySpawnHelperPermissions(logFn) {
111
121
  } catch {
112
122
  }
113
123
  }
114
- var os, path2, net, import_crypto, os2, path3, __require, DEFAULT_SESSION_RING_BUFFER_MAX_BYTES, DEFAULT_SESSION_HOST_COLS, DEFAULT_SESSION_HOST_ROWS, SessionHostClient;
124
+ var os, path2, net, os2, path3, __require, DEFAULT_SESSION_RING_BUFFER_MAX_BYTES, DEFAULT_SESSION_HOST_COLS, DEFAULT_SESSION_HOST_ROWS, SessionHostClient;
115
125
  var init_dist = __esm({
116
126
  "../session-host-core/dist/index.mjs"() {
117
127
  "use strict";
118
128
  os = __toESM(require("os"), 1);
119
129
  path2 = __toESM(require("path"), 1);
120
130
  net = __toESM(require("net"), 1);
121
- import_crypto = require("crypto");
122
131
  os2 = __toESM(require("os"), 1);
123
132
  path3 = __toESM(require("path"), 1);
124
133
  __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
@@ -189,7 +198,7 @@ var init_dist = __esm({
189
198
  async request(request) {
190
199
  await this.connect();
191
200
  if (!this.socket) throw new Error("Session host socket unavailable");
192
- const requestId = (0, import_crypto.randomUUID)();
201
+ const requestId = generateUUID2();
193
202
  const envelope = {
194
203
  kind: "request",
195
204
  requestId,
@@ -25113,6 +25122,7 @@ __export(dist_exports, {
25113
25122
  buildChatTailDeliverySignature: () => buildChatTailDeliverySignature,
25114
25123
  buildCoordinatorSystemPrompt: () => buildCoordinatorSystemPrompt,
25115
25124
  buildMachineInfo: () => buildMachineInfo,
25125
+ buildMeshGraph: () => buildMeshGraph,
25116
25126
  buildMeshLedgerReconciliationEvidence: () => buildMeshLedgerReconciliationEvidence,
25117
25127
  buildMeshLedgerReplicaEvidence: () => buildMeshLedgerReplicaEvidence,
25118
25128
  buildP2pRelayFailurePayload: () => buildP2pRelayFailurePayload,
@@ -25132,6 +25142,7 @@ __export(dist_exports, {
25132
25142
  classifyHotChatSessionsForSubscriptionFlush: () => classifyHotChatSessionsForSubscriptionFlush,
25133
25143
  classifyP2pRelayFailure: () => classifyP2pRelayFailure,
25134
25144
  clearDebugTrace: () => clearDebugTrace,
25145
+ clearPendingMeshCoordinatorEvents: () => clearPendingMeshCoordinatorEvents,
25135
25146
  compareGitSnapshots: () => compareGitSnapshots,
25136
25147
  configureDebugTraceStore: () => configureDebugTraceStore,
25137
25148
  connectCdpManager: () => connectCdpManager,
@@ -25147,6 +25158,7 @@ __export(dist_exports, {
25147
25158
  detectAllVersions: () => detectAllVersions,
25148
25159
  detectCLIs: () => detectCLIs,
25149
25160
  detectIDEs: () => detectIDEs,
25161
+ drainPendingMeshCoordinatorEvents: () => drainPendingMeshCoordinatorEvents,
25150
25162
  enqueueTask: () => enqueueTask,
25151
25163
  ensureSessionHostReady: () => ensureSessionHostReady,
25152
25164
  execNpmCommandSync: () => execNpmCommandSync,
@@ -25173,6 +25185,7 @@ __export(dist_exports, {
25173
25185
  getMeshByRepo: () => getMeshByRepo,
25174
25186
  getMeshQueueStats: () => getMeshQueueStats,
25175
25187
  getNpmExecOptions: () => getNpmExecOptions,
25188
+ getPendingMeshCoordinatorEvents: () => getPendingMeshCoordinatorEvents,
25176
25189
  getQueue: () => getQueue,
25177
25190
  getRecentActivity: () => getRecentActivity,
25178
25191
  getRecentCommands: () => getRecentCommands,
@@ -25490,7 +25503,7 @@ function normalizeConfig(raw) {
25490
25503
  };
25491
25504
  }
25492
25505
  function generateMachineId() {
25493
- return `${MACHINE_ID_PREFIX}${(0, import_crypto2.randomUUID)().replace(/-/g, "")}`;
25506
+ return `${MACHINE_ID_PREFIX}${(0, import_crypto.randomUUID)().replace(/-/g, "")}`;
25494
25507
  }
25495
25508
  function isStableMachineId(machineId) {
25496
25509
  return typeof machineId === "string" && machineId.startsWith(MACHINE_ID_PREFIX);
@@ -25672,7 +25685,7 @@ function createMesh(opts) {
25672
25685
  if (!repoIdentity) throw new Error("Either repoRemoteUrl or repoIdentity is required");
25673
25686
  const now = (/* @__PURE__ */ new Date()).toISOString();
25674
25687
  const mesh = {
25675
- id: `mesh_${(0, import_crypto3.randomUUID)().replace(/-/g, "")}`,
25688
+ id: `mesh_${(0, import_crypto2.randomUUID)().replace(/-/g, "")}`,
25676
25689
  name: opts.name.trim().slice(0, 100),
25677
25690
  repoIdentity,
25678
25691
  repoRemoteUrl: opts.repoRemoteUrl,
@@ -25718,7 +25731,7 @@ function addNode(meshId, opts) {
25718
25731
  throw new Error("This workspace is already in the mesh");
25719
25732
  }
25720
25733
  const node = {
25721
- id: `node_${(0, import_crypto3.randomUUID)().replace(/-/g, "")}`,
25734
+ id: `node_${(0, import_crypto2.randomUUID)().replace(/-/g, "")}`,
25722
25735
  workspace: opts.workspace.trim(),
25723
25736
  repoRoot: opts.repoRoot,
25724
25737
  daemonId: opts.daemonId,
@@ -25900,7 +25913,7 @@ function buildTaskCompletionEvidence(opts) {
25900
25913
  }
25901
25914
  function appendLedgerEntry(meshId, partial2) {
25902
25915
  const entry = {
25903
- id: (0, import_crypto4.randomUUID)(),
25916
+ id: (0, import_crypto3.randomUUID)(),
25904
25917
  meshId,
25905
25918
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
25906
25919
  ...partial2
@@ -26179,7 +26192,7 @@ function writeQueue(meshId, queue) {
26179
26192
  function enqueueTask(meshId, message, opts) {
26180
26193
  const queue = readQueue(meshId);
26181
26194
  const entry = {
26182
- id: (0, import_crypto5.randomUUID)(),
26195
+ id: (0, import_crypto4.randomUUID)(),
26183
26196
  meshId,
26184
26197
  message,
26185
26198
  status: "pending",
@@ -26216,6 +26229,7 @@ function claimNextTask(meshId, nodeId, sessionId) {
26216
26229
  entry.status = "assigned";
26217
26230
  entry.assignedNodeId = nodeId;
26218
26231
  entry.assignedSessionId = sessionId;
26232
+ entry.dispatchTimestamp = (/* @__PURE__ */ new Date()).toISOString();
26219
26233
  entry.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
26220
26234
  writeQueue(meshId, queue);
26221
26235
  return entry;
@@ -26278,15 +26292,22 @@ function requeueTask(meshId, taskId, opts) {
26278
26292
  }
26279
26293
  function updateSessionTaskStatus(meshId, sessionId, status) {
26280
26294
  const queue = readQueue(meshId);
26295
+ let bestIdx = -1;
26296
+ let bestTime = 0;
26281
26297
  for (let i = queue.length - 1; i >= 0; i--) {
26282
26298
  if (queue[i].assignedSessionId === sessionId && queue[i].status === "assigned") {
26283
- queue[i].status = status;
26284
- queue[i].updatedAt = (/* @__PURE__ */ new Date()).toISOString();
26285
- writeQueue(meshId, queue);
26286
- return queue[i];
26299
+ const time3 = new Date(queue[i].dispatchTimestamp || queue[i].updatedAt).getTime();
26300
+ if (time3 > bestTime) {
26301
+ bestTime = time3;
26302
+ bestIdx = i;
26303
+ }
26287
26304
  }
26288
26305
  }
26289
- return null;
26306
+ if (bestIdx === -1) return null;
26307
+ queue[bestIdx].status = status;
26308
+ queue[bestIdx].updatedAt = (/* @__PURE__ */ new Date()).toISOString();
26309
+ writeQueue(meshId, queue);
26310
+ return queue[bestIdx];
26290
26311
  }
26291
26312
  function getMeshQueueStats(meshId) {
26292
26313
  const queue = readQueue(meshId);
@@ -26597,6 +26618,12 @@ function installGlobalInterceptor() {
26597
26618
  function drainPendingMeshCoordinatorEvents() {
26598
26619
  return pendingMeshCoordinatorEvents.splice(0);
26599
26620
  }
26621
+ function getPendingMeshCoordinatorEvents() {
26622
+ return pendingMeshCoordinatorEvents.slice();
26623
+ }
26624
+ function clearPendingMeshCoordinatorEvents() {
26625
+ pendingMeshCoordinatorEvents.splice(0);
26626
+ }
26600
26627
  function readNonEmptyString(value) {
26601
26628
  return typeof value === "string" && value.trim() ? value.trim() : "";
26602
26629
  }
@@ -28994,7 +29021,7 @@ function addWorkspaceEntry(config2, rawPath, label, options) {
28994
29021
  return { error: `Maximum ${MAX_WORKSPACES} workspaces` };
28995
29022
  }
28996
29023
  const entry = {
28997
- id: (0, import_crypto6.randomUUID)(),
29024
+ id: (0, import_crypto5.randomUUID)(),
28998
29025
  path: abs,
28999
29026
  label: (label || "").trim() || defaultWorkspaceLabel(abs),
29000
29027
  addedAt: Date.now()
@@ -29407,6 +29434,227 @@ function buildMeshLedgerReconciliationEvidence(meshId, replicas) {
29407
29434
  }
29408
29435
  };
29409
29436
  }
29437
+ function isDirty(git) {
29438
+ if (!git) return false;
29439
+ return git.staged + git.modified + git.untracked + git.deleted + git.renamed > 0;
29440
+ }
29441
+ function dirtyFileCount(git) {
29442
+ if (!git) return 0;
29443
+ return git.staged + git.modified + git.untracked + git.deleted + git.renamed;
29444
+ }
29445
+ function detectOrphanReasons(node, defaultBranch) {
29446
+ const reasons = [];
29447
+ const git = node.git;
29448
+ if (!git) {
29449
+ reasons.push("No git status available");
29450
+ return reasons;
29451
+ }
29452
+ if (!git.isGitRepo) {
29453
+ reasons.push("Not a git repository");
29454
+ return reasons;
29455
+ }
29456
+ if (git.branch === null && git.headCommit) {
29457
+ reasons.push("Detached HEAD");
29458
+ }
29459
+ if (git.branch && !git.upstream) {
29460
+ if (defaultBranch && git.branch !== defaultBranch) {
29461
+ reasons.push(`No upstream: ${git.branch}`);
29462
+ }
29463
+ }
29464
+ if (git.branch && git.upstream === null && defaultBranch && git.branch !== defaultBranch) {
29465
+ if (!reasons.includes(`No upstream: ${git.branch}`)) {
29466
+ reasons.push(`No upstream: ${git.branch}`);
29467
+ }
29468
+ }
29469
+ if (node.error) {
29470
+ reasons.push(`Error: ${node.error}`);
29471
+ }
29472
+ return reasons;
29473
+ }
29474
+ function nodeHealthPriority(health) {
29475
+ switch (health) {
29476
+ case "online":
29477
+ return 0;
29478
+ case "dirty":
29479
+ return 1;
29480
+ case "degraded":
29481
+ return 2;
29482
+ case "wrong_branch":
29483
+ return 3;
29484
+ case "offline":
29485
+ return 4;
29486
+ case "unknown":
29487
+ return 5;
29488
+ default:
29489
+ return 5;
29490
+ }
29491
+ }
29492
+ function pickDominantHealth(healths) {
29493
+ if (healths.length === 0) return "unknown";
29494
+ return healths.reduce(
29495
+ (best, h) => nodeHealthPriority(h) > nodeHealthPriority(best) ? h : best
29496
+ );
29497
+ }
29498
+ function buildMeshGraph(status) {
29499
+ const nodes = [];
29500
+ const edges = [];
29501
+ const warnings = [];
29502
+ const branchToNodeIds = /* @__PURE__ */ new Map();
29503
+ for (const nodeStatus of status.nodes) {
29504
+ const git = nodeStatus.git;
29505
+ const branch = git?.branch || null;
29506
+ const orphanReasons = detectOrphanReasons(nodeStatus, null);
29507
+ const dirty = isDirty(git);
29508
+ const dfc = dirtyFileCount(git);
29509
+ let type2 = "worktreeNode";
29510
+ if (orphanReasons.length > 0) {
29511
+ type2 = "orphanNode";
29512
+ }
29513
+ const graphNode = {
29514
+ id: nodeStatus.nodeId,
29515
+ type: type2,
29516
+ label: nodeStatus.machineLabel || nodeStatus.nodeId.slice(0, 8),
29517
+ workspace: nodeStatus.workspace,
29518
+ branch,
29519
+ health: nodeStatus.health,
29520
+ ahead: git?.ahead ?? 0,
29521
+ behind: git?.behind ?? 0,
29522
+ dirty,
29523
+ dirtyFiles: dfc,
29524
+ hasConflicts: git?.hasConflicts ?? false,
29525
+ activeSessionCount: nodeStatus.activeSessions?.length ?? 0,
29526
+ activeSessions: nodeStatus.activeSessions ?? [],
29527
+ providers: nodeStatus.providers ?? [],
29528
+ isOrphan: orphanReasons.length > 0,
29529
+ orphanReasons,
29530
+ source: nodeStatus
29531
+ };
29532
+ nodes.push(graphNode);
29533
+ if (branch) {
29534
+ const list = branchToNodeIds.get(branch) ?? [];
29535
+ list.push(graphNode.id);
29536
+ branchToNodeIds.set(branch, list);
29537
+ }
29538
+ }
29539
+ const branchUpstreamCounts = /* @__PURE__ */ new Map();
29540
+ for (const n of status.nodes) {
29541
+ const b = n.git?.branch;
29542
+ const upstream = n.git?.upstream;
29543
+ if (b && upstream) {
29544
+ branchUpstreamCounts.set(b, (branchUpstreamCounts.get(b) ?? 0) + 1);
29545
+ }
29546
+ }
29547
+ let inferredDefaultBranch = null;
29548
+ let bestCount = 0;
29549
+ for (const [b, count] of branchUpstreamCounts) {
29550
+ if (count > bestCount) {
29551
+ bestCount = count;
29552
+ inferredDefaultBranch = b;
29553
+ }
29554
+ }
29555
+ const defaultBranchNodeId = inferredDefaultBranch ? `__branch_${inferredDefaultBranch}` : null;
29556
+ if (defaultBranchNodeId && inferredDefaultBranch) {
29557
+ const branchNodes = branchToNodeIds.get(inferredDefaultBranch) ?? [];
29558
+ const branchHealths = branchNodes.map(
29559
+ (id) => nodes.find((n) => n.id === id).health
29560
+ );
29561
+ const defaultNode = {
29562
+ id: defaultBranchNodeId,
29563
+ type: "defaultBranchNode",
29564
+ label: inferredDefaultBranch,
29565
+ workspace: "",
29566
+ branch: inferredDefaultBranch,
29567
+ health: pickDominantHealth(branchHealths),
29568
+ ahead: 0,
29569
+ behind: 0,
29570
+ dirty: false,
29571
+ dirtyFiles: 0,
29572
+ hasConflicts: false,
29573
+ activeSessionCount: 0,
29574
+ activeSessions: [],
29575
+ providers: [],
29576
+ isOrphan: false,
29577
+ orphanReasons: [],
29578
+ nextStepHint: branchNodes.length > 0 ? `${branchNodes.length} node(s) on default branch` : void 0,
29579
+ source: {
29580
+ nodeId: defaultBranchNodeId,
29581
+ machineLabel: inferredDefaultBranch,
29582
+ workspace: "",
29583
+ health: "online",
29584
+ providers: [],
29585
+ activeSessions: []
29586
+ }
29587
+ };
29588
+ nodes.push(defaultNode);
29589
+ const seenBranches = /* @__PURE__ */ new Set();
29590
+ for (const n of nodes) {
29591
+ if (n.type === "defaultBranchNode") continue;
29592
+ if (!n.branch) continue;
29593
+ if (n.branch === inferredDefaultBranch) {
29594
+ edges.push({
29595
+ id: `${defaultBranchNodeId}--${n.id}`,
29596
+ source: defaultBranchNodeId,
29597
+ target: n.id,
29598
+ type: "parentBranch",
29599
+ label: "default"
29600
+ });
29601
+ continue;
29602
+ }
29603
+ if (seenBranches.has(n.branch)) continue;
29604
+ seenBranches.add(n.branch);
29605
+ edges.push({
29606
+ id: `${defaultBranchNodeId}--branch_${n.branch}`,
29607
+ source: defaultBranchNodeId,
29608
+ target: n.branch,
29609
+ type: "parentBranch",
29610
+ label: n.branch
29611
+ });
29612
+ }
29613
+ }
29614
+ for (const [branch, ids] of branchToNodeIds) {
29615
+ if (ids.length < 2) continue;
29616
+ for (let i = 1; i < ids.length; i++) {
29617
+ edges.push({
29618
+ id: `wt_${ids[0]}--${ids[i]}`,
29619
+ source: ids[0],
29620
+ target: ids[i],
29621
+ type: "worktreeLink",
29622
+ label: branch
29623
+ });
29624
+ }
29625
+ }
29626
+ const orphanCount = nodes.filter((n) => n.isOrphan).length;
29627
+ if (orphanCount > 0) {
29628
+ warnings.push(`${orphanCount} orphan node(s) detected`);
29629
+ }
29630
+ const conflictCount = nodes.filter((n) => n.hasConflicts).length;
29631
+ if (conflictCount > 0) {
29632
+ warnings.push(`${conflictCount} node(s) with merge conflicts`);
29633
+ }
29634
+ const offlineCount = nodes.filter((n) => n.health === "offline").length;
29635
+ if (offlineCount > 0) {
29636
+ warnings.push(`${offlineCount} node(s) offline`);
29637
+ }
29638
+ const stats = {
29639
+ totalNodes: status.nodes.length,
29640
+ onlineNodes: status.nodes.filter((n) => n.health === "online").length,
29641
+ dirtyNodes: nodes.filter((n) => n.dirty).length,
29642
+ orphanNodes: orphanCount,
29643
+ errorNodes: status.nodes.filter((n) => !!n.error).length,
29644
+ offlineNodes: offlineCount,
29645
+ totalActiveSessions: status.nodes.reduce((sum, n) => sum + (n.activeSessions?.length ?? 0), 0)
29646
+ };
29647
+ return {
29648
+ meshId: status.meshId,
29649
+ meshName: status.meshName,
29650
+ repoIdentity: status.repoIdentity,
29651
+ refreshedAt: status.refreshedAt,
29652
+ nodes,
29653
+ edges,
29654
+ stats,
29655
+ warnings
29656
+ };
29657
+ }
29410
29658
  function messageFromError(error48) {
29411
29659
  if (error48 instanceof Error) return error48.message;
29412
29660
  if (typeof error48 === "string") return error48;
@@ -30072,6 +30320,28 @@ function flattenContent(content) {
30072
30320
  if (typeof content === "string") return content;
30073
30321
  return flattenMessageParts(normalizeMessageParts(content));
30074
30322
  }
30323
+ function extractFinalSummaryFromMessages(messages, maxChars = 500) {
30324
+ if (!Array.isArray(messages) || messages.length === 0) return "";
30325
+ for (let i = messages.length - 1; i >= 0; i--) {
30326
+ const msg = messages[i];
30327
+ if (!msg) continue;
30328
+ const classification = classifyChatMessageVisibility(msg);
30329
+ if (classification.isUserFacing && (msg.role === "assistant" || msg.role === "model")) {
30330
+ const text = flattenContent(msg.content).trim();
30331
+ if (text) return text.slice(0, maxChars);
30332
+ }
30333
+ }
30334
+ for (let i = messages.length - 1; i >= 0; i--) {
30335
+ const msg = messages[i];
30336
+ if (!msg) continue;
30337
+ const classification = classifyChatMessageVisibility(msg);
30338
+ if (classification.isUserFacing) {
30339
+ const text = flattenContent(msg.content).trim();
30340
+ if (text) return text.slice(0, maxChars);
30341
+ }
30342
+ }
30343
+ return "";
30344
+ }
30075
30345
  function canonicalizeKindHint(value) {
30076
30346
  return value.trim().toLowerCase().replace(/[\s-]+/g, "_");
30077
30347
  }
@@ -32779,7 +33049,7 @@ function safeBundleIdSegment(value, fallback) {
32779
33049
  function createChatDebugBundleId(targetSessionId) {
32780
33050
  const timestamp2 = (/* @__PURE__ */ new Date()).toISOString().replace(/[-:.]/g, "").replace("T", "T").replace("Z", "Z");
32781
33051
  const sessionSegment = safeBundleIdSegment(targetSessionId, "unknown-session");
32782
- return `chat-debug-${timestamp2}-${sessionSegment}-${(0, import_crypto7.randomUUID)().slice(0, 8)}`;
33052
+ return `chat-debug-${timestamp2}-${sessionSegment}-${(0, import_crypto6.randomUUID)().slice(0, 8)}`;
32783
33053
  }
32784
33054
  function buildChatDebugBundleSummary(bundle) {
32785
33055
  const target = bundle.target && typeof bundle.target === "object" ? bundle.target : {};
@@ -36348,7 +36618,7 @@ function renderMeshCoordinatorTemplate(template, values) {
36348
36618
  function resolveHermesCoordinatorHome(meshId, workspace) {
36349
36619
  const key = `${meshId || "mesh"}
36350
36620
  ${(0, import_path6.resolve)(workspace || os17.tmpdir())}`;
36351
- const hash2 = (0, import_crypto8.createHash)("sha256").update(key).digest("hex").slice(0, 16);
36621
+ const hash2 = (0, import_crypto7.createHash)("sha256").update(key).digest("hex").slice(0, 16);
36352
36622
  return (0, import_path6.join)(os17.tmpdir(), `adhdev-hermes-mesh-coordinator-${hash2}`);
36353
36623
  }
36354
36624
  function resolveMcpConfigPath(configPath, workspace) {
@@ -41911,7 +42181,7 @@ async function shutdownDaemonComponents(components) {
41911
42181
  }
41912
42182
  cdpManagers.clear();
41913
42183
  }
41914
- var path4, import_promises4, import_fs3, import_child_process, import_util3, import_os2, import_path, import_fs4, import_crypto2, import_fs5, import_path2, import_crypto3, import_fs6, import_path3, import_crypto4, import_events2, import_fs7, import_path4, import_crypto5, import_child_process2, os22, path8, import_fs8, fs2, path9, os32, os8, os9, path14, import_child_process3, os10, path15, os11, import_child_process4, import_fs9, import_promises5, path, import_util4, import_promises6, path22, path32, fs, os4, path5, import_crypto6, path6, path7, import_fs10, import_path5, import_child_process5, import_fs11, import_os3, path10, os42, import_child_process6, http, crypto2, fs3, path11, os5, fs4, os6, path12, import_crypto7, fs5, path13, os7, os13, path18, crypto4, import_fs12, import_child_process7, os12, path16, crypto3, fs6, import_module, path17, import_stream2, import_child_process8, import_child_process9, net2, os15, path20, fs7, path19, os14, fs8, path21, os16, import_child_process10, import_crypto8, import_fs13, import_module2, os17, import_path6, os18, import_child_process11, import_child_process12, fs9, os19, path222, import_os4, import_path7, fs10, fs11, path23, os20, import_child_process13, import_os5, http2, fs15, path27, fs12, path24, fs13, path25, fs14, path26, os21, import_child_process14, __defProp2, __getOwnPropDesc2, __getOwnPropNames2, __hasOwnProp2, __require2, __esm2, __export2, __copyProps2, __toCommonJS2, DEFAULT_MESH_POLICY, init_repo_mesh_types, git_worktree_exports, execFileAsync2, WORKTREE_DIR_NAME, GIT_TIMEOUT_MS, GIT_MAX_BUFFER, SUBMODULE_WORKTREE_REMOVE_RE, init_git_worktree, config_exports, DEFAULT_CONFIG, MACHINE_ID_PREFIX, init_config, mesh_config_exports, SESSION_CLEANUP_MODES, SPAWNED_SESSION_VISIBILITY_MODES, init_mesh_config, coordinator_prompt_exports, TOOLS_SECTION, TOOL_EXPOSURE_PREFLIGHT_SECTION, WORKFLOW_SECTION, init_coordinator_prompt, mesh_ledger_exports, LEDGER_DIR_NAME, MAX_FILE_SIZE_BYTES, RECENT_FAILURE_WINDOW_MS, DEFAULT_LEDGER_SLICE_LIMIT, MAX_LEDGER_SLICE_LIMIT, meshLedgerEvents, init_mesh_ledger, mesh_work_queue_exports, ACTIVE_MESH_QUEUE_STATUSES, HISTORICAL_MESH_QUEUE_STATUSES, init_mesh_work_queue, init_cli_detector, LEVEL_NUM, LEVEL_LABEL, currentLevel, LOG_DIR, MAX_LOG_SIZE, MAX_LOG_DAYS, currentDate, currentLogFile, writeCount, RING_BUFFER_SIZE, ringBuffer, origConsoleLog, origConsoleError, origConsoleWarn, LOG, interceptorInstalled, LOG_PATH, init_logger, mesh_events_exports, remoteIdleSessions, MAX_PENDING_EVENTS, pendingMeshCoordinatorEvents, MESH_COORDINATOR_EVENTS, EVENT_TO_LEDGER_KIND, INTENTIONAL_CLEANUP_STOP_SUPPRESSION_MS, autoLaunchInProgress, autoLaunchCooldownUntil, AUTO_LAUNCH_COOLDOWN_MS, init_mesh_events, NORMAL_TRACE_BUFFER_SIZE, DEV_TRACE_BUFFER_SIZE, DEFAULT_CONFIG2, currentConfig, init_debug_config, DEFAULT_BINDING_CANDIDATES, cachedBinding, cachedBindingError, GhosttyVtTerminalBackend, init_ghostty_vt_backend, TerminalCtor, XtermTerminalBackend, init_xterm_backend, DEFAULT_SCROLLBACK, loggedTerminalBackends, TerminalScreen, init_terminal_screen, init_spawn_env, cachedPty, NodePtyRuntimeTransport, NodePtyTransportFactory, init_pty_transport, TerminalTranscriptAccumulator, buildCliSpawnEnv, init_provider_cli_shared, init_provider_cli_parse, init_provider_cli_config, init_provider_cli_runtime, provider_cli_adapter_exports, ProviderCliAdapter, init_provider_cli_adapter, execFileAsync, DEFAULT_TIMEOUT_MS, DEFAULT_MAX_BUFFER, GitCommandError, DEFAULT_MAX_FILES, DEFAULT_MAX_BYTES, summarizeGitStatus, InMemoryGitSnapshotStore, DEFAULT_GIT_WORKSPACE_POLL_INTERVAL_MS, MIN_GIT_WORKSPACE_POLL_INTERVAL_MS, GitWorkspaceMonitor, GIT_COMMAND_NAMES, SNAPSHOT_REASONS, FAILURE_REASONS, defaultSnapshotStore, defaultGitCommandServices, BUSY_STATUSES, TERMINAL_STATUSES, TurnSnapshotTracker, MAX_WORKSPACES, MAX_ACTIVITY, MAX_SAVED_SESSIONS, NO_FALLBACK_REASON, P2P_NEXT_ACTION, NON_P2P_NEXT_ACTION, P2pRelayFailureError, DEFAULT_STATE, BUILTIN_IDE_DEFINITIONS, registeredIDEs, LIVE_LIFECYCLES, DEFAULT_ACTIVE_CHAT_POLL_STATUSES, DEFAULT_CHAT_TAIL_RECENT_MESSAGE_GRACE_MS, LIVE_RUNTIME_LIFECYCLES, DaemonCdpManager, CdpDomHandlers, DEFAULT_MONITOR_CONFIG, StatusMonitor, BUILTIN_CHAT_MESSAGE_KINDS, CHAT_MESSAGE_VISIBILITIES, CHAT_MESSAGE_TRANSCRIPT_VISIBILITIES, CHAT_MESSAGE_AUDIENCES, CHAT_MESSAGE_SOURCES, CHAT_MESSAGE_ACTIVITY_SOURCES, CHAT_MESSAGE_INTERNAL_SOURCES, KNOWN_CHAT_MESSAGE_KINDS, CHAT_MESSAGE_KIND_ALIASES, EXPLICIT_HIDDEN_VISIBILITIES, EXPLICIT_VISIBLE_VISIBILITIES, HIDDEN_AUDIENCES, ACTIVITY_SOURCE_SET, INTERNAL_SOURCE_SET, HISTORY_DIR, RETAIN_DAYS, SAVED_HISTORY_INDEX_VERSION, SAVED_HISTORY_INDEX_FILE, SAVED_HISTORY_INDEX_LOCK_SUFFIX, SAVED_HISTORY_INDEX_LOCK_WAIT_MS, SAVED_HISTORY_INDEX_LOCK_STALE_MS, SAVED_HISTORY_INDEX_LOCK_POLL_MS, SAVED_HISTORY_ROLLUP_THRESHOLD_BYTES, savedHistorySessionCache, savedHistoryFileSummaryCache, savedHistoryBackgroundRefresh, savedHistoryRollupInFlight, ChatHistoryWriter, IDE_PROVIDER_SESSION_CAPABILITIES_BASE, EXTENSION_PROVIDER_SESSION_CAPABILITIES_BASE, ExtensionProviderInstance, VALID_STATUSES, VALID_ROLES, VALID_BUBBLE_STATES, VALID_TURN_STATUSES, DEFAULT_APPROVAL_POSITIVE_HINTS, IdeProviderInstance, DEFAULT_CDP_SCAN_INTERVAL_MS, DEFAULT_CDP_DISCOVERY_INTERVAL_MS, DEFAULT_STATUS_INITIAL_REPORT_DELAY_MS, DEFAULT_STATUS_SERVER_REPORT_INTERVAL_MS, DEFAULT_STATUS_P2P_REPORT_INTERVAL_MS, MIN_MACHINE_RUNTIME_SUBSCRIPTION_INTERVAL_MS, DEFAULT_MACHINE_RUNTIME_SUBSCRIPTION_INTERVAL_MS, MIN_SESSION_HOST_DIAGNOSTICS_SUBSCRIPTION_INTERVAL_MS, DEFAULT_SESSION_HOST_DIAGNOSTICS_SUBSCRIPTION_INTERVAL_MS, DEFAULT_SESSION_HOST_READY_TIMEOUT_MS, STANDALONE_CDP_SCAN_INTERVAL_MS, DaemonCdpScanner, DaemonCdpInitializer, WORKING_STATUSES, FULL_STATUS_ACTIVE_CHAT_OPTIONS, LIVE_STATUS_ACTIVE_CHAT_OPTIONS, STATUS_MODAL_MESSAGE_LIMIT, STATUS_MODAL_BUTTON_LIMIT, VALID_INPUT_MEDIA_TYPES, VALID_INPUT_STRATEGIES, TEXT_ONLY_MESSAGE_INPUT_SUPPORT, IDE_SESSION_CAPABILITIES, EXTENSION_SESSION_CAPABILITIES, PTY_SESSION_CAPABILITIES, CLI_CHAT_SESSION_CAPABILITIES, ACP_SESSION_CAPABILITIES, globalStore, RECENT_SEND_WINDOW_MS, READ_CHAT_PROVIDER_EVAL_TIMEOUT_MS, HERMES_CLI_STARTING_SEND_SETTLE_MS, recentSendByTarget, DEFAULT_DEBUG_SANITIZE_OPTIONS, SECRET_KEY_PATTERN, KEY_TO_VK, COMMAND_DEBUG_LEVELS, DaemonCommandHandler, COMPLETED_FINALIZATION_RETRY_MS, COMPLETED_FINALIZATION_MAX_WAIT_MS, IMAGE_MIME_EXTENSIONS, MATERIALIZED_IMAGE_MAX_AGE_MS, MATERIALIZED_IMAGE_CLEANUP_INTERVAL_MS, lastMaterializedImageCleanupAt, CachedDatabaseSync, CliProviderInstance, AcpProviderInstance, chalkModule, chalkApi, COORDINATOR_DELEGATED_ENV_UNSETS, DaemonCliManager, VALID_CAPABILITY_MEDIA_TYPES, VALID_INPUT_STRATEGIES2, KNOWN_PROVIDER_FIELDS, VALUE_CONTROL_TYPES, ProviderLoader, _providerLoader, LOG_DIR2, MAX_FILE_SIZE, MAX_DAYS, SENSITIVE_KEYS, currentDate2, currentFile, writeCount2, SKIP_COMMANDS, DEFAULT_SERVER_NAME, DEFAULT_ADHDEV_MCP_COMMAND, HERMES_CLI_TYPE, HERMES_MCP_CONFIG_PATH, READ_DEBUG_ENABLED, recentReadDebugSignatureBySession, UPGRADE_HELPER_ENV, CHANNEL_NPM_TAG, CHANNEL_SERVER_URL, REFINE_VALIDATION_CATEGORIES, REFINE_VALIDATION_TIMEOUT_MS, REFINE_VALIDATION_OUTPUT_LIMIT_BYTES, REFINE_VALIDATION_SUMMARY_CHARS, REFINE_VALIDATION_MAX_COMMANDS, CHAT_COMMANDS, READ_DEBUG_ENABLED2, DaemonCommandRouter, DaemonStatusReporter, DEFAULT_DAEMON_PORT, DAEMON_WS_PATH, ProviderStreamAdapter, DaemonAgentStreamManager, AgentStreamPoller, ProviderInstanceManager, ARCHIVE_PATH, MAX_ENTRIES_PER_PROVIDER, VersionArchive, DEV_SERVER_PORT, DevServer, SessionHostRuntimeTransport, SessionHostPtyTransportFactory, DEFAULT_SESSION_HOST_APP_NAME, DEFAULT_STANDALONE_SESSION_HOST_APP_NAME, STARTUP_TIMEOUT_MS, STARTUP_POLL_MS, SessionHostCompatibilityError, EXTENSION_CATALOG, SessionRegistry;
42184
+ var path4, import_promises4, import_fs3, import_child_process, import_util3, import_os2, import_path, import_fs4, import_crypto, import_fs5, import_path2, import_crypto2, import_fs6, import_path3, import_crypto3, import_events2, import_fs7, import_path4, import_crypto4, import_child_process2, os22, path8, import_fs8, fs2, path9, os32, os8, os9, path14, import_child_process3, os10, path15, os11, import_child_process4, import_fs9, import_promises5, path, import_util4, import_promises6, path22, path32, fs, os4, path5, import_crypto5, path6, path7, import_fs10, import_path5, import_child_process5, import_fs11, import_os3, path10, os42, import_child_process6, http, crypto2, fs3, path11, os5, fs4, os6, path12, import_crypto6, fs5, path13, os7, os13, path18, crypto4, import_fs12, import_child_process7, os12, path16, crypto3, fs6, import_module, path17, import_stream2, import_child_process8, import_child_process9, net2, os15, path20, fs7, path19, os14, fs8, path21, os16, import_child_process10, import_crypto7, import_fs13, import_module2, os17, import_path6, os18, import_child_process11, import_child_process12, fs9, os19, path222, import_os4, import_path7, fs10, fs11, path23, os20, import_child_process13, import_os5, http2, fs15, path27, fs12, path24, fs13, path25, fs14, path26, os21, import_child_process14, __defProp2, __getOwnPropDesc2, __getOwnPropNames2, __hasOwnProp2, __require2, __esm2, __export2, __copyProps2, __toCommonJS2, DEFAULT_MESH_POLICY, init_repo_mesh_types, git_worktree_exports, execFileAsync2, WORKTREE_DIR_NAME, GIT_TIMEOUT_MS, GIT_MAX_BUFFER, SUBMODULE_WORKTREE_REMOVE_RE, init_git_worktree, config_exports, DEFAULT_CONFIG, MACHINE_ID_PREFIX, init_config, mesh_config_exports, SESSION_CLEANUP_MODES, SPAWNED_SESSION_VISIBILITY_MODES, init_mesh_config, coordinator_prompt_exports, TOOLS_SECTION, TOOL_EXPOSURE_PREFLIGHT_SECTION, WORKFLOW_SECTION, init_coordinator_prompt, mesh_ledger_exports, LEDGER_DIR_NAME, MAX_FILE_SIZE_BYTES, RECENT_FAILURE_WINDOW_MS, DEFAULT_LEDGER_SLICE_LIMIT, MAX_LEDGER_SLICE_LIMIT, meshLedgerEvents, init_mesh_ledger, mesh_work_queue_exports, ACTIVE_MESH_QUEUE_STATUSES, HISTORICAL_MESH_QUEUE_STATUSES, init_mesh_work_queue, init_cli_detector, LEVEL_NUM, LEVEL_LABEL, currentLevel, LOG_DIR, MAX_LOG_SIZE, MAX_LOG_DAYS, currentDate, currentLogFile, writeCount, RING_BUFFER_SIZE, ringBuffer, origConsoleLog, origConsoleError, origConsoleWarn, LOG, interceptorInstalled, LOG_PATH, init_logger, mesh_events_exports, remoteIdleSessions, MAX_PENDING_EVENTS, pendingMeshCoordinatorEvents, MESH_COORDINATOR_EVENTS, EVENT_TO_LEDGER_KIND, INTENTIONAL_CLEANUP_STOP_SUPPRESSION_MS, autoLaunchInProgress, autoLaunchCooldownUntil, AUTO_LAUNCH_COOLDOWN_MS, init_mesh_events, NORMAL_TRACE_BUFFER_SIZE, DEV_TRACE_BUFFER_SIZE, DEFAULT_CONFIG2, currentConfig, init_debug_config, DEFAULT_BINDING_CANDIDATES, cachedBinding, cachedBindingError, GhosttyVtTerminalBackend, init_ghostty_vt_backend, TerminalCtor, XtermTerminalBackend, init_xterm_backend, DEFAULT_SCROLLBACK, loggedTerminalBackends, TerminalScreen, init_terminal_screen, init_spawn_env, cachedPty, NodePtyRuntimeTransport, NodePtyTransportFactory, init_pty_transport, TerminalTranscriptAccumulator, buildCliSpawnEnv, init_provider_cli_shared, init_provider_cli_parse, init_provider_cli_config, init_provider_cli_runtime, provider_cli_adapter_exports, ProviderCliAdapter, init_provider_cli_adapter, execFileAsync, DEFAULT_TIMEOUT_MS, DEFAULT_MAX_BUFFER, GitCommandError, DEFAULT_MAX_FILES, DEFAULT_MAX_BYTES, summarizeGitStatus, InMemoryGitSnapshotStore, DEFAULT_GIT_WORKSPACE_POLL_INTERVAL_MS, MIN_GIT_WORKSPACE_POLL_INTERVAL_MS, GitWorkspaceMonitor, GIT_COMMAND_NAMES, SNAPSHOT_REASONS, FAILURE_REASONS, defaultSnapshotStore, defaultGitCommandServices, BUSY_STATUSES, TERMINAL_STATUSES, TurnSnapshotTracker, MAX_WORKSPACES, MAX_ACTIVITY, MAX_SAVED_SESSIONS, NO_FALLBACK_REASON, P2P_NEXT_ACTION, NON_P2P_NEXT_ACTION, P2pRelayFailureError, DEFAULT_STATE, BUILTIN_IDE_DEFINITIONS, registeredIDEs, LIVE_LIFECYCLES, DEFAULT_ACTIVE_CHAT_POLL_STATUSES, DEFAULT_CHAT_TAIL_RECENT_MESSAGE_GRACE_MS, LIVE_RUNTIME_LIFECYCLES, DaemonCdpManager, CdpDomHandlers, DEFAULT_MONITOR_CONFIG, StatusMonitor, BUILTIN_CHAT_MESSAGE_KINDS, CHAT_MESSAGE_VISIBILITIES, CHAT_MESSAGE_TRANSCRIPT_VISIBILITIES, CHAT_MESSAGE_AUDIENCES, CHAT_MESSAGE_SOURCES, CHAT_MESSAGE_ACTIVITY_SOURCES, CHAT_MESSAGE_INTERNAL_SOURCES, KNOWN_CHAT_MESSAGE_KINDS, CHAT_MESSAGE_KIND_ALIASES, EXPLICIT_HIDDEN_VISIBILITIES, EXPLICIT_VISIBLE_VISIBILITIES, HIDDEN_AUDIENCES, ACTIVITY_SOURCE_SET, INTERNAL_SOURCE_SET, HISTORY_DIR, RETAIN_DAYS, SAVED_HISTORY_INDEX_VERSION, SAVED_HISTORY_INDEX_FILE, SAVED_HISTORY_INDEX_LOCK_SUFFIX, SAVED_HISTORY_INDEX_LOCK_WAIT_MS, SAVED_HISTORY_INDEX_LOCK_STALE_MS, SAVED_HISTORY_INDEX_LOCK_POLL_MS, SAVED_HISTORY_ROLLUP_THRESHOLD_BYTES, savedHistorySessionCache, savedHistoryFileSummaryCache, savedHistoryBackgroundRefresh, savedHistoryRollupInFlight, ChatHistoryWriter, IDE_PROVIDER_SESSION_CAPABILITIES_BASE, EXTENSION_PROVIDER_SESSION_CAPABILITIES_BASE, ExtensionProviderInstance, VALID_STATUSES, VALID_ROLES, VALID_BUBBLE_STATES, VALID_TURN_STATUSES, DEFAULT_APPROVAL_POSITIVE_HINTS, IdeProviderInstance, DEFAULT_CDP_SCAN_INTERVAL_MS, DEFAULT_CDP_DISCOVERY_INTERVAL_MS, DEFAULT_STATUS_INITIAL_REPORT_DELAY_MS, DEFAULT_STATUS_SERVER_REPORT_INTERVAL_MS, DEFAULT_STATUS_P2P_REPORT_INTERVAL_MS, MIN_MACHINE_RUNTIME_SUBSCRIPTION_INTERVAL_MS, DEFAULT_MACHINE_RUNTIME_SUBSCRIPTION_INTERVAL_MS, MIN_SESSION_HOST_DIAGNOSTICS_SUBSCRIPTION_INTERVAL_MS, DEFAULT_SESSION_HOST_DIAGNOSTICS_SUBSCRIPTION_INTERVAL_MS, DEFAULT_SESSION_HOST_READY_TIMEOUT_MS, STANDALONE_CDP_SCAN_INTERVAL_MS, DaemonCdpScanner, DaemonCdpInitializer, WORKING_STATUSES, FULL_STATUS_ACTIVE_CHAT_OPTIONS, LIVE_STATUS_ACTIVE_CHAT_OPTIONS, STATUS_MODAL_MESSAGE_LIMIT, STATUS_MODAL_BUTTON_LIMIT, VALID_INPUT_MEDIA_TYPES, VALID_INPUT_STRATEGIES, TEXT_ONLY_MESSAGE_INPUT_SUPPORT, IDE_SESSION_CAPABILITIES, EXTENSION_SESSION_CAPABILITIES, PTY_SESSION_CAPABILITIES, CLI_CHAT_SESSION_CAPABILITIES, ACP_SESSION_CAPABILITIES, globalStore, RECENT_SEND_WINDOW_MS, READ_CHAT_PROVIDER_EVAL_TIMEOUT_MS, HERMES_CLI_STARTING_SEND_SETTLE_MS, recentSendByTarget, DEFAULT_DEBUG_SANITIZE_OPTIONS, SECRET_KEY_PATTERN, KEY_TO_VK, COMMAND_DEBUG_LEVELS, DaemonCommandHandler, COMPLETED_FINALIZATION_RETRY_MS, COMPLETED_FINALIZATION_MAX_WAIT_MS, IMAGE_MIME_EXTENSIONS, MATERIALIZED_IMAGE_MAX_AGE_MS, MATERIALIZED_IMAGE_CLEANUP_INTERVAL_MS, lastMaterializedImageCleanupAt, CachedDatabaseSync, CliProviderInstance, AcpProviderInstance, chalkModule, chalkApi, COORDINATOR_DELEGATED_ENV_UNSETS, DaemonCliManager, VALID_CAPABILITY_MEDIA_TYPES, VALID_INPUT_STRATEGIES2, KNOWN_PROVIDER_FIELDS, VALUE_CONTROL_TYPES, ProviderLoader, _providerLoader, LOG_DIR2, MAX_FILE_SIZE, MAX_DAYS, SENSITIVE_KEYS, currentDate2, currentFile, writeCount2, SKIP_COMMANDS, DEFAULT_SERVER_NAME, DEFAULT_ADHDEV_MCP_COMMAND, HERMES_CLI_TYPE, HERMES_MCP_CONFIG_PATH, READ_DEBUG_ENABLED, recentReadDebugSignatureBySession, UPGRADE_HELPER_ENV, CHANNEL_NPM_TAG, CHANNEL_SERVER_URL, REFINE_VALIDATION_CATEGORIES, REFINE_VALIDATION_TIMEOUT_MS, REFINE_VALIDATION_OUTPUT_LIMIT_BYTES, REFINE_VALIDATION_SUMMARY_CHARS, REFINE_VALIDATION_MAX_COMMANDS, CHAT_COMMANDS, READ_DEBUG_ENABLED2, DaemonCommandRouter, DaemonStatusReporter, DEFAULT_DAEMON_PORT, DAEMON_WS_PATH, ProviderStreamAdapter, DaemonAgentStreamManager, AgentStreamPoller, ProviderInstanceManager, ARCHIVE_PATH, MAX_ENTRIES_PER_PROVIDER, VersionArchive, DEV_SERVER_PORT, DevServer, SessionHostRuntimeTransport, SessionHostPtyTransportFactory, DEFAULT_SESSION_HOST_APP_NAME, DEFAULT_STANDALONE_SESSION_HOST_APP_NAME, STARTUP_TIMEOUT_MS, STARTUP_POLL_MS, SessionHostCompatibilityError, EXTENSION_CATALOG, SessionRegistry;
41915
42185
  var init_dist2 = __esm({
41916
42186
  "../daemon-core/dist/index.mjs"() {
41917
42187
  "use strict";
@@ -41923,17 +42193,17 @@ var init_dist2 = __esm({
41923
42193
  import_os2 = require("os");
41924
42194
  import_path = require("path");
41925
42195
  import_fs4 = require("fs");
41926
- import_crypto2 = require("crypto");
42196
+ import_crypto = require("crypto");
41927
42197
  import_fs5 = require("fs");
41928
42198
  import_path2 = require("path");
41929
- import_crypto3 = require("crypto");
42199
+ import_crypto2 = require("crypto");
41930
42200
  import_fs6 = require("fs");
41931
42201
  import_path3 = require("path");
41932
- import_crypto4 = require("crypto");
42202
+ import_crypto3 = require("crypto");
41933
42203
  import_events2 = require("events");
41934
42204
  import_fs7 = require("fs");
41935
42205
  import_path4 = require("path");
41936
- import_crypto5 = require("crypto");
42206
+ import_crypto4 = require("crypto");
41937
42207
  import_child_process2 = require("child_process");
41938
42208
  os22 = __toESM(require("os"), 1);
41939
42209
  path8 = __toESM(require("path"), 1);
@@ -41961,7 +42231,7 @@ var init_dist2 = __esm({
41961
42231
  fs = __toESM(require("fs"), 1);
41962
42232
  os4 = __toESM(require("os"), 1);
41963
42233
  path5 = __toESM(require("path"), 1);
41964
- import_crypto6 = require("crypto");
42234
+ import_crypto5 = require("crypto");
41965
42235
  path6 = __toESM(require("path"), 1);
41966
42236
  path7 = __toESM(require("path"), 1);
41967
42237
  import_fs10 = require("fs");
@@ -41981,7 +42251,7 @@ var init_dist2 = __esm({
41981
42251
  fs4 = __toESM(require("fs"), 1);
41982
42252
  os6 = __toESM(require("os"), 1);
41983
42253
  path12 = __toESM(require("path"), 1);
41984
- import_crypto7 = require("crypto");
42254
+ import_crypto6 = require("crypto");
41985
42255
  fs5 = __toESM(require("fs"), 1);
41986
42256
  path13 = __toESM(require("path"), 1);
41987
42257
  os7 = __toESM(require("os"), 1);
@@ -42013,7 +42283,7 @@ var init_dist2 = __esm({
42013
42283
  os16 = __toESM(require("os"), 1);
42014
42284
  init_js_yaml();
42015
42285
  import_child_process10 = require("child_process");
42016
- import_crypto8 = require("crypto");
42286
+ import_crypto7 = require("crypto");
42017
42287
  import_fs13 = require("fs");
42018
42288
  import_module2 = require("module");
42019
42289
  os17 = __toESM(require("os"), 1);
@@ -42347,7 +42617,9 @@ Follow these recovery rules:
42347
42617
  });
42348
42618
  mesh_events_exports = {};
42349
42619
  __export2(mesh_events_exports, {
42620
+ clearPendingMeshCoordinatorEvents: () => clearPendingMeshCoordinatorEvents,
42350
42621
  drainPendingMeshCoordinatorEvents: () => drainPendingMeshCoordinatorEvents,
42622
+ getPendingMeshCoordinatorEvents: () => getPendingMeshCoordinatorEvents,
42351
42623
  handleMeshForwardEvent: () => handleMeshForwardEvent,
42352
42624
  setupMeshEventForwarding: () => setupMeshEventForwarding,
42353
42625
  triggerMeshQueue: () => triggerMeshQueue,
@@ -47187,7 +47459,8 @@ ${lastSnapshot}`;
47187
47459
  ideType: this.ideType || this.type,
47188
47460
  agentType: this.type,
47189
47461
  agentName: this.agentName || this.provider.name,
47190
- extensionId: this.extensionId || this.type
47462
+ extensionId: this.extensionId || this.type,
47463
+ finalSummary: extractFinalSummaryFromMessages(data?.messages)
47191
47464
  });
47192
47465
  this.generatingStartedAt = 0;
47193
47466
  }
@@ -47778,7 +48051,7 @@ ${effect.notification.body || ""}`.trim();
47778
48051
  } else if (agentStatus === "idle" && (lastStatus === "generating" || lastStatus === "waiting_approval")) {
47779
48052
  const startedAt = this.generatingStartedAt.get(agentKey);
47780
48053
  const duration3 = startedAt ? Math.round((now - startedAt) / 1e3) : 0;
47781
- this.pushEvent({ event: "agent:generating_completed", chatTitle, duration: duration3, timestamp: now, ideType: this.type });
48054
+ this.pushEvent({ event: "agent:generating_completed", chatTitle, duration: duration3, timestamp: now, ideType: this.type, finalSummary: extractFinalSummaryFromMessages(chatData?.messages) });
47782
48055
  this.generatingStartedAt.delete(agentKey);
47783
48056
  }
47784
48057
  this.lastAgentStatuses.set(agentKey, agentStatus);
@@ -49366,7 +49639,8 @@ ${effect.notification.body || ""}`.trim();
49366
49639
  event: "agent:generating_completed",
49367
49640
  chatTitle: pending.chatTitle,
49368
49641
  duration: pending.duration,
49369
- timestamp: pending.timestamp
49642
+ timestamp: pending.timestamp,
49643
+ finalSummary: extractFinalSummaryFromMessages(this.adapter?.getScriptParsedStatus()?.messages)
49370
49644
  });
49371
49645
  this.completedDebouncePending = null;
49372
49646
  this.completedDebounceTimer = null;
@@ -50977,7 +51251,7 @@ ${rawInput}` : rawInput;
50977
51251
  });
50978
51252
  } else if (newStatus === "idle" && (this.lastStatus === "generating" || this.lastStatus === "waiting_approval")) {
50979
51253
  const duration3 = this.generatingStartedAt ? Math.round((now - this.generatingStartedAt) / 1e3) : 0;
50980
- this.pushEvent({ event: "agent:generating_completed", chatTitle, duration: duration3, timestamp: now });
51254
+ this.pushEvent({ event: "agent:generating_completed", chatTitle, duration: duration3, timestamp: now, finalSummary: extractFinalSummaryFromMessages(this.messages) });
50981
51255
  this.generatingStartedAt = 0;
50982
51256
  } else if (newStatus === "stopped") {
50983
51257
  this.pushEvent({ event: "agent:stopped", chatTitle, timestamp: now });
@@ -60089,15 +60363,18 @@ async function meshStatus(ctx) {
60089
60363
  response.ledgerSummary = ledgerSummary;
60090
60364
  } catch {
60091
60365
  }
60092
- if (ctx.transport instanceof IpcTransport) {
60093
- try {
60366
+ try {
60367
+ let pendingEvents = [];
60368
+ if (ctx.transport instanceof IpcTransport) {
60094
60369
  const eventsResult = await ctx.transport.command("get_pending_mesh_events", {});
60095
- const pendingEvents = Array.isArray(eventsResult?.events) ? eventsResult.events : [];
60096
- if (pendingEvents.length > 0) {
60097
- response.pendingCoordinatorEvents = pendingEvents;
60098
- }
60099
- } catch {
60370
+ pendingEvents = Array.isArray(eventsResult?.events) ? eventsResult.events : [];
60371
+ } else if (isLocalTransport(ctx.transport)) {
60372
+ pendingEvents = drainPendingMeshCoordinatorEvents();
60373
+ }
60374
+ if (pendingEvents.length > 0) {
60375
+ response.pendingCoordinatorEvents = pendingEvents;
60100
60376
  }
60377
+ } catch {
60101
60378
  }
60102
60379
  return JSON.stringify(response, null, 2);
60103
60380
  }
@@ -60369,13 +60646,13 @@ async function meshSendTask(ctx, args) {
60369
60646
  const isLocalNode = isLocalControlPlaneNode(ctx, node);
60370
60647
  if (ctx.transport instanceof IpcTransport && node.daemonId && !isLocalNode) {
60371
60648
  const cached2 = meshSessionProviderMetadata.get(meshSessionCacheKey(args.node_id, args.session_id || ""));
60372
- const result = await ipcDispatchToRemoteAgent(ctx, node, {
60649
+ const result2 = await ipcDispatchToRemoteAgent(ctx, node, {
60373
60650
  session_id: args.session_id,
60374
60651
  message: args.message,
60375
60652
  providerType: cached2?.providerType
60376
60653
  });
60377
- if (result.success) {
60378
- const dispatchedSessionId = args.session_id || result.sessionId;
60654
+ if (result2.success) {
60655
+ const dispatchedSessionId = args.session_id || result2.sessionId;
60379
60656
  try {
60380
60657
  appendLedgerEntry(ctx.mesh.id, {
60381
60658
  kind: "task_dispatched",
@@ -60390,7 +60667,7 @@ async function meshSendTask(ctx, args) {
60390
60667
  } catch {
60391
60668
  }
60392
60669
  }
60393
- return JSON.stringify({ ...result, nodeId: args.node_id, dispatched: result.success === true });
60670
+ return JSON.stringify({ ...result2, nodeId: args.node_id, dispatched: result2.success === true });
60394
60671
  }
60395
60672
  if (args.session_id && isLocalTransport(ctx.transport)) {
60396
60673
  const cached2 = meshSessionProviderMetadata.get(meshSessionCacheKey(args.node_id, args.session_id));
@@ -60429,7 +60706,12 @@ async function meshSendTask(ctx, args) {
60429
60706
  ctx.transport.command("trigger_mesh_queue", { meshId: ctx.mesh.id }).catch(() => {
60430
60707
  });
60431
60708
  }
60432
- return JSON.stringify({ success: true, nodeId: args.node_id, taskId: task.id, status: task.status });
60709
+ const pendingEvents = isLocalTransport(ctx.transport) ? drainPendingMeshCoordinatorEvents() : [];
60710
+ const result = { success: true, nodeId: args.node_id, taskId: task.id, status: task.status };
60711
+ if (pendingEvents.length > 0) {
60712
+ result.pendingCoordinatorEvents = pendingEvents;
60713
+ }
60714
+ return JSON.stringify(result);
60433
60715
  } catch (e) {
60434
60716
  const failure2 = buildCoordinatorP2pRelayFailure(e, {
60435
60717
  command: "mesh_send_task",