@webability/core 1.10.0 → 1.12.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
@@ -1,5 +1,5 @@
1
- import { P as PageLike, S as ScanOptions, a as ScanResult, W as WcagLevel, b as SiteTheme, F as FixDetector, I as InternalBug, D as DetectedIssue, c as ScanIssue } from './types-fjs6XhzQ.cjs';
2
- export { B as BrowserDetector, d as DEFAULT_JUDGE_BASE_URL, e as DEFAULT_JUDGE_TEXT_MODEL, f as DEFAULT_JUDGE_VISION_MODEL, g as FixIssueType, h as IssueImpact, i as IssueSource, J as JUDGE_DEFAULT_TIMEOUT_MS, j as JUDGE_SYSTEM_PROMPT, k as JudgeChatBody, l as JudgeItem, m as JudgeOptions, n as JudgeRequest, o as JudgeTransport, p as JudgeVerdict, q as JudgedEntry, V as VIEWPORT_SIZES, r as ViewportPreset, s as WCAG_BY_ISSUE, t as buildJudgeChatBody, u as hostedJudgeTransport, v as judgeUndecided, w as openAiCompatibleTransport, x as resetJudgeCache } from './types-fjs6XhzQ.cjs';
1
+ import { P as PageLike, S as ScanOptions, a as ScanResult, W as WcagLevel, b as SiteTheme, F as FixDetector, I as InternalBug, D as DetectedIssue, c as ScanIssue } from './types-gjAJ8j0I.cjs';
2
+ export { B as BrowserDetector, d as DEFAULT_JUDGE_BASE_URL, e as DEFAULT_JUDGE_TEXT_MODEL, f as DEFAULT_JUDGE_VISION_MODEL, g as FixIssueType, h as IssueImpact, i as IssueSource, J as JUDGE_DEFAULT_TIMEOUT_MS, j as JUDGE_SYSTEM_PROMPT, k as JudgeChatBody, l as JudgeItem, m as JudgeOptions, n as JudgeRequest, o as JudgeTransport, p as JudgeVerdict, q as JudgedEntry, V as VIEWPORT_SIZES, r as ViewportPreset, s as WCAG_BY_ISSUE, t as buildJudgeChatBody, u as hostedJudgeTransport, v as judgeUndecided, w as openAiCompatibleTransport, x as resetJudgeCache } from './types-gjAJ8j0I.cjs';
3
3
 
4
4
  declare function scan(target: string | PageLike, options?: ScanOptions): Promise<ScanResult>;
5
5
 
@@ -10,26 +10,29 @@ declare function scan(target: string | PageLike, options?: ScanOptions): Promise
10
10
  */
11
11
 
12
12
  /**
13
- * Conformance level of every WCAG 2.2 success criterion (plus the obsolete
14
- * 4.1.1, still reported by older engines). The ONE level table in core: the
15
- * default AA scan drops findings whose criteria are all AAA, so a missing or
16
- * wrong row here leaks AAA into AA reports — the set is pinned by a test.
13
+ * Conformance level of every WCAG 2.2 success criterion. The ONE level table
14
+ * in core, and it is strict: a criterion missing from it (4.1.1 Parsing,
15
+ * removed in WCAG 2.2, or a typo) has no level, and a finding that names only
16
+ * such criteria is dropped from every report instead of being read as AA.
17
+ * The set is pinned by a test.
17
18
  */
18
19
  declare const WCAG_LEVEL_MAP: Record<string, WcagLevel>;
19
- declare function getWcagLevel(criterion: string): WcagLevel;
20
+ declare function getWcagLevel(criterion: string): WcagLevel | undefined;
20
21
  /**
21
22
  * The conformance level an issue belongs to: the LOWEST level among the
22
23
  * criteria it names ("2.4.4,2.4.9" is an A finding), or the engine's own
23
- * level when it names none.
24
+ * level when it names none. Criteria outside WCAG 2.2 are skipped; an issue
25
+ * that names only such criteria has no level (undefined).
24
26
  */
25
27
  declare function issueLevel(issue: {
26
28
  wcag?: string;
27
29
  level?: WcagLevel;
28
- }): WcagLevel;
30
+ }): WcagLevel | undefined;
29
31
  /**
30
32
  * Keep findings at `level` and below. Default scans are AA: AAA criteria are
31
33
  * not reported at all (owner decision 2026-10-04 — not in issues[],
32
34
  * incomplete[] or the summary); a caller opts in with `level: 'AAA'`.
35
+ * Findings with no WCAG 2.2 level are never kept.
33
36
  */
34
37
  declare function withinLevel<T extends {
35
38
  wcag?: string;
@@ -59,6 +62,8 @@ interface RunDetectorsOptions {
59
62
  extraSerialDetectors?: FixDetector[];
60
63
  /** Out: invariant-P entries (state a detector left behind, unmarked injections). */
61
64
  internalBugs?: InternalBug[];
65
+ /** Also run EXPERIMENTAL_DETECTORS (best practice, not A/AA). Default false. */
66
+ experimental?: boolean;
62
67
  }
63
68
  declare function runDetectors(page: PageLike, outTruncated?: TruncationEntry[], outWarnings?: string[], options?: RunDetectorsOptions): Promise<DetectedIssue[]>;
64
69
  declare function extractSiteTheme(page: PageLike): Promise<SiteTheme>;
@@ -80,6 +85,8 @@ interface CoverageSources {
80
85
  detectorCriteria: () => readonly string[];
81
86
  /** Every rule id verify_fix accepts as `wcag` besides a criterion: axe ids + detector issue types. */
82
87
  ruleIds: () => readonly string[] | Promise<readonly string[]>;
88
+ /** The criteria a rule id can fail (axe tags, or WCAG_BY_ISSUE); [] when unknown. Optional for fakes. */
89
+ ruleCriteria?: (id: string) => readonly string[] | Promise<readonly string[]>;
83
90
  }
84
91
  /** Union of every engine's criteria. Throws if any registry cannot be read. */
85
92
  declare function coveredCriteria(sources?: CoverageSources): Promise<Set<string>>;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as PageLike, S as ScanOptions, a as ScanResult, W as WcagLevel, b as SiteTheme, F as FixDetector, I as InternalBug, D as DetectedIssue, c as ScanIssue } from './types-fjs6XhzQ.js';
2
- export { B as BrowserDetector, d as DEFAULT_JUDGE_BASE_URL, e as DEFAULT_JUDGE_TEXT_MODEL, f as DEFAULT_JUDGE_VISION_MODEL, g as FixIssueType, h as IssueImpact, i as IssueSource, J as JUDGE_DEFAULT_TIMEOUT_MS, j as JUDGE_SYSTEM_PROMPT, k as JudgeChatBody, l as JudgeItem, m as JudgeOptions, n as JudgeRequest, o as JudgeTransport, p as JudgeVerdict, q as JudgedEntry, V as VIEWPORT_SIZES, r as ViewportPreset, s as WCAG_BY_ISSUE, t as buildJudgeChatBody, u as hostedJudgeTransport, v as judgeUndecided, w as openAiCompatibleTransport, x as resetJudgeCache } from './types-fjs6XhzQ.js';
1
+ import { P as PageLike, S as ScanOptions, a as ScanResult, W as WcagLevel, b as SiteTheme, F as FixDetector, I as InternalBug, D as DetectedIssue, c as ScanIssue } from './types-gjAJ8j0I.js';
2
+ export { B as BrowserDetector, d as DEFAULT_JUDGE_BASE_URL, e as DEFAULT_JUDGE_TEXT_MODEL, f as DEFAULT_JUDGE_VISION_MODEL, g as FixIssueType, h as IssueImpact, i as IssueSource, J as JUDGE_DEFAULT_TIMEOUT_MS, j as JUDGE_SYSTEM_PROMPT, k as JudgeChatBody, l as JudgeItem, m as JudgeOptions, n as JudgeRequest, o as JudgeTransport, p as JudgeVerdict, q as JudgedEntry, V as VIEWPORT_SIZES, r as ViewportPreset, s as WCAG_BY_ISSUE, t as buildJudgeChatBody, u as hostedJudgeTransport, v as judgeUndecided, w as openAiCompatibleTransport, x as resetJudgeCache } from './types-gjAJ8j0I.js';
3
3
 
4
4
  declare function scan(target: string | PageLike, options?: ScanOptions): Promise<ScanResult>;
5
5
 
@@ -10,26 +10,29 @@ declare function scan(target: string | PageLike, options?: ScanOptions): Promise
10
10
  */
11
11
 
12
12
  /**
13
- * Conformance level of every WCAG 2.2 success criterion (plus the obsolete
14
- * 4.1.1, still reported by older engines). The ONE level table in core: the
15
- * default AA scan drops findings whose criteria are all AAA, so a missing or
16
- * wrong row here leaks AAA into AA reports — the set is pinned by a test.
13
+ * Conformance level of every WCAG 2.2 success criterion. The ONE level table
14
+ * in core, and it is strict: a criterion missing from it (4.1.1 Parsing,
15
+ * removed in WCAG 2.2, or a typo) has no level, and a finding that names only
16
+ * such criteria is dropped from every report instead of being read as AA.
17
+ * The set is pinned by a test.
17
18
  */
18
19
  declare const WCAG_LEVEL_MAP: Record<string, WcagLevel>;
19
- declare function getWcagLevel(criterion: string): WcagLevel;
20
+ declare function getWcagLevel(criterion: string): WcagLevel | undefined;
20
21
  /**
21
22
  * The conformance level an issue belongs to: the LOWEST level among the
22
23
  * criteria it names ("2.4.4,2.4.9" is an A finding), or the engine's own
23
- * level when it names none.
24
+ * level when it names none. Criteria outside WCAG 2.2 are skipped; an issue
25
+ * that names only such criteria has no level (undefined).
24
26
  */
25
27
  declare function issueLevel(issue: {
26
28
  wcag?: string;
27
29
  level?: WcagLevel;
28
- }): WcagLevel;
30
+ }): WcagLevel | undefined;
29
31
  /**
30
32
  * Keep findings at `level` and below. Default scans are AA: AAA criteria are
31
33
  * not reported at all (owner decision 2026-10-04 — not in issues[],
32
34
  * incomplete[] or the summary); a caller opts in with `level: 'AAA'`.
35
+ * Findings with no WCAG 2.2 level are never kept.
33
36
  */
34
37
  declare function withinLevel<T extends {
35
38
  wcag?: string;
@@ -59,6 +62,8 @@ interface RunDetectorsOptions {
59
62
  extraSerialDetectors?: FixDetector[];
60
63
  /** Out: invariant-P entries (state a detector left behind, unmarked injections). */
61
64
  internalBugs?: InternalBug[];
65
+ /** Also run EXPERIMENTAL_DETECTORS (best practice, not A/AA). Default false. */
66
+ experimental?: boolean;
62
67
  }
63
68
  declare function runDetectors(page: PageLike, outTruncated?: TruncationEntry[], outWarnings?: string[], options?: RunDetectorsOptions): Promise<DetectedIssue[]>;
64
69
  declare function extractSiteTheme(page: PageLike): Promise<SiteTheme>;
@@ -80,6 +85,8 @@ interface CoverageSources {
80
85
  detectorCriteria: () => readonly string[];
81
86
  /** Every rule id verify_fix accepts as `wcag` besides a criterion: axe ids + detector issue types. */
82
87
  ruleIds: () => readonly string[] | Promise<readonly string[]>;
88
+ /** The criteria a rule id can fail (axe tags, or WCAG_BY_ISSUE); [] when unknown. Optional for fakes. */
89
+ ruleCriteria?: (id: string) => readonly string[] | Promise<readonly string[]>;
83
90
  }
84
91
  /** Union of every engine's criteria. Throws if any registry cannot be read. */
85
92
  declare function coveredCriteria(sources?: CoverageSources): Promise<Set<string>>;