MCPcopy Create free account
hub / github.com/anomalyco/opencode / decodeMessageRow

Function decodeMessageRow

packages/core/src/session/history.ts:55–64  ·  view source on GitHub ↗
(row: typeof SessionMessageTable.$inferSelect)

Source from the content-addressed store, hash-verified

53})
54
55const decodeMessageRow = (row: typeof SessionMessageTable.$inferSelect) =>
56 decode({ ...row.data, id: row.id, type: row.type }).pipe(
57 Effect.mapError(
58 () =>
59 new MessageDecodeError({
60 sessionID: SessionSchema.ID.make(row.session_id),
61 messageID: SessionMessage.ID.make(row.id),
62 }),
63 ),
64 )
65
66export const load = Effect.fn("SessionHistory.load")(function* (db: DatabaseService, sessionID: SessionSchema.ID) {
67 const [epoch, compaction] = yield* Effect.all(

Callers 1

history.tsFile · 0.85

Calls 2

decodeFunction · 0.50
makeMethod · 0.45

Tested by

no test coverage detected