Archived
Seed the in-flight partial assistant message (text, thinking, and
in-progress tool calls) when opening or reconnecting to a session that is
mid-stream, then continue streaming live deltas on top of it. Replaces the
blocking "Catching up..." placeholder and the end-of-turn transcript reload.
Server stamps every per-session UI event with a monotonic seq at the
SessionEventHub publish choke point and exposes
GET /sessions/:sessionId/stream-snapshot returning { seq, partial }. The
client fetches the snapshot on join, seeds the normalized partial into the
in-memory transcript (never the history cache), and applies buffered/live
events using the seq watermark for exactly-once delivery.
The snapshot is a progressive enhancement: a 404 from an older remote
pi-web or a not-yet-restarted session daemon falls back to an empty seed
(seq 0, drops nothing), so sessions still open and stream normally. The
stream-snapshot route is registered in the federation allowlist for
remote-machine proxying.
24 lines
876 B
TypeScript
24 lines
876 B
TypeScript
export type {
|
|
Project,
|
|
Workspace,
|
|
SessionRef as ClientSessionRef,
|
|
SessionInfo as ClientSession,
|
|
ArchiveSessionsResponse as ClientArchiveSessionsResponse,
|
|
SessionCleanupRequest as ClientSessionCleanupRequest,
|
|
SessionCleanupThresholds as ClientSessionCleanupThresholds,
|
|
SessionCleanupPreviewResponse as ClientSessionCleanupPreviewResponse,
|
|
SessionCleanupExecuteResponse as ClientSessionCleanupExecuteResponse,
|
|
MessagePage as ClientMessagePage,
|
|
SessionStreamSnapshot,
|
|
SessionStatus as ClientSessionStatus,
|
|
SessionModel as ClientSessionModel,
|
|
ThinkingLevel as ClientThinkingLevel,
|
|
SlashCommand as ClientCommand,
|
|
FileSuggestion as ClientFileSuggestion,
|
|
CommandOption as ClientCommandOption,
|
|
CommandResult as ClientCommandResult,
|
|
SessionActivity as ClientSessionActivity,
|
|
SessionUiEvent,
|
|
GlobalSessionEvent,
|
|
} from "../shared/apiTypes.js";
|