@opencode-ai/sdk 0.0.0-opentui-202510312235 → 0.0.0-test-bedrock-202511260007
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 +58 -3
- package/dist/gen/sdk.gen.js +122 -1
- package/dist/gen/types.gen.d.ts +1225 -781
- 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, 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,6 +59,12 @@ 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
|
|
@@ -68,6 +80,10 @@ declare class Session extends _HeyApiClient {
|
|
|
68
80
|
* Create a new session
|
|
69
81
|
*/
|
|
70
82
|
create<ThrowOnError extends boolean = false>(options?: Options<SessionCreateData, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionCreateResponses, SessionCreateErrors, ThrowOnError, "fields">;
|
|
83
|
+
/**
|
|
84
|
+
* Get session status
|
|
85
|
+
*/
|
|
86
|
+
status<ThrowOnError extends boolean = false>(options?: Options<SessionStatusData, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionStatusResponses, SessionStatusErrors, ThrowOnError, "fields">;
|
|
71
87
|
/**
|
|
72
88
|
* Delete a session and all its data
|
|
73
89
|
*/
|
|
@@ -109,9 +125,9 @@ declare class Session extends _HeyApiClient {
|
|
|
109
125
|
*/
|
|
110
126
|
share<ThrowOnError extends boolean = false>(options: Options<SessionShareData, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionShareResponses, SessionShareErrors, ThrowOnError, "fields">;
|
|
111
127
|
/**
|
|
112
|
-
* Get the diff
|
|
128
|
+
* Get the diff for this session
|
|
113
129
|
*/
|
|
114
|
-
diff<ThrowOnError extends boolean = false>(options: Options<SessionDiffData, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionDiffResponses,
|
|
130
|
+
diff<ThrowOnError extends boolean = false>(options: Options<SessionDiffData, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionDiffResponses, SessionDiffErrors, ThrowOnError, "fields">;
|
|
115
131
|
/**
|
|
116
132
|
* Summarize the session
|
|
117
133
|
*/
|
|
@@ -128,6 +144,10 @@ declare class Session extends _HeyApiClient {
|
|
|
128
144
|
* Get a message from a session
|
|
129
145
|
*/
|
|
130
146
|
message<ThrowOnError extends boolean = false>(options: Options<SessionMessageData, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionMessageResponses, SessionMessageErrors, ThrowOnError, "fields">;
|
|
147
|
+
/**
|
|
148
|
+
* Create and send a new message to a session, start if needed and return immediately
|
|
149
|
+
*/
|
|
150
|
+
promptAsync<ThrowOnError extends boolean = false>(options: Options<SessionPromptAsyncData, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionPromptAsyncResponses, SessionPromptAsyncErrors, ThrowOnError, "fields">;
|
|
131
151
|
/**
|
|
132
152
|
* Send a new command to a session
|
|
133
153
|
*/
|
|
@@ -151,6 +171,27 @@ declare class Command extends _HeyApiClient {
|
|
|
151
171
|
*/
|
|
152
172
|
list<ThrowOnError extends boolean = false>(options?: Options<CommandListData, ThrowOnError>): import("./client/types.gen.js").RequestResult<CommandListResponses, unknown, ThrowOnError, "fields">;
|
|
153
173
|
}
|
|
174
|
+
declare class Oauth extends _HeyApiClient {
|
|
175
|
+
/**
|
|
176
|
+
* Authorize a provider using OAuth
|
|
177
|
+
*/
|
|
178
|
+
authorize<ThrowOnError extends boolean = false>(options: Options<ProviderOauthAuthorizeData, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProviderOauthAuthorizeResponses, ProviderOauthAuthorizeErrors, ThrowOnError, "fields">;
|
|
179
|
+
/**
|
|
180
|
+
* Handle OAuth callback for a provider
|
|
181
|
+
*/
|
|
182
|
+
callback<ThrowOnError extends boolean = false>(options: Options<ProviderOauthCallbackData, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProviderOauthCallbackResponses, ProviderOauthCallbackErrors, ThrowOnError, "fields">;
|
|
183
|
+
}
|
|
184
|
+
declare class Provider extends _HeyApiClient {
|
|
185
|
+
/**
|
|
186
|
+
* List all providers
|
|
187
|
+
*/
|
|
188
|
+
list<ThrowOnError extends boolean = false>(options?: Options<ProviderListData, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProviderListResponses, unknown, ThrowOnError, "fields">;
|
|
189
|
+
/**
|
|
190
|
+
* Get provider authentication methods
|
|
191
|
+
*/
|
|
192
|
+
auth<ThrowOnError extends boolean = false>(options?: Options<ProviderAuthData, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProviderAuthResponses, unknown, ThrowOnError, "fields">;
|
|
193
|
+
oauth: Oauth;
|
|
194
|
+
}
|
|
154
195
|
declare class Find extends _HeyApiClient {
|
|
155
196
|
/**
|
|
156
197
|
* Find text in files
|
|
@@ -194,6 +235,10 @@ declare class Mcp extends _HeyApiClient {
|
|
|
194
235
|
* Get MCP server status
|
|
195
236
|
*/
|
|
196
237
|
status<ThrowOnError extends boolean = false>(options?: Options<McpStatusData, ThrowOnError>): import("./client/types.gen.js").RequestResult<McpStatusResponses, unknown, ThrowOnError, "fields">;
|
|
238
|
+
/**
|
|
239
|
+
* Add MCP server dynamically
|
|
240
|
+
*/
|
|
241
|
+
add<ThrowOnError extends boolean = false>(options?: Options<McpAddData, ThrowOnError>): import("./client/types.gen.js").RequestResult<McpAddResponses, McpAddErrors, ThrowOnError, "fields">;
|
|
197
242
|
}
|
|
198
243
|
declare class Lsp extends _HeyApiClient {
|
|
199
244
|
/**
|
|
@@ -201,6 +246,12 @@ declare class Lsp extends _HeyApiClient {
|
|
|
201
246
|
*/
|
|
202
247
|
status<ThrowOnError extends boolean = false>(options?: Options<LspStatusData, ThrowOnError>): import("./client/types.gen.js").RequestResult<LspStatusResponses, unknown, ThrowOnError, "fields">;
|
|
203
248
|
}
|
|
249
|
+
declare class Formatter extends _HeyApiClient {
|
|
250
|
+
/**
|
|
251
|
+
* Get formatter status
|
|
252
|
+
*/
|
|
253
|
+
status<ThrowOnError extends boolean = false>(options?: Options<FormatterStatusData, ThrowOnError>): import("./client/types.gen.js").RequestResult<FormatterStatusResponses, unknown, ThrowOnError, "fields">;
|
|
254
|
+
}
|
|
204
255
|
declare class Control extends _HeyApiClient {
|
|
205
256
|
/**
|
|
206
257
|
* Get the next TUI request from the queue
|
|
@@ -271,17 +322,21 @@ export declare class OpencodeClient extends _HeyApiClient {
|
|
|
271
322
|
* Respond to a permission request
|
|
272
323
|
*/
|
|
273
324
|
postSessionIdPermissionsPermissionId<ThrowOnError extends boolean = false>(options: Options<PostSessionIdPermissionsPermissionIdData, ThrowOnError>): import("./client/types.gen.js").RequestResult<PostSessionIdPermissionsPermissionIdResponses, PostSessionIdPermissionsPermissionIdErrors, ThrowOnError, "fields">;
|
|
325
|
+
global: Global;
|
|
274
326
|
project: Project;
|
|
275
327
|
config: Config;
|
|
276
328
|
tool: Tool;
|
|
329
|
+
instance: Instance;
|
|
277
330
|
path: Path;
|
|
278
331
|
session: Session;
|
|
279
332
|
command: Command;
|
|
333
|
+
provider: Provider;
|
|
280
334
|
find: Find;
|
|
281
335
|
file: File;
|
|
282
336
|
app: App;
|
|
283
337
|
mcp: Mcp;
|
|
284
338
|
lsp: Lsp;
|
|
339
|
+
formatter: Formatter;
|
|
285
340
|
tui: Tui;
|
|
286
341
|
auth: Auth;
|
|
287
342
|
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
|
|
@@ -115,6 +137,15 @@ class Session extends _HeyApiClient {
|
|
|
115
137
|
},
|
|
116
138
|
});
|
|
117
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* Get session status
|
|
142
|
+
*/
|
|
143
|
+
status(options) {
|
|
144
|
+
return (options?.client ?? this._client).get({
|
|
145
|
+
url: "/session/status",
|
|
146
|
+
...options,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
118
149
|
/**
|
|
119
150
|
* Delete a session and all its data
|
|
120
151
|
*/
|
|
@@ -218,7 +249,7 @@ class Session extends _HeyApiClient {
|
|
|
218
249
|
});
|
|
219
250
|
}
|
|
220
251
|
/**
|
|
221
|
-
* Get the diff
|
|
252
|
+
* Get the diff for this session
|
|
222
253
|
*/
|
|
223
254
|
diff(options) {
|
|
224
255
|
return (options.client ?? this._client).get({
|
|
@@ -270,6 +301,19 @@ class Session extends _HeyApiClient {
|
|
|
270
301
|
...options,
|
|
271
302
|
});
|
|
272
303
|
}
|
|
304
|
+
/**
|
|
305
|
+
* Create and send a new message to a session, start if needed and return immediately
|
|
306
|
+
*/
|
|
307
|
+
promptAsync(options) {
|
|
308
|
+
return (options.client ?? this._client).post({
|
|
309
|
+
url: "/session/{id}/prompt_async",
|
|
310
|
+
...options,
|
|
311
|
+
headers: {
|
|
312
|
+
"Content-Type": "application/json",
|
|
313
|
+
...options.headers,
|
|
314
|
+
},
|
|
315
|
+
});
|
|
316
|
+
}
|
|
273
317
|
/**
|
|
274
318
|
* Send a new command to a session
|
|
275
319
|
*/
|
|
@@ -330,6 +374,55 @@ class Command extends _HeyApiClient {
|
|
|
330
374
|
});
|
|
331
375
|
}
|
|
332
376
|
}
|
|
377
|
+
class Oauth extends _HeyApiClient {
|
|
378
|
+
/**
|
|
379
|
+
* Authorize a provider using OAuth
|
|
380
|
+
*/
|
|
381
|
+
authorize(options) {
|
|
382
|
+
return (options.client ?? this._client).post({
|
|
383
|
+
url: "/provider/{id}/oauth/authorize",
|
|
384
|
+
...options,
|
|
385
|
+
headers: {
|
|
386
|
+
"Content-Type": "application/json",
|
|
387
|
+
...options.headers,
|
|
388
|
+
},
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Handle OAuth callback for a provider
|
|
393
|
+
*/
|
|
394
|
+
callback(options) {
|
|
395
|
+
return (options.client ?? this._client).post({
|
|
396
|
+
url: "/provider/{id}/oauth/callback",
|
|
397
|
+
...options,
|
|
398
|
+
headers: {
|
|
399
|
+
"Content-Type": "application/json",
|
|
400
|
+
...options.headers,
|
|
401
|
+
},
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
class Provider extends _HeyApiClient {
|
|
406
|
+
/**
|
|
407
|
+
* List all providers
|
|
408
|
+
*/
|
|
409
|
+
list(options) {
|
|
410
|
+
return (options?.client ?? this._client).get({
|
|
411
|
+
url: "/provider",
|
|
412
|
+
...options,
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Get provider authentication methods
|
|
417
|
+
*/
|
|
418
|
+
auth(options) {
|
|
419
|
+
return (options?.client ?? this._client).get({
|
|
420
|
+
url: "/provider/auth",
|
|
421
|
+
...options,
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
oauth = new Oauth({ client: this._client });
|
|
425
|
+
}
|
|
333
426
|
class Find extends _HeyApiClient {
|
|
334
427
|
/**
|
|
335
428
|
* Find text in files
|
|
@@ -422,6 +515,19 @@ class Mcp extends _HeyApiClient {
|
|
|
422
515
|
...options,
|
|
423
516
|
});
|
|
424
517
|
}
|
|
518
|
+
/**
|
|
519
|
+
* Add MCP server dynamically
|
|
520
|
+
*/
|
|
521
|
+
add(options) {
|
|
522
|
+
return (options?.client ?? this._client).post({
|
|
523
|
+
url: "/mcp",
|
|
524
|
+
...options,
|
|
525
|
+
headers: {
|
|
526
|
+
"Content-Type": "application/json",
|
|
527
|
+
...options?.headers,
|
|
528
|
+
},
|
|
529
|
+
});
|
|
530
|
+
}
|
|
425
531
|
}
|
|
426
532
|
class Lsp extends _HeyApiClient {
|
|
427
533
|
/**
|
|
@@ -434,6 +540,17 @@ class Lsp extends _HeyApiClient {
|
|
|
434
540
|
});
|
|
435
541
|
}
|
|
436
542
|
}
|
|
543
|
+
class Formatter extends _HeyApiClient {
|
|
544
|
+
/**
|
|
545
|
+
* Get formatter status
|
|
546
|
+
*/
|
|
547
|
+
status(options) {
|
|
548
|
+
return (options?.client ?? this._client).get({
|
|
549
|
+
url: "/formatter",
|
|
550
|
+
...options,
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
}
|
|
437
554
|
class Control extends _HeyApiClient {
|
|
438
555
|
/**
|
|
439
556
|
* Get the next TUI request from the queue
|
|
@@ -607,17 +724,21 @@ export class OpencodeClient extends _HeyApiClient {
|
|
|
607
724
|
},
|
|
608
725
|
});
|
|
609
726
|
}
|
|
727
|
+
global = new Global({ client: this._client });
|
|
610
728
|
project = new Project({ client: this._client });
|
|
611
729
|
config = new Config({ client: this._client });
|
|
612
730
|
tool = new Tool({ client: this._client });
|
|
731
|
+
instance = new Instance({ client: this._client });
|
|
613
732
|
path = new Path({ client: this._client });
|
|
614
733
|
session = new Session({ client: this._client });
|
|
615
734
|
command = new Command({ client: this._client });
|
|
735
|
+
provider = new Provider({ client: this._client });
|
|
616
736
|
find = new Find({ client: this._client });
|
|
617
737
|
file = new File({ client: this._client });
|
|
618
738
|
app = new App({ client: this._client });
|
|
619
739
|
mcp = new Mcp({ client: this._client });
|
|
620
740
|
lsp = new Lsp({ client: this._client });
|
|
741
|
+
formatter = new Formatter({ client: this._client });
|
|
621
742
|
tui = new Tui({ client: this._client });
|
|
622
743
|
auth = new Auth({ client: this._client });
|
|
623
744
|
event = new Event({ client: this._client });
|