singularity-forge/packages/rpc-client/src
Mikael Hugo a055b3adf2 feat: structured notification event model with metadata-first classification
Replace brittle string-matching in headless-events.ts with structured
source/kind/blocking/dedupe_key metadata on notify() events. String
matching is preserved as a fallback for the ~940 untagged call sites.

- Add NotificationMetadata type to headless-types.ts (canonical definition)
- Extend rpc-types.ts notify event with optional metadata field
- Extend ExtensionUIContext.notify() signature with optional 3rd arg
- Pass metadata through RPC notify implementation in rpc-mode.ts
- Update headless-events.ts: isTerminalNotification, isBlockedNotification,
  isMilestoneReadyNotification, isPauseNotification all check metadata first
- Update notification-store.ts: store metadata on NotificationEntry; use
  metadata.dedupe_key as dedup key when provided (falls back to message hash)
- Update notify-interceptor.ts to thread metadata through to store + original
- Tag critical emit sites with structured metadata:
  stopAuto → { kind: "terminal" } (+ blocking: true when reason includes "block")
  pauseAuto → { kind: "terminal", blocking: true }
  guided-flow milestone ready → { kind: "approval_request", blocking: true }
- Update notification-overlay.ts to prefer metadata.source for [label] display
- Add 17-test regression suite (notification-event-model.test.ts)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 23:07:57 +02:00
..
index.ts chore: sync workspace state after rebrand 2026-04-15 14:54:20 +02:00
jsonl.ts feat: Headless Integration Hardening & Release (M002) (#2811) 2026-03-26 23:33:22 -06:00
rpc-client.test.ts Add provider smoke benchmark and headless updates 2026-04-30 10:19:18 +02:00
rpc-client.ts Add provider smoke benchmark and headless updates 2026-04-30 10:19:18 +02:00
rpc-types.ts feat: structured notification event model with metadata-first classification 2026-05-01 23:07:57 +02:00