@opencode/client 2.0.23 → 2.0.25

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-version-02j88w0z.js → service-probe-1thtawyv.js} +1 -1
  2. package/dist/chunks/{service-version-1y4a697q.js → service-probe-1y4a697q.js} +1 -1
  3. package/dist/chunks/service-probe-2ny4vxct.js +92 -0
  4. package/dist/chunks/{service-version-z6qdwcsf.js → service-probe-65kht65h.js} +5 -5
  5. package/dist/chunks/{service-version-nyqggzs9.js → service-probe-9h52wrcy.js} +11 -2
  6. package/dist/chunks/{service-version-frbwqjmf.js → service-probe-frbwqjmf.js} +1 -1
  7. package/dist/chunks/{service-version-t1xa31vm.js → service-probe-t1xa31vm.js} +1 -1
  8. package/dist/chunks/{service-version-e5ea35j7.js → service-probe-trz7kcxd.js} +23 -1
  9. package/dist/chunks/{service-version-6f43cgzz.js → service-probe-ve4aws36.js} +47 -2
  10. package/dist/chunks/{service-version-7yt87z36.js → service-probe-vnspkrex.js} +12 -7
  11. package/dist/chunks/{service-version-21favj1f.js → service-probe-y99g37y2.js} +9 -9
  12. package/dist/chunks/{service-version-gah0fg5v.js → service-probe-z1hcmzxa.js} +4 -4
  13. package/dist/contract.js +1 -1
  14. package/dist/effect/api/api.d.ts +12 -0
  15. package/dist/effect/client.d.ts +1 -0
  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 +2 -1
  19. package/dist/effect/generated/client.js +5 -5
  20. package/dist/effect/generated/index.js +4 -4
  21. package/dist/effect/index.js +8 -8
  22. package/dist/effect/rpc.js +4 -4
  23. package/dist/effect/service.d.ts +19 -7
  24. package/dist/effect/service.js +49 -137
  25. package/dist/promise/client.d.ts +1 -0
  26. package/dist/promise/client.js +7 -7
  27. package/dist/promise/generated/client-error.js +1 -1
  28. package/dist/promise/generated/client.d.ts +2 -1
  29. package/dist/promise/generated/client.js +2 -2
  30. package/dist/promise/generated/index.js +8 -8
  31. package/dist/promise/generated/types.d.ts +81 -4
  32. package/dist/promise/generated/types.js +1 -1
  33. package/dist/promise/index.js +10 -10
  34. package/dist/promise/rpc.js +2 -2
  35. package/dist/promise/service.d.ts +2 -4
  36. package/dist/promise/service.js +43 -134
  37. package/dist/pty-handoff.js +1 -1
  38. package/dist/rpc-runtime.js +1 -1
  39. package/dist/service-contender.d.ts +27 -1
  40. package/dist/service-contender.js +3 -3
  41. package/dist/service-probe.d.ts +70 -0
  42. package/dist/service-probe.js +16 -0
  43. package/dist/service-timing.js +1 -1
  44. package/dist/service-version.js +1 -1
  45. package/dist/service.js +1 -1
  46. package/dist/shared-events.js +1 -1
  47. package/dist/solid/connection.js +1 -1
  48. package/dist/solid/data.d.ts +10 -0
  49. package/dist/solid/data.js +9 -9
  50. package/dist/solid/index.js +11 -11
  51. package/dist/solid/pty.js +1 -1
  52. package/package.json +5 -6
  53. /package/dist/chunks/{service-version-6mptkzbc.js → service-probe-6mptkzbc.js} +0 -0
  54. /package/dist/chunks/{service-version-9rqn6x4v.js → service-probe-9rqn6x4v.js} +0 -0
  55. /package/dist/chunks/{service-version-gne7h7mq.js → service-probe-gne7h7mq.js} +0 -0
  56. /package/dist/chunks/{service-version-m2eywc8w.js → service-probe-m2eywc8w.js} +0 -0
  57. /package/dist/chunks/{service-version-nwcpakzx.js → service-probe-nwcpakzx.js} +0 -0
  58. /package/dist/chunks/{service-version-qav6mfdz.js → service-probe-qav6mfdz.js} +0 -0
  59. /package/dist/chunks/{service-version-sxt88q69.js → service-probe-sxt88q69.js} +0 -0
  60. /package/dist/chunks/{service-version-vmytr4q8.js → service-probe-vmytr4q8.js} +0 -0
  61. /package/dist/chunks/{service-version-vt9jbch8.js → service-probe-vt9jbch8.js} +0 -0
  62. /package/dist/chunks/{service-version-vyas3vgt.js → service-probe-vyas3vgt.js} +0 -0
  63. /package/dist/chunks/{service-version-xgnj2w4v.js → service-probe-xgnj2w4v.js} +0 -0
  64. /package/dist/chunks/{service-version-y2etg5bs.js → service-probe-y2etg5bs.js} +0 -0
  65. /package/dist/chunks/{service-version-ydhz1zrh.js → service-probe-ydhz1zrh.js} +0 -0
@@ -1,6 +1,8 @@
1
1
  import { Effect, FileSystem, Schema } from "effect";
2
- import type { DiscoverOptions, Endpoint, EnsureOptions, StopOptions } from "../service.js";
2
+ import type { DiscoverOptions, EnsureOptions, StopOptions } from "../service.js";
3
+ import { headers } from "../service-probe.js";
3
4
  export * from "../service.js";
5
+ export { headers };
4
6
  /** Contents of the local service registration file. */
5
7
  export type Info = import("../service.js").Info;
6
8
  /** Discover a healthy, compatible local service without starting one. */
@@ -27,13 +29,16 @@ export declare const incumbent: (options: DiscoverOptions & {
27
29
  state: "failed" | "ready" | "waiting";
28
30
  } | undefined, never, FileSystem.FileSystem>;
29
31
  /** Ensure a healthy, compatible local service is running. */
30
- export declare const ensure: (options?: EnsureOptions | undefined) => Effect.Effect<Endpoint, Error, FileSystem.FileSystem>;
32
+ export declare const ensure: (options?: EnsureOptions | undefined) => Effect.Effect<{
33
+ url: string;
34
+ auth: {
35
+ type: "basic";
36
+ username: string;
37
+ password: string;
38
+ } | undefined;
39
+ }, Error, FileSystem.FileSystem>;
31
40
  /** Stop the registered local service. */
32
41
  export declare const stop: (options?: StopOptions | undefined) => Effect.Effect<void, Error, FileSystem.FileSystem>;
33
- /** Create HTTP authentication headers for a service endpoint. */
34
- export declare function headers(endpoint: Endpoint): {
35
- authorization: string;
36
- } | undefined;
37
42
  /** Schema for the local service registration file. */
38
43
  export declare const Info: Schema.Struct<{
39
44
  readonly id: Schema.optional<Schema.String>;
@@ -65,7 +70,14 @@ export declare const Service: {
65
70
  };
66
71
  state: "failed" | "ready" | "waiting";
67
72
  } | undefined, never, FileSystem.FileSystem>;
68
- ensure: (options?: EnsureOptions | undefined) => Effect.Effect<Endpoint, Error, FileSystem.FileSystem>;
73
+ ensure: (options?: EnsureOptions | undefined) => Effect.Effect<{
74
+ url: string;
75
+ auth: {
76
+ type: "basic";
77
+ username: string;
78
+ password: string;
79
+ } | undefined;
80
+ }, Error, FileSystem.FileSystem>;
69
81
  stop: (options?: StopOptions | undefined) => Effect.Effect<void, Error, FileSystem.FileSystem>;
70
82
  headers: typeof headers;
71
83
  Info: Schema.Struct<{
@@ -1,27 +1,31 @@
1
1
  import {
2
2
  spawnServiceContender2,
3
- contenderFailure2,
4
- contenderFinished2
5
- } from "../chunks/service-version-6f43cgzz.js";
3
+ contenderPool2
4
+ } from "../chunks/service-probe-ve4aws36.js";
6
5
  import {
7
6
  defaultEnsureTiming2,
8
7
  ensureTiming2
9
- } from "../chunks/service-version-xgnj2w4v.js";
8
+ } from "../chunks/service-probe-xgnj2w4v.js";
10
9
  import {
11
10
  matchesVersion2
12
- } from "../chunks/service-version-sxt88q69.js";
11
+ } from "../chunks/service-probe-sxt88q69.js";
13
12
  import {
14
13
  prepare2,
15
14
  environment2,
16
15
  complete2,
17
16
  clear2
18
- } from "../chunks/service-version-02j88w0z.js";
19
- import"../chunks/service-version-qav6mfdz.js";
17
+ } from "../chunks/service-probe-1thtawyv.js";
18
+ import {
19
+ decide2,
20
+ fallback2,
21
+ same2,
22
+ probeResult2,
23
+ headers2
24
+ } from "../chunks/service-probe-2ny4vxct.js";
25
+ import"../chunks/service-probe-qav6mfdz.js";
20
26
 
21
27
  // src/effect/service.ts
22
28
  import { Effect, FileSystem, Option, Schedule, Schema } from "effect";
23
- import { homedir } from "node:os";
24
- import { join } from "node:path";
25
29
  var discover = Effect.fn("service.discover")(function* (options = {}) {
26
30
  const found = (yield* registered(options.file)).service;
27
31
  if (found?.state !== "ready")
@@ -34,10 +38,10 @@ var discover = Effect.fn("service.discover")(function* (options = {}) {
34
38
  });
35
39
  var incumbent = Effect.fn("service.incumbent")(function* (options) {
36
40
  const info = yield* read(options.file);
37
- const found = info === undefined ? undefined : yield* probe({ ...info, url: options.url });
38
- if (found === undefined)
41
+ if (info === undefined)
39
42
  return;
40
- if (!found.compatible)
43
+ const found = (yield* Effect.promise(() => probeResult2({ ...info, url: options.url }))).service;
44
+ if (!found?.compatible)
41
45
  return;
42
46
  if (!matchesVersion2(found.version, options))
43
47
  return;
@@ -45,12 +49,9 @@ var incumbent = Effect.fn("service.incumbent")(function* (options) {
45
49
  });
46
50
  var ensure = Effect.fn("service.ensure")(function* (options = {}) {
47
51
  const timing = ensureTiming2(options);
48
- const contenders = new Set;
52
+ const pool = contenderPool2(timing);
49
53
  let timeouts;
50
54
  let announced = false;
51
- let lastSpawn = 0;
52
- let spawnDelay = timing.spawnDelay;
53
- let failure;
54
55
  const announce = (reason, previousVersion) => Effect.sync(() => {
55
56
  if (announced)
56
57
  return;
@@ -61,7 +62,7 @@ var ensure = Effect.fn("service.ensure")(function* (options = {}) {
61
62
  const [command, ...args] = options.command ?? ["opencode", "serve", "--service"];
62
63
  if (command === undefined)
63
64
  return yield* Effect.fail(new Error("Missing service command"));
64
- const env = yield* Effect.tryPromise(() => environment2(options.file ?? fallback(), options.env));
65
+ const env = yield* Effect.tryPromise(() => environment2(options.file ?? fallback2(), options.env));
65
66
  return yield* Effect.try({
66
67
  try: () => {
67
68
  return spawnServiceContender2(command, args, env);
@@ -76,94 +77,59 @@ var ensure = Effect.fn("service.ensure")(function* (options = {}) {
76
77
  if (registration.timedOut && info !== undefined) {
77
78
  timeouts = {
78
79
  info,
79
- count: timeouts !== undefined && same(timeouts.info, info) ? timeouts.count + 1 : 1
80
+ count: timeouts !== undefined && same2(timeouts.info, info) ? timeouts.count + 1 : 1
80
81
  };
81
82
  if (timeouts.count >= 3) {
82
83
  yield* announce("missing");
83
84
  yield* Effect.logWarning("Background service is unresponsive; recovery cannot preserve persistent terminals");
84
- yield* Effect.tryPromise(() => clear2(options.file ?? fallback()));
85
+ yield* Effect.tryPromise(() => clear2(options.file ?? fallback2()));
85
86
  yield* terminate(info, options, timing);
86
- for (const item of contenders) {
87
- if (item.child.pid === info.pid || contenderFinished2(item)) {
88
- item.release();
89
- contenders.delete(item);
90
- }
91
- }
92
- failure = undefined;
87
+ pool.evict(info.pid);
88
+ pool.recruitNow();
93
89
  timeouts = undefined;
94
- lastSpawn = Date.now() - spawnDelay;
95
90
  }
96
91
  } else
97
92
  timeouts = undefined;
98
93
  if (service2 !== undefined) {
99
- spawnDelay = timing.spawnDelay;
100
- const versionMatches = matchesVersion2(service2.version, options);
101
- const compatible = service2.compatible && versionMatches;
102
- if (!service2.compatible && versionMatches)
103
- return yield* Effect.fail(new Error("Background service uses an incompatible health protocol. Update this client or explicitly restart the service."));
104
- if (compatible && service2.state === "ready") {
105
- yield* Effect.tryPromise(() => complete2(options.file ?? fallback(), service2.info));
94
+ pool.serviceAnswered();
95
+ const decision = decide2(service2, options);
96
+ if (decision._tag === "fail")
97
+ return yield* Effect.fail(decision.error);
98
+ if (decision._tag === "reuse") {
99
+ yield* Effect.tryPromise(() => complete2(options.file ?? fallback2(), service2.info));
106
100
  return Option.some(service2);
107
101
  }
108
- if (compatible && service2.state === "failed")
109
- return yield* Effect.fail(new Error("Background service failed to start"));
110
- if (compatible)
111
- return Option.none();
112
- yield* announce("version-mismatch", service2.version);
113
- if (service2.state !== "ready")
114
- yield* Effect.logWarning("Background service is not ready; replacement cannot preserve persistent terminals");
115
- yield* stop({
116
- file: options.file,
117
- pty: service2.state === "ready" ? "handoff" : "clear"
118
- }).pipe(Effect.ignore);
119
- for (const item of contenders) {
120
- if (item.child.pid === service2.info.pid || contenderFinished2(item)) {
121
- item.release();
122
- contenders.delete(item);
123
- }
102
+ if (decision._tag === "replace") {
103
+ yield* announce("version-mismatch", service2.version);
104
+ if (service2.state !== "ready")
105
+ yield* Effect.logWarning("Background service is not ready; replacement cannot preserve persistent terminals");
106
+ yield* stop({ file: options.file, pty: decision.pty }).pipe(Effect.ignore);
107
+ pool.evict(service2.info.pid);
124
108
  }
125
- failure = undefined;
126
- lastSpawn = 0;
127
109
  return Option.none();
128
- } else if (lastSpawn === 0 && info !== undefined)
129
- lastSpawn = Date.now();
130
- const finished = [...contenders].filter(contenderFinished2);
131
- failure ??= finished.map(contenderFailure2).find((error) => error !== undefined);
132
- if (finished.some((item) => item.child.exitCode === 0)) {
133
- spawnDelay = Math.min(spawnDelay * 2, timing.maxSpawnDelay);
134
110
  }
135
- finished.forEach((item) => contenders.delete(item));
136
- if (failure !== undefined && contenders.size === 0)
137
- return yield* Effect.fail(failure);
138
- if (failure === undefined && contenders.size < 2 && Date.now() - lastSpawn >= spawnDelay) {
111
+ const failed = pool.reap();
112
+ if (failed !== undefined)
113
+ return yield* Effect.fail(failed);
114
+ if (pool.shouldRecruit(info !== undefined)) {
139
115
  yield* announce("missing");
140
- contenders.add(yield* spawnContender);
141
- lastSpawn = Date.now();
116
+ pool.add(yield* spawnContender);
142
117
  }
143
118
  return Option.none();
144
119
  }).pipe(Effect.repeat({
145
120
  until: Option.isSome,
146
121
  schedule: Schedule.spaced(timing.pollInterval).pipe(Schedule.upTo({ duration: timing.promiseTimeout }))
147
- }), Effect.ensuring(Effect.sync(() => contenders.forEach((contender) => contender.release()))));
122
+ }), Effect.ensuring(Effect.sync(() => pool.releaseAll())));
148
123
  if (Option.isNone(found))
149
- return yield* Effect.fail(failure ?? new Error("Timed out waiting for the background service to start"));
124
+ return yield* Effect.fail(pool.failure() ?? new Error("Timed out waiting for the background service to start"));
150
125
  return found.value.endpoint;
151
126
  });
152
127
  var stop = Effect.fn("service.stop")(function* (options = {}) {
153
128
  const info = yield* read(options.file);
154
- yield* Effect.tryPromise(() => options.pty === "handoff" && info !== undefined ? prepare2(options.file ?? fallback(), info, defaultEnsureTiming2.requestTimeout) : clear2(options.file ?? fallback())).pipe(Effect.catch((cause) => Effect.logWarning("Failed to prepare persistent terminals for replacement", cause)));
129
+ yield* Effect.tryPromise(() => options.pty === "handoff" && info !== undefined ? prepare2(options.file ?? fallback2(), info, defaultEnsureTiming2.requestTimeout) : clear2(options.file ?? fallback2())).pipe(Effect.catch((cause) => Effect.logWarning("Failed to prepare persistent terminals for replacement", cause)));
155
130
  if (info !== undefined)
156
131
  yield* terminate(info, options, ensureTiming2(options));
157
132
  });
158
- function fallback() {
159
- const state = process.env["XDG_STATE_HOME"] ?? join(homedir(), ".local", "state");
160
- return join(state, "opencode", "service.json");
161
- }
162
- function headers(endpoint) {
163
- if (endpoint.auth === undefined)
164
- return;
165
- return { authorization: "Basic " + btoa(endpoint.auth.username + ":" + endpoint.auth.password) };
166
- }
167
133
  var Info = Schema.Struct({
168
134
  id: Schema.optional(Schema.String),
169
135
  version: Schema.optional(Schema.String),
@@ -172,69 +138,18 @@ var Info = Schema.Struct({
172
138
  password: Schema.optional(Schema.String)
173
139
  });
174
140
  var decode = Schema.decodeUnknownEffect(Schema.fromJsonString(Info));
175
- var decodeInfo = Schema.decodeUnknownOption(Schema.Struct({
176
- version: Schema.String,
177
- pid: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))
178
- }));
179
141
  var read = Effect.fnUntraced(function* (file) {
180
142
  const fs = yield* FileSystem.FileSystem;
181
- const text = yield* fs.readFileString(file ?? fallback()).pipe(Effect.option);
143
+ const text = yield* fs.readFileString(file ?? fallback2()).pipe(Effect.option);
182
144
  if (Option.isNone(text))
183
145
  return;
184
146
  return yield* decode(text.value).pipe(Effect.option, Effect.map(Option.getOrUndefined));
185
147
  });
186
- var probe = Effect.fnUntraced(function* (info) {
187
- return (yield* probeResult(info)).service;
188
- });
189
- var probeResult = Effect.fnUntraced(function* (info, timeout = defaultEnsureTiming2.requestTimeout) {
190
- const endpoint = {
191
- url: info.url,
192
- auth: info.password === undefined ? undefined : { type: "basic", username: "opencode", password: info.password }
193
- };
194
- const signal = AbortSignal.timeout(timeout);
195
- const result = yield* Effect.promise(() => fetch(new URL("/api/info", info.url), { headers: headers(endpoint), signal }).then(async (response) => ({
196
- response,
197
- body: response.status === 404 ? undefined : await response.json()
198
- })).then((value) => ({ value }), (cause) => ({ cause })));
199
- if ("cause" in result)
200
- return { service: undefined, timedOut: signal.aborted };
201
- const response = result.value.response;
202
- if (response.status === 404)
203
- return {
204
- service: {
205
- info,
206
- endpoint,
207
- version: info.version,
208
- state: "ready",
209
- compatible: false
210
- },
211
- timedOut: false
212
- };
213
- const body = result.value.body;
214
- const serverInfo = decodeInfo(body);
215
- if (Option.isSome(serverInfo)) {
216
- if (serverInfo.value.pid !== info.pid)
217
- return { service: undefined, timedOut: false };
218
- if (info.version !== undefined && serverInfo.value.version !== info.version)
219
- return { service: undefined, timedOut: false };
220
- return {
221
- service: {
222
- info,
223
- endpoint,
224
- version: serverInfo.value.version,
225
- state: response.ok ? "ready" : response.status === 500 ? "failed" : "waiting",
226
- compatible: true
227
- },
228
- timedOut: false
229
- };
230
- }
231
- return { service: undefined, timedOut: false };
232
- });
233
148
  var registered = Effect.fnUntraced(function* (file, timeout) {
234
149
  const info = yield* read(file);
235
150
  if (info === undefined)
236
151
  return { info: undefined, service: undefined, timedOut: false };
237
- return { info, ...yield* probeResult(info, timeout) };
152
+ return { info, ...yield* Effect.promise(() => probeResult2(info, timeout)) };
238
153
  });
239
154
  var poll = (timing) => Schedule.max([Schedule.spaced(timing.stopPollInterval), Schedule.recurs(timing.stopPollAttempts)]);
240
155
  var signal = (pid, name) => Effect.try({ try: () => process.kill(pid, name), catch: (cause) => cause }).pipe(Effect.ignore);
@@ -244,12 +159,9 @@ var stopped = Effect.fnUntraced(function* (pid) {
244
159
  return true;
245
160
  return yield* Effect.fail(new Error(`Server process ${pid} is still running`));
246
161
  });
247
- function same(left, right) {
248
- return left.id === right.id && left.version === right.version && left.url === right.url && left.pid === right.pid;
249
- }
250
162
  var terminate = Effect.fnUntraced(function* (info, options, timing) {
251
163
  const current = yield* read(options.file);
252
- if (current === undefined || !same(current, info))
164
+ if (current === undefined || !same2(current, info))
253
165
  return;
254
166
  yield* signal(info.pid, "SIGTERM");
255
167
  const done = yield* stopped(info.pid).pipe(Effect.retry(poll(timing)), Effect.option);
@@ -258,18 +170,18 @@ var terminate = Effect.fnUntraced(function* (info, options, timing) {
258
170
  yield* stopped(info.pid).pipe(Effect.retry(poll(timing)));
259
171
  }
260
172
  const latest = yield* read(options.file);
261
- if (latest === undefined || !same(latest, info))
173
+ if (latest === undefined || !same2(latest, info))
262
174
  return;
263
175
  const fs = yield* FileSystem.FileSystem;
264
- yield* fs.remove(options.file ?? fallback()).pipe(Effect.ignore);
176
+ yield* fs.remove(options.file ?? fallback2()).pipe(Effect.ignore);
265
177
  });
266
- var Service = { discover, incumbent, ensure, stop, headers, Info };
178
+ var Service = { discover, incumbent, ensure, stop, headers: headers2, Info };
267
179
  export {
268
180
  Info,
269
181
  Service,
270
182
  discover,
271
183
  ensure,
272
- headers,
184
+ headers2 as headers,
273
185
  incumbent,
274
186
  stop
275
187
  };
@@ -113,6 +113,7 @@ export declare function make(options: ClientOptions): {
113
113
  };
114
114
  connect: {
115
115
  key: (input: import("./index.js").IntegrationConnectKeyInput, requestOptions?: OpenCode.RequestOptions) => Promise<void>;
116
+ external: (input: import("./index.js").IntegrationConnectExternalInput, requestOptions?: OpenCode.RequestOptions) => Promise<void>;
116
117
  };
117
118
  oauth: {
118
119
  connect: (input: import("./index.js").IntegrationOauthConnectInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").IntegrationOauthConnectOutput>;
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  make5,
3
3
  exports_client3
4
- } from "../chunks/service-version-gah0fg5v.js";
5
- import"../chunks/service-version-vyas3vgt.js";
6
- import"../chunks/service-version-nyqggzs9.js";
7
- import"../chunks/service-version-nwcpakzx.js";
8
- import"../chunks/service-version-1y4a697q.js";
9
- import"../chunks/service-version-vt9jbch8.js";
10
- import"../chunks/service-version-frbwqjmf.js";
4
+ } from "../chunks/service-probe-z1hcmzxa.js";
5
+ import"../chunks/service-probe-vyas3vgt.js";
6
+ import"../chunks/service-probe-1y4a697q.js";
7
+ import"../chunks/service-probe-vt9jbch8.js";
8
+ import"../chunks/service-probe-9h52wrcy.js";
9
+ import"../chunks/service-probe-nwcpakzx.js";
10
+ import"../chunks/service-probe-frbwqjmf.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-version-nwcpakzx.js";
3
+ } from "../../chunks/service-probe-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, ProviderListInput, ProviderListOutput, ProviderGetInput, ProviderGetOutput, IntegrationListInput, IntegrationListOutput, IntegrationGetInput, IntegrationGetOutput, IntegrationWellknownAddInput, IntegrationConnectKeyInput, IntegrationOauthConnectInput, IntegrationOauthConnectOutput, IntegrationOauthStatusInput, IntegrationOauthStatusOutput, IntegrationOauthCompleteInput, IntegrationOauthCancelInput, IntegrationCommandConnectInput, IntegrationCommandConnectOutput, IntegrationCommandStatusInput, IntegrationCommandStatusOutput, IntegrationCommandCancelInput, McpListInput, McpListOutput, McpAddInput, McpRemoveInput, McpConnectInput, McpDisconnectInput, McpResourceCatalogInput, McpResourceCatalogOutput, CredentialCreateInput, CredentialUpdateInput, CredentialActivateInput, CredentialRemoveInput, ProjectListOutput, ProjectUpdateInput, FormListInput, FormListOutput, PermissionRequestListInput, PermissionRequestListOutput, PermissionSavedListInput, 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, 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, ProjectListOutput, ProjectUpdateInput, FormListInput, FormListOutput, PermissionRequestListInput, PermissionRequestListOutput, PermissionSavedListInput, 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";
2
2
  export interface ClientOptions {
3
3
  readonly baseUrl: string;
4
4
  readonly fetch?: typeof globalThis.fetch;
@@ -114,6 +114,7 @@ export declare function make(options: ClientOptions): {
114
114
  };
115
115
  connect: {
116
116
  key: (input: IntegrationConnectKeyInput, requestOptions?: RequestOptions) => Promise<void>;
117
+ external: (input: IntegrationConnectExternalInput, requestOptions?: RequestOptions) => Promise<void>;
117
118
  };
118
119
  oauth: {
119
120
  connect: (input: IntegrationOauthConnectInput, requestOptions?: RequestOptions) => Promise<IntegrationOauthConnectOutput>;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  make6
3
- } from "../../chunks/service-version-nyqggzs9.js";
4
- import"../../chunks/service-version-nwcpakzx.js";
3
+ } from "../../chunks/service-probe-9h52wrcy.js";
4
+ import"../../chunks/service-probe-nwcpakzx.js";
5
5
  export {
6
6
  make6 as make
7
7
  };
@@ -1,10 +1,4 @@
1
- import"../../chunks/service-version-vyas3vgt.js";
2
- import {
3
- exports_client4
4
- } from "../../chunks/service-version-nyqggzs9.js";
5
- import {
6
- ClientError3
7
- } from "../../chunks/service-version-nwcpakzx.js";
1
+ import"../../chunks/service-probe-vyas3vgt.js";
8
2
  import {
9
3
  isInvalidRequestError2,
10
4
  isUnauthorizedError2,
@@ -39,7 +33,13 @@ import {
39
33
  isShellNotFoundError2,
40
34
  isWorktreeError2,
41
35
  isVcsInitNotSupportedError2
42
- } from "../../chunks/service-version-vt9jbch8.js";
36
+ } from "../../chunks/service-probe-vt9jbch8.js";
37
+ import {
38
+ exports_client4
39
+ } from "../../chunks/service-probe-9h52wrcy.js";
40
+ import {
41
+ ClientError3
42
+ } from "../../chunks/service-probe-nwcpakzx.js";
43
43
  export {
44
44
  ClientError3 as ClientError,
45
45
  exports_client4 as OpenCode,
@@ -496,6 +496,13 @@ export type CredentialOAuth = {
496
496
  [x: string]: JsonValue;
497
497
  };
498
498
  };
499
+ export type CredentialExternal = {
500
+ type: "external";
501
+ methodID: string;
502
+ metadata?: {
503
+ [x: string]: JsonValue;
504
+ };
505
+ };
499
506
  export type ProjectVcs = string;
500
507
  export type ProjectIcon = {
501
508
  url?: string;
@@ -2207,6 +2214,8 @@ export type ModelCompatibility = {
2207
2214
  requireFinishReason?: boolean;
2208
2215
  requireAssistantAfterTool?: boolean;
2209
2216
  supportsPromptCacheKey?: boolean;
2217
+ supportsThinkingBlockBinding?: boolean;
2218
+ supportsEffortUpdates?: boolean;
2210
2219
  };
2211
2220
  export type ModelCost = {
2212
2221
  tier?: {
@@ -2224,7 +2233,7 @@ export type ConnectionCredentialInfo = {
2224
2233
  type: "credential";
2225
2234
  id: string;
2226
2235
  label: string;
2227
- method: "key" | "oauth";
2236
+ method: "key" | "oauth" | "external";
2228
2237
  status?: ConnectionStatus;
2229
2238
  };
2230
2239
  export type ConnectionEnvInfo = {
@@ -3136,7 +3145,7 @@ export type ConfigEntry = {
3136
3145
  portable_shell_scanner?: boolean;
3137
3146
  subagent_depth?: number;
3138
3147
  policies?: Array<{
3139
- action: "provider.use" | "permission";
3148
+ action: "provider.use" | "tool.use" | "integration.use";
3140
3149
  resource: string;
3141
3150
  effect: "allow" | "deny";
3142
3151
  }>;
@@ -3203,7 +3212,7 @@ export type SessionMessageAssistantTool1 = {
3203
3212
  };
3204
3213
  };
3205
3214
  export type FormFields = [FormField, ...Array<FormField>];
3206
- export type CredentialValue = CredentialOAuth | CredentialKey;
3215
+ export type CredentialValue = CredentialOAuth | CredentialKey | CredentialExternal;
3207
3216
  export type FormFields2 = [FormField1, ...Array<FormField1>];
3208
3217
  export type SessionsResponse = {
3209
3218
  data: Array<SessionInfo>;
@@ -3286,6 +3295,12 @@ export type IntegrationKeyMethod = {
3286
3295
  label?: string;
3287
3296
  form?: FormFields;
3288
3297
  };
3298
+ export type IntegrationExternalMethod = {
3299
+ id: string;
3300
+ type: "external";
3301
+ label: string;
3302
+ form?: FormFields;
3303
+ };
3289
3304
  export type CredentialEntry = {
3290
3305
  id: string;
3291
3306
  integrationID: string;
@@ -3320,7 +3335,7 @@ export type SessionMessageContentUpdated = {
3320
3335
  content: Array<SessionMessageAssistantContentEncoded>;
3321
3336
  };
3322
3337
  };
3323
- export type IntegrationMethod = IntegrationOAuthMethod | IntegrationCommandMethod | IntegrationKeyMethod | IntegrationEnvMethod;
3338
+ export type IntegrationMethod = IntegrationOAuthMethod | IntegrationCommandMethod | IntegrationKeyMethod | IntegrationExternalMethod | IntegrationEnvMethod;
3324
3339
  export type FormCreated = {
3325
3340
  id: string;
3326
3341
  created: number;
@@ -7322,6 +7337,38 @@ export type IntegrationConnectKeyInput = {
7322
7337
  }["label"];
7323
7338
  };
7324
7339
  export type IntegrationConnectKeyOutput = void;
7340
+ export type IntegrationConnectExternalInput = {
7341
+ readonly integrationID: {
7342
+ readonly integrationID: string;
7343
+ }["integrationID"];
7344
+ readonly location?: {
7345
+ readonly location?: {
7346
+ readonly directory?: string | undefined;
7347
+ } | undefined;
7348
+ }["location"];
7349
+ readonly methodID: {
7350
+ readonly methodID: string;
7351
+ readonly answer?: {
7352
+ readonly [x: string]: string | number | boolean | ReadonlyArray<string>;
7353
+ } | undefined;
7354
+ readonly label?: string | undefined;
7355
+ }["methodID"];
7356
+ readonly answer?: {
7357
+ readonly methodID: string;
7358
+ readonly answer?: {
7359
+ readonly [x: string]: string | number | boolean | ReadonlyArray<string>;
7360
+ } | undefined;
7361
+ readonly label?: string | undefined;
7362
+ }["answer"];
7363
+ readonly label?: {
7364
+ readonly methodID: string;
7365
+ readonly answer?: {
7366
+ readonly [x: string]: string | number | boolean | ReadonlyArray<string>;
7367
+ } | undefined;
7368
+ readonly label?: string | undefined;
7369
+ }["label"];
7370
+ };
7371
+ export type IntegrationConnectExternalOutput = void;
7325
7372
  export type IntegrationOauthConnectInput = {
7326
7373
  readonly integrationID: {
7327
7374
  readonly integrationID: string;
@@ -7600,6 +7647,12 @@ export type CredentialCreateInput = {
7600
7647
  readonly configuration?: {
7601
7648
  readonly [x: string]: string | number | "Infinity" | "-Infinity" | "NaN" | boolean | ReadonlyArray<string>;
7602
7649
  };
7650
+ } | {
7651
+ readonly type: "external";
7652
+ readonly methodID: string;
7653
+ readonly metadata?: {
7654
+ readonly [x: string]: JsonValue;
7655
+ };
7603
7656
  };
7604
7657
  readonly activate?: boolean;
7605
7658
  }["id"];
@@ -7625,6 +7678,12 @@ export type CredentialCreateInput = {
7625
7678
  readonly configuration?: {
7626
7679
  readonly [x: string]: string | number | "Infinity" | "-Infinity" | "NaN" | boolean | ReadonlyArray<string>;
7627
7680
  };
7681
+ } | {
7682
+ readonly type: "external";
7683
+ readonly methodID: string;
7684
+ readonly metadata?: {
7685
+ readonly [x: string]: JsonValue;
7686
+ };
7628
7687
  };
7629
7688
  readonly activate?: boolean;
7630
7689
  }["integrationID"];
@@ -7650,6 +7709,12 @@ export type CredentialCreateInput = {
7650
7709
  readonly configuration?: {
7651
7710
  readonly [x: string]: string | number | "Infinity" | "-Infinity" | "NaN" | boolean | ReadonlyArray<string>;
7652
7711
  };
7712
+ } | {
7713
+ readonly type: "external";
7714
+ readonly methodID: string;
7715
+ readonly metadata?: {
7716
+ readonly [x: string]: JsonValue;
7717
+ };
7653
7718
  };
7654
7719
  readonly activate?: boolean;
7655
7720
  }["label"];
@@ -7675,6 +7740,12 @@ export type CredentialCreateInput = {
7675
7740
  readonly configuration?: {
7676
7741
  readonly [x: string]: string | number | "Infinity" | "-Infinity" | "NaN" | boolean | ReadonlyArray<string>;
7677
7742
  };
7743
+ } | {
7744
+ readonly type: "external";
7745
+ readonly methodID: string;
7746
+ readonly metadata?: {
7747
+ readonly [x: string]: JsonValue;
7748
+ };
7678
7749
  };
7679
7750
  readonly activate?: boolean;
7680
7751
  }["value"];
@@ -7700,6 +7771,12 @@ export type CredentialCreateInput = {
7700
7771
  readonly configuration?: {
7701
7772
  readonly [x: string]: string | number | "Infinity" | "-Infinity" | "NaN" | boolean | ReadonlyArray<string>;
7702
7773
  };
7774
+ } | {
7775
+ readonly type: "external";
7776
+ readonly methodID: string;
7777
+ readonly metadata?: {
7778
+ readonly [x: string]: JsonValue;
7779
+ };
7703
7780
  };
7704
7781
  readonly activate?: boolean;
7705
7782
  }["activate"];
@@ -32,7 +32,7 @@ import {
32
32
  isShellNotFoundError2,
33
33
  isWorktreeError2,
34
34
  isVcsInitNotSupportedError2
35
- } from "../../chunks/service-version-vt9jbch8.js";
35
+ } from "../../chunks/service-probe-vt9jbch8.js";
36
36
  export {
37
37
  isAgentNotFoundError2 as isAgentNotFoundError,
38
38
  isCommandExecutionError2 as isCommandExecutionError,