tokentracker-cli 0.74.2 → 0.74.3
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/dashboard/dist/assets/{ActivityHeatmap-DGqoFvkZ.js → ActivityHeatmap-BafMAx9W.js} +1 -1
- package/dashboard/dist/assets/{Card-CKxmfosU.js → Card-8Bd8CAb6.js} +1 -1
- package/dashboard/dist/assets/{CommunityStatsModal-C6h6BKVI.js → CommunityStatsModal-DmPuBhXR.js} +1 -1
- package/dashboard/dist/assets/{ConfirmModal-wqW-7Vs_.js → ConfirmModal-qOQJtQWz.js} +1 -1
- package/dashboard/dist/assets/{DashboardPage-10hyXbuM.js → DashboardPage-CIj4rc0i.js} +1 -1
- package/dashboard/dist/assets/{DevicePage-DosHEknI.js → DevicePage--kA2oEMa.js} +1 -1
- package/dashboard/dist/assets/{DialogClose-CRzzOKwV.js → DialogClose-xDpygA07.js} +1 -1
- package/dashboard/dist/assets/DialogDescription-BlOEQ8L8.js +1 -0
- package/dashboard/dist/assets/{DialogTitle-CgVdc49w.js → DialogTitle-BN5gEprS.js} +1 -1
- package/dashboard/dist/assets/{FadeIn-CVkirQtu.js → FadeIn-BRq2LC4x.js} +1 -1
- package/dashboard/dist/assets/{HeaderGithubStar-DHW75YEC.js → HeaderGithubStar-CuMldC3D.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-CMOjeIuH.js → IpCheckPage-4zShMjs_.js} +1 -1
- package/dashboard/dist/assets/{LandingPage-Cca1heHL.js → LandingPage-B1JNQaFH.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardAvatar-CVMcytB1.js → LeaderboardAvatar-DEcdzsuO.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardPage-BEfsEAZY.js → LeaderboardPage-BiMyVuMB.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardProfileModal-5LuPOMoM.js → LeaderboardProfileModal-CT8V2JUs.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardProfilePage-DUQOF16T.js → LeaderboardProfilePage-JAWDtAS2.js} +1 -1
- package/dashboard/dist/assets/{LimitsPage-C6cPHrnU.js → LimitsPage-DVrfx-Tm.js} +1 -1
- package/dashboard/dist/assets/{LocalOnlyNotice-B2SjP1L6.js → LocalOnlyNotice-C9jsEf0r.js} +1 -1
- package/dashboard/dist/assets/{LoginPage-D0vP9cX4.js → LoginPage-C0P-5qQf.js} +1 -1
- package/dashboard/dist/assets/{PopoverPopup-AtVz9OM2.js → PopoverPopup-BZRk80zm.js} +1 -1
- package/dashboard/dist/assets/{ResetPasswordPage-6eUhDnAl.js → ResetPasswordPage-CZBZYLsD.js} +1 -1
- package/dashboard/dist/assets/{Select-Dt-nyHat.js → Select-HqdDKqac.js} +1 -1
- package/dashboard/dist/assets/{SelectItemText-CFxs6Ipf.js → SelectItemText-Cr3-Dbm_.js} +1 -1
- package/dashboard/dist/assets/{SettingsPage-Ccv_PRTi.js → SettingsPage-CJjvQVV6.js} +1 -1
- package/dashboard/dist/assets/{SkillsPage-Ckmq2qWZ.js → SkillsPage-oc9Txx0b.js} +1 -1
- package/dashboard/dist/assets/{WidgetsPage-CuMpK7JS.js → WidgetsPage-DFU0Pxce.js} +1 -1
- package/dashboard/dist/assets/{WrappedPage-C3sjJiS5.js → WrappedPage-CZIKLNNr.js} +1 -1
- package/dashboard/dist/assets/{agent-logos-CORiXh7-.js → agent-logos-bzClhaZ-.js} +1 -1
- package/dashboard/dist/assets/{arrow-up-right-D-CX3rHC.js → arrow-up-right-qUo2Y1Qy.js} +1 -1
- package/dashboard/dist/assets/check-B4b-x97-.js +1 -0
- package/dashboard/dist/assets/{copy-BbbIDe0D.js → copy-CUUYn7I1.js} +1 -1
- package/dashboard/dist/assets/{download-CnLKP9Xi.js → download-axvrp1rN.js} +1 -1
- package/dashboard/dist/assets/{format-tokens-Q8buFewN.js → format-tokens-6qg4_b5j.js} +1 -1
- package/dashboard/dist/assets/{info-Bg3JHknV.js → info-BBTjGdkv.js} +1 -1
- package/dashboard/dist/assets/{main-BZBZhXIl.js → main-RV-4ENcy.js} +2 -2
- package/dashboard/dist/assets/{use-community-stats-BBUKlTpE.js → use-community-stats-BPjHC-TF.js} +1 -1
- package/dashboard/dist/assets/{use-limits-display-prefs-Dnl2W8Rt.js → use-limits-display-prefs-DIhS3rlU.js} +1 -1
- package/dashboard/dist/assets/{use-native-settings-DlQEd871.js → use-native-settings-CbgN2r8q.js} +1 -1
- package/dashboard/dist/assets/{use-ordered-list-4WtaZhJf.js → use-ordered-list-pRCDgKHC.js} +1 -1
- package/dashboard/dist/assets/{use-quality-per-dollar-pref-CS0EFKxa.js → use-quality-per-dollar-pref-Bwpb7Wg6.js} +1 -1
- package/dashboard/dist/assets/{use-usage-limits-CJ25xM-V.js → use-usage-limits-D7w2x9yG.js} +1 -1
- package/dashboard/dist/assets/{useCurrency-CaevR9XR.js → useCurrency-Bxm-LITj.js} +1 -1
- package/dashboard/dist/assets/{useScrollLock-BLGPKPXr.js → useScrollLock-CtT9kSow.js} +1 -1
- package/dashboard/dist/index.html +1 -1
- package/dashboard/dist/share.html +1 -1
- package/package.json +1 -1
- package/src/commands/init.js +128 -12
- package/src/commands/serve.js +6 -2
- package/src/commands/status.js +9 -1
- package/src/commands/uninstall.js +4 -0
- package/src/lib/codex-config.js +58 -9
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/dashboard/dist/assets/DialogDescription-DuiVFMP6.js +0 -1
- package/dashboard/dist/assets/check-frbadzCO.js +0 -1
package/src/lib/codex-config.js
CHANGED
|
@@ -3,7 +3,14 @@ const path = require("node:path");
|
|
|
3
3
|
|
|
4
4
|
const { ensureDir, readJson, writeJson } = require("./fs");
|
|
5
5
|
|
|
6
|
-
async function upsertNotify({
|
|
6
|
+
async function upsertNotify({
|
|
7
|
+
configPath,
|
|
8
|
+
notifyCmd,
|
|
9
|
+
notifyOriginalPath,
|
|
10
|
+
configLabel,
|
|
11
|
+
captureOriginal = true,
|
|
12
|
+
replaceOriginal = false,
|
|
13
|
+
}) {
|
|
7
14
|
const originalText = await fs.readFile(configPath, "utf8").catch(() => null);
|
|
8
15
|
if (originalText == null) {
|
|
9
16
|
const label =
|
|
@@ -15,13 +22,16 @@ async function upsertNotify({ configPath, notifyCmd, notifyOriginalPath, configL
|
|
|
15
22
|
const already = arraysEqual(existingNotify, notifyCmd);
|
|
16
23
|
|
|
17
24
|
if (!already) {
|
|
18
|
-
// Persist original notify once (for uninstall + chaining).
|
|
19
|
-
|
|
25
|
+
// Persist original notify once (for uninstall + chaining). When a caller
|
|
26
|
+
// asks to replace the stored original and the config has no notify, record
|
|
27
|
+
// that absence so uninstall does not resurrect a stale backup.
|
|
28
|
+
const hasExistingNotify = Array.isArray(existingNotify);
|
|
29
|
+
if (captureOriginal && (hasExistingNotify || replaceOriginal)) {
|
|
20
30
|
await ensureDir(path.dirname(notifyOriginalPath));
|
|
21
31
|
const existing = await readJson(notifyOriginalPath);
|
|
22
|
-
if (!existing) {
|
|
32
|
+
if (replaceOriginal || !existing) {
|
|
23
33
|
await writeJson(notifyOriginalPath, {
|
|
24
|
-
notify: existingNotify,
|
|
34
|
+
notify: hasExistingNotify ? existingNotify : null,
|
|
25
35
|
capturedAt: new Date().toISOString(),
|
|
26
36
|
});
|
|
27
37
|
}
|
|
@@ -45,6 +55,10 @@ async function restoreNotify({ configPath, notifyOriginalPath, expectedNotify })
|
|
|
45
55
|
const originalNotify = Array.isArray(original?.notify) ? original.notify : null;
|
|
46
56
|
const currentNotify = extractNotify(text);
|
|
47
57
|
|
|
58
|
+
if (expectedNotify && !arraysEqual(currentNotify, expectedNotify)) {
|
|
59
|
+
return { restored: false, skippedReason: "current-not-managed" };
|
|
60
|
+
}
|
|
61
|
+
|
|
48
62
|
if (!originalNotify && expectedNotify && !arraysEqual(currentNotify, expectedNotify)) {
|
|
49
63
|
return { restored: false, skippedReason: "no-backup-not-installed" };
|
|
50
64
|
}
|
|
@@ -69,12 +83,20 @@ async function readNotify(configPath) {
|
|
|
69
83
|
return extractNotify(text);
|
|
70
84
|
}
|
|
71
85
|
|
|
72
|
-
async function upsertCodexNotify({
|
|
86
|
+
async function upsertCodexNotify({
|
|
87
|
+
codexConfigPath,
|
|
88
|
+
notifyCmd,
|
|
89
|
+
notifyOriginalPath,
|
|
90
|
+
captureOriginal = true,
|
|
91
|
+
replaceOriginal = false,
|
|
92
|
+
}) {
|
|
73
93
|
return upsertNotify({
|
|
74
94
|
configPath: codexConfigPath,
|
|
75
95
|
notifyCmd,
|
|
76
96
|
notifyOriginalPath,
|
|
77
97
|
configLabel: "Codex config",
|
|
98
|
+
captureOriginal,
|
|
99
|
+
replaceOriginal,
|
|
78
100
|
});
|
|
79
101
|
}
|
|
80
102
|
|
|
@@ -94,12 +116,20 @@ async function readCodexNotify(codexConfigPath) {
|
|
|
94
116
|
return readNotify(codexConfigPath);
|
|
95
117
|
}
|
|
96
118
|
|
|
97
|
-
async function upsertEveryCodeNotify({
|
|
119
|
+
async function upsertEveryCodeNotify({
|
|
120
|
+
codeConfigPath,
|
|
121
|
+
notifyCmd,
|
|
122
|
+
notifyOriginalPath,
|
|
123
|
+
captureOriginal = true,
|
|
124
|
+
replaceOriginal = false,
|
|
125
|
+
}) {
|
|
98
126
|
return upsertNotify({
|
|
99
127
|
configPath: codeConfigPath,
|
|
100
128
|
notifyCmd,
|
|
101
129
|
notifyOriginalPath,
|
|
102
130
|
configLabel: "Every Code config",
|
|
131
|
+
captureOriginal,
|
|
132
|
+
replaceOriginal,
|
|
103
133
|
});
|
|
104
134
|
}
|
|
105
135
|
|
|
@@ -193,8 +223,7 @@ function removeNotify(text) {
|
|
|
193
223
|
}
|
|
194
224
|
|
|
195
225
|
function parseTomlStringArray(rhs) {
|
|
196
|
-
// Minimal parser for
|
|
197
|
-
// Assumes there are no escapes in strings (good enough for our usage).
|
|
226
|
+
// Minimal parser for TOML basic/literal string arrays.
|
|
198
227
|
if (!rhs.startsWith("[") || !rhs.endsWith("]")) return null;
|
|
199
228
|
const inner = rhs.slice(1, -1).trim();
|
|
200
229
|
if (!inner) return [];
|
|
@@ -219,6 +248,18 @@ function parseTomlStringArray(rhs) {
|
|
|
219
248
|
quote = null;
|
|
220
249
|
continue;
|
|
221
250
|
}
|
|
251
|
+
if (quote === '"' && ch === "\\") {
|
|
252
|
+
if (i + 1 >= inner.length) return null;
|
|
253
|
+
const next = inner[++i];
|
|
254
|
+
if (next === "b") current += "\b";
|
|
255
|
+
else if (next === "t") current += "\t";
|
|
256
|
+
else if (next === "n") current += "\n";
|
|
257
|
+
else if (next === "f") current += "\f";
|
|
258
|
+
else if (next === "r") current += "\r";
|
|
259
|
+
else if (next === '"' || next === "\\" || next === "/") current += next;
|
|
260
|
+
else return null;
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
222
263
|
current += ch;
|
|
223
264
|
}
|
|
224
265
|
|
|
@@ -261,6 +302,10 @@ function readTomlArrayLiteral(lines, startIndex, rhs) {
|
|
|
261
302
|
if (ch === quote) {
|
|
262
303
|
inString = false;
|
|
263
304
|
quote = null;
|
|
305
|
+
continue;
|
|
306
|
+
}
|
|
307
|
+
if (quote === '"' && ch === "\\") {
|
|
308
|
+
i += 1;
|
|
264
309
|
}
|
|
265
310
|
}
|
|
266
311
|
return -1;
|
|
@@ -315,6 +360,10 @@ function findTomlArrayBlockEnd(lines, startIndex, rhs) {
|
|
|
315
360
|
if (ch === quote) {
|
|
316
361
|
inString = false;
|
|
317
362
|
quote = null;
|
|
363
|
+
continue;
|
|
364
|
+
}
|
|
365
|
+
if (quote === '"' && ch === "\\") {
|
|
366
|
+
i += 1;
|
|
318
367
|
}
|
|
319
368
|
}
|
|
320
369
|
return false;
|