@opencode/client 2.1.2 → 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.
Files changed (65) hide show
  1. package/dist/chunks/{service-probe-65kht65h.js → contract-15p82y03.js} +2 -2
  2. package/dist/chunks/{service-probe-61wt4y9h.js → contract-1x65x4hv.js} +15 -20
  3. package/dist/chunks/{service-probe-2ny4vxct.js → contract-2ny4vxct.js} +2 -2
  4. package/dist/chunks/{service-probe-frbwqjmf.js → contract-8bbb028w.js} +1 -1
  5. package/dist/chunks/{service-probe-032v66at.js → contract-9kmsh4jj.js} +8 -2
  6. package/dist/chunks/{service-probe-ezt8t3fk.js → contract-c46qzyff.js} +2 -2
  7. package/dist/chunks/{service-probe-ggt8t74w.js → contract-hg9t2gnm.js} +5 -5
  8. package/dist/chunks/{service-probe-t1xa31vm.js → contract-ryy6kscr.js} +1 -1
  9. package/dist/chunks/{service-probe-77ntr0t0.js → contract-s2hya144.js} +37 -3
  10. package/dist/chunks/{service-probe-6vp15eh6.js → contract-skhp7hxc.js} +1 -1
  11. package/dist/chunks/{service-probe-k9g6n5n1.js → contract-vwtmm97t.js} +4 -4
  12. package/dist/chunks/{service-probe-gbq9x9x6.js → contract-w10x3kfx.js} +21 -5
  13. package/dist/contract.js +1 -1
  14. package/dist/effect/api/api.d.ts +55 -1
  15. package/dist/effect/client.d.ts +791 -785
  16. package/dist/effect/client.js +8 -8
  17. package/dist/effect/generated/client-error.js +1 -1
  18. package/dist/effect/generated/client.d.ts +491 -485
  19. package/dist/effect/generated/client.js +3 -3
  20. package/dist/effect/generated/index.js +4 -4
  21. package/dist/effect/index.js +8 -8
  22. package/dist/effect/rpc.js +2 -2
  23. package/dist/effect/service.d.ts +1 -1
  24. package/dist/effect/service.js +11 -11
  25. package/dist/mcp.d.ts +44 -0
  26. package/dist/mcp.js +110 -0
  27. package/dist/promise/client.d.ts +12 -0
  28. package/dist/promise/client.js +7 -7
  29. package/dist/promise/generated/client-error.js +1 -1
  30. package/dist/promise/generated/client.d.ts +13 -1
  31. package/dist/promise/generated/client.js +2 -2
  32. package/dist/promise/generated/index.js +9 -9
  33. package/dist/promise/generated/types.d.ts +75 -9
  34. package/dist/promise/generated/types.js +2 -2
  35. package/dist/promise/index.js +11 -11
  36. package/dist/promise/rpc.js +2 -2
  37. package/dist/promise/service.js +11 -11
  38. package/dist/pty-handoff.js +4 -1
  39. package/dist/rpc-runtime.js +1 -1
  40. package/dist/service-contender.js +1 -1
  41. package/dist/service-probe.js +3 -3
  42. package/dist/service-timing.js +1 -1
  43. package/dist/service-version.js +1 -1
  44. package/dist/service.js +1 -1
  45. package/dist/shared-events.js +1 -1
  46. package/dist/solid/connection.js +1 -1
  47. package/dist/solid/data.js +9 -9
  48. package/dist/solid/index.js +12 -12
  49. package/dist/solid/pty.js +1 -1
  50. package/dist/solid/usage.js +1 -1
  51. package/package.json +13 -7
  52. /package/dist/chunks/{service-probe-6mptkzbc.js → contract-6mptkzbc.js} +0 -0
  53. /package/dist/chunks/{service-probe-8s2anffy.js → contract-8s2anffy.js} +0 -0
  54. /package/dist/chunks/{service-probe-9rqn6x4v.js → contract-9rqn6x4v.js} +0 -0
  55. /package/dist/chunks/{service-probe-gne7h7mq.js → contract-gne7h7mq.js} +0 -0
  56. /package/dist/chunks/{service-probe-m2eywc8w.js → contract-m2eywc8w.js} +0 -0
  57. /package/dist/chunks/{service-probe-nwcpakzx.js → contract-nwcpakzx.js} +0 -0
  58. /package/dist/chunks/{service-probe-qav6mfdz.js → contract-qav6mfdz.js} +0 -0
  59. /package/dist/chunks/{service-probe-sxt88q69.js → contract-sxt88q69.js} +0 -0
  60. /package/dist/chunks/{service-probe-ve4aws36.js → contract-ve4aws36.js} +0 -0
  61. /package/dist/chunks/{service-probe-vmytr4q8.js → contract-vmytr4q8.js} +0 -0
  62. /package/dist/chunks/{service-probe-vyas3vgt.js → contract-vyas3vgt.js} +0 -0
  63. /package/dist/chunks/{service-probe-xgnj2w4v.js → contract-xgnj2w4v.js} +0 -0
  64. /package/dist/chunks/{service-probe-y2etg5bs.js → contract-y2etg5bs.js} +0 -0
  65. /package/dist/chunks/{service-probe-ydhz1zrh.js → contract-ydhz1zrh.js} +0 -0
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  make4
3
- } from "../../chunks/service-probe-gbq9x9x6.js";
4
- import"../../chunks/service-probe-y2etg5bs.js";
5
- import"../../chunks/service-probe-vmytr4q8.js";
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/service-probe-6mptkzbc.js";
1
+ import"../../chunks/contract-6mptkzbc.js";
2
2
  import {
3
3
  exports_client2
4
- } from "../../chunks/service-probe-gbq9x9x6.js";
4
+ } from "../../chunks/contract-w10x3kfx.js";
5
5
  import {
6
6
  ClientError2
7
- } from "../../chunks/service-probe-y2etg5bs.js";
8
- import"../../chunks/service-probe-vmytr4q8.js";
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
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  ClientError2
3
- } from "../chunks/service-probe-y2etg5bs.js";
4
- import"../chunks/service-probe-vmytr4q8.js";
5
- import"../chunks/service-probe-gbq9x9x6.js";
6
- import"../chunks/service-probe-6mptkzbc.js";
7
- import"../chunks/service-probe-frbwqjmf.js";
8
- import"../chunks/service-probe-t1xa31vm.js";
9
- import"../chunks/service-probe-65kht65h.js";
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/service-probe-ggt8t74w.js";
12
+ } from "../chunks/contract-hg9t2gnm.js";
13
13
 
14
14
  // src/effect/index.ts
15
15
  import { Agent } from "@opencode/schema/agent";
@@ -2,8 +2,8 @@ import {
2
2
  make3,
3
3
  aborted2,
4
4
  exports_rpc
5
- } from "../chunks/service-probe-65kht65h.js";
6
- import"../chunks/service-probe-t1xa31vm.js";
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,
@@ -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 = import("../service.js").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;
@@ -1,28 +1,28 @@
1
1
  import {
2
2
  spawnServiceContender2,
3
3
  contenderPool2
4
- } from "../chunks/service-probe-ve4aws36.js";
4
+ } from "../chunks/contract-ve4aws36.js";
5
5
  import {
6
6
  defaultEnsureTiming2,
7
7
  ensureTiming2
8
- } from "../chunks/service-probe-xgnj2w4v.js";
8
+ } from "../chunks/contract-xgnj2w4v.js";
9
9
  import {
10
10
  matchesVersion2
11
- } from "../chunks/service-probe-sxt88q69.js";
12
- import {
13
- prepare2,
14
- environment2,
15
- complete2,
16
- clear2
17
- } from "../chunks/service-probe-032v66at.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/service-probe-2ny4vxct.js";
25
- import"../chunks/service-probe-qav6mfdz.js";
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
+ };
@@ -96,9 +96,17 @@ export declare function make(options: ClientOptions): {
96
96
  }>;
97
97
  };
98
98
  voice: {
99
+ models: (requestOptions?: OpenCode.RequestOptions) => Promise<{
100
+ models: Array<import("./index.js").VoiceModel>;
101
+ default?: string | undefined;
102
+ }>;
99
103
  session: (input: import("./index.js").VoiceSessionInput, requestOptions?: OpenCode.RequestOptions) => Promise<{
100
104
  transport: import("./index.js").VoiceTransport;
105
+ session?: {
106
+ id: string;
107
+ } | undefined;
101
108
  }>;
109
+ instructions: (input: import("./index.js").VoiceInstructionsInput, requestOptions?: OpenCode.RequestOptions) => Promise<void>;
102
110
  };
103
111
  provider: {
104
112
  list: (input?: import("./index.js").ProviderListInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").ProviderListOutput>;
@@ -135,6 +143,9 @@ export declare function make(options: ClientOptions): {
135
143
  resource: {
136
144
  catalog: (input?: import("./index.js").McpResourceCatalogInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").McpResourceCatalogOutput>;
137
145
  };
146
+ client: {
147
+ token: (input: import("./index.js").McpClientTokenInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").McpClientTokenOutput>;
148
+ };
138
149
  };
139
150
  credential: {
140
151
  list: (requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").CredentialEntry[]>;
@@ -230,6 +241,7 @@ export declare function make(options: ClientOptions): {
230
241
  diff: (input: import("./index.js").VcsDiffInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").VcsDiffOutput>;
231
242
  };
232
243
  debug: {
244
+ heapDump: (input?: import("./index.js").DebugHeapDumpInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").DebugHeapDumpOutput>;
233
245
  location: {
234
246
  list: (requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").DebugLocationListOutput>;
235
247
  evict: (input?: import("./index.js").DebugLocationEvictInput, requestOptions?: OpenCode.RequestOptions) => Promise<void>;
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  make5,
3
3
  exports_client3
4
- } from "../chunks/service-probe-k9g6n5n1.js";
5
- import"../chunks/service-probe-6vp15eh6.js";
6
- import"../chunks/service-probe-vyas3vgt.js";
7
- import"../chunks/service-probe-ezt8t3fk.js";
8
- import"../chunks/service-probe-77ntr0t0.js";
9
- import"../chunks/service-probe-nwcpakzx.js";
10
- import"../chunks/service-probe-frbwqjmf.js";
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,6 +1,6 @@
1
1
  import {
2
2
  ClientError3
3
- } from "../../chunks/service-probe-nwcpakzx.js";
3
+ } from "../../chunks/contract-nwcpakzx.js";
4
4
  export {
5
5
  ClientError3 as ClientError
6
6
  };
@@ -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, 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;
@@ -103,9 +103,17 @@ export declare function make(options: ClientOptions): {
103
103
  }>;
104
104
  };
105
105
  voice: {
106
+ models: (requestOptions?: RequestOptions) => Promise<{
107
+ models: Array<import("./types.js").VoiceModel>;
108
+ default?: string | undefined;
109
+ }>;
106
110
  session: (input: VoiceSessionInput, requestOptions?: RequestOptions) => Promise<{
107
111
  transport: import("./types.js").VoiceTransport;
112
+ session?: {
113
+ id: string;
114
+ } | undefined;
108
115
  }>;
116
+ instructions: (input: VoiceInstructionsInput, requestOptions?: RequestOptions) => Promise<void>;
109
117
  };
110
118
  provider: {
111
119
  list: (input?: ProviderListInput, requestOptions?: RequestOptions) => Promise<ProviderListOutput>;
@@ -142,6 +150,9 @@ export declare function make(options: ClientOptions): {
142
150
  resource: {
143
151
  catalog: (input?: McpResourceCatalogInput, requestOptions?: RequestOptions) => Promise<McpResourceCatalogOutput>;
144
152
  };
153
+ client: {
154
+ token: (input: McpClientTokenInput, requestOptions?: RequestOptions) => Promise<McpClientTokenOutput>;
155
+ };
145
156
  };
146
157
  credential: {
147
158
  list: (requestOptions?: RequestOptions) => Promise<import("./types.js").CredentialEntry[]>;
@@ -243,6 +254,7 @@ export declare function make(options: ClientOptions): {
243
254
  diff: (input: VcsDiffInput, requestOptions?: RequestOptions) => Promise<VcsDiffOutput>;
244
255
  };
245
256
  debug: {
257
+ heapDump: (input?: DebugHeapDumpInput, requestOptions?: RequestOptions) => Promise<DebugHeapDumpOutput>;
246
258
  location: {
247
259
  list: (requestOptions?: RequestOptions) => Promise<DebugLocationListOutput>;
248
260
  evict: (input?: DebugLocationEvictInput, requestOptions?: RequestOptions) => Promise<void>;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  make6
3
- } from "../../chunks/service-probe-77ntr0t0.js";
4
- import"../../chunks/service-probe-nwcpakzx.js";
3
+ } from "../../chunks/contract-s2hya144.js";
4
+ import"../../chunks/contract-nwcpakzx.js";
5
5
  export {
6
6
  make6 as make
7
7
  };
@@ -1,4 +1,10 @@
1
- import"../../chunks/service-probe-vyas3vgt.js";
1
+ import"../../chunks/contract-vyas3vgt.js";
2
+ import {
3
+ exports_client4
4
+ } from "../../chunks/contract-s2hya144.js";
5
+ import {
6
+ ClientError3
7
+ } from "../../chunks/contract-nwcpakzx.js";
2
8
  import {
3
9
  isInvalidRequestError2,
4
10
  isUnauthorizedError2,
@@ -23,6 +29,7 @@ import {
23
29
  isIntegrationAttemptNotFoundError2,
24
30
  isIntegrationMethodNotFoundError2,
25
31
  isMcpServerNotFoundError2,
32
+ isForbiddenError2,
26
33
  isProjectNotFoundError2,
27
34
  isPermissionSavedNotFoundError2,
28
35
  isPermissionNotFoundError2,
@@ -30,17 +37,10 @@ import {
30
37
  isRpcError2,
31
38
  isRpcInternalError2,
32
39
  isPtyNotFoundError2,
33
- isForbiddenError2,
34
40
  isShellNotFoundError2,
35
41
  isWorktreeError2,
36
42
  isVcsInitNotSupportedError2
37
- } from "../../chunks/service-probe-ezt8t3fk.js";
38
- import {
39
- exports_client4
40
- } from "../../chunks/service-probe-77ntr0t0.js";
41
- import {
42
- ClientError3
43
- } from "../../chunks/service-probe-nwcpakzx.js";
43
+ } from "../../chunks/contract-c46qzyff.js";
44
44
  export {
45
45
  ClientError3 as ClientError,
46
46
  exports_client4 as OpenCode,
@@ -239,6 +239,7 @@ export type GenerateTextResponse = {
239
239
  text: string;
240
240
  };
241
241
  };
242
+ export type VoiceTransportType = "webrtc" | "websocket";
242
243
  export type VoiceWebRTCTransport = {
243
244
  type: "webrtc";
244
245
  sdp: string;
@@ -346,6 +347,10 @@ export type McpResourceTemplate = {
346
347
  description?: string;
347
348
  mimeType?: string;
348
349
  };
350
+ export type PtyTicketConnectToken = {
351
+ ticket: string;
352
+ expires_in: number;
353
+ };
349
354
  export type CredentialKey = {
350
355
  type: "key";
351
356
  key: string;
@@ -411,10 +416,6 @@ export type SessionStatus = {
411
416
  } | {
412
417
  type: "busy";
413
418
  };
414
- export type PtyTicketConnectToken = {
415
- ticket: string;
416
- expires_in: number;
417
- };
418
419
  export type PersistentPtyHandoff = {
419
420
  directory: string;
420
421
  instanceID: string;
@@ -918,6 +919,14 @@ export type ModelCost = {
918
919
  write: MoneyUSDPerMillionTokens;
919
920
  };
920
921
  };
922
+ export type VoiceModel = {
923
+ model: string;
924
+ provider: string;
925
+ transports: Array<VoiceTransportType>;
926
+ available: boolean;
927
+ integration?: string | undefined;
928
+ workspace?: string | undefined;
929
+ };
921
930
  export type VoiceTransport = VoiceWebRTCTransport | VoiceWebSocketTransport;
922
931
  export type IntegrationCommandMethod = {
923
932
  id: IntegrationMethodID;
@@ -2763,9 +2772,18 @@ export type ProviderInfo = {
2763
2772
  [x: string]: any;
2764
2773
  };
2765
2774
  };
2775
+ export type VoiceModelsResponse = {
2776
+ data: {
2777
+ models: Array<VoiceModel>;
2778
+ default?: string | undefined;
2779
+ };
2780
+ };
2766
2781
  export type VoiceSessionResponse = {
2767
2782
  data: {
2768
2783
  transport: VoiceTransport;
2784
+ session?: {
2785
+ id: string;
2786
+ } | undefined;
2769
2787
  };
2770
2788
  };
2771
2789
  export type CredentialValue = CredentialOAuth | CredentialKey | CredentialExternal;
@@ -3245,6 +3263,7 @@ export type ConfigEntry = {
3245
3263
  experimental?: {
3246
3264
  portable_shell_scanner?: boolean;
3247
3265
  todo?: boolean;
3266
+ background_compaction?: boolean;
3248
3267
  subagent_depth?: number;
3249
3268
  location_idle_timeout?: string | false;
3250
3269
  policies?: Array<{
@@ -3613,6 +3632,11 @@ export type McpServerNotFoundError = {
3613
3632
  readonly message: string;
3614
3633
  };
3615
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;
3616
3640
  export type ProjectNotFoundError = {
3617
3641
  readonly _tag: "ProjectNotFoundError";
3618
3642
  readonly projectID: string;
@@ -3657,11 +3681,6 @@ export type PtyNotFoundError = {
3657
3681
  readonly message: string;
3658
3682
  };
3659
3683
  export declare const isPtyNotFoundError: (value: unknown) => value is PtyNotFoundError;
3660
- export type ForbiddenError = {
3661
- readonly _tag: "ForbiddenError";
3662
- readonly message: string;
3663
- };
3664
- export declare const isForbiddenError: (value: unknown) => value is ForbiddenError;
3665
3684
  export type ShellNotFoundError = {
3666
3685
  readonly _tag: "ShellNotFoundError";
3667
3686
  readonly id: string;
@@ -6150,6 +6169,7 @@ export type GenerateTextInput = {
6150
6169
  }["model"];
6151
6170
  };
6152
6171
  export type GenerateTextOutput = GenerateTextResponse["data"];
6172
+ export type VoiceModelsOutput = VoiceModelsResponse["data"];
6153
6173
  export type VoiceSessionInput = {
6154
6174
  readonly model: {
6155
6175
  readonly model: string;
@@ -6192,6 +6212,15 @@ export type VoiceSessionInput = {
6192
6212
  }["transport"];
6193
6213
  };
6194
6214
  export type VoiceSessionOutput = VoiceSessionResponse["data"];
6215
+ export type VoiceInstructionsInput = {
6216
+ readonly sessionID: {
6217
+ readonly sessionID: string;
6218
+ }["sessionID"];
6219
+ readonly instructions: {
6220
+ readonly instructions: string;
6221
+ }["instructions"];
6222
+ };
6223
+ export type VoiceInstructionsOutput = void;
6195
6224
  export type ProviderListInput = {
6196
6225
  readonly location?: {
6197
6226
  readonly location?: {
@@ -6569,6 +6598,27 @@ export type McpResourceCatalogOutput = {
6569
6598
  location: LocationPublicRef;
6570
6599
  data: McpResourceCatalog;
6571
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
+ };
6572
6622
  export type CredentialListOutput = {
6573
6623
  data: Array<CredentialEntry>;
6574
6624
  }["data"];
@@ -7739,6 +7789,22 @@ export type VcsDiffOutput = {
7739
7789
  location: LocationPublicRef;
7740
7790
  data: Array<FileDiffInfo>;
7741
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
+ };
7742
7808
  export type DebugLocationListOutput = Array<LocationPublicRef>;
7743
7809
  export type DebugLocationEvictInput = {
7744
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/service-probe-ezt8t3fk.js";
36
+ } from "../../chunks/contract-c46qzyff.js";
37
37
  export {
38
38
  isAgentNotFoundError2 as isAgentNotFoundError,
39
39
  isCommandExecutionError2 as isCommandExecutionError,