@domandigital/craft 0.9.0 → 0.11.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/index.d.cts CHANGED
@@ -1031,7 +1031,7 @@ interface CheckReport {
1031
1031
  * Bumped whenever an entry is added, removed or its detection changes, so a
1032
1032
  * report can say which list it was judged against.
1033
1033
  */
1034
- declare const CATALOGUE_VERSION = "2026.09.7";
1034
+ declare const CATALOGUE_VERSION = "2026.09.8";
1035
1035
  declare const CATALOGUE: readonly Tell[];
1036
1036
  declare function tellById(id: string): Tell | undefined;
1037
1037
  /**
@@ -1147,6 +1147,231 @@ interface FactComparison {
1147
1147
  declare function compareFacts(before: string, after: string): FactComparison;
1148
1148
  declare function formatComparison(result: FactComparison, beforePath: string, afterPath: string): string;
1149
1149
 
1150
+ /**
1151
+ * The claims list: every sentence a reader would take as a checkable fact.
1152
+ *
1153
+ * No tell can say whether "Bark charges £2,000 to £7,000" is true. The worst
1154
+ * faults in the DD article that set this off (2026-09-24) were figures like
1155
+ * that: a wrong range, an unsourced day rate, a study quoted past what it
1156
+ * found. Every one passed the copy check, because the prose was fine.
1157
+ *
1158
+ * So this does not judge. It lists each sentence holding a price, a figure, a
1159
+ * date or a named source, marks whether the sentence names where it came
1160
+ * from, and leaves the verdict to a person with the primary source open.
1161
+ * "Sourced" means a source is named, not that it says what the sentence
1162
+ * claims: that is exactly what the person checks.
1163
+ *
1164
+ * Pure over text. `craft copy claims <paths...>` is the command.
1165
+ */
1166
+
1167
+ interface Claim {
1168
+ path: string;
1169
+ line: number;
1170
+ /** The sentence, trimmed to a readable length. */
1171
+ sentence: string;
1172
+ /** The prices, figures and dates in it. */
1173
+ facts: Fact[];
1174
+ /** Who the sentence says it comes from: a name, a publication or a link. Empty when nobody is named. */
1175
+ sources: string[];
1176
+ /**
1177
+ * A source named earlier in the same paragraph. A hint for the person, never
1178
+ * a pass: the sentence may be the writer's own arithmetic on top of it.
1179
+ */
1180
+ nearby?: string[];
1181
+ }
1182
+ interface ClaimsReport {
1183
+ files: number;
1184
+ claims: Claim[];
1185
+ unsourced: number;
1186
+ }
1187
+ declare function namedSources(sentence: string): string[];
1188
+ declare function findClaims(files: SourceFile[]): ClaimsReport;
1189
+ declare function formatClaims(report: ClaimsReport, label?: string): string;
1190
+
1191
+ /**
1192
+ * Baselines: adopt craft on a repo that already has findings, and fail only
1193
+ * on new ones.
1194
+ *
1195
+ * A finding is keyed on its tell, its path and a hash of its excerpt with the
1196
+ * whitespace collapsed, never on its line: an edit above a known finding
1197
+ * moves it, and a moved finding is not a new one. Keys are counted, so a file
1198
+ * with two identical findings and a baseline of one reports the second.
1199
+ *
1200
+ * Pure. The command line reads and writes the file.
1201
+ */
1202
+
1203
+ declare const BASELINE_VERSION = 1;
1204
+ interface BaselineEntry {
1205
+ tell: string;
1206
+ path: string;
1207
+ /** FNV-1a of the excerpt, whitespace collapsed. */
1208
+ excerpt: string;
1209
+ count: number;
1210
+ }
1211
+ interface Baseline {
1212
+ version: typeof BASELINE_VERSION;
1213
+ catalogueVersion: string;
1214
+ entries: BaselineEntry[];
1215
+ }
1216
+ /** The key a finding is matched on. Also the SARIF partial fingerprint. */
1217
+ declare function findingKey(f: Finding): string;
1218
+ /** Every finding in a report, as a baseline. */
1219
+ declare function createBaseline(report: CheckReport): Baseline;
1220
+ /** Validate a parsed baseline file. */
1221
+ declare function parseBaseline(data: unknown, source?: string): Baseline;
1222
+ /**
1223
+ * The report without the findings the baseline already knows about.
1224
+ * `baselined` is how many were removed, so the output can say so: a
1225
+ * baseline that hides findings silently is a hole.
1226
+ */
1227
+ declare function applyBaseline(report: CheckReport, baseline: Baseline): CheckReport & {
1228
+ baselined: number;
1229
+ };
1230
+
1231
+ /**
1232
+ * `craft.config.json`: what a repo tells craft about itself.
1233
+ *
1234
+ * Pure: the command line reads the file and hands the parsed JSON here. The
1235
+ * design choices live in `art-direction.json`; this file is about the tool:
1236
+ * which paths are not the site, where the copy is, and a repo's own decisions
1237
+ * about a tell's severity.
1238
+ *
1239
+ * {
1240
+ * "ignore": ["docs/archive/**", "*.stories.tsx"],
1241
+ * "copyPaths": ["content", "src/app"],
1242
+ * "severity": {
1243
+ * "ai-violet": { "level": "off", "because": "The client's shopfront has been this violet since 1998." },
1244
+ * "em-dash": { "level": "block", "because": "House style for this client bans them outright." }
1245
+ * }
1246
+ * }
1247
+ *
1248
+ * A severity change needs a `because`, like an exception in
1249
+ * `art-direction.json`, and for the same reason: a tell switched off with no
1250
+ * reason is a guard nobody can audit. `off` becomes an exception, so the
1251
+ * report still lists what it silenced.
1252
+ */
1253
+
1254
+ type SeverityLevel = "warn" | "block" | "off";
1255
+ interface SeverityOverride {
1256
+ level: SeverityLevel;
1257
+ because: string;
1258
+ }
1259
+ interface CraftConfig {
1260
+ /** Glob patterns for paths that are not the site. Added to `DEFAULT_IGNORE`. */
1261
+ ignore: string[];
1262
+ /** Where `craft copy` looks when no path is given. */
1263
+ copyPaths?: string[];
1264
+ severity: Record<string, SeverityOverride>;
1265
+ }
1266
+ /**
1267
+ * Agent and tool folders: instructions for the people and models building
1268
+ * the site, not copy a visitor reads. Always ignored by a directory walk.
1269
+ */
1270
+ declare const DEFAULT_IGNORE: string[];
1271
+ /**
1272
+ * Validate a parsed `craft.config.json`. Throws with the file name and the
1273
+ * key at fault: a config that half-applies is worse than one that stops the
1274
+ * run.
1275
+ */
1276
+ declare function parseCraftConfig(data: unknown, knownTells: ReadonlySet<string>, source?: string): CraftConfig;
1277
+ /**
1278
+ * A glob as a regular expression over a `/`-separated relative path.
1279
+ * `*` is one segment's worth, `**` any depth, `?` one character. A pattern
1280
+ * with no `/` matches a file or folder of that name anywhere; otherwise it is
1281
+ * anchored at the repo root. Anything under a matched folder matches too.
1282
+ */
1283
+ declare function globToRegExp(glob: string): RegExp;
1284
+ /** A matcher for a set of globs. Paths are normalised to `/` before matching. */
1285
+ declare function ignoreMatcher(patterns: string[]): (path: string) => boolean;
1286
+ /** `off` entries, as exceptions: applied, and listed as silenced in the report. */
1287
+ declare function severityExceptions(config: CraftConfig): TellException[];
1288
+ /** `warn` and `block` entries, applied to a finished report. */
1289
+ declare function applySeverity(report: CheckReport, config: CraftConfig): CheckReport;
1290
+
1291
+ /**
1292
+ * A report as SARIF 2.1.0, for GitHub code scanning and any other tool that
1293
+ * reads it. Pure.
1294
+ *
1295
+ * One rule per tell the report names, carrying the tell's `why` and `fix`.
1296
+ * `block` findings are errors, `warn` findings warnings. A finding on a
1297
+ * rendered page has the URL as its location and no line: GitHub code
1298
+ * scanning only shows results in files of the repo, so those appear in the
1299
+ * SARIF file but not in the Security tab.
1300
+ */
1301
+
1302
+ interface SarifTell {
1303
+ id: string;
1304
+ name: string;
1305
+ why: string;
1306
+ fix: string;
1307
+ }
1308
+ interface SarifOptions {
1309
+ /** The catalogue, for each rule's description. */
1310
+ tells: readonly SarifTell[];
1311
+ /** Where a reader learns more. */
1312
+ informationUri?: string;
1313
+ }
1314
+ declare function toSarif(report: CheckReport, options: SarifOptions): {
1315
+ $schema: string;
1316
+ version: "2.1.0";
1317
+ runs: {
1318
+ tool: {
1319
+ driver: {
1320
+ name: string;
1321
+ version: string;
1322
+ informationUri: string;
1323
+ rules: {
1324
+ fullDescription?: {
1325
+ text: string;
1326
+ } | undefined;
1327
+ help?: {
1328
+ text: string;
1329
+ } | undefined;
1330
+ id: string;
1331
+ name: string;
1332
+ shortDescription: {
1333
+ text: string;
1334
+ };
1335
+ }[];
1336
+ };
1337
+ };
1338
+ results: {
1339
+ ruleId: string;
1340
+ ruleIndex: number;
1341
+ level: "error" | "warning";
1342
+ message: {
1343
+ text: string;
1344
+ };
1345
+ locations: {
1346
+ physicalLocation: {
1347
+ region?: {
1348
+ startLine: number;
1349
+ snippet: {
1350
+ text: string;
1351
+ };
1352
+ } | undefined;
1353
+ artifactLocation: {
1354
+ uri: string;
1355
+ };
1356
+ };
1357
+ }[];
1358
+ partialFingerprints: {
1359
+ "craftFinding/v1": string;
1360
+ };
1361
+ }[];
1362
+ }[];
1363
+ };
1364
+
1365
+ /**
1366
+ * The `--json` contract. Every JSON document a craft command prints carries
1367
+ * `schemaVersion`, so a script reading it can refuse a shape it does not
1368
+ * know instead of misreading it. Bump it when a field is removed or changes
1369
+ * meaning; adding a field is not a bump.
1370
+ */
1371
+ declare const JSON_SCHEMA_VERSION = 1;
1372
+ /** A command's JSON output, versioned. */
1373
+ declare function toJson(data: object): string;
1374
+
1150
1375
  /**
1151
1376
  * The rendered detection path for tells that can be seen on a live page.
1152
1377
  *
@@ -1779,4 +2004,4 @@ declare function characterReport(input: CharacterInputs, copyTells?: Set<string>
1779
2004
 
1780
2005
  declare function retrofitPlan(report: CharacterReport, direction?: ArtDirection | null): string;
1781
2006
 
1782
- export { AI_PHRASES, AI_VIOLET, AI_WORDS, type AccentFork, type AccentForkOptions, type Action, type Area, type ArtDirection, BUZZWORDS, CATALOGUE, CATALOGUE_VERSION, CHOICE_KEYS, type CandidateKind, type CharacterInputs, type CharacterReport, type CheckOptions, type CheckReport, type CheckRestraintInput, type ChoiceKey, type ContrastCheck, type ContrastReport, type CopyTell, type CraftTokensInput, type CraftTokensResult, DENSITIES, DENSITY_NAMES, DIRECTION_VERSION, DISTANCE_WEIGHTS, DURATION_MS, DURATION_S, type DensityCssOptions, type DensityName, type DirectionChoice, type DirectionProblem, type DirectionReport, type DirectionSource, type DurationName, EASE, EASE_TUPLE, ESTATE_VERSION, EXIT_RATIO, type EaseName, type EmitCssOptions, type EstateMatch, type EstatePair, type EstateRegister, type EstateSite, FINGERPRINT_VERSION, type Fact, type FactComparison, type FactKind, type Finding, type Fingerprint, type FingerprintDistance, type FluidSpaceOptions, type FluidTypeOptions, type FluidTypeResult, type FontClass, type Gamut, type Generation, HOUSE, HOUSE_BUDGET, HOUSE_TYPE, type HarvestCandidate, type HarvestOptions, type Hit, type HouseRule, type HouseTier, LIGHTNESS_CURVE, MIN_DECIDED, MIN_RUNS, type MotionDecision, type MotionKind, NEGATIVE_REASSURANCE, NULL_VERSION, type NullModel, type NullRun, type Oklch, type OklchToHexOptions, PILL_LIMIT, PLAINER_WORDS, PROPOSED, type PaletteColour, type Proposal, type ProposeInput, RAMP_STEPS, REFLEX_FONTS_1, REFLEX_FONTS_2, RENDERED_PATHS, REVEAL_LIMIT, REVIEW_PHRASES, type Ramp, type RampFromAnchorsOptions, type RampOptions, type RampStep, type RestraintBudget, type RestraintReport, type RestraintSeverity, type RestraintViolation, type Rgb, SCALE, SHADCN_LIMIT, SHADCN_PRIMITIVES, SIBLING_AT, SNAPSHOT_VERSION, SOURCE_KINDS, SPACE_STEPS, SPRING, STOCK_PHRASES, type SectionKind, type SectionRhythmOptions, type SemanticInput, type SemanticResult, type Severity, type ShouldAnimateInput, type SignalResult, type Snapshot, type SnapshotColour, type SnapshotControl, type SnapshotEffects, type SnapshotFont, type SnapshotGradient, type SnapshotHeading, type SnapshotMotion, type SnapshotPatch, type SnapshotSection, type SourceFile, type SourceKind, type SourceTell, type SpaceStep, type Surface, TELL_HEAVY, TYPE_STEPS, TYPICAL_AT, type TailwindPreset, type Tell, type TellException, type TypeStep, type Typicality, VAGUE_WORDS, type ValidateContext, type Verdict, accentFork, addSite, apcaContrast, applyHouseGate, auditSnapshot, catalogueTable, characterReport, checkCopy, checkPair, checkRestraint, choicesOf, compareFacts, compareToEstate, craftTokens, deltaEOk, deltaEOkHex, densityCss, densityTokens, emitCss, emptyEstate, estatePairs, exitDuration, extractHtml, findColours, fingerprint, fingerprintDistance, fluidClamp, fluidSpace, fluidType, fontClass, formatComparison, formatHex, formatReport, groundName, harvest, hexToOklch, houseRule, hueName, hueSwatch, inP3Gamut, inSrgbGamut, initDirection, isAiViolet, isCream, makeSnapshot, motionTokens, nearest, normaliseFamily, nullPrompt, oklchToHex, oklchToRgb, paletteFromPixels, parseColour, parseHex, propose, protectedFacts, ramp, rampFromAnchors, retrofitPlan, runTell, scanSource, sectionRhythm, semantic, shapeName, sharedParts, shouldAnimate, siblingLine, tailwindV3Preset, tailwindV4Theme, tellById, toGamut, typeFeatureTokens, typicality, validateDirection, visibleText, wcagContrast, wordListsJson };
2007
+ export { AI_PHRASES, AI_VIOLET, AI_WORDS, type AccentFork, type AccentForkOptions, type Action, type Area, type ArtDirection, BASELINE_VERSION, BUZZWORDS, type Baseline, type BaselineEntry, CATALOGUE, CATALOGUE_VERSION, CHOICE_KEYS, type CandidateKind, type CharacterInputs, type CharacterReport, type CheckOptions, type CheckReport, type CheckRestraintInput, type ChoiceKey, type Claim, type ClaimsReport, type ContrastCheck, type ContrastReport, type CopyTell, type CraftConfig, type CraftTokensInput, type CraftTokensResult, DEFAULT_IGNORE, DENSITIES, DENSITY_NAMES, DIRECTION_VERSION, DISTANCE_WEIGHTS, DURATION_MS, DURATION_S, type DensityCssOptions, type DensityName, type DirectionChoice, type DirectionProblem, type DirectionReport, type DirectionSource, type DurationName, EASE, EASE_TUPLE, ESTATE_VERSION, EXIT_RATIO, type EaseName, type EmitCssOptions, type EstateMatch, type EstatePair, type EstateRegister, type EstateSite, FINGERPRINT_VERSION, type Fact, type FactComparison, type FactKind, type Finding, type Fingerprint, type FingerprintDistance, type FluidSpaceOptions, type FluidTypeOptions, type FluidTypeResult, type FontClass, type Gamut, type Generation, HOUSE, HOUSE_BUDGET, HOUSE_TYPE, type HarvestCandidate, type HarvestOptions, type Hit, type HouseRule, type HouseTier, JSON_SCHEMA_VERSION, LIGHTNESS_CURVE, MIN_DECIDED, MIN_RUNS, type MotionDecision, type MotionKind, NEGATIVE_REASSURANCE, NULL_VERSION, type NullModel, type NullRun, type Oklch, type OklchToHexOptions, PILL_LIMIT, PLAINER_WORDS, PROPOSED, type PaletteColour, type Proposal, type ProposeInput, RAMP_STEPS, REFLEX_FONTS_1, REFLEX_FONTS_2, RENDERED_PATHS, REVEAL_LIMIT, REVIEW_PHRASES, type Ramp, type RampFromAnchorsOptions, type RampOptions, type RampStep, type RestraintBudget, type RestraintReport, type RestraintSeverity, type RestraintViolation, type Rgb, SCALE, SHADCN_LIMIT, SHADCN_PRIMITIVES, SIBLING_AT, SNAPSHOT_VERSION, SOURCE_KINDS, SPACE_STEPS, SPRING, STOCK_PHRASES, type SarifOptions, type SarifTell, type SectionKind, type SectionRhythmOptions, type SemanticInput, type SemanticResult, type Severity, type SeverityLevel, type SeverityOverride, type ShouldAnimateInput, type SignalResult, type Snapshot, type SnapshotColour, type SnapshotControl, type SnapshotEffects, type SnapshotFont, type SnapshotGradient, type SnapshotHeading, type SnapshotMotion, type SnapshotPatch, type SnapshotSection, type SourceFile, type SourceKind, type SourceTell, type SpaceStep, type Surface, TELL_HEAVY, TYPE_STEPS, TYPICAL_AT, type TailwindPreset, type Tell, type TellException, type TypeStep, type Typicality, VAGUE_WORDS, type ValidateContext, type Verdict, accentFork, addSite, apcaContrast, applyBaseline, applyHouseGate, applySeverity, auditSnapshot, catalogueTable, characterReport, checkCopy, checkPair, checkRestraint, choicesOf, compareFacts, compareToEstate, craftTokens, createBaseline, deltaEOk, deltaEOkHex, densityCss, densityTokens, emitCss, emptyEstate, estatePairs, exitDuration, extractHtml, findClaims, findColours, findingKey, fingerprint, fingerprintDistance, fluidClamp, fluidSpace, fluidType, fontClass, formatClaims, formatComparison, formatHex, formatReport, globToRegExp, groundName, harvest, hexToOklch, houseRule, hueName, hueSwatch, ignoreMatcher, inP3Gamut, inSrgbGamut, initDirection, isAiViolet, isCream, makeSnapshot, motionTokens, namedSources, nearest, normaliseFamily, nullPrompt, oklchToHex, oklchToRgb, paletteFromPixels, parseBaseline, parseColour, parseCraftConfig, parseHex, propose, protectedFacts, ramp, rampFromAnchors, retrofitPlan, runTell, scanSource, sectionRhythm, semantic, severityExceptions, shapeName, sharedParts, shouldAnimate, siblingLine, tailwindV3Preset, tailwindV4Theme, tellById, toGamut, toJson, toSarif, typeFeatureTokens, typicality, validateDirection, visibleText, wcagContrast, wordListsJson };
package/dist/index.d.ts CHANGED
@@ -1031,7 +1031,7 @@ interface CheckReport {
1031
1031
  * Bumped whenever an entry is added, removed or its detection changes, so a
1032
1032
  * report can say which list it was judged against.
1033
1033
  */
1034
- declare const CATALOGUE_VERSION = "2026.09.7";
1034
+ declare const CATALOGUE_VERSION = "2026.09.8";
1035
1035
  declare const CATALOGUE: readonly Tell[];
1036
1036
  declare function tellById(id: string): Tell | undefined;
1037
1037
  /**
@@ -1147,6 +1147,231 @@ interface FactComparison {
1147
1147
  declare function compareFacts(before: string, after: string): FactComparison;
1148
1148
  declare function formatComparison(result: FactComparison, beforePath: string, afterPath: string): string;
1149
1149
 
1150
+ /**
1151
+ * The claims list: every sentence a reader would take as a checkable fact.
1152
+ *
1153
+ * No tell can say whether "Bark charges £2,000 to £7,000" is true. The worst
1154
+ * faults in the DD article that set this off (2026-09-24) were figures like
1155
+ * that: a wrong range, an unsourced day rate, a study quoted past what it
1156
+ * found. Every one passed the copy check, because the prose was fine.
1157
+ *
1158
+ * So this does not judge. It lists each sentence holding a price, a figure, a
1159
+ * date or a named source, marks whether the sentence names where it came
1160
+ * from, and leaves the verdict to a person with the primary source open.
1161
+ * "Sourced" means a source is named, not that it says what the sentence
1162
+ * claims: that is exactly what the person checks.
1163
+ *
1164
+ * Pure over text. `craft copy claims <paths...>` is the command.
1165
+ */
1166
+
1167
+ interface Claim {
1168
+ path: string;
1169
+ line: number;
1170
+ /** The sentence, trimmed to a readable length. */
1171
+ sentence: string;
1172
+ /** The prices, figures and dates in it. */
1173
+ facts: Fact[];
1174
+ /** Who the sentence says it comes from: a name, a publication or a link. Empty when nobody is named. */
1175
+ sources: string[];
1176
+ /**
1177
+ * A source named earlier in the same paragraph. A hint for the person, never
1178
+ * a pass: the sentence may be the writer's own arithmetic on top of it.
1179
+ */
1180
+ nearby?: string[];
1181
+ }
1182
+ interface ClaimsReport {
1183
+ files: number;
1184
+ claims: Claim[];
1185
+ unsourced: number;
1186
+ }
1187
+ declare function namedSources(sentence: string): string[];
1188
+ declare function findClaims(files: SourceFile[]): ClaimsReport;
1189
+ declare function formatClaims(report: ClaimsReport, label?: string): string;
1190
+
1191
+ /**
1192
+ * Baselines: adopt craft on a repo that already has findings, and fail only
1193
+ * on new ones.
1194
+ *
1195
+ * A finding is keyed on its tell, its path and a hash of its excerpt with the
1196
+ * whitespace collapsed, never on its line: an edit above a known finding
1197
+ * moves it, and a moved finding is not a new one. Keys are counted, so a file
1198
+ * with two identical findings and a baseline of one reports the second.
1199
+ *
1200
+ * Pure. The command line reads and writes the file.
1201
+ */
1202
+
1203
+ declare const BASELINE_VERSION = 1;
1204
+ interface BaselineEntry {
1205
+ tell: string;
1206
+ path: string;
1207
+ /** FNV-1a of the excerpt, whitespace collapsed. */
1208
+ excerpt: string;
1209
+ count: number;
1210
+ }
1211
+ interface Baseline {
1212
+ version: typeof BASELINE_VERSION;
1213
+ catalogueVersion: string;
1214
+ entries: BaselineEntry[];
1215
+ }
1216
+ /** The key a finding is matched on. Also the SARIF partial fingerprint. */
1217
+ declare function findingKey(f: Finding): string;
1218
+ /** Every finding in a report, as a baseline. */
1219
+ declare function createBaseline(report: CheckReport): Baseline;
1220
+ /** Validate a parsed baseline file. */
1221
+ declare function parseBaseline(data: unknown, source?: string): Baseline;
1222
+ /**
1223
+ * The report without the findings the baseline already knows about.
1224
+ * `baselined` is how many were removed, so the output can say so: a
1225
+ * baseline that hides findings silently is a hole.
1226
+ */
1227
+ declare function applyBaseline(report: CheckReport, baseline: Baseline): CheckReport & {
1228
+ baselined: number;
1229
+ };
1230
+
1231
+ /**
1232
+ * `craft.config.json`: what a repo tells craft about itself.
1233
+ *
1234
+ * Pure: the command line reads the file and hands the parsed JSON here. The
1235
+ * design choices live in `art-direction.json`; this file is about the tool:
1236
+ * which paths are not the site, where the copy is, and a repo's own decisions
1237
+ * about a tell's severity.
1238
+ *
1239
+ * {
1240
+ * "ignore": ["docs/archive/**", "*.stories.tsx"],
1241
+ * "copyPaths": ["content", "src/app"],
1242
+ * "severity": {
1243
+ * "ai-violet": { "level": "off", "because": "The client's shopfront has been this violet since 1998." },
1244
+ * "em-dash": { "level": "block", "because": "House style for this client bans them outright." }
1245
+ * }
1246
+ * }
1247
+ *
1248
+ * A severity change needs a `because`, like an exception in
1249
+ * `art-direction.json`, and for the same reason: a tell switched off with no
1250
+ * reason is a guard nobody can audit. `off` becomes an exception, so the
1251
+ * report still lists what it silenced.
1252
+ */
1253
+
1254
+ type SeverityLevel = "warn" | "block" | "off";
1255
+ interface SeverityOverride {
1256
+ level: SeverityLevel;
1257
+ because: string;
1258
+ }
1259
+ interface CraftConfig {
1260
+ /** Glob patterns for paths that are not the site. Added to `DEFAULT_IGNORE`. */
1261
+ ignore: string[];
1262
+ /** Where `craft copy` looks when no path is given. */
1263
+ copyPaths?: string[];
1264
+ severity: Record<string, SeverityOverride>;
1265
+ }
1266
+ /**
1267
+ * Agent and tool folders: instructions for the people and models building
1268
+ * the site, not copy a visitor reads. Always ignored by a directory walk.
1269
+ */
1270
+ declare const DEFAULT_IGNORE: string[];
1271
+ /**
1272
+ * Validate a parsed `craft.config.json`. Throws with the file name and the
1273
+ * key at fault: a config that half-applies is worse than one that stops the
1274
+ * run.
1275
+ */
1276
+ declare function parseCraftConfig(data: unknown, knownTells: ReadonlySet<string>, source?: string): CraftConfig;
1277
+ /**
1278
+ * A glob as a regular expression over a `/`-separated relative path.
1279
+ * `*` is one segment's worth, `**` any depth, `?` one character. A pattern
1280
+ * with no `/` matches a file or folder of that name anywhere; otherwise it is
1281
+ * anchored at the repo root. Anything under a matched folder matches too.
1282
+ */
1283
+ declare function globToRegExp(glob: string): RegExp;
1284
+ /** A matcher for a set of globs. Paths are normalised to `/` before matching. */
1285
+ declare function ignoreMatcher(patterns: string[]): (path: string) => boolean;
1286
+ /** `off` entries, as exceptions: applied, and listed as silenced in the report. */
1287
+ declare function severityExceptions(config: CraftConfig): TellException[];
1288
+ /** `warn` and `block` entries, applied to a finished report. */
1289
+ declare function applySeverity(report: CheckReport, config: CraftConfig): CheckReport;
1290
+
1291
+ /**
1292
+ * A report as SARIF 2.1.0, for GitHub code scanning and any other tool that
1293
+ * reads it. Pure.
1294
+ *
1295
+ * One rule per tell the report names, carrying the tell's `why` and `fix`.
1296
+ * `block` findings are errors, `warn` findings warnings. A finding on a
1297
+ * rendered page has the URL as its location and no line: GitHub code
1298
+ * scanning only shows results in files of the repo, so those appear in the
1299
+ * SARIF file but not in the Security tab.
1300
+ */
1301
+
1302
+ interface SarifTell {
1303
+ id: string;
1304
+ name: string;
1305
+ why: string;
1306
+ fix: string;
1307
+ }
1308
+ interface SarifOptions {
1309
+ /** The catalogue, for each rule's description. */
1310
+ tells: readonly SarifTell[];
1311
+ /** Where a reader learns more. */
1312
+ informationUri?: string;
1313
+ }
1314
+ declare function toSarif(report: CheckReport, options: SarifOptions): {
1315
+ $schema: string;
1316
+ version: "2.1.0";
1317
+ runs: {
1318
+ tool: {
1319
+ driver: {
1320
+ name: string;
1321
+ version: string;
1322
+ informationUri: string;
1323
+ rules: {
1324
+ fullDescription?: {
1325
+ text: string;
1326
+ } | undefined;
1327
+ help?: {
1328
+ text: string;
1329
+ } | undefined;
1330
+ id: string;
1331
+ name: string;
1332
+ shortDescription: {
1333
+ text: string;
1334
+ };
1335
+ }[];
1336
+ };
1337
+ };
1338
+ results: {
1339
+ ruleId: string;
1340
+ ruleIndex: number;
1341
+ level: "error" | "warning";
1342
+ message: {
1343
+ text: string;
1344
+ };
1345
+ locations: {
1346
+ physicalLocation: {
1347
+ region?: {
1348
+ startLine: number;
1349
+ snippet: {
1350
+ text: string;
1351
+ };
1352
+ } | undefined;
1353
+ artifactLocation: {
1354
+ uri: string;
1355
+ };
1356
+ };
1357
+ }[];
1358
+ partialFingerprints: {
1359
+ "craftFinding/v1": string;
1360
+ };
1361
+ }[];
1362
+ }[];
1363
+ };
1364
+
1365
+ /**
1366
+ * The `--json` contract. Every JSON document a craft command prints carries
1367
+ * `schemaVersion`, so a script reading it can refuse a shape it does not
1368
+ * know instead of misreading it. Bump it when a field is removed or changes
1369
+ * meaning; adding a field is not a bump.
1370
+ */
1371
+ declare const JSON_SCHEMA_VERSION = 1;
1372
+ /** A command's JSON output, versioned. */
1373
+ declare function toJson(data: object): string;
1374
+
1150
1375
  /**
1151
1376
  * The rendered detection path for tells that can be seen on a live page.
1152
1377
  *
@@ -1779,4 +2004,4 @@ declare function characterReport(input: CharacterInputs, copyTells?: Set<string>
1779
2004
 
1780
2005
  declare function retrofitPlan(report: CharacterReport, direction?: ArtDirection | null): string;
1781
2006
 
1782
- export { AI_PHRASES, AI_VIOLET, AI_WORDS, type AccentFork, type AccentForkOptions, type Action, type Area, type ArtDirection, BUZZWORDS, CATALOGUE, CATALOGUE_VERSION, CHOICE_KEYS, type CandidateKind, type CharacterInputs, type CharacterReport, type CheckOptions, type CheckReport, type CheckRestraintInput, type ChoiceKey, type ContrastCheck, type ContrastReport, type CopyTell, type CraftTokensInput, type CraftTokensResult, DENSITIES, DENSITY_NAMES, DIRECTION_VERSION, DISTANCE_WEIGHTS, DURATION_MS, DURATION_S, type DensityCssOptions, type DensityName, type DirectionChoice, type DirectionProblem, type DirectionReport, type DirectionSource, type DurationName, EASE, EASE_TUPLE, ESTATE_VERSION, EXIT_RATIO, type EaseName, type EmitCssOptions, type EstateMatch, type EstatePair, type EstateRegister, type EstateSite, FINGERPRINT_VERSION, type Fact, type FactComparison, type FactKind, type Finding, type Fingerprint, type FingerprintDistance, type FluidSpaceOptions, type FluidTypeOptions, type FluidTypeResult, type FontClass, type Gamut, type Generation, HOUSE, HOUSE_BUDGET, HOUSE_TYPE, type HarvestCandidate, type HarvestOptions, type Hit, type HouseRule, type HouseTier, LIGHTNESS_CURVE, MIN_DECIDED, MIN_RUNS, type MotionDecision, type MotionKind, NEGATIVE_REASSURANCE, NULL_VERSION, type NullModel, type NullRun, type Oklch, type OklchToHexOptions, PILL_LIMIT, PLAINER_WORDS, PROPOSED, type PaletteColour, type Proposal, type ProposeInput, RAMP_STEPS, REFLEX_FONTS_1, REFLEX_FONTS_2, RENDERED_PATHS, REVEAL_LIMIT, REVIEW_PHRASES, type Ramp, type RampFromAnchorsOptions, type RampOptions, type RampStep, type RestraintBudget, type RestraintReport, type RestraintSeverity, type RestraintViolation, type Rgb, SCALE, SHADCN_LIMIT, SHADCN_PRIMITIVES, SIBLING_AT, SNAPSHOT_VERSION, SOURCE_KINDS, SPACE_STEPS, SPRING, STOCK_PHRASES, type SectionKind, type SectionRhythmOptions, type SemanticInput, type SemanticResult, type Severity, type ShouldAnimateInput, type SignalResult, type Snapshot, type SnapshotColour, type SnapshotControl, type SnapshotEffects, type SnapshotFont, type SnapshotGradient, type SnapshotHeading, type SnapshotMotion, type SnapshotPatch, type SnapshotSection, type SourceFile, type SourceKind, type SourceTell, type SpaceStep, type Surface, TELL_HEAVY, TYPE_STEPS, TYPICAL_AT, type TailwindPreset, type Tell, type TellException, type TypeStep, type Typicality, VAGUE_WORDS, type ValidateContext, type Verdict, accentFork, addSite, apcaContrast, applyHouseGate, auditSnapshot, catalogueTable, characterReport, checkCopy, checkPair, checkRestraint, choicesOf, compareFacts, compareToEstate, craftTokens, deltaEOk, deltaEOkHex, densityCss, densityTokens, emitCss, emptyEstate, estatePairs, exitDuration, extractHtml, findColours, fingerprint, fingerprintDistance, fluidClamp, fluidSpace, fluidType, fontClass, formatComparison, formatHex, formatReport, groundName, harvest, hexToOklch, houseRule, hueName, hueSwatch, inP3Gamut, inSrgbGamut, initDirection, isAiViolet, isCream, makeSnapshot, motionTokens, nearest, normaliseFamily, nullPrompt, oklchToHex, oklchToRgb, paletteFromPixels, parseColour, parseHex, propose, protectedFacts, ramp, rampFromAnchors, retrofitPlan, runTell, scanSource, sectionRhythm, semantic, shapeName, sharedParts, shouldAnimate, siblingLine, tailwindV3Preset, tailwindV4Theme, tellById, toGamut, typeFeatureTokens, typicality, validateDirection, visibleText, wcagContrast, wordListsJson };
2007
+ export { AI_PHRASES, AI_VIOLET, AI_WORDS, type AccentFork, type AccentForkOptions, type Action, type Area, type ArtDirection, BASELINE_VERSION, BUZZWORDS, type Baseline, type BaselineEntry, CATALOGUE, CATALOGUE_VERSION, CHOICE_KEYS, type CandidateKind, type CharacterInputs, type CharacterReport, type CheckOptions, type CheckReport, type CheckRestraintInput, type ChoiceKey, type Claim, type ClaimsReport, type ContrastCheck, type ContrastReport, type CopyTell, type CraftConfig, type CraftTokensInput, type CraftTokensResult, DEFAULT_IGNORE, DENSITIES, DENSITY_NAMES, DIRECTION_VERSION, DISTANCE_WEIGHTS, DURATION_MS, DURATION_S, type DensityCssOptions, type DensityName, type DirectionChoice, type DirectionProblem, type DirectionReport, type DirectionSource, type DurationName, EASE, EASE_TUPLE, ESTATE_VERSION, EXIT_RATIO, type EaseName, type EmitCssOptions, type EstateMatch, type EstatePair, type EstateRegister, type EstateSite, FINGERPRINT_VERSION, type Fact, type FactComparison, type FactKind, type Finding, type Fingerprint, type FingerprintDistance, type FluidSpaceOptions, type FluidTypeOptions, type FluidTypeResult, type FontClass, type Gamut, type Generation, HOUSE, HOUSE_BUDGET, HOUSE_TYPE, type HarvestCandidate, type HarvestOptions, type Hit, type HouseRule, type HouseTier, JSON_SCHEMA_VERSION, LIGHTNESS_CURVE, MIN_DECIDED, MIN_RUNS, type MotionDecision, type MotionKind, NEGATIVE_REASSURANCE, NULL_VERSION, type NullModel, type NullRun, type Oklch, type OklchToHexOptions, PILL_LIMIT, PLAINER_WORDS, PROPOSED, type PaletteColour, type Proposal, type ProposeInput, RAMP_STEPS, REFLEX_FONTS_1, REFLEX_FONTS_2, RENDERED_PATHS, REVEAL_LIMIT, REVIEW_PHRASES, type Ramp, type RampFromAnchorsOptions, type RampOptions, type RampStep, type RestraintBudget, type RestraintReport, type RestraintSeverity, type RestraintViolation, type Rgb, SCALE, SHADCN_LIMIT, SHADCN_PRIMITIVES, SIBLING_AT, SNAPSHOT_VERSION, SOURCE_KINDS, SPACE_STEPS, SPRING, STOCK_PHRASES, type SarifOptions, type SarifTell, type SectionKind, type SectionRhythmOptions, type SemanticInput, type SemanticResult, type Severity, type SeverityLevel, type SeverityOverride, type ShouldAnimateInput, type SignalResult, type Snapshot, type SnapshotColour, type SnapshotControl, type SnapshotEffects, type SnapshotFont, type SnapshotGradient, type SnapshotHeading, type SnapshotMotion, type SnapshotPatch, type SnapshotSection, type SourceFile, type SourceKind, type SourceTell, type SpaceStep, type Surface, TELL_HEAVY, TYPE_STEPS, TYPICAL_AT, type TailwindPreset, type Tell, type TellException, type TypeStep, type Typicality, VAGUE_WORDS, type ValidateContext, type Verdict, accentFork, addSite, apcaContrast, applyBaseline, applyHouseGate, applySeverity, auditSnapshot, catalogueTable, characterReport, checkCopy, checkPair, checkRestraint, choicesOf, compareFacts, compareToEstate, craftTokens, createBaseline, deltaEOk, deltaEOkHex, densityCss, densityTokens, emitCss, emptyEstate, estatePairs, exitDuration, extractHtml, findClaims, findColours, findingKey, fingerprint, fingerprintDistance, fluidClamp, fluidSpace, fluidType, fontClass, formatClaims, formatComparison, formatHex, formatReport, globToRegExp, groundName, harvest, hexToOklch, houseRule, hueName, hueSwatch, ignoreMatcher, inP3Gamut, inSrgbGamut, initDirection, isAiViolet, isCream, makeSnapshot, motionTokens, namedSources, nearest, normaliseFamily, nullPrompt, oklchToHex, oklchToRgb, paletteFromPixels, parseBaseline, parseColour, parseCraftConfig, parseHex, propose, protectedFacts, ramp, rampFromAnchors, retrofitPlan, runTell, scanSource, sectionRhythm, semantic, severityExceptions, shapeName, sharedParts, shouldAnimate, siblingLine, tailwindV3Preset, tailwindV4Theme, tellById, toGamut, toJson, toSarif, typeFeatureTokens, typicality, validateDirection, visibleText, wcagContrast, wordListsJson };