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,
|
clientName: string,
|
||||||
resourceUri: string,
|
resourceUri: string,
|
||||||
) => Effect.Effect<Awaited<ReturnType<MCPClient["readResource"]>> | undefined>
|
) => 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 authenticate: (mcpName: string) => Effect.Effect<Status, NotFoundError>
|
||||||
readonly finishAuth: (mcpName: string, authorizationCode: string) => Effect.Effect<Status, NotFoundError>
|
readonly finishAuth: (mcpName: string, authorizationCode: string) => Effect.Effect<Status, NotFoundError>
|
||||||
readonly removeAuth: (mcpName: string) => Effect.Effect<void>
|
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)
|
.finishAuth(ctx.params.name, ctx.payload.code)
|
||||||
.pipe(
|
.pipe(
|
||||||
Effect.catchTag("MCP.NotFoundError", (error) =>
|
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)
|
.connect(ctx.params.name)
|
||||||
.pipe(
|
.pipe(
|
||||||
Effect.catchTag("MCP.NotFoundError", (error) =>
|
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
|
return true
|
||||||
|
|
@ -86,7 +90,9 @@ export const mcpHandlers = HttpApiBuilder.group(InstanceHttpApi, "mcp", (handler
|
||||||
.disconnect(ctx.params.name)
|
.disconnect(ctx.params.name)
|
||||||
.pipe(
|
.pipe(
|
||||||
Effect.catchTag("MCP.NotFoundError", (error) =>
|
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
|
return true
|
||||||
|
|
|
||||||
|
|
@ -1694,6 +1694,12 @@ export type McpUnsupportedOAuthError = {
|
||||||
error: string
|
error: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type McpServerNotFoundError = {
|
||||||
|
_tag: "McpServerNotFoundError"
|
||||||
|
name: string
|
||||||
|
message: string
|
||||||
|
}
|
||||||
|
|
||||||
export type NotFoundError = {
|
export type NotFoundError = {
|
||||||
name: "NotFoundError"
|
name: "NotFoundError"
|
||||||
data: {
|
data: {
|
||||||
|
|
@ -5122,9 +5128,9 @@ export type McpAuthRemoveErrors = {
|
||||||
*/
|
*/
|
||||||
400: BadRequestError
|
400: BadRequestError
|
||||||
/**
|
/**
|
||||||
* Not found
|
* McpServerNotFoundError
|
||||||
*/
|
*/
|
||||||
404: NotFoundError
|
404: McpServerNotFoundError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type McpAuthRemoveError = McpAuthRemoveErrors[keyof McpAuthRemoveErrors]
|
export type McpAuthRemoveError = McpAuthRemoveErrors[keyof McpAuthRemoveErrors]
|
||||||
|
|
@ -5158,9 +5164,9 @@ export type McpAuthStartErrors = {
|
||||||
*/
|
*/
|
||||||
400: McpUnsupportedOAuthError | InvalidRequestError
|
400: McpUnsupportedOAuthError | InvalidRequestError
|
||||||
/**
|
/**
|
||||||
* Not found
|
* McpServerNotFoundError
|
||||||
*/
|
*/
|
||||||
404: NotFoundError
|
404: McpServerNotFoundError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type McpAuthStartError = McpAuthStartErrors[keyof McpAuthStartErrors]
|
export type McpAuthStartError = McpAuthStartErrors[keyof McpAuthStartErrors]
|
||||||
|
|
@ -5197,9 +5203,9 @@ export type McpAuthCallbackErrors = {
|
||||||
*/
|
*/
|
||||||
400: EffectHttpApiErrorBadRequest | InvalidRequestError
|
400: EffectHttpApiErrorBadRequest | InvalidRequestError
|
||||||
/**
|
/**
|
||||||
* Not found
|
* McpServerNotFoundError
|
||||||
*/
|
*/
|
||||||
404: NotFoundError
|
404: McpServerNotFoundError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type McpAuthCallbackError = McpAuthCallbackErrors[keyof McpAuthCallbackErrors]
|
export type McpAuthCallbackError = McpAuthCallbackErrors[keyof McpAuthCallbackErrors]
|
||||||
|
|
@ -5231,9 +5237,9 @@ export type McpAuthAuthenticateErrors = {
|
||||||
*/
|
*/
|
||||||
400: McpUnsupportedOAuthError | InvalidRequestError
|
400: McpUnsupportedOAuthError | InvalidRequestError
|
||||||
/**
|
/**
|
||||||
* Not found
|
* McpServerNotFoundError
|
||||||
*/
|
*/
|
||||||
404: NotFoundError
|
404: McpServerNotFoundError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type McpAuthAuthenticateError = McpAuthAuthenticateErrors[keyof McpAuthAuthenticateErrors]
|
export type McpAuthAuthenticateError = McpAuthAuthenticateErrors[keyof McpAuthAuthenticateErrors]
|
||||||
|
|
@ -5264,6 +5270,10 @@ export type McpConnectErrors = {
|
||||||
* Bad request
|
* Bad request
|
||||||
*/
|
*/
|
||||||
400: BadRequestError
|
400: BadRequestError
|
||||||
|
/**
|
||||||
|
* McpServerNotFoundError
|
||||||
|
*/
|
||||||
|
404: McpServerNotFoundError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type McpConnectError = McpConnectErrors[keyof McpConnectErrors]
|
export type McpConnectError = McpConnectErrors[keyof McpConnectErrors]
|
||||||
|
|
@ -5294,6 +5304,10 @@ export type McpDisconnectErrors = {
|
||||||
* Bad request
|
* Bad request
|
||||||
*/
|
*/
|
||||||
400: BadRequestError
|
400: BadRequestError
|
||||||
|
/**
|
||||||
|
* McpServerNotFoundError
|
||||||
|
*/
|
||||||
|
404: McpServerNotFoundError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type McpDisconnectError = McpDisconnectErrors[keyof McpDisconnectErrors]
|
export type McpDisconnectError = McpDisconnectErrors[keyof McpDisconnectErrors]
|
||||||
|
|
|
||||||
|
|
@ -2988,11 +2988,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"description": "Not found",
|
"description": "McpServerNotFoundError",
|
||||||
"content": {
|
"content": {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/components/schemas/NotFoundError"
|
"$ref": "#/components/schemas/McpServerNotFoundError"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3067,11 +3067,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"description": "Not found",
|
"description": "McpServerNotFoundError",
|
||||||
"content": {
|
"content": {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/components/schemas/NotFoundError"
|
"$ref": "#/components/schemas/McpServerNotFoundError"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3146,11 +3146,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"description": "Not found",
|
"description": "McpServerNotFoundError",
|
||||||
"content": {
|
"content": {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/components/schemas/NotFoundError"
|
"$ref": "#/components/schemas/McpServerNotFoundError"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3241,11 +3241,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"description": "Not found",
|
"description": "McpServerNotFoundError",
|
||||||
"content": {
|
"content": {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
"schema": {
|
"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.",
|
"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.",
|
"description": "Disconnect an MCP server.",
|
||||||
|
|
@ -15382,6 +15402,23 @@
|
||||||
"required": ["error"],
|
"required": ["error"],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
|
"McpServerNotFoundError": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"_tag": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["McpServerNotFoundError"]
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"message": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["_tag", "name", "message"],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
"NotFoundError": {
|
"NotFoundError": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": ["name", "data"],
|
"required": ["name", "data"],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue