@ariada-org/core
v0.1.1
Published
Backwards-compat shim — re-exports @ariada-org/core-engine + @ariada-org/core-playwright. New code should import the engine and an adapter directly.
Readme
@ariada-org/core
Multi-domain single-pass web-accessibility scanner. Patent J anchor (IC1 single-pass, IC2 plugin, IC3 element iteration, IC5 cross-domain). Drives element-by-element scan streams that downstream visualisers (draculascan) consume via SSE.
Install
pnpm add @ariada-org/core @ariada-org/rules-axe playwright
pnpm exec playwright install chromiumQuickstart (programmatic)
import { scan } from '@ariada-org/core';
const { report } = await scan('https://example.com');
console.log(report.findings, report.stats);Element-iteration mode (Dracula / SSE consumers)
import { scan, createEventEmitter } from '@ariada-org/core';
const emitter = createEventEmitter();
emitter.on((ev) => console.log(ev.kind, ev));
const { report } = await scan('https://example.com', {
elementIter: true,
emitter,
});The emitter emits scan_started → N × element_scan → scan_complete (or scan_error).
The ScanEvent shape is locked — see src/events.ts and product/plans/2026-04-19-draculascan-build-prompt.md §5.
Public API
| Export | Purpose |
|--------------------------|-------------------------------------------------------------------|
| scan(url, opts) | One-shot scan; returns ScanResult { report, events? } |
| createScanner(opts) | Reusable scanner bound to a set of analyzers |
| createRegistry() | Analyzer plugin registry ({ register, get, all }) |
| registerAnalyzer(a) | Register an analyzer on the module-default registry |
| createEventEmitter() | ScanEventEmitter factory (required for elementIter: true) |
| scoreFromCounts(c) | Pure helper — locked scoring formula |
| fingerprint({ruleId,selector}) | Stable short hash (stub; TODO full murmurhash3) |
| ScanEvent | Locked event union consumed by SSE downstreams |
| DomainAnalyzer | Plugin interface |
| UnifiedSnapshot, UnifiedReport, Finding, ConflictFinding | Core types |
Options
interface ScanOptions {
domains?: Domain[]; // default ['a11y']
ai?: 'off' | 'opt-in' | 'full'; // default 'off' (P1 only)
elementIter?: boolean; // default false
emitter?: ScanEventEmitter; // required when elementIter=true
timeoutMs?: number; // per-URL default 30000
playwright?: { browser?: 'chromium' | 'firefox' | 'webkit'; headless?: boolean };
analyzers?: DomainAnalyzer[]; // default: bundled a11y
logger?: pino.Logger;
}Patent bindings
scanner.ts,snapshot.ts→ Patent J IC1, IC3cross-domain.ts→ Patent J IC5element-iter.ts→ Patent J IC3 + Patent K IC1registry.ts→ Patent H IC1fingerprint.ts→ Patent B Cl.1d (stub — TODO(H))
Licence
Apache-2.0. See repository LICENSE + this package NOTICE for patent notice.
Update
- Author: Alekszandr Bricskin (Agonist Development AB)
- Date: 2026-04-19
