Spaces:
Paused
Paused
Download frontend/apps/internal/src/components/ForensicsView.tsx from 3SCError404/nexus: direct link, hf CLI and curl.
- Browser
- Download file 4.38 kB
-
https://huggingface.co/spaces/3SCError404/nexus/resolve/main/frontend/apps/internal/src/components/ForensicsView.tsx
- Command line
-
hf download hf://spaces/3SCError404/nexus/frontend/apps/internal/src/components/ForensicsView.tsx
-
curl -L -o ForensicsView.tsx https://huggingface.co/spaces/3SCError404/nexus/resolve/main/frontend/apps/internal/src/components/ForensicsView.tsx
4.38 kB
| import React, { useState } from 'react'; | |
| import styles from './ForensicsView.module.css'; | |
| const TICKETS = [ | |
| { id:"TKT-1048", title:"Production DB latency spike — 8x degradation", customer:"Arjun Mehta", priority:"URGENT" }, | |
| { id:"TKT-1047", title:"SSO login loop after tenant migration", customer:"Lisa Park", priority:"HIGH" }, | |
| { id:"TKT-1046", title:"Webhook delivery failing — 503 responses", customer:"Dev Team B", priority:"HIGH" }, | |
| ]; | |
| const FORENSIC_STEPS = [ | |
| { time:"10:42:01", node:"vision", label:"Vision", detail:"No attachments found. Skipped visual scan.", status:"skip" }, | |
| { time:"10:42:02", node:"input_guard", label:"Input Guard", detail:"No injection patterns detected. Cleared.", status:"ok" }, | |
| { time:"10:42:02", node:"router", label:"Intent Router", detail:"Intent: DIAGNOSE_TICKET. Tools selected: SQL + KB.", status:"ok" }, | |
| { time:"10:42:03", node:"executor", label:"Tool Executor", detail:"Parallel: SQL query (12ms) + KB vector search (31ms).", status:"ok" }, | |
| { time:"10:42:04", node:"responder", label:"Responder", detail:"Generated structured diagnosis with code block.", status:"ok" }, | |
| { time:"10:42:05", node:"approval", label:"HITL Approval", detail:"Write action detected. Paused for staff approval.", status:"wait" }, | |
| ]; | |
| export const ForensicsView: React.FC = () => { | |
| const [selected, setSelected] = useState(TICKETS[1]); | |
| return ( | |
| <div className={styles.container}> | |
| <div className={styles.ticketList}> | |
| <div className={styles.listHeader}>Select ticket to inspect</div> | |
| {TICKETS.map(t => ( | |
| <div | |
| key={t.id} | |
| onClick={() => setSelected(t)} | |
| className={`${styles.ticketCard} ${selected?.id === t.id ? styles.selectedCard : ''}`} | |
| > | |
| <div className={styles.cardHeader}> | |
| <span className={styles.ticketId}>{t.id}</span> | |
| <span className={styles.priorityPill} style={{ color: t.priority === 'URGENT' ? 'var(--red)' : 'var(--amber)' }}>{t.priority}</span> | |
| </div> | |
| <div className={styles.cardTitle}>{t.title}</div> | |
| <div className={styles.cardCustomer}>{t.customer}</div> | |
| </div> | |
| ))} | |
| </div> | |
| <div className={styles.inspector}> | |
| <div className={styles.inspectorHeader}>Forensic timeline — {selected?.id}</div> | |
| <div className={styles.timelineCard}> | |
| {FORENSIC_STEPS.map((step, i) => ( | |
| <div key={i} className={styles.timelineItem}> | |
| <div className={styles.timelineGraphic}> | |
| <div className={`${styles.graphicDot} ${styles['status_' + step.status]}`}> | |
| {step.status === 'ok' ? '✓' : step.status === 'wait' ? '⏸' : '–'} | |
| </div> | |
| {i < FORENSIC_STEPS.length - 1 && <div className={styles.graphicLine} />} | |
| </div> | |
| <div className={styles.timelineContent}> | |
| <div className={styles.stepHeader}> | |
| <span className={styles.stepLabel} style={{ color: step.status === 'wait' ? 'var(--amber)' : 'var(--text1)' }}>{step.label}</span> | |
| <span className={styles.stepTime}>{step.time}</span> | |
| </div> | |
| <div className={styles.stepDetail}>{step.detail}</div> | |
| </div> | |
| </div> | |
| ))} | |
| </div> | |
| <div className={styles.interactionRecord}> | |
| <div className={styles.recordTitle}>AI interaction record</div> | |
| {[ | |
| { label:"Confidence", value:"91%", color:"var(--green)" }, | |
| { label:"Model", value:"kimi-k2.5:cloud", color:"var(--purple)" }, | |
| { label:"Latency", value:"847ms", color:"var(--amber)" }, | |
| { label:"Tools called", value:"2", color:"var(--accent)" }, | |
| { label:"Tokens used", value:"1,204", color:"var(--text2)" }, | |
| { label:"Workspace", value:"snowball-corp", color:"var(--text2)" }, | |
| ].map(r => ( | |
| <div key={r.label} className={styles.recordRow}> | |
| <span className={styles.recordLabel}>{r.label}</span> | |
| <span className={styles.recordValue} style={{ color: r.color }}>{r.value}</span> | |
| </div> | |
| ))} | |
| </div> | |
| </div> | |
| </div> | |
| ); | |
| }; | |