@ariada-org/multi-domain
v0.1.1
Published
Single-jurisdiction accessibility-scan reference implementation plus extension API for community-authored jurisdiction rule packs. Open source under EUPL-1.2.
Downloads
57
Maintainers
Readme
@ariada-org/multi-domain
Single-jurisdiction accessibility-scan reference orchestrator plus a
JurisdictionPlugin extension contract for community-authored rule
packs.
Open source under EUPL-1.2.
What this package does
This package publishes three things:
- A canonical
ScanEventdata contract that downstream accessibility-compliance tooling consumes. - A
JurisdictionPluginextension interface that community implementers use to register additional accessibility jurisdictions (for example Canada AODA, Japan JIS X 8341-3). - A reference orchestrator that dispatches one scan against exactly
one registered jurisdiction plugin and emits a
ScanEvent.
The reference orchestrator is enough to exercise the contract end-to-end, validate a community-authored plugin, and serve as a working example for downstream tools.
What this package does NOT do
The reference orchestrator deliberately runs one jurisdiction at a time. The package does not implement:
- multi-jurisdiction execution in a single pass;
- cross-jurisdiction conflict detection or resolution;
- consensus / normalisation heuristics across multiple jurisdictions;
- production rule packs (those live in sibling packages such as
@ariada-org/wcag-rules-extended).
Community implementers may build their own multi-jurisdiction
orchestrator on top of the JurisdictionPlugin contract published
here.
Install
npm install @ariada-org/multi-domainQuick start
import {
JurisdictionRegistry,
SingleJurisdictionOrchestrator,
sePlugin,
} from '@ariada-org/multi-domain';
const registry = new JurisdictionRegistry();
registry.register(sePlugin);
const orchestrator = new SingleJurisdictionOrchestrator({
registry,
scannerVersion: '0.1.0',
ruleEngineVersion: '0.1.0',
deps: {
captureSnapshot: async () => ({
domHash: 'a'.repeat(64),
axTreeHash: 'b'.repeat(64),
cssomHash: 'c'.repeat(64),
screenshotRefs: [],
viewports: [{ label: 'desktop', width: 1280, height: 800 }],
}),
evaluateRules: async () => [],
newId: () => '01HXYZSCANID0000000000000A',
now: () => new Date(),
},
});
const event = await orchestrator.scan({
url: 'https://example.se',
jurisdictions: ['SE'],
});
console.log(event.perJurisdiction['SE']);API
| Export | Type | Description |
| ----------------------------------- | --------- | -------------------------------------------------------------------------- |
| SingleJurisdictionOrchestrator | class | Runs one scan against one registered plugin and emits a ScanEvent. |
| JurisdictionRegistry | class | In-memory plugin registry with idempotent registration semantics. |
| validatePluginShape | function | Validates the structure of a JurisdictionPlugin value. |
| matchJurisdictionFromHints | function | Pure helper that maps URL / <meta> / <html lang> hints to a plugin. |
| computePassRate | function | Pure helper that computes success-criterion pass rate from findings. |
| sePlugin, dePlugin, euEaaPlugin | constants | Minimal reference plugins for Sweden, Germany, and the EU EAA umbrella. |
Type-only exports (ScanEvent, Finding, JurisdictionSubset, etc.)
are also published for downstream consumers.
Writing a plugin
Copy one of the reference plugins as a starting point:
import type { JurisdictionPlugin } from '@ariada-org/multi-domain';
export const myPlugin: JurisdictionPlugin = {
jurisdictionCode: 'XX',
jurisdictionLabel: 'Country X',
governingRegulation: 'Statute citation',
technicalStandard: 'EN 301 549 v3.2.1 + WCAG 2.2 Level AA',
supervisoryAuthority: 'Authority name',
tldHints: ['xx'],
metaHints: [],
langAttrHints: ['xx'],
rulePackId: '@ariada-org/wcag-rules-extended',
rulePackVersion: '0.1.0',
emitJurisdictionSubset(ctx) {
/* … */
},
};Register it against a JurisdictionRegistry instance:
registry.register(myPlugin);