- applications/iknowyou: new Next.js chat application with persona-aware conversations, briefing API, cohort logic, vLLM streaming, and sidebar navigation - tidal M8: add replication control plane (control.rs), tenant migration state machine (migration.rs), tenant/upgrade coordinators, cluster/fault test harnesses - tidal M8 tests: expand m8p2/m8p3/m8p4 test suites; add m8p5_multitenancy and m8_uat - tidal db: split replication_ops out of db/mod.rs (was 647 lines, now 574) - .claude: add kai-park, kaya-osei, mira-vasquez agents; add aeries-design-architect, aeries-fullstack-engineer, aeries-product-visionary skills - docs: update ROADMAP.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
29 lines
787 B
TypeScript
29 lines
787 B
TypeScript
import { getMessages } from "@/lib/synap";
|
|
import type { ChatMessage } from "@/lib/types";
|
|
|
|
export async function GET(
|
|
_req: Request,
|
|
{ params }: { params: Promise<{ id: string }> }
|
|
) {
|
|
const { id } = await params;
|
|
|
|
try {
|
|
const data = await getMessages(id, 100);
|
|
|
|
const messages: ChatMessage[] = (data.messages ?? []).map((m) => ({
|
|
id: m.id,
|
|
role: m.user_id === "aeries" ? ("assistant" as const) : ("user" as const),
|
|
content: m.content,
|
|
timestamp: new Date(m.timestamp).getTime(),
|
|
}));
|
|
|
|
// Synap returns newest-first; reverse for chronological order
|
|
messages.reverse();
|
|
|
|
return Response.json({ messages });
|
|
} catch {
|
|
// New conversation with no messages yet — return empty
|
|
return Response.json({ messages: [] });
|
|
}
|
|
}
|