@opencode-ai/sdk 1.0.134 → 1.0.137
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/dist/client.d.ts +1 -1
- package/dist/client.js +7 -6
- package/dist/gen/sdk.gen.d.ts +32 -7
- package/dist/gen/sdk.gen.js +74 -15
- package/dist/gen/types.gen.d.ts +184 -1
- package/dist/v2/client.d.ts +7 -0
- package/dist/v2/client.js +25 -0
- package/dist/v2/gen/client/client.gen.d.ts +2 -0
- package/dist/v2/gen/client/client.gen.js +225 -0
- package/dist/v2/gen/client/index.d.ts +8 -0
- package/dist/v2/gen/client/index.js +6 -0
- package/dist/v2/gen/client/types.gen.d.ts +117 -0
- package/dist/v2/gen/client/types.gen.js +2 -0
- package/dist/v2/gen/client/utils.gen.d.ts +33 -0
- package/dist/v2/gen/client/utils.gen.js +226 -0
- package/dist/v2/gen/client.gen.d.ts +12 -0
- package/dist/v2/gen/client.gen.js +3 -0
- package/dist/v2/gen/core/auth.gen.d.ts +18 -0
- package/dist/v2/gen/core/auth.gen.js +14 -0
- package/dist/v2/gen/core/bodySerializer.gen.d.ts +25 -0
- package/dist/v2/gen/core/bodySerializer.gen.js +57 -0
- package/dist/v2/gen/core/params.gen.d.ts +43 -0
- package/dist/v2/gen/core/params.gen.js +102 -0
- package/dist/v2/gen/core/pathSerializer.gen.d.ts +33 -0
- package/dist/v2/gen/core/pathSerializer.gen.js +106 -0
- package/dist/v2/gen/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/v2/gen/core/queryKeySerializer.gen.js +93 -0
- package/dist/v2/gen/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/v2/gen/core/serverSentEvents.gen.js +131 -0
- package/dist/v2/gen/core/types.gen.d.ts +78 -0
- package/dist/v2/gen/core/types.gen.js +2 -0
- package/dist/v2/gen/core/utils.gen.d.ts +19 -0
- package/dist/v2/gen/core/utils.gen.js +87 -0
- package/dist/v2/gen/sdk.gen.d.ts +850 -0
- package/dist/v2/gen/sdk.gen.js +1626 -0
- package/dist/v2/gen/types.gen.d.ts +3356 -0
- package/dist/v2/gen/types.gen.js +2 -0
- package/dist/v2/index.d.ts +10 -0
- package/dist/v2/index.js +16 -0
- package/dist/v2/server.d.ts +23 -0
- package/dist/v2/server.js +91 -0
- package/package.json +15 -3
|
@@ -0,0 +1,1626 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
import { client } from "./client.gen.js";
|
|
3
|
+
import { buildClientParams } from "./client/index.js";
|
|
4
|
+
class HeyApiClient {
|
|
5
|
+
client;
|
|
6
|
+
constructor(args) {
|
|
7
|
+
this.client = args?.client ?? client;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
class HeyApiRegistry {
|
|
11
|
+
defaultKey = "default";
|
|
12
|
+
instances = new Map();
|
|
13
|
+
get(key) {
|
|
14
|
+
const instance = this.instances.get(key ?? this.defaultKey);
|
|
15
|
+
if (!instance) {
|
|
16
|
+
throw new Error(`No SDK client found. Create one with "new OpencodeClient()" to fix this error.`);
|
|
17
|
+
}
|
|
18
|
+
return instance;
|
|
19
|
+
}
|
|
20
|
+
set(value, key) {
|
|
21
|
+
this.instances.set(key ?? this.defaultKey, value);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export class Global extends HeyApiClient {
|
|
25
|
+
/**
|
|
26
|
+
* Get global events
|
|
27
|
+
*
|
|
28
|
+
* Subscribe to global events from the OpenCode system using server-sent events.
|
|
29
|
+
*/
|
|
30
|
+
event(options) {
|
|
31
|
+
return (options?.client ?? this.client).sse.get({
|
|
32
|
+
url: "/global/event",
|
|
33
|
+
...options,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export class Project extends HeyApiClient {
|
|
38
|
+
/**
|
|
39
|
+
* List all projects
|
|
40
|
+
*
|
|
41
|
+
* Get a list of projects that have been opened with OpenCode.
|
|
42
|
+
*/
|
|
43
|
+
list(parameters, options) {
|
|
44
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
45
|
+
return (options?.client ?? this.client).get({
|
|
46
|
+
url: "/project",
|
|
47
|
+
...options,
|
|
48
|
+
...params,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Get current project
|
|
53
|
+
*
|
|
54
|
+
* Retrieve the currently active project that OpenCode is working with.
|
|
55
|
+
*/
|
|
56
|
+
current(parameters, options) {
|
|
57
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
58
|
+
return (options?.client ?? this.client).get({
|
|
59
|
+
url: "/project/current",
|
|
60
|
+
...options,
|
|
61
|
+
...params,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export class Pty extends HeyApiClient {
|
|
66
|
+
/**
|
|
67
|
+
* List PTY sessions
|
|
68
|
+
*
|
|
69
|
+
* Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.
|
|
70
|
+
*/
|
|
71
|
+
list(parameters, options) {
|
|
72
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
73
|
+
return (options?.client ?? this.client).get({
|
|
74
|
+
url: "/pty",
|
|
75
|
+
...options,
|
|
76
|
+
...params,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Create PTY session
|
|
81
|
+
*
|
|
82
|
+
* Create a new pseudo-terminal (PTY) session for running shell commands and processes.
|
|
83
|
+
*/
|
|
84
|
+
create(parameters, options) {
|
|
85
|
+
const params = buildClientParams([parameters], [
|
|
86
|
+
{
|
|
87
|
+
args: [
|
|
88
|
+
{ in: "query", key: "directory" },
|
|
89
|
+
{ in: "body", key: "command" },
|
|
90
|
+
{ in: "body", key: "args" },
|
|
91
|
+
{ in: "body", key: "cwd" },
|
|
92
|
+
{ in: "body", key: "title" },
|
|
93
|
+
{ in: "body", key: "env" },
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
]);
|
|
97
|
+
return (options?.client ?? this.client).post({
|
|
98
|
+
url: "/pty",
|
|
99
|
+
...options,
|
|
100
|
+
...params,
|
|
101
|
+
headers: {
|
|
102
|
+
"Content-Type": "application/json",
|
|
103
|
+
...options?.headers,
|
|
104
|
+
...params.headers,
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Remove PTY session
|
|
110
|
+
*
|
|
111
|
+
* Remove and terminate a specific pseudo-terminal (PTY) session.
|
|
112
|
+
*/
|
|
113
|
+
remove(parameters, options) {
|
|
114
|
+
const params = buildClientParams([parameters], [
|
|
115
|
+
{
|
|
116
|
+
args: [
|
|
117
|
+
{ in: "path", key: "ptyID" },
|
|
118
|
+
{ in: "query", key: "directory" },
|
|
119
|
+
],
|
|
120
|
+
},
|
|
121
|
+
]);
|
|
122
|
+
return (options?.client ?? this.client).delete({
|
|
123
|
+
url: "/pty/{ptyID}",
|
|
124
|
+
...options,
|
|
125
|
+
...params,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Get PTY session
|
|
130
|
+
*
|
|
131
|
+
* Retrieve detailed information about a specific pseudo-terminal (PTY) session.
|
|
132
|
+
*/
|
|
133
|
+
get(parameters, options) {
|
|
134
|
+
const params = buildClientParams([parameters], [
|
|
135
|
+
{
|
|
136
|
+
args: [
|
|
137
|
+
{ in: "path", key: "ptyID" },
|
|
138
|
+
{ in: "query", key: "directory" },
|
|
139
|
+
],
|
|
140
|
+
},
|
|
141
|
+
]);
|
|
142
|
+
return (options?.client ?? this.client).get({
|
|
143
|
+
url: "/pty/{ptyID}",
|
|
144
|
+
...options,
|
|
145
|
+
...params,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Update PTY session
|
|
150
|
+
*
|
|
151
|
+
* Update properties of an existing pseudo-terminal (PTY) session.
|
|
152
|
+
*/
|
|
153
|
+
update(parameters, options) {
|
|
154
|
+
const params = buildClientParams([parameters], [
|
|
155
|
+
{
|
|
156
|
+
args: [
|
|
157
|
+
{ in: "path", key: "ptyID" },
|
|
158
|
+
{ in: "query", key: "directory" },
|
|
159
|
+
{ in: "body", key: "title" },
|
|
160
|
+
{ in: "body", key: "size" },
|
|
161
|
+
],
|
|
162
|
+
},
|
|
163
|
+
]);
|
|
164
|
+
return (options?.client ?? this.client).put({
|
|
165
|
+
url: "/pty/{ptyID}",
|
|
166
|
+
...options,
|
|
167
|
+
...params,
|
|
168
|
+
headers: {
|
|
169
|
+
"Content-Type": "application/json",
|
|
170
|
+
...options?.headers,
|
|
171
|
+
...params.headers,
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Connect to PTY session
|
|
177
|
+
*
|
|
178
|
+
* Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.
|
|
179
|
+
*/
|
|
180
|
+
connect(parameters, options) {
|
|
181
|
+
const params = buildClientParams([parameters], [
|
|
182
|
+
{
|
|
183
|
+
args: [
|
|
184
|
+
{ in: "path", key: "ptyID" },
|
|
185
|
+
{ in: "query", key: "directory" },
|
|
186
|
+
],
|
|
187
|
+
},
|
|
188
|
+
]);
|
|
189
|
+
return (options?.client ?? this.client).get({
|
|
190
|
+
url: "/pty/{ptyID}/connect",
|
|
191
|
+
...options,
|
|
192
|
+
...params,
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
export class Config extends HeyApiClient {
|
|
197
|
+
/**
|
|
198
|
+
* Get configuration
|
|
199
|
+
*
|
|
200
|
+
* Retrieve the current OpenCode configuration settings and preferences.
|
|
201
|
+
*/
|
|
202
|
+
get(parameters, options) {
|
|
203
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
204
|
+
return (options?.client ?? this.client).get({
|
|
205
|
+
url: "/config",
|
|
206
|
+
...options,
|
|
207
|
+
...params,
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Update configuration
|
|
212
|
+
*
|
|
213
|
+
* Update OpenCode configuration settings and preferences.
|
|
214
|
+
*/
|
|
215
|
+
update(parameters, options) {
|
|
216
|
+
const params = buildClientParams([parameters], [
|
|
217
|
+
{
|
|
218
|
+
args: [
|
|
219
|
+
{ in: "query", key: "directory" },
|
|
220
|
+
{ key: "config", map: "body" },
|
|
221
|
+
],
|
|
222
|
+
},
|
|
223
|
+
]);
|
|
224
|
+
return (options?.client ?? this.client).patch({
|
|
225
|
+
url: "/config",
|
|
226
|
+
...options,
|
|
227
|
+
...params,
|
|
228
|
+
headers: {
|
|
229
|
+
"Content-Type": "application/json",
|
|
230
|
+
...options?.headers,
|
|
231
|
+
...params.headers,
|
|
232
|
+
},
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* List config providers
|
|
237
|
+
*
|
|
238
|
+
* Get a list of all configured AI providers and their default models.
|
|
239
|
+
*/
|
|
240
|
+
providers(parameters, options) {
|
|
241
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
242
|
+
return (options?.client ?? this.client).get({
|
|
243
|
+
url: "/config/providers",
|
|
244
|
+
...options,
|
|
245
|
+
...params,
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
export class Tool extends HeyApiClient {
|
|
250
|
+
/**
|
|
251
|
+
* List tool IDs
|
|
252
|
+
*
|
|
253
|
+
* Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.
|
|
254
|
+
*/
|
|
255
|
+
ids(parameters, options) {
|
|
256
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
257
|
+
return (options?.client ?? this.client).get({
|
|
258
|
+
url: "/experimental/tool/ids",
|
|
259
|
+
...options,
|
|
260
|
+
...params,
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* List tools
|
|
265
|
+
*
|
|
266
|
+
* Get a list of available tools with their JSON schema parameters for a specific provider and model combination.
|
|
267
|
+
*/
|
|
268
|
+
list(parameters, options) {
|
|
269
|
+
const params = buildClientParams([parameters], [
|
|
270
|
+
{
|
|
271
|
+
args: [
|
|
272
|
+
{ in: "query", key: "directory" },
|
|
273
|
+
{ in: "query", key: "provider" },
|
|
274
|
+
{ in: "query", key: "model" },
|
|
275
|
+
],
|
|
276
|
+
},
|
|
277
|
+
]);
|
|
278
|
+
return (options?.client ?? this.client).get({
|
|
279
|
+
url: "/experimental/tool",
|
|
280
|
+
...options,
|
|
281
|
+
...params,
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
export class Instance extends HeyApiClient {
|
|
286
|
+
/**
|
|
287
|
+
* Dispose instance
|
|
288
|
+
*
|
|
289
|
+
* Clean up and dispose the current OpenCode instance, releasing all resources.
|
|
290
|
+
*/
|
|
291
|
+
dispose(parameters, options) {
|
|
292
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
293
|
+
return (options?.client ?? this.client).post({
|
|
294
|
+
url: "/instance/dispose",
|
|
295
|
+
...options,
|
|
296
|
+
...params,
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
export class Path extends HeyApiClient {
|
|
301
|
+
/**
|
|
302
|
+
* Get paths
|
|
303
|
+
*
|
|
304
|
+
* Retrieve the current working directory and related path information for the OpenCode instance.
|
|
305
|
+
*/
|
|
306
|
+
get(parameters, options) {
|
|
307
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
308
|
+
return (options?.client ?? this.client).get({
|
|
309
|
+
url: "/path",
|
|
310
|
+
...options,
|
|
311
|
+
...params,
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
export class Vcs extends HeyApiClient {
|
|
316
|
+
/**
|
|
317
|
+
* Get VCS info
|
|
318
|
+
*
|
|
319
|
+
* Retrieve version control system (VCS) information for the current project, such as git branch.
|
|
320
|
+
*/
|
|
321
|
+
get(parameters, options) {
|
|
322
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
323
|
+
return (options?.client ?? this.client).get({
|
|
324
|
+
url: "/vcs",
|
|
325
|
+
...options,
|
|
326
|
+
...params,
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
export class Session extends HeyApiClient {
|
|
331
|
+
/**
|
|
332
|
+
* List sessions
|
|
333
|
+
*
|
|
334
|
+
* Get a list of all OpenCode sessions, sorted by most recently updated.
|
|
335
|
+
*/
|
|
336
|
+
list(parameters, options) {
|
|
337
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
338
|
+
return (options?.client ?? this.client).get({
|
|
339
|
+
url: "/session",
|
|
340
|
+
...options,
|
|
341
|
+
...params,
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Create session
|
|
346
|
+
*
|
|
347
|
+
* Create a new OpenCode session for interacting with AI assistants and managing conversations.
|
|
348
|
+
*/
|
|
349
|
+
create(parameters, options) {
|
|
350
|
+
const params = buildClientParams([parameters], [
|
|
351
|
+
{
|
|
352
|
+
args: [
|
|
353
|
+
{ in: "query", key: "directory" },
|
|
354
|
+
{ in: "body", key: "parentID" },
|
|
355
|
+
{ in: "body", key: "title" },
|
|
356
|
+
],
|
|
357
|
+
},
|
|
358
|
+
]);
|
|
359
|
+
return (options?.client ?? this.client).post({
|
|
360
|
+
url: "/session",
|
|
361
|
+
...options,
|
|
362
|
+
...params,
|
|
363
|
+
headers: {
|
|
364
|
+
"Content-Type": "application/json",
|
|
365
|
+
...options?.headers,
|
|
366
|
+
...params.headers,
|
|
367
|
+
},
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Get session status
|
|
372
|
+
*
|
|
373
|
+
* Retrieve the current status of all sessions, including active, idle, and completed states.
|
|
374
|
+
*/
|
|
375
|
+
status(parameters, options) {
|
|
376
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
377
|
+
return (options?.client ?? this.client).get({
|
|
378
|
+
url: "/session/status",
|
|
379
|
+
...options,
|
|
380
|
+
...params,
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Delete session
|
|
385
|
+
*
|
|
386
|
+
* Delete a session and permanently remove all associated data, including messages and history.
|
|
387
|
+
*/
|
|
388
|
+
delete(parameters, options) {
|
|
389
|
+
const params = buildClientParams([parameters], [
|
|
390
|
+
{
|
|
391
|
+
args: [
|
|
392
|
+
{ in: "path", key: "sessionID" },
|
|
393
|
+
{ in: "query", key: "directory" },
|
|
394
|
+
],
|
|
395
|
+
},
|
|
396
|
+
]);
|
|
397
|
+
return (options?.client ?? this.client).delete({
|
|
398
|
+
url: "/session/{sessionID}",
|
|
399
|
+
...options,
|
|
400
|
+
...params,
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Get session
|
|
405
|
+
*
|
|
406
|
+
* Retrieve detailed information about a specific OpenCode session.
|
|
407
|
+
*/
|
|
408
|
+
get(parameters, options) {
|
|
409
|
+
const params = buildClientParams([parameters], [
|
|
410
|
+
{
|
|
411
|
+
args: [
|
|
412
|
+
{ in: "path", key: "sessionID" },
|
|
413
|
+
{ in: "query", key: "directory" },
|
|
414
|
+
],
|
|
415
|
+
},
|
|
416
|
+
]);
|
|
417
|
+
return (options?.client ?? this.client).get({
|
|
418
|
+
url: "/session/{sessionID}",
|
|
419
|
+
...options,
|
|
420
|
+
...params,
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Update session
|
|
425
|
+
*
|
|
426
|
+
* Update properties of an existing session, such as title or other metadata.
|
|
427
|
+
*/
|
|
428
|
+
update(parameters, options) {
|
|
429
|
+
const params = buildClientParams([parameters], [
|
|
430
|
+
{
|
|
431
|
+
args: [
|
|
432
|
+
{ in: "path", key: "sessionID" },
|
|
433
|
+
{ in: "query", key: "directory" },
|
|
434
|
+
{ in: "body", key: "title" },
|
|
435
|
+
],
|
|
436
|
+
},
|
|
437
|
+
]);
|
|
438
|
+
return (options?.client ?? this.client).patch({
|
|
439
|
+
url: "/session/{sessionID}",
|
|
440
|
+
...options,
|
|
441
|
+
...params,
|
|
442
|
+
headers: {
|
|
443
|
+
"Content-Type": "application/json",
|
|
444
|
+
...options?.headers,
|
|
445
|
+
...params.headers,
|
|
446
|
+
},
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Get session children
|
|
451
|
+
*
|
|
452
|
+
* Retrieve all child sessions that were forked from the specified parent session.
|
|
453
|
+
*/
|
|
454
|
+
children(parameters, options) {
|
|
455
|
+
const params = buildClientParams([parameters], [
|
|
456
|
+
{
|
|
457
|
+
args: [
|
|
458
|
+
{ in: "path", key: "sessionID" },
|
|
459
|
+
{ in: "query", key: "directory" },
|
|
460
|
+
],
|
|
461
|
+
},
|
|
462
|
+
]);
|
|
463
|
+
return (options?.client ?? this.client).get({
|
|
464
|
+
url: "/session/{sessionID}/children",
|
|
465
|
+
...options,
|
|
466
|
+
...params,
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Get session todos
|
|
471
|
+
*
|
|
472
|
+
* Retrieve the todo list associated with a specific session, showing tasks and action items.
|
|
473
|
+
*/
|
|
474
|
+
todo(parameters, options) {
|
|
475
|
+
const params = buildClientParams([parameters], [
|
|
476
|
+
{
|
|
477
|
+
args: [
|
|
478
|
+
{ in: "path", key: "sessionID" },
|
|
479
|
+
{ in: "query", key: "directory" },
|
|
480
|
+
],
|
|
481
|
+
},
|
|
482
|
+
]);
|
|
483
|
+
return (options?.client ?? this.client).get({
|
|
484
|
+
url: "/session/{sessionID}/todo",
|
|
485
|
+
...options,
|
|
486
|
+
...params,
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* Initialize session
|
|
491
|
+
*
|
|
492
|
+
* Analyze the current application and create an AGENTS.md file with project-specific agent configurations.
|
|
493
|
+
*/
|
|
494
|
+
init(parameters, options) {
|
|
495
|
+
const params = buildClientParams([parameters], [
|
|
496
|
+
{
|
|
497
|
+
args: [
|
|
498
|
+
{ in: "path", key: "sessionID" },
|
|
499
|
+
{ in: "query", key: "directory" },
|
|
500
|
+
{ in: "body", key: "modelID" },
|
|
501
|
+
{ in: "body", key: "providerID" },
|
|
502
|
+
{ in: "body", key: "messageID" },
|
|
503
|
+
],
|
|
504
|
+
},
|
|
505
|
+
]);
|
|
506
|
+
return (options?.client ?? this.client).post({
|
|
507
|
+
url: "/session/{sessionID}/init",
|
|
508
|
+
...options,
|
|
509
|
+
...params,
|
|
510
|
+
headers: {
|
|
511
|
+
"Content-Type": "application/json",
|
|
512
|
+
...options?.headers,
|
|
513
|
+
...params.headers,
|
|
514
|
+
},
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Fork session
|
|
519
|
+
*
|
|
520
|
+
* Create a new session by forking an existing session at a specific message point.
|
|
521
|
+
*/
|
|
522
|
+
fork(parameters, options) {
|
|
523
|
+
const params = buildClientParams([parameters], [
|
|
524
|
+
{
|
|
525
|
+
args: [
|
|
526
|
+
{ in: "path", key: "sessionID" },
|
|
527
|
+
{ in: "query", key: "directory" },
|
|
528
|
+
{ in: "body", key: "messageID" },
|
|
529
|
+
],
|
|
530
|
+
},
|
|
531
|
+
]);
|
|
532
|
+
return (options?.client ?? this.client).post({
|
|
533
|
+
url: "/session/{sessionID}/fork",
|
|
534
|
+
...options,
|
|
535
|
+
...params,
|
|
536
|
+
headers: {
|
|
537
|
+
"Content-Type": "application/json",
|
|
538
|
+
...options?.headers,
|
|
539
|
+
...params.headers,
|
|
540
|
+
},
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* Abort session
|
|
545
|
+
*
|
|
546
|
+
* Abort an active session and stop any ongoing AI processing or command execution.
|
|
547
|
+
*/
|
|
548
|
+
abort(parameters, options) {
|
|
549
|
+
const params = buildClientParams([parameters], [
|
|
550
|
+
{
|
|
551
|
+
args: [
|
|
552
|
+
{ in: "path", key: "sessionID" },
|
|
553
|
+
{ in: "query", key: "directory" },
|
|
554
|
+
],
|
|
555
|
+
},
|
|
556
|
+
]);
|
|
557
|
+
return (options?.client ?? this.client).post({
|
|
558
|
+
url: "/session/{sessionID}/abort",
|
|
559
|
+
...options,
|
|
560
|
+
...params,
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Unshare session
|
|
565
|
+
*
|
|
566
|
+
* Remove the shareable link for a session, making it private again.
|
|
567
|
+
*/
|
|
568
|
+
unshare(parameters, options) {
|
|
569
|
+
const params = buildClientParams([parameters], [
|
|
570
|
+
{
|
|
571
|
+
args: [
|
|
572
|
+
{ in: "path", key: "sessionID" },
|
|
573
|
+
{ in: "query", key: "directory" },
|
|
574
|
+
],
|
|
575
|
+
},
|
|
576
|
+
]);
|
|
577
|
+
return (options?.client ?? this.client).delete({
|
|
578
|
+
url: "/session/{sessionID}/share",
|
|
579
|
+
...options,
|
|
580
|
+
...params,
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* Share session
|
|
585
|
+
*
|
|
586
|
+
* Create a shareable link for a session, allowing others to view the conversation.
|
|
587
|
+
*/
|
|
588
|
+
share(parameters, options) {
|
|
589
|
+
const params = buildClientParams([parameters], [
|
|
590
|
+
{
|
|
591
|
+
args: [
|
|
592
|
+
{ in: "path", key: "sessionID" },
|
|
593
|
+
{ in: "query", key: "directory" },
|
|
594
|
+
],
|
|
595
|
+
},
|
|
596
|
+
]);
|
|
597
|
+
return (options?.client ?? this.client).post({
|
|
598
|
+
url: "/session/{sessionID}/share",
|
|
599
|
+
...options,
|
|
600
|
+
...params,
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* Get session diff
|
|
605
|
+
*
|
|
606
|
+
* Get all file changes (diffs) made during this session.
|
|
607
|
+
*/
|
|
608
|
+
diff(parameters, options) {
|
|
609
|
+
const params = buildClientParams([parameters], [
|
|
610
|
+
{
|
|
611
|
+
args: [
|
|
612
|
+
{ in: "path", key: "sessionID" },
|
|
613
|
+
{ in: "query", key: "directory" },
|
|
614
|
+
{ in: "query", key: "messageID" },
|
|
615
|
+
],
|
|
616
|
+
},
|
|
617
|
+
]);
|
|
618
|
+
return (options?.client ?? this.client).get({
|
|
619
|
+
url: "/session/{sessionID}/diff",
|
|
620
|
+
...options,
|
|
621
|
+
...params,
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* Summarize session
|
|
626
|
+
*
|
|
627
|
+
* Generate a concise summary of the session using AI compaction to preserve key information.
|
|
628
|
+
*/
|
|
629
|
+
summarize(parameters, options) {
|
|
630
|
+
const params = buildClientParams([parameters], [
|
|
631
|
+
{
|
|
632
|
+
args: [
|
|
633
|
+
{ in: "path", key: "sessionID" },
|
|
634
|
+
{ in: "query", key: "directory" },
|
|
635
|
+
{ in: "body", key: "providerID" },
|
|
636
|
+
{ in: "body", key: "modelID" },
|
|
637
|
+
],
|
|
638
|
+
},
|
|
639
|
+
]);
|
|
640
|
+
return (options?.client ?? this.client).post({
|
|
641
|
+
url: "/session/{sessionID}/summarize",
|
|
642
|
+
...options,
|
|
643
|
+
...params,
|
|
644
|
+
headers: {
|
|
645
|
+
"Content-Type": "application/json",
|
|
646
|
+
...options?.headers,
|
|
647
|
+
...params.headers,
|
|
648
|
+
},
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* Get session messages
|
|
653
|
+
*
|
|
654
|
+
* Retrieve all messages in a session, including user prompts and AI responses.
|
|
655
|
+
*/
|
|
656
|
+
messages(parameters, options) {
|
|
657
|
+
const params = buildClientParams([parameters], [
|
|
658
|
+
{
|
|
659
|
+
args: [
|
|
660
|
+
{ in: "path", key: "sessionID" },
|
|
661
|
+
{ in: "query", key: "directory" },
|
|
662
|
+
{ in: "query", key: "limit" },
|
|
663
|
+
],
|
|
664
|
+
},
|
|
665
|
+
]);
|
|
666
|
+
return (options?.client ?? this.client).get({
|
|
667
|
+
url: "/session/{sessionID}/message",
|
|
668
|
+
...options,
|
|
669
|
+
...params,
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
/**
|
|
673
|
+
* Send message
|
|
674
|
+
*
|
|
675
|
+
* Create and send a new message to a session, streaming the AI response.
|
|
676
|
+
*/
|
|
677
|
+
prompt(parameters, options) {
|
|
678
|
+
const params = buildClientParams([parameters], [
|
|
679
|
+
{
|
|
680
|
+
args: [
|
|
681
|
+
{ in: "path", key: "sessionID" },
|
|
682
|
+
{ in: "query", key: "directory" },
|
|
683
|
+
{ in: "body", key: "messageID" },
|
|
684
|
+
{ in: "body", key: "model" },
|
|
685
|
+
{ in: "body", key: "agent" },
|
|
686
|
+
{ in: "body", key: "noReply" },
|
|
687
|
+
{ in: "body", key: "system" },
|
|
688
|
+
{ in: "body", key: "tools" },
|
|
689
|
+
{ in: "body", key: "parts" },
|
|
690
|
+
],
|
|
691
|
+
},
|
|
692
|
+
]);
|
|
693
|
+
return (options?.client ?? this.client).post({
|
|
694
|
+
url: "/session/{sessionID}/message",
|
|
695
|
+
...options,
|
|
696
|
+
...params,
|
|
697
|
+
headers: {
|
|
698
|
+
"Content-Type": "application/json",
|
|
699
|
+
...options?.headers,
|
|
700
|
+
...params.headers,
|
|
701
|
+
},
|
|
702
|
+
});
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
* Get message
|
|
706
|
+
*
|
|
707
|
+
* Retrieve a specific message from a session by its message ID.
|
|
708
|
+
*/
|
|
709
|
+
message(parameters, options) {
|
|
710
|
+
const params = buildClientParams([parameters], [
|
|
711
|
+
{
|
|
712
|
+
args: [
|
|
713
|
+
{ in: "path", key: "sessionID" },
|
|
714
|
+
{ in: "path", key: "messageID" },
|
|
715
|
+
{ in: "query", key: "directory" },
|
|
716
|
+
],
|
|
717
|
+
},
|
|
718
|
+
]);
|
|
719
|
+
return (options?.client ?? this.client).get({
|
|
720
|
+
url: "/session/{sessionID}/message/{messageID}",
|
|
721
|
+
...options,
|
|
722
|
+
...params,
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
/**
|
|
726
|
+
* Send async message
|
|
727
|
+
*
|
|
728
|
+
* Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.
|
|
729
|
+
*/
|
|
730
|
+
promptAsync(parameters, options) {
|
|
731
|
+
const params = buildClientParams([parameters], [
|
|
732
|
+
{
|
|
733
|
+
args: [
|
|
734
|
+
{ in: "path", key: "sessionID" },
|
|
735
|
+
{ in: "query", key: "directory" },
|
|
736
|
+
{ in: "body", key: "messageID" },
|
|
737
|
+
{ in: "body", key: "model" },
|
|
738
|
+
{ in: "body", key: "agent" },
|
|
739
|
+
{ in: "body", key: "noReply" },
|
|
740
|
+
{ in: "body", key: "system" },
|
|
741
|
+
{ in: "body", key: "tools" },
|
|
742
|
+
{ in: "body", key: "parts" },
|
|
743
|
+
],
|
|
744
|
+
},
|
|
745
|
+
]);
|
|
746
|
+
return (options?.client ?? this.client).post({
|
|
747
|
+
url: "/session/{sessionID}/prompt_async",
|
|
748
|
+
...options,
|
|
749
|
+
...params,
|
|
750
|
+
headers: {
|
|
751
|
+
"Content-Type": "application/json",
|
|
752
|
+
...options?.headers,
|
|
753
|
+
...params.headers,
|
|
754
|
+
},
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* Send command
|
|
759
|
+
*
|
|
760
|
+
* Send a new command to a session for execution by the AI assistant.
|
|
761
|
+
*/
|
|
762
|
+
command(parameters, options) {
|
|
763
|
+
const params = buildClientParams([parameters], [
|
|
764
|
+
{
|
|
765
|
+
args: [
|
|
766
|
+
{ in: "path", key: "sessionID" },
|
|
767
|
+
{ in: "query", key: "directory" },
|
|
768
|
+
{ in: "body", key: "messageID" },
|
|
769
|
+
{ in: "body", key: "agent" },
|
|
770
|
+
{ in: "body", key: "model" },
|
|
771
|
+
{ in: "body", key: "arguments" },
|
|
772
|
+
{ in: "body", key: "command" },
|
|
773
|
+
],
|
|
774
|
+
},
|
|
775
|
+
]);
|
|
776
|
+
return (options?.client ?? this.client).post({
|
|
777
|
+
url: "/session/{sessionID}/command",
|
|
778
|
+
...options,
|
|
779
|
+
...params,
|
|
780
|
+
headers: {
|
|
781
|
+
"Content-Type": "application/json",
|
|
782
|
+
...options?.headers,
|
|
783
|
+
...params.headers,
|
|
784
|
+
},
|
|
785
|
+
});
|
|
786
|
+
}
|
|
787
|
+
/**
|
|
788
|
+
* Run shell command
|
|
789
|
+
*
|
|
790
|
+
* Execute a shell command within the session context and return the AI's response.
|
|
791
|
+
*/
|
|
792
|
+
shell(parameters, options) {
|
|
793
|
+
const params = buildClientParams([parameters], [
|
|
794
|
+
{
|
|
795
|
+
args: [
|
|
796
|
+
{ in: "path", key: "sessionID" },
|
|
797
|
+
{ in: "query", key: "directory" },
|
|
798
|
+
{ in: "body", key: "agent" },
|
|
799
|
+
{ in: "body", key: "model" },
|
|
800
|
+
{ in: "body", key: "command" },
|
|
801
|
+
],
|
|
802
|
+
},
|
|
803
|
+
]);
|
|
804
|
+
return (options?.client ?? this.client).post({
|
|
805
|
+
url: "/session/{sessionID}/shell",
|
|
806
|
+
...options,
|
|
807
|
+
...params,
|
|
808
|
+
headers: {
|
|
809
|
+
"Content-Type": "application/json",
|
|
810
|
+
...options?.headers,
|
|
811
|
+
...params.headers,
|
|
812
|
+
},
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
/**
|
|
816
|
+
* Revert message
|
|
817
|
+
*
|
|
818
|
+
* Revert a specific message in a session, undoing its effects and restoring the previous state.
|
|
819
|
+
*/
|
|
820
|
+
revert(parameters, options) {
|
|
821
|
+
const params = buildClientParams([parameters], [
|
|
822
|
+
{
|
|
823
|
+
args: [
|
|
824
|
+
{ in: "path", key: "sessionID" },
|
|
825
|
+
{ in: "query", key: "directory" },
|
|
826
|
+
{ in: "body", key: "messageID" },
|
|
827
|
+
{ in: "body", key: "partID" },
|
|
828
|
+
],
|
|
829
|
+
},
|
|
830
|
+
]);
|
|
831
|
+
return (options?.client ?? this.client).post({
|
|
832
|
+
url: "/session/{sessionID}/revert",
|
|
833
|
+
...options,
|
|
834
|
+
...params,
|
|
835
|
+
headers: {
|
|
836
|
+
"Content-Type": "application/json",
|
|
837
|
+
...options?.headers,
|
|
838
|
+
...params.headers,
|
|
839
|
+
},
|
|
840
|
+
});
|
|
841
|
+
}
|
|
842
|
+
/**
|
|
843
|
+
* Restore reverted messages
|
|
844
|
+
*
|
|
845
|
+
* Restore all previously reverted messages in a session.
|
|
846
|
+
*/
|
|
847
|
+
unrevert(parameters, options) {
|
|
848
|
+
const params = buildClientParams([parameters], [
|
|
849
|
+
{
|
|
850
|
+
args: [
|
|
851
|
+
{ in: "path", key: "sessionID" },
|
|
852
|
+
{ in: "query", key: "directory" },
|
|
853
|
+
],
|
|
854
|
+
},
|
|
855
|
+
]);
|
|
856
|
+
return (options?.client ?? this.client).post({
|
|
857
|
+
url: "/session/{sessionID}/unrevert",
|
|
858
|
+
...options,
|
|
859
|
+
...params,
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
export class Permission extends HeyApiClient {
|
|
864
|
+
/**
|
|
865
|
+
* Respond to permission
|
|
866
|
+
*
|
|
867
|
+
* Approve or deny a permission request from the AI assistant.
|
|
868
|
+
*/
|
|
869
|
+
respond(parameters, options) {
|
|
870
|
+
const params = buildClientParams([parameters], [
|
|
871
|
+
{
|
|
872
|
+
args: [
|
|
873
|
+
{ in: "path", key: "sessionID" },
|
|
874
|
+
{ in: "path", key: "permissionID" },
|
|
875
|
+
{ in: "query", key: "directory" },
|
|
876
|
+
{ in: "body", key: "response" },
|
|
877
|
+
],
|
|
878
|
+
},
|
|
879
|
+
]);
|
|
880
|
+
return (options?.client ?? this.client).post({
|
|
881
|
+
url: "/session/{sessionID}/permissions/{permissionID}",
|
|
882
|
+
...options,
|
|
883
|
+
...params,
|
|
884
|
+
headers: {
|
|
885
|
+
"Content-Type": "application/json",
|
|
886
|
+
...options?.headers,
|
|
887
|
+
...params.headers,
|
|
888
|
+
},
|
|
889
|
+
});
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
export class Command extends HeyApiClient {
|
|
893
|
+
/**
|
|
894
|
+
* List commands
|
|
895
|
+
*
|
|
896
|
+
* Get a list of all available commands in the OpenCode system.
|
|
897
|
+
*/
|
|
898
|
+
list(parameters, options) {
|
|
899
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
900
|
+
return (options?.client ?? this.client).get({
|
|
901
|
+
url: "/command",
|
|
902
|
+
...options,
|
|
903
|
+
...params,
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
export class Oauth extends HeyApiClient {
|
|
908
|
+
/**
|
|
909
|
+
* OAuth authorize
|
|
910
|
+
*
|
|
911
|
+
* Initiate OAuth authorization for a specific AI provider to get an authorization URL.
|
|
912
|
+
*/
|
|
913
|
+
authorize(parameters, options) {
|
|
914
|
+
const params = buildClientParams([parameters], [
|
|
915
|
+
{
|
|
916
|
+
args: [
|
|
917
|
+
{ in: "path", key: "providerID" },
|
|
918
|
+
{ in: "query", key: "directory" },
|
|
919
|
+
{ in: "body", key: "method" },
|
|
920
|
+
],
|
|
921
|
+
},
|
|
922
|
+
]);
|
|
923
|
+
return (options?.client ?? this.client).post({
|
|
924
|
+
url: "/provider/{providerID}/oauth/authorize",
|
|
925
|
+
...options,
|
|
926
|
+
...params,
|
|
927
|
+
headers: {
|
|
928
|
+
"Content-Type": "application/json",
|
|
929
|
+
...options?.headers,
|
|
930
|
+
...params.headers,
|
|
931
|
+
},
|
|
932
|
+
});
|
|
933
|
+
}
|
|
934
|
+
/**
|
|
935
|
+
* OAuth callback
|
|
936
|
+
*
|
|
937
|
+
* Handle the OAuth callback from a provider after user authorization.
|
|
938
|
+
*/
|
|
939
|
+
callback(parameters, options) {
|
|
940
|
+
const params = buildClientParams([parameters], [
|
|
941
|
+
{
|
|
942
|
+
args: [
|
|
943
|
+
{ in: "path", key: "providerID" },
|
|
944
|
+
{ in: "query", key: "directory" },
|
|
945
|
+
{ in: "body", key: "method" },
|
|
946
|
+
{ in: "body", key: "code" },
|
|
947
|
+
],
|
|
948
|
+
},
|
|
949
|
+
]);
|
|
950
|
+
return (options?.client ?? this.client).post({
|
|
951
|
+
url: "/provider/{providerID}/oauth/callback",
|
|
952
|
+
...options,
|
|
953
|
+
...params,
|
|
954
|
+
headers: {
|
|
955
|
+
"Content-Type": "application/json",
|
|
956
|
+
...options?.headers,
|
|
957
|
+
...params.headers,
|
|
958
|
+
},
|
|
959
|
+
});
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
export class Provider extends HeyApiClient {
|
|
963
|
+
/**
|
|
964
|
+
* List providers
|
|
965
|
+
*
|
|
966
|
+
* Get a list of all available AI providers, including both available and connected ones.
|
|
967
|
+
*/
|
|
968
|
+
list(parameters, options) {
|
|
969
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
970
|
+
return (options?.client ?? this.client).get({
|
|
971
|
+
url: "/provider",
|
|
972
|
+
...options,
|
|
973
|
+
...params,
|
|
974
|
+
});
|
|
975
|
+
}
|
|
976
|
+
/**
|
|
977
|
+
* Get provider auth methods
|
|
978
|
+
*
|
|
979
|
+
* Retrieve available authentication methods for all AI providers.
|
|
980
|
+
*/
|
|
981
|
+
auth(parameters, options) {
|
|
982
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
983
|
+
return (options?.client ?? this.client).get({
|
|
984
|
+
url: "/provider/auth",
|
|
985
|
+
...options,
|
|
986
|
+
...params,
|
|
987
|
+
});
|
|
988
|
+
}
|
|
989
|
+
oauth = new Oauth({ client: this.client });
|
|
990
|
+
}
|
|
991
|
+
export class Find extends HeyApiClient {
|
|
992
|
+
/**
|
|
993
|
+
* Find text
|
|
994
|
+
*
|
|
995
|
+
* Search for text patterns across files in the project using ripgrep.
|
|
996
|
+
*/
|
|
997
|
+
text(parameters, options) {
|
|
998
|
+
const params = buildClientParams([parameters], [
|
|
999
|
+
{
|
|
1000
|
+
args: [
|
|
1001
|
+
{ in: "query", key: "directory" },
|
|
1002
|
+
{ in: "query", key: "pattern" },
|
|
1003
|
+
],
|
|
1004
|
+
},
|
|
1005
|
+
]);
|
|
1006
|
+
return (options?.client ?? this.client).get({
|
|
1007
|
+
url: "/find",
|
|
1008
|
+
...options,
|
|
1009
|
+
...params,
|
|
1010
|
+
});
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* Find files
|
|
1014
|
+
*
|
|
1015
|
+
* Search for files by name or pattern in the project directory.
|
|
1016
|
+
*/
|
|
1017
|
+
files(parameters, options) {
|
|
1018
|
+
const params = buildClientParams([parameters], [
|
|
1019
|
+
{
|
|
1020
|
+
args: [
|
|
1021
|
+
{ in: "query", key: "directory" },
|
|
1022
|
+
{ in: "query", key: "query" },
|
|
1023
|
+
{ in: "query", key: "dirs" },
|
|
1024
|
+
],
|
|
1025
|
+
},
|
|
1026
|
+
]);
|
|
1027
|
+
return (options?.client ?? this.client).get({
|
|
1028
|
+
url: "/find/file",
|
|
1029
|
+
...options,
|
|
1030
|
+
...params,
|
|
1031
|
+
});
|
|
1032
|
+
}
|
|
1033
|
+
/**
|
|
1034
|
+
* Find symbols
|
|
1035
|
+
*
|
|
1036
|
+
* Search for workspace symbols like functions, classes, and variables using LSP.
|
|
1037
|
+
*/
|
|
1038
|
+
symbols(parameters, options) {
|
|
1039
|
+
const params = buildClientParams([parameters], [
|
|
1040
|
+
{
|
|
1041
|
+
args: [
|
|
1042
|
+
{ in: "query", key: "directory" },
|
|
1043
|
+
{ in: "query", key: "query" },
|
|
1044
|
+
],
|
|
1045
|
+
},
|
|
1046
|
+
]);
|
|
1047
|
+
return (options?.client ?? this.client).get({
|
|
1048
|
+
url: "/find/symbol",
|
|
1049
|
+
...options,
|
|
1050
|
+
...params,
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
export class File extends HeyApiClient {
|
|
1055
|
+
/**
|
|
1056
|
+
* List files
|
|
1057
|
+
*
|
|
1058
|
+
* List files and directories in a specified path.
|
|
1059
|
+
*/
|
|
1060
|
+
list(parameters, options) {
|
|
1061
|
+
const params = buildClientParams([parameters], [
|
|
1062
|
+
{
|
|
1063
|
+
args: [
|
|
1064
|
+
{ in: "query", key: "directory" },
|
|
1065
|
+
{ in: "query", key: "path" },
|
|
1066
|
+
],
|
|
1067
|
+
},
|
|
1068
|
+
]);
|
|
1069
|
+
return (options?.client ?? this.client).get({
|
|
1070
|
+
url: "/file",
|
|
1071
|
+
...options,
|
|
1072
|
+
...params,
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
/**
|
|
1076
|
+
* Read file
|
|
1077
|
+
*
|
|
1078
|
+
* Read the content of a specified file.
|
|
1079
|
+
*/
|
|
1080
|
+
read(parameters, options) {
|
|
1081
|
+
const params = buildClientParams([parameters], [
|
|
1082
|
+
{
|
|
1083
|
+
args: [
|
|
1084
|
+
{ in: "query", key: "directory" },
|
|
1085
|
+
{ in: "query", key: "path" },
|
|
1086
|
+
],
|
|
1087
|
+
},
|
|
1088
|
+
]);
|
|
1089
|
+
return (options?.client ?? this.client).get({
|
|
1090
|
+
url: "/file/content",
|
|
1091
|
+
...options,
|
|
1092
|
+
...params,
|
|
1093
|
+
});
|
|
1094
|
+
}
|
|
1095
|
+
/**
|
|
1096
|
+
* Get file status
|
|
1097
|
+
*
|
|
1098
|
+
* Get the git status of all files in the project.
|
|
1099
|
+
*/
|
|
1100
|
+
status(parameters, options) {
|
|
1101
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
1102
|
+
return (options?.client ?? this.client).get({
|
|
1103
|
+
url: "/file/status",
|
|
1104
|
+
...options,
|
|
1105
|
+
...params,
|
|
1106
|
+
});
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
export class App extends HeyApiClient {
|
|
1110
|
+
/**
|
|
1111
|
+
* Write log
|
|
1112
|
+
*
|
|
1113
|
+
* Write a log entry to the server logs with specified level and metadata.
|
|
1114
|
+
*/
|
|
1115
|
+
log(parameters, options) {
|
|
1116
|
+
const params = buildClientParams([parameters], [
|
|
1117
|
+
{
|
|
1118
|
+
args: [
|
|
1119
|
+
{ in: "query", key: "directory" },
|
|
1120
|
+
{ in: "body", key: "service" },
|
|
1121
|
+
{ in: "body", key: "level" },
|
|
1122
|
+
{ in: "body", key: "message" },
|
|
1123
|
+
{ in: "body", key: "extra" },
|
|
1124
|
+
],
|
|
1125
|
+
},
|
|
1126
|
+
]);
|
|
1127
|
+
return (options?.client ?? this.client).post({
|
|
1128
|
+
url: "/log",
|
|
1129
|
+
...options,
|
|
1130
|
+
...params,
|
|
1131
|
+
headers: {
|
|
1132
|
+
"Content-Type": "application/json",
|
|
1133
|
+
...options?.headers,
|
|
1134
|
+
...params.headers,
|
|
1135
|
+
},
|
|
1136
|
+
});
|
|
1137
|
+
}
|
|
1138
|
+
/**
|
|
1139
|
+
* List agents
|
|
1140
|
+
*
|
|
1141
|
+
* Get a list of all available AI agents in the OpenCode system.
|
|
1142
|
+
*/
|
|
1143
|
+
agents(parameters, options) {
|
|
1144
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
1145
|
+
return (options?.client ?? this.client).get({
|
|
1146
|
+
url: "/agent",
|
|
1147
|
+
...options,
|
|
1148
|
+
...params,
|
|
1149
|
+
});
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
export class Auth extends HeyApiClient {
|
|
1153
|
+
/**
|
|
1154
|
+
* Remove MCP OAuth
|
|
1155
|
+
*
|
|
1156
|
+
* Remove OAuth credentials for an MCP server
|
|
1157
|
+
*/
|
|
1158
|
+
remove(parameters, options) {
|
|
1159
|
+
const params = buildClientParams([parameters], [
|
|
1160
|
+
{
|
|
1161
|
+
args: [
|
|
1162
|
+
{ in: "path", key: "name" },
|
|
1163
|
+
{ in: "query", key: "directory" },
|
|
1164
|
+
],
|
|
1165
|
+
},
|
|
1166
|
+
]);
|
|
1167
|
+
return (options?.client ?? this.client).delete({
|
|
1168
|
+
url: "/mcp/{name}/auth",
|
|
1169
|
+
...options,
|
|
1170
|
+
...params,
|
|
1171
|
+
});
|
|
1172
|
+
}
|
|
1173
|
+
/**
|
|
1174
|
+
* Start MCP OAuth
|
|
1175
|
+
*
|
|
1176
|
+
* Start OAuth authentication flow for a Model Context Protocol (MCP) server.
|
|
1177
|
+
*/
|
|
1178
|
+
start(parameters, options) {
|
|
1179
|
+
const params = buildClientParams([parameters], [
|
|
1180
|
+
{
|
|
1181
|
+
args: [
|
|
1182
|
+
{ in: "path", key: "name" },
|
|
1183
|
+
{ in: "query", key: "directory" },
|
|
1184
|
+
],
|
|
1185
|
+
},
|
|
1186
|
+
]);
|
|
1187
|
+
return (options?.client ?? this.client).post({
|
|
1188
|
+
url: "/mcp/{name}/auth",
|
|
1189
|
+
...options,
|
|
1190
|
+
...params,
|
|
1191
|
+
});
|
|
1192
|
+
}
|
|
1193
|
+
/**
|
|
1194
|
+
* Complete MCP OAuth
|
|
1195
|
+
*
|
|
1196
|
+
* Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.
|
|
1197
|
+
*/
|
|
1198
|
+
callback(parameters, options) {
|
|
1199
|
+
const params = buildClientParams([parameters], [
|
|
1200
|
+
{
|
|
1201
|
+
args: [
|
|
1202
|
+
{ in: "path", key: "name" },
|
|
1203
|
+
{ in: "query", key: "directory" },
|
|
1204
|
+
{ in: "body", key: "code" },
|
|
1205
|
+
],
|
|
1206
|
+
},
|
|
1207
|
+
]);
|
|
1208
|
+
return (options?.client ?? this.client).post({
|
|
1209
|
+
url: "/mcp/{name}/auth/callback",
|
|
1210
|
+
...options,
|
|
1211
|
+
...params,
|
|
1212
|
+
headers: {
|
|
1213
|
+
"Content-Type": "application/json",
|
|
1214
|
+
...options?.headers,
|
|
1215
|
+
...params.headers,
|
|
1216
|
+
},
|
|
1217
|
+
});
|
|
1218
|
+
}
|
|
1219
|
+
/**
|
|
1220
|
+
* Authenticate MCP OAuth
|
|
1221
|
+
*
|
|
1222
|
+
* Start OAuth flow and wait for callback (opens browser)
|
|
1223
|
+
*/
|
|
1224
|
+
authenticate(parameters, options) {
|
|
1225
|
+
const params = buildClientParams([parameters], [
|
|
1226
|
+
{
|
|
1227
|
+
args: [
|
|
1228
|
+
{ in: "path", key: "name" },
|
|
1229
|
+
{ in: "query", key: "directory" },
|
|
1230
|
+
],
|
|
1231
|
+
},
|
|
1232
|
+
]);
|
|
1233
|
+
return (options?.client ?? this.client).post({
|
|
1234
|
+
url: "/mcp/{name}/auth/authenticate",
|
|
1235
|
+
...options,
|
|
1236
|
+
...params,
|
|
1237
|
+
});
|
|
1238
|
+
}
|
|
1239
|
+
/**
|
|
1240
|
+
* Set auth credentials
|
|
1241
|
+
*
|
|
1242
|
+
* Set authentication credentials
|
|
1243
|
+
*/
|
|
1244
|
+
set(parameters, options) {
|
|
1245
|
+
const params = buildClientParams([parameters], [
|
|
1246
|
+
{
|
|
1247
|
+
args: [
|
|
1248
|
+
{ in: "path", key: "providerID" },
|
|
1249
|
+
{ in: "query", key: "directory" },
|
|
1250
|
+
{ key: "auth", map: "body" },
|
|
1251
|
+
],
|
|
1252
|
+
},
|
|
1253
|
+
]);
|
|
1254
|
+
return (options?.client ?? this.client).put({
|
|
1255
|
+
url: "/auth/{providerID}",
|
|
1256
|
+
...options,
|
|
1257
|
+
...params,
|
|
1258
|
+
headers: {
|
|
1259
|
+
"Content-Type": "application/json",
|
|
1260
|
+
...options?.headers,
|
|
1261
|
+
...params.headers,
|
|
1262
|
+
},
|
|
1263
|
+
});
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
export class Mcp extends HeyApiClient {
|
|
1267
|
+
/**
|
|
1268
|
+
* Get MCP status
|
|
1269
|
+
*
|
|
1270
|
+
* Get the status of all Model Context Protocol (MCP) servers.
|
|
1271
|
+
*/
|
|
1272
|
+
status(parameters, options) {
|
|
1273
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
1274
|
+
return (options?.client ?? this.client).get({
|
|
1275
|
+
url: "/mcp",
|
|
1276
|
+
...options,
|
|
1277
|
+
...params,
|
|
1278
|
+
});
|
|
1279
|
+
}
|
|
1280
|
+
/**
|
|
1281
|
+
* Add MCP server
|
|
1282
|
+
*
|
|
1283
|
+
* Dynamically add a new Model Context Protocol (MCP) server to the system.
|
|
1284
|
+
*/
|
|
1285
|
+
add(parameters, options) {
|
|
1286
|
+
const params = buildClientParams([parameters], [
|
|
1287
|
+
{
|
|
1288
|
+
args: [
|
|
1289
|
+
{ in: "query", key: "directory" },
|
|
1290
|
+
{ in: "body", key: "name" },
|
|
1291
|
+
{ in: "body", key: "config" },
|
|
1292
|
+
],
|
|
1293
|
+
},
|
|
1294
|
+
]);
|
|
1295
|
+
return (options?.client ?? this.client).post({
|
|
1296
|
+
url: "/mcp",
|
|
1297
|
+
...options,
|
|
1298
|
+
...params,
|
|
1299
|
+
headers: {
|
|
1300
|
+
"Content-Type": "application/json",
|
|
1301
|
+
...options?.headers,
|
|
1302
|
+
...params.headers,
|
|
1303
|
+
},
|
|
1304
|
+
});
|
|
1305
|
+
}
|
|
1306
|
+
/**
|
|
1307
|
+
* Connect an MCP server
|
|
1308
|
+
*/
|
|
1309
|
+
connect(parameters, options) {
|
|
1310
|
+
const params = buildClientParams([parameters], [
|
|
1311
|
+
{
|
|
1312
|
+
args: [
|
|
1313
|
+
{ in: "path", key: "name" },
|
|
1314
|
+
{ in: "query", key: "directory" },
|
|
1315
|
+
],
|
|
1316
|
+
},
|
|
1317
|
+
]);
|
|
1318
|
+
return (options?.client ?? this.client).post({
|
|
1319
|
+
url: "/mcp/{name}/connect",
|
|
1320
|
+
...options,
|
|
1321
|
+
...params,
|
|
1322
|
+
});
|
|
1323
|
+
}
|
|
1324
|
+
/**
|
|
1325
|
+
* Disconnect an MCP server
|
|
1326
|
+
*/
|
|
1327
|
+
disconnect(parameters, options) {
|
|
1328
|
+
const params = buildClientParams([parameters], [
|
|
1329
|
+
{
|
|
1330
|
+
args: [
|
|
1331
|
+
{ in: "path", key: "name" },
|
|
1332
|
+
{ in: "query", key: "directory" },
|
|
1333
|
+
],
|
|
1334
|
+
},
|
|
1335
|
+
]);
|
|
1336
|
+
return (options?.client ?? this.client).post({
|
|
1337
|
+
url: "/mcp/{name}/disconnect",
|
|
1338
|
+
...options,
|
|
1339
|
+
...params,
|
|
1340
|
+
});
|
|
1341
|
+
}
|
|
1342
|
+
auth = new Auth({ client: this.client });
|
|
1343
|
+
}
|
|
1344
|
+
export class Lsp extends HeyApiClient {
|
|
1345
|
+
/**
|
|
1346
|
+
* Get LSP status
|
|
1347
|
+
*
|
|
1348
|
+
* Get LSP server status
|
|
1349
|
+
*/
|
|
1350
|
+
status(parameters, options) {
|
|
1351
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
1352
|
+
return (options?.client ?? this.client).get({
|
|
1353
|
+
url: "/lsp",
|
|
1354
|
+
...options,
|
|
1355
|
+
...params,
|
|
1356
|
+
});
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
export class Formatter extends HeyApiClient {
|
|
1360
|
+
/**
|
|
1361
|
+
* Get formatter status
|
|
1362
|
+
*
|
|
1363
|
+
* Get formatter status
|
|
1364
|
+
*/
|
|
1365
|
+
status(parameters, options) {
|
|
1366
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
1367
|
+
return (options?.client ?? this.client).get({
|
|
1368
|
+
url: "/formatter",
|
|
1369
|
+
...options,
|
|
1370
|
+
...params,
|
|
1371
|
+
});
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
export class Control extends HeyApiClient {
|
|
1375
|
+
/**
|
|
1376
|
+
* Get next TUI request
|
|
1377
|
+
*
|
|
1378
|
+
* Retrieve the next TUI (Terminal User Interface) request from the queue for processing.
|
|
1379
|
+
*/
|
|
1380
|
+
next(parameters, options) {
|
|
1381
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
1382
|
+
return (options?.client ?? this.client).get({
|
|
1383
|
+
url: "/tui/control/next",
|
|
1384
|
+
...options,
|
|
1385
|
+
...params,
|
|
1386
|
+
});
|
|
1387
|
+
}
|
|
1388
|
+
/**
|
|
1389
|
+
* Submit TUI response
|
|
1390
|
+
*
|
|
1391
|
+
* Submit a response to the TUI request queue to complete a pending request.
|
|
1392
|
+
*/
|
|
1393
|
+
response(parameters, options) {
|
|
1394
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }, { in: "body" }] }]);
|
|
1395
|
+
return (options?.client ?? this.client).post({
|
|
1396
|
+
url: "/tui/control/response",
|
|
1397
|
+
...options,
|
|
1398
|
+
...params,
|
|
1399
|
+
headers: {
|
|
1400
|
+
"Content-Type": "application/json",
|
|
1401
|
+
...options?.headers,
|
|
1402
|
+
...params.headers,
|
|
1403
|
+
},
|
|
1404
|
+
});
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
export class Tui extends HeyApiClient {
|
|
1408
|
+
/**
|
|
1409
|
+
* Append TUI prompt
|
|
1410
|
+
*
|
|
1411
|
+
* Append prompt to the TUI
|
|
1412
|
+
*/
|
|
1413
|
+
appendPrompt(parameters, options) {
|
|
1414
|
+
const params = buildClientParams([parameters], [
|
|
1415
|
+
{
|
|
1416
|
+
args: [
|
|
1417
|
+
{ in: "query", key: "directory" },
|
|
1418
|
+
{ in: "body", key: "text" },
|
|
1419
|
+
],
|
|
1420
|
+
},
|
|
1421
|
+
]);
|
|
1422
|
+
return (options?.client ?? this.client).post({
|
|
1423
|
+
url: "/tui/append-prompt",
|
|
1424
|
+
...options,
|
|
1425
|
+
...params,
|
|
1426
|
+
headers: {
|
|
1427
|
+
"Content-Type": "application/json",
|
|
1428
|
+
...options?.headers,
|
|
1429
|
+
...params.headers,
|
|
1430
|
+
},
|
|
1431
|
+
});
|
|
1432
|
+
}
|
|
1433
|
+
/**
|
|
1434
|
+
* Open help dialog
|
|
1435
|
+
*
|
|
1436
|
+
* Open the help dialog in the TUI to display user assistance information.
|
|
1437
|
+
*/
|
|
1438
|
+
openHelp(parameters, options) {
|
|
1439
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
1440
|
+
return (options?.client ?? this.client).post({
|
|
1441
|
+
url: "/tui/open-help",
|
|
1442
|
+
...options,
|
|
1443
|
+
...params,
|
|
1444
|
+
});
|
|
1445
|
+
}
|
|
1446
|
+
/**
|
|
1447
|
+
* Open sessions dialog
|
|
1448
|
+
*
|
|
1449
|
+
* Open the session dialog
|
|
1450
|
+
*/
|
|
1451
|
+
openSessions(parameters, options) {
|
|
1452
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
1453
|
+
return (options?.client ?? this.client).post({
|
|
1454
|
+
url: "/tui/open-sessions",
|
|
1455
|
+
...options,
|
|
1456
|
+
...params,
|
|
1457
|
+
});
|
|
1458
|
+
}
|
|
1459
|
+
/**
|
|
1460
|
+
* Open themes dialog
|
|
1461
|
+
*
|
|
1462
|
+
* Open the theme dialog
|
|
1463
|
+
*/
|
|
1464
|
+
openThemes(parameters, options) {
|
|
1465
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
1466
|
+
return (options?.client ?? this.client).post({
|
|
1467
|
+
url: "/tui/open-themes",
|
|
1468
|
+
...options,
|
|
1469
|
+
...params,
|
|
1470
|
+
});
|
|
1471
|
+
}
|
|
1472
|
+
/**
|
|
1473
|
+
* Open models dialog
|
|
1474
|
+
*
|
|
1475
|
+
* Open the model dialog
|
|
1476
|
+
*/
|
|
1477
|
+
openModels(parameters, options) {
|
|
1478
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
1479
|
+
return (options?.client ?? this.client).post({
|
|
1480
|
+
url: "/tui/open-models",
|
|
1481
|
+
...options,
|
|
1482
|
+
...params,
|
|
1483
|
+
});
|
|
1484
|
+
}
|
|
1485
|
+
/**
|
|
1486
|
+
* Submit TUI prompt
|
|
1487
|
+
*
|
|
1488
|
+
* Submit the prompt
|
|
1489
|
+
*/
|
|
1490
|
+
submitPrompt(parameters, options) {
|
|
1491
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
1492
|
+
return (options?.client ?? this.client).post({
|
|
1493
|
+
url: "/tui/submit-prompt",
|
|
1494
|
+
...options,
|
|
1495
|
+
...params,
|
|
1496
|
+
});
|
|
1497
|
+
}
|
|
1498
|
+
/**
|
|
1499
|
+
* Clear TUI prompt
|
|
1500
|
+
*
|
|
1501
|
+
* Clear the prompt
|
|
1502
|
+
*/
|
|
1503
|
+
clearPrompt(parameters, options) {
|
|
1504
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
1505
|
+
return (options?.client ?? this.client).post({
|
|
1506
|
+
url: "/tui/clear-prompt",
|
|
1507
|
+
...options,
|
|
1508
|
+
...params,
|
|
1509
|
+
});
|
|
1510
|
+
}
|
|
1511
|
+
/**
|
|
1512
|
+
* Execute TUI command
|
|
1513
|
+
*
|
|
1514
|
+
* Execute a TUI command (e.g. agent_cycle)
|
|
1515
|
+
*/
|
|
1516
|
+
executeCommand(parameters, options) {
|
|
1517
|
+
const params = buildClientParams([parameters], [
|
|
1518
|
+
{
|
|
1519
|
+
args: [
|
|
1520
|
+
{ in: "query", key: "directory" },
|
|
1521
|
+
{ in: "body", key: "command" },
|
|
1522
|
+
],
|
|
1523
|
+
},
|
|
1524
|
+
]);
|
|
1525
|
+
return (options?.client ?? this.client).post({
|
|
1526
|
+
url: "/tui/execute-command",
|
|
1527
|
+
...options,
|
|
1528
|
+
...params,
|
|
1529
|
+
headers: {
|
|
1530
|
+
"Content-Type": "application/json",
|
|
1531
|
+
...options?.headers,
|
|
1532
|
+
...params.headers,
|
|
1533
|
+
},
|
|
1534
|
+
});
|
|
1535
|
+
}
|
|
1536
|
+
/**
|
|
1537
|
+
* Show TUI toast
|
|
1538
|
+
*
|
|
1539
|
+
* Show a toast notification in the TUI
|
|
1540
|
+
*/
|
|
1541
|
+
showToast(parameters, options) {
|
|
1542
|
+
const params = buildClientParams([parameters], [
|
|
1543
|
+
{
|
|
1544
|
+
args: [
|
|
1545
|
+
{ in: "query", key: "directory" },
|
|
1546
|
+
{ in: "body", key: "title" },
|
|
1547
|
+
{ in: "body", key: "message" },
|
|
1548
|
+
{ in: "body", key: "variant" },
|
|
1549
|
+
{ in: "body", key: "duration" },
|
|
1550
|
+
],
|
|
1551
|
+
},
|
|
1552
|
+
]);
|
|
1553
|
+
return (options?.client ?? this.client).post({
|
|
1554
|
+
url: "/tui/show-toast",
|
|
1555
|
+
...options,
|
|
1556
|
+
...params,
|
|
1557
|
+
headers: {
|
|
1558
|
+
"Content-Type": "application/json",
|
|
1559
|
+
...options?.headers,
|
|
1560
|
+
...params.headers,
|
|
1561
|
+
},
|
|
1562
|
+
});
|
|
1563
|
+
}
|
|
1564
|
+
/**
|
|
1565
|
+
* Publish TUI event
|
|
1566
|
+
*
|
|
1567
|
+
* Publish a TUI event
|
|
1568
|
+
*/
|
|
1569
|
+
publish(parameters, options) {
|
|
1570
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }, { in: "body" }] }]);
|
|
1571
|
+
return (options?.client ?? this.client).post({
|
|
1572
|
+
url: "/tui/publish",
|
|
1573
|
+
...options,
|
|
1574
|
+
...params,
|
|
1575
|
+
headers: {
|
|
1576
|
+
"Content-Type": "application/json",
|
|
1577
|
+
...options?.headers,
|
|
1578
|
+
...params.headers,
|
|
1579
|
+
},
|
|
1580
|
+
});
|
|
1581
|
+
}
|
|
1582
|
+
control = new Control({ client: this.client });
|
|
1583
|
+
}
|
|
1584
|
+
export class Event extends HeyApiClient {
|
|
1585
|
+
/**
|
|
1586
|
+
* Subscribe to events
|
|
1587
|
+
*
|
|
1588
|
+
* Get events
|
|
1589
|
+
*/
|
|
1590
|
+
subscribe(parameters, options) {
|
|
1591
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }]);
|
|
1592
|
+
return (options?.client ?? this.client).sse.get({
|
|
1593
|
+
url: "/event",
|
|
1594
|
+
...options,
|
|
1595
|
+
...params,
|
|
1596
|
+
});
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
export class OpencodeClient extends HeyApiClient {
|
|
1600
|
+
static __registry = new HeyApiRegistry();
|
|
1601
|
+
constructor(args) {
|
|
1602
|
+
super(args);
|
|
1603
|
+
OpencodeClient.__registry.set(this, args?.key);
|
|
1604
|
+
}
|
|
1605
|
+
global = new Global({ client: this.client });
|
|
1606
|
+
project = new Project({ client: this.client });
|
|
1607
|
+
pty = new Pty({ client: this.client });
|
|
1608
|
+
config = new Config({ client: this.client });
|
|
1609
|
+
tool = new Tool({ client: this.client });
|
|
1610
|
+
instance = new Instance({ client: this.client });
|
|
1611
|
+
path = new Path({ client: this.client });
|
|
1612
|
+
vcs = new Vcs({ client: this.client });
|
|
1613
|
+
session = new Session({ client: this.client });
|
|
1614
|
+
permission = new Permission({ client: this.client });
|
|
1615
|
+
command = new Command({ client: this.client });
|
|
1616
|
+
provider = new Provider({ client: this.client });
|
|
1617
|
+
find = new Find({ client: this.client });
|
|
1618
|
+
file = new File({ client: this.client });
|
|
1619
|
+
app = new App({ client: this.client });
|
|
1620
|
+
mcp = new Mcp({ client: this.client });
|
|
1621
|
+
lsp = new Lsp({ client: this.client });
|
|
1622
|
+
formatter = new Formatter({ client: this.client });
|
|
1623
|
+
tui = new Tui({ client: this.client });
|
|
1624
|
+
auth = new Auth({ client: this.client });
|
|
1625
|
+
event = new Event({ client: this.client });
|
|
1626
|
+
}
|