feat(core): session.pending.list API with pending-only session_pending storage (#36126)
This commit is contained in:
parent
99156c10e6
commit
a72992e00f
43 changed files with 986 additions and 649 deletions
|
|
@ -405,6 +405,8 @@ import type {
|
|||
V2SessionMessageResponses,
|
||||
V2SessionMoveErrors,
|
||||
V2SessionMoveResponses,
|
||||
V2SessionPendingListErrors,
|
||||
V2SessionPendingListResponses,
|
||||
V2SessionPermissionCreateErrors,
|
||||
V2SessionPermissionCreateResponses,
|
||||
V2SessionPermissionGetErrors,
|
||||
|
|
@ -5251,6 +5253,31 @@ export class Revert extends HeyApiClient {
|
|||
}
|
||||
}
|
||||
|
||||
export class Pending extends HeyApiClient {
|
||||
/**
|
||||
* List pending session work
|
||||
*
|
||||
* List durable admitted session work not yet visible in projected history, ordered by admission. Includes unpromoted user and synthetic inputs and unhandled compaction barriers. The runner owns consumption; items disappear once promoted or handled.
|
||||
*/
|
||||
public list<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).get<
|
||||
V2SessionPendingListResponses,
|
||||
V2SessionPendingListErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/api/session/{sessionID}/pending",
|
||||
...options,
|
||||
...params,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Entry extends HeyApiClient {
|
||||
/**
|
||||
* List instruction entries
|
||||
|
|
@ -6524,6 +6551,11 @@ export class Session3 extends HeyApiClient {
|
|||
return (this._revert ??= new Revert({ client: this.client }))
|
||||
}
|
||||
|
||||
private _pending?: Pending
|
||||
get pending(): Pending {
|
||||
return (this._pending ??= new Pending({ client: this.client }))
|
||||
}
|
||||
|
||||
private _instructions?: Instructions
|
||||
get instructions(): Instructions {
|
||||
return (this._instructions ??= new Instructions({ client: this.client }))
|
||||
|
|
|
|||
|
|
@ -846,7 +846,7 @@ export type GlobalEvent = {
|
|||
properties: {
|
||||
sessionID: string
|
||||
inputID: string
|
||||
input: SessionInputMessage
|
||||
input: SessionPendingMessage
|
||||
}
|
||||
}
|
||||
| {
|
||||
|
|
@ -3352,7 +3352,7 @@ export type PromptAgentAttachment = {
|
|||
mention?: PromptMention
|
||||
}
|
||||
|
||||
export type SessionInputUserData = {
|
||||
export type SessionPendingUserData = {
|
||||
text: string
|
||||
files?: Array<PromptFileAttachment>
|
||||
agents?: Array<PromptAgentAttachment>
|
||||
|
|
@ -3361,13 +3361,13 @@ export type SessionInputUserData = {
|
|||
}
|
||||
}
|
||||
|
||||
export type SessionInputUserMessage = {
|
||||
export type SessionPendingUserMessage = {
|
||||
type: "user"
|
||||
data: SessionInputUserData
|
||||
data: SessionPendingUserData
|
||||
delivery: "steer" | "queue"
|
||||
}
|
||||
|
||||
export type SessionInputSyntheticData = {
|
||||
export type SessionPendingSyntheticData = {
|
||||
text: string
|
||||
description?: string
|
||||
metadata?: {
|
||||
|
|
@ -3375,13 +3375,13 @@ export type SessionInputSyntheticData = {
|
|||
}
|
||||
}
|
||||
|
||||
export type SessionInputSyntheticMessage = {
|
||||
export type SessionPendingSyntheticMessage = {
|
||||
type: "synthetic"
|
||||
data: SessionInputSyntheticData
|
||||
data: SessionPendingSyntheticData
|
||||
delivery: "steer" | "queue"
|
||||
}
|
||||
|
||||
export type SessionInputMessage = SessionInputUserMessage | SessionInputSyntheticMessage
|
||||
export type SessionPendingMessage = SessionPendingUserMessage | SessionPendingSyntheticMessage
|
||||
|
||||
export type SessionStructuredError = {
|
||||
type: string
|
||||
|
|
@ -3817,7 +3817,7 @@ export type SyncEventSessionInputAdmitted = {
|
|||
data: {
|
||||
sessionID: string
|
||||
inputID: string
|
||||
input: SessionInputMessage
|
||||
input: SessionPendingMessage
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4450,35 +4450,32 @@ export type PromptInputFileAttachment = {
|
|||
mention?: PromptMention
|
||||
}
|
||||
|
||||
export type SessionInputUser = {
|
||||
export type SessionPendingUser = {
|
||||
admittedSeq: number
|
||||
id: string
|
||||
sessionID: string
|
||||
timeCreated: number
|
||||
promotedSeq?: number
|
||||
type: "user"
|
||||
data: SessionInputUserData
|
||||
data: SessionPendingUserData
|
||||
delivery: "steer" | "queue"
|
||||
}
|
||||
|
||||
export type SessionInputSynthetic = {
|
||||
export type SessionPendingSynthetic = {
|
||||
admittedSeq: number
|
||||
id: string
|
||||
sessionID: string
|
||||
timeCreated: number
|
||||
promotedSeq?: number
|
||||
type: "synthetic"
|
||||
data: SessionInputSyntheticData
|
||||
data: SessionPendingSyntheticData
|
||||
delivery: "steer" | "queue"
|
||||
}
|
||||
|
||||
export type SessionInputCompaction = {
|
||||
export type SessionPendingCompaction = {
|
||||
admittedSeq: number
|
||||
id: string
|
||||
sessionID: string
|
||||
timeCreated: number
|
||||
type: "compaction"
|
||||
handledSeq?: number
|
||||
}
|
||||
|
||||
export type SessionMessageAgentSelected = {
|
||||
|
|
@ -4747,6 +4744,8 @@ export type SessionMessageInfo =
|
|||
| SessionMessageAssistant
|
||||
| SessionMessageCompaction
|
||||
|
||||
export type SessionPendingInfo = SessionPendingUser | SessionPendingSynthetic | SessionPendingCompaction
|
||||
|
||||
export type InstructionEntryKey = string
|
||||
|
||||
export type InstructionEntryInfo = {
|
||||
|
|
@ -4904,7 +4903,7 @@ export type SessionInputAdmitted = {
|
|||
data: {
|
||||
sessionID: string
|
||||
inputID: string
|
||||
input: SessionInputMessage
|
||||
input: SessionPendingMessage
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -7185,7 +7184,7 @@ export type EventSessionInputAdmitted = {
|
|||
properties: {
|
||||
sessionID: string
|
||||
inputID: string
|
||||
input: SessionInputMessage
|
||||
input: SessionPendingMessage
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -8778,35 +8777,32 @@ export type SessionInfoV2 = {
|
|||
|
||||
export type PromptBase64V2 = string
|
||||
|
||||
export type SessionInputUserV2 = {
|
||||
export type SessionPendingUserV2 = {
|
||||
admittedSeq: number
|
||||
id: string
|
||||
sessionID: string
|
||||
timeCreated: number
|
||||
promotedSeq?: number
|
||||
type: "user"
|
||||
data: SessionInputUserData
|
||||
data: SessionPendingUserData
|
||||
delivery: "steer" | "queue"
|
||||
}
|
||||
|
||||
export type SessionInputSyntheticV2 = {
|
||||
export type SessionPendingSyntheticV2 = {
|
||||
admittedSeq: number
|
||||
id: string
|
||||
sessionID: string
|
||||
timeCreated: number
|
||||
promotedSeq?: number
|
||||
type: "synthetic"
|
||||
data: SessionInputSyntheticData
|
||||
data: SessionPendingSyntheticData
|
||||
delivery: "steer" | "queue"
|
||||
}
|
||||
|
||||
export type SessionInputCompactionV2 = {
|
||||
export type SessionPendingCompactionV2 = {
|
||||
admittedSeq: number
|
||||
id: string
|
||||
sessionID: string
|
||||
timeCreated: number
|
||||
type: "compaction"
|
||||
handledSeq?: number
|
||||
}
|
||||
|
||||
export type SessionMessageAgentSelectedV2 = {
|
||||
|
|
@ -9123,7 +9119,7 @@ export type SessionInputPromotedV2 = {
|
|||
}
|
||||
}
|
||||
|
||||
export type SessionInputUserData1 = {
|
||||
export type SessionPendingUserData1 = {
|
||||
text: string
|
||||
files?: Array<PromptFileAttachment>
|
||||
agents?: Array<PromptAgentAttachment>
|
||||
|
|
@ -9132,13 +9128,13 @@ export type SessionInputUserData1 = {
|
|||
}
|
||||
}
|
||||
|
||||
export type SessionInputUserMessageV2 = {
|
||||
export type SessionPendingUserMessageV2 = {
|
||||
type: "user"
|
||||
data: SessionInputUserData1
|
||||
data: SessionPendingUserData1
|
||||
delivery: "steer" | "queue"
|
||||
}
|
||||
|
||||
export type SessionInputSyntheticData1 = {
|
||||
export type SessionPendingSyntheticData1 = {
|
||||
text: string
|
||||
description?: string
|
||||
metadata?: {
|
||||
|
|
@ -9146,9 +9142,9 @@ export type SessionInputSyntheticData1 = {
|
|||
}
|
||||
}
|
||||
|
||||
export type SessionInputSyntheticMessageV2 = {
|
||||
export type SessionPendingSyntheticMessageV2 = {
|
||||
type: "synthetic"
|
||||
data: SessionInputSyntheticData1
|
||||
data: SessionPendingSyntheticData1
|
||||
delivery: "steer" | "queue"
|
||||
}
|
||||
|
||||
|
|
@ -9168,7 +9164,7 @@ export type SessionInputAdmittedV2 = {
|
|||
data: {
|
||||
sessionID: string
|
||||
inputID: string
|
||||
input: SessionInputMessage
|
||||
input: SessionPendingMessage
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -15683,7 +15679,7 @@ export type V2SessionPromptResponses = {
|
|||
* Success
|
||||
*/
|
||||
200: {
|
||||
data: SessionInputUserV2
|
||||
data: SessionPendingUserV2
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -15738,7 +15734,7 @@ export type V2SessionCommandResponses = {
|
|||
* Success
|
||||
*/
|
||||
200: {
|
||||
data: SessionInputUserV2
|
||||
data: SessionPendingUserV2
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -15827,7 +15823,7 @@ export type V2SessionSyntheticResponses = {
|
|||
* Success
|
||||
*/
|
||||
200: {
|
||||
data: SessionInputSyntheticV2
|
||||
data: SessionPendingSyntheticV2
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -15908,7 +15904,7 @@ export type V2SessionCompactResponses = {
|
|||
* Success
|
||||
*/
|
||||
200: {
|
||||
data: SessionInputCompactionV2
|
||||
data: SessionPendingCompactionV2
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -16124,6 +16120,43 @@ export type V2SessionContextResponses = {
|
|||
|
||||
export type V2SessionContextResponse = V2SessionContextResponses[keyof V2SessionContextResponses]
|
||||
|
||||
export type V2SessionPendingListData = {
|
||||
body?: never
|
||||
path: {
|
||||
sessionID: string
|
||||
}
|
||||
query?: never
|
||||
url: "/api/session/{sessionID}/pending"
|
||||
}
|
||||
|
||||
export type V2SessionPendingListErrors = {
|
||||
/**
|
||||
* InvalidRequestError
|
||||
*/
|
||||
400: InvalidRequestErrorV2
|
||||
/**
|
||||
* UnauthorizedError
|
||||
*/
|
||||
401: UnauthorizedError
|
||||
/**
|
||||
* SessionNotFoundError
|
||||
*/
|
||||
404: SessionNotFoundError
|
||||
}
|
||||
|
||||
export type V2SessionPendingListError = V2SessionPendingListErrors[keyof V2SessionPendingListErrors]
|
||||
|
||||
export type V2SessionPendingListResponses = {
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
200: {
|
||||
data: Array<SessionPendingInfo>
|
||||
}
|
||||
}
|
||||
|
||||
export type V2SessionPendingListResponse = V2SessionPendingListResponses[keyof V2SessionPendingListResponses]
|
||||
|
||||
export type V2SessionInstructionsEntryListData = {
|
||||
body?: never
|
||||
path: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue