@zetaloop/chappie 0.4.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1745 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+
3
+ // node_modules/.pnpm/@opencode+client@2.0.18_effect@4.0.0-rc.112/node_modules/@opencode/client/dist/chunks/contract-9rqn6x4v.js
4
+ var __defProp = Object.defineProperty;
5
+ var __returnValue = (v) => v;
6
+ function __exportSetter(name, newValue) {
7
+ this[name] = __returnValue.bind(null, newValue);
8
+ }
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, {
12
+ get: all[name],
13
+ enumerable: true,
14
+ configurable: true,
15
+ set: __exportSetter.bind(all, name)
16
+ });
17
+ };
18
+
19
+ // node_modules/.pnpm/@opencode+client@2.0.18_effect@4.0.0-rc.112/node_modules/@opencode/client/dist/chunks/contract-frbwqjmf.js
20
+ var exports_shared_events = {};
21
+ __export(exports_shared_events, {
22
+ SharedEvents: () => exports_shared_events,
23
+ make: () => make7
24
+ });
25
+ function make7(connect) {
26
+ let current;
27
+ const capacity = 4096;
28
+ function stop(connection) {
29
+ connection.connected = void 0;
30
+ connection.controller.abort();
31
+ if (current === connection)
32
+ current = void 0;
33
+ }
34
+ async function run(connection) {
35
+ let iterator;
36
+ let completion = {};
37
+ try {
38
+ if (connection.controller.signal.aborted)
39
+ return;
40
+ iterator = connect(connection.controller.signal, () => {
41
+ connection.subscribers.forEach((subscriber) => subscriber.activity?.());
42
+ })[Symbol.asyncIterator]();
43
+ while (!connection.controller.signal.aborted) {
44
+ const item = await iterator.next();
45
+ if (item.done || connection.controller.signal.aborted)
46
+ break;
47
+ if (item.value.type === "server.connected")
48
+ connection.connected = item.value;
49
+ connection.subscribers.forEach((subscriber) => subscriber.push(item.value));
50
+ }
51
+ } catch (error) {
52
+ completion = { error };
53
+ } finally {
54
+ stop(connection);
55
+ try {
56
+ await iterator?.return?.();
57
+ } catch (error) {
58
+ if (!("error" in completion))
59
+ completion = { error };
60
+ }
61
+ connection.subscribers.forEach((subscriber) => subscriber.finish(completion));
62
+ }
63
+ }
64
+ return {
65
+ subscribe(options) {
66
+ return {
67
+ [Symbol.asyncIterator]() {
68
+ const pending = [];
69
+ const queued = [];
70
+ let started = false;
71
+ let completion;
72
+ let connection;
73
+ function finish(result, discard = true) {
74
+ completion = result;
75
+ if (discard)
76
+ queued.length = 0;
77
+ options?.signal?.removeEventListener("abort", abort);
78
+ if (connection?.subscribers.delete(subscriber) && !connection.subscribers.size)
79
+ stop(connection);
80
+ pending.splice(0).forEach((request) => {
81
+ if ("error" in result)
82
+ request.reject(result.error);
83
+ else
84
+ request.resolve({ done: true, value: void 0 });
85
+ });
86
+ }
87
+ function abort() {
88
+ finish({});
89
+ }
90
+ const subscriber = {
91
+ activity: options?.onActivity,
92
+ finish(result) {
93
+ finish(result, false);
94
+ },
95
+ push(value) {
96
+ if (completion)
97
+ return;
98
+ const request = pending.shift();
99
+ if (request) {
100
+ request.resolve({ done: false, value });
101
+ return;
102
+ }
103
+ if (queued.length === capacity) {
104
+ finish({ error: new Error(`Event subscriber exceeded its ${capacity}-event capacity`) });
105
+ return;
106
+ }
107
+ queued.push(value);
108
+ }
109
+ };
110
+ function start() {
111
+ if (completion)
112
+ return;
113
+ const fresh = !current;
114
+ connection = current ?? {
115
+ controller: new AbortController(),
116
+ subscribers: /* @__PURE__ */ new Set()
117
+ };
118
+ current = connection;
119
+ connection.subscribers.add(subscriber);
120
+ if (connection.connected)
121
+ subscriber.push(connection.connected);
122
+ if (fresh)
123
+ run(connection);
124
+ }
125
+ return {
126
+ next() {
127
+ const value = queued.shift();
128
+ if (value)
129
+ return Promise.resolve({ done: false, value });
130
+ if (completion) {
131
+ if ("error" in completion)
132
+ return Promise.reject(completion.error);
133
+ return Promise.resolve({ done: true, value: void 0 });
134
+ }
135
+ if (options?.signal?.aborted) {
136
+ abort();
137
+ return Promise.resolve({ done: true, value: void 0 });
138
+ }
139
+ const request = Promise.withResolvers();
140
+ pending.push(request);
141
+ if (!started) {
142
+ started = true;
143
+ options?.signal?.addEventListener("abort", abort, { once: true });
144
+ start();
145
+ }
146
+ return request.promise;
147
+ },
148
+ return() {
149
+ finish({});
150
+ return Promise.resolve({ done: true, value: void 0 });
151
+ }
152
+ };
153
+ }
154
+ };
155
+ }
156
+ };
157
+ }
158
+
159
+ // node_modules/.pnpm/@opencode+client@2.0.18_effect@4.0.0-rc.112/node_modules/@opencode/client/dist/chunks/contract-nwcpakzx.js
160
+ var ClientError3 = class extends Error {
161
+ reason;
162
+ name = "ClientError";
163
+ constructor(reason, options) {
164
+ const detail = options?.detail ?? (options?.cause instanceof Error ? options.cause.message : void 0);
165
+ super(detail ? `${reason}: ${detail}` : reason, options);
166
+ this.reason = reason;
167
+ }
168
+ };
169
+
170
+ // node_modules/.pnpm/@opencode+client@2.0.18_effect@4.0.0-rc.112/node_modules/@opencode/client/dist/chunks/contract-n8g24fq8.js
171
+ var exports_client4 = {};
172
+ __export(exports_client4, {
173
+ make: () => make6
174
+ });
175
+ var maxSseEventBytes = 16 * 1024 * 1024;
176
+ function make6(options) {
177
+ const fetch = options.fetch ?? globalThis.fetch;
178
+ const prepare = (descriptor, requestOptions) => {
179
+ const baseUrl = new URL(options.baseUrl);
180
+ if (!baseUrl.pathname.endsWith("/"))
181
+ baseUrl.pathname += "/";
182
+ const url = new URL(descriptor.path.slice(1), baseUrl);
183
+ for (const [key, value] of Object.entries(descriptor.query ?? {}))
184
+ appendQuery(url.searchParams, key, value);
185
+ const headers = new Headers(options.headers);
186
+ for (const [key, value] of Object.entries(descriptor.headers ?? {})) {
187
+ if (value !== void 0 && value !== null)
188
+ headers.set(key, String(value));
189
+ }
190
+ for (const [key, value] of new Headers(requestOptions?.headers))
191
+ headers.set(key, value);
192
+ if (descriptor.body !== void 0 && !headers.has("content-type"))
193
+ headers.set("content-type", descriptor.binaryBody ? "application/octet-stream" : "application/json");
194
+ return {
195
+ url,
196
+ init: {
197
+ method: descriptor.method,
198
+ signal: requestOptions?.signal,
199
+ headers,
200
+ body: descriptor.body === void 0 ? void 0 : descriptor.binaryBody ? descriptor.body : JSON.stringify(descriptor.body)
201
+ }
202
+ };
203
+ };
204
+ const execute = async (descriptor, requestOptions) => {
205
+ try {
206
+ const prepared = prepare(descriptor, requestOptions);
207
+ return await fetch(prepared.url, prepared.init);
208
+ } catch (cause) {
209
+ throw new ClientError3("Transport", { cause });
210
+ }
211
+ };
212
+ const responseError = async (response, descriptor) => {
213
+ if (descriptor.declaredStatuses.includes(response.status))
214
+ throw declared(await json(response));
215
+ try {
216
+ await response.body?.cancel();
217
+ } catch {
218
+ }
219
+ throw new ClientError3("UnexpectedStatus", { cause: { status: response.status }, detail: String(response.status) });
220
+ };
221
+ const request = async (descriptor, requestOptions) => {
222
+ const response = await execute(descriptor, requestOptions);
223
+ if (response.status !== descriptor.successStatus)
224
+ return responseError(response, descriptor);
225
+ if (descriptor.binary)
226
+ return new Uint8Array(await response.arrayBuffer());
227
+ if (descriptor.empty) {
228
+ try {
229
+ await response.body?.cancel();
230
+ } catch {
231
+ }
232
+ return;
233
+ }
234
+ return await json(response);
235
+ };
236
+ const sse = (descriptor, requestOptions) => ({
237
+ async *[Symbol.asyncIterator]() {
238
+ const response = await execute(descriptor, requestOptions);
239
+ if (response.status !== descriptor.successStatus)
240
+ await responseError(response, descriptor);
241
+ if (!isContentType(response, "text/event-stream")) {
242
+ try {
243
+ await response.body?.cancel();
244
+ } catch {
245
+ }
246
+ throw new ClientError3("UnsupportedContentType", { detail: response.headers.get("content-type") });
247
+ }
248
+ if (response.body === null)
249
+ throw new ClientError3("MalformedResponse");
250
+ const reader = response.body.getReader();
251
+ const decoder = new TextDecoder();
252
+ let buffer = "";
253
+ try {
254
+ while (true) {
255
+ let next;
256
+ try {
257
+ next = await reader.read();
258
+ } catch (cause) {
259
+ throw new ClientError3("Transport", { cause });
260
+ }
261
+ if (!next.done)
262
+ requestOptions?.onActivity?.();
263
+ buffer += decoder.decode(next.value, { stream: !next.done });
264
+ if (buffer.length > maxSseEventBytes)
265
+ throw new ClientError3("SseEventTooLarge");
266
+ const trailingCarriageReturn = !next.done && buffer.endsWith("\r");
267
+ if (trailingCarriageReturn)
268
+ buffer = buffer.slice(0, -1);
269
+ buffer = buffer.replaceAll(`\r
270
+ `, `
271
+ `).replaceAll("\r", `
272
+ `);
273
+ if (trailingCarriageReturn)
274
+ buffer += "\r";
275
+ if (next.done && buffer !== "")
276
+ buffer += `
277
+
278
+ `;
279
+ let boundary = buffer.indexOf(`
280
+
281
+ `);
282
+ while (boundary >= 0) {
283
+ const block = buffer.slice(0, boundary);
284
+ buffer = buffer.slice(boundary + 2);
285
+ const data = block.split(`
286
+ `).flatMap((line) => line.startsWith("data:") ? [line.slice(5).trimStart()] : []).join(`
287
+ `);
288
+ if (data !== "") {
289
+ try {
290
+ yield JSON.parse(data);
291
+ } catch (cause) {
292
+ throw new ClientError3("MalformedResponse", { cause });
293
+ }
294
+ }
295
+ boundary = buffer.indexOf(`
296
+
297
+ `);
298
+ }
299
+ if (next.done)
300
+ return;
301
+ }
302
+ } finally {
303
+ try {
304
+ await reader.cancel();
305
+ } catch {
306
+ }
307
+ reader.releaseLock();
308
+ }
309
+ }
310
+ });
311
+ return {
312
+ server: {
313
+ info: (requestOptions) => request({ method: "GET", path: `/api/info`, successStatus: 200, declaredStatuses: [400, 401], empty: false }, requestOptions),
314
+ pair: (requestOptions) => request({ method: "POST", path: `/api/pair`, successStatus: 200, declaredStatuses: [400, 401], empty: false }, requestOptions),
315
+ connect: (input, requestOptions) => request({
316
+ method: "GET",
317
+ path: `/auth/connect/${encodeURIComponent(input.code)}`,
318
+ successStatus: 200,
319
+ declaredStatuses: [400, 401],
320
+ empty: false
321
+ }, requestOptions)
322
+ },
323
+ location: {
324
+ get: (input, requestOptions) => request({
325
+ method: "GET",
326
+ path: `/api/location`,
327
+ query: { location: input?.["location"] },
328
+ successStatus: 200,
329
+ declaredStatuses: [400, 401],
330
+ empty: false
331
+ }, requestOptions),
332
+ reload: (requestOptions) => request({
333
+ method: "POST",
334
+ path: `/api/location/reload`,
335
+ successStatus: 204,
336
+ declaredStatuses: [400, 401, 503],
337
+ empty: true
338
+ }, requestOptions)
339
+ },
340
+ agent: {
341
+ list: (input, requestOptions) => request({
342
+ method: "GET",
343
+ path: `/api/agent`,
344
+ query: { location: input?.["location"] },
345
+ successStatus: 200,
346
+ declaredStatuses: [400, 401],
347
+ empty: false
348
+ }, requestOptions),
349
+ get: (input, requestOptions) => request({
350
+ method: "GET",
351
+ path: `/api/agent/${encodeURIComponent(input.agentID)}`,
352
+ query: { location: input["location"] },
353
+ successStatus: 200,
354
+ declaredStatuses: [400, 401, 404],
355
+ empty: false
356
+ }, requestOptions)
357
+ },
358
+ plugin: {
359
+ list: (input, requestOptions) => request({
360
+ method: "GET",
361
+ path: `/api/plugin`,
362
+ query: { location: input?.["location"] },
363
+ successStatus: 200,
364
+ declaredStatuses: [400, 401],
365
+ empty: false
366
+ }, requestOptions),
367
+ check: (input, requestOptions) => request({
368
+ method: "POST",
369
+ path: `/api/plugin/check`,
370
+ query: { location: input?.["location"] },
371
+ body: { target: input?.["target"] },
372
+ successStatus: 200,
373
+ declaredStatuses: [400, 401],
374
+ empty: false
375
+ }, requestOptions),
376
+ update: (input, requestOptions) => request({
377
+ method: "POST",
378
+ path: `/api/plugin/update`,
379
+ query: { location: input["location"] },
380
+ body: { targets: input["targets"] },
381
+ successStatus: 204,
382
+ declaredStatuses: [400, 401, 503],
383
+ empty: true
384
+ }, requestOptions)
385
+ },
386
+ session: {
387
+ list: (input, requestOptions) => request({
388
+ method: "GET",
389
+ path: `/api/session`,
390
+ query: {
391
+ limit: input?.["limit"],
392
+ order: input?.["order"],
393
+ search: input?.["search"],
394
+ parentID: input?.["parentID"],
395
+ directory: input?.["directory"],
396
+ project: input?.["project"],
397
+ subpath: input?.["subpath"],
398
+ cursor: input?.["cursor"]
399
+ },
400
+ successStatus: 200,
401
+ declaredStatuses: [400, 401],
402
+ empty: false
403
+ }, requestOptions),
404
+ stats: (input, requestOptions) => request({
405
+ method: "GET",
406
+ path: `/api/experimental/session/stats`,
407
+ query: {
408
+ from: input?.["from"],
409
+ to: input?.["to"],
410
+ project: input?.["project"],
411
+ timezone: input?.["timezone"],
412
+ tools: input?.["tools"]
413
+ },
414
+ successStatus: 200,
415
+ declaredStatuses: [400, 401],
416
+ empty: false
417
+ }, requestOptions).then((value) => value.data),
418
+ create: (input, requestOptions) => request({
419
+ method: "POST",
420
+ path: `/api/session`,
421
+ body: {
422
+ id: input?.["id"],
423
+ title: input?.["title"],
424
+ agent: input?.["agent"],
425
+ model: input?.["model"],
426
+ location: input?.["location"],
427
+ metadata: input?.["metadata"],
428
+ permissions: input?.["permissions"]
429
+ },
430
+ successStatus: 200,
431
+ declaredStatuses: [400, 401],
432
+ empty: false
433
+ }, requestOptions).then((value) => value.data),
434
+ import: (input, requestOptions) => request({
435
+ method: "POST",
436
+ path: `/api/experimental/session/import`,
437
+ body: { info: input["info"], messages: input["messages"], location: input["location"] },
438
+ successStatus: 200,
439
+ declaredStatuses: [400, 401, 404, 409],
440
+ empty: false
441
+ }, requestOptions).then((value) => value.data),
442
+ export: (input, requestOptions) => request({
443
+ method: "GET",
444
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/export`,
445
+ query: { sanitize: input["sanitize"] },
446
+ successStatus: 200,
447
+ declaredStatuses: [400, 401, 404, 500],
448
+ empty: false
449
+ }, requestOptions).then((value) => value.data),
450
+ active: (requestOptions) => request({
451
+ method: "GET",
452
+ path: `/api/session/active`,
453
+ successStatus: 200,
454
+ declaredStatuses: [400, 401],
455
+ empty: false
456
+ }, requestOptions).then((value) => value.data),
457
+ get: (input, requestOptions) => request({
458
+ method: "GET",
459
+ path: `/api/session/${encodeURIComponent(input.sessionID)}`,
460
+ successStatus: 200,
461
+ declaredStatuses: [400, 401, 404],
462
+ empty: false
463
+ }, requestOptions).then((value) => value.data),
464
+ remove: (input, requestOptions) => request({
465
+ method: "DELETE",
466
+ path: `/api/session/${encodeURIComponent(input.sessionID)}`,
467
+ successStatus: 204,
468
+ declaredStatuses: [400, 401, 404],
469
+ empty: true
470
+ }, requestOptions),
471
+ fork: (input, requestOptions) => request({
472
+ method: "POST",
473
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/fork`,
474
+ body: { before: input["before"] },
475
+ successStatus: 200,
476
+ declaredStatuses: [400, 401, 404],
477
+ empty: false
478
+ }, requestOptions).then((value) => value.data),
479
+ switchAgent: (input, requestOptions) => request({
480
+ method: "POST",
481
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/agent`,
482
+ body: { agent: input["agent"] },
483
+ successStatus: 204,
484
+ declaredStatuses: [400, 401, 404],
485
+ empty: true
486
+ }, requestOptions),
487
+ switchModel: (input, requestOptions) => request({
488
+ method: "POST",
489
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/model`,
490
+ body: { model: input["model"] },
491
+ successStatus: 204,
492
+ declaredStatuses: [400, 401, 404],
493
+ empty: true
494
+ }, requestOptions),
495
+ update: (input, requestOptions) => request({
496
+ method: "PATCH",
497
+ path: `/api/session/${encodeURIComponent(input.sessionID)}`,
498
+ body: { title: input["title"], metadata: input["metadata"], permissions: input["permissions"] },
499
+ successStatus: 204,
500
+ declaredStatuses: [400, 401, 404],
501
+ empty: true
502
+ }, requestOptions),
503
+ move: (input, requestOptions) => request({
504
+ method: "POST",
505
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/move`,
506
+ body: { directory: input["directory"], delivery: input["delivery"] },
507
+ successStatus: 204,
508
+ declaredStatuses: [400, 401, 404],
509
+ empty: true
510
+ }, requestOptions),
511
+ prompt: (input, requestOptions) => request({
512
+ method: "POST",
513
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/prompt`,
514
+ body: {
515
+ id: input["id"],
516
+ text: input["text"],
517
+ files: input["files"],
518
+ agents: input["agents"],
519
+ skills: input["skills"],
520
+ metadata: input["metadata"],
521
+ delivery: input["delivery"],
522
+ resume: input["resume"]
523
+ },
524
+ successStatus: 200,
525
+ declaredStatuses: [400, 401, 404, 409],
526
+ empty: false
527
+ }, requestOptions).then((value) => value.data),
528
+ command: (input, requestOptions) => request({
529
+ method: "POST",
530
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/command`,
531
+ body: {
532
+ name: input["name"],
533
+ text: input["text"],
534
+ files: input["files"],
535
+ agents: input["agents"],
536
+ skills: input["skills"],
537
+ delivery: input["delivery"]
538
+ },
539
+ successStatus: 204,
540
+ declaredStatuses: [400, 401, 404, 500],
541
+ empty: true
542
+ }, requestOptions),
543
+ skill: (input, requestOptions) => request({
544
+ method: "POST",
545
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/skill`,
546
+ body: { id: input["id"], resume: input["resume"] },
547
+ successStatus: 204,
548
+ declaredStatuses: [400, 401, 404],
549
+ empty: true
550
+ }, requestOptions),
551
+ synthetic: (input, requestOptions) => request({
552
+ method: "POST",
553
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/synthetic`,
554
+ body: {
555
+ id: input["id"],
556
+ text: input["text"],
557
+ description: input["description"],
558
+ metadata: input["metadata"],
559
+ delivery: input["delivery"],
560
+ resume: input["resume"]
561
+ },
562
+ successStatus: 200,
563
+ declaredStatuses: [400, 401, 404, 409],
564
+ empty: false
565
+ }, requestOptions).then((value) => value.data),
566
+ shell: (input, requestOptions) => request({
567
+ method: "POST",
568
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/shell`,
569
+ body: { id: input["id"], command: input["command"] },
570
+ successStatus: 204,
571
+ declaredStatuses: [400, 401, 404],
572
+ empty: true
573
+ }, requestOptions),
574
+ compact: (input, requestOptions) => request({
575
+ method: "POST",
576
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/compact`,
577
+ body: { id: input["id"], delivery: input["delivery"] },
578
+ successStatus: 200,
579
+ declaredStatuses: [400, 401, 404, 409],
580
+ empty: false
581
+ }, requestOptions).then((value) => value.data),
582
+ wait: (input, requestOptions) => request({
583
+ method: "POST",
584
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/wait`,
585
+ successStatus: 204,
586
+ declaredStatuses: [400, 401, 404, 503],
587
+ empty: true
588
+ }, requestOptions),
589
+ revert: {
590
+ stage: (input, requestOptions) => request({
591
+ method: "POST",
592
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/revert/stage`,
593
+ body: { messageID: input["messageID"], files: input["files"] },
594
+ successStatus: 200,
595
+ declaredStatuses: [400, 401, 404, 409, 500],
596
+ empty: false
597
+ }, requestOptions).then((value) => value.data),
598
+ clear: (input, requestOptions) => request({
599
+ method: "DELETE",
600
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/revert`,
601
+ successStatus: 204,
602
+ declaredStatuses: [400, 401, 404, 409, 500],
603
+ empty: true
604
+ }, requestOptions),
605
+ commit: (input, requestOptions) => request({
606
+ method: "POST",
607
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/revert/commit`,
608
+ successStatus: 204,
609
+ declaredStatuses: [400, 401, 404, 409],
610
+ empty: true
611
+ }, requestOptions)
612
+ },
613
+ context: (input, requestOptions) => request({
614
+ method: "GET",
615
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/context`,
616
+ successStatus: 200,
617
+ declaredStatuses: [400, 401, 404, 500],
618
+ empty: false
619
+ }, requestOptions).then((value) => value.data),
620
+ diff: (input, requestOptions) => request({
621
+ method: "GET",
622
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/diff`,
623
+ query: { from: input["from"], to: input["to"], context: input["context"] },
624
+ successStatus: 200,
625
+ declaredStatuses: [400, 401, 404, 500],
626
+ empty: false
627
+ }, requestOptions).then((value) => value.data),
628
+ inbox: {
629
+ list: (input, requestOptions) => request({
630
+ method: "GET",
631
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/inbox`,
632
+ successStatus: 200,
633
+ declaredStatuses: [400, 401, 404],
634
+ empty: false
635
+ }, requestOptions).then((value) => value.data),
636
+ cancel: (input, requestOptions) => request({
637
+ method: "DELETE",
638
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/inbox/${encodeURIComponent(input.inboxID)}`,
639
+ successStatus: 204,
640
+ declaredStatuses: [400, 401, 404],
641
+ empty: true
642
+ }, requestOptions),
643
+ update: (input, requestOptions) => request({
644
+ method: "PATCH",
645
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/inbox/${encodeURIComponent(input.inboxID)}`,
646
+ body: { delivery: input["delivery"] },
647
+ successStatus: 204,
648
+ declaredStatuses: [400, 401, 404, 409],
649
+ empty: true
650
+ }, requestOptions)
651
+ },
652
+ instructions: {
653
+ entry: {
654
+ list: (input, requestOptions) => request({
655
+ method: "GET",
656
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/instructions/entries`,
657
+ successStatus: 200,
658
+ declaredStatuses: [400, 401, 404],
659
+ empty: false
660
+ }, requestOptions).then((value) => value.data),
661
+ put: (input, requestOptions) => request({
662
+ method: "PUT",
663
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/instructions/entries/${encodeURIComponent(input.key)}`,
664
+ body: { value: input["value"] },
665
+ successStatus: 204,
666
+ declaredStatuses: [400, 401, 404, 413],
667
+ empty: true
668
+ }, requestOptions),
669
+ remove: (input, requestOptions) => request({
670
+ method: "DELETE",
671
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/instructions/entries/${encodeURIComponent(input.key)}`,
672
+ successStatus: 204,
673
+ declaredStatuses: [400, 401, 404],
674
+ empty: true
675
+ }, requestOptions)
676
+ }
677
+ },
678
+ generate: (input, requestOptions) => request({
679
+ method: "POST",
680
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/generate`,
681
+ body: { prompt: input["prompt"] },
682
+ successStatus: 200,
683
+ declaredStatuses: [400, 401, 404, 503],
684
+ empty: false
685
+ }, requestOptions).then((value) => value.data),
686
+ log: (input, requestOptions) => sse({
687
+ method: "GET",
688
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/log`,
689
+ query: { after: input["after"], follow: input["follow"] },
690
+ successStatus: 200,
691
+ declaredStatuses: [400, 401, 404],
692
+ empty: false
693
+ }, requestOptions),
694
+ interrupt: (input, requestOptions) => request({
695
+ method: "POST",
696
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/interrupt`,
697
+ query: { resume: input["resume"] },
698
+ successStatus: 200,
699
+ declaredStatuses: [400, 401, 404],
700
+ empty: false
701
+ }, requestOptions),
702
+ background: (input, requestOptions) => request({
703
+ method: "POST",
704
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/background`,
705
+ successStatus: 204,
706
+ declaredStatuses: [400, 401, 404],
707
+ empty: true
708
+ }, requestOptions),
709
+ message: {
710
+ get: (input, requestOptions) => request({
711
+ method: "GET",
712
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/message/${encodeURIComponent(input.messageID)}`,
713
+ successStatus: 200,
714
+ declaredStatuses: [400, 401, 404],
715
+ empty: false
716
+ }, requestOptions).then((value) => value.data)
717
+ },
718
+ form: {
719
+ list: (input, requestOptions) => request({
720
+ method: "GET",
721
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/form`,
722
+ successStatus: 200,
723
+ declaredStatuses: [400, 401, 404],
724
+ empty: false
725
+ }, requestOptions).then((value) => value.data),
726
+ create: (input, requestOptions) => request({
727
+ method: "POST",
728
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/form`,
729
+ body: { id: input["id"], title: input["title"], metadata: input["metadata"], fields: input["fields"] },
730
+ successStatus: 200,
731
+ declaredStatuses: [400, 401, 404, 409],
732
+ empty: false
733
+ }, requestOptions).then((value) => value.data),
734
+ get: (input, requestOptions) => request({
735
+ method: "GET",
736
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/form/${encodeURIComponent(input.formID)}`,
737
+ successStatus: 200,
738
+ declaredStatuses: [400, 401, 404],
739
+ empty: false
740
+ }, requestOptions).then((value) => value.data),
741
+ reply: (input, requestOptions) => request({
742
+ method: "POST",
743
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/form/${encodeURIComponent(input.formID)}/reply`,
744
+ body: { answer: input["answer"] },
745
+ successStatus: 204,
746
+ declaredStatuses: [400, 401, 404, 409],
747
+ empty: true
748
+ }, requestOptions),
749
+ cancel: (input, requestOptions) => request({
750
+ method: "DELETE",
751
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/form/${encodeURIComponent(input.formID)}`,
752
+ successStatus: 204,
753
+ declaredStatuses: [400, 401, 404, 409],
754
+ empty: true
755
+ }, requestOptions)
756
+ },
757
+ environment: (input, requestOptions) => request({
758
+ method: "PUT",
759
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/environment`,
760
+ body: { variables: input["variables"] },
761
+ successStatus: 204,
762
+ declaredStatuses: [400, 401, 404],
763
+ empty: true
764
+ }, requestOptions),
765
+ view: (input, requestOptions) => request({
766
+ method: "POST",
767
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/view`,
768
+ body: { idle: input["idle"] },
769
+ successStatus: 204,
770
+ declaredStatuses: [400, 401, 404],
771
+ empty: true
772
+ }, requestOptions)
773
+ },
774
+ message: {
775
+ list: (input, requestOptions) => request({
776
+ method: "GET",
777
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/message`,
778
+ query: { limit: input["limit"], order: input["order"], cursor: input["cursor"], type: input["type"] },
779
+ successStatus: 200,
780
+ declaredStatuses: [400, 401, 404, 500],
781
+ empty: false
782
+ }, requestOptions)
783
+ },
784
+ model: {
785
+ list: (input, requestOptions) => request({
786
+ method: "GET",
787
+ path: `/api/model`,
788
+ query: { location: input?.["location"] },
789
+ successStatus: 200,
790
+ declaredStatuses: [400, 401, 503],
791
+ empty: false
792
+ }, requestOptions),
793
+ default: (input, requestOptions) => request({
794
+ method: "GET",
795
+ path: `/api/model/default`,
796
+ query: { location: input?.["location"] },
797
+ successStatus: 200,
798
+ declaredStatuses: [400, 401, 503],
799
+ empty: false
800
+ }, requestOptions)
801
+ },
802
+ generate: {
803
+ text: (input, requestOptions) => request({
804
+ method: "POST",
805
+ path: `/api/experimental/generate`,
806
+ body: { prompt: input["prompt"], model: input["model"] },
807
+ successStatus: 200,
808
+ declaredStatuses: [400, 401, 503],
809
+ empty: false
810
+ }, requestOptions).then((value) => value.data)
811
+ },
812
+ provider: {
813
+ list: (input, requestOptions) => request({
814
+ method: "GET",
815
+ path: `/api/provider`,
816
+ query: { location: input?.["location"] },
817
+ successStatus: 200,
818
+ declaredStatuses: [400, 401, 503],
819
+ empty: false
820
+ }, requestOptions),
821
+ get: (input, requestOptions) => request({
822
+ method: "GET",
823
+ path: `/api/provider/${encodeURIComponent(input.providerID)}`,
824
+ query: { location: input["location"] },
825
+ successStatus: 200,
826
+ declaredStatuses: [400, 401, 404, 503],
827
+ empty: false
828
+ }, requestOptions)
829
+ },
830
+ integration: {
831
+ list: (input, requestOptions) => request({
832
+ method: "GET",
833
+ path: `/api/integration`,
834
+ query: { location: input?.["location"] },
835
+ successStatus: 200,
836
+ declaredStatuses: [400, 401],
837
+ empty: false
838
+ }, requestOptions),
839
+ get: (input, requestOptions) => request({
840
+ method: "GET",
841
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}`,
842
+ query: { location: input["location"] },
843
+ successStatus: 200,
844
+ declaredStatuses: [400, 401, 404],
845
+ empty: false
846
+ }, requestOptions),
847
+ wellknown: {
848
+ add: (input, requestOptions) => request({
849
+ method: "POST",
850
+ path: `/api/experimental/integration/wellknown`,
851
+ query: { location: input["location"] },
852
+ body: { url: input["url"] },
853
+ successStatus: 204,
854
+ declaredStatuses: [400, 401],
855
+ empty: true
856
+ }, requestOptions)
857
+ },
858
+ connect: {
859
+ key: (input, requestOptions) => request({
860
+ method: "POST",
861
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/key`,
862
+ query: { location: input["location"] },
863
+ body: { key: input["key"], answer: input["answer"], label: input["label"] },
864
+ successStatus: 204,
865
+ declaredStatuses: [400, 401, 404],
866
+ empty: true
867
+ }, requestOptions)
868
+ },
869
+ oauth: {
870
+ connect: (input, requestOptions) => request({
871
+ method: "POST",
872
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/oauth`,
873
+ query: { location: input["location"] },
874
+ body: { methodID: input["methodID"], answer: input["answer"], label: input["label"] },
875
+ successStatus: 200,
876
+ declaredStatuses: [400, 401],
877
+ empty: false
878
+ }, requestOptions),
879
+ status: (input, requestOptions) => request({
880
+ method: "GET",
881
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/oauth/${encodeURIComponent(input.attemptID)}`,
882
+ query: { location: input["location"] },
883
+ successStatus: 200,
884
+ declaredStatuses: [400, 401, 404],
885
+ empty: false
886
+ }, requestOptions),
887
+ complete: (input, requestOptions) => request({
888
+ method: "POST",
889
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/oauth/${encodeURIComponent(input.attemptID)}/complete`,
890
+ query: { location: input["location"] },
891
+ body: { code: input["code"] },
892
+ successStatus: 204,
893
+ declaredStatuses: [400, 401, 404],
894
+ empty: true
895
+ }, requestOptions),
896
+ cancel: (input, requestOptions) => request({
897
+ method: "DELETE",
898
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/oauth/${encodeURIComponent(input.attemptID)}`,
899
+ query: { location: input["location"] },
900
+ successStatus: 204,
901
+ declaredStatuses: [400, 401],
902
+ empty: true
903
+ }, requestOptions)
904
+ },
905
+ command: {
906
+ connect: (input, requestOptions) => request({
907
+ method: "POST",
908
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/command`,
909
+ query: { location: input["location"] },
910
+ body: { methodID: input["methodID"], label: input["label"] },
911
+ successStatus: 200,
912
+ declaredStatuses: [400, 401, 404],
913
+ empty: false
914
+ }, requestOptions),
915
+ status: (input, requestOptions) => request({
916
+ method: "GET",
917
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/command/${encodeURIComponent(input.attemptID)}`,
918
+ query: { location: input["location"] },
919
+ successStatus: 200,
920
+ declaredStatuses: [400, 401, 404],
921
+ empty: false
922
+ }, requestOptions),
923
+ cancel: (input, requestOptions) => request({
924
+ method: "DELETE",
925
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/command/${encodeURIComponent(input.attemptID)}`,
926
+ query: { location: input["location"] },
927
+ successStatus: 204,
928
+ declaredStatuses: [400, 401],
929
+ empty: true
930
+ }, requestOptions)
931
+ }
932
+ },
933
+ mcp: {
934
+ list: (input, requestOptions) => request({
935
+ method: "GET",
936
+ path: `/api/mcp`,
937
+ query: { location: input?.["location"] },
938
+ successStatus: 200,
939
+ declaredStatuses: [400, 401],
940
+ empty: false
941
+ }, requestOptions),
942
+ add: (input, requestOptions) => request({
943
+ method: "PUT",
944
+ path: `/api/experimental/mcp/${encodeURIComponent(input.server)}`,
945
+ query: { location: input["location"] },
946
+ body: { config: input["config"] },
947
+ successStatus: 204,
948
+ declaredStatuses: [400, 401],
949
+ empty: true
950
+ }, requestOptions),
951
+ remove: (input, requestOptions) => request({
952
+ method: "DELETE",
953
+ path: `/api/experimental/mcp/${encodeURIComponent(input.server)}`,
954
+ query: { location: input["location"] },
955
+ successStatus: 204,
956
+ declaredStatuses: [400, 401, 404],
957
+ empty: true
958
+ }, requestOptions),
959
+ connect: (input, requestOptions) => request({
960
+ method: "POST",
961
+ path: `/api/experimental/mcp/${encodeURIComponent(input.server)}/connect`,
962
+ query: { location: input["location"] },
963
+ successStatus: 204,
964
+ declaredStatuses: [400, 401, 404],
965
+ empty: true
966
+ }, requestOptions),
967
+ disconnect: (input, requestOptions) => request({
968
+ method: "POST",
969
+ path: `/api/experimental/mcp/${encodeURIComponent(input.server)}/disconnect`,
970
+ query: { location: input["location"] },
971
+ successStatus: 204,
972
+ declaredStatuses: [400, 401, 404],
973
+ empty: true
974
+ }, requestOptions),
975
+ resource: {
976
+ catalog: (input, requestOptions) => request({
977
+ method: "GET",
978
+ path: `/api/mcp/resource`,
979
+ query: { location: input?.["location"] },
980
+ successStatus: 200,
981
+ declaredStatuses: [400, 401],
982
+ empty: false
983
+ }, requestOptions)
984
+ }
985
+ },
986
+ credential: {
987
+ update: (input, requestOptions) => request({
988
+ method: "PATCH",
989
+ path: `/api/credential/${encodeURIComponent(input.credentialID)}`,
990
+ body: { label: input["label"] },
991
+ successStatus: 204,
992
+ declaredStatuses: [400, 401],
993
+ empty: true
994
+ }, requestOptions),
995
+ activate: (input, requestOptions) => request({
996
+ method: "POST",
997
+ path: `/api/credential/${encodeURIComponent(input.credentialID)}/activate`,
998
+ successStatus: 204,
999
+ declaredStatuses: [400, 401],
1000
+ empty: true
1001
+ }, requestOptions),
1002
+ remove: (input, requestOptions) => request({
1003
+ method: "DELETE",
1004
+ path: `/api/credential/${encodeURIComponent(input.credentialID)}`,
1005
+ successStatus: 204,
1006
+ declaredStatuses: [400, 401],
1007
+ empty: true
1008
+ }, requestOptions)
1009
+ },
1010
+ project: {
1011
+ list: (requestOptions) => request({ method: "GET", path: `/api/project`, successStatus: 200, declaredStatuses: [400, 401], empty: false }, requestOptions),
1012
+ update: (input, requestOptions) => request({
1013
+ method: "PATCH",
1014
+ path: `/api/project/${encodeURIComponent(input.projectID)}`,
1015
+ body: {
1016
+ canonical: input["canonical"],
1017
+ name: input["name"],
1018
+ icon: input["icon"],
1019
+ commands: input["commands"]
1020
+ },
1021
+ successStatus: 200,
1022
+ declaredStatuses: [400, 401, 404],
1023
+ empty: false
1024
+ }, requestOptions)
1025
+ },
1026
+ form: {
1027
+ list: (input, requestOptions) => request({
1028
+ method: "GET",
1029
+ path: `/api/form`,
1030
+ query: { location: input?.["location"] },
1031
+ successStatus: 200,
1032
+ declaredStatuses: [400, 401],
1033
+ empty: false
1034
+ }, requestOptions)
1035
+ },
1036
+ permission: {
1037
+ request: {
1038
+ list: (input, requestOptions) => request({
1039
+ method: "GET",
1040
+ path: `/api/permission/request`,
1041
+ query: { location: input?.["location"] },
1042
+ successStatus: 200,
1043
+ declaredStatuses: [400, 401],
1044
+ empty: false
1045
+ }, requestOptions)
1046
+ },
1047
+ saved: {
1048
+ list: (input, requestOptions) => request({
1049
+ method: "GET",
1050
+ path: `/api/permission/saved`,
1051
+ query: { projectID: input?.["projectID"] },
1052
+ successStatus: 200,
1053
+ declaredStatuses: [400, 401],
1054
+ empty: false
1055
+ }, requestOptions).then((value) => value.data),
1056
+ remove: (input, requestOptions) => request({
1057
+ method: "DELETE",
1058
+ path: `/api/permission/saved/${encodeURIComponent(input.id)}`,
1059
+ successStatus: 204,
1060
+ declaredStatuses: [400, 401],
1061
+ empty: true
1062
+ }, requestOptions)
1063
+ },
1064
+ create: (input, requestOptions) => request({
1065
+ method: "POST",
1066
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/permission`,
1067
+ body: {
1068
+ id: input["id"],
1069
+ action: input["action"],
1070
+ resources: input["resources"],
1071
+ save: input["save"],
1072
+ metadata: input["metadata"],
1073
+ source: input["source"],
1074
+ agent: input["agent"]
1075
+ },
1076
+ successStatus: 200,
1077
+ declaredStatuses: [400, 401, 404],
1078
+ empty: false
1079
+ }, requestOptions).then((value) => value.data),
1080
+ list: (input, requestOptions) => request({
1081
+ method: "GET",
1082
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/permission`,
1083
+ successStatus: 200,
1084
+ declaredStatuses: [400, 401, 404],
1085
+ empty: false
1086
+ }, requestOptions).then((value) => value.data),
1087
+ get: (input, requestOptions) => request({
1088
+ method: "GET",
1089
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/permission/${encodeURIComponent(input.requestID)}`,
1090
+ successStatus: 200,
1091
+ declaredStatuses: [400, 401, 404],
1092
+ empty: false
1093
+ }, requestOptions).then((value) => value.data),
1094
+ reply: (input, requestOptions) => request({
1095
+ method: "POST",
1096
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/permission/${encodeURIComponent(input.requestID)}/reply`,
1097
+ body: { decision: input["decision"], message: input["message"] },
1098
+ successStatus: 204,
1099
+ declaredStatuses: [400, 401, 404],
1100
+ empty: true
1101
+ }, requestOptions)
1102
+ },
1103
+ file: {
1104
+ read: (input, requestOptions) => request({
1105
+ method: "GET",
1106
+ path: `/api/fs/read/${encodePath(input.path)}`,
1107
+ query: { location: input["location"] },
1108
+ successStatus: 200,
1109
+ declaredStatuses: [400, 401, 404],
1110
+ empty: false,
1111
+ binary: true
1112
+ }, requestOptions),
1113
+ list: (input, requestOptions) => request({
1114
+ method: "GET",
1115
+ path: `/api/fs/list`,
1116
+ query: { location: input?.["location"], path: input?.["path"] },
1117
+ successStatus: 200,
1118
+ declaredStatuses: [400, 401],
1119
+ empty: false
1120
+ }, requestOptions),
1121
+ find: (input, requestOptions) => request({
1122
+ method: "GET",
1123
+ path: `/api/fs/find`,
1124
+ query: { location: input["location"], query: input["query"], type: input["type"], limit: input["limit"] },
1125
+ successStatus: 200,
1126
+ declaredStatuses: [400, 401],
1127
+ empty: false
1128
+ }, requestOptions),
1129
+ write: (input, requestOptions) => request({
1130
+ method: "POST",
1131
+ path: `/api/experimental/fs/write`,
1132
+ query: { location: input["location"], path: input["path"] },
1133
+ body: input["payload"],
1134
+ successStatus: 200,
1135
+ declaredStatuses: [400, 401],
1136
+ empty: false,
1137
+ binaryBody: true
1138
+ }, requestOptions)
1139
+ },
1140
+ command: {
1141
+ list: (input, requestOptions) => request({
1142
+ method: "GET",
1143
+ path: `/api/command`,
1144
+ query: { location: input?.["location"] },
1145
+ successStatus: 200,
1146
+ declaredStatuses: [400, 401],
1147
+ empty: false
1148
+ }, requestOptions)
1149
+ },
1150
+ skill: {
1151
+ list: (input, requestOptions) => request({
1152
+ method: "GET",
1153
+ path: `/api/skill`,
1154
+ query: { location: input?.["location"] },
1155
+ successStatus: 200,
1156
+ declaredStatuses: [400, 401],
1157
+ empty: false
1158
+ }, requestOptions)
1159
+ },
1160
+ rpc: {
1161
+ call: (input, requestOptions) => request({
1162
+ method: "POST",
1163
+ path: `/api/rpc/${encodeURIComponent(input.rpcID)}/${encodeURIComponent(input.method)}`,
1164
+ query: { location: input["location"] },
1165
+ body: { input: input["input"] },
1166
+ successStatus: 200,
1167
+ declaredStatuses: [400, 401, 500],
1168
+ empty: false
1169
+ }, requestOptions)
1170
+ },
1171
+ event: {
1172
+ subscribe: (requestOptions) => sse({ method: "GET", path: `/api/event`, successStatus: 200, declaredStatuses: [400, 401], empty: false }, requestOptions)
1173
+ },
1174
+ pty: {
1175
+ list: (input, requestOptions) => request({
1176
+ method: "GET",
1177
+ path: `/api/pty`,
1178
+ query: { location: input?.["location"] },
1179
+ successStatus: 200,
1180
+ declaredStatuses: [400, 401],
1181
+ empty: false
1182
+ }, requestOptions),
1183
+ create: (input, requestOptions) => request({
1184
+ method: "POST",
1185
+ path: `/api/pty`,
1186
+ query: { location: input?.["location"] },
1187
+ body: {
1188
+ command: input?.["command"],
1189
+ args: input?.["args"],
1190
+ cwd: input?.["cwd"],
1191
+ title: input?.["title"],
1192
+ env: input?.["env"]
1193
+ },
1194
+ successStatus: 200,
1195
+ declaredStatuses: [400, 401],
1196
+ empty: false
1197
+ }, requestOptions),
1198
+ get: (input, requestOptions) => request({
1199
+ method: "GET",
1200
+ path: `/api/pty/${encodeURIComponent(input.ptyID)}`,
1201
+ query: { location: input["location"] },
1202
+ successStatus: 200,
1203
+ declaredStatuses: [400, 401, 404],
1204
+ empty: false
1205
+ }, requestOptions),
1206
+ update: (input, requestOptions) => request({
1207
+ method: "PUT",
1208
+ path: `/api/pty/${encodeURIComponent(input.ptyID)}`,
1209
+ query: { location: input["location"] },
1210
+ body: { title: input["title"], size: input["size"] },
1211
+ successStatus: 200,
1212
+ declaredStatuses: [400, 401, 404],
1213
+ empty: false
1214
+ }, requestOptions),
1215
+ remove: (input, requestOptions) => request({
1216
+ method: "DELETE",
1217
+ path: `/api/pty/${encodeURIComponent(input.ptyID)}`,
1218
+ query: { location: input["location"] },
1219
+ successStatus: 204,
1220
+ declaredStatuses: [400, 401, 404],
1221
+ empty: true
1222
+ }, requestOptions),
1223
+ connect: {
1224
+ token: (input, requestOptions) => request({
1225
+ method: "POST",
1226
+ path: `/api/pty/${encodeURIComponent(input.ptyID)}/connect-token`,
1227
+ query: { location: input["location"] },
1228
+ headers: { "x-opencode-ticket": input["x-opencode-ticket"] },
1229
+ successStatus: 200,
1230
+ declaredStatuses: [400, 401, 403, 404],
1231
+ empty: false
1232
+ }, requestOptions)
1233
+ }
1234
+ },
1235
+ experimental: {
1236
+ persistentPty: {
1237
+ read: (input, requestOptions) => request({
1238
+ method: "GET",
1239
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/terminal/read`,
1240
+ query: { lines: input["lines"] },
1241
+ successStatus: 200,
1242
+ declaredStatuses: [400, 401, 503],
1243
+ empty: false
1244
+ }, requestOptions).then((value) => value.data),
1245
+ list: (input, requestOptions) => request({
1246
+ method: "GET",
1247
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/terminal`,
1248
+ successStatus: 200,
1249
+ declaredStatuses: [400, 401, 503],
1250
+ empty: false
1251
+ }, requestOptions).then((value) => value.data),
1252
+ create: (input, requestOptions) => request({
1253
+ method: "POST",
1254
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/terminal`,
1255
+ body: {
1256
+ command: input["command"],
1257
+ args: input["args"],
1258
+ cwd: input["cwd"],
1259
+ title: input["title"],
1260
+ env: input["env"],
1261
+ size: input["size"]
1262
+ },
1263
+ successStatus: 200,
1264
+ declaredStatuses: [400, 401, 503],
1265
+ empty: false
1266
+ }, requestOptions).then((value) => value.data),
1267
+ shutdown: (requestOptions) => request({
1268
+ method: "POST",
1269
+ path: `/api/experimental/persistent-pty/shutdown`,
1270
+ successStatus: 204,
1271
+ declaredStatuses: [400, 401, 503],
1272
+ empty: true
1273
+ }, requestOptions),
1274
+ handoff: (requestOptions) => request({
1275
+ method: "POST",
1276
+ path: `/api/experimental/persistent-pty/handoff`,
1277
+ successStatus: 200,
1278
+ declaredStatuses: [400, 401, 503],
1279
+ empty: false
1280
+ }, requestOptions),
1281
+ get: (input, requestOptions) => request({
1282
+ method: "GET",
1283
+ path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}`,
1284
+ successStatus: 200,
1285
+ declaredStatuses: [400, 401, 404, 503],
1286
+ empty: false
1287
+ }, requestOptions).then((value) => value.data),
1288
+ update: (input, requestOptions) => request({
1289
+ method: "PUT",
1290
+ path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}`,
1291
+ body: { attachmentID: input["attachmentID"], size: input["size"] },
1292
+ successStatus: 200,
1293
+ declaredStatuses: [400, 401, 404, 503],
1294
+ empty: false
1295
+ }, requestOptions).then((value) => value.data),
1296
+ snapshot: (input, requestOptions) => request({
1297
+ method: "GET",
1298
+ path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}/snapshot`,
1299
+ successStatus: 200,
1300
+ declaredStatuses: [400, 401, 404, 503],
1301
+ empty: false
1302
+ }, requestOptions).then((value) => value.data),
1303
+ remove: (input, requestOptions) => request({
1304
+ method: "DELETE",
1305
+ path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}`,
1306
+ successStatus: 204,
1307
+ declaredStatuses: [400, 401, 404, 503],
1308
+ empty: true
1309
+ }, requestOptions),
1310
+ connectToken: (input, requestOptions) => request({
1311
+ method: "POST",
1312
+ path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}/connect-token`,
1313
+ headers: { "x-opencode-ticket": input["x-opencode-ticket"] },
1314
+ successStatus: 200,
1315
+ declaredStatuses: [400, 401, 403, 404, 503],
1316
+ empty: false
1317
+ }, requestOptions).then((value) => value.data)
1318
+ }
1319
+ },
1320
+ shell: {
1321
+ list: (input, requestOptions) => request({
1322
+ method: "GET",
1323
+ path: `/api/shell`,
1324
+ query: { location: input?.["location"] },
1325
+ successStatus: 200,
1326
+ declaredStatuses: [400, 401],
1327
+ empty: false
1328
+ }, requestOptions),
1329
+ create: (input, requestOptions) => request({
1330
+ method: "POST",
1331
+ path: `/api/shell`,
1332
+ query: { location: input["location"] },
1333
+ body: {
1334
+ command: input["command"],
1335
+ cwd: input["cwd"],
1336
+ timeout: input["timeout"],
1337
+ metadata: input["metadata"]
1338
+ },
1339
+ successStatus: 200,
1340
+ declaredStatuses: [400, 401],
1341
+ empty: false
1342
+ }, requestOptions),
1343
+ get: (input, requestOptions) => request({
1344
+ method: "GET",
1345
+ path: `/api/shell/${encodeURIComponent(input.id)}`,
1346
+ query: { location: input["location"] },
1347
+ successStatus: 200,
1348
+ declaredStatuses: [400, 401, 404],
1349
+ empty: false
1350
+ }, requestOptions),
1351
+ output: (input, requestOptions) => request({
1352
+ method: "GET",
1353
+ path: `/api/shell/${encodeURIComponent(input.id)}/output`,
1354
+ query: { location: input["location"], cursor: input["cursor"], limit: input["limit"] },
1355
+ successStatus: 200,
1356
+ declaredStatuses: [400, 401, 404],
1357
+ empty: false
1358
+ }, requestOptions),
1359
+ remove: (input, requestOptions) => request({
1360
+ method: "DELETE",
1361
+ path: `/api/shell/${encodeURIComponent(input.id)}`,
1362
+ query: { location: input["location"] },
1363
+ successStatus: 204,
1364
+ declaredStatuses: [400, 401],
1365
+ empty: true
1366
+ }, requestOptions)
1367
+ },
1368
+ reference: {
1369
+ list: (input, requestOptions) => request({
1370
+ method: "GET",
1371
+ path: `/api/reference`,
1372
+ query: { location: input?.["location"] },
1373
+ successStatus: 200,
1374
+ declaredStatuses: [400, 401],
1375
+ empty: false
1376
+ }, requestOptions)
1377
+ },
1378
+ worktree: {
1379
+ list: (input, requestOptions) => request({
1380
+ method: "GET",
1381
+ path: `/api/worktree`,
1382
+ query: { projectID: input["projectID"] },
1383
+ successStatus: 200,
1384
+ declaredStatuses: [400, 401, 404],
1385
+ empty: false
1386
+ }, requestOptions),
1387
+ create: (input, requestOptions) => request({
1388
+ method: "POST",
1389
+ path: `/api/worktree`,
1390
+ body: {
1391
+ projectID: input["projectID"],
1392
+ from: input["from"],
1393
+ branch: input["branch"],
1394
+ directory: input["directory"],
1395
+ name: input["name"]
1396
+ },
1397
+ successStatus: 200,
1398
+ declaredStatuses: [400, 401, 404],
1399
+ empty: false
1400
+ }, requestOptions),
1401
+ remove: (input, requestOptions) => request({
1402
+ method: "DELETE",
1403
+ path: `/api/worktree`,
1404
+ body: { projectID: input["projectID"], directory: input["directory"], force: input["force"] },
1405
+ successStatus: 204,
1406
+ declaredStatuses: [400, 401, 404],
1407
+ empty: true
1408
+ }, requestOptions),
1409
+ refresh: (input, requestOptions) => request({
1410
+ method: "POST",
1411
+ path: `/api/worktree/refresh`,
1412
+ body: { projectID: input["projectID"] },
1413
+ successStatus: 204,
1414
+ declaredStatuses: [400, 401, 404],
1415
+ empty: true
1416
+ }, requestOptions)
1417
+ },
1418
+ vcs: {
1419
+ get: (input, requestOptions) => request({
1420
+ method: "GET",
1421
+ path: `/api/vcs`,
1422
+ query: { location: input?.["location"] },
1423
+ successStatus: 200,
1424
+ declaredStatuses: [400, 401],
1425
+ empty: false
1426
+ }, requestOptions),
1427
+ base: (input, requestOptions) => request({
1428
+ method: "GET",
1429
+ path: `/api/vcs/base`,
1430
+ query: { location: input?.["location"] },
1431
+ successStatus: 200,
1432
+ declaredStatuses: [400, 401, 503],
1433
+ empty: false
1434
+ }, requestOptions),
1435
+ status: (input, requestOptions) => request({
1436
+ method: "GET",
1437
+ path: `/api/vcs/status`,
1438
+ query: { location: input?.["location"] },
1439
+ successStatus: 200,
1440
+ declaredStatuses: [400, 401],
1441
+ empty: false
1442
+ }, requestOptions),
1443
+ branch: {
1444
+ list: (input, requestOptions) => request({
1445
+ method: "GET",
1446
+ path: `/api/vcs/branch`,
1447
+ query: { location: input?.["location"], search: input?.["search"], limit: input?.["limit"] },
1448
+ successStatus: 200,
1449
+ declaredStatuses: [400, 401],
1450
+ empty: false
1451
+ }, requestOptions)
1452
+ },
1453
+ diff: (input, requestOptions) => request({
1454
+ method: "GET",
1455
+ path: `/api/vcs/diff`,
1456
+ query: { location: input["location"], mode: input["mode"], base: input["base"], context: input["context"] },
1457
+ successStatus: 200,
1458
+ declaredStatuses: [400, 401, 503],
1459
+ empty: false
1460
+ }, requestOptions)
1461
+ },
1462
+ debug: {
1463
+ location: {
1464
+ list: (requestOptions) => request({
1465
+ method: "GET",
1466
+ path: `/api/debug/location`,
1467
+ successStatus: 200,
1468
+ declaredStatuses: [400, 401],
1469
+ empty: false
1470
+ }, requestOptions),
1471
+ evict: (input, requestOptions) => request({
1472
+ method: "DELETE",
1473
+ path: `/api/debug/location`,
1474
+ query: { location: input?.["location"] },
1475
+ successStatus: 204,
1476
+ declaredStatuses: [400, 401],
1477
+ empty: true
1478
+ }, requestOptions)
1479
+ }
1480
+ },
1481
+ migration: {
1482
+ v1: {
1483
+ status: (requestOptions) => request({
1484
+ method: "GET",
1485
+ path: `/api/experimental/migration/v1`,
1486
+ successStatus: 200,
1487
+ declaredStatuses: [400, 401],
1488
+ empty: false
1489
+ }, requestOptions)
1490
+ }
1491
+ },
1492
+ websearch: {
1493
+ providers: (input, requestOptions) => request({
1494
+ method: "GET",
1495
+ path: `/api/websearch/provider`,
1496
+ query: { location: input?.["location"] },
1497
+ successStatus: 200,
1498
+ declaredStatuses: [400, 401, 503],
1499
+ empty: false
1500
+ }, requestOptions),
1501
+ query: (input, requestOptions) => request({
1502
+ method: "POST",
1503
+ path: `/api/websearch`,
1504
+ query: { location: input["location"] },
1505
+ body: { query: input["query"], providerID: input["providerID"] },
1506
+ successStatus: 200,
1507
+ declaredStatuses: [400, 401, 503],
1508
+ empty: false
1509
+ }, requestOptions)
1510
+ },
1511
+ config: {
1512
+ get: (input, requestOptions) => request({
1513
+ method: "GET",
1514
+ path: `/api/config`,
1515
+ query: { location: input?.["location"] },
1516
+ successStatus: 200,
1517
+ declaredStatuses: [400, 401],
1518
+ empty: false
1519
+ }, requestOptions),
1520
+ shells: (requestOptions) => request({ method: "GET", path: `/api/config/shell`, successStatus: 200, declaredStatuses: [400, 401], empty: false }, requestOptions),
1521
+ update: (input, requestOptions) => request({
1522
+ method: "PATCH",
1523
+ path: `/api/experimental/config`,
1524
+ body: { shell: input["shell"] },
1525
+ successStatus: 204,
1526
+ declaredStatuses: [400, 401],
1527
+ empty: true
1528
+ }, requestOptions)
1529
+ }
1530
+ };
1531
+ }
1532
+ function encodePath(value) {
1533
+ return value.split("/").map(encodeURIComponent).join("/");
1534
+ }
1535
+ function appendQuery(params, key, value) {
1536
+ if (value === void 0)
1537
+ return;
1538
+ if (value === null) {
1539
+ params.append(key, "null");
1540
+ return;
1541
+ }
1542
+ if (Array.isArray(value)) {
1543
+ for (const item of value)
1544
+ appendQuery(params, key, item);
1545
+ return;
1546
+ }
1547
+ if (typeof value === "object") {
1548
+ for (const [child, item] of Object.entries(value))
1549
+ appendQuery(params, `${key}[${child}]`, item);
1550
+ return;
1551
+ }
1552
+ params.append(key, String(value));
1553
+ }
1554
+ async function json(response) {
1555
+ if (!isContentType(response, "application/json") && !response.headers.get("content-type")?.includes("+json")) {
1556
+ try {
1557
+ await response.body?.cancel();
1558
+ } catch {
1559
+ }
1560
+ throw new ClientError3("UnsupportedContentType", { detail: response.headers.get("content-type") });
1561
+ }
1562
+ let text;
1563
+ try {
1564
+ text = await response.text();
1565
+ } catch (cause) {
1566
+ throw new ClientError3("Transport", { cause });
1567
+ }
1568
+ if (text === "")
1569
+ throw new ClientError3("MalformedResponse");
1570
+ try {
1571
+ return JSON.parse(text);
1572
+ } catch (cause) {
1573
+ throw new ClientError3("MalformedResponse", { cause });
1574
+ }
1575
+ }
1576
+ function declared(body) {
1577
+ const error = Object.assign(new Error(body.message ?? body.data?.message), body);
1578
+ if (body._tag)
1579
+ error.name = body._tag;
1580
+ return error;
1581
+ }
1582
+ function isContentType(response, expected) {
1583
+ return response.headers.get("content-type")?.split(";", 1)[0]?.trim().toLowerCase() === expected;
1584
+ }
1585
+
1586
+ // node_modules/.pnpm/@opencode+client@2.0.18_effect@4.0.0-rc.112/node_modules/@opencode/client/dist/chunks/contract-4tveyqeh.js
1587
+ var isInvalidRequestError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "InvalidRequestError";
1588
+ var isUnauthorizedError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "UnauthorizedError";
1589
+ var isServiceUnavailableError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "ServiceUnavailableError";
1590
+ var isAgentNotFoundError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "AgentNotFoundError";
1591
+ var isInvalidCursorError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "InvalidCursorError";
1592
+ var isSessionNotFoundError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "SessionNotFoundError";
1593
+ var isConflictError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "ConflictError";
1594
+ var isUnknownError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "UnknownError";
1595
+ var isMessageNotFoundError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "MessageNotFoundError";
1596
+ var isCommandNotFoundError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "CommandNotFoundError";
1597
+ var isCommandExecutionError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "CommandExecutionError";
1598
+ var isSkillNotFoundError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "SkillNotFoundError";
1599
+ var isSessionBusyError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "SessionBusyError";
1600
+ var isInstructionEntryValueTooLargeError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "InstructionEntryValueTooLargeError";
1601
+ var isFormNotFoundError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "FormNotFoundError";
1602
+ var isFormInvalidAnswerError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "FormInvalidAnswerError";
1603
+ var isFormAlreadySettledError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "FormAlreadySettledError";
1604
+ var isProviderNotFoundError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "ProviderNotFoundError";
1605
+ var isIntegrationNotFoundError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "IntegrationNotFoundError";
1606
+ var isIntegrationAttemptNotFoundError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "IntegrationAttemptNotFoundError";
1607
+ var isIntegrationMethodNotFoundError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "IntegrationMethodNotFoundError";
1608
+ var isMcpServerNotFoundError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "McpServerNotFoundError";
1609
+ var isProjectNotFoundError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "ProjectNotFoundError";
1610
+ var isPermissionNotFoundError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "PermissionNotFoundError";
1611
+ var isFileNotFoundError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "FileNotFoundError";
1612
+ var isRpcError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "RpcError";
1613
+ var isRpcInternalError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "RpcInternalError";
1614
+ var isPtyNotFoundError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "PtyNotFoundError";
1615
+ var isForbiddenError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "ForbiddenError";
1616
+ var isShellNotFoundError2 = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "ShellNotFoundError";
1617
+ var isWorktreeError2 = (value) => typeof value === "object" && value !== null && "name" in value && value["name"] === "WorktreeError";
1618
+
1619
+ // node_modules/.pnpm/@opencode+client@2.0.18_effect@4.0.0-rc.112/node_modules/@opencode/client/dist/chunks/contract-1tbj6z39.js
1620
+ function makeRpc2(raw, events) {
1621
+ return (definition) => {
1622
+ const subscribe = (name, options) => {
1623
+ if (!Object.hasOwn(definition.events, name))
1624
+ throw new Error(`Unknown RPC event: ${definition.id}.${name}`);
1625
+ const type = eventType(definition, name);
1626
+ return {
1627
+ [Symbol.asyncIterator]() {
1628
+ const controller = new AbortController();
1629
+ const signal = options?.signal ? AbortSignal.any([controller.signal, options.signal]) : controller.signal;
1630
+ const iterator = (async function* () {
1631
+ try {
1632
+ for await (const published of events.subscribe({ signal })) {
1633
+ if (signal.aborted)
1634
+ return;
1635
+ if (published.type !== type)
1636
+ continue;
1637
+ yield published;
1638
+ }
1639
+ } catch (error) {
1640
+ if (!signal.aborted)
1641
+ throw error;
1642
+ } finally {
1643
+ controller.abort();
1644
+ }
1645
+ })();
1646
+ return {
1647
+ next: () => iterator.next(),
1648
+ return: () => {
1649
+ controller.abort();
1650
+ return iterator.return();
1651
+ }
1652
+ };
1653
+ }
1654
+ };
1655
+ };
1656
+ return Object.assign(Object.fromEntries(Object.keys(definition.methods).map((name) => [
1657
+ name,
1658
+ async (input, options) => {
1659
+ try {
1660
+ const result = await raw.rpc.call({
1661
+ rpcID: definition.id,
1662
+ method: name,
1663
+ input,
1664
+ location: options?.location
1665
+ }, { signal: options?.signal, headers: options?.headers });
1666
+ return result.output;
1667
+ } catch (error) {
1668
+ if (!isRpcError2(error) && !isRpcInternalError2(error))
1669
+ throw error;
1670
+ throw error.data === void 0 ? { type: error.type, message: error.message } : { type: error.type, message: error.message, data: error.data };
1671
+ }
1672
+ }
1673
+ ])), {
1674
+ events: {
1675
+ subscribe,
1676
+ on: (name, handler, options) => {
1677
+ const controller = new AbortController();
1678
+ const signal = options?.signal ? AbortSignal.any([controller.signal, options.signal]) : controller.signal;
1679
+ const source = subscribe(name, { signal });
1680
+ (async () => {
1681
+ for await (const event of source)
1682
+ await handler(event);
1683
+ })().catch((error) => console.error(error));
1684
+ return () => controller.abort();
1685
+ }
1686
+ }
1687
+ });
1688
+ };
1689
+ }
1690
+ function eventType(definition, name) {
1691
+ return `rpc.${definition.id}.${name}`;
1692
+ }
1693
+
1694
+ // node_modules/.pnpm/@opencode+client@2.0.18_effect@4.0.0-rc.112/node_modules/@opencode/client/dist/chunks/contract-hg4r8g3y.js
1695
+ var exports_client3 = {};
1696
+ __export(exports_client3, {
1697
+ OpenCode: () => exports_client3,
1698
+ make: () => make5
1699
+ });
1700
+ function make5(options) {
1701
+ const raw = make6(options);
1702
+ const events = make7((signal, onActivity) => raw.event.subscribe({ signal, onActivity }));
1703
+ return {
1704
+ ...raw,
1705
+ rpc: Object.assign(makeRpc2(raw, events), raw.rpc),
1706
+ event: events
1707
+ };
1708
+ }
1709
+
1710
+ export {
1711
+ __export,
1712
+ ClientError3,
1713
+ isInvalidRequestError2,
1714
+ isUnauthorizedError2,
1715
+ isServiceUnavailableError2,
1716
+ isAgentNotFoundError2,
1717
+ isInvalidCursorError2,
1718
+ isSessionNotFoundError2,
1719
+ isConflictError2,
1720
+ isUnknownError2,
1721
+ isMessageNotFoundError2,
1722
+ isCommandNotFoundError2,
1723
+ isCommandExecutionError2,
1724
+ isSkillNotFoundError2,
1725
+ isSessionBusyError2,
1726
+ isInstructionEntryValueTooLargeError2,
1727
+ isFormNotFoundError2,
1728
+ isFormInvalidAnswerError2,
1729
+ isFormAlreadySettledError2,
1730
+ isProviderNotFoundError2,
1731
+ isIntegrationNotFoundError2,
1732
+ isIntegrationAttemptNotFoundError2,
1733
+ isIntegrationMethodNotFoundError2,
1734
+ isMcpServerNotFoundError2,
1735
+ isProjectNotFoundError2,
1736
+ isPermissionNotFoundError2,
1737
+ isFileNotFoundError2,
1738
+ isRpcError2,
1739
+ isRpcInternalError2,
1740
+ isPtyNotFoundError2,
1741
+ isForbiddenError2,
1742
+ isShellNotFoundError2,
1743
+ isWorktreeError2,
1744
+ exports_client3
1745
+ };