feat: background blocking tools

This commit is contained in:
Dax Raad 2026-07-01 12:17:30 -04:00
commit e2bca216a2
15 changed files with 392 additions and 66 deletions

View file

@ -309,6 +309,8 @@ import type {
V2PermissionSavedListResponses,
V2PermissionSavedRemoveErrors,
V2PermissionSavedRemoveResponses,
V2PluginListErrors,
V2PluginListResponses,
V2ProjectCopyCreateErrors,
V2ProjectCopyCreateResponses,
V2ProjectCopyRefreshErrors,
@ -343,6 +345,8 @@ import type {
V2ReferenceListResponses,
V2SessionActiveErrors,
V2SessionActiveResponses,
V2SessionBackgroundErrors,
V2SessionBackgroundResponses,
V2SessionCompactErrors,
V2SessionCompactResponses,
V2SessionContextErrors,
@ -5107,6 +5111,30 @@ export class Agent extends HeyApiClient {
}
}
export class Plugin extends HeyApiClient {
/**
* List plugins
*
* Retrieve currently loaded plugins.
*/
public list<ThrowOnError extends boolean = false>(
parameters?: {
location?: {
directory?: string
workspace?: string
}
},
options?: Options<never, ThrowOnError>,
) {
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }])
return (options?.client ?? this.client).get<V2PluginListResponses, V2PluginListErrors, ThrowOnError>({
url: "/api/plugin",
...options,
...params,
})
}
}
export class Revert extends HeyApiClient {
/**
* Stage session revert
@ -5926,6 +5954,27 @@ export class Session3 extends HeyApiClient {
})
}
/**
* Background blocking session tools
*
* Move active foreground backgroundable tools for this session into background observation. Idle requests are a no-op.
*/
public background<ThrowOnError extends boolean = false>(
parameters: {
sessionID: string
},
options?: Options<never, ThrowOnError>,
) {
const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "sessionID" }] }])
return (options?.client ?? this.client).post<V2SessionBackgroundResponses, V2SessionBackgroundErrors, ThrowOnError>(
{
url: "/api/session/{sessionID}/background",
...options,
...params,
},
)
}
/**
* Get session message
*
@ -7436,6 +7485,11 @@ export class V2 extends HeyApiClient {
return (this._agent ??= new Agent({ client: this.client }))
}
private _plugin?: Plugin
get plugin(): Plugin {
return (this._plugin ??= new Plugin({ client: this.client }))
}
private _session?: Session3
get session(): Session3 {
return (this._session ??= new Session3({ client: this.client }))

View file

@ -1502,6 +1502,7 @@ export type GlobalEvent = {
| "session.new"
| "session.share"
| "session.interrupt"
| "session.background"
| "session.compact"
| "session.page.up"
| "session.page.down"
@ -2707,6 +2708,7 @@ export type EventTuiCommandExecute = {
| "session.new"
| "session.share"
| "session.interrupt"
| "session.background"
| "session.compact"
| "session.page.up"
| "session.page.down"
@ -3134,6 +3136,7 @@ export type EventTuiCommandExecute2 = {
| "session.new"
| "session.share"
| "session.interrupt"
| "session.background"
| "session.compact"
| "session.page.up"
| "session.page.down"
@ -4111,6 +4114,10 @@ export type AgentV2Info = {
permissions: PermissionV2Ruleset
}
export type PluginInfo = {
id: string
}
export type SessionV2Info = {
id: string
parentID?: string
@ -6171,6 +6178,7 @@ export type TuiCommandExecute = {
| "session.new"
| "session.share"
| "session.interrupt"
| "session.background"
| "session.compact"
| "session.page.up"
| "session.page.down"
@ -11817,6 +11825,43 @@ export type V2AgentListResponses = {
export type V2AgentListResponse = V2AgentListResponses[keyof V2AgentListResponses]
export type V2PluginListData = {
body?: never
path?: never
query?: {
location?: {
directory?: string
workspace?: string
}
}
url: "/api/plugin"
}
export type V2PluginListErrors = {
/**
* InvalidRequestError
*/
400: InvalidRequestError
/**
* UnauthorizedError
*/
401: UnauthorizedError
}
export type V2PluginListError = V2PluginListErrors[keyof V2PluginListErrors]
export type V2PluginListResponses = {
/**
* Success
*/
200: {
location: LocationInfo
data: Array<PluginInfo>
}
}
export type V2PluginListResponse = V2PluginListResponses[keyof V2PluginListResponses]
export type V2SessionListData = {
body?: never
path?: never
@ -12570,6 +12615,41 @@ export type V2SessionInterruptResponses = {
export type V2SessionInterruptResponse = V2SessionInterruptResponses[keyof V2SessionInterruptResponses]
export type V2SessionBackgroundData = {
body?: never
path: {
sessionID: string
}
query?: never
url: "/api/session/{sessionID}/background"
}
export type V2SessionBackgroundErrors = {
/**
* InvalidRequestError
*/
400: InvalidRequestError
/**
* UnauthorizedError
*/
401: UnauthorizedError
/**
* SessionNotFoundError
*/
404: SessionNotFoundError
}
export type V2SessionBackgroundError = V2SessionBackgroundErrors[keyof V2SessionBackgroundErrors]
export type V2SessionBackgroundResponses = {
/**
* <No Content>
*/
204: void
}
export type V2SessionBackgroundResponse = V2SessionBackgroundResponses[keyof V2SessionBackgroundResponses]
export type V2SessionMessageData = {
body?: never
path: {