@wopal/ellamaka-sdk 2.0.5

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