@opencode-ai/server 0.0.0-dev-18428 → 0.0.0-dev-18431
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/handlers/mcp.js +7 -7
- package/dist/routes.js +3 -3
- package/package.json +6 -6
package/dist/handlers/mcp.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mcp } from "@opencode-ai/core/mcp/index";
|
|
2
2
|
import { McpServerNotFoundError } from "@opencode-ai/protocol/errors";
|
|
3
3
|
import { Effect } from "effect";
|
|
4
4
|
import { HttpApiBuilder, HttpApiSchema } from "effect/unstable/httpapi";
|
|
@@ -7,25 +7,25 @@ import { response } from "../location";
|
|
|
7
7
|
const notFound = (effect) => effect.pipe(Effect.mapError((error) => new McpServerNotFoundError({ server: error.server, message: error.message })));
|
|
8
8
|
export const McpHandler = HttpApiBuilder.group(Api, "server.mcp", (handlers) => Effect.gen(function* () {
|
|
9
9
|
return handlers.handle("mcp.list", Effect.fn(function* () {
|
|
10
|
-
const service = yield*
|
|
10
|
+
const service = yield* Mcp.Service;
|
|
11
11
|
return yield* response(service.servers().pipe(Effect.map((servers) => servers.map((info) => ({ name: info.name, status: info.status, integrationID: info.integrationID })))));
|
|
12
12
|
})).handle("mcp.add", Effect.fn(function* (ctx) {
|
|
13
|
-
yield* (yield*
|
|
13
|
+
yield* (yield* Mcp.Service).add(ctx.params.server, ctx.payload.config);
|
|
14
14
|
return HttpApiSchema.NoContent.make();
|
|
15
15
|
})).handle("mcp.remove", Effect.fn(function* (ctx) {
|
|
16
|
-
const service = yield*
|
|
16
|
+
const service = yield* Mcp.Service;
|
|
17
17
|
yield* notFound(service.remove(ctx.params.server));
|
|
18
18
|
return HttpApiSchema.NoContent.make();
|
|
19
19
|
})).handle("mcp.connect", Effect.fn(function* (ctx) {
|
|
20
|
-
const service = yield*
|
|
20
|
+
const service = yield* Mcp.Service;
|
|
21
21
|
yield* notFound(service.connect(ctx.params.server));
|
|
22
22
|
return HttpApiSchema.NoContent.make();
|
|
23
23
|
})).handle("mcp.disconnect", Effect.fn(function* (ctx) {
|
|
24
|
-
const service = yield*
|
|
24
|
+
const service = yield* Mcp.Service;
|
|
25
25
|
yield* notFound(service.disconnect(ctx.params.server));
|
|
26
26
|
return HttpApiSchema.NoContent.make();
|
|
27
27
|
})).handle("mcp.resource.catalog", Effect.fn(function* () {
|
|
28
|
-
const service = yield*
|
|
28
|
+
const service = yield* Mcp.Service;
|
|
29
29
|
return yield* response(service.resourceCatalog());
|
|
30
30
|
}));
|
|
31
31
|
}));
|
package/dist/routes.js
CHANGED
|
@@ -17,7 +17,7 @@ import { Session } from "@opencode-ai/core/session";
|
|
|
17
17
|
import { SessionTransfer } from "@opencode-ai/core/session/transfer";
|
|
18
18
|
import { ShellSelect } from "@opencode-ai/core/shell/select";
|
|
19
19
|
import { Job } from "@opencode-ai/core/job";
|
|
20
|
-
import {
|
|
20
|
+
import { Mcp } from "@opencode-ai/core/mcp/index";
|
|
21
21
|
import { Global } from "@opencode-ai/util/global";
|
|
22
22
|
import { InstructionDiscovery } from "@opencode-ai/core/instruction-discovery";
|
|
23
23
|
import { LocationServiceMap } from "@opencode-ai/core/location-service-map";
|
|
@@ -94,8 +94,8 @@ function makeRoutes(auth, options, serviceURLs, overrides) {
|
|
|
94
94
|
[InstructionDiscovery.node, InstructionDiscovery.configured({ project: options.config?.project })],
|
|
95
95
|
[ShellSelect.node, ShellSelect.configured({ gitbash: options.windows?.gitbash })],
|
|
96
96
|
[
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
Mcp.node,
|
|
98
|
+
Mcp.configured({
|
|
99
99
|
clientInfo: {
|
|
100
100
|
name: options.app?.name ?? "opencode",
|
|
101
101
|
version: options.app?.version ?? "unknown"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode-ai/server",
|
|
4
|
-
"version": "0.0.0-dev-
|
|
4
|
+
"version": "0.0.0-dev-18431",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@effect/platform-node": "4.0.0-rc.111",
|
|
32
32
|
"@effect/platform-node-shared": "4.0.0-rc.111",
|
|
33
|
-
"@opencode-ai/core": "0.0.0-dev-
|
|
34
|
-
"@opencode-ai/protocol": "0.0.0-dev-
|
|
35
|
-
"@opencode-ai/schema": "0.0.0-dev-
|
|
36
|
-
"@opencode-ai/simulation": "0.0.0-dev-
|
|
37
|
-
"@opencode-ai/util": "0.0.0-dev-
|
|
33
|
+
"@opencode-ai/core": "0.0.0-dev-18431",
|
|
34
|
+
"@opencode-ai/protocol": "0.0.0-dev-18431",
|
|
35
|
+
"@opencode-ai/schema": "0.0.0-dev-18431",
|
|
36
|
+
"@opencode-ai/simulation": "0.0.0-dev-18431",
|
|
37
|
+
"@opencode-ai/util": "0.0.0-dev-18431",
|
|
38
38
|
"drizzle-orm": "1.0.0-rc.5-169397b",
|
|
39
39
|
"effect": "4.0.0-rc.111"
|
|
40
40
|
},
|