Spaces:
Sleeping
Sleeping
| // ClauseGuard — Shared TypeScript types for the web app | |
| export interface Cat { | |
| name: string; | |
| severity: string; | |
| description?: string; | |
| confidence?: number; | |
| } | |
| export interface Clause { | |
| text: string; | |
| categories: Cat[]; | |
| } | |
| export interface Entity { | |
| text: string; | |
| type: string; | |
| score?: number; | |
| source?: string; | |
| } | |
| export interface Contradiction { | |
| type: string; | |
| explanation: string; | |
| severity: string; | |
| confidence?: number; | |
| source?: string; | |
| } | |
| export interface Obligation { | |
| type: string; | |
| party: string; | |
| description: string; | |
| deadline: string; | |
| priority?: number; | |
| } | |
| export interface ComplianceCheck { | |
| requirement: string; | |
| description: string; | |
| severity: string; | |
| status: string; | |
| matched_keywords: string[]; | |
| context?: string[]; | |
| } | |
| export interface ComplianceReg { | |
| description: string; | |
| compliance_rate: number; | |
| checks: ComplianceCheck[]; | |
| overall_status: string; | |
| negated_count?: number; | |
| ambiguous_count?: number; | |
| note?: string; | |
| } | |
| export interface Redline { | |
| original_text: string; | |
| clause_label: string; | |
| risk_level: string; | |
| safe_alternative: string; | |
| template_alternative?: string; | |
| legal_basis: string; | |
| consumer_standard: string; | |
| tier: string; | |
| } | |
| export interface ChatMessage { | |
| role: "user" | "assistant"; | |
| content: string; | |
| } | |
| export interface AnalysisResult { | |
| risk_score: number; | |
| grade: string; | |
| total_clauses: number; | |
| flagged_count: number; | |
| results: Clause[]; | |
| entities: Entity[]; | |
| contradictions: Contradiction[]; | |
| obligations: Obligation[]; | |
| compliance: Record<string, ComplianceReg>; | |
| redlines: Redline[]; | |
| model: string; | |
| latency_ms: number; | |
| session_id?: string; | |
| } | |