@dingmenghua/opencode-sdk 1.15.11

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 (79) hide show
  1. package/dist/client.d.ts +7 -0
  2. package/dist/client.js +53 -0
  3. package/dist/error-interceptor.d.ts +15 -0
  4. package/dist/error-interceptor.js +43 -0
  5. package/dist/gen/client/client.gen.d.ts +2 -0
  6. package/dist/gen/client/client.gen.js +165 -0
  7. package/dist/gen/client/index.d.ts +7 -0
  8. package/dist/gen/client/index.js +5 -0
  9. package/dist/gen/client/types.gen.d.ts +127 -0
  10. package/dist/gen/client/types.gen.js +2 -0
  11. package/dist/gen/client/utils.gen.d.ts +38 -0
  12. package/dist/gen/client/utils.gen.js +226 -0
  13. package/dist/gen/client.gen.d.ts +12 -0
  14. package/dist/gen/client.gen.js +5 -0
  15. package/dist/gen/core/auth.gen.d.ts +18 -0
  16. package/dist/gen/core/auth.gen.js +14 -0
  17. package/dist/gen/core/bodySerializer.gen.d.ts +17 -0
  18. package/dist/gen/core/bodySerializer.gen.js +57 -0
  19. package/dist/gen/core/params.gen.d.ts +33 -0
  20. package/dist/gen/core/params.gen.js +89 -0
  21. package/dist/gen/core/pathSerializer.gen.d.ts +33 -0
  22. package/dist/gen/core/pathSerializer.gen.js +106 -0
  23. package/dist/gen/core/queryKeySerializer.gen.d.ts +18 -0
  24. package/dist/gen/core/queryKeySerializer.gen.js +93 -0
  25. package/dist/gen/core/serverSentEvents.gen.d.ts +59 -0
  26. package/dist/gen/core/serverSentEvents.gen.js +117 -0
  27. package/dist/gen/core/types.gen.d.ts +78 -0
  28. package/dist/gen/core/types.gen.js +2 -0
  29. package/dist/gen/core/utils.gen.d.ts +14 -0
  30. package/dist/gen/core/utils.gen.js +69 -0
  31. package/dist/gen/sdk.gen.d.ts +403 -0
  32. package/dist/gen/sdk.gen.js +881 -0
  33. package/dist/gen/types.gen.d.ts +3383 -0
  34. package/dist/gen/types.gen.js +2 -0
  35. package/dist/index.d.ts +10 -0
  36. package/dist/index.js +16 -0
  37. package/dist/process.d.ts +3 -0
  38. package/dist/process.js +33 -0
  39. package/dist/server.d.ts +23 -0
  40. package/dist/server.js +105 -0
  41. package/dist/v2/client.d.ts +8 -0
  42. package/dist/v2/client.js +78 -0
  43. package/dist/v2/data.d.ts +9 -0
  44. package/dist/v2/data.js +22 -0
  45. package/dist/v2/gen/client/client.gen.d.ts +2 -0
  46. package/dist/v2/gen/client/client.gen.js +232 -0
  47. package/dist/v2/gen/client/index.d.ts +8 -0
  48. package/dist/v2/gen/client/index.js +6 -0
  49. package/dist/v2/gen/client/types.gen.d.ts +117 -0
  50. package/dist/v2/gen/client/types.gen.js +2 -0
  51. package/dist/v2/gen/client/utils.gen.d.ts +33 -0
  52. package/dist/v2/gen/client/utils.gen.js +226 -0
  53. package/dist/v2/gen/client.gen.d.ts +12 -0
  54. package/dist/v2/gen/client.gen.js +3 -0
  55. package/dist/v2/gen/core/auth.gen.d.ts +18 -0
  56. package/dist/v2/gen/core/auth.gen.js +14 -0
  57. package/dist/v2/gen/core/bodySerializer.gen.d.ts +25 -0
  58. package/dist/v2/gen/core/bodySerializer.gen.js +57 -0
  59. package/dist/v2/gen/core/params.gen.d.ts +43 -0
  60. package/dist/v2/gen/core/params.gen.js +102 -0
  61. package/dist/v2/gen/core/pathSerializer.gen.d.ts +33 -0
  62. package/dist/v2/gen/core/pathSerializer.gen.js +106 -0
  63. package/dist/v2/gen/core/queryKeySerializer.gen.d.ts +18 -0
  64. package/dist/v2/gen/core/queryKeySerializer.gen.js +93 -0
  65. package/dist/v2/gen/core/serverSentEvents.gen.d.ts +71 -0
  66. package/dist/v2/gen/core/serverSentEvents.gen.js +133 -0
  67. package/dist/v2/gen/core/types.gen.d.ts +78 -0
  68. package/dist/v2/gen/core/types.gen.js +2 -0
  69. package/dist/v2/gen/core/utils.gen.d.ts +19 -0
  70. package/dist/v2/gen/core/utils.gen.js +87 -0
  71. package/dist/v2/gen/sdk.gen.d.ts +1610 -0
  72. package/dist/v2/gen/sdk.gen.js +3234 -0
  73. package/dist/v2/gen/types.gen.d.ts +6222 -0
  74. package/dist/v2/gen/types.gen.js +2 -0
  75. package/dist/v2/index.d.ts +11 -0
  76. package/dist/v2/index.js +17 -0
  77. package/dist/v2/server.d.ts +23 -0
  78. package/dist/v2/server.js +105 -0
  79. package/package.json +55 -0
@@ -0,0 +1,3234 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ import { client } from "./client.gen.js";
3
+ import { buildClientParams } from "./client/index.js";
4
+ class HeyApiClient {
5
+ client;
6
+ constructor(args) {
7
+ this.client = args?.client ?? client;
8
+ }
9
+ }
10
+ class HeyApiRegistry {
11
+ defaultKey = "default";
12
+ instances = new Map();
13
+ get(key) {
14
+ const instance = this.instances.get(key ?? this.defaultKey);
15
+ if (!instance) {
16
+ throw new Error(`No SDK client found. Create one with "new OpencodeClient()" to fix this error.`);
17
+ }
18
+ return instance;
19
+ }
20
+ set(value, key) {
21
+ this.instances.set(key ?? this.defaultKey, value);
22
+ }
23
+ }
24
+ export class Auth extends HeyApiClient {
25
+ /**
26
+ * Remove auth credentials
27
+ *
28
+ * Remove authentication credentials
29
+ */
30
+ remove(parameters, options) {
31
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "providerID" }] }]);
32
+ return (options?.client ?? this.client).delete({
33
+ url: "/auth/{providerID}",
34
+ ...options,
35
+ ...params,
36
+ });
37
+ }
38
+ /**
39
+ * Set auth credentials
40
+ *
41
+ * Set authentication credentials
42
+ */
43
+ set(parameters, options) {
44
+ const params = buildClientParams([parameters], [
45
+ {
46
+ args: [
47
+ { in: "path", key: "providerID" },
48
+ { key: "auth", map: "body" },
49
+ ],
50
+ },
51
+ ]);
52
+ return (options?.client ?? this.client).put({
53
+ url: "/auth/{providerID}",
54
+ ...options,
55
+ ...params,
56
+ headers: {
57
+ "Content-Type": "application/json",
58
+ ...options?.headers,
59
+ ...params.headers,
60
+ },
61
+ });
62
+ }
63
+ }
64
+ export class App extends HeyApiClient {
65
+ /**
66
+ * Write log
67
+ *
68
+ * Write a log entry to the server logs with specified level and metadata.
69
+ */
70
+ log(parameters, options) {
71
+ const params = buildClientParams([parameters], [
72
+ {
73
+ args: [
74
+ { in: "query", key: "directory" },
75
+ { in: "query", key: "workspace" },
76
+ { in: "body", key: "service" },
77
+ { in: "body", key: "level" },
78
+ { in: "body", key: "message" },
79
+ { in: "body", key: "extra" },
80
+ ],
81
+ },
82
+ ]);
83
+ return (options?.client ?? this.client).post({
84
+ url: "/log",
85
+ ...options,
86
+ ...params,
87
+ headers: {
88
+ "Content-Type": "application/json",
89
+ ...options?.headers,
90
+ ...params.headers,
91
+ },
92
+ });
93
+ }
94
+ /**
95
+ * List agents
96
+ *
97
+ * Get a list of all available AI agents in the OpenCode system.
98
+ */
99
+ agents(parameters, options) {
100
+ const params = buildClientParams([parameters], [
101
+ {
102
+ args: [
103
+ { in: "query", key: "directory" },
104
+ { in: "query", key: "workspace" },
105
+ ],
106
+ },
107
+ ]);
108
+ return (options?.client ?? this.client).get({
109
+ url: "/agent",
110
+ ...options,
111
+ ...params,
112
+ });
113
+ }
114
+ /**
115
+ * List skills
116
+ *
117
+ * Get a list of all available skills in the OpenCode system.
118
+ */
119
+ skills(parameters, options) {
120
+ const params = buildClientParams([parameters], [
121
+ {
122
+ args: [
123
+ { in: "query", key: "directory" },
124
+ { in: "query", key: "workspace" },
125
+ ],
126
+ },
127
+ ]);
128
+ return (options?.client ?? this.client).get({
129
+ url: "/skill",
130
+ ...options,
131
+ ...params,
132
+ });
133
+ }
134
+ }
135
+ export class Config extends HeyApiClient {
136
+ /**
137
+ * Get global configuration
138
+ *
139
+ * Retrieve the current global OpenCode configuration settings and preferences.
140
+ */
141
+ get(options) {
142
+ return (options?.client ?? this.client).get({
143
+ url: "/global/config",
144
+ ...options,
145
+ });
146
+ }
147
+ /**
148
+ * Update global configuration
149
+ *
150
+ * Update global OpenCode configuration settings and preferences.
151
+ */
152
+ update(parameters, options) {
153
+ const params = buildClientParams([parameters], [{ args: [{ key: "config", map: "body" }] }]);
154
+ return (options?.client ?? this.client).patch({
155
+ url: "/global/config",
156
+ ...options,
157
+ ...params,
158
+ headers: {
159
+ "Content-Type": "application/json",
160
+ ...options?.headers,
161
+ ...params.headers,
162
+ },
163
+ });
164
+ }
165
+ }
166
+ export class Global extends HeyApiClient {
167
+ /**
168
+ * Get health
169
+ *
170
+ * Get health information about the OpenCode server.
171
+ */
172
+ health(options) {
173
+ return (options?.client ?? this.client).get({
174
+ url: "/global/health",
175
+ ...options,
176
+ });
177
+ }
178
+ /**
179
+ * Get global events
180
+ *
181
+ * Subscribe to global events from the OpenCode system using server-sent events.
182
+ */
183
+ event(options) {
184
+ return (options?.client ?? this.client).sse.get({
185
+ url: "/global/event",
186
+ ...options,
187
+ });
188
+ }
189
+ /**
190
+ * Dispose instance
191
+ *
192
+ * Clean up and dispose all OpenCode instances, releasing all resources.
193
+ */
194
+ dispose(options) {
195
+ return (options?.client ?? this.client).post({
196
+ url: "/global/dispose",
197
+ ...options,
198
+ });
199
+ }
200
+ /**
201
+ * Upgrade opencode
202
+ *
203
+ * Upgrade opencode to the specified version or latest if not specified.
204
+ */
205
+ upgrade(parameters, options) {
206
+ const params = buildClientParams([parameters], [{ args: [{ in: "body", key: "target" }] }]);
207
+ return (options?.client ?? this.client).post({
208
+ url: "/global/upgrade",
209
+ ...options,
210
+ ...params,
211
+ headers: {
212
+ "Content-Type": "application/json",
213
+ ...options?.headers,
214
+ ...params.headers,
215
+ },
216
+ });
217
+ }
218
+ _config;
219
+ get config() {
220
+ return (this._config ??= new Config({ client: this.client }));
221
+ }
222
+ }
223
+ export class Event extends HeyApiClient {
224
+ /**
225
+ * Subscribe to events
226
+ *
227
+ * Get events
228
+ */
229
+ subscribe(parameters, options) {
230
+ const params = buildClientParams([parameters], [
231
+ {
232
+ args: [
233
+ { in: "query", key: "directory" },
234
+ { in: "query", key: "workspace" },
235
+ ],
236
+ },
237
+ ]);
238
+ return (options?.client ?? this.client).sse.get({
239
+ url: "/event",
240
+ ...options,
241
+ ...params,
242
+ });
243
+ }
244
+ }
245
+ export class Config2 extends HeyApiClient {
246
+ /**
247
+ * Get configuration
248
+ *
249
+ * Retrieve the current OpenCode configuration settings and preferences.
250
+ */
251
+ get(parameters, options) {
252
+ const params = buildClientParams([parameters], [
253
+ {
254
+ args: [
255
+ { in: "query", key: "directory" },
256
+ { in: "query", key: "workspace" },
257
+ ],
258
+ },
259
+ ]);
260
+ return (options?.client ?? this.client).get({
261
+ url: "/config",
262
+ ...options,
263
+ ...params,
264
+ });
265
+ }
266
+ /**
267
+ * Update configuration
268
+ *
269
+ * Update OpenCode configuration settings and preferences.
270
+ */
271
+ update(parameters, options) {
272
+ const params = buildClientParams([parameters], [
273
+ {
274
+ args: [
275
+ { in: "query", key: "directory" },
276
+ { in: "query", key: "workspace" },
277
+ { key: "config", map: "body" },
278
+ ],
279
+ },
280
+ ]);
281
+ return (options?.client ?? this.client).patch({
282
+ url: "/config",
283
+ ...options,
284
+ ...params,
285
+ headers: {
286
+ "Content-Type": "application/json",
287
+ ...options?.headers,
288
+ ...params.headers,
289
+ },
290
+ });
291
+ }
292
+ /**
293
+ * List config providers
294
+ *
295
+ * Get a list of all configured AI providers and their default models.
296
+ */
297
+ providers(parameters, options) {
298
+ const params = buildClientParams([parameters], [
299
+ {
300
+ args: [
301
+ { in: "query", key: "directory" },
302
+ { in: "query", key: "workspace" },
303
+ ],
304
+ },
305
+ ]);
306
+ return (options?.client ?? this.client).get({
307
+ url: "/config/providers",
308
+ ...options,
309
+ ...params,
310
+ });
311
+ }
312
+ }
313
+ export class Console extends HeyApiClient {
314
+ /**
315
+ * Get active Console provider metadata
316
+ *
317
+ * Get the active Console org name and the set of provider IDs managed by that Console org.
318
+ */
319
+ get(parameters, options) {
320
+ const params = buildClientParams([parameters], [
321
+ {
322
+ args: [
323
+ { in: "query", key: "directory" },
324
+ { in: "query", key: "workspace" },
325
+ ],
326
+ },
327
+ ]);
328
+ return (options?.client ?? this.client).get({
329
+ url: "/experimental/console",
330
+ ...options,
331
+ ...params,
332
+ });
333
+ }
334
+ /**
335
+ * List switchable Console orgs
336
+ *
337
+ * Get the available Console orgs across logged-in accounts, including the current active org.
338
+ */
339
+ listOrgs(parameters, options) {
340
+ const params = buildClientParams([parameters], [
341
+ {
342
+ args: [
343
+ { in: "query", key: "directory" },
344
+ { in: "query", key: "workspace" },
345
+ ],
346
+ },
347
+ ]);
348
+ return (options?.client ?? this.client).get({
349
+ url: "/experimental/console/orgs",
350
+ ...options,
351
+ ...params,
352
+ });
353
+ }
354
+ /**
355
+ * Switch active Console org
356
+ *
357
+ * Persist a new active Console account/org selection for the current local OpenCode state.
358
+ */
359
+ switchOrg(parameters, options) {
360
+ const params = buildClientParams([parameters], [
361
+ {
362
+ args: [
363
+ { in: "query", key: "directory" },
364
+ { in: "query", key: "workspace" },
365
+ { in: "body", key: "accountID" },
366
+ { in: "body", key: "orgID" },
367
+ ],
368
+ },
369
+ ]);
370
+ return (options?.client ?? this.client).post({
371
+ url: "/experimental/console/switch",
372
+ ...options,
373
+ ...params,
374
+ headers: {
375
+ "Content-Type": "application/json",
376
+ ...options?.headers,
377
+ ...params.headers,
378
+ },
379
+ });
380
+ }
381
+ }
382
+ export class Session extends HeyApiClient {
383
+ /**
384
+ * List sessions
385
+ *
386
+ * Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.
387
+ */
388
+ list(parameters, options) {
389
+ const params = buildClientParams([parameters], [
390
+ {
391
+ args: [
392
+ { in: "query", key: "directory" },
393
+ { in: "query", key: "workspace" },
394
+ { in: "query", key: "roots" },
395
+ { in: "query", key: "start" },
396
+ { in: "query", key: "cursor" },
397
+ { in: "query", key: "search" },
398
+ { in: "query", key: "limit" },
399
+ { in: "query", key: "archived" },
400
+ ],
401
+ },
402
+ ]);
403
+ return (options?.client ?? this.client).get({
404
+ url: "/experimental/session",
405
+ ...options,
406
+ ...params,
407
+ });
408
+ }
409
+ }
410
+ export class Resource extends HeyApiClient {
411
+ /**
412
+ * Get MCP resources
413
+ *
414
+ * Get all available MCP resources from connected servers. Optionally filter by name.
415
+ */
416
+ list(parameters, options) {
417
+ const params = buildClientParams([parameters], [
418
+ {
419
+ args: [
420
+ { in: "query", key: "directory" },
421
+ { in: "query", key: "workspace" },
422
+ ],
423
+ },
424
+ ]);
425
+ return (options?.client ?? this.client).get({
426
+ url: "/experimental/resource",
427
+ ...options,
428
+ ...params,
429
+ });
430
+ }
431
+ }
432
+ export class Adapter extends HeyApiClient {
433
+ /**
434
+ * List workspace adapters
435
+ *
436
+ * List all available workspace adapters for the current project.
437
+ */
438
+ list(parameters, options) {
439
+ const params = buildClientParams([parameters], [
440
+ {
441
+ args: [
442
+ { in: "query", key: "directory" },
443
+ { in: "query", key: "workspace" },
444
+ ],
445
+ },
446
+ ]);
447
+ return (options?.client ?? this.client).get({
448
+ url: "/experimental/workspace/adapter",
449
+ ...options,
450
+ ...params,
451
+ });
452
+ }
453
+ }
454
+ export class Workspace extends HeyApiClient {
455
+ /**
456
+ * List workspaces
457
+ *
458
+ * List all workspaces.
459
+ */
460
+ list(parameters, options) {
461
+ const params = buildClientParams([parameters], [
462
+ {
463
+ args: [
464
+ { in: "query", key: "directory" },
465
+ { in: "query", key: "workspace" },
466
+ ],
467
+ },
468
+ ]);
469
+ return (options?.client ?? this.client).get({
470
+ url: "/experimental/workspace",
471
+ ...options,
472
+ ...params,
473
+ });
474
+ }
475
+ /**
476
+ * Create workspace
477
+ *
478
+ * Create a workspace for the current project.
479
+ */
480
+ create(parameters, options) {
481
+ const params = buildClientParams([parameters], [
482
+ {
483
+ args: [
484
+ { in: "query", key: "directory" },
485
+ { in: "query", key: "workspace" },
486
+ { in: "body", key: "id" },
487
+ { in: "body", key: "type" },
488
+ { in: "body", key: "branch" },
489
+ { in: "body", key: "extra" },
490
+ ],
491
+ },
492
+ ]);
493
+ return (options?.client ?? this.client).post({
494
+ url: "/experimental/workspace",
495
+ ...options,
496
+ ...params,
497
+ headers: {
498
+ "Content-Type": "application/json",
499
+ ...options?.headers,
500
+ ...params.headers,
501
+ },
502
+ });
503
+ }
504
+ /**
505
+ * Sync workspace list
506
+ *
507
+ * Register missing workspaces returned by workspace adapters.
508
+ */
509
+ syncList(parameters, options) {
510
+ const params = buildClientParams([parameters], [
511
+ {
512
+ args: [
513
+ { in: "query", key: "directory" },
514
+ { in: "query", key: "workspace" },
515
+ ],
516
+ },
517
+ ]);
518
+ return (options?.client ?? this.client).post({
519
+ url: "/experimental/workspace/sync-list",
520
+ ...options,
521
+ ...params,
522
+ });
523
+ }
524
+ /**
525
+ * Workspace status
526
+ *
527
+ * Get connection status for workspaces in the current project.
528
+ */
529
+ status(parameters, options) {
530
+ const params = buildClientParams([parameters], [
531
+ {
532
+ args: [
533
+ { in: "query", key: "directory" },
534
+ { in: "query", key: "workspace" },
535
+ ],
536
+ },
537
+ ]);
538
+ return (options?.client ?? this.client).get({
539
+ url: "/experimental/workspace/status",
540
+ ...options,
541
+ ...params,
542
+ });
543
+ }
544
+ /**
545
+ * Remove workspace
546
+ *
547
+ * Remove an existing workspace.
548
+ */
549
+ remove(parameters, options) {
550
+ const params = buildClientParams([parameters], [
551
+ {
552
+ args: [
553
+ { in: "path", key: "id" },
554
+ { in: "query", key: "directory" },
555
+ { in: "query", key: "workspace" },
556
+ ],
557
+ },
558
+ ]);
559
+ return (options?.client ?? this.client).delete({
560
+ url: "/experimental/workspace/{id}",
561
+ ...options,
562
+ ...params,
563
+ });
564
+ }
565
+ /**
566
+ * Warp session into workspace
567
+ *
568
+ * Move a session's sync history into the target workspace, or detach it to the local project.
569
+ */
570
+ warp(parameters, options) {
571
+ const params = buildClientParams([parameters], [
572
+ {
573
+ args: [
574
+ { in: "query", key: "directory" },
575
+ { in: "query", key: "workspace" },
576
+ { in: "body", key: "id" },
577
+ { in: "body", key: "sessionID" },
578
+ { in: "body", key: "copyChanges" },
579
+ ],
580
+ },
581
+ ]);
582
+ return (options?.client ?? this.client).post({
583
+ url: "/experimental/workspace/warp",
584
+ ...options,
585
+ ...params,
586
+ headers: {
587
+ "Content-Type": "application/json",
588
+ ...options?.headers,
589
+ ...params.headers,
590
+ },
591
+ });
592
+ }
593
+ _adapter;
594
+ get adapter() {
595
+ return (this._adapter ??= new Adapter({ client: this.client }));
596
+ }
597
+ }
598
+ export class Experimental extends HeyApiClient {
599
+ _console;
600
+ get console() {
601
+ return (this._console ??= new Console({ client: this.client }));
602
+ }
603
+ _session;
604
+ get session() {
605
+ return (this._session ??= new Session({ client: this.client }));
606
+ }
607
+ _resource;
608
+ get resource() {
609
+ return (this._resource ??= new Resource({ client: this.client }));
610
+ }
611
+ _workspace;
612
+ get workspace() {
613
+ return (this._workspace ??= new Workspace({ client: this.client }));
614
+ }
615
+ }
616
+ export class Tool extends HeyApiClient {
617
+ /**
618
+ * List tools
619
+ *
620
+ * Get a list of available tools with their JSON schema parameters for a specific provider and model combination.
621
+ */
622
+ list(parameters, options) {
623
+ const params = buildClientParams([parameters], [
624
+ {
625
+ args: [
626
+ { in: "query", key: "directory" },
627
+ { in: "query", key: "workspace" },
628
+ { in: "query", key: "provider" },
629
+ { in: "query", key: "model" },
630
+ ],
631
+ },
632
+ ]);
633
+ return (options?.client ?? this.client).get({
634
+ url: "/experimental/tool",
635
+ ...options,
636
+ ...params,
637
+ });
638
+ }
639
+ /**
640
+ * List tool IDs
641
+ *
642
+ * Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.
643
+ */
644
+ ids(parameters, options) {
645
+ const params = buildClientParams([parameters], [
646
+ {
647
+ args: [
648
+ { in: "query", key: "directory" },
649
+ { in: "query", key: "workspace" },
650
+ ],
651
+ },
652
+ ]);
653
+ return (options?.client ?? this.client).get({
654
+ url: "/experimental/tool/ids",
655
+ ...options,
656
+ ...params,
657
+ });
658
+ }
659
+ }
660
+ export class Worktree extends HeyApiClient {
661
+ /**
662
+ * Remove worktree
663
+ *
664
+ * Remove a git worktree and delete its branch.
665
+ */
666
+ remove(parameters, options) {
667
+ const params = buildClientParams([parameters], [
668
+ {
669
+ args: [
670
+ { in: "query", key: "directory" },
671
+ { in: "query", key: "workspace" },
672
+ { key: "worktreeRemoveInput", map: "body" },
673
+ ],
674
+ },
675
+ ]);
676
+ return (options?.client ?? this.client).delete({
677
+ url: "/experimental/worktree",
678
+ ...options,
679
+ ...params,
680
+ headers: {
681
+ "Content-Type": "application/json",
682
+ ...options?.headers,
683
+ ...params.headers,
684
+ },
685
+ });
686
+ }
687
+ /**
688
+ * List worktrees
689
+ *
690
+ * List all sandbox worktrees for the current project.
691
+ */
692
+ list(parameters, options) {
693
+ const params = buildClientParams([parameters], [
694
+ {
695
+ args: [
696
+ { in: "query", key: "directory" },
697
+ { in: "query", key: "workspace" },
698
+ ],
699
+ },
700
+ ]);
701
+ return (options?.client ?? this.client).get({
702
+ url: "/experimental/worktree",
703
+ ...options,
704
+ ...params,
705
+ });
706
+ }
707
+ /**
708
+ * Create worktree
709
+ *
710
+ * Create a new git worktree for the current project and run any configured startup scripts.
711
+ */
712
+ create(parameters, options) {
713
+ const params = buildClientParams([parameters], [
714
+ {
715
+ args: [
716
+ { in: "query", key: "directory" },
717
+ { in: "query", key: "workspace" },
718
+ { key: "worktreeCreateInput", map: "body" },
719
+ ],
720
+ },
721
+ ]);
722
+ return (options?.client ?? this.client).post({
723
+ url: "/experimental/worktree",
724
+ ...options,
725
+ ...params,
726
+ headers: {
727
+ "Content-Type": "application/json",
728
+ ...options?.headers,
729
+ ...params.headers,
730
+ },
731
+ });
732
+ }
733
+ /**
734
+ * Reset worktree
735
+ *
736
+ * Reset a worktree branch to the primary default branch.
737
+ */
738
+ reset(parameters, options) {
739
+ const params = buildClientParams([parameters], [
740
+ {
741
+ args: [
742
+ { in: "query", key: "directory" },
743
+ { in: "query", key: "workspace" },
744
+ { key: "worktreeResetInput", map: "body" },
745
+ ],
746
+ },
747
+ ]);
748
+ return (options?.client ?? this.client).post({
749
+ url: "/experimental/worktree/reset",
750
+ ...options,
751
+ ...params,
752
+ headers: {
753
+ "Content-Type": "application/json",
754
+ ...options?.headers,
755
+ ...params.headers,
756
+ },
757
+ });
758
+ }
759
+ }
760
+ export class Find extends HeyApiClient {
761
+ /**
762
+ * Find text
763
+ *
764
+ * Search for text patterns across files in the project using ripgrep.
765
+ */
766
+ text(parameters, options) {
767
+ const params = buildClientParams([parameters], [
768
+ {
769
+ args: [
770
+ { in: "query", key: "directory" },
771
+ { in: "query", key: "workspace" },
772
+ { in: "query", key: "pattern" },
773
+ ],
774
+ },
775
+ ]);
776
+ return (options?.client ?? this.client).get({
777
+ url: "/find",
778
+ ...options,
779
+ ...params,
780
+ });
781
+ }
782
+ /**
783
+ * Find files
784
+ *
785
+ * Search for files or directories by name or pattern in the project directory.
786
+ */
787
+ files(parameters, options) {
788
+ const params = buildClientParams([parameters], [
789
+ {
790
+ args: [
791
+ { in: "query", key: "directory" },
792
+ { in: "query", key: "workspace" },
793
+ { in: "query", key: "query" },
794
+ { in: "query", key: "dirs" },
795
+ { in: "query", key: "type" },
796
+ { in: "query", key: "limit" },
797
+ ],
798
+ },
799
+ ]);
800
+ return (options?.client ?? this.client).get({
801
+ url: "/find/file",
802
+ ...options,
803
+ ...params,
804
+ });
805
+ }
806
+ /**
807
+ * Find symbols
808
+ *
809
+ * Search for workspace symbols like functions, classes, and variables using LSP.
810
+ */
811
+ symbols(parameters, options) {
812
+ const params = buildClientParams([parameters], [
813
+ {
814
+ args: [
815
+ { in: "query", key: "directory" },
816
+ { in: "query", key: "workspace" },
817
+ { in: "query", key: "query" },
818
+ ],
819
+ },
820
+ ]);
821
+ return (options?.client ?? this.client).get({
822
+ url: "/find/symbol",
823
+ ...options,
824
+ ...params,
825
+ });
826
+ }
827
+ }
828
+ export class File extends HeyApiClient {
829
+ /**
830
+ * List files
831
+ *
832
+ * List files and directories in a specified path.
833
+ */
834
+ list(parameters, options) {
835
+ const params = buildClientParams([parameters], [
836
+ {
837
+ args: [
838
+ { in: "query", key: "directory" },
839
+ { in: "query", key: "workspace" },
840
+ { in: "query", key: "path" },
841
+ ],
842
+ },
843
+ ]);
844
+ return (options?.client ?? this.client).get({
845
+ url: "/file",
846
+ ...options,
847
+ ...params,
848
+ });
849
+ }
850
+ /**
851
+ * Read file
852
+ *
853
+ * Read the content of a specified file.
854
+ */
855
+ read(parameters, options) {
856
+ const params = buildClientParams([parameters], [
857
+ {
858
+ args: [
859
+ { in: "query", key: "directory" },
860
+ { in: "query", key: "workspace" },
861
+ { in: "query", key: "path" },
862
+ ],
863
+ },
864
+ ]);
865
+ return (options?.client ?? this.client).get({
866
+ url: "/file/content",
867
+ ...options,
868
+ ...params,
869
+ });
870
+ }
871
+ /**
872
+ * Get file status
873
+ *
874
+ * Get the git status of all files in the project.
875
+ */
876
+ status(parameters, options) {
877
+ const params = buildClientParams([parameters], [
878
+ {
879
+ args: [
880
+ { in: "query", key: "directory" },
881
+ { in: "query", key: "workspace" },
882
+ ],
883
+ },
884
+ ]);
885
+ return (options?.client ?? this.client).get({
886
+ url: "/file/status",
887
+ ...options,
888
+ ...params,
889
+ });
890
+ }
891
+ }
892
+ export class Instance extends HeyApiClient {
893
+ /**
894
+ * Dispose instance
895
+ *
896
+ * Clean up and dispose the current OpenCode instance, releasing all resources.
897
+ */
898
+ dispose(parameters, options) {
899
+ const params = buildClientParams([parameters], [
900
+ {
901
+ args: [
902
+ { in: "query", key: "directory" },
903
+ { in: "query", key: "workspace" },
904
+ ],
905
+ },
906
+ ]);
907
+ return (options?.client ?? this.client).post({
908
+ url: "/instance/dispose",
909
+ ...options,
910
+ ...params,
911
+ });
912
+ }
913
+ }
914
+ export class Path extends HeyApiClient {
915
+ /**
916
+ * Get paths
917
+ *
918
+ * Retrieve the current working directory and related path information for the OpenCode instance.
919
+ */
920
+ get(parameters, options) {
921
+ const params = buildClientParams([parameters], [
922
+ {
923
+ args: [
924
+ { in: "query", key: "directory" },
925
+ { in: "query", key: "workspace" },
926
+ ],
927
+ },
928
+ ]);
929
+ return (options?.client ?? this.client).get({
930
+ url: "/path",
931
+ ...options,
932
+ ...params,
933
+ });
934
+ }
935
+ }
936
+ export class Diff extends HeyApiClient {
937
+ /**
938
+ * Get raw VCS diff
939
+ *
940
+ * Retrieve a raw patch for current uncommitted changes.
941
+ */
942
+ raw(parameters, options) {
943
+ const params = buildClientParams([parameters], [
944
+ {
945
+ args: [
946
+ { in: "query", key: "directory" },
947
+ { in: "query", key: "workspace" },
948
+ ],
949
+ },
950
+ ]);
951
+ return (options?.client ?? this.client).get({
952
+ url: "/vcs/diff/raw",
953
+ ...options,
954
+ ...params,
955
+ });
956
+ }
957
+ }
958
+ export class Vcs extends HeyApiClient {
959
+ /**
960
+ * Get VCS info
961
+ *
962
+ * Retrieve version control system (VCS) information for the current project, such as git branch.
963
+ */
964
+ get(parameters, options) {
965
+ const params = buildClientParams([parameters], [
966
+ {
967
+ args: [
968
+ { in: "query", key: "directory" },
969
+ { in: "query", key: "workspace" },
970
+ ],
971
+ },
972
+ ]);
973
+ return (options?.client ?? this.client).get({
974
+ url: "/vcs",
975
+ ...options,
976
+ ...params,
977
+ });
978
+ }
979
+ /**
980
+ * Get VCS status
981
+ *
982
+ * Retrieve changed files in the current working tree without patches.
983
+ */
984
+ status(parameters, options) {
985
+ const params = buildClientParams([parameters], [
986
+ {
987
+ args: [
988
+ { in: "query", key: "directory" },
989
+ { in: "query", key: "workspace" },
990
+ ],
991
+ },
992
+ ]);
993
+ return (options?.client ?? this.client).get({
994
+ url: "/vcs/status",
995
+ ...options,
996
+ ...params,
997
+ });
998
+ }
999
+ /**
1000
+ * Get VCS diff
1001
+ *
1002
+ * Retrieve the current git diff for the working tree or against the default branch.
1003
+ */
1004
+ diff(parameters, options) {
1005
+ const params = buildClientParams([parameters], [
1006
+ {
1007
+ args: [
1008
+ { in: "query", key: "directory" },
1009
+ { in: "query", key: "workspace" },
1010
+ { in: "query", key: "mode" },
1011
+ ],
1012
+ },
1013
+ ]);
1014
+ return (options?.client ?? this.client).get({
1015
+ url: "/vcs/diff",
1016
+ ...options,
1017
+ ...params,
1018
+ });
1019
+ }
1020
+ /**
1021
+ * Apply VCS patch
1022
+ *
1023
+ * Apply a raw patch to the current working tree.
1024
+ */
1025
+ apply(parameters, options) {
1026
+ const params = buildClientParams([parameters], [
1027
+ {
1028
+ args: [
1029
+ { in: "query", key: "directory" },
1030
+ { in: "query", key: "workspace" },
1031
+ { in: "body", key: "patch" },
1032
+ ],
1033
+ },
1034
+ ]);
1035
+ return (options?.client ?? this.client).post({
1036
+ url: "/vcs/apply",
1037
+ ...options,
1038
+ ...params,
1039
+ headers: {
1040
+ "Content-Type": "application/json",
1041
+ ...options?.headers,
1042
+ ...params.headers,
1043
+ },
1044
+ });
1045
+ }
1046
+ _diff;
1047
+ get diff2() {
1048
+ return (this._diff ??= new Diff({ client: this.client }));
1049
+ }
1050
+ }
1051
+ export class Command extends HeyApiClient {
1052
+ /**
1053
+ * List commands
1054
+ *
1055
+ * Get a list of all available commands in the OpenCode system.
1056
+ */
1057
+ list(parameters, options) {
1058
+ const params = buildClientParams([parameters], [
1059
+ {
1060
+ args: [
1061
+ { in: "query", key: "directory" },
1062
+ { in: "query", key: "workspace" },
1063
+ ],
1064
+ },
1065
+ ]);
1066
+ return (options?.client ?? this.client).get({
1067
+ url: "/command",
1068
+ ...options,
1069
+ ...params,
1070
+ });
1071
+ }
1072
+ }
1073
+ export class Lsp extends HeyApiClient {
1074
+ /**
1075
+ * Get LSP status
1076
+ *
1077
+ * Get LSP server status
1078
+ */
1079
+ status(parameters, options) {
1080
+ const params = buildClientParams([parameters], [
1081
+ {
1082
+ args: [
1083
+ { in: "query", key: "directory" },
1084
+ { in: "query", key: "workspace" },
1085
+ ],
1086
+ },
1087
+ ]);
1088
+ return (options?.client ?? this.client).get({
1089
+ url: "/lsp",
1090
+ ...options,
1091
+ ...params,
1092
+ });
1093
+ }
1094
+ }
1095
+ export class Formatter extends HeyApiClient {
1096
+ /**
1097
+ * Get formatter status
1098
+ *
1099
+ * Get formatter status
1100
+ */
1101
+ status(parameters, options) {
1102
+ const params = buildClientParams([parameters], [
1103
+ {
1104
+ args: [
1105
+ { in: "query", key: "directory" },
1106
+ { in: "query", key: "workspace" },
1107
+ ],
1108
+ },
1109
+ ]);
1110
+ return (options?.client ?? this.client).get({
1111
+ url: "/formatter",
1112
+ ...options,
1113
+ ...params,
1114
+ });
1115
+ }
1116
+ }
1117
+ export class Auth2 extends HeyApiClient {
1118
+ /**
1119
+ * Remove MCP OAuth
1120
+ *
1121
+ * Remove OAuth credentials for an MCP server.
1122
+ */
1123
+ remove(parameters, options) {
1124
+ const params = buildClientParams([parameters], [
1125
+ {
1126
+ args: [
1127
+ { in: "path", key: "name" },
1128
+ { in: "query", key: "directory" },
1129
+ { in: "query", key: "workspace" },
1130
+ ],
1131
+ },
1132
+ ]);
1133
+ return (options?.client ?? this.client).delete({
1134
+ url: "/mcp/{name}/auth",
1135
+ ...options,
1136
+ ...params,
1137
+ });
1138
+ }
1139
+ /**
1140
+ * Start MCP OAuth
1141
+ *
1142
+ * Start OAuth authentication flow for a Model Context Protocol (MCP) server.
1143
+ */
1144
+ start(parameters, options) {
1145
+ const params = buildClientParams([parameters], [
1146
+ {
1147
+ args: [
1148
+ { in: "path", key: "name" },
1149
+ { in: "query", key: "directory" },
1150
+ { in: "query", key: "workspace" },
1151
+ ],
1152
+ },
1153
+ ]);
1154
+ return (options?.client ?? this.client).post({
1155
+ url: "/mcp/{name}/auth",
1156
+ ...options,
1157
+ ...params,
1158
+ });
1159
+ }
1160
+ /**
1161
+ * Complete MCP OAuth
1162
+ *
1163
+ * Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.
1164
+ */
1165
+ callback(parameters, options) {
1166
+ const params = buildClientParams([parameters], [
1167
+ {
1168
+ args: [
1169
+ { in: "path", key: "name" },
1170
+ { in: "query", key: "directory" },
1171
+ { in: "query", key: "workspace" },
1172
+ { in: "body", key: "code" },
1173
+ ],
1174
+ },
1175
+ ]);
1176
+ return (options?.client ?? this.client).post({
1177
+ url: "/mcp/{name}/auth/callback",
1178
+ ...options,
1179
+ ...params,
1180
+ headers: {
1181
+ "Content-Type": "application/json",
1182
+ ...options?.headers,
1183
+ ...params.headers,
1184
+ },
1185
+ });
1186
+ }
1187
+ /**
1188
+ * Authenticate MCP OAuth
1189
+ *
1190
+ * Start OAuth flow and wait for callback (opens browser).
1191
+ */
1192
+ authenticate(parameters, options) {
1193
+ const params = buildClientParams([parameters], [
1194
+ {
1195
+ args: [
1196
+ { in: "path", key: "name" },
1197
+ { in: "query", key: "directory" },
1198
+ { in: "query", key: "workspace" },
1199
+ ],
1200
+ },
1201
+ ]);
1202
+ return (options?.client ?? this.client).post({
1203
+ url: "/mcp/{name}/auth/authenticate",
1204
+ ...options,
1205
+ ...params,
1206
+ });
1207
+ }
1208
+ }
1209
+ export class Mcp extends HeyApiClient {
1210
+ /**
1211
+ * Get MCP status
1212
+ *
1213
+ * Get the status of all Model Context Protocol (MCP) servers.
1214
+ */
1215
+ status(parameters, options) {
1216
+ const params = buildClientParams([parameters], [
1217
+ {
1218
+ args: [
1219
+ { in: "query", key: "directory" },
1220
+ { in: "query", key: "workspace" },
1221
+ ],
1222
+ },
1223
+ ]);
1224
+ return (options?.client ?? this.client).get({
1225
+ url: "/mcp",
1226
+ ...options,
1227
+ ...params,
1228
+ });
1229
+ }
1230
+ /**
1231
+ * Add MCP server
1232
+ *
1233
+ * Dynamically add a new Model Context Protocol (MCP) server to the system.
1234
+ */
1235
+ add(parameters, options) {
1236
+ const params = buildClientParams([parameters], [
1237
+ {
1238
+ args: [
1239
+ { in: "query", key: "directory" },
1240
+ { in: "query", key: "workspace" },
1241
+ { in: "body", key: "name" },
1242
+ { in: "body", key: "config" },
1243
+ ],
1244
+ },
1245
+ ]);
1246
+ return (options?.client ?? this.client).post({
1247
+ url: "/mcp",
1248
+ ...options,
1249
+ ...params,
1250
+ headers: {
1251
+ "Content-Type": "application/json",
1252
+ ...options?.headers,
1253
+ ...params.headers,
1254
+ },
1255
+ });
1256
+ }
1257
+ /**
1258
+ * Connect an MCP server.
1259
+ */
1260
+ connect(parameters, options) {
1261
+ const params = buildClientParams([parameters], [
1262
+ {
1263
+ args: [
1264
+ { in: "path", key: "name" },
1265
+ { in: "query", key: "directory" },
1266
+ { in: "query", key: "workspace" },
1267
+ ],
1268
+ },
1269
+ ]);
1270
+ return (options?.client ?? this.client).post({
1271
+ url: "/mcp/{name}/connect",
1272
+ ...options,
1273
+ ...params,
1274
+ });
1275
+ }
1276
+ /**
1277
+ * Disconnect an MCP server.
1278
+ */
1279
+ disconnect(parameters, options) {
1280
+ const params = buildClientParams([parameters], [
1281
+ {
1282
+ args: [
1283
+ { in: "path", key: "name" },
1284
+ { in: "query", key: "directory" },
1285
+ { in: "query", key: "workspace" },
1286
+ ],
1287
+ },
1288
+ ]);
1289
+ return (options?.client ?? this.client).post({
1290
+ url: "/mcp/{name}/disconnect",
1291
+ ...options,
1292
+ ...params,
1293
+ });
1294
+ }
1295
+ _auth;
1296
+ get auth() {
1297
+ return (this._auth ??= new Auth2({ client: this.client }));
1298
+ }
1299
+ }
1300
+ export class Project extends HeyApiClient {
1301
+ /**
1302
+ * List all projects
1303
+ *
1304
+ * Get a list of projects that have been opened with OpenCode.
1305
+ */
1306
+ list(parameters, options) {
1307
+ const params = buildClientParams([parameters], [
1308
+ {
1309
+ args: [
1310
+ { in: "query", key: "directory" },
1311
+ { in: "query", key: "workspace" },
1312
+ ],
1313
+ },
1314
+ ]);
1315
+ return (options?.client ?? this.client).get({
1316
+ url: "/project",
1317
+ ...options,
1318
+ ...params,
1319
+ });
1320
+ }
1321
+ /**
1322
+ * Get current project
1323
+ *
1324
+ * Retrieve the currently active project that OpenCode is working with.
1325
+ */
1326
+ current(parameters, options) {
1327
+ const params = buildClientParams([parameters], [
1328
+ {
1329
+ args: [
1330
+ { in: "query", key: "directory" },
1331
+ { in: "query", key: "workspace" },
1332
+ ],
1333
+ },
1334
+ ]);
1335
+ return (options?.client ?? this.client).get({
1336
+ url: "/project/current",
1337
+ ...options,
1338
+ ...params,
1339
+ });
1340
+ }
1341
+ /**
1342
+ * Initialize git repository
1343
+ *
1344
+ * Create a git repository for the current project and return the refreshed project info.
1345
+ */
1346
+ initGit(parameters, options) {
1347
+ const params = buildClientParams([parameters], [
1348
+ {
1349
+ args: [
1350
+ { in: "query", key: "directory" },
1351
+ { in: "query", key: "workspace" },
1352
+ ],
1353
+ },
1354
+ ]);
1355
+ return (options?.client ?? this.client).post({
1356
+ url: "/project/git/init",
1357
+ ...options,
1358
+ ...params,
1359
+ });
1360
+ }
1361
+ /**
1362
+ * Update project
1363
+ *
1364
+ * Update project properties such as name, icon, and commands.
1365
+ */
1366
+ update(parameters, options) {
1367
+ const params = buildClientParams([parameters], [
1368
+ {
1369
+ args: [
1370
+ { in: "path", key: "projectID" },
1371
+ { in: "query", key: "directory" },
1372
+ { in: "query", key: "workspace" },
1373
+ { in: "body", key: "name" },
1374
+ { in: "body", key: "icon" },
1375
+ { in: "body", key: "commands" },
1376
+ ],
1377
+ },
1378
+ ]);
1379
+ return (options?.client ?? this.client).patch({
1380
+ url: "/project/{projectID}",
1381
+ ...options,
1382
+ ...params,
1383
+ headers: {
1384
+ "Content-Type": "application/json",
1385
+ ...options?.headers,
1386
+ ...params.headers,
1387
+ },
1388
+ });
1389
+ }
1390
+ }
1391
+ export class Pty extends HeyApiClient {
1392
+ /**
1393
+ * List available shells
1394
+ *
1395
+ * Get a list of available shells on the system.
1396
+ */
1397
+ shells(parameters, options) {
1398
+ const params = buildClientParams([parameters], [
1399
+ {
1400
+ args: [
1401
+ { in: "query", key: "directory" },
1402
+ { in: "query", key: "workspace" },
1403
+ ],
1404
+ },
1405
+ ]);
1406
+ return (options?.client ?? this.client).get({
1407
+ url: "/pty/shells",
1408
+ ...options,
1409
+ ...params,
1410
+ });
1411
+ }
1412
+ /**
1413
+ * List PTY sessions
1414
+ *
1415
+ * Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.
1416
+ */
1417
+ list(parameters, options) {
1418
+ const params = buildClientParams([parameters], [
1419
+ {
1420
+ args: [
1421
+ { in: "query", key: "directory" },
1422
+ { in: "query", key: "workspace" },
1423
+ ],
1424
+ },
1425
+ ]);
1426
+ return (options?.client ?? this.client).get({
1427
+ url: "/pty",
1428
+ ...options,
1429
+ ...params,
1430
+ });
1431
+ }
1432
+ /**
1433
+ * Create PTY session
1434
+ *
1435
+ * Create a new pseudo-terminal (PTY) session for running shell commands and processes.
1436
+ */
1437
+ create(parameters, options) {
1438
+ const params = buildClientParams([parameters], [
1439
+ {
1440
+ args: [
1441
+ { in: "query", key: "directory" },
1442
+ { in: "query", key: "workspace" },
1443
+ { in: "body", key: "command" },
1444
+ { in: "body", key: "args" },
1445
+ { in: "body", key: "cwd" },
1446
+ { in: "body", key: "title" },
1447
+ { in: "body", key: "env" },
1448
+ ],
1449
+ },
1450
+ ]);
1451
+ return (options?.client ?? this.client).post({
1452
+ url: "/pty",
1453
+ ...options,
1454
+ ...params,
1455
+ headers: {
1456
+ "Content-Type": "application/json",
1457
+ ...options?.headers,
1458
+ ...params.headers,
1459
+ },
1460
+ });
1461
+ }
1462
+ /**
1463
+ * Remove PTY session
1464
+ *
1465
+ * Remove and terminate a specific pseudo-terminal (PTY) session.
1466
+ */
1467
+ remove(parameters, options) {
1468
+ const params = buildClientParams([parameters], [
1469
+ {
1470
+ args: [
1471
+ { in: "path", key: "ptyID" },
1472
+ { in: "query", key: "directory" },
1473
+ { in: "query", key: "workspace" },
1474
+ ],
1475
+ },
1476
+ ]);
1477
+ return (options?.client ?? this.client).delete({
1478
+ url: "/pty/{ptyID}",
1479
+ ...options,
1480
+ ...params,
1481
+ });
1482
+ }
1483
+ /**
1484
+ * Get PTY session
1485
+ *
1486
+ * Retrieve detailed information about a specific pseudo-terminal (PTY) session.
1487
+ */
1488
+ get(parameters, options) {
1489
+ const params = buildClientParams([parameters], [
1490
+ {
1491
+ args: [
1492
+ { in: "path", key: "ptyID" },
1493
+ { in: "query", key: "directory" },
1494
+ { in: "query", key: "workspace" },
1495
+ ],
1496
+ },
1497
+ ]);
1498
+ return (options?.client ?? this.client).get({
1499
+ url: "/pty/{ptyID}",
1500
+ ...options,
1501
+ ...params,
1502
+ });
1503
+ }
1504
+ /**
1505
+ * Update PTY session
1506
+ *
1507
+ * Update properties of an existing pseudo-terminal (PTY) session.
1508
+ */
1509
+ update(parameters, options) {
1510
+ const params = buildClientParams([parameters], [
1511
+ {
1512
+ args: [
1513
+ { in: "path", key: "ptyID" },
1514
+ { in: "query", key: "directory" },
1515
+ { in: "query", key: "workspace" },
1516
+ { in: "body", key: "title" },
1517
+ { in: "body", key: "size" },
1518
+ ],
1519
+ },
1520
+ ]);
1521
+ return (options?.client ?? this.client).put({
1522
+ url: "/pty/{ptyID}",
1523
+ ...options,
1524
+ ...params,
1525
+ headers: {
1526
+ "Content-Type": "application/json",
1527
+ ...options?.headers,
1528
+ ...params.headers,
1529
+ },
1530
+ });
1531
+ }
1532
+ /**
1533
+ * Create PTY WebSocket token
1534
+ *
1535
+ * Create a short-lived ticket for opening a PTY WebSocket connection.
1536
+ */
1537
+ connectToken(parameters, options) {
1538
+ const params = buildClientParams([parameters], [
1539
+ {
1540
+ args: [
1541
+ { in: "path", key: "ptyID" },
1542
+ { in: "query", key: "directory" },
1543
+ { in: "query", key: "workspace" },
1544
+ ],
1545
+ },
1546
+ ]);
1547
+ return (options?.client ?? this.client).post({
1548
+ url: "/pty/{ptyID}/connect-token",
1549
+ ...options,
1550
+ ...params,
1551
+ });
1552
+ }
1553
+ /**
1554
+ * Connect to PTY session
1555
+ *
1556
+ * Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.
1557
+ */
1558
+ connect(parameters, options) {
1559
+ const params = buildClientParams([parameters], [
1560
+ {
1561
+ args: [
1562
+ { in: "path", key: "ptyID" },
1563
+ { in: "query", key: "directory" },
1564
+ { in: "query", key: "workspace" },
1565
+ ],
1566
+ },
1567
+ ]);
1568
+ return (options?.client ?? this.client).get({
1569
+ url: "/pty/{ptyID}/connect",
1570
+ ...options,
1571
+ ...params,
1572
+ });
1573
+ }
1574
+ }
1575
+ export class Question extends HeyApiClient {
1576
+ /**
1577
+ * List pending questions
1578
+ *
1579
+ * Get all pending question requests across all sessions.
1580
+ */
1581
+ list(parameters, options) {
1582
+ const params = buildClientParams([parameters], [
1583
+ {
1584
+ args: [
1585
+ { in: "query", key: "directory" },
1586
+ { in: "query", key: "workspace" },
1587
+ ],
1588
+ },
1589
+ ]);
1590
+ return (options?.client ?? this.client).get({
1591
+ url: "/question",
1592
+ ...options,
1593
+ ...params,
1594
+ });
1595
+ }
1596
+ /**
1597
+ * Reply to question request
1598
+ *
1599
+ * Provide answers to a question request from the AI assistant.
1600
+ */
1601
+ reply(parameters, options) {
1602
+ const params = buildClientParams([parameters], [
1603
+ {
1604
+ args: [
1605
+ { in: "path", key: "requestID" },
1606
+ { in: "query", key: "directory" },
1607
+ { in: "query", key: "workspace" },
1608
+ { in: "body", key: "answers" },
1609
+ ],
1610
+ },
1611
+ ]);
1612
+ return (options?.client ?? this.client).post({
1613
+ url: "/question/{requestID}/reply",
1614
+ ...options,
1615
+ ...params,
1616
+ headers: {
1617
+ "Content-Type": "application/json",
1618
+ ...options?.headers,
1619
+ ...params.headers,
1620
+ },
1621
+ });
1622
+ }
1623
+ /**
1624
+ * Reject question request
1625
+ *
1626
+ * Reject a question request from the AI assistant.
1627
+ */
1628
+ reject(parameters, options) {
1629
+ const params = buildClientParams([parameters], [
1630
+ {
1631
+ args: [
1632
+ { in: "path", key: "requestID" },
1633
+ { in: "query", key: "directory" },
1634
+ { in: "query", key: "workspace" },
1635
+ ],
1636
+ },
1637
+ ]);
1638
+ return (options?.client ?? this.client).post({
1639
+ url: "/question/{requestID}/reject",
1640
+ ...options,
1641
+ ...params,
1642
+ });
1643
+ }
1644
+ }
1645
+ export class Permission extends HeyApiClient {
1646
+ /**
1647
+ * List pending permissions
1648
+ *
1649
+ * Get all pending permission requests across all sessions.
1650
+ */
1651
+ list(parameters, options) {
1652
+ const params = buildClientParams([parameters], [
1653
+ {
1654
+ args: [
1655
+ { in: "query", key: "directory" },
1656
+ { in: "query", key: "workspace" },
1657
+ ],
1658
+ },
1659
+ ]);
1660
+ return (options?.client ?? this.client).get({
1661
+ url: "/permission",
1662
+ ...options,
1663
+ ...params,
1664
+ });
1665
+ }
1666
+ /**
1667
+ * Respond to permission request
1668
+ *
1669
+ * Approve or deny a permission request from the AI assistant.
1670
+ */
1671
+ reply(parameters, options) {
1672
+ const params = buildClientParams([parameters], [
1673
+ {
1674
+ args: [
1675
+ { in: "path", key: "requestID" },
1676
+ { in: "query", key: "directory" },
1677
+ { in: "query", key: "workspace" },
1678
+ { in: "body", key: "reply" },
1679
+ { in: "body", key: "message" },
1680
+ ],
1681
+ },
1682
+ ]);
1683
+ return (options?.client ?? this.client).post({
1684
+ url: "/permission/{requestID}/reply",
1685
+ ...options,
1686
+ ...params,
1687
+ headers: {
1688
+ "Content-Type": "application/json",
1689
+ ...options?.headers,
1690
+ ...params.headers,
1691
+ },
1692
+ });
1693
+ }
1694
+ /**
1695
+ * Respond to permission
1696
+ *
1697
+ * Approve or deny a permission request from the AI assistant.
1698
+ *
1699
+ * @deprecated
1700
+ */
1701
+ respond(parameters, options) {
1702
+ const params = buildClientParams([parameters], [
1703
+ {
1704
+ args: [
1705
+ { in: "path", key: "sessionID" },
1706
+ { in: "path", key: "permissionID" },
1707
+ { in: "query", key: "directory" },
1708
+ { in: "query", key: "workspace" },
1709
+ { in: "body", key: "response" },
1710
+ ],
1711
+ },
1712
+ ]);
1713
+ return (options?.client ?? this.client).post({
1714
+ url: "/session/{sessionID}/permissions/{permissionID}",
1715
+ ...options,
1716
+ ...params,
1717
+ headers: {
1718
+ "Content-Type": "application/json",
1719
+ ...options?.headers,
1720
+ ...params.headers,
1721
+ },
1722
+ });
1723
+ }
1724
+ }
1725
+ export class Oauth extends HeyApiClient {
1726
+ /**
1727
+ * Start OAuth authorization
1728
+ *
1729
+ * Start the OAuth authorization flow for a provider.
1730
+ */
1731
+ authorize(parameters, options) {
1732
+ const params = buildClientParams([parameters], [
1733
+ {
1734
+ args: [
1735
+ { in: "path", key: "providerID" },
1736
+ { in: "query", key: "directory" },
1737
+ { in: "query", key: "workspace" },
1738
+ { in: "body", key: "method" },
1739
+ { in: "body", key: "inputs" },
1740
+ ],
1741
+ },
1742
+ ]);
1743
+ return (options?.client ?? this.client).post({
1744
+ url: "/provider/{providerID}/oauth/authorize",
1745
+ ...options,
1746
+ ...params,
1747
+ headers: {
1748
+ "Content-Type": "application/json",
1749
+ ...options?.headers,
1750
+ ...params.headers,
1751
+ },
1752
+ });
1753
+ }
1754
+ /**
1755
+ * Handle OAuth callback
1756
+ *
1757
+ * Handle the OAuth callback from a provider after user authorization.
1758
+ */
1759
+ callback(parameters, options) {
1760
+ const params = buildClientParams([parameters], [
1761
+ {
1762
+ args: [
1763
+ { in: "path", key: "providerID" },
1764
+ { in: "query", key: "directory" },
1765
+ { in: "query", key: "workspace" },
1766
+ { in: "body", key: "method" },
1767
+ { in: "body", key: "code" },
1768
+ ],
1769
+ },
1770
+ ]);
1771
+ return (options?.client ?? this.client).post({
1772
+ url: "/provider/{providerID}/oauth/callback",
1773
+ ...options,
1774
+ ...params,
1775
+ headers: {
1776
+ "Content-Type": "application/json",
1777
+ ...options?.headers,
1778
+ ...params.headers,
1779
+ },
1780
+ });
1781
+ }
1782
+ }
1783
+ export class Provider extends HeyApiClient {
1784
+ /**
1785
+ * List providers
1786
+ *
1787
+ * Get a list of all available AI providers, including both available and connected ones.
1788
+ */
1789
+ list(parameters, options) {
1790
+ const params = buildClientParams([parameters], [
1791
+ {
1792
+ args: [
1793
+ { in: "query", key: "directory" },
1794
+ { in: "query", key: "workspace" },
1795
+ ],
1796
+ },
1797
+ ]);
1798
+ return (options?.client ?? this.client).get({
1799
+ url: "/provider",
1800
+ ...options,
1801
+ ...params,
1802
+ });
1803
+ }
1804
+ /**
1805
+ * Get provider auth methods
1806
+ *
1807
+ * Retrieve available authentication methods for all AI providers.
1808
+ */
1809
+ auth(parameters, options) {
1810
+ const params = buildClientParams([parameters], [
1811
+ {
1812
+ args: [
1813
+ { in: "query", key: "directory" },
1814
+ { in: "query", key: "workspace" },
1815
+ ],
1816
+ },
1817
+ ]);
1818
+ return (options?.client ?? this.client).get({
1819
+ url: "/provider/auth",
1820
+ ...options,
1821
+ ...params,
1822
+ });
1823
+ }
1824
+ _oauth;
1825
+ get oauth() {
1826
+ return (this._oauth ??= new Oauth({ client: this.client }));
1827
+ }
1828
+ }
1829
+ export class Session2 extends HeyApiClient {
1830
+ /**
1831
+ * List sessions
1832
+ *
1833
+ * Get a list of all OpenCode sessions, sorted by most recently updated.
1834
+ */
1835
+ list(parameters, options) {
1836
+ const params = buildClientParams([parameters], [
1837
+ {
1838
+ args: [
1839
+ { in: "query", key: "directory" },
1840
+ { in: "query", key: "workspace" },
1841
+ { in: "query", key: "scope" },
1842
+ { in: "query", key: "path" },
1843
+ { in: "query", key: "roots" },
1844
+ { in: "query", key: "start" },
1845
+ { in: "query", key: "search" },
1846
+ { in: "query", key: "limit" },
1847
+ ],
1848
+ },
1849
+ ]);
1850
+ return (options?.client ?? this.client).get({
1851
+ url: "/session",
1852
+ ...options,
1853
+ ...params,
1854
+ });
1855
+ }
1856
+ /**
1857
+ * Create session
1858
+ *
1859
+ * Create a new OpenCode session for interacting with AI assistants and managing conversations.
1860
+ */
1861
+ create(parameters, options) {
1862
+ const params = buildClientParams([parameters], [
1863
+ {
1864
+ args: [
1865
+ { in: "query", key: "directory" },
1866
+ { in: "query", key: "workspace" },
1867
+ { in: "body", key: "parentID" },
1868
+ { in: "body", key: "title" },
1869
+ { in: "body", key: "agent" },
1870
+ { in: "body", key: "model" },
1871
+ { in: "body", key: "permission" },
1872
+ { in: "body", key: "workspaceID" },
1873
+ ],
1874
+ },
1875
+ ]);
1876
+ return (options?.client ?? this.client).post({
1877
+ url: "/session",
1878
+ ...options,
1879
+ ...params,
1880
+ headers: {
1881
+ "Content-Type": "application/json",
1882
+ ...options?.headers,
1883
+ ...params.headers,
1884
+ },
1885
+ });
1886
+ }
1887
+ /**
1888
+ * Get session status
1889
+ *
1890
+ * Retrieve the current status of all sessions, including active, idle, and completed states.
1891
+ */
1892
+ status(parameters, options) {
1893
+ const params = buildClientParams([parameters], [
1894
+ {
1895
+ args: [
1896
+ { in: "query", key: "directory" },
1897
+ { in: "query", key: "workspace" },
1898
+ ],
1899
+ },
1900
+ ]);
1901
+ return (options?.client ?? this.client).get({
1902
+ url: "/session/status",
1903
+ ...options,
1904
+ ...params,
1905
+ });
1906
+ }
1907
+ /**
1908
+ * Delete session
1909
+ *
1910
+ * Delete a session and permanently remove all associated data, including messages and history.
1911
+ */
1912
+ delete(parameters, options) {
1913
+ const params = buildClientParams([parameters], [
1914
+ {
1915
+ args: [
1916
+ { in: "path", key: "sessionID" },
1917
+ { in: "query", key: "directory" },
1918
+ { in: "query", key: "workspace" },
1919
+ ],
1920
+ },
1921
+ ]);
1922
+ return (options?.client ?? this.client).delete({
1923
+ url: "/session/{sessionID}",
1924
+ ...options,
1925
+ ...params,
1926
+ });
1927
+ }
1928
+ /**
1929
+ * Get session
1930
+ *
1931
+ * Retrieve detailed information about a specific OpenCode session.
1932
+ */
1933
+ get(parameters, options) {
1934
+ const params = buildClientParams([parameters], [
1935
+ {
1936
+ args: [
1937
+ { in: "path", key: "sessionID" },
1938
+ { in: "query", key: "directory" },
1939
+ { in: "query", key: "workspace" },
1940
+ ],
1941
+ },
1942
+ ]);
1943
+ return (options?.client ?? this.client).get({
1944
+ url: "/session/{sessionID}",
1945
+ ...options,
1946
+ ...params,
1947
+ });
1948
+ }
1949
+ /**
1950
+ * Update session
1951
+ *
1952
+ * Update properties of an existing session, such as title or other metadata.
1953
+ */
1954
+ update(parameters, options) {
1955
+ const params = buildClientParams([parameters], [
1956
+ {
1957
+ args: [
1958
+ { in: "path", key: "sessionID" },
1959
+ { in: "query", key: "directory" },
1960
+ { in: "query", key: "workspace" },
1961
+ { in: "body", key: "title" },
1962
+ { in: "body", key: "permission" },
1963
+ { in: "body", key: "time" },
1964
+ ],
1965
+ },
1966
+ ]);
1967
+ return (options?.client ?? this.client).patch({
1968
+ url: "/session/{sessionID}",
1969
+ ...options,
1970
+ ...params,
1971
+ headers: {
1972
+ "Content-Type": "application/json",
1973
+ ...options?.headers,
1974
+ ...params.headers,
1975
+ },
1976
+ });
1977
+ }
1978
+ /**
1979
+ * Get session children
1980
+ *
1981
+ * Retrieve all child sessions that were forked from the specified parent session.
1982
+ */
1983
+ children(parameters, options) {
1984
+ const params = buildClientParams([parameters], [
1985
+ {
1986
+ args: [
1987
+ { in: "path", key: "sessionID" },
1988
+ { in: "query", key: "directory" },
1989
+ { in: "query", key: "workspace" },
1990
+ ],
1991
+ },
1992
+ ]);
1993
+ return (options?.client ?? this.client).get({
1994
+ url: "/session/{sessionID}/children",
1995
+ ...options,
1996
+ ...params,
1997
+ });
1998
+ }
1999
+ /**
2000
+ * Get session todos
2001
+ *
2002
+ * Retrieve the todo list associated with a specific session, showing tasks and action items.
2003
+ */
2004
+ todo(parameters, options) {
2005
+ const params = buildClientParams([parameters], [
2006
+ {
2007
+ args: [
2008
+ { in: "path", key: "sessionID" },
2009
+ { in: "query", key: "directory" },
2010
+ { in: "query", key: "workspace" },
2011
+ ],
2012
+ },
2013
+ ]);
2014
+ return (options?.client ?? this.client).get({
2015
+ url: "/session/{sessionID}/todo",
2016
+ ...options,
2017
+ ...params,
2018
+ });
2019
+ }
2020
+ /**
2021
+ * Get message diff
2022
+ *
2023
+ * Get the file changes (diff) that resulted from a specific user message in the session.
2024
+ */
2025
+ diff(parameters, options) {
2026
+ const params = buildClientParams([parameters], [
2027
+ {
2028
+ args: [
2029
+ { in: "path", key: "sessionID" },
2030
+ { in: "query", key: "directory" },
2031
+ { in: "query", key: "workspace" },
2032
+ { in: "query", key: "messageID" },
2033
+ ],
2034
+ },
2035
+ ]);
2036
+ return (options?.client ?? this.client).get({
2037
+ url: "/session/{sessionID}/diff",
2038
+ ...options,
2039
+ ...params,
2040
+ });
2041
+ }
2042
+ /**
2043
+ * Get session messages
2044
+ *
2045
+ * Retrieve all messages in a session, including user prompts and AI responses.
2046
+ */
2047
+ messages(parameters, options) {
2048
+ const params = buildClientParams([parameters], [
2049
+ {
2050
+ args: [
2051
+ { in: "path", key: "sessionID" },
2052
+ { in: "query", key: "directory" },
2053
+ { in: "query", key: "workspace" },
2054
+ { in: "query", key: "limit" },
2055
+ { in: "query", key: "before" },
2056
+ ],
2057
+ },
2058
+ ]);
2059
+ return (options?.client ?? this.client).get({
2060
+ url: "/session/{sessionID}/message",
2061
+ ...options,
2062
+ ...params,
2063
+ });
2064
+ }
2065
+ /**
2066
+ * Send message
2067
+ *
2068
+ * Create and send a new message to a session, streaming the AI response.
2069
+ */
2070
+ prompt(parameters, options) {
2071
+ const params = buildClientParams([parameters], [
2072
+ {
2073
+ args: [
2074
+ { in: "path", key: "sessionID" },
2075
+ { in: "query", key: "directory" },
2076
+ { in: "query", key: "workspace" },
2077
+ { in: "body", key: "messageID" },
2078
+ { in: "body", key: "model" },
2079
+ { in: "body", key: "agent" },
2080
+ { in: "body", key: "noReply" },
2081
+ { in: "body", key: "tools" },
2082
+ { in: "body", key: "format" },
2083
+ { in: "body", key: "system" },
2084
+ { in: "body", key: "variant" },
2085
+ { in: "body", key: "parts" },
2086
+ ],
2087
+ },
2088
+ ]);
2089
+ return (options?.client ?? this.client).post({
2090
+ url: "/session/{sessionID}/message",
2091
+ ...options,
2092
+ ...params,
2093
+ headers: {
2094
+ "Content-Type": "application/json",
2095
+ ...options?.headers,
2096
+ ...params.headers,
2097
+ },
2098
+ });
2099
+ }
2100
+ /**
2101
+ * Delete message
2102
+ *
2103
+ * Permanently delete a specific message and all of its parts from a session without reverting file changes.
2104
+ */
2105
+ deleteMessage(parameters, options) {
2106
+ const params = buildClientParams([parameters], [
2107
+ {
2108
+ args: [
2109
+ { in: "path", key: "sessionID" },
2110
+ { in: "path", key: "messageID" },
2111
+ { in: "query", key: "directory" },
2112
+ { in: "query", key: "workspace" },
2113
+ ],
2114
+ },
2115
+ ]);
2116
+ return (options?.client ?? this.client).delete({
2117
+ url: "/session/{sessionID}/message/{messageID}",
2118
+ ...options,
2119
+ ...params,
2120
+ });
2121
+ }
2122
+ /**
2123
+ * Get message
2124
+ *
2125
+ * Retrieve a specific message from a session by its message ID.
2126
+ */
2127
+ message(parameters, options) {
2128
+ const params = buildClientParams([parameters], [
2129
+ {
2130
+ args: [
2131
+ { in: "path", key: "sessionID" },
2132
+ { in: "path", key: "messageID" },
2133
+ { in: "query", key: "directory" },
2134
+ { in: "query", key: "workspace" },
2135
+ ],
2136
+ },
2137
+ ]);
2138
+ return (options?.client ?? this.client).get({
2139
+ url: "/session/{sessionID}/message/{messageID}",
2140
+ ...options,
2141
+ ...params,
2142
+ });
2143
+ }
2144
+ /**
2145
+ * Fork session
2146
+ *
2147
+ * Create a new session by forking an existing session at a specific message point.
2148
+ */
2149
+ fork(parameters, options) {
2150
+ const params = buildClientParams([parameters], [
2151
+ {
2152
+ args: [
2153
+ { in: "path", key: "sessionID" },
2154
+ { in: "query", key: "directory" },
2155
+ { in: "query", key: "workspace" },
2156
+ { in: "body", key: "messageID" },
2157
+ ],
2158
+ },
2159
+ ]);
2160
+ return (options?.client ?? this.client).post({
2161
+ url: "/session/{sessionID}/fork",
2162
+ ...options,
2163
+ ...params,
2164
+ headers: {
2165
+ "Content-Type": "application/json",
2166
+ ...options?.headers,
2167
+ ...params.headers,
2168
+ },
2169
+ });
2170
+ }
2171
+ /**
2172
+ * Abort session
2173
+ *
2174
+ * Abort an active session and stop any ongoing AI processing or command execution.
2175
+ */
2176
+ abort(parameters, options) {
2177
+ const params = buildClientParams([parameters], [
2178
+ {
2179
+ args: [
2180
+ { in: "path", key: "sessionID" },
2181
+ { in: "query", key: "directory" },
2182
+ { in: "query", key: "workspace" },
2183
+ ],
2184
+ },
2185
+ ]);
2186
+ return (options?.client ?? this.client).post({
2187
+ url: "/session/{sessionID}/abort",
2188
+ ...options,
2189
+ ...params,
2190
+ });
2191
+ }
2192
+ /**
2193
+ * Initialize session
2194
+ *
2195
+ * Analyze the current application and create an AGENTS.md file with project-specific agent configurations.
2196
+ */
2197
+ init(parameters, options) {
2198
+ const params = buildClientParams([parameters], [
2199
+ {
2200
+ args: [
2201
+ { in: "path", key: "sessionID" },
2202
+ { in: "query", key: "directory" },
2203
+ { in: "query", key: "workspace" },
2204
+ { in: "body", key: "modelID" },
2205
+ { in: "body", key: "providerID" },
2206
+ { in: "body", key: "messageID" },
2207
+ ],
2208
+ },
2209
+ ]);
2210
+ return (options?.client ?? this.client).post({
2211
+ url: "/session/{sessionID}/init",
2212
+ ...options,
2213
+ ...params,
2214
+ headers: {
2215
+ "Content-Type": "application/json",
2216
+ ...options?.headers,
2217
+ ...params.headers,
2218
+ },
2219
+ });
2220
+ }
2221
+ /**
2222
+ * Unshare session
2223
+ *
2224
+ * Remove the shareable link for a session, making it private again.
2225
+ */
2226
+ unshare(parameters, options) {
2227
+ const params = buildClientParams([parameters], [
2228
+ {
2229
+ args: [
2230
+ { in: "path", key: "sessionID" },
2231
+ { in: "query", key: "directory" },
2232
+ { in: "query", key: "workspace" },
2233
+ ],
2234
+ },
2235
+ ]);
2236
+ return (options?.client ?? this.client).delete({
2237
+ url: "/session/{sessionID}/share",
2238
+ ...options,
2239
+ ...params,
2240
+ });
2241
+ }
2242
+ /**
2243
+ * Share session
2244
+ *
2245
+ * Create a shareable link for a session, allowing others to view the conversation.
2246
+ */
2247
+ share(parameters, options) {
2248
+ const params = buildClientParams([parameters], [
2249
+ {
2250
+ args: [
2251
+ { in: "path", key: "sessionID" },
2252
+ { in: "query", key: "directory" },
2253
+ { in: "query", key: "workspace" },
2254
+ ],
2255
+ },
2256
+ ]);
2257
+ return (options?.client ?? this.client).post({
2258
+ url: "/session/{sessionID}/share",
2259
+ ...options,
2260
+ ...params,
2261
+ });
2262
+ }
2263
+ /**
2264
+ * Summarize session
2265
+ *
2266
+ * Generate a concise summary of the session using AI compaction to preserve key information.
2267
+ */
2268
+ summarize(parameters, options) {
2269
+ const params = buildClientParams([parameters], [
2270
+ {
2271
+ args: [
2272
+ { in: "path", key: "sessionID" },
2273
+ { in: "query", key: "directory" },
2274
+ { in: "query", key: "workspace" },
2275
+ { in: "body", key: "providerID" },
2276
+ { in: "body", key: "modelID" },
2277
+ { in: "body", key: "auto" },
2278
+ ],
2279
+ },
2280
+ ]);
2281
+ return (options?.client ?? this.client).post({
2282
+ url: "/session/{sessionID}/summarize",
2283
+ ...options,
2284
+ ...params,
2285
+ headers: {
2286
+ "Content-Type": "application/json",
2287
+ ...options?.headers,
2288
+ ...params.headers,
2289
+ },
2290
+ });
2291
+ }
2292
+ /**
2293
+ * Send async message
2294
+ *
2295
+ * Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.
2296
+ */
2297
+ promptAsync(parameters, options) {
2298
+ const params = buildClientParams([parameters], [
2299
+ {
2300
+ args: [
2301
+ { in: "path", key: "sessionID" },
2302
+ { in: "query", key: "directory" },
2303
+ { in: "query", key: "workspace" },
2304
+ { in: "body", key: "messageID" },
2305
+ { in: "body", key: "model" },
2306
+ { in: "body", key: "agent" },
2307
+ { in: "body", key: "noReply" },
2308
+ { in: "body", key: "tools" },
2309
+ { in: "body", key: "format" },
2310
+ { in: "body", key: "system" },
2311
+ { in: "body", key: "variant" },
2312
+ { in: "body", key: "parts" },
2313
+ ],
2314
+ },
2315
+ ]);
2316
+ return (options?.client ?? this.client).post({
2317
+ url: "/session/{sessionID}/prompt_async",
2318
+ ...options,
2319
+ ...params,
2320
+ headers: {
2321
+ "Content-Type": "application/json",
2322
+ ...options?.headers,
2323
+ ...params.headers,
2324
+ },
2325
+ });
2326
+ }
2327
+ /**
2328
+ * Send command
2329
+ *
2330
+ * Send a new command to a session for execution by the AI assistant.
2331
+ */
2332
+ command(parameters, options) {
2333
+ const params = buildClientParams([parameters], [
2334
+ {
2335
+ args: [
2336
+ { in: "path", key: "sessionID" },
2337
+ { in: "query", key: "directory" },
2338
+ { in: "query", key: "workspace" },
2339
+ { in: "body", key: "messageID" },
2340
+ { in: "body", key: "agent" },
2341
+ { in: "body", key: "model" },
2342
+ { in: "body", key: "arguments" },
2343
+ { in: "body", key: "command" },
2344
+ { in: "body", key: "variant" },
2345
+ { in: "body", key: "parts" },
2346
+ ],
2347
+ },
2348
+ ]);
2349
+ return (options?.client ?? this.client).post({
2350
+ url: "/session/{sessionID}/command",
2351
+ ...options,
2352
+ ...params,
2353
+ headers: {
2354
+ "Content-Type": "application/json",
2355
+ ...options?.headers,
2356
+ ...params.headers,
2357
+ },
2358
+ });
2359
+ }
2360
+ /**
2361
+ * Run shell command
2362
+ *
2363
+ * Execute a shell command within the session context and return the AI's response.
2364
+ */
2365
+ shell(parameters, options) {
2366
+ const params = buildClientParams([parameters], [
2367
+ {
2368
+ args: [
2369
+ { in: "path", key: "sessionID" },
2370
+ { in: "query", key: "directory" },
2371
+ { in: "query", key: "workspace" },
2372
+ { in: "body", key: "messageID" },
2373
+ { in: "body", key: "agent" },
2374
+ { in: "body", key: "model" },
2375
+ { in: "body", key: "command" },
2376
+ ],
2377
+ },
2378
+ ]);
2379
+ return (options?.client ?? this.client).post({
2380
+ url: "/session/{sessionID}/shell",
2381
+ ...options,
2382
+ ...params,
2383
+ headers: {
2384
+ "Content-Type": "application/json",
2385
+ ...options?.headers,
2386
+ ...params.headers,
2387
+ },
2388
+ });
2389
+ }
2390
+ /**
2391
+ * Revert message
2392
+ *
2393
+ * Revert a specific message in a session, undoing its effects and restoring the previous state.
2394
+ */
2395
+ revert(parameters, options) {
2396
+ const params = buildClientParams([parameters], [
2397
+ {
2398
+ args: [
2399
+ { in: "path", key: "sessionID" },
2400
+ { in: "query", key: "directory" },
2401
+ { in: "query", key: "workspace" },
2402
+ { in: "body", key: "messageID" },
2403
+ { in: "body", key: "partID" },
2404
+ ],
2405
+ },
2406
+ ]);
2407
+ return (options?.client ?? this.client).post({
2408
+ url: "/session/{sessionID}/revert",
2409
+ ...options,
2410
+ ...params,
2411
+ headers: {
2412
+ "Content-Type": "application/json",
2413
+ ...options?.headers,
2414
+ ...params.headers,
2415
+ },
2416
+ });
2417
+ }
2418
+ /**
2419
+ * Restore reverted messages
2420
+ *
2421
+ * Restore all previously reverted messages in a session.
2422
+ */
2423
+ unrevert(parameters, options) {
2424
+ const params = buildClientParams([parameters], [
2425
+ {
2426
+ args: [
2427
+ { in: "path", key: "sessionID" },
2428
+ { in: "query", key: "directory" },
2429
+ { in: "query", key: "workspace" },
2430
+ ],
2431
+ },
2432
+ ]);
2433
+ return (options?.client ?? this.client).post({
2434
+ url: "/session/{sessionID}/unrevert",
2435
+ ...options,
2436
+ ...params,
2437
+ });
2438
+ }
2439
+ }
2440
+ export class Part extends HeyApiClient {
2441
+ /**
2442
+ * Delete a part from a message.
2443
+ */
2444
+ delete(parameters, options) {
2445
+ const params = buildClientParams([parameters], [
2446
+ {
2447
+ args: [
2448
+ { in: "path", key: "sessionID" },
2449
+ { in: "path", key: "messageID" },
2450
+ { in: "path", key: "partID" },
2451
+ { in: "query", key: "directory" },
2452
+ { in: "query", key: "workspace" },
2453
+ ],
2454
+ },
2455
+ ]);
2456
+ return (options?.client ?? this.client).delete({
2457
+ url: "/session/{sessionID}/message/{messageID}/part/{partID}",
2458
+ ...options,
2459
+ ...params,
2460
+ });
2461
+ }
2462
+ /**
2463
+ * Update a part in a message.
2464
+ */
2465
+ update(parameters, options) {
2466
+ const params = buildClientParams([parameters], [
2467
+ {
2468
+ args: [
2469
+ { in: "path", key: "sessionID" },
2470
+ { in: "path", key: "messageID" },
2471
+ { in: "path", key: "partID" },
2472
+ { in: "query", key: "directory" },
2473
+ { in: "query", key: "workspace" },
2474
+ { key: "part", map: "body" },
2475
+ ],
2476
+ },
2477
+ ]);
2478
+ return (options?.client ?? this.client).patch({
2479
+ url: "/session/{sessionID}/message/{messageID}/part/{partID}",
2480
+ ...options,
2481
+ ...params,
2482
+ headers: {
2483
+ "Content-Type": "application/json",
2484
+ ...options?.headers,
2485
+ ...params.headers,
2486
+ },
2487
+ });
2488
+ }
2489
+ }
2490
+ export class History extends HeyApiClient {
2491
+ /**
2492
+ * List sync events
2493
+ *
2494
+ * List sync events for all aggregates. Keys are aggregate IDs the client already knows about, values are the last known sequence ID. Events with seq > value are returned for those aggregates. Aggregates not listed in the input get their full history.
2495
+ */
2496
+ list(parameters, options) {
2497
+ const params = buildClientParams([parameters], [
2498
+ {
2499
+ args: [
2500
+ { in: "query", key: "directory" },
2501
+ { in: "query", key: "workspace" },
2502
+ { key: "body", map: "body" },
2503
+ ],
2504
+ },
2505
+ ]);
2506
+ return (options?.client ?? this.client).post({
2507
+ url: "/sync/history",
2508
+ ...options,
2509
+ ...params,
2510
+ headers: {
2511
+ "Content-Type": "application/json",
2512
+ ...options?.headers,
2513
+ ...params.headers,
2514
+ },
2515
+ });
2516
+ }
2517
+ }
2518
+ export class Sync extends HeyApiClient {
2519
+ /**
2520
+ * Start workspace sync
2521
+ *
2522
+ * Start sync loops for workspaces in the current project that have active sessions.
2523
+ */
2524
+ start(parameters, options) {
2525
+ const params = buildClientParams([parameters], [
2526
+ {
2527
+ args: [
2528
+ { in: "query", key: "directory" },
2529
+ { in: "query", key: "workspace" },
2530
+ ],
2531
+ },
2532
+ ]);
2533
+ return (options?.client ?? this.client).post({
2534
+ url: "/sync/start",
2535
+ ...options,
2536
+ ...params,
2537
+ });
2538
+ }
2539
+ /**
2540
+ * Replay sync events
2541
+ *
2542
+ * Validate and replay a complete sync event history.
2543
+ */
2544
+ replay(parameters, options) {
2545
+ const params = buildClientParams([parameters], [
2546
+ {
2547
+ args: [
2548
+ {
2549
+ in: "query",
2550
+ key: "query_directory",
2551
+ map: "directory",
2552
+ },
2553
+ { in: "query", key: "workspace" },
2554
+ {
2555
+ in: "body",
2556
+ key: "body_directory",
2557
+ map: "directory",
2558
+ },
2559
+ { in: "body", key: "events" },
2560
+ ],
2561
+ },
2562
+ ]);
2563
+ return (options?.client ?? this.client).post({
2564
+ url: "/sync/replay",
2565
+ ...options,
2566
+ ...params,
2567
+ headers: {
2568
+ "Content-Type": "application/json",
2569
+ ...options?.headers,
2570
+ ...params.headers,
2571
+ },
2572
+ });
2573
+ }
2574
+ /**
2575
+ * Steal session into workspace
2576
+ *
2577
+ * Update a session to belong to the current workspace through the sync event system.
2578
+ */
2579
+ steal(parameters, options) {
2580
+ const params = buildClientParams([parameters], [
2581
+ {
2582
+ args: [
2583
+ { in: "query", key: "directory" },
2584
+ { in: "query", key: "workspace" },
2585
+ { in: "body", key: "sessionID" },
2586
+ ],
2587
+ },
2588
+ ]);
2589
+ return (options?.client ?? this.client).post({
2590
+ url: "/sync/steal",
2591
+ ...options,
2592
+ ...params,
2593
+ headers: {
2594
+ "Content-Type": "application/json",
2595
+ ...options?.headers,
2596
+ ...params.headers,
2597
+ },
2598
+ });
2599
+ }
2600
+ _history;
2601
+ get history() {
2602
+ return (this._history ??= new History({ client: this.client }));
2603
+ }
2604
+ }
2605
+ export class Session3 extends HeyApiClient {
2606
+ /**
2607
+ * List v2 sessions
2608
+ *
2609
+ * Retrieve sessions in the requested order. Items keep that order across pages; use cursor.next or cursor.previous to move through the ordered list.
2610
+ */
2611
+ list(parameters, options) {
2612
+ const params = buildClientParams([parameters], [
2613
+ {
2614
+ args: [
2615
+ { in: "query", key: "directory" },
2616
+ { in: "query", key: "workspace" },
2617
+ { in: "query", key: "limit" },
2618
+ { in: "query", key: "order" },
2619
+ { in: "query", key: "path" },
2620
+ { in: "query", key: "roots" },
2621
+ { in: "query", key: "start" },
2622
+ { in: "query", key: "search" },
2623
+ { in: "query", key: "cursor" },
2624
+ ],
2625
+ },
2626
+ ]);
2627
+ return (options?.client ?? this.client).get({
2628
+ url: "/api/session",
2629
+ ...options,
2630
+ ...params,
2631
+ });
2632
+ }
2633
+ /**
2634
+ * Send v2 message
2635
+ *
2636
+ * Create a v2 session message and queue it for the agent loop.
2637
+ */
2638
+ prompt(parameters, options) {
2639
+ const params = buildClientParams([parameters], [
2640
+ {
2641
+ args: [
2642
+ { in: "path", key: "sessionID" },
2643
+ { in: "query", key: "directory" },
2644
+ { in: "query", key: "workspace" },
2645
+ { in: "body", key: "prompt" },
2646
+ { in: "body", key: "delivery" },
2647
+ ],
2648
+ },
2649
+ ]);
2650
+ return (options?.client ?? this.client).post({
2651
+ url: "/api/session/{sessionID}/prompt",
2652
+ ...options,
2653
+ ...params,
2654
+ headers: {
2655
+ "Content-Type": "application/json",
2656
+ ...options?.headers,
2657
+ ...params.headers,
2658
+ },
2659
+ });
2660
+ }
2661
+ /**
2662
+ * Compact v2 session
2663
+ *
2664
+ * Compact a v2 session conversation.
2665
+ */
2666
+ compact(parameters, options) {
2667
+ const params = buildClientParams([parameters], [
2668
+ {
2669
+ args: [
2670
+ { in: "path", key: "sessionID" },
2671
+ { in: "query", key: "directory" },
2672
+ { in: "query", key: "workspace" },
2673
+ ],
2674
+ },
2675
+ ]);
2676
+ return (options?.client ?? this.client).post({
2677
+ url: "/api/session/{sessionID}/compact",
2678
+ ...options,
2679
+ ...params,
2680
+ });
2681
+ }
2682
+ /**
2683
+ * Wait for v2 session
2684
+ *
2685
+ * Wait for a v2 session agent loop to become idle.
2686
+ */
2687
+ wait(parameters, options) {
2688
+ const params = buildClientParams([parameters], [
2689
+ {
2690
+ args: [
2691
+ { in: "path", key: "sessionID" },
2692
+ { in: "query", key: "directory" },
2693
+ { in: "query", key: "workspace" },
2694
+ ],
2695
+ },
2696
+ ]);
2697
+ return (options?.client ?? this.client).post({
2698
+ url: "/api/session/{sessionID}/wait",
2699
+ ...options,
2700
+ ...params,
2701
+ });
2702
+ }
2703
+ /**
2704
+ * Get v2 session context
2705
+ *
2706
+ * Retrieve the active context messages for a v2 session (all messages after the last compaction).
2707
+ */
2708
+ context(parameters, options) {
2709
+ const params = buildClientParams([parameters], [
2710
+ {
2711
+ args: [
2712
+ { in: "path", key: "sessionID" },
2713
+ { in: "query", key: "directory" },
2714
+ { in: "query", key: "workspace" },
2715
+ ],
2716
+ },
2717
+ ]);
2718
+ return (options?.client ?? this.client).get({
2719
+ url: "/api/session/{sessionID}/context",
2720
+ ...options,
2721
+ ...params,
2722
+ });
2723
+ }
2724
+ /**
2725
+ * Get v2 session messages
2726
+ *
2727
+ * Retrieve projected v2 messages for a session. Items keep the requested order across pages; use cursor.next or cursor.previous to move through the ordered timeline.
2728
+ */
2729
+ messages(parameters, options) {
2730
+ const params = buildClientParams([parameters], [
2731
+ {
2732
+ args: [
2733
+ { in: "path", key: "sessionID" },
2734
+ { in: "query", key: "directory" },
2735
+ { in: "query", key: "workspace" },
2736
+ { in: "query", key: "limit" },
2737
+ { in: "query", key: "order" },
2738
+ { in: "query", key: "cursor" },
2739
+ ],
2740
+ },
2741
+ ]);
2742
+ return (options?.client ?? this.client).get({
2743
+ url: "/api/session/{sessionID}/message",
2744
+ ...options,
2745
+ ...params,
2746
+ });
2747
+ }
2748
+ }
2749
+ export class Model extends HeyApiClient {
2750
+ /**
2751
+ * List v2 models
2752
+ *
2753
+ * Retrieve available v2 models ordered by release date.
2754
+ */
2755
+ list(parameters, options) {
2756
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]);
2757
+ return (options?.client ?? this.client).get({
2758
+ url: "/api/model",
2759
+ ...options,
2760
+ ...params,
2761
+ });
2762
+ }
2763
+ }
2764
+ export class Provider2 extends HeyApiClient {
2765
+ /**
2766
+ * List v2 providers
2767
+ *
2768
+ * Retrieve active v2 AI providers so clients can show provider availability and configuration.
2769
+ */
2770
+ list(parameters, options) {
2771
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]);
2772
+ return (options?.client ?? this.client).get({
2773
+ url: "/api/provider",
2774
+ ...options,
2775
+ ...params,
2776
+ });
2777
+ }
2778
+ /**
2779
+ * Get v2 provider
2780
+ *
2781
+ * Retrieve a single v2 AI provider so clients can inspect its availability and endpoint settings.
2782
+ */
2783
+ get(parameters, options) {
2784
+ const params = buildClientParams([parameters], [
2785
+ {
2786
+ args: [
2787
+ { in: "path", key: "providerID" },
2788
+ { in: "query", key: "location" },
2789
+ ],
2790
+ },
2791
+ ]);
2792
+ return (options?.client ?? this.client).get({
2793
+ url: "/api/provider/{providerID}",
2794
+ ...options,
2795
+ ...params,
2796
+ });
2797
+ }
2798
+ }
2799
+ export class V2 extends HeyApiClient {
2800
+ _session;
2801
+ get session() {
2802
+ return (this._session ??= new Session3({ client: this.client }));
2803
+ }
2804
+ _model;
2805
+ get model() {
2806
+ return (this._model ??= new Model({ client: this.client }));
2807
+ }
2808
+ _provider;
2809
+ get provider() {
2810
+ return (this._provider ??= new Provider2({ client: this.client }));
2811
+ }
2812
+ }
2813
+ export class Control extends HeyApiClient {
2814
+ /**
2815
+ * Get next TUI request
2816
+ *
2817
+ * Retrieve the next TUI request from the queue for processing.
2818
+ */
2819
+ next(parameters, options) {
2820
+ const params = buildClientParams([parameters], [
2821
+ {
2822
+ args: [
2823
+ { in: "query", key: "directory" },
2824
+ { in: "query", key: "workspace" },
2825
+ ],
2826
+ },
2827
+ ]);
2828
+ return (options?.client ?? this.client).get({
2829
+ url: "/tui/control/next",
2830
+ ...options,
2831
+ ...params,
2832
+ });
2833
+ }
2834
+ /**
2835
+ * Submit TUI response
2836
+ *
2837
+ * Submit a response to the TUI request queue to complete a pending request.
2838
+ */
2839
+ response(parameters, options) {
2840
+ const params = buildClientParams([parameters], [
2841
+ {
2842
+ args: [
2843
+ { in: "query", key: "directory" },
2844
+ { in: "query", key: "workspace" },
2845
+ { key: "body", map: "body" },
2846
+ ],
2847
+ },
2848
+ ]);
2849
+ return (options?.client ?? this.client).post({
2850
+ url: "/tui/control/response",
2851
+ ...options,
2852
+ ...params,
2853
+ headers: {
2854
+ "Content-Type": "application/json",
2855
+ ...options?.headers,
2856
+ ...params.headers,
2857
+ },
2858
+ });
2859
+ }
2860
+ }
2861
+ export class Tui extends HeyApiClient {
2862
+ /**
2863
+ * Append TUI prompt
2864
+ *
2865
+ * Append prompt to the TUI.
2866
+ */
2867
+ appendPrompt(parameters, options) {
2868
+ const params = buildClientParams([parameters], [
2869
+ {
2870
+ args: [
2871
+ { in: "query", key: "directory" },
2872
+ { in: "query", key: "workspace" },
2873
+ { in: "body", key: "text" },
2874
+ ],
2875
+ },
2876
+ ]);
2877
+ return (options?.client ?? this.client).post({
2878
+ url: "/tui/append-prompt",
2879
+ ...options,
2880
+ ...params,
2881
+ headers: {
2882
+ "Content-Type": "application/json",
2883
+ ...options?.headers,
2884
+ ...params.headers,
2885
+ },
2886
+ });
2887
+ }
2888
+ /**
2889
+ * Open help dialog
2890
+ *
2891
+ * Open the help dialog in the TUI to display user assistance information.
2892
+ */
2893
+ openHelp(parameters, options) {
2894
+ const params = buildClientParams([parameters], [
2895
+ {
2896
+ args: [
2897
+ { in: "query", key: "directory" },
2898
+ { in: "query", key: "workspace" },
2899
+ ],
2900
+ },
2901
+ ]);
2902
+ return (options?.client ?? this.client).post({
2903
+ url: "/tui/open-help",
2904
+ ...options,
2905
+ ...params,
2906
+ });
2907
+ }
2908
+ /**
2909
+ * Open sessions dialog
2910
+ *
2911
+ * Open the session dialog.
2912
+ */
2913
+ openSessions(parameters, options) {
2914
+ const params = buildClientParams([parameters], [
2915
+ {
2916
+ args: [
2917
+ { in: "query", key: "directory" },
2918
+ { in: "query", key: "workspace" },
2919
+ ],
2920
+ },
2921
+ ]);
2922
+ return (options?.client ?? this.client).post({
2923
+ url: "/tui/open-sessions",
2924
+ ...options,
2925
+ ...params,
2926
+ });
2927
+ }
2928
+ /**
2929
+ * Open themes dialog
2930
+ *
2931
+ * Open the theme dialog.
2932
+ */
2933
+ openThemes(parameters, options) {
2934
+ const params = buildClientParams([parameters], [
2935
+ {
2936
+ args: [
2937
+ { in: "query", key: "directory" },
2938
+ { in: "query", key: "workspace" },
2939
+ ],
2940
+ },
2941
+ ]);
2942
+ return (options?.client ?? this.client).post({
2943
+ url: "/tui/open-themes",
2944
+ ...options,
2945
+ ...params,
2946
+ });
2947
+ }
2948
+ /**
2949
+ * Open models dialog
2950
+ *
2951
+ * Open the model dialog.
2952
+ */
2953
+ openModels(parameters, options) {
2954
+ const params = buildClientParams([parameters], [
2955
+ {
2956
+ args: [
2957
+ { in: "query", key: "directory" },
2958
+ { in: "query", key: "workspace" },
2959
+ ],
2960
+ },
2961
+ ]);
2962
+ return (options?.client ?? this.client).post({
2963
+ url: "/tui/open-models",
2964
+ ...options,
2965
+ ...params,
2966
+ });
2967
+ }
2968
+ /**
2969
+ * Submit TUI prompt
2970
+ *
2971
+ * Submit the prompt.
2972
+ */
2973
+ submitPrompt(parameters, options) {
2974
+ const params = buildClientParams([parameters], [
2975
+ {
2976
+ args: [
2977
+ { in: "query", key: "directory" },
2978
+ { in: "query", key: "workspace" },
2979
+ ],
2980
+ },
2981
+ ]);
2982
+ return (options?.client ?? this.client).post({
2983
+ url: "/tui/submit-prompt",
2984
+ ...options,
2985
+ ...params,
2986
+ });
2987
+ }
2988
+ /**
2989
+ * Clear TUI prompt
2990
+ *
2991
+ * Clear the prompt.
2992
+ */
2993
+ clearPrompt(parameters, options) {
2994
+ const params = buildClientParams([parameters], [
2995
+ {
2996
+ args: [
2997
+ { in: "query", key: "directory" },
2998
+ { in: "query", key: "workspace" },
2999
+ ],
3000
+ },
3001
+ ]);
3002
+ return (options?.client ?? this.client).post({
3003
+ url: "/tui/clear-prompt",
3004
+ ...options,
3005
+ ...params,
3006
+ });
3007
+ }
3008
+ /**
3009
+ * Execute TUI command
3010
+ *
3011
+ * Execute a TUI command.
3012
+ */
3013
+ executeCommand(parameters, options) {
3014
+ const params = buildClientParams([parameters], [
3015
+ {
3016
+ args: [
3017
+ { in: "query", key: "directory" },
3018
+ { in: "query", key: "workspace" },
3019
+ { in: "body", key: "command" },
3020
+ ],
3021
+ },
3022
+ ]);
3023
+ return (options?.client ?? this.client).post({
3024
+ url: "/tui/execute-command",
3025
+ ...options,
3026
+ ...params,
3027
+ headers: {
3028
+ "Content-Type": "application/json",
3029
+ ...options?.headers,
3030
+ ...params.headers,
3031
+ },
3032
+ });
3033
+ }
3034
+ /**
3035
+ * Show TUI toast
3036
+ *
3037
+ * Show a toast notification in the TUI.
3038
+ */
3039
+ showToast(parameters, options) {
3040
+ const params = buildClientParams([parameters], [
3041
+ {
3042
+ args: [
3043
+ { in: "query", key: "directory" },
3044
+ { in: "query", key: "workspace" },
3045
+ { in: "body", key: "title" },
3046
+ { in: "body", key: "message" },
3047
+ { in: "body", key: "variant" },
3048
+ { in: "body", key: "duration" },
3049
+ ],
3050
+ },
3051
+ ]);
3052
+ return (options?.client ?? this.client).post({
3053
+ url: "/tui/show-toast",
3054
+ ...options,
3055
+ ...params,
3056
+ headers: {
3057
+ "Content-Type": "application/json",
3058
+ ...options?.headers,
3059
+ ...params.headers,
3060
+ },
3061
+ });
3062
+ }
3063
+ /**
3064
+ * Publish TUI event
3065
+ *
3066
+ * Publish a TUI event.
3067
+ */
3068
+ publish(parameters, options) {
3069
+ const params = buildClientParams([parameters], [
3070
+ {
3071
+ args: [
3072
+ { in: "query", key: "directory" },
3073
+ { in: "query", key: "workspace" },
3074
+ { key: "body", map: "body" },
3075
+ ],
3076
+ },
3077
+ ]);
3078
+ return (options?.client ?? this.client).post({
3079
+ url: "/tui/publish",
3080
+ ...options,
3081
+ ...params,
3082
+ headers: {
3083
+ "Content-Type": "application/json",
3084
+ ...options?.headers,
3085
+ ...params.headers,
3086
+ },
3087
+ });
3088
+ }
3089
+ /**
3090
+ * Select session
3091
+ *
3092
+ * Navigate the TUI to display the specified session.
3093
+ */
3094
+ selectSession(parameters, options) {
3095
+ const params = buildClientParams([parameters], [
3096
+ {
3097
+ args: [
3098
+ { in: "query", key: "directory" },
3099
+ { in: "query", key: "workspace" },
3100
+ { in: "body", key: "sessionID" },
3101
+ ],
3102
+ },
3103
+ ]);
3104
+ return (options?.client ?? this.client).post({
3105
+ url: "/tui/select-session",
3106
+ ...options,
3107
+ ...params,
3108
+ headers: {
3109
+ "Content-Type": "application/json",
3110
+ ...options?.headers,
3111
+ ...params.headers,
3112
+ },
3113
+ });
3114
+ }
3115
+ _control;
3116
+ get control() {
3117
+ return (this._control ??= new Control({ client: this.client }));
3118
+ }
3119
+ }
3120
+ export class OpencodeClient extends HeyApiClient {
3121
+ static __registry = new HeyApiRegistry();
3122
+ constructor(args) {
3123
+ super(args);
3124
+ OpencodeClient.__registry.set(this, args?.key);
3125
+ }
3126
+ _auth;
3127
+ get auth() {
3128
+ return (this._auth ??= new Auth({ client: this.client }));
3129
+ }
3130
+ _app;
3131
+ get app() {
3132
+ return (this._app ??= new App({ client: this.client }));
3133
+ }
3134
+ _global;
3135
+ get global() {
3136
+ return (this._global ??= new Global({ client: this.client }));
3137
+ }
3138
+ _event;
3139
+ get event() {
3140
+ return (this._event ??= new Event({ client: this.client }));
3141
+ }
3142
+ _config;
3143
+ get config() {
3144
+ return (this._config ??= new Config2({ client: this.client }));
3145
+ }
3146
+ _experimental;
3147
+ get experimental() {
3148
+ return (this._experimental ??= new Experimental({ client: this.client }));
3149
+ }
3150
+ _tool;
3151
+ get tool() {
3152
+ return (this._tool ??= new Tool({ client: this.client }));
3153
+ }
3154
+ _worktree;
3155
+ get worktree() {
3156
+ return (this._worktree ??= new Worktree({ client: this.client }));
3157
+ }
3158
+ _find;
3159
+ get find() {
3160
+ return (this._find ??= new Find({ client: this.client }));
3161
+ }
3162
+ _file;
3163
+ get file() {
3164
+ return (this._file ??= new File({ client: this.client }));
3165
+ }
3166
+ _instance;
3167
+ get instance() {
3168
+ return (this._instance ??= new Instance({ client: this.client }));
3169
+ }
3170
+ _path;
3171
+ get path() {
3172
+ return (this._path ??= new Path({ client: this.client }));
3173
+ }
3174
+ _vcs;
3175
+ get vcs() {
3176
+ return (this._vcs ??= new Vcs({ client: this.client }));
3177
+ }
3178
+ _command;
3179
+ get command() {
3180
+ return (this._command ??= new Command({ client: this.client }));
3181
+ }
3182
+ _lsp;
3183
+ get lsp() {
3184
+ return (this._lsp ??= new Lsp({ client: this.client }));
3185
+ }
3186
+ _formatter;
3187
+ get formatter() {
3188
+ return (this._formatter ??= new Formatter({ client: this.client }));
3189
+ }
3190
+ _mcp;
3191
+ get mcp() {
3192
+ return (this._mcp ??= new Mcp({ client: this.client }));
3193
+ }
3194
+ _project;
3195
+ get project() {
3196
+ return (this._project ??= new Project({ client: this.client }));
3197
+ }
3198
+ _pty;
3199
+ get pty() {
3200
+ return (this._pty ??= new Pty({ client: this.client }));
3201
+ }
3202
+ _question;
3203
+ get question() {
3204
+ return (this._question ??= new Question({ client: this.client }));
3205
+ }
3206
+ _permission;
3207
+ get permission() {
3208
+ return (this._permission ??= new Permission({ client: this.client }));
3209
+ }
3210
+ _provider;
3211
+ get provider() {
3212
+ return (this._provider ??= new Provider({ client: this.client }));
3213
+ }
3214
+ _session;
3215
+ get session() {
3216
+ return (this._session ??= new Session2({ client: this.client }));
3217
+ }
3218
+ _part;
3219
+ get part() {
3220
+ return (this._part ??= new Part({ client: this.client }));
3221
+ }
3222
+ _sync;
3223
+ get sync() {
3224
+ return (this._sync ??= new Sync({ client: this.client }));
3225
+ }
3226
+ _v2;
3227
+ get v2() {
3228
+ return (this._v2 ??= new V2({ client: this.client }));
3229
+ }
3230
+ _tui;
3231
+ get tui() {
3232
+ return (this._tui ??= new Tui({ client: this.client }));
3233
+ }
3234
+ }