MCPcopy Index your code
hub / github.com/anomalyco/opencode / fromRow

Function fromRow

packages/core/src/session/input.ts:21–30  ·  view source on GitHub ↗
(row: typeof SessionInputTable.$inferSelect)

Source from the content-addressed store, hash-verified

19const encodePrompt = Schema.encodeSync(Prompt)
20
21const fromRow = (row: typeof SessionInputTable.$inferSelect): Admitted =>
22 Admitted.make({
23 admittedSeq: row.admitted_seq,
24 id: SessionMessage.ID.make(row.id),
25 sessionID: SessionSchema.ID.make(row.session_id),
26 prompt: decodePrompt(row.prompt),
27 delivery: row.delivery,
28 timeCreated: DateTime.makeUnsafe(row.time_created),
29 ...(row.promoted_seq === null ? {} : { promotedSeq: row.promoted_seq }),
30 })
31
32export const find = Effect.fn("SessionInput.find")(function* (db: DatabaseService, id: SessionMessage.ID) {
33 const row = yield* db.select().from(SessionInputTable).where(eq(SessionInputTable.id, id)).get().pipe(Effect.orDie)

Callers 1

input.tsFile · 0.70

Calls 1

makeMethod · 0.45

Tested by

no test coverage detected