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

Function getAssistant

packages/core/src/session/projector.ts:152–170  ·  view source on GitHub ↗
(messageID)

Source from the content-addressed store, hash-verified

150 })
151 },
152 getAssistant(messageID) {
153 return Effect.gen(function* () {
154 const row = yield* db
155 .select()
156 .from(SessionMessageTable)
157 .where(
158 and(
159 eq(SessionMessageTable.id, messageID),
160 eq(SessionMessageTable.session_id, event.data.sessionID),
161 eq(SessionMessageTable.type, "assistant"),
162 ),
163 )
164 .get()
165 .pipe(Effect.orDie)
166 if (!row) return
167 const message = decodeRow(row)
168 return message.type === "assistant" ? message : undefined
169 })
170 },
171 getCurrentShell(callID) {
172 return Effect.gen(function* () {
173 const rows = yield* db

Callers

nothing calls this directly

Calls 6

eqFunction · 0.85
decodeRowFunction · 0.85
getMethod · 0.65
whereMethod · 0.45
fromMethod · 0.45
selectMethod · 0.45

Tested by

no test coverage detected