MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / roleOf

Function roleOf

apps/api/src/agents/persistence.ts:30–33  ·  view source on GitHub ↗

* Prisma-backed `ConversationStore` for Better Agent. * * One Better Agent `ConversationItem` (message, tool call, or tool * result) is stored as one `ChatMessage` row. The `parts` JSON column * holds the entire item; `role` is a discriminator for analytics. * * Save semantics: Better Agent ha

(item: ConversationItem)

Source from the content-addressed store, hash-verified

28 * invariant and don't check it explicitly.
29 */
30function roleOf(item: ConversationItem): string {
31 if (item.type === 'message') return item.role;
32 return item.type;
33}
34
35function itemToRow(conversationId: string, item: ConversationItem) {
36 return {

Callers 1

itemToRowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected