From 2663ecd39df1b4532b96e8b7f7f9693b8e5ee281 Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" Date: Fri, 22 May 2026 11:00:29 +0000 Subject: [PATCH] chore: generate --- packages/opencode/src/question/index.ts | 5 +- .../server/httpapi-public-openapi.test.ts | 6 +- packages/sdk/js/src/v2/gen/types.gen.ts | 28 ++++++--- packages/sdk/openapi.json | 57 ++++++++++++++++--- 4 files changed, 76 insertions(+), 20 deletions(-) diff --git a/packages/opencode/src/question/index.ts b/packages/opencode/src/question/index.ts index ca52bddc8e..e03af848b0 100644 --- a/packages/opencode/src/question/index.ts +++ b/packages/opencode/src/question/index.ts @@ -119,7 +119,10 @@ export interface Interface { questions: ReadonlyArray tool?: Tool }) => Effect.Effect, RejectedError> - readonly reply: (input: { requestID: QuestionID; answers: ReadonlyArray }) => Effect.Effect + readonly reply: (input: { + requestID: QuestionID + answers: ReadonlyArray + }) => Effect.Effect readonly reject: (requestID: QuestionID) => Effect.Effect readonly list: () => Effect.Effect> } diff --git a/packages/opencode/test/server/httpapi-public-openapi.test.ts b/packages/opencode/test/server/httpapi-public-openapi.test.ts index c928f1668e..e98e07c005 100644 --- a/packages/opencode/test/server/httpapi-public-openapi.test.ts +++ b/packages/opencode/test/server/httpapi-public-openapi.test.ts @@ -161,9 +161,9 @@ describe("PublicApi OpenAPI v2 errors", () => { test("documents permission and question not-found errors", () => { const spec = OpenApi.fromApi(PublicApi) as OpenApiSpec - expect(componentName(responseRef(spec.paths["/permission/{requestID}/reply"]?.post?.responses?.["404"]) ?? "")).toBe( - "PermissionNotFoundError", - ) + expect( + componentName(responseRef(spec.paths["/permission/{requestID}/reply"]?.post?.responses?.["404"]) ?? ""), + ).toBe("PermissionNotFoundError") for (const route of [ ["post", "/question/{requestID}/reply"], ["post", "/question/{requestID}/reject"], diff --git a/packages/sdk/js/src/v2/gen/types.gen.ts b/packages/sdk/js/src/v2/gen/types.gen.ts index 527c3a9dac..16a4bd3106 100644 --- a/packages/sdk/js/src/v2/gen/types.gen.ts +++ b/packages/sdk/js/src/v2/gen/types.gen.ts @@ -1704,6 +1704,18 @@ export type EffectHttpApiErrorForbidden = { _tag: "Forbidden" } +export type QuestionNotFoundError = { + _tag: "QuestionNotFoundError" + requestID: string + message: string +} + +export type PermissionNotFoundError = { + _tag: "PermissionNotFoundError" + requestID: string + message: string +} + export type ProviderAuthMethod = { type: "oauth" | "api" label: string @@ -5717,9 +5729,9 @@ export type QuestionReplyErrors = { */ 400: EffectHttpApiErrorBadRequest | InvalidRequestError /** - * Not found + * QuestionNotFoundError */ - 404: NotFoundError + 404: QuestionNotFoundError } export type QuestionReplyError = QuestionReplyErrors[keyof QuestionReplyErrors] @@ -5751,9 +5763,9 @@ export type QuestionRejectErrors = { */ 400: EffectHttpApiErrorBadRequest | InvalidRequestError /** - * Not found + * QuestionNotFoundError */ - 404: NotFoundError + 404: QuestionNotFoundError } export type QuestionRejectError = QuestionRejectErrors[keyof QuestionRejectErrors] @@ -5816,9 +5828,9 @@ export type PermissionReplyErrors = { */ 400: EffectHttpApiErrorBadRequest | InvalidRequestError /** - * Not found + * PermissionNotFoundError */ - 404: NotFoundError + 404: PermissionNotFoundError } export type PermissionReplyError = PermissionReplyErrors[keyof PermissionReplyErrors] @@ -6916,9 +6928,9 @@ export type PermissionRespondErrors = { */ 400: EffectHttpApiErrorBadRequest | InvalidRequestError /** - * NotFoundError + * NotFoundError | PermissionNotFoundError */ - 404: NotFoundError + 404: NotFoundError | PermissionNotFoundError } export type PermissionRespondError = PermissionRespondErrors[keyof PermissionRespondErrors] diff --git a/packages/sdk/openapi.json b/packages/sdk/openapi.json index 074bde1ec3..157799b00c 100644 --- a/packages/sdk/openapi.json +++ b/packages/sdk/openapi.json @@ -4348,11 +4348,11 @@ } }, "404": { - "description": "Not found", + "description": "QuestionNotFoundError", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotFoundError" + "$ref": "#/components/schemas/QuestionNotFoundError" } } } @@ -4449,11 +4449,11 @@ } }, "404": { - "description": "Not found", + "description": "QuestionNotFoundError", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotFoundError" + "$ref": "#/components/schemas/QuestionNotFoundError" } } } @@ -4588,11 +4588,11 @@ } }, "404": { - "description": "Not found", + "description": "PermissionNotFoundError", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotFoundError" + "$ref": "#/components/schemas/PermissionNotFoundError" } } } @@ -7462,11 +7462,18 @@ } }, "404": { - "description": "NotFoundError", + "description": "NotFoundError | PermissionNotFoundError", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotFoundError" + "anyOf": [ + { + "$ref": "#/components/schemas/NotFoundError" + }, + { + "$ref": "#/components/schemas/PermissionNotFoundError" + } + ] } } } @@ -15400,6 +15407,40 @@ "required": ["_tag"], "additionalProperties": false }, + "QuestionNotFoundError": { + "type": "object", + "properties": { + "_tag": { + "type": "string", + "enum": ["QuestionNotFoundError"] + }, + "requestID": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": ["_tag", "requestID", "message"], + "additionalProperties": false + }, + "PermissionNotFoundError": { + "type": "object", + "properties": { + "_tag": { + "type": "string", + "enum": ["PermissionNotFoundError"] + }, + "requestID": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": ["_tag", "requestID", "message"], + "additionalProperties": false + }, "ProviderAuthMethod": { "type": "object", "properties": {