|
|
@@ -1,7 +1,7 @@
|
|
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
|
|
|
|
import type { Options as ClientOptions, TDataShape, Client } from './client';
|
|
|
-import type { EventSubscribeData, EventSubscribeResponses, AppGetData, AppGetResponses, AppInitData, AppInitResponses, ConfigGetData, ConfigGetResponses, SessionListData, SessionListResponses, SessionCreateData, SessionCreateResponses, SessionCreateErrors, SessionDeleteData, SessionDeleteResponses, SessionInitData, SessionInitResponses, SessionAbortData, SessionAbortResponses, SessionUnshareData, SessionUnshareResponses, SessionShareData, SessionShareResponses, SessionSummarizeData, SessionSummarizeResponses, SessionMessagesData, SessionMessagesResponses, SessionChatData, SessionChatResponses, SessionRevertData, SessionRevertResponses, SessionUnrevertData, SessionUnrevertResponses, ConfigProvidersData, ConfigProvidersResponses, FindTextData, FindTextResponses, FindFilesData, FindFilesResponses, FindSymbolsData, FindSymbolsResponses, FileReadData, FileReadResponses, FileStatusData, FileStatusResponses, AppLogData, AppLogResponses, AppModesData, AppModesResponses, TuiAppendPromptData, TuiAppendPromptResponses, TuiOpenHelpData, TuiOpenHelpResponses } from './types.gen';
|
|
|
+import type { EventSubscribeData, EventSubscribeResponses, AppGetData, AppGetResponses, AppInitData, AppInitResponses, ConfigGetData, ConfigGetResponses, SessionListData, SessionListResponses, SessionCreateData, SessionCreateResponses, SessionCreateErrors, SessionDeleteData, SessionDeleteResponses, SessionInitData, SessionInitResponses, SessionAbortData, SessionAbortResponses, SessionUnshareData, SessionUnshareResponses, SessionShareData, SessionShareResponses, SessionSummarizeData, SessionSummarizeResponses, SessionMessagesData, SessionMessagesResponses, SessionChatData, SessionChatResponses, SessionMessageData, SessionMessageResponses, SessionRevertData, SessionRevertResponses, SessionUnrevertData, SessionUnrevertResponses, PostSessionByIdPermissionsByPermissionIdData, PostSessionByIdPermissionsByPermissionIdResponses, ConfigProvidersData, ConfigProvidersResponses, FindTextData, FindTextResponses, FindFilesData, FindFilesResponses, FindSymbolsData, FindSymbolsResponses, FileReadData, FileReadResponses, FileStatusData, FileStatusResponses, AppLogData, AppLogResponses, AppModesData, AppModesResponses, TuiAppendPromptData, TuiAppendPromptResponses, TuiOpenHelpData, TuiOpenHelpResponses, TuiOpenSessionsData, TuiOpenSessionsResponses, TuiOpenThemesData, TuiOpenThemesResponses, TuiOpenModelsData, TuiOpenModelsResponses, TuiSubmitPromptData, TuiSubmitPromptResponses, TuiClearPromptData, TuiClearPromptResponses, TuiExecuteCommandData, TuiExecuteCommandResponses } from './types.gen';
|
|
|
import { client as _heyApiClient } from './client.gen';
|
|
|
|
|
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
|
|
|
@@ -223,6 +223,16 @@ class Session extends _HeyApiClient {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Get a message from a session
|
|
|
+ */
|
|
|
+ public message<ThrowOnError extends boolean = false>(options: Options<SessionMessageData, ThrowOnError>) {
|
|
|
+ return (options.client ?? this._client).get<SessionMessageResponses, unknown, ThrowOnError>({
|
|
|
+ url: '/session/{id}/message/{messageID}',
|
|
|
+ ...options
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Revert a message
|
|
|
*/
|
|
|
@@ -326,9 +336,86 @@ class Tui extends _HeyApiClient {
|
|
|
...options
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Open the session dialog
|
|
|
+ */
|
|
|
+ public openSessions<ThrowOnError extends boolean = false>(options?: Options<TuiOpenSessionsData, ThrowOnError>) {
|
|
|
+ return (options?.client ?? this._client).post<TuiOpenSessionsResponses, unknown, ThrowOnError>({
|
|
|
+ url: '/tui/open-sessions',
|
|
|
+ ...options
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Open the theme dialog
|
|
|
+ */
|
|
|
+ public openThemes<ThrowOnError extends boolean = false>(options?: Options<TuiOpenThemesData, ThrowOnError>) {
|
|
|
+ return (options?.client ?? this._client).post<TuiOpenThemesResponses, unknown, ThrowOnError>({
|
|
|
+ url: '/tui/open-themes',
|
|
|
+ ...options
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Open the model dialog
|
|
|
+ */
|
|
|
+ public openModels<ThrowOnError extends boolean = false>(options?: Options<TuiOpenModelsData, ThrowOnError>) {
|
|
|
+ return (options?.client ?? this._client).post<TuiOpenModelsResponses, unknown, ThrowOnError>({
|
|
|
+ url: '/tui/open-models',
|
|
|
+ ...options
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Submit the prompt
|
|
|
+ */
|
|
|
+ public submitPrompt<ThrowOnError extends boolean = false>(options?: Options<TuiSubmitPromptData, ThrowOnError>) {
|
|
|
+ return (options?.client ?? this._client).post<TuiSubmitPromptResponses, unknown, ThrowOnError>({
|
|
|
+ url: '/tui/submit-prompt',
|
|
|
+ ...options
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Clear the prompt
|
|
|
+ */
|
|
|
+ public clearPrompt<ThrowOnError extends boolean = false>(options?: Options<TuiClearPromptData, ThrowOnError>) {
|
|
|
+ return (options?.client ?? this._client).post<TuiClearPromptResponses, unknown, ThrowOnError>({
|
|
|
+ url: '/tui/clear-prompt',
|
|
|
+ ...options
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Execute a TUI command (e.g. switch_mode)
|
|
|
+ */
|
|
|
+ public executeCommand<ThrowOnError extends boolean = false>(options?: Options<TuiExecuteCommandData, ThrowOnError>) {
|
|
|
+ return (options?.client ?? this._client).post<TuiExecuteCommandResponses, unknown, ThrowOnError>({
|
|
|
+ url: '/tui/execute-command',
|
|
|
+ ...options,
|
|
|
+ headers: {
|
|
|
+ 'Content-Type': 'application/json',
|
|
|
+ ...options?.headers
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
export class OpencodeClient extends _HeyApiClient {
|
|
|
+ /**
|
|
|
+ * Respond to a permission request
|
|
|
+ */
|
|
|
+ public postSessionByIdPermissionsByPermissionId<ThrowOnError extends boolean = false>(options: Options<PostSessionByIdPermissionsByPermissionIdData, ThrowOnError>) {
|
|
|
+ return (options.client ?? this._client).post<PostSessionByIdPermissionsByPermissionIdResponses, unknown, ThrowOnError>({
|
|
|
+ url: '/session/{id}/permissions/{permissionID}',
|
|
|
+ ...options,
|
|
|
+ headers: {
|
|
|
+ 'Content-Type': 'application/json',
|
|
|
+ ...options.headers
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
event = new Event({ client: this._client });
|
|
|
app = new App({ client: this._client });
|
|
|
config = new Config({ client: this._client });
|