@trazum/cli 1.56.1 → 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 +5 -0
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +6 -0
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/types.d.ts +13 -0
- package/dist/i18n/types.d.ts.map +1 -1
- package/dist/index.js +28 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/i18n/en.ts +7 -0
- package/src/i18n/es.ts +8 -0
- package/src/i18n/types.ts +13 -0
- package/src/index.ts +32 -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
|
@@ -924,6 +924,13 @@ ${bold('EXAMPLES')}
|
|
|
924
924
|
dictionaryCoverage: (languages) =>
|
|
925
925
|
` The phrase dictionaries cover ${languages}. A prompt in another language `
|
|
926
926
|
+ 'is not necessarily efficient — it may just be one Trazum cannot read yet.',
|
|
927
|
+
dictionaryUnreviewed: (languages) =>
|
|
928
|
+
` Of those, ${languages} carry entries nobody here reads: written by the same `
|
|
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.',
|
|
927
934
|
levelAggressive: () => '[aggressive]',
|
|
928
935
|
levelSafe: () => '[safe]',
|
|
929
936
|
ruleHits: (hits, tokensSaved) => `(${hits}×, ~${tokensSaved} tokens)`,
|
package/src/i18n/es.ts
CHANGED
|
@@ -943,6 +943,14 @@ ${bold('EJEMPLOS')}
|
|
|
943
943
|
` Los diccionarios de frases cubren ${languages}. Un prompt en otro idioma `
|
|
944
944
|
+ 'no es necesariamente eficiente: puede ser simplemente uno que Trazum '
|
|
945
945
|
+ 'todavía no sabe leer.',
|
|
946
|
+
dictionaryUnreviewed: (languages) =>
|
|
947
|
+
` De esos, ${languages} llevan entradas que nadie aquí lee: escritas por el `
|
|
948
|
+
+ 'mismo proceso que escribió las reglas, nunca aprobadas por alguien que '
|
|
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.',
|
|
946
954
|
levelAggressive: () => '[agresiva]',
|
|
947
955
|
levelSafe: () => '[segura]',
|
|
948
956
|
ruleHits: (hits, tokensSaved) => `(${hits}×, ~${tokensSaved} tokens)`,
|
package/src/i18n/types.ts
CHANGED
|
@@ -92,6 +92,19 @@ export interface CliMessages {
|
|
|
92
92
|
nothingToTrim(): string;
|
|
93
93
|
/** The languages the phrase dictionaries cover, printed when nothing fired. */
|
|
94
94
|
dictionaryCoverage(languages: string): string;
|
|
95
|
+
/**
|
|
96
|
+
* Of those, the ones nobody here has been shown to read.
|
|
97
|
+
*
|
|
98
|
+
* Its own line rather than a qualifier inside `dictionaryCoverage`, because
|
|
99
|
+
* the day somebody maintains all seven it is deleted rather than reworded.
|
|
100
|
+
*/
|
|
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;
|
|
95
108
|
levelAggressive(): string;
|
|
96
109
|
levelSafe(): string;
|
|
97
110
|
ruleHits(hits: number, tokensSaved: number): string;
|
package/src/index.ts
CHANGED
|
@@ -95,6 +95,9 @@ import {
|
|
|
95
95
|
optimize,
|
|
96
96
|
parseBaseline,
|
|
97
97
|
PHRASE_LANGUAGES,
|
|
98
|
+
detectTextLanguage,
|
|
99
|
+
dictionaryStanding,
|
|
100
|
+
languagesWithStanding,
|
|
98
101
|
plannedCalls,
|
|
99
102
|
PRICING_LAST_REVIEWED,
|
|
100
103
|
profilePrompt,
|
|
@@ -883,6 +886,27 @@ function printReport(
|
|
|
883
886
|
if (result.rules.length > 0) {
|
|
884
887
|
console.log();
|
|
885
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
|
+
}
|
|
886
910
|
for (const rule of result.rules) {
|
|
887
911
|
const tag =
|
|
888
912
|
rule.level === 'aggressive'
|
|
@@ -911,6 +935,14 @@ function printReport(
|
|
|
911
935
|
// Which languages the dictionaries actually cover. Only here, because this
|
|
912
936
|
// is the one branch where silence reads as "your prompt is already clean".
|
|
913
937
|
console.log(c.dim(t.report.dictionaryCoverage(languageNames(PHRASE_LANGUAGES, t))));
|
|
938
|
+
// And which of them nobody here reads. Naming the seven and stopping there
|
|
939
|
+
// reads as seven equal dictionaries; five of them have never been agreed by
|
|
940
|
+
// a speaker of the language, and a reader deciding whether to trust an
|
|
941
|
+
// empty result deserves the difference.
|
|
942
|
+
const unreviewed = languagesWithStanding(PHRASE_LANGUAGES, 'unreviewed');
|
|
943
|
+
if (unreviewed.length > 0) {
|
|
944
|
+
console.log(c.dim(t.report.dictionaryUnreviewed(languageNames(unreviewed, t))));
|
|
945
|
+
}
|
|
914
946
|
}
|
|
915
947
|
|
|
916
948
|
if (result.llm) {
|