@opencode/client 2.0.7 → 2.0.9

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 (56) hide show
  1. package/dist/chunks/pty-handoff-1tbj6z39.js +81 -0
  2. package/dist/chunks/pty-handoff-4tveyqeh.js +34 -0
  3. package/dist/chunks/pty-handoff-65kht65h.js +62 -0
  4. package/dist/chunks/pty-handoff-6mptkzbc.js +0 -0
  5. package/dist/chunks/pty-handoff-9rqn6x4v.js +16 -0
  6. package/dist/chunks/pty-handoff-atpwm825.js +1638 -0
  7. package/dist/chunks/pty-handoff-bssvn03b.js +594 -0
  8. package/dist/chunks/pty-handoff-frbwqjmf.js +145 -0
  9. package/dist/chunks/pty-handoff-m2eywc8w.js +0 -0
  10. package/dist/chunks/pty-handoff-n3c99vt5.js +11 -0
  11. package/dist/chunks/pty-handoff-nqd0dnpk.js +112 -0
  12. package/dist/chunks/pty-handoff-qav6mfdz.js +0 -0
  13. package/dist/chunks/pty-handoff-radw39tv.js +1402 -0
  14. package/dist/chunks/pty-handoff-sxt88q69.js +12 -0
  15. package/dist/chunks/pty-handoff-t1xa31vm.js +39 -0
  16. package/dist/chunks/pty-handoff-txckps9j.js +57 -0
  17. package/dist/chunks/pty-handoff-vgxtr9hm.js +30 -0
  18. package/dist/chunks/pty-handoff-vmytr4q8.js +4 -0
  19. package/dist/chunks/pty-handoff-vyas3vgt.js +0 -0
  20. package/dist/chunks/pty-handoff-xgnj2w4v.js +20 -0
  21. package/dist/chunks/pty-handoff-y2etg5bs.js +9 -0
  22. package/dist/chunks/pty-handoff-ydhz1zrh.js +238 -0
  23. package/dist/chunks/pty-handoff-yepdgb80.js +44 -0
  24. package/dist/chunks/pty-handoff-zadn5mwr.js +52 -0
  25. package/dist/contract.js +12 -1
  26. package/dist/effect/client.d.ts +4 -4
  27. package/dist/effect/client.js +15 -29
  28. package/dist/effect/generated/client-error.js +6 -5
  29. package/dist/effect/generated/client.d.ts +4 -4
  30. package/dist/effect/generated/client.js +8 -582
  31. package/dist/effect/generated/index.js +12 -2
  32. package/dist/effect/index.js +75 -30
  33. package/dist/effect/rpc.js +11 -49
  34. package/dist/effect/service.js +238 -245
  35. package/dist/promise/client.js +14 -13
  36. package/dist/promise/generated/client-error.js +6 -8
  37. package/dist/promise/generated/client.js +7 -1396
  38. package/dist/promise/generated/index.js +75 -3
  39. package/dist/promise/generated/types.d.ts +91 -89
  40. package/dist/promise/generated/types.js +66 -34
  41. package/dist/promise/index.js +79 -2
  42. package/dist/promise/rpc.js +7 -86
  43. package/dist/promise/service.js +230 -227
  44. package/dist/pty-handoff.js +14 -121
  45. package/dist/rpc-runtime.js +14 -32
  46. package/dist/service-contender.js +10 -56
  47. package/dist/service-timing.d.ts +0 -1
  48. package/dist/service-timing.js +9 -18
  49. package/dist/service-version.js +6 -9
  50. package/dist/service.js +1 -0
  51. package/dist/shared-events.js +8 -137
  52. package/dist/solid/connection.js +10 -246
  53. package/dist/solid/data.js +18 -1769
  54. package/dist/solid/index.js +32 -3
  55. package/dist/solid/pty.js +8 -41
  56. package/package.json +4 -4
@@ -0,0 +1,1402 @@
1
+ import {
2
+ ClientError3
3
+ } from "./pty-handoff-n3c99vt5.js";
4
+ import {
5
+ __export
6
+ } from "./pty-handoff-9rqn6x4v.js";
7
+
8
+ // src/promise/generated/client.ts
9
+ var exports_client4 = {};
10
+ __export(exports_client4, {
11
+ make: () => make6
12
+ });
13
+ var maxSseEventBytes = 16 * 1024 * 1024;
14
+ function make6(options) {
15
+ const fetch = options.fetch ?? globalThis.fetch;
16
+ const prepare = (descriptor, requestOptions) => {
17
+ const url = new URL(descriptor.path, options.baseUrl);
18
+ for (const [key, value] of Object.entries(descriptor.query ?? {}))
19
+ appendQuery(url.searchParams, key, value);
20
+ const headers = new Headers(options.headers);
21
+ for (const [key, value] of Object.entries(descriptor.headers ?? {})) {
22
+ if (value !== undefined && value !== null)
23
+ headers.set(key, String(value));
24
+ }
25
+ for (const [key, value] of new Headers(requestOptions?.headers))
26
+ headers.set(key, value);
27
+ if (descriptor.body !== undefined && !headers.has("content-type"))
28
+ headers.set("content-type", descriptor.binaryBody ? "application/octet-stream" : "application/json");
29
+ return {
30
+ url,
31
+ init: {
32
+ method: descriptor.method,
33
+ signal: requestOptions?.signal,
34
+ headers,
35
+ body: descriptor.body === undefined ? undefined : descriptor.binaryBody ? descriptor.body : JSON.stringify(descriptor.body)
36
+ }
37
+ };
38
+ };
39
+ const execute = async (descriptor, requestOptions) => {
40
+ try {
41
+ const prepared = prepare(descriptor, requestOptions);
42
+ return await fetch(prepared.url, prepared.init);
43
+ } catch (cause) {
44
+ throw new ClientError3("Transport", { cause });
45
+ }
46
+ };
47
+ const responseError = async (response, descriptor) => {
48
+ if (descriptor.declaredStatuses.includes(response.status))
49
+ throw await json(response);
50
+ try {
51
+ await response.body?.cancel();
52
+ } catch {}
53
+ throw new ClientError3("UnexpectedStatus", { cause: { status: response.status } });
54
+ };
55
+ const request = async (descriptor, requestOptions) => {
56
+ const response = await execute(descriptor, requestOptions);
57
+ if (response.status !== descriptor.successStatus)
58
+ return responseError(response, descriptor);
59
+ if (descriptor.binary)
60
+ return new Uint8Array(await response.arrayBuffer());
61
+ if (descriptor.empty) {
62
+ try {
63
+ await response.body?.cancel();
64
+ } catch {}
65
+ return;
66
+ }
67
+ return await json(response);
68
+ };
69
+ const sse = (descriptor, requestOptions) => ({
70
+ async* [Symbol.asyncIterator]() {
71
+ const response = await execute(descriptor, requestOptions);
72
+ if (response.status !== descriptor.successStatus)
73
+ await responseError(response, descriptor);
74
+ if (!isContentType(response, "text/event-stream")) {
75
+ try {
76
+ await response.body?.cancel();
77
+ } catch {}
78
+ throw new ClientError3("UnsupportedContentType");
79
+ }
80
+ if (response.body === null)
81
+ throw new ClientError3("MalformedResponse");
82
+ const reader = response.body.getReader();
83
+ const decoder = new TextDecoder;
84
+ let buffer = "";
85
+ try {
86
+ while (true) {
87
+ let next;
88
+ try {
89
+ next = await reader.read();
90
+ } catch (cause) {
91
+ throw new ClientError3("Transport", { cause });
92
+ }
93
+ if (!next.done)
94
+ requestOptions?.onActivity?.();
95
+ buffer += decoder.decode(next.value, { stream: !next.done });
96
+ if (buffer.length > maxSseEventBytes)
97
+ throw new ClientError3("SseEventTooLarge");
98
+ const trailingCarriageReturn = !next.done && buffer.endsWith("\r");
99
+ if (trailingCarriageReturn)
100
+ buffer = buffer.slice(0, -1);
101
+ buffer = buffer.replaceAll(`\r
102
+ `, `
103
+ `).replaceAll("\r", `
104
+ `);
105
+ if (trailingCarriageReturn)
106
+ buffer += "\r";
107
+ if (next.done && buffer !== "")
108
+ buffer += `
109
+
110
+ `;
111
+ let boundary = buffer.indexOf(`
112
+
113
+ `);
114
+ while (boundary >= 0) {
115
+ const block = buffer.slice(0, boundary);
116
+ buffer = buffer.slice(boundary + 2);
117
+ const data = block.split(`
118
+ `).flatMap((line) => line.startsWith("data:") ? [line.slice(5).trimStart()] : []).join(`
119
+ `);
120
+ if (data !== "") {
121
+ try {
122
+ yield JSON.parse(data);
123
+ } catch (cause) {
124
+ throw new ClientError3("MalformedResponse", { cause });
125
+ }
126
+ }
127
+ boundary = buffer.indexOf(`
128
+
129
+ `);
130
+ }
131
+ if (next.done)
132
+ return;
133
+ }
134
+ } finally {
135
+ try {
136
+ await reader.cancel();
137
+ } catch {}
138
+ reader.releaseLock();
139
+ }
140
+ }
141
+ });
142
+ return {
143
+ server: {
144
+ info: (requestOptions) => request({ method: "GET", path: `/api/info`, successStatus: 200, declaredStatuses: [400, 401], empty: false }, requestOptions)
145
+ },
146
+ location: {
147
+ get: (input, requestOptions) => request({
148
+ method: "GET",
149
+ path: `/api/location`,
150
+ query: { location: input?.["location"] },
151
+ successStatus: 200,
152
+ declaredStatuses: [400, 401],
153
+ empty: false
154
+ }, requestOptions),
155
+ reload: (requestOptions) => request({
156
+ method: "POST",
157
+ path: `/api/location/reload`,
158
+ successStatus: 204,
159
+ declaredStatuses: [400, 401, 503],
160
+ empty: true
161
+ }, requestOptions)
162
+ },
163
+ agent: {
164
+ list: (input, requestOptions) => request({
165
+ method: "GET",
166
+ path: `/api/agent`,
167
+ query: { location: input?.["location"] },
168
+ successStatus: 200,
169
+ declaredStatuses: [400, 401],
170
+ empty: false
171
+ }, requestOptions),
172
+ get: (input, requestOptions) => request({
173
+ method: "GET",
174
+ path: `/api/agent/${encodeURIComponent(input.agentID)}`,
175
+ query: { location: input["location"] },
176
+ successStatus: 200,
177
+ declaredStatuses: [400, 401, 404],
178
+ empty: false
179
+ }, requestOptions)
180
+ },
181
+ plugin: {
182
+ list: (input, requestOptions) => request({
183
+ method: "GET",
184
+ path: `/api/plugin`,
185
+ query: { location: input?.["location"] },
186
+ successStatus: 200,
187
+ declaredStatuses: [400, 401],
188
+ empty: false
189
+ }, requestOptions),
190
+ check: (input, requestOptions) => request({
191
+ method: "POST",
192
+ path: `/api/plugin/check`,
193
+ query: { location: input?.["location"] },
194
+ body: { target: input?.["target"] },
195
+ successStatus: 200,
196
+ declaredStatuses: [400, 401],
197
+ empty: false
198
+ }, requestOptions),
199
+ update: (input, requestOptions) => request({
200
+ method: "POST",
201
+ path: `/api/plugin/update`,
202
+ query: { location: input["location"] },
203
+ body: { targets: input["targets"] },
204
+ successStatus: 204,
205
+ declaredStatuses: [400, 401, 503],
206
+ empty: true
207
+ }, requestOptions)
208
+ },
209
+ session: {
210
+ list: (input, requestOptions) => request({
211
+ method: "GET",
212
+ path: `/api/session`,
213
+ query: {
214
+ limit: input?.["limit"],
215
+ order: input?.["order"],
216
+ search: input?.["search"],
217
+ parentID: input?.["parentID"],
218
+ directory: input?.["directory"],
219
+ project: input?.["project"],
220
+ subpath: input?.["subpath"],
221
+ cursor: input?.["cursor"]
222
+ },
223
+ successStatus: 200,
224
+ declaredStatuses: [400, 401],
225
+ empty: false
226
+ }, requestOptions),
227
+ stats: (input, requestOptions) => request({
228
+ method: "GET",
229
+ path: `/api/experimental/session/stats`,
230
+ query: {
231
+ from: input?.["from"],
232
+ to: input?.["to"],
233
+ project: input?.["project"],
234
+ timezone: input?.["timezone"],
235
+ tools: input?.["tools"]
236
+ },
237
+ successStatus: 200,
238
+ declaredStatuses: [400, 401],
239
+ empty: false
240
+ }, requestOptions).then((value) => value.data),
241
+ create: (input, requestOptions) => request({
242
+ method: "POST",
243
+ path: `/api/session`,
244
+ body: {
245
+ id: input?.["id"],
246
+ title: input?.["title"],
247
+ agent: input?.["agent"],
248
+ model: input?.["model"],
249
+ location: input?.["location"],
250
+ metadata: input?.["metadata"],
251
+ permissions: input?.["permissions"]
252
+ },
253
+ successStatus: 200,
254
+ declaredStatuses: [400, 401],
255
+ empty: false
256
+ }, requestOptions).then((value) => value.data),
257
+ import: (input, requestOptions) => request({
258
+ method: "POST",
259
+ path: `/api/experimental/session/import`,
260
+ body: { info: input["info"], messages: input["messages"], location: input["location"] },
261
+ successStatus: 200,
262
+ declaredStatuses: [400, 401, 404, 409],
263
+ empty: false
264
+ }, requestOptions).then((value) => value.data),
265
+ export: (input, requestOptions) => request({
266
+ method: "GET",
267
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/export`,
268
+ query: { sanitize: input["sanitize"] },
269
+ successStatus: 200,
270
+ declaredStatuses: [400, 401, 404, 500],
271
+ empty: false
272
+ }, requestOptions).then((value) => value.data),
273
+ active: (requestOptions) => request({
274
+ method: "GET",
275
+ path: `/api/session/active`,
276
+ successStatus: 200,
277
+ declaredStatuses: [400, 401],
278
+ empty: false
279
+ }, requestOptions).then((value) => value.data),
280
+ get: (input, requestOptions) => request({
281
+ method: "GET",
282
+ path: `/api/session/${encodeURIComponent(input.sessionID)}`,
283
+ successStatus: 200,
284
+ declaredStatuses: [400, 401, 404],
285
+ empty: false
286
+ }, requestOptions).then((value) => value.data),
287
+ remove: (input, requestOptions) => request({
288
+ method: "DELETE",
289
+ path: `/api/session/${encodeURIComponent(input.sessionID)}`,
290
+ successStatus: 204,
291
+ declaredStatuses: [400, 401, 404],
292
+ empty: true
293
+ }, requestOptions),
294
+ fork: (input, requestOptions) => request({
295
+ method: "POST",
296
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/fork`,
297
+ body: { before: input["before"] },
298
+ successStatus: 200,
299
+ declaredStatuses: [400, 401, 404],
300
+ empty: false
301
+ }, requestOptions).then((value) => value.data),
302
+ switchAgent: (input, requestOptions) => request({
303
+ method: "POST",
304
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/agent`,
305
+ body: { agent: input["agent"] },
306
+ successStatus: 204,
307
+ declaredStatuses: [400, 401, 404],
308
+ empty: true
309
+ }, requestOptions),
310
+ switchModel: (input, requestOptions) => request({
311
+ method: "POST",
312
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/model`,
313
+ body: { model: input["model"] },
314
+ successStatus: 204,
315
+ declaredStatuses: [400, 401, 404],
316
+ empty: true
317
+ }, requestOptions),
318
+ update: (input, requestOptions) => request({
319
+ method: "PATCH",
320
+ path: `/api/session/${encodeURIComponent(input.sessionID)}`,
321
+ body: { title: input["title"], permissions: input["permissions"] },
322
+ successStatus: 204,
323
+ declaredStatuses: [400, 401, 404],
324
+ empty: true
325
+ }, requestOptions),
326
+ move: (input, requestOptions) => request({
327
+ method: "POST",
328
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/move`,
329
+ body: { directory: input["directory"], delivery: input["delivery"] },
330
+ successStatus: 204,
331
+ declaredStatuses: [400, 401, 404],
332
+ empty: true
333
+ }, requestOptions),
334
+ prompt: (input, requestOptions) => request({
335
+ method: "POST",
336
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/prompt`,
337
+ body: {
338
+ id: input["id"],
339
+ text: input["text"],
340
+ files: input["files"],
341
+ agents: input["agents"],
342
+ skills: input["skills"],
343
+ metadata: input["metadata"],
344
+ delivery: input["delivery"],
345
+ resume: input["resume"]
346
+ },
347
+ successStatus: 200,
348
+ declaredStatuses: [400, 401, 404, 409],
349
+ empty: false
350
+ }, requestOptions).then((value) => value.data),
351
+ command: (input, requestOptions) => request({
352
+ method: "POST",
353
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/command`,
354
+ body: {
355
+ name: input["name"],
356
+ text: input["text"],
357
+ files: input["files"],
358
+ agents: input["agents"],
359
+ skills: input["skills"],
360
+ delivery: input["delivery"]
361
+ },
362
+ successStatus: 204,
363
+ declaredStatuses: [400, 401, 404, 500],
364
+ empty: true
365
+ }, requestOptions),
366
+ skill: (input, requestOptions) => request({
367
+ method: "POST",
368
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/skill`,
369
+ body: { id: input["id"], resume: input["resume"] },
370
+ successStatus: 204,
371
+ declaredStatuses: [400, 401, 404],
372
+ empty: true
373
+ }, requestOptions),
374
+ synthetic: (input, requestOptions) => request({
375
+ method: "POST",
376
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/synthetic`,
377
+ body: {
378
+ id: input["id"],
379
+ text: input["text"],
380
+ description: input["description"],
381
+ metadata: input["metadata"],
382
+ delivery: input["delivery"],
383
+ resume: input["resume"]
384
+ },
385
+ successStatus: 200,
386
+ declaredStatuses: [400, 401, 404, 409],
387
+ empty: false
388
+ }, requestOptions).then((value) => value.data),
389
+ shell: (input, requestOptions) => request({
390
+ method: "POST",
391
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/shell`,
392
+ body: { id: input["id"], command: input["command"] },
393
+ successStatus: 204,
394
+ declaredStatuses: [400, 401, 404],
395
+ empty: true
396
+ }, requestOptions),
397
+ compact: (input, requestOptions) => request({
398
+ method: "POST",
399
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/compact`,
400
+ body: { id: input["id"], delivery: input["delivery"] },
401
+ successStatus: 200,
402
+ declaredStatuses: [400, 401, 404, 409],
403
+ empty: false
404
+ }, requestOptions).then((value) => value.data),
405
+ wait: (input, requestOptions) => request({
406
+ method: "POST",
407
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/wait`,
408
+ successStatus: 204,
409
+ declaredStatuses: [400, 401, 404, 503],
410
+ empty: true
411
+ }, requestOptions),
412
+ revert: {
413
+ stage: (input, requestOptions) => request({
414
+ method: "POST",
415
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/revert/stage`,
416
+ body: { messageID: input["messageID"], files: input["files"] },
417
+ successStatus: 200,
418
+ declaredStatuses: [400, 401, 404, 409, 500],
419
+ empty: false
420
+ }, requestOptions).then((value) => value.data),
421
+ clear: (input, requestOptions) => request({
422
+ method: "DELETE",
423
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/revert`,
424
+ successStatus: 204,
425
+ declaredStatuses: [400, 401, 404, 409, 500],
426
+ empty: true
427
+ }, requestOptions),
428
+ commit: (input, requestOptions) => request({
429
+ method: "POST",
430
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/revert/commit`,
431
+ successStatus: 204,
432
+ declaredStatuses: [400, 401, 404, 409],
433
+ empty: true
434
+ }, requestOptions)
435
+ },
436
+ context: (input, requestOptions) => request({
437
+ method: "GET",
438
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/context`,
439
+ successStatus: 200,
440
+ declaredStatuses: [400, 401, 404, 500],
441
+ empty: false
442
+ }, requestOptions).then((value) => value.data),
443
+ diff: (input, requestOptions) => request({
444
+ method: "GET",
445
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/diff`,
446
+ query: { from: input["from"], to: input["to"], context: input["context"] },
447
+ successStatus: 200,
448
+ declaredStatuses: [400, 401, 404, 500],
449
+ empty: false
450
+ }, requestOptions).then((value) => value.data),
451
+ inbox: {
452
+ list: (input, requestOptions) => request({
453
+ method: "GET",
454
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/inbox`,
455
+ successStatus: 200,
456
+ declaredStatuses: [400, 401, 404],
457
+ empty: false
458
+ }, requestOptions).then((value) => value.data),
459
+ cancel: (input, requestOptions) => request({
460
+ method: "DELETE",
461
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/inbox/${encodeURIComponent(input.inboxID)}`,
462
+ successStatus: 204,
463
+ declaredStatuses: [400, 401, 404],
464
+ empty: true
465
+ }, requestOptions),
466
+ update: (input, requestOptions) => request({
467
+ method: "PATCH",
468
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/inbox/${encodeURIComponent(input.inboxID)}`,
469
+ body: { delivery: input["delivery"] },
470
+ successStatus: 204,
471
+ declaredStatuses: [400, 401, 404, 409],
472
+ empty: true
473
+ }, requestOptions)
474
+ },
475
+ instructions: {
476
+ entry: {
477
+ list: (input, requestOptions) => request({
478
+ method: "GET",
479
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/instructions/entries`,
480
+ successStatus: 200,
481
+ declaredStatuses: [400, 401, 404],
482
+ empty: false
483
+ }, requestOptions).then((value) => value.data),
484
+ put: (input, requestOptions) => request({
485
+ method: "PUT",
486
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/instructions/entries/${encodeURIComponent(input.key)}`,
487
+ body: { value: input["value"] },
488
+ successStatus: 204,
489
+ declaredStatuses: [400, 401, 404, 413],
490
+ empty: true
491
+ }, requestOptions),
492
+ remove: (input, requestOptions) => request({
493
+ method: "DELETE",
494
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/instructions/entries/${encodeURIComponent(input.key)}`,
495
+ successStatus: 204,
496
+ declaredStatuses: [400, 401, 404],
497
+ empty: true
498
+ }, requestOptions)
499
+ }
500
+ },
501
+ generate: (input, requestOptions) => request({
502
+ method: "POST",
503
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/generate`,
504
+ body: { prompt: input["prompt"] },
505
+ successStatus: 200,
506
+ declaredStatuses: [400, 401, 404, 503],
507
+ empty: false
508
+ }, requestOptions).then((value) => value.data),
509
+ log: (input, requestOptions) => sse({
510
+ method: "GET",
511
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/log`,
512
+ query: { after: input["after"], follow: input["follow"] },
513
+ successStatus: 200,
514
+ declaredStatuses: [400, 401, 404],
515
+ empty: false
516
+ }, requestOptions),
517
+ interrupt: (input, requestOptions) => request({
518
+ method: "POST",
519
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/interrupt`,
520
+ query: { resume: input["resume"] },
521
+ successStatus: 200,
522
+ declaredStatuses: [400, 401, 404],
523
+ empty: false
524
+ }, requestOptions),
525
+ background: (input, requestOptions) => request({
526
+ method: "POST",
527
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/background`,
528
+ successStatus: 204,
529
+ declaredStatuses: [400, 401, 404],
530
+ empty: true
531
+ }, requestOptions),
532
+ message: {
533
+ get: (input, requestOptions) => request({
534
+ method: "GET",
535
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/message/${encodeURIComponent(input.messageID)}`,
536
+ successStatus: 200,
537
+ declaredStatuses: [400, 401, 404],
538
+ empty: false
539
+ }, requestOptions).then((value) => value.data)
540
+ },
541
+ form: {
542
+ list: (input, requestOptions) => request({
543
+ method: "GET",
544
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/form`,
545
+ successStatus: 200,
546
+ declaredStatuses: [400, 401, 404],
547
+ empty: false
548
+ }, requestOptions).then((value) => value.data),
549
+ create: (input, requestOptions) => request({
550
+ method: "POST",
551
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/form`,
552
+ body: { id: input["id"], title: input["title"], metadata: input["metadata"], fields: input["fields"] },
553
+ successStatus: 200,
554
+ declaredStatuses: [400, 401, 404, 409],
555
+ empty: false
556
+ }, requestOptions).then((value) => value.data),
557
+ get: (input, requestOptions) => request({
558
+ method: "GET",
559
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/form/${encodeURIComponent(input.formID)}`,
560
+ successStatus: 200,
561
+ declaredStatuses: [400, 401, 404],
562
+ empty: false
563
+ }, requestOptions).then((value) => value.data),
564
+ reply: (input, requestOptions) => request({
565
+ method: "POST",
566
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/form/${encodeURIComponent(input.formID)}/reply`,
567
+ body: { answer: input["answer"] },
568
+ successStatus: 204,
569
+ declaredStatuses: [400, 401, 404, 409],
570
+ empty: true
571
+ }, requestOptions),
572
+ cancel: (input, requestOptions) => request({
573
+ method: "DELETE",
574
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/form/${encodeURIComponent(input.formID)}`,
575
+ successStatus: 204,
576
+ declaredStatuses: [400, 401, 404, 409],
577
+ empty: true
578
+ }, requestOptions)
579
+ },
580
+ environment: (input, requestOptions) => request({
581
+ method: "PUT",
582
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/environment`,
583
+ body: { variables: input["variables"] },
584
+ successStatus: 204,
585
+ declaredStatuses: [400, 401, 404],
586
+ empty: true
587
+ }, requestOptions),
588
+ view: (input, requestOptions) => request({
589
+ method: "POST",
590
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/view`,
591
+ body: { idle: input["idle"] },
592
+ successStatus: 204,
593
+ declaredStatuses: [400, 401, 404],
594
+ empty: true
595
+ }, requestOptions)
596
+ },
597
+ message: {
598
+ list: (input, requestOptions) => request({
599
+ method: "GET",
600
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/message`,
601
+ query: { limit: input["limit"], order: input["order"], cursor: input["cursor"], type: input["type"] },
602
+ successStatus: 200,
603
+ declaredStatuses: [400, 401, 404, 500],
604
+ empty: false
605
+ }, requestOptions)
606
+ },
607
+ model: {
608
+ list: (input, requestOptions) => request({
609
+ method: "GET",
610
+ path: `/api/model`,
611
+ query: { location: input?.["location"] },
612
+ successStatus: 200,
613
+ declaredStatuses: [400, 401, 503],
614
+ empty: false
615
+ }, requestOptions),
616
+ default: (input, requestOptions) => request({
617
+ method: "GET",
618
+ path: `/api/model/default`,
619
+ query: { location: input?.["location"] },
620
+ successStatus: 200,
621
+ declaredStatuses: [400, 401, 503],
622
+ empty: false
623
+ }, requestOptions)
624
+ },
625
+ generate: {
626
+ text: (input, requestOptions) => request({
627
+ method: "POST",
628
+ path: `/api/experimental/generate`,
629
+ body: { prompt: input["prompt"], model: input["model"] },
630
+ successStatus: 200,
631
+ declaredStatuses: [400, 401, 503],
632
+ empty: false
633
+ }, requestOptions).then((value) => value.data)
634
+ },
635
+ provider: {
636
+ list: (input, requestOptions) => request({
637
+ method: "GET",
638
+ path: `/api/provider`,
639
+ query: { location: input?.["location"] },
640
+ successStatus: 200,
641
+ declaredStatuses: [400, 401, 503],
642
+ empty: false
643
+ }, requestOptions),
644
+ get: (input, requestOptions) => request({
645
+ method: "GET",
646
+ path: `/api/provider/${encodeURIComponent(input.providerID)}`,
647
+ query: { location: input["location"] },
648
+ successStatus: 200,
649
+ declaredStatuses: [400, 401, 404, 503],
650
+ empty: false
651
+ }, requestOptions)
652
+ },
653
+ integration: {
654
+ list: (input, requestOptions) => request({
655
+ method: "GET",
656
+ path: `/api/integration`,
657
+ query: { location: input?.["location"] },
658
+ successStatus: 200,
659
+ declaredStatuses: [400, 401],
660
+ empty: false
661
+ }, requestOptions),
662
+ get: (input, requestOptions) => request({
663
+ method: "GET",
664
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}`,
665
+ query: { location: input["location"] },
666
+ successStatus: 200,
667
+ declaredStatuses: [400, 401, 404],
668
+ empty: false
669
+ }, requestOptions),
670
+ wellknown: {
671
+ add: (input, requestOptions) => request({
672
+ method: "POST",
673
+ path: `/api/experimental/integration/wellknown`,
674
+ query: { location: input["location"] },
675
+ body: { url: input["url"] },
676
+ successStatus: 204,
677
+ declaredStatuses: [400, 401],
678
+ empty: true
679
+ }, requestOptions)
680
+ },
681
+ connect: {
682
+ key: (input, requestOptions) => request({
683
+ method: "POST",
684
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/key`,
685
+ query: { location: input["location"] },
686
+ body: { key: input["key"], answer: input["answer"], label: input["label"] },
687
+ successStatus: 204,
688
+ declaredStatuses: [400, 401, 404],
689
+ empty: true
690
+ }, requestOptions)
691
+ },
692
+ oauth: {
693
+ connect: (input, requestOptions) => request({
694
+ method: "POST",
695
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/oauth`,
696
+ query: { location: input["location"] },
697
+ body: { methodID: input["methodID"], answer: input["answer"], label: input["label"] },
698
+ successStatus: 200,
699
+ declaredStatuses: [400, 401],
700
+ empty: false
701
+ }, requestOptions),
702
+ status: (input, requestOptions) => request({
703
+ method: "GET",
704
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/oauth/${encodeURIComponent(input.attemptID)}`,
705
+ query: { location: input["location"] },
706
+ successStatus: 200,
707
+ declaredStatuses: [400, 401, 404],
708
+ empty: false
709
+ }, requestOptions),
710
+ complete: (input, requestOptions) => request({
711
+ method: "POST",
712
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/oauth/${encodeURIComponent(input.attemptID)}/complete`,
713
+ query: { location: input["location"] },
714
+ body: { code: input["code"] },
715
+ successStatus: 204,
716
+ declaredStatuses: [400, 401, 404],
717
+ empty: true
718
+ }, requestOptions),
719
+ cancel: (input, requestOptions) => request({
720
+ method: "DELETE",
721
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/oauth/${encodeURIComponent(input.attemptID)}`,
722
+ query: { location: input["location"] },
723
+ successStatus: 204,
724
+ declaredStatuses: [400, 401],
725
+ empty: true
726
+ }, requestOptions)
727
+ },
728
+ command: {
729
+ connect: (input, requestOptions) => request({
730
+ method: "POST",
731
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/command`,
732
+ query: { location: input["location"] },
733
+ body: { methodID: input["methodID"], label: input["label"] },
734
+ successStatus: 200,
735
+ declaredStatuses: [400, 401, 404],
736
+ empty: false
737
+ }, requestOptions),
738
+ status: (input, requestOptions) => request({
739
+ method: "GET",
740
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/command/${encodeURIComponent(input.attemptID)}`,
741
+ query: { location: input["location"] },
742
+ successStatus: 200,
743
+ declaredStatuses: [400, 401, 404],
744
+ empty: false
745
+ }, requestOptions),
746
+ cancel: (input, requestOptions) => request({
747
+ method: "DELETE",
748
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/command/${encodeURIComponent(input.attemptID)}`,
749
+ query: { location: input["location"] },
750
+ successStatus: 204,
751
+ declaredStatuses: [400, 401],
752
+ empty: true
753
+ }, requestOptions)
754
+ }
755
+ },
756
+ mcp: {
757
+ list: (input, requestOptions) => request({
758
+ method: "GET",
759
+ path: `/api/mcp`,
760
+ query: { location: input?.["location"] },
761
+ successStatus: 200,
762
+ declaredStatuses: [400, 401],
763
+ empty: false
764
+ }, requestOptions),
765
+ add: (input, requestOptions) => request({
766
+ method: "PUT",
767
+ path: `/api/experimental/mcp/${encodeURIComponent(input.server)}`,
768
+ query: { location: input["location"] },
769
+ body: { config: input["config"] },
770
+ successStatus: 204,
771
+ declaredStatuses: [400, 401],
772
+ empty: true
773
+ }, requestOptions),
774
+ remove: (input, requestOptions) => request({
775
+ method: "DELETE",
776
+ path: `/api/experimental/mcp/${encodeURIComponent(input.server)}`,
777
+ query: { location: input["location"] },
778
+ successStatus: 204,
779
+ declaredStatuses: [400, 401, 404],
780
+ empty: true
781
+ }, requestOptions),
782
+ connect: (input, requestOptions) => request({
783
+ method: "POST",
784
+ path: `/api/experimental/mcp/${encodeURIComponent(input.server)}/connect`,
785
+ query: { location: input["location"] },
786
+ successStatus: 204,
787
+ declaredStatuses: [400, 401, 404],
788
+ empty: true
789
+ }, requestOptions),
790
+ disconnect: (input, requestOptions) => request({
791
+ method: "POST",
792
+ path: `/api/experimental/mcp/${encodeURIComponent(input.server)}/disconnect`,
793
+ query: { location: input["location"] },
794
+ successStatus: 204,
795
+ declaredStatuses: [400, 401, 404],
796
+ empty: true
797
+ }, requestOptions),
798
+ resource: {
799
+ catalog: (input, requestOptions) => request({
800
+ method: "GET",
801
+ path: `/api/mcp/resource`,
802
+ query: { location: input?.["location"] },
803
+ successStatus: 200,
804
+ declaredStatuses: [400, 401],
805
+ empty: false
806
+ }, requestOptions)
807
+ }
808
+ },
809
+ credential: {
810
+ update: (input, requestOptions) => request({
811
+ method: "PATCH",
812
+ path: `/api/credential/${encodeURIComponent(input.credentialID)}`,
813
+ body: { label: input["label"] },
814
+ successStatus: 204,
815
+ declaredStatuses: [400, 401],
816
+ empty: true
817
+ }, requestOptions),
818
+ activate: (input, requestOptions) => request({
819
+ method: "POST",
820
+ path: `/api/credential/${encodeURIComponent(input.credentialID)}/activate`,
821
+ successStatus: 204,
822
+ declaredStatuses: [400, 401],
823
+ empty: true
824
+ }, requestOptions),
825
+ remove: (input, requestOptions) => request({
826
+ method: "DELETE",
827
+ path: `/api/credential/${encodeURIComponent(input.credentialID)}`,
828
+ successStatus: 204,
829
+ declaredStatuses: [400, 401],
830
+ empty: true
831
+ }, requestOptions)
832
+ },
833
+ project: {
834
+ list: (requestOptions) => request({ method: "GET", path: `/api/project`, successStatus: 200, declaredStatuses: [400, 401], empty: false }, requestOptions),
835
+ update: (input, requestOptions) => request({
836
+ method: "PATCH",
837
+ path: `/api/project/${encodeURIComponent(input.projectID)}`,
838
+ body: {
839
+ canonical: input["canonical"],
840
+ name: input["name"],
841
+ icon: input["icon"],
842
+ commands: input["commands"]
843
+ },
844
+ successStatus: 200,
845
+ declaredStatuses: [400, 401, 404],
846
+ empty: false
847
+ }, requestOptions)
848
+ },
849
+ form: {
850
+ list: (input, requestOptions) => request({
851
+ method: "GET",
852
+ path: `/api/form`,
853
+ query: { location: input?.["location"] },
854
+ successStatus: 200,
855
+ declaredStatuses: [400, 401],
856
+ empty: false
857
+ }, requestOptions)
858
+ },
859
+ permission: {
860
+ request: {
861
+ list: (input, requestOptions) => request({
862
+ method: "GET",
863
+ path: `/api/permission/request`,
864
+ query: { location: input?.["location"] },
865
+ successStatus: 200,
866
+ declaredStatuses: [400, 401],
867
+ empty: false
868
+ }, requestOptions)
869
+ },
870
+ saved: {
871
+ list: (input, requestOptions) => request({
872
+ method: "GET",
873
+ path: `/api/permission/saved`,
874
+ query: { projectID: input?.["projectID"] },
875
+ successStatus: 200,
876
+ declaredStatuses: [400, 401],
877
+ empty: false
878
+ }, requestOptions).then((value) => value.data),
879
+ remove: (input, requestOptions) => request({
880
+ method: "DELETE",
881
+ path: `/api/permission/saved/${encodeURIComponent(input.id)}`,
882
+ successStatus: 204,
883
+ declaredStatuses: [400, 401],
884
+ empty: true
885
+ }, requestOptions)
886
+ },
887
+ create: (input, requestOptions) => request({
888
+ method: "POST",
889
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/permission`,
890
+ body: {
891
+ id: input["id"],
892
+ action: input["action"],
893
+ resources: input["resources"],
894
+ save: input["save"],
895
+ metadata: input["metadata"],
896
+ source: input["source"],
897
+ agent: input["agent"]
898
+ },
899
+ successStatus: 200,
900
+ declaredStatuses: [400, 401, 404],
901
+ empty: false
902
+ }, requestOptions).then((value) => value.data),
903
+ list: (input, requestOptions) => request({
904
+ method: "GET",
905
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/permission`,
906
+ successStatus: 200,
907
+ declaredStatuses: [400, 401, 404],
908
+ empty: false
909
+ }, requestOptions).then((value) => value.data),
910
+ get: (input, requestOptions) => request({
911
+ method: "GET",
912
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/permission/${encodeURIComponent(input.requestID)}`,
913
+ successStatus: 200,
914
+ declaredStatuses: [400, 401, 404],
915
+ empty: false
916
+ }, requestOptions).then((value) => value.data),
917
+ reply: (input, requestOptions) => request({
918
+ method: "POST",
919
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/permission/${encodeURIComponent(input.requestID)}/reply`,
920
+ body: { decision: input["decision"], message: input["message"] },
921
+ successStatus: 204,
922
+ declaredStatuses: [400, 401, 404],
923
+ empty: true
924
+ }, requestOptions)
925
+ },
926
+ file: {
927
+ read: (input, requestOptions) => request({
928
+ method: "GET",
929
+ path: `/api/fs/read/${encodePath(input.path)}`,
930
+ query: { location: input["location"] },
931
+ successStatus: 200,
932
+ declaredStatuses: [400, 401, 404],
933
+ empty: false,
934
+ binary: true
935
+ }, requestOptions),
936
+ list: (input, requestOptions) => request({
937
+ method: "GET",
938
+ path: `/api/fs/list`,
939
+ query: { location: input?.["location"], path: input?.["path"] },
940
+ successStatus: 200,
941
+ declaredStatuses: [400, 401],
942
+ empty: false
943
+ }, requestOptions),
944
+ find: (input, requestOptions) => request({
945
+ method: "GET",
946
+ path: `/api/fs/find`,
947
+ query: { location: input["location"], query: input["query"], type: input["type"], limit: input["limit"] },
948
+ successStatus: 200,
949
+ declaredStatuses: [400, 401],
950
+ empty: false
951
+ }, requestOptions),
952
+ write: (input, requestOptions) => request({
953
+ method: "POST",
954
+ path: `/api/experimental/fs/write`,
955
+ query: { location: input["location"], path: input["path"] },
956
+ body: input["payload"],
957
+ successStatus: 200,
958
+ declaredStatuses: [400, 401],
959
+ empty: false,
960
+ binaryBody: true
961
+ }, requestOptions)
962
+ },
963
+ command: {
964
+ list: (input, requestOptions) => request({
965
+ method: "GET",
966
+ path: `/api/command`,
967
+ query: { location: input?.["location"] },
968
+ successStatus: 200,
969
+ declaredStatuses: [400, 401],
970
+ empty: false
971
+ }, requestOptions)
972
+ },
973
+ skill: {
974
+ list: (input, requestOptions) => request({
975
+ method: "GET",
976
+ path: `/api/skill`,
977
+ query: { location: input?.["location"] },
978
+ successStatus: 200,
979
+ declaredStatuses: [400, 401],
980
+ empty: false
981
+ }, requestOptions)
982
+ },
983
+ rpc: {
984
+ call: (input, requestOptions) => request({
985
+ method: "POST",
986
+ path: `/api/rpc/${encodeURIComponent(input.rpcID)}/${encodeURIComponent(input.method)}`,
987
+ query: { location: input["location"] },
988
+ body: { input: input["input"] },
989
+ successStatus: 200,
990
+ declaredStatuses: [400, 401, 500],
991
+ empty: false
992
+ }, requestOptions)
993
+ },
994
+ event: {
995
+ subscribe: (requestOptions) => sse({ method: "GET", path: `/api/event`, successStatus: 200, declaredStatuses: [400, 401], empty: false }, requestOptions)
996
+ },
997
+ pty: {
998
+ list: (input, requestOptions) => request({
999
+ method: "GET",
1000
+ path: `/api/pty`,
1001
+ query: { location: input?.["location"] },
1002
+ successStatus: 200,
1003
+ declaredStatuses: [400, 401],
1004
+ empty: false
1005
+ }, requestOptions),
1006
+ create: (input, requestOptions) => request({
1007
+ method: "POST",
1008
+ path: `/api/pty`,
1009
+ query: { location: input?.["location"] },
1010
+ body: {
1011
+ command: input?.["command"],
1012
+ args: input?.["args"],
1013
+ cwd: input?.["cwd"],
1014
+ title: input?.["title"],
1015
+ env: input?.["env"]
1016
+ },
1017
+ successStatus: 200,
1018
+ declaredStatuses: [400, 401],
1019
+ empty: false
1020
+ }, requestOptions),
1021
+ get: (input, requestOptions) => request({
1022
+ method: "GET",
1023
+ path: `/api/pty/${encodeURIComponent(input.ptyID)}`,
1024
+ query: { location: input["location"] },
1025
+ successStatus: 200,
1026
+ declaredStatuses: [400, 401, 404],
1027
+ empty: false
1028
+ }, requestOptions),
1029
+ update: (input, requestOptions) => request({
1030
+ method: "PUT",
1031
+ path: `/api/pty/${encodeURIComponent(input.ptyID)}`,
1032
+ query: { location: input["location"] },
1033
+ body: { title: input["title"], size: input["size"] },
1034
+ successStatus: 200,
1035
+ declaredStatuses: [400, 401, 404],
1036
+ empty: false
1037
+ }, requestOptions),
1038
+ remove: (input, requestOptions) => request({
1039
+ method: "DELETE",
1040
+ path: `/api/pty/${encodeURIComponent(input.ptyID)}`,
1041
+ query: { location: input["location"] },
1042
+ successStatus: 204,
1043
+ declaredStatuses: [400, 401, 404],
1044
+ empty: true
1045
+ }, requestOptions),
1046
+ connect: {
1047
+ token: (input, requestOptions) => request({
1048
+ method: "POST",
1049
+ path: `/api/pty/${encodeURIComponent(input.ptyID)}/connect-token`,
1050
+ query: { location: input["location"] },
1051
+ headers: { "x-opencode-ticket": input["x-opencode-ticket"] },
1052
+ successStatus: 200,
1053
+ declaredStatuses: [400, 401, 403, 404],
1054
+ empty: false
1055
+ }, requestOptions)
1056
+ }
1057
+ },
1058
+ experimental: {
1059
+ persistentPty: {
1060
+ read: (input, requestOptions) => request({
1061
+ method: "GET",
1062
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/terminal/read`,
1063
+ query: { lines: input["lines"] },
1064
+ successStatus: 200,
1065
+ declaredStatuses: [400, 401, 503],
1066
+ empty: false
1067
+ }, requestOptions).then((value) => value.data),
1068
+ list: (input, requestOptions) => request({
1069
+ method: "GET",
1070
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/terminal`,
1071
+ successStatus: 200,
1072
+ declaredStatuses: [400, 401, 503],
1073
+ empty: false
1074
+ }, requestOptions).then((value) => value.data),
1075
+ create: (input, requestOptions) => request({
1076
+ method: "POST",
1077
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/terminal`,
1078
+ body: {
1079
+ command: input["command"],
1080
+ args: input["args"],
1081
+ cwd: input["cwd"],
1082
+ title: input["title"],
1083
+ env: input["env"],
1084
+ size: input["size"]
1085
+ },
1086
+ successStatus: 200,
1087
+ declaredStatuses: [400, 401, 503],
1088
+ empty: false
1089
+ }, requestOptions).then((value) => value.data),
1090
+ shutdown: (requestOptions) => request({
1091
+ method: "POST",
1092
+ path: `/api/experimental/persistent-pty/shutdown`,
1093
+ successStatus: 204,
1094
+ declaredStatuses: [400, 401, 503],
1095
+ empty: true
1096
+ }, requestOptions),
1097
+ handoff: (requestOptions) => request({
1098
+ method: "POST",
1099
+ path: `/api/experimental/persistent-pty/handoff`,
1100
+ successStatus: 200,
1101
+ declaredStatuses: [400, 401, 503],
1102
+ empty: false
1103
+ }, requestOptions),
1104
+ get: (input, requestOptions) => request({
1105
+ method: "GET",
1106
+ path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}`,
1107
+ successStatus: 200,
1108
+ declaredStatuses: [400, 401, 404, 503],
1109
+ empty: false
1110
+ }, requestOptions).then((value) => value.data),
1111
+ update: (input, requestOptions) => request({
1112
+ method: "PUT",
1113
+ path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}`,
1114
+ body: { attachmentID: input["attachmentID"], size: input["size"] },
1115
+ successStatus: 200,
1116
+ declaredStatuses: [400, 401, 404, 503],
1117
+ empty: false
1118
+ }, requestOptions).then((value) => value.data),
1119
+ snapshot: (input, requestOptions) => request({
1120
+ method: "GET",
1121
+ path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}/snapshot`,
1122
+ successStatus: 200,
1123
+ declaredStatuses: [400, 401, 404, 503],
1124
+ empty: false
1125
+ }, requestOptions).then((value) => value.data),
1126
+ remove: (input, requestOptions) => request({
1127
+ method: "DELETE",
1128
+ path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}`,
1129
+ successStatus: 204,
1130
+ declaredStatuses: [400, 401, 404, 503],
1131
+ empty: true
1132
+ }, requestOptions),
1133
+ connectToken: (input, requestOptions) => request({
1134
+ method: "POST",
1135
+ path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}/connect-token`,
1136
+ headers: { "x-opencode-ticket": input["x-opencode-ticket"] },
1137
+ successStatus: 200,
1138
+ declaredStatuses: [400, 401, 403, 404, 503],
1139
+ empty: false
1140
+ }, requestOptions).then((value) => value.data)
1141
+ }
1142
+ },
1143
+ shell: {
1144
+ list: (input, requestOptions) => request({
1145
+ method: "GET",
1146
+ path: `/api/shell`,
1147
+ query: { location: input?.["location"] },
1148
+ successStatus: 200,
1149
+ declaredStatuses: [400, 401],
1150
+ empty: false
1151
+ }, requestOptions),
1152
+ create: (input, requestOptions) => request({
1153
+ method: "POST",
1154
+ path: `/api/shell`,
1155
+ query: { location: input["location"] },
1156
+ body: {
1157
+ command: input["command"],
1158
+ cwd: input["cwd"],
1159
+ timeout: input["timeout"],
1160
+ metadata: input["metadata"]
1161
+ },
1162
+ successStatus: 200,
1163
+ declaredStatuses: [400, 401],
1164
+ empty: false
1165
+ }, requestOptions),
1166
+ get: (input, requestOptions) => request({
1167
+ method: "GET",
1168
+ path: `/api/shell/${encodeURIComponent(input.id)}`,
1169
+ query: { location: input["location"] },
1170
+ successStatus: 200,
1171
+ declaredStatuses: [400, 401, 404],
1172
+ empty: false
1173
+ }, requestOptions),
1174
+ output: (input, requestOptions) => request({
1175
+ method: "GET",
1176
+ path: `/api/shell/${encodeURIComponent(input.id)}/output`,
1177
+ query: { location: input["location"], cursor: input["cursor"], limit: input["limit"] },
1178
+ successStatus: 200,
1179
+ declaredStatuses: [400, 401, 404],
1180
+ empty: false
1181
+ }, requestOptions),
1182
+ remove: (input, requestOptions) => request({
1183
+ method: "DELETE",
1184
+ path: `/api/shell/${encodeURIComponent(input.id)}`,
1185
+ query: { location: input["location"] },
1186
+ successStatus: 204,
1187
+ declaredStatuses: [400, 401],
1188
+ empty: true
1189
+ }, requestOptions)
1190
+ },
1191
+ reference: {
1192
+ list: (input, requestOptions) => request({
1193
+ method: "GET",
1194
+ path: `/api/reference`,
1195
+ query: { location: input?.["location"] },
1196
+ successStatus: 200,
1197
+ declaredStatuses: [400, 401],
1198
+ empty: false
1199
+ }, requestOptions)
1200
+ },
1201
+ worktree: {
1202
+ list: (input, requestOptions) => request({
1203
+ method: "GET",
1204
+ path: `/api/worktree`,
1205
+ query: { projectID: input["projectID"] },
1206
+ successStatus: 200,
1207
+ declaredStatuses: [400, 401, 404],
1208
+ empty: false
1209
+ }, requestOptions),
1210
+ create: (input, requestOptions) => request({
1211
+ method: "POST",
1212
+ path: `/api/worktree`,
1213
+ body: {
1214
+ projectID: input["projectID"],
1215
+ from: input["from"],
1216
+ branch: input["branch"],
1217
+ directory: input["directory"],
1218
+ name: input["name"]
1219
+ },
1220
+ successStatus: 200,
1221
+ declaredStatuses: [400, 401, 404],
1222
+ empty: false
1223
+ }, requestOptions),
1224
+ remove: (input, requestOptions) => request({
1225
+ method: "DELETE",
1226
+ path: `/api/worktree`,
1227
+ body: { projectID: input["projectID"], directory: input["directory"], force: input["force"] },
1228
+ successStatus: 204,
1229
+ declaredStatuses: [400, 401, 404],
1230
+ empty: true
1231
+ }, requestOptions),
1232
+ refresh: (input, requestOptions) => request({
1233
+ method: "POST",
1234
+ path: `/api/worktree/refresh`,
1235
+ body: { projectID: input["projectID"] },
1236
+ successStatus: 204,
1237
+ declaredStatuses: [400, 401, 404],
1238
+ empty: true
1239
+ }, requestOptions)
1240
+ },
1241
+ vcs: {
1242
+ get: (input, requestOptions) => request({
1243
+ method: "GET",
1244
+ path: `/api/vcs`,
1245
+ query: { location: input?.["location"] },
1246
+ successStatus: 200,
1247
+ declaredStatuses: [400, 401],
1248
+ empty: false
1249
+ }, requestOptions),
1250
+ base: (input, requestOptions) => request({
1251
+ method: "GET",
1252
+ path: `/api/vcs/base`,
1253
+ query: { location: input?.["location"] },
1254
+ successStatus: 200,
1255
+ declaredStatuses: [400, 401, 503],
1256
+ empty: false
1257
+ }, requestOptions),
1258
+ status: (input, requestOptions) => request({
1259
+ method: "GET",
1260
+ path: `/api/vcs/status`,
1261
+ query: { location: input?.["location"] },
1262
+ successStatus: 200,
1263
+ declaredStatuses: [400, 401],
1264
+ empty: false
1265
+ }, requestOptions),
1266
+ branch: {
1267
+ list: (input, requestOptions) => request({
1268
+ method: "GET",
1269
+ path: `/api/vcs/branch`,
1270
+ query: { location: input?.["location"], search: input?.["search"], limit: input?.["limit"] },
1271
+ successStatus: 200,
1272
+ declaredStatuses: [400, 401],
1273
+ empty: false
1274
+ }, requestOptions)
1275
+ },
1276
+ diff: (input, requestOptions) => request({
1277
+ method: "GET",
1278
+ path: `/api/vcs/diff`,
1279
+ query: { location: input["location"], mode: input["mode"], base: input["base"], context: input["context"] },
1280
+ successStatus: 200,
1281
+ declaredStatuses: [400, 401, 503],
1282
+ empty: false
1283
+ }, requestOptions)
1284
+ },
1285
+ debug: {
1286
+ location: {
1287
+ list: (requestOptions) => request({
1288
+ method: "GET",
1289
+ path: `/api/debug/location`,
1290
+ successStatus: 200,
1291
+ declaredStatuses: [400, 401],
1292
+ empty: false
1293
+ }, requestOptions),
1294
+ evict: (input, requestOptions) => request({
1295
+ method: "DELETE",
1296
+ path: `/api/debug/location`,
1297
+ query: { location: input?.["location"] },
1298
+ successStatus: 204,
1299
+ declaredStatuses: [400, 401],
1300
+ empty: true
1301
+ }, requestOptions)
1302
+ }
1303
+ },
1304
+ migration: {
1305
+ v1: {
1306
+ status: (requestOptions) => request({
1307
+ method: "GET",
1308
+ path: `/api/experimental/migration/v1`,
1309
+ successStatus: 200,
1310
+ declaredStatuses: [400, 401],
1311
+ empty: false
1312
+ }, requestOptions)
1313
+ }
1314
+ },
1315
+ websearch: {
1316
+ providers: (input, requestOptions) => request({
1317
+ method: "GET",
1318
+ path: `/api/websearch/provider`,
1319
+ query: { location: input?.["location"] },
1320
+ successStatus: 200,
1321
+ declaredStatuses: [400, 401, 503],
1322
+ empty: false
1323
+ }, requestOptions),
1324
+ query: (input, requestOptions) => request({
1325
+ method: "POST",
1326
+ path: `/api/websearch`,
1327
+ query: { location: input["location"] },
1328
+ body: { query: input["query"], providerID: input["providerID"] },
1329
+ successStatus: 200,
1330
+ declaredStatuses: [400, 401, 503],
1331
+ empty: false
1332
+ }, requestOptions)
1333
+ },
1334
+ config: {
1335
+ get: (input, requestOptions) => request({
1336
+ method: "GET",
1337
+ path: `/api/config`,
1338
+ query: { location: input?.["location"] },
1339
+ successStatus: 200,
1340
+ declaredStatuses: [400, 401],
1341
+ empty: false
1342
+ }, requestOptions),
1343
+ shells: (requestOptions) => request({ method: "GET", path: `/api/config/shell`, successStatus: 200, declaredStatuses: [400, 401], empty: false }, requestOptions),
1344
+ update: (input, requestOptions) => request({
1345
+ method: "PATCH",
1346
+ path: `/api/experimental/config`,
1347
+ body: { shell: input["shell"] },
1348
+ successStatus: 204,
1349
+ declaredStatuses: [400, 401],
1350
+ empty: true
1351
+ }, requestOptions)
1352
+ }
1353
+ };
1354
+ }
1355
+ function encodePath(value) {
1356
+ return value.split("/").map(encodeURIComponent).join("/");
1357
+ }
1358
+ function appendQuery(params, key, value) {
1359
+ if (value === undefined)
1360
+ return;
1361
+ if (value === null) {
1362
+ params.append(key, "null");
1363
+ return;
1364
+ }
1365
+ if (Array.isArray(value)) {
1366
+ for (const item of value)
1367
+ appendQuery(params, key, item);
1368
+ return;
1369
+ }
1370
+ if (typeof value === "object") {
1371
+ for (const [child, item] of Object.entries(value))
1372
+ appendQuery(params, `${key}[${child}]`, item);
1373
+ return;
1374
+ }
1375
+ params.append(key, String(value));
1376
+ }
1377
+ async function json(response) {
1378
+ if (!isContentType(response, "application/json") && !response.headers.get("content-type")?.includes("+json")) {
1379
+ try {
1380
+ await response.body?.cancel();
1381
+ } catch {}
1382
+ throw new ClientError3("UnsupportedContentType");
1383
+ }
1384
+ let text;
1385
+ try {
1386
+ text = await response.text();
1387
+ } catch (cause) {
1388
+ throw new ClientError3("Transport", { cause });
1389
+ }
1390
+ if (text === "")
1391
+ throw new ClientError3("MalformedResponse");
1392
+ try {
1393
+ return JSON.parse(text);
1394
+ } catch (cause) {
1395
+ throw new ClientError3("MalformedResponse", { cause });
1396
+ }
1397
+ }
1398
+ function isContentType(response, expected) {
1399
+ return response.headers.get("content-type")?.split(";", 1)[0]?.trim().toLowerCase() === expected;
1400
+ }
1401
+
1402
+ export { make6, exports_client4 };