fix(protocol): keep internal events off SSE (#35378)

This commit is contained in:
Kit Langton 2026-07-04 21:12:45 -04:00 committed by GitHub
commit 905123b9c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 52 additions and 44 deletions

View file

@ -1,5 +1,6 @@
export * as EventManifest from "./event-manifest.js"
import { Schema } from "effect"
import { Agent } from "./agent.js"
import { Catalog } from "./catalog.js"
import { Command } from "./command.js"
@ -78,7 +79,7 @@ export const ServerDefinitions = Event.inventory(
...TuiEvent.Definitions,
...InstallationEvent.Definitions,
...VcsEvent.Definitions,
...McpEvent.Definitions,
McpEvent.StatusChanged,
// Shared transitional: V1 contracts the current TUI still consumes during
// the migration (permission.asked/replied, question.asked, session.error).
// Remove when the TUI moves to the current permission/question surfaces.
@ -86,6 +87,9 @@ export const ServerDefinitions = Event.inventory(
...QuestionV1.Event.Definitions,
SessionV1.Error,
)
export const Server = Event.latest(ServerDefinitions)
export type ServerEvent = Schema.Schema.Type<(typeof ServerDefinitions)[number]>
export const isServer = (event: { readonly type: string }): event is ServerEvent => Server.has(event.type)
export const Definitions = Event.inventory(
...foundationDefinitions,