@adhdev/daemon-core 0.9.82-rc.252 → 0.9.82-rc.254

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.
@@ -41,7 +41,7 @@ import { LOG } from '../../logging/logger.js';
41
41
 
42
42
  export type DashboardEvent =
43
43
  | { kind: 'pty_data'; chunk: string }
44
- | { kind: 'state_changed'; state: { id: string; label: string; title: string | null };
44
+ | { kind: 'state_changed'; state: { id: string; label: string; title: string | null; status: 'idle' | 'generating' | 'approval' };
45
45
  modal: { title: string | null; buttons: { index: number; label: string }[] } | null;
46
46
  controls: { id: string; label: string; action_type: string }[] }
47
47
  | { kind: 'notification'; id: string; title: string; body: string }
@@ -144,7 +144,7 @@ type HistoryEntry = DriverHistoryEntry;
144
144
  /** Per-state evaluation snapshot (mirrors v3 SpecEvaluation shape for the
145
145
  * parts the cli-adapter / panel consume). */
146
146
  interface CurrentEval {
147
- state: { id: string; label: string; title: string | null };
147
+ state: { id: string; label: string; title: string | null; status: 'idle' | 'generating' | 'approval' };
148
148
  modal: ModalSnapshot | null;
149
149
  controls: VisibleControl[];
150
150
  }
@@ -432,7 +432,12 @@ export class FsmDriver implements ISpecDriver {
432
432
  const title = modal?.title ?? this.deriveTitle(state, sections, lines.join('\n'));
433
433
 
434
434
  const next: CurrentEval = {
435
- state: { id: state.id, label: state.label, title },
435
+ // status is derived from the FSM state itself (statusForState), NOT from
436
+ // whether a modal was parsed this frame. A modal state whose buttons briefly
437
+ // fail to parse (PTY repaint → deriveModal returns null) must still report
438
+ // its authoritative status (e.g. 'approval'), so the adapter never collapses
439
+ // an approval/busy state to idle on a transient modal-parse miss.
440
+ state: { id: state.id, label: state.label, title, status: statusForState(state) },
436
441
  modal,
437
442
  controls,
438
443
  };