@tokz/cli 0.2.21 → 0.2.22
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.
|
@@ -81,7 +81,7 @@ function costUsd(usage, modelId) {
|
|
|
81
81
|
cacheRead += usage.longContextCacheReadTokens / 1e6 * (p.inputPerMTok * 2) * readMult;
|
|
82
82
|
}
|
|
83
83
|
if (usage.longContextOutputTokens) {
|
|
84
|
-
output += usage.longContextOutputTokens / 1e6 * (p.outputPerMTok *
|
|
84
|
+
output += usage.longContextOutputTokens / 1e6 * (p.outputPerMTok * 1.5);
|
|
85
85
|
}
|
|
86
86
|
const write1h = Math.min(usage.cacheCreation1hTokens ?? 0, usage.cacheCreationTokens);
|
|
87
87
|
const write5m = usage.cacheCreationTokens - write1h;
|
|
@@ -99,6 +99,9 @@ function addUsage(acc, u) {
|
|
|
99
99
|
acc.cacheCreation1hTokens = (acc.cacheCreation1hTokens ?? 0) + (u.cacheCreation1hTokens ?? 0);
|
|
100
100
|
acc.outputTokens += u.outputTokens;
|
|
101
101
|
acc.turns += u.turns;
|
|
102
|
+
acc.longContextInputTokens = (acc.longContextInputTokens ?? 0) + (u.longContextInputTokens ?? 0);
|
|
103
|
+
acc.longContextCacheReadTokens = (acc.longContextCacheReadTokens ?? 0) + (u.longContextCacheReadTokens ?? 0);
|
|
104
|
+
acc.longContextOutputTokens = (acc.longContextOutputTokens ?? 0) + (u.longContextOutputTokens ?? 0);
|
|
102
105
|
}
|
|
103
106
|
function cacheSavings(usageByModel) {
|
|
104
107
|
let saved = 0;
|
package/dist/cli.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
buildBlocks,
|
|
4
4
|
renderBlocksReport
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-Q5AEDWTI.js";
|
|
6
6
|
import {
|
|
7
7
|
findMcpServers
|
|
8
8
|
} from "./chunk-65BQE6TI.js";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
setTimezone,
|
|
18
18
|
tok,
|
|
19
19
|
usd
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-YVDSYDGL.js";
|
|
21
21
|
|
|
22
22
|
// src/cli.ts
|
|
23
23
|
import { createRequire } from "module";
|
|
@@ -234,7 +234,7 @@ program.command("blocks").description("Claude usage grouped into rolling 5-hour
|
|
|
234
234
|
});
|
|
235
235
|
program.command("statusline").description("compact usage line for Claude Code's statusLine hook (reads hook JSON on stdin)").argument("[action]", '"enable" writes the hook into ~/.claude/settings.json, "disable" removes it').option("--cost-source <mode>", "session cost source: auto | cc | calc | both", "auto").action(async (action, opts) => {
|
|
236
236
|
const globals = applyGlobals();
|
|
237
|
-
const sl = await import("./statusline-
|
|
237
|
+
const sl = await import("./statusline-ES3W3TEU.js");
|
|
238
238
|
if (action === "enable" || action === "disable") {
|
|
239
239
|
try {
|
|
240
240
|
console.log(action === "enable" ? await sl.enableStatusline() : await sl.disableStatusline());
|
|
@@ -276,7 +276,7 @@ program.action(async () => {
|
|
|
276
276
|
const [{ render }, React, { Root }, { Fullscreen }] = await Promise.all([
|
|
277
277
|
import("ink"),
|
|
278
278
|
import("react"),
|
|
279
|
-
import("./Root-
|
|
279
|
+
import("./Root-GBSQBWNF.js"),
|
|
280
280
|
import("./Fullscreen-GK2ZYXHV.js")
|
|
281
281
|
]);
|
|
282
282
|
render(React.createElement(Fullscreen, null, React.createElement(Root)));
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
buildBlocks,
|
|
4
4
|
burnRate,
|
|
5
5
|
fmtMs
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Q5AEDWTI.js";
|
|
7
7
|
import {
|
|
8
8
|
compact,
|
|
9
9
|
costUsd,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
parseTranscript,
|
|
13
13
|
shortModel,
|
|
14
14
|
usd
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-YVDSYDGL.js";
|
|
16
16
|
|
|
17
17
|
// src/statusline.ts
|
|
18
18
|
import { mkdir, readFile, stat, writeFile } from "fs/promises";
|