@goflag/cli 0.2.8 → 0.2.10

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.ts CHANGED
@@ -48,6 +48,16 @@ type TagOrigin = {
48
48
  kind: "computed";
49
49
  };
50
50
  type Severity = "error" | "warning" | "info";
51
+ /**
52
+ * How authoritative the requirement behind a finding is.
53
+ *
54
+ * Lives here rather than in the rule layer for the same reason `Issue` does:
55
+ * it crosses the engine → report → CLI `--json` boundary. An agent reading a
56
+ * report has to be able to tell a `spec-required` from a `heuristic` before it
57
+ * decides what to change, and a type that stopped at the rule registry could
58
+ * not tell it — `../rules/types` re-exports this one.
59
+ */
60
+ type Rigor = "spec-required" | "spec-recommended" | "vendor-spec" | "guideline" | "heuristic";
51
61
 
52
62
  /**
53
63
  * Hreflang reciprocity + matrix derivation (Phase 7.4 / 7.5).
@@ -289,6 +299,34 @@ interface ExtractionIcon {
289
299
  height: number;
290
300
  } | "any">;
291
301
  }
302
+ /** One entry of a Web App Manifest's `icons` member. */
303
+ interface ExtractionManifestIcon {
304
+ src: string;
305
+ sizes?: string;
306
+ type?: string;
307
+ purpose?: string;
308
+ /** Parsed `sizes` entries; empty for absent or unparseable values. */
309
+ parsedSizes: Array<{
310
+ width: number;
311
+ height: number;
312
+ } | "any">;
313
+ }
314
+ /**
315
+ * The `<link rel="manifest">`, and what the manifest said when goflag fetched
316
+ * it.
317
+ *
318
+ * `parsed` is deliberately three-valued. `undefined` means no probe ran — the
319
+ * manifest was never looked at — while `false` means it was fetched and could
320
+ * not be read. A rule must be able to tell those apart from a manifest that
321
+ * parsed and declares no icons, because only the last of the three is evidence
322
+ * about the site.
323
+ */
324
+ interface ExtractionManifest {
325
+ href: string;
326
+ parsed?: boolean;
327
+ /** Present only when `parsed` is true. */
328
+ icons?: ExtractionManifestIcon[];
329
+ }
292
330
  /** One feed advertisement (`rel="alternate"` with a feed content type). */
293
331
  interface ExtractionFeed {
294
332
  type: string;
@@ -303,9 +341,7 @@ interface ExtractionFeed {
303
341
  interface ExtractionLinks {
304
342
  hreflang: ExtractionHreflang[];
305
343
  icons: ExtractionIcon[];
306
- manifest?: {
307
- href: string;
308
- };
344
+ manifest?: ExtractionManifest;
309
345
  feeds: ExtractionFeed[];
310
346
  }
311
347
  /** One `<script type="application/ld+json">` block. */
@@ -320,6 +356,29 @@ interface ExtractionJsonLd {
320
356
  /** Verbatim script content — the evidence, especially on parse errors. */
321
357
  raw: string;
322
358
  }
359
+ /** One intrinsic size a file declares about itself. */
360
+ interface ExtractionAssetSize {
361
+ width: number;
362
+ height: number;
363
+ }
364
+ /**
365
+ * What was served at one asset URL the page declared.
366
+ *
367
+ * The rules stay pure functions of this model: the network happened in a
368
+ * dedicated pass (`docs/og-plan.md` D8) and its answers arrive here as data,
369
+ * exactly like the manifest's.
370
+ */
371
+ interface ExtractionAsset {
372
+ status: number;
373
+ /** 2xx *and* an image content type. */
374
+ ok: boolean;
375
+ contentType?: string;
376
+ /**
377
+ * Sizes decoded from the file's header — several for an ICO. Absent for a
378
+ * format goflag does not decode, which means *unknown*, never *none*.
379
+ */
380
+ sizes?: ExtractionAssetSize[];
381
+ }
323
382
  /**
324
383
  * The per-page observation. Everything a page rule (or an agent judging a
325
384
  * prose rule) may read; nothing else.
@@ -336,6 +395,13 @@ interface Extraction {
336
395
  twitter: ExtractionTwitter;
337
396
  links: ExtractionLinks;
338
397
  jsonLd: ExtractionJsonLd[];
398
+ /**
399
+ * What was served at each asset URL this page declared, keyed by resolved
400
+ * URL. **Absent when no probe pass ran** — a rule must read that as "not
401
+ * looked at" rather than "nothing there", the same three-valued care the
402
+ * manifest gets.
403
+ */
404
+ assets?: Record<string, ExtractionAsset>;
339
405
  }
340
406
 
341
407
  /**
@@ -368,8 +434,6 @@ interface Extraction {
368
434
  * findings into issues at that boundary.
369
435
  */
370
436
 
371
- /** How authoritative the requirement behind a rule is. */
372
- type Rigor = "spec-required" | "spec-recommended" | "vendor-spec" | "guideline" | "heuristic";
373
437
  /** A band a scored measurement can land in. */
374
438
  type Band = "ideal" | "acceptable" | "poor";
375
439
  /** Everything a rule declares about itself, before any evaluation. */
@@ -686,6 +750,13 @@ interface SiteIssue {
686
750
  why?: string;
687
751
  /** A copy-pasteable fix snippet, when the rule offers one. */
688
752
  fix?: string;
753
+ /**
754
+ * Same two fields as `SeoIssue`, and absent for a different reason: a
755
+ * `SiteRule` may simply not declare a rigor yet. Three of the four do not,
756
+ * and the catalogue reports that gap rather than inventing an authority.
757
+ */
758
+ rigor?: Rigor;
759
+ sources?: string[];
689
760
  }
690
761
  /** How the audit established which locales the site serves. */
691
762
  interface LocaleAxisReport {
@@ -718,6 +789,20 @@ interface SeoIssue {
718
789
  why?: string;
719
790
  /** A copy-pasteable fix snippet, when the rule offers one. */
720
791
  fix?: string;
792
+ /**
793
+ * How authoritative the requirement is, and the documents that back it.
794
+ *
795
+ * Carried on the finding because a report is read where the rule registry is
796
+ * not — a JSON file in CI, a PR comment, an agent's context. Without it a
797
+ * consumer cannot tell a `spec-required` from a `heuristic`, which is the one
798
+ * distinction the rigor axis exists to make.
799
+ */
800
+ rigor?: Rigor;
801
+ sources?: string[];
802
+ /** What the page actually said, as the rule saw it. */
803
+ observed?: unknown;
804
+ /** One sentence stating what a passing page looks like. */
805
+ expected?: string;
721
806
  }
722
807
  /**
723
808
  * One prose rule's evidence bundle, attributed to a page. The `id` is a
@@ -1048,6 +1133,12 @@ interface RollupLink {
1048
1133
  interface RollupSeo {
1049
1134
  ruleId: string;
1050
1135
  severity: Severity;
1136
+ /**
1137
+ * How authoritative the rule is. Constant within a group — a rollup is one
1138
+ * rule — which is what makes the summary the right place to show it: one tag
1139
+ * per line instead of one per finding.
1140
+ */
1141
+ rigor?: Rigor;
1051
1142
  why?: string;
1052
1143
  fix?: string;
1053
1144
  /** A representative message (from the first occurrence). */
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  runAudit,
12
12
  summarize,
13
13
  targetKey
14
- } from "./chunk-SKX7UCGC.js";
14
+ } from "./chunk-DKGBLJ4H.js";
15
15
  export {
16
16
  Logger,
17
17
  SAMPLE_LIMIT,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goflag/cli",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "type": "module",
5
5
  "description": "Audits a site for broken links, missing translation pages, a robots.txt that contradicts your pages, and missing or misconfigured SEO metadata. JSON-first.",
6
6
  "keywords": [