@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.js CHANGED
@@ -5378,6 +5378,22 @@ function injectMeshSystemMessage(components, args) {
5378
5378
  return { success: true, forwarded: 0, suppressed: true, duplicateCompletion: true };
5379
5379
  }
5380
5380
  }
5381
+ if (args.event === "agent:stopped" && eventSessionId) {
5382
+ const duplicateStopped = isDuplicateMeshCompletionEvent({
5383
+ meshId: args.meshId,
5384
+ event: args.event,
5385
+ sessionId: eventSessionId,
5386
+ providerType: readNonEmptyString2(args.metadataEvent.providerType) || void 0,
5387
+ providerSessionId: readNonEmptyString2(args.metadataEvent.providerSessionId) || void 0,
5388
+ timestamp: eventTimestamp,
5389
+ finalSummary: readNonEmptyString2(args.metadataEvent.finalSummary) || void 0,
5390
+ coordinatorDaemonId: workerCoordinatorDaemonId || void 0
5391
+ });
5392
+ if (duplicateStopped) {
5393
+ LOG.info("MeshEvents", `Suppressed duplicate stopped event for mesh ${args.meshId} session ${eventSessionId}`);
5394
+ return { success: true, forwarded: 0, suppressed: true, duplicateStopped: true };
5395
+ }
5396
+ }
5381
5397
  function markSessionTerminal(sessionId, outcome, occurredAtMs) {
5382
5398
  const task = updateSessionTaskStatus(args.meshId, sessionId, outcome, {
5383
5399
  occurredAt: occurredAtMs != null ? new Date(occurredAtMs).toISOString() : void 0
@@ -8568,9 +8584,9 @@ var init_cli_state_engine = __esm({
8568
8584
  const recentInteractiveActivity = this.hasRecentInteractiveActivity(snap, now);
8569
8585
  LOG.debug(
8570
8586
  "CLI",
8571
- `[${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)}`
8587
+ `[${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}`
8572
8588
  );
8573
- const shouldHoldGenerating = status === "idle" && this.isWaitingForResponse && !!this.currentTurnScope && !modal && recentInteractiveActivity && !(parsedStatus === "idle" && !!lastParsedAssistant);
8589
+ const shouldHoldGenerating = status === "idle" && this.isWaitingForResponse && !!this.currentTurnScope && !modal && !(parsedStatus === "idle" && !!lastParsedAssistant);
8574
8590
  if (shouldHoldGenerating) {
8575
8591
  this.applyHoldGenerating(ctx);
8576
8592
  return;
@@ -11730,7 +11746,10 @@ function buildClaudeInteractiveTuiAnswerSteps(prompt, response) {
11730
11746
  if (answer.selectedLabels.length !== 1) throw new Error(`Expected one selected label for ${question.questionId}`);
11731
11747
  const selectedIndex = question.options.findIndex((option) => option.label === answer.selectedLabels[0]);
11732
11748
  if (selectedIndex < 0) throw new Error(`Unknown option for ${question.questionId}: ${answer.selectedLabels[0]}`);
11733
- steps.push(`${"\x1B[B".repeat(selectedIndex)}\r`);
11749
+ for (let i = 0; i < selectedIndex; i += 1) {
11750
+ steps.push("\x1B[B");
11751
+ }
11752
+ steps.push("\r");
11734
11753
  }
11735
11754
  steps.push("\r");
11736
11755
  return steps;
@@ -28177,6 +28196,9 @@ var CliProviderInstance = class {
28177
28196
  if (externalNativeFinal && isCliGeneratingLikeStatus(visibleStatus)) {
28178
28197
  visibleStatus = "idle";
28179
28198
  }
28199
+ if (isCliGeneratingLikeStatus(visibleStatus) && this.lastStatus === "idle") {
28200
+ visibleStatus = "idle";
28201
+ }
28180
28202
  const runtime = this.adapter.getRuntimeMetadata();
28181
28203
  this.maybeAppendRuntimeRecoveryMessage(runtime);
28182
28204
  let parsedMessages = Array.isArray(parsedStatus?.messages) ? parsedStatus.messages : [];
@@ -28745,6 +28767,9 @@ var CliProviderInstance = class {
28745
28767
  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`);
28746
28768
  pending.loggedTranscriptProbe = true;
28747
28769
  }
28770
+ if (this.type === "antigravity-cli") {
28771
+ return null;
28772
+ }
28748
28773
  return { reason: "missing_final_assistant", terminal: true, allowTimeout: allowMissingAssistantTimeout };
28749
28774
  }
28750
28775
  if (this.provider.requiresFinalAssistantBeforeIdle === true) {
@@ -29073,6 +29098,11 @@ var CliProviderInstance = class {
29073
29098
  }
29074
29099
  });
29075
29100
  this.generatingStartedAt = 0;
29101
+ if (this.completedDebounceTimer) {
29102
+ clearTimeout(this.completedDebounceTimer);
29103
+ this.completedDebounceTimer = null;
29104
+ }
29105
+ this.completedDebouncePending = null;
29076
29106
  continue;
29077
29107
  }
29078
29108
  this.pushEvent({ event: me.type, agentKey: me.agentKey, message: me.message, elapsedSec: me.elapsedSec, timestamp: me.timestamp });