@opencode-ai/sdk 1.0.133 → 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 +59 -7
- package/dist/gen/sdk.gen.js +139 -15
- package/dist/gen/types.gen.d.ts +389 -16
- 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
package/dist/client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from "./gen/types.gen.js";
|
|
2
|
-
export { type Config as OpencodeClientConfig, OpencodeClient };
|
|
3
2
|
import { type Config } from "./gen/client/types.gen.js";
|
|
4
3
|
import { OpencodeClient } from "./gen/sdk.gen.js";
|
|
4
|
+
export { type Config as OpencodeClientConfig, OpencodeClient };
|
|
5
5
|
export declare function createOpencodeClient(config?: Config & {
|
|
6
6
|
directory?: string;
|
|
7
7
|
}): OpencodeClient;
|
package/dist/client.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
export * from "./gen/types.gen.js";
|
|
2
|
-
export { OpencodeClient };
|
|
3
2
|
import { createClient } from "./gen/client/client.gen.js";
|
|
4
3
|
import { OpencodeClient } from "./gen/sdk.gen.js";
|
|
4
|
+
export { OpencodeClient };
|
|
5
5
|
export function createOpencodeClient(config) {
|
|
6
6
|
if (!config?.fetch) {
|
|
7
|
+
const customFetch = (req) => {
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
req.timeout = false;
|
|
10
|
+
return fetch(req);
|
|
11
|
+
};
|
|
7
12
|
config = {
|
|
8
13
|
...config,
|
|
9
|
-
fetch:
|
|
10
|
-
// @ts-ignore
|
|
11
|
-
req.timeout = false;
|
|
12
|
-
return fetch(req);
|
|
13
|
-
},
|
|
14
|
+
fetch: customFetch,
|
|
14
15
|
};
|
|
15
16
|
}
|
|
16
17
|
if (config?.directory) {
|
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, 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";
|
|
2
|
+
import type { GlobalEventData, GlobalEventResponses, ProjectListData, ProjectListResponses, ProjectCurrentData, ProjectCurrentResponses, PtyListData, PtyListResponses, PtyCreateData, PtyCreateResponses, PtyCreateErrors, PtyRemoveData, PtyRemoveResponses, PtyRemoveErrors, PtyGetData, PtyGetResponses, PtyGetErrors, PtyUpdateData, PtyUpdateResponses, PtyUpdateErrors, PtyConnectData, PtyConnectResponses, PtyConnectErrors, 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, McpAuthRemoveData, McpAuthRemoveResponses, McpAuthRemoveErrors, McpAuthStartData, McpAuthStartResponses, McpAuthStartErrors, McpAuthCallbackData, McpAuthCallbackResponses, McpAuthCallbackErrors, McpAuthAuthenticateData, McpAuthAuthenticateResponses, McpAuthAuthenticateErrors, McpConnectData, McpConnectResponses, McpDisconnectData, McpDisconnectResponses, 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
|
|
@@ -35,6 +35,32 @@ declare class Project extends _HeyApiClient {
|
|
|
35
35
|
*/
|
|
36
36
|
current<ThrowOnError extends boolean = false>(options?: Options<ProjectCurrentData, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProjectCurrentResponses, unknown, ThrowOnError, "fields">;
|
|
37
37
|
}
|
|
38
|
+
declare class Pty extends _HeyApiClient {
|
|
39
|
+
/**
|
|
40
|
+
* List all PTY sessions
|
|
41
|
+
*/
|
|
42
|
+
list<ThrowOnError extends boolean = false>(options?: Options<PtyListData, ThrowOnError>): import("./client/types.gen.js").RequestResult<PtyListResponses, unknown, ThrowOnError, "fields">;
|
|
43
|
+
/**
|
|
44
|
+
* Create a new PTY session
|
|
45
|
+
*/
|
|
46
|
+
create<ThrowOnError extends boolean = false>(options?: Options<PtyCreateData, ThrowOnError>): import("./client/types.gen.js").RequestResult<PtyCreateResponses, PtyCreateErrors, ThrowOnError, "fields">;
|
|
47
|
+
/**
|
|
48
|
+
* Remove a PTY session
|
|
49
|
+
*/
|
|
50
|
+
remove<ThrowOnError extends boolean = false>(options: Options<PtyRemoveData, ThrowOnError>): import("./client/types.gen.js").RequestResult<PtyRemoveResponses, PtyRemoveErrors, ThrowOnError, "fields">;
|
|
51
|
+
/**
|
|
52
|
+
* Get PTY session info
|
|
53
|
+
*/
|
|
54
|
+
get<ThrowOnError extends boolean = false>(options: Options<PtyGetData, ThrowOnError>): import("./client/types.gen.js").RequestResult<PtyGetResponses, PtyGetErrors, ThrowOnError, "fields">;
|
|
55
|
+
/**
|
|
56
|
+
* Update PTY session
|
|
57
|
+
*/
|
|
58
|
+
update<ThrowOnError extends boolean = false>(options: Options<PtyUpdateData, ThrowOnError>): import("./client/types.gen.js").RequestResult<PtyUpdateResponses, PtyUpdateErrors, ThrowOnError, "fields">;
|
|
59
|
+
/**
|
|
60
|
+
* Connect to a PTY session
|
|
61
|
+
*/
|
|
62
|
+
connect<ThrowOnError extends boolean = false>(options: Options<PtyConnectData, ThrowOnError>): import("./client/types.gen.js").RequestResult<PtyConnectResponses, PtyConnectErrors, ThrowOnError, "fields">;
|
|
63
|
+
}
|
|
38
64
|
declare class Config extends _HeyApiClient {
|
|
39
65
|
/**
|
|
40
66
|
* Get config info
|
|
@@ -236,6 +262,28 @@ declare class App extends _HeyApiClient {
|
|
|
236
262
|
*/
|
|
237
263
|
agents<ThrowOnError extends boolean = false>(options?: Options<AppAgentsData, ThrowOnError>): import("./client/types.gen.js").RequestResult<AppAgentsResponses, unknown, ThrowOnError, "fields">;
|
|
238
264
|
}
|
|
265
|
+
declare class Auth extends _HeyApiClient {
|
|
266
|
+
/**
|
|
267
|
+
* Remove OAuth credentials for an MCP server
|
|
268
|
+
*/
|
|
269
|
+
remove<ThrowOnError extends boolean = false>(options: Options<McpAuthRemoveData, ThrowOnError>): import("./client/types.gen.js").RequestResult<McpAuthRemoveResponses, McpAuthRemoveErrors, ThrowOnError, "fields">;
|
|
270
|
+
/**
|
|
271
|
+
* Start OAuth authentication flow for an MCP server
|
|
272
|
+
*/
|
|
273
|
+
start<ThrowOnError extends boolean = false>(options: Options<McpAuthStartData, ThrowOnError>): import("./client/types.gen.js").RequestResult<McpAuthStartResponses, McpAuthStartErrors, ThrowOnError, "fields">;
|
|
274
|
+
/**
|
|
275
|
+
* Complete OAuth authentication with authorization code
|
|
276
|
+
*/
|
|
277
|
+
callback<ThrowOnError extends boolean = false>(options: Options<McpAuthCallbackData, ThrowOnError>): import("./client/types.gen.js").RequestResult<McpAuthCallbackResponses, McpAuthCallbackErrors, ThrowOnError, "fields">;
|
|
278
|
+
/**
|
|
279
|
+
* Start OAuth flow and wait for callback (opens browser)
|
|
280
|
+
*/
|
|
281
|
+
authenticate<ThrowOnError extends boolean = false>(options: Options<McpAuthAuthenticateData, ThrowOnError>): import("./client/types.gen.js").RequestResult<McpAuthAuthenticateResponses, McpAuthAuthenticateErrors, ThrowOnError, "fields">;
|
|
282
|
+
/**
|
|
283
|
+
* Set authentication credentials
|
|
284
|
+
*/
|
|
285
|
+
set<ThrowOnError extends boolean = false>(options: Options<AuthSetData, ThrowOnError>): import("./client/types.gen.js").RequestResult<AuthSetResponses, AuthSetErrors, ThrowOnError, "fields">;
|
|
286
|
+
}
|
|
239
287
|
declare class Mcp extends _HeyApiClient {
|
|
240
288
|
/**
|
|
241
289
|
* Get MCP server status
|
|
@@ -245,6 +293,15 @@ declare class Mcp extends _HeyApiClient {
|
|
|
245
293
|
* Add MCP server dynamically
|
|
246
294
|
*/
|
|
247
295
|
add<ThrowOnError extends boolean = false>(options?: Options<McpAddData, ThrowOnError>): import("./client/types.gen.js").RequestResult<McpAddResponses, McpAddErrors, ThrowOnError, "fields">;
|
|
296
|
+
/**
|
|
297
|
+
* Connect an MCP server
|
|
298
|
+
*/
|
|
299
|
+
connect<ThrowOnError extends boolean = false>(options: Options<McpConnectData, ThrowOnError>): import("./client/types.gen.js").RequestResult<McpConnectResponses, unknown, ThrowOnError, "fields">;
|
|
300
|
+
/**
|
|
301
|
+
* Disconnect an MCP server
|
|
302
|
+
*/
|
|
303
|
+
disconnect<ThrowOnError extends boolean = false>(options: Options<McpDisconnectData, ThrowOnError>): import("./client/types.gen.js").RequestResult<McpDisconnectResponses, unknown, ThrowOnError, "fields">;
|
|
304
|
+
auth: Auth;
|
|
248
305
|
}
|
|
249
306
|
declare class Lsp extends _HeyApiClient {
|
|
250
307
|
/**
|
|
@@ -311,12 +368,6 @@ declare class Tui extends _HeyApiClient {
|
|
|
311
368
|
publish<ThrowOnError extends boolean = false>(options?: Options<TuiPublishData, ThrowOnError>): import("./client/types.gen.js").RequestResult<TuiPublishResponses, TuiPublishErrors, ThrowOnError, "fields">;
|
|
312
369
|
control: Control;
|
|
313
370
|
}
|
|
314
|
-
declare class Auth extends _HeyApiClient {
|
|
315
|
-
/**
|
|
316
|
-
* Set authentication credentials
|
|
317
|
-
*/
|
|
318
|
-
set<ThrowOnError extends boolean = false>(options: Options<AuthSetData, ThrowOnError>): import("./client/types.gen.js").RequestResult<AuthSetResponses, AuthSetErrors, ThrowOnError, "fields">;
|
|
319
|
-
}
|
|
320
371
|
declare class Event extends _HeyApiClient {
|
|
321
372
|
/**
|
|
322
373
|
* Get events
|
|
@@ -330,6 +381,7 @@ export declare class OpencodeClient extends _HeyApiClient {
|
|
|
330
381
|
postSessionIdPermissionsPermissionId<ThrowOnError extends boolean = false>(options: Options<PostSessionIdPermissionsPermissionIdData, ThrowOnError>): import("./client/types.gen.js").RequestResult<PostSessionIdPermissionsPermissionIdResponses, PostSessionIdPermissionsPermissionIdErrors, ThrowOnError, "fields">;
|
|
331
382
|
global: Global;
|
|
332
383
|
project: Project;
|
|
384
|
+
pty: Pty;
|
|
333
385
|
config: Config;
|
|
334
386
|
tool: Tool;
|
|
335
387
|
instance: Instance;
|
package/dist/gen/sdk.gen.js
CHANGED
|
@@ -39,6 +39,70 @@ class Project extends _HeyApiClient {
|
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
+
class Pty extends _HeyApiClient {
|
|
43
|
+
/**
|
|
44
|
+
* List all PTY sessions
|
|
45
|
+
*/
|
|
46
|
+
list(options) {
|
|
47
|
+
return (options?.client ?? this._client).get({
|
|
48
|
+
url: "/pty",
|
|
49
|
+
...options,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Create a new PTY session
|
|
54
|
+
*/
|
|
55
|
+
create(options) {
|
|
56
|
+
return (options?.client ?? this._client).post({
|
|
57
|
+
url: "/pty",
|
|
58
|
+
...options,
|
|
59
|
+
headers: {
|
|
60
|
+
"Content-Type": "application/json",
|
|
61
|
+
...options?.headers,
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Remove a PTY session
|
|
67
|
+
*/
|
|
68
|
+
remove(options) {
|
|
69
|
+
return (options.client ?? this._client).delete({
|
|
70
|
+
url: "/pty/{id}",
|
|
71
|
+
...options,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Get PTY session info
|
|
76
|
+
*/
|
|
77
|
+
get(options) {
|
|
78
|
+
return (options.client ?? this._client).get({
|
|
79
|
+
url: "/pty/{id}",
|
|
80
|
+
...options,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Update PTY session
|
|
85
|
+
*/
|
|
86
|
+
update(options) {
|
|
87
|
+
return (options.client ?? this._client).put({
|
|
88
|
+
url: "/pty/{id}",
|
|
89
|
+
...options,
|
|
90
|
+
headers: {
|
|
91
|
+
"Content-Type": "application/json",
|
|
92
|
+
...options.headers,
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Connect to a PTY session
|
|
98
|
+
*/
|
|
99
|
+
connect(options) {
|
|
100
|
+
return (options.client ?? this._client).get({
|
|
101
|
+
url: "/pty/{id}/connect",
|
|
102
|
+
...options,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
42
106
|
class Config extends _HeyApiClient {
|
|
43
107
|
/**
|
|
44
108
|
* Get config info
|
|
@@ -516,6 +580,61 @@ class App extends _HeyApiClient {
|
|
|
516
580
|
});
|
|
517
581
|
}
|
|
518
582
|
}
|
|
583
|
+
class Auth extends _HeyApiClient {
|
|
584
|
+
/**
|
|
585
|
+
* Remove OAuth credentials for an MCP server
|
|
586
|
+
*/
|
|
587
|
+
remove(options) {
|
|
588
|
+
return (options.client ?? this._client).delete({
|
|
589
|
+
url: "/mcp/{name}/auth",
|
|
590
|
+
...options,
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* Start OAuth authentication flow for an MCP server
|
|
595
|
+
*/
|
|
596
|
+
start(options) {
|
|
597
|
+
return (options.client ?? this._client).post({
|
|
598
|
+
url: "/mcp/{name}/auth",
|
|
599
|
+
...options,
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* Complete OAuth authentication with authorization code
|
|
604
|
+
*/
|
|
605
|
+
callback(options) {
|
|
606
|
+
return (options.client ?? this._client).post({
|
|
607
|
+
url: "/mcp/{name}/auth/callback",
|
|
608
|
+
...options,
|
|
609
|
+
headers: {
|
|
610
|
+
"Content-Type": "application/json",
|
|
611
|
+
...options.headers,
|
|
612
|
+
},
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* Start OAuth flow and wait for callback (opens browser)
|
|
617
|
+
*/
|
|
618
|
+
authenticate(options) {
|
|
619
|
+
return (options.client ?? this._client).post({
|
|
620
|
+
url: "/mcp/{name}/auth/authenticate",
|
|
621
|
+
...options,
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* Set authentication credentials
|
|
626
|
+
*/
|
|
627
|
+
set(options) {
|
|
628
|
+
return (options.client ?? this._client).put({
|
|
629
|
+
url: "/auth/{id}",
|
|
630
|
+
...options,
|
|
631
|
+
headers: {
|
|
632
|
+
"Content-Type": "application/json",
|
|
633
|
+
...options.headers,
|
|
634
|
+
},
|
|
635
|
+
});
|
|
636
|
+
}
|
|
637
|
+
}
|
|
519
638
|
class Mcp extends _HeyApiClient {
|
|
520
639
|
/**
|
|
521
640
|
* Get MCP server status
|
|
@@ -539,6 +658,25 @@ class Mcp extends _HeyApiClient {
|
|
|
539
658
|
},
|
|
540
659
|
});
|
|
541
660
|
}
|
|
661
|
+
/**
|
|
662
|
+
* Connect an MCP server
|
|
663
|
+
*/
|
|
664
|
+
connect(options) {
|
|
665
|
+
return (options.client ?? this._client).post({
|
|
666
|
+
url: "/mcp/{name}/connect",
|
|
667
|
+
...options,
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* Disconnect an MCP server
|
|
672
|
+
*/
|
|
673
|
+
disconnect(options) {
|
|
674
|
+
return (options.client ?? this._client).post({
|
|
675
|
+
url: "/mcp/{name}/disconnect",
|
|
676
|
+
...options,
|
|
677
|
+
});
|
|
678
|
+
}
|
|
679
|
+
auth = new Auth({ client: this._client });
|
|
542
680
|
}
|
|
543
681
|
class Lsp extends _HeyApiClient {
|
|
544
682
|
/**
|
|
@@ -695,21 +833,6 @@ class Tui extends _HeyApiClient {
|
|
|
695
833
|
}
|
|
696
834
|
control = new Control({ client: this._client });
|
|
697
835
|
}
|
|
698
|
-
class Auth extends _HeyApiClient {
|
|
699
|
-
/**
|
|
700
|
-
* Set authentication credentials
|
|
701
|
-
*/
|
|
702
|
-
set(options) {
|
|
703
|
-
return (options.client ?? this._client).put({
|
|
704
|
-
url: "/auth/{id}",
|
|
705
|
-
...options,
|
|
706
|
-
headers: {
|
|
707
|
-
"Content-Type": "application/json",
|
|
708
|
-
...options.headers,
|
|
709
|
-
},
|
|
710
|
-
});
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
836
|
class Event extends _HeyApiClient {
|
|
714
837
|
/**
|
|
715
838
|
* Get events
|
|
@@ -737,6 +860,7 @@ export class OpencodeClient extends _HeyApiClient {
|
|
|
737
860
|
}
|
|
738
861
|
global = new Global({ client: this._client });
|
|
739
862
|
project = new Project({ client: this._client });
|
|
863
|
+
pty = new Pty({ client: this._client });
|
|
740
864
|
config = new Config({ client: this._client });
|
|
741
865
|
tool = new Tool({ client: this._client });
|
|
742
866
|
instance = new Instance({ client: this._client });
|