|
|
@@ -26,42 +26,60 @@ import type {
|
|
|
SessionCreateErrors,
|
|
|
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,
|
|
|
SessionSummarizeData,
|
|
|
SessionSummarizeResponses,
|
|
|
+ SessionSummarizeErrors,
|
|
|
SessionMessagesData,
|
|
|
SessionMessagesResponses,
|
|
|
+ SessionMessagesErrors,
|
|
|
SessionPromptData,
|
|
|
SessionPromptResponses,
|
|
|
+ SessionPromptErrors,
|
|
|
SessionMessageData,
|
|
|
SessionMessageResponses,
|
|
|
+ SessionMessageErrors,
|
|
|
SessionCommandData,
|
|
|
SessionCommandResponses,
|
|
|
+ SessionCommandErrors,
|
|
|
SessionShellData,
|
|
|
SessionShellResponses,
|
|
|
+ SessionShellErrors,
|
|
|
SessionRevertData,
|
|
|
SessionRevertResponses,
|
|
|
+ SessionRevertErrors,
|
|
|
SessionUnrevertData,
|
|
|
SessionUnrevertResponses,
|
|
|
+ SessionUnrevertErrors,
|
|
|
PostSessionIdPermissionsPermissionIdData,
|
|
|
PostSessionIdPermissionsPermissionIdResponses,
|
|
|
+ PostSessionIdPermissionsPermissionIdErrors,
|
|
|
CommandListData,
|
|
|
CommandListResponses,
|
|
|
ConfigProvidersData,
|
|
|
@@ -80,12 +98,14 @@ import type {
|
|
|
FileStatusResponses,
|
|
|
AppLogData,
|
|
|
AppLogResponses,
|
|
|
+ AppLogErrors,
|
|
|
AppAgentsData,
|
|
|
AppAgentsResponses,
|
|
|
McpStatusData,
|
|
|
McpStatusResponses,
|
|
|
TuiAppendPromptData,
|
|
|
TuiAppendPromptResponses,
|
|
|
+ TuiAppendPromptErrors,
|
|
|
TuiOpenHelpData,
|
|
|
TuiOpenHelpResponses,
|
|
|
TuiOpenSessionsData,
|
|
|
@@ -100,6 +120,7 @@ import type {
|
|
|
TuiClearPromptResponses,
|
|
|
TuiExecuteCommandData,
|
|
|
TuiExecuteCommandResponses,
|
|
|
+ TuiExecuteCommandErrors,
|
|
|
TuiShowToastData,
|
|
|
TuiShowToastResponses,
|
|
|
AuthSetData,
|
|
|
@@ -258,7 +279,7 @@ class Session extends _HeyApiClient {
|
|
|
* Delete a session and all its data
|
|
|
*/
|
|
|
public delete<ThrowOnError extends boolean = false>(options: Options<SessionDeleteData, ThrowOnError>) {
|
|
|
- return (options.client ?? this._client).delete<SessionDeleteResponses, unknown, ThrowOnError>({
|
|
|
+ return (options.client ?? this._client).delete<SessionDeleteResponses, SessionDeleteErrors, ThrowOnError>({
|
|
|
url: "/session/{id}",
|
|
|
...options,
|
|
|
})
|
|
|
@@ -268,7 +289,7 @@ class Session extends _HeyApiClient {
|
|
|
* Get session
|
|
|
*/
|
|
|
public get<ThrowOnError extends boolean = false>(options: Options<SessionGetData, ThrowOnError>) {
|
|
|
- return (options.client ?? this._client).get<SessionGetResponses, unknown, ThrowOnError>({
|
|
|
+ return (options.client ?? this._client).get<SessionGetResponses, SessionGetErrors, ThrowOnError>({
|
|
|
url: "/session/{id}",
|
|
|
...options,
|
|
|
})
|
|
|
@@ -278,7 +299,7 @@ class Session extends _HeyApiClient {
|
|
|
* Update session properties
|
|
|
*/
|
|
|
public update<ThrowOnError extends boolean = false>(options: Options<SessionUpdateData, ThrowOnError>) {
|
|
|
- return (options.client ?? this._client).patch<SessionUpdateResponses, unknown, ThrowOnError>({
|
|
|
+ return (options.client ?? this._client).patch<SessionUpdateResponses, SessionUpdateErrors, ThrowOnError>({
|
|
|
url: "/session/{id}",
|
|
|
...options,
|
|
|
headers: {
|
|
|
@@ -292,7 +313,7 @@ class Session extends _HeyApiClient {
|
|
|
* Get a session's children
|
|
|
*/
|
|
|
public children<ThrowOnError extends boolean = false>(options: Options<SessionChildrenData, ThrowOnError>) {
|
|
|
- return (options.client ?? this._client).get<SessionChildrenResponses, unknown, ThrowOnError>({
|
|
|
+ return (options.client ?? this._client).get<SessionChildrenResponses, SessionChildrenErrors, ThrowOnError>({
|
|
|
url: "/session/{id}/children",
|
|
|
...options,
|
|
|
})
|
|
|
@@ -302,7 +323,7 @@ class Session extends _HeyApiClient {
|
|
|
* Get the todo list for a session
|
|
|
*/
|
|
|
public todo<ThrowOnError extends boolean = false>(options: Options<SessionTodoData, ThrowOnError>) {
|
|
|
- return (options.client ?? this._client).get<SessionTodoResponses, unknown, ThrowOnError>({
|
|
|
+ return (options.client ?? this._client).get<SessionTodoResponses, SessionTodoErrors, ThrowOnError>({
|
|
|
url: "/session/{id}/todo",
|
|
|
...options,
|
|
|
})
|
|
|
@@ -312,7 +333,7 @@ class Session extends _HeyApiClient {
|
|
|
* Analyze the app and create an AGENTS.md file
|
|
|
*/
|
|
|
public init<ThrowOnError extends boolean = false>(options: Options<SessionInitData, ThrowOnError>) {
|
|
|
- return (options.client ?? this._client).post<SessionInitResponses, unknown, ThrowOnError>({
|
|
|
+ return (options.client ?? this._client).post<SessionInitResponses, SessionInitErrors, ThrowOnError>({
|
|
|
url: "/session/{id}/init",
|
|
|
...options,
|
|
|
headers: {
|
|
|
@@ -340,7 +361,7 @@ class Session extends _HeyApiClient {
|
|
|
* Abort a session
|
|
|
*/
|
|
|
public abort<ThrowOnError extends boolean = false>(options: Options<SessionAbortData, ThrowOnError>) {
|
|
|
- return (options.client ?? this._client).post<SessionAbortResponses, unknown, ThrowOnError>({
|
|
|
+ return (options.client ?? this._client).post<SessionAbortResponses, SessionAbortErrors, ThrowOnError>({
|
|
|
url: "/session/{id}/abort",
|
|
|
...options,
|
|
|
})
|
|
|
@@ -350,7 +371,7 @@ class Session extends _HeyApiClient {
|
|
|
* Unshare the session
|
|
|
*/
|
|
|
public unshare<ThrowOnError extends boolean = false>(options: Options<SessionUnshareData, ThrowOnError>) {
|
|
|
- return (options.client ?? this._client).delete<SessionUnshareResponses, unknown, ThrowOnError>({
|
|
|
+ return (options.client ?? this._client).delete<SessionUnshareResponses, SessionUnshareErrors, ThrowOnError>({
|
|
|
url: "/session/{id}/share",
|
|
|
...options,
|
|
|
})
|
|
|
@@ -360,7 +381,7 @@ class Session extends _HeyApiClient {
|
|
|
* Share a session
|
|
|
*/
|
|
|
public share<ThrowOnError extends boolean = false>(options: Options<SessionShareData, ThrowOnError>) {
|
|
|
- return (options.client ?? this._client).post<SessionShareResponses, unknown, ThrowOnError>({
|
|
|
+ return (options.client ?? this._client).post<SessionShareResponses, SessionShareErrors, ThrowOnError>({
|
|
|
url: "/session/{id}/share",
|
|
|
...options,
|
|
|
})
|
|
|
@@ -370,7 +391,7 @@ class Session extends _HeyApiClient {
|
|
|
* Summarize the session
|
|
|
*/
|
|
|
public summarize<ThrowOnError extends boolean = false>(options: Options<SessionSummarizeData, ThrowOnError>) {
|
|
|
- return (options.client ?? this._client).post<SessionSummarizeResponses, unknown, ThrowOnError>({
|
|
|
+ return (options.client ?? this._client).post<SessionSummarizeResponses, SessionSummarizeErrors, ThrowOnError>({
|
|
|
url: "/session/{id}/summarize",
|
|
|
...options,
|
|
|
headers: {
|
|
|
@@ -384,7 +405,7 @@ class Session extends _HeyApiClient {
|
|
|
* List messages for a session
|
|
|
*/
|
|
|
public messages<ThrowOnError extends boolean = false>(options: Options<SessionMessagesData, ThrowOnError>) {
|
|
|
- return (options.client ?? this._client).get<SessionMessagesResponses, unknown, ThrowOnError>({
|
|
|
+ return (options.client ?? this._client).get<SessionMessagesResponses, SessionMessagesErrors, ThrowOnError>({
|
|
|
url: "/session/{id}/message",
|
|
|
...options,
|
|
|
})
|
|
|
@@ -394,7 +415,7 @@ class Session extends _HeyApiClient {
|
|
|
* Create and send a new message to a session
|
|
|
*/
|
|
|
public prompt<ThrowOnError extends boolean = false>(options: Options<SessionPromptData, ThrowOnError>) {
|
|
|
- return (options.client ?? this._client).post<SessionPromptResponses, unknown, ThrowOnError>({
|
|
|
+ return (options.client ?? this._client).post<SessionPromptResponses, SessionPromptErrors, ThrowOnError>({
|
|
|
url: "/session/{id}/message",
|
|
|
...options,
|
|
|
headers: {
|
|
|
@@ -408,7 +429,7 @@ 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>({
|
|
|
+ return (options.client ?? this._client).get<SessionMessageResponses, SessionMessageErrors, ThrowOnError>({
|
|
|
url: "/session/{id}/message/{messageID}",
|
|
|
...options,
|
|
|
})
|
|
|
@@ -418,7 +439,7 @@ class Session extends _HeyApiClient {
|
|
|
* Send a new command to a session
|
|
|
*/
|
|
|
public command<ThrowOnError extends boolean = false>(options: Options<SessionCommandData, ThrowOnError>) {
|
|
|
- return (options.client ?? this._client).post<SessionCommandResponses, unknown, ThrowOnError>({
|
|
|
+ return (options.client ?? this._client).post<SessionCommandResponses, SessionCommandErrors, ThrowOnError>({
|
|
|
url: "/session/{id}/command",
|
|
|
...options,
|
|
|
headers: {
|
|
|
@@ -432,7 +453,7 @@ class Session extends _HeyApiClient {
|
|
|
* Run a shell command
|
|
|
*/
|
|
|
public shell<ThrowOnError extends boolean = false>(options: Options<SessionShellData, ThrowOnError>) {
|
|
|
- return (options.client ?? this._client).post<SessionShellResponses, unknown, ThrowOnError>({
|
|
|
+ return (options.client ?? this._client).post<SessionShellResponses, SessionShellErrors, ThrowOnError>({
|
|
|
url: "/session/{id}/shell",
|
|
|
...options,
|
|
|
headers: {
|
|
|
@@ -446,7 +467,7 @@ class Session extends _HeyApiClient {
|
|
|
* Revert a message
|
|
|
*/
|
|
|
public revert<ThrowOnError extends boolean = false>(options: Options<SessionRevertData, ThrowOnError>) {
|
|
|
- return (options.client ?? this._client).post<SessionRevertResponses, unknown, ThrowOnError>({
|
|
|
+ return (options.client ?? this._client).post<SessionRevertResponses, SessionRevertErrors, ThrowOnError>({
|
|
|
url: "/session/{id}/revert",
|
|
|
...options,
|
|
|
headers: {
|
|
|
@@ -460,7 +481,7 @@ class Session extends _HeyApiClient {
|
|
|
* Restore all reverted messages
|
|
|
*/
|
|
|
public unrevert<ThrowOnError extends boolean = false>(options: Options<SessionUnrevertData, ThrowOnError>) {
|
|
|
- return (options.client ?? this._client).post<SessionUnrevertResponses, unknown, ThrowOnError>({
|
|
|
+ return (options.client ?? this._client).post<SessionUnrevertResponses, SessionUnrevertErrors, ThrowOnError>({
|
|
|
url: "/session/{id}/unrevert",
|
|
|
...options,
|
|
|
})
|
|
|
@@ -548,7 +569,7 @@ class App extends _HeyApiClient {
|
|
|
* Write a log entry to the server logs
|
|
|
*/
|
|
|
public log<ThrowOnError extends boolean = false>(options?: Options<AppLogData, ThrowOnError>) {
|
|
|
- return (options?.client ?? this._client).post<AppLogResponses, unknown, ThrowOnError>({
|
|
|
+ return (options?.client ?? this._client).post<AppLogResponses, AppLogErrors, ThrowOnError>({
|
|
|
url: "/log",
|
|
|
...options,
|
|
|
headers: {
|
|
|
@@ -586,7 +607,7 @@ class Tui extends _HeyApiClient {
|
|
|
* Append prompt to the TUI
|
|
|
*/
|
|
|
public appendPrompt<ThrowOnError extends boolean = false>(options?: Options<TuiAppendPromptData, ThrowOnError>) {
|
|
|
- return (options?.client ?? this._client).post<TuiAppendPromptResponses, unknown, ThrowOnError>({
|
|
|
+ return (options?.client ?? this._client).post<TuiAppendPromptResponses, TuiAppendPromptErrors, ThrowOnError>({
|
|
|
url: "/tui/append-prompt",
|
|
|
...options,
|
|
|
headers: {
|
|
|
@@ -660,7 +681,7 @@ class Tui extends _HeyApiClient {
|
|
|
* Execute a TUI command (e.g. agent_cycle)
|
|
|
*/
|
|
|
public executeCommand<ThrowOnError extends boolean = false>(options?: Options<TuiExecuteCommandData, ThrowOnError>) {
|
|
|
- return (options?.client ?? this._client).post<TuiExecuteCommandResponses, unknown, ThrowOnError>({
|
|
|
+ return (options?.client ?? this._client).post<TuiExecuteCommandResponses, TuiExecuteCommandErrors, ThrowOnError>({
|
|
|
url: "/tui/execute-command",
|
|
|
...options,
|
|
|
headers: {
|
|
|
@@ -720,7 +741,11 @@ export class OpencodeClient extends _HeyApiClient {
|
|
|
public postSessionIdPermissionsPermissionId<ThrowOnError extends boolean = false>(
|
|
|
options: Options<PostSessionIdPermissionsPermissionIdData, ThrowOnError>,
|
|
|
) {
|
|
|
- return (options.client ?? this._client).post<PostSessionIdPermissionsPermissionIdResponses, unknown, ThrowOnError>({
|
|
|
+ return (options.client ?? this._client).post<
|
|
|
+ PostSessionIdPermissionsPermissionIdResponses,
|
|
|
+ PostSessionIdPermissionsPermissionIdErrors,
|
|
|
+ ThrowOnError
|
|
|
+ >({
|
|
|
url: "/session/{id}/permissions/{permissionID}",
|
|
|
...options,
|
|
|
headers: {
|