MCPcopy
hub / github.com/anomalyco/opencode / decode

Function decode

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

Source from the content-addressed store, hash-verified

194 const decodeMessage = Schema.decodeUnknownEffect(SessionMessage.Message)
195 const isDurableSessionEvent = Schema.is(SessionEvent.Durable)
196 const decode = (row: typeof SessionMessageTable.$inferSelect) =>
197 decodeMessage({ ...row.data, id: row.id, type: row.type }).pipe(
198 Effect.mapError(
199 () =>
200 new MessageDecodeError({
201 sessionID: SessionSchema.ID.make(row.session_id),
202 messageID: SessionMessage.ID.make(row.id),
203 }),
204 ),
205 )
206
207 const result = Service.of({
208 create: Effect.fn("V2Session.create")(function* (input) {

Callers 13

storedFunction · 0.70
event.tsFile · 0.70
validateWithFunction · 0.50
model.test.tsFile · 0.50
skill.test.tsFile · 0.50
command.test.tsFile · 0.50
plugin.test.tsFile · 0.50
provider.test.tsFile · 0.50
agent.test.tsFile · 0.50

Calls 1

makeMethod · 0.45

Tested by

no test coverage detected