@coreplane/switchboard 1.267.0 → 1.267.2

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 (154) hide show
  1. package/dist/assets/deploy/cloudflare-resident/gc.ts +1 -0
  2. package/dist/assets/deploy/cloudflare-resident/keyedAsyncLock.ts +20 -0
  3. package/dist/assets/deploy/cloudflare-resident/legacyCredentials.ts +57 -0
  4. package/dist/assets/deploy/cloudflare-resident/orphanThreadUsers.ts +14 -0
  5. package/dist/assets/deploy/cloudflare-resident/worker.ts +646 -204
  6. package/dist/assets/package-lock.json +51 -4
  7. package/dist/assets/package.json +1 -1
  8. package/dist/assets/source.json +3 -3
  9. package/dist/assets/src/core/budgets.ts +10 -0
  10. package/dist/assets/src/core/coordinator/contract.ts +29 -0
  11. package/dist/assets/src/core/coordinator/driver.ts +15 -2
  12. package/dist/assets/src/core/publicationPush.ts +31 -9
  13. package/dist/assets/src/core/runRecord.ts +32 -0
  14. package/dist/assets/src/core/ship/coordinator.ts +53 -5
  15. package/dist/assets/src/execution/githubMintScope.ts +49 -0
  16. package/dist/assets/src/execution/residentCredentials.ts +9 -37
  17. package/dist/assets/src/execution/residentDestroyGate.ts +12 -0
  18. package/dist/assets/src/execution/residentPoolSpends.ts +96 -0
  19. package/dist/assets/src/execution/residentRecreateAdmission.ts +41 -0
  20. package/dist/assets/src/execution/residentSteps.ts +1 -0
  21. package/dist/assets/web/dist/.vite/manifest.json +505 -505
  22. package/dist/assets/web/dist/assets/AppShell-CCPwPqvc.js +1 -0
  23. package/dist/assets/web/dist/assets/{CostChart-4TeDdbvJ.js → CostChart-Y5BqJKLA.js} +2 -2
  24. package/dist/assets/web/dist/assets/CostsPage-RRggVvIx.js +1 -0
  25. package/dist/assets/web/dist/assets/DeliveryPage-CuIBLfup.js +1 -0
  26. package/dist/assets/web/dist/assets/HomePage-BQmun9kS.js +1 -0
  27. package/dist/assets/web/dist/assets/InputMenu-ymuqElZB.js +1 -0
  28. package/dist/assets/web/dist/assets/{MetricsPage-BQBuIuYU.js → MetricsPage-D2YGsI8C.js} +1 -1
  29. package/dist/assets/web/dist/assets/NotFoundPage-DZ6ysTXd.js +1 -0
  30. package/dist/assets/web/dist/assets/PendingTurnRow-BPyJ2f-i.js +1 -0
  31. package/dist/assets/web/dist/assets/PlanePage-C_gVx0Dg.js +1 -0
  32. package/dist/assets/web/dist/assets/ResidentDetailPage-CT6v9INM.js +1 -0
  33. package/dist/assets/web/dist/assets/ResidentsIndexPage-CWqPFf40.js +1 -0
  34. package/dist/assets/web/dist/assets/{RunFoldRow-DrfFauYJ.js → RunFoldRow-C1w-mwch.js} +1 -1
  35. package/dist/assets/web/dist/assets/RunRoutePage-zWMHTzla.js +9 -0
  36. package/dist/assets/web/dist/assets/RunsIndexPage-DF16D2Gg.js +1 -0
  37. package/dist/assets/web/dist/assets/RunsTabs-D7rsC4GR.js +1 -0
  38. package/dist/assets/web/dist/assets/ScheduledPage-CyRs0fXN.js +1 -0
  39. package/dist/assets/web/dist/assets/SettingSelect-CEkCLVWd.js +1 -0
  40. package/dist/assets/web/dist/assets/SettingsPage-BRuMCHSj.js +1 -0
  41. package/dist/assets/web/dist/assets/SilentTurn-D4MMDjWO.js +2 -0
  42. package/dist/assets/web/dist/assets/SlackMark-DjJTK2tD.js +1 -0
  43. package/dist/assets/web/dist/assets/StatusDot-BIAQN7iD.js +1 -0
  44. package/dist/assets/web/dist/assets/Tooltip-CxiQ7luL.js +1 -0
  45. package/dist/assets/web/dist/assets/UnitRoutePage-BQB5mAAl.js +1 -0
  46. package/dist/assets/web/dist/assets/{angular-html-BRRhsdQE.js → angular-html-DR_aiq_z.js} +1 -1
  47. package/dist/assets/web/dist/assets/{angular-ts-BFj-mqCm.js → angular-ts-DdAdPC99.js} +1 -1
  48. package/dist/assets/web/dist/assets/{apl-CsBuy1IL.js → apl-CFsVwJXV.js} +1 -1
  49. package/dist/assets/web/dist/assets/{astro-cVaqxBZq.js → astro-CV6XNX3T.js} +1 -1
  50. package/dist/assets/web/dist/assets/{blade-MEP5mWha.js → blade-BGvEqTv7.js} +1 -1
  51. package/dist/assets/web/dist/assets/browser-BWnzWwaT.js +6 -0
  52. package/dist/assets/web/dist/assets/budgets-CJHiTZmM.js +1 -0
  53. package/dist/assets/web/dist/assets/{c-D4NGQ_Pd.js → c-ViUYuFAx.js} +1 -1
  54. package/dist/assets/web/dist/assets/{chapel-BkWImsIy.js → chapel-CZ7_YbfP.js} +1 -1
  55. package/dist/assets/web/dist/assets/{cobol-RPDSPSET.js → cobol-Dc8kYvS6.js} +1 -1
  56. package/dist/assets/web/dist/assets/{coffee-DZ5z7oVX.js → coffee-C0musOvn.js} +1 -1
  57. package/dist/assets/web/dist/assets/{cpp-CrBtIaRZ.js → cpp-ToPQGcGd.js} +1 -1
  58. package/dist/assets/web/dist/assets/{crystal-DJesYi6f.js → crystal-DUJIaO8W.js} +1 -1
  59. package/dist/assets/web/dist/assets/{css-DO9mjau-.js → css-BTcEgWyQ.js} +1 -1
  60. package/dist/assets/web/dist/assets/{dist-v3Py3_QR.js → dist-I2OEmPqz.js} +2 -2
  61. package/dist/assets/web/dist/assets/{edge-C3VzbSW0.js → edge-D8sh1uAj.js} +1 -1
  62. package/dist/assets/web/dist/assets/{elixir-BkD_Vhfe.js → elixir-D5vOtHrB.js} +1 -1
  63. package/dist/assets/web/dist/assets/{elm-KIM0mFPk.js → elm-B_5xqTuz.js} +1 -1
  64. package/dist/assets/web/dist/assets/{erb-D2ruCqb2.js → erb-DBEct7_l.js} +1 -1
  65. package/dist/assets/web/dist/assets/{eventSource-Cv0AFlMi.js → eventSource-Ds6_gjPD.js} +1 -1
  66. package/dist/assets/web/dist/assets/{git-rebase-CnfbQTxA.js → git-rebase-lWoTL0Qh.js} +1 -1
  67. package/dist/assets/web/dist/assets/{glimmer-js-CbiwFXWH.js → glimmer-js-DNfSP4GT.js} +1 -1
  68. package/dist/assets/web/dist/assets/{glimmer-ts-DV8ii0Pv.js → glimmer-ts-DpPeWMLs.js} +1 -1
  69. package/dist/assets/web/dist/assets/{glsl-CgmznWkA.js → glsl-m6Ziz8q0.js} +1 -1
  70. package/dist/assets/web/dist/assets/{graphql-BK-bBYfH.js → graphql-shD9521e.js} +1 -1
  71. package/dist/assets/web/dist/assets/{hack-DnwTTP5n.js → hack-D_Mf_2gv.js} +1 -1
  72. package/dist/assets/web/dist/assets/{haml-DAVJsWwT.js → haml-BuEAF47S.js} +1 -1
  73. package/dist/assets/web/dist/assets/{handlebars-voOVfxFL.js → handlebars-D2aiSYtv.js} +1 -1
  74. package/dist/assets/web/dist/assets/{html-3FTqwaPk.js → html-CRjXJZot.js} +1 -1
  75. package/dist/assets/web/dist/assets/{html-derivative-CSlhLDQn.js → html-derivative-CYpQX_KK.js} +1 -1
  76. package/dist/assets/web/dist/assets/{http-Vx4ilPfS.js → http-D6vXMpc_.js} +1 -1
  77. package/dist/assets/web/dist/assets/{hurl-DxyZDE3R.js → hurl-B634cMJT.js} +1 -1
  78. package/dist/assets/web/dist/assets/{indexRow-BsWcHHVh.js → indexRow-BGjjLnN5.js} +1 -1
  79. package/dist/assets/web/dist/assets/{java-nWqdjNJG.js → java-BlINdAve.js} +1 -1
  80. package/dist/assets/web/dist/assets/{javascript-Dr82HOwp.js → javascript-BBEMmUOu.js} +1 -1
  81. package/dist/assets/web/dist/assets/{jinja-BhjLrPOt.js → jinja-BIA8TYHJ.js} +1 -1
  82. package/dist/assets/web/dist/assets/{jison-DilGIUa8.js → jison-aepfTbzH.js} +1 -1
  83. package/dist/assets/web/dist/assets/{json-CrOcvmhJ.js → json-DmYZ1boG.js} +1 -1
  84. package/dist/assets/web/dist/assets/{jsx-BW_RX-fo.js → jsx-GkaaF4_W.js} +1 -1
  85. package/dist/assets/web/dist/assets/{julia-CWH071DB.js → julia-DRtMztOz.js} +1 -1
  86. package/dist/assets/web/dist/assets/{just-DkhhoWBy.js → just-PvoeEWoy.js} +1 -1
  87. package/dist/assets/web/dist/assets/{latex-cuHJ4TUT.js → latex-Bujuo3AZ.js} +1 -1
  88. package/dist/assets/web/dist/assets/{liquid-DG6afYQN.js → liquid-B0h0HkS3.js} +1 -1
  89. package/dist/assets/web/dist/assets/{lua-C5CMnCPS.js → lua-6O-O1CSO.js} +1 -1
  90. package/dist/assets/web/dist/assets/main-DYwKyLY5.js +28 -0
  91. package/dist/assets/web/dist/assets/{marko-Dy2_DuC4.js → marko-XS_tpV0N.js} +1 -1
  92. package/dist/assets/web/dist/assets/{mdc-BMKb_EeA.js → mdc-DxULuTS1.js} +1 -1
  93. package/dist/assets/web/dist/assets/{nginx-og0RgMKf.js → nginx-n2RAfCKE.js} +1 -1
  94. package/dist/assets/web/dist/assets/{nim-CQxTQQP0.js → nim-DJxdqD8U.js} +1 -1
  95. package/dist/assets/web/dist/assets/{org-b5lkq_Pl.js → org-R9yxwZ2v.js} +1 -1
  96. package/dist/assets/web/dist/assets/{perl-D9X5_i_J.js → perl-zKAUtl73.js} +1 -1
  97. package/dist/assets/web/dist/assets/{php-CwUxvLX0.js → php-Dk50x1WE.js} +1 -1
  98. package/dist/assets/web/dist/assets/{pug-uOIOExr0.js → pug-C3TSg8JJ.js} +1 -1
  99. package/dist/assets/web/dist/assets/{qml-g5RoADf-.js → qml-CL1nqvCt.js} +1 -1
  100. package/dist/assets/web/dist/assets/{r-5LdAopD3.js → r-Bo44Yl7y.js} +1 -1
  101. package/dist/assets/web/dist/assets/{razor-DwrvFLYQ.js → razor-k2Dt2qXz.js} +1 -1
  102. package/dist/assets/web/dist/assets/{regexp-dGtAaxC-.js → regexp-Uy_HNe6G.js} +1 -1
  103. package/dist/assets/web/dist/assets/{rst-wFdW0brr.js → rst-U0zcRJ60.js} +1 -1
  104. package/dist/assets/web/dist/assets/{ruby-DPglN6I9.js → ruby-DUyqwP37.js} +1 -1
  105. package/dist/assets/web/dist/assets/{sas-CUbCs40d.js → sas-CxC8bRy1.js} +1 -1
  106. package/dist/assets/web/dist/assets/{scss-B-DUiI1c.js → scss-DaqXj6RQ.js} +1 -1
  107. package/dist/assets/web/dist/assets/{shellscript-lGOV7Ram.js → shellscript-CI49IoFh.js} +1 -1
  108. package/dist/assets/web/dist/assets/{shellsession-BDWtAAjr.js → shellsession-DJxotIOK.js} +1 -1
  109. package/dist/assets/web/dist/assets/{soy-zod_dcOy.js → soy-BjVAVuCU.js} +1 -1
  110. package/dist/assets/web/dist/assets/{sql-BG0HSSoM.js → sql-CzxBKQd1.js} +1 -1
  111. package/dist/assets/web/dist/assets/{sseReplay-DuALaBPq.js → sseReplay-BDVyc8HX.js} +4 -4
  112. package/dist/assets/web/dist/assets/{stata-BVUMLp1W.js → stata-DLMv_9_X.js} +1 -1
  113. package/dist/assets/web/dist/assets/{surrealql-DiSUbHKF.js → surrealql-BzbVEZbO.js} +1 -1
  114. package/dist/assets/web/dist/assets/{svelte-DZenT45Y.js → svelte-DTSfopUt.js} +1 -1
  115. package/dist/assets/web/dist/assets/{templ-BWKRNM0-.js → templ-BPxFlKQj.js} +1 -1
  116. package/dist/assets/web/dist/assets/{tex-CbMzBlkK.js → tex-B_KndQwK.js} +1 -1
  117. package/dist/assets/web/dist/assets/{ts-tags-CZsVorDN.js → ts-tags-CG7tgvBl.js} +1 -1
  118. package/dist/assets/web/dist/assets/{tsx-R1r3mH4W.js → tsx-CN9eqIdJ.js} +1 -1
  119. package/dist/assets/web/dist/assets/{twig-BjPMyjKH.js → twig-CKPbB5ca.js} +1 -1
  120. package/dist/assets/web/dist/assets/{typescript-Bx-66VN_.js → typescript-BQAXVjHJ.js} +1 -1
  121. package/dist/assets/web/dist/assets/{typst-fW037Eo6.js → typst-D3EaP9Ui.js} +1 -1
  122. package/dist/assets/web/dist/assets/{vue-D1V_GNxW.js → vue-DuQwQ__D.js} +1 -1
  123. package/dist/assets/web/dist/assets/{vue-html-C-4pTZ-s.js → vue-html-UEJn5cLD.js} +1 -1
  124. package/dist/assets/web/dist/assets/{vue-vine-C-QsX3hR.js → vue-vine-DDdijZY2.js} +1 -1
  125. package/dist/assets/web/dist/assets/{wallClock-x0hjr0J_.js → wallClock-DaewxNMY.js} +1 -1
  126. package/dist/assets/web/dist/assets/{xml-BJTJXPgC.js → xml-BezNDynk.js} +1 -1
  127. package/dist/assets/web/dist/assets/{xsl-Xc9lukqe.js → xsl-Bzb2zIr8.js} +1 -1
  128. package/dist/assets/web/dist/assets/{yaml-Dw-FMsQa.js → yaml-DOccVRRG.js} +1 -1
  129. package/dist/cli.js +1002 -366
  130. package/package.json +1 -1
  131. package/dist/assets/web/dist/assets/AppShell-DPJVhUGP.js +0 -1
  132. package/dist/assets/web/dist/assets/CostsPage-8HDgvuWB.js +0 -1
  133. package/dist/assets/web/dist/assets/DeliveryPage-BUJckSuW.js +0 -1
  134. package/dist/assets/web/dist/assets/HomePage-BfpIrKDX.js +0 -1
  135. package/dist/assets/web/dist/assets/InputMenu-BRV35UWP.js +0 -1
  136. package/dist/assets/web/dist/assets/NotFoundPage-CDjMfCcj.js +0 -1
  137. package/dist/assets/web/dist/assets/PendingTurnRow-C6hroa00.js +0 -1
  138. package/dist/assets/web/dist/assets/PlanePage-C2Cb1mkT.js +0 -1
  139. package/dist/assets/web/dist/assets/ResidentDetailPage-Bd9_Q87l.js +0 -1
  140. package/dist/assets/web/dist/assets/ResidentsIndexPage-C8eS7hxp.js +0 -1
  141. package/dist/assets/web/dist/assets/RunRoutePage-B_eXfNAF.js +0 -9
  142. package/dist/assets/web/dist/assets/RunsIndexPage-BpQu36Dm.js +0 -1
  143. package/dist/assets/web/dist/assets/RunsTabs-C7Ua3XX5.js +0 -1
  144. package/dist/assets/web/dist/assets/ScheduledPage-DGHcjcSt.js +0 -1
  145. package/dist/assets/web/dist/assets/SettingSelect-CEeA4iuC.js +0 -1
  146. package/dist/assets/web/dist/assets/SettingsPage-IfQ71QjN.js +0 -1
  147. package/dist/assets/web/dist/assets/SilentTurn-D9ON15a8.js +0 -2
  148. package/dist/assets/web/dist/assets/SlackMark-DB0MGiF5.js +0 -1
  149. package/dist/assets/web/dist/assets/StatusDot-DyFjGg4V.js +0 -1
  150. package/dist/assets/web/dist/assets/Tooltip-BvPkV4kZ.js +0 -1
  151. package/dist/assets/web/dist/assets/UnitRoutePage-BNe3nBIG.js +0 -1
  152. package/dist/assets/web/dist/assets/browser-CCImen5O.js +0 -6
  153. package/dist/assets/web/dist/assets/budgets-BQgcCyvb.js +0 -1
  154. package/dist/assets/web/dist/assets/main-ks3kBojV.js +0 -28
@@ -0,0 +1 @@
1
+ import{t as e}from"./AppShell-CCPwPqvc.js";import{An as t,Cr as n,Dn as r,Fi as i,Jr as a,Jt as o,Mi as s,Pi as c,Qt as l,Xr as u,_n as d,bn as f,hr as p,ki as m,lr as h,o as ee,pr as g,sn as _,vn as v,xn as y,xr as b,yi as x,yn as S}from"./browser-BWnzWwaT.js";import{a as C,c as te,d as w,f as T,g as E,h as D,l as O,m as k,o as ne,p as re,s as ie,t as A,u as j}from"./CostChart-Y5BqJKLA.js";import{t as ae}from"./eventSource-Ds6_gjPD.js";import{r as oe}from"./settingsApi-Dm6eaQcu.js";import{t as se}from"./wallClock-DaewxNMY.js";var M=[`data-dimension`],ce={class:`flex flex-wrap items-center gap-x-4 gap-y-2`},N={class:`flex items-center gap-2 text-sm text-muted`},P=[`placeholder`,`aria-label`],F=[`title`],I=[`disabled`,`aria-describedby`],L={key:0,id:`me-hint`,class:`me-hint text-xs text-dimmed`},R={class:`coverage font-mono text-xs tabular-nums text-muted`},le={class:`overflow-x-auto`},z={class:`by w-full min-w-[40rem] border-collapse whitespace-nowrap font-mono text-[0.8125rem] tabular-nums`},B={class:`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-left text-xs font-medium text-muted`},V={class:`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-right text-xs font-medium text-muted`},H={key:0,class:`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-right text-xs font-medium text-muted`},ue=[`title`],U={class:`text-highlighted`},de={key:0,class:`ml-1.5 text-xs text-dimmed`},fe={key:1,class:`ml-1.5 rounded-xs bg-accented px-1 text-xs text-highlighted`},W=[`title`],G={class:`border-b border-muted px-2.5 py-1.5 text-right`},K={class:`border-b border-muted px-2.5 py-1.5 text-right`},q={key:0,class:`border-b border-muted px-2.5 py-1.5 text-right`},J={class:`border-b border-muted px-2.5 py-1.5 text-right font-medium text-highlighted`},Y={class:`border-b border-muted px-2.5 py-1.5 text-right`},X={key:0},Z=[`colspan`],pe={key:0},Q=[`colspan`],me={class:`px-2.5 py-1.5 text-right text-xs text-muted`},he={class:`px-2.5 py-1.5 text-right text-xs text-muted`},ge={class:`reconciliation font-mono text-xs tabular-nums text-muted`},_e={class:`text-xs text-dimmed`},ve=t({__name:`CostsByDimension`,props:{report:{}},setup(e){let t=e,n={user:`User`,thread:`Thread`,channel:`Channel`,agent:`Agent`,model:`Model`},a=x(``),c=x(!1),h=d(()=>t.report.dimension),ee=d(()=>t.report.viewer!==void 0),g=d(()=>(t.report.viewer?.userIds.length??0)>0),S=d(()=>t.report.cloudAllocated),C=d(()=>h.value===`model`?`Turns`:`Runs`),te=e=>h.value===`model`?e.turns:e.runs,w=d(()=>{let e=a.value.trim().toLowerCase(),n=new Set(t.report.viewer?.userIds??[]);return t.report.rows.filter(t=>c.value&&!n.has(t.key)?!1:!e||t.key.toLowerCase().includes(e)||(t.label??``).toLowerCase().includes(e))}),T=d(()=>t.report.rows.reduce((e,t)=>e+t.totalUsd,0)),E=d(()=>w.value.reduce((e,t)=>e+t.totalUsd,0)),k=e=>t.report.viewer?.userIds.includes(e.key)??!1,ne=d(()=>h.value===`user`||h.value===`thread`||h.value===`channel`),re=e=>e.label?h.value===`channel`?`#${e.label}`:e.label:ne.value?e.key.replace(/^[a-z]+:/,``):e.key,ie=e=>ne.value&&e.key.includes(`:`)?e.key.split(`:`)[0]:``,A=e=>`${e} day${e===1?``:`s`}`,j=d(()=>S.value?6:5);return(t,d)=>(p(),y(`section`,{class:`by-dimension grid gap-3`,"data-dimension":h.value},[v(`div`,ce,[v(`label`,N,[d[2]||=v(`span`,null,`Filter`,-1),u(v(`input`,{"onUpdate:modelValue":d[0]||=e=>a.value=e,class:`key-filter rounded-md border border-default bg-elevated px-2.5 py-1 font-mono text-xs text-highlighted`,type:`search`,placeholder:h.value===`user`?`name or id`:n[h.value].toLowerCase(),"aria-label":`Filter by ${n[h.value].toLowerCase()}`},null,8,P),[[l,a.value]])]),ee.value?(p(),y(`label`,{key:0,class:s([`me-toggle flex items-center gap-2 text-sm`,g.value?`text-muted`:`text-dimmed`]),title:g.value?`Only your own runs`:void 0},[u(v(`input`,{"onUpdate:modelValue":d[1]||=e=>c.value=e,type:`checkbox`,disabled:!g.value,"aria-label":`Only me`,"aria-describedby":g.value?void 0:`me-hint`},null,8,I),[[o,c.value]]),d[3]||=v(`span`,null,`me`,-1),g.value?f(``,!0):(p(),y(`span`,L,`— your sign-in email matched no Slack user in this range`))],10,F)):f(``,!0),v(`p`,R,[e.report.coverage.historyOn?(p(),y(_,{key:1},[r(` runs from `+i(m(O)(e.report.coverage.from))+` to `+i(m(O)(e.report.range.to)),1),e.report.coverage.clamped?(p(),y(_,{key:0},[r(` · earlier days are past the history's `+i(e.report.coverage.retentionDays)+`-day window`,1)],64)):f(``,!0),e.report.pending>0?(p(),y(_,{key:1},[r(` · `+i(e.report.pending)+` run`+i(e.report.pending===1?``:`s`)+` still being priced`,1)],64)):f(``,!0)],64)):(p(),y(_,{key:0},[r(`history is off — no runs to attribute`)],64))])]),v(`div`,le,[v(`table`,z,[v(`thead`,null,[v(`tr`,null,[v(`th`,B,i(n[h.value]),1),v(`th`,V,i(C.value),1),d[5]||=v(`th`,{class:`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-right text-xs font-medium text-muted`},` LLM `,-1),S.value?(p(),y(`th`,H,[...d[4]||=[r(` Cloud `,-1),v(`span`,{class:`font-normal text-dimmed`},`allocated`,-1)]])):f(``,!0),d[6]||=v(`th`,{class:`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-right text-xs font-medium text-muted`},` Total `,-1),d[7]||=v(`th`,{class:`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-right text-xs font-medium text-muted`},` Share `,-1)])]),v(`tbody`,null,[(p(!0),y(_,null,b(w.value,e=>(p(),y(`tr`,{key:e.key,class:s([`by-row`,k(e)?`is-me`:``])},[v(`td`,{class:`border-b border-muted px-2.5 py-1.5`,title:e.key},[v(`span`,U,i(re(e)),1),ie(e)?(p(),y(`span`,de,i(ie(e)),1)):f(``,!0),k(e)?(p(),y(`span`,fe,`me`)):f(``,!0),e.unpricedTokens>0?(p(),y(`span`,{key:2,class:`ml-1.5 text-xs text-warn`,title:`${e.unpricedTokens} tokens ran under a model with no price`},`unpriced tokens`,8,W)):f(``,!0)],8,ue),v(`td`,G,i(te(e)),1),v(`td`,K,i(m(D)(e.llmUsd)),1),S.value?(p(),y(`td`,q,i(m(D)(e.cloudUsd)),1)):f(``,!0),v(`td`,J,i(m(D)(e.totalUsd)),1),v(`td`,Y,i(T.value>0?Math.round(e.totalUsd/T.value*100):0)+`% `,1)],2))),128)),w.value.length===0?(p(),y(`tr`,X,[v(`td`,{class:`empty px-2.5 py-3 text-sm text-muted`,colspan:j.value},i(e.report.rows.length===0?`no runs in this range`:`no ${n[h.value].toLowerCase()} matches`),9,Z)])):f(``,!0)]),w.value.length>0&&w.value.length<e.report.rows.length?(p(),y(`tfoot`,pe,[v(`tr`,null,[v(`td`,{class:`px-2.5 py-1.5 text-xs text-muted`,colspan:j.value-2},`shown`,8,Q),v(`td`,me,i(m(D)(E.value)),1),v(`td`,he,i(T.value>0?Math.round(E.value/T.value*100):0)+`% `,1)])])):f(``,!0)])]),v(`p`,ge,[e.report.reconciliation.comparedDays>0?(p(),y(_,{key:0},[r(` LLM attributed `+i(m(D)(e.report.reconciliation.attributedLlmUsd))+` of `+i(m(D)(e.report.reconciliation.workspaceLlmUsd))+` on the workspace over `+i(A(e.report.reconciliation.comparedDays))+` · `,1),e.report.reconciliation.unattributedLlmUsd>=0?(p(),y(_,{key:0},[r(i(m(D)(e.report.reconciliation.unattributedLlmUsd))+` unattributed (router, review abridges, runs without a record, list vs invoice) `,1)],64)):(p(),y(_,{key:1},[r(i(m(D)(-e.report.reconciliation.unattributedLlmUsd))+` more attributed than the workspace figure (list vs invoice, or spend billed outside this workspace on a compared day) `,1)],64))],64)):(p(),y(_,{key:1},[r(`no day in range has a workspace LLM figure to compare against`)],64)),e.report.reconciliation.uncomparedDays>0?(p(),y(_,{key:2},[r(` · `+i(A(e.report.reconciliation.uncomparedDays))+` with `+i(m(D)(e.report.reconciliation.uncomparedLlmUsd))+` of tokens from runs but no workspace figure (billed outside this workspace) not compared`,1)],64)):f(``,!0),S.value?(p(),y(_,{key:3},[r(` · cloud allocated `+i(m(D)(e.report.reconciliation.cloudAllocatedUsd)),1),e.report.reconciliation.cloudUnallocatedUsd>0?(p(),y(_,{key:0},[r(` · `+i(m(D)(e.report.reconciliation.cloudUnallocatedUsd))+` on days with no runs`,1)],64)):f(``,!0)],64)):f(``,!0)]),v(`p`,_e,[h.value===`model`?(p(),y(_,{key:0},[r(` A model's LLM is the runs' tokens on it, priced through the price table (the configured rates over Anthropic list; cache writes at the 5-minute rate); a run that spent on two models counts under both, and cloud is not split by model — a container runs a run, not a model. `)],64)):(p(),y(_,{key:1},[r(` A `+i(n[h.value].toLowerCase())+`'s LLM is its runs' tokens priced through the price table (the configured rates over Anthropic list; cache writes at the 5-minute rate); a child run bills to whoever started its parent, in the child's own thread and agent. Cloud is each day's Cloudflare spend split by share of run wall-clock — an allocation, not a meter. `,1)],64))])],8,M))}}),ye={class:`mb-4 flex flex-wrap items-center gap-x-4 gap-y-2`},be={class:`flex items-center gap-1`,"aria-label":`Range`},xe={key:0,class:`rounded-md bg-accented px-2.5 py-1 font-mono text-xs font-medium tabular-nums text-highlighted`,"aria-current":`page`},Se={key:0,class:`flex items-center gap-1`,"aria-label":`Cost groups`},Ce={key:0,class:`rounded-md bg-accented px-2.5 py-1 text-xs font-medium text-highlighted`,"aria-current":`page`},we={class:`font-mono text-sm tabular-nums text-muted`},Te={key:1,class:`flex basis-full flex-wrap items-center gap-x-3 gap-y-1`},Ee={class:`font-mono text-xs tabular-nums text-dimmed`,"data-snapshot-status":``},De=[`disabled`],Oe={key:1,class:`text-xs text-error`,role:`status`,"data-snapshot-error":``},ke={class:`mb-5 grid grid-cols-[repeat(auto-fit,minmax(190px,1fr))] gap-3`},Ae={key:0,class:`grid gap-0.5 rounded-lg border border-default bg-elevated px-4 py-3.5`},je={class:`font-mono text-2xl font-medium tabular-nums`},Me={class:`text-xs text-muted`},Ne={key:1,class:`grid gap-0.5 rounded-lg border border-default bg-elevated px-4 py-3.5`},Pe={class:`font-mono text-2xl font-medium tabular-nums`},Fe={class:`text-xs text-muted`},Ie={class:`grid gap-0.5 rounded-lg border border-default bg-elevated px-4 py-3.5`},Le={class:`font-mono text-2xl font-medium tabular-nums`},Re={class:`text-xs text-muted`},ze={class:`grid gap-0.5 rounded-lg border border-default bg-elevated px-4 py-3.5`},Be={class:`font-mono text-2xl font-medium tabular-nums`},Ve={class:`text-xs text-muted`},He={class:`grid gap-0.5 rounded-lg border border-default bg-elevated px-4 py-3.5`},Ue={class:`font-mono text-2xl font-medium tabular-nums`},We={class:`text-xs text-muted`},Ge={class:`grid gap-0.5 rounded-lg border border-default bg-elevated px-4 py-3.5`},Ke={class:`font-mono text-2xl font-medium tabular-nums`},qe={class:`text-xs text-muted`},Je=[`href`,`title`],Ye=[`href`],Xe={class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},Ze={class:`flex flex-wrap items-baseline justify-between gap-x-4 gap-y-2`},Qe={class:`legend flex flex-wrap gap-x-4 gap-y-1.5 text-xs text-muted`},$e=[`href`,`title`],et={key:1,class:`text-xs text-warn`},tt={key:2,class:`text-xs text-muted`},nt={class:`mb-3 flex flex-wrap items-center gap-1 border-b border-default`,"aria-label":`View`},rt={key:0,class:`-mb-px border-b-2 border-primary px-3 py-1.5 text-sm font-medium text-highlighted`,"aria-current":`page`},it={key:0,class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},at={class:`text-[0.9375rem] font-medium`},ot={class:`text-sm text-muted`},st={key:1,class:`text-sm text-warn`},ct={class:`text-xs text-muted`},lt={class:`rounded bg-accented px-1 py-0.5`},ut={key:1,class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},dt={class:`w-full border-collapse font-mono text-[0.8125rem] tabular-nums`},ft={class:`px-2.5 py-1.5`},pt=[`href`],mt={class:`px-2.5 py-1.5 text-right`},ht={class:`px-2.5 py-1.5 text-right`},gt={class:`w-2/5 px-2.5 py-1.5`},_t={key:2,class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},vt={open:``},yt={class:`mt-2.5 overflow-x-auto`},bt={class:`data w-full min-w-[38rem] border-collapse whitespace-nowrap font-mono text-[0.8125rem] tabular-nums`},xt=[`title`],St={key:0,class:`text-xs text-dimmed`},Ct={key:1,class:`text-xs text-dimmed`},wt={class:`border-b border-muted px-2.5 py-1.5 text-right font-medium`},Tt={class:`text-xs text-muted`},Et={class:`rounded bg-accented px-1 py-0.5`},Dt={key:3,class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},Ot=[`data-biller`],kt={class:`text-sm`},At={key:1,class:`text-muted`},jt={key:2,class:`text-muted`},Mt={key:0,class:`overflow-x-auto`},Nt={class:`data w-full border-collapse whitespace-nowrap font-mono text-[0.8125rem] tabular-nums`},Pt={key:0,class:`border-b border-muted px-2.5 py-1 text-right text-xs font-medium text-muted`},Ft={key:1,class:`border-b border-muted px-2.5 py-1 text-right text-xs font-medium text-muted`},It=[`title`],Lt={key:0,class:`border-b border-muted px-2.5 py-1 text-right`},Rt={class:`border-b border-muted px-2.5 py-1 text-right`},zt={class:`border-b border-muted px-2.5 py-1 text-right`},Bt={class:`border-b border-muted px-2.5 py-1 text-right`},Vt={key:1,class:`border-b border-muted px-2.5 py-1 text-right`},Ht={class:`border-t border-default pt-3.5 text-xs text-dimmed`},Ut={class:`mt-2 grid gap-1.5`},Wt=[`href`],Gt={key:2},Kt=[`href`],qt={key:2},Jt=[`href`],Yt=[`href`],Xt={class:`mb-4 flex flex-wrap items-center gap-x-4 gap-y-2`},Zt={key:0,class:`flex items-center gap-1`,"aria-label":`Cost groups`},Qt={key:0,class:`rounded-md bg-accented px-2.5 py-1 text-xs font-medium text-highlighted`,"aria-current":`page`},$t={class:`mb-5 grid gap-2 rounded-lg border border-default bg-elevated px-5 py-4`},en={class:`flex flex-wrap items-center gap-x-3 gap-y-1`},tn={class:`font-mono text-xs tabular-nums text-muted`,"data-snapshot-status":``},nn=[`disabled`],rn={key:1,class:`text-xs text-error`,role:`status`,"data-snapshot-error":``},an=t({__name:`CostsPage`,setup(t){let o=ee(`costs`),l=x(o?.report??null),u=d(()=>o?.groups??[]),O=d(()=>o?.group??l.value?.group??``),M=x(o?.snapshot??null),ce=se(void 0,6e4),N=d(()=>M.value?re(M.value,ce.value):``),P=d(()=>o?.view??`daily`),F=x(o&&o.view!==`daily`?o.by??null:null),I=[{view:`daily`,tab:`Daily`,subtitle:``},{view:`users`,tab:`By user`,subtitle:`Who started the runs · LLM from their tokens through the price table · cloud allocated by wall-clock`},{view:`threads`,tab:`By thread`,subtitle:`The thread each run ran in · LLM from its tokens through the price table · cloud allocated by wall-clock`},{view:`channels`,tab:`By channel`,subtitle:`The channel each run ran in · LLM from its tokens through the price table · cloud allocated by wall-clock`},{view:`agents`,tab:`By agent`,subtitle:`The agent each run ran on · LLM from its tokens through the price table · cloud allocated by wall-clock`},{view:`models`,tab:`By model`,subtitle:`The model each turn ran on · LLM from its tokens through the price table · cloud is not split by model`}],L=d(()=>I.find(e=>e.view===P.value)??I[0]),R=d(()=>o?.canSnapshot===!0),le=d(()=>typeof window>`u`?null:new URLSearchParams(window.location.search).get(`days`)),z=e=>`/costs/${O.value}${e}${le.value?`?days=${le.value}`:``}`,B=o?.snapshot?.snapshot?.takenAt??null,V=B,H=null;async function ue(){try{let[e,t]=await Promise.all([fetch(z(`.json`),{credentials:`same-origin`}),P.value===`daily`?Promise.resolve(null):fetch(z(`/${P.value}.json`),{credentials:`same-origin`})]);return e.ok?(l.value=await e.json(),t?.ok&&(F.value=await t.json()),!0):!1}catch{return!1}}function U(){if(H||V===null||V===B)return;let e=V;H=ue().then(t=>{t&&(B=e)}).finally(()=>{H=null,V!==e&&U()})}function de(e){M.value=e;let t=e.snapshot?.takenAt??null;t&&(V=t,U())}let fe=ae(),W=null;h(()=>{O.value&&(W=fe(`/costs/${O.value}?stream=1`),W.onmessage=e=>{let t=j(e.data);t&&de(t)})}),g(()=>W?.close());let G=x(!1),K=x(``);async function q(){G.value=!0,K.value=``;let e=await oe(fetch,`costs.snapshot`,{});e.ok||(K.value=e.failure.message),G.value=!1}function J(e,t,n){let r=[`days=${t}`];return n!==`daily`&&r.push(`view=${n}`),`/costs/${e}?${r.join(`&`)}`}let Y=d(()=>l.value?T(l.value):[]),X=d(()=>l.value?ie(l.value,Y.value):null),Z=d(()=>l.value?k(l.value):null),pe=d(()=>l.value?w(l.value):[]),Q=d(()=>l.value?te(l.value):null),me=d(()=>l.value?ne(l.value):``);function he(e){let t=Q.value;if(t){if(/^(Memory|vCPU|Disk)/.test(e))return t.containers;if(e.startsWith(`Durable Object`))return t.durableObjects;if(e.startsWith(`Workers`))return t.workers;if(e.startsWith(`R2`))return t.r2;if(e.startsWith(`Workflow`))return t.workflows}}function ge(e){let t=Q.value;if(t)return e===`LLM (Anthropic)`?t.anthropic:e===`Durable Objects`?t.durableObjects:e===`Workers · storage · R2`?t.workers:t.containers}let _e=d(()=>{let e=l.value,t=Z.value;if(!e||!t)return``;let n=t.projection,r=`cloud ${D(n.cloudRate)}/day`,i=n.cloudBasis===`today`?`cloud from today so far`:`cloud from the last 7 full days`;if(!e.llmAvailable)return`${r} × 30.4 · ${i} · before plan fees and included allowances`;let a=`LLM ${D(n.llmRate)}/day`,o=n.llmBasis===`closed-days`?`LLM from ${n.llmClosedDays} closed day${n.llmClosedDays===1?``:`s`}`:n.llmBasis===`today`?`LLM from today so far`:`no LLM spend in range`;return`${r} + ${a} · × 30.4 · ${n.cloudBasis===`today`&&n.llmBasis===`today`?`both from today so far`:`${i} · ${o}`}`}),an=d(()=>l.value?[...l.value.days].reverse():[]),on=d(()=>(l.value?.billers??[]).map(e=>({...e,days:[...e.days].reverse(),unpricedTokens:e.days.reduce((e,t)=>e+(t.unpricedTokens??0),0)}))),sn=[1,7,30],cn=e=>e===1?`today`:`${e}d`,ln=d(()=>{let e=l.value,t=Z.value;if(!e||!t)return``;if(!e.llmAvailable)return`LLM spend not configured`;let n=[];return t.llm.yesterday!==void 0&&n.push(`yesterday ${D(t.llm.yesterday)}`),t.llm.today&&n.push(`today ${D(t.llm.today.usd)}${t.llm.today.estimated?` (estimate)`:``}`),n.length?n.join(` · `):`in range`});function $(e){let t=new Date(`${e}T00:00:00Z`);return Number.isNaN(t.getTime())?e:`${[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`][t.getUTCMonth()]} ${t.getUTCDate()}`}return(t,o)=>{let d=n(`RouterLink`);return l.value&&Z.value?(p(),S(e,{key:0,title:`${l.value.label} spend`,nav:`costs`},{default:a(()=>[v(`div`,ye,[v(`nav`,be,[(p(),y(_,null,b(sn,e=>(p(),y(_,{key:e},[e===l.value.range.days?(p(),y(`span`,xe,i(cn(e)),1)):(p(),S(d,{key:1,class:`rounded-md px-2.5 py-1 font-mono text-xs tabular-nums text-muted no-underline hover:bg-elevated hover:text-highlighted`,to:J(l.value.group,e,P.value)},{default:a(()=>[r(i(cn(e)),1)]),_:2},1032,[`to`]))],64))),64))]),u.value.length>1?(p(),y(`nav`,Se,[(p(!0),y(_,null,b(u.value,e=>(p(),y(_,{key:e},[e===l.value.group?(p(),y(`span`,Ce,i(e),1)):(p(),S(d,{key:1,class:`rounded-md px-2.5 py-1 text-xs text-muted no-underline hover:bg-elevated hover:text-highlighted`,to:J(e,l.value.range.days,P.value)},{default:a(()=>[r(i(e),1)]),_:2},1032,[`to`]))],64))),128))])):f(``,!0),v(`p`,we,[r(i($(l.value.range.from))+` → `+i($(l.value.range.to))+` · `+i(l.value.range.days)+`d`,1),l.value.range.partialLastDay?(p(),y(_,{key:0},[r(` · today partial`)],64)):f(``,!0)]),N.value?(p(),y(`div`,Te,[v(`p`,Ee,i(N.value),1),R.value?(p(),y(`button`,{key:0,type:`button`,class:`rounded-md border border-default px-2 py-0.5 text-xs text-muted hover:bg-elevated hover:text-highlighted disabled:cursor-not-allowed disabled:opacity-60`,disabled:G.value||M.value?.inFlight!==null,"data-snapshot-now":``,onClick:q},i(M.value?.inFlight?`Taking…`:`Snapshot now`),9,De)):f(``,!0),K.value?(p(),y(`span`,Oe,i(K.value),1)):f(``,!0)])):f(``,!0)]),v(`section`,ke,[Z.value.yesterday?(p(),y(`div`,Ae,[o[0]||=v(`span`,{class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`Yesterday`,-1),v(`span`,je,i(m(D)(Z.value.yesterday.total)),1),v(`span`,Me,i(Z.value.yesterday.date)+` · last full day`,1)])):(p(),y(`div`,Ne,[o[1]||=v(`span`,{class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`Today so far`,-1),v(`span`,Pe,i(Z.value.today?m(D)(Z.value.today.total):`—`),1),v(`span`,Fe,i(Z.value.today?`${Z.value.today.date} · partial day, UTC`:`no day in range`),1)])),v(`div`,Ie,[o[2]||=v(`span`,{class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`7-day average`,-1),v(`span`,Le,i(Z.value.avg7===void 0?`—`:m(D)(Z.value.avg7)),1),v(`span`,Re,i(Z.value.avg7===void 0?`no full day yet in this range`:`per day, full days only`),1)]),v(`div`,ze,[o[3]||=v(`span`,{class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`Projected month`,-1),v(`span`,Be,i(m(D)(Z.value.projection.monthUsd,0)),1),v(`span`,Ve,i(_e.value),1)]),v(`div`,He,[o[4]||=v(`span`,{class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`LLM spend`,-1),v(`span`,Ue,i(l.value.llmAvailable?m(D)(Z.value.llm.range):`—`),1),v(`span`,We,i(ln.value),1)]),v(`div`,Ge,[o[6]||=v(`span`,{class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`Share of account`,-1),v(`span`,Ke,i(Z.value.accountShare)+`%`,1),v(`span`,qe,[r(i(m(D)(l.value.totals.cloudUsd))+` of `+i(m(D)(l.value.account.cloudUsd))+` on `,1),Q.value?(p(),y(`a`,{key:0,class:`text-primary hover:underline`,href:Q.value.account,target:`_blank`,rel:`noopener noreferrer`,title:`Cloudflare account ${l.value.account.id}`},i(me.value),9,Je)):f(``,!0),o[5]||=r(` · Cloudflare spend in range · `,-1),Q.value?(p(),y(`a`,{key:1,class:`text-primary hover:underline`,href:Q.value.billing,target:`_blank`,rel:`noopener noreferrer`},`billing`,8,Ye)):f(``,!0)])])]),v(`section`,Xe,[v(`div`,Ze,[o[7]||=v(`div`,null,[v(`h2`,{class:`text-[0.9375rem] font-medium`},`Daily cost`),v(`p`,{class:`text-sm text-muted`},`Stacked by component · USD list price`)],-1),v(`div`,Qe,[(p(!0),y(_,null,b(Y.value,(e,t)=>(p(),y(`a`,{key:e,class:`inline-flex items-center gap-1.5 no-underline hover:text-highlighted hover:underline`,href:ge(e),target:`_blank`,rel:`noopener noreferrer`,title:`Open where ${e} is billed`},[v(`i`,{class:s([`inline-block size-2.5 rounded-xs`,m(C)[t%m(C).length]])},null,2),r(i(e),1)],8,$e))),128))])]),X.value?(p(),S(A,{key:0,model:X.value,label:`Daily cost, stacked by component`},null,8,[`model`])):f(``,!0),l.value.llmAvailable?l.value.days.some(e=>e.llmEstimated)?(p(),y(`p`,tt,[o[9]||=r(` A day the Anthropic cost report has not closed yet (today, and yesterday until a few hours after midnight UTC) shows its LLM figure as an estimate: the hourly usage report priced at list. The closed days are the cost report itself. `,-1),l.value.days.some(e=>e.llmUnpricedTokens>0)?(p(),y(_,{key:0},[r(` Some tokens ran under a model this page has no price for and are not in the estimate. `)],64)):f(``,!0)])):f(``,!0):(p(),y(`p`,et,[...o[8]||=[r(` LLM spend not configured — set `,-1),v(`code`,null,`ANTHROPIC_ADMIN_KEY`,-1),r(` and the group's `,-1),v(`code`,null,`anthropicWorkspaceId`,-1),r(` to layer it in. `,-1)]]))]),v(`nav`,nt,[(p(),y(_,null,b(I,e=>(p(),y(_,{key:e.view},[e.view===P.value?(p(),y(`span`,rt,i(e.tab),1)):(p(),S(d,{key:1,class:`-mb-px border-b-2 border-transparent px-3 py-1.5 text-sm text-muted no-underline hover:border-muted hover:text-highlighted`,to:J(l.value.group,l.value.range.days,e.view)},{default:a(()=>[r(i(e.tab),1)]),_:2},1032,[`to`]))],64))),64))]),P.value===`daily`?f(``,!0):(p(),y(`section`,it,[v(`div`,null,[v(`h2`,at,`Cost `+i(L.value.tab.toLowerCase()),1),v(`p`,ot,i(L.value.subtitle),1)]),F.value?(p(),S(ve,{key:0,report:F.value},null,8,[`report`])):(p(),y(`p`,st,` The `+i(L.value.tab.toLowerCase())+` report did not load with this page. `,1)),v(`p`,ct,[o[10]||=r(` Machine-readable twin: `,-1),v(`code`,lt,`GET /costs/`+i(l.value.group)+`/`+i(P.value)+`.json`,1),o[11]||=r(` (same Access gate). `,-1)])])),P.value===`daily`?(p(),y(`section`,ut,[o[12]||=v(`div`,null,[v(`h2`,{class:`text-[0.9375rem] font-medium`},`What each cloud dollar buys`)],-1),v(`table`,dt,[v(`tbody`,null,[(p(!0),y(_,null,b(pe.value,e=>(p(),y(`tr`,{key:e.label,class:`border-b border-muted`},[v(`td`,ft,[he(e.label)?(p(),y(`a`,{key:0,class:`no-underline hover:text-highlighted hover:underline`,href:he(e.label),target:`_blank`,rel:`noopener noreferrer`,title:`Open where this is billed on Cloudflare`},i(e.label),9,pt)):(p(),y(_,{key:1},[r(i(e.label),1)],64))]),v(`td`,mt,i(m(D)(e.usd)),1),v(`td`,ht,i(Math.round(e.percent))+`%`,1),v(`td`,gt,[v(`i`,{class:`block h-2.5 rounded-xs bg-primary opacity-75`,style:c({width:`${e.percent.toFixed(1)}%`})},null,4)])]))),128))])])])):f(``,!0),P.value===`daily`?(p(),y(`section`,_t,[v(`details`,vt,[o[15]||=v(`summary`,{class:`cursor-pointer text-sm text-muted`},`Table view — daily cost by component (USD)`,-1),v(`div`,yt,[v(`table`,bt,[v(`thead`,null,[v(`tr`,null,[o[13]||=v(`th`,{class:`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-left text-xs font-medium text-muted`},` Date `,-1),(p(!0),y(_,null,b(Y.value,e=>(p(),y(`th`,{key:e,class:`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-right text-xs font-medium text-muted`},i(e),1))),128)),o[14]||=v(`th`,{class:`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-right text-xs font-medium text-muted`},` Total `,-1)])]),v(`tbody`,null,[(p(!0),y(_,null,b(an.value,e=>(p(),y(`tr`,{key:e.date},[v(`td`,{class:`border-b border-muted px-2.5 py-1.5`,title:e.date},[r(i($(e.date))+` `,1),l.value.range.partialLastDay&&e.date===l.value.range.to?(p(),y(`span`,St,`(partial day`+i(e.llmEstimated?` · LLM estimated`:``)+`)`,1)):e.llmEstimated?(p(),y(`span`,Ct,`(LLM estimated)`)):f(``,!0)],8,xt),(p(!0),y(_,null,b(Y.value,t=>(p(),y(`td`,{key:t,class:`border-b border-muted px-2.5 py-1.5 text-right`},i(m(D)(m(E)(e,t),3)),1))),128)),v(`td`,wt,i(m(D)(e.total,3)),1)]))),128))])])])]),v(`p`,Tt,[o[16]||=r(` Machine-readable twin: `,-1),v(`code`,Et,`GET /costs/`+i(l.value.group)+`.json`,1),o[17]||=r(` (same Access gate). `,-1)])])):f(``,!0),P.value===`daily`&&on.value.length?(p(),y(`section`,Dt,[o[22]||=v(`div`,null,[v(`h2`,{class:`text-[0.9375rem] font-medium`},`Invoice tie-out by biller`),v(`p`,{class:`text-xs text-muted`},[r(` Each biller's own invoice beside the summed `),v(`code`,null,`model.turn`),r(` dollars its runs attributed — an aggregator's fee against the summed fees, its BYOK upstream against the remainder. Attributed is the meter's charged figure — each turn's own `),v(`code`,null,`usd`),r(` (the provider's, the operator's or the registry's price at the time) — never the price table's repricing the dimension tabs show, so the two need not agree. `)])],-1),(p(!0),y(_,null,b(on.value,e=>(p(),y(`div`,{key:e.biller,class:`grid gap-1.5`,"data-biller":e.biller},[v(`p`,kt,[v(`b`,null,i(e.biller),1),e.invoice?(p(),y(_,{key:0},[r(` · invoice `+i(m(D)(e.totals.invoiceUsd,4))+` · attributed `+i(m(D)(e.totals.attributedUsd,4)),1)],64)):(p(),y(`span`,At,` · no invoice — the block names no invoice source`)),e.unpricedTokens>0?(p(),y(`span`,jt,` · `+i(e.unpricedTokens.toLocaleString(`en-US`))+` tokens unpriced — not in the attributed figure`,1)):f(``,!0)]),e.days.length?(p(),y(`div`,Mt,[v(`table`,Nt,[v(`thead`,null,[v(`tr`,null,[o[18]||=v(`th`,{class:`border-b border-muted px-2.5 py-1 text-left text-xs font-medium text-muted`},`Date`,-1),e.invoice?(p(),y(`th`,Pt,` Invoice `)):f(``,!0),o[19]||=v(`th`,{class:`border-b border-muted px-2.5 py-1 text-right text-xs font-medium text-muted`},`Attributed`,-1),o[20]||=v(`th`,{class:`border-b border-muted px-2.5 py-1 text-right text-xs font-medium text-muted`},` Fee (invoice / rows) `,-1),o[21]||=v(`th`,{class:`border-b border-muted px-2.5 py-1 text-right text-xs font-medium text-muted`},` Upstream (invoice / remainder) `,-1),e.unpricedTokens>0?(p(),y(`th`,Ft,` Unpriced tokens `)):f(``,!0)])]),v(`tbody`,null,[(p(!0),y(_,null,b(e.days,t=>(p(),y(`tr`,{key:t.date},[v(`td`,{class:`border-b border-muted px-2.5 py-1`,title:t.date},i($(t.date)),9,It),e.invoice?(p(),y(`td`,Lt,i(t.invoiceUsd===void 0?`—`:m(D)(t.invoiceUsd,4)),1)):f(``,!0),v(`td`,Rt,i(m(D)(t.attributedUsd,4)),1),v(`td`,zt,[t.invoiceFeeUsd!==void 0||t.attributedFeeUsd!==void 0?(p(),y(_,{key:0},[r(i(t.invoiceFeeUsd===void 0?`—`:m(D)(t.invoiceFeeUsd,4))+` / `+i(t.attributedFeeUsd===void 0?`—`:m(D)(t.attributedFeeUsd,4)),1)],64)):(p(),y(_,{key:1},[r(`—`)],64))]),v(`td`,Bt,[t.invoiceByokUsd!==void 0||t.attributedUpstreamUsd!==void 0?(p(),y(_,{key:0},[r(i(t.invoiceByokUsd===void 0?`—`:m(D)(t.invoiceByokUsd,4))+` / `+i(t.attributedUpstreamUsd===void 0?`—`:m(D)(t.attributedUpstreamUsd,4)),1)],64)):(p(),y(_,{key:1},[r(`—`)],64))]),e.unpricedTokens>0?(p(),y(`td`,Vt,i((t.unpricedTokens??0).toLocaleString(`en-US`)),1)):f(``,!0)]))),128))])])])):f(``,!0)],8,Ot))),128))])):f(``,!0),v(`footer`,Ht,[v(`details`,null,[o[30]||=v(`summary`,{class:`cursor-pointer text-muted`},`How these numbers are computed`,-1),v(`div`,Ut,[o[28]||=v(`div`,null,[v(`b`,null,`Snapshot.`),r(` Both billing sources and the run history are read once over the widest range this page offers and kept as a snapshot; every figure here, the JSON twins and the dimension tabs are arithmetic over it, with `),v(`em`,null,`today`),r(` the day it was taken. The line under the range says when that was, how old it is and when the next one is due (`),v(`code`,null,`costs.snapshot.everyHours`),r(`, daily by default); `),v(`code`,null,`costs snapshot`),r(` takes one now. Cloudflare bills vCPU on active use only; memory and disk bill on the provisioned size for every second a container is awake. LLM spend is the Anthropic Admin API cost report for this group's workspace (gross, USD); a day the cost report has not closed is the Admin API usage report, hourly, priced at Anthropic list per model (input, output, cache writes, cache reads) and marked as an estimate. The invoice tie-out's attributed side is different money: the meter's charged figure from each turn's own `),v(`code`,null,`usd`),r(`, never the price table's repricing the dimension tabs show, with the tokens no turn priced counted beside it as unpriced. `)],-1),o[29]||=v(`div`,null,[v(`b`,null,`Method.`),r(` Cloudflare GraphQL Analytics, every meter a Workers deployment is billed on: `),v(`code`,null,`containersUsageAdaptiveGroups`),r(` (cpuTimeSec, allocatedMemory, allocatedDisk per app per UTC day), `),v(`code`,null,`durableObjectsPeriodicGroups`),r(` (billable `),v(`code`,null,`duration`),r(` GB-s and SQLite rows read and written per namespace), `),v(`code`,null,`durableObjectsInvocationsAdaptiveGroups`),r(` (requests per namespace), `),v(`code`,null,`durableObjectsSqlStorageGroups`),r(` (bytes stored), `),v(`code`,null,`workersInvocationsAdaptive`),r(` (requests, CPU time), `),v(`code`,null,`r2StorageAdaptiveGroups`),r(` and `),v(`code`,null,`r2OperationsAdaptiveGroups`),r(` (bytes stored, class A/B operations). Prices: vCPU $0.000020/s, memory $0.0000025/GiB-s, disk $0.00000007/GB-s, DO duration $12.50 per million GB-s, DO requests $0.15/M, SQLite rows $0.001/M read and $1.00/M written, DO storage $0.20/GB-month, Workers $0.30/M requests and $0.02/M CPU-ms, R2 $0.015/GB-month, $4.50/M class A and $0.36/M class B (deletes free). Storage is the day's peak, prorated over a 30.44-day month. Gross list price — plan fees and included allowances are not subtracted; Workers Logs volume has no analytics dataset and is not priced. `)],-1),v(`div`,null,[o[23]||=v(`b`,null,`Scope.`,-1),o[24]||=r(` Attributed to this group: the Workers `,-1),(p(!0),y(_,null,b(l.value.attribution.workers,(e,t)=>(p(),y(_,{key:e},[t>0?(p(),y(_,{key:0},[r(`, `)],64)):f(``,!0),Q.value?(p(),y(`a`,{key:1,class:`font-mono hover:underline`,href:Q.value.worker(e),target:`_blank`,rel:`noopener noreferrer`},i(e),9,Wt)):(p(),y(`code`,Gt,i(e),1))],64))),128)),r(`, every Durable Object namespace they host (`+i(Object.keys(l.value.attribution.durableObjectNamespaces).length)+`), the R2 buckets named after them (`,1),(p(!0),y(_,null,b(Object.keys(l.value.attribution.r2Buckets),(e,t)=>(p(),y(_,{key:e},[t>0?(p(),y(_,{key:0},[r(`, `)],64)):f(``,!0),Q.value?(p(),y(`a`,{key:1,class:`font-mono hover:underline`,href:Q.value.bucket(e),target:`_blank`,rel:`noopener noreferrer`},i(e),9,Kt)):(p(),y(`code`,qt,i(e),1))],64))),128)),Object.keys(l.value.attribution.r2Buckets).length===0?(p(),y(_,{key:0},[r(`none`)],64)):f(``,!0),o[25]||=r(`), and the container apps mapped in `,-1),v(`code`,null,`costs.groups.`+i(l.value.group),1),r(` (`+i(Object.keys(l.value.attribution.containerApps).length)+`). Everything else in the account is priced the same way into the account total, which is what "share of account" divides by. Every figure above links to where it is billed: the `,1),Q.value?(p(),y(`a`,{key:1,class:`hover:underline`,href:Q.value.account,target:`_blank`,rel:`noopener noreferrer`},`Cloudflare dashboard`,8,Jt)):f(``,!0),o[26]||=r(` for the account `,-1),v(`code`,null,i(l.value.account.id),1),r(i(l.value.account.name?` (${l.value.account.name})`:``)+`, and `,1),Q.value?(p(),y(`a`,{key:2,class:`hover:underline`,href:Q.value.anthropic,target:`_blank`,rel:`noopener noreferrer`},`Anthropic's cost page`,8,Yt)):f(``,!0),o[27]||=r(` for the LLM line. `,-1)])])])])]),_:1},8,[`title`])):(p(),S(e,{key:1,title:`${O.value} spend`,nav:`costs`},{default:a(()=>[v(`div`,Xt,[u.value.length>1?(p(),y(`nav`,Zt,[(p(!0),y(_,null,b(u.value,e=>(p(),y(_,{key:e},[e===O.value?(p(),y(`span`,Qt,i(e),1)):(p(),S(d,{key:1,class:`rounded-md px-2.5 py-1 text-xs text-muted no-underline hover:bg-elevated hover:text-highlighted`,to:`/costs/${e}`},{default:a(()=>[r(i(e),1)]),_:2},1032,[`to`]))],64))),128))])):f(``,!0)]),v(`section`,$t,[o[31]||=v(`h2`,{class:`text-sm font-medium text-highlighted`},`Nothing to show yet`,-1),v(`div`,en,[v(`p`,tn,i(N.value),1),R.value?(p(),y(`button`,{key:0,type:`button`,class:`rounded-md border border-default px-2 py-0.5 text-xs text-muted hover:bg-elevated hover:text-highlighted disabled:cursor-not-allowed disabled:opacity-60`,disabled:G.value||M.value?.inFlight!==null,"data-snapshot-now":``,onClick:q},i(M.value?.inFlight?`Taking…`:`Snapshot now`),9,nn)):f(``,!0),K.value?(p(),y(`span`,rn,i(K.value),1)):f(``,!0)]),o[32]||=v(`p`,{class:`text-xs text-dimmed`},[r(` The page prices a stored snapshot of both billing sources, never a live read; the figures appear here the moment the first one lands (this page listens for it), or take one now with `),v(`code`,null,`costs snapshot`),r(`. `)],-1)])]),_:1},8,[`title`]))}}});export{an as default};
@@ -0,0 +1 @@
1
+ import{t as e}from"./AppShell-CCPwPqvc.js";import{An as t,Cr as ee,Dn as n,Fi as r,Jr as i,Mi as a,On as te,_n as o,bn as s,hr as c,ki as l,o as u,sn as d,vn as f,xn as p,xr as m,yn as h}from"./browser-BWnzWwaT.js";import{a as g,c as ne,d as re,i as ie,l as _,n as ae,o as v,r as y,s as b,t as x,u as oe}from"./delivery-CTdOqpVK.js";import{t as se}from"./wallClock-DaewxNMY.js";import"./budgets-CJHiTZmM.js";function S(e,t){return e.truncated&&e.completeFrom!==void 0&&Date.parse(`${t}T00:00:00Z`)<Date.parse(e.completeFrom)}Object.freeze({reviewers:[],agentLogins:[],agentCoauthors:[]}),Object.freeze({default:60,min:5,max:1440});var C={class:`text-xs text-muted`},w={key:1,class:`text-highlighted`},T={class:`mb-4 flex flex-wrap items-center gap-x-4 gap-y-2`},E={key:0,class:`flex items-center gap-1`,"aria-label":`Repositories`},D={key:0,class:`rounded-md bg-accented px-2.5 py-1 text-xs font-medium text-highlighted`,"aria-current":`page`},O={class:`font-mono text-sm tabular-nums text-muted`},k={class:`mb-5 grid gap-3`},A={key:0,class:`text-sm text-muted`},j={class:`grid grid-cols-[repeat(auto-fit,minmax(190px,1fr))] gap-3`},M={class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},N={class:`font-mono text-2xl font-medium tabular-nums`},P={class:`text-xs text-muted`},F={class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},I={class:`overflow-x-auto`},L={class:`weeks w-full min-w-[52rem] border-collapse whitespace-nowrap font-mono text-[0.8125rem] tabular-nums`},R=[`title`],z={key:0,class:`ml-1 text-xs`},B={key:0,class:`text-xs text-muted`},V={class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},ce={key:0,class:`text-sm text-muted`},H={key:1,class:`overflow-x-auto`},U={class:`units w-full min-w-[52rem] border-collapse font-mono text-[0.8125rem] tabular-nums`},W=[`href`],G={key:1,class:`text-dimmed`},le=[`title`],ue=[`href`],de={class:`text-xs text-muted`},fe={class:`rounded bg-accented px-1 py-0.5`},pe={class:`border-t border-default pt-3.5 text-xs text-dimmed`},me={key:0,class:`mb-2 font-mono tabular-nums text-muted`},he={class:`mt-2 grid gap-1.5`},K=`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-xs font-medium text-muted whitespace-nowrap`,q=`border-b border-muted px-2.5 py-1.5`,J=t({__name:`DeliveryPage`,setup(t){let J=u(`delivery`),Y=o(()=>J?.report??null),X=o(()=>J?.repos??[]),ge=o(()=>Y.value?oe(Y.value):[]),Z=o(()=>Y.value?ae(Y.value):void 0),Q=e=>Y.value?S(Y.value,e):!1,$=o(()=>Y.value?.weeks.some(e=>Q(e.week))??!1),_e=[1,2,4,8,13],ve=se(void 0,6e4),ye=typeof window>`u`?``:window.location.search;return(t,o)=>{let u=ee(`RouterLink`);return Y.value?(c(),h(e,{key:0,title:`${Y.value.repo} delivery`,nav:`delivery`},{actions:i(()=>[f(`span`,C,[(c(),p(d,null,m(_e,(e,t)=>(c(),p(d,{key:e},[t>0?(c(),p(d,{key:0},[n(` · `)],64)):s(``,!0),e===Y.value.range.weeks?(c(),p(`b`,w,r(e)+`w`,1)):(c(),h(u,{key:2,class:`text-primary hover:underline`,to:`/delivery/${Y.value.repo}?weeks=${e}`},{default:i(()=>[n(r(e)+`w`,1)]),_:2},1032,[`to`]))],64))),64))])]),default:i(()=>[f(`div`,T,[X.value.length>1?(c(),p(`nav`,E,[(c(!0),p(d,null,m(X.value,e=>(c(),p(d,{key:e},[e===Y.value.repo?(c(),p(`span`,D,r(e),1)):(c(),h(u,{key:1,class:`rounded-md px-2.5 py-1 text-xs text-muted no-underline hover:bg-elevated hover:text-highlighted`,to:`/delivery/${e}`},{default:i(()=>[n(r(e),1)]),_:2},1032,[`to`]))],64))),128))])):s(``,!0),f(`p`,O,r(l(v)(Y.value.range.since))+` → `+r(l(v)(Y.value.range.until))+` · `+r(Y.value.range.weeks)+`w · weeks start Monday, UTC `,1)]),f(`section`,k,[Z.value?(c(),p(`p`,A,r(Z.value),1)):s(``,!0),f(`div`,j,[(c(!0),p(d,null,m(ge.value,e=>(c(),p(`div`,{key:e.label,class:`grid gap-0.5 rounded-lg border border-default bg-elevated px-4 py-3.5`},[f(`span`,M,r(e.label),1),f(`span`,N,r(e.value),1),f(`span`,P,r(e.note),1)]))),128))])]),f(`section`,F,[o[0]||=f(`div`,null,[f(`h2`,{class:`text-[0.9375rem] font-medium`},`By week`),f(`p`,{class:`text-sm text-muted`},`One row per Monday-start week · merged pull requests only`)],-1),f(`div`,I,[f(`table`,L,[f(`thead`,null,[f(`tr`,null,[f(`th`,{class:a([K,`text-left`])},`Week`,2),f(`th`,{class:a([K,`text-right`])},`Merged`,2),f(`th`,{class:a([K,`text-right`])},`Agent-authored`,2),f(`th`,{class:a([K,`text-right`])},`Issue → merge`,2),f(`th`,{class:a([K,`text-right`])},`First-pass CI`,2),f(`th`,{class:a([K,`text-right`])},`Rounds / PR`,2),f(`th`,{class:a([K,`text-right`])},`Findings`,2),f(`th`,{class:a([K,`text-right`])},`No human edit`,2),f(`th`,{class:a([K,`text-right`])},`Agent run min`,2)])]),f(`tbody`,null,[(c(!0),p(d,null,m(Y.value.weeks,e=>(c(),p(`tr`,{key:e.week,class:a(Q(e.week)?`text-dimmed`:``)},[f(`td`,{class:a(q),title:`${e.week} → ${e.until}`},[n(r(l(v)(e.week))+` – `+r(l(v)(e.until))+` `,1),Q(e.week)?(c(),p(`span`,z,`(incomplete)`)):s(``,!0)],8,R),f(`td`,{class:a([q,`text-right font-medium`])},r(e.prsMerged),3),f(`td`,{class:a([q,`text-right`])},r(e.agentAuthoredPrs),3),f(`td`,{class:a([q,`text-right`])},r(l(g)(e.leadTimeHours.median)),3),f(`td`,{class:a([q,`text-right`])},r(l(x)(e)),3),f(`td`,{class:a([q,`text-right`])},r(l(ne)(e.reviewRounds.perPr)),3),f(`td`,{class:a([q,`text-right`])},r(l(y)(e)),3),f(`td`,{class:a([q,`text-right`])},r(l(b)(e.findings.noHumanEditShare)),3),f(`td`,{class:a([q,`text-right`])},r(e.agentRuns.minutes.toFixed(0)),3)],2))),128))])])]),$.value&&Y.value.completeFrom?(c(),p(`p`,B,` Incomplete weeks hold the newest pull requests the read reached — it is complete from `+r(l(_)(Y.value.completeFrom))+` — so their numbers are a floor on the merges, not the week's. `,1)):s(``,!0)]),f(`section`,V,[o[3]||=f(`div`,null,[f(`h2`,{class:`text-[0.9375rem] font-medium`},`By unit`),f(`p`,{class:`text-sm text-muted`},` One row per board issue the pull requests link · the issue's opening starts the clock `)],-1),Y.value.units.length===0?(c(),p(`p`,ce,`Nothing merged in range.`)):(c(),p(`div`,H,[f(`table`,U,[f(`thead`,null,[f(`tr`,null,[f(`th`,{class:a([K,`text-left`])},`Issue`,2),f(`th`,{class:a([K,`text-left`])},`Unit`,2),f(`th`,{class:a([K,`text-left`])},`PRs`,2),f(`th`,{class:a([K,`text-right`])},`Issue → merge`,2),f(`th`,{class:a([K,`text-right`])},`First-pass CI`,2),f(`th`,{class:a([K,`text-right`])},`Rounds`,2),f(`th`,{class:a([K,`text-right`])},`Findings`,2),f(`th`,{class:a([K,`text-right`])},`No human edit`,2)])]),f(`tbody`,null,[(c(!0),p(d,null,m(Y.value.units,e=>(c(),p(`tr`,{key:e.issue??`none`},[f(`td`,{class:a([q,`whitespace-nowrap`])},[e.issue===null?(c(),p(`span`,G,`—`)):(c(),p(`a`,{key:0,class:`text-primary hover:underline`,href:`https://github.com/${Y.value.repo}/issues/${e.issue}`},`#`+r(e.issue),9,W))],2),f(`td`,{class:a([q,`max-w-[28rem] truncate font-sans`]),title:e.title},r(e.title),11,le),f(`td`,{class:a([q,`whitespace-nowrap`])},[(c(!0),p(d,null,m(e.prs,(e,t)=>(c(),p(d,{key:e},[t>0?(c(),p(d,{key:0},[n(`, `)],64)):s(``,!0),f(`a`,{class:`text-primary hover:underline`,href:`https://github.com/${Y.value.repo}/pull/${e}`},r(e),9,ue)],64))),128))],2),f(`td`,{class:a([q,`text-right`])},r(l(g)(e.leadTimeHours.median)),3),f(`td`,{class:a([q,`text-right`])},r(l(x)(e)),3),f(`td`,{class:a([q,`text-right`])},r(e.reviewRounds.verdicts),3),f(`td`,{class:a([q,`text-right`])},r(l(y)(e)),3),f(`td`,{class:a([q,`text-right`])},r(l(b)(e.findings.noHumanEditShare)),3)]))),128))])])])),f(`p`,de,[o[1]||=n(` Machine-readable twin: `,-1),f(`code`,fe,`GET /delivery/`+r(Y.value.repo)+`.json`,1),o[2]||=n(` (same gate). `,-1)])]),f(`footer`,pe,[Y.value.snapshotAt?(c(),p(`p`,me,[n(` As of `+r(l(_)(Y.value.snapshotAt))+`, `+r(l(re)(Y.value.snapshotAt,l(ve)))+` · `,1),te(u,{class:`text-primary hover:underline`,to:`/delivery/${Y.value.repo}${l(ie)(l(ye))}`},{default:i(()=>[...o[4]||=[n(`read GitHub now`,-1)]]),_:1},8,[`to`])])):s(``,!0),f(`details`,null,[o[14]||=f(`summary`,{class:`cursor-pointer text-muted`},`How these numbers are computed`,-1),f(`div`,he,[o[12]||=f(`div`,null,[f(`b`,null,`Snapshot.`),n(` GitHub's record of the merged pull requests (each one's timeline and its branch's workflow runs, the board issue its body links) is read on an interval and kept as a snapshot the page, its JSON twin and `),f(`code`,null,`delivery report`),n(` serve; `),f(`code`,null,`?fresh=1`),n(` reads GitHub now. The run history you may see joins on every load. `)],-1),o[13]||=f(`div`,null,[f(`b`,null,`Issue → merge`),n(` runs from the linked board issue's opening (a closing keyword or a `),f(`code`,null,`board item`),n(` reference in the body) to the merge; a pull request that links no issue counts from its own opening. `),f(`b`,null,`First-pass CI`),n(` is green when every pull-request-triggered workflow run (`),f(`code`,null,`pull_request`),n(`, `),f(`code`,null,`pull_request_target`),n(`) on the first head succeeded at its first attempt — a rerun or a red run fails it; a head with no such run is not counted. `),f(`b`,null,`Review rounds`),n(` are the review agent's verdicts; a `),f(`i`,null,`fix round`),n(` is a verdict that followed a push. `),f(`b`,null,`No human edit`),n(` is the share of the agent's findings on pull requests where every push after the first verdict was an agent's: a bot login, or a commit co-authored by an agent. `),f(`b`,null,`Agent run minutes`),n(` are the finished runs of this repository that named a pull request. `)],-1),f(`div`,null,[o[6]||=f(`b`,null,`Identities.`,-1),o[7]||=n(` Verdicts by `,-1),f(`code`,null,r(Y.value.identities.reviewers.join(`, `)||`(none configured)`),1),o[8]||=n(`; agent logins end in `,-1),o[9]||=f(`code`,null,`[bot]`,-1),Y.value.identities.agentLogins.length?(c(),p(d,{key:0},[o[5]||=n(`, plus `,-1),f(`code`,null,r(Y.value.identities.agentLogins.join(`, `)),1)],64)):s(``,!0),o[10]||=n(`; agent co-authors named `,-1),f(`code`,null,r(Y.value.identities.agentCoauthors.join(`, `)||`(none)`),1),o[11]||=n(`. `,-1)])])])])]),_:1},8,[`title`])):s(``,!0)}}});export{J as default};
@@ -0,0 +1 @@
1
+ import{i as e,r as t,t as n}from"./AppShell-CCPwPqvc.js";import{An as r,Cr as i,Dn as a,Fi as o,Jr as s,Mi as c,Mt as l,Nt as ee,On as u,Pi as d,Qt as f,Sr as p,Ur as m,Xr as te,_i as h,_n as g,_r as ne,ar as re,bn as _,c as ie,hr as v,ki as y,l as ae,lr as oe,nr as b,o as se,pr as ce,sn as x,t as S,vn as C,xn as w,xr as T,y as E,yi as D,yn as O}from"./browser-BWnzWwaT.js";import{t as k}from"./Tooltip-CxiQ7luL.js";import{i as le}from"./PendingTurnRow-BPyJ2f-i.js";import{b as ue,x as de}from"./main-DYwKyLY5.js";import{t as fe}from"./eventSource-Ds6_gjPD.js";import{t as pe}from"./wallClock-DaewxNMY.js";import{r as A}from"./indexFormat-B-pd4r7Y.js";import{K as me,i as he}from"./indexRow-BGjjLnN5.js";import"./format-BldUwl_R.js";import{S as j,_ as ge,a as _e,b as ve,c as M,d as ye,f as be,g as xe,h as N,i as Se,l as Ce,m as P,n as we,o as Te,p as Ee,r as De,s as F,t as Oe,u as ke,v as Ae,x as je,y as Me}from"./SilentTurn-D4MMDjWO.js";import{t as Ne}from"./SlackMark-DjJTK2tD.js";import{T as Pe}from"./sseReplay-BDVyc8HX.js";var I={class:`thread-tip flex max-w-xs flex-col gap-1 text-xs`},Fe={class:`tip-title leading-snug text-highlighted`},L={class:`flex flex-wrap items-center gap-x-1.5 gap-y-0.5 font-mono text-[0.68rem] text-muted`},R={class:`tip-when tabular-nums`},Ie={class:`tip-source inline-flex items-center gap-1`},Le={class:`tip-runs`},Re={key:0,class:`tip-live inline-flex items-center gap-1 text-toned`},z=r({__name:`ThreadTip`,props:{row:{},now:{}},setup(e){let t=e,n=g(()=>j(t.row,t.now));return(t,r)=>(v(),w(`div`,I,[C(`p`,Fe,o(n.value.title),1),C(`p`,L,[C(`span`,R,o(n.value.when),1),r[1]||=C(`span`,{"aria-hidden":`true`},`·`,-1),C(`span`,Ie,[e.row.surface===`slack`?(v(),O(Ne,{key:0})):_(``,!0),a(o(n.value.source),1)]),r[2]||=C(`span`,{"aria-hidden":`true`},`·`,-1),C(`span`,Le,o(n.value.runs),1),n.value.live?(v(),w(`span`,Re,[...r[0]||=[C(`span`,{class:`size-1.5 rounded-full bg-ok`,"aria-hidden":`true`},null,-1),a(`live`,-1)]])):_(``,!0)])]))}}),B={class:`rail flex flex-col gap-1 text-[0.8rem]`,"aria-label":`Recent threads`},V={class:`filter mb-2 flex items-center gap-2 rounded-lg border border-default px-2.5 py-1.5 transition-colors duration-150 ease-out focus-within:border-primary hover:border-accented`},H={key:0,class:`rounded border border-default px-1 font-mono text-[0.65rem] text-dimmed`},ze={key:0,class:`empty px-3 py-1 text-xs text-dimmed`},U={key:1,class:`nomatch px-3 py-1 text-xs text-dimmed`},W={key:0,class:`dot mt-px size-1.5 shrink-0 self-center rounded-full bg-ok motion-safe:animate-pulse`,"aria-label":`a run is in flight`},Be={class:`title min-w-0 flex-1 truncate text-toned group-hover:text-highlighted group-aria-[current=page]:text-highlighted`},Ve={class:`when shrink-0 font-mono text-[0.7rem] tabular-nums text-dimmed`},G={class:`retention px-3 pt-1 text-[0.7rem] leading-relaxed text-dimmed`},K={class:`model px-3 pt-2 text-[0.7rem] leading-relaxed text-dimmed`,"data-testid":`what-is-a-thread`},q=500,He=r({__name:`ConversationRail`,props:{rows:{},current:{},now:{},retention:{}},setup(e,{expose:t}){let n=e,r=D(``),c=D(null),l=g(()=>P(n.rows,r.value));function d(){c.value?.focus(),c.value?.select()}function p(e){e.key===`Escape`&&(r.value=``,c.value?.blur())}return t({focusFilter:d}),(t,n)=>{let d=E,m=i(`RouterLink`),h=k;return v(),w(`nav`,B,[u(m,{class:`new group mb-3 flex items-center gap-2 rounded-xl bg-inverted px-3 py-2 font-medium text-inverted no-underline transition-[transform,opacity] duration-150 ease-out hover:-translate-y-px hover:opacity-90 active:translate-y-0 active:opacity-100`,to:`/threads`,"aria-current":e.current===``?`page`:void 0,"data-testid":`new-thread`},{default:s(()=>[u(d,{name:`i-lucide-plus`,class:`size-4 shrink-0 transition-transform duration-150 ease-out group-hover:rotate-90`,"aria-hidden":`true`}),n[1]||=C(`span`,null,`New thread`,-1),n[2]||=C(`span`,{class:`kbd ml-auto flex gap-0.5 font-mono text-[0.65rem] opacity-70`,"aria-label":`shortcut shift command O`},[C(`kbd`,{class:`rounded border border-current/30 px-1`},`⇧`),C(`kbd`,{class:`rounded border border-current/30 px-1`},`⌘`),C(`kbd`,{class:`rounded border border-current/30 px-1`},`O`)],-1)]),_:1},8,[`aria-current`]),C(`label`,V,[u(d,{name:`i-lucide-search`,class:`size-3.5 shrink-0 text-dimmed`,"aria-hidden":`true`}),te(C(`input`,{ref_key:`filter`,ref:c,"onUpdate:modelValue":n[0]||=e=>r.value=e,class:`min-w-0 flex-1 bg-transparent text-[0.8rem] text-highlighted outline-none placeholder:text-dimmed`,type:`text`,placeholder:`Filter recent`,"aria-label":`Filter recent threads`,autocomplete:`off`,onKeydown:p},null,544),[[f,r.value]]),r.value?_(``,!0):(v(),w(`kbd`,H,`⌘K`))]),n[8]||=C(`p`,{class:`label px-3 pb-1 font-mono text-[0.65rem] font-medium uppercase tracking-wider text-dimmed`},`Recent`,-1),e.rows.length===0?(v(),w(`p`,ze,`Nothing yet. Ask something.`)):l.value.length===0?(v(),w(`p`,U,`Nothing matches "`+o(r.value)+`".`,1)):_(``,!0),u(ee,{name:`sb-rise`,tag:`div`,class:`rows flex flex-col gap-0.5`},{default:s(()=>[(v(!0),w(x,null,T(l.value,t=>(v(),w(`div`,{key:t.id},[u(h,{"delay-duration":q,content:{side:`right`,sideOffset:12,align:`start`},ui:{content:`h-auto max-w-xs px-2.5 py-2`}},{content:s(()=>[u(z,{row:t,now:e.now},null,8,[`row`,`now`])]),default:s(()=>[u(m,{class:`row group relative flex items-baseline gap-2 rounded-lg px-3 py-1.5 no-underline transition-colors duration-150 ease-out hover:bg-(--ui-bg-muted) aria-[current=page]:bg-(--ui-bg-accented)`,to:`/threads/${encodeURIComponent(t.id)}`,"aria-current":t.id===e.current?`page`:void 0,"data-surface":t.surface},{default:s(()=>[n[3]||=C(`span`,{class:`bar absolute left-0 top-1/2 h-4 w-0.5 -translate-y-1/2 rounded-full bg-primary opacity-0 transition-opacity duration-150 ease-out group-aria-[current=page]:opacity-100`,"aria-hidden":`true`},null,-1),t.live?(v(),w(`span`,W)):_(``,!0),C(`span`,Be,o(t.title),1),C(`span`,Ve,o(y(ye)(t.lastAt,e.now)),1)]),_:2},1032,[`to`,`aria-current`,`data-surface`])]),_:2},1024)]))),128))]),_:1}),u(m,{class:`all mt-3 flex items-center gap-1.5 px-3 py-1 text-xs font-medium text-muted no-underline transition-colors duration-150 ease-out hover:text-highlighted`,to:`/runs`,"data-testid":`all-runs`},{default:s(()=>[n[4]||=a(` All runs `,-1),u(d,{name:`i-lucide-arrow-right`,class:`size-3 transition-transform duration-150 ease-out group-hover:translate-x-0.5`,"aria-hidden":`true`})]),_:1}),C(`p`,G,o(e.retention),1),C(`p`,K,[n[6]||=a(` A thread holds the runs its messages start. `,-1),u(m,{class:`text-muted hover:text-highlighted`,to:`/runs`},{default:s(()=>[...n[5]||=[a(`Runs`,-1)]]),_:1}),n[7]||=a(` lists every run across everyone's threads. `,-1)])])}}}),Ue={class:`empty mx-auto flex w-full max-w-2xl flex-col items-center gap-5 px-3 py-6 text-center`},We={class:`flex flex-col gap-1.5`},Ge={class:`greeting sb-stagger text-xl font-medium tracking-tight text-highlighted`,style:{"--sb-i":`1`}},Ke={class:`sb-stagger w-full text-left`,style:{"--sb-i":`3`}},J={key:0,class:`chips flex flex-wrap justify-center gap-2`,"aria-label":`Suggestions`},Y=[`onClick`],qe=r({__name:`EmptyState`,props:{name:{},hour:{},suggestions:{}},emits:[`pick`],setup(e,{emit:n}){let r=n;return(n,i)=>(v(),w(`section`,Ue,[u(t,{draw:``,idle:``,class:`mark-lg sb-stagger text-highlighted`,style:{"font-size":`3.25rem`,"--sb-i":`0`}}),C(`div`,We,[C(`h2`,Ge,o(y(N)(e.hour,e.name)),1),i[0]||=C(`p`,{class:`sub sb-stagger text-[0.875rem] text-muted`,style:{"--sb-i":`2`}},` Ask in plain words. The right agent picks it up, and you watch it work here. `,-1)]),C(`div`,Ke,[p(n.$slots,`default`)]),e.suggestions.length>0?(v(),w(`ul`,J,[(v(!0),w(x,null,T(e.suggestions,(e,t)=>(v(),w(`li`,{key:e,class:`sb-stagger`,style:d({"--sb-i":t+4})},[C(`button`,{type:`button`,class:`chip rounded-full border border-default px-3 py-1 text-[0.8rem] text-toned transition-[color,border-color,background-color,transform] duration-150 ease-out hover:-translate-y-px hover:border-accented hover:bg-(--ui-bg-muted) hover:text-highlighted focus-visible:outline-2 focus-visible:outline-primary active:translate-y-0`,onClick:t=>r(`pick`,e)},o(e),9,Y)],4))),128))])):_(``,!0)]))}});function Je(){return{runs:new Map,connected:!1}}function Ye(e,t){t.type===`upsert`&&t.run?t.run.finished||!t.run.threadKey?e.runs.delete(t.run.id):e.runs.set(t.run.id,{threadKey:t.run.threadKey,startedAt:t.run.startedAt,...t.run.label===void 0?{}:{label:t.run.label},...t.run.channelId===void 0?{}:{channelId:t.run.channelId}}):t.type===`removed`&&t.id&&e.runs.delete(t.id)}function Xe(e){let t=new Map;for(let n of e.runs.values()){let e=t.get(n.threadKey)??[];e.push(n),t.set(n.threadKey,e)}return t}function Ze(e,t){return t.includes(`:`)?t:`${e}:${t}`}function Qe(e){let t=e.indexOf(`:`);return t>0?e.slice(0,t):`unknown`}function $e(e,t,n){if(!t.connected)return[...e];let r=Xe(t),i=new Set,a=e.map(e=>{let t=Ze(n,e.id);i.add(t);let a=r.get(t);if(!a)return e.live?{...e,live:!1}:e;let o=e.live?0:a.length;return{...e,live:!0,runs:e.runs+o,lastAt:Math.max(e.lastAt,...a.map(e=>e.startedAt))}}),o=[];for(let[e,t]of r){if(i.has(e))continue;let r=t.reduce((e,t)=>t.startedAt>e.startedAt?t:e),a=r.label?A(r.label).snippet:void 0;o.push({id:e.startsWith(`${n}:`)?e.slice(n.length+1):e,title:a??r.label??e,excerpt:a??r.label??e,lastAt:r.startedAt,runs:t.length,live:!0,surface:Qe(r.channelId??e)})}return o.sort((e,t)=>t.lastAt-e.lastAt),[...o,...a]}var et={key:0,class:`mx-auto my-12 max-w-xl text-center text-toned`},tt=[`data-rail`],nt={key:0,class:`relative hidden md:block`},rt=[`aria-valuemin`,`aria-valuemax`,`aria-valuenow`],it={class:`thread mx-auto flex min-h-[calc(100vh-8rem)] w-full max-w-3xl flex-col`},at={key:4,class:`inline text-[0.875rem] text-toned`,"data-testid":`inline`},ot={key:2,class:`elsewhere sticky bottom-0 z-10 -mx-3 mt-auto bg-default/85 px-3 py-4 text-center text-[0.8rem] text-toned backdrop-blur sm:-mx-5 sm:px-5`,"data-testid":`elsewhere`},st=[`href`],ct={key:3,class:`composer-dock sticky bottom-0 z-10 -mx-3 mt-auto bg-default/85 px-3 pb-[max(0.75rem,env(safe-area-inset-bottom))] pt-3 backdrop-blur sm:-mx-5 sm:px-5`},X=`(min-width: 48rem)`,Z=r({__name:`HomePage`,setup(t){let r=se(`home`),i=pe(r?.now),f=r?.conversation??``,p=ie(r?.retentionDays??null),te=0,E=e=>`${e}-${++te}`,k=h([]);for(let e of r?.turns??[]){if(`kind`in e){e.kind===`receipt`?k.push({key:E(`s`),kind:`silent`,reason:e.reason,at:e.decidedAt}):k.push({key:E(`w`),kind:`parent`,turn:e});continue}k.push({key:E(`p`),kind:`person`,text:e.request,at:e.receivedAt??e.startedAt,pending:!1});let t=!e.finished&&e.token?{eventsUrl:`/runs/${encodeURIComponent(e.id)}/events?t=${e.token}`,stopUrl:`/runs/${encodeURIComponent(e.id)}/stop?t=${e.token}`,serverNow:r?.now}:null;k.push({key:E(`a`),kind:`assistant`,turn:e,live:t,ended:e.finished})}let A=g(()=>{for(let e=k.length-1;e>=0;e--){let t=k[e];if(t.kind===`assistant`&&t.live&&!t.ended&&t.turn.hosted!==!0)return t}return null}),j=D(null),ye=D(0);ne(e,ye);let N=D(``),P=D(void 0),Ne=g(()=>be(A.value!==null,N.value)),I=D(!1);m(N,()=>{P.value&&N.value===``&&(P.value=void 0)});function Fe(e){N.value=e,L()}async function L(){if(!r||I.value)return;let e=Te(N.value.trim(),r.commands);if(e===``)return;let t=h({key:E(`p`),kind:`person`,text:e,at:i.value,pending:!0});k.push(t),N.value=``,P.value=void 0,I.value=!0,ye.value++;try{let n=await fetch(r.sendUrl,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:JSON.stringify({text:e})}),a=await n.json().catch(()=>({}));if(n.status===202&&typeof a.viewPath==`string`&&typeof a.runId==`string`){let n=xe(a.viewPath);if(!n)throw Error(`the run's view path was not one`);t.pending=!1,S.pathname()===`/threads`&&S.replaceUrl(`/threads/${encodeURIComponent(f)}`),k.push({key:E(`a`),kind:`assistant`,turn:{id:a.runId,request:e,startedAt:i.value,receivedAt:i.value,finished:!1,eventCount:0},live:{eventsUrl:n.eventsUrl,stopUrl:n.stopUrl},ended:!1});return}if(n.ok&&a.offer&&typeof a.offer.line==`string`){t.pending=!1;let e=Ae({line:a.offer.line,...a.offer});N.value=e.command,P.value=e.hint;return}if(n.ok&&typeof a.reply==`string`){t.pending=!1;let e=ke(a.reply);e.kind===`inline`&&k.push({key:E(`i`),kind:`inline`,text:e.text});return}throw Error(a.error??`HTTP ${n.status}`)}catch(e){t.pending=!1,t.failed=`not sent: ${e instanceof Error?e.message:`error`}`}finally{I.value=!1}}function R(){let e=j.value;e&&fetch(`${e}${e.includes(`?`)?`&`:`?`}mode=soft`,{method:`POST`,credentials:`same-origin`})}function Ie(e,t,n){let r=k.filter(e=>e.kind===`person`),i=ge(r.map(e=>({text:e.text,folded:e.folded!==void 0,ref:e})),t);if(!i)return;let a=e.turn.receivedAt??e.turn.startedAt;i.ref.folded=n===void 0?``:`at ${me(Math.max(0,n-a),`clock`)}`}function Le(e){e.ended=!0,j.value=null}let Re=Me({width:S.readPref(F.width),collapsed:S.readPref(F.collapsed)}),z=D(Re.width),B=D(Re.collapsed),V=D(!1),H=D(S.mediaMatches(X)),ze=S.onMediaChange(X,e=>{H.value=e}),U=D(null),W=D(null),Be=g(()=>H.value?B.value?`Show recent threads`:`Hide recent threads`:`Recent threads`);function Ve(){if(H.value=S.mediaMatches(X),H.value){B.value=!B.value,S.writePref(F.collapsed,B.value?`1`:`0`);return}V.value=!0}function G(e,t){z.value=Ce(e),t&&S.writePref(F.width,String(z.value))}let K=null;function q(e){K&&G(K.startWidth+(e.clientX-K.startX),!1)}function Ue(){window.removeEventListener(`pointermove`,q),K&&(K=null,S.writePref(F.width,String(z.value)))}function We(e){e.button===0&&(e.preventDefault(),K={startX:e.clientX,startWidth:z.value},e.currentTarget?.setPointerCapture?.(e.pointerId),window.addEventListener(`pointermove`,q),window.addEventListener(`pointerup`,Ue,{once:!0}))}function Ge(e){if(e.key===`ArrowRight`)G(z.value+M.step,!0);else if(e.key===`ArrowLeft`)G(z.value-M.step,!0);else if(e.key===`Home`)G(M.min,!0);else if(e.key===`End`)G(M.max,!0);else return;e.preventDefault()}re(()=>{window.removeEventListener(`pointermove`,q),window.removeEventListener(`pointerup`,Ue),ze()});function Ke(e){let t=ve(e);if(t){if(e.preventDefault(),t===`newThread`){S.navigate(`/threads`);return}if(U.value){U.value.focusFilter();return}if(B.value&&S.mediaMatches(X)){B.value=!1,S.writePref(F.collapsed,`0`),b().then(()=>U.value?.focusFilter());return}V.value=!0,b().then(()=>W.value?.focusFilter())}}let J=D(null),Y=D(!1);function Xe(){return document.body.scrollHeight-(window.innerHeight+window.scrollY)}m(()=>k.length,()=>{let e=je(Xe());b().then(()=>{e?J.value?.scrollIntoView?.({block:`end`}):Y.value=!0})});function Ze(){je(Xe())&&(Y.value=!1)}function Qe(){J.value?.scrollIntoView?.({block:`end`,behavior:`smooth`}),Y.value=!1}oe(()=>{window.addEventListener(`scroll`,Ze,{passive:!0}),window.addEventListener(`keydown`,Ke),r&&ft()}),ce(()=>{window.removeEventListener(`scroll`,Ze),window.removeEventListener(`keydown`,Ke),Q?.close()});let Z=h(Je()),lt=g(()=>$e(r?.conversations??[],Z,r?.lane??``)),ut=g(()=>{let e=A.value?.turn.id;return Z.runs.size+(e&&!Z.runs.has(e)?1:0)}),dt=fe(),Q=null;function ft(){Q=dt(`/runs?stream=1&mine=1`);let e=!1;Q.onopen=()=>{e&&Z.runs.clear(),e=!0,Z.connected=!0},Q.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}Ye(Z,t)}}let pt=g(()=>{let e=k.find(e=>e.kind===`person`);return e?Ee(e.text):`Switchboard`});m([pt,ut],([e,t])=>{S.setTitle(t>0?`(${t}) ${e}`:e),S.setFavicon(t>0?de:ue)},{immediate:!0});let mt=g(()=>new Date(i.value).getHours()),ht=g(()=>k.length===0),$=r?.elsewhere,gt=$?$.surface===`web`?`This thread is another person's conversation. You can read it here.`:`This thread lives in ${he[$.surface]??$.surface}.`:``;return(e,t)=>{let m=ae,te=le;return v(),O(n,{title:`Threads`,nav:`home`},{leading:s(()=>[u(m,{class:`rail-toggle -ml-1`,size:`xs`,color:`neutral`,variant:`ghost`,icon:H.value&&!B.value?`i-lucide-panel-left-close`:`i-lucide-panel-left`,"aria-label":Be.value,"aria-expanded":H.value?!B.value:void 0,onClick:Ve},null,8,[`icon`,`aria-label`,`aria-expanded`])]),default:s(()=>[y(r)?(v(),w(`div`,{key:1,class:c([`home gap-8 md:grid`,B.value?`md:grid-cols-[minmax(0,1fr)]`:`md:grid-cols-[var(--rail-w)_minmax(0,1fr)]`]),style:d({"--rail-w":`${z.value}px`}),"data-rail":B.value?`hidden`:`shown`},[B.value?_(``,!0):(v(),w(`aside`,nt,[u(He,{ref_key:`rail`,ref:U,class:`sticky top-20`,rows:lt.value,current:y(f),now:y(i),retention:y(p)},null,8,[`rows`,`current`,`now`,`retention`]),C(`div`,{class:`handle group/handle absolute inset-y-0 -right-5 flex w-3 cursor-col-resize touch-none select-none justify-center outline-none`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize the recent threads column`,"aria-valuemin":y(M).min,"aria-valuemax":y(M).max,"aria-valuenow":z.value,tabindex:`0`,"data-testid":`rail-handle`,onPointerdown:We,onKeydown:Ge,onDblclick:t[0]||=e=>G(y(M).default,!0)},[...t[5]||=[C(`span`,{class:`w-px rounded-full bg-(--ui-border-accented) opacity-0 transition-opacity duration-150 ease-out group-hover/handle:opacity-100 group-focus-visible/handle:opacity-100`,"aria-hidden":`true`},null,-1)]],40,rt)])),u(te,{open:V.value,"onUpdate:open":t[1]||=e=>V.value=e,side:`left`,title:`Recent threads`,ui:{content:`max-w-xs`}},{body:s(()=>[u(He,{ref_key:`sheetRail`,ref:W,rows:lt.value,current:y(f),now:y(i),retention:y(p)},null,8,[`rows`,`current`,`now`,`retention`])]),_:1},8,[`open`]),C(`section`,it,[ht.value?(v(),O(qe,{key:0,class:`mb-auto mt-[clamp(1.5rem,14vh,9rem)]`,name:y(r).viewer.name,hour:mt.value,suggestions:y(r).suggestions,onPick:Fe},{default:s(()=>[u(_e,{modelValue:N.value,"onUpdate:modelValue":t[2]||=e=>N.value=e,mode:Ne.value,hint:P.value,commands:y(r).commands,autofocus:``,"sweep-on-mount":``,onSubmit:L,onStop:R},null,8,[`modelValue`,`mode`,`hint`,`commands`])]),_:1},8,[`name`,`hour`,`suggestions`])):(v(),O(ee,{key:1,name:`sb-rise`,"move-class":`sb-move-move`,tag:`ol`,class:`transcript m-0 flex list-none flex-col gap-6 p-0 pb-32 pt-2`},{default:s(()=>[(v(!0),w(x,null,T(k,e=>(v(),w(`li`,{key:e.key},[e.kind===`person`?(v(),O(Se,{key:0,text:e.text,at:e.at,now:y(i),pending:e.pending,folded:e.folded,failed:e.failed},null,8,[`text`,`at`,`now`,`pending`,`folded`,`failed`])):e.kind===`assistant`?(v(),O(De,{key:1,turn:e.turn,live:e.live,now:y(i),onInput:(t,n)=>Ie(e,t,n),onEnded:t=>Le(e),onStop:t[3]||=e=>j.value=e},null,8,[`turn`,`live`,`now`,`onInput`,`onEnded`])):e.kind===`silent`?(v(),O(Oe,{key:2,reason:e.reason,"decided-at":e.at,now:y(i)},null,8,[`reason`,`decided-at`,`now`])):e.kind===`parent`?(v(),O(we,{key:3,turn:e.turn,now:y(i)},null,8,[`turn`,`now`])):(v(),w(`div`,at,[u(Pe,{text:e.text},null,8,[`text`])]))]))),128))]),_:1})),C(`div`,{ref_key:`end`,ref:J,class:`end`,"aria-hidden":`true`},null,512),!ht.value&&y($)?(v(),w(`p`,ot,[a(o(y(gt))+` `,1),y($).url?(v(),w(`a`,{key:0,href:y($).url,target:`_blank`,rel:`noopener`,class:`text-highlighted`},`Reply there ↗`,8,st)):y($).surface===`web`?_(``,!0):(v(),w(x,{key:1},[a(`Reply there.`)],64))])):ht.value?_(``,!0):(v(),w(`div`,ct,[u(l,{name:`sb-rise`},{default:s(()=>[Y.value?(v(),w(`button`,{key:0,type:`button`,class:`new-pill absolute -top-9 left-1/2 -translate-x-1/2 rounded-full border border-default bg-(--ui-bg-elevated) px-3 py-1 font-mono text-[0.7rem] text-toned shadow-sm hover:text-highlighted`,onClick:Qe},` ↓ new `)):_(``,!0)]),_:1}),u(_e,{modelValue:N.value,"onUpdate:modelValue":t[4]||=e=>N.value=e,mode:Ne.value,hint:P.value,commands:y(r).commands,autofocus:``,onSubmit:L,onStop:R},null,8,[`modelValue`,`mode`,`hint`,`commands`])]))])],14,tt)):(v(),w(`div`,et,`This page needs its seed.`))]),_:1})}}});export{Z as default};
@@ -0,0 +1 @@
1
+ import{C as e,F as t,L as n,M as r,P as i,d as a,f as o,k as s,u as c}from"./AppShell-CCPwPqvc.js";import{$ as l,An as u,Bn as d,Dn as f,E as p,Ei as m,Fi as h,I as g,Ir as ee,J as te,Jr as _,K as v,Mi as y,Ni as ne,On as b,Pr as x,Q as re,Rr as ie,S,Sr as C,Ti as w,Ur as T,X as E,Y as ae,Z as D,_ as oe,_n as O,b as se,bn as k,bt as ce,en as A,er as j,g as le,h as ue,hr as M,it as de,ki as N,l as fe,lr as pe,lt as me,m as he,mi as ge,mt as _e,nr as P,nt as F,p as ve,rt as ye,sn as I,tn as L,tr as R,tt as z,v as be,vn as B,w as xe,wi as Se,x as Ce,xn as V,xr as H,xt as we,y as U,yi as Te,yn as W,z as G,zr as Ee}from"./browser-BWnzWwaT.js";var[K,De]=v(`TagsInputRoot`),Oe=u({__name:`TagsInputRoot`,props:{modelValue:{type:[Array,null],required:!1},defaultValue:{type:Array,required:!1,default:()=>[]},addOnPaste:{type:Boolean,required:!1},addOnTab:{type:Boolean,required:!1},addOnBlur:{type:Boolean,required:!1},duplicate:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},delimiter:{type:null,required:!1,default:`,`},dir:{type:String,required:!1},max:{type:Number,required:!1,default:0},id:{type:String,required:!1},convertValue:{type:Function,required:!1},displayValue:{type:Function,required:!1,default:e=>e.toString()},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`,`invalid`,`addTag`,`removeTag`],setup(t,{emit:a}){let o=t,s=a,{addOnPaste:c,disabled:l,delimiter:u,max:d,id:f,dir:h,addOnBlur:ee,addOnTab:te}=m(o),v=i(h),y=_e(o,`modelValue`,s,{defaultValue:o.defaultValue,passive:!0,deep:!0}),{forwardRef:ne,currentElement:x}=G(),{focused:re}=me(x),ie=r(x),{getItems:S,CollectionSlot:w}=p({isProvider:!0}),T=Te(),E=Te(!1),ae=O(()=>Array.isArray(y.value)?[...y.value]:[]);function D(e){if(e!==-1){let t=y.value[e];y.value=y.value.filter((t,n)=>n!==e),s(`removeTag`,t)}}return De({modelValue:y,onAddValue:e=>{let t=[...ae.value],n=t.length>0&&typeof t[0]==`object`,r=t.length>0&&typeof o.defaultValue[0]==`object`;if((n||r)&&typeof o.convertValue!=`function`)throw Error("You must provide a `convertValue` function when using objects as values.");let i=o.convertValue?o.convertValue(e):e;if(t.length>=d.value&&d.value)return s(`invalid`,i),!1;if(o.duplicate)return y.value=[...t,i],s(`addTag`,i),!0;if(t.includes(i))E.value=!0;else return y.value=[...t,i],s(`addTag`,i),!0;return s(`invalid`,i),!1},onRemoveValue:D,onInputKeydown:e=>{if(e.isComposing)return;let t=e.target,r=S().map(e=>e.ref).filter(e=>e.dataset.disabled!==``);if(!r.length)return;let i=r.at(-1);switch(e.key){case`Delete`:case`Backspace`:if(t.selectionStart!==0||t.selectionEnd!==0)break;if(T.value){let t=r.findIndex(e=>e===T.value),n=S().find(e=>e.ref===T.value);D(n?y.value.findIndex(e=>z(e,n.value)):-1),T.value=T.value===i?r.at(t-1):r.at(t+1),e.preventDefault()}else e.key===`Backspace`&&(T.value=i,e.preventDefault());break;case`Home`:case`End`:case`ArrowRight`:case`ArrowLeft`:{let a=e.key===`ArrowRight`&&v.value===`ltr`||e.key===`ArrowLeft`&&v.value===`rtl`,o=!a;if(t.selectionStart!==0||t.selectionEnd!==0)break;if(o&&!T.value)T.value=i,e.preventDefault();else if(a&&i&&T.value===i)T.value=void 0,e.preventDefault();else if(T.value){let t=n(e,T.value,void 0,{itemsArray:r,loop:!1,dir:v.value});t&&(T.value=t),e.preventDefault()}break}case`ArrowUp`:case`ArrowDown`:T.value&&e.preventDefault();break;default:T.value=void 0}},selectedElement:T,isInvalidInput:E,addOnPaste:c,addOnBlur:ee,addOnTab:te,dir:v,disabled:l,delimiter:u,max:d,id:f,displayValue:o.displayValue}),(t,n)=>(M(),W(N(w),null,{default:_(()=>[b(N(g),{ref:N(ne),dir:N(v),as:t.as,"as-child":t.asChild,"data-invalid":E.value?``:void 0,"data-disabled":N(l)?``:void 0,"data-focused":N(re)?``:void 0},{default:_(()=>[C(t.$slots,`default`,{modelValue:N(y)}),N(ie)&&t.name?(M(),W(N(e),{key:0,name:t.name,value:N(y),required:t.required,disabled:N(l)},null,8,[`name`,`value`,`required`,`disabled`])):k(`v-if`,!0)]),_:3},8,[`dir`,`as`,`as-child`,`data-invalid`,`data-disabled`,`data-focused`])]),_:3}))}}),ke=u({__name:`TagsInputInput`,props:{placeholder:{type:String,required:!1},autoFocus:{type:Boolean,required:!1},maxLength:{type:Number,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`input`}},setup(e){let n=e,r=K(),{forwardRef:i,currentElement:a}=G();function o(e){if(r.selectedElement.value=void 0,!r.addOnBlur.value)return;let t=e.target,n=e.relatedTarget,i=t.getAttribute(`aria-controls`);i&&n?.closest(`#${CSS.escape(i)}`)||t.value&&r.onAddValue(t.value)&&(t.value=``)}function s(e){r.addOnTab.value&&d(e)}let{isComposing:c,handleCompositionStart:l,handleCompositionEnd:u}=t();async function d(e){if(c.value||(await P(),e.defaultPrevented))return;let t=e.target;t.value&&(r.onAddValue(t.value)&&(t.value=``),e.preventDefault())}function f(e){if(c.value||(r.isInvalidInput.value=!1,e.data===null))return;let t=r.delimiter.value;if(t===e.data||t instanceof RegExp&&t.test(e.data)){let n=e.target;if(n.value=n.value.replace(t,``),n.value.trim()===``){n.value=``;return}r.onAddValue(n.value)&&(n.value=``)}}function p(e){c.value||r.onInputKeydown(e)}function m(e){if(r.addOnPaste.value){e.preventDefault();let t=e.clipboardData;if(!t)return;let n=t.getData(`text`);r.delimiter.value?n.split(r.delimiter.value).forEach(e=>{r.onAddValue(e)}):r.onAddValue(n)}}return pe(()=>{let e=a.value.nodeName===`INPUT`?a.value:a.value.querySelector(`input`);e&&setTimeout(()=>{n.autoFocus&&e?.focus()},1)}),(e,t)=>(M(),W(N(g),{id:N(r).id?.value,ref:N(i),type:`text`,autocomplete:`off`,autocorrect:`off`,autocapitalize:`off`,as:e.as,"as-child":e.asChild,maxlength:e.maxLength,placeholder:e.placeholder,disabled:N(r).disabled.value,"data-invalid":N(r).isInvalidInput.value?``:void 0,onInput:f,onKeydown:[A(d,[`enter`]),A(s,[`tab`]),p],onBlur:o,onCompositionstart:N(l),onCompositionend:N(u),onPaste:m},{default:_(()=>[C(e.$slots,`default`)]),_:3},8,[`id`,`as`,`as-child`,`maxlength`,`placeholder`,`disabled`,`data-invalid`,`onCompositionstart`,`onCompositionend`]))}}),[Ae,je]=v(`TagsInputItem`),Me=u({__name:`TagsInputItem`,props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{value:n}=m(t),r=K(),{forwardRef:i,currentElement:a}=G(),{CollectionItem:o}=p(),s=O(()=>r.selectedElement.value===a.value),c=O(()=>t.disabled||r.disabled.value),l=je({value:n,isSelected:s,disabled:c,textId:``,displayValue:O(()=>r.displayValue(n.value))});return(e,t)=>(M(),W(N(o),{value:N(n)},{default:_(()=>[b(N(g),{ref:N(i),as:e.as,"as-child":e.asChild,"aria-labelledby":N(l).textId,"aria-current":s.value,"data-disabled":c.value?``:void 0,"data-state":s.value?`active`:`inactive`},{default:_(()=>[C(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-labelledby`,`aria-current`,`data-disabled`,`data-state`])]),_:3},8,[`value`]))}}),Ne=u({__name:`TagsInputItemDelete`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;G();let n=K(),r=Ae(),i=O(()=>r.disabled?.value||n.disabled.value);function a(){if(i.value)return;let e=n.modelValue.value.findIndex(e=>z(e,r.value.value));n.onRemoveValue(e)}return(e,n)=>(M(),W(N(g),R({tabindex:`-1`},t,{"aria-labelledby":N(r).textId,"aria-current":N(r).isSelected.value,"data-state":N(r).isSelected.value?`active`:`inactive`,"data-disabled":i.value?``:void 0,type:e.as===`button`?`button`:void 0,onClick:a}),{default:_(()=>[C(e.$slots,`default`)]),_:3},16,[`aria-labelledby`,`aria-current`,`data-state`,`data-disabled`,`type`]))}}),Pe=u({__name:`TagsInputItemText`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=Ae();return G(),n.textId||=s(void 0,`reka-tags-input-item-text`),(e,r)=>(M(),W(N(g),R(t,{id:N(n).textId}),{default:_(()=>[C(e.$slots,`default`,{},()=>[f(h(N(n).displayValue.value),1)])]),_:3},16,[`id`]))}});function Fe(e,t){if(typeof e!=`object`||!e)return!1;let n=E(e,t);return n!=null&&n!==``}function Ie(e,t){return t?{xs:44,sm:48,md:52,lg:56,xl:60}[e]:{xs:24,sm:28,md:32,lg:36,xl:40}[e]}function Le(e,t,n,r){let i=Ie(t,!0),a=Ie(t,!1);return r?()=>i:n?t=>Fe(e[t],n)?i:a:()=>a}var Re={slots:{root:`relative inline-flex items-center`,base:[`rounded-md`,`transition-colors`],leading:`absolute inset-y-0 start-0 flex items-center`,leadingIcon:`shrink-0 text-dimmed`,leadingAvatar:`shrink-0`,leadingAvatarSize:``,trailing:`group absolute inset-y-0 end-0 flex items-center disabled:cursor-not-allowed disabled:opacity-75 focus:outline-none`,trailingIcon:`shrink-0 text-dimmed`,trailingClear:`p-0`,arrow:`fill-bg stroke-default`,content:`max-h-[min(15rem,var(--reka-combobox-content-available-height,15rem))] w-(--reka-combobox-trigger-width) bg-default shadow-lg rounded-md ring ring-default overflow-hidden data-[state=open]:animate-[scale-in_100ms_var(--ease-out)] data-[state=closed]:animate-[scale-out_100ms_var(--ease-out)] origin-(--reka-combobox-content-transform-origin) pointer-events-auto flex flex-col`,viewport:`relative scroll-py-1 overflow-y-auto flex-1`,group:`p-1 isolate`,empty:`text-center text-muted`,label:`font-semibold text-highlighted`,separator:`-mx-1 my-1 h-px bg-border`,item:[`group relative w-full flex items-start gap-1.5 p-1.5 text-sm select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75 text-default data-highlighted:not-data-disabled:text-highlighted data-highlighted:not-data-disabled:before:bg-elevated/50`,`transition-colors before:transition-colors`],itemLeadingIcon:[`shrink-0 text-dimmed group-data-highlighted:not-group-data-disabled:text-default`,`transition-colors`],itemLeadingAvatar:`shrink-0`,itemLeadingAvatarSize:``,itemLeadingChip:`shrink-0`,itemLeadingChipSize:``,itemTrailing:`ms-auto inline-flex gap-1.5 items-center`,itemTrailingIcon:`shrink-0`,itemWrapper:`flex-1 flex flex-col min-w-0`,itemLabel:`truncate`,itemDescription:`truncate text-muted`,tagsItem:`px-1.5 py-0.5 rounded-sm font-medium inline-flex items-center gap-0.5 ring ring-inset ring-accented bg-elevated text-default data-disabled:cursor-not-allowed data-disabled:opacity-75`,tagsItemText:`truncate`,tagsItemDelete:[`inline-flex items-center rounded-xs text-dimmed hover:text-default hover:bg-accented/75 disabled:pointer-events-none`,`transition-colors`],tagsItemDeleteIcon:`shrink-0`,tagsInput:`flex-1 border-0 bg-transparent placeholder:text-dimmed focus:outline-none disabled:cursor-not-allowed disabled:opacity-75`},variants:{fieldGroup:{horizontal:{root:`group has-focus-visible:z-[1]`,base:`group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none`},vertical:{root:`group has-focus-visible:z-[1]`,base:`group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none`}},size:{xs:{base:`px-2 py-1 text-sm/4 gap-1`,leading:`ps-2`,trailing:`pe-2`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`,trailingIcon:`size-4`,label:`p-1 text-[10px]/3 gap-1`,item:`p-1 text-xs gap-1`,itemLeadingIcon:`size-4`,itemLeadingAvatarSize:`3xs`,itemLeadingChip:`size-4`,itemLeadingChipSize:`sm`,itemTrailingIcon:`size-4`,tagsItem:`text-[10px]/3`,tagsItemDeleteIcon:`size-3`,empty:`p-2 text-xs`},sm:{base:`px-2.5 py-1.5 text-sm/4 gap-1.5`,leading:`ps-2.5`,trailing:`pe-2.5`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`,trailingIcon:`size-4`,label:`p-1.5 text-[10px]/3 gap-1.5`,item:`p-1.5 text-xs gap-1.5`,itemLeadingIcon:`size-4`,itemLeadingAvatarSize:`3xs`,itemLeadingChip:`size-4`,itemLeadingChipSize:`sm`,itemTrailingIcon:`size-4`,tagsItem:`text-[10px]/3`,tagsItemDeleteIcon:`size-3`,empty:`p-2.5 text-xs`},md:{base:`px-2.5 py-1.5 text-base/5 gap-1.5`,leading:`ps-2.5`,trailing:`pe-2.5`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`,trailingIcon:`size-5`,label:`p-1.5 text-xs gap-1.5`,item:`p-1.5 text-sm gap-1.5`,itemLeadingIcon:`size-5`,itemLeadingAvatarSize:`2xs`,itemLeadingChip:`size-5`,itemLeadingChipSize:`md`,itemTrailingIcon:`size-5`,tagsItem:`text-xs`,tagsItemDeleteIcon:`size-3.5`,empty:`p-2.5 text-sm`},lg:{base:`px-3 py-2 text-base/5 gap-2`,leading:`ps-3`,trailing:`pe-3`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`,trailingIcon:`size-5`,label:`p-2 text-xs gap-2`,item:`p-2 text-sm gap-2`,itemLeadingIcon:`size-5`,itemLeadingAvatarSize:`2xs`,itemLeadingChip:`size-5`,itemLeadingChipSize:`md`,itemTrailingIcon:`size-5`,tagsItem:`text-xs`,tagsItemDeleteIcon:`size-3.5`,empty:`p-3 text-sm`},xl:{base:`px-3 py-2 text-base gap-2`,leading:`ps-3`,trailing:`pe-3`,leadingIcon:`size-6`,leadingAvatarSize:`xs`,trailingIcon:`size-6`,label:`p-2 text-sm gap-2`,item:`p-2 text-base gap-2`,itemLeadingIcon:`size-6`,itemLeadingAvatarSize:`xs`,itemLeadingChip:`size-6`,itemLeadingChipSize:`lg`,itemTrailingIcon:`size-6`,tagsItem:`text-sm`,tagsItemDeleteIcon:`size-4`,empty:`p-3 text-base`}},variant:{outline:`text-highlighted bg-default ring ring-inset ring-accented`,soft:`text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50`,subtle:`text-highlighted bg-elevated ring ring-inset ring-accented`,ghost:`text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent`,none:`text-highlighted bg-transparent focus:outline-none`},color:{primary:``,secondary:``,success:``,info:``,warning:``,error:``,neutral:``},leading:{true:``},trailing:{true:``},loading:{true:``},highlight:{true:``},fixed:{false:``},type:{file:`file:me-1.5 file:font-medium file:text-muted file:outline-none`},virtualize:{true:{viewport:`p-1 isolate`},false:{viewport:`divide-y divide-default`}},multiple:{true:{root:`flex-wrap`},false:{base:`w-full border-0 placeholder:text-dimmed disabled:cursor-not-allowed disabled:opacity-75`}}},compoundVariants:[{variant:`soft`,multiple:!0,class:`has-focus:bg-elevated has-focus-visible:outline-3`},{variant:`ghost`,multiple:!0,class:`has-focus:bg-elevated has-focus-visible:outline-3`},{color:`primary`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-primary`},{color:`secondary`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-secondary`},{color:`success`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-success`},{color:`info`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-info`},{color:`warning`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-warning`},{color:`error`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-error`},{color:`neutral`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-inverted`},{color:`primary`,variant:[`outline`,`subtle`],class:`outline-primary/25 focus-visible:outline-3 focus-visible:ring-primary`},{color:`secondary`,variant:[`outline`,`subtle`],class:`outline-secondary/25 focus-visible:outline-3 focus-visible:ring-secondary`},{color:`success`,variant:[`outline`,`subtle`],class:`outline-success/25 focus-visible:outline-3 focus-visible:ring-success`},{color:`info`,variant:[`outline`,`subtle`],class:`outline-info/25 focus-visible:outline-3 focus-visible:ring-info`},{color:`warning`,variant:[`outline`,`subtle`],class:`outline-warning/25 focus-visible:outline-3 focus-visible:ring-warning`},{color:`error`,variant:[`outline`,`subtle`],class:`outline-error/25 focus-visible:outline-3 focus-visible:ring-error`},{color:`primary`,variant:[`soft`,`ghost`],class:`outline-primary/25 focus-visible:outline-3`},{color:`secondary`,variant:[`soft`,`ghost`],class:`outline-secondary/25 focus-visible:outline-3`},{color:`success`,variant:[`soft`,`ghost`],class:`outline-success/25 focus-visible:outline-3`},{color:`info`,variant:[`soft`,`ghost`],class:`outline-info/25 focus-visible:outline-3`},{color:`warning`,variant:[`soft`,`ghost`],class:`outline-warning/25 focus-visible:outline-3`},{color:`error`,variant:[`soft`,`ghost`],class:`outline-error/25 focus-visible:outline-3`},{color:`primary`,highlight:!0,class:`ring ring-inset ring-primary`},{color:`secondary`,highlight:!0,class:`ring ring-inset ring-secondary`},{color:`success`,highlight:!0,class:`ring ring-inset ring-success`},{color:`info`,highlight:!0,class:`ring ring-inset ring-info`},{color:`warning`,highlight:!0,class:`ring ring-inset ring-warning`},{color:`error`,highlight:!0,class:`ring ring-inset ring-error`},{color:`neutral`,variant:[`outline`,`subtle`],class:`outline-inverted/25 focus-visible:outline-3 focus-visible:ring-inverted`},{color:`neutral`,variant:[`soft`,`ghost`],class:`outline-inverted/25 focus-visible:outline-3`},{color:`neutral`,highlight:!0,class:`ring ring-inset ring-inverted`},{leading:!0,size:`xs`,class:`ps-7`},{leading:!0,size:`sm`,class:`ps-8`},{leading:!0,size:`md`,class:`ps-9`},{leading:!0,size:`lg`,class:`ps-10`},{leading:!0,size:`xl`,class:`ps-11`},{trailing:!0,size:`xs`,class:`pe-7`},{trailing:!0,size:`sm`,class:`pe-8`},{trailing:!0,size:`md`,class:`pe-9`},{trailing:!0,size:`lg`,class:`pe-10`},{trailing:!0,size:`xl`,class:`pe-11`},{loading:!0,leading:!0,class:{leadingIcon:`animate-spin`}},{loading:!0,leading:!1,trailing:!0,class:{trailingIcon:`animate-spin`}},{fixed:!1,size:`xs`,class:`md:text-xs`},{fixed:!1,size:`sm`,class:`md:text-xs`},{fixed:!1,size:`md`,class:`md:text-sm`},{fixed:!1,size:`lg`,class:`md:text-sm`}],defaultVariants:{size:`md`,color:`primary`,variant:`outline`}},ze=Object.assign({inheritAttrs:!1},{__name:`InputMenu`,props:j({as:{type:null,required:!1},id:{type:String,required:!1},type:{type:null,required:!1,default:`text`},placeholder:{type:String,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1,default:0},trailingIcon:{type:null,required:!1},selectedIcon:{type:null,required:!1},deleteIcon:{type:null,required:!1},clear:{type:[Boolean,Object],required:!1},clearIcon:{type:null,required:!1},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},virtualize:{type:[Boolean,Object],required:!1,default:!1},valueKey:{type:null,required:!1},labelKey:{type:null,required:!1,default:`label`},descriptionKey:{type:null,required:!1,default:`description`},items:{type:null,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1},modelModifiers:{type:null,required:!1},multiple:{type:Boolean,required:!1},highlight:{type:Boolean,required:!1},fixed:{type:Boolean,required:!1},mode:{type:String,required:!1,default:`combobox`},createItem:{type:[Boolean,String,Object],required:!1},filterFields:{type:Array,required:!1},ignoreFilter:{type:Boolean,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},resetSearchTermOnBlur:{type:Boolean,required:!1,default:!0},resetSearchTermOnSelect:{type:Boolean,required:!1,default:!0},resetModelValueOnClear:{type:Boolean,required:!1,default:!0},highlightOnHover:{type:Boolean,required:!1},openOnClick:{type:Boolean,required:!1},openOnFocus:{type:Boolean,required:!1},by:{type:[String,Function],required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},{searchTerm:{type:String,default:``},searchTermModifiers:{}}),emits:j([`change`,`blur`,`focus`,`create`,`clear`,`highlight`,`remove-tag`,`update:modelValue`,`update:open`],[`update:searchTerm`]),setup(e,{expose:t,emit:n}){let r=e,i=n,s=ie(),u=S(`inputMenu`,r),p=ee(e,`searchTerm`,{type:String,default:``}),{t:m}=te(),g=ye(),{filterGroups:v}=c(),A=O(()=>u.mode===`autocomplete`),j=we(u,`as`,`modelValue`,`defaultValue`,`open`,`defaultOpen`,`required`,`multiple`,`resetSearchTermOnBlur`,`resetSearchTermOnSelect`,`resetModelValueOnClear`,`highlightOnHover`,`openOnClick`,`openOnFocus`,`by`),me=ce(j,`multiple`,`resetSearchTermOnSelect`,`resetModelValueOnClear`,`by`),_e=Ce(O(()=>A.value?me:j),i),G=O(()=>A.value?a:o),K=x(),De=O(()=>u.multiple&&!A.value?K[`data-slot`]??`base`:`base`),Ae=xe(w(()=>u.portal)),je=w(()=>F(u.content,{side:`bottom`,sideOffset:8,collisionPadding:8,position:`popper`})),Fe=w(()=>F(u.arrow,{rounded:!0})),Ie=O(()=>typeof u.clear==`object`?u.clear:{}),ze=w(()=>u.virtualize?F(typeof u.virtualize==`boolean`?{}:u.virtualize,{estimateSize:Le(Y.value,at.value??`md`,u.descriptionKey,!!s[`item-description`])}):!1),{emitFormBlur:Be,emitFormFocus:Ve,emitFormChange:He,emitFormInput:Ue,size:We,color:Ge,id:Ke,name:qe,highlight:Je,disabled:Ye,ariaAttrs:Xe}=ve(r),{orientation:Ze,size:Qe}=ue(r),{isLeading:$e,isTrailing:et,leadingIconName:tt,trailingIconName:nt}=le(O(()=>({icon:u.icon,leading:u.leading,leadingIcon:u.leadingIcon,trailing:u.trailing,trailingIcon:u.trailingIcon??g.ui.icons.chevronDown,loading:u.loading,loadingIcon:u.loadingIcon}))),rt=O(()=>Ge.value??u.color),it=O(()=>Je.value??u.highlight),at=O(()=>Qe.value??We.value??u.size),ot=O(()=>Ye.value??u.disabled),[st,q]=de(),[ct,lt]=de({props:{item:{type:[Object,String,Number,Boolean],required:!0},index:{type:Number,required:!1}}}),J=O(()=>se({extend:Re,...g.ui?.inputMenu||{}})({color:rt.value,variant:u.variant,size:at.value,loading:u.loading,highlight:it.value,fixed:u.fixed,leading:$e.value||!!u.avatar||!!s.leading,trailing:et.value||!!s.trailing,multiple:u.multiple,fieldGroup:Ze.value,virtualize:!!u.virtualize})),ut=O(()=>ft.value.flatMap(e=>e));function dt(e){return D(ut.value,e,{labelKey:u.labelKey,valueKey:u.valueKey,by:u.by})??``}let ft=O(()=>u.items?.length?re(u.items)?u.items:[u.items]:[]),pt=O(()=>{if(u.ignoreFilter||!p.value)return ft.value;let e=Array.isArray(u.filterFields)?u.filterFields:[u.labelKey];return v(ft.value,p.value,{fields:e,isStructural:e=>$(e)&&!!e.type&&[`label`,`separator`].includes(e.type)})}),Y=O(()=>pt.value.flatMap(e=>e)),X=O(()=>{if(!u.createItem||!p.value)return!1;let e=u.valueKey?{[u.valueKey]:p.value}:p.value;return typeof u.createItem==`object`&&u.createItem.when===`always`||u.createItem===`always`?!Y.value.find(t=>ae(t,e,u.by??u.valueKey)):!Y.value.length}),Z=O(()=>typeof u.createItem==`object`?u.createItem.position:`bottom`),Q=Ee(`inputRef`);function mt(){u.autofocus&&Q.value?.$el?.focus()}let ht;pe(()=>{P(()=>{A.value?p.value=String(u.modelValue??u.defaultValue??``):p.value=``}),ht=setTimeout(()=>{mt()},u.autofocusDelay)}),ge(()=>clearTimeout(ht)),T(()=>u.modelValue,e=>{A.value&&(p.value=String(e??``))});function gt(e){if(Se(u.modelValue)===e)return;u.modelModifiers?.trim&&(typeof e==`string`||e==null)&&(e=e?.trim()??null),u.modelModifiers?.number&&(e=l(e)),u.modelModifiers?.nullable&&(e??=null),u.modelModifiers?.optional&&!u.modelModifiers?.nullable&&e!==null&&(e??=void 0);let t=new Event(`change`,{target:{value:e}});i(`change`,t),He(),Ue(),A.value?p.value=String(e??``):u.resetSearchTermOnSelect&&(p.value=``)}function _t(e){A.value||(p.value=e)}function vt(e){i(`blur`,e),Be()}function yt(e){i(`focus`,e),Ve()}let bt=Te(!1),xt;ge(()=>clearTimeout(xt));function St(e){if(bt.value=e,e){let e=new FocusEvent(`focus`);i(`focus`,e),Ve(),clearTimeout(xt)}else{let e=new FocusEvent(`blur`);i(`blur`,e),Be(),!A.value&&u.resetSearchTermOnBlur&&(xt=setTimeout(()=>{p.value=``},100))}}function Ct(e,t){if(u.multiple){let n=t.filter(t=>!z(t,e));i(`update:modelValue`,n),i(`remove-tag`,e),gt(n)}}function wt(e){e.preventDefault(),e.stopPropagation(),i(`create`,p.value)}function Tt(e,t){if($(t)){if(t.disabled){e.preventDefault();return}t.onSelect?.(e)}}function $(e){return typeof e==`object`&&!!e}function Et(e){return u.multiple&&Array.isArray(e)?e.length===0:e==null||e===``}function Dt(){i(`clear`)}let Ot=Ee(`viewportRef`),kt=Ee(`comboboxRootRef`);return T(()=>u.items,async()=>{bt.value&&u.createItem&&(await P(),kt.value?.highlightFirstItem?.())},{flush:`post`}),t({inputRef:w(()=>Q.value?.$el),viewportRef:w(()=>Ot.value)}),(e,t)=>(M(),V(I,null,[b(N(st),null,{default:_(()=>[b(N(G).Item,{"data-slot":`item`,class:y(J.value.item({class:N(u).ui?.item})),value:p.value,onSelect:wt},{default:_(()=>[B(`span`,{"data-slot":`itemLabel`,class:y(J.value.itemLabel({class:N(u).ui?.itemLabel}))},[C(e.$slots,`create-item-label`,{item:p.value},()=>[f(h(N(m)(`inputMenu.create`,{label:p.value})),1)])],2)]),_:3},8,[`class`,`value`])]),_:3}),b(N(ct),null,{default:_(({item:t,index:n})=>[$(t)&&t.type===`label`?(M(),W(N(G).Label,{key:0,"data-slot":`label`,class:y(J.value.label({class:[N(u).ui?.label,t.ui?.label,t.class]}))},{default:_(()=>[f(h(N(E)(t,N(u).labelKey)),1)]),_:2},1032,[`class`])):$(t)&&t.type===`separator`?(M(),W(N(G).Separator,{key:1,"data-slot":`separator`,class:y(J.value.separator({class:[N(u).ui?.separator,t.ui?.separator,t.class]}))},null,8,[`class`])):(M(),W(N(G).Item,{key:2,"data-slot":`item`,class:y(J.value.item({class:[N(u).ui?.item,$(t)&&t.ui?.item,$(t)&&t.class]})),disabled:$(t)&&t.disabled,value:N(u).valueKey&&$(t)?N(E)(t,N(u).valueKey):t,onSelect:e=>Tt(e,t)},{default:_(()=>[C(e.$slots,`item`,{item:t,index:n,ui:J.value},()=>[C(e.$slots,`item-leading`,{item:t,index:n,ui:J.value},()=>[$(t)&&t.icon?(M(),W(U,{key:0,name:t.icon,"data-slot":`itemLeadingIcon`,class:y(J.value.itemLeadingIcon({class:[N(u).ui?.itemLeadingIcon,t.ui?.itemLeadingIcon]}))},null,8,[`name`,`class`])):$(t)&&t.avatar?(M(),W(oe,R({key:1,size:t.ui?.itemLeadingAvatarSize||N(u).ui?.itemLeadingAvatarSize||J.value.itemLeadingAvatarSize()},t.avatar,{"data-slot":`itemLeadingAvatar`,class:J.value.itemLeadingAvatar({class:[N(u).ui?.itemLeadingAvatar,t.ui?.itemLeadingAvatar]})}),null,16,[`size`,`class`])):$(t)&&t.chip?(M(),W(be,R({key:2,size:t.ui?.itemLeadingChipSize||N(u).ui?.itemLeadingChipSize||J.value.itemLeadingChipSize(),inset:``,standalone:``},t.chip,{"data-slot":`itemLeadingChip`,class:J.value.itemLeadingChip({class:[N(u).ui?.itemLeadingChip,t.ui?.itemLeadingChip]})}),null,16,[`size`,`class`])):k(``,!0)]),B(`span`,{"data-slot":`itemWrapper`,class:y(J.value.itemWrapper({class:[N(u).ui?.itemWrapper,$(t)&&t.ui?.itemWrapper]}))},[B(`span`,{"data-slot":`itemLabel`,class:y(J.value.itemLabel({class:[N(u).ui?.itemLabel,$(t)&&t.ui?.itemLabel]}))},[C(e.$slots,`item-label`,{item:t,index:n},()=>[f(h($(t)?N(E)(t,N(u).labelKey):t),1)])],2),$(t)&&(N(E)(t,N(u).descriptionKey)||s[`item-description`])?(M(),V(`span`,{key:0,"data-slot":`itemDescription`,class:y(J.value.itemDescription({class:[N(u).ui?.itemDescription,$(t)&&t.ui?.itemDescription]}))},[C(e.$slots,`item-description`,{item:t,index:n},()=>[f(h(N(E)(t,N(u).descriptionKey)),1)])],2)):k(``,!0)],2),B(`span`,{"data-slot":`itemTrailing`,class:y(J.value.itemTrailing({class:[N(u).ui?.itemTrailing,$(t)&&t.ui?.itemTrailing]}))},[C(e.$slots,`item-trailing`,{item:t,index:n,ui:J.value}),A.value?k(``,!0):(M(),W(N(G).ItemIndicator,{key:0,"as-child":``},{default:_(()=>[b(U,{name:N(u).selectedIcon||N(g).ui.icons.check,"data-slot":`itemTrailingIcon`,class:y(J.value.itemTrailingIcon({class:[N(u).ui?.itemTrailingIcon,$(t)&&t.ui?.itemTrailingIcon]}))},null,8,[`name`,`class`])]),_:2},1024))],2)])]),_:2},1032,[`class`,`disabled`,`value`,`onSelect`]))]),_:3}),b(N(G).Root,R({ref_key:`comboboxRootRef`,ref:kt},N(_e),{name:N(qe),disabled:ot.value,"data-slot":e.$attrs[`data-slot`]??`root`,class:J.value.root({class:[N(u).ui?.root,N(u).class]}),"as-child":!!N(u).multiple&&!A.value,"ignore-filter":``,"onUpdate:modelValue":gt,"onUpdate:open":St}),{default:_(({modelValue:n,open:r})=>[b(N(G).Anchor,{"as-child":!N(u).multiple,"data-slot":De.value,class:y(J.value.base({class:N(u).ui?.base}))},{default:_(()=>[N(u).multiple&&!A.value?(M(),W(N(Oe),{key:0,"model-value":n,disabled:ot.value,required:N(u).required,delimiter:``,"as-child":``,onBlur:vt,onFocus:yt,onRemoveTag:e=>Ct(e,n)},{default:_(({modelValue:n})=>[(M(!0),V(I,null,H(n,(t,n)=>(M(),W(N(Me),{key:n,value:t,"data-slot":`tagsItem`,class:y(J.value.tagsItem({class:[N(u).ui?.tagsItem,$(t)&&t.ui?.tagsItem]}))},{default:_(()=>[b(N(Pe),{"data-slot":`tagsItemText`,class:y(J.value.tagsItemText({class:[N(u).ui?.tagsItemText,$(t)&&t.ui?.tagsItemText]}))},{default:_(()=>[C(e.$slots,`tags-item-text`,{item:t,index:n},()=>[f(h(dt(t)),1)])]),_:2},1032,[`class`]),b(N(Ne),{"data-slot":`tagsItemDelete`,class:y(J.value.tagsItemDelete({class:[N(u).ui?.tagsItemDelete,$(t)&&t.ui?.tagsItemDelete]})),disabled:ot.value},{default:_(()=>[C(e.$slots,`tags-item-delete`,{item:t,index:n,ui:J.value},()=>[b(U,{name:N(u).deleteIcon||N(g).ui.icons.close,"data-slot":`tagsItemDeleteIcon`,class:y(J.value.tagsItemDeleteIcon({class:[N(u).ui?.tagsItemDeleteIcon,$(t)&&t.ui?.tagsItemDeleteIcon]}))},null,8,[`name`,`class`])])]),_:2},1032,[`class`,`disabled`])]),_:2},1032,[`value`,`class`]))),128)),b(N(G).Input,{modelValue:p.value,"onUpdate:modelValue":t[1]||=e=>p.value=e,"as-child":``},{default:_(()=>[b(N(ke),R({id:N(Ke),ref_key:`inputRef`,ref:Q},{...e.$attrs,...N(Xe)},{placeholder:N(u).placeholder,"data-slot":`tagsInput`,class:J.value.tagsInput({class:N(u).ui?.tagsInput}),onChange:t[0]||=L(()=>{},[`stop`])}),null,16,[`id`,`placeholder`,`class`])]),_:1},8,[`modelValue`])]),_:3},8,[`model-value`,`disabled`,`required`,`onRemoveTag`])):(M(),W(N(G).Input,R({key:1,id:N(Ke),ref_key:`inputRef`,ref:Q},{...A.value?{}:{displayValue:dt},...e.$attrs,...N(Xe)},{"data-slot":N(u).multiple?void 0:`base`,type:N(u).type,placeholder:N(u).placeholder,required:N(u).required,onBlur:vt,onFocus:yt,onChange:t[2]||=L(()=>{},[`stop`]),"onUpdate:modelValue":_t}),null,16,[`id`,`data-slot`,`type`,`placeholder`,`required`])),N($e)||N(u).avatar||s.leading?(M(),V(`span`,{key:2,"data-slot":`leading`,class:y(J.value.leading({class:N(u).ui?.leading}))},[C(e.$slots,`leading`,{modelValue:n,open:r,ui:J.value},()=>[N($e)&&N(tt)?(M(),W(U,{key:0,name:N(tt),"data-slot":`leadingIcon`,class:y(J.value.leadingIcon({class:N(u).ui?.leadingIcon}))},null,8,[`name`,`class`])):N(u).avatar?(M(),W(oe,R({key:1,size:N(u).ui?.itemLeadingAvatarSize||J.value.itemLeadingAvatarSize()},N(u).avatar,{"data-slot":`itemLeadingAvatar`,class:J.value.itemLeadingAvatar({class:N(u).ui?.itemLeadingAvatar})}),null,16,[`size`,`class`])):k(``,!0)])],2)):k(``,!0),N(et)||s.trailing||N(u).clear?(M(),W(N(G).Trigger,{key:3,"data-slot":`trailing`,class:y(J.value.trailing({class:N(u).ui?.trailing}))},{default:_(()=>[C(e.$slots,`trailing`,{modelValue:n,open:r,ui:J.value},()=>[N(u).clear&&!Et(n)?(M(),W(N(G).Cancel,{key:0,"as-child":``},{default:_(()=>[b(fe,R({as:`span`,icon:N(u).clearIcon||N(g).ui.icons.close,size:at.value,variant:`link`,color:`neutral`,tabindex:`-1`},Ie.value,{"data-slot":`trailingClear`,class:J.value.trailingClear({class:N(u).ui?.trailingClear}),onClick:L(Dt,[`stop`])}),null,16,[`icon`,`size`,`class`])]),_:1})):N(nt)?(M(),W(U,{key:1,name:N(nt),"data-slot":`trailingIcon`,class:y(J.value.trailingIcon({class:N(u).ui?.trailingIcon}))},null,8,[`name`,`class`])):k(``,!0)])]),_:2},1032,[`class`])):k(``,!0)]),_:2},1032,[`as-child`,`data-slot`,`class`]),b(N(G).Portal,ne(d(N(Ae))),{default:_(()=>[b(N(he),null,{default:_(()=>[b(N(G).Content,R({"data-slot":`content`,class:J.value.content({class:N(u).ui?.content})},je.value,{onFocusOutside:t[3]||=L(()=>{},[`prevent`])}),{default:_(()=>[C(e.$slots,`content-top`),b(N(G).Empty,{"data-slot":`empty`,class:y(J.value.empty({class:N(u).ui?.empty}))},{default:_(()=>[C(e.$slots,`empty`,{searchTerm:p.value},()=>[f(h(p.value?N(m)(`inputMenu.noMatch`,{searchTerm:p.value}):N(m)(`inputMenu.noData`)),1)])]),_:3},8,[`class`]),B(`div`,{ref_key:`viewportRef`,ref:Ot,role:`presentation`,"data-slot":`viewport`,class:y(J.value.viewport({class:N(u).ui?.viewport}))},[N(u).virtualize?(M(),V(I,{key:0},[X.value&&Z.value===`top`?(M(),W(N(q),{key:0})):k(``,!0),b(N(G).Virtualizer,R({options:Y.value,"text-content":e=>$(e)?N(E)(e,N(u).labelKey):String(e)},ze.value),{default:_(({option:e,virtualItem:t})=>[b(N(lt),{item:e,index:t.index},null,8,[`item`,`index`])]),_:1},16,[`options`,`text-content`]),X.value&&Z.value===`bottom`?(M(),W(N(q),{key:1})):k(``,!0)],64)):(M(),V(I,{key:1},[X.value&&Z.value===`top`?(M(),W(N(G).Group,{key:0,"data-slot":`group`,class:y(J.value.group({class:N(u).ui?.group}))},{default:_(()=>[b(N(q))]),_:1},8,[`class`])):k(``,!0),(M(!0),V(I,null,H(pt.value,(e,t)=>(M(),W(N(G).Group,{key:`group-${t}`,"data-slot":`group`,class:y(J.value.group({class:N(u).ui?.group}))},{default:_(()=>[(M(!0),V(I,null,H(e,(e,n)=>(M(),W(N(lt),{key:`group-${t}-${n}`,item:e,index:n},null,8,[`item`,`index`]))),128))]),_:2},1032,[`class`]))),128)),X.value&&Z.value===`bottom`?(M(),W(N(G).Group,{key:1,"data-slot":`group`,class:y(J.value.group({class:N(u).ui?.group}))},{default:_(()=>[b(N(q))]),_:1},8,[`class`])):k(``,!0)],64))],2),C(e.$slots,`content-bottom`),N(u).arrow?(M(),W(N(G).Arrow,R({key:0},Fe.value,{"data-slot":`arrow`,class:J.value.arrow({class:N(u).ui?.arrow})}),null,16,[`class`])):k(``,!0)]),_:3},16,[`class`])]),_:3})]),_:3},16)]),_:3},16,[`name`,`disabled`,`data-slot`,`class`,`as-child`])],64))}});export{ze as t};
@@ -1 +1 @@
1
- import{t as e}from"./AppShell-DPJVhUGP.js";import{An as t,Cn as n,Cr as r,Li as i,Mn as a,Pi as o,Sn as s,Tr as c,Xr as l,_r as u,bn as d,ji as f,kn as p,ln as m,o as h,xn as g,yn as _}from"./browser-CCImen5O.js";import{a as v,h as y,l as b,t as x}from"./CostChart-4TeDdbvJ.js";var S=e=>Math.round(e).toLocaleString(`en-US`);function C(e){let t=(Number.isFinite(e)?e:0)/1e3;return t<120?`${t.toFixed(1)}s`:`${Math.round(t/60)}m`}var w=e=>`${Math.round((Number.isFinite(e)?e:0)*100)}%`;function T(e,t){return`/metrics?days=${e}${t===void 0?``:`&agent=${encodeURIComponent(t)}`}`}function E(e){let t=e.tiles;return[{label:`Runs`,value:S(t.runs),sub:`${e.range.days}d window, UTC days`},{label:`Failed`,value:S(t.failed),sub:`runs that ended failed`},{label:`Failure rate`,value:w(t.failureRate),sub:`${S(t.failed)} of ${S(t.runs)}`},{label:`p50 wall`,value:C(t.p50WallMs),sub:`median run, runs-weighted`},{label:`p95 wall`,value:C(t.p95WallMs),sub:`runs-weighted`},{label:`LLM spend`,value:y(t.usd),sub:`priced at finish`},{label:`Unpriced tokens`,value:S(t.unpricedTokens),sub:`tokens with no price row`},{label:`Turns`,value:S(t.turns),sub:`model turns in range`}]}function D(e){let t=[];for(let n of e)for(let e of Object.keys(n.byStatus))t.includes(e)||t.push(e);return t}var O=960,k=260,A={t:12,r:12,b:30,l:48},j=e=>e<=16?1:Math.ceil(e/16);function M(e,t){let n=O-A.l-A.r,r=k-A.t-A.b,i=Math.max(1,...e.map(e=>e.runs))*1.08,a=n/Math.max(1,e.length),o=Math.min(10,a*.28),s=e=>A.t+r-e/i*r,c=Array.from({length:5},(e,t)=>{let n=i/4*t;return{y:Number(s(n).toFixed(1)),label:S(n)}}),l=[],u=[],d=[];return e.forEach((n,i)=>{let c=0,f=A.l+i*a+o/2,p=a-o,m=t.map(e=>({series:e,usd:n.byStatus[e]??0})).filter(e=>e.usd>0).sort((e,t)=>t.usd-e.usd);u.push({x:Number((A.l+i*a).toFixed(1)),y:A.t,width:Number(a.toFixed(1)),height:r,title:`${n.day} — ${S(n.runs)} runs${m.map(e=>` · ${e.series} ${S(e.usd)}`).join(``)}`,tip:{date:n.day,label:n.day,total:n.runs,partial:!1,rows:m.map(e=>({...e,estimated:!1}))}}),t.forEach((e,t)=>{let r=n.byStatus[e]??0;if(r<=0)return;let i=s(c+r),a=s(c);l.push({seriesIndex:t,x:Number(f.toFixed(1)),y:Number(i.toFixed(1)),width:Number(p.toFixed(1)),height:Number(Math.max(0,a-i-2).toFixed(1))}),c+=r}),i%j(e.length)===0&&d.push({x:Number((f+p/2).toFixed(1)),label:n.day.slice(5)})}),{width:O,height:k,gridLines:c,segments:l,dayHovers:u,dayLabels:d,axisY:Number(s(0).toFixed(1)),marginLeft:A.l,marginRight:A.r}}function N(e,t,n,r=1e-9){let i=O-A.l-A.r,a=k-A.t-A.b,o=t.flatMap(e=>e.values.filter(e=>e!==null)),s=Math.max(r,...o)*1.08,c=i/Math.max(1,e.length),l=e=>A.l+e*c+c/2,u=e=>A.t+a-e/s*a,d=Array.from({length:5},(e,t)=>{let r=s/4*t;return{y:Number(u(r).toFixed(1)),label:n(r)}}),f=e.map((e,t)=>({x:Number(l(t).toFixed(1)),label:e.slice(5),i:t})).filter(({i:t})=>t%j(e.length)===0).map(({x:e,label:t})=>({x:e,label:t})),p=t.map((t,r)=>{let i=[],a=[],o=[];return t.values.forEach((r,s)=>{if(r===null){o.length>=2&&i.push(o.join(` `)),o=[];return}let c=Number(l(s).toFixed(1)),d=Number(u(r).toFixed(1));o.push(`${c},${d}`),a.push({x:c,y:d,title:`${e[s]} — ${t.name} ${n(r)}`})}),o.length>=2&&i.push(o.join(` `)),{name:t.name,seriesIndex:r,segments:i,dots:a}});return{width:O,height:k,gridLines:d,dayLabels:f,axisY:Number(u(0).toFixed(1)),marginLeft:A.l,marginRight:A.r,lines:p}}function P(e){return N(e.map(e=>e.day),[{name:`failure rate`,values:e.map(e=>e.runs>0?(e.byStatus.failed??0)/e.runs:null)}],w,.01)}function ee(e,t,n){let r=e.map(e=>e.day),i=new Map(n.map(e=>[`${e.day}\n${e.agent}`,e.p50WallMs]));return N(r,t.map(e=>({name:e.agent,values:r.map(t=>i.get(`${t}\n${e.agent}`)??null)})),C)}function te(e){return[`Each finished run is one point, bucketed at ${e.bucket} (UTC days).`,`Dollars are priced ${e.pricing}, through the same price table the costs page uses.`,`Each run is counted ${e.completeness}, however many times its record is written.`,`The dataset keeps ${e.retentionDays} days; sampled rows are re-weighted in every figure.`]}var F=[`stroke-[#4478b8] dark:stroke-[#7aa7e0]`,`stroke-[#c8823b] dark:stroke-[#e0a95a]`,`stroke-[#4c8c57] dark:stroke-[#6fae7a]`,`stroke-[#b8963e] dark:stroke-[#d4b45a]`,`stroke-[#b0568c] dark:stroke-[#d489b8]`,`stroke-[#6b7bcc] dark:stroke-[#98a5e6]`,`stroke-[#d05252] dark:stroke-[#e07a74]`,`stroke-[#3e8e96] dark:stroke-[#6fb9c0]`],I=[`fill-[#4478b8] dark:fill-[#7aa7e0]`,`fill-[#c8823b] dark:fill-[#e0a95a]`,`fill-[#4c8c57] dark:fill-[#6fae7a]`,`fill-[#b8963e] dark:fill-[#d4b45a]`,`fill-[#b0568c] dark:fill-[#d489b8]`,`fill-[#6b7bcc] dark:fill-[#98a5e6]`,`fill-[#d05252] dark:fill-[#e07a74]`,`fill-[#3e8e96] dark:fill-[#6fb9c0]`],L={class:`overflow-x-auto`},R=[`viewBox`,`aria-label`],z=[`x1`,`x2`,`y1`,`y2`],B=[`x`,`y`],V=[`points`],H=[`cx`,`cy`],U=[`x`,`y`],W=[`x1`,`x2`,`y1`,`y2`],G=a({__name:`TrendLineChart`,props:{model:{},label:{}},setup(e){return(t,a)=>(u(),n(`div`,L,[(u(),n(`svg`,{class:`block h-auto w-full font-mono`,viewBox:`0 0 ${e.model.width} ${e.model.height}`,role:`img`,"aria-label":e.label},[(u(!0),n(m,null,r(e.model.gridLines,(t,r)=>(u(),n(m,{key:`g${r}`},[d(`line`,{class:`stroke-(--ui-border-muted)`,x1:e.model.marginLeft,x2:e.model.width-e.model.marginRight,y1:t.y,y2:t.y},null,8,z),d(`text`,{class:`fill-(--ui-text-dimmed) text-[11px] tabular-nums`,x:e.model.marginLeft-8,y:t.y+4,"text-anchor":`end`},i(t.label),9,B)],64))),128)),(u(!0),n(m,null,r(e.model.lines,e=>(u(),n(m,{key:e.name},[(u(!0),n(m,null,r(e.segments,(t,r)=>(u(),n(`polyline`,{key:`${e.name}-${r}`,class:o([`trend-line fill-none`,f(F)[e.seriesIndex%f(F).length]]),"stroke-width":`2`,"stroke-linejoin":`round`,"stroke-linecap":`round`,points:t},null,10,V))),128)),(u(!0),n(m,null,r(e.dots,(t,r)=>(u(),n(`circle`,{key:`${e.name}-d${r}`,class:o([`trend-dot`,f(I)[e.seriesIndex%f(I).length]]),cx:t.x,cy:t.y,r:`2.5`},[d(`title`,null,i(t.title),1)],10,H))),128))],64))),128)),(u(!0),n(m,null,r(e.model.dayLabels,(t,r)=>(u(),n(`text`,{key:`d${r}`,class:`fill-(--ui-text-dimmed) text-[11px]`,x:t.x,y:e.model.height-10,"text-anchor":`middle`},i(t.label),9,U))),128)),d(`line`,{class:`stroke-(--ui-border)`,x1:e.model.marginLeft,x2:e.model.width-e.model.marginRight,y1:e.model.axisY,y2:e.model.axisY},null,8,W)],8,R))]))}}),K={class:`mb-4 flex flex-wrap items-center gap-x-4 gap-y-2`},q={class:`flex items-center gap-1`,"aria-label":`Range`},J={key:0,class:`rounded-md bg-accented px-2.5 py-1 font-mono text-xs font-medium tabular-nums text-highlighted`,"aria-current":`page`},Y={key:0,class:`flex items-center gap-1`,"aria-label":`Agent`},X={key:0,class:`rounded-md bg-accented px-2.5 py-1 text-xs font-medium text-highlighted`,"aria-current":`page`},Z={key:0,class:`rounded-md bg-accented px-2.5 py-1 text-xs font-medium text-highlighted`,"aria-current":`page`},Q={class:`font-mono text-sm tabular-nums text-muted`,"data-metrics-range":``},$={class:`mb-5 grid grid-cols-[repeat(auto-fit,minmax(190px,1fr))] gap-3`,"data-metrics-tiles":``},ne={class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},re={class:`font-mono text-2xl font-medium tabular-nums`},ie={class:`text-xs text-muted`},ae={class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},oe={class:`flex flex-wrap items-baseline justify-between gap-x-4 gap-y-2`},se={class:`legend flex flex-wrap gap-x-4 gap-y-1.5 text-xs text-muted`},ce={class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},le={class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},ue={class:`flex flex-wrap items-baseline justify-between gap-x-4 gap-y-2`},de={class:`legend flex flex-wrap gap-x-4 gap-y-1.5 text-xs text-muted`},fe={class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},pe={class:`overflow-x-auto`},me={class:`data w-full min-w-[38rem] border-collapse whitespace-nowrap font-mono text-[0.8125rem] tabular-nums`,"data-metrics-agents":``},he={class:`border-b border-muted px-2.5 py-1.5`},ge={class:`border-b border-muted px-2.5 py-1.5 text-right`},_e={class:`border-b border-muted px-2.5 py-1.5 text-right`},ve={class:`border-b border-muted px-2.5 py-1.5 text-right`},ye={class:`border-b border-muted px-2.5 py-1.5 text-right`},be={class:`border-b border-muted px-2.5 py-1.5 text-right`},xe={class:`border-b border-muted px-2.5 py-1.5 text-right`},Se={class:`border-b border-muted px-2.5 py-1.5 text-right`},Ce={class:`border-b border-muted px-2.5 py-1.5 text-right`},we={key:0},Te={class:`border-t border-default pt-3.5 text-xs text-dimmed`,"data-metrics-footer":``},Ee=a({__name:`MetricsPage`,setup(a){let O=h(`metrics`),k=_(()=>O?.report??null),A=_(()=>k.value?.range??null),j=_(()=>k.value?E(k.value):[]),N=_(()=>k.value?D(k.value.byDay):[]),F=_(()=>k.value?M(k.value.byDay,N.value):null),I=_(()=>k.value?P(k.value.byDay):null),L=_(()=>k.value?ee(k.value.byDay,k.value.byAgent,k.value.p50ByDayAgent):null),R=_(()=>A.value?te(A.value):[]),z=[7,30,90],B=_(()=>k.value?k.value.byAgent.map(e=>e.agent):[]),V=_(()=>A.value?.agent),H=e=>new Date(e).toISOString().slice(0,10);return(a,h)=>{let _=c(`RouterLink`);return k.value&&A.value?(u(),g(e,{key:0,title:`Run metrics`,nav:`metrics`},{default:l(()=>[d(`div`,K,[d(`nav`,q,[(u(),n(m,null,r(z,e=>(u(),n(m,{key:e},[e===A.value.days?(u(),n(`span`,J,i(e)+`d`,1)):(u(),g(_,{key:1,class:`rounded-md px-2.5 py-1 font-mono text-xs tabular-nums text-muted no-underline hover:bg-elevated hover:text-highlighted`,to:f(T)(e,V.value)},{default:l(()=>[p(i(e)+`d`,1)]),_:2},1032,[`to`]))],64))),64))]),B.value.length>0?(u(),n(`nav`,Y,[V.value===void 0?(u(),n(`span`,X,`all agents`)):(u(),g(_,{key:1,class:`rounded-md px-2.5 py-1 text-xs text-muted no-underline hover:bg-elevated hover:text-highlighted`,to:f(T)(A.value.days)},{default:l(()=>[...h[0]||=[p(`all agents`,-1)]]),_:1},8,[`to`])),(u(!0),n(m,null,r(B.value,e=>(u(),n(m,{key:e},[e===V.value?(u(),n(`span`,Z,i(e),1)):(u(),g(_,{key:1,class:`rounded-md px-2.5 py-1 text-xs text-muted no-underline hover:bg-elevated hover:text-highlighted`,to:f(T)(A.value.days,e)},{default:l(()=>[p(i(e),1)]),_:2},1032,[`to`]))],64))),128))])):s(``,!0),d(`p`,Q,i(f(b)(H(A.value.sinceMs)))+` → `+i(f(b)(H(A.value.untilMs-1)))+` · `+i(A.value.days)+`d · dataset `+i(k.value.dataset),1)]),d(`section`,$,[(u(!0),n(m,null,r(j.value,e=>(u(),n(`div`,{key:e.label,class:`grid gap-0.5 rounded-lg border border-default bg-elevated px-4 py-3.5`},[d(`span`,ne,i(e.label),1),d(`span`,re,i(e.value),1),d(`span`,ie,i(e.sub),1)]))),128))]),d(`section`,ae,[d(`div`,oe,[h[1]||=d(`div`,null,[d(`h2`,{class:`text-[0.9375rem] font-medium`},`Runs per day`),d(`p`,{class:`text-sm text-muted`},`Stacked by status · one point per finished run, weighted for sampling`)],-1),d(`div`,se,[(u(!0),n(m,null,r(N.value,(e,t)=>(u(),n(`span`,{key:e,class:`inline-flex items-center gap-1.5`},[d(`i`,{class:o([`inline-block size-2.5 rounded-xs`,f(v)[t%f(v).length]])},null,2),p(i(e),1)]))),128))])]),F.value?(u(),g(x,{key:0,model:F.value,label:`Runs per day, stacked by status`,format:f(S)},null,8,[`model`,`format`])):s(``,!0)]),d(`section`,ce,[h[2]||=d(`div`,null,[d(`h2`,{class:`text-[0.9375rem] font-medium`},`Failure rate per day`),d(`p`,{class:`text-sm text-muted`},`Failed share of the day's runs · a day with no runs draws a gap`)],-1),I.value?(u(),g(G,{key:0,model:I.value,label:`Failure rate per day`},null,8,[`model`])):s(``,!0)]),d(`section`,le,[d(`div`,ue,[h[3]||=d(`div`,null,[d(`h2`,{class:`text-[0.9375rem] font-medium`},`Median wall per day`),d(`p`,{class:`text-sm text-muted`},`p50 wall-clock per agent, weighted for sampling`)],-1),d(`div`,de,[(u(!0),n(m,null,r(L.value?.lines??[],e=>(u(),n(`span`,{key:e.name,class:`inline-flex items-center gap-1.5`},[d(`i`,{class:o([`inline-block size-2.5 rounded-xs`,f(v)[e.seriesIndex%f(v).length]])},null,2),p(i(e.name),1)]))),128))])]),L.value?(u(),g(G,{key:0,model:L.value,label:`Median wall-clock per day per agent`},null,8,[`model`])):s(``,!0)]),d(`section`,fe,[h[6]||=d(`div`,null,[d(`h2`,{class:`text-[0.9375rem] font-medium`},`By agent`),d(`p`,{class:`text-sm text-muted`},`Largest first · the whole range's runs per agent`)],-1),d(`div`,pe,[d(`table`,me,[d(`thead`,null,[d(`tr`,null,[h[4]||=d(`th`,{class:`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-left text-xs font-medium text-muted`},` Agent `,-1),(u(),n(m,null,r([`Runs`,`Failed`,`Failure rate`,`p50 wall`,`p95 wall`,`LLM`,`Unpriced tokens`,`Turns`],e=>d(`th`,{key:e,class:`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-right text-xs font-medium text-muted`},i(e),1)),64))])]),d(`tbody`,null,[(u(!0),n(m,null,r(k.value.byAgent,e=>(u(),n(`tr`,{key:e.agent},[d(`td`,he,[t(_,{class:`no-underline hover:text-highlighted hover:underline`,to:f(T)(A.value.days,e.agent)},{default:l(()=>[p(i(e.agent),1)]),_:2},1032,[`to`])]),d(`td`,ge,i(f(S)(e.runs)),1),d(`td`,_e,i(f(S)(e.failed)),1),d(`td`,ve,i(f(w)(e.runs>0?e.failed/e.runs:0)),1),d(`td`,ye,i(f(C)(e.p50WallMs)),1),d(`td`,be,i(f(C)(e.p95WallMs)),1),d(`td`,xe,i(f(y)(e.usd)),1),d(`td`,Se,i(f(S)(e.unpricedTokens)),1),d(`td`,Ce,i(f(S)(e.turns)),1)]))),128)),k.value.byAgent.length===0?(u(),n(`tr`,we,[...h[5]||=[d(`td`,{class:`px-2.5 py-1.5 text-muted`,colspan:`9`},`No runs in this range.`,-1)]])):s(``,!0)])])]),h[7]||=d(`p`,{class:`text-xs text-muted`},[p(` Machine-readable twin: `),d(`code`,{class:`rounded bg-accented px-1 py-0.5`},`GET /metrics.json`),p(` (same Access gate); the same report is `),d(`code`,{class:`rounded bg-accented px-1 py-0.5`},`metrics trend`),p(` on every command surface. `)],-1)]),d(`footer`,Te,[(u(!0),n(m,null,r(R.value,e=>(u(),n(`p`,{key:e},i(e),1))),128))])]),_:1})):(u(),g(e,{key:1,title:`Run metrics`,nav:`metrics`},{default:l(()=>[...h[8]||=[d(`section`,{class:`mb-5 grid gap-2 rounded-lg border border-default bg-elevated px-5 py-4`},[d(`h2`,{class:`text-sm font-medium text-highlighted`},`Nothing to show`),d(`p`,{class:`text-xs text-dimmed`},`This page did not receive its report; reload to ask again.`)],-1)]]),_:1}))}}});export{Ee as default};
1
+ import{t as e}from"./AppShell-CCPwPqvc.js";import{An as t,Cr as n,Dn as r,Fi as i,Jr as a,Mi as o,On as s,_n as c,bn as l,hr as u,ki as d,o as f,sn as p,vn as m,xn as h,xr as g,yn as _}from"./browser-BWnzWwaT.js";import{a as v,h as y,l as b,t as x}from"./CostChart-Y5BqJKLA.js";var S=e=>Math.round(e).toLocaleString(`en-US`);function C(e){let t=(Number.isFinite(e)?e:0)/1e3;return t<120?`${t.toFixed(1)}s`:`${Math.round(t/60)}m`}var w=e=>`${Math.round((Number.isFinite(e)?e:0)*100)}%`;function T(e,t){return`/metrics?days=${e}${t===void 0?``:`&agent=${encodeURIComponent(t)}`}`}function E(e){let t=e.tiles;return[{label:`Runs`,value:S(t.runs),sub:`${e.range.days}d window, UTC days`},{label:`Failed`,value:S(t.failed),sub:`runs that ended failed`},{label:`Failure rate`,value:w(t.failureRate),sub:`${S(t.failed)} of ${S(t.runs)}`},{label:`p50 wall`,value:C(t.p50WallMs),sub:`median run, runs-weighted`},{label:`p95 wall`,value:C(t.p95WallMs),sub:`runs-weighted`},{label:`LLM spend`,value:y(t.usd),sub:`priced at finish`},{label:`Unpriced tokens`,value:S(t.unpricedTokens),sub:`tokens with no price row`},{label:`Turns`,value:S(t.turns),sub:`model turns in range`}]}function D(e){let t=[];for(let n of e)for(let e of Object.keys(n.byStatus))t.includes(e)||t.push(e);return t}var O=960,k=260,A={t:12,r:12,b:30,l:48},j=e=>e<=16?1:Math.ceil(e/16);function M(e,t){let n=O-A.l-A.r,r=k-A.t-A.b,i=Math.max(1,...e.map(e=>e.runs))*1.08,a=n/Math.max(1,e.length),o=Math.min(10,a*.28),s=e=>A.t+r-e/i*r,c=Array.from({length:5},(e,t)=>{let n=i/4*t;return{y:Number(s(n).toFixed(1)),label:S(n)}}),l=[],u=[],d=[];return e.forEach((n,i)=>{let c=0,f=A.l+i*a+o/2,p=a-o,m=t.map(e=>({series:e,usd:n.byStatus[e]??0})).filter(e=>e.usd>0).sort((e,t)=>t.usd-e.usd);u.push({x:Number((A.l+i*a).toFixed(1)),y:A.t,width:Number(a.toFixed(1)),height:r,title:`${n.day} — ${S(n.runs)} runs${m.map(e=>` · ${e.series} ${S(e.usd)}`).join(``)}`,tip:{date:n.day,label:n.day,total:n.runs,partial:!1,rows:m.map(e=>({...e,estimated:!1}))}}),t.forEach((e,t)=>{let r=n.byStatus[e]??0;if(r<=0)return;let i=s(c+r),a=s(c);l.push({seriesIndex:t,x:Number(f.toFixed(1)),y:Number(i.toFixed(1)),width:Number(p.toFixed(1)),height:Number(Math.max(0,a-i-2).toFixed(1))}),c+=r}),i%j(e.length)===0&&d.push({x:Number((f+p/2).toFixed(1)),label:n.day.slice(5)})}),{width:O,height:k,gridLines:c,segments:l,dayHovers:u,dayLabels:d,axisY:Number(s(0).toFixed(1)),marginLeft:A.l,marginRight:A.r}}function N(e,t,n,r=1e-9){let i=O-A.l-A.r,a=k-A.t-A.b,o=t.flatMap(e=>e.values.filter(e=>e!==null)),s=Math.max(r,...o)*1.08,c=i/Math.max(1,e.length),l=e=>A.l+e*c+c/2,u=e=>A.t+a-e/s*a,d=Array.from({length:5},(e,t)=>{let r=s/4*t;return{y:Number(u(r).toFixed(1)),label:n(r)}}),f=e.map((e,t)=>({x:Number(l(t).toFixed(1)),label:e.slice(5),i:t})).filter(({i:t})=>t%j(e.length)===0).map(({x:e,label:t})=>({x:e,label:t})),p=t.map((t,r)=>{let i=[],a=[],o=[];return t.values.forEach((r,s)=>{if(r===null){o.length>=2&&i.push(o.join(` `)),o=[];return}let c=Number(l(s).toFixed(1)),d=Number(u(r).toFixed(1));o.push(`${c},${d}`),a.push({x:c,y:d,title:`${e[s]} — ${t.name} ${n(r)}`})}),o.length>=2&&i.push(o.join(` `)),{name:t.name,seriesIndex:r,segments:i,dots:a}});return{width:O,height:k,gridLines:d,dayLabels:f,axisY:Number(u(0).toFixed(1)),marginLeft:A.l,marginRight:A.r,lines:p}}function P(e){return N(e.map(e=>e.day),[{name:`failure rate`,values:e.map(e=>e.runs>0?(e.byStatus.failed??0)/e.runs:null)}],w,.01)}function ee(e,t,n){let r=e.map(e=>e.day),i=new Map(n.map(e=>[`${e.day}\n${e.agent}`,e.p50WallMs]));return N(r,t.map(e=>({name:e.agent,values:r.map(t=>i.get(`${t}\n${e.agent}`)??null)})),C)}function te(e){return[`Each finished run is one point, bucketed at ${e.bucket} (UTC days).`,`Dollars are priced ${e.pricing}, through the same price table the costs page uses.`,`Each run is counted ${e.completeness}, however many times its record is written.`,`The dataset keeps ${e.retentionDays} days; sampled rows are re-weighted in every figure.`]}var F=[`stroke-[#4478b8] dark:stroke-[#7aa7e0]`,`stroke-[#c8823b] dark:stroke-[#e0a95a]`,`stroke-[#4c8c57] dark:stroke-[#6fae7a]`,`stroke-[#b8963e] dark:stroke-[#d4b45a]`,`stroke-[#b0568c] dark:stroke-[#d489b8]`,`stroke-[#6b7bcc] dark:stroke-[#98a5e6]`,`stroke-[#d05252] dark:stroke-[#e07a74]`,`stroke-[#3e8e96] dark:stroke-[#6fb9c0]`],I=[`fill-[#4478b8] dark:fill-[#7aa7e0]`,`fill-[#c8823b] dark:fill-[#e0a95a]`,`fill-[#4c8c57] dark:fill-[#6fae7a]`,`fill-[#b8963e] dark:fill-[#d4b45a]`,`fill-[#b0568c] dark:fill-[#d489b8]`,`fill-[#6b7bcc] dark:fill-[#98a5e6]`,`fill-[#d05252] dark:fill-[#e07a74]`,`fill-[#3e8e96] dark:fill-[#6fb9c0]`],L={class:`overflow-x-auto`},R=[`viewBox`,`aria-label`],z=[`x1`,`x2`,`y1`,`y2`],B=[`x`,`y`],V=[`points`],H=[`cx`,`cy`],U=[`x`,`y`],W=[`x1`,`x2`,`y1`,`y2`],G=t({__name:`TrendLineChart`,props:{model:{},label:{}},setup(e){return(t,n)=>(u(),h(`div`,L,[(u(),h(`svg`,{class:`block h-auto w-full font-mono`,viewBox:`0 0 ${e.model.width} ${e.model.height}`,role:`img`,"aria-label":e.label},[(u(!0),h(p,null,g(e.model.gridLines,(t,n)=>(u(),h(p,{key:`g${n}`},[m(`line`,{class:`stroke-(--ui-border-muted)`,x1:e.model.marginLeft,x2:e.model.width-e.model.marginRight,y1:t.y,y2:t.y},null,8,z),m(`text`,{class:`fill-(--ui-text-dimmed) text-[11px] tabular-nums`,x:e.model.marginLeft-8,y:t.y+4,"text-anchor":`end`},i(t.label),9,B)],64))),128)),(u(!0),h(p,null,g(e.model.lines,e=>(u(),h(p,{key:e.name},[(u(!0),h(p,null,g(e.segments,(t,n)=>(u(),h(`polyline`,{key:`${e.name}-${n}`,class:o([`trend-line fill-none`,d(F)[e.seriesIndex%d(F).length]]),"stroke-width":`2`,"stroke-linejoin":`round`,"stroke-linecap":`round`,points:t},null,10,V))),128)),(u(!0),h(p,null,g(e.dots,(t,n)=>(u(),h(`circle`,{key:`${e.name}-d${n}`,class:o([`trend-dot`,d(I)[e.seriesIndex%d(I).length]]),cx:t.x,cy:t.y,r:`2.5`},[m(`title`,null,i(t.title),1)],10,H))),128))],64))),128)),(u(!0),h(p,null,g(e.model.dayLabels,(t,n)=>(u(),h(`text`,{key:`d${n}`,class:`fill-(--ui-text-dimmed) text-[11px]`,x:t.x,y:e.model.height-10,"text-anchor":`middle`},i(t.label),9,U))),128)),m(`line`,{class:`stroke-(--ui-border)`,x1:e.model.marginLeft,x2:e.model.width-e.model.marginRight,y1:e.model.axisY,y2:e.model.axisY},null,8,W)],8,R))]))}}),K={class:`mb-4 flex flex-wrap items-center gap-x-4 gap-y-2`},q={class:`flex items-center gap-1`,"aria-label":`Range`},J={key:0,class:`rounded-md bg-accented px-2.5 py-1 font-mono text-xs font-medium tabular-nums text-highlighted`,"aria-current":`page`},Y={key:0,class:`flex items-center gap-1`,"aria-label":`Agent`},X={key:0,class:`rounded-md bg-accented px-2.5 py-1 text-xs font-medium text-highlighted`,"aria-current":`page`},Z={key:0,class:`rounded-md bg-accented px-2.5 py-1 text-xs font-medium text-highlighted`,"aria-current":`page`},Q={class:`font-mono text-sm tabular-nums text-muted`,"data-metrics-range":``},$={class:`mb-5 grid grid-cols-[repeat(auto-fit,minmax(190px,1fr))] gap-3`,"data-metrics-tiles":``},ne={class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},re={class:`font-mono text-2xl font-medium tabular-nums`},ie={class:`text-xs text-muted`},ae={class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},oe={class:`flex flex-wrap items-baseline justify-between gap-x-4 gap-y-2`},se={class:`legend flex flex-wrap gap-x-4 gap-y-1.5 text-xs text-muted`},ce={class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},le={class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},ue={class:`flex flex-wrap items-baseline justify-between gap-x-4 gap-y-2`},de={class:`legend flex flex-wrap gap-x-4 gap-y-1.5 text-xs text-muted`},fe={class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},pe={class:`overflow-x-auto`},me={class:`data w-full min-w-[38rem] border-collapse whitespace-nowrap font-mono text-[0.8125rem] tabular-nums`,"data-metrics-agents":``},he={class:`border-b border-muted px-2.5 py-1.5`},ge={class:`border-b border-muted px-2.5 py-1.5 text-right`},_e={class:`border-b border-muted px-2.5 py-1.5 text-right`},ve={class:`border-b border-muted px-2.5 py-1.5 text-right`},ye={class:`border-b border-muted px-2.5 py-1.5 text-right`},be={class:`border-b border-muted px-2.5 py-1.5 text-right`},xe={class:`border-b border-muted px-2.5 py-1.5 text-right`},Se={class:`border-b border-muted px-2.5 py-1.5 text-right`},Ce={class:`border-b border-muted px-2.5 py-1.5 text-right`},we={key:0},Te={class:`border-t border-default pt-3.5 text-xs text-dimmed`,"data-metrics-footer":``},Ee=t({__name:`MetricsPage`,setup(t){let O=f(`metrics`),k=c(()=>O?.report??null),A=c(()=>k.value?.range??null),j=c(()=>k.value?E(k.value):[]),N=c(()=>k.value?D(k.value.byDay):[]),F=c(()=>k.value?M(k.value.byDay,N.value):null),I=c(()=>k.value?P(k.value.byDay):null),L=c(()=>k.value?ee(k.value.byDay,k.value.byAgent,k.value.p50ByDayAgent):null),R=c(()=>A.value?te(A.value):[]),z=[7,30,90],B=c(()=>k.value?k.value.byAgent.map(e=>e.agent):[]),V=c(()=>A.value?.agent),H=e=>new Date(e).toISOString().slice(0,10);return(t,c)=>{let f=n(`RouterLink`);return k.value&&A.value?(u(),_(e,{key:0,title:`Run metrics`,nav:`metrics`},{default:a(()=>[m(`div`,K,[m(`nav`,q,[(u(),h(p,null,g(z,e=>(u(),h(p,{key:e},[e===A.value.days?(u(),h(`span`,J,i(e)+`d`,1)):(u(),_(f,{key:1,class:`rounded-md px-2.5 py-1 font-mono text-xs tabular-nums text-muted no-underline hover:bg-elevated hover:text-highlighted`,to:d(T)(e,V.value)},{default:a(()=>[r(i(e)+`d`,1)]),_:2},1032,[`to`]))],64))),64))]),B.value.length>0?(u(),h(`nav`,Y,[V.value===void 0?(u(),h(`span`,X,`all agents`)):(u(),_(f,{key:1,class:`rounded-md px-2.5 py-1 text-xs text-muted no-underline hover:bg-elevated hover:text-highlighted`,to:d(T)(A.value.days)},{default:a(()=>[...c[0]||=[r(`all agents`,-1)]]),_:1},8,[`to`])),(u(!0),h(p,null,g(B.value,e=>(u(),h(p,{key:e},[e===V.value?(u(),h(`span`,Z,i(e),1)):(u(),_(f,{key:1,class:`rounded-md px-2.5 py-1 text-xs text-muted no-underline hover:bg-elevated hover:text-highlighted`,to:d(T)(A.value.days,e)},{default:a(()=>[r(i(e),1)]),_:2},1032,[`to`]))],64))),128))])):l(``,!0),m(`p`,Q,i(d(b)(H(A.value.sinceMs)))+` → `+i(d(b)(H(A.value.untilMs-1)))+` · `+i(A.value.days)+`d · dataset `+i(k.value.dataset),1)]),m(`section`,$,[(u(!0),h(p,null,g(j.value,e=>(u(),h(`div`,{key:e.label,class:`grid gap-0.5 rounded-lg border border-default bg-elevated px-4 py-3.5`},[m(`span`,ne,i(e.label),1),m(`span`,re,i(e.value),1),m(`span`,ie,i(e.sub),1)]))),128))]),m(`section`,ae,[m(`div`,oe,[c[1]||=m(`div`,null,[m(`h2`,{class:`text-[0.9375rem] font-medium`},`Runs per day`),m(`p`,{class:`text-sm text-muted`},`Stacked by status · one point per finished run, weighted for sampling`)],-1),m(`div`,se,[(u(!0),h(p,null,g(N.value,(e,t)=>(u(),h(`span`,{key:e,class:`inline-flex items-center gap-1.5`},[m(`i`,{class:o([`inline-block size-2.5 rounded-xs`,d(v)[t%d(v).length]])},null,2),r(i(e),1)]))),128))])]),F.value?(u(),_(x,{key:0,model:F.value,label:`Runs per day, stacked by status`,format:d(S)},null,8,[`model`,`format`])):l(``,!0)]),m(`section`,ce,[c[2]||=m(`div`,null,[m(`h2`,{class:`text-[0.9375rem] font-medium`},`Failure rate per day`),m(`p`,{class:`text-sm text-muted`},`Failed share of the day's runs · a day with no runs draws a gap`)],-1),I.value?(u(),_(G,{key:0,model:I.value,label:`Failure rate per day`},null,8,[`model`])):l(``,!0)]),m(`section`,le,[m(`div`,ue,[c[3]||=m(`div`,null,[m(`h2`,{class:`text-[0.9375rem] font-medium`},`Median wall per day`),m(`p`,{class:`text-sm text-muted`},`p50 wall-clock per agent, weighted for sampling`)],-1),m(`div`,de,[(u(!0),h(p,null,g(L.value?.lines??[],e=>(u(),h(`span`,{key:e.name,class:`inline-flex items-center gap-1.5`},[m(`i`,{class:o([`inline-block size-2.5 rounded-xs`,d(v)[e.seriesIndex%d(v).length]])},null,2),r(i(e.name),1)]))),128))])]),L.value?(u(),_(G,{key:0,model:L.value,label:`Median wall-clock per day per agent`},null,8,[`model`])):l(``,!0)]),m(`section`,fe,[c[6]||=m(`div`,null,[m(`h2`,{class:`text-[0.9375rem] font-medium`},`By agent`),m(`p`,{class:`text-sm text-muted`},`Largest first · the whole range's runs per agent`)],-1),m(`div`,pe,[m(`table`,me,[m(`thead`,null,[m(`tr`,null,[c[4]||=m(`th`,{class:`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-left text-xs font-medium text-muted`},` Agent `,-1),(u(),h(p,null,g([`Runs`,`Failed`,`Failure rate`,`p50 wall`,`p95 wall`,`LLM`,`Unpriced tokens`,`Turns`],e=>m(`th`,{key:e,class:`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-right text-xs font-medium text-muted`},i(e),1)),64))])]),m(`tbody`,null,[(u(!0),h(p,null,g(k.value.byAgent,e=>(u(),h(`tr`,{key:e.agent},[m(`td`,he,[s(f,{class:`no-underline hover:text-highlighted hover:underline`,to:d(T)(A.value.days,e.agent)},{default:a(()=>[r(i(e.agent),1)]),_:2},1032,[`to`])]),m(`td`,ge,i(d(S)(e.runs)),1),m(`td`,_e,i(d(S)(e.failed)),1),m(`td`,ve,i(d(w)(e.runs>0?e.failed/e.runs:0)),1),m(`td`,ye,i(d(C)(e.p50WallMs)),1),m(`td`,be,i(d(C)(e.p95WallMs)),1),m(`td`,xe,i(d(y)(e.usd)),1),m(`td`,Se,i(d(S)(e.unpricedTokens)),1),m(`td`,Ce,i(d(S)(e.turns)),1)]))),128)),k.value.byAgent.length===0?(u(),h(`tr`,we,[...c[5]||=[m(`td`,{class:`px-2.5 py-1.5 text-muted`,colspan:`9`},`No runs in this range.`,-1)]])):l(``,!0)])])]),c[7]||=m(`p`,{class:`text-xs text-muted`},[r(` Machine-readable twin: `),m(`code`,{class:`rounded bg-accented px-1 py-0.5`},`GET /metrics.json`),r(` (same Access gate); the same report is `),m(`code`,{class:`rounded bg-accented px-1 py-0.5`},`metrics trend`),r(` on every command surface. `)],-1)]),m(`footer`,Te,[(u(!0),h(p,null,g(R.value,e=>(u(),h(`p`,{key:e},i(e),1))),128))])]),_:1})):(u(),_(e,{key:1,title:`Run metrics`,nav:`metrics`},{default:a(()=>[...c[8]||=[m(`section`,{class:`mb-5 grid gap-2 rounded-lg border border-default bg-elevated px-5 py-4`},[m(`h2`,{class:`text-sm font-medium text-highlighted`},`Nothing to show`),m(`p`,{class:`text-xs text-dimmed`},`This page did not receive its report; reload to ask again.`)],-1)]]),_:1}))}}});export{Ee as default};
@@ -0,0 +1 @@
1
+ import{t as e,z as t}from"./AppShell-CCPwPqvc.js";import{An as n,Fi as r,Jr as i,On as a,c as o,hr as s,ki as c,l,o as u,vn as d,yn as f}from"./browser-BWnzWwaT.js";import{t as p}from"./RunsTabs-D7rsC4GR.js";var m={class:`notfound mx-auto my-12 max-w-xl text-center text-toned`},h={class:`why text-[0.8rem] text-muted`},g=n({__name:`NotFoundPage`,setup(t){let n=u(`runNotFound`),g=o(n?.retentionDays??null);return(t,n)=>{let o=l;return s(),f(e,{title:`Run not found`,nav:`runs`},{default:i(()=>[a(p,{current:`runs`}),d(`section`,m,[n[0]||=d(`p`,{class:`code mb-3 font-mono text-4xl font-medium tracking-wide text-dimmed`},`404`,-1),n[1]||=d(`h2`,{class:`mb-3 text-lg font-medium tracking-tight text-highlighted`},`That run isn't here.`,-1),n[2]||=d(`p`,{class:`mb-2.5 leading-relaxed`},` It may have finished and aged out, the link may be missing its token, or it never existed — this page says the same thing in every case. `,-1),d(`p`,h,r(c(g)),1),a(o,{class:`back mt-4`,color:`neutral`,variant:`outline`,to:`/runs`,label:`← All runs`})])]),_:1})}}}),_=t({default:()=>v}),v=g;export{_ as n,v as t};
@@ -0,0 +1 @@
1
+ import{A as e,D as t,E as n,I as r,T as i,k as a}from"./AppShell-CCPwPqvc.js";import{$t as o,An as s,B as c,Bn as l,D as u,Dn as d,Ei as f,Fi as p,G as m,I as h,J as ee,Jr as g,K as te,L as _,Mi as v,Mr as y,Ni as b,On as x,Rr as S,S as C,Sr as w,T,Ti as E,Tr as D,Ur as O,Xr as k,_n as A,b as j,bn as M,hr as N,ki as P,l as F,lr as I,m as ne,mt as re,rt as ie,tn as ae,tr as L,vn as R,w as z,x as B,xn as V,xt as H,yi as U,yn as W,z as G}from"./browser-BWnzWwaT.js";import{K}from"./indexRow-BGjjLnN5.js";import"./format-BldUwl_R.js";import{d as q,f as J,m as oe,p as se}from"./sseReplay-BDVyc8HX.js";var[Y,ce]=te(`DialogRoot`),le=s({inheritAttrs:!1,__name:`DialogRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=re(n,`open`,t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=U(),a=U(),{modal:o,unmountOnHide:s}=f(n);return ce({open:r,modal:o,unmountOnHide:s,openModal:()=>{r.value=!0},onOpenChange:e=>{r.value=e},onOpenToggle:()=>{r.value=!r.value},contentId:``,titleId:``,descriptionId:``,triggerElement:i,contentElement:a}),(e,t)=>w(e.$slots,`default`,{open:P(r),close:()=>r.value=!1})}}),ue=s({__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;G();let n=Y();return(e,r)=>(N(),W(P(h),L(t,{type:e.as===`button`?`button`:void 0,onClick:r[0]||=e=>P(n).onOpenChange(!1)}),{default:g(()=>[w(e.$slots,`default`)]),_:3},16,[`type`]))}}),X=s({__name:`DialogContentImpl`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:r}){let o=e,s=r,c=Y(),{forwardRef:l,currentElement:u}=G();return c.titleId||=a(void 0,`reka-dialog-title`),c.descriptionId||=a(void 0,`reka-dialog-description`),I(()=>{c.contentElement=u,m()!==document.body&&(c.triggerElement.value=m())}),(e,r)=>(N(),W(P(n),{"as-child":``,loop:``,trapped:o.trapFocus,present:o.present,onMountAutoFocus:r[5]||=e=>s(`openAutoFocus`,e),onUnmountAutoFocus:r[6]||=e=>s(`closeAutoFocus`,e)},{default:g(()=>[x(P(t),L({id:P(c).contentId,ref:P(l),as:e.as,"as-child":e.asChild,present:o.present,"disable-outside-pointer-events":e.disableOutsidePointerEvents,role:`dialog`,"aria-describedby":P(c).descriptionId,"aria-labelledby":P(c).titleId,"data-state":P(i)(P(c).open.value)},e.$attrs,{onDismiss:r[0]||=e=>P(c).onOpenChange(!1),onEscapeKeyDown:r[1]||=e=>s(`escapeKeyDown`,e),onFocusOutside:r[2]||=e=>s(`focusOutside`,e),onInteractOutside:r[3]||=e=>s(`interactOutside`,e),onPointerDownOutside:r[4]||=e=>s(`pointerDownOutside`,e)}),{default:g(()=>[w(e.$slots,`default`)]),_:3},16,[`id`,`as`,`as-child`,`present`,`disable-outside-pointer-events`,`aria-describedby`,`aria-labelledby`,`data-state`])]),_:3},8,[`trapped`,`present`]))}}),de=s({__name:`DialogContentModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(t,{emit:n}){let r=t,i=n,a=Y(),o=c(i),{forwardRef:s,currentElement:l}=G(),u=A(()=>r.present?l.value:void 0);e(u);let d=A(()=>{let{present:e,...t}=r;return t});return O(()=>r.present,(e,t)=>{!e&&t&&a.triggerElement.value?.focus()}),(e,t)=>(N(),W(X,L({...d.value,...P(o)},{ref:P(s),present:e.present,"trap-focus":P(a).open.value,"disable-outside-pointer-events":r.disableOutsidePointerEvents,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(e.preventDefault(),P(a).triggerElement.value?.focus())},onPointerDownOutside:t[1]||=e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()},onFocusOutside:t[2]||=e=>{e.preventDefault()}}),{default:g(()=>[w(e.$slots,`default`)]),_:3},16,[`present`,`trap-focus`,`disable-outside-pointer-events`]))}}),fe=s({__name:`DialogContentNonModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=c(t);G();let i=Y(),a=U(!1),o=U(!1),s=A(()=>{let{present:e,...t}=n;return t});return O(()=>n.present,(e,t)=>{!e&&t&&(a.value||i.triggerElement.value?.focus(),a.value=!1,o.value=!1)}),(e,t)=>(N(),W(X,L({...s.value,...P(r)},{present:e.present,"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(a.value||P(i).triggerElement.value?.focus(),e.preventDefault()),a.value=!1,o.value=!1},onInteractOutside:t[1]||=e=>{e.defaultPrevented||(a.value=!0,e.detail.originalEvent.type===`pointerdown`&&(o.value=!0));let t=e.target;P(i).triggerElement.value?.contains(t)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&o.value&&e.preventDefault()}}),{default:g(()=>[w(e.$slots,`default`)]),_:3},16,[`present`]))}}),pe=s({__name:`DialogContent`,props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=Y(),a=c(r),{forwardRef:s}=G();return(e,t)=>(N(),W(P(_),{present:e.forceMount||P(i).open.value,"force-mount":e.forceMount||!P(i).unmountOnHide.value},{default:g(({present:t})=>[P(i).modal.value?k((N(),W(de,L({key:0,ref:P(s),present:P(i).unmountOnHide.value||t},{...n,...P(a),...e.$attrs}),{default:g(()=>[w(e.$slots,`default`)]),_:2},1040,[`present`])),[[o,P(i).unmountOnHide.value||t]]):k((N(),W(fe,L({key:1,ref:P(s),present:P(i).unmountOnHide.value||t},{...n,...P(a),...e.$attrs}),{default:g(()=>[w(e.$slots,`default`)]),_:2},1040,[`present`])),[[o,P(i).unmountOnHide.value||t]])]),_:3},8,[`present`,`force-mount`]))}}),Z=s({__name:`DialogDescription`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`p`}},setup(e){let t=e;G();let n=Y();return(e,r)=>(N(),W(P(h),L(t,{id:P(n).descriptionId}),{default:g(()=>[w(e.$slots,`default`)]),_:3},16,[`id`]))}}),me=s({__name:`DialogOverlayImpl`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},setup(e){let t=e,n=Y(),i=r(t.present);return O(()=>t.present,e=>i.value=e),G(),(e,t)=>(N(),W(P(h),{as:e.as,"as-child":e.asChild,"data-state":P(n).open.value?`open`:`closed`,style:{"pointer-events":`auto`},onPointerdown:t[0]||=ae(()=>{},[`left`,`self`,`prevent`])},{default:g(()=>[w(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`]))}}),he=s({__name:`DialogOverlay`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=Y(),{forwardRef:n}=G();return(e,r)=>P(t)?.modal.value?(N(),W(P(_),{key:0,present:e.forceMount||P(t).open.value,"force-mount":e.forceMount||!P(t).unmountOnHide.value},{default:g(({present:r})=>[k(x(me,L(e.$attrs,{ref:P(n),as:e.as,"as-child":e.asChild,present:P(t).unmountOnHide.value||r}),{default:g(()=>[w(e.$slots,`default`)]),_:2},1040,[`as`,`as-child`,`present`]),[[o,P(t).unmountOnHide.value||r]])]),_:3},8,[`present`,`force-mount`])):M(`v-if`,!0)}}),ge=s({__name:`DialogPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(N(),W(P(u),b(l(t)),{default:g(()=>[w(e.$slots,`default`)]),_:3},16))}}),Q=s({__name:`DialogTitle`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`h2`}},setup(e){let t=e,n=Y();return G(),(e,r)=>(N(),W(P(h),L(t,{id:P(n).titleId}),{default:g(()=>[w(e.$slots,`default`)]),_:3},16,[`id`]))}}),_e=s({__name:`DialogTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=Y(),{forwardRef:r,currentElement:i}=G();return n.contentId||=a(void 0,`reka-dialog-content`),I(()=>{n.triggerElement.value=i.value}),(e,i)=>(N(),W(P(h),L(t,{ref:P(r),type:e.as===`button`?`button`:void 0,"aria-haspopup":`dialog`,"aria-expanded":P(n).open.value||!1,"aria-controls":P(n).open.value?P(n).contentId:void 0,"data-state":P(n).open.value?`open`:`closed`,onClick:P(n).onOpenToggle}),{default:g(()=>[w(e.$slots,`default`)]),_:3},16,[`type`,`aria-expanded`,`aria-controls`,`data-state`,`onClick`]))}});function ve(e,t={}){let n=e.detail.originalEvent,r=n.target;if(!r?.isConnected){e.preventDefault();return}t.scrollable&&(n.offsetX>r.clientWidth||n.offsetY>r.clientHeight)&&e.preventDefault()}var ye={slots:{overlay:`fixed inset-0 bg-elevated/75`,content:`fixed bg-default divide-y divide-default sm:ring ring-default sm:shadow-lg flex flex-col focus:outline-none`,header:`flex items-center gap-1.5 p-4 sm:px-6 min-h-(--ui-header-height)`,wrapper:``,body:`flex-1 overflow-y-auto p-4 sm:p-6`,footer:`flex items-center gap-1.5 p-4 sm:px-6`,title:`text-highlighted font-semibold`,description:`mt-1 text-muted text-sm`,close:`absolute top-4 end-4`},variants:{side:{top:{content:``},right:{content:`max-w-md`},bottom:{content:``},left:{content:`max-w-md`}},inset:{true:{content:`rounded-lg`}},transition:{true:{overlay:`data-[state=open]:animate-[fade-in_200ms_var(--ease-out)] data-[state=closed]:animate-[fade-out_200ms_var(--ease-out)]`}}},compoundVariants:[{side:`top`,inset:!0,class:{content:`max-h-[calc(100%-2rem)] inset-x-4 top-4`}},{side:`top`,inset:!1,class:{content:`max-h-full inset-x-0 top-0`}},{side:`right`,inset:!0,class:{content:`w-[calc(100%-2rem)] inset-y-4 right-4`}},{side:`right`,inset:!1,class:{content:`w-full inset-y-0 right-0`}},{side:`bottom`,inset:!0,class:{content:`max-h-[calc(100%-2rem)] inset-x-4 bottom-4`}},{side:`bottom`,inset:!1,class:{content:`max-h-full inset-x-0 bottom-0`}},{side:`left`,inset:!0,class:{content:`w-[calc(100%-2rem)] inset-y-4 left-4`}},{side:`left`,inset:!1,class:{content:`w-full inset-y-0 left-0`}},{transition:!0,side:`top`,class:{content:`data-[state=open]:animate-[slide-in-from-top_200ms_var(--ease-out)] data-[state=closed]:animate-[slide-out-to-top_200ms_var(--ease-out)]`}},{transition:!0,side:`right`,class:{content:`data-[state=open]:animate-[slide-in-from-right_200ms_var(--ease-out)] data-[state=closed]:animate-[slide-out-to-right_200ms_var(--ease-out)]`}},{transition:!0,side:`bottom`,class:{content:`data-[state=open]:animate-[slide-in-from-bottom_200ms_var(--ease-out)] data-[state=closed]:animate-[slide-out-to-bottom_200ms_var(--ease-out)]`}},{transition:!0,side:`left`,class:{content:`data-[state=open]:animate-[slide-in-from-left_200ms_var(--ease-out)] data-[state=closed]:animate-[slide-out-to-left_200ms_var(--ease-out)]`}}]},be={__name:`Slideover`,props:{title:{type:String,required:!1},description:{type:String,required:!1},content:{type:Object,required:!1},overlay:{type:Boolean,required:!1,default:!0},transition:{type:Boolean,required:!1,default:!0},side:{type:null,required:!1,default:`right`},inset:{type:Boolean,required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},close:{type:[Boolean,Object],required:!1,default:!0},closeIcon:{type:null,required:!1},dismissible:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:Object,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1}},emits:[`leave`,`after:leave`,`enter`,`after:enter`,`close:prevent`,`update:open`],setup(e,{emit:t}){let n=e,r=t,i=S(),a=C(`slideover`,n),{t:o}=ee(),s=ie(),c=B(H(a,`open`,`defaultOpen`,`modal`,`unmountOnHide`),r),u=z(E(()=>a.portal)),f=E(()=>a.content),m=A(()=>a.dismissible?{pointerDownOutside:ve}:[`interactOutside`,`escapeKeyDown`].reduce((e,t)=>(e[t]=e=>{e.preventDefault(),r(`close:prevent`)},e),{})),h=A(()=>j({extend:ye,...s.ui?.slideover||{}})({transition:a.transition,side:a.side,inset:a.inset}));return(e,t)=>(N(),W(P(le),b(l(P(c))),{default:g(({open:n,close:c})=>[i.default?(N(),W(P(_e),{key:0,"as-child":``,class:v(P(a).class)},{default:g(()=>[w(e.$slots,`default`,{open:n})]),_:2},1032,[`class`])):M(``,!0),x(P(ge),L(P(u),{"force-mount":P(u).disabled&&P(a).unmountOnHide===!1||void 0}),{default:g(()=>[x(P(ne),null,{default:g(()=>[P(a).overlay?(N(),W(P(he),{key:0,"data-slot":`overlay`,class:v(h.value.overlay({class:P(a).ui?.overlay}))},null,8,[`class`])):M(``,!0),x(P(pe),L({"data-side":P(a).side,"data-slot":`content`,class:h.value.content({class:[!i.default&&P(a).class,P(a).ui?.content]})},f.value,{onEnter:t[0]||=e=>r(`enter`),onAfterEnter:t[1]||=e=>r(`after:enter`),onLeave:t[2]||=e=>r(`leave`),onAfterLeave:t[3]||=e=>r(`after:leave`)},y(m.value)),{default:g(()=>[!P(a).title&&!i.title||!P(a).description&&!i.description||i.content?(N(),W(P(T),{key:0},{default:g(()=>[!P(a).title&&!i.title?(N(),W(P(Q),{key:0})):i.content?(N(),W(P(Q),{key:1},{default:g(()=>[w(e.$slots,`title`,{},()=>[d(p(P(a).title),1)])]),_:3})):M(``,!0),!P(a).description&&!i.description?(N(),W(P(Z),{key:2})):i.content?(N(),W(P(Z),{key:3},{default:g(()=>[w(e.$slots,`description`,{},()=>[d(p(P(a).description),1)])]),_:3})):M(``,!0)]),_:3})):M(``,!0),w(e.$slots,`content`,{close:c},()=>[i.header||P(a).title||i.title||P(a).description||i.description||P(a).close||i.close?(N(),V(`div`,{key:0,"data-slot":`header`,class:v(h.value.header({class:P(a).ui?.header}))},[w(e.$slots,`header`,{close:c},()=>[P(a).title||i.title||P(a).description||i.description?(N(),V(`div`,{key:0,"data-slot":`wrapper`,class:v(h.value.wrapper({class:P(a).ui?.wrapper}))},[P(a).title||i.title?(N(),W(P(Q),{key:0,"data-slot":`title`,class:v(h.value.title({class:P(a).ui?.title}))},{default:g(()=>[w(e.$slots,`title`,{},()=>[d(p(P(a).title),1)])]),_:3},8,[`class`])):M(``,!0),P(a).description||i.description?(N(),W(P(Z),{key:1,"data-slot":`description`,class:v(h.value.description({class:P(a).ui?.description}))},{default:g(()=>[w(e.$slots,`description`,{},()=>[d(p(P(a).description),1)])]),_:3},8,[`class`])):M(``,!0)],2)):M(``,!0),w(e.$slots,`actions`),P(a).close||i.close?(N(),W(P(ue),{key:1,"as-child":``},{default:g(()=>[w(e.$slots,`close`,{ui:h.value},()=>[P(a).close?(N(),W(F,L({key:0,icon:P(a).closeIcon||P(s).ui.icons.close,color:`neutral`,variant:`ghost`,"aria-label":P(o)(`slideover.close`)},typeof P(a).close==`object`?P(a).close:{},{"data-slot":`close`,class:h.value.close({class:P(a).ui?.close})}),null,16,[`icon`,`aria-label`,`class`])):M(``,!0)])]),_:2},1024)):M(``,!0)])],2)):M(``,!0),R(`div`,{"data-slot":`body`,class:v(h.value.body({class:P(a).ui?.body}))},[w(e.$slots,`body`,{close:c})],2),i.footer?(N(),V(`div`,{key:1,"data-slot":`footer`,class:v(h.value.footer({class:P(a).ui?.footer}))},[w(e.$slots,`footer`,{close:c})],2)):M(``,!0)])]),_:2},1040,[`data-side`,`class`])]),_:2},1024)]),_:2},1040,[`force-mount`])]),_:3},16))}};function xe(e){let t=U(`connecting`),n=e.factory(e.url);n.onopen=()=>{t.value===`connecting`&&!e.model.state.stopMode&&(t.value=`running`)};let r=0;return n.onmessage=t=>{let n;try{n=JSON.parse(t.data)}catch{return}if(n.type!==`replay_note`){let e=Number(t.lastEventId);if(e>0){if(e<=r)return;r=e}}e.handle(n)},n.addEventListener(`replay_elided`,t=>{let n=oe(t);n&&e.model.noteElided(n)}),n.addEventListener(`finished`,n=>{e.onFinished?.(se(n)),(t.value===`connecting`||t.value===`running`)&&(t.value=`finished`)}),n.addEventListener(`end`,r=>{e.model.flushPendingTurn(`the run ended here`),e.model.closePhases(),t.value=`ended`,n.close(),e.onEnd?.(J(r))}),n.onerror=()=>{n.readyState===2&&(t.value=`disconnected`,e.onDisconnected?.())},{phase:t,close:()=>n.close()}}var $=[`Thinking`,`Pondering`,`Mulling it over`,`Reasoning`,`Cogitating`,`Weighing options`,`Puzzling`,`Deliberating`,`Noodling`,`Chewing on it`,`Ruminating`,`Reticulating splines`];function Se(e){return $[Math.floor(Math.max(0,e)/6e3)%$.length]}var Ce=[`title`],we={class:`verb min-w-0 truncate text-toned`},Te=s({__name:`PendingTurnRow`,props:{verb:{},elapsedMs:{},slow:{type:Boolean},model:{},tag:{},id:{}},setup(e){return(t,n)=>(N(),W(D(e.tag??`li`),{id:e.id,class:`pending flex items-center gap-3 rounded-md border border-dashed border-accented pl-3 pr-[calc(var(--sb-gutter)-1px)] py-2 text-sm`,"aria-live":`off`,title:`the model is working on its next turn — nothing back yet (since the last event, runner clock)`,"data-testid":`pending`},{default:g(()=>[n[0]||=R(`span`,{class:`pulse text-[1.1em] leading-none text-info motion-safe:animate-pulse`},`∿`,-1),e.model?(N(),V(`span`,{key:0,class:`badge shrink-0 rounded bg-accented px-1.5 font-mono text-[0.68rem] font-medium leading-normal tracking-wider text-muted`,title:e.model},p(P(q)(e.model)),9,Ce)):M(``,!0),R(`span`,we,p(e.verb)+`…`,1),R(`span`,{class:v([`since ml-auto shrink-0 font-mono text-xs tabular-nums`,e.slow?`text-warn`:`text-dimmed`])},p(P(K)(e.elapsedMs,`clock`)),3)]),_:1},8,[`id`]))}});export{be as i,Se as n,xe as r,Te as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./AppShell-CCPwPqvc.js";import{An as t,Cr as n,Dn as r,Fi as i,Jr as a,Mi as o,On as s,Pi as c,Ur as l,_i as u,_n as d,ar as f,bn as p,hr as m,ki as h,l as g,nr as _,o as v,sn as y,t as b,vn as x,xn as S,xr as C,yi as w,yn as T}from"./browser-BWnzWwaT.js";import{i as E}from"./PendingTurnRow-BPyJ2f-i.js";import{t as D}from"./wallClock-DaewxNMY.js";import{C as O,D as ee,G as te,K as k,N as ne,T as A,j as re,v as ie,x as ae,y as oe}from"./indexRow-BGjjLnN5.js";import"./format-BldUwl_R.js";import{_ as j,a as M,f as N,g as P,i as F,n as I,o as L,r as R,t as z,u as B,v as V,x as H}from"./SilentTurn-D4MMDjWO.js";import{T as U}from"./sseReplay-BDVyc8HX.js";var W=[`data-conversation`],G={key:0,class:`mt-6 text-center text-sm text-toned`,"data-testid":`chat-empty`},K={key:1,class:`m-0 flex list-none flex-col gap-5 p-0 pb-4 pt-2`},q={key:4,class:`inline text-[0.875rem] text-toned`,"data-testid":`inline`},J={class:`pt-2`},Y=t({__name:`PlaneChat`,props:{chat:{},at:{},now:{}},setup(e){let t=e,n=0,r=e=>`${e}-${++n}`,i=u([]);for(let e of t.chat.turns){if(`kind`in e){e.kind===`receipt`?i.push({key:r(`s`),kind:`silent`,reason:e.reason,at:e.decidedAt}):i.push({key:r(`w`),kind:`parent`,turn:e});continue}i.push({key:r(`p`),kind:`person`,text:e.request,at:e.receivedAt??e.startedAt,pending:!1});let n=!e.finished&&e.token?{eventsUrl:`/runs/${encodeURIComponent(e.id)}/events?t=${e.token}`,stopUrl:`/runs/${encodeURIComponent(e.id)}/stop?t=${e.token}`,serverNow:t.at}:null;i.push({key:r(`a`),kind:`assistant`,turn:e,live:n,ended:e.finished})}let a=d(()=>{for(let e=i.length-1;e>=0;e--){let t=i[e];if(t.kind===`assistant`&&t.live&&!t.ended&&t.turn.hosted!==!0)return t}return null}),o=w(null),c=w(``),f=w(void 0),p=d(()=>N(a.value!==null,c.value)),h=w(!1);l(c,()=>{f.value&&c.value===``&&(f.value=void 0)});async function g(){if(h.value)return;let e=L(c.value.trim(),t.chat.commands);if(e===``)return;let n=u({key:r(`p`),kind:`person`,text:e,at:t.now,pending:!0});i.push(n),c.value=``,f.value=void 0,h.value=!0;try{let a=await fetch(t.chat.sendUrl,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:JSON.stringify({text:e})}),o=await a.json().catch(()=>({}));if(a.status===202&&typeof o.viewPath==`string`&&typeof o.runId==`string`){let a=P(o.viewPath);if(!a)throw Error(`the run's view path was not one`);n.pending=!1,i.push({key:r(`a`),kind:`assistant`,turn:{id:o.runId,request:e,startedAt:t.now,receivedAt:t.now,finished:!1,eventCount:0},live:{eventsUrl:a.eventsUrl,stopUrl:a.stopUrl},ended:!1});return}if(a.ok&&o.offer&&typeof o.offer.line==`string`){n.pending=!1;let e=V({line:o.offer.line,...o.offer});c.value=e.command,f.value=e.hint;return}if(a.ok&&typeof o.reply==`string`){n.pending=!1;let e=B(o.reply);e.kind===`inline`&&i.push({key:r(`i`),kind:`inline`,text:e.text});return}throw Error(o.error??`HTTP ${a.status}`)}catch(e){n.pending=!1,n.failed=`not sent: ${e instanceof Error?e.message:`error`}`}finally{h.value=!1}}function v(){let e=o.value;e&&fetch(`${e}${e.includes(`?`)?`&`:`?`}mode=soft`,{method:`POST`,credentials:`same-origin`})}function b(e,t,n){let r=i.filter(e=>e.kind===`person`),a=j(r.map(e=>({text:e.text,folded:e.folded!==void 0,ref:e})),t);if(!a)return;let o=e.turn.receivedAt??e.turn.startedAt;a.ref.folded=n===void 0?``:`at ${k(Math.max(0,n-o),`clock`)}`}function E(e){e.ended=!0,o.value=null}let D=w(null);return l(()=>i.length,()=>{let e=D.value,t=!e||H(e.scrollHeight-(e.clientHeight+e.scrollTop));_().then(()=>{let e=D.value;t&&e&&(e.scrollTop=e.scrollHeight)})}),(t,n)=>(m(),S(`div`,{class:`plane-chat flex h-full min-h-0 flex-col`,"data-plane-chat":``,"data-conversation":e.chat.conversation},[x(`div`,{ref_key:`scroller`,ref:D,class:`min-h-0 flex-1 overflow-y-auto pr-1`,"data-testid":`chat-scroller`},[i.length===0?(m(),S(`p`,G,` Ask about the fleet — the rows on this page are what it reads. `)):(m(),S(`ol`,K,[(m(!0),S(y,null,C(i,t=>(m(),S(`li`,{key:t.key},[t.kind===`person`?(m(),T(F,{key:0,text:t.text,at:t.at,now:e.now,pending:t.pending,folded:t.folded,failed:t.failed},null,8,[`text`,`at`,`now`,`pending`,`folded`,`failed`])):t.kind===`assistant`?(m(),T(R,{key:1,turn:t.turn,live:t.live,now:e.now,onInput:(e,n)=>b(t,e,n),onEnded:e=>E(t),onStop:n[0]||=e=>o.value=e},null,8,[`turn`,`live`,`now`,`onInput`,`onEnded`])):t.kind===`silent`?(m(),T(z,{key:2,reason:t.reason,"decided-at":t.at,now:e.now},null,8,[`reason`,`decided-at`,`now`])):t.kind===`parent`?(m(),T(I,{key:3,turn:t.turn,now:e.now},null,8,[`turn`,`now`])):(m(),S(`div`,q,[s(U,{text:t.text},null,8,[`text`])]))]))),128))]))],512),x(`div`,J,[s(M,{modelValue:c.value,"onUpdate:modelValue":n[1]||=e=>c.value=e,mode:p.value,hint:f.value,commands:e.chat.commands,onSubmit:g,onStop:v},null,8,[`modelValue`,`mode`,`hint`,`commands`])])],8,W))}}),se=[`data-chat`],ce={class:`panels min-w-0`},le={class:`mb-4 font-mono text-sm tabular-nums text-muted`,"data-plane-head":``},ue={class:`mb-6`,"aria-labelledby":`plane-runs`},de={key:0,class:`text-sm text-muted`},fe={key:1,class:`divide-y divide-default rounded-md border border-default`},pe=[`data-run`,`data-health`],me={class:`text-muted`},he={class:`font-mono tabular-nums`},ge={class:`font-mono tabular-nums text-muted`},_e={key:0,class:`font-mono text-xs tabular-nums text-muted`},ve={class:`text-muted`,"data-owner":``},ye=[`href`],be=[`data-flag`],xe={class:`mb-6`,"aria-labelledby":`plane-units`},Se={key:0,class:`text-sm text-muted`},Ce={key:1,class:`divide-y divide-default rounded-md border border-default`},we=[`data-unit`,`data-health`],Te={class:`text-muted`},Ee=[`href`],De=[`data-flag`],Oe={"aria-labelledby":`plane-prs`},ke={key:0,class:`text-sm text-muted`},Ae={key:1,class:`divide-y divide-default rounded-md border border-default`},je=[`data-pr`,`data-health`],Me=[`href`],Ne={key:1,class:`font-mono text-highlighted`},Pe={key:2,class:`truncate text-muted`},Fe={class:`text-xs text-dimmed`,"data-owner":``},Ie=[`data-flag`],Le={key:0,class:`chat-column relative hidden lg:block`,"data-testid":`chat-column`},Re=[`aria-valuemin`,`aria-valuemax`,`aria-valuenow`],X=`sb.plane.chat.width`,ze=`(min-width: 64rem)`,Be=t({__name:`PlanePage`,setup(t){let l=v(`plane`),u=d(()=>l?.table??null),_=D(l?.table.at,3e4),j=l?.chat??null,M={min:320,default:400,max:640,step:16};function N(e){let t=Math.round(Number(e));return Number.isFinite(t)?Math.min(M.max,Math.max(M.min,t)):M.default}let P=b.readPref(X),F=w(P===null?M.default:N(P)),I=w(!1),L=w(b.mediaMatches(ze)),R=b.onMediaChange(ze,e=>{L.value=e,e&&(I.value=!1)});function z(e,t){F.value=N(e),t&&b.writePref(X,String(F.value))}let B=null;function V(e){B&&z(B.startWidth-(e.clientX-B.startX),!1)}function H(){window.removeEventListener(`pointermove`,V),B&&(B=null,b.writePref(X,String(F.value)))}function U(e){e.button===0&&(e.preventDefault(),B={startX:e.clientX,startWidth:F.value},e.currentTarget?.setPointerCapture?.(e.pointerId),window.addEventListener(`pointermove`,V),window.addEventListener(`pointerup`,H,{once:!0}))}function W(e){if(e.key===`ArrowLeft`)z(F.value+M.step,!0);else if(e.key===`ArrowRight`)z(F.value-M.step,!0);else if(e.key===`Home`)z(M.max,!0);else if(e.key===`End`)z(M.min,!0);else return;e.preventDefault()}f(()=>{window.removeEventListener(`pointermove`,V),window.removeEventListener(`pointerup`,H),R()});let G=e=>({...e.run,...l?.tokens[e.run.id]?{token:l.tokens[e.run.id]}:{}}),K=d(()=>u.value?.runs.filter(e=>!e.run.finished).length??0),q=d(()=>u.value?u.value.runs.length-K.value:0),J=e=>{let t=e.owner.name??ne(G(e))??e.owner.id??``;return e.owner.generation?`${t||`run`} · on ${e.owner.generation}`:t},Be=e=>{let t=e.run;return k(te({startedAt:t.startedAt,receivedAt:t.receivedAt,finishedAt:t.finishedAt},_.value),`clock`)},Ve=e=>ie(G(e),_.value)??oe(G(e),_.value),He=e=>`/runs/unit/${encodeURIComponent(e.unit.unit)}`,Z=e=>`${e.pr.repo}#${e.pr.number}`,Ue=e=>e.owner.unitKey??(e.owner.runId?`run ${O(e.owner.runId)}`:`a person`),We={stalled:`stalled`,"bound-exceeded":`past its bound`,"no-signal":`no signal`,provisional:`unfinished`,interrupted:`interrupted`,failed:`failed`,approved:`approved`,dirty:`conflicts`,red:`checks red`,pending:`checks pending`,mistitled:`title fails the rule`,merged:`merged`,closed:`closed`,unknown:`unread`,live:`live`,waiting:`waiting`,idle:`idle`,"merge-ready":`merge-ready`,ended:`ended`,"owner-gap":`approved, open, nobody's`},Q=e=>We[e]??e,$=e=>[`stalled`,`bound-exceeded`,`red`,`dirty`,`mistitled`,`owner-gap`,`failed`,`interrupted`].includes(e)?`border-error/40 text-error`:[`pending`,`idle`,`waiting`,`no-signal`,`provisional`,`unknown`].includes(e)?`border-warning/40 text-warning`:`border-default text-muted`;return(t,l)=>{let d=n(`RouterLink`),f=g,v=E;return u.value?(m(),T(e,{key:0,title:`Plane`,nav:`plane`},{default:a(()=>[x(`div`,{class:o([`plane`,h(j)?`lg:grid lg:grid-cols-[minmax(0,1fr)_var(--chat-w)] lg:gap-10`:``]),style:c(h(j)?{"--chat-w":`${F.value}px`}:void 0),"data-chat":h(j)?`shown`:void 0},[x(`div`,ce,[x(`p`,le,i(K.value)+` live · `+i(q.value)+` recent · `+i(u.value.units.length)+` units · `+i(u.value.pullRequests.length)+` pull requests `,1),x(`section`,ue,[l[3]||=x(`h2`,{id:`plane-runs`,class:`mb-2 text-xs font-medium uppercase tracking-wide text-dimmed`},`Runs`,-1),u.value.runs.length===0?(m(),S(`p`,de,`No run is live or ended in the last hour.`)):(m(),S(`ul`,fe,[(m(!0),S(y,null,C(u.value.runs,e=>(m(),S(`li`,{key:e.run.id,class:`flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-2 text-sm`,"data-run":e.run.id,"data-health":e.health.join(` `)},[x(`span`,{class:o([`inline-block size-2 rounded-full`,{"bg-success":h(A)(G(e))===`green`,"bg-error":h(A)(G(e))===`red`,"bg-warning":h(A)(G(e))===`amber`,"bg-dimmed":h(A)(G(e))===`grey`}]),"aria-hidden":`true`},null,2),s(d,{class:`font-mono text-highlighted`,to:h(ae)(G(e))},{default:a(()=>[r(i(h(O)(e.run.id)),1)]),_:2},1032,[`to`]),x(`span`,me,i(e.run.agent??`-`),1),x(`span`,he,i(h(ee)(G(e))),1),x(`span`,ge,i(Be(e)),1),Ve(e)?(m(),S(`span`,_e,i(Ve(e)),1)):p(``,!0),x(`span`,ve,i(J(e)),1),e.unit?(m(),T(d,{key:1,class:`font-mono text-xs text-muted`,to:`/runs/unit/${encodeURIComponent(e.unit.key)}`},{default:a(()=>[r(i(e.unit.key),1)]),_:2},1032,[`to`])):p(``,!0),e.run.threadKey?(m(),S(`a`,{key:2,class:`text-xs text-dimmed`,href:h(re)(e.run.threadKey),target:`_blank`,rel:`noreferrer`},`thread`,8,ye)):p(``,!0),(m(!0),S(y,null,C(e.health,e=>(m(),S(`span`,{key:e,class:o([`rounded border px-1.5 py-0.5 text-xs`,$(e)]),"data-flag":e},i(Q(e)),11,be))),128))],8,pe))),128))]))]),x(`section`,xe,[l[4]||=x(`h2`,{id:`plane-units`,class:`mb-2 text-xs font-medium uppercase tracking-wide text-dimmed`},`Units`,-1),u.value.units.length===0?(m(),S(`p`,Se,`No ship unit has a run on the table.`)):(m(),S(`ul`,Ce,[(m(!0),S(y,null,C(u.value.units,e=>(m(),S(`li`,{key:e.unit.unit,class:`flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-2 text-sm`,"data-unit":e.unit.unit,"data-health":e.health.join(` `)},[s(d,{class:`font-mono text-highlighted`,to:He(e)},{default:a(()=>[r(i(e.unit.unit),1)]),_:2},1032,[`to`]),x(`span`,Te,i(e.instance.repo),1),x(`span`,null,i(e.unit.title??e.unit.id),1),e.unit.pr?(m(),S(`a`,{key:0,class:`font-mono text-xs text-muted`,href:e.unit.pr.url,target:`_blank`,rel:`noreferrer`},`#`+i(e.unit.pr.number),9,Ee)):p(``,!0),(m(!0),S(y,null,C(e.health,e=>(m(),S(`span`,{key:e,class:o([`rounded border px-1.5 py-0.5 text-xs`,$(e)]),"data-flag":e},i(Q(e)),11,De))),128))],8,we))),128))]))]),x(`section`,Oe,[l[5]||=x(`h2`,{id:`plane-prs`,class:`mb-2 text-xs font-medium uppercase tracking-wide text-dimmed`},`Pull requests`,-1),u.value.pullRequests.length===0?(m(),S(`p`,ke,`No pull request is tracked.`)):(m(),S(`ul`,Ae,[(m(!0),S(y,null,C(u.value.pullRequests,e=>(m(),S(`li`,{key:Z(e),class:`flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-2 text-sm`,"data-pr":Z(e),"data-health":e.health.join(` `)},[e.pr.url?(m(),S(`a`,{key:0,class:`font-mono text-highlighted`,href:e.pr.url,target:`_blank`,rel:`noreferrer`},i(Z(e)),9,Me)):(m(),S(`span`,Ne,i(Z(e)),1)),e.pr.title?(m(),S(`span`,Pe,i(e.pr.title),1)):p(``,!0),x(`span`,Fe,i(Ue(e)),1),(m(!0),S(y,null,C(e.health,e=>(m(),S(`span`,{key:e,class:o([`rounded border px-1.5 py-0.5 text-xs`,$(e)]),"data-flag":e},i(Q(e)),11,Ie))),128))],8,je))),128))]))])]),h(j)&&L.value?(m(),S(`aside`,Le,[x(`div`,{class:`handle group/handle absolute inset-y-0 -left-6 flex w-3 cursor-col-resize touch-none select-none justify-center outline-none`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize the chat column`,"aria-valuemin":M.min,"aria-valuemax":M.max,"aria-valuenow":F.value,tabindex:`0`,"data-testid":`chat-handle`,onPointerdown:U,onKeydown:W,onDblclick:l[0]||=e=>z(M.default,!0)},[...l[6]||=[x(`span`,{class:`w-px rounded-full bg-(--ui-border-accented) opacity-0 transition-opacity duration-150 ease-out group-hover/handle:opacity-100 group-focus-visible/handle:opacity-100`,"aria-hidden":`true`},null,-1)]],40,Re),s(Y,{class:`sticky top-20 h-[calc(100vh-7rem)]`,chat:h(j),at:u.value.at,now:h(_)},null,8,[`chat`,`at`,`now`])])):p(``,!0)],14,se),h(j)&&!L.value?(m(),S(y,{key:0},[s(f,{class:`chat-fab fixed bottom-5 right-5 z-20 rounded-full shadow-lg lg:hidden`,size:`lg`,icon:`i-lucide-message-circle`,"aria-label":`Open the chat`,"data-testid":`chat-fab`,onClick:l[1]||=e=>I.value=!0}),s(v,{open:I.value,"onUpdate:open":l[2]||=e=>I.value=e,side:`right`,title:`Chat`,ui:{content:`max-w-md`}},{body:a(()=>[s(Y,{class:`h-full`,chat:h(j),at:u.value.at,now:h(_)},null,8,[`chat`,`at`,`now`])]),_:1},8,[`open`])],64)):p(``,!0)]),_:1})):(m(),T(e,{key:1,title:`Plane`,nav:`plane`},{default:a(()=>[...l[7]||=[x(`p`,{class:`text-sm text-muted`},`The table could not be read.`,-1)]]),_:1}))}}});export{Be as default};
@@ -0,0 +1 @@
1
+ import{t as e}from"./AppShell-CCPwPqvc.js";import{An as t,Cr as n,Dn as r,Fi as i,Jr as a,On as o,_n as s,bn as ee,hr as c,ki as l,o as u,sn as d,vn as f,xn as p,xr as m,yn as h}from"./browser-BWnzWwaT.js";import{_ as g,a as te,c as ne,d as re,g as ie,l as ae,m as _,n as oe,o as v,s as se,u as ce,v as y}from"./main-DYwKyLY5.js";import{t as b}from"./StatusDot-BIAQN7iD.js";var le={class:`mt-4 first:mt-0`},ue={class:`w-full border-collapse font-mono text-[0.8125rem]`},de={class:`border-t border-muted`},fe={class:`px-2 py-1 align-top`},pe={class:`ml-1.5 font-medium`},me={class:`border-t border-muted`},x={class:`break-all px-2 py-1 align-top`},S={key:0},C={key:1,class:`text-dimmed`},w={class:`border-t border-muted`},T={class:`break-all px-2 py-1 align-top`},E={key:0},D={key:1,class:`text-dimmed`},O={class:`border-t border-muted`},k={class:`break-all px-2 py-1 align-top`},A={key:0},j={key:1,class:`text-dimmed`},M={class:`border-t border-muted`},N={class:`break-all px-2 py-1 align-top`},P={key:0},F={key:1,class:`text-dimmed`},I={class:`border-t border-muted`},L={class:`break-all px-2 py-1 align-top`},R={key:1,class:`text-dimmed`},z={class:`mt-4`},he={class:`w-full border-collapse font-mono text-[0.8125rem]`},ge={class:`border-t border-muted`},_e={class:`break-all px-2 py-1 align-top`},ve=[`href`],ye={key:1},be={class:`border-t border-muted`},xe={class:`break-all px-2 py-1 align-top`},Se={class:`border-t border-muted`},Ce={class:`break-all px-2 py-1 align-top`},we=[`href`],Te={key:1},Ee={key:2,class:`text-dimmed`},De={class:`border-t border-muted`},Oe={class:`break-all px-2 py-1 align-top`},ke={key:0},Ae={key:1,class:`text-dimmed`},je={class:`border-t border-muted`},Me={class:`break-all px-2 py-1 align-top`},Ne={key:0},Pe={key:1,class:`text-dimmed`},Fe={class:`border-t border-muted`},Ie={class:`break-all px-2 py-1 align-top`},Le={key:0},Re={key:1,class:`text-dimmed`},ze={class:`mt-4`},Be={class:`w-full border-collapse font-mono text-[0.8125rem]`},Ve={class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},He={class:`break-all px-2 py-1 align-top`},Ue={class:`w-full border-collapse font-mono text-[0.8125rem]`},We={class:`w-32 break-all px-2 py-1 align-top text-muted sm:w-96 sm:break-words`},Ge={class:`px-2 py-1 align-top`},Ke={key:1,class:`text-xs text-muted`},qe={class:`mt-4`},Je={key:0,class:`w-full border-collapse font-mono text-[0.8125rem]`},Ye={class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},B={class:`break-all px-2 py-1 align-top`},Xe={key:0},Ze={key:1,class:`text-dimmed`},Qe={key:1,class:`text-xs text-muted`},$e={class:`mt-4`},et={class:`mb-1 text-xs text-muted`},tt={class:`overflow-x-auto`},nt={class:`w-full border-collapse font-mono text-[0.8125rem]`},rt={class:`break-all px-2 py-1 align-top`},it={key:0,class:`text-xs text-muted`},at={class:`break-all px-2 py-1 align-top`},ot=[`href`],st={key:1},ct={key:2,class:`text-dimmed`},lt={class:`break-all px-2 py-1 align-top`},ut={key:0},dt={key:1,class:`text-dimmed`},ft={key:2},pt={key:3,class:`text-dimmed`},mt={class:`break-all px-2 py-1 align-top`},ht={key:0},gt={key:1,class:`text-dimmed`},_t={key:2},vt={key:3,class:`text-dimmed`},yt={key:1,class:`text-xs text-muted`},bt={class:`mt-4`},xt={class:`w-full border-collapse font-mono text-[0.8125rem]`},St={class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},Ct={class:`px-2 py-1 align-top`},wt={class:`mt-4`},Tt={key:0,class:`w-full border-collapse font-mono text-[0.8125rem]`},Et={class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},Dt={class:`break-all px-2 py-1 align-top`},Ot={class:`text-xs text-muted`},kt={key:1,class:`text-xs text-muted`},At={class:`mt-4`},jt={class:`w-full border-collapse font-mono text-[0.8125rem]`},Mt={class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},Nt={class:`break-all px-2 py-1 align-top`},Pt={key:0},Ft={key:1,class:`text-dimmed`},It={class:`mt-4 text-xs text-muted`},Lt={class:`rounded bg-elevated px-1 py-0.5`},Rt={class:`rounded bg-elevated px-1 py-0.5`},zt={class:`rounded bg-elevated px-1 py-0.5`},V=t({__name:`ResidentDetailPage`,setup(t){let V=u(`resident`),H=s(()=>V?.record??{}),U=s(()=>ne(H.value)),W=s(()=>ae(H.value)||(V?.slug??``)),G=s(()=>_(U.value.sha)),K=s(()=>oe.test(W.value)?`https://github.com/${W.value}`:void 0),q=s(()=>K.value&&/^[0-9a-f]{7,40}$/.test(G.value)?`${K.value}/commit/${G.value}`:void 0),J=s(()=>{let e=U.value.snapshot;return e&&typeof e==`object`?v(e):void 0}),Bt=s(()=>v(U.value.schedules)),Y=s(()=>{let e=v(H.value.commands),t=v(H.value.effects);return Object.keys(e).sort().map(n=>({name:n,command:_(e[n]),effect:_(t[n])||`readonly`}))}),X=s(()=>re(H.value).map(e=>({...e,threadKey:e.threadKey||`?`,ref:e.ref||`?`,sha:e.sha?e.sha.slice(0,8):``,commitHref:K.value&&/^[0-9a-f]{7,40}$/.test(e.sha)?`${K.value}/commit/${e.sha}`:void 0}))),Z=s(()=>X.value.filter(e=>!e.evicted).length),Q=s(()=>{let e=U.value.lastRestore;return e?JSON.stringify(e):``}),$=s(()=>se(H.value)),Vt=s(()=>typeof H.value.diskBudgetMb==`number`?H.value.diskBudgetMb:void 0),Ht=s(()=>{let e=$.value;if(!e)return[];let t=te(e,Vt.value),n=n=>{let r=t.room[n];return r===null?y(e.parts,n)===null?`? (checkout not measured)`:`?`:`${r} more (${g(y(e.parts,n))} each)`};return[[`used / total`,ie(e)],[`free`,`${g(t.freeKiB)}${t.capped?` under the ${g(t.capacityKiB)} diskBudgetMb cap`:``}`],[`reserve`,`${g(t.reserve.totalKiB)} (snapshot staging ${g(t.reserve.stagingKiB)} + floor ${g(t.reserve.floorKiB)})`],[`headroom`,`${g(t.headroomKiB)} — room for ${n(`hardlink`)} hardlinked trees, ${n(`reconcile`)} lockfile-diverged (reconciling)`],[`measured`,e.at||`—`]]}),Ut=s(()=>{let e=$.value;if(!e)return[];let t=[[`mirror`,g(e.parts.mirror)],[`checkout deps (node_modules)`,g(e.parts.deps)],[`checkout (history + tree + build)`,g(e.parts.checkout)]];for(let[n,r]of Object.entries(e.parts.threads).sort((e,t)=>t[1]-e[1]))t.push([`thread ${n}`,g(r)]);for(let[n,r]of Object.entries(e.parts.homes).sort((e,t)=>t[1]-e[1]))r>=1024&&t.push([`home ${n}`,g(r)]);return t.push([`other (image, /tmp, …)`,g(e.parts.other)]),t});return(t,s)=>{let u=n(`RouterLink`);return c(),h(e,{title:W.value||`Resident`,nav:`residents`},{leading:a(()=>[o(u,{class:`back text-sm text-muted no-underline hover:text-primary`,to:`/residents`},{default:a(()=>[...s[0]||=[r(`← All residents`,-1)]]),_:1})]),default:a(()=>[f(`section`,le,[s[8]||=f(`h2`,{class:`mb-1.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},`Lifecycle`,-1),f(`table`,ue,[f(`tbody`,null,[f(`tr`,de,[s[1]||=f(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`state`,-1),f(`td`,fe,[o(b,{tone:l(ce)(U.value.state),label:U.value.state},null,8,[`tone`,`label`]),f(`span`,pe,i(U.value.state),1)])]),f(`tr`,me,[s[2]||=f(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`reason`,-1),f(`td`,x,[U.value.reason?(c(),p(`span`,S,i(U.value.reason),1)):(c(),p(`span`,C,`—`))])]),f(`tr`,w,[s[3]||=f(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`last refresh error`,-1),f(`td`,T,[l(_)(U.value.lastRefreshError)?(c(),p(`span`,E,i(l(_)(U.value.lastRefreshError)),1)):(c(),p(`span`,D,`—`))])]),f(`tr`,O,[s[4]||=f(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`last restore`,-1),f(`td`,k,[Q.value?(c(),p(`span`,A,i(Q.value),1)):(c(),p(`span`,j,`—`))])]),f(`tr`,M,[s[5]||=f(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`state updated`,-1),f(`td`,N,[l(_)(U.value.updatedAt)?(c(),p(`span`,P,i(l(_)(U.value.updatedAt)),1)):(c(),p(`span`,F,`—`))])]),f(`tr`,I,[s[7]||=f(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`idle since`,-1),f(`td`,L,[l(_)(U.value.idleSince)?(c(),p(d,{key:0},[r(i(l(_)(U.value.idleSince))+` `,1),s[6]||=f(`span`,{class:`text-xs text-muted`},`(refresh parked; container may sleep)`,-1)],64)):(c(),p(`span`,R,`awake`))])])])])]),f(`section`,z,[s[15]||=f(`h2`,{class:`mb-1.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},`Pinned facts`,-1),f(`table`,he,[f(`tbody`,null,[f(`tr`,ge,[s[9]||=f(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`repository`,-1),f(`td`,_e,[K.value?(c(),p(`a`,{key:0,class:`text-primary`,href:K.value},i(K.value),9,ve)):(c(),p(`span`,ye,i(l(_)(H.value.resource)||`—`),1))])]),f(`tr`,be,[s[10]||=f(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`default ref`,-1),f(`td`,xe,i(l(_)(U.value.defaultRef)||l(_)(H.value.defaultRef)||`—`),1)]),f(`tr`,Se,[s[11]||=f(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`pinned sha`,-1),f(`td`,Ce,[q.value?(c(),p(`a`,{key:0,class:`text-primary`,href:q.value},i(G.value),9,we)):G.value?(c(),p(`span`,Te,i(G.value),1)):(c(),p(`span`,Ee,`—`))])]),f(`tr`,De,[s[12]||=f(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`lockfile hash`,-1),f(`td`,Oe,[l(_)(U.value.lockfileHash)?(c(),p(`span`,ke,i(l(_)(U.value.lockfileHash)),1)):(c(),p(`span`,Ae,`—`))])]),f(`tr`,je,[s[13]||=f(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`provisioned`,-1),f(`td`,Me,[l(_)(U.value.provisionedAt)?(c(),p(`span`,Ne,i(l(_)(U.value.provisionedAt)),1)):(c(),p(`span`,Pe,`—`))])]),f(`tr`,Fe,[s[14]||=f(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`last refresh`,-1),f(`td`,Ie,[l(_)(U.value.lastRefreshAt)?(c(),p(`span`,Le,i(l(_)(U.value.lastRefreshAt)),1)):(c(),p(`span`,Re,`—`))])])])])]),f(`section`,ze,[s[17]||=f(`h2`,{class:`mb-1.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},`Disk`,-1),$.value?(c(),p(d,{key:0},[f(`table`,Be,[f(`tbody`,null,[(c(!0),p(d,null,m(Ht.value,([e,t])=>(c(),p(`tr`,{key:e,class:`border-t border-muted`},[f(`td`,Ve,i(e),1),f(`td`,He,i(t),1)]))),128))])]),s[16]||=f(`p`,{class:`mb-1 mt-2 text-xs text-muted`},` components (one du, hardlinks counted once — a thread tree shows only what it does not share with the checkout) `,-1),f(`table`,Ue,[f(`tbody`,null,[(c(!0),p(d,null,m(Ut.value,([e,t])=>(c(),p(`tr`,{key:e,class:`border-t border-muted`},[f(`td`,We,i(e),1),f(`td`,Ge,i(t),1)]))),128))])])],64)):(c(),p(`p`,Ke,` not measured yet — the first refresh cycle or attach of this container measures it `))]),f(`section`,qe,[s[18]||=f(`h2`,{class:`mb-1.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},`Snapshot stamp`,-1),J.value?(c(),p(`table`,Je,[f(`tbody`,null,[(c(),p(d,null,m([`ref`,`sha`,`lockfileHash`,`createdAt`,`mirrorBackupId`,`checkoutBackupId`],e=>f(`tr`,{key:e,class:`border-t border-muted`},[f(`td`,Ye,i(e),1),f(`td`,B,[l(_)(J.value[e])?(c(),p(`span`,Xe,i(l(_)(J.value[e])),1)):(c(),p(`span`,Ze,`—`))])])),64))])])):(c(),p(`p`,Qe,`no snapshot recorded`))]),f(`section`,$e,[s[22]||=f(`h2`,{class:`mb-1.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},`Thread worktrees`,-1),X.value.length>0?(c(),p(d,{key:0},[f(`p`,et,i(Z.value)+` live · `+i(X.value.length-Z.value)+` evicted`,1),f(`div`,tt,[f(`table`,nt,[f(`tbody`,null,[s[21]||=f(`tr`,{class:`text-xs text-muted`},[f(`td`,{class:`px-2 py-1`},`thread`),f(`td`,{class:`px-2 py-1`},`ref · sha`),f(`td`,{class:`px-2 py-1`},`user · deps`),f(`td`,{class:`px-2 py-1`},`bound · last attach`)],-1),(c(!0),p(d,null,m(X.value,e=>(c(),p(`tr`,{key:e.threadKey,class:`border-t border-muted`},[f(`td`,rt,[e.evicted?(c(),p(`span`,it,[r(`evicted `+i(e.evictedAt||`—`),1),e.evictedWhy?(c(),p(d,{key:0},[r(` · `+i(e.evictedWhy),1)],64)):ee(``,!0)])):(c(),h(b,{key:1,tone:`green`,label:`live`,tip:`live`})),r(` `+i(e.threadKey),1)]),f(`td`,at,[r(i(e.ref)+` · `,1),e.commitHref?(c(),p(`a`,{key:0,class:`text-primary`,href:e.commitHref},i(e.sha),9,ot)):e.sha?(c(),p(`span`,st,i(e.sha),1)):(c(),p(`span`,ct,`—`))]),f(`td`,lt,[e.user?(c(),p(`span`,ut,i(e.user),1)):(c(),p(`span`,dt,`—`)),s[19]||=r(` · `,-1),e.deps?(c(),p(`span`,ft,i(e.deps),1)):(c(),p(`span`,pt,`—`))]),f(`td`,mt,[e.boundAt?(c(),p(`span`,ht,i(e.boundAt),1)):(c(),p(`span`,gt,`—`)),s[20]||=r(` · `,-1),e.lastAttachAt?(c(),p(`span`,_t,i(e.lastAttachAt),1)):(c(),p(`span`,vt,`—`))])]))),128))])])])],64)):(c(),p(`p`,yt,`no thread worktrees`))]),f(`section`,bt,[s[23]||=f(`h2`,{class:`mb-1.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},`Pending schedules`,-1),f(`table`,xt,[f(`tbody`,null,[(c(),p(d,null,m([[`refresh`,`refresh`],[`provision run`,`provisionRun`],[`provision deadline`,`provisionDeadline`]],([e,t])=>f(`tr`,{key:t,class:`border-t border-muted`},[f(`td`,St,i(e),1),f(`td`,Ct,i(l(_)(Bt.value[t]??0)||`0`),1)])),64))])])]),f(`section`,wt,[s[25]||=f(`h2`,{class:`mb-1.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},`Command table`,-1),Y.value.length>0?(c(),p(`table`,Tt,[f(`tbody`,null,[(c(!0),p(d,null,m(Y.value,e=>(c(),p(`tr`,{key:e.name,class:`border-t border-muted`},[f(`td`,Et,i(e.name),1),f(`td`,Dt,[f(`code`,null,i(e.command),1),s[24]||=r(),f(`span`,Ot,i(e.effect),1)])]))),128))])])):(c(),p(`p`,kt,`no command table`))]),f(`section`,At,[s[26]||=f(`h2`,{class:`mb-1.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},`Registry settings`,-1),f(`table`,jt,[f(`tbody`,null,[(c(!0),p(d,null,m([[`onboarded`,l(_)(H.value.onboardedAt)],[`record updated`,l(_)(H.value.updatedAt)],[`provisioning timeout (ms)`,l(_)(H.value.provisioningTimeoutMs)],[`disk budget (MB)`,l(_)(H.value.diskBudgetMb)],[`worktree TTL (days)`,l(_)(H.value.worktreeTtlDays??7)]],([e,t])=>(c(),p(`tr`,{key:e,class:`border-t border-muted`},[f(`td`,Mt,i(e),1),f(`td`,Nt,[t?(c(),p(`span`,Pt,i(t),1)):(c(),p(`span`,Ft,`—`))])]))),128))])])]),f(`p`,It,[s[27]||=r(` Manage from chat: `,-1),f(`code`,Lt,`repo rebuild `+i(W.value),1),s[28]||=r(` · `,-1),f(`code`,Rt,`repo reconfigure `+i(W.value)+` …`,1),s[29]||=r(` · `,-1),f(`code`,zt,`repo offboard `+i(W.value)+` --dry-run`,1)])]),_:1},8,[`title`])}}});export{V as default};
@@ -0,0 +1 @@
1
+ import{t as e}from"./AppShell-CCPwPqvc.js";import{An as t,Cr as n,Dn as r,Fi as i,Jr as a,Mi as o,On as s,Ur as c,_i as l,_n as u,bn as d,hr as f,ki as p,lr as m,o as h,pr as g,sn as _,t as v,tn as y,vn as b,xn as x,xr as S,yi as C,yn as w}from"./browser-BWnzWwaT.js";import{t as ee}from"./Tooltip-CxiQ7luL.js";import{_ as T,a as E,c as D,d as O,f as k,g as A,h as j,i as M,l as N,m as P,n as F,p as I,r as L,s as te,u as ne,y as R}from"./main-DYwKyLY5.js";import{t as z}from"./eventSource-Ds6_gjPD.js";import{t as B}from"./wallClock-DaewxNMY.js";import{n as V,r as re}from"./indexFormat-B-pd4r7Y.js";import{A as ie,C as H,D as ae,S as oe,a as se,c as ce,i as le,l as ue,t as de,x as fe}from"./indexRow-BGjjLnN5.js";import"./format-BldUwl_R.js";import{t as U}from"./StatusDot-BIAQN7iD.js";var pe=[`data-slug`,`data-running`],me=[`open`],he={class:`row flex cursor-pointer list-none flex-wrap items-baseline gap-x-2.5 gap-y-1 rounded-md px-2 py-2 hover:bg-elevated [&::-webkit-details-marker]:hidden`},ge={class:`self-center`},_e={class:`font-mono text-[0.9375rem] font-medium text-highlighted`},ve={class:`text-sm text-toned`},ye={key:0,class:`running shrink-0 rounded border border-ok/25 bg-ok/8 px-1.5 font-mono text-[0.68rem] font-medium tabular-nums text-ok`},be=[`title`],xe={key:2,class:`basis-full pl-[1.9rem] text-xs text-warn`},Se={class:`fold pb-3 pl-[1.9rem] pr-2 pt-0.5`},Ce={key:0,class:`m-0 list-none divide-y divide-(--ui-border-muted) p-0`},we=[`data-run-id`,`data-thread`],Te={class:`pt-[0.3rem]`},Ee={class:`what min-w-0`},De={class:`flex min-w-0 items-baseline gap-2`},Oe=[`title`],ke={key:0,class:`who block truncate text-xs text-dimmed`},Ae=[`href`],je={key:1,class:`who block text-xs text-dimmed`},Me={class:`min-w-0 font-mono text-xs max-sm:col-span-2 max-sm:col-start-2 max-sm:row-start-2`},Ne=[`title`],Pe=[`href`],Fe={key:1},Ie={key:1,class:`font-sans text-dimmed`},Le={key:0,class:`facts-tree block truncate text-dimmed`},Re={class:`user`},ze={class:`deps`},Be=[`title`],Ve={class:`flex items-baseline gap-3 justify-self-end max-sm:col-start-3 max-sm:row-start-1`},He=[`title`],Ue={key:1,class:`py-1 text-xs text-dimmed`},We=[`data-idle`],Ge={key:1},W=t({__name:`ResidentRow`,props:{record:{},runs:{},now:{},open:{type:Boolean}},setup(e){let t=e,l=C(t.open===!0);c(()=>t.open,e=>{e&&(l.value=!0)});function m(e){l.value=e.target.open}let h=u(()=>N(t.record)),g=u(()=>h.value||P(t.record.resource)||`?`),v=u(()=>D(t.record)),ee=u(()=>ne(v.value.state)),k=u(()=>F.test(h.value)?`/residents/${h.value}`:null),I=u(()=>F.test(h.value)?`https://github.com/${h.value}`:void 0),L=e=>I.value&&/^[0-9a-f]{7,40}$/.test(e)?`${I.value}/commit/${e}`:void 0,R=u(()=>P(t.record.defaultRef)||`?`),z=u(()=>P(v.value.sha).slice(0,8)),B=u(()=>P(v.value.lastRefreshAt)),W=e=>{let n=e?Date.parse(e):NaN;return Number.isFinite(n)?V(n,t.now):e||`—`},G=u(()=>B.value?W(B.value):``),K=u(()=>te(t.record)),q=u(()=>K.value?A(K.value):``),J=u(()=>{let e=K.value;if(!e)return null;let n=typeof t.record.diskBudgetMb==`number`?t.record.diskBudgetMb:void 0;return E(e,n)}),Y=u(()=>[`ref ${R.value}`,z.value,G.value?`refreshed ${G.value}`:``,q.value?`disk ${q.value}`:``].filter(Boolean).join(` · `)),X=u(()=>[B.value?`refreshed ${B.value}`:``,K.value?.at?`disk measured ${K.value.at}`:``].filter(Boolean).join(` · `)),Z=u(()=>{let e=K.value,t=J.value;if(!e||!t)return``;let n=t.room.hardlink===null?`room not projected (checkout not measured)`:`room for ${t.room.hardlink} more ${t.room.hardlink===1?`tree`:`trees`}`;return[`${T(t.freeKiB)} free${t.capped?` under the ${T(t.capacityKiB)} cap`:``}`,n,`measured ${W(e.at)}`].join(` · `)}),Q=u(()=>O(t.record)),$=u(()=>{let e=t.runs.map(e=>{let n=re(e.label||H(e.id)),r=M(Q.value,e.threadKey),i=ie(e);return{key:`run:${e.id}`,run:e,agent:n.agent,text:n.snippet??n.scope,who:i.identity,surface:le[i.kind]??i.kind,threadUrl:oe(e),href:fe(e),elapsed:ue(e,t.now),binding:r,treeKiB:r?j(K.value,r.threadKey):null}}),n=new Set(t.runs.map(e=>e.threadKey));for(let t of Q.value)t.evicted||n.has(t.threadKey)||e.push({key:`idle:${t.threadKey}`,text:`idle`,who:``,surface:``,threadUrl:``,href:``,elapsed:``,binding:t,treeKiB:j(K.value,t.threadKey)});return e}),Ke=u(()=>$.value.filter(e=>!e.run).length);return(t,c)=>{let u=n(`RouterLink`);return f(),x(`li`,{class:`resident border-b border-muted first:border-t`,"data-slug":h.value,"data-running":e.runs.length},[b(`details`,{class:`group/fold`,open:l.value,onToggle:m},[b(`summary`,he,[c[2]||=b(`span`,{class:`chev w-3 select-none self-center text-xs text-dimmed transition-transform group-open/fold:rotate-90 motion-reduce:transition-none`,"aria-hidden":`true`},`❯`,-1),b(`span`,ge,[s(U,{tone:ee.value,label:v.value.state,tip:v.value.state},null,8,[`tone`,`label`,`tip`])]),b(`span`,_e,i(g.value),1),b(`span`,ve,i(v.value.state),1),e.runs.length>0?(f(),x(`span`,ye,i(e.runs.length)+` running`,1)):d(``,!0),b(`span`,{class:`facts font-mono text-xs text-muted max-sm:basis-full max-sm:pl-[1.9rem] sm:ml-2`,title:X.value||void 0},i(Y.value),9,be),k.value?(f(),w(u,{key:1,class:`detail ml-auto shrink-0 text-xs text-muted no-underline hover:text-highlighted hover:underline`,to:k.value,onClick:c[0]||=y(()=>{},[`stop`])},{default:a(()=>[...c[1]||=[r(`detail ↗`,-1)]]),_:1},8,[`to`])):d(``,!0),v.value.reason?(f(),x(`span`,xe,i(v.value.reason),1)):d(``,!0)]),b(`div`,Se,[$.value.length>0?(f(),x(`ul`,Ce,[(f(!0),x(_,null,S($.value,t=>(f(),x(`li`,{key:t.key,class:o([`grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-x-3 gap-y-1 py-2 sm:grid-cols-[auto_minmax(0,1fr)_minmax(14rem,22rem)_auto]`,t.run?`run`:`idle`]),"data-run-id":t.run?.id,"data-thread":t.run?void 0:t.binding?.threadKey},[b(`span`,Te,[t.run?(f(),w(U,{key:0,tone:`green`,label:p(ae)(t.run),tip:p(ce)(t.run),pulse:``},null,8,[`label`,`tip`])):(f(),w(U,{key:1,tone:`grey`,label:`idle`,tip:`no run is using this tree`}))]),b(`span`,Ee,[b(`span`,De,[t.agent?(f(),x(`span`,{key:0,class:o([`agent shrink-0 rounded border px-1.5 font-mono text-[0.65rem] font-medium uppercase tracking-wider`,p(de)[p(se)(t.agent)]])},i(t.agent),3)):d(``,!0),b(`span`,{class:o([`text min-w-0 truncate text-[0.8125rem]`,t.run?`text-highlighted`:`text-dimmed`]),title:t.run?t.text:void 0},i(t.text),11,Oe)]),t.run?(f(),x(`span`,ke,[t.who?(f(),x(_,{key:0},[r(`by `+i(t.who),1)],64)):d(``,!0),t.who&&(t.threadUrl||t.surface)?(f(),x(_,{key:1},[r(i(` · `))],64)):d(``,!0),t.threadUrl?(f(),x(`a`,{key:2,class:`text-muted no-underline hover:text-highlighted hover:underline`,href:t.threadUrl,target:`_blank`,rel:`noopener noreferrer`},i(t.surface)+` thread ↗`,9,Ae)):t.surface?(f(),x(_,{key:3},[r(`via `+i(t.surface),1)],64)):d(``,!0)])):t.binding?(f(),x(`span`,je,`last used `+i(W(t.binding.lastAttachAt)),1)):d(``,!0)]),b(`span`,Me,[b(`span`,{class:`tree block truncate text-toned`,title:t.binding&&t.binding.ref||void 0},[t.binding?(f(),x(_,{key:0},[r(i(t.binding.ref||`?`),1),t.binding.sha?(f(),x(_,{key:0},[c[3]||=r(i(` `),-1),c[4]||=b(`span`,{class:`text-dimmed`},`@`,-1),c[5]||=r(i(` `)+` `,-1),L(t.binding.sha)?(f(),x(`a`,{key:0,class:`text-highlighted no-underline hover:underline`,href:L(t.binding.sha)},i(t.binding.sha.slice(0,8)),9,Pe)):(f(),x(`span`,Fe,i(t.binding.sha.slice(0,8)),1))],64)):d(``,!0)],64)):(f(),x(`span`,Ie,`no worktree bound yet`))],8,Ne),t.binding?(f(),x(`span`,Le,[b(`span`,Re,i(t.binding.user||`—`),1),c[6]||=r(` `+i(` · `),-1),b(`span`,ze,i(t.binding.deps||`—`),1),c[7]||=r(` `+i(` · `),-1),b(`span`,{class:o([`size`,t.treeKiB===null?``:`text-muted`]),title:t.treeKiB===null?`size not measured yet`:`on disk`},i(t.treeKiB===null?`—`:p(T)(t.treeKiB)),11,Be)])):d(``,!0)]),b(`span`,Ve,[t.run?(f(),x(`span`,{key:0,class:`elapsed whitespace-nowrap font-mono text-xs tabular-nums text-ok`,title:`running for · started ${p(V)(t.run.startedAt,e.now)}`},i(t.elapsed),9,He)):d(``,!0),t.run?(f(),w(u,{key:1,class:`open text-xs text-muted no-underline hover:text-highlighted hover:underline`,to:t.href,"aria-label":`open run ${t.run.label||p(H)(t.run.id)}`},{default:a(()=>[...c[8]||=[r(`open ↗`,-1)]]),_:1},8,[`to`,`aria-label`])):d(``,!0)])],10,we))),128))])):(f(),x(`p`,Ue,`nothing on this resident — no run, no worktree`)),b(`p`,{class:`disk mt-2 font-mono text-xs text-dimmed`,"data-idle":Ke.value},[Z.value?(f(),x(_,{key:0},[r(i(Z.value),1)],64)):(f(),x(`span`,Ge,`disk not measured yet`))],8,We)])],40,me)],8,pe)}}}),G={class:`conn flex items-center gap-1.5`},K={id:`state`,class:`text-xs text-muted`},q={class:`mb-2 text-xs text-muted`},J={id:`running`,class:`font-mono tabular-nums`},Y={id:`residents`,class:`m-0 list-none p-0`},X={key:1,class:`px-2 py-1.5 text-muted`},Z=`Resident repos`,Q=t({__name:`ResidentsIndexPage`,setup(t){let n=h(`residents`),o=l({cap:n?.cap,count:n?.count,residents:n?.residents??[],runs:new Map((n?.runs??[]).map(e=>[e.id,e]))}),d=B(n?.now),y=C({tone:`amber`,text:`connecting…`}),T=typeof window<`u`?new URLSearchParams(window.location.search).get(`open`):null,E=u(()=>o.residents.map((e,t)=>{let n=e,r=N(n);return{key:`${r||`?`}-${t}`,record:n,slug:r,runs:I(o.runs.values(),r)}})),D=u(()=>P(o.cap)||`?`),O=u(()=>P(o.count)||String(E.value.length)),A=u(()=>E.value.reduce((e,t)=>e+t.runs.length,0));c([A,()=>o.residents],([e,t])=>{v.setTitle((e>0?`(${e}) `:``)+Z),v.setFavicon(R[k(t)])},{immediate:!0});let j=z(),M=null;return m(()=>{M=j(`/residents?stream=1`);let e=!1;M.onopen=()=>{if(e){v.reload();return}e=!0,y.value={tone:`green`,text:`live`}},M.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}L(o,t)},M.onerror=()=>{M&&M.readyState===2?y.value={tone:`red`,text:`disconnected`}:y.value={tone:`amber`,text:`connecting…`}}}),g(()=>{M?.close()}),(t,n)=>{let o=ee;return f(),w(e,{title:Z,nav:`residents`},{status:a(()=>[s(o,{text:`runs arrive from the registry feed; the listing is re-read when a run attaches or ends`},{default:a(()=>[b(`span`,G,[s(U,{tone:y.value.tone,label:y.value.text},null,8,[`tone`,`label`]),b(`span`,K,i(y.value.text),1)])]),_:1})]),default:a(()=>[E.value.length>0?(f(),x(_,{key:0},[b(`p`,q,[r(i(`${O.value}/${D.value} resident slots in use · `),1),b(`span`,J,i(A.value)+` running`,1)]),b(`ul`,Y,[(f(!0),x(_,null,S(E.value,e=>(f(),w(W,{key:e.key,record:e.record,runs:e.runs,now:p(d),open:p(T)!==null&&p(T)===e.slug},null,8,[`record`,`runs`,`now`,`open`]))),128))])],64)):(f(),x(`p`,X,[r(` No repos onboarded (0/`+i(D.value)+`). Onboard one from chat: `,1),n[0]||=b(`code`,{class:`rounded bg-elevated px-1.5 py-0.5`},`repo onboard <owner/name>`,-1),n[1]||=r(`. `,-1)]))]),_:1})}}});export{Q as default};
@@ -1 +1 @@
1
- import{An as e,Cn as t,Cr as n,Gr as r,Ii as i,Li as a,Mn as o,Pi as s,Sn as c,Tr as l,Xr as u,_r as d,bn as f,dr as p,ir as m,ji as h,kn as g,ln as _,rn as v,t as y,xi as b,xn as x,yn as S}from"./browser-CCImen5O.js";import{r as C,t as w}from"./indexFormat-B-pd4r7Y.js";import{B as T,C as E,D,E as O,G as k,I as A,K as j,L as M,M as N,R as ee,T as te,U as ne,a as P,c as F,l as I,o as L,t as R,x as re,z as ie}from"./indexRow-BsWcHHVh.js";import"./format-BldUwl_R.js";import{n as ae}from"./SlackMark-DB0MGiF5.js";import{c as oe,l as se,n as ce,t as le,w as z}from"./sseReplay-DuALaBPq.js";import{n as ue,t as de}from"./durationTone-CVpX_yIk.js";import{t as B}from"./StatusDot-DyFjGg4V.js";var fe={merged:`merged`,closed:`closed`,already_landed:`merged`,merge_ready:`merge-ready`,held:`held`,merge_refused:`not merged`,round_cap:`round cap reached`,wall_clock_cap:`out of budget`,review_pending:`review pending`,stopped:`stopped`,aborted:`aborted`,transient:`aborted`,continued:`continuing`,no_verdict:`no verdict`,interrupted:`interrupted`,refused:`refused`,idle:`idle`,idle_expired:`idle expired`,blocked:`blocked`,failed:`failed`};function pe(e){return fe[e]??e}var me={},he={viewBox:`0 0 16 16`,class:`inline-block size-[1em] shrink-0`,"aria-hidden":`true`};function ge(e,n){return d(),t(`svg`,he,[...n[0]||=[f(`path`,{fill:`currentColor`,d:`M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z`},null,-1)]])}var _e=ae(me,[[`render`,ge]]),V={"getting ready":`paint-ready`,thinking:`paint-thinking`,"in tools":`paint-tools`,"finishing up":`paint-finishing`,"Switchboard overhead":`paint-overhead`,"not recorded":`paint-lost`,"not loaded":`paint-elided`},ve={getting_ready:`getting ready`,finishing_up:`finishing up`};function ye(e){return V[ve[e]]}var be={id:`timeline`,class:`block mb-4 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`,"data-testid":`timeline`},xe={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},Se={class:`ml-auto flex items-baseline gap-3 font-normal normal-case tracking-normal`},Ce=[`href`],we={class:`lede font-mono text-sm text-toned`},Te={class:`shape tabular-nums`},Ee={key:0,class:`current text-muted`},De={key:0,class:`note mt-0.5 text-xs text-muted`},Oe=[`aria-label`],ke=[`title`,`data-term`],Ae={class:`legend mt-2 flex flex-wrap gap-x-4 gap-y-1 font-mono text-xs`},je=[`title`,`data-term`],Me={class:`term text-muted`},Ne={class:`ms tabular-nums text-toned`},Pe=[`title`],Fe={class:`ranked mt-1 flex flex-col gap-1 font-mono text-xs`},Ie={class:`ms w-14 shrink-0 tabular-nums text-toned`},Le=[`href`,`data-anchor`,`onClick`],Re=[`title`],ze={class:`cut mt-1 flex flex-col gap-1 font-mono text-xs`},Be={class:`ms w-14 shrink-0 tabular-nums text-toned`},Ve=[`href`,`data-anchor`,`onClick`],H=o({__name:`TimelineSection`,props:{vm:{},eventsHref:{}},emits:[`reveal`],setup(e,{emit:r}){let o=e,l=r;function u(e){return`${j(e.ms,`clock`)} ${e.term}${e.hatched?` (in flight)`:``}`}function p(){y.copyText(JSON.stringify(o.vm.debug,null,2))}return(r,o)=>(d(),t(`section`,be,[f(`h2`,xe,[o[0]||=f(`span`,null,`Where the time went`,-1),f(`span`,Se,[e.eventsHref?(d(),t(`a`,{key:0,class:`text-dimmed no-underline hover:text-primary hover:underline`,href:e.eventsHref,title:`the stored events, as JSON lines`},`raw events`,8,Ce)):c(``,!0),f(`button`,{type:`button`,class:`debug cursor-pointer text-dimmed hover:text-toned`,title:`the partition and the raw span names, for a bug report`,onClick:p},` Copy debug JSON `)])]),f(`p`,we,[f(`span`,Te,a(e.vm.shown?e.vm.total:e.vm.lede),1),e.vm.current?(d(),t(`span`,Ee,` · `+a(e.vm.current),1)):c(``,!0)]),(d(!0),t(_,null,n(e.vm.captions,e=>(d(),t(`p`,{key:e,class:`caption mt-0.5 text-xs text-muted`},a(e),1))),128)),e.vm.note?(d(),t(`p`,De,a(e.vm.note),1)):c(``,!0),e.vm.shown?(d(),t(_,{key:1},[f(`div`,{class:`bar mt-2.5 flex h-2 w-full overflow-hidden rounded-sm`,role:`img`,"aria-label":e.vm.lede},[(d(!0),t(_,null,n(e.vm.bar,(e,n)=>(d(),t(`div`,{key:n,class:s([`seg h-full`,[h(V)[e.term],e.hatched?`paint-hatched hatched`:``]]),style:i({width:`${e.pct}%`}),title:u(e),"data-term":e.term},null,14,ke))),128))],8,Oe),f(`ul`,Ae,[(d(!0),t(_,null,n(e.vm.legend,e=>(d(),t(`li`,{key:e.term,class:`flex items-baseline gap-1.5 cursor-help`,title:e.definition,"data-term":e.term},[f(`span`,{class:s([`swatch inline-block size-2 shrink-0 self-center rounded-[2px]`,h(V)[e.term]])},null,2),f(`span`,Me,a(e.term),1),f(`span`,Ne,a(e.text),1)],8,je))),128))]),e.vm.ranked.length>0?(d(),t(_,{key:0},[f(`h3`,{class:`ranked-head mt-3 inline-block cursor-help text-xs font-medium text-muted underline decoration-dotted decoration-(--ui-border-accented) underline-offset-2`,title:e.vm.rankedNote},` Longest steps `,8,Pe),f(`ol`,Fe,[(d(!0),t(_,null,n(e.vm.ranked,(e,r)=>(d(),t(`li`,{key:r,class:`flex items-baseline gap-2`},[f(`span`,Ie,a(h(j)(e.ms,`clock`)),1),f(`a`,{class:`label min-w-0 truncate text-muted no-underline hover:text-primary hover:underline`,href:`#${e.anchor}`,"data-anchor":e.anchor,title:`scroll to this step`,onClick:v(t=>l(`reveal`,e.anchor),[`prevent`])},a(e.label),9,Le),(d(!0),t(_,null,n(e.facts,e=>(d(),t(`span`,{key:e,class:`fact shrink-0 rounded border border-accented px-1 text-dimmed`},a(e),1))),128))]))),128))])],64)):c(``,!0),e.vm.cut.length>0?(d(),t(_,{key:1},[f(`h3`,{class:`cut-head mt-3 block cursor-help text-xs font-medium text-muted underline decoration-dotted decoration-(--ui-border-accented) underline-offset-2`,title:e.vm.cutNote},` Cut steps `,8,Re),f(`ol`,ze,[(d(!0),t(_,null,n(e.vm.cut,(e,r)=>(d(),t(`li`,{key:r,class:`flex items-baseline gap-2`},[f(`span`,Be,a(h(j)(e.ms,`clock`)),1),f(`a`,{class:`label min-w-0 truncate text-muted no-underline hover:text-primary hover:underline`,href:`#${e.anchor}`,"data-anchor":e.anchor,title:`scroll to this step`,onClick:v(t=>l(`reveal`,e.anchor),[`prevent`])},a(e.label),9,Ve),(d(!0),t(_,null,n(e.facts,e=>(d(),t(`span`,{key:e,class:`fact shrink-0 rounded border border-accented px-1 text-dimmed`},a(e),1))),128))]))),128))])],64)):c(``,!0)],64)):c(``,!0)]))}}),U={"getting ready":`before the agent's first turn: reading the thread, finding the repo, checking out, loading tools`,thinking:`the model's turns — from a request to the model until its reply came back`,"in tools":`the commands and tool calls the model ran`,"finishing up":`after the agent's last turn: posting the PR, checking the workspace`,"Switchboard overhead":`orchestration between steps, and moments when only a background read was running — the time no step claims`,"not recorded":`a stretch of the run the record does not carry`,"not loaded":`a stretch of the run this page did not load — the record has the full shape`},W=`Ranked by each step's own time, its children excluded — the bar counts every instant once.`,G=`Steps still open when the run ended: closed at the run's terminal event and left out of the ranking — the time shown is the cut, not a measurement.`;function He(e){let t=e===`interrupted`?`the interruption`:e===`failed`?`the failure`:e===`stopped_hard`?`the hard stop`:e===`stopped_soft`?`the stop`:void 0;return t?`cut by ${t}`:`cut at the run's end`}var Ue=`currently delivering`,We=`getting ready: not recorded (too large)`,Ge=`no timing data`,Ke=`not loaded (the record has the full shape)`,K={getting_ready:`getting ready`,thinking:`thinking`,tools:`in tools`,finishing_up:`finishing up`};function q(e){let{spans:t,window:n,owner:r}=e,i=e.phase!==`live`,a=ee(t,{window:n,owner:r,finished:i,losses:e.losses}),o=ie(a),s=j(o.totalS*1e3,`clock`),c=t.find(e=>e.name===`request`&&e.parentSpanId===void 0),l=e.phase===`live`?Je(t,r,n):void 0,u=Ye(e,l),d=l?z(l.name):``,f={window:n,owner:r,phase:e.phase,partition:a,spans:t.map(e=>({spanId:e.spanId,parentSpanId:e.parentSpanId,name:e.name,startedAt:e.startedAt,endedAt:e.endedAt,status:e.status,attrs:e.attrs}))};if(e.untimed)return{total:s,current:u,openStep:d,captions:[],rankedNote:W,cut:[],cutNote:G,debug:f,lede:s,shown:!1,bar:[],legend:[],ranked:[],note:Ge};let p=qe(c,`restartOfRunId`),m={total:s,current:u,openStep:d,captions:[p===void 0?void 0:`restarted from run ${p}`,A(`before`,J(c,`queuedBeforeMs`)),p===void 0?A(`behind`,J(c,`queuedBehindMs`)):void 0].filter(e=>e!==void 0),rankedNote:W,cutNote:G,debug:f};if(!c)return{...m,lede:s,shown:!1,bar:[],legend:[],ranked:[],cut:[],note:i?We:``};let h=t=>t===`not recorded`?`not recorded${e.truncated?` (too large)`:``}`:t===`not loaded`?Ke:t,g=M(a)&&o.items.length>0,_=g?`${s} — ${o.items.map(({term:e,s:t})=>`${j(t*1e3,`clock`)} ${h(e)}`).join(` · `)}`:a.windowMs>0?`${s} — ${h(Xe(a))}`:s,v=g?o.items.map(({term:t,s:n})=>({term:t,text:j(n*1e3,`clock`),definition:t===`not recorded`&&e.truncated?`${U[t]} (too large)`:U[t]})):[],y=g?Qe(t,c,r,n,e.callTitle,e.phase===`ended`,He(e.endedBy)):{ranked:[],cut:[]};return{...m,lede:_,shown:g,bar:g?Ze(a,l):[],legend:v,ranked:y.ranked,cut:y.cut,note:``}}function J(e,t){let n=e?.attrs[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function qe(e,t){let n=e?.attrs[t];return typeof n==`string`&&n!==``?n:void 0}function Je(e,t,n){let r=new Map(e.map(e=>[e.spanId,e])),i=e=>{let t=1,n=new Set([e.spanId]),i=e.parentSpanId?r.get(e.parentSpanId):void 0;for(;i&&!n.has(i.spanId);)n.add(i.spanId),t++,i=i.parentSpanId?r.get(i.parentSpanId):void 0;return t},a;for(let o of e){if(o.endedAt!==void 0||o.startedAt>=n.end)continue;let e=T(o.name,t);if(e?.kind!==`counted`||Y(o,r,t))continue;let s=i(o);(!a||s>a.depth||s===a.depth&&o.startedAt>a.span.startedAt)&&(a={span:o,depth:s,bucket:e.bucket})}if(a)return{bucket:a.bucket,name:a.span.name,elapsedMs:Math.max(0,n.end-Math.max(n.start,a.span.startedAt))}}function Y(e,t,n){let r=e,i=new Set;for(;r&&!i.has(r.spanId);){if(i.add(r.spanId),T(r.name,n)?.kind===`background`)return!0;r=r.parentSpanId?t.get(r.parentSpanId):void 0}return!1}function Ye(e,t){return e.phase===`delivering`?Ue:e.phase===`ended`?se(e.delivery??{}):t?`currently ${K[t.bucket]} ${j(t.elapsedMs,`clock`)}`:``}function X(e){return[[`getting ready`,e.gettingReadyMs],[`thinking`,e.thinkingMs],[`in tools`,e.toolsMs],[`finishing up`,e.finishingUpMs],[`Switchboard overhead`,e.overheadMs],[`not recorded`,e.notRecordedMs],[`not loaded`,e.notLoadedMs]]}function Xe(e){let t=[`getting ready`,-1];for(let n of X(e))n[1]>t[1]&&(t=n);return t[0]}function Ze(e,t){let n=[],r=t=>e.windowMs>0?t/e.windowMs*100:0;for(let[i,a]of X(e))if(!(a<=0)){if(t&&K[t.bucket]===i){let e=Math.min(t.elapsedMs,a);a-e>0&&n.push({term:i,ms:a-e,pct:r(a-e),hatched:!1}),e>0&&n.push({term:i,ms:e,pct:r(e),hatched:!0});continue}n.push({term:i,ms:a,pct:r(a),hatched:!1})}return n}function Qe(e,t,n,r,i,a,o){let s=new Map(e.map(e=>[e.spanId,e])),c=new Map;for(let t of e){if(t.parentSpanId===void 0)continue;let e=c.get(t.parentSpanId);e?e.push(t):c.set(t.parentSpanId,[t])}let l=e=>[Math.max(r.start,e.startedAt),Math.min(r.end,e.endedAt??r.end)],u=[],d=[];for(let r of e){if(r===t||r.name===`run.agent`||T(r.name,n)===void 0||Y(r,s,n))continue;let[e,f]=l(r);if(f<=e)continue;let p=(c.get(r.spanId)??[]).map(l).map(([t,n])=>[Math.max(e,t),Math.min(f,n)]).filter(([e,t])=>t>e),m=f-e-$e(p);if(m<=0)continue;let h=r.name.startsWith(`tool.`)&&typeof r.attrs.callId==`string`?r.attrs.callId:void 0,g=h?i?.(h):void 0,_=a&&r.endedAt===void 0;(_?d:u).push({label:g??z(r.name),ms:m,facts:_?[o,...Z(r)]:Z(r),anchor:h?`call-${h}`:`span-${r.spanId}`,startedAt:r.startedAt})}let f=(e,t)=>t.ms-e.ms||e.startedAt-t.startedAt;u.sort(f),d.sort(f);let p=({label:e,ms:t,facts:n,anchor:r})=>({label:e,ms:t,facts:n,anchor:r});return{ranked:u.slice(0,3).map(p),cut:d.map(p)}}function $e(e){let t=[...e].sort((e,t)=>e[0]-t[0]),n=0,r;for(let[e,i]of t)!r||e>r[1]?(r&&(n+=r[1]-r[0]),r=[e,i]):i>r[1]&&(r[1]=i);return r&&(n+=r[1]-r[0]),n}function Z(e){let t=e.attrs,n=[];return(t.token===`expired`||t.token===`expiring`)&&n.push(`token ${t.token}`),t.budget===`clipped`&&n.push(`budget clipped`),typeof t.timeoutMs==`number`&&n.push(`timeout ${j(t.timeoutMs,`clock`)}`),typeof t.waitedMs==`number`&&n.push(`waited ${j(t.waitedMs,`clock`)}`),typeof t.exitCode==`number`&&t.exitCode!==0&&n.push(`exit ${t.exitCode}`),t.timedOut===!0&&n.push(`timed out`),typeof t.attempts==`number`&&t.attempts>1&&n.push(`${t.attempts} attempts`),e.status===`error`&&n.length===0&&n.push(`failed`),n}function Q(e){return e===`command`?`command`:`agent`}var et=[`data-state`],tt={key:0,class:`loading py-2 font-mono text-xs text-dimmed`},nt={key:1,class:`failed py-2 font-mono text-xs text-warn`},rt=[`data-turn`,`data-anchor`],it={class:`landing-head flex flex-wrap items-baseline gap-x-2 font-mono text-xs text-muted`},at={class:`turn tabular-nums`},ot={class:`what min-w-0 truncate text-toned`},st={key:0,class:`m-0 mt-1 list-none p-0`},ct=o({__name:`RunTimeline`,props:{run:{},land:{},fetch:{}},setup(n){let i=n,o=b(`loading`),s=oe(),v=S(()=>{if(o.value!==`ready`)return null;s.state.traceVersion;let e=i.run,t=e.receivedAt??e.startedAt,n=k(e)??(e.finishedAt===void 0?0:Math.max(0,e.finishedAt-t));return q({spans:s.spanSet(),losses:s.losses(t),window:{start:t,end:t+n},owner:Q(e.agent),totalMs:n,phase:`ended`,delivery:{finishedAt:e.finishedAt,sealedAt:e.sealedAt,replyOk:e.replyOk},...e.truncated===void 0?{}:{truncated:e.truncated},...(e.schema??0)>=2?{}:{untimed:!0},callTitle:s.callHeadline})}),x=S(()=>`/runs/${encodeURIComponent(i.run.id)}/events`),C=e=>`/runs/${encodeURIComponent(i.run.id)}#${e}`;function w(e){y.navigate(C(e))}let T=S(()=>{if(o.value!==`ready`||i.land===void 0)return null;s.state.traceVersion;let e=i.land,t=i.run.session;if(t&&e===t.request)return{anchor:`request`,what:`the request`};let n=t&&t.range!==`broken`?t.range.to:void 0;if(n!==void 0&&e===n&&s.state.reply)return{anchor:`reply`,what:`the reply`};let r=s.landing(e);return r?{anchor:r.anchor,what:E(r.step),step:r.step}:null});function E(e){let t=e.items.find(e=>e.kind===`call`),n=t?.kind===`call`?t.call.headline:void 0;return[e.turn?`thought ${e.turn.chip}`:void 0,n].filter(e=>e!==void 0).join(` · `)||`step ${e.index+1}`}let D=b(null),O=S(()=>T.value?`${i.land}@${T.value.anchor}`:null);return r(O,e=>{e!==null&&m().then(()=>{let e=(T.value?.step?D.value?.querySelector(`li.step`):null)??D.value;e&&(e.scrollIntoView?.({block:`center`}),e.classList.add(`revealed`),setTimeout(()=>e.classList.remove(`revealed`),1500))})}),p(async()=>{let e=i.fetch??((...e)=>globalThis.fetch(...e));try{let t=await e(x.value,{credentials:`same-origin`});if(!t.ok)throw Error(`HTTP ${t.status}`);let n=le(await t.text()).filter(e=>e.type!==`replay_note`);for(let e of(i.run.schema??0)>=2?ne(n):n)s.handle(e);s.closePhases(),o.value=`ready`}catch{o.value=`failed`}}),(r,i)=>{let p=l(`RouterLink`);return d(),t(`div`,{class:`runtimeline pl-5`,"data-state":o.value},[o.value===`loading`?(d(),t(`p`,tt,`reading the run's record…`)):o.value===`failed`?(d(),t(`p`,nt,[i[2]||=g(` the run's record could not be read — `,-1),e(p,{class:`text-primary no-underline hover:underline`,to:`/runs/${encodeURIComponent(n.run.id)}`},{default:u(()=>[...i[1]||=[g(`open the run`,-1)]]),_:1},8,[`to`])])):v.value?(d(),t(_,{key:2},[e(H,{vm:v.value,"events-href":x.value,onReveal:w},null,8,[`vm`,`events-href`]),T.value?(d(),t(`div`,{key:0,ref_key:`landingEl`,ref:D,class:`landing mb-4 rounded-lg border border-default px-(--sb-gutter) py-2`,"data-turn":n.land,"data-anchor":T.value.anchor},[f(`p`,it,[f(`span`,at,`turn `+a(n.land),1),f(`span`,ot,`· `+a(T.value.what),1),e(p,{class:`page ml-auto shrink-0 text-primary no-underline hover:underline`,to:C(T.value.anchor),title:`the same step on the run's own page`},{default:u(()=>[...i[3]||=[g(`open on the run's page ↗`,-1)]]),_:1},8,[`to`])]),T.value.step?(d(),t(`ol`,st,[e(ce,{step:T.value.step,onToggleGroup:i[0]||=e=>h(s).toggleGroup(T.value.step)},null,8,[`step`])])):c(``,!0)],8,rt)):c(``,!0)],64)):c(``,!0)],8,et)}}}),lt=[`id`,`data-run-id`,`data-round`,`data-thread`],ut=[`open`],dt={class:`row flex min-w-0 cursor-pointer list-none flex-wrap items-center gap-x-2.5 gap-y-1 px-2 py-2 hover:bg-(--ui-bg-muted) [&::-webkit-details-marker]:hidden`},ft={key:0,class:`round shrink-0 rounded border border-accented px-1.5 font-mono text-[0.7rem] font-medium tabular-nums text-toned`},$={key:2,class:`snippet min-w-0 flex-1 truncate text-muted`},pt={key:3,class:`scope min-w-0 flex-1 truncate text-toned`},mt=[`title`],ht=[`data-heat`],gt={class:`count shrink-0 text-right font-mono text-xs tabular-nums text-dimmed sm:min-w-[6em]`},_t={key:1,class:`row flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1 px-2 py-2 hover:bg-(--ui-bg-muted)`},vt={key:0,class:`round shrink-0 rounded border border-accented px-1.5 font-mono text-[0.7rem] font-medium tabular-nums text-toned`},yt={key:2,class:`snippet min-w-0 flex-1 truncate text-muted`},bt={key:3,class:`scope min-w-0 flex-1 truncate text-highlighted`},xt=[`title`],St={class:`elapsed shrink-0 text-right font-mono text-xs tabular-nums text-ok sm:min-w-[4.5em]`,title:`running for`},Ct={class:`count shrink-0 text-right font-mono text-xs tabular-nums text-dimmed sm:min-w-[6em]`},wt=o({__name:`RunFoldRow`,props:{run:{},now:{},label:{},open:{type:Boolean},land:{}},setup(n){let o=n,p=b(o.open===!0);r(()=>o.open,e=>{e&&(p.value=!0)});let m=S(()=>C(o.run.label||E(o.run.id))),_=S(()=>te(o.run)),y=S(()=>re(o.run)),T=S(()=>o.run.finished),k=S(()=>o.run.finished&&o.run.status&&o.run.status!==`completed`?O(o.run.status):``),A=S(()=>de(o.run.finished&&typeof o.run.finishedAt==`number`?o.run.finishedAt-o.run.startedAt:void 0,`run`)),j=S(()=>ue(A.value));function M(e){p.value=e.target.open}return(r,o)=>{let b=l(`RouterLink`);return d(),t(`li`,{id:`run-${n.run.id}`,class:s([`fold group border-b border-muted`,n.run.finished?`finished`:`live`]),"data-run-id":n.run.id,"data-round":n.run.round,"data-thread":n.run.thread},[T.value?(d(),t(`details`,{key:0,class:`group/fold`,open:p.value,onToggle:M},[f(`summary`,dt,[o[2]||=f(`span`,{class:`chev select-none text-xs text-dimmed transition-transform group-open/fold:rotate-90 motion-reduce:transition-none`,"aria-hidden":`true`},`❯`,-1),e(B,{tone:_.value,label:h(D)(n.run),tip:h(F)(n.run)},null,8,[`tone`,`label`,`tip`]),n.label?(d(),t(`span`,ft,a(n.label),1)):c(``,!0),m.value.agent?(d(),t(`span`,{key:1,class:s([`agent shrink-0 rounded border px-1.5 font-mono text-[0.68rem] font-medium uppercase tracking-wider opacity-55`,h(R)[h(P)(m.value.agent)]])},a(m.value.agent),3)):c(``,!0),m.value.snippet===void 0?(d(),t(`span`,pt,a(m.value.scope),1)):(d(),t(`span`,$,a(m.value.snippet),1)),k.value?(d(),t(`span`,{key:4,class:s([`outcome shrink-0 rounded border px-1.5 font-mono text-[0.7rem]`,_.value===`red`?`border-bad/30 text-bad`:`border-warn/30 text-warn`])},a(k.value),3)):c(``,!0),f(`span`,{class:`when shrink-0 font-mono text-xs tabular-nums text-dimmed`,title:h(N)(n.run)},a(h(w)(n.run.startedAt,n.now)),9,mt),f(`span`,{class:s([`elapsed shrink-0 text-right font-mono text-xs tabular-nums sm:min-w-[4.5em]`,[j.value?`heat`:`text-muted`,A.value.level>=2?`font-medium`:``]]),style:i(j.value),"data-heat":A.value.level,title:`start to finish`},a(h(I)(n.run,n.now)),15,ht),f(`span`,gt,a(h(L)(n.run)),1),e(b,{class:`open shrink-0 font-mono text-xs text-primary no-underline hover:underline`,to:y.value,"aria-label":`open run ${n.run.label||h(E)(n.run.id)}`,onClick:o[0]||=v(()=>{},[`stop`])},{default:u(()=>[...o[1]||=[g(`open ↗`,-1)]]),_:1},8,[`to`,`aria-label`])]),p.value?(d(),x(ct,{key:0,run:n.run,land:n.land},null,8,[`run`,`land`])):c(``,!0)],40,ut)):(d(),t(`div`,_t,[o[4]||=f(`span`,{class:`chev select-none text-xs text-transparent`,"aria-hidden":`true`},`❯`,-1),e(B,{tone:_.value,label:h(D)(n.run),tip:h(F)(n.run),pulse:``},null,8,[`tone`,`label`,`tip`]),n.label?(d(),t(`span`,vt,a(n.label),1)):c(``,!0),m.value.agent?(d(),t(`span`,{key:1,class:s([`agent shrink-0 rounded border px-1.5 font-mono text-[0.68rem] font-medium uppercase tracking-wider`,h(R)[h(P)(m.value.agent)]])},a(m.value.agent),3)):c(``,!0),m.value.snippet===void 0?(d(),t(`span`,bt,a(m.value.scope),1)):(d(),t(`span`,yt,a(m.value.snippet),1)),f(`span`,{class:`when shrink-0 font-mono text-xs tabular-nums text-muted`,title:h(N)(n.run)},a(h(w)(n.run.startedAt,n.now)),9,xt),f(`span`,St,a(h(I)(n.run,n.now)),1),f(`span`,Ct,a(h(L)(n.run)),1),e(b,{class:`open shrink-0 font-mono text-xs text-primary no-underline hover:underline`,to:y.value,"aria-label":`open run ${n.run.label||h(E)(n.run.id)}`},{default:u(()=>[...o[3]||=[g(`open ↗`,-1)]]),_:1},8,[`to`,`aria-label`])]))],10,lt)}}});export{ye as a,H as i,Q as n,_e as o,q as r,pe as s,wt as t};
1
+ import{An as e,Cr as t,Dn as n,Fi as r,Jr as i,Mi as a,On as o,Pi as s,Ur as c,_n as l,bn as u,hr as d,ki as f,lr as p,nr as m,sn as h,t as g,tn as _,vn as v,xn as y,xr as b,yi as x,yn as S}from"./browser-BWnzWwaT.js";import{r as C,t as w}from"./indexFormat-B-pd4r7Y.js";import{B as T,C as E,D,E as O,G as k,I as A,K as j,L as M,M as N,R as ee,T as te,U as ne,a as P,c as F,l as I,o as L,t as R,x as re,z as ie}from"./indexRow-BGjjLnN5.js";import"./format-BldUwl_R.js";import{n as ae}from"./SlackMark-DjJTK2tD.js";import{c as oe,l as se,n as ce,t as le,w as z}from"./sseReplay-BDVyc8HX.js";import{n as ue,t as de}from"./durationTone-CVpX_yIk.js";import{t as B}from"./StatusDot-BIAQN7iD.js";var fe={merged:`merged`,closed:`closed`,already_landed:`merged`,merge_ready:`merge-ready`,held:`held`,merge_refused:`not merged`,round_cap:`round cap reached`,wall_clock_cap:`out of budget`,review_pending:`review pending`,stopped:`stopped`,aborted:`aborted`,transient:`aborted`,continued:`continuing`,no_verdict:`no verdict`,interrupted:`interrupted`,refused:`refused`,idle:`idle`,idle_expired:`idle expired`,blocked:`blocked`,failed:`failed`};function pe(e){return fe[e]??e}var me={},he={viewBox:`0 0 16 16`,class:`inline-block size-[1em] shrink-0`,"aria-hidden":`true`};function ge(e,t){return d(),y(`svg`,he,[...t[0]||=[v(`path`,{fill:`currentColor`,d:`M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z`},null,-1)]])}var _e=ae(me,[[`render`,ge]]),V={"getting ready":`paint-ready`,thinking:`paint-thinking`,"in tools":`paint-tools`,"finishing up":`paint-finishing`,"Switchboard overhead":`paint-overhead`,"not recorded":`paint-lost`,"not loaded":`paint-elided`},ve={getting_ready:`getting ready`,finishing_up:`finishing up`};function ye(e){return V[ve[e]]}var be={id:`timeline`,class:`block mb-4 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`,"data-testid":`timeline`},xe={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},Se={class:`ml-auto flex items-baseline gap-3 font-normal normal-case tracking-normal`},Ce=[`href`],we={class:`lede font-mono text-sm text-toned`},Te={class:`shape tabular-nums`},Ee={key:0,class:`current text-muted`},De={key:0,class:`note mt-0.5 text-xs text-muted`},Oe=[`aria-label`],ke=[`title`,`data-term`],Ae={class:`legend mt-2 flex flex-wrap gap-x-4 gap-y-1 font-mono text-xs`},je=[`title`,`data-term`],Me={class:`term text-muted`},Ne={class:`ms tabular-nums text-toned`},Pe=[`title`],Fe={class:`ranked mt-1 flex flex-col gap-1 font-mono text-xs`},Ie={class:`ms w-14 shrink-0 tabular-nums text-toned`},Le=[`href`,`data-anchor`,`onClick`],Re=[`title`],ze={class:`cut mt-1 flex flex-col gap-1 font-mono text-xs`},Be={class:`ms w-14 shrink-0 tabular-nums text-toned`},Ve=[`href`,`data-anchor`,`onClick`],H=e({__name:`TimelineSection`,props:{vm:{},eventsHref:{}},emits:[`reveal`],setup(e,{emit:t}){let n=e,i=t;function o(e){return`${j(e.ms,`clock`)} ${e.term}${e.hatched?` (in flight)`:``}`}function c(){g.copyText(JSON.stringify(n.vm.debug,null,2))}return(t,n)=>(d(),y(`section`,be,[v(`h2`,xe,[n[0]||=v(`span`,null,`Where the time went`,-1),v(`span`,Se,[e.eventsHref?(d(),y(`a`,{key:0,class:`text-dimmed no-underline hover:text-primary hover:underline`,href:e.eventsHref,title:`the stored events, as JSON lines`},`raw events`,8,Ce)):u(``,!0),v(`button`,{type:`button`,class:`debug cursor-pointer text-dimmed hover:text-toned`,title:`the partition and the raw span names, for a bug report`,onClick:c},` Copy debug JSON `)])]),v(`p`,we,[v(`span`,Te,r(e.vm.shown?e.vm.total:e.vm.lede),1),e.vm.current?(d(),y(`span`,Ee,` · `+r(e.vm.current),1)):u(``,!0)]),(d(!0),y(h,null,b(e.vm.captions,e=>(d(),y(`p`,{key:e,class:`caption mt-0.5 text-xs text-muted`},r(e),1))),128)),e.vm.note?(d(),y(`p`,De,r(e.vm.note),1)):u(``,!0),e.vm.shown?(d(),y(h,{key:1},[v(`div`,{class:`bar mt-2.5 flex h-2 w-full overflow-hidden rounded-sm`,role:`img`,"aria-label":e.vm.lede},[(d(!0),y(h,null,b(e.vm.bar,(e,t)=>(d(),y(`div`,{key:t,class:a([`seg h-full`,[f(V)[e.term],e.hatched?`paint-hatched hatched`:``]]),style:s({width:`${e.pct}%`}),title:o(e),"data-term":e.term},null,14,ke))),128))],8,Oe),v(`ul`,Ae,[(d(!0),y(h,null,b(e.vm.legend,e=>(d(),y(`li`,{key:e.term,class:`flex items-baseline gap-1.5 cursor-help`,title:e.definition,"data-term":e.term},[v(`span`,{class:a([`swatch inline-block size-2 shrink-0 self-center rounded-[2px]`,f(V)[e.term]])},null,2),v(`span`,Me,r(e.term),1),v(`span`,Ne,r(e.text),1)],8,je))),128))]),e.vm.ranked.length>0?(d(),y(h,{key:0},[v(`h3`,{class:`ranked-head mt-3 inline-block cursor-help text-xs font-medium text-muted underline decoration-dotted decoration-(--ui-border-accented) underline-offset-2`,title:e.vm.rankedNote},` Longest steps `,8,Pe),v(`ol`,Fe,[(d(!0),y(h,null,b(e.vm.ranked,(e,t)=>(d(),y(`li`,{key:t,class:`flex items-baseline gap-2`},[v(`span`,Ie,r(f(j)(e.ms,`clock`)),1),v(`a`,{class:`label min-w-0 truncate text-muted no-underline hover:text-primary hover:underline`,href:`#${e.anchor}`,"data-anchor":e.anchor,title:`scroll to this step`,onClick:_(t=>i(`reveal`,e.anchor),[`prevent`])},r(e.label),9,Le),(d(!0),y(h,null,b(e.facts,e=>(d(),y(`span`,{key:e,class:`fact shrink-0 rounded border border-accented px-1 text-dimmed`},r(e),1))),128))]))),128))])],64)):u(``,!0),e.vm.cut.length>0?(d(),y(h,{key:1},[v(`h3`,{class:`cut-head mt-3 block cursor-help text-xs font-medium text-muted underline decoration-dotted decoration-(--ui-border-accented) underline-offset-2`,title:e.vm.cutNote},` Cut steps `,8,Re),v(`ol`,ze,[(d(!0),y(h,null,b(e.vm.cut,(e,t)=>(d(),y(`li`,{key:t,class:`flex items-baseline gap-2`},[v(`span`,Be,r(f(j)(e.ms,`clock`)),1),v(`a`,{class:`label min-w-0 truncate text-muted no-underline hover:text-primary hover:underline`,href:`#${e.anchor}`,"data-anchor":e.anchor,title:`scroll to this step`,onClick:_(t=>i(`reveal`,e.anchor),[`prevent`])},r(e.label),9,Ve),(d(!0),y(h,null,b(e.facts,e=>(d(),y(`span`,{key:e,class:`fact shrink-0 rounded border border-accented px-1 text-dimmed`},r(e),1))),128))]))),128))])],64)):u(``,!0)],64)):u(``,!0)]))}}),U={"getting ready":`before the agent's first turn: reading the thread, finding the repo, checking out, loading tools`,thinking:`the model's turns — from a request to the model until its reply came back`,"in tools":`the commands and tool calls the model ran`,"finishing up":`after the agent's last turn: posting the PR, checking the workspace`,"Switchboard overhead":`orchestration between steps, and moments when only a background read was running — the time no step claims`,"not recorded":`a stretch of the run the record does not carry`,"not loaded":`a stretch of the run this page did not load — the record has the full shape`},W=`Ranked by each step's own time, its children excluded — the bar counts every instant once.`,G=`Steps still open when the run ended: closed at the run's terminal event and left out of the ranking — the time shown is the cut, not a measurement.`;function He(e){let t=e===`interrupted`?`the interruption`:e===`failed`?`the failure`:e===`stopped_hard`?`the hard stop`:e===`stopped_soft`?`the stop`:void 0;return t?`cut by ${t}`:`cut at the run's end`}var Ue=`currently delivering`,We=`getting ready: not recorded (too large)`,Ge=`no timing data`,Ke=`not loaded (the record has the full shape)`,K={getting_ready:`getting ready`,thinking:`thinking`,tools:`in tools`,finishing_up:`finishing up`};function q(e){let{spans:t,window:n,owner:r}=e,i=e.phase!==`live`,a=ee(t,{window:n,owner:r,finished:i,losses:e.losses}),o=ie(a),s=j(o.totalS*1e3,`clock`),c=t.find(e=>e.name===`request`&&e.parentSpanId===void 0),l=e.phase===`live`?Je(t,r,n):void 0,u=Ye(e,l),d=l?z(l.name):``,f={window:n,owner:r,phase:e.phase,partition:a,spans:t.map(e=>({spanId:e.spanId,parentSpanId:e.parentSpanId,name:e.name,startedAt:e.startedAt,endedAt:e.endedAt,status:e.status,attrs:e.attrs}))};if(e.untimed)return{total:s,current:u,openStep:d,captions:[],rankedNote:W,cut:[],cutNote:G,debug:f,lede:s,shown:!1,bar:[],legend:[],ranked:[],note:Ge};let p=qe(c,`restartOfRunId`),m={total:s,current:u,openStep:d,captions:[p===void 0?void 0:`restarted from run ${p}`,A(`before`,J(c,`queuedBeforeMs`)),p===void 0?A(`behind`,J(c,`queuedBehindMs`)):void 0].filter(e=>e!==void 0),rankedNote:W,cutNote:G,debug:f};if(!c)return{...m,lede:s,shown:!1,bar:[],legend:[],ranked:[],cut:[],note:i?We:``};let h=t=>t===`not recorded`?`not recorded${e.truncated?` (too large)`:``}`:t===`not loaded`?Ke:t,g=M(a)&&o.items.length>0,_=g?`${s} — ${o.items.map(({term:e,s:t})=>`${j(t*1e3,`clock`)} ${h(e)}`).join(` · `)}`:a.windowMs>0?`${s} — ${h(Xe(a))}`:s,v=g?o.items.map(({term:t,s:n})=>({term:t,text:j(n*1e3,`clock`),definition:t===`not recorded`&&e.truncated?`${U[t]} (too large)`:U[t]})):[],y=g?Qe(t,c,r,n,e.callTitle,e.phase===`ended`,He(e.endedBy)):{ranked:[],cut:[]};return{...m,lede:_,shown:g,bar:g?Ze(a,l):[],legend:v,ranked:y.ranked,cut:y.cut,note:``}}function J(e,t){let n=e?.attrs[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function qe(e,t){let n=e?.attrs[t];return typeof n==`string`&&n!==``?n:void 0}function Je(e,t,n){let r=new Map(e.map(e=>[e.spanId,e])),i=e=>{let t=1,n=new Set([e.spanId]),i=e.parentSpanId?r.get(e.parentSpanId):void 0;for(;i&&!n.has(i.spanId);)n.add(i.spanId),t++,i=i.parentSpanId?r.get(i.parentSpanId):void 0;return t},a;for(let o of e){if(o.endedAt!==void 0||o.startedAt>=n.end)continue;let e=T(o.name,t);if(e?.kind!==`counted`||Y(o,r,t))continue;let s=i(o);(!a||s>a.depth||s===a.depth&&o.startedAt>a.span.startedAt)&&(a={span:o,depth:s,bucket:e.bucket})}if(a)return{bucket:a.bucket,name:a.span.name,elapsedMs:Math.max(0,n.end-Math.max(n.start,a.span.startedAt))}}function Y(e,t,n){let r=e,i=new Set;for(;r&&!i.has(r.spanId);){if(i.add(r.spanId),T(r.name,n)?.kind===`background`)return!0;r=r.parentSpanId?t.get(r.parentSpanId):void 0}return!1}function Ye(e,t){return e.phase===`delivering`?Ue:e.phase===`ended`?se(e.delivery??{}):t?`currently ${K[t.bucket]} ${j(t.elapsedMs,`clock`)}`:``}function X(e){return[[`getting ready`,e.gettingReadyMs],[`thinking`,e.thinkingMs],[`in tools`,e.toolsMs],[`finishing up`,e.finishingUpMs],[`Switchboard overhead`,e.overheadMs],[`not recorded`,e.notRecordedMs],[`not loaded`,e.notLoadedMs]]}function Xe(e){let t=[`getting ready`,-1];for(let n of X(e))n[1]>t[1]&&(t=n);return t[0]}function Ze(e,t){let n=[],r=t=>e.windowMs>0?t/e.windowMs*100:0;for(let[i,a]of X(e))if(!(a<=0)){if(t&&K[t.bucket]===i){let e=Math.min(t.elapsedMs,a);a-e>0&&n.push({term:i,ms:a-e,pct:r(a-e),hatched:!1}),e>0&&n.push({term:i,ms:e,pct:r(e),hatched:!0});continue}n.push({term:i,ms:a,pct:r(a),hatched:!1})}return n}function Qe(e,t,n,r,i,a,o){let s=new Map(e.map(e=>[e.spanId,e])),c=new Map;for(let t of e){if(t.parentSpanId===void 0)continue;let e=c.get(t.parentSpanId);e?e.push(t):c.set(t.parentSpanId,[t])}let l=e=>[Math.max(r.start,e.startedAt),Math.min(r.end,e.endedAt??r.end)],u=[],d=[];for(let r of e){if(r===t||r.name===`run.agent`||T(r.name,n)===void 0||Y(r,s,n))continue;let[e,f]=l(r);if(f<=e)continue;let p=(c.get(r.spanId)??[]).map(l).map(([t,n])=>[Math.max(e,t),Math.min(f,n)]).filter(([e,t])=>t>e),m=f-e-$e(p);if(m<=0)continue;let h=r.name.startsWith(`tool.`)&&typeof r.attrs.callId==`string`?r.attrs.callId:void 0,g=h?i?.(h):void 0,_=a&&r.endedAt===void 0;(_?d:u).push({label:g??z(r.name),ms:m,facts:_?[o,...Z(r)]:Z(r),anchor:h?`call-${h}`:`span-${r.spanId}`,startedAt:r.startedAt})}let f=(e,t)=>t.ms-e.ms||e.startedAt-t.startedAt;u.sort(f),d.sort(f);let p=({label:e,ms:t,facts:n,anchor:r})=>({label:e,ms:t,facts:n,anchor:r});return{ranked:u.slice(0,3).map(p),cut:d.map(p)}}function $e(e){let t=[...e].sort((e,t)=>e[0]-t[0]),n=0,r;for(let[e,i]of t)!r||e>r[1]?(r&&(n+=r[1]-r[0]),r=[e,i]):i>r[1]&&(r[1]=i);return r&&(n+=r[1]-r[0]),n}function Z(e){let t=e.attrs,n=[];return(t.token===`expired`||t.token===`expiring`)&&n.push(`token ${t.token}`),t.budget===`clipped`&&n.push(`budget clipped`),typeof t.timeoutMs==`number`&&n.push(`timeout ${j(t.timeoutMs,`clock`)}`),typeof t.waitedMs==`number`&&n.push(`waited ${j(t.waitedMs,`clock`)}`),typeof t.exitCode==`number`&&t.exitCode!==0&&n.push(`exit ${t.exitCode}`),t.timedOut===!0&&n.push(`timed out`),typeof t.attempts==`number`&&t.attempts>1&&n.push(`${t.attempts} attempts`),e.status===`error`&&n.length===0&&n.push(`failed`),n}function Q(e){return e===`command`?`command`:`agent`}var et=[`data-state`],tt={key:0,class:`loading py-2 font-mono text-xs text-dimmed`},nt={key:1,class:`failed py-2 font-mono text-xs text-warn`},rt=[`data-turn`,`data-anchor`],it={class:`landing-head flex flex-wrap items-baseline gap-x-2 font-mono text-xs text-muted`},at={class:`turn tabular-nums`},ot={class:`what min-w-0 truncate text-toned`},st={key:0,class:`m-0 mt-1 list-none p-0`},ct=e({__name:`RunTimeline`,props:{run:{},land:{},fetch:{}},setup(e){let a=e,s=x(`loading`),_=oe(),b=l(()=>{if(s.value!==`ready`)return null;_.state.traceVersion;let e=a.run,t=e.receivedAt??e.startedAt,n=k(e)??(e.finishedAt===void 0?0:Math.max(0,e.finishedAt-t));return q({spans:_.spanSet(),losses:_.losses(t),window:{start:t,end:t+n},owner:Q(e.agent),totalMs:n,phase:`ended`,delivery:{finishedAt:e.finishedAt,sealedAt:e.sealedAt,replyOk:e.replyOk},...e.truncated===void 0?{}:{truncated:e.truncated},...(e.schema??0)>=2?{}:{untimed:!0},callTitle:_.callHeadline})}),S=l(()=>`/runs/${encodeURIComponent(a.run.id)}/events`),C=e=>`/runs/${encodeURIComponent(a.run.id)}#${e}`;function w(e){g.navigate(C(e))}let T=l(()=>{if(s.value!==`ready`||a.land===void 0)return null;_.state.traceVersion;let e=a.land,t=a.run.session;if(t&&e===t.request)return{anchor:`request`,what:`the request`};let n=t&&t.range!==`broken`?t.range.to:void 0;if(n!==void 0&&e===n&&_.state.reply)return{anchor:`reply`,what:`the reply`};let r=_.landing(e);return r?{anchor:r.anchor,what:E(r.step),step:r.step}:null});function E(e){let t=e.items.find(e=>e.kind===`call`),n=t?.kind===`call`?t.call.headline:void 0;return[e.turn?`thought ${e.turn.chip}`:void 0,n].filter(e=>e!==void 0).join(` · `)||`step ${e.index+1}`}let D=x(null),O=l(()=>T.value?`${a.land}@${T.value.anchor}`:null);return c(O,e=>{e!==null&&m().then(()=>{let e=(T.value?.step?D.value?.querySelector(`li.step`):null)??D.value;e&&(e.scrollIntoView?.({block:`center`}),e.classList.add(`revealed`),setTimeout(()=>e.classList.remove(`revealed`),1500))})}),p(async()=>{let e=a.fetch??((...e)=>globalThis.fetch(...e));try{let t=await e(S.value,{credentials:`same-origin`});if(!t.ok)throw Error(`HTTP ${t.status}`);let n=le(await t.text()).filter(e=>e.type!==`replay_note`);for(let e of(a.run.schema??0)>=2?ne(n):n)_.handle(e);_.closePhases(),s.value=`ready`}catch{s.value=`failed`}}),(a,c)=>{let l=t(`RouterLink`);return d(),y(`div`,{class:`runtimeline pl-5`,"data-state":s.value},[s.value===`loading`?(d(),y(`p`,tt,`reading the run's record…`)):s.value===`failed`?(d(),y(`p`,nt,[c[2]||=n(` the run's record could not be read — `,-1),o(l,{class:`text-primary no-underline hover:underline`,to:`/runs/${encodeURIComponent(e.run.id)}`},{default:i(()=>[...c[1]||=[n(`open the run`,-1)]]),_:1},8,[`to`])])):b.value?(d(),y(h,{key:2},[o(H,{vm:b.value,"events-href":S.value,onReveal:w},null,8,[`vm`,`events-href`]),T.value?(d(),y(`div`,{key:0,ref_key:`landingEl`,ref:D,class:`landing mb-4 rounded-lg border border-default px-(--sb-gutter) py-2`,"data-turn":e.land,"data-anchor":T.value.anchor},[v(`p`,it,[v(`span`,at,`turn `+r(e.land),1),v(`span`,ot,`· `+r(T.value.what),1),o(l,{class:`page ml-auto shrink-0 text-primary no-underline hover:underline`,to:C(T.value.anchor),title:`the same step on the run's own page`},{default:i(()=>[...c[3]||=[n(`open on the run's page ↗`,-1)]]),_:1},8,[`to`])]),T.value.step?(d(),y(`ol`,st,[o(ce,{step:T.value.step,onToggleGroup:c[0]||=e=>f(_).toggleGroup(T.value.step)},null,8,[`step`])])):u(``,!0)],8,rt)):u(``,!0)],64)):u(``,!0)],8,et)}}}),lt=[`id`,`data-run-id`,`data-round`,`data-thread`],ut=[`open`],dt={class:`row flex min-w-0 cursor-pointer list-none flex-wrap items-center gap-x-2.5 gap-y-1 px-2 py-2 hover:bg-(--ui-bg-muted) [&::-webkit-details-marker]:hidden`},ft={key:0,class:`round shrink-0 rounded border border-accented px-1.5 font-mono text-[0.7rem] font-medium tabular-nums text-toned`},$={key:2,class:`snippet min-w-0 flex-1 truncate text-muted`},pt={key:3,class:`scope min-w-0 flex-1 truncate text-toned`},mt=[`title`],ht=[`data-heat`],gt={class:`count shrink-0 text-right font-mono text-xs tabular-nums text-dimmed sm:min-w-[6em]`},_t={key:1,class:`row flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1 px-2 py-2 hover:bg-(--ui-bg-muted)`},vt={key:0,class:`round shrink-0 rounded border border-accented px-1.5 font-mono text-[0.7rem] font-medium tabular-nums text-toned`},yt={key:2,class:`snippet min-w-0 flex-1 truncate text-muted`},bt={key:3,class:`scope min-w-0 flex-1 truncate text-highlighted`},xt=[`title`],St={class:`elapsed shrink-0 text-right font-mono text-xs tabular-nums text-ok sm:min-w-[4.5em]`,title:`running for`},Ct={class:`count shrink-0 text-right font-mono text-xs tabular-nums text-dimmed sm:min-w-[6em]`},wt=e({__name:`RunFoldRow`,props:{run:{},now:{},label:{},open:{type:Boolean},land:{}},setup(e){let p=e,m=x(p.open===!0);c(()=>p.open,e=>{e&&(m.value=!0)});let h=l(()=>C(p.run.label||E(p.run.id))),g=l(()=>te(p.run)),b=l(()=>re(p.run)),T=l(()=>p.run.finished),k=l(()=>p.run.finished&&p.run.status&&p.run.status!==`completed`?O(p.run.status):``),A=l(()=>de(p.run.finished&&typeof p.run.finishedAt==`number`?p.run.finishedAt-p.run.startedAt:void 0,`run`)),j=l(()=>ue(A.value));function M(e){m.value=e.target.open}return(c,l)=>{let p=t(`RouterLink`);return d(),y(`li`,{id:`run-${e.run.id}`,class:a([`fold group border-b border-muted`,e.run.finished?`finished`:`live`]),"data-run-id":e.run.id,"data-round":e.run.round,"data-thread":e.run.thread},[T.value?(d(),y(`details`,{key:0,class:`group/fold`,open:m.value,onToggle:M},[v(`summary`,dt,[l[2]||=v(`span`,{class:`chev select-none text-xs text-dimmed transition-transform group-open/fold:rotate-90 motion-reduce:transition-none`,"aria-hidden":`true`},`❯`,-1),o(B,{tone:g.value,label:f(D)(e.run),tip:f(F)(e.run)},null,8,[`tone`,`label`,`tip`]),e.label?(d(),y(`span`,ft,r(e.label),1)):u(``,!0),h.value.agent?(d(),y(`span`,{key:1,class:a([`agent shrink-0 rounded border px-1.5 font-mono text-[0.68rem] font-medium uppercase tracking-wider opacity-55`,f(R)[f(P)(h.value.agent)]])},r(h.value.agent),3)):u(``,!0),h.value.snippet===void 0?(d(),y(`span`,pt,r(h.value.scope),1)):(d(),y(`span`,$,r(h.value.snippet),1)),k.value?(d(),y(`span`,{key:4,class:a([`outcome shrink-0 rounded border px-1.5 font-mono text-[0.7rem]`,g.value===`red`?`border-bad/30 text-bad`:`border-warn/30 text-warn`])},r(k.value),3)):u(``,!0),v(`span`,{class:`when shrink-0 font-mono text-xs tabular-nums text-dimmed`,title:f(N)(e.run)},r(f(w)(e.run.startedAt,e.now)),9,mt),v(`span`,{class:a([`elapsed shrink-0 text-right font-mono text-xs tabular-nums sm:min-w-[4.5em]`,[j.value?`heat`:`text-muted`,A.value.level>=2?`font-medium`:``]]),style:s(j.value),"data-heat":A.value.level,title:`start to finish`},r(f(I)(e.run,e.now)),15,ht),v(`span`,gt,r(f(L)(e.run)),1),o(p,{class:`open shrink-0 font-mono text-xs text-primary no-underline hover:underline`,to:b.value,"aria-label":`open run ${e.run.label||f(E)(e.run.id)}`,onClick:l[0]||=_(()=>{},[`stop`])},{default:i(()=>[...l[1]||=[n(`open ↗`,-1)]]),_:1},8,[`to`,`aria-label`])]),m.value?(d(),S(ct,{key:0,run:e.run,land:e.land},null,8,[`run`,`land`])):u(``,!0)],40,ut)):(d(),y(`div`,_t,[l[4]||=v(`span`,{class:`chev select-none text-xs text-transparent`,"aria-hidden":`true`},`❯`,-1),o(B,{tone:g.value,label:f(D)(e.run),tip:f(F)(e.run),pulse:``},null,8,[`tone`,`label`,`tip`]),e.label?(d(),y(`span`,vt,r(e.label),1)):u(``,!0),h.value.agent?(d(),y(`span`,{key:1,class:a([`agent shrink-0 rounded border px-1.5 font-mono text-[0.68rem] font-medium uppercase tracking-wider`,f(R)[f(P)(h.value.agent)]])},r(h.value.agent),3)):u(``,!0),h.value.snippet===void 0?(d(),y(`span`,bt,r(h.value.scope),1)):(d(),y(`span`,yt,r(h.value.snippet),1)),v(`span`,{class:`when shrink-0 font-mono text-xs tabular-nums text-muted`,title:f(N)(e.run)},r(f(w)(e.run.startedAt,e.now)),9,xt),v(`span`,St,r(f(I)(e.run,e.now)),1),v(`span`,Ct,r(f(L)(e.run)),1),o(p,{class:`open shrink-0 font-mono text-xs text-primary no-underline hover:underline`,to:b.value,"aria-label":`open run ${e.run.label||f(E)(e.run.id)}`},{default:i(()=>[...l[3]||=[n(`open ↗`,-1)]]),_:1},8,[`to`,`aria-label`])]))],10,lt)}}});export{ye as a,H as i,Q as n,_e as o,q as r,pe as s,wt as t};