@opencode/client 0.0.0-dev-192 → 0.0.0-dev-201

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 (68) hide show
  1. package/dist/chunks/{service-8jxa4f6s.js → shared-events-00979gww.js} +17 -17
  2. package/dist/chunks/{service-8we1dz3p.js → shared-events-0f3b9fnq.js} +5 -5
  3. package/dist/chunks/shared-events-60xe5cbf.js +4 -0
  4. package/dist/chunks/{service-y2etg5bs.js → shared-events-7f0py9js.js} +2 -2
  5. package/dist/chunks/{service-8ye1ye6f.js → shared-events-8ye1ye6f.js} +2 -2
  6. package/dist/chunks/shared-events-ek8qkqrq.js +30 -0
  7. package/dist/chunks/{service-gecjxyvt.js → shared-events-gecjxyvt.js} +1 -1
  8. package/dist/chunks/{service-m37zsx6v.js → shared-events-j4snqxar.js} +207 -126
  9. package/dist/chunks/{service-nwcpakzx.js → shared-events-js54wxgp.js} +2 -2
  10. package/dist/chunks/{service-cyxwqteg.js → shared-events-khkm0pf7.js} +6 -2
  11. package/dist/chunks/{service-15p82y03.js → shared-events-myz4ngx9.js} +5 -5
  12. package/dist/chunks/{service-ryy6kscr.js → shared-events-ryy6kscr.js} +1 -1
  13. package/dist/chunks/{service-0mrkn4v6.js → shared-events-sp3vqdnr.js} +446 -374
  14. package/dist/chunks/{service-h6f391n3.js → shared-events-yhgf3er7.js} +2 -2
  15. package/dist/chunks/{service-ab9bm97w.js → shared-events-z11mztjj.js} +1 -1
  16. package/dist/contract.d.ts +1 -1
  17. package/dist/contract.js +3 -1
  18. package/dist/effect/api/api.d.ts +589 -342
  19. package/dist/effect/client.d.ts +174 -121
  20. package/dist/effect/client.js +12 -12
  21. package/dist/effect/generated/client-error.js +3 -3
  22. package/dist/effect/generated/client.d.ts +209 -122
  23. package/dist/effect/generated/client.js +5 -5
  24. package/dist/effect/generated/index.js +8 -8
  25. package/dist/effect/index.js +12 -12
  26. package/dist/effect/rpc.js +4 -4
  27. package/dist/effect/service.js +6 -6
  28. package/dist/promise/api.d.ts +3 -0
  29. package/dist/promise/client.d.ts +198 -137
  30. package/dist/promise/client.js +11 -11
  31. package/dist/promise/generated/client-error.js +3 -3
  32. package/dist/promise/generated/client.d.ts +234 -138
  33. package/dist/promise/generated/client.js +4 -4
  34. package/dist/promise/generated/index.js +12 -12
  35. package/dist/promise/generated/types.d.ts +463 -363
  36. package/dist/promise/generated/types.js +5 -5
  37. package/dist/promise/index.js +16 -16
  38. package/dist/promise/rpc.js +2 -2
  39. package/dist/promise/service.js +6 -6
  40. package/dist/pty-handoff.js +4 -4
  41. package/dist/rpc-runtime.js +1 -1
  42. package/dist/service-contender.js +1 -1
  43. package/dist/service-probe.js +3 -3
  44. package/dist/service-timing.js +1 -1
  45. package/dist/service-version.js +1 -1
  46. package/dist/service.js +1 -1
  47. package/dist/shared-events.js +1 -1
  48. package/dist/solid/connection.js +1 -1
  49. package/dist/solid/data.js +9 -9
  50. package/dist/solid/index.js +13 -13
  51. package/dist/solid/pty.js +1 -1
  52. package/dist/solid/retention.js +1 -1
  53. package/dist/solid/usage.js +1 -1
  54. package/package.json +4 -4
  55. package/dist/chunks/service-nrbbv8kf.js +0 -30
  56. package/dist/chunks/service-vmytr4q8.js +0 -4
  57. /package/dist/chunks/{service-6mptkzbc.js → shared-events-6mptkzbc.js} +0 -0
  58. /package/dist/chunks/{service-6mq2wh8y.js → shared-events-6mq2wh8y.js} +0 -0
  59. /package/dist/chunks/{service-8s2anffy.js → shared-events-8s2anffy.js} +0 -0
  60. /package/dist/chunks/{service-9rqn6x4v.js → shared-events-9rqn6x4v.js} +0 -0
  61. /package/dist/chunks/{service-gne7h7mq.js → shared-events-gne7h7mq.js} +0 -0
  62. /package/dist/chunks/{service-m2eywc8w.js → shared-events-m2eywc8w.js} +0 -0
  63. /package/dist/chunks/{service-qav6mfdz.js → shared-events-qav6mfdz.js} +0 -0
  64. /package/dist/chunks/{service-sxt88q69.js → shared-events-sxt88q69.js} +0 -0
  65. /package/dist/chunks/{service-ve4aws36.js → shared-events-ve4aws36.js} +0 -0
  66. /package/dist/chunks/{service-vyas3vgt.js → shared-events-vyas3vgt.js} +0 -0
  67. /package/dist/chunks/{service-xgnj2w4v.js → shared-events-xgnj2w4v.js} +0 -0
  68. /package/dist/chunks/{service-ydhz1zrh.js → shared-events-ydhz1zrh.js} +0 -0
@@ -1,17 +1,17 @@
1
1
  import {
2
- ClientError3
3
- } from "./service-nwcpakzx.js";
2
+ ClientError2
3
+ } from "./shared-events-js54wxgp.js";
4
4
  import {
5
5
  __export
6
- } from "./service-9rqn6x4v.js";
6
+ } from "./shared-events-9rqn6x4v.js";
7
7
 
8
8
  // src/promise/generated/client.ts
9
- var exports_client4 = {};
10
- __export(exports_client4, {
11
- make: () => make6
9
+ var exports_client2 = {};
10
+ __export(exports_client2, {
11
+ make: () => make3
12
12
  });
13
13
  var maxSseEventBytes = 16 * 1024 * 1024;
14
- function make6(options) {
14
+ function make3(options) {
15
15
  const fetch = options.fetch ?? globalThis.fetch;
16
16
  const prepare = (descriptor, requestOptions) => {
17
17
  const baseUrl = new URL(options.baseUrl);
@@ -44,7 +44,7 @@ function make6(options) {
44
44
  const prepared = prepare(descriptor, requestOptions);
45
45
  return await fetch(prepared.url, prepared.init);
46
46
  } catch (cause) {
47
- throw new ClientError3("Transport", { cause });
47
+ throw new ClientError2("Transport", { cause });
48
48
  }
49
49
  };
50
50
  const responseError = async (response, descriptor) => {
@@ -53,7 +53,7 @@ function make6(options) {
53
53
  try {
54
54
  await response.body?.cancel();
55
55
  } catch {}
56
- throw new ClientError3("UnexpectedStatus", { cause: { status: response.status }, detail: String(response.status) });
56
+ throw new ClientError2("UnexpectedStatus", { cause: { status: response.status }, detail: String(response.status) });
57
57
  };
58
58
  const request = async (descriptor, requestOptions) => {
59
59
  const response = await execute(descriptor, requestOptions);
@@ -78,10 +78,10 @@ function make6(options) {
78
78
  try {
79
79
  await response.body?.cancel();
80
80
  } catch {}
81
- throw new ClientError3("UnsupportedContentType", { detail: response.headers.get("content-type") });
81
+ throw new ClientError2("UnsupportedContentType", { detail: response.headers.get("content-type") });
82
82
  }
83
83
  if (response.body === null)
84
- throw new ClientError3("MalformedResponse");
84
+ throw new ClientError2("MalformedResponse");
85
85
  const reader = response.body.getReader();
86
86
  const decoder = new TextDecoder;
87
87
  let buffer = "";
@@ -91,13 +91,13 @@ function make6(options) {
91
91
  try {
92
92
  next = await reader.read();
93
93
  } catch (cause) {
94
- throw new ClientError3("Transport", { cause });
94
+ throw new ClientError2("Transport", { cause });
95
95
  }
96
96
  if (!next.done)
97
97
  requestOptions?.onActivity?.();
98
98
  buffer += decoder.decode(next.value, { stream: !next.done });
99
99
  if (buffer.length > maxSseEventBytes)
100
- throw new ClientError3("SseEventTooLarge");
100
+ throw new ClientError2("SseEventTooLarge");
101
101
  const trailingCarriageReturn = !next.done && buffer.endsWith("\r");
102
102
  if (trailingCarriageReturn)
103
103
  buffer = buffer.slice(0, -1);
@@ -124,7 +124,7 @@ function make6(options) {
124
124
  try {
125
125
  yield JSON.parse(data);
126
126
  } catch (cause) {
127
- throw new ClientError3("MalformedResponse", { cause });
127
+ throw new ClientError2("MalformedResponse", { cause });
128
128
  }
129
129
  }
130
130
  boundary = buffer.indexOf(`
@@ -142,7 +142,7 @@ function make6(options) {
142
142
  }
143
143
  }
144
144
  });
145
- return {
145
+ const client = {
146
146
  server: {
147
147
  info: (requestOptions) => request({ method: "GET", path: `/api/info`, successStatus: 200, declaredStatuses: [400, 401], empty: false }, requestOptions),
148
148
  pair: (requestOptions) => request({ method: "POST", path: `/api/pair`, successStatus: 200, declaredStatuses: [400, 401], empty: false }, requestOptions),
@@ -244,20 +244,6 @@ function make6(options) {
244
244
  declaredStatuses: [400, 401],
245
245
  empty: false
246
246
  }, requestOptions),
247
- stats: (input, requestOptions) => request({
248
- method: "GET",
249
- path: `/api/experimental/session/stats`,
250
- query: {
251
- from: input?.["from"],
252
- to: input?.["to"],
253
- project: input?.["project"],
254
- timezone: input?.["timezone"],
255
- tools: input?.["tools"]
256
- },
257
- successStatus: 200,
258
- declaredStatuses: [400, 401],
259
- empty: false
260
- }, requestOptions).then((value) => value.data),
261
247
  create: (input, requestOptions) => request({
262
248
  method: "POST",
263
249
  path: `/api/session`,
@@ -275,22 +261,6 @@ function make6(options) {
275
261
  declaredStatuses: [400, 401, 404],
276
262
  empty: false
277
263
  }, requestOptions).then((value) => value.data),
278
- import: (input, requestOptions) => request({
279
- method: "POST",
280
- path: `/api/experimental/session/import`,
281
- body: { info: input["info"], messages: input["messages"], location: input["location"] },
282
- successStatus: 200,
283
- declaredStatuses: [400, 401, 404, 409],
284
- empty: false
285
- }, requestOptions).then((value) => value.data),
286
- export: (input, requestOptions) => request({
287
- method: "GET",
288
- path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/export`,
289
- query: { sanitize: input["sanitize"] },
290
- successStatus: 200,
291
- declaredStatuses: [400, 401, 404, 500],
292
- empty: false
293
- }, requestOptions).then((value) => value.data),
294
264
  active: (requestOptions) => request({
295
265
  method: "GET",
296
266
  path: `/api/session/active`,
@@ -389,14 +359,6 @@ function make6(options) {
389
359
  declaredStatuses: [400, 401, 404, 500],
390
360
  empty: true
391
361
  }, requestOptions),
392
- skill: (input, requestOptions) => request({
393
- method: "POST",
394
- path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/skill`,
395
- body: { id: input["id"], resume: input["resume"] },
396
- successStatus: 204,
397
- declaredStatuses: [400, 401, 404],
398
- empty: true
399
- }, requestOptions),
400
362
  synthetic: (input, requestOptions) => request({
401
363
  method: "POST",
402
364
  path: `/api/session/${encodeURIComponent(input.sessionID)}/synthetic`,
@@ -428,13 +390,6 @@ function make6(options) {
428
390
  declaredStatuses: [400, 401, 404, 409],
429
391
  empty: false
430
392
  }, requestOptions).then((value) => value.data),
431
- wait: (input, requestOptions) => request({
432
- method: "POST",
433
- path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/wait`,
434
- successStatus: 204,
435
- declaredStatuses: [400, 401, 404, 503],
436
- empty: true
437
- }, requestOptions),
438
393
  revert: {
439
394
  stage: (input, requestOptions) => request({
440
395
  method: "POST",
@@ -498,32 +453,6 @@ function make6(options) {
498
453
  empty: true
499
454
  }, requestOptions)
500
455
  },
501
- instructions: {
502
- entry: {
503
- list: (input, requestOptions) => request({
504
- method: "GET",
505
- path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/instructions/entries`,
506
- successStatus: 200,
507
- declaredStatuses: [400, 401, 404],
508
- empty: false
509
- }, requestOptions).then((value) => value.data),
510
- put: (input, requestOptions) => request({
511
- method: "PUT",
512
- path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/instructions/entries/${encodeURIComponent(input.key)}`,
513
- body: { value: input["value"] },
514
- successStatus: 204,
515
- declaredStatuses: [400, 401, 404, 413],
516
- empty: true
517
- }, requestOptions),
518
- remove: (input, requestOptions) => request({
519
- method: "DELETE",
520
- path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/instructions/entries/${encodeURIComponent(input.key)}`,
521
- successStatus: 204,
522
- declaredStatuses: [400, 401, 404],
523
- empty: true
524
- }, requestOptions)
525
- }
526
- },
527
456
  generate: (input, requestOptions) => request({
528
457
  method: "POST",
529
458
  path: `/api/session/${encodeURIComponent(input.sessionID)}/generate`,
@@ -532,14 +461,6 @@ function make6(options) {
532
461
  declaredStatuses: [400, 401, 404, 503],
533
462
  empty: false
534
463
  }, requestOptions).then((value) => value.data),
535
- log: (input, requestOptions) => sse({
536
- method: "GET",
537
- path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/log`,
538
- query: { after: input["after"], follow: input["follow"] },
539
- successStatus: 200,
540
- declaredStatuses: [400, 401, 404],
541
- empty: false
542
- }, requestOptions),
543
464
  interrupt: (input, requestOptions) => request({
544
465
  method: "POST",
545
466
  path: `/api/session/${encodeURIComponent(input.sessionID)}/interrupt`,
@@ -600,26 +521,372 @@ function make6(options) {
600
521
  path: `/api/session/${encodeURIComponent(input.sessionID)}/form/${encodeURIComponent(input.formID)}`,
601
522
  query: { message: input["message"] },
602
523
  successStatus: 204,
603
- declaredStatuses: [400, 401, 404, 409],
524
+ declaredStatuses: [400, 401, 404, 409],
525
+ empty: true
526
+ }, requestOptions)
527
+ },
528
+ environment: (input, requestOptions) => request({
529
+ method: "PUT",
530
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/environment`,
531
+ body: { variables: input["variables"] },
532
+ successStatus: 204,
533
+ declaredStatuses: [400, 401, 404],
534
+ empty: true
535
+ }, requestOptions),
536
+ view: (input, requestOptions) => request({
537
+ method: "POST",
538
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/view`,
539
+ body: { idle: input["idle"] },
540
+ successStatus: 204,
541
+ declaredStatuses: [400, 401, 404],
542
+ empty: true
543
+ }, requestOptions)
544
+ },
545
+ experimental: {
546
+ session: {
547
+ stats: (input, requestOptions) => request({
548
+ method: "GET",
549
+ path: `/api/experimental/session/stats`,
550
+ query: {
551
+ from: input?.["from"],
552
+ to: input?.["to"],
553
+ project: input?.["project"],
554
+ timezone: input?.["timezone"],
555
+ tools: input?.["tools"]
556
+ },
557
+ successStatus: 200,
558
+ declaredStatuses: [400, 401],
559
+ empty: false
560
+ }, requestOptions).then((value) => value.data),
561
+ import: (input, requestOptions) => request({
562
+ method: "POST",
563
+ path: `/api/experimental/session/import`,
564
+ body: { info: input["info"], messages: input["messages"], location: input["location"] },
565
+ successStatus: 200,
566
+ declaredStatuses: [400, 401, 404, 409],
567
+ empty: false
568
+ }, requestOptions).then((value) => value.data),
569
+ export: (input, requestOptions) => request({
570
+ method: "GET",
571
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/export`,
572
+ query: { sanitize: input["sanitize"] },
573
+ successStatus: 200,
574
+ declaredStatuses: [400, 401, 404, 500],
575
+ empty: false
576
+ }, requestOptions).then((value) => value.data),
577
+ skill: (input, requestOptions) => request({
578
+ method: "POST",
579
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/skill`,
580
+ body: { id: input["id"], resume: input["resume"] },
581
+ successStatus: 204,
582
+ declaredStatuses: [400, 401, 404],
583
+ empty: true
584
+ }, requestOptions),
585
+ wait: (input, requestOptions) => request({
586
+ method: "POST",
587
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/wait`,
588
+ successStatus: 204,
589
+ declaredStatuses: [400, 401, 404, 503],
590
+ empty: true
591
+ }, requestOptions),
592
+ instructions: {
593
+ entry: {
594
+ list: (input, requestOptions) => request({
595
+ method: "GET",
596
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/instructions/entries`,
597
+ successStatus: 200,
598
+ declaredStatuses: [400, 401, 404],
599
+ empty: false
600
+ }, requestOptions).then((value) => value.data),
601
+ put: (input, requestOptions) => request({
602
+ method: "PUT",
603
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/instructions/entries/${encodeURIComponent(input.key)}`,
604
+ body: { value: input["value"] },
605
+ successStatus: 204,
606
+ declaredStatuses: [400, 401, 404, 413],
607
+ empty: true
608
+ }, requestOptions),
609
+ remove: (input, requestOptions) => request({
610
+ method: "DELETE",
611
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/instructions/entries/${encodeURIComponent(input.key)}`,
612
+ successStatus: 204,
613
+ declaredStatuses: [400, 401, 404],
614
+ empty: true
615
+ }, requestOptions)
616
+ }
617
+ },
618
+ log: (input, requestOptions) => sse({
619
+ method: "GET",
620
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/log`,
621
+ query: { after: input["after"], follow: input["follow"] },
622
+ successStatus: 200,
623
+ declaredStatuses: [400, 401, 404],
624
+ empty: false
625
+ }, requestOptions)
626
+ },
627
+ generate: {
628
+ text: (input, requestOptions) => request({
629
+ method: "POST",
630
+ path: `/api/experimental/generate/text`,
631
+ body: { prompt: input["prompt"], model: input["model"] },
632
+ successStatus: 200,
633
+ declaredStatuses: [400, 401, 404, 422, 502, 503],
634
+ empty: false
635
+ }, requestOptions).then((value) => value.data),
636
+ image: (input, requestOptions) => request({
637
+ method: "POST",
638
+ path: `/api/experimental/generate/image`,
639
+ body: {
640
+ model: input["model"],
641
+ prompt: input["prompt"],
642
+ images: input["images"],
643
+ n: input["n"],
644
+ aspect: input["aspect"],
645
+ resolution: input["resolution"]
646
+ },
647
+ successStatus: 200,
648
+ declaredStatuses: [400, 401, 404, 422, 502, 503],
649
+ empty: false
650
+ }, requestOptions).then((value) => value.data),
651
+ decisions: (input, requestOptions) => request({
652
+ method: "POST",
653
+ path: `/api/experimental/generate/decisions`,
654
+ body: { model: input["model"], input: input["input"], questions: input["questions"] },
655
+ successStatus: 200,
656
+ declaredStatuses: [400, 401, 404, 422, 502, 503],
657
+ empty: false
658
+ }, requestOptions).then((value) => value.data)
659
+ },
660
+ voice: {
661
+ models: (requestOptions) => request({
662
+ method: "GET",
663
+ path: `/api/experimental/voice/models`,
664
+ successStatus: 200,
665
+ declaredStatuses: [400, 401, 404, 503],
666
+ empty: false
667
+ }, requestOptions).then((value) => value.data),
668
+ session: (input, requestOptions) => request({
669
+ method: "POST",
670
+ path: `/api/experimental/voice/session`,
671
+ body: { model: input["model"], session: input["session"], transport: input["transport"] },
672
+ successStatus: 200,
673
+ declaredStatuses: [400, 401, 404, 503],
674
+ empty: false
675
+ }, requestOptions).then((value) => value.data)
676
+ },
677
+ integration: {
678
+ wellknown: {
679
+ add: (input, requestOptions) => request({
680
+ method: "POST",
681
+ path: `/api/experimental/integration/wellknown`,
682
+ query: { location: input["location"] },
683
+ body: { url: input["url"] },
684
+ successStatus: 204,
685
+ declaredStatuses: [400, 401, 404],
686
+ empty: true
687
+ }, requestOptions)
688
+ }
689
+ },
690
+ mcp: {
691
+ add: (input, requestOptions) => request({
692
+ method: "PUT",
693
+ path: `/api/experimental/mcp/${encodeURIComponent(input.server)}`,
694
+ query: { location: input["location"] },
695
+ body: { config: input["config"] },
696
+ successStatus: 204,
697
+ declaredStatuses: [400, 401, 404],
698
+ empty: true
699
+ }, requestOptions),
700
+ remove: (input, requestOptions) => request({
701
+ method: "DELETE",
702
+ path: `/api/experimental/mcp/${encodeURIComponent(input.server)}`,
703
+ query: { location: input["location"] },
704
+ successStatus: 204,
705
+ declaredStatuses: [400, 401, 404],
706
+ empty: true
707
+ }, requestOptions),
708
+ connect: (input, requestOptions) => request({
709
+ method: "POST",
710
+ path: `/api/experimental/mcp/${encodeURIComponent(input.server)}/connect`,
711
+ query: { location: input["location"] },
712
+ successStatus: 204,
713
+ declaredStatuses: [400, 401, 404],
714
+ empty: true
715
+ }, requestOptions),
716
+ disconnect: (input, requestOptions) => request({
717
+ method: "POST",
718
+ path: `/api/experimental/mcp/${encodeURIComponent(input.server)}/disconnect`,
719
+ query: { location: input["location"] },
720
+ successStatus: 204,
721
+ declaredStatuses: [400, 401, 404],
722
+ empty: true
723
+ }, requestOptions),
724
+ client: {
725
+ token: (input, requestOptions) => request({
726
+ method: "POST",
727
+ path: `/api/experimental/client-mcp/token`,
728
+ query: { location: input["location"], name: input["name"] },
729
+ headers: { "x-opencode-ticket": input["x-opencode-ticket"] },
730
+ successStatus: 200,
731
+ declaredStatuses: [400, 401, 403, 404],
732
+ empty: false
733
+ }, requestOptions)
734
+ }
735
+ },
736
+ file: {
737
+ write: (input, requestOptions) => request({
738
+ method: "POST",
739
+ path: `/api/experimental/fs/write`,
740
+ query: { location: input["location"], path: input["path"] },
741
+ body: input["payload"],
742
+ successStatus: 200,
743
+ declaredStatuses: [400, 401, 404],
744
+ empty: false,
745
+ binaryBody: true
746
+ }, requestOptions),
747
+ watch: (input, requestOptions) => request({
748
+ method: "POST",
749
+ path: `/api/experimental/fs/watch`,
750
+ query: { location: input["location"] },
751
+ body: { path: input["path"] },
752
+ successStatus: 204,
753
+ declaredStatuses: [400, 401, 404, 503],
754
+ empty: true
755
+ }, requestOptions),
756
+ unwatch: (input, requestOptions) => request({
757
+ method: "DELETE",
758
+ path: `/api/experimental/fs/watch`,
759
+ query: { location: input["location"] },
760
+ body: { path: input["path"] },
761
+ successStatus: 204,
762
+ declaredStatuses: [400, 401, 404],
763
+ empty: true
764
+ }, requestOptions)
765
+ },
766
+ persistentPty: {
767
+ read: (input, requestOptions) => request({
768
+ method: "GET",
769
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/terminal/read`,
770
+ query: { lines: input["lines"] },
771
+ successStatus: 200,
772
+ declaredStatuses: [400, 401, 503],
773
+ empty: false
774
+ }, requestOptions).then((value) => value.data),
775
+ list: (input, requestOptions) => request({
776
+ method: "GET",
777
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/terminal`,
778
+ successStatus: 200,
779
+ declaredStatuses: [400, 401, 503],
780
+ empty: false
781
+ }, requestOptions).then((value) => value.data),
782
+ create: (input, requestOptions) => request({
783
+ method: "POST",
784
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/terminal`,
785
+ body: {
786
+ command: input["command"],
787
+ args: input["args"],
788
+ cwd: input["cwd"],
789
+ title: input["title"],
790
+ env: input["env"],
791
+ size: input["size"]
792
+ },
793
+ successStatus: 200,
794
+ declaredStatuses: [400, 401, 503],
795
+ empty: false
796
+ }, requestOptions).then((value) => value.data),
797
+ shutdown: (requestOptions) => request({
798
+ method: "POST",
799
+ path: `/api/experimental/persistent-pty/shutdown`,
800
+ successStatus: 204,
801
+ declaredStatuses: [400, 401, 503],
802
+ empty: true
803
+ }, requestOptions),
804
+ handoff: (requestOptions) => request({
805
+ method: "POST",
806
+ path: `/api/experimental/persistent-pty/handoff`,
807
+ successStatus: 200,
808
+ declaredStatuses: [400, 401, 503],
809
+ empty: false
810
+ }, requestOptions),
811
+ get: (input, requestOptions) => request({
812
+ method: "GET",
813
+ path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}`,
814
+ successStatus: 200,
815
+ declaredStatuses: [400, 401, 404, 503],
816
+ empty: false
817
+ }, requestOptions).then((value) => value.data),
818
+ update: (input, requestOptions) => request({
819
+ method: "PUT",
820
+ path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}`,
821
+ body: { attachmentID: input["attachmentID"], size: input["size"] },
822
+ successStatus: 200,
823
+ declaredStatuses: [400, 401, 404, 503],
824
+ empty: false
825
+ }, requestOptions).then((value) => value.data),
826
+ snapshot: (input, requestOptions) => request({
827
+ method: "GET",
828
+ path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}/snapshot`,
829
+ successStatus: 200,
830
+ declaredStatuses: [400, 401, 404, 503],
831
+ empty: false
832
+ }, requestOptions).then((value) => value.data),
833
+ remove: (input, requestOptions) => request({
834
+ method: "DELETE",
835
+ path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}`,
836
+ successStatus: 204,
837
+ declaredStatuses: [400, 401, 404, 503],
838
+ empty: true
839
+ }, requestOptions),
840
+ connectToken: (input, requestOptions) => request({
841
+ method: "POST",
842
+ path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}/connect-token`,
843
+ headers: { "x-opencode-ticket": input["x-opencode-ticket"] },
844
+ successStatus: 200,
845
+ declaredStatuses: [400, 401, 403, 404, 503],
846
+ empty: false
847
+ }, requestOptions).then((value) => value.data)
848
+ },
849
+ media: {
850
+ get: (input, requestOptions) => request({
851
+ method: "GET",
852
+ path: `/api/experimental/media/${encodeURIComponent(input.hash)}`,
853
+ successStatus: 200,
854
+ declaredStatuses: [400, 401, 404],
855
+ empty: false,
856
+ binary: true
857
+ }, requestOptions)
858
+ },
859
+ migration: {
860
+ v1: {
861
+ status: (requestOptions) => request({
862
+ method: "GET",
863
+ path: `/api/experimental/migration/v1`,
864
+ successStatus: 200,
865
+ declaredStatuses: [400, 401],
866
+ empty: false
867
+ }, requestOptions)
868
+ }
869
+ },
870
+ usage: {
871
+ limits: (input, requestOptions) => request({
872
+ method: "GET",
873
+ path: `/api/experimental/usage/limits`,
874
+ query: { location: input?.["location"] },
875
+ successStatus: 200,
876
+ declaredStatuses: [400, 401, 404, 503],
877
+ empty: false
878
+ }, requestOptions)
879
+ },
880
+ config: {
881
+ update: (input, requestOptions) => request({
882
+ method: "PATCH",
883
+ path: `/api/experimental/config`,
884
+ body: { shell: input["shell"] },
885
+ successStatus: 204,
886
+ declaredStatuses: [400, 401, 404],
604
887
  empty: true
605
888
  }, requestOptions)
606
- },
607
- environment: (input, requestOptions) => request({
608
- method: "PUT",
609
- path: `/api/session/${encodeURIComponent(input.sessionID)}/environment`,
610
- body: { variables: input["variables"] },
611
- successStatus: 204,
612
- declaredStatuses: [400, 401, 404],
613
- empty: true
614
- }, requestOptions),
615
- view: (input, requestOptions) => request({
616
- method: "POST",
617
- path: `/api/session/${encodeURIComponent(input.sessionID)}/view`,
618
- body: { idle: input["idle"] },
619
- successStatus: 204,
620
- declaredStatuses: [400, 401, 404],
621
- empty: true
622
- }, requestOptions)
889
+ }
623
890
  },
624
891
  message: {
625
892
  list: (input, requestOptions) => request({
@@ -649,56 +916,6 @@ function make6(options) {
649
916
  empty: false
650
917
  }, requestOptions)
651
918
  },
652
- generate: {
653
- text: (input, requestOptions) => request({
654
- method: "POST",
655
- path: `/api/experimental/generate/text`,
656
- body: { prompt: input["prompt"], model: input["model"] },
657
- successStatus: 200,
658
- declaredStatuses: [400, 401, 404, 422, 502, 503],
659
- empty: false
660
- }, requestOptions).then((value) => value.data),
661
- image: (input, requestOptions) => request({
662
- method: "POST",
663
- path: `/api/experimental/generate/image`,
664
- body: {
665
- model: input["model"],
666
- prompt: input["prompt"],
667
- images: input["images"],
668
- n: input["n"],
669
- aspect: input["aspect"],
670
- resolution: input["resolution"]
671
- },
672
- successStatus: 200,
673
- declaredStatuses: [400, 401, 404, 422, 502, 503],
674
- empty: false
675
- }, requestOptions).then((value) => value.data),
676
- decisions: (input, requestOptions) => request({
677
- method: "POST",
678
- path: `/api/experimental/generate/decisions`,
679
- body: { model: input["model"], input: input["input"], questions: input["questions"] },
680
- successStatus: 200,
681
- declaredStatuses: [400, 401, 404, 422, 502, 503],
682
- empty: false
683
- }, requestOptions).then((value) => value.data)
684
- },
685
- voice: {
686
- models: (requestOptions) => request({
687
- method: "GET",
688
- path: `/api/experimental/voice/models`,
689
- successStatus: 200,
690
- declaredStatuses: [400, 401, 404, 503],
691
- empty: false
692
- }, requestOptions).then((value) => value.data),
693
- session: (input, requestOptions) => request({
694
- method: "POST",
695
- path: `/api/experimental/voice/session`,
696
- body: { model: input["model"], session: input["session"], transport: input["transport"] },
697
- successStatus: 200,
698
- declaredStatuses: [400, 401, 404, 503],
699
- empty: false
700
- }, requestOptions).then((value) => value.data)
701
- },
702
919
  provider: {
703
920
  list: (input, requestOptions) => request({
704
921
  method: "GET",
@@ -734,17 +951,6 @@ function make6(options) {
734
951
  declaredStatuses: [400, 401, 404],
735
952
  empty: false
736
953
  }, requestOptions),
737
- wellknown: {
738
- add: (input, requestOptions) => request({
739
- method: "POST",
740
- path: `/api/experimental/integration/wellknown`,
741
- query: { location: input["location"] },
742
- body: { url: input["url"] },
743
- successStatus: 204,
744
- declaredStatuses: [400, 401, 404],
745
- empty: true
746
- }, requestOptions)
747
- },
748
954
  connect: {
749
955
  key: (input, requestOptions) => request({
750
956
  method: "POST",
@@ -838,39 +1044,6 @@ function make6(options) {
838
1044
  declaredStatuses: [400, 401, 404],
839
1045
  empty: false
840
1046
  }, requestOptions),
841
- add: (input, requestOptions) => request({
842
- method: "PUT",
843
- path: `/api/experimental/mcp/${encodeURIComponent(input.server)}`,
844
- query: { location: input["location"] },
845
- body: { config: input["config"] },
846
- successStatus: 204,
847
- declaredStatuses: [400, 401, 404],
848
- empty: true
849
- }, requestOptions),
850
- remove: (input, requestOptions) => request({
851
- method: "DELETE",
852
- path: `/api/experimental/mcp/${encodeURIComponent(input.server)}`,
853
- query: { location: input["location"] },
854
- successStatus: 204,
855
- declaredStatuses: [400, 401, 404],
856
- empty: true
857
- }, requestOptions),
858
- connect: (input, requestOptions) => request({
859
- method: "POST",
860
- path: `/api/experimental/mcp/${encodeURIComponent(input.server)}/connect`,
861
- query: { location: input["location"] },
862
- successStatus: 204,
863
- declaredStatuses: [400, 401, 404],
864
- empty: true
865
- }, requestOptions),
866
- disconnect: (input, requestOptions) => request({
867
- method: "POST",
868
- path: `/api/experimental/mcp/${encodeURIComponent(input.server)}/disconnect`,
869
- query: { location: input["location"] },
870
- successStatus: 204,
871
- declaredStatuses: [400, 401, 404],
872
- empty: true
873
- }, requestOptions),
874
1047
  resource: {
875
1048
  catalog: (input, requestOptions) => request({
876
1049
  method: "GET",
@@ -880,17 +1053,6 @@ function make6(options) {
880
1053
  declaredStatuses: [400, 401, 404],
881
1054
  empty: false
882
1055
  }, requestOptions)
883
- },
884
- client: {
885
- token: (input, requestOptions) => request({
886
- method: "POST",
887
- path: `/api/experimental/client-mcp/token`,
888
- query: { location: input["location"], name: input["name"] },
889
- headers: { "x-opencode-ticket": input["x-opencode-ticket"] },
890
- successStatus: 200,
891
- declaredStatuses: [400, 401, 403, 404],
892
- empty: false
893
- }, requestOptions)
894
1056
  }
895
1057
  },
896
1058
  credential: {
@@ -1065,34 +1227,6 @@ function make6(options) {
1065
1227
  successStatus: 200,
1066
1228
  declaredStatuses: [400, 401, 404],
1067
1229
  empty: false
1068
- }, requestOptions),
1069
- write: (input, requestOptions) => request({
1070
- method: "POST",
1071
- path: `/api/experimental/fs/write`,
1072
- query: { location: input["location"], path: input["path"] },
1073
- body: input["payload"],
1074
- successStatus: 200,
1075
- declaredStatuses: [400, 401, 404],
1076
- empty: false,
1077
- binaryBody: true
1078
- }, requestOptions),
1079
- watch: (input, requestOptions) => request({
1080
- method: "POST",
1081
- path: `/api/experimental/fs/watch`,
1082
- query: { location: input["location"] },
1083
- body: { path: input["path"] },
1084
- successStatus: 204,
1085
- declaredStatuses: [400, 401, 404, 503],
1086
- empty: true
1087
- }, requestOptions),
1088
- unwatch: (input, requestOptions) => request({
1089
- method: "DELETE",
1090
- path: `/api/experimental/fs/watch`,
1091
- query: { location: input["location"] },
1092
- body: { path: input["path"] },
1093
- successStatus: 204,
1094
- declaredStatuses: [400, 401, 404],
1095
- empty: true
1096
1230
  }, requestOptions)
1097
1231
  },
1098
1232
  command: {
@@ -1197,101 +1331,6 @@ function make6(options) {
1197
1331
  }, requestOptions)
1198
1332
  }
1199
1333
  },
1200
- experimental: {
1201
- persistentPty: {
1202
- read: (input, requestOptions) => request({
1203
- method: "GET",
1204
- path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/terminal/read`,
1205
- query: { lines: input["lines"] },
1206
- successStatus: 200,
1207
- declaredStatuses: [400, 401, 503],
1208
- empty: false
1209
- }, requestOptions).then((value) => value.data),
1210
- list: (input, requestOptions) => request({
1211
- method: "GET",
1212
- path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/terminal`,
1213
- successStatus: 200,
1214
- declaredStatuses: [400, 401, 503],
1215
- empty: false
1216
- }, requestOptions).then((value) => value.data),
1217
- create: (input, requestOptions) => request({
1218
- method: "POST",
1219
- path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/terminal`,
1220
- body: {
1221
- command: input["command"],
1222
- args: input["args"],
1223
- cwd: input["cwd"],
1224
- title: input["title"],
1225
- env: input["env"],
1226
- size: input["size"]
1227
- },
1228
- successStatus: 200,
1229
- declaredStatuses: [400, 401, 503],
1230
- empty: false
1231
- }, requestOptions).then((value) => value.data),
1232
- shutdown: (requestOptions) => request({
1233
- method: "POST",
1234
- path: `/api/experimental/persistent-pty/shutdown`,
1235
- successStatus: 204,
1236
- declaredStatuses: [400, 401, 503],
1237
- empty: true
1238
- }, requestOptions),
1239
- handoff: (requestOptions) => request({
1240
- method: "POST",
1241
- path: `/api/experimental/persistent-pty/handoff`,
1242
- successStatus: 200,
1243
- declaredStatuses: [400, 401, 503],
1244
- empty: false
1245
- }, requestOptions),
1246
- get: (input, requestOptions) => request({
1247
- method: "GET",
1248
- path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}`,
1249
- successStatus: 200,
1250
- declaredStatuses: [400, 401, 404, 503],
1251
- empty: false
1252
- }, requestOptions).then((value) => value.data),
1253
- update: (input, requestOptions) => request({
1254
- method: "PUT",
1255
- path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}`,
1256
- body: { attachmentID: input["attachmentID"], size: input["size"] },
1257
- successStatus: 200,
1258
- declaredStatuses: [400, 401, 404, 503],
1259
- empty: false
1260
- }, requestOptions).then((value) => value.data),
1261
- snapshot: (input, requestOptions) => request({
1262
- method: "GET",
1263
- path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}/snapshot`,
1264
- successStatus: 200,
1265
- declaredStatuses: [400, 401, 404, 503],
1266
- empty: false
1267
- }, requestOptions).then((value) => value.data),
1268
- remove: (input, requestOptions) => request({
1269
- method: "DELETE",
1270
- path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}`,
1271
- successStatus: 204,
1272
- declaredStatuses: [400, 401, 404, 503],
1273
- empty: true
1274
- }, requestOptions),
1275
- connectToken: (input, requestOptions) => request({
1276
- method: "POST",
1277
- path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}/connect-token`,
1278
- headers: { "x-opencode-ticket": input["x-opencode-ticket"] },
1279
- successStatus: 200,
1280
- declaredStatuses: [400, 401, 403, 404, 503],
1281
- empty: false
1282
- }, requestOptions).then((value) => value.data)
1283
- },
1284
- media: {
1285
- get: (input, requestOptions) => request({
1286
- method: "GET",
1287
- path: `/api/experimental/media/${encodeURIComponent(input.hash)}`,
1288
- successStatus: 200,
1289
- declaredStatuses: [400, 401, 404],
1290
- empty: false,
1291
- binary: true
1292
- }, requestOptions)
1293
- }
1294
- },
1295
1334
  shell: {
1296
1335
  list: (input, requestOptions) => request({
1297
1336
  method: "GET",
@@ -1475,17 +1514,6 @@ function make6(options) {
1475
1514
  }, requestOptions)
1476
1515
  }
1477
1516
  },
1478
- migration: {
1479
- v1: {
1480
- status: (requestOptions) => request({
1481
- method: "GET",
1482
- path: `/api/experimental/migration/v1`,
1483
- successStatus: 200,
1484
- declaredStatuses: [400, 401],
1485
- empty: false
1486
- }, requestOptions)
1487
- }
1488
- },
1489
1517
  websearch: {
1490
1518
  providers: (input, requestOptions) => request({
1491
1519
  method: "GET",
@@ -1505,16 +1533,6 @@ function make6(options) {
1505
1533
  empty: false
1506
1534
  }, requestOptions)
1507
1535
  },
1508
- usage: {
1509
- limits: (input, requestOptions) => request({
1510
- method: "GET",
1511
- path: `/api/experimental/usage/limits`,
1512
- query: { location: input?.["location"] },
1513
- successStatus: 200,
1514
- declaredStatuses: [400, 401, 404, 503],
1515
- empty: false
1516
- }, requestOptions)
1517
- },
1518
1536
  config: {
1519
1537
  get: (input, requestOptions) => request({
1520
1538
  method: "GET",
@@ -1530,17 +1548,71 @@ function make6(options) {
1530
1548
  successStatus: 200,
1531
1549
  declaredStatuses: [400, 401, 404],
1532
1550
  empty: false
1533
- }, requestOptions),
1534
- update: (input, requestOptions) => request({
1535
- method: "PATCH",
1536
- path: `/api/experimental/config`,
1537
- body: { shell: input["shell"] },
1538
- successStatus: 204,
1539
- declaredStatuses: [400, 401, 404],
1540
- empty: true
1541
1551
  }, requestOptions)
1542
1552
  }
1543
1553
  };
1554
+ return {
1555
+ ...client,
1556
+ session: {
1557
+ ...client.session,
1558
+ stats: client.experimental.session.stats,
1559
+ import: client.experimental.session.import,
1560
+ export: client.experimental.session.export,
1561
+ skill: client.experimental.session.skill,
1562
+ wait: client.experimental.session.wait,
1563
+ instructions: {
1564
+ entry: {
1565
+ list: client.experimental.session.instructions.entry.list,
1566
+ put: client.experimental.session.instructions.entry.put,
1567
+ remove: client.experimental.session.instructions.entry.remove
1568
+ }
1569
+ },
1570
+ log: client.experimental.session.log
1571
+ },
1572
+ generate: {
1573
+ text: client.experimental.generate.text,
1574
+ image: client.experimental.generate.image,
1575
+ decisions: client.experimental.generate.decisions
1576
+ },
1577
+ voice: {
1578
+ models: client.experimental.voice.models,
1579
+ session: client.experimental.voice.session
1580
+ },
1581
+ integration: {
1582
+ ...client.integration,
1583
+ wellknown: {
1584
+ add: client.experimental.integration.wellknown.add
1585
+ }
1586
+ },
1587
+ mcp: {
1588
+ ...client.mcp,
1589
+ add: client.experimental.mcp.add,
1590
+ remove: client.experimental.mcp.remove,
1591
+ connect: client.experimental.mcp.connect,
1592
+ disconnect: client.experimental.mcp.disconnect,
1593
+ client: {
1594
+ token: client.experimental.mcp.client.token
1595
+ }
1596
+ },
1597
+ file: {
1598
+ ...client.file,
1599
+ write: client.experimental.file.write,
1600
+ watch: client.experimental.file.watch,
1601
+ unwatch: client.experimental.file.unwatch
1602
+ },
1603
+ migration: {
1604
+ v1: {
1605
+ status: client.experimental.migration.v1.status
1606
+ }
1607
+ },
1608
+ usage: {
1609
+ limits: client.experimental.usage.limits
1610
+ },
1611
+ config: {
1612
+ ...client.config,
1613
+ update: client.experimental.config.update
1614
+ }
1615
+ };
1544
1616
  }
1545
1617
  function encodePath(value) {
1546
1618
  return value.split("/").map(encodeURIComponent).join("/");
@@ -1569,20 +1641,20 @@ async function json(response) {
1569
1641
  try {
1570
1642
  await response.body?.cancel();
1571
1643
  } catch {}
1572
- throw new ClientError3("UnsupportedContentType", { detail: response.headers.get("content-type") });
1644
+ throw new ClientError2("UnsupportedContentType", { detail: response.headers.get("content-type") });
1573
1645
  }
1574
1646
  let text;
1575
1647
  try {
1576
1648
  text = await response.text();
1577
1649
  } catch (cause) {
1578
- throw new ClientError3("Transport", { cause });
1650
+ throw new ClientError2("Transport", { cause });
1579
1651
  }
1580
1652
  if (text === "")
1581
- throw new ClientError3("MalformedResponse");
1653
+ throw new ClientError2("MalformedResponse");
1582
1654
  try {
1583
1655
  return JSON.parse(text);
1584
1656
  } catch (cause) {
1585
- throw new ClientError3("MalformedResponse", { cause });
1657
+ throw new ClientError2("MalformedResponse", { cause });
1586
1658
  }
1587
1659
  }
1588
1660
  function declared(body) {
@@ -1595,4 +1667,4 @@ function isContentType(response, expected) {
1595
1667
  return response.headers.get("content-type")?.split(";", 1)[0]?.trim().toLowerCase() === expected;
1596
1668
  }
1597
1669
 
1598
- export { make6, exports_client4 };
1670
+ export { make3, exports_client2 };