@opencode-ai/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.
Files changed (42) hide show
  1. package/dist/gen/client/client.d.ts +2 -0
  2. package/dist/gen/client/client.js +145 -0
  3. package/dist/gen/client/index.d.ts +7 -0
  4. package/dist/gen/client/index.js +4 -0
  5. package/dist/gen/client/types.d.ts +119 -0
  6. package/dist/gen/client/types.js +0 -0
  7. package/dist/gen/client/utils.d.ts +45 -0
  8. package/dist/gen/client/utils.js +284 -0
  9. package/dist/gen/client.gen.d.ts +12 -0
  10. package/dist/gen/client.gen.js +5 -0
  11. package/dist/gen/core/auth.d.ts +18 -0
  12. package/dist/gen/core/auth.js +13 -0
  13. package/dist/gen/core/bodySerializer.d.ts +17 -0
  14. package/dist/gen/core/bodySerializer.js +53 -0
  15. package/dist/gen/core/params.d.ts +33 -0
  16. package/dist/gen/core/params.js +87 -0
  17. package/dist/gen/core/pathSerializer.d.ts +33 -0
  18. package/dist/gen/core/pathSerializer.js +113 -0
  19. package/dist/gen/core/types.d.ts +78 -0
  20. package/dist/gen/core/types.js +0 -0
  21. package/dist/gen/sdk.gen.d.ts +149 -0
  22. package/dist/gen/sdk.gen.js +291 -0
  23. package/dist/gen/types.gen.d.ts +1308 -0
  24. package/dist/gen/types.gen.js +1 -0
  25. package/dist/index.d.ts +3 -0
  26. package/dist/index.js +6 -0
  27. package/dist/script/generate.js +31 -0
  28. package/dist/script/publish.js +4 -0
  29. package/dist/src/gen/client/client.js +145 -0
  30. package/dist/src/gen/client/index.js +4 -0
  31. package/dist/src/gen/client/types.js +0 -0
  32. package/dist/src/gen/client/utils.js +284 -0
  33. package/dist/src/gen/client.gen.js +5 -0
  34. package/dist/src/gen/core/auth.js +13 -0
  35. package/dist/src/gen/core/bodySerializer.js +53 -0
  36. package/dist/src/gen/core/params.js +87 -0
  37. package/dist/src/gen/core/pathSerializer.js +113 -0
  38. package/dist/src/gen/core/types.js +0 -0
  39. package/dist/src/gen/sdk.gen.js +291 -0
  40. package/dist/src/gen/types.gen.js +1 -0
  41. package/dist/src/index.js +6 -0
  42. package/package.json +17 -0
@@ -0,0 +1,291 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ import { client as _heyApiClient } from './client.gen';
3
+ class _HeyApiClient {
4
+ _client = _heyApiClient;
5
+ constructor(args) {
6
+ if (args?.client) {
7
+ this._client = args.client;
8
+ }
9
+ }
10
+ }
11
+ class Event extends _HeyApiClient {
12
+ /**
13
+ * Get events
14
+ */
15
+ subscribe(options) {
16
+ return (options?.client ?? this._client).get({
17
+ url: '/event',
18
+ ...options
19
+ });
20
+ }
21
+ }
22
+ class App extends _HeyApiClient {
23
+ /**
24
+ * Get app info
25
+ */
26
+ get(options) {
27
+ return (options?.client ?? this._client).get({
28
+ url: '/app',
29
+ ...options
30
+ });
31
+ }
32
+ /**
33
+ * Initialize the app
34
+ */
35
+ init(options) {
36
+ return (options?.client ?? this._client).post({
37
+ url: '/app/init',
38
+ ...options
39
+ });
40
+ }
41
+ /**
42
+ * Write a log entry to the server logs
43
+ */
44
+ log(options) {
45
+ return (options?.client ?? this._client).post({
46
+ url: '/log',
47
+ ...options,
48
+ headers: {
49
+ 'Content-Type': 'application/json',
50
+ ...options?.headers
51
+ }
52
+ });
53
+ }
54
+ /**
55
+ * List all modes
56
+ */
57
+ modes(options) {
58
+ return (options?.client ?? this._client).get({
59
+ url: '/mode',
60
+ ...options
61
+ });
62
+ }
63
+ }
64
+ class Config extends _HeyApiClient {
65
+ /**
66
+ * Get config info
67
+ */
68
+ get(options) {
69
+ return (options?.client ?? this._client).get({
70
+ url: '/config',
71
+ ...options
72
+ });
73
+ }
74
+ /**
75
+ * List all providers
76
+ */
77
+ providers(options) {
78
+ return (options?.client ?? this._client).get({
79
+ url: '/config/providers',
80
+ ...options
81
+ });
82
+ }
83
+ }
84
+ class Session extends _HeyApiClient {
85
+ /**
86
+ * List all sessions
87
+ */
88
+ list(options) {
89
+ return (options?.client ?? this._client).get({
90
+ url: '/session',
91
+ ...options
92
+ });
93
+ }
94
+ /**
95
+ * Create a new session
96
+ */
97
+ create(options) {
98
+ return (options?.client ?? this._client).post({
99
+ url: '/session',
100
+ ...options
101
+ });
102
+ }
103
+ /**
104
+ * Delete a session and all its data
105
+ */
106
+ delete(options) {
107
+ return (options.client ?? this._client).delete({
108
+ url: '/session/{id}',
109
+ ...options
110
+ });
111
+ }
112
+ /**
113
+ * Analyze the app and create an AGENTS.md file
114
+ */
115
+ init(options) {
116
+ return (options.client ?? this._client).post({
117
+ url: '/session/{id}/init',
118
+ ...options,
119
+ headers: {
120
+ 'Content-Type': 'application/json',
121
+ ...options.headers
122
+ }
123
+ });
124
+ }
125
+ /**
126
+ * Abort a session
127
+ */
128
+ abort(options) {
129
+ return (options.client ?? this._client).post({
130
+ url: '/session/{id}/abort',
131
+ ...options
132
+ });
133
+ }
134
+ /**
135
+ * Unshare the session
136
+ */
137
+ unshare(options) {
138
+ return (options.client ?? this._client).delete({
139
+ url: '/session/{id}/share',
140
+ ...options
141
+ });
142
+ }
143
+ /**
144
+ * Share a session
145
+ */
146
+ share(options) {
147
+ return (options.client ?? this._client).post({
148
+ url: '/session/{id}/share',
149
+ ...options
150
+ });
151
+ }
152
+ /**
153
+ * Summarize the session
154
+ */
155
+ summarize(options) {
156
+ return (options.client ?? this._client).post({
157
+ url: '/session/{id}/summarize',
158
+ ...options,
159
+ headers: {
160
+ 'Content-Type': 'application/json',
161
+ ...options.headers
162
+ }
163
+ });
164
+ }
165
+ /**
166
+ * List messages for a session
167
+ */
168
+ messages(options) {
169
+ return (options.client ?? this._client).get({
170
+ url: '/session/{id}/message',
171
+ ...options
172
+ });
173
+ }
174
+ /**
175
+ * Create and send a new message to a session
176
+ */
177
+ chat(options) {
178
+ return (options.client ?? this._client).post({
179
+ url: '/session/{id}/message',
180
+ ...options,
181
+ headers: {
182
+ 'Content-Type': 'application/json',
183
+ ...options.headers
184
+ }
185
+ });
186
+ }
187
+ /**
188
+ * Revert a message
189
+ */
190
+ revert(options) {
191
+ return (options.client ?? this._client).post({
192
+ url: '/session/{id}/revert',
193
+ ...options,
194
+ headers: {
195
+ 'Content-Type': 'application/json',
196
+ ...options.headers
197
+ }
198
+ });
199
+ }
200
+ /**
201
+ * Restore all reverted messages
202
+ */
203
+ unrevert(options) {
204
+ return (options.client ?? this._client).post({
205
+ url: '/session/{id}/unrevert',
206
+ ...options
207
+ });
208
+ }
209
+ }
210
+ class Find extends _HeyApiClient {
211
+ /**
212
+ * Find text in files
213
+ */
214
+ text(options) {
215
+ return (options.client ?? this._client).get({
216
+ url: '/find',
217
+ ...options
218
+ });
219
+ }
220
+ /**
221
+ * Find files
222
+ */
223
+ files(options) {
224
+ return (options.client ?? this._client).get({
225
+ url: '/find/file',
226
+ ...options
227
+ });
228
+ }
229
+ /**
230
+ * Find workspace symbols
231
+ */
232
+ symbols(options) {
233
+ return (options.client ?? this._client).get({
234
+ url: '/find/symbol',
235
+ ...options
236
+ });
237
+ }
238
+ }
239
+ class File extends _HeyApiClient {
240
+ /**
241
+ * Read a file
242
+ */
243
+ read(options) {
244
+ return (options.client ?? this._client).get({
245
+ url: '/file',
246
+ ...options
247
+ });
248
+ }
249
+ /**
250
+ * Get file status
251
+ */
252
+ status(options) {
253
+ return (options?.client ?? this._client).get({
254
+ url: '/file/status',
255
+ ...options
256
+ });
257
+ }
258
+ }
259
+ class Tui extends _HeyApiClient {
260
+ /**
261
+ * Append prompt to the TUI
262
+ */
263
+ appendPrompt(options) {
264
+ return (options?.client ?? this._client).post({
265
+ url: '/tui/append-prompt',
266
+ ...options,
267
+ headers: {
268
+ 'Content-Type': 'application/json',
269
+ ...options?.headers
270
+ }
271
+ });
272
+ }
273
+ /**
274
+ * Open the help dialog
275
+ */
276
+ openHelp(options) {
277
+ return (options?.client ?? this._client).post({
278
+ url: '/tui/open-help',
279
+ ...options
280
+ });
281
+ }
282
+ }
283
+ export class OpencodeClient extends _HeyApiClient {
284
+ event = new Event({ client: this._client });
285
+ app = new App({ client: this._client });
286
+ config = new Config({ client: this._client });
287
+ session = new Session({ client: this._client });
288
+ find = new Find({ client: this._client });
289
+ file = new File({ client: this._client });
290
+ tui = new Tui({ client: this._client });
291
+ }