export interface ApiErrorResponse { error: string; status: number; } export interface Conversation { createdAt: string; id: string; modelId: null | string; projectId: string; title: string; updatedAt: string; } export interface ConversationListResponse { items: Conversation[]; page: number; pageSize: number; total: number; } export interface ConversationResponse { conversation: Conversation; } export interface CreateConversationRequest { modelId?: string; title?: string; } export interface CreateMaterialRequest { associatedDate: string; description: string; materialType?: MaterialType; } export interface CreateModelRequest { capabilities: ModelCapability[]; contextLength?: null | number; externalId: string; maxOutputTokens?: null | number; name: string; providerId: string; } export interface CreateProjectRequest { description?: string; name: string; } export interface CreateProviderRequest { apiKey: string; baseUrl: string; name: string; type: ProviderType; } export interface ApproveMaterialRequest { entityConfirmations?: EntityConfirmation[]; } export interface CandidateEntity { context: string; matchedEntityId: null | string; name: string; type: EntityType; } export interface CreateEntityRequest { aliases?: string[]; description?: string; name: string; type: EntityType; } export interface Entity { aliases: string[]; createdAt: string; description: string; id: string; name: string; projectId: string; type: EntityType; updatedAt: string; } export interface EntityConfirmation { action: "create" | "discard" | "merge" | "select"; candidateIndex: number; targetEntityId?: string; } export interface EntityListResponse { items: Entity[]; page: number; pageSize: number; total: number; } export interface EntityResponse { entity: Entity; } export const ENTITY_TYPES = [ "person", "organization", "system", "feature", "requirement", "issue", "term", "other", ] as const; export type EntityType = (typeof ENTITY_TYPES)[number]; export interface ProcessingResult { candidateEntities: CandidateEntity[]; normalizedContent: string; summary: string; } export interface UpdateEntityRequest { aliases?: string[]; description?: string; name?: string; type?: EntityType; } export interface ListSortParams { sortBy?: string; sortOrder?: SortOrder; } export interface Material { associatedDate: string; createdAt: string; description: string; id: string; materialType: MaterialType; processedContent: null | string; projectId: string; status: MaterialStatus; updatedAt: string; } export interface MaterialListResponse { items: Material[]; page: number; pageSize: number; total: number; } export interface MaterialResponse { material: Material; } export type MaterialStatus = "approved" | "discarded" | "failed" | "pending" | "processing" | "review"; export type MaterialType = "general" | "meeting"; export interface Message { content: string; conversationId: string; createdAt: string; id: string; parts: null | string; role: "assistant" | "system" | "user"; updatedAt: string; } export interface MessageListResponse { items: Message[]; page: number; pageSize: number; total: number; } export interface MetaResponse { ok: true; service: string; timestamp: string; version: string; } export interface Model { capabilities: ModelCapability[]; contextLength: null | number; createdAt: string; externalId: string; id: string; maxOutputTokens: null | number; name: string; providerId: string; updatedAt: string; } export type ModelCapability = | "audio-generation" | "audio-recognition" | "image-generation" | "image-recognition" | "reasoning" | "text" | "video-generation" | "video-recognition"; export type SortOrder = "asc" | "desc"; export interface UpdateConversationRequest { modelId?: string; title?: string; } export const MODEL_CAPABILITIES: readonly ModelCapability[] = [ "audio-generation", "audio-recognition", "image-generation", "image-recognition", "reasoning", "text", "video-generation", "video-recognition", ]; export interface ModelListResponse { items: Model[]; page: number; pageSize: number; total: number; } export interface ModelResponse { model: Model; } export interface ModelTestResponse { message: string; ok: boolean; } export interface ModelTestResultResponse { modelTestResponse: ModelTestResponse; } export interface Project { createdAt: string; description: string; id: string; name: string; status: ProjectStatus; updatedAt: string; } export interface ProjectListResponse { items: Project[]; page: number; pageSize: number; total: number; } export interface ProjectResponse { project: Project; } export type ProjectStatus = "active" | "archived"; export interface Provider { apiKey: string; baseUrl: string; createdAt: string; id: string; name: string; type: ProviderType; updatedAt: string; } export interface ProviderListResponse { items: Provider[]; page: number; pageSize: number; total: number; } export interface ProviderOption { id: string; name: string; type: ProviderType; } export interface ProviderOptionsResponse { items: ProviderOption[]; } export interface ProviderResponse { provider: Provider; } export interface ProviderTestResponse { message: string; ok: boolean; } export interface ProviderTestResultResponse { providerTestResponse: ProviderTestResponse; } export type ProviderType = "anthropic" | "openai" | "openai-compatible"; export type RuntimeMode = "development" | "production" | "test"; /** 模型能力到默认模型 ID 的映射,用于后台自动流程 */ export interface DefaultModelSettings { /** 文本能力,覆盖 text + reasoning */ text?: string | null; imageRecognition?: string | null; audioRecognition?: string | null; videoRecognition?: string | null; imageGeneration?: string | null; audioGeneration?: string | null; videoGeneration?: string | null; } export interface SettingsData { compact?: boolean; defaultModels?: DefaultModelSettings; theme: ThemePreference; } export interface TestModelRequest { externalId: string; providerId: string; } export type ThemePreference = "dark" | "light" | "system"; export interface UpdateModelRequest { capabilities?: ModelCapability[]; contextLength?: null | number; externalId?: string; maxOutputTokens?: null | number; name?: string; providerId?: string; } export interface UpdateProjectRequest { description?: string; name?: string; } export interface UpdateProviderRequest { apiKey?: string; baseUrl?: string; name?: string; type?: ProviderType; }