@sunasteriskrnd/takumi 1.0.0-dev.40 → 1.0.0-dev.41
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/dist/index.js +9 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -19815,7 +19815,7 @@ var package_default;
|
|
|
19815
19815
|
var init_package = __esm(() => {
|
|
19816
19816
|
package_default = {
|
|
19817
19817
|
name: "@sunasteriskrnd/takumi",
|
|
19818
|
-
version: "1.0.0-dev.
|
|
19818
|
+
version: "1.0.0-dev.41",
|
|
19819
19819
|
description: "CLI tool for bootstrapping and managing Takumi projects",
|
|
19820
19820
|
type: "module",
|
|
19821
19821
|
repository: {
|
|
@@ -70515,14 +70515,20 @@ function compactionBoundary(records) {
|
|
|
70515
70515
|
}
|
|
70516
70516
|
|
|
70517
70517
|
// src/domains/hooks/telemetry/lib/transcript-metrics.ts
|
|
70518
|
+
function isInterruptRecord(record) {
|
|
70519
|
+
if (record.promptSource != null)
|
|
70520
|
+
return false;
|
|
70521
|
+
return isInterruptText(peekText(record.message?.content));
|
|
70522
|
+
}
|
|
70518
70523
|
function deriveTranscriptMetrics(records) {
|
|
70519
70524
|
let turnCount = 0;
|
|
70520
70525
|
let apiErrorCount = 0;
|
|
70521
70526
|
for (const record of records) {
|
|
70522
70527
|
if (record.isApiErrorMessage === true)
|
|
70523
70528
|
apiErrorCount += 1;
|
|
70524
|
-
if (record.type === "
|
|
70529
|
+
if (record.type === "user" && record.toolUseResult === undefined && !record.isMeta && !record.isSidechain && !record.isCompactSummary && !isInterruptRecord(record)) {
|
|
70525
70530
|
turnCount += 1;
|
|
70531
|
+
}
|
|
70526
70532
|
}
|
|
70527
70533
|
return { turnCount, apiErrorCount };
|
|
70528
70534
|
}
|
|
@@ -70550,7 +70556,7 @@ function foldRecordsIntoSummary(summary, records, nextOffset, newFingerprint, co
|
|
|
70550
70556
|
const { mainLoopDelta, subagentDeltas, tokenUsageDeltas } = bucketTokens(records);
|
|
70551
70557
|
const metrics = deriveTranscriptMetrics(records);
|
|
70552
70558
|
const merged = mergeSummary(summary, {
|
|
70553
|
-
turn_count: metrics.turnCount,
|
|
70559
|
+
...metrics.turnCount > 0 ? { turn_count: metrics.turnCount } : {},
|
|
70554
70560
|
api_error_count: metrics.apiErrorCount
|
|
70555
70561
|
});
|
|
70556
70562
|
merged.main_loop_tokens = addTokens3(summary.main_loop_tokens, mainLoopDelta);
|