@baochunli/flakes 0.0.5 → 0.0.6

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 (126) hide show
  1. package/dist/node_modules/@flakes/auth/package.json +1 -1
  2. package/dist/node_modules/@flakes/console/.output/nitro.json +1 -1
  3. package/dist/node_modules/@flakes/console/.output/public/assets/{DocumentationPage-CNPk8RVl.js → DocumentationPage-CGIcMKwf.js} +1 -1
  4. package/dist/node_modules/@flakes/console/.output/public/assets/ProjectsPage-ByTl4Kyy.js +1 -0
  5. package/dist/node_modules/@flakes/console/.output/public/assets/RunPage-5MmbVpaE.js +3 -0
  6. package/dist/node_modules/@flakes/console/.output/public/assets/{RunsPage-CJbycrqM.js → RunsPage-fbDKP9kM.js} +1 -1
  7. package/dist/node_modules/@flakes/console/.output/public/assets/{SandboxesLens-BoLM52PY.js → SandboxesLens-DPG87mUE.js} +1 -1
  8. package/dist/node_modules/@flakes/console/.output/public/assets/SandboxesPage-DIpzR_Ef.js +1 -0
  9. package/dist/node_modules/@flakes/console/.output/public/assets/TranscriptPage-mCgSqfv0.js +1 -0
  10. package/dist/node_modules/@flakes/console/.output/public/assets/_-CM2hE2sZ.js +1 -0
  11. package/dist/node_modules/@flakes/console/.output/public/assets/_runId-3ZZOAqUK.js +2 -0
  12. package/dist/node_modules/@flakes/console/.output/public/assets/_taskId-cy4RxW8Y.js +2 -0
  13. package/dist/node_modules/@flakes/console/.output/public/assets/{account-BoRurhrq.js → account-BWoGGXJw.js} +1 -1
  14. package/dist/node_modules/@flakes/console/.output/public/assets/{account-forms-D4eVqOhW.js → account-forms-Dq70JDyg.js} +1 -1
  15. package/dist/node_modules/@flakes/console/.output/public/assets/{auth-layout-DBnq_eif.js → auth-layout-BFusNq3W.js} +1 -1
  16. package/dist/node_modules/@flakes/console/.output/public/assets/{bits-BOMPEHvv.js → bits-CTGNpp-v.js} +1 -1
  17. package/dist/node_modules/@flakes/console/.output/public/assets/device-BajR3eSF.js +1 -0
  18. package/dist/node_modules/@flakes/console/.output/public/assets/documentation-6ao_Ux6x.js +1 -0
  19. package/dist/node_modules/@flakes/console/.output/public/assets/{forgot-password-BSQ4TWpA.js → forgot-password-DOKn8_7P.js} +1 -1
  20. package/dist/node_modules/@flakes/console/.output/public/assets/main-DVO9gWzi.js +1215 -0
  21. package/dist/node_modules/@flakes/console/.output/public/assets/{otp-verification-CussJQT1.js → otp-verification-qolVtiom.js} +2 -2
  22. package/dist/node_modules/@flakes/console/.output/public/assets/projects-n5LSsNi3.js +2 -0
  23. package/dist/node_modules/@flakes/console/.output/public/assets/{reset-password-DwWhVkEh.js → reset-password-D-OlZeHQ.js} +1 -1
  24. package/dist/node_modules/@flakes/console/.output/public/assets/runs-BB9ogobQ.js +2 -0
  25. package/dist/node_modules/@flakes/console/.output/public/assets/sandboxes-BIimz5FI.js +2 -0
  26. package/dist/node_modules/@flakes/console/.output/public/assets/{security-MjM55vIw.js → security-DdQNcp6k.js} +1 -1
  27. package/dist/node_modules/@flakes/console/.output/public/assets/{signin-KbA1cD6o.js → signin-BoZiVxyq.js} +1 -1
  28. package/dist/node_modules/@flakes/console/.output/public/assets/{signin-form-CBF-d8iK.js → signin-form-tTBWDjhi.js} +1 -1
  29. package/dist/node_modules/@flakes/console/.output/public/assets/{signup-CbHsThKr.js → signup-CBSszmUC.js} +1 -1
  30. package/dist/node_modules/@flakes/console/.output/public/assets/styles-B8OXOvkO.css +2 -0
  31. package/dist/node_modules/@flakes/console/.output/server/{_-BULJ6utw.mjs → _-BGsKgsbF.mjs} +3 -3
  32. package/dist/node_modules/@flakes/console/.output/server/{_-_ST9QYWn.mjs → _-DtPMXzt0.mjs} +3 -3
  33. package/dist/node_modules/@flakes/console/.output/server/_chunks/ProjectsPage.mjs +1 -2
  34. package/dist/node_modules/@flakes/console/.output/server/_chunks/RunPage.mjs +1 -2
  35. package/dist/node_modules/@flakes/console/.output/server/_chunks/RunsPage.mjs +1 -2
  36. package/dist/node_modules/@flakes/console/.output/server/_chunks/SandboxesLens.mjs +1 -1
  37. package/dist/node_modules/@flakes/console/.output/server/_chunks/SandboxesPage.mjs +253 -18
  38. package/dist/node_modules/@flakes/console/.output/server/_chunks/TranscriptPage.mjs +1 -2
  39. package/dist/node_modules/@flakes/console/.output/server/_chunks/bits.mjs +1 -1
  40. package/dist/node_modules/@flakes/console/.output/server/_chunks/button.mjs +461 -3
  41. package/dist/node_modules/@flakes/console/.output/server/_chunks/card.mjs +1 -1
  42. package/dist/node_modules/@flakes/console/.output/server/_chunks/router.mjs +3 -4
  43. package/dist/node_modules/@flakes/console/.output/server/_chunks/table.mjs +1 -1
  44. package/dist/node_modules/@flakes/console/.output/server/{_runId-WZmbo654.mjs → _runId-P1u-vfcm.mjs} +2 -2
  45. package/dist/node_modules/@flakes/console/.output/server/{_runId-CmYWNL8A.mjs → _runId-vO4tlCOP.mjs} +3 -3
  46. package/dist/node_modules/@flakes/console/.output/server/_ssr/{App-CUx8Ftit.mjs → App-C-XaVKoO.mjs} +2 -2
  47. package/dist/node_modules/@flakes/console/.output/server/_ssr/{DocumentationPage-0I9oWWJT.mjs → DocumentationPage-BR2KosFz.mjs} +2 -2
  48. package/dist/node_modules/@flakes/console/.output/server/_ssr/{ProjectsPage-CGj9V2Of.mjs → ProjectsPage-BUrep1wl.mjs} +2 -2
  49. package/dist/node_modules/@flakes/console/.output/server/_ssr/{RunPage-B2vhVaj6.mjs → RunPage-BHs-v0LU.mjs} +2 -2
  50. package/dist/node_modules/@flakes/console/.output/server/_ssr/{RunsPage-BifKogQE.mjs → RunsPage-iTNYVwL0.mjs} +2 -2
  51. package/dist/node_modules/@flakes/console/.output/server/_ssr/SandboxesPage-C1Z6dVce.mjs +423 -0
  52. package/dist/node_modules/@flakes/console/.output/server/_ssr/{TranscriptPage-deSxVZaQ.mjs → TranscriptPage-BcomoTls.mjs} +2 -2
  53. package/dist/node_modules/@flakes/console/.output/server/_ssr/{account-D5y9vkAc.mjs → account-Cp0s_IQK.mjs} +2 -2
  54. package/dist/node_modules/@flakes/console/.output/server/_ssr/{documentation-C91gfyy0.mjs → documentation-BnxmM-Yo.mjs} +2 -2
  55. package/dist/node_modules/@flakes/console/.output/server/_ssr/{documentation-C69e9_eF.mjs → documentation-Cgyr3VKK.mjs} +3 -3
  56. package/dist/node_modules/@flakes/console/.output/server/_ssr/{hooks-DrgN35zn.mjs → hooks-CsVtQ1m-.mjs} +117 -51
  57. package/dist/node_modules/@flakes/console/.output/server/_ssr/{projects-lJ2tIIPj.mjs → projects-R9sxR_t4.mjs} +1 -1
  58. package/dist/node_modules/@flakes/console/.output/server/_ssr/{router-DHxFQ03L.mjs → router-CobdI6gO.mjs} +12 -12
  59. package/dist/node_modules/@flakes/console/.output/server/_ssr/{runs-dnPfp9dt.mjs → runs-D8MHe3QU.mjs} +2 -2
  60. package/dist/node_modules/@flakes/console/.output/server/_ssr/{runs-BWxEGKO_.mjs → runs-mTxbc_pm.mjs} +3 -3
  61. package/dist/node_modules/@flakes/console/.output/server/_ssr/{sandboxes-v28LJQM3.mjs → sandboxes-B2z_9JyU.mjs} +2 -2
  62. package/dist/node_modules/@flakes/console/.output/server/_ssr/{sandboxes-hxFINxDS.mjs → sandboxes-r0y6Ihg6.mjs} +3 -3
  63. package/dist/node_modules/@flakes/console/.output/server/_ssr/ssr.mjs +2 -2
  64. package/dist/node_modules/@flakes/console/.output/server/{_tanstack-start-manifest_v-DfwuEzTr.mjs → _tanstack-start-manifest_v-DpAwCFK9.mjs} +32 -33
  65. package/dist/node_modules/@flakes/console/.output/server/{_taskId-CBo95z-s.mjs → _taskId-Cz9xwj5L.mjs} +2 -2
  66. package/dist/node_modules/@flakes/console/.output/server/{_taskId-Sil3-PKh.mjs → _taskId-wQsG2CQj.mjs} +3 -3
  67. package/dist/node_modules/@flakes/console/package.json +1 -1
  68. package/dist/node_modules/@flakes/control-plane/dist/host-credentials.d.ts +1 -1
  69. package/dist/node_modules/@flakes/control-plane/dist/host-credentials.d.ts.map +1 -1
  70. package/dist/node_modules/@flakes/control-plane/dist/routes/sandboxes.js +48 -3
  71. package/dist/node_modules/@flakes/control-plane/dist/routes/sandboxes.js.map +1 -1
  72. package/dist/node_modules/@flakes/control-plane/package.json +1 -1
  73. package/dist/node_modules/@flakes/core/package.json +1 -1
  74. package/dist/node_modules/@flakes/harness-agent/package.json +1 -1
  75. package/dist/node_modules/@flakes/harness-sdk/package.json +1 -1
  76. package/dist/node_modules/@flakes/pi-agent/package.json +1 -1
  77. package/dist/node_modules/@flakes/protocol/package.json +1 -1
  78. package/dist/node_modules/@flakes/sandbox-runtime/package.json +1 -1
  79. package/dist/node_modules/@flakes/store/dist/managed-sandbox-instances-store.d.ts +9 -1
  80. package/dist/node_modules/@flakes/store/dist/managed-sandbox-instances-store.d.ts.map +1 -1
  81. package/dist/node_modules/@flakes/store/dist/managed-sandbox-instances-store.js +407 -6
  82. package/dist/node_modules/@flakes/store/dist/managed-sandbox-instances-store.js.map +1 -1
  83. package/dist/node_modules/@flakes/store/dist/mappers.d.ts.map +1 -1
  84. package/dist/node_modules/@flakes/store/dist/mappers.js +1 -0
  85. package/dist/node_modules/@flakes/store/dist/mappers.js.map +1 -1
  86. package/dist/node_modules/@flakes/store/dist/types.d.ts +30 -1
  87. package/dist/node_modules/@flakes/store/dist/types.d.ts.map +1 -1
  88. package/dist/node_modules/@flakes/store/package.json +1 -1
  89. package/package.json +1 -1
  90. package/dist/node_modules/@flakes/auth/dist/better-auth-shape.d.ts +0 -10
  91. package/dist/node_modules/@flakes/auth/dist/better-auth-shape.d.ts.map +0 -1
  92. package/dist/node_modules/@flakes/auth/dist/better-auth-shape.js +0 -16
  93. package/dist/node_modules/@flakes/auth/dist/better-auth-shape.js.map +0 -1
  94. package/dist/node_modules/@flakes/console/.output/public/assets/ProjectsPage-CKPR1nnu.js +0 -1
  95. package/dist/node_modules/@flakes/console/.output/public/assets/RunPage-BdugbnA3.js +0 -3
  96. package/dist/node_modules/@flakes/console/.output/public/assets/SandboxesPage-6KHjMeaR.js +0 -1
  97. package/dist/node_modules/@flakes/console/.output/public/assets/TranscriptPage-CHSq0_qN.js +0 -1
  98. package/dist/node_modules/@flakes/console/.output/public/assets/_-CD1Voz9h.js +0 -1
  99. package/dist/node_modules/@flakes/console/.output/public/assets/_runId-_0VPmGYe.js +0 -2
  100. package/dist/node_modules/@flakes/console/.output/public/assets/_taskId-CPAKAp4X.js +0 -2
  101. package/dist/node_modules/@flakes/console/.output/public/assets/device-FqII-S41.js +0 -1
  102. package/dist/node_modules/@flakes/console/.output/public/assets/dist-BEfdrJTS.js +0 -1
  103. package/dist/node_modules/@flakes/console/.output/public/assets/documentation-2C3ncAuV.js +0 -1
  104. package/dist/node_modules/@flakes/console/.output/public/assets/main-LpSDdT-S.js +0 -1215
  105. package/dist/node_modules/@flakes/console/.output/public/assets/projects-CLgKBrCe.js +0 -2
  106. package/dist/node_modules/@flakes/console/.output/public/assets/runs-CFYk2iRh.js +0 -2
  107. package/dist/node_modules/@flakes/console/.output/public/assets/sandboxes-mGsOcVFL.js +0 -2
  108. package/dist/node_modules/@flakes/console/.output/public/assets/styles-DtA2wbW8.css +0 -2
  109. package/dist/node_modules/@flakes/console/.output/server/_chunks/utils.mjs +0 -393
  110. package/dist/node_modules/@flakes/console/.output/server/_ssr/SandboxesPage-DGji_OdB.mjs +0 -187
  111. package/dist/node_modules/@flakes/control-plane/dist/managed-sandbox-provisioner.d.ts +0 -71
  112. package/dist/node_modules/@flakes/control-plane/dist/managed-sandbox-provisioner.d.ts.map +0 -1
  113. package/dist/node_modules/@flakes/control-plane/dist/managed-sandbox-provisioner.js +0 -243
  114. package/dist/node_modules/@flakes/control-plane/dist/managed-sandbox-provisioner.js.map +0 -1
  115. package/dist/node_modules/@flakes/control-plane/dist/routes/sandboxes-admin.d.ts +0 -3
  116. package/dist/node_modules/@flakes/control-plane/dist/routes/sandboxes-admin.d.ts.map +0 -1
  117. package/dist/node_modules/@flakes/control-plane/dist/routes/sandboxes-admin.js +0 -153
  118. package/dist/node_modules/@flakes/control-plane/dist/routes/sandboxes-admin.js.map +0 -1
  119. package/dist/node_modules/@flakes/control-plane/dist/sandbox-drain.d.ts +0 -19
  120. package/dist/node_modules/@flakes/control-plane/dist/sandbox-drain.d.ts.map +0 -1
  121. package/dist/node_modules/@flakes/control-plane/dist/sandbox-drain.js +0 -46
  122. package/dist/node_modules/@flakes/control-plane/dist/sandbox-drain.js.map +0 -1
  123. package/dist/node_modules/@flakes/store/dist/sqlite.d.ts +0 -4
  124. package/dist/node_modules/@flakes/store/dist/sqlite.d.ts.map +0 -1
  125. package/dist/node_modules/@flakes/store/dist/sqlite.js +0 -34
  126. package/dist/node_modules/@flakes/store/dist/sqlite.js.map +0 -1
@@ -1,3 +0,0 @@
1
- import{i as e,t}from"./react-B8IZ02wI.js";import{m as n}from"./tiny-invariant-CO5X59di.js";import{t as r}from"./react-dom-ki7NpxV4.js";import{r as i,t as a}from"./utils-CBxvVKOM.js";import{t as o}from"./file-text-DLxLJ7P1.js";import{t as s}from"./lock-Ck2SfQA2.js";import{t as c}from"./x-Bdsfqbi3.js";import{a as l}from"./dist-BEfdrJTS.js";import{$ as u,B as d,Ct as f,F as p,H as m,I as h,J as ee,L as g,M as _,N as v,O as te,P as y,Q as ne,R as b,V as re,W as ie,X as ae,Y as oe,Z as se,_t as x,mt as ce,ut as le,z as ue}from"./main-LpSDdT-S.js";import{n as S,t as C}from"./card-37qs8AAd.js";import{a as w,c as de,d as T,f as E,i as D,l as fe,n as pe,o as me,r as O,t as he,u as ge}from"./bits-BOMPEHvv.js";import{a as k,i as A,n as j,o as M,r as N,t as P}from"./table-WMIs2m3R.js";import{t as _e}from"./SandboxesLens-BoLM52PY.js";var ve=i(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),ye=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`}]]),be=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`}]]),xe=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`}]]),Se=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`}]]),Ce=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=e(t(),1),I=n(),L=`Tabs`,[we,Te]=re(L,[p]),Ee=p(),[De,R]=we(L),Oe=F.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=h(s),[d,f]=ue({prop:r,onChange:i,defaultProp:a??``,caller:L});return(0,I.jsx)(De,{scope:n,baseId:g(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,I.jsx)(m.div,{dir:u,"data-orientation":o,...l,ref:t})})});Oe.displayName=L;var ke=`TabsList`,Ae=F.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=R(ke,n),o=Ee(n);return(0,I.jsx)(y,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,I.jsx)(m.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});Ae.displayName=ke;var je=`TabsTrigger`,Me=F.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=R(je,n),s=Ee(n),c=Fe(o.baseId,r),l=Ie(o.baseId,r),u=r===o.value;return(0,I.jsx)(v,{asChild:!0,...s,focusable:!i,active:u,children:(0,I.jsx)(m.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:d(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:d(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:d(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});Me.displayName=je;var Ne=`TabsContent`,Pe=F.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=R(Ne,n),c=Fe(s.baseId,r),l=Ie(s.baseId,r),u=r===s.value,d=F.useRef(u);return F.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,I.jsx)(b,{present:i||u,children:({present:n})=>(0,I.jsx)(m.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:d.current?`0s`:void 0},children:n&&a})})});Pe.displayName=Ne;function Fe(e,t){return`${e}-trigger-${t}`}function Ie(e,t){return`${e}-content-${t}`}var Le=Oe,Re=Ae,ze=Me,Be=Pe;function Ve({className:e,orientation:t=`horizontal`,...n}){return(0,I.jsx)(Le,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:a(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var He=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 Ue({className:e,variant:t=`default`,...n}){return(0,I.jsx)(Re,{"data-slot":`tabs-list`,"data-variant":t,className:a(He({variant:t}),e),...n})}function z({className:e,...t}){return(0,I.jsx)(ze,{"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)(Be,{"data-slot":`tabs-content`,className:a(`flex-1 outline-none`,e),...t})}var We=e(r(),1),V=192,H=60,U=248,W=76,Ge=2,Ke=18,qe=16,Je=1e4,G=new Set([`SUCCEEDED`,`FAILED`,`CANCELLED`]),Ye=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 Xe(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 Ze(e,t){return Qe(e,t)>=2&&Math.abs(t.y-e.y)<W*.5}function Qe(e,t){return Math.max(1,Math.round((t.x-e.x)/U))}function $e(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 et(e){let t=e===``?[]:e.split(`
2
- `).map(e=>{let[t=``,n=``]=e.split(`>`);return{id:t,deps:n===``?[]:n.split(`,`)}}),n=Xe(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||Qe(t,s)>Ge)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=>Ze(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,Ke+r*qe)}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:$e({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 tt(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
- `),d=(0,F.useMemo)(()=>et(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)(ft,{});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 h=new Map(e.tasks.map(e=>[e.taskId,e.status])),ee=Date.now(),g=(0,I.jsx)(nt,{graph:d,tasks:e.tasks,ordinals:e.ordinals,now:ee,statusById:h,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)(it,{width:d.layout.width,height:d.layout.height,onExpand:()=>i(!0),collapsed:r,children:g}),r?(0,I.jsx)(at,{width:d.layout.width,height:d.layout.height,onClose:()=>i(!1),children:g}):null]})}function nt(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)(st,{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)(ut,{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 rt(e,t,n){return Math.min(n,Math.max(t,e))}function it(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)(be,{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)(be,{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 at(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,We.createPortal)((0,I.jsx)(`div`,{className:`fixed inset-0 z-50 bg-background/95 backdrop-blur-sm`,children:(0,I.jsx)(ot,{width:e.width,height:e.height,onClose:t,children:e.children})}),document.body)}function ot(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=rt(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=rt(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)(Ce,{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)(Se,{className:`size-4`,"aria-hidden":!0})}),(0,I.jsx)(Y,{label:`Fit to screen`,onClick:a,children:(0,I.jsx)(xe,{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 st(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:{...D(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)&&Ye.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 ct={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`},lt={SUCCEEDED:`var(--status-succeeded)`,FAILED:`var(--status-failed)`,CANCELLED:`var(--status-warn)`};function ut(e){let t=e.task,n=t.status.toUpperCase(),r=n===`RUNNING`,i=w(t),o=t.assignmentHeartbeatAt,s=r&&o!==void 0&&e.now-Date.parse(o)>Je,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?D(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`,ct[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)(dt,{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":lt[n]??`var(--status-idle)`}},e.flashNonce)]})}function dt(e){switch(e.status){case`RUNNING`:return(0,I.jsx)(x,{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)(ve,{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 ft(){return(0,I.jsxs)(it,{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:$e(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 pt(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 mt(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)(T,{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)(ht,{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)(gt,{label:`Success rate`,rate:t.tasks?.successRate}),(0,I.jsx)(gt,{label:`Locality hit`,rate:t.locality?.localityHitRate}),(0,I.jsx)(gt,{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:pt(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 ht(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 gt(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":ge(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 _t=new Set([`SUCCEEDED`,`FAILED`,`CANCELLED`]),vt={RUNNING:`bg-status-running`,SUCCEEDED:`bg-status-succeeded`,FAILED:`bg-status-failed`,CANCELLED:`bg-status-warn`},yt=`repeating-linear-gradient(45deg, var(--status-idle) 0 3px, transparent 3px 6px)`,bt=`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 xt(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`,bt),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=_t.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`,bt),children:[(0,I.jsx)(`span`,{className:`truncate font-mono text-[11px]`,children:w(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:yt}}):null,t.startedAt!==void 0&&c!==void 0?(0,I.jsx)(`span`,{className:a(`absolute inset-y-0.5 rounded-[2px]`,vt[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 St=[`SUCCEEDED`,`FAILED`,`CANCELLED`],Ct=new Set([`SUCCEEDED`,`FAILED`,`CANCELLED`,`STALLED`]),wt=40;function Tt(e){if(e===void 0)return;let t=Date.parse(e.createdAt),n=e.completedAt===void 0?Ct.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 Et(e){let t=oe(e.runId),n=ee(),r=u(e.runId),i=ae(e.runId),a=ne(e.runId),o=se(e.runId),s=ie(),c=f(),l=e.view,[d,p]=(0,F.useState)(null),[m,h]=(0,F.useState)(null),g=t.data?.state===`RUNNING`;fe(g?1e3:3e4);let _=r.data?.tasks??[],v=me(_),y=t=>c({to:`/runs/$runId/t/$taskId`,params:{runId:e.runId,taskId:t}}),b={};if(_.length>0)for(let e of _)b[e.status]=(b[e.status]??0)+1;else t.data?.taskStatusCounts!==void 0&&Object.assign(b,t.data.taskStatusCounts);let re=Object.values(b).reduce((e,t)=>e+t,0),x=St.reduce((e,t)=>e+(b[t]??0),0),ue=ge(x),S=Tt(t.data),C=t.data===void 0?void 0:te(n.data?.projects??[],t.data),w=d??_.length<=wt,T=t.data!==void 0&&Ct.has(t.data.state);async function D(){if(t.data!==void 0&&window.confirm(`Delete "${t.data.name}" from run history?`)){h(null);try{await s.mutateAsync(e.runId),c({to:`/runs`})}catch(e){h(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)(he,{state:t.data.state,id:e.runId}):null,(0,I.jsx)(pe,{counts:b,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":ue,children:[x,`/`,re,` 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:()=>{le(`/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)(ye,{className:`size-3.5`}),`History`]}),(0,I.jsxs)(`button`,{type:`button`,title:T?`Delete this run from history`:`Delete is available after the run finishes`,disabled:!T||s.isPending,onClick:()=>{D()},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)(ce,{className:`size-3.5`}),s.isPending?`Deleting`:`Delete`]})]}),(0,I.jsxs)(`p`,{className:`font-mono text-xs text-muted-foreground`,children:[e.runId,C===void 0?null:(0,I.jsxs)(I.Fragment,{children:[` · `,C]}),t.data?(0,I.jsxs)(I.Fragment,{children:[` · created `,(0,I.jsx)(`span`,{title:t.data.createdAt,children:de(t.data.createdAt)})]}):null]}),m?(0,I.jsx)(`p`,{className:`text-xs text-destructive`,children:m}):null]}),(0,I.jsxs)(Ve,{value:e.tab,onValueChange:e.onTabChange,children:[(0,I.jsxs)(Ue,{children:[(0,I.jsx)(z,{value:`overview`,children:`Overview`}),(0,I.jsxs)(z,{value:`artifacts`,children:[`Artifacts`,i.data?.artifacts.length?(0,I.jsx)(E,{variant:`secondary`,"data-num":!0,children:i.data.artifacts.length}):null]}),(0,I.jsx)(z,{value:`metrics`,children:`Metrics`}),(0,I.jsxs)(z,{value:`files`,children:[`Files`,o.data?.reservations.length?(0,I.jsx)(E,{variant:`secondary`,"data-num":!0,children:o.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)(Dt,{active:l===`map`,onClick:()=>e.onViewChange(`map`),children:`Map`}),(0,I.jsx)(Dt,{active:l===`timeline`,onClick:()=>e.onViewChange(`timeline`),children:`Timeline`}),(0,I.jsx)(Dt,{active:l===`sandboxes`,onClick:()=>e.onViewChange(`sandboxes`),children:`By Sandbox`}),l!==`sandboxes`&&_.length>wt?(0,I.jsx)(`button`,{type:`button`,onClick:()=>p(!w),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:w?`Collapse`:`Expand (${_.length} tasks)`}):null]}),l===`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)(_e,{tasks:_,ordinals:v,pending:r.isPending,onSelect:y})]}):(0,I.jsxs)(I.Fragment,{children:[w&&!r.isError?l===`map`?(0,I.jsx)(tt,{tasks:_,ordinals:v,pending:r.isPending,selectedTaskId:null,onSelect:y}):(0,I.jsx)(xt,{tasks:_,pending:r.isPending,runCreatedAt:t.data?.createdAt,runActive:g,onSelect:y}):null,(0,I.jsxs)(`div`,{className:`grid gap-2`,children:[(0,I.jsx)(`h2`,{className:`console-callout`,children:`Tasks`}),(0,I.jsx)(Ot,{tasks:_,ordinals:v,pending:r.isPending,error:r.isError?String(r.error):null,onOpen:y})]})]})]}),(0,I.jsx)(B,{value:`artifacts`,className:`pt-3`,children:(0,I.jsx)(Nt,{artifacts:i.data?.artifacts,error:i.isError?String(i.error):null})}),(0,I.jsx)(B,{value:`metrics`,className:`pt-3`,children:(0,I.jsx)(mt,{metrics:a.data,error:a.isError?String(a.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)(kt,{reservations:o.data?.reservations,tasks:_,ordinals:v,pending:o.isPending,error:o.isError?String(o.error):null,onOpen:y})]})})]})]})}function Dt(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 Ot(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)(C,{className:`py-0`,children:(0,I.jsx)(S,{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)(T,{className:`h-4 w-full max-w-28`})},e))}):t.map(t=>{let n=w(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)(he,{state:t.status,id:t.taskId}),(0,I.jsx)(At,{task:t})]})}),(0,I.jsx)(N,{children:t.workpad?(0,I.jsxs)(E,{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)(E,{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)(_,{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 kt(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)(C,{className:`py-0`,children:(0,I.jsx)(S,{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)(T,{className:`h-4 w-full max-w-28`})},e))}):t.map(t=>{let r=n.get(t.taskId),i=r?w(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)(E,{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:jt(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 At(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)(E,{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)(E,{variant:`secondary`,className:`font-mono text-[10px] uppercase tracking-[0.08em]`,title:`Idle timeout ${n}`,children:[`idle `,O(n)]})]})}function jt(e){return`${e.selector.kind}:${e.selector.path}`}function Mt(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 Nt(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 le(`/v1/artifacts/${encodeURIComponent(e.artifactId)}/fetch`,Pt(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)(C,{className:`py-0`,children:(0,I.jsx)(S,{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=>It(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:zt(e.metadata)})]}),(0,I.jsx)(N,{children:(0,I.jsx)(E,{variant:`secondary`,className:`font-mono text-[10px] uppercase tracking-[0.08em]`,children:e.kind})}),(0,I.jsx)(N,{children:(0,I.jsx)(E,{variant:`outline`,className:a(`font-mono text-[10px] uppercase tracking-[0.08em]`,Mt(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?`—`:pt(e.sizeBytes)}),(0,I.jsx)(N,{className:`min-w-44`,children:(0,I.jsx)(Lt,{locations:e.locations})}),(0,I.jsx)(N,{children:n?(0,I.jsxs)(_,{type:`button`,size:`xs`,variant:`outline`,disabled:r,title:`Download artifact bytes through the control plane`,onClick:()=>void s(e),children:[(0,I.jsx)(ye,{}),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 Pt(e){return Ft(e.metadata)??e.locations.map(e=>Ft(e.metadata)).find(e=>e!==void 0)??e.artifactId}function Ft(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 It(e){return e.storageKind===`sandbox-local`&&e.bytesAvailable}function Lt(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)(E,{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:Rt(e),children:[e.storageKind,e.sandboxId?` · ${e.sandboxId}`:``,e.bytesAvailable?``:` · unavailable`]},e.artifactLocationId))})}function Rt(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 zt(e){let t=Object.entries(e).filter(([e])=>e!==`clientScope`);return t.length===0?`descriptor`:t.slice(0,2).map(([e,t])=>`${e}=${Bt(t)}`).join(` · `)}function Bt(e){return typeof e==`string`||typeof e==`number`?String(e):typeof e==`boolean`?e?`true`:`false`:JSON.stringify(e)}export{Et as RunPage};
@@ -1 +0,0 @@
1
- import{m as e}from"./tiny-invariant-CO5X59di.js";import{r as t,t as n}from"./utils-CBxvVKOM.js";import{t as r}from"./arrow-right-QzVbRzF_.js";import{t as i}from"./external-link-BWhbbPgy.js";import{$ as a,et as o}from"./main-LpSDdT-S.js";import{n as s,t as c}from"./card-37qs8AAd.js";import{c as l,d as u,l as d,o as f,t as p}from"./bits-BOMPEHvv.js";import{t as m}from"./SandboxesLens-BoLM52PY.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 +0,0 @@
1
- import{i as e,t}from"./react-B8IZ02wI.js";import{m as n}from"./tiny-invariant-CO5X59di.js";import{t as r}from"./link-ll3nLBSM.js";import{r as i,t as a}from"./utils-CBxvVKOM.js";import{n as o,r as s,t as c}from"./lib-COfgMmRR.js";import{t as l}from"./save-Bte_1tnN.js";import{t as u}from"./x-Bdsfqbi3.js";import{$ as d,M as f,at as p,it as m,lt as h,nt as g,ot as ee,st as te,tt as _}from"./main-LpSDdT-S.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-BOMPEHvv.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=e(t(),1),k=n();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=d(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),h=[...l].sort((e,t)=>(u.get(e.taskId)??0)-(u.get(t.taskId)??0)),g=h.findIndex(t=>t.taskId===e.taskId),_=g>=0?h[g]:void 0,C=g>0?h[g-1]:void 0,w=g>=0&&g<h.length-1?h[g+1]:void 0,T=_?.status===`RUNNING`,E=_!==void 0&&ce.has(_.status),D=e.transcriptMode,A=p(_===void 0?null:e.taskId,T),j=ee(_===void 0?null:e.taskId,D===`raw`,T),M=te(_===void 0?null:e.taskId,T),N=m(_===void 0?null:e.taskId,T);x(T?1e3:3e4);let P=_===void 0?void 0:v(_),F=g>=0?g+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)]}):_===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}),_===void 0?null:(0,k.jsx)(re,{state:_.status,id:_.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})]})]}),_===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:_.assignedSandboxId??_.lastSandboxId??`—`}),(0,k.jsx)(Q,{label:`attempt`,value:String(_.currentAttemptNumber??_.attemptCount??`—`),num:!0}),(0,k.jsx)(Q,{label:`agent`,value:_.agentId}),(0,k.jsx)(Q,{label:`accepted`,value:S(_.assignmentAcceptedAt),num:!0}),(0,k.jsx)(Te,{heartbeatAt:_.assignmentHeartbeatAt,running:_.status===`RUNNING`}),(0,k.jsx)(Q,{label:`finished`,value:S(_.lastFinishedAt),num:!0})]}),_!==void 0&&_.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`}),_.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:_}),(0,k.jsx)(V,{taskId:_===void 0?null:e.taskId,workpad:M.data??null,pending:_===void 0||M.isPending,error:M.isError?String(M.error):null},_?.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:_!==void 0&&K(_)}):(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:_!==void 0&&K(_),outbound:n})}),s?null:(0,k.jsxs)(f,{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:_===void 0?null:e.taskId,running:T,supported:_!==void 0,onMessageQueued:e=>{i(t=>[...t,e])},onMessageStatus:(e,t)=>{i(n=>n.map(n=>n.id===e?{...n,status:t}:n))}},_?.taskId??e.taskId)})]})]})]})}function ue(e){let[t,n]=(0,O.useState)(`follow_up`),[r,i]=(0,O.useState)(``),a=g(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)(f,{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)(f,{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)(f,{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=_(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)(f,{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)(f,{type:`button`,size:`xs`,disabled:!m,onClick:()=>void d(),children:[(0,k.jsx)(l,{className:`size-3`}),t.isPending?`Saving`:`Save`]})]}):(0,k.jsxs)(f,{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 h&&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 +0,0 @@
1
- import{m as e}from"./tiny-invariant-CO5X59di.js";import{n as t}from"./main-LpSDdT-S.js";import{t as n}from"./DocumentationPage-CNPk8RVl.js";var r=e();function i(){let{path:e}=t.useLoaderData();return(0,r.jsx)(n,{selectedPath:e})}export{i as component};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RunPage-BdugbnA3.js","assets/react-B8IZ02wI.js","assets/main-LpSDdT-S.js","assets/dist-BEfdrJTS.js","assets/utils-CBxvVKOM.js","assets/link-ll3nLBSM.js","assets/react-dom-ki7NpxV4.js","assets/tiny-invariant-CO5X59di.js","assets/matchContext-puEkI9BI.js","assets/redirect-Cu9zBy04.js","assets/qss-4JXuaDtg.js","assets/file-text-DLxLJ7P1.js","assets/lock-Ck2SfQA2.js","assets/x-Bdsfqbi3.js","assets/bits-BOMPEHvv.js","assets/card-37qs8AAd.js","assets/table-WMIs2m3R.js","assets/SandboxesLens-BoLM52PY.js"])))=>i.map(i=>d[i]);
2
- import{i as e,t}from"./react-B8IZ02wI.js";import{m as n}from"./tiny-invariant-CO5X59di.js";import{Ct as r,St as i,r as a,w as o,xt as s}from"./main-LpSDdT-S.js";var c=e(t()),l=n(),u=(0,c.lazy)(()=>o(()=>import(`./RunPage-BdugbnA3.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,17])));function d(){let{runId:e}=a.useParams(),{tab:t,view:n}=a.useSearch(),o=s(),c=r();return f(o.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)(i,{})}function f(e){return e===`/`?e:e.replace(/\/$/,``)}export{d as component};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TranscriptPage-CHSq0_qN.js","assets/react-B8IZ02wI.js","assets/main-LpSDdT-S.js","assets/dist-BEfdrJTS.js","assets/utils-CBxvVKOM.js","assets/link-ll3nLBSM.js","assets/react-dom-ki7NpxV4.js","assets/tiny-invariant-CO5X59di.js","assets/matchContext-puEkI9BI.js","assets/redirect-Cu9zBy04.js","assets/qss-4JXuaDtg.js","assets/lib-COfgMmRR.js","assets/save-Bte_1tnN.js","assets/x-Bdsfqbi3.js","assets/bits-BOMPEHvv.js"])))=>i.map(i=>d[i]);
2
- import{i as e,t}from"./react-B8IZ02wI.js";import{m as n}from"./tiny-invariant-CO5X59di.js";import{Ct as r,t as i,w as a}from"./main-LpSDdT-S.js";var o=e(t()),s=n(),c=(0,o.lazy)(()=>a(()=>import(`./TranscriptPage-CHSq0_qN.js`).then(e=>({default:e.TranscriptPage})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])));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 +0,0 @@
1
- import{i as e,t}from"./react-B8IZ02wI.js";import{m as n}from"./tiny-invariant-CO5X59di.js";import{t as r}from"./link-ll3nLBSM.js";import{r as i,t as a}from"./utils-CBxvVKOM.js";import{t as o}from"./arrow-right-QzVbRzF_.js";import{t as s}from"./circle-check-CzwcEElH.js";import{t as c}from"./circle-x-C_sOQVNQ.js";import{r as l}from"./signin-form-CBF-d8iK.js";import{t as u}from"./otp-verification-CussJQT1.js";import{t as d}from"./user-Bt9z7sSI.js";import{Ct as ee,D as f,E as p,M as m,_t as h,f as g,ht as _,i as v,p as y}from"./main-LpSDdT-S.js";import{t as b}from"./auth-layout-DBnq_eif.js";var x=i(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),S=e(t(),1);function C(e){return(e??``).trim().replace(/[\s-]+/g,``).toUpperCase()}function w(e){return C(D(e)??e)}function T(e){let t=e??``,n=(t.includes(`user_code=`)?w(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=w(e);t.length>0&&r.push(t[0]??` `)}return r.concat(Array(8).fill(` `)).slice(0,8)}function E(e){let t=C(e);return t.length<=4?t:`${t.slice(0,4)}-${t.slice(4)}`}function D(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 O(e){let t=C(e);return t.length===0?`/device`:`/device?user_code=${encodeURIComponent(t)}`}async function te(e,t){let n=C(t);if(n.length===0)return N(n,{title:`Device code missing`,message:`Start login again from the Flakes CLI.`});let r=await e.verify(n);if(r.error)return M(n,r.error);switch(r.data?.status){case`pending`:return{state:`ready`,userCode:n,displayUserCode:E(n)};case`approved`:return A(n);case`denied`:return j(n);default:return N(n,{title:`Device code not found`,message:`Start login again from the Flakes CLI.`})}}async function k(e,t,n){let r=C(n);if(r.length===0)return N(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?M(r,i.error):t===`approve`?A(r):j(r)}function A(e){return{state:`approved`,userCode:e,displayUserCode:E(e),title:`CLI session authorized`,message:`Open the console to continue.`}}function j(e){return{state:`denied`,userCode:e,displayUserCode:E(e),title:`CLI session denied`,message:`The waiting login request has been rejected.`}}function M(e,t){switch(P(t)){case`expired_token`:return N(e,{title:`Device code expired`,message:`Start login again from the Flakes CLI.`});case`device_code_already_processed`:return N(e,{title:`Device code already used`,message:`This login request has already been completed.`});case`unauthorized`:return N(e,{title:`Sign-in required`,message:`Sign in again before authorizing the CLI.`});case`access_denied`:return N(e,{title:`Device code belongs to another user`,message:`Use the same account that opened the device request.`});default:return N(e,{title:`Device code not found`,message:`Start login again from the Flakes CLI.`})}}function N(e,t){return{state:`invalid`,userCode:e,displayUserCode:E(e),...t}}function P(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 F=n(),I=[`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 L(e){let t=(0,S.useRef)([]),n=(0,S.useRef)(void 0),r=T(e.value);(0,S.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[R(r)]?.focus()})}function a(e,t){let n=w(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=w(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,F.jsxs)(`fieldset`,{className:`grid gap-2`,"aria-describedby":`${e.id}-error`,children:[(0,F.jsx)(`legend`,{className:`console-callout pb-2`,children:e.label}),(0,F.jsx)(`div`,{className:`flex items-center gap-1.5`,children:I.map((n,i)=>(0,F.jsx)(z,{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,F.jsx)(`p`,{id:`${e.id}-error`,className:`min-h-4 text-xs text-destructive`,children:e.error??``})]})}function R(e){return Math.max(0,Math.min(e,7))}function z(e){return(0,F.jsxs)(F.Fragment,{children:[e.index===4?(0,F.jsx)(`span`,{className:`px-0.5 font-mono text-sm text-muted-foreground`,children:`-`}):null,(0,F.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 B(){let{user_code:e}=v.useSearch(),t=ee(),n=f.useSession(),i=C(e),a=(0,S.useMemo)(Y,[]),[o,s]=(0,S.useState)(()=>J(i)),[c,d]=(0,S.useState)(()=>E(i)),[m,h]=(0,S.useState)(),[_,x]=(0,S.useState)(0),[T,D]=(0,S.useState)(!1),[A,j]=(0,S.useState)(null),[M,N]=(0,S.useState)(`signin`),[P,I]=(0,S.useState)(``),[L,R]=(0,S.useState)(``),[z,B]=(0,S.useState)(null);(0,S.useEffect)(()=>{d(E(i)),h(void 0),x(0),N(`signin`),j(null)},[i]),(0,S.useEffect)(()=>{if(n.isPending||i.length===0||n.data===null)return;let e=!0;return s(J(i)),te(a,i).then(t=>{e&&s(t)}),()=>{e=!1}},[a,n.data,n.isPending,i]);function X(e){e.preventDefault();let n=w(c);if(n.length!==8){h(`Enter the 8-character code shown in your terminal.`),x(e=>e+1);return}if(o.state===`invalid`&&n===i){h(o.title),x(e=>e+1);return}h(void 0),t({to:`/device`,search:{user_code:n},replace:!0})}function Z(e){d(e),h(void 0)}async function Q(e){z||(B(e),s(await k(a,e,i)),B(null))}async function re(e){D(!0),j(null),I(e.email),R(e.password);let t=await f.signIn.email({email:e.email,password:e.password});if(t.error){if(y(t.error)){let t=await f.emailOtp.sendVerificationOtp({email:e.email,type:`email-verification`});if(D(!1),t.error){j(g(t.error,`Could not send verification code.`));return}N(`verify`);return}D(!1),j(g(t.error));return}D(!1),window.location.assign(p(O(i)))}async function ie(e){if(D(!0),j(null),(await f.emailOtp.verifyEmail({email:P,otp:e})).error){D(!1),j(`Verification failed: the six-digit code is incorrect.`);return}let t=await f.signIn.email({email:P,password:L});if(D(!1),t.error){j(`Verification succeeded, but failed to sign in: ${g(t.error)}`),N(`signin`);return}window.location.assign(p(O(i)))}if(n.isPending)return(0,F.jsx)(b,{title:`Authorize CLI session`,description:`Flakes is checking your account session.`,children:(0,F.jsx)(K,{displayUserCode:E(i)})});if(i.length===0)return(0,F.jsx)(b,{title:`Authorize CLI session`,description:`Enter the code shown by the Flakes CLI.`,footer:n.data?(0,F.jsx)(U,{userLabel:G(n.data.user)}):(0,F.jsx)(`p`,{children:`Sign in after entering a code to authorize the CLI session.`}),children:(0,F.jsx)(V,{value:c,error:m,errorPulse:_,onChange:Z,onSubmit:X})});let ae=n.data?.user.email??n.data?.user.name??`Signed-in account`;if(n.data===null)return(0,F.jsx)(b,{title:`Authorize CLI session`,description:`Sign in to authorize this CLI login.`,footer:(0,F.jsxs)(`p`,{children:[`Need access?`,` `,(0,F.jsx)(r,{to:`/signup`,search:{redirect:O(i)},className:`text-foreground underline-offset-4 hover:underline`,children:`Create an account`})]}),children:(0,F.jsxs)(`div`,{className:`grid gap-4`,children:[(0,F.jsx)(H,{displayUserCode:E(i)}),M===`signin`?(0,F.jsx)(l,{error:A,pending:T,redirectTarget:O(i),onSubmit:re}):(0,F.jsx)(u,{email:P,error:A,pending:T,onVerify:ie,onBack:()=>{j(null),N(`signin`)}})]})});if(o.state===`invalid`){let e=w(c)===i?o.title:void 0;return(0,F.jsx)(b,{title:`Authorize CLI session`,description:`Enter the code shown by the Flakes CLI.`,footer:(0,F.jsxs)(`p`,{children:[`Wrong account?`,` `,(0,F.jsx)(r,{to:`/signin`,search:{redirect:O(i)},className:`text-foreground underline-offset-4 hover:underline`,children:`Sign in again`})]}),children:(0,F.jsx)(V,{value:c,error:m??e,errorPulse:_,onChange:Z,onSubmit:X})})}let $=ne(o);return(0,F.jsx)(b,{title:$.title,description:$.description,footer:(0,F.jsxs)(`p`,{children:[`Wrong account?`,` `,(0,F.jsx)(r,{to:`/signin`,search:{redirect:O(i)},className:`text-foreground underline-offset-4 hover:underline`,children:`Sign in again`})]}),children:(0,F.jsxs)(`div`,{className:`grid gap-4`,children:[(0,F.jsx)(H,{displayUserCode:o.displayUserCode}),n.data?(0,F.jsx)(U,{userLabel:ae}):null,o.state===`checking`?(0,F.jsx)(K,{displayUserCode:o.displayUserCode}):o.state===`ready`?(0,F.jsx)(W,{pendingDecision:z,onApprove:()=>Q(`approve`),onDeny:()=>Q(`deny`)}):(0,F.jsx)(q,{view:o})]})})}function ne(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,F.jsxs)(`form`,{className:`grid gap-4`,onSubmit:e.onSubmit,noValidate:!0,children:[(0,F.jsx)(L,{id:`device-user-code`,label:`Device code`,value:e.value,error:e.error,errorPulse:e.errorPulse,onChange:e.onChange}),(0,F.jsxs)(m,{type:`submit`,className:`font-mono`,children:[(0,F.jsx)(o,{className:`size-4`}),` Continue`]})]})}function H(e){return(0,F.jsxs)(`section`,{className:`rounded-md border bg-background p-3`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,F.jsx)(`p`,{className:`console-callout`,children:`Device code`}),(0,F.jsx)(x,{className:`size-4 text-muted-foreground`})]}),(0,F.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,F.jsxs)(`p`,{className:`flex items-center gap-2 rounded-md border bg-background px-3 py-2 text-sm text-muted-foreground`,children:[(0,F.jsx)(d,{className:`size-4 shrink-0`}),(0,F.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Signed in as `,e.userLabel]})]})}function W(e){return(0,F.jsxs)(`div`,{className:`grid gap-3`,children:[(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Authorizing will let this CLI session use your Flakes account.`}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,F.jsxs)(m,{type:`button`,disabled:e.pendingDecision!==null,className:`font-mono`,onClick:e.onApprove,children:[e.pendingDecision===`approve`?(0,F.jsx)(h,{className:`size-4 animate-spin`}):(0,F.jsx)(s,{className:`size-4`}),`Authorize`]}),(0,F.jsxs)(m,{type:`button`,variant:`outline`,disabled:e.pendingDecision!==null,className:`font-mono`,onClick:e.onDeny,children:[e.pendingDecision===`deny`?(0,F.jsx)(h,{className:`size-4 animate-spin`}):(0,F.jsx)(c,{className:`size-4`}),`Deny`]})]})]})}function G(e){return e.email??e.name??`Signed-in account`}function K(e){return(0,F.jsxs)(`p`,{className:`flex min-h-10 items-center gap-2 text-sm text-muted-foreground`,children:[(0,F.jsx)(h,{className:`size-4 animate-spin`}),(0,F.jsxs)(`span`,{children:[`Checking `,e.displayUserCode?e.displayUserCode:`device code`]})]})}function q(e){let t=e.view.state===`approved`;return(0,F.jsxs)(`section`,{className:a(`grid gap-2 rounded-md border p-4`,t?`border-primary/30 bg-primary/10`:`bg-muted/40`),children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t?(0,F.jsx)(_,{className:`size-4 text-primary`}):(0,F.jsx)(c,{className:`size-4 text-muted-foreground`}),(0,F.jsx)(`h2`,{className:`text-sm font-medium`,children:e.view.title})]}),(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.view.message}),t?(0,F.jsx)(m,{asChild:!0,className:`mt-1 font-mono`,children:(0,F.jsxs)(r,{to:`/runs`,children:[(0,F.jsx)(o,{className:`size-4`}),` Open Console`]})}):null]})}function J(e){return{state:`checking`,userCode:e,displayUserCode:E(e)}}function Y(){return{verify:async e=>{let t=await f.device({query:{user_code:e}});return{...t.data?{data:X(t.data)}:{},...t.error?{error:t.error}:{}}},approve:async e=>Z(await f.device.approve({userCode:e})),deny:async e=>Z(await f.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{B as component};
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-B8IZ02wI.js";import{n}from"./utils-CBxvVKOM.js";var r=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,i=n,a=(e,t)=>n=>{if(t?.variants==null)return i(e,n?.class,n?.className);let{variants:a,defaultVariants:o}=t,s=Object.keys(a).map(e=>{let t=n?.[e],i=o?.[e];if(t===null)return null;let s=r(t)||r(i);return a[e][s]}),c=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return i(e,s,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...i}=t;return Object.entries(i).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...o,...c}[t]):{...o,...c}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},o=e(t(),1);function s(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function c(...e){return t=>{let n=!1,r=e.map(e=>{let r=s(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():s(e[t],null)}}}}function l(...e){return o.useCallback(c(...e),e)}function u(e){let t=o.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,s=!1,c=[];v(r)&&typeof S==`function`&&(r=S(r._payload)),o.Children.forEach(r,e=>{if(g(e)){s=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;v(n)&&typeof S==`function`&&(n=S(n._payload)),a=p(t,n),c.push(a?.props?.children)}else c.push(e)}),a?a=o.cloneElement(a,void 0,c):!s&&o.Children.count(r)===1&&o.isValidElement(r)&&(a=r);let u=a?h(a):void 0,d=l(n,u);if(!a){if(r||r===0)throw Error(s?x(e):b(e));return r}let f=m(i,a.props??{});return a.type!==o.Fragment&&(f.ref=n?d:u),o.cloneElement(a,f)});return t.displayName=`${e}.Slot`,t}var d=u(`Slot`),f=Symbol.for(`radix.slottable`),p=(e,t)=>{if(`child`in e.props){let t=e.props.child;return o.isValidElement(t)?o.cloneElement(t,void 0,e.props.children(t.props.children)):null}return o.isValidElement(t)?t:null};function m(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function h(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function g(e){return o.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===f}var _=Symbol.for(`react.lazy`);function v(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===_&&`_payload`in e&&y(e._payload)}function y(e){return typeof e==`object`&&!!e&&`then`in e}var b=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,x=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,S=o.use;export{a,l as i,u as n,c as r,d as t};
@@ -1 +0,0 @@
1
- import{m as e}from"./tiny-invariant-CO5X59di.js";import{St as t,a as n,xt as r}from"./main-LpSDdT-S.js";import{t as i}from"./DocumentationPage-CNPk8RVl.js";var a=e();function o(){return s(r().pathname)===`/documentation`?(0,a.jsx)(i,{selectedPath:n}):(0,a.jsx)(t,{})}function s(e){return e===`/`?e:e.replace(/\/$/,``)}export{o as component};