tokentracker-cli 0.74.2 → 0.74.4

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.
Files changed (55) hide show
  1. package/dashboard/dist/assets/{ActivityHeatmap-DGqoFvkZ.js → ActivityHeatmap-C7oqary_.js} +1 -1
  2. package/dashboard/dist/assets/{Card-CKxmfosU.js → Card-BCePOeL5.js} +1 -1
  3. package/dashboard/dist/assets/{CommunityStatsModal-C6h6BKVI.js → CommunityStatsModal-CODikgAM.js} +1 -1
  4. package/dashboard/dist/assets/{ConfirmModal-wqW-7Vs_.js → ConfirmModal-D4P6QXYR.js} +1 -1
  5. package/dashboard/dist/assets/{DashboardPage-10hyXbuM.js → DashboardPage-BXNH-zoX.js} +1 -1
  6. package/dashboard/dist/assets/{DevicePage-DosHEknI.js → DevicePage-BoZhWNng.js} +1 -1
  7. package/dashboard/dist/assets/{DialogClose-CRzzOKwV.js → DialogClose-tHsQT_Vp.js} +1 -1
  8. package/dashboard/dist/assets/DialogDescription-D356qUn1.js +1 -0
  9. package/dashboard/dist/assets/{DialogTitle-CgVdc49w.js → DialogTitle-DU9z49D2.js} +1 -1
  10. package/dashboard/dist/assets/{FadeIn-CVkirQtu.js → FadeIn-bLe0eaGz.js} +1 -1
  11. package/dashboard/dist/assets/{HeaderGithubStar-DHW75YEC.js → HeaderGithubStar-Bas7sLdk.js} +1 -1
  12. package/dashboard/dist/assets/{IpCheckPage-CMOjeIuH.js → IpCheckPage-qeSoM4w3.js} +1 -1
  13. package/dashboard/dist/assets/{LandingPage-Cca1heHL.js → LandingPage-PnozFLwt.js} +1 -1
  14. package/dashboard/dist/assets/{LeaderboardAvatar-CVMcytB1.js → LeaderboardAvatar-D-WIXZAr.js} +1 -1
  15. package/dashboard/dist/assets/{LeaderboardPage-BEfsEAZY.js → LeaderboardPage-RHRwgsVh.js} +2 -2
  16. package/dashboard/dist/assets/{LeaderboardProfileModal-5LuPOMoM.js → LeaderboardProfileModal-B7yOwluv.js} +1 -1
  17. package/dashboard/dist/assets/{LeaderboardProfilePage-DUQOF16T.js → LeaderboardProfilePage-C8v53iFy.js} +1 -1
  18. package/dashboard/dist/assets/{LimitsPage-C6cPHrnU.js → LimitsPage-DKBH_uFv.js} +1 -1
  19. package/dashboard/dist/assets/{LocalOnlyNotice-B2SjP1L6.js → LocalOnlyNotice-BEeFbIYU.js} +1 -1
  20. package/dashboard/dist/assets/{LoginPage-D0vP9cX4.js → LoginPage-Q4xGLSh4.js} +1 -1
  21. package/dashboard/dist/assets/{PopoverPopup-AtVz9OM2.js → PopoverPopup-CdXmxime.js} +1 -1
  22. package/dashboard/dist/assets/{ResetPasswordPage-6eUhDnAl.js → ResetPasswordPage-DCq6m3Sx.js} +1 -1
  23. package/dashboard/dist/assets/{Select-Dt-nyHat.js → Select-BFzOQ_Qh.js} +1 -1
  24. package/dashboard/dist/assets/{SelectItemText-CFxs6Ipf.js → SelectItemText-BtYYJp_d.js} +1 -1
  25. package/dashboard/dist/assets/{SettingsPage-Ccv_PRTi.js → SettingsPage-DSKKIFxe.js} +1 -1
  26. package/dashboard/dist/assets/{SkillsPage-Ckmq2qWZ.js → SkillsPage-D0FLWYC3.js} +1 -1
  27. package/dashboard/dist/assets/{WidgetsPage-CuMpK7JS.js → WidgetsPage-D0vf85Gc.js} +1 -1
  28. package/dashboard/dist/assets/{WrappedPage-C3sjJiS5.js → WrappedPage-Dls_m5Ba.js} +1 -1
  29. package/dashboard/dist/assets/{agent-logos-CORiXh7-.js → agent-logos-CZPomuU8.js} +1 -1
  30. package/dashboard/dist/assets/{arrow-up-right-D-CX3rHC.js → arrow-up-right-BsX4uuXC.js} +1 -1
  31. package/dashboard/dist/assets/check-CFNHutnk.js +1 -0
  32. package/dashboard/dist/assets/{copy-BbbIDe0D.js → copy-Irxyg8vw.js} +1 -1
  33. package/dashboard/dist/assets/{download-CnLKP9Xi.js → download-BO6E5SiF.js} +1 -1
  34. package/dashboard/dist/assets/{format-tokens-Q8buFewN.js → format-tokens-BmI1AkBm.js} +1 -1
  35. package/dashboard/dist/assets/{info-Bg3JHknV.js → info-BZoIZTYL.js} +1 -1
  36. package/dashboard/dist/assets/{main-BZBZhXIl.js → main-C6oRShLQ.js} +2 -2
  37. package/dashboard/dist/assets/{use-community-stats-BBUKlTpE.js → use-community-stats-B-yz2TUw.js} +1 -1
  38. package/dashboard/dist/assets/{use-limits-display-prefs-Dnl2W8Rt.js → use-limits-display-prefs-DA9uTJQz.js} +1 -1
  39. package/dashboard/dist/assets/{use-native-settings-DlQEd871.js → use-native-settings-DpsyM_fO.js} +1 -1
  40. package/dashboard/dist/assets/{use-ordered-list-4WtaZhJf.js → use-ordered-list-DAaD_oBC.js} +1 -1
  41. package/dashboard/dist/assets/{use-quality-per-dollar-pref-CS0EFKxa.js → use-quality-per-dollar-pref-akRSCZ4W.js} +1 -1
  42. package/dashboard/dist/assets/{use-usage-limits-CJ25xM-V.js → use-usage-limits-B9TQcAWp.js} +1 -1
  43. package/dashboard/dist/assets/{useCurrency-CaevR9XR.js → useCurrency-DTQa3vND.js} +1 -1
  44. package/dashboard/dist/assets/{useScrollLock-BLGPKPXr.js → useScrollLock-YAMmPQRR.js} +1 -1
  45. package/dashboard/dist/index.html +1 -1
  46. package/dashboard/dist/share.html +1 -1
  47. package/package.json +1 -1
  48. package/src/commands/init.js +128 -12
  49. package/src/commands/serve.js +6 -2
  50. package/src/commands/status.js +9 -1
  51. package/src/commands/uninstall.js +4 -0
  52. package/src/lib/codex-config.js +58 -9
  53. package/src/lib/pricing/seed-snapshot.json +1 -1
  54. package/dashboard/dist/assets/DialogDescription-DuiVFMP6.js +0 -1
  55. package/dashboard/dist/assets/check-frbadzCO.js +0 -1
@@ -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({ configPath, notifyCmd, notifyOriginalPath, configLabel }) {
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
- if (existingNotify && existingNotify.length > 0) {
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({ codexConfigPath, notifyCmd, notifyOriginalPath }) {
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({ codeConfigPath, notifyCmd, notifyOriginalPath }) {
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 ["a", "b"] string arrays.
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;