@viberaven/cli 1.6.6 → 1.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/stack/app.js CHANGED
@@ -1,19 +1,25 @@
1
- "use strict";(()=>{function Ze(e=document){return e.querySelector('meta[name="viberaven-token"]')?.content??""}async function T(e,i){let n=await fetch(e,{...i,credentials:"same-origin",headers:{"content-type":"application/json","x-viberaven-token":Ze(),...i?.headers??{}}}),s=await n.text(),a=null;try{a=s?JSON.parse(s):null}catch{a={error:s}}if(!n.ok){let c=a?.error??a?.message??s??`HTTP ${n.status}`;throw new Error(String(c))}return a}var x=(e,i)=>T(e,{method:"POST",body:JSON.stringify(i)}),k={project:()=>T("/api/project"),scan:()=>x("/api/scan",{}),scanStatus:()=>T("/api/scan-status"),githubWorkflow:()=>T("/api/github-workflow"),addGithubWorkflow:()=>x("/api/github-workflow",{}),agents:()=>T("/api/cli-agents"),probe:e=>x("/api/cli-agents/probe",{cliId:e}),runSetup:(e,i)=>x("/api/cli-agents/run-setup",{cliId:e,step:i}),openTerminal:(e,i)=>x("/api/cli-agents/open-terminal",{cliId:e,step:i}),chat:e=>x("/api/agent-chat",e),catalog:()=>T("/api/provider-catalog"),verified:()=>T("/api/provider-verify"),stop:e=>x("/api/agent-chat/stop",{runId:e}),verify:e=>x("/api/provider-verify",e),connectMcp:e=>x("/api/mcp/connect",{providerId:e}),compare:(e,i)=>T(`/api/releases/compare?from=${encodeURIComponent(e)}&to=${encodeURIComponent(i)}`),fullCheckStatus:()=>T("/api/fullcheck/status"),fullCheckSignInStart:()=>x("/api/fullcheck/signin/start",{}),fullCheckSignInPoll:()=>x("/api/fullcheck/signin/poll",{}),fullCheckSignOut:()=>x("/api/fullcheck/signout",{}),fullCheckPrepare:()=>x("/api/fullcheck/prepare",{}),fullCheckRun:e=>x("/api/fullcheck/run",{previewId:e}),changelog:(e,i)=>T(`/api/releases/changelog?from=${encodeURIComponent(e)}&to=${encodeURIComponent(i)}`)};function t(e,i,...n){let s=document.createElement(e);if(i){for(let[a,c]of Object.entries(i))if(!(c==null||c===!1))if(a==="class")s.className=String(c);else if(a==="on")for(let[u,o]of Object.entries(c))s.addEventListener(u,o);else if(a==="dataset")for(let[u,o]of Object.entries(c))s.dataset[u]=o;else a==="html"?s.innerHTML=String(c):a==="style"&&typeof c=="object"?Object.assign(s.style,c):a in s&&typeof c!="string"?s[a]=c:s.setAttribute(a,String(c))}return ge(s,n),s}function ge(e,i){for(let n of i)n==null||n===!1||(Array.isArray(n)?ge(e,n):n instanceof Node?e.appendChild(n):e.appendChild(document.createTextNode(String(n))))}function G(e){return e.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i])}function Z(e){let n=G(e.replace(/\r\n/g,`
2
- `)).split(/```/),s="";return n.forEach((a,c)=>{if(c%2===1){let p=a.replace(/^[a-z0-9-]*\n/i,"");s+=`<pre><code>${p}</code></pre>`;return}let u=a.split(`
3
- `),o=null;for(let p of u){let r=p.trimEnd(),l=/^\s*[-*•]\s+(.*)$/.exec(r),d=/^\s*\d+[.)]\s+(.*)$/.exec(r),h=/^(#{1,3})\s+(.*)$/.exec(r),y=l?"ul":d?"ol":null;o&&y!==o&&(s+=`</${o}>`,o=null),y&&!o&&(s+=`<${y}>`,o=y),l||d?s+=`<li>${ee((l??d)[1])}</li>`:h?s+=`<h4>${ee(h[2])}</h4>`:r.trim()&&(s+=`<p>${ee(r)}</p>`)}o&&(s+=`</${o}>`)}),s}function ee(e){return e.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>")}function E(e){let i=Date.now()-new Date(e).getTime();if(!Number.isFinite(i)||i<0)return"just now";let n=Math.round(i/6e4);if(n<1)return"just now";if(n<60)return`${n} min ago`;let s=Math.round(n/60);return s<24?`${s} h ago`:`${Math.round(s/24)} d ago`}function W(){return{step:"closed",status:null,signIn:null,preview:null,result:null,limit:null,error:null,notice:null}}var Ve=new Set(["network","timeout","server","rate_limited","busy"]);function fe(e,i={}){let n=i.wait??(g=>new Promise(m=>window.setTimeout(m,g))),s=0,a=()=>e.get().fullCheck,c=g=>e.set(m=>({fullCheck:{...m.fullCheck,...g}})),u=g=>g===s&&a().step!=="closed";async function o(g){try{return await g()}catch(m){return{kind:"error",reason:"unexpected",message:`The Studio did not answer: ${m instanceof Error?m.message:String(m)}`}}}async function p(){try{let g=await k.fullCheckStatus();return c({status:g}),g}catch{return null}}async function r(g,m,M){if(u(M))switch(g.kind){case"signin":c({step:"signin",signIn:{code:g.code,verificationUrl:g.verificationUrl,expiresAt:g.expiresAt,opened:g.opened},error:null}),l(M,g.pollIntervalSeconds);return;case"signin_pending":return;case"signed_in":if(c({signIn:null,notice:g.notice??(a().preview?"Signed in again. Confirm to send the same request.":null)}),await p(),!u(M))return;a().preview?c({step:"preview"}):await h(M);return;case"signin_expired":case"signin_denied":c({step:"error",signIn:null,error:{message:g.message,retry:"signin"}});return;case"signed_out":c({...W()}),e.toast("Signed out of VibeRaven on this computer.");return;case"signin_required":case"reauth":c({notice:g.message}),await d(M);return;case"preview":c({step:"preview",preview:g.preview,error:null});return;case"result":c({step:"result",result:g.result,preview:null,notice:null,error:null}),await p();return;case"plan_limit":c({step:"limit",preview:null,notice:null,limit:{plan:g.plan,message:g.message,pricingUrl:g.pricingUrl,usage:g.usage}}),await p();return;case"error":{let w=g.reason==="not_confirmed"||g.reason==="prepare_failed"?"prepare":g.reason==="no_signin"?"signin":m==="run"&&!Ve.has(g.reason)?"prepare":m;w==="prepare"&&m==="run"&&c({preview:null}),c({step:"error",error:{message:g.message,retry:w}});return}}}async function l(g,m){for(;u(g)&&a().step==="signin";){if(await n(Math.max(1,m)*1e3),!u(g)||a().step!=="signin")return;let M=await o(()=>k.fullCheckSignInPoll());if(M.kind!=="signin_pending"){await r(M,"signin",g);return}}}async function d(g){c({step:"loading",error:null}),await r(await o(()=>k.fullCheckSignInStart()),"signin",g)}async function h(g){c({step:"preparing",error:null,result:null,limit:null}),await r(await o(()=>k.fullCheckPrepare()),"prepare",g)}async function y(g){c({step:"loading",error:null});let m=await p();if(u(g)){if(!m){c({step:"error",error:{message:"The Studio server did not answer. Reload the page and try again.",retry:"status"}});return}m.signedIn?await h(g):await d(g)}}return{async openFullCheck(){let g=a().step;g!=="closed"&&g!=="result"&&g!=="limit"&&g!=="error"||(s+=1,c({...W(),step:"loading",status:a().status}),await y(s))},closeFullCheck(){s+=1,c({step:"closed",signIn:null,error:null,notice:null}),document.getElementById("run-full-check")?.focus({preventScroll:!0})},async fullCheckSignIn(){await d(s)},async fullCheckConfirm(){let g=a().preview;if(!g||a().step!=="preview")return;let m=s;c({step:"running",error:null}),await r(await o(()=>k.fullCheckRun(g.id)),"run",m)},async fullCheckRetry(){let g=a().error?.retry??"status",m=s;if(g==="run"&&a().preview){c({step:"preview",error:null});return}g==="signin"?await d(m):g==="prepare"?await h(m):await y(m)},async fullCheckSignOut(){await r(await o(()=>k.fullCheckSignOut()),"status",s),await p()},async copyFullCheckPrompt(g){try{await navigator.clipboard.writeText(g),e.toast("Fix prompt copied. Paste it into your coding agent.")}catch{e.toast("Could not copy. Select the text and copy it by hand.","err")}}}}function z(e){return e?e.plan==="pro"?`${e.used} of ${e.limit} Pro full checks used this month`:`${e.used} of ${e.limit} free full checks used`:null}function me(e){return e==="pro"?"Pro plan":"Free plan"}function te(e){return e<1024?`${e} B`:`${(e/1024).toFixed(1)} KB`}function We(e){try{return new URL(e).host}catch{return e}}function he(e){return t("span",{class:`tag ${e==="critical"?"red":e==="warning"?"amber":"dim"}`},e==="critical"?"Critical":e==="warning"?"Important":"Nice to have")}function qe(e,i){let n=e.status?.account;if(!n)return null;let s=z(e.status?.usage);return t("div",{class:"fc-account"},t("span",{class:"fc-avatar","aria-hidden":"true"},n.email.slice(0,1).toUpperCase()),t("span",{class:"fc-who"},`Signed in as ${n.email}`),t("span",{class:`fc-plan is-${n.plan}`},me(n.plan)),e.status?.sessionOnly?t("span",{class:"fc-dot"},"this session only"):null,s?t("span",{class:"fc-dot"},s):null,t("button",{class:"fc-link",on:{click:()=>i.fullCheckSignOut()}},"Sign out"))}function Ke(e,i){let n=e.signIn;return[t("p",{class:"fc-lead"},e.notice??"Full checks run on VibeRaven, so they need your VibeRaven account. Sign in once on this computer."),t("div",{class:"fc-code"},t("span",{class:"fc-code-label"},"Your code"),t("strong",{id:"fc-code"},...n.code.split("").map(s=>t("span",{},s)))),t("p",{class:"fc-hint"},n.opened?"We opened the sign-in page in your browser. Check the code matches, then confirm it there.":"Open the sign-in page, check the code matches, then confirm it there."),t("div",{class:"fc-actions"},t("a",{class:"btn primary",href:n.verificationUrl,target:"_blank",rel:"noopener noreferrer"},"Open the sign-in page"),t("span",{class:"fc-wait",role:"status"},t("span",{class:"spin"}),"Waiting for you to confirm\u2026"),t("button",{class:"btn ghost",on:{click:()=>i.closeFullCheck()}},"Cancel"))]}function V(e,i,n,s=!1){return t("details",{class:"fc-files",open:s},t("summary",{},t("span",{},e),t("span",{class:"fc-files-count"},String(i.length))),i.length?t("ul",{},...i.map(a=>t("li",{},t("code",{},a.path),t("span",{},a.meta)))):t("p",{class:"fc-empty"},n))}function Xe(e,i){let n=e.preview,s=n.promptFiles.length;return[e.notice?t("p",{class:"fc-notice",role:"status"},e.notice):null,t("div",{class:"fc-summary"},t("div",{class:"fc-summary-main"},t("span",{class:"fc-summary-size"},te(n.bytes)),t("span",{class:"fc-summary-what"},`${s} file${s===1?"":"s"} in full, plus names and snippets`)),t("p",{class:"fc-lead"},`This is exactly what gets sent to ${We(n.endpoint)} when you confirm. Nothing has been uploaded yet.`)),qe(e,i),t("dl",{class:"fc-facts"},t("div",{},t("dt",{},"Project folder"),t("dd",{},t("code",{},n.workspacePath))),t("div",{},t("dt",{},"Request size"),t("dd",{},te(n.bytes))),t("div",{},t("dt",{},"SPEC.md"),t("dd",{},n.spec.included?`Included (${n.spec.chars.toLocaleString()} characters)`:"Not found, not sent")),t("div",{},t("dt",{},"Dependencies"),t("dd",{},`${n.dependencyCount} package names`)),t("div",{},t("dt",{},"File tree"),t("dd",{},`${n.fileTreeEntries} paths, names only`))),t("div",{class:"fc-filegrid"},V("Files sent in full",n.promptFiles.map(a=>({path:a.path,meta:`${a.chars.toLocaleString()} chars${a.redactions?`, ${a.redactions} redacted`:""}`})),"No file contents are sent.",!0),V("File snippets (first 200 characters)",n.snippetFiles.map(a=>({path:a.path,meta:a.heat})),"None."),V("Skipped as secret files (name sent, contents never read)",n.secretFilesNamedOnly.map(a=>({path:a,meta:"name only"})),"None found."),V("Request text by section",n.promptSections.map(a=>({path:a.title,meta:`${a.chars.toLocaleString()} chars`})),"Empty.")),t("p",{id:"fc-redaction",class:`fc-shield${n.redactions>0?" is-on":""}`},n.redactions>0?`VibeRaven replaced ${n.redactions} secret-looking value${n.redactions===1?"":"s"} with [REDACTED]. `:"VibeRaven found no secret-looking values to replace. ","This is pattern matching, not a guarantee. Other files are sent as they are, so read the exact request body below before you send it."),t("details",{class:"fc-raw"},t("summary",{},`Show the exact request body: the prompt, file snippets and SPEC.md. Shown formatted here; sent compact (${te(n.bytes)}), same content.`),t("pre",{id:"fc-request-json"},n.requestJson)),t("p",{class:"fc-hint"},"Most of the request text is written by VibeRaven on your machine from the local scan: stack notes and the check instructions."),t("div",{class:"fc-actions fc-footer"},t("button",{id:"fc-confirm",class:"btn primary",on:{click:()=>i.fullCheckConfirm()}},"Send and run full check"),t("button",{class:"btn ghost",on:{click:()=>i.closeFullCheck()}},"Cancel"))]}function Je(e){return e<50?"fail":e<80?"warn":"pass"}function _e(e,i){let n=e.result,s=n.areas.reduce((o,p)=>o+p.hiddenCount,0),a=n.nextFix,c=n.areas.filter(o=>!o.locked&&o.findings.length),u=n.areas.filter(o=>o.locked||!o.findings.length);return[t("div",{class:`fc-score is-${Je(n.score)}`},t("div",{class:"fc-score-num",style:`--score:${Math.max(0,Math.min(100,n.score))}`},String(n.score)),t("div",{},t("div",{class:"fc-score-label"},n.scoreLabel,t("span",{class:"tag dim"},`${n.confidence} confidence`)),t("p",{},n.summary))),t("div",{class:"fc-account"},t("span",{class:`fc-plan is-${n.usage.plan}`},me(n.usage.plan)),t("span",{class:"fc-dot"},z(n.usage)),t("span",{class:"fc-dot"},`${n.usage.remaining} left${n.usage.period==="monthly"?" this month":""}`)),a?t("article",{class:`fc-next is-${a.severity}`},t("div",{class:"fix-top"},t("span",{class:"fc-eyebrow"},"Next fix"),he(a.severity),t("span",{class:"fix-meta"},a.areaTitle)),t("h3",{},a.title),a.detail?t("p",{},a.detail):null,a.prompt?t("button",{class:"btn primary sm",on:{click:()=>i.copyFullCheckPrompt(a.prompt)}},"Copy fix prompt"):null):t("p",{class:"fc-lead"},"No findings in the areas your plan covers."),t("h4",{class:"fc-h4"},"Findings by area"),c.length?t("div",{class:"fc-areas"},...c.map(o=>t("section",{class:"fc-area","aria-label":o.title},t("div",{class:"fc-area-head"},t("h5",{},o.title),t("span",{class:"fc-count on"},String(o.findings.length))),t("ul",{},...o.findings.map(p=>t("li",{},he(p.severity),t("span",{title:p.detail},p.title))))))):null,u.length?t("div",{class:"fc-quiet"},...u.map(o=>t("section",{class:`fc-chip${o.locked?" locked":""}`,"aria-label":o.title},t("span",{class:"fc-chip-mark","aria-hidden":"true"},o.locked?"":"\u2713"),t("span",{},o.title),o.locked?t("span",{class:"tag dim"},"Pro area"):t("span",{class:"fc-sr"},"No findings."),o.locked&&o.hiddenCount?t("span",{class:"fc-sr"},`${o.hiddenCount} finding${o.hiddenCount===1?"":"s"} here. Pro shows every area.`):null))):null,s&&n.usage.plan==="free"?t("p",{class:"fc-upsell"},`${s} finding${s===1?" is":"s are"} in areas Pro covers. `,t("a",{href:"https://viberaven.dev/pricing",target:"_blank",rel:"noopener noreferrer"},"See Pro")):null,t("div",{class:"fc-actions fc-footer"},t("button",{class:"btn",on:{click:()=>i.closeFullCheck()}},"Done"))]}function et(e,i){let n=e.limit;return[t("h3",{class:"fc-limit",role:"alert"},n.message),z(n.usage)?t("p",{class:"fc-hint"},z(n.usage)):null,n.plan==="free"?t("p",{class:"fc-hint"},"The local Studio checks stay free and unlimited. Pro adds 50 full checks a month across all production areas."):t("p",{class:"fc-hint"},"The local Studio checks keep working until your monthly allowance resets."),t("div",{class:"fc-actions"},n.pricingUrl?t("a",{id:"fc-see-pro",class:"btn primary",href:n.pricingUrl,target:"_blank",rel:"noopener noreferrer"},"See Pro"):null,t("button",{class:"btn ghost",on:{click:()=>i.closeFullCheck()}},"Close"))]}function tt(e,i){let n=e.error;return[t("p",{class:"fc-error",role:"alert"},n.message),t("div",{class:"fc-actions"},t("button",{class:"btn primary",on:{click:()=>i.fullCheckRetry()}},n.retry==="signin"?"Sign in again":"Try again"),t("button",{class:"btn ghost",on:{click:()=>i.closeFullCheck()}},"Close"))]}function ne(e){return t("p",{class:"fc-wait",role:"status"},t("span",{class:"spin"}),e)}var nt={closed:"",loading:"Full check",signin:"Sign in to run a full check",preparing:"Full check",preview:"Review what gets sent",running:"Running the full check",result:"Full check result",limit:"Full check limit reached",error:"Full check did not run"};function ye(e,i){let n=e.fullCheck;if(n.step==="closed")return[];let s=n.step==="signin"&&n.signIn?Ke(n,i):n.step==="preview"&&n.preview?Xe(n,i):n.step==="result"&&n.result?_e(n,i):n.step==="limit"&&n.limit?et(n,i):n.step==="error"&&n.error?tt(n,i):n.step==="preparing"?[ne("Reading your project to build the request\u2026")]:n.step==="running"?[ne("Sent. VibeRaven is checking your app\u2026")]:[ne("Checking your VibeRaven sign-in\u2026")],a=n.step!=="running";return[t("div",{class:"fc-veil",on:{click:()=>{a&&i.closeFullCheck()}}}),t("section",{id:"full-check",class:"fc-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"fc-title"},t("header",{class:"fc-head"},t("h2",{id:"fc-title"},nt[n.step]),a?t("button",{class:"btn ghost sm","aria-label":"Close full check",on:{click:()=>i.closeFullCheck()}},"Close"):null),t("div",{class:"fc-body"},...s))]}var Me="viberaven.stack.";function R(e,i,n=localStorage){try{let s=n.getItem(Me+e);return s?JSON.parse(s):i}catch{return i}}function H(e,i,n=localStorage){try{n.setItem(Me+e,JSON.stringify(i))}catch{}}function it(e){return!e.empty&&!!e.project?.scannedAt?(e.missionCards?.blockers??[]).length?"findings":"ready":"app"}function be(e){let i=`chat.${e.project?.path??"project"}`,n=`checklist.${e.project?.path??"project"}`,s={project:e,catalog:[],verified:{},agents:[],probes:{},cliId:R("cliId","codex"),accessMode:R("accessMode","approve"),modelId:R("modelId",""),messages:R(i,[],sessionStorage),draft:"",contextProviderId:null,busy:{chat:!1,scan:!1,probe:null,tile:null,compare:!1},terminalOutput:"",compare:{from:"",to:"HEAD",result:null,error:null},drawer:null,section:"stack",agentOpen:!1,moreOpen:!1,showAll:!1,setup:{open:!1,initialized:!1,selected:[],running:!1,progress:[],error:null},scan:null,toasts:[],workingSince:null,runId:null,fullCheck:W(),prChecks:{status:null,open:!1,busy:!1,written:!1,error:null},flow:{step:it(e),fixId:null,handoff:null,recheck:null,checklist:R(n,{})}},a=new Set,c=0,u={get:()=>s,set(o){let p=typeof o=="function"?o(s):o;s={...s,...p},"cliId"in p&&H("cliId",s.cliId),"accessMode"in p&&H("accessMode",s.accessMode),"modelId"in p&&H("modelId",s.modelId),"messages"in p&&H(i,s.messages.slice(-60),sessionStorage),"flow"in p&&H(n,s.flow.checklist);for(let r of a)r(s)},flow(o){u.set(p=>({flow:{...p.flow,...o}}))},subscribe(o){return a.add(o),()=>a.delete(o)},toast(o,p="ok"){let r=++c;u.set(l=>({toasts:[...l.toasts,{id:r,text:o,kind:p}]})),window.setTimeout(()=>u.set(l=>({toasts:l.toasts.filter(d=>d.id!==r)})),p==="err"?7e3:3600)},push(o){let p={...o,id:`${Date.now()}-${Math.random().toString(36).slice(2,7)}`,at:new Date().toISOString()};return u.set(r=>({messages:[...r.messages,p]})),p}};return u}var ke=["sentry","stripe","clerk","cloudflare","render","railway","neon","posthog","upstash","resend","authjs"];function st(e){return e?e.launchPath.filter(n=>n.state==="needs_fix"||n.state==="needs_connect"||n.state==="requires_user_action"||n.state==="blocked").length||(e.nextFix?1:0):0}function P(e,i,n){let s=new Map(e.providers.map(r=>[r.id,r])),a=new Set,c=[],u=(r,l)=>{let d=r?.id??l.id;if(a.has(d))return;a.add(d);let h=!!r?.detected||!!(l&&l.state!=="not_detected"),y=!!r?.mcpConfigured||l?.mcp?.status==="connected",g=n[d],m=h?st(l):0,M="absent",w="Not in this app";h&&(M="in_repo",w=y?"MCP configured \xB7 not verified live":"In repo \xB7 MCP not set up",y&&(M="mcp"),g&&(M=g.ok&&m===0?"ready":"verified",w=g.ok?"Verified live":"Verified live \xB7 issues found")),c.push({id:d,name:r?.name??l.name,area:r?.area??l.area,logoUrl:r?.logoUrl??rt(l?.iconHtml??""),step:M,statusText:w,fixes:m,hasRecipe:!!r?.hasRecipe||l?.mcp?.available===!0,mcpConfigured:y,note:r?.note,mcpSource:r?.mcpSource??l?.mcp?.source,verified:g,provider:l})};for(let r of i)u(r,s.get(r.id));for(let r of e.providers)u(null,r);let o=r=>r.step==="absent"?r.hasRecipe?1:2:0,p=r=>{let l=ke.indexOf(r.id);return l===-1?ke.length:l};return c.sort((r,l)=>o(r)-o(l)||l.fixes-r.fixes||p(r)-p(l)||r.name.localeCompare(l.name))}function rt(e){let i=/src="([^"]+)"/.exec(e);return i?i[1]:""}function we(e,i,n){let s=e.setup,a=s.selected.length,c=e.probes[e.cliId]?.ready,u=s.running||e.busy.chat||!!e.busy.tile||e.busy.scan;return t("section",{class:"stack-setup","aria-label":"Connect my app"},t("div",{class:"setup-heading"},t("div",{},t("h2",{id:"stack-setup-heading",tabIndex:-1},"Set up your app"),t("ol",{class:"setup-steps"},t("li",{class:a?"done":""},t("i",{"aria-hidden":"true"},a?"\u2713":"1"),"Pick your services"),t("li",{class:c?"done":""},t("i",{"aria-hidden":"true"},c?"\u2713":"2"),"Connect your coding agent"),t("li",{},t("i",{"aria-hidden":"true"},"3"),e.accessMode==="ask"?"Get a plan":"Start setup"))),t("button",{class:"btn ghost sm",disabled:s.running,on:{click:()=>{i.set({setup:{...i.get().setup,open:!1}}),document.getElementById("connect-my-app")?.focus({preventScroll:!0})}}},"Close")),e.catalog.length?t("div",{class:"setup-services"},...e.catalog.map(o=>{let p=s.selected.includes(o.id);return t("button",{id:`setup-provider-${o.id}`,class:`setup-service${p?" selected":""}`,"aria-pressed":String(p),disabled:u,on:{click:()=>n.toggleSetupProvider(o.id)}},t("img",{src:o.logoUrl,alt:""}),t("span",{class:"setup-service-copy"},t("strong",{},o.name),t("small",{},o.detected?"In your app":o.area)),t("span",{class:"setup-check","aria-hidden":"true"},p?"\u2713":"+"))})):t("p",{class:"setup-note"},"Loading the service catalog\u2026"),t("div",{class:"setup-footer"},t("div",{},t("strong",{},a?c?`${a} service${a===1?"":"s"} ready to set up`:"Connect your agent to continue":"Pick at least one service"),t("p",{},e.accessMode==="ask"?"Ask mode only plans. It does not change your app.":"Your agent edits the repo. Provider sign-ins stay with you.")),s.running?t("button",{class:"btn",on:{click:()=>n.stop()}},"Stop setup"):c?t("button",{class:"btn primary",disabled:!a||u,on:{click:()=>n.startStackSetup()}},e.accessMode==="ask"?"Plan my setup":"Start setup",t("span",{"aria-hidden":"true"},"\u2197")):t("button",{class:"btn primary",disabled:e.busy.probe!==null,on:{click:()=>n.testConnection(e.cliId)}},e.busy.probe?"Testing agent\u2026":"Test agent connection")),s.progress.length?t("ol",{class:"setup-progress","aria-live":"polite"},...s.progress.map(o=>t("li",{class:o.state},t("span",{class:o.state==="working"&&s.running&&!s.error?"spin":"progress-dot","aria-hidden":"true"}),o.label))):null,s.error?t("p",{class:"setup-error",role:"alert"},s.error):null)}var at={authjs:"data:image/webp;base64,UklGRtANAABXRUJQVlA4WAoAAAAQAAAAVgAAXwAAQUxQSEIEAAABoETbtmnbmRvftl2LbSffthGVbNu2bdu2bdvGY5K91prBw73n7KAYEROAajsfPYBuk856r7Gh9tlD1wkAQvQotQsBAAbNv+QjNisvnTC2OwAXvSuJjwGA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UyIDE2LjQxMjUgMCAxMy44MDI3IDB6TTEyIDEyYy0uOTk1Ni0uOTk1Ni0uOTk1Ni0yLjYwOTggMC0zLjYwNTUuOTk1Ni0uOTk1NSAyLjYwOTgtLjk5NTUgMy42MDU1IDAgMi45ODY3IDIuOTg2OCAyLjk4NjcgNy44Mjk3IDAgMTAuODE2NC0yLjk4NjcgMi45ODY4LTcuODI5NyAyLjk4NjgtMTAuODE2NCAwbC0xLjgwMjggMS44MDI4YzMuOTgyMyAzLjk4MjIgMTAuNDM5NiAzLjk4MjIgMTQuNDIxOSAwIDMuOTgyMy0zLjk4MjQgMy45ODIzLTEwLjQzOTYgMC0xNC40MjE5LS45OTU2LS45OTU2LTIuMzAwNi0xLjQ5MjItMy42MDU1LTEuNDkyMi0xLjMwNDggMC0yLjYwOTkuNDk2Ni0zLjYwNTQgMS40OTIyLTEuOTkxMiAxLjk5MTItMS45OTEyIDUuMjE5OCAwIDcuMjExeiIvPjwvc3ZnPg==",vercel:"data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjRkZGRkZGIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+VmVyY2VsPC90aXRsZT48cGF0aCBkPSJtMTIgMS42MDggMTIgMjAuNzg0SDBaIi8+PC9zdmc+"};function ve(e){return at[e]??null}var Y={critical:0,warning:1,info:2},Se={supabase:"https://supabase.com/dashboard/projects",vercel:"https://vercel.com/dashboard",stripe:"https://dashboard.stripe.com",github:"https://github.com/settings/profile",sentry:"https://sentry.io",posthog:"https://app.posthog.com",clerk:"https://dashboard.clerk.com",resend:"https://resend.com/emails",upstash:"https://console.upstash.com",neon:"https://console.neon.tech",railway:"https://railway.com/dashboard",render:"https://dashboard.render.com",cloudflare:"https://dash.cloudflare.com"},ot="sql|ts|tsx|js|jsx|mjs|cjs|json|toml|ya?ml|env|py|rb|go|rs|vue|svelte|astro|html|css|md|prisma|php|java|kt|sh|lock",lt=new RegExp(String.raw`((?:[\w.@-]+[\\/])*[\w.@-]+\.(?:${ot})):(\d{1,6})\b`,"g");function ct(e){if(!e)return[];let i=new Set;for(let n of e.matchAll(lt))i.add(`${n[1].split("\\").join("/")}:${n[2]}`);return[...i]}function dt(e){let i=(e??"").split(`
4
- `).map(a=>a.trim()).filter(Boolean),[n="",...s]=i;return{summary:n,evidence:s.filter(a=>a!=="Evidence:").map(a=>a.replace(/^-\s*/,""))}}function q(e){return ve(e.id)??e.logoUrl}function ut(e,i){let n=i?.provider?.nextFix;return n?.id===e.id&&n.prompt?n.prompt:[e.asksFirst?`${e.asksFirst} Tell the user this before you change anything, and make the change only if they confirm.`:"",`Fix this production blocker in the repo now: ${e.title}.`,e.detail??"",e.prompt?`How to fix it: ${e.prompt}`:"","Make the minimal change, then summarize what you changed and which files. Do not claim the app is production-ready; VibeRaven will check again."].filter(Boolean).join(`
5
- `)}function pt(e,i){let n=e.find(a=>a.provider?.nextFix?.id===i.id);if(n)return n;let s=`${i.title} ${i.detail??""}`.toLowerCase();return e.find(a=>s.includes(a.name.toLowerCase())||s.includes(`${a.id}/`))}function Ie(e){let[i,n]=[e.slice(0,e.lastIndexOf(":")),e.slice(e.lastIndexOf(":")+1)];return`${i.split("/").pop()??i}:${n}`}function gt(e){return!e.project.empty&&!!e.project.project?.scannedAt}function ht(e){return e.busy.scan||e.scan?.state==="running"}function S(e){let i=gt(e),n=ht(e),a=P(e.project,e.catalog,e.verified).filter(f=>f.step!=="absent"),c=i?e.project.missionCards?.blockers??[]:[],u=new Set((e.project.missionCards?.planSteps??[]).filter(f=>f.requiresUserAction).map(f=>f.id)),o=c.map(f=>{let b=pt(a,f),{summary:L,evidence:A}=dt(f.detail);return{id:f.id,title:f.title,severity:f.severity,summary:L,evidence:A,locations:ct(f.detail),service:b?{id:b.id,name:b.name,mark:q(b)}:null,dashboard:f.requiresUserAction===!0||u.has(f.id),prompt:ut(f,b)}}),p=new Map;for(let f of o){let b=f.service?.id??"app",L=p.get(b)??{key:b,name:f.service?.name??"Your code",mark:f.service?.mark??null,findings:[]};L.findings.push(f),p.set(b,L)}let r=f=>Math.min(...f.findings.map(b=>Y[b.severity])),l=[...p.values()].map(f=>({...f,findings:[...f.findings].sort((b,L)=>Y[b.severity]-Y[L.severity])})).sort((f,b)=>r(f)-r(b)||b.findings.length-f.findings.length),d=l.flatMap(f=>f.findings),h=d.filter(f=>!f.dashboard).sort((f,b)=>Y[f.severity]-Y[b.severity]),y={critical:0,warning:0,info:0};for(let f of o)y[f.severity]+=1;let g=a.map(f=>{let b=o.filter(_=>_.service?.id===f.id),L=b.filter(_=>_.severity==="critical").length,A=e.verified[f.id],N="pending",$="Unknown \xB7 not checked yet";return n?$="Checking":i&&(L?(N="fail",$=`Not ready \xB7 ${L} blocker${L===1?"":"s"}`):b.length?(N="warn",$=`${b.length} to review`):(N="pass",$=A?.ok?"Ready \xB7 checked live":"Ready \xB7 no blockers found")),{id:f.id,name:f.name,area:f.area,mark:q(f),tone:N,stateText:$,findings:b.length,verified:A}}),m=h.find(f=>f.id===e.flow.fixId)??null,M=[];for(let f of a){let b=e.verified[f.id];M.push({id:`live:${f.id}`,label:`Check ${f.name} live`,detail:b?b.ok?`Your agent checked the real ${f.name} project and it matched.`:`Your agent checked ${f.name} and found issues.`:`Your agent reads your real ${f.name} project and confirms it matches the code.`,kind:"live",done:b?.ok===!0,doneBy:"viberaven",providerId:f.id});let L=f.provider?.cockpit?.proof.checks.filter(A=>A.source==="dashboard"&&A.status!=="yes")??[];for(let A of L){let N=`dash:${f.id}:${A.label}`;M.push({id:N,label:A.label==="Production secret proof"?`Production keys for ${f.name} are set where you deploy`:`${f.name}: ${A.label}`,detail:A.label==="Production secret proof"?`The keys your app reads for ${f.name} go in your hosting provider's environment settings for production. VibeRaven cannot see your dashboards, so you tick this.`:`VibeRaven cannot see your ${f.name} dashboard, so you tick this.`,kind:"dashboard",done:e.flow.checklist[N]===!0,doneBy:"you",providerId:f.id,href:Se[f.id]})}}for(let f of d.filter(b=>b.dashboard))M.push({id:`finding:${f.id}`,label:f.title,detail:`${f.summary} This clears when the next check no longer finds it.`,kind:"finding",done:!1,doneBy:"viberaven",providerId:f.service?.id,href:f.service?Se[f.service.id]:void 0});let w=h.filter(f=>f.severity==="critical").length,D={app:!0,findings:i,fix:i&&h.length>0,recheck:i&&e.flow.recheck!==null,ready:i&&w===0};return{scanned:i,scanning:n,services:g,findings:o,groups:l,fixable:h,counts:y,current:m,checklist:M,gateClear:i&&e.project.gate?.status==="clear",available:D}}function ie(e){return e.scanned?e.findings.length===0||!e.available.fix?"ready":"findings":"app"}function Le(e,i){let n=i.flow.recheck,s=e.checklist.filter(a=>!a.done).length;return{app:e.scanning?"Checking now":e.services.length?`${e.services.length} service${e.services.length===1?"":"s"} found`:"No services found",findings:e.scanned?e.findings.length===0?"Nothing found":[e.counts.critical?`${e.counts.critical} critical`:null,`${e.findings.length} total`].filter(Boolean).join(" \xB7 "):"After the check",fix:e.scanned?e.fixable.length===0?"Nothing to fix in code":`${e.fixable.length} to fix`:"After the check",recheck:n?n.status==="running"?"Checking now":n.status==="fixed"?"Last fix held":n.status==="open"?"Still open":"Did not finish":"After a fix",ready:e.scanned?e.available.ready?e.gateClear?"No blockers found":s?`${s} step${s===1?"":"s"} left`:"Checklist done":"After the critical fixes":"After the check"}}var se=new Map,xe=()=>{};function re(e){return`vr-canvas:${e}`}function B(e){let i=se.get(e);if(i)return i;let n={pan:{x:0,y:0},zoom:1,cards:{}};try{let s=localStorage.getItem(re(e));if(s){let a=JSON.parse(s);n={pan:a.pan??n.pan,zoom:je(a.zoom??1),cards:a.cards??{}}}}catch{}return se.set(e,n),n}function Ce(e){try{localStorage.setItem(re(e),JSON.stringify(B(e)))}catch{}}function je(e){return Math.min(1.6,Math.max(.5,Math.round(e*100)/100))}function ft(e){return`translate(${e.pan.x}px, ${e.pan.y}px) scale(${e.zoom})`}function mt(e,i){let n=e.cards[i];return n?`translate(${n.x}px, ${n.y}px)`:void 0}function yt(e){return e.zoom!==1||e.pan.x!==0||e.pan.y!==0||Object.keys(e.cards).length>0}function K(e){return e.querySelector(".board")}function U(e){let i=K(e);if(!i)return;let n=B(i.dataset.layoutKey??"default");i.style.transform=ft(n);for(let s of Array.from(i.querySelectorAll("[data-card]")))s.style.transform=mt(n,s.dataset.card??"")??"";e.classList.toggle("is-moved",yt(n)),xe(i)}function X(e,i){let n=K(e);if(!n)return;let s=n.dataset.layoutKey??"default",a=B(s);a.zoom=je(a.zoom*i),U(e),Ce(s)}function Ne(e){let i=K(e);if(!i)return;let n=i.dataset.layoutKey??"default";se.set(n,{pan:{x:0,y:0},zoom:1,cards:{}}),U(e);try{localStorage.removeItem(re(n))}catch{}}var Ae=new WeakSet;function Te(e,i){if(xe=i,Ae.has(e)){U(e);return}Ae.add(e);let n=null,s=0;e.addEventListener("pointerdown",c=>{if(c.button!==0)return;let u=c.target;if(u.closest("button, a, input, select, textarea, pre, .canvas-tools, .pr-checks"))return;let o=K(e);if(!o)return;let p=o.dataset.layoutKey??"default",r=B(p),l=u.closest("[data-card]"),d=l?.dataset.card??"";n={kind:l?"card":"pan",id:d,key:p,startX:c.clientX,startY:c.clientY,origin:l?{...r.cards[d]??{x:0,y:0}}:{...r.pan},moved:!1,pointer:c.pointerId,target:l??e}}),e.addEventListener("pointermove",c=>{if(!n||c.pointerId!==n.pointer)return;let u=c.clientX-n.startX,o=c.clientY-n.startY;if(!n.moved){if(Math.hypot(u,o)<4)return;n.moved=!0,e.setPointerCapture?.(n.pointer),e.classList.add("is-dragging"),n.target.classList.add("is-lifted")}let p=B(n.key);n.kind==="pan"?p.pan={x:Math.round(n.origin.x+u),y:Math.round(n.origin.y+o)}:p.cards[n.id]={x:Math.round(n.origin.x+u/p.zoom),y:Math.round(n.origin.y+o/p.zoom)},s||(s=requestAnimationFrame(()=>{s=0,U(e)}))});let a=c=>{!n||c.pointerId!==n.pointer||(n.moved&&(e.releasePointerCapture?.(n.pointer),e.classList.remove("is-dragging"),n.target.classList.remove("is-lifted"),U(e),Ce(n.key)),n=null)};e.addEventListener("pointerup",a),e.addEventListener("pointercancel",a),e.addEventListener("wheel",c=>{!c.ctrlKey&&!c.metaKey||(c.preventDefault(),X(e,c.deltaY<0?1.1:1/1.1))},{passive:!1}),U(e)}var v={check:'<svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.5 8.5l3 3 6-7"/></svg>',arrow:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 8h10M9 4l4 4-4 4"/></svg>',back:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13 8H3M7 4L3 8l4 4"/></svg>',copy:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><rect x="5.5" y="5.5" width="8" height="8" rx="1.6"/><path d="M10.5 5.5V3.6c0-.6-.5-1.1-1.1-1.1H3.6c-.6 0-1.1.5-1.1 1.1v5.8c0 .6.5 1.1 1.1 1.1h1.9"/></svg>',more:'<svg viewBox="0 0 16 16" width="14" height="14" fill="currentColor" aria-hidden="true"><circle cx="3" cy="8" r="1.4"/><circle cx="8" cy="8" r="1.4"/><circle cx="13" cy="8" r="1.4"/></svg>',out:'<svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 3H3v10h10v-3M9 3h4v4M13 3L7.5 8.5"/></svg>',scan:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 5V3.5C2 2.7 2.7 2 3.5 2H5M11 2h1.5c.8 0 1.5.7 1.5 1.5V5M14 11v1.5c0 .8-.7 1.5-1.5 1.5H11M5 14H3.5C2.7 14 2 13.3 2 12.5V11"/><circle cx="7.6" cy="7.6" r="2.4"/><path d="M9.4 9.4 11 11"/></svg>',fix:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9.8 2.3a3.4 3.4 0 0 0-3.9 4.5L2.4 10.3a1.4 1.4 0 0 0 2 2l3.5-3.5a3.4 3.4 0 0 0 4.5-3.9l-2 2-1.8-.5-.5-1.8z"/></svg>',recheck:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13.5 8a5.5 5.5 0 0 1-9.6 3.7M2.5 8a5.5 5.5 0 0 1 9.6-3.7"/><path d="M12.5 1.8v2.7H9.8M3.5 14.2v-2.7h2.7"/></svg>',launch:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 2.5v11M3 3h8.5l-1.8 2.8L11.5 8.6H3"/></svg>',pr:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="4" cy="3.5" r="1.6"/><circle cx="4" cy="12.5" r="1.6"/><circle cx="12" cy="12.5" r="1.6"/><path d="M4 5.1v5.8M12 10.9V6.5a2 2 0 0 0-2-2H7.5M9 3 7.5 4.5 9 6"/></svg>',zoomIn:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" aria-hidden="true"><path d="M8 3.5v9M3.5 8h9"/></svg>',zoomOut:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" aria-hidden="true"><path d="M3.5 8h9"/></svg>',reset:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.5 6V2.5H6M13.5 10v3.5H10M2.5 2.5l4 4M13.5 13.5l-4-4"/></svg>',app:'<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="1.8" y="2.5" width="12.4" height="11" rx="2"/><path d="M1.8 5.5h12.4M6 8.4 4.6 9.8 6 11.2M10 8.4l1.4 1.4-1.4 1.4"/></svg>'},Mt={critical:"Critical",warning:"Important",info:"Nice to have"};function O(e){return t("span",{class:"ico",html:e})}function Q(e){return(e||"Project").replace(/^@[^/]+\//,"").split(/[-_\s]+/).filter(Boolean).map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" ")}function F(e){let i=e.project.project;return(i?.name&&i.name!=="Project"?i.name:(i?.path??"").split(/[\\/]/).filter(Boolean).pop())||"your-app"}function J(e,i=e.cliId){return e.agents.find(n=>n.id===i)?.label.replace(/ CLI$/,"")??(i==="claude"?"Claude Code":i==="gemini"?"Gemini":"Codex")}function Ee(e,i){let n=e.project.project,s=e.project.releases?.[0],a=ze(e,S(e));return t("header",{class:"top",dataset:{slot:"top"}},t("span",{class:"wordmark"},"Vibe",t("b",{},"Raven")),t("span",{class:"top-project"},t("span",{class:"top-sep","aria-hidden":"true"},"/"),t("strong",{},Q(F(e))),t("span",{class:"top-sep","aria-hidden":"true"},"/"),t("code",{},[s?.branch,n?.version?`v${n.version.replace(/^v/,"")}`:null].filter(Boolean).join(" \xB7 ")||"local")),t("span",{class:"spacer"}),bt(e,i),t("span",{class:`top-verdict is-${a.tone}`},t("i",{"aria-hidden":"true"}),a.text),t("div",{class:"more-wrap"},t("button",{id:"open-more",class:`quiet more-button${e.moreOpen?" on":""}`,"aria-haspopup":"menu","aria-expanded":String(e.moreOpen),"aria-controls":"more-menu",on:{click:()=>i.toggleMore()}},"More",O(v.more)),e.moreOpen?kt(e,i):null))}function bt(e,i){let n=S(e),s=e.flow.step,a=(c,u,o,p,r={})=>t("button",{id:c,class:"top-tab","aria-current":o?"page":void 0,disabled:r.disabled,on:{click:p}},u,r.count?t("span",{class:"top-tab-count"},String(r.count)):null);return t("nav",{class:"top-tabs","aria-label":"Views"},a("tab-stack","Stack",s==="app"&&!e.drawer,()=>{e.drawer&&i.toggleDrawer(null),i.goToStep("app")}),a("tab-findings","Findings",s==="findings"&&!e.drawer,()=>{e.drawer&&i.toggleDrawer(null),i.goToStep("findings")},{disabled:!n.available.findings,count:n.findings.length}),a("tab-terminal","Terminal",e.drawer==="terminal",()=>i.openMore("terminal")),a("tab-releases","Releases",e.drawer==="releases",()=>i.openMore("releases")))}function kt(e,i){let n=e.agents.filter(a=>e.probes[a.id]?.ready).length,s=[{id:"services",label:"Services",note:"Browse, add and check services live"},{id:"terminal",label:"Coding agents",note:n?`${n} connected`:"Install, sign in, test"},{id:"chat",label:"Agent chat",note:"Ask your agent anything about this app"},{id:"releases",label:"Releases",note:(e.project.releases??[]).length?"History and diffs":"Compare any two commits"}];return t("div",{id:"more-menu",class:"more-menu",role:"menu","aria-label":"More",on:{keydown:a=>{let c=a.key;if(c!=="ArrowDown"&&c!=="ArrowUp")return;a.preventDefault();let u=Array.from(a.currentTarget.querySelectorAll('[role="menuitem"]')),o=u.indexOf(document.activeElement);u[(o+(c==="ArrowDown"?1:-1)+u.length)%u.length]?.focus()}}},...s.map(a=>t("button",{role:"menuitem",class:"more-item",on:{click:()=>i.openMore(a.id)}},t("strong",{},a.label),t("span",{},a.note))))}function Oe(e,i,n){let s=Le(i,e),a=e.flow.step,c=i.scanning||e.setup.running,u=()=>{a==="fix"&&i.current?n.checkAgain():i.available.recheck?n.goToStep("recheck"):n.checkMyApp()},o=[{key:"scan",id:"check-my-app",label:i.scanning?"Scanning":"Scan",svg:v.scan,meta:s.app,current:a==="app",disabled:c,passed:i.scanned,onClick:()=>void n.checkMyApp()},{key:"fix",label:"Fix",svg:v.fix,meta:s.fix,current:a==="fix",disabled:!i.available.fix||c,passed:!1,onClick:()=>n.goToStep("fix")},{key:"recheck",label:"Re-check",svg:v.recheck,meta:s.recheck,current:a==="recheck",disabled:!i.scanned||c,passed:e.flow.recheck?.status==="fixed",onClick:u},{key:"ready",label:"Launch",svg:v.launch,meta:s.ready,current:a==="ready",disabled:!i.available.ready,passed:!1,onClick:()=>n.goToStep("ready")}];return t("nav",{class:`rail${i.scanning?" is-scanning":""}`,"aria-label":"Launch path",dataset:{slot:"rail"}},t("ol",{},...o.map(p=>t("li",{class:`rail-step is-${p.current?"current":p.disabled?"locked":p.passed?"passed":"open"}`},t("button",{id:p.id,class:"rail-button",title:p.meta,"aria-current":p.current?"step":void 0,disabled:p.disabled,on:{click:p.onClick}},t("span",{class:"rail-mark","aria-hidden":"true",html:p.svg}),t("span",{class:"rail-copy"},t("span",{class:"rail-label"},p.label),t("span",{class:"rail-meta"},p.meta)),p.key==="scan"&&i.scanning?t("i",{class:"rail-time","aria-hidden":"true"}):null)))))}function ze(e,i){if(i.scanning)return{text:"Checking your app",tone:"pending"};if(!i.scanned)return{text:"Not checked yet",tone:"pending"};if(i.counts.critical)return{text:`${i.counts.critical} blocker${i.counts.critical===1?"":"s"}`,tone:"fail"};if(i.findings.length)return{text:`${i.findings.length} to review`,tone:"warn"};let n=i.checklist.filter(a=>!a.done).length,s=n?` \xB7 ${n} unknown${n===1?"":"s"}`:"";return{text:i.gateClear?`No blockers found${s}`:"No blockers in the code",tone:"pass"}}var wt={pending:"Unknown",pass:"Ready",warn:"Review",fail:"Not ready"};function vt(e){let i=e.stateText.replace(/^(Not ready|Ready|Unknown)\s*·\s*/,"")||e.stateText;return i.charAt(0).toUpperCase()+i.slice(1)}function De(e,i=null){return t("li",{class:`node is-${e.tone}${e.id===i?" is-focus":""}`,dataset:{provider:e.id,card:e.id}},t("span",{class:"node-head"},e.mark?t("img",{src:e.mark,alt:"",width:18,height:18}):t("span",{class:"node-fallback"},e.name.slice(0,1)),t("span",{class:"node-name"},e.name)),e.area?t("code",{class:"node-detail"},e.area.toLowerCase()):null,t("span",{class:"node-state"},t("i",{"aria-hidden":"true"}),t("span",{class:"node-text"},vt(e)),t("span",{class:"node-verdict"},wt[e.tone])))}function St(){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("class","board-lines"),e.setAttribute("aria-hidden","true"),e}function It(e,i){let n=e.project.project,s=ze(e,i),a=i.services.length<=3,c=a?[]:i.services.filter((l,d)=>d%2===0),u=a?i.services:i.services.filter((l,d)=>d%2===1),o=i.scanned?[n?.archetype&&n.archetype!=="unknown"?n.archetype:null,n?.scannedAt?`Checked ${E(n.scannedAt)}`:null,typeof e.project.gate?.score=="number"?`Readiness ${e.project.gate.score} of 100`:null].filter(l=>!!l):[],p=e.flow.step==="app"?null:e.flow.step==="fix"?i.current?.service?.id??null:e.contextProviderId,r=JSON.stringify([i.services.map(l=>[l.id,l.tone,l.stateText]),s,o,i.scanning,p]);return t("figure",{class:`board${i.scanning?" is-scanning":""}${i.services.length?a?" is-side":"":" is-solo"}`,dataset:{sig:r,lines:i.services.length?"1":"",layoutKey:e.project.project?.path||F(e)},"aria-label":`${Q(F(e))} and the services found in its code`},St(),c.length?t("ul",{class:"board-col left"},...c.map(l=>De(l,p))):null,t("div",{class:`board-app is-${s.tone}`,dataset:{card:"app"}},t("span",{class:"node-head"},O(v.app),t("span",{class:"node-name"},Q(F(e)))),t("code",{class:"board-app-name"},[F(e),e.project.releases?.[0]?.branch].filter(Boolean).join(" \xB7 ")),t("p",{class:"board-status"},t("strong",{},s.text)),o.length?t("ul",{class:"board-checks"},...o.map(l=>t("li",{},t("i",{"aria-hidden":"true"}),l))):null),u.length?t("ul",{class:"board-col right"},...u.map(l=>De(l,p))):null)}function le(e){let i=e.querySelector(".board-lines"),n=e.querySelector(".board-app");if(!i||!n)return;let s=e.getBoundingClientRect(),a=e.offsetWidth,c=e.offsetHeight;if(!s.width||!a)return;let u=s.width/a;if(i.setAttribute("viewBox",`0 0 ${Math.round(a)} ${Math.round(c)}`),i.setAttribute("width",String(Math.round(a))),i.setAttribute("height",String(Math.round(c))),getComputedStyle(i).display==="none"){i.innerHTML="";return}let o=n.getBoundingClientRect(),p=o.left+o.width/2,r=Array.from(e.querySelectorAll(".node")),l=y=>(y-s.left)/u,d=y=>(y-s.top)/u,h=r.map((y,g)=>{let m=y.getBoundingClientRect(),M=m.left+m.width/2<p,w=l(M?o.left:o.right),D=d(o.top+o.height/2)+(g%4-1.5)*Math.min(22,o.height/u/7),f=l(M?m.right:m.left),b=d(m.top+m.height/2),L=(w+f)/2,A=/is-(pass|warn|fail|pending)/.exec(y.className)?.[1]??"pending",N=`M ${w.toFixed(1)} ${D.toFixed(1)} C ${L.toFixed(1)} ${D.toFixed(1)} ${L.toFixed(1)} ${b.toFixed(1)} ${f.toFixed(1)} ${b.toFixed(1)}`;return`<path class="line is-${A}" d="${N}"/><path class="pulse" pathLength="1" style="animation-delay:${(g*.6).toFixed(2)}s" d="${N}"/>`});i.innerHTML=h.join("")}function j(e,i){let n=[t("h1",{id:"stage-heading",tabindex:-1},e)];return i&&n.push(t("p",{class:"stage-sub"},i)),n}function I(e,i,n={}){return t("div",{class:"primary-row"},t("button",{id:n.id??"primary-action",class:"primary",disabled:n.disabled,on:{click:i}},n.busy?t("span",{class:"spin","aria-hidden":"true"}):null,e,n.busy?null:O(v.arrow)),n.note?t("span",{class:"primary-note"},n.note):null)}function ae(e,i,n={}){return t("button",{class:"quiet",disabled:n.disabled,on:{click:i}},n.icon?O(n.icon):null,e)}function Pe(e){return t("span",{class:`sev is-${e.severity}`},t("i",{"aria-hidden":"true"}),Mt[e.severity])}function Ue(e,i=!1){if(!e.locations.length)return null;let[n,...s]=e.locations;return t("span",{class:"where"},t("code",{title:e.locations.join(`
6
- `)},i?n:Ie(n)),s.length?t("span",{class:"where-more"},`+${s.length} more`):null)}function Lt(e,i){let n=e.project.project,s=i.services.length,a=i.scanning?"Reading your code and the services it uses. Nothing leaves this computer.":s?`${s} service${s===1?"":"s"} found in this code.`:"No hosted services found in this code yet.",c=i.scanning?"Checking on this computer, offline.":i.scanned?`Last check ${E(n.scannedAt)} \xB7 runs on this computer, offline`:"Press Scan to check your app. It runs on this computer, offline.";return[t("h1",{id:"stage-heading",tabindex:-1,class:"sr-only"},Q(F(e))),t("p",{class:"sr-only"},a),t("p",{class:"canvas-note",role:"status"},c)]}function At(e,i,n){let s=i.fixable[0],a=e.project.project?.scannedAt;if(!i.findings.length)return[...j("Nothing to fix",`The check ${a?E(a):""} found no blockers in this code.`),I("Go to the launch checklist",()=>n.goToStep("ready"))];let c=[i.counts.critical?`${i.counts.critical} critical`:null,i.counts.warning?`${i.counts.warning} important`:null,i.counts.info?`${i.counts.info} nice to have`:null].filter(Boolean).join(", ");return[...j(`${i.findings.length} finding${i.findings.length===1?"":"s"}`,`${c}. Critical first, grouped by service. From the check ${a?E(a):""}.`),t("div",{class:"findings"},...i.groups.map(u=>t("section",{class:"group","aria-label":u.name},t("header",{class:"group-head"},u.mark?t("img",{src:u.mark,alt:"",width:22,height:22}):t("span",{class:"group-code","aria-hidden":"true"},"</>"),t("h2",{},u.name),t("span",{class:"group-count"},String(u.findings.length))),t("ul",{},...u.findings.map(o=>{let p=o.id===s?.id,r=[Pe(o),t("span",{class:"finding-title"},o.title),o.dashboard?t("span",{class:"finding-tag"},"Dashboard step"):Ue(o)];return t("li",{},o.dashboard?t("div",{class:`finding is-${o.severity} is-static`,dataset:{provider:o.service?.id??""}},...r):t("button",{class:`finding is-${o.severity}${p?" is-first":""}`,dataset:{provider:o.service?.id??""},on:{click:()=>n.fixFinding(o.id)}},...r,O(v.arrow)))}))))),s?I("Fix the first blocker",()=>n.fixFinding(),{id:"fix-first",note:s.title}):I("Go to the launch checklist",()=>n.goToStep("ready"),{note:"What is left needs your dashboards, not your code."})]}function xt(e,i,n){let s=e.agents.filter(a=>a.installed);return s.length?t("div",{class:"agent-choice",role:"radiogroup","aria-label":"Coding agent"},...s.map(a=>{let c=e.probes[a.id],u=a.id===e.cliId;return t("button",{role:"radio","aria-checked":String(u),class:`agent-option${u?" on":""}`,disabled:n,on:{click:()=>i.selectCli(a.id)}},t("i",{class:c?.ready?"ok":c?"no":"","aria-hidden":"true"}),a.label.replace(/ CLI$/,""))})):null}function Ct(e,i,n){let s=i.current;if(!s)return[...j("Nothing to fix in code","Every finding left needs a dashboard, not the repo."),I("Go to the launch checklist",()=>n.goToStep("ready"))];let a=i.fixable.findIndex(h=>h.id===s.id),c=e.flow.handoff?.findingId===s.id?e.flow.handoff:null,u=J(e),o=e.probes[e.cliId],p=e.agents.filter(h=>h.installed),r=c?.status==="running",l=e.busy.probe===e.cliId,d;return r?d=I(`${u} is working`,()=>{},{disabled:!0,busy:!0,note:"It edits files in this repo. You review the change."}):c?.status==="done"?d=I("Check again",()=>void n.checkAgain(),{id:"check-again",note:"Runs the same local check to see if the fix held."}):p.length?o?.ready?d=I(c?.status==="failed"?`Send to ${u} again`:`Send to ${u}`,()=>void n.sendFix(),{id:"send-fix",note:e.accessMode==="ask"?"Ask mode is on: the agent will only plan, not edit. Change it in More, Agent chat.":`${u} edits files in this repo. You review the change.`}):d=I(l?`Connecting ${u}`:`Connect ${u}`,()=>void n.testConnection(e.cliId),{disabled:l,busy:l,note:o?o.message:`VibeRaven runs ${u} on this computer with your own sign-in.`}):d=I("Copy the prompt",()=>void n.copyFix(),{note:"No coding agent found on this computer. Paste it into any agent."}),[...j(s.title),t("div",{class:"fix-meta"},Pe(s),t("span",{class:"fix-count"},`Blocker ${a+1} of ${i.fixable.length}${s.service?` \xB7 ${s.service.name}`:""}`),Ue(s,!0)),s.summary?t("p",{class:"fix-summary"},s.summary):null,s.evidence.length?t("ul",{class:"fix-evidence"},...s.evidence.slice(0,4).map(h=>t("li",{},h))):null,t("section",{class:"prompt","aria-label":"Prompt for your agent"},t("header",{},t("h2",{},"Prompt for your agent"),ae("Copy",()=>void n.copyFix(),{icon:v.copy})),t("pre",{tabindex:0},s.prompt)),xt(e,n,r||e.busy.chat),r?t("p",{class:"working-line",role:"status"},t("span",{dataset:{working:"1"}},`${u} is working\u2026`),t("button",{class:"quiet stop",on:{click:()=>void n.stop()}},"Stop")):null,c&&c.status!=="running"?t("section",{class:`agent-reply is-${c.status}`,"aria-label":`${J(e,c.cliId)} replied`},t("h2",{},c.status==="done"?`${J(e,c.cliId)} replied`:`${J(e,c.cliId)} did not finish`),t("div",{class:"agent-reply-body",html:Z(c.output)})):null,d,t("div",{class:"quiet-row"},ae("Back to findings",()=>n.goToStep("findings"),{icon:v.back}),c?.status!=="done"?ae("Fixed it yourself? Check again",()=>void n.checkAgain(),{disabled:r||i.scanning}):null)].filter(h=>h!==null)}function jt(e,i,n){let s=e.flow.recheck;if(!s)return[...j("Nothing to check yet","Fix a blocker first, then check again here."),I("Back to findings",()=>n.goToStep("findings"))];let a=typeof s.scoreBefore=="number"&&typeof s.scoreAfter=="number"&&s.scoreBefore!==s.scoreAfter?t("p",{class:"score-move"},`Readiness ${s.scoreBefore} \u2192 ${s.scoreAfter}`):null;if(s.status==="running")return[...j("Checking again",`Running the same local check to see if \u201C${s.title}\u201D is gone.`),t("div",{class:"recheck-meter",role:"status"},t("span",{class:"spin"}),"Reading the repo"),I("Checking",()=>{},{disabled:!0,busy:!0})];if(s.status==="fixed"){let c=i.fixable.find(u=>u.id===s.nextId);return[...j("Scenario passed locally",`\u201C${s.title}\u201D no longer shows up in the check.`),a,t("p",{class:"recheck-next",role:"status"},c?`Next: ${c.title}`:"That was the last blocker in the code."),c?I("Next blocker",()=>n.fixFinding(c.id),{note:"Moving on by itself in a moment."}):I("Go to the launch checklist",()=>n.goToStep("ready"),{note:"Moving on by itself in a moment."})].filter(u=>u!==null)}return s.status==="open"?[...j("Still open",`The check still finds \u201C${s.title}\u201D.`),s.message?t("p",{class:"fix-summary"},s.message):null,a,I("Back to the fix",()=>n.fixFinding(s.findingId))].filter(c=>c!==null):[...j("The check did not finish",s.message??""),I("Check again",()=>void n.checkAgain())]}function Nt(e,i,n){if(!i.checklist.length)return t("section",{class:"checklist","aria-label":"Launch checklist"},t("h2",{},"Launch checklist"),t("p",{class:"empty-line"},"No dashboard steps found for this app: VibeRaven found no hosted services in the code."));let s=i.checklist.filter(a=>!a.done).length;return t("section",{class:"checklist","aria-label":"Launch checklist"},t("h2",{},"Launch checklist",t("span",{class:"checklist-count"},s?`${s} left`:"All done")),t("ul",{},...i.checklist.map(a=>t("li",{class:`check-item${a.done?" is-done":""}`},a.doneBy==="you"?t("button",{class:"tick",role:"checkbox","aria-checked":String(a.done),"aria-label":a.label,on:{click:()=>n.toggleChecklistItem(a.id)},html:a.done?v.check:""}):t("span",{class:`tick is-auto${a.done?" on":""}`,"aria-hidden":"true",html:a.done?v.check:""}),t("div",{class:"check-copy"},t("strong",{},a.label),t("span",{},a.detail),t("span",{class:"check-who"},a.doneBy==="you"?"You confirm this":a.kind==="live"?"VibeRaven confirms this with your agent":"VibeRaven confirms this on the next check")),a.kind==="live"&&!a.done&&a.providerId?t("button",{class:"quiet",disabled:e.busy.chat||!e.probes[e.cliId]?.ready,title:e.probes[e.cliId]?.ready?void 0:"Connect a coding agent first",on:{click:()=>void n.verifyById(a.providerId)}},"Check live"):a.href?t("a",{class:"quiet",href:a.href,target:"_blank",rel:"noreferrer"},"Open dashboard",O(v.out)):null))))}function Tt(e,i){let n=e.fullCheck.status,s=z(n?.usage),a=n?.account?n.account.plan==="pro"?"Pro plan":"Free plan":null;return t("section",{class:"final","aria-label":"Full check"},t("h2",{},"Final confirmation"),t("p",{},"The full check runs on VibeRaven across every production area. You see exactly what gets sent before anything leaves this computer."),t("p",{class:"final-quota"},[a,s??"Free accounts get 2 full checks. Pro gets 50 a month."].filter(Boolean).join(" \xB7 ")),t("button",{id:"run-full-check",class:"primary",disabled:e.fullCheck.step==="running",on:{click:()=>void i.openFullCheck()}},"Run full check",O(v.arrow)))}function Dt(e,i,n){if(!i.available.ready)return[...j("Not yet","Fix the critical blockers first. The launch checklist opens when none are left."),I("Back to findings",()=>n.goToStep("findings"))];let s=i.findings.filter(o=>!o.dashboard).length,a=i.gateClear?"No blockers found within tested scope":"No critical blockers left",c=i.checklist.filter(o=>!o.done).length,u=i.gateClear?c?`${c} unknown${c===1?"":"s"}: the checklist items below, which VibeRaven cannot test from this computer.`:"Every item on the checklist is confirmed.":`The code has no critical blockers.${s?` ${s} other finding${s===1?" is":"s are"} still open in Findings.`:""} What is left lives in your dashboards.`;return[...j(a,u),i.services.length?t("ul",{class:"strip","aria-label":"Services"},...i.services.map(o=>t("li",{class:`strip-item is-${o.tone}`},o.mark?t("img",{src:o.mark,alt:"",width:20,height:20}):null,o.name))):null,t("div",{class:"ready-grid"},Nt(e,i,n),Tt(e,n))].filter(o=>o!==null)}function Et(e,i){let n=e.prChecks;if(!n.status)return null;let s=n.status.exists,a=`git add ${n.status.path} && git commit -m "Check pull requests with VibeRaven"`,c=null;if(n.open){let u=n.written?[t("h3",{},"Workflow added"),t("p",{},"Commit and push it. From the next pull request on, VibeRaven comments with what the change added and what it fixed."),t("pre",{class:"pr-command",tabindex:0},a),n.status.onGithub?null:t("p",{class:"pr-muted"},"This repository has no GitHub remote yet. The check runs once it is on GitHub."),t("div",{class:"pr-actions"},t("button",{id:"pr-checks-copy",class:"btn sm primary",on:{click:()=>void i.copyPrCommit()}},"Copy command"),t("button",{class:"btn sm",on:{click:()=>i.togglePrChecks(!1)}},"Done"))]:s?[t("h3",{},"Pull request checks are set up"),t("p",{},`The workflow is in ${n.status.path}. Once it is pushed, each pull request gets one comment with what it added and fixed.`),t("div",{class:"pr-actions"},t("button",{id:"pr-checks-action",class:"btn sm",on:{click:()=>i.togglePrChecks(!1)}},"Close"))]:[t("h3",{},"Check every pull request"),t("p",{},"VibeRaven adds one file to this repo, ",t("code",{},n.status.path),". Each pull request then gets one comment: what the change added and what it fixed."),t("ul",{class:"pr-points"},t("li",{},"Runs in your own GitHub Actions: private repos work and the code is never uploaded."),t("li",{},"Advice by default. It only blocks a merge if you turn that on.")),n.error?t("p",{class:"pr-error",role:"alert"},n.error):null,t("div",{class:"pr-actions"},t("button",{id:"pr-checks-action",class:"btn sm primary",disabled:n.busy,on:{click:()=>void i.addPrChecks()}},n.busy?"Adding\u2026":"Add the workflow"),t("button",{class:"btn sm",on:{click:()=>i.togglePrChecks(!1)}},"Not now"))];c=t("div",{id:"pr-checks-card",class:"pr-card",role:"dialog","aria-labelledby":"pr-checks-button"},...u)}return t("div",{class:"pr-checks"},t("button",{id:"pr-checks-button",class:`pr-checks-button${s?" is-on":""}`,"aria-expanded":String(n.open),"aria-controls":"pr-checks-card",on:{click:()=>i.togglePrChecks()}},O(v.pr),s?"Pull request checks added":"Check every pull request"),c)}function Ot(){let e=n=>n.currentTarget.closest(".canvas"),i=(n,s,a,c="")=>t("button",{class:`canvas-tool${c}`,title:n,"aria-label":n,html:s,on:{click:u=>{let o=e(u);o&&a(o)}}});return t("div",{class:"canvas-tools",dataset:{sig:"tools"}},i("Zoom in",v.zoomIn,n=>X(n,1.15)),i("Zoom out",v.zoomOut,n=>X(n,1/1.15)),i("Reset layout",v.reset,n=>Ne(n)," is-reset"))}var oe=null;function Fe(e,i){let n=S(e),s=e.flow.step,a=oe!==null&&oe!==s;oe=s;let c=s==="app"?Lt(e,n):s==="findings"?At(e,n,i):s==="fix"?Ct(e,n,i):s==="recheck"?jt(e,n,i):Dt(e,n,i),u=s!=="app";return t("main",{class:`stage${u?" has-panel":""}`,dataset:{slot:"stage",step:s}},e.scan?.state==="error"?t("p",{class:"stage-alert",role:"alert"},e.scan.error??"The first check did not finish."):null,t("div",{class:"canvas",dataset:{slot:"canvas"}},It(e,n),Ot(),Et(e,i)),t("div",{class:`stage-body step-${s}${u?" panel":""}${a?" arrive":""}`,dataset:{slot:`body-${s}`}},u?t("button",{class:"panel-close quiet",on:{click:()=>i.goToStep("app")}},O(v.back),"Stack"):null,...c))}function $e(e){return S(e)}function Re(e,i){let n=Array.from(e.children);i.forEach((s,a)=>{let c=n[a];if(!c){e.appendChild(s);return}let u=s.dataset?.sig;if(u&&c.dataset?.sig===u&&c.tagName===s.tagName)return;let o=s.dataset?.slot;if(o&&c.dataset?.slot===o&&c.tagName===s.tagName){for(let p of Array.from(c.attributes))s.hasAttribute(p.name)||c.removeAttribute(p.name);for(let p of Array.from(s.attributes))c.getAttribute(p.name)!==p.value&&c.setAttribute(p.name,p.value);Re(c,Array.from(s.children));return}e.replaceChild(s,c)});for(let s of Array.from(e.children).slice(i.length))s.remove()}var ce=new WeakMap;function zt(e){for(let i of Array.from(e.querySelectorAll(".canvas")))Te(i,le);for(let i of Array.from(e.querySelectorAll('.board[data-lines="1"]'))){if(ce.has(i))continue;let n=()=>le(i);if(requestAnimationFrame(n),typeof ResizeObserver<"u"){let s=new ResizeObserver(n);s.observe(i),ce.set(i,s)}else ce.set(i,{disconnect(){}})}}function He(e,i,n){let s=i.get(),a=e.contains(document.activeElement)?document.activeElement:null,c=a?.id,u=a instanceof HTMLTextAreaElement||a instanceof HTMLInputElement?[a.selectionStart,a.selectionEnd]:null,o=$e(s);if(Re(e,[Ee(s,n),Oe(s,o,n),Fe(s,n),...s.agentOpen?[t("div",{class:"sheet-veil",on:{click:()=>n.toggleAgent()}}),$t(s,i,n)]:[],...s.drawer?[t("div",{class:"drawer-veil",on:{click:()=>n.toggleDrawer(null)}}),Ht(s,i,n)]:[],...ye(s,n),Zt(s)]),zt(e),c&&document.activeElement?.id!==c){let p=document.getElementById(c);p?.focus({preventScroll:!0}),u&&(p instanceof HTMLTextAreaElement||p instanceof HTMLInputElement)&&p.setSelectionRange(...u)}}function Pt(e,i,n){let s=P(e.project,e.catalog,e.verified),a=s.filter(o=>o.step!=="absent"),c=s.filter(o=>o.step==="absent"),u=e.setup.running||e.busy.chat||e.busy.scan;return t("div",{},e.setup.open?we(e,i,n):null,t("section",{class:"block","aria-label":"In your app"},t("div",{class:"block-head"},t("h4",{},"In your app"),t("button",{id:"connect-my-app",class:"btn sm",disabled:u,on:{click:()=>n.openStackSetup()}},"Set up with your agent")),a.length?t("div",{class:"rail-grid"},...a.map(o=>Ft(o,e,n))):t("p",{class:"drawer-empty"},"No services found in this code yet.")),c.length?t("section",{class:"block","aria-label":"Available services"},t("div",{class:"block-head"},t("h4",{},"Available"),t("span",{class:"block-meta"},"Your accounts, your choice of providers")),t("div",{class:"rail-grid"},...c.map(o=>t("article",{class:"slab available"},t("div",{class:"face"},t("div",{class:"face-logo"},t("img",{src:q(o),alt:"",loading:"lazy"})),t("h3",{class:"face-name"},o.name),t("div",{class:"face-area"},o.area)),t("div",{class:"slab-act"},t("button",{class:"btn library-add",disabled:u,"aria-label":`Add ${o.name} to setup`,on:{click:()=>{n.openStackSetup(),i.get().setup.selected.includes(o.id)||n.toggleSetupProvider(o.id),document.getElementById("stack-setup-heading")?.focus()}}},"+ Add to setup")))))):null)}function Ut(e){return e.step==="ready"?{text:`Agent reported checks passed ${e.verified?E(e.verified.at):""}.`,tone:"g"}:e.step==="verified"?{text:e.verified?.ok?`Agent check ${e.verified?E(e.verified.at):""}.`:"Agent check found issues.",tone:e.verified?.ok?"g":"a"}:e.step==="mcp"?{text:"Agent integration configured. Live check needed.",tone:"a"}:e.step==="in_repo"?{text:e.hasRecipe?"Found in your code. Not connected.":"Found in your code.",tone:"a"}:{text:"Not in this app.",tone:""}}function Ft(e,i,n){let s=i.busy.tile===e.id,a=s||i.setup.running||i.busy.chat,c=Ut(e),u=e.step==="ready"?t("span",{class:"tag acid"},"Agent checked"):e.step==="verified"?t("span",{class:"tag"},e.verified?.ok?"Checked":"Issues"):e.step==="mcp"?t("span",{class:"tag"},"Configured"):t("span",{class:"tag"},"In code"),o=e.step==="in_repo"&&e.hasRecipe?t("button",{class:"btn primary",disabled:a,on:{click:()=>n.connect(e)}},s?t("span",{class:"spin"}):null,s?"Configuring\u2026":"Configure agent"):e.step==="in_repo"?t("button",{class:"btn",disabled:a,on:{click:()=>n.verify(e)}},"Check with agent"):e.step==="mcp"?t("button",{class:"btn",disabled:a,on:{click:()=>n.verify(e)}},s?t("span",{class:"spin"}):null,s?"Checking\u2026":"Check live"):t("button",{class:"btn",disabled:a,on:{click:()=>n.verify(e)}},s?t("span",{class:"spin"}):null,s?"Checking\u2026":"Check again"),p=Qt(e.logoUrl)??"#9a9a9a";return t("article",{class:`slab${e.step==="ready"?" ready":""}${s?" scanning":""}`,dataset:{provider:e.id},style:{"--brand":p}},t("div",{class:"face"},t("div",{class:"face-top"},u),t("div",{class:"face-logo"},t("img",{src:e.logoUrl,alt:"",loading:"lazy"})),t("div",{class:"face-name"},e.name),t("div",{class:"face-area"},e.area)),t("div",{class:`slab-status ${c.tone}`},t("i",{class:c.tone}),t("span",{class:"txt"},c.text),e.fixes>0?t("button",{class:"fixlink",on:{click:()=>n.focusBlockers(e.id)}},`${e.fixes} to fix`):null),t("div",{class:"slab-act"},o))}function ue(e){return e.agents.find(i=>i.id===e.cliId)?.label.replace(/ CLI$/,"")??e.cliId}function $t(e,i,n){let s=e.agents.find(d=>d.id===e.cliId),a=e.probes[e.cliId],c=a?.ready===!0,u=s?.modelOptions??(s?.models??[]).map(d=>({id:d,label:d})),o=t("div",{class:"thread"},e.messages.length?e.messages.map(d=>Rt(d,e,n)):t("div",{class:"welcome"},t("h3",{},"A little less setup. A lot more building."),t("p",{},"Start with Connect my app, or ask your agent to work on something specific."),t("div",{class:"suggest"},...["What does this app need next?","Check my service connections","Explain what changed since the last release"].map(d=>t("button",{class:"suggest-chip",disabled:!c||e.busy.chat||e.setup.running,on:{click:()=>n.send(d)}},d)))),e.busy.chat?t("div",{class:"working"},t("span",{class:"spin"}),t("span",{dataset:{working:"1"}},`${ue(e)} is working\u2026`),t("button",{class:"btn sm stop",on:{click:()=>n.stop()}},t("i",{class:"sq"}),"Stop")):null,e.busy.chat?t("div",{class:"slow-run hint",hidden:!e.workingSince||Date.now()-e.workingSince<6e4,dataset:{slowRun:"1"}},t("p",{},"Taking longer than expected. CLI startup hooks or provider sign-in may be waiting. Stop this run and open Terminal to check your agent setup."),t("button",{class:"btn sm",on:{click:()=>n.toggleDrawer("terminal")}},"Open terminal")):null);(e.messages.length||e.busy.chat)&&queueMicrotask(()=>{o.scrollTop=o.scrollHeight});let p=e.contextProviderId?P(e.project,e.catalog,e.verified).find(d=>d.id===e.contextProviderId):null,r=t("textarea",{id:"agent-composer",placeholder:c?"Ask about this app, or tell the agent what to do\u2026":"Test the connection first, then chat.",rows:2,value:e.draft,disabled:e.busy.chat||e.setup.running,on:{input:d=>{i.get().draft=d.target.value},keydown:d=>{let h=d;h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),n.send(h.target.value))}}}),l=e.busy.probe===e.cliId;return t("aside",{id:"agent-panel",class:"side","aria-label":"Coding agent"},t("div",{class:"side-head"},t("span",{class:"who"},"Agent"),t("div",{class:"seg"},...(e.agents.length?e.agents:[]).map(d=>{let h=e.probes[d.id],y=h?.ready?"g":d.installed?"a":"";return t("button",{class:d.id===e.cliId?"on":"",disabled:e.setup.running||e.busy.chat,title:d.installed?h?.ready?"Connected":"Installed, not tested yet":"Not installed",on:{click:()=>n.selectCli(d.id)}},t("i",{class:y}),d.label.replace(/ CLI$/,"").replace("Claude Code","Claude"))}))),t("div",{class:"side-head tools"},u.length?t("label",{class:"model-field",for:"agent-model"},t("span",{},"Model"),t("select",{id:"agent-model",class:"sel",title:"Model",disabled:e.setup.running||e.busy.chat,on:{change:d=>i.set({modelId:d.target.value})}},t("option",{value:"",selected:!e.modelId},"Use agent default"),e.modelId&&!u.some(d=>d.id===e.modelId)?t("option",{value:e.modelId,selected:!0},`${e.modelId} (saved selection)`):null,...u.map(d=>t("option",{value:d.id,selected:d.id===e.modelId},d.label)))):null,e.cliId==="claude"?t("p",{class:"model-note"},"Versioned models. Availability depends on your Claude account and CLI."):null,t("div",{class:"agent-connection",role:"status"},l?t("span",{class:"pill"},t("span",{class:"spin"}),"Checking connection\u2026"):c?t("span",{class:"pill green",title:a?.message},t("i"),`${ue(e).replace("Claude Code","Claude")} connected`):s&&!s.installed?t("span",{class:"pill amber",title:`${s.label} is not installed`},t("i"),"Not installed"):t("span",{class:"pill amber"},t("i"),"Not connected"),t("button",{id:"agent-test-connection",class:"connection-action",disabled:l||e.busy.chat||e.setup.running,on:{click:()=>n.testConnection(e.cliId)}},c?"Test again":"Test connection"))),o,a&&!a.ready?t("div",{class:"hint"},t("b",{},a.message)," ",t("button",{class:"btn sm",on:{click:()=>n.toggleDrawer("terminal")}},"Open terminal")):null,t("div",{class:"composer"},r,t("div",{class:"row"},p?t("span",{class:"chip"},p.logoUrl?t("img",{src:p.logoUrl,alt:""}):null,p.name,t("button",{title:"Remove context","aria-label":"Remove context",on:{click:()=>i.set({contextProviderId:null})},html:'<svg width="10" height="10" viewBox="0 0 10 10" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"><path d="M1.5 1.5l7 7M8.5 1.5l-7 7"/></svg>'})):null,t("select",{id:"agent-access",class:"sel mode","aria-label":"Agent access",title:"What the agent may do",disabled:e.setup.running||e.busy.chat,on:{change:d=>n.setAccessMode(d.target.value)}},...["ask","approve","full"].map(d=>t("option",{value:d,selected:d===e.accessMode},d==="ask"?"Ask \xB7 plan only":d==="approve"?"Approve \xB7 edit files":"Full access"))),e.busy.chat?t("button",{class:"btn send stop",title:"Stop","aria-label":"Stop",on:{click:()=>n.stop()},html:'<svg width="14" height="14" viewBox="0 0 14 14"><rect x="2" y="2" width="10" height="10" rx="2" fill="currentColor"/></svg>'}):t("button",{class:"btn send",title:"Send","aria-label":"Send",disabled:!c||e.setup.running,on:{click:()=>n.send(r.value)},html:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 13V3M3.5 7.5 8 3l4.5 4.5"/></svg>'}))))}function Ye(e,i,n=Date.now()){if(!i)return;let s=Math.max(0,Math.floor((n-i)/1e3)),a=e.querySelector("[data-working]");a&&(a.textContent=`${a.textContent?.split(" \xB7")[0]??"Working\u2026"} \xB7 ${s}s`);let c=e.querySelector("[data-slow-run]");c&&(c.hidden=s<60)}function Rt(e,i,n){let s=e.role==="me"?"You":e.role==="agent"?i.agents.find(c=>c.id===e.cliId)?.label.replace(/ CLI$/,"").replace("Claude Code","Claude")??"Agent":e.role==="error"?"Something went wrong":"VibeRaven",a=e.card?t("div",{class:"card"},t("span",{},e.card.providerId?t("img",{src:P(i.project,i.catalog,i.verified).find(c=>c.id===e.card?.providerId)?.logoUrl??"",alt:""}):null,e.card.label),e.card.action==="verify"&&e.card.providerId?t("button",{class:"btn sm primary",disabled:i.busy.chat||i.setup.running,on:{click:()=>n.verifyById(e.card.providerId)}},"Verify live"):e.card.action==="recheck"?t("button",{class:"btn sm",disabled:i.busy.scan,on:{click:()=>n.recheck()}},"Re-check"):null):null;return t("div",{class:`msg ${e.role==="me"?"me":e.role==="error"?"err":""}`},t("div",{class:"who"},s,t("span",{class:"t"},E(e.at))),t("div",{class:"body",html:e.role==="me"?`<p>${G(e.text)}</p>`:Z(e.text)}),a)}function Ht(e,i,n){let s=e.drawer==="terminal"?Yt(e,n):e.drawer==="services"?Pt(e,i,n):Bt(e,i,n),a=e.drawer==="terminal"?"Coding agents":e.drawer==="services"?"Services":"Releases",c=e.drawer==="terminal"?"VibeRaven drives the agent CLI installed on this computer. Installed is not connected: test each one.":e.drawer==="services"?"What your app runs on, and what you could add. Check a service live through your agent.":"Release points in this repository, and the real diff between any two of them.";return t("div",{class:"drawer",dataset:{drawer:e.drawer??""},role:"dialog","aria-modal":"true","aria-labelledby":"drawer-heading",on:{keydown:u=>{let o=u;if(o.key==="Escape"&&(o.preventDefault(),o.stopPropagation(),n.toggleDrawer(null)),o.key!=="Tab")return;let p=Array.from(u.currentTarget.querySelectorAll("*")).filter(d=>d.matches('button:not(:disabled), input:not(:disabled), a[href], select:not(:disabled), [tabindex="0"]')),r=p[0],l=p[p.length-1];o.shiftKey&&document.activeElement===r&&(o.preventDefault(),l?.focus()),!o.shiftKey&&document.activeElement===l&&(o.preventDefault(),r?.focus())}}},t("div",{class:"drawer-head"},t("div",{class:"drawer-title"},t("h3",{id:"drawer-heading"},a),t("p",{},c)),t("button",{id:"drawer-close",class:"quiet",on:{click:()=>n.toggleDrawer(null)}},"Close")),t("div",{class:"drawer-body"},s))}function de(e,i,n,s,...a){return t("li",{class:`step${n?" done":""}`},t("span",{class:"step-n","aria-hidden":"true"},n?"\u2713":String(e)),t("div",{class:"step-body"},t("div",{class:"step-title"},i,t("span",{class:`step-state${n?" ok":""}`},n?"Done":"Not confirmed")),t("p",{},s),a.some(Boolean)?t("div",{class:"row step-row"},...a):null))}function Yt(e,i){return t("div",{},...e.agents.map(n=>{let s=e.probes[n.id],a=s?.ready===!0,c=e.busy.probe===n.id;return t("section",{class:"block agent-block","aria-label":n.label},t("div",{class:"block-head"},t("h4",{},n.label),t("span",{class:`pill ${a?"green":n.installed?"amber":"gray"}`},t("i"),a?"Connected":n.installed?"Installed \xB7 not tested":"Not installed"),t("a",{class:"btn sm ghost",style:{marginLeft:"auto"},href:n.setup.docsUrl,target:"_blank",rel:"noreferrer"},"Docs")),t("ol",{class:"steps"},de(1,"Install the CLI",n.installed,n.installed?`Found on this computer as ${n.command}.`:`Not found on this computer. Install command: ${n.setup.installCommand}`,n.installed?null:t("button",{class:"btn sm primary",on:{click:()=>i.runSetup(n.id,"install")}},"Install here")),de(2,"Sign in to your account",a,a?"Confirmed by the last connection test.":`VibeRaven cannot read your CLI session. Sign in with ${n.setup.signInCommand}, then test below.`,t("button",{class:"btn sm",on:{click:()=>i.openTerminal(n.id,"sign-in")}},"Open a terminal to sign in")),de(3,"Test the connection",a,s?.message??`Not tested in this session. VibeRaven runs ${n.setup.verifyCommand} and reads the result.`,t("button",{class:"btn sm",disabled:c,on:{click:()=>i.testConnection(n.id)}},c?t("span",{class:"spin"}):null,c?"Testing\u2026":a?"Test again":"Test connection"))))}),t("section",{class:"block","aria-label":"Terminal output"},t("div",{class:"block-head"},t("h4",{},"Terminal output"),t("span",{class:"block-meta"},"From the last install, sign-in or connection test")),t("pre",{class:"out",dataset:{terminalOut:"1"}},e.terminalOutput||"Nothing yet. Run a step above and the raw output appears here.")))}function Bt(e,i,n){let s=e.project.releases??[],a=t("input",{id:"release-from",class:"sel","aria-label":"From revision",placeholder:"Tag, commit or branch",value:e.compare.from,on:{input:p=>{i.get().compare.from=p.target.value}}}),c=t("input",{id:"release-to",class:"sel","aria-label":"To revision",placeholder:"HEAD",value:e.compare.to,on:{input:p=>{i.get().compare.to=p.target.value}}}),u=e.compare.result,o=u?.stats;return t("div",{},t("section",{class:"block","aria-label":"Release history"},t("div",{class:"block-head"},t("h4",{},"History"),t("span",{class:"block-meta"},s.length?`${s.length} release point${s.length===1?"":"s"} \xB7 branch ${s[0].branch}`:"Nothing tagged yet")),s.length?t("ul",{class:"rel-list"},...s.map(p=>t("li",{class:"rel"},t("div",{class:"rel-main"},t("div",{class:"rel-line"},t("span",{class:"lbl"},p.label),t("span",{class:`tag ${p.tone==="current"?"amber":"dim"}`},p.tone==="current"?"Current":p.tone==="prod"?"Released":"Planned")),t("p",{class:"rel-sum"},p.summary),t("p",{class:"rel-meta"},`${p.meta} \xB7 ${p.branch}`)),t("button",{class:"btn sm ghost",on:{click:()=>{i.set({compare:{...i.get().compare,from:p.id}}),document.getElementById("release-from")?.focus()}}},"Compare from here")))):t("p",{class:"drawer-empty"},"No git tags yet. Tag a release (git tag v1.0.0) and it shows up here. You can still compare any branch or commit below.")),t("section",{class:"block","aria-label":"Compare"},t("div",{class:"block-head"},t("h4",{},"Compare two points"),t("span",{class:"block-meta"},"Any tag, branch or commit in this repository")),t("div",{class:"row compare-fields"},t("label",{},"From",a),t("label",{},"To",c),t("div",{class:"compare-actions"},t("button",{class:"btn sm primary",disabled:e.busy.compare,on:{click:()=>n.compare(a.value,c.value)}},e.busy.compare?t("span",{class:"spin"}):null,e.busy.compare?"Reading\u2026":"Diff"),t("button",{class:"btn sm",disabled:e.busy.chat||e.setup.running,on:{click:()=>n.explainDiff(a.value,c.value)}},`Explain with ${ue(e)}`))),e.compare.error?t("p",{class:"compare-error",role:"alert"},e.compare.error):null,u?t("div",{class:"diff-result"},t("div",{class:"diff-stats"},t("span",{class:"diff-range"},`${u.fromLabel} \u2192 ${u.toLabel}`),o?t("span",{},`${o.files??0} file${o.files===1?"":"s"}`):null,o?t("span",{class:"add"},`+${o.insertions??0}`):null,o?t("span",{class:"del"},`\u2212${o.deletions??0}`):null),t("pre",{class:"out diff",tabindex:0,role:"region","aria-label":"Diff output",html:Gt(u.diff)})):t("p",{class:"drawer-empty"},"Pick two points and select Diff. The output is read straight from git \u2014 nothing is sent anywhere.")))}function Qt(e){let i=/cdn\.simpleicons\.org\/[a-z0-9.-]+\/([0-9a-f]{6})/i.exec(e);if(!i)return null;let n=i[1].toLowerCase();return n==="ffffff"?"#c8c8c8":`#${n}`}function Gt(e){return e.split(`
7
- `).map(i=>{let n=G(i);return i.startsWith("+++")||i.startsWith("---")||i.startsWith("diff ")||i.startsWith("@@")?`<span class="hd">${n}</span>`:i.startsWith("+")?`<span class="add">${n}</span>`:i.startsWith("-")?`<span class="del">${n}</span>`:n}).join(`
8
- `)}function Zt(e){return t("div",{class:"toasts"},...e.toasts.map(i=>t("div",{class:`toast${i.kind==="err"?" err":""}`},i.text)))}function pe(e){let i=e.filter(n=>n.detected);return(i.length?i:e.filter(n=>["github","supabase","vercel"].includes(n.id))).map(n=>n.id)}function Vt(e,i){return[i==="ask"?"Plan the setup of this app. Do not edit files, write configuration, provision resources, or change providers.":"Set up the selected services for this app using the current access mode.","Selected services:",...e.map(n=>`- ${n.name} (${n.area}): ${n.detected?"already detected; preserve and complete the existing integration":"requested addition; inspect the app before choosing the minimal integration"}. ${n.note??""}`),"First inspect the repo and reuse its existing architecture, accounts, and integrations. Do not replace an existing provider or add unselected services.","Shared MCP recipes may be available in .mcp.json. Check whether your CLI loads them. In editing modes, adapt the selected recipes to its project-local native configuration if necessary, preserving other entries. If a restart or authorization is required, report that as a remaining step; do not pretend the tools are available.","Use available provider MCP tools to inspect configuration. For repo work, use official SDKs, wire the necessary integration, and add placeholder variable names to .env.example. Never invent real secrets or print secret values.","If sign-in, account selection, a paid resource, broader permissions, or dashboard access is needed, stop that step and give the owner the exact next action. Do not purchase services, make financial transactions, push commits, publish packages, create releases, deploy, or alter production data as part of setup.","Run relevant local checks. Report separately: repo changes, provider evidence actually observed, and remaining user actions. MCP configuration alone does not prove a live connection. Do not claim the app is production-ready.","Keep the summary short and name the files changed."].join(`
9
- `)}async function Be(e){let{providers:i,mode:n,connect:s,runAgent:a,onProgress:c,cancelled:u}=e;if(!i.length)throw new Error("Select at least one service.");let o=()=>{if(u())throw new Error("Setup stopped. Configuration already written is kept; no further steps will run.")};for(let r of i)if(o(),n==="ask")c({id:r.id,state:"pending",label:`${r.name} \xB7 planning only`});else if(r.mcpConfigured)c({id:r.id,state:"configured",label:`${r.name} \xB7 MCP configuration found`});else if(r.hasRecipe){c({id:r.id,state:"working",label:`${r.name} \xB7 preparing MCP configuration`});let l=await s(r.id);if(o(),!l.ok)throw new Error(`${r.name}: ${l.message}`);c({id:r.id,state:"configured",label:`${r.name} \xB7 shared MCP recipe saved`})}else c({id:r.id,state:"pending",label:`${r.name} \xB7 agent will inspect setup options`});o(),c({id:"agent",state:"working",label:n==="ask"?"Agent is preparing your plan":"Agent is working through your stack"});let p=await a(Vt(i,n));if(o(),!p)throw new Error("The agent did not complete the setup task. Review its output and try again.");c({id:"agent",state:"review",label:n==="ask"?"Plan returned \xB7 review it in the agent panel":"Setup response returned \xB7 review changes and remaining steps"})}function Qe(e,i){if(e.length>1e3)return null;let n=new URLSearchParams(e.replace(/^[#?]/,"")).get("stack");return n===null?null:[...new Set(n.split(",").filter(s=>i.includes(s)))]}function Wt(){let e=document.getElementById("vr-state");if(!e?.textContent)throw new Error("Missing initial state");return JSON.parse(e.textContent)}function Ge(e,i){let n=(e??"").trim();return n.length>i?`\u2026${n.slice(-i)}`:n}function C(e){return e instanceof Error?e.message:String(e)}function qt(e){let i=!1,n=new Set;function s(r=!1){e.set({agentOpen:!0,drawer:null}),document.getElementById(r?"agent-test-connection":"agent-composer")?.focus({preventScroll:!0}),document.getElementById("agent-panel")?.scrollIntoView?.({behavior:"smooth",block:"nearest"})}async function a(){let[r,l,d]=await Promise.all([k.project(),k.catalog().catch(()=>({providers:[]})),k.verified().catch(()=>({verified:{}}))]);e.set({project:r,catalog:l.providers,verified:d.verified})}async function c(r,l,d){let h=e.get();if(h.busy.chat)return null;let y=h.probes[r.cliId];if(s(!y?.ready),!y?.ready)return e.toast(`Test the ${r.cliId} connection first.`,"err"),null;e.push({role:"me",text:l});let g=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;e.set({busy:{...e.get().busy,chat:!0},draft:"",workingSince:Date.now(),runId:g});try{let M=(await k.chat({...r,runId:g})).agentRun,w=M.output?.trim(),D=M.timedOut||M.exitCode!==null&&M.exitCode!==0||/Stopped by user/.test(M.stderr??"");if(!w&&/Stopped by user/.test(M.stderr??""))return e.push({role:"system",text:"Stopped."}),null;let f=w||(M.timedOut?`${r.cliId} did not finish in time and was stopped. Try a smaller task, or switch to ask mode for a read-only answer.`:`${r.cliId} exited with code ${M.exitCode??"unknown"} and no answer.
1
+ "use strict";(()=>{function En(e=document){return e.querySelector('meta[name="viberaven-token"]')?.content??""}async function O(e,n){let t=await fetch(e,{...n,credentials:"same-origin",headers:{"content-type":"application/json","x-viberaven-token":En(),...n?.headers??{}}}),r=await t.text(),s=null;try{s=r?JSON.parse(r):null}catch{s={error:r}}if(!t.ok){let a=s?.error??s?.message??r??`HTTP ${t.status}`;throw new Error(String(a))}return s}var D=(e,n)=>O(e,{method:"POST",body:JSON.stringify(n)}),L={project:()=>O("/api/project"),scan:()=>D("/api/scan",{}),scanStatus:()=>O("/api/scan-status"),githubWorkflow:()=>O("/api/github-workflow"),addGithubWorkflow:()=>D("/api/github-workflow",{}),agents:()=>O("/api/cli-agents"),probe:e=>D("/api/cli-agents/probe",{cliId:e}),runSetup:(e,n)=>D("/api/cli-agents/run-setup",{cliId:e,step:n}),openTerminal:(e,n)=>D("/api/cli-agents/open-terminal",{cliId:e,step:n}),chat:e=>D("/api/agent-chat",e),catalog:()=>O("/api/provider-catalog"),verified:()=>O("/api/provider-verify"),stop:e=>D("/api/agent-chat/stop",{runId:e}),verify:e=>D("/api/provider-verify",e),connectMcp:e=>D("/api/mcp/connect",{providerId:e}),compare:(e,n)=>O(`/api/releases/compare?from=${encodeURIComponent(e)}&to=${encodeURIComponent(n)}`),fullCheckStatus:()=>O("/api/fullcheck/status"),fullCheckLatest:()=>O("/api/fullcheck/latest"),fullCheckSignInStart:()=>D("/api/fullcheck/signin/start",{}),fullCheckSignInPoll:()=>D("/api/fullcheck/signin/poll",{}),fullCheckSignOut:()=>D("/api/fullcheck/signout",{}),fullCheckPrepare:()=>D("/api/fullcheck/prepare",{}),fullCheckRun:e=>D("/api/fullcheck/run",{previewId:e}),actions:e=>O(`/api/actions?cli=${encodeURIComponent(e)}`),planAction:e=>D("/api/actions/plan",e),startRun:e=>D("/api/runs",e),runs:()=>O("/api/runs"),run:(e,n)=>O(`/api/runs/${encodeURIComponent(e)}?after=${n}`),resumeRun:e=>D(`/api/runs/${encodeURIComponent(e)}/resume`,{}),cancelRun:e=>D(`/api/runs/${encodeURIComponent(e)}/cancel`,{}),runDiff:e=>O(`/api/runs/${encodeURIComponent(e)}/diff`),restoreFile:(e,n)=>D(`/api/runs/${encodeURIComponent(e)}/restore`,{path:n}),revertRun:e=>D(`/api/runs/${encodeURIComponent(e)}/revert`,{}),preview:()=>O("/api/preview"),stopPreview:()=>D("/api/preview/stop",{}),changelog:(e,n)=>O(`/api/releases/changelog?from=${encodeURIComponent(e)}&to=${encodeURIComponent(n)}`)};function i(e,n,...t){let r=document.createElement(e);if(n){for(let[s,a]of Object.entries(n))if(!(a==null||a===!1))if(s==="class")r.className=String(a);else if(s==="on")for(let[l,o]of Object.entries(a))r.addEventListener(l,o);else if(s==="dataset")for(let[l,o]of Object.entries(a))r.dataset[l]=o;else s==="html"?r.innerHTML=String(a):s==="style"&&typeof a=="object"?Object.assign(r.style,a):s in r&&typeof a!="string"?r[s]=a:r.setAttribute(s,String(a))}return kt(r,t),r}function kt(e,n){for(let t of n)t==null||t===!1||(Array.isArray(t)?kt(e,t):t instanceof Node?e.appendChild(t):e.appendChild(document.createTextNode(String(t))))}function ye(e){return e.replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n])}function _(e){let t=ye(e.replace(/\r\n/g,`
2
+ `)).split(/```/),r="";return t.forEach((s,a)=>{if(a%2===1){let d=s.replace(/^[a-z0-9-]*\n/i,"");r+=`<pre><code>${d}</code></pre>`;return}let l=s.split(`
3
+ `),o=null;for(let d of l){let u=d.trimEnd(),c=/^\s*[-*•]\s+(.*)$/.exec(u),p=/^\s*\d+[.)]\s+(.*)$/.exec(u),h=/^(#{1,3})\s+(.*)$/.exec(u),f=c?"ul":p?"ol":null;o&&f!==o&&(r+=`</${o}>`,o=null),f&&!o&&(r+=`<${f}>`,o=f),c||p?r+=`<li>${it((c??p)[1])}</li>`:h?r+=`<h4>${it(h[2])}</h4>`:u.trim()&&(r+=`<p>${it(u)}</p>`)}o&&(r+=`</${o}>`)}),r}function it(e){return e.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>")}function F(e){let n=Date.now()-new Date(e).getTime();if(!Number.isFinite(n)||n<0)return"just now";let t=Math.round(n/6e4);if(t<1)return"just now";if(t<60)return`${t} min ago`;let r=Math.round(t/60);return r<24?`${r} h ago`:`${Math.round(r/24)} d ago`}function Fe(){return{step:"closed",status:null,signIn:null,preview:null,result:null,saved:null,fromSaved:!1,limit:null,error:null,notice:null}}var Pn=new Set(["network","timeout","server","rate_limited","busy"]);function Lt(e,n={}){let t=n.wait??(g=>new Promise(w=>window.setTimeout(w,g))),r=0,s=()=>e.get().fullCheck,a=g=>e.set(w=>({fullCheck:{...w.fullCheck,...g}})),l=g=>g===r&&s().step!=="closed";async function o(g){try{return await g()}catch(w){return{kind:"error",reason:"unexpected",message:`The Studio did not answer: ${w instanceof Error?w.message:String(w)}`}}}async function d(){try{let g=await L.fullCheckStatus();return a({status:g}),g}catch{return null}}async function u(g,w,b){if(l(b))switch(g.kind){case"signin":a({step:"signin",signIn:{code:g.code,verificationUrl:g.verificationUrl,expiresAt:g.expiresAt,opened:g.opened},error:null}),c(b,g.pollIntervalSeconds);return;case"signin_pending":return;case"signed_in":if(a({signIn:null,notice:g.notice??(s().preview?"Signed in again. Confirm to send the same request.":null)}),await d(),!l(b))return;s().preview?a({step:"preview"}):await h(b);return;case"signin_expired":case"signin_denied":a({step:"error",signIn:null,error:{message:g.message,retry:"signin"}});return;case"signed_out":a({...Fe(),saved:s().saved}),e.toast("Signed out of VibeRaven on this computer.");return;case"signin_required":case"reauth":a({notice:g.message}),await p(b);return;case"preview":a({step:"preview",preview:g.preview,error:null});return;case"result":a({step:"result",result:g.result,saved:g.result,fromSaved:!1,preview:null,notice:null,error:null}),await d();return;case"plan_limit":a({step:"limit",preview:null,notice:null,limit:{plan:g.plan,message:g.message,pricingUrl:g.pricingUrl,usage:g.usage}}),await d();return;case"error":{let M=g.reason==="not_confirmed"||g.reason==="prepare_failed"?"prepare":g.reason==="no_signin"?"signin":w==="run"&&!Pn.has(g.reason)?"prepare":w;M==="prepare"&&w==="run"&&a({preview:null}),a({step:"error",error:{message:g.message,retry:M}});return}}}async function c(g,w){for(;l(g)&&s().step==="signin";){if(await t(Math.max(1,w)*1e3),!l(g)||s().step!=="signin")return;let b=await o(()=>L.fullCheckSignInPoll());if(b.kind!=="signin_pending"){await u(b,"signin",g);return}}}async function p(g){a({step:"loading",error:null}),await u(await o(()=>L.fullCheckSignInStart()),"signin",g)}async function h(g){a({step:"preparing",error:null,result:null,limit:null}),await u(await o(()=>L.fullCheckPrepare()),"prepare",g)}async function f(g){a({step:"loading",error:null});let w=await d();if(l(g)){if(!w){a({step:"error",error:{message:"The Studio server did not answer. Reload the page and try again.",retry:"status"}});return}w.signedIn?await h(g):await p(g)}}return{async openFullCheck(){let g=s().step;g!=="closed"&&g!=="result"&&g!=="limit"&&g!=="error"||(r+=1,a({...Fe(),step:"loading",status:s().status,saved:s().saved}),await f(r))},closeFullCheck(){r+=1,a({step:"closed",signIn:null,error:null,notice:null}),document.getElementById("run-full-check")?.focus({preventScroll:!0})},async fullCheckSignIn(){await p(r)},async fullCheckConfirm(){let g=s().preview;if(!g||s().step!=="preview")return;let w=r;a({step:"running",error:null}),await u(await o(()=>L.fullCheckRun(g.id)),"run",w)},async fullCheckRetry(){let g=s().error?.retry??"status",w=r;if(g==="run"&&s().preview){a({step:"preview",error:null});return}g==="signin"?await p(w):g==="prepare"?await h(w):await f(w)},async fullCheckSignOut(){await u(await o(()=>L.fullCheckSignOut()),"status",r),await d()},async loadSavedFullCheck(){try{let{result:g}=await L.fullCheckLatest();g&&!s().saved&&a({saved:g})}catch{}},showSavedFullCheck(){let g=s().saved,w=s().step;!g||w!=="closed"&&w!=="result"&&w!=="limit"&&w!=="error"||(r+=1,a({step:"result",result:g,fromSaved:!0,preview:null,limit:null,error:null,notice:null}))},async copyFullCheckPrompt(g){try{await navigator.clipboard.writeText(g),e.toast("Fix prompt copied. Paste it into your coding agent.")}catch{e.toast("Could not copy. Select the text and copy it by hand.","err")}}}}function be(e){return e?e.plan==="pro"?`${e.used} of ${e.limit} Pro full checks used this month`:`${e.used} of ${e.limit} free full checks used`:null}function at(e,n=new Date){let t=new Date(e);if(Number.isNaN(t.getTime()))return"at an unknown time";let r=Math.round((n.getTime()-t.getTime())/6e4);return r<1?"just now":r<60?`${r} min ago`:r<1440?`${Math.round(r/60)} h ago`:`on ${t.toISOString().slice(0,10)}`}function xt(e){return e==="pro"?"Pro plan":"Free plan"}function rt(e){return e<1024?`${e} B`:`${(e/1024).toFixed(1)} KB`}function On(e){try{return new URL(e).host}catch{return e}}function Mt(e){return i("span",{class:`tag ${e==="critical"?"red":e==="warning"?"amber":"dim"}`},e==="critical"?"Critical":e==="warning"?"Important":"Nice to have")}function Rn(e,n){let t=e.status?.account;if(!t)return null;let r=be(e.status?.usage);return i("div",{class:"fc-account"},i("span",{class:"fc-avatar","aria-hidden":"true"},t.email.slice(0,1).toUpperCase()),i("span",{class:"fc-who"},`Signed in as ${t.email}`),i("span",{class:`fc-plan is-${t.plan}`},xt(t.plan)),e.status?.sessionOnly?i("span",{class:"fc-dot"},"this session only"):null,r?i("span",{class:"fc-dot"},r):null,i("button",{class:"fc-link",on:{click:()=>n.fullCheckSignOut()}},"Sign out"))}function Un(e,n){let t=e.signIn;return[i("p",{class:"fc-lead"},e.notice??"Full checks run on VibeRaven, so they need your VibeRaven account. Sign in once on this computer."),i("div",{class:"fc-code"},i("span",{class:"fc-code-label"},"Your code"),i("strong",{id:"fc-code"},...t.code.split("").map(r=>i("span",{},r)))),i("p",{class:"fc-hint"},t.opened?"We opened the sign-in page in your browser. Check the code matches, then confirm it there.":"Open the sign-in page, check the code matches, then confirm it there."),i("div",{class:"fc-actions"},i("a",{class:"btn primary",href:t.verificationUrl,target:"_blank",rel:"noopener noreferrer"},"Open the sign-in page"),i("span",{class:"fc-wait",role:"status"},i("span",{class:"spin"}),"Waiting for you to confirm\u2026"),i("button",{class:"btn ghost",on:{click:()=>n.closeFullCheck()}},"Cancel"))]}function Ue(e,n,t,r=!1){return i("details",{class:"fc-files",open:r},i("summary",{},i("span",{},e),i("span",{class:"fc-files-count"},String(n.length))),n.length?i("ul",{},...n.map(s=>i("li",{},i("code",{},s.path),i("span",{},s.meta)))):i("p",{class:"fc-empty"},t))}function Fn(e,n){let t=e.preview,r=t.promptFiles.length;return[e.notice?i("p",{class:"fc-notice",role:"status"},e.notice):null,i("div",{class:"fc-summary"},i("div",{class:"fc-summary-main"},i("span",{class:"fc-summary-size"},rt(t.bytes)),i("span",{class:"fc-summary-what"},`${r} file${r===1?"":"s"} in full, plus names and snippets`)),i("p",{class:"fc-lead"},`This is exactly what gets sent to ${On(t.endpoint)} when you confirm. Nothing has been uploaded yet.`)),Rn(e,n),i("dl",{class:"fc-facts"},i("div",{},i("dt",{},"Project folder"),i("dd",{},i("code",{},t.workspacePath))),i("div",{},i("dt",{},"Request size"),i("dd",{},rt(t.bytes))),i("div",{},i("dt",{},"SPEC.md"),i("dd",{},t.spec.included?`Included (${t.spec.chars.toLocaleString()} characters)`:"Not found, not sent")),i("div",{},i("dt",{},"Dependencies"),i("dd",{},`${t.dependencyCount} package names`)),i("div",{},i("dt",{},"File tree"),i("dd",{},`${t.fileTreeEntries} paths, names only`))),i("div",{class:"fc-filegrid"},Ue("Files sent in full",t.promptFiles.map(s=>({path:s.path,meta:`${s.chars.toLocaleString()} chars${s.redactions?`, ${s.redactions} redacted`:""}`})),"No file contents are sent.",!0),Ue("File snippets (first 200 characters)",t.snippetFiles.map(s=>({path:s.path,meta:s.heat})),"None."),Ue("Skipped as secret files (name sent, contents never read)",t.secretFilesNamedOnly.map(s=>({path:s,meta:"name only"})),"None found."),Ue("Request text by section",t.promptSections.map(s=>({path:s.title,meta:`${s.chars.toLocaleString()} chars`})),"Empty.")),i("p",{id:"fc-redaction",class:`fc-shield${t.redactions>0?" is-on":""}`},t.redactions>0?`VibeRaven replaced ${t.redactions} secret-looking value${t.redactions===1?"":"s"} with [REDACTED]. `:"VibeRaven found no secret-looking values to replace. ","This is pattern matching, not a guarantee. Other files are sent as they are, so read the exact request body below before you send it."),i("details",{class:"fc-raw"},i("summary",{},`Show the exact request body: the prompt, file snippets and SPEC.md. Shown formatted here; sent compact (${rt(t.bytes)}), same content.`),i("pre",{id:"fc-request-json"},t.requestJson)),i("p",{class:"fc-hint"},"Most of the request text is written by VibeRaven on your machine from the local scan: stack notes and the check instructions."),i("div",{class:"fc-actions fc-footer"},i("button",{id:"fc-confirm",class:"btn primary",on:{click:()=>n.fullCheckConfirm()}},"Send and run full check"),i("button",{class:"btn ghost",on:{click:()=>n.closeFullCheck()}},"Cancel"))]}function zn(e){return e<50?"fail":e<80?"warn":"pass"}function Hn(e,n){let t=e.result,r=t.areas.reduce((o,d)=>o+d.hiddenCount,0),s=t.nextFix,a=t.areas.filter(o=>!o.locked&&o.findings.length),l=t.areas.filter(o=>o.locked||!o.findings.length);return[i("div",{class:`fc-score is-${zn(t.score)}`},i("div",{class:"fc-score-num",style:`--score:${Math.max(0,Math.min(100,t.score))}`},String(t.score)),i("div",{},i("div",{class:"fc-score-label"},t.scoreLabel,i("span",{class:"tag dim"},`${t.confidence} confidence`)),i("p",{},t.summary),i("p",{class:"fc-checked"},`Checked ${at(t.checkedAt)}. Changes made after that are not in this result; run it again after your next change.`))),i("div",{class:"fc-account"},e.fromSaved?i("span",{class:"fc-dot"},"At the time of this check:"):null,i("span",{class:`fc-plan is-${t.usage.plan}`},xt(t.usage.plan)),i("span",{class:"fc-dot"},be(t.usage)),i("span",{class:"fc-dot"},`${t.usage.remaining} left${t.usage.period==="monthly"?" this month":""}`)),s?i("article",{class:`fc-next is-${s.severity}`},i("div",{class:"fix-top"},i("span",{class:"fc-eyebrow"},"Next fix"),Mt(s.severity),i("span",{class:"fix-meta"},s.areaTitle)),i("h3",{},s.title),s.detail?i("p",{},s.detail):null,s.prompt?i("button",{class:"btn primary sm",on:{click:()=>n.copyFullCheckPrompt(s.prompt)}},"Copy fix prompt"):null):i("p",{class:"fc-lead"},"No findings in the areas your plan covers."),i("h4",{class:"fc-h4"},"Findings by area"),a.length?i("div",{class:"fc-areas"},...a.map(o=>i("section",{class:"fc-area","aria-label":o.title},i("div",{class:"fc-area-head"},i("h5",{},o.title),i("span",{class:"fc-count on"},String(o.findings.length))),i("ul",{},...o.findings.map(d=>i("li",{},Mt(d.severity),i("span",{title:d.detail},d.title))))))):null,l.length?i("div",{class:"fc-quiet"},...l.map(o=>i("section",{class:`fc-chip${o.locked?" locked":""}`,"aria-label":o.title},i("span",{class:"fc-chip-mark","aria-hidden":"true"},o.locked?"":"\u2713"),i("span",{},o.title),o.locked?i("span",{class:"tag dim"},"Pro area"):i("span",{class:"fc-sr"},"No findings."),o.locked&&o.hiddenCount?i("span",{class:"fc-sr"},`${o.hiddenCount} finding${o.hiddenCount===1?"":"s"} here. Pro shows every area.`):null))):null,r&&t.usage.plan==="free"?i("p",{class:"fc-upsell"},`${r} finding${r===1?" is":"s are"} in areas Pro covers. `,i("a",{href:"https://viberaven.dev/pricing",target:"_blank",rel:"noopener noreferrer"},"See Pro")):null,i("div",{class:"fc-actions fc-footer"},i("button",{class:"btn",on:{click:()=>n.closeFullCheck()}},"Done"))]}function Bn(e,n){let t=e.limit;return[i("h3",{class:"fc-limit",role:"alert"},t.message),be(t.usage)?i("p",{class:"fc-hint"},be(t.usage)):null,t.plan==="free"?i("p",{class:"fc-hint"},"The local Studio checks stay free and unlimited. Pro adds 50 full checks a month across all production areas."):i("p",{class:"fc-hint"},"The local Studio checks keep working until your monthly allowance resets."),i("div",{class:"fc-actions"},t.pricingUrl?i("a",{id:"fc-see-pro",class:"btn primary",href:t.pricingUrl,target:"_blank",rel:"noopener noreferrer"},"See Pro"):null,i("button",{class:"btn ghost",on:{click:()=>n.closeFullCheck()}},"Close"))]}function Yn(e,n){let t=e.error;return[i("p",{class:"fc-error",role:"alert"},t.message),i("div",{class:"fc-actions"},i("button",{class:"btn primary",on:{click:()=>n.fullCheckRetry()}},t.retry==="signin"?"Sign in again":"Try again"),i("button",{class:"btn ghost",on:{click:()=>n.closeFullCheck()}},"Close"))]}function st(e){return i("p",{class:"fc-wait",role:"status"},i("span",{class:"spin"}),e)}var Gn={closed:"",loading:"Full check",signin:"Sign in to run a full check",preparing:"Full check",preview:"Review what gets sent",running:"Running the full check",result:"Full check result",limit:"Full check limit reached",error:"Full check did not run"};function St(e,n){let t=e.fullCheck;if(t.step==="closed")return[];let r=t.step==="signin"&&t.signIn?Un(t,n):t.step==="preview"&&t.preview?Fn(t,n):t.step==="result"&&t.result?Hn(t,n):t.step==="limit"&&t.limit?Bn(t,n):t.step==="error"&&t.error?Yn(t,n):t.step==="preparing"?[st("Reading your project to build the request\u2026")]:t.step==="running"?[st("Sent. VibeRaven is checking your app\u2026")]:[st("Checking your VibeRaven sign-in\u2026")],s=t.step!=="running";return[i("div",{class:"fc-veil",on:{click:()=>{s&&n.closeFullCheck()}}}),i("section",{id:"full-check",class:"fc-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"fc-title"},i("header",{class:"fc-head"},i("h2",{id:"fc-title"},Gn[t.step]),s?i("button",{class:"btn ghost sm","aria-label":"Close full check",on:{click:()=>n.closeFullCheck()}},"Close"):null),i("div",{class:"fc-body"},...r))]}function Qn(){return{offers:[],facts:null,preview:null,request:"",plan:null,error:null,run:null,events:[],cursor:0,history:[],diff:null,previewExpanded:!1,busy:!1,selectedPart:null,gallery:null}}var At="viberaven.stack.";function Ce(e,n,t=localStorage){try{let r=t.getItem(At+e);return r?JSON.parse(r):n}catch{return n}}function $e(e,n,t=localStorage){try{t.setItem(At+e,JSON.stringify(n))}catch{}}function Wn(e){return!e.empty&&!!e.project?.scannedAt?(e.missionCards?.blockers??[]).length?"findings":"ready":"app"}function Ct(e){let n=`chat.${e.project?.path??"project"}`,t=`checklist.${e.project?.path??"project"}`,r={project:e,catalog:[],verified:{},agents:[],probes:{},cliId:Ce("cliId","codex"),accessMode:Ce("accessMode","approve"),modelId:Ce("modelId",""),messages:Ce(n,[],sessionStorage),draft:"",contextProviderId:null,busy:{chat:!1,scan:!1,probe:null,tile:null,compare:!1},terminalOutput:"",compare:{from:"",to:"HEAD",result:null,error:null},drawer:null,section:"stack",agentOpen:!1,moreOpen:!1,showAll:!1,setup:{open:!1,initialized:!1,selected:[],running:!1,progress:[],error:null},scan:null,toasts:[],workingSince:null,runId:null,fullCheck:Fe(),prChecks:{status:null,open:!1,busy:!1,written:!1,error:null},flow:{step:Wn(e),fixId:null,handoff:null,recheck:null,checklist:Ce(t,{})},work:Qn()},s=new Set,a=0,l={get:()=>r,set(o){let d=typeof o=="function"?o(r):o;r={...r,...d},"cliId"in d&&$e("cliId",r.cliId),"accessMode"in d&&$e("accessMode",r.accessMode),"modelId"in d&&$e("modelId",r.modelId),"messages"in d&&$e(n,r.messages.slice(-60),sessionStorage),"flow"in d&&$e(t,r.flow.checklist);for(let u of s)u(r)},flow(o){l.set(d=>({flow:{...d.flow,...o}}))},work(o){l.set(d=>({work:{...d.work,...typeof o=="function"?o(d.work):o}}))},subscribe(o){return s.add(o),()=>s.delete(o)},toast(o,d="ok"){let u=++a;l.set(c=>({toasts:[...c.toasts,{id:u,text:o,kind:d}]})),window.setTimeout(()=>l.set(c=>({toasts:c.toasts.filter(p=>p.id!==u)})),d==="err"?7e3:3600)},push(o){let d={...o,id:`${Date.now()}-${Math.random().toString(36).slice(2,7)}`,at:new Date().toISOString()};return l.set(u=>({messages:[...u.messages,d]})),d}};return l}var $t=["sentry","stripe","clerk","cloudflare","render","railway","neon","posthog","upstash","resend","authjs"];function Vn(e){return e?e.launchPath.filter(t=>t.state==="needs_fix"||t.state==="needs_connect"||t.state==="requires_user_action"||t.state==="blocked").length||(e.nextFix?1:0):0}function ve(e,n,t){let r=new Map(e.providers.map(u=>[u.id,u])),s=new Set,a=[],l=(u,c)=>{let p=u?.id??c.id;if(s.has(p))return;s.add(p);let h=!!u?.detected||!!(c&&c.state!=="not_detected"),f=!!u?.mcpConfigured||c?.mcp?.status==="connected",g=t[p],w=h?Vn(c):0,b="absent",M="Not in this app";h&&(b="in_repo",M=f?"MCP configured \xB7 not verified live":"In repo \xB7 MCP not set up",f&&(b="mcp"),g&&(b=g.ok&&w===0?"ready":"verified",M=g.ok?"Verified live":"Verified live \xB7 issues found")),a.push({id:p,name:u?.name??c.name,area:u?.area??c.area,logoUrl:u?.logoUrl??Zn(c?.iconHtml??""),step:b,statusText:M,fixes:w,hasRecipe:!!u?.hasRecipe||c?.mcp?.available===!0,mcpConfigured:f,note:u?.note,mcpSource:u?.mcpSource??c?.mcp?.source,verified:g,provider:c})};for(let u of n)l(u,r.get(u.id));for(let u of e.providers)l(null,u);let o=u=>u.step==="absent"?u.hasRecipe?1:2:0,d=u=>{let c=$t.indexOf(u.id);return c===-1?$t.length:c};return a.sort((u,c)=>o(u)-o(c)||c.fixes-u.fixes||d(u)-d(c)||u.name.localeCompare(c.name))}function Zn(e){let n=/src="([^"]+)"/.exec(e);return n?n[1]:""}function It(e,n,t){let r=e.setup,s=r.selected.length,a=e.probes[e.cliId]?.ready,l=r.running||e.busy.chat||!!e.busy.tile||e.busy.scan;return i("section",{class:"stack-setup","aria-label":"Connect my app"},i("div",{class:"setup-heading"},i("div",{},i("h2",{id:"stack-setup-heading",tabIndex:-1},"Set up your app"),i("ol",{class:"setup-steps"},i("li",{class:s?"done":""},i("i",{"aria-hidden":"true"},s?"\u2713":"1"),"Pick your services"),i("li",{class:a?"done":""},i("i",{"aria-hidden":"true"},a?"\u2713":"2"),"Connect your coding agent"),i("li",{},i("i",{"aria-hidden":"true"},"3"),e.accessMode==="ask"?"Get a plan":"Start setup"))),i("button",{class:"btn ghost sm",disabled:r.running,on:{click:()=>{n.set({setup:{...n.get().setup,open:!1}}),document.getElementById("connect-my-app")?.focus({preventScroll:!0})}}},"Close")),e.catalog.length?i("div",{class:"setup-services"},...e.catalog.map(o=>{let d=r.selected.includes(o.id);return i("button",{id:`setup-provider-${o.id}`,class:`setup-service${d?" selected":""}`,"aria-pressed":String(d),disabled:l,on:{click:()=>t.toggleSetupProvider(o.id)}},i("img",{src:o.logoUrl,alt:""}),i("span",{class:"setup-service-copy"},i("strong",{},o.name),i("small",{},o.detected?"In your app":o.area)),i("span",{class:"setup-check","aria-hidden":"true"},d?"\u2713":"+"))})):i("p",{class:"setup-note"},"Loading the service catalog\u2026"),i("div",{class:"setup-footer"},i("div",{},i("strong",{},s?a?`${s} service${s===1?"":"s"} ready to set up`:"Connect your agent to continue":"Pick at least one service"),i("p",{},e.accessMode==="ask"?"Ask mode only plans. It does not change your app.":"Your agent edits the repo. Provider sign-ins stay with you.")),r.running?i("button",{class:"btn",on:{click:()=>t.stop()}},"Stop setup"):a?i("button",{class:"btn primary",disabled:!s||l,on:{click:()=>t.startStackSetup()}},e.accessMode==="ask"?"Plan my setup":"Start setup",i("span",{"aria-hidden":"true"},"\u2197")):i("button",{class:"btn primary",disabled:e.busy.probe!==null,on:{click:()=>t.testConnection(e.cliId)}},e.busy.probe?"Testing agent\u2026":"Test agent connection")),r.progress.length?i("ol",{class:"setup-progress","aria-live":"polite"},...r.progress.map(o=>i("li",{class:o.state},i("span",{class:o.state==="working"&&r.running&&!r.error?"spin":"progress-dot","aria-hidden":"true"}),o.label))):null,r.error?i("p",{class:"setup-error",role:"alert"},r.error):null)}function jt(e){if(e.actionDestination)return e.actionDestination;if(e.asksFirst||["missing_stripe_webhook","unverified_stripe_webhook"].includes(e.id))return"repo-code";let n=`${e.id} ${e.title} ${e.detail??""}`.replace(/[-_]/g," ");return/\bdashboard\b|\bdns\b|apex domain|\blive\b[^.\n]*\bproof\b|\bprovider action\b/i.test(n)?"provider-action":e.requiresUserAction?"manual-review":"repo-code"}var X={authjs:"data:image/webp;base64,UklGRtANAABXRUJQVlA4WAoAAAAQAAAAVgAAXwAAQUxQSEIEAAABoETbtmnbmRvftl2LbSffthGVbNu2bdu2bdvGY5K91prBw73n7KAYEROAajsfPYBuk856r7Gh9tlD1wkAQvQotQsBAAbNv+QjNisvnTC2OwAXvSuJjwGAX3XP+2tJmhhJFZL8+rothwNADK5ozkcHoOvoE14lSRFl85qUZN1De60WAIToi+NCBIChi674jCSTGFtrIiT5xqkTegBw0bsC+BgA+FX3fLCOpCY1VtYkkeSX1ywbDgAhuGo4Hx2ArqNPeIUkRZTV1aQk6x/eZ80IIERfGRciAAxdes0XJJnEWEQTIck3Th3XFYCL3rXChwAAK+12Xw1JTWosrkkiyc+uXDwMAGJwTTkfPYBuY0542UiKGIuvSUnWP7TXagFAiB4IADBk0ZWfk2QSY1lVhCRfPXF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5NiAzLjk4MjIgMTQuNDIxOSAwIDMuOTgyMy0zLjk4MjQgMy45ODIzLTEwLjQzOTYgMC0xNC40MjE5LS45OTU2LS45OTU2LTIuMzAwNi0xLjQ5MjItMy42MDU1LTEuNDkyMi0xLjMwNDggMC0yLjYwOTkuNDk2Ni0zLjYwNTQgMS40OTIyLTEuOTkxMiAxLjk5MTItMS45OTEyIDUuMjE5OCAwIDcuMjExeiIvPjwvc3ZnPg==",vercel:"data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjRkZGRkZGIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+VmVyY2VsPC90aXRsZT48cGF0aCBkPSJtMTIgMS42MDggMTIgMjAuNzg0SDBaIi8+PC9zdmc+"};function Tt(e){return X[e]??null}var Ie={critical:0,warning:1,info:2},Nt={supabase:"https://supabase.com/dashboard/projects",vercel:"https://vercel.com/dashboard",stripe:"https://dashboard.stripe.com",github:"https://github.com/settings/profile",sentry:"https://sentry.io",posthog:"https://app.posthog.com",clerk:"https://dashboard.clerk.com",resend:"https://resend.com/emails",upstash:"https://console.upstash.com",neon:"https://console.neon.tech",railway:"https://railway.com/dashboard",render:"https://dashboard.render.com",cloudflare:"https://dash.cloudflare.com"},qn="sql|ts|tsx|js|jsx|mjs|cjs|json|toml|ya?ml|env|py|rb|go|rs|vue|svelte|astro|html|css|md|prisma|php|java|kt|sh|lock",Kn=new RegExp(String.raw`((?:[\w.@-]+[\\/])*[\w.@-]+\.(?:${qn})):(\d{1,6})\b`,"g");function _n(e){if(!e)return[];let n=new Set;for(let t of e.matchAll(Kn))n.add(`${t[1].split("\\").join("/")}:${t[2]}`);return[...n]}function Xn(e){let n=(e??"").split(`
4
+ `).map(s=>s.trim()).filter(Boolean),[t="",...r]=n;return{summary:t,evidence:r.filter(s=>s!=="Evidence:").map(s=>s.replace(/^-\s*/,""))}}function ze(e){return Tt(e.id)??e.logoUrl}function Jn(e,n,t){let r=n?.provider?.nextFix,s=e.asksFirst?`${e.asksFirst} Tell the user this before you change anything, and make the change only if they confirm.`:"";return t==="manual-review"?[s,`Review this finding: ${e.title}. Do not edit files or change provider settings. Identify what evidence is missing and whether the next step belongs in the repo or with a provider, then ask the user before any change.`,e.detail,e.prompt?`Scanner guidance to review, not authorization to execute: ${e.prompt}`:""].filter(Boolean).join(`
5
+ `):!e.prompt&&r?.id===e.id&&r.prompt?[s,r.prompt].filter(Boolean).join(`
6
+ `):[s,`Address this repository finding: ${e.title}.`,e.detail??"",e.prompt?`How to fix it: ${e.prompt}`:"","Make the minimal change, then summarize what you changed and which files. Do not claim the app is production-ready; VibeRaven will check again."].filter(Boolean).join(`
7
+ `)}function ei(e,n){let t=e.find(s=>s.provider?.nextFix?.id===n.id);if(t)return t;let r=`${n.title} ${n.detail??""}`.toLowerCase();return e.find(s=>r.includes(s.name.toLowerCase())||r.includes(`${s.id}/`))}function Dt(e){let[n,t]=[e.slice(0,e.lastIndexOf(":")),e.slice(e.lastIndexOf(":")+1)];return`${n.split("/").pop()??n}:${t}`}function ti(e){return!e.project.empty&&!!e.project.project?.scannedAt}function ni(e){return e.busy.scan||e.scan?.state==="running"}function R(e){let n=ti(e),t=ni(e),s=ve(e.project,e.catalog,e.verified).filter(y=>y.step!=="absent"),a=n?e.project.missionCards?.blockers??[]:[],l=new Map((e.project.missionCards?.planSteps??[]).map(y=>[y.id,y])),o=a.map(y=>{let k=ei(s,y),{summary:E,evidence:A}=Xn(y.detail),I=l.get(y.id),H=jt({...y,asksFirst:y.asksFirst??I?.asksFirst,actionDestination:y.actionDestination??I?.actionDestination,requiresUserAction:y.requiresUserAction===!0||I?.requiresUserAction===!0});return{id:y.id,title:y.title,severity:y.severity,summary:E,evidence:A,locations:_n(y.detail),service:k?{id:k.id,name:k.name,mark:ze(k)}:null,dashboard:H==="provider-action",actionDestination:H,prompt:Jn({...y,asksFirst:y.asksFirst??I?.asksFirst},k,H)}}),d=new Map;for(let y of o){let k=y.service?.id??"app",E=d.get(k)??{key:k,name:y.service?.name??"Your code",mark:y.service?.mark??null,findings:[]};E.findings.push(y),d.set(k,E)}let u=y=>Math.min(...y.findings.map(k=>Ie[k.severity])),c=[...d.values()].map(y=>({...y,findings:[...y.findings].sort((k,E)=>Ie[k.severity]-Ie[E.severity])})).sort((y,k)=>u(y)-u(k)||k.findings.length-y.findings.length),p=c.flatMap(y=>y.findings),h=p.filter(y=>!y.dashboard).sort((y,k)=>Ie[y.severity]-Ie[k.severity]),f={critical:0,warning:0,info:0};for(let y of o)f[y.severity]+=1;let g=s.map(y=>{let k=o.filter(nt=>nt.service?.id===y.id),E=k.filter(nt=>nt.severity==="critical").length,A=e.verified[y.id],I="pending",H="Unknown \xB7 not checked yet";return t?H="Checking":n&&(E?(I="fail",H=`Repo checks \xB7 ${E} blocker${E===1?"":"s"}`):k.length?(I="warn",H=`${k.length} to review`):(I="pass",H="Repo checks \xB7 no blockers found")),{id:y.id,name:y.name,area:y.area,mark:ze(y),tone:I,stateText:H,findings:k.length,verified:A}}),w=h.find(y=>y.id===e.flow.fixId)??null,b=[];for(let y of s){let k=e.verified[y.id];b.push({id:`live:${y.id}`,label:`Check ${y.name} live`,detail:k?`Recorded ${y.name} check (${k.at}): ${k.summary}`:`Your agent reads your real ${y.name} project and confirms it matches the code.`,kind:"live",done:k?.ok===!0,doneBy:"viberaven",providerId:y.id});let E=y.provider?.cockpit?.proof.checks.filter(A=>A.source==="dashboard"&&A.status!=="yes")??[];for(let A of E){let I=`dash:${y.id}:${A.label}`;b.push({id:I,label:A.label==="Production secret proof"?`Production keys for ${y.name} are set where you deploy`:`${y.name}: ${A.label}`,detail:A.label==="Production secret proof"?`The keys your app reads for ${y.name} go in your hosting provider's environment settings for production. VibeRaven cannot see your dashboards, so you tick this.`:`VibeRaven cannot see your ${y.name} dashboard, so you tick this.`,kind:"dashboard",done:e.flow.checklist[I]===!0,doneBy:"you",providerId:y.id,href:Nt[y.id]})}}for(let y of p.filter(k=>k.dashboard))b.push({id:`finding:${y.id}`,label:y.title,detail:`${y.summary} This clears when the next check no longer finds it.`,kind:"finding",done:!1,doneBy:"viberaven",providerId:y.service?.id,href:y.service?Nt[y.service.id]:void 0});let M=h.filter(y=>y.severity==="critical").length,$={app:!0,work:!0,findings:n,fix:n&&h.length>0,recheck:n&&e.flow.recheck!==null,ready:n&&M===0};return{scanned:n,scanning:t,services:g,findings:o,groups:c,fixable:h,counts:f,current:w,checklist:b,gateClear:n&&e.project.gate?.status==="clear",available:$}}function ot(e){return e.scanned?e.findings.length===0||!e.available.fix?"ready":"findings":"app"}function Et(e,n){let t=n.flow.recheck,r=e.checklist.filter(s=>!s.done).length;return{work:"",app:e.scanning?"Checking now":e.services.length?`${e.services.length} service${e.services.length===1?"":"s"} found`:"No services found",findings:e.scanned?e.findings.length===0?"Nothing found":[e.counts.critical?`${e.counts.critical} critical`:null,`${e.findings.length} total`].filter(Boolean).join(" \xB7 "):"After the check",fix:e.scanned?e.fixable.length===0?"Nothing to fix in code":`${e.fixable.length} to fix`:"After the check",recheck:t?t.status==="running"?"Checking now":t.status==="fixed"?"Last fix held":t.status==="open"?"Still open":"Did not finish":"After a fix",ready:e.scanned?e.available.ready?e.gateClear?"No blockers found":r?`${r} step${r===1?"":"s"} left`:"Checklist done":"After the critical fixes":"After the check"}}var He='<svg class="brand-raven" width="24" height="20" viewBox="0 0 796 667" aria-hidden="true" focusable="false"><path fill-rule="evenodd" fill="currentColor" d="M177.0 347.5 L170.0 352.0 L152.5 365.5 L142.0 375.5 L141.5 375.5 L141.5 376.0 L133.5 383.5 L133.5 384.0 L120.5 397.5 L96.5 427.5 L95.5 429.5 L84.0 445.0 L65.5 472.5 L65.0 474.0 L56.0 487.5 L55.5 489.0 L49.5 498.0 L43.0 509.5 L38.0 517.0 L37.0 519.5 L36.0 520.5 L35.5 522.0 L31.5 528.0 L30.0 531.5 L27.5 535.0 L26.5 537.5 L24.0 541.0 L18.5 552.0 L17.5 553.0 L2.0 584.0 L2.0 585.0 L0.0 589.0 L1.0 589.0 L10.0 583.0 L13.5 580.0 L20.0 576.0 L21.5 574.5 L23.0 574.0 L31.0 568.0 L47.5 557.0 L50.5 555.5 L52.0 554.0 L74.0 539.5 L75.5 538.0 L83.5 533.0 L85.0 531.5 L94.5 525.0 L100.5 520.0 L108.0 512.5 L121.0 496.0 L123.5 492.0 L130.0 478.0 L130.0 477.0 L133.0 470.5 L133.5 468.0 L136.5 461.5 L139.0 453.5 L140.0 452.0 L142.5 444.5 L143.5 443.0 L144.0 440.5 L147.0 434.0 L151.0 421.5 L152.0 420.0 L154.0 413.5 L156.0 409.5 L158.0 402.5 L161.0 396.0 L162.0 392.0 L163.0 390.5 L163.0 389.0 L164.0 387.5 L168.0 375.0 L169.0 373.5 L170.0 369.0 L171.0 367.5 L175.0 355.0 L176.0 353.5 L176.0 352.0 L177.5 348.0 Z M763.0 175.5 L732.0 140.0 L703.5 118.0 L652.0 93.5 L604.5 79.5 L586.0 56.5 L562.0 38.5 L525.0 19.5 L483.5 5.0 L455.5 0.5 L426.5 0.0 L383.5 6.0 L333.0 23.0 L275.0 55.5 L237.0 86.0 L302.0 77.5 L238.5 129.0 L199.5 169.5 L136.5 254.5 L67.0 356.5 L296.5 247.0 L232.5 314.0 L201.5 357.0 L110.0 552.5 L69.0 666.5 L211.0 526.0 L264.5 479.0 L323.0 433.0 L206.0 633.5 L288.5 587.0 L349.0 547.5 L417.0 497.0 L471.5 450.5 L529.0 392.5 L499.5 279.5 L501.0 275.0 L544.5 251.5 L605.5 229.5 L658.5 223.0 L725.5 221.0 L701.5 210.0 L655.5 197.0 L515.0 178.5 L549.5 171.0 L594.0 166.0 L649.5 175.0 L692.5 189.0 L718.5 201.0 L747.0 217.5 L795.0 252.0 L784.0 214.0 Z M436.5 73.5 L437.0 73.0 L438.0 73.0 L438.5 73.5 L439.5 73.5 L440.0 74.0 L441.5 74.0 L442.0 74.5 L443.0 74.5 L443.5 75.0 L445.0 75.0 L445.5 75.5 L446.0 75.5 L446.5 76.0 L448.0 76.0 L448.5 76.5 L449.0 76.5 L449.5 77.0 L451.0 77.0 L451.5 77.5 L452.0 77.5 L452.5 78.0 L453.5 78.0 L454.0 78.5 L454.5 78.5 L455.0 79.0 L456.0 79.0 L456.5 79.5 L457.5 79.5 L458.0 80.0 L459.0 80.0 L459.5 80.5 L460.5 80.5 L461.0 81.0 L461.5 81.0 L462.0 81.5 L463.0 81.5 L463.5 82.0 L464.5 82.0 L465.0 82.5 L465.5 82.5 L466.0 83.0 L467.0 83.0 L467.5 83.5 L468.5 83.5 L469.0 84.0 L469.5 84.0 L470.0 84.5 L471.0 84.5 L471.5 85.0 L472.5 85.0 L473.0 85.5 L473.5 85.5 L474.0 86.0 L475.0 86.0 L475.5 86.5 L476.5 86.5 L477.0 87.0 L477.5 87.0 L478.0 87.5 L478.5 87.5 L479.0 88.0 L480.0 88.0 L480.5 88.5 L481.0 88.5 L481.5 89.0 L482.5 89.0 L483.0 89.5 L483.5 89.5 L484.0 90.0 L484.5 90.0 L485.0 90.5 L486.0 90.5 L486.5 91.0 L487.5 91.0 L488.0 91.5 L488.5 91.5 L489.0 92.0 L489.5 92.0 L490.0 92.5 L491.0 92.5 L491.5 93.0 L492.0 93.0 L492.5 93.5 L493.5 93.5 L494.0 94.0 L494.5 94.0 L495.0 94.5 L495.5 94.5 L496.0 95.0 L496.5 95.0 L497.0 95.5 L497.5 95.5 L498.0 96.0 L499.0 96.0 L499.5 96.5 L500.0 96.5 L500.5 97.0 L501.0 97.0 L501.5 97.5 L502.0 97.5 L502.5 98.0 L503.5 98.0 L504.0 98.5 L504.5 98.5 L505.0 99.0 L506.0 99.0 L506.5 99.5 L507.0 99.5 L507.5 100.0 L508.0 100.0 L508.5 100.5 L509.0 100.5 L509.5 101.0 L510.5 101.0 L511.0 101.5 L511.5 101.5 L512.0 102.0 L512.5 102.0 L513.0 102.5 L513.5 102.5 L514.0 103.0 L514.5 103.0 L515.0 103.5 L515.5 103.5 L516.0 104.0 L516.5 104.0 L517.0 104.5 L517.5 104.5 L518.0 105.0 L518.5 105.0 L519.0 105.5 L519.5 105.5 L520.0 106.0 L521.0 106.0 L521.5 106.5 L522.0 106.5 L522.5 107.0 L523.0 107.0 L523.5 107.5 L524.0 107.5 L524.5 108.0 L525.0 108.0 L525.5 108.5 L526.0 108.5 L526.5 109.0 L527.0 109.0 L527.5 109.5 L528.0 109.5 L528.5 110.0 L529.0 110.0 L529.5 110.5 L530.0 110.5 L530.5 111.0 L531.0 111.0 L531.5 111.5 L532.0 111.5 L532.5 112.0 L533.0 112.0 L533.5 112.5 L534.0 112.5 L534.5 113.0 L535.0 113.0 L535.5 113.5 L536.0 113.5 L536.5 114.0 L537.0 114.0 L537.5 114.5 L538.0 114.5 L539.0 115.5 L539.0 116.0 L538.0 117.0 L537.0 117.0 L536.5 117.5 L536.0 117.5 L535.5 118.0 L535.0 118.0 L534.5 118.5 L533.5 118.5 L533.0 119.0 L532.5 119.0 L532.0 119.5 L531.0 119.5 L530.5 120.0 L530.0 120.0 L529.5 120.5 L528.5 120.5 L528.0 121.0 L527.5 121.0 L527.0 121.5 L526.5 121.5 L526.0 122.0 L525.5 122.0 L525.0 122.5 L524.0 122.5 L523.5 123.0 L523.0 123.0 L522.5 123.5 L521.5 123.5 L521.0 124.0 L520.5 124.0 L520.0 124.5 L519.0 124.5 L518.5 125.0 L518.0 125.0 L517.5 125.5 L516.5 125.5 L516.0 126.0 L515.0 126.0 L514.5 126.5 L513.5 126.5 L513.0 127.0 L512.5 127.0 L512.0 127.5 L511.0 127.5 L510.5 128.0 L510.0 128.0 L509.5 128.5 L508.5 128.5 L508.0 129.0 L507.0 129.0 L506.5 129.5 L505.0 129.5 L504.5 130.0 L504.0 130.0 L503.5 130.5 L502.0 130.5 L501.5 131.0 L500.0 131.0 L499.5 131.5 L496.5 131.5 L496.0 132.0 L491.5 132.0 L491.0 131.5 L488.5 131.5 L488.0 131.0 L487.0 131.0 L486.5 130.5 L485.5 130.5 L485.0 130.0 L484.0 130.0 L483.5 129.5 L483.0 129.5 L482.5 129.0 L482.0 129.0 L481.5 128.5 L481.0 128.5 L480.5 128.0 L480.0 128.0 L479.0 127.0 L478.5 127.0 L477.5 126.0 L477.0 126.0 L475.5 124.5 L475.0 124.5 L470.0 119.5 L470.0 119.0 L468.0 117.0 L468.0 116.5 L466.5 115.0 L466.5 114.5 L464.5 112.5 L464.5 112.0 L463.0 110.5 L463.0 110.0 L461.5 108.5 L461.5 108.0 L460.0 106.5 L460.0 106.0 L458.5 104.5 L458.5 104.0 L457.0 102.5 L457.0 102.0 L455.5 100.5 L455.5 100.0 L454.0 98.5 L454.0 98.0 L452.5 96.5 L452.5 96.0 L451.5 95.0 L451.5 94.5 L450.0 93.0 L450.0 92.5 L448.5 91.0 L448.5 90.5 L447.0 89.0 L447.0 88.5 L446.0 87.5 L446.0 87.0 L444.5 85.5 L444.5 85.0 L443.0 83.5 L443.0 83.0 L442.0 82.0 L442.0 81.5 L440.5 80.0 L440.5 79.5 L439.5 78.5 L439.5 78.0 L438.5 77.0 L438.5 76.5 L437.5 75.5 L437.5 75.0 L436.5 74.0 Z"/></svg>';var lt=new Map,Ot=()=>{};function ct(e){return`vr-canvas:${e}`}function je(e){let n=lt.get(e);if(n)return n;let t={pan:{x:0,y:0},zoom:1,cards:{}};try{let r=localStorage.getItem(ct(e));if(r){let s=JSON.parse(r);t={pan:s.pan??t.pan,zoom:Ut(s.zoom??1),cards:s.cards??{}}}}catch{}return lt.set(e,t),t}function Rt(e){try{localStorage.setItem(ct(e),JSON.stringify(je(e)))}catch{}}function Ut(e){return Math.min(1.6,Math.max(.5,Math.round(e*100)/100))}function ii(e){return`translate(${e.pan.x}px, ${e.pan.y}px) scale(${e.zoom})`}function ri(e,n){let t=e.cards[n];return t?`translate(${t.x}px, ${t.y}px)`:void 0}function si(e){return e.zoom!==1||e.pan.x!==0||e.pan.y!==0||Object.keys(e.cards).length>0}function Be(e){return e.querySelector(".board")}function ke(e){let n=Be(e);if(!n)return;let t=je(n.dataset.layoutKey??"default");n.style.transform=ii(t);for(let r of Array.from(n.querySelectorAll("[data-card]")))r.style.transform=ri(t,r.dataset.card??"")??"";e.classList.toggle("is-moved",si(t)),Ot(n)}function Ye(e,n){let t=Be(e);if(!t)return;let r=t.dataset.layoutKey??"default",s=je(r);s.zoom=Ut(s.zoom*n),ke(e),Rt(r)}function Ft(e){let n=Be(e);if(!n)return;let t=n.dataset.layoutKey??"default";lt.set(t,{pan:{x:0,y:0},zoom:1,cards:{}}),ke(e);try{localStorage.removeItem(ct(t))}catch{}}var Pt=new WeakSet;function zt(e,n){if(Ot=n,Pt.has(e)){ke(e);return}Pt.add(e);let t=null,r=0;e.addEventListener("pointerdown",a=>{if(a.button!==0)return;let l=a.target;if(l.closest("button, a, input, select, textarea, pre, form, iframe, .canvas-tools, .pr-checks, .shelf"))return;let o=Be(e);if(!o)return;let d=o.dataset.layoutKey??"default",u=je(d),c=l.closest("[data-card]"),p=c?.dataset.card??"";t={kind:c?"card":"pan",id:p,key:d,startX:a.clientX,startY:a.clientY,origin:c?{...u.cards[p]??{x:0,y:0}}:{...u.pan},moved:!1,pointer:a.pointerId,target:c??e}}),e.addEventListener("pointermove",a=>{if(!t||a.pointerId!==t.pointer)return;let l=a.clientX-t.startX,o=a.clientY-t.startY;if(!t.moved){if(Math.hypot(l,o)<4)return;t.moved=!0,e.setPointerCapture?.(t.pointer),e.classList.add("is-dragging"),t.target.classList.add("is-lifted")}let d=je(t.key);t.kind==="pan"?d.pan={x:Math.round(t.origin.x+l),y:Math.round(t.origin.y+o)}:d.cards[t.id]={x:Math.round(t.origin.x+l/d.zoom),y:Math.round(t.origin.y+o/d.zoom)},r||(r=requestAnimationFrame(()=>{r=0,ke(e)}))});let s=a=>{!t||a.pointerId!==t.pointer||(t.moved&&(e.releasePointerCapture?.(t.pointer),e.classList.remove("is-dragging"),t.target.classList.remove("is-lifted"),ke(e),Rt(t.key)),t=null)};e.addEventListener("pointerup",s),e.addEventListener("pointercancel",s),e.addEventListener("wheel",a=>{!a.ctrlKey&&!a.metaKey||(a.preventDefault(),Ye(e,a.deltaY<0?1.1:1/1.1))},{passive:!1}),ke(e)}var Q={claude:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgYXJpYS1oaWRkZW49InRydWUiPg0KICA8dGl0bGU+Q2xhdWRlIENvZGU8L3RpdGxlPg0KICA8cGF0aCBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yMC45OTggMTAuOTQ5SDI0djMuMTAyaC0zdjMuMDI4aC0xLjQ4N1YyMEgxOHYtMi45MjFoLTEuNDg3VjIwSDE1di0yLjkyMUg5VjIwSDcuNDg4di0yLjkyMUg2VjIwSDQuNDg3di0yLjkyMUgzVjE0LjA1SDBWMTAuOTVoM1Y1aDE3Ljk5OHY1Ljk0OXpNNiAxMC45NDloMS40ODhWOC4xMDJINnYyLjg0N3ptMTAuNTEgMEgxOFY4LjEwMmgtMS40OXYyLjg0N3oiIGZpbGw9IiNEOTc3NTciIGZpbGwtcnVsZT0iZXZlbm9kZCIgLz4NCjwvc3ZnPg0K",codex:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iIzI1NjNlYiIgZmlsbC1ydWxlPSJldmVub2RkIiBhcmlhLWhpZGRlbj0idHJ1ZSI+DQogIDx0aXRsZT5Db2RleDwvdGl0bGU+DQogIDxwYXRoIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTguMDg2LjQ1N2E2LjEwNSA2LjEwNSAwIDAxMy4wNDYtLjQxNWMxLjMzMy4xNTMgMi41MjEuNzIgMy41NjQgMS43YS4xMTcuMTE3IDAgMDAuMTA3LjAyOWMxLjQwOC0uMzQ2IDIuNzYyLS4y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NS42MzUgMi4zMUM2LjMxNSAxLjQ2NCA3LjEzMi44NDYgOC4wODYuNDU3em0tLjgwNCA3Ljg1YS44NDguODQ4IDAgMDAtMS40NzMuODQybDEuNjk0IDIuOTY1LTEuNjg4IDIuODQ4YS44NDkuODQ5IDAgMDAxLjQ2Ljg2NGwxLjk0LTMuMjcyYS44NDkuODQ5IDAgMDAuMDA3LS44NTRsLTEuOTQtMy4zOTN6bTUuNDQ2IDYuMjRhLjg0OS44NDkgMCAwMDAgMS42OTVoNC44NDhhLjg0OS44NDkgMCAwMDAtMS42OTZoLTQuODQ4eiIgLz4NCjwvc3ZnPg0K",gemini:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHJvbGU9ImltZyIgdmlld0JveD0iMCAwIDI0IDI0IiBhcmlhLWhpZGRlbj0idHJ1ZSI+DQogIDx0aXRsZT5HZW1pbmkgQ0xJPC90aXRsZT4NCiAgPHBhdGggZmlsbD0iIzQyODVGNCIgZD0iTTExLjA0IDE5LjMyUTEyIDIxLjUxIDEyIDI0cTAtMi40OS45My00LjY4Ljk2LTIuMTkgMi41OC0zLjgxdDMuODEtMi41NVEyMS41MSAxMiAyNCAxMnEtMi40OSAwLTQuNjgtLjkzYTEyLjMgMTIuMyAwIDAgMS0zLjgxLTIuNTggMTIuMyAxMi4zIDAgMCAxLTIuNTgtMy44MVExMiAyLjQ5IDEyIDBxMCAyLjQ5LS45NiA0LjY4LS45MyAyLjE5LTIuNTUgMy44MWExMi4zIDEyLjMgMCAwIDEtMy44MSAyLjU4UTIuNDkgMTIgMCAxMnEyLjQ5IDAgNC42OC45NiAyLjE5LjkzIDMuODEgMi41NXQyLjU1IDMuODEiLz4NCjwvc3ZnPg0K"};var J=new Set(["succeeded","partially_completed","failed","cancelled","interrupted"]),Ht=600;function ai(e){let n=e.trim().toLowerCase();return/^(?:please\s+)?(?:show|run|start|open|launch)\s+(?:me\s+)?(?:my\s+|the\s+)?(?:app|preview|site)\b\.?$/.test(n)?"preview.start":/^(?:please\s+)?fix\s+(?:the\s+|my\s+|all\s+)?(?:findings?|blockers?|issues?)\b\.?$/.test(n)?"findings.fix":"app.change"}function Bt(e,n){let t=null,r=null,s=()=>e.get().work;async function a(){try{let f=await L.actions(e.get().cliId);e.work({offers:f.actions,facts:f.facts,preview:f.preview}),f.activeRunId&&f.activeRunId!==s().run?.id&&await u(f.activeRunId)}catch{}}async function l(){try{e.work({history:(await L.runs()).runs})}catch{}}function o(f){let g=e.get().work.run;g&&g.id!==f.run.id||e.work(w=>{let b=w.run?.id===f.run.id,M=b?w.cursor:0,$=f.events.filter(y=>y.seq>M);return{run:f.run,events:[...b?w.events:[],...$].slice(-300),cursor:$.length?$[$.length-1].seq:M}})}async function d(f){if(t!==f){t=f;try{for(;s().run?.id===f;){let g;try{g=await L.run(f,s().cursor)}catch{await new Promise(b=>window.setTimeout(b,Ht*2));continue}let w=s().run?.state;if(o(g),g.events.some(b=>b.type==="preview.refreshed"||b.type==="preview.ready")&&await c(),J.has(g.run.state)){w&&!J.has(w)&&(await Promise.all([a(),l(),c()]),g.run.changes.length&&await n.refreshProject().catch(()=>{}));break}await new Promise(b=>window.setTimeout(b,Ht))}}finally{t===f&&(t=null)}}}async function u(f){let g=await L.run(f,0);e.work({run:g.run,events:g.events,cursor:g.events.at(-1)?.seq??0,plan:null,diff:null,error:null}),n.goToStep("work"),J.has(g.run.state)||d(f)}async function c(){try{let f=await L.preview();e.work({preview:f}),f.state==="starting"&&p()}catch{}}function p(){r===null&&(r=window.setTimeout(()=>{r=null,c()},900))}let h={async loadWork(){await Promise.all([a(),l()])},setRequest(f){e.get().work.request=f},async submitRequest(f){let g=f.trim();if(!g){document.getElementById("shelf-input")?.focus();return}let w=ai(g);if(w==="findings.fix"){n.goToStep("findings");return}await h.planAction(w,w==="app.change"?g:void 0)},runOffer(f){if(f.id==="findings.fix"){n.goToStep("findings");return}if(f.id==="agent.connect"||f.unblock==="connect-agent"){n.openAgents();return}if(f.id==="app.change"){n.openCatalog(!1),queueMicrotask(()=>document.getElementById("shelf-input")?.focus());return}f.availability==="ready"&&(n.openCatalog(!1),h.planAction(f.id))},async planAction(f,g){let w=e.get();if(w.work.run&&!J.has(w.work.run.state)){n.goToStep("work");return}e.work({busy:!0,error:null});try{let{plan:b}=await L.planAction({actionId:f,request:g,cliId:w.cliId,accessMode:w.accessMode,modelId:w.modelId||void 0});e.work({plan:{actionId:f,request:g,plan:b},run:null,events:[],cursor:0,diff:null,gallery:null,selectedPart:null}),n.goToStep("work"),queueMicrotask(()=>document.getElementById("work-start")?.focus({preventScroll:!0}))}catch(b){e.toast(b instanceof Error?b.message:String(b),"err")}finally{e.work({busy:!1})}},async setWorkAccess(f){n.setAccessMode(f);let g=s().plan;g&&await h.planAction(g.actionId,g.request)},async startPlanned(){let f=s().plan,g=e.get();if(!(!f||g.work.busy)&&!(f.actionId==="app.change"&&!g.probes[g.cliId]?.ready&&(await n.testConnection(),!e.get().probes[e.get().cliId]?.ready))){e.work({busy:!0,error:null});try{let w=await L.startRun({actionId:f.actionId,request:f.request,cliId:g.cliId,accessMode:g.accessMode,modelId:g.modelId||void 0,planRevision:f.plan.revision});e.work({plan:null,run:w.run,events:w.events,cursor:w.events.at(-1)?.seq??0,request:f.actionId==="app.change"?"":s().request,selectedPart:null}),d(w.run.id),f.actionId==="preview.start"&&p()}catch(w){let b=w instanceof Error?w.message:String(w);e.work({error:b}),/plan changed/i.test(b)&&await h.planAction(f.actionId,f.request)}finally{e.work({busy:!1})}}},async cancelRun(){let f=s().run;if(!(!f||J.has(f.state)))try{await L.cancelRun(f.id)}catch(g){e.toast(g instanceof Error?g.message:String(g),"err")}},closeWork(){e.work({plan:null,diff:null,error:null,gallery:null,selectedPart:null,...s().run&&!J.has(s().run.state)?{}:{run:null,events:[],cursor:0}}),n.goToStep("app")},newChange(){e.work({plan:null,run:null,events:[],cursor:0,diff:null,error:null,gallery:null,selectedPart:null}),n.goToStep("app"),queueMicrotask(()=>document.getElementById("shelf-input")?.focus())},async showDiff(){let f=s().run;if(f){if(s().diff?.runId===f.id){e.work({diff:null});return}try{e.work({diff:{runId:f.id,files:(await L.runDiff(f.id)).files}})}catch(g){e.toast(g instanceof Error?g.message:String(g),"err")}}},async undoRun(){let f=s().run;if(f)try{let g=await L.revertRun(f.id);g.run&&e.work({run:g.run,diff:null}),e.toast(g.skipped.length?`Put back ${g.restored.length} file${g.restored.length===1?"":"s"}. ${g.skipped.length} left as ${g.skipped.length===1?"it is":"they are"}: Review shows why.`:`Put back ${g.restored.length} file${g.restored.length===1?"":"s"}.`,g.skipped.length?"err":"ok"),await Promise.all([c(),n.refreshProject().catch(()=>{}),l()])}catch(g){e.toast(g instanceof Error?g.message:String(g),"err")}},async restoreFile(f){let g=s().run;if(g)try{let w=await L.restoreFile(g.id,f);e.work({run:w.run??g,diff:{runId:g.id,files:(await L.runDiff(g.id)).files}}),e.toast(`Put back ${f.split("/").pop()}. A copy of it as it was is kept with the run.`,"ok"),await Promise.all([c(),n.refreshProject().catch(()=>{})])}catch(w){e.toast(w instanceof Error?w.message:String(w),"err")}},async stopPreview(){try{e.work({preview:await L.stopPreview(),previewExpanded:!1}),await a()}catch(f){e.toast(f instanceof Error?f.message:String(f),"err")}},reloadPreview(){let f=document.getElementById("app-frame");f&&(f.src=f.src)},selectPart(f){e.work({selectedPart:s().selectedPart===f?null:f})},showGallery(f,g,w){if(s().run&&!J.has(s().run.state)){n.goToStep("work");return}n.openCatalog(!1),e.work({gallery:{kind:f,phase:g,provider:w},plan:null,run:null,events:[],cursor:0,diff:null,selectedPart:null}),n.goToStep("work")},async resumeRun(){let f=s().run;if(!(!f||f.state!=="waiting_for_user"||s().busy)){e.work({busy:!0});try{o(await L.resumeRun(f.id));let g=s().run;g&&!J.has(g.state)?d(g.id):await Promise.all([a(),l(),c()])}catch(g){e.toast(g instanceof Error?g.message:String(g),"err")}finally{e.work({busy:!1})}}},toggleCatalog(f){n.openCatalog(f??e.get().drawer!=="actions")},togglePreviewExpanded(f){let g=f??!s().previewExpanded;e.work({previewExpanded:g}),queueMicrotask(()=>document.getElementById(g?"preview-collapse":"preview-expand")?.focus({preventScroll:!0}))}};return h}function ee(e){return e!==void 0&&J.has(e)}var C=24,oe=.8660254,le=.5,Yt={x:470,y:120},W=null;function v(e,n,t){let r=[Yt.x+(e-n)*oe*C,Yt.y+(e+n)*le*C-t*C];return W&&(W.x0=Math.min(W.x0,r[0]),W.x1=Math.max(W.x1,r[0]),W.y0=Math.min(W.y0,r[1]),W.y1=Math.max(W.y1,r[1])),r}function U(e){return e.map(([n,t])=>`${n.toFixed(1)},${t.toFixed(1)}`).join(" ")}function m(e){return e.toFixed(1)}function j(e,n,t,r){let[s,a]=v(n,t,r);return e==="front"?`matrix(${m(oe*C)} ${m(le*C)} 0 ${C} ${m(s)} ${m(a)})`:e==="side"?`matrix(${m(oe*C)} ${m(-le*C)} 0 ${C} ${m(s)} ${m(a)})`:`matrix(${m(oe*C)} ${m(le*C)} ${m(-oe*C)} ${m(le*C)} ${m(s)} ${m(a)})`}function S(e,n,t,r,s,a,l){let o=[v(e,n,t+a),v(e+r,n,t+a),v(e+r,n+s,t+a),v(e,n+s,t+a)],d=[v(e,n+s,t+a),v(e+r,n+s,t+a),v(e+r,n+s,t),v(e,n+s,t)],u=[v(e+r,n,t+a),v(e+r,n+s,t+a),v(e+r,n+s,t),v(e+r,n,t)],c=U([v(e,n+s,t+a),v(e+r,n+s,t+a),v(e+r,n,t+a)]);return`<g class="box ${l}"><polygon class="f-left" points="${U(d)}"/><polygon class="f-right" points="${U(u)}"/><polygon class="f-top" points="${U(o)}"/><polyline class="edge" points="${c}"/></g>`}function oi(e,n,t,r,s,a,l=0){let[o,d]=v(e,n,t+s),u=r*C*1.2247,c=r*C*.7071,p=d+s*C;return`<g class="cyl ${a}" style="animation-delay:${l}ms"><path class="f-left" d="M${m(o-u)} ${m(d)} L${m(o-u)} ${m(p)} A${m(u)} ${m(c)} 0 0 0 ${m(o+u)} ${m(p)} L${m(o+u)} ${m(d)} Z"/><ellipse class="f-top" cx="${m(o)}" cy="${m(d)}" rx="${m(u)}" ry="${m(c)}"/></g>`}function Z(e,n,t,r,s=0){return`<polygon class="shadow" points="${U([v(e+.3,n+.3,s),v(e+t+.5,n+.3,s),v(e+t+.5,n+r+.6,s),v(e+.3,n+r+.6,s)])}"/>`}function ce(e,n,t=2){let[r,s]=v(...e),[a,l]=v(...n),o=(r+a)/2,d=Math.min(s,l)-t*C;return`M${m(r)} ${m(s)} Q${m(o)} ${m(d)} ${m(a)} ${m(l)}`}function Te(e){return e.map((n,t)=>`${t?"L":"M"}${m(v(...n)[0])} ${m(v(...n)[1])}`).join(" ")}function qe(e,n,t,r,s=""){let[a,l]=v(e,n,t),o=Math.max(26,r.length*5.6+14);return`<g class="tag ${s}" transform="translate(${m(a)} ${m(l)})"><rect x="${m(-o/2)}" y="-9.5" width="${m(o)}" height="18" rx="9"/><text x="0" y="3.2" text-anchor="middle">${dt(r)}</text></g>`}function dt(e){return e.replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n])}var Gt=/d="([^"]+)"/.exec(He)?.[1]??"",li="data:image/svg+xml;base64,"+Wt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path fill="#EA4335" d="M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"/><path fill="#4285F4" d="M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"/><path fill="#FBBC05" d="M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"/><path fill="#34A853" d="M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"/></svg>');function Wt(e){return btoa(e)}function ne(e,n,t,r,s,a,l,o){let d=[];for(let h=1;h<r;h+=1)d.push(`<path class="grid" d="M${h} 0 L${h} ${s}"/>`);for(let h=1;h<s;h+=1)d.push(`<path class="grid" d="M0 ${h} L${r} ${h}"/>`);let u=Gt&&!o?`<g transform="${j("front",n+.5,t+s,.62)}"><g transform="scale(0.00105 0.00105) translate(0 -620)"><path class="raven" d="${Gt}"/></g></g>`:"",c=o?`<g transform="${j("front",n+.45,t+s,.62)}"><image href="${o}" x="0" y="-0.55" width="0.5" height="0.5"/></g>`:"",p=U([v(n,t+s,.7),v(n,t,.7),v(n+r,t,.7),v(n+r,t+s,.7),v(n,t+s,.7)]);return{id:e,label:a,state:l,svg:`${S(n,t,0,r,s,.7,"ground")}<g transform="${j("top",n,t,.7)}" class="grid-lines">${d.join("")}</g><polyline class="rim" points="${p}"/>${u}${c}<g transform="${j("front",n+(o?1.25:1.7),t+s,.7)}"><text class="ground-label" x="0" y="0.47">${dt(a.toUpperCase())}</text></g>`}}function ci(e,n,t,r,s,a,l,o){let c=`<rect class="win-face" x="0" y="0" width="${r}" height="${s}" rx="0.18"/><rect class="win-bar" x="0" y="0" width="${r}" height="0.62" rx="0.18"/><circle class="dot" cx="0.42" cy="0.31" r="0.1"/><circle class="dot" cx="0.74" cy="0.31" r="0.1"/><circle class="dot" cx="1.06" cy="0.31" r="0.1"/><rect class="win-url" x="1.5" y="0.17" width="${Math.max(1,r-2.3)}" height="0.28" rx="0.14"/>`;return{id:e,label:o,state:a,svg:`${Z(n,t,r,.32,.7)}${S(n,t,.7,r,.32,s,"frame")}<g transform="${j("front",n,t+.32,.7+s)}" class="win">${c}<g class="win-content">${l}</g><rect class="win-outline" x="0" y="0" width="${r}" height="${s}" rx="0.18" pathLength="1"/></g>`}}function te(e,n="0 0 24 24"){return`data:image/svg+xml;base64,${Wt(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${n}">${e}</svg>`)}`}var pe='fill="none" stroke="#f5f5f7" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"',ae={code:te(`<path ${pe} d="M8.5 7 3.5 12l5 5M15.5 7l5 5-5 5"/>`),tests:te(`<path ${pe} d="M9 3h6M10 3v6l-5 9a2 2 0 0 0 1.7 3h10.6a2 2 0 0 0 1.7-3l-5-9V3M7.5 15h9"/>`),page:te(`<path ${pe} d="M6 3h8.5L19 7.5V21H6zM14 3v5h5M9 12.5h7M9 16.5h5"/>`),preview:te(`<path ${pe} d="M3 5h18v12H3zM9 21h6M12 17v4"/><path fill="#f5f5f7" d="M10 8.5v5l4.3-2.5z"/>`),check:te(`<path ${pe} d="M4.5 12.5l4.5 4.5 10-10"/>`),user:te(`<circle ${pe} cx="12" cy="8" r="3.6"/><path ${pe} d="M4.8 20c.9-3.6 3.8-5.6 7.2-5.6s6.3 2 7.2 5.6"/>`)},di=te('<rect width="24" height="24" rx="4" fill="#CB3837"/><path fill="#fff" d="M5 7h14v10h-3.5V10.5h-3V17H5z"/>'),ui=te('<circle cx="12" cy="12" r="11" fill="#000" stroke="#f5f5f7" stroke-width="1.2"/><path d="M8.4 16.8V7.2l8.4 11.4" fill="none" stroke="#f5f5f7" stroke-width="1.7" stroke-linejoin="round"/><path d="M15.6 7.2v6.6" stroke="#f5f5f7" stroke-width="1.7"/>'),pi=te('<path fill="#bd34fe" d="M21.5 3.5 12.6 21a.6.6 0 0 1-1.1 0L2.5 3.5a.6.6 0 0 1 .6-.8l8.8 1.6h.2l8.8-1.6a.6.6 0 0 1 .6.8z"/><path fill="#ffd62e" d="M16.2 2.3 9.6 3.6a.3.3 0 0 0-.2.3l-.4 6.8a.3.3 0 0 0 .3.3l1.8-.4a.3.3 0 0 1 .4.4l-.5 2.6a.3.3 0 0 0 .4.3l1.1-.3a.3.3 0 0 1 .4.3l-.9 4.2c0 .3.3.4.5.2l.1-.2 3.9-7.8a.3.3 0 0 0-.3-.4l-1.9.4a.3.3 0 0 1-.3-.4l1.2-4.3a.3.3 0 0 0-.3-.4z"/>'),gi={claude:"#D97757",codex:"#2563eb",gemini:"#4285F4"};function hi(e){return e==="Next.js"?ui:e==="Vite"?pi:ae.code}function fi(e){return/type/i.test(e)?ae.code:/test/i.test(e)?ae.tests:/page|load|answer/i.test(e)?ae.page:/sign|user|owner|other/i.test(e)?ae.user:ae.check}function Ke(e){let{x:n,y:t,size:r}=e,s=e.h??.5,a=e.grounded?.7:e.z??1.5,l=r*.5,o=n+(r-l)/2,d=t+(r-l)/2,[u,c]=v(n+r/2,t+r/2,.7),p=r*.68,h=(r-p)/2,f=p*.62,g=e.grounded?Z(n,t,r,r,.7):`<ellipse class="shadow soft" cx="${m(u)}" cy="${m(c)}" rx="${m(r*.85*C)}" ry="${m(r*.48*C)}"/>${e.floating?"":S(o,d,.7,l,l,Math.max(.2,a-.7-.25),"pedestal")}`;return`<g class="unit-wrap ${e.cls??""}" style="--brand:${e.brand??"rgba(255,255,255,0.35)"}">${g}<g class="${e.grounded?"still":"hover"}">${S(n,t,a,r,r,s,"unit")}<g transform="${j("top",n,t,a+s)}"><rect class="unit-plate" x="${m(h)}" y="${m(h)}" width="${m(p)}" height="${m(p)}" rx="${m(p*.22)}"/><rect class="unit-ring" x="${m(h)}" y="${m(h)}" width="${m(p)}" height="${m(p)}" rx="${m(p*.22)}"/><image href="${e.mark}" x="${m(h+(p-f)/2)}" y="${m(h+(p-f)/2)}" width="${m(f)}" height="${m(f)}"/></g><g transform="${j("front",n,t+r,a+s)}"><rect class="unit-led" x="${m(r*.18)}" y="${m(s*.42)}" width="${m(r*.64)}" height="0.11" rx="0.055"/></g></g></g>`}function mi(e,n,t,r,s,a,l,o="#D97757",d=!1,u=!1){let c=Ke({x:n,y:t,size:1.8,z:r,h:.55,mark:a,brand:o,floating:!0});return{id:e,label:l,state:s,svg:d&&!u?c.replace(/<\/g><\/g>$/,`${Vt(n+.1,t+.55,r+.55)}</g></g>`):c}}function wi(e,n,t,r,s){return{id:e,label:s,state:r,svg:`${Ke({x:n,y:t,size:1.25,z:1.6,h:.42,mark:fi(s)})}${qe(n+.62,t+.62,3.05,s,"tag-check")}`}}function Y(e,n,t,r){return{id:e,label:r,state:t,svg:`<path class="pipe-base" d="${n}"/><path class="pipe" d="${n}" pathLength="1"/><path class="pipe-flow" d="${n}"/>`}}function We(e,n,t,r,s,a){if(!s)return`<circle class="token ${n}" r="5" cx="0" cy="0"><animateMotion dur="0.01s" fill="freeze" path="${e}" keyPoints="${a??1};${a??1}" keyTimes="0;1" calcMode="linear"/></circle>`;let l=a!==void 0?`keyPoints="0;${a};${a}" keyTimes="0;0.7;1" calcMode="linear"`:"";return`<g class="token-g ${n}"><circle class="token-halo" r="9"/><circle class="token" r="4.5"/><animateMotion dur="${t}s" ${r?'repeatCount="indefinite"':'fill="freeze"'} ${l} path="${e}"/></g>`}function yi(e,n,t,r){return{id:e,label:"Live preview",state:r,svg:`${Ke({x:n,y:t,size:1.2,z:1.25,h:.4,mark:ae.preview,brand:"#6fd08c"})}${qe(n+.6,t+.6,3.15,r==="done"?"LIVE":"PREVIEW","tag-port")}`}}function ut(e,n,t,r,s,a,l){let o=[],d=[];for(let h=0;h<3;h+=1){if(h>=s&&r!=="planned")continue;let f=.7+h*.95;if(o.push(oi(n,t,f,1.55,.75,`layer${h<s?"":" ghost"}`,h*160)),h<s){let[g,w]=v(n,t,f+.75),b=1.55*C*1.2247,M=1.55*C*.7071;d.push(`<path class="seam" style="animation-delay:${h*200}ms" d="M${m(g-b)} ${m(w+.18*C)} A${m(b)} ${m(M)} 0 0 0 ${m(g+b)} ${m(w+.18*C)}"/>`)}}let u=.7+Math.min(Math.max(s,1),3)*.95-.2,c=[];for(let h=0;h<a;h+=1)c.push(`<rect class="table" x="${-.95+h%2*1}" y="${-.95+Math.floor(h/2)*1}" width="0.85" height="0.85" rx="0.12" style="animation-delay:${h*140}ms"/>`);let p=s?`<g transform="${j("front",n-.45,t+1.35,1.55)}"><rect class="brand-badge" x="0" y="0" width="0.9" height="0.9" rx="0.22"/><image href="${l}" x="0.17" y="0.17" width="0.56" height="0.56"/></g>`:"";return{id:e,label:"Supabase database",state:r,svg:`<g class="brand-supabase" style="--brand:#3ECF8E">${Z(n-1.6,t-1.6,3.2,3.2,.7)}${o.join("")}${d.join("")}<g transform="${j("top",n,t,u)}">${c.join("")}</g>${p}</g>`}}function bi(e,n,t,r,s,a){let l=s==="github"?["g-dark","g-light"]:["g-blue","g-green"],o=u=>{let[c,p]=Zt(u,0,0);return`${m(c)} ${m(p)}`},d=(u,c)=>{let p=a==="cycle"?`<animateTransform attributeName="transform" type="translate" values="0 0;0 0;${o(u)};${o(u)};0 0;0 0" keyTimes="0;0.16;0.28;0.5;0.62;1" calcMode="spline" keySplines="0 0 1 1;0.4 0 0.2 1;0 0 1 1;0.4 0 0.2 1;0 0 1 1" dur="3.6s" repeatCount="indefinite"/>`:"";return`<g${a==="open"?` transform="translate(${o(u)})"`:""}>${S(c,t+.28,.7,.9,.12,2.5,`door ${s}`)}${p}</g>`};return{id:e,label:s==="github"?"GitHub sign-in gateway":"Google sign-in gateway",state:r,svg:`<g class="brand-${s}" style="--brand:${s==="github"?"#f0f6fc":"#4285F4"}">${Z(n,t,3,.8,.7)}${S(n,t,.7,.6,.7,2.6,"pillar")}${d(-.82,n+.6)}${d(.82,n+1.5)}${S(n+2.4,t,.7,.6,.7,2.6,"pillar")}${S(n-.02,t-.02,3.3,.64,.74,.16,`cap ${l[0]}`)}${S(n+2.38,t-.02,3.3,.64,.74,.16,`cap ${l[1]}`)}${S(n-.1,t-.05,3.46,3.2,.8,.6,"lintel")}${qt(`gate-${s}`,ie(s),n+.85,t+.5,4.06,1.5)}</g>`}}function vi(e,n,t,r){return{id:e,label:"Access rule",state:r,svg:`${S(n,t,.7,.35,1.8,1.1,"bar")}<g transform="${j("side",n+.35,t,1.8)}"><path class="bar-stripes" d="M0.2 0.2 L0.6 0.9 M0.7 0.2 L1.1 0.9 M1.2 0.2 L1.6 0.9"/></g>`}}function ki(e,n,t,r,s,a,l,o){let d=ne(e,n,t,r,s,a,l,o),u=2.2,c=n+(r-u)/2,p=t+(s-u)/2-.3,h=v(c+u/2,p+u/2,.7+2.4),f=U([v(c,p+u,.7),v(c+u,p+u,.7),h]),g=U([v(c+u,p,.7),v(c+u,p+u,.7),h]),w=`<g class="pyramid">${Z(c,p,u,u,.7)}<polygon class="f-left" points="${f}"/><polygon class="f-right" points="${g}"/><polyline class="edge" points="${U([v(c,p+u,.7),h,v(c+u,p,.7)])}"/></g>`;return{...d,svg:`<g class="pad brand-vercel" style="--brand:#f5f5f7">${d.svg}${w}</g>`}}function Mi(e,n,t,r){return{id:e,label:"GitHub repository",state:r,svg:`<g class="brand-github" style="--brand:#f0f6fc">${Z(n,t,2.1,1.7,.7)}${S(n,t,.7,2.1,1.7,1.5,"vault")}<g transform="${j("top",n,t,2.2)}"><rect class="unit-plate" x="0.35" y="0.25" width="1.2" height="1.2" rx="0.28"/><rect class="unit-ring" x="0.35" y="0.25" width="1.2" height="1.2" rx="0.28"/><image href="${X.github}" x="0.6" y="0.5" width="0.7" height="0.7"/></g><g transform="${j("front",n,t+1.7,2.2)}"><g class="gitgraph"><path d="M0.25 0.55 H1.85"/><path class="branch" d="M0.65 0.55 C0.9 0.55 0.9 1.05 1.15 1.05 H1.55"/><circle cx="0.35" cy="0.55" r="0.09"/><circle cx="0.8" cy="0.55" r="0.09"/><circle cx="1.3" cy="0.55" r="0.09"/><circle class="tip" cx="1.8" cy="0.55" r="0.1"/><circle class="branch-dot" cx="1.5" cy="1.05" r="0.09"/></g></g></g>`}}function Vt(e,n,t,r=.066){let a=(o,d,u,c,p)=>S(e+o*r,n,t+(20-c)*r,(d-o)*r,.55,(c-u)*r,p),l=`<g transform="${j("front",e+3*r,n+.55,t+15*r)}"><rect class="cc-eye" x="${m(3*r)}" y="${m(3.0999999999999996*r)}" width="${m(1.49*r)}" height="${m(2.85*r)}"/><rect class="cc-eye" x="${m(13.510000000000002*r)}" y="${m(3.0999999999999996*r)}" width="${m(1.49*r)}" height="${m(2.85*r)}"/></g>`;return`<g class="critter"><g class="cc-legs a">${a(4.49,6,17,20,"cc cc-leg")}${a(15,16.51,17,20,"cc cc-leg")}</g><g class="cc-legs b">${a(7.49,9,17,20,"cc cc-leg")}${a(18,19.51,17,20,"cc cc-leg")}</g><g class="cc-torso">${a(0,3,10.95,14.05,"cc")}${a(3,21,5,17,"cc")}${a(21,24,10.95,14.05,"cc")}${l}</g></g>`}function Li(e,n=7,t=1.3){let r=[];for(let s=0;s<n;s+=1){let a=e[0]-150+s*46,l=e[1]-190-s%3*18,o=`M${m(a)} ${m(l)} Q${m((a+e[0])/2+(s%2?40:-30))} ${m(l+30)} ${m(e[0])} ${m(e[1])}`;r.push(`<g class="tok"><rect x="-4" y="-4" width="8" height="8" rx="2"/><animateMotion dur="${t}s" begin="${m(-s*(t/n))}s" repeatCount="indefinite" path="${o}"/><animate attributeName="opacity" values="0;1;1;0" keyTimes="0;0.15;0.85;1" dur="${t}s" begin="${m(-s*(t/n))}s" repeatCount="indefinite"/></g>`)}return`<g class="hype tokens">${r.join("")}</g>`}function Zt(e,n,t){return[(e-n)*oe*C,(e+n)*le*C-t*C]}function Qe(e,n){let t=e.replace("#",""),r=t.length===3?t.split("").map(l=>l+l).join(""):t;return`rgb(${[0,2,4].map(l=>parseInt(r.slice(l,l+2),16)).map(l=>n<=1?Math.round(l*n):Math.round(l+(255-l)*(n-1))).join(",")})`}function V(e,n,t,r,s=""){let a=(h,f,g)=>Zt(h-e/2,f-n/2,g),l=[a(0,0,t),a(e,0,t),a(e,n,t),a(0,n,t)],o=[a(0,n,t),a(e,n,t),a(e,n,0),a(0,n,0)],d=[a(e,0,t),a(e,n,t),a(e,n,0),a(e,0,0)],[u,c]=a(0,0,t),p=s?`<g transform="matrix(${m(oe*C)} ${m(le*C)} ${m(-oe*C)} ${m(le*C)} ${m(u)} ${m(c)})">${s}</g>`:"";return`<polygon points="${U(o)}" fill="${Qe(r,.72)}"/><polygon points="${U(d)}" fill="${Qe(r,.52)}"/><polygon points="${U(l)}" fill="${Qe(r,1.12)}"/>${p}<polyline points="${U([a(0,n,t),a(e,n,t),a(e,0,t)])}" fill="none" stroke="rgba(255,255,255,0.45)" stroke-width="0.8"/>`}function xi(e,n,t=0){switch(e){case"card":return V(.95,.62,.09,"#635BFF",'<rect x="0.06" y="0.14" width="0.83" height="0.09" fill="rgba(255,255,255,0.75)"/><rect x="0.12" y="0.34" width="0.18" height="0.14" rx="0.03" fill="#f2c15f"/>');case"envelope":return V(.95,.62,.1,"#f2f2f5",'<path d="M0.05 0.05 L0.475 0.36 L0.9 0.05" fill="none" stroke="#9b9ba5" stroke-width="0.04"/>');case"app":return V(.72,.72,.5,"#2c2c34",'<rect x="0.08" y="0.08" width="0.56" height="0.56" rx="0.06" fill="#0e0e12"/><circle cx="0.16" cy="0.16" r="0.03" fill="#f4715f"/><circle cx="0.24" cy="0.16" r="0.03" fill="#f2c15f"/><rect x="0.14" y="0.28" width="0.44" height="0.08" rx="0.03" fill="rgba(255,255,255,0.35)"/>');case"user":return V(.46,.46,.46,"#f5f5f7",'<circle cx="0.23" cy="0.18" r="0.07" fill="#55555f"/><path d="M0.1 0.38 Q0.23 0.22 0.36 0.38" fill="#55555f"/>');case"commit":return V(.44,.44,.44,"#3fb950",'<circle cx="0.22" cy="0.22" r="0.08" fill="none" stroke="#0d1117" stroke-width="0.05"/>');case"event":return V(.42,.42,.42,["#F54E00","#F9BD2B","#1D4AFF"][t%3]);case"record":return V(.5,.5,.36,n,'<rect x="0.08" y="0.12" width="0.34" height="0.06" fill="rgba(255,255,255,0.55)"/><rect x="0.08" y="0.26" width="0.24" height="0.06" fill="rgba(255,255,255,0.35)"/>');default:return V(.48,.48,.48,n)}}function Ne(e,n,t,r={}){let s=r.count??2,a=r.dur??3.2,l=r.travel??.55,o=[];for(let d=0;d<s;d+=1){let u=`${m(-d*(a/s))}s`;o.push(`<g class="pl"><g>${xi(n,t,d)}</g><animateMotion dur="${a}s" begin="${u}" repeatCount="indefinite" path="${e}" keyPoints="0;1;1" keyTimes="0;${l};1" calcMode="spline" keySplines="0.45 0 0.25 1;0 0 1 1"/><animate attributeName="opacity" values="0;1;1;0;0" keyTimes="0;0.06;${m(l-.03)};${l};1" dur="${a}s" begin="${u}" repeatCount="indefinite"/></g>`),r.landing&&o.push(r.landing(u))}return`<g class="hype">${o.join("")}</g>`}function Le(e,n,t,r,s,a=34){let l=Math.min(r+.22,.99);return`<ellipse cx="${m(e[0])}" cy="${m(e[1])}" rx="${a*.4}" ry="${m(a*.4*.42)}" fill="none" stroke="${s}" stroke-width="2" opacity="0"><animate attributeName="rx" values="${a*.4};${a*.4};${a};${a}" keyTimes="0;${r};${m(l)};1" dur="${t}s" begin="${n}" repeatCount="indefinite"/><animate attributeName="ry" values="${m(a*.4*.42)};${m(a*.4*.42)};${m(a*.42)};${m(a*.42)}" keyTimes="0;${r};${m(l)};1" dur="${t}s" begin="${n}" repeatCount="indefinite"/><animate attributeName="opacity" values="0;0;0.9;0;0" keyTimes="0;${r};${m(r+.02)};${m(l)};1" dur="${t}s" begin="${n}" repeatCount="indefinite"/></ellipse>`}function qt(e,n,t,r,s,a,l=.28,o=10){let d=[];for(let p=o-1;p>=0;p-=1){let h=l*p/(o-1);d.push(`<g transform="${j("front",t,r-h,s+a)}"><image class="${p===0?"emb-face":"emb-side"}" href="${n}" x="0" y="0" width="${a}" height="${a}"/></g>`)}let u=`emb-${e.replace(/[^a-z0-9-]/gi,"")}`,c=`<g transform="${j("front",t,r,s+a)}"><mask id="${u}" maskUnits="userSpaceOnUse" x="-1" y="-1" width="${a+2}" height="${a+2}" style="mask-type:alpha"><image href="${n}" x="0" y="0" width="${a}" height="${a}"/></mask><g mask="url(#${u})"><rect class="emb-sheen" x="${m(-a*.6)}" y="0" width="${m(a*.45)}" height="${a}"><animateTransform attributeName="transform" type="translate" values="0 0;${m(a*1.9)} 0;${m(a*1.9)} 0" keyTimes="0;0.3;1" dur="4.8s" repeatCount="indefinite"/></rect></g></g>`;return`<g class="emblem">${d.join("")}${c}</g>`}function Kt(e,n,t,r,s,a,l,o=1.5){let d=o+.5,u=`${Z(r,s,d,1.25,.7)}${S(r,s,.7,d,1.25,.34,"plinth")}<g transform="${j("front",r,s+1.25,1.04)}"><rect class="unit-led" x="${m(d*.15)}" y="0.13" width="${m(d*.7)}" height="0.09" rx="0.045"/></g>`;return{id:e,label:n,state:t,svg:`<g class="unit-wrap emblem-unit" style="--brand:${l}">${u}<g class="emb-float">${qt(e,a,r+.25,s+.8,1.06,o)}</g></g>`}}var ge={supabase:{name:"Supabase",brand:"#3ECF8E",payload:"record",verb:"Records reach the database"},vercel:{name:"Vercel",brand:"#f5f5f7",payload:"app",verb:"The app reaches Vercel"},github:{name:"GitHub",brand:"#f0f6fc",payload:"commit",verb:"Commits reach the repository"},stripe:{name:"Stripe",brand:"#635BFF",payload:"card",verb:"A test payment reaches Stripe"},sentry:{name:"Sentry",brand:"#8B5CF6",payload:"event",verb:"A test error reaches Sentry"},posthog:{name:"PostHog",brand:"#F54E00",payload:"event",verb:"Events reach PostHog"},clerk:{name:"Clerk",brand:"#6C47FF",payload:"user",verb:"A test user signs in with Clerk"},authjs:{name:"Auth.js",brand:"#a855f7",payload:"user",verb:"A test user signs in"},resend:{name:"Resend",brand:"#f5f5f7",payload:"envelope",verb:"A test email reaches Resend"},upstash:{name:"Upstash",brand:"#00E9A3",payload:"record",verb:"Keys reach Redis"},neon:{name:"Neon",brand:"#00E599",payload:"record",verb:"Rows reach Postgres"},railway:{name:"Railway",brand:"#f5f5f7",payload:"app",verb:"The app reaches Railway"},render:{name:"Render",brand:"#f5f5f7",payload:"app",verb:"The app reaches Render"},cloudflare:{name:"Cloudflare",brand:"#F38020",payload:"cube",verb:"Traffic reaches the edge"},google:{name:"Google",brand:"#4285F4",payload:"user",verb:"A test user signs in with Google"}};function ie(e){return e==="google"?li:X[e]??ae.check}function Ve(e){return e.map(n=>n.toFixed(3)).join(";")}function N(e,n,t,r){return e.startsWith("transform-")?`<animateTransform attributeName="transform" type="${e.slice(10)}" values="${n.join(";")}" keyTimes="${Ve(t)}" dur="${r}s" repeatCount="indefinite"/>`:`<animate attributeName="${e}" values="${n.join(";")}" keyTimes="${Ve(t)}" dur="${r}s" repeatCount="indefinite"/>`}function Ze(e,n,t,r,s){return`<g transform="translate(${m(e[0])} ${m(e[1])})"><g>${N("transform-scale",n.map(a=>`${a} ${a}`),t,r)}<g transform="translate(${m(-e[0])} ${m(-e[1])})">${s}</g></g></g>`}function se(e,n){return`${m(n[0]-e[0])} ${m(n[1]-e[1])}`}function Me(e,n,t,r=7){let s=`M0 ${-r} L${r*.25} ${-r*.25} L${r} 0 L${r*.25} ${r*.25} L0 ${r} L${-r*.25} ${r*.25} L${-r} 0 L${-r*.25} ${-r*.25} Z`,a=Math.max(.001,n-.02),l=Math.min(.998,n+.08);return`<g transform="translate(${m(e[0])} ${m(e[1])})"><path class="sparkle" d="${s}" opacity="0">${N("opacity",["0","0","1","0","0"],[0,a,n,l,1],t)}</path></g>`}function _t(e,n,t,r){let s=Array.from({length:5},(o,d)=>`<g class="oc-tent t${d%2}">${S(e+.06+d*.25,n+.5,t,.19,.34,.44,"oc")}${S(e+.06+d*.25,n+.84,t,.19,.14,.12,"oc")}</g>`).join(""),a=`<g transform="${j("front",e,n+1.3,t+1.44)}"><rect class="oc-face" x="0.12" y="0.14" width="1.06" height="0.74" rx="0.12"/><rect class="oc-eye" x="0.3" y="0.32" width="0.18" height="0.26"/><rect class="oc-eye" x="0.82" y="0.32" width="0.18" height="0.26"/><rect class="oc-shine" x="0.36" y="0.35" width="0.06" height="0.07"/><rect class="oc-shine" x="0.88" y="0.35" width="0.06" height="0.07"/><rect class="oc-mouth" x="0.6" y="0.68" width="0.1" height="0.04"/></g>`,l=v(e+1.4,n+.78,t+1.05);return`<g class="octocat">${s}${S(e-.2,n+.66,t+.6,.2,.24,.46,"oc")}${S(e,n+.3,t+.44,1.3,1,1,"oc")}${S(e+.04,n+.45,t+1.44,.3,.3,.28,"oc")}${S(e+.96,n+.45,t+1.44,.3,.3,.28,"oc")}${a}${r(S(e+1.3,n+.66,t+.6,.2,.24,.46,"oc"),l)}</g>`}function Xt(e,n,t,r,s=7,a=1.3){let l=v(e+.65,n+.8,t),o=v(e+.65,n+.8,t+1.1+1.3*a),d=v(e-1.6,n+.4,t+3.2),u=v(e+2.9,n+1.2,t+3),c=v(e+.65+.95*a,n+.8,t+1.5*a),p=[(c[0]+r[0])/2,Math.min(c[1],r[1])-70],h=(y,k)=>`<g>${N("transform-rotate",["0 "+m(k[0])+" "+m(k[1]),"0 "+m(k[0])+" "+m(k[1]),"-70 "+m(k[0])+" "+m(k[1]),"45 "+m(k[0])+" "+m(k[1]),"0 "+m(k[0])+" "+m(k[1]),"0 "+m(k[0])+" "+m(k[1])],[0,.44,.5,.54,.6,1],s)}${y}</g>`,f=`<g>${N("transform-translate",["0 0","0 0","0 -9","0 0","0 -6","0 0","0 0"],[0,.62,.66,.7,.73,.76,1],s)}${_t(e,n,t,h)}</g>`,g=Ze(l,[0,0,1.15*a,a,a,0,0],[0,.02,.08,.11,.8,.86,1],s,f),w=(y,k)=>`<g transform="translate(${m(y[0])} ${m(y[1])})"><g opacity="0">${N("opacity",["0","0","1","1","0","0"],[0,.12,.14,.355,.37,1],s)}${N("transform-translate",["0 0","0 0",se(y,o),se(y,o)],[0,.12,.36,1],s)}${V(.42,.42,.42,k,'<circle cx="0.21" cy="0.21" r="0.08" fill="none" stroke="rgba(0,0,0,0.55)" stroke-width="0.05"/>')}</g></g>`,b=`<g transform="translate(${m(o[0])} ${m(o[1]-6)})"><circle class="burst" r="2" opacity="0">${N("opacity",["0","0","1","0","0"],[0,.355,.365,.43,1],s)}<animate attributeName="r" values="2;2;26;26" keyTimes="${Ve([0,.355,.43,1])}" dur="${s}s" repeatCount="indefinite"/></circle></g>`,M=`<g transform="translate(${m(o[0])} ${m(o[1])})"><g opacity="0">${N("opacity",["0","0","1","1","0","0"],[0,.365,.38,.655,.67,1],s)}${N("transform-translate",["0 0","0 0",se(o,c),se(o,c),se(o,p),se(o,r),se(o,r)],[0,.44,.5,.53,.595,.66,1],s)}${Ze([0,0],[0,0,1.25,1,1],[0,.365,.4,.43,1],s,V(.5,.5,.5,"#8957e5",'<path d="M0.12 0.12 L0.12 0.38 M0.12 0.18 Q0.25 0.3 0.38 0.38" fill="none" stroke="#fff" stroke-width="0.05" stroke-linecap="round"/><circle cx="0.12" cy="0.12" r="0.05" fill="#fff"/><circle cx="0.38" cy="0.38" r="0.05" fill="#fff"/>'))}</g></g>`,$=`<g transform="translate(${m(o[0])} ${m(o[1]-34)})" opacity="0">${N("opacity",["0","0","1","1","0","0"],[0,.38,.4,.5,.52,1],s)}<rect class="say" x="-30" y="-10" width="60" height="20" rx="10"/><text class="say-text" x="0" y="4" text-anchor="middle">merged!</text></g>`;return`<g class="hype skit">${g}${w(d,"#3fb950")}${w(u,"#2f81f7")}${b}${M}${$}</g>`}function Si(e,n,t,r=7.2){let s=v(e+.65,n+.8,t),a=(o,d)=>{let u=c=>`${c} ${m(d[0])} ${m(d[1])}`;return`<g>${N("transform-rotate",[u(0),u(0),u(-80),u(-40),u(-80),u(-40),u(-80),u(0),u(0),u(-110),u(0),u(0)],[0,.08,.11,.14,.17,.2,.23,.27,.58,.61,.66,1],r)}${o}</g>`},l=`<g>${N("transform-translate",["0 0","0 0","0 -12","0 0","0 -8","0 0","0 0"],[0,.58,.61,.64,.67,.7,1],r)}${_t(e,n,t,a)}</g>`;return`<g class="hype skit">${Ze(s,[0,0,1.12,1,1,0,0],[0,.02,.06,.08,.84,.9,1],r,l)}</g>`}function Ai(e,n,t,r){let s=[];for(let h=0;h<5;h+=1)s.push(S(e-.04+h*.25,n+.04,t+2.25,.2,.3,.2+h%2*.18,"mx-spike"));for(let h=0;h<4;h+=1)s.push(S(e+1.16,n+.06,t+.45+h*.42,.2+h%2*.1,.3,.2,"mx-spike")),s.push(S(e-.3-h%2*.08,n+.06,t+.6+h*.42,.24+h%2*.08,.3,.2,"mx-spike"));let a=`${S(e-.08,n,t+.3,1.26,.42,1.95,"mx-spike")}${s.join("")}`,l=`${S(e+.16,n+.45,t,.3,.34,.32,"mx-leg")}${S(e+.64,n+.45,t,.3,.34,.32,"mx-leg")}`,o=`${S(e+.05,n+.35,t+.3,1,.62,.86,"mx-body")}<g transform="${j("front",e+.05,n+.97,t+1.16)}"><rect class="mx-belly" x="0.2" y="0.1" width="0.6" height="0.66" rx="0.22"/></g>`,d=`<g transform="${j("front",e,n+1.05,t+1.95)}"><rect class="mx-eye" x="0.2" y="0.3" width="0.2" height="0.07" rx="0.03"/><rect class="mx-eye" x="0.7" y="0.3" width="0.2" height="0.07" rx="0.03"/><rect class="mx-brow" x="0.17" y="0.19" width="0.26" height="0.05"/><rect class="mx-brow" x="0.67" y="0.19" width="0.26" height="0.05"/></g>`,u=`${S(e,n+.3,t+1.15,1.1,.75,.8,"mx-face")}${d}${S(e+.3,n+1.05,t+1.2,.5,.34,.36,"mx-snout")}${S(e+.46,n+1.39,t+1.38,.18,.08,.15,"mx-nose")}`,c=`${S(e-.06,n+.24,t+1.95,1.22,.92,.06,"mx-hat")}${S(e+.14,n+.38,t+2.01,.82,.62,.3,"mx-hat")}${S(e+.49,n+.38,t+2.31,.12,.62,.05,"mx-hat-ridge")}`,p=v(e+1.14,n+.63,t+1.12);return`<g class="hog">${a}${l}${S(e-.13,n+.5,t+.62,.18,.26,.52,"mx-body")}${o}${u}${c}${r(S(e+1.05,n+.5,t+.62,.18,.26,.52,"mx-body"),p)}</g>`}function Jt(e,n,t=8){let s=($,y)=>{let k=E=>`${E} ${m(y[0])} ${m(y[1])}`;return`<g>${N("transform-rotate",[k(0),k(0),k(-150),k(-150),k(-10),k(-10),k(-160),k(-110),k(-160),k(-110),k(0),k(0)],[0,.18,.22,.3,.34,.45,.48,.52,.56,.6,.64,1],t)}${$}</g>`},a=`<g>${N("transform-translate",["0 0","0 0","0 3","0 0","0 0","0 -16","0 0","0 -12","0 0","0 0"],[0,.3,.33,.37,.48,.52,.56,.6,.64,1],t)}${Ai(e,n,.7,s)}</g>`,l=Ze(v(e+.55,n+.7,.7),[0,0,1.12,1,1,0,0],[0,.02,.08,.11,.78,.84,1],t,a),o=e+1.75,d=n+.7,u=`0 ${m(-1.6*C)}`,c=$=>["#55555f","#55555f","#F54E00","#F54E00","#55555f","#55555f"].map(y=>y==="#55555f"?y:Qe(y,$)).join(";"),p=($,y)=>`<polygon class="mx-flag" points="${U($)}"><animate attributeName="fill" values="${c(y)}" keyTimes="${Ve([0,.32,.42,.86,.9,1])}" dur="${t}s" repeatCount="indefinite"/></polygon>`,h=.7+.3,f=[v(o+.1,d+.06,h+.45),v(o+.85,d+.06,h+.45),v(o+.85,d+.06,h),v(o+.1,d+.06,h)],g=[v(o+.1,d,h+.45),v(o+.85,d,h+.45),v(o+.85,d+.06,h+.45),v(o+.1,d+.06,h+.45)],w=`<g>${N("transform-translate",["0 0","0 0",u,u,"0 0","0 0"],[0,.32,.42,.86,.94,1],t)}${p(f,1)}${p(g,1.2)}<g transform="${j("front",o+.1,d+.06,h+.45)}"><text class="flag-text" x="0.38" y="0.31" text-anchor="middle" opacity="0">ON${N("opacity",["0","0","1","1","0","0"],[0,.42,.45,.84,.86,1],t)}</text></g></g>`,b=`${Z(o,d,.12,.12,.7)}${S(o,d,.7,.1,.1,2.55,"mx-pole")}${S(o-.08,d-.08,.7,.26,.26,.08,"mx-pole")}${S(o-.03,d-.03,3.25,.16,.16,.08,"mx-pole")}`,M=[Me(v(o+.6,d,3.4),.43,t),Me(v(o+1,d,2.9),.46,t,5),Me(v(o+.2,d,3.6),.49,t,5)].join("");return`<g class="hype skit">${l}${b}${w}${M}</g>`}function Ci(e,n=7){let t=v(...e),r=v(e[0]+1.75,e[1]+.3,e[2]+1.2),s=v(3,2,.7),a=v(6.8,2,.7),l=(A,I)=>`${m((A[0]+I[0])/2-t[0])} ${m(Math.min(A[1],I[1])-40-t[1])}`,o=A=>se(t,A),d=["0 0","0 0",l(t,s),o(s),o(a),o(s),o(a),l(a,t),"0 0","0 -10","0 0","0 0"],u=[0,.08,.14,.2,.36,.5,.64,.72,.8,.84,.88,1],c=["0 0","5 -3","0 -7","-5 -3"],p=["0 0"],h=[0];for(let A=0;.2+A*.022<=.64;A+=1)p.push(c[A%4]),h.push(Number((.2+A*.022).toFixed(3)));p.push("0 0"),h.push(1);let f=[[-6,0],[4,-.27],[10,-.54],[-2,-.81]].map(([A,I],H)=>`<circle class="bubble" cx="${m(r[0]+A)}" cy="${m(r[1]-6)}" r="${2.2+H%2*1.4}"><animate attributeName="cy" values="${m(r[1]-6)};${m(r[1]-34)}" dur="1.08s" begin="${I}s" repeatCount="indefinite"/><animate attributeName="opacity" values="0;1;1;0" keyTimes="0;0.15;0.7;1" dur="1.08s" begin="${I}s" repeatCount="indefinite"/></circle>`).join(""),g=A=>`<g opacity="0">${N("opacity",["0","0","1","1","0","0"],[0,.19,.2,.64,.65,1],n)}${A}</g>`,w=`<g>${N("transform-translate",p,h,n)}${g(`<g transform="translate(${m(r[0])} ${m(r[1])})">${V(.56,.3,.32,"#f2c15f",'<circle cx="0.14" cy="0.1" r="0.035" fill="#c99528"/><circle cx="0.32" cy="0.2" r="0.03" fill="#c99528"/><circle cx="0.44" cy="0.08" r="0.03" fill="#c99528"/>')}<ellipse class="foam" cx="-2" cy="-9" rx="9" ry="4"/></g>`)}</g>`,b=`<g>${N("transform-translate",d,u,n)}<g class="critter is-busy">${Vt(...e).replace('<g class="critter">',"<g>")}</g>${g(f)}${w}</g>`,M=A=>.2+(A-2.07)/3.8*.16,$=[[2.4,3.9],[3.2,3.6],[4.1,4.1],[4.9,3.7],[5.7,4]],y=$.map(([A,I])=>{let H=M(A);return`<g class="smudge">${N("opacity",["1","1","0","0","1","1"],[0,H,H+.03,.9,.98,1],n)}<ellipse cx="${A}" cy="${I}" rx="0.42" ry="0.24"/><ellipse cx="${m(A+.3)}" cy="${m(I-.16)}" rx="0.2" ry="0.13"/><path class="streak" d="M${m(A-.4)} ${m(I+.2)} q0.3 -0.25 0.75 -0.1"/></g>`}).join(""),k=[...$.map(([A,I])=>Me(v(2+A,1.62,5.3-I+.2),M(A)+.02,n,9)),Me(v(4.4,1.62,3.9),.7,n,10),Me(v(7.6,1.62,3.2),.74,n,8)].join("");return`<g class="hype skit">${`<g transform="${j("front",2,1.62,5.3)}"><clipPath id="polish-clip"><rect width="7" height="4.6" rx="0.18"/></clipPath><g clip-path="url(#polish-clip)">${y}<g transform="skewX(-22)"><rect x="-1.6" y="-0.5" width="1.3" height="5.6" fill="url(#sc-sheen)" opacity="0">${N("transform-translate",["0 0","0 0","11 0","11 0"],[0,.66,.8,1],n)}${N("opacity",["0","0","0.9","0.9","0","0"],[0,.655,.67,.79,.8,1],n)}</rect></g></g></g>`}${k}${b}</g>`}var $i=()=>typeof matchMedia!="function"||!matchMedia("(prefers-reduced-motion: reduce)").matches;function he(e,n,t=7){let r=[];if(!e.length){let s=n==="active"?" sketch":"",a=(t-1.1)/2;return r.push(`<rect class="ghost-panel${s}" x="0.4" y="1" width="${t-.8}" height="0.85" rx="0.12" pathLength="1"/>`),r.push(`<rect class="ghost-panel${s}" x="0.4" y="2.1" width="${a}" height="1.9" rx="0.12" pathLength="1"/>`),r.push(`<rect class="ghost-panel${s}" x="${.7+a}" y="2.1" width="${a}" height="1.9" rx="0.12" pathLength="1"/>`),r.join("")}return e.slice(0,3).forEach((s,a)=>{let l=1+a*1.05,o=s.path.split("/").pop()??s.path;r.push(`<g class="panel-in" style="animation-delay:${a*90}ms"><rect class="panel ${s.kind}" x="0.4" y="${l}" width="${t-.8}" height="0.85" rx="0.12"/><rect class="panel-line" x="0.65" y="${l+.22}" width="${Math.min(t-2,1.2+o.length*.16)}" height="0.12" rx="0.06"/><text class="panel-name" x="0.65" y="${l+.66}">${dt(o)}</text></g>`)}),e.length>3&&r.push(`<text class="panel-name more" x="0.65" y="${1+3*1.05+.4}">+${e.length-3} more</text>`),r.join("")}function Ii(e){return e==="passed"?"done":e==="failed"?"failed":e==="active"?"active":e==="not_run"?"idle":"planned"}var ji=[[8.2,7.6],[9.9,6.5],[11.5,5.3]];function de(e,n=ji){return e.checks.slice(0,n.length).map((t,r)=>wi(`check:${t.id}`,n[r][0],n[r][1],Ii(t.status),t.label))}function fe(e,n,t,r,s=2,a=7){return ci("window",s,1.3,a,4.6,n,t,r)}function en(e){return[Y("pipe-live",Te([[9.15,1.85,.72],[10.9,1.85,.72],[10.9,2.7,.72]]),e["pipe-live"]??"planned","To the live preview"),yi("port",10.4,2.7,e.port??"planned")]}function Ti(e,n){let t=e.parts,r=e.agent?Q[e.agent.id]:Q.claude,s=!e.agent||e.agent.id==="claude",a=ce([2.6,4.8,5],[5.2,1.62,3.4],.5),l=s&&n&&e.phase==="done"&&t.agent==="done",o=[ne("platform",0,0,13,10,"This computer",t.platform??"done"),fe(e,t.window??"planned",he(e.files,t.window??"planned"),"Your app (workflow view)"),...en(t),Y("beam",a,t.beam??"planned","Agent at work"),...de(e),mi("agent",1.4,4.2,3.8,t.agent??"planned",r,e.agent?.label??"Coding agent",gi[e.agent?.id??"claude"],s,l)],d=[];return t.beam==="active"&&n&&(d.push(We(a,"spark",.55,!0,!0)),s&&d.push(Li(v(2.45,4.75,5.05),8,.9))),l&&d.push(Ci([1.5,4.75,4.35])),{parts:o,fx:d,viewBox:""}}function Ni(e,n,t,r,s){let a=[.5,.9,1.3,1.7].map(l=>`<rect class="vent" x="0.25" y="${l}" width="1" height="0.14" rx="0.07"/>`).join("");return{id:e,label:s?`${s} dev server`:"Dev server",state:r,svg:`<g class="unit-wrap" style="--brand:rgba(255,255,255,0.4)">${Z(n,t,1.5,1.5,.7)}${S(n,t,.7,1.5,1.5,2.6,"tower")}<g transform="${j("top",n,t,3.3)}"><rect class="unit-plate" x="0.25" y="0.25" width="1" height="1" rx="0.22"/><rect class="unit-ring" x="0.25" y="0.25" width="1" height="1" rx="0.22"/><image href="${hi(s)}" x="0.42" y="0.42" width="0.66" height="0.66"/></g><g transform="${j("front",n,t+1.5,3.3)}">${a}<rect class="tower-led" x="0.25" y="2.2" width="0.5" height="0.16" rx="0.08"/></g></g>`}}function Di(e,n,t,r,s){return{id:e,label:"Run command",state:r,svg:`${Ke({x:n,y:t,size:1.5,h:.75,mark:di,brand:"#CB3837",grounded:!0})}${qe(n+.75,t+.75,2.55,s,"tag-cmd")}`}}function Ei(e,n){let t=e.parts,s=t.window==="waiting"?'<g class="key-sign"><circle cx="3.5" cy="2.5" r="0.85"/><path d="M3.1 2.5 h0.9 m-0.3 0 v0.35 m-0.25 -0.35 v0.25"/></g>':t.window==="done"?'<g class="panel-in"><rect class="panel modified" x="0.4" y="1" width="6.2" height="0.85" rx="0.12"/><rect class="panel-line" x="0.65" y="1.3" width="3" height="0.12" rx="0.06"/></g><g class="panel-in" style="animation-delay:90ms"><rect class="panel" x="0.4" y="2.1" width="2.95" height="1.9" rx="0.12"/><rect class="panel" x="3.65" y="2.1" width="2.95" height="1.9" rx="0.12"/></g>':he([],t.window??"planned"),a=ce([4,6,3.4],[4.6,1.62,3.3],.6),l=[ne("platform",0,0,13,10,"This computer",t.platform??"done"),fe(e,t.window??"planned",s,"Your app (workflow view)"),...en(t),Y("pipe-power",Te([[2.3,7.6,.72],[3.9,7.6,.72],[3.9,6.9,.72]]),t["pipe-power"]??"planned","Runs"),Ni("server",3.2,5.2,t.server??"planned",e.framework),Y("pipe-serve",a,t["pipe-serve"]??"planned","Serves the page"),Di("command",.7,7,t.command??"planned",e.caption.match(/(?:npm|pnpm|yarn|bun) run \w+/)?.[0]??"npm run dev"),...de(e,[[9.6,6.6]])],o=[];return t["pipe-serve"]==="active"&&n&&o.push(We(a,"spark",1.6,!0,!0)),{parts:l,fx:o,viewBox:""}}function Pi(e,n){let t=e.parts,r=e.provider==="github"?"github":"google",s=ce([11.6,1.9,2.6],[9.9,4.7,2.2],1),a=ce([9.9,4.7,2.2],[5.4,1.62,3.2],.6),l=`${s} ${a.replace(/^M[^Q]+/,"")}`,o=t["pipe-app"]==="active"||t.gateway==="active",d=[ne("platform",0,0,13,10,"This computer",t.platform??"done"),fe(e,t.window??"planned",he(e.files,t.window??"planned",6),"Your app (demo)",1.5,6),ut("auth",11.6,1.9,t.auth??"planned",t.auth==="planned"?0:2,0,X.supabase),Y("pipe-provider",s,t["pipe-provider"]??"planned",`${r==="github"?"GitHub":"Google"} to gateway`),Y("pipe-app",a,t["pipe-app"]??"planned","Gateway to app"),bi("gateway",8.4,4.4,t.gateway??"planned",r,o&&n?"cycle":t["pipe-app"]==="done"||t.gateway==="done"?"open":"closed"),...de(e,[[4.2,7.9],[7.4,7.3]])],u=[];return o&&n&&r==="github"&&u.push(Si(10.9,5,.7)),o&&n&&u.push(Ne(l,"user","#f5f5f7",{count:1,dur:3.6,travel:.7,landing:c=>Le(v(5.4,1.62,3.2),c,3.6,.7,"rgba(245,245,247,0.8)",30)})),{parts:d,fx:u,viewBox:""}}function Oi(e,n){let t=e.parts,r=t.db==="planned"?0:t.db==="active"?2:3,s=t.schema==="done"?4:t.schema==="active"?2:0,a=ce([5.6,1.62,3],[10.6,5.2,.7+Math.max(r,1)*.95],1.2),l=[ne("platform",0,0,13,10,"This computer",t.platform??"done"),fe(e,t.window??"planned",he(e.files,t.window??"planned",6),"Your app (demo)",1.5,6),Y("pipe-db",a,t["pipe-db"]??"planned","App to database"),ut("db",10.6,5.2,t.db??"planned",r,s,X.supabase),...de(e,[[2.4,7.4],[5.6,7.9]])],o=[];if((t.db==="active"||t["pipe-db"]==="active")&&n){let d=.7+Math.max(r,1)*.95,u=c=>`${Le(v(10.6,5.2,d),c,3.4,.55,"rgba(62,207,142,0.9)",44)}${Ri(10.6,5.2,r,c,3.4,.55)}`;o.push(Ne(a,"record","#3ECF8E",{count:2,dur:3.4,travel:.55,landing:u}))}return{parts:l,fx:o,viewBox:""}}function Ri(e,n,t,r,s,a){let l=1.55*C*1.2247,o=1.55*C*.7071;return Array.from({length:Math.max(t,1)},(d,u)=>{let c=Math.max(t,1)-1-u,[p,h]=v(e,n,.7+c*.95+.75),f=Math.min(a+.03+u*.06,.9);return`<path d="M${m(p-l)} ${m(h+.18*C)} A${m(l)} ${m(o)} 0 0 0 ${m(p+l)} ${m(h+.18*C)}" fill="none" stroke="#7dffc4" stroke-width="2.4" stroke-linecap="round" opacity="0"><animate attributeName="opacity" values="0;0;1;0;0" keyTimes="0;${m(f)};${m(f+.04)};${m(Math.min(f+.2,.98))};1" dur="${s}s" begin="${r}" repeatCount="indefinite"/></path>`}).join("")}function Qt(e,n,t,r,s){return{id:e,label:r,state:s,svg:`${Z(n,t,.9,.9,.7)}${S(n,t,.7,.9,.9,.9,"post")}${qe(n+.45,t+.45,2.3,r)}`}}function Ui(e,n){let t=e.parts,r=Te([[1.6,7.6,.75],[9.4,7.6,.75],[9.4,6.2,.75]]),s=Te([[1.6,3,.75],[9.4,3,.75],[9.4,4.4,.75]]),a=[ne("platform",0,0,13,10,"This computer",t.platform??"done"),Y("path-other",s,t["path-other"]??"planned","Others cannot read"),Y("path-owner",r,t["path-owner"]??"planned","Owner can read"),Qt("other",.6,2.5,"Other user","done"),vi("rule",5.4,2.2,t.rule??"planned"),ut("db",10.8,5.3,t.db??"done",3,4,X.supabase),Qt("owner",.6,7.1,"Owner","done"),...de(e,[[4.4,9.1],[7.4,.6]])],l=[];return(t["path-owner"]==="active"||t["path-owner"]==="done")&&l.push(We(r,"user",2.4,t["path-owner"]==="active",n)),(t["path-other"]==="active"||t["path-other"]==="done"||t["path-other"]==="failed")&&l.push(We(s,t["path-other"]==="failed"?"leak":"blocked",2.4,t["path-other"]==="active",n,t["path-other"]==="failed"?void 0:.42)),{parts:a,fx:l,viewBox:""}}function Fi(e,n){let t=e.parts,r=Te([[6.6,1.9,.72],[7.4,1.9,.72],[7.4,4.6,.72]]),s=ce([7.5,5.4,2.3],[15.3,-1.3,.75],2.6),a=[ne("platform",0,0,10,8,"This computer",t.platform??"done"),ki("preview",12.6,-3.6,5.4,4.6,"Preview",t.preview??"planned",X.vercel),fe(e,t.window??"done",he([{path:"app",kind:"modified"}],"done",5.4),"Your app (demo)",1,5.4),Y("push",r,t.build==="planned"?"planned":"done","Push"),Mi("build",6.4,4.6,t.build??"planned"),Y("flight",s,t.flight??"planned","Build and upload"),...de(e,[[17.2,-2.9]])],l=[];return t.build==="active"&&n&&l.push(Ne(r,"commit","#3fb950",{count:2,dur:2.8,travel:.6})),(t.flight==="active"||t.preview==="active")&&n&&(l.push(Xt(6.8,4.5,2.2,v(15.3,-.6,.9),7)),l.push(`<g class="hype">${zi(12.6,-3.6,5.4,4.6,"0s",7,.66)}${Le(v(15.3,-1.3,.7),"0s",7,.67,"rgba(245,245,247,0.85)",52)}</g>`)),{parts:a,fx:l,viewBox:""}}function zi(e,n,t,r,s,a,l){let d=e+(t-2.2)/2,u=n+(r-2.2)/2-.3,c=v(d+2.2/2,u+2.2/2,.7+2.4),p=[v(d,u+2.2,.7),v(d+2.2,u+2.2,.7),c],h=[v(d+2.2,u,.7),v(d+2.2,u+2.2,.7),c],f=Math.max(p[0][1],p[1][1],h[0][1]),g="vx-sweep",w=b=>`<rect x="${m(Math.min(p[0][0],h[0][0])-4)}" y="${m(f)}" width="${m(Math.abs(h[0][0]-p[0][0])+60)}" height="26" fill="url(#sc-sweep-v)"><animate attributeName="y" values="${m(f)};${m(f)};${m(c[1]-26)};${m(c[1]-26)}" keyTimes="0;${l};${m(Math.min(l+.24,.98))};1" dur="${a}s" begin="${b}" repeatCount="indefinite"/></rect>`;return`<clipPath id="${g}"><polygon points="${U(p)}"/><polygon points="${U(h)}"/></clipPath><g clip-path="url(#${g})">${w(s)}</g>`}function Hi(e,n){let t=e.parts,r=[11.35,3.2,1.08],s=ce([6.4,1.62,3],r,1.6),a=t.event==="active"||t.posthog==="active",l=[ne("platform",0,0,13,10,"This computer",t.platform??"done"),fe(e,t.window??"done",he([{path:"instrumentation.ts",kind:"added"}],"done",6),"Your app (demo)",1.5,6),{id:"insights",label:"PostHog insight",state:t.posthog??"planned",svg:Bi(7.6,6.6,t.posthog==="done"?"done":a&&n?"live":"idle")},Y("event",s,t.event??"planned","Event to PostHog"),Kt("posthog","PostHog project",t.posthog??"planned",10.1,2.2,X.posthog,"#F54E00",2),...de(e,[[4.4,7.8]])],o=[];return a&&n&&o.push(Jt(9.8,4.7)),a&&n&&o.push(Ne(s,"event","#F54E00",{count:3,dur:3.3,travel:.5,landing:d=>Le(v(...r),d,3.3,.5,"rgba(245,78,0,0.9)",52)})),{parts:l,fx:o,viewBox:""}}function Bi(e,n,t){let a="M0.25 1.35 L0.7 1.15 L1.05 1.22 L1.45 0.88 L1.85 0.95 L2.3 0.5",l=t==="live"?`<path class="ins-line" d="${a}" pathLength="1" stroke-dasharray="1" stroke-dashoffset="1"><animate attributeName="stroke-dashoffset" values="1;1;0;0" keyTimes="0;0.5;0.8;1" dur="3.3s" repeatCount="indefinite"/></path><circle class="ins-dot" cx="2.3" cy="0.5" r="0.07" opacity="0"><animate attributeName="opacity" values="0;0;1;1;0" keyTimes="0;0.78;0.82;0.95;1" dur="3.3s" repeatCount="indefinite"/></circle>`:`<path class="ins-line" d="${a}" opacity="${t==="done"?1:.35}"/>${t==="done"?'<circle class="ins-dot" cx="2.3" cy="0.5" r="0.07"/>':""}`;return`<g class="insight">${Z(e+.9,n+.5,.6,.4,.7)}${S(e+1.1,n+.45,.7,.4,.3,.6,"stand")}${S(e,n,1.3,2.6,.12,1.7,"card")}<g transform="${j("front",e,n+.12,1.3+1.7)}"><rect class="ins-bg" x="0.1" y="0.1" width="${2.6-.2}" height="${1.7-.2}" rx="0.08"/><rect class="ins-title" x="0.25" y="0.22" width="0.9" height="0.1" rx="0.05"/><path class="ins-grid" d="M0.25 0.7 H2.35 M0.25 1.05 H2.35 M0.25 1.4 H2.35"/>${l}</g></g>`}function Yi(e,n){let t=e.parts,r=e.provider&&ge[e.provider]?e.provider:"supabase",s=ge[r],[a,l,o]=[10.1,2.2,2.1],d=[a+(o+.5)/2,l+1,1.08],u=ce([6.4,1.62,3],d,1.6),c=[ne("platform",0,0,13,10,"This computer",t.platform??"done"),fe(e,t.window??"done",he([{path:`${r}.ts`,kind:"added"}],"done",6),"Your app (demo)",1.5,6),Y("link",u,t.link??"planned",`App to ${s.name}`),Kt("provider",s.name,t.provider??"planned",a,l,ie(r),s.brand,o),...de(e,[[3.4,7.6]])],p=[],h=(t.link==="active"||t.provider==="active")&&n;return h&&r==="github"&&p.push(Xt(7,4.6,.7,v(d[0],d[1],1.5),7),`<g class="hype">${Le(v(...d),"0s",7,.66,s.brand,52)}</g>`),h&&r==="posthog"&&p.push(Jt(9.8,4.7)),h&&r!=="github"&&p.push(Ne(u,s.payload,s.brand,{count:2,dur:3.2,travel:.55,landing:f=>Le(v(...d),f,3.2,.55,s.brand,52)})),{parts:c,fx:p,viewBox:""}}function Gi(e){let n=$i();W={x0:1/0,y0:1/0,x1:-1/0,y1:-1/0};let t;switch(e.kind){case"start":t=Ei(e,n);break;case"auth":t=Pi(e,n);break;case"db":t=Oi(e,n);break;case"security":t=Ui(e,n);break;case"deploy":t=Fi(e,n);break;case"monitor":t=Hi(e,n);break;case"connect":t=Yi(e,n);break;default:t=Ti(e,n)}let r=W;W=null;let s={x:34,top:58,bottom:26};return t.viewBox=`${m(r.x0-s.x)} ${m(r.y0-s.top)} ${m(r.x1-r.x0+s.x*2)} ${m(r.y1-r.y0+s.top+s.bottom)}`,t}var tn="http://www.w3.org/2000/svg";function Ge(e,n,t={}){let r=document.createElementNS(tn,"g");r.setAttribute("data-sig",e);for(let[s,a]of Object.entries(t))r.setAttribute(s,a);return r.innerHTML=n,r}var Qi='<defs><filter id="sc-soft" x="-40%" y="-40%" width="180%" height="180%"><feGaussianBlur stdDeviation="6"/></filter><filter id="sc-glow" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="3"/></filter><linearGradient id="sc-sheen" x1="0" y1="0" x2="1" y2="0"><stop offset="0" stop-color="#fff" stop-opacity="0"/><stop offset="0.5" stop-color="#fff" stop-opacity="0.6"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></linearGradient><linearGradient id="sc-sweep-v" x1="0" y1="1" x2="0" y2="0"><stop offset="0" stop-color="#fff" stop-opacity="0"/><stop offset="0.6" stop-color="#fff" stop-opacity="0.75"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></linearGradient><linearGradient id="sc-floor" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#1f1f25"/><stop offset="1" stop-color="#17171c"/></linearGradient></defs>';function nn(e,n){let t=Gi(e),r=document.createElementNS(tn,"svg");r.setAttribute("class",`scene is-${e.phase} kind-${e.kind}${e.demo?" is-demo":""}`),r.setAttribute("viewBox",t.viewBox),r.setAttribute("role","group"),r.setAttribute("aria-label","Workflow view: an illustration of the steps, not your app"),r.setAttribute("data-slot",`scene-${e.kind}`);let s=a=>{let l=a.target.closest?.("[data-part]");l&&n(l.getAttribute("data-part")??"")};r.addEventListener("click",s),r.addEventListener("keydown",a=>{let l=a.key;(l==="Enter"||l===" ")&&(a.preventDefault(),s(a))}),r.appendChild(Ge("defs",Qi));for(let a of t.parts){let l=e.focus===a.id,o=e.selected===a.id,u={class:`part p-${a.state}${l?" is-focus":""}${o?" is-selected":""}`,"data-part":a.id};a.inert||Object.assign(u,{tabindex:"0",role:"button","aria-label":`${a.label}: ${pt[a.state]}`}),r.appendChild(Ge(`${a.id}|${a.state}|${l}|${o}|${Wi(a.svg)}`,a.svg,u))}return r.appendChild(Ge(`fx|${t.fx.join("").length}|${t.fx.map(a=>a.slice(0,40)).join("|")}`,t.fx.join(""),{class:"fx","pointer-events":"none"})),r.appendChild(Ge(`payoff|${e.phase}`,e.phase==="done"?Vi(e):"",{class:"fx-payoff","pointer-events":"none"})),r}function Wi(e){let n=5381;for(let t=0;t<e.length;t+=1)n=(n<<5)+n+e.charCodeAt(t)|0;return(n>>>0).toString(36)}function Vi(e){let[n,t]=e.kind==="deploy"?v(15.3,-1.3,1.6):e.kind==="monitor"||e.kind==="connect"?v(11.35,3.2,2):v(5.5,1.6,3.2);return`<circle class="ring" cx="${m(n)}" cy="${m(t)}" r="120"/><circle class="ring two" cx="${m(n)}" cy="${m(t)}" r="120"/>`}var pt={planned:"planned",idle:"not run",active:"working now",done:"done, with evidence",failed:"failed",waiting:"waiting for you"};function xe(e){return e==="active"?"active":e==="done"?"done":e==="failed"?"failed":e==="skipped"||e==="unknown"?"idle":"planned"}var Zi=[[/tsc|typecheck/i,"Types"],[/test/i,"Tests"],[/preview still loads|page loads/i,"Page loads"],[/answers/i,"Answers"]];function sn(e){return Zi.find(([n])=>n.test(e))?.[1]??e}function qi(e){return e.state==="waiting_for_user"?"wait":ee(e.state)?e.state==="succeeded"?"done":e.state==="cancelled"||e.state==="partially_completed"&&!e.checks.some(n=>n.status==="failed")&&!e.steps.some(n=>n.state==="failed")?"stopped":"fail":"work"}function Ki(e,n){let t=w=>n.steps.find(b=>b.id===w),r=e.work.preview?.state==="ready"&&!!e.work.preview.url,s=n.steps.find(w=>w.state==="active"),a=qi(n),l=n.state==="waiting_for_user"&&n.waiting?`Waiting for you: ${n.waiting.title.toLowerCase()}`:s?`${s.label}${s.detail?` \xB7 ${s.detail}`:""}`:n.result?.title??"Working";if(n.actionId==="preview.start"){let w=t("page"),b=n.checks.find($=>$.id==="page"),M=n.state==="waiting_for_user"?"waiting":w?.state==="done"?"done":w?.state==="failed"?"failed":t("answer")?.state==="active"||w?.state==="active"||t("answer")?.state==="done"?"active":"planned";return{kind:"start",phase:a,focus:n.state==="waiting_for_user"?"window":t("find")?.state==="active"?"command":t("start")?.state==="active"?"server":t("answer")?.state==="active"||w?.state==="active"?"window":null,parts:{platform:"done",command:xe(t("find")?.state),server:t("answer")?.state==="failed"?"failed":xe(t("start")?.state),"pipe-power":xe(t("start")?.state),"pipe-serve":t("answer")?.state==="active"?"active":xe(t("answer")?.state),window:M,"pipe-live":w?.state==="done"&&r?"done":"planned",port:w?.state==="done"&&r?"done":"planned"},files:[],checks:[{id:"page",label:"Page loads",status:b?b.status==="passed"?"passed":"failed":w?.state==="active"?"active":"pending"}],live:r,framework:e.work.facts?.framework??null,caption:l.replace(/(npm|pnpm|yarn|bun) run (\w+)/,"$1 run $2"),selected:e.work.selectedPart}}let o=t("edit"),d=t("check"),u=t("preview"),c=[...e.work.events].reverse().find(w=>w.type==="check.started"),h=(n.plan?.checks??[]).map(w=>{let b=/preview still loads/i.test(w),M=n.checks.find(y=>b?y.id==="page":y.command===w),$=!M&&(b?u?.state==="active":d?.state==="active"&&c?.payload.command===w);return{id:b?"page":w.replace(/\W+/g,"-"),label:sn(w),status:M?M.status==="passed"?"passed":M.status==="failed"?"failed":"not_run":$?"active":ee(n.state)?"not_run":"pending"}}),f=t("read")?.state==="active"||o?.state==="active"?"active":o?.state==="failed"?"failed":n.changes.length&&!n.reverted?"done":o?.state==="done"?"idle":"planned",g=h.find(w=>w.status==="active");return{kind:"ui",phase:a,focus:o?.state==="active"||t("read")?.state==="active"?"window":g?`check:${g.id}`:u?.state==="active"?"port":null,parts:{platform:"done",agent:xe(o?.state),beam:o?.state==="active"?"active":o?.state==="done"?"idle":xe(o?.state),window:f,"pipe-live":u?.state==="done"&&r?"done":u?.state==="active"?"active":u?.state==="failed"?"failed":"planned",port:u?.state==="done"&&r?"done":u?.state==="failed"?"failed":"planned"},files:n.reverted?[]:n.changes.map(w=>({path:w.path,kind:w.kind})),checks:h,agent:n.agent?{id:n.agent.cliId,label:ht(e,n.agent.cliId)}:void 0,live:r,caption:l,selected:e.work.selectedPart}}function ht(e,n){return e.agents.find(t=>t.id===n)?.label.replace(/ CLI$/,"")??(n==="claude"?"Claude Code":n==="gemini"?"Gemini":"Codex")}function _i(e,n,t){let r=n==="preview.start";return{kind:r?"start":"ui",phase:"plan",focus:null,parts:{platform:"done"},files:[],checks:r?[{id:"page",label:"Page loads",status:"pending"}]:t.checks.map(s=>({id:s.replace(/\W+/g,"-"),label:sn(s),status:"pending"})),agent:r?void 0:{id:e.cliId,label:ht(e,e.cliId)},live:e.work.preview?.state==="ready",framework:e.work.facts?.framework??null,caption:"The plan. Nothing has run yet.",selected:e.work.selectedPart}}var gt=[{kind:"ui",key:"ui",title:"Change something in my app",text:"Claude Code eats its tokens and builds the change into the app; when the checks pass, it polishes the window."},{kind:"auth",provider:"google",key:"auth",title:"Add Google sign-in",text:"A gateway opens beside the app; a test user signs in with Google and comes back into the app."},{kind:"auth",provider:"github",key:"auth-github",title:"Add GitHub sign-in",text:"The same gateway with GitHub: a test user signs in with GitHub and comes back into the app."},{kind:"db",key:"db",title:"Connect a database",text:"The database settles in layers, its tables appear as compartments, and one test record travels to it and back."},{kind:"security",key:"security",title:"Fix an access issue",text:"The affected path is marked, the rule takes shape, then the owner\u2019s path and the blocked path are tested separately."},{kind:"monitor",key:"monitor",title:"Add product analytics",text:"An app event travels to PostHog, and the check waits for PostHog to show it arrived."},{kind:"deploy",key:"deploy",title:"Create a preview deployment",text:"The change is pushed to GitHub, built and uploaded to a Vercel preview, and checked there."},{kind:"connect",key:"connect",title:"Connect a provider",text:"Every provider VibeRaven works with, in its own colours, with what it really receives from your app."}],Xi={auth:{plan:{},work:{gateway:"active","pipe-provider":"done","pipe-app":"active",auth:"done",window:"idle"},wait:{gateway:"waiting","pipe-provider":"planned",auth:"done",window:"idle"},fail:{gateway:"done","pipe-provider":"done","pipe-app":"failed",auth:"done",window:"failed"},done:{gateway:"done","pipe-provider":"done","pipe-app":"done",auth:"done",window:"done"},stopped:{}},db:{plan:{},work:{db:"active",schema:"active",window:"idle"},wait:{db:"waiting",window:"idle"},fail:{db:"done",schema:"done","pipe-db":"failed",window:"failed"},done:{db:"done",schema:"done","pipe-db":"done",window:"done"},stopped:{}},security:{plan:{db:"done"},work:{rule:"active",db:"done","path-owner":"planned","path-other":"planned"},wait:{rule:"waiting",db:"done"},fail:{rule:"done",db:"done","path-owner":"done","path-other":"failed"},done:{rule:"done",db:"done","path-owner":"done","path-other":"done"},stopped:{}},deploy:{plan:{},work:{build:"done",flight:"active",preview:"active"},wait:{build:"done",flight:"planned",preview:"waiting"},fail:{build:"done",flight:"done",preview:"failed"},done:{build:"done",flight:"done",preview:"done"},stopped:{}},monitor:{plan:{},work:{posthog:"active",event:"active",window:"done"},wait:{posthog:"waiting",event:"planned",window:"done"},fail:{posthog:"done",event:"failed",window:"done"},done:{posthog:"done",event:"done",window:"done"},stopped:{}},connect:{plan:{},work:{provider:"active",link:"active",window:"done"},wait:{provider:"waiting",link:"planned",window:"done"},fail:{provider:"done",link:"failed",window:"done"},done:{provider:"done",link:"done",window:"done"},stopped:{}},ui:{plan:{},work:{agent:"active",beam:"active",window:"active"},wait:{agent:"waiting",window:"idle"},fail:{agent:"done",beam:"idle",window:"failed"},done:{agent:"done",beam:"idle",window:"done","pipe-live":"done",port:"done"},stopped:{}},start:{plan:{},work:{},wait:{},fail:{},done:{},stopped:{}}},Ji={ui:["Types","Page loads"],auth:["Sign in","Sign out"],db:["Write","Read back"],security:["Owner reads","Others blocked"],deploy:["Preview answers"],monitor:["Event arrived"],connect:["Connected"]};function er(e,n,t,r){let s=Xi[n][t],a=l=>t==="done"?"passed":t==="fail"?l===0?"passed":"failed":t==="work"&&l===0?"active":"pending";return{kind:n,phase:t,focus:Object.entries(s).find(([,l])=>l==="active"||l==="waiting"||l==="failed")?.[0]??null,parts:{platform:"done",...s},framework:e.work.facts?.framework??null,provider:r,files:n==="ui"&&(t==="done"||t==="fail")?[{path:"app/page.tsx",kind:"modified"},{path:"components/Hero.tsx",kind:"modified"}]:n==="auth"&&(t==="done"||t==="fail")?[{path:"app/login/page.tsx",kind:"added"}]:n==="db"&&t==="done"?[{path:"app/notes/actions.ts",kind:"added"}]:[],checks:(Ji[n]??[]).map((l,o)=>({id:`demo-${o}`,label:l,status:a(o)})),live:!1,caption:t==="plan"?"Planned scene":t==="work"?"Working (simulated)":t==="wait"?"Waiting for you (simulated)":t==="fail"?"A check failed (simulated)":"Done (simulated)",demo:!0,selected:e.work.selectedPart}}function tr(e,n,t){let r=n.selected;if(!r)return null;let s=n.parts[r]??(r.startsWith("check:")?(()=>{let o=n.checks.find(d=>`check:${d.id}`===r);return o?.status==="passed"?"done":o?.status==="failed"?"failed":o?.status==="active"?"active":"planned"})():"planned"),a=[],l=r;if(n.demo)l=r,a.push(i("p",{},"Demo scene. Nothing here is your app or a real result."));else if(r==="window")l="Your app, as drawn in the workflow",a.push(i("p",{},"A drawing of the work, not a screenshot. The real app is in the live window.")),t?.changes.length&&a.push(i("ul",{class:"insp-files"},...t.changes.map(o=>i("li",{},i("code",{},o.path),i("span",{class:"add"},`+${o.additions}`),i("span",{class:"del"},`\u2212${o.deletions}`))))),t?.waiting&&a.push(i("p",{class:"insp-wait"},t.waiting.detail));else if(r==="agent"&&t?.agent)l=ht(e,t.agent.cliId),a.push(i("p",{},`Coding agent on this computer, access: ${t.agent.accessMode}.`)),t.result?.agentAnswer&&a.push(i("div",{class:"insp-answer",html:_(t.result.agentAnswer.slice(0,900))}));else if(r.startsWith("check:")){let o=n.checks.find(u=>`check:${u.id}`===r),d=t?.checks.find(u=>u.id===o?.id||u.command?.replace(/\W+/g,"-")===o?.id);l=o?.label??"Check",a.push(i("p",{},d?`${d.status==="passed"?"Passed":d.status==="failed"?"Failed":"Not run"}${d.command?` \xB7 ${d.command}`:""}`:"Not run yet.")),d?.detail&&a.push(i("pre",{class:"insp-pre"},d.detail))}else r==="port"||r==="pipe-live"?(l="Live preview",a.push(i("p",{},e.work.preview?.url?`${e.work.preview.url} \xB7 ${e.work.preview.state}`:"Not running."))):r==="server"||r==="command"?(l=r==="server"?"Dev server":"Run command",a.push(i("p",{},e.work.preview?.command??"npm run dev")),e.work.preview?.log&&a.push(i("pre",{class:"insp-pre"},e.work.preview.log.trim().split(`
8
+ `).slice(-8).join(`
9
+ `)))):r==="platform"?(l="This computer",a.push(i("p",{},`${e.project.project?.path??""} \xB7 nothing leaves this machine, nothing is deployed.`))):r==="beam"&&(l="Agent at work",a.push(i("p",{},t?`${t.changes.length} file${t.changes.length===1?"":"s"} changed so far.`:"")));return i("aside",{class:"scene-inspect","aria-live":"polite"},i("header",{},i("strong",{},l),i("span",{class:`insp-state is-${s}`},pt[s]??String(s))),...a)}function an(e,n){let t=e.work.gallery,r=e.work.run,s=e.work.plan,a=t?er(e,t.kind,t.phase,t.provider):s?_i(e,s.actionId,s.plan):r?Ki(e,r):null;if(!a)return null;let l=a.phase==="work",o=a.phase==="done"?"pass":a.phase==="fail"?"fail":a.phase==="wait"?"wait":a.phase==="work"?"work":"plan";return i("section",{class:`scene-stage is-${a.phase}`,dataset:{slot:"scene-stage"},"aria-label":"Workflow view"},i("header",{class:"scene-head",dataset:{sig:`${a.demo}|${a.kind}`}},i("span",{class:`scene-tag${a.demo?" is-demo":""}`},a.demo?"Demo \xB7 simulated":"Workflow view"),i("span",{class:"scene-note"},a.demo?"A preview of a planned action. It does not run and is not your app.":"A drawing of the real steps. Your app itself is in the live window.")),nn(a,d=>n.selectPart(d)),i("p",{class:`scene-caption is-${o}`,role:"status",dataset:{sig:`${a.caption}|${o}|${r?.createdAt??""}`}},i("i",{"aria-hidden":"true"}),i("span",{},a.caption),l&&r?i("span",{class:"work-elapsed",dataset:{since:r.createdAt}}):null,!l&&r&&!a.demo?i("span",{class:"scene-when"},F(r.updatedAt)):null),tr(e,a,t?null:r))}function on(e,n){return e.work.gallery?null:i("section",{class:"live-window",dataset:{slot:"live-window"},"aria-label":"Your app, live"},i("header",{dataset:{sig:"live-head"}},i("strong",{},"Your app"),i("span",{},"real, on this computer")),_e(e,n))}var nr={ui:"App change",auth:"Google sign-in","auth-github":"GitHub sign-in",db:"Database",security:"Access fix",deploy:"Deploy",monitor:"Analytics",connect:"Any provider"},ir="data:image/svg+xml;base64,"+btoa('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="#f2c15f" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M8 1.8 2.8 3.6v4.1c0 3.1 2.2 5.4 5.2 6.5 3-1.1 5.2-3.4 5.2-6.5V3.6z"/><path d="M5.8 8l1.6 1.6L10.4 6.4"/></svg>'),rn="data:image/svg+xml;base64,"+btoa('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="#f5f5f7" stroke-width="1.4" stroke-linecap="round"><rect x="2" y="2" width="5" height="5" rx="1.2"/><rect x="9" y="2" width="5" height="5" rx="1.2"/><rect x="2" y="9" width="5" height="5" rx="1.2"/><rect x="9" y="9" width="5" height="5" rx="1.2"/></svg>');function rr(e){return{ui:Q.claude,auth:ie("google"),"auth-github":ie("github"),db:ie("supabase"),security:ir,deploy:ie("vercel"),monitor:ie("posthog"),connect:rn}[e]??rn}var sr={plan:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-dasharray="2 2" aria-hidden="true"><rect x="2.5" y="2.5" width="11" height="11" rx="3"/></svg>',work:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" aria-hidden="true"><path d="M8 2a6 6 0 1 1-6 6"/></svg>',wait:'<svg viewBox="0 0 16 16" width="14" height="14" fill="currentColor" aria-hidden="true"><rect x="4" y="3" width="2.6" height="10" rx="1"/><rect x="9.4" y="3" width="2.6" height="10" rx="1"/></svg>',fail:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M4 4l8 8M12 4l-8 8"/></svg>',done:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.5 8.5l3 3 6-7"/></svg>'};function ar(e){return e.kind==="auth"?e.provider==="github"?"auth-github":"auth":e.kind}function ln(e,n){let t=e.work.gallery,r=ar(t),s=gt.find(d=>d.key===r)??gt[0],a=[["plan","Plan"],["work","Working"],["wait","Waiting"],["fail","Failed"],["done","Done"]],l=t.provider&&ge[t.provider]?t.provider:"supabase";return[i("p",{class:"work-eyebrow is-plan"},i("i",{"aria-hidden":"true"}),"Demo \xB7 not built yet"),i("h1",{id:"stage-heading",tabindex:-1,class:"wtitle"},t.kind==="connect"?`Connect ${ge[l].name}`:s.title),i("p",{class:"wline"},t.kind==="connect"?`${ge[l].verb}. A preview; nothing here touches your app.`:"A preview of how it will look. Nothing here touches your app."),i("div",{class:"wgallery",role:"radiogroup","aria-label":"Scene"},...gt.map(d=>i("button",{type:"button",role:"radio","aria-checked":String(d.key===r),class:`wscene${d.key===r?" on":""}`,on:{click:()=>n.showGallery(d.kind,t.phase,d.kind==="connect"?l:d.provider)}},i("span",{class:"wscene-mark"},i("img",{src:rr(d.key),alt:"",width:22,height:22})),i("span",{},nr[d.key])))),t.kind==="connect"?i("div",{class:"wproviders",role:"radiogroup","aria-label":"Provider"},...Object.entries(ge).map(([d,u])=>i("button",{type:"button",role:"radio","aria-checked":String(d===l),title:u.name,class:`wprov${d===l?" on":""}`,on:{click:()=>n.showGallery("connect",t.phase,d)}},i("img",{src:ie(d),alt:u.name,width:20,height:20})))):null,i("div",{class:"wphases",role:"radiogroup","aria-label":"Demo state"},...a.map(([d,u])=>i("button",{type:"button",role:"radio","aria-checked":String(t.phase===d),class:`wphase is-${d}${t.phase===d?" on":""}`,title:u,on:{click:()=>n.showGallery(t.kind,d,t.provider)}},i("span",{class:"wphase-ico",html:sr[d]}),u))),i("button",{class:"wlink",on:{click:()=>n.closeWork()}},"Close the demo")].filter(d=>d!==null)}var ft={"auth.google":{kind:"auth",provider:"google"},"auth.github":{kind:"auth",provider:"github"},"supabase.connect":{kind:"db"},"data.feature":{kind:"db"},"access.rule":{kind:"security"},"config.fix":{kind:"security"},"deploy.preview":{kind:"deploy"},"monitoring.add":{kind:"monitor"},"payments.add":{kind:"connect",provider:"stripe"},"email.transactional":{kind:"connect",provider:"resend"},"integration.add":{kind:"connect",provider:"supabase"}},x={spark:'<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 1.8v3.4M8 10.8v3.4M1.8 8h3.4M10.8 8h3.4M3.6 3.6l2 2M10.4 10.4l2 2M12.4 3.6l-2 2M5.6 10.4l-2 2"/></svg>',arrow:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 8h10M9 4l4 4-4 4"/></svg>',play:'<svg viewBox="0 0 16 16" width="13" height="13" fill="currentColor" aria-hidden="true"><path d="M4.5 2.8v10.4L13 8z"/></svg>',grid:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><rect x="2" y="2" width="5" height="5" rx="1.2"/><rect x="9" y="2" width="5" height="5" rx="1.2"/><rect x="2" y="9" width="5" height="5" rx="1.2"/><rect x="9" y="9" width="5" height="5" rx="1.2"/></svg>',fix:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9.8 2.3a3.4 3.4 0 0 0-3.9 4.5L2.4 10.3a1.4 1.4 0 0 0 2 2l3.5-3.5a3.4 3.4 0 0 0 4.5-3.9l-2 2-1.8-.5-.5-1.8z"/></svg>',plug:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M6 2v3M10 2v3M4.5 5h7v2.5a3.5 3.5 0 0 1-7 0zM8 11v3"/></svg>',reload:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13.5 8a5.5 5.5 0 1 1-1.6-3.9M13.5 2.5v3h-3"/></svg>',out:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 3H3v10h10v-3M9 3h4v4M13 3L7.5 8.5"/></svg>',expand:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9.5 2.5h4v4M6.5 13.5h-4v-4M13.5 2.5 9 7M2.5 13.5 7 9"/></svg>',collapse:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13.5 6.5h-4v-4M2.5 9.5h4v4M9.5 6.5 14 2M6.5 9.5 2 14"/></svg>',stop:'<svg viewBox="0 0 16 16" width="11" height="11" aria-hidden="true"><rect x="3" y="3" width="10" height="10" rx="2" fill="currentColor"/></svg>',check:'<svg viewBox="0 0 16 16" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.5 8.5l3 3 6-7"/></svg>',cross:'<svg viewBox="0 0 16 16" width="10" height="10" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" aria-hidden="true"><path d="M4 4l8 8M12 4l-8 8"/></svg>',dash:'<svg viewBox="0 0 16 16" width="10" height="10" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" aria-hidden="true"><path d="M4 8h8"/></svg>',undo:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5.5 3.5 2.5 6.5l3 3"/><path d="M2.5 6.5h7a4 4 0 0 1 0 8H7"/></svg>',diff:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M5 2.5v6M2 5.5h6M9 11.5h5"/><rect x="1.5" y="1.5" width="13" height="13" rx="2.5"/></svg>',plus:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" aria-hidden="true"><path d="M8 3v10M3 8h10"/></svg>',monitor:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="1.5" y="2.5" width="13" height="8.5" rx="1.6"/><path d="M5.5 14h5M8 11v3"/></svg>',shield:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 1.8 2.8 3.6v4.1c0 3.1 2.2 5.4 5.2 6.5 3-1.1 5.2-3.4 5.2-6.5V3.6z"/><path d="M5.8 8l1.6 1.6L10.4 6.4"/></svg>',nodeploy:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 13V5M4.5 8.5 8 5l3.5 3.5"/><path d="M2.5 2.5l11 11"/></svg>',eye:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M1.5 8S4 3.5 8 3.5 14.5 8 14.5 8 12 12.5 8 12.5 1.5 8 1.5 8z"/><circle cx="8" cy="8" r="2"/></svg>',pencil:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10.8 2.7a1.7 1.7 0 0 1 2.5 2.5L5.6 12.9 2.5 13.5l.6-3.1z"/></svg>',bolt:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 1.5 3.5 9H8l-1 5.5L12.5 7H8z"/></svg>',key:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="5" cy="8" r="3"/><path d="M8 8h6.5M12 8v2.5M14 8v1.5"/></svg>',bigCheck:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg>',bigCross:'<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" aria-hidden="true"><path d="M6.5 6.5l11 11M17.5 6.5l-11 11"/></svg>',bigBang:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" aria-hidden="true"><path d="M12 5v9M12 18.5v.5"/></svg>',bigStop:'<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><rect x="5" y="5" width="14" height="14" rx="3" fill="currentColor"/></svg>'};function me(e){return i("span",{class:"ico",html:e})}function Ee(e){return e.agents.find(n=>n.id===e.cliId)?.label.replace(/ CLI$/,"")??(e.cliId==="claude"?"Claude Code":e.cliId==="gemini"?"Gemini":"Codex")}function un(e){if(!e)return"";try{let n=new URL(e);return`${n.hostname}:${n.port}`}catch{return e}}function or(e){let n=l=>e.work.offers.find(o=>o.id===l),t=[],r=n("preview.start");r&&r.availability==="ready"&&t.push(r);let s=n("agent.connect");s&&s.availability==="needs_connection"&&t.push(s);let a=n("findings.fix");return a&&a.availability==="ready"&&t.push(a),t.slice(0,3)}function lr(e,n){return e.id==="preview.start"?{label:"Show my app",svg:x.play}:e.id==="agent.connect"?{label:`Connect ${Ee(n)}`,svg:x.plug}:e.id==="findings.fix"?{label:n.work.facts?.fixable?`Fix ${n.work.facts.fixable} finding${n.work.facts.fixable===1?"":"s"}`:"Fix findings",svg:x.fix}:{label:e.name,svg:x.arrow}}function pn(e,n,t){let r=!!(e.work.run&&!ee(e.work.run.state)),s=r||e.work.busy||e.setup.running,a=or(e),l=e.work.offers.filter(d=>d.availability==="ready"||d.availability==="already_configured").length,o=i("input",{id:"shelf-input",class:"shelf-input",type:"text",autocomplete:"off",spellcheck:!0,maxlength:1200,value:e.work.request,placeholder:r?e.work.run?.agent?`${Ee(e)} is working on your last request\u2026`:"Starting your app\u2026":"What should change in your app?","aria-label":"Describe a change to your app",disabled:s,on:{input:d=>n.setRequest(d.target.value)}});return i("form",{class:`shelf${r?" is-running":""}`,dataset:{slot:"shelf"},"aria-label":"Ask for a change",on:{submit:d=>{d.preventDefault(),n.submitRequest(d.currentTarget.querySelector("#shelf-input")?.value??"")}}},i("div",{class:"shelf-box",dataset:{sig:JSON.stringify([s,r,e.work.request==="",Ee(e)])}},i("span",{class:"shelf-spark",html:x.spark}),o,i("button",{class:"shelf-go",type:"submit",disabled:s},e.work.busy?i("span",{class:"spin","aria-hidden":"true"}):null,"Plan it",e.work.busy?null:me(x.arrow))),i("div",{class:"shelf-row",dataset:{sig:JSON.stringify([a.map(d=>[d.id,d.availability]),l,s,t,e.work.facts?.fixable,Ee(e)])}},...a.map(d=>{let u=lr(d,e);return i("button",{type:"button",class:`shelf-chip${d.id==="preview.start"?" is-main":""}`,title:d.reason,disabled:s&&d.id!=="agent.connect",on:{click:()=>n.runOffer(d)}},me(u.svg),u.label)}),i("button",{id:"shelf-all",type:"button",class:"shelf-chip is-quiet",on:{click:()=>n.toggleCatalog(!0)}},me(x.grid),"All actions",i("span",{class:"shelf-count"},String(e.work.offers.length||28))),i("span",{class:"shelf-note"},t)))}function gn(e){let n=e.work.run;if(!n?.agent)return null;let t=n.agent.cliId,r=!ee(n.state),s=n.steps.find(u=>u.id==="edit"),a=n.changes.length,l=r?"work":n.state==="succeeded"?"pass":n.state==="failed"?"fail":"warn",o=r?s?.state==="active"?a?`Editing \xB7 ${a} file${a===1?"":"s"} so far`:"Reading and editing":n.state==="verifying"?"Done editing \xB7 checks running":"Getting ready":a?`Changed ${a} file${a===1?"":"s"}`:"No files changed",d=e.agents.find(u=>u.id===t)?.label.replace(/ CLI$/,"")??(t==="claude"?"Claude Code":t==="gemini"?"Gemini":"Codex");return i("li",{class:`node is-agent is-${l}`,dataset:{card:"agent",provider:"agent",sig:JSON.stringify([t,l,o,n.agent.accessMode])}},i("span",{class:"node-head"},i("img",{src:Q[t],alt:"",width:18,height:18}),i("span",{class:"node-name"},d)),i("code",{class:"node-detail"},`coding agent \xB7 ${n.agent.accessMode}`),i("span",{class:"node-state"},i("i",{"aria-hidden":"true"}),i("span",{class:"node-text"},o),i("span",{class:"node-verdict"},r?"Working":l==="pass"?"Done":l==="fail"?"Failed":"Review")))}function _e(e,n){let t=e.work.preview,r=t?.state??"idle",s=t?.url,a=r==="ready"&&!!s,l=t?.embeddable!==!1,o=a?"Live":r==="starting"?"Starting":r==="failed"?"Did not start":r==="unavailable"?"No dev script":"Not running",d=i("div",{class:"screen-bar",dataset:{sig:JSON.stringify([r,s,o])}},i("span",{class:"screen-dots","aria-hidden":"true"},i("i"),i("i"),i("i")),i("span",{class:"screen-url"},a?un(s):t?.command??"your app"),i("span",{class:`screen-live is-${r}`},i("i",{"aria-hidden":"true"}),o)),u;if(a&&l&&!e.work.previewExpanded)u=i("div",{class:"screen-body is-live",dataset:{sig:`live|${s}|${t?.revision??0}`}},i("p",{class:"screen-wait"},"Updating\u2026"),i("iframe",{id:"app-frame",src:s,title:"Your app, running on this computer",tabindex:-1,sandbox:"allow-scripts allow-same-origin allow-forms",loading:"eager",referrerpolicy:"no-referrer",on:{load:c=>c.target.classList.add("is-loaded")}}),i("button",{type:"button",class:"screen-open","aria-label":"Try your app in the large view",on:{click:()=>n.togglePreviewExpanded(!0)}},i("span",{},me(x.expand),"Try it")));else if(a&&e.work.previewExpanded)u=i("div",{class:"screen-body is-placeholder",dataset:{sig:"expanded"}},i("p",{},"Open in the large view"));else if(a&&!l)u=i("div",{class:"screen-body is-placeholder",dataset:{sig:`noframe|${s}`}},i("p",{},"This app does not allow being shown inside another page."),i("a",{class:"screen-cta",href:s,target:"_blank",rel:"noreferrer"},me(x.out),"Open in a browser tab"));else if(r==="starting")u=i("div",{class:"screen-body is-skeleton",dataset:{sig:"starting"}},i("span",{class:"sk sk-1"}),i("span",{class:"sk sk-2"}),i("span",{class:"sk sk-3"}),i("p",{},`Starting ${t?.command??"your app"}\u2026`));else if(r==="failed")u=i("div",{class:"screen-body is-placeholder is-failed",dataset:{sig:`failed|${t?.error}`}},i("p",{},t?.reason??t?.error??"The app did not start."));else if(r==="unavailable")u=i("div",{class:"screen-body is-placeholder",dataset:{sig:"unavailable"}},i("p",{},"No dev, start or preview script in package.json."));else{let c=e.work.offers.find(p=>p.id==="preview.start")?.availability==="ready";u=i("div",{class:"screen-body is-placeholder is-idle",dataset:{sig:`idle|${c}`}},i("span",{class:"sk sk-1"}),i("span",{class:"sk sk-2"}),c?i("button",{type:"button",class:"screen-cta",on:{click:()=>void n.planAction("preview.start")}},me(x.play),"Show my app"):i("p",{},"Not running"))}return i("div",{class:`screen is-${r}`,dataset:{slot:"screen"}},d,u)}function hn(e){let n=e.work.run,t=n?.changes??[],r=!!(n&&t.length&&!n.reverted);return i("ul",{class:"app-files",hidden:!r,dataset:{slot:"files"},"aria-label":"Files changed by the run"},...r?t.slice(0,5).map(s=>i("li",{class:`is-${s.kind}`,dataset:{sig:JSON.stringify(s)}},i("code",{title:s.path},s.path.split("/").pop()??s.path),i("span",{class:"add"},`+${s.additions}`),i("span",{class:"del"},`\u2212${s.deletions}`))):[],...r&&t.length>5?[i("li",{class:"more",dataset:{sig:`more${t.length}`}},`+${t.length-5} more`)]:[])}function fn(e,n){let t=e.work.preview;return!e.work.previewExpanded||t?.state!=="ready"||!t.url?[]:[i("section",{class:"appwin",role:"dialog","aria-label":"Your app, live",dataset:{slot:"appwin"}},i("header",{class:"appwin-bar",dataset:{sig:JSON.stringify([t.url,t.revision])}},i("span",{class:"screen-dots","aria-hidden":"true"},i("i"),i("i"),i("i")),i("span",{class:"appwin-url"},i("i",{"aria-hidden":"true"}),un(t.url)),i("span",{class:"appwin-note"},"Your app, running on this computer"),i("span",{class:"spacer"}),i("button",{type:"button",class:"appwin-tool",title:"Reload","aria-label":"Reload the app",on:{click:()=>n.reloadPreview()},html:x.reload}),i("a",{class:"appwin-tool",href:t.url,target:"_blank",rel:"noreferrer",title:"Open in a browser tab","aria-label":"Open in a browser tab",html:x.out}),i("button",{type:"button",class:"appwin-tool",title:"Stop the app","aria-label":"Stop the app",on:{click:()=>void n.stopPreview()},html:x.stop}),i("button",{id:"preview-collapse",type:"button",class:"appwin-tool is-close",title:"Back to the board","aria-label":"Back to the board",on:{click:()=>n.togglePreviewExpanded(!1)},html:x.collapse})),i("div",{class:"appwin-body",dataset:{sig:`${t.url}|${t.revision}`}},i("iframe",{id:"app-frame",src:t.url,title:"Your app, running on this computer",sandbox:"allow-scripts allow-same-origin allow-forms allow-popups allow-modals",referrerpolicy:"no-referrer"})))]}var De={discovering:"Getting ready",planning:"Planning",running:"Working",verifying:"Checking",waiting_for_user:"Waiting for you",succeeded:"Done",partially_completed:"Needs a look",failed:"Did not finish",cancelled:"Stopped",interrupted:"Interrupted"};function Xe(e,n){return i("p",{class:`work-eyebrow is-${n}`},i("i",{"aria-hidden":"true"}),e)}function Pe(e,n){return e.length>n?`${e.slice(0,n-1)}\u2026`:e}function re(e,n,t,r=""){return i("span",{class:`wchip${r?` is-${r}`:""}`,title:t??n},typeof e=="string"?me(e):e,n)}function q(e,n,t,r={}){return i("button",{id:r.id,type:"button",class:`wtile${r.primary?" is-primary":""}${r.danger?" is-danger":""}`,disabled:r.disabled,"aria-pressed":r.pressed===void 0?void 0:String(r.pressed),on:{click:t}},i("span",{class:"wtile-ico",html:e}),i("span",{class:"wtile-label"},n),r.note?i("span",{class:"wtile-note"},r.note):null)}function cn(e){let n=e==="pass"?x.bigCheck:e==="fail"?x.bigCross:e==="warn"?x.bigBang:e==="wait"?x.key:x.bigStop;return i("span",{class:`wbadge is-${e}`,html:n})}function cr(e,n){let t=Q[n]??Q.claude;return re(i("img",{src:t,alt:"",width:14,height:14}),e.agents.find(r=>r.id===n)?.label.replace(/ CLI$/,"")??(n==="claude"?"Claude Code":n==="gemini"?"Gemini":"Codex"))}function dr(e,n){let t=e.work.plan,r=t.plan,s=t.actionId==="app.change",a=e.probes[e.cliId]?.ready===!0,l=e.busy.probe===e.cliId,o=r.checks.length?r.checks.map(p=>p.replace("The preview still loads","page loads")).join(" + "):"no checks",d=s?[re(x.monitor,"This computer",r.target),cr(e,e.cliId),re(x.shield,Pe(o,28),`Then checks: ${r.checks.join(", ")||"nothing (no typecheck or test script)"}`),re(x.nodeploy,"No deploy",`Will not: ${r.willNot.join(", ")}`)]:[re(x.play,e.work.facts?.previewCommand??"npm run dev"),re(x.monitor,"This computer"),re(x.nodeploy,"No installs",`Will not: ${r.willNot.join(", ")}`)],u=(p,h,f,g)=>i("button",{type:"button",role:"radio","aria-checked":String(e.accessMode===p),class:`wmode${e.accessMode===p?" on":""}`,title:g,disabled:e.work.busy,on:{click:()=>void n.setWorkAccess(p)}},i("span",{class:"wmode-ico",html:h}),f),c=!s||a?q(x.play,s?e.accessMode==="ask"?"Get a plan":"Make the change":"Start the app",()=>void n.startPlanned(),{id:"work-start",primary:!0,disabled:e.work.busy}):q(x.plug,l?"Testing\u2026":`Connect ${Ee(e)}`,()=>void n.testConnection(e.cliId),{id:"work-start",primary:!0,disabled:l});return[Xe("Plan \xB7 nothing runs until you start","plan"),i("h1",{id:"stage-heading",tabindex:-1,class:"wtitle"},s?Pe(r.outcome,90):"Show my app"),i("div",{class:"wchips"},...d),s?i("div",{class:"wmodes",role:"radiogroup","aria-label":"What the agent may do"},u("ask",x.eye,"Ask","Plan only. The agent edits nothing."),u("approve",x.pencil,"Edit","The agent edits files in this project."),u("full",x.bolt,"Full","Full local access. Still explains anything destructive.")):null,e.work.error?i("p",{class:"work-error",role:"alert"},e.work.error):null,i("div",{class:"wtiles is-one",dataset:{sig:JSON.stringify(["go",s,a,l,e.accessMode,e.work.busy,e.cliId])}},c),i("button",{class:"wlink",on:{click:()=>s?n.newChange():n.closeWork()}},s?"Change the request":"Cancel")].filter(p=>p!==null)}var ur={done:x.check,failed:x.cross,skipped:x.dash,unknown:"?"};function dn(e,n){return i("ol",{class:`work-steps${n?" is-compact":""}`,dataset:{slot:"steps"}},...e.steps.map(t=>i("li",{class:`work-step is-${t.state}`,dataset:{sig:JSON.stringify([t.state,t.detail,n,t.id==="edit"?e.changes.map(r=>`${r.path}:${r.additions}:${r.deletions}`):0])}},i("span",{class:"work-mark","aria-hidden":"true",html:ur[t.state]??""}),i("div",{class:"work-step-copy"},i("span",{class:"work-step-label"},t.label),(!n||t.state==="active"||t.state==="failed")&&t.detail?i("span",{class:"work-step-detail"},t.detail):null,t.id==="edit"&&e.changes.length?i("ul",{class:"work-files"},...e.changes.slice(0,n?3:8).map(r=>i("li",{class:`is-${r.kind}`},i("code",{},r.path),i("span",{class:"add"},`+${r.additions}`),i("span",{class:"del"},`\u2212${r.deletions}`)))):null))))}function pr(e){return e.checks.length?i("div",{class:"wchips"},...e.checks.map(n=>re(n.status==="passed"?x.check:n.status==="failed"?x.cross:x.dash,n.label.replace("The preview still loads","Page loads").replace("The page loads","Page loads"),n.detail??n.command,n.status==="passed"?"pass":n.status==="failed"?"fail":""))):null}function gr(e){return e.split(`
10
+ `).map(n=>{let t=ye(n);return n.startsWith("+++")||n.startsWith("---")||n.startsWith("@@")?`<span class="hd">${t}</span>`:n.startsWith("+")?`<span class="add">${t}</span>`:n.startsWith("-")?`<span class="del">${t}</span>`:t}).join(`
11
+ `)}function hr(e,n){let t=e.work.run,r=!ee(t.state),s=t.state==="waiting_for_user"&&t.waiting?t.waiting:null,a=s?"wait":r?"work":t.state==="succeeded"?"pass":t.state==="failed"||t.state==="interrupted"?"fail":t.state==="cancelled"?"stop":"warn",l=t.steps.find(w=>w.state==="active"),o=t.actionId==="app.change",d=e.work.preview,u=d?.state==="ready"&&!!d.url,c=t.result,p=e.work.diff?.runId===t.id;if(s)return[Xe("Waiting for you","wait"),i("div",{class:"whead"},cn("wait"),i("h1",{id:"stage-heading",tabindex:-1,class:"wtitle"},s.title)),i("p",{class:"wline"},s.missing?.length?`Add ${s.missing.length===1?"this":"these"} to .env.local, save, then check again. Test values are fine here.`:s.detail),s.missing?.length?i("div",{class:"wchips"},...s.missing.map(w=>re(x.key,w,w,"wait"))):null,i("div",{class:"wtiles is-one",dataset:{sig:JSON.stringify(["resume",t.id,s.action,e.work.busy])}},q(x.reload,s.action,()=>void n.resumeRun(),{id:"work-resume",primary:!0,disabled:e.work.busy})),i("button",{class:"wlink is-danger",on:{click:()=>void n.cancelRun()}},"Stop")].filter(w=>w!==null);if(r)return[Xe(`${De[t.state]}`,"work"),i("h1",{id:"stage-heading",tabindex:-1,class:"wtitle"},o?Pe(t.inputs.request??"",80):"Starting your app"),i("p",{class:"work-live",role:"status","aria-live":"polite"},i("span",{class:"work-pulse","aria-hidden":"true"}),l?.label??De[t.state],i("span",{class:"work-elapsed",dataset:{since:t.createdAt}})),dn(t,!0),i("div",{class:"wtiles is-one",dataset:{sig:`stop|${t.id}`}},q(x.bigStop,"Stop",()=>void n.cancelRun(),{danger:!0,note:o?"Keeps what already changed":void 0}))];let h=[];u&&h.push(q(x.play,"Try it",()=>n.togglePreviewExpanded(!0),{id:"work-try",primary:!0})),!o&&(t.state==="failed"||t.state==="cancelled")?h.push(q(x.reload,"Try again",()=>void n.planAction("preview.start"),{id:"work-retry",primary:!0})):o&&!u&&e.work.offers.find(w=>w.id==="preview.start")?.availability==="ready"&&h.push(q(x.play,"Show my app",()=>void n.planAction("preview.start"),{id:"work-try",primary:!0})),o&&t.changes.length&&h.push(q(x.diff,p?"Hide change":"Review",()=>void n.showDiff(),{pressed:p}));let f=t.changes.filter(w=>w.owner==="agent");o&&f.length&&!t.reverted&&h.push(fr(t,f.length,n)),o&&h.push(q(x.plus,"New",()=>n.newChange()));let g=[dn(t,!1),c?.unknowns?.length?i("section",{class:"work-unknowns","aria-label":"Not checked"},i("h2",{},"Not checked"),i("ul",{},...c.unknowns.map(w=>i("li",{},w)))):null,...t.checks.filter(w=>w.status==="failed"&&w.detail).map(w=>i("pre",{class:"work-detail"},w.detail)),c?.agentAnswer?i("div",{class:"agent-reply-body",html:_(c.agentAnswer)}):null].filter(w=>w!==null);return[Xe(`${De[t.state]} \xB7 ${F(t.updatedAt)}`,a==="stop"?"plan":a),i("div",{class:"whead"},cn(a),i("h1",{id:"stage-heading",tabindex:-1,class:"wtitle"},c?.title??De[t.state])),c?.summary?i("p",{class:"wline"},Pe(c.summary,140)):null,pr(t),t.reverted?i("p",{class:"work-hint"},`Undone: ${t.reverted.restored.length} file${t.reverted.restored.length===1?"":"s"} put back${t.reverted.skipped.length?`, ${t.reverted.skipped.length} left as they were`:""}.`):null,h.length?i("div",{class:`wtiles${h.length===1?" is-one":""}`,dataset:{sig:JSON.stringify(["done",t.id,t.state,u,p,f.length,!!t.reverted,h.length])}},...h):null,p?i("section",{class:"work-diff","aria-label":"The change"},...e.work.diff.files.length?e.work.diff.files.map(w=>mr(t,w,n)):[i("p",{class:"work-hint"},"Nothing left to show: the files match where the run started.")]):null,i("details",{class:"wdetails"},i("summary",{},"Details"),...g)].filter(w=>w!==null)}var Se=null;function fr(e,n,t){let r=Se===e.id,s=`the ${n} file${n===1?"":"s"} proven to be the agent\u2019s own edit${n===1?"":"s"}`,a=q(x.undo,r?"Sure?":"Undo",()=>{if(Se!==e.id){Se=e.id,a.querySelector(".wtile-label").textContent="Sure?",a.classList.add("is-danger"),a.title=`Put back ${s}. Click again.`,window.setTimeout(()=>{Se===e.id&&(Se=null,a.querySelector(".wtile-label").textContent="Undo",a.classList.remove("is-danger"))},6e3);return}Se=null,t.undoRun()},{danger:r,note:n<e.changes.length?`${n} of ${e.changes.length} files`:void 0});return a.title=`Put back ${s}. Anything else that changed is left alone.`,a}var Ae=null;function mr(e,n,t){let r=e.changes.find(u=>u.path===n.path),s=e.restoredFiles?.includes(n.path),a=!!(r&&r.owner!=="agent"&&!s&&!e.reverted?.restored.includes(n.path)),l=`${e.id}:${n.path}`,o=a?i("button",{type:"button",class:`wlink diff-restore${Ae===l?" is-danger":""}`,title:"Put this file back to how it was when the run started. Any edits in it, yours included, go too; VibeRaven keeps a copy of it as it is now.",on:{click:u=>{if(Ae!==l){Ae=l,u.currentTarget.textContent="Sure? Put it back",u.currentTarget.classList.add("is-danger"),window.setTimeout(()=>{Ae===l&&(Ae=null)},6e3);return}Ae=null,t.restoreFile(n.path)}}},"Put back"):null,d=s?"Put back by you":a?"Not undone automatically":null;return i("div",{class:"work-diff-file"},i("h3",{},n.path,d?i("span",{class:`diff-note${a?" is-warn":""}`,title:a?"It changed during the run, but VibeRaven cannot prove it was only the agent\u2019s edit, so Undo leaves it alone.":void 0},d):null,o),i("pre",{class:"out diff",tabindex:0,html:gr(n.diff)}))}function mn(e,n){return e.work.gallery?ln(e,n):e.work.plan?dr(e,n):e.work.run?hr(e,n):[i("h1",{id:"stage-heading",tabindex:-1},"Nothing running"),i("p",{class:"stage-sub"},"Describe a change in the box under your app, or pick an action."),wr(e)].filter(t=>t!==null)}function wr(e){return e.work.history.length?i("section",{class:"work-history","aria-label":"Earlier runs"},i("h2",{},"Earlier"),i("ul",{},...e.work.history.slice(0,6).map(n=>i("li",{class:`is-${n.state}`},i("strong",{},n.inputs?.request?Pe(n.inputs.request,70):n.actionId==="preview.start"?"Show my app":n.actionId),i("span",{},`${De[n.state]??n.state} \xB7 ${F(n.createdAt)}${n.changes?` \xB7 ${n.changes} file${n.changes===1?"":"s"}`:""}`))))):null}var yr={ready:"Ready",needs_connection:"Needs a connection",needs_information:"Waiting",guided:"Guided",unsupported:"Not for this app",already_configured:"Done",planned:"Planned"};function wn(e,n){let t=["Start","Build","Connect","Data","Security","Release","Business","Improve"],r=e.work.offers.filter(s=>s.executable).length;return i("div",{},i("p",{class:"catalog-intro"},`${r} of ${e.work.offers.length} actions run in this version. The rest are planned and cannot start yet.`),...t.map(s=>{let a=e.work.offers.filter(l=>l.family===s);return a.length?i("section",{class:"block catalog-group","aria-label":s},i("div",{class:"block-head"},i("h4",{},s)),i("ul",{class:"catalog-list"},...a.map(l=>{let o=l.executable&&(l.availability==="ready"||l.availability==="needs_connection"||l.id==="app.change");return i("li",{class:`catalog-item is-${l.availability}`},i("div",{class:"catalog-copy"},i("strong",{},l.name),i("span",{},l.outcome),i("span",{class:"catalog-reason"},l.reason)),i("span",{class:`catalog-state is-${l.availability}`},yr[l.availability]??l.availability),o&&l.availability!=="already_configured"?i("button",{class:"btn sm",on:{click:()=>{n.toggleCatalog(!1),n.runOffer(l)}}},l.availability==="needs_connection"?"Connect":l.id==="app.change"?"Describe it":"Start"):ft[l.id]?i("button",{class:"btn sm ghost",title:"A simulated preview of how this action will look. It does not run.",on:{click:()=>n.showGallery(ft[l.id].kind,"work",ft[l.id].provider)}},"See the scene"):null)}))):null}))}var P={check:'<svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.5 8.5l3 3 6-7"/></svg>',arrow:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 8h10M9 4l4 4-4 4"/></svg>',back:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13 8H3M7 4L3 8l4 4"/></svg>',copy:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><rect x="5.5" y="5.5" width="8" height="8" rx="1.6"/><path d="M10.5 5.5V3.6c0-.6-.5-1.1-1.1-1.1H3.6c-.6 0-1.1.5-1.1 1.1v5.8c0 .6.5 1.1 1.1 1.1h1.9"/></svg>',more:'<svg viewBox="0 0 16 16" width="14" height="14" fill="currentColor" aria-hidden="true"><circle cx="3" cy="8" r="1.4"/><circle cx="8" cy="8" r="1.4"/><circle cx="13" cy="8" r="1.4"/></svg>',out:'<svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 3H3v10h10v-3M9 3h4v4M13 3L7.5 8.5"/></svg>',scan:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 5V3.5C2 2.7 2.7 2 3.5 2H5M11 2h1.5c.8 0 1.5.7 1.5 1.5V5M14 11v1.5c0 .8-.7 1.5-1.5 1.5H11M5 14H3.5C2.7 14 2 13.3 2 12.5V11"/><circle cx="7.6" cy="7.6" r="2.4"/><path d="M9.4 9.4 11 11"/></svg>',fix:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9.8 2.3a3.4 3.4 0 0 0-3.9 4.5L2.4 10.3a1.4 1.4 0 0 0 2 2l3.5-3.5a3.4 3.4 0 0 0 4.5-3.9l-2 2-1.8-.5-.5-1.8z"/></svg>',recheck:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13.5 8a5.5 5.5 0 0 1-9.6 3.7M2.5 8a5.5 5.5 0 0 1 9.6-3.7"/><path d="M12.5 1.8v2.7H9.8M3.5 14.2v-2.7h2.7"/></svg>',launch:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 2.5v11M3 3h8.5l-1.8 2.8L11.5 8.6H3"/></svg>',pr:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="4" cy="3.5" r="1.6"/><circle cx="4" cy="12.5" r="1.6"/><circle cx="12" cy="12.5" r="1.6"/><path d="M4 5.1v5.8M12 10.9V6.5a2 2 0 0 0-2-2H7.5M9 3 7.5 4.5 9 6"/></svg>',zoomIn:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" aria-hidden="true"><path d="M8 3.5v9M3.5 8h9"/></svg>',zoomOut:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" aria-hidden="true"><path d="M3.5 8h9"/></svg>',reset:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.5 6V2.5H6M13.5 10v3.5H10M2.5 2.5l4 4M13.5 13.5l-4-4"/></svg>',app:'<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="1.8" y="2.5" width="12.4" height="11" rx="2"/><path d="M1.8 5.5h12.4M6 8.4 4.6 9.8 6 11.2M10 8.4l1.4 1.4-1.4 1.4"/></svg>'},br={critical:"Critical",warning:"Important",info:"Nice to have"};function we(e){return i("span",{class:"ico",html:e})}function Oe(e){return(e||"Project").replace(/^@[^/]+\//,"").split(/[-_\s]+/).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function ue(e){let n=e.project.project;return(n?.name&&n.name!=="Project"?n.name:(n?.path??"").split(/[\\/]/).filter(Boolean).pop())||"your-app"}function Je(e,n=e.cliId){return e.agents.find(t=>t.id===n)?.label.replace(/ CLI$/,"")??(n==="claude"?"Claude Code":n==="gemini"?"Gemini":"Codex")}function bn(e,n){let t=e.project.project,r=e.project.releases?.[0],s=kn(e,R(e));return i("header",{class:"top",dataset:{slot:"top"}},i("span",{class:"brand","aria-label":"VibeRaven"},i("span",{class:"brand-mark","aria-hidden":"true",html:He}),i("span",{class:"brand-word","aria-hidden":"true"},"VibeRaven")),i("span",{class:"top-project"},i("span",{class:"top-sep","aria-hidden":"true"},"/"),i("strong",{},Oe(ue(e))),i("span",{class:"top-sep","aria-hidden":"true"},"/"),i("code",{},[r?.branch,t?.version?`v${t.version.replace(/^v/,"")}`:null].filter(Boolean).join(" \xB7 ")||"local")),i("span",{class:"spacer"}),vr(e,n),i("span",{class:`top-verdict is-${s.tone}`},i("i",{"aria-hidden":"true"}),s.text),i("div",{class:"more-wrap"},i("button",{id:"open-more",class:`quiet more-button${e.moreOpen?" on":""}`,"aria-haspopup":"menu","aria-expanded":String(e.moreOpen),"aria-controls":"more-menu",on:{click:()=>n.toggleMore()}},"More",we(P.more)),e.moreOpen?kr(e,n):null))}function vr(e,n){let t=R(e),r=e.flow.step,s=(a,l,o,d,u={})=>i("button",{id:a,class:"top-tab","aria-current":o?"page":void 0,disabled:u.disabled,on:{click:d}},l,u.count?i("span",{class:"top-tab-count"},String(u.count)):null);return i("nav",{class:"top-tabs","aria-label":"Views"},s("tab-stack","Stack",r==="app"&&!e.drawer,()=>{e.drawer&&n.toggleDrawer(null),n.goToStep("app")}),s("tab-findings","Findings",r==="findings"&&!e.drawer,()=>{e.drawer&&n.toggleDrawer(null),n.goToStep("findings")},{disabled:!t.available.findings,count:t.findings.length}),s("tab-terminal","Agents",e.drawer==="terminal",()=>n.openMore("terminal")),s("tab-releases","Releases",e.drawer==="releases",()=>n.openMore("releases")))}function kr(e,n){let t=e.agents.filter(s=>e.probes[s.id]?.ready).length,r=[{id:"services",label:"Services",note:"Browse, add and check services live"},{id:"terminal",label:"Coding agents",note:t?`${t} connected`:"Install, sign in, test"},{id:"chat",label:"Agent chat",note:"Ask your agent anything about this app"},{id:"releases",label:"Releases",note:(e.project.releases??[]).length?"History and diffs":"Compare any two commits"}];return i("div",{id:"more-menu",class:"more-menu",role:"menu","aria-label":"More",on:{keydown:s=>{let a=s.key;if(a!=="ArrowDown"&&a!=="ArrowUp")return;s.preventDefault();let l=Array.from(s.currentTarget.querySelectorAll('[role="menuitem"]')),o=l.indexOf(document.activeElement);l[(o+(a==="ArrowDown"?1:-1)+l.length)%l.length]?.focus()}}},...r.map(s=>i("button",{role:"menuitem",class:"more-item",on:{click:()=>n.openMore(s.id)}},i("strong",{},s.label),i("span",{},s.note))))}function vn(e,n,t){let r=Et(n,e),s=e.flow.step,a=n.scanning||e.setup.running,l=()=>{s==="fix"&&n.current?t.checkAgain():n.available.recheck?t.goToStep("recheck"):t.checkMyApp()},o=[{key:"scan",id:"check-my-app",label:n.scanning?"Scanning":"Scan",svg:P.scan,meta:r.app,current:s==="app",disabled:a,passed:n.scanned,onClick:()=>void t.checkMyApp()},{key:"fix",label:"Fix",svg:P.fix,meta:r.fix,current:s==="fix",disabled:!n.available.fix||a,passed:!1,onClick:()=>t.goToStep("fix")},{key:"recheck",label:"Re-check",svg:P.recheck,meta:r.recheck,current:s==="recheck",disabled:!n.scanned||a,passed:e.flow.recheck?.status==="fixed",onClick:l},{key:"ready",label:"Launch",svg:P.launch,meta:r.ready,current:s==="ready",disabled:!n.available.ready,passed:!1,onClick:()=>t.goToStep("ready")}];return i("nav",{class:`rail${n.scanning?" is-scanning":""}`,"aria-label":"Launch path",dataset:{slot:"rail"}},i("ol",{},...o.map(d=>i("li",{class:`rail-step is-${d.current?"current":d.disabled?"locked":d.passed?"passed":"open"}`},i("button",{id:d.id,class:"rail-button",title:d.meta,"aria-current":d.current?"step":void 0,disabled:d.disabled,on:{click:d.onClick}},i("span",{class:"rail-mark","aria-hidden":"true",html:d.svg}),i("span",{class:"rail-copy"},i("span",{class:"rail-label"},d.label),i("span",{class:"rail-meta"},d.meta)),d.key==="scan"&&n.scanning?i("i",{class:"rail-time","aria-hidden":"true"}):null)))))}function kn(e,n){if(n.scanning)return{text:"Checking your app",tone:"pending"};if(!n.scanned)return{text:"Not checked yet",tone:"pending"};if(n.counts.critical)return{text:`${n.counts.critical} blocker${n.counts.critical===1?"":"s"}`,tone:"fail"};if(n.findings.length)return{text:`${n.findings.length} to review`,tone:"warn"};let t=n.checklist.filter(s=>!s.done).length,r=t?` \xB7 ${t} unknown${t===1?"":"s"}`:"";return{text:n.gateClear?`No blockers in repo checks${r}`:"No blockers in repo checks",tone:"pass"}}var Mr={pending:"Unknown",pass:"Repo checked",warn:"Review",fail:"Blockers"};function Lr(e){let n=e.stateText.replace(/^(Repo checks|Unknown)\s*·\s*/,"")||e.stateText;return n.charAt(0).toUpperCase()+n.slice(1)}function yn(e,n=null){return i("li",{class:`node is-${e.tone}${e.id===n?" is-focus":""}`,dataset:{provider:e.id,card:e.id,sig:JSON.stringify([e.id,e.tone,e.stateText,e.mark,e.id===n])}},i("span",{class:"node-head"},e.mark?i("img",{src:e.mark,alt:"",width:18,height:18}):i("span",{class:"node-fallback"},e.name.slice(0,1)),i("span",{class:"node-name"},e.name)),e.area?i("code",{class:"node-detail"},e.area.toLowerCase()):null,i("span",{class:"node-state"},i("i",{"aria-hidden":"true"}),i("span",{class:"node-text"},Lr(e)),i("span",{class:"node-verdict"},Mr[e.tone])))}function xr(){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("class","board-lines"),e.setAttribute("aria-hidden","true"),e.setAttribute("data-sig","lines"),e}function Sr(e,n,t){let r=e.project.project,s=kn(e,n),a=gn(e),l=!!(e.work.run&&!ee(e.work.run.state)),o=n.services.length<=3,d=o?[]:n.services.filter((w,b)=>b%2===0),u=o?n.services:n.services.filter((w,b)=>b%2===1),c=n.scanned?[r?.archetype&&r.archetype!=="unknown"?r.archetype:null,r?.scannedAt?`Checked ${F(r.scannedAt)}`:null,typeof e.project.gate?.score=="number"?`Heuristic repo-check score ${e.project.gate.score} of 100`:null].filter(w=>!!w):[],p=e.flow.step==="app"?null:e.flow.step==="fix"?n.current?.service?.id??null:e.contextProviderId,h=n.services.length>0||!!a,f=[...a&&!o?[a]:[],...d.map(w=>yn(w,p))],g=[...a&&o?[a]:[],...u.map(w=>yn(w,p))];return i("figure",{class:`board has-screen${n.scanning?" is-scanning":""}${l?" is-working":""}${h?o?" is-side":"":" is-solo"}`,dataset:{slot:"board",lines:h?"1":"",layoutKey:e.project.project?.path||ue(e)},"aria-label":`${Oe(ue(e))} and the services found in its code`},xr(),i("ul",{class:"board-col left",hidden:!f.length,dataset:{slot:"left"}},...f),i("div",{class:`board-app is-${s.tone}${l?" is-working":""}`,dataset:{card:"app",slot:"app"}},i("span",{class:"node-head",dataset:{sig:`head|${ue(e)}`}},we(P.app),i("span",{class:"node-name"},Oe(ue(e)))),i("code",{class:"board-app-name",dataset:{sig:`name|${ue(e)}|${e.project.releases?.[0]?.branch??""}`}},[ue(e),e.project.releases?.[0]?.branch].filter(Boolean).join(" \xB7 ")),_e(e,t),i("p",{class:"board-status",dataset:{sig:`status|${s.text}`}},i("strong",{},s.text)),hn(e),i("ul",{class:"board-checks",hidden:!c.length,dataset:{sig:`checks|${c.join("|")}`}},...c.map(w=>i("li",{},i("i",{"aria-hidden":"true"}),w)))),i("ul",{class:"board-col right",hidden:!g.length,dataset:{slot:"right"}},...g))}function et(e){let n=e.querySelector(".board-lines"),t=e.querySelector(".board-app");if(!n||!t)return;let r=e.getBoundingClientRect(),s=e.offsetWidth,a=e.offsetHeight;if(!r.width||!s)return;let l=r.width/s;if(n.setAttribute("viewBox",`0 0 ${Math.round(s)} ${Math.round(a)}`),n.setAttribute("width",String(Math.round(s))),n.setAttribute("height",String(Math.round(a))),getComputedStyle(n).display==="none"){n.innerHTML="";return}let o=t.getBoundingClientRect(),d=o.left+o.width/2,u=Array.from(e.querySelectorAll(".node")),c=f=>(f-r.left)/l,p=f=>(f-r.top)/l,h=u.map((f,g)=>{let w=f.getBoundingClientRect(),b=w.left+w.width/2<d,M=c(b?o.left:o.right),$=p(o.top+o.height/2)+(g%4-1.5)*Math.min(22,o.height/l/7),y=c(b?w.right:w.left),k=p(w.top+w.height/2),E=(M+y)/2,A=/is-(work|pass|warn|fail|pending)/.exec(f.className)?.[1]??"pending",I=`M ${M.toFixed(1)} ${$.toFixed(1)} C ${E.toFixed(1)} ${$.toFixed(1)} ${E.toFixed(1)} ${k.toFixed(1)} ${y.toFixed(1)} ${k.toFixed(1)}`;return`<path class="line is-${A}" d="${I}"/><path class="pulse is-${A}" pathLength="1" style="animation-delay:${(g*.6).toFixed(2)}s" d="${I}"/>`});n.innerHTML=h.join("")}function K(e,n){let t=[i("h1",{id:"stage-heading",tabindex:-1},e)];return n&&t.push(i("p",{class:"stage-sub"},n)),t}function z(e,n,t={}){return i("div",{class:"primary-row"},i("button",{id:t.id??"primary-action",class:"primary",disabled:t.disabled,on:{click:n}},t.busy?i("span",{class:"spin","aria-hidden":"true"}):null,e,t.busy?null:we(P.arrow)),t.note?i("span",{class:"primary-note"},t.note):null)}function mt(e,n,t={}){return i("button",{class:"quiet",disabled:t.disabled,on:{click:n}},t.icon?we(t.icon):null,e)}function Mn(e){return i("span",{class:`sev is-${e.severity}`},i("i",{"aria-hidden":"true"}),br[e.severity])}function Ln(e,n=!1){if(!e.locations.length)return null;let[t,...r]=e.locations;return i("span",{class:"where"},i("code",{title:e.locations.join(`
12
+ `)},n?t:Dt(t)),r.length?i("span",{class:"where-more"},`+${r.length} more`):null)}function Ar(e,n){let t=e.project.project,r=n.services.length,s=n.scanning?"Reading your code and the services it uses. Nothing leaves this computer.":r?`${r} service${r===1?"":"s"} found in this code.`:"No hosted services found in this code yet.",a=n.scanning?"Checking on this computer, offline.":n.scanned?`Last check ${F(t.scannedAt)} \xB7 runs on this computer, offline`:"Press Scan to check your app. It runs on this computer, offline.";return[i("h1",{id:"stage-heading",tabindex:-1,class:"sr-only"},Oe(ue(e))),i("p",{class:"sr-only",role:"status"},`${s} ${a}`)]}function Cr(e,n){let t=e.project.project;return n.scanning?"Checking on this computer, offline.":n.scanned&&t?.scannedAt?`Last check ${F(t.scannedAt)} \xB7 everything runs on this computer`:"Everything runs on this computer."}function $r(e,n,t){let r=n.fixable[0],s=e.project.project?.scannedAt;if(!n.findings.length)return[...K("Nothing to fix",`The check ${s?F(s):""} found no blockers in this code.`),z("Go to the launch checklist",()=>t.goToStep("ready"))];let a=[n.counts.critical?`${n.counts.critical} critical`:null,n.counts.warning?`${n.counts.warning} important`:null,n.counts.info?`${n.counts.info} nice to have`:null].filter(Boolean).join(", "),l=(o,d,u)=>o?i("span",{class:`fchip is-${d}`},i("i",{"aria-hidden":"true"}),`${o} ${u}`):null;return[i("h1",{id:"stage-heading",tabindex:-1},`${n.findings.length} finding${n.findings.length===1?"":"s"}`),i("div",{class:"fchips"},l(n.counts.critical,"critical","critical"),l(n.counts.warning,"warning","important"),l(n.counts.info,"info","nice to have"),i("span",{class:"fchip is-time"},`Checked ${s?F(s):"just now"}`)),i("div",{class:"findings"},...n.groups.map(o=>i("section",{class:"group","aria-label":o.name},i("header",{class:"group-head"},o.mark?i("img",{src:o.mark,alt:"",width:22,height:22}):i("span",{class:"group-code","aria-hidden":"true"},"</>"),i("h2",{},o.name),i("span",{class:"group-count"},String(o.findings.length))),i("ul",{},...o.findings.map(d=>{let u=d.id===r?.id,c=[i("span",{class:"finding-main"},i("span",{class:"finding-title"},d.title),i("span",{class:"finding-meta"},Mn(d),d.dashboard?i("span",{class:"finding-tag"},"In your dashboard"):d.actionDestination==="manual-review"?i("span",{class:"finding-tag"},"Check by hand"):Ln(d))),d.dashboard?null:i("span",{class:"finding-go"},u?"Fix first":"Fix")];return i("li",{},d.dashboard?i("div",{class:`finding is-${d.severity} is-static`,dataset:{provider:d.service?.id??""}},...c):i("button",{class:`finding is-${d.severity}${u?" is-first":""}`,dataset:{provider:d.service?.id??""},on:{click:()=>t.fixFinding(d.id)}},...c))}))))),r?i("div",{class:"wtiles is-one findings-go"},i("button",{id:"fix-first",type:"button",class:"wtile is-primary",title:r.title,on:{click:()=>t.fixFinding()}},i("span",{class:"wtile-ico",html:P.fix}),i("span",{class:"wtile-label"},r.severity==="critical"?"Fix the first blocker":"Fix the first finding"))):z("Go to the launch checklist",()=>t.goToStep("ready"),{note:"Review the remaining provider and live-evidence steps."})]}function Ir(e,n,t){let r=e.agents.filter(s=>s.installed);return r.length?i("div",{class:"agent-choice",role:"radiogroup","aria-label":"Coding agent"},...r.map(s=>{let a=e.probes[s.id],l=s.id===e.cliId;return i("button",{role:"radio","aria-checked":String(l),class:`agent-option${l?" on":""}`,disabled:t,on:{click:()=>n.selectCli(s.id)}},i("i",{class:a?.ready?"ok":a?"no":"","aria-hidden":"true"}),s.label.replace(/ CLI$/,""))})):null}function jr(e,n,t){let r=n.current;if(!r)return[...K("Nothing to fix in code","Choose a finding to review, or inspect the remaining checklist steps."),z("Go to the launch checklist",()=>t.goToStep("ready"))];let s=n.fixable.findIndex(h=>h.id===r.id),a=e.flow.handoff?.findingId===r.id?e.flow.handoff:null,l=Je(e),o=e.probes[e.cliId],d=e.agents.filter(h=>h.installed),u=a?.status==="running",c=e.busy.probe===e.cliId,p;return u?p=z(`${l} is working`,()=>{},{disabled:!0,busy:!0,note:"It edits files in this repo. You review the change."}):a?.status==="done"?p=z("Check again",()=>void t.checkAgain(),{id:"check-again",note:"Runs the same local check to see if the fix held."}):d.length?o?.ready?p=z(a?.status==="failed"?`Send to ${l} again`:`Send to ${l}`,()=>void t.sendFix(),{id:"send-fix",note:e.accessMode==="ask"?"Ask mode is on: the agent will only plan, not edit. Change it in More, Agent chat.":`${l} edits files in this repo. You review the change.`}):p=z(c?`Connecting ${l}`:`Connect ${l}`,()=>void t.testConnection(e.cliId),{disabled:c,busy:c,note:o?o.message:`VibeRaven runs ${l} on this computer with your own sign-in.`}):p=z("Copy the prompt",()=>void t.copyFix(),{note:"No coding agent found on this computer. Paste it into any agent."}),[...K(r.title),i("div",{class:"fix-meta"},Mn(r),i("span",{class:"fix-count"},`Blocker ${s+1} of ${n.fixable.length}${r.service?` \xB7 ${r.service.name}`:""}`),Ln(r,!0)),r.summary?i("p",{class:"fix-summary"},r.summary):null,r.evidence.length?i("ul",{class:"fix-evidence"},...r.evidence.slice(0,4).map(h=>i("li",{},h))):null,i("section",{class:"prompt","aria-label":"Prompt for your agent"},i("header",{},i("h2",{},"Prompt for your agent"),mt("Copy",()=>void t.copyFix(),{icon:P.copy})),i("pre",{tabindex:0},r.prompt)),Ir(e,t,u||e.busy.chat),u?i("p",{class:"working-line",role:"status"},i("span",{dataset:{working:"1"}},`${l} is working\u2026`),i("button",{class:"quiet stop",on:{click:()=>void t.stop()}},"Stop")):null,a&&a.status!=="running"?i("section",{class:`agent-reply is-${a.status}`,"aria-label":`${Je(e,a.cliId)} replied`},i("h2",{},a.status==="done"?`${Je(e,a.cliId)} replied`:`${Je(e,a.cliId)} did not finish`),i("div",{class:"agent-reply-body",html:_(a.output)})):null,p,i("div",{class:"quiet-row"},mt("Back to findings",()=>t.goToStep("findings"),{icon:P.back}),a?.status!=="done"?mt("Fixed it yourself? Check again",()=>void t.checkAgain(),{disabled:u||n.scanning}):null)].filter(h=>h!==null)}function Tr(e,n,t){let r=e.flow.recheck;if(!r)return[...K("Nothing to check yet","Fix a blocker first, then check again here."),z("Back to findings",()=>t.goToStep("findings"))];let s=typeof r.scoreBefore=="number"&&typeof r.scoreAfter=="number"&&r.scoreBefore!==r.scoreAfter?i("p",{class:"score-move"},`Heuristic repo-check score ${r.scoreBefore} \u2192 ${r.scoreAfter}`):null;if(r.status==="running")return[...K("Checking again",`Running the same local check to see if \u201C${r.title}\u201D is gone.`),i("div",{class:"recheck-meter",role:"status"},i("span",{class:"spin"}),"Reading the repo"),z("Checking",()=>{},{disabled:!0,busy:!0})];if(r.status==="fixed"){let a=n.fixable.find(l=>l.id===r.nextId);return[...K("Scenario passed locally",`\u201C${r.title}\u201D no longer shows up in the check.`),s,i("p",{class:"recheck-next",role:"status"},a?`Next: ${a.title}`:"That was the last blocker in the code."),a?z("Next blocker",()=>t.fixFinding(a.id),{note:"Moving on by itself in a moment."}):z("Go to the launch checklist",()=>t.goToStep("ready"),{note:"Moving on by itself in a moment."})].filter(l=>l!==null)}return r.status==="open"?[...K("Still open",`The check still finds \u201C${r.title}\u201D.`),r.message?i("p",{class:"fix-summary"},r.message):null,s,z("Back to the fix",()=>t.fixFinding(r.findingId))].filter(a=>a!==null):[...K("The check did not finish",r.message??""),z("Check again",()=>void t.checkAgain())]}function Nr(e,n,t){if(!n.checklist.length)return i("section",{class:"checklist","aria-label":"Launch checklist"},i("h2",{},"Launch checklist"),i("p",{class:"empty-line"},"No dashboard steps found for this app: VibeRaven found no hosted services in the code."));let r=n.checklist.filter(s=>!s.done).length;return i("section",{class:"checklist","aria-label":"Launch checklist"},i("h2",{},"Launch checklist",i("span",{class:"checklist-count"},r?`${r} left`:"All done")),i("ul",{},...n.checklist.map(s=>i("li",{class:`check-item${s.done?" is-done":""}`},s.doneBy==="you"?i("button",{class:"tick",role:"checkbox","aria-checked":String(s.done),"aria-label":s.label,on:{click:()=>t.toggleChecklistItem(s.id)},html:s.done?P.check:""}):i("span",{class:`tick is-auto${s.done?" on":""}`,"aria-hidden":"true",html:s.done?P.check:""}),i("div",{class:"check-copy"},i("strong",{},s.label),i("span",{},s.detail),i("span",{class:"check-who"},s.doneBy==="you"?"You confirm this":s.kind==="live"?"VibeRaven confirms this with your agent":"VibeRaven confirms this on the next check")),s.kind==="live"&&!s.done&&s.providerId?i("button",{class:"quiet",disabled:e.busy.chat||!e.probes[e.cliId]?.ready,title:e.probes[e.cliId]?.ready?void 0:"Connect a coding agent first",on:{click:()=>void t.verifyById(s.providerId)}},"Check live"):s.href?i("a",{class:"quiet",href:s.href,target:"_blank",rel:"noreferrer"},"Open dashboard",we(P.out)):null))))}function Dr(e,n){let t=e.fullCheck.status,r=be(t?.usage),s=t?.account?t.account.plan==="pro"?"Pro plan":"Free plan":null;return i("section",{class:"final","aria-label":"Full check"},i("h2",{},"Optional deeper repository review"),i("p",{},"A hosted model reviews selected repository context after you preview and confirm the upload. This does not verify live deployment behavior or capacity."),i("p",{class:"final-quota"},[s,r??"Free accounts get 2 full checks. Pro gets 50 a month."].filter(Boolean).join(" \xB7 ")),i("button",{id:"run-full-check",class:"primary",disabled:e.fullCheck.step==="running",on:{click:()=>void n.openFullCheck()}},"Run full check",we(P.arrow)),e.fullCheck.saved?i("button",{id:"show-last-full-check",class:"quiet",on:{click:()=>n.showSavedFullCheck()}},`Show last full check (score ${e.fullCheck.saved.score}, ${at(e.fullCheck.saved.checkedAt)})`):null)}function Er(e,n,t){if(!n.available.ready)return[...K("Not yet","Fix the critical blockers first. The launch checklist opens when none are left."),z("Back to findings",()=>t.goToStep("findings"))];let r=n.findings.filter(o=>!o.dashboard).length,s=n.gateClear?"No blockers found within tested scope":"No critical blockers left",a=n.checklist.filter(o=>!o.done).length,l=n.gateClear?a?`${a} unknown${a===1?"":"s"}: the checklist items below, which VibeRaven cannot test from this computer.`:"The listed checks are recorded or marked done by you. This is not confirmation that production is ready.":`The repository checks found no critical blockers.${r?` ${r} other finding${r===1?" is":"s are"} still open in Findings.`:""} Review the remaining findings and live-evidence checklist.`;return[...K(s,l),n.services.length?i("ul",{class:"strip","aria-label":"Services"},...n.services.map(o=>i("li",{class:`strip-item is-${o.tone}`},o.mark?i("img",{src:o.mark,alt:"",width:20,height:20}):null,o.name))):null,i("div",{class:"ready-grid"},Nr(e,n,t),Dr(e,t))].filter(o=>o!==null)}function Pr(e,n){let t=e.prChecks;if(!t.status)return null;let r=t.status.exists,s=`git add ${t.status.path} && git commit -m "Check pull requests with VibeRaven"`,a=null;if(t.open){let l=t.written?[i("h3",{},"Workflow added"),i("p",{},"Commit and push it. From the next pull request on, VibeRaven comments with what the change added and what it fixed."),i("pre",{class:"pr-command",tabindex:0},s),t.status.onGithub?null:i("p",{class:"pr-muted"},"This repository has no GitHub remote yet. The check runs once it is on GitHub."),i("div",{class:"pr-actions"},i("button",{id:"pr-checks-copy",class:"btn sm primary",on:{click:()=>void n.copyPrCommit()}},"Copy command"),i("button",{class:"btn sm",on:{click:()=>n.togglePrChecks(!1)}},"Done"))]:r?[i("h3",{},"Pull request checks are set up"),i("p",{},`The workflow is in ${t.status.path}. Once it is pushed, each pull request gets one comment with what it added and fixed.`),i("div",{class:"pr-actions"},i("button",{id:"pr-checks-action",class:"btn sm",on:{click:()=>n.togglePrChecks(!1)}},"Close"))]:[i("h3",{},"Check every pull request"),i("p",{},"VibeRaven adds one file to this repo, ",i("code",{},t.status.path),". Each pull request then gets one comment: what the change added and what it fixed."),i("ul",{class:"pr-points"},i("li",{},"Runs in your own GitHub Actions: private repos work and the code is never uploaded."),i("li",{},"Advice by default. It only blocks a merge if you turn that on.")),t.error?i("p",{class:"pr-error",role:"alert"},t.error):null,i("div",{class:"pr-actions"},i("button",{id:"pr-checks-action",class:"btn sm primary",disabled:t.busy,on:{click:()=>void n.addPrChecks()}},t.busy?"Adding\u2026":"Add the workflow"),i("button",{class:"btn sm",on:{click:()=>n.togglePrChecks(!1)}},"Not now"))];a=i("div",{id:"pr-checks-card",class:"pr-card",role:"dialog","aria-labelledby":"pr-checks-button"},...l)}return i("div",{class:"pr-checks"},i("button",{id:"pr-checks-button",class:`pr-checks-button${r?" is-on":""}`,"aria-expanded":String(t.open),"aria-controls":"pr-checks-card",on:{click:()=>n.togglePrChecks()}},we(P.pr),r?"Pull request checks added":"Check every pull request"),a)}function Or(){let e=t=>t.currentTarget.closest(".canvas"),n=(t,r,s,a="")=>i("button",{class:`canvas-tool${a}`,title:t,"aria-label":t,html:r,on:{click:l=>{let o=e(l);o&&s(o)}}});return i("div",{class:"canvas-tools",dataset:{sig:"tools"}},n("Zoom in",P.zoomIn,t=>Ye(t,1.15)),n("Zoom out",P.zoomOut,t=>Ye(t,1/1.15)),n("Reset layout",P.reset,t=>Ft(t)," is-reset"))}var wt=null;function xn(e,n){let t=R(e),r=e.flow.step,s=wt!==null&&wt!==r;wt=r;let a=r==="app"?Ar(e,t):r==="work"?mn(e,n):r==="findings"?$r(e,t,n):r==="fix"?jr(e,t,n):r==="recheck"?Tr(e,t,n):Er(e,t,n),l=r!=="app",o=r==="work"?an(e,n):null;return i("main",{class:`stage${l?" has-panel":""}${o?" is-work":""}`,dataset:{slot:"stage",step:r}},e.scan?.state==="error"?i("p",{class:"stage-alert",role:"alert"},e.scan.error??"The first check did not finish."):null,o?i("div",{class:"canvas is-scene",dataset:{slot:"canvas-scene"}},o,on(e,n)):i("div",{class:"canvas",dataset:{slot:"canvas"}},Sr(e,t,n),Or(),Pr(e,n),pn(e,n,Cr(e,t))),i("div",{class:`stage-body step-${r}${l?" panel":""}${s?" arrive":""}`,dataset:{slot:`body-${r}`}},l?i("button",{class:"panel-close","aria-label":"Close panel",title:"Close",on:{click:()=>r==="work"?n.closeWork():n.goToStep("app")},html:'<svg width="14" height="14" viewBox="0 0 14 14" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" aria-hidden="true"><path d="M3 3l8 8M11 3l-8 8"/></svg>'}):null,...a))}function Sn(e){return R(e)}function Cn(e,n){let t=Array.from(e.children);n.forEach((r,s)=>{let a=t[s];if(!a){e.appendChild(r);return}let l=r.dataset?.sig;if(l&&a.dataset?.sig===l&&a.tagName===r.tagName)return;let o=r.dataset?.slot;if(o&&a.dataset?.slot===o&&a.tagName===r.tagName){for(let d of Array.from(a.attributes))r.hasAttribute(d.name)||a.removeAttribute(d.name);for(let d of Array.from(r.attributes))a.getAttribute(d.name)!==d.value&&a.setAttribute(d.name,d.value);Cn(a,Array.from(r.children));return}e.replaceChild(r,a)});for(let r of Array.from(e.children).slice(n.length))r.remove()}var yt=new WeakMap;function Rr(e){for(let n of Array.from(e.querySelectorAll(".canvas")))zt(n,et);for(let n of Array.from(e.querySelectorAll('.board[data-lines="1"]'))){if(yt.has(n)){requestAnimationFrame(()=>et(n));continue}let t=()=>et(n);if(requestAnimationFrame(t),typeof ResizeObserver<"u"){let r=new ResizeObserver(t);r.observe(n),yt.set(n,r)}else yt.set(n,{disconnect(){}})}}function $n(e,n,t){let r=n.get(),s=e.contains(document.activeElement)?document.activeElement:null,a=s?.id,l=s instanceof HTMLTextAreaElement||s instanceof HTMLInputElement?[s.selectionStart,s.selectionEnd]:null,o=Sn(r);if(Cn(e,[bn(r,t),vn(r,o,t),xn(r,t),...r.agentOpen?[i("div",{class:"sheet-veil",on:{click:()=>t.toggleAgent()}}),Hr(r,n,t)]:[],...r.drawer?[i("div",{class:"drawer-veil",on:{click:()=>t.toggleDrawer(null)}}),Yr(r,n,t)]:[],...St(r,t),...fn(r,t),Zr(r)]),Rr(e),a&&document.activeElement?.id!==a){let d=document.getElementById(a);d?.focus({preventScroll:!0}),l&&(d instanceof HTMLTextAreaElement||d instanceof HTMLInputElement)&&d.setSelectionRange(...l)}}function Ur(e,n,t){let r=ve(e.project,e.catalog,e.verified),s=r.filter(o=>o.step!=="absent"),a=r.filter(o=>o.step==="absent"),l=e.setup.running||e.busy.chat||e.busy.scan;return i("div",{},e.setup.open?It(e,n,t):null,i("section",{class:"block","aria-label":"In your app"},i("div",{class:"block-head"},i("h4",{},"In your app"),i("button",{id:"connect-my-app",class:"btn sm",disabled:l,on:{click:()=>t.openStackSetup()}},"Set up with your agent")),s.length?i("div",{class:"rail-grid"},...s.map(o=>zr(o,e,t))):i("p",{class:"drawer-empty"},"No services found in this code yet.")),a.length?i("section",{class:"block","aria-label":"Available services"},i("div",{class:"block-head"},i("h4",{},"Available"),i("span",{class:"block-meta"},"Your accounts, your choice of providers")),i("div",{class:"rail-grid"},...a.map(o=>i("article",{class:"slab available"},i("div",{class:"face"},i("div",{class:"face-logo"},i("img",{src:ze(o),alt:"",loading:"lazy"})),i("h3",{class:"face-name"},o.name),i("div",{class:"face-area"},o.area)),i("div",{class:"slab-act"},i("button",{class:"btn library-add",disabled:l,"aria-label":`Add ${o.name} to setup`,on:{click:()=>{t.openStackSetup(),n.get().setup.selected.includes(o.id)||t.toggleSetupProvider(o.id),document.getElementById("stack-setup-heading")?.focus()}}},"+ Add to setup")))))):null)}function Fr(e){return e.step==="ready"?{text:`Agent reported checks passed ${e.verified?F(e.verified.at):""}.`,tone:"g"}:e.step==="verified"?{text:e.verified?.ok?`Agent check ${e.verified?F(e.verified.at):""}.`:"Agent check found issues.",tone:e.verified?.ok?"g":"a"}:e.step==="mcp"?{text:"Agent integration configured. Live check needed.",tone:"a"}:e.step==="in_repo"?{text:e.hasRecipe?"Found in your code. Not connected.":"Found in your code.",tone:"a"}:{text:"Not in this app.",tone:""}}function zr(e,n,t){let r=n.busy.tile===e.id,s=r||n.setup.running||n.busy.chat,a=Fr(e),l=e.step==="ready"?i("span",{class:"tag acid"},"Agent checked"):e.step==="verified"?i("span",{class:"tag"},e.verified?.ok?"Checked":"Issues"):e.step==="mcp"?i("span",{class:"tag"},"Configured"):i("span",{class:"tag"},"In code"),o=e.step==="in_repo"&&e.hasRecipe?i("button",{class:"btn primary",disabled:s,on:{click:()=>t.connect(e)}},r?i("span",{class:"spin"}):null,r?"Configuring\u2026":"Configure agent"):e.step==="in_repo"?i("button",{class:"btn",disabled:s,on:{click:()=>t.verify(e)}},"Check with agent"):e.step==="mcp"?i("button",{class:"btn",disabled:s,on:{click:()=>t.verify(e)}},r?i("span",{class:"spin"}):null,r?"Checking\u2026":"Check live"):i("button",{class:"btn",disabled:s,on:{click:()=>t.verify(e)}},r?i("span",{class:"spin"}):null,r?"Checking\u2026":"Check again"),d=Wr(e.logoUrl)??"#9a9a9a";return i("article",{class:`slab${e.step==="ready"?" ready":""}${r?" scanning":""}`,dataset:{provider:e.id},style:{"--brand":d}},i("div",{class:"face"},i("div",{class:"face-top"},l),i("div",{class:"face-logo"},i("img",{src:e.logoUrl,alt:"",loading:"lazy"})),i("div",{class:"face-name"},e.name),i("div",{class:"face-area"},e.area)),i("div",{class:`slab-status ${a.tone}`},i("i",{class:a.tone}),i("span",{class:"txt"},a.text),e.fixes>0?i("button",{class:"fixlink",on:{click:()=>t.focusBlockers(e.id)}},`${e.fixes} to fix`):null),i("div",{class:"slab-act"},o))}var T={close:'<svg width="12" height="12" viewBox="0 0 14 14" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" aria-hidden="true"><path d="M3 3l8 8M11 3l-8 8"/></svg>',reload:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13.5 8a5.5 5.5 0 1 1-1.6-3.9M13.5 2.5v3h-3"/></svg>',send:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 13V3M3.5 7.5 8 3l4.5 4.5"/></svg>',stop:'<svg width="14" height="14" viewBox="0 0 14 14" aria-hidden="true"><rect x="2" y="2" width="10" height="10" rx="2" fill="currentColor"/></svg>',spark:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M8 1.8v3.4M8 10.8v3.4M1.8 8h3.4M10.8 8h3.4M3.6 3.6l2 2M10.4 10.4l2 2M12.4 3.6l-2 2M5.6 10.4l-2 2"/></svg>',plug:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M6 2v3M10 2v3M4.5 5h7v2.5a3.5 3.5 0 0 1-7 0zM8 11v3"/></svg>',diff:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M5 2.5v6M2 5.5h6M9 11.5h5"/><rect x="1.5" y="1.5" width="13" height="13" rx="2.5"/></svg>',terminal:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.5 4.5 6 8l-3.5 3.5M8 12h5.5"/></svg>',download:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 2.5v8M4.5 7 8 10.5 11.5 7M3 13.5h10"/></svg>',arrow:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 8h10M9 4l4 4-4 4"/></svg>',tag:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><path d="M2 2.5h5.5l6.5 6.5-5 5-6.5-6.5z"/><circle cx="5" cy="5.5" r="1" fill="currentColor"/></svg>',book:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><path d="M3 2.5h7.5a2 2 0 0 1 2 2v9H5a2 2 0 0 1-2-2z"/><path d="M3 11.5a2 2 0 0 1 2-2h7.5"/></svg>'};function G(e){return i("span",{class:"ico",html:e})}function Re(e){return Q[e]??Q.claude}function tt(e){return e.replace(/ CLI$/,"").replace("Claude Code","Claude")}function In(e){return e.agents.find(n=>n.id===e.cliId)?.label.replace(/ CLI$/,"")??e.cliId}function Hr(e,n,t){let r=e.agents.find(g=>g.id===e.cliId),s=e.probes[e.cliId],a=s?.ready===!0,l=e.busy.probe===e.cliId,o=e.setup.running||e.busy.chat,d=r?.modelOptions??(r?.models??[]).map(g=>({id:g,label:g})),u=tt(In(e)),c=[[T.spark,"What does this app need next?"],[T.plug,"Check my service connections"],[T.diff,"Explain what changed since the last release"]],p=i("div",{class:"thread"},e.messages.length?e.messages.map(g=>Br(g,e,t)):i("div",{class:"chat-welcome"},i("span",{class:"chat-welcome-mark"},i("img",{src:Re(e.cliId),alt:"",width:28,height:28})),i("h3",{},"What should we work on?"),i("p",{},`${u} works in this project on your computer.`),i("div",{class:"chat-suggest"},...c.map(([g,w])=>i("button",{class:"chat-suggestion",disabled:!a||o,on:{click:()=>t.send(w)}},G(g),i("span",{},w))))),e.busy.chat?i("div",{class:"working"},i("span",{class:"chat-typing","aria-hidden":"true"},i("i"),i("i"),i("i")),i("span",{dataset:{working:"1"}},`${u} is working\u2026`),i("button",{class:"btn sm stop",on:{click:()=>t.stop()}},i("i",{class:"sq"}),"Stop")):null,e.busy.chat?i("div",{class:"slow-run hint",hidden:!e.workingSince||Date.now()-e.workingSince<6e4,dataset:{slowRun:"1"}},i("p",{},"Taking longer than usual. A sign-in prompt may be waiting in your agent."),i("button",{class:"btn sm",on:{click:()=>t.toggleDrawer("terminal")}},"Open agents")):null);(e.messages.length||e.busy.chat)&&queueMicrotask(()=>{p.scrollTop=p.scrollHeight});let h=e.contextProviderId?ve(e.project,e.catalog,e.verified).find(g=>g.id===e.contextProviderId):null,f=i("textarea",{id:"agent-composer",placeholder:a?`Ask ${u} about this app, or say what to change\u2026`:`Connect ${u} to start chatting.`,rows:2,value:e.draft,disabled:o,on:{input:g=>{n.get().draft=g.target.value},keydown:g=>{let w=g;w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),t.send(w.target.value))}}});return i("aside",{id:"agent-panel",class:"side chat","aria-label":"Coding agent"},i("header",{class:"chat-head"},i("div",{class:"chat-agents",role:"radiogroup","aria-label":"Coding agent"},...e.agents.map(g=>{let w=e.probes[g.id],b=g.id===e.cliId,M=w?.ready?"ok":g.installed?"wait":"off";return i("button",{role:"radio","aria-checked":String(b),class:`chat-agent${b?" on":""}`,disabled:o,title:g.installed?w?.ready?"Connected":"Installed, not tested yet":"Not installed",on:{click:()=>t.selectCli(g.id)}},i("img",{src:Re(g.id),alt:"",width:16,height:16}),tt(g.label),i("i",{class:`chat-dot is-${M}`,"aria-hidden":"true"}))})),i("button",{class:"chat-close","aria-label":"Close chat",title:"Close",on:{click:()=>t.toggleAgent()},html:T.close})),i("div",{class:"chat-meta"},i("span",{class:`chat-status${a?" is-ok":""}`,role:"status"},l?i("span",{class:"spin"}):i("i",{"aria-hidden":"true"}),l?"Checking\u2026":a?"Connected":r&&!r.installed?"Not installed":"Not connected"),d.length?i("label",{class:"chat-model",title:"Model"},i("span",{class:"chat-model-label"},"Model"),i("select",{id:"agent-model",disabled:o,on:{change:g=>n.set({modelId:g.target.value})}},i("option",{value:"",selected:!e.modelId},"Default"),e.modelId&&!d.some(g=>g.id===e.modelId)?i("option",{value:e.modelId,selected:!0},e.modelId):null,...d.map(g=>i("option",{value:g.id,selected:g.id===e.modelId},g.label)))):null,i("button",{id:"agent-test-connection",class:"chat-icon",title:a?"Test the connection again":"Test the connection","aria-label":a?"Test again":"Test connection",disabled:l||o,on:{click:()=>t.testConnection(e.cliId)},html:T.reload})),p,s&&!s.ready?i("div",{class:"chat-connect"},i("p",{},s.message),i("div",{class:"chat-connect-row"},i("button",{class:"btn sm primary",disabled:l,on:{click:()=>t.testConnection(e.cliId)}},G(T.reload),"Test again"),i("button",{class:"btn sm ghost",on:{click:()=>t.toggleDrawer("terminal")}},G(T.terminal),"Set up"))):null,i("div",{class:"composer"},h?i("span",{class:"chip"},h.logoUrl?i("img",{src:h.logoUrl,alt:""}):null,h.name,i("button",{title:"Remove context","aria-label":"Remove context",on:{click:()=>n.set({contextProviderId:null})},html:T.close})):null,f,i("div",{class:"row"},i("label",{class:"chat-access",title:"What the agent may do"},i("select",{id:"agent-access","aria-label":"Agent access",disabled:o,on:{change:g=>t.setAccessMode(g.target.value)}},...["ask","approve","full"].map(g=>i("option",{value:g,selected:g===e.accessMode},g==="ask"?"Ask \xB7 plan only":g==="approve"?"Edit files":"Full access")))),e.busy.chat?i("button",{class:"btn send stop",title:"Stop","aria-label":"Stop",on:{click:()=>t.stop()},html:T.stop}):i("button",{class:"btn send",title:"Send","aria-label":"Send",disabled:!a||e.setup.running,on:{click:()=>t.send(f.value)},html:T.send}))))}function jn(e,n,t=Date.now()){for(let l of Array.from(e.querySelectorAll(".work-elapsed[data-since]"))){let o=Date.parse(l.dataset.since??"");Number.isFinite(o)&&(l.textContent=`${Math.max(0,Math.floor((t-o)/1e3))}s`)}if(!n)return;let r=Math.max(0,Math.floor((t-n)/1e3)),s=e.querySelector("[data-working]");s&&(s.textContent=`${s.textContent?.split(" \xB7")[0]??"Working\u2026"} \xB7 ${r}s`);let a=e.querySelector("[data-slow-run]");a&&(a.hidden=r<60)}function Br(e,n,t){if(e.role==="me")return i("div",{class:"msg me"},i("div",{class:"body",html:`<p>${ye(e.text)}</p>`}));if(e.role==="system")return i("div",{class:"msg sys"},i("div",{class:"body",html:_(e.text)}),e.card?An(e,n,t):null);let r=n.agents.find(a=>a.id===e.cliId),s=e.role==="error"?"Something went wrong":r?tt(r.label):"Agent";return i("div",{class:`msg ${e.role==="error"?"err":"agent"}`},i("div",{class:"who"},e.role==="error"?i("span",{class:"msg-avatar is-err"},"!"):i("span",{class:"msg-avatar"},i("img",{src:Re(e.cliId??n.cliId),alt:"",width:14,height:14})),s,i("span",{class:"t"},F(e.at))),i("div",{class:"body",html:_(e.text)}),e.card?An(e,n,t):null)}function An(e,n,t){return i("div",{class:"card"},i("span",{},e.card.providerId?i("img",{src:ve(n.project,n.catalog,n.verified).find(r=>r.id===e.card?.providerId)?.logoUrl??"",alt:""}):null,e.card.label),e.card.action==="verify"&&e.card.providerId?i("button",{class:"btn sm primary",disabled:n.busy.chat||n.setup.running,on:{click:()=>t.verifyById(e.card.providerId)}},"Verify live"):e.card.action==="recheck"?i("button",{class:"btn sm",disabled:n.busy.scan,on:{click:()=>t.recheck()}},"Re-check"):null)}function Yr(e,n,t){let r=e.drawer==="terminal"?Gr(e,t):e.drawer==="services"?Ur(e,n,t):e.drawer==="actions"?wn(e,t):Qr(e,n,t),s=e.drawer==="terminal"?"Coding agents":e.drawer==="services"?"Services":e.drawer==="actions"?"Actions":"Releases",a=e.drawer==="terminal"?"Connect one, then it can work on your app. Installed is not the same as connected.":e.drawer==="services"?"What your app runs on, and what you could add. Check a service live through your agent.":e.drawer==="actions"?"What VibeRaven can do in this project. An action only starts when it has a real way to run here.":"Every tagged point, and what changed between any two.";return i("div",{class:"drawer",dataset:{drawer:e.drawer??""},role:"dialog","aria-modal":"true","aria-labelledby":"drawer-heading",on:{keydown:l=>{let o=l;if(o.key==="Escape"&&(o.preventDefault(),o.stopPropagation(),t.toggleDrawer(null)),o.key!=="Tab")return;let d=Array.from(l.currentTarget.querySelectorAll("*")).filter(p=>p.matches('button:not(:disabled), input:not(:disabled), a[href], select:not(:disabled), [tabindex="0"]')),u=d[0],c=d[d.length-1];o.shiftKey&&document.activeElement===u&&(o.preventDefault(),c?.focus()),!o.shiftKey&&document.activeElement===c&&(o.preventDefault(),u?.focus())}}},i("div",{class:"drawer-head"},i("div",{class:"drawer-title"},i("h3",{id:"drawer-heading"},s),i("p",{},a)),i("button",{id:"drawer-close",class:"drawer-x","aria-label":"Close",title:"Close",on:{click:()=>t.toggleDrawer(null)},html:T.close})),i("div",{class:"drawer-body"},r))}function bt(e,n,t,r,...s){return i("li",{class:`step${t?" done":""}`},i("span",{class:"step-n","aria-hidden":"true"},t?"\u2713":String(e)),i("div",{class:"step-body"},i("div",{class:"step-title"},n,i("span",{class:`step-state${t?" ok":""}`},t?"Done":"Not confirmed")),i("p",{},r),s.some(Boolean)?i("div",{class:"row step-row"},...s):null))}function Gr(e,n){return i("div",{},i("div",{class:"agent-cards"},...e.agents.map(t=>{let r=e.probes[t.id],s=r?.ready===!0,a=e.busy.probe===t.id,l=e.cliId===t.id,o=s?"Connected":t.installed?"Installed \xB7 not tested":"Not installed",d=s?"green":t.installed?"amber":"gray",u=s?l?i("button",{class:"agent-cta is-on",disabled:!0},G(T.spark),"In use"):i("button",{class:"agent-cta",on:{click:()=>n.selectCli(t.id)}},G(T.arrow),"Use this agent"):t.installed?i("button",{class:"agent-cta is-primary",disabled:a,on:{click:()=>n.testConnection(t.id)}},a?i("span",{class:"spin"}):G(T.plug),a?"Testing\u2026":"Connect"):i("button",{class:"agent-cta is-primary",on:{click:()=>n.runSetup(t.id,"install")}},G(T.download),"Install");return i("section",{class:`block agent-block agent-card${s?" is-connected":""}${l?" is-selected":""}`,"aria-label":t.label},i("div",{class:"agent-card-head"},i("span",{class:"agent-card-mark"},i("img",{src:Re(t.id),alt:"",width:26,height:26})),i("div",{class:"agent-card-name"},i("h4",{},tt(t.label)),i("span",{class:`pill ${d}`},i("i"),o)),i("a",{class:"agent-card-docs",href:t.setup.docsUrl,target:"_blank",rel:"noreferrer",title:"Docs","aria-label":`${t.label} docs`,html:T.book})),s?i("p",{class:"agent-card-note"},r?.message??"Signed in and answering."):null,i("div",{class:"agent-card-actions"},u,s?i("button",{class:"agent-cta is-quiet",disabled:a,title:"Test again",on:{click:()=>n.testConnection(t.id)}},a?i("span",{class:"spin"}):G(T.reload),"Test"):null,!s&&t.installed?i("button",{class:"agent-cta is-quiet",on:{click:()=>n.openTerminal(t.id,"sign-in")}},G(T.terminal),"Sign in"):null),s?null:i("details",{class:"agent-how"},i("summary",{},"How to connect"),i("ol",{class:"steps"},bt(1,"Install the CLI",t.installed,t.installed?`Found on this computer as ${t.command}.`:`Install command: ${t.setup.installCommand}`),bt(2,"Sign in to your account",s,`Sign in with ${t.setup.signInCommand}. VibeRaven cannot read your CLI session.`),bt(3,"Test the connection",s,r?.message??`VibeRaven runs ${t.setup.verifyCommand} and reads the result.`))))})),i("details",{class:"agent-output"},i("summary",{},G(T.terminal),"Output from the last step"),i("pre",{class:"out",dataset:{terminalOut:"1"}},e.terminalOutput||"Nothing yet. Install, sign in or test an agent and its output appears here.")))}function Qr(e,n,t){let r=e.project.releases??[],s=i("input",{id:"release-from",class:"sel","aria-label":"From revision",placeholder:"Tag, commit or branch",value:e.compare.from,on:{input:d=>{n.get().compare.from=d.target.value}}}),a=i("input",{id:"release-to",class:"sel","aria-label":"To revision",placeholder:"HEAD",value:e.compare.to,on:{input:d=>{n.get().compare.to=d.target.value}}}),l=e.compare.result,o=l?.stats;return i("div",{class:"releases"},i("section",{class:"rel-section","aria-label":"Release history"},i("h4",{class:"rel-title"},G(T.tag),"Release points",i("span",{class:"rel-count"},String(r.length))),r.length?i("ul",{class:"rel-cards"},...r.map(d=>i("li",{class:`rel-card${d.tone==="current"?" is-current":""}`},i("div",{class:"rel-card-top"},i("span",{class:"rel-tag"},d.label),i("span",{class:`rel-badge is-${d.tone}`},d.tone==="current"?"Current":d.tone==="prod"?"Released":"Planned")),i("p",{class:"rel-sum"},d.summary),i("p",{class:"rel-meta"},`${d.meta} \xB7 ${d.branch}`),i("button",{class:"rel-compare",on:{click:()=>{n.set({compare:{...n.get().compare,from:d.id}}),document.getElementById("release-from")?.focus()}}},G(T.diff),"Compare from here")))):i("div",{class:"rel-empty"},i("p",{},"No tags yet."),i("code",{},"git tag v1.0.0"),i("p",{},"You can still compare any branch or commit below."))),i("section",{class:"rel-section","aria-label":"Compare"},i("h4",{class:"rel-title"},G(T.diff),"Compare two points"),i("div",{class:"rel-compare-row"},i("label",{class:"rel-field"},i("span",{},"From"),s),i("span",{class:"rel-arrow",html:T.arrow}),i("label",{class:"rel-field"},i("span",{},"To"),a)),e.compare.error?i("p",{class:"compare-error",role:"alert"},e.compare.error):null,l?i("div",{class:"diff-result"},i("div",{class:"diff-stats"},i("span",{class:"diff-range"},`${l.fromLabel} \u2192 ${l.toLabel}`),o?i("span",{},`${o.files??0} file${o.files===1?"":"s"}`):null,o?i("span",{class:"add"},`+${o.insertions??0}`):null,o?i("span",{class:"del"},`\u2212${o.deletions??0}`):null),i("pre",{class:"out diff",tabindex:0,role:"region","aria-label":"Diff output",html:Vr(l.diff)})):null,i("div",{class:"rel-actions"},i("button",{class:"wtile",disabled:e.busy.compare,on:{click:()=>t.compare(s.value,a.value)}},i("span",{class:"wtile-ico",html:T.diff}),i("span",{class:"wtile-label"},e.busy.compare?"Reading\u2026":"Show the diff"),i("span",{class:"wtile-note"},"Straight from git, nothing sent")),i("button",{class:"wtile",disabled:e.busy.chat||e.setup.running,on:{click:()=>t.explainDiff(s.value,a.value)}},i("span",{class:"wtile-ico"},i("img",{src:Re(e.cliId),alt:"",width:16,height:16})),i("span",{class:"wtile-label"},`Explain with ${In(e)}`),i("span",{class:"wtile-note"},"Plain words, risks first")))))}function Wr(e){let n=/cdn\.simpleicons\.org\/[a-z0-9.-]+\/([0-9a-f]{6})/i.exec(e);if(!n)return null;let t=n[1].toLowerCase();return t==="ffffff"?"#c8c8c8":`#${t}`}function Vr(e){return e.split(`
13
+ `).map(n=>{let t=ye(n);return n.startsWith("+++")||n.startsWith("---")||n.startsWith("diff ")||n.startsWith("@@")?`<span class="hd">${t}</span>`:n.startsWith("+")?`<span class="add">${t}</span>`:n.startsWith("-")?`<span class="del">${t}</span>`:t}).join(`
14
+ `)}function Zr(e){return i("div",{class:"toasts"},...e.toasts.map(n=>i("div",{class:`toast${n.kind==="err"?" err":""}`},n.text)))}function vt(e){let n=e.filter(t=>t.detected);return(n.length?n:e.filter(t=>["github","supabase","vercel"].includes(t.id))).map(t=>t.id)}function qr(e,n){return[n==="ask"?"Plan the setup of this app. Do not edit files, write configuration, provision resources, or change providers.":"Set up the selected services for this app using the current access mode.","Selected services:",...e.map(t=>`- ${t.name} (${t.area}): ${t.detected?"already detected; preserve and complete the existing integration":"requested addition; inspect the app before choosing the minimal integration"}. ${t.note??""}`),"First inspect the repo and reuse its existing architecture, accounts, and integrations. Do not replace an existing provider or add unselected services.","Shared MCP recipes may be available in .mcp.json. Check whether your CLI loads them. In editing modes, adapt the selected recipes to its project-local native configuration if necessary, preserving other entries. If a restart or authorization is required, report that as a remaining step; do not pretend the tools are available.","Use available provider MCP tools to inspect configuration. For repo work, use official SDKs, wire the necessary integration, and add placeholder variable names to .env.example. Never invent real secrets or print secret values.","If sign-in, account selection, a paid resource, broader permissions, or dashboard access is needed, stop that step and give the owner the exact next action. Do not purchase services, make financial transactions, push commits, publish packages, create releases, deploy, or alter production data as part of setup.","Run relevant local checks. Report separately: repo changes, provider evidence actually observed, and remaining user actions. MCP configuration alone does not prove a live connection. Do not claim the app is production-ready.","Keep the summary short and name the files changed."].join(`
15
+ `)}async function Tn(e){let{providers:n,mode:t,connect:r,runAgent:s,onProgress:a,cancelled:l}=e;if(!n.length)throw new Error("Select at least one service.");let o=()=>{if(l())throw new Error("Setup stopped. Configuration already written is kept; no further steps will run.")};for(let u of n)if(o(),t==="ask")a({id:u.id,state:"pending",label:`${u.name} \xB7 planning only`});else if(u.mcpConfigured)a({id:u.id,state:"configured",label:`${u.name} \xB7 MCP configuration found`});else if(u.hasRecipe){a({id:u.id,state:"working",label:`${u.name} \xB7 preparing MCP configuration`});let c=await r(u.id);if(o(),!c.ok)throw new Error(`${u.name}: ${c.message}`);a({id:u.id,state:"configured",label:`${u.name} \xB7 shared MCP recipe saved`})}else a({id:u.id,state:"pending",label:`${u.name} \xB7 agent will inspect setup options`});o(),a({id:"agent",state:"working",label:t==="ask"?"Agent is preparing your plan":"Agent is working through your stack"});let d=await s(qr(n,t));if(o(),!d)throw new Error("The agent did not complete the setup task. Review its output and try again.");a({id:"agent",state:"review",label:t==="ask"?"Plan returned \xB7 review it in the agent panel":"Setup response returned \xB7 review changes and remaining steps"})}function Nn(e,n){if(e.length>1e3)return null;let t=new URLSearchParams(e.replace(/^[#?]/,"")).get("stack");return t===null?null:[...new Set(t.split(",").filter(r=>n.includes(r)))]}function Kr(){let e=document.getElementById("vr-state");if(!e?.textContent)throw new Error("Missing initial state");return JSON.parse(e.textContent)}function Dn(e,n){let t=(e??"").trim();return t.length>n?`\u2026${t.slice(-n)}`:t}function B(e){return e instanceof Error?e.message:String(e)}function _r(e){let n=!1,t=new Set;function r(c=!1){e.set({agentOpen:!0,drawer:null}),document.getElementById(c?"agent-test-connection":"agent-composer")?.focus({preventScroll:!0}),document.getElementById("agent-panel")?.scrollIntoView?.({behavior:"smooth",block:"nearest"})}async function s(){let[c,p,h]=await Promise.all([L.project(),L.catalog().catch(()=>({providers:[]})),L.verified().catch(()=>({verified:{}}))]);e.set({project:c,catalog:p.providers,verified:h.verified})}async function a(c,p,h){let f=e.get();if(f.busy.chat)return null;let g=f.probes[c.cliId];if(r(!g?.ready),!g?.ready)return e.toast(`Test the ${c.cliId} connection first.`,"err"),null;e.push({role:"me",text:p});let w=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;e.set({busy:{...e.get().busy,chat:!0},draft:"",workingSince:Date.now(),runId:w});try{let M=(await L.chat({...c,runId:w})).agentRun,$=M.output?.trim(),y=M.timedOut||M.exitCode!==null&&M.exitCode!==0||/Stopped by user/.test(M.stderr??"");if(!$&&/Stopped by user/.test(M.stderr??""))return e.push({role:"system",text:"Stopped."}),null;let k=$||(M.timedOut?`${c.cliId} did not finish in time and was stopped. Try a smaller task, or switch to ask mode for a read-only answer.`:`${c.cliId} exited with code ${M.exitCode??"unknown"} and no answer.
10
16
 
11
- ${Ge(M.stderr,1200)}`);return!w||D?e.push({role:"error",text:f,cliId:r.cliId}):e.push({role:"agent",text:f,cliId:r.cliId,card:d}),(r.taskKind==="fix"||r.taskKind==="plan")&&await a().catch(()=>{}),D||!w?null:f}catch(m){return e.push({role:"error",text:C(m)}),null}finally{e.set({busy:{...e.get().busy,chat:!1},workingSince:null,runId:null})}}function u(){queueMicrotask(()=>document.getElementById("stage-heading")?.focus({preventScroll:!0}))}function o(){let r=e.get();return{cliId:r.cliId,accessMode:r.accessMode,modelId:r.modelId||void 0}}let p={...fe(e),setSection(r){e.get().setup.running||(e.set(l=>({section:r,setup:{...l.setup,open:!1}})),document.getElementById(`tab-${r}`)?.focus({preventScroll:!0}))},toggleAgent(){let r=!e.get().agentOpen;e.set({agentOpen:r}),document.getElementById(r?"agent-composer":"open-more")?.focus({preventScroll:!0}),r&&document.getElementById("agent-panel")?.scrollIntoView?.({behavior:"smooth",block:"nearest"})},openStackSetup(){let r=e.get();e.set({section:"stack",drawer:"services",moreOpen:!1,setup:{...r.setup,open:!0,initialized:r.setup.initialized||r.catalog.length>0,selected:r.setup.initialized?r.setup.selected:pe(r.catalog)}}),document.getElementById("stack-setup-heading")?.focus({preventScroll:!0})},toggleSetupProvider(r){let l=e.get();if(l.setup.running)return;let d=l.setup.selected.includes(r)?l.setup.selected.filter(h=>h!==r):[...l.setup.selected,r];e.set({setup:{...l.setup,initialized:!0,selected:d,progress:[],error:null}})},async startStackSetup(){let r=e.get();if(r.setup.running||r.busy.chat||r.busy.tile||r.busy.scan)return;if(s(!r.probes[r.cliId]?.ready),!r.probes[r.cliId]?.ready){e.toast(`Connect ${r.cliId} in the agent panel first.`,"err");return}let l=r.catalog.filter(h=>r.setup.selected.includes(h.id));if(!l.length){e.toast("Select at least one service.","err");return}let d=o();i=!1,e.set({setup:{...r.setup,running:!0,progress:[],error:null}});try{await Be({providers:l,mode:d.accessMode,connect:h=>k.connectMcp(h),cancelled:()=>i,onProgress:h=>e.set(y=>({setup:{...y.setup,progress:[...y.setup.progress.filter(g=>g.id!==h.id),h]}})),runAgent:h=>c({...d,taskKind:d.accessMode==="ask"?"plan":"fix",prompt:h},`${d.accessMode==="ask"?"Plan":"Set up"} my stack: ${l.map(y=>y.name).join(", ")}`,{label:"Review the response, then check your app",action:"recheck"})})}catch(h){e.set(y=>({setup:{...y.setup,error:C(h)}}))}finally{await a().catch(()=>{}),e.set(h=>({setup:{...h.setup,running:!1}}))}},async stop(){e.get().setup.running&&(i=!0);let r=e.get().runId;if(r)try{await k.stop(r),e.toast("Stopped.")}catch(l){e.toast(C(l),"err")}},async recheck(){if(!(e.get().setup.running||e.get().busy.chat||e.get().busy.scan)){e.set({busy:{...e.get().busy,scan:!0}});try{await k.scan(),await a(),e.toast("Check finished.")}catch(r){e.toast(`Check failed: ${C(r)}`,"err")}finally{e.set({busy:{...e.get().busy,scan:!1}})}}},toggleDrawer(r){let l=e.get().drawer;e.set(d=>({drawer:d.drawer===r?null:r})),document.getElementById(e.get().drawer?"drawer-close":"open-more")?.focus({preventScroll:!0})},selectCli(r){if(e.get().setup.running||e.get().busy.chat)return;e.set({cliId:r,modelId:""}),e.get().agents.find(d=>d.id===r)?.installed&&!e.get().probes[r]&&p.testConnection(r)},setAccessMode(r){e.get().setup.running||e.get().busy.chat||e.set({accessMode:r})},async testConnection(r,l){if(!n.has(r)){n.add(r),e.set({busy:{...e.get().busy,probe:r}});try{let d=await k.probe(r);e.set(h=>({probes:{...h.probes,[r]:d},terminalOutput:d.output||d.message})),l?.silent||e.toast(d.message,d.ready?"ok":"err")}catch(d){e.set(h=>{let y={...h.probes};return delete y[r],{probes:y}}),e.toast(C(d),"err")}finally{n.delete(r),e.set(d=>({busy:{...d.busy,probe:d.busy.probe===r?null:d.busy.probe}}))}}},async runSetup(r,l){e.set({terminalOutput:`$ ${l}\u2026`});try{let d=await k.runSetup(r,l);e.set({terminalOutput:`$ ${d.command}
12
- ${d.output}`.trim()});let h=await k.agents();e.set({agents:h.agents.filter(y=>y.id==="codex"||y.id==="claude"||y.id==="gemini")})}catch(d){e.set({terminalOutput:C(d)})}},async openTerminal(r,l){try{let d=await k.openTerminal(r,l);e.set({terminalOutput:`Opened a terminal with: ${d.command}
13
- Sign in there, then press Test connection.`})}catch(d){e.toast(C(d),"err")}},async send(r){if(e.get().setup.running)return;let l=r.trim();if(!l)return;let d=e.get(),h=d.contextProviderId?d.catalog.find(y=>y.id===d.contextProviderId):null;await c({...o(),prompt:l,taskKind:"analyze",provider:h?{id:h.id,name:h.name,area:h.area}:void 0},l)},async connect(r){if(!(e.get().setup.running||e.get().busy.chat||e.get().busy.tile)){s(),e.set({busy:{...e.get().busy,tile:r.id}});try{let l=await k.connectMcp(r.id);e.toast(l.message,l.ok?"ok":"err"),await a(),l.ok&&e.push({role:"system",text:`${l.message} ${r.note??""}`.trim(),card:{providerId:r.id,label:`${r.name} \xB7 MCP configured`,action:"verify"}})}catch(l){e.toast(C(l),"err")}finally{e.set({busy:{...e.get().busy,tile:null}})}}},async verify(r){return p.verifyById(r.id)},async verifyById(r){let l=e.get();if(l.setup.running||l.busy.chat||l.busy.tile)return;let h=(l.catalog.find(m=>m.id===r)??l.project.providers.find(m=>m.id===r))?.name??r,y=l.probes[l.cliId];if(s(!y?.ready),!y?.ready){e.toast(`Test the ${l.cliId} connection first.`,"err");return}e.push({role:"me",text:`Check ${h} live`});let g=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;e.set({busy:{...e.get().busy,tile:r,chat:!0},workingSince:Date.now(),runId:g});try{let m=await k.verify({providerId:r,...o(),runId:g}),M=m.agentRun.output?.trim()||m.agentRun.stderr?.trim()||"No output.";e.push({role:"agent",text:M,cliId:l.cliId,card:{providerId:r,label:m.verified.ok?`${h} \xB7 verified live`:`${h} \xB7 issues found`}}),await a()}catch(m){e.push({role:"error",text:C(m)})}finally{e.set({busy:{...e.get().busy,tile:null,chat:!1},workingSince:null,runId:null})}},async addProvider(r){e.get().setup.running||await c({...o(),taskKind:"fix",provider:{id:r.id,name:r.name,area:r.area},prompt:`Add ${r.name} (${r.area}) to this app. Install the official SDK, wire the minimal integration the app needs, add the required keys to .env.example with placeholder values, and never invent real secrets. Then tell me exactly which dashboard steps remain.`},`Add ${r.name} to this app`,{providerId:r.id,label:`${r.name} \xB7 added to repo`,action:"recheck"})},async fix(r,l){if(e.get().setup.running)return;let d=l?.provider?.nextFix?.id===r.id&&l.provider.nextFix.prompt?l.provider.nextFix.prompt:`Fix this production blocker in the repo now: ${r.title}. ${r.detail??""} Make the minimal change, then summarize what you changed and which files.`,h=r.asksFirst?`${r.asksFirst} Tell the user this before you change anything, and make the change only if they confirm.
14
- ${d}`:d;await c({...o(),taskKind:"fix",provider:l?{id:l.id,name:l.name,area:l.area}:void 0,prompt:h},`Fix: ${r.title}`,{providerId:l?.id,label:"Re-check to update the score",action:"recheck"})},async explain(r,l){e.get().setup.running||await c({...o(),taskKind:"analyze",provider:l?{id:l.id,name:l.name,area:l.area}:void 0,prompt:`This blocker needs dashboard work: ${r.title}. ${r.detail??""} Give me the exact steps: which page, which button, which value. If a provider MCP is available, do the read-only parts yourself first.`},`Steps for: ${r.title}`)},async fixAll(){if(e.get().setup.running)return;let{missionCards:r}=e.get().project,l=r.blockers.filter(d=>!d.asksFirst&&r.planSteps.some(h=>h.id===d.id&&!h.requiresUserAction&&!h.asksFirst));l.length&&await c({...o(),taskKind:"fix",prompt:`Fix these production blockers in the repo, one by one, minimal changes each:
15
- ${l.map((d,h)=>`${h+1}. ${d.title}`).join(`
17
+ ${Dn(M.stderr,1200)}`);return!$||y?e.push({role:"error",text:k,cliId:c.cliId}):e.push({role:"agent",text:k,cliId:c.cliId,card:h}),(c.taskKind==="fix"||c.taskKind==="plan")&&await s().catch(()=>{}),y||!$?null:k}catch(b){return e.push({role:"error",text:B(b)}),null}finally{e.set({busy:{...e.get().busy,chat:!1},workingSince:null,runId:null})}}function l(){queueMicrotask(()=>document.getElementById("stage-heading")?.focus({preventScroll:!0}))}function o(){let c=e.get();return{cliId:c.cliId,accessMode:c.accessMode,modelId:c.modelId||void 0}}let d=Bt(e,{goToStep:c=>u.goToStep(c),testConnection:()=>u.testConnection(e.get().cliId),openAgents:()=>u.openMore("terminal"),openCatalog:c=>{c?(e.set({drawer:"actions",agentOpen:!1,moreOpen:!1}),queueMicrotask(()=>document.getElementById("drawer-close")?.focus({preventScroll:!0}))):e.get().drawer==="actions"&&e.set({drawer:null})},setAccessMode:c=>u.setAccessMode(c),refreshProject:s}),u={...Lt(e),...d,setSection(c){e.get().setup.running||(e.set(p=>({section:c,setup:{...p.setup,open:!1}})),document.getElementById(`tab-${c}`)?.focus({preventScroll:!0}))},toggleAgent(){let c=!e.get().agentOpen;e.set({agentOpen:c}),document.getElementById(c?"agent-composer":"open-more")?.focus({preventScroll:!0}),c&&document.getElementById("agent-panel")?.scrollIntoView?.({behavior:"smooth",block:"nearest"})},openStackSetup(){let c=e.get();e.set({section:"stack",drawer:"services",moreOpen:!1,setup:{...c.setup,open:!0,initialized:c.setup.initialized||c.catalog.length>0,selected:c.setup.initialized?c.setup.selected:vt(c.catalog)}}),document.getElementById("stack-setup-heading")?.focus({preventScroll:!0})},toggleSetupProvider(c){let p=e.get();if(p.setup.running)return;let h=p.setup.selected.includes(c)?p.setup.selected.filter(f=>f!==c):[...p.setup.selected,c];e.set({setup:{...p.setup,initialized:!0,selected:h,progress:[],error:null}})},async startStackSetup(){let c=e.get();if(c.setup.running||c.busy.chat||c.busy.tile||c.busy.scan)return;if(r(!c.probes[c.cliId]?.ready),!c.probes[c.cliId]?.ready){e.toast(`Connect ${c.cliId} in the agent panel first.`,"err");return}let p=c.catalog.filter(f=>c.setup.selected.includes(f.id));if(!p.length){e.toast("Select at least one service.","err");return}let h=o();n=!1,e.set({setup:{...c.setup,running:!0,progress:[],error:null}});try{await Tn({providers:p,mode:h.accessMode,connect:f=>L.connectMcp(f),cancelled:()=>n,onProgress:f=>e.set(g=>({setup:{...g.setup,progress:[...g.setup.progress.filter(w=>w.id!==f.id),f]}})),runAgent:f=>a({...h,taskKind:h.accessMode==="ask"?"plan":"fix",prompt:f},`${h.accessMode==="ask"?"Plan":"Set up"} my stack: ${p.map(g=>g.name).join(", ")}`,{label:"Review the response, then check your app",action:"recheck"})})}catch(f){e.set(g=>({setup:{...g.setup,error:B(f)}}))}finally{await s().catch(()=>{}),e.set(f=>({setup:{...f.setup,running:!1}}))}},async stop(){e.get().setup.running&&(n=!0);let c=e.get().runId;if(c)try{await L.stop(c),e.toast("Stopped.")}catch(p){e.toast(B(p),"err")}},async recheck(){if(!(e.get().setup.running||e.get().busy.chat||e.get().busy.scan)){e.set({busy:{...e.get().busy,scan:!0}});try{await L.scan(),await s(),e.toast("Check finished.")}catch(c){e.toast(`Check failed: ${B(c)}`,"err")}finally{e.set({busy:{...e.get().busy,scan:!1}})}}},toggleDrawer(c){let p=e.get().drawer;e.set(h=>({drawer:h.drawer===c?null:c})),document.getElementById(e.get().drawer?"drawer-close":"open-more")?.focus({preventScroll:!0})},selectCli(c){if(e.get().setup.running||e.get().busy.chat)return;e.set({cliId:c,modelId:""}),d.loadWork(),e.get().agents.find(h=>h.id===c)?.installed&&!e.get().probes[c]&&u.testConnection(c)},setAccessMode(c){e.get().setup.running||e.get().busy.chat||e.set({accessMode:c})},async testConnection(c,p){if(!t.has(c)){t.add(c),e.set({busy:{...e.get().busy,probe:c}});try{let h=await L.probe(c);e.set(f=>({probes:{...f.probes,[c]:h},terminalOutput:h.output||h.message})),p?.silent||e.toast(h.message,h.ready?"ok":"err"),d.loadWork()}catch(h){e.set(f=>{let g={...f.probes};return delete g[c],{probes:g}}),e.toast(B(h),"err")}finally{t.delete(c),e.set(h=>({busy:{...h.busy,probe:h.busy.probe===c?null:h.busy.probe}}))}}},async runSetup(c,p){e.set({terminalOutput:`$ ${p}\u2026`});try{let h=await L.runSetup(c,p);e.set({terminalOutput:`$ ${h.command}
18
+ ${h.output}`.trim()});let f=await L.agents();e.set({agents:f.agents.filter(g=>g.id==="codex"||g.id==="claude"||g.id==="gemini")})}catch(h){e.set({terminalOutput:B(h)})}},async openTerminal(c,p){try{let h=await L.openTerminal(c,p);e.set({terminalOutput:`Opened a terminal with: ${h.command}
19
+ Sign in there, then press Test connection.`})}catch(h){e.toast(B(h),"err")}},async send(c){if(e.get().setup.running)return;let p=c.trim();if(!p)return;let h=e.get(),f=h.contextProviderId?h.catalog.find(g=>g.id===h.contextProviderId):null;await a({...o(),prompt:p,taskKind:"analyze",provider:f?{id:f.id,name:f.name,area:f.area}:void 0},p)},async connect(c){if(!(e.get().setup.running||e.get().busy.chat||e.get().busy.tile)){r(),e.set({busy:{...e.get().busy,tile:c.id}});try{let p=await L.connectMcp(c.id);e.toast(p.message,p.ok?"ok":"err"),await s(),p.ok&&e.push({role:"system",text:`${p.message} ${c.note??""}`.trim(),card:{providerId:c.id,label:`${c.name} \xB7 MCP configured`,action:"verify"}})}catch(p){e.toast(B(p),"err")}finally{e.set({busy:{...e.get().busy,tile:null}})}}},async verify(c){return u.verifyById(c.id)},async verifyById(c){let p=e.get();if(p.setup.running||p.busy.chat||p.busy.tile)return;let f=(p.catalog.find(b=>b.id===c)??p.project.providers.find(b=>b.id===c))?.name??c,g=p.probes[p.cliId];if(r(!g?.ready),!g?.ready){e.toast(`Test the ${p.cliId} connection first.`,"err");return}e.push({role:"me",text:`Check ${f} live`});let w=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;e.set({busy:{...e.get().busy,tile:c,chat:!0},workingSince:Date.now(),runId:w});try{let b=await L.verify({providerId:c,...o(),runId:w}),M=b.agentRun.output?.trim()||b.agentRun.stderr?.trim()||"No output.";e.push({role:"agent",text:M,cliId:p.cliId,card:{providerId:c,label:b.verified.ok?`${f} \xB7 verified live`:`${f} \xB7 issues found`}}),await s()}catch(b){e.push({role:"error",text:B(b)})}finally{e.set({busy:{...e.get().busy,tile:null,chat:!1},workingSince:null,runId:null})}},async addProvider(c){e.get().setup.running||await a({...o(),taskKind:"fix",provider:{id:c.id,name:c.name,area:c.area},prompt:`Add ${c.name} (${c.area}) to this app. Install the official SDK, wire the minimal integration the app needs, add the required keys to .env.example with placeholder values, and never invent real secrets. Then tell me exactly which dashboard steps remain.`},`Add ${c.name} to this app`,{providerId:c.id,label:`${c.name} \xB7 added to repo`,action:"recheck"})},async fix(c,p){if(e.get().setup.running)return;let h=p?.provider?.nextFix?.id===c.id&&p.provider.nextFix.prompt?p.provider.nextFix.prompt:`Fix this production blocker in the repo now: ${c.title}. ${c.detail??""} Make the minimal change, then summarize what you changed and which files.`,f=c.asksFirst?`${c.asksFirst} Tell the user this before you change anything, and make the change only if they confirm.
20
+ ${h}`:h;await a({...o(),taskKind:"fix",provider:p?{id:p.id,name:p.name,area:p.area}:void 0,prompt:f},`Fix: ${c.title}`,{providerId:p?.id,label:"Re-check to update the score",action:"recheck"})},async explain(c,p){e.get().setup.running||await a({...o(),taskKind:"analyze",provider:p?{id:p.id,name:p.name,area:p.area}:void 0,prompt:`This blocker needs dashboard work: ${c.title}. ${c.detail??""} Give me the exact steps: which page, which button, which value. If a provider MCP is available, do the read-only parts yourself first.`},`Steps for: ${c.title}`)},async fixAll(){if(e.get().setup.running)return;let{missionCards:c}=e.get().project,p=c.blockers.filter(h=>!h.asksFirst&&c.planSteps.some(f=>f.id===h.id&&!f.requiresUserAction&&!f.asksFirst));p.length&&await a({...o(),taskKind:"fix",prompt:`Fix these production blockers in the repo, one by one, minimal changes each:
21
+ ${p.map((h,f)=>`${f+1}. ${h.title}`).join(`
16
22
  `)}
17
- After each, note the files touched. Do not claim production-ready; I will re-check.`},`Fix all ${l.length} repo blockers`,{label:"Re-check to update the score",action:"recheck"})},focusBlockers(r){if(!S(e.get()).available.findings)return;e.set(d=>({section:"findings",drawer:null,contextProviderId:r,setup:{...d.setup,open:!1},flow:{...d.flow,step:"findings"}}));let l=Array.from(document.querySelectorAll(".finding")).find(d=>d.dataset.provider===r)??document.getElementById("stage-heading");l?.focus({preventScroll:!0}),l?.scrollIntoView?.({behavior:"smooth",block:"center"})},async compare(r,l){if(!r.trim()||!l.trim()){e.set({compare:{...e.get().compare,error:"Both refs are required."}});return}e.set({busy:{...e.get().busy,compare:!0},compare:{...e.get().compare,from:r,to:l,error:null}});try{let d=await k.compare(r.trim(),l.trim());e.set({compare:{from:r,to:l,result:d,error:null}})}catch(d){e.set({compare:{from:r,to:l,result:null,error:C(d)}})}finally{e.set({busy:{...e.get().busy,compare:!1}})}},async explainDiff(r,l){e.get().setup.running||await c({...o(),taskKind:"diff",release:{id:`${r.trim()}..${l.trim()}`,label:`${r.trim()} \u2192 ${l.trim()}`},prompt:`Explain what changed between ${r.trim()} and ${l.trim()} in this repo, in plain words. Call out anything risky for production: auth, database writes, webhooks, env, payments.`},`Explain ${r.trim()} \u2192 ${l.trim()}`)},goToStep(r){let l=S(e.get());l.available[r]&&(r==="fix"&&!l.current&&e.flow({fixId:l.fixable[0]?.id??null,handoff:null}),e.flow({step:r}),u())},async checkMyApp(){let r=e.get();if(!(r.busy.scan||r.setup.running)){e.set({busy:{...r.busy,scan:!0}});try{await k.scan(),await a();let l=S(e.get());e.flow({step:ie(l),fixId:null,handoff:null,recheck:null}),u()}catch(l){e.toast(`The check did not finish: ${C(l)}`,"err")}finally{e.set({busy:{...e.get().busy,scan:!1}})}}},fixFinding(r){let l=S(e.get()),d=r?l.fixable.find(h=>h.id===r):l.fixable[0];d&&(e.flow({step:"fix",fixId:d.id,handoff:e.get().flow.handoff?.findingId===d.id?e.get().flow.handoff:null}),u())},async sendFix(){let r=e.get(),l=S(r).current;if(!l||r.busy.chat||r.setup.running||!r.probes[r.cliId]?.ready&&(await p.testConnection(r.cliId),!e.get().probes[r.cliId]?.ready))return;let d=e.get().cliId,h=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;e.set({busy:{...e.get().busy,chat:!0},workingSince:Date.now(),runId:h}),e.flow({handoff:{findingId:l.id,cliId:d,status:"running",output:""}}),e.push({role:"me",text:`Fix: ${l.title}`});try{let g=(await k.chat({...o(),runId:h,taskKind:"fix",prompt:l.prompt,displayPrompt:`Fix: ${l.title}`,provider:l.service?{id:l.service.id,name:l.service.name,area:""}:void 0})).agentRun,m=/Stopped by user/.test(g.stderr??""),M=g.timedOut||m||g.exitCode!==null&&g.exitCode!==0||!g.output?.trim(),w=g.output?.trim()||(m?"Stopped.":g.timedOut?`${d} did not finish in time and was stopped.`:`${d} exited with code ${g.exitCode??"unknown"} and no answer.
23
+ After each, note the files touched. Do not claim production-ready; I will re-check.`},`Fix all ${p.length} repo blockers`,{label:"Re-check to update the score",action:"recheck"})},focusBlockers(c){if(!R(e.get()).available.findings)return;e.set(h=>({section:"findings",drawer:null,contextProviderId:c,setup:{...h.setup,open:!1},flow:{...h.flow,step:"findings"}}));let p=Array.from(document.querySelectorAll(".finding")).find(h=>h.dataset.provider===c)??document.getElementById("stage-heading");p?.focus({preventScroll:!0}),p?.scrollIntoView?.({behavior:"smooth",block:"center"})},async compare(c,p){if(!c.trim()||!p.trim()){e.set({compare:{...e.get().compare,error:"Both refs are required."}});return}e.set({busy:{...e.get().busy,compare:!0},compare:{...e.get().compare,from:c,to:p,error:null}});try{let h=await L.compare(c.trim(),p.trim());e.set({compare:{from:c,to:p,result:h,error:null}})}catch(h){e.set({compare:{from:c,to:p,result:null,error:B(h)}})}finally{e.set({busy:{...e.get().busy,compare:!1}})}},async explainDiff(c,p){e.get().setup.running||await a({...o(),taskKind:"diff",release:{id:`${c.trim()}..${p.trim()}`,label:`${c.trim()} \u2192 ${p.trim()}`},prompt:`Explain what changed between ${c.trim()} and ${p.trim()} in this repo, in plain words. Call out anything risky for production: auth, database writes, webhooks, env, payments.`},`Explain ${c.trim()} \u2192 ${p.trim()}`)},goToStep(c){let p=R(e.get());p.available[c]&&(c==="fix"&&!p.current&&e.flow({fixId:p.fixable[0]?.id??null,handoff:null}),e.flow({step:c}),l())},async checkMyApp(){let c=e.get();if(!(c.busy.scan||c.setup.running)){e.set({busy:{...c.busy,scan:!0}});try{await L.scan(),await s();let p=R(e.get());e.flow({step:ot(p),fixId:null,handoff:null,recheck:null}),l()}catch(p){e.toast(`The check did not finish: ${B(p)}`,"err")}finally{e.set({busy:{...e.get().busy,scan:!1}})}}},fixFinding(c){let p=R(e.get()),h=c?p.fixable.find(f=>f.id===c):p.fixable[0];h&&(e.flow({step:"fix",fixId:h.id,handoff:e.get().flow.handoff?.findingId===h.id?e.get().flow.handoff:null}),l())},async sendFix(){let c=e.get(),p=R(c).current;if(!p||c.busy.chat||c.setup.running||!c.probes[c.cliId]?.ready&&(await u.testConnection(c.cliId),!e.get().probes[c.cliId]?.ready))return;let h=e.get().cliId,f=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;e.set({busy:{...e.get().busy,chat:!0},workingSince:Date.now(),runId:f}),e.flow({handoff:{findingId:p.id,cliId:h,status:"running",output:""}}),e.push({role:"me",text:`Fix: ${p.title}`});try{let w=(await L.chat({...o(),runId:f,taskKind:"fix",prompt:p.prompt,displayPrompt:`Fix: ${p.title}`,provider:p.service?{id:p.service.id,name:p.service.name,area:""}:void 0})).agentRun,b=/Stopped by user/.test(w.stderr??""),M=w.timedOut||b||w.exitCode!==null&&w.exitCode!==0||!w.output?.trim(),$=w.output?.trim()||(b?"Stopped.":w.timedOut?`${h} did not finish in time and was stopped.`:`${h} exited with code ${w.exitCode??"unknown"} and no answer.
18
24
 
19
- ${Ge(g.stderr,1200)}`);e.flow({handoff:{findingId:l.id,cliId:d,status:M?"failed":"done",output:w}}),e.push({role:M?"error":"agent",text:w,cliId:d})}catch(y){e.flow({handoff:{findingId:l.id,cliId:d,status:"failed",output:C(y)}})}finally{e.set({busy:{...e.get().busy,chat:!1},workingSince:null,runId:null})}},async copyFix(){let r=S(e.get()).current;if(r)try{await navigator.clipboard.writeText(r.prompt),e.toast("Prompt copied. Paste it into your coding agent.")}catch{e.toast("Could not copy. Select the prompt and copy it by hand.","err")}},async checkAgain(){let r=e.get(),l=S(r).current;if(!l||r.busy.scan)return;let d=r.project.gate?.score;e.flow({step:"recheck",recheck:{findingId:l.id,title:l.title,status:"running",scoreBefore:d}}),e.set({busy:{...e.get().busy,scan:!0}}),u();try{await k.scan(),await a();let h=S(e.get()),y=h.findings.find(M=>M.id===l.id),g=e.get().project.gate?.score;if(y){e.flow({recheck:{findingId:l.id,title:l.title,status:"open",message:y.summary,scoreBefore:d,scoreAfter:g}});return}let m=h.fixable[0]??null;e.flow({recheck:{findingId:l.id,title:l.title,status:"fixed",nextId:m?.id??null,scoreBefore:d,scoreAfter:g}}),window.setTimeout(()=>{let M=e.get().flow;if(M.step!=="recheck"||M.recheck?.findingId!==l.id||M.recheck.status!=="fixed")return;let w=S(e.get());m&&w.fixable.some(D=>D.id===m.id)?e.flow({step:"fix",fixId:m.id,handoff:null}):e.flow({step:"ready",fixId:null,handoff:null}),u()},1600)}catch(h){e.flow({recheck:{findingId:l.id,title:l.title,status:"error",message:C(h),scoreBefore:d}})}finally{e.set({busy:{...e.get().busy,scan:!1}})}},toggleChecklistItem(r){let l={...e.get().flow.checklist,[r]:!e.get().flow.checklist[r]};e.flow({checklist:l})},togglePrChecks(r){let l=r??!e.get().prChecks.open;e.set(d=>({prChecks:{...d.prChecks,open:l,error:null}})),l?queueMicrotask(()=>document.getElementById("pr-checks-action")?.focus({preventScroll:!0})):document.getElementById("pr-checks-button")?.focus({preventScroll:!0})},async addPrChecks(){if(!e.get().prChecks.busy){e.set(r=>({prChecks:{...r.prChecks,busy:!0,error:null}}));try{let r=await k.addGithubWorkflow();e.set(l=>({prChecks:{...l.prChecks,status:r.status,written:r.written,busy:!1}})),queueMicrotask(()=>document.getElementById("pr-checks-copy")?.focus({preventScroll:!0}))}catch(r){e.set(l=>({prChecks:{...l.prChecks,busy:!1,error:C(r)}}))}}},async copyPrCommit(){let r=e.get().prChecks.status?.path??".github/workflows/viberaven.yml";try{await navigator.clipboard.writeText(`git add ${r} && git commit -m "Check pull requests with VibeRaven"`),e.toast("Copied. Run it, then push.")}catch{e.toast("Could not copy. Select the command and copy it by hand.","err")}},toggleMore(r){let l=r??!e.get().moreOpen;e.set({moreOpen:l}),l?queueMicrotask(()=>document.querySelector('#more-menu [role="menuitem"]')?.focus({preventScroll:!0})):document.getElementById("open-more")?.focus({preventScroll:!0})},openMore(r){if(e.set({moreOpen:!1}),r==="chat"){s();return}if(r==="services"){e.set({drawer:"services",agentOpen:!1}),queueMicrotask(()=>document.getElementById("drawer-close")?.focus({preventScroll:!0}));return}e.set({drawer:r,agentOpen:!1}),queueMicrotask(()=>document.getElementById("drawer-close")?.focus({preventScroll:!0}))}};return p}function Kt(){let e=document.getElementById("app");if(!e)return;let i=be(Wt()),n=qt(i),s=()=>He(e,i,n);i.subscribe(s),s(),document.addEventListener("keydown",u=>{let o=i.get().fullCheck.step;if(u.key==="Escape"&&o!=="closed"){o!=="running"&&n.closeFullCheck();return}if(u.key==="Escape"&&i.get().moreOpen){n.toggleMore(!1);return}if(u.key==="Escape"&&i.get().prChecks.open){n.togglePrChecks(!1);return}if(u.key==="Escape"&&i.get().agentOpen){n.toggleAgent();return}u.key==="Escape"&&i.get().drawer&&n.toggleDrawer(null)}),document.addEventListener("pointerdown",u=>{!i.get().moreOpen||u.target?.closest("#more-menu, #open-more")||i.set({moreOpen:!1})});let a=()=>{let u=i.get();if(!u.catalog.length||u.setup.running||u.busy.chat)return;let o=Qe(window.location.hash,u.catalog.map(p=>p.id));o!==null&&(i.set({section:"stack",drawer:"services",agentOpen:!1,moreOpen:!1,setup:{...u.setup,open:!0,initialized:!0,selected:o,progress:[],error:null}}),history.replaceState(null,"",window.location.pathname+window.location.search),document.getElementById("stack-setup-heading")?.focus())};window.addEventListener("hashchange",a),k.catalog().then(u=>{i.set(o=>({catalog:u.providers,setup:o.setup.open&&!o.setup.initialized?{...o.setup,initialized:!0,selected:pe(u.providers)}:o.setup})),a()}).catch(()=>{}),k.verified().then(u=>i.set({verified:u.verified})).catch(()=>{}),k.githubWorkflow().then(u=>i.set(o=>({prChecks:{...o.prChecks,status:u}}))).catch(()=>{}),k.agents().then(u=>{i.set({agents:u.agents.filter(p=>p.id==="codex"||p.id==="claude"||p.id==="gemini")});let o=u.agents.find(p=>p.id===i.get().cliId);if(o&&!o.installed){let p=u.agents.find(r=>r.installed);p&&i.set({cliId:p.id})}n.testConnection(i.get().cliId,{silent:!0})}).catch(()=>{});let c=async()=>{try{let u=await k.scanStatus();if(i.set({scan:u}),u.state==="running")window.setTimeout(c,1500);else if(u.state==="done"&&i.get().project.empty){let o=await k.project();i.set({project:o}),i.get().flow.step==="app"&&i.flow({step:ie(S(i.get()))})}}catch{}};c(),window.setInterval(()=>{Ye(document,i.get().workingSince)},1e3)}Kt();})();
25
+ ${Dn(w.stderr,1200)}`);e.flow({handoff:{findingId:p.id,cliId:h,status:M?"failed":"done",output:$}}),e.push({role:M?"error":"agent",text:$,cliId:h})}catch(g){e.flow({handoff:{findingId:p.id,cliId:h,status:"failed",output:B(g)}})}finally{e.set({busy:{...e.get().busy,chat:!1},workingSince:null,runId:null})}},async copyFix(){let c=R(e.get()).current;if(c)try{await navigator.clipboard.writeText(c.prompt),e.toast("Prompt copied. Paste it into your coding agent.")}catch{e.toast("Could not copy. Select the prompt and copy it by hand.","err")}},async checkAgain(){let c=e.get(),p=R(c).current;if(!p||c.busy.scan)return;let h=c.project.gate?.score;e.flow({step:"recheck",recheck:{findingId:p.id,title:p.title,status:"running",scoreBefore:h}}),e.set({busy:{...e.get().busy,scan:!0}}),l();try{await L.scan(),await s();let f=R(e.get()),g=f.findings.find(M=>M.id===p.id),w=e.get().project.gate?.score;if(g){e.flow({recheck:{findingId:p.id,title:p.title,status:"open",message:g.summary,scoreBefore:h,scoreAfter:w}});return}let b=f.fixable[0]??null;e.flow({recheck:{findingId:p.id,title:p.title,status:"fixed",nextId:b?.id??null,scoreBefore:h,scoreAfter:w}}),window.setTimeout(()=>{let M=e.get().flow;if(M.step!=="recheck"||M.recheck?.findingId!==p.id||M.recheck.status!=="fixed")return;let $=R(e.get());b&&$.fixable.some(y=>y.id===b.id)?e.flow({step:"fix",fixId:b.id,handoff:null}):e.flow({step:"ready",fixId:null,handoff:null}),l()},1600)}catch(f){e.flow({recheck:{findingId:p.id,title:p.title,status:"error",message:B(f),scoreBefore:h}})}finally{e.set({busy:{...e.get().busy,scan:!1}})}},toggleChecklistItem(c){let p={...e.get().flow.checklist,[c]:!e.get().flow.checklist[c]};e.flow({checklist:p})},togglePrChecks(c){let p=c??!e.get().prChecks.open;e.set(h=>({prChecks:{...h.prChecks,open:p,error:null}})),p?queueMicrotask(()=>document.getElementById("pr-checks-action")?.focus({preventScroll:!0})):document.getElementById("pr-checks-button")?.focus({preventScroll:!0})},async addPrChecks(){if(!e.get().prChecks.busy){e.set(c=>({prChecks:{...c.prChecks,busy:!0,error:null}}));try{let c=await L.addGithubWorkflow();e.set(p=>({prChecks:{...p.prChecks,status:c.status,written:c.written,busy:!1}})),queueMicrotask(()=>document.getElementById("pr-checks-copy")?.focus({preventScroll:!0}))}catch(c){e.set(p=>({prChecks:{...p.prChecks,busy:!1,error:B(c)}}))}}},async copyPrCommit(){let c=e.get().prChecks.status?.path??".github/workflows/viberaven.yml";try{await navigator.clipboard.writeText(`git add ${c} && git commit -m "Check pull requests with VibeRaven"`),e.toast("Copied. Run it, then push.")}catch{e.toast("Could not copy. Select the command and copy it by hand.","err")}},toggleMore(c){let p=c??!e.get().moreOpen;e.set({moreOpen:p}),p?queueMicrotask(()=>document.querySelector('#more-menu [role="menuitem"]')?.focus({preventScroll:!0})):document.getElementById("open-more")?.focus({preventScroll:!0})},openMore(c){if(e.set({moreOpen:!1}),c==="chat"){r();return}if(c==="services"){e.set({drawer:"services",agentOpen:!1}),queueMicrotask(()=>document.getElementById("drawer-close")?.focus({preventScroll:!0}));return}e.set({drawer:c,agentOpen:!1}),queueMicrotask(()=>document.getElementById("drawer-close")?.focus({preventScroll:!0}))}};return u}function Xr(){let e=document.getElementById("app");if(!e)return;let n=Ct(Kr()),t=_r(n),r=()=>$n(e,n,t);n.subscribe(r),r(),document.addEventListener("keydown",l=>{let o=n.get().fullCheck.step;if(l.key==="Escape"&&o!=="closed"){o!=="running"&&t.closeFullCheck();return}if(l.key==="Escape"&&n.get().moreOpen){t.toggleMore(!1);return}if(l.key==="Escape"&&n.get().prChecks.open){t.togglePrChecks(!1);return}if(l.key==="Escape"&&n.get().agentOpen){t.toggleAgent();return}l.key==="Escape"&&n.get().drawer&&t.toggleDrawer(null)}),document.addEventListener("pointerdown",l=>{!n.get().moreOpen||l.target?.closest("#more-menu, #open-more")||n.set({moreOpen:!1})});let s=()=>{let l=n.get();if(!l.catalog.length||l.setup.running||l.busy.chat)return;let o=Nn(window.location.hash,l.catalog.map(d=>d.id));o!==null&&(n.set({section:"stack",drawer:"services",agentOpen:!1,moreOpen:!1,setup:{...l.setup,open:!0,initialized:!0,selected:o,progress:[],error:null}}),history.replaceState(null,"",window.location.pathname+window.location.search),document.getElementById("stack-setup-heading")?.focus())};window.addEventListener("hashchange",s),L.catalog().then(l=>{n.set(o=>({catalog:l.providers,setup:o.setup.open&&!o.setup.initialized?{...o.setup,initialized:!0,selected:vt(l.providers)}:o.setup})),s()}).catch(()=>{}),L.verified().then(l=>n.set({verified:l.verified})).catch(()=>{}),t.loadSavedFullCheck(),t.loadWork(),L.githubWorkflow().then(l=>n.set(o=>({prChecks:{...o.prChecks,status:l}}))).catch(()=>{}),L.agents().then(l=>{n.set({agents:l.agents.filter(d=>d.id==="codex"||d.id==="claude"||d.id==="gemini")});let o=l.agents.find(d=>d.id===n.get().cliId);if(o&&!o.installed){let d=l.agents.find(u=>u.installed);d&&n.set({cliId:d.id})}t.testConnection(n.get().cliId,{silent:!0})}).catch(()=>{});let a=async()=>{try{let l=await L.scanStatus();if(n.set({scan:l}),l.state==="running")window.setTimeout(a,1500);else if(l.state==="done"&&n.get().project.empty){let o=await L.project();n.set({project:o}),n.get().flow.step==="app"&&n.flow({step:ot(R(n.get()))})}}catch{}};a(),window.setInterval(()=>{jn(document,n.get().workingSince)},1e3)}Xr();})();