@diegovelasquezweb/a11y-engine 0.8.5 → 0.9.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/README.md CHANGED
@@ -15,7 +15,7 @@ Accessibility automation engine for web applications. It orchestrates multi engi
15
15
  | **AI enrichment** | Optional Claude-powered analysis that adds contextual fix suggestions based on detected stack, repo structure, and finding patterns |
16
16
  | **Report generation** | Produces HTML dashboard, PDF compliance report, manual testing checklist, and Markdown remediation guide |
17
17
  | **Source code scanning** | Static regex analysis of project source for accessibility patterns that runtime engines cannot detect. Works with local paths or remote GitHub repos |
18
- | **Knowledge API** | Exposes WCAG conformance levels, severity definitions, persona profiles, glossary, scanner help, and documentation so frontends and agents can render guidance from engine-owned data |
18
+ | **Knowledge API** | Exposes WCAG conformance levels, severity definitions, persona profiles, glossary, scanner help, and documentation |
19
19
 
20
20
  ## Installation
21
21
 
@@ -41,12 +41,6 @@ import {
41
41
  getChecklist,
42
42
  getRemediationGuide,
43
43
  getSourcePatterns,
44
- getScannerHelp,
45
- getPersonaReference,
46
- getUiHelp,
47
- getConformanceLevels,
48
- getWcagPrinciples,
49
- getSeverityLevels,
50
44
  getKnowledge,
51
45
  } from "@diegovelasquezweb/a11y-engine";
52
46
  ```
@@ -122,19 +116,21 @@ These functions render final artifacts from scan payload data.
122
116
 
123
117
  ### Knowledge API
124
118
 
125
- These functions expose scanner help content, persona explanations, conformance levels, and UI copy so frontends or agents can render guidance from engine-owned data.
119
+ Returns all accessibility knowledge in a single call: scanner help, persona profiles, concepts, glossary, documentation, conformance levels, WCAG principles, and severity definitions.
126
120
 
127
- | Function | Returns | Description |
128
- | :--- | :--- | :--- |
129
- | `getScannerHelp(options?)` | `{ locale, version, title, engines, options }` | Scanner option and engine help metadata |
130
- | `getPersonaReference(options?)` | `{ locale, version, personas }` | Persona labels, descriptions, and mapping hints |
131
- | `getUiHelp(options?)` | `{ locale, version, concepts, glossary }` | Shared concept definitions and glossary entries |
132
- | `getConformanceLevels(options?)` | `{ locale, version, conformanceLevels }` | WCAG conformance level definitions with axe tag mappings |
133
- | `getWcagPrinciples(options?)` | `{ locale, version, wcagPrinciples }` | The four WCAG principles with criterion prefix patterns |
134
- | `getSeverityLevels(options?)` | `{ locale, version, severityLevels }` | Severity level definitions with labels and ordering |
135
- | `getKnowledge(options?)` | Full knowledge pack | Combines all knowledge APIs into a single response for UI or agent flows |
136
-
137
- See [API Reference](docs/api-reference.md) for exact options and return types.
121
+ ```ts
122
+ const knowledge = getKnowledge({ locale: "en" });
123
+ // knowledge.scanner → engine and option descriptions
124
+ // knowledge.personas persona labels and descriptions
125
+ // knowledge.concepts concept definitions
126
+ // knowledge.glossary → accessibility glossary
127
+ // knowledge.docs → documentation articles
128
+ // knowledge.conformanceLevels A/AA/AAA with axe tag mappings
129
+ // knowledge.wcagPrinciples → the four WCAG principles
130
+ // knowledge.severityLevels → Critical/Serious/Moderate/Minor definitions
131
+ ```
132
+
133
+ See [API Reference](docs/api-reference.md) for the full `EngineKnowledge` shape.
138
134
 
139
135
  ## CLI
140
136
 
@@ -353,95 +353,28 @@ Returns: `Promise<SourcePatternResult>`
353
353
 
354
354
  ## Knowledge API
355
355
 
356
- These functions expose engine-owned content for UIs and agents to render. All accept an optional `{ locale?: string }` option (default: `"en"`).
357
-
358
356
  ### `getKnowledge(options?)`
359
357
 
360
- Returns the full knowledge pack combines all knowledge functions into one call. Useful for pre-loading UI help content.
358
+ Returns all accessibility knowledge in a single call. Accepts an optional `{ locale?: string }` option (default: `"en"`).
361
359
 
362
360
  ```ts
363
361
  import { getKnowledge } from "@diegovelasquezweb/a11y-engine";
364
362
 
365
363
  const knowledge = getKnowledge({ locale: "en" });
366
-
367
- // knowledge.scanner → scan options help and engine descriptions
368
- // knowledge.personas → persona labels, icons, descriptions
369
- // knowledge.concepts → UI concept definitions
370
- // knowledge.glossary → accessibility glossary
371
- // knowledge.conformanceLevels → WCAG A/AA/AAA definitions with axe tags
372
- // knowledge.wcagPrinciples → the 4 WCAG principles
373
- // knowledge.severityLevels → Critical/Serious/Moderate/Minor definitions
374
- ```
375
-
376
- Returns: `EngineKnowledge`
377
-
378
- ---
379
-
380
- ### `getScannerHelp(options?)`
381
-
382
- Returns scan option descriptions, allowed values, and engine metadata — used to render Advanced Settings UI.
383
-
384
- ```ts
385
- const help = getScannerHelp();
386
- // help.engines → [{ id: "axe", label: "axe-core", description: "..." }, ...]
387
- // help.options → [{ id: "maxRoutes", label: "Max Routes", type: "number", ... }, ...]
388
- ```
389
-
390
- ---
391
-
392
- ### `getPersonaReference(options?)`
393
-
394
- Returns persona labels, descriptions, and disability group definitions.
395
-
396
- ```ts
397
- const ref = getPersonaReference();
398
- // ref.personas → [{ id: "screenReader", label: "Screen Readers", icon: "...", description: "..." }, ...]
399
- ```
400
-
401
- ---
402
-
403
- ### `getUiHelp(options?)`
404
-
405
- Returns shared concept definitions and a glossary of accessibility terms.
406
-
407
- ```ts
408
- const ui = getUiHelp();
409
- // ui.concepts → { wcag: "...", aria: "...", ... }
410
- // ui.glossary → [{ term: "ARIA", definition: "..." }, ...]
411
- ```
412
-
413
- ---
414
-
415
- ### `getConformanceLevels(options?)`
416
-
417
- Returns WCAG conformance level definitions with their corresponding axe-core tag sets.
418
-
419
- ```ts
420
- const { conformanceLevels } = getConformanceLevels();
421
- // conformanceLevels[0] → { id: "AA", label: "WCAG 2.2 AA", axeTags: ["wcag2a", "wcag2aa", ...] }
422
- ```
423
-
424
- ---
425
-
426
- ### `getWcagPrinciples(options?)`
427
-
428
- Returns the four WCAG principles (Perceivable, Operable, Understandable, Robust) with criterion prefix patterns.
429
-
430
- ```ts
431
- const { wcagPrinciples } = getWcagPrinciples();
432
- // wcagPrinciples[0] → { id: "perceivable", label: "Perceivable", prefix: "1.", description: "..." }
433
364
  ```
434
365
 
435
- ---
436
-
437
- ### `getSeverityLevels(options?)`
438
-
439
- Returns severity level definitions with labels, descriptions, and ordering.
440
-
441
- ```ts
442
- const { severityLevels } = getSeverityLevels();
443
- // severityLevels[0] { id: "Critical", label: "Critical", order: 0, description: "..." }
444
- ```
366
+ **Returns:** `EngineKnowledge`
367
+
368
+ | Field | Type | Description |
369
+ | :--- | :--- | :--- |
370
+ | `scanner` | `{ title, engines, options }` | Scan option descriptions, allowed values, and engine metadata |
371
+ | `personas` | `PersonaReferenceItem[]` | Persona labels, icons, descriptions, and mapped rules |
372
+ | `concepts` | `Record<string, ConceptEntry>` | Concept definitions with title, body, and context |
373
+ | `glossary` | `GlossaryEntry[]` | Accessibility term definitions |
374
+ | `docs` | `KnowledgeDocs` | Documentation articles organized by section and group |
375
+ | `conformanceLevels` | `ConformanceLevel[]` | WCAG A/AA/AAA definitions with axe-core tag mappings |
376
+ | `wcagPrinciples` | `WcagPrinciple[]` | The four WCAG principles with criterion prefix patterns |
377
+ | `severityLevels` | `SeverityLevel[]` | Critical/Serious/Moderate/Minor definitions with ordering |
445
378
 
446
379
  ---
447
380
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diegovelasquezweb/a11y-engine",
3
- "version": "0.8.5",
3
+ "version": "0.9.0",
4
4
  "description": "WCAG 2.2 accessibility audit engine — scanner, analyzer, and report builders",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/index.d.mts CHANGED
@@ -449,18 +449,6 @@ export function getSourcePatterns(
449
449
  options?: SourcePatternOptions
450
450
  ): Promise<SourcePatternResult>;
451
451
 
452
- export function getScannerHelp(options?: KnowledgeOptions): ScannerHelp;
453
-
454
- export function getPersonaReference(options?: KnowledgeOptions): PersonaReference;
455
-
456
- export function getUiHelp(options?: KnowledgeOptions): UiHelp;
457
-
458
- export function getConformanceLevels(options?: KnowledgeOptions): ConformanceLevelsResult;
459
-
460
- export function getWcagPrinciples(options?: KnowledgeOptions): WcagPrinciplesResult;
461
-
462
- export function getSeverityLevels(options?: KnowledgeOptions): SeverityLevelsResult;
463
-
464
452
  export function getKnowledge(options?: KnowledgeOptions): EngineKnowledge;
465
453
 
466
454
  export const DEFAULT_AI_SYSTEM_PROMPT: string;
package/src/index.mjs CHANGED
@@ -434,7 +434,7 @@ export function getOverview(findings, payload = null) {
434
434
  * @param {{ locale?: string }} [options={}]
435
435
  * @returns {{ locale: string, version: string, title: string, engines: object[], options: object[] }}
436
436
  */
437
- export function getScannerHelp(options = {}) {
437
+ function getScannerHelp(options = {}) {
438
438
  const locale = resolveKnowledgeLocale(options.locale || "en");
439
439
  const payload = getKnowledgeData();
440
440
  const scanner = payload.locales[locale]?.scanner || { title: "Scanner Help", engines: [], options: [] };
@@ -455,7 +455,7 @@ export function getScannerHelp(options = {}) {
455
455
  * @param {{ locale?: string }} [options={}]
456
456
  * @returns {{ locale: string, version: string, personas: object[] }}
457
457
  */
458
- export function getPersonaReference(options = {}) {
458
+ function getPersonaReference(options = {}) {
459
459
  const locale = resolveKnowledgeLocale(options.locale || "en");
460
460
  const payload = getKnowledgeData();
461
461
  const wcagRef = getWcagReference();
@@ -492,7 +492,7 @@ export function getPersonaReference(options = {}) {
492
492
  * @param {{ locale?: string }} [options={}]
493
493
  * @returns {{ locale: string, version: string, tooltips: Record<string, object>, glossary: object[] }}
494
494
  */
495
- export function getUiHelp(options = {}) {
495
+ function getConceptsAndGlossary(options = {}) {
496
496
  const locale = resolveKnowledgeLocale(options.locale || "en");
497
497
  const payload = getKnowledgeData();
498
498
  const localePayload = payload.locales[locale] || {};
@@ -518,7 +518,7 @@ export function getUiHelp(options = {}) {
518
518
  * @param {{ locale?: string }} [options={}]
519
519
  * @returns {{ locale: string, version: string, conformanceLevels: object[] }}
520
520
  */
521
- export function getConformanceLevels(options = {}) {
521
+ function getConformanceLevels(options = {}) {
522
522
  const locale = resolveKnowledgeLocale(options.locale || "en");
523
523
  const payload = getKnowledgeData();
524
524
  const levels = payload.locales[locale]?.conformanceLevels || [];
@@ -535,7 +535,7 @@ export function getConformanceLevels(options = {}) {
535
535
  * @param {{ locale?: string }} [options={}]
536
536
  * @returns {{ locale: string, version: string, wcagPrinciples: object[] }}
537
537
  */
538
- export function getWcagPrinciples(options = {}) {
538
+ function getWcagPrinciples(options = {}) {
539
539
  const locale = resolveKnowledgeLocale(options.locale || "en");
540
540
  const payload = getKnowledgeData();
541
541
  const principles = payload.locales[locale]?.wcagPrinciples || [];
@@ -552,7 +552,7 @@ export function getWcagPrinciples(options = {}) {
552
552
  * @param {{ locale?: string }} [options={}]
553
553
  * @returns {{ locale: string, version: string, severityLevels: object[] }}
554
554
  */
555
- export function getSeverityLevels(options = {}) {
555
+ function getSeverityLevels(options = {}) {
556
556
  const locale = resolveKnowledgeLocale(options.locale || "en");
557
557
  const payload = getKnowledgeData();
558
558
  const levels = payload.locales[locale]?.severityLevels || [];
@@ -573,7 +573,7 @@ export const VIEWPORT_PRESETS = [
573
573
  export function getKnowledge(options = {}) {
574
574
  const scanner = getScannerHelp(options);
575
575
  const personas = getPersonaReference(options);
576
- const ui = getUiHelp(options);
576
+ const ui = getConceptsAndGlossary(options);
577
577
  const conformance = getConformanceLevels(options);
578
578
  const principles = getWcagPrinciples(options);
579
579
  const severity = getSeverityLevels(options);