@songsid/agend 2.1.4-beta.3 → 2.1.4-beta.31

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.
Files changed (146) hide show
  1. package/README.md +1 -1
  2. package/README.zh-TW.md +1 -1
  3. package/dist/agent-endpoint.js +1 -1
  4. package/dist/agent-endpoint.js.map +1 -1
  5. package/dist/backend/antigravity.d.ts +9 -5
  6. package/dist/backend/antigravity.js +155 -30
  7. package/dist/backend/antigravity.js.map +1 -1
  8. package/dist/backend/claude-code.d.ts +33 -21
  9. package/dist/backend/claude-code.js +103 -27
  10. package/dist/backend/claude-code.js.map +1 -1
  11. package/dist/backend/codex.d.ts +17 -0
  12. package/dist/backend/codex.js +123 -8
  13. package/dist/backend/codex.js.map +1 -1
  14. package/dist/backend/gemini-cli.js +2 -2
  15. package/dist/backend/gemini-cli.js.map +1 -1
  16. package/dist/backend/grok.js +2 -2
  17. package/dist/backend/grok.js.map +1 -1
  18. package/dist/backend/kiro.d.ts +1 -0
  19. package/dist/backend/kiro.js +17 -3
  20. package/dist/backend/kiro.js.map +1 -1
  21. package/dist/backend/opencode.d.ts +27 -11
  22. package/dist/backend/opencode.js +50 -39
  23. package/dist/backend/opencode.js.map +1 -1
  24. package/dist/backend/types.d.ts +20 -0
  25. package/dist/backend/types.js +12 -1
  26. package/dist/backend/types.js.map +1 -1
  27. package/dist/channel/adapters/discord.js +106 -19
  28. package/dist/channel/adapters/discord.js.map +1 -1
  29. package/dist/channel/adapters/telegram.js +5 -3
  30. package/dist/channel/adapters/telegram.js.map +1 -1
  31. package/dist/channel/agy-mcp-launcher.d.ts +2 -0
  32. package/dist/channel/agy-mcp-launcher.js +28 -0
  33. package/dist/channel/agy-mcp-launcher.js.map +1 -0
  34. package/dist/channel/mcp-server.js +6 -20
  35. package/dist/channel/mcp-server.js.map +1 -1
  36. package/dist/channel/mcp-tools.js +4 -2
  37. package/dist/channel/mcp-tools.js.map +1 -1
  38. package/dist/channel/types.d.ts +1 -1
  39. package/dist/classic-channel-manager.d.ts +40 -3
  40. package/dist/classic-channel-manager.js +218 -31
  41. package/dist/classic-channel-manager.js.map +1 -1
  42. package/dist/cli.js +148 -33
  43. package/dist/cli.js.map +1 -1
  44. package/dist/completion-install.d.ts +70 -0
  45. package/dist/completion-install.js +152 -0
  46. package/dist/completion-install.js.map +1 -0
  47. package/dist/completion.d.ts +7 -1
  48. package/dist/completion.js +14 -4
  49. package/dist/completion.js.map +1 -1
  50. package/dist/config-validator.js +38 -7
  51. package/dist/config-validator.js.map +1 -1
  52. package/dist/config.d.ts +2 -0
  53. package/dist/config.js +10 -1
  54. package/dist/config.js.map +1 -1
  55. package/dist/daemon.d.ts +177 -5
  56. package/dist/daemon.js +771 -99
  57. package/dist/daemon.js.map +1 -1
  58. package/dist/doctor.d.ts +26 -0
  59. package/dist/doctor.js +216 -0
  60. package/dist/doctor.js.map +1 -0
  61. package/dist/fleet-context.d.ts +47 -0
  62. package/dist/fleet-manager.d.ts +251 -10
  63. package/dist/fleet-manager.js +2059 -387
  64. package/dist/fleet-manager.js.map +1 -1
  65. package/dist/fleet-yaml-slim.d.ts +10 -0
  66. package/dist/fleet-yaml-slim.js +59 -0
  67. package/dist/fleet-yaml-slim.js.map +1 -0
  68. package/dist/general-knowledge/skills/backend-providers/SKILL.md +114 -0
  69. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +3 -1
  70. package/dist/general-knowledge/skills/delegation-playbook/SKILL.md +52 -0
  71. package/dist/general-knowledge/skills/development-workflow/SKILL.md +28 -0
  72. package/dist/general-knowledge/skills/fleet-config/SKILL.md +1 -0
  73. package/dist/general-knowledge/skills/fleet-health/SKILL.md +1 -0
  74. package/dist/general-knowledge/skills/fleet-restart/SKILL.md +1 -0
  75. package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +1 -0
  76. package/dist/general-knowledge/skills/model-discovery/SKILL.md +64 -16
  77. package/dist/general-knowledge/skills/multi-channel/SKILL.md +1 -0
  78. package/dist/general-knowledge/skills/scheduling/SKILL.md +1 -0
  79. package/dist/general-knowledge/skills/session-management/SKILL.md +1 -0
  80. package/dist/general-knowledge/skills/tui-effort/SKILL.md +1 -0
  81. package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +30 -0
  82. package/dist/instance-lifecycle.d.ts +45 -0
  83. package/dist/instance-lifecycle.js +150 -5
  84. package/dist/instance-lifecycle.js.map +1 -1
  85. package/dist/instructions.d.ts +12 -0
  86. package/dist/instructions.js +35 -1
  87. package/dist/instructions.js.map +1 -1
  88. package/dist/locale.js +750 -288
  89. package/dist/locale.js.map +1 -1
  90. package/dist/login-flows.d.ts +85 -0
  91. package/dist/login-flows.js +159 -0
  92. package/dist/login-flows.js.map +1 -0
  93. package/dist/login-manager.d.ts +63 -0
  94. package/dist/login-manager.js +134 -0
  95. package/dist/login-manager.js.map +1 -0
  96. package/dist/outbound-handlers.d.ts +8 -0
  97. package/dist/outbound-handlers.js +44 -5
  98. package/dist/outbound-handlers.js.map +1 -1
  99. package/dist/outbound-schemas.d.ts +5 -0
  100. package/dist/outbound-schemas.js +7 -0
  101. package/dist/outbound-schemas.js.map +1 -1
  102. package/dist/quickstart.js +25 -0
  103. package/dist/quickstart.js.map +1 -1
  104. package/dist/restart-progress.d.ts +2 -0
  105. package/dist/restart-progress.js +3 -0
  106. package/dist/restart-progress.js.map +1 -1
  107. package/dist/scheduler/db.d.ts +12 -0
  108. package/dist/scheduler/db.js +59 -0
  109. package/dist/scheduler/db.js.map +1 -1
  110. package/dist/service-installer.d.ts +11 -0
  111. package/dist/service-installer.js +84 -18
  112. package/dist/service-installer.js.map +1 -1
  113. package/dist/settings-api.js +1 -1
  114. package/dist/settings-api.js.map +1 -1
  115. package/dist/setup-wizard.js +2 -2
  116. package/dist/setup-wizard.js.map +1 -1
  117. package/dist/tips.d.ts +44 -0
  118. package/dist/tips.js +355 -0
  119. package/dist/tips.js.map +1 -0
  120. package/dist/tmux-manager.d.ts +6 -0
  121. package/dist/tmux-manager.js +12 -0
  122. package/dist/tmux-manager.js.map +1 -1
  123. package/dist/tool-progress.d.ts +40 -0
  124. package/dist/tool-progress.js +289 -0
  125. package/dist/tool-progress.js.map +1 -0
  126. package/dist/topic-commands.d.ts +36 -4
  127. package/dist/topic-commands.js +322 -64
  128. package/dist/topic-commands.js.map +1 -1
  129. package/dist/transcript-monitor.d.ts +15 -2
  130. package/dist/transcript-monitor.js +63 -17
  131. package/dist/transcript-monitor.js.map +1 -1
  132. package/dist/transcript-sources.d.ts +131 -0
  133. package/dist/transcript-sources.js +580 -0
  134. package/dist/transcript-sources.js.map +1 -0
  135. package/dist/types.d.ts +11 -0
  136. package/dist/ui/dashboard.html +55 -32
  137. package/dist/ui/settings.html +120 -51
  138. package/dist/ui/view.html +23 -15
  139. package/dist/usage/providers.d.ts +7 -0
  140. package/dist/usage/providers.js +18 -1
  141. package/dist/usage/providers.js.map +1 -1
  142. package/dist/usage/usage-api.d.ts +8 -2
  143. package/dist/usage/usage-api.js +24 -3
  144. package/dist/usage/usage-api.js.map +1 -1
  145. package/dist/workflow-templates/default.md +2 -1
  146. package/package.json +1 -1
package/dist/daemon.d.ts CHANGED
@@ -11,6 +11,10 @@ export declare function buildInstructionReloadNotice(binaryName: string, instanc
11
11
  export declare const DEFAULT_STUCK_TIMEOUT_MS: number;
12
12
  export declare const DEFAULT_STATE_IDLE_DEBOUNCE_MS = 2000;
13
13
  export declare const DEFAULT_STATE_SAFETY_SWEEP_MS = 60000;
14
+ /** Coalesce one cosmetic-redraw burst before comparing the visible pane. */
15
+ export declare const PERIODIC_REDRAW_PROBE_MS = 25;
16
+ /** A foreground server/port-forward should hand control back or be acknowledged. */
17
+ export declare const DEFAULT_BLOCKING_PROCESS_GRACE_MS: number;
14
18
  /**
15
19
  * Whether two working directories belong to the same project, so a fleet-scoped
16
20
  * decision recorded in one reaches the other. Covers the worktree/checkout
@@ -62,11 +66,13 @@ export declare function writeLastInboundAt(instanceDir: string, timestamp: numbe
62
66
  export declare function renderHandoffMetadata(meta: Record<string, string>): string;
63
67
  /** Headless inactivity timer used by the daemon and unit tests. */
64
68
  export declare class AutoPauseController {
65
- private readonly thresholdMs;
69
+ private thresholdMs;
66
70
  private lastActivityAt;
67
71
  private pausedAt;
68
72
  constructor(thresholdMs: number, lastActivityAt?: number);
69
73
  recordActivity(now?: number): void;
74
+ /** Apply a new idle threshold and start a fresh countdown from this update. */
75
+ reconfigure(thresholdMs: number, now?: number): void;
70
76
  observe(state: InstanceState, now?: number): boolean;
71
77
  markPaused(now?: number): void;
72
78
  markAwake(now?: number): void;
@@ -142,10 +148,13 @@ export declare class PaneStateMachine {
142
148
  * working" and a finished turn would not be seen as idle until the next 60s
143
149
  * safety sweep. Output timestamps are the honest liveness signal here, and
144
150
  * the caller has them.
151
+ * @param opts.forceBusy the backend has positively identified a still-running
152
+ * foreground tool even though its TUI keeps an old ready footer visible.
145
153
  */
146
154
  observe(pane: string, now?: number, opts?: {
147
155
  settled?: boolean;
148
156
  changeAt?: number;
157
+ forceBusy?: boolean;
149
158
  }): InstanceStateSnapshot;
150
159
  /** Record pane motion from tmux control mode without capturing pane content. */
151
160
  recordOutput(now?: number): InstanceStateSnapshot;
@@ -258,6 +267,30 @@ export declare class InteractivePromptDetector {
258
267
  observe(pane: string, now?: number, outputAt?: number): InteractivePromptDetection | null;
259
268
  reset(): void;
260
269
  }
270
+ export interface BlockingProcessDetection {
271
+ activity: string;
272
+ evidence: string;
273
+ blockedForMs: number;
274
+ }
275
+ /**
276
+ * Detect a foreground shell tool which has become a long-lived server.
277
+ *
278
+ * Unlike the generic pane-stuck clock, this clock deliberately survives new
279
+ * output: access logs and `Handling connection` lines are exactly why a
280
+ * foreground server can remain blocked forever without ever looking silent.
281
+ * Once a server marker is seen, the still-running tool identity is the stable
282
+ * signal; the marker may scroll out of the 32-row pane.
283
+ */
284
+ export declare class BlockingProcessDetector {
285
+ private readonly graceMs;
286
+ private activity;
287
+ private evidence;
288
+ private detectedAt;
289
+ private notified;
290
+ constructor(graceMs?: number);
291
+ observe(pane: string, activity: string | null, now?: number): BlockingProcessDetection | null;
292
+ reset(): void;
293
+ }
261
294
  export declare class Daemon extends EventEmitter {
262
295
  private name;
263
296
  private config;
@@ -317,6 +350,7 @@ export declare class Daemon extends EventEmitter {
317
350
  /** Fallback safety sweep used only when no shared tmux control client exists. */
318
351
  private instanceStateMonitorTimer;
319
352
  private instanceStateIdleTimer;
353
+ private instanceStateOutputProbeTimer;
320
354
  private instanceStateStuckTimer;
321
355
  private instanceStateOutputListener;
322
356
  private instanceStateOutputEventName;
@@ -327,6 +361,7 @@ export declare class Daemon extends EventEmitter {
327
361
  private instanceStateReadyPattern;
328
362
  private instanceStateBusyPattern;
329
363
  private instanceStateMonitorActive;
364
+ private sessionCheckpointWarningEmitted;
330
365
  private statePollInFlight;
331
366
  private turnHadInbound;
332
367
  private turnOutboundDelivered;
@@ -342,6 +377,24 @@ export declare class Daemon extends EventEmitter {
342
377
  * would silently no-op exactly when we most need to stop feeding the CLI.
343
378
  */
344
379
  private pausePending;
380
+ /**
381
+ * An auth failure was detected and nothing has resolved it yet.
382
+ *
383
+ * Separate from `pausePending` because it must outlive it: the deferred pause
384
+ * clears `pausePending` as soon as it fires, but if that pause is refused the
385
+ * instance is still auth-broken and must not resume raising alarms.
386
+ */
387
+ private authFailureUnresolved;
388
+ /** One login-screen auth report per spawn — the screen persists across polls. */
389
+ private loginScreenReported;
390
+ /** model_error seen mid-turn: notify only if it survives to the idle screen. */
391
+ private pendingModelErrorKey;
392
+ /**
393
+ * Let the next pause() proceed from a stuck pane. Set only for the auth-deferred
394
+ * pause — see the pausePending consumption site for why waiting for idle there
395
+ * is waiting forever.
396
+ */
397
+ private pauseAllowStuck;
345
398
  private pauseWakeState;
346
399
  private pauseWakeTransition;
347
400
  private modelOverride;
@@ -353,6 +406,12 @@ export declare class Daemon extends EventEmitter {
353
406
  * and ⏳/👀/✅ reactions live here). It does NOT cover the other writers that
354
407
  * reach the pane — {@link paneWriteLock} does. */
355
408
  private pasteLock;
409
+ /**
410
+ * Fleet cancellation epoch. Queue entries retain the epoch they arrived with;
411
+ * advancing it invalidates only work received before the cancel, never a new
412
+ * user message which arrives immediately afterwards.
413
+ */
414
+ private deliveryEpoch;
356
415
  /** Mutual exclusion for *every* write into the pane, whichever subsystem it
357
416
  * comes from. See PaneWriteLock for why interleaving is destructive. */
358
417
  private readonly paneWriteLock;
@@ -362,8 +421,20 @@ export declare class Daemon extends EventEmitter {
362
421
  private lastBuiltInstructions;
363
422
  private pasteQueueDepth;
364
423
  private firstDeliveryDelay;
424
+ /** Orders /steer pastes against each other. Deliberately NOT pasteLock:
425
+ * a steer must not queue behind the normal deliveries it exists to
426
+ * overtake. Pane-level exclusion still comes from paneWriteLock inside
427
+ * deliverMessage, so a steer and a normal delivery can never interleave
428
+ * their PTY writes — the steer just doesn't wait for idle. */
429
+ private steerLock;
430
+ /** Tool lines shown in the channel processing bubble for the current turn. */
431
+ private readonly turnProgress;
432
+ private lastProgressBroadcast;
433
+ private progressBroadcastTimer;
434
+ private lastProgressBroadcastAt;
365
435
  private errorMonitorTimer;
366
436
  private readonly interactivePromptDetector;
437
+ private readonly blockingProcessDetector;
367
438
  /** Same 5-min gate the error monitor uses, so a dead MCP server alerts once. */
368
439
  private static readonly MCP_DEATH_COOLDOWN_MS;
369
440
  private lastMcpDeathNotifiedAt;
@@ -468,6 +539,8 @@ export declare class Daemon extends EventEmitter {
468
539
  private startErrorMonitor;
469
540
  /** Evaluate one pane snapshot. Kept synchronous so state-machine edges are unit-testable. */
470
541
  private evaluateErrorPatterns;
542
+ /** Arm the recovery gates and emit one detected error pattern. */
543
+ private emitErrorPattern;
471
544
  /**
472
545
  * Notification text for a detected pattern. `formatMessage` patterns build it
473
546
  * from the match so the user gets the specifics (e.g. which period and what
@@ -489,12 +562,30 @@ export declare class Daemon extends EventEmitter {
489
562
  * that message, which is what the user asked for anyway.
490
563
  */
491
564
  sendEscape(): Promise<void>;
565
+ /**
566
+ * Drop every not-yet-started pane delivery which predates a user cancel.
567
+ * Promise chains cannot be removed, so entries become generation-checked
568
+ * no-ops. An entry already past its check is allowed to finish its current PTY
569
+ * transaction; the interrupt key still cancels the CLI generation.
570
+ */
571
+ clearPendingDeliveries(fleetEpoch?: number): void;
572
+ private captureDeliveryEpoch;
573
+ private isDeliveryEpochCurrent;
574
+ private queueRawPaste;
492
575
  /** Send the backend-specific graceful quit command/key sequence. */
493
576
  private sendQuitSequence;
494
577
  stop(): Promise<void>;
495
578
  getHangDetector(): HangDetector | null;
496
579
  getInstanceState(): InstanceState | "paused";
497
580
  getInstanceStateSnapshot(): InstanceStateSnapshot;
581
+ /**
582
+ * Answer a FleetManager state query. Most callers only need the cached state,
583
+ * but lifecycle decisions such as post-reply Cancel retirement need an
584
+ * authoritative pane observation: after startup the last transition can stay
585
+ * "working" even though the CLI has since settled without emitting another
586
+ * control-mode output record.
587
+ */
588
+ private respondToInstanceStateQuery;
498
589
  /** Gracefully stop the CLI while keeping its remain-on-exit tmux window. */
499
590
  /**
500
591
  * Mark the instance to pause as soon as its pane is idle. Used for auth
@@ -524,6 +615,13 @@ export declare class Daemon extends EventEmitter {
524
615
  /** Relay the pane's final text to the channel, marked as a daemon proxy reply. */
525
616
  private sendProxyReply;
526
617
  private clearInstanceStateIdleTimer;
618
+ private clearInstanceStateOutputProbeTimer;
619
+ /**
620
+ * Periodic status-line hooks can generate `%output` without changing a single
621
+ * visible cell. Probe the pane once per burst: a changed capture is real work;
622
+ * an identical ready capture remains idle and emits no state edge.
623
+ */
624
+ private scheduleInstanceStateOutputProbe;
527
625
  private clearInstanceStateStuckTimer;
528
626
  private scheduleInstanceStateStuckDeadline;
529
627
  private scheduleInstanceStateIdleCapture;
@@ -542,14 +640,48 @@ export declare class Daemon extends EventEmitter {
542
640
  * Tell the fleet manager what this instance is doing right now, for the live
543
641
  * progress line on the cancel button.
544
642
  *
545
- * Purely cosmetic — nothing decides anything from it, so it is fine that only
546
- * backends with a transcript feed report at all (claude-code today). For the
547
- * rest the progress line keeps showing just elapsed time.
643
+ * Primarily cosmetic. The foreground-process detector also uses a current
644
+ * shell activity as one of several positive signals, but never makes a state
645
+ * decision from an arbitrary activity label alone.
548
646
  *
549
647
  * Repeats are dropped: the ticker only edits the channel message when the text
550
648
  * changes, and a stream of identical broadcasts would defeat that.
551
649
  */
552
650
  private publishActivity;
651
+ /** Effective tool_progress level, hardened against junk config values.
652
+ * Off unless explicitly enabled: an update must never make bubbles start
653
+ * listing tool activity the operator did not ask to broadcast. */
654
+ private toolProgressLevel;
655
+ /**
656
+ * Apply a tool-progress setting without restarting the CLI session.
657
+ *
658
+ * Drop the current accumulator at the boundary: verbose entries may contain
659
+ * command previews which must not survive a downgrade to standard/off, and a
660
+ * newly enabled level should start with a clean, internally consistent list.
661
+ */
662
+ updateToolProgress(level: InstanceConfig["tool_progress"]): void;
663
+ /** Snapshot the configuration actually owned by this live daemon. */
664
+ getConfigSnapshot(): InstanceConfig;
665
+ /**
666
+ * Apply the whitelisted hot configuration carried by FleetManager IPC.
667
+ * null removes an optional value; invalid/unlisted fields are ignored rather
668
+ * than allowing another client on the per-instance socket to mutate cold
669
+ * process/session settings.
670
+ */
671
+ applyConfigUpdate(value: unknown): void;
672
+ /**
673
+ * Accumulate one semantic progress line for the channel bubble and schedule
674
+ * a coalesced broadcast. Separate from publishActivity on purpose: that one
675
+ * is the single-line statusline detail (terse, operator-facing), this is the
676
+ * multi-line channel list (semantic, argument-free at `standard`) — see
677
+ * tool-progress.ts for why the two labellers must not merge.
678
+ */
679
+ private recordToolProgress;
680
+ /** Coalesce progress broadcasts: at most one per 3s, trailing edge kept. */
681
+ private scheduleProgressBroadcast;
682
+ private broadcastToolProgress;
683
+ /** New turn (or turn over): drop the list and tell the fleet to clear it. */
684
+ private resetToolProgress;
553
685
  /**
554
686
  * Options for every system-initiated paste (startup notice, session snapshot,
555
687
  * runtime-dialog keys).
@@ -561,12 +693,43 @@ export declare class Daemon extends EventEmitter {
561
693
  */
562
694
  private systemPasteOptions;
563
695
  private summarizeTool;
696
+ /**
697
+ * The one place an inbound message grows its metadata wrapper ([user:]/
698
+ * [from:] prefix, pending reactions, handoff metadata, reply instructions).
699
+ * Both the normal queued path (pushChannelMessage) and /steer go through
700
+ * here — a steered message must read EXACTLY like a queued one to the
701
+ * agent, or the two drift apart in what the agent is told about replying.
702
+ */
703
+ private formatInboundMessage;
704
+ /**
705
+ * /steer: interject into the CURRENT turn instead of queueing for idle.
706
+ *
707
+ * Differences from pushChannelMessage, and nothing else:
708
+ * - serialized on steerLock, not pasteLock — it must overtake, not queue
709
+ * - deliverMessage runs with { steer: true }, which takes the busy branch
710
+ * that pastes immediately (the codex native-queue transaction) instead of
711
+ * waiting for idle. Verification and silent-loss fallback are the ones
712
+ * that path already has: pane-capture visibility check, then one
713
+ * idle-gated redelivery — so on a TUI that swallows busy input the steer
714
+ * degrades to "next message after this turn", never silently vanishes.
715
+ *
716
+ * The steered text goes through formatInboundMessage so the agent sees a
717
+ * normal inbound message, with a steering notice prepended for context.
718
+ */
719
+ steerMessage(content: string, meta: Record<string, string>, deliveryEpoch?: number): void;
720
+ /**
721
+ * /btw: submit a separately-labelled side question immediately while asking
722
+ * the agent not to change the active task. Claude's native `/btw` opens a
723
+ * branchAndResume panel whose answer never reaches the channel or transcript,
724
+ * so channel delivery intentionally uses a normal wrapped inbound instead.
725
+ */
726
+ btwMessage(content: string, meta: Record<string, string>, deliveryEpoch?: number): void;
564
727
  /**
565
728
  * Push an inbound channel message to a specific MCP session.
566
729
  * If targetSession is provided, only send to the matching socket.
567
730
  * Otherwise send to the instance's own session (this.name).
568
731
  */
569
- pushChannelMessage(content: string, meta: Record<string, string>, _targetSession?: string): void;
732
+ pushChannelMessage(content: string, meta: Record<string, string>, _targetSession?: string, deliveryEpoch?: number): void;
570
733
  /**
571
734
  * Deliver a single message and drive its status reactions:
572
735
  * ⏳ message_queued — CLI busy; queued locally or by the backend
@@ -584,6 +747,15 @@ export declare class Daemon extends EventEmitter {
584
747
  * serial in both cases so separate PTY writes can never overlap.
585
748
  */
586
749
  private deliverMessage;
750
+ /**
751
+ * A raw `%output` silence check is authoritative for ordinary TUIs. It is not
752
+ * for a backend such as agy whose status-line hook periodically redraws an
753
+ * identical screen. In that case trust an idle pane-state snapshot only when
754
+ * it was captured after both the latest output and the latest control-client
755
+ * observation reset.
756
+ */
757
+ private isPaneIdleForDelivery;
758
+ private waitForPaneIdleForDelivery;
587
759
  /**
588
760
  * The write half of a delivery: paste → Enter → confirm, with retries.
589
761
  *