@kinti/a11y-toolkit 5.22.0 → 5.22.1
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/bin/a11y-toolkit-mcp.cjs +2 -2
- package/bin/a11y-toolkit.cjs +2 -2
- package/lib/runner.cjs +30 -22
- package/package.json +1 -1
package/bin/a11y-toolkit-mcp.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/* MCP server launcher
|
|
3
|
-
require('../lib/runner.cjs').run('
|
|
2
|
+
/* MCP server launcher (self-contained engine, stdio). */
|
|
3
|
+
require('../lib/runner.cjs').run('a11y_toolkit.server');
|
package/bin/a11y-toolkit.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/* CLI launcher
|
|
3
|
-
require('../lib/runner.cjs').run('
|
|
2
|
+
/* CLI launcher (self-contained engine). */
|
|
3
|
+
require('../lib/runner.cjs').run('a11y_toolkit.a11y');
|
package/lib/runner.cjs
CHANGED
|
@@ -1,36 +1,44 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
const { spawn } = require('child_process');
|
|
2
|
+
/* Launcher: runs the SELF-CONTAINED engine that ships inside this package
|
|
3
|
+
* (a11y_toolkit/, pure-stdlib Python). No downloads at runtime when a
|
|
4
|
+
* python3 (>=3.9) exists; falls back to a version-pinned uvx when it does
|
|
5
|
+
* not. Zero install, zero network, reproducible by construction. */
|
|
6
|
+
const { spawn, spawnSync } = require('child_process');
|
|
7
|
+
const path = require('path');
|
|
7
8
|
|
|
9
|
+
const ENGINE = path.join(__dirname, '..'); // where a11y_toolkit/ lives
|
|
10
|
+
const PY = process.platform === 'win32' ? 'python' : 'python3';
|
|
8
11
|
const UVX = process.platform === 'win32' ? 'uvx.exe' : 'uvx';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
12
|
+
const VERSION = require('../package.json').version; // pinned fallback, same release
|
|
13
|
+
|
|
14
|
+
function pythonOk() {
|
|
15
|
+
try {
|
|
16
|
+
const r = spawnSync(PY, ['-c', 'import sys; sys.exit(0 if sys.version_info >= (3, 9) else 1)']);
|
|
17
|
+
return r.status === 0;
|
|
18
|
+
} catch { return false; }
|
|
19
|
+
}
|
|
14
20
|
|
|
15
21
|
function run(entry) {
|
|
16
|
-
const args =
|
|
17
|
-
|
|
22
|
+
const args = process.argv.slice(2);
|
|
23
|
+
if (pythonOk()) {
|
|
24
|
+
const child = spawn(PY, ['-m', entry, ...args],
|
|
25
|
+
{ stdio: 'inherit', env: { ...process.env, PYTHONPATH: ENGINE } });
|
|
26
|
+
child.on('close', (c) => process.exit(c === null ? 1 : c));
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const SCRIPTS = { 'a11y_toolkit.a11y': 'a11ytoolkit', 'a11y_toolkit.server': 'a11y-toolkit-mcp' };
|
|
30
|
+
const child = spawn(UVX, ['--from', `a11y-toolkit==${VERSION}`, SCRIPTS[entry] || entry], { stdio: 'inherit' });
|
|
18
31
|
child.on('error', (e) => {
|
|
19
32
|
if (e.code === 'ENOENT') {
|
|
20
|
-
console.error('a11y-toolkit:
|
|
21
|
-
console.error('');
|
|
22
|
-
console.error('
|
|
23
|
-
console.error('
|
|
24
|
-
console.error(' macOS (brew): brew install uv');
|
|
25
|
-
console.error(' Windows (PowerShell): powershell -c "irm https://astral.sh/uv/install.ps1 | iex"');
|
|
26
|
-
console.error(' or: pip install uv');
|
|
27
|
-
console.error('');
|
|
28
|
-
console.error('Then run this command again. https://github.com/kinti/a11y-toolkit');
|
|
33
|
+
console.error('a11y-toolkit: needs python3 (>=3.9) or uv.');
|
|
34
|
+
console.error(' uv (one line): curl -LsSf https://astral.sh/uv/install.sh | sh');
|
|
35
|
+
console.error(' or python3: https://www.python.org/downloads/');
|
|
36
|
+
console.error('https://github.com/kinti/a11y-toolkit');
|
|
29
37
|
process.exit(1);
|
|
30
38
|
}
|
|
31
39
|
throw e;
|
|
32
40
|
});
|
|
33
|
-
child.on('close', (
|
|
41
|
+
child.on('close', (c) => process.exit(c === null ? 1 : c));
|
|
34
42
|
}
|
|
35
43
|
|
|
36
44
|
module.exports = { run };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kinti/a11y-toolkit",
|
|
3
|
-
"version": "5.22.
|
|
3
|
+
"version": "5.22.1",
|
|
4
4
|
"description": "Zero-dependency WCAG 2.2 accessibility engine (34 MCP tools + CLI): audits, contrast fixing, SHA-256-sealed evidence packs, SARIF, EARL/ACT, CI ratchet. Node launcher; the engine itself is Python via uv.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|