tokentracker-cli 0.88.7 → 0.88.8
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/README.de.md +4 -4
- package/README.ja.md +3 -3
- package/README.ko.md +3 -3
- package/README.md +6 -5
- package/README.zh-CN.md +5 -4
- package/dashboard/dist/assets/{AchievementBadge-m7oaBLpH.js → AchievementBadge-CzfK_8kl.js} +1 -1
- package/dashboard/dist/assets/{AchievementsPage-BHHh4VjM.js → AchievementsPage-PVft5lyI.js} +2 -2
- package/dashboard/dist/assets/{AchievementsSection-CGLNe_1p.js → AchievementsSection-DyzHGzys.js} +1 -1
- package/dashboard/dist/assets/{BadgeDetailModal-v1DGF6EM.js → BadgeDetailModal-CFsRpXG1.js} +1 -1
- package/dashboard/dist/assets/{Card-C16SqIR8.js → Card-Bi9dmQTP.js} +1 -1
- package/dashboard/dist/assets/{ClawdAnimated-Bj3ptLJv.js → ClawdAnimated-BxcZjV9b.js} +1 -1
- package/dashboard/dist/assets/{CommandPalette-BaegDLAM.js → CommandPalette-DHVK5yTu.js} +1 -1
- package/dashboard/dist/assets/{CommunityStatsModal-CThxVFG0.js → CommunityStatsModal-BmMh7Avp.js} +1 -1
- package/dashboard/dist/assets/{ConfirmModal-C0sP3Ktk.js → ConfirmModal-BjTQXMg4.js} +1 -1
- package/dashboard/dist/assets/{Controls-C8usK6RW.js → Controls-CZUbEggT.js} +1 -1
- package/dashboard/dist/assets/DashboardPage-C3x4Hew6.js +1 -0
- package/dashboard/dist/assets/{DevicePage-Cu4qqRcB.js → DevicePage-1qf6aiEH.js} +1 -1
- package/dashboard/dist/assets/{DialogClose-DVo3jJb6.js → DialogClose-CRrlkVf0.js} +1 -1
- package/dashboard/dist/assets/DialogDescription-tD0gEESM.js +1 -0
- package/dashboard/dist/assets/{DialogTitle-C1UOMgTZ.js → DialogTitle-DhGyZ0Ue.js} +1 -1
- package/dashboard/dist/assets/{FadeIn-CuQlQrvO.js → FadeIn-M8ECNbPG.js} +1 -1
- package/dashboard/dist/assets/{HeaderGithubStar-BTt2612H.js → HeaderGithubStar-BKtQc1Si.js} +1 -1
- package/dashboard/dist/assets/{HoverTooltip-CHdLolcf.js → HoverTooltip-Bo1zVtke.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-BFz8hr_3.js → IpCheckPage-B78HcgA1.js} +1 -1
- package/dashboard/dist/assets/{LandingPage-CTyNSAYl.js → LandingPage-DSlanH3Y.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardAvatar-CBdOXZWk.js → LeaderboardAvatar-Cs4IYwTC.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardPage-DStx51Bj.js → LeaderboardPage-DXlo-PNE.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardProfileModal-CtxgJR07.js → LeaderboardProfileModal-CVM6FjLt.js} +3 -3
- package/dashboard/dist/assets/{LeaderboardProfilePage-DrpsHTdZ.js → LeaderboardProfilePage-BO-MTMcH.js} +1 -1
- package/dashboard/dist/assets/{LimitsPage-m_itA-7d.js → LimitsPage-BohIYn9J.js} +1 -1
- package/dashboard/dist/assets/{LocalOnlyNotice-A62wFwYT.js → LocalOnlyNotice-BQ7eYwB8.js} +1 -1
- package/dashboard/dist/assets/{LoginCard-DFJugNa-.js → LoginCard-DhOJyCcc.js} +1 -1
- package/dashboard/dist/assets/{LoginModal-DF4BOwS6.js → LoginModal-Dfo2DSA9.js} +1 -1
- package/dashboard/dist/assets/{LoginPage-BxFhfitr.js → LoginPage-CN-cXdsD.js} +1 -1
- package/dashboard/dist/assets/{PetPage-l4fkRsf1.js → PetPage-CQY2YUNm.js} +1 -1
- package/dashboard/dist/assets/{PopoverPopup-y-OAHy4v.js → PopoverPopup-D0bYgqkq.js} +1 -1
- package/dashboard/dist/assets/{ProviderIcon-DwoPHz27.js → ProviderIcon-BfiriW8d.js} +1 -1
- package/dashboard/dist/assets/{ResetPasswordPage-CCDj94rl.js → ResetPasswordPage-CQyX1BF6.js} +1 -1
- package/dashboard/dist/assets/{SegmentedControl-lEKPzZlV.js → SegmentedControl-DWhf_XGR.js} +1 -1
- package/dashboard/dist/assets/{Select-DoyUBoxn.js → Select-Dy6krqIZ.js} +1 -1
- package/dashboard/dist/assets/{SelectItemText-K8Vzn1Dd.js → SelectItemText-D1296h92.js} +1 -1
- package/dashboard/dist/assets/{ServiceStatusPage-Cqyo7OtW.js → ServiceStatusPage-BgC3i1y-.js} +1 -1
- package/dashboard/dist/assets/{SessionsPage-BELC-8aJ.js → SessionsPage-Dyq0Q8tm.js} +1 -1
- package/dashboard/dist/assets/{SettingsPage-C6Og4tMS.js → SettingsPage-QCZksfny.js} +1 -1
- package/dashboard/dist/assets/{SkillsPage-BKKgpXc_.js → SkillsPage-BUWMr2_o.js} +1 -1
- package/dashboard/dist/assets/{TokenGalaxy-DoSCQSpY.js → TokenGalaxy-BHauFZfa.js} +1 -1
- package/dashboard/dist/assets/{ToolbarRootContext-GoQP9LXi.js → ToolbarRootContext-1sViYfay.js} +1 -1
- package/dashboard/dist/assets/{TrendMonitor-BHE1KkJ7.js → TrendMonitor-DM26Zn7d.js} +1 -1
- package/dashboard/dist/assets/{WidgetsPage-CHBzNb19.js → WidgetsPage-DhjPczRN.js} +1 -1
- package/dashboard/dist/assets/{WrappedPage-CW_kqVoY.js → WrappedPage-BsEFzfrx.js} +1 -1
- package/dashboard/dist/assets/{__vite-browser-external-BgeLzJ0q.js → __vite-browser-external-BW4ueyBB.js} +6 -3
- package/dashboard/dist/assets/agent-logos-IRTgTlkV.js +1 -0
- package/dashboard/dist/assets/{arrow-up-right-5GGSSEKW.js → arrow-up-right-BapNuXPQ.js} +1 -1
- package/dashboard/dist/assets/{check-g6Fq4TSB.js → check-lpIv67Hh.js} +1 -1
- package/dashboard/dist/assets/{chevron-right-DjPuavEP.js → chevron-right-jYAPg2OX.js} +1 -1
- package/dashboard/dist/assets/{copy-BAMl60zT.js → copy-CEdsXYF2.js} +1 -1
- package/dashboard/dist/assets/{download-BQPhL4h5.js → download-CGJA0mZj.js} +1 -1
- package/dashboard/dist/assets/{external-link-CU3XKMbZ.js → external-link-DTmmieCB.js} +1 -1
- package/dashboard/dist/assets/{flame-B85YY_rB.js → flame-C-orSEmd.js} +1 -1
- package/dashboard/dist/assets/{format-tokens-DDxlnhNV.js → format-tokens-BQuK3UBV.js} +1 -1
- package/dashboard/dist/assets/{icons-D1e1TWTe.js → icons-DuVOMXCd.js} +1 -1
- package/dashboard/dist/assets/{index-CWMkVmon.js → index-5hluBV6Y.js} +1 -1
- package/dashboard/dist/assets/{index-BZ2hkHKk.js → index-CKG-dDk-.js} +1 -1
- package/dashboard/dist/assets/{index-sQl-P7u5.js → index-DvLGX2GN.js} +1 -1
- package/dashboard/dist/assets/{info-DlSYpCFm.js → info-EKHZ3tlo.js} +1 -1
- package/dashboard/dist/assets/{limits-providers-DS5EIbJK.js → limits-providers-DgnwvabV.js} +1 -1
- package/dashboard/dist/assets/{link-2-DbEVoNk-.js → link-2-A2f7492I.js} +1 -1
- package/dashboard/dist/assets/{loader-circle-CqmzGIX-.js → loader-circle-DiBM_0cy.js} +1 -1
- package/dashboard/dist/assets/{maximize-2-Ce8X8kHQ.js → maximize-2-CmJrrSbJ.js} +1 -1
- package/dashboard/dist/assets/{modifiers.esm-BQNRpVcA.js → modifiers.esm-v5P5znue.js} +1 -1
- package/dashboard/dist/assets/{monitor-smartphone-8drugZmh.js → monitor-smartphone-jmB0EaLx.js} +1 -1
- package/dashboard/dist/assets/{provider-display-BayTojFu.js → provider-display-BJXN_8Ft.js} +2 -2
- package/dashboard/dist/assets/{react-BfgySeLu.js → react-DRhZt4b6.js} +1 -1
- package/dashboard/dist/assets/{search-BkGUxlXI.js → search-D9j_51N0.js} +1 -1
- package/dashboard/dist/assets/{skills-api-D80JxFc1.js → skills-api-Dywy4E7M.js} +1 -1
- package/dashboard/dist/assets/{sortable.esm-SjRQ4Ehw.js → sortable.esm-BYYlH2M3.js} +1 -1
- package/dashboard/dist/assets/{store-B3WkWBgn.js → store-Dt6GNo2E.js} +1 -1
- package/dashboard/dist/assets/{terminal-CIvEvMau.js → terminal-BfWjr1gW.js} +1 -1
- package/dashboard/dist/assets/{trash-2-BZclE0mU.js → trash-2-Ceal5Y6z.js} +1 -1
- package/dashboard/dist/assets/{use-community-stats-ChaFzJoW.js → use-community-stats-2G4i1ZwJ.js} +1 -1
- package/dashboard/dist/assets/{use-limits-display-prefs-2LALdqvT.js → use-limits-display-prefs--qpfQM72.js} +1 -1
- package/dashboard/dist/assets/{use-ordered-list-10Nmxw1I.js → use-ordered-list-BRg8W35v.js} +1 -1
- package/dashboard/dist/assets/use-reduced-motion-BDYfqZDy.js +1 -0
- package/dashboard/dist/assets/{use-session-efficiency-pref-CqPK4jX1.js → use-session-efficiency-pref-DHwJtj_8.js} +1 -1
- package/dashboard/dist/assets/{use-transform-s6og1tg9.js → use-transform-DaIhV0Zy.js} +1 -1
- package/dashboard/dist/assets/{use-usage-limits-jyRJ_kl9.js → use-usage-limits-COggDJdz.js} +1 -1
- package/dashboard/dist/assets/{useCurrency-hZfdhfqK.js → useCurrency-0g-kQuZf.js} +1 -1
- package/dashboard/dist/assets/{useScrollLock-DFF4vpw2.js → useScrollLock-CMMjcyJf.js} +1 -1
- package/dashboard/dist/assets/{useTokenFormat-DaVdoRvh.js → useTokenFormat-BuVZXkVC.js} +1 -1
- package/dashboard/dist/assets/{zap-B1XMdyCV.js → zap-BhYCdFZP.js} +1 -1
- package/dashboard/dist/brand-logos/reasonix.png +0 -0
- package/dashboard/dist/index.html +9 -9
- package/dashboard/dist/ip-check.html +1 -1
- package/dashboard/dist/leaderboard.html +1 -1
- package/dashboard/dist/llms.txt +3 -2
- package/dashboard/dist/share.html +1 -1
- package/package.json +2 -2
- package/src/commands/init.js +10 -0
- package/src/commands/status.js +27 -5
- package/src/commands/sync.js +177 -5
- package/src/lib/install-resolver.js +35 -0
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/src/lib/rollout.js +768 -0
- package/src/lib/subscriptions.js +1 -0
- package/src/lib/usage-limits.js +17 -2
- package/dashboard/dist/assets/DashboardPage-DbzbT_cY.js +0 -1
- package/dashboard/dist/assets/DialogDescription-zf3KGPP3.js +0 -1
- package/dashboard/dist/assets/agent-logos-BWeWRlms.js +0 -1
- package/dashboard/dist/assets/use-reduced-motion-J12KnTgP.js +0 -1
package/src/commands/status.js
CHANGED
|
@@ -62,6 +62,8 @@ const {
|
|
|
62
62
|
piAgentDirCollidesWithOmp,
|
|
63
63
|
resolveCraftSessionFiles,
|
|
64
64
|
resolveCraftConfigDir,
|
|
65
|
+
resolveReasonixHome,
|
|
66
|
+
resolveReasonixTelemetryFiles,
|
|
65
67
|
resolveKilocodeTaskFiles,
|
|
66
68
|
resolveRoocodeTaskFiles,
|
|
67
69
|
resolveZedDbPath,
|
|
@@ -72,6 +74,8 @@ const {
|
|
|
72
74
|
resolveGooseDbPath,
|
|
73
75
|
listDroidSettingsFiles,
|
|
74
76
|
resolveDroidSessionsDir,
|
|
77
|
+
resolveDshHome,
|
|
78
|
+
resolveDshSessionFiles,
|
|
75
79
|
resolveTraeStoragePath,
|
|
76
80
|
readTraeEntitlementFromStorage,
|
|
77
81
|
resolveGrokBuildSessions,
|
|
@@ -85,7 +89,7 @@ const {
|
|
|
85
89
|
} = require("../lib/rollout");
|
|
86
90
|
const wsl = require("../lib/wsl-probe");
|
|
87
91
|
const { getWslMode, isInvalidWslMode, shouldProbeWsl, discoverWslHome } = wsl;
|
|
88
|
-
const { resolveInstallPaths } = require("../lib/install-resolver");
|
|
92
|
+
const { resolveInstallPaths, resolveZcodeNativeDbPath } = require("../lib/install-resolver");
|
|
89
93
|
const { probeGrokHookState, resolveGrokHome } = require("../lib/grok-hook");
|
|
90
94
|
const { probeOmpHookState } = require("../lib/omp-hook");
|
|
91
95
|
|
|
@@ -428,6 +432,11 @@ async function cmdStatus(argv = []) {
|
|
|
428
432
|
const craftInstalled = Boolean(craftConfigDir && fssync.existsSync(craftConfigDir));
|
|
429
433
|
const craftFiles = craftInstalled ? resolveCraftSessionFiles(process.env) : [];
|
|
430
434
|
|
|
435
|
+
// Reasonix — passive scan of content-free cumulative telemetry sidecars.
|
|
436
|
+
const reasonixHome = resolveReasonixHome(process.env);
|
|
437
|
+
const reasonixInstalled = Boolean(reasonixHome && fssync.existsSync(reasonixHome));
|
|
438
|
+
const reasonixFiles = reasonixInstalled ? resolveReasonixTelemetryFiles(process.env) : [];
|
|
439
|
+
|
|
431
440
|
// Kilo CLI (kilo.ai @kilocode/plugin) — passive scan of kilo.db.
|
|
432
441
|
const xdgDataHome = process.env.XDG_DATA_HOME || path.join(home, ".local", "share");
|
|
433
442
|
const kiloHome = process.env.KILO_HOME || path.join(xdgDataHome, "kilo");
|
|
@@ -456,10 +465,7 @@ async function cmdStatus(argv = []) {
|
|
|
456
465
|
const mimoDbPath = mimoActive.join(" | ");
|
|
457
466
|
|
|
458
467
|
// ZCode (Z.ai's coding agent — OpenCode-fork SQLite) — passive scan of db.sqlite.
|
|
459
|
-
const
|
|
460
|
-
const zcodeNativeValue = process.platform === "win32" && typeof process.env.APPDATA === "string"
|
|
461
|
-
? path.join(process.env.APPDATA.trim(), ".zcode", "cli", "db", "db.sqlite")
|
|
462
|
-
: path.join(zcodeHome, "cli", "db", "db.sqlite");
|
|
468
|
+
const zcodeNativeValue = resolveZcodeNativeDbPath({ home });
|
|
463
469
|
const wslZcodeDir = process.platform === "win32" && wsl.shouldProbeWsl(process.env)
|
|
464
470
|
? wsl.discoverWslHome(".zcode")
|
|
465
471
|
: null;
|
|
@@ -613,6 +619,10 @@ async function cmdStatus(argv = []) {
|
|
|
613
619
|
const droidSessionsDir = resolveDroidSessionsDir(process.env);
|
|
614
620
|
const droidSettingsFiles = listDroidSettingsFiles(process.env);
|
|
615
621
|
const droidInstalled = droidSettingsFiles.length > 0;
|
|
622
|
+
const dshHome = resolveDshHome(process.env);
|
|
623
|
+
const dshSessionsDir = path.join(dshHome, "sessions");
|
|
624
|
+
const dshSessionFiles = await resolveDshSessionFiles(process.env);
|
|
625
|
+
const dshInstalled = dshSessionFiles.length > 0;
|
|
616
626
|
|
|
617
627
|
// Trae SOLO (ByteDance AI IDE) — passive entitlement snapshot reader.
|
|
618
628
|
const traeStoragePath = resolveTraeStoragePath(process.env);
|
|
@@ -866,6 +876,9 @@ async function cmdStatus(argv = []) {
|
|
|
866
876
|
craft: craftInstalled
|
|
867
877
|
? { installed: true, files: craftFiles.length }
|
|
868
878
|
: { installed: false },
|
|
879
|
+
reasonix: reasonixInstalled
|
|
880
|
+
? { installed: true, files: reasonixFiles.length }
|
|
881
|
+
: { installed: false },
|
|
869
882
|
anythingllm: anythingllmInstalled
|
|
870
883
|
? { installed: true, detail: anythingllmDbPath }
|
|
871
884
|
: { installed: false },
|
|
@@ -900,6 +913,9 @@ async function cmdStatus(argv = []) {
|
|
|
900
913
|
droid: droidInstalled
|
|
901
914
|
? { installed: true, files: droidSettingsFiles.length, detail: droidSessionsDir }
|
|
902
915
|
: { installed: false },
|
|
916
|
+
dsh: dshInstalled
|
|
917
|
+
? { installed: true, files: dshSessionFiles.length, detail: dshSessionsDir }
|
|
918
|
+
: { installed: false },
|
|
903
919
|
trae: traeInstalled
|
|
904
920
|
? {
|
|
905
921
|
installed: true,
|
|
@@ -1001,6 +1017,9 @@ async function cmdStatus(argv = []) {
|
|
|
1001
1017
|
craftInstalled
|
|
1002
1018
|
? `- Craft Agents: passive reader (${craftFiles.length} session jsonl file${craftFiles.length !== 1 ? "s" : ""} found)`
|
|
1003
1019
|
: null,
|
|
1020
|
+
reasonixInstalled
|
|
1021
|
+
? `- Reasonix: passive reader (${reasonixFiles.length} telemetry file${reasonixFiles.length !== 1 ? "s" : ""} found)`
|
|
1022
|
+
: null,
|
|
1004
1023
|
anythingllmInstalled
|
|
1005
1024
|
? `- AnythingLLM Desktop: passive reader (${anythingllmDbPath})`
|
|
1006
1025
|
: null,
|
|
@@ -1059,6 +1078,9 @@ async function cmdStatus(argv = []) {
|
|
|
1059
1078
|
droidInstalled
|
|
1060
1079
|
? `- Droid (Factory): passive reader (${droidSettingsFiles.length} session${droidSettingsFiles.length !== 1 ? "s" : ""} in ${droidSessionsDir}, cumulative-delta)`
|
|
1061
1080
|
: null,
|
|
1081
|
+
dshInstalled
|
|
1082
|
+
? `- DeepSeek Harness: passive reader (${dshSessionFiles.length} session${dshSessionFiles.length !== 1 ? "s" : ""} in ${dshSessionsDir})`
|
|
1083
|
+
: null,
|
|
1062
1084
|
traeInstalled
|
|
1063
1085
|
// Deliberately NOT "passive reader": every other line with that wording
|
|
1064
1086
|
// means tokens are being counted. Trae encrypts its session transcripts
|
package/src/commands/sync.js
CHANGED
|
@@ -5,7 +5,7 @@ const fssync = require("node:fs");
|
|
|
5
5
|
const cp = require("node:child_process");
|
|
6
6
|
const readline = require("node:readline");
|
|
7
7
|
|
|
8
|
-
const { resolveInstallPaths, ensureFlatCursor } = require("../lib/install-resolver");
|
|
8
|
+
const { resolveInstallPaths, resolveZcodeNativeDbPath, ensureFlatCursor } = require("../lib/install-resolver");
|
|
9
9
|
const { multiInstallParse, mergeBothFileSources } = require("../lib/multi-install-parser");
|
|
10
10
|
const wsl = require("../lib/wsl-probe");
|
|
11
11
|
const {
|
|
@@ -80,6 +80,8 @@ const {
|
|
|
80
80
|
piAgentDirCollidesWithOmp,
|
|
81
81
|
resolveCraftSessionFiles,
|
|
82
82
|
parseCraftIncremental,
|
|
83
|
+
resolveReasonixTelemetryFiles,
|
|
84
|
+
parseReasonixIncremental,
|
|
83
85
|
resolveGrokBuildSessions,
|
|
84
86
|
parseGrokBuildIncremental,
|
|
85
87
|
listAntigravityTranscripts,
|
|
@@ -106,6 +108,8 @@ const {
|
|
|
106
108
|
parseDroidIncremental,
|
|
107
109
|
droidSessionIdFromPath,
|
|
108
110
|
resolveDroidModel,
|
|
111
|
+
resolveDshSessionFiles,
|
|
112
|
+
parseDshIncremental,
|
|
109
113
|
bucketKey,
|
|
110
114
|
toUtcHalfHourStart,
|
|
111
115
|
totalsKey,
|
|
@@ -244,8 +248,10 @@ const CODEX_COLD_SCAN_AUDIT_MAX_SYNCS = 288;
|
|
|
244
248
|
// one-time repair purges all source=mimo data from the local queues + cursor
|
|
245
249
|
// state so the next sync (providerID-filtered reader) rebuilds it correctly.
|
|
246
250
|
const MIMO_PROVIDER_REPAIR_KEY = "mimoClaudeMislabelRepair_2026_06";
|
|
251
|
+
const DSH_LEGACY_SOURCE_MIGRATION_KEY = "deepseekHarnessSourceMigration_2026_08";
|
|
247
252
|
const AUTO_SYNC_SOURCE_ALIASES = new Map([
|
|
248
253
|
["code", "every-code"],
|
|
254
|
+
["deepseek", "dsh"],
|
|
249
255
|
["everycode", "every-code"],
|
|
250
256
|
["kilo", "kilo-cli"],
|
|
251
257
|
["kilo-code", "kilocode"],
|
|
@@ -263,6 +269,7 @@ const AUTO_SYNC_SOURCES = new Set([
|
|
|
263
269
|
"craft",
|
|
264
270
|
"cursor",
|
|
265
271
|
"droid",
|
|
272
|
+
"dsh",
|
|
266
273
|
"every-code",
|
|
267
274
|
"gemini",
|
|
268
275
|
"goose",
|
|
@@ -280,6 +287,7 @@ const AUTO_SYNC_SOURCES = new Set([
|
|
|
280
287
|
"pi",
|
|
281
288
|
"qoder",
|
|
282
289
|
"qoder-cn",
|
|
290
|
+
"reasonix",
|
|
283
291
|
"roocode",
|
|
284
292
|
"workbuddy",
|
|
285
293
|
"zcode",
|
|
@@ -289,6 +297,7 @@ const BACKGROUND_AUTO_SYNC_SOURCES = new Set([
|
|
|
289
297
|
// Keep unscoped native 5-minute syncs bounded to dated local session trees.
|
|
290
298
|
"codex",
|
|
291
299
|
"every-code",
|
|
300
|
+
"reasonix",
|
|
292
301
|
]);
|
|
293
302
|
|
|
294
303
|
function warnProviderParseFailure(label, err, opts) {
|
|
@@ -576,7 +585,6 @@ async function cmdSync(argv, context = {}) {
|
|
|
576
585
|
const xdgDataHome = process.env.XDG_DATA_HOME || path.join(home, ".local", "share");
|
|
577
586
|
const kiloHome = process.env.KILO_HOME || path.join(xdgDataHome, "kilo");
|
|
578
587
|
const mimoHome = process.env.MIMO_HOME || path.join(xdgDataHome, "mimocode");
|
|
579
|
-
const zcodeHome = process.env.ZCODE_HOME || path.join(home, ".zcode");
|
|
580
588
|
|
|
581
589
|
// OpenClaw session plugin integration: lifecycle hooks request an
|
|
582
590
|
// OpenClaw-only auto sync so unrelated providers do not get walked.
|
|
@@ -1369,9 +1377,7 @@ async function cmdSync(argv, context = {}) {
|
|
|
1369
1377
|
// ── ZCode (Z.ai's coding agent — OpenCode-fork SQLite) ──
|
|
1370
1378
|
let zcodeResult = { recordsProcessed: 0, eventsAggregated: 0, bucketsQueued: 0 };
|
|
1371
1379
|
if (sourceAllowed("zcode")) {
|
|
1372
|
-
const zcodeNativeValue =
|
|
1373
|
-
? path.join(process.env.APPDATA.trim(), ".zcode", "cli", "db", "db.sqlite")
|
|
1374
|
-
: path.join(zcodeHome, "cli", "db", "db.sqlite");
|
|
1380
|
+
const zcodeNativeValue = resolveZcodeNativeDbPath({ home });
|
|
1375
1381
|
const wslZcodeDir = process.platform === "win32" && wsl.shouldProbeWsl(process.env)
|
|
1376
1382
|
? wsl.discoverWslHome(".zcode")
|
|
1377
1383
|
: null;
|
|
@@ -1398,6 +1404,32 @@ async function cmdSync(argv, context = {}) {
|
|
|
1398
1404
|
};
|
|
1399
1405
|
}
|
|
1400
1406
|
|
|
1407
|
+
// ── DeepSeek Harness — passive read of ~/.dsh/sessions session logs ──
|
|
1408
|
+
let dshResult = { recordsProcessed: 0, eventsAggregated: 0, bucketsQueued: 0 };
|
|
1409
|
+
if (sourceAllowed("dsh")) {
|
|
1410
|
+
await migrateLegacyDeepseekHarnessSource({ cursors, queuePath, queueStatePath });
|
|
1411
|
+
const dshSessionFiles = await resolveDshSessionFiles(process.env);
|
|
1412
|
+
if (dshSessionFiles.length > 0) {
|
|
1413
|
+
if (progress?.enabled) {
|
|
1414
|
+
progress.start(
|
|
1415
|
+
`Parsing DeepSeek Harness ${renderBar(0)} 0/${formatNumber(
|
|
1416
|
+
dshSessionFiles.length,
|
|
1417
|
+
)} sessions | buckets 0`,
|
|
1418
|
+
);
|
|
1419
|
+
}
|
|
1420
|
+
try {
|
|
1421
|
+
dshResult = await parseDshIncremental({
|
|
1422
|
+
sessionFiles: dshSessionFiles,
|
|
1423
|
+
cursors,
|
|
1424
|
+
queuePath,
|
|
1425
|
+
onProgress: makeProviderProgress("DeepSeek Harness"),
|
|
1426
|
+
});
|
|
1427
|
+
} catch (err) {
|
|
1428
|
+
warnProviderParseFailure("DeepSeek Harness", err, opts);
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1401
1433
|
// ── AnythingLLM Desktop (workspace_chats.response.metrics) ──
|
|
1402
1434
|
let anythingllmResult = { recordsProcessed: 0, eventsAggregated: 0, bucketsQueued: 0 };
|
|
1403
1435
|
if (sourceAllowed("anythingllm")) {
|
|
@@ -2075,6 +2107,25 @@ async function cmdSync(argv, context = {}) {
|
|
|
2075
2107
|
}
|
|
2076
2108
|
}
|
|
2077
2109
|
|
|
2110
|
+
// Reasonix — content-free cumulative telemetry sidecars only.
|
|
2111
|
+
let reasonixResult = { recordsProcessed: 0, eventsAggregated: 0, bucketsQueued: 0 };
|
|
2112
|
+
const reasonixFiles = sourceAllowed("reasonix")
|
|
2113
|
+
? mergeBothFileSources({ resolveFiles: resolveReasonixTelemetryFiles, env: process.env })
|
|
2114
|
+
: [];
|
|
2115
|
+
if (reasonixFiles.length > 0) {
|
|
2116
|
+
try {
|
|
2117
|
+
reasonixResult = await parseReasonixIncremental({
|
|
2118
|
+
telemetryFiles: reasonixFiles,
|
|
2119
|
+
cursors,
|
|
2120
|
+
queuePath,
|
|
2121
|
+
env: process.env,
|
|
2122
|
+
onProgress: makeProviderProgress("Reasonix"),
|
|
2123
|
+
});
|
|
2124
|
+
} catch (err) {
|
|
2125
|
+
warnProviderParseFailure("Reasonix", err, opts);
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
|
|
2078
2129
|
// ── Grok Build (xAI) ──
|
|
2079
2130
|
let grokResult = { recordsProcessed: 0, eventsAggregated: 0, bucketsQueued: 0 };
|
|
2080
2131
|
// Full passive scan of all Grok sessions (historical + any not covered by hook)
|
|
@@ -2513,6 +2564,7 @@ async function cmdSync(argv, context = {}) {
|
|
|
2513
2564
|
ompResult.recordsProcessed +
|
|
2514
2565
|
piResult.recordsProcessed +
|
|
2515
2566
|
craftResult.recordsProcessed +
|
|
2567
|
+
reasonixResult.recordsProcessed +
|
|
2516
2568
|
grokResult.recordsProcessed +
|
|
2517
2569
|
copilotResult.recordsProcessed +
|
|
2518
2570
|
anythingllmResult.recordsProcessed +
|
|
@@ -2523,6 +2575,7 @@ async function cmdSync(argv, context = {}) {
|
|
|
2523
2575
|
roocodeResult.recordsProcessed +
|
|
2524
2576
|
zedResult.recordsProcessed +
|
|
2525
2577
|
gooseResult.recordsProcessed +
|
|
2578
|
+
dshResult.recordsProcessed +
|
|
2526
2579
|
droidResult.recordsProcessed;
|
|
2527
2580
|
const totalBuckets =
|
|
2528
2581
|
parseResult.bucketsQueued +
|
|
@@ -2545,6 +2598,7 @@ async function cmdSync(argv, context = {}) {
|
|
|
2545
2598
|
ompResult.bucketsQueued +
|
|
2546
2599
|
piResult.bucketsQueued +
|
|
2547
2600
|
craftResult.bucketsQueued +
|
|
2601
|
+
reasonixResult.bucketsQueued +
|
|
2548
2602
|
grokResult.bucketsQueued +
|
|
2549
2603
|
copilotResult.bucketsQueued +
|
|
2550
2604
|
anythingllmResult.bucketsQueued +
|
|
@@ -2555,6 +2609,7 @@ async function cmdSync(argv, context = {}) {
|
|
|
2555
2609
|
roocodeResult.bucketsQueued +
|
|
2556
2610
|
zedResult.bucketsQueued +
|
|
2557
2611
|
gooseResult.bucketsQueued +
|
|
2612
|
+
dshResult.bucketsQueued +
|
|
2558
2613
|
droidResult.bucketsQueued;
|
|
2559
2614
|
const skipNoOpCursorCommit =
|
|
2560
2615
|
opts.auto &&
|
|
@@ -2888,6 +2943,8 @@ module.exports = {
|
|
|
2888
2943
|
repairCodebuddyLogJsonlOverlap,
|
|
2889
2944
|
repairWorkbuddyContextUsage,
|
|
2890
2945
|
WORKBUDDY_CONTEXT_USAGE_REPAIR_KEY,
|
|
2946
|
+
migrateLegacyDeepseekHarnessSource,
|
|
2947
|
+
DSH_LEGACY_SOURCE_MIGRATION_KEY,
|
|
2891
2948
|
repairCodexRescanInflation,
|
|
2892
2949
|
repairCodexForkReplayInflation,
|
|
2893
2950
|
repairCodexInterleavedUsageInflation,
|
|
@@ -2912,6 +2969,121 @@ module.exports = {
|
|
|
2912
2969
|
CLOUD_CONVERSATIONS_BACKFILL_KEY,
|
|
2913
2970
|
};
|
|
2914
2971
|
|
|
2972
|
+
// The pre-merge Harness prototype briefly emitted source="deepseek" before
|
|
2973
|
+
// settling on the official CLI id, source="dsh". Relabel the local history,
|
|
2974
|
+
// append explicit zero rows for every old cloud key, and replay from offset 0.
|
|
2975
|
+
// That preserves the latest canonical totals while making remote whole-row
|
|
2976
|
+
// upserts remove the stale alias instead of displaying both sources or summing
|
|
2977
|
+
// the same session twice.
|
|
2978
|
+
async function migrateLegacyDeepseekHarnessSource({ cursors, queuePath, queueStatePath } = {}) {
|
|
2979
|
+
if (!cursors || typeof cursors !== "object") return false;
|
|
2980
|
+
const migrations = (cursors.migrations ||= {});
|
|
2981
|
+
if (migrations[DSH_LEGACY_SOURCE_MIGRATION_KEY]) return false;
|
|
2982
|
+
|
|
2983
|
+
let raw = "";
|
|
2984
|
+
try {
|
|
2985
|
+
raw = await fs.readFile(queuePath, "utf8");
|
|
2986
|
+
} catch (error) {
|
|
2987
|
+
if (error?.code !== "ENOENT") throw error;
|
|
2988
|
+
}
|
|
2989
|
+
|
|
2990
|
+
const output = [];
|
|
2991
|
+
const legacyKeys = new Map();
|
|
2992
|
+
const latestMigratedRows = new Map();
|
|
2993
|
+
const latestExplicitCanonicalRows = new Map();
|
|
2994
|
+
for (const line of raw.split("\n")) {
|
|
2995
|
+
if (!line.trim()) continue;
|
|
2996
|
+
let row;
|
|
2997
|
+
try {
|
|
2998
|
+
row = JSON.parse(line);
|
|
2999
|
+
} catch (_error) {
|
|
3000
|
+
output.push(line);
|
|
3001
|
+
continue;
|
|
3002
|
+
}
|
|
3003
|
+
|
|
3004
|
+
const isLegacy =
|
|
3005
|
+
row?.source === "deepseek" &&
|
|
3006
|
+
typeof row.model === "string" &&
|
|
3007
|
+
typeof row.hour_start === "string";
|
|
3008
|
+
if (isLegacy) {
|
|
3009
|
+
const key = `${row.model}|${row.hour_start}`;
|
|
3010
|
+
legacyKeys.set(key, { model: row.model, hour_start: row.hour_start });
|
|
3011
|
+
row = {
|
|
3012
|
+
...row,
|
|
3013
|
+
source: "dsh",
|
|
3014
|
+
billable_total_tokens: row.billable_total_tokens ?? row.total_tokens,
|
|
3015
|
+
};
|
|
3016
|
+
}
|
|
3017
|
+
const serialized = JSON.stringify(row);
|
|
3018
|
+
output.push(serialized);
|
|
3019
|
+
if (row?.source === "dsh" && typeof row.model === "string" && typeof row.hour_start === "string") {
|
|
3020
|
+
const key = `${row.model}|${row.hour_start}`;
|
|
3021
|
+
if (isLegacy) latestMigratedRows.set(key, serialized);
|
|
3022
|
+
else latestExplicitCanonicalRows.set(key, serialized);
|
|
3023
|
+
}
|
|
3024
|
+
}
|
|
3025
|
+
|
|
3026
|
+
if (legacyKeys.size === 0) {
|
|
3027
|
+
migrations[DSH_LEGACY_SOURCE_MIGRATION_KEY] = {
|
|
3028
|
+
status: "noop",
|
|
3029
|
+
appliedAt: new Date().toISOString(),
|
|
3030
|
+
reason: "no-legacy-deepseek-rows",
|
|
3031
|
+
};
|
|
3032
|
+
return false;
|
|
3033
|
+
}
|
|
3034
|
+
|
|
3035
|
+
// Re-append the last canonical row for each affected key so local readers'
|
|
3036
|
+
// last-row-wins contract remains correct even when an old alias line was
|
|
3037
|
+
// physically later than an already-emitted dsh row.
|
|
3038
|
+
for (const key of legacyKeys.keys()) {
|
|
3039
|
+
const canonical = latestExplicitCanonicalRows.get(key) || latestMigratedRows.get(key);
|
|
3040
|
+
if (canonical) output.push(canonical);
|
|
3041
|
+
}
|
|
3042
|
+
for (const { model, hour_start } of legacyKeys.values()) {
|
|
3043
|
+
output.push(JSON.stringify({
|
|
3044
|
+
source: "deepseek",
|
|
3045
|
+
model,
|
|
3046
|
+
hour_start,
|
|
3047
|
+
input_tokens: 0,
|
|
3048
|
+
cached_input_tokens: 0,
|
|
3049
|
+
cache_creation_input_tokens: 0,
|
|
3050
|
+
output_tokens: 0,
|
|
3051
|
+
reasoning_output_tokens: 0,
|
|
3052
|
+
total_tokens: 0,
|
|
3053
|
+
billable_total_tokens: 0,
|
|
3054
|
+
conversation_count: 0,
|
|
3055
|
+
}));
|
|
3056
|
+
}
|
|
3057
|
+
|
|
3058
|
+
await ensureDir(path.dirname(queuePath));
|
|
3059
|
+
const tmpPath = `${queuePath}.tmp.${process.pid}.${Date.now()}`;
|
|
3060
|
+
await fs.writeFile(tmpPath, `${output.join("\n")}\n`, "utf8");
|
|
3061
|
+
await fs.rename(tmpPath, queuePath);
|
|
3062
|
+
|
|
3063
|
+
if (typeof queueStatePath === "string" && queueStatePath) {
|
|
3064
|
+
let state = {};
|
|
3065
|
+
try {
|
|
3066
|
+
state = JSON.parse(await fs.readFile(queueStatePath, "utf8"));
|
|
3067
|
+
if (!state || typeof state !== "object") state = {};
|
|
3068
|
+
} catch (_error) {
|
|
3069
|
+
state = {};
|
|
3070
|
+
}
|
|
3071
|
+
state.offset = 0;
|
|
3072
|
+
state.updatedAt = new Date().toISOString();
|
|
3073
|
+
state.note = "reset_after_deepseek_harness_source_migration_2026_08";
|
|
3074
|
+
await ensureDir(path.dirname(queueStatePath));
|
|
3075
|
+
await fs.writeFile(queueStatePath, `${JSON.stringify(state, null, 2)}\n`, "utf8");
|
|
3076
|
+
}
|
|
3077
|
+
|
|
3078
|
+
migrations[DSH_LEGACY_SOURCE_MIGRATION_KEY] = {
|
|
3079
|
+
status: "applied",
|
|
3080
|
+
appliedAt: new Date().toISOString(),
|
|
3081
|
+
migratedBuckets: legacyKeys.size,
|
|
3082
|
+
retractedBuckets: legacyKeys.size,
|
|
3083
|
+
};
|
|
3084
|
+
return true;
|
|
3085
|
+
}
|
|
3086
|
+
|
|
2915
3087
|
function normalizeString(value) {
|
|
2916
3088
|
if (typeof value !== "string") return null;
|
|
2917
3089
|
const trimmed = value.trim();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const fssync = require("node:fs");
|
|
2
|
+
const os = require("node:os");
|
|
2
3
|
const path = require("node:path");
|
|
3
4
|
const wsl = require("./wsl-probe");
|
|
4
5
|
|
|
@@ -48,6 +49,39 @@ function pathExists(p, existsSync) {
|
|
|
48
49
|
try { return (existsSync || fssync.existsSync)(p) ? p : null; } catch (_e) { return null; }
|
|
49
50
|
}
|
|
50
51
|
|
|
52
|
+
// ZCode stores its CLI DB under the user's home dir on every platform
|
|
53
|
+
// (~/.zcode/cli/db/db.sqlite), Windows included. The win32 APPDATA guess
|
|
54
|
+
// (introduced with the WSL dual-install work) silently missed the native
|
|
55
|
+
// install, so probe home first and keep APPDATA only as a fallback for
|
|
56
|
+
// installs that do live under Roaming. Falls back to the home path when
|
|
57
|
+
// neither exists so resolveInstallPaths can null it uniformly.
|
|
58
|
+
function resolveZcodeNativeDbPath({
|
|
59
|
+
home = os.homedir(),
|
|
60
|
+
env = process.env,
|
|
61
|
+
platform = process.platform,
|
|
62
|
+
deps = {},
|
|
63
|
+
} = {}) {
|
|
64
|
+
const existsSync = deps.existsSync || fssync.existsSync;
|
|
65
|
+
const zcodeHomeOverride =
|
|
66
|
+
typeof env.ZCODE_HOME === "string" ? env.ZCODE_HOME.trim() : "";
|
|
67
|
+
const zcodeHome = zcodeHomeOverride
|
|
68
|
+
? path.resolve(zcodeHomeOverride)
|
|
69
|
+
: path.join(home, ".zcode");
|
|
70
|
+
// An explicit ZCODE_HOME pins the install: when its database is missing we
|
|
71
|
+
// must not fall back to an APPDATA database, or sync could read a different
|
|
72
|
+
// ZCode installation than the one the user pointed at.
|
|
73
|
+
const candidates = [
|
|
74
|
+
path.join(zcodeHome, "cli", "db", "db.sqlite"),
|
|
75
|
+
...(!zcodeHomeOverride &&
|
|
76
|
+
platform === "win32" &&
|
|
77
|
+
typeof env.APPDATA === "string" &&
|
|
78
|
+
env.APPDATA.trim()
|
|
79
|
+
? [path.join(env.APPDATA.trim(), ".zcode", "cli", "db", "db.sqlite")]
|
|
80
|
+
: []),
|
|
81
|
+
];
|
|
82
|
+
return candidates.find((p) => existsSync(p)) || candidates[0];
|
|
83
|
+
}
|
|
84
|
+
|
|
51
85
|
function hasAnyChild(p, children, existsSync) {
|
|
52
86
|
const ex = existsSync || fssync.existsSync;
|
|
53
87
|
return children.some((c) => { try { return ex(path.join(p, c)); } catch (_e) { return false; } });
|
|
@@ -99,6 +133,7 @@ function ensureFlatCursor(cursors, providerName, env, preferredKey) {
|
|
|
99
133
|
|
|
100
134
|
module.exports = {
|
|
101
135
|
resolveInstallPaths,
|
|
136
|
+
resolveZcodeNativeDbPath,
|
|
102
137
|
ensureNamespacedCursors,
|
|
103
138
|
ensureFlatCursor,
|
|
104
139
|
};
|