plaincrew 0.2.2 → 0.2.4
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/app-build/BUILD_ID +1 -1
- package/app-build/build-manifest.json +3 -3
- package/app-build/diagnostics/route-bundle-stats.json +18 -18
- package/app-build/fallback-build-manifest.json +3 -3
- package/app-build/server/app/_global-error.html +1 -1
- package/app-build/server/app/_global-error.rsc +1 -1
- package/app-build/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/app-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app-build/server/app/_not-found.html +1 -1
- package/app-build/server/app/_not-found.rsc +1 -1
- package/app-build/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/app-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/app-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/app-build/server/app/canvas/[workflowId]/page_client-reference-manifest.js +1 -1
- package/app-build/server/app/connect/page_client-reference-manifest.js +1 -1
- package/app-build/server/app/invite/[id]/page_client-reference-manifest.js +1 -1
- package/app-build/server/app/organization/new/page_client-reference-manifest.js +1 -1
- package/app-build/server/app/page_client-reference-manifest.js +1 -1
- package/app-build/server/app/sign-in/page_client-reference-manifest.js +1 -1
- package/app-build/server/app/sign-up/page_client-reference-manifest.js +1 -1
- package/app-build/server/chunks/[root-of-the-server]__0_use5ykfraw7._.js +1 -1
- package/app-build/server/chunks/_09ejh1dyvkto7._.js +1 -1
- package/app-build/server/chunks/_0b2ridyy82jxe._.js +1 -1
- package/app-build/server/chunks/_0e2pq-eirvzjq._.js +1 -1
- package/app-build/server/chunks/_0et5mjk8ma941._.js +1 -1
- package/app-build/server/chunks/_0prtq3d1e3y27._.js +1 -1
- package/app-build/server/chunks/_12v43tznpol4u._.js +1 -1
- package/app-build/server/chunks/_19_0wmfnwvz9o._.js +1 -1
- package/app-build/server/chunks/_19q1zxel7pllh._.js +1 -1
- package/app-build/server/chunks/_1bf1pcq2wtg91._.js +1 -1
- package/app-build/server/chunks/_1cq7469bqdm3u._.js +1 -1
- package/app-build/server/chunks/_1ob-6ym8mt48u._.js +1 -1
- package/app-build/server/chunks/_1uwtj6yrwszfe._.js +1 -1
- package/app-build/server/chunks/_1vb0vvvhh6nh7._.js +1 -1
- package/app-build/server/chunks/ssr/_14z-y2hqpv20w._.js +2 -2
- package/app-build/server/chunks/ssr/src_ui_0a7papum2y8_i._.js +1 -1
- package/app-build/server/chunks/ssr/src_ui_0dybjq718frlj._.js +1 -1
- package/app-build/server/chunks/ssr/src_ui_1lk_5nzn_qoqs._.js +1 -1
- package/app-build/server/chunks/ssr/src_ui_1pd2_lbqeputa._.js +1 -1
- package/app-build/server/chunks/ssr/src_ui_strings_ts_1es3352ykktl1._.js +1 -1
- package/app-build/server/middleware-build-manifest.js +3 -3
- package/app-build/server/pages/404.html +1 -1
- package/app-build/server/pages/500.html +1 -1
- package/app-build/static/chunks/{2-i8llxdbif11.js → 0ktd6egow2li4.js} +1 -1
- package/app-build/static/chunks/13wn9vx3riyrm.js +5 -0
- package/app-build/static/chunks/{0ii9_22v9su8d.js → 1bs37pgeduned.js} +1 -1
- package/app-build/trace-build +1 -1
- package/bin/plaincrew.mjs +49 -13
- package/package.json +1 -1
- package/app-build/static/chunks/2ld15xpoa2y6e.js +0 -5
- /package/app-build/static/{dLfuxcueP2VUobb7KqDeT → yqtP8lYCZufkpLNxUxuPr}/_buildManifest.js +0 -0
- /package/app-build/static/{dLfuxcueP2VUobb7KqDeT → yqtP8lYCZufkpLNxUxuPr}/_clientMiddlewareManifest.js +0 -0
- /package/app-build/static/{dLfuxcueP2VUobb7KqDeT → yqtP8lYCZufkpLNxUxuPr}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,21069,21347,e=>{"use strict";e.s(["J",()=>C,"c",()=>I,"l",()=>z,"G",()=>v,"X",()=>k,"v",()=>$,"e",()=>W,"K",()=>w,"u",()=>L,"m",()=>M,"Y",()=>y],21069),e.s(["U",()=>h,"B",()=>u,"O",()=>g],21347);var t=e.i(43476),n=e.i(71645),i=e.i(85402),r=e.i(30904),s=e.i(64425),o=e.i(44094),a=e.i(34910),l=e.i(53148),d=e.i(74080),p=e.i(76871);let c={request:i.f.running,followUp:i.f.running,memory:"#2dd4bf",replan:i.f.waiting,changes:i.f.waiting,reviewer:"#a78bfa",approvedNote:i.f.passed,rejectedNote:i.f.failed,answer:i.f.waiting},u=e=>e.earlier?"input":e.step??f[e.kind],f={request:"input",followUp:"input",memory:"input",replan:"plan",reviewer:"review",changes:"human",approvedNote:"human",rejectedNote:"human",answer:"plan"};function g(e,t){let[i,r]=(0,n.useState)(null);return(0,n.useEffect)(()=>{if(!e)return;let t=!0;return fetch(`/api/runs/${e}/prompts`).then(e=>e.ok?e.json():null).then(n=>t&&n&&r({runId:e,prompts:n.prompts})).catch(()=>void 0),()=>{t=!1}},[e,t]),i&&i.runId===e?i.prompts:[]}function h({prompts:e}){let[s,o]=(0,n.useState)(null);return 0===e.length?null:(0,t.jsxs)("div",{"data-testid":"asked-strip",className:"nodrag",onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),style:{display:"grid",gap:6,marginTop:10},children:[e.map((e,n)=>(0,t.jsxs)("button",{type:"button",onClick:()=>o(e),title:r.B.prompts.open,style:{textAlign:"left",display:"grid",gap:3,padding:"7px 9px",borderRadius:8,border:`1px solid ${i.f.border}`,borderLeft:`3px solid ${c[e.kind]}`,background:"#0d1118",color:"#d6dce6",cursor:"pointer",opacity:e.earlier?.75:1},children:[(0,t.jsxs)("span",{style:{display:"flex",justifyContent:"space-between",gap:6,fontSize:9.5,fontWeight:800,letterSpacing:"0.1em",textTransform:"uppercase",color:c[e.kind]},children:[(0,t.jsxs)("span",{children:[e.earlier?`${r.B.prompts.earlier} \xb7 `:"",r.B.prompts.kind[e.kind]]}),(0,t.jsx)("span",{style:{fontWeight:600,letterSpacing:0,textTransform:"none",color:i.f.dim},children:(0,p.O)(e.at)})]}),(0,t.jsx)("span",{style:{fontSize:12.5,lineHeight:1.4,overflow:"hidden",display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical"},children:e.text})]},`${e.at}-${n}`)),s&&(0,t.jsx)(x,{prompt:s,onClose:()=>o(null)})]})}function x({prompt:e,onClose:s}){let o=(0,n.useRef)(null);return(0,n.useEffect)(()=>{o.current?.focus();let e=e=>{"Escape"===e.key&&s()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[s]),(0,d.createPortal)((0,t.jsx)("div",{onClick:s,style:{position:"fixed",inset:0,zIndex:100,background:"rgba(5, 7, 11, 0.7)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",placeItems:"center",padding:24},children:(0,t.jsxs)("div",{ref:o,role:"dialog","aria-modal":"true","aria-label":r.B.prompts.kind[e.kind],tabIndex:-1,onClick:e=>e.stopPropagation(),style:{width:"min(680px, 100%)",maxHeight:"80vh",display:"flex",flexDirection:"column",background:i.f.bg,border:`1px solid ${i.f.border}`,borderTop:`3px solid ${c[e.kind]}`,borderRadius:14,boxShadow:"0 30px 80px rgba(0,0,0,0.6)",outline:"none",color:"#e6e9ef"},children:[(0,t.jsxs)("header",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,padding:"12px 16px",borderBottom:`1px solid ${i.f.border}`},children:[(0,t.jsxs)("div",{style:{fontSize:13,fontWeight:800,letterSpacing:"0.08em",textTransform:"uppercase",color:c[e.kind]},children:[r.B.prompts.kind[e.kind]," ",(0,t.jsxs)("span",{style:{fontWeight:600,letterSpacing:0,textTransform:"none",color:i.f.dim},children:["· ",new Date(e.at).toLocaleString()]})]}),(0,t.jsx)("button",{type:"button","aria-label":r.B.prompts.close,onClick:s,style:{background:"none",border:"none",color:i.f.skipped,cursor:"pointer",fontSize:18,lineHeight:1,padding:6},children:"✕"})]}),(0,t.jsx)("div",{style:{padding:16,overflowY:"auto",fontSize:14.5,lineHeight:1.55,whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:e.text})]})}),document.body)}let b={queued:"skipped",running:"running",waiting_approval:"waiting",passed:"passed",failed:"failed",cancelled:"skipped",skipped:"skipped",blocked:"failed"};function y(e){return b[e]}let m=new Set(["running","failed","waiting"]),j={passed:"✓",failed:"✕"},k=320,v=304,w=80,S="var(--font-mono), ui-monospace, SFMono-Regular, Menlo, monospace",B={fontSize:10,fontWeight:800,letterSpacing:"0.13em",textTransform:"uppercase"},$=(0,n.createContext)(e=>"string"==typeof e&&""!==e.trim()?e:null),I=(0,n.createContext)(()=>null);function C({ai:e,testId:n}){return(0,t.jsxs)("span",{"data-testid":n,title:r.B.editing.doneBy(e.name),style:{flex:"none",display:"inline-flex",alignItems:"center",gap:6,padding:"4px 9px",background:"rgba(255, 255, 255, 0.045)",border:`1px solid ${i.f.lineSoft}`,borderRadius:999,fontSize:11.5,fontWeight:600,color:i.f.dim,whiteSpace:"nowrap"},children:[(0,t.jsx)(s.f,{id:e.id,size:13}),e.short??e.name]})}function z({block:e,view:s,expanded:o=!1,selected:d=!1,issues:p=[],breadcrumb:c,onCollapse:u,onRemove:f,collapseLabel:g=r.B.canvas.collapse,width:x,failedActions:y,onDetails:w}){var W;let R=(0,n.useContext)($)(e.config.model,e.kind,e.config.ai),L=(0,n.useContext)(I)(e.config.ai,e.kind),P=b[s.state],F=i.f[P],N=s.notBuilt?r.B.canvas.notBuilt:s.turn?r.B.direct.yourTurn:s.asking&&"waiting_approval"===s.state?r.B.question.stateLabel:s.stateWord??r.B.canvas.stateLabel[s.state],E=s.steps??[],q=E.slice(-6),O=E.length-q.length,D=E[E.length-1],U=""!==s.summary.trim(),_=e.enabled&&U&&s.summaryIsClaim,V=j[s.state],Y=d?i.f.running:i.f.border;return(0,t.jsxs)("div",{"data-testid":`block-card-${e.id}`,style:{position:"relative",width:x??k,minWidth:220,minHeight:v,display:"flex",flexDirection:"column",background:i.f.cardFace,borderStyle:s.notBuilt?"dashed":"solid",borderWidth:1,borderTopColor:Y,borderRightColor:Y,borderBottomColor:Y,borderLeftWidth:4,borderLeftColor:F,borderRadius:14,padding:"running"===s.state?"15px 16px 44px":"15px 16px 13px",boxShadow:m.has(P)?i.f.glow(P):"none",fontSize:13,overflowWrap:"anywhere",opacity:e.enabled?s.notBuilt?.6:1:.55},children:[(0,t.jsx)("span",{"aria-hidden":"true",style:{position:"absolute",left:0,right:0,top:0,height:1,borderRadius:"14px 14px 0 0",background:"linear-gradient(90deg, transparent, rgba(255,255,255,0.09) 20%, rgba(255,255,255,0.09) 80%, transparent)"}}),"running"===s.state&&(0,t.jsx)("span",{style:{position:"absolute",left:14,bottom:12},children:(0,t.jsx)(M,{blockId:e.id})}),V&&(0,t.jsx)("span",{"aria-hidden":"true","data-testid":`corner-mark-${e.id}`,style:{position:"absolute",right:-9,top:-9,width:24,height:24,borderRadius:"50%",display:"grid",placeItems:"center",background:F,color:"#07090d",border:`2.5px solid ${i.f.bg}`,fontSize:12,fontWeight:800,lineHeight:1},children:V}),o&&(c&&c.length>0||u)&&(0,t.jsxs)("div",{className:"factory-unfold",style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[c&&c.length>0&&(0,t.jsx)("nav",{"data-testid":"breadcrumb","aria-label":r.B.canvas.breadcrumbAria,style:{minWidth:0,color:i.f.skipped,fontSize:12,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c.join(r.B.canvas.breadcrumbSeparator)}),u&&(0,t.jsx)("span",{style:{marginLeft:"auto",flex:"none"},children:(0,t.jsx)("button",{type:"button",className:"nodrag",onClick:e=>{e.stopPropagation(),u()},style:{background:"none",color:"inherit",border:`1px solid ${i.f.border}`,borderRadius:6,cursor:"pointer",fontSize:12,padding:"3px 8px",display:"inline-flex",alignItems:"center",gap:5,whiteSpace:"nowrap"},children:g})})]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,t.jsx)(a.f,{kind:e.kind,colour:F}),(0,t.jsx)("strong",{className:"factory-display",style:{minWidth:"min-content",overflowWrap:"normal",wordBreak:"normal",fontSize:20,fontWeight:700,letterSpacing:"0",lineHeight:1.1},children:e.label}),(0,t.jsxs)("span",{style:{marginLeft:"auto",flex:"0 1 auto",minWidth:0,display:"flex",alignItems:"center",gap:6},children:[L&&(0,t.jsx)(C,{ai:L,testId:`block-ai-${e.id}`}),R&&(0,t.jsx)("span",{"data-testid":`block-model-${e.id}`,title:R,style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",padding:"4px 9px",background:"rgba(255, 255, 255, 0.045)",border:`1px solid ${i.f.lineSoft}`,borderRadius:999,fontSize:11.5,fontWeight:600,color:i.f.dim,whiteSpace:"nowrap"},children:R}),"tests"===e.kind&&"string"==typeof e.config.testCommand&&""!==e.config.testCommand.trim()&&(0,t.jsx)("span",{"data-testid":`block-command-${e.id}`,title:e.config.testCommand,style:{maxWidth:150,overflow:"hidden",textOverflow:"ellipsis",padding:"4px 9px",background:"rgba(255, 255, 255, 0.045)",border:`1px solid ${i.f.lineSoft}`,borderRadius:999,fontFamily:"var(--font-mono), ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:11,color:i.f.dim,whiteSpace:"nowrap"},children:e.config.testCommand.trim()}),!e.enabled&&(0,t.jsx)("span",{style:{color:i.f.skipped,fontSize:12},children:r.B.editing.disabledBadge}),f&&(0,t.jsx)(A,{label:e.label,onRemove:f})]})]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:7,margin:"11px 0 0"},children:[(0,t.jsx)("span",{"aria-hidden":"true",style:{width:6,height:6,borderRadius:"50%",background:F,flex:"0 0 auto"}}),(0,t.jsx)("span",{"aria-label":r.B.canvas.stateAria(N),style:{...B,fontSize:11,color:F},children:N}),s.round&&(0,t.jsx)("span",{"data-testid":`round-${e.id}`,style:{...B,fontSize:9.5,color:"#cfe0ff",padding:"2px 7px",borderRadius:999,border:`1px solid ${i.f.tint("running",.45)}`,marginLeft:4},children:r.B.gate.round(s.round)})]}),_&&(0,t.jsx)("div",{title:r.B.canvas.claimTitle,style:{...B,color:i.f.waiting,margin:"11px 0 3px"},children:r.B.canvas.claimMarker}),(0,t.jsx)("p",{style:{margin:_?0:"9px 0 0",fontSize:_?15:16,lineHeight:1.36,letterSpacing:"-0.005em",color:_?"#e7dcc4":i.f.ink,fontStyle:_?"italic":"normal",borderLeft:_?`2px solid ${i.f.tint("waiting",.5)}`:void 0,paddingLeft:_?10:void 0},children:e.enabled?U?s.summary:r.B.canvas.noResultLine:r.B.editing.disabledLine}),s.evidence&&(0,t.jsx)(T,{evidence:s.evidence}),s.asked&&s.asked.length>0&&(0,t.jsx)(h,{prompts:s.asked}),s.risk&&(0,t.jsx)(H,{risk:s.risk}),s.results&&(0,t.jsx)(l.v,{runId:s.results,compact:!0}),p.map(e=>(0,t.jsx)("p",{style:{margin:"10px 0 0",fontSize:12.5,color:"#ffb4ac",background:i.f.tint("failed",.09),border:`1px solid ${i.f.tint("failed",.28)}`,borderRadius:8,padding:"7px 9px"},children:e},e)),y&&"failed"===s.state&&(0,t.jsxs)("div",{className:"nodrag nopan","data-testid":"failed-actions",style:{display:"flex",gap:8,marginTop:14,marginBottom:14},onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("button",{type:"button",onClick:y.onSee,style:{flex:1,padding:"8px 10px",borderRadius:8,border:`1px solid ${i.f.failed}`,background:i.f.tint("failed",.14),color:"#ffd9d9",fontSize:13,fontWeight:700,cursor:"pointer"},children:r.B.failure.see}),y.onAgain&&(0,t.jsxs)("button",{type:"button",onClick:y.onAgain,style:{flex:"none",display:"inline-flex",alignItems:"center",gap:7,padding:"8px 12px",borderRadius:8,border:`1px solid ${i.f.border}`,background:"#0f141c",color:"#e6e9ef",fontSize:13,fontWeight:700,cursor:"pointer"},children:[(0,t.jsxs)("svg",{viewBox:"0 0 24 24",width:14,height:14,fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M20 11a8 8 0 1 0-2.3 5.7"}),(0,t.jsx)("path",{d:"M20 4v7h-7"})]}),r.B.failure.tryAgain]})]}),w&&"queued"!==s.state&&!s.notBuilt&&(0,t.jsx)("div",{className:"nodrag nopan",style:{marginTop:12,marginBottom:12},onClick:e=>e.stopPropagation(),children:(0,t.jsxs)("button",{type:"button",onClick:w,style:{display:"inline-flex",alignItems:"center",gap:7,padding:"7px 12px",borderRadius:8,border:`1px solid ${i.f.border}`,background:"#0f141c",color:"#e6e9ef",fontSize:13,fontWeight:700,cursor:"pointer"},children:[(0,t.jsxs)("svg",{viewBox:"0 0 24 24",width:14,height:14,fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,t.jsx)("path",{d:"M12 11v5.5M12 7.6v.1"})]}),s.autoStarted?r.B.plan.seePlan:r.B.details.see]})}),(0,t.jsxs)("div",{style:{marginTop:"auto"},children:[o&&q.length>0&&(0,t.jsxs)("div",{style:{paddingTop:12,borderTop:`1px solid ${i.f.lineSoft}`},children:[(0,t.jsx)("div",{style:{...B,color:"#7d8798",marginBottom:7},children:r.B.canvas.steps}),O>0&&(0,t.jsx)("div",{style:{color:i.f.skipped,fontSize:11.5,marginBottom:4},children:r.B.canvas.earlierStepsHidden(O)}),(0,t.jsx)("ol",{start:O+1,style:{margin:0,paddingLeft:20,display:"grid",gap:3,fontSize:12.5},children:q.map((e,n)=>(0,t.jsx)("li",{style:{color:n===q.length-1?"#dfe4ec":"#6a7383"},children:e},n))})]}),!o&&void 0!==D&&(0,t.jsxs)("div",{style:{display:"flex",gap:7,alignItems:"baseline",paddingTop:12,borderTop:`1px solid ${i.f.lineSoft}`,fontSize:12.5,color:"running"===s.state?"#dfe4ec":"#6a7383"},children:[(0,t.jsx)("span",{"aria-hidden":"true",style:{width:4,height:4,borderRadius:"50%",marginTop:6,flex:"0 0 auto",background:"running"===s.state?i.f.running:"#39424f",boxShadow:"running"===s.state?`0 0 7px ${i.f.running}`:"none"}}),D]}),s.usage&&(0,t.jsxs)("dl",{style:{margin:0,paddingTop:12,borderTop:`1px solid ${i.f.lineSoft}`,display:"flex",alignItems:"baseline",gap:"0 8px",fontFamily:S,fontSize:11.5,color:"#7d8798"},children:[(0,t.jsx)("dt",{children:r.B.canvas.tokens}),(0,t.jsx)("dd",{style:{margin:0,color:i.f.dim,fontWeight:600},children:null===s.usage.tokens?r.B.canvas.notReported:s.usage.tokens.toLocaleString("en-US")}),(0,t.jsx)("dt",{style:{marginLeft:"auto"},children:r.B.canvas.cost}),(0,t.jsx)("dd",{style:{margin:0,color:i.f.dim,fontWeight:600},children:null===s.usage.costCents?r.B.canvas.notReported:(W=s.usage.costCents,`$${(W/100).toFixed(2)}`)})]})]})]})}function W({block:e,selected:n=!1,issues:s=[],onRemove:o}){return(0,t.jsxs)("div",{"data-testid":`block-card-${e.id}`,style:{width:k,minWidth:220,minHeight:v,display:"flex",flexDirection:"column",justifyContent:"center",gap:10,background:"transparent",border:`1px dashed ${n?i.f.running:i.f.skipped}`,borderRadius:14,padding:"15px 16px",fontSize:13,opacity:e.enabled?.8:.55},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,t.jsx)(a.f,{kind:e.kind,colour:i.f.skipped}),(0,t.jsx)("strong",{className:"factory-display",style:{fontSize:20,fontWeight:700,letterSpacing:"0",color:"#8b95a8"},children:e.label}),(0,t.jsxs)("span",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:6},children:[!e.enabled&&(0,t.jsx)("span",{style:{color:i.f.skipped,fontSize:12},children:r.B.editing.disabledBadge}),(0,t.jsx)("span",{style:{...B,fontSize:10,color:i.f.skipped},children:r.B.canvas.notInRun}),o&&(0,t.jsx)(A,{label:e.label,onRemove:o})]})]}),(0,t.jsx)("p",{style:{margin:0,color:i.f.skipped,fontSize:14,lineHeight:1.36},children:r.B.canvas.notInRunDetail}),s.map(e=>(0,t.jsx)("p",{style:{margin:0,fontSize:12.5,color:"#ffb4ac",background:i.f.tint("failed",.09),border:`1px solid ${i.f.tint("failed",.28)}`,borderRadius:8,padding:"7px 9px"},children:e},e))]})}let R={queued:"·",running:"▸",waiting_approval:"!",passed:"✓",failed:"✕",cancelled:"·",skipped:"·",blocked:"!"};function L({block:e,view:n,selected:s=!1}){let o=n?b[n.state]:"skipped",l=i.f[o],d=n?.notBuilt?r.B.canvas.notBuilt:n?.stateWord??(n?r.B.canvas.stateLabel[n.state]:r.B.canvas.notInRun),p=n?.notBuilt===!0;return(0,t.jsxs)("div",{"data-testid":`block-card-${e.id}`,title:`${e.label} — ${d}`,style:{position:"relative",width:w,minHeight:v,display:"flex",flexDirection:"column-reverse",alignItems:"center",gap:12,padding:"14px 0 16px",background:"linear-gradient(180deg, #141a24, #10151d)",borderStyle:p?"dashed":"solid",borderWidth:1,borderTopWidth:3,borderTopColor:l,borderRightColor:s?i.f.running:i.f.border,borderBottomColor:s?i.f.running:i.f.border,borderLeftColor:s?i.f.running:i.f.border,borderRadius:12,cursor:"pointer",opacity:e.enabled?p?.6:1:.55},children:[(0,t.jsx)(a.f,{kind:e.kind,colour:l,size:26}),(0,t.jsx)("span",{className:"factory-display",style:{writingMode:"vertical-rl",transform:"rotate(180deg)",fontSize:18,fontWeight:600,letterSpacing:"0.05em",color:"#c3cbd8",whiteSpace:"nowrap"},children:e.label}),n?.state==="running"&&(0,t.jsx)(M,{blockId:e.id,size:18}),(0,t.jsx)("span",{"aria-label":r.B.canvas.stateAria(d),style:{marginBottom:"auto",width:22,height:22,borderRadius:"50%",display:"grid",placeItems:"center",background:n&&!p?l:"transparent",border:n&&!p?"none":`1px dashed ${i.f.skipped}`,color:n&&!p?"#07090d":i.f.skipped,fontSize:11,fontWeight:800,lineHeight:1},children:n&&!p?R[n.state]:"·"})]})}function T({evidence:e}){var n;let s=e.counts,o=e.changedTestFiles??[],a=e.changedTestFilesCount??o.length,l=0===a&&null!==e.changedTestFiles;return(0,t.jsxs)("div",{"data-testid":"evidence-strip",style:{marginTop:12,background:"rgba(124, 160, 255, 0.045)",border:`1px solid ${i.f.lineSoft}`,borderRadius:10,padding:"9px 11px 10px"},children:[(0,t.jsxs)("div",{style:{...B,fontSize:9.5,letterSpacing:"0.14em",color:"#7d8798",display:"flex",alignItems:"center",gap:6,marginBottom:8},children:[(0,t.jsx)("span",{"aria-hidden":"true",style:{color:l?i.f.passed:i.f.waiting},children:l?"✓":"!"}),r.B.canvas.evidence]}),a>0&&(0,t.jsxs)("div",{"data-testid":"tests-changed",role:"note",style:{fontSize:12,color:i.f.waiting,margin:"0 0 8px",lineHeight:1.4},children:[r.B.canvas.testsChanged(a)," ",(0,t.jsxs)("span",{style:{fontFamily:S,fontSize:11.5,color:"#e7dcc4"},children:[o.slice(0,3).join(", "),a>3?` ${r.B.canvas.andMore(a-3)}`:""]})]}),null===e.changedTestFiles&&(0,t.jsx)("div",{"data-testid":"tests-unchecked",style:{fontSize:12,color:i.f.skipped,margin:"0 0 8px"},children:r.B.canvas.testsUnchecked}),s&&s.total>0&&(0,t.jsxs)("div",{role:"img","aria-label":r.B.canvas.evidenceCounts(s.passed,s.failed,s.total),style:{display:"flex",alignItems:"center",gap:3,marginBottom:8},children:[s.total<=30?Array.from({length:s.total},(e,n)=>(0,t.jsx)("span",{"data-pip":n<s.passed?"passed":n<s.passed+s.failed?"failed":"other",style:{width:7,height:13,borderRadius:2,flex:"0 0 auto",background:n<s.passed?i.f.passed:n<s.passed+s.failed?i.f.failed:"#30394a"}},n)):(0,t.jsxs)("span",{style:{display:"flex",flex:1,height:8,borderRadius:4,overflow:"hidden",background:"#30394a"},children:[(0,t.jsx)("span",{style:{width:`${s.passed/s.total*100}%`,background:i.f.passed}}),(0,t.jsx)("span",{style:{width:`${s.failed/s.total*100}%`,background:i.f.failed}})]}),(0,t.jsx)("span",{style:{fontFamily:S,fontSize:11.5,color:i.f.dim,marginLeft:7,fontWeight:600},children:r.B.canvas.evidenceCounts(s.passed,s.failed,s.total)})]}),(0,t.jsxs)("dl",{style:{display:"flex",flexWrap:"wrap",gap:"3px 14px",margin:0,fontFamily:S,fontSize:11.5,color:i.f.dim},children:[(0,t.jsxs)("span",{children:[(0,t.jsxs)("dt",{style:{display:"inline"},children:[r.B.canvas.exitCode," "]}),(0,t.jsx)("dd",{style:{display:"inline",margin:0,color:0===e.exitCode?i.f.passed:i.f.failed,fontWeight:600},children:null!==e.exitCode?e.exitCode:e.signal?e.signal:r.B.canvas.notReported})]}),(0,t.jsxs)("span",{children:[(0,t.jsxs)("dt",{style:{display:"inline"},children:[r.B.canvas.took," "]}),(0,t.jsx)("dd",{style:{display:"inline",margin:0,color:"#d6dce6",fontWeight:600},children:(n=e.durationMs)<1e3?`${n}ms`:n<6e4?`${(n/1e3).toFixed(1)}s`:`${Math.floor(n/6e4)}m ${Math.round(n%6e4/1e3)}s`})]})]})]})}function M({blockId:e,size:n=20}){return(0,t.jsxs)("svg",{"aria-hidden":"true","data-testid":`spinner-${e}`,className:"factory-spinner",viewBox:"0 0 20 20",width:n,height:n,style:{display:"block"},children:[(0,t.jsx)("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:i.f.tint("passed",.25),strokeWidth:"2.5"}),(0,t.jsx)("path",{d:"M10 2a8 8 0 0 1 8 8",fill:"none",stroke:i.f.passed,strokeWidth:"2.5",strokeLinecap:"round"})]})}function H({risk:e}){let n="low"===e.level,s=n?i.f.passed:i.f.waiting;return(0,t.jsxs)("div",{"data-testid":"risk-strip","data-level":e.level,style:{marginTop:12,background:i.f.tint(n?"passed":"waiting",.06),border:`1px solid ${i.f.tint(n?"passed":"waiting",.3)}`,borderRadius:10,padding:"9px 11px 10px"},children:[(0,t.jsx)("div",{style:{...B,fontSize:9.5,letterSpacing:"0.14em",color:s,marginBottom:6},children:r.B.risk.label[e.level]}),(0,t.jsx)("ul",{style:{margin:0,paddingLeft:16,display:"grid",gap:3,fontSize:12.5,color:"#d6dce6",lineHeight:1.4},children:e.reasons.slice(0,4).map(e=>(0,t.jsx)("li",{children:(0,o.f)((0,r.g)(e))},e))}),e.reasons.length>4&&(0,t.jsx)("div",{style:{fontSize:12,color:i.f.dim,marginTop:4},children:r.B.canvas.andMore(e.reasons.length-4)})]})}function A({label:e,onRemove:n}){return(0,t.jsx)("button",{type:"button",className:"nodrag","aria-label":r.B.editing.removeNamed(e),title:r.B.editing.removeNamed(e),onClick:e=>{e.stopPropagation(),n()},style:{display:"grid",placeItems:"center",width:26,height:26,padding:0,background:"none",border:`1px solid ${i.f.border}`,borderRadius:6,color:i.f.dim,cursor:"pointer"},children:(0,t.jsx)("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M2.5 4h11M6.5 4V2.5h3V4M4 4l.7 9.5h6.6L12 4M6.8 6.5v5M9.2 6.5v5"})})})}},76871,e=>{"use strict";e.s(["R",()=>p,"h",()=>g,"O",()=>d]);var t=e.i(43476),n=e.i(71645),i=e.i(5929),r=e.i(30904),s=e.i(8219),o=e.i(85402),a=e.i(21069);let l={completed:o.f.passed,failed:o.f.failed,cancelled:o.f.skipped,waiting_approval:o.f.waiting,running:o.f.running,queued:o.f.skipped};function d(e,t=Date.now()){let n=Math.round((t-Date.parse(e))/6e4);if(n<1)return r.B.history.justNow;if(n<60)return r.B.history.minutesAgo(n);let i=Math.round(n/60);return i<24?r.B.history.hoursAgo(i):i<48?r.B.history.yesterday:new Date(e).toLocaleDateString()}function p({workflowId:e,currentRunId:h,publishing:x=!1,refreshKey:b,onOpen:y,onDeleted:m,onCount:j,onWaiting:k}){let[v,w]=(0,n.useState)(null),[S,B]=(0,n.useState)(null),[$,I]=(0,n.useState)(null),[C,z]=(0,n.useState)(null),[W,R]=(0,n.useState)(null),[L,T]=(0,n.useState)(null),[M,H]=(0,n.useState)(0);async function A(e){z(null),I(e);try{let t=await fetch(`/api/runs/${e}`,{method:"DELETE"});if(!t.ok){let e=await t.json().catch(()=>null);return z(e?.error??r.B.history.couldNotDelete)}w(t=>(t??[]).filter(t=>t.runId!==e)),B(null),m?.(e)}catch{z(r.B.history.couldNotDelete)}finally{I(null)}}async function P(e,t){z(null),R({runId:e,what:t});try{let n=await fetch(`/api/runs/${e}/ship`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:t})});if(!n.ok){let e=await n.json().catch(()=>null);z(e?.error??r.B.history.actionFailed)}}catch{z(r.B.history.actionFailed)}finally{R(null),T(null),H(e=>e+1)}}(0,n.useEffect)(()=>{let e=setInterval(()=>H(e=>e+1),6e3);return()=>clearInterval(e)},[]),(0,n.useEffect)(()=>{let t=!0;return fetch(`/api/workflows/${e}/runs`).then(e=>e.ok?e.json():null).then(e=>t&&e&&w(e.runs)).catch(()=>void 0),()=>{t=!1}},[e,b,M]);let F=v?.length??null;(0,n.useEffect)(()=>{null!==F&&j?.(F)},[F]);let N=v?.filter(e=>"waiting_approval"===e.status).length??null;if((0,n.useEffect)(()=>{null!==N&&k?.(N)},[N]),null===v)return null;if(0===v.length)return(0,t.jsx)("p",{style:{margin:0,fontSize:13,color:s.f.faint},children:c.empty});let E=v.filter(u),q=v.filter(e=>!u(e)),O=e=>{let n=e.runId===h,p=e.status in r.B.run.status?e.status:"queued",b=u(e),m=W?.runId===e.runId,j="running"===p||"queued"===p,k=e.onHold?{text:c.onHold,colour:s.f.quiet,id:`on-hold-${e.runId}`}:"published"===e.next&&x&&e.runId===h?{text:c.publishing,colour:o.f.running,id:`next-${e.runId}`,spin:!0}:e.next?{text:c.next[e.next],colour:"conflict"===e.next?o.f.failed:s.f.green,id:`next-${e.runId}`}:"waiting_approval"===p?{text:c.waitingForYou,colour:s.f.green,id:`next-${e.runId}`}:j?{text:c.pill.working,colour:o.f.running,id:`state-${e.runId}`,spin:!0}:{text:r.B.run.status[p],colour:l[p]??s.f.quiet,id:`state-${e.runId}`},v=[e.onHold?c.pill.youHeld:null,!e.onHold&&"waiting_approval"===p?e.why:null].filter(e=>!!e);return(0,t.jsxs)("li",{style:{position:"relative",borderRadius:14,border:`1px solid ${S===e.runId?o.f.tint("failed",.6):b||n?s.f.green:s.f.line}`,background:n?"#242424":s.f.card,boxShadow:n?`inset 4px 0 0 ${s.f.green}`:void 0,color:s.f.text},children:[(0,t.jsx)("button",{type:"button","aria-label":c.delete(e.request),title:c.delete(e.request),onClick:()=>B(t=>t===e.runId?null:e.runId),className:"factory-delete",style:{position:"absolute",right:10,top:10,width:30,height:30,display:"grid",placeItems:"center",padding:0,borderRadius:8,background:S===e.runId?o.f.tint("failed",.18):"transparent",border:"1px solid transparent",color:S===e.runId?o.f.failed:s.f.faint,cursor:"pointer"},children:(0,t.jsx)("svg",{viewBox:"0 0 16 16",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M2.5 4h11M6.5 4V2.5h3V4M4 4l.7 9.5h6.6L12 4M6.8 6.5v5M9.2 6.5v5"})})}),(0,t.jsxs)("button",{type:"button","data-testid":`past-task-${e.runId}`,"aria-current":n?"true":void 0,onClick:()=>y(e.runId),style:{width:"100%",textAlign:"left",display:"grid",gap:8,padding:"14px 46px 14px 16px",background:"transparent",border:"none",borderRadius:14,color:"inherit",font:"inherit",cursor:"pointer"},children:[e.title&&(0,t.jsxs)("span",{"data-testid":`task-name-${e.runId}`,style:{fontSize:15,fontWeight:700,lineHeight:1.3,letterSpacing:"-0.01em",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[e.parentRunId?"↺ ":"",e.title]}),(0,t.jsxs)("span",{style:{fontSize:e.title?13:14,lineHeight:1.45,color:e.title?s.f.quiet:s.f.text,overflow:"hidden",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:[!e.title&&e.parentRunId?"↺ ":"",e.request]}),j&&e.progress&&(0,t.jsxs)("span",{"data-testid":`progress-${e.runId}`,style:{display:"grid",gap:6},children:[(0,t.jsx)("span",{"aria-hidden":"true",style:{display:"flex",gap:4},children:Array.from({length:e.progress.of},(n,i)=>(0,t.jsx)("span",{style:{flex:1,height:4,borderRadius:2,background:i+1<e.progress.step?s.f.green:i+1===e.progress.step?"#9a9a9a":s.f.line}},i))}),(0,t.jsx)("span",{style:{fontFamily:s.f.mono,fontSize:11.5,color:s.f.quiet},children:c.stepOf(e.progress.step,e.progress.of,e.progress.name)})]}),(0,t.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"4px 8px",fontSize:12,color:s.f.quiet},children:[(0,t.jsxs)("span",{"data-testid":k.id,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"3px 10px",borderRadius:999,background:"#222222",color:k.colour,fontWeight:700},children:[e.onHold?(0,t.jsx)(g,{}):k.spin?(0,t.jsx)(a.m,{blockId:`pill-${e.runId}`,size:12}):(0,t.jsx)("span",{"aria-hidden":"true",style:{width:7,height:7,flex:"none",borderRadius:"50%",background:k.colour}}),k.text]}),(0,t.jsx)("span",{children:d(e.createdAt)}),v.map(e=>(0,t.jsxs)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["· ",e]},e)),e.passedOnItsOwn&&(0,t.jsxs)("span",{"data-testid":`on-its-own-${e.runId}`,children:["· ",c.wentOnItsOwn]}),e.providerId===i.C&&(0,t.jsxs)("span",{style:{color:o.f.waiting},children:["· ",c.demo]})]})]}),S!==e.runId&&(e.onHold||b)&&!(n&&("plan"===e.next||"check"===e.next||"conflict"===e.next))&&(0,t.jsx)("div",{"data-testid":`task-action-${e.runId}`,style:{display:"grid",gap:8,margin:"0 16px",padding:"12px 0 14px",borderTop:`1px solid ${s.f.line}`,fontSize:12.5,lineHeight:1.45,color:s.f.quiet},children:e.onHold?(0,t.jsxs)("button",{type:"button",disabled:null!==W,onClick:()=>void P(e.runId,"unhold"),style:f(!1),children:[m&&(0,t.jsx)(a.m,{blockId:`resume-${e.runId}`,size:12}),c.resume]}):L===e.runId?(0,t.jsxs)("div",{role:"group","aria-label":c.confirmPublish,style:{display:"grid",gap:8},children:[c.confirmPublish,(0,t.jsxs)("span",{style:{display:"flex",gap:8},children:[(0,t.jsxs)("button",{type:"button",disabled:null!==W,onClick:()=>void P(e.runId,"merge"),style:f(!0),children:[m&&(0,t.jsx)(a.m,{blockId:`publish-${e.runId}`,size:12}),m?c.publishing:c.yesPublish]}),(0,t.jsx)("button",{type:"button",disabled:null!==W,onClick:()=>T(null),style:f(!1),children:c.noPublish})]})]}):"publish"===e.next?(0,t.jsxs)("span",{style:{display:"flex",gap:8},children:[(0,t.jsx)("button",{type:"button",disabled:null!==W,onClick:()=>T(e.runId),style:f(!0),children:c.publishIt}),(0,t.jsxs)("button",{type:"button",disabled:null!==W,onClick:()=>void P(e.runId,"hold"),style:f(!1),children:[m&&(0,t.jsx)(a.m,{blockId:`hold-${e.runId}`,size:12}),c.holdIt]})]}):"send"===e.next?(0,t.jsxs)("button",{type:"button",disabled:null!==W,onClick:()=>void P(e.runId,"open"),style:f(!0),children:[m&&(0,t.jsx)(a.m,{blockId:`send-${e.runId}`,size:12}),m?c.sending:c.sendIt]}):(0,t.jsx)("button",{type:"button",onClick:()=>y(e.runId),style:f(!0),children:c.openIt})}),S===e.runId&&(0,t.jsxs)("div",{role:"group","aria-label":c.confirm,style:{display:"grid",gap:8,margin:"0 16px",padding:"12px 0 14px",borderTop:`1px solid ${o.f.tint("failed",.3)}`,fontSize:12.5,lineHeight:1.45},children:[c.confirm,(0,t.jsxs)("span",{style:{display:"flex",gap:8},children:[(0,t.jsxs)("button",{type:"button",disabled:null!==$,onClick:()=>void A(e.runId),style:{...f(!1),borderColor:o.f.failed,background:o.f.tint("failed",.16),color:"#fecaca"},children:[$===e.runId&&(0,t.jsx)(a.m,{blockId:`delete-${e.runId}`,size:12}),$===e.runId?c.deleting:c.yes]}),(0,t.jsx)("button",{type:"button",disabled:null!==$,onClick:()=>B(null),style:f(!1),children:c.no})]})]})]},e.runId)},D={listStyle:"none",margin:0,padding:0,display:"grid",gap:10};return(0,t.jsxs)("div",{style:{display:"grid",gap:14,fontFamily:s.f.sans},children:[C&&(0,t.jsx)("p",{role:"alert",style:{margin:0,fontSize:12.5,color:o.f.failed},children:C}),E.length>0&&(0,t.jsxs)("section",{"aria-label":c.needsYou,style:{display:"grid",gap:10},children:[(0,t.jsx)("h3",{style:{margin:0,fontFamily:s.f.mono,fontSize:11.5,fontWeight:500,letterSpacing:"0.2em",textTransform:"uppercase",color:s.f.green},children:c.needsYou}),(0,t.jsx)("ul",{style:D,children:E.map(O)})]}),q.length>0&&(0,t.jsx)("ul",{style:D,children:q.map(O)})]})}let c=r.B.history;function u(e){return!e.onHold&&"published"!==e.next&&("waiting_approval"===e.status||null!==e.next&&void 0!==e.next)}function f(e){return{flex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6,padding:"9px 12px",borderRadius:9,border:`1px solid ${e?s.f.green:s.f.line}`,background:e?s.f.green:s.f.bg,color:e?s.f.onGreen:s.f.text,fontSize:13,fontWeight:700,cursor:"pointer"}}function g({size:e=10}){return(0,t.jsxs)("svg",{viewBox:"0 0 16 16",width:e,height:e,fill:"currentColor","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"3.5",y:"2.5",width:"3",height:"11",rx:"1"}),(0,t.jsx)("rect",{x:"9.5",y:"2.5",width:"3",height:"11",rx:"1"})]})}},85402,44094,34910,53148,e=>{"use strict";e.s(["v",()=>b,"$",()=>x,"R",()=>m,"h",()=>u,"w",()=>y,"C",()=>g],53148);let t={running:"59, 130, 246",passed:"121, 220, 139",failed:"239, 68, 68",waiting:"245, 158, 11",skipped:"107, 114, 128"},n={bg:"#0b0e14",card:"#151a23",border:"#262d3a",running:"#3b82f6",passed:"#79dc8b",failed:"#ef4444",waiting:"#f59e0b",skipped:"#6b7280",floorLine:"#2a3548",pointer:"#e5e7eb",cardFace:"linear-gradient(180deg, #1a2230 0%, #141a24 62%)",lineSoft:"rgba(255, 255, 255, 0.055)",ink:"#eef1f6",dim:"#9aa5b6",elevation(e){let t=[0,6,14][e]??0;return 0===e?"none":`0 ${t}px ${2*t}px rgba(0, 0, 0, 0.45)`},ambient:"radial-gradient(ellipse at 30% 40%, rgba(59, 130, 246, 0.10), transparent 55%), radial-gradient(ellipse at 75% 65%, rgba(245, 158, 11, 0.06), transparent 50%)",glow(e){let n=t[e];return`0 0 0 1px rgba(${n}, 0.6), 0 0 26px rgba(${n}, 0.28), 0 14px 28px rgba(0, 0, 0, 0.45)`},tint:(e,n)=>`rgba(${t[e]}, ${n})`};e.s(["f",0,n],85402);var i=e.i(30904);let r=e=>e.length>80?`${e.slice(0,79).trimEnd()}…`:e,s=/(\b(?:[Tt]he\s+)?(?:[Aa]greed\s+|[Ee]arlier\s+)?(?:[Dd]ecision|[Rr]ule|[Cc]ore area|[Ee]ntry)\s+)?\bD-(\d+)\b/g;e.s(["f",0,function(e,t=[]){return e.replace(s,(n,s,o,a)=>{var l;let d=(l=t.find(e=>e.number===Number(o)))?"core"===l.kind?i.B.question.entryAs.core(l.paths&&l.paths.length>0?l.paths.join(", "):`“${r(l.text)}”`):"rule"===l.kind?i.B.question.entryAs.rule(r(l.text)):i.B.question.entryAs.decision(r(l.text)):i.B.question.earlierDecision;return/[A-Z]/.test(s?.[0]??"")||!s&&/(^|[.!?]\s+)$/.test(e.slice(0,a))?`${d[0].toUpperCase()}${d.slice(1)}`:d})}],44094);var o=e.i(43476);let a={input:(0,o.jsx)("path",{d:"M2 8h8M7 5l3 3-3 3M12 2v12"}),plan:(0,o.jsx)("path",{d:"M3 4h10M3 8h10M3 12h6"}),build:(0,o.jsx)("path",{d:"M2.5 5.5l3-3 8 8-3 3zM9 3l1.5-1.5 3.5 3.5L12.5 6.5"}),tests:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("rect",{x:"1.5",y:"1.5",width:"13",height:"13",rx:"3"}),(0,o.jsx)("path",{d:"M3 8l2.5 2.5L9 6"})]}),review:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("circle",{cx:"7",cy:"7",r:"4.5"}),(0,o.jsx)("path",{d:"M10.5 10.5L14 14"})]}),approve:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("circle",{cx:"8",cy:"8",r:"6.5"}),(0,o.jsx)("path",{d:"M5 8.2l2.2 2.2L11 6.4"})]}),human:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("circle",{cx:"8",cy:"5",r:"2.6"}),(0,o.jsx)("path",{d:"M3 14c0-2.8 2.2-4.6 5-4.6s5 1.8 5 4.6"})]}),ship:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("path",{d:"M8 13V3M8 3l4 4M8 3L4 7"}),(0,o.jsx)("path",{d:"M2.5 13.5h11"})]})};e.s(["f",0,function({kind:e,colour:t,size:n=28}){let i=Math.round(.54*n);return(0,o.jsx)("span",{"aria-hidden":"true","data-testid":`type-mark-${e}`,style:{width:n,height:n,flex:"0 0 auto",borderRadius:Math.round(.29*n),display:"grid",placeItems:"center",background:`color-mix(in srgb, ${t} 13%, transparent)`,border:`1px solid color-mix(in srgb, ${t} 28%, transparent)`,color:t},children:(0,o.jsx)("svg",{viewBox:"0 0 16 16",width:i,height:i,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:a[e]})})}],34910);var l=e.i(71645),d=e.i(74080),p=e.i(21069);let c=(e,t,n,i)=>`/api/runs/${e}/snapshots/${t}?v=${encodeURIComponent(n)}${i?`&c=${i}`:""}`,u=(e,t,n)=>c(e,t,n.taken??`${n.route??""}-${n.shots.join(",")}`);function f({style:e,newProject:t}){return(0,o.jsx)("div",{"data-testid":t?"before-new-project":void 0,style:{...e,border:`1px dashed ${n.border}`,display:"grid",placeItems:"center",padding:8,boxSizing:"border-box",textAlign:"center",color:n.dim,fontSize:12,lineHeight:1.35},children:t?i.B.snapshots.newProject:null})}function g(e,t,n=!1,r){let[s,o]=(0,l.useState)(null),[a,d]=(0,l.useState)(null),p=(0,l.useRef)(!1),c=(0,l.useCallback)(()=>{fetch(`/api/runs/${e}/snapshots${r?`?change=${r}`:""}`).then(e=>e.ok?e.json():null).then(e=>e&&Array.isArray(e.shots)&&o(e)).catch(()=>void 0)},[e,r]),u=(0,l.useCallback)(async()=>{d(null);try{let t=await fetch(`/api/runs/${e}/snapshots`,{method:"POST"}),n=await t.json().catch(()=>null);if(!t.ok||!n||!Array.isArray(n.shots))return d(n?.error??i.B.snapshots.failed(""));o(n)}catch{d(i.B.snapshots.failed(""))}},[e]);return(0,l.useEffect)(()=>{p.current=!1,c()},[c]),(0,l.useEffect)(()=>{t&&s?.status==="none"&&!p.current&&(p.current=!0,u())},[t,s?.status,u]),(0,l.useEffect)(()=>{if(s?.status!=="working"&&!(n&&s?.status==="none"))return;let e=setInterval(c,3e3);return()=>clearInterval(e)},[s?.status,n,c]),{state:s,error:a,take:u}}function h(e,t,n){let[i,r]=(0,l.useState)([]);return(0,l.useEffect)(()=>{if(n)return;let t=!0;return fetch(`/api/runs/${e}/snapshots?versions=1`).then(e=>e.ok?e.json():null).then(e=>t&&Array.isArray(e?.versions)&&r(e.versions)).catch(()=>void 0),()=>{t=!1}},[e,t,n]),i}function x({runId:e,autoStart:t}){return g(e,t),null}function b({runId:e,autoStart:t=!1,compact:r=!1,canTake:s=!0,change:a}){let{state:d,error:u,take:x}=g(e,t&&!a,!a,a),[y,m]=(0,l.useState)(!1),v=(0,l.useCallback)(()=>m(!1),[]),w=h(e,d?.taken,void 0!==a||d?.status!=="ready"),S=w.length>1;if(!d||"unneeded"===d.status||a&&"ready"!==d.status)return null;let B=d.taken??`${d.route??""}-${d.shots.join(",")}`,$={fontSize:11.5,color:n.dim,lineHeight:1.4};return(0,o.jsxs)("div",{"data-testid":"before-after",onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),style:{display:"grid",gap:6,marginTop:10*!!r,padding:10,borderRadius:10,border:`1px solid ${n.border}`,background:"#0d1118"},children:[(0,o.jsx)("div",{style:{fontSize:10.5,fontWeight:800,letterSpacing:"0.12em",textTransform:"uppercase",color:n.dim},children:i.B.snapshots.title}),"none"===d.status&&!u&&s&&(0,o.jsxs)("button",{type:"button",onClick:()=>void x(),style:{justifySelf:"start",display:"inline-flex",alignItems:"center",gap:6,padding:0,background:"none",border:"none",color:"#93c5fd",fontSize:12.5,fontWeight:600,cursor:"pointer"},children:[(0,o.jsx)(k,{})," ",i.B.snapshots.take]}),"working"===d.status&&(0,o.jsxs)("div",{style:{...$,display:"flex",gap:6,alignItems:"center"},children:[(0,o.jsx)(p.m,{blockId:`snap-${e}`,size:13})," ",d.message]}),"ready"===d.status&&(0,o.jsx)("button",{type:"button","aria-label":i.B.snapshots.open,onClick:()=>m(!0),style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:6,padding:0,background:"none",border:"none",cursor:"zoom-in",color:"inherit"},children:["before-desktop","after-desktop"].map(t=>(0,o.jsxs)("figure",{style:{margin:0,display:"grid",gap:3},children:[d.shots.includes(t)?(0,o.jsx)("img",{src:c(e,t,B,a),alt:t.startsWith("before")?i.B.snapshots.before:i.B.snapshots.after,style:{width:"100%",aspectRatio:"16 / 10",objectFit:"cover",objectPosition:"top",borderRadius:6,border:`1px solid ${n.border}`}}):(0,o.jsx)(f,{style:{aspectRatio:"16 / 10",borderRadius:6},newProject:t.startsWith("before")&&!0===d.newProject}),(0,o.jsx)("figcaption",{style:{fontSize:11,fontWeight:700,color:t.startsWith("before")?n.dim:n.passed,textAlign:"left"},children:t.startsWith("before")?i.B.snapshots.before:i.B.snapshots.after})]},t))}),"ready"===d.status&&(0,o.jsxs)("button",{type:"button",onClick:()=>m(!0),style:{justifySelf:"start",display:"inline-flex",alignItems:"center",gap:6,padding:0,background:"none",border:"none",color:"#93c5fd",fontSize:12.5,fontWeight:600,cursor:"pointer"},children:[(0,o.jsx)(k,{})," ",S?i.B.snapshots.openAll(w.length):i.B.snapshots.open]}),("failed"===d.status||u)&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{role:"alert",style:{...$,color:n.waiting},children:u??d.message}),(0,o.jsx)("button",{type:"button",onClick:()=>void x(),style:{justifySelf:"start",padding:0,background:"none",border:"none",color:"#93c5fd",fontSize:12,fontWeight:600,cursor:"pointer"},children:i.B.snapshots.retry})]}),y&&"ready"===d.status&&(0,o.jsx)(j,{runId:e,state:d,at:B,change:a,versions:S?w:[],onClose:v})]})}function y(e){let{state:t}=g(e,!1),n=h(e,t?.taken,t?.status!=="ready");return{state:t,versions:t?.status==="ready"&&n.length>1?n:[]}}function m({runId:e,state:t,versions:r,index:s}){let[a,d]=(0,l.useState)(!1),p=(0,l.useCallback)(()=>d(!1),[]),u=r[s];if(!u)return null;let g=r[s-1],h=g?g.shots.includes("after-desktop")?c(e,"after-desktop",g.taken,g.change):null:u.shots.includes("before-desktop")?c(e,"before-desktop",u.taken,u.change):null,x=u.shots.includes("after-desktop")?c(e,"after-desktop",u.taken,u.change):null,b=(e,t,i)=>(0,o.jsxs)("span",{style:{display:"grid",gap:4,justifyItems:"start"},children:[(0,o.jsx)("span",{style:{fontSize:11,fontWeight:800,letterSpacing:"0.08em",textTransform:"uppercase",color:i?n.passed:n.dim},children:t}),e?(0,o.jsx)("img",{src:e,alt:"",style:{display:"block",width:"min(170px, 34vw)",aspectRatio:"25 / 16",objectFit:"cover",objectPosition:"top",borderRadius:8,border:`1px solid ${i?n.tint("passed",.5):n.border}`}}):(0,o.jsx)(f,{style:{width:"min(170px, 34vw)",aspectRatio:"25 / 16",borderRadius:8},newProject:!i&&!g&&!0===u.newProject})]});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("button",{type:"button","data-testid":"version-pictures","aria-label":i.B.snapshots.openAll(r.length),onClick:()=>d(!0),style:{display:"flex",alignItems:"end",gap:8,padding:0,border:"none",background:"none",cursor:"zoom-in",justifySelf:"start",color:"inherit"},children:[b(h,i.B.snapshots.before,!1),(0,o.jsx)("span",{"aria-hidden":"true",style:{alignSelf:"center",color:n.dim,fontSize:16,paddingTop:14},children:"→"}),b(x,i.B.snapshots.after,!0)]}),a&&(0,o.jsx)(j,{runId:e,state:t,at:t.taken??"",versions:r,onClose:p})]})}function j({runId:e,state:t,at:r,change:s,versions:a,onClose:p}){let[u,g]=(0,l.useState)("desktop"),h=(0,l.useRef)(null);(0,l.useEffect)(()=>{h.current?.focus();let e=e=>{"Escape"===e.key&&p()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[p]);let x=e=>({padding:"5px 12px",borderRadius:999,border:`1px solid ${u===e?n.running:n.border}`,background:u===e?n.tint("running",.18):"transparent",color:u===e?"#cfe0ff":n.dim,fontSize:12.5,fontWeight:700,cursor:"pointer"}),b="desktop"===u?i.B.snapshots.desktop:i.B.snapshots.mobile,y=(e,t,i,r,s=!1)=>[["before",e,i],["after",t,r]].map(([e,t,i])=>(0,o.jsxs)("figure",{style:{margin:0,display:"grid",gap:8,justifyItems:"center"},children:[(0,o.jsx)("figcaption",{style:{justifySelf:"start",fontSize:13,fontWeight:800,letterSpacing:"0.08em",textTransform:"uppercase",color:"before"===e?n.dim:n.passed},children:i}),t?(0,o.jsx)("img",{src:t,alt:`${i} \xb7 ${b}`,style:{width:"desktop"===u?"100%":"min(100%, 390px)",borderRadius:8,border:`1px solid ${"before"===e?n.border:n.tint("passed",.5)}`}}):(0,o.jsx)(f,{style:{width:"100%",aspectRatio:"16 / 10",borderRadius:8},newProject:"before"===e&&s})]},e));return(0,d.createPortal)((0,o.jsx)("div",{"data-testid":"before-after-modal",onClick:p,style:{position:"fixed",inset:0,zIndex:120,background:"rgba(5, 7, 11, 0.75)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",placeItems:"center",padding:24},children:(0,o.jsxs)("div",{ref:h,role:"dialog","aria-modal":"true","aria-label":i.B.snapshots.beforeAfter,tabIndex:-1,onClick:e=>e.stopPropagation(),style:{width:"min(1400px, 100%)",height:"min(90vh, 100%)",display:"flex",flexDirection:"column",background:n.bg,border:`1px solid ${n.border}`,borderRadius:14,boxShadow:"0 30px 80px rgba(0,0,0,0.6)",outline:"none",color:"#e6e9ef"},children:[(0,o.jsxs)("header",{style:{display:"flex",alignItems:"center",gap:12,padding:"12px 16px",borderBottom:`1px solid ${n.border}`},children:[(0,o.jsxs)("div",{style:{display:"grid",gap:2,flex:1,minWidth:0},children:[(0,o.jsx)("div",{className:"factory-display",style:{fontSize:19},children:i.B.snapshots.beforeAfter}),(0,o.jsxs)("div",{style:{fontSize:12,color:n.dim},children:[t.route?`${i.B.snapshots.page(t.route,t.opened)} \xb7 `:"",i.B.snapshots.what]})]}),(0,o.jsxs)("div",{role:"group",style:{display:"flex",gap:6},children:[(0,o.jsx)("button",{type:"button","aria-pressed":"desktop"===u,onClick:()=>g("desktop"),style:x("desktop"),children:i.B.snapshots.desktop}),(0,o.jsx)("button",{type:"button","aria-pressed":"mobile"===u,onClick:()=>g("mobile"),style:x("mobile"),children:i.B.snapshots.mobile})]}),(0,o.jsx)("button",{type:"button","aria-label":i.B.snapshots.close,onClick:p,style:{background:"none",border:"none",color:n.skipped,cursor:"pointer",fontSize:18,lineHeight:1,padding:6},children:"✕"})]}),a.length>0?(0,o.jsx)("ol",{"data-testid":"before-after-versions",style:{flex:1,minHeight:0,overflow:"auto",margin:0,padding:16,listStyle:"none",display:"grid",gap:28,alignContent:"start",scrollbarWidth:"thin",scrollbarColor:`${n.floorLine} transparent`},children:a.map((t,r)=>{let s=a[r-1],l=s?{shot:`after-${u}`,of:s}:{shot:`before-${u}`,of:t};return(0,o.jsxs)("li",{"data-testid":"before-after-version",style:{display:"grid",gap:10},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,minWidth:0},children:[(0,o.jsx)("span",{style:{flex:"none",width:26,height:26,borderRadius:999,display:"grid",placeItems:"center",border:`2px solid ${n.passed}`,color:n.passed,fontSize:12.5,fontWeight:800,alignSelf:"center"},children:r+1}),(0,o.jsxs)("div",{style:{display:"grid",gap:2,minWidth:0},children:[(0,o.jsx)("span",{style:{fontSize:11,fontWeight:800,letterSpacing:"0.1em",textTransform:"uppercase",color:n.dim},children:0===r?i.B.snapshots.versionFirst:i.B.snapshots.versionNext}),(0,o.jsx)("span",{style:{fontSize:14.5,lineHeight:1.45,overflowWrap:"anywhere"},children:t.asked})]})]}),(0,o.jsx)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:16,alignItems:"start"},children:y(l.of.shots.includes(l.shot)?c(e,l.shot,l.of.taken,l.of.change):null,t.shots.includes(`after-${u}`)?c(e,`after-${u}`,t.taken,t.change):null,i.B.snapshots.versionBefore,i.B.snapshots.versionAfter,l.of===t&&!0===t.newProject)})]},t.change)})}):(0,o.jsx)("div",{style:{flex:1,minHeight:0,overflow:"auto",padding:16,display:"grid",gridTemplateColumns:"1fr 1fr",gap:16,alignItems:"start",scrollbarWidth:"thin",scrollbarColor:`${n.floorLine} transparent`},children:y(t.shots.includes(`before-${u}`)?c(e,`before-${u}`,r,s):null,t.shots.includes(`after-${u}`)?c(e,`after-${u}`,r,s):null,i.B.snapshots.before,i.B.snapshots.after,!0===t.newProject)})]})}),document.body)}function k(){return(0,o.jsxs)("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,o.jsx)("rect",{x:"1.5",y:"3",width:"5.5",height:"10",rx:"1"}),(0,o.jsx)("rect",{x:"9",y:"3",width:"5.5",height:"10",rx:"1"})]})}}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,21069,21347,e=>{"use strict";e.s(["J",()=>C,"c",()=>I,"l",()=>z,"G",()=>v,"X",()=>k,"v",()=>$,"e",()=>W,"K",()=>w,"u",()=>L,"m",()=>M,"Y",()=>y],21069),e.s(["U",()=>h,"B",()=>u,"O",()=>g],21347);var t=e.i(43476),n=e.i(71645),i=e.i(85402),r=e.i(30904),s=e.i(64425),o=e.i(44094),a=e.i(34910),l=e.i(53148),d=e.i(74080),p=e.i(76871);let c={request:i.f.running,followUp:i.f.running,memory:"#2dd4bf",replan:i.f.waiting,changes:i.f.waiting,reviewer:"#a78bfa",approvedNote:i.f.passed,rejectedNote:i.f.failed,answer:i.f.waiting},u=e=>e.earlier?"input":e.step??f[e.kind],f={request:"input",followUp:"input",memory:"input",replan:"plan",reviewer:"review",changes:"human",approvedNote:"human",rejectedNote:"human",answer:"plan"};function g(e,t){let[i,r]=(0,n.useState)(null);return(0,n.useEffect)(()=>{if(!e)return;let t=!0;return fetch(`/api/runs/${e}/prompts`).then(e=>e.ok?e.json():null).then(n=>t&&n&&r({runId:e,prompts:n.prompts})).catch(()=>void 0),()=>{t=!1}},[e,t]),i&&i.runId===e?i.prompts:[]}function h({prompts:e}){let[s,o]=(0,n.useState)(null);return 0===e.length?null:(0,t.jsxs)("div",{"data-testid":"asked-strip",className:"nodrag",onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),style:{display:"grid",gap:6,marginTop:10},children:[e.map((e,n)=>(0,t.jsxs)("button",{type:"button",onClick:()=>o(e),title:r.B.prompts.open,style:{textAlign:"left",display:"grid",gap:3,padding:"7px 9px",borderRadius:8,border:`1px solid ${i.f.border}`,borderLeft:`3px solid ${c[e.kind]}`,background:"#0d1118",color:"#d6dce6",cursor:"pointer",opacity:e.earlier?.75:1},children:[(0,t.jsxs)("span",{style:{display:"flex",justifyContent:"space-between",gap:6,fontSize:9.5,fontWeight:800,letterSpacing:"0.1em",textTransform:"uppercase",color:c[e.kind]},children:[(0,t.jsxs)("span",{children:[e.earlier?`${r.B.prompts.earlier} \xb7 `:"",r.B.prompts.kind[e.kind]]}),(0,t.jsx)("span",{style:{fontWeight:600,letterSpacing:0,textTransform:"none",color:i.f.dim},children:(0,p.O)(e.at)})]}),(0,t.jsx)("span",{style:{fontSize:12.5,lineHeight:1.4,overflow:"hidden",display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical"},children:e.text})]},`${e.at}-${n}`)),s&&(0,t.jsx)(x,{prompt:s,onClose:()=>o(null)})]})}function x({prompt:e,onClose:s}){let o=(0,n.useRef)(null);return(0,n.useEffect)(()=>{o.current?.focus();let e=e=>{"Escape"===e.key&&s()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[s]),(0,d.createPortal)((0,t.jsx)("div",{onClick:s,style:{position:"fixed",inset:0,zIndex:100,background:"rgba(5, 7, 11, 0.7)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",placeItems:"center",padding:24},children:(0,t.jsxs)("div",{ref:o,role:"dialog","aria-modal":"true","aria-label":r.B.prompts.kind[e.kind],tabIndex:-1,onClick:e=>e.stopPropagation(),style:{width:"min(680px, 100%)",maxHeight:"80vh",display:"flex",flexDirection:"column",background:i.f.bg,border:`1px solid ${i.f.border}`,borderTop:`3px solid ${c[e.kind]}`,borderRadius:14,boxShadow:"0 30px 80px rgba(0,0,0,0.6)",outline:"none",color:"#e6e9ef"},children:[(0,t.jsxs)("header",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,padding:"12px 16px",borderBottom:`1px solid ${i.f.border}`},children:[(0,t.jsxs)("div",{style:{fontSize:13,fontWeight:800,letterSpacing:"0.08em",textTransform:"uppercase",color:c[e.kind]},children:[r.B.prompts.kind[e.kind]," ",(0,t.jsxs)("span",{style:{fontWeight:600,letterSpacing:0,textTransform:"none",color:i.f.dim},children:["· ",new Date(e.at).toLocaleString()]})]}),(0,t.jsx)("button",{type:"button","aria-label":r.B.prompts.close,onClick:s,style:{background:"none",border:"none",color:i.f.skipped,cursor:"pointer",fontSize:18,lineHeight:1,padding:6},children:"✕"})]}),(0,t.jsx)("div",{style:{padding:16,overflowY:"auto",fontSize:14.5,lineHeight:1.55,whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:e.text})]})}),document.body)}let b={queued:"skipped",running:"running",waiting_approval:"waiting",passed:"passed",failed:"failed",cancelled:"skipped",skipped:"skipped",blocked:"failed"};function y(e){return b[e]}let m=new Set(["running","failed","waiting"]),j={passed:"✓",failed:"✕"},k=320,v=304,w=80,S="var(--font-mono), ui-monospace, SFMono-Regular, Menlo, monospace",B={fontSize:10,fontWeight:800,letterSpacing:"0.13em",textTransform:"uppercase"},$=(0,n.createContext)(e=>"string"==typeof e&&""!==e.trim()?e:null),I=(0,n.createContext)(()=>null);function C({ai:e,testId:n}){return(0,t.jsxs)("span",{"data-testid":n,title:r.B.editing.doneBy(e.name),style:{flex:"none",display:"inline-flex",alignItems:"center",gap:6,padding:"4px 9px",background:"rgba(255, 255, 255, 0.045)",border:`1px solid ${i.f.lineSoft}`,borderRadius:999,fontSize:11.5,fontWeight:600,color:i.f.dim,whiteSpace:"nowrap"},children:[(0,t.jsx)(s.f,{id:e.id,size:13}),e.short??e.name]})}function z({block:e,view:s,expanded:o=!1,selected:d=!1,issues:p=[],breadcrumb:c,onCollapse:u,onRemove:f,collapseLabel:g=r.B.canvas.collapse,width:x,failedActions:y,onDetails:w}){var W;let R=(0,n.useContext)($)(e.config.model,e.kind,e.config.ai),L=(0,n.useContext)(I)(e.config.ai,e.kind),P=b[s.state],F=i.f[P],N=s.notBuilt?r.B.canvas.notBuilt:s.turn?r.B.direct.yourTurn:s.asking&&"waiting_approval"===s.state?r.B.question.stateLabel:s.stateWord??r.B.canvas.stateLabel[s.state],E=s.steps??[],q=E.slice(-6),O=E.length-q.length,D=E[E.length-1],U=""!==s.summary.trim(),_=e.enabled&&U&&s.summaryIsClaim,V=j[s.state],Y=d?i.f.running:i.f.border;return(0,t.jsxs)("div",{"data-testid":`block-card-${e.id}`,style:{position:"relative",width:x??k,minWidth:220,minHeight:v,display:"flex",flexDirection:"column",background:i.f.cardFace,borderStyle:s.notBuilt?"dashed":"solid",borderWidth:1,borderTopColor:Y,borderRightColor:Y,borderBottomColor:Y,borderLeftWidth:4,borderLeftColor:F,borderRadius:14,padding:"running"===s.state?"15px 16px 44px":"15px 16px 13px",boxShadow:m.has(P)?i.f.glow(P):"none",fontSize:13,overflowWrap:"anywhere",opacity:e.enabled?s.notBuilt?.6:1:.55},children:[(0,t.jsx)("span",{"aria-hidden":"true",style:{position:"absolute",left:0,right:0,top:0,height:1,borderRadius:"14px 14px 0 0",background:"linear-gradient(90deg, transparent, rgba(255,255,255,0.09) 20%, rgba(255,255,255,0.09) 80%, transparent)"}}),"running"===s.state&&(0,t.jsx)("span",{style:{position:"absolute",left:14,bottom:12},children:(0,t.jsx)(M,{blockId:e.id})}),V&&(0,t.jsx)("span",{"aria-hidden":"true","data-testid":`corner-mark-${e.id}`,style:{position:"absolute",right:-9,top:-9,width:24,height:24,borderRadius:"50%",display:"grid",placeItems:"center",background:F,color:"#07090d",border:`2.5px solid ${i.f.bg}`,fontSize:12,fontWeight:800,lineHeight:1},children:V}),o&&(c&&c.length>0||u)&&(0,t.jsxs)("div",{className:"factory-unfold",style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[c&&c.length>0&&(0,t.jsx)("nav",{"data-testid":"breadcrumb","aria-label":r.B.canvas.breadcrumbAria,style:{minWidth:0,color:i.f.skipped,fontSize:12,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c.join(r.B.canvas.breadcrumbSeparator)}),u&&(0,t.jsx)("span",{style:{marginLeft:"auto",flex:"none"},children:(0,t.jsx)("button",{type:"button",className:"nodrag",onClick:e=>{e.stopPropagation(),u()},style:{background:"none",color:"inherit",border:`1px solid ${i.f.border}`,borderRadius:6,cursor:"pointer",fontSize:12,padding:"3px 8px",display:"inline-flex",alignItems:"center",gap:5,whiteSpace:"nowrap"},children:g})})]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,t.jsx)(a.f,{kind:e.kind,colour:F}),(0,t.jsx)("strong",{className:"factory-display",style:{minWidth:"min-content",overflowWrap:"normal",wordBreak:"normal",fontSize:20,fontWeight:700,letterSpacing:"0",lineHeight:1.1},children:e.label}),(0,t.jsxs)("span",{style:{marginLeft:"auto",flex:"0 1 auto",minWidth:0,display:"flex",alignItems:"center",gap:6},children:[L&&(0,t.jsx)(C,{ai:L,testId:`block-ai-${e.id}`}),R&&(0,t.jsx)("span",{"data-testid":`block-model-${e.id}`,title:R,style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",padding:"4px 9px",background:"rgba(255, 255, 255, 0.045)",border:`1px solid ${i.f.lineSoft}`,borderRadius:999,fontSize:11.5,fontWeight:600,color:i.f.dim,whiteSpace:"nowrap"},children:R}),"tests"===e.kind&&"string"==typeof e.config.testCommand&&""!==e.config.testCommand.trim()&&(0,t.jsx)("span",{"data-testid":`block-command-${e.id}`,title:e.config.testCommand,style:{maxWidth:150,overflow:"hidden",textOverflow:"ellipsis",padding:"4px 9px",background:"rgba(255, 255, 255, 0.045)",border:`1px solid ${i.f.lineSoft}`,borderRadius:999,fontFamily:"var(--font-mono), ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:11,color:i.f.dim,whiteSpace:"nowrap"},children:e.config.testCommand.trim()}),!e.enabled&&(0,t.jsx)("span",{style:{color:i.f.skipped,fontSize:12},children:r.B.editing.disabledBadge}),f&&(0,t.jsx)(A,{label:e.label,onRemove:f})]})]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:7,margin:"11px 0 0"},children:[(0,t.jsx)("span",{"aria-hidden":"true",style:{width:6,height:6,borderRadius:"50%",background:F,flex:"0 0 auto"}}),(0,t.jsx)("span",{"aria-label":r.B.canvas.stateAria(N),style:{...B,fontSize:11,color:F},children:N}),s.round&&(0,t.jsx)("span",{"data-testid":`round-${e.id}`,style:{...B,fontSize:9.5,color:"#cfe0ff",padding:"2px 7px",borderRadius:999,border:`1px solid ${i.f.tint("running",.45)}`,marginLeft:4},children:r.B.gate.round(s.round)})]}),_&&(0,t.jsx)("div",{title:r.B.canvas.claimTitle,style:{...B,color:i.f.waiting,margin:"11px 0 3px"},children:r.B.canvas.claimMarker}),(0,t.jsx)("p",{style:{margin:_?0:"9px 0 0",fontSize:_?15:16,lineHeight:1.36,letterSpacing:"-0.005em",color:_?"#e7dcc4":i.f.ink,fontStyle:_?"italic":"normal",borderLeft:_?`2px solid ${i.f.tint("waiting",.5)}`:void 0,paddingLeft:_?10:void 0},children:e.enabled?U?s.summary:r.B.canvas.noResultLine:r.B.editing.disabledLine}),s.evidence&&(0,t.jsx)(T,{evidence:s.evidence}),s.asked&&s.asked.length>0&&(0,t.jsx)(h,{prompts:s.asked}),s.risk&&(0,t.jsx)(H,{risk:s.risk}),s.results&&(0,t.jsx)(l.v,{runId:s.results,compact:!0}),p.map(e=>(0,t.jsx)("p",{style:{margin:"10px 0 0",fontSize:12.5,color:"#ffb4ac",background:i.f.tint("failed",.09),border:`1px solid ${i.f.tint("failed",.28)}`,borderRadius:8,padding:"7px 9px"},children:e},e)),y&&"failed"===s.state&&(0,t.jsxs)("div",{className:"nodrag nopan","data-testid":"failed-actions",style:{display:"flex",gap:8,marginTop:14,marginBottom:14},onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("button",{type:"button",onClick:y.onSee,style:{flex:1,padding:"8px 10px",borderRadius:8,border:`1px solid ${i.f.failed}`,background:i.f.tint("failed",.14),color:"#ffd9d9",fontSize:13,fontWeight:700,cursor:"pointer"},children:r.B.failure.see}),y.onAgain&&(0,t.jsxs)("button",{type:"button",onClick:y.onAgain,style:{flex:"none",display:"inline-flex",alignItems:"center",gap:7,padding:"8px 12px",borderRadius:8,border:`1px solid ${i.f.border}`,background:"#0f141c",color:"#e6e9ef",fontSize:13,fontWeight:700,cursor:"pointer"},children:[(0,t.jsxs)("svg",{viewBox:"0 0 24 24",width:14,height:14,fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M20 11a8 8 0 1 0-2.3 5.7"}),(0,t.jsx)("path",{d:"M20 4v7h-7"})]}),r.B.failure.tryAgain]})]}),w&&"queued"!==s.state&&!s.notBuilt&&(0,t.jsx)("div",{className:"nodrag nopan",style:{marginTop:12,marginBottom:12},onClick:e=>e.stopPropagation(),children:(0,t.jsxs)("button",{type:"button",onClick:w,style:{display:"inline-flex",alignItems:"center",gap:7,padding:"7px 12px",borderRadius:8,border:`1px solid ${i.f.border}`,background:"#0f141c",color:"#e6e9ef",fontSize:13,fontWeight:700,cursor:"pointer"},children:[(0,t.jsxs)("svg",{viewBox:"0 0 24 24",width:14,height:14,fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,t.jsx)("path",{d:"M12 11v5.5M12 7.6v.1"})]}),s.autoStarted?r.B.plan.seePlan:r.B.details.see]})}),(0,t.jsxs)("div",{style:{marginTop:"auto"},children:[o&&q.length>0&&(0,t.jsxs)("div",{style:{paddingTop:12,borderTop:`1px solid ${i.f.lineSoft}`},children:[(0,t.jsx)("div",{style:{...B,color:"#7d8798",marginBottom:7},children:r.B.canvas.steps}),O>0&&(0,t.jsx)("div",{style:{color:i.f.skipped,fontSize:11.5,marginBottom:4},children:r.B.canvas.earlierStepsHidden(O)}),(0,t.jsx)("ol",{start:O+1,style:{margin:0,paddingLeft:20,display:"grid",gap:3,fontSize:12.5},children:q.map((e,n)=>(0,t.jsx)("li",{style:{color:n===q.length-1?"#dfe4ec":"#6a7383"},children:e},n))})]}),!o&&void 0!==D&&(0,t.jsxs)("div",{style:{display:"flex",gap:7,alignItems:"baseline",paddingTop:12,borderTop:`1px solid ${i.f.lineSoft}`,fontSize:12.5,color:"running"===s.state?"#dfe4ec":"#6a7383"},children:[(0,t.jsx)("span",{"aria-hidden":"true",style:{width:4,height:4,borderRadius:"50%",marginTop:6,flex:"0 0 auto",background:"running"===s.state?i.f.running:"#39424f",boxShadow:"running"===s.state?`0 0 7px ${i.f.running}`:"none"}}),D]}),s.usage&&(0,t.jsxs)("dl",{style:{margin:0,paddingTop:12,borderTop:`1px solid ${i.f.lineSoft}`,display:"flex",alignItems:"baseline",gap:"0 8px",fontFamily:S,fontSize:11.5,color:"#7d8798"},children:[(0,t.jsx)("dt",{children:r.B.canvas.tokens}),(0,t.jsx)("dd",{style:{margin:0,color:i.f.dim,fontWeight:600},children:null===s.usage.tokens?r.B.canvas.notReported:s.usage.tokens.toLocaleString("en-US")}),(0,t.jsx)("dt",{style:{marginLeft:"auto"},children:r.B.canvas.cost}),(0,t.jsx)("dd",{style:{margin:0,color:i.f.dim,fontWeight:600},children:null===s.usage.costCents?r.B.canvas.notReported:(W=s.usage.costCents,`$${(W/100).toFixed(2)}`)})]})]})]})}function W({block:e,selected:n=!1,issues:s=[],onRemove:o}){return(0,t.jsxs)("div",{"data-testid":`block-card-${e.id}`,style:{width:k,minWidth:220,minHeight:v,display:"flex",flexDirection:"column",justifyContent:"center",gap:10,background:"transparent",border:`1px dashed ${n?i.f.running:i.f.skipped}`,borderRadius:14,padding:"15px 16px",fontSize:13,opacity:e.enabled?.8:.55},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,t.jsx)(a.f,{kind:e.kind,colour:i.f.skipped}),(0,t.jsx)("strong",{className:"factory-display",style:{fontSize:20,fontWeight:700,letterSpacing:"0",color:"#8b95a8"},children:e.label}),(0,t.jsxs)("span",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:6},children:[!e.enabled&&(0,t.jsx)("span",{style:{color:i.f.skipped,fontSize:12},children:r.B.editing.disabledBadge}),(0,t.jsx)("span",{style:{...B,fontSize:10,color:i.f.skipped},children:r.B.canvas.notInRun}),o&&(0,t.jsx)(A,{label:e.label,onRemove:o})]})]}),(0,t.jsx)("p",{style:{margin:0,color:i.f.skipped,fontSize:14,lineHeight:1.36},children:r.B.canvas.notInRunDetail}),s.map(e=>(0,t.jsx)("p",{style:{margin:0,fontSize:12.5,color:"#ffb4ac",background:i.f.tint("failed",.09),border:`1px solid ${i.f.tint("failed",.28)}`,borderRadius:8,padding:"7px 9px"},children:e},e))]})}let R={queued:"·",running:"▸",waiting_approval:"!",passed:"✓",failed:"✕",cancelled:"·",skipped:"·",blocked:"!"};function L({block:e,view:n,selected:s=!1}){let o=n?b[n.state]:"skipped",l=i.f[o],d=n?.notBuilt?r.B.canvas.notBuilt:n?.stateWord??(n?r.B.canvas.stateLabel[n.state]:r.B.canvas.notInRun),p=n?.notBuilt===!0;return(0,t.jsxs)("div",{"data-testid":`block-card-${e.id}`,title:`${e.label} — ${d}`,style:{position:"relative",width:w,minHeight:v,display:"flex",flexDirection:"column-reverse",alignItems:"center",gap:12,padding:"14px 0 16px",background:"linear-gradient(180deg, #141a24, #10151d)",borderStyle:p?"dashed":"solid",borderWidth:1,borderTopWidth:3,borderTopColor:l,borderRightColor:s?i.f.running:i.f.border,borderBottomColor:s?i.f.running:i.f.border,borderLeftColor:s?i.f.running:i.f.border,borderRadius:12,cursor:"pointer",opacity:e.enabled?p?.6:1:.55},children:[(0,t.jsx)(a.f,{kind:e.kind,colour:l,size:26}),(0,t.jsx)("span",{className:"factory-display",style:{writingMode:"vertical-rl",transform:"rotate(180deg)",fontSize:18,fontWeight:600,letterSpacing:"0.05em",color:"#c3cbd8",whiteSpace:"nowrap"},children:e.label}),n?.state==="running"&&(0,t.jsx)(M,{blockId:e.id,size:18}),(0,t.jsx)("span",{"aria-label":r.B.canvas.stateAria(d),style:{marginBottom:"auto",width:22,height:22,borderRadius:"50%",display:"grid",placeItems:"center",background:n&&!p?l:"transparent",border:n&&!p?"none":`1px dashed ${i.f.skipped}`,color:n&&!p?"#07090d":i.f.skipped,fontSize:11,fontWeight:800,lineHeight:1},children:n&&!p?R[n.state]:"·"})]})}function T({evidence:e}){var n;let s=e.counts,o=e.changedTestFiles??[],a=e.changedTestFilesCount??o.length,l=0===a&&null!==e.changedTestFiles;return(0,t.jsxs)("div",{"data-testid":"evidence-strip",style:{marginTop:12,background:"rgba(124, 160, 255, 0.045)",border:`1px solid ${i.f.lineSoft}`,borderRadius:10,padding:"9px 11px 10px"},children:[(0,t.jsxs)("div",{style:{...B,fontSize:9.5,letterSpacing:"0.14em",color:"#7d8798",display:"flex",alignItems:"center",gap:6,marginBottom:8},children:[(0,t.jsx)("span",{"aria-hidden":"true",style:{color:l?i.f.passed:i.f.waiting},children:l?"✓":"!"}),r.B.canvas.evidence]}),a>0&&(0,t.jsxs)("div",{"data-testid":"tests-changed",role:"note",style:{fontSize:12,color:i.f.waiting,margin:"0 0 8px",lineHeight:1.4},children:[r.B.canvas.testsChanged(a)," ",(0,t.jsxs)("span",{style:{fontFamily:S,fontSize:11.5,color:"#e7dcc4"},children:[o.slice(0,3).join(", "),a>3?` ${r.B.canvas.andMore(a-3)}`:""]})]}),null===e.changedTestFiles&&(0,t.jsx)("div",{"data-testid":"tests-unchecked",style:{fontSize:12,color:i.f.skipped,margin:"0 0 8px"},children:r.B.canvas.testsUnchecked}),s&&s.total>0&&(0,t.jsxs)("div",{role:"img","aria-label":r.B.canvas.evidenceCounts(s.passed,s.failed,s.total),style:{display:"flex",alignItems:"center",gap:3,marginBottom:8},children:[s.total<=30?Array.from({length:s.total},(e,n)=>(0,t.jsx)("span",{"data-pip":n<s.passed?"passed":n<s.passed+s.failed?"failed":"other",style:{width:7,height:13,borderRadius:2,flex:"0 0 auto",background:n<s.passed?i.f.passed:n<s.passed+s.failed?i.f.failed:"#30394a"}},n)):(0,t.jsxs)("span",{style:{display:"flex",flex:1,height:8,borderRadius:4,overflow:"hidden",background:"#30394a"},children:[(0,t.jsx)("span",{style:{width:`${s.passed/s.total*100}%`,background:i.f.passed}}),(0,t.jsx)("span",{style:{width:`${s.failed/s.total*100}%`,background:i.f.failed}})]}),(0,t.jsx)("span",{style:{fontFamily:S,fontSize:11.5,color:i.f.dim,marginLeft:7,fontWeight:600},children:r.B.canvas.evidenceCounts(s.passed,s.failed,s.total)})]}),(0,t.jsxs)("dl",{style:{display:"flex",flexWrap:"wrap",gap:"3px 14px",margin:0,fontFamily:S,fontSize:11.5,color:i.f.dim},children:[(0,t.jsxs)("span",{children:[(0,t.jsxs)("dt",{style:{display:"inline"},children:[r.B.canvas.exitCode," "]}),(0,t.jsx)("dd",{style:{display:"inline",margin:0,color:0===e.exitCode?i.f.passed:i.f.failed,fontWeight:600},children:null!==e.exitCode?e.exitCode:e.signal?e.signal:r.B.canvas.notReported})]}),(0,t.jsxs)("span",{children:[(0,t.jsxs)("dt",{style:{display:"inline"},children:[r.B.canvas.took," "]}),(0,t.jsx)("dd",{style:{display:"inline",margin:0,color:"#d6dce6",fontWeight:600},children:(n=e.durationMs)<1e3?`${n}ms`:n<6e4?`${(n/1e3).toFixed(1)}s`:`${Math.floor(n/6e4)}m ${Math.round(n%6e4/1e3)}s`})]})]})]})}function M({blockId:e,size:n=20}){return(0,t.jsxs)("svg",{"aria-hidden":"true","data-testid":`spinner-${e}`,className:"factory-spinner",viewBox:"0 0 20 20",width:n,height:n,style:{display:"block"},children:[(0,t.jsx)("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:i.f.tint("passed",.25),strokeWidth:"2.5"}),(0,t.jsx)("path",{d:"M10 2a8 8 0 0 1 8 8",fill:"none",stroke:i.f.passed,strokeWidth:"2.5",strokeLinecap:"round"})]})}function H({risk:e}){let n="low"===e.level,s=n?i.f.passed:i.f.waiting;return(0,t.jsxs)("div",{"data-testid":"risk-strip","data-level":e.level,style:{marginTop:12,background:i.f.tint(n?"passed":"waiting",.06),border:`1px solid ${i.f.tint(n?"passed":"waiting",.3)}`,borderRadius:10,padding:"9px 11px 10px"},children:[(0,t.jsx)("div",{style:{...B,fontSize:9.5,letterSpacing:"0.14em",color:s,marginBottom:6},children:r.B.risk.label[e.level]}),(0,t.jsx)("ul",{style:{margin:0,paddingLeft:16,display:"grid",gap:3,fontSize:12.5,color:"#d6dce6",lineHeight:1.4},children:e.reasons.slice(0,4).map(e=>(0,t.jsx)("li",{children:(0,o.f)((0,r.g)(e))},e))}),e.reasons.length>4&&(0,t.jsx)("div",{style:{fontSize:12,color:i.f.dim,marginTop:4},children:r.B.canvas.andMore(e.reasons.length-4)})]})}function A({label:e,onRemove:n}){return(0,t.jsx)("button",{type:"button",className:"nodrag","aria-label":r.B.editing.removeNamed(e),title:r.B.editing.removeNamed(e),onClick:e=>{e.stopPropagation(),n()},style:{display:"grid",placeItems:"center",width:26,height:26,padding:0,background:"none",border:`1px solid ${i.f.border}`,borderRadius:6,color:i.f.dim,cursor:"pointer"},children:(0,t.jsx)("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M2.5 4h11M6.5 4V2.5h3V4M4 4l.7 9.5h6.6L12 4M6.8 6.5v5M9.2 6.5v5"})})})}},76871,e=>{"use strict";e.s(["R",()=>p,"h",()=>g,"O",()=>d]);var t=e.i(43476),n=e.i(71645),i=e.i(5929),r=e.i(30904),s=e.i(8219),o=e.i(85402),a=e.i(21069);let l={completed:o.f.passed,failed:o.f.failed,cancelled:o.f.skipped,waiting_approval:o.f.waiting,running:o.f.running,queued:o.f.skipped};function d(e,t=Date.now()){let n=Math.round((t-Date.parse(e))/6e4);if(n<1)return r.B.history.justNow;if(n<60)return r.B.history.minutesAgo(n);let i=Math.round(n/60);return i<24?r.B.history.hoursAgo(i):i<48?r.B.history.yesterday:new Date(e).toLocaleDateString()}function p({workflowId:e,currentRunId:h,publishing:x=!1,refreshKey:b,onOpen:y,onDeleted:m,onCount:j,onWaiting:k}){let[v,w]=(0,n.useState)(null),[S,B]=(0,n.useState)(null),[$,I]=(0,n.useState)(null),[C,z]=(0,n.useState)(null),[W,R]=(0,n.useState)(null),[L,T]=(0,n.useState)(null),[M,H]=(0,n.useState)(0);async function A(e){z(null),I(e);try{let t=await fetch(`/api/runs/${e}`,{method:"DELETE"});if(!t.ok){let e=await t.json().catch(()=>null);return z(e?.error??r.B.history.couldNotDelete)}w(t=>(t??[]).filter(t=>t.runId!==e)),B(null),m?.(e)}catch{z(r.B.history.couldNotDelete)}finally{I(null)}}async function P(e,t){z(null),R({runId:e,what:t});try{let n=await fetch(`/api/runs/${e}/ship`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:t})});if(!n.ok){let e=await n.json().catch(()=>null);z(e?.error??r.B.history.actionFailed)}}catch{z(r.B.history.actionFailed)}finally{R(null),T(null),H(e=>e+1)}}(0,n.useEffect)(()=>{let e=setInterval(()=>H(e=>e+1),6e3);return()=>clearInterval(e)},[]),(0,n.useEffect)(()=>{let t=!0;return fetch(`/api/workflows/${e}/runs`).then(e=>e.ok?e.json():null).then(e=>t&&e&&w(e.runs)).catch(()=>void 0),()=>{t=!1}},[e,b,M]);let F=v?.length??null;(0,n.useEffect)(()=>{null!==F&&j?.(F)},[F]);let N=v?.filter(e=>"waiting_approval"===e.status).length??null;if((0,n.useEffect)(()=>{null!==N&&k?.(N)},[N]),null===v)return null;if(0===v.length)return(0,t.jsx)("p",{style:{margin:0,fontSize:13,color:s.f.faint},children:c.empty});let E=v.filter(u),q=v.filter(e=>!u(e)),O=e=>{let n=e.runId===h,p=e.status in r.B.run.status?e.status:"queued",b=u(e),m=W?.runId===e.runId,j="running"===p||"queued"===p,k=e.onHold?{text:c.onHold,colour:s.f.quiet,id:`on-hold-${e.runId}`}:"published"===e.next&&x&&e.runId===h?{text:c.publishing,colour:o.f.running,id:`next-${e.runId}`,spin:!0}:e.next?{text:c.next[e.next],colour:"conflict"===e.next?o.f.failed:s.f.green,id:`next-${e.runId}`}:"waiting_approval"===p?{text:c.waitingForYou,colour:s.f.green,id:`next-${e.runId}`}:j?{text:c.pill.working,colour:o.f.running,id:`state-${e.runId}`,spin:!0}:{text:r.B.run.status[p],colour:l[p]??s.f.quiet,id:`state-${e.runId}`},v=[e.onHold?c.pill.youHeld:null,!e.onHold&&"waiting_approval"===p?e.why:null].filter(e=>!!e);return(0,t.jsxs)("li",{style:{position:"relative",borderRadius:14,border:`1px solid ${S===e.runId?o.f.tint("failed",.6):b||n?s.f.green:s.f.line}`,background:n?"#242424":s.f.card,boxShadow:n?`inset 4px 0 0 ${s.f.green}`:void 0,color:s.f.text},children:[(0,t.jsx)("button",{type:"button","aria-label":c.delete(e.request),title:c.delete(e.request),onClick:()=>B(t=>t===e.runId?null:e.runId),className:"factory-delete",style:{position:"absolute",right:10,top:10,width:30,height:30,display:"grid",placeItems:"center",padding:0,borderRadius:8,background:S===e.runId?o.f.tint("failed",.18):"transparent",border:"1px solid transparent",color:S===e.runId?o.f.failed:s.f.faint,cursor:"pointer"},children:(0,t.jsx)("svg",{viewBox:"0 0 16 16",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M2.5 4h11M6.5 4V2.5h3V4M4 4l.7 9.5h6.6L12 4M6.8 6.5v5M9.2 6.5v5"})})}),(0,t.jsxs)("button",{type:"button","data-testid":`past-task-${e.runId}`,"aria-current":n?"true":void 0,onClick:()=>y(e.runId),style:{width:"100%",textAlign:"left",display:"grid",gap:8,padding:"14px 46px 14px 16px",background:"transparent",border:"none",borderRadius:14,color:"inherit",font:"inherit",cursor:"pointer"},children:[e.title&&(0,t.jsxs)("span",{"data-testid":`task-name-${e.runId}`,style:{fontSize:15,fontWeight:700,lineHeight:1.3,letterSpacing:"-0.01em",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[e.parentRunId?"↺ ":"",e.title]}),(0,t.jsxs)("span",{style:{fontSize:e.title?13:14,lineHeight:1.45,color:e.title?s.f.quiet:s.f.text,overflow:"hidden",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:[!e.title&&e.parentRunId?"↺ ":"",e.request]}),j&&e.progress&&(0,t.jsxs)("span",{"data-testid":`progress-${e.runId}`,style:{display:"grid",gap:6},children:[(0,t.jsx)("span",{"aria-hidden":"true",style:{display:"flex",gap:4},children:Array.from({length:e.progress.of},(n,i)=>(0,t.jsx)("span",{style:{flex:1,height:4,borderRadius:2,background:i+1<e.progress.step?s.f.green:i+1===e.progress.step?"#9a9a9a":s.f.line}},i))}),(0,t.jsx)("span",{style:{fontFamily:s.f.mono,fontSize:11.5,color:s.f.quiet},children:c.stepOf(e.progress.step,e.progress.of,e.progress.name)})]}),(0,t.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"4px 8px",fontSize:12,color:s.f.quiet},children:[(0,t.jsxs)("span",{"data-testid":k.id,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"3px 10px",borderRadius:999,background:"#222222",color:k.colour,fontWeight:700},children:[e.onHold?(0,t.jsx)(g,{}):k.spin?(0,t.jsx)(a.m,{blockId:`pill-${e.runId}`,size:12}):(0,t.jsx)("span",{"aria-hidden":"true",style:{width:7,height:7,flex:"none",borderRadius:"50%",background:k.colour}}),k.text]}),(0,t.jsx)("span",{children:d(e.createdAt)}),v.map(e=>(0,t.jsxs)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["· ",e]},e)),e.passedOnItsOwn&&(0,t.jsxs)("span",{"data-testid":`on-its-own-${e.runId}`,children:["· ",c.wentOnItsOwn]}),e.providerId===i.C&&(0,t.jsxs)("span",{style:{color:o.f.waiting},children:["· ",c.demo]})]})]}),S!==e.runId&&(e.onHold||b)&&!(n&&("plan"===e.next||"check"===e.next||"conflict"===e.next))&&(0,t.jsx)("div",{"data-testid":`task-action-${e.runId}`,style:{display:"grid",gap:8,margin:"0 16px",padding:"12px 0 14px",borderTop:`1px solid ${s.f.line}`,fontSize:12.5,lineHeight:1.45,color:s.f.quiet},children:e.onHold?(0,t.jsxs)("button",{type:"button",disabled:null!==W,onClick:()=>void P(e.runId,"unhold"),style:f(!1),children:[m&&(0,t.jsx)(a.m,{blockId:`resume-${e.runId}`,size:12}),c.resume]}):L===e.runId?(0,t.jsxs)("div",{role:"group","aria-label":c.confirmPublish,style:{display:"grid",gap:8},children:[c.confirmPublish,(0,t.jsxs)("span",{style:{display:"flex",gap:8},children:[(0,t.jsxs)("button",{type:"button",disabled:null!==W,onClick:()=>void P(e.runId,"merge"),style:f(!0),children:[m&&(0,t.jsx)(a.m,{blockId:`publish-${e.runId}`,size:12}),m?c.publishing:c.yesPublish]}),(0,t.jsx)("button",{type:"button",disabled:null!==W,onClick:()=>T(null),style:f(!1),children:c.noPublish})]})]}):"publish"===e.next?(0,t.jsxs)("span",{style:{display:"flex",gap:8},children:[(0,t.jsx)("button",{type:"button",disabled:null!==W,onClick:()=>T(e.runId),style:f(!0),children:c.publishIt}),(0,t.jsxs)("button",{type:"button",disabled:null!==W,onClick:()=>void P(e.runId,"hold"),style:f(!1),children:[m&&(0,t.jsx)(a.m,{blockId:`hold-${e.runId}`,size:12}),c.holdIt]})]}):"send"===e.next?(0,t.jsxs)("button",{type:"button",disabled:null!==W,onClick:()=>void P(e.runId,"open"),style:f(!0),children:[m&&(0,t.jsx)(a.m,{blockId:`send-${e.runId}`,size:12}),m?c.sending:c.sendIt]}):(0,t.jsx)("button",{type:"button",onClick:()=>y(e.runId),style:f(!0),children:c.openIt})}),S===e.runId&&(0,t.jsxs)("div",{role:"group","aria-label":c.confirm,style:{display:"grid",gap:8,margin:"0 16px",padding:"12px 0 14px",borderTop:`1px solid ${o.f.tint("failed",.3)}`,fontSize:12.5,lineHeight:1.45},children:[c.confirm,(0,t.jsxs)("span",{style:{display:"flex",gap:8},children:[(0,t.jsxs)("button",{type:"button",disabled:null!==$,onClick:()=>void A(e.runId),style:{...f(!1),borderColor:o.f.failed,background:o.f.tint("failed",.16),color:"#fecaca"},children:[$===e.runId&&(0,t.jsx)(a.m,{blockId:`delete-${e.runId}`,size:12}),$===e.runId?c.deleting:c.yes]}),(0,t.jsx)("button",{type:"button",disabled:null!==$,onClick:()=>B(null),style:f(!1),children:c.no})]})]})]},e.runId)},D={listStyle:"none",margin:0,padding:0,display:"grid",gap:10};return(0,t.jsxs)("div",{style:{display:"grid",gap:14,fontFamily:s.f.sans},children:[C&&(0,t.jsx)("p",{role:"alert",style:{margin:0,fontSize:12.5,color:o.f.failed},children:C}),E.length>0&&(0,t.jsxs)("section",{"aria-label":c.needsYou,style:{display:"grid",gap:10},children:[(0,t.jsx)("h3",{style:{margin:0,fontFamily:s.f.mono,fontSize:11.5,fontWeight:500,letterSpacing:"0.2em",textTransform:"uppercase",color:s.f.green},children:c.needsYou}),(0,t.jsx)("ul",{style:D,children:E.map(O)})]}),q.length>0&&(0,t.jsx)("ul",{style:D,children:q.map(O)})]})}let c=r.B.history;function u(e){return!e.onHold&&"published"!==e.next&&("waiting_approval"===e.status||null!==e.next&&void 0!==e.next)}function f(e){return{flex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6,padding:"9px 12px",borderRadius:9,border:`1px solid ${e?s.f.green:s.f.line}`,background:e?s.f.green:s.f.bg,color:e?s.f.onGreen:s.f.text,fontSize:13,fontWeight:700,cursor:"pointer"}}function g({size:e=10}){return(0,t.jsxs)("svg",{viewBox:"0 0 16 16",width:e,height:e,fill:"currentColor","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"3.5",y:"2.5",width:"3",height:"11",rx:"1"}),(0,t.jsx)("rect",{x:"9.5",y:"2.5",width:"3",height:"11",rx:"1"})]})}},85402,44094,34910,53148,e=>{"use strict";e.s(["v",()=>b,"$",()=>x,"R",()=>m,"h",()=>u,"w",()=>y,"C",()=>g],53148);let t={running:"59, 130, 246",passed:"121, 220, 139",failed:"239, 68, 68",waiting:"245, 158, 11",skipped:"107, 114, 128"},n={bg:"#0b0e14",card:"#151a23",border:"#262d3a",running:"#3b82f6",passed:"#79dc8b",failed:"#ef4444",waiting:"#f59e0b",skipped:"#6b7280",floorLine:"#2a3548",pointer:"#e5e7eb",cardFace:"linear-gradient(180deg, #1a2230 0%, #141a24 62%)",lineSoft:"rgba(255, 255, 255, 0.055)",ink:"#eef1f6",dim:"#9aa5b6",elevation(e){let t=[0,6,14][e]??0;return 0===e?"none":`0 ${t}px ${2*t}px rgba(0, 0, 0, 0.45)`},ambient:"radial-gradient(ellipse at 30% 40%, rgba(59, 130, 246, 0.10), transparent 55%), radial-gradient(ellipse at 75% 65%, rgba(245, 158, 11, 0.06), transparent 50%)",glow(e){let n=t[e];return`0 0 0 1px rgba(${n}, 0.6), 0 0 26px rgba(${n}, 0.28), 0 14px 28px rgba(0, 0, 0, 0.45)`},tint:(e,n)=>`rgba(${t[e]}, ${n})`};e.s(["f",0,n],85402);var i=e.i(30904);let r=e=>e.length>80?`${e.slice(0,79).trimEnd()}…`:e,s=/(\b(?:[Tt]he\s+)?(?:[Aa]greed\s+|[Ee]arlier\s+)?(?:[Dd]ecision|[Rr]ule|[Cc]ore area|[Ee]ntry)\s+)?\bD-(\d+)\b/g;e.s(["f",0,function(e,t=[]){return e.replace(s,(n,s,o,a)=>{var l;let d=(l=t.find(e=>e.number===Number(o)))?"core"===l.kind?i.B.question.entryAs.core(l.paths&&l.paths.length>0?l.paths.join(", "):`“${r(l.text)}”`):"rule"===l.kind?i.B.question.entryAs.rule(r(l.text)):i.B.question.entryAs.decision(r(l.text)):i.B.question.earlierDecision;return/[A-Z]/.test(s?.[0]??"")||!s&&/(^|[.!?]\s+)$/.test(e.slice(0,a))?`${d[0].toUpperCase()}${d.slice(1)}`:d})}],44094);var o=e.i(43476);let a={input:(0,o.jsx)("path",{d:"M2 8h8M7 5l3 3-3 3M12 2v12"}),plan:(0,o.jsx)("path",{d:"M3 4h10M3 8h10M3 12h6"}),build:(0,o.jsx)("path",{d:"M2.5 5.5l3-3 8 8-3 3zM9 3l1.5-1.5 3.5 3.5L12.5 6.5"}),tests:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("rect",{x:"1.5",y:"1.5",width:"13",height:"13",rx:"3"}),(0,o.jsx)("path",{d:"M3 8l2.5 2.5L9 6"})]}),review:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("circle",{cx:"7",cy:"7",r:"4.5"}),(0,o.jsx)("path",{d:"M10.5 10.5L14 14"})]}),approve:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("circle",{cx:"8",cy:"8",r:"6.5"}),(0,o.jsx)("path",{d:"M5 8.2l2.2 2.2L11 6.4"})]}),human:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("circle",{cx:"8",cy:"5",r:"2.6"}),(0,o.jsx)("path",{d:"M3 14c0-2.8 2.2-4.6 5-4.6s5 1.8 5 4.6"})]}),ship:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("path",{d:"M8 13V3M8 3l4 4M8 3L4 7"}),(0,o.jsx)("path",{d:"M2.5 13.5h11"})]})};e.s(["f",0,function({kind:e,colour:t,size:n=28}){let i=Math.round(.54*n);return(0,o.jsx)("span",{"aria-hidden":"true","data-testid":`type-mark-${e}`,style:{width:n,height:n,flex:"0 0 auto",borderRadius:Math.round(.29*n),display:"grid",placeItems:"center",background:`color-mix(in srgb, ${t} 13%, transparent)`,border:`1px solid color-mix(in srgb, ${t} 28%, transparent)`,color:t},children:(0,o.jsx)("svg",{viewBox:"0 0 16 16",width:i,height:i,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:a[e]})})}],34910);var l=e.i(71645),d=e.i(74080),p=e.i(21069);let c=(e,t,n,i)=>`/api/runs/${e}/snapshots/${t}?v=${encodeURIComponent(n)}${i?`&c=${i}`:""}`,u=(e,t,n)=>c(e,t,n.taken??`${n.route??""}-${n.shots.join(",")}`);function f({style:e,newProject:t}){return(0,o.jsx)("div",{"data-testid":t?"before-new-project":void 0,style:{...e,minWidth:0,overflow:"hidden",border:`1px dashed ${n.border}`,display:"grid",placeItems:"center",padding:8,boxSizing:"border-box",textAlign:"center",color:n.dim,fontSize:12,lineHeight:1.35},children:t?i.B.snapshots.newProject:null})}function g(e,t,n=!1,r){let[s,o]=(0,l.useState)(null),[a,d]=(0,l.useState)(null),p=(0,l.useRef)(!1),c=(0,l.useCallback)(()=>{fetch(`/api/runs/${e}/snapshots${r?`?change=${r}`:""}`).then(e=>e.ok?e.json():null).then(e=>e&&Array.isArray(e.shots)&&o(e)).catch(()=>void 0)},[e,r]),u=(0,l.useCallback)(async()=>{d(null);try{let t=await fetch(`/api/runs/${e}/snapshots`,{method:"POST"}),n=await t.json().catch(()=>null);if(!t.ok||!n||!Array.isArray(n.shots))return d(n?.error??i.B.snapshots.failed(""));o(n)}catch{d(i.B.snapshots.failed(""))}},[e]);return(0,l.useEffect)(()=>{p.current=!1,c()},[c]),(0,l.useEffect)(()=>{t&&s?.status==="none"&&!p.current&&(p.current=!0,u())},[t,s?.status,u]),(0,l.useEffect)(()=>{if(s?.status!=="working"&&!(n&&s?.status==="none"))return;let e=setInterval(c,3e3);return()=>clearInterval(e)},[s?.status,n,c]),{state:s,error:a,take:u}}function h(e,t,n){let[i,r]=(0,l.useState)([]);return(0,l.useEffect)(()=>{if(n)return;let t=!0;return fetch(`/api/runs/${e}/snapshots?versions=1`).then(e=>e.ok?e.json():null).then(e=>t&&Array.isArray(e?.versions)&&r(e.versions)).catch(()=>void 0),()=>{t=!1}},[e,t,n]),i}function x({runId:e,autoStart:t}){return g(e,t),null}function b({runId:e,autoStart:t=!1,compact:r=!1,canTake:s=!0,change:a}){let{state:d,error:u,take:x}=g(e,t&&!a,!a,a),[y,m]=(0,l.useState)(!1),v=(0,l.useCallback)(()=>m(!1),[]),w=h(e,d?.taken,void 0!==a||d?.status!=="ready"),S=w.length>1;if(!d||"unneeded"===d.status||a&&"ready"!==d.status)return null;let B=d.taken??`${d.route??""}-${d.shots.join(",")}`,$={fontSize:11.5,color:n.dim,lineHeight:1.4};return(0,o.jsxs)("div",{"data-testid":"before-after",onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),style:{display:"grid",gap:6,marginTop:10*!!r,padding:10,borderRadius:10,border:`1px solid ${n.border}`,background:"#0d1118"},children:[(0,o.jsx)("div",{style:{fontSize:10.5,fontWeight:800,letterSpacing:"0.12em",textTransform:"uppercase",color:n.dim},children:i.B.snapshots.title}),"none"===d.status&&!u&&s&&(0,o.jsxs)("button",{type:"button",onClick:()=>void x(),style:{justifySelf:"start",display:"inline-flex",alignItems:"center",gap:6,padding:0,background:"none",border:"none",color:"#93c5fd",fontSize:12.5,fontWeight:600,cursor:"pointer"},children:[(0,o.jsx)(k,{})," ",i.B.snapshots.take]}),"working"===d.status&&(0,o.jsxs)("div",{style:{...$,display:"flex",gap:6,alignItems:"center"},children:[(0,o.jsx)(p.m,{blockId:`snap-${e}`,size:13})," ",d.message]}),"ready"===d.status&&(0,o.jsx)("button",{type:"button","aria-label":i.B.snapshots.open,onClick:()=>m(!0),style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr) minmax(0, 1fr)",gap:6,padding:0,background:"none",border:"none",cursor:"zoom-in",color:"inherit"},children:["before-desktop","after-desktop"].map(t=>(0,o.jsxs)("figure",{style:{margin:0,display:"grid",gap:3,minWidth:0},children:[d.shots.includes(t)?(0,o.jsx)("img",{src:c(e,t,B,a),alt:t.startsWith("before")?i.B.snapshots.before:i.B.snapshots.after,style:{width:"100%",aspectRatio:"16 / 10",objectFit:"cover",objectPosition:"top",borderRadius:6,border:`1px solid ${n.border}`}}):(0,o.jsx)(f,{style:{aspectRatio:"16 / 10",borderRadius:6},newProject:t.startsWith("before")&&!0===d.newProject}),(0,o.jsx)("figcaption",{style:{fontSize:11,fontWeight:700,color:t.startsWith("before")?n.dim:n.passed,textAlign:"left"},children:t.startsWith("before")?i.B.snapshots.before:i.B.snapshots.after})]},t))}),"ready"===d.status&&(0,o.jsxs)("button",{type:"button",onClick:()=>m(!0),style:{justifySelf:"start",display:"inline-flex",alignItems:"center",gap:6,padding:0,background:"none",border:"none",color:"#93c5fd",fontSize:12.5,fontWeight:600,cursor:"pointer"},children:[(0,o.jsx)(k,{})," ",S?i.B.snapshots.openAll(w.length):i.B.snapshots.open]}),("failed"===d.status||u)&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{role:"alert",style:{...$,color:n.waiting},children:u??d.message}),(0,o.jsx)("button",{type:"button",onClick:()=>void x(),style:{justifySelf:"start",padding:0,background:"none",border:"none",color:"#93c5fd",fontSize:12,fontWeight:600,cursor:"pointer"},children:i.B.snapshots.retry})]}),y&&"ready"===d.status&&(0,o.jsx)(j,{runId:e,state:d,at:B,change:a,versions:S?w:[],onClose:v})]})}function y(e){let{state:t}=g(e,!1),n=h(e,t?.taken,t?.status!=="ready");return{state:t,versions:t?.status==="ready"&&n.length>1?n:[]}}function m({runId:e,state:t,versions:r,index:s}){let[a,d]=(0,l.useState)(!1),p=(0,l.useCallback)(()=>d(!1),[]),u=r[s];if(!u)return null;let g=r[s-1],h=g?g.shots.includes("after-desktop")?c(e,"after-desktop",g.taken,g.change):null:u.shots.includes("before-desktop")?c(e,"before-desktop",u.taken,u.change):null,x=u.shots.includes("after-desktop")?c(e,"after-desktop",u.taken,u.change):null,b=(e,t,i)=>(0,o.jsxs)("span",{style:{display:"grid",gap:4,justifyItems:"start"},children:[(0,o.jsx)("span",{style:{fontSize:11,fontWeight:800,letterSpacing:"0.08em",textTransform:"uppercase",color:i?n.passed:n.dim},children:t}),e?(0,o.jsx)("img",{src:e,alt:"",style:{display:"block",width:"min(170px, 34vw)",aspectRatio:"25 / 16",objectFit:"cover",objectPosition:"top",borderRadius:8,border:`1px solid ${i?n.tint("passed",.5):n.border}`}}):(0,o.jsx)(f,{style:{width:"min(170px, 34vw)",aspectRatio:"25 / 16",borderRadius:8},newProject:!i&&!g&&!0===u.newProject})]});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("button",{type:"button","data-testid":"version-pictures","aria-label":i.B.snapshots.openAll(r.length),onClick:()=>d(!0),style:{display:"flex",alignItems:"end",gap:8,padding:0,border:"none",background:"none",cursor:"zoom-in",justifySelf:"start",color:"inherit"},children:[b(h,i.B.snapshots.before,!1),(0,o.jsx)("span",{"aria-hidden":"true",style:{alignSelf:"center",color:n.dim,fontSize:16,paddingTop:14},children:"→"}),b(x,i.B.snapshots.after,!0)]}),a&&(0,o.jsx)(j,{runId:e,state:t,at:t.taken??"",versions:r,onClose:p})]})}function j({runId:e,state:t,at:r,change:s,versions:a,onClose:p}){let[u,g]=(0,l.useState)("desktop"),h=(0,l.useRef)(null);(0,l.useEffect)(()=>{h.current?.focus();let e=e=>{"Escape"===e.key&&p()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[p]);let x=e=>({padding:"5px 12px",borderRadius:999,border:`1px solid ${u===e?n.running:n.border}`,background:u===e?n.tint("running",.18):"transparent",color:u===e?"#cfe0ff":n.dim,fontSize:12.5,fontWeight:700,cursor:"pointer"}),b="desktop"===u?i.B.snapshots.desktop:i.B.snapshots.mobile,y=(e,t,i,r,s=!1)=>[["before",e,i],["after",t,r]].map(([e,t,i])=>(0,o.jsxs)("figure",{style:{margin:0,display:"grid",gap:8,justifyItems:"center"},children:[(0,o.jsx)("figcaption",{style:{justifySelf:"start",fontSize:13,fontWeight:800,letterSpacing:"0.08em",textTransform:"uppercase",color:"before"===e?n.dim:n.passed},children:i}),t?(0,o.jsx)("img",{src:t,alt:`${i} \xb7 ${b}`,style:{width:"desktop"===u?"100%":"min(100%, 390px)",borderRadius:8,border:`1px solid ${"before"===e?n.border:n.tint("passed",.5)}`}}):(0,o.jsx)(f,{style:{width:"100%",aspectRatio:"16 / 10",borderRadius:8},newProject:"before"===e&&s})]},e));return(0,d.createPortal)((0,o.jsx)("div",{"data-testid":"before-after-modal",onClick:p,style:{position:"fixed",inset:0,zIndex:120,background:"rgba(5, 7, 11, 0.75)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",placeItems:"center",padding:24},children:(0,o.jsxs)("div",{ref:h,role:"dialog","aria-modal":"true","aria-label":i.B.snapshots.beforeAfter,tabIndex:-1,onClick:e=>e.stopPropagation(),style:{width:"min(1400px, 100%)",height:"min(90vh, 100%)",display:"flex",flexDirection:"column",background:n.bg,border:`1px solid ${n.border}`,borderRadius:14,boxShadow:"0 30px 80px rgba(0,0,0,0.6)",outline:"none",color:"#e6e9ef"},children:[(0,o.jsxs)("header",{style:{display:"flex",alignItems:"center",gap:12,padding:"12px 16px",borderBottom:`1px solid ${n.border}`},children:[(0,o.jsxs)("div",{style:{display:"grid",gap:2,flex:1,minWidth:0},children:[(0,o.jsx)("div",{className:"factory-display",style:{fontSize:19},children:i.B.snapshots.beforeAfter}),(0,o.jsxs)("div",{style:{fontSize:12,color:n.dim},children:[t.route?`${i.B.snapshots.page(t.route,t.opened)} \xb7 `:"",i.B.snapshots.what]})]}),(0,o.jsxs)("div",{role:"group",style:{display:"flex",gap:6},children:[(0,o.jsx)("button",{type:"button","aria-pressed":"desktop"===u,onClick:()=>g("desktop"),style:x("desktop"),children:i.B.snapshots.desktop}),(0,o.jsx)("button",{type:"button","aria-pressed":"mobile"===u,onClick:()=>g("mobile"),style:x("mobile"),children:i.B.snapshots.mobile})]}),(0,o.jsx)("button",{type:"button","aria-label":i.B.snapshots.close,onClick:p,style:{background:"none",border:"none",color:n.skipped,cursor:"pointer",fontSize:18,lineHeight:1,padding:6},children:"✕"})]}),a.length>0?(0,o.jsx)("ol",{"data-testid":"before-after-versions",style:{flex:1,minHeight:0,overflow:"auto",margin:0,padding:16,listStyle:"none",display:"grid",gap:28,alignContent:"start",scrollbarWidth:"thin",scrollbarColor:`${n.floorLine} transparent`},children:a.map((t,r)=>{let s=a[r-1],l=s?{shot:`after-${u}`,of:s}:{shot:`before-${u}`,of:t};return(0,o.jsxs)("li",{"data-testid":"before-after-version",style:{display:"grid",gap:10},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,minWidth:0},children:[(0,o.jsx)("span",{style:{flex:"none",width:26,height:26,borderRadius:999,display:"grid",placeItems:"center",border:`2px solid ${n.passed}`,color:n.passed,fontSize:12.5,fontWeight:800,alignSelf:"center"},children:r+1}),(0,o.jsxs)("div",{style:{display:"grid",gap:2,minWidth:0},children:[(0,o.jsx)("span",{style:{fontSize:11,fontWeight:800,letterSpacing:"0.1em",textTransform:"uppercase",color:n.dim},children:0===r?i.B.snapshots.versionFirst:i.B.snapshots.versionNext}),(0,o.jsx)("span",{style:{fontSize:14.5,lineHeight:1.45,overflowWrap:"anywhere"},children:t.asked})]})]}),(0,o.jsx)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr) minmax(0, 1fr)",gap:16,alignItems:"start"},children:y(l.of.shots.includes(l.shot)?c(e,l.shot,l.of.taken,l.of.change):null,t.shots.includes(`after-${u}`)?c(e,`after-${u}`,t.taken,t.change):null,i.B.snapshots.versionBefore,i.B.snapshots.versionAfter,l.of===t&&!0===t.newProject)})]},t.change)})}):(0,o.jsx)("div",{style:{flex:1,minHeight:0,overflow:"auto",padding:16,display:"grid",gridTemplateColumns:"minmax(0, 1fr) minmax(0, 1fr)",gap:16,alignItems:"start",scrollbarWidth:"thin",scrollbarColor:`${n.floorLine} transparent`},children:y(t.shots.includes(`before-${u}`)?c(e,`before-${u}`,r,s):null,t.shots.includes(`after-${u}`)?c(e,`after-${u}`,r,s):null,i.B.snapshots.before,i.B.snapshots.after,!0===t.newProject)})]})}),document.body)}function k(){return(0,o.jsxs)("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,o.jsx)("rect",{x:"1.5",y:"3",width:"5.5",height:"10",rx:"1"}),(0,o.jsx)("rect",{x:"9",y:"3",width:"5.5",height:"10",rx:"1"})]})}}]);
|
package/app-build/trace-build
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"name":"turbopack-
|
|
1
|
+
[{"name":"turbopack-write-entrypoints","duration":0,"timestamp":407401689806,"id":15,"parentId":1,"tags":{},"startTime":1795036938018,"traceId":"72cdb07717710d17"},{"name":"turbopack-write-entrypoints","duration":0,"timestamp":407401907939,"id":17,"parentId":1,"tags":{},"startTime":1795036938236,"traceId":"72cdb07717710d17"},{"name":"turbopack-write-entrypoints","duration":0,"timestamp":407401995747,"id":19,"parentId":1,"tags":{},"startTime":1795036938324,"traceId":"72cdb07717710d17"},{"name":"turbopack-write-entrypoints","duration":0,"timestamp":407401996883,"id":21,"parentId":1,"tags":{},"startTime":1795036938325,"traceId":"72cdb07717710d17"},{"name":"turbopack-emit","duration":257000,"timestamp":407402749234,"id":23,"parentId":1,"tags":{},"startTime":1795036939077,"traceId":"72cdb07717710d17"},{"name":"run-turbopack","duration":3465711,"timestamp":407399697163,"id":14,"parentId":1,"tags":{},"startTime":1795036936025,"traceId":"72cdb07717710d17"},{"name":"turbopack-persistence","duration":309000,"timestamp":407403162832,"id":27,"parentId":1,"tags":{"reason":"stop","snapshot_duration_ms":7.228541,"persist_duration_ms":301.053667,"task_count":10681,"bytes_written":48078435,"bytes_deleted":0},"startTime":1795036939491,"traceId":"72cdb07717710d17"},{"name":"turbopack-compaction","duration":1451000,"timestamp":407403473154,"id":29,"parentId":1,"tags":{"bytes_written":346117642,"bytes_deleted":495359937},"startTime":1795036939801,"traceId":"72cdb07717710d17"},{"name":"run-typescript","duration":5809506,"timestamp":407403170008,"id":26,"parentId":1,"tags":{},"startTime":1795036939498,"traceId":"72cdb07717710d17"},{"name":"static-check","duration":1173743,"timestamp":407409006462,"id":33,"parentId":1,"tags":{},"startTime":1795036945335,"traceId":"72cdb07717710d17"},{"name":"static-generation","duration":144563,"timestamp":407410183224,"id":159,"parentId":1,"tags":{},"startTime":1795036946511,"traceId":"72cdb07717710d17"},{"name":"telemetry-flush","duration":466496,"timestamp":407410364925,"id":168,"parentId":1,"tags":{},"startTime":1795036946693,"traceId":"72cdb07717710d17"},{"name":"next-build","duration":11356579,"timestamp":407399474915,"id":1,"tags":{"buildMode":"default","version":"16.4.5","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1795036935803,"traceId":"72cdb07717710d17"}]
|
package/bin/plaincrew.mjs
CHANGED
|
@@ -159,15 +159,20 @@ async function connectToCloud(base) {
|
|
|
159
159
|
}
|
|
160
160
|
/** The greeting, with the mark (two rings and the green dot), as other tools greet in the terminal. Plain text when
|
|
161
161
|
* the output is not a terminal or colour is turned off (NO_COLOR). */
|
|
162
|
+
const colour = process.stdout.isTTY && !process.env.NO_COLOR
|
|
163
|
+
const paint = (code, text) => (colour ? `\x1b[${code}m${text}\x1b[0m` : text)
|
|
164
|
+
const green = text => paint('38;2;121;220;139', text)
|
|
165
|
+
const grey = text => paint('38;2;163;163;163', text)
|
|
166
|
+
const bold = text => paint('1', text)
|
|
167
|
+
/** The mark's two lines, with the green dot in place `at` (0, 1 or 2) and rings in the others. */
|
|
168
|
+
const RING = ['▄▀▀▄', '▀▄▄▀']
|
|
169
|
+
const DOT = ['▄██▄', '▀██▀']
|
|
170
|
+
const markLines = at => [0, 1].map(row => [0, 1, 2].map(i => (i === at ? green(DOT[row]) : grey(RING[row]))).join(' '))
|
|
162
171
|
function welcome() {
|
|
163
|
-
const colour = process.stdout.isTTY && !process.env.NO_COLOR
|
|
164
|
-
const paint = (code, text) => (colour ? `\x1b[${code}m${text}\x1b[0m` : text)
|
|
165
|
-
const green = text => paint('38;2;121;220;139', text)
|
|
166
|
-
const grey = text => paint('38;2;163;163;163', text)
|
|
167
|
-
const bold = text => paint('1', text)
|
|
168
172
|
say('')
|
|
169
|
-
|
|
170
|
-
say(` ${
|
|
173
|
+
const [top, bottom] = markLines(2)
|
|
174
|
+
say(` ${top} ${bold('Welcome to Plaincrew')} ${grey(version)}`)
|
|
175
|
+
say(` ${bottom} ${grey('Say what you want. Agents build it, check it and send it.')}`)
|
|
171
176
|
}
|
|
172
177
|
welcome()
|
|
173
178
|
|
|
@@ -182,9 +187,38 @@ const children = []
|
|
|
182
187
|
let stopping = false
|
|
183
188
|
/** Every part is asked to stop, and given time to: the task engine saves what each task waits on as it closes, so a
|
|
184
189
|
* task that waited for the person carries on when Plaincrew is opened again. One that does not stop is ended. */
|
|
185
|
-
|
|
190
|
+
/**
|
|
191
|
+
* While Plaincrew closes: the mark, its green dot moving from ring to ring, and "please wait", so the terminal never
|
|
192
|
+
* looks stuck. Plain lines when the output is not a terminal. Returns what ends it, saying Plaincrew is closed.
|
|
193
|
+
*/
|
|
194
|
+
function closingAnimation() {
|
|
195
|
+
const text = [bold('Closing Plaincrew, please wait…'), grey('Saving what each task was doing.')]
|
|
196
|
+
if (!colour) {
|
|
197
|
+
say('\nClosing Plaincrew, please wait…')
|
|
198
|
+
return () => say('Plaincrew is closed.')
|
|
199
|
+
}
|
|
200
|
+
const draw = (at, lines) => process.stdout.write(markLines(at).map((m, i) => `\x1b[2K ${m} ${lines[i]}`).join('\n'))
|
|
201
|
+
process.stdout.write('\n\x1b[?25l') // the cursor hidden while it moves
|
|
202
|
+
let at = 0
|
|
203
|
+
draw(at, text)
|
|
204
|
+
const timer = setInterval(() => {
|
|
205
|
+
at = (at + 1) % 3
|
|
206
|
+
process.stdout.write('\r\x1b[1A')
|
|
207
|
+
draw(at, text)
|
|
208
|
+
}, 250)
|
|
209
|
+
return () => {
|
|
210
|
+
clearInterval(timer)
|
|
211
|
+
process.stdout.write('\r\x1b[1A')
|
|
212
|
+
draw(2, [bold('Plaincrew is closed.'), grey('See you soon.')])
|
|
213
|
+
process.stdout.write('\n\x1b[?25h')
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function stopAll(code = 0, quietly = false) {
|
|
186
218
|
if (stopping) return
|
|
187
219
|
stopping = true
|
|
220
|
+
// Ctrl+C reaches Plaincrew twice when started through npx (npx passes it on too): only the first one counts.
|
|
221
|
+
const finished = quietly ? () => undefined : closingAnimation()
|
|
188
222
|
const signal = (c, sig) => {
|
|
189
223
|
try {
|
|
190
224
|
process.kill(process.platform === 'win32' ? c.pid : -c.pid, sig)
|
|
@@ -196,13 +230,15 @@ function stopAll(code = 0) {
|
|
|
196
230
|
// SIGINT, as Ctrl+C would: the task engine saves what each task waits on before it closes.
|
|
197
231
|
for (const c of alive) signal(c, 'SIGINT')
|
|
198
232
|
let left = alive.length
|
|
199
|
-
const done = () => (log.end(), process.exit(code))
|
|
233
|
+
const done = () => (finished(), log.end(), process.exit(code))
|
|
200
234
|
if (left === 0) return done()
|
|
201
235
|
for (const c of alive) c.once('exit', () => --left === 0 && done())
|
|
236
|
+
// The task engine saves in about a second. The app can wait on the browser's open connection for a long time, and
|
|
237
|
+
// it keeps nothing of its own, so after a few seconds whatever is left is ended.
|
|
202
238
|
setTimeout(() => {
|
|
203
239
|
for (const c of alive) signal(c, 'SIGKILL')
|
|
204
240
|
setTimeout(done, 300)
|
|
205
|
-
},
|
|
241
|
+
}, 8_000).unref()
|
|
206
242
|
}
|
|
207
243
|
/** Starts a part of the app in its own process group; what it prints goes to the log, not the terminal. */
|
|
208
244
|
function start(name, cmd, args, opts) {
|
|
@@ -271,10 +307,10 @@ start('app', process.execPath, [require.resolve('next/dist/bin/next'), 'start',
|
|
|
271
307
|
},
|
|
272
308
|
})
|
|
273
309
|
|
|
274
|
-
process.on('SIGINT', () =>
|
|
310
|
+
process.on('SIGINT', () => stopAll(0))
|
|
275
311
|
process.on('SIGTERM', () => stopAll(0))
|
|
276
|
-
// Closing the terminal window: the same as Ctrl+C.
|
|
277
|
-
process.on('SIGHUP', () => stopAll(0))
|
|
312
|
+
// Closing the terminal window: the same as Ctrl+C, with nobody left to show the closing to.
|
|
313
|
+
process.on('SIGHUP', () => stopAll(0, true))
|
|
278
314
|
|
|
279
315
|
// Ready when the app answers; the first start also makes its database, so it may take a little longer.
|
|
280
316
|
const started = Date.now()
|