@adhdev/daemon-core 0.9.82-rc.192 → 0.9.82-rc.194

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
@@ -5373,6 +5373,22 @@ function injectMeshSystemMessage(components, args) {
5373
5373
  return { success: true, forwarded: 0, suppressed: true, duplicateCompletion: true };
5374
5374
  }
5375
5375
  }
5376
+ if (args.event === "agent:stopped" && eventSessionId) {
5377
+ const duplicateStopped = isDuplicateMeshCompletionEvent({
5378
+ meshId: args.meshId,
5379
+ event: args.event,
5380
+ sessionId: eventSessionId,
5381
+ providerType: readNonEmptyString2(args.metadataEvent.providerType) || void 0,
5382
+ providerSessionId: readNonEmptyString2(args.metadataEvent.providerSessionId) || void 0,
5383
+ timestamp: eventTimestamp,
5384
+ finalSummary: readNonEmptyString2(args.metadataEvent.finalSummary) || void 0,
5385
+ coordinatorDaemonId: workerCoordinatorDaemonId || void 0
5386
+ });
5387
+ if (duplicateStopped) {
5388
+ LOG.info("MeshEvents", `Suppressed duplicate stopped event for mesh ${args.meshId} session ${eventSessionId}`);
5389
+ return { success: true, forwarded: 0, suppressed: true, duplicateStopped: true };
5390
+ }
5391
+ }
5376
5392
  function markSessionTerminal(sessionId, outcome, occurredAtMs) {
5377
5393
  const task = updateSessionTaskStatus(args.meshId, sessionId, outcome, {
5378
5394
  occurredAt: occurredAtMs != null ? new Date(occurredAtMs).toISOString() : void 0
@@ -8564,9 +8580,9 @@ var init_cli_state_engine = __esm({
8564
8580
  const recentInteractiveActivity = this.hasRecentInteractiveActivity(snap, now);
8565
8581
  LOG.debug(
8566
8582
  "CLI",
8567
- `[${this.provider.type}] settled diagnostics prompt=${JSON.stringify(this.currentTurnScope?.prompt || "").slice(0, 140)} status=${String(status || "")} parsedStatus=${String(parsedStatus || "")} parsedMsgCount=${parsedMessages.length} lastParsedAssistant=${JSON.stringify((lastParsedAssistant?.content || "").slice(0, 120)).slice(0, 160)} responseBuffer=${JSON.stringify((snap.responseBuffer || "").slice(0, 160)).slice(0, 220)}`
8583
+ `[${this.provider.type}] settled diagnostics prompt=${JSON.stringify(this.currentTurnScope?.prompt || "").slice(0, 140)} status=${String(status || "")} parsedStatus=${String(parsedStatus || "")} parsedMsgCount=${parsedMessages.length} lastParsedAssistant=${JSON.stringify((lastParsedAssistant?.content || "").slice(0, 120)).slice(0, 160)} responseBuffer=${JSON.stringify((snap.responseBuffer || "").slice(0, 160)).slice(0, 220)} recentActivity=${recentInteractiveActivity}`
8568
8584
  );
8569
- const shouldHoldGenerating = status === "idle" && this.isWaitingForResponse && !!this.currentTurnScope && !modal && recentInteractiveActivity && !(parsedStatus === "idle" && !!lastParsedAssistant);
8585
+ const shouldHoldGenerating = status === "idle" && this.isWaitingForResponse && !!this.currentTurnScope && !modal && !(parsedStatus === "idle" && !!lastParsedAssistant);
8570
8586
  if (shouldHoldGenerating) {
8571
8587
  this.applyHoldGenerating(ctx);
8572
8588
  return;
@@ -11420,7 +11436,10 @@ function buildClaudeInteractiveTuiAnswerSteps(prompt, response) {
11420
11436
  if (answer.selectedLabels.length !== 1) throw new Error(`Expected one selected label for ${question.questionId}`);
11421
11437
  const selectedIndex = question.options.findIndex((option) => option.label === answer.selectedLabels[0]);
11422
11438
  if (selectedIndex < 0) throw new Error(`Unknown option for ${question.questionId}: ${answer.selectedLabels[0]}`);
11423
- steps.push(`${"\x1B[B".repeat(selectedIndex)}\r`);
11439
+ for (let i = 0; i < selectedIndex; i += 1) {
11440
+ steps.push("\x1B[B");
11441
+ }
11442
+ steps.push("\r");
11424
11443
  }
11425
11444
  steps.push("\r");
11426
11445
  return steps;
@@ -27867,6 +27886,9 @@ var CliProviderInstance = class {
27867
27886
  if (externalNativeFinal && isCliGeneratingLikeStatus(visibleStatus)) {
27868
27887
  visibleStatus = "idle";
27869
27888
  }
27889
+ if (isCliGeneratingLikeStatus(visibleStatus) && this.lastStatus === "idle") {
27890
+ visibleStatus = "idle";
27891
+ }
27870
27892
  const runtime = this.adapter.getRuntimeMetadata();
27871
27893
  this.maybeAppendRuntimeRecoveryMessage(runtime);
27872
27894
  let parsedMessages = Array.isArray(parsedStatus?.messages) ? parsedStatus.messages : [];
@@ -28435,6 +28457,9 @@ var CliProviderInstance = class {
28435
28457
  LOG.info("CLI", `[${this.type}] external transcript probe: msgCount=${probe.msgCount} lastRole=${probe.lastRole || "none"} lastKind=${probe.lastKind || "none"} contentLen=${probe.contentLen} sourceMtime=${probe.sourceMtimeMs ?? "unknown"} mtimeAge=${probe.mtimeAgeMs ?? "unknown"}ms`);
28436
28458
  pending.loggedTranscriptProbe = true;
28437
28459
  }
28460
+ if (this.type === "antigravity-cli") {
28461
+ return null;
28462
+ }
28438
28463
  return { reason: "missing_final_assistant", terminal: true, allowTimeout: allowMissingAssistantTimeout };
28439
28464
  }
28440
28465
  if (this.provider.requiresFinalAssistantBeforeIdle === true) {
@@ -28763,6 +28788,11 @@ var CliProviderInstance = class {
28763
28788
  }
28764
28789
  });
28765
28790
  this.generatingStartedAt = 0;
28791
+ if (this.completedDebounceTimer) {
28792
+ clearTimeout(this.completedDebounceTimer);
28793
+ this.completedDebounceTimer = null;
28794
+ }
28795
+ this.completedDebouncePending = null;
28766
28796
  continue;
28767
28797
  }
28768
28798
  this.pushEvent({ event: me.type, agentKey: me.agentKey, message: me.message, elapsedSec: me.elapsedSec, timestamp: me.timestamp });