@opencode-ai/sdk 0.0.0-dev-202511210437 → 0.0.0-dev-202511210532
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/gen/sdk.gen.d.ts +30 -1
- package/dist/gen/sdk.gen.js +62 -0
- package/dist/gen/types.gen.d.ts +130 -0
- package/package.json +1 -1
package/dist/gen/sdk.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Options as ClientOptions, TDataShape, Client } from "./client/index.js";
|
|
2
|
-
import type { GlobalEventData, GlobalEventResponses, ProjectListData, ProjectListResponses, ProjectCurrentData, ProjectCurrentResponses, ConfigGetData, ConfigGetResponses, ConfigUpdateData, ConfigUpdateResponses, ConfigUpdateErrors, ToolIdsData, ToolIdsResponses, ToolIdsErrors, ToolListData, ToolListResponses, ToolListErrors, PathGetData, PathGetResponses, SessionListData, SessionListResponses, SessionCreateData, SessionCreateResponses, SessionCreateErrors, SessionStatusData, SessionStatusResponses, SessionStatusErrors, SessionDeleteData, SessionDeleteResponses, SessionDeleteErrors, SessionGetData, SessionGetResponses, SessionGetErrors, SessionUpdateData, SessionUpdateResponses, SessionUpdateErrors, SessionChildrenData, SessionChildrenResponses, SessionChildrenErrors, SessionTodoData, SessionTodoResponses, SessionTodoErrors, SessionInitData, SessionInitResponses, SessionInitErrors, SessionForkData, SessionForkResponses, SessionAbortData, SessionAbortResponses, SessionAbortErrors, SessionUnshareData, SessionUnshareResponses, SessionUnshareErrors, SessionShareData, SessionShareResponses, SessionShareErrors, SessionDiffData, SessionDiffResponses, SessionDiffErrors, SessionSummarizeData, SessionSummarizeResponses, SessionSummarizeErrors, SessionMessagesData, SessionMessagesResponses, SessionMessagesErrors, SessionPromptData, SessionPromptResponses, SessionPromptErrors, SessionMessageData, SessionMessageResponses, SessionMessageErrors, SessionCommandData, SessionCommandResponses, SessionCommandErrors, SessionShellData, SessionShellResponses, SessionShellErrors, SessionRevertData, SessionRevertResponses, SessionRevertErrors, SessionUnrevertData, SessionUnrevertResponses, SessionUnrevertErrors, PostSessionIdPermissionsPermissionIdData, PostSessionIdPermissionsPermissionIdResponses, PostSessionIdPermissionsPermissionIdErrors, CommandListData, CommandListResponses, ConfigProvidersData, ConfigProvidersResponses, FindTextData, FindTextResponses, FindFilesData, FindFilesResponses, FindSymbolsData, FindSymbolsResponses, FileListData, FileListResponses, FileReadData, FileReadResponses, FileStatusData, FileStatusResponses, AppLogData, AppLogResponses, AppLogErrors, AppAgentsData, AppAgentsResponses, McpStatusData, McpStatusResponses, McpAddData, McpAddResponses, McpAddErrors, LspStatusData, LspStatusResponses, FormatterStatusData, FormatterStatusResponses, TuiAppendPromptData, TuiAppendPromptResponses, TuiAppendPromptErrors, TuiOpenHelpData, TuiOpenHelpResponses, TuiOpenSessionsData, TuiOpenSessionsResponses, TuiOpenThemesData, TuiOpenThemesResponses, TuiOpenModelsData, TuiOpenModelsResponses, TuiSubmitPromptData, TuiSubmitPromptResponses, TuiClearPromptData, TuiClearPromptResponses, TuiExecuteCommandData, TuiExecuteCommandResponses, TuiExecuteCommandErrors, TuiShowToastData, TuiShowToastResponses, TuiPublishData, TuiPublishResponses, TuiPublishErrors, TuiControlNextData, TuiControlNextResponses, TuiControlResponseData, TuiControlResponseResponses, AuthSetData, AuthSetResponses, AuthSetErrors, EventSubscribeData, EventSubscribeResponses } from "./types.gen.js";
|
|
2
|
+
import type { GlobalEventData, GlobalEventResponses, ProjectListData, ProjectListResponses, ProjectCurrentData, ProjectCurrentResponses, ConfigGetData, ConfigGetResponses, ConfigUpdateData, ConfigUpdateResponses, ConfigUpdateErrors, ToolIdsData, ToolIdsResponses, ToolIdsErrors, ToolListData, ToolListResponses, ToolListErrors, InstanceDisposeData, InstanceDisposeResponses, PathGetData, PathGetResponses, SessionListData, SessionListResponses, SessionCreateData, SessionCreateResponses, SessionCreateErrors, SessionStatusData, SessionStatusResponses, SessionStatusErrors, SessionDeleteData, SessionDeleteResponses, SessionDeleteErrors, SessionGetData, SessionGetResponses, SessionGetErrors, SessionUpdateData, SessionUpdateResponses, SessionUpdateErrors, SessionChildrenData, SessionChildrenResponses, SessionChildrenErrors, SessionTodoData, SessionTodoResponses, SessionTodoErrors, SessionInitData, SessionInitResponses, SessionInitErrors, SessionForkData, SessionForkResponses, SessionAbortData, SessionAbortResponses, SessionAbortErrors, SessionUnshareData, SessionUnshareResponses, SessionUnshareErrors, SessionShareData, SessionShareResponses, SessionShareErrors, SessionDiffData, SessionDiffResponses, SessionDiffErrors, SessionSummarizeData, SessionSummarizeResponses, SessionSummarizeErrors, SessionMessagesData, SessionMessagesResponses, SessionMessagesErrors, SessionPromptData, SessionPromptResponses, SessionPromptErrors, SessionMessageData, SessionMessageResponses, SessionMessageErrors, SessionCommandData, SessionCommandResponses, SessionCommandErrors, SessionShellData, SessionShellResponses, SessionShellErrors, SessionRevertData, SessionRevertResponses, SessionRevertErrors, SessionUnrevertData, SessionUnrevertResponses, SessionUnrevertErrors, PostSessionIdPermissionsPermissionIdData, PostSessionIdPermissionsPermissionIdResponses, PostSessionIdPermissionsPermissionIdErrors, CommandListData, CommandListResponses, ConfigProvidersData, ConfigProvidersResponses, ProviderListData, ProviderListResponses, ProviderAuthData, ProviderAuthResponses, ProviderOauthAuthorizeData, ProviderOauthAuthorizeResponses, ProviderOauthAuthorizeErrors, ProviderOauthCallbackData, ProviderOauthCallbackResponses, ProviderOauthCallbackErrors, FindTextData, FindTextResponses, FindFilesData, FindFilesResponses, FindSymbolsData, FindSymbolsResponses, FileListData, FileListResponses, FileReadData, FileReadResponses, FileStatusData, FileStatusResponses, AppLogData, AppLogResponses, AppLogErrors, AppAgentsData, AppAgentsResponses, McpStatusData, McpStatusResponses, McpAddData, McpAddResponses, McpAddErrors, LspStatusData, LspStatusResponses, FormatterStatusData, FormatterStatusResponses, TuiAppendPromptData, TuiAppendPromptResponses, TuiAppendPromptErrors, TuiOpenHelpData, TuiOpenHelpResponses, TuiOpenSessionsData, TuiOpenSessionsResponses, TuiOpenThemesData, TuiOpenThemesResponses, TuiOpenModelsData, TuiOpenModelsResponses, TuiSubmitPromptData, TuiSubmitPromptResponses, TuiClearPromptData, TuiClearPromptResponses, TuiExecuteCommandData, TuiExecuteCommandResponses, TuiExecuteCommandErrors, TuiShowToastData, TuiShowToastResponses, TuiPublishData, TuiPublishResponses, TuiPublishErrors, TuiControlNextData, TuiControlNextResponses, TuiControlResponseData, TuiControlResponseResponses, AuthSetData, AuthSetResponses, AuthSetErrors, EventSubscribeData, EventSubscribeResponses } from "./types.gen.js";
|
|
3
3
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
|
|
4
4
|
/**
|
|
5
5
|
* You can provide a client instance returned by `createClient()` instead of
|
|
@@ -59,6 +59,12 @@ declare class Tool extends _HeyApiClient {
|
|
|
59
59
|
*/
|
|
60
60
|
list<ThrowOnError extends boolean = false>(options: Options<ToolListData, ThrowOnError>): import("./client/types.gen.js").RequestResult<ToolListResponses, ToolListErrors, ThrowOnError, "fields">;
|
|
61
61
|
}
|
|
62
|
+
declare class Instance extends _HeyApiClient {
|
|
63
|
+
/**
|
|
64
|
+
* Dispose the current instance
|
|
65
|
+
*/
|
|
66
|
+
dispose<ThrowOnError extends boolean = false>(options?: Options<InstanceDisposeData, ThrowOnError>): import("./client/types.gen.js").RequestResult<InstanceDisposeResponses, unknown, ThrowOnError, "fields">;
|
|
67
|
+
}
|
|
62
68
|
declare class Path extends _HeyApiClient {
|
|
63
69
|
/**
|
|
64
70
|
* Get the current path
|
|
@@ -161,6 +167,27 @@ declare class Command extends _HeyApiClient {
|
|
|
161
167
|
*/
|
|
162
168
|
list<ThrowOnError extends boolean = false>(options?: Options<CommandListData, ThrowOnError>): import("./client/types.gen.js").RequestResult<CommandListResponses, unknown, ThrowOnError, "fields">;
|
|
163
169
|
}
|
|
170
|
+
declare class Oauth extends _HeyApiClient {
|
|
171
|
+
/**
|
|
172
|
+
* Authorize a provider using OAuth
|
|
173
|
+
*/
|
|
174
|
+
authorize<ThrowOnError extends boolean = false>(options: Options<ProviderOauthAuthorizeData, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProviderOauthAuthorizeResponses, ProviderOauthAuthorizeErrors, ThrowOnError, "fields">;
|
|
175
|
+
/**
|
|
176
|
+
* Handle OAuth callback for a provider
|
|
177
|
+
*/
|
|
178
|
+
callback<ThrowOnError extends boolean = false>(options: Options<ProviderOauthCallbackData, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProviderOauthCallbackResponses, ProviderOauthCallbackErrors, ThrowOnError, "fields">;
|
|
179
|
+
}
|
|
180
|
+
declare class Provider extends _HeyApiClient {
|
|
181
|
+
/**
|
|
182
|
+
* List all providers
|
|
183
|
+
*/
|
|
184
|
+
list<ThrowOnError extends boolean = false>(options?: Options<ProviderListData, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProviderListResponses, unknown, ThrowOnError, "fields">;
|
|
185
|
+
/**
|
|
186
|
+
* Get provider authentication methods
|
|
187
|
+
*/
|
|
188
|
+
auth<ThrowOnError extends boolean = false>(options?: Options<ProviderAuthData, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProviderAuthResponses, unknown, ThrowOnError, "fields">;
|
|
189
|
+
oauth: Oauth;
|
|
190
|
+
}
|
|
164
191
|
declare class Find extends _HeyApiClient {
|
|
165
192
|
/**
|
|
166
193
|
* Find text in files
|
|
@@ -295,9 +322,11 @@ export declare class OpencodeClient extends _HeyApiClient {
|
|
|
295
322
|
project: Project;
|
|
296
323
|
config: Config;
|
|
297
324
|
tool: Tool;
|
|
325
|
+
instance: Instance;
|
|
298
326
|
path: Path;
|
|
299
327
|
session: Session;
|
|
300
328
|
command: Command;
|
|
329
|
+
provider: Provider;
|
|
301
330
|
find: Find;
|
|
302
331
|
file: File;
|
|
303
332
|
app: App;
|
package/dist/gen/sdk.gen.js
CHANGED
|
@@ -92,6 +92,17 @@ class Tool extends _HeyApiClient {
|
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
+
class Instance extends _HeyApiClient {
|
|
96
|
+
/**
|
|
97
|
+
* Dispose the current instance
|
|
98
|
+
*/
|
|
99
|
+
dispose(options) {
|
|
100
|
+
return (options?.client ?? this._client).post({
|
|
101
|
+
url: "/instance/dispose",
|
|
102
|
+
...options,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
95
106
|
class Path extends _HeyApiClient {
|
|
96
107
|
/**
|
|
97
108
|
* Get the current path
|
|
@@ -350,6 +361,55 @@ class Command extends _HeyApiClient {
|
|
|
350
361
|
});
|
|
351
362
|
}
|
|
352
363
|
}
|
|
364
|
+
class Oauth extends _HeyApiClient {
|
|
365
|
+
/**
|
|
366
|
+
* Authorize a provider using OAuth
|
|
367
|
+
*/
|
|
368
|
+
authorize(options) {
|
|
369
|
+
return (options.client ?? this._client).post({
|
|
370
|
+
url: "/provider/{id}/oauth/authorize",
|
|
371
|
+
...options,
|
|
372
|
+
headers: {
|
|
373
|
+
"Content-Type": "application/json",
|
|
374
|
+
...options.headers,
|
|
375
|
+
},
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Handle OAuth callback for a provider
|
|
380
|
+
*/
|
|
381
|
+
callback(options) {
|
|
382
|
+
return (options.client ?? this._client).post({
|
|
383
|
+
url: "/provider/{id}/oauth/callback",
|
|
384
|
+
...options,
|
|
385
|
+
headers: {
|
|
386
|
+
"Content-Type": "application/json",
|
|
387
|
+
...options.headers,
|
|
388
|
+
},
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
class Provider extends _HeyApiClient {
|
|
393
|
+
/**
|
|
394
|
+
* List all providers
|
|
395
|
+
*/
|
|
396
|
+
list(options) {
|
|
397
|
+
return (options?.client ?? this._client).get({
|
|
398
|
+
url: "/provider",
|
|
399
|
+
...options,
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Get provider authentication methods
|
|
404
|
+
*/
|
|
405
|
+
auth(options) {
|
|
406
|
+
return (options?.client ?? this._client).get({
|
|
407
|
+
url: "/provider/auth",
|
|
408
|
+
...options,
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
oauth = new Oauth({ client: this._client });
|
|
412
|
+
}
|
|
353
413
|
class Find extends _HeyApiClient {
|
|
354
414
|
/**
|
|
355
415
|
* Find text in files
|
|
@@ -655,9 +715,11 @@ export class OpencodeClient extends _HeyApiClient {
|
|
|
655
715
|
project = new Project({ client: this._client });
|
|
656
716
|
config = new Config({ client: this._client });
|
|
657
717
|
tool = new Tool({ client: this._client });
|
|
718
|
+
instance = new Instance({ client: this._client });
|
|
658
719
|
path = new Path({ client: this._client });
|
|
659
720
|
session = new Session({ client: this._client });
|
|
660
721
|
command = new Command({ client: this._client });
|
|
722
|
+
provider = new Provider({ client: this._client });
|
|
661
723
|
find = new Find({ client: this._client });
|
|
662
724
|
file = new File({ client: this._client });
|
|
663
725
|
app = new App({ client: this._client });
|
package/dist/gen/types.gen.d.ts
CHANGED
|
@@ -1172,6 +1172,15 @@ export type Provider = {
|
|
|
1172
1172
|
[key: string]: Model;
|
|
1173
1173
|
};
|
|
1174
1174
|
};
|
|
1175
|
+
export type ProviderAuthMethod = {
|
|
1176
|
+
type: "oauth" | "api";
|
|
1177
|
+
label: string;
|
|
1178
|
+
};
|
|
1179
|
+
export type ProviderAuthAuthorization = {
|
|
1180
|
+
url: string;
|
|
1181
|
+
method: "auto" | "code";
|
|
1182
|
+
instructions: string;
|
|
1183
|
+
};
|
|
1175
1184
|
export type Symbol = {
|
|
1176
1185
|
name: string;
|
|
1177
1186
|
kind: number;
|
|
@@ -1408,6 +1417,21 @@ export type ToolListResponses = {
|
|
|
1408
1417
|
200: ToolList;
|
|
1409
1418
|
};
|
|
1410
1419
|
export type ToolListResponse = ToolListResponses[keyof ToolListResponses];
|
|
1420
|
+
export type InstanceDisposeData = {
|
|
1421
|
+
body?: never;
|
|
1422
|
+
path?: never;
|
|
1423
|
+
query?: {
|
|
1424
|
+
directory?: string;
|
|
1425
|
+
};
|
|
1426
|
+
url: "/instance/dispose";
|
|
1427
|
+
};
|
|
1428
|
+
export type InstanceDisposeResponses = {
|
|
1429
|
+
/**
|
|
1430
|
+
* Instance disposed
|
|
1431
|
+
*/
|
|
1432
|
+
200: boolean;
|
|
1433
|
+
};
|
|
1434
|
+
export type InstanceDisposeResponse = InstanceDisposeResponses[keyof InstanceDisposeResponses];
|
|
1411
1435
|
export type PathGetData = {
|
|
1412
1436
|
body?: never;
|
|
1413
1437
|
path?: never;
|
|
@@ -2159,6 +2183,112 @@ export type ConfigProvidersResponses = {
|
|
|
2159
2183
|
};
|
|
2160
2184
|
};
|
|
2161
2185
|
export type ConfigProvidersResponse = ConfigProvidersResponses[keyof ConfigProvidersResponses];
|
|
2186
|
+
export type ProviderListData = {
|
|
2187
|
+
body?: never;
|
|
2188
|
+
path?: never;
|
|
2189
|
+
query?: {
|
|
2190
|
+
directory?: string;
|
|
2191
|
+
};
|
|
2192
|
+
url: "/provider";
|
|
2193
|
+
};
|
|
2194
|
+
export type ProviderListResponses = {
|
|
2195
|
+
/**
|
|
2196
|
+
* List of providers
|
|
2197
|
+
*/
|
|
2198
|
+
200: {
|
|
2199
|
+
all: Array<Provider>;
|
|
2200
|
+
default: {
|
|
2201
|
+
[key: string]: string;
|
|
2202
|
+
};
|
|
2203
|
+
connected: Array<string>;
|
|
2204
|
+
};
|
|
2205
|
+
};
|
|
2206
|
+
export type ProviderListResponse = ProviderListResponses[keyof ProviderListResponses];
|
|
2207
|
+
export type ProviderAuthData = {
|
|
2208
|
+
body?: never;
|
|
2209
|
+
path?: never;
|
|
2210
|
+
query?: {
|
|
2211
|
+
directory?: string;
|
|
2212
|
+
};
|
|
2213
|
+
url: "/provider/auth";
|
|
2214
|
+
};
|
|
2215
|
+
export type ProviderAuthResponses = {
|
|
2216
|
+
/**
|
|
2217
|
+
* Provider auth methods
|
|
2218
|
+
*/
|
|
2219
|
+
200: {
|
|
2220
|
+
[key: string]: Array<ProviderAuthMethod>;
|
|
2221
|
+
};
|
|
2222
|
+
};
|
|
2223
|
+
export type ProviderAuthResponse = ProviderAuthResponses[keyof ProviderAuthResponses];
|
|
2224
|
+
export type ProviderOauthAuthorizeData = {
|
|
2225
|
+
body?: {
|
|
2226
|
+
/**
|
|
2227
|
+
* Auth method index
|
|
2228
|
+
*/
|
|
2229
|
+
method: number;
|
|
2230
|
+
};
|
|
2231
|
+
path: {
|
|
2232
|
+
/**
|
|
2233
|
+
* Provider ID
|
|
2234
|
+
*/
|
|
2235
|
+
id: string;
|
|
2236
|
+
};
|
|
2237
|
+
query?: {
|
|
2238
|
+
directory?: string;
|
|
2239
|
+
};
|
|
2240
|
+
url: "/provider/{id}/oauth/authorize";
|
|
2241
|
+
};
|
|
2242
|
+
export type ProviderOauthAuthorizeErrors = {
|
|
2243
|
+
/**
|
|
2244
|
+
* Bad request
|
|
2245
|
+
*/
|
|
2246
|
+
400: BadRequestError;
|
|
2247
|
+
};
|
|
2248
|
+
export type ProviderOauthAuthorizeError = ProviderOauthAuthorizeErrors[keyof ProviderOauthAuthorizeErrors];
|
|
2249
|
+
export type ProviderOauthAuthorizeResponses = {
|
|
2250
|
+
/**
|
|
2251
|
+
* Authorization URL and method
|
|
2252
|
+
*/
|
|
2253
|
+
200: ProviderAuthAuthorization;
|
|
2254
|
+
};
|
|
2255
|
+
export type ProviderOauthAuthorizeResponse = ProviderOauthAuthorizeResponses[keyof ProviderOauthAuthorizeResponses];
|
|
2256
|
+
export type ProviderOauthCallbackData = {
|
|
2257
|
+
body?: {
|
|
2258
|
+
/**
|
|
2259
|
+
* Auth method index
|
|
2260
|
+
*/
|
|
2261
|
+
method: number;
|
|
2262
|
+
/**
|
|
2263
|
+
* OAuth authorization code
|
|
2264
|
+
*/
|
|
2265
|
+
code?: string;
|
|
2266
|
+
};
|
|
2267
|
+
path: {
|
|
2268
|
+
/**
|
|
2269
|
+
* Provider ID
|
|
2270
|
+
*/
|
|
2271
|
+
id: string;
|
|
2272
|
+
};
|
|
2273
|
+
query?: {
|
|
2274
|
+
directory?: string;
|
|
2275
|
+
};
|
|
2276
|
+
url: "/provider/{id}/oauth/callback";
|
|
2277
|
+
};
|
|
2278
|
+
export type ProviderOauthCallbackErrors = {
|
|
2279
|
+
/**
|
|
2280
|
+
* Bad request
|
|
2281
|
+
*/
|
|
2282
|
+
400: BadRequestError;
|
|
2283
|
+
};
|
|
2284
|
+
export type ProviderOauthCallbackError = ProviderOauthCallbackErrors[keyof ProviderOauthCallbackErrors];
|
|
2285
|
+
export type ProviderOauthCallbackResponses = {
|
|
2286
|
+
/**
|
|
2287
|
+
* OAuth callback processed successfully
|
|
2288
|
+
*/
|
|
2289
|
+
200: boolean;
|
|
2290
|
+
};
|
|
2291
|
+
export type ProviderOauthCallbackResponse = ProviderOauthCallbackResponses[keyof ProviderOauthCallbackResponses];
|
|
2162
2292
|
export type FindTextData = {
|
|
2163
2293
|
body?: never;
|
|
2164
2294
|
path?: never;
|