@coreplane/switchboard 1.260.3 → 1.260.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/deploy/cloudflare/package.json +2 -2
- package/dist/assets/deploy/cloudflare-docs/package.json +1 -1
- package/dist/assets/deploy/cloudflare-memory/package.json +2 -2
- package/dist/assets/deploy/cloudflare-memory/worker.ts +205 -8
- package/dist/assets/deploy/cloudflare-resident/Dockerfile +11 -2
- package/dist/assets/deploy/cloudflare-resident/package.json +2 -2
- package/dist/assets/deploy/cloudflare-resident/worker.ts +124 -40
- package/dist/assets/deploy/cloudflare-sandbox/package.json +2 -2
- package/dist/assets/package-lock.json +712 -97
- package/dist/assets/package.json +7 -6
- package/dist/assets/project.json +4 -0
- package/dist/assets/source.json +3 -3
- package/dist/assets/src/core/budgets.ts +5 -0
- package/dist/assets/src/core/coordinator/contract.ts +5 -0
- package/dist/assets/src/core/coordinator/driver.ts +118 -29
- package/dist/assets/src/core/pipelineStanding.ts +2 -0
- package/dist/assets/src/core/plane/decide.ts +19 -2
- package/dist/assets/src/core/provider.ts +380 -0
- package/dist/assets/src/core/refusal.ts +1 -0
- package/dist/assets/src/core/runEvents.ts +8 -0
- package/dist/assets/src/core/runFriction.ts +1 -1
- package/dist/assets/src/core/runLedger/types.ts +10 -1
- package/dist/assets/src/core/runRecord.ts +31 -0
- package/dist/assets/src/core/ship/contract.ts +3 -1
- package/dist/assets/src/core/ship/coordinator.ts +518 -56
- package/dist/assets/src/core/ship/renewal.ts +3 -1
- package/dist/assets/src/core/types.ts +6 -0
- package/dist/assets/src/execution/bashTimeout.ts +1 -1
- package/dist/assets/src/execution/residentRebind.ts +15 -0
- package/dist/assets/src/execution/residentReuse.ts +23 -2
- package/dist/assets/src/execution/sandboxErrors.ts +6 -6
- package/dist/assets/web/dist/.vite/manifest.json +505 -505
- package/dist/assets/web/dist/assets/{AppShell-CSXDCV4x.js → AppShell-DPJVhUGP.js} +1 -1
- package/dist/assets/web/dist/assets/{CostChart-DsuPS2g7.js → CostChart-4TeDdbvJ.js} +1 -1
- package/dist/assets/web/dist/assets/CostsPage-8HDgvuWB.js +1 -0
- package/dist/assets/web/dist/assets/{DeliveryPage-62qCSLvk.js → DeliveryPage-Cf1joUyA.js} +1 -1
- package/dist/assets/web/dist/assets/{HomePage-Dk3HRBc3.js → HomePage-DZEAnCCv.js} +1 -1
- package/dist/assets/web/dist/assets/{InputMenu-BdZXnibG.js → InputMenu-BRV35UWP.js} +1 -1
- package/dist/assets/web/dist/assets/{MetricsPage-o5fSaCTe.js → MetricsPage-BQBuIuYU.js} +1 -1
- package/dist/assets/web/dist/assets/{NotFoundPage-DHuWyjlq.js → NotFoundPage-CDjMfCcj.js} +1 -1
- package/dist/assets/web/dist/assets/{PendingTurnRow-CeTGOXUy.js → PendingTurnRow-4B8JwETU.js} +1 -1
- package/dist/assets/web/dist/assets/{PlanePage-RD0M6O6W.js → PlanePage-CHU2szQs.js} +1 -1
- package/dist/assets/web/dist/assets/{ResidentDetailPage-Dl2KId95.js → ResidentDetailPage-L5SRcN_O.js} +1 -1
- package/dist/assets/web/dist/assets/{ResidentsIndexPage-DBy43I1R.js → ResidentsIndexPage-BIFf8qyE.js} +1 -1
- package/dist/assets/web/dist/assets/RunFoldRow-DzPIshJx.js +1 -0
- package/dist/assets/web/dist/assets/{RunRoutePage-Du1HqLZs.js → RunRoutePage-Cru5IVux.js} +3 -3
- package/dist/assets/web/dist/assets/{RunsIndexPage-BZphy3Hr.js → RunsIndexPage-CBkdPAdj.js} +1 -1
- package/dist/assets/web/dist/assets/{RunsTabs-kHbbxVHx.js → RunsTabs-C7Ua3XX5.js} +1 -1
- package/dist/assets/web/dist/assets/{ScheduledPage-B7jh898t.js → ScheduledPage-D_R55BDk.js} +1 -1
- package/dist/assets/web/dist/assets/{SettingSelect-BfID5nF4.js → SettingSelect-CEeA4iuC.js} +1 -1
- package/dist/assets/web/dist/assets/{SettingsPage-3uLEsiiE.js → SettingsPage-DlmZvAvf.js} +1 -1
- package/dist/assets/web/dist/assets/{SilentTurn-CKxSxnQC.js → SilentTurn-PWMDMbMG.js} +1 -1
- package/dist/assets/web/dist/assets/{SlackMark-CtiHrNjr.js → SlackMark-DB0MGiF5.js} +1 -1
- package/dist/assets/web/dist/assets/{StatusDot-x7vcK0iE.js → StatusDot-Bq0mYMFo.js} +1 -1
- package/dist/assets/web/dist/assets/{Tooltip-wVXCWhMp.js → Tooltip-Bs6zd7yE.js} +1 -1
- package/dist/assets/web/dist/assets/{UnitRoutePage-V5BXK7FH.js → UnitRoutePage-BMGEZCvn.js} +1 -1
- package/dist/assets/web/dist/assets/{angular-html-C8b5YTHf.js → angular-html-BRRhsdQE.js} +1 -1
- package/dist/assets/web/dist/assets/{angular-ts-C3f4WYNe.js → angular-ts-BFj-mqCm.js} +1 -1
- package/dist/assets/web/dist/assets/{apl-DSHxUJc3.js → apl-CsBuy1IL.js} +1 -1
- package/dist/assets/web/dist/assets/{astro-BSGCCBP6.js → astro-cVaqxBZq.js} +1 -1
- package/dist/assets/web/dist/assets/{blade-DFeYrMKk.js → blade-MEP5mWha.js} +1 -1
- package/dist/assets/web/dist/assets/{browser-B6T5hjfR.js → browser-CCImen5O.js} +1 -1
- package/dist/assets/web/dist/assets/budgets-0szUBIMv.js +1 -0
- package/dist/assets/web/dist/assets/{c-L_QOnFVv.js → c-D4NGQ_Pd.js} +1 -1
- package/dist/assets/web/dist/assets/{chapel-DLQWUwhu.js → chapel-BkWImsIy.js} +1 -1
- package/dist/assets/web/dist/assets/{cobol-1DlMmrEO.js → cobol-RPDSPSET.js} +1 -1
- package/dist/assets/web/dist/assets/{coffee-BTB6os6N.js → coffee-DZ5z7oVX.js} +1 -1
- package/dist/assets/web/dist/assets/{cpp-BvJI2z3u.js → cpp-CrBtIaRZ.js} +1 -1
- package/dist/assets/web/dist/assets/{crystal-B11wGW_h.js → crystal-DJesYi6f.js} +1 -1
- package/dist/assets/web/dist/assets/{css-BiIWx5Pw.js → css-DO9mjau-.js} +1 -1
- package/dist/assets/web/dist/assets/{dist-C-XGnvM4.js → dist-EkKVbIM-.js} +12 -12
- package/dist/assets/web/dist/assets/{edge-nSglEXaD.js → edge-C3VzbSW0.js} +1 -1
- package/dist/assets/web/dist/assets/{elixir-x7o8qMl8.js → elixir-BkD_Vhfe.js} +1 -1
- package/dist/assets/web/dist/assets/{elm-DGrRyqTQ.js → elm-KIM0mFPk.js} +1 -1
- package/dist/assets/web/dist/assets/{erb--_dh58Nw.js → erb-D2ruCqb2.js} +1 -1
- package/dist/assets/web/dist/assets/{eventSource-Bj_dZf6M.js → eventSource-Cv0AFlMi.js} +1 -1
- package/dist/assets/web/dist/assets/{git-rebase-DbpUXwyg.js → git-rebase-CnfbQTxA.js} +1 -1
- package/dist/assets/web/dist/assets/{glimmer-js-BG0CuZG5.js → glimmer-js-CbiwFXWH.js} +1 -1
- package/dist/assets/web/dist/assets/{glimmer-ts-CQIl5qyR.js → glimmer-ts-DV8ii0Pv.js} +1 -1
- package/dist/assets/web/dist/assets/{glsl-9PJNQTcw.js → glsl-CgmznWkA.js} +1 -1
- package/dist/assets/web/dist/assets/{graphql-CzVTzjEI.js → graphql-BK-bBYfH.js} +1 -1
- package/dist/assets/web/dist/assets/{hack-BhCmAz3Q.js → hack-DnwTTP5n.js} +1 -1
- package/dist/assets/web/dist/assets/{haml-BmI12COR.js → haml-DAVJsWwT.js} +1 -1
- package/dist/assets/web/dist/assets/{handlebars-Cib-ISTS.js → handlebars-voOVfxFL.js} +1 -1
- package/dist/assets/web/dist/assets/{html-D3lDapvI.js → html-3FTqwaPk.js} +1 -1
- package/dist/assets/web/dist/assets/{html-derivative-DRPY8vOK.js → html-derivative-CSlhLDQn.js} +1 -1
- package/dist/assets/web/dist/assets/{http-B9VttK6m.js → http-Vx4ilPfS.js} +1 -1
- package/dist/assets/web/dist/assets/{hurl-C0saNJYj.js → hurl-DxyZDE3R.js} +1 -1
- package/dist/assets/web/dist/assets/{indexRow-Dxg7C8s9.js → indexRow-5s3hNzZ9.js} +1 -1
- package/dist/assets/web/dist/assets/{java-BCFbtYAj.js → java-nWqdjNJG.js} +1 -1
- package/dist/assets/web/dist/assets/{javascript-nwBjnrhh.js → javascript-Dr82HOwp.js} +1 -1
- package/dist/assets/web/dist/assets/{jinja-CMYO9byN.js → jinja-BhjLrPOt.js} +1 -1
- package/dist/assets/web/dist/assets/{jison-Cko8HnE_.js → jison-DilGIUa8.js} +1 -1
- package/dist/assets/web/dist/assets/{json-Dzv__YsX.js → json-CrOcvmhJ.js} +1 -1
- package/dist/assets/web/dist/assets/{jsx-CTFxagih.js → jsx-BW_RX-fo.js} +1 -1
- package/dist/assets/web/dist/assets/{julia-_Xvten1-.js → julia-CWH071DB.js} +1 -1
- package/dist/assets/web/dist/assets/{just-bLps4qOu.js → just-DkhhoWBy.js} +1 -1
- package/dist/assets/web/dist/assets/{latex-D6UaYsUP.js → latex-cuHJ4TUT.js} +1 -1
- package/dist/assets/web/dist/assets/{liquid-CoDIeULa.js → liquid-DG6afYQN.js} +1 -1
- package/dist/assets/web/dist/assets/{lua-D1KFRnVf.js → lua-C5CMnCPS.js} +1 -1
- package/dist/assets/web/dist/assets/{main-DAL--hyj.js → main-Disot0n_.js} +3 -3
- package/dist/assets/web/dist/assets/{marko-B5N5XcOw.js → marko-Dy2_DuC4.js} +1 -1
- package/dist/assets/web/dist/assets/{mdc-uxzjQO3q.js → mdc-BMKb_EeA.js} +1 -1
- package/dist/assets/web/dist/assets/{nginx-BMJxs2TK.js → nginx-og0RgMKf.js} +1 -1
- package/dist/assets/web/dist/assets/{nim-DqQ3-8p1.js → nim-CQxTQQP0.js} +1 -1
- package/dist/assets/web/dist/assets/{org-DsY6LK59.js → org-b5lkq_Pl.js} +1 -1
- package/dist/assets/web/dist/assets/{perl--pq9iJFp.js → perl-D9X5_i_J.js} +1 -1
- package/dist/assets/web/dist/assets/{php-RHCMbsM2.js → php-CwUxvLX0.js} +1 -1
- package/dist/assets/web/dist/assets/{pug-CFNq_FCp.js → pug-uOIOExr0.js} +1 -1
- package/dist/assets/web/dist/assets/{qml-C9Acx9E8.js → qml-g5RoADf-.js} +1 -1
- package/dist/assets/web/dist/assets/{r-DxlU8FBd.js → r-5LdAopD3.js} +1 -1
- package/dist/assets/web/dist/assets/{razor-CLJ2kKih.js → razor-DwrvFLYQ.js} +1 -1
- package/dist/assets/web/dist/assets/{regexp-CzmdGoEp.js → regexp-dGtAaxC-.js} +1 -1
- package/dist/assets/web/dist/assets/{rst-D9yuxBET.js → rst-wFdW0brr.js} +1 -1
- package/dist/assets/web/dist/assets/{ruby-CIRcEvnD.js → ruby-DPglN6I9.js} +1 -1
- package/dist/assets/web/dist/assets/{sas-LOl-uUPh.js → sas-CUbCs40d.js} +1 -1
- package/dist/assets/web/dist/assets/{scss-BX2_sZHY.js → scss-B-DUiI1c.js} +1 -1
- package/dist/assets/web/dist/assets/{shellscript-4d-QvKkY.js → shellscript-lGOV7Ram.js} +1 -1
- package/dist/assets/web/dist/assets/{shellsession-DhB16UGy.js → shellsession-BDWtAAjr.js} +1 -1
- package/dist/assets/web/dist/assets/{soy-Cm1xTUBr.js → soy-zod_dcOy.js} +1 -1
- package/dist/assets/web/dist/assets/{sql-BsfcBJdu.js → sql-BG0HSSoM.js} +1 -1
- package/dist/assets/web/dist/assets/{sseReplay-BqgOggyQ.js → sseReplay-9gcMpylx.js} +1 -1
- package/dist/assets/web/dist/assets/{stata-Dwat3BSw.js → stata-BVUMLp1W.js} +1 -1
- package/dist/assets/web/dist/assets/{surrealql-P4rtxzAW.js → surrealql-DiSUbHKF.js} +1 -1
- package/dist/assets/web/dist/assets/{svelte-DTcsi8S8.js → svelte-DZenT45Y.js} +1 -1
- package/dist/assets/web/dist/assets/{templ-D-kP0Tg5.js → templ-BWKRNM0-.js} +1 -1
- package/dist/assets/web/dist/assets/{tex-D-4vuedK.js → tex-CbMzBlkK.js} +1 -1
- package/dist/assets/web/dist/assets/{ts-tags-jEEWYxsu.js → ts-tags-CZsVorDN.js} +1 -1
- package/dist/assets/web/dist/assets/{tsx-CFnlrVzT.js → tsx-R1r3mH4W.js} +1 -1
- package/dist/assets/web/dist/assets/{twig-D5rGrPjs.js → twig-BjPMyjKH.js} +1 -1
- package/dist/assets/web/dist/assets/{typescript-nYIQ35or.js → typescript-Bx-66VN_.js} +1 -1
- package/dist/assets/web/dist/assets/{typst-3-UX8dna.js → typst-fW037Eo6.js} +1 -1
- package/dist/assets/web/dist/assets/{vue-CLIPIX03.js → vue-D1V_GNxW.js} +1 -1
- package/dist/assets/web/dist/assets/{vue-html-Ci9CpkHU.js → vue-html-C-4pTZ-s.js} +1 -1
- package/dist/assets/web/dist/assets/{vue-vine-DL5pEYYk.js → vue-vine-C-QsX3hR.js} +1 -1
- package/dist/assets/web/dist/assets/{wallClock-DmaC1sKA.js → wallClock-x0hjr0J_.js} +1 -1
- package/dist/assets/web/dist/assets/{xml-bO80qikC.js → xml-BJTJXPgC.js} +1 -1
- package/dist/assets/web/dist/assets/{xsl-BPze60Ej.js → xsl-Xc9lukqe.js} +1 -1
- package/dist/assets/web/dist/assets/{yaml-BQUSon_o.js → yaml-Dw-FMsQa.js} +1 -1
- package/dist/cli.js +1988 -546
- package/package.json +4 -4
- package/dist/assets/web/dist/assets/CostsPage-BaeWnm-o.js +0 -1
- package/dist/assets/web/dist/assets/RunFoldRow-CwHDL-Mo.js +0 -1
- package/dist/assets/web/dist/assets/budgets-KNNkT4PZ.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coreplane/switchboard",
|
|
3
|
-
"version": "1.260.
|
|
3
|
+
"version": "1.260.5",
|
|
4
4
|
"description": "Mention it in Slack and an agent reviews the PR, ships the fix, or answers the question — on the model you choose, with its tools running where you decide.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://openswitchboard.dev",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"@earendil-works/pi-ai": "0.85.1",
|
|
38
38
|
"@slack/bolt": "^5.1.0",
|
|
39
39
|
"aws4fetch": "^1.0.20",
|
|
40
|
-
"e2b": "^2.
|
|
40
|
+
"e2b": "^2.49.1",
|
|
41
41
|
"mdast-util-from-markdown": "^2.0.3",
|
|
42
42
|
"undici": "^8.10.2",
|
|
43
|
-
"yaml": "^2.
|
|
44
|
-
"zod": "^4.5
|
|
43
|
+
"yaml": "^2.9.1",
|
|
44
|
+
"zod": "^4.6.5"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"esbuild": "^0.28.2",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./AppShell-CSXDCV4x.js";import{Cn as t,Cr as n,Ii as r,Li as i,Mn as a,Pi as o,Qr as s,Sn as c,Tr as l,Xr as u,Xt as d,_r as f,bn as p,dr as m,en as h,hr as ee,ji as g,kn as _,ln as v,o as y,xi as b,xn as x,yn as S}from"./browser-B6T5hjfR.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-DsuPS2g7.js";import{t as ae}from"./eventSource-Bj_dZf6M.js";import{r as oe}from"./settingsApi-Dm6eaQcu.js";import{t as se}from"./wallClock-DmaC1sKA.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`},z={class:`overflow-x-auto`},le={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=a({__name:`CostsByDimension`,props:{report:{}},setup(e){let r=e,a={user:`User`,thread:`Thread`,channel:`Channel`,agent:`Agent`,model:`Model`},l=b(``),u=b(!1),m=S(()=>r.report.dimension),ee=S(()=>r.report.viewer!==void 0),y=S(()=>(r.report.viewer?.userIds.length??0)>0),x=S(()=>r.report.cloudAllocated),C=S(()=>m.value===`model`?`Turns`:`Runs`),te=e=>m.value===`model`?e.turns:e.runs,w=S(()=>{let e=l.value.trim().toLowerCase(),t=new Set(r.report.viewer?.userIds??[]);return r.report.rows.filter(n=>u.value&&!t.has(n.key)?!1:!e||n.key.toLowerCase().includes(e)||(n.label??``).toLowerCase().includes(e))}),T=S(()=>r.report.rows.reduce((e,t)=>e+t.totalUsd,0)),E=S(()=>w.value.reduce((e,t)=>e+t.totalUsd,0)),k=e=>r.report.viewer?.userIds.includes(e.key)??!1,ne=S(()=>m.value===`user`||m.value===`thread`||m.value===`channel`),re=e=>e.label?m.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=S(()=>x.value?6:5);return(r,b)=>(f(),t(`section`,{class:`by-dimension grid gap-3`,"data-dimension":m.value},[p(`div`,ce,[p(`label`,N,[b[2]||=p(`span`,null,`Filter`,-1),s(p(`input`,{"onUpdate:modelValue":b[0]||=e=>l.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:m.value===`user`?`name or id`:a[m.value].toLowerCase(),"aria-label":`Filter by ${a[m.value].toLowerCase()}`},null,8,P),[[h,l.value]])]),ee.value?(f(),t(`label`,{key:0,class:o([`me-toggle flex items-center gap-2 text-sm`,y.value?`text-muted`:`text-dimmed`]),title:y.value?`Only your own runs`:void 0},[s(p(`input`,{"onUpdate:modelValue":b[1]||=e=>u.value=e,type:`checkbox`,disabled:!y.value,"aria-label":`Only me`,"aria-describedby":y.value?void 0:`me-hint`},null,8,I),[[d,u.value]]),b[3]||=p(`span`,null,`me`,-1),y.value?c(``,!0):(f(),t(`span`,L,`— your sign-in email matched no Slack user in this range`))],10,F)):c(``,!0),p(`p`,R,[e.report.coverage.historyOn?(f(),t(v,{key:1},[_(` runs from `+i(g(O)(e.report.coverage.from))+` to `+i(g(O)(e.report.range.to)),1),e.report.coverage.clamped?(f(),t(v,{key:0},[_(` · earlier days are past the history's `+i(e.report.coverage.retentionDays)+`-day window`,1)],64)):c(``,!0),e.report.pending>0?(f(),t(v,{key:1},[_(` · `+i(e.report.pending)+` run`+i(e.report.pending===1?``:`s`)+` still being priced`,1)],64)):c(``,!0)],64)):(f(),t(v,{key:0},[_(`run history is off — no runs to attribute`)],64))])]),p(`div`,z,[p(`table`,le,[p(`thead`,null,[p(`tr`,null,[p(`th`,B,i(a[m.value]),1),p(`th`,V,i(C.value),1),b[5]||=p(`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),x.value?(f(),t(`th`,H,[...b[4]||=[_(` Cloud `,-1),p(`span`,{class:`font-normal text-dimmed`},`allocated`,-1)]])):c(``,!0),b[6]||=p(`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),b[7]||=p(`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)])]),p(`tbody`,null,[(f(!0),t(v,null,n(w.value,e=>(f(),t(`tr`,{key:e.key,class:o([`by-row`,k(e)?`is-me`:``])},[p(`td`,{class:`border-b border-muted px-2.5 py-1.5`,title:e.key},[p(`span`,U,i(re(e)),1),ie(e)?(f(),t(`span`,de,i(ie(e)),1)):c(``,!0),k(e)?(f(),t(`span`,fe,`me`)):c(``,!0),e.unpricedTokens>0?(f(),t(`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)):c(``,!0)],8,ue),p(`td`,G,i(te(e)),1),p(`td`,K,i(g(D)(e.llmUsd)),1),x.value?(f(),t(`td`,q,i(g(D)(e.cloudUsd)),1)):c(``,!0),p(`td`,J,i(g(D)(e.totalUsd)),1),p(`td`,Y,i(T.value>0?Math.round(e.totalUsd/T.value*100):0)+`% `,1)],2))),128)),w.value.length===0?(f(),t(`tr`,X,[p(`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 ${a[m.value].toLowerCase()} matches`),9,Z)])):c(``,!0)]),w.value.length>0&&w.value.length<e.report.rows.length?(f(),t(`tfoot`,pe,[p(`tr`,null,[p(`td`,{class:`px-2.5 py-1.5 text-xs text-muted`,colspan:j.value-2},`shown`,8,Q),p(`td`,me,i(g(D)(E.value)),1),p(`td`,he,i(T.value>0?Math.round(E.value/T.value*100):0)+`% `,1)])])):c(``,!0)])]),p(`p`,ge,[e.report.reconciliation.comparedDays>0?(f(),t(v,{key:0},[_(` LLM attributed `+i(g(D)(e.report.reconciliation.attributedLlmUsd))+` of `+i(g(D)(e.report.reconciliation.workspaceLlmUsd))+` on the workspace over `+i(A(e.report.reconciliation.comparedDays))+` · `,1),e.report.reconciliation.unattributedLlmUsd>=0?(f(),t(v,{key:0},[_(i(g(D)(e.report.reconciliation.unattributedLlmUsd))+` unattributed (router, review abridges, runs without a record, list vs invoice) `,1)],64)):(f(),t(v,{key:1},[_(i(g(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)):(f(),t(v,{key:1},[_(`no day in range has a workspace LLM figure to compare against`)],64)),e.report.reconciliation.uncomparedDays>0?(f(),t(v,{key:2},[_(` · `+i(A(e.report.reconciliation.uncomparedDays))+` with `+i(g(D)(e.report.reconciliation.uncomparedLlmUsd))+` of run tokens but no workspace figure (billed outside this workspace) not compared`,1)],64)):c(``,!0),x.value?(f(),t(v,{key:3},[_(` · cloud allocated `+i(g(D)(e.report.reconciliation.cloudAllocatedUsd)),1),e.report.reconciliation.cloudUnallocatedUsd>0?(f(),t(v,{key:0},[_(` · `+i(g(D)(e.report.reconciliation.cloudUnallocatedUsd))+` on days with no runs`,1)],64)):c(``,!0)],64)):c(``,!0)]),p(`p`,_e,[m.value===`model`?(f(),t(v,{key:0},[_(` 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)):(f(),t(v,{key:1},[_(` A `+i(a[m.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=a({__name:`CostsPage`,setup(a){let s=y(`costs`),d=b(s?.report??null),h=S(()=>s?.groups??[]),O=S(()=>s?.group??d.value?.group??``),M=b(s?.snapshot??null),ce=se(void 0,6e4),N=S(()=>M.value?re(M.value,ce.value):``),P=S(()=>s?.view??`daily`),F=b(s&&s.view!==`daily`?s.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=S(()=>I.find(e=>e.view===P.value)??I[0]),R=S(()=>s?.canSnapshot===!0),z=S(()=>typeof window>`u`?null:new URLSearchParams(window.location.search).get(`days`)),le=e=>`/costs/${O.value}${e}${z.value?`?days=${z.value}`:``}`,B=s?.snapshot?.snapshot?.takenAt??null,V=B,H=null;async function ue(){try{let[e,t]=await Promise.all([fetch(le(`.json`),{credentials:`same-origin`}),P.value===`daily`?Promise.resolve(null):fetch(le(`/${P.value}.json`),{credentials:`same-origin`})]);return e.ok?(d.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;m(()=>{O.value&&(W=fe(`/costs/${O.value}?stream=1`),W.onmessage=e=>{let t=j(e.data);t&&de(t)})}),ee(()=>W?.close());let G=b(!1),K=b(``);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=S(()=>d.value?T(d.value):[]),X=S(()=>d.value?ie(d.value,Y.value):null),Z=S(()=>d.value?k(d.value):null),pe=S(()=>d.value?w(d.value):[]),Q=S(()=>d.value?te(d.value):null),me=S(()=>d.value?ne(d.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=S(()=>{let e=d.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=S(()=>d.value?[...d.value.days].reverse():[]),on=S(()=>(d.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=S(()=>{let e=d.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(a,s)=>{let m=l(`RouterLink`);return d.value&&Z.value?(f(),x(e,{key:0,title:`${d.value.label} spend`,nav:`costs`},{default:u(()=>[p(`div`,ye,[p(`nav`,be,[(f(),t(v,null,n(sn,e=>(f(),t(v,{key:e},[e===d.value.range.days?(f(),t(`span`,xe,i(cn(e)),1)):(f(),x(m,{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(d.value.group,e,P.value)},{default:u(()=>[_(i(cn(e)),1)]),_:2},1032,[`to`]))],64))),64))]),h.value.length>1?(f(),t(`nav`,Se,[(f(!0),t(v,null,n(h.value,e=>(f(),t(v,{key:e},[e===d.value.group?(f(),t(`span`,Ce,i(e),1)):(f(),x(m,{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,d.value.range.days,P.value)},{default:u(()=>[_(i(e),1)]),_:2},1032,[`to`]))],64))),128))])):c(``,!0),p(`p`,we,[_(i($(d.value.range.from))+` → `+i($(d.value.range.to))+` · `+i(d.value.range.days)+`d`,1),d.value.range.partialLastDay?(f(),t(v,{key:0},[_(` · today partial`)],64)):c(``,!0)]),N.value?(f(),t(`div`,Te,[p(`p`,Ee,i(N.value),1),R.value?(f(),t(`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)):c(``,!0),K.value?(f(),t(`span`,Oe,i(K.value),1)):c(``,!0)])):c(``,!0)]),p(`section`,ke,[Z.value.yesterday?(f(),t(`div`,Ae,[s[0]||=p(`span`,{class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`Yesterday`,-1),p(`span`,je,i(g(D)(Z.value.yesterday.total)),1),p(`span`,Me,i(Z.value.yesterday.date)+` · last full day`,1)])):(f(),t(`div`,Ne,[s[1]||=p(`span`,{class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`Today so far`,-1),p(`span`,Pe,i(Z.value.today?g(D)(Z.value.today.total):`—`),1),p(`span`,Fe,i(Z.value.today?`${Z.value.today.date} · partial day, UTC`:`no day in range`),1)])),p(`div`,Ie,[s[2]||=p(`span`,{class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`7-day average`,-1),p(`span`,Le,i(Z.value.avg7===void 0?`—`:g(D)(Z.value.avg7)),1),p(`span`,Re,i(Z.value.avg7===void 0?`no full day yet in this range`:`per day, full days only`),1)]),p(`div`,ze,[s[3]||=p(`span`,{class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`Projected month`,-1),p(`span`,Be,i(g(D)(Z.value.projection.monthUsd,0)),1),p(`span`,Ve,i(_e.value),1)]),p(`div`,He,[s[4]||=p(`span`,{class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`LLM spend`,-1),p(`span`,Ue,i(d.value.llmAvailable?g(D)(Z.value.llm.range):`—`),1),p(`span`,We,i(ln.value),1)]),p(`div`,Ge,[s[6]||=p(`span`,{class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`Share of account`,-1),p(`span`,Ke,i(Z.value.accountShare)+`%`,1),p(`span`,qe,[_(i(g(D)(d.value.totals.cloudUsd))+` of `+i(g(D)(d.value.account.cloudUsd))+` on `,1),Q.value?(f(),t(`a`,{key:0,class:`text-primary hover:underline`,href:Q.value.account,target:`_blank`,rel:`noopener noreferrer`,title:`Cloudflare account ${d.value.account.id}`},i(me.value),9,Je)):c(``,!0),s[5]||=_(` · Cloudflare spend in range · `,-1),Q.value?(f(),t(`a`,{key:1,class:`text-primary hover:underline`,href:Q.value.billing,target:`_blank`,rel:`noopener noreferrer`},`billing`,8,Ye)):c(``,!0)])])]),p(`section`,Xe,[p(`div`,Ze,[s[7]||=p(`div`,null,[p(`h2`,{class:`text-[0.9375rem] font-medium`},`Daily cost`),p(`p`,{class:`text-sm text-muted`},`Stacked by component · USD list price`)],-1),p(`div`,Qe,[(f(!0),t(v,null,n(Y.value,(e,n)=>(f(),t(`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`},[p(`i`,{class:o([`inline-block size-2.5 rounded-xs`,g(C)[n%g(C).length]])},null,2),_(i(e),1)],8,$e))),128))])]),X.value?(f(),x(A,{key:0,model:X.value,label:`Daily cost, stacked by component`},null,8,[`model`])):c(``,!0),d.value.llmAvailable?d.value.days.some(e=>e.llmEstimated)?(f(),t(`p`,tt,[s[9]||=_(` 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),d.value.days.some(e=>e.llmUnpricedTokens>0)?(f(),t(v,{key:0},[_(` Some tokens ran under a model this page has no price for and are not in the estimate. `)],64)):c(``,!0)])):c(``,!0):(f(),t(`p`,et,[...s[8]||=[_(` LLM spend not configured — set `,-1),p(`code`,null,`ANTHROPIC_ADMIN_KEY`,-1),_(` and the group's `,-1),p(`code`,null,`anthropicWorkspaceId`,-1),_(` to layer it in. `,-1)]]))]),p(`nav`,nt,[(f(),t(v,null,n(I,e=>(f(),t(v,{key:e.view},[e.view===P.value?(f(),t(`span`,rt,i(e.tab),1)):(f(),x(m,{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(d.value.group,d.value.range.days,e.view)},{default:u(()=>[_(i(e.tab),1)]),_:2},1032,[`to`]))],64))),64))]),P.value===`daily`?c(``,!0):(f(),t(`section`,it,[p(`div`,null,[p(`h2`,at,`Cost `+i(L.value.tab.toLowerCase()),1),p(`p`,ot,i(L.value.subtitle),1)]),F.value?(f(),x(ve,{key:0,report:F.value},null,8,[`report`])):(f(),t(`p`,st,` The `+i(L.value.tab.toLowerCase())+` report did not load with this page. `,1)),p(`p`,ct,[s[10]||=_(` Machine-readable twin: `,-1),p(`code`,lt,`GET /costs/`+i(d.value.group)+`/`+i(P.value)+`.json`,1),s[11]||=_(` (same Access gate). `,-1)])])),P.value===`daily`?(f(),t(`section`,ut,[s[12]||=p(`div`,null,[p(`h2`,{class:`text-[0.9375rem] font-medium`},`What each cloud dollar buys`)],-1),p(`table`,dt,[p(`tbody`,null,[(f(!0),t(v,null,n(pe.value,e=>(f(),t(`tr`,{key:e.label,class:`border-b border-muted`},[p(`td`,ft,[he(e.label)?(f(),t(`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)):(f(),t(v,{key:1},[_(i(e.label),1)],64))]),p(`td`,mt,i(g(D)(e.usd)),1),p(`td`,ht,i(Math.round(e.percent))+`%`,1),p(`td`,gt,[p(`i`,{class:`block h-2.5 rounded-xs bg-primary opacity-75`,style:r({width:`${e.percent.toFixed(1)}%`})},null,4)])]))),128))])])])):c(``,!0),P.value===`daily`?(f(),t(`section`,_t,[p(`details`,vt,[s[15]||=p(`summary`,{class:`cursor-pointer text-sm text-muted`},`Table view — daily cost by component (USD)`,-1),p(`div`,yt,[p(`table`,bt,[p(`thead`,null,[p(`tr`,null,[s[13]||=p(`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),(f(!0),t(v,null,n(Y.value,e=>(f(),t(`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)),s[14]||=p(`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)])]),p(`tbody`,null,[(f(!0),t(v,null,n(an.value,e=>(f(),t(`tr`,{key:e.date},[p(`td`,{class:`border-b border-muted px-2.5 py-1.5`,title:e.date},[_(i($(e.date))+` `,1),d.value.range.partialLastDay&&e.date===d.value.range.to?(f(),t(`span`,St,`(partial day`+i(e.llmEstimated?` · LLM estimated`:``)+`)`,1)):e.llmEstimated?(f(),t(`span`,Ct,`(LLM estimated)`)):c(``,!0)],8,xt),(f(!0),t(v,null,n(Y.value,n=>(f(),t(`td`,{key:n,class:`border-b border-muted px-2.5 py-1.5 text-right`},i(g(D)(g(E)(e,n),3)),1))),128)),p(`td`,wt,i(g(D)(e.total,3)),1)]))),128))])])])]),p(`p`,Tt,[s[16]||=_(` Machine-readable twin: `,-1),p(`code`,Et,`GET /costs/`+i(d.value.group)+`.json`,1),s[17]||=_(` (same Access gate). `,-1)])])):c(``,!0),P.value===`daily`&&on.value.length?(f(),t(`section`,Dt,[s[22]||=p(`div`,null,[p(`h2`,{class:`text-[0.9375rem] font-medium`},`Invoice tie-out by biller`),p(`p`,{class:`text-xs text-muted`},[_(` Each biller's own invoice beside the summed `),p(`code`,null,`model.turn`),_(` 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 `),p(`code`,null,`usd`),_(` (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),(f(!0),t(v,null,n(on.value,e=>(f(),t(`div`,{key:e.biller,class:`grid gap-1.5`,"data-biller":e.biller},[p(`p`,kt,[p(`b`,null,i(e.biller),1),e.invoice?(f(),t(v,{key:0},[_(` · invoice `+i(g(D)(e.totals.invoiceUsd,4))+` · attributed `+i(g(D)(e.totals.attributedUsd,4)),1)],64)):(f(),t(`span`,At,` · no invoice — the block names no invoice source`)),e.unpricedTokens>0?(f(),t(`span`,jt,` · `+i(e.unpricedTokens.toLocaleString(`en-US`))+` tokens unpriced — not in the attributed figure`,1)):c(``,!0)]),e.days.length?(f(),t(`div`,Mt,[p(`table`,Nt,[p(`thead`,null,[p(`tr`,null,[s[18]||=p(`th`,{class:`border-b border-muted px-2.5 py-1 text-left text-xs font-medium text-muted`},`Date`,-1),e.invoice?(f(),t(`th`,Pt,` Invoice `)):c(``,!0),s[19]||=p(`th`,{class:`border-b border-muted px-2.5 py-1 text-right text-xs font-medium text-muted`},`Attributed`,-1),s[20]||=p(`th`,{class:`border-b border-muted px-2.5 py-1 text-right text-xs font-medium text-muted`},` Fee (invoice / rows) `,-1),s[21]||=p(`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?(f(),t(`th`,Ft,` Unpriced tokens `)):c(``,!0)])]),p(`tbody`,null,[(f(!0),t(v,null,n(e.days,n=>(f(),t(`tr`,{key:n.date},[p(`td`,{class:`border-b border-muted px-2.5 py-1`,title:n.date},i($(n.date)),9,It),e.invoice?(f(),t(`td`,Lt,i(n.invoiceUsd===void 0?`—`:g(D)(n.invoiceUsd,4)),1)):c(``,!0),p(`td`,Rt,i(g(D)(n.attributedUsd,4)),1),p(`td`,zt,[n.invoiceFeeUsd!==void 0||n.attributedFeeUsd!==void 0?(f(),t(v,{key:0},[_(i(n.invoiceFeeUsd===void 0?`—`:g(D)(n.invoiceFeeUsd,4))+` / `+i(n.attributedFeeUsd===void 0?`—`:g(D)(n.attributedFeeUsd,4)),1)],64)):(f(),t(v,{key:1},[_(`—`)],64))]),p(`td`,Bt,[n.invoiceByokUsd!==void 0||n.attributedUpstreamUsd!==void 0?(f(),t(v,{key:0},[_(i(n.invoiceByokUsd===void 0?`—`:g(D)(n.invoiceByokUsd,4))+` / `+i(n.attributedUpstreamUsd===void 0?`—`:g(D)(n.attributedUpstreamUsd,4)),1)],64)):(f(),t(v,{key:1},[_(`—`)],64))]),e.unpricedTokens>0?(f(),t(`td`,Vt,i((n.unpricedTokens??0).toLocaleString(`en-US`)),1)):c(``,!0)]))),128))])])])):c(``,!0)],8,Ot))),128))])):c(``,!0),p(`footer`,Ht,[p(`details`,null,[s[30]||=p(`summary`,{class:`cursor-pointer text-muted`},`How these numbers are computed`,-1),p(`div`,Ut,[s[28]||=p(`div`,null,[p(`b`,null,`Snapshot.`),_(` 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 `),p(`em`,null,`today`),_(` 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 (`),p(`code`,null,`costs.snapshot.everyHours`),_(`, daily by default); `),p(`code`,null,`costs snapshot`),_(` 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 `),p(`code`,null,`usd`),_(`, never the price table's repricing the dimension tabs show, with the tokens no turn priced counted beside it as unpriced. `)],-1),s[29]||=p(`div`,null,[p(`b`,null,`Method.`),_(` Cloudflare GraphQL Analytics, every meter a Workers deployment is billed on: `),p(`code`,null,`containersUsageAdaptiveGroups`),_(` (cpuTimeSec, allocatedMemory, allocatedDisk per app per UTC day), `),p(`code`,null,`durableObjectsPeriodicGroups`),_(` (billable `),p(`code`,null,`duration`),_(` GB-s and SQLite rows read and written per namespace), `),p(`code`,null,`durableObjectsInvocationsAdaptiveGroups`),_(` (requests per namespace), `),p(`code`,null,`durableObjectsSqlStorageGroups`),_(` (bytes stored), `),p(`code`,null,`workersInvocationsAdaptive`),_(` (requests, CPU time), `),p(`code`,null,`r2StorageAdaptiveGroups`),_(` and `),p(`code`,null,`r2OperationsAdaptiveGroups`),_(` (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),p(`div`,null,[s[23]||=p(`b`,null,`Scope.`,-1),s[24]||=_(` Attributed to this group: the Workers `,-1),(f(!0),t(v,null,n(d.value.attribution.workers,(e,n)=>(f(),t(v,{key:e},[n>0?(f(),t(v,{key:0},[_(`, `)],64)):c(``,!0),Q.value?(f(),t(`a`,{key:1,class:`font-mono hover:underline`,href:Q.value.worker(e),target:`_blank`,rel:`noopener noreferrer`},i(e),9,Wt)):(f(),t(`code`,Gt,i(e),1))],64))),128)),_(`, every Durable Object namespace they host (`+i(Object.keys(d.value.attribution.durableObjectNamespaces).length)+`), the R2 buckets named after them (`,1),(f(!0),t(v,null,n(Object.keys(d.value.attribution.r2Buckets),(e,n)=>(f(),t(v,{key:e},[n>0?(f(),t(v,{key:0},[_(`, `)],64)):c(``,!0),Q.value?(f(),t(`a`,{key:1,class:`font-mono hover:underline`,href:Q.value.bucket(e),target:`_blank`,rel:`noopener noreferrer`},i(e),9,Kt)):(f(),t(`code`,qt,i(e),1))],64))),128)),Object.keys(d.value.attribution.r2Buckets).length===0?(f(),t(v,{key:0},[_(`none`)],64)):c(``,!0),s[25]||=_(`), and the container apps mapped in `,-1),p(`code`,null,`costs.groups.`+i(d.value.group),1),_(` (`+i(Object.keys(d.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?(f(),t(`a`,{key:1,class:`hover:underline`,href:Q.value.account,target:`_blank`,rel:`noopener noreferrer`},`Cloudflare dashboard`,8,Jt)):c(``,!0),s[26]||=_(` for the account `,-1),p(`code`,null,i(d.value.account.id),1),_(i(d.value.account.name?` (${d.value.account.name})`:``)+`, and `,1),Q.value?(f(),t(`a`,{key:2,class:`hover:underline`,href:Q.value.anthropic,target:`_blank`,rel:`noopener noreferrer`},`Anthropic's cost page`,8,Yt)):c(``,!0),s[27]||=_(` for the LLM line. `,-1)])])])])]),_:1},8,[`title`])):(f(),x(e,{key:1,title:`${O.value} spend`,nav:`costs`},{default:u(()=>[p(`div`,Xt,[h.value.length>1?(f(),t(`nav`,Zt,[(f(!0),t(v,null,n(h.value,e=>(f(),t(v,{key:e},[e===O.value?(f(),t(`span`,Qt,i(e),1)):(f(),x(m,{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:u(()=>[_(i(e),1)]),_:2},1032,[`to`]))],64))),128))])):c(``,!0)]),p(`section`,$t,[s[31]||=p(`h2`,{class:`text-sm font-medium text-highlighted`},`Nothing to show yet`,-1),p(`div`,en,[p(`p`,tn,i(N.value),1),R.value?(f(),t(`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)):c(``,!0),K.value?(f(),t(`span`,rn,i(K.value),1)):c(``,!0)]),s[32]||=p(`p`,{class:`text-xs text-dimmed`},[_(` 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 `),p(`code`,null,`costs snapshot`),_(`. `)],-1)])]),_:1},8,[`title`]))}}});export{an as default};
|
|
@@ -1 +0,0 @@
|
|
|
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-B6T5hjfR.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-Dxg7C8s9.js";import"./format-BldUwl_R.js";import{n as ae}from"./SlackMark-CtiHrNjr.js";import{c as oe,l as se,n as ce,t as le,w as z}from"./sseReplay-BqgOggyQ.js";import{n as ue,t as de}from"./durationTone-CVpX_yIk.js";import{t as B}from"./StatusDot-x7vcK0iE.js";var fe={merged:`merged`,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 +0,0 @@
|
|
|
1
|
-
var e=6e4,t=t=>t*e,n=1440*e;7*n,10*e,15*e,5*e,60*e,10*e,3*e,60*e,30*n,10*e;var r={general:2,coding:15,review:5,research:3,explore:15,conductor:15,orchestrator:2};r.coding,r.coding,r.review;var i={marginMinutes:5,chunkMinutes:5,mergeChunkMinutes:5,busyRetryMinutes:2};t(i.chunkMinutes);export{i as n,t as r,e as t};
|