Skip to content

Commit 4da807e

Browse files
author
zwingzheng
committed
fix(js-sdk): fix types if session.chat
1 parent 4dea020 commit 4da807e

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

packages/opencode/src/server/server.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,10 @@ export namespace Server {
572572
description: "Created message",
573573
content: {
574574
"application/json": {
575-
schema: resolver(MessageV2.Assistant),
575+
schema: resolver(z.object({
576+
info: MessageV2.Assistant,
577+
parts: MessageV2.Part.array(),
578+
})),
576579
},
577580
},
578581
},

packages/sdk/js/src/gen/types.gen.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,10 @@ export type SessionChatResponses = {
14231423
/**
14241424
* Created message
14251425
*/
1426-
200: AssistantMessage
1426+
200: {
1427+
info: AssistantMessage
1428+
parts: Array<Part>
1429+
}
14271430
}
14281431

14291432
export type SessionChatResponse = SessionChatResponses[keyof SessionChatResponses]

0 commit comments

Comments
 (0)