@trazum/cli 1.76.0 → 1.77.0
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/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +2 -0
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +2 -0
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/types.d.ts +2 -0
- package/dist/i18n/types.d.ts.map +1 -1
- package/dist/index.js +38 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/i18n/en.ts +2 -0
- package/src/i18n/es.ts +2 -0
- package/src/i18n/types.ts +2 -0
- package/src/index.ts +36 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trazum/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.77.0",
|
|
4
4
|
"description": "Trazum CLI: find where your LLM bill goes, price every finding per month, and enforce token budgets in CI.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "David Mu\u00f1oz Rey",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"prepublishOnly": "npm run build && npm test"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@trazum/core": "1.
|
|
40
|
+
"@trazum/core": "1.77.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "^26.2.0",
|
package/src/i18n/en.ts
CHANGED
|
@@ -1715,6 +1715,8 @@ ${bold('EXAMPLES')}
|
|
|
1715
1715
|
streamed: (count) => `${count} call(s) were written while still streaming; the final line's counts stood.`,
|
|
1716
1716
|
disagreements: (count) => `${count} call(s) had lines that disagreed beyond streaming growth — a count shrank, or another field changed. The last line stood, but that is a finding: worth a look at the transcript.`,
|
|
1717
1717
|
noRequestId: (count) => `${count} call(s) carried no request id, so nothing could be collapsed against them; each is priced as recorded.`,
|
|
1718
|
+
synthetic: (count) => `${count} turn(s) Claude Code wrote itself (model "<synthetic>") are not in the output: no provider ever billed them, so they are not calls.`,
|
|
1719
|
+
labelled: () => 'Labelled by project folder. Pass --no-label-from-project to leave the label off, or --label <name> to set one.',
|
|
1718
1720
|
skipped: (other, unparseable, withoutUsage) => `Passed over: ${other} non-assistant line(s) (the transcript's other business), ${unparseable} unparseable, ${withoutUsage} assistant line(s) without usage.`,
|
|
1719
1721
|
written: (file) => `Wrote ${file}.`,
|
|
1720
1722
|
},
|
package/src/i18n/es.ts
CHANGED
|
@@ -1733,6 +1733,8 @@ ${bold('EJEMPLOS')}
|
|
|
1733
1733
|
streamed: (count) => `${count} llamada(s) se escribieron aún en streaming; quedaron los recuentos de la línea final.`,
|
|
1734
1734
|
disagreements: (count) => `${count} llamada(s) tenían líneas en desacuerdo más allá del crecimiento del streaming — un recuento encogió, u otro campo cambió. Se quedó la última línea, pero es un hallazgo: merece un vistazo al transcript.`,
|
|
1735
1735
|
noRequestId: (count) => `${count} llamada(s) sin id de petición, así que nada pudo colapsarse contra ellas; cada una se tasa tal como quedó registrada.`,
|
|
1736
|
+
synthetic: (count) => `${count} turno(s) que Claude Code escribió por su cuenta (modelo «<synthetic>») quedan fuera de la salida: ningún proveedor los facturó, así que no son llamadas.`,
|
|
1737
|
+
labelled: () => 'Etiquetado por carpeta de proyecto. Usa --no-label-from-project para dejarlo sin etiqueta, o --label <nombre> para poner una.',
|
|
1736
1738
|
skipped: (other, unparseable, withoutUsage) => `Omitidas: ${other} línea(s) no-assistant (el resto del negocio del transcript), ${unparseable} imparseables, ${withoutUsage} línea(s) assistant sin usage.`,
|
|
1737
1739
|
written: (file) => `Escrito ${file}.`,
|
|
1738
1740
|
},
|
package/src/i18n/types.ts
CHANGED
|
@@ -585,6 +585,8 @@ export interface CliMessages {
|
|
|
585
585
|
/** Lines of one request disagreed beyond streaming growth. A finding. */
|
|
586
586
|
disagreements(count: number): string;
|
|
587
587
|
noRequestId(count: number): string;
|
|
588
|
+
synthetic(count: number): string;
|
|
589
|
+
labelled(): string;
|
|
588
590
|
skipped(other: number, unparseable: number, withoutUsage: number): string;
|
|
589
591
|
written(file: string): string;
|
|
590
592
|
};
|
package/src/index.ts
CHANGED
|
@@ -2571,6 +2571,23 @@ async function commandWrite(args: Args, t: CliMessages): Promise<void> {
|
|
|
2571
2571
|
* `cwd`, no branch name crosses the conversion; the suite plants one of
|
|
2572
2572
|
* each in a fixture and greps the whole output for them.
|
|
2573
2573
|
*/
|
|
2574
|
+
/**
|
|
2575
|
+
* The workload name inside a Claude Code project folder.
|
|
2576
|
+
*
|
|
2577
|
+
* Claude Code names those folders by encoding the project's absolute path,
|
|
2578
|
+
* `/` becoming `-`: `~/.claude/projects/-Users-mac-Trazum`. The last
|
|
2579
|
+
* segment of that encoding is the project's own directory name, which is
|
|
2580
|
+
* the word a person would have chosen. A documented decoding, not a guess
|
|
2581
|
+
* — and when decoding would leave nothing, the raw folder name stands,
|
|
2582
|
+
* because a label somebody can trace beats a tidy one they cannot.
|
|
2583
|
+
*/
|
|
2584
|
+
function projectLabelFor(file: string): string | undefined {
|
|
2585
|
+
const folder = dirname(resolvePath(file)).split('/').pop();
|
|
2586
|
+
if (folder === undefined || folder === '') return undefined;
|
|
2587
|
+
const decoded = folder.split('-').filter((part) => part !== '').pop();
|
|
2588
|
+
return decoded !== undefined && decoded !== '' ? decoded : folder;
|
|
2589
|
+
}
|
|
2590
|
+
|
|
2574
2591
|
async function commandFromClaudeCode(args: Args, t: CliMessages): Promise<void> {
|
|
2575
2592
|
const target = args.positional[0];
|
|
2576
2593
|
if (target === undefined) throw new Error(t.fromClaudeCode.noPath());
|
|
@@ -2596,7 +2613,20 @@ async function commandFromClaudeCode(args: Args, t: CliMessages): Promise<void>
|
|
|
2596
2613
|
}
|
|
2597
2614
|
|
|
2598
2615
|
const label = stringFlag(args, 'label');
|
|
2599
|
-
|
|
2616
|
+
/**
|
|
2617
|
+
* A folder of projects is a folder of workloads — the 1.77 default.
|
|
2618
|
+
*
|
|
2619
|
+
* The flag has existed since the folder walk did, and nobody found it: a
|
|
2620
|
+
* real forty-day run produced `label` on 0 of 10,393 records, and the
|
|
2621
|
+
* report could then only describe a mixture, which is exactly what it
|
|
2622
|
+
* said. The web app's folder drop has labelled by project since 1.70, so
|
|
2623
|
+
* the two surfaces disagreed about the same gesture.
|
|
2624
|
+
*
|
|
2625
|
+
* Default-on for a directory, `--no-label-from-project` to decline. A
|
|
2626
|
+
* single file is untouched: one file is one workload only if the caller
|
|
2627
|
+
* says so.
|
|
2628
|
+
*/
|
|
2629
|
+
const labelFromProject = boolFlag(args, 'label-from-project', info.isDirectory());
|
|
2600
2630
|
const lines: string[] = [];
|
|
2601
2631
|
let records = 0;
|
|
2602
2632
|
let collapsed = 0;
|
|
@@ -2606,9 +2636,10 @@ async function commandFromClaudeCode(args: Args, t: CliMessages): Promise<void>
|
|
|
2606
2636
|
let withoutUsage = 0;
|
|
2607
2637
|
let streamed = 0;
|
|
2608
2638
|
let disagreements = 0;
|
|
2639
|
+
let synthetic = 0;
|
|
2609
2640
|
for (const file of files) {
|
|
2610
2641
|
const text = await readFile(file, 'utf8');
|
|
2611
|
-
const projectLabel = labelFromProject ?
|
|
2642
|
+
const projectLabel = labelFromProject ? projectLabelFor(file) : undefined;
|
|
2612
2643
|
const conversion = claudeCodeRecords(text, {
|
|
2613
2644
|
...(label !== undefined
|
|
2614
2645
|
? { label }
|
|
@@ -2625,6 +2656,7 @@ async function commandFromClaudeCode(args: Args, t: CliMessages): Promise<void>
|
|
|
2625
2656
|
withoutUsage += conversion.assistantWithoutUsage;
|
|
2626
2657
|
streamed += conversion.streamed;
|
|
2627
2658
|
disagreements += conversion.disagreements;
|
|
2659
|
+
synthetic += conversion.synthetic;
|
|
2628
2660
|
}
|
|
2629
2661
|
|
|
2630
2662
|
const out = stringFlag(args, 'out') ?? stringFlag(args, 'o');
|
|
@@ -2640,6 +2672,8 @@ async function commandFromClaudeCode(args: Args, t: CliMessages): Promise<void>
|
|
|
2640
2672
|
if (streamed > 0) console.error(t.fromClaudeCode.streamed(streamed));
|
|
2641
2673
|
if (disagreements > 0) console.error(t.fromClaudeCode.disagreements(disagreements));
|
|
2642
2674
|
if (noRequestId > 0) console.error(t.fromClaudeCode.noRequestId(noRequestId));
|
|
2675
|
+
if (synthetic > 0) console.error(t.fromClaudeCode.synthetic(synthetic));
|
|
2676
|
+
if (labelFromProject && label === undefined) console.error(t.fromClaudeCode.labelled());
|
|
2643
2677
|
console.error(t.fromClaudeCode.skipped(otherLines, unparseable, withoutUsage));
|
|
2644
2678
|
}
|
|
2645
2679
|
|