@opencode-ai/sdk 0.5.1 → 0.5.3
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 +137 -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;
|
|
@@ -481,6 +484,15 @@ export type Config = {
|
|
|
481
484
|
* Custom keybind configurations
|
|
482
485
|
*/
|
|
483
486
|
keybinds?: KeybindsConfig;
|
|
487
|
+
/**
|
|
488
|
+
* TUI specific settings
|
|
489
|
+
*/
|
|
490
|
+
tui?: {
|
|
491
|
+
/**
|
|
492
|
+
* TUI scroll speed
|
|
493
|
+
*/
|
|
494
|
+
scroll_speed: number;
|
|
495
|
+
};
|
|
484
496
|
plugin?: Array<string>;
|
|
485
497
|
snapshot?: boolean;
|
|
486
498
|
/**
|
|
@@ -648,25 +660,29 @@ export type KeybindsConfig = {
|
|
|
648
660
|
*/
|
|
649
661
|
app_help: string;
|
|
650
662
|
/**
|
|
651
|
-
*
|
|
663
|
+
* Exit the application
|
|
652
664
|
*/
|
|
653
|
-
|
|
665
|
+
app_exit: string;
|
|
654
666
|
/**
|
|
655
|
-
*
|
|
667
|
+
* Open external editor
|
|
656
668
|
*/
|
|
657
|
-
|
|
669
|
+
editor_open: string;
|
|
658
670
|
/**
|
|
659
|
-
*
|
|
671
|
+
* List available themes
|
|
660
672
|
*/
|
|
661
|
-
|
|
673
|
+
theme_list: string;
|
|
662
674
|
/**
|
|
663
|
-
*
|
|
675
|
+
* Create/update AGENTS.md
|
|
664
676
|
*/
|
|
665
|
-
|
|
677
|
+
project_init: string;
|
|
666
678
|
/**
|
|
667
|
-
*
|
|
679
|
+
* Toggle tool details
|
|
668
680
|
*/
|
|
669
|
-
|
|
681
|
+
tool_details: string;
|
|
682
|
+
/**
|
|
683
|
+
* Toggle thinking blocks
|
|
684
|
+
*/
|
|
685
|
+
thinking_blocks: string;
|
|
670
686
|
/**
|
|
671
687
|
* Export session to editor
|
|
672
688
|
*/
|
|
@@ -696,41 +712,73 @@ export type KeybindsConfig = {
|
|
|
696
712
|
*/
|
|
697
713
|
session_compact: string;
|
|
698
714
|
/**
|
|
699
|
-
*
|
|
715
|
+
* Cycle to next child session
|
|
700
716
|
*/
|
|
701
|
-
|
|
717
|
+
session_child_cycle: string;
|
|
702
718
|
/**
|
|
703
|
-
*
|
|
719
|
+
* Cycle to previous child session
|
|
704
720
|
*/
|
|
705
|
-
|
|
721
|
+
session_child_cycle_reverse: string;
|
|
706
722
|
/**
|
|
707
|
-
*
|
|
723
|
+
* Scroll messages up by one page
|
|
708
724
|
*/
|
|
709
|
-
|
|
725
|
+
messages_page_up: string;
|
|
710
726
|
/**
|
|
711
|
-
*
|
|
727
|
+
* Scroll messages down by one page
|
|
712
728
|
*/
|
|
713
|
-
|
|
729
|
+
messages_page_down: string;
|
|
714
730
|
/**
|
|
715
|
-
*
|
|
731
|
+
* Scroll messages up by half page
|
|
716
732
|
*/
|
|
717
|
-
|
|
733
|
+
messages_half_page_up: string;
|
|
718
734
|
/**
|
|
719
|
-
*
|
|
735
|
+
* Scroll messages down by half page
|
|
720
736
|
*/
|
|
721
|
-
|
|
737
|
+
messages_half_page_down: string;
|
|
722
738
|
/**
|
|
723
|
-
*
|
|
739
|
+
* Navigate to first message
|
|
724
740
|
*/
|
|
725
|
-
|
|
741
|
+
messages_first: string;
|
|
726
742
|
/**
|
|
727
|
-
*
|
|
743
|
+
* Navigate to last message
|
|
728
744
|
*/
|
|
729
|
-
|
|
745
|
+
messages_last: string;
|
|
730
746
|
/**
|
|
731
|
-
*
|
|
747
|
+
* Copy message
|
|
732
748
|
*/
|
|
733
|
-
|
|
749
|
+
messages_copy: string;
|
|
750
|
+
/**
|
|
751
|
+
* Undo message
|
|
752
|
+
*/
|
|
753
|
+
messages_undo: string;
|
|
754
|
+
/**
|
|
755
|
+
* Redo message
|
|
756
|
+
*/
|
|
757
|
+
messages_redo: string;
|
|
758
|
+
/**
|
|
759
|
+
* List available models
|
|
760
|
+
*/
|
|
761
|
+
model_list: string;
|
|
762
|
+
/**
|
|
763
|
+
* Next recent model
|
|
764
|
+
*/
|
|
765
|
+
model_cycle_recent: string;
|
|
766
|
+
/**
|
|
767
|
+
* Previous recent model
|
|
768
|
+
*/
|
|
769
|
+
model_cycle_recent_reverse: string;
|
|
770
|
+
/**
|
|
771
|
+
* List agents
|
|
772
|
+
*/
|
|
773
|
+
agent_list: string;
|
|
774
|
+
/**
|
|
775
|
+
* Next agent
|
|
776
|
+
*/
|
|
777
|
+
agent_cycle: string;
|
|
778
|
+
/**
|
|
779
|
+
* Previous agent
|
|
780
|
+
*/
|
|
781
|
+
agent_cycle_reverse: string;
|
|
734
782
|
/**
|
|
735
783
|
* Clear input field
|
|
736
784
|
*/
|
|
@@ -748,61 +796,53 @@ export type KeybindsConfig = {
|
|
|
748
796
|
*/
|
|
749
797
|
input_newline: string;
|
|
750
798
|
/**
|
|
751
|
-
*
|
|
799
|
+
* @deprecated use agent_cycle. Next mode
|
|
752
800
|
*/
|
|
753
|
-
|
|
754
|
-
/**
|
|
755
|
-
* Scroll messages down by one page
|
|
756
|
-
*/
|
|
757
|
-
messages_page_down: string;
|
|
758
|
-
/**
|
|
759
|
-
* Scroll messages up by half page
|
|
760
|
-
*/
|
|
761
|
-
messages_half_page_up: string;
|
|
801
|
+
switch_mode: string;
|
|
762
802
|
/**
|
|
763
|
-
*
|
|
803
|
+
* @deprecated use agent_cycle_reverse. Previous mode
|
|
764
804
|
*/
|
|
765
|
-
|
|
805
|
+
switch_mode_reverse: string;
|
|
766
806
|
/**
|
|
767
|
-
*
|
|
807
|
+
* @deprecated use agent_cycle. Next agent
|
|
768
808
|
*/
|
|
769
|
-
|
|
809
|
+
switch_agent: string;
|
|
770
810
|
/**
|
|
771
|
-
*
|
|
811
|
+
* @deprecated use agent_cycle_reverse. Previous agent
|
|
772
812
|
*/
|
|
773
|
-
|
|
813
|
+
switch_agent_reverse: string;
|
|
774
814
|
/**
|
|
775
|
-
*
|
|
815
|
+
* @deprecated Currently not available. List files
|
|
776
816
|
*/
|
|
777
|
-
|
|
817
|
+
file_list: string;
|
|
778
818
|
/**
|
|
779
|
-
*
|
|
819
|
+
* @deprecated Close file
|
|
780
820
|
*/
|
|
781
|
-
|
|
821
|
+
file_close: string;
|
|
782
822
|
/**
|
|
783
|
-
*
|
|
823
|
+
* @deprecated Search file
|
|
784
824
|
*/
|
|
785
|
-
|
|
825
|
+
file_search: string;
|
|
786
826
|
/**
|
|
787
|
-
*
|
|
827
|
+
* @deprecated Split/unified diff
|
|
788
828
|
*/
|
|
789
|
-
|
|
829
|
+
file_diff_toggle: string;
|
|
790
830
|
/**
|
|
791
|
-
* @deprecated
|
|
831
|
+
* @deprecated Navigate to previous message
|
|
792
832
|
*/
|
|
793
|
-
|
|
833
|
+
messages_previous: string;
|
|
794
834
|
/**
|
|
795
|
-
*
|
|
835
|
+
* @deprecated Navigate to next message
|
|
796
836
|
*/
|
|
797
|
-
|
|
837
|
+
messages_next: string;
|
|
798
838
|
/**
|
|
799
|
-
*
|
|
839
|
+
* @deprecated Toggle layout
|
|
800
840
|
*/
|
|
801
|
-
|
|
841
|
+
messages_layout_toggle: string;
|
|
802
842
|
/**
|
|
803
|
-
*
|
|
843
|
+
* @deprecated use messages_undo. Revert message
|
|
804
844
|
*/
|
|
805
|
-
|
|
845
|
+
messages_revert: string;
|
|
806
846
|
};
|
|
807
847
|
export type AgentConfig = {
|
|
808
848
|
model?: string;
|
|
@@ -959,6 +999,7 @@ export type Agent = {
|
|
|
959
999
|
name: string;
|
|
960
1000
|
description?: string;
|
|
961
1001
|
mode: "subagent" | "primary" | "all";
|
|
1002
|
+
builtIn: boolean;
|
|
962
1003
|
topP?: number;
|
|
963
1004
|
temperature?: number;
|
|
964
1005
|
permission: {
|
|
@@ -1068,7 +1109,10 @@ export type SessionListResponses = {
|
|
|
1068
1109
|
};
|
|
1069
1110
|
export type SessionListResponse = SessionListResponses[keyof SessionListResponses];
|
|
1070
1111
|
export type SessionCreateData = {
|
|
1071
|
-
body?:
|
|
1112
|
+
body?: {
|
|
1113
|
+
parentID?: string;
|
|
1114
|
+
title?: string;
|
|
1115
|
+
};
|
|
1072
1116
|
path?: never;
|
|
1073
1117
|
query?: never;
|
|
1074
1118
|
url: "/session";
|
|
@@ -1134,6 +1178,21 @@ export type SessionUpdateResponses = {
|
|
|
1134
1178
|
200: Session;
|
|
1135
1179
|
};
|
|
1136
1180
|
export type SessionUpdateResponse = SessionUpdateResponses[keyof SessionUpdateResponses];
|
|
1181
|
+
export type SessionChildrenData = {
|
|
1182
|
+
body?: never;
|
|
1183
|
+
path: {
|
|
1184
|
+
id: string;
|
|
1185
|
+
};
|
|
1186
|
+
query?: never;
|
|
1187
|
+
url: "/session/{id}/children";
|
|
1188
|
+
};
|
|
1189
|
+
export type SessionChildrenResponses = {
|
|
1190
|
+
/**
|
|
1191
|
+
* List of children
|
|
1192
|
+
*/
|
|
1193
|
+
200: Array<Session>;
|
|
1194
|
+
};
|
|
1195
|
+
export type SessionChildrenResponse = SessionChildrenResponses[keyof SessionChildrenResponses];
|
|
1137
1196
|
export type SessionInitData = {
|
|
1138
1197
|
body?: {
|
|
1139
1198
|
messageID: string;
|
|
@@ -1637,6 +1696,23 @@ export type TuiExecuteCommandResponses = {
|
|
|
1637
1696
|
200: boolean;
|
|
1638
1697
|
};
|
|
1639
1698
|
export type TuiExecuteCommandResponse = TuiExecuteCommandResponses[keyof TuiExecuteCommandResponses];
|
|
1699
|
+
export type TuiShowToastData = {
|
|
1700
|
+
body?: {
|
|
1701
|
+
title?: string;
|
|
1702
|
+
message: string;
|
|
1703
|
+
variant: "info" | "success" | "warning" | "error";
|
|
1704
|
+
};
|
|
1705
|
+
path?: never;
|
|
1706
|
+
query?: never;
|
|
1707
|
+
url: "/tui/show-toast";
|
|
1708
|
+
};
|
|
1709
|
+
export type TuiShowToastResponses = {
|
|
1710
|
+
/**
|
|
1711
|
+
* Toast notification shown successfully
|
|
1712
|
+
*/
|
|
1713
|
+
200: boolean;
|
|
1714
|
+
};
|
|
1715
|
+
export type TuiShowToastResponse = TuiShowToastResponses[keyof TuiShowToastResponses];
|
|
1640
1716
|
export type AuthSetData = {
|
|
1641
1717
|
body?: Auth;
|
|
1642
1718
|
path: {
|