token-usage-dashboard 1.0.20 → 1.0.21
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/build/adapter-node.js +1 -1
- package/build/client/_app/immutable/chunks/C1sJReAz.js +3 -0
- package/build/client/_app/immutable/chunks/C1sJReAz.js.br +0 -0
- package/build/client/_app/immutable/chunks/C1sJReAz.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{C2_oK6Yg.js → CY61d4eO.js} +1 -1
- package/build/client/_app/immutable/chunks/CY61d4eO.js.br +0 -0
- package/build/client/_app/immutable/chunks/CY61d4eO.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{DkRfJXwX.js → DqDXC22T.js} +1 -1
- package/build/client/_app/immutable/chunks/DqDXC22T.js.br +0 -0
- package/build/client/_app/immutable/chunks/DqDXC22T.js.gz +0 -0
- package/build/client/_app/immutable/chunks/MCCUCfWF.js +1 -0
- package/build/client/_app/immutable/chunks/MCCUCfWF.js.br +1 -0
- package/build/client/_app/immutable/chunks/MCCUCfWF.js.gz +0 -0
- package/build/client/_app/immutable/entry/{app.Bs9G7zoZ.js → app.c-l2PDnA.js} +2 -2
- package/build/client/_app/immutable/entry/app.c-l2PDnA.js.br +0 -0
- package/build/client/_app/immutable/entry/app.c-l2PDnA.js.gz +0 -0
- package/build/client/_app/immutable/entry/{start.BPslY-3R.js → start.Ch_y930O.js} +2 -2
- package/build/client/_app/immutable/entry/start.Ch_y930O.js.br +3 -0
- package/build/client/_app/immutable/entry/start.Ch_y930O.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.C6Tx-XmR.js +1 -0
- package/build/client/_app/immutable/nodes/0.C6Tx-XmR.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.C6Tx-XmR.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{1.CArPcl3H.js → 1.Be7Mrr0U.js} +1 -1
- package/build/client/_app/immutable/nodes/1.Be7Mrr0U.js.br +3 -0
- package/build/client/_app/immutable/nodes/1.Be7Mrr0U.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{2.BD6e8Sr-.js → 2.ByGQ00I8.js} +1 -1
- package/build/client/_app/immutable/nodes/2.ByGQ00I8.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.ByGQ00I8.js.gz +0 -0
- package/build/client/_app/version.json +1 -1
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/server/adapter-index.js +1 -2
- package/build/server/adapter-node-env.js +1 -2
- package/build/server/adapter-node-handler.js +4 -8
- package/build/server/chunks/config.js +1 -2
- package/build/server/chunks/functions.js +1 -2
- package/build/server/chunks/instance.js +33 -63
- package/build/server/chunks/internal.js +33 -65
- package/build/server/chunks/navigation.js +1 -2
- package/build/server/chunks/queries.js +10 -20
- package/build/server/chunks/range.js +3 -6
- package/build/server/chunks/refresh.js +2 -4
- package/build/server/chunks/request.js +1 -2
- package/build/server/chunks/server-errors.js +2 -4
- package/build/server/chunks/server.js +0 -1
- package/build/server/chunks/server2.js +17 -38
- package/build/server/chunks/shared.js +1 -2
- package/build/server/chunks/uneval.js +3 -6
- package/build/server/entries/endpoints/api/refresh/_server.ts.js +1 -2
- package/build/server/entries/endpoints/api/settings/_server.ts.js +1 -2
- package/build/server/entries/endpoints/api/usage/_server.ts.js +1 -2
- package/build/server/entries/fallbacks/error.svelte.js +2 -4
- package/build/server/entries/hooks.server.js +1 -2
- package/build/server/entries/pages/_layout.svelte.js +1 -2
- package/build/server/entries/pages/_page.server.ts.js +1 -2
- package/build/server/entries/pages/_page.svelte.js +21 -42
- package/build/server/index.js +1 -2
- package/build/server/manifest-full.js +1 -1
- package/build/server/manifest.js +1 -1
- package/build/server/nodes/0.js +1 -1
- package/build/server/nodes/1.js +1 -1
- package/build/server/nodes/2.js +1 -1
- package/build/server/remote-entry.js +7 -14
- package/build/server/server.js +1 -1
- package/package.json +1 -1
- package/build/client/_app/immutable/chunks/BLLqPIda.js +0 -3
- package/build/client/_app/immutable/chunks/BLLqPIda.js.br +0 -0
- package/build/client/_app/immutable/chunks/BLLqPIda.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C2_oK6Yg.js.br +0 -0
- package/build/client/_app/immutable/chunks/C2_oK6Yg.js.gz +0 -0
- package/build/client/_app/immutable/chunks/ChHPZo_0.js +0 -1
- package/build/client/_app/immutable/chunks/ChHPZo_0.js.br +0 -1
- package/build/client/_app/immutable/chunks/ChHPZo_0.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DkRfJXwX.js.br +0 -0
- package/build/client/_app/immutable/chunks/DkRfJXwX.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.Bs9G7zoZ.js.br +0 -0
- package/build/client/_app/immutable/entry/app.Bs9G7zoZ.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.BPslY-3R.js.br +0 -2
- package/build/client/_app/immutable/entry/start.BPslY-3R.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.yxxqRuA2.js +0 -1
- package/build/client/_app/immutable/nodes/0.yxxqRuA2.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.yxxqRuA2.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.CArPcl3H.js.br +0 -1
- package/build/client/_app/immutable/nodes/1.CArPcl3H.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.BD6e8Sr-.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.BD6e8Sr-.js.gz +0 -0
|
@@ -4,7 +4,7 @@ import { basename, dirname, join } from "node:path";
|
|
|
4
4
|
import { DatabaseSync } from "node:sqlite";
|
|
5
5
|
import { existsSync, mkdirSync } from "node:fs";
|
|
6
6
|
import { homedir } from "node:os";
|
|
7
|
-
|
|
7
|
+
// src/lib/server/config.ts
|
|
8
8
|
var home = homedir();
|
|
9
9
|
var env = (name, fallback) => (process.env[name] || "").trim() || fallback;
|
|
10
10
|
var dataHome = env("XDG_DATA_HOME", join(home, ".local", "share"));
|
|
@@ -19,8 +19,7 @@ var config = {
|
|
|
19
19
|
openRouterKey: env("OPENROUTER_API_KEY", ""),
|
|
20
20
|
scanIntervalMs: Number(env("AIUSAGE_SCAN_INTERVAL", "120")) * 1e3
|
|
21
21
|
};
|
|
22
|
-
|
|
23
|
-
//#region src/lib/server/db.ts
|
|
22
|
+
// src/lib/server/db.ts
|
|
24
23
|
/** Bump to throw away scanned rows and read every source file again. */
|
|
25
24
|
var SCHEMA = 2;
|
|
26
25
|
var META = "create table if not exists meta (key text primary key, value text not null)";
|
|
@@ -118,8 +117,7 @@ function readMeta(key) {
|
|
|
118
117
|
function writeMeta(key, value) {
|
|
119
118
|
db().prepare("insert into meta (key, value) values (?, ?) on conflict(key) do update set value = excluded.value").run(key, value);
|
|
120
119
|
}
|
|
121
|
-
|
|
122
|
-
//#region src/lib/server/sources/types.ts
|
|
120
|
+
// src/lib/server/sources/types.ts
|
|
123
121
|
/** Lines that can't be parsed are skipped: a half-written tail is normal, not a fault. */
|
|
124
122
|
function* jsonLines(text, needle) {
|
|
125
123
|
for (const line of text.split("\n")) {
|
|
@@ -132,8 +130,7 @@ function* jsonLines(text, needle) {
|
|
|
132
130
|
}
|
|
133
131
|
}
|
|
134
132
|
var num = (value) => typeof value === "number" && value > 0 ? value : 0;
|
|
135
|
-
|
|
136
|
-
//#region src/lib/server/sources/claude.ts
|
|
133
|
+
// src/lib/server/sources/claude.ts
|
|
137
134
|
/**
|
|
138
135
|
* A streaming message is rewritten in place under one `message.id`, so the caller keeps the
|
|
139
136
|
* highest value it has seen per field. Session comes off the line, never the filename, or a
|
|
@@ -190,8 +187,7 @@ function names(text) {
|
|
|
190
187
|
...typed
|
|
191
188
|
};
|
|
192
189
|
}
|
|
193
|
-
|
|
194
|
-
//#region src/lib/server/sources/codex.ts
|
|
190
|
+
// src/lib/server/sources/codex.ts
|
|
195
191
|
var label = (minutes) => {
|
|
196
192
|
if (minutes === 300) return "Codex 5-hour";
|
|
197
193
|
if (minutes === 10080) return "Codex weekly";
|
|
@@ -209,8 +205,7 @@ function window(id, limit, plan, seenAt) {
|
|
|
209
205
|
seen_at: seenAt
|
|
210
206
|
};
|
|
211
207
|
}
|
|
212
|
-
|
|
213
|
-
//#region src/lib/server/sources/index.ts
|
|
208
|
+
// src/lib/server/sources/index.ts
|
|
214
209
|
var SOURCES = [
|
|
215
210
|
claudeCode,
|
|
216
211
|
{
|
|
@@ -299,8 +294,7 @@ var SOURCES = [
|
|
|
299
294
|
}
|
|
300
295
|
}
|
|
301
296
|
];
|
|
302
|
-
|
|
303
|
-
//#region src/lib/server/problems.ts
|
|
297
|
+
// src/lib/server/problems.ts
|
|
304
298
|
var seen = /* @__PURE__ */ new Map();
|
|
305
299
|
/** Keyed on id so a fault that repeats every scan stays one row in the panel. */
|
|
306
300
|
function report(problem) {
|
|
@@ -314,8 +308,7 @@ function resolve(id) {
|
|
|
314
308
|
}
|
|
315
309
|
var problems = () => [...seen.values()].sort((a, b) => b.at - a.at);
|
|
316
310
|
var describe = (error) => error instanceof Error ? error.message : String(error);
|
|
317
|
-
|
|
318
|
-
//#region src/lib/server/scan.ts
|
|
311
|
+
// src/lib/server/scan.ts
|
|
319
312
|
var running = null;
|
|
320
313
|
var last = [];
|
|
321
314
|
var finishedAt = 0;
|
|
@@ -436,8 +429,7 @@ var scanState = () => ({
|
|
|
436
429
|
scannedAt: finishedAt,
|
|
437
430
|
busy: running !== null
|
|
438
431
|
});
|
|
439
|
-
|
|
440
|
-
//#region src/lib/server/settings.ts
|
|
432
|
+
// src/lib/server/settings.ts
|
|
441
433
|
var DEFAULTS = {
|
|
442
434
|
theme: "auto",
|
|
443
435
|
range: "30d",
|
|
@@ -475,8 +467,7 @@ function saveSettings(patch) {
|
|
|
475
467
|
return next;
|
|
476
468
|
}
|
|
477
469
|
var priceOverrides = () => settings().prices;
|
|
478
|
-
|
|
479
|
-
//#region src/lib/server/queries.ts
|
|
470
|
+
// src/lib/server/queries.ts
|
|
480
471
|
var empty = () => ({
|
|
481
472
|
input: 0,
|
|
482
473
|
output: 0,
|
|
@@ -717,7 +708,6 @@ function rollup(filters) {
|
|
|
717
708
|
problems: problems()
|
|
718
709
|
};
|
|
719
710
|
}
|
|
720
|
-
//#endregion
|
|
721
711
|
export { scan as a, resolve as c, settings as i, db as l, usage as n, describe as o, saveSettings as r, report as s, clearUsageMemo as t, config as u };
|
|
722
712
|
|
|
723
713
|
//# sourceMappingURL=queries.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/lib/themes.ts
|
|
2
2
|
var THEMES = [
|
|
3
3
|
{
|
|
4
4
|
id: "auto",
|
|
@@ -37,8 +37,7 @@ var THEMES = [
|
|
|
37
37
|
label: "Solarized dark"
|
|
38
38
|
}
|
|
39
39
|
];
|
|
40
|
-
|
|
41
|
-
//#region src/lib/pricing.ts
|
|
40
|
+
// src/lib/pricing.ts
|
|
42
41
|
/** Dollars per million. Anthropic bills cache reads at a tenth and 5m writes at 1.25x. */
|
|
43
42
|
var anthropic = (input, output, read = .1) => ({
|
|
44
43
|
input,
|
|
@@ -105,8 +104,7 @@ function costOf(model, tokens, overrides = {}) {
|
|
|
105
104
|
return (tokens.input * rate.input + tokens.output * rate.output + tokens.cache_read * rate.cacheRead + short * rate.cacheWrite + tokens.cache_write_long * rate.cacheWrite * LONG_WRITE) / 1e6;
|
|
106
105
|
}
|
|
107
106
|
var totalOf = (tokens) => tokens.input + tokens.output + tokens.cache_read + tokens.cache_write;
|
|
108
|
-
|
|
109
|
-
//#region src/lib/range.ts
|
|
107
|
+
// src/lib/range.ts
|
|
110
108
|
var RANGES = [
|
|
111
109
|
{
|
|
112
110
|
id: "today",
|
|
@@ -158,7 +156,6 @@ function resolveRange(id, now = Date.now()) {
|
|
|
158
156
|
range: range.id
|
|
159
157
|
};
|
|
160
158
|
}
|
|
161
|
-
//#endregion
|
|
162
159
|
export { costOf as a, RATES as i, rangeLabel as n, totalOf as o, resolveRange as r, THEMES as s, RANGES as t };
|
|
163
160
|
|
|
164
161
|
//# sourceMappingURL=range.js.map
|
|
@@ -2,7 +2,7 @@ import { a as scan, c as resolve, i as settings, l as db, n as usage, o as descr
|
|
|
2
2
|
import { r as resolveRange } from "./range.js";
|
|
3
3
|
import { readFile } from "node:fs/promises";
|
|
4
4
|
import { join } from "node:path";
|
|
5
|
-
|
|
5
|
+
// src/lib/server/windows.ts
|
|
6
6
|
var ENDPOINT = "https://api.anthropic.com/api/oauth/usage";
|
|
7
7
|
var LABELS = {
|
|
8
8
|
five_hour: ["Claude 5-hour", 300],
|
|
@@ -69,8 +69,7 @@ async function refreshClaudeWindows(force = false) {
|
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
//#region src/lib/server/refresh.ts
|
|
72
|
+
// src/lib/server/refresh.ts
|
|
74
73
|
var timer = null;
|
|
75
74
|
async function refresh(force = false) {
|
|
76
75
|
await Promise.all([scan().catch((error) => report({
|
|
@@ -101,7 +100,6 @@ function boot() {
|
|
|
101
100
|
timer.unref?.();
|
|
102
101
|
refresh();
|
|
103
102
|
}
|
|
104
|
-
//#endregion
|
|
105
103
|
export { refresh as n, boot as t };
|
|
106
104
|
|
|
107
105
|
//# sourceMappingURL=refresh.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as settings } from "./queries.js";
|
|
2
2
|
import { r as resolveRange } from "./range.js";
|
|
3
|
-
|
|
3
|
+
// src/lib/server/request.ts
|
|
4
4
|
function filtersFrom(url) {
|
|
5
5
|
const id = url.searchParams.get("range") || settings().range;
|
|
6
6
|
const { from, to, range } = resolveRange(id);
|
|
@@ -14,7 +14,6 @@ function filtersFrom(url) {
|
|
|
14
14
|
projects: list("projects")
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
//#endregion
|
|
18
17
|
export { filtersFrom as t };
|
|
19
18
|
|
|
20
19
|
//# sourceMappingURL=request.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// node_modules/@sveltejs/kit/src/messages/internal/server.js
|
|
2
2
|
/**
|
|
3
3
|
* @typedef {{ cause?: unknown; stackless?: boolean }} ServerThrowOptions
|
|
4
4
|
*/
|
|
@@ -30,8 +30,7 @@ function capture_error(fn) {
|
|
|
30
30
|
return error;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
//#region node_modules/@sveltejs/kit/src/messages/server-errors.js
|
|
33
|
+
// node_modules/@sveltejs/kit/src/messages/server-errors.js
|
|
35
34
|
/** @import { ServerThrowOptions } from './internal/server.js' */
|
|
36
35
|
/**
|
|
37
36
|
* Data returned from action inside `%id%` is not serializable: %message%
|
|
@@ -483,7 +482,6 @@ function state_read_outside_render(_values, options) {
|
|
|
483
482
|
function url_search_unavailable_prerender(_values, options) {
|
|
484
483
|
throw_error("url_search_unavailable_prerender", `Cannot access \`url.${_values.property}\` on a page with prerendering enabled`, options, url_search_unavailable_prerender);
|
|
485
484
|
}
|
|
486
|
-
//#endregion
|
|
487
485
|
export { remote_cookie_forbidden as A, remote_requested_context as B, prerender_endpoint_methods as C, remote_command_method as D, prerender_template_nonce as E, remote_query_live_no_value as F, server_api_unavailable as G, remote_requested_invalid_query as H, remote_query_live_not_iterable as I, ssr_fetch_relative_url as J, set_headers_after_response as K, remote_query_prerender as L, remote_form_fail as M, remote_headers_forbidden as N, remote_command_readonly as O, remote_invalid_validator as P, remote_request_property as R, prerender_actions as S, prerender_nonce as T, remote_requested_wrong_method as U, remote_requested_invalid_limit as V, request_store_after_await as W, url_search_unavailable_prerender as X, state_read_outside_render as Y, capture_error as Z, load_fetch_cors as _, action_return_error as a, load_promise_not_serializable as b, client_address_unsupported as c, cookies_set_after_response as d, csp_report_only_missing_report as f, header_already_set as g, handle_error_hook_failed as h, action_response_not_serializable as i, remote_cookie_path_relative as j, remote_command_render as k, cookie_too_large as l, fetch_response_decoded as m, action_default_with_named as n, action_return_redirect as o, endpoint_invalid_response as p, set_headers_cookie as q, action_name_reserved as r, action_throw_fail as s, action_data_not_serializable as t, cookies_serialize_before_route as u, load_not_plain_object as v, prerender_endpoint_not_prerenderable as w, load_response_header_not_serialized as x, load_not_serializable as y, remote_requested_async_validator as z };
|
|
488
486
|
|
|
489
487
|
//# sourceMappingURL=server-errors.js.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { t as uneval } from "./uneval.js";
|
|
2
|
-
|
|
2
|
+
// node_modules/svelte/src/constants.js
|
|
3
3
|
var UNINITIALIZED = Symbol("uninitialized");
|
|
4
|
-
|
|
5
|
-
//#region node_modules/svelte/src/escaping.js
|
|
4
|
+
// node_modules/svelte/src/escaping.js
|
|
6
5
|
var ATTR_REGEX = /[&"<]/g;
|
|
7
6
|
var CONTENT_REGEX = /[&<]/g;
|
|
8
7
|
/**
|
|
@@ -24,8 +23,7 @@ function escape_html(value, is_attr) {
|
|
|
24
23
|
}
|
|
25
24
|
return escaped + str.substring(last);
|
|
26
25
|
}
|
|
27
|
-
|
|
28
|
-
//#region node_modules/clsx/dist/clsx.mjs
|
|
26
|
+
// node_modules/clsx/dist/clsx.mjs
|
|
29
27
|
function r(e) {
|
|
30
28
|
var t, f, n = "";
|
|
31
29
|
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
@@ -39,8 +37,7 @@ function clsx$1() {
|
|
|
39
37
|
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
40
38
|
return n;
|
|
41
39
|
}
|
|
42
|
-
|
|
43
|
-
//#region node_modules/svelte/src/internal/shared/utils.js
|
|
40
|
+
// node_modules/svelte/src/internal/shared/utils.js
|
|
44
41
|
var is_array = Array.isArray;
|
|
45
42
|
Array.prototype.indexOf;
|
|
46
43
|
Array.prototype.includes;
|
|
@@ -70,8 +67,7 @@ function deferred() {
|
|
|
70
67
|
reject
|
|
71
68
|
};
|
|
72
69
|
}
|
|
73
|
-
|
|
74
|
-
//#region node_modules/svelte/src/internal/shared/attributes.js
|
|
70
|
+
// node_modules/svelte/src/internal/shared/attributes.js
|
|
75
71
|
/**
|
|
76
72
|
* `<div translate={false}>` should be rendered as `<div translate="no">` and _not_
|
|
77
73
|
* `<div translate="false">`, which is equivalent to `<div translate="yes">`. There
|
|
@@ -209,19 +205,14 @@ function to_style(value, styles) {
|
|
|
209
205
|
}
|
|
210
206
|
return value == null ? null : String(value);
|
|
211
207
|
}
|
|
212
|
-
|
|
213
|
-
//#region node_modules/svelte/src/internal/client/constants.js
|
|
214
|
-
var CLEAN = 1024;
|
|
215
|
-
var DIRTY = 2048;
|
|
216
|
-
var MAYBE_DIRTY = 4096;
|
|
208
|
+
// node_modules/svelte/src/internal/client/constants.js
|
|
217
209
|
/** allow users to ignore aborted signal errors if `reason.name === 'StaleReactionError` */
|
|
218
210
|
var STALE_REACTION = new class StaleReactionError extends Error {
|
|
219
211
|
name = "StaleReactionError";
|
|
220
212
|
message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
|
|
221
213
|
}();
|
|
222
214
|
globalThis.document?.contentType;
|
|
223
|
-
|
|
224
|
-
//#region node_modules/svelte/src/internal/shared/errors.js
|
|
215
|
+
// node_modules/svelte/src/internal/shared/errors.js
|
|
225
216
|
/**
|
|
226
217
|
* `%name%(...)` can only be used during component initialisation
|
|
227
218
|
* @param {string} name
|
|
@@ -230,12 +221,10 @@ globalThis.document?.contentType;
|
|
|
230
221
|
function lifecycle_outside_component(name) {
|
|
231
222
|
throw new Error(`https://svelte.dev/e/lifecycle_outside_component`);
|
|
232
223
|
}
|
|
233
|
-
|
|
234
|
-
//#region node_modules/svelte/src/internal/flags/index.js
|
|
224
|
+
// node_modules/svelte/src/internal/flags/index.js
|
|
235
225
|
/** True if experimental.async=true */
|
|
236
226
|
var async_mode_flag = false;
|
|
237
|
-
|
|
238
|
-
//#region node_modules/svelte/src/internal/shared/context.js
|
|
227
|
+
// node_modules/svelte/src/internal/shared/context.js
|
|
239
228
|
/**
|
|
240
229
|
* @typedef {{ p: Context | null, c: Map<unknown, unknown> | null }} Context
|
|
241
230
|
*/
|
|
@@ -257,14 +246,11 @@ function get_or_init_context_map(context, name) {
|
|
|
257
246
|
if (context === null) lifecycle_outside_component(name);
|
|
258
247
|
return context.c ??= new Map(get_parent_context(context) || void 0);
|
|
259
248
|
}
|
|
260
|
-
|
|
261
|
-
//#endregion
|
|
262
|
-
//#region node_modules/svelte/src/internal/server/hydration.js
|
|
249
|
+
// node_modules/svelte/src/internal/server/hydration.js
|
|
263
250
|
var BLOCK_OPEN = `<!--[-->`;
|
|
264
251
|
var BLOCK_CLOSE = `<!--]-->`;
|
|
265
252
|
var EMPTY_COMMENT = `<!---->`;
|
|
266
|
-
|
|
267
|
-
//#region node_modules/svelte/src/utils.js
|
|
253
|
+
// node_modules/svelte/src/utils.js
|
|
268
254
|
var VOID_ELEMENT_NAMES = [
|
|
269
255
|
"area",
|
|
270
256
|
"base",
|
|
@@ -343,8 +329,7 @@ function is_raw_text_element(name) {
|
|
|
343
329
|
return RAW_TEXT_ELEMENTS.includes(name);
|
|
344
330
|
}
|
|
345
331
|
var REGEX_VALID_TAG_NAME = /^[a-zA-Z][a-zA-Z0-9]*(-[a-zA-Z0-9.\-_\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}]*)?$/u;
|
|
346
|
-
|
|
347
|
-
//#region node_modules/svelte/src/internal/server/errors.js
|
|
332
|
+
// node_modules/svelte/src/internal/server/errors.js
|
|
348
333
|
/**
|
|
349
334
|
* The node API `AsyncLocalStorage` is not available, but is required to use async server rendering.
|
|
350
335
|
* @returns {never}
|
|
@@ -409,8 +394,7 @@ function server_context_required() {
|
|
|
409
394
|
error.name = "Svelte error";
|
|
410
395
|
throw error;
|
|
411
396
|
}
|
|
412
|
-
|
|
413
|
-
//#region node_modules/svelte/src/internal/server/context.js
|
|
397
|
+
// node_modules/svelte/src/internal/server/context.js
|
|
414
398
|
/** @import { SSRContext } from '#server' */
|
|
415
399
|
/** @type {SSRContext | null} */
|
|
416
400
|
var ssr_context = null;
|
|
@@ -451,8 +435,7 @@ function pop() {
|
|
|
451
435
|
function unresolved_hydratable(key, stack) {
|
|
452
436
|
console.warn(`https://svelte.dev/e/unresolved_hydratable`);
|
|
453
437
|
}
|
|
454
|
-
|
|
455
|
-
//#region node_modules/svelte/src/internal/server/render-context.js
|
|
438
|
+
// node_modules/svelte/src/internal/server/render-context.js
|
|
456
439
|
/** @import { AsyncLocalStorage } from 'node:async_hooks' */
|
|
457
440
|
/** @import { RenderContext } from '#server' */
|
|
458
441
|
/** @type {Promise<void> | null} */
|
|
@@ -507,8 +490,7 @@ function init_render_context() {
|
|
|
507
490
|
function in_webcontainer() {
|
|
508
491
|
return !!globalThis.process?.versions?.webcontainer;
|
|
509
492
|
}
|
|
510
|
-
|
|
511
|
-
//#region node_modules/svelte/src/internal/server/crypto.js
|
|
493
|
+
// node_modules/svelte/src/internal/server/crypto.js
|
|
512
494
|
var text_encoder;
|
|
513
495
|
var crypto;
|
|
514
496
|
/** @param {string} module_name */
|
|
@@ -532,8 +514,7 @@ function base64_encode(bytes) {
|
|
|
532
514
|
for (let i = 0; i < bytes.length; i++) binary += String.fromCharCode(bytes[i]);
|
|
533
515
|
return btoa(binary);
|
|
534
516
|
}
|
|
535
|
-
|
|
536
|
-
//#region node_modules/svelte/src/internal/server/renderer.js
|
|
517
|
+
// node_modules/svelte/src/internal/server/renderer.js
|
|
537
518
|
/** @import { Component } from 'svelte' */
|
|
538
519
|
/** @import { HydratableContext, SSRContext } from './types.js' */
|
|
539
520
|
/** @import { Csp, RenderOutput, SyncRenderOutput, Sha256Source } from '../../server/public.js' */
|
|
@@ -1342,8 +1323,7 @@ var SSRState = class {
|
|
|
1342
1323
|
}
|
|
1343
1324
|
}
|
|
1344
1325
|
};
|
|
1345
|
-
|
|
1346
|
-
//#region node_modules/svelte/src/internal/server/index.js
|
|
1326
|
+
// node_modules/svelte/src/internal/server/index.js
|
|
1347
1327
|
var INVALID_ATTR_NAME_CHAR_REGEX = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;
|
|
1348
1328
|
/**
|
|
1349
1329
|
* @param {Renderer} renderer
|
|
@@ -1498,7 +1478,6 @@ function derived(fn) {
|
|
|
1498
1478
|
return updated_value;
|
|
1499
1479
|
};
|
|
1500
1480
|
}
|
|
1501
|
-
//#endregion
|
|
1502
1481
|
export { element as a, render as c, attr as d, run as f, derived as i, stringify as l, attr_style as n, ensure_array_like as o, escape_html as p, bind_props as r, head as s, attr_class as t, getContext as u };
|
|
1503
1482
|
|
|
1504
1483
|
//# sourceMappingURL=server2.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// node_modules/@sveltejs/kit/src/exports/internal/shared.js
|
|
2
2
|
/** @import { StandardSchemaV1 } from '@standard-schema/spec' */
|
|
3
3
|
var HttpError = class {
|
|
4
4
|
/**
|
|
@@ -78,7 +78,6 @@ var ValidationError = class extends Error {
|
|
|
78
78
|
this.issues = issues;
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
|
-
//#endregion
|
|
82
81
|
export { SvelteKitError as a, Redirect as i, HandledHttpError as n, ValidationError as o, HttpError as r, ActionFailure as t };
|
|
83
82
|
|
|
84
83
|
//# sourceMappingURL=shared.js.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// node_modules/devalue/src/constants.js
|
|
2
2
|
var MAX_ARRAY_LEN = 2 ** 32 - 1;
|
|
3
3
|
var MAX_ARRAY_INDEX = MAX_ARRAY_LEN - 1;
|
|
4
|
-
|
|
5
|
-
//#region node_modules/devalue/src/utils.js
|
|
4
|
+
// node_modules/devalue/src/utils.js
|
|
6
5
|
/** @type {Record<string, string>} */
|
|
7
6
|
var escaped = {
|
|
8
7
|
"<": "\\u003C",
|
|
@@ -129,8 +128,7 @@ function valid_array_indices(array) {
|
|
|
129
128
|
keys.length = array_index_cut(keys);
|
|
130
129
|
return keys;
|
|
131
130
|
}
|
|
132
|
-
|
|
133
|
-
//#region node_modules/devalue/src/uneval.js
|
|
131
|
+
// node_modules/devalue/src/uneval.js
|
|
134
132
|
var chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$";
|
|
135
133
|
var MIN_STRING_LENGTH = 128;
|
|
136
134
|
var unsafe_chars = /[<\b\f\n\r\t\0\u2028\u2029]/g;
|
|
@@ -531,7 +529,6 @@ function stringify_primitive(thing) {
|
|
|
531
529
|
if (type === "bigint") return thing + "n";
|
|
532
530
|
return str;
|
|
533
531
|
}
|
|
534
|
-
//#endregion
|
|
535
532
|
export { is_buffer as a, is_valid_array_len as c, valid_array_indices as d, MAX_ARRAY_INDEX as f, get_type as i, stringify_key as l, DevalueError as n, is_plain_object as o, enumerable_symbols as r, is_valid_array_index as s, uneval as t, stringify_string as u };
|
|
536
533
|
|
|
537
534
|
//# sourceMappingURL=uneval.js.map
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { n as usage } from "../../../../chunks/queries.js";
|
|
2
2
|
import { n as refresh } from "../../../../chunks/refresh.js";
|
|
3
3
|
import { t as filtersFrom } from "../../../../chunks/request.js";
|
|
4
|
-
|
|
4
|
+
// src/routes/api/refresh/+server.ts
|
|
5
5
|
var POST = async ({ url }) => {
|
|
6
6
|
await refresh(true);
|
|
7
7
|
return Response.json(usage(filtersFrom(url)));
|
|
8
8
|
};
|
|
9
|
-
//#endregion
|
|
10
9
|
export { POST };
|
|
11
10
|
|
|
12
11
|
//# sourceMappingURL=_server.ts.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as settings, r as saveSettings, t as clearUsageMemo } from "../../../../chunks/queries.js";
|
|
2
2
|
import { n as refresh } from "../../../../chunks/refresh.js";
|
|
3
|
-
|
|
3
|
+
// src/routes/api/settings/+server.ts
|
|
4
4
|
var GET = () => Response.json(settings());
|
|
5
5
|
var POST = async ({ request }) => {
|
|
6
6
|
const patch = await request.json();
|
|
@@ -9,7 +9,6 @@ var POST = async ({ request }) => {
|
|
|
9
9
|
if (patch.claudeWindows || patch.prices) await refresh();
|
|
10
10
|
return Response.json(next);
|
|
11
11
|
};
|
|
12
|
-
//#endregion
|
|
13
12
|
export { GET, POST };
|
|
14
13
|
|
|
15
14
|
//# sourceMappingURL=_server.ts.js.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { n as usage } from "../../../../chunks/queries.js";
|
|
2
2
|
import { t as filtersFrom } from "../../../../chunks/request.js";
|
|
3
|
-
|
|
3
|
+
// src/routes/api/usage/+server.ts
|
|
4
4
|
var GET = ({ url }) => Response.json(usage(filtersFrom(url)));
|
|
5
|
-
//#endregion
|
|
6
5
|
export { GET };
|
|
7
6
|
|
|
8
7
|
//# sourceMappingURL=_server.ts.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../chunks/server-errors.js";
|
|
2
2
|
import { p as escape_html, u as getContext } from "../../chunks/server2.js";
|
|
3
3
|
import "../../chunks/index-server.js";
|
|
4
|
-
|
|
4
|
+
// node_modules/@sveltejs/kit/src/runtime/app/state/server.js
|
|
5
5
|
function context() {
|
|
6
6
|
return getContext("__request__");
|
|
7
7
|
}
|
|
@@ -34,14 +34,12 @@ var page = {
|
|
|
34
34
|
return context().page.url;
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
|
|
38
|
-
//#region node_modules/@sveltejs/kit/src/runtime/components/error.svelte
|
|
37
|
+
// node_modules/@sveltejs/kit/src/runtime/components/error.svelte
|
|
39
38
|
function Error($$renderer, $$props) {
|
|
40
39
|
$$renderer.component(($$renderer) => {
|
|
41
40
|
$$renderer.push(`<h1>${escape_html(page.status)}</h1> <p>${escape_html(page.error?.message)}</p>`);
|
|
42
41
|
});
|
|
43
42
|
}
|
|
44
|
-
//#endregion
|
|
45
43
|
export { Error as default };
|
|
46
44
|
|
|
47
45
|
//# sourceMappingURL=error.svelte.js.map
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { i as settings } from "../chunks/queries.js";
|
|
2
2
|
import { t as boot } from "../chunks/refresh.js";
|
|
3
|
-
|
|
3
|
+
// src/hooks.server.ts
|
|
4
4
|
boot();
|
|
5
5
|
/** Stamped on <html> so a dark install doesn't flash white before hydration. */
|
|
6
6
|
var handle = ({ event, resolve }) => resolve(event, { transformPageChunk: ({ html }) => html.replace("%aiusage.theme%", settings().theme === "auto" ? "" : settings().theme) });
|
|
7
|
-
//#endregion
|
|
8
7
|
export { handle };
|
|
9
8
|
|
|
10
9
|
//# sourceMappingURL=hooks.server.js.map
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import "../../chunks/server2.js";
|
|
2
|
-
|
|
2
|
+
// src/routes/+layout.svelte
|
|
3
3
|
function _layout($$renderer, $$props) {
|
|
4
4
|
let { children } = $$props;
|
|
5
5
|
children($$renderer);
|
|
6
6
|
$$renderer.push(`<!---->`);
|
|
7
7
|
}
|
|
8
|
-
//#endregion
|
|
9
8
|
export { _layout as default };
|
|
10
9
|
|
|
11
10
|
//# sourceMappingURL=_layout.svelte.js.map
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { i as settings, n as usage, u as config } from "../../chunks/queries.js";
|
|
2
2
|
import { t as filtersFrom } from "../../chunks/request.js";
|
|
3
|
-
|
|
3
|
+
// src/routes/+page.server.ts
|
|
4
4
|
var load = ({ url }) => ({
|
|
5
5
|
usage: usage(filtersFrom(url)),
|
|
6
6
|
settings: settings(),
|
|
7
7
|
paths: { db: config.dbPath }
|
|
8
8
|
});
|
|
9
|
-
//#endregion
|
|
10
9
|
export { load };
|
|
11
10
|
|
|
12
11
|
//# sourceMappingURL=_page.server.ts.js.map
|