@opencode-ai/sdk 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gen/sdk.gen.d.ts +10 -2
- package/dist/gen/sdk.gen.js +27 -1
- package/dist/gen/types.gen.d.ts +128 -61
- package/package.json +1 -1
package/dist/gen/sdk.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Options as ClientOptions, TDataShape, Client } from "./client/index.js";
|
|
2
|
-
import type { EventSubscribeData, EventSubscribeResponses, AppGetData, AppGetResponses, AppInitData, AppInitResponses, ConfigGetData, ConfigGetResponses, SessionListData, SessionListResponses, SessionCreateData, SessionCreateResponses, SessionCreateErrors, SessionDeleteData, SessionDeleteResponses, SessionGetData, SessionGetResponses, SessionUpdateData, SessionUpdateResponses, SessionInitData, SessionInitResponses, SessionAbortData, SessionAbortResponses, SessionUnshareData, SessionUnshareResponses, SessionShareData, SessionShareResponses, SessionSummarizeData, SessionSummarizeResponses, SessionMessagesData, SessionMessagesResponses, SessionChatData, SessionChatResponses, SessionMessageData, SessionMessageResponses, SessionShellData, SessionShellResponses, SessionRevertData, SessionRevertResponses, SessionUnrevertData, SessionUnrevertResponses, PostSessionByIdPermissionsByPermissionIdData, PostSessionByIdPermissionsByPermissionIdResponses, ConfigProvidersData, ConfigProvidersResponses, FindTextData, FindTextResponses, FindFilesData, FindFilesResponses, FindSymbolsData, FindSymbolsResponses, FileReadData, FileReadResponses, FileStatusData, FileStatusResponses, AppLogData, AppLogResponses, AppAgentsData, AppAgentsResponses, TuiAppendPromptData, TuiAppendPromptResponses, TuiOpenHelpData, TuiOpenHelpResponses, TuiOpenSessionsData, TuiOpenSessionsResponses, TuiOpenThemesData, TuiOpenThemesResponses, TuiOpenModelsData, TuiOpenModelsResponses, TuiSubmitPromptData, TuiSubmitPromptResponses, TuiClearPromptData, TuiClearPromptResponses, TuiExecuteCommandData, TuiExecuteCommandResponses, AuthSetData, AuthSetResponses, AuthSetErrors } from "./types.gen.js";
|
|
2
|
+
import type { EventSubscribeData, EventSubscribeResponses, AppGetData, AppGetResponses, AppInitData, AppInitResponses, ConfigGetData, ConfigGetResponses, SessionListData, SessionListResponses, SessionCreateData, SessionCreateResponses, SessionCreateErrors, SessionDeleteData, SessionDeleteResponses, SessionGetData, SessionGetResponses, SessionUpdateData, SessionUpdateResponses, SessionChildrenData, SessionChildrenResponses, SessionInitData, SessionInitResponses, SessionAbortData, SessionAbortResponses, SessionUnshareData, SessionUnshareResponses, SessionShareData, SessionShareResponses, SessionSummarizeData, SessionSummarizeResponses, SessionMessagesData, SessionMessagesResponses, SessionChatData, SessionChatResponses, SessionMessageData, SessionMessageResponses, SessionShellData, SessionShellResponses, SessionRevertData, SessionRevertResponses, SessionUnrevertData, SessionUnrevertResponses, PostSessionByIdPermissionsByPermissionIdData, PostSessionByIdPermissionsByPermissionIdResponses, ConfigProvidersData, ConfigProvidersResponses, FindTextData, FindTextResponses, FindFilesData, FindFilesResponses, FindSymbolsData, FindSymbolsResponses, FileReadData, FileReadResponses, FileStatusData, FileStatusResponses, AppLogData, AppLogResponses, AppAgentsData, AppAgentsResponses, TuiAppendPromptData, TuiAppendPromptResponses, TuiOpenHelpData, TuiOpenHelpResponses, TuiOpenSessionsData, TuiOpenSessionsResponses, TuiOpenThemesData, TuiOpenThemesResponses, TuiOpenModelsData, TuiOpenModelsResponses, TuiSubmitPromptData, TuiSubmitPromptResponses, TuiClearPromptData, TuiClearPromptResponses, TuiExecuteCommandData, TuiExecuteCommandResponses, TuiShowToastData, TuiShowToastResponses, AuthSetData, AuthSetResponses, AuthSetErrors } 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
|
|
@@ -74,6 +74,10 @@ declare class Session extends _HeyApiClient {
|
|
|
74
74
|
* Update session properties
|
|
75
75
|
*/
|
|
76
76
|
update<ThrowOnError extends boolean = false>(options: Options<SessionUpdateData, ThrowOnError>): import("./client/types.js").RequestResult<SessionUpdateResponses, unknown, ThrowOnError, "fields">;
|
|
77
|
+
/**
|
|
78
|
+
* Get a session's children
|
|
79
|
+
*/
|
|
80
|
+
children<ThrowOnError extends boolean = false>(options: Options<SessionChildrenData, ThrowOnError>): import("./client/types.js").RequestResult<SessionChildrenResponses, unknown, ThrowOnError, "fields">;
|
|
77
81
|
/**
|
|
78
82
|
* Analyze the app and create an AGENTS.md file
|
|
79
83
|
*/
|
|
@@ -173,9 +177,13 @@ declare class Tui extends _HeyApiClient {
|
|
|
173
177
|
*/
|
|
174
178
|
clearPrompt<ThrowOnError extends boolean = false>(options?: Options<TuiClearPromptData, ThrowOnError>): import("./client/types.js").RequestResult<TuiClearPromptResponses, unknown, ThrowOnError, "fields">;
|
|
175
179
|
/**
|
|
176
|
-
* Execute a TUI command (e.g.
|
|
180
|
+
* Execute a TUI command (e.g. agent_cycle)
|
|
177
181
|
*/
|
|
178
182
|
executeCommand<ThrowOnError extends boolean = false>(options?: Options<TuiExecuteCommandData, ThrowOnError>): import("./client/types.js").RequestResult<TuiExecuteCommandResponses, unknown, ThrowOnError, "fields">;
|
|
183
|
+
/**
|
|
184
|
+
* Show a toast notification in the TUI
|
|
185
|
+
*/
|
|
186
|
+
showToast<ThrowOnError extends boolean = false>(options?: Options<TuiShowToastData, ThrowOnError>): import("./client/types.js").RequestResult<TuiShowToastResponses, unknown, ThrowOnError, "fields">;
|
|
179
187
|
}
|
|
180
188
|
declare class Auth extends _HeyApiClient {
|
|
181
189
|
/**
|
package/dist/gen/sdk.gen.js
CHANGED
|
@@ -98,6 +98,10 @@ class Session extends _HeyApiClient {
|
|
|
98
98
|
return (options?.client ?? this._client).post({
|
|
99
99
|
url: "/session",
|
|
100
100
|
...options,
|
|
101
|
+
headers: {
|
|
102
|
+
"Content-Type": "application/json",
|
|
103
|
+
...options?.headers,
|
|
104
|
+
},
|
|
101
105
|
});
|
|
102
106
|
}
|
|
103
107
|
/**
|
|
@@ -131,6 +135,15 @@ class Session extends _HeyApiClient {
|
|
|
131
135
|
},
|
|
132
136
|
});
|
|
133
137
|
}
|
|
138
|
+
/**
|
|
139
|
+
* Get a session's children
|
|
140
|
+
*/
|
|
141
|
+
children(options) {
|
|
142
|
+
return (options.client ?? this._client).get({
|
|
143
|
+
url: "/session/{id}/children",
|
|
144
|
+
...options,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
134
147
|
/**
|
|
135
148
|
* Analyze the app and create an AGENTS.md file
|
|
136
149
|
*/
|
|
@@ -369,7 +382,7 @@ class Tui extends _HeyApiClient {
|
|
|
369
382
|
});
|
|
370
383
|
}
|
|
371
384
|
/**
|
|
372
|
-
* Execute a TUI command (e.g.
|
|
385
|
+
* Execute a TUI command (e.g. agent_cycle)
|
|
373
386
|
*/
|
|
374
387
|
executeCommand(options) {
|
|
375
388
|
return (options?.client ?? this._client).post({
|
|
@@ -381,6 +394,19 @@ class Tui extends _HeyApiClient {
|
|
|
381
394
|
},
|
|
382
395
|
});
|
|
383
396
|
}
|
|
397
|
+
/**
|
|
398
|
+
* Show a toast notification in the TUI
|
|
399
|
+
*/
|
|
400
|
+
showToast(options) {
|
|
401
|
+
return (options?.client ?? this._client).post({
|
|
402
|
+
url: "/tui/show-toast",
|
|
403
|
+
...options,
|
|
404
|
+
headers: {
|
|
405
|
+
"Content-Type": "application/json",
|
|
406
|
+
...options?.headers,
|
|
407
|
+
},
|
|
408
|
+
});
|
|
409
|
+
}
|
|
384
410
|
}
|
|
385
411
|
class Auth extends _HeyApiClient {
|
|
386
412
|
/**
|
package/dist/gen/types.gen.d.ts
CHANGED
|
@@ -281,6 +281,9 @@ export type ToolStateError = {
|
|
|
281
281
|
[key: string]: unknown;
|
|
282
282
|
};
|
|
283
283
|
error: string;
|
|
284
|
+
metadata?: {
|
|
285
|
+
[key: string]: unknown;
|
|
286
|
+
};
|
|
284
287
|
time: {
|
|
285
288
|
start: number;
|
|
286
289
|
end: number;
|
|
@@ -648,25 +651,29 @@ export type KeybindsConfig = {
|
|
|
648
651
|
*/
|
|
649
652
|
app_help: string;
|
|
650
653
|
/**
|
|
651
|
-
*
|
|
654
|
+
* Exit the application
|
|
652
655
|
*/
|
|
653
|
-
|
|
656
|
+
app_exit: string;
|
|
654
657
|
/**
|
|
655
|
-
*
|
|
658
|
+
* Open external editor
|
|
656
659
|
*/
|
|
657
|
-
|
|
660
|
+
editor_open: string;
|
|
658
661
|
/**
|
|
659
|
-
*
|
|
662
|
+
* List available themes
|
|
660
663
|
*/
|
|
661
|
-
|
|
664
|
+
theme_list: string;
|
|
662
665
|
/**
|
|
663
|
-
*
|
|
666
|
+
* Create/update AGENTS.md
|
|
664
667
|
*/
|
|
665
|
-
|
|
668
|
+
project_init: string;
|
|
666
669
|
/**
|
|
667
|
-
*
|
|
670
|
+
* Toggle tool details
|
|
668
671
|
*/
|
|
669
|
-
|
|
672
|
+
tool_details: string;
|
|
673
|
+
/**
|
|
674
|
+
* Toggle thinking blocks
|
|
675
|
+
*/
|
|
676
|
+
thinking_blocks: string;
|
|
670
677
|
/**
|
|
671
678
|
* Export session to editor
|
|
672
679
|
*/
|
|
@@ -696,41 +703,73 @@ export type KeybindsConfig = {
|
|
|
696
703
|
*/
|
|
697
704
|
session_compact: string;
|
|
698
705
|
/**
|
|
699
|
-
*
|
|
706
|
+
* Cycle to next child session
|
|
700
707
|
*/
|
|
701
|
-
|
|
708
|
+
session_child_cycle: string;
|
|
702
709
|
/**
|
|
703
|
-
*
|
|
710
|
+
* Cycle to previous child session
|
|
704
711
|
*/
|
|
705
|
-
|
|
712
|
+
session_child_cycle_reverse: string;
|
|
706
713
|
/**
|
|
707
|
-
*
|
|
714
|
+
* Scroll messages up by one page
|
|
708
715
|
*/
|
|
709
|
-
|
|
716
|
+
messages_page_up: string;
|
|
710
717
|
/**
|
|
711
|
-
*
|
|
718
|
+
* Scroll messages down by one page
|
|
712
719
|
*/
|
|
713
|
-
|
|
720
|
+
messages_page_down: string;
|
|
714
721
|
/**
|
|
715
|
-
*
|
|
722
|
+
* Scroll messages up by half page
|
|
716
723
|
*/
|
|
717
|
-
|
|
724
|
+
messages_half_page_up: string;
|
|
718
725
|
/**
|
|
719
|
-
*
|
|
726
|
+
* Scroll messages down by half page
|
|
720
727
|
*/
|
|
721
|
-
|
|
728
|
+
messages_half_page_down: string;
|
|
722
729
|
/**
|
|
723
|
-
*
|
|
730
|
+
* Navigate to first message
|
|
724
731
|
*/
|
|
725
|
-
|
|
732
|
+
messages_first: string;
|
|
726
733
|
/**
|
|
727
|
-
*
|
|
734
|
+
* Navigate to last message
|
|
728
735
|
*/
|
|
729
|
-
|
|
736
|
+
messages_last: string;
|
|
730
737
|
/**
|
|
731
|
-
*
|
|
738
|
+
* Copy message
|
|
732
739
|
*/
|
|
733
|
-
|
|
740
|
+
messages_copy: string;
|
|
741
|
+
/**
|
|
742
|
+
* Undo message
|
|
743
|
+
*/
|
|
744
|
+
messages_undo: string;
|
|
745
|
+
/**
|
|
746
|
+
* Redo message
|
|
747
|
+
*/
|
|
748
|
+
messages_redo: string;
|
|
749
|
+
/**
|
|
750
|
+
* List available models
|
|
751
|
+
*/
|
|
752
|
+
model_list: string;
|
|
753
|
+
/**
|
|
754
|
+
* Next recent model
|
|
755
|
+
*/
|
|
756
|
+
model_cycle_recent: string;
|
|
757
|
+
/**
|
|
758
|
+
* Previous recent model
|
|
759
|
+
*/
|
|
760
|
+
model_cycle_recent_reverse: string;
|
|
761
|
+
/**
|
|
762
|
+
* List agents
|
|
763
|
+
*/
|
|
764
|
+
agent_list: string;
|
|
765
|
+
/**
|
|
766
|
+
* Next agent
|
|
767
|
+
*/
|
|
768
|
+
agent_cycle: string;
|
|
769
|
+
/**
|
|
770
|
+
* Previous agent
|
|
771
|
+
*/
|
|
772
|
+
agent_cycle_reverse: string;
|
|
734
773
|
/**
|
|
735
774
|
* Clear input field
|
|
736
775
|
*/
|
|
@@ -748,61 +787,53 @@ export type KeybindsConfig = {
|
|
|
748
787
|
*/
|
|
749
788
|
input_newline: string;
|
|
750
789
|
/**
|
|
751
|
-
*
|
|
752
|
-
*/
|
|
753
|
-
messages_page_up: string;
|
|
754
|
-
/**
|
|
755
|
-
* Scroll messages down by one page
|
|
756
|
-
*/
|
|
757
|
-
messages_page_down: string;
|
|
758
|
-
/**
|
|
759
|
-
* Scroll messages up by half page
|
|
790
|
+
* @deprecated use agent_cycle. Next mode
|
|
760
791
|
*/
|
|
761
|
-
|
|
792
|
+
switch_mode: string;
|
|
762
793
|
/**
|
|
763
|
-
*
|
|
794
|
+
* @deprecated use agent_cycle_reverse. Previous mode
|
|
764
795
|
*/
|
|
765
|
-
|
|
796
|
+
switch_mode_reverse: string;
|
|
766
797
|
/**
|
|
767
|
-
*
|
|
798
|
+
* @deprecated use agent_cycle. Next agent
|
|
768
799
|
*/
|
|
769
|
-
|
|
800
|
+
switch_agent: string;
|
|
770
801
|
/**
|
|
771
|
-
*
|
|
802
|
+
* @deprecated use agent_cycle_reverse. Previous agent
|
|
772
803
|
*/
|
|
773
|
-
|
|
804
|
+
switch_agent_reverse: string;
|
|
774
805
|
/**
|
|
775
|
-
*
|
|
806
|
+
* @deprecated Currently not available. List files
|
|
776
807
|
*/
|
|
777
|
-
|
|
808
|
+
file_list: string;
|
|
778
809
|
/**
|
|
779
|
-
*
|
|
810
|
+
* @deprecated Close file
|
|
780
811
|
*/
|
|
781
|
-
|
|
812
|
+
file_close: string;
|
|
782
813
|
/**
|
|
783
|
-
*
|
|
814
|
+
* @deprecated Search file
|
|
784
815
|
*/
|
|
785
|
-
|
|
816
|
+
file_search: string;
|
|
786
817
|
/**
|
|
787
|
-
*
|
|
818
|
+
* @deprecated Split/unified diff
|
|
788
819
|
*/
|
|
789
|
-
|
|
820
|
+
file_diff_toggle: string;
|
|
790
821
|
/**
|
|
791
|
-
* @deprecated
|
|
822
|
+
* @deprecated Navigate to previous message
|
|
792
823
|
*/
|
|
793
|
-
|
|
824
|
+
messages_previous: string;
|
|
794
825
|
/**
|
|
795
|
-
*
|
|
826
|
+
* @deprecated Navigate to next message
|
|
796
827
|
*/
|
|
797
|
-
|
|
828
|
+
messages_next: string;
|
|
798
829
|
/**
|
|
799
|
-
*
|
|
830
|
+
* @deprecated Toggle layout
|
|
800
831
|
*/
|
|
801
|
-
|
|
832
|
+
messages_layout_toggle: string;
|
|
802
833
|
/**
|
|
803
|
-
*
|
|
834
|
+
* @deprecated use messages_undo. Revert message
|
|
804
835
|
*/
|
|
805
|
-
|
|
836
|
+
messages_revert: string;
|
|
806
837
|
};
|
|
807
838
|
export type AgentConfig = {
|
|
808
839
|
model?: string;
|
|
@@ -959,6 +990,7 @@ export type Agent = {
|
|
|
959
990
|
name: string;
|
|
960
991
|
description?: string;
|
|
961
992
|
mode: "subagent" | "primary" | "all";
|
|
993
|
+
builtIn: boolean;
|
|
962
994
|
topP?: number;
|
|
963
995
|
temperature?: number;
|
|
964
996
|
permission: {
|
|
@@ -1068,7 +1100,10 @@ export type SessionListResponses = {
|
|
|
1068
1100
|
};
|
|
1069
1101
|
export type SessionListResponse = SessionListResponses[keyof SessionListResponses];
|
|
1070
1102
|
export type SessionCreateData = {
|
|
1071
|
-
body?:
|
|
1103
|
+
body?: {
|
|
1104
|
+
parentID?: string;
|
|
1105
|
+
title?: string;
|
|
1106
|
+
};
|
|
1072
1107
|
path?: never;
|
|
1073
1108
|
query?: never;
|
|
1074
1109
|
url: "/session";
|
|
@@ -1134,6 +1169,21 @@ export type SessionUpdateResponses = {
|
|
|
1134
1169
|
200: Session;
|
|
1135
1170
|
};
|
|
1136
1171
|
export type SessionUpdateResponse = SessionUpdateResponses[keyof SessionUpdateResponses];
|
|
1172
|
+
export type SessionChildrenData = {
|
|
1173
|
+
body?: never;
|
|
1174
|
+
path: {
|
|
1175
|
+
id: string;
|
|
1176
|
+
};
|
|
1177
|
+
query?: never;
|
|
1178
|
+
url: "/session/{id}/children";
|
|
1179
|
+
};
|
|
1180
|
+
export type SessionChildrenResponses = {
|
|
1181
|
+
/**
|
|
1182
|
+
* List of children
|
|
1183
|
+
*/
|
|
1184
|
+
200: Array<Session>;
|
|
1185
|
+
};
|
|
1186
|
+
export type SessionChildrenResponse = SessionChildrenResponses[keyof SessionChildrenResponses];
|
|
1137
1187
|
export type SessionInitData = {
|
|
1138
1188
|
body?: {
|
|
1139
1189
|
messageID: string;
|
|
@@ -1637,6 +1687,23 @@ export type TuiExecuteCommandResponses = {
|
|
|
1637
1687
|
200: boolean;
|
|
1638
1688
|
};
|
|
1639
1689
|
export type TuiExecuteCommandResponse = TuiExecuteCommandResponses[keyof TuiExecuteCommandResponses];
|
|
1690
|
+
export type TuiShowToastData = {
|
|
1691
|
+
body?: {
|
|
1692
|
+
title?: string;
|
|
1693
|
+
message: string;
|
|
1694
|
+
variant: "info" | "success" | "warning" | "error";
|
|
1695
|
+
};
|
|
1696
|
+
path?: never;
|
|
1697
|
+
query?: never;
|
|
1698
|
+
url: "/tui/show-toast";
|
|
1699
|
+
};
|
|
1700
|
+
export type TuiShowToastResponses = {
|
|
1701
|
+
/**
|
|
1702
|
+
* Toast notification shown successfully
|
|
1703
|
+
*/
|
|
1704
|
+
200: boolean;
|
|
1705
|
+
};
|
|
1706
|
+
export type TuiShowToastResponse = TuiShowToastResponses[keyof TuiShowToastResponses];
|
|
1640
1707
|
export type AuthSetData = {
|
|
1641
1708
|
body?: Auth;
|
|
1642
1709
|
path: {
|