@kaitranntt/ccs 6.5.0-dev.4 → 6.5.0-dev.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/VERSION +1 -1
- package/dist/cliproxy/binary-manager.d.ts +16 -2
- package/dist/cliproxy/binary-manager.d.ts.map +1 -1
- package/dist/cliproxy/binary-manager.js +39 -15
- package/dist/cliproxy/binary-manager.js.map +1 -1
- package/dist/ui/assets/accounts-C1DiBVWf.js +1 -0
- package/dist/ui/assets/{analytics-DoFD4MUg.js → analytics-34-9qi4o.js} +1 -1
- package/dist/ui/assets/{api-CwUJMuXb.js → api-Lcsxd42l.js} +1 -1
- package/dist/ui/assets/{card-CyWUt_38.js → card-tk5ihPK8.js} +1 -1
- package/dist/ui/assets/{cliproxy-control-panel-DPdlwOom.js → cliproxy-control-panel-BzhsXWKa.js} +1 -1
- package/dist/ui/assets/cliproxy-lpz8UdFt.js +1 -0
- package/dist/ui/assets/{code-editor-Cle0Dpfm.js → code-editor-rSl_-6ob.js} +1 -1
- package/dist/ui/assets/{copilot-De6CUpAp.js → copilot-Djc29_O8.js} +3 -3
- package/dist/ui/assets/{health-BhWyRLcf.js → health-ByL12ZVZ.js} +1 -1
- package/dist/ui/assets/icons-U_6eBV_J.js +1 -0
- package/dist/ui/assets/index-CeV2P3Sp.css +1 -0
- package/dist/ui/assets/{index-DgE4vUOj.js → index-c9idYjfn.js} +17 -17
- package/dist/ui/assets/{settings-CF8hsr9i.js → settings-BzHi9yIP.js} +1 -1
- package/dist/ui/assets/{shared-DOouyrMo.js → shared-CojMqcSc.js} +1 -1
- package/dist/ui/assets/{switch-Brk5YONT.js → switch-BQbPcCIQ.js} +1 -1
- package/dist/ui/index.html +3 -3
- package/dist/web-server/routes.d.ts.map +1 -1
- package/dist/web-server/routes.js +27 -0
- package/dist/web-server/routes.js.map +1 -1
- package/package.json +1 -1
- package/dist/ui/assets/accounts-DpWwKi5h.js +0 -1
- package/dist/ui/assets/cliproxy-Clb4iYcu.js +0 -1
- package/dist/ui/assets/icons-DueS9DOr.js +0 -1
- package/dist/ui/assets/index-BOt9W1nO.css +0 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
6.5.0-dev.
|
|
1
|
+
6.5.0-dev.5
|
|
@@ -17,6 +17,7 @@ interface UpdateCheckResult {
|
|
|
17
17
|
currentVersion: string;
|
|
18
18
|
latestVersion: string;
|
|
19
19
|
fromCache: boolean;
|
|
20
|
+
checkedAt: number;
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
23
|
* Binary Manager class for CLIProxyAPI binary lifecycle
|
|
@@ -52,9 +53,9 @@ export declare class BinaryManager {
|
|
|
52
53
|
*/
|
|
53
54
|
private saveInstalledVersion;
|
|
54
55
|
/**
|
|
55
|
-
* Get
|
|
56
|
+
* Get version cache data if still valid
|
|
56
57
|
*/
|
|
57
|
-
private
|
|
58
|
+
private getVersionCache;
|
|
58
59
|
/**
|
|
59
60
|
* Cache latest version for future checks
|
|
60
61
|
*/
|
|
@@ -164,6 +165,19 @@ export declare function installCliproxyVersion(version: string, verbose?: boolea
|
|
|
164
165
|
* @returns Latest version string (e.g., "6.5.53")
|
|
165
166
|
*/
|
|
166
167
|
export declare function fetchLatestCliproxyVersion(): Promise<string>;
|
|
168
|
+
/** Update check result for API response */
|
|
169
|
+
export interface CliproxyUpdateCheckResult {
|
|
170
|
+
hasUpdate: boolean;
|
|
171
|
+
currentVersion: string;
|
|
172
|
+
latestVersion: string;
|
|
173
|
+
fromCache: boolean;
|
|
174
|
+
checkedAt: number;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Check for CLIProxyAPI binary updates
|
|
178
|
+
* @returns Update check result with version info
|
|
179
|
+
*/
|
|
180
|
+
export declare function checkCliproxyUpdate(): Promise<CliproxyUpdateCheckResult>;
|
|
167
181
|
/**
|
|
168
182
|
* Get path to version pin file
|
|
169
183
|
* @returns Absolute path to .version-pin file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binary-manager.d.ts","sourceRoot":"","sources":["../../src/cliproxy/binary-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"binary-manager.d.ts","sourceRoot":"","sources":["../../src/cliproxy/binary-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAYH,OAAO,EACL,UAAU,EACV,mBAAmB,EAIpB,MAAM,SAAS,CAAC;AA0BjB,0BAA0B;AAC1B,UAAU,iBAAiB;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAYD;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAsB;IACpC,OAAO,CAAC,OAAO,CAAU;gBAEb,MAAM,GAAE,OAAO,CAAC,mBAAmB,CAAM;IAKrD;;;OAGG;IACG,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC;IA6ErC;;;OAGG;IACG,eAAe,IAAI,OAAO,CAAC,iBAAiB,CAAC;IA8BnD;;OAEG;YACW,kBAAkB;IAYhC;;OAEG;IACH,OAAO,CAAC,SAAS;IA8CjB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAY3B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAS5B;;OAEG;IACH,OAAO,CAAC,eAAe;IAsBvB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAe1B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAI3B;;OAEG;IACH,OAAO,CAAC,cAAc;IAgBtB;;OAEG;IACH,aAAa,IAAI,MAAM;IAKvB;;OAEG;IACH,iBAAiB,IAAI,OAAO;IAI5B;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAiBjD;;OAEG;YACW,kBAAkB;IAsEhC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MAAM,GAAG,IAAI,CAUhD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAQvD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CASzC;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
35
35
|
return result;
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.isVersionPinned = exports.clearPinnedVersion = exports.savePinnedVersion = exports.getPinnedVersion = exports.getVersionPinPath = exports.fetchLatestCliproxyVersion = exports.installCliproxyVersion = exports.getInstalledCliproxyVersion = exports.getCLIProxyPath = exports.isCLIProxyInstalled = exports.ensureCLIProxyBinary = exports.BinaryManager = void 0;
|
|
38
|
+
exports.isVersionPinned = exports.clearPinnedVersion = exports.savePinnedVersion = exports.getPinnedVersion = exports.getVersionPinPath = exports.checkCliproxyUpdate = exports.fetchLatestCliproxyVersion = exports.installCliproxyVersion = exports.getInstalledCliproxyVersion = exports.getCLIProxyPath = exports.isCLIProxyInstalled = exports.ensureCLIProxyBinary = exports.BinaryManager = void 0;
|
|
39
39
|
const fs = __importStar(require("fs"));
|
|
40
40
|
const path = __importStar(require("path"));
|
|
41
41
|
const https = __importStar(require("https"));
|
|
@@ -45,6 +45,7 @@ const zlib = __importStar(require("zlib"));
|
|
|
45
45
|
const progress_indicator_1 = require("../utils/progress-indicator");
|
|
46
46
|
const ui_1 = require("../utils/ui");
|
|
47
47
|
const config_generator_1 = require("./config-generator");
|
|
48
|
+
const stats_fetcher_1 = require("./stats-fetcher");
|
|
48
49
|
const platform_detector_1 = require("./platform-detector");
|
|
49
50
|
/** Cache duration for version check (1 hour in milliseconds) */
|
|
50
51
|
const VERSION_CACHE_DURATION_MS = 60 * 60 * 1000;
|
|
@@ -87,12 +88,23 @@ class BinaryManager {
|
|
|
87
88
|
try {
|
|
88
89
|
const updateResult = await this.checkForUpdates();
|
|
89
90
|
if (updateResult.hasUpdate) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
91
|
+
// Check if CLIProxyAPI is currently running - can't update while running
|
|
92
|
+
const proxyRunning = await (0, stats_fetcher_1.isCliproxyRunning)(config_generator_1.CLIPROXY_DEFAULT_PORT);
|
|
93
|
+
if (proxyRunning) {
|
|
94
|
+
// Proxy is running - can't update, just notify user
|
|
95
|
+
console.log((0, ui_1.info)(`CLIProxyAPI update available: v${updateResult.currentVersion} -> v${updateResult.latestVersion}`));
|
|
96
|
+
console.log((0, ui_1.info)('Run "ccs cliproxy stop" then restart to apply update'));
|
|
97
|
+
this.log('Skipping update: CLIProxyAPI is currently running');
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
// Proxy not running - safe to update
|
|
101
|
+
console.log((0, ui_1.info)(`CLIProxyAPI update available: v${updateResult.currentVersion} -> v${updateResult.latestVersion}`));
|
|
102
|
+
console.log((0, ui_1.info)('Updating CLIProxyAPI...'));
|
|
103
|
+
// Delete old binary and download new version
|
|
104
|
+
this.deleteBinary();
|
|
105
|
+
this.config.version = updateResult.latestVersion;
|
|
106
|
+
await this.downloadAndInstall();
|
|
107
|
+
}
|
|
96
108
|
}
|
|
97
109
|
}
|
|
98
110
|
catch (error) {
|
|
@@ -132,24 +144,27 @@ class BinaryManager {
|
|
|
132
144
|
async checkForUpdates() {
|
|
133
145
|
const currentVersion = this.getInstalledVersion();
|
|
134
146
|
// Try cache first
|
|
135
|
-
const
|
|
136
|
-
if (
|
|
137
|
-
this.log(`Using cached version: ${
|
|
147
|
+
const cache = this.getVersionCache();
|
|
148
|
+
if (cache) {
|
|
149
|
+
this.log(`Using cached version: ${cache.latestVersion}`);
|
|
138
150
|
return {
|
|
139
|
-
hasUpdate: this.isNewerVersion(
|
|
151
|
+
hasUpdate: this.isNewerVersion(cache.latestVersion, currentVersion),
|
|
140
152
|
currentVersion,
|
|
141
|
-
latestVersion:
|
|
153
|
+
latestVersion: cache.latestVersion,
|
|
142
154
|
fromCache: true,
|
|
155
|
+
checkedAt: cache.checkedAt,
|
|
143
156
|
};
|
|
144
157
|
}
|
|
145
158
|
// Fetch from GitHub API
|
|
146
159
|
const latestVersion = await this.fetchLatestVersion();
|
|
160
|
+
const now = Date.now();
|
|
147
161
|
this.cacheLatestVersion(latestVersion);
|
|
148
162
|
return {
|
|
149
163
|
hasUpdate: this.isNewerVersion(latestVersion, currentVersion),
|
|
150
164
|
currentVersion,
|
|
151
165
|
latestVersion,
|
|
152
166
|
fromCache: false,
|
|
167
|
+
checkedAt: now,
|
|
153
168
|
};
|
|
154
169
|
}
|
|
155
170
|
/**
|
|
@@ -237,9 +252,9 @@ class BinaryManager {
|
|
|
237
252
|
}
|
|
238
253
|
}
|
|
239
254
|
/**
|
|
240
|
-
* Get
|
|
255
|
+
* Get version cache data if still valid
|
|
241
256
|
*/
|
|
242
|
-
|
|
257
|
+
getVersionCache() {
|
|
243
258
|
const cachePath = this.getVersionCachePath();
|
|
244
259
|
if (!fs.existsSync(cachePath)) {
|
|
245
260
|
return null;
|
|
@@ -249,7 +264,7 @@ class BinaryManager {
|
|
|
249
264
|
const cache = JSON.parse(content);
|
|
250
265
|
// Check if cache is still valid
|
|
251
266
|
if (Date.now() - cache.checkedAt < VERSION_CACHE_DURATION_MS) {
|
|
252
|
-
return cache
|
|
267
|
+
return cache;
|
|
253
268
|
}
|
|
254
269
|
// Cache expired
|
|
255
270
|
return null;
|
|
@@ -850,6 +865,15 @@ async function fetchLatestCliproxyVersion() {
|
|
|
850
865
|
return result.latestVersion;
|
|
851
866
|
}
|
|
852
867
|
exports.fetchLatestCliproxyVersion = fetchLatestCliproxyVersion;
|
|
868
|
+
/**
|
|
869
|
+
* Check for CLIProxyAPI binary updates
|
|
870
|
+
* @returns Update check result with version info
|
|
871
|
+
*/
|
|
872
|
+
async function checkCliproxyUpdate() {
|
|
873
|
+
const manager = new BinaryManager();
|
|
874
|
+
return manager.checkForUpdates();
|
|
875
|
+
}
|
|
876
|
+
exports.checkCliproxyUpdate = checkCliproxyUpdate;
|
|
853
877
|
/**
|
|
854
878
|
* Get path to version pin file
|
|
855
879
|
* @returns Absolute path to .version-pin file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binary-manager.js","sourceRoot":"","sources":["../../src/cliproxy/binary-manager.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAC7B,6CAA+B;AAC/B,2CAA6B;AAC7B,+CAAiC;AACjC,2CAA6B;AAC7B,oEAAgE;AAChE,oCAAuC;AACvC,yDAA+D;AAQ/D,2DAO6B;AAE7B,gEAAgE;AAChE,MAAM,yBAAyB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEjD,oEAAoE;AACpE,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAExC,wCAAwC;AACxC,MAAM,yBAAyB,GAC7B,wEAAwE,CAAC;AAgB3E,4BAA4B;AAC5B,MAAM,cAAc,GAAwB;IAC1C,OAAO,EAAE,6CAAyB;IAClC,UAAU,EAAE,gEAAgE;IAC5E,OAAO,EAAE,IAAA,4BAAS,GAAE;IACpB,UAAU,EAAE,CAAC;IACb,OAAO,EAAE,KAAK;IACd,YAAY,EAAE,KAAK;CACpB,CAAC;AAEF;;GAEG;AACH,MAAa,aAAa;IAIxB,YAAY,SAAuC,EAAE;QACnD,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,MAAM,EAAE,CAAC;QAC/C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;IACrC,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,YAAY;QAChB,MAAM,UAAU,GAAG,IAAI,CAAC,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E,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;IACjD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAVD,4CAUC;AAED;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,OAAe;IAC/C,MAAM,OAAO,GAAG,iBAAiB,EAAE,CAAC;IACpC,IAAI,CAAC;QACH,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACzD,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC7C,CAAC;IAAC,MAAM,CAAC;QACP,gDAAgD;IAClD,CAAC;AACH,CAAC;AARD,8CAQC;AAED;;GAEG;AACH,SAAgB,kBAAkB;IAChC,MAAM,OAAO,GAAG,iBAAiB,EAAE,CAAC;IACpC,IAAI,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,IAAI,CAAC;YACH,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACzB,CAAC;QAAC,MAAM,CAAC;YACP,cAAc;QAChB,CAAC;IACH,CAAC;AACH,CAAC;AATD,gDASC;AAED;;;GAGG;AACH,SAAgB,eAAe;IAC7B,OAAO,gBAAgB,EAAE,KAAK,IAAI,CAAC;AACrC,CAAC;AAFD,0CAEC;AAED,kBAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./radix-ui-DFHQr9A5.js";import{a as x,u as p,b as h,d as f,f as l,g as b}from"./tanstack-C4gT2P7V.js";import"./react-vendor-FspHSO0w.js";import{c as r,a1 as u,B as g}from"./index-c9idYjfn.js";import{t as d}from"./notifications-B2Pz7lik.js";import{j}from"./icons-U_6eBV_J.js";import"./utils-CzKF5WmX.js";import"./form-utils-BuXDJb0w.js";import"./code-highlight-BoHWVYut.js";function y({className:s,...t}){return e.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:e.jsx("table",{"data-slot":"table",className:r("w-full caption-bottom text-sm",s),...t})})}function N({className:s,...t}){return e.jsx("thead",{"data-slot":"table-header",className:r("[&_tr]:border-b",s),...t})}function w({className:s,...t}){return e.jsx("tbody",{"data-slot":"table-body",className:r("[&_tr:last-child]:border-0",s),...t})}function i({className:s,...t}){return e.jsx("tr",{"data-slot":"table-row",className:r("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",s),...t})}function v({className:s,...t}){return e.jsx("th",{"data-slot":"table-head",className:r("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),...t})}function C({className:s,...t}){return e.jsx("td",{"data-slot":"table-cell",className:r("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),...t})}function D(){return x({queryKey:["accounts"],queryFn:()=>u.accounts.list()})}function T(){const s=p();return h({mutationFn:t=>u.accounts.setDefault(t),onSuccess:(t,o)=>{s.invalidateQueries({queryKey:["accounts"]}),d.success(`Default account set to "${o}"`)},onError:t=>{d.error(t.message)}})}function A({data:s,defaultAccount:t}){const o=T(),c=f({data:s,columns:[{accessorKey:"name",header:"Name",size:200,cell:({row:a})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:a.original.name}),a.original.name===t&&e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded border border-primary/20",children:"default"})]})},{accessorKey:"type",header:"Type",size:100,cell:({row:a})=>e.jsx("span",{className:"capitalize text-muted-foreground",children:a.original.type||"oauth"})},{accessorKey:"created",header:"Created",size:150,cell:({row:a})=>{const n=new Date(a.original.created);return e.jsx("span",{className:"text-muted-foreground",children:n.toLocaleDateString()})}},{accessorKey:"last_used",header:"Last Used",size:150,cell:({row:a})=>{if(!a.original.last_used)return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});const n=new Date(a.original.last_used);return e.jsx("span",{className:"text-muted-foreground",children:n.toLocaleDateString()})}},{id:"actions",header:"Actions",size:100,cell:({row:a})=>{const n=a.original.name===t;return e.jsxs(g,{variant:n?"secondary":"default",size:"sm",className:"h-8 px-2 w-full",disabled:n||o.isPending,onClick:()=>o.mutate(a.original.name),children:[e.jsx(j,{className:`w-3 h-3 mr-1.5 ${n?"opacity-50":""}`}),n?"Active":"Set Default"]})}}],getCoreRowModel:b()});return s.length===0?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:["No accounts found. Use ",e.jsx("code",{className:"text-sm bg-muted px-1 rounded",children:"ccs login"})," to add accounts."]}):e.jsx("div",{className:"border rounded-md",children:e.jsxs(y,{children:[e.jsx(N,{children:c.getHeaderGroups().map(a=>e.jsx(i,{children:a.headers.map(n=>{const m={name:"w-[200px]",type:"w-[100px]",created:"w-[150px]",last_used:"w-[150px]",actions:"w-[100px]"}[n.id]||"w-auto";return e.jsx(v,{className:m,children:n.isPlaceholder?null:l(n.column.columnDef.header,n.getContext())},n.id)})},a.id))}),e.jsx(w,{children:c.getRowModel().rows.map(a=>e.jsx(i,{children:a.getVisibleCells().map(n=>e.jsx(C,{children:l(n.column.columnDef.cell,n.getContext())},n.id))},a.id))})]})})}function H(){const{data:s,isLoading:t}=D();return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-8",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Accounts"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage multi-account Claude sessions (profiles.json)"})]})}),t?e.jsx("div",{className:"text-muted-foreground",children:"Loading accounts..."}):e.jsx(A,{data:s?.accounts||[],defaultAccount:s?.default??null}),e.jsx("div",{className:"text-sm text-muted-foreground border-t pt-4 mt-4",children:e.jsxs("p",{children:["Accounts are isolated Claude instances with separate sessions.",e.jsx("br",{}),"Use ",e.jsx("code",{className:"bg-muted px-1 rounded",children:"ccs auth create <name>"})," to add new accounts via CLI."]})})]})}export{H as AccountsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-DFHQr9A5.js";import{c as ge,r as p}from"./react-vendor-FspHSO0w.js";import{C as g,a as j,b as N,c as C}from"./card-CyWUt_38.js";import{c as i,B as O,P as ee,a as je,b as se,C as Ne,u as R,S as m,d as y,g as te,e as B,f as ye,h as be,i as we,j as ve}from"./index-DgE4vUOj.js";import{K as F,f as k,L as H,H as ke}from"./utils-CzKF5WmX.js";import{a2 as Ce,s as $e,a3 as ae,a4 as W,a5 as re,v as ne,Y as Se,G as De,t as Q,U as Le,Z as le,r as Fe,a6 as q,a7 as Te,a8 as Me,J as Re,a9 as Pe,b as Ae,aa as Be}from"./icons-DueS9DOr.js";import{R as ie,A as Ue,C as qe,X as Ie,Y as V,T as oe,a as Z,P as Oe,b as Ke,c as Ee}from"./charts-B9Jh-s-X.js";import{u as Ge,a as P}from"./tanstack-C4gT2P7V.js";import"./notifications-B2Pz7lik.js";import"./form-utils-BuXDJb0w.js";import"./code-highlight-BoHWVYut.js";function He({value:s,onChange:t,presets:a=[{label:"Last 7 days",range:{from:F(new Date,7),to:new Date}},{label:"Last 30 days",range:{from:F(new Date,30),to:new Date}},{label:"Last 90 days",range:{from:F(new Date,90),to:new Date}}],className:d}){const[o,c]=ge.useState(!1),n=r=>!s||!s.from||!s.to||!r.from||!r.to?!1:k(s.from,"yyyy-MM-dd")===k(r.from,"yyyy-MM-dd")&&k(s.to,"yyyy-MM-dd")===k(r.to,"yyyy-MM-dd");return e.jsxs("div",{className:i("flex items-center gap-2",d),children:[a.map(r=>e.jsx(O,{variant:n(r.range)?"default":"outline",size:"sm",onClick:()=>t(r.range),children:r.label},r.label)),e.jsxs(ee,{open:o,onOpenChange:c,children:[e.jsx(je,{asChild:!0,children:e.jsxs(O,{id:"date",variant:"outline",className:i("w-auto min-w-[240px] justify-start text-left font-normal",!s&&"text-muted-foreground"),children:[e.jsx(Ce,{className:"mr-2 h-4 w-4"}),s?.from?s.to?e.jsxs(e.Fragment,{children:[k(s.from,"LLL dd, y")," - ",k(s.to,"LLL dd, y")]}):k(s.from,"LLL dd, y"):e.jsx("span",{children:"Pick a date"})]})}),e.jsx(se,{className:"w-auto p-0",align:"end",children:e.jsx(Ne,{initialFocus:!0,mode:"range",defaultMonth:s?.from,selected:s,onSelect:t,numberOfMonths:2})})]})]})}function We({data:s,isLoading:t}){const{privacyMode:a}=R();if(t)return e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 xl:grid-cols-5 gap-4",children:[1,2,3,4,5].map(n=>e.jsx(g,{children:e.jsx(j,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{className:"h-4 w-[100px]"}),e.jsx(m,{className:"h-8 w-[80px]"})]}),e.jsx(m,{className:"h-8 w-8 rounded-lg"})]})})},n))});const d=(s?.tokenBreakdown?.cacheCreation?.cost??0)+(s?.tokenBreakdown?.cacheRead?.cost??0),o=s?.totalCost?Math.round(d/s.totalCost*100):0,c=[{title:"Total Tokens",value:s?.totalTokens??0,icon:$e,format:n=>M(n),color:"text-blue-600",bgColor:"bg-blue-100 dark:bg-blue-900/20",subtitle:`${M(s?.totalInputTokens??0)} in / ${M(s?.totalOutputTokens??0)} out`},{title:"Total Cost",value:s?.totalCost??0,icon:ae,format:n=>`$${n.toFixed(2)}`,color:"text-green-600",bgColor:"bg-green-100 dark:bg-green-900/20",subtitle:`$${s?.averageCostPerDay?.toFixed(2)??"0.00"}/day avg`},{title:"Cache Tokens",value:s?.totalCacheTokens??0,icon:W,format:n=>M(n),color:"text-cyan-600",bgColor:"bg-cyan-100 dark:bg-cyan-900/20",subtitle:`$${d.toFixed(2)} (${o}% of cost)`},{title:"Input Cost",value:s?.tokenBreakdown?.input?.cost??0,icon:re,format:n=>`$${n.toFixed(2)}`,color:"text-purple-600",bgColor:"bg-purple-100 dark:bg-purple-900/20",subtitle:`${M(s?.tokenBreakdown?.input?.tokens??0)} tokens`},{title:"Output Cost",value:s?.tokenBreakdown?.output?.cost??0,icon:ne,format:n=>`$${n.toFixed(2)}`,color:"text-orange-600",bgColor:"bg-orange-100 dark:bg-orange-900/20",subtitle:`${M(s?.tokenBreakdown?.output?.tokens??0)} tokens`}];return e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 xl:grid-cols-5 gap-4",children:c.map((n,r)=>{const x=n.icon;return e.jsx(g,{className:"hover:shadow-md transition-shadow",children:e.jsx(j,{className:"p-4",children:e.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[e.jsxs("div",{className:"space-y-1 min-w-0",children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground truncate",children:n.title}),e.jsx("p",{className:i("text-xl font-bold truncate",a&&y),children:n.format(n.value)}),n.subtitle&&e.jsx("p",{className:i("text-[10px] text-muted-foreground truncate",a&&y),children:n.subtitle})]}),e.jsx("div",{className:i("p-2 rounded-lg shrink-0",n.bgColor),children:e.jsx(x,{className:i("h-4 w-4",n.color)})})]})})},r)})})}function M(s){return s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString()}function _e({data:s,isLoading:t,granularity:a="daily",className:d}){const{privacyMode:o}=R(),c=p.useMemo(()=>!s||s.length===0?[]:(a==="hourly"?s:[...s].reverse()).map(x=>{const u="hour"in x?x.hour:x.date;return{...x,dateFormatted:ze(u,a),costRounded:Number(x.cost.toFixed(4))}}),[s,a]);if(t)return e.jsx(m,{className:i("h-full w-full",d)});if(!s||s.length===0)return e.jsx("div",{className:i("h-full flex items-center justify-center",d),children:e.jsx("p",{className:"text-muted-foreground",children:a==="hourly"?"No usage data for today":"No usage data available"})});const n=({x:r,y:x,payload:u,isRight:f})=>{const h=f?`$${u.value}`:X(Number(u.value));return e.jsx("text",{x:r,y:x,dy:4,textAnchor:f?"start":"end",fontSize:12,fill:"currentColor",className:i("fill-muted-foreground",o&&"blur-[4px]"),children:h})};return e.jsx("div",{className:i("w-full h-full",d),children:e.jsx(ie,{width:"100%",height:"100%",children:e.jsxs(Ue,{data:c,margin:{top:5,right:30,left:20,bottom:5},children:[e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"tokenGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:"#0080FF",stopOpacity:.8}),e.jsx("stop",{offset:"95%",stopColor:"#0080FF",stopOpacity:.1})]}),e.jsxs("linearGradient",{id:"costGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:"#00C49F",stopOpacity:.8}),e.jsx("stop",{offset:"95%",stopColor:"#00C49F",stopOpacity:.1})]})]}),e.jsx(qe,{strokeDasharray:"3 3",className:"stroke-muted"}),e.jsx(Ie,{dataKey:"dateFormatted",tick:{fontSize:12},tickLine:!1,axisLine:{className:"stroke-muted"}}),e.jsx(V,{yAxisId:"left",orientation:"left",tick:r=>e.jsx(n,{...r,isRight:!1}),tickLine:!1,axisLine:{className:"stroke-muted"}}),e.jsx(V,{yAxisId:"right",orientation:"right",tick:r=>e.jsx(n,{...r,isRight:!0}),tickLine:!1,axisLine:{className:"stroke-muted"}}),e.jsx(oe,{content:({active:r,payload:x,label:u})=>{if(!r||!x||!x.length)return null;const f=x[0].payload;return e.jsxs("div",{className:"rounded-lg border bg-background p-3 shadow-lg",children:[e.jsx("p",{className:"font-medium mb-2",children:u}),x.map((h,S)=>e.jsxs("p",{className:i("text-sm",o&&y),style:{color:h.color},children:[h.name,":"," ",h.name==="Tokens"?X(Number(h.value)||0):`$${h.value}`]},S)),"requests"in f&&e.jsxs("p",{className:i("text-sm text-muted-foreground mt-1",o&&y),children:["Requests: ",f.requests]})]})}}),e.jsx(Z,{yAxisId:"left",type:"monotone",dataKey:"tokens",stroke:"#0080FF",strokeWidth:2,fillOpacity:1,fill:"url(#tokenGradient)",name:"Tokens"}),e.jsx(Z,{yAxisId:"right",type:"monotone",dataKey:"costRounded",stroke:"#00C49F",strokeWidth:2,fillOpacity:1,fill:"url(#costGradient)",name:"Cost"})]})})})}function ze(s,t){if(t==="hourly"){const[d,o]=s.split(" ");if(d&&o){const c=new Date(`${d}T${o}:00Z`);return k(c,"HH:mm")}return s}const a=new Date(s);return t==="monthly"?k(a,"MMM yyyy"):k(a,"MMM dd")}function X(s){return s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString()}function Ye({data:s,isLoading:t,className:a}){const{privacyMode:d}=R(),o=p.useMemo(()=>!s||s.length===0?[]:s.map(r=>({name:r.model,value:r.tokens,cost:r.cost,percentage:r.percentage,fill:te(r.model)})),[s]);if(t)return e.jsx(m,{className:i("h-[300px] w-full",a)});if(!s||s.length===0)return e.jsx("div",{className:i("h-[300px] flex items-center justify-center",a),children:e.jsx("p",{className:"text-muted-foreground",children:"No model data available"})});const c=({active:r,payload:x})=>{if(!r||!x)return null;const u=x;if(!u.length)return null;const f=u[0].payload;return e.jsxs("div",{className:"rounded-lg border bg-background p-2 shadow-lg text-xs",children:[e.jsx("p",{className:"font-medium mb-1",children:f.name}),e.jsxs("p",{className:i("text-muted-foreground",d&&y),children:[Qe(f.value)," (",f.percentage.toFixed(1),"%)"]}),e.jsxs("p",{className:i("text-muted-foreground",d&&y),children:["$",f.cost.toFixed(4)]})]})},n=r=>r.percentage>5?`${r.percentage.toFixed(1)}%`:"";return e.jsx("div",{className:i("w-full",a),children:e.jsx(ie,{width:"100%",height:250,children:e.jsxs(Oe,{children:[e.jsx(Ke,{data:o,cx:"50%",cy:"50%",labelLine:!1,label:n,innerRadius:50,outerRadius:70,paddingAngle:2,dataKey:"value",children:o.map((r,x)=>e.jsx(Ee,{fill:r.fill,strokeWidth:1},`cell-${x}`))}),e.jsx(oe,{content:c})]})})})}function Qe(s){return s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString()}function Ve({model:s}){const{privacyMode:t}=R(),a=Ze(s.ioRatio);return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Se,{className:"h-4 w-4 text-primary shrink-0"}),e.jsx("h4",{className:"font-semibold leading-none truncate",title:s.model,children:s.model})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(B,{variant:"secondary",className:"text-[10px] h-5 px-1.5",children:[s.percentage.toFixed(1),"% usage"]}),e.jsxs(B,{variant:a.variant,className:"text-[10px] h-5 px-1.5",children:[s.ioRatio.toFixed(0),":1 I/O"]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{className:"p-2 rounded-md bg-muted/50 border text-center",children:[e.jsxs("p",{className:i("text-lg font-bold",t&&y),children:["$",s.cost.toFixed(2)]}),e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Total Cost"})]}),e.jsxs("div",{className:"p-2 rounded-md bg-muted/50 border text-center",children:[e.jsx("p",{className:i("text-lg font-bold",t&&y),children:Je(s.tokens)}),e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Total Tokens"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h5",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wider",children:"Token Breakdown"}),e.jsxs("div",{className:i("space-y-1",t&&y),children:[e.jsx(I,{label:"Input",tokens:s.inputTokens,cost:s.costBreakdown.input.cost,color:"#335c67",icon:re}),e.jsx(I,{label:"Output",tokens:s.outputTokens,cost:s.costBreakdown.output.cost,color:"#fff3b0",icon:ne}),e.jsx(I,{label:"Cache Write",tokens:s.cacheCreationTokens,cost:s.costBreakdown.cacheCreation.cost,color:"#e09f3e",icon:W}),e.jsx(I,{label:"Cache Read",tokens:s.cacheReadTokens,cost:s.costBreakdown.cacheRead.cost,color:"#9e2a2b",icon:W})]})]}),e.jsxs("div",{className:"p-2.5 rounded-md border bg-muted/20 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(De,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("span",{className:"text-xs font-medium",children:"Input/Output Ratio"})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground leading-snug",children:a.description})]})]})}function I({label:s,tokens:t,cost:a,color:d,icon:o}){return t===0?null:e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("div",{className:"w-1 h-6 rounded-full shrink-0",style:{backgroundColor:d}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium truncate",children:s}),e.jsxs("span",{className:"font-mono text-muted-foreground",children:["$",a.toFixed(3)]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[e.jsx(o,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{children:Xe(t)})]})]})]})}function Ze(s){return s>=200?{variant:"destructive",description:"Extended thinking or large context loading. Expected for reasoning models."}:s>=50?{variant:"secondary",description:"More input than output. Typical for analysis tasks."}:s>=5?{variant:"outline",description:"Balanced input/output ratio for typical coding tasks."}:{variant:"default",description:"More output than input. Generation-heavy workload."}}function Xe(s){return s.toLocaleString()}function Je(s){return s>=1e9?`${(s/1e9).toFixed(1)}B`:s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toString()}function es({data:s,isLoading:t,className:a}){const{privacyMode:d}=R(),o=p.useMemo(()=>{if(!s?.sessions||s.sessions.length===0)return null;const c=s.sessions,n=s.total,r=c.reduce((v,b)=>v+(b.inputTokens+b.outputTokens),0),x=Math.round(r/c.length),f=c.reduce((v,b)=>v+b.cost,0)/c.length,h=c[0],S=h?H(new Date(h.lastActivity),{addSuffix:!0}):"N/A";return{totalSessions:n,avgTokens:x,avgCost:f,lastActive:S,recentSessions:c.slice(0,3)}},[s]);return t?e.jsxs(g,{className:i("flex flex-col h-full",a),children:[e.jsx(N,{className:"px-3 py-2",children:e.jsx(m,{className:"h-5 w-32"})}),e.jsx(j,{className:"px-3 pb-3 pt-0 flex-1",children:e.jsx(m,{className:"h-full w-full"})})]}):o?e.jsxs(g,{className:i("flex flex-col h-full shadow-sm",a),children:[e.jsx(N,{className:"px-3 py-2",children:e.jsxs(C,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(Q,{className:"w-4 h-4"}),"Session Stats"]})}),e.jsxs(j,{className:"px-3 pb-3 pt-0 flex-1 flex flex-col gap-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{className:"p-2 rounded-md bg-muted/50 border text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-1.5 text-blue-600 dark:text-blue-400",children:[e.jsx(Le,{className:"w-4 h-4"}),e.jsx("span",{className:"text-xl font-bold",children:o.totalSessions})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mt-0.5",children:"Total Sessions"})]}),e.jsxs("div",{className:"p-2 rounded-md bg-muted/50 border text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-1.5 text-green-600 dark:text-green-400",children:[e.jsx(le,{className:"w-4 h-4"}),e.jsxs("span",{className:i("text-xl font-bold",d&&y),children:["$",o.avgCost.toFixed(2)]})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mt-0.5",children:"Avg Cost/Session"})]})]}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground font-medium mb-1",children:[e.jsx(Fe,{className:"w-3 h-3"}),"Recent Activity"]}),e.jsx("div",{className:"space-y-1.5",children:o.recentSessions.map(c=>e.jsxs("div",{className:"flex items-center justify-between text-xs p-1.5 rounded bg-muted/30 hover:bg-muted/50 transition-colors",children:[e.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[e.jsx("span",{className:"font-medium truncate",title:c.projectPath,children:c.projectPath.split("/").pop()}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:H(new Date(c.lastActivity),{addSuffix:!0})})]}),e.jsxs("div",{className:i("text-right shrink-0 ml-2",d&&y),children:[e.jsxs("div",{className:"font-mono",children:["$",c.cost.toFixed(2)]}),e.jsxs("div",{className:"text-[10px] text-muted-foreground",children:[ss(c.inputTokens+c.outputTokens)," toks"]})]})]},c.sessionId))})]})]})]}):e.jsxs(g,{className:i("flex flex-col h-full",a),children:[e.jsx(N,{className:"px-3 py-2",children:e.jsxs(C,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(Q,{className:"w-4 h-4"}),"Session Stats"]})}),e.jsx(j,{className:"px-3 pb-3 pt-0 flex-1 flex items-center justify-center",children:e.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"No session data available"})})]})}function ss(s){return s>=1e9?`${(s/1e9).toFixed(1)}B`:s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toString()}function ts({className:s,isLoading:t}){const{data:a,isLoading:d}=ye(),{data:o,isLoading:c,error:n}=be(a?.running);if(t||d||a?.running&&c)return e.jsxs(g,{className:i("flex flex-col h-full",s),children:[e.jsx(N,{className:"px-3 py-2",children:e.jsxs(C,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(q,{className:"h-4 w-4"}),"CLIProxy Stats"]})}),e.jsx(j,{className:"px-3 pb-3 pt-0 flex-1",children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(m,{className:"h-4 w-[100px]"}),e.jsx(m,{className:"h-16 w-full"})]})})]});if(!a?.running)return e.jsxs(g,{className:i("flex flex-col h-full border-dashed",s),children:[e.jsx(N,{className:"px-3 py-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(C,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(q,{className:"h-4 w-4 text-muted-foreground"}),"CLIProxy Stats"]}),e.jsx(B,{variant:"secondary",className:"text-[10px] h-5",children:"Offline"})]})}),e.jsx(j,{className:"px-3 pb-3 pt-0 flex-1 flex items-center justify-center",children:e.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Start a CLIProxy session (gemini, codex, agy) to collect stats."})})]});if(n)return e.jsxs(g,{className:i("flex flex-col h-full border-destructive/50",s),children:[e.jsx(N,{className:"px-3 py-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(C,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(q,{className:"h-4 w-4"}),"CLIProxy Stats"]}),e.jsx(B,{variant:"destructive",className:"text-[10px] h-5",children:"Error"})]})}),e.jsx(j,{className:"px-3 pb-3 pt-0 flex-1",children:e.jsx("p",{className:"text-xs text-destructive",children:n.message})})]});const x=o?.totalRequests??0,u=o?.quotaExceededCount??0,f=x-u,h=x>0?Math.round(f/x*100):100,S=o?.tokens?.total??0,v=Object.entries(o?.requestsByModel??{}).sort((D,L)=>L[1]-D[1]).slice(0,4),b=v.length>0?v[0][1]:1;return e.jsxs(g,{className:i("flex flex-col h-full overflow-hidden",s),children:[e.jsx(N,{className:"px-3 py-2 border-b bg-muted/5",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(C,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(q,{className:"h-4 w-4"}),"CLIProxy Stats"]}),e.jsxs(B,{variant:"outline",className:"text-[10px] h-5 text-green-600 border-green-200 bg-green-50 dark:bg-green-900/10 dark:border-green-800",children:[e.jsx(le,{className:"h-3 w-3 mr-0.5"}),"Running"]})]})}),e.jsx(j,{className:"p-0 flex-1 min-h-0",children:e.jsx(we,{className:"h-full",children:e.jsxs("div",{className:"p-3 space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg bg-muted/30",children:[e.jsxs("div",{className:"relative",children:[e.jsxs("svg",{className:"w-10 h-10 -rotate-90",viewBox:"0 0 36 36",children:[e.jsx("circle",{cx:"18",cy:"18",r:"14",fill:"none",stroke:"currentColor",strokeWidth:"3",className:"text-muted/30"}),e.jsx("circle",{cx:"18",cy:"18",r:"14",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeDasharray:`${h*.88} 88`,strokeLinecap:"round",className:h>=90?"text-green-500":"text-amber-500"})]}),e.jsxs("span",{className:"absolute inset-0 flex items-center justify-center text-[8px] font-bold",children:[h,"%"]})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-lg font-bold leading-none",children:J(x)}),e.jsx("div",{className:"text-[9px] text-muted-foreground mt-0.5",children:u>0?`${u} failed`:"All success"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg bg-muted/30",children:[e.jsx("div",{className:"p-1.5 rounded-md bg-purple-100 dark:bg-purple-900/20",children:e.jsx(Te,{className:"h-4 w-4 text-purple-600"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-lg font-bold leading-none",children:J(S)}),e.jsx("div",{className:"text-[9px] text-muted-foreground mt-0.5",children:"Total tokens"})]})]})]}),v.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-medium text-muted-foreground",children:[e.jsx(Me,{className:"h-3 w-3"}),"Models Used"]}),e.jsx("div",{className:"space-y-1",children:v.map(([D,L])=>{const K=Math.round(L/b*100),E=as(D);return e.jsxs("div",{className:"group",children:[e.jsxs("div",{className:"flex items-center justify-between text-[10px] mb-0.5",children:[e.jsx("span",{className:"truncate font-medium",title:D,children:E}),e.jsx("span",{className:"text-muted-foreground shrink-0 ml-2",children:L})]}),e.jsx("div",{className:"h-1 bg-muted/50 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-accent/70 rounded-full transition-all",style:{width:`${K}%`}})})]},D)})})]})]})})})]})}function J(s){return s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString()}function as(s){let t=s.replace(/^gemini-claude-/,"").replace(/^gemini-/,"").replace(/^claude-/,"").replace(/^anthropic\./,"").replace(/-thinking$/," Thinking");return t=t.split(/[-_]/).map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),t.length>20&&(t=t.slice(0,18)+"..."),t}const rs="/api";function w(s){const t=s.getFullYear(),a=String(s.getMonth()+1).padStart(2,"0"),d=String(s.getDate()).padStart(2,"0");return`${t}${a}${d}`}const T={summary:s=>{const t=new URLSearchParams;return s?.startDate&&t.append("since",w(s.startDate)),s?.endDate&&t.append("until",w(s.endDate)),s?.profile&&t.append("profile",s.profile),$(`/usage/summary?${t}`)},trends:s=>{const t=new URLSearchParams;return s?.startDate&&t.append("since",w(s.startDate)),s?.endDate&&t.append("until",w(s.endDate)),s?.profile&&t.append("profile",s.profile),$(`/usage/daily?${t}`)},hourly:s=>{const t=new URLSearchParams;return s?.startDate&&t.append("since",w(s.startDate)),s?.endDate&&t.append("until",w(s.endDate)),$(`/usage/hourly?${t}`)},models:s=>{const t=new URLSearchParams;return s?.startDate&&t.append("since",w(s.startDate)),s?.endDate&&t.append("until",w(s.endDate)),s?.profile&&t.append("profile",s.profile),$(`/usage/models?${t}`)},sessions:s=>{const t=new URLSearchParams;return s?.startDate&&t.append("since",w(s.startDate)),s?.endDate&&t.append("until",w(s.endDate)),s?.profile&&t.append("profile",s.profile),s?.limit&&t.append("limit",s.limit.toString()),s?.offset&&t.append("offset",s.offset.toString()),$(`/usage/sessions?${t}`)},monthly:(s,t)=>{const a=new URLSearchParams;return s&&a.append("months",s.toString()),t&&a.append("profile",t),$(`/usage/monthly?${a}`)},refresh:async()=>{if(!(await fetch(`${rs}/usage/refresh`,{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw new Error("Failed to refresh usage cache")},status:()=>$("/usage/status"),insights:s=>{const t=new URLSearchParams;return s?.startDate&&t.append("since",w(s.startDate)),s?.endDate&&t.append("until",w(s.endDate)),s?.profile&&t.append("profile",s.profile),$(`/usage/insights?${t}`)}};async function $(s){const a=await fetch(`/api${s}`,{headers:{"Content-Type":"application/json"}});if(!a.ok){const o=await a.json().catch(()=>({error:"Unknown error"}));throw new Error(o.error||a.statusText)}const d=await a.json();return d.data||d}function ns(s){return P({queryKey:["usage","summary",s],queryFn:()=>T.summary(s),staleTime:60*1e3})}function ls(s){return P({queryKey:["usage","trends",s],queryFn:()=>T.trends(s),staleTime:60*1e3})}function is(s){return P({queryKey:["usage","hourly",s],queryFn:()=>T.hourly(s),staleTime:60*1e3})}function os(s){return P({queryKey:["usage","models",s],queryFn:()=>T.models(s),staleTime:60*1e3})}function cs(){const s=Ge();return p.useCallback(async()=>{await T.refresh(),await s.invalidateQueries({queryKey:["usage"]})},[s])}function ds(){return P({queryKey:["usage","status"],queryFn:()=>T.status(),staleTime:10*1e3,refetchInterval:30*1e3})}function xs(s){return P({queryKey:["usage","sessions",s],queryFn:()=>T.sessions(s),staleTime:60*1e3})}function us(s){return s>=1e9?`${(s/1e9).toFixed(1)}B`:s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(0)}K`:s.toString()}function ks(){const{privacyMode:s}=R(),[t,a]=p.useState({from:F(new Date,30),to:new Date}),[d,o]=p.useState(!1),[c,n]=p.useState(null),[r,x]=p.useState(null),[u,f]=p.useState("daily"),h=p.useRef(null),S=cs(),v=async()=>{o(!0);try{await S()}finally{o(!1)}},b={startDate:t?.from,endDate:t?.to},{data:D,isLoading:L}=ns(b),{data:K,isLoading:E}=ls(b),{data:ce,isLoading:de}=is(b),{data:_,isLoading:z}=os(b),{data:xe,isLoading:ue}=xs({...b,limit:3}),{data:G}=ds(),me=p.useCallback(()=>{const l=new Date;a({from:F(l,1),to:l}),f("hourly")},[]),fe=p.useCallback(l=>{a(l),f("daily")},[]),Y=p.useMemo(()=>G?.lastFetch?H(new Date(G.lastFetch),{addSuffix:!0}):null,[G?.lastFetch]),he=p.useCallback((l,A)=>{const U=A.currentTarget.getBoundingClientRect();x({x:U.left+U.width/2,y:U.top+U.height/2}),n(l)},[]),pe=p.useCallback(()=>{n(null),x(null)},[]);return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden px-4 pt-4 pb-50 gap-4",children:[e.jsxs("div",{className:"flex items-center justify-between shrink-0",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-semibold",children:"Analytics"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Track usage & insights"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(O,{variant:u==="hourly"?"default":"outline",size:"sm",className:"h-8",onClick:me,children:"24H"}),e.jsx(He,{value:t,onChange:fe,presets:[{label:"7D",range:{from:F(new Date,7),to:new Date}},{label:"30D",range:{from:F(new Date,30),to:new Date}},{label:"Month",range:{from:ke(new Date),to:new Date}},{label:"All Time",range:{from:void 0,to:new Date}}]}),Y&&e.jsxs("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:["Updated ",Y]}),e.jsx(O,{variant:"outline",size:"sm",className:"gap-2 h-8",onClick:v,disabled:d,children:e.jsx(Re,{className:`w-3.5 h-3.5 ${d?"animate-spin":""}`})})]})]}),e.jsx(We,{data:D,isLoading:L}),e.jsxs("div",{className:"flex-1 flex flex-col min-h-0 gap-4",children:[e.jsxs(g,{className:"flex flex-col flex-1 min-h-0 max-h-[500px] overflow-hidden shadow-sm",children:[e.jsx(N,{className:"px-3 py-2 shrink-0",children:e.jsxs(C,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(Pe,{className:"w-4 h-4"}),u==="hourly"?"Last 24 Hours":"Usage Trends"]})}),e.jsx(j,{className:"px-3 pb-3 pt-0 flex-1 min-h-0",children:e.jsx(_e,{data:u==="hourly"?ce||[]:K||[],isLoading:u==="hourly"?de:E,granularity:u==="hourly"?"hourly":"daily"})})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-10 gap-4 h-auto lg:h-[180px] shrink-0",children:[e.jsxs(g,{className:"flex flex-col h-full min-h-0 shadow-sm lg:col-span-4",children:[e.jsx(N,{className:"px-3 py-2",children:e.jsxs(C,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(ae,{className:"w-4 h-4"}),"Cost by Model"]})}),e.jsx(j,{className:"px-2 pb-2 pt-0 flex-1 min-h-0 overflow-y-auto",children:z?e.jsx(m,{className:"h-full w-full"}):e.jsxs("div",{className:"space-y-0.5",children:[[..._||[]].sort((l,A)=>A.cost-l.cost).map(l=>e.jsxs("button",{className:"group flex items-center text-xs w-full hover:bg-muted/50 rounded px-2 py-1.5 transition-colors cursor-pointer gap-3",onClick:A=>he(l,A),title:"Click for details",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 w-[180px] shrink-0",children:[e.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:te(l.model)}}),e.jsx("span",{className:"font-medium truncate group-hover:underline underline-offset-2",children:l.model})]}),e.jsx("div",{className:"flex-1 flex items-center gap-1 min-w-0",children:e.jsxs("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden flex",children:[e.jsx("div",{className:"h-full",style:{backgroundColor:"#335c67",width:`${l.cost>0?l.costBreakdown.input.cost/l.cost*100:0}%`},title:`Input: $${l.costBreakdown.input.cost.toFixed(2)}`}),e.jsx("div",{className:"h-full",style:{backgroundColor:"#fff3b0",width:`${l.cost>0?l.costBreakdown.output.cost/l.cost*100:0}%`},title:`Output: $${l.costBreakdown.output.cost.toFixed(2)}`}),e.jsx("div",{className:"h-full",style:{backgroundColor:"#e09f3e",width:`${l.cost>0?l.costBreakdown.cacheCreation.cost/l.cost*100:0}%`},title:`Cache Write: $${l.costBreakdown.cacheCreation.cost.toFixed(2)}`}),e.jsx("div",{className:"h-full",style:{backgroundColor:"#9e2a2b",width:`${l.cost>0?l.costBreakdown.cacheRead.cost/l.cost*100:0}%`},title:`Cache Read: $${l.costBreakdown.cacheRead.cost.toFixed(2)}`})]})}),e.jsx("span",{className:i("text-[10px] text-muted-foreground w-14 text-right shrink-0",s&&y),children:us(l.tokens)}),e.jsxs("span",{className:i("font-mono font-medium w-16 text-right shrink-0",s&&y),children:["$",l.cost.toFixed(2)]}),e.jsx(Ae,{className:"w-3 h-3 opacity-0 group-hover:opacity-50 transition-opacity shrink-0"})]},l.model)),e.jsxs("div",{className:"flex items-center gap-3 pt-2 px-2 text-[10px] text-muted-foreground border-t mt-2",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:"#335c67"}}),"Input"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-2 h-2 rounded-full border border-muted-foreground/30",style:{backgroundColor:"#fff3b0"}}),"Output"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:"#e09f3e"}}),"Cache Write"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:"#9e2a2b"}}),"Cache Read"]})]})]})})]}),e.jsxs(g,{className:"flex flex-col h-full min-h-0 shadow-sm lg:col-span-2",children:[e.jsx(N,{className:"px-3 py-2",children:e.jsxs(C,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(Be,{className:"w-4 h-4"}),"Model Usage"]})}),e.jsx(j,{className:"px-2 pb-2 pt-0 flex-1 min-h-0 flex items-center justify-center",children:e.jsx(Ye,{data:_||[],isLoading:z,className:"h-full w-full"})})]}),e.jsx(es,{data:xe,isLoading:ue,className:"lg:col-span-2"}),e.jsx(ts,{isLoading:L,className:"lg:col-span-2"})]}),e.jsxs(ee,{open:!!c,onOpenChange:l=>!l&&pe(),children:[e.jsx(ve,{asChild:!0,children:e.jsx("div",{ref:h,className:"fixed pointer-events-none",style:{left:r?.x??0,top:r?.y??0,width:1,height:1}})}),e.jsx(se,{className:"w-80 p-3",side:"top",align:"center",children:c&&e.jsx(Ve,{model:c})})]})]})]})}function Cs(){return e.jsxs("div",{className:"space-y-4 h-full overflow-hidden",children:[e.jsxs(g,{className:"flex flex-col min-h-[300px]",children:[e.jsx(N,{className:"p-4 pb-2",children:e.jsx(m,{className:"h-4 w-32"})}),e.jsx(j,{className:"p-4 pt-0 flex-1",children:e.jsx(m,{className:"h-full w-full"})})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsxs(g,{className:"flex flex-col min-h-[250px]",children:[e.jsx(N,{className:"p-4 pb-2",children:e.jsx(m,{className:"h-4 w-28"})}),e.jsx(j,{className:"p-4 pt-2",children:e.jsx("div",{className:"space-y-3",children:[1,2,3,4,5].map(s=>e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(m,{className:"w-2.5 h-2.5 rounded-full"}),e.jsx(m,{className:"h-3 w-24"})]}),e.jsx(m,{className:"h-3 w-16"})]},s))})})]}),e.jsxs(g,{className:"flex flex-col min-h-[250px]",children:[e.jsx(N,{className:"p-4 pb-2",children:e.jsx(m,{className:"h-4 w-28"})}),e.jsx(j,{className:"p-4 pt-0 flex-1",children:e.jsxs("div",{className:"flex w-full h-full items-center",children:[e.jsx("div",{className:"flex-1 flex justify-center",children:e.jsx(m,{className:"h-[180px] w-[180px] rounded-full"})}),e.jsx("div",{className:"w-[140px] shrink-0 pl-2 space-y-2",children:[1,2,3,4].map(s=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(m,{className:"w-2 h-2 rounded-full"}),e.jsx(m,{className:"h-3 w-20"})]},s))})]})})]})]})]})}export{ks as AnalyticsPage,Cs as AnalyticsSkeleton};
|
|
1
|
+
import{j as e}from"./radix-ui-DFHQr9A5.js";import{c as ge,r as p}from"./react-vendor-FspHSO0w.js";import{C as g,a as j,b as N,c as C}from"./card-tk5ihPK8.js";import{c as i,B as O,P as ee,a as je,b as se,C as Ne,u as R,S as m,d as y,g as te,e as B,f as ye,h as be,i as we,j as ve}from"./index-c9idYjfn.js";import{K as F,f as k,L as H,H as ke}from"./utils-CzKF5WmX.js";import{a2 as Ce,s as $e,a3 as ae,a4 as W,a5 as re,v as ne,Y as Se,G as De,t as Q,U as Le,Z as le,r as Fe,a6 as q,a7 as Te,a8 as Me,J as Re,a9 as Pe,b as Ae,aa as Be}from"./icons-U_6eBV_J.js";import{R as ie,A as Ue,C as qe,X as Ie,Y as V,T as oe,a as Z,P as Oe,b as Ke,c as Ee}from"./charts-B9Jh-s-X.js";import{u as Ge,a as P}from"./tanstack-C4gT2P7V.js";import"./notifications-B2Pz7lik.js";import"./form-utils-BuXDJb0w.js";import"./code-highlight-BoHWVYut.js";function He({value:s,onChange:t,presets:a=[{label:"Last 7 days",range:{from:F(new Date,7),to:new Date}},{label:"Last 30 days",range:{from:F(new Date,30),to:new Date}},{label:"Last 90 days",range:{from:F(new Date,90),to:new Date}}],className:d}){const[o,c]=ge.useState(!1),n=r=>!s||!s.from||!s.to||!r.from||!r.to?!1:k(s.from,"yyyy-MM-dd")===k(r.from,"yyyy-MM-dd")&&k(s.to,"yyyy-MM-dd")===k(r.to,"yyyy-MM-dd");return e.jsxs("div",{className:i("flex items-center gap-2",d),children:[a.map(r=>e.jsx(O,{variant:n(r.range)?"default":"outline",size:"sm",onClick:()=>t(r.range),children:r.label},r.label)),e.jsxs(ee,{open:o,onOpenChange:c,children:[e.jsx(je,{asChild:!0,children:e.jsxs(O,{id:"date",variant:"outline",className:i("w-auto min-w-[240px] justify-start text-left font-normal",!s&&"text-muted-foreground"),children:[e.jsx(Ce,{className:"mr-2 h-4 w-4"}),s?.from?s.to?e.jsxs(e.Fragment,{children:[k(s.from,"LLL dd, y")," - ",k(s.to,"LLL dd, y")]}):k(s.from,"LLL dd, y"):e.jsx("span",{children:"Pick a date"})]})}),e.jsx(se,{className:"w-auto p-0",align:"end",children:e.jsx(Ne,{initialFocus:!0,mode:"range",defaultMonth:s?.from,selected:s,onSelect:t,numberOfMonths:2})})]})]})}function We({data:s,isLoading:t}){const{privacyMode:a}=R();if(t)return e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 xl:grid-cols-5 gap-4",children:[1,2,3,4,5].map(n=>e.jsx(g,{children:e.jsx(j,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{className:"h-4 w-[100px]"}),e.jsx(m,{className:"h-8 w-[80px]"})]}),e.jsx(m,{className:"h-8 w-8 rounded-lg"})]})})},n))});const d=(s?.tokenBreakdown?.cacheCreation?.cost??0)+(s?.tokenBreakdown?.cacheRead?.cost??0),o=s?.totalCost?Math.round(d/s.totalCost*100):0,c=[{title:"Total Tokens",value:s?.totalTokens??0,icon:$e,format:n=>M(n),color:"text-blue-600",bgColor:"bg-blue-100 dark:bg-blue-900/20",subtitle:`${M(s?.totalInputTokens??0)} in / ${M(s?.totalOutputTokens??0)} out`},{title:"Total Cost",value:s?.totalCost??0,icon:ae,format:n=>`$${n.toFixed(2)}`,color:"text-green-600",bgColor:"bg-green-100 dark:bg-green-900/20",subtitle:`$${s?.averageCostPerDay?.toFixed(2)??"0.00"}/day avg`},{title:"Cache Tokens",value:s?.totalCacheTokens??0,icon:W,format:n=>M(n),color:"text-cyan-600",bgColor:"bg-cyan-100 dark:bg-cyan-900/20",subtitle:`$${d.toFixed(2)} (${o}% of cost)`},{title:"Input Cost",value:s?.tokenBreakdown?.input?.cost??0,icon:re,format:n=>`$${n.toFixed(2)}`,color:"text-purple-600",bgColor:"bg-purple-100 dark:bg-purple-900/20",subtitle:`${M(s?.tokenBreakdown?.input?.tokens??0)} tokens`},{title:"Output Cost",value:s?.tokenBreakdown?.output?.cost??0,icon:ne,format:n=>`$${n.toFixed(2)}`,color:"text-orange-600",bgColor:"bg-orange-100 dark:bg-orange-900/20",subtitle:`${M(s?.tokenBreakdown?.output?.tokens??0)} tokens`}];return e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 xl:grid-cols-5 gap-4",children:c.map((n,r)=>{const x=n.icon;return e.jsx(g,{className:"hover:shadow-md transition-shadow",children:e.jsx(j,{className:"p-4",children:e.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[e.jsxs("div",{className:"space-y-1 min-w-0",children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground truncate",children:n.title}),e.jsx("p",{className:i("text-xl font-bold truncate",a&&y),children:n.format(n.value)}),n.subtitle&&e.jsx("p",{className:i("text-[10px] text-muted-foreground truncate",a&&y),children:n.subtitle})]}),e.jsx("div",{className:i("p-2 rounded-lg shrink-0",n.bgColor),children:e.jsx(x,{className:i("h-4 w-4",n.color)})})]})})},r)})})}function M(s){return s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString()}function _e({data:s,isLoading:t,granularity:a="daily",className:d}){const{privacyMode:o}=R(),c=p.useMemo(()=>!s||s.length===0?[]:(a==="hourly"?s:[...s].reverse()).map(x=>{const u="hour"in x?x.hour:x.date;return{...x,dateFormatted:ze(u,a),costRounded:Number(x.cost.toFixed(4))}}),[s,a]);if(t)return e.jsx(m,{className:i("h-full w-full",d)});if(!s||s.length===0)return e.jsx("div",{className:i("h-full flex items-center justify-center",d),children:e.jsx("p",{className:"text-muted-foreground",children:a==="hourly"?"No usage data for today":"No usage data available"})});const n=({x:r,y:x,payload:u,isRight:f})=>{const h=f?`$${u.value}`:X(Number(u.value));return e.jsx("text",{x:r,y:x,dy:4,textAnchor:f?"start":"end",fontSize:12,fill:"currentColor",className:i("fill-muted-foreground",o&&"blur-[4px]"),children:h})};return e.jsx("div",{className:i("w-full h-full",d),children:e.jsx(ie,{width:"100%",height:"100%",children:e.jsxs(Ue,{data:c,margin:{top:5,right:30,left:20,bottom:5},children:[e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"tokenGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:"#0080FF",stopOpacity:.8}),e.jsx("stop",{offset:"95%",stopColor:"#0080FF",stopOpacity:.1})]}),e.jsxs("linearGradient",{id:"costGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:"#00C49F",stopOpacity:.8}),e.jsx("stop",{offset:"95%",stopColor:"#00C49F",stopOpacity:.1})]})]}),e.jsx(qe,{strokeDasharray:"3 3",className:"stroke-muted"}),e.jsx(Ie,{dataKey:"dateFormatted",tick:{fontSize:12},tickLine:!1,axisLine:{className:"stroke-muted"}}),e.jsx(V,{yAxisId:"left",orientation:"left",tick:r=>e.jsx(n,{...r,isRight:!1}),tickLine:!1,axisLine:{className:"stroke-muted"}}),e.jsx(V,{yAxisId:"right",orientation:"right",tick:r=>e.jsx(n,{...r,isRight:!0}),tickLine:!1,axisLine:{className:"stroke-muted"}}),e.jsx(oe,{content:({active:r,payload:x,label:u})=>{if(!r||!x||!x.length)return null;const f=x[0].payload;return e.jsxs("div",{className:"rounded-lg border bg-background p-3 shadow-lg",children:[e.jsx("p",{className:"font-medium mb-2",children:u}),x.map((h,S)=>e.jsxs("p",{className:i("text-sm",o&&y),style:{color:h.color},children:[h.name,":"," ",h.name==="Tokens"?X(Number(h.value)||0):`$${h.value}`]},S)),"requests"in f&&e.jsxs("p",{className:i("text-sm text-muted-foreground mt-1",o&&y),children:["Requests: ",f.requests]})]})}}),e.jsx(Z,{yAxisId:"left",type:"monotone",dataKey:"tokens",stroke:"#0080FF",strokeWidth:2,fillOpacity:1,fill:"url(#tokenGradient)",name:"Tokens"}),e.jsx(Z,{yAxisId:"right",type:"monotone",dataKey:"costRounded",stroke:"#00C49F",strokeWidth:2,fillOpacity:1,fill:"url(#costGradient)",name:"Cost"})]})})})}function ze(s,t){if(t==="hourly"){const[d,o]=s.split(" ");if(d&&o){const c=new Date(`${d}T${o}:00Z`);return k(c,"HH:mm")}return s}const a=new Date(s);return t==="monthly"?k(a,"MMM yyyy"):k(a,"MMM dd")}function X(s){return s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString()}function Ye({data:s,isLoading:t,className:a}){const{privacyMode:d}=R(),o=p.useMemo(()=>!s||s.length===0?[]:s.map(r=>({name:r.model,value:r.tokens,cost:r.cost,percentage:r.percentage,fill:te(r.model)})),[s]);if(t)return e.jsx(m,{className:i("h-[300px] w-full",a)});if(!s||s.length===0)return e.jsx("div",{className:i("h-[300px] flex items-center justify-center",a),children:e.jsx("p",{className:"text-muted-foreground",children:"No model data available"})});const c=({active:r,payload:x})=>{if(!r||!x)return null;const u=x;if(!u.length)return null;const f=u[0].payload;return e.jsxs("div",{className:"rounded-lg border bg-background p-2 shadow-lg text-xs",children:[e.jsx("p",{className:"font-medium mb-1",children:f.name}),e.jsxs("p",{className:i("text-muted-foreground",d&&y),children:[Qe(f.value)," (",f.percentage.toFixed(1),"%)"]}),e.jsxs("p",{className:i("text-muted-foreground",d&&y),children:["$",f.cost.toFixed(4)]})]})},n=r=>r.percentage>5?`${r.percentage.toFixed(1)}%`:"";return e.jsx("div",{className:i("w-full",a),children:e.jsx(ie,{width:"100%",height:250,children:e.jsxs(Oe,{children:[e.jsx(Ke,{data:o,cx:"50%",cy:"50%",labelLine:!1,label:n,innerRadius:50,outerRadius:70,paddingAngle:2,dataKey:"value",children:o.map((r,x)=>e.jsx(Ee,{fill:r.fill,strokeWidth:1},`cell-${x}`))}),e.jsx(oe,{content:c})]})})})}function Qe(s){return s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString()}function Ve({model:s}){const{privacyMode:t}=R(),a=Ze(s.ioRatio);return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Se,{className:"h-4 w-4 text-primary shrink-0"}),e.jsx("h4",{className:"font-semibold leading-none truncate",title:s.model,children:s.model})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(B,{variant:"secondary",className:"text-[10px] h-5 px-1.5",children:[s.percentage.toFixed(1),"% usage"]}),e.jsxs(B,{variant:a.variant,className:"text-[10px] h-5 px-1.5",children:[s.ioRatio.toFixed(0),":1 I/O"]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{className:"p-2 rounded-md bg-muted/50 border text-center",children:[e.jsxs("p",{className:i("text-lg font-bold",t&&y),children:["$",s.cost.toFixed(2)]}),e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Total Cost"})]}),e.jsxs("div",{className:"p-2 rounded-md bg-muted/50 border text-center",children:[e.jsx("p",{className:i("text-lg font-bold",t&&y),children:Je(s.tokens)}),e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Total Tokens"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h5",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wider",children:"Token Breakdown"}),e.jsxs("div",{className:i("space-y-1",t&&y),children:[e.jsx(I,{label:"Input",tokens:s.inputTokens,cost:s.costBreakdown.input.cost,color:"#335c67",icon:re}),e.jsx(I,{label:"Output",tokens:s.outputTokens,cost:s.costBreakdown.output.cost,color:"#fff3b0",icon:ne}),e.jsx(I,{label:"Cache Write",tokens:s.cacheCreationTokens,cost:s.costBreakdown.cacheCreation.cost,color:"#e09f3e",icon:W}),e.jsx(I,{label:"Cache Read",tokens:s.cacheReadTokens,cost:s.costBreakdown.cacheRead.cost,color:"#9e2a2b",icon:W})]})]}),e.jsxs("div",{className:"p-2.5 rounded-md border bg-muted/20 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(De,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("span",{className:"text-xs font-medium",children:"Input/Output Ratio"})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground leading-snug",children:a.description})]})]})}function I({label:s,tokens:t,cost:a,color:d,icon:o}){return t===0?null:e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("div",{className:"w-1 h-6 rounded-full shrink-0",style:{backgroundColor:d}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium truncate",children:s}),e.jsxs("span",{className:"font-mono text-muted-foreground",children:["$",a.toFixed(3)]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[e.jsx(o,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{children:Xe(t)})]})]})]})}function Ze(s){return s>=200?{variant:"destructive",description:"Extended thinking or large context loading. Expected for reasoning models."}:s>=50?{variant:"secondary",description:"More input than output. Typical for analysis tasks."}:s>=5?{variant:"outline",description:"Balanced input/output ratio for typical coding tasks."}:{variant:"default",description:"More output than input. Generation-heavy workload."}}function Xe(s){return s.toLocaleString()}function Je(s){return s>=1e9?`${(s/1e9).toFixed(1)}B`:s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toString()}function es({data:s,isLoading:t,className:a}){const{privacyMode:d}=R(),o=p.useMemo(()=>{if(!s?.sessions||s.sessions.length===0)return null;const c=s.sessions,n=s.total,r=c.reduce((v,b)=>v+(b.inputTokens+b.outputTokens),0),x=Math.round(r/c.length),f=c.reduce((v,b)=>v+b.cost,0)/c.length,h=c[0],S=h?H(new Date(h.lastActivity),{addSuffix:!0}):"N/A";return{totalSessions:n,avgTokens:x,avgCost:f,lastActive:S,recentSessions:c.slice(0,3)}},[s]);return t?e.jsxs(g,{className:i("flex flex-col h-full",a),children:[e.jsx(N,{className:"px-3 py-2",children:e.jsx(m,{className:"h-5 w-32"})}),e.jsx(j,{className:"px-3 pb-3 pt-0 flex-1",children:e.jsx(m,{className:"h-full w-full"})})]}):o?e.jsxs(g,{className:i("flex flex-col h-full shadow-sm",a),children:[e.jsx(N,{className:"px-3 py-2",children:e.jsxs(C,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(Q,{className:"w-4 h-4"}),"Session Stats"]})}),e.jsxs(j,{className:"px-3 pb-3 pt-0 flex-1 flex flex-col gap-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{className:"p-2 rounded-md bg-muted/50 border text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-1.5 text-blue-600 dark:text-blue-400",children:[e.jsx(Le,{className:"w-4 h-4"}),e.jsx("span",{className:"text-xl font-bold",children:o.totalSessions})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mt-0.5",children:"Total Sessions"})]}),e.jsxs("div",{className:"p-2 rounded-md bg-muted/50 border text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-1.5 text-green-600 dark:text-green-400",children:[e.jsx(le,{className:"w-4 h-4"}),e.jsxs("span",{className:i("text-xl font-bold",d&&y),children:["$",o.avgCost.toFixed(2)]})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mt-0.5",children:"Avg Cost/Session"})]})]}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground font-medium mb-1",children:[e.jsx(Fe,{className:"w-3 h-3"}),"Recent Activity"]}),e.jsx("div",{className:"space-y-1.5",children:o.recentSessions.map(c=>e.jsxs("div",{className:"flex items-center justify-between text-xs p-1.5 rounded bg-muted/30 hover:bg-muted/50 transition-colors",children:[e.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[e.jsx("span",{className:"font-medium truncate",title:c.projectPath,children:c.projectPath.split("/").pop()}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:H(new Date(c.lastActivity),{addSuffix:!0})})]}),e.jsxs("div",{className:i("text-right shrink-0 ml-2",d&&y),children:[e.jsxs("div",{className:"font-mono",children:["$",c.cost.toFixed(2)]}),e.jsxs("div",{className:"text-[10px] text-muted-foreground",children:[ss(c.inputTokens+c.outputTokens)," toks"]})]})]},c.sessionId))})]})]})]}):e.jsxs(g,{className:i("flex flex-col h-full",a),children:[e.jsx(N,{className:"px-3 py-2",children:e.jsxs(C,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(Q,{className:"w-4 h-4"}),"Session Stats"]})}),e.jsx(j,{className:"px-3 pb-3 pt-0 flex-1 flex items-center justify-center",children:e.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"No session data available"})})]})}function ss(s){return s>=1e9?`${(s/1e9).toFixed(1)}B`:s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toString()}function ts({className:s,isLoading:t}){const{data:a,isLoading:d}=ye(),{data:o,isLoading:c,error:n}=be(a?.running);if(t||d||a?.running&&c)return e.jsxs(g,{className:i("flex flex-col h-full",s),children:[e.jsx(N,{className:"px-3 py-2",children:e.jsxs(C,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(q,{className:"h-4 w-4"}),"CLIProxy Stats"]})}),e.jsx(j,{className:"px-3 pb-3 pt-0 flex-1",children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(m,{className:"h-4 w-[100px]"}),e.jsx(m,{className:"h-16 w-full"})]})})]});if(!a?.running)return e.jsxs(g,{className:i("flex flex-col h-full border-dashed",s),children:[e.jsx(N,{className:"px-3 py-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(C,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(q,{className:"h-4 w-4 text-muted-foreground"}),"CLIProxy Stats"]}),e.jsx(B,{variant:"secondary",className:"text-[10px] h-5",children:"Offline"})]})}),e.jsx(j,{className:"px-3 pb-3 pt-0 flex-1 flex items-center justify-center",children:e.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Start a CLIProxy session (gemini, codex, agy) to collect stats."})})]});if(n)return e.jsxs(g,{className:i("flex flex-col h-full border-destructive/50",s),children:[e.jsx(N,{className:"px-3 py-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(C,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(q,{className:"h-4 w-4"}),"CLIProxy Stats"]}),e.jsx(B,{variant:"destructive",className:"text-[10px] h-5",children:"Error"})]})}),e.jsx(j,{className:"px-3 pb-3 pt-0 flex-1",children:e.jsx("p",{className:"text-xs text-destructive",children:n.message})})]});const x=o?.totalRequests??0,u=o?.quotaExceededCount??0,f=x-u,h=x>0?Math.round(f/x*100):100,S=o?.tokens?.total??0,v=Object.entries(o?.requestsByModel??{}).sort((D,L)=>L[1]-D[1]).slice(0,4),b=v.length>0?v[0][1]:1;return e.jsxs(g,{className:i("flex flex-col h-full overflow-hidden",s),children:[e.jsx(N,{className:"px-3 py-2 border-b bg-muted/5",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(C,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(q,{className:"h-4 w-4"}),"CLIProxy Stats"]}),e.jsxs(B,{variant:"outline",className:"text-[10px] h-5 text-green-600 border-green-200 bg-green-50 dark:bg-green-900/10 dark:border-green-800",children:[e.jsx(le,{className:"h-3 w-3 mr-0.5"}),"Running"]})]})}),e.jsx(j,{className:"p-0 flex-1 min-h-0",children:e.jsx(we,{className:"h-full",children:e.jsxs("div",{className:"p-3 space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg bg-muted/30",children:[e.jsxs("div",{className:"relative",children:[e.jsxs("svg",{className:"w-10 h-10 -rotate-90",viewBox:"0 0 36 36",children:[e.jsx("circle",{cx:"18",cy:"18",r:"14",fill:"none",stroke:"currentColor",strokeWidth:"3",className:"text-muted/30"}),e.jsx("circle",{cx:"18",cy:"18",r:"14",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeDasharray:`${h*.88} 88`,strokeLinecap:"round",className:h>=90?"text-green-500":"text-amber-500"})]}),e.jsxs("span",{className:"absolute inset-0 flex items-center justify-center text-[8px] font-bold",children:[h,"%"]})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-lg font-bold leading-none",children:J(x)}),e.jsx("div",{className:"text-[9px] text-muted-foreground mt-0.5",children:u>0?`${u} failed`:"All success"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg bg-muted/30",children:[e.jsx("div",{className:"p-1.5 rounded-md bg-purple-100 dark:bg-purple-900/20",children:e.jsx(Te,{className:"h-4 w-4 text-purple-600"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-lg font-bold leading-none",children:J(S)}),e.jsx("div",{className:"text-[9px] text-muted-foreground mt-0.5",children:"Total tokens"})]})]})]}),v.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-medium text-muted-foreground",children:[e.jsx(Me,{className:"h-3 w-3"}),"Models Used"]}),e.jsx("div",{className:"space-y-1",children:v.map(([D,L])=>{const K=Math.round(L/b*100),E=as(D);return e.jsxs("div",{className:"group",children:[e.jsxs("div",{className:"flex items-center justify-between text-[10px] mb-0.5",children:[e.jsx("span",{className:"truncate font-medium",title:D,children:E}),e.jsx("span",{className:"text-muted-foreground shrink-0 ml-2",children:L})]}),e.jsx("div",{className:"h-1 bg-muted/50 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-accent/70 rounded-full transition-all",style:{width:`${K}%`}})})]},D)})})]})]})})})]})}function J(s){return s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString()}function as(s){let t=s.replace(/^gemini-claude-/,"").replace(/^gemini-/,"").replace(/^claude-/,"").replace(/^anthropic\./,"").replace(/-thinking$/," Thinking");return t=t.split(/[-_]/).map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),t.length>20&&(t=t.slice(0,18)+"..."),t}const rs="/api";function w(s){const t=s.getFullYear(),a=String(s.getMonth()+1).padStart(2,"0"),d=String(s.getDate()).padStart(2,"0");return`${t}${a}${d}`}const T={summary:s=>{const t=new URLSearchParams;return s?.startDate&&t.append("since",w(s.startDate)),s?.endDate&&t.append("until",w(s.endDate)),s?.profile&&t.append("profile",s.profile),$(`/usage/summary?${t}`)},trends:s=>{const t=new URLSearchParams;return s?.startDate&&t.append("since",w(s.startDate)),s?.endDate&&t.append("until",w(s.endDate)),s?.profile&&t.append("profile",s.profile),$(`/usage/daily?${t}`)},hourly:s=>{const t=new URLSearchParams;return s?.startDate&&t.append("since",w(s.startDate)),s?.endDate&&t.append("until",w(s.endDate)),$(`/usage/hourly?${t}`)},models:s=>{const t=new URLSearchParams;return s?.startDate&&t.append("since",w(s.startDate)),s?.endDate&&t.append("until",w(s.endDate)),s?.profile&&t.append("profile",s.profile),$(`/usage/models?${t}`)},sessions:s=>{const t=new URLSearchParams;return s?.startDate&&t.append("since",w(s.startDate)),s?.endDate&&t.append("until",w(s.endDate)),s?.profile&&t.append("profile",s.profile),s?.limit&&t.append("limit",s.limit.toString()),s?.offset&&t.append("offset",s.offset.toString()),$(`/usage/sessions?${t}`)},monthly:(s,t)=>{const a=new URLSearchParams;return s&&a.append("months",s.toString()),t&&a.append("profile",t),$(`/usage/monthly?${a}`)},refresh:async()=>{if(!(await fetch(`${rs}/usage/refresh`,{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw new Error("Failed to refresh usage cache")},status:()=>$("/usage/status"),insights:s=>{const t=new URLSearchParams;return s?.startDate&&t.append("since",w(s.startDate)),s?.endDate&&t.append("until",w(s.endDate)),s?.profile&&t.append("profile",s.profile),$(`/usage/insights?${t}`)}};async function $(s){const a=await fetch(`/api${s}`,{headers:{"Content-Type":"application/json"}});if(!a.ok){const o=await a.json().catch(()=>({error:"Unknown error"}));throw new Error(o.error||a.statusText)}const d=await a.json();return d.data||d}function ns(s){return P({queryKey:["usage","summary",s],queryFn:()=>T.summary(s),staleTime:60*1e3})}function ls(s){return P({queryKey:["usage","trends",s],queryFn:()=>T.trends(s),staleTime:60*1e3})}function is(s){return P({queryKey:["usage","hourly",s],queryFn:()=>T.hourly(s),staleTime:60*1e3})}function os(s){return P({queryKey:["usage","models",s],queryFn:()=>T.models(s),staleTime:60*1e3})}function cs(){const s=Ge();return p.useCallback(async()=>{await T.refresh(),await s.invalidateQueries({queryKey:["usage"]})},[s])}function ds(){return P({queryKey:["usage","status"],queryFn:()=>T.status(),staleTime:10*1e3,refetchInterval:30*1e3})}function xs(s){return P({queryKey:["usage","sessions",s],queryFn:()=>T.sessions(s),staleTime:60*1e3})}function us(s){return s>=1e9?`${(s/1e9).toFixed(1)}B`:s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(0)}K`:s.toString()}function ks(){const{privacyMode:s}=R(),[t,a]=p.useState({from:F(new Date,30),to:new Date}),[d,o]=p.useState(!1),[c,n]=p.useState(null),[r,x]=p.useState(null),[u,f]=p.useState("daily"),h=p.useRef(null),S=cs(),v=async()=>{o(!0);try{await S()}finally{o(!1)}},b={startDate:t?.from,endDate:t?.to},{data:D,isLoading:L}=ns(b),{data:K,isLoading:E}=ls(b),{data:ce,isLoading:de}=is(b),{data:_,isLoading:z}=os(b),{data:xe,isLoading:ue}=xs({...b,limit:3}),{data:G}=ds(),me=p.useCallback(()=>{const l=new Date;a({from:F(l,1),to:l}),f("hourly")},[]),fe=p.useCallback(l=>{a(l),f("daily")},[]),Y=p.useMemo(()=>G?.lastFetch?H(new Date(G.lastFetch),{addSuffix:!0}):null,[G?.lastFetch]),he=p.useCallback((l,A)=>{const U=A.currentTarget.getBoundingClientRect();x({x:U.left+U.width/2,y:U.top+U.height/2}),n(l)},[]),pe=p.useCallback(()=>{n(null),x(null)},[]);return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden px-4 pt-4 pb-50 gap-4",children:[e.jsxs("div",{className:"flex items-center justify-between shrink-0",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-semibold",children:"Analytics"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Track usage & insights"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(O,{variant:u==="hourly"?"default":"outline",size:"sm",className:"h-8",onClick:me,children:"24H"}),e.jsx(He,{value:t,onChange:fe,presets:[{label:"7D",range:{from:F(new Date,7),to:new Date}},{label:"30D",range:{from:F(new Date,30),to:new Date}},{label:"Month",range:{from:ke(new Date),to:new Date}},{label:"All Time",range:{from:void 0,to:new Date}}]}),Y&&e.jsxs("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:["Updated ",Y]}),e.jsx(O,{variant:"outline",size:"sm",className:"gap-2 h-8",onClick:v,disabled:d,children:e.jsx(Re,{className:`w-3.5 h-3.5 ${d?"animate-spin":""}`})})]})]}),e.jsx(We,{data:D,isLoading:L}),e.jsxs("div",{className:"flex-1 flex flex-col min-h-0 gap-4",children:[e.jsxs(g,{className:"flex flex-col flex-1 min-h-0 max-h-[500px] overflow-hidden shadow-sm",children:[e.jsx(N,{className:"px-3 py-2 shrink-0",children:e.jsxs(C,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(Pe,{className:"w-4 h-4"}),u==="hourly"?"Last 24 Hours":"Usage Trends"]})}),e.jsx(j,{className:"px-3 pb-3 pt-0 flex-1 min-h-0",children:e.jsx(_e,{data:u==="hourly"?ce||[]:K||[],isLoading:u==="hourly"?de:E,granularity:u==="hourly"?"hourly":"daily"})})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-10 gap-4 h-auto lg:h-[180px] shrink-0",children:[e.jsxs(g,{className:"flex flex-col h-full min-h-0 shadow-sm lg:col-span-4",children:[e.jsx(N,{className:"px-3 py-2",children:e.jsxs(C,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(ae,{className:"w-4 h-4"}),"Cost by Model"]})}),e.jsx(j,{className:"px-2 pb-2 pt-0 flex-1 min-h-0 overflow-y-auto",children:z?e.jsx(m,{className:"h-full w-full"}):e.jsxs("div",{className:"space-y-0.5",children:[[..._||[]].sort((l,A)=>A.cost-l.cost).map(l=>e.jsxs("button",{className:"group flex items-center text-xs w-full hover:bg-muted/50 rounded px-2 py-1.5 transition-colors cursor-pointer gap-3",onClick:A=>he(l,A),title:"Click for details",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 w-[180px] shrink-0",children:[e.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:te(l.model)}}),e.jsx("span",{className:"font-medium truncate group-hover:underline underline-offset-2",children:l.model})]}),e.jsx("div",{className:"flex-1 flex items-center gap-1 min-w-0",children:e.jsxs("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden flex",children:[e.jsx("div",{className:"h-full",style:{backgroundColor:"#335c67",width:`${l.cost>0?l.costBreakdown.input.cost/l.cost*100:0}%`},title:`Input: $${l.costBreakdown.input.cost.toFixed(2)}`}),e.jsx("div",{className:"h-full",style:{backgroundColor:"#fff3b0",width:`${l.cost>0?l.costBreakdown.output.cost/l.cost*100:0}%`},title:`Output: $${l.costBreakdown.output.cost.toFixed(2)}`}),e.jsx("div",{className:"h-full",style:{backgroundColor:"#e09f3e",width:`${l.cost>0?l.costBreakdown.cacheCreation.cost/l.cost*100:0}%`},title:`Cache Write: $${l.costBreakdown.cacheCreation.cost.toFixed(2)}`}),e.jsx("div",{className:"h-full",style:{backgroundColor:"#9e2a2b",width:`${l.cost>0?l.costBreakdown.cacheRead.cost/l.cost*100:0}%`},title:`Cache Read: $${l.costBreakdown.cacheRead.cost.toFixed(2)}`})]})}),e.jsx("span",{className:i("text-[10px] text-muted-foreground w-14 text-right shrink-0",s&&y),children:us(l.tokens)}),e.jsxs("span",{className:i("font-mono font-medium w-16 text-right shrink-0",s&&y),children:["$",l.cost.toFixed(2)]}),e.jsx(Ae,{className:"w-3 h-3 opacity-0 group-hover:opacity-50 transition-opacity shrink-0"})]},l.model)),e.jsxs("div",{className:"flex items-center gap-3 pt-2 px-2 text-[10px] text-muted-foreground border-t mt-2",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:"#335c67"}}),"Input"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-2 h-2 rounded-full border border-muted-foreground/30",style:{backgroundColor:"#fff3b0"}}),"Output"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:"#e09f3e"}}),"Cache Write"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:"#9e2a2b"}}),"Cache Read"]})]})]})})]}),e.jsxs(g,{className:"flex flex-col h-full min-h-0 shadow-sm lg:col-span-2",children:[e.jsx(N,{className:"px-3 py-2",children:e.jsxs(C,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(Be,{className:"w-4 h-4"}),"Model Usage"]})}),e.jsx(j,{className:"px-2 pb-2 pt-0 flex-1 min-h-0 flex items-center justify-center",children:e.jsx(Ye,{data:_||[],isLoading:z,className:"h-full w-full"})})]}),e.jsx(es,{data:xe,isLoading:ue,className:"lg:col-span-2"}),e.jsx(ts,{isLoading:L,className:"lg:col-span-2"})]}),e.jsxs(ee,{open:!!c,onOpenChange:l=>!l&&pe(),children:[e.jsx(ve,{asChild:!0,children:e.jsx("div",{ref:h,className:"fixed pointer-events-none",style:{left:r?.x??0,top:r?.y??0,width:1,height:1}})}),e.jsx(se,{className:"w-80 p-3",side:"top",align:"center",children:c&&e.jsx(Ve,{model:c})})]})]})]})}function Cs(){return e.jsxs("div",{className:"space-y-4 h-full overflow-hidden",children:[e.jsxs(g,{className:"flex flex-col min-h-[300px]",children:[e.jsx(N,{className:"p-4 pb-2",children:e.jsx(m,{className:"h-4 w-32"})}),e.jsx(j,{className:"p-4 pt-0 flex-1",children:e.jsx(m,{className:"h-full w-full"})})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsxs(g,{className:"flex flex-col min-h-[250px]",children:[e.jsx(N,{className:"p-4 pb-2",children:e.jsx(m,{className:"h-4 w-28"})}),e.jsx(j,{className:"p-4 pt-2",children:e.jsx("div",{className:"space-y-3",children:[1,2,3,4,5].map(s=>e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(m,{className:"w-2.5 h-2.5 rounded-full"}),e.jsx(m,{className:"h-3 w-24"})]}),e.jsx(m,{className:"h-3 w-16"})]},s))})})]}),e.jsxs(g,{className:"flex flex-col min-h-[250px]",children:[e.jsx(N,{className:"p-4 pb-2",children:e.jsx(m,{className:"h-4 w-28"})}),e.jsx(j,{className:"p-4 pt-0 flex-1",children:e.jsxs("div",{className:"flex w-full h-full items-center",children:[e.jsx("div",{className:"flex-1 flex justify-center",children:e.jsx(m,{className:"h-[180px] w-[180px] rounded-full"})}),e.jsx("div",{className:"w-[140px] shrink-0 pl-2 space-y-2",children:[1,2,3,4].map(s=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(m,{className:"w-2 h-2 rounded-full"}),e.jsx(m,{className:"h-3 w-20"})]},s))})]})})]})]})]})}export{ks as AnalyticsPage,Cs as AnalyticsSkeleton};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-DFHQr9A5.js";import{r}from"./react-vendor-FspHSO0w.js";import{k as S,l as A,B as i,I,i as D,m as L,n as M,o as z,c as E,p as R,q as B,e as j}from"./index-
|
|
1
|
+
import{j as e}from"./radix-ui-DFHQr9A5.js";import{r}from"./react-vendor-FspHSO0w.js";import{k as S,l as A,B as i,I,i as D,m as L,n as M,o as z,c as E,p as R,q as B,e as j}from"./index-c9idYjfn.js";import{a6 as O,V as N,ab as F,ac as y,J as T,ad as U,l as C,N as Q,z as q,D as H}from"./icons-U_6eBV_J.js";import"./tanstack-C4gT2P7V.js";import"./notifications-B2Pz7lik.js";import"./utils-CzKF5WmX.js";import"./form-utils-BuXDJb0w.js";import"./code-highlight-BoHWVYut.js";function se(){const{data:a,isLoading:d,isError:x,refetch:u}=S(),h=A(),[l,p]=r.useState(null),[c,b]=r.useState(""),[w,n]=r.useState(!1),[o,m]=r.useState(null),t=r.useMemo(()=>a?.profiles||[],[a?.profiles]),g=r.useMemo(()=>t.filter(s=>s.name.toLowerCase().includes(c.toLowerCase())),[t,c]),v=r.useMemo(()=>l&&t.some(s=>s.name===l)?l:t.length>0?t[0].name:null,[l,t]),P=s=>{h.mutate(s,{onSuccess:()=>{l===s&&p(null),m(null)}})},k=s=>{n(!1),p(s)},f=t.find(s=>s.name===v);return e.jsxs("div",{className:"h-[calc(100vh-100px)] flex",children:[e.jsxs("div",{className:"w-80 border-r flex flex-col bg-muted/30",children:[e.jsxs("div",{className:"p-4 border-b bg-background",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(O,{className:"w-5 h-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:"API Profiles"})]}),e.jsxs(i,{size:"sm",onClick:()=>{n(!0)},children:[e.jsx(N,{className:"w-4 h-4 mr-1"}),"New"]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(F,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(I,{placeholder:"Search profiles...",className:"pl-8 h-9",value:c,onChange:s=>b(s.target.value)})]})]}),e.jsx(D,{className:"flex-1",children:d?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"Loading profiles..."}):x?e.jsx("div",{className:"p-4 text-center",children:e.jsxs("div",{className:"space-y-3 py-8",children:[e.jsx(y,{className:"w-12 h-12 mx-auto text-destructive/50"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Failed to load profiles"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Unable to fetch API profiles. Please try again."})]}),e.jsxs(i,{size:"sm",variant:"outline",onClick:()=>u(),children:[e.jsx(T,{className:"w-4 h-4 mr-1"}),"Retry"]})]})}):g.length===0?e.jsx("div",{className:"p-4 text-center",children:t.length===0?e.jsxs("div",{className:"space-y-3 py-8",children:[e.jsx(U,{className:"w-12 h-12 mx-auto text-muted-foreground/50"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"No API profiles yet"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Create your first profile to connect to custom API endpoints"})]}),e.jsxs(i,{size:"sm",variant:"outline",onClick:()=>{n(!0)},children:[e.jsx(N,{className:"w-4 h-4 mr-1"}),"Create Profile"]})]}):e.jsxs("p",{className:"text-sm text-muted-foreground py-4",children:['No profiles match "',c,'"']})}):e.jsx("div",{className:"p-2 space-y-1",children:g.map(s=>e.jsx(J,{profile:s,isSelected:v===s.name,onSelect:()=>{p(s.name)},onDelete:()=>m(s.name)},s.name))})}),t.length>0&&e.jsx("div",{className:"p-3 border-t bg-background text-xs text-muted-foreground",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{children:[t.length," profile",t.length!==1?"s":""]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(C,{className:"w-3 h-3 text-green-600"}),t.filter(s=>s.configured).length," configured"]})]})})]}),e.jsx("div",{className:"flex-1 flex flex-col min-w-0",children:f?e.jsx(L,{profileName:f.name,onDelete:()=>m(f.name)}):e.jsx(V,{onCreateClick:()=>{n(!0)}})}),e.jsx(M,{open:w,onOpenChange:n,onSuccess:k}),e.jsx(z,{open:!!o,title:"Delete Profile",description:`Are you sure you want to delete "${o}"? This will remove the settings file and cannot be undone.`,confirmText:"Delete",variant:"destructive",onConfirm:()=>o&&P(o),onCancel:()=>m(null)})]})}function J({profile:a,isSelected:d,onSelect:x,onDelete:u}){return e.jsxs("div",{className:E("group flex items-center gap-2 px-3 py-2.5 rounded-md cursor-pointer transition-colors",d?"bg-primary/10 border border-primary/20":"hover:bg-muted border border-transparent"),onClick:x,children:[a.configured?e.jsx(C,{className:"w-4 h-4 text-green-600 shrink-0"}):e.jsx(y,{className:"w-4 h-4 text-yellow-600 shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium text-sm truncate",children:a.name}),e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("div",{className:"text-xs text-muted-foreground truncate flex-1",children:a.settingsPath}),e.jsx(R,{value:a.settingsPath,size:"icon",className:"h-5 w-5 opacity-0 group-hover:opacity-100 transition-opacity"})]})]}),e.jsx(i,{variant:"ghost",size:"icon",className:"h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity",onClick:h=>{h.stopPropagation(),u()},children:e.jsx(Q,{className:"w-3.5 h-3.5 text-destructive"})})]})}function V({onCreateClick:a}){return e.jsx("div",{className:"flex-1 flex items-center justify-center bg-muted/20",children:e.jsxs("div",{className:"text-center max-w-md px-8",children:[e.jsx(q,{className:"w-16 h-16 mx-auto text-muted-foreground/30 mb-6"}),e.jsx("h2",{className:"text-xl font-semibold mb-2",children:"API Profile Manager"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Configure custom API endpoints for Claude CLI. Connect to proxy services like copilot-api, OpenRouter, or your own API backend."}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs(i,{onClick:a,className:"w-full",children:[e.jsx(N,{className:"w-4 h-4 mr-2"}),"Create Your First Profile"]}),e.jsx(B,{className:"my-4"}),e.jsxs("div",{className:"text-left space-y-2",children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"What you can configure:"}),e.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1.5",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(j,{variant:"outline",className:"text-xs shrink-0 mt-0.5",children:"URL"}),e.jsx("span",{children:"Custom API base URL endpoint"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(j,{variant:"outline",className:"text-xs shrink-0 mt-0.5",children:"Auth"}),e.jsx("span",{children:"API key or authentication token"})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(j,{variant:"outline",className:"text-xs shrink-0 mt-0.5",children:"Models"}),e.jsx("span",{children:"Model mapping for Opus/Sonnet/Haiku"})]})]})]}),e.jsx("div",{className:"pt-4",children:e.jsxs("a",{href:"https://github.com/kaitranntt/ccs#api-profiles",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-xs text-primary hover:underline",children:["Learn more about API profiles",e.jsx(H,{className:"w-3 h-3 ml-1"})]})})]})]})})}export{se as ApiPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./radix-ui-DFHQr9A5.js";import"./react-vendor-FspHSO0w.js";import{c as o}from"./index-
|
|
1
|
+
import{j as t}from"./radix-ui-DFHQr9A5.js";import"./react-vendor-FspHSO0w.js";import{c as o}from"./index-c9idYjfn.js";function n({className:a,...r}){return t.jsx("div",{"data-slot":"card",className:o("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",a),...r})}function c({className:a,...r}){return t.jsx("div",{"data-slot":"card-header",className:o("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",a),...r})}function i({className:a,...r}){return t.jsx("div",{"data-slot":"card-title",className:o("leading-none font-semibold",a),...r})}function l({className:a,...r}){return t.jsx("div",{"data-slot":"card-content",className:o("px-6",a),...r})}export{n as C,l as a,c as b,i as c};
|
package/dist/ui/assets/{cliproxy-control-panel-DPdlwOom.js → cliproxy-control-panel-BzhsXWKa.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-DFHQr9A5.js";import{r as s}from"./react-vendor-FspHSO0w.js";import{G as b,J as d,ac as g,K as j,X as p}from"./icons-
|
|
1
|
+
import{j as e}from"./radix-ui-DFHQr9A5.js";import{r as s}from"./react-vendor-FspHSO0w.js";import{G as b,J as d,ac as g,K as j,X as p}from"./icons-U_6eBV_J.js";const N=8317,C="ccs";function y({port:t=N}){const n=s.useRef(null),[r,c]=s.useState(!0),[o,a]=s.useState(null),[x,l]=s.useState(!1),[m,u]=s.useState(!0),i=`http://localhost:${t}/management.html`;s.useEffect(()=>{(async()=>{try{(await fetch(`http://localhost:${t}/`,{signal:AbortSignal.timeout(2e3)})).ok?(l(!0),a(null)):(l(!1),a("CLIProxy returned an error"))}catch{l(!1),a("CLIProxy is not running")}})()},[t]);const h=s.useCallback(()=>{if(c(!1),n.current?.contentWindow)try{n.current.contentWindow.postMessage({type:"ccs-auto-login",apiBase:`http://localhost:${t}`,managementKey:C},`http://localhost:${t}`)}catch{console.debug("[ControlPanelEmbed] postMessage failed - cross-origin")}},[t]),f=()=>{c(!0),n.current&&(n.current.src=i)};return!x&&o?e.jsxs("div",{className:"flex-1 flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{className:"w-5 h-5 text-primary"}),e.jsx("h2",{className:"font-semibold",children:"CLIProxy Control Panel"})]}),e.jsxs("button",{className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm border rounded-md hover:bg-muted",onClick:f,children:[e.jsx(d,{className:"w-4 h-4"}),"Retry"]})]}),e.jsx("div",{className:"flex-1 flex items-center justify-center bg-muted/20",children:e.jsxs("div",{className:"text-center max-w-md px-8",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-destructive/10 flex items-center justify-center mx-auto mb-6",children:e.jsx(g,{className:"w-8 h-8 text-destructive"})}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"CLIProxy Not Available"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:o}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Start a CLIProxy session with"," ",e.jsx("code",{className:"bg-muted px-1 rounded",children:"ccs gemini"})," or run"," ",e.jsx("code",{className:"bg-muted px-1 rounded",children:"ccs config"})," which auto-starts it."]})]})})]}):e.jsxs("div",{className:"flex-1 flex flex-col relative",children:[m&&!r&&e.jsx("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-20",children:e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-blue-50 dark:bg-blue-950 border border-blue-200 dark:border-blue-800 rounded-md text-sm",children:[e.jsx(j,{className:"h-3.5 w-3.5 text-blue-600"}),e.jsxs("span",{children:["Key:"," ",e.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded font-mono font-semibold",children:"ccs"})]}),e.jsx("button",{className:"text-blue-600 hover:text-blue-800 dark:hover:text-blue-400",onClick:()=>u(!1),children:e.jsx(p,{className:"h-3.5 w-3.5"})})]})}),r&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/80 z-10",children:e.jsxs("div",{className:"text-center",children:[e.jsx(d,{className:"w-8 h-8 animate-spin text-primary mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading Control Panel..."})]})}),e.jsx("iframe",{ref:n,src:i,className:"flex-1 w-full border-0",title:"CLIProxy Management Panel",onLoad:h})]})}function E(){return e.jsx("div",{className:"h-[calc(100vh-100px)] flex flex-col",children:e.jsx(y,{})})}export{E as CliproxyControlPanelPage};
|