feat(core): session.pending.list API with pending-only session_pending storage (#36126)

This commit is contained in:
Kit Langton 2026-07-09 17:25:40 -04:00 committed by GitHub
commit a72992e00f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
43 changed files with 986 additions and 649 deletions

View file

@ -48,6 +48,8 @@ import type {
SessionRevertCommitOutput,
SessionContextInput,
SessionContextOutput,
SessionPendingListInput,
SessionPendingListOutput,
SessionInstructionsEntryListInput,
SessionInstructionsEntryListOutput,
SessionInstructionsEntryPutInput,
@ -666,6 +668,19 @@ export function make(options: ClientOptions) {
},
requestOptions,
).then((value) => value.data),
pending: {
list: (input: SessionPendingListInput, requestOptions?: RequestOptions) =>
request<{ readonly data: SessionPendingListOutput }>(
{
method: "GET",
path: `/api/session/${encodeURIComponent(input.sessionID)}/pending`,
successStatus: 200,
declaredStatuses: [404, 400, 401],
empty: false,
},
requestOptions,
).then((value) => value.data),
},
instructions: {
entry: {
list: (input: SessionInstructionsEntryListInput, requestOptions?: RequestOptions) =>

View file

@ -624,7 +624,6 @@ export type SessionPromptOutput = {
id: string
sessionID: string
timeCreated: number
promotedSeq?: number
type: "user"
data: {
text: string
@ -824,7 +823,6 @@ export type SessionCommandOutput = {
id: string
sessionID: string
timeCreated: number
promotedSeq?: number
type: "user"
data: {
text: string
@ -922,7 +920,6 @@ export type SessionSyntheticOutput = {
id: string
sessionID: string
timeCreated: number
promotedSeq?: number
type: "synthetic"
data: { text: string; description?: string; metadata?: { [x: string]: JsonValue } }
delivery: "steer" | "queue"
@ -943,14 +940,7 @@ export type SessionCompactInput = {
}
export type SessionCompactOutput = {
data: {
admittedSeq: number
id: string
sessionID: string
timeCreated: number
type: "compaction"
handledSeq?: number
}
data: { admittedSeq: number; id: string; sessionID: string; timeCreated: number; type: "compaction" }
}["data"]
export type SessionWaitInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] }
@ -1145,6 +1135,44 @@ export type SessionContextOutput = {
>
}["data"]
export type SessionPendingListInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] }
export type SessionPendingListOutput = {
data: Array<
| {
admittedSeq: number
id: string
sessionID: string
timeCreated: number
type: "user"
data: {
text: string
files?: Array<{
data: string
mime: string
source: { type: "inline" } | { type: "uri"; uri: string }
name?: string
description?: string
mention?: { start: number; end: number; text: string }
}>
agents?: Array<{ name: string; mention?: { start: number; end: number; text: string } }>
metadata?: { [x: string]: JsonValue }
}
delivery: "steer" | "queue"
}
| {
admittedSeq: number
id: string
sessionID: string
timeCreated: number
type: "synthetic"
data: { text: string; description?: string; metadata?: { [x: string]: JsonValue } }
delivery: "steer" | "queue"
}
| { admittedSeq: number; id: string; sessionID: string; timeCreated: number; type: "compaction" }
>
}["data"]
export type SessionInstructionsEntryListInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] }
export type SessionInstructionsEntryListOutput = { data: Array<{ key: string; value: JsonValue }> }["data"]