Dashboard › opencode › Distillation
b719eca7-7599-4702-ab96-a573e4fc3aea["lore_tm_v1_ipFJIFPF2uSjfK3lbKQOYDIQZQgFTM9r2rIn6NEikS8"]
Date: Sep 15, 2026
packages/core/src/session/projector.ts:141-157, SessionMessageUpdater.Adapter.getCurrentAssistant() selects the newest assistant row for event.data.sessionID via orderBy(desc(SessionMessageTable.seq)).limit(1), decodes it, and returns it only when message.type === "assistant" and message.time.completed is absent.packages/core/src/session/projector.ts:123-138, updateMessage() requires event.durable; otherwise it dies with "Durable Session event is missing aggregate sequence". It encodes the message and updates SessionMessageTable by both message.id and event.data.sessionID, setting type, time_created, and data.packages/core/src/session/projector.ts:159-176, getAssistant(messageID) scopes lookup by messageID, event.data.sessionID, and type="assistant", then returns only a decoded assistant message.packages/core/src/session/projector.ts:178-190, getCurrentShell(callID) loads shell rows for the session in descending seq order, decodes them, and returns the newest shell message whose callID matches.packages/core/src/session/projector.ts:192-196, the updater adapter maps both updateAssistant and updateShell to updateMessage, maps appendMessage to insertMessage(db, event, message), and is passed to SessionMessageUpdater.update(adapter, event).packages/core/src/session/projector.ts:200-215, insertMessage() requires event.durable, encodes the message, and inserts id, session_id, type, seq: event.durable.seq, time_created, and data into SessionMessageTable.packages/core/src/session/projector.ts:222-240, projection of SessionV1.Event.Created inserts sessionRow(event.data.info) into SessionTable with onConflictDoNothing(); absence of a returned row dies with new SessionAlreadyProjected(). If workspaceID exists, it updates WorkspaceTable.time_used to Date.now().packages/core/src/session/projector.ts:242-248, projection of SessionV1.Event.Updated updates SessionTable with sessionRow(event.data.info) for event.data.sessionID.packages/core/src/session/projector.ts:250-263, projection of SessionEvent.Moved updates SessionTable.directory, path, nullable workspace_id, and time_updated from the event’s location and timestamp.packages/core/src/session/projector.ts:265-266, projection of SessionV1.Event.Deleted deletes the matching SessionTable row.