@tokz/cli 0.2.13 → 0.2.15
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.
|
@@ -749,9 +749,6 @@ function rawOrNormalizedTimestamp(v) {
|
|
|
749
749
|
}
|
|
750
750
|
return normalizeTimestamp(v);
|
|
751
751
|
}
|
|
752
|
-
function tsSecond(ts) {
|
|
753
|
-
return (ts ?? "").slice(0, 19);
|
|
754
|
-
}
|
|
755
752
|
function parseLine(raw) {
|
|
756
753
|
let obj;
|
|
757
754
|
try {
|
|
@@ -772,20 +769,6 @@ function parseLine(raw) {
|
|
|
772
769
|
function tokenCountInfo(p) {
|
|
773
770
|
return p.type === "event_msg" && p.payload?.type === "token_count" ? asDict(p.payload.info) : void 0;
|
|
774
771
|
}
|
|
775
|
-
function replayBurstSecond(content, lines) {
|
|
776
|
-
const head = content.slice(0, 16384);
|
|
777
|
-
if (!head.includes("thread_spawn") && !head.includes("forked_from_id")) return void 0;
|
|
778
|
-
let first;
|
|
779
|
-
for (const p of lines) {
|
|
780
|
-
const info = tokenCountInfo(p);
|
|
781
|
-
if (!info) continue;
|
|
782
|
-
if (!asDict(info.last_token_usage) && !asDict(info.total_token_usage)) continue;
|
|
783
|
-
const sec = tsSecond(p.timestamp);
|
|
784
|
-
if (first === void 0) first = sec;
|
|
785
|
-
else return first === sec ? first : void 0;
|
|
786
|
-
}
|
|
787
|
-
return void 0;
|
|
788
|
-
}
|
|
789
772
|
function headlessUsage(o) {
|
|
790
773
|
const usage = rawUsage(asDict(o.usage)) ?? rawUsage(asDict(asDict(o.data)?.usage)) ?? rawUsage(asDict(asDict(o.result)?.usage)) ?? rawUsage(asDict(asDict(o.response)?.usage));
|
|
791
774
|
if (!usage) return void 0;
|
|
@@ -810,8 +793,6 @@ async function parseCodexRollout(file, seen = /* @__PURE__ */ new Set()) {
|
|
|
810
793
|
const parsed = parseLine(raw);
|
|
811
794
|
if (parsed) lines.push(parsed);
|
|
812
795
|
}
|
|
813
|
-
const burstSecond = replayBurstSecond(content, lines);
|
|
814
|
-
let skippingReplay = burstSecond !== void 0;
|
|
815
796
|
const modelState = { currentIsFallback: false };
|
|
816
797
|
let prev;
|
|
817
798
|
let turnTools = [];
|
|
@@ -886,12 +867,6 @@ async function parseCodexRollout(file, seen = /* @__PURE__ */ new Set()) {
|
|
|
886
867
|
const totals = rawUsage(info.total_token_usage);
|
|
887
868
|
const last = rawUsage(info.last_token_usage);
|
|
888
869
|
if (!last && !totals) continue;
|
|
889
|
-
if (skippingReplay && tsSecond(timestamp) === burstSecond) {
|
|
890
|
-
if (totals) prev = totals;
|
|
891
|
-
turnTools = [];
|
|
892
|
-
continue;
|
|
893
|
-
}
|
|
894
|
-
skippingReplay = false;
|
|
895
870
|
const usage2 = last ?? subtractUsage(totals, prev);
|
|
896
871
|
if (totals) prev = totals;
|
|
897
872
|
if (usage2.input === 0 && usage2.cached === 0 && usage2.output === 0 && usage2.reasoning === 0) {
|
package/dist/cli.js
CHANGED
|
@@ -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-ZXWUSTBH.js"),
|
|
280
280
|
import("./Fullscreen-GK2ZYXHV.js")
|
|
281
281
|
]);
|
|
282
282
|
render(React.createElement(Fullscreen, null, React.createElement(Root)));
|