mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-23 04:26:05 +00:00
chore: generate
This commit is contained in:
parent
0beb4de3e8
commit
63f3e84792
4 changed files with 79 additions and 20 deletions
|
|
@ -257,7 +257,9 @@ export interface Interface {
|
|||
clientName: string,
|
||||
resourceUri: string,
|
||||
) => Effect.Effect<Awaited<ReturnType<MCPClient["readResource"]>> | undefined>
|
||||
readonly startAuth: (mcpName: string) => Effect.Effect<{ authorizationUrl: string; oauthState: string }, NotFoundError>
|
||||
readonly startAuth: (
|
||||
mcpName: string,
|
||||
) => Effect.Effect<{ authorizationUrl: string; oauthState: string }, NotFoundError>
|
||||
readonly authenticate: (mcpName: string) => Effect.Effect<Status, NotFoundError>
|
||||
readonly finishAuth: (mcpName: string, authorizationCode: string) => Effect.Effect<Status, NotFoundError>
|
||||
readonly removeAuth: (mcpName: string) => Effect.Effect<void>
|
||||
|
|
|
|||
|
|
@ -41,7 +41,9 @@ export const mcpHandlers = HttpApiBuilder.group(InstanceHttpApi, "mcp", (handler
|
|||
.finishAuth(ctx.params.name, ctx.payload.code)
|
||||
.pipe(
|
||||
Effect.catchTag("MCP.NotFoundError", (error) =>
|
||||
Effect.fail(new McpServerNotFoundError({ name: error.name, message: `MCP server not found: ${error.name}` })),
|
||||
Effect.fail(
|
||||
new McpServerNotFoundError({ name: error.name, message: `MCP server not found: ${error.name}` }),
|
||||
),
|
||||
),
|
||||
)
|
||||
})
|
||||
|
|
@ -75,7 +77,9 @@ export const mcpHandlers = HttpApiBuilder.group(InstanceHttpApi, "mcp", (handler
|
|||
.connect(ctx.params.name)
|
||||
.pipe(
|
||||
Effect.catchTag("MCP.NotFoundError", (error) =>
|
||||
Effect.fail(new McpServerNotFoundError({ name: error.name, message: `MCP server not found: ${error.name}` })),
|
||||
Effect.fail(
|
||||
new McpServerNotFoundError({ name: error.name, message: `MCP server not found: ${error.name}` }),
|
||||
),
|
||||
),
|
||||
)
|
||||
return true
|
||||
|
|
@ -86,7 +90,9 @@ export const mcpHandlers = HttpApiBuilder.group(InstanceHttpApi, "mcp", (handler
|
|||
.disconnect(ctx.params.name)
|
||||
.pipe(
|
||||
Effect.catchTag("MCP.NotFoundError", (error) =>
|
||||
Effect.fail(new McpServerNotFoundError({ name: error.name, message: `MCP server not found: ${error.name}` })),
|
||||
Effect.fail(
|
||||
new McpServerNotFoundError({ name: error.name, message: `MCP server not found: ${error.name}` }),
|
||||
),
|
||||
),
|
||||
)
|
||||
return true
|
||||
|
|
|
|||
|
|
@ -1694,6 +1694,12 @@ export type McpUnsupportedOAuthError = {
|
|||
error: string
|
||||
}
|
||||
|
||||
export type McpServerNotFoundError = {
|
||||
_tag: "McpServerNotFoundError"
|
||||
name: string
|
||||
message: string
|
||||
}
|
||||
|
||||
export type NotFoundError = {
|
||||
name: "NotFoundError"
|
||||
data: {
|
||||
|
|
@ -5122,9 +5128,9 @@ export type McpAuthRemoveErrors = {
|
|||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
* McpServerNotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
404: McpServerNotFoundError
|
||||
}
|
||||
|
||||
export type McpAuthRemoveError = McpAuthRemoveErrors[keyof McpAuthRemoveErrors]
|
||||
|
|
@ -5158,9 +5164,9 @@ export type McpAuthStartErrors = {
|
|||
*/
|
||||
400: McpUnsupportedOAuthError | InvalidRequestError
|
||||
/**
|
||||
* Not found
|
||||
* McpServerNotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
404: McpServerNotFoundError
|
||||
}
|
||||
|
||||
export type McpAuthStartError = McpAuthStartErrors[keyof McpAuthStartErrors]
|
||||
|
|
@ -5197,9 +5203,9 @@ export type McpAuthCallbackErrors = {
|
|||
*/
|
||||
400: EffectHttpApiErrorBadRequest | InvalidRequestError
|
||||
/**
|
||||
* Not found
|
||||
* McpServerNotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
404: McpServerNotFoundError
|
||||
}
|
||||
|
||||
export type McpAuthCallbackError = McpAuthCallbackErrors[keyof McpAuthCallbackErrors]
|
||||
|
|
@ -5231,9 +5237,9 @@ export type McpAuthAuthenticateErrors = {
|
|||
*/
|
||||
400: McpUnsupportedOAuthError | InvalidRequestError
|
||||
/**
|
||||
* Not found
|
||||
* McpServerNotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
404: McpServerNotFoundError
|
||||
}
|
||||
|
||||
export type McpAuthAuthenticateError = McpAuthAuthenticateErrors[keyof McpAuthAuthenticateErrors]
|
||||
|
|
@ -5264,6 +5270,10 @@ export type McpConnectErrors = {
|
|||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* McpServerNotFoundError
|
||||
*/
|
||||
404: McpServerNotFoundError
|
||||
}
|
||||
|
||||
export type McpConnectError = McpConnectErrors[keyof McpConnectErrors]
|
||||
|
|
@ -5294,6 +5304,10 @@ export type McpDisconnectErrors = {
|
|||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* McpServerNotFoundError
|
||||
*/
|
||||
404: McpServerNotFoundError
|
||||
}
|
||||
|
||||
export type McpDisconnectError = McpDisconnectErrors[keyof McpDisconnectErrors]
|
||||
|
|
|
|||
|
|
@ -2988,11 +2988,11 @@
|
|||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Not found",
|
||||
"description": "McpServerNotFoundError",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/NotFoundError"
|
||||
"$ref": "#/components/schemas/McpServerNotFoundError"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3067,11 +3067,11 @@
|
|||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Not found",
|
||||
"description": "McpServerNotFoundError",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/NotFoundError"
|
||||
"$ref": "#/components/schemas/McpServerNotFoundError"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3146,11 +3146,11 @@
|
|||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Not found",
|
||||
"description": "McpServerNotFoundError",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/NotFoundError"
|
||||
"$ref": "#/components/schemas/McpServerNotFoundError"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3241,11 +3241,11 @@
|
|||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Not found",
|
||||
"description": "McpServerNotFoundError",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/NotFoundError"
|
||||
"$ref": "#/components/schemas/McpServerNotFoundError"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3312,6 +3312,16 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "McpServerNotFoundError",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/McpServerNotFoundError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Connect an MCP server.",
|
||||
|
|
@ -3374,6 +3384,16 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "McpServerNotFoundError",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/McpServerNotFoundError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Disconnect an MCP server.",
|
||||
|
|
@ -15382,6 +15402,23 @@
|
|||
"required": ["error"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"McpServerNotFoundError": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"_tag": {
|
||||
"type": "string",
|
||||
"enum": ["McpServerNotFoundError"]
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["_tag", "name", "message"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"NotFoundError": {
|
||||
"type": "object",
|
||||
"required": ["name", "data"],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue