Refactor SSE event handling and consolidate notification contexts

This commit is contained in:
Chris Scott committed 2026-01-12 23:56:50 -05:00
1 parent 9851ec06e0
commit f7fd3176d4
30 files changed
+2226 -988

No files matched your search

+16
View File
@@ -11,6 +11,7 @@ type CommandListResponse = paths['/command']['get']['responses']['200']['content
type CommandRequest = NonNullable<paths['/session/{sessionID}/command']['post']['requestBody']>['content']['application/json']
type ShellRequest = NonNullable<paths['/session/{sessionID}/shell']['post']['requestBody']>['content']['application/json']
type AgentListResponse = paths['/agent']['get']['responses']['200']['content']['application/json']
type QuestionListResponse = paths['/question']['get']['responses']['200']['content']['application/json']
export class OpenCodeClient {
private client: AxiosInstance
@@ -130,6 +131,21 @@ export class OpenCodeClient {
return result.data
}
async replyToQuestion(requestID: string, answers: string[][]) {
const result = await this.client.post(`/question/${requestID}/reply`, { answers })
return result.data
}
async rejectQuestion(requestID: string) {
const result = await this.client.post(`/question/${requestID}/reject`)
return result.data
}
async listPendingQuestions() {
const response = await this.client.get<QuestionListResponse>('/question')
return response.data
}
async listAgents() {
const response = await this.client.get<AgentListResponse>('/agent')
return response.data