+
+
+
+ 배속
+ {SPEEDS.map((s) => (
+
+ ))}
+
+ {shown} / {items.length}
+
+
+
+ {items.slice(0, shown).map((item) => (
+
+ ))}
+
+
+
+ );
+}
diff --git a/app/subs/otel/[tenant]/s/[sessionId]/page.tsx b/app/subs/otel/[tenant]/s/[sessionId]/page.tsx
new file mode 100644
index 0000000..9e26f9e
--- /dev/null
+++ b/app/subs/otel/[tenant]/s/[sessionId]/page.tsx
@@ -0,0 +1,71 @@
+import Link from "next/link";
+import { notFound, redirect } from "next/navigation";
+import { findTenant, getSession, tenantPath } from "@/app/subs/otel/lib/tenant";
+import { sessionEvents } from "@/app/subs/otel/lib/queries";
+import { buildReplay } from "@/app/subs/otel/lib/replay";
+import { Header, kst, n, usd } from "../../ui";
+import Replay from "./Replay";
+
+export const dynamic = "force-dynamic";
+
+// 세션 하나를 채팅 화면처럼 다시 본다.
+export default async function SessionReplay({
+ params,
+}: {
+ params: Promise<{ tenant: string; sessionId: string }>;
+}) {
+ const { tenant: slug, sessionId } = await params;
+ const tenant = await findTenant(slug);
+ if (!tenant) notFound();
+ const session = await getSession(tenant);
+ if (!session) redirect(tenantPath(slug));
+
+ const events = await sessionEvents(tenant.id, decodeURIComponent(sessionId));
+ if (events.length === 0) notFound();
+ const items = buildReplay(events);
+
+ const user = events.find((e) => e.user_email)?.user_email;
+ const cost = items.reduce(
+ (s, i) => s + (i.kind === "api" ? i.costUsd : 0),
+ 0,
+ );
+ const prompts = items.filter((i) => i.kind === "user").length;
+ const tools = items.filter((i) => i.kind === "tool").length;
+ const contentMissing = items.some(
+ (i) => (i.kind === "user" || i.kind === "assistant") && i.text === null,
+ );
+
+ return (
+ <>
+