mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-19 16:54:22 +01:00
rework acp to compensate for changes in Zed IDE (#4050)
This commit is contained in:
@@ -106,6 +106,9 @@ import type {
|
||||
AppAgentsResponses,
|
||||
McpStatusData,
|
||||
McpStatusResponses,
|
||||
McpAddData,
|
||||
McpAddResponses,
|
||||
McpAddErrors,
|
||||
LspStatusData,
|
||||
LspStatusResponses,
|
||||
FormatterStatusData,
|
||||
@@ -764,6 +767,20 @@ class Mcp extends _HeyApiClient {
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Add MCP server dynamically
|
||||
*/
|
||||
public add<ThrowOnError extends boolean = false>(options?: Options<McpAddData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).post<McpAddResponses, McpAddErrors, ThrowOnError>({
|
||||
url: "/mcp",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
class Lsp extends _HeyApiClient {
|
||||
|
||||
@@ -1979,9 +1979,9 @@ export type SessionMessagesData = {
|
||||
*/
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
query: {
|
||||
directory?: string
|
||||
limit?: number
|
||||
limit: number
|
||||
}
|
||||
url: "/session/{id}/message"
|
||||
}
|
||||
@@ -2552,6 +2552,38 @@ export type McpStatusResponses = {
|
||||
|
||||
export type McpStatusResponse = McpStatusResponses[keyof McpStatusResponses]
|
||||
|
||||
export type McpAddData = {
|
||||
body?: {
|
||||
name: string
|
||||
config: McpLocalConfig | McpRemoteConfig
|
||||
}
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/mcp"
|
||||
}
|
||||
|
||||
export type McpAddErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type McpAddError = McpAddErrors[keyof McpAddErrors]
|
||||
|
||||
export type McpAddResponses = {
|
||||
/**
|
||||
* MCP server added successfully
|
||||
*/
|
||||
200: {
|
||||
[key: string]: McpStatus
|
||||
}
|
||||
}
|
||||
|
||||
export type McpAddResponse = McpAddResponses[keyof McpAddResponses]
|
||||
|
||||
export type LspStatusData = {
|
||||
body?: never
|
||||
path?: never
|
||||
|
||||
Reference in New Issue
Block a user