events.ts 693 B

12345678910111213141516
  1. /**
  2. * Wire protocol of the `/plugins/events` dev SSE channel — single source for
  3. * both halves of this package. Frames still cross a wire boundary: the
  4. * browser half validates them at its JSON parse point; sharing the type keeps
  5. * the two ends from drifting, not from parsing.
  6. */
  7. import type { WebBootGraph } from '@deepseek-ai/dsh-client-modules'
  8. /** One SSE frame: the full graph on connect, or one rebuilt bundle notice. */
  9. export type PluginsEventFrame =
  10. | { type: 'graph'; graph: WebBootGraph }
  11. | { type: 'rebuilt'; id: string; rev: string }
  12. /** System SSE endpoint pushing graph/rebuilt frames (wire protocol constant). */
  13. export const EVENTS_ENDPOINT = '/plugins/events'