Multi-tenant platform (182 pages, 228 API routes, ~30 modules) built on a deterministic verification core: clinical-trial claims checked against ClinicalTrials.gov registered results and raw event counts (ARR/NNT/RR+CI recomputed in code, oracle-tested), code-enforced exact-span grounding, and multi-source cross-verification. Auth/RBAC/multi-tenancy, document processing at scale (unpdf + Docling), agentic workflows, Claude Science connector, compliance/audit, billing, public API, and more. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
55 lines
1.4 KiB
TypeScript
55 lines
1.4 KiB
TypeScript
// Client mirror of the science API shapes. Kept separate from lib/science/types
|
|
// so page bundles don't pull in zod. No server-only imports here.
|
|
|
|
export type SessionStatus = "active" | "archived";
|
|
export type MessageRole = "user" | "assistant" | "system";
|
|
export type ConnectionStatus = "disabled" | "enabled" | "error";
|
|
|
|
export interface ScienceSession {
|
|
id: string;
|
|
orgId: string;
|
|
projectId: string | null;
|
|
title: string;
|
|
status: SessionStatus;
|
|
createdBy: string | null;
|
|
createdAt: string;
|
|
}
|
|
|
|
export interface ResearchArtifacts {
|
|
literatureQueries: string[];
|
|
citations: { title: string; source: string; note: string | null }[];
|
|
nextSteps: string[];
|
|
}
|
|
|
|
export interface ScienceMessage {
|
|
id: string;
|
|
orgId: string;
|
|
sessionId: string;
|
|
role: MessageRole;
|
|
content: string;
|
|
artifacts: ResearchArtifacts;
|
|
createdAt: string;
|
|
}
|
|
|
|
export interface ScienceConnectionConfig {
|
|
endpoint: string | null;
|
|
workspaceId: string | null;
|
|
notes: string | null;
|
|
}
|
|
|
|
export interface ScienceConnection {
|
|
id: string;
|
|
orgId: string;
|
|
name: string;
|
|
config: ScienceConnectionConfig;
|
|
status: ConnectionStatus;
|
|
createdAt: string;
|
|
}
|
|
|
|
// Shape returned by GET /api/science/sessions/[id].
|
|
export interface SessionDetail {
|
|
session: ScienceSession;
|
|
messages: ScienceMessage[];
|
|
workbench: { configured: boolean; endpoint: string | null; reason: string | null };
|
|
}
|