@opencode-ai/protocol 0.0.0-next-15828 → 0.0.0-next-15832
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/errors.d.ts +6 -0
- package/dist/errors.js +5 -0
- package/dist/groups/mcp.d.ts +34 -2
- package/dist/groups/mcp.js +52 -1
- package/package.json +2 -2
package/dist/errors.d.ts
CHANGED
|
@@ -60,6 +60,12 @@ declare const SkillNotFoundError_base: Schema.Class<SkillNotFoundError, Schema.T
|
|
|
60
60
|
}>, import("effect/Cause").YieldableError>;
|
|
61
61
|
export declare class SkillNotFoundError extends SkillNotFoundError_base {
|
|
62
62
|
}
|
|
63
|
+
declare const McpServerNotFoundError_base: Schema.Class<McpServerNotFoundError, Schema.TaggedStruct<"McpServerNotFoundError", {
|
|
64
|
+
readonly server: Schema.String;
|
|
65
|
+
readonly message: Schema.String;
|
|
66
|
+
}>, import("effect/Cause").YieldableError>;
|
|
67
|
+
export declare class McpServerNotFoundError extends McpServerNotFoundError_base {
|
|
68
|
+
}
|
|
63
69
|
declare const CommandNotFoundError_base: Schema.Class<CommandNotFoundError, Schema.TaggedStruct<"CommandNotFoundError", {
|
|
64
70
|
readonly command: Schema.String;
|
|
65
71
|
readonly message: Schema.String;
|
package/dist/errors.js
CHANGED
|
@@ -49,6 +49,11 @@ export class SkillNotFoundError extends Schema.TaggedErrorClass()("SkillNotFound
|
|
|
49
49
|
message: Schema.String,
|
|
50
50
|
}, { httpApiStatus: 404 }) {
|
|
51
51
|
}
|
|
52
|
+
export class McpServerNotFoundError extends Schema.TaggedErrorClass()("McpServerNotFoundError", {
|
|
53
|
+
server: Schema.String,
|
|
54
|
+
message: Schema.String,
|
|
55
|
+
}, { httpApiStatus: 404 }) {
|
|
56
|
+
}
|
|
52
57
|
export class CommandNotFoundError extends Schema.TaggedErrorClass()("CommandNotFoundError", {
|
|
53
58
|
command: Schema.String,
|
|
54
59
|
message: Schema.String,
|
package/dist/groups/mcp.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { Mcp } from "@opencode-ai/schema/mcp";
|
|
1
2
|
import { Location } from "@opencode-ai/schema/location";
|
|
2
3
|
import { Schema } from "effect";
|
|
3
|
-
import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
|
|
4
|
+
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/unstable/httpapi";
|
|
5
|
+
import { McpServerNotFoundError } from "../errors.js";
|
|
4
6
|
export declare const McpGroup: HttpApiGroup.HttpApiGroup<"server.mcp", HttpApiEndpoint.HttpApiEndpoint<"mcp.list", "GET", "/api/mcp", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
5
7
|
readonly location: Schema.optional<Schema.Struct<{
|
|
6
8
|
readonly directory: Schema.optional<Schema.String>;
|
|
@@ -27,7 +29,37 @@ export declare const McpGroup: HttpApiGroup.HttpApiGroup<"server.mcp", HttpApiEn
|
|
|
27
29
|
}>]>;
|
|
28
30
|
readonly integrationID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Integration.ID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Integration.ID">>, never, never>;
|
|
29
31
|
}>>;
|
|
30
|
-
}>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"mcp.
|
|
32
|
+
}>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"mcp.add", "PUT", "/api/mcp/:server", Schema.toCodecStringTree<Schema.Struct<{
|
|
33
|
+
server: Schema.String;
|
|
34
|
+
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
35
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
36
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
37
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
38
|
+
}>>;
|
|
39
|
+
}>>, Schema.toCodecJson<Schema.Struct<{
|
|
40
|
+
readonly config: Schema.toTaggedUnion<"type", readonly [typeof Mcp.LocalConfig, typeof Mcp.RemoteConfig]>;
|
|
41
|
+
}>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"mcp.remove", "DELETE", "/api/mcp/:server", Schema.toCodecStringTree<Schema.Struct<{
|
|
42
|
+
server: Schema.String;
|
|
43
|
+
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
44
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
45
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
46
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
47
|
+
}>>;
|
|
48
|
+
}>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof McpServerNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"mcp.connect", "POST", "/api/mcp/:server/connect", Schema.toCodecStringTree<Schema.Struct<{
|
|
49
|
+
server: Schema.String;
|
|
50
|
+
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
51
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
52
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
53
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
54
|
+
}>>;
|
|
55
|
+
}>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof McpServerNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"mcp.disconnect", "POST", "/api/mcp/:server/disconnect", Schema.toCodecStringTree<Schema.Struct<{
|
|
56
|
+
server: Schema.String;
|
|
57
|
+
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
58
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
59
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
60
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
61
|
+
}>>;
|
|
62
|
+
}>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof McpServerNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"mcp.resource.catalog", "GET", "/api/mcp/resource", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
31
63
|
readonly location: Schema.optional<Schema.Struct<{
|
|
32
64
|
readonly directory: Schema.optional<Schema.String>;
|
|
33
65
|
readonly workspace: Schema.optional<Schema.String>;
|
package/dist/groups/mcp.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Mcp } from "@opencode-ai/schema/mcp";
|
|
2
2
|
import { Location } from "@opencode-ai/schema/location";
|
|
3
3
|
import { Schema } from "effect";
|
|
4
|
-
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
|
|
4
|
+
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/unstable/httpapi";
|
|
5
|
+
import { McpServerNotFoundError } from "../errors.js";
|
|
5
6
|
import { LocationQuery, locationQueryOpenApi } from "./location.js";
|
|
6
7
|
export const McpGroup = HttpApiGroup.make("server.mcp")
|
|
7
8
|
.add(HttpApiEndpoint.get("mcp.list", "/api/mcp", {
|
|
@@ -13,6 +14,56 @@ export const McpGroup = HttpApiGroup.make("server.mcp")
|
|
|
13
14
|
identifier: "v2.mcp.list",
|
|
14
15
|
summary: "List MCP servers",
|
|
15
16
|
description: "Retrieve configured MCP servers and their connection status.",
|
|
17
|
+
})))
|
|
18
|
+
.add(HttpApiEndpoint.put("mcp.add", "/api/mcp/:server", {
|
|
19
|
+
params: { server: Schema.String },
|
|
20
|
+
query: LocationQuery,
|
|
21
|
+
// Wrapped in a struct because the client codegen flattens payload fields and cannot
|
|
22
|
+
// represent a top-level union payload.
|
|
23
|
+
payload: Schema.Struct({ config: Mcp.ServerConfig }),
|
|
24
|
+
success: HttpApiSchema.NoContent,
|
|
25
|
+
})
|
|
26
|
+
.annotateMerge(locationQueryOpenApi)
|
|
27
|
+
.annotateMerge(OpenApi.annotations({
|
|
28
|
+
identifier: "v2.mcp.add",
|
|
29
|
+
summary: "Add MCP server",
|
|
30
|
+
description: "Add an MCP server at runtime or replace an existing one, connecting it immediately.",
|
|
31
|
+
})))
|
|
32
|
+
.add(HttpApiEndpoint.delete("mcp.remove", "/api/mcp/:server", {
|
|
33
|
+
params: { server: Schema.String },
|
|
34
|
+
query: LocationQuery,
|
|
35
|
+
success: HttpApiSchema.NoContent,
|
|
36
|
+
error: McpServerNotFoundError,
|
|
37
|
+
})
|
|
38
|
+
.annotateMerge(locationQueryOpenApi)
|
|
39
|
+
.annotateMerge(OpenApi.annotations({
|
|
40
|
+
identifier: "v2.mcp.remove",
|
|
41
|
+
summary: "Remove MCP server",
|
|
42
|
+
description: "Stop an MCP server and remove it from the runtime set until restart.",
|
|
43
|
+
})))
|
|
44
|
+
.add(HttpApiEndpoint.post("mcp.connect", "/api/mcp/:server/connect", {
|
|
45
|
+
params: { server: Schema.String },
|
|
46
|
+
query: LocationQuery,
|
|
47
|
+
success: HttpApiSchema.NoContent,
|
|
48
|
+
error: McpServerNotFoundError,
|
|
49
|
+
})
|
|
50
|
+
.annotateMerge(locationQueryOpenApi)
|
|
51
|
+
.annotateMerge(OpenApi.annotations({
|
|
52
|
+
identifier: "v2.mcp.connect",
|
|
53
|
+
summary: "Connect MCP server",
|
|
54
|
+
description: "Connect an MCP server at runtime, overriding a disabled configuration until restart.",
|
|
55
|
+
})))
|
|
56
|
+
.add(HttpApiEndpoint.post("mcp.disconnect", "/api/mcp/:server/disconnect", {
|
|
57
|
+
params: { server: Schema.String },
|
|
58
|
+
query: LocationQuery,
|
|
59
|
+
success: HttpApiSchema.NoContent,
|
|
60
|
+
error: McpServerNotFoundError,
|
|
61
|
+
})
|
|
62
|
+
.annotateMerge(locationQueryOpenApi)
|
|
63
|
+
.annotateMerge(OpenApi.annotations({
|
|
64
|
+
identifier: "v2.mcp.disconnect",
|
|
65
|
+
summary: "Disconnect MCP server",
|
|
66
|
+
description: "Disconnect an MCP server at runtime, removing its tools until reconnected.",
|
|
16
67
|
})))
|
|
17
68
|
.add(HttpApiEndpoint.get("mcp.resource.catalog", "/api/mcp/resource", {
|
|
18
69
|
query: LocationQuery,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode-ai/protocol",
|
|
4
|
-
"version": "0.0.0-next-
|
|
4
|
+
"version": "0.0.0-next-15832",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"typecheck": "tsgo --noEmit"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@opencode-ai/schema": "0.0.0-next-
|
|
29
|
+
"@opencode-ai/schema": "0.0.0-next-15832",
|
|
30
30
|
"effect": "4.0.0-beta.98"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|