This commit is contained in:
07akioni
2026-07-28 19:16:39 +08:00
parent 9e94082f4d
commit 6978dbfb13
12 changed files with 112 additions and 15 deletions

View File

@@ -139,7 +139,7 @@ export const historyEntrySchema = z.object({
view: toolEventViewSchema.optional(),
}) satisfies z.ZodType<Wire<HistoryEntry>>
/** One todo item of the tail page's session-level projection (the todo/write payload shape). */
/** One todo item of the tail page's standing-plan projection (the todo/write payload shape). */
export const todoItemSchema = z.object({
content: z.string(),
status: z.union([z.literal('pending'), z.literal('in_progress'), z.literal('completed')]),

View File

@@ -149,10 +149,11 @@ export interface SessionsApi {
* Each entry pairs the raw SessionEvent with the host-computed view (tool events whose
* presenter produced one, evaluated against the registry at pagination time); the client
* rebuilds the surface from the events with the shared fold.
* The tail page (beforeSeq absent) also carries `todos` — the session's current todo
* projection (latest `todo/write` over the FULL log, independent of the page window) —
* so a paged client restores the plan without walking history; absent when the session
* never wrote one. Older pages omit it (the projection is session-level, not per-page).
* The tail page (beforeSeq absent) also carries `todos` — the standing plan over the
* FULL log (latest `todo/write` with no later `turn/start`), independent of the page
* window — so a paged client restores the plan without walking history. Absent when no
* plan stands (never wrote one, or a later `turn/start` retired it). Older pages omit
* it (the projection is session-level, not per-page).
*/
history(request: RpcRequest<{ sessionId: SessionId; beforeSeq?: number; maxMessages?: number }>):
Promise<RpcResponse<{ events: HistoryEntry[]; hasMore: boolean; todos?: TodoItem[] }>>