tokentracker-cli 0.97.1 → 0.97.2
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 +3 -3
- package/README.ja.md +3 -3
- package/README.ko.md +3 -3
- package/README.md +7 -5
- package/README.zh-CN.md +3 -3
- package/dashboard/dist/assets/{AchievementBadge-BdvqY4Qb.js → AchievementBadge-Bf2T612R.js} +1 -1
- package/dashboard/dist/assets/{AchievementsPage-CrqvRxnb.js → AchievementsPage-CnkSNpJx.js} +2 -2
- package/dashboard/dist/assets/{AchievementsSection-wyLAM9N7.js → AchievementsSection-CPwsy04Y.js} +1 -1
- package/dashboard/dist/assets/{BadgeDetailModal-CquST3dj.js → BadgeDetailModal-BJBrgn24.js} +1 -1
- package/dashboard/dist/assets/{BotAnimated-EXhdUHSg.js → BotAnimated-BJM20N9T.js} +1 -1
- package/dashboard/dist/assets/{Card-Il2WWgOG.js → Card-BRWOMoBk.js} +1 -1
- package/dashboard/dist/assets/{ClawdAnimated-DioF5wa-.js → ClawdAnimated-CtX8cne4.js} +2 -2
- package/dashboard/dist/assets/{CommandPalette-CaDx06tM.js → CommandPalette-C8BwOnSn.js} +1 -1
- package/dashboard/dist/assets/{CommunityStatsModal-BbYWzM07.js → CommunityStatsModal-BGMbgSjq.js} +1 -1
- package/dashboard/dist/assets/{ConfirmModal-BHWQLUCM.js → ConfirmModal-ZZXg_OLV.js} +1 -1
- package/dashboard/dist/assets/{Controls--LFhExZX.js → Controls-VDvgw_ed.js} +1 -1
- package/dashboard/dist/assets/{DashboardPage-DuqJOpHL.js → DashboardPage-BcJGzQWK.js} +1 -1
- package/dashboard/dist/assets/{DevicePage-RKTirqz0.js → DevicePage-CP5m8azV.js} +1 -1
- package/dashboard/dist/assets/{DialogClose-DPFsTKmJ.js → DialogClose-8pTCallP.js} +1 -1
- package/dashboard/dist/assets/DialogDescription-DRQEfAWH.js +1 -0
- package/dashboard/dist/assets/{DialogTitle-DolLpmFL.js → DialogTitle-BWYdq4TT.js} +1 -1
- package/dashboard/dist/assets/{FadeIn-92GGNCPe.js → FadeIn-CEJfaKnL.js} +1 -1
- package/dashboard/dist/assets/{HeaderGithubStar-GfXudotT.js → HeaderGithubStar-Bg2vijF8.js} +1 -1
- package/dashboard/dist/assets/{HoverTooltip-n7gbPEsq.js → HoverTooltip-B03JQ3PO.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-BaQOTbXi.js → IpCheckPage-DYZucBOf.js} +1 -1
- package/dashboard/dist/assets/{LandingPage-D3JcvxW_.js → LandingPage-m-byhnVx.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardAvatar-tVaWJXZ3.js → LeaderboardAvatar-JtGhJC1s.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardPage-NqHcStnk.js → LeaderboardPage-vVDKFLhl.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardProfileModal-DmvcCVS7.js → LeaderboardProfileModal-Cm4DDrcY.js} +3 -3
- package/dashboard/dist/assets/{LeaderboardProfilePage-VSv3IlzS.js → LeaderboardProfilePage-bKbMm856.js} +1 -1
- package/dashboard/dist/assets/{LimitsPage-CtxgT20z.js → LimitsPage-B271tZOj.js} +1 -1
- package/dashboard/dist/assets/{LocalOnlyNotice-O9o586G8.js → LocalOnlyNotice-DKIxuBP0.js} +1 -1
- package/dashboard/dist/assets/{LoginCard-JCejigVu.js → LoginCard-DA46RXDo.js} +1 -1
- package/dashboard/dist/assets/{LoginModal-CJ3g7tBc.js → LoginModal-PxTgIoLk.js} +1 -1
- package/dashboard/dist/assets/{LoginPage-DPWzPywx.js → LoginPage-uEUnU7NP.js} +1 -1
- package/dashboard/dist/assets/{PetPage-MSJ3jseK.js → PetPage-DDPZtxMw.js} +1 -1
- package/dashboard/dist/assets/{PopoverPopup-nL3YOLPO.js → PopoverPopup-DWIMb8D6.js} +1 -1
- package/dashboard/dist/assets/{ProviderIcon-C5RX_xPk.js → ProviderIcon-DqqwXu3b.js} +1 -1
- package/dashboard/dist/assets/{ResetPasswordPage-DW_NCwA_.js → ResetPasswordPage-BVuJTR9A.js} +1 -1
- package/dashboard/dist/assets/{SegmentedControl-CS6wQtck.js → SegmentedControl-iHtWKWtc.js} +1 -1
- package/dashboard/dist/assets/{Select-YqlqvbT5.js → Select-Cr9wq8mD.js} +1 -1
- package/dashboard/dist/assets/{SelectItemText-BahqsiIc.js → SelectItemText-BWnP4yuq.js} +1 -1
- package/dashboard/dist/assets/{ServiceStatusPage-DyhutLUy.js → ServiceStatusPage-DLuiUUYV.js} +1 -1
- package/dashboard/dist/assets/{SessionsPage-wbvi4EHi.js → SessionsPage-CBAH4ieT.js} +1 -1
- package/dashboard/dist/assets/{SettingsPage-HGSwpV1O.js → SettingsPage-Djku-i8K.js} +2 -2
- package/dashboard/dist/assets/{SkillsPage-BbVT9oyh.js → SkillsPage-DtBRoB8R.js} +1 -1
- package/dashboard/dist/assets/{TokenGalaxy-Cej6MLu6.js → TokenGalaxy-nvyPu5eV.js} +1 -1
- package/dashboard/dist/assets/{ToolbarRootContext-D9pPY73U.js → ToolbarRootContext-DhpHv55w.js} +1 -1
- package/dashboard/dist/assets/{TrendMonitor-BtBcCjx-.js → TrendMonitor-CCzwGDst.js} +1 -1
- package/dashboard/dist/assets/{WidgetsPage-BSNl2WIL.js → WidgetsPage-CcWCidAd.js} +1 -1
- package/dashboard/dist/assets/{WrappedPage-d5oiNV4T.js → WrappedPage-B6dn8eyh.js} +1 -1
- package/dashboard/dist/assets/__vite-browser-external-sJsF0ioo.js +45 -0
- package/dashboard/dist/assets/{agent-logos-CCVzO3uU.js → agent-logos-Dh2k8E_G.js} +1 -1
- package/dashboard/dist/assets/{arrow-up-right-AKItXMyh.js → arrow-up-right-BLDQog1A.js} +1 -1
- package/dashboard/dist/assets/{check-BQw5n0V0.js → check-DNq_ySSn.js} +1 -1
- package/dashboard/dist/assets/{composite-CWz1s64R.js → composite-CSBcryzA.js} +1 -1
- package/dashboard/dist/assets/{copy-CF8XNmv3.js → copy-DHRrNtRb.js} +1 -1
- package/dashboard/dist/assets/{download-BZvLU_hD.js → download-CluyujgG.js} +1 -1
- package/dashboard/dist/assets/{external-link-bZrcVkeE.js → external-link-Cf12tdLf.js} +1 -1
- package/dashboard/dist/assets/{flame-CMHolW1z.js → flame-CJEYinxo.js} +1 -1
- package/dashboard/dist/assets/{format-tokens-Bs2YotMr.js → format-tokens-CqiCmYtk.js} +1 -1
- package/dashboard/dist/assets/{icons-OKyij2y_.js → icons-DD8OvYVG.js} +1 -1
- package/dashboard/dist/assets/{index-CN7xY7j_.js → index-21lDN4rA.js} +1 -1
- package/dashboard/dist/assets/{index-C8nY1OaT.js → index-Cm8jn8Va.js} +1 -1
- package/dashboard/dist/assets/{index-DOwPCQx2.js → index-DLLivlEh.js} +1 -1
- package/dashboard/dist/assets/{info-CU7bMBhU.js → info-dv3Y0z8Q.js} +1 -1
- package/dashboard/dist/assets/{link-2-wwoUOujz.js → link-2-CWHBxVuk.js} +1 -1
- package/dashboard/dist/assets/{loader-circle-BK3Ltc-j.js → loader-circle-9l5p9Dwa.js} +1 -1
- package/dashboard/dist/assets/{maximize-2-DIPnLqR8.js → maximize-2-DQ2t3MJB.js} +1 -1
- package/dashboard/dist/assets/{modifiers.esm-D_aVVjx5.js → modifiers.esm-Cwj0l9Zb.js} +1 -1
- package/dashboard/dist/assets/{monitor-smartphone-4NOM9BHb.js → monitor-smartphone-B-9at3iV.js} +1 -1
- package/dashboard/dist/assets/{plus-JqSTJ28Y.js → plus-C_CTQjDD.js} +1 -1
- package/dashboard/dist/assets/{provider-display-CEFlg9ho.js → provider-display-XJQod7k9.js} +2 -2
- package/dashboard/dist/assets/{react-jS0-5kwE.js → react-xH4nkyuj.js} +1 -1
- package/dashboard/dist/assets/{search-CbBetPN7.js → search-Ut41Fw1G.js} +1 -1
- package/dashboard/dist/assets/{skills-api-PwUMTdmV.js → skills-api-B7lb1cjO.js} +1 -1
- package/dashboard/dist/assets/{sortable.esm-BDdw7tkz.js → sortable.esm-BUPRsWL6.js} +1 -1
- package/dashboard/dist/assets/{store-CFdu9yv_.js → store-DneqOW0h.js} +1 -1
- package/dashboard/dist/assets/{terminal-Dh7Sh6IG.js → terminal-DPQyZyHR.js} +1 -1
- package/dashboard/dist/assets/{trash-B6_OaEVL.js → trash-CVdV1bBR.js} +1 -1
- package/dashboard/dist/assets/{use-community-stats-D55oU9bu.js → use-community-stats-DB98TGn9.js} +1 -1
- package/dashboard/dist/assets/{use-latest-request-guard-BO89yQ3n.js → use-latest-request-guard-DK3KulKx.js} +1 -1
- package/dashboard/dist/assets/{use-limits-display-prefs-C358N7B0.js → use-limits-display-prefs-BACCRUMZ.js} +1 -1
- package/dashboard/dist/assets/{use-ordered-list-B9ZYDS1K.js → use-ordered-list-DnKFdI9a.js} +1 -1
- package/dashboard/dist/assets/use-reduced-motion-BfdrKOsS.js +1 -0
- package/dashboard/dist/assets/{use-session-efficiency-pref-CwGRDyVq.js → use-session-efficiency-pref-BTm6RoSm.js} +1 -1
- package/dashboard/dist/assets/{use-transform-9S4Ruq_s.js → use-transform-DweC2iKa.js} +1 -1
- package/dashboard/dist/assets/{use-usage-limits-CpnM5V06.js → use-usage-limits-CN5xWIBs.js} +1 -1
- package/dashboard/dist/assets/{useCurrency-BKJGW_4l.js → useCurrency-CFjvWawL.js} +1 -1
- package/dashboard/dist/assets/{useTokenFormat-CTB5svOB.js → useTokenFormat-Cf81HqWi.js} +1 -1
- package/dashboard/dist/assets/{zap-DGdBuT6m.js → zap-Vx_j5oJN.js} +1 -1
- package/dashboard/dist/index.html +13 -11
- 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 +1 -0
- package/src/commands/status.js +13 -0
- package/src/commands/sync.js +46 -0
- package/src/lib/pricing/index.js +7 -1
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/src/lib/rollout.js +200 -32
- package/dashboard/dist/assets/DialogDescription-DgaV8Gtk.js +0 -1
- package/dashboard/dist/assets/__vite-browser-external-CjrP5KfC.js +0 -45
- package/dashboard/dist/assets/use-reduced-motion-DWHVI51t.js +0 -1
package/src/lib/rollout.js
CHANGED
|
@@ -10896,8 +10896,10 @@ function resolveOmpAgentDir(env = process.env) {
|
|
|
10896
10896
|
return ompHome ? path.join(ompHome, "agent") : null;
|
|
10897
10897
|
}
|
|
10898
10898
|
|
|
10899
|
-
|
|
10900
|
-
|
|
10899
|
+
// Session-file discovery is shared with OmO (omo), which persists the exact
|
|
10900
|
+
// same on-disk layout under its own agent dir:
|
|
10901
|
+
// <agentDir>/sessions/--<cwd-encoded>--/<timestamp>_<sessionId>.jsonl
|
|
10902
|
+
function collectPiStyleSessionFiles(agentDir) {
|
|
10901
10903
|
if (!agentDir) return [];
|
|
10902
10904
|
const sessionsDir = path.join(agentDir, "sessions");
|
|
10903
10905
|
if (!fssync.existsSync(sessionsDir)) return [];
|
|
@@ -10922,6 +10924,10 @@ function resolveOmpSessionFiles(env = process.env) {
|
|
|
10922
10924
|
return files;
|
|
10923
10925
|
}
|
|
10924
10926
|
|
|
10927
|
+
function resolveOmpSessionFiles(env = process.env) {
|
|
10928
|
+
return collectPiStyleSessionFiles(resolveOmpAgentDir(env));
|
|
10929
|
+
}
|
|
10930
|
+
|
|
10925
10931
|
// Subagent transcripts live in a directory named after the session file:
|
|
10926
10932
|
// ~/.omp/agent/sessions/<cwd>/<session>.jsonl (main agent)
|
|
10927
10933
|
// ~/.omp/agent/sessions/<cwd>/<session>/<Agent>.jsonl (task subagent)
|
|
@@ -10930,8 +10936,8 @@ function resolveOmpSessionFiles(env = process.env) {
|
|
|
10930
10936
|
// rel path <= 2 segments → main, deeper → subagent/advisor), so we mirror
|
|
10931
10937
|
// that: everything below the cwd level is subagent traffic. Session dirs also
|
|
10932
10938
|
// hold non-JSONL artefacts (*.bash-original.log, *.md) — skipped by extension.
|
|
10933
|
-
|
|
10934
|
-
|
|
10939
|
+
// OmO nests the same way, so it reuses this walker.
|
|
10940
|
+
function collectPiStyleSubagentFiles(agentDir) {
|
|
10935
10941
|
if (!agentDir) return [];
|
|
10936
10942
|
const sessionsDir = path.join(agentDir, "sessions");
|
|
10937
10943
|
if (!fssync.existsSync(sessionsDir)) return [];
|
|
@@ -10979,20 +10985,24 @@ function resolveOmpSubagentFiles(env = process.env) {
|
|
|
10979
10985
|
return files;
|
|
10980
10986
|
}
|
|
10981
10987
|
|
|
10988
|
+
function resolveOmpSubagentFiles(env = process.env) {
|
|
10989
|
+
return collectPiStyleSubagentFiles(resolveOmpAgentDir(env));
|
|
10990
|
+
}
|
|
10991
|
+
|
|
10982
10992
|
function resolveOmpDefaultModel() {
|
|
10983
10993
|
// oh-my-pi has no global default model setting; model is per-message.
|
|
10984
10994
|
return "omp-unknown";
|
|
10985
10995
|
}
|
|
10986
10996
|
|
|
10987
|
-
const
|
|
10997
|
+
const PI_STYLE_HEADER_SCAN_MAX_BYTES = 65536;
|
|
10988
10998
|
|
|
10989
|
-
async function
|
|
10999
|
+
async function readPiStyleSessionCwd(filePath) {
|
|
10990
11000
|
let stream;
|
|
10991
11001
|
try {
|
|
10992
11002
|
stream = fssync.createReadStream(filePath, {
|
|
10993
11003
|
encoding: "utf8",
|
|
10994
11004
|
start: 0,
|
|
10995
|
-
end:
|
|
11005
|
+
end: PI_STYLE_HEADER_SCAN_MAX_BYTES,
|
|
10996
11006
|
});
|
|
10997
11007
|
} catch {
|
|
10998
11008
|
return null;
|
|
@@ -11013,6 +11023,95 @@ async function resolveOmpFileCwd(filePath) {
|
|
|
11013
11023
|
return null;
|
|
11014
11024
|
}
|
|
11015
11025
|
|
|
11026
|
+
async function resolveOmpFileCwd(filePath) {
|
|
11027
|
+
return readPiStyleSessionCwd(filePath);
|
|
11028
|
+
}
|
|
11029
|
+
|
|
11030
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
11031
|
+
// OmO (omo) — passive JSONL reader (~/.omo/agent/sessions/**/*.jsonl)
|
|
11032
|
+
//
|
|
11033
|
+
// OmO shares oh-my-pi's session persistence format, so it reuses the same
|
|
11034
|
+
// collectors and parser. Layout:
|
|
11035
|
+
// ~/.omo/agent/sessions/--<cwd-encoded>--/<timestamp>_<sessionId>.jsonl
|
|
11036
|
+
//
|
|
11037
|
+
// First line is the type:"session" header (carries the real, unencoded cwd).
|
|
11038
|
+
// Only type:"message" lines with message.role=="assistant" carry usage:
|
|
11039
|
+
//
|
|
11040
|
+
// {
|
|
11041
|
+
// "type": "message",
|
|
11042
|
+
// "id": "7ae3734f", ← 8-char dedup key
|
|
11043
|
+
// "timestamp": "2026-08-27T23:28:16.699Z",
|
|
11044
|
+
// "message": {
|
|
11045
|
+
// "role": "assistant",
|
|
11046
|
+
// "provider": "xai",
|
|
11047
|
+
// "model": "grok-4.6",
|
|
11048
|
+
// "usage": {
|
|
11049
|
+
// "input": 28646, "output": 630, "cacheRead": 512, "cacheWrite": 0,
|
|
11050
|
+
// "reasoning": 218, "totalTokens": 29788,
|
|
11051
|
+
// "cost": { ... } ← OmO's own estimate; ignored, we price it
|
|
11052
|
+
// },
|
|
11053
|
+
// "timestamp": 1787873284870 ← ms epoch, preferred for bucketing
|
|
11054
|
+
// }
|
|
11055
|
+
// }
|
|
11056
|
+
//
|
|
11057
|
+
// Two deliberate differences from oh-my-pi:
|
|
11058
|
+
// 1. The reasoning field is `reasoning`, not `reasoningTokens`.
|
|
11059
|
+
// 2. Reasoning is a SUBSET of `output`, and `totalTokens` excludes it —
|
|
11060
|
+
// verified across a 2,586-message corpus where
|
|
11061
|
+
// input+output+cacheRead+cacheWrite === totalTokens for every row, and
|
|
11062
|
+
// `usage.cost` bills no separate reasoning component. So omo follows the
|
|
11063
|
+
// Codex convention: reasoning_output_tokens is informational and must not
|
|
11064
|
+
// be billed on top of output (see computeRowCost in lib/pricing/index.js).
|
|
11065
|
+
//
|
|
11066
|
+
// OmO is a router — the upstream model name is recorded per message and there
|
|
11067
|
+
// is no global default (fallback: "omo-unknown").
|
|
11068
|
+
//
|
|
11069
|
+
// Path overrides are TokenTracker-only (TOKENTRACKER_OMO_AGENT_DIR /
|
|
11070
|
+
// TOKENTRACKER_OMO_HOME / OMO_HOME). PI_CONFIG_DIR and PI_CODING_AGENT_DIR are
|
|
11071
|
+
// deliberately NOT honored here: those belong to pi/omp, and routing them to a
|
|
11072
|
+
// third provider would reintroduce the ambiguity decidePiCodingAgentDirOwner
|
|
11073
|
+
// exists to resolve.
|
|
11074
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
11075
|
+
|
|
11076
|
+
function resolveOmoHome(env = process.env) {
|
|
11077
|
+
if (env.TOKENTRACKER_OMO_HOME) return expandHomePath(env.TOKENTRACKER_OMO_HOME, env);
|
|
11078
|
+
if (env.OMO_HOME) return expandHomePath(env.OMO_HOME, env);
|
|
11079
|
+
const home = env.HOME || require("node:os").homedir();
|
|
11080
|
+
if (process.platform === "win32") {
|
|
11081
|
+
return pickWin32ProviderPath({
|
|
11082
|
+
env,
|
|
11083
|
+
nativeValue: path.join(home, ".omo"),
|
|
11084
|
+
wslProviderDir: ".omo",
|
|
11085
|
+
});
|
|
11086
|
+
}
|
|
11087
|
+
return path.join(home, ".omo");
|
|
11088
|
+
}
|
|
11089
|
+
|
|
11090
|
+
function resolveOmoAgentDir(env = process.env) {
|
|
11091
|
+
if (env.TOKENTRACKER_OMO_AGENT_DIR) {
|
|
11092
|
+
return expandHomePath(env.TOKENTRACKER_OMO_AGENT_DIR, env);
|
|
11093
|
+
}
|
|
11094
|
+
const omoHome = resolveOmoHome(env);
|
|
11095
|
+
return omoHome ? path.join(omoHome, "agent") : null;
|
|
11096
|
+
}
|
|
11097
|
+
|
|
11098
|
+
function resolveOmoSessionFiles(env = process.env) {
|
|
11099
|
+
return collectPiStyleSessionFiles(resolveOmoAgentDir(env));
|
|
11100
|
+
}
|
|
11101
|
+
|
|
11102
|
+
function resolveOmoSubagentFiles(env = process.env) {
|
|
11103
|
+
return collectPiStyleSubagentFiles(resolveOmoAgentDir(env));
|
|
11104
|
+
}
|
|
11105
|
+
|
|
11106
|
+
function resolveOmoDefaultModel() {
|
|
11107
|
+
// OmO has no global default model setting; model is per-message.
|
|
11108
|
+
return "omo-unknown";
|
|
11109
|
+
}
|
|
11110
|
+
|
|
11111
|
+
async function resolveOmoFileCwd(filePath) {
|
|
11112
|
+
return readPiStyleSessionCwd(filePath);
|
|
11113
|
+
}
|
|
11114
|
+
|
|
11016
11115
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
11017
11116
|
// Kilo Code VS Code extension — passive reader for VS Code-family
|
|
11018
11117
|
// globalStorage/kilocode.kilo-code/tasks/<uuid>/ui_messages.json files.
|
|
@@ -14594,7 +14693,23 @@ async function parseKilocodeIncremental({
|
|
|
14594
14693
|
return { recordsProcessed, eventsAggregated, bucketsQueued };
|
|
14595
14694
|
}
|
|
14596
14695
|
|
|
14597
|
-
|
|
14696
|
+
// Reads the first present numeric field. oh-my-pi emits `reasoningTokens`;
|
|
14697
|
+
// OmO emits `reasoning`. Listing the accepted keys per provider keeps each
|
|
14698
|
+
// one's accounting exact instead of guessing across both spellings.
|
|
14699
|
+
function pickUsageInt(usage, fields) {
|
|
14700
|
+
for (const field of fields) {
|
|
14701
|
+
const raw = usage?.[field];
|
|
14702
|
+
if (raw == null) continue;
|
|
14703
|
+
const value = Number(raw);
|
|
14704
|
+
if (Number.isFinite(value)) return toNonNegativeInt(value);
|
|
14705
|
+
}
|
|
14706
|
+
return 0;
|
|
14707
|
+
}
|
|
14708
|
+
|
|
14709
|
+
// Shared implementation for the oh-my-pi session format. omp and omo both
|
|
14710
|
+
// persist it verbatim, so they differ only in where the sessions live, which
|
|
14711
|
+
// cursor namespace they own, and how reasoning tokens are spelled.
|
|
14712
|
+
async function parseOmpLikeIncremental({
|
|
14598
14713
|
sessionFiles,
|
|
14599
14714
|
subagentFiles,
|
|
14600
14715
|
cursors,
|
|
@@ -14604,41 +14719,50 @@ async function parseOmpIncremental({
|
|
|
14604
14719
|
onProgress,
|
|
14605
14720
|
env,
|
|
14606
14721
|
defaultModel,
|
|
14722
|
+
stateKey,
|
|
14723
|
+
source,
|
|
14724
|
+
resolveSessionFiles,
|
|
14725
|
+
resolveSubagentFiles,
|
|
14726
|
+
resolveDefaultModel,
|
|
14727
|
+
resolveFileCwd,
|
|
14728
|
+
reasoningFields,
|
|
14729
|
+
reasoningIncludedInOutput = false,
|
|
14607
14730
|
} = {}) {
|
|
14608
14731
|
await ensureDir(path.dirname(queuePath));
|
|
14609
14732
|
const projectEnabled = typeof projectQueuePath === "string" && projectQueuePath.length > 0;
|
|
14610
|
-
const
|
|
14611
|
-
|
|
14733
|
+
const providerState =
|
|
14734
|
+
cursors[stateKey] && typeof cursors[stateKey] === "object" ? cursors[stateKey] : {};
|
|
14735
|
+
const seenIds = new Set(Array.isArray(providerState.seenIds) ? providerState.seenIds : []);
|
|
14612
14736
|
const projectSeenIds = new Set(
|
|
14613
|
-
Array.isArray(
|
|
14737
|
+
Array.isArray(providerState.projectSeenIds) ? providerState.projectSeenIds : [],
|
|
14614
14738
|
);
|
|
14615
14739
|
const fileOffsets =
|
|
14616
|
-
|
|
14617
|
-
? { ...
|
|
14740
|
+
providerState.fileOffsets && typeof providerState.fileOffsets === "object"
|
|
14741
|
+
? { ...providerState.fileOffsets }
|
|
14618
14742
|
: {};
|
|
14619
14743
|
const projectFileOffsets =
|
|
14620
|
-
|
|
14621
|
-
? { ...
|
|
14744
|
+
providerState.projectFileOffsets && typeof providerState.projectFileOffsets === "object"
|
|
14745
|
+
? { ...providerState.projectFileOffsets }
|
|
14622
14746
|
: {};
|
|
14623
14747
|
|
|
14624
14748
|
const mainFiles = Array.isArray(sessionFiles)
|
|
14625
14749
|
? sessionFiles
|
|
14626
|
-
:
|
|
14750
|
+
: resolveSessionFiles(env || process.env);
|
|
14627
14751
|
// Subagent transcripts share the session format and count toward the same
|
|
14628
|
-
//
|
|
14752
|
+
// provider totals; they're discovered separately because they nest below the
|
|
14629
14753
|
// cwd level. When the caller supplies explicit sessionFiles (tests), don't
|
|
14630
14754
|
// auto-resolve — keep the parse hermetic.
|
|
14631
14755
|
const subFiles = Array.isArray(subagentFiles)
|
|
14632
14756
|
? subagentFiles
|
|
14633
14757
|
: Array.isArray(sessionFiles)
|
|
14634
14758
|
? []
|
|
14635
|
-
:
|
|
14759
|
+
: resolveSubagentFiles(env || process.env);
|
|
14636
14760
|
const files = [...mainFiles, ...subFiles];
|
|
14637
|
-
const fallbackModel = defaultModel ||
|
|
14761
|
+
const fallbackModel = defaultModel || resolveDefaultModel();
|
|
14638
14762
|
|
|
14639
14763
|
if (files.length === 0) {
|
|
14640
|
-
cursors
|
|
14641
|
-
...
|
|
14764
|
+
cursors[stateKey] = {
|
|
14765
|
+
...providerState,
|
|
14642
14766
|
seenIds: Array.from(seenIds),
|
|
14643
14767
|
fileOffsets,
|
|
14644
14768
|
...(projectEnabled
|
|
@@ -14716,7 +14840,7 @@ async function parseOmpIncremental({
|
|
|
14716
14840
|
const output = toNonNegativeInt(usage.output);
|
|
14717
14841
|
const cacheRead = toNonNegativeInt(usage.cacheRead);
|
|
14718
14842
|
const cacheWrite = toNonNegativeInt(usage.cacheWrite);
|
|
14719
|
-
const reasoningTokens =
|
|
14843
|
+
const reasoningTokens = pickUsageInt(usage, reasoningFields);
|
|
14720
14844
|
|
|
14721
14845
|
if (
|
|
14722
14846
|
input === 0 &&
|
|
@@ -14749,10 +14873,12 @@ async function parseOmpIncremental({
|
|
|
14749
14873
|
if (!bucketStart) continue;
|
|
14750
14874
|
|
|
14751
14875
|
// Use provided totalTokens when available; otherwise sum all components.
|
|
14876
|
+
// OmO folds reasoning into output, so the fallback must not add it again.
|
|
14752
14877
|
const totalTokens =
|
|
14753
14878
|
Number.isFinite(Number(usage.totalTokens)) && Number(usage.totalTokens) > 0
|
|
14754
14879
|
? toNonNegativeInt(usage.totalTokens)
|
|
14755
|
-
: input + output + cacheRead + cacheWrite +
|
|
14880
|
+
: input + output + cacheRead + cacheWrite +
|
|
14881
|
+
(reasoningIncludedInOutput ? 0 : reasoningTokens);
|
|
14756
14882
|
|
|
14757
14883
|
const model = normalizeModelInput(msg.model) || fallbackModel;
|
|
14758
14884
|
|
|
@@ -14766,9 +14892,9 @@ async function parseOmpIncremental({
|
|
|
14766
14892
|
conversation_count: 1,
|
|
14767
14893
|
};
|
|
14768
14894
|
|
|
14769
|
-
const bucket = getHourlyBucket(hourlyState,
|
|
14895
|
+
const bucket = getHourlyBucket(hourlyState, source, model, bucketStart);
|
|
14770
14896
|
addTotals(bucket.totals, delta);
|
|
14771
|
-
touchedBuckets.add(bucketKey(
|
|
14897
|
+
touchedBuckets.add(bucketKey(source, model, bucketStart));
|
|
14772
14898
|
seenIds.add(entryId);
|
|
14773
14899
|
eventsAggregated++;
|
|
14774
14900
|
|
|
@@ -14809,7 +14935,7 @@ async function parseOmpIncremental({
|
|
|
14809
14935
|
const startOffset = stat.size < prevSize || inodeChanged ? 0 : prevSize;
|
|
14810
14936
|
if (stat.size <= startOffset) continue;
|
|
14811
14937
|
|
|
14812
|
-
const cwd = await
|
|
14938
|
+
const cwd = await resolveFileCwd(filePath);
|
|
14813
14939
|
const projectContext = cwd
|
|
14814
14940
|
? await resolveProjectContextForPath({
|
|
14815
14941
|
startDir: wsl.mapWslCwdToUnc(cwd, filePath),
|
|
@@ -14848,7 +14974,7 @@ async function parseOmpIncremental({
|
|
|
14848
14974
|
const output = toNonNegativeInt(usage.output);
|
|
14849
14975
|
const cacheRead = toNonNegativeInt(usage.cacheRead);
|
|
14850
14976
|
const cacheWrite = toNonNegativeInt(usage.cacheWrite);
|
|
14851
|
-
const reasoningTokens =
|
|
14977
|
+
const reasoningTokens = pickUsageInt(usage, reasoningFields);
|
|
14852
14978
|
if (
|
|
14853
14979
|
input === 0 &&
|
|
14854
14980
|
output === 0 &&
|
|
@@ -14878,7 +15004,8 @@ async function parseOmpIncremental({
|
|
|
14878
15004
|
const totalTokens =
|
|
14879
15005
|
Number.isFinite(Number(usage.totalTokens)) && Number(usage.totalTokens) > 0
|
|
14880
15006
|
? toNonNegativeInt(usage.totalTokens)
|
|
14881
|
-
: input + output + cacheRead + cacheWrite +
|
|
15007
|
+
: input + output + cacheRead + cacheWrite +
|
|
15008
|
+
(reasoningIncludedInOutput ? 0 : reasoningTokens);
|
|
14882
15009
|
const delta = {
|
|
14883
15010
|
input_tokens: input,
|
|
14884
15011
|
cached_input_tokens: cacheRead,
|
|
@@ -14891,12 +15018,12 @@ async function parseOmpIncremental({
|
|
|
14891
15018
|
const projectBucket = getProjectBucket(
|
|
14892
15019
|
projectState,
|
|
14893
15020
|
projectKey,
|
|
14894
|
-
|
|
15021
|
+
source,
|
|
14895
15022
|
bucketStart,
|
|
14896
15023
|
projectRef,
|
|
14897
15024
|
);
|
|
14898
15025
|
addTotals(projectBucket.totals, delta);
|
|
14899
|
-
projectTouchedBuckets.add(projectBucketKey(projectKey,
|
|
15026
|
+
projectTouchedBuckets.add(projectBucketKey(projectKey, source, bucketStart));
|
|
14900
15027
|
projectSeenIds.add(entryId);
|
|
14901
15028
|
}
|
|
14902
15029
|
}
|
|
@@ -14941,8 +15068,8 @@ async function parseOmpIncremental({
|
|
|
14941
15068
|
projectState.updatedAt = updatedAt;
|
|
14942
15069
|
cursors.projectHourly = projectState;
|
|
14943
15070
|
}
|
|
14944
|
-
cursors
|
|
14945
|
-
...
|
|
15071
|
+
cursors[stateKey] = {
|
|
15072
|
+
...providerState,
|
|
14946
15073
|
seenIds: cappedSeen,
|
|
14947
15074
|
fileOffsets,
|
|
14948
15075
|
...(projectEnabled
|
|
@@ -14957,6 +15084,33 @@ async function parseOmpIncremental({
|
|
|
14957
15084
|
return { recordsProcessed, eventsAggregated, bucketsQueued, projectBucketsQueued };
|
|
14958
15085
|
}
|
|
14959
15086
|
|
|
15087
|
+
async function parseOmpIncremental(options = {}) {
|
|
15088
|
+
return parseOmpLikeIncremental({
|
|
15089
|
+
...options,
|
|
15090
|
+
stateKey: "omp",
|
|
15091
|
+
source: "omp",
|
|
15092
|
+
resolveSessionFiles: resolveOmpSessionFiles,
|
|
15093
|
+
resolveSubagentFiles: resolveOmpSubagentFiles,
|
|
15094
|
+
resolveDefaultModel: resolveOmpDefaultModel,
|
|
15095
|
+
resolveFileCwd: resolveOmpFileCwd,
|
|
15096
|
+
reasoningFields: ["reasoningTokens"],
|
|
15097
|
+
});
|
|
15098
|
+
}
|
|
15099
|
+
|
|
15100
|
+
async function parseOmoIncremental(options = {}) {
|
|
15101
|
+
return parseOmpLikeIncremental({
|
|
15102
|
+
...options,
|
|
15103
|
+
stateKey: "omo",
|
|
15104
|
+
source: "omo",
|
|
15105
|
+
resolveSessionFiles: resolveOmoSessionFiles,
|
|
15106
|
+
resolveSubagentFiles: resolveOmoSubagentFiles,
|
|
15107
|
+
resolveDefaultModel: resolveOmoDefaultModel,
|
|
15108
|
+
resolveFileCwd: resolveOmoFileCwd,
|
|
15109
|
+
reasoningFields: ["reasoningTokens", "reasoning"],
|
|
15110
|
+
reasoningIncludedInOutput: true,
|
|
15111
|
+
});
|
|
15112
|
+
}
|
|
15113
|
+
|
|
14960
15114
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
14961
15115
|
// pi (@mariozechner/pi-coding-agent) — passive JSONL reader
|
|
14962
15116
|
// (~/.pi/agent/sessions/**/*.jsonl)
|
|
@@ -15007,6 +15161,13 @@ function piAgentDirCollidesWithOmp(env = process.env) {
|
|
|
15007
15161
|
return path.resolve(piAgentDir) === path.resolve(ompAgentDir);
|
|
15008
15162
|
}
|
|
15009
15163
|
|
|
15164
|
+
function omoAgentDirCollidesWithOmp(env = process.env) {
|
|
15165
|
+
const omoAgentDir = resolveOmoAgentDir(env);
|
|
15166
|
+
const ompAgentDir = resolveOmpAgentDir(env);
|
|
15167
|
+
if (!omoAgentDir || !ompAgentDir) return false;
|
|
15168
|
+
return path.resolve(omoAgentDir) === path.resolve(ompAgentDir);
|
|
15169
|
+
}
|
|
15170
|
+
|
|
15010
15171
|
function resolvePiSessionFiles(env = process.env) {
|
|
15011
15172
|
const agentDir = resolvePiAgentDir(env);
|
|
15012
15173
|
if (!agentDir) return [];
|
|
@@ -21773,6 +21934,12 @@ module.exports = {
|
|
|
21773
21934
|
resolveOmpSubagentFiles,
|
|
21774
21935
|
resolveOmpDefaultModel,
|
|
21775
21936
|
parseOmpIncremental,
|
|
21937
|
+
resolveOmoHome,
|
|
21938
|
+
resolveOmoAgentDir,
|
|
21939
|
+
resolveOmoSessionFiles,
|
|
21940
|
+
resolveOmoSubagentFiles,
|
|
21941
|
+
resolveOmoDefaultModel,
|
|
21942
|
+
parseOmoIncremental,
|
|
21776
21943
|
resolveKilocodeRoots,
|
|
21777
21944
|
resolveKilocodeTaskFiles,
|
|
21778
21945
|
normalizeKilocodeProviderToModel,
|
|
@@ -21826,6 +21993,7 @@ module.exports = {
|
|
|
21826
21993
|
resolvePiDefaultModel,
|
|
21827
21994
|
parsePiIncremental,
|
|
21828
21995
|
piAgentDirCollidesWithOmp,
|
|
21996
|
+
omoAgentDirCollidesWithOmp,
|
|
21829
21997
|
resolvePrimeAgentHome,
|
|
21830
21998
|
resolvePrimeAgentDir,
|
|
21831
21999
|
resolvePrimeAgentSessionFiles,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,v as a}from"./__vite-browser-external-CjrP5KfC.js";import{u as p}from"./DialogTitle-DolLpmFL.js";import{u as c}from"./composite-CWz1s64R.js";const x=n.forwardRef(function(e,r){const{render:l,className:u,style:m,id:s,...t}=e,i=p(),o=c(s);return i.useSyncedValueWithCleanup("descriptionElementId",o),a("p",e,{ref:r,props:[{id:o},t]})});export{x as D};
|