@opencode-ai/sdk 1.1.21 → 1.1.24
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.
|
@@ -121,10 +121,16 @@ export const createClient = (config = {}) => {
|
|
|
121
121
|
case "arrayBuffer":
|
|
122
122
|
case "blob":
|
|
123
123
|
case "formData":
|
|
124
|
-
case "json":
|
|
125
124
|
case "text":
|
|
126
125
|
data = await response[parseAs]();
|
|
127
126
|
break;
|
|
127
|
+
case "json": {
|
|
128
|
+
// Some servers return 200 with no Content-Length and empty body.
|
|
129
|
+
// response.json() would throw; read as text and parse if non-empty.
|
|
130
|
+
const text = await response.text();
|
|
131
|
+
data = text ? JSON.parse(text) : {};
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
128
134
|
case "stream":
|
|
129
135
|
return opts.responseStyle === "data"
|
|
130
136
|
? response.body
|
|
@@ -192,6 +198,7 @@ export const createClient = (config = {}) => {
|
|
|
192
198
|
}
|
|
193
199
|
return request;
|
|
194
200
|
},
|
|
201
|
+
serializedBody: getValidRequestBody(opts),
|
|
195
202
|
url,
|
|
196
203
|
});
|
|
197
204
|
};
|
|
@@ -53,6 +53,8 @@ export const createSseClient = ({ onRequest, onSseError, onSseEvent, responseTra
|
|
|
53
53
|
if (done)
|
|
54
54
|
break;
|
|
55
55
|
buffer += value;
|
|
56
|
+
// Normalize line endings: CRLF -> LF, then CR -> LF
|
|
57
|
+
buffer = buffer.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
56
58
|
const chunks = buffer.split("\n\n");
|
|
57
59
|
buffer = chunks.pop() ?? "";
|
|
58
60
|
for (const chunk of chunks) {
|
package/dist/v2/gen/sdk.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Client, type Options as Options2, type TDataShape } from "./client/index.js";
|
|
2
|
-
import type { AgentPartInput, AppAgentsResponses, AppLogErrors, AppLogResponses, Auth as
|
|
2
|
+
import type { AgentPartInput, AppAgentsResponses, AppLogErrors, AppLogResponses, Auth as Auth3, AuthSetErrors, AuthSetResponses, CommandListResponses, Config as Config2, ConfigGetResponses, ConfigProvidersResponses, ConfigUpdateErrors, ConfigUpdateResponses, EventSubscribeResponses, EventTuiCommandExecute, EventTuiPromptAppend, EventTuiSessionSelect, EventTuiToastShow, ExperimentalResourceListResponses, FileListResponses, FilePartInput, FilePartSource, FileReadResponses, FileStatusResponses, FindFilesResponses, FindSymbolsResponses, FindTextResponses, FormatterStatusResponses, GlobalDisposeResponses, GlobalEventResponses, GlobalHealthResponses, InstanceDisposeResponses, LspStatusResponses, McpAddErrors, McpAddResponses, McpAuthAuthenticateErrors, McpAuthAuthenticateResponses, McpAuthCallbackErrors, McpAuthCallbackResponses, McpAuthRemoveErrors, McpAuthRemoveResponses, McpAuthStartErrors, McpAuthStartResponses, McpConnectResponses, McpDisconnectResponses, McpLocalConfig, McpRemoteConfig, McpStatusResponses, Part as Part2, PartDeleteErrors, PartDeleteResponses, PartUpdateErrors, PartUpdateResponses, PathGetResponses, PermissionListResponses, PermissionReplyErrors, PermissionReplyResponses, PermissionRespondErrors, PermissionRespondResponses, PermissionRuleset, ProjectCurrentResponses, ProjectListResponses, ProjectUpdateErrors, ProjectUpdateResponses, ProviderAuthResponses, ProviderListResponses, ProviderOauthAuthorizeErrors, ProviderOauthAuthorizeResponses, ProviderOauthCallbackErrors, ProviderOauthCallbackResponses, PtyConnectErrors, PtyConnectResponses, PtyCreateErrors, PtyCreateResponses, PtyGetErrors, PtyGetResponses, PtyListResponses, PtyRemoveErrors, PtyRemoveResponses, PtyUpdateErrors, PtyUpdateResponses, QuestionAnswer, QuestionListResponses, QuestionRejectErrors, QuestionRejectResponses, QuestionReplyErrors, QuestionReplyResponses, SessionAbortErrors, SessionAbortResponses, SessionChildrenErrors, SessionChildrenResponses, SessionCommandErrors, SessionCommandResponses, SessionCreateErrors, SessionCreateResponses, SessionDeleteErrors, SessionDeleteResponses, SessionDiffErrors, SessionDiffResponses, SessionForkResponses, SessionGetErrors, SessionGetResponses, SessionInitErrors, SessionInitResponses, SessionListResponses, SessionMessageErrors, SessionMessageResponses, SessionMessagesErrors, SessionMessagesResponses, SessionPromptAsyncErrors, SessionPromptAsyncResponses, SessionPromptErrors, SessionPromptResponses, SessionRevertErrors, SessionRevertResponses, SessionShareErrors, SessionShareResponses, SessionShellErrors, SessionShellResponses, SessionStatusErrors, SessionStatusResponses, SessionSummarizeErrors, SessionSummarizeResponses, SessionTodoErrors, SessionTodoResponses, SessionUnrevertErrors, SessionUnrevertResponses, SessionUnshareErrors, SessionUnshareResponses, SessionUpdateErrors, SessionUpdateResponses, SubtaskPartInput, TextPartInput, ToolIdsErrors, ToolIdsResponses, ToolListErrors, ToolListResponses, TuiAppendPromptErrors, TuiAppendPromptResponses, TuiClearPromptResponses, TuiControlNextResponses, TuiControlResponseResponses, TuiExecuteCommandErrors, TuiExecuteCommandResponses, TuiOpenHelpResponses, TuiOpenModelsResponses, TuiOpenSessionsResponses, TuiOpenThemesResponses, TuiPublishErrors, TuiPublishResponses, TuiSelectSessionErrors, TuiSelectSessionResponses, TuiShowToastResponses, TuiSubmitPromptResponses, VcsGetResponses, WorktreeCreateErrors, WorktreeCreateInput, WorktreeCreateResponses, WorktreeListResponses } from "./types.gen.js";
|
|
3
3
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
|
|
4
4
|
/**
|
|
5
5
|
* You can provide a client instance returned by `createClient()` instead of
|
|
@@ -648,7 +648,8 @@ export declare class Provider extends HeyApiClient {
|
|
|
648
648
|
auth<ThrowOnError extends boolean = false>(parameters?: {
|
|
649
649
|
directory?: string;
|
|
650
650
|
}, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProviderAuthResponses, unknown, ThrowOnError, "fields">;
|
|
651
|
-
|
|
651
|
+
private _oauth?;
|
|
652
|
+
get oauth(): Oauth;
|
|
652
653
|
}
|
|
653
654
|
export declare class Find extends HeyApiClient {
|
|
654
655
|
/**
|
|
@@ -772,16 +773,6 @@ export declare class Auth extends HeyApiClient {
|
|
|
772
773
|
name: string;
|
|
773
774
|
directory?: string;
|
|
774
775
|
}, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<McpAuthAuthenticateResponses, McpAuthAuthenticateErrors, ThrowOnError, "fields">;
|
|
775
|
-
/**
|
|
776
|
-
* Set auth credentials
|
|
777
|
-
*
|
|
778
|
-
* Set authentication credentials
|
|
779
|
-
*/
|
|
780
|
-
set<ThrowOnError extends boolean = false>(parameters: {
|
|
781
|
-
providerID: string;
|
|
782
|
-
directory?: string;
|
|
783
|
-
auth?: Auth2;
|
|
784
|
-
}, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<AuthSetResponses, AuthSetErrors, ThrowOnError, "fields">;
|
|
785
776
|
}
|
|
786
777
|
export declare class Mcp extends HeyApiClient {
|
|
787
778
|
/**
|
|
@@ -816,7 +807,8 @@ export declare class Mcp extends HeyApiClient {
|
|
|
816
807
|
name: string;
|
|
817
808
|
directory?: string;
|
|
818
809
|
}, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<McpDisconnectResponses, unknown, ThrowOnError, "fields">;
|
|
819
|
-
|
|
810
|
+
private _auth?;
|
|
811
|
+
get auth(): Auth;
|
|
820
812
|
}
|
|
821
813
|
export declare class Resource extends HeyApiClient {
|
|
822
814
|
/**
|
|
@@ -829,7 +821,8 @@ export declare class Resource extends HeyApiClient {
|
|
|
829
821
|
}, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<ExperimentalResourceListResponses, unknown, ThrowOnError, "fields">;
|
|
830
822
|
}
|
|
831
823
|
export declare class Experimental extends HeyApiClient {
|
|
832
|
-
|
|
824
|
+
private _resource?;
|
|
825
|
+
get resource(): Resource;
|
|
833
826
|
}
|
|
834
827
|
export declare class Lsp extends HeyApiClient {
|
|
835
828
|
/**
|
|
@@ -967,7 +960,20 @@ export declare class Tui extends HeyApiClient {
|
|
|
967
960
|
directory?: string;
|
|
968
961
|
sessionID?: string;
|
|
969
962
|
}, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<TuiSelectSessionResponses, TuiSelectSessionErrors, ThrowOnError, "fields">;
|
|
970
|
-
|
|
963
|
+
private _control?;
|
|
964
|
+
get control(): Control;
|
|
965
|
+
}
|
|
966
|
+
export declare class Auth2 extends HeyApiClient {
|
|
967
|
+
/**
|
|
968
|
+
* Set auth credentials
|
|
969
|
+
*
|
|
970
|
+
* Set authentication credentials
|
|
971
|
+
*/
|
|
972
|
+
set<ThrowOnError extends boolean = false>(parameters: {
|
|
973
|
+
providerID: string;
|
|
974
|
+
directory?: string;
|
|
975
|
+
auth?: Auth3;
|
|
976
|
+
}, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<AuthSetResponses, AuthSetErrors, ThrowOnError, "fields">;
|
|
971
977
|
}
|
|
972
978
|
export declare class Event extends HeyApiClient {
|
|
973
979
|
/**
|
|
@@ -985,30 +991,55 @@ export declare class OpencodeClient extends HeyApiClient {
|
|
|
985
991
|
client?: Client;
|
|
986
992
|
key?: string;
|
|
987
993
|
});
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
994
|
+
private _global?;
|
|
995
|
+
get global(): Global;
|
|
996
|
+
private _project?;
|
|
997
|
+
get project(): Project;
|
|
998
|
+
private _pty?;
|
|
999
|
+
get pty(): Pty;
|
|
1000
|
+
private _config?;
|
|
1001
|
+
get config(): Config;
|
|
1002
|
+
private _tool?;
|
|
1003
|
+
get tool(): Tool;
|
|
1004
|
+
private _instance?;
|
|
1005
|
+
get instance(): Instance;
|
|
1006
|
+
private _path?;
|
|
1007
|
+
get path(): Path;
|
|
1008
|
+
private _worktree?;
|
|
1009
|
+
get worktree(): Worktree;
|
|
1010
|
+
private _vcs?;
|
|
1011
|
+
get vcs(): Vcs;
|
|
1012
|
+
private _session?;
|
|
1013
|
+
get session(): Session;
|
|
1014
|
+
private _part?;
|
|
1015
|
+
get part(): Part;
|
|
1016
|
+
private _permission?;
|
|
1017
|
+
get permission(): Permission;
|
|
1018
|
+
private _question?;
|
|
1019
|
+
get question(): Question;
|
|
1020
|
+
private _command?;
|
|
1021
|
+
get command(): Command;
|
|
1022
|
+
private _provider?;
|
|
1023
|
+
get provider(): Provider;
|
|
1024
|
+
private _find?;
|
|
1025
|
+
get find(): Find;
|
|
1026
|
+
private _file?;
|
|
1027
|
+
get file(): File;
|
|
1028
|
+
private _app?;
|
|
1029
|
+
get app(): App;
|
|
1030
|
+
private _mcp?;
|
|
1031
|
+
get mcp(): Mcp;
|
|
1032
|
+
private _experimental?;
|
|
1033
|
+
get experimental(): Experimental;
|
|
1034
|
+
private _lsp?;
|
|
1035
|
+
get lsp(): Lsp;
|
|
1036
|
+
private _formatter?;
|
|
1037
|
+
get formatter(): Formatter;
|
|
1038
|
+
private _tui?;
|
|
1039
|
+
get tui(): Tui;
|
|
1040
|
+
private _auth?;
|
|
1041
|
+
get auth(): Auth2;
|
|
1042
|
+
private _event?;
|
|
1043
|
+
get event(): Event;
|
|
1013
1044
|
}
|
|
1014
1045
|
export {};
|
package/dist/v2/gen/sdk.gen.js
CHANGED
|
@@ -1243,7 +1243,10 @@ export class Provider extends HeyApiClient {
|
|
|
1243
1243
|
...params,
|
|
1244
1244
|
});
|
|
1245
1245
|
}
|
|
1246
|
-
|
|
1246
|
+
_oauth;
|
|
1247
|
+
get oauth() {
|
|
1248
|
+
return (this._oauth ??= new Oauth({ client: this.client }));
|
|
1249
|
+
}
|
|
1247
1250
|
}
|
|
1248
1251
|
export class Find extends HeyApiClient {
|
|
1249
1252
|
/**
|
|
@@ -1495,32 +1498,6 @@ export class Auth extends HeyApiClient {
|
|
|
1495
1498
|
...params,
|
|
1496
1499
|
});
|
|
1497
1500
|
}
|
|
1498
|
-
/**
|
|
1499
|
-
* Set auth credentials
|
|
1500
|
-
*
|
|
1501
|
-
* Set authentication credentials
|
|
1502
|
-
*/
|
|
1503
|
-
set(parameters, options) {
|
|
1504
|
-
const params = buildClientParams([parameters], [
|
|
1505
|
-
{
|
|
1506
|
-
args: [
|
|
1507
|
-
{ in: "path", key: "providerID" },
|
|
1508
|
-
{ in: "query", key: "directory" },
|
|
1509
|
-
{ key: "auth", map: "body" },
|
|
1510
|
-
],
|
|
1511
|
-
},
|
|
1512
|
-
]);
|
|
1513
|
-
return (options?.client ?? this.client).put({
|
|
1514
|
-
url: "/auth/{providerID}",
|
|
1515
|
-
...options,
|
|
1516
|
-
...params,
|
|
1517
|
-
headers: {
|
|
1518
|
-
"Content-Type": "application/json",
|
|
1519
|
-
...options?.headers,
|
|
1520
|
-
...params.headers,
|
|
1521
|
-
},
|
|
1522
|
-
});
|
|
1523
|
-
}
|
|
1524
1501
|
}
|
|
1525
1502
|
export class Mcp extends HeyApiClient {
|
|
1526
1503
|
/**
|
|
@@ -1598,7 +1575,10 @@ export class Mcp extends HeyApiClient {
|
|
|
1598
1575
|
...params,
|
|
1599
1576
|
});
|
|
1600
1577
|
}
|
|
1601
|
-
|
|
1578
|
+
_auth;
|
|
1579
|
+
get auth() {
|
|
1580
|
+
return (this._auth ??= new Auth({ client: this.client }));
|
|
1581
|
+
}
|
|
1602
1582
|
}
|
|
1603
1583
|
export class Resource extends HeyApiClient {
|
|
1604
1584
|
/**
|
|
@@ -1616,7 +1596,10 @@ export class Resource extends HeyApiClient {
|
|
|
1616
1596
|
}
|
|
1617
1597
|
}
|
|
1618
1598
|
export class Experimental extends HeyApiClient {
|
|
1619
|
-
|
|
1599
|
+
_resource;
|
|
1600
|
+
get resource() {
|
|
1601
|
+
return (this._resource ??= new Resource({ client: this.client }));
|
|
1602
|
+
}
|
|
1620
1603
|
}
|
|
1621
1604
|
export class Lsp extends HeyApiClient {
|
|
1622
1605
|
/**
|
|
@@ -1881,7 +1864,38 @@ export class Tui extends HeyApiClient {
|
|
|
1881
1864
|
},
|
|
1882
1865
|
});
|
|
1883
1866
|
}
|
|
1884
|
-
|
|
1867
|
+
_control;
|
|
1868
|
+
get control() {
|
|
1869
|
+
return (this._control ??= new Control({ client: this.client }));
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
export class Auth2 extends HeyApiClient {
|
|
1873
|
+
/**
|
|
1874
|
+
* Set auth credentials
|
|
1875
|
+
*
|
|
1876
|
+
* Set authentication credentials
|
|
1877
|
+
*/
|
|
1878
|
+
set(parameters, options) {
|
|
1879
|
+
const params = buildClientParams([parameters], [
|
|
1880
|
+
{
|
|
1881
|
+
args: [
|
|
1882
|
+
{ in: "path", key: "providerID" },
|
|
1883
|
+
{ in: "query", key: "directory" },
|
|
1884
|
+
{ key: "auth", map: "body" },
|
|
1885
|
+
],
|
|
1886
|
+
},
|
|
1887
|
+
]);
|
|
1888
|
+
return (options?.client ?? this.client).put({
|
|
1889
|
+
url: "/auth/{providerID}",
|
|
1890
|
+
...options,
|
|
1891
|
+
...params,
|
|
1892
|
+
headers: {
|
|
1893
|
+
"Content-Type": "application/json",
|
|
1894
|
+
...options?.headers,
|
|
1895
|
+
...params.headers,
|
|
1896
|
+
},
|
|
1897
|
+
});
|
|
1898
|
+
}
|
|
1885
1899
|
}
|
|
1886
1900
|
export class Event extends HeyApiClient {
|
|
1887
1901
|
/**
|
|
@@ -1904,29 +1918,104 @@ export class OpencodeClient extends HeyApiClient {
|
|
|
1904
1918
|
super(args);
|
|
1905
1919
|
OpencodeClient.__registry.set(this, args?.key);
|
|
1906
1920
|
}
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1921
|
+
_global;
|
|
1922
|
+
get global() {
|
|
1923
|
+
return (this._global ??= new Global({ client: this.client }));
|
|
1924
|
+
}
|
|
1925
|
+
_project;
|
|
1926
|
+
get project() {
|
|
1927
|
+
return (this._project ??= new Project({ client: this.client }));
|
|
1928
|
+
}
|
|
1929
|
+
_pty;
|
|
1930
|
+
get pty() {
|
|
1931
|
+
return (this._pty ??= new Pty({ client: this.client }));
|
|
1932
|
+
}
|
|
1933
|
+
_config;
|
|
1934
|
+
get config() {
|
|
1935
|
+
return (this._config ??= new Config({ client: this.client }));
|
|
1936
|
+
}
|
|
1937
|
+
_tool;
|
|
1938
|
+
get tool() {
|
|
1939
|
+
return (this._tool ??= new Tool({ client: this.client }));
|
|
1940
|
+
}
|
|
1941
|
+
_instance;
|
|
1942
|
+
get instance() {
|
|
1943
|
+
return (this._instance ??= new Instance({ client: this.client }));
|
|
1944
|
+
}
|
|
1945
|
+
_path;
|
|
1946
|
+
get path() {
|
|
1947
|
+
return (this._path ??= new Path({ client: this.client }));
|
|
1948
|
+
}
|
|
1949
|
+
_worktree;
|
|
1950
|
+
get worktree() {
|
|
1951
|
+
return (this._worktree ??= new Worktree({ client: this.client }));
|
|
1952
|
+
}
|
|
1953
|
+
_vcs;
|
|
1954
|
+
get vcs() {
|
|
1955
|
+
return (this._vcs ??= new Vcs({ client: this.client }));
|
|
1956
|
+
}
|
|
1957
|
+
_session;
|
|
1958
|
+
get session() {
|
|
1959
|
+
return (this._session ??= new Session({ client: this.client }));
|
|
1960
|
+
}
|
|
1961
|
+
_part;
|
|
1962
|
+
get part() {
|
|
1963
|
+
return (this._part ??= new Part({ client: this.client }));
|
|
1964
|
+
}
|
|
1965
|
+
_permission;
|
|
1966
|
+
get permission() {
|
|
1967
|
+
return (this._permission ??= new Permission({ client: this.client }));
|
|
1968
|
+
}
|
|
1969
|
+
_question;
|
|
1970
|
+
get question() {
|
|
1971
|
+
return (this._question ??= new Question({ client: this.client }));
|
|
1972
|
+
}
|
|
1973
|
+
_command;
|
|
1974
|
+
get command() {
|
|
1975
|
+
return (this._command ??= new Command({ client: this.client }));
|
|
1976
|
+
}
|
|
1977
|
+
_provider;
|
|
1978
|
+
get provider() {
|
|
1979
|
+
return (this._provider ??= new Provider({ client: this.client }));
|
|
1980
|
+
}
|
|
1981
|
+
_find;
|
|
1982
|
+
get find() {
|
|
1983
|
+
return (this._find ??= new Find({ client: this.client }));
|
|
1984
|
+
}
|
|
1985
|
+
_file;
|
|
1986
|
+
get file() {
|
|
1987
|
+
return (this._file ??= new File({ client: this.client }));
|
|
1988
|
+
}
|
|
1989
|
+
_app;
|
|
1990
|
+
get app() {
|
|
1991
|
+
return (this._app ??= new App({ client: this.client }));
|
|
1992
|
+
}
|
|
1993
|
+
_mcp;
|
|
1994
|
+
get mcp() {
|
|
1995
|
+
return (this._mcp ??= new Mcp({ client: this.client }));
|
|
1996
|
+
}
|
|
1997
|
+
_experimental;
|
|
1998
|
+
get experimental() {
|
|
1999
|
+
return (this._experimental ??= new Experimental({ client: this.client }));
|
|
2000
|
+
}
|
|
2001
|
+
_lsp;
|
|
2002
|
+
get lsp() {
|
|
2003
|
+
return (this._lsp ??= new Lsp({ client: this.client }));
|
|
2004
|
+
}
|
|
2005
|
+
_formatter;
|
|
2006
|
+
get formatter() {
|
|
2007
|
+
return (this._formatter ??= new Formatter({ client: this.client }));
|
|
2008
|
+
}
|
|
2009
|
+
_tui;
|
|
2010
|
+
get tui() {
|
|
2011
|
+
return (this._tui ??= new Tui({ client: this.client }));
|
|
2012
|
+
}
|
|
2013
|
+
_auth;
|
|
2014
|
+
get auth() {
|
|
2015
|
+
return (this._auth ??= new Auth2({ client: this.client }));
|
|
2016
|
+
}
|
|
2017
|
+
_event;
|
|
2018
|
+
get event() {
|
|
2019
|
+
return (this._event ??= new Event({ client: this.client }));
|
|
2020
|
+
}
|
|
1932
2021
|
}
|
|
@@ -384,6 +384,10 @@ export type Part = TextPart | {
|
|
|
384
384
|
prompt: string;
|
|
385
385
|
description: string;
|
|
386
386
|
agent: string;
|
|
387
|
+
model?: {
|
|
388
|
+
providerID: string;
|
|
389
|
+
modelID: string;
|
|
390
|
+
};
|
|
387
391
|
command?: string;
|
|
388
392
|
} | ReasoningPart | FilePart | ToolPart | StepStartPart | StepFinishPart | SnapshotPart | PatchPart | AgentPart | RetryPart | CompactionPart;
|
|
389
393
|
export type EventMessagePartUpdated = {
|
|
@@ -590,6 +594,13 @@ export type EventMcpToolsChanged = {
|
|
|
590
594
|
server: string;
|
|
591
595
|
};
|
|
592
596
|
};
|
|
597
|
+
export type EventMcpBrowserOpenFailed = {
|
|
598
|
+
type: "mcp.browser.open.failed";
|
|
599
|
+
properties: {
|
|
600
|
+
mcpName: string;
|
|
601
|
+
url: string;
|
|
602
|
+
};
|
|
603
|
+
};
|
|
593
604
|
export type EventCommandExecuted = {
|
|
594
605
|
type: "command.executed";
|
|
595
606
|
properties: {
|
|
@@ -728,7 +739,7 @@ export type EventGlobalDisposed = {
|
|
|
728
739
|
[key: string]: unknown;
|
|
729
740
|
};
|
|
730
741
|
};
|
|
731
|
-
export type Event = EventInstallationUpdated | EventInstallationUpdateAvailable | EventProjectUpdated | EventServerInstanceDisposed | EventLspClientDiagnostics | EventLspUpdated | EventMessageUpdated | EventMessageRemoved | EventMessagePartUpdated | EventMessagePartRemoved | EventPermissionAsked | EventPermissionReplied | EventSessionStatus | EventSessionIdle | EventQuestionAsked | EventQuestionReplied | EventQuestionRejected | EventSessionCompacted | EventFileEdited | EventTodoUpdated | EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow | EventTuiSessionSelect | EventMcpToolsChanged | EventCommandExecuted | EventSessionCreated | EventSessionUpdated | EventSessionDeleted | EventSessionDiff | EventSessionError | EventFileWatcherUpdated | EventVcsBranchUpdated | EventPtyCreated | EventPtyUpdated | EventPtyExited | EventPtyDeleted | EventServerConnected | EventGlobalDisposed;
|
|
742
|
+
export type Event = EventInstallationUpdated | EventInstallationUpdateAvailable | EventProjectUpdated | EventServerInstanceDisposed | EventLspClientDiagnostics | EventLspUpdated | EventMessageUpdated | EventMessageRemoved | EventMessagePartUpdated | EventMessagePartRemoved | EventPermissionAsked | EventPermissionReplied | EventSessionStatus | EventSessionIdle | EventQuestionAsked | EventQuestionReplied | EventQuestionRejected | EventSessionCompacted | EventFileEdited | EventTodoUpdated | EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow | EventTuiSessionSelect | EventMcpToolsChanged | EventMcpBrowserOpenFailed | EventCommandExecuted | EventSessionCreated | EventSessionUpdated | EventSessionDeleted | EventSessionDiff | EventSessionError | EventFileWatcherUpdated | EventVcsBranchUpdated | EventPtyCreated | EventPtyUpdated | EventPtyExited | EventPtyDeleted | EventServerConnected | EventGlobalDisposed;
|
|
732
743
|
export type GlobalEvent = {
|
|
733
744
|
directory: string;
|
|
734
745
|
payload: Event;
|
|
@@ -806,6 +817,22 @@ export type KeybindsConfig = {
|
|
|
806
817
|
* Rename session
|
|
807
818
|
*/
|
|
808
819
|
session_rename?: string;
|
|
820
|
+
/**
|
|
821
|
+
* Delete session
|
|
822
|
+
*/
|
|
823
|
+
session_delete?: string;
|
|
824
|
+
/**
|
|
825
|
+
* Delete stash entry
|
|
826
|
+
*/
|
|
827
|
+
stash_delete?: string;
|
|
828
|
+
/**
|
|
829
|
+
* Open provider list from model dialog
|
|
830
|
+
*/
|
|
831
|
+
model_provider_list?: string;
|
|
832
|
+
/**
|
|
833
|
+
* Toggle model favorite status
|
|
834
|
+
*/
|
|
835
|
+
model_favorite_toggle?: string;
|
|
809
836
|
/**
|
|
810
837
|
* Share current session
|
|
811
838
|
*/
|
|
@@ -1225,6 +1252,7 @@ export type ProviderConfig = {
|
|
|
1225
1252
|
};
|
|
1226
1253
|
limit?: {
|
|
1227
1254
|
context: number;
|
|
1255
|
+
input?: number;
|
|
1228
1256
|
output: number;
|
|
1229
1257
|
};
|
|
1230
1258
|
modalities?: {
|
|
@@ -1296,7 +1324,7 @@ export type McpLocalConfig = {
|
|
|
1296
1324
|
*/
|
|
1297
1325
|
enabled?: boolean;
|
|
1298
1326
|
/**
|
|
1299
|
-
* Timeout in ms for
|
|
1327
|
+
* Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.
|
|
1300
1328
|
*/
|
|
1301
1329
|
timeout?: number;
|
|
1302
1330
|
};
|
|
@@ -1313,6 +1341,10 @@ export type McpOAuthConfig = {
|
|
|
1313
1341
|
* OAuth scopes to request during authorization
|
|
1314
1342
|
*/
|
|
1315
1343
|
scope?: string;
|
|
1344
|
+
/**
|
|
1345
|
+
* OAuth redirect URI (default: http://127.0.0.1:19876/mcp/oauth/callback).
|
|
1346
|
+
*/
|
|
1347
|
+
redirectUri?: string;
|
|
1316
1348
|
};
|
|
1317
1349
|
export type McpRemoteConfig = {
|
|
1318
1350
|
/**
|
|
@@ -1338,7 +1370,7 @@ export type McpRemoteConfig = {
|
|
|
1338
1370
|
*/
|
|
1339
1371
|
oauth?: McpOAuthConfig | false;
|
|
1340
1372
|
/**
|
|
1341
|
-
* Timeout in ms for
|
|
1373
|
+
* Timeout in ms for MCP server requests. Defaults to 5000 (5 seconds) if not specified.
|
|
1342
1374
|
*/
|
|
1343
1375
|
timeout?: number;
|
|
1344
1376
|
};
|
|
@@ -1442,7 +1474,7 @@ export type Config = {
|
|
|
1442
1474
|
[key: string]: AgentConfig | undefined;
|
|
1443
1475
|
};
|
|
1444
1476
|
/**
|
|
1445
|
-
* Agent configuration, see https://opencode.ai/docs/
|
|
1477
|
+
* Agent configuration, see https://opencode.ai/docs/agents
|
|
1446
1478
|
*/
|
|
1447
1479
|
agent?: {
|
|
1448
1480
|
plan?: AgentConfig;
|
|
@@ -1626,6 +1658,10 @@ export type SubtaskPartInput = {
|
|
|
1626
1658
|
prompt: string;
|
|
1627
1659
|
description: string;
|
|
1628
1660
|
agent: string;
|
|
1661
|
+
model?: {
|
|
1662
|
+
providerID: string;
|
|
1663
|
+
modelID: string;
|
|
1664
|
+
};
|
|
1629
1665
|
command?: string;
|
|
1630
1666
|
};
|
|
1631
1667
|
export type Command = {
|
|
@@ -1689,6 +1725,7 @@ export type Model = {
|
|
|
1689
1725
|
};
|
|
1690
1726
|
limit: {
|
|
1691
1727
|
context: number;
|
|
1728
|
+
input?: number;
|
|
1692
1729
|
output: number;
|
|
1693
1730
|
};
|
|
1694
1731
|
status: "alpha" | "beta" | "deprecated" | "active";
|
|
@@ -3328,6 +3365,7 @@ export type ProviderListResponses = {
|
|
|
3328
3365
|
};
|
|
3329
3366
|
limit: {
|
|
3330
3367
|
context: number;
|
|
3368
|
+
input?: number;
|
|
3331
3369
|
output: number;
|
|
3332
3370
|
};
|
|
3333
3371
|
modalities?: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode-ai/sdk",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.24",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"scripts": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dist"
|
|
39
39
|
],
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@hey-api/openapi-ts": "0.
|
|
41
|
+
"@hey-api/openapi-ts": "0.90.4",
|
|
42
42
|
"@tsconfig/node22": "22.0.2",
|
|
43
43
|
"@types/node": "22.13.9",
|
|
44
44
|
"typescript": "5.8.2",
|