feat(tui): refresh agents after update events
This commit is contained in:
parent
4ce830a919
commit
02cb350880
17 changed files with 576 additions and 30 deletions
|
|
@ -279,6 +279,8 @@ import type {
|
|||
V2FsListResponses,
|
||||
V2FsReadErrors,
|
||||
V2FsReadResponses,
|
||||
V2GenerateTextErrors,
|
||||
V2GenerateTextResponses,
|
||||
V2HealthGetErrors,
|
||||
V2HealthGetResponses,
|
||||
V2IntegrationAttemptCancelErrors,
|
||||
|
|
@ -311,6 +313,10 @@ import type {
|
|||
V2ProjectCopyRefreshResponses,
|
||||
V2ProjectCopyRemoveErrors,
|
||||
V2ProjectCopyRemoveResponses,
|
||||
V2ProjectCurrentErrors,
|
||||
V2ProjectCurrentResponses,
|
||||
V2ProjectDirectoriesErrors,
|
||||
V2ProjectDirectoriesResponses,
|
||||
V2ProviderGetErrors,
|
||||
V2ProviderGetResponses,
|
||||
V2ProviderListErrors,
|
||||
|
|
@ -343,6 +349,8 @@ import type {
|
|||
V2SessionCreateResponses,
|
||||
V2SessionEventsErrors,
|
||||
V2SessionEventsResponses,
|
||||
V2SessionForkErrors,
|
||||
V2SessionForkResponses,
|
||||
V2SessionGetErrors,
|
||||
V2SessionGetResponses,
|
||||
V2SessionHistoryErrors,
|
||||
|
|
@ -5548,6 +5556,41 @@ export class Session3 extends HeyApiClient {
|
|||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Fork session
|
||||
*
|
||||
* Create a child session by copying projected history from the parent. When messageID is supplied, copy messages before that boundary.
|
||||
*/
|
||||
public fork<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
sessionID: string
|
||||
messageID?: string
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams(
|
||||
[parameters],
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "path", key: "sessionID" },
|
||||
{ in: "body", key: "messageID" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<V2SessionForkResponses, V2SessionForkErrors, ThrowOnError>({
|
||||
url: "/api/session/{sessionID}/fork",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
...params.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch session agent
|
||||
*
|
||||
|
|
@ -5944,6 +5987,48 @@ export class Model extends HeyApiClient {
|
|||
}
|
||||
}
|
||||
|
||||
export class Generate extends HeyApiClient {
|
||||
/**
|
||||
* Generate text
|
||||
*
|
||||
* Run one stateless model generation at the requested location and return the assistant text. Uses the location's default model when none is specified.
|
||||
*/
|
||||
public text<ThrowOnError extends boolean = false>(
|
||||
parameters?: {
|
||||
location?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
prompt?: string
|
||||
model?: ModelRef
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams(
|
||||
[parameters],
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "query", key: "location" },
|
||||
{ in: "body", key: "prompt" },
|
||||
{ in: "body", key: "model" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<V2GenerateTextResponses, V2GenerateTextErrors, ThrowOnError>({
|
||||
url: "/api/generate",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
...params.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Provider2 extends HeyApiClient {
|
||||
/**
|
||||
* List providers
|
||||
|
|
@ -6363,6 +6448,67 @@ export class Credential extends HeyApiClient {
|
|||
}
|
||||
}
|
||||
|
||||
export class Project2 extends HeyApiClient {
|
||||
/**
|
||||
* Get current project
|
||||
*
|
||||
* Resolve the project for the requested location.
|
||||
*/
|
||||
public current<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<V2ProjectCurrentResponses, V2ProjectCurrentErrors, ThrowOnError>({
|
||||
url: "/api/project/current",
|
||||
...options,
|
||||
...params,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* List project directories
|
||||
*
|
||||
* List known local absolute directories for a project.
|
||||
*/
|
||||
public directories<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
projectID: string
|
||||
location?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams(
|
||||
[parameters],
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "path", key: "projectID" },
|
||||
{ in: "query", key: "location" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<
|
||||
V2ProjectDirectoriesResponses,
|
||||
V2ProjectDirectoriesErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/api/project/{projectID}/directories",
|
||||
...options,
|
||||
...params,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Request extends HeyApiClient {
|
||||
/**
|
||||
* List pending permission requests
|
||||
|
|
@ -7233,6 +7379,11 @@ export class V2 extends HeyApiClient {
|
|||
return (this._model ??= new Model({ client: this.client }))
|
||||
}
|
||||
|
||||
private _generate?: Generate
|
||||
get generate(): Generate {
|
||||
return (this._generate ??= new Generate({ client: this.client }))
|
||||
}
|
||||
|
||||
private _provider?: Provider2
|
||||
get provider(): Provider2 {
|
||||
return (this._provider ??= new Provider2({ client: this.client }))
|
||||
|
|
@ -7248,6 +7399,11 @@ export class V2 extends HeyApiClient {
|
|||
return (this._credential ??= new Credential({ client: this.client }))
|
||||
}
|
||||
|
||||
private _project?: Project2
|
||||
get project(): Project2 {
|
||||
return (this._project ??= new Project2({ client: this.client }))
|
||||
}
|
||||
|
||||
private _permission?: Permission3
|
||||
get permission(): Permission3 {
|
||||
return (this._permission ??= new Permission3({ client: this.client }))
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ export type Event =
|
|||
| EventIntegrationUpdated
|
||||
| EventIntegrationConnectionUpdated
|
||||
| EventCatalogUpdated
|
||||
| EventAgentUpdated
|
||||
| EventSessionCreated
|
||||
| EventSessionUpdated
|
||||
| EventSessionDeleted
|
||||
|
|
@ -20,6 +21,7 @@ export type Event =
|
|||
| EventSessionNextModelSwitched
|
||||
| EventSessionNextMoved
|
||||
| EventSessionNextRenamed
|
||||
| EventSessionNextForked
|
||||
| EventSessionNextPrompted
|
||||
| EventSessionNextPromptAdmitted
|
||||
| EventSessionNextContextUpdated
|
||||
|
|
@ -646,7 +648,6 @@ export type Prompt = {
|
|||
text: string
|
||||
files?: Array<PromptFileAttachment>
|
||||
agents?: Array<PromptAgentAttachment>
|
||||
system?: string
|
||||
}
|
||||
|
||||
export type Pty = {
|
||||
|
|
@ -783,6 +784,13 @@ export type GlobalEvent = {
|
|||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
| {
|
||||
id: string
|
||||
type: "agent.updated"
|
||||
properties: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
| {
|
||||
id: string
|
||||
type: "session.created"
|
||||
|
|
@ -880,6 +888,16 @@ export type GlobalEvent = {
|
|||
title: string
|
||||
}
|
||||
}
|
||||
| {
|
||||
id: string
|
||||
type: "session.next.forked"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
parentID: string
|
||||
messageID?: string
|
||||
}
|
||||
}
|
||||
| {
|
||||
id: string
|
||||
type: "session.next.prompted"
|
||||
|
|
@ -1667,6 +1685,7 @@ export type GlobalEvent = {
|
|||
| SyncEventSessionNextModelSwitched
|
||||
| SyncEventSessionNextMoved
|
||||
| SyncEventSessionNextRenamed
|
||||
| SyncEventSessionNextForked
|
||||
| SyncEventSessionNextPrompted
|
||||
| SyncEventSessionNextPromptAdmitted
|
||||
| SyncEventSessionNextContextUpdated
|
||||
|
|
@ -2756,11 +2775,17 @@ export type SessionNotFoundError = {
|
|||
message: string
|
||||
}
|
||||
|
||||
export type MessageNotFoundError = {
|
||||
_tag: "MessageNotFoundError"
|
||||
sessionID: string
|
||||
messageID: string
|
||||
message: string
|
||||
}
|
||||
|
||||
export type PromptInput = {
|
||||
text: string
|
||||
files?: Array<PromptInputFileAttachment>
|
||||
agents?: Array<PromptAgentAttachment>
|
||||
system?: string
|
||||
}
|
||||
|
||||
export type ConflictError = {
|
||||
|
|
@ -2781,18 +2806,12 @@ export type UnknownError1 = {
|
|||
ref?: string
|
||||
}
|
||||
|
||||
export type MessageNotFoundError = {
|
||||
_tag: "MessageNotFoundError"
|
||||
sessionID: string
|
||||
messageID: string
|
||||
message: string
|
||||
}
|
||||
|
||||
export type SessionDurableEvent =
|
||||
| SessionNextAgentSwitched
|
||||
| SessionNextModelSwitched
|
||||
| SessionNextMoved
|
||||
| SessionNextRenamed
|
||||
| SessionNextForked
|
||||
| SessionNextPrompted
|
||||
| SessionNextPromptAdmitted
|
||||
| SessionNextContextUpdated
|
||||
|
|
@ -2834,6 +2853,12 @@ export type SessionMessagesResponse = {
|
|||
}
|
||||
}
|
||||
|
||||
export type GenerateTextResponse = {
|
||||
data: {
|
||||
text: string
|
||||
}
|
||||
}
|
||||
|
||||
export type ProviderNotFoundError = {
|
||||
_tag: "ProviderNotFoundError"
|
||||
providerID: string
|
||||
|
|
@ -2928,6 +2953,7 @@ export type V2Event =
|
|||
| IntegrationUpdated
|
||||
| IntegrationConnectionUpdated
|
||||
| CatalogUpdated
|
||||
| AgentUpdated
|
||||
| SessionCreated
|
||||
| SessionUpdated
|
||||
| SessionDeleted
|
||||
|
|
@ -2939,6 +2965,7 @@ export type V2Event =
|
|||
| SessionNextModelSwitched
|
||||
| SessionNextMoved
|
||||
| SessionNextRenamed
|
||||
| SessionNextForked
|
||||
| SessionNextPrompted
|
||||
| SessionNextPromptAdmitted
|
||||
| SessionNextContextUpdated
|
||||
|
|
@ -3464,6 +3491,23 @@ export type SyncEventSessionNextRenamed = {
|
|||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextForked = {
|
||||
type: "sync"
|
||||
id: string
|
||||
syncEvent: {
|
||||
type: "session.next.forked.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: string
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
parentID: string
|
||||
messageID?: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextPrompted = {
|
||||
type: "sync"
|
||||
id: string
|
||||
|
|
@ -3959,10 +4003,12 @@ export type ConfigV2ExperimentalPolicy = {
|
|||
resource: string
|
||||
}
|
||||
|
||||
export type ProjectDirectories = Array<{
|
||||
export type ProjectDirectory = {
|
||||
directory: string
|
||||
strategy?: string
|
||||
}>
|
||||
}
|
||||
|
||||
export type ProjectDirectories = Array<ProjectDirectory>
|
||||
|
||||
export type PtyTicketConnectToken = {
|
||||
ticket: string
|
||||
|
|
@ -4096,7 +4142,6 @@ export type SessionMessageUser = {
|
|||
text: string
|
||||
files?: Array<PromptFileAttachment>
|
||||
agents?: Array<PromptAgentAttachment>
|
||||
system?: string
|
||||
type: "user"
|
||||
}
|
||||
|
||||
|
|
@ -4357,6 +4402,26 @@ export type SessionNextRenamed = {
|
|||
}
|
||||
}
|
||||
|
||||
export type SessionNextForked = {
|
||||
id: string
|
||||
metadata?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
type: "session.next.forked"
|
||||
durable?: {
|
||||
aggregateID: string
|
||||
seq: number
|
||||
version: number
|
||||
}
|
||||
location?: LocationRef
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
parentID: string
|
||||
messageID?: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionNextPrompted = {
|
||||
id: string
|
||||
metadata?: {
|
||||
|
|
@ -5115,6 +5180,11 @@ export type IntegrationAttemptStatus =
|
|||
}
|
||||
}
|
||||
|
||||
export type ProjectCurrent = {
|
||||
id: string
|
||||
directory: string
|
||||
}
|
||||
|
||||
export type PermissionV2Request = {
|
||||
id: string
|
||||
sessionID: string
|
||||
|
|
@ -5224,6 +5294,23 @@ export type CatalogUpdated = {
|
|||
}
|
||||
}
|
||||
|
||||
export type AgentUpdated = {
|
||||
id: string
|
||||
metadata?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
type: "agent.updated"
|
||||
durable?: {
|
||||
aggregateID: string
|
||||
seq: number
|
||||
version: number
|
||||
}
|
||||
location?: LocationRef
|
||||
data: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionCreated = {
|
||||
id: string
|
||||
metadata?: {
|
||||
|
|
@ -6371,6 +6458,14 @@ export type EventCatalogUpdated = {
|
|||
}
|
||||
}
|
||||
|
||||
export type EventAgentUpdated = {
|
||||
id: string
|
||||
type: "agent.updated"
|
||||
properties: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionCreated = {
|
||||
id: string
|
||||
type: "session.created"
|
||||
|
|
@ -6479,6 +6574,17 @@ export type EventSessionNextRenamed = {
|
|||
}
|
||||
}
|
||||
|
||||
export type EventSessionNextForked = {
|
||||
id: string
|
||||
type: "session.next.forked"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
parentID: string
|
||||
messageID?: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionNextPrompted = {
|
||||
id: string
|
||||
type: "session.next.prompted"
|
||||
|
|
@ -11700,6 +11806,45 @@ export type V2SessionGetResponses = {
|
|||
|
||||
export type V2SessionGetResponse = V2SessionGetResponses[keyof V2SessionGetResponses]
|
||||
|
||||
export type V2SessionForkData = {
|
||||
body: {
|
||||
messageID?: string
|
||||
}
|
||||
path: {
|
||||
sessionID: string
|
||||
}
|
||||
query?: never
|
||||
url: "/api/session/{sessionID}/fork"
|
||||
}
|
||||
|
||||
export type V2SessionForkErrors = {
|
||||
/**
|
||||
* InvalidRequestError
|
||||
*/
|
||||
400: InvalidRequestError
|
||||
/**
|
||||
* UnauthorizedError
|
||||
*/
|
||||
401: UnauthorizedError
|
||||
/**
|
||||
* SessionNotFoundError | MessageNotFoundError
|
||||
*/
|
||||
404: MessageNotFoundError | SessionNotFoundError
|
||||
}
|
||||
|
||||
export type V2SessionForkError = V2SessionForkErrors[keyof V2SessionForkErrors]
|
||||
|
||||
export type V2SessionForkResponses = {
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
200: {
|
||||
data: SessionV2Info
|
||||
}
|
||||
}
|
||||
|
||||
export type V2SessionForkResponse = V2SessionForkResponses[keyof V2SessionForkResponses]
|
||||
|
||||
export type V2SessionSwitchAgentData = {
|
||||
body: {
|
||||
agent: string
|
||||
|
|
@ -12353,6 +12498,47 @@ export type V2ModelListResponses = {
|
|||
|
||||
export type V2ModelListResponse = V2ModelListResponses[keyof V2ModelListResponses]
|
||||
|
||||
export type V2GenerateTextData = {
|
||||
body: {
|
||||
prompt: string
|
||||
model?: ModelRef
|
||||
}
|
||||
path?: never
|
||||
query?: {
|
||||
location?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
}
|
||||
url: "/api/generate"
|
||||
}
|
||||
|
||||
export type V2GenerateTextErrors = {
|
||||
/**
|
||||
* InvalidRequestError
|
||||
*/
|
||||
400: InvalidRequestError
|
||||
/**
|
||||
* UnauthorizedError
|
||||
*/
|
||||
401: UnauthorizedError
|
||||
/**
|
||||
* ServiceUnavailableError
|
||||
*/
|
||||
503: ServiceUnavailableError
|
||||
}
|
||||
|
||||
export type V2GenerateTextError = V2GenerateTextErrors[keyof V2GenerateTextErrors]
|
||||
|
||||
export type V2GenerateTextResponses = {
|
||||
/**
|
||||
* GenerateTextResponse
|
||||
*/
|
||||
200: GenerateTextResponse
|
||||
}
|
||||
|
||||
export type V2GenerateTextResponse = V2GenerateTextResponses[keyof V2GenerateTextResponses]
|
||||
|
||||
export type V2ProviderListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
|
|
@ -12793,6 +12979,76 @@ export type V2CredentialUpdateResponses = {
|
|||
|
||||
export type V2CredentialUpdateResponse = V2CredentialUpdateResponses[keyof V2CredentialUpdateResponses]
|
||||
|
||||
export type V2ProjectCurrentData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
location?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
}
|
||||
url: "/api/project/current"
|
||||
}
|
||||
|
||||
export type V2ProjectCurrentErrors = {
|
||||
/**
|
||||
* InvalidRequestError
|
||||
*/
|
||||
400: InvalidRequestError
|
||||
/**
|
||||
* UnauthorizedError
|
||||
*/
|
||||
401: UnauthorizedError
|
||||
}
|
||||
|
||||
export type V2ProjectCurrentError = V2ProjectCurrentErrors[keyof V2ProjectCurrentErrors]
|
||||
|
||||
export type V2ProjectCurrentResponses = {
|
||||
/**
|
||||
* Project.Current
|
||||
*/
|
||||
200: ProjectCurrent
|
||||
}
|
||||
|
||||
export type V2ProjectCurrentResponse = V2ProjectCurrentResponses[keyof V2ProjectCurrentResponses]
|
||||
|
||||
export type V2ProjectDirectoriesData = {
|
||||
body?: never
|
||||
path: {
|
||||
projectID: string
|
||||
}
|
||||
query?: {
|
||||
location?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
}
|
||||
url: "/api/project/{projectID}/directories"
|
||||
}
|
||||
|
||||
export type V2ProjectDirectoriesErrors = {
|
||||
/**
|
||||
* InvalidRequestError
|
||||
*/
|
||||
400: InvalidRequestError
|
||||
/**
|
||||
* UnauthorizedError
|
||||
*/
|
||||
401: UnauthorizedError
|
||||
}
|
||||
|
||||
export type V2ProjectDirectoriesError = V2ProjectDirectoriesErrors[keyof V2ProjectDirectoriesErrors]
|
||||
|
||||
export type V2ProjectDirectoriesResponses = {
|
||||
/**
|
||||
* Project.Directories
|
||||
*/
|
||||
200: ProjectDirectories
|
||||
}
|
||||
|
||||
export type V2ProjectDirectoriesResponse = V2ProjectDirectoriesResponses[keyof V2ProjectDirectoriesResponses]
|
||||
|
||||
export type V2PermissionRequestListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue