@opencode-ai/sdk 0.0.0-opentui-202510311907 → 0.0.0-otui-diffs-202511281600
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 +3 -1
- package/dist/client.js +16 -0
- package/dist/gen/client/client.gen.js +1 -3
- package/dist/gen/client/utils.gen.d.ts +1 -1
- package/dist/gen/client/utils.gen.js +3 -5
- package/dist/gen/client.gen.js +1 -1
- package/dist/gen/core/pathSerializer.gen.d.ts +1 -1
- package/dist/gen/core/pathSerializer.gen.js +1 -1
- package/dist/gen/sdk.gen.d.ts +65 -3
- package/dist/gen/sdk.gen.js +134 -1
- package/dist/gen/types.gen.d.ts +1249 -772
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -2,4 +2,6 @@ export * from "./gen/types.gen.js";
|
|
|
2
2
|
export { type Config as OpencodeClientConfig, OpencodeClient };
|
|
3
3
|
import { type Config } from "./gen/client/types.gen.js";
|
|
4
4
|
import { OpencodeClient } from "./gen/sdk.gen.js";
|
|
5
|
-
export declare function createOpencodeClient(config?: Config
|
|
5
|
+
export declare function createOpencodeClient(config?: Config & {
|
|
6
|
+
directory?: string;
|
|
7
|
+
}): OpencodeClient;
|
package/dist/client.js
CHANGED
|
@@ -3,6 +3,22 @@ export { OpencodeClient };
|
|
|
3
3
|
import { createClient } from "./gen/client/client.gen.js";
|
|
4
4
|
import { OpencodeClient } from "./gen/sdk.gen.js";
|
|
5
5
|
export function createOpencodeClient(config) {
|
|
6
|
+
if (!config?.fetch) {
|
|
7
|
+
config = {
|
|
8
|
+
...config,
|
|
9
|
+
fetch: (req) => {
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
req.timeout = false;
|
|
12
|
+
return fetch(req);
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
if (config?.directory) {
|
|
17
|
+
config.headers = {
|
|
18
|
+
...config.headers,
|
|
19
|
+
"x-opencode-directory": config.directory,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
6
22
|
const client = createClient(config);
|
|
7
23
|
return new OpencodeClient({ client });
|
|
8
24
|
}
|
|
@@ -72,9 +72,7 @@ export const createClient = (config = {}) => {
|
|
|
72
72
|
...result,
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
|
-
const parseAs = (opts.parseAs === "auto"
|
|
76
|
-
? getParseAs(response.headers.get("Content-Type"))
|
|
77
|
-
: opts.parseAs) ?? "json";
|
|
75
|
+
const parseAs = (opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json";
|
|
78
76
|
let data;
|
|
79
77
|
switch (parseAs) {
|
|
80
78
|
case "arrayBuffer":
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { QuerySerializerOptions } from "../core/bodySerializer.gen.js";
|
|
2
2
|
import type { Client, ClientOptions, Config, RequestOptions } from "./types.gen.js";
|
|
3
|
-
export declare const createQuerySerializer: <T = unknown>({ allowReserved, array, object
|
|
3
|
+
export declare const createQuerySerializer: <T = unknown>({ allowReserved, array, object }?: QuerySerializerOptions) => (queryParams: T) => string;
|
|
4
4
|
/**
|
|
5
5
|
* Infers parseAs value from provided Content-Type header.
|
|
6
6
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
2
|
import { getAuthToken } from "../core/auth.gen.js";
|
|
3
3
|
import { jsonBodySerializer } from "../core/bodySerializer.gen.js";
|
|
4
|
-
import { serializeArrayParam, serializeObjectParam, serializePrimitiveParam
|
|
4
|
+
import { serializeArrayParam, serializeObjectParam, serializePrimitiveParam } from "../core/pathSerializer.gen.js";
|
|
5
5
|
import { getUrl } from "../core/utils.gen.js";
|
|
6
|
-
export const createQuerySerializer = ({ allowReserved, array, object
|
|
6
|
+
export const createQuerySerializer = ({ allowReserved, array, object } = {}) => {
|
|
7
7
|
const querySerializer = (queryParams) => {
|
|
8
8
|
const search = [];
|
|
9
9
|
if (queryParams && typeof queryParams === "object") {
|
|
@@ -82,9 +82,7 @@ const checkForExistence = (options, name) => {
|
|
|
82
82
|
if (!name) {
|
|
83
83
|
return false;
|
|
84
84
|
}
|
|
85
|
-
if (options.headers.has(name) ||
|
|
86
|
-
options.query?.[name] ||
|
|
87
|
-
options.headers.get("Cookie")?.includes(`${name}=`)) {
|
|
85
|
+
if (options.headers.has(name) || options.query?.[name] || options.headers.get("Cookie")?.includes(`${name}=`)) {
|
|
88
86
|
return true;
|
|
89
87
|
}
|
|
90
88
|
return false;
|
package/dist/gen/client.gen.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
-
import { createClient, createConfig
|
|
2
|
+
import { createClient, createConfig } from "./client/index.js";
|
|
3
3
|
export const client = createClient(createConfig({
|
|
4
4
|
baseUrl: "http://localhost:4096",
|
|
5
5
|
}));
|
|
@@ -25,7 +25,7 @@ export declare const separatorObjectExplode: (style: ObjectSeparatorStyle) => ".
|
|
|
25
25
|
export declare const serializeArrayParam: ({ allowReserved, explode, name, style, value, }: SerializeOptions<ArraySeparatorStyle> & {
|
|
26
26
|
value: unknown[];
|
|
27
27
|
}) => string;
|
|
28
|
-
export declare const serializePrimitiveParam: ({ allowReserved, name, value
|
|
28
|
+
export declare const serializePrimitiveParam: ({ allowReserved, name, value }: SerializePrimitiveParam) => string;
|
|
29
29
|
export declare const serializeObjectParam: ({ allowReserved, explode, name, style, value, valueOnly, }: SerializeOptions<ObjectSeparatorStyle> & {
|
|
30
30
|
value: Record<string, unknown> | Date;
|
|
31
31
|
valueOnly?: boolean;
|
|
@@ -64,7 +64,7 @@ export const serializeArrayParam = ({ allowReserved, explode, name, style, value
|
|
|
64
64
|
.join(separator);
|
|
65
65
|
return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
|
|
66
66
|
};
|
|
67
|
-
export const serializePrimitiveParam = ({ allowReserved, name, value
|
|
67
|
+
export const serializePrimitiveParam = ({ allowReserved, name, value }) => {
|
|
68
68
|
if (value === undefined || value === null) {
|
|
69
69
|
return "";
|
|
70
70
|
}
|
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 { ProjectListData, ProjectListResponses, ProjectCurrentData, ProjectCurrentResponses, ConfigGetData, ConfigGetResponses, ConfigUpdateData, ConfigUpdateResponses, ConfigUpdateErrors, ToolIdsData, ToolIdsResponses, ToolIdsErrors, ToolListData, ToolListResponses, ToolListErrors, PathGetData, PathGetResponses, SessionListData, SessionListResponses, SessionCreateData, SessionCreateResponses, SessionCreateErrors, 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, 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, LspStatusData, LspStatusResponses, 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, VcsGetData, VcsGetResponses, 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, SessionPromptAsyncData, SessionPromptAsyncResponses, SessionPromptAsyncErrors, 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
|
|
@@ -19,6 +19,12 @@ declare class _HeyApiClient {
|
|
|
19
19
|
client?: Client;
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
+
declare class Global extends _HeyApiClient {
|
|
23
|
+
/**
|
|
24
|
+
* Get events
|
|
25
|
+
*/
|
|
26
|
+
event<ThrowOnError extends boolean = false>(options?: Options<GlobalEventData, ThrowOnError>): Promise<import("./core/serverSentEvents.gen.js").ServerSentEventsResult<GlobalEventResponses, unknown>>;
|
|
27
|
+
}
|
|
22
28
|
declare class Project extends _HeyApiClient {
|
|
23
29
|
/**
|
|
24
30
|
* List all projects
|
|
@@ -53,12 +59,24 @@ declare class Tool extends _HeyApiClient {
|
|
|
53
59
|
*/
|
|
54
60
|
list<ThrowOnError extends boolean = false>(options: Options<ToolListData, ThrowOnError>): import("./client/types.gen.js").RequestResult<ToolListResponses, ToolListErrors, ThrowOnError, "fields">;
|
|
55
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
|
+
}
|
|
56
68
|
declare class Path extends _HeyApiClient {
|
|
57
69
|
/**
|
|
58
70
|
* Get the current path
|
|
59
71
|
*/
|
|
60
72
|
get<ThrowOnError extends boolean = false>(options?: Options<PathGetData, ThrowOnError>): import("./client/types.gen.js").RequestResult<PathGetResponses, unknown, ThrowOnError, "fields">;
|
|
61
73
|
}
|
|
74
|
+
declare class Vcs extends _HeyApiClient {
|
|
75
|
+
/**
|
|
76
|
+
* Get VCS info for the current instance
|
|
77
|
+
*/
|
|
78
|
+
get<ThrowOnError extends boolean = false>(options?: Options<VcsGetData, ThrowOnError>): import("./client/types.gen.js").RequestResult<VcsGetResponses, unknown, ThrowOnError, "fields">;
|
|
79
|
+
}
|
|
62
80
|
declare class Session extends _HeyApiClient {
|
|
63
81
|
/**
|
|
64
82
|
* List all sessions
|
|
@@ -68,6 +86,10 @@ declare class Session extends _HeyApiClient {
|
|
|
68
86
|
* Create a new session
|
|
69
87
|
*/
|
|
70
88
|
create<ThrowOnError extends boolean = false>(options?: Options<SessionCreateData, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionCreateResponses, SessionCreateErrors, ThrowOnError, "fields">;
|
|
89
|
+
/**
|
|
90
|
+
* Get session status
|
|
91
|
+
*/
|
|
92
|
+
status<ThrowOnError extends boolean = false>(options?: Options<SessionStatusData, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionStatusResponses, SessionStatusErrors, ThrowOnError, "fields">;
|
|
71
93
|
/**
|
|
72
94
|
* Delete a session and all its data
|
|
73
95
|
*/
|
|
@@ -109,9 +131,9 @@ declare class Session extends _HeyApiClient {
|
|
|
109
131
|
*/
|
|
110
132
|
share<ThrowOnError extends boolean = false>(options: Options<SessionShareData, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionShareResponses, SessionShareErrors, ThrowOnError, "fields">;
|
|
111
133
|
/**
|
|
112
|
-
* Get the diff
|
|
134
|
+
* Get the diff for this session
|
|
113
135
|
*/
|
|
114
|
-
diff<ThrowOnError extends boolean = false>(options: Options<SessionDiffData, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionDiffResponses,
|
|
136
|
+
diff<ThrowOnError extends boolean = false>(options: Options<SessionDiffData, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionDiffResponses, SessionDiffErrors, ThrowOnError, "fields">;
|
|
115
137
|
/**
|
|
116
138
|
* Summarize the session
|
|
117
139
|
*/
|
|
@@ -128,6 +150,10 @@ declare class Session extends _HeyApiClient {
|
|
|
128
150
|
* Get a message from a session
|
|
129
151
|
*/
|
|
130
152
|
message<ThrowOnError extends boolean = false>(options: Options<SessionMessageData, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionMessageResponses, SessionMessageErrors, ThrowOnError, "fields">;
|
|
153
|
+
/**
|
|
154
|
+
* Create and send a new message to a session, start if needed and return immediately
|
|
155
|
+
*/
|
|
156
|
+
promptAsync<ThrowOnError extends boolean = false>(options: Options<SessionPromptAsyncData, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionPromptAsyncResponses, SessionPromptAsyncErrors, ThrowOnError, "fields">;
|
|
131
157
|
/**
|
|
132
158
|
* Send a new command to a session
|
|
133
159
|
*/
|
|
@@ -151,6 +177,27 @@ declare class Command extends _HeyApiClient {
|
|
|
151
177
|
*/
|
|
152
178
|
list<ThrowOnError extends boolean = false>(options?: Options<CommandListData, ThrowOnError>): import("./client/types.gen.js").RequestResult<CommandListResponses, unknown, ThrowOnError, "fields">;
|
|
153
179
|
}
|
|
180
|
+
declare class Oauth extends _HeyApiClient {
|
|
181
|
+
/**
|
|
182
|
+
* Authorize a provider using OAuth
|
|
183
|
+
*/
|
|
184
|
+
authorize<ThrowOnError extends boolean = false>(options: Options<ProviderOauthAuthorizeData, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProviderOauthAuthorizeResponses, ProviderOauthAuthorizeErrors, ThrowOnError, "fields">;
|
|
185
|
+
/**
|
|
186
|
+
* Handle OAuth callback for a provider
|
|
187
|
+
*/
|
|
188
|
+
callback<ThrowOnError extends boolean = false>(options: Options<ProviderOauthCallbackData, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProviderOauthCallbackResponses, ProviderOauthCallbackErrors, ThrowOnError, "fields">;
|
|
189
|
+
}
|
|
190
|
+
declare class Provider extends _HeyApiClient {
|
|
191
|
+
/**
|
|
192
|
+
* List all providers
|
|
193
|
+
*/
|
|
194
|
+
list<ThrowOnError extends boolean = false>(options?: Options<ProviderListData, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProviderListResponses, unknown, ThrowOnError, "fields">;
|
|
195
|
+
/**
|
|
196
|
+
* Get provider authentication methods
|
|
197
|
+
*/
|
|
198
|
+
auth<ThrowOnError extends boolean = false>(options?: Options<ProviderAuthData, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProviderAuthResponses, unknown, ThrowOnError, "fields">;
|
|
199
|
+
oauth: Oauth;
|
|
200
|
+
}
|
|
154
201
|
declare class Find extends _HeyApiClient {
|
|
155
202
|
/**
|
|
156
203
|
* Find text in files
|
|
@@ -194,6 +241,10 @@ declare class Mcp extends _HeyApiClient {
|
|
|
194
241
|
* Get MCP server status
|
|
195
242
|
*/
|
|
196
243
|
status<ThrowOnError extends boolean = false>(options?: Options<McpStatusData, ThrowOnError>): import("./client/types.gen.js").RequestResult<McpStatusResponses, unknown, ThrowOnError, "fields">;
|
|
244
|
+
/**
|
|
245
|
+
* Add MCP server dynamically
|
|
246
|
+
*/
|
|
247
|
+
add<ThrowOnError extends boolean = false>(options?: Options<McpAddData, ThrowOnError>): import("./client/types.gen.js").RequestResult<McpAddResponses, McpAddErrors, ThrowOnError, "fields">;
|
|
197
248
|
}
|
|
198
249
|
declare class Lsp extends _HeyApiClient {
|
|
199
250
|
/**
|
|
@@ -201,6 +252,12 @@ declare class Lsp extends _HeyApiClient {
|
|
|
201
252
|
*/
|
|
202
253
|
status<ThrowOnError extends boolean = false>(options?: Options<LspStatusData, ThrowOnError>): import("./client/types.gen.js").RequestResult<LspStatusResponses, unknown, ThrowOnError, "fields">;
|
|
203
254
|
}
|
|
255
|
+
declare class Formatter extends _HeyApiClient {
|
|
256
|
+
/**
|
|
257
|
+
* Get formatter status
|
|
258
|
+
*/
|
|
259
|
+
status<ThrowOnError extends boolean = false>(options?: Options<FormatterStatusData, ThrowOnError>): import("./client/types.gen.js").RequestResult<FormatterStatusResponses, unknown, ThrowOnError, "fields">;
|
|
260
|
+
}
|
|
204
261
|
declare class Control extends _HeyApiClient {
|
|
205
262
|
/**
|
|
206
263
|
* Get the next TUI request from the queue
|
|
@@ -271,17 +328,22 @@ export declare class OpencodeClient extends _HeyApiClient {
|
|
|
271
328
|
* Respond to a permission request
|
|
272
329
|
*/
|
|
273
330
|
postSessionIdPermissionsPermissionId<ThrowOnError extends boolean = false>(options: Options<PostSessionIdPermissionsPermissionIdData, ThrowOnError>): import("./client/types.gen.js").RequestResult<PostSessionIdPermissionsPermissionIdResponses, PostSessionIdPermissionsPermissionIdErrors, ThrowOnError, "fields">;
|
|
331
|
+
global: Global;
|
|
274
332
|
project: Project;
|
|
275
333
|
config: Config;
|
|
276
334
|
tool: Tool;
|
|
335
|
+
instance: Instance;
|
|
277
336
|
path: Path;
|
|
337
|
+
vcs: Vcs;
|
|
278
338
|
session: Session;
|
|
279
339
|
command: Command;
|
|
340
|
+
provider: Provider;
|
|
280
341
|
find: Find;
|
|
281
342
|
file: File;
|
|
282
343
|
app: App;
|
|
283
344
|
mcp: Mcp;
|
|
284
345
|
lsp: Lsp;
|
|
346
|
+
formatter: Formatter;
|
|
285
347
|
tui: Tui;
|
|
286
348
|
auth: Auth;
|
|
287
349
|
event: Event;
|
package/dist/gen/sdk.gen.js
CHANGED
|
@@ -8,6 +8,17 @@ class _HeyApiClient {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
+
class Global extends _HeyApiClient {
|
|
12
|
+
/**
|
|
13
|
+
* Get events
|
|
14
|
+
*/
|
|
15
|
+
event(options) {
|
|
16
|
+
return (options?.client ?? this._client).get.sse({
|
|
17
|
+
url: "/global/event",
|
|
18
|
+
...options,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
11
22
|
class Project extends _HeyApiClient {
|
|
12
23
|
/**
|
|
13
24
|
* List all projects
|
|
@@ -81,6 +92,17 @@ class Tool extends _HeyApiClient {
|
|
|
81
92
|
});
|
|
82
93
|
}
|
|
83
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
|
+
}
|
|
84
106
|
class Path extends _HeyApiClient {
|
|
85
107
|
/**
|
|
86
108
|
* Get the current path
|
|
@@ -92,6 +114,17 @@ class Path extends _HeyApiClient {
|
|
|
92
114
|
});
|
|
93
115
|
}
|
|
94
116
|
}
|
|
117
|
+
class Vcs extends _HeyApiClient {
|
|
118
|
+
/**
|
|
119
|
+
* Get VCS info for the current instance
|
|
120
|
+
*/
|
|
121
|
+
get(options) {
|
|
122
|
+
return (options?.client ?? this._client).get({
|
|
123
|
+
url: "/vcs",
|
|
124
|
+
...options,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
95
128
|
class Session extends _HeyApiClient {
|
|
96
129
|
/**
|
|
97
130
|
* List all sessions
|
|
@@ -115,6 +148,15 @@ class Session extends _HeyApiClient {
|
|
|
115
148
|
},
|
|
116
149
|
});
|
|
117
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* Get session status
|
|
153
|
+
*/
|
|
154
|
+
status(options) {
|
|
155
|
+
return (options?.client ?? this._client).get({
|
|
156
|
+
url: "/session/status",
|
|
157
|
+
...options,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
118
160
|
/**
|
|
119
161
|
* Delete a session and all its data
|
|
120
162
|
*/
|
|
@@ -218,7 +260,7 @@ class Session extends _HeyApiClient {
|
|
|
218
260
|
});
|
|
219
261
|
}
|
|
220
262
|
/**
|
|
221
|
-
* Get the diff
|
|
263
|
+
* Get the diff for this session
|
|
222
264
|
*/
|
|
223
265
|
diff(options) {
|
|
224
266
|
return (options.client ?? this._client).get({
|
|
@@ -270,6 +312,19 @@ class Session extends _HeyApiClient {
|
|
|
270
312
|
...options,
|
|
271
313
|
});
|
|
272
314
|
}
|
|
315
|
+
/**
|
|
316
|
+
* Create and send a new message to a session, start if needed and return immediately
|
|
317
|
+
*/
|
|
318
|
+
promptAsync(options) {
|
|
319
|
+
return (options.client ?? this._client).post({
|
|
320
|
+
url: "/session/{id}/prompt_async",
|
|
321
|
+
...options,
|
|
322
|
+
headers: {
|
|
323
|
+
"Content-Type": "application/json",
|
|
324
|
+
...options.headers,
|
|
325
|
+
},
|
|
326
|
+
});
|
|
327
|
+
}
|
|
273
328
|
/**
|
|
274
329
|
* Send a new command to a session
|
|
275
330
|
*/
|
|
@@ -330,6 +385,55 @@ class Command extends _HeyApiClient {
|
|
|
330
385
|
});
|
|
331
386
|
}
|
|
332
387
|
}
|
|
388
|
+
class Oauth extends _HeyApiClient {
|
|
389
|
+
/**
|
|
390
|
+
* Authorize a provider using OAuth
|
|
391
|
+
*/
|
|
392
|
+
authorize(options) {
|
|
393
|
+
return (options.client ?? this._client).post({
|
|
394
|
+
url: "/provider/{id}/oauth/authorize",
|
|
395
|
+
...options,
|
|
396
|
+
headers: {
|
|
397
|
+
"Content-Type": "application/json",
|
|
398
|
+
...options.headers,
|
|
399
|
+
},
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Handle OAuth callback for a provider
|
|
404
|
+
*/
|
|
405
|
+
callback(options) {
|
|
406
|
+
return (options.client ?? this._client).post({
|
|
407
|
+
url: "/provider/{id}/oauth/callback",
|
|
408
|
+
...options,
|
|
409
|
+
headers: {
|
|
410
|
+
"Content-Type": "application/json",
|
|
411
|
+
...options.headers,
|
|
412
|
+
},
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
class Provider extends _HeyApiClient {
|
|
417
|
+
/**
|
|
418
|
+
* List all providers
|
|
419
|
+
*/
|
|
420
|
+
list(options) {
|
|
421
|
+
return (options?.client ?? this._client).get({
|
|
422
|
+
url: "/provider",
|
|
423
|
+
...options,
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Get provider authentication methods
|
|
428
|
+
*/
|
|
429
|
+
auth(options) {
|
|
430
|
+
return (options?.client ?? this._client).get({
|
|
431
|
+
url: "/provider/auth",
|
|
432
|
+
...options,
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
oauth = new Oauth({ client: this._client });
|
|
436
|
+
}
|
|
333
437
|
class Find extends _HeyApiClient {
|
|
334
438
|
/**
|
|
335
439
|
* Find text in files
|
|
@@ -422,6 +526,19 @@ class Mcp extends _HeyApiClient {
|
|
|
422
526
|
...options,
|
|
423
527
|
});
|
|
424
528
|
}
|
|
529
|
+
/**
|
|
530
|
+
* Add MCP server dynamically
|
|
531
|
+
*/
|
|
532
|
+
add(options) {
|
|
533
|
+
return (options?.client ?? this._client).post({
|
|
534
|
+
url: "/mcp",
|
|
535
|
+
...options,
|
|
536
|
+
headers: {
|
|
537
|
+
"Content-Type": "application/json",
|
|
538
|
+
...options?.headers,
|
|
539
|
+
},
|
|
540
|
+
});
|
|
541
|
+
}
|
|
425
542
|
}
|
|
426
543
|
class Lsp extends _HeyApiClient {
|
|
427
544
|
/**
|
|
@@ -434,6 +551,17 @@ class Lsp extends _HeyApiClient {
|
|
|
434
551
|
});
|
|
435
552
|
}
|
|
436
553
|
}
|
|
554
|
+
class Formatter extends _HeyApiClient {
|
|
555
|
+
/**
|
|
556
|
+
* Get formatter status
|
|
557
|
+
*/
|
|
558
|
+
status(options) {
|
|
559
|
+
return (options?.client ?? this._client).get({
|
|
560
|
+
url: "/formatter",
|
|
561
|
+
...options,
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
}
|
|
437
565
|
class Control extends _HeyApiClient {
|
|
438
566
|
/**
|
|
439
567
|
* Get the next TUI request from the queue
|
|
@@ -607,17 +735,22 @@ export class OpencodeClient extends _HeyApiClient {
|
|
|
607
735
|
},
|
|
608
736
|
});
|
|
609
737
|
}
|
|
738
|
+
global = new Global({ client: this._client });
|
|
610
739
|
project = new Project({ client: this._client });
|
|
611
740
|
config = new Config({ client: this._client });
|
|
612
741
|
tool = new Tool({ client: this._client });
|
|
742
|
+
instance = new Instance({ client: this._client });
|
|
613
743
|
path = new Path({ client: this._client });
|
|
744
|
+
vcs = new Vcs({ client: this._client });
|
|
614
745
|
session = new Session({ client: this._client });
|
|
615
746
|
command = new Command({ client: this._client });
|
|
747
|
+
provider = new Provider({ client: this._client });
|
|
616
748
|
find = new Find({ client: this._client });
|
|
617
749
|
file = new File({ client: this._client });
|
|
618
750
|
app = new App({ client: this._client });
|
|
619
751
|
mcp = new Mcp({ client: this._client });
|
|
620
752
|
lsp = new Lsp({ client: this._client });
|
|
753
|
+
formatter = new Formatter({ client: this._client });
|
|
621
754
|
tui = new Tui({ client: this._client });
|
|
622
755
|
auth = new Auth({ client: this._client });
|
|
623
756
|
event = new Event({ client: this._client });
|