evOo-local/packages/db/src/thread-listing.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

26 lines
660 B
TypeScript

import { ACTIVE_RUN_STATUSES } from "@rakazo/core";
export const activeRunStatuses = [...ACTIVE_RUN_STATUSES];
export const activeRunSelection = {
where: { status: { in: activeRunStatuses } },
orderBy: { createdAt: "desc" as const },
take: 1,
select: { status: true },
} as const;
export function previewFromBlocks(blocks: unknown): string {
const rows = Array.isArray(blocks) ? blocks : [];
for (const block of rows) {
if (
block &&
typeof block === "object" &&
"text" in block &&
typeof (block as { text?: unknown }).text === "string"
) {
return (block as { text: string }).text;
}
}
return "";
}