@opencode/client 2.0.22 → 2.0.24

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 (67) hide show
  1. package/dist/chunks/{service-contender-1tbj6z39.js → pty-handoff-1y4a697q.js} +1 -1
  2. package/dist/chunks/{service-contender-mxz277s4.js → pty-handoff-5yf5aaev.js} +12 -10
  3. package/dist/chunks/{service-contender-1kn39gq3.js → pty-handoff-71wkqa80.js} +14 -21
  4. package/dist/chunks/{service-contender-y2etg5bs.js → pty-handoff-7f0py9js.js} +2 -2
  5. package/dist/chunks/pty-handoff-ank0d71z.js +75 -0
  6. package/dist/chunks/pty-handoff-cqfz2qxq.js +30 -0
  7. package/dist/chunks/{service-contender-frbwqjmf.js → pty-handoff-frbwqjmf.js} +1 -1
  8. package/dist/chunks/{service-contender-nwcpakzx.js → pty-handoff-js54wxgp.js} +2 -2
  9. package/dist/chunks/{service-contender-krgmp8b6.js → pty-handoff-myyn5x39.js} +17 -17
  10. package/dist/chunks/{service-contender-50fct660.js → pty-handoff-qzsnm4q8.js} +77 -63
  11. package/dist/chunks/{service-contender-h11j9btw.js → pty-handoff-src6by76.js} +10 -1
  12. package/dist/chunks/{service-contender-t1xa31vm.js → pty-handoff-t1xa31vm.js} +1 -1
  13. package/dist/chunks/{service-contender-txckps9j.js → pty-handoff-ve4aws36.js} +48 -2
  14. package/dist/chunks/{service-contender-4tveyqeh.js → pty-handoff-vt9jbch8.js} +4 -2
  15. package/dist/chunks/{service-contender-z6qdwcsf.js → pty-handoff-w1w809zr.js} +5 -5
  16. package/dist/contract.js +1 -1
  17. package/dist/effect/api/api.d.ts +12 -0
  18. package/dist/effect/client.d.ts +93 -92
  19. package/dist/effect/client.js +12 -12
  20. package/dist/effect/generated/client-error.js +3 -3
  21. package/dist/effect/generated/client.d.ts +93 -92
  22. package/dist/effect/generated/client.js +5 -5
  23. package/dist/effect/generated/index.js +8 -8
  24. package/dist/effect/index.js +12 -12
  25. package/dist/effect/rpc.js +4 -4
  26. package/dist/effect/service.d.ts +5 -7
  27. package/dist/effect/service.js +44 -115
  28. package/dist/promise/client.d.ts +1 -0
  29. package/dist/promise/client.js +11 -11
  30. package/dist/promise/generated/client-error.js +3 -3
  31. package/dist/promise/generated/client.d.ts +2 -1
  32. package/dist/promise/generated/client.js +4 -4
  33. package/dist/promise/generated/index.js +13 -9
  34. package/dist/promise/generated/types.d.ts +33 -0
  35. package/dist/promise/generated/types.js +6 -2
  36. package/dist/promise/index.js +17 -13
  37. package/dist/promise/rpc.js +2 -2
  38. package/dist/promise/service.d.ts +2 -4
  39. package/dist/promise/service.js +41 -115
  40. package/dist/pty-handoff.d.ts +4 -1
  41. package/dist/pty-handoff.js +1 -1
  42. package/dist/rpc-runtime.js +1 -1
  43. package/dist/service-contender.d.ts +27 -1
  44. package/dist/service-contender.js +3 -3
  45. package/dist/service-probe.d.ts +53 -0
  46. package/dist/service-probe.js +13 -0
  47. package/dist/service-timing.js +1 -1
  48. package/dist/service-version.js +1 -1
  49. package/dist/service.js +1 -1
  50. package/dist/shared-events.js +1 -1
  51. package/dist/solid/connection.js +1 -1
  52. package/dist/solid/data.d.ts +3 -0
  53. package/dist/solid/data.js +9 -9
  54. package/dist/solid/index.js +11 -11
  55. package/dist/solid/pty.js +1 -1
  56. package/package.json +4 -4
  57. package/dist/chunks/service-contender-992ffpa9.js +0 -30
  58. /package/dist/chunks/{service-contender-6mptkzbc.js → pty-handoff-6mptkzbc.js} +0 -0
  59. /package/dist/chunks/{service-contender-9rqn6x4v.js → pty-handoff-9rqn6x4v.js} +0 -0
  60. /package/dist/chunks/{service-contender-gne7h7mq.js → pty-handoff-gne7h7mq.js} +0 -0
  61. /package/dist/chunks/{service-contender-m2eywc8w.js → pty-handoff-m2eywc8w.js} +0 -0
  62. /package/dist/chunks/{service-contender-qav6mfdz.js → pty-handoff-qav6mfdz.js} +0 -0
  63. /package/dist/chunks/{service-contender-sxt88q69.js → pty-handoff-sxt88q69.js} +0 -0
  64. /package/dist/chunks/{service-contender-vmytr4q8.js → pty-handoff-vmytr4q8.js} +0 -0
  65. /package/dist/chunks/{service-contender-vyas3vgt.js → pty-handoff-vyas3vgt.js} +0 -0
  66. /package/dist/chunks/{service-contender-xgnj2w4v.js → pty-handoff-xgnj2w4v.js} +0 -0
  67. /package/dist/chunks/{service-contender-ydhz1zrh.js → pty-handoff-ydhz1zrh.js} +0 -0
@@ -1,27 +1,30 @@
1
1
  import {
2
2
  spawnServiceContender2,
3
- contenderFailure2,
4
- contenderFinished2
5
- } from "../chunks/service-contender-txckps9j.js";
3
+ contenderPool2
4
+ } from "../chunks/pty-handoff-ve4aws36.js";
6
5
  import {
7
6
  defaultEnsureTiming2,
8
7
  ensureTiming2
9
- } from "../chunks/service-contender-xgnj2w4v.js";
8
+ } from "../chunks/pty-handoff-xgnj2w4v.js";
10
9
  import {
11
10
  matchesVersion2
12
- } from "../chunks/service-contender-sxt88q69.js";
11
+ } from "../chunks/pty-handoff-sxt88q69.js";
13
12
  import {
14
13
  prepare2,
15
14
  environment2,
16
15
  complete2,
17
16
  clear2
18
- } from "../chunks/service-contender-1kn39gq3.js";
19
- import"../chunks/service-contender-qav6mfdz.js";
17
+ } from "../chunks/pty-handoff-71wkqa80.js";
18
+ import {
19
+ fallback2,
20
+ same2,
21
+ probeResult2,
22
+ headers2
23
+ } from "../chunks/pty-handoff-ank0d71z.js";
24
+ import"../chunks/pty-handoff-qav6mfdz.js";
20
25
 
21
26
  // src/effect/service.ts
22
27
  import { Effect, FileSystem, Option, Schedule, Schema } from "effect";
23
- import { homedir } from "node:os";
24
- import { join } from "node:path";
25
28
  var discover = Effect.fn("service.discover")(function* (options = {}) {
26
29
  const found = (yield* registered(options.file)).service;
27
30
  if (found?.state !== "ready")
@@ -34,10 +37,10 @@ var discover = Effect.fn("service.discover")(function* (options = {}) {
34
37
  });
35
38
  var incumbent = Effect.fn("service.incumbent")(function* (options) {
36
39
  const info = yield* read(options.file);
37
- const found = info === undefined ? undefined : yield* probe({ ...info, url: options.url });
38
- if (found === undefined)
40
+ if (info === undefined)
39
41
  return;
40
- if (!found.compatible)
42
+ const found = (yield* Effect.promise(() => probeResult2({ ...info, url: options.url }))).service;
43
+ if (!found?.compatible)
41
44
  return;
42
45
  if (!matchesVersion2(found.version, options))
43
46
  return;
@@ -45,11 +48,9 @@ var incumbent = Effect.fn("service.incumbent")(function* (options) {
45
48
  });
46
49
  var ensure = Effect.fn("service.ensure")(function* (options = {}) {
47
50
  const timing = ensureTiming2(options);
48
- const contenders = new Set;
51
+ const pool = contenderPool2(timing);
49
52
  let timeouts;
50
53
  let announced = false;
51
- let lastSpawn = 0;
52
- let spawnDelay = timing.spawnDelay;
53
54
  const announce = (reason, previousVersion) => Effect.sync(() => {
54
55
  if (announced)
55
56
  return;
@@ -60,7 +61,7 @@ var ensure = Effect.fn("service.ensure")(function* (options = {}) {
60
61
  const [command, ...args] = options.command ?? ["opencode", "serve", "--service"];
61
62
  if (command === undefined)
62
63
  return yield* Effect.fail(new Error("Missing service command"));
63
- const env = yield* Effect.tryPromise(() => environment2(options.file ?? fallback(), options.env));
64
+ const env = yield* Effect.tryPromise(() => environment2(options.file ?? fallback2(), options.env));
64
65
  return yield* Effect.try({
65
66
  try: () => {
66
67
  return spawnServiceContender2(command, args, env);
@@ -75,23 +76,27 @@ var ensure = Effect.fn("service.ensure")(function* (options = {}) {
75
76
  if (registration.timedOut && info !== undefined) {
76
77
  timeouts = {
77
78
  info,
78
- count: timeouts !== undefined && same(timeouts.info, info) ? timeouts.count + 1 : 1
79
+ count: timeouts !== undefined && same2(timeouts.info, info) ? timeouts.count + 1 : 1
79
80
  };
80
81
  if (timeouts.count >= 3) {
81
82
  yield* announce("missing");
82
83
  yield* Effect.logWarning("Background service is unresponsive; recovery cannot preserve persistent terminals");
83
- yield* Effect.tryPromise(() => clear2(options.file ?? fallback()));
84
+ yield* Effect.tryPromise(() => clear2(options.file ?? fallback2()));
84
85
  yield* terminate(info, options, timing);
86
+ pool.evict(info.pid);
87
+ pool.recruitNow();
85
88
  timeouts = undefined;
86
- lastSpawn = Date.now() - spawnDelay;
87
89
  }
88
90
  } else
89
91
  timeouts = undefined;
90
92
  if (service2 !== undefined) {
91
- spawnDelay = timing.spawnDelay;
92
- const compatible = service2.compatible && matchesVersion2(service2.version, options);
93
+ pool.serviceAnswered();
94
+ const versionMatches = matchesVersion2(service2.version, options);
95
+ const compatible = service2.compatible && versionMatches;
96
+ if (!service2.compatible && versionMatches)
97
+ return yield* Effect.fail(new Error("Background service uses an incompatible health protocol. Update this client or explicitly restart the service."));
93
98
  if (compatible && service2.state === "ready") {
94
- yield* Effect.tryPromise(() => complete2(options.file ?? fallback(), service2.info));
99
+ yield* Effect.tryPromise(() => complete2(options.file ?? fallback2(), service2.info));
95
100
  return Option.some(service2);
96
101
  }
97
102
  if (compatible && service2.state === "failed")
@@ -105,50 +110,31 @@ var ensure = Effect.fn("service.ensure")(function* (options = {}) {
105
110
  file: options.file,
106
111
  pty: service2.state === "ready" ? "handoff" : "clear"
107
112
  }).pipe(Effect.ignore);
108
- lastSpawn = 0;
113
+ pool.evict(service2.info.pid);
109
114
  return Option.none();
110
- } else if (lastSpawn === 0 && info !== undefined)
111
- lastSpawn = Date.now();
112
- const finished = [...contenders].filter(contenderFinished2);
113
- const failure = finished.map(contenderFailure2).find((error) => error !== undefined);
114
- if (finished.some((item) => item.child.exitCode === 0)) {
115
- spawnDelay = Math.min(spawnDelay * 2, timing.maxSpawnDelay);
116
115
  }
117
- finished.forEach((item) => contenders.delete(item));
118
- if (failure !== undefined && contenders.size === 0)
119
- return yield* Effect.fail(failure);
120
- if (contenders.size < 2 && Date.now() - lastSpawn >= spawnDelay) {
116
+ const failed = pool.reap();
117
+ if (failed !== undefined)
118
+ return yield* Effect.fail(failed);
119
+ if (pool.shouldRecruit(info !== undefined)) {
121
120
  yield* announce("missing");
122
- contenders.add(yield* spawnContender);
123
- lastSpawn = Date.now();
121
+ pool.add(yield* spawnContender);
124
122
  }
125
123
  return Option.none();
126
124
  }).pipe(Effect.repeat({
127
125
  until: Option.isSome,
128
126
  schedule: Schedule.spaced(timing.pollInterval).pipe(Schedule.upTo({ duration: timing.promiseTimeout }))
129
- }), Effect.ensuring(Effect.sync(() => contenders.forEach((contender) => contender.release()))));
127
+ }), Effect.ensuring(Effect.sync(() => pool.releaseAll())));
130
128
  if (Option.isNone(found))
131
- return yield* Effect.fail(new Error("Timed out waiting for the background service to start"));
129
+ return yield* Effect.fail(pool.failure() ?? new Error("Timed out waiting for the background service to start"));
132
130
  return found.value.endpoint;
133
131
  });
134
132
  var stop = Effect.fn("service.stop")(function* (options = {}) {
135
133
  const info = yield* read(options.file);
136
- if (options.pty === "handoff" && info !== undefined)
137
- yield* Effect.tryPromise(() => prepare2(options.file ?? fallback(), info, defaultEnsureTiming2.requestTimeout));
138
- else
139
- yield* Effect.tryPromise(() => clear2(options.file ?? fallback()));
134
+ 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)));
140
135
  if (info !== undefined)
141
- yield* terminate(info, options, defaultEnsureTiming2);
136
+ yield* terminate(info, options, ensureTiming2(options));
142
137
  });
143
- function fallback() {
144
- const state = process.env["XDG_STATE_HOME"] ?? join(homedir(), ".local", "state");
145
- return join(state, "opencode", "service.json");
146
- }
147
- function headers(endpoint) {
148
- if (endpoint.auth === undefined)
149
- return;
150
- return { authorization: "Basic " + btoa(endpoint.auth.username + ":" + endpoint.auth.password) };
151
- }
152
138
  var Info = Schema.Struct({
153
139
  id: Schema.optional(Schema.String),
154
140
  version: Schema.optional(Schema.String),
@@ -157,69 +143,18 @@ var Info = Schema.Struct({
157
143
  password: Schema.optional(Schema.String)
158
144
  });
159
145
  var decode = Schema.decodeUnknownEffect(Schema.fromJsonString(Info));
160
- var decodeInfo = Schema.decodeUnknownOption(Schema.Struct({
161
- version: Schema.String,
162
- pid: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))
163
- }));
164
146
  var read = Effect.fnUntraced(function* (file) {
165
147
  const fs = yield* FileSystem.FileSystem;
166
- const text = yield* fs.readFileString(file ?? fallback()).pipe(Effect.option);
148
+ const text = yield* fs.readFileString(file ?? fallback2()).pipe(Effect.option);
167
149
  if (Option.isNone(text))
168
150
  return;
169
151
  return yield* decode(text.value).pipe(Effect.option, Effect.map(Option.getOrUndefined));
170
152
  });
171
- var probe = Effect.fnUntraced(function* (info) {
172
- return (yield* probeResult(info)).service;
173
- });
174
- var probeResult = Effect.fnUntraced(function* (info, timeout = defaultEnsureTiming2.requestTimeout) {
175
- const endpoint = {
176
- url: info.url,
177
- auth: info.password === undefined ? undefined : { type: "basic", username: "opencode", password: info.password }
178
- };
179
- const signal = AbortSignal.timeout(timeout);
180
- const result = yield* Effect.promise(() => fetch(new URL("/api/info", info.url), { headers: headers(endpoint), signal }).then(async (response) => ({
181
- response,
182
- body: response.status === 404 ? undefined : await response.json()
183
- })).then((value) => ({ value }), (cause) => ({ cause })));
184
- if ("cause" in result)
185
- return { service: undefined, timedOut: signal.aborted };
186
- const response = result.value.response;
187
- if (response.status === 404)
188
- return {
189
- service: {
190
- info,
191
- endpoint,
192
- version: info.version,
193
- state: "ready",
194
- compatible: false
195
- },
196
- timedOut: false
197
- };
198
- const body = result.value.body;
199
- const serverInfo = decodeInfo(body);
200
- if (Option.isSome(serverInfo)) {
201
- if (serverInfo.value.pid !== info.pid)
202
- return { service: undefined, timedOut: false };
203
- if (info.version !== undefined && serverInfo.value.version !== info.version)
204
- return { service: undefined, timedOut: false };
205
- return {
206
- service: {
207
- info,
208
- endpoint,
209
- version: serverInfo.value.version,
210
- state: response.ok ? "ready" : response.status === 500 ? "failed" : "waiting",
211
- compatible: true
212
- },
213
- timedOut: false
214
- };
215
- }
216
- return { service: undefined, timedOut: false };
217
- });
218
153
  var registered = Effect.fnUntraced(function* (file, timeout) {
219
154
  const info = yield* read(file);
220
155
  if (info === undefined)
221
156
  return { info: undefined, service: undefined, timedOut: false };
222
- return { info, ...yield* probeResult(info, timeout) };
157
+ return { info, ...yield* Effect.promise(() => probeResult2(info, timeout)) };
223
158
  });
224
159
  var poll = (timing) => Schedule.max([Schedule.spaced(timing.stopPollInterval), Schedule.recurs(timing.stopPollAttempts)]);
225
160
  var signal = (pid, name) => Effect.try({ try: () => process.kill(pid, name), catch: (cause) => cause }).pipe(Effect.ignore);
@@ -229,35 +164,29 @@ var stopped = Effect.fnUntraced(function* (pid) {
229
164
  return true;
230
165
  return yield* Effect.fail(new Error(`Server process ${pid} is still running`));
231
166
  });
232
- function same(left, right) {
233
- return left.id === right.id && left.version === right.version && left.url === right.url && left.pid === right.pid;
234
- }
235
167
  var terminate = Effect.fnUntraced(function* (info, options, timing) {
236
168
  const current = yield* read(options.file);
237
- if (current === undefined || !same(current, info))
169
+ if (current === undefined || !same2(current, info))
238
170
  return;
239
171
  yield* signal(info.pid, "SIGTERM");
240
172
  const done = yield* stopped(info.pid).pipe(Effect.retry(poll(timing)), Effect.option);
241
173
  if (Option.isNone(done)) {
242
- const latest = yield* read(options.file);
243
- if (latest === undefined || !same(latest, info))
244
- return;
245
174
  yield* signal(info.pid, "SIGKILL");
246
175
  yield* stopped(info.pid).pipe(Effect.retry(poll(timing)));
247
176
  }
248
177
  const latest = yield* read(options.file);
249
- if (latest === undefined || !same(latest, info))
178
+ if (latest === undefined || !same2(latest, info))
250
179
  return;
251
180
  const fs = yield* FileSystem.FileSystem;
252
- yield* fs.remove(options.file ?? fallback()).pipe(Effect.ignore);
181
+ yield* fs.remove(options.file ?? fallback2()).pipe(Effect.ignore);
253
182
  });
254
- var Service = { discover, incumbent, ensure, stop, headers, Info };
183
+ var Service = { discover, incumbent, ensure, stop, headers: headers2, Info };
255
184
  export {
256
185
  Info,
257
186
  Service,
258
187
  discover,
259
188
  ensure,
260
- headers,
189
+ headers2 as headers,
261
190
  incumbent,
262
191
  stop
263
192
  };
@@ -219,6 +219,7 @@ export declare function make(options: ClientOptions): {
219
219
  refresh: (input: import("./index.js").WorktreeRefreshInput, requestOptions?: OpenCode.RequestOptions) => Promise<void>;
220
220
  };
221
221
  vcs: {
222
+ init: (input?: import("./index.js").VcsInitInput, requestOptions?: OpenCode.RequestOptions) => Promise<void>;
222
223
  get: (input?: import("./index.js").VcsGetInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").VcsGetOutput>;
223
224
  base: (input?: import("./index.js").VcsBaseInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").VcsBaseOutput>;
224
225
  status: (input?: import("./index.js").VcsStatusInput, requestOptions?: OpenCode.RequestOptions) => Promise<import("./index.js").VcsStatusOutput>;
@@ -1,14 +1,14 @@
1
1
  import {
2
- make5,
3
- exports_client3
4
- } from "../chunks/service-contender-992ffpa9.js";
5
- import"../chunks/service-contender-vyas3vgt.js";
6
- import"../chunks/service-contender-50fct660.js";
7
- import"../chunks/service-contender-nwcpakzx.js";
8
- import"../chunks/service-contender-1tbj6z39.js";
9
- import"../chunks/service-contender-4tveyqeh.js";
10
- import"../chunks/service-contender-frbwqjmf.js";
2
+ make2,
3
+ exports_client
4
+ } from "../chunks/pty-handoff-cqfz2qxq.js";
5
+ import"../chunks/pty-handoff-vyas3vgt.js";
6
+ import"../chunks/pty-handoff-qzsnm4q8.js";
7
+ import"../chunks/pty-handoff-js54wxgp.js";
8
+ import"../chunks/pty-handoff-1y4a697q.js";
9
+ import"../chunks/pty-handoff-vt9jbch8.js";
10
+ import"../chunks/pty-handoff-frbwqjmf.js";
11
11
  export {
12
- exports_client3 as OpenCode,
13
- make5 as make
12
+ exports_client as OpenCode,
13
+ make2 as make
14
14
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
- ClientError3
3
- } from "../../chunks/service-contender-nwcpakzx.js";
2
+ ClientError2
3
+ } from "../../chunks/pty-handoff-js54wxgp.js";
4
4
  export {
5
- ClientError3 as ClientError
5
+ ClientError2 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, 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, 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;
@@ -226,6 +226,7 @@ export declare function make(options: ClientOptions): {
226
226
  refresh: (input: WorktreeRefreshInput, requestOptions?: RequestOptions) => Promise<void>;
227
227
  };
228
228
  vcs: {
229
+ init: (input?: VcsInitInput, requestOptions?: RequestOptions) => Promise<void>;
229
230
  get: (input?: VcsGetInput, requestOptions?: RequestOptions) => Promise<VcsGetOutput>;
230
231
  base: (input?: VcsBaseInput, requestOptions?: RequestOptions) => Promise<VcsBaseOutput>;
231
232
  status: (input?: VcsStatusInput, requestOptions?: RequestOptions) => Promise<VcsStatusOutput>;
@@ -1,7 +1,7 @@
1
1
  import {
2
- make6
3
- } from "../../chunks/service-contender-50fct660.js";
4
- import"../../chunks/service-contender-nwcpakzx.js";
2
+ make3
3
+ } from "../../chunks/pty-handoff-qzsnm4q8.js";
4
+ import"../../chunks/pty-handoff-js54wxgp.js";
5
5
  export {
6
- make6 as make
6
+ make3 as make
7
7
  };
@@ -1,13 +1,14 @@
1
- import"../../chunks/service-contender-vyas3vgt.js";
1
+ import"../../chunks/pty-handoff-vyas3vgt.js";
2
2
  import {
3
- exports_client4
4
- } from "../../chunks/service-contender-50fct660.js";
3
+ exports_client2
4
+ } from "../../chunks/pty-handoff-qzsnm4q8.js";
5
5
  import {
6
- ClientError3
7
- } from "../../chunks/service-contender-nwcpakzx.js";
6
+ ClientError2
7
+ } from "../../chunks/pty-handoff-js54wxgp.js";
8
8
  import {
9
9
  isInvalidRequestError2,
10
10
  isUnauthorizedError2,
11
+ isLocationNotFoundError2,
11
12
  isServiceUnavailableError2,
12
13
  isAgentNotFoundError2,
13
14
  isInvalidCursorError2,
@@ -36,11 +37,12 @@ import {
36
37
  isPtyNotFoundError2,
37
38
  isForbiddenError2,
38
39
  isShellNotFoundError2,
39
- isWorktreeError2
40
- } from "../../chunks/service-contender-4tveyqeh.js";
40
+ isWorktreeError2,
41
+ isVcsInitNotSupportedError2
42
+ } from "../../chunks/pty-handoff-vt9jbch8.js";
41
43
  export {
42
- ClientError3 as ClientError,
43
- exports_client4 as OpenCode,
44
+ ClientError2 as ClientError,
45
+ exports_client2 as OpenCode,
44
46
  isAgentNotFoundError2 as isAgentNotFoundError,
45
47
  isCommandExecutionError2 as isCommandExecutionError,
46
48
  isCommandNotFoundError2 as isCommandNotFoundError,
@@ -56,6 +58,7 @@ export {
56
58
  isIntegrationNotFoundError2 as isIntegrationNotFoundError,
57
59
  isInvalidCursorError2 as isInvalidCursorError,
58
60
  isInvalidRequestError2 as isInvalidRequestError,
61
+ isLocationNotFoundError2 as isLocationNotFoundError,
59
62
  isMcpServerNotFoundError2 as isMcpServerNotFoundError,
60
63
  isMessageNotFoundError2 as isMessageNotFoundError,
61
64
  isPermissionNotFoundError2 as isPermissionNotFoundError,
@@ -71,5 +74,6 @@ export {
71
74
  isSkillNotFoundError2 as isSkillNotFoundError,
72
75
  isUnauthorizedError2 as isUnauthorizedError,
73
76
  isUnknownError2 as isUnknownError,
77
+ isVcsInitNotSupportedError2 as isVcsInitNotSupportedError,
74
78
  isWorktreeError2 as isWorktreeError
75
79
  };
@@ -8,6 +8,9 @@ export type ServerInfo = {
8
8
  paths: {
9
9
  tmp: string;
10
10
  };
11
+ capabilities?: {
12
+ persistentPty?: boolean | undefined;
13
+ } | undefined;
11
14
  };
12
15
  export type PairingCode = {
13
16
  code: string;
@@ -3365,6 +3368,14 @@ export type UnauthorizedError = {
3365
3368
  readonly message: string;
3366
3369
  };
3367
3370
  export declare const isUnauthorizedError: (value: unknown) => value is UnauthorizedError;
3371
+ export type LocationNotFoundError = {
3372
+ readonly _tag: "LocationNotFoundError";
3373
+ readonly location: {
3374
+ readonly directory: string;
3375
+ };
3376
+ readonly message: string;
3377
+ };
3378
+ export declare const isLocationNotFoundError: (value: unknown) => value is LocationNotFoundError;
3368
3379
  export type ServiceUnavailableError = {
3369
3380
  readonly _tag: "ServiceUnavailableError";
3370
3381
  readonly message: string;
@@ -3538,6 +3549,7 @@ export type ShellNotFoundError = {
3538
3549
  };
3539
3550
  export declare const isShellNotFoundError: (value: unknown) => value is ShellNotFoundError;
3540
3551
  export type WorktreeError = {
3552
+ readonly _tag: "WorktreeError";
3541
3553
  readonly name: "WorktreeError";
3542
3554
  readonly data: {
3543
3555
  readonly message: string;
@@ -3545,6 +3557,12 @@ export type WorktreeError = {
3545
3557
  };
3546
3558
  };
3547
3559
  export declare const isWorktreeError: (value: unknown) => value is WorktreeError;
3560
+ export type VcsInitNotSupportedError = {
3561
+ readonly _tag: "VcsInitNotSupportedError";
3562
+ readonly providerID: string;
3563
+ readonly message: string;
3564
+ };
3565
+ export declare const isVcsInitNotSupportedError: (value: unknown) => value is VcsInitNotSupportedError;
3548
3566
  export type ServerInfoOutput = ServerInfo;
3549
3567
  export type ServerPairOutput = PairingCode;
3550
3568
  export type ServerConnectInput = {
@@ -8577,6 +8595,21 @@ export type WorktreeRefreshInput = {
8577
8595
  }["projectID"];
8578
8596
  };
8579
8597
  export type WorktreeRefreshOutput = void;
8598
+ export type VcsInitInput = {
8599
+ readonly location?: {
8600
+ readonly location?: {
8601
+ readonly directory?: string | undefined;
8602
+ } | undefined;
8603
+ readonly provider?: string | undefined;
8604
+ }["location"];
8605
+ readonly provider?: {
8606
+ readonly location?: {
8607
+ readonly directory?: string | undefined;
8608
+ } | undefined;
8609
+ readonly provider?: string | undefined;
8610
+ }["provider"];
8611
+ };
8612
+ export type VcsInitOutput = void;
8580
8613
  export type VcsGetInput = {
8581
8614
  readonly location?: {
8582
8615
  readonly location?: {
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  isInvalidRequestError2,
3
3
  isUnauthorizedError2,
4
+ isLocationNotFoundError2,
4
5
  isServiceUnavailableError2,
5
6
  isAgentNotFoundError2,
6
7
  isInvalidCursorError2,
@@ -29,8 +30,9 @@ import {
29
30
  isPtyNotFoundError2,
30
31
  isForbiddenError2,
31
32
  isShellNotFoundError2,
32
- isWorktreeError2
33
- } from "../../chunks/service-contender-4tveyqeh.js";
33
+ isWorktreeError2,
34
+ isVcsInitNotSupportedError2
35
+ } from "../../chunks/pty-handoff-vt9jbch8.js";
34
36
  export {
35
37
  isAgentNotFoundError2 as isAgentNotFoundError,
36
38
  isCommandExecutionError2 as isCommandExecutionError,
@@ -47,6 +49,7 @@ export {
47
49
  isIntegrationNotFoundError2 as isIntegrationNotFoundError,
48
50
  isInvalidCursorError2 as isInvalidCursorError,
49
51
  isInvalidRequestError2 as isInvalidRequestError,
52
+ isLocationNotFoundError2 as isLocationNotFoundError,
50
53
  isMcpServerNotFoundError2 as isMcpServerNotFoundError,
51
54
  isMessageNotFoundError2 as isMessageNotFoundError,
52
55
  isPermissionNotFoundError2 as isPermissionNotFoundError,
@@ -62,5 +65,6 @@ export {
62
65
  isSkillNotFoundError2 as isSkillNotFoundError,
63
66
  isUnauthorizedError2 as isUnauthorizedError,
64
67
  isUnknownError2 as isUnknownError,
68
+ isVcsInitNotSupportedError2 as isVcsInitNotSupportedError,
65
69
  isWorktreeError2 as isWorktreeError
66
70
  };
@@ -1,16 +1,17 @@
1
- import"../chunks/service-contender-m2eywc8w.js";
1
+ import"../chunks/pty-handoff-m2eywc8w.js";
2
2
  import {
3
- exports_client3
4
- } from "../chunks/service-contender-992ffpa9.js";
5
- import"../chunks/service-contender-vyas3vgt.js";
6
- import"../chunks/service-contender-50fct660.js";
3
+ exports_client
4
+ } from "../chunks/pty-handoff-cqfz2qxq.js";
5
+ import"../chunks/pty-handoff-vyas3vgt.js";
6
+ import"../chunks/pty-handoff-qzsnm4q8.js";
7
7
  import {
8
- ClientError3
9
- } from "../chunks/service-contender-nwcpakzx.js";
10
- import"../chunks/service-contender-1tbj6z39.js";
8
+ ClientError2
9
+ } from "../chunks/pty-handoff-js54wxgp.js";
10
+ import"../chunks/pty-handoff-1y4a697q.js";
11
11
  import {
12
12
  isInvalidRequestError2,
13
13
  isUnauthorizedError2,
14
+ isLocationNotFoundError2,
14
15
  isServiceUnavailableError2,
15
16
  isAgentNotFoundError2,
16
17
  isInvalidCursorError2,
@@ -39,12 +40,13 @@ import {
39
40
  isPtyNotFoundError2,
40
41
  isForbiddenError2,
41
42
  isShellNotFoundError2,
42
- isWorktreeError2
43
- } from "../chunks/service-contender-4tveyqeh.js";
44
- import"../chunks/service-contender-frbwqjmf.js";
43
+ isWorktreeError2,
44
+ isVcsInitNotSupportedError2
45
+ } from "../chunks/pty-handoff-vt9jbch8.js";
46
+ import"../chunks/pty-handoff-frbwqjmf.js";
45
47
  export {
46
- ClientError3 as ClientError,
47
- exports_client3 as OpenCode,
48
+ ClientError2 as ClientError,
49
+ exports_client as OpenCode,
48
50
  isAgentNotFoundError2 as isAgentNotFoundError,
49
51
  isCommandExecutionError2 as isCommandExecutionError,
50
52
  isCommandNotFoundError2 as isCommandNotFoundError,
@@ -60,6 +62,7 @@ export {
60
62
  isIntegrationNotFoundError2 as isIntegrationNotFoundError,
61
63
  isInvalidCursorError2 as isInvalidCursorError,
62
64
  isInvalidRequestError2 as isInvalidRequestError,
65
+ isLocationNotFoundError2 as isLocationNotFoundError,
63
66
  isMcpServerNotFoundError2 as isMcpServerNotFoundError,
64
67
  isMessageNotFoundError2 as isMessageNotFoundError,
65
68
  isPermissionNotFoundError2 as isPermissionNotFoundError,
@@ -75,5 +78,6 @@ export {
75
78
  isSkillNotFoundError2 as isSkillNotFoundError,
76
79
  isUnauthorizedError2 as isUnauthorizedError,
77
80
  isUnknownError2 as isUnknownError,
81
+ isVcsInitNotSupportedError2 as isVcsInitNotSupportedError,
78
82
  isWorktreeError2 as isWorktreeError
79
83
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  makeRpc2
3
- } from "../chunks/service-contender-1tbj6z39.js";
4
- import"../chunks/service-contender-4tveyqeh.js";
3
+ } from "../chunks/pty-handoff-1y4a697q.js";
4
+ import"../chunks/pty-handoff-vt9jbch8.js";
5
5
  export {
6
6
  makeRpc2 as makeRpc
7
7
  };
@@ -1,5 +1,7 @@
1
1
  import type { DiscoverOptions, Endpoint, EnsureOptions, StopOptions } from "../service.js";
2
+ import { headers } from "../service-probe.js";
2
3
  export * from "../service.js";
4
+ export { headers };
3
5
  /** Discover a healthy, compatible local service without starting one. */
4
6
  export declare function discover(options?: DiscoverOptions): Promise<{
5
7
  url: string;
@@ -13,10 +15,6 @@ export declare function discover(options?: DiscoverOptions): Promise<{
13
15
  export declare function ensure(options?: EnsureOptions): Promise<Endpoint>;
14
16
  /** Stop the registered local service. */
15
17
  export declare function stop(options?: StopOptions): Promise<void>;
16
- /** Create HTTP authentication headers for a service endpoint. */
17
- export declare function headers(endpoint: Endpoint): {
18
- authorization: string;
19
- } | undefined;
20
18
  /** Promise-based local service lifecycle operations. */
21
19
  export declare const Service: {
22
20
  discover: typeof discover;