feat(tui): allow backgrounding synchronous subagents (#30488)
This commit is contained in:
parent
8c0edca175
commit
3003867c25
26 changed files with 527 additions and 35 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -5850,6 +5850,38 @@ export type ExperimentalSessionListResponses = {
|
|||
|
||||
export type ExperimentalSessionListResponse = ExperimentalSessionListResponses[keyof ExperimentalSessionListResponses]
|
||||
|
||||
export type ExperimentalSessionBackgroundData = {
|
||||
body?: never
|
||||
path: {
|
||||
sessionID: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/experimental/session/{sessionID}/background"
|
||||
}
|
||||
|
||||
export type ExperimentalSessionBackgroundErrors = {
|
||||
/**
|
||||
* BadRequest | InvalidRequestError
|
||||
*/
|
||||
400: EffectHttpApiErrorBadRequest | InvalidRequestError
|
||||
}
|
||||
|
||||
export type ExperimentalSessionBackgroundError =
|
||||
ExperimentalSessionBackgroundErrors[keyof ExperimentalSessionBackgroundErrors]
|
||||
|
||||
export type ExperimentalSessionBackgroundResponses = {
|
||||
/**
|
||||
* Backgrounded subagents
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type ExperimentalSessionBackgroundResponse =
|
||||
ExperimentalSessionBackgroundResponses[keyof ExperimentalSessionBackgroundResponses]
|
||||
|
||||
export type ExperimentalResourceListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue