mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
Refactor SSE event handling and consolidate notification contexts
This commit is contained in:
1 parent
9851ec06e0
commit
f7fd3176d4
30 files changed
+2226
-988
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user