usage-board 3.1.2 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +25 -264
- package/dist/public/_nuxt/builds/latest.json +1 -1
- package/dist/public/_nuxt/builds/meta/ae3c6372-8821-43fb-aa55-bb47729a5660.json +1 -0
- package/dist/server/chunks/nitro/nitro.mjs +64 -64
- package/dist/server/chunks/routes/api/analysis/agent/session.json.mjs +1 -1
- package/dist/server/chunks/routes/api/analysis/agent/token.json.mjs +1 -1
- package/dist/server/chunks/routes/api/analysis/cache.json.mjs +1 -1
- package/dist/server/chunks/routes/api/analysis/hot-project.json.mjs +1 -1
- package/dist/server/chunks/routes/api/analysis/model.json.mjs +1 -1
- package/dist/server/chunks/routes/api/analysis/overview-cards.json.mjs +1 -1
- package/dist/server/chunks/routes/api/analysis/session.json.mjs +1 -1
- package/dist/server/chunks/routes/api/analysis/token/daily.json.mjs +1 -1
- package/dist/server/chunks/routes/api/analysis/token.json.mjs +1 -1
- package/dist/server/chunks/routes/api/payload.json.mjs +1 -1
- package/dist/server/chunks/routes/api/projects/_project/modules.get.mjs +1 -1
- package/dist/server/chunks/routes/api/projects/catalog.get.mjs +1 -1
- package/dist/server/chunks/routes/renderer.mjs +1 -1
- package/dist/server/chunks/routes/ws.mjs +1 -1
- package/dist/server/index.mjs +1 -1
- package/dist/server/package.json +1 -4
- package/package.json +8 -6
- package/dist/public/_nuxt/builds/meta/97934cfc-fbd7-4ac5-ab89-aefedca0767f.json +0 -1
- package/dist/server/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
- package/dist/server/node_modules/better-sqlite3/lib/database.js +0 -90
- package/dist/server/node_modules/better-sqlite3/lib/index.js +0 -3
- package/dist/server/node_modules/better-sqlite3/lib/methods/aggregate.js +0 -43
- package/dist/server/node_modules/better-sqlite3/lib/methods/backup.js +0 -67
- package/dist/server/node_modules/better-sqlite3/lib/methods/function.js +0 -31
- package/dist/server/node_modules/better-sqlite3/lib/methods/inspect.js +0 -7
- package/dist/server/node_modules/better-sqlite3/lib/methods/pragma.js +0 -12
- package/dist/server/node_modules/better-sqlite3/lib/methods/serialize.js +0 -16
- package/dist/server/node_modules/better-sqlite3/lib/methods/table.js +0 -189
- package/dist/server/node_modules/better-sqlite3/lib/methods/transaction.js +0 -78
- package/dist/server/node_modules/better-sqlite3/lib/methods/wrappers.js +0 -54
- package/dist/server/node_modules/better-sqlite3/lib/sqlite-error.js +0 -20
- package/dist/server/node_modules/better-sqlite3/lib/util.js +0 -12
- package/dist/server/node_modules/better-sqlite3/package.json +0 -59
- package/dist/server/node_modules/bindings/bindings.js +0 -221
- package/dist/server/node_modules/bindings/package.json +0 -28
- package/dist/server/node_modules/file-uri-to-path/index.js +0 -66
- package/dist/server/node_modules/file-uri-to-path/package.json +0 -32
package/dist/index.mjs
CHANGED
|
@@ -1,231 +1,14 @@
|
|
|
1
|
-
import { createServer } from "node:http";
|
|
2
1
|
import path, { dirname, resolve } from "node:path";
|
|
3
|
-
import { fileURLToPath
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
4
3
|
import cac from "cac";
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import fs, { constants } from "node:fs/promises";
|
|
8
|
-
import process$1 from "node:process";
|
|
4
|
+
import { createRuntimeServer } from "nuxt-devkit-server";
|
|
5
|
+
import process from "node:process";
|
|
9
6
|
import childProcess, { execFile } from "node:child_process";
|
|
7
|
+
import fs, { constants } from "node:fs/promises";
|
|
10
8
|
import { promisify } from "node:util";
|
|
9
|
+
import os from "node:os";
|
|
11
10
|
import fs$1 from "node:fs";
|
|
12
11
|
import { Buffer } from "node:buffer";
|
|
13
|
-
//#region node_modules/.pnpm/get-port-please@3.2.0/node_modules/get-port-please/dist/index.mjs
|
|
14
|
-
const unsafePorts = /* @__PURE__ */ new Set([
|
|
15
|
-
1,
|
|
16
|
-
7,
|
|
17
|
-
9,
|
|
18
|
-
11,
|
|
19
|
-
13,
|
|
20
|
-
15,
|
|
21
|
-
17,
|
|
22
|
-
19,
|
|
23
|
-
20,
|
|
24
|
-
21,
|
|
25
|
-
22,
|
|
26
|
-
23,
|
|
27
|
-
25,
|
|
28
|
-
37,
|
|
29
|
-
42,
|
|
30
|
-
43,
|
|
31
|
-
53,
|
|
32
|
-
69,
|
|
33
|
-
77,
|
|
34
|
-
79,
|
|
35
|
-
87,
|
|
36
|
-
95,
|
|
37
|
-
101,
|
|
38
|
-
102,
|
|
39
|
-
103,
|
|
40
|
-
104,
|
|
41
|
-
109,
|
|
42
|
-
110,
|
|
43
|
-
111,
|
|
44
|
-
113,
|
|
45
|
-
115,
|
|
46
|
-
117,
|
|
47
|
-
119,
|
|
48
|
-
123,
|
|
49
|
-
135,
|
|
50
|
-
137,
|
|
51
|
-
139,
|
|
52
|
-
143,
|
|
53
|
-
161,
|
|
54
|
-
179,
|
|
55
|
-
389,
|
|
56
|
-
427,
|
|
57
|
-
465,
|
|
58
|
-
512,
|
|
59
|
-
513,
|
|
60
|
-
514,
|
|
61
|
-
515,
|
|
62
|
-
526,
|
|
63
|
-
530,
|
|
64
|
-
531,
|
|
65
|
-
532,
|
|
66
|
-
540,
|
|
67
|
-
548,
|
|
68
|
-
554,
|
|
69
|
-
556,
|
|
70
|
-
563,
|
|
71
|
-
587,
|
|
72
|
-
601,
|
|
73
|
-
636,
|
|
74
|
-
989,
|
|
75
|
-
990,
|
|
76
|
-
993,
|
|
77
|
-
995,
|
|
78
|
-
1719,
|
|
79
|
-
1720,
|
|
80
|
-
1723,
|
|
81
|
-
2049,
|
|
82
|
-
3659,
|
|
83
|
-
4045,
|
|
84
|
-
5060,
|
|
85
|
-
5061,
|
|
86
|
-
6e3,
|
|
87
|
-
6566,
|
|
88
|
-
6665,
|
|
89
|
-
6666,
|
|
90
|
-
6667,
|
|
91
|
-
6668,
|
|
92
|
-
6669,
|
|
93
|
-
6697,
|
|
94
|
-
10080
|
|
95
|
-
]);
|
|
96
|
-
function isUnsafePort(port) {
|
|
97
|
-
return unsafePorts.has(port);
|
|
98
|
-
}
|
|
99
|
-
function isSafePort(port) {
|
|
100
|
-
return !isUnsafePort(port);
|
|
101
|
-
}
|
|
102
|
-
var GetPortError = class extends Error {
|
|
103
|
-
constructor(message, opts) {
|
|
104
|
-
super(message, opts);
|
|
105
|
-
this.message = message;
|
|
106
|
-
}
|
|
107
|
-
name = "GetPortError";
|
|
108
|
-
};
|
|
109
|
-
function _log(verbose, message) {
|
|
110
|
-
if (verbose) console.log(`[get-port] ${message}`);
|
|
111
|
-
}
|
|
112
|
-
function _generateRange(from, to) {
|
|
113
|
-
if (to < from) return [];
|
|
114
|
-
const r = [];
|
|
115
|
-
for (let index = from; index <= to; index++) r.push(index);
|
|
116
|
-
return r;
|
|
117
|
-
}
|
|
118
|
-
function _tryPort(port, host) {
|
|
119
|
-
return new Promise((resolve) => {
|
|
120
|
-
const server = createServer$1();
|
|
121
|
-
server.unref();
|
|
122
|
-
server.on("error", () => {
|
|
123
|
-
resolve(false);
|
|
124
|
-
});
|
|
125
|
-
server.listen({
|
|
126
|
-
port,
|
|
127
|
-
host
|
|
128
|
-
}, () => {
|
|
129
|
-
const { port: port2 } = server.address();
|
|
130
|
-
server.close(() => {
|
|
131
|
-
resolve(isSafePort(port2) && port2);
|
|
132
|
-
});
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
function _getLocalHosts(additional) {
|
|
137
|
-
const hosts = new Set(additional);
|
|
138
|
-
for (const _interface of Object.values(networkInterfaces())) for (const config of _interface || []) if (config.address && !config.internal && !config.address.startsWith("fe80::") && !config.address.startsWith("169.254")) hosts.add(config.address);
|
|
139
|
-
return [...hosts];
|
|
140
|
-
}
|
|
141
|
-
async function _findPort(ports, host) {
|
|
142
|
-
for (const port of ports) {
|
|
143
|
-
const r = await _tryPort(port, host);
|
|
144
|
-
if (r) return r;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
function _fmtOnHost(hostname) {
|
|
148
|
-
return hostname ? `on host ${JSON.stringify(hostname)}` : "on any host";
|
|
149
|
-
}
|
|
150
|
-
const HOSTNAME_RE = /^(?!-)[\d.:A-Za-z-]{1,63}(?<!-)$/;
|
|
151
|
-
function _validateHostname(hostname, _public, verbose) {
|
|
152
|
-
if (hostname && !HOSTNAME_RE.test(hostname)) {
|
|
153
|
-
const fallbackHost = _public ? "0.0.0.0" : "127.0.0.1";
|
|
154
|
-
_log(verbose, `Invalid hostname: ${JSON.stringify(hostname)}. Using ${JSON.stringify(fallbackHost)} as fallback.`);
|
|
155
|
-
return fallbackHost;
|
|
156
|
-
}
|
|
157
|
-
return hostname;
|
|
158
|
-
}
|
|
159
|
-
async function getPort(_userOptions = {}) {
|
|
160
|
-
if (typeof _userOptions === "number" || typeof _userOptions === "string") _userOptions = { port: Number.parseInt(_userOptions + "") || 0 };
|
|
161
|
-
const _port = Number(_userOptions.port ?? process.env.PORT);
|
|
162
|
-
const _userSpecifiedAnyPort = Boolean(_userOptions.port || _userOptions.ports?.length || _userOptions.portRange?.length);
|
|
163
|
-
const options = {
|
|
164
|
-
random: _port === 0,
|
|
165
|
-
ports: [],
|
|
166
|
-
portRange: [],
|
|
167
|
-
alternativePortRange: _userSpecifiedAnyPort ? [] : [3e3, 3100],
|
|
168
|
-
verbose: false,
|
|
169
|
-
..._userOptions,
|
|
170
|
-
port: _port,
|
|
171
|
-
host: _validateHostname(_userOptions.host ?? process.env.HOST, _userOptions.public, _userOptions.verbose)
|
|
172
|
-
};
|
|
173
|
-
if (options.random && !_userSpecifiedAnyPort) return getRandomPort(options.host);
|
|
174
|
-
const portsToCheck = [
|
|
175
|
-
options.port,
|
|
176
|
-
...options.ports,
|
|
177
|
-
..._generateRange(...options.portRange)
|
|
178
|
-
].filter((port) => {
|
|
179
|
-
if (!port) return false;
|
|
180
|
-
if (!isSafePort(port)) {
|
|
181
|
-
_log(options.verbose, `Ignoring unsafe port: ${port}`);
|
|
182
|
-
return false;
|
|
183
|
-
}
|
|
184
|
-
return true;
|
|
185
|
-
});
|
|
186
|
-
if (portsToCheck.length === 0) portsToCheck.push(3e3);
|
|
187
|
-
let availablePort = await _findPort(portsToCheck, options.host);
|
|
188
|
-
if (!availablePort && options.alternativePortRange.length > 0) {
|
|
189
|
-
availablePort = await _findPort(_generateRange(...options.alternativePortRange), options.host);
|
|
190
|
-
if (portsToCheck.length > 0) {
|
|
191
|
-
let message = `Unable to find an available port (tried ${portsToCheck.join("-")} ${_fmtOnHost(options.host)}).`;
|
|
192
|
-
if (availablePort) message += ` Using alternative port ${availablePort}.`;
|
|
193
|
-
_log(options.verbose, message);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
if (!availablePort && _userOptions.random !== false) {
|
|
197
|
-
availablePort = await getRandomPort(options.host);
|
|
198
|
-
if (availablePort) _log(options.verbose, `Using random port ${availablePort}`);
|
|
199
|
-
}
|
|
200
|
-
if (!availablePort) {
|
|
201
|
-
const triedRanges = [
|
|
202
|
-
options.port,
|
|
203
|
-
options.portRange.join("-"),
|
|
204
|
-
options.alternativePortRange.join("-")
|
|
205
|
-
].filter(Boolean).join(", ");
|
|
206
|
-
throw new GetPortError(`Unable to find an available port ${_fmtOnHost(options.host)} (tried ${triedRanges})`);
|
|
207
|
-
}
|
|
208
|
-
return availablePort;
|
|
209
|
-
}
|
|
210
|
-
async function getRandomPort(host) {
|
|
211
|
-
const port = await checkPort(0, host);
|
|
212
|
-
if (port === false) throw new GetPortError(`Unable to find a random port ${_fmtOnHost(host)}`);
|
|
213
|
-
return port;
|
|
214
|
-
}
|
|
215
|
-
async function checkPort(port, host = process.env.HOST, verbose) {
|
|
216
|
-
if (!host) host = _getLocalHosts([void 0, "0.0.0.0"]);
|
|
217
|
-
if (!Array.isArray(host)) return _tryPort(port, host);
|
|
218
|
-
for (const _host of host) {
|
|
219
|
-
const _port = await _tryPort(port, _host);
|
|
220
|
-
if (_port === false) {
|
|
221
|
-
if (port < 1024 && verbose) _log(verbose, `Unable to listen to the privileged port ${port} ${_fmtOnHost(_host)}`);
|
|
222
|
-
return false;
|
|
223
|
-
}
|
|
224
|
-
if (port === 0 && _port !== 0) port = _port;
|
|
225
|
-
}
|
|
226
|
-
return port;
|
|
227
|
-
}
|
|
228
|
-
//#endregion
|
|
229
12
|
//#region node_modules/.pnpm/is-docker@3.0.0/node_modules/is-docker/index.js
|
|
230
13
|
let isDockerCached;
|
|
231
14
|
function hasDockerEnv() {
|
|
@@ -265,7 +48,7 @@ function isInsideContainer() {
|
|
|
265
48
|
//#endregion
|
|
266
49
|
//#region node_modules/.pnpm/is-wsl@3.1.1/node_modules/is-wsl/index.js
|
|
267
50
|
const isWsl = () => {
|
|
268
|
-
if (process
|
|
51
|
+
if (process.platform !== "linux") return false;
|
|
269
52
|
if (os.release().toLowerCase().includes("microsoft")) {
|
|
270
53
|
if (isInsideContainer()) return false;
|
|
271
54
|
return true;
|
|
@@ -276,11 +59,11 @@ const isWsl = () => {
|
|
|
276
59
|
if (fs$1.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop") || fs$1.existsSync("/run/WSL")) return !isInsideContainer();
|
|
277
60
|
return false;
|
|
278
61
|
};
|
|
279
|
-
var is_wsl_default = process
|
|
62
|
+
var is_wsl_default = process.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
280
63
|
//#endregion
|
|
281
64
|
//#region node_modules/.pnpm/powershell-utils@0.1.0/node_modules/powershell-utils/index.js
|
|
282
65
|
const execFile$2 = promisify(childProcess.execFile);
|
|
283
|
-
const powerShellPath$1 = () => `${process
|
|
66
|
+
const powerShellPath$1 = () => `${process.env.SYSTEMROOT || process.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
284
67
|
const executePowerShell = async (command, options = {}) => {
|
|
285
68
|
const { powerShellPath: psPath, ...execFileOptions } = options;
|
|
286
69
|
const encodedCommand = executePowerShell.encodeCommand(command);
|
|
@@ -387,7 +170,7 @@ function defineLazyProperty(object, propertyName, valueGetter) {
|
|
|
387
170
|
//#region node_modules/.pnpm/default-browser-id@5.0.1/node_modules/default-browser-id/index.js
|
|
388
171
|
const execFileAsync$3 = promisify(execFile);
|
|
389
172
|
async function defaultBrowserId() {
|
|
390
|
-
if (process
|
|
173
|
+
if (process.platform !== "darwin") throw new Error("macOS only");
|
|
391
174
|
const { stdout } = await execFileAsync$3("defaults", [
|
|
392
175
|
"read",
|
|
393
176
|
"com.apple.LaunchServices/com.apple.launchservices.secure",
|
|
@@ -401,7 +184,7 @@ async function defaultBrowserId() {
|
|
|
401
184
|
//#region node_modules/.pnpm/run-applescript@7.1.0/node_modules/run-applescript/index.js
|
|
402
185
|
const execFileAsync$2 = promisify(execFile);
|
|
403
186
|
async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
|
|
404
|
-
if (process
|
|
187
|
+
if (process.platform !== "darwin") throw new Error("macOS only");
|
|
405
188
|
const outputArguments = humanReadableOutput ? [] : ["-ss"];
|
|
406
189
|
const execOptions = {};
|
|
407
190
|
if (signal) execOptions.signal = signal;
|
|
@@ -512,14 +295,14 @@ async function defaultBrowser$1(_execFileAsync = execFileAsync$1) {
|
|
|
512
295
|
const execFileAsync = promisify(execFile);
|
|
513
296
|
const titleize = (string) => string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x) => x.toUpperCase());
|
|
514
297
|
async function defaultBrowser() {
|
|
515
|
-
if (process
|
|
298
|
+
if (process.platform === "darwin") {
|
|
516
299
|
const id = await defaultBrowserId();
|
|
517
300
|
return {
|
|
518
301
|
name: await bundleName(id),
|
|
519
302
|
id
|
|
520
303
|
};
|
|
521
304
|
}
|
|
522
|
-
if (process
|
|
305
|
+
if (process.platform === "linux") {
|
|
523
306
|
const { stdout } = await execFileAsync("xdg-mime", [
|
|
524
307
|
"query",
|
|
525
308
|
"default",
|
|
@@ -531,18 +314,18 @@ async function defaultBrowser() {
|
|
|
531
314
|
id
|
|
532
315
|
};
|
|
533
316
|
}
|
|
534
|
-
if (process
|
|
317
|
+
if (process.platform === "win32") return defaultBrowser$1();
|
|
535
318
|
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
536
319
|
}
|
|
537
320
|
//#endregion
|
|
538
321
|
//#region node_modules/.pnpm/is-in-ssh@1.0.0/node_modules/is-in-ssh/index.js
|
|
539
|
-
const isInSsh = Boolean(process
|
|
322
|
+
const isInSsh = Boolean(process.env.SSH_CONNECTION || process.env.SSH_CLIENT || process.env.SSH_TTY);
|
|
540
323
|
//#endregion
|
|
541
324
|
//#region node_modules/.pnpm/open@11.0.0/node_modules/open/index.js
|
|
542
325
|
const fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
543
326
|
const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
|
|
544
327
|
const localXdgOpenPath = path.join(__dirname, "xdg-open");
|
|
545
|
-
const { platform, arch } = process
|
|
328
|
+
const { platform, arch } = process;
|
|
546
329
|
const tryEachApp = async (apps, opener) => {
|
|
547
330
|
if (apps.length === 0) return;
|
|
548
331
|
const errors = [];
|
|
@@ -655,7 +438,7 @@ const baseOpen = async (options) => {
|
|
|
655
438
|
await fs.access(localXdgOpenPath, constants.X_OK);
|
|
656
439
|
exeLocalXdgOpen = true;
|
|
657
440
|
} catch {}
|
|
658
|
-
command = process
|
|
441
|
+
command = process.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
|
|
659
442
|
}
|
|
660
443
|
if (appArguments.length > 0) cliArguments.push(...appArguments);
|
|
661
444
|
if (!options.wait) {
|
|
@@ -756,42 +539,20 @@ defineLazyProperty(apps, "safari", () => detectPlatformBinary({ darwin: "Safari"
|
|
|
756
539
|
//#endregion
|
|
757
540
|
//#region package.json
|
|
758
541
|
var name = "usage-board";
|
|
759
|
-
var version = "3.
|
|
542
|
+
var version = "3.2.0";
|
|
760
543
|
//#endregion
|
|
761
544
|
//#region src/index.ts
|
|
762
545
|
const cli = cac(name);
|
|
763
|
-
function isNodeListener(value) {
|
|
764
|
-
return typeof value === "function";
|
|
765
|
-
}
|
|
766
|
-
async function loadNitroEntrypoint(outputDir) {
|
|
767
|
-
const entryPath = resolve(outputDir, "server/index.mjs");
|
|
768
|
-
const mod = await import(pathToFileURL(entryPath).href);
|
|
769
|
-
const listener = mod.listener ?? mod.middleware ?? mod.handler ?? mod.default;
|
|
770
|
-
if (!isNodeListener(listener)) throw new TypeError(`Invalid Nitro listener exported from ${entryPath}`);
|
|
771
|
-
return {
|
|
772
|
-
listener,
|
|
773
|
-
websocket: mod.websocket
|
|
774
|
-
};
|
|
775
|
-
}
|
|
776
546
|
cli.command("", "Start tokens usage analysis").option("--host <host>", "Host", { default: "127.0.0.1" }).option("--port <port>", "Port", { default: 7777 }).option("--open", "Open browser", { default: true }).action(async (option) => {
|
|
777
|
-
|
|
547
|
+
await createRuntimeServer({
|
|
548
|
+
path: resolve(dirname(fileURLToPath(import.meta.url)), "./"),
|
|
549
|
+
host: option.host,
|
|
778
550
|
port: option.port,
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
});
|
|
785
|
-
if (nitro.websocket) {
|
|
786
|
-
const { default: wsAdapter } = await import("crossws/adapters/node");
|
|
787
|
-
const { handleUpgrade } = wsAdapter(nitro.websocket);
|
|
788
|
-
app.on("upgrade", handleUpgrade);
|
|
789
|
-
}
|
|
790
|
-
app.listen(port, option.host, async () => {
|
|
791
|
-
if (option.open) {
|
|
792
|
-
const url = `http://${option.host}:${port}`;
|
|
793
|
-
console.log(`Usage board is running at ${url}`);
|
|
794
|
-
await open(url);
|
|
551
|
+
onReady: async ({ app }) => {
|
|
552
|
+
if (option.open) {
|
|
553
|
+
console.log(`Usage board is running at ${app.url}`);
|
|
554
|
+
await open(app.url);
|
|
555
|
+
}
|
|
795
556
|
}
|
|
796
557
|
});
|
|
797
558
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"ae3c6372-8821-43fb-aa55-bb47729a5660","timestamp":1779463669223}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"ae3c6372-8821-43fb-aa55-bb47729a5660","timestamp":1779463669223,"prerendered":[]}
|
|
@@ -6,7 +6,7 @@ import { Buffer as Buffer$1 } from 'node:buffer';
|
|
|
6
6
|
import { promises, existsSync, mkdirSync, readFileSync, statSync, accessSync, constants } from 'node:fs';
|
|
7
7
|
import { resolve as resolve$1, dirname as dirname$1, join, sep, basename as basename$1 } from 'node:path';
|
|
8
8
|
import { createHash } from 'node:crypto';
|
|
9
|
-
import
|
|
9
|
+
import { DatabaseSync } from 'node:sqlite';
|
|
10
10
|
import { glob } from 'glob';
|
|
11
11
|
import chokidar from 'chokidar';
|
|
12
12
|
import { homedir } from 'node:os';
|
|
@@ -4267,7 +4267,7 @@ function _expandFromEnv(value) {
|
|
|
4267
4267
|
const _inlineRuntimeConfig = {
|
|
4268
4268
|
"app": {
|
|
4269
4269
|
"baseURL": "/",
|
|
4270
|
-
"buildId": "
|
|
4270
|
+
"buildId": "ae3c6372-8821-43fb-aa55-bb47729a5660",
|
|
4271
4271
|
"buildAssetsDir": "/_nuxt/",
|
|
4272
4272
|
"cdnURL": ""
|
|
4273
4273
|
},
|
|
@@ -4295,7 +4295,7 @@ const _inlineRuntimeConfig = {
|
|
|
4295
4295
|
}
|
|
4296
4296
|
},
|
|
4297
4297
|
"public": {
|
|
4298
|
-
"appVersion": "3.
|
|
4298
|
+
"appVersion": "3.2.0",
|
|
4299
4299
|
"home": "/Users/tangchenghui"
|
|
4300
4300
|
},
|
|
4301
4301
|
"icon": {
|
|
@@ -4710,7 +4710,7 @@ function defineNitroPlugin(def) {
|
|
|
4710
4710
|
}
|
|
4711
4711
|
|
|
4712
4712
|
function openSqliteDatabase(location, options) {
|
|
4713
|
-
return new
|
|
4713
|
+
return new DatabaseSync(location, options != null ? options : {});
|
|
4714
4714
|
}
|
|
4715
4715
|
|
|
4716
4716
|
const PROJECT_USAGE_PLATFORMS = [
|
|
@@ -9008,7 +9008,7 @@ const gooseUsageAdapter = {
|
|
|
9008
9008
|
return config.goosePaths.flatMap((filePath) => toDiscoveredUsageFile(filePath, "goose"));
|
|
9009
9009
|
},
|
|
9010
9010
|
parseFile(filePath, resolvePricing) {
|
|
9011
|
-
const database = openSqliteDatabase(filePath, {
|
|
9011
|
+
const database = openSqliteDatabase(filePath, { readOnly: true });
|
|
9012
9012
|
try {
|
|
9013
9013
|
const rows = database.prepare(GOOSE_SESSION_QUERY).all();
|
|
9014
9014
|
const fragments = rows.map((row) => parseGooseRow(row, resolvePricing)).filter((entry) => entry !== null).map((entry) => {
|
|
@@ -9132,7 +9132,7 @@ const hermesUsageAdapter = {
|
|
|
9132
9132
|
return config.hermesPaths.flatMap((filePath) => toDiscoveredUsageFile(filePath, "hermes"));
|
|
9133
9133
|
},
|
|
9134
9134
|
parseFile(filePath, resolvePricing) {
|
|
9135
|
-
const database = openSqliteDatabase(filePath, {
|
|
9135
|
+
const database = openSqliteDatabase(filePath, { readOnly: true });
|
|
9136
9136
|
try {
|
|
9137
9137
|
const rows = database.prepare(HERMES_SESSION_QUERY).all();
|
|
9138
9138
|
return rows.map((row) => parseHermesRow(row, resolvePricing)).filter((entry) => entry !== null).map((entry) => {
|
|
@@ -9252,7 +9252,7 @@ const kiloUsageAdapter = {
|
|
|
9252
9252
|
},
|
|
9253
9253
|
parseFile(filePath, resolvePricing) {
|
|
9254
9254
|
var _a;
|
|
9255
|
-
const database = openSqliteDatabase(filePath, {
|
|
9255
|
+
const database = openSqliteDatabase(filePath, { readOnly: true });
|
|
9256
9256
|
try {
|
|
9257
9257
|
const rows = database.prepare(KILO_MESSAGE_QUERY).all();
|
|
9258
9258
|
const fragments = /* @__PURE__ */ new Map();
|
|
@@ -9585,7 +9585,7 @@ const openCodeUsageAdapter = {
|
|
|
9585
9585
|
parseFile(filePath, resolvePricing) {
|
|
9586
9586
|
var _a;
|
|
9587
9587
|
if (filePath.endsWith(".db")) {
|
|
9588
|
-
const database = openSqliteDatabase(filePath, {
|
|
9588
|
+
const database = openSqliteDatabase(filePath, { readOnly: true });
|
|
9589
9589
|
try {
|
|
9590
9590
|
const rows = database.prepare("SELECT id, session_id, data FROM message").all();
|
|
9591
9591
|
const fragments = /* @__PURE__ */ new Map();
|
|
@@ -10796,159 +10796,159 @@ const plugins = [
|
|
|
10796
10796
|
];
|
|
10797
10797
|
|
|
10798
10798
|
const assets = {
|
|
10799
|
-
"/favicon.ico": {
|
|
10800
|
-
"type": "image/vnd.microsoft.icon",
|
|
10801
|
-
"etag": "\"1083e-LfyFZ+1JmdianDqe/sQN2Ou0IzQ\"",
|
|
10802
|
-
"mtime": "2026-05-22T03:59:02.934Z",
|
|
10803
|
-
"size": 67646,
|
|
10804
|
-
"path": "../public/favicon.ico"
|
|
10805
|
-
},
|
|
10806
10799
|
"/logo.svg": {
|
|
10807
10800
|
"type": "image/svg+xml",
|
|
10808
10801
|
"etag": "\"1550-fwYFdULdJ83Qp0FjnnX31iQz9oI\"",
|
|
10809
|
-
"mtime": "2026-05-
|
|
10802
|
+
"mtime": "2026-05-22T15:27:58.719Z",
|
|
10810
10803
|
"size": 5456,
|
|
10811
10804
|
"path": "../public/logo.svg"
|
|
10812
10805
|
},
|
|
10813
10806
|
"/robots.txt": {
|
|
10814
10807
|
"type": "text/plain; charset=utf-8",
|
|
10815
10808
|
"etag": "\"18-j8OIsL9qGDmNZ+lHhp2tyH4XtaE\"",
|
|
10816
|
-
"mtime": "2026-05-
|
|
10809
|
+
"mtime": "2026-05-22T15:27:58.719Z",
|
|
10817
10810
|
"size": 24,
|
|
10818
10811
|
"path": "../public/robots.txt"
|
|
10819
10812
|
},
|
|
10813
|
+
"/favicon.ico": {
|
|
10814
|
+
"type": "image/vnd.microsoft.icon",
|
|
10815
|
+
"etag": "\"1083e-LfyFZ+1JmdianDqe/sQN2Ou0IzQ\"",
|
|
10816
|
+
"mtime": "2026-05-22T15:27:58.720Z",
|
|
10817
|
+
"size": 67646,
|
|
10818
|
+
"path": "../public/favicon.ico"
|
|
10819
|
+
},
|
|
10820
10820
|
"/_nuxt/B6C9KBQ4.js": {
|
|
10821
10821
|
"type": "text/javascript; charset=utf-8",
|
|
10822
10822
|
"etag": "\"5e1e-I40z3Xz4z7/UJG57r4vYGuEgT7c\"",
|
|
10823
|
-
"mtime": "2026-05-
|
|
10823
|
+
"mtime": "2026-05-22T15:27:58.714Z",
|
|
10824
10824
|
"size": 24094,
|
|
10825
10825
|
"path": "../public/_nuxt/B6C9KBQ4.js"
|
|
10826
10826
|
},
|
|
10827
10827
|
"/_nuxt/Bv6agYS5.js": {
|
|
10828
10828
|
"type": "text/javascript; charset=utf-8",
|
|
10829
10829
|
"etag": "\"9f6b-/oK8WDX8dj11Vq4rsvDCjR0nyFo\"",
|
|
10830
|
-
"mtime": "2026-05-
|
|
10830
|
+
"mtime": "2026-05-22T15:27:58.713Z",
|
|
10831
10831
|
"size": 40811,
|
|
10832
10832
|
"path": "../public/_nuxt/Bv6agYS5.js"
|
|
10833
10833
|
},
|
|
10834
10834
|
"/_nuxt/BvRyOET7.js": {
|
|
10835
10835
|
"type": "text/javascript; charset=utf-8",
|
|
10836
10836
|
"etag": "\"760b-+u3AotZdPY2Q6cCC1nWxcJWlQgA\"",
|
|
10837
|
-
"mtime": "2026-05-
|
|
10837
|
+
"mtime": "2026-05-22T15:27:58.714Z",
|
|
10838
10838
|
"size": 30219,
|
|
10839
10839
|
"path": "../public/_nuxt/BvRyOET7.js"
|
|
10840
10840
|
},
|
|
10841
|
+
"/_nuxt/COIbUy5w.js": {
|
|
10842
|
+
"type": "text/javascript; charset=utf-8",
|
|
10843
|
+
"etag": "\"d7b-HHVnZRYVWGAGuQkgrnXTrnj2mJI\"",
|
|
10844
|
+
"mtime": "2026-05-22T15:27:58.714Z",
|
|
10845
|
+
"size": 3451,
|
|
10846
|
+
"path": "../public/_nuxt/COIbUy5w.js"
|
|
10847
|
+
},
|
|
10841
10848
|
"/_nuxt/CMWftE4h.js": {
|
|
10842
10849
|
"type": "text/javascript; charset=utf-8",
|
|
10843
10850
|
"etag": "\"bc73-irs7yf0750yO82xrMn/X7jkeBxA\"",
|
|
10844
|
-
"mtime": "2026-05-
|
|
10851
|
+
"mtime": "2026-05-22T15:27:58.714Z",
|
|
10845
10852
|
"size": 48243,
|
|
10846
10853
|
"path": "../public/_nuxt/CMWftE4h.js"
|
|
10847
10854
|
},
|
|
10848
10855
|
"/_nuxt/CXLmM1yO.js": {
|
|
10849
10856
|
"type": "text/javascript; charset=utf-8",
|
|
10850
10857
|
"etag": "\"4a32-Fw0ZEqsjg7b74APkVgMFCTcBxCQ\"",
|
|
10851
|
-
"mtime": "2026-05-
|
|
10858
|
+
"mtime": "2026-05-22T15:27:58.714Z",
|
|
10852
10859
|
"size": 18994,
|
|
10853
10860
|
"path": "../public/_nuxt/CXLmM1yO.js"
|
|
10854
10861
|
},
|
|
10855
10862
|
"/_nuxt/DFqWEFN4.js": {
|
|
10856
10863
|
"type": "text/javascript; charset=utf-8",
|
|
10857
10864
|
"etag": "\"14f4-HAVLxCVCXnZm0u8oApXRDBhScWE\"",
|
|
10858
|
-
"mtime": "2026-05-
|
|
10865
|
+
"mtime": "2026-05-22T15:27:58.715Z",
|
|
10859
10866
|
"size": 5364,
|
|
10860
10867
|
"path": "../public/_nuxt/DFqWEFN4.js"
|
|
10861
10868
|
},
|
|
10862
10869
|
"/_nuxt/DUoLvn3A.js": {
|
|
10863
10870
|
"type": "text/javascript; charset=utf-8",
|
|
10864
10871
|
"etag": "\"3cf2-TwHHSkH7vVlOWjAczEQy6IP+0lw\"",
|
|
10865
|
-
"mtime": "2026-05-
|
|
10872
|
+
"mtime": "2026-05-22T15:27:58.715Z",
|
|
10866
10873
|
"size": 15602,
|
|
10867
10874
|
"path": "../public/_nuxt/DUoLvn3A.js"
|
|
10868
10875
|
},
|
|
10869
|
-
"/_nuxt/D_W11Quh.js": {
|
|
10870
|
-
"type": "text/javascript; charset=utf-8",
|
|
10871
|
-
"etag": "\"11426-X4U7gtaJhTDKTtUXLGjq2GLguBo\"",
|
|
10872
|
-
"mtime": "2026-05-22T03:59:02.929Z",
|
|
10873
|
-
"size": 70694,
|
|
10874
|
-
"path": "../public/_nuxt/D_W11Quh.js"
|
|
10875
|
-
},
|
|
10876
10876
|
"/_nuxt/DkxY2YMp.js": {
|
|
10877
10877
|
"type": "text/javascript; charset=utf-8",
|
|
10878
10878
|
"etag": "\"4399-3rFV4vv/KswxrAJ9NQha32buQPE\"",
|
|
10879
|
-
"mtime": "2026-05-
|
|
10879
|
+
"mtime": "2026-05-22T15:27:58.715Z",
|
|
10880
10880
|
"size": 17305,
|
|
10881
10881
|
"path": "../public/_nuxt/DkxY2YMp.js"
|
|
10882
10882
|
},
|
|
10883
|
-
"/_nuxt/
|
|
10883
|
+
"/_nuxt/D_W11Quh.js": {
|
|
10884
10884
|
"type": "text/javascript; charset=utf-8",
|
|
10885
|
-
"etag": "\"
|
|
10886
|
-
"mtime": "2026-05-
|
|
10887
|
-
"size":
|
|
10888
|
-
"path": "../public/_nuxt/
|
|
10885
|
+
"etag": "\"11426-X4U7gtaJhTDKTtUXLGjq2GLguBo\"",
|
|
10886
|
+
"mtime": "2026-05-22T15:27:58.715Z",
|
|
10887
|
+
"size": 70694,
|
|
10888
|
+
"path": "../public/_nuxt/D_W11Quh.js"
|
|
10889
10889
|
},
|
|
10890
10890
|
"/_nuxt/HiqUua3-.js": {
|
|
10891
10891
|
"type": "text/javascript; charset=utf-8",
|
|
10892
10892
|
"etag": "\"2a70-eSH6QudruLCR6jtZZFjhyeyirUU\"",
|
|
10893
|
-
"mtime": "2026-05-
|
|
10893
|
+
"mtime": "2026-05-22T15:27:58.716Z",
|
|
10894
10894
|
"size": 10864,
|
|
10895
10895
|
"path": "../public/_nuxt/HiqUua3-.js"
|
|
10896
10896
|
},
|
|
10897
10897
|
"/_nuxt/error-404.CFBEg71j.css": {
|
|
10898
10898
|
"type": "text/css; charset=utf-8",
|
|
10899
10899
|
"etag": "\"97e-GvhaEAryQvrSXyDcP4RiHXzYb5o\"",
|
|
10900
|
-
"mtime": "2026-05-
|
|
10900
|
+
"mtime": "2026-05-22T15:27:58.715Z",
|
|
10901
10901
|
"size": 2430,
|
|
10902
10902
|
"path": "../public/_nuxt/error-404.CFBEg71j.css"
|
|
10903
10903
|
},
|
|
10904
10904
|
"/_nuxt/error-500.BqCnH31G.css": {
|
|
10905
10905
|
"type": "text/css; charset=utf-8",
|
|
10906
10906
|
"etag": "\"773-Tpf6lA6A2FEDtjLyWUXKolBZ3hM\"",
|
|
10907
|
-
"mtime": "2026-05-
|
|
10907
|
+
"mtime": "2026-05-22T15:27:58.716Z",
|
|
10908
10908
|
"size": 1907,
|
|
10909
10909
|
"path": "../public/_nuxt/error-500.BqCnH31G.css"
|
|
10910
10910
|
},
|
|
10911
|
-
"/_nuxt/
|
|
10911
|
+
"/_nuxt/uHQwCIHg.js": {
|
|
10912
10912
|
"type": "text/javascript; charset=utf-8",
|
|
10913
|
-
"etag": "\"
|
|
10914
|
-
"mtime": "2026-05-
|
|
10915
|
-
"size":
|
|
10916
|
-
"path": "../public/_nuxt/
|
|
10913
|
+
"etag": "\"eb4-eU+Hz4IGbA/36UMYmP8kZLNbF6s\"",
|
|
10914
|
+
"mtime": "2026-05-22T15:27:58.716Z",
|
|
10915
|
+
"size": 3764,
|
|
10916
|
+
"path": "../public/_nuxt/uHQwCIHg.js"
|
|
10917
10917
|
},
|
|
10918
10918
|
"/_nuxt/builds/latest.json": {
|
|
10919
10919
|
"type": "application/json",
|
|
10920
|
-
"etag": "\"47-
|
|
10921
|
-
"mtime": "2026-05-
|
|
10920
|
+
"etag": "\"47-wNnQ9XSYF1pAl7k+i6JQXN2OTYk\"",
|
|
10921
|
+
"mtime": "2026-05-22T15:27:58.708Z",
|
|
10922
10922
|
"size": 71,
|
|
10923
10923
|
"path": "../public/_nuxt/builds/latest.json"
|
|
10924
10924
|
},
|
|
10925
|
-
"/_nuxt/
|
|
10926
|
-
"type": "text/javascript; charset=utf-8",
|
|
10927
|
-
"etag": "\"eb4-eU+Hz4IGbA/36UMYmP8kZLNbF6s\"",
|
|
10928
|
-
"mtime": "2026-05-22T03:59:02.929Z",
|
|
10929
|
-
"size": 3764,
|
|
10930
|
-
"path": "../public/_nuxt/uHQwCIHg.js"
|
|
10931
|
-
},
|
|
10932
|
-
"/_nuxt/builds/meta/97934cfc-fbd7-4ac5-ab89-aefedca0767f.json": {
|
|
10925
|
+
"/_nuxt/builds/meta/ae3c6372-8821-43fb-aa55-bb47729a5660.json": {
|
|
10933
10926
|
"type": "application/json",
|
|
10934
|
-
"etag": "\"58-
|
|
10935
|
-
"mtime": "2026-05-
|
|
10927
|
+
"etag": "\"58-S7bLze8ZYeMP8v0W6MLjHfuBE20\"",
|
|
10928
|
+
"mtime": "2026-05-22T15:27:58.701Z",
|
|
10936
10929
|
"size": 88,
|
|
10937
|
-
"path": "../public/_nuxt/builds/meta/
|
|
10930
|
+
"path": "../public/_nuxt/builds/meta/ae3c6372-8821-43fb-aa55-bb47729a5660.json"
|
|
10931
|
+
},
|
|
10932
|
+
"/_nuxt/DgKrPjze.js": {
|
|
10933
|
+
"type": "text/javascript; charset=utf-8",
|
|
10934
|
+
"etag": "\"35466-BQwxEwkorZeoi3JtsQAovpFUAlE\"",
|
|
10935
|
+
"mtime": "2026-05-22T15:27:58.715Z",
|
|
10936
|
+
"size": 218214,
|
|
10937
|
+
"path": "../public/_nuxt/DgKrPjze.js"
|
|
10938
10938
|
},
|
|
10939
10939
|
"/_nuxt/entry.vHfFzkyD.css": {
|
|
10940
10940
|
"type": "text/css; charset=utf-8",
|
|
10941
10941
|
"etag": "\"1d217-AX0vUIWFE2kL17zPKjOPcQBxadQ\"",
|
|
10942
|
-
"mtime": "2026-05-
|
|
10942
|
+
"mtime": "2026-05-22T15:27:58.716Z",
|
|
10943
10943
|
"size": 119319,
|
|
10944
10944
|
"path": "../public/_nuxt/entry.vHfFzkyD.css"
|
|
10945
10945
|
},
|
|
10946
|
-
"/_nuxt/
|
|
10946
|
+
"/_nuxt/DtbPvE6R.js": {
|
|
10947
10947
|
"type": "text/javascript; charset=utf-8",
|
|
10948
|
-
"etag": "\"
|
|
10949
|
-
"mtime": "2026-05-
|
|
10950
|
-
"size":
|
|
10951
|
-
"path": "../public/_nuxt/
|
|
10948
|
+
"etag": "\"4135e-cTbNR7mK7vcfB4JteOXxth6FUlY\"",
|
|
10949
|
+
"mtime": "2026-05-22T15:27:58.716Z",
|
|
10950
|
+
"size": 267102,
|
|
10951
|
+
"path": "../public/_nuxt/DtbPvE6R.js"
|
|
10952
10952
|
}
|
|
10953
10953
|
};
|
|
10954
10954
|
|