@opencode/client 2.1.3 → 2.1.4
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/chunks/{service-probe-9j12j8xw.js → contract-15p82y03.js} +5 -5
- package/dist/chunks/{service-probe-61wt4y9h.js → contract-1x65x4hv.js} +15 -20
- package/dist/chunks/{service-probe-8ye1ye6f.js → contract-2ny4vxct.js} +2 -2
- package/dist/chunks/{service-probe-8bbb028w.js → contract-8bbb028w.js} +1 -1
- package/dist/chunks/{service-probe-v1n69e13.js → contract-9kmsh4jj.js} +8 -2
- package/dist/chunks/{service-probe-ezt8t3fk.js → contract-c46qzyff.js} +2 -2
- package/dist/chunks/{service-probe-xwk4fryp.js → contract-hg9t2gnm.js} +9 -9
- package/dist/chunks/{service-probe-ryy6kscr.js → contract-ryy6kscr.js} +1 -1
- package/dist/chunks/{service-probe-g22sa7qz.js → contract-s2hya144.js} +21 -2
- package/dist/chunks/{service-probe-6vp15eh6.js → contract-skhp7hxc.js} +1 -1
- package/dist/chunks/{service-probe-9p0yrv34.js → contract-vwtmm97t.js} +4 -4
- package/dist/chunks/{service-probe-5r97ebd4.js → contract-w10x3kfx.js} +14 -7
- package/dist/contract.js +1 -1
- package/dist/effect/api/api.d.ts +32 -1
- package/dist/effect/client.d.ts +789 -785
- package/dist/effect/client.js +8 -8
- package/dist/effect/generated/client-error.js +1 -1
- package/dist/effect/generated/client.d.ts +489 -485
- package/dist/effect/generated/client.js +5 -5
- package/dist/effect/generated/index.js +4 -4
- package/dist/effect/index.js +8 -8
- package/dist/effect/rpc.js +4 -4
- package/dist/effect/service.d.ts +1 -1
- package/dist/effect/service.js +11 -11
- package/dist/mcp.d.ts +44 -0
- package/dist/mcp.js +110 -0
- package/dist/promise/client.d.ts +4 -0
- package/dist/promise/client.js +7 -7
- package/dist/promise/generated/client-error.js +1 -1
- package/dist/promise/generated/client.d.ts +5 -1
- package/dist/promise/generated/client.js +2 -2
- package/dist/promise/generated/index.js +5 -5
- package/dist/promise/generated/types.d.ts +47 -9
- package/dist/promise/generated/types.js +2 -2
- package/dist/promise/index.js +9 -9
- package/dist/promise/rpc.js +2 -2
- package/dist/promise/service.js +11 -11
- package/dist/pty-handoff.js +4 -1
- package/dist/rpc-runtime.js +1 -1
- package/dist/service-contender.js +1 -1
- package/dist/service-probe.js +3 -3
- package/dist/service-timing.js +1 -1
- package/dist/service-version.js +1 -1
- package/dist/service.js +1 -1
- package/dist/shared-events.js +1 -1
- package/dist/solid/connection.js +1 -1
- package/dist/solid/data.js +9 -9
- package/dist/solid/index.js +12 -12
- package/dist/solid/pty.js +1 -1
- package/dist/solid/usage.js +1 -1
- package/package.json +12 -6
- /package/dist/chunks/{service-probe-6mptkzbc.js → contract-6mptkzbc.js} +0 -0
- /package/dist/chunks/{service-probe-8s2anffy.js → contract-8s2anffy.js} +0 -0
- /package/dist/chunks/{service-probe-9rqn6x4v.js → contract-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{service-probe-gne7h7mq.js → contract-gne7h7mq.js} +0 -0
- /package/dist/chunks/{service-probe-m2eywc8w.js → contract-m2eywc8w.js} +0 -0
- /package/dist/chunks/{service-probe-nwcpakzx.js → contract-nwcpakzx.js} +0 -0
- /package/dist/chunks/{service-probe-qav6mfdz.js → contract-qav6mfdz.js} +0 -0
- /package/dist/chunks/{service-probe-sxt88q69.js → contract-sxt88q69.js} +0 -0
- /package/dist/chunks/{service-probe-ve4aws36.js → contract-ve4aws36.js} +0 -0
- /package/dist/chunks/{service-probe-vmytr4q8.js → contract-vmytr4q8.js} +0 -0
- /package/dist/chunks/{service-probe-vyas3vgt.js → contract-vyas3vgt.js} +0 -0
- /package/dist/chunks/{service-probe-xgnj2w4v.js → contract-xgnj2w4v.js} +0 -0
- /package/dist/chunks/{service-probe-y2etg5bs.js → contract-y2etg5bs.js} +0 -0
- /package/dist/chunks/{service-probe-ydhz1zrh.js → contract-ydhz1zrh.js} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../../chunks/
|
|
4
|
-
import"../../chunks/
|
|
5
|
-
import"../../chunks/
|
|
2
|
+
make4
|
|
3
|
+
} from "../../chunks/contract-w10x3kfx.js";
|
|
4
|
+
import"../../chunks/contract-y2etg5bs.js";
|
|
5
|
+
import"../../chunks/contract-vmytr4q8.js";
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
make4 as make
|
|
8
8
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import"../../chunks/
|
|
1
|
+
import"../../chunks/contract-6mptkzbc.js";
|
|
2
2
|
import {
|
|
3
3
|
exports_client2
|
|
4
|
-
} from "../../chunks/
|
|
4
|
+
} from "../../chunks/contract-w10x3kfx.js";
|
|
5
5
|
import {
|
|
6
6
|
ClientError2
|
|
7
|
-
} from "../../chunks/
|
|
8
|
-
import"../../chunks/
|
|
7
|
+
} from "../../chunks/contract-y2etg5bs.js";
|
|
8
|
+
import"../../chunks/contract-vmytr4q8.js";
|
|
9
9
|
export {
|
|
10
10
|
ClientError2 as ClientError,
|
|
11
11
|
exports_client2 as OpenCode
|
package/dist/effect/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ClientError2
|
|
3
|
-
} from "../chunks/
|
|
4
|
-
import"../chunks/
|
|
5
|
-
import"../chunks/
|
|
6
|
-
import"../chunks/
|
|
7
|
-
import"../chunks/
|
|
8
|
-
import"../chunks/
|
|
9
|
-
import"../chunks/
|
|
3
|
+
} from "../chunks/contract-y2etg5bs.js";
|
|
4
|
+
import"../chunks/contract-vmytr4q8.js";
|
|
5
|
+
import"../chunks/contract-w10x3kfx.js";
|
|
6
|
+
import"../chunks/contract-6mptkzbc.js";
|
|
7
|
+
import"../chunks/contract-8bbb028w.js";
|
|
8
|
+
import"../chunks/contract-ryy6kscr.js";
|
|
9
|
+
import"../chunks/contract-15p82y03.js";
|
|
10
10
|
import {
|
|
11
11
|
exports_client
|
|
12
|
-
} from "../chunks/
|
|
12
|
+
} from "../chunks/contract-hg9t2gnm.js";
|
|
13
13
|
|
|
14
14
|
// src/effect/index.ts
|
|
15
15
|
import { Agent } from "@opencode/schema/agent";
|
package/dist/effect/rpc.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
make3,
|
|
3
3
|
aborted2,
|
|
4
4
|
exports_rpc
|
|
5
|
-
} from "../chunks/
|
|
6
|
-
import"../chunks/
|
|
5
|
+
} from "../chunks/contract-15p82y03.js";
|
|
6
|
+
import"../chunks/contract-ryy6kscr.js";
|
|
7
7
|
export {
|
|
8
8
|
exports_rpc as RpcClientRuntime,
|
|
9
9
|
aborted2 as aborted,
|
|
10
|
-
|
|
10
|
+
make3 as make
|
|
11
11
|
};
|
package/dist/effect/service.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { headers } from "../service-probe.js";
|
|
|
4
4
|
export * from "../service.js";
|
|
5
5
|
export { headers };
|
|
6
6
|
/** Contents of the local service registration file. */
|
|
7
|
-
export type Info =
|
|
7
|
+
export type Info = typeof Info.Type;
|
|
8
8
|
/** Discover a healthy, compatible local service without starting one. */
|
|
9
9
|
export declare const discover: (options?: DiscoverOptions | undefined) => Effect.Effect<{
|
|
10
10
|
url: string;
|
package/dist/effect/service.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
spawnServiceContender2,
|
|
3
3
|
contenderPool2
|
|
4
|
-
} from "../chunks/
|
|
4
|
+
} from "../chunks/contract-ve4aws36.js";
|
|
5
5
|
import {
|
|
6
6
|
defaultEnsureTiming2,
|
|
7
7
|
ensureTiming2
|
|
8
|
-
} from "../chunks/
|
|
8
|
+
} from "../chunks/contract-xgnj2w4v.js";
|
|
9
9
|
import {
|
|
10
10
|
matchesVersion2
|
|
11
|
-
} from "../chunks/
|
|
12
|
-
import {
|
|
13
|
-
prepare2,
|
|
14
|
-
environment2,
|
|
15
|
-
complete2,
|
|
16
|
-
clear2
|
|
17
|
-
} from "../chunks/service-probe-v1n69e13.js";
|
|
11
|
+
} from "../chunks/contract-sxt88q69.js";
|
|
18
12
|
import {
|
|
19
13
|
decide2,
|
|
20
14
|
fallback2,
|
|
21
15
|
same2,
|
|
22
16
|
probeResult2,
|
|
23
17
|
headers2
|
|
24
|
-
} from "../chunks/
|
|
25
|
-
import
|
|
18
|
+
} from "../chunks/contract-2ny4vxct.js";
|
|
19
|
+
import {
|
|
20
|
+
prepare2,
|
|
21
|
+
environment2,
|
|
22
|
+
complete2,
|
|
23
|
+
clear2
|
|
24
|
+
} from "../chunks/contract-9kmsh4jj.js";
|
|
25
|
+
import"../chunks/contract-qav6mfdz.js";
|
|
26
26
|
|
|
27
27
|
// src/effect/service.ts
|
|
28
28
|
import { Effect, FileSystem, Option, Schedule, Schema } from "effect";
|
package/dist/mcp.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export type ClientMcpOptions = {
|
|
2
|
+
/** Base URL of the opencode server, for example `http://127.0.0.1:4096`. Its query params are kept. */
|
|
3
|
+
readonly url: string;
|
|
4
|
+
/** Client name, `[a-zA-Z0-9_-]+`. Tools are exposed to the model as `<name>_<tool>`. */
|
|
5
|
+
readonly name: string;
|
|
6
|
+
/** Sent as `location[directory]`. */
|
|
7
|
+
readonly directory?: string;
|
|
8
|
+
/** Handshake headers, such as `authorization`. Browsers cannot send them; use a ticket in `url` instead. */
|
|
9
|
+
readonly headers?: Record<string, string>;
|
|
10
|
+
readonly tools: ReadonlyArray<ClientMcpTool>;
|
|
11
|
+
readonly WebSocket?: typeof WebSocket;
|
|
12
|
+
};
|
|
13
|
+
export type ClientMcpTool = {
|
|
14
|
+
/** `[a-zA-Z0-9_-]+` */
|
|
15
|
+
readonly name: string;
|
|
16
|
+
readonly description?: string;
|
|
17
|
+
/** JSON Schema for the arguments; `type: "object"` is always set. Arguments are not validated here. */
|
|
18
|
+
readonly inputSchema?: Record<string, unknown>;
|
|
19
|
+
readonly handler: (args: Record<string, unknown>, ctx: ClientMcpToolContext) => ClientMcpToolResult | Promise<ClientMcpToolResult>;
|
|
20
|
+
};
|
|
21
|
+
export type ClientMcpToolContext = {
|
|
22
|
+
/** The opencode session that issued the call. */
|
|
23
|
+
readonly sessionID?: string;
|
|
24
|
+
};
|
|
25
|
+
export type ClientMcpToolResult = {
|
|
26
|
+
readonly content: ReadonlyArray<{
|
|
27
|
+
readonly type: "text";
|
|
28
|
+
readonly text: string;
|
|
29
|
+
} | {
|
|
30
|
+
readonly type: "image";
|
|
31
|
+
readonly data: string;
|
|
32
|
+
readonly mimeType: string;
|
|
33
|
+
}>;
|
|
34
|
+
readonly isError?: boolean;
|
|
35
|
+
};
|
|
36
|
+
export type ClientMcpConnection = {
|
|
37
|
+
close(): Promise<void>;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Exposes tools to the opencode server: opens a WebSocket to `/api/experimental/client-mcp` and answers MCP
|
|
41
|
+
* JSON-RPC over it (one message per text frame), so the opencode server is the MCP client. Reconnects with
|
|
42
|
+
* backoff until `close()`.
|
|
43
|
+
*/
|
|
44
|
+
export declare function connectClientMcp(options: ClientMcpOptions): ClientMcpConnection;
|
package/dist/mcp.js
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// src/mcp.ts
|
|
2
|
+
var SESSION_ID_META_KEY = "ai.opencode/sessionID";
|
|
3
|
+
var PROTOCOL_VERSION = "2025-11-25";
|
|
4
|
+
var RECONNECT_MIN = 500;
|
|
5
|
+
var RECONNECT_MAX = 1e4;
|
|
6
|
+
function connectClientMcp(options) {
|
|
7
|
+
const state = {
|
|
8
|
+
disposed: false,
|
|
9
|
+
delay: RECONNECT_MIN
|
|
10
|
+
};
|
|
11
|
+
const connect = () => {
|
|
12
|
+
if (state.disposed)
|
|
13
|
+
return;
|
|
14
|
+
const Socket = options.WebSocket ?? WebSocket;
|
|
15
|
+
const socket = options.headers ? new Socket(endpoint(options), { headers: options.headers }) : new Socket(endpoint(options));
|
|
16
|
+
state.socket = socket;
|
|
17
|
+
socket.addEventListener("message", (event) => {
|
|
18
|
+
if (state.disposed || typeof event.data !== "string")
|
|
19
|
+
return;
|
|
20
|
+
const message = parse(event.data);
|
|
21
|
+
if (!message)
|
|
22
|
+
return;
|
|
23
|
+
if (message.method === "notifications/initialized")
|
|
24
|
+
state.delay = RECONNECT_MIN;
|
|
25
|
+
if (typeof message.id !== "string" && typeof message.id !== "number" || typeof message.method !== "string")
|
|
26
|
+
return;
|
|
27
|
+
respond(options, message.method, message.params).then((reply) => send(socket, { jsonrpc: "2.0", id: message.id, ...reply }));
|
|
28
|
+
});
|
|
29
|
+
socket.addEventListener("close", () => {
|
|
30
|
+
if (state.socket === socket)
|
|
31
|
+
state.socket = undefined;
|
|
32
|
+
if (state.disposed)
|
|
33
|
+
return;
|
|
34
|
+
state.timer = setTimeout(connect, state.delay);
|
|
35
|
+
state.delay = Math.min(state.delay * 2, RECONNECT_MAX);
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
connect();
|
|
39
|
+
return {
|
|
40
|
+
async close() {
|
|
41
|
+
state.disposed = true;
|
|
42
|
+
clearTimeout(state.timer);
|
|
43
|
+
state.socket?.close(1000);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
async function respond(options, method, params) {
|
|
48
|
+
switch (method) {
|
|
49
|
+
case "initialize":
|
|
50
|
+
return {
|
|
51
|
+
result: {
|
|
52
|
+
protocolVersion: typeof params?.protocolVersion === "string" ? params.protocolVersion : PROTOCOL_VERSION,
|
|
53
|
+
capabilities: { tools: {} },
|
|
54
|
+
serverInfo: { name: options.name, version: "1.0.0" }
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
case "ping":
|
|
58
|
+
return { result: {} };
|
|
59
|
+
case "tools/list":
|
|
60
|
+
return {
|
|
61
|
+
result: {
|
|
62
|
+
tools: options.tools.map((tool) => ({
|
|
63
|
+
name: tool.name,
|
|
64
|
+
description: tool.description,
|
|
65
|
+
inputSchema: { type: "object", ...tool.inputSchema }
|
|
66
|
+
}))
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
case "tools/call": {
|
|
70
|
+
const tool = options.tools.find((tool) => tool.name === params?.name);
|
|
71
|
+
if (!tool)
|
|
72
|
+
return { error: { code: -32602, message: `Unknown tool: ${String(params?.name)}` } };
|
|
73
|
+
const meta = params?._meta?.[SESSION_ID_META_KEY];
|
|
74
|
+
return Promise.resolve().then(() => tool.handler(params?.arguments ?? {}, { sessionID: typeof meta === "string" ? meta : undefined })).then((result) => ({ result }), (error) => ({
|
|
75
|
+
result: {
|
|
76
|
+
content: [{ type: "text", text: error instanceof Error ? error.message : String(error) }],
|
|
77
|
+
isError: true
|
|
78
|
+
}
|
|
79
|
+
}));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return { error: { code: -32601, message: `Method not found: ${method}` } };
|
|
83
|
+
}
|
|
84
|
+
function send(socket, message) {
|
|
85
|
+
if (socket.readyState === socket.OPEN)
|
|
86
|
+
socket.send(JSON.stringify(message));
|
|
87
|
+
}
|
|
88
|
+
function parse(text) {
|
|
89
|
+
try {
|
|
90
|
+
const value = JSON.parse(text);
|
|
91
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : undefined;
|
|
92
|
+
} catch {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function endpoint(options) {
|
|
97
|
+
const base = new URL(options.url);
|
|
98
|
+
if (!base.pathname.endsWith("/"))
|
|
99
|
+
base.pathname += "/";
|
|
100
|
+
const url = new URL("api/experimental/client-mcp", base);
|
|
101
|
+
url.search = base.search;
|
|
102
|
+
if (options.directory)
|
|
103
|
+
url.searchParams.set("location[directory]", options.directory);
|
|
104
|
+
url.searchParams.set("name", options.name);
|
|
105
|
+
url.protocol = url.protocol === "https:" || url.protocol === "wss:" ? "wss:" : "ws:";
|
|
106
|
+
return url;
|
|
107
|
+
}
|
|
108
|
+
export {
|
|
109
|
+
connectClientMcp
|
|
110
|
+
};
|
package/dist/promise/client.d.ts
CHANGED
|
@@ -143,6 +143,9 @@ export declare function make(options: ClientOptions): {
|
|
|
143
143
|
resource: {
|
|
144
144
|
catalog: (input?: import("./index.js").McpResourceCatalogInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").McpResourceCatalogOutput>;
|
|
145
145
|
};
|
|
146
|
+
client: {
|
|
147
|
+
token: (input: import("./index.js").McpClientTokenInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").McpClientTokenOutput>;
|
|
148
|
+
};
|
|
146
149
|
};
|
|
147
150
|
credential: {
|
|
148
151
|
list: (requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").CredentialEntry[]>;
|
|
@@ -238,6 +241,7 @@ export declare function make(options: ClientOptions): {
|
|
|
238
241
|
diff: (input: import("./index.js").VcsDiffInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").VcsDiffOutput>;
|
|
239
242
|
};
|
|
240
243
|
debug: {
|
|
244
|
+
heapDump: (input?: import("./index.js").DebugHeapDumpInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").DebugHeapDumpOutput>;
|
|
241
245
|
location: {
|
|
242
246
|
list: (requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").DebugLocationListOutput>;
|
|
243
247
|
evict: (input?: import("./index.js").DebugLocationEvictInput, requestOptions?: OpenCode.RequestOptions) => Promise<void>;
|
package/dist/promise/client.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
make5,
|
|
3
3
|
exports_client3
|
|
4
|
-
} from "../chunks/
|
|
5
|
-
import"../chunks/
|
|
6
|
-
import"../chunks/
|
|
7
|
-
import"../chunks/
|
|
8
|
-
import"../chunks/
|
|
9
|
-
import"../chunks/
|
|
10
|
-
import"../chunks/
|
|
4
|
+
} from "../chunks/contract-vwtmm97t.js";
|
|
5
|
+
import"../chunks/contract-vyas3vgt.js";
|
|
6
|
+
import"../chunks/contract-s2hya144.js";
|
|
7
|
+
import"../chunks/contract-nwcpakzx.js";
|
|
8
|
+
import"../chunks/contract-skhp7hxc.js";
|
|
9
|
+
import"../chunks/contract-c46qzyff.js";
|
|
10
|
+
import"../chunks/contract-8bbb028w.js";
|
|
11
11
|
export {
|
|
12
12
|
exports_client3 as OpenCode,
|
|
13
13
|
make5 as make
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ServerConnectInput, LocationGetInput, AgentListInput, AgentListOutput, AgentGetInput, AgentGetOutput, PluginListInput, PluginListOutput, PluginCheckInput, PluginCheckOutput, PluginUpdateInput, SessionListInput, SessionStatsInput, SessionCreateInput, SessionImportInput, SessionExportInput, SessionGetInput, SessionRemoveInput, SessionForkInput, SessionSwitchAgentInput, SessionSwitchModelInput, SessionUpdateInput, SessionMoveInput, SessionPromptInput, SessionCommandInput, SessionSkillInput, SessionSyntheticInput, SessionShellInput, SessionCompactInput, SessionWaitInput, SessionRevertStageInput, SessionRevertClearInput, SessionRevertCommitInput, SessionContextInput, SessionDiffInput, SessionInboxListInput, SessionInboxCancelInput, SessionInboxUpdateInput, SessionInstructionsEntryListInput, SessionInstructionsEntryPutInput, SessionInstructionsEntryRemoveInput, SessionGenerateInput, SessionLogInput, SessionLogOutput, SessionInterruptInput, SessionBackgroundInput, SessionMessageGetInput, SessionFormListInput, SessionFormCreateInput, SessionFormGetInput, SessionFormReplyInput, SessionFormCancelInput, SessionEnvironmentInput, SessionViewInput, MessageListInput, ModelListInput, ModelListOutput, ModelDefaultInput, ModelDefaultOutput, GenerateTextInput, VoiceSessionInput, VoiceInstructionsInput, ProviderListInput, ProviderListOutput, ProviderGetInput, ProviderGetOutput, IntegrationListInput, IntegrationListOutput, IntegrationGetInput, IntegrationGetOutput, IntegrationWellknownAddInput, IntegrationConnectKeyInput, IntegrationConnectExternalInput, IntegrationOauthConnectInput, IntegrationOauthConnectOutput, IntegrationOauthStatusInput, IntegrationOauthStatusOutput, IntegrationOauthCompleteInput, IntegrationOauthCancelInput, IntegrationCommandConnectInput, IntegrationCommandConnectOutput, IntegrationCommandStatusInput, IntegrationCommandStatusOutput, IntegrationCommandCancelInput, McpListInput, McpListOutput, McpAddInput, McpRemoveInput, McpConnectInput, McpDisconnectInput, McpResourceCatalogInput, McpResourceCatalogOutput, CredentialCreateInput, CredentialUpdateInput, CredentialActivateInput, CredentialRemoveInput, ProjectListInput, ProjectListOutput, ProjectUpdateInput, FormListInput, FormListOutput, PermissionRequestListInput, PermissionRequestListOutput, PermissionSavedListInput, PermissionSavedUpdateInput, PermissionSavedRemoveInput, PermissionCreateInput, PermissionListInput, PermissionGetInput, PermissionReplyInput, FileReadInput, FileReadOutput, FileListInput, FileListOutput, FileFindInput, FileFindOutput, FileWriteInput, FileWriteOutput, CommandListInput, CommandListOutput, SkillListInput, SkillListOutput, RpcCallInput, EventSubscribeOutput, PtyListInput, PtyListOutput, PtyCreateInput, PtyCreateOutput, PtyGetInput, PtyGetOutput, PtyUpdateInput, PtyUpdateOutput, PtyRemoveInput, PtyConnectTokenInput, PtyConnectTokenOutput, ExperimentalPersistentPtyReadInput, ExperimentalPersistentPtyListInput, ExperimentalPersistentPtyCreateInput, ExperimentalPersistentPtyHandoffOutput, ExperimentalPersistentPtyGetInput, ExperimentalPersistentPtyUpdateInput, ExperimentalPersistentPtySnapshotInput, ExperimentalPersistentPtyRemoveInput, ExperimentalPersistentPtyConnectTokenInput, ShellListInput, ShellListOutput, ShellCreateInput, ShellCreateOutput, ShellGetInput, ShellGetOutput, ShellOutputInput, ShellOutputOutput, ShellRemoveInput, ReferenceListInput, ReferenceListOutput, WorktreeListInput, WorktreeCreateInput, WorktreeRemoveInput, WorktreeRefreshInput, VcsInitInput, VcsGetInput, VcsGetOutput, VcsBaseInput, VcsBaseOutput, VcsStatusInput, VcsStatusOutput, VcsBranchListInput, VcsBranchListOutput, VcsDiffInput, VcsDiffOutput, DebugLocationListOutput, DebugLocationEvictInput, MigrationV1StatusOutput, WebsearchProvidersInput, WebsearchProvidersOutput, WebsearchQueryInput, WebsearchQueryOutput, ConfigGetInput, ConfigGetOutput, ConfigShellsOutput, ConfigUpdateInput } from "./types.js";
|
|
1
|
+
import type { ServerConnectInput, LocationGetInput, AgentListInput, AgentListOutput, AgentGetInput, AgentGetOutput, PluginListInput, PluginListOutput, PluginCheckInput, PluginCheckOutput, PluginUpdateInput, SessionListInput, SessionStatsInput, SessionCreateInput, SessionImportInput, SessionExportInput, SessionGetInput, SessionRemoveInput, SessionForkInput, SessionSwitchAgentInput, SessionSwitchModelInput, SessionUpdateInput, SessionMoveInput, SessionPromptInput, SessionCommandInput, SessionSkillInput, SessionSyntheticInput, SessionShellInput, SessionCompactInput, SessionWaitInput, SessionRevertStageInput, SessionRevertClearInput, SessionRevertCommitInput, SessionContextInput, SessionDiffInput, SessionInboxListInput, SessionInboxCancelInput, SessionInboxUpdateInput, SessionInstructionsEntryListInput, SessionInstructionsEntryPutInput, SessionInstructionsEntryRemoveInput, SessionGenerateInput, SessionLogInput, SessionLogOutput, SessionInterruptInput, SessionBackgroundInput, SessionMessageGetInput, SessionFormListInput, SessionFormCreateInput, SessionFormGetInput, SessionFormReplyInput, SessionFormCancelInput, SessionEnvironmentInput, SessionViewInput, MessageListInput, ModelListInput, ModelListOutput, ModelDefaultInput, ModelDefaultOutput, GenerateTextInput, VoiceSessionInput, VoiceInstructionsInput, ProviderListInput, ProviderListOutput, ProviderGetInput, ProviderGetOutput, IntegrationListInput, IntegrationListOutput, IntegrationGetInput, IntegrationGetOutput, IntegrationWellknownAddInput, IntegrationConnectKeyInput, IntegrationConnectExternalInput, IntegrationOauthConnectInput, IntegrationOauthConnectOutput, IntegrationOauthStatusInput, IntegrationOauthStatusOutput, IntegrationOauthCompleteInput, IntegrationOauthCancelInput, IntegrationCommandConnectInput, IntegrationCommandConnectOutput, IntegrationCommandStatusInput, IntegrationCommandStatusOutput, IntegrationCommandCancelInput, McpListInput, McpListOutput, McpAddInput, McpRemoveInput, McpConnectInput, McpDisconnectInput, McpResourceCatalogInput, McpResourceCatalogOutput, McpClientTokenInput, McpClientTokenOutput, CredentialCreateInput, CredentialUpdateInput, CredentialActivateInput, CredentialRemoveInput, ProjectListInput, ProjectListOutput, ProjectUpdateInput, FormListInput, FormListOutput, PermissionRequestListInput, PermissionRequestListOutput, PermissionSavedListInput, PermissionSavedUpdateInput, PermissionSavedRemoveInput, PermissionCreateInput, PermissionListInput, PermissionGetInput, PermissionReplyInput, FileReadInput, FileReadOutput, FileListInput, FileListOutput, FileFindInput, FileFindOutput, FileWriteInput, FileWriteOutput, CommandListInput, CommandListOutput, SkillListInput, SkillListOutput, RpcCallInput, EventSubscribeOutput, PtyListInput, PtyListOutput, PtyCreateInput, PtyCreateOutput, PtyGetInput, PtyGetOutput, PtyUpdateInput, PtyUpdateOutput, PtyRemoveInput, PtyConnectTokenInput, PtyConnectTokenOutput, ExperimentalPersistentPtyReadInput, ExperimentalPersistentPtyListInput, ExperimentalPersistentPtyCreateInput, ExperimentalPersistentPtyHandoffOutput, ExperimentalPersistentPtyGetInput, ExperimentalPersistentPtyUpdateInput, ExperimentalPersistentPtySnapshotInput, ExperimentalPersistentPtyRemoveInput, ExperimentalPersistentPtyConnectTokenInput, ShellListInput, ShellListOutput, ShellCreateInput, ShellCreateOutput, ShellGetInput, ShellGetOutput, ShellOutputInput, ShellOutputOutput, ShellRemoveInput, ReferenceListInput, ReferenceListOutput, WorktreeListInput, WorktreeCreateInput, WorktreeRemoveInput, WorktreeRefreshInput, VcsInitInput, VcsGetInput, VcsGetOutput, VcsBaseInput, VcsBaseOutput, VcsStatusInput, VcsStatusOutput, VcsBranchListInput, VcsBranchListOutput, VcsDiffInput, VcsDiffOutput, DebugHeapDumpInput, DebugHeapDumpOutput, DebugLocationListOutput, DebugLocationEvictInput, MigrationV1StatusOutput, WebsearchProvidersInput, WebsearchProvidersOutput, WebsearchQueryInput, WebsearchQueryOutput, ConfigGetInput, ConfigGetOutput, ConfigShellsOutput, ConfigUpdateInput } from "./types.js";
|
|
2
2
|
export interface ClientOptions {
|
|
3
3
|
readonly baseUrl: string;
|
|
4
4
|
readonly fetch?: typeof globalThis.fetch;
|
|
@@ -150,6 +150,9 @@ export declare function make(options: ClientOptions): {
|
|
|
150
150
|
resource: {
|
|
151
151
|
catalog: (input?: McpResourceCatalogInput, requestOptions?: RequestOptions) => Promise<McpResourceCatalogOutput>;
|
|
152
152
|
};
|
|
153
|
+
client: {
|
|
154
|
+
token: (input: McpClientTokenInput, requestOptions?: RequestOptions) => Promise<McpClientTokenOutput>;
|
|
155
|
+
};
|
|
153
156
|
};
|
|
154
157
|
credential: {
|
|
155
158
|
list: (requestOptions?: RequestOptions) => Promise<import("./types.js").CredentialEntry[]>;
|
|
@@ -251,6 +254,7 @@ export declare function make(options: ClientOptions): {
|
|
|
251
254
|
diff: (input: VcsDiffInput, requestOptions?: RequestOptions) => Promise<VcsDiffOutput>;
|
|
252
255
|
};
|
|
253
256
|
debug: {
|
|
257
|
+
heapDump: (input?: DebugHeapDumpInput, requestOptions?: RequestOptions) => Promise<DebugHeapDumpOutput>;
|
|
254
258
|
location: {
|
|
255
259
|
list: (requestOptions?: RequestOptions) => Promise<DebugLocationListOutput>;
|
|
256
260
|
evict: (input?: DebugLocationEvictInput, requestOptions?: RequestOptions) => Promise<void>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import"../../chunks/
|
|
1
|
+
import"../../chunks/contract-vyas3vgt.js";
|
|
2
2
|
import {
|
|
3
3
|
exports_client4
|
|
4
|
-
} from "../../chunks/
|
|
4
|
+
} from "../../chunks/contract-s2hya144.js";
|
|
5
5
|
import {
|
|
6
6
|
ClientError3
|
|
7
|
-
} from "../../chunks/
|
|
7
|
+
} from "../../chunks/contract-nwcpakzx.js";
|
|
8
8
|
import {
|
|
9
9
|
isInvalidRequestError2,
|
|
10
10
|
isUnauthorizedError2,
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
isIntegrationAttemptNotFoundError2,
|
|
30
30
|
isIntegrationMethodNotFoundError2,
|
|
31
31
|
isMcpServerNotFoundError2,
|
|
32
|
+
isForbiddenError2,
|
|
32
33
|
isProjectNotFoundError2,
|
|
33
34
|
isPermissionSavedNotFoundError2,
|
|
34
35
|
isPermissionNotFoundError2,
|
|
@@ -36,11 +37,10 @@ import {
|
|
|
36
37
|
isRpcError2,
|
|
37
38
|
isRpcInternalError2,
|
|
38
39
|
isPtyNotFoundError2,
|
|
39
|
-
isForbiddenError2,
|
|
40
40
|
isShellNotFoundError2,
|
|
41
41
|
isWorktreeError2,
|
|
42
42
|
isVcsInitNotSupportedError2
|
|
43
|
-
} from "../../chunks/
|
|
43
|
+
} from "../../chunks/contract-c46qzyff.js";
|
|
44
44
|
export {
|
|
45
45
|
ClientError3 as ClientError,
|
|
46
46
|
exports_client4 as OpenCode,
|
|
@@ -347,6 +347,10 @@ export type McpResourceTemplate = {
|
|
|
347
347
|
description?: string;
|
|
348
348
|
mimeType?: string;
|
|
349
349
|
};
|
|
350
|
+
export type PtyTicketConnectToken = {
|
|
351
|
+
ticket: string;
|
|
352
|
+
expires_in: number;
|
|
353
|
+
};
|
|
350
354
|
export type CredentialKey = {
|
|
351
355
|
type: "key";
|
|
352
356
|
key: string;
|
|
@@ -412,10 +416,6 @@ export type SessionStatus = {
|
|
|
412
416
|
} | {
|
|
413
417
|
type: "busy";
|
|
414
418
|
};
|
|
415
|
-
export type PtyTicketConnectToken = {
|
|
416
|
-
ticket: string;
|
|
417
|
-
expires_in: number;
|
|
418
|
-
};
|
|
419
419
|
export type PersistentPtyHandoff = {
|
|
420
420
|
directory: string;
|
|
421
421
|
instanceID: string;
|
|
@@ -3263,6 +3263,7 @@ export type ConfigEntry = {
|
|
|
3263
3263
|
experimental?: {
|
|
3264
3264
|
portable_shell_scanner?: boolean;
|
|
3265
3265
|
todo?: boolean;
|
|
3266
|
+
background_compaction?: boolean;
|
|
3266
3267
|
subagent_depth?: number;
|
|
3267
3268
|
location_idle_timeout?: string | false;
|
|
3268
3269
|
policies?: Array<{
|
|
@@ -3631,6 +3632,11 @@ export type McpServerNotFoundError = {
|
|
|
3631
3632
|
readonly message: string;
|
|
3632
3633
|
};
|
|
3633
3634
|
export declare const isMcpServerNotFoundError: (value: unknown) => value is McpServerNotFoundError;
|
|
3635
|
+
export type ForbiddenError = {
|
|
3636
|
+
readonly _tag: "ForbiddenError";
|
|
3637
|
+
readonly message: string;
|
|
3638
|
+
};
|
|
3639
|
+
export declare const isForbiddenError: (value: unknown) => value is ForbiddenError;
|
|
3634
3640
|
export type ProjectNotFoundError = {
|
|
3635
3641
|
readonly _tag: "ProjectNotFoundError";
|
|
3636
3642
|
readonly projectID: string;
|
|
@@ -3675,11 +3681,6 @@ export type PtyNotFoundError = {
|
|
|
3675
3681
|
readonly message: string;
|
|
3676
3682
|
};
|
|
3677
3683
|
export declare const isPtyNotFoundError: (value: unknown) => value is PtyNotFoundError;
|
|
3678
|
-
export type ForbiddenError = {
|
|
3679
|
-
readonly _tag: "ForbiddenError";
|
|
3680
|
-
readonly message: string;
|
|
3681
|
-
};
|
|
3682
|
-
export declare const isForbiddenError: (value: unknown) => value is ForbiddenError;
|
|
3683
3684
|
export type ShellNotFoundError = {
|
|
3684
3685
|
readonly _tag: "ShellNotFoundError";
|
|
3685
3686
|
readonly id: string;
|
|
@@ -6597,6 +6598,27 @@ export type McpResourceCatalogOutput = {
|
|
|
6597
6598
|
location: LocationPublicRef;
|
|
6598
6599
|
data: McpResourceCatalog;
|
|
6599
6600
|
};
|
|
6601
|
+
export type McpClientTokenInput = {
|
|
6602
|
+
readonly location?: {
|
|
6603
|
+
readonly location?: {
|
|
6604
|
+
readonly directory?: string | undefined;
|
|
6605
|
+
} | undefined;
|
|
6606
|
+
readonly name: string;
|
|
6607
|
+
}["location"];
|
|
6608
|
+
readonly name: {
|
|
6609
|
+
readonly location?: {
|
|
6610
|
+
readonly directory?: string | undefined;
|
|
6611
|
+
} | undefined;
|
|
6612
|
+
readonly name: string;
|
|
6613
|
+
}["name"];
|
|
6614
|
+
readonly "x-opencode-ticket"?: {
|
|
6615
|
+
readonly "x-opencode-ticket"?: string | undefined;
|
|
6616
|
+
}["x-opencode-ticket"];
|
|
6617
|
+
};
|
|
6618
|
+
export type McpClientTokenOutput = {
|
|
6619
|
+
location: LocationPublicRef;
|
|
6620
|
+
data: PtyTicketConnectToken;
|
|
6621
|
+
};
|
|
6600
6622
|
export type CredentialListOutput = {
|
|
6601
6623
|
data: Array<CredentialEntry>;
|
|
6602
6624
|
}["data"];
|
|
@@ -7767,6 +7789,22 @@ export type VcsDiffOutput = {
|
|
|
7767
7789
|
location: LocationPublicRef;
|
|
7768
7790
|
data: Array<FileDiffInfo>;
|
|
7769
7791
|
};
|
|
7792
|
+
export type DebugHeapDumpInput = {
|
|
7793
|
+
readonly directory?: {
|
|
7794
|
+
readonly directory?: string | undefined;
|
|
7795
|
+
}["directory"];
|
|
7796
|
+
};
|
|
7797
|
+
export type DebugHeapDumpOutput = {
|
|
7798
|
+
path: string;
|
|
7799
|
+
pid: number;
|
|
7800
|
+
memory: {
|
|
7801
|
+
rss: number;
|
|
7802
|
+
heapTotal: number;
|
|
7803
|
+
heapUsed: number;
|
|
7804
|
+
external: number;
|
|
7805
|
+
arrayBuffers: number;
|
|
7806
|
+
};
|
|
7807
|
+
};
|
|
7770
7808
|
export type DebugLocationListOutput = Array<LocationPublicRef>;
|
|
7771
7809
|
export type DebugLocationEvictInput = {
|
|
7772
7810
|
readonly location?: {
|
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
isIntegrationAttemptNotFoundError2,
|
|
23
23
|
isIntegrationMethodNotFoundError2,
|
|
24
24
|
isMcpServerNotFoundError2,
|
|
25
|
+
isForbiddenError2,
|
|
25
26
|
isProjectNotFoundError2,
|
|
26
27
|
isPermissionSavedNotFoundError2,
|
|
27
28
|
isPermissionNotFoundError2,
|
|
@@ -29,11 +30,10 @@ import {
|
|
|
29
30
|
isRpcError2,
|
|
30
31
|
isRpcInternalError2,
|
|
31
32
|
isPtyNotFoundError2,
|
|
32
|
-
isForbiddenError2,
|
|
33
33
|
isShellNotFoundError2,
|
|
34
34
|
isWorktreeError2,
|
|
35
35
|
isVcsInitNotSupportedError2
|
|
36
|
-
} from "../../chunks/
|
|
36
|
+
} from "../../chunks/contract-c46qzyff.js";
|
|
37
37
|
export {
|
|
38
38
|
isAgentNotFoundError2 as isAgentNotFoundError,
|
|
39
39
|
isCommandExecutionError2 as isCommandExecutionError,
|
package/dist/promise/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import"../chunks/
|
|
1
|
+
import"../chunks/contract-m2eywc8w.js";
|
|
2
2
|
import {
|
|
3
3
|
exports_client3
|
|
4
|
-
} from "../chunks/
|
|
5
|
-
import"../chunks/
|
|
6
|
-
import"../chunks/
|
|
4
|
+
} from "../chunks/contract-vwtmm97t.js";
|
|
5
|
+
import"../chunks/contract-vyas3vgt.js";
|
|
6
|
+
import"../chunks/contract-s2hya144.js";
|
|
7
7
|
import {
|
|
8
8
|
ClientError3
|
|
9
|
-
} from "../chunks/
|
|
10
|
-
import"../chunks/
|
|
9
|
+
} from "../chunks/contract-nwcpakzx.js";
|
|
10
|
+
import"../chunks/contract-skhp7hxc.js";
|
|
11
11
|
import {
|
|
12
12
|
isInvalidRequestError2,
|
|
13
13
|
isUnauthorizedError2,
|
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
isIntegrationAttemptNotFoundError2,
|
|
33
33
|
isIntegrationMethodNotFoundError2,
|
|
34
34
|
isMcpServerNotFoundError2,
|
|
35
|
+
isForbiddenError2,
|
|
35
36
|
isProjectNotFoundError2,
|
|
36
37
|
isPermissionSavedNotFoundError2,
|
|
37
38
|
isPermissionNotFoundError2,
|
|
@@ -39,12 +40,11 @@ import {
|
|
|
39
40
|
isRpcError2,
|
|
40
41
|
isRpcInternalError2,
|
|
41
42
|
isPtyNotFoundError2,
|
|
42
|
-
isForbiddenError2,
|
|
43
43
|
isShellNotFoundError2,
|
|
44
44
|
isWorktreeError2,
|
|
45
45
|
isVcsInitNotSupportedError2
|
|
46
|
-
} from "../chunks/
|
|
47
|
-
import"../chunks/
|
|
46
|
+
} from "../chunks/contract-c46qzyff.js";
|
|
47
|
+
import"../chunks/contract-8bbb028w.js";
|
|
48
48
|
export {
|
|
49
49
|
ClientError3 as ClientError,
|
|
50
50
|
exports_client3 as OpenCode,
|
package/dist/promise/rpc.js
CHANGED
package/dist/promise/service.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
spawnServiceContender2,
|
|
3
3
|
contenderPool2
|
|
4
|
-
} from "../chunks/
|
|
4
|
+
} from "../chunks/contract-ve4aws36.js";
|
|
5
5
|
import {
|
|
6
6
|
defaultEnsureTiming2,
|
|
7
7
|
ensureTiming2
|
|
8
|
-
} from "../chunks/
|
|
8
|
+
} from "../chunks/contract-xgnj2w4v.js";
|
|
9
9
|
import {
|
|
10
10
|
matchesVersion2
|
|
11
|
-
} from "../chunks/
|
|
12
|
-
import {
|
|
13
|
-
prepare2,
|
|
14
|
-
environment2,
|
|
15
|
-
complete2,
|
|
16
|
-
clear2
|
|
17
|
-
} from "../chunks/service-probe-v1n69e13.js";
|
|
11
|
+
} from "../chunks/contract-sxt88q69.js";
|
|
18
12
|
import {
|
|
19
13
|
decide2,
|
|
20
14
|
fallback2,
|
|
21
15
|
same2,
|
|
22
16
|
probeResult2,
|
|
23
17
|
headers2
|
|
24
|
-
} from "../chunks/
|
|
25
|
-
import
|
|
18
|
+
} from "../chunks/contract-2ny4vxct.js";
|
|
19
|
+
import {
|
|
20
|
+
prepare2,
|
|
21
|
+
environment2,
|
|
22
|
+
complete2,
|
|
23
|
+
clear2
|
|
24
|
+
} from "../chunks/contract-9kmsh4jj.js";
|
|
25
|
+
import"../chunks/contract-qav6mfdz.js";
|
|
26
26
|
|
|
27
27
|
// src/promise/service.ts
|
|
28
28
|
import { readFile, rm } from "node:fs/promises";
|
package/dist/pty-handoff.js
CHANGED
|
@@ -4,7 +4,10 @@ import {
|
|
|
4
4
|
complete2,
|
|
5
5
|
clear2,
|
|
6
6
|
exports_pty_handoff
|
|
7
|
-
} from "./chunks/
|
|
7
|
+
} from "./chunks/contract-9kmsh4jj.js";
|
|
8
|
+
import"./chunks/contract-2ny4vxct.js";
|
|
9
|
+
import"./chunks/contract-sxt88q69.js";
|
|
10
|
+
import"./chunks/contract-xgnj2w4v.js";
|
|
8
11
|
export {
|
|
9
12
|
exports_pty_handoff as PtyHandoff,
|
|
10
13
|
clear2 as clear,
|