@trazum/cli 1.8.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/LICENSE +21 -0
- package/README.md +134 -0
- package/dist/git.d.ts +81 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +225 -0
- package/dist/git.js.map +1 -0
- package/dist/i18n/en.d.ts +10 -0
- package/dist/i18n/en.d.ts.map +1 -0
- package/dist/i18n/en.js +694 -0
- package/dist/i18n/en.js.map +1 -0
- package/dist/i18n/es.d.ts +4 -0
- package/dist/i18n/es.d.ts.map +1 -0
- package/dist/i18n/es.js +694 -0
- package/dist/i18n/es.js.map +1 -0
- package/dist/i18n/index.d.ts +34 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +46 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/types.d.ts +363 -0
- package/dist/i18n/types.d.ts.map +1 -0
- package/dist/i18n/types.js +2 -0
- package/dist/i18n/types.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2824 -0
- package/dist/index.js.map +1 -0
- package/dist/markdown.d.ts +246 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +492 -0
- package/dist/markdown.js.map +1 -0
- package/dist/suggest-cache.d.ts +119 -0
- package/dist/suggest-cache.d.ts.map +1 -0
- package/dist/suggest-cache.js +225 -0
- package/dist/suggest-cache.js.map +1 -0
- package/package.json +49 -0
- package/src/git.ts +294 -0
- package/src/i18n/en.ts +825 -0
- package/src/i18n/es.ts +838 -0
- package/src/i18n/index.ts +57 -0
- package/src/i18n/types.ts +372 -0
- package/src/index.ts +3873 -0
- package/src/markdown.ts +717 -0
- package/src/suggest-cache.ts +268 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { DEFAULT_LOCALE, matchLocale } from '@trazum/core';
|
|
2
|
+
import type { Locale } from '@trazum/core';
|
|
3
|
+
|
|
4
|
+
import { en } from './en.js';
|
|
5
|
+
import { es } from './es.js';
|
|
6
|
+
import type { CliMessages } from './types.js';
|
|
7
|
+
|
|
8
|
+
const CATALOGUES: Record<Locale, CliMessages> = { en, es };
|
|
9
|
+
|
|
10
|
+
export function getCliMessages(locale: Locale = DEFAULT_LOCALE): CliMessages {
|
|
11
|
+
return CATALOGUES[locale] ?? CATALOGUES[DEFAULT_LOCALE];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Locale for this run, most explicit source first:
|
|
16
|
+
* the `--locale` flag, then `TRAZUM_LOCALE`, then the usual POSIX variables,
|
|
17
|
+
* and last the project config file.
|
|
18
|
+
*
|
|
19
|
+
* **The config comes last on purpose.** A repository stating `"locale": "es"`
|
|
20
|
+
* is choosing the language its CI logs read in, where `LANG` is usually unset
|
|
21
|
+
* or `C`; a contributor whose machine says otherwise should still get their own
|
|
22
|
+
* language. So the project sets the floor and the person at the keyboard wins.
|
|
23
|
+
*
|
|
24
|
+
* An unrecognised value falls back to English rather than failing: the point
|
|
25
|
+
* of the tool is to optimise the prompt, and the language of the report is
|
|
26
|
+
* never a good reason to refuse to do that.
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Every environment variable this reads, in precedence order.
|
|
30
|
+
*
|
|
31
|
+
* Exported because it was a hardcoded list in two places and they drifted. The
|
|
32
|
+
* CLI's own test suite has to neutralise the ambient locale before asserting on
|
|
33
|
+
* English output, and its copy of this list omitted `LC_MESSAGES` — so the suite
|
|
34
|
+
* passed on a CI runner and failed for a contributor whose machine sets it.
|
|
35
|
+
* There is one list now, and it is this one: a variable added here is read by the
|
|
36
|
+
* detector and neutralised by the tests in the same commit, or by neither.
|
|
37
|
+
*/
|
|
38
|
+
export const LOCALE_ENV_VARS = ['TRAZUM_LOCALE', 'LC_ALL', 'LC_MESSAGES', 'LANG'] as const;
|
|
39
|
+
|
|
40
|
+
export function detectLocale(
|
|
41
|
+
flag: string | undefined,
|
|
42
|
+
env: Record<string, string | undefined> = process.env,
|
|
43
|
+
configLocale?: string,
|
|
44
|
+
): Locale {
|
|
45
|
+
const candidates = [flag, ...LOCALE_ENV_VARS.map((name) => env[name]), configLocale];
|
|
46
|
+
for (const candidate of candidates) {
|
|
47
|
+
// An unrecognised value does not stop the search: `LANG=fr_FR.UTF-8` with
|
|
48
|
+
// `TRAZUM_LOCALE` unset should still reach the default rather than being
|
|
49
|
+
// mistaken for an explicit choice.
|
|
50
|
+
const matched = matchLocale(candidate);
|
|
51
|
+
if (matched) return matched;
|
|
52
|
+
}
|
|
53
|
+
return DEFAULT_LOCALE;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { en, es };
|
|
57
|
+
export type { CliMessages, HelpDefaults } from './types.js';
|
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
import type { EvalVerdict, Locale, RuleLevel } from '@trazum/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The CLI's own message catalogue.
|
|
5
|
+
*
|
|
6
|
+
* The core library has its own catalogue for rule copy and advisories; this
|
|
7
|
+
* one covers the chrome around them — help text, table headers, section
|
|
8
|
+
* titles and error messages. Two catalogues rather than one because the two
|
|
9
|
+
* packages ship independently: the library is usable without ever installing
|
|
10
|
+
* the CLI.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export interface HelpDefaults {
|
|
14
|
+
model: string;
|
|
15
|
+
callsPerMonth: number;
|
|
16
|
+
avgOutputTokens: number;
|
|
17
|
+
cacheHitRate: number;
|
|
18
|
+
locales: readonly string[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface CliMessages {
|
|
22
|
+
locale: Locale;
|
|
23
|
+
/** BCP 47 tag used to format numbers. */
|
|
24
|
+
numberLocale: string;
|
|
25
|
+
|
|
26
|
+
help(defaults: HelpDefaults, bold: (s: string) => string): string;
|
|
27
|
+
|
|
28
|
+
/** The on-disk cache of model answers for `--suggest`. */
|
|
29
|
+
cache: {
|
|
30
|
+
cleared(entries: number, bytes: number, dir: string): string;
|
|
31
|
+
/** Printed after a run that used the cache, so a hit is never silent. */
|
|
32
|
+
used(hits: number, misses: number): string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
errors: {
|
|
36
|
+
livePricingFailed: (url: string, detail: string) => string;
|
|
37
|
+
optionNeedsValue(name: string): string;
|
|
38
|
+
mustBeNonNegative(name: string, raw: string): string;
|
|
39
|
+
badLevel(received: string): string;
|
|
40
|
+
unknownRuleInDisable(id: string): string;
|
|
41
|
+
unknownCommand(command: string): string;
|
|
42
|
+
unknownFlag(name: string, allowed: string): string;
|
|
43
|
+
unknownFlagDidYouMean(name: string, suggestion: string): string;
|
|
44
|
+
missingInputFile(): string;
|
|
45
|
+
llmNotConfigured(): string;
|
|
46
|
+
applyNeedsSuggest(): string;
|
|
47
|
+
exactTokensNeedsKey(): string;
|
|
48
|
+
checkNeedsMaxTokens(): string;
|
|
49
|
+
evalNeedsCases(): string;
|
|
50
|
+
evalNoCases(path: string): string;
|
|
51
|
+
unknownExportFormat(received: string, allowed: string): string;
|
|
52
|
+
diffNeedsTwoFiles(): string;
|
|
53
|
+
cannotNegate(name: string): string;
|
|
54
|
+
noPromptsFound(directory: string, extensions: string): string;
|
|
55
|
+
noBudgetsApply(directory: string, configFile: string): string;
|
|
56
|
+
baselineMissing(path: string): string;
|
|
57
|
+
baselineTooBig(path: string, limit: number): string;
|
|
58
|
+
errorLabel(): string;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
report: {
|
|
62
|
+
inputTokens(): string;
|
|
63
|
+
/**
|
|
64
|
+
* @param offFamily Provider name when the model is not the family the
|
|
65
|
+
* estimator was calibrated on, otherwise null.
|
|
66
|
+
*/
|
|
67
|
+
estimated(offFamily: string | null): string;
|
|
68
|
+
exactCount(): string;
|
|
69
|
+
rulesApplied(): string;
|
|
70
|
+
nothingToTrim(): string;
|
|
71
|
+
/** The languages the phrase dictionaries cover, printed when nothing fired. */
|
|
72
|
+
dictionaryCoverage(languages: string): string;
|
|
73
|
+
levelAggressive(): string;
|
|
74
|
+
levelSafe(): string;
|
|
75
|
+
ruleHits(hits: number, tokensSaved: number): string;
|
|
76
|
+
moreChanges(count: number): string;
|
|
77
|
+
llmPass(): string;
|
|
78
|
+
examplesReview(): string;
|
|
79
|
+
examplesReviewNote(provider: string, model: string, count: number): string;
|
|
80
|
+
exampleRedundant(redundant: number[], keep: number): string;
|
|
81
|
+
llmApplied(provider: string, model: string, before: number, after: number): string;
|
|
82
|
+
llmRejected(reason: string): string;
|
|
83
|
+
costWith(modelName: string): string;
|
|
84
|
+
usageLine(calls: string, outputTokens: number, batch: boolean): string;
|
|
85
|
+
perMonthSaving(saving: string, pct: string): string;
|
|
86
|
+
beyondShortening(): string;
|
|
87
|
+
biggestLever(): string;
|
|
88
|
+
biggestLeverDetail(title: string, amount: string, times: number | null): string;
|
|
89
|
+
perMonthSuffix(amount: string): string;
|
|
90
|
+
diff(): string;
|
|
91
|
+
tokensOnlyHeading(host: string): string;
|
|
92
|
+
tokensOnlyWhy(host: string): string;
|
|
93
|
+
tokensOnlyAsked(): string;
|
|
94
|
+
tokensSaved(tokens: string): string;
|
|
95
|
+
windowUse(before: string, after: string, model: string, window: string): string;
|
|
96
|
+
tokensOnlyCost(): string;
|
|
97
|
+
diffTooLarge(lines: number, max: number): string;
|
|
98
|
+
reorderHeading(): string;
|
|
99
|
+
reorderMoved(blocks: number, tokens: string): string;
|
|
100
|
+
reorderPrefix(before: string, after: string): string;
|
|
101
|
+
reorderDeclined(count: number): string;
|
|
102
|
+
reorderDeclinedRef(phrase: string, excerpt: string): string;
|
|
103
|
+
reorderDeclinedAfter(excerpt: string): string;
|
|
104
|
+
reorderDeclinedScript(script: string): string;
|
|
105
|
+
reorderDeclinedMore(count: number): string;
|
|
106
|
+
/** One line to stderr when a redirect suppresses the report. */
|
|
107
|
+
reorderPiped(moved: number, tokens: string, declined: number): string;
|
|
108
|
+
reorderNothing(): string;
|
|
109
|
+
reorderReview(): string;
|
|
110
|
+
suggestHeading(): string;
|
|
111
|
+
suggestOffered(count: number, tokens: string): string;
|
|
112
|
+
suggestApplied(count: number, tokens: string): string;
|
|
113
|
+
suggestNothing(provider: string, model: string): string;
|
|
114
|
+
suggestRejected(count: number): string;
|
|
115
|
+
suggestRemoved(): string;
|
|
116
|
+
suggestHowToApply(): string;
|
|
117
|
+
pricingOverlaid(models: string, lastReviewed: string): string;
|
|
118
|
+
wroteTo(path: string): string;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
where: {
|
|
122
|
+
hostHeading(): string;
|
|
123
|
+
subscription(host: string): string;
|
|
124
|
+
noTarget(): string;
|
|
125
|
+
sourceHeading(path: string): string;
|
|
126
|
+
conflict(): string;
|
|
127
|
+
conflictFallback(): string;
|
|
128
|
+
nothingFound(): string;
|
|
129
|
+
providerOnly(): string;
|
|
130
|
+
evidenceLine(line: number, kind: string, detail: string): string;
|
|
131
|
+
pricedAs(): string;
|
|
132
|
+
fromConfig(): string;
|
|
133
|
+
fromDetection(): string;
|
|
134
|
+
fromProviderDefault(provider: string): string;
|
|
135
|
+
fromDefault(): string;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
pricing: {
|
|
139
|
+
liveLoaded: (added: number, refreshed: number, skipped: number) => string;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
models: {
|
|
143
|
+
title(): string;
|
|
144
|
+
unit(): string;
|
|
145
|
+
/** `days` is null when the date is unusable or in the future. */
|
|
146
|
+
reviewedOn(date: string, days: number | null): string;
|
|
147
|
+
columns: {
|
|
148
|
+
model: string;
|
|
149
|
+
input: string;
|
|
150
|
+
output: string;
|
|
151
|
+
context: string;
|
|
152
|
+
cacheMin: string;
|
|
153
|
+
};
|
|
154
|
+
promoNote(): string;
|
|
155
|
+
cacheNote(): string;
|
|
156
|
+
batchNote(): string;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
/** Language names for the coverage note, plus the conjunction that joins them. */
|
|
160
|
+
languages: Record<string, string> & { and: string };
|
|
161
|
+
|
|
162
|
+
rules: {
|
|
163
|
+
title(): string;
|
|
164
|
+
disableHint(): string;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
/** `trazum rank` — which prompts to fix first, and why. */
|
|
168
|
+
rank: {
|
|
169
|
+
heading(root: string, count: number): string;
|
|
170
|
+
subheading(model: string, calls: string): string;
|
|
171
|
+
columns: {
|
|
172
|
+
recoverable: string;
|
|
173
|
+
tokensBack: string;
|
|
174
|
+
tokens: string;
|
|
175
|
+
density: string;
|
|
176
|
+
notes: string;
|
|
177
|
+
};
|
|
178
|
+
noteExamples(count: number, tokens: string): string;
|
|
179
|
+
noteFormat(tokens: string): string;
|
|
180
|
+
noteProtected(pct: number): string;
|
|
181
|
+
skipped(count: number): string;
|
|
182
|
+
densityNote(): string;
|
|
183
|
+
recoverableNote(): string;
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
/** `trazum blame` — how a prompt's cost moved over its git history. */
|
|
187
|
+
blame: {
|
|
188
|
+
heading(path: string, revisions: number): string;
|
|
189
|
+
notARepository(): string;
|
|
190
|
+
outsideRepository(path: string): string;
|
|
191
|
+
noHistory(path: string): string;
|
|
192
|
+
gitMissing(): string;
|
|
193
|
+
columns: { when: string; tokens: string; change: string; who: string; commit: string };
|
|
194
|
+
/** The line under the table: net movement across the whole history. */
|
|
195
|
+
net(first: string, last: string, delta: string, pct: string): string;
|
|
196
|
+
netCost(amount: string, model: string, calls: string): string;
|
|
197
|
+
biggestRise(): string;
|
|
198
|
+
biggestRiseDetail(tokens: string, author: string, subject: string, sha: string): string;
|
|
199
|
+
addedAt(): string;
|
|
200
|
+
goneAt(): string;
|
|
201
|
+
truncated(shown: number): string;
|
|
202
|
+
followedRename(from: string): string;
|
|
203
|
+
estimateNote(): string;
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
/** `trazum doctor` — the survey across a whole workspace. */
|
|
207
|
+
doctor: {
|
|
208
|
+
heading(root: string, prompts: number): string;
|
|
209
|
+
subheading(model: string, calls: string): string;
|
|
210
|
+
pricesReviewed(date: string, days: number | null): string;
|
|
211
|
+
budgetsHeading(): string;
|
|
212
|
+
everyPromptBudgeted(count: number): string;
|
|
213
|
+
unbudgeted(count: number, total: number): string;
|
|
214
|
+
overBudget(count: number): string;
|
|
215
|
+
andMore(count: number): string;
|
|
216
|
+
findingsHeading(): string;
|
|
217
|
+
acrossPrompts(count: number): string;
|
|
218
|
+
findingsNote(): string;
|
|
219
|
+
notAGate(): string;
|
|
220
|
+
sharedPrefixHeading(): string;
|
|
221
|
+
sharedPrefixGroup(count: number, tokens: string, drift: 'whitespace' | 'wording'): string;
|
|
222
|
+
sharedPrefixFix(drift: 'whitespace' | 'wording'): string;
|
|
223
|
+
sharedPrefixNoFigure(): string;
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
prune: {
|
|
227
|
+
needsExamples(): string;
|
|
228
|
+
estimate(examples: number, cases: number, calls: number): string;
|
|
229
|
+
needsConsent(): string;
|
|
230
|
+
heading(model: string): string;
|
|
231
|
+
selfAgreement(pct: string): string;
|
|
232
|
+
line(n: number, tokens: number, pct: string): string;
|
|
233
|
+
verdictNeeded(): string;
|
|
234
|
+
verdictRecoverable(): string;
|
|
235
|
+
verdictUnknown(): string;
|
|
236
|
+
recoverable(tokens: number): string;
|
|
237
|
+
caveat(): string;
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
eval: {
|
|
241
|
+
nothingToCompare(): string;
|
|
242
|
+
starting(cases: number, calls: number, model: string): string;
|
|
243
|
+
heading(): string;
|
|
244
|
+
selfAgreement(pct: string): string;
|
|
245
|
+
crossAgreement(pct: string): string;
|
|
246
|
+
verdict(kind: EvalVerdict): { label: string; detail: string };
|
|
247
|
+
mostChanged(): string;
|
|
248
|
+
caseAgreement(cross: string, self: string): string;
|
|
249
|
+
callsMade(count: number): string;
|
|
250
|
+
exportWarnings(count: number): string;
|
|
251
|
+
exportWrote(path: string, cases: number, assertions: number): string;
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
diff: {
|
|
255
|
+
heading(before: string, after: string): string;
|
|
256
|
+
measuringOptimised(): string;
|
|
257
|
+
monthly(delta: string, calls: string, model: string): string;
|
|
258
|
+
advisoriesAppeared(): string;
|
|
259
|
+
advisoriesResolved(): string;
|
|
260
|
+
rulesNewlyFiring(): string;
|
|
261
|
+
rulesNoLongerFiring(): string;
|
|
262
|
+
overLimit(delta: number, max: number): string;
|
|
263
|
+
/** `--all`: the same gate, per prompt rather than on the total. */
|
|
264
|
+
someOverLimit(count: number, max: number): string;
|
|
265
|
+
allSubheading(prompts: number): string;
|
|
266
|
+
allTotal(delta: string, prompts: number): string;
|
|
267
|
+
signConvention(): string;
|
|
268
|
+
onlyBefore(): string;
|
|
269
|
+
onlyAfter(): string;
|
|
270
|
+
onlyOneSideNote(): string;
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Copy for the markdown reports written by `--markdown-out`.
|
|
275
|
+
*
|
|
276
|
+
* A separate section rather than reuse of `check`/`diff`, because the terminal
|
|
277
|
+
* and a pull request are read differently: the terminal reader ran the
|
|
278
|
+
* command and knows what they asked for, the pull-request reader arrived at a
|
|
279
|
+
* comment with no context and needs the sign convention spelled out.
|
|
280
|
+
*/
|
|
281
|
+
markdown: {
|
|
282
|
+
checkHeading(target: string): string;
|
|
283
|
+
/** The cost-diff block a pull-request comment leads with. */
|
|
284
|
+
baselineGrew(delta: string, pct: string): string;
|
|
285
|
+
baselineShrank(delta: string, pct: string): string;
|
|
286
|
+
baselineUnchanged(): string;
|
|
287
|
+
baselineOverLimit(limits: string): string;
|
|
288
|
+
baselineLimitTokens(limit: string): string;
|
|
289
|
+
baselineLimitPct(limit: string): string;
|
|
290
|
+
baselineColumnBefore(): string;
|
|
291
|
+
baselineColumnAfter(): string;
|
|
292
|
+
baselineMoney(before: string, after: string, delta: string): string;
|
|
293
|
+
baselineMoneyIncomparable(): string;
|
|
294
|
+
baselineReRecord(command: string, path: string): string;
|
|
295
|
+
diffHeading(before: string, after: string): string;
|
|
296
|
+
rankHeading(root: string, count: number): string;
|
|
297
|
+
blameHeading(path: string): string;
|
|
298
|
+
/** The level the recoverable figures were measured at. */
|
|
299
|
+
rankLevel(level: RuleLevel): string;
|
|
300
|
+
columnFile(): string;
|
|
301
|
+
columnTokens(): string;
|
|
302
|
+
columnBudget(): string;
|
|
303
|
+
columnMetric(): string;
|
|
304
|
+
columnChange(): string;
|
|
305
|
+
allWithin(budgeted: number): string;
|
|
306
|
+
overBudget(failures: number, budgeted: number): string;
|
|
307
|
+
noBudget(): string;
|
|
308
|
+
unbudgetedNote(count: number): string;
|
|
309
|
+
whatWouldHelp(): string;
|
|
310
|
+
wouldFit(level: string, optimizedTokens: string): string;
|
|
311
|
+
stillTooBig(optimizedTokens: string): string;
|
|
312
|
+
truncated(): string;
|
|
313
|
+
footer(source: string, level: string): string;
|
|
314
|
+
pricingOverlaid(count: number, lastReviewed: string): string;
|
|
315
|
+
sourceEstimated(): string;
|
|
316
|
+
sourceExact(): string;
|
|
317
|
+
measuringOptimised(): string;
|
|
318
|
+
metricTokens(before: string, after: string): string;
|
|
319
|
+
metricMonthly(calls: string, model: string): string;
|
|
320
|
+
deltaConvention(): string;
|
|
321
|
+
advisoriesAppeared(): string;
|
|
322
|
+
advisoriesResolved(): string;
|
|
323
|
+
rulesNewlyFiring(): string;
|
|
324
|
+
rulesNoLongerFiring(): string;
|
|
325
|
+
collapsedNote(): string;
|
|
326
|
+
trimNotice(): string;
|
|
327
|
+
commentTitle(): string;
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
check: {
|
|
331
|
+
okLabel(): string;
|
|
332
|
+
failedLabel(): string;
|
|
333
|
+
embeddedHeading(path: string, count: number): string;
|
|
334
|
+
declinedHeading(count: number): string;
|
|
335
|
+
declinedAt(line: number, detail: string): string;
|
|
336
|
+
ok(tokens: string, budget: string): string;
|
|
337
|
+
failed(tokens: string, budget: string): string;
|
|
338
|
+
wouldFit(level: string, optimizedTokens: string): string;
|
|
339
|
+
stillTooBig(optimizedTokens: string): string;
|
|
340
|
+
directoryHeading(directory: string, files: number): string;
|
|
341
|
+
directorySummary(failures: number, files: number): string;
|
|
342
|
+
noBudget(): string;
|
|
343
|
+
walkTruncated(): string;
|
|
344
|
+
exactCountsCost(files: number): string;
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* The cost baseline: recording one, and reporting drift from it.
|
|
349
|
+
*
|
|
350
|
+
* Separate from `check` because it answers a different question — "did this
|
|
351
|
+
* get worse" rather than "does this fit" — and both verdicts appear in the
|
|
352
|
+
* same run.
|
|
353
|
+
*/
|
|
354
|
+
baseline: {
|
|
355
|
+
recorded(path: string, files: string, tokens: string): string;
|
|
356
|
+
recordedMoney(monthly: string, model: string, calls: string): string;
|
|
357
|
+
heading(): string;
|
|
358
|
+
unchanged(tokens: string): string;
|
|
359
|
+
grew(delta: string, pct: string, tokens: string): string;
|
|
360
|
+
shrank(delta: string, pct: string, tokens: string): string;
|
|
361
|
+
entry(path: string, before: string, after: string, delta: string): string;
|
|
362
|
+
addedHeading(count: number): string;
|
|
363
|
+
removedHeading(count: number): string;
|
|
364
|
+
grownHeading(count: number): string;
|
|
365
|
+
breachTokens(actual: string, limit: string): string;
|
|
366
|
+
breachPct(actual: string, limit: string): string;
|
|
367
|
+
reRecord(path: string): string;
|
|
368
|
+
money(before: string, after: string, delta: string): string;
|
|
369
|
+
moneyIncomparableScenario(): string;
|
|
370
|
+
moneyIncomparablePricing(was: string, now: string): string;
|
|
371
|
+
};
|
|
372
|
+
}
|