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 e599951769
commit 32e90eaec8
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,
),
},
}
}
+4
View File
@@ -1,3 +1,5 @@
import type { OpenCodeEventEncoded } from "@opencode-ai/protocol/groups/event"
export type JsonValue =
| null
| boolean
@@ -1666,3 +1668,5 @@ export type SessionsMessageOutput = {
readonly time: { readonly created: number }
}
}["data"]
export type EventsSubscribeOutput = OpenCodeEventEncoded