@adhdev/daemon-core 0.9.82-rc.422 → 0.9.82-rc.424

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
@@ -384,10 +384,10 @@ function readInjected(value) {
384
384
  }
385
385
  function getDaemonBuildInfo() {
386
386
  if (cached) return cached;
387
- const commit = readInjected(true ? "308e099c65d2de2491f3db46913f9ced6aa3992c" : void 0) ?? "unknown";
388
- const commitShort = readInjected(true ? "308e099c" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
389
- const version = readInjected(true ? "0.9.82-rc.422" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
390
- const builtAt = readInjected(true ? "2026-06-29T05:26:31.350Z" : void 0);
387
+ const commit = readInjected(true ? "906d662b9cf13e7841eaebd28cb81403c236a7ad" : void 0) ?? "unknown";
388
+ const commitShort = readInjected(true ? "906d662b" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
389
+ const version = readInjected(true ? "0.9.82-rc.424" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
390
+ const builtAt = readInjected(true ? "2026-06-29T09:38:26.396Z" : void 0);
391
391
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
392
392
  return cached;
393
393
  }
@@ -4163,6 +4163,24 @@ function normalizeMeshWorkerResult(input, source = "explicit_metadata") {
4163
4163
  source
4164
4164
  };
4165
4165
  }
4166
+ function summaryHasParseableJsonAnswer(summary) {
4167
+ const text = readNonEmptyString(summary);
4168
+ if (!text) return false;
4169
+ const fenced = text.match(/```(?:json)?\s*([\s\S]*?)```/i);
4170
+ const candidates = [fenced?.[1], text].filter(Boolean);
4171
+ for (const candidate of candidates) {
4172
+ const trimmed = candidate.trim();
4173
+ if (!trimmed.startsWith("{") || !trimmed.endsWith("}")) continue;
4174
+ try {
4175
+ const parsed = JSON.parse(trimmed);
4176
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed) && Object.keys(parsed).length > 0) {
4177
+ return true;
4178
+ }
4179
+ } catch {
4180
+ }
4181
+ }
4182
+ return false;
4183
+ }
4166
4184
  function resolveWorkerResult(opts) {
4167
4185
  if (opts.workerResult && typeof opts.workerResult === "object") {
4168
4186
  return normalizeMeshWorkerResult(opts.workerResult, "explicit_metadata");
@@ -4171,6 +4189,9 @@ function resolveWorkerResult(opts) {
4171
4189
  if (parsed) {
4172
4190
  return normalizeMeshWorkerResult(parsed, "final_summary_json");
4173
4191
  }
4192
+ if (summaryHasParseableJsonAnswer(opts.finalSummary)) {
4193
+ return normalizeMeshWorkerResult(void 0, "parseable_answer");
4194
+ }
4174
4195
  return normalizeMeshWorkerResult(void 0, "default");
4175
4196
  }
4176
4197
  function buildTaskCompletionEvidence(opts) {
@@ -16256,6 +16277,11 @@ function injectMeshSystemMessage(components, args) {
16256
16277
  completionDiagnostic: args.metadataEvent.completionDiagnostic && typeof args.metadataEvent.completionDiagnostic === "object" ? args.metadataEvent.completionDiagnostic : void 0,
16257
16278
  evidence: completionEvidence,
16258
16279
  // B2: evidenceLevel lets coordinator know when completion evidence is insufficient.
16280
+ // NOTIF Defect-2b: ONLY source==='default' (no parseable answer at all) is
16281
+ // 'insufficient'. 'parseable_answer' (a real JSON answer that just isn't
16282
+ // worker-result-shaped, e.g. a MAGI envelope) is concrete evidence and must
16283
+ // resolve to 'sufficient' — resolveWorkerResult now upgrades that case so a
16284
+ // complete, valid answer is no longer mislabelled insufficient/reviewRecommended.
16259
16285
  ...completionEvidence ? completionEvidence.workerResult.source === "default" ? { evidenceLevel: "insufficient", reviewRecommended: true } : { evidenceLevel: "sufficient" } : {}
16260
16286
  }
16261
16287
  });
@@ -40038,6 +40064,12 @@ function hasNonEmptyCliModalButtons(activeModal) {
40038
40064
  function isCliGeneratingLikeStatus(status) {
40039
40065
  return status === "generating" || status === "streaming" || status === "no_progress" || status === "long_generating" || status === "starting";
40040
40066
  }
40067
+ function computeTurnAnchoredDurationMs(engineTurnStartedAt, generatingStartedAt, now) {
40068
+ const engineStart = typeof engineTurnStartedAt === "number" && Number.isFinite(engineTurnStartedAt) ? engineTurnStartedAt : 0;
40069
+ if (engineStart > 0) return { durationMs: now - engineStart, anchor: "turn-start" };
40070
+ if (generatingStartedAt > 0) return { durationMs: now - generatingStartedAt, anchor: "generatingStartedAt" };
40071
+ return { durationMs: 0, anchor: "none" };
40072
+ }
40041
40073
  function buildCliStructuredInputPrompt(input, options = {}) {
40042
40074
  const promptParts = [];
40043
40075
  const imageRefs = [];
@@ -41548,8 +41580,12 @@ var CliProviderInstance = class _CliProviderInstance {
41548
41580
  if (!this.generatingStartedAt && !this.generatingDebouncePending) {
41549
41581
  LOG.debug("CLI", `[${this.type}] suppressed startup-phase generating\u2192idle blip (generatingStartedAt=0, no debounce pending)`);
41550
41582
  } else if (this.generatingDebouncePending) {
41551
- const shortDurationMs = this.generatingStartedAt ? now - this.generatingStartedAt : 0;
41552
- LOG.info("CLI", `[${this.type}] suppressed short generating (${shortDurationMs}ms)`);
41583
+ const { durationMs: shortDurationMs, anchor: durationAnchor } = computeTurnAnchoredDurationMs(
41584
+ this.adapter?.currentTurnStartedAt,
41585
+ this.generatingStartedAt,
41586
+ now
41587
+ );
41588
+ LOG.info("CLI", `[${this.type}] suppressed short generating (${shortDurationMs}ms, anchor=${durationAnchor})`);
41553
41589
  if (this.generatingDebounceTimer) {
41554
41590
  clearTimeout(this.generatingDebounceTimer);
41555
41591
  this.generatingDebounceTimer = null;