@ipv9/tokentracker-cli 0.39.45 → 0.39.46
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/{Card-2-TQg7P7.js → Card-Bk5BMQ2P.js} +1 -1
- package/dashboard/dist/assets/{DashboardPage-yb9ss9uE.js → DashboardPage-DPP44kwE.js} +1 -1
- package/dashboard/dist/assets/{FadeIn-BOc6XtOK.js → FadeIn-CWvnEI0O.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-C2tIb68P.js → IpCheckPage-BmSn2zKd.js} +1 -1
- package/dashboard/dist/assets/{LimitsPage-BsuLQ9co.js → LimitsPage-CDCccsH_.js} +1 -1
- package/dashboard/dist/assets/{LocalOnlyNotice-C8R9KLef.js → LocalOnlyNotice-D19MhLRF.js} +1 -1
- package/dashboard/dist/assets/{PopoverPopup-BpfseoI7.js → PopoverPopup-D78fYtAs.js} +1 -1
- package/dashboard/dist/assets/{Select-Ctk8zze5.js → Select-CKV1Rvl0.js} +1 -1
- package/dashboard/dist/assets/{SelectItemText-BKZlFyFs.js → SelectItemText-5eDkx616.js} +1 -1
- package/dashboard/dist/assets/{SettingsPage-CQXM8qGU.js → SettingsPage-DIwe50pL.js} +1 -1
- package/dashboard/dist/assets/{SkillsPage-4EMm0eBX.js → SkillsPage-zUzRrWak.js} +1 -1
- package/dashboard/dist/assets/{WidgetsPage-C2sdX5g6.js → WidgetsPage-3yOTNqKD.js} +1 -1
- package/dashboard/dist/assets/{WrappedPage-CLiuEcQZ.js → WrappedPage-DPAnbLdi.js} +1 -1
- package/dashboard/dist/assets/{arrow-up-right-BDkp93DX.js → arrow-up-right-BGg2lx0L.js} +1 -1
- package/dashboard/dist/assets/{download-DZ6SoCSn.js → download-BU4HPPvG.js} +1 -1
- package/dashboard/dist/assets/{format-CaW9kvsA.js → format-vw28c71d.js} +1 -1
- package/dashboard/dist/assets/{limitDisplay-DNU_w4O7.js → limitDisplay-CY5Qlw5s.js} +1 -1
- package/dashboard/dist/assets/{main-DgyymGht.js → main-D9Jo7Pt-.js} +3 -3
- package/dashboard/dist/assets/{mock-data-D6C7Fba3.js → mock-data-B0oPPFnn.js} +1 -1
- package/dashboard/dist/assets/{use-limits-display-prefs-B7cHBa7Y.js → use-limits-display-prefs-BAGMxrq7.js} +1 -1
- package/dashboard/dist/assets/{use-native-settings-BKAzGuxw.js → use-native-settings-C4lSH6qA.js} +1 -1
- package/dashboard/dist/assets/{useCurrency-BVr6Ajuu.js → useCurrency-Dvz0184_.js} +1 -1
- package/dashboard/dist/index.html +1 -1
- package/package.json +1 -1
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/src/lib/rollout.js +14 -7
package/src/lib/rollout.js
CHANGED
|
@@ -6116,8 +6116,10 @@ async function parseGooseIncremental({
|
|
|
6116
6116
|
onProgress,
|
|
6117
6117
|
env,
|
|
6118
6118
|
sqliteOptions,
|
|
6119
|
+
now = () => new Date(),
|
|
6119
6120
|
} = {}) {
|
|
6120
6121
|
await ensureDir(path.dirname(queuePath));
|
|
6122
|
+
const observedAt = now().toISOString();
|
|
6121
6123
|
const resolvedDb = dbPath || resolveGooseDbPath(env || process.env);
|
|
6122
6124
|
const gooseState =
|
|
6123
6125
|
cursors.goose && typeof cursors.goose === "object" ? cursors.goose : {};
|
|
@@ -6132,7 +6134,7 @@ async function parseGooseIncremental({
|
|
|
6132
6134
|
currentMtime = fssync.statSync(resolvedDb).mtimeMs;
|
|
6133
6135
|
} catch (e) {
|
|
6134
6136
|
if (e && e.code === "ENOENT") {
|
|
6135
|
-
cursors.goose = { ...gooseState, sessionTotals, updatedAt:
|
|
6137
|
+
cursors.goose = { ...gooseState, sessionTotals, updatedAt: observedAt };
|
|
6136
6138
|
return { recordsProcessed: 0, eventsAggregated: 0, bucketsQueued: 0 };
|
|
6137
6139
|
}
|
|
6138
6140
|
throw e;
|
|
@@ -6140,7 +6142,7 @@ async function parseGooseIncremental({
|
|
|
6140
6142
|
// mtime short-circuit: skip the full sessions table scan when the DB
|
|
6141
6143
|
// hasn't been touched since the last sync.
|
|
6142
6144
|
if (currentMtime > 0 && currentMtime === cursorDbMtime) {
|
|
6143
|
-
cursors.goose = { ...gooseState, sessionTotals, updatedAt:
|
|
6145
|
+
cursors.goose = { ...gooseState, sessionTotals, updatedAt: observedAt };
|
|
6144
6146
|
return { recordsProcessed: 0, eventsAggregated: 0, bucketsQueued: 0 };
|
|
6145
6147
|
}
|
|
6146
6148
|
|
|
@@ -6155,7 +6157,7 @@ async function parseGooseIncremental({
|
|
|
6155
6157
|
}
|
|
6156
6158
|
|
|
6157
6159
|
if (rows.length === 0) {
|
|
6158
|
-
cursors.goose = { ...gooseState, sessionTotals, updatedAt:
|
|
6160
|
+
cursors.goose = { ...gooseState, sessionTotals, updatedAt: observedAt };
|
|
6159
6161
|
return { recordsProcessed: 0, eventsAggregated: 0, bucketsQueued: 0 };
|
|
6160
6162
|
}
|
|
6161
6163
|
|
|
@@ -6188,6 +6190,7 @@ async function parseGooseIncremental({
|
|
|
6188
6190
|
);
|
|
6189
6191
|
if (totalNow === 0 && inputNow === 0 && outputNow === 0) continue;
|
|
6190
6192
|
|
|
6193
|
+
const hadPreviousSnapshot = Object.prototype.hasOwnProperty.call(sessionTotals, row.id);
|
|
6191
6194
|
const prev = sessionTotals[row.id] || { input: 0, output: 0, total: 0 };
|
|
6192
6195
|
// Goose can wipe a session and re-create with the same id during
|
|
6193
6196
|
// database migration. Treat shrinking cumulative as a reset and emit
|
|
@@ -6213,7 +6216,12 @@ async function parseGooseIncremental({
|
|
|
6213
6216
|
const accountedDelta = dInput + dOutput;
|
|
6214
6217
|
const reasoningDelta = Math.max(0, dTotal - accountedDelta);
|
|
6215
6218
|
|
|
6216
|
-
|
|
6219
|
+
// The first observation has only created_at as a trustworthy timestamp.
|
|
6220
|
+
// Later cumulative deltas belong to this sync's observation bucket so a
|
|
6221
|
+
// long-lived session does not keep growing the day on which it started.
|
|
6222
|
+
const tsIso = hadPreviousSnapshot
|
|
6223
|
+
? observedAt
|
|
6224
|
+
: parseGooseCreatedAt(row.created_at) || observedAt;
|
|
6217
6225
|
const bucketStart = toUtcHalfHourStart(tsIso);
|
|
6218
6226
|
if (!bucketStart) continue;
|
|
6219
6227
|
|
|
@@ -6257,14 +6265,13 @@ async function parseGooseIncremental({
|
|
|
6257
6265
|
}
|
|
6258
6266
|
|
|
6259
6267
|
const bucketsQueued = await enqueueTouchedBuckets({ queuePath, hourlyState, touchedBuckets });
|
|
6260
|
-
|
|
6261
|
-
hourlyState.updatedAt = updatedAt;
|
|
6268
|
+
hourlyState.updatedAt = observedAt;
|
|
6262
6269
|
cursors.hourly = hourlyState;
|
|
6263
6270
|
cursors.goose = {
|
|
6264
6271
|
...gooseState,
|
|
6265
6272
|
sessionTotals,
|
|
6266
6273
|
lastDbMtimeMs: currentMtime,
|
|
6267
|
-
updatedAt,
|
|
6274
|
+
updatedAt: observedAt,
|
|
6268
6275
|
};
|
|
6269
6276
|
|
|
6270
6277
|
return { recordsProcessed, eventsAggregated, bucketsQueued };
|