PageSourceSearch

https://kompoze.ai/assets/ReliabilityQA-DxV-kyJK.js

js kompoze.ai collected 2026-10-05 14:16:03 UTC 4,145 bytes, 1 lines download raw bytes

1import{r,j as e}from"./index-BgHJffnE.js";function S({session:l,onBack:j}){const[a,y]=r.useState(null),[o,n]=r.useState(""),[f,d]=r.useState(!1),[x,v]=r.useState("success"),[m,h]=r.useState(()=>crypto.randomUUID()),[p,N]=r.useState(null),u=new URLSearchParams(window.location.search);u.set("qa","1");const w=`/api/health?${u}`,b=async s=>{const t=await fetch(w,{method:s?"POST":"GET",headers:{Authorization:`Bearer ${l.access_token}`,"Content-Type":"application/json"},...s?{body:JSON.stringify(s)}:{}}),i=await t.json();if(!t.ok)throw new Error(`${i.message||i.error} · Ref ${i.requestId||"unavailable"}`);return i},c=()=>b().then(y).catch(s=>n(s.message));r.useEffect(()=>{c()},[l.access_token]);const g=async s=>{d(!0),n("");try{N(await b({action:s,scenario:x,key:m})),await c()}catch(t){n(t.message)}finally{d(!1)}};return e.jsx("main",{className:"min-h-screen bg-black text-zinc-100 p-8 font-sans",children:e.jsxs("div",{className:"max-w-5xl mx-auto space-y-6",children:[e.jsx("button",{className:"text-sm text-zinc-400",onClick:j,children:"← Studio"}),e.jsxs("header",{children:[e.jsx("p",{className:"text-xs uppercase tracking-widest text-zinc-500",children:"Restricted preview only"}),e.jsx("h1",{className:"text-2xl mt-2",children:"Reliability QA"}),e.jsx("p",{className:"text-sm text-zinc-400 mt-3",children:"Free provider fixtures; real storage, credits and recovery in the dedicated QA workspace. This does not test provider image quality. Customer administration is disabled in shared-database previews."})]}),o&&e.jsx("p",{role:"alert",className:"border border-amber-800 p-4 text-amber-200",children:o}),e.jsxs("section",{className:"border border-zinc-800 p-5 space-y-4",children:[e.jsxs("label",{className:"block text-sm",children:["Scenario"," ",e.jsxs("select",{className:"ml-3 bg-zinc-900 p-2",value:x,onChange:s=>{v(s.target.value),h(crypto.randomUUID())},children:[e.jsx("option",{value:"success",children:"Success"}),e.jsx("option",{value:"provider_rejection",children:"Provider rejection"}),e.jsx("option",{value:"storage_retry",children:"Storage fails twice"}),e.jsx("option",{value:"deadline",children:"Deadline exceeded"}),e.jsx("option",{value:"dead_letter",children:"Persistent failure / dead letter"})]})]}),e.jsxs("p",{className:"text-xs text-zinc-500 break-all",children:["Action key: ",m]}),e.jsxs("div",{className:"flex flex-wrap gap-3",children:[[["submit","Submit / retry same action"],["work","Run recovery worker"]].map(([s,t])=>e.jsx("button",{disabled:f,onClick:()=>void g(s),className:"bg-zinc-100 text-black rounded px-4 py-2 text-sm disabled:opacity-50",children:t},s)),e.jsx("button",{onClick:()=>h(crypto.randomUUID()),className:"border border-zinc-700 px-4 py-2 text-sm",children:"New action key"}),e.jsx("button",{onClick:()=>void c(),className:"border border-zinc-700 px-4 py-2 text-sm",children:"Refresh status"})]}),e.jsx("p",{className:"text-xs text-zinc-500",children:"Storage retries back off (10s, 20s, then 40s…). Repeated submission with the same key must keep the same generation ID. A new key is a new action."})]}),p&&e.jsx("pre",{className:"text-xs p-4 bg-zinc-950 overflow-auto","aria-label":"Last action result",children:JSON.stringify(p,null,2)}),a&&e.jsxs("section",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm",children:["Credits: ",a.quota.used," used · ",a.quota.reserved," reserved ·"," ",a.quota.enforced===!1?"monthly caps off":`${a.quota.remaining} available`,". Paid providers:"," ",a.paidGenerationEnabled?"enabled":"disabled","."]}),e.jsx("div",{className:"overflow-auto",children:e.jsxs("table",{className:"w-full text-xs text-left",children:[e.jsx("thead",{children:e.jsx("tr",{children:["Generation","State","Retries","Diagnostic"].map(s=>e.jsx("th",{className:"p-3 border-b border-zinc-800",children:s},s))})}),e.jsx("tbody",{children:a.jobs.map(s=>{var t;return e.jsxs("tr",{children:[e.jsx("td",{className:"p-3 font-mono",children:s.id}),e.jsxs("td",{children:[s.status," / ",s.stage]}),e.jsx("td",{children:s.recovery_attempts}),e.jsx("td",{children:((t=s.error)==null?void 0:t.code)||"—"})]},s.id)})})]})})]})]})})}export{S as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.