@xutest1/sdk 0.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.
@@ -0,0 +1,574 @@
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 Config extends _HeyApiClient {
32
+ /**
33
+ * Get config info
34
+ */
35
+ get(options) {
36
+ return (options?.client ?? this._client).get({
37
+ url: "/config",
38
+ ...options,
39
+ });
40
+ }
41
+ /**
42
+ * Update config
43
+ */
44
+ update(options) {
45
+ return (options?.client ?? this._client).patch({
46
+ url: "/config",
47
+ ...options,
48
+ headers: {
49
+ "Content-Type": "application/json",
50
+ ...options?.headers,
51
+ },
52
+ });
53
+ }
54
+ /**
55
+ * List all providers
56
+ */
57
+ providers(options) {
58
+ return (options?.client ?? this._client).get({
59
+ url: "/config/providers",
60
+ ...options,
61
+ });
62
+ }
63
+ }
64
+ class Tool extends _HeyApiClient {
65
+ /**
66
+ * List all tool IDs (including built-in and dynamically registered)
67
+ */
68
+ ids(options) {
69
+ return (options?.client ?? this._client).get({
70
+ url: "/experimental/tool/ids",
71
+ ...options,
72
+ });
73
+ }
74
+ /**
75
+ * List tools with JSON schema parameters for a provider/model
76
+ */
77
+ list(options) {
78
+ return (options.client ?? this._client).get({
79
+ url: "/experimental/tool",
80
+ ...options,
81
+ });
82
+ }
83
+ }
84
+ class Path extends _HeyApiClient {
85
+ /**
86
+ * Get the current path
87
+ */
88
+ get(options) {
89
+ return (options?.client ?? this._client).get({
90
+ url: "/path",
91
+ ...options,
92
+ });
93
+ }
94
+ }
95
+ class Session extends _HeyApiClient {
96
+ /**
97
+ * List all sessions
98
+ */
99
+ list(options) {
100
+ return (options?.client ?? this._client).get({
101
+ url: "/session",
102
+ ...options,
103
+ });
104
+ }
105
+ /**
106
+ * Create a new session
107
+ */
108
+ create(options) {
109
+ return (options?.client ?? this._client).post({
110
+ url: "/session",
111
+ ...options,
112
+ headers: {
113
+ "Content-Type": "application/json",
114
+ ...options?.headers,
115
+ },
116
+ });
117
+ }
118
+ /**
119
+ * Delete a session and all its data
120
+ */
121
+ delete(options) {
122
+ return (options.client ?? this._client).delete({
123
+ url: "/session/{id}",
124
+ ...options,
125
+ });
126
+ }
127
+ /**
128
+ * Get session
129
+ */
130
+ get(options) {
131
+ return (options.client ?? this._client).get({
132
+ url: "/session/{id}",
133
+ ...options,
134
+ });
135
+ }
136
+ /**
137
+ * Update session properties
138
+ */
139
+ update(options) {
140
+ return (options.client ?? this._client).patch({
141
+ url: "/session/{id}",
142
+ ...options,
143
+ headers: {
144
+ "Content-Type": "application/json",
145
+ ...options.headers,
146
+ },
147
+ });
148
+ }
149
+ /**
150
+ * Get a session's children
151
+ */
152
+ children(options) {
153
+ return (options.client ?? this._client).get({
154
+ url: "/session/{id}/children",
155
+ ...options,
156
+ });
157
+ }
158
+ /**
159
+ * Get the todo list for a session
160
+ */
161
+ todo(options) {
162
+ return (options.client ?? this._client).get({
163
+ url: "/session/{id}/todo",
164
+ ...options,
165
+ });
166
+ }
167
+ /**
168
+ * Analyze the app and create an AGENTS.md file
169
+ */
170
+ init(options) {
171
+ return (options.client ?? this._client).post({
172
+ url: "/session/{id}/init",
173
+ ...options,
174
+ headers: {
175
+ "Content-Type": "application/json",
176
+ ...options.headers,
177
+ },
178
+ });
179
+ }
180
+ /**
181
+ * Fork an existing session at a specific message
182
+ */
183
+ fork(options) {
184
+ return (options.client ?? this._client).post({
185
+ url: "/session/{id}/fork",
186
+ ...options,
187
+ headers: {
188
+ "Content-Type": "application/json",
189
+ ...options.headers,
190
+ },
191
+ });
192
+ }
193
+ /**
194
+ * Abort a session
195
+ */
196
+ abort(options) {
197
+ return (options.client ?? this._client).post({
198
+ url: "/session/{id}/abort",
199
+ ...options,
200
+ });
201
+ }
202
+ /**
203
+ * Unshare the session
204
+ */
205
+ unshare(options) {
206
+ return (options.client ?? this._client).delete({
207
+ url: "/session/{id}/share",
208
+ ...options,
209
+ });
210
+ }
211
+ /**
212
+ * Share a session
213
+ */
214
+ share(options) {
215
+ return (options.client ?? this._client).post({
216
+ url: "/session/{id}/share",
217
+ ...options,
218
+ });
219
+ }
220
+ /**
221
+ * Get the diff that resulted from this user message
222
+ */
223
+ diff(options) {
224
+ return (options.client ?? this._client).get({
225
+ url: "/session/{id}/diff",
226
+ ...options,
227
+ });
228
+ }
229
+ /**
230
+ * Summarize the session
231
+ */
232
+ summarize(options) {
233
+ return (options.client ?? this._client).post({
234
+ url: "/session/{id}/summarize",
235
+ ...options,
236
+ headers: {
237
+ "Content-Type": "application/json",
238
+ ...options.headers,
239
+ },
240
+ });
241
+ }
242
+ /**
243
+ * List messages for a session
244
+ */
245
+ messages(options) {
246
+ return (options.client ?? this._client).get({
247
+ url: "/session/{id}/message",
248
+ ...options,
249
+ });
250
+ }
251
+ /**
252
+ * Create and send a new message to a session
253
+ */
254
+ prompt(options) {
255
+ return (options.client ?? this._client).post({
256
+ url: "/session/{id}/message",
257
+ ...options,
258
+ headers: {
259
+ "Content-Type": "application/json",
260
+ ...options.headers,
261
+ },
262
+ });
263
+ }
264
+ /**
265
+ * Get a message from a session
266
+ */
267
+ message(options) {
268
+ return (options.client ?? this._client).get({
269
+ url: "/session/{id}/message/{messageID}",
270
+ ...options,
271
+ });
272
+ }
273
+ /**
274
+ * Send a new command to a session
275
+ */
276
+ command(options) {
277
+ return (options.client ?? this._client).post({
278
+ url: "/session/{id}/command",
279
+ ...options,
280
+ headers: {
281
+ "Content-Type": "application/json",
282
+ ...options.headers,
283
+ },
284
+ });
285
+ }
286
+ /**
287
+ * Run a shell command
288
+ */
289
+ shell(options) {
290
+ return (options.client ?? this._client).post({
291
+ url: "/session/{id}/shell",
292
+ ...options,
293
+ headers: {
294
+ "Content-Type": "application/json",
295
+ ...options.headers,
296
+ },
297
+ });
298
+ }
299
+ /**
300
+ * Revert a message
301
+ */
302
+ revert(options) {
303
+ return (options.client ?? this._client).post({
304
+ url: "/session/{id}/revert",
305
+ ...options,
306
+ headers: {
307
+ "Content-Type": "application/json",
308
+ ...options.headers,
309
+ },
310
+ });
311
+ }
312
+ /**
313
+ * Restore all reverted messages
314
+ */
315
+ unrevert(options) {
316
+ return (options.client ?? this._client).post({
317
+ url: "/session/{id}/unrevert",
318
+ ...options,
319
+ });
320
+ }
321
+ }
322
+ class Command extends _HeyApiClient {
323
+ /**
324
+ * List all commands
325
+ */
326
+ list(options) {
327
+ return (options?.client ?? this._client).get({
328
+ url: "/command",
329
+ ...options,
330
+ });
331
+ }
332
+ }
333
+ class Find extends _HeyApiClient {
334
+ /**
335
+ * Find text in files
336
+ */
337
+ text(options) {
338
+ return (options.client ?? this._client).get({
339
+ url: "/find",
340
+ ...options,
341
+ });
342
+ }
343
+ /**
344
+ * Find files
345
+ */
346
+ files(options) {
347
+ return (options.client ?? this._client).get({
348
+ url: "/find/file",
349
+ ...options,
350
+ });
351
+ }
352
+ /**
353
+ * Find workspace symbols
354
+ */
355
+ symbols(options) {
356
+ return (options.client ?? this._client).get({
357
+ url: "/find/symbol",
358
+ ...options,
359
+ });
360
+ }
361
+ }
362
+ class File extends _HeyApiClient {
363
+ /**
364
+ * List files and directories
365
+ */
366
+ list(options) {
367
+ return (options.client ?? this._client).get({
368
+ url: "/file",
369
+ ...options,
370
+ });
371
+ }
372
+ /**
373
+ * Read a file
374
+ */
375
+ read(options) {
376
+ return (options.client ?? this._client).get({
377
+ url: "/file/content",
378
+ ...options,
379
+ });
380
+ }
381
+ /**
382
+ * Get file status
383
+ */
384
+ status(options) {
385
+ return (options?.client ?? this._client).get({
386
+ url: "/file/status",
387
+ ...options,
388
+ });
389
+ }
390
+ }
391
+ class App extends _HeyApiClient {
392
+ /**
393
+ * Write a log entry to the server logs
394
+ */
395
+ log(options) {
396
+ return (options?.client ?? this._client).post({
397
+ url: "/log",
398
+ ...options,
399
+ headers: {
400
+ "Content-Type": "application/json",
401
+ ...options?.headers,
402
+ },
403
+ });
404
+ }
405
+ /**
406
+ * List all agents
407
+ */
408
+ agents(options) {
409
+ return (options?.client ?? this._client).get({
410
+ url: "/agent",
411
+ ...options,
412
+ });
413
+ }
414
+ }
415
+ class Mcp extends _HeyApiClient {
416
+ /**
417
+ * Get MCP server status
418
+ */
419
+ status(options) {
420
+ return (options?.client ?? this._client).get({
421
+ url: "/mcp",
422
+ ...options,
423
+ });
424
+ }
425
+ }
426
+ class Tui extends _HeyApiClient {
427
+ /**
428
+ * Append prompt to the TUI
429
+ */
430
+ appendPrompt(options) {
431
+ return (options?.client ?? this._client).post({
432
+ url: "/tui/append-prompt",
433
+ ...options,
434
+ headers: {
435
+ "Content-Type": "application/json",
436
+ ...options?.headers,
437
+ },
438
+ });
439
+ }
440
+ /**
441
+ * Open the help dialog
442
+ */
443
+ openHelp(options) {
444
+ return (options?.client ?? this._client).post({
445
+ url: "/tui/open-help",
446
+ ...options,
447
+ });
448
+ }
449
+ /**
450
+ * Open the session dialog
451
+ */
452
+ openSessions(options) {
453
+ return (options?.client ?? this._client).post({
454
+ url: "/tui/open-sessions",
455
+ ...options,
456
+ });
457
+ }
458
+ /**
459
+ * Open the theme dialog
460
+ */
461
+ openThemes(options) {
462
+ return (options?.client ?? this._client).post({
463
+ url: "/tui/open-themes",
464
+ ...options,
465
+ });
466
+ }
467
+ /**
468
+ * Open the model dialog
469
+ */
470
+ openModels(options) {
471
+ return (options?.client ?? this._client).post({
472
+ url: "/tui/open-models",
473
+ ...options,
474
+ });
475
+ }
476
+ /**
477
+ * Submit the prompt
478
+ */
479
+ submitPrompt(options) {
480
+ return (options?.client ?? this._client).post({
481
+ url: "/tui/submit-prompt",
482
+ ...options,
483
+ });
484
+ }
485
+ /**
486
+ * Clear the prompt
487
+ */
488
+ clearPrompt(options) {
489
+ return (options?.client ?? this._client).post({
490
+ url: "/tui/clear-prompt",
491
+ ...options,
492
+ });
493
+ }
494
+ /**
495
+ * Execute a TUI command (e.g. agent_cycle)
496
+ */
497
+ executeCommand(options) {
498
+ return (options?.client ?? this._client).post({
499
+ url: "/tui/execute-command",
500
+ ...options,
501
+ headers: {
502
+ "Content-Type": "application/json",
503
+ ...options?.headers,
504
+ },
505
+ });
506
+ }
507
+ /**
508
+ * Show a toast notification in the TUI
509
+ */
510
+ showToast(options) {
511
+ return (options?.client ?? this._client).post({
512
+ url: "/tui/show-toast",
513
+ ...options,
514
+ headers: {
515
+ "Content-Type": "application/json",
516
+ ...options?.headers,
517
+ },
518
+ });
519
+ }
520
+ }
521
+ class Auth extends _HeyApiClient {
522
+ /**
523
+ * Set authentication credentials
524
+ */
525
+ set(options) {
526
+ return (options.client ?? this._client).put({
527
+ url: "/auth/{id}",
528
+ ...options,
529
+ headers: {
530
+ "Content-Type": "application/json",
531
+ ...options.headers,
532
+ },
533
+ });
534
+ }
535
+ }
536
+ class Event extends _HeyApiClient {
537
+ /**
538
+ * Get events
539
+ */
540
+ subscribe(options) {
541
+ return (options?.client ?? this._client).get.sse({
542
+ url: "/event",
543
+ ...options,
544
+ });
545
+ }
546
+ }
547
+ export class OpencodeClient extends _HeyApiClient {
548
+ /**
549
+ * Respond to a permission request
550
+ */
551
+ postSessionIdPermissionsPermissionId(options) {
552
+ return (options.client ?? this._client).post({
553
+ url: "/session/{id}/permissions/{permissionID}",
554
+ ...options,
555
+ headers: {
556
+ "Content-Type": "application/json",
557
+ ...options.headers,
558
+ },
559
+ });
560
+ }
561
+ project = new Project({ client: this._client });
562
+ config = new Config({ client: this._client });
563
+ tool = new Tool({ client: this._client });
564
+ path = new Path({ client: this._client });
565
+ session = new Session({ client: this._client });
566
+ command = new Command({ client: this._client });
567
+ find = new Find({ client: this._client });
568
+ file = new File({ client: this._client });
569
+ app = new App({ client: this._client });
570
+ mcp = new Mcp({ client: this._client });
571
+ tui = new Tui({ client: this._client });
572
+ auth = new Auth({ client: this._client });
573
+ event = new Event({ client: this._client });
574
+ }