tokmon 0.22.5 → 0.22.7

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.
@@ -1 +1 @@
1
- import{g as R,X as l,Y as x,L as C,f as M,A,u as b,j as t,P as k,E as T,C as S,R as N,a as h,G as u,b as v,c as n,d as O,T as j,e as g,h as c,r as L,S as E,s as G,m as Y}from"./index-Dziiggw_.js";var I=R({chartName:"LineChart",GraphicalChild:C,axisComponents:[{axisType:"xAxis",AxisComp:l},{axisType:"yAxis",AxisComp:x}],formatAxisMap:M}),W=R({chartName:"AreaChart",GraphicalChild:A,axisComponents:[{axisType:"xAxis",AxisComp:l},{axisType:"yAxis",AxisComp:x}],formatAxisMap:M});const _=[{value:"linear",label:"lin"},{value:"log",label:"log"}],B=[{value:"combined",label:"merged"},{value:"byProvider",label:"split"}],F="flex items-center overflow-hidden rounded border border-line text-[10px]",H=Y(a=>{const s=a.filter(e=>e.dataKey!=="total"&&(e.value??0)>0).map(e=>({label:String(e.name??e.dataKey),value:c(e.value??0),color:e.color})),r=a.reduce((e,o)=>e+(o.dataKey==="total"?0:o.value??0),0);return s.length>1&&s.push({label:"total",value:c(r),color:"var(--color-fg-bright)"}),s}),U=G("total",c,"var(--color-cost)");function V({derived:a,title:s="cost over time",height:r=260,periodLabel:e,heightClass:o}){const m=b(),K=a.byProvider,P=K.length>1,[d,X]=L.useState("linear"),[w,z]=L.useState(P?"byProvider":"combined"),f=a.timeline.map(i=>{const p={date:i.date,total:i.total,...i.byProvider};if(d==="log")for(const y of Object.keys(p))y!=="date"&&p[y]===0&&(p[y]=null);return p}),D=t.jsx(x,{...n,width:52,tickFormatter:O,scale:d,allowDataOverflow:d==="log",domain:d==="log"?[.1,"auto"]:[0,"auto"]});return t.jsx(k,{title:s,titleTag:e,captureName:"cost-over-time",right:t.jsxs("div",{className:"flex items-center gap-1.5",children:[P&&t.jsx(E,{options:B,value:w,onChange:z,size:"xs",containerClassName:F,ariaLabel:"combine providers"}),t.jsx(E,{options:_,value:d,onChange:X,size:"xs",containerClassName:F,ariaLabel:"value scale"})]}),children:f.length===0?t.jsx(T,{children:"no spend in period"}):t.jsx(S,{height:r,heightClass:o,children:t.jsx(N,{children:w==="combined"?t.jsxs(W,{data:f,margin:{top:8,right:8,left:0,bottom:0},children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"g-cost",x1:"0",y1:"0",x2:"0",y2:"1",children:[t.jsx("stop",{offset:"0%",stopColor:"var(--color-cost)",stopOpacity:.16}),t.jsx("stop",{offset:"100%",stopColor:"var(--color-cost)",stopOpacity:.02})]})}),t.jsx(h,{...u}),t.jsx(l,{dataKey:"date",...n,tickFormatter:v,minTickGap:28}),D,t.jsx(j,{content:U,cursor:g}),t.jsx(A,{type:"monotone",dataKey:"total",stroke:"var(--color-cost)",strokeWidth:1.8,fill:"url(#g-cost)",connectNulls:!0,isAnimationActive:m,animationDuration:350})]}):t.jsxs(I,{data:f,margin:{top:8,right:8,left:0,bottom:0},children:[t.jsx(h,{...u}),t.jsx(l,{dataKey:"date",...n,tickFormatter:v,minTickGap:28}),D,t.jsx(j,{content:H,cursor:g}),K.map(i=>t.jsx(C,{type:"monotone",dataKey:i.id,name:i.name,stroke:i.color,strokeWidth:1.6,dot:!1,connectNulls:!0,isAnimationActive:m,animationDuration:350},i.id))]})})})})}const q=G("cumulative",c,"var(--color-cost)");function Z({derived:a,height:s=220,periodLabel:r}){const e=b(),o=a.cumulative;return t.jsx(k,{title:"cumulative spend",titleTag:r,captureName:"cumulative",children:o.length===0?t.jsx(T,{children:"no spend in period"}):t.jsx(S,{height:s,children:t.jsx(N,{children:t.jsxs(I,{data:o,margin:{top:8,right:8,left:0,bottom:0},children:[t.jsx(h,{...u}),t.jsx(l,{dataKey:"date",...n,tickFormatter:v,minTickGap:28}),t.jsx(x,{...n,width:52,tickFormatter:O}),t.jsx(j,{content:q,cursor:g}),t.jsx(C,{type:"monotone",dataKey:"total",stroke:"var(--color-cost)",strokeWidth:1.8,dot:!1,isAnimationActive:e,animationDuration:350})]})})})})}const J=G("cache saved",c,"var(--color-positive)");function $({derived:a,height:s=220,periodLabel:r}){const e=b(),o=a.cacheSavingsSeries,m=a.totals.cacheSavings;return t.jsx(k,{title:"cache savings",titleTag:r,captureName:"cache-savings",right:t.jsx("span",{className:"tnum text-xs text-positive",children:c(m)}),children:o.length===0?t.jsx(T,{children:"no cache reads in period"}):t.jsx(S,{height:s,children:t.jsx(N,{children:t.jsxs(W,{data:o,margin:{top:8,right:8,left:0,bottom:0},children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"g-save",x1:"0",y1:"0",x2:"0",y2:"1",children:[t.jsx("stop",{offset:"0%",stopColor:"var(--color-positive)",stopOpacity:.18}),t.jsx("stop",{offset:"100%",stopColor:"var(--color-positive)",stopOpacity:.02})]})}),t.jsx(h,{...u}),t.jsx(l,{dataKey:"date",...n,tickFormatter:v,minTickGap:28}),t.jsx(x,{...n,width:52,tickFormatter:O}),t.jsx(j,{content:J,cursor:g}),t.jsx(A,{type:"monotone",dataKey:"value",stroke:"var(--color-positive)",strokeWidth:1.6,fill:"url(#g-save)",isAnimationActive:e,animationDuration:350})]})})})})}export{$ as CacheSavings,V as CostTimeline,Z as CumulativeSpend};
1
+ import{g as R,X as l,Y as x,L as C,f as M,A,u as b,j as t,P as k,E as T,C as S,R as N,a as h,G as u,b as v,c as n,d as O,T as j,e as g,h as c,r as L,S as E,s as G,m as Y}from"./index-ygZyXDLT.js";var I=R({chartName:"LineChart",GraphicalChild:C,axisComponents:[{axisType:"xAxis",AxisComp:l},{axisType:"yAxis",AxisComp:x}],formatAxisMap:M}),W=R({chartName:"AreaChart",GraphicalChild:A,axisComponents:[{axisType:"xAxis",AxisComp:l},{axisType:"yAxis",AxisComp:x}],formatAxisMap:M});const _=[{value:"linear",label:"lin"},{value:"log",label:"log"}],B=[{value:"combined",label:"merged"},{value:"byProvider",label:"split"}],F="flex items-center overflow-hidden rounded border border-line text-[10px]",H=Y(a=>{const s=a.filter(e=>e.dataKey!=="total"&&(e.value??0)>0).map(e=>({label:String(e.name??e.dataKey),value:c(e.value??0),color:e.color})),r=a.reduce((e,o)=>e+(o.dataKey==="total"?0:o.value??0),0);return s.length>1&&s.push({label:"total",value:c(r),color:"var(--color-fg-bright)"}),s}),U=G("total",c,"var(--color-cost)");function V({derived:a,title:s="cost over time",height:r=260,periodLabel:e,heightClass:o}){const m=b(),K=a.byProvider,P=K.length>1,[d,X]=L.useState("linear"),[w,z]=L.useState(P?"byProvider":"combined"),f=a.timeline.map(i=>{const p={date:i.date,total:i.total,...i.byProvider};if(d==="log")for(const y of Object.keys(p))y!=="date"&&p[y]===0&&(p[y]=null);return p}),D=t.jsx(x,{...n,width:52,tickFormatter:O,scale:d,allowDataOverflow:d==="log",domain:d==="log"?[.1,"auto"]:[0,"auto"]});return t.jsx(k,{title:s,titleTag:e,captureName:"cost-over-time",right:t.jsxs("div",{className:"flex items-center gap-1.5",children:[P&&t.jsx(E,{options:B,value:w,onChange:z,size:"xs",containerClassName:F,ariaLabel:"combine providers"}),t.jsx(E,{options:_,value:d,onChange:X,size:"xs",containerClassName:F,ariaLabel:"value scale"})]}),children:f.length===0?t.jsx(T,{children:"no spend in period"}):t.jsx(S,{height:r,heightClass:o,children:t.jsx(N,{children:w==="combined"?t.jsxs(W,{data:f,margin:{top:8,right:8,left:0,bottom:0},children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"g-cost",x1:"0",y1:"0",x2:"0",y2:"1",children:[t.jsx("stop",{offset:"0%",stopColor:"var(--color-cost)",stopOpacity:.16}),t.jsx("stop",{offset:"100%",stopColor:"var(--color-cost)",stopOpacity:.02})]})}),t.jsx(h,{...u}),t.jsx(l,{dataKey:"date",...n,tickFormatter:v,minTickGap:28}),D,t.jsx(j,{content:U,cursor:g}),t.jsx(A,{type:"monotone",dataKey:"total",stroke:"var(--color-cost)",strokeWidth:1.8,fill:"url(#g-cost)",connectNulls:!0,isAnimationActive:m,animationDuration:350})]}):t.jsxs(I,{data:f,margin:{top:8,right:8,left:0,bottom:0},children:[t.jsx(h,{...u}),t.jsx(l,{dataKey:"date",...n,tickFormatter:v,minTickGap:28}),D,t.jsx(j,{content:H,cursor:g}),K.map(i=>t.jsx(C,{type:"monotone",dataKey:i.id,name:i.name,stroke:i.color,strokeWidth:1.6,dot:!1,connectNulls:!0,isAnimationActive:m,animationDuration:350},i.id))]})})})})}const q=G("cumulative",c,"var(--color-cost)");function Z({derived:a,height:s=220,periodLabel:r}){const e=b(),o=a.cumulative;return t.jsx(k,{title:"cumulative spend",titleTag:r,captureName:"cumulative",children:o.length===0?t.jsx(T,{children:"no spend in period"}):t.jsx(S,{height:s,children:t.jsx(N,{children:t.jsxs(I,{data:o,margin:{top:8,right:8,left:0,bottom:0},children:[t.jsx(h,{...u}),t.jsx(l,{dataKey:"date",...n,tickFormatter:v,minTickGap:28}),t.jsx(x,{...n,width:52,tickFormatter:O}),t.jsx(j,{content:q,cursor:g}),t.jsx(C,{type:"monotone",dataKey:"total",stroke:"var(--color-cost)",strokeWidth:1.8,dot:!1,isAnimationActive:e,animationDuration:350})]})})})})}const J=G("cache saved",c,"var(--color-positive)");function $({derived:a,height:s=220,periodLabel:r}){const e=b(),o=a.cacheSavingsSeries,m=a.totals.cacheSavings;return t.jsx(k,{title:"cache savings",titleTag:r,captureName:"cache-savings",right:t.jsx("span",{className:"tnum text-xs text-positive",children:c(m)}),children:o.length===0?t.jsx(T,{children:"no cache reads in period"}):t.jsx(S,{height:s,children:t.jsx(N,{children:t.jsxs(W,{data:o,margin:{top:8,right:8,left:0,bottom:0},children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"g-save",x1:"0",y1:"0",x2:"0",y2:"1",children:[t.jsx("stop",{offset:"0%",stopColor:"var(--color-positive)",stopOpacity:.18}),t.jsx("stop",{offset:"100%",stopColor:"var(--color-positive)",stopOpacity:.02})]})}),t.jsx(h,{...u}),t.jsx(l,{dataKey:"date",...n,tickFormatter:v,minTickGap:28}),t.jsx(x,{...n,width:52,tickFormatter:O}),t.jsx(j,{content:J,cursor:g}),t.jsx(A,{type:"monotone",dataKey:"value",stroke:"var(--color-positive)",strokeWidth:1.6,fill:"url(#g-save)",isAnimationActive:e,animationDuration:350})]})})})})}export{$ as CacheSavings,V as CostTimeline,Z as CumulativeSpend};
@@ -11,7 +11,7 @@
11
11
  // Apply saved theme before first paint to avoid a flash. Default: dark.
12
12
  try { if (localStorage.getItem('tokmon-theme') === 'light') document.documentElement.classList.add('light') } catch (e) {}
13
13
  </script>
14
- <script type="module" crossorigin src="./assets/index-Dziiggw_.js"></script>
14
+ <script type="module" crossorigin src="./assets/index-ygZyXDLT.js"></script>
15
15
  <link rel="stylesheet" crossorigin href="./assets/index-BCaPGYQA.css">
16
16
  </head>
17
17
  <body>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tokmon",
3
- "version": "0.22.5",
4
- "description": "Terminal + web dashboard for Claude Code, Codex, Cursor, opencode, pi, Copilot, Gemini & more — usage, limits, and costs",
3
+ "version": "0.22.7",
4
+ "description": "Terminal + web dashboard for Claude Code, Codex, Cursor, Grok, opencode, pi, Copilot, Gemini & more — usage, limits, and costs",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "tokmon": "dist/cli.js"
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- startWebServer
4
- } from "./chunk-FO7IUYCM.js";
5
- import "./chunk-AQNFQRWV.js";
6
- import "./chunk-QTHCHB7S.js";
7
- export {
8
- startWebServer
9
- };