@trazum/cli 1.82.0 → 1.85.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.
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Providers whose tokens an optional package can count exactly, by provider id.
3
+ *
4
+ * Its own module rather than a constant inside the command, because two
5
+ * different readers need it: the CLI, to decide whether to try loading one, and
6
+ * `band-family.test.js`, which walks every priced provider and asserts that the
7
+ * ones this tool cannot count are refused by name. That suite's whole design is
8
+ * that a family leaves its assertions by *becoming countable* rather than by
9
+ * anybody editing the test -- which only works if there is one place that says
10
+ * which families those are.
11
+ *
12
+ * A map rather than a list, so the refusal for a family that is not installed
13
+ * can name the package that would fix it.
14
+ */
15
+ export declare const OPTIONAL_COUNTERS: Readonly<Record<string, string>>;
16
+ /** Whether some optional package exists that counts this provider exactly. */
17
+ export declare const countableLocally: (provider: string | null | undefined) => boolean;
18
+ //# sourceMappingURL=optional-counters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optional-counters.d.ts","sourceRoot":"","sources":["../src/optional-counters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAE7D,CAAC;AAEH,8EAA8E;AAC9E,eAAO,MAAM,gBAAgB,aAAc,MAAM,GAAG,IAAI,GAAG,SAAS,KAAG,OACO,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Providers whose tokens an optional package can count exactly, by provider id.
3
+ *
4
+ * Its own module rather than a constant inside the command, because two
5
+ * different readers need it: the CLI, to decide whether to try loading one, and
6
+ * `band-family.test.js`, which walks every priced provider and asserts that the
7
+ * ones this tool cannot count are refused by name. That suite's whole design is
8
+ * that a family leaves its assertions by *becoming countable* rather than by
9
+ * anybody editing the test -- which only works if there is one place that says
10
+ * which families those are.
11
+ *
12
+ * A map rather than a list, so the refusal for a family that is not installed
13
+ * can name the package that would fix it.
14
+ */
15
+ export const OPTIONAL_COUNTERS = Object.freeze({
16
+ openai: '@trazum/tokenizer-openai',
17
+ });
18
+ /** Whether some optional package exists that counts this provider exactly. */
19
+ export const countableLocally = (provider) => provider !== null && provider !== undefined && provider in OPTIONAL_COUNTERS;
20
+ //# sourceMappingURL=optional-counters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optional-counters.js","sourceRoot":"","sources":["../src/optional-counters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAqC,MAAM,CAAC,MAAM,CAAC;IAC/E,MAAM,EAAE,0BAA0B;CACnC,CAAC,CAAC;AAEH,8EAA8E;AAC9E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAAmC,EAAW,EAAE,CAC/E,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,IAAI,iBAAiB,CAAC"}
package/dist/style.d.ts CHANGED
@@ -12,6 +12,17 @@
12
12
  * stays plain: every `trazum ... | grep` in somebody's script is owed the
13
13
  * bytes their script was written against.
14
14
  */
15
+ /**
16
+ * The variables the decision below reads.
17
+ *
18
+ * Exported for the same reason `LOCALE_ENV_VARS` is: the test suite has to
19
+ * neutralise the machine before asserting on output, and a list of what to
20
+ * neutralise kept in the test file drifts from the list that is read here. It
21
+ * drifted once already, in the other direction: `env.mjs` set `NO_COLOR` and
22
+ * left `FORCE_COLOR` alone, so a contributor whose shell exports `FORCE_COLOR`
23
+ * ran the whole CLI suite against painted output and twenty-nine tests failed.
24
+ */
25
+ export declare const COLOUR_ENV_VARS: readonly ['FORCE_COLOR', 'NO_COLOR'];
15
26
  export declare const useColor: boolean;
16
27
  export declare const c: {
17
28
  bold: (s: string) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,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AM;IACjB,GAAG,MAAM,MAAM;IACf,MAAM,MAAM,MAAM;IAClB,IAAI,MAAM,MAAM;CACjB,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,YAAY,KAAK,CAAC;AAI/B;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAGjF;AAED,MAAM,WAAW,WAAW;IAC1B,gFAAgF;IAChF,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,SAAO,GAAG,MAAM,EAAE,CAiBvF;AAED;;;;;;;;GAQG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,MAAM,CAIrD;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,SAAe,GAAG,MAAM,CAGzE"}
package/dist/style.js CHANGED
@@ -12,6 +12,17 @@
12
12
  * stays plain: every `trazum ... | grep` in somebody's script is owed the
13
13
  * bytes their script was written against.
14
14
  */
15
+ /**
16
+ * The variables the decision below reads.
17
+ *
18
+ * Exported for the same reason `LOCALE_ENV_VARS` is: the test suite has to
19
+ * neutralise the machine before asserting on output, and a list of what to
20
+ * neutralise kept in the test file drifts from the list that is read here. It
21
+ * drifted once already, in the other direction: `env.mjs` set `NO_COLOR` and
22
+ * left `FORCE_COLOR` alone, so a contributor whose shell exports `FORCE_COLOR`
23
+ * ran the whole CLI suite against painted output and twenty-nine tests failed.
24
+ */
25
+ export const COLOUR_ENV_VARS = ['FORCE_COLOR', 'NO_COLOR'];
15
26
  const forced = process.env.FORCE_COLOR === '1';
16
27
  export const useColor = forced || (process.stdout.isTTY === true && process.env.NO_COLOR === undefined);
17
28
  export const c = {
package/dist/style.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,GAAG,CAAC;AAC/C,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC;AAExG,MAAM,CAAC,MAAM,CAAC,GAAG;IACf,IAAI,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/D,GAAG,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9D,KAAK,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IACjE,GAAG,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/D,MAAM,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAClE,IAAI,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CA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AC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC;AACxE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,KAAK,GAAG,YAAY;IAC/D,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACzD,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC;AAChE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trazum/cli",
3
- "version": "1.82.0",
3
+ "version": "1.85.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",
@@ -41,7 +41,7 @@
41
41
  "prepublishOnly": "npm run build && npm test"
42
42
  },
43
43
  "dependencies": {
44
- "@trazum/core": "1.82.0"
44
+ "@trazum/core": "1.85.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/node": "^26.2.0",
package/src/i18n/en.ts CHANGED
@@ -59,10 +59,12 @@ ${bold('USAGE')}
59
59
  trazum schema <contract>
60
60
  trazum rollup <document...|dir> [--json] [--html-out <file>]
61
61
  trazum position <usage.jsonl>
62
+ trazum receipt <usage.jsonl|dir> [--stamp] [-o <file>]
62
63
  trazum from-claude-code <file|dir> [--label <name>] [-o <file>]
63
64
  trazum from-otel <file|dir> [--label-from-service] [-o <file>]
64
65
  trazum from-litellm <file|dir> [-o <file>]
65
66
  trazum from-helicone <file|dir> [-o <file>]
67
+ trazum from-langsmith <file|dir> [-o <file>]
66
68
  trazum switch <usage.jsonl> --to <model> [--migration-usd <n>] [--cases <n>]
67
69
  trazum ownrate --gpu-usd-hour <n> --tokens-per-second <n> [--utilization <0-1>]
68
70
  trazum pulse [--max-stale-hours <n>]
@@ -181,6 +183,18 @@ ${bold('OPTIONS FOR from-helicone')}
181
183
  conversation, so the records carry no session and the conversation findings
182
184
  cannot be answered from this log; that is said on every run.
183
185
 
186
+ ${bold('OPTIONS FOR from-langsmith')}
187
+ -o, --out <file> Write the usage log there instead of stdout.
188
+
189
+ A LangSmith run export, read as a usage log: model, timestamp, label, the
190
+ trace as the session, and the token counts, and nothing else. The inputs and
191
+ the outputs stay in the run, and the metadata bag is read for named keys and
192
+ never copied. Only run_type "llm" is a call: chains, tools and retrievers are
193
+ skipped and counted, because the chain wrapping a call repeats its child's
194
+ tokens. A run whose metadata names no model is refused rather than priced by
195
+ the run's name, which is a client class. LangSmith's own cost is reported on
196
+ its own and never merged into Trazum's.
197
+
184
198
  ${bold('OPTIONS FOR from-litellm')}
185
199
  -o, --out <file> Write the usage log there instead of stdout.
186
200
 
@@ -230,6 +244,26 @@ ${bold('OPTIONS FOR position')}
230
244
  floor, on an over, and on a zero rate: never a forecast, and no field in
231
245
  the document names a date.
232
246
 
247
+ ${bold('OPTIONS FOR receipt')}
248
+ --stamp Record the emission time in the document. Off by
249
+ default so two runs on one log produce the same
250
+ bytes: the period the figures cover is already in
251
+ there, from the log's own clock.
252
+ -o, --out <file> Write the receipt there instead of to standard
253
+ output. The summary always goes to standard
254
+ error, so a redirect writes a document and not a
255
+ document with a summary stapled to the front.
256
+ --pricing <file> Price it with your own card instead of the
257
+ bundled catalogue.
258
+ --pricing-live Price it against live rates via OpenRouter.
259
+
260
+ A profile answers where it ran. A receipt is the same figures shaped so they
261
+ still answer somewhere else: every line carries the rates behind its money
262
+ and the date that provider's rates were last read off its own page. What is
263
+ not in it is prompt text, answers, file paths, branch names, credentials and
264
+ sessions: not redacted, absent, because the shape it is built from has no
265
+ field that can hold them. It sends nothing anywhere.
266
+
233
267
  ${bold('OPTIONS FOR pulse')}
234
268
  --max-stale-hours <n> Exit 1 when something that runs here has not run
235
269
  in over n hours. Without it, the ages are
@@ -1008,6 +1042,14 @@ ${bold('EXAMPLES')}
1008
1042
  },
1009
1043
 
1010
1044
  errors: {
1045
+ fileNotFound: (path) =>
1046
+ `${path}: not found. Check the path, or point this at the directory that holds it.`,
1047
+ fileIsDirectory: (path) =>
1048
+ `${path} is a directory, and this command reads a file. Name the file inside it, or use a command that walks a folder.`,
1049
+ fileIsDirectoryUnnamed: () =>
1050
+ 'that path is a directory, and this command reads a file. Name the file inside it, or use a command that walks a folder.',
1051
+ fileNotReadable: (path) =>
1052
+ `${path}: no permission to read it. Check the file's owner and mode, then run this again.`,
1011
1053
  livePricingFailed: (url: string, detail: string) =>
1012
1054
  `Could not load live prices from ${url}: ${detail}. The bundled prices are still there. Drop --pricing-live to use them.`,
1013
1055
  optionNeedsValue: (name) => `Option --${name} needs a value.`,
@@ -1057,6 +1099,12 @@ ${bold('EXAMPLES')}
1057
1099
  }. Counting it there would either be refused upstream or return a number for a different tokenizer, and this tool will not label that exact. Drop --exact-tokens for the estimate, which is honest about being one, or count with ${
1058
1100
  provider === null ? "that model's" : provider + "'s"
1059
1101
  } own tooling.`,
1102
+ exactTokensNeedsPackage: (model, packageName) =>
1103
+ `--exact-tokens can count ${model} exactly, offline and without a key, but that ` +
1104
+ `needs ${packageName}, which is not installed. It is a separate package because its ` +
1105
+ 'rank tables are twenty-two megabytes and @trazum/core depends on nothing.\n' +
1106
+ ` npm install ${packageName}\n` +
1107
+ 'Or drop --exact-tokens for the estimate, which says how far out it is.',
1060
1108
  checkNeedsMaxTokens: () => 'trazum check needs --max-tokens <n>.',
1061
1109
  evalNeedsCases: () => 'trazum eval needs --cases <file>.',
1062
1110
  unknownExportFormat: (received, allowed) =>
@@ -1171,7 +1219,7 @@ ${bold('EXAMPLES')}
1171
1219
  beyondThisPromptTokensOnly: () =>
1172
1220
  'Shortening a prompt is the smallest lever there is: measured on an ordinary support prompt, the rules recover about 1% of a monthly bill. If any of your prompts go to a metered API, "trazum profile <usage.jsonl>" reads what the provider actually charged and prices the levers that are not the prompt. Recording that log is a few lines and it never contains prompt text.',
1173
1221
  beyondThisPrompt: () =>
1174
- 'Shortening a prompt is the smallest lever there is: measured on an ordinary support prompt, the rules recover about 1% of a monthly bill. On a metered API the things that move 40% to 80% are which model the call goes to, the Batch API, prompt caching, and what re-sending the conversation costs, and "trazum profile <usage.jsonl>" prices all four from what the provider actually charged. Recording that log is a few lines and it never contains prompt text.',
1222
+ 'Shortening a prompt is the smallest lever there is: measured on an ordinary support prompt, the rules recover about 1% of a monthly bill. On a metered API the things that move 60% to 80% are which model the call goes to, the Batch API, prompt caching, and what re-sending the conversation costs, and "trazum profile <usage.jsonl>" prices all four from what the provider actually charged. Recording that log is a few lines and it never contains prompt text.',
1175
1223
  windowUse: (before, after, model, window) =>
1176
1224
  `Context window: ${before} → ${after} of ${model}'s ${window} tokens, room the conversation gets instead.`,
1177
1225
  tokensOnlyAskedFor: () =>
@@ -1724,6 +1772,19 @@ ${bold('EXAMPLES')}
1724
1772
  snippetHeading: () => 'Paste into trazum.config.json (the "pricing" overlay file):',
1725
1773
  },
1726
1774
 
1775
+ receipt: {
1776
+ noLog: () => 'Name a usage log to make a receipt from.',
1777
+ written: (file, lines) => `Wrote a receipt of ${lines} line(s) to ${file}.`,
1778
+ summary: (lines, usd) =>
1779
+ `${lines} line(s), ${usd} priced. Every figure carries the rate behind it and the date that rate was reviewed.`,
1780
+ unpriced: (models, calls) =>
1781
+ `${models} model(s) the catalogue does not price, covering ${calls} call(s): named in the receipt's gaps, and kept out of the total rather than costed at zero.`,
1782
+ unread: (count) => `${count} line(s) of the log could not be read, and the receipt says so.`,
1783
+ noClock: () =>
1784
+ 'The log carries no clock, so the receipt is unbounded in time and states that rather than inventing a period.',
1785
+ nothingToBill: () => 'Nothing in this log could be priced, so the receipt has no lines.',
1786
+ },
1787
+
1727
1788
  fromOtel: {
1728
1789
  noPath: () => 'from-otel needs an OTLP file or directory: trazum from-otel spans.json',
1729
1790
  notFound: (path) => `${path}: not found`,
@@ -1756,6 +1817,25 @@ ${bold('EXAMPLES')}
1756
1817
  written: (file) => `Wrote ${file}.`,
1757
1818
  },
1758
1819
 
1820
+ fromLangsmith: {
1821
+ noPath: () =>
1822
+ 'from-langsmith needs a run export or a directory: trazum from-langsmith runs.json',
1823
+ notFound: (path) => `${path}: not found`,
1824
+ noExports: (path) =>
1825
+ `${path}: no .json/.jsonl/.ndjson exports under it. LangSmith's runs come out of its list-runs endpoint, the SDK's list_runs(), or the export button on a project's runs table.`,
1826
+ summary: (files, rows) => `${files} file(s), ${rows} model call(s) read.`,
1827
+ notModelCalls: (count) =>
1828
+ `${count} run(s) were not model calls and are not in the output: chains, tools, retrievers and prompts. A LangSmith trace is a tree and the chain wrapping a call repeats its child's tokens, so summing the tree would bill the same tokens once per level.`,
1829
+ unnamedModel: (count) =>
1830
+ `${count} model call(s) named no model in their metadata and are not in the output. The run's own name is a client class: "ChatAnthropic" is not a model anybody can price, so it is refused rather than guessed at. Set ls_model_name, or record the invocation params.`,
1831
+ noTokens: (count) =>
1832
+ `${count} model call(s) carried no token counts and are not in the output: logged runs nobody can price. Counted here and worth a look at the tracer.`,
1833
+ reportedCost: (usd) =>
1834
+ `LangSmith priced these same calls at ${usd} with its own table. That figure is not merged into anything Trazum computes: two price tables summed into one total is how a report becomes quietly wrong. Compare them deliberately or not at all.`,
1835
+ unparseable: (count) => `${count} line(s) did not parse as JSON.`,
1836
+ written: (file) => `Wrote ${file}.`,
1837
+ },
1838
+
1759
1839
  fromLiteLlm: {
1760
1840
  noPath: () =>
1761
1841
  'from-litellm needs a spend-log export or a directory: trazum from-litellm spend.json',
@@ -1949,6 +2029,8 @@ ${bold('EXAMPLES')}
1949
2029
  unit: () => ' (USD per million tokens)',
1950
2030
  reviewedOn: (date, days) =>
1951
2031
  ` Table reviewed on ${date}${ago(days)}. Verify before budgeting.`,
2032
+ reviewedByProvider: (rows) => ` Per provider: ${rows}`,
2033
+ reviewedGroup: (date, days, providers) => `${date}${ago(days)} ${providers}`,
1952
2034
  columns: {
1953
2035
  model: 'model',
1954
2036
  input: 'input',
@@ -2678,6 +2760,13 @@ ${bold('EXAMPLES')}
2678
2760
  'No record in this log carries a timestamp, so --since/--until have nothing to filter by. A time window over a clockless log would gate nothing, which is not an answer. Add "ts" to the records, the recipe in the README shows where.',
2679
2761
  windowMatchesNothing: (from, to) =>
2680
2762
  `No record falls inside this window. The log covers ${from} → ${to}. A window matching nothing must not become a $0 report, under --max-usd it would pass a budget gate over a period the log does not cover.`,
2763
+ gateNothingMeasured: (reason) =>
2764
+ `A spend gate is armed and there was nothing to judge: ${reason}. An absence is not a pass, so this exits 1 rather than reporting $0 against your budget. Fix the log, or pass --allow-empty if a period with no calls is the expected answer.`,
2765
+ nothingUnreadable: (lines) =>
2766
+ `every one of the ${count(lines)} ${lines === 1 ? 'line' : 'lines'} in that file was unreadable`,
2767
+ nothingUnpriced: (calls) =>
2768
+ `${count(calls)} ${calls === 1 ? 'call was' : 'calls were'} recorded and none of their models are in the price table`,
2769
+ nothingEmpty: () => 'the log holds no records at all',
2681
2770
  sinceAfterUntil: () =>
2682
2771
  '--since is at or after --until, so the window contains no time at all. Check the two dates.',
2683
2772
  badWhen: (flag, value) =>
package/src/i18n/es.ts CHANGED
@@ -46,10 +46,12 @@ ${bold('USO')}
46
46
  trazum schema <contrato>
47
47
  trazum rollup <documento...|dir> [--json] [--html-out <fichero>]
48
48
  trazum position <uso.jsonl>
49
+ trazum receipt <uso.jsonl|dir> [--stamp] [-o <fichero>]
49
50
  trazum from-claude-code <fichero|dir> [--label <nombre>] [-o <fichero>]
50
51
  trazum from-otel <fichero|dir> [--label-from-service] [-o <fichero>]
51
52
  trazum from-litellm <fichero|dir> [-o <fichero>]
52
53
  trazum from-helicone <fichero|dir> [-o <fichero>]
54
+ trazum from-langsmith <fichero|dir> [-o <fichero>]
53
55
  trazum switch <uso.jsonl> --to <modelo> [--migration-usd <n>] [--cases <n>]
54
56
  trazum ownrate --gpu-usd-hour <n> --tokens-per-second <n> [--utilization <0-1>]
55
57
  trazum pulse [--max-stale-hours <n>]
@@ -121,6 +123,29 @@ ${bold('OPCIONES DE rollup')}
121
123
 
122
124
  Sale con 1 cuando una contribución se entregó y no se pudo agregar.
123
125
 
126
+ ${bold('OPCIONES DE receipt')}
127
+ --stamp Registra la hora de emisión en el documento.
128
+ Desactivado por defecto para que dos ejecuciones
129
+ sobre un log den los mismos bytes: el periodo que
130
+ cubren las cifras ya está dentro, leído del reloj
131
+ del propio log.
132
+ -o, --out <fichero> Escribe el recibo ahí en vez de en la salida
133
+ estándar. El resumen siempre va al error
134
+ estándar, así que una redirección escribe un
135
+ documento y no un documento con un resumen
136
+ pegado delante.
137
+ --pricing <fichero> Lo precia con tu propia tarjeta de precios en
138
+ vez de con el catálogo incluido.
139
+ --pricing-live Lo precia con tarifas en vivo vía OpenRouter.
140
+
141
+ Un perfil responde donde se ejecutó. Un recibo son las mismas cifras con la
142
+ forma que las deja seguir respondiendo en otro sitio: cada línea lleva las
143
+ tarifas que produjeron su dinero y la fecha en que las de ese proveedor se
144
+ leyeron por última vez de su propia página. Lo que no lleva es texto del
145
+ prompt, respuestas, rutas de fichero, nombres de rama, credenciales ni
146
+ sesiones: no censurados, ausentes, porque la forma de la que se construye no
147
+ tiene campo donde meterlos. No envía nada a ningún sitio.
148
+
124
149
  ${bold('OPCIONES DE write')}
125
150
  --answers <fichero> Un objeto JSON de ids de slot y respuestas. Sin
126
151
  esto, las preguntas se hacen una a una; una línea
@@ -185,6 +210,19 @@ ${bold('OPCIONES DE from-helicone')}
185
210
  registros no llevan sesión y los hallazgos de conversación no se pueden
186
211
  responder desde este registro; se dice en cada ejecución.
187
212
 
213
+ ${bold('OPCIONES DE from-langsmith')}
214
+ -o, --out <fichero> Escribe el log de uso ahí en vez de en stdout.
215
+
216
+ Un export de runs de LangSmith, leído como un log de uso: modelo, marca de
217
+ tiempo, etiqueta, la traza como sesión y los recuentos de tokens, y nada más.
218
+ Los inputs y los outputs se quedan en el run, y de los metadatos se leen
219
+ claves con nombre y nunca se copian enteros. Solo run_type "llm" es una
220
+ llamada: cadenas, herramientas y retrievers se saltan y se cuentan, porque la
221
+ cadena que envuelve una llamada repite los tokens de su hijo. Un run cuyos
222
+ metadatos no nombran modelo se rechaza en lugar de tarifarlo por el nombre
223
+ del run, que es una clase cliente. El coste propio de LangSmith se informa
224
+ aparte y nunca se mezcla con el de Trazum.
225
+
188
226
  ${bold('OPCIONES DE from-litellm')}
189
227
  -o, --out <fichero> Escribe el log de uso ahí en vez de en stdout.
190
228
 
@@ -1045,6 +1083,14 @@ ${bold('EJEMPLOS')}
1045
1083
  },
1046
1084
 
1047
1085
  errors: {
1086
+ fileNotFound: (path) =>
1087
+ `${path}: no encontrado. Revisa la ruta, o apunta esto al directorio que lo contiene.`,
1088
+ fileIsDirectory: (path) =>
1089
+ `${path} es un directorio, y este comando lee un fichero. Nombra el fichero de dentro, o usa un comando que recorra una carpeta.`,
1090
+ fileIsDirectoryUnnamed: () =>
1091
+ 'esa ruta es un directorio, y este comando lee un fichero. Nombra el fichero de dentro, o usa un comando que recorra una carpeta.',
1092
+ fileNotReadable: (path) =>
1093
+ `${path}: sin permiso de lectura. Revisa el dueño y los permisos del fichero, y vuelve a ejecutarlo.`,
1048
1094
  livePricingFailed: (url: string, detail: string) =>
1049
1095
  `No se han podido cargar los precios en vivo desde ${url}: ${detail}. Los precios incluidos siguen ahí: quita --pricing-live para usarlos.`,
1050
1096
  optionNeedsValue: (name) => `La opción --${name} necesita un valor.`,
@@ -1089,6 +1135,12 @@ ${bold('EJEMPLOS')}
1089
1135
  }. Contarlo ahí sería rechazado arriba o devolvería un número de otro tokenizador, y esta herramienta no va a llamar exacto a eso. Quita --exact-tokens y quédate con la estimación (que es honesta sobre serlo) o cuenta con las herramientas de ${
1090
1136
  provider === null ? 'ese modelo' : provider
1091
1137
  }.`,
1138
+ exactTokensNeedsPackage: (model, packageName) =>
1139
+ `--exact-tokens puede contar ${model} de forma exacta, sin conexión y sin clave, pero ` +
1140
+ `necesita ${packageName}, que no está instalado. Es un paquete aparte porque sus tablas ` +
1141
+ 'de rangos ocupan veintidós megabytes y @trazum/core no depende de nada.\n' +
1142
+ ` npm install ${packageName}\n` +
1143
+ 'O quita --exact-tokens y quédate con la estimación, que dice cuánto se desvía.',
1092
1144
  checkNeedsMaxTokens: () => 'trazum check necesita --max-tokens <n>.',
1093
1145
  evalNeedsCases: () => 'trazum eval necesita --cases <fichero>.',
1094
1146
  unknownExportFormat: (received, allowed) =>
@@ -1203,7 +1255,7 @@ ${bold('EJEMPLOS')}
1203
1255
  beyondThisPromptTokensOnly: () =>
1204
1256
  'Acortar un prompt es la palanca más pequeña que hay: medido en un prompt de soporte corriente, las reglas recuperan alrededor del 1% de una factura mensual. Si alguno de tus prompts va a una API de pago por uso, "trazum profile <usage.jsonl>" lee lo que el proveedor cobró de verdad y calcula las palancas que no son el prompt. Grabar ese registro son unas pocas líneas y nunca contiene texto del prompt.',
1205
1257
  beyondThisPrompt: () =>
1206
- 'Acortar un prompt es la palanca más pequeña que hay: medido en un prompt de soporte corriente, las reglas recuperan alrededor del 1% de una factura mensual. En una API de pago por uso, lo que mueve del 40% al 80% es a qué modelo va la llamada, la Batch API, la caché de prompts, y lo que cuesta reenviar la conversación, y "trazum profile <usage.jsonl>" calcula las cuatro a partir de lo que el proveedor cobró de verdad. Grabar ese registro son unas pocas líneas y nunca contiene texto del prompt.',
1258
+ 'Acortar un prompt es la palanca más pequeña que hay: medido en un prompt de soporte corriente, las reglas recuperan alrededor del 1% de una factura mensual. En una API de pago por uso, lo que mueve del 60% al 80% es a qué modelo va la llamada, la Batch API, la caché de prompts, y lo que cuesta reenviar la conversación, y "trazum profile <usage.jsonl>" calcula las cuatro a partir de lo que el proveedor cobró de verdad. Grabar ese registro son unas pocas líneas y nunca contiene texto del prompt.',
1207
1259
  windowUse: (before, after, model, window) =>
1208
1260
  `Ventana de contexto: ${before} → ${after} de los ${window} tokens de ${model}, sitio que se lleva la conversación.`,
1209
1261
  tokensOnlyAskedFor: () =>
@@ -1744,6 +1796,19 @@ ${bold('EJEMPLOS')}
1744
1796
  snippetHeading: () => 'Pega en trazum.config.json (el fichero de overlay «pricing»):',
1745
1797
  },
1746
1798
 
1799
+ receipt: {
1800
+ noLog: () => 'Nombra un log de uso del que hacer el recibo.',
1801
+ written: (file, lines) => `Recibo de ${lines} línea(s) escrito en ${file}.`,
1802
+ summary: (lines, usd) =>
1803
+ `${lines} línea(s), ${usd} con precio. Cada cifra lleva la tarifa que la produjo y la fecha en que se revisó esa tarifa.`,
1804
+ unpriced: (models, calls) =>
1805
+ `${models} modelo(s) que el catálogo no precia, con ${calls} llamada(s): nombrados en los huecos del recibo y fuera del total, en vez de costados a cero.`,
1806
+ unread: (count) => `${count} línea(s) del log no se pudieron leer, y el recibo lo dice.`,
1807
+ noClock: () =>
1808
+ 'El log no lleva reloj, así que el recibo no está acotado en el tiempo y lo declara en vez de inventarse un periodo.',
1809
+ nothingToBill: () => 'Nada de este log se pudo precificar, así que el recibo no tiene líneas.',
1810
+ },
1811
+
1747
1812
  fromOtel: {
1748
1813
  noPath: () => 'from-otel necesita un archivo o directorio OTLP: trazum from-otel spans.json',
1749
1814
  notFound: (path) => `${path}: no existe`,
@@ -1776,6 +1841,25 @@ ${bold('EJEMPLOS')}
1776
1841
  written: (file) => `Escrito ${file}.`,
1777
1842
  },
1778
1843
 
1844
+ fromLangsmith: {
1845
+ noPath: () =>
1846
+ 'from-langsmith necesita un export de runs o un directorio: trazum from-langsmith runs.json',
1847
+ notFound: (path) => `${path}: no encontrado`,
1848
+ noExports: (path) =>
1849
+ `${path}: no hay exports .json/.jsonl/.ndjson dentro. Los runs de LangSmith salen de su endpoint de listado, del list_runs() del SDK o del botón de exportar en la tabla de runs de un proyecto.`,
1850
+ summary: (files, rows) => `${files} archivo(s), ${rows} llamada(s) al modelo leídas.`,
1851
+ notModelCalls: (count) =>
1852
+ `${count} run(s) no eran llamadas al modelo y no están en la salida: cadenas, herramientas, retrievers y prompts. Una traza de LangSmith es un árbol y la cadena que envuelve una llamada repite los tokens de su hijo, así que sumar el árbol facturaría los mismos tokens una vez por nivel.`,
1853
+ unnamedModel: (count) =>
1854
+ `${count} llamada(s) no nombran modelo en sus metadatos y no están en la salida. El nombre del run es una clase cliente: «ChatAnthropic» no es un modelo que nadie pueda tarifar, así que se rechaza en lugar de adivinarlo. Pon ls_model_name o registra los invocation params.`,
1855
+ noTokens: (count) =>
1856
+ `${count} llamada(s) no traían recuento de tokens y no están en la salida: runs registrados que nadie puede tarifar. Se cuentan aquí y merecen una mirada en el tracer.`,
1857
+ reportedCost: (usd) =>
1858
+ `LangSmith tarifó estas mismas llamadas en ${usd} con su propia tabla. Esa cifra no se mezcla con nada que calcule Trazum: sumar dos tablas de precios en un total es como un informe se vuelve silenciosamente falso. Compáralas a propósito o no las compares.`,
1859
+ unparseable: (count) => `${count} línea(s) no se han podido leer como JSON.`,
1860
+ written: (file) => `Escrito ${file}.`,
1861
+ },
1862
+
1779
1863
  fromLiteLlm: {
1780
1864
  noPath: () =>
1781
1865
  'from-litellm necesita un export de spend log o un directorio: trazum from-litellm spend.json',
@@ -1970,6 +2054,8 @@ ${bold('EJEMPLOS')}
1970
2054
  unit: () => ' (USD por millón de tokens)',
1971
2055
  reviewedOn: (date, days) =>
1972
2056
  ` Tabla revisada el ${date}${hace(days)}. Verifica antes de presupuestar.`,
2057
+ reviewedByProvider: (rows) => ` Por proveedor: ${rows}`,
2058
+ reviewedGroup: (date, days, providers) => `${date}${hace(days)} ${providers}`,
1973
2059
  columns: {
1974
2060
  model: 'modelo',
1975
2061
  input: 'entrada',
@@ -2696,6 +2782,13 @@ ${bold('EJEMPLOS')}
2696
2782
  'Ningún registro lleva marca de tiempo, así que --since/--until no tienen por qué filtrar. Una ventana temporal sobre un registro sin reloj no vigilaría nada, y eso no es una respuesta. Añade "ts" a los registros: la receta del README dice dónde.',
2697
2783
  windowMatchesNothing: (from, to) =>
2698
2784
  `Ningún registro cae dentro de esta ventana. El registro cubre ${from} → ${to}. Una ventana que no encuentra nada no debe volverse un informe de $0: bajo --max-usd pasaría una puerta de presupuesto sobre un periodo que el registro no cubre.`,
2785
+ gateNothingMeasured: (reason) =>
2786
+ `Hay una puerta de gasto armada y no había nada que juzgar: ${reason}. Una ausencia no es un aprobado, así que esto sale con 1 en vez de reportar $0 contra tu presupuesto. Arregla el registro, o pasa --allow-empty si un periodo sin llamadas es la respuesta esperada.`,
2787
+ nothingUnreadable: (lines) =>
2788
+ `las ${count(lines)} ${lines === 1 ? 'línea del fichero era ilegible' : 'líneas del fichero eran ilegibles'}`,
2789
+ nothingUnpriced: (calls) =>
2790
+ `se ${count(calls) && calls === 1 ? 'registró 1 llamada' : `registraron ${count(calls)} llamadas`} y ninguno de sus modelos está en la tabla de precios`,
2791
+ nothingEmpty: () => 'el registro no tiene ni un solo apunte',
2699
2792
  sinceAfterUntil: () =>
2700
2793
  '--since es igual o posterior a --until, así que la ventana no contiene tiempo alguno. Revisa las dos fechas.',
2701
2794
  badWhen: (flag, value) =>
package/src/i18n/types.ts CHANGED
@@ -81,6 +81,20 @@ export interface CliMessages {
81
81
  };
82
82
 
83
83
  errors: {
84
+ /**
85
+ * A filesystem refusal, said in this product's voice rather than Node's.
86
+ *
87
+ * Seven commands used to let `ENOENT: no such file or directory, open
88
+ * '/nope/x.txt'` reach the reader on the commonest mistake there is, a
89
+ * mistyped path, while the five converters answered `/nope/x.json: not
90
+ * found`. The doctrine's rule is that a refusal never arrives bare, so
91
+ * these say the path, what was wrong with it, and the move that settles it.
92
+ */
93
+ fileNotFound(path: string): string;
94
+ fileIsDirectory(path: string): string;
95
+ /** Node reports EISDIR from `read` with no path on it, so this one names none. */
96
+ fileIsDirectoryUnnamed(): string;
97
+ fileNotReadable(path: string): string;
84
98
  livePricingFailed: (url: string, detail: string) => string;
85
99
  optionNeedsValue(name: string): string;
86
100
  mustBeNonNegative(name: string, raw: string): string;
@@ -111,6 +125,17 @@ export interface CliMessages {
111
125
  * cannot count, and told as a different sentence.
112
126
  */
113
127
  exactTokensWrongFamily(model: string, provider: string | null): string;
128
+ /**
129
+ * A family Trazum *can* count exactly, through an optional package that is
130
+ * not installed.
131
+ *
132
+ * A third sentence rather than a branch inside `exactTokensWrongFamily`,
133
+ * because it is a different fact: not *nobody here can count this* but
134
+ * *one `npm install` away*, and telling somebody to go and find another
135
+ * tool when the answer ships under the same scope is a worse refusal than
136
+ * the one it replaced.
137
+ */
138
+ exactTokensNeedsPackage(model: string, packageName: string): string;
114
139
  checkNeedsMaxTokens(): string;
115
140
  evalNeedsCases(): string;
116
141
  evalNoCases(path: string): string;
@@ -578,6 +603,20 @@ export interface CliMessages {
578
603
  snippetHeading(): string;
579
604
  };
580
605
 
606
+ /**
607
+ * `receipt` — the bill's counts with the provenance of every figure, shaped
608
+ * so they still answer somewhere other than the terminal that produced them.
609
+ */
610
+ receipt: {
611
+ noLog(): string;
612
+ written(file: string, lines: number): string;
613
+ summary(lines: number, usd: string): string;
614
+ unpriced(models: number, calls: number): string;
615
+ unread(count: number): string;
616
+ noClock(): string;
617
+ nothingToBill(): string;
618
+ };
619
+
581
620
  fromOtel: {
582
621
  noPath(): string;
583
622
  notFound(path: string): string;
@@ -615,6 +654,27 @@ export interface CliMessages {
615
654
  written(file: string): string;
616
655
  };
617
656
 
657
+ fromLangsmith: {
658
+ noPath(): string;
659
+ notFound(path: string): string;
660
+ noExports(path: string): string;
661
+ summary(files: number, rows: number): string;
662
+ /**
663
+ * Runs that were not model calls: chains, tools, retrievers, prompts.
664
+ *
665
+ * Most of a LangSmith export, and said out loud because a reader who
666
+ * converted a thousand runs into three hundred records is owed the reason.
667
+ */
668
+ notModelCalls(count: number): string;
669
+ /** Runs whose metadata named no model: counted, never priced by the client class. */
670
+ unnamedModel(count: number): string;
671
+ noTokens(count: number): string;
672
+ /** LangSmith's own priced figure, stated and never merged into Trazum's. */
673
+ reportedCost(usd: string): string;
674
+ unparseable(count: number): string;
675
+ written(file: string): string;
676
+ };
677
+
618
678
  fromLiteLlm: {
619
679
  noPath(): string;
620
680
  notFound(path: string): string;
@@ -764,6 +824,15 @@ export interface CliMessages {
764
824
  unit(): string;
765
825
  /** `days` is null when the date is unusable or in the future. */
766
826
  reviewedOn(date: string, days: number | null): string;
827
+ /**
828
+ * Said only when the providers disagree, which is the case the headline
829
+ * date cannot carry: it is the oldest of them, so a reader pricing only
830
+ * Anthropic calls is told the table is two months old when their half of
831
+ * it was checked today.
832
+ */
833
+ reviewedByProvider(rows: string): string;
834
+ /** The providers that share one review date, joined into the line above. */
835
+ reviewedGroup(date: string, days: number | null, providers: string): string;
767
836
  columns: {
768
837
  model: string;
769
838
  input: string;
@@ -1065,7 +1134,7 @@ export interface CliMessages {
1065
1134
  * The section the whole command builds towards.
1066
1135
  *
1067
1136
  * Trazum's rules recover about 1% of a bill. Which model a call goes to moves
1068
- * 40% to 80%, and the Batch API moves 50% flat. A report that shows where the
1137
+ * 60% to 80%, and the Batch API moves 50% flat. A report that shows where the
1069
1138
  * money went and then stops is a report that leaves the reader with the
1070
1139
  * smallest lever in their hand.
1071
1140
  */
@@ -1621,6 +1690,18 @@ export interface CliMessages {
1621
1690
  windowNeedsClock(): string;
1622
1691
  /** A window matching nothing must not become a passing $0 gate. */
1623
1692
  windowMatchesNothing(from: string, to: string): string;
1693
+ /**
1694
+ * A gate armed over a report with nothing in it.
1695
+ *
1696
+ * `reason` names the gap: unreadable lines, models with no price, or a log
1697
+ * that is genuinely empty. The doctrine's rule is that an absence is never
1698
+ * reported as a pass, and this is the sentence that refuses to.
1699
+ */
1700
+ gateNothingMeasured(reason: string): string;
1701
+ /** The three gaps, for the sentence above. */
1702
+ nothingUnreadable(lines: number): string;
1703
+ nothingUnpriced(calls: number): string;
1704
+ nothingEmpty(): string;
1624
1705
  sinceAfterUntil(): string;
1625
1706
  badWhen(flag: string, value: string): string;
1626
1707
  /**