@baochunli/flakes 0.0.3 → 0.0.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.
Files changed (55) hide show
  1. package/dist/commands/auth.d.ts.map +1 -1
  2. package/dist/commands/auth.js +133 -13
  3. package/dist/commands/auth.js.map +1 -1
  4. package/dist/commands/host.js +1 -0
  5. package/dist/commands/host.js.map +1 -1
  6. package/dist/commands/tasks.js +3 -0
  7. package/dist/commands/tasks.js.map +1 -1
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +28 -15
  10. package/dist/index.js.map +1 -1
  11. package/dist/node_modules/@flakes/auth/package.json +1 -1
  12. package/dist/node_modules/@flakes/console/.output/nitro.json +1 -1
  13. package/dist/node_modules/@flakes/console/.output/public/assets/DocumentationPage-DM-ZYPgQ.js +1 -0
  14. package/dist/node_modules/@flakes/console/.output/public/assets/{RunPage-BC3sGoPN.js → RunPage-i03UqHYF.js} +1 -1
  15. package/dist/node_modules/@flakes/console/.output/public/assets/{RunsPage-LkYGVvbL.js → RunsPage-u8qbeAoV.js} +1 -1
  16. package/dist/node_modules/@flakes/console/.output/public/assets/{SandboxesPage-CwWMogj6.js → SandboxesPage-D8D_5kXP.js} +1 -1
  17. package/dist/node_modules/@flakes/console/.output/public/assets/{TranscriptPage-CTMgJgHp.js → TranscriptPage-ChoFjiPI.js} +1 -1
  18. package/dist/node_modules/@flakes/console/.output/public/assets/{_-DRcA_CG9.js → _-C4ecJpHe.js} +1 -1
  19. package/dist/node_modules/@flakes/console/.output/public/assets/{_runId-CO1ozt9P.js → _runId-BZXYFY32.js} +2 -2
  20. package/dist/node_modules/@flakes/console/.output/public/assets/{_taskId-CcIypX6M.js → _taskId-C28oHEU_.js} +2 -2
  21. package/dist/node_modules/@flakes/console/.output/public/assets/{account-DKgjbb-C.js → account-B4wDEC7t.js} +1 -1
  22. package/dist/node_modules/@flakes/console/.output/public/assets/{account-forms-DrHA3zEd.js → account-forms-BLo66Mqa.js} +1 -1
  23. package/dist/node_modules/@flakes/console/.output/public/assets/{auth-layout-INHonQMf.js → auth-layout-DiUSgtaY.js} +1 -1
  24. package/dist/node_modules/@flakes/console/.output/public/assets/{device-DOGZUNMB.js → device-NrLWypMd.js} +1 -1
  25. package/dist/node_modules/@flakes/console/.output/public/assets/{documentation-Dr9Bdqxh.js → documentation-NRDmcDud.js} +1 -1
  26. package/dist/node_modules/@flakes/console/.output/public/assets/{forgot-password-C7qvwcpm.js → forgot-password--3Mujc8s.js} +1 -1
  27. package/dist/node_modules/@flakes/console/.output/public/assets/{main-RzjfJZwD.js → main-KBvz0mSQ.js} +21 -87
  28. package/dist/node_modules/@flakes/console/.output/public/assets/{otp-verification-Cqa6lopR.js → otp-verification-BSXwS5bo.js} +1 -1
  29. package/dist/node_modules/@flakes/console/.output/public/assets/{reset-password-tImCgEn0.js → reset-password-C7SbNx2J.js} +1 -1
  30. package/dist/node_modules/@flakes/console/.output/public/assets/{runs-Cuk0VOVi.js → runs-xD4ynllK.js} +2 -2
  31. package/dist/node_modules/@flakes/console/.output/public/assets/{sandboxes-BBIIbVN8.js → sandboxes-Cfr1Y2Dn.js} +2 -2
  32. package/dist/node_modules/@flakes/console/.output/public/assets/{security-D3N68cBT.js → security-CCThSJae.js} +1 -1
  33. package/dist/node_modules/@flakes/console/.output/public/assets/{signin-DylILjyG.js → signin-CYeR3TaY.js} +1 -1
  34. package/dist/node_modules/@flakes/console/.output/public/assets/{signin-form-DWaa_uwj.js → signin-form-Bp22jPob.js} +1 -1
  35. package/dist/node_modules/@flakes/console/.output/public/assets/{signup-KmFQL_1g.js → signup-DHhPfohX.js} +1 -1
  36. package/dist/node_modules/@flakes/console/.output/server/{_-8ZDVkA1O.mjs → _-C-u135Pp.mjs} +3 -3
  37. package/dist/node_modules/@flakes/console/.output/server/{_-CjpSIsvB.mjs → _-DwPiGKLE.mjs} +3 -3
  38. package/dist/node_modules/@flakes/console/.output/server/_chunks/router.mjs +5 -5
  39. package/dist/node_modules/@flakes/console/.output/server/_ssr/{DocumentationPage-D85Budiq.mjs → DocumentationPage-CtBAQbzy.mjs} +4 -4
  40. package/dist/node_modules/@flakes/console/.output/server/_ssr/{documentation-Do_Mr_e4.mjs → documentation-Bf0VPrnt.mjs} +4 -4
  41. package/dist/node_modules/@flakes/console/.output/server/_ssr/{documentation-4BCES--X.mjs → documentation-PC93pMWl.mjs} +3 -3
  42. package/dist/node_modules/@flakes/console/.output/server/_ssr/{router-B3vKkNtv.mjs → router-elhBqT5k.mjs} +4 -4
  43. package/dist/node_modules/@flakes/console/.output/server/_ssr/ssr.mjs +2 -2
  44. package/dist/node_modules/@flakes/console/.output/server/{_tanstack-start-manifest_v-llXRWxjT.mjs → _tanstack-start-manifest_v-CR_hZXXv.mjs} +31 -31
  45. package/dist/node_modules/@flakes/console/package.json +1 -1
  46. package/dist/node_modules/@flakes/control-plane/package.json +1 -1
  47. package/dist/node_modules/@flakes/core/package.json +1 -1
  48. package/dist/node_modules/@flakes/harness-agent/package.json +1 -1
  49. package/dist/node_modules/@flakes/harness-sdk/package.json +1 -1
  50. package/dist/node_modules/@flakes/pi-agent/package.json +1 -1
  51. package/dist/node_modules/@flakes/protocol/package.json +1 -1
  52. package/dist/node_modules/@flakes/sandbox-runtime/package.json +1 -1
  53. package/dist/node_modules/@flakes/store/package.json +1 -1
  54. package/package.json +1 -1
  55. package/dist/node_modules/@flakes/console/.output/public/assets/DocumentationPage-DrqDulyL.js +0 -1
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAA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AAC,KAAK,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,KAAK,EAAE,CAAC;SACzE,CAAC;QACF,EAAE;QACF,yDAAyD;QACzD,yDAAyD;QACzD,uDAAuD;QACvD,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,SAAS,iBAAiB,CAAC,OAAe,EAAE,IAAiB;IAC3D,OAAO;QACL,UAAU,OAAO,EAAE;QACnB,EAAE;QACF,IAAI,CAAC,OAAO;QACZ,EAAE;QACF,QAAQ;QACR,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC;QAC1C,GAAG,qBAAqB,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC;QAC9C,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,SAAS,qBAAqB,CAC5B,OAAe,EACf,KAAoC;IAEpC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9C,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;AAC5D,CAAC"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flakes/auth",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -1,5 +1,5 @@
1
1
  {
2
- "date": "2026-07-03T06:53:18.111Z",
2
+ "date": "2026-07-03T07:25:59.537Z",
3
3
  "preset": "node-middleware",
4
4
  "framework": {
5
5
  "name": "nitro",
@@ -0,0 +1 @@
1
+ import{h as e,t,v as n}from"./react-DtOYBmep.js";import{t as r}from"./link-BsixJinJ.js";import{r as i,t as a}from"./utils-CEE0-YEp.js";import{n as o,r as s,t as c}from"./lib-DtfURcG3.js";import{t as l}from"./external-link-BW8lpiMR.js";import{t as u}from"./file-text-DMdy8OfN.js";import{at as d,c as f,l as p,o as m,s as h}from"./main-KBvz0mSQ.js";var g=i(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),_=n(t(),1),v=e();function y(e){let t=p(e.selectedPath);return(0,v.jsxs)(`section`,{className:`grid gap-5`,children:[(0,v.jsx)(`div`,{className:`flex min-w-0 flex-wrap items-start gap-4`,children:(0,v.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,v.jsx)(`p`,{className:`console-callout`,children:`Documentation`}),(0,v.jsx)(`h1`,{className:`mt-1 text-lg font-semibold tracking-tight`,children:`Flakes`}),(0,v.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm text-muted-foreground`,children:`Guides and reference for using Flakes, a harness runtime for distributed agent workflows.`})]})}),(0,v.jsxs)(`div`,{className:`grid min-w-0 gap-4 lg:grid-cols-[18rem_minmax(0,1fr)]`,children:[(0,v.jsx)(b,{selectedPath:t?.path}),t?(0,v.jsxs)(`article`,{className:`min-w-0 rounded-lg border bg-card text-card-foreground shadow-sm`,children:[(0,v.jsxs)(`header`,{className:`border-b px-5 py-5 sm:px-6`,children:[(0,v.jsx)(`p`,{className:`console-callout`,children:`Guide`}),(0,v.jsx)(`h2`,{className:`mt-2 text-xl font-semibold tracking-tight`,children:t.title}),t.description.length>0?(0,v.jsx)(`p`,{className:`mt-2 max-w-3xl text-sm text-muted-foreground`,children:t.description}):null]}),(0,v.jsx)(`div`,{className:`min-w-0 px-5 py-5 sm:px-6`,children:(0,v.jsx)(o,{remarkPlugins:[c],components:T,children:t.body})})]}):null]})]})}function b(e){let t=h.length===1?`1 page`:`${h.length} pages`;return(0,v.jsxs)(`nav`,{"aria-label":`Documentation pages`,className:`min-w-0 overflow-hidden rounded-lg border bg-card/80 text-card-foreground shadow-sm lg:sticky lg:top-6 lg:self-start`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-2 border-b bg-muted/30 px-3 py-2.5`,children:[(0,v.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-md border bg-background`,children:(0,v.jsx)(d,{className:`size-4 text-muted-foreground`})}),(0,v.jsxs)(`span`,{className:`min-w-0`,children:[(0,v.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:`Contents`}),(0,v.jsx)(`span`,{className:`block truncate font-mono text-[11px] text-muted-foreground`,children:t})]})]}),(0,v.jsx)(`div`,{className:`grid max-h-72 gap-0.5 overflow-y-auto p-2 lg:max-h-[calc(100vh-12rem)]`,children:(0,v.jsx)(x,{items:m,selectedPath:e.selectedPath})})]})}function x(e){let t=e.depth??0;return(0,v.jsx)(v.Fragment,{children:e.items.map(n=>n.type===`page`?(0,v.jsx)(w,{page:n.page,selected:n.page.path===e.selectedPath,depth:t},n.page.path||`overview`):(0,v.jsx)(S,{item:n,selectedPath:e.selectedPath,depth:t},n.key))})}function S(e){let t=C(e.item,e.selectedPath),[n,r]=(0,_.useState)(t);return(0,_.useEffect)(()=>{t&&r(!0)},[t]),(0,v.jsxs)(`div`,{className:`grid gap-1`,children:[(0,v.jsxs)(`button`,{type:`button`,"aria-expanded":n,onClick:()=>r(e=>!e),className:a(`group flex h-8 w-full min-w-0 items-center gap-2 rounded-md px-2 text-left text-sm text-muted-foreground transition-state hover:bg-secondary/70 hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/30 focus-visible:outline-none`,t&&`text-foreground`),children:[(0,v.jsx)(g,{className:`size-4 shrink-0 text-muted-foreground transition-colors group-hover:text-foreground`,"aria-hidden":`true`}),(0,v.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:e.item.title}),(0,v.jsx)(s,{className:a(`size-3.5 shrink-0 text-muted-foreground transition-transform group-hover:text-foreground`,n&&`rotate-90`),"aria-hidden":`true`})]}),n?(0,v.jsx)(`div`,{className:a(`ml-3 grid gap-0.5 border-l border-border/80 pl-3`,e.depth>0&&`ml-5`),children:(0,v.jsx)(x,{items:e.item.children,selectedPath:e.selectedPath,depth:e.depth+1})}):null]})}function C(e,t){return t===void 0?!1:e.type===`page`?e.page.path===t:e.children.some(e=>C(e,t))}function w(e){let t=a(`relative flex h-8 min-w-0 items-center gap-2 rounded-md px-2 text-left text-sm transition-state focus-visible:ring-[3px] focus-visible:ring-ring/30 focus-visible:outline-none`,e.selected?`bg-secondary text-foreground before:absolute before:inset-y-1 before:left-0 before:w-0.5 before:rounded-full before:bg-primary`:`text-muted-foreground hover:bg-secondary/70 hover:text-foreground`),n=(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(u,{className:a(`size-4 shrink-0 text-muted-foreground transition-colors`,e.selected&&`text-primary`),"aria-hidden":`true`}),(0,v.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:e.page.title})]});return e.page.path===``?(0,v.jsx)(r,{to:`/documentation`,"aria-current":e.selected?`page`:void 0,className:t,children:n}):(0,v.jsx)(r,{to:`/documentation/$`,params:{_splat:e.page.path},"aria-current":e.selected?`page`:void 0,className:t,children:n})}var T={h1({children:e}){return(0,v.jsx)(`h2`,{className:`mt-8 scroll-m-20 text-xl font-semibold tracking-tight first:mt-0`,children:e})},h2({children:e}){return(0,v.jsx)(`h2`,{className:`mt-8 scroll-m-20 border-t pt-6 text-lg font-semibold tracking-tight first:mt-0 first:border-t-0 first:pt-0`,children:e})},h3({children:e}){return(0,v.jsx)(`h3`,{className:`mt-6 scroll-m-20 text-base font-semibold tracking-tight`,children:e})},p({children:e}){return(0,v.jsx)(`p`,{className:`mt-4 text-sm leading-7 text-foreground`,children:e})},a({href:e,children:t}){let n=f(e);return n===void 0?(0,v.jsxs)(`a`,{href:e,target:e?.startsWith(`http`)?`_blank`:void 0,rel:e?.startsWith(`http`)?`noreferrer`:void 0,className:`inline-flex items-center gap-1 font-medium text-primary underline-offset-4 hover:underline`,children:[t,e?.startsWith(`http`)?(0,v.jsx)(l,{className:`size-3`,"aria-hidden":`true`}):null]}):n===``?(0,v.jsx)(r,{to:`/documentation`,className:`font-medium text-primary underline-offset-4 hover:underline`,children:t}):(0,v.jsx)(r,{to:`/documentation/$`,params:{_splat:n},className:`font-medium text-primary underline-offset-4 hover:underline`,children:t})},ul({children:e}){return(0,v.jsx)(`ul`,{className:`mt-4 grid gap-2 pl-5 text-sm`,children:e})},ol({children:e}){return(0,v.jsx)(`ol`,{className:`mt-4 grid list-decimal gap-3 pl-5 text-sm`,children:e})},li({children:e}){return(0,v.jsx)(`li`,{className:`pl-1 leading-7 marker:text-muted-foreground`,children:e})},code({children:e,className:t}){return t===void 0?(0,v.jsx)(`code`,{className:`rounded border bg-muted px-1.5 py-0.5 font-mono text-[0.85em] text-foreground`,children:e}):(0,v.jsx)(`code`,{className:a(`font-mono text-xs leading-6`,t),children:e})},pre({children:e}){return(0,v.jsx)(`pre`,{className:`mt-4 max-w-full overflow-x-auto rounded-lg border bg-muted/40 p-3 text-xs text-foreground`,children:e})},blockquote({children:e}){return(0,v.jsx)(`blockquote`,{className:`mt-4 border-l-2 pl-4 text-sm text-muted-foreground`,children:e})},table({children:e}){return(0,v.jsx)(`div`,{className:`mt-4 max-w-full overflow-x-auto rounded-lg border`,children:(0,v.jsx)(`table`,{className:`w-full border-collapse text-sm`,children:e})})},thead({children:e}){return(0,v.jsx)(`thead`,{className:`bg-muted/50`,children:e})},th({children:e}){return(0,v.jsx)(`th`,{className:`border-b px-3 py-2 text-left font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground`,children:e})},td({children:e}){return(0,v.jsx)(`td`,{className:`border-b px-3 py-2 align-top`,children:e})},hr(){return(0,v.jsx)(`hr`,{className:`my-8 border-border`})}};export{y as t};
@@ -1,3 +1,3 @@
1
- import{h as e,t,v as n}from"./react-DtOYBmep.js";import{t as r}from"./react-dom-DrIU40PY.js";import{r as i,t as a}from"./utils-CEE0-YEp.js";import{t as o}from"./file-text-DMdy8OfN.js";import{t as s}from"./lock-D4OhqEPW.js";import{t as c}from"./x-fKvnmCoQ.js";import{a as l}from"./dist-BtPw3IIV.js";import{A as u,F as d,G as f,H as p,I as m,K as ee,L as h,M as g,N as _,P as v,R as y,U as te,V as ne,W as re,ct as ie,it as ae,j as b,k as x,nt as oe,tt as se,z as S}from"./main-RzjfJZwD.js";import{n as C,t as w}from"./card-DSG3_teC.js";import{a as T,c as ce,d as E,f as D,i as le,l as ue,n as de,o as fe,r as O,t as pe,u as me}from"./bits-Cv0Te4iz.js";import{a as k,i as A,n as j,o as M,r as N,t as P}from"./table-DptQuuuq.js";import{t as he}from"./SandboxesLens-BUQQWmH6.js";var ge=i(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),_e=i(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),ve=i(`expand`,[[`path`,{d:`m15 15 6 6`,key:`1s409w`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}],[`path`,{d:`M21 16v5h-5`,key:`1ck2sf`}],[`path`,{d:`M21 8V3h-5`,key:`1qoq8a`}],[`path`,{d:`M3 16v5h5`,key:`1t08am`}],[`path`,{d:`m3 21 6-6`,key:`wwnumi`}],[`path`,{d:`M3 8V3h5`,key:`1ln10m`}],[`path`,{d:`M9 9 3 3`,key:`v551iv`}]]),ye=i(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),be=i(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),xe=i(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),F=n(t(),1),I=e(),L=`Tabs`,[Se,Ce]=y(L,[g]),we=g(),[Te,R]=Se(L),Ee=F.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=_(s),[d,f]=m({prop:r,onChange:i,defaultProp:a??``,caller:L});return(0,I.jsx)(Te,{scope:n,baseId:v(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,I.jsx)(S.div,{dir:u,"data-orientation":o,...l,ref:t})})});Ee.displayName=L;var De=`TabsList`,Oe=F.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=R(De,n),o=we(n);return(0,I.jsx)(b,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,I.jsx)(S.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});Oe.displayName=De;var ke=`TabsTrigger`,Ae=F.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=R(ke,n),s=we(n),c=Ne(o.baseId,r),l=Pe(o.baseId,r),d=r===o.value;return(0,I.jsx)(u,{asChild:!0,...s,focusable:!i,active:d,children:(0,I.jsx)(S.button,{type:`button`,role:`tab`,"aria-selected":d,"aria-controls":l,"data-state":d?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:h(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:h(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:h(e.onFocus,()=>{let e=o.activationMode!==`manual`;!d&&!i&&e&&o.onValueChange(r)})})})});Ae.displayName=ke;var je=`TabsContent`,Me=F.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=R(je,n),c=Ne(s.baseId,r),l=Pe(s.baseId,r),u=r===s.value,f=F.useRef(u);return F.useEffect(()=>{let e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,I.jsx)(d,{present:i||u,children:({present:n})=>(0,I.jsx)(S.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:f.current?`0s`:void 0},children:n&&a})})});Me.displayName=je;function Ne(e,t){return`${e}-trigger-${t}`}function Pe(e,t){return`${e}-content-${t}`}var Fe=Ee,Ie=Oe,Le=Ae,Re=Me;function ze({className:e,orientation:t=`horizontal`,...n}){return(0,I.jsx)(Fe,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:a(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var Be=l(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function Ve({className:e,variant:t=`default`,...n}){return(0,I.jsx)(Ie,{"data-slot":`tabs-list`,"data-variant":t,className:a(Be({variant:t}),e),...n})}function z({className:e,...t}){return(0,I.jsx)(Le,{"data-slot":`tabs-trigger`,className:a(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent`,`data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,e),...t})}function B({className:e,...t}){return(0,I.jsx)(Re,{"data-slot":`tabs-content`,className:a(`flex-1 outline-none`,e),...t})}var He=n(r(),1),V=192,H=60,U=248,W=76,Ue=2,We=18,Ge=16,Ke=1e4,G=new Set([`SUCCEEDED`,`FAILED`,`CANCELLED`]),qe=new Set([`CREATED`,`QUEUED`,`BLOCKED`]);function K(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m${String(t%60).padStart(2,`0`)}s`:`${Math.floor(n/60)}h${String(n%60).padStart(2,`0`)}m`}function Je(e){if(e.length===0)return{positions:new Map,width:0,height:0};let t=new Map(e.map(e=>[e.id,e])),n=new Map,r=new Set,i=e=>{let a=n.get(e);if(a!==void 0)return a;if(r.has(e))return 0;r.add(e);let o=t.get(e)?.deps.filter(e=>t.has(e))??[],s=o.length===0?0:1+Math.max(...o.map(e=>i(e)));return r.delete(e),n.set(e,s),s},a=[];for(let t of e){let e=i(t.id);for(;a.length<=e;)a.push([]);a[e]?.push(t.id)}let o=new Map;for(let e of a){let n=e=>{let n=(t.get(e)?.deps??[]).map(e=>o.get(e)).filter(e=>e!==void 0).sort((e,t)=>e-t);return n[Math.floor((n.length-1)/2)]??2**53-1};e.sort((e,t)=>n(e)-n(t)||e.localeCompare(t)),e.forEach((e,t)=>{o.set(e,t)})}let s=Math.max(1,...a.map(e=>e.length)),c=new Map;return a.forEach((e,t)=>{let n=(s-e.length)*W/2;e.forEach((e,r)=>{c.set(e,{x:t*U,y:r*W+n})})}),{positions:c,width:(a.length-1)*U+V,height:(s-1)*W+H}}function Ye(e,t){return Xe(e,t)>=2&&Math.abs(t.y-e.y)<W*.5}function Xe(e,t){return Math.max(1,Math.round((t.x-e.x)/U))}function Ze(e,t,n){let r=e.x+V,i=e.y+H/2,a=t.x,o=t.y+H/2;if(n!==null){let s=Math.min(e.y,t.y)-n,c=Math.min(40,(a-r)/2-8),l=r+c,u=a-c,d=c*.6;return`M ${r} ${i} C ${r+d} ${i}, ${l-d} ${s}, ${l} ${s} L ${u} ${s} C ${u+d} ${s}, ${a-d} ${o}, ${a} ${o}`}let s=Math.max(16,Math.min(90,(a-r)*.45));return`M ${r} ${i} C ${r+s} ${i}, ${a-s} ${o}, ${a} ${o}`}function Qe(e){let t=e===``?[]:e.split(`
1
+ import{h as e,t,v as n}from"./react-DtOYBmep.js";import{t as r}from"./react-dom-DrIU40PY.js";import{r as i,t as a}from"./utils-CEE0-YEp.js";import{t as o}from"./file-text-DMdy8OfN.js";import{t as s}from"./lock-D4OhqEPW.js";import{t as c}from"./x-fKvnmCoQ.js";import{a as l}from"./dist-BtPw3IIV.js";import{A as u,F as d,G as f,H as p,I as m,K as ee,L as h,M as g,N as _,P as v,R as y,U as te,V as ne,W as re,ct as ie,it as ae,j as b,k as x,nt as oe,tt as se,z as S}from"./main-KBvz0mSQ.js";import{n as C,t as w}from"./card-DSG3_teC.js";import{a as T,c as ce,d as E,f as D,i as le,l as ue,n as de,o as fe,r as O,t as pe,u as me}from"./bits-Cv0Te4iz.js";import{a as k,i as A,n as j,o as M,r as N,t as P}from"./table-DptQuuuq.js";import{t as he}from"./SandboxesLens-BUQQWmH6.js";var ge=i(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),_e=i(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),ve=i(`expand`,[[`path`,{d:`m15 15 6 6`,key:`1s409w`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}],[`path`,{d:`M21 16v5h-5`,key:`1ck2sf`}],[`path`,{d:`M21 8V3h-5`,key:`1qoq8a`}],[`path`,{d:`M3 16v5h5`,key:`1t08am`}],[`path`,{d:`m3 21 6-6`,key:`wwnumi`}],[`path`,{d:`M3 8V3h5`,key:`1ln10m`}],[`path`,{d:`M9 9 3 3`,key:`v551iv`}]]),ye=i(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),be=i(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),xe=i(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),F=n(t(),1),I=e(),L=`Tabs`,[Se,Ce]=y(L,[g]),we=g(),[Te,R]=Se(L),Ee=F.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=_(s),[d,f]=m({prop:r,onChange:i,defaultProp:a??``,caller:L});return(0,I.jsx)(Te,{scope:n,baseId:v(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,I.jsx)(S.div,{dir:u,"data-orientation":o,...l,ref:t})})});Ee.displayName=L;var De=`TabsList`,Oe=F.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=R(De,n),o=we(n);return(0,I.jsx)(b,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,I.jsx)(S.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});Oe.displayName=De;var ke=`TabsTrigger`,Ae=F.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=R(ke,n),s=we(n),c=Ne(o.baseId,r),l=Pe(o.baseId,r),d=r===o.value;return(0,I.jsx)(u,{asChild:!0,...s,focusable:!i,active:d,children:(0,I.jsx)(S.button,{type:`button`,role:`tab`,"aria-selected":d,"aria-controls":l,"data-state":d?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:h(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:h(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:h(e.onFocus,()=>{let e=o.activationMode!==`manual`;!d&&!i&&e&&o.onValueChange(r)})})})});Ae.displayName=ke;var je=`TabsContent`,Me=F.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=R(je,n),c=Ne(s.baseId,r),l=Pe(s.baseId,r),u=r===s.value,f=F.useRef(u);return F.useEffect(()=>{let e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,I.jsx)(d,{present:i||u,children:({present:n})=>(0,I.jsx)(S.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:f.current?`0s`:void 0},children:n&&a})})});Me.displayName=je;function Ne(e,t){return`${e}-trigger-${t}`}function Pe(e,t){return`${e}-content-${t}`}var Fe=Ee,Ie=Oe,Le=Ae,Re=Me;function ze({className:e,orientation:t=`horizontal`,...n}){return(0,I.jsx)(Fe,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:a(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var Be=l(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function Ve({className:e,variant:t=`default`,...n}){return(0,I.jsx)(Ie,{"data-slot":`tabs-list`,"data-variant":t,className:a(Be({variant:t}),e),...n})}function z({className:e,...t}){return(0,I.jsx)(Le,{"data-slot":`tabs-trigger`,className:a(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent`,`data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,e),...t})}function B({className:e,...t}){return(0,I.jsx)(Re,{"data-slot":`tabs-content`,className:a(`flex-1 outline-none`,e),...t})}var He=n(r(),1),V=192,H=60,U=248,W=76,Ue=2,We=18,Ge=16,Ke=1e4,G=new Set([`SUCCEEDED`,`FAILED`,`CANCELLED`]),qe=new Set([`CREATED`,`QUEUED`,`BLOCKED`]);function K(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m${String(t%60).padStart(2,`0`)}s`:`${Math.floor(n/60)}h${String(n%60).padStart(2,`0`)}m`}function Je(e){if(e.length===0)return{positions:new Map,width:0,height:0};let t=new Map(e.map(e=>[e.id,e])),n=new Map,r=new Set,i=e=>{let a=n.get(e);if(a!==void 0)return a;if(r.has(e))return 0;r.add(e);let o=t.get(e)?.deps.filter(e=>t.has(e))??[],s=o.length===0?0:1+Math.max(...o.map(e=>i(e)));return r.delete(e),n.set(e,s),s},a=[];for(let t of e){let e=i(t.id);for(;a.length<=e;)a.push([]);a[e]?.push(t.id)}let o=new Map;for(let e of a){let n=e=>{let n=(t.get(e)?.deps??[]).map(e=>o.get(e)).filter(e=>e!==void 0).sort((e,t)=>e-t);return n[Math.floor((n.length-1)/2)]??2**53-1};e.sort((e,t)=>n(e)-n(t)||e.localeCompare(t)),e.forEach((e,t)=>{o.set(e,t)})}let s=Math.max(1,...a.map(e=>e.length)),c=new Map;return a.forEach((e,t)=>{let n=(s-e.length)*W/2;e.forEach((e,r)=>{c.set(e,{x:t*U,y:r*W+n})})}),{positions:c,width:(a.length-1)*U+V,height:(s-1)*W+H}}function Ye(e,t){return Xe(e,t)>=2&&Math.abs(t.y-e.y)<W*.5}function Xe(e,t){return Math.max(1,Math.round((t.x-e.x)/U))}function Ze(e,t,n){let r=e.x+V,i=e.y+H/2,a=t.x,o=t.y+H/2;if(n!==null){let s=Math.min(e.y,t.y)-n,c=Math.min(40,(a-r)/2-8),l=r+c,u=a-c,d=c*.6;return`M ${r} ${i} C ${r+d} ${i}, ${l-d} ${s}, ${l} ${s} L ${u} ${s} C ${u+d} ${s}, ${a-d} ${o}, ${a} ${o}`}let s=Math.max(16,Math.min(90,(a-r)*.45));return`M ${r} ${i} C ${r+s} ${i}, ${a-s} ${o}, ${a} ${o}`}function Qe(e){let t=e===``?[]:e.split(`
2
2
  `).map(e=>{let[t=``,n=``]=e.split(`>`);return{id:t,deps:n===``?[]:n.split(`,`)}}),n=Je(t),r=new Map,i=new Map,a=[];for(let e of t){let t=e.deps.filter(e=>n.positions.has(e)),o=[];for(let r of t){let t=n.positions.get(r),s=n.positions.get(e.id);if(t===void 0||s===void 0||Xe(t,s)>Ue)continue;o.push(r);let c=i.get(r);c===void 0?i.set(r,[e.id]):c.push(e.id),a.push({source:r,target:e.id,from:t,to:s})}r.set(e.id,o)}let o=new Map,s=[],c=a.map((e,t)=>({edge:e,index:t})).filter(e=>Ye(e.edge.from,e.edge.to)).sort((e,t)=>e.edge.from.x-t.edge.from.x||e.edge.to.x-t.edge.to.x);for(let{edge:e,index:t}of c){let n=e.from.x+V,r=s.findIndex(e=>e<=n);r===-1&&(r=s.length),s[r]=e.to.x,o.set(t,We+r*Ge)}let l=0;for(let{edge:e,index:t}of c){let n=o.get(t)??0;l=Math.max(l,n-Math.min(e.from.y,e.to.y))}l=l>0?Math.ceil(l)+6:0;let u=l===0?n.positions:new Map(Array.from(n.positions,([e,t])=>[e,{x:t.x,y:t.y+l}]));return{layout:{...n,positions:u,height:n.height+l},edges:a.map((e,t)=>({key:`${e.source}->${e.target}`,source:e.source,target:e.target,d:Ze({x:e.from.x,y:e.from.y+l},{x:e.to.x,y:e.to.y+l},o.get(t)??null)})),parents:r,children:i}}function q(e,t){let n=new Set,r=[...t.get(e)??[]];for(;r.length>0;){let e=r.pop();if(!(e===void 0||n.has(e))){n.add(e);for(let i of t.get(e)??[])n.has(i)||r.push(i)}}return n}function $e(e){let[t,n]=(0,F.useState)(null),[r,i]=(0,F.useState)(!1),[a,o]=(0,F.useState)(new Map),[s,c]=(0,F.useState)(new Map),l=(0,F.useRef)(null),u=e.tasks.map(e=>`${e.taskId}>${e.dependsOn.join(`,`)}`).join(`
3
3
  `),d=(0,F.useMemo)(()=>Qe(u),[u]);(0,F.useEffect)(()=>{let t=l.current;if(l.current=new Map(e.tasks.map(e=>[e.taskId,e.status])),t===null)return;let n=[],r=[];for(let i of e.tasks){let e=t.get(i.taskId);e===void 0||e===i.status||(i.status===`SUCCEEDED`&&n.push(i.taskId),G.has(i.status)&&r.push(i.taskId))}if(r.length>0){let e=Date.now();c(t=>{let n=new Map(t);for(let t of r)n.set(t,e);return n})}if(n.length>0){let e=Date.now();o(t=>{let r=new Map(t);for(let t of n)r.set(t,e);return r}),setTimeout(()=>{o(t=>{let r=new Map(t);for(let t of n)r.get(t)===e&&r.delete(t);return r})},800)}},[e.tasks]);let f=(0,F.useMemo)(()=>{let t=new Set;for(let n of e.tasks)if(n.status===`FAILED`)for(let e of q(n.taskId,d.children))t.add(e);return t},[e.tasks,d]),p=e.selectedTaskId??t,m=(0,F.useMemo)(()=>{if(p===null||!d.layout.positions.has(p))return null;let e=new Set([p]);for(let t of q(p,d.parents))e.add(t);for(let t of q(p,d.children))e.add(t);return e},[p,d]);if(e.pending)return(0,I.jsx)(ut,{});if(e.tasks.length===0)return(0,I.jsx)(`p`,{className:`py-6 text-center text-sm text-muted-foreground`,children:`No tasks in this run.`});let ee=new Map(e.tasks.map(e=>[e.taskId,e.status])),h=Date.now(),g=(0,I.jsx)(et,{graph:d,tasks:e.tasks,ordinals:e.ordinals,now:h,statusById:ee,ignitions:a,terminalFlashes:s,blastSet:f,focusSet:m,selectedTaskId:e.selectedTaskId,onSelect:e.onSelect,onHover:n});return(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`sr-only`,children:`Task dependency map. The manifest table below lists the same tasks.`}),(0,I.jsx)(nt,{width:d.layout.width,height:d.layout.height,onExpand:()=>i(!0),collapsed:r,children:g}),r?(0,I.jsx)(rt,{width:d.layout.width,height:d.layout.height,onClose:()=>i(!1),children:g}):null]})}function et(e){let{graph:t,statusById:n,focusSet:r,blastSet:i}=e,a=e=>{let t=n.get(e);if(t===void 0)throw Error(`DAG edge references missing task ${e}`);return t};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`svg`,{"aria-hidden":`true`,className:`absolute inset-0 overflow-visible`,width:t.layout.width,height:t.layout.height,children:t.edges.map(t=>(0,I.jsx)(at,{edge:t,sourceStatus:a(t.source),targetStatus:a(t.target),igniteNonce:e.ignitions.get(t.source),blast:n.get(t.source)===`FAILED`||i.has(t.source),dimmed:r!==null&&!(r.has(t.source)&&r.has(t.target))},t.key))}),e.tasks.map((n,a)=>{let o=t.layout.positions.get(n.taskId);return o===void 0?null:(0,I.jsx)(ct,{task:n,ordinal:e.ordinals.get(n.taskId)??a+1,x:o.x,y:o.y,now:e.now,flashNonce:e.terminalFlashes.get(n.taskId),dimmed:r!==null&&!r.has(n.taskId),blast:i.has(n.taskId),selected:e.selectedTaskId===n.taskId,onSelect:e.onSelect,onHover:e.onHover},n.taskId)})]})}var J={backgroundImage:`radial-gradient(var(--border) 1px, transparent 1px)`,backgroundSize:`24px 24px`};function tt(e,t,n){return Math.min(n,Math.max(t,e))}function nt(e){return e.collapsed?(0,I.jsxs)(`div`,{className:`flex min-h-[420px] w-full min-w-0 flex-col items-center justify-center gap-2 rounded-lg border bg-card/40 text-sm text-muted-foreground`,style:J,children:[(0,I.jsx)(ve,{className:`size-5`,"aria-hidden":!0}),(0,I.jsx)(`span`,{children:`Dependency map open in fullscreen — press Esc to return`})]}):(0,I.jsxs)(`div`,{className:`relative h-[min(56vh,34rem)] min-h-[420px] w-full min-w-0 rounded-lg border bg-card/40`,children:[e.onExpand?(0,I.jsx)(`button`,{type:`button`,"aria-label":`Open dependency map in fullscreen`,onClick:e.onExpand,className:`absolute top-3 right-3 z-10 flex size-8 items-center justify-center rounded-md border bg-card/80 text-muted-foreground backdrop-blur transition-state hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,I.jsx)(ve,{className:`size-4`,"aria-hidden":!0})}):null,(0,I.jsx)(`div`,{className:`flex size-full min-w-0 overflow-auto overscroll-contain rounded-lg p-6`,style:J,children:(0,I.jsx)(`div`,{className:`relative m-auto shrink-0`,style:{width:e.width,height:e.height},children:e.children})})]})}function rt(e){let{onClose:t}=e;return(0,F.useEffect)(()=>{let e=e=>{e.key===`Escape`&&t()};window.addEventListener(`keydown`,e);let n=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{window.removeEventListener(`keydown`,e),document.body.style.overflow=n}},[t]),(0,He.createPortal)((0,I.jsx)(`div`,{className:`fixed inset-0 z-50 bg-background/95 backdrop-blur-sm`,children:(0,I.jsx)(it,{width:e.width,height:e.height,onClose:t,children:e.children})}),document.body)}function it(e){let t=(0,F.useRef)(null),[n,r]=(0,F.useState)({scale:1,x:0,y:0}),i=(0,F.useRef)(null),a=(0,F.useCallback)(()=>{let n=t.current;if(!n)return;let i=tt(Math.min((n.clientWidth-80)/e.width,(n.clientHeight-80)/e.height),.1,1.6);r({scale:i,x:(n.clientWidth-e.width*i)/2,y:(n.clientHeight-e.height*i)/2})},[e.width,e.height]);(0,F.useEffect)(()=>{a()},[a]);let o=(e,t,n)=>{r(r=>{let i=tt(r.scale*e,.1,4),a=i/r.scale;return{scale:i,x:t-(t-r.x)*a,y:n-(n-r.y)*a}})},s=e=>{let n=t.current;if(!n)return;let r=n.getBoundingClientRect();o(Math.exp(-e.deltaY*.0015),e.clientX-r.left,e.clientY-r.top)},l=e=>{let n=t.current;n&&o(e,n.clientWidth/2,n.clientHeight/2)},u=e=>{e.button===0&&(e.target instanceof Element&&e.target.closest(`button`)!==null||(i.current={px:e.clientX,py:e.clientY,ox:n.x,oy:n.y},e.currentTarget.setPointerCapture(e.pointerId)))},d=e=>{let t=i.current;t&&r(n=>({...n,x:t.ox+(e.clientX-t.px),y:t.oy+(e.clientY-t.py)}))},f=()=>{i.current=null};return(0,I.jsxs)(`div`,{ref:t,className:`absolute inset-0 cursor-grab touch-none overflow-hidden active:cursor-grabbing`,style:J,onWheel:s,onPointerDown:u,onPointerMove:d,onPointerUp:f,onPointerLeave:f,children:[(0,I.jsx)(`div`,{style:{transform:`translate(${n.x}px, ${n.y}px) scale(${n.scale})`,transformOrigin:`0 0`},children:(0,I.jsx)(`div`,{className:`relative`,style:{width:e.width,height:e.height},children:e.children})}),(0,I.jsxs)(`div`,{className:`absolute top-4 right-4 flex items-center gap-1.5`,onPointerDown:e=>e.stopPropagation(),children:[(0,I.jsx)(Y,{label:`Zoom out`,onClick:()=>l(1/1.2),children:(0,I.jsx)(xe,{className:`size-4`,"aria-hidden":!0})}),(0,I.jsxs)(`span`,{className:`w-11 text-center font-mono text-xs text-muted-foreground`,"data-num":!0,children:[Math.round(n.scale*100),`%`]}),(0,I.jsx)(Y,{label:`Zoom in`,onClick:()=>l(1.2),children:(0,I.jsx)(be,{className:`size-4`,"aria-hidden":!0})}),(0,I.jsx)(Y,{label:`Fit to screen`,onClick:a,children:(0,I.jsx)(ye,{className:`size-4`,"aria-hidden":!0})}),(0,I.jsx)(Y,{label:`Close fullscreen`,onClick:e.onClose,children:(0,I.jsx)(c,{className:`size-4`,"aria-hidden":!0})})]}),(0,I.jsx)(`div`,{className:`pointer-events-none absolute bottom-4 left-4 font-mono text-[11px] text-muted-foreground/70`,children:`scroll to zoom · drag to pan · esc to close`})]})}function Y(e){return(0,I.jsx)(`button`,{type:`button`,"aria-label":e.label,onClick:e.onClick,className:`flex size-8 items-center justify-center rounded-md border bg-card text-muted-foreground transition-state hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:e.children})}function at(e){let t=e.dimmed?.35:void 0,n={d:e.edge.d,fill:`none`};return e.blast?(0,I.jsx)(`path`,{...n,strokeWidth:1.5,className:`stroke-status-failed transition-state`,style:{opacity:t??.4}}):e.targetStatus===`RUNNING`?(0,I.jsx)(`path`,{...n,strokeWidth:2,className:`edge-flow stroke-status-running transition-state`,style:{...le(e.edge.key,1200),opacity:t??1}}):e.igniteNonce===void 0?e.sourceStatus===`SUCCEEDED`&&G.has(e.targetStatus)?(0,I.jsx)(`path`,{...n,strokeWidth:1.5,className:`stroke-status-succeeded transition-state`,style:{opacity:t??.5}}):G.has(e.sourceStatus)&&qe.has(e.targetStatus)?(0,I.jsx)(`path`,{...n,strokeWidth:1.5,className:`stroke-status-idle transition-state`,style:{opacity:t??1}}):(0,I.jsx)(`path`,{...n,strokeWidth:1.5,strokeDasharray:`4 6`,className:`stroke-border transition-state`,style:{opacity:t??.4}}):(0,F.createElement)(`path`,{...n,key:`${e.edge.key}:${e.igniteNonce}`,strokeWidth:2,pathLength:1,className:`edge-ignite stroke-status-succeeded`,style:{opacity:t??1}})}var ot={RUNNING:`border-status-running bg-status-running/5`,SUCCEEDED:`border-l-status-succeeded`,FAILED:`border-status-failed`,CANCELLED:`border-status-warn`,QUEUED:`border-dashed border-status-idle/60 bg-transparent text-muted-foreground`,CREATED:`border-dashed border-status-idle/60 bg-transparent text-muted-foreground`,BLOCKED:`border-dashed border-status-blocked/60 bg-transparent text-muted-foreground`},st={SUCCEEDED:`var(--status-succeeded)`,FAILED:`var(--status-failed)`,CANCELLED:`var(--status-warn)`};function ct(e){let t=e.task,n=t.status.toUpperCase(),r=n===`RUNNING`,i=T(t),o=t.assignmentHeartbeatAt,s=r&&o!==void 0&&e.now-Date.parse(o)>Ke,c=e.dimmed?.35:e.blast?.4:n===`CANCELLED`?.7:1,l=t.assignedSandboxId??t.lastSandboxId,u=l??t.agentId,d=`text-muted-foreground`;n===`FAILED`?(u=t.error?.code??`FAILED`,d=`text-status-failed`):r&&t.startedAt!==void 0?u=`${l??t.agentId} · ${K(e.now-Date.parse(t.startedAt))}`:n===`SUCCEEDED`&&t.startedAt!==void 0&&t.completedAt!==void 0&&(u=`${l??t.agentId} · ${K(Date.parse(t.completedAt)-Date.parse(t.startedAt))}`);let f={left:e.x,top:e.y,width:V,height:H,opacity:c,...r?le(t.taskId):void 0,...s?{"--glow-level":.3}:void 0};return(0,I.jsxs)(`button`,{type:`button`,className:a(`absolute rounded-md border border-l-2 bg-card px-2.5 py-1.5 text-left transition-state`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,ot[n]??`border-status-idle/60 text-muted-foreground`,r&&`glow`,r&&!s&&`pulse-running`,e.selected&&`ring-1 ring-ring`),style:f,onClick:()=>e.onSelect(t.taskId),onMouseEnter:()=>e.onHover(t.taskId),onMouseLeave:()=>e.onHover(null),onFocus:()=>e.onHover(t.taskId),onBlur:()=>e.onHover(null),children:[(0,I.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(lt,{status:n}),(0,I.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] text-muted-foreground`,"data-num":!0,children:[`#`,e.ordinal]}),(0,I.jsx)(`span`,{className:a(`min-w-0 flex-1 truncate`,i===void 0?`font-mono text-[11px]`:`text-xs font-medium`),children:i??t.taskId}),(t.currentAttemptNumber??1)>1?(0,I.jsxs)(`span`,{className:`shrink-0 rounded-sm border border-status-warn/50 px-1 font-mono text-[9px] leading-4 text-status-warn`,"data-num":!0,children:[`A`,t.currentAttemptNumber,t.maxAttempts===void 0?``:`/${t.maxAttempts}`]}):null]}),(0,I.jsx)(`span`,{className:a(`mt-1 block truncate font-mono text-[10px]`,d),"data-num":!0,children:u}),r?(0,I.jsx)(`span`,{"aria-hidden":!0,className:a(`absolute top-1.5 right-1.5 size-1 rounded-full`,s?`bg-status-warn`:`bg-status-running`),children:!s&&o!==void 0?(0,I.jsx)(`span`,{className:`blip absolute inset-0 rounded-full border border-status-running`},o):null}):null,e.flashNonce===void 0?null:(0,I.jsx)(`span`,{"aria-hidden":!0,className:`glow flash-terminal pointer-events-none absolute inset-0 rounded-md`,style:{"--glow-color":st[n]??`var(--status-idle)`}},e.flashNonce)]})}function lt(e){switch(e.status){case`RUNNING`:return(0,I.jsx)(ae,{className:`size-3.5 shrink-0 animate-spin text-status-running`});case`SUCCEEDED`:return(0,I.jsx)(`svg`,{viewBox:`0 0 16 16`,className:`size-3.5 shrink-0`,fill:`none`,"aria-hidden":`true`,children:(0,I.jsx)(`path`,{d:`M3 8.5 6.5 12 13 4.5`,pathLength:1,className:`stroke-draw stroke-status-succeeded`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})});case`FAILED`:return(0,I.jsx)(c,{className:`size-3.5 shrink-0 text-status-failed`});case`CANCELLED`:return(0,I.jsx)(c,{className:`size-3.5 shrink-0 text-status-warn`});case`BLOCKED`:return(0,I.jsx)(s,{className:`size-3.5 shrink-0 text-status-blocked`});default:return(0,I.jsx)(ge,{className:`size-3.5 shrink-0 text-status-idle`})}}var X=[{x:0,y:W},{x:U,y:0},{x:U,y:W*2}];function ut(){return(0,I.jsxs)(nt,{width:440,height:212,children:[(0,I.jsx)(`svg`,{"aria-hidden":`true`,className:`absolute inset-0 overflow-visible`,width:440,height:212,children:[X[1],X[2]].map(e=>e!==void 0&&X[0]!==void 0?(0,I.jsx)(`path`,{d:Ze(X[0],e,null),fill:`none`,strokeWidth:1.5,strokeDasharray:`4 6`,className:`stroke-border`,opacity:.6},e.y):null)}),X.map(e=>(0,I.jsxs)(`div`,{className:`absolute rounded-md border border-dashed`,style:{left:e.x,top:e.y,width:V,height:H},children:[(0,I.jsx)(`div`,{className:`mx-2.5 mt-3.5 h-2 w-24 rounded-sm bg-muted`}),(0,I.jsx)(`div`,{className:`mx-2.5 mt-2 h-2 w-16 rounded-sm bg-muted/60`})]},`${e.x}:${e.y}`))]})}function dt(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function Z(e){return e===void 0?`—`:e<1e3?`${Math.round(e)}ms`:K(e)}function ft(e){if(e.error!==null)return(0,I.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`Cannot load metrics: `,e.error]});let t=e.metrics;if(t===void 0)return(0,I.jsx)(E,{className:`h-40 w-full`});let n=[{label:`TASK LATENCY`,dist:t.timing?.taskLatencyMs},{label:`QUEUE WAIT`,dist:t.timing?.queueWaitMs},{label:`ASSIGNMENT`,dist:t.timing?.assignmentDurationMs}],r=Math.max(1,...n.map(e=>e.dist?.max??0)),i=t.timing?.runDurationMs;return(0,I.jsxs)(`div`,{className:`grid gap-4`,children:[(0,I.jsxs)(`div`,{className:`grid gap-4 rounded-lg border bg-card p-4`,children:[(0,I.jsx)(`h3`,{className:`console-callout`,children:`Latency distributions`}),n.map(e=>(0,I.jsx)(pt,{label:e.label,dist:e.dist,scaleMax:r},e.label))]}),(0,I.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-3`,children:[(0,I.jsx)(mt,{label:`Success rate`,rate:t.tasks?.successRate}),(0,I.jsx)(mt,{label:`Locality hit`,rate:t.locality?.localityHitRate}),(0,I.jsx)(mt,{label:`Compliance`,rate:t.policy?.complianceRate})]}),(0,I.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 lg:grid-cols-4`,children:[(0,I.jsx)(Q,{label:`Bytes moved`,value:dt(t.artifacts?.bytesTransferred??0)}),(0,I.jsx)(Q,{label:`Movements`,value:String(t.artifacts?.movementCount??0)}),(0,I.jsx)(Q,{label:`Policy denials`,value:String(t.policy?.denialCount??0)}),(0,I.jsx)(Q,{label:`Run duration`,value:typeof i==`number`?K(i):`—`})]})]})}function pt(e){let t=e.dist?.count??0,n=e.dist?.min,r=e.dist?.max,i=e.dist!==void 0&&t>0?e.dist.total/t:void 0,a=t=>e.scaleMax>0?Math.min(100,t/e.scaleMax*100):0;return(0,I.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,I.jsx)(`span`,{className:`console-callout`,children:e.label}),(0,I.jsxs)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,"data-num":!0,children:[t,` SAMPLES`]})]}),(0,I.jsxs)(`div`,{className:`relative h-2 rounded-full bg-muted`,children:[n!==void 0&&r!==void 0?(0,I.jsx)(`div`,{className:`absolute inset-y-0 rounded-full bg-primary/30 transition-all duration-500 ease-out-fast`,style:{left:`${a(n)}%`,width:`${Math.max(a(r)-a(n),.5)}%`}}):null,i===void 0?null:(0,I.jsx)(`div`,{className:`absolute inset-y-0 w-[3px] rounded-full bg-primary transition-all duration-500 ease-out-fast`,style:{left:`calc(${a(i)}% - 1.5px)`}})]}),(0,I.jsxs)(`div`,{className:`flex justify-between font-mono text-[10px] text-muted-foreground`,"data-num":!0,children:[(0,I.jsx)(`span`,{children:Z(n)}),(0,I.jsxs)(`span`,{children:[`μ `,Z(i)]}),(0,I.jsx)(`span`,{children:Z(r)})]})]})}function mt(e){let t=e.rate===void 0?void 0:Math.round(Math.min(1,Math.max(0,e.rate))*100);return(0,I.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border bg-card px-4 py-3`,children:[(0,I.jsxs)(`div`,{className:`relative size-11 shrink-0`,children:[(0,I.jsxs)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 44 44`,className:`size-11 -rotate-90`,children:[(0,I.jsx)(`circle`,{cx:22,cy:22,r:19,fill:`none`,strokeWidth:4,className:`stroke-muted`}),(0,I.jsx)(`circle`,{cx:22,cy:22,r:19,fill:`none`,strokeWidth:4,strokeLinecap:`round`,pathLength:100,strokeDasharray:100,strokeDashoffset:100-(t??0),className:a(`transition-[stroke-dashoffset] duration-500 ease-out-fast`,(t??0)>=90?`stroke-status-succeeded`:`stroke-status-warn`)})]}),(0,I.jsx)(`span`,{className:`absolute inset-0 grid place-items-center font-mono text-[10px]`,"data-num":!0,children:t===void 0?`—`:`${t}%`})]}),(0,I.jsx)(`span`,{className:`console-callout`,children:e.label})]})}function Q(e){return(0,I.jsxs)(`div`,{className:`rounded-lg border bg-card px-4 py-3`,"data-flash":me(e.value),children:[(0,I.jsx)(`div`,{className:`console-callout`,children:e.label}),(0,I.jsx)(`div`,{className:`mt-1 font-mono text-xl font-medium`,"data-num":!0,children:e.value})]})}var ht=new Set([`SUCCEEDED`,`FAILED`,`CANCELLED`]),gt={RUNNING:`bg-status-running`,SUCCEEDED:`bg-status-succeeded`,FAILED:`bg-status-failed`,CANCELLED:`bg-status-warn`},_t=`repeating-linear-gradient(45deg, var(--status-idle) 0 3px, transparent 3px 6px)`,vt=`grid-cols-[minmax(8rem,12rem)_1fr_4.5rem]`;function $(e){if(e===void 0)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function yt(e){let t=(0,F.useMemo)(()=>{let t=e.tasks.map(e=>({task:e,queuedAt:$(e.queuedAt??e.createdAt),startedAt:$(e.startedAt),completedAt:$(e.completedAt)}));t.sort((e,t)=>(e.startedAt??e.queuedAt??2**53-1)-(t.startedAt??t.queuedAt??2**53-1)||e.task.taskId.localeCompare(t.task.taskId));let n=$(e.runCreatedAt)??2**53-1,r=0;for(let e of t)n=Math.min(n,e.queuedAt??e.startedAt??n),r=Math.max(r,e.completedAt??e.startedAt??e.queuedAt??0);return n===2**53-1&&(n=r>0?r:Date.now()),{rows:t,start:n,end:r}},[e.tasks,e.runCreatedAt]);if(e.pending)return(0,I.jsx)(`div`,{className:`rounded-lg border bg-card/40 p-4`,children:(0,I.jsx)(`div`,{className:`grid gap-2.5`,children:[0,1,2].map(e=>(0,I.jsxs)(`div`,{className:a(`grid items-center gap-3 px-1.5`,vt),children:[(0,I.jsx)(`div`,{className:`h-3 w-24 rounded-sm bg-muted`}),(0,I.jsx)(`div`,{className:`h-2 rounded-sm bg-muted/50`}),(0,I.jsx)(`div`,{className:`h-3 w-10 justify-self-end rounded-sm bg-muted`})]},e))})});if(t.rows.length===0)return(0,I.jsx)(`p`,{className:`py-6 text-center text-sm text-muted-foreground`,children:`No tasks in this run.`});let n=Date.now(),r=e.runActive?Math.max(t.end,n):Math.max(t.end,t.start+1),i=Math.max(1,r-t.start),o=e=>(e-t.start)/i*100;return(0,I.jsx)(`div`,{className:`rounded-lg border bg-card/40 p-4`,children:(0,I.jsx)(`div`,{className:`grid gap-1`,children:t.rows.map(t=>{let r=t.task.status,i=ht.has(r),s=t.startedAt??(i?t.completedAt??t.queuedAt:n),c=t.completedAt??(t.startedAt===void 0?void 0:n),l=t.startedAt!==void 0&&c!==void 0?c-t.startedAt:void 0;return(0,I.jsxs)(`button`,{type:`button`,onClick:()=>e.onSelect(t.task.taskId),className:a(`grid w-full items-center gap-3 rounded-sm px-1.5 py-0.5 text-left hover:bg-accent/50`,vt),children:[(0,I.jsx)(`span`,{className:`truncate font-mono text-[11px]`,children:T(t.task)??t.task.taskId}),(0,I.jsxs)(`span`,{className:`relative block h-4`,children:[t.queuedAt!==void 0&&s!==void 0&&s>t.queuedAt?(0,I.jsx)(`span`,{className:`absolute inset-y-1 rounded-[1px]`,style:{left:`${o(t.queuedAt)}%`,width:`${Math.max(o(s)-o(t.queuedAt),.3)}%`,backgroundImage:_t}}):null,t.startedAt!==void 0&&c!==void 0?(0,I.jsx)(`span`,{className:a(`absolute inset-y-0.5 rounded-[2px]`,gt[r]??`bg-status-idle`),style:{left:`${o(t.startedAt)}%`,width:`${Math.max(o(c)-o(t.startedAt),.4)}%`}}):null]}),(0,I.jsx)(`span`,{className:`text-right font-mono text-[10px] text-muted-foreground`,"data-num":!0,children:l===void 0?`—`:K(l)})]},t.task.taskId)})})})}var bt=[`SUCCEEDED`,`FAILED`,`CANCELLED`],xt=new Set([`SUCCEEDED`,`FAILED`,`CANCELLED`,`STALLED`]),St=40;function Ct(e){if(e===void 0)return;let t=Date.parse(e.createdAt),n=e.completedAt===void 0?xt.has(e.state)?Date.parse(e.updatedAt):Date.now():Date.parse(e.completedAt);return Number.isFinite(t)&&Number.isFinite(n)?n-t:void 0}function wt(e){let t=p(e.runId),n=ee(e.runId),r=te(e.runId),i=f(e.runId),a=re(e.runId),o=ne(),s=ie(),c=e.view,[l,u]=(0,F.useState)(null),[d,m]=(0,F.useState)(null),h=t.data?.state===`RUNNING`;ue(h?1e3:3e4);let g=n.data?.tasks??[],_=fe(g),v=t=>s({to:`/runs/$runId/t/$taskId`,params:{runId:e.runId,taskId:t}}),y={};if(g.length>0)for(let e of g)y[e.status]=(y[e.status]??0)+1;else t.data?.taskStatusCounts!==void 0&&Object.assign(y,t.data.taskStatusCounts);let ae=Object.values(y).reduce((e,t)=>e+t,0),b=bt.reduce((e,t)=>e+(y[t]??0),0),x=me(b),S=Ct(t.data),C=l??g.length<=St,w=t.data!==void 0&&xt.has(t.data.state);async function T(){if(t.data!==void 0&&window.confirm(`Delete "${t.data.name}" from run history?`)){m(null);try{await o.mutateAsync(e.runId),s({to:`/runs`})}catch(e){m(e instanceof Error?e.message:`Failed to delete run`)}}}return(0,I.jsxs)(`section`,{className:`grid gap-5`,children:[(0,I.jsxs)(`div`,{className:`grid gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2`,children:[(0,I.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:t.data?.name??e.runId}),t.data?(0,I.jsx)(pe,{state:t.data.state,id:e.runId}):null,(0,I.jsx)(de,{counts:y,className:`h-2 w-40 max-w-md flex-1`,segmentClassName:`duration-300`}),(0,I.jsxs)(`span`,{className:`font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground`,"data-num":!0,"data-flash":x,children:[b,`/`,ae,` TASKS TERMINAL`]}),S===void 0?null:(0,I.jsxs)(`span`,{className:`font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground`,"data-num":!0,children:[K(S),` ELAPSED`]}),(0,I.jsxs)(`button`,{type:`button`,title:`Download the run history as NDJSON`,onClick:()=>{se(`/v1/runs/${encodeURIComponent(e.runId)}/history.jsonl`,`${e.runId}.jsonl`).catch(()=>{})},className:`ml-auto flex items-center gap-1.5 rounded-md border px-2.5 py-1 font-mono text-[11px] tracking-[0.08em] text-muted-foreground uppercase transition-colors hover:bg-secondary/60 hover:text-foreground`,children:[(0,I.jsx)(_e,{className:`size-3.5`}),`History`]}),(0,I.jsxs)(`button`,{type:`button`,title:w?`Delete this run from history`:`Delete is available after the run finishes`,disabled:!w||o.isPending,onClick:()=>{T()},className:`flex items-center gap-1.5 rounded-md border px-2.5 py-1 font-mono text-[11px] tracking-[0.08em] text-destructive uppercase transition-colors hover:bg-destructive/10 disabled:cursor-not-allowed disabled:opacity-40`,children:[(0,I.jsx)(oe,{className:`size-3.5`}),o.isPending?`Deleting`:`Delete`]})]}),(0,I.jsxs)(`p`,{className:`font-mono text-xs text-muted-foreground`,children:[e.runId,t.data?(0,I.jsxs)(I.Fragment,{children:[` · created `,(0,I.jsx)(`span`,{title:t.data.createdAt,children:ce(t.data.createdAt)})]}):null]}),d?(0,I.jsx)(`p`,{className:`text-xs text-destructive`,children:d}):null]}),(0,I.jsxs)(ze,{value:e.tab,onValueChange:e.onTabChange,children:[(0,I.jsxs)(Ve,{children:[(0,I.jsx)(z,{value:`overview`,children:`Overview`}),(0,I.jsxs)(z,{value:`artifacts`,children:[`Artifacts`,r.data?.artifacts.length?(0,I.jsx)(D,{variant:`secondary`,"data-num":!0,children:r.data.artifacts.length}):null]}),(0,I.jsx)(z,{value:`metrics`,children:`Metrics`}),(0,I.jsxs)(z,{value:`files`,children:[`Files`,a.data?.reservations.length?(0,I.jsx)(D,{variant:`secondary`,"data-num":!0,children:a.data.reservations.length}):null]})]}),(0,I.jsxs)(B,{value:`overview`,className:`grid min-w-0 gap-4 pt-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,I.jsx)(Tt,{active:c===`map`,onClick:()=>e.onViewChange(`map`),children:`Map`}),(0,I.jsx)(Tt,{active:c===`timeline`,onClick:()=>e.onViewChange(`timeline`),children:`Timeline`}),(0,I.jsx)(Tt,{active:c===`sandboxes`,onClick:()=>e.onViewChange(`sandboxes`),children:`By Sandbox`}),c!==`sandboxes`&&g.length>St?(0,I.jsx)(`button`,{type:`button`,onClick:()=>u(!C),className:`ml-2 rounded-md border border-transparent px-2.5 py-1 font-mono text-[11px] uppercase tracking-[0.14em] text-muted-foreground hover:bg-secondary/60`,children:C?`Collapse`:`Expand (${g.length} tasks)`}):null]}),c===`sandboxes`?(0,I.jsxs)(`div`,{className:`grid gap-3`,children:[(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Tasks grouped by the sandbox assigned to run them. This is run context, not the global fleet page.`}),(0,I.jsx)(he,{tasks:g,ordinals:_,pending:n.isPending,onSelect:v})]}):(0,I.jsxs)(I.Fragment,{children:[C&&!n.isError?c===`map`?(0,I.jsx)($e,{tasks:g,ordinals:_,pending:n.isPending,selectedTaskId:null,onSelect:v}):(0,I.jsx)(yt,{tasks:g,pending:n.isPending,runCreatedAt:t.data?.createdAt,runActive:h,onSelect:v}):null,(0,I.jsxs)(`div`,{className:`grid gap-2`,children:[(0,I.jsx)(`h2`,{className:`console-callout`,children:`Tasks`}),(0,I.jsx)(Et,{tasks:g,ordinals:_,pending:n.isPending,error:n.isError?String(n.error):null,onOpen:v})]})]})]}),(0,I.jsx)(B,{value:`artifacts`,className:`pt-3`,children:(0,I.jsx)(jt,{artifacts:r.data?.artifacts,error:r.isError?String(r.error):null})}),(0,I.jsx)(B,{value:`metrics`,className:`pt-3`,children:(0,I.jsx)(ft,{metrics:i.data,error:i.isError?String(i.error):null})}),(0,I.jsx)(B,{value:`files`,className:`pt-3`,children:(0,I.jsxs)(`div`,{className:`grid gap-2`,children:[(0,I.jsx)(`h2`,{className:`console-callout`,children:`Active file reservations`}),(0,I.jsx)(Dt,{reservations:a.data?.reservations,tasks:g,ordinals:_,pending:a.isPending,error:a.isError?String(a.error):null,onOpen:v})]})})]})]})}function Tt(e){return(0,I.jsx)(`button`,{type:`button`,onClick:e.onClick,className:a(`rounded-md border px-2.5 py-1 font-mono text-[11px] uppercase tracking-[0.14em] transition-state`,e.active?`border-primary/40 bg-secondary text-foreground`:`border-transparent text-muted-foreground hover:bg-secondary/60`),children:e.children})}function Et(e){if(e.error!==null)return(0,I.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`Cannot load tasks: `,e.error]});let t=[...e.tasks].sort((t,n)=>(e.ordinals.get(t.taskId)??0)-(e.ordinals.get(n.taskId)??0));return(0,I.jsx)(w,{className:`py-0`,children:(0,I.jsx)(C,{className:`p-0`,children:(0,I.jsxs)(P,{children:[(0,I.jsx)(k,{children:(0,I.jsxs)(M,{children:[(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`#`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Task`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Status`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Workpad`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Sandbox`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Depends on`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Accepted`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Finished`}),(0,I.jsx)(A,{className:`console-callout pr-4 text-right text-muted-foreground`,children:`Open`})]})}),(0,I.jsx)(j,{children:e.pending?(0,I.jsx)(M,{children:[0,1,2,3,4,5,6,7,8].map(e=>(0,I.jsx)(N,{children:(0,I.jsx)(E,{className:`h-4 w-full max-w-28`})},e))}):t.map(t=>{let n=T(t);return(0,I.jsxs)(M,{className:`cursor-pointer`,onClick:()=>e.onOpen(t.taskId),children:[(0,I.jsxs)(N,{className:`font-mono text-xs text-muted-foreground`,"data-num":!0,children:[`#`,e.ordinals.get(t.taskId)]}),(0,I.jsx)(N,{children:(0,I.jsx)(`button`,{type:`button`,className:n===void 0?`block text-left font-mono text-xs hover:underline`:`block text-left text-sm font-medium hover:underline`,onClick:()=>e.onOpen(t.taskId),title:t.taskId,children:n??t.taskId})}),(0,I.jsx)(N,{children:(0,I.jsxs)(`div`,{className:`grid gap-1`,children:[(0,I.jsx)(pe,{state:t.status,id:t.taskId}),(0,I.jsx)(Ot,{task:t})]})}),(0,I.jsx)(N,{children:t.workpad?(0,I.jsxs)(D,{variant:`outline`,className:`font-mono text-[10px] uppercase tracking-[0.08em]`,title:`Updated ${t.workpad.updatedAt}`,children:[`v`,t.workpad.version,` ·`,` `,O(t.workpad.updatedAt)]}):(0,I.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:`—`})}),(0,I.jsx)(N,{className:`font-mono text-xs`,children:t.assignedSandboxId??t.lastSandboxId??`—`}),(0,I.jsx)(N,{className:`space-x-1`,children:t.dependsOn.length===0?`—`:t.dependsOn.map(t=>(0,I.jsxs)(D,{variant:`secondary`,className:`font-mono text-[11px]`,title:t,children:[`#`,e.ordinals.get(t)??`?`]},t))}),(0,I.jsx)(N,{className:`font-mono text-xs text-muted-foreground`,title:t.assignmentAcceptedAt,"data-num":!0,children:O(t.assignmentAcceptedAt)}),(0,I.jsx)(N,{className:`font-mono text-xs text-muted-foreground`,title:t.lastFinishedAt,"data-num":!0,children:O(t.lastFinishedAt)}),(0,I.jsx)(N,{className:`pr-4 text-right`,children:(0,I.jsxs)(x,{type:`button`,size:`xs`,variant:`outline`,title:`Open this task's workpad and agent transcript`,onClick:n=>{n.stopPropagation(),e.onOpen(t.taskId)},children:[(0,I.jsx)(o,{}),`Task`]})})]},t.taskId)})})]})})})}function Dt(e){if(e.error!==null)return(0,I.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`Cannot load file reservations: `,e.error]});let t=e.reservations??[],n=new Map(e.tasks.map(e=>[e.taskId,e]));return!e.pending&&t.length===0?(0,I.jsx)(`p`,{className:`py-6 text-center text-sm text-muted-foreground`,children:`No active file reservations in this run.`}):(0,I.jsx)(w,{className:`py-0`,children:(0,I.jsx)(C,{className:`p-0`,children:(0,I.jsxs)(P,{className:`min-w-[960px] table-fixed`,children:[(0,I.jsxs)(`colgroup`,{children:[(0,I.jsx)(`col`,{style:{width:`22%`}}),(0,I.jsx)(`col`,{style:{width:`27%`}}),(0,I.jsx)(`col`,{style:{width:`13%`}}),(0,I.jsx)(`col`,{style:{width:`28%`}}),(0,I.jsx)(`col`,{style:{width:`10%`}})]}),(0,I.jsx)(k,{children:(0,I.jsxs)(M,{children:[(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Path`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Task`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Sandbox`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Reason`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Reserved`})]})}),(0,I.jsx)(j,{children:e.pending&&t.length===0?(0,I.jsx)(M,{children:[0,1,2,3,4].map(e=>(0,I.jsx)(N,{children:(0,I.jsx)(E,{className:`h-4 w-full max-w-28`})},e))}):t.map(t=>{let r=n.get(t.taskId),i=r?T(r):void 0;return(0,I.jsxs)(M,{children:[(0,I.jsx)(N,{className:`overflow-hidden`,children:(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,I.jsx)(D,{variant:`outline`,className:`shrink-0 font-mono text-[10px] uppercase`,children:t.selector.kind}),(0,I.jsx)(`div`,{className:`min-w-0 flex-1 overflow-x-auto whitespace-nowrap font-mono text-xs`,title:kt(t),children:t.selector.path})]})}),(0,I.jsxs)(N,{className:`overflow-hidden`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`block max-w-full truncate text-left text-sm font-medium hover:underline`,title:t.taskId,onClick:()=>e.onOpen(t.taskId),children:[e.ordinals.has(t.taskId)?`#${e.ordinals.get(t.taskId)} `:``,i??t.taskId]}),(0,I.jsx)(`div`,{className:`mt-0.5 truncate font-mono text-[11px] text-muted-foreground`,children:t.assignmentId})]}),(0,I.jsx)(N,{className:`overflow-hidden truncate font-mono text-xs`,title:t.sandboxId,children:t.sandboxId}),(0,I.jsx)(N,{className:`overflow-hidden text-sm`,children:(0,I.jsx)(`div`,{className:`max-w-full overflow-x-auto whitespace-nowrap`,title:t.reason??`No reason`,children:t.reason??`No reason`})}),(0,I.jsx)(N,{className:`font-mono text-xs text-muted-foreground`,title:t.createdAt,"data-num":!0,children:O(t.createdAt)})]},t.reservationId)})})]})})})}function Ot(e){let t=e.task.live;if(!t)return null;let n=t.idleTimeout?.graceExpiresAt??t.idleTimeout?.expiresAt;return(0,I.jsxs)(`div`,{className:`flex max-w-56 flex-wrap items-center gap-1`,children:[t.state?.liveStatus===void 0?null:(0,I.jsx)(D,{variant:`outline`,className:`font-mono text-[10px] uppercase tracking-[0.08em]`,title:`Live task round state`,children:t.state.liveStatus}),t.latestRoundKey===void 0?null:(0,I.jsx)(`span`,{className:`truncate font-mono text-[11px] text-muted-foreground`,title:`Latest round ${t.latestRoundKey}`,children:t.latestRoundKey}),n===void 0?null:(0,I.jsxs)(D,{variant:`secondary`,className:`font-mono text-[10px] uppercase tracking-[0.08em]`,title:`Idle timeout ${n}`,children:[`idle `,O(n)]})]})}function kt(e){return`${e.selector.kind}:${e.selector.path}`}function At(e){return e===`allow`?`border-status-idle/40 text-status-idle`:e===`deny`?`border-status-failed/40 text-status-failed`:`border-status-warn/40 text-status-warn`}function jt(e){let[t,n]=(0,F.useState)(null),[r,i]=(0,F.useState)(null);if(e.error!==null)return(0,I.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`Cannot load artifacts: `,e.error]});let o=e.artifacts??[];if(o.length===0)return(0,I.jsx)(`p`,{className:`py-6 text-center text-sm text-muted-foreground`,children:`No artifacts declared in this run.`});async function s(e){n(e.artifactId),i(null);try{await se(`/v1/artifacts/${encodeURIComponent(e.artifactId)}/fetch`,Mt(e))}catch(e){i(e instanceof Error?e.message:String(e))}finally{n(null)}}return(0,I.jsxs)(`div`,{className:`grid gap-2`,children:[r===null?null:(0,I.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`Cannot download artifact: `,r]}),(0,I.jsx)(w,{className:`py-0`,children:(0,I.jsx)(C,{className:`p-0`,children:(0,I.jsxs)(P,{children:[(0,I.jsx)(k,{children:(0,I.jsxs)(M,{children:[(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Descriptor`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Kind`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Policy`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Size`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Locations`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Download`})]})}),(0,I.jsx)(j,{children:o.map(e=>{let n=e.locations.some(e=>Pt(e)),r=t===e.artifactId;return(0,I.jsxs)(M,{children:[(0,I.jsxs)(N,{children:[(0,I.jsx)(`div`,{className:`font-mono text-xs`,children:e.artifactId}),e.metadata===void 0?null:(0,I.jsx)(`div`,{className:`mt-1 font-mono text-[11px] text-muted-foreground`,children:Lt(e.metadata)})]}),(0,I.jsx)(N,{children:(0,I.jsx)(D,{variant:`secondary`,className:`font-mono text-[10px] uppercase tracking-[0.08em]`,children:e.kind})}),(0,I.jsx)(N,{children:(0,I.jsx)(D,{variant:`outline`,className:a(`font-mono text-[10px] uppercase tracking-[0.08em]`,At(e.movementPolicy)),children:e.movementPolicy})}),(0,I.jsx)(N,{className:`font-mono text-xs text-muted-foreground`,"data-num":!0,children:e.sizeBytes===void 0?`—`:dt(e.sizeBytes)}),(0,I.jsx)(N,{className:`min-w-44`,children:(0,I.jsx)(Ft,{locations:e.locations})}),(0,I.jsx)(N,{children:n?(0,I.jsxs)(x,{type:`button`,size:`xs`,variant:`outline`,disabled:r,title:`Download artifact bytes through the control plane`,onClick:()=>void s(e),children:[(0,I.jsx)(_e,{}),r?`Saving`:`Download`]}):(0,I.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,title:`This descriptor has no produced artifact bytes.`,children:`not produced`})})]},e.artifactId)})})]})})})]})}function Mt(e){return Nt(e.metadata)??e.locations.map(e=>Nt(e.metadata)).find(e=>e!==void 0)??e.artifactId}function Nt(e){for(let t of[`filename`,`fileName`,`name`,`path`,`relativePath`]){let n=e?.[t];if(typeof n!=`string`)continue;let r=n.split(/[\\/]/).filter(Boolean).at(-1);if(r!==void 0&&r.length>0)return r}}function Pt(e){return e.storageKind===`sandbox-local`&&e.bytesAvailable}function Ft(e){return e.locations.length===0?(0,I.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:`none`}):(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.locations.map(e=>(0,I.jsxs)(D,{variant:e.bytesAvailable?`outline`:`secondary`,className:a(`font-mono text-[10px] uppercase tracking-[0.08em]`,e.storageKind===`sandbox-local`&&e.bytesAvailable&&`border-status-succeeded/40 text-status-succeeded`),title:It(e),children:[e.storageKind,e.sandboxId?` · ${e.sandboxId}`:``,e.bytesAvailable?``:` · unavailable`]},e.artifactLocationId))})}function It(e){let t=[e.artifactLocationId,e.location,e.site,e.region,e.network,e.substrate,e.uri].filter(e=>typeof e==`string`);return t.length>0?t.join(` · `):e.storageKind}function Lt(e){let t=Object.entries(e).filter(([e])=>e!==`clientScope`);return t.length===0?`descriptor`:t.slice(0,2).map(([e,t])=>`${e}=${Rt(t)}`).join(` · `)}function Rt(e){return typeof e==`string`||typeof e==`number`?String(e):typeof e==`boolean`?e?`true`:`false`:JSON.stringify(e)}export{wt as RunPage};
@@ -1 +1 @@
1
- import{h as e,t,v as n}from"./react-DtOYBmep.js";import{r,t as i}from"./utils-CEE0-YEp.js";import{k as a,q as o}from"./main-RzjfJZwD.js";import{a as s,i as c,n as l,r as u,t as d}from"./card-DSG3_teC.js";import{c as f,d as p,l as m,n as h,s as g,t as _,u as v}from"./bits-Cv0Te4iz.js";import{a as y,i as b,n as x,o as S,r as C,t as w}from"./table-DptQuuuq.js";var T=r(`inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),E=n(t(),1),D=e(),O=[{label:`All`,value:void 0},{label:`Running`,value:`RUNNING`},{label:`Succeeded`,value:`SUCCEEDED`},{label:`Failed`,value:`FAILED`}];function k(e){let t=e.filter,n=o(),r=o(t),s=(n.data?.pages??[]).flatMap(e=>e.runs),c=(r.data?.pages??[]).flatMap(e=>e.runs);m();let u=(0,E.useRef)(null),f=new Set;if(u.current!==null)for(let e of c){if(u.current.has(e.runId))break;f.add(e.runId)}(0,E.useEffect)(()=>{if(r.isPending)return;let e=u.current??new Set;u.current=e;for(let t of c)e.add(t.runId)});let p=M(s);return(0,D.jsxs)(`section`,{className:`grid gap-5`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:`Runs`}),(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Every run your account can read, newest first.`})]}),(0,D.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,D.jsx)(j,{label:`Active runs`,hint:`of ${s.length} loaded`,value:String(s.filter(e=>e.state===`RUNNING`).length)}),(0,D.jsx)(j,{label:`Success rate`,hint:`of ${s.length} loaded`,value:p===void 0?`—`:`${p}%`,baseline:p??0})]}),(0,D.jsx)(`div`,{className:`flex items-center gap-1.5`,children:O.map(n=>(0,D.jsx)(a,{size:`sm`,"aria-pressed":t===n.value,variant:t===n.value?`secondary`:`ghost`,className:i(`h-7 px-2.5 font-mono text-xs uppercase tracking-[0.08em]`,t!==n.value&&`text-muted-foreground`),onClick:()=>e.onFilterChange(n.value),children:n.label},n.label))}),r.isError?(0,D.jsxs)(`p`,{className:`text-sm text-status-failed`,children:[`Cannot list runs: `,String(r.error)]}):c.length===0&&!r.isPending?(0,D.jsx)(P,{filtered:t!==void 0}):(0,D.jsx)(d,{className:`py-0`,children:(0,D.jsx)(l,{className:`p-0`,children:(0,D.jsxs)(w,{children:[(0,D.jsx)(y,{children:(0,D.jsxs)(S,{children:[(0,D.jsx)(b,{className:`console-callout text-muted-foreground`,children:`Run`}),(0,D.jsx)(b,{className:`console-callout text-muted-foreground`,children:`State`}),(0,D.jsx)(b,{className:`console-callout text-muted-foreground`,children:`Tasks`}),(0,D.jsx)(b,{className:`console-callout text-muted-foreground`,children:`Created`}),(0,D.jsx)(b,{className:`console-callout text-muted-foreground`,children:`Updated`})]})}),(0,D.jsx)(x,{children:r.isPending?(0,D.jsx)(N,{}):c.map(t=>(0,D.jsx)(A,{run:t,rising:f.has(t.runId),onOpen:()=>e.onOpenRun(t.runId)},t.runId))})]})})}),r.hasNextPage?(0,D.jsx)(a,{variant:`outline`,onClick:()=>void r.fetchNextPage(),disabled:r.isFetchingNextPage,children:`Load more`}):null]})}function A(e){let t=v(e.run.updatedAt);return(0,D.jsxs)(S,{"data-flash":t,className:i(`cursor-pointer`,e.rising&&`animate-in fade-in slide-in-from-bottom-1 duration-200`),onClick:e.onOpen,children:[(0,D.jsxs)(C,{className:`relative`,children:[t===void 0?null:(0,D.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-y-0 left-0 w-[3px] bg-primary animate-out fade-out fill-mode-forwards duration-700`}),(0,D.jsx)(`button`,{type:`button`,className:`block text-left font-medium hover:underline`,onClick:e.onOpen,children:e.run.name}),(0,D.jsx)(`div`,{className:`font-mono text-xs text-muted-foreground`,children:e.run.runId})]}),(0,D.jsx)(C,{children:(0,D.jsx)(_,{state:e.run.state,id:e.run.runId})}),(0,D.jsx)(C,{children:(0,D.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,D.jsx)(`span`,{className:`font-mono text-xs`,"data-num":!0,children:g(e.run.taskStatusCounts)}),(0,D.jsx)(h,{counts:e.run.taskStatusCounts})]})}),(0,D.jsx)(C,{"data-num":!0,className:`font-mono text-xs text-muted-foreground`,title:e.run.createdAt,children:f(e.run.createdAt)}),(0,D.jsx)(C,{"data-num":!0,className:`font-mono text-xs text-muted-foreground`,title:e.run.updatedAt,children:f(e.run.updatedAt)})]})}function j(e){let t=v(e.value);return(0,D.jsx)(d,{className:`gap-1 py-4`,children:(0,D.jsxs)(c,{className:`gap-1.5 py-0`,children:[(0,D.jsxs)(u,{className:`console-callout`,children:[e.label,e.hint===void 0?null:(0,D.jsxs)(`span`,{className:`ml-1 opacity-70`,"data-num":!0,children:[`· `,e.hint]})]}),(0,D.jsx)(s,{"data-num":!0,"data-flash":t,className:`-mx-1 w-fit rounded-sm px-1 font-mono text-2xl font-medium`,children:e.value}),e.baseline===void 0?null:(0,D.jsx)(`div`,{"aria-hidden":!0,className:`h-px w-full bg-border`,children:(0,D.jsx)(`div`,{className:`h-full bg-status-succeeded transition-state`,style:{width:`${e.baseline}%`}})})]})})}function M(e){let t=e.filter(e=>[`SUCCEEDED`,`FAILED`,`CANCELLED`,`STALLED`].includes(e.state));if(t.length===0)return;let n=t.filter(e=>e.state===`SUCCEEDED`).length;return Math.round(n/t.length*100)}function N(){return(0,D.jsx)(D.Fragment,{children:[0,1,2].map(e=>(0,D.jsx)(S,{children:[0,1,2,3,4].map(e=>(0,D.jsx)(C,{children:(0,D.jsx)(p,{className:`h-4 w-full max-w-32`})},e))},e))})}function P(e){return(0,D.jsx)(d,{className:`py-12 text-center`,children:(0,D.jsxs)(l,{className:`grid justify-items-center gap-2`,children:[(0,D.jsx)(T,{className:`size-8 text-muted-foreground`}),(0,D.jsx)(`p`,{className:`font-medium`,children:e.filtered?`No runs match this filter`:`No runs yet`}),(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.filtered?`Try another state.`:`Create a run and it will appear here within a second.`})]})})}export{k as RunsPage};
1
+ import{h as e,t,v as n}from"./react-DtOYBmep.js";import{r,t as i}from"./utils-CEE0-YEp.js";import{k as a,q as o}from"./main-KBvz0mSQ.js";import{a as s,i as c,n as l,r as u,t as d}from"./card-DSG3_teC.js";import{c as f,d as p,l as m,n as h,s as g,t as _,u as v}from"./bits-Cv0Te4iz.js";import{a as y,i as b,n as x,o as S,r as C,t as w}from"./table-DptQuuuq.js";var T=r(`inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),E=n(t(),1),D=e(),O=[{label:`All`,value:void 0},{label:`Running`,value:`RUNNING`},{label:`Succeeded`,value:`SUCCEEDED`},{label:`Failed`,value:`FAILED`}];function k(e){let t=e.filter,n=o(),r=o(t),s=(n.data?.pages??[]).flatMap(e=>e.runs),c=(r.data?.pages??[]).flatMap(e=>e.runs);m();let u=(0,E.useRef)(null),f=new Set;if(u.current!==null)for(let e of c){if(u.current.has(e.runId))break;f.add(e.runId)}(0,E.useEffect)(()=>{if(r.isPending)return;let e=u.current??new Set;u.current=e;for(let t of c)e.add(t.runId)});let p=M(s);return(0,D.jsxs)(`section`,{className:`grid gap-5`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:`Runs`}),(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Every run your account can read, newest first.`})]}),(0,D.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,D.jsx)(j,{label:`Active runs`,hint:`of ${s.length} loaded`,value:String(s.filter(e=>e.state===`RUNNING`).length)}),(0,D.jsx)(j,{label:`Success rate`,hint:`of ${s.length} loaded`,value:p===void 0?`—`:`${p}%`,baseline:p??0})]}),(0,D.jsx)(`div`,{className:`flex items-center gap-1.5`,children:O.map(n=>(0,D.jsx)(a,{size:`sm`,"aria-pressed":t===n.value,variant:t===n.value?`secondary`:`ghost`,className:i(`h-7 px-2.5 font-mono text-xs uppercase tracking-[0.08em]`,t!==n.value&&`text-muted-foreground`),onClick:()=>e.onFilterChange(n.value),children:n.label},n.label))}),r.isError?(0,D.jsxs)(`p`,{className:`text-sm text-status-failed`,children:[`Cannot list runs: `,String(r.error)]}):c.length===0&&!r.isPending?(0,D.jsx)(P,{filtered:t!==void 0}):(0,D.jsx)(d,{className:`py-0`,children:(0,D.jsx)(l,{className:`p-0`,children:(0,D.jsxs)(w,{children:[(0,D.jsx)(y,{children:(0,D.jsxs)(S,{children:[(0,D.jsx)(b,{className:`console-callout text-muted-foreground`,children:`Run`}),(0,D.jsx)(b,{className:`console-callout text-muted-foreground`,children:`State`}),(0,D.jsx)(b,{className:`console-callout text-muted-foreground`,children:`Tasks`}),(0,D.jsx)(b,{className:`console-callout text-muted-foreground`,children:`Created`}),(0,D.jsx)(b,{className:`console-callout text-muted-foreground`,children:`Updated`})]})}),(0,D.jsx)(x,{children:r.isPending?(0,D.jsx)(N,{}):c.map(t=>(0,D.jsx)(A,{run:t,rising:f.has(t.runId),onOpen:()=>e.onOpenRun(t.runId)},t.runId))})]})})}),r.hasNextPage?(0,D.jsx)(a,{variant:`outline`,onClick:()=>void r.fetchNextPage(),disabled:r.isFetchingNextPage,children:`Load more`}):null]})}function A(e){let t=v(e.run.updatedAt);return(0,D.jsxs)(S,{"data-flash":t,className:i(`cursor-pointer`,e.rising&&`animate-in fade-in slide-in-from-bottom-1 duration-200`),onClick:e.onOpen,children:[(0,D.jsxs)(C,{className:`relative`,children:[t===void 0?null:(0,D.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-y-0 left-0 w-[3px] bg-primary animate-out fade-out fill-mode-forwards duration-700`}),(0,D.jsx)(`button`,{type:`button`,className:`block text-left font-medium hover:underline`,onClick:e.onOpen,children:e.run.name}),(0,D.jsx)(`div`,{className:`font-mono text-xs text-muted-foreground`,children:e.run.runId})]}),(0,D.jsx)(C,{children:(0,D.jsx)(_,{state:e.run.state,id:e.run.runId})}),(0,D.jsx)(C,{children:(0,D.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,D.jsx)(`span`,{className:`font-mono text-xs`,"data-num":!0,children:g(e.run.taskStatusCounts)}),(0,D.jsx)(h,{counts:e.run.taskStatusCounts})]})}),(0,D.jsx)(C,{"data-num":!0,className:`font-mono text-xs text-muted-foreground`,title:e.run.createdAt,children:f(e.run.createdAt)}),(0,D.jsx)(C,{"data-num":!0,className:`font-mono text-xs text-muted-foreground`,title:e.run.updatedAt,children:f(e.run.updatedAt)})]})}function j(e){let t=v(e.value);return(0,D.jsx)(d,{className:`gap-1 py-4`,children:(0,D.jsxs)(c,{className:`gap-1.5 py-0`,children:[(0,D.jsxs)(u,{className:`console-callout`,children:[e.label,e.hint===void 0?null:(0,D.jsxs)(`span`,{className:`ml-1 opacity-70`,"data-num":!0,children:[`· `,e.hint]})]}),(0,D.jsx)(s,{"data-num":!0,"data-flash":t,className:`-mx-1 w-fit rounded-sm px-1 font-mono text-2xl font-medium`,children:e.value}),e.baseline===void 0?null:(0,D.jsx)(`div`,{"aria-hidden":!0,className:`h-px w-full bg-border`,children:(0,D.jsx)(`div`,{className:`h-full bg-status-succeeded transition-state`,style:{width:`${e.baseline}%`}})})]})})}function M(e){let t=e.filter(e=>[`SUCCEEDED`,`FAILED`,`CANCELLED`,`STALLED`].includes(e.state));if(t.length===0)return;let n=t.filter(e=>e.state===`SUCCEEDED`).length;return Math.round(n/t.length*100)}function N(){return(0,D.jsx)(D.Fragment,{children:[0,1,2].map(e=>(0,D.jsx)(S,{children:[0,1,2,3,4].map(e=>(0,D.jsx)(C,{children:(0,D.jsx)(p,{className:`h-4 w-full max-w-32`})},e))},e))})}function P(e){return(0,D.jsx)(d,{className:`py-12 text-center`,children:(0,D.jsxs)(l,{className:`grid justify-items-center gap-2`,children:[(0,D.jsx)(T,{className:`size-8 text-muted-foreground`}),(0,D.jsx)(`p`,{className:`font-medium`,children:e.filtered?`No runs match this filter`:`No runs yet`}),(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.filtered?`Try another state.`:`Create a run and it will appear here within a second.`})]})})}export{k as RunsPage};
@@ -1 +1 @@
1
- import{h as e}from"./react-DtOYBmep.js";import{r as t,t as n}from"./utils-CEE0-YEp.js";import{t as r}from"./arrow-right-BMW8fJP5.js";import{t as i}from"./external-link-BW8lpiMR.js";import{K as a,q as o}from"./main-RzjfJZwD.js";import{n as s,t as c}from"./card-DSG3_teC.js";import{c as l,d as u,l as d,o as f,t as p}from"./bits-Cv0Te4iz.js";import{t as m}from"./SandboxesLens-BUQQWmH6.js";var h=t(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),g=e();function _(e){let t=o();d();let n=(t.data?.pages??[]).flatMap(e=>e.runs),r=n.find(t=>t.runId===e.selectedRunId)??n[0];return(0,g.jsxs)(`section`,{className:`grid gap-5`,children:[(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:`Sandboxes`}),(0,g.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Sandboxes used by your runs. This is task/session context, not global fleet capacity.`})]}),t.isError?(0,g.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`Cannot list runs: `,String(t.error)]}):t.isPending?(0,g.jsx)(v,{}):n.length===0?(0,g.jsx)(y,{}):(0,g.jsxs)(`div`,{className:`grid min-w-0 gap-4 lg:grid-cols-[20rem_minmax(0,1fr)]`,children:[(0,g.jsx)(b,{runs:n,selectedRunId:r?.runId,hasMore:t.hasNextPage,loadingMore:t.isFetchingNextPage,onLoadMore:()=>void t.fetchNextPage(),onSelect:e.onSelectRun}),r?(0,g.jsx)(S,{run:r,onOpenRun:e.onOpenRun,onOpenTask:e.onOpenTask}):null]})]})}function v(){return(0,g.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[20rem_minmax(0,1fr)]`,children:[(0,g.jsx)(c,{className:`gap-2 p-3`,children:[0,1,2].map(e=>(0,g.jsx)(u,{className:`h-12 w-full`},e))}),(0,g.jsxs)(c,{className:`p-4`,children:[(0,g.jsx)(u,{className:`h-5 w-40`}),(0,g.jsx)(u,{className:`mt-4 h-32 w-full`})]})]})}function y(){return(0,g.jsxs)(`div`,{className:`rounded-lg border border-dashed py-12 text-center`,children:[(0,g.jsx)(h,{className:`mx-auto size-5 text-muted-foreground`}),(0,g.jsx)(`p`,{className:`mt-3 console-callout`,children:`No runs yet`}),(0,g.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Sandbox placement appears after your account has task runs.`})]})}function b(e){return(0,g.jsxs)(c,{className:`gap-2 p-2`,children:[(0,g.jsx)(`div`,{className:`px-2 py-1`,children:(0,g.jsx)(`h2`,{className:`console-callout`,children:`Recent runs`})}),(0,g.jsx)(`div`,{className:`grid gap-1`,children:e.runs.map(t=>(0,g.jsx)(x,{run:t,selected:t.runId===e.selectedRunId,onSelect:e.onSelect},t.runId))}),e.hasMore?(0,g.jsx)(`button`,{type:`button`,disabled:e.loadingMore,onClick:e.onLoadMore,className:`mt-1 rounded-md px-2 py-1.5 text-left font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground transition-colors hover:bg-secondary/60 disabled:cursor-wait disabled:opacity-60`,children:e.loadingMore?`Loading`:`Load more`}):null]})}function x(e){return(0,g.jsxs)(`button`,{type:`button`,"aria-pressed":e.selected,onClick:()=>e.onSelect(e.run.runId),className:n(`grid min-w-0 gap-1 rounded-md px-2 py-2 text-left transition-colors`,e.selected?`bg-secondary text-foreground`:`text-muted-foreground hover:bg-secondary/60 hover:text-foreground`),children:[(0,g.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,g.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:e.run.name}),(0,g.jsx)(p,{state:e.run.state,id:e.run.runId})]}),(0,g.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 font-mono text-[11px]`,children:[(0,g.jsx)(`span`,{className:`truncate`,title:e.run.runId,children:e.run.runId}),(0,g.jsx)(`span`,{className:`shrink-0`,title:e.run.updatedAt,"data-num":!0,children:l(e.run.updatedAt)})]})]})}function S(e){let t=a(e.run.runId),n=t.data?.tasks??[],o=f(n);return(0,g.jsxs)(`div`,{className:`grid min-w-0 gap-3`,children:[(0,g.jsx)(c,{className:`py-0`,children:(0,g.jsxs)(s,{className:`flex min-w-0 flex-wrap items-center gap-3 p-4`,children:[(0,g.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,g.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,g.jsx)(`h2`,{className:`min-w-0 truncate text-base font-semibold`,children:e.run.name}),(0,g.jsx)(p,{state:e.run.state,id:e.run.runId})]}),(0,g.jsx)(`p`,{className:`mt-1 truncate font-mono text-xs text-muted-foreground`,children:e.run.runId})]}),(0,g.jsxs)(`button`,{type:`button`,onClick:()=>e.onOpenRun(e.run.runId),className:`flex items-center gap-1.5 rounded-md border px-2.5 py-1 font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground transition-colors hover:bg-secondary/60 hover:text-foreground`,children:[(0,g.jsx)(i,{className:`size-3.5`}),`Open run`]})]})}),t.isError?(0,g.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`Cannot load tasks: `,String(t.error)]}):(0,g.jsx)(m,{tasks:n,ordinals:o,pending:t.isPending,onSelect:t=>e.onOpenTask(e.run.runId,t)}),!t.isPending&&n.length>0?(0,g.jsxs)(`button`,{type:`button`,onClick:()=>e.onOpenRun(e.run.runId),className:`inline-flex w-fit items-center gap-1.5 rounded-md px-2 py-1 font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground transition-colors hover:bg-secondary/60 hover:text-foreground`,children:[`Open run by sandbox`,(0,g.jsx)(r,{className:`size-3.5`})]}):null]})}export{_ as SandboxesPage};
1
+ import{h as e}from"./react-DtOYBmep.js";import{r as t,t as n}from"./utils-CEE0-YEp.js";import{t as r}from"./arrow-right-BMW8fJP5.js";import{t as i}from"./external-link-BW8lpiMR.js";import{K as a,q as o}from"./main-KBvz0mSQ.js";import{n as s,t as c}from"./card-DSG3_teC.js";import{c as l,d as u,l as d,o as f,t as p}from"./bits-Cv0Te4iz.js";import{t as m}from"./SandboxesLens-BUQQWmH6.js";var h=t(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),g=e();function _(e){let t=o();d();let n=(t.data?.pages??[]).flatMap(e=>e.runs),r=n.find(t=>t.runId===e.selectedRunId)??n[0];return(0,g.jsxs)(`section`,{className:`grid gap-5`,children:[(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:`Sandboxes`}),(0,g.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Sandboxes used by your runs. This is task/session context, not global fleet capacity.`})]}),t.isError?(0,g.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`Cannot list runs: `,String(t.error)]}):t.isPending?(0,g.jsx)(v,{}):n.length===0?(0,g.jsx)(y,{}):(0,g.jsxs)(`div`,{className:`grid min-w-0 gap-4 lg:grid-cols-[20rem_minmax(0,1fr)]`,children:[(0,g.jsx)(b,{runs:n,selectedRunId:r?.runId,hasMore:t.hasNextPage,loadingMore:t.isFetchingNextPage,onLoadMore:()=>void t.fetchNextPage(),onSelect:e.onSelectRun}),r?(0,g.jsx)(S,{run:r,onOpenRun:e.onOpenRun,onOpenTask:e.onOpenTask}):null]})]})}function v(){return(0,g.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[20rem_minmax(0,1fr)]`,children:[(0,g.jsx)(c,{className:`gap-2 p-3`,children:[0,1,2].map(e=>(0,g.jsx)(u,{className:`h-12 w-full`},e))}),(0,g.jsxs)(c,{className:`p-4`,children:[(0,g.jsx)(u,{className:`h-5 w-40`}),(0,g.jsx)(u,{className:`mt-4 h-32 w-full`})]})]})}function y(){return(0,g.jsxs)(`div`,{className:`rounded-lg border border-dashed py-12 text-center`,children:[(0,g.jsx)(h,{className:`mx-auto size-5 text-muted-foreground`}),(0,g.jsx)(`p`,{className:`mt-3 console-callout`,children:`No runs yet`}),(0,g.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Sandbox placement appears after your account has task runs.`})]})}function b(e){return(0,g.jsxs)(c,{className:`gap-2 p-2`,children:[(0,g.jsx)(`div`,{className:`px-2 py-1`,children:(0,g.jsx)(`h2`,{className:`console-callout`,children:`Recent runs`})}),(0,g.jsx)(`div`,{className:`grid gap-1`,children:e.runs.map(t=>(0,g.jsx)(x,{run:t,selected:t.runId===e.selectedRunId,onSelect:e.onSelect},t.runId))}),e.hasMore?(0,g.jsx)(`button`,{type:`button`,disabled:e.loadingMore,onClick:e.onLoadMore,className:`mt-1 rounded-md px-2 py-1.5 text-left font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground transition-colors hover:bg-secondary/60 disabled:cursor-wait disabled:opacity-60`,children:e.loadingMore?`Loading`:`Load more`}):null]})}function x(e){return(0,g.jsxs)(`button`,{type:`button`,"aria-pressed":e.selected,onClick:()=>e.onSelect(e.run.runId),className:n(`grid min-w-0 gap-1 rounded-md px-2 py-2 text-left transition-colors`,e.selected?`bg-secondary text-foreground`:`text-muted-foreground hover:bg-secondary/60 hover:text-foreground`),children:[(0,g.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,g.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:e.run.name}),(0,g.jsx)(p,{state:e.run.state,id:e.run.runId})]}),(0,g.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 font-mono text-[11px]`,children:[(0,g.jsx)(`span`,{className:`truncate`,title:e.run.runId,children:e.run.runId}),(0,g.jsx)(`span`,{className:`shrink-0`,title:e.run.updatedAt,"data-num":!0,children:l(e.run.updatedAt)})]})]})}function S(e){let t=a(e.run.runId),n=t.data?.tasks??[],o=f(n);return(0,g.jsxs)(`div`,{className:`grid min-w-0 gap-3`,children:[(0,g.jsx)(c,{className:`py-0`,children:(0,g.jsxs)(s,{className:`flex min-w-0 flex-wrap items-center gap-3 p-4`,children:[(0,g.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,g.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,g.jsx)(`h2`,{className:`min-w-0 truncate text-base font-semibold`,children:e.run.name}),(0,g.jsx)(p,{state:e.run.state,id:e.run.runId})]}),(0,g.jsx)(`p`,{className:`mt-1 truncate font-mono text-xs text-muted-foreground`,children:e.run.runId})]}),(0,g.jsxs)(`button`,{type:`button`,onClick:()=>e.onOpenRun(e.run.runId),className:`flex items-center gap-1.5 rounded-md border px-2.5 py-1 font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground transition-colors hover:bg-secondary/60 hover:text-foreground`,children:[(0,g.jsx)(i,{className:`size-3.5`}),`Open run`]})]})}),t.isError?(0,g.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`Cannot load tasks: `,String(t.error)]}):(0,g.jsx)(m,{tasks:n,ordinals:o,pending:t.isPending,onSelect:t=>e.onOpenTask(e.run.runId,t)}),!t.isPending&&n.length>0?(0,g.jsxs)(`button`,{type:`button`,onClick:()=>e.onOpenRun(e.run.runId),className:`inline-flex w-fit items-center gap-1.5 rounded-md px-2 py-1 font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground transition-colors hover:bg-secondary/60 hover:text-foreground`,children:[`Open run by sandbox`,(0,g.jsx)(r,{className:`size-3.5`})]}):null]})}export{_ as SandboxesPage};
@@ -1 +1 @@
1
- import{h as e,t,v as n}from"./react-DtOYBmep.js";import{t as r}from"./link-BsixJinJ.js";import{r as i,t as a}from"./utils-CEE0-YEp.js";import{n as o,r as s,t as c}from"./lib-DtfURcG3.js";import{t as l}from"./save-1uf5fQff.js";import{t as u}from"./x-fKvnmCoQ.js";import{$ as d,J as f,K as p,Q as m,X as ee,Y as h,Z as te,et as g,k as _}from"./main-RzjfJZwD.js";import{a as v,d as y,f as b,l as x,o as ne,r as S,t as re}from"./bits-Cv0Te4iz.js";var ie=i(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),C=i(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),w=i(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),T=i(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),E=i(`route`,[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]),D=i(`send-horizontal`,[[`path`,{d:`M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z`,key:`117uat`}],[`path`,{d:`M6 12h16`,key:`s4cdu5`}]]),O=n(t(),1),k=e();function A(e){let t=M(e.outbound??[],e.session);if(e.session===null&&t.length===0)return(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.running?`Waiting for Pi session...`:`No Pi session.`});let n=e.session===null?[]:j(e.session.transcript);return n.length===0&&t.length===0?(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.running?`Waiting for Pi session...`:`Pi session has no transcript messages.`}):(0,k.jsxs)(`div`,{className:`grid gap-2.5`,children:[n.map(e=>e.kind===`message`?(0,k.jsx)(F,{text:e.text},e.key):e.kind===`user`?(0,k.jsx)(P,{text:e.text},e.key):e.kind===`tool`?(0,k.jsx)(L,{name:e.name,args:e.args,output:e.output,status:e.status},e.key):e.kind===`thinking`?(0,k.jsx)(R,{text:e.text},e.key):(0,k.jsx)(ae,{level:e.level,text:e.text},e.key)),t.map(e=>(0,k.jsx)(P,{text:e.text,label:`${e.mode===`steer`?`Steer`:`Follow up`} · ${N(e.status)}`,muted:e.status!==`accepted`},e.id)),e.running?(0,k.jsx)(`span`,{className:`caret-blink inline-block h-3.5 w-2 bg-primary`}):null]})}function j(e){let t=[];for(let n of e)switch(n.kind){case`user_message`:t.push({kind:`user`,key:n.id,text:n.text});break;case`assistant_message`:t.push({kind:`message`,key:n.id,text:n.text});break;case`assistant_thinking`:t.push({kind:`thinking`,key:n.id,text:n.text});break;case`tool`:t.push({kind:`tool`,key:n.id,name:n.name,args:n.argsText??(n.args===void 0?void 0:JSON.stringify(n.args)),output:n.resultText,status:n.status===`unknown`?`running`:n.status});break;case`system_notice`:t.push({kind:`system`,key:n.id,level:n.level,text:n.text});break}return t}function M(e,t){return t===null?e:e.filter(e=>!t.transcript.some(t=>t.kind===`user_message`&&t.text===e.text))}function N(e){switch(e){case`sending`:return`sending`;case`accepted`:return`sent to agent`;case`failed`:return`failed`}}function P(e){return(0,k.jsxs)(`div`,{className:a(`ml-auto max-w-[92%] rounded-md px-3.5 py-2.5 text-sm leading-relaxed`,e.muted?`border bg-card/60 text-foreground`:`bg-primary text-primary-foreground`),children:[e.label===void 0?null:(0,k.jsx)(`div`,{className:a(`mb-1 font-mono text-[10px] uppercase tracking-[0.08em]`,e.muted?`text-muted-foreground`:`text-primary-foreground/70`),children:e.label}),(0,k.jsx)(`pre`,{className:`max-h-[24rem] overflow-auto font-sans break-words whitespace-pre-wrap`,children:e.text})]})}function F(e){return(0,k.jsx)(`div`,{className:`rounded-md border bg-card/40 px-3.5 py-2.5 text-sm leading-relaxed`,children:(0,k.jsx)(`div`,{className:`transcript-md`,children:(0,k.jsx)(o,{remarkPlugins:[c],components:se,children:e.text})})})}var I={running:`bg-status-running`,ok:`bg-status-succeeded`,error:`bg-status-failed`};function L(e){return(0,k.jsxs)(`details`,{className:`group rounded-md border bg-muted/30`,children:[(0,k.jsxs)(`summary`,{className:`flex w-full cursor-pointer list-none items-center gap-2 px-3 py-1.5 text-left outline-none transition-colors hover:bg-muted/40 focus-visible:ring-[3px] focus-visible:ring-ring/40 [&::-webkit-details-marker]:hidden`,children:[(0,k.jsx)(s,{className:`size-3 shrink-0 text-muted-foreground transition-transform group-open:rotate-90`}),(0,k.jsx)(`span`,{className:a(`size-1.5 shrink-0 rounded-full`,I[e.status],e.status===`running`&&`animate-pulse`)}),(0,k.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:`used`}),(0,k.jsx)(`span`,{className:`font-mono text-xs font-medium text-foreground`,children:e.name})]}),e.args===void 0?null:(0,k.jsx)(`pre`,{className:`overflow-x-auto border-t px-3 py-2 font-mono text-[11px] break-all whitespace-pre-wrap text-muted-foreground`,children:e.args}),e.output===void 0?null:(0,k.jsx)(`pre`,{className:`max-h-64 overflow-auto border-t bg-background/40 px-3 py-2 font-mono text-[11px] break-words whitespace-pre-wrap text-foreground/80`,children:e.output})]})}function R(e){return(0,k.jsxs)(`details`,{className:`group rounded-md border border-dashed bg-muted/20`,children:[(0,k.jsxs)(`summary`,{className:`flex w-full cursor-pointer list-none items-center gap-2 px-3 py-1.5 text-left outline-none transition-colors hover:bg-muted/35 focus-visible:ring-[3px] focus-visible:ring-ring/40 [&::-webkit-details-marker]:hidden`,children:[(0,k.jsx)(s,{className:`size-3 shrink-0 text-muted-foreground transition-transform group-open:rotate-90`}),(0,k.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:`thinking`})]}),(0,k.jsx)(`pre`,{className:`max-h-64 overflow-auto border-t px-3 py-2 font-mono text-[11px] break-words whitespace-pre-wrap text-foreground/75`,children:e.text})]})}function ae(e){return(0,k.jsx)(`div`,{className:a(`px-1 font-mono text-[11px]`,e.level===`error`?`text-status-failed`:e.level===`warn`?`text-status-warn`:`text-muted-foreground/70`),children:e.text})}var oe=/^(https?:|mailto:)/i,se={a({href:e,children:t}){return e===void 0||!oe.test(e)?(0,k.jsx)(`span`,{children:t}):(0,k.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:t})},img({alt:e}){return(0,k.jsxs)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground`,children:[`image blocked`,e?`: ${e}`:``]})}},ce=new Set([`SUCCEEDED`,`FAILED`,`CANCELLED`]);function le(e){let t=p(e.runId),[n,i]=(0,O.useState)([]),o=(0,O.useRef)(null),[s,c]=(0,O.useState)(!0),l=t.data?.tasks??[],u=ne(l),f=[...l].sort((e,t)=>(u.get(e.taskId)??0)-(u.get(t.taskId)??0)),h=f.findIndex(t=>t.taskId===e.taskId),g=h>=0?f[h]:void 0,C=h>0?f[h-1]:void 0,w=h>=0&&h<f.length-1?f[h+1]:void 0,T=g?.status===`RUNNING`,E=g!==void 0&&ce.has(g.status),D=e.transcriptMode,A=te(g===void 0?null:e.taskId,T),j=m(g===void 0?null:e.taskId,D===`raw`,T),M=d(g===void 0?null:e.taskId,T),N=ee(g===void 0?null:e.taskId,T);x(T?1e3:3e4);let P=g===void 0?void 0:v(g),F=h>=0?h+1:void 0,I=A.data??null;(0,O.useEffect)(()=>{e.taskId.length>0&&(c(!0),i([]))},[e.taskId]),(0,O.useEffect)(()=>{if(!s)return;let e=requestAnimationFrame(()=>{let e=o.current;e&&(e.scrollTop=e.scrollHeight)});return()=>cancelAnimationFrame(e)});function L(){let e=o.current;e&&c(we(e))}function R(){let e=o.current;e&&(e.scrollTop=e.scrollHeight,c(!0))}return t.isError?(0,k.jsxs)(`p`,{className:`text-sm text-status-failed`,children:[`Cannot load this run: `,String(t.error)]}):g===void 0&&!t.isPending?(0,k.jsxs)(`div`,{className:`grid gap-3`,children:[(0,k.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No task `,(0,k.jsx)(`span`,{className:`font-mono`,children:e.taskId}),` in this run.`]}),(0,k.jsx)(r,{to:`/runs/$runId`,params:{runId:e.runId},className:`font-mono text-xs text-primary hover:underline`,children:`← back to run`})]}):(0,k.jsxs)(`section`,{className:`flex h-[calc(100dvh-3.5rem-3rem)] min-h-[32rem] flex-col gap-4`,children:[(0,k.jsxs)(`div`,{className:`grid shrink-0 gap-3`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[F===void 0?null:(0,k.jsxs)(`span`,{className:`font-mono text-sm text-muted-foreground`,"data-num":!0,children:[`#`,F]}),(0,k.jsx)(`h1`,{className:a(`text-lg font-semibold tracking-tight`,P===void 0&&`font-mono text-base`),children:P??e.taskId}),g===void 0?null:(0,k.jsx)(re,{state:g.status,id:g.taskId}),(0,k.jsxs)(`div`,{className:`ml-auto flex items-center gap-1.5`,children:[F===void 0?null:(0,k.jsxs)(`span`,{className:`font-mono text-[11px] text-muted-foreground tabular-nums`,"data-num":!0,children:[F,` / `,l.length]}),(0,k.jsx)(Z,{dir:`prev`,runId:e.runId,task:C}),(0,k.jsx)(Z,{dir:`next`,runId:e.runId,task:w})]})]}),g===void 0?(0,k.jsx)(y,{className:`h-12 w-full max-w-xl`}):(0,k.jsxs)(`dl`,{className:`grid grid-cols-2 gap-x-6 gap-y-1.5 sm:grid-cols-3`,children:[(0,k.jsx)(Q,{label:`sandbox`,value:g.assignedSandboxId??g.lastSandboxId??`—`}),(0,k.jsx)(Q,{label:`attempt`,value:String(g.currentAttemptNumber??g.attemptCount??`—`),num:!0}),(0,k.jsx)(Q,{label:`agent`,value:g.agentId}),(0,k.jsx)(Q,{label:`accepted`,value:S(g.assignmentAcceptedAt),num:!0}),(0,k.jsx)(Te,{heartbeatAt:g.assignmentHeartbeatAt,running:g.status===`RUNNING`}),(0,k.jsx)(Q,{label:`finished`,value:S(g.lastFinishedAt),num:!0})]}),g!==void 0&&g.dependsOn.length>0?(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,k.jsx)(`span`,{className:`console-callout`,children:`depends on`}),g.dependsOn.map(t=>(0,k.jsx)(r,{to:`/runs/$runId/t/$taskId`,params:{runId:e.runId,taskId:t},title:t,children:(0,k.jsxs)(b,{variant:`secondary`,className:`font-mono text-[11px] transition-colors hover:bg-secondary/70`,children:[`#`,u.get(t)??`?`]})},t))]}):null]}),(0,k.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-4 lg:grid-cols-[minmax(0,1fr)_minmax(22rem,0.86fr)]`,children:[(0,k.jsx)(`section`,{className:`min-h-0 overflow-y-auto pr-2`,"aria-label":`Task and workpad`,children:(0,k.jsxs)(`div`,{className:`grid gap-3 pb-4`,children:[(0,k.jsx)(de,{task:g}),(0,k.jsx)(V,{taskId:g===void 0?null:e.taskId,workpad:M.data??null,pending:g===void 0||M.isPending,error:M.isError?String(M.error):null},g?.taskId??e.taskId),(0,k.jsx)(fe,{activity:N.data?.activity??[],pending:N.isPending,error:N.isError?String(N.error):null})]})}),(0,k.jsxs)(`section`,{className:`flex min-h-[28rem] min-w-0 flex-col rounded-md border bg-card/35`,"aria-label":`Agent transcript`,children:[(0,k.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b px-3 py-2`,children:[(0,k.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,k.jsx)(`h2`,{className:`console-callout`,children:`Agent transcript`}),T?(0,k.jsx)(b,{variant:`secondary`,className:`font-mono text-[11px]`,children:`live`}):null,I===null?null:(0,k.jsxs)(`span`,{className:`truncate font-mono text-[11px] text-muted-foreground`,children:[I.session.lineCount,` lines ·`,` `,Se(I.session.sizeBytes),I.session.threadId?` · thread ${I.session.threadId}`:``]})]}),(0,k.jsxs)(`div`,{className:`ml-auto flex rounded-md border bg-background p-0.5`,children:[(0,k.jsx)(G,{active:D===`parsed`,onClick:()=>e.onTranscriptModeChange(`parsed`),children:`Parsed`}),(0,k.jsx)(G,{active:D===`raw`,onClick:()=>e.onTranscriptModeChange(`raw`),children:`Raw`})]})]}),(0,k.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,k.jsx)(`div`,{ref:o,onScroll:L,className:`h-full overflow-y-auto p-3`,children:D===`raw`?(0,k.jsx)(_e,{raw:j.data??null,pending:j.isPending,error:j.isError?String(j.error):null,running:T,terminal:E,expectsSession:g!==void 0&&K(g)}):(0,k.jsx)(ge,{session:I,error:I===null&&A.isError?String(A.error):null,pending:I===null&&A.isPending,running:T,terminal:E,expectsSession:g!==void 0&&K(g),outbound:n})}),s?null:(0,k.jsxs)(_,{type:`button`,size:`xs`,variant:`secondary`,className:`absolute right-3 bottom-3 shadow-md`,onClick:R,children:[(0,k.jsx)(ie,{className:`size-3`}),`Jump to latest`]})]}),(0,k.jsx)(`div`,{className:`shrink-0 border-t bg-background/95 p-3`,children:(0,k.jsx)(ue,{taskId:g===void 0?null:e.taskId,running:T,supported:g!==void 0,onMessageQueued:e=>{i(t=>[...t,e])},onMessageStatus:(e,t)=>{i(n=>n.map(n=>n.id===e?{...n,status:t}:n))}},g?.taskId??e.taskId)})]})]})]})}function ue(e){let[t,n]=(0,O.useState)(`follow_up`),[r,i]=(0,O.useState)(``),a=h(e.taskId),o=e.supported&&e.running&&e.taskId!==null&&r.trim().length>0&&!a.isPending;async function s(){let n=r.trim();if(!o||n.length===0)return;let s=`local-${Date.now()}-${Math.random().toString(16).slice(2)}`;e.onMessageQueued({id:s,mode:t,text:n,status:`sending`}),i(``);try{await a.mutateAsync({mode:t,message:n}),e.onMessageStatus(s,`accepted`)}catch{e.onMessageStatus(s,`failed`),i(n)}}return(0,k.jsxs)(`section`,{className:`grid gap-2 rounded-md border bg-card/35 p-2.5`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,k.jsxs)(_,{type:`button`,variant:t===`follow_up`?`secondary`:`ghost`,size:`xs`,onClick:()=>n(`follow_up`),children:[(0,k.jsx)(w,{className:`size-3.5`}),`Follow up`]}),(0,k.jsxs)(_,{type:`button`,variant:t===`steer`?`secondary`:`ghost`,size:`xs`,onClick:()=>n(`steer`),children:[(0,k.jsx)(E,{className:`size-3.5`}),`Steer`]})]}),(0,k.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,k.jsx)(`textarea`,{value:r,onChange:e=>i(e.currentTarget.value),placeholder:e.supported?e.running?t===`follow_up`?`Add a follow-up message…`:`Steer the agent…`:`Task is no longer running.`:`No task selected.`,disabled:!e.supported||!e.running,"aria-label":t===`follow_up`?`Follow-up message`:`Steer message`,rows:2,onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),s())},className:`min-h-16 flex-1 resize-y rounded-md border bg-background px-3 py-2 text-sm leading-relaxed outline-none transition-colors placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50`}),(0,k.jsx)(_,{type:`button`,size:`icon-sm`,disabled:!o,onClick:()=>void s(),"aria-label":`Send agent message`,title:e.supported?e.running?`Send to running agent`:`Task is not running.`:`No task selected.`,children:(0,k.jsx)(D,{className:`size-4`})})]}),a.isError?(0,k.jsx)(`p`,{className:`text-xs text-destructive`,children:String(a.error)}):null]})}function de(e){if(e.task===void 0)return(0,k.jsx)(y,{className:`h-24 w-full`});let t=ye(e.task),n=ve(e.task),r=xe(e.task.input),i=t.bodyMarkdown;return(0,k.jsxs)(`section`,{className:`rounded-md border bg-card/45 p-3`,children:[(0,k.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center gap-2`,children:[(0,k.jsx)(`h2`,{className:`console-callout`,children:`Task`}),t.title===void 0?null:(0,k.jsx)(`span`,{className:`text-sm font-medium`,children:t.title})]}),i===void 0?(0,k.jsx)(`p`,{className:`mb-3 rounded-md border border-dashed bg-background/40 p-3 text-sm text-muted-foreground`,children:`No task description was provided for this task.`}):(0,k.jsx)(`div`,{className:`mb-3 rounded-md border bg-background/60 p-3`,children:(0,k.jsx)(U,{markdown:i})}),t.acceptanceCriteria.length>0?(0,k.jsxs)(`div`,{className:`mb-3`,children:[(0,k.jsx)(`h3`,{className:`console-callout mb-1.5`,children:`Acceptance criteria`}),(0,k.jsx)(`ul`,{className:`grid gap-1 text-sm`,children:Ce(t.acceptanceCriteria).map(e=>(0,k.jsxs)(`li`,{className:`flex gap-2`,children:[(0,k.jsx)(`span`,{className:`mt-1.5 size-1.5 shrink-0 rounded-full bg-muted-foreground/60`}),(0,k.jsx)(`span`,{children:e.text})]},e.key))})]}):null,(0,k.jsxs)(`dl`,{className:`grid gap-x-6 gap-y-2 sm:grid-cols-2`,children:[n===void 0?null:(0,k.jsx)(W,{label:`adapter`,value:n}),e.task.live?.state?.liveStatus===void 0?null:(0,k.jsx)(W,{label:`live state`,value:e.task.live.state.liveStatus}),e.task.live?.latestRoundKey===void 0?null:(0,k.jsx)(W,{label:`latest round`,value:e.task.live.latestRoundKey}),e.task.live?.idleTimeout===void 0?null:(0,k.jsx)(W,{label:`idle timeout`,value:B(e.task)}),t.workspaceKey===void 0?null:(0,k.jsx)(W,{label:`project key`,value:t.workspaceKey}),t.externalSource?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(W,{label:`source`,value:be(t.externalSource)}),(0,k.jsx)(W,{label:`source url`,value:t.externalSource.url??`—`,href:X(t.externalSource.url)})]}):null]}),(0,k.jsx)(z,{task:e.task}),r===void 0?null:(0,k.jsxs)(`details`,{className:`mt-3 rounded-md border bg-background/60`,children:[(0,k.jsx)(`summary`,{className:`cursor-pointer px-3 py-2 font-mono text-[11px] uppercase tracking-[0.12em] text-muted-foreground`,children:`Adapter input`}),(0,k.jsx)(`pre`,{className:`max-h-48 overflow-auto border-t px-3 py-2 text-xs whitespace-pre-wrap`,children:r})]})]})}function z(e){let t=e.task.live?.rounds??[];if(t.length===0)return null;let n=[...t].sort((e,t)=>e.sequence-t.sequence);return(0,k.jsxs)(`div`,{className:`mt-3`,children:[(0,k.jsx)(`h3`,{className:`console-callout mb-1.5`,children:`Round history`}),(0,k.jsx)(`ol`,{className:`grid gap-2`,children:n.map(e=>(0,k.jsxs)(`li`,{className:`rounded-md border bg-background/60 p-2`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,k.jsxs)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:[`#`,e.sequence]}),(0,k.jsx)(`span`,{className:`font-mono text-xs font-medium`,children:e.roundKey}),(0,k.jsx)(b,{variant:`outline`,className:`font-mono text-[10px] uppercase tracking-[0.08em]`,children:e.status}),e.completedAt===void 0?(0,k.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:S(e.promptedAt)}):(0,k.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:S(e.completedAt)})]}),e.summary!==void 0||e.terminalReason!==void 0?(0,k.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.summary,e.terminalReason].filter(e=>!!e).join(` · `)}):null,e.outputs!==void 0&&e.outputs.length>0?(0,k.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:e.outputs.map(t=>(0,k.jsxs)(`a`,{href:t.href,className:`inline-flex items-center gap-1 rounded-sm border px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground transition-colors hover:bg-secondary/60 hover:text-foreground`,title:`${t.kind} output ${t.outputKey}`,children:[t.outputKey,(0,k.jsx)(`span`,{className:`text-[10px] uppercase`,children:t.kind})]},`${e.roundKey}:${t.outputKey}`))}):null]},`${e.sequence}:${e.roundKey}`))})]})}function B(e){let t=e.live?.idleTimeout;if(!t)return`—`;let n=t.graceExpiresAt??t.expiresAt;return[t.action,n?S(n):void 0].filter(e=>!!e).join(` · `)}function V(e){let t=f(e.taskId),[n,r]=(0,O.useState)(!1),[i,a]=(0,O.useState)(``),[o,s]=(0,O.useState)(null),c=e.workpad?.bodyMarkdown??``;(0,O.useEffect)(()=>{n||a(c)},[c,n]);async function d(){if(e.taskId!==null)try{await t.mutateAsync({bodyMarkdown:i,baseVersion:o?.version??e.workpad?.version??0}),r(!1),s(null)}catch{}}let p=e.taskId!==null&&e.workpad!==null&&!e.pending&&e.error===null,m=p&&o!==null&&i!==o.body&&!t.isPending;return(0,k.jsxs)(`section`,{className:`rounded-md border bg-card/45 p-3`,children:[(0,k.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center gap-2`,children:[(0,k.jsx)(`h2`,{className:`console-callout`,children:`Workpad`}),e.workpad?(0,k.jsxs)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,"data-num":!0,children:[`v`,e.workpad.version,` · updated`,` `,S(e.workpad.updatedAt)]}):null,(0,k.jsx)(`div`,{className:`ml-auto flex items-center gap-1.5`,children:n?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(_,{type:`button`,size:`xs`,variant:`ghost`,disabled:t.isPending,onClick:()=>{a(c),s(null),r(!1)},children:[(0,k.jsx)(u,{className:`size-3`}),`Cancel`]}),(0,k.jsxs)(_,{type:`button`,size:`xs`,disabled:!m,onClick:()=>void d(),children:[(0,k.jsx)(l,{className:`size-3`}),t.isPending?`Saving`:`Save`]})]}):(0,k.jsxs)(_,{type:`button`,size:`xs`,variant:`outline`,disabled:!p,onClick:()=>{a(c),s({body:c,version:e.workpad?.version??0}),r(!0)},children:[(0,k.jsx)(T,{className:`size-3`}),e.workpad===null?`Write`:`Edit`]})})]}),e.error===null?e.pending?(0,k.jsx)($,{}):n?(0,k.jsx)(`textarea`,{value:i,onChange:e=>a(e.currentTarget.value),rows:10,className:`min-h-56 w-full resize-y rounded-md border bg-background px-3 py-2 font-mono text-sm leading-relaxed outline-none transition-colors placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/40`,placeholder:`Write the task workpad…`}):e.workpad===null?(0,k.jsx)(`p`,{className:`rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive`,children:`Workpad missing for this task.`}):(0,k.jsx)(U,{markdown:e.workpad.bodyMarkdown}):(0,k.jsx)(`p`,{className:`text-sm text-destructive`,children:e.error}),t.isError?(0,k.jsx)(`p`,{className:`mt-2 text-xs text-destructive`,children:he(t.error)}):null]})}function fe(e){return(0,k.jsxs)(`section`,{className:`rounded-md border bg-card/45 p-3`,children:[(0,k.jsx)(`div`,{className:`mb-2 flex items-center gap-2`,children:(0,k.jsx)(`h2`,{className:`console-callout`,children:`Activity`})}),e.error===null?e.pending?(0,k.jsx)($,{}):e.activity.length===0?(0,k.jsx)(`p`,{className:`rounded-md border border-dashed bg-background/40 p-3 text-sm text-muted-foreground`,children:`No task activity yet.`}):(0,k.jsx)(`ol`,{className:`grid gap-2`,children:e.activity.map(e=>(0,k.jsxs)(`li`,{className:`rounded-md border bg-background/50 p-2`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,k.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:S(e.createdAt)}),(0,k.jsx)(`span`,{className:`font-mono text-xs font-medium`,children:pe(e)}),(0,k.jsxs)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:[e.actorKind,e.actorId?` · ${e.actorId}`:``]})]}),H(e)?(0,k.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:H(e)}):null]},e.activityId))}):(0,k.jsx)(`p`,{className:`text-sm text-destructive`,children:e.error})]})}function pe(e){switch(e.type){case`workpad.updated`:return`updated workpad`;case`human_input.queued`:return e.data?.mode===`steer`?`queued steer`:`queued follow-up`;case`live_round.prompted`:return`round prompt`;case`live_round.steer_queued`:return`round steer`;case`live_round.completed`:return`round completed`;case`live_round.failed`:return`round failed`;case`live_round.cancelled`:return`round cancelled`;case`live_round.finish_requested`:return`finish requested`;default:return e.type}}function H(e){if(e.type===`workpad.updated`){let t=e.data?.version;return typeof t==`number`?`workpad v${t}`:void 0}if(e.type===`human_input.queued`){let t=e.data?.messagePreview;return typeof t==`string`?t:void 0}if(e.type.startsWith(`live_round.`))return me(e)}function me(e){let t=[],n=e.data?.roundKey;typeof n==`string`&&t.push(n);let r=e.data?.childKey;typeof r==`string`&&t.push(r);let i=e.data?.summary;typeof i==`string`&&t.push(i);let a=e.data?.terminalReason;typeof a==`string`&&t.push(a);let o=e.data?.messagePreview;typeof o==`string`&&t.push(o);let s=e.data?.outputKeys;return Array.isArray(s)&&s.length>0&&t.push(`outputs ${s.join(`, `)}`),t.length>0?t.join(` · `):void 0}function he(e){return e instanceof g&&e.status===409?`Workpad changed since you started editing. Cancel and reopen to review the latest version before saving.`:String(e)}function U(e){let t=e.markdown.replace(/^<!--\s*flakes:task-workpad:v1\s*-->\s*/,``);return(0,k.jsx)(`div`,{className:`space-y-3 text-sm leading-relaxed`,children:(0,k.jsx)(o,{remarkPlugins:[c],components:{h1:({children:e})=>(0,k.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:e}),h2:({children:e})=>(0,k.jsx)(`h2`,{className:`mt-4 border-b pb-1 text-base font-semibold first:mt-0`,children:e}),h3:({children:e})=>(0,k.jsx)(`h3`,{className:`mt-3 text-sm font-semibold`,children:e}),p:({children:e})=>(0,k.jsx)(`p`,{children:e}),ul:({children:e})=>(0,k.jsx)(`ul`,{className:`list-disc space-y-1 pl-5`,children:e}),ol:({children:e})=>(0,k.jsx)(`ol`,{className:`list-decimal space-y-1 pl-5`,children:e}),li:({children:e})=>(0,k.jsx)(`li`,{children:e}),code:({children:e})=>(0,k.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-[0.9em]`,children:e}),pre:({children:e})=>(0,k.jsx)(`pre`,{className:`overflow-auto rounded-md bg-muted p-3 text-xs`,children:e}),a:({children:e,href:t})=>{let n=X(t);return n?(0,k.jsx)(`a`,{href:n,target:`_blank`,rel:`noreferrer`,className:`text-primary underline underline-offset-2`,children:e}):e},img:({alt:e})=>(0,k.jsxs)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground`,children:[`image blocked`,e?`: ${e}`:``]}),blockquote:({children:e})=>(0,k.jsx)(`blockquote`,{className:`border-l-2 pl-3 text-muted-foreground`,children:e})},children:t})})}function W(e){return(0,k.jsxs)(`div`,{className:`min-w-0`,children:[(0,k.jsx)(`dt`,{className:`console-callout`,children:e.label}),(0,k.jsx)(`dd`,{className:`truncate font-mono text-xs text-foreground`,children:e.href?(0,k.jsx)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,className:`text-primary hover:underline`,children:e.value}):e.value})]})}function ge(e){return e.error===null?e.pending&&e.outbound.length===0?(0,k.jsx)($,{}):e.session===null&&e.terminal&&e.expectsSession?(0,k.jsx)(`p`,{className:`text-sm text-destructive`,children:`Pi session missing after task finished.`}):(0,k.jsx)(A,{session:e.session,running:e.running,outbound:e.outbound}):(0,k.jsx)(`p`,{className:`text-sm text-destructive`,children:e.error})}function _e(e){return e.error===null?e.pending?(0,k.jsx)($,{}):e.raw===null?e.terminal&&e.expectsSession?(0,k.jsx)(`p`,{className:`text-sm text-destructive`,children:`Raw Pi session missing after task finished.`}):(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.running?`Waiting for raw Pi session...`:`No raw Pi session.`}):(0,k.jsx)(`pre`,{className:`min-h-full overflow-auto rounded-md bg-background/70 p-3 font-mono text-[11px] break-words whitespace-pre-wrap text-foreground/80`,children:e.raw}):(0,k.jsx)(`p`,{className:`text-sm text-destructive`,children:e.error})}function G(e){return(0,k.jsx)(`button`,{type:`button`,className:a(`rounded px-2 py-1 font-mono text-[11px] transition-colors`,e.active?`bg-primary text-primary-foreground`:`text-muted-foreground hover:bg-muted hover:text-foreground`),onClick:e.onClick,children:e.children})}function ve(e){return e.target?.adapter}function K(e){return e.target?.adapter===`pi`}function ye(e){let t=e.metadata??{},n=q(t.externalSource);return{title:J(t.title),bodyMarkdown:J(t.bodyMarkdown),acceptanceCriteria:Y(t.acceptanceCriteria),externalSource:n?{kind:J(n.kind),provider:J(n.provider),externalId:J(n.externalId),identifier:J(n.identifier),url:J(n.url)}:void 0,workspaceKey:J(t.workspaceKey)}}function be(e){return[e.provider,e.identifier??e.externalId,e.kind&&!e.provider?e.kind:void 0].filter(Boolean).join(` · `)||`—`}function xe(e){if(e==null)return;let t=q(e),n=t?J(t.prompt):void 0;return n===void 0?JSON.stringify(e,null,2):n}function q(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:void 0}function J(e){return typeof e==`string`&&e.length>0?e:void 0}function Y(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`&&e.length>0):[]}function Se(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KiB`:`${(e/(1024*1024)).toFixed(1)} MiB`}function Ce(e){let t=new Map;return e.map(e=>{let n=t.get(e)??0;return t.set(e,n+1),{text:e,key:n===0?e:`${e}#${n+1}`}})}function X(e){if(e)try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`?t.toString():void 0}catch{return}}function we(e){return e.scrollHeight-e.scrollTop-e.clientHeight<72}function Z(e){let t=e.dir===`prev`?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(C,{className:`size-3.5`}),` Prev`]}):(0,k.jsxs)(k.Fragment,{children:[`Next `,(0,k.jsx)(s,{className:`size-3.5`})]});return e.task===void 0?(0,k.jsx)(`span`,{className:`flex items-center gap-1 rounded-md border border-transparent px-2 py-1 font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground/30`,children:t}):(0,k.jsx)(r,{to:`/runs/$runId/t/$taskId`,params:{runId:e.runId,taskId:e.task.taskId},title:v(e.task)??e.task.taskId,className:`flex items-center gap-1 rounded-md border px-2 py-1 font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground transition-colors hover:bg-secondary/60 hover:text-foreground`,children:t})}function Q(e){return(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`dt`,{className:`console-callout`,children:e.label}),(0,k.jsx)(`dd`,{className:`truncate font-mono text-xs text-foreground`,"data-num":e.num?``:void 0,children:e.value})]})}function Te(e){x(1e3);let t=e.heartbeatAt!==void 0&&Date.now()-Date.parse(e.heartbeatAt)>1e4;return(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`dt`,{className:`console-callout`,children:`heartbeat`}),(0,k.jsxs)(`dd`,{className:`flex min-w-0 items-center gap-1.5 font-mono text-xs text-foreground`,children:[e.running&&e.heartbeatAt!==void 0?(0,k.jsxs)(`span`,{className:`relative size-1.5 shrink-0`,children:[(0,k.jsx)(`span`,{className:a(`absolute inset-0 rounded-full`,t?`bg-status-warn`:`bg-status-running`)}),t?null:(0,k.jsx)(`span`,{className:`blip absolute inset-0 rounded-full border border-status-running`},e.heartbeatAt)]}):null,(0,k.jsx)(`span`,{className:a(`truncate`,e.running&&t&&`text-status-warn`),"data-num":!0,children:S(e.heartbeatAt)})]})]})}function $(){return(0,k.jsxs)(`div`,{className:`grid gap-1 rounded-md bg-muted p-3`,children:[(0,k.jsx)(y,{className:`h-3 w-3/4 bg-foreground/10`}),(0,k.jsx)(y,{className:`h-3 w-full bg-foreground/10`}),(0,k.jsx)(y,{className:`h-3 w-5/6 bg-foreground/10`}),(0,k.jsx)(y,{className:`h-3 w-1/2 bg-foreground/10`}),(0,k.jsx)(y,{className:`h-3 w-11/12 bg-foreground/10`})]})}export{le as TranscriptPage};
1
+ import{h as e,t,v as n}from"./react-DtOYBmep.js";import{t as r}from"./link-BsixJinJ.js";import{r as i,t as a}from"./utils-CEE0-YEp.js";import{n as o,r as s,t as c}from"./lib-DtfURcG3.js";import{t as l}from"./save-1uf5fQff.js";import{t as u}from"./x-fKvnmCoQ.js";import{$ as d,J as f,K as p,Q as m,X as ee,Y as h,Z as te,et as g,k as _}from"./main-KBvz0mSQ.js";import{a as v,d as y,f as b,l as x,o as ne,r as S,t as re}from"./bits-Cv0Te4iz.js";var ie=i(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),C=i(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),w=i(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),T=i(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),E=i(`route`,[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]),D=i(`send-horizontal`,[[`path`,{d:`M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z`,key:`117uat`}],[`path`,{d:`M6 12h16`,key:`s4cdu5`}]]),O=n(t(),1),k=e();function A(e){let t=M(e.outbound??[],e.session);if(e.session===null&&t.length===0)return(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.running?`Waiting for Pi session...`:`No Pi session.`});let n=e.session===null?[]:j(e.session.transcript);return n.length===0&&t.length===0?(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.running?`Waiting for Pi session...`:`Pi session has no transcript messages.`}):(0,k.jsxs)(`div`,{className:`grid gap-2.5`,children:[n.map(e=>e.kind===`message`?(0,k.jsx)(F,{text:e.text},e.key):e.kind===`user`?(0,k.jsx)(P,{text:e.text},e.key):e.kind===`tool`?(0,k.jsx)(L,{name:e.name,args:e.args,output:e.output,status:e.status},e.key):e.kind===`thinking`?(0,k.jsx)(R,{text:e.text},e.key):(0,k.jsx)(ae,{level:e.level,text:e.text},e.key)),t.map(e=>(0,k.jsx)(P,{text:e.text,label:`${e.mode===`steer`?`Steer`:`Follow up`} · ${N(e.status)}`,muted:e.status!==`accepted`},e.id)),e.running?(0,k.jsx)(`span`,{className:`caret-blink inline-block h-3.5 w-2 bg-primary`}):null]})}function j(e){let t=[];for(let n of e)switch(n.kind){case`user_message`:t.push({kind:`user`,key:n.id,text:n.text});break;case`assistant_message`:t.push({kind:`message`,key:n.id,text:n.text});break;case`assistant_thinking`:t.push({kind:`thinking`,key:n.id,text:n.text});break;case`tool`:t.push({kind:`tool`,key:n.id,name:n.name,args:n.argsText??(n.args===void 0?void 0:JSON.stringify(n.args)),output:n.resultText,status:n.status===`unknown`?`running`:n.status});break;case`system_notice`:t.push({kind:`system`,key:n.id,level:n.level,text:n.text});break}return t}function M(e,t){return t===null?e:e.filter(e=>!t.transcript.some(t=>t.kind===`user_message`&&t.text===e.text))}function N(e){switch(e){case`sending`:return`sending`;case`accepted`:return`sent to agent`;case`failed`:return`failed`}}function P(e){return(0,k.jsxs)(`div`,{className:a(`ml-auto max-w-[92%] rounded-md px-3.5 py-2.5 text-sm leading-relaxed`,e.muted?`border bg-card/60 text-foreground`:`bg-primary text-primary-foreground`),children:[e.label===void 0?null:(0,k.jsx)(`div`,{className:a(`mb-1 font-mono text-[10px] uppercase tracking-[0.08em]`,e.muted?`text-muted-foreground`:`text-primary-foreground/70`),children:e.label}),(0,k.jsx)(`pre`,{className:`max-h-[24rem] overflow-auto font-sans break-words whitespace-pre-wrap`,children:e.text})]})}function F(e){return(0,k.jsx)(`div`,{className:`rounded-md border bg-card/40 px-3.5 py-2.5 text-sm leading-relaxed`,children:(0,k.jsx)(`div`,{className:`transcript-md`,children:(0,k.jsx)(o,{remarkPlugins:[c],components:se,children:e.text})})})}var I={running:`bg-status-running`,ok:`bg-status-succeeded`,error:`bg-status-failed`};function L(e){return(0,k.jsxs)(`details`,{className:`group rounded-md border bg-muted/30`,children:[(0,k.jsxs)(`summary`,{className:`flex w-full cursor-pointer list-none items-center gap-2 px-3 py-1.5 text-left outline-none transition-colors hover:bg-muted/40 focus-visible:ring-[3px] focus-visible:ring-ring/40 [&::-webkit-details-marker]:hidden`,children:[(0,k.jsx)(s,{className:`size-3 shrink-0 text-muted-foreground transition-transform group-open:rotate-90`}),(0,k.jsx)(`span`,{className:a(`size-1.5 shrink-0 rounded-full`,I[e.status],e.status===`running`&&`animate-pulse`)}),(0,k.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:`used`}),(0,k.jsx)(`span`,{className:`font-mono text-xs font-medium text-foreground`,children:e.name})]}),e.args===void 0?null:(0,k.jsx)(`pre`,{className:`overflow-x-auto border-t px-3 py-2 font-mono text-[11px] break-all whitespace-pre-wrap text-muted-foreground`,children:e.args}),e.output===void 0?null:(0,k.jsx)(`pre`,{className:`max-h-64 overflow-auto border-t bg-background/40 px-3 py-2 font-mono text-[11px] break-words whitespace-pre-wrap text-foreground/80`,children:e.output})]})}function R(e){return(0,k.jsxs)(`details`,{className:`group rounded-md border border-dashed bg-muted/20`,children:[(0,k.jsxs)(`summary`,{className:`flex w-full cursor-pointer list-none items-center gap-2 px-3 py-1.5 text-left outline-none transition-colors hover:bg-muted/35 focus-visible:ring-[3px] focus-visible:ring-ring/40 [&::-webkit-details-marker]:hidden`,children:[(0,k.jsx)(s,{className:`size-3 shrink-0 text-muted-foreground transition-transform group-open:rotate-90`}),(0,k.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:`thinking`})]}),(0,k.jsx)(`pre`,{className:`max-h-64 overflow-auto border-t px-3 py-2 font-mono text-[11px] break-words whitespace-pre-wrap text-foreground/75`,children:e.text})]})}function ae(e){return(0,k.jsx)(`div`,{className:a(`px-1 font-mono text-[11px]`,e.level===`error`?`text-status-failed`:e.level===`warn`?`text-status-warn`:`text-muted-foreground/70`),children:e.text})}var oe=/^(https?:|mailto:)/i,se={a({href:e,children:t}){return e===void 0||!oe.test(e)?(0,k.jsx)(`span`,{children:t}):(0,k.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:t})},img({alt:e}){return(0,k.jsxs)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground`,children:[`image blocked`,e?`: ${e}`:``]})}},ce=new Set([`SUCCEEDED`,`FAILED`,`CANCELLED`]);function le(e){let t=p(e.runId),[n,i]=(0,O.useState)([]),o=(0,O.useRef)(null),[s,c]=(0,O.useState)(!0),l=t.data?.tasks??[],u=ne(l),f=[...l].sort((e,t)=>(u.get(e.taskId)??0)-(u.get(t.taskId)??0)),h=f.findIndex(t=>t.taskId===e.taskId),g=h>=0?f[h]:void 0,C=h>0?f[h-1]:void 0,w=h>=0&&h<f.length-1?f[h+1]:void 0,T=g?.status===`RUNNING`,E=g!==void 0&&ce.has(g.status),D=e.transcriptMode,A=te(g===void 0?null:e.taskId,T),j=m(g===void 0?null:e.taskId,D===`raw`,T),M=d(g===void 0?null:e.taskId,T),N=ee(g===void 0?null:e.taskId,T);x(T?1e3:3e4);let P=g===void 0?void 0:v(g),F=h>=0?h+1:void 0,I=A.data??null;(0,O.useEffect)(()=>{e.taskId.length>0&&(c(!0),i([]))},[e.taskId]),(0,O.useEffect)(()=>{if(!s)return;let e=requestAnimationFrame(()=>{let e=o.current;e&&(e.scrollTop=e.scrollHeight)});return()=>cancelAnimationFrame(e)});function L(){let e=o.current;e&&c(we(e))}function R(){let e=o.current;e&&(e.scrollTop=e.scrollHeight,c(!0))}return t.isError?(0,k.jsxs)(`p`,{className:`text-sm text-status-failed`,children:[`Cannot load this run: `,String(t.error)]}):g===void 0&&!t.isPending?(0,k.jsxs)(`div`,{className:`grid gap-3`,children:[(0,k.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No task `,(0,k.jsx)(`span`,{className:`font-mono`,children:e.taskId}),` in this run.`]}),(0,k.jsx)(r,{to:`/runs/$runId`,params:{runId:e.runId},className:`font-mono text-xs text-primary hover:underline`,children:`← back to run`})]}):(0,k.jsxs)(`section`,{className:`flex h-[calc(100dvh-3.5rem-3rem)] min-h-[32rem] flex-col gap-4`,children:[(0,k.jsxs)(`div`,{className:`grid shrink-0 gap-3`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[F===void 0?null:(0,k.jsxs)(`span`,{className:`font-mono text-sm text-muted-foreground`,"data-num":!0,children:[`#`,F]}),(0,k.jsx)(`h1`,{className:a(`text-lg font-semibold tracking-tight`,P===void 0&&`font-mono text-base`),children:P??e.taskId}),g===void 0?null:(0,k.jsx)(re,{state:g.status,id:g.taskId}),(0,k.jsxs)(`div`,{className:`ml-auto flex items-center gap-1.5`,children:[F===void 0?null:(0,k.jsxs)(`span`,{className:`font-mono text-[11px] text-muted-foreground tabular-nums`,"data-num":!0,children:[F,` / `,l.length]}),(0,k.jsx)(Z,{dir:`prev`,runId:e.runId,task:C}),(0,k.jsx)(Z,{dir:`next`,runId:e.runId,task:w})]})]}),g===void 0?(0,k.jsx)(y,{className:`h-12 w-full max-w-xl`}):(0,k.jsxs)(`dl`,{className:`grid grid-cols-2 gap-x-6 gap-y-1.5 sm:grid-cols-3`,children:[(0,k.jsx)(Q,{label:`sandbox`,value:g.assignedSandboxId??g.lastSandboxId??`—`}),(0,k.jsx)(Q,{label:`attempt`,value:String(g.currentAttemptNumber??g.attemptCount??`—`),num:!0}),(0,k.jsx)(Q,{label:`agent`,value:g.agentId}),(0,k.jsx)(Q,{label:`accepted`,value:S(g.assignmentAcceptedAt),num:!0}),(0,k.jsx)(Te,{heartbeatAt:g.assignmentHeartbeatAt,running:g.status===`RUNNING`}),(0,k.jsx)(Q,{label:`finished`,value:S(g.lastFinishedAt),num:!0})]}),g!==void 0&&g.dependsOn.length>0?(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,k.jsx)(`span`,{className:`console-callout`,children:`depends on`}),g.dependsOn.map(t=>(0,k.jsx)(r,{to:`/runs/$runId/t/$taskId`,params:{runId:e.runId,taskId:t},title:t,children:(0,k.jsxs)(b,{variant:`secondary`,className:`font-mono text-[11px] transition-colors hover:bg-secondary/70`,children:[`#`,u.get(t)??`?`]})},t))]}):null]}),(0,k.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-4 lg:grid-cols-[minmax(0,1fr)_minmax(22rem,0.86fr)]`,children:[(0,k.jsx)(`section`,{className:`min-h-0 overflow-y-auto pr-2`,"aria-label":`Task and workpad`,children:(0,k.jsxs)(`div`,{className:`grid gap-3 pb-4`,children:[(0,k.jsx)(de,{task:g}),(0,k.jsx)(V,{taskId:g===void 0?null:e.taskId,workpad:M.data??null,pending:g===void 0||M.isPending,error:M.isError?String(M.error):null},g?.taskId??e.taskId),(0,k.jsx)(fe,{activity:N.data?.activity??[],pending:N.isPending,error:N.isError?String(N.error):null})]})}),(0,k.jsxs)(`section`,{className:`flex min-h-[28rem] min-w-0 flex-col rounded-md border bg-card/35`,"aria-label":`Agent transcript`,children:[(0,k.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b px-3 py-2`,children:[(0,k.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,k.jsx)(`h2`,{className:`console-callout`,children:`Agent transcript`}),T?(0,k.jsx)(b,{variant:`secondary`,className:`font-mono text-[11px]`,children:`live`}):null,I===null?null:(0,k.jsxs)(`span`,{className:`truncate font-mono text-[11px] text-muted-foreground`,children:[I.session.lineCount,` lines ·`,` `,Se(I.session.sizeBytes),I.session.threadId?` · thread ${I.session.threadId}`:``]})]}),(0,k.jsxs)(`div`,{className:`ml-auto flex rounded-md border bg-background p-0.5`,children:[(0,k.jsx)(G,{active:D===`parsed`,onClick:()=>e.onTranscriptModeChange(`parsed`),children:`Parsed`}),(0,k.jsx)(G,{active:D===`raw`,onClick:()=>e.onTranscriptModeChange(`raw`),children:`Raw`})]})]}),(0,k.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,k.jsx)(`div`,{ref:o,onScroll:L,className:`h-full overflow-y-auto p-3`,children:D===`raw`?(0,k.jsx)(_e,{raw:j.data??null,pending:j.isPending,error:j.isError?String(j.error):null,running:T,terminal:E,expectsSession:g!==void 0&&K(g)}):(0,k.jsx)(ge,{session:I,error:I===null&&A.isError?String(A.error):null,pending:I===null&&A.isPending,running:T,terminal:E,expectsSession:g!==void 0&&K(g),outbound:n})}),s?null:(0,k.jsxs)(_,{type:`button`,size:`xs`,variant:`secondary`,className:`absolute right-3 bottom-3 shadow-md`,onClick:R,children:[(0,k.jsx)(ie,{className:`size-3`}),`Jump to latest`]})]}),(0,k.jsx)(`div`,{className:`shrink-0 border-t bg-background/95 p-3`,children:(0,k.jsx)(ue,{taskId:g===void 0?null:e.taskId,running:T,supported:g!==void 0,onMessageQueued:e=>{i(t=>[...t,e])},onMessageStatus:(e,t)=>{i(n=>n.map(n=>n.id===e?{...n,status:t}:n))}},g?.taskId??e.taskId)})]})]})]})}function ue(e){let[t,n]=(0,O.useState)(`follow_up`),[r,i]=(0,O.useState)(``),a=h(e.taskId),o=e.supported&&e.running&&e.taskId!==null&&r.trim().length>0&&!a.isPending;async function s(){let n=r.trim();if(!o||n.length===0)return;let s=`local-${Date.now()}-${Math.random().toString(16).slice(2)}`;e.onMessageQueued({id:s,mode:t,text:n,status:`sending`}),i(``);try{await a.mutateAsync({mode:t,message:n}),e.onMessageStatus(s,`accepted`)}catch{e.onMessageStatus(s,`failed`),i(n)}}return(0,k.jsxs)(`section`,{className:`grid gap-2 rounded-md border bg-card/35 p-2.5`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,k.jsxs)(_,{type:`button`,variant:t===`follow_up`?`secondary`:`ghost`,size:`xs`,onClick:()=>n(`follow_up`),children:[(0,k.jsx)(w,{className:`size-3.5`}),`Follow up`]}),(0,k.jsxs)(_,{type:`button`,variant:t===`steer`?`secondary`:`ghost`,size:`xs`,onClick:()=>n(`steer`),children:[(0,k.jsx)(E,{className:`size-3.5`}),`Steer`]})]}),(0,k.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,k.jsx)(`textarea`,{value:r,onChange:e=>i(e.currentTarget.value),placeholder:e.supported?e.running?t===`follow_up`?`Add a follow-up message…`:`Steer the agent…`:`Task is no longer running.`:`No task selected.`,disabled:!e.supported||!e.running,"aria-label":t===`follow_up`?`Follow-up message`:`Steer message`,rows:2,onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),s())},className:`min-h-16 flex-1 resize-y rounded-md border bg-background px-3 py-2 text-sm leading-relaxed outline-none transition-colors placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50`}),(0,k.jsx)(_,{type:`button`,size:`icon-sm`,disabled:!o,onClick:()=>void s(),"aria-label":`Send agent message`,title:e.supported?e.running?`Send to running agent`:`Task is not running.`:`No task selected.`,children:(0,k.jsx)(D,{className:`size-4`})})]}),a.isError?(0,k.jsx)(`p`,{className:`text-xs text-destructive`,children:String(a.error)}):null]})}function de(e){if(e.task===void 0)return(0,k.jsx)(y,{className:`h-24 w-full`});let t=ye(e.task),n=ve(e.task),r=xe(e.task.input),i=t.bodyMarkdown;return(0,k.jsxs)(`section`,{className:`rounded-md border bg-card/45 p-3`,children:[(0,k.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center gap-2`,children:[(0,k.jsx)(`h2`,{className:`console-callout`,children:`Task`}),t.title===void 0?null:(0,k.jsx)(`span`,{className:`text-sm font-medium`,children:t.title})]}),i===void 0?(0,k.jsx)(`p`,{className:`mb-3 rounded-md border border-dashed bg-background/40 p-3 text-sm text-muted-foreground`,children:`No task description was provided for this task.`}):(0,k.jsx)(`div`,{className:`mb-3 rounded-md border bg-background/60 p-3`,children:(0,k.jsx)(U,{markdown:i})}),t.acceptanceCriteria.length>0?(0,k.jsxs)(`div`,{className:`mb-3`,children:[(0,k.jsx)(`h3`,{className:`console-callout mb-1.5`,children:`Acceptance criteria`}),(0,k.jsx)(`ul`,{className:`grid gap-1 text-sm`,children:Ce(t.acceptanceCriteria).map(e=>(0,k.jsxs)(`li`,{className:`flex gap-2`,children:[(0,k.jsx)(`span`,{className:`mt-1.5 size-1.5 shrink-0 rounded-full bg-muted-foreground/60`}),(0,k.jsx)(`span`,{children:e.text})]},e.key))})]}):null,(0,k.jsxs)(`dl`,{className:`grid gap-x-6 gap-y-2 sm:grid-cols-2`,children:[n===void 0?null:(0,k.jsx)(W,{label:`adapter`,value:n}),e.task.live?.state?.liveStatus===void 0?null:(0,k.jsx)(W,{label:`live state`,value:e.task.live.state.liveStatus}),e.task.live?.latestRoundKey===void 0?null:(0,k.jsx)(W,{label:`latest round`,value:e.task.live.latestRoundKey}),e.task.live?.idleTimeout===void 0?null:(0,k.jsx)(W,{label:`idle timeout`,value:B(e.task)}),t.workspaceKey===void 0?null:(0,k.jsx)(W,{label:`project key`,value:t.workspaceKey}),t.externalSource?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(W,{label:`source`,value:be(t.externalSource)}),(0,k.jsx)(W,{label:`source url`,value:t.externalSource.url??`—`,href:X(t.externalSource.url)})]}):null]}),(0,k.jsx)(z,{task:e.task}),r===void 0?null:(0,k.jsxs)(`details`,{className:`mt-3 rounded-md border bg-background/60`,children:[(0,k.jsx)(`summary`,{className:`cursor-pointer px-3 py-2 font-mono text-[11px] uppercase tracking-[0.12em] text-muted-foreground`,children:`Adapter input`}),(0,k.jsx)(`pre`,{className:`max-h-48 overflow-auto border-t px-3 py-2 text-xs whitespace-pre-wrap`,children:r})]})]})}function z(e){let t=e.task.live?.rounds??[];if(t.length===0)return null;let n=[...t].sort((e,t)=>e.sequence-t.sequence);return(0,k.jsxs)(`div`,{className:`mt-3`,children:[(0,k.jsx)(`h3`,{className:`console-callout mb-1.5`,children:`Round history`}),(0,k.jsx)(`ol`,{className:`grid gap-2`,children:n.map(e=>(0,k.jsxs)(`li`,{className:`rounded-md border bg-background/60 p-2`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,k.jsxs)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:[`#`,e.sequence]}),(0,k.jsx)(`span`,{className:`font-mono text-xs font-medium`,children:e.roundKey}),(0,k.jsx)(b,{variant:`outline`,className:`font-mono text-[10px] uppercase tracking-[0.08em]`,children:e.status}),e.completedAt===void 0?(0,k.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:S(e.promptedAt)}):(0,k.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:S(e.completedAt)})]}),e.summary!==void 0||e.terminalReason!==void 0?(0,k.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.summary,e.terminalReason].filter(e=>!!e).join(` · `)}):null,e.outputs!==void 0&&e.outputs.length>0?(0,k.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:e.outputs.map(t=>(0,k.jsxs)(`a`,{href:t.href,className:`inline-flex items-center gap-1 rounded-sm border px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground transition-colors hover:bg-secondary/60 hover:text-foreground`,title:`${t.kind} output ${t.outputKey}`,children:[t.outputKey,(0,k.jsx)(`span`,{className:`text-[10px] uppercase`,children:t.kind})]},`${e.roundKey}:${t.outputKey}`))}):null]},`${e.sequence}:${e.roundKey}`))})]})}function B(e){let t=e.live?.idleTimeout;if(!t)return`—`;let n=t.graceExpiresAt??t.expiresAt;return[t.action,n?S(n):void 0].filter(e=>!!e).join(` · `)}function V(e){let t=f(e.taskId),[n,r]=(0,O.useState)(!1),[i,a]=(0,O.useState)(``),[o,s]=(0,O.useState)(null),c=e.workpad?.bodyMarkdown??``;(0,O.useEffect)(()=>{n||a(c)},[c,n]);async function d(){if(e.taskId!==null)try{await t.mutateAsync({bodyMarkdown:i,baseVersion:o?.version??e.workpad?.version??0}),r(!1),s(null)}catch{}}let p=e.taskId!==null&&e.workpad!==null&&!e.pending&&e.error===null,m=p&&o!==null&&i!==o.body&&!t.isPending;return(0,k.jsxs)(`section`,{className:`rounded-md border bg-card/45 p-3`,children:[(0,k.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center gap-2`,children:[(0,k.jsx)(`h2`,{className:`console-callout`,children:`Workpad`}),e.workpad?(0,k.jsxs)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,"data-num":!0,children:[`v`,e.workpad.version,` · updated`,` `,S(e.workpad.updatedAt)]}):null,(0,k.jsx)(`div`,{className:`ml-auto flex items-center gap-1.5`,children:n?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(_,{type:`button`,size:`xs`,variant:`ghost`,disabled:t.isPending,onClick:()=>{a(c),s(null),r(!1)},children:[(0,k.jsx)(u,{className:`size-3`}),`Cancel`]}),(0,k.jsxs)(_,{type:`button`,size:`xs`,disabled:!m,onClick:()=>void d(),children:[(0,k.jsx)(l,{className:`size-3`}),t.isPending?`Saving`:`Save`]})]}):(0,k.jsxs)(_,{type:`button`,size:`xs`,variant:`outline`,disabled:!p,onClick:()=>{a(c),s({body:c,version:e.workpad?.version??0}),r(!0)},children:[(0,k.jsx)(T,{className:`size-3`}),e.workpad===null?`Write`:`Edit`]})})]}),e.error===null?e.pending?(0,k.jsx)($,{}):n?(0,k.jsx)(`textarea`,{value:i,onChange:e=>a(e.currentTarget.value),rows:10,className:`min-h-56 w-full resize-y rounded-md border bg-background px-3 py-2 font-mono text-sm leading-relaxed outline-none transition-colors placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/40`,placeholder:`Write the task workpad…`}):e.workpad===null?(0,k.jsx)(`p`,{className:`rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive`,children:`Workpad missing for this task.`}):(0,k.jsx)(U,{markdown:e.workpad.bodyMarkdown}):(0,k.jsx)(`p`,{className:`text-sm text-destructive`,children:e.error}),t.isError?(0,k.jsx)(`p`,{className:`mt-2 text-xs text-destructive`,children:he(t.error)}):null]})}function fe(e){return(0,k.jsxs)(`section`,{className:`rounded-md border bg-card/45 p-3`,children:[(0,k.jsx)(`div`,{className:`mb-2 flex items-center gap-2`,children:(0,k.jsx)(`h2`,{className:`console-callout`,children:`Activity`})}),e.error===null?e.pending?(0,k.jsx)($,{}):e.activity.length===0?(0,k.jsx)(`p`,{className:`rounded-md border border-dashed bg-background/40 p-3 text-sm text-muted-foreground`,children:`No task activity yet.`}):(0,k.jsx)(`ol`,{className:`grid gap-2`,children:e.activity.map(e=>(0,k.jsxs)(`li`,{className:`rounded-md border bg-background/50 p-2`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,k.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:S(e.createdAt)}),(0,k.jsx)(`span`,{className:`font-mono text-xs font-medium`,children:pe(e)}),(0,k.jsxs)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:[e.actorKind,e.actorId?` · ${e.actorId}`:``]})]}),H(e)?(0,k.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:H(e)}):null]},e.activityId))}):(0,k.jsx)(`p`,{className:`text-sm text-destructive`,children:e.error})]})}function pe(e){switch(e.type){case`workpad.updated`:return`updated workpad`;case`human_input.queued`:return e.data?.mode===`steer`?`queued steer`:`queued follow-up`;case`live_round.prompted`:return`round prompt`;case`live_round.steer_queued`:return`round steer`;case`live_round.completed`:return`round completed`;case`live_round.failed`:return`round failed`;case`live_round.cancelled`:return`round cancelled`;case`live_round.finish_requested`:return`finish requested`;default:return e.type}}function H(e){if(e.type===`workpad.updated`){let t=e.data?.version;return typeof t==`number`?`workpad v${t}`:void 0}if(e.type===`human_input.queued`){let t=e.data?.messagePreview;return typeof t==`string`?t:void 0}if(e.type.startsWith(`live_round.`))return me(e)}function me(e){let t=[],n=e.data?.roundKey;typeof n==`string`&&t.push(n);let r=e.data?.childKey;typeof r==`string`&&t.push(r);let i=e.data?.summary;typeof i==`string`&&t.push(i);let a=e.data?.terminalReason;typeof a==`string`&&t.push(a);let o=e.data?.messagePreview;typeof o==`string`&&t.push(o);let s=e.data?.outputKeys;return Array.isArray(s)&&s.length>0&&t.push(`outputs ${s.join(`, `)}`),t.length>0?t.join(` · `):void 0}function he(e){return e instanceof g&&e.status===409?`Workpad changed since you started editing. Cancel and reopen to review the latest version before saving.`:String(e)}function U(e){let t=e.markdown.replace(/^<!--\s*flakes:task-workpad:v1\s*-->\s*/,``);return(0,k.jsx)(`div`,{className:`space-y-3 text-sm leading-relaxed`,children:(0,k.jsx)(o,{remarkPlugins:[c],components:{h1:({children:e})=>(0,k.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:e}),h2:({children:e})=>(0,k.jsx)(`h2`,{className:`mt-4 border-b pb-1 text-base font-semibold first:mt-0`,children:e}),h3:({children:e})=>(0,k.jsx)(`h3`,{className:`mt-3 text-sm font-semibold`,children:e}),p:({children:e})=>(0,k.jsx)(`p`,{children:e}),ul:({children:e})=>(0,k.jsx)(`ul`,{className:`list-disc space-y-1 pl-5`,children:e}),ol:({children:e})=>(0,k.jsx)(`ol`,{className:`list-decimal space-y-1 pl-5`,children:e}),li:({children:e})=>(0,k.jsx)(`li`,{children:e}),code:({children:e})=>(0,k.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-[0.9em]`,children:e}),pre:({children:e})=>(0,k.jsx)(`pre`,{className:`overflow-auto rounded-md bg-muted p-3 text-xs`,children:e}),a:({children:e,href:t})=>{let n=X(t);return n?(0,k.jsx)(`a`,{href:n,target:`_blank`,rel:`noreferrer`,className:`text-primary underline underline-offset-2`,children:e}):e},img:({alt:e})=>(0,k.jsxs)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground`,children:[`image blocked`,e?`: ${e}`:``]}),blockquote:({children:e})=>(0,k.jsx)(`blockquote`,{className:`border-l-2 pl-3 text-muted-foreground`,children:e})},children:t})})}function W(e){return(0,k.jsxs)(`div`,{className:`min-w-0`,children:[(0,k.jsx)(`dt`,{className:`console-callout`,children:e.label}),(0,k.jsx)(`dd`,{className:`truncate font-mono text-xs text-foreground`,children:e.href?(0,k.jsx)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,className:`text-primary hover:underline`,children:e.value}):e.value})]})}function ge(e){return e.error===null?e.pending&&e.outbound.length===0?(0,k.jsx)($,{}):e.session===null&&e.terminal&&e.expectsSession?(0,k.jsx)(`p`,{className:`text-sm text-destructive`,children:`Pi session missing after task finished.`}):(0,k.jsx)(A,{session:e.session,running:e.running,outbound:e.outbound}):(0,k.jsx)(`p`,{className:`text-sm text-destructive`,children:e.error})}function _e(e){return e.error===null?e.pending?(0,k.jsx)($,{}):e.raw===null?e.terminal&&e.expectsSession?(0,k.jsx)(`p`,{className:`text-sm text-destructive`,children:`Raw Pi session missing after task finished.`}):(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.running?`Waiting for raw Pi session...`:`No raw Pi session.`}):(0,k.jsx)(`pre`,{className:`min-h-full overflow-auto rounded-md bg-background/70 p-3 font-mono text-[11px] break-words whitespace-pre-wrap text-foreground/80`,children:e.raw}):(0,k.jsx)(`p`,{className:`text-sm text-destructive`,children:e.error})}function G(e){return(0,k.jsx)(`button`,{type:`button`,className:a(`rounded px-2 py-1 font-mono text-[11px] transition-colors`,e.active?`bg-primary text-primary-foreground`:`text-muted-foreground hover:bg-muted hover:text-foreground`),onClick:e.onClick,children:e.children})}function ve(e){return e.target?.adapter}function K(e){return e.target?.adapter===`pi`}function ye(e){let t=e.metadata??{},n=q(t.externalSource);return{title:J(t.title),bodyMarkdown:J(t.bodyMarkdown),acceptanceCriteria:Y(t.acceptanceCriteria),externalSource:n?{kind:J(n.kind),provider:J(n.provider),externalId:J(n.externalId),identifier:J(n.identifier),url:J(n.url)}:void 0,workspaceKey:J(t.workspaceKey)}}function be(e){return[e.provider,e.identifier??e.externalId,e.kind&&!e.provider?e.kind:void 0].filter(Boolean).join(` · `)||`—`}function xe(e){if(e==null)return;let t=q(e),n=t?J(t.prompt):void 0;return n===void 0?JSON.stringify(e,null,2):n}function q(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:void 0}function J(e){return typeof e==`string`&&e.length>0?e:void 0}function Y(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`&&e.length>0):[]}function Se(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KiB`:`${(e/(1024*1024)).toFixed(1)} MiB`}function Ce(e){let t=new Map;return e.map(e=>{let n=t.get(e)??0;return t.set(e,n+1),{text:e,key:n===0?e:`${e}#${n+1}`}})}function X(e){if(e)try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`?t.toString():void 0}catch{return}}function we(e){return e.scrollHeight-e.scrollTop-e.clientHeight<72}function Z(e){let t=e.dir===`prev`?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(C,{className:`size-3.5`}),` Prev`]}):(0,k.jsxs)(k.Fragment,{children:[`Next `,(0,k.jsx)(s,{className:`size-3.5`})]});return e.task===void 0?(0,k.jsx)(`span`,{className:`flex items-center gap-1 rounded-md border border-transparent px-2 py-1 font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground/30`,children:t}):(0,k.jsx)(r,{to:`/runs/$runId/t/$taskId`,params:{runId:e.runId,taskId:e.task.taskId},title:v(e.task)??e.task.taskId,className:`flex items-center gap-1 rounded-md border px-2 py-1 font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground transition-colors hover:bg-secondary/60 hover:text-foreground`,children:t})}function Q(e){return(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`dt`,{className:`console-callout`,children:e.label}),(0,k.jsx)(`dd`,{className:`truncate font-mono text-xs text-foreground`,"data-num":e.num?``:void 0,children:e.value})]})}function Te(e){x(1e3);let t=e.heartbeatAt!==void 0&&Date.now()-Date.parse(e.heartbeatAt)>1e4;return(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`dt`,{className:`console-callout`,children:`heartbeat`}),(0,k.jsxs)(`dd`,{className:`flex min-w-0 items-center gap-1.5 font-mono text-xs text-foreground`,children:[e.running&&e.heartbeatAt!==void 0?(0,k.jsxs)(`span`,{className:`relative size-1.5 shrink-0`,children:[(0,k.jsx)(`span`,{className:a(`absolute inset-0 rounded-full`,t?`bg-status-warn`:`bg-status-running`)}),t?null:(0,k.jsx)(`span`,{className:`blip absolute inset-0 rounded-full border border-status-running`},e.heartbeatAt)]}):null,(0,k.jsx)(`span`,{className:a(`truncate`,e.running&&t&&`text-status-warn`),"data-num":!0,children:S(e.heartbeatAt)})]})]})}function $(){return(0,k.jsxs)(`div`,{className:`grid gap-1 rounded-md bg-muted p-3`,children:[(0,k.jsx)(y,{className:`h-3 w-3/4 bg-foreground/10`}),(0,k.jsx)(y,{className:`h-3 w-full bg-foreground/10`}),(0,k.jsx)(y,{className:`h-3 w-5/6 bg-foreground/10`}),(0,k.jsx)(y,{className:`h-3 w-1/2 bg-foreground/10`}),(0,k.jsx)(y,{className:`h-3 w-11/12 bg-foreground/10`})]})}export{le as TranscriptPage};
@@ -1 +1 @@
1
- import{h as e}from"./react-DtOYBmep.js";import{t}from"./DocumentationPage-DrqDulyL.js";import{n}from"./main-RzjfJZwD.js";var r=e();function i(){let{path:e}=n.useLoaderData();return(0,r.jsx)(t,{selectedPath:e})}export{i as component};
1
+ import{h as e}from"./react-DtOYBmep.js";import{t}from"./DocumentationPage-DM-ZYPgQ.js";import{n}from"./main-KBvz0mSQ.js";var r=e();function i(){let{path:e}=n.useLoaderData();return(0,r.jsx)(t,{selectedPath:e})}export{i as component};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RunPage-BC3sGoPN.js","assets/react-DtOYBmep.js","assets/main-RzjfJZwD.js","assets/dist-BtPw3IIV.js","assets/utils-CEE0-YEp.js","assets/link-BsixJinJ.js","assets/react-dom-DrIU40PY.js","assets/matchContext-tJ0VTv5m.js","assets/redirect-BEm0VK76.js","assets/qss-4JXuaDtg.js","assets/file-text-DMdy8OfN.js","assets/lock-D4OhqEPW.js","assets/x-fKvnmCoQ.js","assets/bits-Cv0Te4iz.js","assets/card-DSG3_teC.js","assets/table-DptQuuuq.js","assets/SandboxesLens-BUQQWmH6.js"])))=>i.map(i=>d[i]);
2
- import{h as e,t,v as n}from"./react-DtOYBmep.js";import{ct as r,ot as i,r as a,st as o,w as s}from"./main-RzjfJZwD.js";var c=n(t()),l=e(),u=(0,c.lazy)(()=>s(()=>import(`./RunPage-BC3sGoPN.js`).then(e=>({default:e.RunPage})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])));function d(){let{runId:e}=a.useParams(),{tab:t,view:n}=a.useSearch(),s=i(),c=r();return f(s.pathname)===`/runs/${encodeURIComponent(e)}`?(0,l.jsx)(u,{runId:e,tab:t??`overview`,onTabChange:t=>c({to:`/runs/$runId`,params:{runId:e},search:e=>({...e,tab:t===`overview`?void 0:t}),replace:!0}),view:n??`map`,onViewChange:t=>c({to:`/runs/$runId`,params:{runId:e},search:e=>({...e,view:t===`map`?void 0:t}),replace:!0})}):(0,l.jsx)(o,{})}function f(e){return e===`/`?e:e.replace(/\/$/,``)}export{d as component};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RunPage-i03UqHYF.js","assets/react-DtOYBmep.js","assets/main-KBvz0mSQ.js","assets/dist-BtPw3IIV.js","assets/utils-CEE0-YEp.js","assets/link-BsixJinJ.js","assets/react-dom-DrIU40PY.js","assets/matchContext-tJ0VTv5m.js","assets/redirect-BEm0VK76.js","assets/qss-4JXuaDtg.js","assets/file-text-DMdy8OfN.js","assets/lock-D4OhqEPW.js","assets/x-fKvnmCoQ.js","assets/bits-Cv0Te4iz.js","assets/card-DSG3_teC.js","assets/table-DptQuuuq.js","assets/SandboxesLens-BUQQWmH6.js"])))=>i.map(i=>d[i]);
2
+ import{h as e,t,v as n}from"./react-DtOYBmep.js";import{ct as r,ot as i,r as a,st as o,w as s}from"./main-KBvz0mSQ.js";var c=n(t()),l=e(),u=(0,c.lazy)(()=>s(()=>import(`./RunPage-i03UqHYF.js`).then(e=>({default:e.RunPage})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])));function d(){let{runId:e}=a.useParams(),{tab:t,view:n}=a.useSearch(),s=i(),c=r();return f(s.pathname)===`/runs/${encodeURIComponent(e)}`?(0,l.jsx)(u,{runId:e,tab:t??`overview`,onTabChange:t=>c({to:`/runs/$runId`,params:{runId:e},search:e=>({...e,tab:t===`overview`?void 0:t}),replace:!0}),view:n??`map`,onViewChange:t=>c({to:`/runs/$runId`,params:{runId:e},search:e=>({...e,view:t===`map`?void 0:t}),replace:!0})}):(0,l.jsx)(o,{})}function f(e){return e===`/`?e:e.replace(/\/$/,``)}export{d as component};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TranscriptPage-CTMgJgHp.js","assets/react-DtOYBmep.js","assets/main-RzjfJZwD.js","assets/dist-BtPw3IIV.js","assets/utils-CEE0-YEp.js","assets/link-BsixJinJ.js","assets/react-dom-DrIU40PY.js","assets/matchContext-tJ0VTv5m.js","assets/redirect-BEm0VK76.js","assets/qss-4JXuaDtg.js","assets/lib-DtfURcG3.js","assets/save-1uf5fQff.js","assets/x-fKvnmCoQ.js","assets/bits-Cv0Te4iz.js"])))=>i.map(i=>d[i]);
2
- import{h as e,t,v as n}from"./react-DtOYBmep.js";import{ct as r,t as i,w as a}from"./main-RzjfJZwD.js";var o=n(t()),s=e(),c=(0,o.lazy)(()=>a(()=>import(`./TranscriptPage-CTMgJgHp.js`).then(e=>({default:e.TranscriptPage})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])));function l(){let{runId:e,taskId:t}=i.useParams(),{transcript:n}=i.useSearch(),a=r();return(0,s.jsx)(c,{runId:e,taskId:t,transcriptMode:n??`parsed`,onTranscriptModeChange:n=>a({to:`/runs/$runId/t/$taskId`,params:{runId:e,taskId:t},search:n===`raw`?{transcript:`raw`}:{},replace:!0})})}export{l as component};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TranscriptPage-ChoFjiPI.js","assets/react-DtOYBmep.js","assets/main-KBvz0mSQ.js","assets/dist-BtPw3IIV.js","assets/utils-CEE0-YEp.js","assets/link-BsixJinJ.js","assets/react-dom-DrIU40PY.js","assets/matchContext-tJ0VTv5m.js","assets/redirect-BEm0VK76.js","assets/qss-4JXuaDtg.js","assets/lib-DtfURcG3.js","assets/save-1uf5fQff.js","assets/x-fKvnmCoQ.js","assets/bits-Cv0Te4iz.js"])))=>i.map(i=>d[i]);
2
+ import{h as e,t,v as n}from"./react-DtOYBmep.js";import{ct as r,t as i,w as a}from"./main-KBvz0mSQ.js";var o=n(t()),s=e(),c=(0,o.lazy)(()=>a(()=>import(`./TranscriptPage-ChoFjiPI.js`).then(e=>({default:e.TranscriptPage})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])));function l(){let{runId:e,taskId:t}=i.useParams(),{transcript:n}=i.useSearch(),a=r();return(0,s.jsx)(c,{runId:e,taskId:t,transcriptMode:n??`parsed`,onTranscriptModeChange:n=>a({to:`/runs/$runId/t/$taskId`,params:{runId:e,taskId:t},search:n===`raw`?{transcript:`raw`}:{},replace:!0})})}export{l as component};
@@ -1 +1 @@
1
- import{h as e,t,v as n}from"./react-DtOYBmep.js";import{D as r,T as i,f as a}from"./main-RzjfJZwD.js";import{t as o}from"./account-forms-DrHA3zEd.js";import{a as s,i as c,n as l,r as u,t as d}from"./card-DSG3_teC.js";var f=n(t()),p=e();function m(){let{user:e,refreshSession:t}=i(),[n,m]=(0,f.useState)(!1),[h,g]=(0,f.useState)(null),[_,v]=(0,f.useState)(null);async function y(e){m(!0),g(null),v(null);let n=await r.updateUser({name:e.name});return m(!1),n.error?(g(a(n.error,`Could not update profile.`)),!1):(await t(),v(`Profile updated.`),!0)}let b=e.name??``,x=e.email??`No email recorded`;return(0,p.jsxs)(`section`,{className:`grid max-w-3xl gap-6`,children:[(0,p.jsxs)(`header`,{className:`grid gap-1`,children:[(0,p.jsx)(`p`,{className:`font-mono text-xs uppercase tracking-[0.14em] text-muted-foreground`,children:`Account`}),(0,p.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Profile`}),(0,p.jsx)(`p`,{className:`max-w-2xl text-sm text-muted-foreground`,children:`Manage the identity shown on your Flakes account.`})]}),(0,p.jsxs)(d,{className:`rounded-md`,children:[(0,p.jsxs)(c,{children:[(0,p.jsx)(s,{children:`Account details`}),(0,p.jsx)(u,{children:`Your email address is managed by the authentication provider.`})]}),(0,p.jsx)(l,{children:(0,p.jsx)(o,{name:b,email:x,pending:n,error:h,success:_,onSubmit:y})})]})]})}export{m as component};
1
+ import{h as e,t,v as n}from"./react-DtOYBmep.js";import{D as r,T as i,f as a}from"./main-KBvz0mSQ.js";import{t as o}from"./account-forms-BLo66Mqa.js";import{a as s,i as c,n as l,r as u,t as d}from"./card-DSG3_teC.js";var f=n(t()),p=e();function m(){let{user:e,refreshSession:t}=i(),[n,m]=(0,f.useState)(!1),[h,g]=(0,f.useState)(null),[_,v]=(0,f.useState)(null);async function y(e){m(!0),g(null),v(null);let n=await r.updateUser({name:e.name});return m(!1),n.error?(g(a(n.error,`Could not update profile.`)),!1):(await t(),v(`Profile updated.`),!0)}let b=e.name??``,x=e.email??`No email recorded`;return(0,p.jsxs)(`section`,{className:`grid max-w-3xl gap-6`,children:[(0,p.jsxs)(`header`,{className:`grid gap-1`,children:[(0,p.jsx)(`p`,{className:`font-mono text-xs uppercase tracking-[0.14em] text-muted-foreground`,children:`Account`}),(0,p.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Profile`}),(0,p.jsx)(`p`,{className:`max-w-2xl text-sm text-muted-foreground`,children:`Manage the identity shown on your Flakes account.`})]}),(0,p.jsxs)(d,{className:`rounded-md`,children:[(0,p.jsxs)(c,{children:[(0,p.jsx)(s,{children:`Account details`}),(0,p.jsx)(u,{children:`Your email address is managed by the authentication provider.`})]}),(0,p.jsx)(l,{children:(0,p.jsx)(o,{name:b,email:x,pending:n,error:h,success:_,onSubmit:y})})]})]})}export{m as component};
@@ -1 +1 @@
1
- import{h as e,t,v as n}from"./react-DtOYBmep.js";import{n as r,t as i}from"./signin-form-DWaa_uwj.js";import{t as a}from"./circle-check-B0gtb8OH.js";import{t as o}from"./lock-D4OhqEPW.js";import{t as s}from"./save-1uf5fQff.js";import{t as c}from"./user-DK27uFod.js";import{g as l,h as u,it as d,k as f,rt as p}from"./main-RzjfJZwD.js";var m=n(t(),1),h=e();function g(e){let t=(0,m.useId)(),[n,r]=(0,m.useState)({name:e.name}),[a,o]=(0,m.useState)({});(0,m.useEffect)(()=>{r({name:e.name})},[e.name]);async function l(t){if(t.preventDefault(),e.pending)return;let r=u(n);if(!r.ok){o(r.errors);return}o({}),await e.onSubmit(r.data)}return(0,h.jsxs)(`form`,{className:`grid gap-4`,onSubmit:l,noValidate:!0,children:[(0,h.jsx)(i,{id:t,icon:c,label:`Name`,type:`text`,autoComplete:`name`,value:n.name,error:a.name,onChange:e=>r({name:e})}),(0,h.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,h.jsx)(`span`,{className:`console-callout`,children:`Email`}),(0,h.jsx)(`div`,{className:`rounded-md border bg-muted/25 px-3 py-2 font-mono text-sm text-muted-foreground`,children:e.email})]}),(0,h.jsx)(v,{error:e.error,success:e.success}),(0,h.jsx)(f,{type:`submit`,disabled:e.pending,className:`w-fit font-mono`,children:e.pending?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(d,{className:`size-4 animate-spin`}),` Saving`]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s,{className:`size-4`}),` Save profile`]})})]})}function _(e){let t=(0,m.useId)(),n=(0,m.useId)(),r=(0,m.useId)(),[a,s]=(0,m.useState)({currentPassword:``,newPassword:``,confirmPassword:``}),[c,u]=(0,m.useState)({});async function g(t){if(t.preventDefault(),e.pending)return;let n=l(a);if(!n.ok){u(n.errors);return}u({}),await e.onSubmit(n.data)&&s({currentPassword:``,newPassword:``,confirmPassword:``})}return(0,h.jsxs)(`form`,{className:`grid gap-4`,onSubmit:g,noValidate:!0,children:[(0,h.jsx)(i,{id:t,icon:o,label:`Current password`,type:`password`,autoComplete:`current-password`,value:a.currentPassword,error:c.currentPassword,onChange:e=>s(t=>({...t,currentPassword:e}))}),(0,h.jsx)(i,{id:n,icon:p,label:`New password`,type:`password`,autoComplete:`new-password`,value:a.newPassword,error:c.newPassword,onChange:e=>s(t=>({...t,newPassword:e}))}),(0,h.jsx)(i,{id:r,icon:p,label:`Confirm password`,type:`password`,autoComplete:`new-password`,value:a.confirmPassword,error:c.confirmPassword,onChange:e=>s(t=>({...t,confirmPassword:e}))}),(0,h.jsx)(v,{error:e.error,success:e.success}),(0,h.jsx)(f,{type:`submit`,disabled:e.pending,className:`w-fit font-mono`,children:e.pending?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(d,{className:`size-4 animate-spin`}),` Updating`]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(p,{className:`size-4`}),` Change password`]})})]})}function v(e){return e.error===null?(0,h.jsx)(`p`,{className:`flex min-h-5 items-start gap-1.5 text-sm text-primary`,children:e.success?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(a,{className:`mt-0.5 size-4 shrink-0`}),(0,h.jsx)(`span`,{children:e.success})]}):null}):(0,h.jsx)(r,{message:e.error})}export{_ as n,g as t};
1
+ import{h as e,t,v as n}from"./react-DtOYBmep.js";import{n as r,t as i}from"./signin-form-Bp22jPob.js";import{t as a}from"./circle-check-B0gtb8OH.js";import{t as o}from"./lock-D4OhqEPW.js";import{t as s}from"./save-1uf5fQff.js";import{t as c}from"./user-DK27uFod.js";import{g as l,h as u,it as d,k as f,rt as p}from"./main-KBvz0mSQ.js";var m=n(t(),1),h=e();function g(e){let t=(0,m.useId)(),[n,r]=(0,m.useState)({name:e.name}),[a,o]=(0,m.useState)({});(0,m.useEffect)(()=>{r({name:e.name})},[e.name]);async function l(t){if(t.preventDefault(),e.pending)return;let r=u(n);if(!r.ok){o(r.errors);return}o({}),await e.onSubmit(r.data)}return(0,h.jsxs)(`form`,{className:`grid gap-4`,onSubmit:l,noValidate:!0,children:[(0,h.jsx)(i,{id:t,icon:c,label:`Name`,type:`text`,autoComplete:`name`,value:n.name,error:a.name,onChange:e=>r({name:e})}),(0,h.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,h.jsx)(`span`,{className:`console-callout`,children:`Email`}),(0,h.jsx)(`div`,{className:`rounded-md border bg-muted/25 px-3 py-2 font-mono text-sm text-muted-foreground`,children:e.email})]}),(0,h.jsx)(v,{error:e.error,success:e.success}),(0,h.jsx)(f,{type:`submit`,disabled:e.pending,className:`w-fit font-mono`,children:e.pending?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(d,{className:`size-4 animate-spin`}),` Saving`]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s,{className:`size-4`}),` Save profile`]})})]})}function _(e){let t=(0,m.useId)(),n=(0,m.useId)(),r=(0,m.useId)(),[a,s]=(0,m.useState)({currentPassword:``,newPassword:``,confirmPassword:``}),[c,u]=(0,m.useState)({});async function g(t){if(t.preventDefault(),e.pending)return;let n=l(a);if(!n.ok){u(n.errors);return}u({}),await e.onSubmit(n.data)&&s({currentPassword:``,newPassword:``,confirmPassword:``})}return(0,h.jsxs)(`form`,{className:`grid gap-4`,onSubmit:g,noValidate:!0,children:[(0,h.jsx)(i,{id:t,icon:o,label:`Current password`,type:`password`,autoComplete:`current-password`,value:a.currentPassword,error:c.currentPassword,onChange:e=>s(t=>({...t,currentPassword:e}))}),(0,h.jsx)(i,{id:n,icon:p,label:`New password`,type:`password`,autoComplete:`new-password`,value:a.newPassword,error:c.newPassword,onChange:e=>s(t=>({...t,newPassword:e}))}),(0,h.jsx)(i,{id:r,icon:p,label:`Confirm password`,type:`password`,autoComplete:`new-password`,value:a.confirmPassword,error:c.confirmPassword,onChange:e=>s(t=>({...t,confirmPassword:e}))}),(0,h.jsx)(v,{error:e.error,success:e.success}),(0,h.jsx)(f,{type:`submit`,disabled:e.pending,className:`w-fit font-mono`,children:e.pending?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(d,{className:`size-4 animate-spin`}),` Updating`]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(p,{className:`size-4`}),` Change password`]})})]})}function v(e){return e.error===null?(0,h.jsx)(`p`,{className:`flex min-h-5 items-start gap-1.5 text-sm text-primary`,children:e.success?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(a,{className:`mt-0.5 size-4 shrink-0`}),(0,h.jsx)(`span`,{children:e.success})]}):null}):(0,h.jsx)(r,{message:e.error})}export{_ as n,g as t};
@@ -1 +1 @@
1
- import{h as e}from"./react-DtOYBmep.js";import{B as t,O as n}from"./main-RzjfJZwD.js";import{a as r,i,n as a,r as o,t as s}from"./card-DSG3_teC.js";var c=e();function l(e){return(0,c.jsxs)(`main`,{className:`relative flex min-h-screen items-center justify-center bg-muted/40 p-4 sm:p-6`,style:{backgroundImage:`radial-gradient(var(--border) 1px, transparent 1px)`,backgroundSize:`24px 24px`},children:[(0,c.jsx)(`div`,{className:`absolute right-4 top-4 sm:right-6 sm:top-6`,children:(0,c.jsx)(n,{})}),(0,c.jsxs)(s,{className:`w-full max-w-sm gap-4 rounded-md py-5 shadow-sm`,children:[(0,c.jsxs)(i,{className:`gap-3 px-5`,children:[(0,c.jsx)(r,{className:`text-base`,children:(0,c.jsx)(t,{})}),(0,c.jsxs)(`div`,{className:`grid gap-1`,children:[(0,c.jsx)(`h1`,{className:`text-xl font-semibold leading-tight tracking-tight`,children:e.title}),(0,c.jsx)(o,{children:e.description})]})]}),(0,c.jsx)(a,{className:`px-5`,children:e.children}),e.footer?(0,c.jsx)(`div`,{className:`border-t px-5 pt-4 text-sm text-muted-foreground`,children:e.footer}):null]})]})}export{l as t};
1
+ import{h as e}from"./react-DtOYBmep.js";import{B as t,O as n}from"./main-KBvz0mSQ.js";import{a as r,i,n as a,r as o,t as s}from"./card-DSG3_teC.js";var c=e();function l(e){return(0,c.jsxs)(`main`,{className:`relative flex min-h-screen items-center justify-center bg-muted/40 p-4 sm:p-6`,style:{backgroundImage:`radial-gradient(var(--border) 1px, transparent 1px)`,backgroundSize:`24px 24px`},children:[(0,c.jsx)(`div`,{className:`absolute right-4 top-4 sm:right-6 sm:top-6`,children:(0,c.jsx)(n,{})}),(0,c.jsxs)(s,{className:`w-full max-w-sm gap-4 rounded-md py-5 shadow-sm`,children:[(0,c.jsxs)(i,{className:`gap-3 px-5`,children:[(0,c.jsx)(r,{className:`text-base`,children:(0,c.jsx)(t,{})}),(0,c.jsxs)(`div`,{className:`grid gap-1`,children:[(0,c.jsx)(`h1`,{className:`text-xl font-semibold leading-tight tracking-tight`,children:e.title}),(0,c.jsx)(o,{children:e.description})]})]}),(0,c.jsx)(a,{className:`px-5`,children:e.children}),e.footer?(0,c.jsx)(`div`,{className:`border-t px-5 pt-4 text-sm text-muted-foreground`,children:e.footer}):null]})]})}export{l as t};
@@ -1 +1 @@
1
- import{h as e,t,v as n}from"./react-DtOYBmep.js";import{t as r}from"./link-BsixJinJ.js";import{r as i,t as a}from"./utils-CEE0-YEp.js";import{t as o}from"./arrow-right-BMW8fJP5.js";import{r as s}from"./signin-form-DWaa_uwj.js";import{t as c}from"./circle-check-B0gtb8OH.js";import{t as ee}from"./otp-verification-Cqa6lopR.js";import{t as l}from"./user-DK27uFod.js";import{D as u,E as d,ct as f,f as p,i as m,it as h,k as g,p as te,rt as _}from"./main-RzjfJZwD.js";import{t as v}from"./auth-layout-INHonQMf.js";var y=i(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),b=i(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),x=n(t(),1);function S(e){return(e??``).trim().replace(/[\s-]+/g,``).toUpperCase()}function C(e){return S(E(e)??e)}function w(e){let t=e??``,n=(t.includes(`user_code=`)?C(t):void 0)??t.toUpperCase(),r=[];for(let e of n){if(r.length>=8)break;if(e===`-`)continue;if(e.trim()===``){r.push(` `);continue}let t=C(e);t.length>0&&r.push(t[0]??` `)}return r.concat(Array(8).fill(` `)).slice(0,8)}function T(e){let t=S(e);return t.length<=4?t:`${t.slice(0,4)}-${t.slice(4)}`}function E(e){let t=e?.trim();if(t?.includes(`user_code=`))try{return new URL(t,`http://console.invalid`).searchParams.get(`user_code`)??void 0}catch{return}}function D(e){let t=S(e);return t.length===0?`/device`:`/device?user_code=${encodeURIComponent(t)}`}async function ne(e,t){let n=S(t);if(n.length===0)return M(n,{title:`Device code missing`,message:`Start login again from the Flakes CLI.`});let r=await e.verify(n);if(r.error)return j(n,r.error);switch(r.data?.status){case`pending`:return{state:`ready`,userCode:n,displayUserCode:T(n)};case`approved`:return k(n);case`denied`:return A(n);default:return M(n,{title:`Device code not found`,message:`Start login again from the Flakes CLI.`})}}async function O(e,t,n){let r=S(n);if(r.length===0)return M(r,{title:`Device code missing`,message:`Start login again from the Flakes CLI.`});let i=t===`approve`?await e.approve(r):await e.deny(r);return i.error?j(r,i.error):t===`approve`?k(r):A(r)}function k(e){return{state:`approved`,userCode:e,displayUserCode:T(e),title:`CLI session authorized`,message:`Open the console to continue.`}}function A(e){return{state:`denied`,userCode:e,displayUserCode:T(e),title:`CLI session denied`,message:`The waiting login request has been rejected.`}}function j(e,t){switch(N(t)){case`expired_token`:return M(e,{title:`Device code expired`,message:`Start login again from the Flakes CLI.`});case`device_code_already_processed`:return M(e,{title:`Device code already used`,message:`This login request has already been completed.`});case`unauthorized`:return M(e,{title:`Sign-in required`,message:`Sign in again before authorizing the CLI.`});case`access_denied`:return M(e,{title:`Device code belongs to another user`,message:`Use the same account that opened the device request.`});default:return M(e,{title:`Device code not found`,message:`Start login again from the Flakes CLI.`})}}function M(e,t){return{state:`invalid`,userCode:e,displayUserCode:T(e),...t}}function N(e){if(typeof e!=`object`||!e)return``;let t=e;for(let e of[`code`,`error`,`status`,`statusText`]){let n=t[e];if(typeof n==`string`&&n.length>0)return n.toLowerCase()}return``}var P=e(),F=[`device-code-slot-1`,`device-code-slot-2`,`device-code-slot-3`,`device-code-slot-4`,`device-code-slot-5`,`device-code-slot-6`,`device-code-slot-7`,`device-code-slot-8`];function I(e){let t=(0,x.useRef)([]),n=(0,x.useRef)(void 0),r=w(e.value);(0,x.useEffect)(()=>{if(!e.error){n.current=void 0;return}if(n.current!==e.errorPulse){n.current=e.errorPulse;for(let e of t.current)e&&(e.classList.remove(`device-code-slot-error`),e.offsetWidth,e.classList.add(`device-code-slot-error`))}},[e.error,e.errorPulse]);function i(n,r){e.onChange(n.slice(0,8).join(``)),r!==void 0&&requestAnimationFrame(()=>{t.current[L(r)]?.focus()})}function a(e,t){let n=C(t.currentTarget.value);if(n.length===0){let t=r.slice();t[e]=` `,i(t);return}let a=r.slice();for(let t=0;t<n.length;t+=1){let r=e+t;if(r>=8)break;a[r]=n[t]??` `}i(a,e+n.length)}function o(e,t){t.preventDefault();let n=C(t.clipboardData.getData(`text`));if(n.length===0)return;let a=r.slice();for(let t=0;t<n.length;t+=1){let r=e+t;if(r>=8)break;a[r]=n[t]??` `}i(a,e+n.length)}function s(e,n){if(n.key===`Backspace`){n.preventDefault();let t=r.slice();if(r[e]!==` `){t[e]=` `,i(t,e);return}e>0&&(t[e-1]=` `,i(t,e-1));return}if(n.key===`Delete`){n.preventDefault();let t=r.slice();t[e]=` `,i(t,e);return}if(n.key===`ArrowLeft`&&e>0){n.preventDefault(),t.current[e-1]?.focus();return}n.key===`ArrowRight`&&e<7&&(n.preventDefault(),t.current[e+1]?.focus())}return(0,P.jsxs)(`fieldset`,{className:`grid gap-2`,"aria-describedby":`${e.id}-error`,children:[(0,P.jsx)(`legend`,{className:`console-callout pb-2`,children:e.label}),(0,P.jsx)(`div`,{className:`flex items-center gap-1.5`,children:F.map((n,i)=>(0,P.jsx)(R,{ref:e=>{t.current[i]=e},id:i===0?e.id:void 0,value:r[i]?.trim()??``,error:e.error!==void 0,index:i,onChange:e=>a(i,e),onPaste:e=>o(i,e),onKeyDown:e=>s(i,e)},n))}),(0,P.jsx)(`p`,{id:`${e.id}-error`,className:`min-h-4 text-xs text-destructive`,children:e.error??``})]})}function L(e){return Math.max(0,Math.min(e,7))}function R(e){return(0,P.jsxs)(P.Fragment,{children:[e.index===4?(0,P.jsx)(`span`,{className:`px-0.5 font-mono text-sm text-muted-foreground`,children:`-`}):null,(0,P.jsx)(`input`,{ref:e.ref,id:e.id,value:e.value,"aria-label":`Device code character ${e.index+1}`,inputMode:`text`,autoComplete:e.index===0?`one-time-code`:`off`,autoCapitalize:`characters`,maxLength:8,onChange:e.onChange,onPaste:e.onPaste,onKeyDown:e.onKeyDown,className:a(`h-11 w-8 rounded-md border bg-background text-center font-mono text-lg font-semibold outline-none transition-colors sm:w-9`,`focus:border-primary focus:ring-[3px] focus:ring-ring/30`,e.error&&`device-code-slot-error focus:border-destructive focus:ring-destructive/20`)})]})}function z(){let{user_code:e}=m.useSearch(),t=f(),n=u.useSession(),i=S(e),a=(0,x.useMemo)(Y,[]),[o,c]=(0,x.useState)(()=>J(i)),[l,h]=(0,x.useState)(()=>T(i)),[g,_]=(0,x.useState)(),[y,b]=(0,x.useState)(0),[w,E]=(0,x.useState)(!1),[k,A]=(0,x.useState)(null),[j,M]=(0,x.useState)(`signin`),[N,F]=(0,x.useState)(``),[I,L]=(0,x.useState)(``),[R,z]=(0,x.useState)(null);(0,x.useEffect)(()=>{h(T(i)),_(void 0),b(0),M(`signin`),A(null)},[i]),(0,x.useEffect)(()=>{if(n.isPending||i.length===0||n.data===null)return;let e=!0;return c(J(i)),ne(a,i).then(t=>{e&&c(t)}),()=>{e=!1}},[a,n.data,n.isPending,i]);function X(e){e.preventDefault();let n=C(l);if(n.length!==8){_(`Enter the 8-character code shown in your terminal.`),b(e=>e+1);return}if(o.state===`invalid`&&n===i){_(o.title),b(e=>e+1);return}_(void 0),t({to:`/device`,search:{user_code:n},replace:!0})}function Z(e){h(e),_(void 0)}async function Q(e){R||(z(e),c(await O(a,e,i)),z(null))}async function re(e){E(!0),A(null),F(e.email),L(e.password);let t=await u.signIn.email({email:e.email,password:e.password});if(t.error){if(te(t.error)){let t=await u.emailOtp.sendVerificationOtp({email:e.email,type:`email-verification`});if(E(!1),t.error){A(p(t.error,`Could not send verification code.`));return}M(`verify`);return}E(!1),A(p(t.error));return}E(!1),window.location.assign(d(D(i)))}async function ie(e){if(E(!0),A(null),(await u.emailOtp.verifyEmail({email:N,otp:e})).error){E(!1),A(`Verification failed: the six-digit code is incorrect.`);return}let t=await u.signIn.email({email:N,password:I});if(E(!1),t.error){A(`Verification succeeded, but failed to sign in: ${p(t.error)}`),M(`signin`);return}window.location.assign(d(D(i)))}if(n.isPending)return(0,P.jsx)(v,{title:`Authorize CLI session`,description:`Flakes is checking your account session.`,children:(0,P.jsx)(K,{displayUserCode:T(i)})});if(i.length===0)return(0,P.jsx)(v,{title:`Authorize CLI session`,description:`Enter the code shown by the Flakes CLI.`,footer:n.data?(0,P.jsx)(U,{userLabel:G(n.data.user)}):(0,P.jsx)(`p`,{children:`Sign in after entering a code to authorize the CLI session.`}),children:(0,P.jsx)(V,{value:l,error:g,errorPulse:y,onChange:Z,onSubmit:X})});let ae=n.data?.user.email??n.data?.user.name??`Signed-in account`;if(n.data===null)return(0,P.jsx)(v,{title:`Authorize CLI session`,description:`Sign in to authorize this CLI login.`,footer:(0,P.jsxs)(`p`,{children:[`Need access?`,` `,(0,P.jsx)(r,{to:`/signup`,search:{redirect:D(i)},className:`text-foreground underline-offset-4 hover:underline`,children:`Create an account`})]}),children:(0,P.jsxs)(`div`,{className:`grid gap-4`,children:[(0,P.jsx)(H,{displayUserCode:T(i)}),j===`signin`?(0,P.jsx)(s,{error:k,pending:w,redirectTarget:D(i),onSubmit:re}):(0,P.jsx)(ee,{email:N,error:k,pending:w,onVerify:ie,onBack:()=>{A(null),M(`signin`)}})]})});if(o.state===`invalid`){let e=C(l)===i?o.title:void 0;return(0,P.jsx)(v,{title:`Authorize CLI session`,description:`Enter the code shown by the Flakes CLI.`,footer:(0,P.jsxs)(`p`,{children:[`Wrong account?`,` `,(0,P.jsx)(r,{to:`/signin`,search:{redirect:D(i)},className:`text-foreground underline-offset-4 hover:underline`,children:`Sign in again`})]}),children:(0,P.jsx)(V,{value:l,error:g??e,errorPulse:y,onChange:Z,onSubmit:X})})}let $=B(o);return(0,P.jsx)(v,{title:$.title,description:$.description,footer:(0,P.jsxs)(`p`,{children:[`Wrong account?`,` `,(0,P.jsx)(r,{to:`/signin`,search:{redirect:D(i)},className:`text-foreground underline-offset-4 hover:underline`,children:`Sign in again`})]}),children:(0,P.jsxs)(`div`,{className:`grid gap-4`,children:[(0,P.jsx)(H,{displayUserCode:o.displayUserCode}),n.data?(0,P.jsx)(U,{userLabel:ae}):null,o.state===`checking`?(0,P.jsx)(K,{displayUserCode:o.displayUserCode}):o.state===`ready`?(0,P.jsx)(W,{pendingDecision:R,onApprove:()=>Q(`approve`),onDeny:()=>Q(`deny`)}):(0,P.jsx)(q,{view:o})]})})}function B(e){switch(e.state){case`approved`:return{title:`CLI session authorized`,description:`Open the console to continue.`};case`denied`:return{title:`CLI session denied`,description:`This login request was rejected.`};case`invalid`:return{title:`Cannot authorize CLI session`,description:`This device code cannot be authorized.`};default:return{title:`Authorize CLI session`,description:`Review the code before authorizing this CLI login.`}}}function V(e){return(0,P.jsxs)(`form`,{className:`grid gap-4`,onSubmit:e.onSubmit,noValidate:!0,children:[(0,P.jsx)(I,{id:`device-user-code`,label:`Device code`,value:e.value,error:e.error,errorPulse:e.errorPulse,onChange:e.onChange}),(0,P.jsxs)(g,{type:`submit`,className:`font-mono`,children:[(0,P.jsx)(o,{className:`size-4`}),` Continue`]})]})}function H(e){return(0,P.jsxs)(`section`,{className:`rounded-md border bg-background p-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,P.jsx)(`p`,{className:`console-callout`,children:`Device code`}),(0,P.jsx)(b,{className:`size-4 text-muted-foreground`})]}),(0,P.jsx)(`p`,{className:`mt-2 break-all font-mono text-2xl font-semibold tracking-[0.12em] text-foreground`,children:e.displayUserCode})]})}function U(e){return(0,P.jsxs)(`p`,{className:`flex items-center gap-2 rounded-md border bg-background px-3 py-2 text-sm text-muted-foreground`,children:[(0,P.jsx)(l,{className:`size-4 shrink-0`}),(0,P.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Signed in as `,e.userLabel]})]})}function W(e){return(0,P.jsxs)(`div`,{className:`grid gap-3`,children:[(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Authorizing will let this CLI session use your Flakes account.`}),(0,P.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,P.jsxs)(g,{type:`button`,disabled:e.pendingDecision!==null,className:`font-mono`,onClick:e.onApprove,children:[e.pendingDecision===`approve`?(0,P.jsx)(h,{className:`size-4 animate-spin`}):(0,P.jsx)(c,{className:`size-4`}),`Authorize`]}),(0,P.jsxs)(g,{type:`button`,variant:`outline`,disabled:e.pendingDecision!==null,className:`font-mono`,onClick:e.onDeny,children:[e.pendingDecision===`deny`?(0,P.jsx)(h,{className:`size-4 animate-spin`}):(0,P.jsx)(y,{className:`size-4`}),`Deny`]})]})]})}function G(e){return e.email??e.name??`Signed-in account`}function K(e){return(0,P.jsxs)(`p`,{className:`flex min-h-10 items-center gap-2 text-sm text-muted-foreground`,children:[(0,P.jsx)(h,{className:`size-4 animate-spin`}),(0,P.jsxs)(`span`,{children:[`Checking `,e.displayUserCode?e.displayUserCode:`device code`]})]})}function q(e){let t=e.view.state===`approved`;return(0,P.jsxs)(`section`,{className:a(`grid gap-2 rounded-md border p-4`,t?`border-primary/30 bg-primary/10`:`bg-muted/40`),children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t?(0,P.jsx)(_,{className:`size-4 text-primary`}):(0,P.jsx)(y,{className:`size-4 text-muted-foreground`}),(0,P.jsx)(`h2`,{className:`text-sm font-medium`,children:e.view.title})]}),(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.view.message}),t?(0,P.jsx)(g,{asChild:!0,className:`mt-1 font-mono`,children:(0,P.jsxs)(r,{to:`/runs`,children:[(0,P.jsx)(o,{className:`size-4`}),` Open Console`]})}):null]})}function J(e){return{state:`checking`,userCode:e,displayUserCode:T(e)}}function Y(){return{verify:async e=>{let t=await u.device({query:{user_code:e}});return{...t.data?{data:X(t.data)}:{},...t.error?{error:t.error}:{}}},approve:async e=>Z(await u.device.approve({userCode:e})),deny:async e=>Z(await u.device.deny({userCode:e}))}}function X(e){let t=e.status===`pending`||e.status===`approved`||e.status===`denied`?e.status:void 0;return{...e.user_code?{user_code:e.user_code}:{},...t?{status:t}:{}}}function Z(e){return{...e.data?{data:e.data}:{},...e.error?{error:e.error}:{}}}export{z as component};
1
+ import{h as e,t,v as n}from"./react-DtOYBmep.js";import{t as r}from"./link-BsixJinJ.js";import{r as i,t as a}from"./utils-CEE0-YEp.js";import{t as o}from"./arrow-right-BMW8fJP5.js";import{r as s}from"./signin-form-Bp22jPob.js";import{t as c}from"./circle-check-B0gtb8OH.js";import{t as ee}from"./otp-verification-BSXwS5bo.js";import{t as l}from"./user-DK27uFod.js";import{D as u,E as d,ct as f,f as p,i as m,it as h,k as g,p as te,rt as _}from"./main-KBvz0mSQ.js";import{t as v}from"./auth-layout-DiUSgtaY.js";var y=i(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),b=i(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),x=n(t(),1);function S(e){return(e??``).trim().replace(/[\s-]+/g,``).toUpperCase()}function C(e){return S(E(e)??e)}function w(e){let t=e??``,n=(t.includes(`user_code=`)?C(t):void 0)??t.toUpperCase(),r=[];for(let e of n){if(r.length>=8)break;if(e===`-`)continue;if(e.trim()===``){r.push(` `);continue}let t=C(e);t.length>0&&r.push(t[0]??` `)}return r.concat(Array(8).fill(` `)).slice(0,8)}function T(e){let t=S(e);return t.length<=4?t:`${t.slice(0,4)}-${t.slice(4)}`}function E(e){let t=e?.trim();if(t?.includes(`user_code=`))try{return new URL(t,`http://console.invalid`).searchParams.get(`user_code`)??void 0}catch{return}}function D(e){let t=S(e);return t.length===0?`/device`:`/device?user_code=${encodeURIComponent(t)}`}async function ne(e,t){let n=S(t);if(n.length===0)return M(n,{title:`Device code missing`,message:`Start login again from the Flakes CLI.`});let r=await e.verify(n);if(r.error)return j(n,r.error);switch(r.data?.status){case`pending`:return{state:`ready`,userCode:n,displayUserCode:T(n)};case`approved`:return k(n);case`denied`:return A(n);default:return M(n,{title:`Device code not found`,message:`Start login again from the Flakes CLI.`})}}async function O(e,t,n){let r=S(n);if(r.length===0)return M(r,{title:`Device code missing`,message:`Start login again from the Flakes CLI.`});let i=t===`approve`?await e.approve(r):await e.deny(r);return i.error?j(r,i.error):t===`approve`?k(r):A(r)}function k(e){return{state:`approved`,userCode:e,displayUserCode:T(e),title:`CLI session authorized`,message:`Open the console to continue.`}}function A(e){return{state:`denied`,userCode:e,displayUserCode:T(e),title:`CLI session denied`,message:`The waiting login request has been rejected.`}}function j(e,t){switch(N(t)){case`expired_token`:return M(e,{title:`Device code expired`,message:`Start login again from the Flakes CLI.`});case`device_code_already_processed`:return M(e,{title:`Device code already used`,message:`This login request has already been completed.`});case`unauthorized`:return M(e,{title:`Sign-in required`,message:`Sign in again before authorizing the CLI.`});case`access_denied`:return M(e,{title:`Device code belongs to another user`,message:`Use the same account that opened the device request.`});default:return M(e,{title:`Device code not found`,message:`Start login again from the Flakes CLI.`})}}function M(e,t){return{state:`invalid`,userCode:e,displayUserCode:T(e),...t}}function N(e){if(typeof e!=`object`||!e)return``;let t=e;for(let e of[`code`,`error`,`status`,`statusText`]){let n=t[e];if(typeof n==`string`&&n.length>0)return n.toLowerCase()}return``}var P=e(),F=[`device-code-slot-1`,`device-code-slot-2`,`device-code-slot-3`,`device-code-slot-4`,`device-code-slot-5`,`device-code-slot-6`,`device-code-slot-7`,`device-code-slot-8`];function I(e){let t=(0,x.useRef)([]),n=(0,x.useRef)(void 0),r=w(e.value);(0,x.useEffect)(()=>{if(!e.error){n.current=void 0;return}if(n.current!==e.errorPulse){n.current=e.errorPulse;for(let e of t.current)e&&(e.classList.remove(`device-code-slot-error`),e.offsetWidth,e.classList.add(`device-code-slot-error`))}},[e.error,e.errorPulse]);function i(n,r){e.onChange(n.slice(0,8).join(``)),r!==void 0&&requestAnimationFrame(()=>{t.current[L(r)]?.focus()})}function a(e,t){let n=C(t.currentTarget.value);if(n.length===0){let t=r.slice();t[e]=` `,i(t);return}let a=r.slice();for(let t=0;t<n.length;t+=1){let r=e+t;if(r>=8)break;a[r]=n[t]??` `}i(a,e+n.length)}function o(e,t){t.preventDefault();let n=C(t.clipboardData.getData(`text`));if(n.length===0)return;let a=r.slice();for(let t=0;t<n.length;t+=1){let r=e+t;if(r>=8)break;a[r]=n[t]??` `}i(a,e+n.length)}function s(e,n){if(n.key===`Backspace`){n.preventDefault();let t=r.slice();if(r[e]!==` `){t[e]=` `,i(t,e);return}e>0&&(t[e-1]=` `,i(t,e-1));return}if(n.key===`Delete`){n.preventDefault();let t=r.slice();t[e]=` `,i(t,e);return}if(n.key===`ArrowLeft`&&e>0){n.preventDefault(),t.current[e-1]?.focus();return}n.key===`ArrowRight`&&e<7&&(n.preventDefault(),t.current[e+1]?.focus())}return(0,P.jsxs)(`fieldset`,{className:`grid gap-2`,"aria-describedby":`${e.id}-error`,children:[(0,P.jsx)(`legend`,{className:`console-callout pb-2`,children:e.label}),(0,P.jsx)(`div`,{className:`flex items-center gap-1.5`,children:F.map((n,i)=>(0,P.jsx)(R,{ref:e=>{t.current[i]=e},id:i===0?e.id:void 0,value:r[i]?.trim()??``,error:e.error!==void 0,index:i,onChange:e=>a(i,e),onPaste:e=>o(i,e),onKeyDown:e=>s(i,e)},n))}),(0,P.jsx)(`p`,{id:`${e.id}-error`,className:`min-h-4 text-xs text-destructive`,children:e.error??``})]})}function L(e){return Math.max(0,Math.min(e,7))}function R(e){return(0,P.jsxs)(P.Fragment,{children:[e.index===4?(0,P.jsx)(`span`,{className:`px-0.5 font-mono text-sm text-muted-foreground`,children:`-`}):null,(0,P.jsx)(`input`,{ref:e.ref,id:e.id,value:e.value,"aria-label":`Device code character ${e.index+1}`,inputMode:`text`,autoComplete:e.index===0?`one-time-code`:`off`,autoCapitalize:`characters`,maxLength:8,onChange:e.onChange,onPaste:e.onPaste,onKeyDown:e.onKeyDown,className:a(`h-11 w-8 rounded-md border bg-background text-center font-mono text-lg font-semibold outline-none transition-colors sm:w-9`,`focus:border-primary focus:ring-[3px] focus:ring-ring/30`,e.error&&`device-code-slot-error focus:border-destructive focus:ring-destructive/20`)})]})}function z(){let{user_code:e}=m.useSearch(),t=f(),n=u.useSession(),i=S(e),a=(0,x.useMemo)(Y,[]),[o,c]=(0,x.useState)(()=>J(i)),[l,h]=(0,x.useState)(()=>T(i)),[g,_]=(0,x.useState)(),[y,b]=(0,x.useState)(0),[w,E]=(0,x.useState)(!1),[k,A]=(0,x.useState)(null),[j,M]=(0,x.useState)(`signin`),[N,F]=(0,x.useState)(``),[I,L]=(0,x.useState)(``),[R,z]=(0,x.useState)(null);(0,x.useEffect)(()=>{h(T(i)),_(void 0),b(0),M(`signin`),A(null)},[i]),(0,x.useEffect)(()=>{if(n.isPending||i.length===0||n.data===null)return;let e=!0;return c(J(i)),ne(a,i).then(t=>{e&&c(t)}),()=>{e=!1}},[a,n.data,n.isPending,i]);function X(e){e.preventDefault();let n=C(l);if(n.length!==8){_(`Enter the 8-character code shown in your terminal.`),b(e=>e+1);return}if(o.state===`invalid`&&n===i){_(o.title),b(e=>e+1);return}_(void 0),t({to:`/device`,search:{user_code:n},replace:!0})}function Z(e){h(e),_(void 0)}async function Q(e){R||(z(e),c(await O(a,e,i)),z(null))}async function re(e){E(!0),A(null),F(e.email),L(e.password);let t=await u.signIn.email({email:e.email,password:e.password});if(t.error){if(te(t.error)){let t=await u.emailOtp.sendVerificationOtp({email:e.email,type:`email-verification`});if(E(!1),t.error){A(p(t.error,`Could not send verification code.`));return}M(`verify`);return}E(!1),A(p(t.error));return}E(!1),window.location.assign(d(D(i)))}async function ie(e){if(E(!0),A(null),(await u.emailOtp.verifyEmail({email:N,otp:e})).error){E(!1),A(`Verification failed: the six-digit code is incorrect.`);return}let t=await u.signIn.email({email:N,password:I});if(E(!1),t.error){A(`Verification succeeded, but failed to sign in: ${p(t.error)}`),M(`signin`);return}window.location.assign(d(D(i)))}if(n.isPending)return(0,P.jsx)(v,{title:`Authorize CLI session`,description:`Flakes is checking your account session.`,children:(0,P.jsx)(K,{displayUserCode:T(i)})});if(i.length===0)return(0,P.jsx)(v,{title:`Authorize CLI session`,description:`Enter the code shown by the Flakes CLI.`,footer:n.data?(0,P.jsx)(U,{userLabel:G(n.data.user)}):(0,P.jsx)(`p`,{children:`Sign in after entering a code to authorize the CLI session.`}),children:(0,P.jsx)(V,{value:l,error:g,errorPulse:y,onChange:Z,onSubmit:X})});let ae=n.data?.user.email??n.data?.user.name??`Signed-in account`;if(n.data===null)return(0,P.jsx)(v,{title:`Authorize CLI session`,description:`Sign in to authorize this CLI login.`,footer:(0,P.jsxs)(`p`,{children:[`Need access?`,` `,(0,P.jsx)(r,{to:`/signup`,search:{redirect:D(i)},className:`text-foreground underline-offset-4 hover:underline`,children:`Create an account`})]}),children:(0,P.jsxs)(`div`,{className:`grid gap-4`,children:[(0,P.jsx)(H,{displayUserCode:T(i)}),j===`signin`?(0,P.jsx)(s,{error:k,pending:w,redirectTarget:D(i),onSubmit:re}):(0,P.jsx)(ee,{email:N,error:k,pending:w,onVerify:ie,onBack:()=>{A(null),M(`signin`)}})]})});if(o.state===`invalid`){let e=C(l)===i?o.title:void 0;return(0,P.jsx)(v,{title:`Authorize CLI session`,description:`Enter the code shown by the Flakes CLI.`,footer:(0,P.jsxs)(`p`,{children:[`Wrong account?`,` `,(0,P.jsx)(r,{to:`/signin`,search:{redirect:D(i)},className:`text-foreground underline-offset-4 hover:underline`,children:`Sign in again`})]}),children:(0,P.jsx)(V,{value:l,error:g??e,errorPulse:y,onChange:Z,onSubmit:X})})}let $=B(o);return(0,P.jsx)(v,{title:$.title,description:$.description,footer:(0,P.jsxs)(`p`,{children:[`Wrong account?`,` `,(0,P.jsx)(r,{to:`/signin`,search:{redirect:D(i)},className:`text-foreground underline-offset-4 hover:underline`,children:`Sign in again`})]}),children:(0,P.jsxs)(`div`,{className:`grid gap-4`,children:[(0,P.jsx)(H,{displayUserCode:o.displayUserCode}),n.data?(0,P.jsx)(U,{userLabel:ae}):null,o.state===`checking`?(0,P.jsx)(K,{displayUserCode:o.displayUserCode}):o.state===`ready`?(0,P.jsx)(W,{pendingDecision:R,onApprove:()=>Q(`approve`),onDeny:()=>Q(`deny`)}):(0,P.jsx)(q,{view:o})]})})}function B(e){switch(e.state){case`approved`:return{title:`CLI session authorized`,description:`Open the console to continue.`};case`denied`:return{title:`CLI session denied`,description:`This login request was rejected.`};case`invalid`:return{title:`Cannot authorize CLI session`,description:`This device code cannot be authorized.`};default:return{title:`Authorize CLI session`,description:`Review the code before authorizing this CLI login.`}}}function V(e){return(0,P.jsxs)(`form`,{className:`grid gap-4`,onSubmit:e.onSubmit,noValidate:!0,children:[(0,P.jsx)(I,{id:`device-user-code`,label:`Device code`,value:e.value,error:e.error,errorPulse:e.errorPulse,onChange:e.onChange}),(0,P.jsxs)(g,{type:`submit`,className:`font-mono`,children:[(0,P.jsx)(o,{className:`size-4`}),` Continue`]})]})}function H(e){return(0,P.jsxs)(`section`,{className:`rounded-md border bg-background p-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,P.jsx)(`p`,{className:`console-callout`,children:`Device code`}),(0,P.jsx)(b,{className:`size-4 text-muted-foreground`})]}),(0,P.jsx)(`p`,{className:`mt-2 break-all font-mono text-2xl font-semibold tracking-[0.12em] text-foreground`,children:e.displayUserCode})]})}function U(e){return(0,P.jsxs)(`p`,{className:`flex items-center gap-2 rounded-md border bg-background px-3 py-2 text-sm text-muted-foreground`,children:[(0,P.jsx)(l,{className:`size-4 shrink-0`}),(0,P.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Signed in as `,e.userLabel]})]})}function W(e){return(0,P.jsxs)(`div`,{className:`grid gap-3`,children:[(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Authorizing will let this CLI session use your Flakes account.`}),(0,P.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,P.jsxs)(g,{type:`button`,disabled:e.pendingDecision!==null,className:`font-mono`,onClick:e.onApprove,children:[e.pendingDecision===`approve`?(0,P.jsx)(h,{className:`size-4 animate-spin`}):(0,P.jsx)(c,{className:`size-4`}),`Authorize`]}),(0,P.jsxs)(g,{type:`button`,variant:`outline`,disabled:e.pendingDecision!==null,className:`font-mono`,onClick:e.onDeny,children:[e.pendingDecision===`deny`?(0,P.jsx)(h,{className:`size-4 animate-spin`}):(0,P.jsx)(y,{className:`size-4`}),`Deny`]})]})]})}function G(e){return e.email??e.name??`Signed-in account`}function K(e){return(0,P.jsxs)(`p`,{className:`flex min-h-10 items-center gap-2 text-sm text-muted-foreground`,children:[(0,P.jsx)(h,{className:`size-4 animate-spin`}),(0,P.jsxs)(`span`,{children:[`Checking `,e.displayUserCode?e.displayUserCode:`device code`]})]})}function q(e){let t=e.view.state===`approved`;return(0,P.jsxs)(`section`,{className:a(`grid gap-2 rounded-md border p-4`,t?`border-primary/30 bg-primary/10`:`bg-muted/40`),children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t?(0,P.jsx)(_,{className:`size-4 text-primary`}):(0,P.jsx)(y,{className:`size-4 text-muted-foreground`}),(0,P.jsx)(`h2`,{className:`text-sm font-medium`,children:e.view.title})]}),(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.view.message}),t?(0,P.jsx)(g,{asChild:!0,className:`mt-1 font-mono`,children:(0,P.jsxs)(r,{to:`/runs`,children:[(0,P.jsx)(o,{className:`size-4`}),` Open Console`]})}):null]})}function J(e){return{state:`checking`,userCode:e,displayUserCode:T(e)}}function Y(){return{verify:async e=>{let t=await u.device({query:{user_code:e}});return{...t.data?{data:X(t.data)}:{},...t.error?{error:t.error}:{}}},approve:async e=>Z(await u.device.approve({userCode:e})),deny:async e=>Z(await u.device.deny({userCode:e}))}}function X(e){let t=e.status===`pending`||e.status===`approved`||e.status===`denied`?e.status:void 0;return{...e.user_code?{user_code:e.user_code}:{},...t?{status:t}:{}}}function Z(e){return{...e.data?{data:e.data}:{},...e.error?{error:e.error}:{}}}export{z as component};
@@ -1 +1 @@
1
- import{h as e}from"./react-DtOYBmep.js";import{t}from"./DocumentationPage-DrqDulyL.js";import{a as n,ot as r,st as i}from"./main-RzjfJZwD.js";var a=e();function o(){return s(r().pathname)===`/documentation`?(0,a.jsx)(t,{selectedPath:n}):(0,a.jsx)(i,{})}function s(e){return e===`/`?e:e.replace(/\/$/,``)}export{o as component};
1
+ import{h as e}from"./react-DtOYBmep.js";import{t}from"./DocumentationPage-DM-ZYPgQ.js";import{a as n,ot as r,st as i}from"./main-KBvz0mSQ.js";var a=e();function o(){return s(r().pathname)===`/documentation`?(0,a.jsx)(t,{selectedPath:n}):(0,a.jsx)(i,{})}function s(e){return e===`/`?e:e.replace(/\/$/,``)}export{o as component};
@@ -1 +1 @@
1
- import{h as e,t,v as n}from"./react-DtOYBmep.js";import{t as r}from"./link-BsixJinJ.js";import{r as i}from"./utils-CEE0-YEp.js";import{i as a,n as o,t as s}from"./signin-form-DWaa_uwj.js";import{D as c,f as l,it as u,k as d,u as f,v as p}from"./main-RzjfJZwD.js";import{t as m}from"./auth-layout-INHonQMf.js";var h=i(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),g=n(t(),1),_=e();function v(e){let t=(0,g.useId)(),[n,i]=(0,g.useState)(``),[c,l]=(0,g.useState)();async function f(t){if(t.preventDefault(),e.pending||e.sent)return;let r=p({email:n,password:`placeholder`});if(!r.ok){l(r.errors.email);return}l(void 0),await e.onSubmit(r.data.email)}return e.sent?(0,_.jsxs)(`div`,{className:`grid gap-4`,children:[(0,_.jsx)(`p`,{className:`rounded-md border bg-background p-3 text-sm text-muted-foreground`,children:`If an account exists for that address, a reset link will arrive shortly.`}),(0,_.jsx)(d,{asChild:!0,variant:`outline`,children:(0,_.jsx)(r,{to:`/signin`,search:{redirect:e.redirectTarget},children:`Return to sign in`})})]}):(0,_.jsxs)(`form`,{className:`grid gap-4`,onSubmit:f,noValidate:!0,children:[(0,_.jsx)(s,{id:t,icon:a,label:`Email`,type:`email`,autoComplete:`email`,value:n,error:c,onChange:i}),(0,_.jsx)(o,{message:e.error}),(0,_.jsx)(d,{type:`submit`,disabled:e.pending,className:`font-mono`,children:e.pending?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(u,{className:`size-4 animate-spin`}),` Sending link`]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(h,{className:`size-4`}),` Send reset link`]})})]})}function y(){let{redirect:e}=f.useSearch(),[t,n]=(0,g.useState)(!1),[i,a]=(0,g.useState)(!1),[o,s]=(0,g.useState)(null);async function u(t){n(!0),s(null);let r=await c.requestPasswordReset({email:t,redirectTo:`/console/reset-password?redirect=${encodeURIComponent(e)}`});if(n(!1),r.error){s(l(r.error,`Could not send reset link.`));return}a(!0)}return(0,_.jsx)(m,{title:`Reset password`,description:`Request a password reset link for your Flakes account.`,footer:(0,_.jsxs)(`p`,{children:[`Remembered it?`,` `,(0,_.jsx)(r,{to:`/signin`,search:{redirect:e},className:`text-foreground underline-offset-4 hover:underline`,children:`Sign in`})]}),children:(0,_.jsx)(v,{error:o,pending:t,sent:i,redirectTarget:e,onSubmit:u})})}export{y as component};
1
+ import{h as e,t,v as n}from"./react-DtOYBmep.js";import{t as r}from"./link-BsixJinJ.js";import{r as i}from"./utils-CEE0-YEp.js";import{i as a,n as o,t as s}from"./signin-form-Bp22jPob.js";import{D as c,f as l,it as u,k as d,u as f,v as p}from"./main-KBvz0mSQ.js";import{t as m}from"./auth-layout-DiUSgtaY.js";var h=i(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),g=n(t(),1),_=e();function v(e){let t=(0,g.useId)(),[n,i]=(0,g.useState)(``),[c,l]=(0,g.useState)();async function f(t){if(t.preventDefault(),e.pending||e.sent)return;let r=p({email:n,password:`placeholder`});if(!r.ok){l(r.errors.email);return}l(void 0),await e.onSubmit(r.data.email)}return e.sent?(0,_.jsxs)(`div`,{className:`grid gap-4`,children:[(0,_.jsx)(`p`,{className:`rounded-md border bg-background p-3 text-sm text-muted-foreground`,children:`If an account exists for that address, a reset link will arrive shortly.`}),(0,_.jsx)(d,{asChild:!0,variant:`outline`,children:(0,_.jsx)(r,{to:`/signin`,search:{redirect:e.redirectTarget},children:`Return to sign in`})})]}):(0,_.jsxs)(`form`,{className:`grid gap-4`,onSubmit:f,noValidate:!0,children:[(0,_.jsx)(s,{id:t,icon:a,label:`Email`,type:`email`,autoComplete:`email`,value:n,error:c,onChange:i}),(0,_.jsx)(o,{message:e.error}),(0,_.jsx)(d,{type:`submit`,disabled:e.pending,className:`font-mono`,children:e.pending?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(u,{className:`size-4 animate-spin`}),` Sending link`]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(h,{className:`size-4`}),` Send reset link`]})})]})}function y(){let{redirect:e}=f.useSearch(),[t,n]=(0,g.useState)(!1),[i,a]=(0,g.useState)(!1),[o,s]=(0,g.useState)(null);async function u(t){n(!0),s(null);let r=await c.requestPasswordReset({email:t,redirectTo:`/console/reset-password?redirect=${encodeURIComponent(e)}`});if(n(!1),r.error){s(l(r.error,`Could not send reset link.`));return}a(!0)}return(0,_.jsx)(m,{title:`Reset password`,description:`Request a password reset link for your Flakes account.`,footer:(0,_.jsxs)(`p`,{children:[`Remembered it?`,` `,(0,_.jsx)(r,{to:`/signin`,search:{redirect:e},className:`text-foreground underline-offset-4 hover:underline`,children:`Sign in`})]}),children:(0,_.jsx)(v,{error:o,pending:t,sent:i,redirectTarget:e,onSubmit:u})})}export{y as component};