@trazum/cli 1.56.2 → 1.59.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 +3 -0
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +3 -0
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/types.d.ts +6 -0
- package/dist/i18n/types.d.ts.map +1 -1
- package/dist/index.js +20 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/i18n/en.ts +4 -0
- package/src/i18n/es.ts +4 -0
- package/src/i18n/types.ts +6 -0
- package/src/index.ts +23 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trazum/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.59.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.59.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "^26.2.0",
|
package/src/i18n/en.ts
CHANGED
|
@@ -927,6 +927,10 @@ ${bold('EXAMPLES')}
|
|
|
927
927
|
dictionaryUnreviewed: (languages) =>
|
|
928
928
|
` Of those, ${languages} carry entries nobody here reads: written by the same `
|
|
929
929
|
+ 'process that wrote the rules, never agreed by a speaker of the language.',
|
|
930
|
+
dictionaryAppliedUnreviewed: (language) =>
|
|
931
|
+
` These changes came from the ${language} dictionary, which nobody here reads. `
|
|
932
|
+
+ 'Its entries were written by the same process that wrote the rules and never '
|
|
933
|
+
+ 'agreed by a speaker — read the diff before trusting it.',
|
|
930
934
|
levelAggressive: () => '[aggressive]',
|
|
931
935
|
levelSafe: () => '[safe]',
|
|
932
936
|
ruleHits: (hits, tokensSaved) => `(${hits}×, ~${tokensSaved} tokens)`,
|
package/src/i18n/es.ts
CHANGED
|
@@ -947,6 +947,10 @@ ${bold('EJEMPLOS')}
|
|
|
947
947
|
` De esos, ${languages} llevan entradas que nadie aquí lee: escritas por el `
|
|
948
948
|
+ 'mismo proceso que escribió las reglas, nunca aprobadas por alguien que '
|
|
949
949
|
+ 'hable el idioma.',
|
|
950
|
+
dictionaryAppliedUnreviewed: (language) =>
|
|
951
|
+
` Estos cambios vienen del diccionario de ${language}, que nadie aquí lee. `
|
|
952
|
+
+ 'Sus entradas las escribió el mismo proceso que escribió las reglas y nunca '
|
|
953
|
+
+ 'las aprobó alguien que hable el idioma: revisa el diff antes de fiarte.',
|
|
950
954
|
levelAggressive: () => '[agresiva]',
|
|
951
955
|
levelSafe: () => '[segura]',
|
|
952
956
|
ruleHits: (hits, tokensSaved) => `(${hits}×, ~${tokensSaved} tokens)`,
|
package/src/i18n/types.ts
CHANGED
|
@@ -99,6 +99,12 @@ export interface CliMessages {
|
|
|
99
99
|
* the day somebody maintains all seven it is deleted rather than reworded.
|
|
100
100
|
*/
|
|
101
101
|
dictionaryUnreviewed(languages: string): string;
|
|
102
|
+
/**
|
|
103
|
+
* The prompt just changed, and the dictionary that changed it is one
|
|
104
|
+
* nobody here reads. Printed only when the prompt's own language is
|
|
105
|
+
* detected and unreviewed — never as a footer under every report.
|
|
106
|
+
*/
|
|
107
|
+
dictionaryAppliedUnreviewed(language: string): string;
|
|
102
108
|
levelAggressive(): string;
|
|
103
109
|
levelSafe(): string;
|
|
104
110
|
ruleHits(hits: number, tokensSaved: number): string;
|
package/src/index.ts
CHANGED
|
@@ -95,6 +95,8 @@ import {
|
|
|
95
95
|
optimize,
|
|
96
96
|
parseBaseline,
|
|
97
97
|
PHRASE_LANGUAGES,
|
|
98
|
+
detectTextLanguage,
|
|
99
|
+
dictionaryStanding,
|
|
98
100
|
languagesWithStanding,
|
|
99
101
|
plannedCalls,
|
|
100
102
|
PRICING_LAST_REVIEWED,
|
|
@@ -884,6 +886,27 @@ function printReport(
|
|
|
884
886
|
if (result.rules.length > 0) {
|
|
885
887
|
console.log();
|
|
886
888
|
console.log(c.bold(t.report.rulesApplied()));
|
|
889
|
+
/**
|
|
890
|
+
* Whose judgement just edited this prompt.
|
|
891
|
+
*
|
|
892
|
+
* Five of the seven dictionaries were written without anybody who reads the
|
|
893
|
+
* language agreeing to an entry, and the branch where that matters most is
|
|
894
|
+
* this one: the rules did not stay silent, they changed somebody's text.
|
|
895
|
+
* The coverage line under `nothingToTrim` cannot cover it — by then the
|
|
896
|
+
* prompt is untouched.
|
|
897
|
+
*
|
|
898
|
+
* Gated on the prompt's own detected language, so an English or Spanish
|
|
899
|
+
* prompt never sees it and it never becomes a footer. `detectTextLanguage`
|
|
900
|
+
* answers null on a short or mixed prompt, and this stays silent then:
|
|
901
|
+
* not-detected is not not-unreviewed, and guessing the language in order to
|
|
902
|
+
* warn about it would be the same overreach the detector exists to refuse.
|
|
903
|
+
*/
|
|
904
|
+
const promptLanguage = detectTextLanguage(result.original);
|
|
905
|
+
if (promptLanguage !== null && dictionaryStanding(promptLanguage)?.standing === 'unreviewed') {
|
|
906
|
+
console.log(
|
|
907
|
+
c.yellow(t.report.dictionaryAppliedUnreviewed(t.languages[promptLanguage] ?? promptLanguage)),
|
|
908
|
+
);
|
|
909
|
+
}
|
|
887
910
|
for (const rule of result.rules) {
|
|
888
911
|
const tag =
|
|
889
912
|
rule.level === 'aggressive'
|