evOo-local/packages/adapters/src/messaging-context.ts
cynarAI 6c7eed7580 Initial clean evOo-local from f00577b
Fresh history cut from cynarAI/evoo antigravity-handoff/project-timeline
(Voice First + project timeline). Brand docs/titles as evOo; keep @rakazo/*
packages as tech debt. Excludes node_modules, caches, secrets, voice blobs.
2026-09-20 17:15:16 +02:00

15 lines
478 B
TypeScript

import type { PrismaClient } from "@rakazo/db";
/**
* Executor dep answering "does this bot belong to a messaging identity?" —
* one indexed query per run, and none when the messaging surface is absent.
*/
export function createMessagingContextLoader(prisma: PrismaClient) {
return {
hasIdentity: async (botId: string): Promise<boolean> =>
Boolean(
await prisma.messagingIdentity.findUnique({ where: { botId }, select: { id: true } }),
),
};
}