@trazum/cli 1.62.1 → 1.64.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/html.d.ts +42 -0
- package/dist/html.d.ts.map +1 -0
- package/dist/html.js +250 -0
- package/dist/html.js.map +1 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +36 -1
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +38 -1
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/types.d.ts +24 -0
- package/dist/i18n/types.d.ts.map +1 -1
- package/dist/index.js +97 -25
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/html.ts +343 -0
- package/src/i18n/en.ts +40 -1
- package/src/i18n/es.ts +42 -1
- package/src/i18n/types.ts +25 -0
- package/src/index.ts +109 -29
package/dist/html.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { RollupDocument } from '@trazum/core';
|
|
2
|
+
import type { CliMessages } from './i18n/index.js';
|
|
3
|
+
import type { ProfileMarkdownInput } from './markdown.js';
|
|
4
|
+
/**
|
|
5
|
+
* HTML for the person who does not run CLIs.
|
|
6
|
+
*
|
|
7
|
+
* One self-contained file: inline CSS, no scripts, no external assets — a
|
|
8
|
+
* mail client, a wiki upload and a double-click all render it the same. It
|
|
9
|
+
* is a **projection of the document `--json` prints**, taking the exact same
|
|
10
|
+
* input object as the Markdown renderer: no second computation exists to
|
|
11
|
+
* disagree with the first, and the parity guard in the suite walks every
|
|
12
|
+
* figure here back to that document.
|
|
13
|
+
*
|
|
14
|
+
* The design rule this repository applies to its terminal output is applied
|
|
15
|
+
* here where a designer would be tempted to grey it out: **the caveats are
|
|
16
|
+
* furniture, not footnotes.** Unpriced models, skipped lines and the absent
|
|
17
|
+
* fields render inside a bordered block ahead of the detail tables, at the
|
|
18
|
+
* same visual weight as the totals they qualify — a forwarded report whose
|
|
19
|
+
* limits can be cropped out is a lie by omission wearing this tool's name.
|
|
20
|
+
*
|
|
21
|
+
* Escaping is not optional politeness: labels, model ids and file paths come
|
|
22
|
+
* from somebody's log, and a label is exactly where `<script>` would arrive.
|
|
23
|
+
* Everything interpolated goes through `esc()`, tested with hostile labels.
|
|
24
|
+
*/
|
|
25
|
+
export declare function esc(value: string): string;
|
|
26
|
+
/** The profile as one self-contained page. Same input as the Markdown door. */
|
|
27
|
+
export declare function renderProfileHtml(input: ProfileMarkdownInput): string;
|
|
28
|
+
/**
|
|
29
|
+
* The roll-up as one self-contained page — the team-facing document, for
|
|
30
|
+
* exactly the person who does not run CLIs.
|
|
31
|
+
*
|
|
32
|
+
* The same discipline as the profile door: the input is the roll-up document
|
|
33
|
+
* itself, the one `--json` prints and `conform` checks, so the page cannot
|
|
34
|
+
* disagree with the data. Two things this page refuses to soften, because
|
|
35
|
+
* they are the roll-up's whole honesty: **each contributor's gaps stay under
|
|
36
|
+
* that contributor** — summing them away is the averaging this command
|
|
37
|
+
* exists to refuse — and **the `cannotSay` caveats render in the caveat
|
|
38
|
+
* block**, overlap-invisible included, so the one thing no merge can measure
|
|
39
|
+
* cannot be cropped out of the forwarded copy.
|
|
40
|
+
*/
|
|
41
|
+
export declare function renderRollupHtml(document: RollupDocument, t: CliMessages): string;
|
|
42
|
+
//# sourceMappingURL=html.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../src/html.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,cAAc,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAG1D;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOzC;AAoDD,+EAA+E;AAC/E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,CAiHrE;AAuBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,cAAc,EAAE,CAAC,EAAE,WAAW,GAAG,MAAM,CAyGjF"}
|
package/dist/html.js
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { UNLABELLED, formatUsd, sharesOf } from '@trazum/core';
|
|
2
|
+
import { dayOf, spanDays } from './time.js';
|
|
3
|
+
/**
|
|
4
|
+
* HTML for the person who does not run CLIs.
|
|
5
|
+
*
|
|
6
|
+
* One self-contained file: inline CSS, no scripts, no external assets — a
|
|
7
|
+
* mail client, a wiki upload and a double-click all render it the same. It
|
|
8
|
+
* is a **projection of the document `--json` prints**, taking the exact same
|
|
9
|
+
* input object as the Markdown renderer: no second computation exists to
|
|
10
|
+
* disagree with the first, and the parity guard in the suite walks every
|
|
11
|
+
* figure here back to that document.
|
|
12
|
+
*
|
|
13
|
+
* The design rule this repository applies to its terminal output is applied
|
|
14
|
+
* here where a designer would be tempted to grey it out: **the caveats are
|
|
15
|
+
* furniture, not footnotes.** Unpriced models, skipped lines and the absent
|
|
16
|
+
* fields render inside a bordered block ahead of the detail tables, at the
|
|
17
|
+
* same visual weight as the totals they qualify — a forwarded report whose
|
|
18
|
+
* limits can be cropped out is a lie by omission wearing this tool's name.
|
|
19
|
+
*
|
|
20
|
+
* Escaping is not optional politeness: labels, model ids and file paths come
|
|
21
|
+
* from somebody's log, and a label is exactly where `<script>` would arrive.
|
|
22
|
+
* Everything interpolated goes through `esc()`, tested with hostile labels.
|
|
23
|
+
*/
|
|
24
|
+
export function esc(value) {
|
|
25
|
+
return value
|
|
26
|
+
.replaceAll('&', '&')
|
|
27
|
+
.replaceAll('<', '<')
|
|
28
|
+
.replaceAll('>', '>')
|
|
29
|
+
.replaceAll('"', '"')
|
|
30
|
+
.replaceAll("'", ''');
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A single committed look, print-first: explicit colours on everything, a
|
|
34
|
+
* caveat block that a printer and a dark-mode mail client both keep legible.
|
|
35
|
+
* No media-query theming — this file's job is to look the same everywhere,
|
|
36
|
+
* including on paper.
|
|
37
|
+
*/
|
|
38
|
+
const STYLE = `
|
|
39
|
+
:root { color-scheme: light; }
|
|
40
|
+
body { margin: 0; padding: 2.5rem 1.25rem; background: #f7f6f3; color: #1f2328;
|
|
41
|
+
font: 16px/1.55 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
|
|
42
|
+
main { max-width: 860px; margin: 0 auto; background: #ffffff; border: 1px solid #d9d5cc;
|
|
43
|
+
border-radius: 6px; padding: 2.25rem 2.5rem; }
|
|
44
|
+
h1 { font-size: 1.45rem; margin: 0 0 .25rem; }
|
|
45
|
+
h2 { font-size: 1.05rem; margin: 2rem 0 .5rem; border-bottom: 1px solid #e4e0d8; padding-bottom: .3rem; }
|
|
46
|
+
.headline { font-size: 1.8rem; font-weight: 700; margin: .75rem 0 .1rem; font-variant-numeric: tabular-nums; }
|
|
47
|
+
.muted { color: #59606a; }
|
|
48
|
+
.gate-fail { border: 2px solid #b42318; background: #fdf1f0; color: #7a1a12;
|
|
49
|
+
padding: .7rem 1rem; border-radius: 6px; margin: 1rem 0; font-weight: 600; }
|
|
50
|
+
.gate-pass { color: #365f37; margin: 1rem 0; }
|
|
51
|
+
.caveats { border: 2px solid #8a6d1a; background: #fbf6e9; border-radius: 6px;
|
|
52
|
+
padding: 1rem 1.25rem; margin: 1.5rem 0; }
|
|
53
|
+
.caveats h2 { margin: 0 0 .5rem; border: 0; padding: 0; font-size: 1.05rem; color: #6d5510; }
|
|
54
|
+
.caveats ul { margin: 0; padding-left: 1.2rem; }
|
|
55
|
+
.caveats li { margin: .3rem 0; }
|
|
56
|
+
table { border-collapse: collapse; width: 100%; margin: .5rem 0 1rem; font-variant-numeric: tabular-nums; }
|
|
57
|
+
th { text-align: left; font-weight: 600; border-bottom: 2px solid #d9d5cc; padding: .35rem .6rem .35rem 0; }
|
|
58
|
+
td { border-bottom: 1px solid #ece9e2; padding: .35rem .6rem .35rem 0; }
|
|
59
|
+
td.n, th.n { text-align: right; }
|
|
60
|
+
ul.findings { padding-left: 1.2rem; } ul.findings li { margin: .35rem 0; }
|
|
61
|
+
footer { margin-top: 2rem; padding-top: .75rem; border-top: 1px solid #e4e0d8;
|
|
62
|
+
font-size: .85rem; color: #59606a; }
|
|
63
|
+
@media print { body { background: #ffffff; padding: 0; } main { border: 0; padding: 0; } }
|
|
64
|
+
`;
|
|
65
|
+
function breakdownTable(rows, totalUsd, t, nameHeading) {
|
|
66
|
+
const n = (value) => value.toLocaleString(t.numberLocale);
|
|
67
|
+
const body = rows
|
|
68
|
+
.map(({ name, breakdown: b }) => {
|
|
69
|
+
const share = totalUsd > 0 ? `${((b.totalUsd / totalUsd) * 100).toFixed(1)}%` : '—';
|
|
70
|
+
return `<tr><td>${esc(name)}</td><td class="n">${n(b.calls)}</td><td class="n">${n(b.inputTokens)}</td><td class="n">${n(b.cacheReadTokens)}</td><td class="n">${n(b.cacheWriteTokens)}</td><td class="n">${n(b.outputTokens)}</td><td class="n">${esc(formatUsd(b.totalUsd))}</td><td class="n">${share}</td></tr>`;
|
|
71
|
+
})
|
|
72
|
+
.join('\n');
|
|
73
|
+
return `<table><thead><tr><th>${esc(nameHeading)}</th><th class="n">${esc(t.html.colCalls())}</th><th class="n">${esc(t.html.colInput())}</th><th class="n">${esc(t.html.colCacheRead())}</th><th class="n">${esc(t.html.colCacheWrite())}</th><th class="n">${esc(t.html.colOutput())}</th><th class="n">USD</th><th class="n">%</th></tr></thead><tbody>\n${body}\n</tbody></table>`;
|
|
74
|
+
}
|
|
75
|
+
/** The profile as one self-contained page. Same input as the Markdown door. */
|
|
76
|
+
export function renderProfileHtml(input) {
|
|
77
|
+
const { report, levers, cache, t, gates, window, stalePricing } = input;
|
|
78
|
+
const n = (value) => value.toLocaleString(t.numberLocale);
|
|
79
|
+
const pct = (share) => `${(share * 100).toFixed(1)}%`;
|
|
80
|
+
const showLabel = (label) => (label === UNLABELLED ? t.profile.unlabelled() : label);
|
|
81
|
+
const shares = sharesOf(report.total);
|
|
82
|
+
const parts = [];
|
|
83
|
+
parts.push(`<h1>${esc(t.profile.heading())}</h1>`);
|
|
84
|
+
parts.push(`<p class="headline">${esc(t.profile.spent(t.profile.calls(report.total.calls), formatUsd(report.total.totalUsd)))}</p>`);
|
|
85
|
+
if (report.span !== null) {
|
|
86
|
+
parts.push(`<p class="muted">${esc(t.profile.spanLine(dayOf(report.span.fromMs), dayOf(report.span.toMs), spanDays(report.span.fromMs, report.span.toMs)))}</p>`);
|
|
87
|
+
}
|
|
88
|
+
if (window !== undefined) {
|
|
89
|
+
parts.push(`<p class="muted">${esc(t.profile.windowLine(window.since, window.until))}</p>`);
|
|
90
|
+
}
|
|
91
|
+
if (gates !== undefined && gates.lines.length > 0) {
|
|
92
|
+
const box = gates.failed ? 'gate-fail' : 'gate-pass';
|
|
93
|
+
parts.push(`<div class="${box}">${gates.lines.map((line) => esc(line)).join('<br>')}</div>`);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The caveats, ahead of every detail table. What this report cannot say is
|
|
97
|
+
* part of what it says, and it renders before the part a skimmer stops at.
|
|
98
|
+
*/
|
|
99
|
+
const caveats = [];
|
|
100
|
+
if (report.unpricedModels.length > 0) {
|
|
101
|
+
caveats.push(esc(t.profile.unpriced(report.unpricedModels.join(', '), report.unpriced.calls)));
|
|
102
|
+
}
|
|
103
|
+
if (report.skippedLines.length > 0) {
|
|
104
|
+
const shown = report.skippedLines.slice(0, 5).join(', ');
|
|
105
|
+
caveats.push(esc(t.profile.skipped(report.skippedLines.length, report.skippedLines.length > 5 ? `${shown}…` : shown)));
|
|
106
|
+
}
|
|
107
|
+
if (report.span === null)
|
|
108
|
+
caveats.push(esc(t.html.noClock()));
|
|
109
|
+
if (!report.hasSessions)
|
|
110
|
+
caveats.push(esc(t.html.noSessions()));
|
|
111
|
+
if (report.total.assumedWriteTtlCalls > 0) {
|
|
112
|
+
caveats.push(esc(t.profile.cacheTtlUnsettled(report.total.assumedWriteTtlCalls, formatUsd(-cache.deltaUsd), formatUsd(cache.worstCaseDeltaUsd))));
|
|
113
|
+
}
|
|
114
|
+
if (stalePricing !== undefined) {
|
|
115
|
+
caveats.push(esc(t.profile.pricesStale(stalePricing.date, stalePricing.days)));
|
|
116
|
+
}
|
|
117
|
+
if (caveats.length > 0) {
|
|
118
|
+
parts.push(`<div class="caveats"><h2>${esc(t.html.caveatsHeading())}</h2><ul>${caveats
|
|
119
|
+
.map((caveat) => `<li>${caveat}</li>`)
|
|
120
|
+
.join('')}</ul></div>`);
|
|
121
|
+
}
|
|
122
|
+
parts.push(`<h2>${esc(t.html.byLabelHeading())}</h2>`);
|
|
123
|
+
parts.push(breakdownTable(report.byLabel.map((row) => ({ name: showLabel(row.label), breakdown: row.breakdown })), report.total.totalUsd, t, t.html.colLabel()));
|
|
124
|
+
parts.push(`<h2>${esc(t.html.byModelHeading())}</h2>`);
|
|
125
|
+
parts.push(breakdownTable(report.byModel.map((row) => ({ name: row.model, breakdown: row.breakdown })), report.total.totalUsd, t, t.html.colModel()));
|
|
126
|
+
// The findings, as the sentences the terminal already says — the copy is
|
|
127
|
+
// the product's, not this file's, so the two surfaces cannot drift apart.
|
|
128
|
+
const findings = [];
|
|
129
|
+
for (const lever of levers.slices.slice(0, 5)) {
|
|
130
|
+
findings.push(esc(t.profile.leverSlice(showLabel(lever.label), lever.modelName, formatUsd(lever.combinedUsd), pct(lever.shareOfBill))));
|
|
131
|
+
}
|
|
132
|
+
if (report.total.cacheReadTokens + report.total.cacheWriteTokens > 0) {
|
|
133
|
+
if (cache.deltaUsd > 0) {
|
|
134
|
+
findings.push(esc(t.profile.cacheLost(formatUsd(cache.deltaUsd), n(report.total.cacheWriteTokens), n(report.total.cacheReadTokens))));
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
findings.push(esc(t.profile.cachePaidOff(formatUsd(-cache.deltaUsd))));
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if (findings.length > 0) {
|
|
141
|
+
parts.push(`<h2>${esc(t.html.findingsHeading())}</h2>`);
|
|
142
|
+
parts.push(`<ul class="findings">${findings.map((finding) => `<li>${finding}</li>`).join('')}</ul>`);
|
|
143
|
+
}
|
|
144
|
+
parts.push(`<p class="muted">${esc(t.html.sharesLine(pct(shares.input), pct(shares.cacheRead), pct(shares.cacheWrite), pct(shares.output)))}</p>`);
|
|
145
|
+
parts.push(`<footer>${esc(t.html.footer())}</footer>`);
|
|
146
|
+
return page(t.profile.heading(), t.locale, parts);
|
|
147
|
+
}
|
|
148
|
+
/** The shared skeleton: both documents are the same file to a mail client. */
|
|
149
|
+
function page(title, locale, parts) {
|
|
150
|
+
return [
|
|
151
|
+
'<!doctype html>',
|
|
152
|
+
`<html lang="${esc(locale)}">`,
|
|
153
|
+
'<head>',
|
|
154
|
+
'<meta charset="utf-8">',
|
|
155
|
+
'<meta name="viewport" content="width=device-width, initial-scale=1">',
|
|
156
|
+
`<title>${esc(title)}</title>`,
|
|
157
|
+
`<style>${STYLE}</style>`,
|
|
158
|
+
'</head>',
|
|
159
|
+
'<body>',
|
|
160
|
+
'<main>',
|
|
161
|
+
...parts,
|
|
162
|
+
'</main>',
|
|
163
|
+
'</body>',
|
|
164
|
+
'</html>',
|
|
165
|
+
'',
|
|
166
|
+
].join('\n');
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* The roll-up as one self-contained page — the team-facing document, for
|
|
170
|
+
* exactly the person who does not run CLIs.
|
|
171
|
+
*
|
|
172
|
+
* The same discipline as the profile door: the input is the roll-up document
|
|
173
|
+
* itself, the one `--json` prints and `conform` checks, so the page cannot
|
|
174
|
+
* disagree with the data. Two things this page refuses to soften, because
|
|
175
|
+
* they are the roll-up's whole honesty: **each contributor's gaps stay under
|
|
176
|
+
* that contributor** — summing them away is the averaging this command
|
|
177
|
+
* exists to refuse — and **the `cannotSay` caveats render in the caveat
|
|
178
|
+
* block**, overlap-invisible included, so the one thing no merge can measure
|
|
179
|
+
* cannot be cropped out of the forwarded copy.
|
|
180
|
+
*/
|
|
181
|
+
export function renderRollupHtml(document, t) {
|
|
182
|
+
const n = (value) => value.toLocaleString(t.numberLocale);
|
|
183
|
+
const parts = [];
|
|
184
|
+
parts.push(`<h1>${esc(t.rollup.heading(document.contributors.length, formatUsd(document.total.totalUsd), document.total.calls))}</h1>`);
|
|
185
|
+
parts.push(`<p class="headline">${esc(formatUsd(document.total.totalUsd))}</p>`);
|
|
186
|
+
if (document.span !== null) {
|
|
187
|
+
parts.push(`<p class="muted">${esc(t.rollup.span(dayOf(document.span.fromMs), dayOf(document.span.toMs)))}</p>`);
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
parts.push(`<p class="muted">${esc(t.rollup.noSpan())}</p>`);
|
|
191
|
+
}
|
|
192
|
+
// The caveat block, ahead of every table: what the merge cannot say, what
|
|
193
|
+
// was rejected by name, and which contributions arrived twice.
|
|
194
|
+
const caveats = [];
|
|
195
|
+
for (const code of document.cannotSay)
|
|
196
|
+
caveats.push(esc(t.rollup.caveat(code)));
|
|
197
|
+
for (const rejection of document.rejected) {
|
|
198
|
+
caveats.push(esc(rejection.via === null
|
|
199
|
+
? t.rollup.rejected(rejection.name, rejection.because)
|
|
200
|
+
: t.rollup.rejectedVia(rejection.name, rejection.via, rejection.because)));
|
|
201
|
+
}
|
|
202
|
+
if (document.repeatedContributors.length > 0) {
|
|
203
|
+
caveats.push(esc(t.rollup.repeated(document.repeatedContributors.join(', '))));
|
|
204
|
+
}
|
|
205
|
+
for (const group of document.identicalContributions.groups) {
|
|
206
|
+
caveats.push(esc(t.rollup.identical(group.join(', '))));
|
|
207
|
+
}
|
|
208
|
+
if (document.identicalContributions.usd > 0) {
|
|
209
|
+
caveats.push(esc(t.rollup.identicalUsd(formatUsd(document.identicalContributions.usd))));
|
|
210
|
+
}
|
|
211
|
+
if (document.unpricedModels.length > 0) {
|
|
212
|
+
caveats.push(esc(t.profile.unpriced(document.unpricedModels.join(', '), document.unpriced.calls)));
|
|
213
|
+
}
|
|
214
|
+
if (caveats.length > 0) {
|
|
215
|
+
parts.push(`<div class="caveats"><h2>${esc(t.rollup.cannotSayHeading())}</h2><ul>${caveats
|
|
216
|
+
.map((caveat) => `<li>${caveat}</li>`)
|
|
217
|
+
.join('')}</ul></div>`);
|
|
218
|
+
}
|
|
219
|
+
// One contributor, one row — and that contributor's own gaps directly
|
|
220
|
+
// beneath its name, never pooled.
|
|
221
|
+
parts.push(`<h2>${esc(t.rollup.contributorsHeading())}</h2>`);
|
|
222
|
+
const contributorRows = document.contributors
|
|
223
|
+
.map((contributor) => {
|
|
224
|
+
const gapItems = contributor.gaps
|
|
225
|
+
.map((gap) => `<li>${esc(gap.detail)}${gap.usd !== null ? ` — ${esc(formatUsd(gap.usd))}` : ''}</li>`)
|
|
226
|
+
.join('');
|
|
227
|
+
const gaps = gapItems === '' ? '' : `<ul class="findings">${gapItems}</ul>`;
|
|
228
|
+
return `<tr><td>${esc(contributor.name)}</td><td class="n">${n(contributor.calls)}</td><td class="n">${esc(formatUsd(contributor.totalUsd))}</td><td class="n">${contributor.spanDays === null ? '—' : n(contributor.spanDays)}</td></tr>${gaps === '' ? '' : `<tr><td colspan="4">${gaps}</td></tr>`}`;
|
|
229
|
+
})
|
|
230
|
+
.join('\n');
|
|
231
|
+
parts.push(`<table><thead><tr><th>${esc(t.html.colContributor())}</th><th class="n">${esc(t.html.colCalls())}</th><th class="n">USD</th><th class="n">${esc(t.html.colSpanDays())}</th></tr></thead><tbody>\n${contributorRows}\n</tbody></table>`);
|
|
232
|
+
parts.push(`<h2>${esc(t.rollup.byLabelHeading())}</h2>`);
|
|
233
|
+
parts.push(breakdownTable(document.byLabel.map((row) => ({
|
|
234
|
+
name: row.label === UNLABELLED ? t.profile.unlabelled() : row.label,
|
|
235
|
+
breakdown: row.breakdown,
|
|
236
|
+
})), document.total.totalUsd, t, t.html.colLabel()));
|
|
237
|
+
parts.push(`<h2>${esc(t.html.byModelHeading())}</h2>`);
|
|
238
|
+
parts.push(breakdownTable(document.byModel.map((row) => ({ name: row.model, breakdown: row.breakdown })), document.total.totalUsd, t, t.html.colModel()));
|
|
239
|
+
// Findings that did not merge are named with the contributors that have
|
|
240
|
+
// them — reported as prose, exactly as the terminal says it.
|
|
241
|
+
if (document.notMerged.length > 0) {
|
|
242
|
+
parts.push(`<h2>${esc(t.rollup.notMergedHeading())}</h2>`);
|
|
243
|
+
parts.push(`<ul class="findings">${document.notMerged
|
|
244
|
+
.map((entry) => `<li>${esc(t.rollup.notMerged(entry.finding, entry.because))} ${esc(t.rollup.presentIn(entry.presentIn.join(', ')))}</li>`)
|
|
245
|
+
.join('')}</ul>`);
|
|
246
|
+
}
|
|
247
|
+
parts.push(`<footer>${esc(t.html.footer())}</footer>`);
|
|
248
|
+
return page(t.rollup.heading(document.contributors.length, formatUsd(document.total.totalUsd), document.total.calls), t.locale, parts);
|
|
249
|
+
}
|
|
250
|
+
//# sourceMappingURL=html.js.map
|
package/dist/html.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html.js","sourceRoot":"","sources":["../src/html.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAI/D,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,UAAU,GAAG,CAAC,KAAa;IAC/B,OAAO,KAAK;SACT,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC;SACxB,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC;SACvB,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC;SACvB,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC;SACzB,UAAU,CAAC,GAAG,EA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|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAqB9C;;;;;;GAMG;AACH,eAAO,MAAM,EAAE,EAAE,WA0xFhB,CAAC"}
|
package/dist/i18n/en.js
CHANGED
|
@@ -47,7 +47,7 @@ ${bold('USAGE')}
|
|
|
47
47
|
trazum prune <file> --cases <file> --yes
|
|
48
48
|
trazum where [file]
|
|
49
49
|
trazum conform <file|-> [--contract <name>]
|
|
50
|
-
trazum rollup <document...|dir> [--json]
|
|
50
|
+
trazum rollup <document...|dir> [--json] [--html-out <file>]
|
|
51
51
|
trazum pulse [--max-stale-hours <n>]
|
|
52
52
|
trazum bench [--workload <id>] [--record <file>] [--against <file> --max-ratio <n>] [--json]
|
|
53
53
|
trazum write [--answers <file>] [--json] [-o <file>]
|
|
@@ -95,6 +95,11 @@ ${bold('OPTIONS FOR conform')}
|
|
|
95
95
|
|
|
96
96
|
${bold('OPTIONS FOR rollup')}
|
|
97
97
|
--json The roll-up document as data. See docs/format.md.
|
|
98
|
+
--html-out <file> Also write the roll-up as one self-contained HTML
|
|
99
|
+
file — the team-facing report, for whoever pays
|
|
100
|
+
the bill. Each contributor's gaps stay under that
|
|
101
|
+
contributor, and what no merge can measure is in
|
|
102
|
+
the caveat block, impossible to crop.
|
|
98
103
|
|
|
99
104
|
Several people's bills, one roll-up. Each contributor runs
|
|
100
105
|
\`trazum profile --json\` where their traffic already is; this merges the
|
|
@@ -396,6 +401,10 @@ ${bold('OPTIONS FOR optimize')}
|
|
|
396
401
|
--diff Show the line-by-line diff.
|
|
397
402
|
--json Dump the full report as JSON.
|
|
398
403
|
--locale <${d.locales.join('|')}> Language of the report. Default: the system language.
|
|
404
|
+
--max-input <chars> Raise (or lower) the prompt-input ceiling, per run.
|
|
405
|
+
Above it a prompt door refuses with the size and
|
|
406
|
+
the limit named rather than grinding. Logs and
|
|
407
|
+
documents are never held to it.
|
|
399
408
|
-o, --out <file> Write the optimised prompt to a file.
|
|
400
409
|
-h, --help This help.
|
|
401
410
|
--clear-suggestion-cache Empty the --cache-suggestions cache and say how much
|
|
@@ -503,6 +512,10 @@ ${bold('OPTIONS FOR profile')}
|
|
|
503
512
|
are named as impossible, not priced as cheap.
|
|
504
513
|
--markdown-out <file> Also write the report as Markdown, for a CI job
|
|
505
514
|
summary or a pull request comment.
|
|
515
|
+
--html-out <file> Also write the report as one self-contained HTML
|
|
516
|
+
file — the one to email to whoever pays the bill.
|
|
517
|
+
Same figures as --json, caveats rendered as
|
|
518
|
+
prominently as the totals they qualify.
|
|
506
519
|
--csv-shape <shape> Which table --csv-out writes: slice (default),
|
|
507
520
|
day, hour, or model-day (one row per day and
|
|
508
521
|
model — charts the mix moving). One row shape
|
|
@@ -866,6 +879,8 @@ ${bold('EXAMPLES')}
|
|
|
866
879
|
livePricingFailed: (url, detail) => `Could not load live prices from ${url}: ${detail}. The bundled prices are still there — drop --pricing-live to use them.`,
|
|
867
880
|
optionNeedsValue: (name) => `Option --${name} needs a value.`,
|
|
868
881
|
mustBeNonNegative: (name, raw) => `--${name} must be a non-negative number (received: "${raw}").`,
|
|
882
|
+
inputTooLarge: (source, size, limit) => `${source} is ${count(size)} characters, past the ${count(limit)}-character ceiling for a prompt. Raise it deliberately with --max-input <chars> if this input really is one.`,
|
|
883
|
+
badMaxInput: (raw) => `--max-input must be a positive number of characters (received: "${raw}").`,
|
|
869
884
|
fractionFlag: (name, raw) => `--${name} is a fraction between 0 and 1 (received: ${raw}). The config refuses the same value the same way.`,
|
|
870
885
|
badLevel: (received) => `--level must be "safe" or "aggressive" (received: "${received}").`,
|
|
871
886
|
allLabelsNeedsLog: () => '--all-labels ranks prompts by measured traffic, so it needs --from-log <usage.jsonl>. Without a log every saving would be multiplied by the same typed guess, which ranks prompts by length and calls it a priority.',
|
|
@@ -1373,6 +1388,26 @@ ${bold('EXAMPLES')}
|
|
|
1373
1388
|
stale: (hours) => `Something that runs here has not run in over ${plural(hours, 'hour')}. Silence from a scheduled job and silence from a job with nothing to report look identical; this is which.`,
|
|
1374
1389
|
notAService: () => 'This command runs nothing and hosts nothing. Something has to notice, and the something is your CI: a step that runs this on the schedule you already have turns a dead cron into a red build, without Trazum holding anybody\'s metrics. How far the measurements reach is reported and never judged — that is a provider reporting on its own schedule, not a job that failed.',
|
|
1375
1390
|
},
|
|
1391
|
+
html: {
|
|
1392
|
+
caveatsHeading: () => 'What this report cannot say',
|
|
1393
|
+
noClock: () => 'No record carried a timestamp, so days, rates and drift are not in this report — a total is still a total.',
|
|
1394
|
+
noSessions: () => 'No record carried a session, so conversation growth and per-conversation costs are not in this report.',
|
|
1395
|
+
byLabelHeading: () => 'By workload',
|
|
1396
|
+
byModelHeading: () => 'By model',
|
|
1397
|
+
findingsHeading: () => 'What would move this bill',
|
|
1398
|
+
colLabel: () => 'workload',
|
|
1399
|
+
colModel: () => 'model',
|
|
1400
|
+
colContributor: () => 'contributor',
|
|
1401
|
+
colSpanDays: () => 'days',
|
|
1402
|
+
colCalls: () => 'calls',
|
|
1403
|
+
colInput: () => 'input',
|
|
1404
|
+
colCacheRead: () => 'cache reads',
|
|
1405
|
+
colCacheWrite: () => 'cache writes',
|
|
1406
|
+
colOutput: () => 'output',
|
|
1407
|
+
sharesLine: (input, cacheRead, cacheWrite, output) => `Where the money goes: ${input} plain input, ${cacheRead} cache reads, ${cacheWrite} cache writes, ${output} output.`,
|
|
1408
|
+
footer: () => 'Generated by trazum from a usage log, offline. Every figure derives from that log and the pricing table the run named; nothing here was sent anywhere to be computed.',
|
|
1409
|
+
written: (path) => `HTML report written to ${path}.`,
|
|
1410
|
+
},
|
|
1376
1411
|
bench: {
|
|
1377
1412
|
heading: () => 'This machine, measured',
|
|
1378
1413
|
machine: (node, platform, cpuCount, cpuModel) => `node ${node} on ${platform}, ${plural(cpuCount, 'CPU')}${cpuModel === null ? '' : ` (${cpuModel})`}`,
|