@trazum/cli 1.77.0 → 1.78.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 +10 -0
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +10 -0
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/types.d.ts +1 -0
- package/dist/i18n/types.d.ts.map +1 -1
- package/dist/index.js +27 -12
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/i18n/en.ts +10 -0
- package/src/i18n/es.ts +10 -0
- package/src/i18n/types.ts +1 -0
- package/src/index.ts +27 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trazum/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.78.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.78.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "^26.2.0",
|
package/src/i18n/en.ts
CHANGED
|
@@ -1744,6 +1744,16 @@ ${bold('EXAMPLES')}
|
|
|
1744
1744
|
? 'the log is empty — nothing was recorded'
|
|
1745
1745
|
: 'the log records labels and has never seen this one this month — possibly renamed, possibly idle, and neither is "under budget"',
|
|
1746
1746
|
cannotSayHeading: () => 'What this deliberately does not answer',
|
|
1747
|
+
cannotSay: (code) => {
|
|
1748
|
+
switch (code) {
|
|
1749
|
+
case 'session-limit-at-the-doors':
|
|
1750
|
+
return 'limits.sessionUsd is judged per call at the doors. A session is not a calendar scope, and a "session position for the month" would be an average wearing a limit\'s name.';
|
|
1751
|
+
case 'no-ceiling-configured':
|
|
1752
|
+
return 'No monthly budget and no limits are configured, so there is no ceiling to state a position against. spend.monthlyUsd and the limits block are where ceilings live.';
|
|
1753
|
+
default:
|
|
1754
|
+
return code;
|
|
1755
|
+
}
|
|
1756
|
+
},
|
|
1747
1757
|
unpriced: (count) =>
|
|
1748
1758
|
`${count} record(s) name a model the catalogue cannot price. They contribute nothing to any figure above — money nobody can see, said here rather than hidden.`,
|
|
1749
1759
|
source: () =>
|
package/src/i18n/es.ts
CHANGED
|
@@ -1762,6 +1762,16 @@ ${bold('EJEMPLOS')}
|
|
|
1762
1762
|
? 'el log está vacío — no se registró nada'
|
|
1763
1763
|
: 'el log registra etiquetas y no ha visto esta en todo el mes — quizá renombrada, quizá parada, y ninguna de las dos es «dentro del presupuesto»',
|
|
1764
1764
|
cannotSayHeading: () => 'Lo que deliberadamente no responde',
|
|
1765
|
+
cannotSay: (code) => {
|
|
1766
|
+
switch (code) {
|
|
1767
|
+
case 'session-limit-at-the-doors':
|
|
1768
|
+
return 'limits.sessionUsd se juzga llamada a llamada en las puertas. Una sesión no es un ámbito de calendario, y una «posición de sesión para el mes» sería una media disfrazada de límite.';
|
|
1769
|
+
case 'no-ceiling-configured':
|
|
1770
|
+
return 'No hay presupuesto mensual ni límites configurados, así que no existe techo contra el que declarar una posición. Los techos viven en spend.monthlyUsd y en el bloque limits.';
|
|
1771
|
+
default:
|
|
1772
|
+
return code;
|
|
1773
|
+
}
|
|
1774
|
+
},
|
|
1765
1775
|
unpriced: (count) =>
|
|
1766
1776
|
`${count} registro(s) nombran un modelo que el catálogo no puede tasar. No aportan nada a ninguna cifra de arriba — dinero que nadie ve, dicho aquí en vez de escondido.`,
|
|
1767
1777
|
source: () =>
|
package/src/i18n/types.ts
CHANGED
|
@@ -609,6 +609,7 @@ export interface CliMessages {
|
|
|
609
609
|
unmeasured(scope: string, why: string): string;
|
|
610
610
|
why(reason: 'no-clock' | 'no-labels' | 'nothing-recorded' | 'label-unseen'): string;
|
|
611
611
|
cannotSayHeading(): string;
|
|
612
|
+
cannotSay(code: string): string;
|
|
612
613
|
unpriced(count: number): string;
|
|
613
614
|
/** The source, named: this log alone, never merged with the store. */
|
|
614
615
|
source(): string;
|
package/src/index.ts
CHANGED
|
@@ -699,7 +699,10 @@ const COMMAND_FLAGS: Record<string, string[]> = {
|
|
|
699
699
|
function rejectUnknownFlags(args: Args, t: CliMessages): void {
|
|
700
700
|
const known = COMMAND_FLAGS[args.command];
|
|
701
701
|
if (!known) return;
|
|
702
|
-
|
|
702
|
+
// Deduplicated: a command that declares a flag the globals also carry
|
|
703
|
+
// (`--json`, `--pricing`, `--pricing-live`) listed it twice in the error,
|
|
704
|
+
// and a refusal that stutters reads like the tool is unsure what it takes.
|
|
705
|
+
const allowed = [...new Set([...known, ...GLOBAL_FLAGS])];
|
|
703
706
|
|
|
704
707
|
for (const name of args.flags.keys()) {
|
|
705
708
|
// `out` is stored under its long name even when given as `-o`, and a
|
|
@@ -2574,18 +2577,27 @@ async function commandWrite(args: Args, t: CliMessages): Promise<void> {
|
|
|
2574
2577
|
/**
|
|
2575
2578
|
* The workload name inside a Claude Code project folder.
|
|
2576
2579
|
*
|
|
2577
|
-
* Claude Code names those folders by encoding the project's absolute path
|
|
2578
|
-
* `/`
|
|
2579
|
-
*
|
|
2580
|
-
* the
|
|
2581
|
-
*
|
|
2582
|
-
*
|
|
2580
|
+
* Claude Code names those folders by encoding the project's absolute path
|
|
2581
|
+
* with `/` replaced by `-`: `~/.claude/projects/-Users-mac-Trazum`. **That
|
|
2582
|
+
* encoding cannot be undone.** Both `/` and `-` map to `-`, so nothing in
|
|
2583
|
+
* the folder name says which dashes were separators, and 1.77.0 shipped a
|
|
2584
|
+
* decoder that guessed the last segment and was wrong on every project
|
|
2585
|
+
* whose own name contains a hyphen — real examples from the run that found
|
|
2586
|
+
* it: `-Users-mac-ai-job-search-ai-job-search` labelled `search`, and
|
|
2587
|
+
* `-Users-mac-Desktop-Pulse-Coffee-pulse-coffee` labelled `coffee`. Two
|
|
2588
|
+
* different projects, both renamed to a word that was never their name.
|
|
2589
|
+
*
|
|
2590
|
+
* So the folder name stands as it is, minus the leading separator. It is
|
|
2591
|
+
* longer than a tidy guess and it is the one thing here that is certainly
|
|
2592
|
+
* true: a reader can find the folder it names. Presenting a decoding as a
|
|
2593
|
+
* fact when the encoding cannot support one is the failure this product
|
|
2594
|
+
* exists to refuse, and it does not get an exception for being convenient.
|
|
2583
2595
|
*/
|
|
2584
2596
|
function projectLabelFor(file: string): string | undefined {
|
|
2585
2597
|
const folder = dirname(resolvePath(file)).split('/').pop();
|
|
2586
2598
|
if (folder === undefined || folder === '') return undefined;
|
|
2587
|
-
const
|
|
2588
|
-
return
|
|
2599
|
+
const trimmed = folder.replace(/^-+/, '');
|
|
2600
|
+
return trimmed !== '' ? trimmed : folder;
|
|
2589
2601
|
}
|
|
2590
2602
|
|
|
2591
2603
|
async function commandFromClaudeCode(args: Args, t: CliMessages): Promise<void> {
|
|
@@ -2730,7 +2742,10 @@ async function commandSwitch(args: Args, pricing: PricingCatalogue, t: CliMessag
|
|
|
2730
2742
|
savingUsd >= 0
|
|
2731
2743
|
? t.switchCmd.saves(formatUsd(reprice.currentUsd), formatUsd(reprice.targetUsd), formatUsd(savingUsd))
|
|
2732
2744
|
: t.switchCmd.costs(formatUsd(reprice.currentUsd), formatUsd(reprice.targetUsd), formatUsd(-savingUsd));
|
|
2733
|
-
|
|
2745
|
+
// The same arrow the levers use. `switch` shipped with an ASCII `->`
|
|
2746
|
+
// in 1.74 and the 1.75 arc gave every report one visual vocabulary;
|
|
2747
|
+
// two glyphs for one meaning is the reader doing translation work.
|
|
2748
|
+
console.log(` ${savingUsd >= 0 ? c.green('\u2192') : c.red('\u2192')} ${wrap(line, 72, ' ')}`);
|
|
2734
2749
|
const movableCalls = reprice.slices.reduce((sum, slice) => sum + slice.calls, 0);
|
|
2735
2750
|
console.log(` ${wrap(t.switchCmd.movable(movableCalls, reprice.slices.length), 74, ' ')}`);
|
|
2736
2751
|
}
|
|
@@ -2984,8 +2999,8 @@ async function commandPosition(
|
|
|
2984
2999
|
if (document.cannotSay.length > 0) {
|
|
2985
3000
|
console.log();
|
|
2986
3001
|
console.log(` ${c.bold(t.position.cannotSayHeading())}`);
|
|
2987
|
-
for (const
|
|
2988
|
-
console.log(` ${c.dim(wrap(
|
|
3002
|
+
for (const code of document.cannotSay) {
|
|
3003
|
+
console.log(` ${c.dim(wrap(t.position.cannotSay(code), 70, ' '))}`);
|
|
2989
3004
|
}
|
|
2990
3005
|
}
|
|
2991
3006
|
if (document.unpricedRecords > 0) {
|