| export type ApiTabKey = |
| | "knowledgebase" |
| | "router_kb" |
| | "telco" |
| | "pots_estimator" |
| | "routers" |
| | "masters" |
| | "pots" |
| | "intake" |
| | "rapid_router"; |
|
|
| export type ApiUiTabFlags = Partial<Record<ApiTabKey, boolean | number | string | null>>; |
|
|
| export type ApiTranscriptTurn = { |
| role: "user" | "assistant"; |
| content: string; |
| }; |
|
|
| export type ApiSourceRef = { |
| doc?: string; |
| document?: string; |
| page?: number | string; |
| pageno?: number | string; |
| pages?: string; |
| loc?: string; |
| location?: string; |
| excerpt?: string; |
| }; |
|
|
| export type ApiChatResponse = { |
| assistant?: string; |
| state?: Record<string, unknown>; |
| sources?: ApiSourceRef[]; |
| files?: string[]; |
| meta?: Record<string, unknown>; |
| prompt_version?: string; |
| effective_audience?: string; |
| render?: Record<string, unknown>; |
| error?: string; |
| }; |
|
|
| export type ApiHealthCheck = { |
| name: string; |
| kind?: string; |
| path?: string; |
| required?: boolean; |
| ok: boolean; |
| exists?: boolean; |
| writable?: boolean | null; |
| error?: string | null; |
| }; |
|
|
| export type ApiHealthAuthStatus = { |
| required?: boolean; |
| enabled?: boolean; |
| issuer?: string; |
| audience?: string; |
| email_claim?: string; |
| allowed_domains?: string[]; |
| config_error?: string; |
| config_details?: string[]; |
| config_warnings?: string[]; |
| }; |
|
|
| export type ApiHealthResponse = { |
| ok: boolean; |
| summary?: { |
| required_ok?: number; |
| required_total?: number; |
| total_checks?: number; |
| }; |
| checks: ApiHealthCheck[]; |
| env: Record<string, boolean>; |
| auth?: ApiHealthAuthStatus; |
| }; |
|
|
| export type ApiObservabilityEndpoint = { |
| endpoint: string; |
| total_requests: number; |
| error_requests: number; |
| error_rate: number; |
| status_counts: Record<string, number>; |
| avg_latency_ms: number; |
| p95_latency_ms: number; |
| max_latency_ms: number; |
| last_seen?: string; |
| }; |
|
|
| export type ApiObservabilityMetricsResponse = { |
| generated_at: string; |
| started_at: string; |
| window_size: number; |
| totals: { |
| requests: number; |
| errors: number; |
| error_rate: number; |
| }; |
| endpoints: ApiObservabilityEndpoint[]; |
| recent_errors: Array<{ |
| ts: string; |
| request_id: string; |
| method: string; |
| path: string; |
| endpoint: string; |
| status: number; |
| latency_ms: number; |
| error?: string; |
| }>; |
| }; |
|
|