/** Client-safe types re-exported from server modules (type-only imports are erased at build). */ export type { PolyModel, ProviderId, ModelCapabilities, ModelParameters, ModelPricing, ReasoningEffort, UnifiedGenerationSettings, Usage, PolyProviderErrorShape, PolyErrorCode } from "@/lib/ai/core/types"; export type { PublicConversation } from "@/lib/conversations/service"; export type { PublicMessage, StoredPart } from "@/lib/chat/service"; export type { PublicConnection } from "@/lib/providers/keys"; export type { GenerationSettingsInput, ChatRequestInput } from "@/lib/chat/schemas"; export type { ModelPreset, PromptPreset, Folder, UserPreferences, ArenaSession, ArenaResponse } from "@/db/schema"; export type { Project, ProjectFile, Prompt, CustomEndpoint, ArenaVote } from "@/db/schema-workspace"; export interface ModelsResponse { models: import("@/lib/ai/core/types").PolyModel[]; favorites: string[]; recents: string[]; /** User labels per model key. */ labels: Record; connectedProviders: import("@/lib/ai/core/types").ProviderId[]; } export interface ConversationsResponse { conversations: import("@/lib/conversations/service").PublicConversation[]; nextCursor: string | null; } export interface ConversationDetail { conversation: import("@/lib/conversations/service").PublicConversation; messages: import("@/lib/chat/service").PublicMessage[]; } /** Events emitted by POST /api/chat (SSE). */ export type ChatStreamEvent = | { type: "meta"; conversationId: string; isNewConversation: boolean; userMessage: import("@/lib/chat/service").PublicMessage | null; assistantMessageId: string; modelKey: string; clientId?: string } | { type: "text-delta"; text: string } | { type: "reasoning-delta"; text: string } | { type: "tool-start"; id: string; name: string } | { type: "tool-delta"; id: string; argumentsDelta: string } | { type: "tool-end"; id: string; name: string; arguments: Record; argumentsText?: string } | { type: "tool-result"; id: string; name: string; result: unknown; isError: boolean; durationMs: number } | { type: "server-tool"; name: string; status: "started" | "completed"; data?: unknown } | { type: "citation"; citation: { url?: string; title?: string; snippet?: string } } | { type: "refusal"; category?: string | null; explanation?: string | null } | { type: "error"; error: import("@/lib/ai/core/types").PolyProviderErrorShape } | { type: "done"; message: import("@/lib/chat/service").PublicMessage; usage?: import("@/lib/ai/core/types").Usage; costUsd: number | null; latencyMs: number; ttftMs?: number; status: "complete" | "stopped" | "error"; title?: string; error?: import("@/lib/ai/core/types").PolyProviderErrorShape }; /** Extra fields the chat `meta` event carries since the 1.0 upgrade (workstream A). */ export interface ChatMetaExtras { /** Temporary chat — nothing persisted except the usage record; `conversationId` is the "ephemeral" sentinel. */ ephemeral?: boolean; /** Server request id (X-Request-Id) for the error details sheet. */ requestId?: string; } /** Diagnostics stored on a failed assistant message (see `lib/chat/service.ts` `StoredMessageError`). */ export type { StoredMessageError } from "@/lib/chat/service"; /** Response of POST /api/chat/adopt. */ export interface ChatAdoptResponse { conversation: import("@/lib/conversations/service").PublicConversation; userMessage: import("@/lib/chat/service").PublicMessage | null; message: import("@/lib/chat/service").PublicMessage; isNewConversation: boolean; } /** Workspace (Projects / Library / Prompt library) public shapes — appended by the Projects workstream. */ export type { PublicProject, ProjectDetail } from "@/lib/projects/service"; export type { PublicProjectFile, PendingAttachment } from "@/lib/library/service"; export type { PublicPrompt, PromptKind, UsePromptResult } from "@/lib/prompts/service"; export type { PromptVariable } from "@/lib/prompts/variables"; // --- Search / share / export (workstream G) ------------------------------------------------------- export type { SearchResponse, SearchGroup, SearchConversationHit, SearchMessageHit, SearchModelHit, SearchPromptHit, SearchProjectHit, SearchPresetHit } from "@/lib/search/service"; export type { ShareLinkItem, ExportFormat, ShareSnapshotMeta } from "@/lib/conversations/service"; export type { ParsedQuery, FilterToken, FilterKey } from "@/lib/search/query"; // --- Usage analytics, providers, custom endpoints (workstream E) ------------------------------ export type { PublicEndpoint, EndpointInput, EndpointPatch, EndpointProbeResult } from "@/lib/endpoints/service"; export type { ManualModel } from "@/lib/ai/providers/custom"; export type { UsageSummary, UsageKpis, UsageSeriesPoint, ProviderAgg, ModelAgg, UsageProjection, RecentRecord } from "@/lib/usage/service"; export type { SavingsOpportunity } from "@/lib/usage/savings";