feat(sdk): expose live event stream (#34098)

This commit is contained in:
Kit Langton
2026-06-26 21:16:33 +02:00
committed by GitHub
parent 2c02f8bace
commit 42e6b7db32
19 changed files with 396 additions and 57 deletions
+8
View File
@@ -32,6 +32,7 @@ import type {
SessionsInterruptOutput,
SessionsMessageInput,
SessionsMessageOutput,
EventsSubscribeOutput,
} from "./types"
import { ClientError } from "./client-error"
@@ -373,6 +374,13 @@ export function make(options: ClientOptions) {
requestOptions,
).then((value) => value.data),
},
events: {
subscribe: (requestOptions?: RequestOptions): AsyncIterable<EventsSubscribeOutput> =>
sse<EventsSubscribeOutput>(
{ method: "GET", path: `/api/event`, successStatus: 200, declaredStatuses: [401, 400], empty: false },
requestOptions,
),
},
}
}