@adhdev/daemon-standalone 1.0.18-rc.15 → 1.0.18-rc.16

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
@@ -30265,10 +30265,10 @@ var require_dist3 = __commonJS({
30265
30265
  }
30266
30266
  function getDaemonBuildInfo() {
30267
30267
  if (cached2) return cached2;
30268
- const commit = readInjected(true ? "64f056340da99d3b28464efcf5c05fe643e5db63" : void 0) ?? "unknown";
30269
- const commitShort = readInjected(true ? "64f05634" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
30270
- const version2 = readInjected(true ? "1.0.18-rc.15" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
30271
- const builtAt = readInjected(true ? "2026-07-23T00:53:09.129Z" : void 0);
30268
+ const commit = readInjected(true ? "74f34080bcd7c145e55fd7e5fd492a40a4942bc4" : void 0) ?? "unknown";
30269
+ const commitShort = readInjected(true ? "74f34080" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
30270
+ const version2 = readInjected(true ? "1.0.18-rc.16" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
30271
+ const builtAt = readInjected(true ? "2026-07-23T02:30:18.950Z" : void 0);
30272
30272
  cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
30273
30273
  return cached2;
30274
30274
  }
@@ -49165,6 +49165,26 @@ The mesh has no work in flight. For each mission, decide its outcome: continue i
49165
49165
  }
49166
49166
  return null;
49167
49167
  }
49168
+ function hasTrailingToolActivityAfterFinalAssistant(messages) {
49169
+ if (!Array.isArray(messages) || messages.length === 0) return false;
49170
+ let sawTrailingToolActivity = false;
49171
+ for (let i = messages.length - 1; i >= 0; i--) {
49172
+ const msg = messages[i];
49173
+ if (!msg) continue;
49174
+ const classification = classifyChatMessageVisibility(msg);
49175
+ if (classification.isUserFacing && (msg.role === "assistant" || msg.role === "model")) {
49176
+ if (flattenContent(msg.content).trim()) return sawTrailingToolActivity;
49177
+ return false;
49178
+ }
49179
+ if (classification.isUserFacing) {
49180
+ return false;
49181
+ }
49182
+ if (classification.kind === "tool" || classification.kind === "terminal") {
49183
+ sawTrailingToolActivity = true;
49184
+ }
49185
+ }
49186
+ return false;
49187
+ }
49168
49188
  function canonicalizeKindHint(value) {
49169
49189
  return value.trim().toLowerCase().replace(/[\s-]+/g, "_");
49170
49190
  }
@@ -52864,6 +52884,7 @@ ${cleanBody}`;
52864
52884
  const messages = Array.isArray(payload.messages) ? payload.messages : [];
52865
52885
  const evidence = extractFinalAssistantSummaryEvidence(messages);
52866
52886
  if (!evidence.finalSummary) return null;
52887
+ if (hasTrailingToolActivityAfterFinalAssistant(messages)) return null;
52867
52888
  const dispatchedAtMs = Date.parse(readNonEmptyString(row.dispatchTimestamp));
52868
52889
  const transcriptAtMs = Date.parse(evidence.transcriptMessageAt ?? "");
52869
52890
  if (!(Number.isFinite(dispatchedAtMs) && Number.isFinite(transcriptAtMs) && transcriptAtMs >= dispatchedAtMs)) {
@@ -53154,6 +53175,52 @@ ${cleanBody}`;
53154
53175
  return false;
53155
53176
  }
53156
53177
  }
53178
+ function resolveLocalSessionPurePty(components, sessionId) {
53179
+ try {
53180
+ const instances = components.instanceManager?.getByCategory?.("cli") || [];
53181
+ const inst = instances.find((i) => {
53182
+ const sid = readNonEmptyString(i?.getState?.().instanceId);
53183
+ return sid && sessionIdsEquivalent(sid, sessionId);
53184
+ });
53185
+ if (!inst) return void 0;
53186
+ const provider = inst.provider;
53187
+ if (!provider || typeof provider !== "object") return void 0;
53188
+ return isPurePtyTranscriptProvider(provider);
53189
+ } catch {
53190
+ return void 0;
53191
+ }
53192
+ }
53193
+ async function evaluateEarlyIdleTranscriptArm(components, mesh, store, row, localDaemonId, selfIds = []) {
53194
+ const sessionId = readNonEmptyString(row.assignedSessionId);
53195
+ if (!sessionId) return false;
53196
+ const verdict = resolveSessionBusyVerdict(components, sessionId);
53197
+ if (verdict === "GENERATING") return false;
53198
+ if (verdict === "UNKNOWN") {
53199
+ const nodeId = readNonEmptyString(row.assignedNodeId);
53200
+ const node = (mesh.nodes ?? []).find((n) => n.id === nodeId);
53201
+ const liveStatus = nodeId ? readNonEmptyString(sessionStatusFromNodes(mesh.nodes, nodeId, sessionId).status).toLowerCase() : "";
53202
+ if (liveStatus && liveStatus !== "idle") return false;
53203
+ if (!liveStatus) {
53204
+ const nodeDaemonId = readNonEmptyString(node?.daemonId);
53205
+ const isLocalNode = !nodeDaemonId || daemonIdsEquivalent(nodeDaemonId, localDaemonId) || daemonIdListIncludes(selfIds, nodeDaemonId) || !!components.instanceManager?.getInstance?.(sessionId);
53206
+ const providerType = readNonEmptyString(row.assignedProviderType);
53207
+ const readArgs = {
53208
+ sessionId,
53209
+ targetSessionId: sessionId,
53210
+ tailLimit: 1,
53211
+ ...node?.workspace ? { workspace: node.workspace } : {},
53212
+ ...providerType ? { agentType: providerType, providerType } : {}
53213
+ };
53214
+ const probedStatus = await reprobeWorkerStatus(components, { isLocalNode, nodeDaemonId, readArgs });
53215
+ if (probedStatus !== "idle") return false;
53216
+ }
53217
+ }
53218
+ if (store.taskDeliveryConsumed(mesh.id, row.id)) return true;
53219
+ const localPurePty = resolveLocalSessionPurePty(components, sessionId);
53220
+ if (localPurePty === true) return true;
53221
+ if (localPurePty === false) return false;
53222
+ return verdict === "UNKNOWN";
53223
+ }
53157
53224
  async function recoverStrandedAssignedDispatches(components, mesh, store, localDaemonId, selfIds = []) {
53158
53225
  const meshId = mesh.id;
53159
53226
  const assigned = getQueue(meshId, { status: ["assigned"] });
@@ -53175,7 +53242,8 @@ ${cleanBody}`;
53175
53242
  if (!Number.isFinite(dispatchedAtMs)) continue;
53176
53243
  const ageMs = nowMs - dispatchedAtMs;
53177
53244
  const idleTranscriptStreakKey = `${meshId}::${row.id}`;
53178
- if (store.taskHasConfirmedDelivery(meshId, row.id) && !findTerminalLedgerEvidenceForTask({ meshId, taskId: row.id }) && readNonEmptyString(row.assignedSessionId) && resolveSessionBusyVerdict(components, row.assignedSessionId) !== "GENERATING") {
53245
+ const earlyArm = store.taskHasConfirmedDelivery(meshId, row.id) && !findTerminalLedgerEvidenceForTask({ meshId, taskId: row.id }) && readNonEmptyString(row.assignedSessionId) ? await evaluateEarlyIdleTranscriptArm(components, mesh, store, row, localDaemonId, selfIds) : false;
53246
+ if (earlyArm) {
53179
53247
  const since = assignedIdleFinalAssistantSince.get(idleTranscriptStreakKey);
53180
53248
  if (since === void 0) {
53181
53249
  assignedIdleFinalAssistantSince.set(idleTranscriptStreakKey, nowMs);
@@ -53932,6 +54000,7 @@ ${cleanBody}`;
53932
54000
  init_mesh_reconcile_identity();
53933
54001
  init_mesh_reconcile_config();
53934
54002
  init_mesh_remote_event_pull();
54003
+ init_provider_cli_shared();
53935
54004
  init_mesh_disk_retention();
53936
54005
  init_mesh_completion_synthesis();
53937
54006
  init_mesh_active_work();