@xutest1/sdk 0.1.7 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/gen/sdk.gen.js ADDED
@@ -0,0 +1,735 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ import { client as _heyApiClient } from "./client.gen.js";
3
+ class _HeyApiClient {
4
+ _client = _heyApiClient;
5
+ constructor(args) {
6
+ if (args?.client) {
7
+ this._client = args.client;
8
+ }
9
+ }
10
+ }
11
+ class Project extends _HeyApiClient {
12
+ /**
13
+ * List all projects
14
+ */
15
+ list(options) {
16
+ return (options?.client ?? this._client).get({
17
+ url: "/project",
18
+ ...options,
19
+ });
20
+ }
21
+ /**
22
+ * Get the current project
23
+ */
24
+ current(options) {
25
+ return (options?.client ?? this._client).get({
26
+ url: "/project/current",
27
+ ...options,
28
+ });
29
+ }
30
+ }
31
+ class Current extends _HeyApiClient {
32
+ /**
33
+ * Get LLM context for the most recently loaded paper
34
+ */
35
+ context(options) {
36
+ return (options?.client ?? this._client).get({
37
+ url: "/fds/paper/current/context",
38
+ ...options,
39
+ });
40
+ }
41
+ }
42
+ class Spec extends _HeyApiClient {
43
+ /**
44
+ * Set the FDS specification for a paper
45
+ */
46
+ set(options) {
47
+ return (options.client ?? this._client).put({
48
+ url: "/fds/paper/{id}/spec",
49
+ ...options,
50
+ headers: {
51
+ "Content-Type": "application/json",
52
+ ...options.headers,
53
+ },
54
+ });
55
+ }
56
+ }
57
+ class Paper extends _HeyApiClient {
58
+ /**
59
+ * Load a research paper from file path or URL
60
+ */
61
+ load(options) {
62
+ return (options?.client ?? this._client).post({
63
+ url: "/fds/paper/load",
64
+ ...options,
65
+ headers: {
66
+ "Content-Type": "application/json",
67
+ ...options?.headers,
68
+ },
69
+ });
70
+ }
71
+ /**
72
+ * Get LLM context for a loaded paper (includes FDS extraction instructions)
73
+ */
74
+ context(options) {
75
+ return (options.client ?? this._client).get({
76
+ url: "/fds/paper/{id}/context",
77
+ ...options,
78
+ });
79
+ }
80
+ /**
81
+ * Clear a paper from memory
82
+ */
83
+ delete(options) {
84
+ return (options.client ?? this._client).delete({
85
+ url: "/fds/paper/{id}",
86
+ ...options,
87
+ });
88
+ }
89
+ /**
90
+ * Get paper details by ID
91
+ */
92
+ get(options) {
93
+ return (options.client ?? this._client).get({
94
+ url: "/fds/paper/{id}",
95
+ ...options,
96
+ });
97
+ }
98
+ /**
99
+ * List all loaded papers
100
+ */
101
+ list(options) {
102
+ return (options?.client ?? this._client).get({
103
+ url: "/fds/paper",
104
+ ...options,
105
+ });
106
+ }
107
+ /**
108
+ * Update the current phase for a paper
109
+ */
110
+ phase(options) {
111
+ return (options.client ?? this._client).patch({
112
+ url: "/fds/paper/{id}/phase",
113
+ ...options,
114
+ headers: {
115
+ "Content-Type": "application/json",
116
+ ...options.headers,
117
+ },
118
+ });
119
+ }
120
+ current = new Current({ client: this._client });
121
+ spec = new Spec({ client: this._client });
122
+ }
123
+ class Fds extends _HeyApiClient {
124
+ /**
125
+ * Check if FDS dependencies (PyPDF2) are available
126
+ */
127
+ dependencies(options) {
128
+ return (options?.client ?? this._client).get({
129
+ url: "/fds/dependencies",
130
+ ...options,
131
+ });
132
+ }
133
+ paper = new Paper({ client: this._client });
134
+ }
135
+ class Config extends _HeyApiClient {
136
+ /**
137
+ * Get config info
138
+ */
139
+ get(options) {
140
+ return (options?.client ?? this._client).get({
141
+ url: "/config",
142
+ ...options,
143
+ });
144
+ }
145
+ /**
146
+ * Update config
147
+ */
148
+ update(options) {
149
+ return (options?.client ?? this._client).patch({
150
+ url: "/config",
151
+ ...options,
152
+ headers: {
153
+ "Content-Type": "application/json",
154
+ ...options?.headers,
155
+ },
156
+ });
157
+ }
158
+ /**
159
+ * List all providers
160
+ */
161
+ providers(options) {
162
+ return (options?.client ?? this._client).get({
163
+ url: "/config/providers",
164
+ ...options,
165
+ });
166
+ }
167
+ }
168
+ class Tool extends _HeyApiClient {
169
+ /**
170
+ * List all tool IDs (including built-in and dynamically registered)
171
+ */
172
+ ids(options) {
173
+ return (options?.client ?? this._client).get({
174
+ url: "/experimental/tool/ids",
175
+ ...options,
176
+ });
177
+ }
178
+ /**
179
+ * List tools with JSON schema parameters for a provider/model
180
+ */
181
+ list(options) {
182
+ return (options.client ?? this._client).get({
183
+ url: "/experimental/tool",
184
+ ...options,
185
+ });
186
+ }
187
+ }
188
+ class Path extends _HeyApiClient {
189
+ /**
190
+ * Get the current path
191
+ */
192
+ get(options) {
193
+ return (options?.client ?? this._client).get({
194
+ url: "/path",
195
+ ...options,
196
+ });
197
+ }
198
+ }
199
+ class Session extends _HeyApiClient {
200
+ /**
201
+ * List all sessions
202
+ */
203
+ list(options) {
204
+ return (options?.client ?? this._client).get({
205
+ url: "/session",
206
+ ...options,
207
+ });
208
+ }
209
+ /**
210
+ * Create a new session
211
+ */
212
+ create(options) {
213
+ return (options?.client ?? this._client).post({
214
+ url: "/session",
215
+ ...options,
216
+ headers: {
217
+ "Content-Type": "application/json",
218
+ ...options?.headers,
219
+ },
220
+ });
221
+ }
222
+ /**
223
+ * Delete a session and all its data
224
+ */
225
+ delete(options) {
226
+ return (options.client ?? this._client).delete({
227
+ url: "/session/{id}",
228
+ ...options,
229
+ });
230
+ }
231
+ /**
232
+ * Get session
233
+ */
234
+ get(options) {
235
+ return (options.client ?? this._client).get({
236
+ url: "/session/{id}",
237
+ ...options,
238
+ });
239
+ }
240
+ /**
241
+ * Update session properties
242
+ */
243
+ update(options) {
244
+ return (options.client ?? this._client).patch({
245
+ url: "/session/{id}",
246
+ ...options,
247
+ headers: {
248
+ "Content-Type": "application/json",
249
+ ...options.headers,
250
+ },
251
+ });
252
+ }
253
+ /**
254
+ * Get a session's children
255
+ */
256
+ children(options) {
257
+ return (options.client ?? this._client).get({
258
+ url: "/session/{id}/children",
259
+ ...options,
260
+ });
261
+ }
262
+ /**
263
+ * Get the todo list for a session
264
+ */
265
+ todo(options) {
266
+ return (options.client ?? this._client).get({
267
+ url: "/session/{id}/todo",
268
+ ...options,
269
+ });
270
+ }
271
+ /**
272
+ * Analyze the app and create an AGENTS.md file
273
+ */
274
+ init(options) {
275
+ return (options.client ?? this._client).post({
276
+ url: "/session/{id}/init",
277
+ ...options,
278
+ headers: {
279
+ "Content-Type": "application/json",
280
+ ...options.headers,
281
+ },
282
+ });
283
+ }
284
+ /**
285
+ * Fork an existing session at a specific message
286
+ */
287
+ fork(options) {
288
+ return (options.client ?? this._client).post({
289
+ url: "/session/{id}/fork",
290
+ ...options,
291
+ headers: {
292
+ "Content-Type": "application/json",
293
+ ...options.headers,
294
+ },
295
+ });
296
+ }
297
+ /**
298
+ * Abort a session
299
+ */
300
+ abort(options) {
301
+ return (options.client ?? this._client).post({
302
+ url: "/session/{id}/abort",
303
+ ...options,
304
+ });
305
+ }
306
+ /**
307
+ * Toggle auto-approve permission for a session
308
+ */
309
+ togglePermission(options) {
310
+ return (options.client ?? this._client).patch({
311
+ url: "/session/{id}/permission",
312
+ ...options,
313
+ headers: {
314
+ "Content-Type": "application/json",
315
+ ...options.headers,
316
+ },
317
+ });
318
+ }
319
+ /**
320
+ * Unshare the session
321
+ */
322
+ unshare(options) {
323
+ return (options.client ?? this._client).delete({
324
+ url: "/session/{id}/share",
325
+ ...options,
326
+ });
327
+ }
328
+ /**
329
+ * Share a session
330
+ */
331
+ share(options) {
332
+ return (options.client ?? this._client).post({
333
+ url: "/session/{id}/share",
334
+ ...options,
335
+ });
336
+ }
337
+ /**
338
+ * Get the diff that resulted from this user message
339
+ */
340
+ diff(options) {
341
+ return (options.client ?? this._client).get({
342
+ url: "/session/{id}/diff",
343
+ ...options,
344
+ });
345
+ }
346
+ /**
347
+ * Summarize the session
348
+ */
349
+ summarize(options) {
350
+ return (options.client ?? this._client).post({
351
+ url: "/session/{id}/summarize",
352
+ ...options,
353
+ headers: {
354
+ "Content-Type": "application/json",
355
+ ...options.headers,
356
+ },
357
+ });
358
+ }
359
+ /**
360
+ * List messages for a session
361
+ */
362
+ messages(options) {
363
+ return (options.client ?? this._client).get({
364
+ url: "/session/{id}/message",
365
+ ...options,
366
+ });
367
+ }
368
+ /**
369
+ * Create and send a new message to a session
370
+ */
371
+ prompt(options) {
372
+ return (options.client ?? this._client).post({
373
+ url: "/session/{id}/message",
374
+ ...options,
375
+ headers: {
376
+ "Content-Type": "application/json",
377
+ ...options.headers,
378
+ },
379
+ });
380
+ }
381
+ /**
382
+ * Get a message from a session
383
+ */
384
+ message(options) {
385
+ return (options.client ?? this._client).get({
386
+ url: "/session/{id}/message/{messageID}",
387
+ ...options,
388
+ });
389
+ }
390
+ /**
391
+ * Send a new command to a session
392
+ */
393
+ command(options) {
394
+ return (options.client ?? this._client).post({
395
+ url: "/session/{id}/command",
396
+ ...options,
397
+ headers: {
398
+ "Content-Type": "application/json",
399
+ ...options.headers,
400
+ },
401
+ });
402
+ }
403
+ /**
404
+ * Run a shell command
405
+ */
406
+ shell(options) {
407
+ return (options.client ?? this._client).post({
408
+ url: "/session/{id}/shell",
409
+ ...options,
410
+ headers: {
411
+ "Content-Type": "application/json",
412
+ ...options.headers,
413
+ },
414
+ });
415
+ }
416
+ /**
417
+ * Revert a message
418
+ */
419
+ revert(options) {
420
+ return (options.client ?? this._client).post({
421
+ url: "/session/{id}/revert",
422
+ ...options,
423
+ headers: {
424
+ "Content-Type": "application/json",
425
+ ...options.headers,
426
+ },
427
+ });
428
+ }
429
+ /**
430
+ * Restore all reverted messages
431
+ */
432
+ unrevert(options) {
433
+ return (options.client ?? this._client).post({
434
+ url: "/session/{id}/unrevert",
435
+ ...options,
436
+ });
437
+ }
438
+ }
439
+ class Command extends _HeyApiClient {
440
+ /**
441
+ * List all commands
442
+ */
443
+ list(options) {
444
+ return (options?.client ?? this._client).get({
445
+ url: "/command",
446
+ ...options,
447
+ });
448
+ }
449
+ }
450
+ class Find extends _HeyApiClient {
451
+ /**
452
+ * Find text in files
453
+ */
454
+ text(options) {
455
+ return (options.client ?? this._client).get({
456
+ url: "/find",
457
+ ...options,
458
+ });
459
+ }
460
+ /**
461
+ * Find files
462
+ */
463
+ files(options) {
464
+ return (options.client ?? this._client).get({
465
+ url: "/find/file",
466
+ ...options,
467
+ });
468
+ }
469
+ /**
470
+ * Find workspace symbols
471
+ */
472
+ symbols(options) {
473
+ return (options.client ?? this._client).get({
474
+ url: "/find/symbol",
475
+ ...options,
476
+ });
477
+ }
478
+ }
479
+ class File extends _HeyApiClient {
480
+ /**
481
+ * List files and directories
482
+ */
483
+ list(options) {
484
+ return (options.client ?? this._client).get({
485
+ url: "/file",
486
+ ...options,
487
+ });
488
+ }
489
+ /**
490
+ * Read a file
491
+ */
492
+ read(options) {
493
+ return (options.client ?? this._client).get({
494
+ url: "/file/content",
495
+ ...options,
496
+ });
497
+ }
498
+ /**
499
+ * Get file status
500
+ */
501
+ status(options) {
502
+ return (options?.client ?? this._client).get({
503
+ url: "/file/status",
504
+ ...options,
505
+ });
506
+ }
507
+ }
508
+ class App extends _HeyApiClient {
509
+ /**
510
+ * Write a log entry to the server logs
511
+ */
512
+ log(options) {
513
+ return (options?.client ?? this._client).post({
514
+ url: "/log",
515
+ ...options,
516
+ headers: {
517
+ "Content-Type": "application/json",
518
+ ...options?.headers,
519
+ },
520
+ });
521
+ }
522
+ /**
523
+ * List all agents
524
+ */
525
+ agents(options) {
526
+ return (options?.client ?? this._client).get({
527
+ url: "/agent",
528
+ ...options,
529
+ });
530
+ }
531
+ }
532
+ class Agent extends _HeyApiClient {
533
+ /**
534
+ * Update agent permission settings
535
+ */
536
+ updatePermission(options) {
537
+ return (options.client ?? this._client).patch({
538
+ url: "/agent/{name}/permission",
539
+ ...options,
540
+ headers: {
541
+ "Content-Type": "application/json",
542
+ ...options.headers,
543
+ },
544
+ });
545
+ }
546
+ }
547
+ class Mcp extends _HeyApiClient {
548
+ /**
549
+ * Get MCP server status
550
+ */
551
+ status(options) {
552
+ return (options?.client ?? this._client).get({
553
+ url: "/mcp",
554
+ ...options,
555
+ });
556
+ }
557
+ /**
558
+ * Refresh all MCP servers - reloads config and reconnects
559
+ */
560
+ refresh(options) {
561
+ return (options?.client ?? this._client).post({
562
+ url: "/mcp/refresh",
563
+ ...options,
564
+ });
565
+ }
566
+ /**
567
+ * Enable an MCP server
568
+ */
569
+ enable(options) {
570
+ return (options.client ?? this._client).post({
571
+ url: "/mcp/{name}/enable",
572
+ ...options,
573
+ });
574
+ }
575
+ /**
576
+ * Disable an MCP server
577
+ */
578
+ disable(options) {
579
+ return (options.client ?? this._client).post({
580
+ url: "/mcp/{name}/disable",
581
+ ...options,
582
+ });
583
+ }
584
+ }
585
+ class Tui extends _HeyApiClient {
586
+ /**
587
+ * Append prompt to the TUI
588
+ */
589
+ appendPrompt(options) {
590
+ return (options?.client ?? this._client).post({
591
+ url: "/tui/append-prompt",
592
+ ...options,
593
+ headers: {
594
+ "Content-Type": "application/json",
595
+ ...options?.headers,
596
+ },
597
+ });
598
+ }
599
+ /**
600
+ * Open the help dialog
601
+ */
602
+ openHelp(options) {
603
+ return (options?.client ?? this._client).post({
604
+ url: "/tui/open-help",
605
+ ...options,
606
+ });
607
+ }
608
+ /**
609
+ * Open the session dialog
610
+ */
611
+ openSessions(options) {
612
+ return (options?.client ?? this._client).post({
613
+ url: "/tui/open-sessions",
614
+ ...options,
615
+ });
616
+ }
617
+ /**
618
+ * Open the theme dialog
619
+ */
620
+ openThemes(options) {
621
+ return (options?.client ?? this._client).post({
622
+ url: "/tui/open-themes",
623
+ ...options,
624
+ });
625
+ }
626
+ /**
627
+ * Open the model dialog
628
+ */
629
+ openModels(options) {
630
+ return (options?.client ?? this._client).post({
631
+ url: "/tui/open-models",
632
+ ...options,
633
+ });
634
+ }
635
+ /**
636
+ * Submit the prompt
637
+ */
638
+ submitPrompt(options) {
639
+ return (options?.client ?? this._client).post({
640
+ url: "/tui/submit-prompt",
641
+ ...options,
642
+ });
643
+ }
644
+ /**
645
+ * Clear the prompt
646
+ */
647
+ clearPrompt(options) {
648
+ return (options?.client ?? this._client).post({
649
+ url: "/tui/clear-prompt",
650
+ ...options,
651
+ });
652
+ }
653
+ /**
654
+ * Execute a TUI command (e.g. agent_cycle)
655
+ */
656
+ executeCommand(options) {
657
+ return (options?.client ?? this._client).post({
658
+ url: "/tui/execute-command",
659
+ ...options,
660
+ headers: {
661
+ "Content-Type": "application/json",
662
+ ...options?.headers,
663
+ },
664
+ });
665
+ }
666
+ /**
667
+ * Show a toast notification in the TUI
668
+ */
669
+ showToast(options) {
670
+ return (options?.client ?? this._client).post({
671
+ url: "/tui/show-toast",
672
+ ...options,
673
+ headers: {
674
+ "Content-Type": "application/json",
675
+ ...options?.headers,
676
+ },
677
+ });
678
+ }
679
+ }
680
+ class Auth extends _HeyApiClient {
681
+ /**
682
+ * Set authentication credentials
683
+ */
684
+ set(options) {
685
+ return (options.client ?? this._client).put({
686
+ url: "/auth/{id}",
687
+ ...options,
688
+ headers: {
689
+ "Content-Type": "application/json",
690
+ ...options.headers,
691
+ },
692
+ });
693
+ }
694
+ }
695
+ class Event extends _HeyApiClient {
696
+ /**
697
+ * Get events
698
+ */
699
+ subscribe(options) {
700
+ return (options?.client ?? this._client).get.sse({
701
+ url: "/event",
702
+ ...options,
703
+ });
704
+ }
705
+ }
706
+ export class OpencodeClient extends _HeyApiClient {
707
+ /**
708
+ * Respond to a permission request
709
+ */
710
+ postSessionIdPermissionsPermissionId(options) {
711
+ return (options.client ?? this._client).post({
712
+ url: "/session/{id}/permissions/{permissionID}",
713
+ ...options,
714
+ headers: {
715
+ "Content-Type": "application/json",
716
+ ...options.headers,
717
+ },
718
+ });
719
+ }
720
+ project = new Project({ client: this._client });
721
+ fds = new Fds({ client: this._client });
722
+ config = new Config({ client: this._client });
723
+ tool = new Tool({ client: this._client });
724
+ path = new Path({ client: this._client });
725
+ session = new Session({ client: this._client });
726
+ command = new Command({ client: this._client });
727
+ find = new Find({ client: this._client });
728
+ file = new File({ client: this._client });
729
+ app = new App({ client: this._client });
730
+ agent = new Agent({ client: this._client });
731
+ mcp = new Mcp({ client: this._client });
732
+ tui = new Tui({ client: this._client });
733
+ auth = new Auth({ client: this._client });
734
+ event = new Event({ client: this._client });
735
+ }