@hopcoderx/sdk 1.0.1

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 (73) hide show
  1. package/dist/client.d.ts +7 -0
  2. package/dist/client.js +25 -0
  3. package/dist/gen/client/client.gen.d.ts +2 -0
  4. package/dist/gen/client/client.gen.js +165 -0
  5. package/dist/gen/client/index.d.ts +7 -0
  6. package/dist/gen/client/index.js +5 -0
  7. package/dist/gen/client/types.gen.d.ts +127 -0
  8. package/dist/gen/client/types.gen.js +2 -0
  9. package/dist/gen/client/utils.gen.d.ts +38 -0
  10. package/dist/gen/client/utils.gen.js +226 -0
  11. package/dist/gen/client.gen.d.ts +12 -0
  12. package/dist/gen/client.gen.js +5 -0
  13. package/dist/gen/core/auth.gen.d.ts +18 -0
  14. package/dist/gen/core/auth.gen.js +14 -0
  15. package/dist/gen/core/bodySerializer.gen.d.ts +17 -0
  16. package/dist/gen/core/bodySerializer.gen.js +57 -0
  17. package/dist/gen/core/params.gen.d.ts +33 -0
  18. package/dist/gen/core/params.gen.js +89 -0
  19. package/dist/gen/core/pathSerializer.gen.d.ts +33 -0
  20. package/dist/gen/core/pathSerializer.gen.js +106 -0
  21. package/dist/gen/core/queryKeySerializer.gen.d.ts +18 -0
  22. package/dist/gen/core/queryKeySerializer.gen.js +93 -0
  23. package/dist/gen/core/serverSentEvents.gen.d.ts +59 -0
  24. package/dist/gen/core/serverSentEvents.gen.js +117 -0
  25. package/dist/gen/core/types.gen.d.ts +78 -0
  26. package/dist/gen/core/types.gen.js +2 -0
  27. package/dist/gen/core/utils.gen.d.ts +14 -0
  28. package/dist/gen/core/utils.gen.js +69 -0
  29. package/dist/gen/sdk.gen.d.ts +403 -0
  30. package/dist/gen/sdk.gen.js +881 -0
  31. package/dist/gen/types.gen.d.ts +3380 -0
  32. package/dist/gen/types.gen.js +2 -0
  33. package/dist/index.d.ts +10 -0
  34. package/dist/index.js +16 -0
  35. package/dist/server.d.ts +23 -0
  36. package/dist/server.js +94 -0
  37. package/dist/v2/client.d.ts +7 -0
  38. package/dist/v2/client.js +27 -0
  39. package/dist/v2/gen/client/client.gen.d.ts +2 -0
  40. package/dist/v2/gen/client/client.gen.js +232 -0
  41. package/dist/v2/gen/client/index.d.ts +8 -0
  42. package/dist/v2/gen/client/index.js +6 -0
  43. package/dist/v2/gen/client/types.gen.d.ts +117 -0
  44. package/dist/v2/gen/client/types.gen.js +2 -0
  45. package/dist/v2/gen/client/utils.gen.d.ts +33 -0
  46. package/dist/v2/gen/client/utils.gen.js +226 -0
  47. package/dist/v2/gen/client.gen.d.ts +12 -0
  48. package/dist/v2/gen/client.gen.js +3 -0
  49. package/dist/v2/gen/core/auth.gen.d.ts +18 -0
  50. package/dist/v2/gen/core/auth.gen.js +14 -0
  51. package/dist/v2/gen/core/bodySerializer.gen.d.ts +25 -0
  52. package/dist/v2/gen/core/bodySerializer.gen.js +57 -0
  53. package/dist/v2/gen/core/params.gen.d.ts +43 -0
  54. package/dist/v2/gen/core/params.gen.js +102 -0
  55. package/dist/v2/gen/core/pathSerializer.gen.d.ts +33 -0
  56. package/dist/v2/gen/core/pathSerializer.gen.js +106 -0
  57. package/dist/v2/gen/core/queryKeySerializer.gen.d.ts +18 -0
  58. package/dist/v2/gen/core/queryKeySerializer.gen.js +93 -0
  59. package/dist/v2/gen/core/serverSentEvents.gen.d.ts +71 -0
  60. package/dist/v2/gen/core/serverSentEvents.gen.js +133 -0
  61. package/dist/v2/gen/core/types.gen.d.ts +78 -0
  62. package/dist/v2/gen/core/types.gen.js +2 -0
  63. package/dist/v2/gen/core/utils.gen.d.ts +19 -0
  64. package/dist/v2/gen/core/utils.gen.js +87 -0
  65. package/dist/v2/gen/sdk.gen.d.ts +1105 -0
  66. package/dist/v2/gen/sdk.gen.js +2148 -0
  67. package/dist/v2/gen/types.gen.d.ts +4382 -0
  68. package/dist/v2/gen/types.gen.js +2 -0
  69. package/dist/v2/index.d.ts +10 -0
  70. package/dist/v2/index.js +16 -0
  71. package/dist/v2/server.d.ts +23 -0
  72. package/dist/v2/server.js +94 -0
  73. package/package.json +73 -0
@@ -0,0 +1,2148 @@
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 HopCoderXClient()" 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 Config extends HeyApiClient {
25
+ /**
26
+ * Get global configuration
27
+ *
28
+ * Retrieve the current global HopCoderX configuration settings and preferences.
29
+ */
30
+ get(options) {
31
+ return (options?.client ?? this.client).get({
32
+ url: "/global/config",
33
+ ...options,
34
+ });
35
+ }
36
+ /**
37
+ * Update global configuration
38
+ *
39
+ * Update global HopCoderX configuration settings and preferences.
40
+ */
41
+ update(parameters, options) {
42
+ const params = buildClientParams([parameters], [{ args: [{ key: "config", map: "body" }] }]);
43
+ return (options?.client ?? this.client).patch({
44
+ url: "/global/config",
45
+ ...options,
46
+ ...params,
47
+ headers: {
48
+ "Content-Type": "application/json",
49
+ ...options?.headers,
50
+ ...params.headers,
51
+ },
52
+ });
53
+ }
54
+ }
55
+ export class Global extends HeyApiClient {
56
+ /**
57
+ * Get health
58
+ *
59
+ * Get health information about the HopCoderX server.
60
+ */
61
+ health(options) {
62
+ return (options?.client ?? this.client).get({
63
+ url: "/global/health",
64
+ ...options,
65
+ });
66
+ }
67
+ /**
68
+ * Get global events
69
+ *
70
+ * Subscribe to global events from the HopCoderX system using server-sent events.
71
+ */
72
+ event(options) {
73
+ return (options?.client ?? this.client).sse.get({
74
+ url: "/global/event",
75
+ ...options,
76
+ });
77
+ }
78
+ /**
79
+ * Dispose instance
80
+ *
81
+ * Clean up and dispose all HopCoderX instances, releasing all resources.
82
+ */
83
+ dispose(options) {
84
+ return (options?.client ?? this.client).post({
85
+ url: "/global/dispose",
86
+ ...options,
87
+ });
88
+ }
89
+ _config;
90
+ get config() {
91
+ return (this._config ??= new Config({ client: this.client }));
92
+ }
93
+ }
94
+ export class Auth extends HeyApiClient {
95
+ /**
96
+ * Remove auth credentials
97
+ *
98
+ * Remove authentication credentials
99
+ */
100
+ remove(parameters, options) {
101
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "providerID" }] }]);
102
+ return (options?.client ?? this.client).delete({
103
+ url: "/auth/{providerID}",
104
+ ...options,
105
+ ...params,
106
+ });
107
+ }
108
+ /**
109
+ * Set auth credentials
110
+ *
111
+ * Set authentication credentials
112
+ */
113
+ set(parameters, options) {
114
+ const params = buildClientParams([parameters], [
115
+ {
116
+ args: [
117
+ { in: "path", key: "providerID" },
118
+ { key: "auth", map: "body" },
119
+ ],
120
+ },
121
+ ]);
122
+ return (options?.client ?? this.client).put({
123
+ url: "/auth/{providerID}",
124
+ ...options,
125
+ ...params,
126
+ headers: {
127
+ "Content-Type": "application/json",
128
+ ...options?.headers,
129
+ ...params.headers,
130
+ },
131
+ });
132
+ }
133
+ }
134
+ export class Project extends HeyApiClient {
135
+ /**
136
+ * List all projects
137
+ *
138
+ * Get a list of projects that have been opened with HopCoderX.
139
+ */
140
+ list(parameters, options) {
141
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
142
+ return (options?.client ?? this.client).get({
143
+ url: "/project",
144
+ ...options,
145
+ ...params,
146
+ });
147
+ }
148
+ /**
149
+ * Get current project
150
+ *
151
+ * Retrieve the currently active project that HopCoderX is working with.
152
+ */
153
+ current(parameters, options) {
154
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
155
+ return (options?.client ?? this.client).get({
156
+ url: "/project/current",
157
+ ...options,
158
+ ...params,
159
+ });
160
+ }
161
+ /**
162
+ * Update project
163
+ *
164
+ * Update project properties such as name, icon, and commands.
165
+ */
166
+ update(parameters, options) {
167
+ const params = buildClientParams([parameters], [
168
+ {
169
+ args: [
170
+ { in: "path", key: "projectID" },
171
+ { in: "query", key: "directory" },
172
+ { in: "body", key: "name" },
173
+ { in: "body", key: "icon" },
174
+ { in: "body", key: "commands" },
175
+ ],
176
+ },
177
+ ]);
178
+ return (options?.client ?? this.client).patch({
179
+ url: "/project/{projectID}",
180
+ ...options,
181
+ ...params,
182
+ headers: {
183
+ "Content-Type": "application/json",
184
+ ...options?.headers,
185
+ ...params.headers,
186
+ },
187
+ });
188
+ }
189
+ }
190
+ export class Pty extends HeyApiClient {
191
+ /**
192
+ * List PTY sessions
193
+ *
194
+ * Get a list of all active pseudo-terminal (PTY) sessions managed by HopCoderX.
195
+ */
196
+ list(parameters, options) {
197
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
198
+ return (options?.client ?? this.client).get({
199
+ url: "/pty",
200
+ ...options,
201
+ ...params,
202
+ });
203
+ }
204
+ /**
205
+ * Create PTY session
206
+ *
207
+ * Create a new pseudo-terminal (PTY) session for running shell commands and processes.
208
+ */
209
+ create(parameters, options) {
210
+ const params = buildClientParams([parameters], [
211
+ {
212
+ args: [
213
+ { in: "query", key: "directory" },
214
+ { in: "body", key: "command" },
215
+ { in: "body", key: "args" },
216
+ { in: "body", key: "cwd" },
217
+ { in: "body", key: "title" },
218
+ { in: "body", key: "env" },
219
+ ],
220
+ },
221
+ ]);
222
+ return (options?.client ?? this.client).post({
223
+ url: "/pty",
224
+ ...options,
225
+ ...params,
226
+ headers: {
227
+ "Content-Type": "application/json",
228
+ ...options?.headers,
229
+ ...params.headers,
230
+ },
231
+ });
232
+ }
233
+ /**
234
+ * Remove PTY session
235
+ *
236
+ * Remove and terminate a specific pseudo-terminal (PTY) session.
237
+ */
238
+ remove(parameters, options) {
239
+ const params = buildClientParams([parameters], [
240
+ {
241
+ args: [
242
+ { in: "path", key: "ptyID" },
243
+ { in: "query", key: "directory" },
244
+ ],
245
+ },
246
+ ]);
247
+ return (options?.client ?? this.client).delete({
248
+ url: "/pty/{ptyID}",
249
+ ...options,
250
+ ...params,
251
+ });
252
+ }
253
+ /**
254
+ * Get PTY session
255
+ *
256
+ * Retrieve detailed information about a specific pseudo-terminal (PTY) session.
257
+ */
258
+ get(parameters, options) {
259
+ const params = buildClientParams([parameters], [
260
+ {
261
+ args: [
262
+ { in: "path", key: "ptyID" },
263
+ { in: "query", key: "directory" },
264
+ ],
265
+ },
266
+ ]);
267
+ return (options?.client ?? this.client).get({
268
+ url: "/pty/{ptyID}",
269
+ ...options,
270
+ ...params,
271
+ });
272
+ }
273
+ /**
274
+ * Update PTY session
275
+ *
276
+ * Update properties of an existing pseudo-terminal (PTY) session.
277
+ */
278
+ update(parameters, options) {
279
+ const params = buildClientParams([parameters], [
280
+ {
281
+ args: [
282
+ { in: "path", key: "ptyID" },
283
+ { in: "query", key: "directory" },
284
+ { in: "body", key: "title" },
285
+ { in: "body", key: "size" },
286
+ ],
287
+ },
288
+ ]);
289
+ return (options?.client ?? this.client).put({
290
+ url: "/pty/{ptyID}",
291
+ ...options,
292
+ ...params,
293
+ headers: {
294
+ "Content-Type": "application/json",
295
+ ...options?.headers,
296
+ ...params.headers,
297
+ },
298
+ });
299
+ }
300
+ /**
301
+ * Connect to PTY session
302
+ *
303
+ * Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.
304
+ */
305
+ connect(parameters, options) {
306
+ const params = buildClientParams([parameters], [
307
+ {
308
+ args: [
309
+ { in: "path", key: "ptyID" },
310
+ { in: "query", key: "directory" },
311
+ ],
312
+ },
313
+ ]);
314
+ return (options?.client ?? this.client).get({
315
+ url: "/pty/{ptyID}/connect",
316
+ ...options,
317
+ ...params,
318
+ });
319
+ }
320
+ }
321
+ export class Config2 extends HeyApiClient {
322
+ /**
323
+ * Get configuration
324
+ *
325
+ * Retrieve the current HopCoderX configuration settings and preferences.
326
+ */
327
+ get(parameters, options) {
328
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
329
+ return (options?.client ?? this.client).get({
330
+ url: "/config",
331
+ ...options,
332
+ ...params,
333
+ });
334
+ }
335
+ /**
336
+ * Update configuration
337
+ *
338
+ * Update HopCoderX configuration settings and preferences.
339
+ */
340
+ update(parameters, options) {
341
+ const params = buildClientParams([parameters], [
342
+ {
343
+ args: [
344
+ { in: "query", key: "directory" },
345
+ { key: "config", map: "body" },
346
+ ],
347
+ },
348
+ ]);
349
+ return (options?.client ?? this.client).patch({
350
+ url: "/config",
351
+ ...options,
352
+ ...params,
353
+ headers: {
354
+ "Content-Type": "application/json",
355
+ ...options?.headers,
356
+ ...params.headers,
357
+ },
358
+ });
359
+ }
360
+ /**
361
+ * List config providers
362
+ *
363
+ * Get a list of all configured AI providers and their default models.
364
+ */
365
+ providers(parameters, options) {
366
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
367
+ return (options?.client ?? this.client).get({
368
+ url: "/config/providers",
369
+ ...options,
370
+ ...params,
371
+ });
372
+ }
373
+ }
374
+ export class Tool extends HeyApiClient {
375
+ /**
376
+ * List tool IDs
377
+ *
378
+ * Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.
379
+ */
380
+ ids(parameters, options) {
381
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
382
+ return (options?.client ?? this.client).get({
383
+ url: "/experimental/tool/ids",
384
+ ...options,
385
+ ...params,
386
+ });
387
+ }
388
+ /**
389
+ * List tools
390
+ *
391
+ * Get a list of available tools with their JSON schema parameters for a specific provider and model combination.
392
+ */
393
+ list(parameters, options) {
394
+ const params = buildClientParams([parameters], [
395
+ {
396
+ args: [
397
+ { in: "query", key: "directory" },
398
+ { in: "query", key: "provider" },
399
+ { in: "query", key: "model" },
400
+ ],
401
+ },
402
+ ]);
403
+ return (options?.client ?? this.client).get({
404
+ url: "/experimental/tool",
405
+ ...options,
406
+ ...params,
407
+ });
408
+ }
409
+ }
410
+ export class Worktree extends HeyApiClient {
411
+ /**
412
+ * Remove worktree
413
+ *
414
+ * Remove a git worktree and delete its branch.
415
+ */
416
+ remove(parameters, options) {
417
+ const params = buildClientParams([parameters], [
418
+ {
419
+ args: [
420
+ { in: "query", key: "directory" },
421
+ { key: "worktreeRemoveInput", map: "body" },
422
+ ],
423
+ },
424
+ ]);
425
+ return (options?.client ?? this.client).delete({
426
+ url: "/experimental/worktree",
427
+ ...options,
428
+ ...params,
429
+ headers: {
430
+ "Content-Type": "application/json",
431
+ ...options?.headers,
432
+ ...params.headers,
433
+ },
434
+ });
435
+ }
436
+ /**
437
+ * List worktrees
438
+ *
439
+ * List all sandbox worktrees for the current project.
440
+ */
441
+ list(parameters, options) {
442
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
443
+ return (options?.client ?? this.client).get({
444
+ url: "/experimental/worktree",
445
+ ...options,
446
+ ...params,
447
+ });
448
+ }
449
+ /**
450
+ * Create worktree
451
+ *
452
+ * Create a new git worktree for the current project and run any configured startup scripts.
453
+ */
454
+ create(parameters, options) {
455
+ const params = buildClientParams([parameters], [
456
+ {
457
+ args: [
458
+ { in: "query", key: "directory" },
459
+ { key: "worktreeCreateInput", map: "body" },
460
+ ],
461
+ },
462
+ ]);
463
+ return (options?.client ?? this.client).post({
464
+ url: "/experimental/worktree",
465
+ ...options,
466
+ ...params,
467
+ headers: {
468
+ "Content-Type": "application/json",
469
+ ...options?.headers,
470
+ ...params.headers,
471
+ },
472
+ });
473
+ }
474
+ /**
475
+ * Reset worktree
476
+ *
477
+ * Reset a worktree branch to the primary default branch.
478
+ */
479
+ reset(parameters, options) {
480
+ const params = buildClientParams([parameters], [
481
+ {
482
+ args: [
483
+ { in: "query", key: "directory" },
484
+ { key: "worktreeResetInput", map: "body" },
485
+ ],
486
+ },
487
+ ]);
488
+ return (options?.client ?? this.client).post({
489
+ url: "/experimental/worktree/reset",
490
+ ...options,
491
+ ...params,
492
+ headers: {
493
+ "Content-Type": "application/json",
494
+ ...options?.headers,
495
+ ...params.headers,
496
+ },
497
+ });
498
+ }
499
+ }
500
+ export class Resource extends HeyApiClient {
501
+ /**
502
+ * Get MCP resources
503
+ *
504
+ * Get all available MCP resources from connected servers. Optionally filter by name.
505
+ */
506
+ list(parameters, options) {
507
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
508
+ return (options?.client ?? this.client).get({
509
+ url: "/experimental/resource",
510
+ ...options,
511
+ ...params,
512
+ });
513
+ }
514
+ }
515
+ export class Experimental extends HeyApiClient {
516
+ _resource;
517
+ get resource() {
518
+ return (this._resource ??= new Resource({ client: this.client }));
519
+ }
520
+ }
521
+ export class Session extends HeyApiClient {
522
+ /**
523
+ * List sessions
524
+ *
525
+ * Get a list of all HopCoderX sessions, sorted by most recently updated.
526
+ */
527
+ list(parameters, options) {
528
+ const params = buildClientParams([parameters], [
529
+ {
530
+ args: [
531
+ { in: "query", key: "directory" },
532
+ { in: "query", key: "roots" },
533
+ { in: "query", key: "start" },
534
+ { in: "query", key: "search" },
535
+ { in: "query", key: "limit" },
536
+ ],
537
+ },
538
+ ]);
539
+ return (options?.client ?? this.client).get({
540
+ url: "/session",
541
+ ...options,
542
+ ...params,
543
+ });
544
+ }
545
+ /**
546
+ * Create session
547
+ *
548
+ * Create a new HopCoderX session for interacting with AI assistants and managing conversations.
549
+ */
550
+ create(parameters, options) {
551
+ const params = buildClientParams([parameters], [
552
+ {
553
+ args: [
554
+ { in: "query", key: "directory" },
555
+ { in: "body", key: "parentID" },
556
+ { in: "body", key: "title" },
557
+ { in: "body", key: "permission" },
558
+ ],
559
+ },
560
+ ]);
561
+ return (options?.client ?? this.client).post({
562
+ url: "/session",
563
+ ...options,
564
+ ...params,
565
+ headers: {
566
+ "Content-Type": "application/json",
567
+ ...options?.headers,
568
+ ...params.headers,
569
+ },
570
+ });
571
+ }
572
+ /**
573
+ * Get session status
574
+ *
575
+ * Retrieve the current status of all sessions, including active, idle, and completed states.
576
+ */
577
+ status(parameters, options) {
578
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
579
+ return (options?.client ?? this.client).get({
580
+ url: "/session/status",
581
+ ...options,
582
+ ...params,
583
+ });
584
+ }
585
+ /**
586
+ * Delete session
587
+ *
588
+ * Delete a session and permanently remove all associated data, including messages and history.
589
+ */
590
+ delete(parameters, options) {
591
+ const params = buildClientParams([parameters], [
592
+ {
593
+ args: [
594
+ { in: "path", key: "sessionID" },
595
+ { in: "query", key: "directory" },
596
+ ],
597
+ },
598
+ ]);
599
+ return (options?.client ?? this.client).delete({
600
+ url: "/session/{sessionID}",
601
+ ...options,
602
+ ...params,
603
+ });
604
+ }
605
+ /**
606
+ * Get session
607
+ *
608
+ * Retrieve detailed information about a specific HopCoderX session.
609
+ */
610
+ get(parameters, options) {
611
+ const params = buildClientParams([parameters], [
612
+ {
613
+ args: [
614
+ { in: "path", key: "sessionID" },
615
+ { in: "query", key: "directory" },
616
+ ],
617
+ },
618
+ ]);
619
+ return (options?.client ?? this.client).get({
620
+ url: "/session/{sessionID}",
621
+ ...options,
622
+ ...params,
623
+ });
624
+ }
625
+ /**
626
+ * Update session
627
+ *
628
+ * Update properties of an existing session, such as title or other metadata.
629
+ */
630
+ update(parameters, options) {
631
+ const params = buildClientParams([parameters], [
632
+ {
633
+ args: [
634
+ { in: "path", key: "sessionID" },
635
+ { in: "query", key: "directory" },
636
+ { in: "body", key: "title" },
637
+ { in: "body", key: "time" },
638
+ ],
639
+ },
640
+ ]);
641
+ return (options?.client ?? this.client).patch({
642
+ url: "/session/{sessionID}",
643
+ ...options,
644
+ ...params,
645
+ headers: {
646
+ "Content-Type": "application/json",
647
+ ...options?.headers,
648
+ ...params.headers,
649
+ },
650
+ });
651
+ }
652
+ /**
653
+ * Get session children
654
+ *
655
+ * Retrieve all child sessions that were forked from the specified parent session.
656
+ */
657
+ children(parameters, options) {
658
+ const params = buildClientParams([parameters], [
659
+ {
660
+ args: [
661
+ { in: "path", key: "sessionID" },
662
+ { in: "query", key: "directory" },
663
+ ],
664
+ },
665
+ ]);
666
+ return (options?.client ?? this.client).get({
667
+ url: "/session/{sessionID}/children",
668
+ ...options,
669
+ ...params,
670
+ });
671
+ }
672
+ /**
673
+ * Get session todos
674
+ *
675
+ * Retrieve the todo list associated with a specific session, showing tasks and action items.
676
+ */
677
+ todo(parameters, options) {
678
+ const params = buildClientParams([parameters], [
679
+ {
680
+ args: [
681
+ { in: "path", key: "sessionID" },
682
+ { in: "query", key: "directory" },
683
+ ],
684
+ },
685
+ ]);
686
+ return (options?.client ?? this.client).get({
687
+ url: "/session/{sessionID}/todo",
688
+ ...options,
689
+ ...params,
690
+ });
691
+ }
692
+ /**
693
+ * Initialize session
694
+ *
695
+ * Analyze the current application and create an AGENTS.md file with project-specific agent configurations.
696
+ */
697
+ init(parameters, options) {
698
+ const params = buildClientParams([parameters], [
699
+ {
700
+ args: [
701
+ { in: "path", key: "sessionID" },
702
+ { in: "query", key: "directory" },
703
+ { in: "body", key: "modelID" },
704
+ { in: "body", key: "providerID" },
705
+ { in: "body", key: "messageID" },
706
+ ],
707
+ },
708
+ ]);
709
+ return (options?.client ?? this.client).post({
710
+ url: "/session/{sessionID}/init",
711
+ ...options,
712
+ ...params,
713
+ headers: {
714
+ "Content-Type": "application/json",
715
+ ...options?.headers,
716
+ ...params.headers,
717
+ },
718
+ });
719
+ }
720
+ /**
721
+ * Fork session
722
+ *
723
+ * Create a new session by forking an existing session at a specific message point.
724
+ */
725
+ fork(parameters, options) {
726
+ const params = buildClientParams([parameters], [
727
+ {
728
+ args: [
729
+ { in: "path", key: "sessionID" },
730
+ { in: "query", key: "directory" },
731
+ { in: "body", key: "messageID" },
732
+ ],
733
+ },
734
+ ]);
735
+ return (options?.client ?? this.client).post({
736
+ url: "/session/{sessionID}/fork",
737
+ ...options,
738
+ ...params,
739
+ headers: {
740
+ "Content-Type": "application/json",
741
+ ...options?.headers,
742
+ ...params.headers,
743
+ },
744
+ });
745
+ }
746
+ /**
747
+ * Abort session
748
+ *
749
+ * Abort an active session and stop any ongoing AI processing or command execution.
750
+ */
751
+ abort(parameters, options) {
752
+ const params = buildClientParams([parameters], [
753
+ {
754
+ args: [
755
+ { in: "path", key: "sessionID" },
756
+ { in: "query", key: "directory" },
757
+ ],
758
+ },
759
+ ]);
760
+ return (options?.client ?? this.client).post({
761
+ url: "/session/{sessionID}/abort",
762
+ ...options,
763
+ ...params,
764
+ });
765
+ }
766
+ /**
767
+ * Unshare session
768
+ *
769
+ * Remove the shareable link for a session, making it private again.
770
+ */
771
+ unshare(parameters, options) {
772
+ const params = buildClientParams([parameters], [
773
+ {
774
+ args: [
775
+ { in: "path", key: "sessionID" },
776
+ { in: "query", key: "directory" },
777
+ ],
778
+ },
779
+ ]);
780
+ return (options?.client ?? this.client).delete({
781
+ url: "/session/{sessionID}/share",
782
+ ...options,
783
+ ...params,
784
+ });
785
+ }
786
+ /**
787
+ * Share session
788
+ *
789
+ * Create a shareable link for a session, allowing others to view the conversation.
790
+ */
791
+ share(parameters, options) {
792
+ const params = buildClientParams([parameters], [
793
+ {
794
+ args: [
795
+ { in: "path", key: "sessionID" },
796
+ { in: "query", key: "directory" },
797
+ ],
798
+ },
799
+ ]);
800
+ return (options?.client ?? this.client).post({
801
+ url: "/session/{sessionID}/share",
802
+ ...options,
803
+ ...params,
804
+ });
805
+ }
806
+ /**
807
+ * Get message diff
808
+ *
809
+ * Get the file changes (diff) that resulted from a specific user message in the session.
810
+ */
811
+ diff(parameters, options) {
812
+ const params = buildClientParams([parameters], [
813
+ {
814
+ args: [
815
+ { in: "path", key: "sessionID" },
816
+ { in: "query", key: "directory" },
817
+ { in: "query", key: "messageID" },
818
+ ],
819
+ },
820
+ ]);
821
+ return (options?.client ?? this.client).get({
822
+ url: "/session/{sessionID}/diff",
823
+ ...options,
824
+ ...params,
825
+ });
826
+ }
827
+ /**
828
+ * Summarize session
829
+ *
830
+ * Generate a concise summary of the session using AI compaction to preserve key information.
831
+ */
832
+ summarize(parameters, options) {
833
+ const params = buildClientParams([parameters], [
834
+ {
835
+ args: [
836
+ { in: "path", key: "sessionID" },
837
+ { in: "query", key: "directory" },
838
+ { in: "body", key: "providerID" },
839
+ { in: "body", key: "modelID" },
840
+ { in: "body", key: "auto" },
841
+ ],
842
+ },
843
+ ]);
844
+ return (options?.client ?? this.client).post({
845
+ url: "/session/{sessionID}/summarize",
846
+ ...options,
847
+ ...params,
848
+ headers: {
849
+ "Content-Type": "application/json",
850
+ ...options?.headers,
851
+ ...params.headers,
852
+ },
853
+ });
854
+ }
855
+ /**
856
+ * Get session messages
857
+ *
858
+ * Retrieve all messages in a session, including user prompts and AI responses.
859
+ */
860
+ messages(parameters, options) {
861
+ const params = buildClientParams([parameters], [
862
+ {
863
+ args: [
864
+ { in: "path", key: "sessionID" },
865
+ { in: "query", key: "directory" },
866
+ { in: "query", key: "limit" },
867
+ ],
868
+ },
869
+ ]);
870
+ return (options?.client ?? this.client).get({
871
+ url: "/session/{sessionID}/message",
872
+ ...options,
873
+ ...params,
874
+ });
875
+ }
876
+ /**
877
+ * Send message
878
+ *
879
+ * Create and send a new message to a session, streaming the AI response.
880
+ */
881
+ prompt(parameters, options) {
882
+ const params = buildClientParams([parameters], [
883
+ {
884
+ args: [
885
+ { in: "path", key: "sessionID" },
886
+ { in: "query", key: "directory" },
887
+ { in: "body", key: "messageID" },
888
+ { in: "body", key: "model" },
889
+ { in: "body", key: "agent" },
890
+ { in: "body", key: "noReply" },
891
+ { in: "body", key: "tools" },
892
+ { in: "body", key: "format" },
893
+ { in: "body", key: "system" },
894
+ { in: "body", key: "variant" },
895
+ { in: "body", key: "parts" },
896
+ ],
897
+ },
898
+ ]);
899
+ return (options?.client ?? this.client).post({
900
+ url: "/session/{sessionID}/message",
901
+ ...options,
902
+ ...params,
903
+ headers: {
904
+ "Content-Type": "application/json",
905
+ ...options?.headers,
906
+ ...params.headers,
907
+ },
908
+ });
909
+ }
910
+ /**
911
+ * Get message
912
+ *
913
+ * Retrieve a specific message from a session by its message ID.
914
+ */
915
+ message(parameters, options) {
916
+ const params = buildClientParams([parameters], [
917
+ {
918
+ args: [
919
+ { in: "path", key: "sessionID" },
920
+ { in: "path", key: "messageID" },
921
+ { in: "query", key: "directory" },
922
+ ],
923
+ },
924
+ ]);
925
+ return (options?.client ?? this.client).get({
926
+ url: "/session/{sessionID}/message/{messageID}",
927
+ ...options,
928
+ ...params,
929
+ });
930
+ }
931
+ /**
932
+ * Send async message
933
+ *
934
+ * Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.
935
+ */
936
+ promptAsync(parameters, options) {
937
+ const params = buildClientParams([parameters], [
938
+ {
939
+ args: [
940
+ { in: "path", key: "sessionID" },
941
+ { in: "query", key: "directory" },
942
+ { in: "body", key: "messageID" },
943
+ { in: "body", key: "model" },
944
+ { in: "body", key: "agent" },
945
+ { in: "body", key: "noReply" },
946
+ { in: "body", key: "tools" },
947
+ { in: "body", key: "format" },
948
+ { in: "body", key: "system" },
949
+ { in: "body", key: "variant" },
950
+ { in: "body", key: "parts" },
951
+ ],
952
+ },
953
+ ]);
954
+ return (options?.client ?? this.client).post({
955
+ url: "/session/{sessionID}/prompt_async",
956
+ ...options,
957
+ ...params,
958
+ headers: {
959
+ "Content-Type": "application/json",
960
+ ...options?.headers,
961
+ ...params.headers,
962
+ },
963
+ });
964
+ }
965
+ /**
966
+ * Send command
967
+ *
968
+ * Send a new command to a session for execution by the AI assistant.
969
+ */
970
+ command(parameters, options) {
971
+ const params = buildClientParams([parameters], [
972
+ {
973
+ args: [
974
+ { in: "path", key: "sessionID" },
975
+ { in: "query", key: "directory" },
976
+ { in: "body", key: "messageID" },
977
+ { in: "body", key: "agent" },
978
+ { in: "body", key: "model" },
979
+ { in: "body", key: "arguments" },
980
+ { in: "body", key: "command" },
981
+ { in: "body", key: "variant" },
982
+ { in: "body", key: "parts" },
983
+ ],
984
+ },
985
+ ]);
986
+ return (options?.client ?? this.client).post({
987
+ url: "/session/{sessionID}/command",
988
+ ...options,
989
+ ...params,
990
+ headers: {
991
+ "Content-Type": "application/json",
992
+ ...options?.headers,
993
+ ...params.headers,
994
+ },
995
+ });
996
+ }
997
+ /**
998
+ * Run shell command
999
+ *
1000
+ * Execute a shell command within the session context and return the AI's response.
1001
+ */
1002
+ shell(parameters, options) {
1003
+ const params = buildClientParams([parameters], [
1004
+ {
1005
+ args: [
1006
+ { in: "path", key: "sessionID" },
1007
+ { in: "query", key: "directory" },
1008
+ { in: "body", key: "agent" },
1009
+ { in: "body", key: "model" },
1010
+ { in: "body", key: "command" },
1011
+ ],
1012
+ },
1013
+ ]);
1014
+ return (options?.client ?? this.client).post({
1015
+ url: "/session/{sessionID}/shell",
1016
+ ...options,
1017
+ ...params,
1018
+ headers: {
1019
+ "Content-Type": "application/json",
1020
+ ...options?.headers,
1021
+ ...params.headers,
1022
+ },
1023
+ });
1024
+ }
1025
+ /**
1026
+ * Revert message
1027
+ *
1028
+ * Revert a specific message in a session, undoing its effects and restoring the previous state.
1029
+ */
1030
+ revert(parameters, options) {
1031
+ const params = buildClientParams([parameters], [
1032
+ {
1033
+ args: [
1034
+ { in: "path", key: "sessionID" },
1035
+ { in: "query", key: "directory" },
1036
+ { in: "body", key: "messageID" },
1037
+ { in: "body", key: "partID" },
1038
+ ],
1039
+ },
1040
+ ]);
1041
+ return (options?.client ?? this.client).post({
1042
+ url: "/session/{sessionID}/revert",
1043
+ ...options,
1044
+ ...params,
1045
+ headers: {
1046
+ "Content-Type": "application/json",
1047
+ ...options?.headers,
1048
+ ...params.headers,
1049
+ },
1050
+ });
1051
+ }
1052
+ /**
1053
+ * Restore reverted messages
1054
+ *
1055
+ * Restore all previously reverted messages in a session.
1056
+ */
1057
+ unrevert(parameters, options) {
1058
+ const params = buildClientParams([parameters], [
1059
+ {
1060
+ args: [
1061
+ { in: "path", key: "sessionID" },
1062
+ { in: "query", key: "directory" },
1063
+ ],
1064
+ },
1065
+ ]);
1066
+ return (options?.client ?? this.client).post({
1067
+ url: "/session/{sessionID}/unrevert",
1068
+ ...options,
1069
+ ...params,
1070
+ });
1071
+ }
1072
+ }
1073
+ export class Part extends HeyApiClient {
1074
+ /**
1075
+ * Delete a part from a message
1076
+ */
1077
+ delete(parameters, options) {
1078
+ const params = buildClientParams([parameters], [
1079
+ {
1080
+ args: [
1081
+ { in: "path", key: "sessionID" },
1082
+ { in: "path", key: "messageID" },
1083
+ { in: "path", key: "partID" },
1084
+ { in: "query", key: "directory" },
1085
+ ],
1086
+ },
1087
+ ]);
1088
+ return (options?.client ?? this.client).delete({
1089
+ url: "/session/{sessionID}/message/{messageID}/part/{partID}",
1090
+ ...options,
1091
+ ...params,
1092
+ });
1093
+ }
1094
+ /**
1095
+ * Update a part in a message
1096
+ */
1097
+ update(parameters, options) {
1098
+ const params = buildClientParams([parameters], [
1099
+ {
1100
+ args: [
1101
+ { in: "path", key: "sessionID" },
1102
+ { in: "path", key: "messageID" },
1103
+ { in: "path", key: "partID" },
1104
+ { in: "query", key: "directory" },
1105
+ { key: "part", map: "body" },
1106
+ ],
1107
+ },
1108
+ ]);
1109
+ return (options?.client ?? this.client).patch({
1110
+ url: "/session/{sessionID}/message/{messageID}/part/{partID}",
1111
+ ...options,
1112
+ ...params,
1113
+ headers: {
1114
+ "Content-Type": "application/json",
1115
+ ...options?.headers,
1116
+ ...params.headers,
1117
+ },
1118
+ });
1119
+ }
1120
+ }
1121
+ export class Permission extends HeyApiClient {
1122
+ /**
1123
+ * Respond to permission
1124
+ *
1125
+ * Approve or deny a permission request from the AI assistant.
1126
+ *
1127
+ * @deprecated
1128
+ */
1129
+ respond(parameters, options) {
1130
+ const params = buildClientParams([parameters], [
1131
+ {
1132
+ args: [
1133
+ { in: "path", key: "sessionID" },
1134
+ { in: "path", key: "permissionID" },
1135
+ { in: "query", key: "directory" },
1136
+ { in: "body", key: "response" },
1137
+ ],
1138
+ },
1139
+ ]);
1140
+ return (options?.client ?? this.client).post({
1141
+ url: "/session/{sessionID}/permissions/{permissionID}",
1142
+ ...options,
1143
+ ...params,
1144
+ headers: {
1145
+ "Content-Type": "application/json",
1146
+ ...options?.headers,
1147
+ ...params.headers,
1148
+ },
1149
+ });
1150
+ }
1151
+ /**
1152
+ * Respond to permission request
1153
+ *
1154
+ * Approve or deny a permission request from the AI assistant.
1155
+ */
1156
+ reply(parameters, options) {
1157
+ const params = buildClientParams([parameters], [
1158
+ {
1159
+ args: [
1160
+ { in: "path", key: "requestID" },
1161
+ { in: "query", key: "directory" },
1162
+ { in: "body", key: "reply" },
1163
+ { in: "body", key: "message" },
1164
+ ],
1165
+ },
1166
+ ]);
1167
+ return (options?.client ?? this.client).post({
1168
+ url: "/permission/{requestID}/reply",
1169
+ ...options,
1170
+ ...params,
1171
+ headers: {
1172
+ "Content-Type": "application/json",
1173
+ ...options?.headers,
1174
+ ...params.headers,
1175
+ },
1176
+ });
1177
+ }
1178
+ /**
1179
+ * List pending permissions
1180
+ *
1181
+ * Get all pending permission requests across all sessions.
1182
+ */
1183
+ list(parameters, options) {
1184
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1185
+ return (options?.client ?? this.client).get({
1186
+ url: "/permission",
1187
+ ...options,
1188
+ ...params,
1189
+ });
1190
+ }
1191
+ }
1192
+ export class Question extends HeyApiClient {
1193
+ /**
1194
+ * List pending questions
1195
+ *
1196
+ * Get all pending question requests across all sessions.
1197
+ */
1198
+ list(parameters, options) {
1199
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1200
+ return (options?.client ?? this.client).get({
1201
+ url: "/question",
1202
+ ...options,
1203
+ ...params,
1204
+ });
1205
+ }
1206
+ /**
1207
+ * Reply to question request
1208
+ *
1209
+ * Provide answers to a question request from the AI assistant.
1210
+ */
1211
+ reply(parameters, options) {
1212
+ const params = buildClientParams([parameters], [
1213
+ {
1214
+ args: [
1215
+ { in: "path", key: "requestID" },
1216
+ { in: "query", key: "directory" },
1217
+ { in: "body", key: "answers" },
1218
+ ],
1219
+ },
1220
+ ]);
1221
+ return (options?.client ?? this.client).post({
1222
+ url: "/question/{requestID}/reply",
1223
+ ...options,
1224
+ ...params,
1225
+ headers: {
1226
+ "Content-Type": "application/json",
1227
+ ...options?.headers,
1228
+ ...params.headers,
1229
+ },
1230
+ });
1231
+ }
1232
+ /**
1233
+ * Reject question request
1234
+ *
1235
+ * Reject a question request from the AI assistant.
1236
+ */
1237
+ reject(parameters, options) {
1238
+ const params = buildClientParams([parameters], [
1239
+ {
1240
+ args: [
1241
+ { in: "path", key: "requestID" },
1242
+ { in: "query", key: "directory" },
1243
+ ],
1244
+ },
1245
+ ]);
1246
+ return (options?.client ?? this.client).post({
1247
+ url: "/question/{requestID}/reject",
1248
+ ...options,
1249
+ ...params,
1250
+ });
1251
+ }
1252
+ }
1253
+ export class Oauth extends HeyApiClient {
1254
+ /**
1255
+ * OAuth authorize
1256
+ *
1257
+ * Initiate OAuth authorization for a specific AI provider to get an authorization URL.
1258
+ */
1259
+ authorize(parameters, options) {
1260
+ const params = buildClientParams([parameters], [
1261
+ {
1262
+ args: [
1263
+ { in: "path", key: "providerID" },
1264
+ { in: "query", key: "directory" },
1265
+ { in: "body", key: "method" },
1266
+ ],
1267
+ },
1268
+ ]);
1269
+ return (options?.client ?? this.client).post({
1270
+ url: "/provider/{providerID}/oauth/authorize",
1271
+ ...options,
1272
+ ...params,
1273
+ headers: {
1274
+ "Content-Type": "application/json",
1275
+ ...options?.headers,
1276
+ ...params.headers,
1277
+ },
1278
+ });
1279
+ }
1280
+ /**
1281
+ * OAuth callback
1282
+ *
1283
+ * Handle the OAuth callback from a provider after user authorization.
1284
+ */
1285
+ callback(parameters, options) {
1286
+ const params = buildClientParams([parameters], [
1287
+ {
1288
+ args: [
1289
+ { in: "path", key: "providerID" },
1290
+ { in: "query", key: "directory" },
1291
+ { in: "body", key: "method" },
1292
+ { in: "body", key: "code" },
1293
+ ],
1294
+ },
1295
+ ]);
1296
+ return (options?.client ?? this.client).post({
1297
+ url: "/provider/{providerID}/oauth/callback",
1298
+ ...options,
1299
+ ...params,
1300
+ headers: {
1301
+ "Content-Type": "application/json",
1302
+ ...options?.headers,
1303
+ ...params.headers,
1304
+ },
1305
+ });
1306
+ }
1307
+ }
1308
+ export class Provider extends HeyApiClient {
1309
+ /**
1310
+ * List providers
1311
+ *
1312
+ * Get a list of all available AI providers, including both available and connected ones.
1313
+ */
1314
+ list(parameters, options) {
1315
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1316
+ return (options?.client ?? this.client).get({
1317
+ url: "/provider",
1318
+ ...options,
1319
+ ...params,
1320
+ });
1321
+ }
1322
+ /**
1323
+ * Get provider auth methods
1324
+ *
1325
+ * Retrieve available authentication methods for all AI providers.
1326
+ */
1327
+ auth(parameters, options) {
1328
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1329
+ return (options?.client ?? this.client).get({
1330
+ url: "/provider/auth",
1331
+ ...options,
1332
+ ...params,
1333
+ });
1334
+ }
1335
+ _oauth;
1336
+ get oauth() {
1337
+ return (this._oauth ??= new Oauth({ client: this.client }));
1338
+ }
1339
+ }
1340
+ export class Find extends HeyApiClient {
1341
+ /**
1342
+ * Find text
1343
+ *
1344
+ * Search for text patterns across files in the project using ripgrep.
1345
+ */
1346
+ text(parameters, options) {
1347
+ const params = buildClientParams([parameters], [
1348
+ {
1349
+ args: [
1350
+ { in: "query", key: "directory" },
1351
+ { in: "query", key: "pattern" },
1352
+ ],
1353
+ },
1354
+ ]);
1355
+ return (options?.client ?? this.client).get({
1356
+ url: "/find",
1357
+ ...options,
1358
+ ...params,
1359
+ });
1360
+ }
1361
+ /**
1362
+ * Find files
1363
+ *
1364
+ * Search for files or directories by name or pattern in the project directory.
1365
+ */
1366
+ files(parameters, options) {
1367
+ const params = buildClientParams([parameters], [
1368
+ {
1369
+ args: [
1370
+ { in: "query", key: "directory" },
1371
+ { in: "query", key: "query" },
1372
+ { in: "query", key: "dirs" },
1373
+ { in: "query", key: "type" },
1374
+ { in: "query", key: "limit" },
1375
+ ],
1376
+ },
1377
+ ]);
1378
+ return (options?.client ?? this.client).get({
1379
+ url: "/find/file",
1380
+ ...options,
1381
+ ...params,
1382
+ });
1383
+ }
1384
+ /**
1385
+ * Find symbols
1386
+ *
1387
+ * Search for workspace symbols like functions, classes, and variables using LSP.
1388
+ */
1389
+ symbols(parameters, options) {
1390
+ const params = buildClientParams([parameters], [
1391
+ {
1392
+ args: [
1393
+ { in: "query", key: "directory" },
1394
+ { in: "query", key: "query" },
1395
+ ],
1396
+ },
1397
+ ]);
1398
+ return (options?.client ?? this.client).get({
1399
+ url: "/find/symbol",
1400
+ ...options,
1401
+ ...params,
1402
+ });
1403
+ }
1404
+ }
1405
+ export class File extends HeyApiClient {
1406
+ /**
1407
+ * List files
1408
+ *
1409
+ * List files and directories in a specified path.
1410
+ */
1411
+ list(parameters, options) {
1412
+ const params = buildClientParams([parameters], [
1413
+ {
1414
+ args: [
1415
+ { in: "query", key: "directory" },
1416
+ { in: "query", key: "path" },
1417
+ ],
1418
+ },
1419
+ ]);
1420
+ return (options?.client ?? this.client).get({
1421
+ url: "/file",
1422
+ ...options,
1423
+ ...params,
1424
+ });
1425
+ }
1426
+ /**
1427
+ * Read file
1428
+ *
1429
+ * Read the content of a specified file.
1430
+ */
1431
+ read(parameters, options) {
1432
+ const params = buildClientParams([parameters], [
1433
+ {
1434
+ args: [
1435
+ { in: "query", key: "directory" },
1436
+ { in: "query", key: "path" },
1437
+ ],
1438
+ },
1439
+ ]);
1440
+ return (options?.client ?? this.client).get({
1441
+ url: "/file/content",
1442
+ ...options,
1443
+ ...params,
1444
+ });
1445
+ }
1446
+ /**
1447
+ * Get file status
1448
+ *
1449
+ * Get the git status of all files in the project.
1450
+ */
1451
+ status(parameters, options) {
1452
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1453
+ return (options?.client ?? this.client).get({
1454
+ url: "/file/status",
1455
+ ...options,
1456
+ ...params,
1457
+ });
1458
+ }
1459
+ }
1460
+ export class Auth2 extends HeyApiClient {
1461
+ /**
1462
+ * Remove MCP OAuth
1463
+ *
1464
+ * Remove OAuth credentials for an MCP server
1465
+ */
1466
+ remove(parameters, options) {
1467
+ const params = buildClientParams([parameters], [
1468
+ {
1469
+ args: [
1470
+ { in: "path", key: "name" },
1471
+ { in: "query", key: "directory" },
1472
+ ],
1473
+ },
1474
+ ]);
1475
+ return (options?.client ?? this.client).delete({
1476
+ url: "/mcp/{name}/auth",
1477
+ ...options,
1478
+ ...params,
1479
+ });
1480
+ }
1481
+ /**
1482
+ * Start MCP OAuth
1483
+ *
1484
+ * Start OAuth authentication flow for a Model Context Protocol (MCP) server.
1485
+ */
1486
+ start(parameters, options) {
1487
+ const params = buildClientParams([parameters], [
1488
+ {
1489
+ args: [
1490
+ { in: "path", key: "name" },
1491
+ { in: "query", key: "directory" },
1492
+ ],
1493
+ },
1494
+ ]);
1495
+ return (options?.client ?? this.client).post({
1496
+ url: "/mcp/{name}/auth",
1497
+ ...options,
1498
+ ...params,
1499
+ });
1500
+ }
1501
+ /**
1502
+ * Complete MCP OAuth
1503
+ *
1504
+ * Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.
1505
+ */
1506
+ callback(parameters, options) {
1507
+ const params = buildClientParams([parameters], [
1508
+ {
1509
+ args: [
1510
+ { in: "path", key: "name" },
1511
+ { in: "query", key: "directory" },
1512
+ { in: "body", key: "code" },
1513
+ ],
1514
+ },
1515
+ ]);
1516
+ return (options?.client ?? this.client).post({
1517
+ url: "/mcp/{name}/auth/callback",
1518
+ ...options,
1519
+ ...params,
1520
+ headers: {
1521
+ "Content-Type": "application/json",
1522
+ ...options?.headers,
1523
+ ...params.headers,
1524
+ },
1525
+ });
1526
+ }
1527
+ /**
1528
+ * Authenticate MCP OAuth
1529
+ *
1530
+ * Start OAuth flow and wait for callback (opens browser)
1531
+ */
1532
+ authenticate(parameters, options) {
1533
+ const params = buildClientParams([parameters], [
1534
+ {
1535
+ args: [
1536
+ { in: "path", key: "name" },
1537
+ { in: "query", key: "directory" },
1538
+ ],
1539
+ },
1540
+ ]);
1541
+ return (options?.client ?? this.client).post({
1542
+ url: "/mcp/{name}/auth/authenticate",
1543
+ ...options,
1544
+ ...params,
1545
+ });
1546
+ }
1547
+ }
1548
+ export class Mcp extends HeyApiClient {
1549
+ /**
1550
+ * Get MCP status
1551
+ *
1552
+ * Get the status of all Model Context Protocol (MCP) servers.
1553
+ */
1554
+ status(parameters, options) {
1555
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1556
+ return (options?.client ?? this.client).get({
1557
+ url: "/mcp",
1558
+ ...options,
1559
+ ...params,
1560
+ });
1561
+ }
1562
+ /**
1563
+ * Add MCP server
1564
+ *
1565
+ * Dynamically add a new Model Context Protocol (MCP) server to the system.
1566
+ */
1567
+ add(parameters, options) {
1568
+ const params = buildClientParams([parameters], [
1569
+ {
1570
+ args: [
1571
+ { in: "query", key: "directory" },
1572
+ { in: "body", key: "name" },
1573
+ { in: "body", key: "config" },
1574
+ ],
1575
+ },
1576
+ ]);
1577
+ return (options?.client ?? this.client).post({
1578
+ url: "/mcp",
1579
+ ...options,
1580
+ ...params,
1581
+ headers: {
1582
+ "Content-Type": "application/json",
1583
+ ...options?.headers,
1584
+ ...params.headers,
1585
+ },
1586
+ });
1587
+ }
1588
+ /**
1589
+ * Connect an MCP server
1590
+ */
1591
+ connect(parameters, options) {
1592
+ const params = buildClientParams([parameters], [
1593
+ {
1594
+ args: [
1595
+ { in: "path", key: "name" },
1596
+ { in: "query", key: "directory" },
1597
+ ],
1598
+ },
1599
+ ]);
1600
+ return (options?.client ?? this.client).post({
1601
+ url: "/mcp/{name}/connect",
1602
+ ...options,
1603
+ ...params,
1604
+ });
1605
+ }
1606
+ /**
1607
+ * Disconnect an MCP server
1608
+ */
1609
+ disconnect(parameters, options) {
1610
+ const params = buildClientParams([parameters], [
1611
+ {
1612
+ args: [
1613
+ { in: "path", key: "name" },
1614
+ { in: "query", key: "directory" },
1615
+ ],
1616
+ },
1617
+ ]);
1618
+ return (options?.client ?? this.client).post({
1619
+ url: "/mcp/{name}/disconnect",
1620
+ ...options,
1621
+ ...params,
1622
+ });
1623
+ }
1624
+ _auth;
1625
+ get auth() {
1626
+ return (this._auth ??= new Auth2({ client: this.client }));
1627
+ }
1628
+ }
1629
+ export class Control extends HeyApiClient {
1630
+ /**
1631
+ * Get next TUI request
1632
+ *
1633
+ * Retrieve the next TUI (Terminal User Interface) request from the queue for processing.
1634
+ */
1635
+ next(parameters, options) {
1636
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1637
+ return (options?.client ?? this.client).get({
1638
+ url: "/tui/control/next",
1639
+ ...options,
1640
+ ...params,
1641
+ });
1642
+ }
1643
+ /**
1644
+ * Submit TUI response
1645
+ *
1646
+ * Submit a response to the TUI request queue to complete a pending request.
1647
+ */
1648
+ response(parameters, options) {
1649
+ const params = buildClientParams([parameters], [
1650
+ {
1651
+ args: [
1652
+ { in: "query", key: "directory" },
1653
+ { key: "body", map: "body" },
1654
+ ],
1655
+ },
1656
+ ]);
1657
+ return (options?.client ?? this.client).post({
1658
+ url: "/tui/control/response",
1659
+ ...options,
1660
+ ...params,
1661
+ headers: {
1662
+ "Content-Type": "application/json",
1663
+ ...options?.headers,
1664
+ ...params.headers,
1665
+ },
1666
+ });
1667
+ }
1668
+ }
1669
+ export class Tui extends HeyApiClient {
1670
+ /**
1671
+ * Append TUI prompt
1672
+ *
1673
+ * Append prompt to the TUI
1674
+ */
1675
+ appendPrompt(parameters, options) {
1676
+ const params = buildClientParams([parameters], [
1677
+ {
1678
+ args: [
1679
+ { in: "query", key: "directory" },
1680
+ { in: "body", key: "text" },
1681
+ ],
1682
+ },
1683
+ ]);
1684
+ return (options?.client ?? this.client).post({
1685
+ url: "/tui/append-prompt",
1686
+ ...options,
1687
+ ...params,
1688
+ headers: {
1689
+ "Content-Type": "application/json",
1690
+ ...options?.headers,
1691
+ ...params.headers,
1692
+ },
1693
+ });
1694
+ }
1695
+ /**
1696
+ * Open help dialog
1697
+ *
1698
+ * Open the help dialog in the TUI to display user assistance information.
1699
+ */
1700
+ openHelp(parameters, options) {
1701
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1702
+ return (options?.client ?? this.client).post({
1703
+ url: "/tui/open-help",
1704
+ ...options,
1705
+ ...params,
1706
+ });
1707
+ }
1708
+ /**
1709
+ * Open sessions dialog
1710
+ *
1711
+ * Open the session dialog
1712
+ */
1713
+ openSessions(parameters, options) {
1714
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1715
+ return (options?.client ?? this.client).post({
1716
+ url: "/tui/open-sessions",
1717
+ ...options,
1718
+ ...params,
1719
+ });
1720
+ }
1721
+ /**
1722
+ * Open themes dialog
1723
+ *
1724
+ * Open the theme dialog
1725
+ */
1726
+ openThemes(parameters, options) {
1727
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1728
+ return (options?.client ?? this.client).post({
1729
+ url: "/tui/open-themes",
1730
+ ...options,
1731
+ ...params,
1732
+ });
1733
+ }
1734
+ /**
1735
+ * Open models dialog
1736
+ *
1737
+ * Open the model dialog
1738
+ */
1739
+ openModels(parameters, options) {
1740
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1741
+ return (options?.client ?? this.client).post({
1742
+ url: "/tui/open-models",
1743
+ ...options,
1744
+ ...params,
1745
+ });
1746
+ }
1747
+ /**
1748
+ * Submit TUI prompt
1749
+ *
1750
+ * Submit the prompt
1751
+ */
1752
+ submitPrompt(parameters, options) {
1753
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1754
+ return (options?.client ?? this.client).post({
1755
+ url: "/tui/submit-prompt",
1756
+ ...options,
1757
+ ...params,
1758
+ });
1759
+ }
1760
+ /**
1761
+ * Clear TUI prompt
1762
+ *
1763
+ * Clear the prompt
1764
+ */
1765
+ clearPrompt(parameters, options) {
1766
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1767
+ return (options?.client ?? this.client).post({
1768
+ url: "/tui/clear-prompt",
1769
+ ...options,
1770
+ ...params,
1771
+ });
1772
+ }
1773
+ /**
1774
+ * Execute TUI command
1775
+ *
1776
+ * Execute a TUI command (e.g. agent_cycle)
1777
+ */
1778
+ executeCommand(parameters, options) {
1779
+ const params = buildClientParams([parameters], [
1780
+ {
1781
+ args: [
1782
+ { in: "query", key: "directory" },
1783
+ { in: "body", key: "command" },
1784
+ ],
1785
+ },
1786
+ ]);
1787
+ return (options?.client ?? this.client).post({
1788
+ url: "/tui/execute-command",
1789
+ ...options,
1790
+ ...params,
1791
+ headers: {
1792
+ "Content-Type": "application/json",
1793
+ ...options?.headers,
1794
+ ...params.headers,
1795
+ },
1796
+ });
1797
+ }
1798
+ /**
1799
+ * Show TUI toast
1800
+ *
1801
+ * Show a toast notification in the TUI
1802
+ */
1803
+ showToast(parameters, options) {
1804
+ const params = buildClientParams([parameters], [
1805
+ {
1806
+ args: [
1807
+ { in: "query", key: "directory" },
1808
+ { in: "body", key: "title" },
1809
+ { in: "body", key: "message" },
1810
+ { in: "body", key: "variant" },
1811
+ { in: "body", key: "duration" },
1812
+ ],
1813
+ },
1814
+ ]);
1815
+ return (options?.client ?? this.client).post({
1816
+ url: "/tui/show-toast",
1817
+ ...options,
1818
+ ...params,
1819
+ headers: {
1820
+ "Content-Type": "application/json",
1821
+ ...options?.headers,
1822
+ ...params.headers,
1823
+ },
1824
+ });
1825
+ }
1826
+ /**
1827
+ * Publish TUI event
1828
+ *
1829
+ * Publish a TUI event
1830
+ */
1831
+ publish(parameters, options) {
1832
+ const params = buildClientParams([parameters], [
1833
+ {
1834
+ args: [
1835
+ { in: "query", key: "directory" },
1836
+ { key: "body", map: "body" },
1837
+ ],
1838
+ },
1839
+ ]);
1840
+ return (options?.client ?? this.client).post({
1841
+ url: "/tui/publish",
1842
+ ...options,
1843
+ ...params,
1844
+ headers: {
1845
+ "Content-Type": "application/json",
1846
+ ...options?.headers,
1847
+ ...params.headers,
1848
+ },
1849
+ });
1850
+ }
1851
+ /**
1852
+ * Select session
1853
+ *
1854
+ * Navigate the TUI to display the specified session.
1855
+ */
1856
+ selectSession(parameters, options) {
1857
+ const params = buildClientParams([parameters], [
1858
+ {
1859
+ args: [
1860
+ { in: "query", key: "directory" },
1861
+ { in: "body", key: "sessionID" },
1862
+ ],
1863
+ },
1864
+ ]);
1865
+ return (options?.client ?? this.client).post({
1866
+ url: "/tui/select-session",
1867
+ ...options,
1868
+ ...params,
1869
+ headers: {
1870
+ "Content-Type": "application/json",
1871
+ ...options?.headers,
1872
+ ...params.headers,
1873
+ },
1874
+ });
1875
+ }
1876
+ _control;
1877
+ get control() {
1878
+ return (this._control ??= new Control({ client: this.client }));
1879
+ }
1880
+ }
1881
+ export class Instance extends HeyApiClient {
1882
+ /**
1883
+ * Dispose instance
1884
+ *
1885
+ * Clean up and dispose the current HopCoderX instance, releasing all resources.
1886
+ */
1887
+ dispose(parameters, options) {
1888
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1889
+ return (options?.client ?? this.client).post({
1890
+ url: "/instance/dispose",
1891
+ ...options,
1892
+ ...params,
1893
+ });
1894
+ }
1895
+ }
1896
+ export class Path extends HeyApiClient {
1897
+ /**
1898
+ * Get paths
1899
+ *
1900
+ * Retrieve the current working directory and related path information for the HopCoderX instance.
1901
+ */
1902
+ get(parameters, options) {
1903
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1904
+ return (options?.client ?? this.client).get({
1905
+ url: "/path",
1906
+ ...options,
1907
+ ...params,
1908
+ });
1909
+ }
1910
+ }
1911
+ export class Vcs extends HeyApiClient {
1912
+ /**
1913
+ * Get VCS info
1914
+ *
1915
+ * Retrieve version control system (VCS) information for the current project, such as git branch.
1916
+ */
1917
+ get(parameters, options) {
1918
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1919
+ return (options?.client ?? this.client).get({
1920
+ url: "/vcs",
1921
+ ...options,
1922
+ ...params,
1923
+ });
1924
+ }
1925
+ }
1926
+ export class Command extends HeyApiClient {
1927
+ /**
1928
+ * List commands
1929
+ *
1930
+ * Get a list of all available commands in the HopCoderX system.
1931
+ */
1932
+ list(parameters, options) {
1933
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1934
+ return (options?.client ?? this.client).get({
1935
+ url: "/command",
1936
+ ...options,
1937
+ ...params,
1938
+ });
1939
+ }
1940
+ }
1941
+ export class App extends HeyApiClient {
1942
+ /**
1943
+ * Write log
1944
+ *
1945
+ * Write a log entry to the server logs with specified level and metadata.
1946
+ */
1947
+ log(parameters, options) {
1948
+ const params = buildClientParams([parameters], [
1949
+ {
1950
+ args: [
1951
+ { in: "query", key: "directory" },
1952
+ { in: "body", key: "service" },
1953
+ { in: "body", key: "level" },
1954
+ { in: "body", key: "message" },
1955
+ { in: "body", key: "extra" },
1956
+ ],
1957
+ },
1958
+ ]);
1959
+ return (options?.client ?? this.client).post({
1960
+ url: "/log",
1961
+ ...options,
1962
+ ...params,
1963
+ headers: {
1964
+ "Content-Type": "application/json",
1965
+ ...options?.headers,
1966
+ ...params.headers,
1967
+ },
1968
+ });
1969
+ }
1970
+ /**
1971
+ * List agents
1972
+ *
1973
+ * Get a list of all available AI agents in the HopCoderX system.
1974
+ */
1975
+ agents(parameters, options) {
1976
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1977
+ return (options?.client ?? this.client).get({
1978
+ url: "/agent",
1979
+ ...options,
1980
+ ...params,
1981
+ });
1982
+ }
1983
+ /**
1984
+ * List skills
1985
+ *
1986
+ * Get a list of all available skills in the HopCoderX system.
1987
+ */
1988
+ skills(parameters, options) {
1989
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
1990
+ return (options?.client ?? this.client).get({
1991
+ url: "/skill",
1992
+ ...options,
1993
+ ...params,
1994
+ });
1995
+ }
1996
+ }
1997
+ export class Lsp extends HeyApiClient {
1998
+ /**
1999
+ * Get LSP status
2000
+ *
2001
+ * Get LSP server status
2002
+ */
2003
+ status(parameters, options) {
2004
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
2005
+ return (options?.client ?? this.client).get({
2006
+ url: "/lsp",
2007
+ ...options,
2008
+ ...params,
2009
+ });
2010
+ }
2011
+ }
2012
+ export class Formatter extends HeyApiClient {
2013
+ /**
2014
+ * Get formatter status
2015
+ *
2016
+ * Get formatter status
2017
+ */
2018
+ status(parameters, options) {
2019
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
2020
+ return (options?.client ?? this.client).get({
2021
+ url: "/formatter",
2022
+ ...options,
2023
+ ...params,
2024
+ });
2025
+ }
2026
+ }
2027
+ export class Event extends HeyApiClient {
2028
+ /**
2029
+ * Subscribe to events
2030
+ *
2031
+ * Get events
2032
+ */
2033
+ subscribe(parameters, options) {
2034
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
2035
+ return (options?.client ?? this.client).sse.get({
2036
+ url: "/event",
2037
+ ...options,
2038
+ ...params,
2039
+ });
2040
+ }
2041
+ }
2042
+ export class HopCoderXClient extends HeyApiClient {
2043
+ static __registry = new HeyApiRegistry();
2044
+ constructor(args) {
2045
+ super(args);
2046
+ HopCoderXClient.__registry.set(this, args?.key);
2047
+ }
2048
+ _global;
2049
+ get global() {
2050
+ return (this._global ??= new Global({ client: this.client }));
2051
+ }
2052
+ _auth;
2053
+ get auth() {
2054
+ return (this._auth ??= new Auth({ client: this.client }));
2055
+ }
2056
+ _project;
2057
+ get project() {
2058
+ return (this._project ??= new Project({ client: this.client }));
2059
+ }
2060
+ _pty;
2061
+ get pty() {
2062
+ return (this._pty ??= new Pty({ client: this.client }));
2063
+ }
2064
+ _config;
2065
+ get config() {
2066
+ return (this._config ??= new Config2({ client: this.client }));
2067
+ }
2068
+ _tool;
2069
+ get tool() {
2070
+ return (this._tool ??= new Tool({ client: this.client }));
2071
+ }
2072
+ _worktree;
2073
+ get worktree() {
2074
+ return (this._worktree ??= new Worktree({ client: this.client }));
2075
+ }
2076
+ _experimental;
2077
+ get experimental() {
2078
+ return (this._experimental ??= new Experimental({ client: this.client }));
2079
+ }
2080
+ _session;
2081
+ get session() {
2082
+ return (this._session ??= new Session({ client: this.client }));
2083
+ }
2084
+ _part;
2085
+ get part() {
2086
+ return (this._part ??= new Part({ client: this.client }));
2087
+ }
2088
+ _permission;
2089
+ get permission() {
2090
+ return (this._permission ??= new Permission({ client: this.client }));
2091
+ }
2092
+ _question;
2093
+ get question() {
2094
+ return (this._question ??= new Question({ client: this.client }));
2095
+ }
2096
+ _provider;
2097
+ get provider() {
2098
+ return (this._provider ??= new Provider({ client: this.client }));
2099
+ }
2100
+ _find;
2101
+ get find() {
2102
+ return (this._find ??= new Find({ client: this.client }));
2103
+ }
2104
+ _file;
2105
+ get file() {
2106
+ return (this._file ??= new File({ client: this.client }));
2107
+ }
2108
+ _mcp;
2109
+ get mcp() {
2110
+ return (this._mcp ??= new Mcp({ client: this.client }));
2111
+ }
2112
+ _tui;
2113
+ get tui() {
2114
+ return (this._tui ??= new Tui({ client: this.client }));
2115
+ }
2116
+ _instance;
2117
+ get instance() {
2118
+ return (this._instance ??= new Instance({ client: this.client }));
2119
+ }
2120
+ _path;
2121
+ get path() {
2122
+ return (this._path ??= new Path({ client: this.client }));
2123
+ }
2124
+ _vcs;
2125
+ get vcs() {
2126
+ return (this._vcs ??= new Vcs({ client: this.client }));
2127
+ }
2128
+ _command;
2129
+ get command() {
2130
+ return (this._command ??= new Command({ client: this.client }));
2131
+ }
2132
+ _app;
2133
+ get app() {
2134
+ return (this._app ??= new App({ client: this.client }));
2135
+ }
2136
+ _lsp;
2137
+ get lsp() {
2138
+ return (this._lsp ??= new Lsp({ client: this.client }));
2139
+ }
2140
+ _formatter;
2141
+ get formatter() {
2142
+ return (this._formatter ??= new Formatter({ client: this.client }));
2143
+ }
2144
+ _event;
2145
+ get event() {
2146
+ return (this._event ??= new Event({ client: this.client }));
2147
+ }
2148
+ }