@opencode/client 2.1.3 → 2.2.0

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 (76) hide show
  1. package/dist/chunks/service-timing-6mq2wh8y.js +33 -0
  2. package/dist/chunks/{service-probe-y2etg5bs.js → service-timing-7f0py9js.js} +2 -2
  3. package/dist/chunks/{service-probe-ezt8t3fk.js → service-timing-8we1dz3p.js} +6 -2
  4. package/dist/chunks/{service-probe-8ye1ye6f.js → service-timing-8ye1ye6f.js} +2 -2
  5. package/dist/chunks/{service-probe-6vp15eh6.js → service-timing-ab9bm97w.js} +1 -1
  6. package/dist/chunks/service-timing-b80wmp2t.js +30 -0
  7. package/dist/chunks/{service-probe-61wt4y9h.js → service-timing-cyxwqteg.js} +111 -75
  8. package/dist/chunks/{service-probe-8bbb028w.js → service-timing-gecjxyvt.js} +5 -1
  9. package/dist/chunks/{service-probe-xwk4fryp.js → service-timing-jpd9ebw3.js} +17 -17
  10. package/dist/chunks/{service-probe-nwcpakzx.js → service-timing-js54wxgp.js} +2 -2
  11. package/dist/chunks/{service-probe-v1n69e13.js → service-timing-knyqkv17.js} +8 -2
  12. package/dist/chunks/{service-probe-9j12j8xw.js → service-timing-myz4ngx9.js} +5 -5
  13. package/dist/chunks/{service-probe-5r97ebd4.js → service-timing-rxd7awy0.js} +59 -22
  14. package/dist/chunks/{service-probe-ryy6kscr.js → service-timing-ryy6kscr.js} +1 -1
  15. package/dist/chunks/{service-probe-g22sa7qz.js → service-timing-wcsbjfhx.js} +129 -36
  16. package/dist/contract.js +1 -1
  17. package/dist/effect/api/api.d.ts +104 -14
  18. package/dist/effect/api.d.ts +1 -0
  19. package/dist/effect/client.d.ts +901 -885
  20. package/dist/effect/client.js +12 -12
  21. package/dist/effect/generated/client-error.js +3 -3
  22. package/dist/effect/generated/client.d.ts +515 -503
  23. package/dist/effect/generated/client.js +5 -5
  24. package/dist/effect/generated/index.js +8 -8
  25. package/dist/effect/index.js +12 -12
  26. package/dist/effect/rpc.js +4 -4
  27. package/dist/effect/service.d.ts +1 -1
  28. package/dist/effect/service.js +11 -11
  29. package/dist/mcp.d.ts +44 -0
  30. package/dist/mcp.js +110 -0
  31. package/dist/promise/api.d.ts +1 -0
  32. package/dist/promise/client.d.ts +16 -5
  33. package/dist/promise/client.js +11 -11
  34. package/dist/promise/generated/client-error.js +3 -3
  35. package/dist/promise/generated/client.d.ts +17 -6
  36. package/dist/promise/generated/client.js +4 -4
  37. package/dist/promise/generated/index.js +17 -9
  38. package/dist/promise/generated/types.d.ts +1165 -3509
  39. package/dist/promise/generated/types.js +10 -2
  40. package/dist/promise/index.d.ts +1 -0
  41. package/dist/promise/index.js +21 -13
  42. package/dist/promise/rpc.js +2 -2
  43. package/dist/promise/service.d.ts +2 -2
  44. package/dist/promise/service.js +12 -11
  45. package/dist/pty-handoff.js +4 -1
  46. package/dist/rpc-runtime.js +1 -1
  47. package/dist/service-contender.js +1 -1
  48. package/dist/service-probe.js +3 -3
  49. package/dist/service-timing.js +1 -1
  50. package/dist/service-version.js +1 -1
  51. package/dist/service.js +1 -1
  52. package/dist/shared-events.d.ts +7 -2
  53. package/dist/shared-events.js +1 -1
  54. package/dist/solid/connection.js +1 -1
  55. package/dist/solid/data.d.ts +11 -1
  56. package/dist/solid/data.js +9 -9
  57. package/dist/solid/index.d.ts +1 -0
  58. package/dist/solid/index.js +16 -12
  59. package/dist/solid/pty.js +1 -1
  60. package/dist/solid/retention.d.ts +10 -0
  61. package/dist/solid/retention.js +6 -0
  62. package/dist/solid/usage.js +1 -1
  63. package/package.json +15 -8
  64. package/dist/chunks/service-probe-9p0yrv34.js +0 -30
  65. /package/dist/chunks/{service-probe-6mptkzbc.js → service-timing-6mptkzbc.js} +0 -0
  66. /package/dist/chunks/{service-probe-8s2anffy.js → service-timing-8s2anffy.js} +0 -0
  67. /package/dist/chunks/{service-probe-9rqn6x4v.js → service-timing-9rqn6x4v.js} +0 -0
  68. /package/dist/chunks/{service-probe-gne7h7mq.js → service-timing-gne7h7mq.js} +0 -0
  69. /package/dist/chunks/{service-probe-m2eywc8w.js → service-timing-m2eywc8w.js} +0 -0
  70. /package/dist/chunks/{service-probe-qav6mfdz.js → service-timing-qav6mfdz.js} +0 -0
  71. /package/dist/chunks/{service-probe-sxt88q69.js → service-timing-sxt88q69.js} +0 -0
  72. /package/dist/chunks/{service-probe-ve4aws36.js → service-timing-ve4aws36.js} +0 -0
  73. /package/dist/chunks/{service-probe-vmytr4q8.js → service-timing-vmytr4q8.js} +0 -0
  74. /package/dist/chunks/{service-probe-vyas3vgt.js → service-timing-vyas3vgt.js} +0 -0
  75. /package/dist/chunks/{service-probe-xgnj2w4v.js → service-timing-xgnj2w4v.js} +0 -0
  76. /package/dist/chunks/{service-probe-ydhz1zrh.js → service-timing-ydhz1zrh.js} +0 -0
@@ -4,6 +4,7 @@ import {
4
4
  isLocationNotFoundError2,
5
5
  isServiceUnavailableError2,
6
6
  isAgentNotFoundError2,
7
+ isPluginNotFoundError2,
7
8
  isInvalidCursorError2,
8
9
  isSessionNotFoundError2,
9
10
  isConflictError2,
@@ -18,10 +19,14 @@ import {
18
19
  isFormInvalidAnswerError2,
19
20
  isFormAlreadySettledError2,
20
21
  isProviderNotFoundError2,
22
+ isModelNotFoundError2,
23
+ isUnsupportedModelError2,
24
+ isProviderRequestError2,
21
25
  isIntegrationNotFoundError2,
22
26
  isIntegrationAttemptNotFoundError2,
23
27
  isIntegrationMethodNotFoundError2,
24
28
  isMcpServerNotFoundError2,
29
+ isForbiddenError2,
25
30
  isProjectNotFoundError2,
26
31
  isPermissionSavedNotFoundError2,
27
32
  isPermissionNotFoundError2,
@@ -29,11 +34,10 @@ import {
29
34
  isRpcError2,
30
35
  isRpcInternalError2,
31
36
  isPtyNotFoundError2,
32
- isForbiddenError2,
33
37
  isShellNotFoundError2,
34
38
  isWorktreeError2,
35
39
  isVcsInitNotSupportedError2
36
- } from "../../chunks/service-probe-ezt8t3fk.js";
40
+ } from "../../chunks/service-timing-8we1dz3p.js";
37
41
  export {
38
42
  isAgentNotFoundError2 as isAgentNotFoundError,
39
43
  isCommandExecutionError2 as isCommandExecutionError,
@@ -53,10 +57,13 @@ export {
53
57
  isLocationNotFoundError2 as isLocationNotFoundError,
54
58
  isMcpServerNotFoundError2 as isMcpServerNotFoundError,
55
59
  isMessageNotFoundError2 as isMessageNotFoundError,
60
+ isModelNotFoundError2 as isModelNotFoundError,
56
61
  isPermissionNotFoundError2 as isPermissionNotFoundError,
57
62
  isPermissionSavedNotFoundError2 as isPermissionSavedNotFoundError,
63
+ isPluginNotFoundError2 as isPluginNotFoundError,
58
64
  isProjectNotFoundError2 as isProjectNotFoundError,
59
65
  isProviderNotFoundError2 as isProviderNotFoundError,
66
+ isProviderRequestError2 as isProviderRequestError,
60
67
  isPtyNotFoundError2 as isPtyNotFoundError,
61
68
  isRpcError2 as isRpcError,
62
69
  isRpcInternalError2 as isRpcInternalError,
@@ -67,6 +74,7 @@ export {
67
74
  isSkillNotFoundError2 as isSkillNotFoundError,
68
75
  isUnauthorizedError2 as isUnauthorizedError,
69
76
  isUnknownError2 as isUnknownError,
77
+ isUnsupportedModelError2 as isUnsupportedModelError,
70
78
  isVcsInitNotSupportedError2 as isVcsInitNotSupportedError,
71
79
  isWorktreeError2 as isWorktreeError
72
80
  };
@@ -3,4 +3,5 @@ export * from "./generated/index.js";
3
3
  export { OpenCode } from "./client.js";
4
4
  export type { AgentApi, CommandApi, ConfigApi, EventApi, IntegrationApi, ModelApi, PluginApi, ProviderApi, ReferenceApi, RpcApi, RpcCallOptions, RpcClient, RpcEventPayload, WebSearchApi, SessionApi, SkillApi, } from "./api.js";
5
5
  export type { EventSubscribeOutput as OpenCodeEvent } from "./generated/types.js";
6
+ export type { MediaFileAttachment as PromptMediaFileAttachment, Attachment as PromptAttachment, } from "@opencode/schema/prompt";
6
7
  export type OpenCodeClient = ReturnType<typeof OpenCode.make>;
@@ -1,19 +1,20 @@
1
- import"../chunks/service-probe-m2eywc8w.js";
1
+ import"../chunks/service-timing-m2eywc8w.js";
2
2
  import {
3
- exports_client3
4
- } from "../chunks/service-probe-9p0yrv34.js";
5
- import"../chunks/service-probe-vyas3vgt.js";
6
- import"../chunks/service-probe-g22sa7qz.js";
3
+ exports_client
4
+ } from "../chunks/service-timing-b80wmp2t.js";
5
+ import"../chunks/service-timing-vyas3vgt.js";
6
+ import"../chunks/service-timing-wcsbjfhx.js";
7
7
  import {
8
- ClientError3
9
- } from "../chunks/service-probe-nwcpakzx.js";
10
- import"../chunks/service-probe-6vp15eh6.js";
8
+ ClientError2
9
+ } from "../chunks/service-timing-js54wxgp.js";
10
+ import"../chunks/service-timing-ab9bm97w.js";
11
11
  import {
12
12
  isInvalidRequestError2,
13
13
  isUnauthorizedError2,
14
14
  isLocationNotFoundError2,
15
15
  isServiceUnavailableError2,
16
16
  isAgentNotFoundError2,
17
+ isPluginNotFoundError2,
17
18
  isInvalidCursorError2,
18
19
  isSessionNotFoundError2,
19
20
  isConflictError2,
@@ -28,10 +29,14 @@ import {
28
29
  isFormInvalidAnswerError2,
29
30
  isFormAlreadySettledError2,
30
31
  isProviderNotFoundError2,
32
+ isModelNotFoundError2,
33
+ isUnsupportedModelError2,
34
+ isProviderRequestError2,
31
35
  isIntegrationNotFoundError2,
32
36
  isIntegrationAttemptNotFoundError2,
33
37
  isIntegrationMethodNotFoundError2,
34
38
  isMcpServerNotFoundError2,
39
+ isForbiddenError2,
35
40
  isProjectNotFoundError2,
36
41
  isPermissionSavedNotFoundError2,
37
42
  isPermissionNotFoundError2,
@@ -39,15 +44,14 @@ import {
39
44
  isRpcError2,
40
45
  isRpcInternalError2,
41
46
  isPtyNotFoundError2,
42
- isForbiddenError2,
43
47
  isShellNotFoundError2,
44
48
  isWorktreeError2,
45
49
  isVcsInitNotSupportedError2
46
- } from "../chunks/service-probe-ezt8t3fk.js";
47
- import"../chunks/service-probe-8bbb028w.js";
50
+ } from "../chunks/service-timing-8we1dz3p.js";
51
+ import"../chunks/service-timing-gecjxyvt.js";
48
52
  export {
49
- ClientError3 as ClientError,
50
- exports_client3 as OpenCode,
53
+ ClientError2 as ClientError,
54
+ exports_client as OpenCode,
51
55
  isAgentNotFoundError2 as isAgentNotFoundError,
52
56
  isCommandExecutionError2 as isCommandExecutionError,
53
57
  isCommandNotFoundError2 as isCommandNotFoundError,
@@ -66,10 +70,13 @@ export {
66
70
  isLocationNotFoundError2 as isLocationNotFoundError,
67
71
  isMcpServerNotFoundError2 as isMcpServerNotFoundError,
68
72
  isMessageNotFoundError2 as isMessageNotFoundError,
73
+ isModelNotFoundError2 as isModelNotFoundError,
69
74
  isPermissionNotFoundError2 as isPermissionNotFoundError,
70
75
  isPermissionSavedNotFoundError2 as isPermissionSavedNotFoundError,
76
+ isPluginNotFoundError2 as isPluginNotFoundError,
71
77
  isProjectNotFoundError2 as isProjectNotFoundError,
72
78
  isProviderNotFoundError2 as isProviderNotFoundError,
79
+ isProviderRequestError2 as isProviderRequestError,
73
80
  isPtyNotFoundError2 as isPtyNotFoundError,
74
81
  isRpcError2 as isRpcError,
75
82
  isRpcInternalError2 as isRpcInternalError,
@@ -80,6 +87,7 @@ export {
80
87
  isSkillNotFoundError2 as isSkillNotFoundError,
81
88
  isUnauthorizedError2 as isUnauthorizedError,
82
89
  isUnknownError2 as isUnknownError,
90
+ isUnsupportedModelError2 as isUnsupportedModelError,
83
91
  isVcsInitNotSupportedError2 as isVcsInitNotSupportedError,
84
92
  isWorktreeError2 as isWorktreeError
85
93
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  makeRpc2
3
- } from "../chunks/service-probe-6vp15eh6.js";
4
- import"../chunks/service-probe-ezt8t3fk.js";
3
+ } from "../chunks/service-timing-ab9bm97w.js";
4
+ import"../chunks/service-timing-8we1dz3p.js";
5
5
  export {
6
6
  makeRpc2 as makeRpc
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import type { DiscoverOptions, Endpoint, EnsureOptions, StopOptions } from "../service.js";
2
- import { headers } from "../service-probe.js";
2
+ import { fallback, headers } from "../service-probe.js";
3
3
  export * from "../service.js";
4
- export { headers };
4
+ export { fallback, headers };
5
5
  /** Discover a healthy, compatible local service without starting one. */
6
6
  export declare function discover(options?: DiscoverOptions): Promise<{
7
7
  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/service-timing-ve4aws36.js";
5
5
  import {
6
6
  defaultEnsureTiming2,
7
7
  ensureTiming2
8
- } from "../chunks/service-probe-xgnj2w4v.js";
8
+ } from "../chunks/service-timing-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-v1n69e13.js";
11
+ } from "../chunks/service-timing-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-8ye1ye6f.js";
25
- import"../chunks/service-probe-qav6mfdz.js";
18
+ } from "../chunks/service-timing-8ye1ye6f.js";
19
+ import {
20
+ prepare2,
21
+ environment2,
22
+ complete2,
23
+ clear2
24
+ } from "../chunks/service-timing-knyqkv17.js";
25
+ import"../chunks/service-timing-qav6mfdz.js";
26
26
 
27
27
  // src/promise/service.ts
28
28
  import { readFile, rm } from "node:fs/promises";
@@ -182,6 +182,7 @@ export {
182
182
  Service,
183
183
  discover,
184
184
  ensure,
185
+ fallback2 as fallback,
185
186
  headers2 as headers,
186
187
  stop
187
188
  };
@@ -4,7 +4,10 @@ import {
4
4
  complete2,
5
5
  clear2,
6
6
  exports_pty_handoff
7
- } from "./chunks/service-probe-v1n69e13.js";
7
+ } from "./chunks/service-timing-knyqkv17.js";
8
+ import"./chunks/service-timing-8ye1ye6f.js";
9
+ import"./chunks/service-timing-xgnj2w4v.js";
10
+ import"./chunks/service-timing-sxt88q69.js";
8
11
  export {
9
12
  exports_pty_handoff as PtyHandoff,
10
13
  clear2 as clear,
@@ -4,7 +4,7 @@ import {
4
4
  event2,
5
5
  eventType2,
6
6
  exports_rpc_runtime
7
- } from "./chunks/service-probe-ryy6kscr.js";
7
+ } from "./chunks/service-timing-ryy6kscr.js";
8
8
  export {
9
9
  exports_rpc_runtime as RpcRuntime,
10
10
  event2 as event,
@@ -2,7 +2,7 @@ import {
2
2
  spawnServiceContender2,
3
3
  contenderPool2,
4
4
  contenderFinished2
5
- } from "./chunks/service-probe-ve4aws36.js";
5
+ } from "./chunks/service-timing-ve4aws36.js";
6
6
  export {
7
7
  contenderFinished2 as contenderFinished,
8
8
  contenderPool2 as contenderPool,
@@ -4,9 +4,9 @@ import {
4
4
  same2,
5
5
  probeResult2,
6
6
  headers2
7
- } from "./chunks/service-probe-8ye1ye6f.js";
8
- import"./chunks/service-probe-xgnj2w4v.js";
9
- import"./chunks/service-probe-sxt88q69.js";
7
+ } from "./chunks/service-timing-8ye1ye6f.js";
8
+ import"./chunks/service-timing-xgnj2w4v.js";
9
+ import"./chunks/service-timing-sxt88q69.js";
10
10
  export {
11
11
  decide2 as decide,
12
12
  fallback2 as fallback,
@@ -2,7 +2,7 @@ import {
2
2
  defaultEnsureTiming2,
3
3
  ensureTiming2,
4
4
  withEnsureTiming2
5
- } from "./chunks/service-probe-xgnj2w4v.js";
5
+ } from "./chunks/service-timing-xgnj2w4v.js";
6
6
  export {
7
7
  defaultEnsureTiming2 as defaultEnsureTiming,
8
8
  ensureTiming2 as ensureTiming,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  matchesVersion2
3
- } from "./chunks/service-probe-sxt88q69.js";
3
+ } from "./chunks/service-timing-sxt88q69.js";
4
4
  export {
5
5
  matchesVersion2 as matchesVersion
6
6
  };
package/dist/service.js CHANGED
@@ -1 +1 @@
1
- import"./chunks/service-probe-qav6mfdz.js";
1
+ import"./chunks/service-timing-qav6mfdz.js";
@@ -1,5 +1,10 @@
1
1
  export * as SharedEvents from "./shared-events.js";
2
- export type SubscribeOptions = {
2
+ /** The members of event union `A` whose type matches one of `Type`, including `rpc.*` events. */
3
+ export type SelectedEvent<A extends {
4
+ readonly type: string;
5
+ }, Type extends string> = A extends unknown ? [Extract<Type, A["type"]>] extends [never] ? never : A : never;
6
+ export type SubscribeOptions<Type extends string = string> = {
7
+ readonly types?: ReadonlyArray<Type>;
3
8
  readonly signal?: AbortSignal;
4
9
  /** Reports transport activity on the shared stream, including keepalive frames that carry no event. */
5
10
  readonly onActivity?: () => void;
@@ -7,5 +12,5 @@ export type SubscribeOptions = {
7
12
  export declare function make<A extends {
8
13
  readonly type: string;
9
14
  }>(connect: (signal: AbortSignal, onActivity: () => void) => AsyncIterable<A>): {
10
- subscribe(options?: SubscribeOptions): AsyncIterable<A>;
15
+ subscribe<Type extends Exclude<A["type"], "server.connected"> = Exclude<A["type"], "server.connected">>(options?: SubscribeOptions<Type>): AsyncIterable<SelectedEvent<A, Type | "server.connected">>;
11
16
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  make7,
3
3
  exports_shared_events
4
- } from "./chunks/service-probe-8bbb028w.js";
4
+ } from "./chunks/service-timing-gecjxyvt.js";
5
5
  export {
6
6
  exports_shared_events as SharedEvents,
7
7
  make7 as make
@@ -2,7 +2,7 @@ import {
2
2
  defaultIdleTimeout2,
3
3
  foregroundIdleThreshold2,
4
4
  createClientConnection2
5
- } from "../chunks/service-probe-ydhz1zrh.js";
5
+ } from "../chunks/service-timing-ydhz1zrh.js";
6
6
  export {
7
7
  createClientConnection2 as createClientConnection,
8
8
  defaultIdleTimeout2 as defaultIdleTimeout,
@@ -1,4 +1,4 @@
1
- import type { AgentInfo, CommandInfo, ConfigEntry, SessionFormCancelInput, FormInfo, SessionFormReplyInput, IntegrationInfo, LocationRef, McpResource, McpServer, ModelInfo, ModelRef, PermissionSavedInfo, PermissionRequest, PermissionReplyInput, Project, ProviderInfo, ReferenceInfo, SessionMessageInfo, SessionInfo, SessionInboxInfo, SessionInboxCompaction, ShellInfo, SkillInfo, VcsInfo, OpenCodeEvent, OpenCodeClient, WebSearchProvider } from "../promise";
1
+ import type { AgentInfo, CommandInfo, ConfigEntry, SessionFormCancelInput, FormInfo, SessionFormReplyInput, IntegrationInfo, LocationRef, McpResource, McpServer, ModelInfo, ModelRef, PermissionSavedInfo, PermissionRequest, PermissionReplyInput, Project, ProviderInfo, ReferenceInfo, SessionMessageInfo, SessionInfo, SessionInboxInfo, SessionInboxCompaction, ShellInfo, SkillInfo, UsageLimitsInfo, VcsInfo, OpenCodeEvent, OpenCodeClient, WebSearchProvider } from "../promise";
2
2
  import { type SessionPromptInput } from "../promise";
3
3
  export type DataSessionStatus = "idle" | "running";
4
4
  /**
@@ -29,6 +29,11 @@ export type CreateDataInput = {
29
29
  };
30
30
  /** Receives failed event-driven reads. Explicit reads still reject to their caller. */
31
31
  readonly onError?: (error: unknown) => void;
32
+ /**
33
+ * Drops the payload of inline `data:` files in tool results before they enter the store. For clients that never
34
+ * render tool-result files: a session full of screenshots otherwise keeps hundreds of MB of base64 alive.
35
+ */
36
+ readonly omitToolFileData?: boolean;
32
37
  };
33
38
  export declare const settleMs = 150;
34
39
  export type FormWithLocation = FormInfo & {
@@ -149,6 +154,11 @@ export declare function createData(config: CreateDataInput): {
149
154
  sync: (ref?: LocationRef) => Promise<void>;
150
155
  invalidate: (ref?: LocationRef) => void;
151
156
  };
157
+ usage: {
158
+ limits: (ref?: LocationRef) => UsageLimitsInfo | null | undefined;
159
+ sync: (ref?: LocationRef) => Promise<void>;
160
+ invalidate: (ref?: LocationRef) => void;
161
+ };
152
162
  agent: {
153
163
  list: (ref?: LocationRef) => AgentInfo[] | undefined;
154
164
  sync: (ref?: LocationRef) => Promise<void>;
@@ -2,15 +2,15 @@ import {
2
2
  settleMs2,
3
3
  locationKey2,
4
4
  createData2
5
- } from "../chunks/service-probe-61wt4y9h.js";
6
- import"../chunks/service-probe-m2eywc8w.js";
7
- import"../chunks/service-probe-9p0yrv34.js";
8
- import"../chunks/service-probe-vyas3vgt.js";
9
- import"../chunks/service-probe-g22sa7qz.js";
10
- import"../chunks/service-probe-nwcpakzx.js";
11
- import"../chunks/service-probe-6vp15eh6.js";
12
- import"../chunks/service-probe-ezt8t3fk.js";
13
- import"../chunks/service-probe-8bbb028w.js";
5
+ } from "../chunks/service-timing-cyxwqteg.js";
6
+ import"../chunks/service-timing-m2eywc8w.js";
7
+ import"../chunks/service-timing-b80wmp2t.js";
8
+ import"../chunks/service-timing-vyas3vgt.js";
9
+ import"../chunks/service-timing-wcsbjfhx.js";
10
+ import"../chunks/service-timing-js54wxgp.js";
11
+ import"../chunks/service-timing-ab9bm97w.js";
12
+ import"../chunks/service-timing-8we1dz3p.js";
13
+ import"../chunks/service-timing-gecjxyvt.js";
14
14
  export {
15
15
  createData2 as createData,
16
16
  locationKey2 as locationKey,
@@ -1,4 +1,5 @@
1
1
  export * from "./data";
2
2
  export * from "./connection";
3
3
  export * from "./pty";
4
+ export * from "./retention";
4
5
  export * from "./usage";
@@ -1,33 +1,37 @@
1
- import"../chunks/service-probe-nwcpakzx.js";
2
- import"../chunks/service-probe-g22sa7qz.js";
3
- import"../chunks/service-probe-ezt8t3fk.js";
4
- import"../chunks/service-probe-vyas3vgt.js";
5
- import"../chunks/service-probe-8bbb028w.js";
6
- import"../chunks/service-probe-6vp15eh6.js";
7
- import"../chunks/service-probe-9p0yrv34.js";
8
- import"../chunks/service-probe-m2eywc8w.js";
1
+ import"../chunks/service-timing-js54wxgp.js";
2
+ import"../chunks/service-timing-wcsbjfhx.js";
3
+ import"../chunks/service-timing-8we1dz3p.js";
4
+ import"../chunks/service-timing-vyas3vgt.js";
5
+ import"../chunks/service-timing-gecjxyvt.js";
6
+ import"../chunks/service-timing-ab9bm97w.js";
7
+ import"../chunks/service-timing-b80wmp2t.js";
8
+ import"../chunks/service-timing-m2eywc8w.js";
9
9
  import {
10
10
  settleMs2,
11
11
  locationKey2,
12
12
  createData2
13
- } from "../chunks/service-probe-61wt4y9h.js";
13
+ } from "../chunks/service-timing-cyxwqteg.js";
14
14
  import {
15
15
  defaultIdleTimeout2,
16
16
  foregroundIdleThreshold2,
17
17
  createClientConnection2
18
- } from "../chunks/service-probe-ydhz1zrh.js";
18
+ } from "../chunks/service-timing-ydhz1zrh.js";
19
19
  import {
20
20
  createPtyClient2,
21
21
  createPersistentPtyClient2
22
- } from "../chunks/service-probe-gne7h7mq.js";
22
+ } from "../chunks/service-timing-gne7h7mq.js";
23
+ import {
24
+ createSessionRetention2
25
+ } from "../chunks/service-timing-6mq2wh8y.js";
23
26
  import {
24
27
  lastAssistantWithUsage2
25
- } from "../chunks/service-probe-8s2anffy.js";
28
+ } from "../chunks/service-timing-8s2anffy.js";
26
29
  export {
27
30
  createClientConnection2 as createClientConnection,
28
31
  createData2 as createData,
29
32
  createPersistentPtyClient2 as createPersistentPtyClient,
30
33
  createPtyClient2 as createPtyClient,
34
+ createSessionRetention2 as createSessionRetention,
31
35
  defaultIdleTimeout2 as defaultIdleTimeout,
32
36
  foregroundIdleThreshold2 as foregroundIdleThreshold,
33
37
  lastAssistantWithUsage2 as lastAssistantWithUsage,
package/dist/solid/pty.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createPtyClient2,
3
3
  createPersistentPtyClient2
4
- } from "../chunks/service-probe-gne7h7mq.js";
4
+ } from "../chunks/service-timing-gne7h7mq.js";
5
5
  export {
6
6
  createPersistentPtyClient2 as createPersistentPtyClient,
7
7
  createPtyClient2 as createPtyClient
@@ -0,0 +1,10 @@
1
+ import { type Accessor } from "solid-js";
2
+ import type { Data } from "./data";
3
+ export declare function createSessionRetention(input: {
4
+ session: Pick<Data["session"], "list" | "root" | "evict"> & {
5
+ message?: Pick<Data["session"]["message"], "list">;
6
+ };
7
+ current: Accessor<string | undefined>;
8
+ keep: Accessor<readonly string[]>;
9
+ limit: number;
10
+ }): void;
@@ -0,0 +1,6 @@
1
+ import {
2
+ createSessionRetention2
3
+ } from "../chunks/service-timing-6mq2wh8y.js";
4
+ export {
5
+ createSessionRetention2 as createSessionRetention
6
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  lastAssistantWithUsage2
3
- } from "../chunks/service-probe-8s2anffy.js";
3
+ } from "../chunks/service-timing-8s2anffy.js";
4
4
  export {
5
5
  lastAssistantWithUsage2 as lastAssistantWithUsage
6
6
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode/client",
4
- "version": "2.1.3",
4
+ "version": "2.2.0",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -47,18 +47,24 @@
47
47
  "./effect/service": {
48
48
  "import": "./dist/effect/service.js",
49
49
  "types": "./dist/effect/service.d.ts"
50
+ },
51
+ "./mcp": {
52
+ "import": "./dist/mcp.js",
53
+ "types": "./dist/mcp.d.ts"
50
54
  }
51
55
  },
52
56
  "scripts": {
53
- "build": "bun run script/build-package.ts",
54
- "generate": "bun run script/build.ts",
57
+ "build": "bun run script/build.ts",
58
+ "pack": "bun run script/pack.ts",
59
+ "generate": "bun run script/generate.ts",
55
60
  "check:generated": "bun run generate && git diff --exit-code -- src/promise/generated src/effect/generated src/effect/api",
56
61
  "test": "bun test --timeout 5000",
57
- "typecheck": "tsc --noEmit"
62
+ "typecheck": "bun check --no-script",
63
+ "typecheck:tsc": "tsc --noEmit"
58
64
  },
59
65
  "dependencies": {
60
- "@opencode/schema": "2.1.3",
61
- "@opencode/protocol": "2.1.3"
66
+ "@opencode/schema": "2.2.0",
67
+ "@opencode/protocol": "2.2.0"
62
68
  },
63
69
  "peerDependencies": {
64
70
  "effect": "4.0.1",
@@ -74,10 +80,11 @@
74
80
  },
75
81
  "devDependencies": {
76
82
  "@effect/platform-node": "4.0.1",
77
- "@opencode/httpapi-codegen": "2.1.3",
83
+ "@modelcontextprotocol/client": "2.3.1",
84
+ "@opencode/httpapi-codegen": "2.2.0",
78
85
  "@tsconfig/bun": "1.0.9",
79
86
  "@types/bun": "1.4.3",
80
- "@typescript/native": "npm:typescript@7.0.2",
87
+ "@typescript/native": "npm:typescript@7.1.0-beta",
81
88
  "effect": "4.0.1",
82
89
  "solid-js": "1.9.15"
83
90
  }
@@ -1,30 +0,0 @@
1
- import {
2
- make7
3
- } from "./service-probe-8bbb028w.js";
4
- import {
5
- make6
6
- } from "./service-probe-g22sa7qz.js";
7
- import {
8
- makeRpc2
9
- } from "./service-probe-6vp15eh6.js";
10
- import {
11
- __export
12
- } from "./service-probe-9rqn6x4v.js";
13
-
14
- // src/promise/client.ts
15
- var exports_client3 = {};
16
- __export(exports_client3, {
17
- OpenCode: () => exports_client3,
18
- make: () => make5
19
- });
20
- function make5(options) {
21
- const raw = make6(options);
22
- const events = make7((signal, onActivity) => raw.event.subscribe({ signal, onActivity }));
23
- return {
24
- ...raw,
25
- rpc: Object.assign(makeRpc2(raw, events), raw.rpc),
26
- event: events
27
- };
28
- }
29
-
30
- export { make5, exports_client3 };