diff --git a/README.md b/README.md
index ff632c1..066a3b8 100644
--- a/README.md
+++ b/README.md
@@ -1119,6 +1119,17 @@ SESSION` is only an inactivity inference, fresh activity anywhere in the group
suppresses a stale sibling's check; definite input and approval are never
suppressed this way.
+Named sessions show ` Quota refresh failed. Policy state is based on the last successful
observation. The longest Codex quota window selects one active model profile. ASK
@@ -7,24 +7,25 @@
eligible check. No threshold-based model steps were configured at launch. Quota refresh failed. Values below are the last successful observation. Expiry details unavailable. No listed expiry does not mean no expiry. Read-only preview. Use the terminal to redeem a reset. The backend may return only some credits. This list does not establish
+ observation table for times, positions and gaps. Quota refresh failed. Values below are the last successful observation. Expiry details unavailable. No listed expiry does not mean no expiry. Read-only preview. Use the terminal to redeem a reset. The backend may return only some credits. This list does not establish
redemption order. Cycle duration or reset date unavailable — position cannot be
plotted. Cycle duration unavailable — pace cannot be calculated. No quota windows reported yet. All reported windows are shown. API-equivalent learning and quota status
scoring remain in the terminal for this first preview. MODEL / REASONING LEVEL / SPEED MODEL / REASONING LEVEL / SPEED Applied settings remain after Codexometer closes. Command unavailable from this observation. Open Codex to inspect the
request. Session controls temporarily unavailable. Check Codex for current state. Checking session controls… Controls require a supported live request from a connected shared
app-server session. Local observations alone cannot provide them. Type one of these choices exactly. Your answer stays masked. Command unavailable from this observation. Open Codex to inspect the
+ carefully.`),io=K(``),ao=K(``),oo=K(``),so=K(``),co=K(` `,1),lo=K(` Type one of these choices exactly. Your answer stays masked. Command unavailable from this observation. Open Codex to inspect the
request. Session connection or refresh unavailable. Context and telemetry may be
stale. Some quota profile checks are unavailable. Only sessions with freshly
verified quota and settings can be updated; previous outcome notices remain
- visible. Read only — reply or approve in Codex. This session is no longer in the current observation. Return to sessions. No locally observed sessions yet. Keep Codex running alongside
- Codexometer. ↑ ↓ SELECT SESSION // ← LESS DETAIL // → MORE DETAIL // ESC BACK 0){var E=i&4&&s===0?n:null;if(o){for(v=0;v0){var E=i&4&&s===0?n:null;if(o){for(v=0;v
`),va=K(` Observed at Period elapsed Consumed Trail segment
Observed quota
path, not individual session usage. Gaps are not interpolated. Expand the
- observation table for times, positions and gaps.OBSERVATION TABLE
OBSERVATION TABLE
CURRENT PROFILE
PROPOSED PROFILE
`,1),Xa=K(`About browser controls
`),ro=K(`Grants permission beyond this one command. Check the scope
- carefully.`),io=K(``),ao=K(``),oo=K(``),so=K(``),co=K(` `,1),lo=K(`View fixed choices
`),So=K(`
`),Co=K(`View fixed choices
`),So=K(`
`),Co=K(`
`,1),To=K(`
`,1),Do=K(`
TOKEN ACTIVITY // 30 SECOND SAMPLES
SESSION TOTALS
Read only — reply or approve in Codex.
`),Po=K(``),Fo=K(`QUOTA THRESHOLD // REVIEW PROFILE ↗`),Io=K(`
This session is no longer in the current observation. Return to sessions.
`),zo=K(``),Bo=K(``),Vo=K(``),Ho=K(` `),Uo=K(`
`),Wo=K(`QUOTA THRESHOLD // REVIEW PROFILE ↗`),Go=K(` `,1),Ko=K(`
No locally observed sessions yet. Keep Codex running alongside + Codexometer.
`),Xo=K(`↑ ↓ SELECT SESSION // ← LESS DETAIL // → MORE DETAIL // ESC BACK
`,1);function Qo(e,t){qe(t,!0);let n=(e,t=f,n,r)=>{let i=yt(()=>g(n?.(),!0)),a=yt(()=>g(r?.(),!1));var o=Eo(),s=R(o),c=e=>{var n=bo();let r;var i=z(n,!0);V(e=>{r=li(n,1,`attention-note`,null,r,{inferred:t().status===`CHECK SESSION`}),J(i,e)},[()=>b(t())]),q(e,n)},l=N(()=>b(t())&&(!W(a)||W(d)||t().status===`CHECK SESSION`));Y(s,e=>{W(l)&&e(c)});var u=B(s,2),p=e=>{var n=xo(),r=z(n,!0);V(()=>J(r,t().contextKind||`LAST ACTIVITY`)),q(e,n)};Y(u,e=>{W(i)&&e(p)});var m=B(u,2),h=z(m,!0),_=B(m,2),v=e=>{var n=wo(),r=B(R(n),2),i=z(r,!0),a=B(r,2),o=e=>{var n=So(),r=z(n,!0);V(()=>J(r,t().command)),q(e,n)},s=e=>{q(e,Co())};Y(a,e=>{t().command?e(o):e(s,-1)}),V(()=>J(i,W(d)||t().status!==`APPROVAL NEEDED`?`LAST OBSERVED COMMAND`:$.data?.control?`COMMAND REQUEST`:`COMMAND TO APPROVE IN CODEX`)),q(e,n)};Y(_,e=>{(!W(a)||!$.data?.control)&&(t().command||t().status===`APPROVAL NEEDED`)&&e(v)});var y=B(_,2),x=e=>{var n=To(),r=z(n);V(()=>J(r,`CONTEXT SOURCE // ${(t().source||`LOCAL`)??``} // OBSERVATION`)),q(e,n)};Y(y,e=>{W(a)||e(x)}),V(()=>J(h,t().text||`No session context available.`)),q(e,o)},r=zi(t,`params`,19,()=>({})),i=N(()=>$.data?.sessions||[]),a=N(()=>$.data?.control&&$.data.profiles||[]),o=F(!1);function s(e,t){if(r().id&&r().id!==t&&W(o)){e.preventDefault();return}h(t)}Sn(()=>{let e=r().id;e&&gr(()=>{Zi.selected=e,na(e,2)})});let c=N(()=>W(i).find(e=>e.id===r().id)),l=N(()=>new URLSearchParams(Ui.querystring).get(`review`)===`profile`&&W(a).some(e=>e.session===r().id&&e.pending)),u=N(()=>W(i).some(e=>e.id===Zi.selected)?Zi.selected:W(i)[0]?.id),d=N(()=>!$.connected||!!$.data?.sessionsError),p=N(()=>[[`OBSERVED TOKENS`,ra(W(i).reduce((e,t)=>e+t.tokens,0))],[`LISTED SESSIONS`,ra(W(i).length)],...[[`WORKING`,`WORKING`],[`AWAITING APPROVAL`,`APPROVAL NEEDED`],[`AWAITING INPUT`,`INPUT NEEDED`],[`CHECK · INFERRED`,`CHECK SESSION`]].map(([e,t])=>[e,W(d)?`—`:ra(W(i).filter(e=>e.status===t).length)])]),m=N(()=>W(i).filter(e=>[`INPUT NEEDED`,`APPROVAL NEEDED`,`CHECK SESSION`].includes(e.status)));function h(e){Zi.selected=e,pr().then(()=>document.querySelector(`.session-row.selected`)?.scrollIntoView({block:`nearest`}))}function v(e,t){if(h(e),r().id){t<0&&(na(e,2),location.hash=`/sessions`);return}let n=ea(e)+t;n>2?location.hash=`/sessions/`+encodeURIComponent(e):na(e,n)}function y(e){let t=e.target;if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||t.closest(`input, textarea, select, [contenteditable="true"]`))){if(e.key===`Escape`&&r().id)e.preventDefault(),v(r().id,-1);else if([`ArrowLeft`,`ArrowRight`].includes(e.key)&&(r().id||W(u)))e.preventDefault(),v(r().id||W(u),e.key===`ArrowLeft`?-1:1);else if(!r().id&&[`ArrowUp`,`ArrowDown`].includes(e.key)&&W(i).length){e.preventDefault();let t=W(i).findIndex(e=>e.id===W(u));h(W(i)[Math.max(0,Math.min(W(i).length-1,t+(e.key===`ArrowUp`?-1:1)))].id)}}}function b(e){return W(d)?`Last observation only — refresh unavailable. Check Codex for current state.`:e.status===`CHECK SESSION`?`INFERRED INACTIVITY — a quiet session, not a confirmed input or approval request. Local tools may still be running.`:$.data?.control&&[`APPROVAL NEEDED`,`INPUT NEEDED`].includes(e.status)?`Open full detail for supported live controls; otherwise reply in Codex.`:e.status===`APPROVAL NEEDED`?`OBSERVED APPROVAL SIGNAL — approve or decline in Codex.`:e.status===`INPUT NEEDED`?`OBSERVED INPUT SIGNAL — reply in Codex.`:e.status===`TURN COMPLETE`?`OBSERVED TURN COMPLETION — informational, not an approval request.`:``}var x=Zo();Tr(`keydown`,nn,y);var S=R(x),C=z(B(L(S),2));A(S);var w=B(S,2);let T;Z(w,21,()=>W(p),X,(e,t)=>{var n=N(()=>_(W(t),2));let r=()=>W(n)[0],i=()=>W(n)[1];var a=Do(),o=L(a),s=z(o,!0),c=z(B(o,2),!0);A(a),V(()=>{J(s,r()),J(c,i())}),q(e,a)}),A(w);var E=B(w,2),ee=z(E),D=B(E,2),te=e=>{q(e,Oo())};Y(D,e=>{W(d)&&e(te)});var ne=B(D,2),re=e=>{q(e,ko())};Y(ne,e=>{$.data?.profileError&&e(re)});var ie=B(ne,2),ae=e=>{var t=Mo(),n=L(t);Z(n,17,()=>W(m),X,(e,t)=>{var n=Ao();let r;var i=z(n);V((e,a)=>{r=li(n,1,`button`,null,r,{approval:W(t).status===`APPROVAL NEEDED`}),Q(n,`href`,e),J(i,`${W(t).status??``} + ${a??``} // ${(W(t).name||W(t).directory||W(t).id)??``}`)},[()=>`#/sessions/`+encodeURIComponent(W(t).id),()=>Array.from(W(t).id).slice(-5).join(``).toUpperCase()]),G(`click`,n,()=>h(W(t).id)),q(e,n)}),Z(B(n,2),17,()=>W(a).filter(e=>e.pending&&W(i).some(t=>t.id===e.session)),X,(e,t)=>{var n=jo(),a=z(n);V((e,i,s)=>{Q(n,`title`,r().id&&r().id!==W(t).session&&W(o)?`Finish sending or clear your current draft before switching sessions.`:`Review this session’s quota threshold`),Q(n,`href`,e),J(a,`QUOTA THRESHOLD ${i??``} // ${s??``}`)},[()=>`#/sessions/`+encodeURIComponent(W(t).session)+`?review=profile`,()=>Array.from(W(t).session).slice(-5).join(``).toUpperCase(),()=>W(i).find(e=>e.id===W(t).session)?.name||W(i).find(e=>e.id===W(t).session)?.directory||W(t).session]),G(`click`,n,e=>s(e,W(t).session)),q(e,n)}),A(t),q(e,t)},oe=N(()=>(W(m).length||W(a).some(e=>e.pending))&&!W(d));Y(ie,e=>{W(oe)&&e(ae)});var se=B(ie,2),ce=e=>{var t=Ir(),i=R(t),s=e=>{var t=Lo(),i=L(t),s=L(i),u=L(s);let f;var p=B(u);A(s);var m=B(s,2);A(i);var g=B(i,2),_=e=>{var t=To(),n=z(t,!0);V(()=>J(n,W(c).directory)),q(e,t)};Y(g,e=>{W(c).name&&W(c).directory&&e(_)});var v=B(g,2),y=z(v),b=B(v,2);let x;var S=L(b),C=L(S);n(C,()=>W(c),()=>!0,()=>!0),A(S);var w=B(S,2),T=e=>{var t=Ir();Jr(R(t),()=>W(c).id,e=>{_o(e,{get session(){return W(c).id},get observedCommand(){return W(c).command},get suspended(){return W(l)},onProtectedChange:e=>{I(o,e,!0)}})}),q(e,t)},E=e=>{q(e,No())};Y(w,e=>{$.data?.control?e(T):e(E,-1)}),A(b);var ee=B(b,2);Z(ee,17,()=>W(a).filter(e=>e.session===W(c).id),e=>e.session,(e,t)=>{var n=Io(),r=L(n),i=e=>{var n=Po(),r=z(n,!0);V(()=>J(r,W(t).notice)),q(e,n)};Y(r,e=>{W(t).notice&&e(i)});var a=B(r,2),o=e=>{_o(e,{get session(){return W(c).id},review:`profile`})},s=e=>{var t=Fo();V(e=>Q(t,`href`,e),[()=>`#/sessions/`+encodeURIComponent(W(c).id)+`?review=profile`]),q(e,t)};Y(a,e=>{W(t).pending&&W(l)?e(o):W(t).pending&&e(s,1)}),A(n),V(()=>Q(n,`id`,`quota-profile-`+W(c).id)),q(e,n)});var D=B(ee,2),te=e=>{var t=Ir();Jr(R(t),()=>W(c).id,e=>{yo(e,{get session(){return W(c)},active:!0})}),q(e,t)};Y(D,e=>{W(l)||e(te)}),A(t),V(e=>{f=li(u,1,`lamp lit`,null,f,{working:W(c).status===`WORKING`&&!W(d)}),J(p,`${(W(d)?`STALE`:W(l)?`QUOTA THRESHOLD`:W(c).status)??``} // ${(W(c).name||W(c).directory)??``}`),J(y,`${e??``} TOKENS // ${W(c).id??``} // CONTEXT SOURCE // ${(W(c).source||`LOCAL`)??``}`),x=di(b,``,x,{display:W(l)?`none`:void 0})},[()=>ra(W(c).tokens)]),G(`click`,m,()=>{h(r().id),na(r().id,2)}),q(e,t)},u=e=>{q(e,Ro())};Y(i,e=>{W(c)?e(s):e(u,-1)}),q(e,t)},le=e=>{var t=Xo(),r=R(t),o=B(L(r),2),c=L(o),l=B(c,2);A(o),A(r);var f=B(r,2);Z(f,17,()=>W(i),e=>e.id,(e,t)=>{let r=N(()=>ea(W(t).id));var i=Jo();let o;var c=L(i),l=L(c),f=e=>{var n=zo(),r=L(n),i=z(r);A(n),V(e=>{Q(r,`aria-pressed`,W(u)===W(t).id),J(i,`${e??``} // ${W(t).name??``}`)},[()=>Array.from(W(t).id).slice(-5).join(``).toUpperCase()]),G(`click`,r,()=>h(W(t).id)),q(e,n)};Y(l,e=>{W(t).name&&e(f)});var p=B(l,2),m=L(p),g=L(m);let _;var y=B(g,1,!0);A(m),A(p);var b=B(p,2),x=e=>{var n=Bo(),r=z(n,!0);V(()=>{Q(n,`aria-pressed`,W(u)===W(t).id),J(r,W(t).directory||W(t).id)}),G(`click`,n,()=>h(W(t).id)),q(e,n)};Y(b,e=>{W(t).name||e(x)});var S=B(b,2),C=L(S);Ee(),A(S);var w=B(S,2),T=e=>{var n=To(),r=z(n,!0);V(()=>J(r,W(t).directory)),q(e,n)};Y(w,e=>{W(t).name&&W(t).directory&&e(T)});var E=B(w,2),ee=z(E),D=B(E,2),te=z(D),ne=B(D,2),re=L(ne),ie=B(re,2),ae=z(ie,!0),oe=B(ie,2);A(ne);var se=B(ne,2),ce=B(se,2),le=e=>{var n=Vo(),r=z(n,!0);V(()=>J(r,W(t).status===`CHECK SESSION`?`INFERRED INACTIVITY`:$.data?.control?`OPEN FULL DETAIL OR REPLY IN CODEX`:W(t).status===`APPROVAL NEEDED`?`APPROVE OR DECLINE IN CODEX`:`REPLY IN CODEX`)),q(e,n)},ue=N(()=>!W(d)&&[`APPROVAL NEEDED`,`INPUT NEEDED`,`CHECK SESSION`].includes(W(t).status));Y(ce,e=>{W(ue)&&e(le)}),A(c);var de=B(c,2),fe=e=>{var r=Ko(),i=L(r),o=L(i),c=z(o,!0),l=B(o,2),f=e=>{var n=Ho(),r=z(n,!0);V(e=>{Q(n,`href`,e),J(r,$.data?.control?`REVIEW IN FULL DETAIL ↗`:`APPROVAL IN CODEX ↗`)},[()=>`#/sessions/`+encodeURIComponent(W(t).id)]),q(e,n)};Y(l,e=>{!W(d)&&W(t).status===`APPROVAL NEEDED`&&e(f)}),A(i);var p=B(i,2);n(p,()=>W(t),()=>!1);var m=B(p,2);Z(m,17,()=>W(a).filter(e=>e.session===W(t).id),X,(e,n)=>{var r=Go(),i=R(r),a=e=>{var t=Uo(),r=z(t,!0);V(()=>J(r,W(n).notice)),q(e,t)};Y(i,e=>{W(n).notice&&e(a)});var o=B(i,2),c=e=>{var n=Wo();V(e=>Q(n,`href`,e),[()=>`#/sessions/`+encodeURIComponent(W(t).id)+`?review=profile`]),G(`click`,n,e=>s(e,W(t).id)),q(e,n)};Y(o,e=>{W(n).pending&&e(c)}),q(e,r)});var h=B(m,2);{let e=N(()=>W(u)===W(t).id);yo(h,{get session(){return W(t)},get active(){return W(e)}})}A(r),V(()=>J(c,W(t).contextKind||`LAST ACTIVITY`)),q(e,r)};Y(de,e=>{W(r)>0&&e(fe)});var pe=B(de,2),me=e=>{var n=qo(),r=B(L(n),2);{let e=N(()=>(W(t).samples||[]).map(e=>e.tokens));Ka(r,{get values(){return W(e)},capacity:120})}var i=z(B(r,2));A(n),V(()=>J(i,`LAST ${(W(t).samples?.length||0)??``} SAMPLES // AUTO SCALE`)),q(e,n)};Y(pe,e=>{W(r)<2&&e(me)}),A(i),V((e,n,a,s)=>{o=li(i,1,`session-row`,null,o,{selected:W(u)===W(t).id,wide:W(r)===2,split:W(r)===1}),Q(i,`aria-label`,`Session `+(W(t).name||W(t).directory||W(t).id)),Q(m,`href`,e),_=li(g,1,`lamp lit`,null,_,{working:W(t).status===`WORKING`&&!W(d)}),J(y,W(d)?`STALE`:W(t).status),J(C,`${n??``} `),J(ee,`${W(t).agents??``} LINKED AGENTS`),J(te,`ACTIVE // ${a??``}`),re.disabled=W(r)===0,Q(ie,`aria-expanded`,W(r)>0),J(ae,W(r)?`HIDE DETAIL`:`SHOW DETAIL`),Q(se,`href`,s)},[()=>`#/sessions/`+encodeURIComponent(W(t).id),()=>ra(W(t).tokens),()=>ia(W(t).activity),()=>`#/sessions/`+encodeURIComponent(W(t).id)]),G(`click`,m,()=>h(W(t).id)),G(`click`,re,()=>v(W(t).id,-1)),G(`click`,ie,()=>{h(W(t).id),na(W(t).id,+!W(r))}),G(`click`,oe,()=>v(W(t).id,1)),G(`click`,se,()=>h(W(t).id)),q(e,i)});var p=B(f,2),m=e=>{q(e,Yo())};Y(p,e=>{W(i).length||e(m)}),G(`click`,c,()=>ta(1)),G(`click`,l,()=>ta(0)),q(e,t)};Y(se,e=>{r().id?e(ce):e(le,-1)}),V(e=>{J(C,`OBSERVED ${e??``}`),T=li(w,1,`session-totals`,null,T,{stale:W(d)}),J(ee,`${W(d)?`LAST KNOWN TOTALS — live state counts unavailable. `:``}Tokens observed since this server started for currently listed sessions; linked agents are already included. Totals can decrease when a session leaves the - list. History samples every 30 seconds. Not account-wide totals.`)},[()=>ia($.data?.sessionsAt)]),q(e,x),Je()}Er([`click`]);var Zo=864e5;function Qo(e,t){let n=new Date(e);n.setUTCDate(1),n.setUTCMonth(n.getUTCMonth()+t);let r=new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth()+1,0)).getUTCDate();return n.setUTCDate(Math.min(e.getUTCDate(),r)),n}function $o(e,t,n){let r=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()));for(let e=0;;e++){let i=Qo(r,-t),a=new Date(i.getTime()+Zo);if(e===n)return{start:a,end:r};r=i}}var es=K(`
History refresh failed. Any displayed history is the last successful - observation.
`),ts=K(``),ns=K(``),rs=K(`LESS ░ ▒ ▓ █ MORE // HOVER FOR DATE AND TOKENS
`,1),is=K(`
DAYS
| Date (UTC) | Tokens |
|---|
`,1),ss=K(`
History unavailable or awaiting a matching account observation. Missing - history is not treated as zero usage.
`),cs=K(`Account-wide history reported by Codex, not the local Sessions counter. Dates - use UTC. Historical resets are not provided by this data.
`,1);function ls(e,t){qe(t,!0);let n=F(`daily`),r=F(12),i=F(0),a=N(()=>{let e=$.data?.usage?.dailyUsageBuckets;if(!e)return[];let{start:t,end:n}=$o(new Date,W(r),W(i)),a=new Map;for(let t of e)!Number.isFinite(t.tokens)||t.tokens<0||a.set(t.startDate,(a.get(t.startDate)||0)+t.tokens);let o=[];for(let e=t;e<=n;e=new Date(e.getTime()+864e5)){let t=e.toISOString().slice(0,10);o.push({date:t,tokens:a.get(t)||0})}return o}),o=N(()=>Math.max(1,...W(a).map(e=>e.tokens))),s=N(()=>W(a).length?new Date(W(a)[0].date+`T00:00:00Z`).getUTCDay():0),c=N(()=>{if(W(n)===`monthly`){let e=new Map;for(let t of W(a))e.set(t.date.slice(0,7),(e.get(t.date.slice(0,7))||0)+t.tokens);return[...e].map(([e,t])=>({date:e,tokens:t}))}let e=0;return W(a).map(t=>({date:t.date,tokens:e+=t.tokens}))});var l=cs(),u=B(R(l),4),d=L(u),f=B(L(d)),p=L(f);p.value=p.__value=`daily`;var m=B(p);m.value=m.__value=`monthly`;var h=B(m);h.value=h.__value=`cumulative`,A(f),hi(f),A(d);var g=B(d),_=B(L(g)),v=L(_);v.value=v.__value=6;var y=B(v);y.value=y.__value=12,A(_),hi(_),A(g);var b=B(g),x=B(b);A(u);var S=B(u,2),C=e=>{q(e,es())};Y(S,e=>{$.data?.usageError&&e(C)});var w=B(S,2),T=e=>{var t=os(),r=R(t),i=L(r),l=z(B(L(i),2),!0);A(i);var u=B(i,2),d=z(B(L(u),2),!0);A(u);var f=B(u,2),p=B(L(f),2),m=L(p);Ee(),A(p),A(f),A(r);var h=B(r,2),g=L(h),_=z(g),v=B(g,2),y=e=>{var t=rs(),n=R(t),r=L(n),i=L(r);Z(i,17,()=>Array(W(s)),X,(e,t)=>{q(e,ts())}),Z(B(i,2),17,()=>W(a),X,(e,t)=>{var n=ns();let r,i;V(e=>{r=li(n,1,`heat-cell`,null,r,{zero:W(t).tokens===0}),Q(n,`title`,e),i=di(n,``,i,{opacity:W(t).tokens?.25+.75*W(t).tokens/W(o):1})},[()=>`${W(t).date}: ${ra(W(t).tokens)} tokens`]),q(e,n)}),A(r),A(n),Ee(2),q(e,t)},b=e=>{var t=is(),r=R(t);{let e=N(()=>W(c).map(e=>e.tokens)),t=N(()=>W(n)+` usage`);Ka(r,{get values(){return W(e)},get label(){return W(t)}})}var i=B(r,2),a=L(i),o=z(a,!0),s=z(B(a),!0);A(i),V(e=>{J(o,W(c)[0]?.date),J(s,e)},[()=>W(c).at(-1)?.date]),q(e,t)};Y(v,e=>{W(n)===`daily`?e(y):e(b,-1)});var x=B(v,2),S=B(L(x),2),C=L(S),w=B(L(C));Z(w,21,()=>W(n)===`daily`?W(a):W(c),X,(e,t)=>{var n=as(),r=L(n),i=z(r,!0),a=z(B(r),!0);A(n),V(e=>{J(i,W(t).date),J(a,e)},[()=>ra(W(t).tokens)]),q(e,n)}),A(w),A(C),A(S),A(x),A(h);var T=z(B(h,2));V((e,t,n,r,i)=>{J(l,e),J(d,t),J(m,`${n??``} `),J(_,`${W(a)[0]?.date??``} — ${r??``}`),J(T,`OBSERVED ${i??``} // CUMULATIVE IS FOR THE SELECTED PERIOD`)},[()=>ra($.data.usage.summary.lifetimeTokens),()=>ra($.data.usage.summary.peakDailyTokens),()=>ra($.data.usage.summary.currentStreakDays),()=>W(a).at(-1)?.date,()=>ia($.data.usageAt)]),q(e,t)},E=e=>{q(e,ss())};Y(w,e=>{$.data?.usage&&$.data.usage.dailyUsageBuckets!==null?e(T):e(E,-1)}),V(()=>x.disabled=W(i)===0),gi(f,()=>W(n),e=>I(n,e)),G(`change`,_,()=>I(i,0)),gi(_,()=>W(r),e=>I(r,e)),G(`click`,b,()=>Xt(i)),G(`click`,x,()=>Xt(i,-1)),q(e,l),Je()}Er([`change`,`click`]);var us=K(``),ms=K(`
Connecting to your local Codexometer…
`),hs=K(``),gs=K(`Your quota. Your sessions. Your command centre.
History refresh failed. Any displayed history is the last successful + observation.
`),rs=K(``),is=K(``),as=K(`LESS ░ ▒ ▓ █ MORE // HOVER FOR DATE AND TOKENS
`,1),os=K(`
DAYS
| Date (UTC) | Tokens |
|---|
`,1),ls=K(`
History unavailable or awaiting a matching account observation. Missing + history is not treated as zero usage.
`),us=K(`Account-wide history reported by Codex, not the local Sessions counter. Dates + use UTC. Historical resets are not provided by this data.
`,1);function ds(e,t){qe(t,!0);let n=F(`daily`),r=F(12),i=F(0),a=N(()=>{let e=$.data?.usage?.dailyUsageBuckets;if(!e)return[];let{start:t,end:n}=ts(new Date,W(r),W(i)),a=new Map;for(let t of e)!Number.isFinite(t.tokens)||t.tokens<0||a.set(t.startDate,(a.get(t.startDate)||0)+t.tokens);let o=[];for(let e=t;e<=n;e=new Date(e.getTime()+864e5)){let t=e.toISOString().slice(0,10);o.push({date:t,tokens:a.get(t)||0})}return o}),o=N(()=>Math.max(1,...W(a).map(e=>e.tokens))),s=N(()=>W(a).length?new Date(W(a)[0].date+`T00:00:00Z`).getUTCDay():0),c=N(()=>{if(W(n)===`monthly`){let e=new Map;for(let t of W(a))e.set(t.date.slice(0,7),(e.get(t.date.slice(0,7))||0)+t.tokens);return[...e].map(([e,t])=>({date:e,tokens:t}))}let e=0;return W(a).map(t=>({date:t.date,tokens:e+=t.tokens}))});var l=us(),u=B(R(l),4),d=L(u),f=B(L(d)),p=L(f);p.value=p.__value=`daily`;var m=B(p);m.value=m.__value=`monthly`;var h=B(m);h.value=h.__value=`cumulative`,A(f),hi(f),A(d);var g=B(d),_=B(L(g)),v=L(_);v.value=v.__value=6;var y=B(v);y.value=y.__value=12,A(_),hi(_),A(g);var b=B(g),x=B(b);A(u);var S=B(u,2),C=e=>{q(e,ns())};Y(S,e=>{$.data?.usageError&&e(C)});var w=B(S,2),T=e=>{var t=cs(),r=R(t),i=L(r),l=z(B(L(i),2),!0);A(i);var u=B(i,2),d=z(B(L(u),2),!0);A(u);var f=B(u,2),p=B(L(f),2),m=L(p);Ee(),A(p),A(f),A(r);var h=B(r,2),g=L(h),_=z(g),v=B(g,2),y=e=>{var t=as(),n=R(t),r=L(n),i=L(r);Z(i,17,()=>Array(W(s)),X,(e,t)=>{q(e,rs())}),Z(B(i,2),17,()=>W(a),X,(e,t)=>{var n=is();let r,i;V(e=>{r=li(n,1,`heat-cell`,null,r,{zero:W(t).tokens===0}),Q(n,`title`,e),i=di(n,``,i,{opacity:W(t).tokens?.25+.75*W(t).tokens/W(o):1})},[()=>`${W(t).date}: ${ra(W(t).tokens)} tokens`]),q(e,n)}),A(r),A(n),Ee(2),q(e,t)},b=e=>{var t=os(),r=R(t);{let e=N(()=>W(c).map(e=>e.tokens)),t=N(()=>W(n)+` usage`);Ka(r,{get values(){return W(e)},get label(){return W(t)}})}var i=B(r,2),a=L(i),o=z(a,!0),s=z(B(a),!0);A(i),V(e=>{J(o,W(c)[0]?.date),J(s,e)},[()=>W(c).at(-1)?.date]),q(e,t)};Y(v,e=>{W(n)===`daily`?e(y):e(b,-1)});var x=B(v,2),S=B(L(x),2),C=L(S),w=B(L(C));Z(w,21,()=>W(n)===`daily`?W(a):W(c),X,(e,t)=>{var n=ss(),r=L(n),i=z(r,!0),a=z(B(r),!0);A(n),V(e=>{J(i,W(t).date),J(a,e)},[()=>ra(W(t).tokens)]),q(e,n)}),A(w),A(C),A(S),A(x),A(h);var T=z(B(h,2));V((e,t,n,r,i)=>{J(l,e),J(d,t),J(m,`${n??``} `),J(_,`${W(a)[0]?.date??``} — ${r??``}`),J(T,`OBSERVED ${i??``} // CUMULATIVE IS FOR THE SELECTED PERIOD`)},[()=>ra($.data.usage.summary.lifetimeTokens),()=>ra($.data.usage.summary.peakDailyTokens),()=>ra($.data.usage.summary.currentStreakDays),()=>W(a).at(-1)?.date,()=>ia($.data.usageAt)]),q(e,t)},E=e=>{q(e,ls())};Y(w,e=>{$.data?.usage&&$.data.usage.dailyUsageBuckets!==null?e(T):e(E,-1)}),V(()=>x.disabled=W(i)===0),gi(f,()=>W(n),e=>I(n,e)),G(`change`,_,()=>I(i,0)),gi(_,()=>W(r),e=>I(r,e)),G(`click`,b,()=>Xt(i)),G(`click`,x,()=>Xt(i,-1)),q(e,l),Je()}Er([`change`,`click`]);var fs=K(``),gs=K(`
Connecting to your local Codexometer…
`),_s=K(``),vs=K(`Your quota. Your sessions. Your command centre.
+ {selected.directory} +
{/if}{number(session.tokens)} TOKENS
+ {#if session.name && session.directory}+ {session.directory} +
{/if}{session.agents} LINKED AGENTS
ACTIVE // {date(session.activity)}