feat(tui): allow backgrounding synchronous subagents (#30488)
This commit is contained in:
@@ -44,6 +44,8 @@ import type {
|
||||
ExperimentalProjectCopyRemoveResponses,
|
||||
ExperimentalResourceListErrors,
|
||||
ExperimentalResourceListResponses,
|
||||
ExperimentalSessionBackgroundErrors,
|
||||
ExperimentalSessionBackgroundResponses,
|
||||
ExperimentalSessionListErrors,
|
||||
ExperimentalSessionListResponses,
|
||||
ExperimentalWorkspaceAdapterListErrors,
|
||||
@@ -733,6 +735,42 @@ export class Session extends HeyApiClient {
|
||||
...params,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Background subagents
|
||||
*
|
||||
* Detach any synchronous subagents currently blocking the session and continue them in the background.
|
||||
*/
|
||||
public background<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
sessionID: string
|
||||
directory?: string
|
||||
workspace?: string
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams(
|
||||
[parameters],
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "path", key: "sessionID" },
|
||||
{ in: "query", key: "directory" },
|
||||
{ in: "query", key: "workspace" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<
|
||||
ExperimentalSessionBackgroundResponses,
|
||||
ExperimentalSessionBackgroundErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/experimental/session/{sessionID}/background",
|
||||
...options,
|
||||
...params,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Resource extends HeyApiClient {
|
||||
|
||||
Reference in New Issue
Block a user