@mcptoolshop/accessibility-suite 0.1.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.
Files changed (241) hide show
  1. package/.github/workflows/ci.yml +63 -0
  2. package/LICENSE +21 -0
  3. package/README.md +37 -0
  4. package/docs/prov-spec/.github/workflows/ci.yml +68 -0
  5. package/docs/prov-spec/CHANGELOG.md +69 -0
  6. package/docs/prov-spec/CODE_OF_CONDUCT.md +129 -0
  7. package/docs/prov-spec/CONFORMANCE_LEVELS.md +223 -0
  8. package/docs/prov-spec/CONTRIBUTING.md +145 -0
  9. package/docs/prov-spec/IMPLEMENTER_CHECKLIST.md +137 -0
  10. package/docs/prov-spec/LICENSE +21 -0
  11. package/docs/prov-spec/PRESS_RELEASE.md +74 -0
  12. package/docs/prov-spec/README.md +182 -0
  13. package/docs/prov-spec/SETUP.md +135 -0
  14. package/docs/prov-spec/WHY.md +86 -0
  15. package/docs/prov-spec/examples/artifact.example.json +14 -0
  16. package/docs/prov-spec/examples/artifact.ref.example.json +9 -0
  17. package/docs/prov-spec/examples/evidence.example.json +6 -0
  18. package/docs/prov-spec/examples/mcp.envelope.example.json +97 -0
  19. package/docs/prov-spec/examples/mcp.request.example.json +28 -0
  20. package/docs/prov-spec/examples/prov.record.example.json +35 -0
  21. package/docs/prov-spec/interop/PROOF_NODE_ENGINE.md +114 -0
  22. package/docs/prov-spec/spec/MCP_COMPATIBILITY.md +241 -0
  23. package/docs/prov-spec/spec/PROV_METHODS_CATALOG.md +142 -0
  24. package/docs/prov-spec/spec/PROV_METHODS_SPEC.md +397 -0
  25. package/docs/prov-spec/spec/methods.json +213 -0
  26. package/docs/prov-spec/spec/schemas/artifact.ref.schema.v0.1.json +58 -0
  27. package/docs/prov-spec/spec/schemas/artifact.schema.v0.1.json +61 -0
  28. package/docs/prov-spec/spec/schemas/assist.request.schema.v0.1.json +52 -0
  29. package/docs/prov-spec/spec/schemas/assist.response.schema.v0.1.json +70 -0
  30. package/docs/prov-spec/spec/schemas/cli.error.schema.v0.1.json +78 -0
  31. package/docs/prov-spec/spec/schemas/evidence.schema.v0.1.json +37 -0
  32. package/docs/prov-spec/spec/schemas/mcp.envelope.schema.v0.1.json +141 -0
  33. package/docs/prov-spec/spec/schemas/mcp.request.schema.v0.1.json +79 -0
  34. package/docs/prov-spec/spec/schemas/methods.schema.json +93 -0
  35. package/docs/prov-spec/spec/schemas/prov-capabilities.schema.json +122 -0
  36. package/docs/prov-spec/spec/schemas/prov.record.schema.v0.1.json +133 -0
  37. package/docs/prov-spec/spec/vectors/adapter.wrap.envelope_v0_1/expected.json +4 -0
  38. package/docs/prov-spec/spec/vectors/adapter.wrap.envelope_v0_1/input.json +1 -0
  39. package/docs/prov-spec/spec/vectors/adapter.wrap.envelope_v0_1/negative/double_wrapped.json +14 -0
  40. package/docs/prov-spec/spec/vectors/adapter.wrap.envelope_v0_1/negative/wrong_schema_version.json +11 -0
  41. package/docs/prov-spec/spec/vectors/engine.extract.evidence.json_pointer/expected.json +24 -0
  42. package/docs/prov-spec/spec/vectors/engine.extract.evidence.json_pointer/input.json +8 -0
  43. package/docs/prov-spec/spec/vectors/integrity.digest.sha256/expected.json +7 -0
  44. package/docs/prov-spec/spec/vectors/integrity.digest.sha256/input.json +1 -0
  45. package/docs/prov-spec/spec/vectors/integrity.digest.sha256/negative/non_hex_chars.json +16 -0
  46. package/docs/prov-spec/spec/vectors/integrity.digest.sha256/negative/uppercase_hex.json +16 -0
  47. package/docs/prov-spec/spec/vectors/integrity.digest.sha256/negative/wrong_length.json +16 -0
  48. package/docs/prov-spec/spec/vectors/method_id_syntax/negative/hyphen_separator.json +8 -0
  49. package/docs/prov-spec/spec/vectors/method_id_syntax/negative/reserved_namespace.json +8 -0
  50. package/docs/prov-spec/spec/vectors/method_id_syntax/negative/starts_with_digit.json +8 -0
  51. package/docs/prov-spec/spec/vectors/method_id_syntax/negative/uppercase.json +8 -0
  52. package/docs/prov-spec/spec/vectors/method_id_syntax/positive/valid_ids.json +18 -0
  53. package/docs/prov-spec/tools/python/prov_validator.py +428 -0
  54. package/examples/a11y-demo-site/.github/workflows/a11y-artifacts.yml +81 -0
  55. package/examples/a11y-demo-site/.github/workflows/a11y.yml +34 -0
  56. package/examples/a11y-demo-site/CODE_OF_CONDUCT.md +129 -0
  57. package/examples/a11y-demo-site/CONTRIBUTING.md +83 -0
  58. package/examples/a11y-demo-site/LICENSE +21 -0
  59. package/examples/a11y-demo-site/README.md +155 -0
  60. package/examples/a11y-demo-site/html/contact.html +15 -0
  61. package/examples/a11y-demo-site/html/index.html +20 -0
  62. package/examples/a11y-demo-site/scripts/a11y.sh +20 -0
  63. package/package.json +26 -0
  64. package/src/a11y-assist/.github/workflows/publish.yml +52 -0
  65. package/src/a11y-assist/.github/workflows/test.yml +30 -0
  66. package/src/a11y-assist/A11Y_ASSIST_TEST_COVERAGE_REQUIREMENTS.md +104 -0
  67. package/src/a11y-assist/CODE_OF_CONDUCT.md +129 -0
  68. package/src/a11y-assist/CONTRIBUTING.md +98 -0
  69. package/src/a11y-assist/ENGINE.md +363 -0
  70. package/src/a11y-assist/LICENSE +21 -0
  71. package/src/a11y-assist/PRESS_RELEASE.md +71 -0
  72. package/src/a11y-assist/QUICKSTART.md +101 -0
  73. package/src/a11y-assist/README.md +192 -0
  74. package/src/a11y-assist/RELEASE_NOTES.md +319 -0
  75. package/src/a11y-assist/a11y_assist/__init__.py +3 -0
  76. package/src/a11y-assist/a11y_assist/cli.py +599 -0
  77. package/src/a11y-assist/a11y_assist/from_cli_error.py +149 -0
  78. package/src/a11y-assist/a11y_assist/guard.py +444 -0
  79. package/src/a11y-assist/a11y_assist/ingest.py +407 -0
  80. package/src/a11y-assist/a11y_assist/methods.py +137 -0
  81. package/src/a11y-assist/a11y_assist/parse_raw.py +71 -0
  82. package/src/a11y-assist/a11y_assist/profiles/__init__.py +29 -0
  83. package/src/a11y-assist/a11y_assist/profiles/cognitive_load.py +245 -0
  84. package/src/a11y-assist/a11y_assist/profiles/cognitive_load_render.py +86 -0
  85. package/src/a11y-assist/a11y_assist/profiles/dyslexia.py +144 -0
  86. package/src/a11y-assist/a11y_assist/profiles/dyslexia_render.py +77 -0
  87. package/src/a11y-assist/a11y_assist/profiles/plain_language.py +119 -0
  88. package/src/a11y-assist/a11y_assist/profiles/plain_language_render.py +66 -0
  89. package/src/a11y-assist/a11y_assist/profiles/screen_reader.py +348 -0
  90. package/src/a11y-assist/a11y_assist/profiles/screen_reader_render.py +89 -0
  91. package/src/a11y-assist/a11y_assist/render.py +95 -0
  92. package/src/a11y-assist/a11y_assist/schemas/assist.request.schema.v0.1.json +52 -0
  93. package/src/a11y-assist/a11y_assist/schemas/assist.response.schema.v0.1.json +70 -0
  94. package/src/a11y-assist/a11y_assist/schemas/cli.error.schema.v0.1.json +78 -0
  95. package/src/a11y-assist/a11y_assist/storage.py +31 -0
  96. package/src/a11y-assist/pyproject.toml +60 -0
  97. package/src/a11y-assist/tests/__init__.py +1 -0
  98. package/src/a11y-assist/tests/fixtures/base_inputs/cli_error_high.json +18 -0
  99. package/src/a11y-assist/tests/fixtures/base_inputs/cli_error_medium.json +16 -0
  100. package/src/a11y-assist/tests/fixtures/base_inputs/raw_text_low.txt +3 -0
  101. package/src/a11y-assist/tests/fixtures/cli_error_good.json +9 -0
  102. package/src/a11y-assist/tests/fixtures/cli_error_missing_id.json +7 -0
  103. package/src/a11y-assist/tests/fixtures/cli_error_string_format.json +7 -0
  104. package/src/a11y-assist/tests/fixtures/expected/cognitive_load_high.txt +20 -0
  105. package/src/a11y-assist/tests/fixtures/expected/dyslexia_high.txt +20 -0
  106. package/src/a11y-assist/tests/fixtures/expected/lowvision_high.txt +18 -0
  107. package/src/a11y-assist/tests/fixtures/expected/plain_language_high.txt +14 -0
  108. package/src/a11y-assist/tests/fixtures/expected/screen_reader_high.txt +19 -0
  109. package/src/a11y-assist/tests/fixtures/golden_screen_reader_cli_error.txt +16 -0
  110. package/src/a11y-assist/tests/fixtures/golden_screen_reader_raw_no_id.txt +14 -0
  111. package/src/a11y-assist/tests/fixtures/golden_screen_reader_raw_with_id.txt +14 -0
  112. package/src/a11y-assist/tests/fixtures/raw_good.txt +11 -0
  113. package/src/a11y-assist/tests/fixtures/raw_no_id.txt +2 -0
  114. package/src/a11y-assist/tests/test_cognitive_load.py +469 -0
  115. package/src/a11y-assist/tests/test_dyslexia.py +337 -0
  116. package/src/a11y-assist/tests/test_explain.py +74 -0
  117. package/src/a11y-assist/tests/test_golden.py +127 -0
  118. package/src/a11y-assist/tests/test_guard.py +819 -0
  119. package/src/a11y-assist/tests/test_guard_integration.py +457 -0
  120. package/src/a11y-assist/tests/test_ingest.py +311 -0
  121. package/src/a11y-assist/tests/test_methods_metadata.py +236 -0
  122. package/src/a11y-assist/tests/test_plain_language.py +348 -0
  123. package/src/a11y-assist/tests/test_render.py +117 -0
  124. package/src/a11y-assist/tests/test_screen_reader.py +703 -0
  125. package/src/a11y-assist/tests/test_storage_last.py +61 -0
  126. package/src/a11y-assist/tests/test_triage.py +86 -0
  127. package/src/a11y-ci/.github/workflows/ci.yml +43 -0
  128. package/src/a11y-ci/.github/workflows/test.yml +30 -0
  129. package/src/a11y-ci/A11Y_CI_TEST_COVERAGE_REQUIREMENTS.md +94 -0
  130. package/src/a11y-ci/CODE_OF_CONDUCT.md +129 -0
  131. package/src/a11y-ci/CONTRIBUTING.md +142 -0
  132. package/src/a11y-ci/LICENSE +21 -0
  133. package/src/a11y-ci/README.md +105 -0
  134. package/src/a11y-ci/a11y_ci/__init__.py +3 -0
  135. package/src/a11y-ci/a11y_ci/allowlist.py +83 -0
  136. package/src/a11y-ci/a11y_ci/cli.py +145 -0
  137. package/src/a11y-ci/a11y_ci/gate.py +131 -0
  138. package/src/a11y-ci/a11y_ci/render.py +48 -0
  139. package/src/a11y-ci/a11y_ci/schemas/allowlist.schema.json +24 -0
  140. package/src/a11y-ci/a11y_ci/scorecard.py +99 -0
  141. package/src/a11y-ci/npm/package.json +35 -0
  142. package/src/a11y-ci/pyproject.toml +64 -0
  143. package/src/a11y-ci/tests/__init__.py +1 -0
  144. package/src/a11y-ci/tests/fixtures/allowlist_expired.json +10 -0
  145. package/src/a11y-ci/tests/fixtures/allowlist_ok.json +10 -0
  146. package/src/a11y-ci/tests/fixtures/baseline_ok.json +7 -0
  147. package/src/a11y-ci/tests/fixtures/current_fail.json +6 -0
  148. package/src/a11y-ci/tests/fixtures/current_ok.json +6 -0
  149. package/src/a11y-ci/tests/fixtures/current_regresses.json +7 -0
  150. package/src/a11y-ci/tests/test_gate.py +134 -0
  151. package/src/a11y-evidence-engine/.github/workflows/ci.yml +53 -0
  152. package/src/a11y-evidence-engine/CODE_OF_CONDUCT.md +129 -0
  153. package/src/a11y-evidence-engine/CONTRIBUTING.md +128 -0
  154. package/src/a11y-evidence-engine/LICENSE +21 -0
  155. package/src/a11y-evidence-engine/README.md +71 -0
  156. package/src/a11y-evidence-engine/bin/a11y-engine.js +11 -0
  157. package/src/a11y-evidence-engine/fixtures/bad/button-no-name.html +30 -0
  158. package/src/a11y-evidence-engine/fixtures/bad/img-missing-alt.html +19 -0
  159. package/src/a11y-evidence-engine/fixtures/bad/input-missing-label.html +26 -0
  160. package/src/a11y-evidence-engine/fixtures/bad/missing-lang.html +11 -0
  161. package/src/a11y-evidence-engine/fixtures/good/index.html +29 -0
  162. package/src/a11y-evidence-engine/package-lock.json +109 -0
  163. package/src/a11y-evidence-engine/package.json +45 -0
  164. package/src/a11y-evidence-engine/src/cli.js +74 -0
  165. package/src/a11y-evidence-engine/src/evidence/canonicalize.js +52 -0
  166. package/src/a11y-evidence-engine/src/evidence/json_pointer.js +34 -0
  167. package/src/a11y-evidence-engine/src/evidence/prov_emit.js +153 -0
  168. package/src/a11y-evidence-engine/src/fswalk.js +56 -0
  169. package/src/a11y-evidence-engine/src/html_parse.js +117 -0
  170. package/src/a11y-evidence-engine/src/ids.js +53 -0
  171. package/src/a11y-evidence-engine/src/rules/document_missing_lang.js +50 -0
  172. package/src/a11y-evidence-engine/src/rules/form_control_missing_label.js +105 -0
  173. package/src/a11y-evidence-engine/src/rules/img_missing_alt.js +77 -0
  174. package/src/a11y-evidence-engine/src/rules/index.js +37 -0
  175. package/src/a11y-evidence-engine/src/rules/interactive_missing_name.js +129 -0
  176. package/src/a11y-evidence-engine/src/scan.js +128 -0
  177. package/src/a11y-evidence-engine/test/scan.test.js +149 -0
  178. package/src/a11y-evidence-engine/test/vectors.test.js +200 -0
  179. package/src/a11y-lint/.github/workflows/ci.yml +46 -0
  180. package/src/a11y-lint/.github/workflows/test.yml +34 -0
  181. package/src/a11y-lint/CODE_OF_CONDUCT.md +129 -0
  182. package/src/a11y-lint/CONTRIBUTING.md +70 -0
  183. package/src/a11y-lint/GOVERNANCE.md +57 -0
  184. package/src/a11y-lint/LICENSE +21 -0
  185. package/src/a11y-lint/PRESS_RELEASE.md +50 -0
  186. package/src/a11y-lint/README.md +276 -0
  187. package/src/a11y-lint/RELEASE_NOTES.md +57 -0
  188. package/src/a11y-lint/RELEASING.md +57 -0
  189. package/src/a11y-lint/a11y_lint/__init__.py +64 -0
  190. package/src/a11y-lint/a11y_lint/cli.py +319 -0
  191. package/src/a11y-lint/a11y_lint/errors.py +252 -0
  192. package/src/a11y-lint/a11y_lint/render.py +293 -0
  193. package/src/a11y-lint/a11y_lint/report_md.py +289 -0
  194. package/src/a11y-lint/a11y_lint/scan_cli_text.py +434 -0
  195. package/src/a11y-lint/a11y_lint/schemas/cli.error.schema.v0.1.json +83 -0
  196. package/src/a11y-lint/a11y_lint/scorecard.py +244 -0
  197. package/src/a11y-lint/a11y_lint/validate.py +225 -0
  198. package/src/a11y-lint/pyproject.toml +75 -0
  199. package/src/a11y-lint/tests/__init__.py +1 -0
  200. package/src/a11y-lint/tests/test_cli.py +200 -0
  201. package/src/a11y-lint/tests/test_errors.py +188 -0
  202. package/src/a11y-lint/tests/test_render.py +202 -0
  203. package/src/a11y-lint/tests/test_report_md.py +188 -0
  204. package/src/a11y-lint/tests/test_scan_cli_text.py +290 -0
  205. package/src/a11y-lint/tests/test_scorecard.py +195 -0
  206. package/src/a11y-lint/tests/test_validate.py +257 -0
  207. package/src/a11y-mcp-tools/.github/workflows/ci.yml +53 -0
  208. package/src/a11y-mcp-tools/CODE_OF_CONDUCT.md +129 -0
  209. package/src/a11y-mcp-tools/CONTRIBUTING.md +136 -0
  210. package/src/a11y-mcp-tools/LICENSE +21 -0
  211. package/src/a11y-mcp-tools/PROV_METHODS_CATALOG.md +104 -0
  212. package/src/a11y-mcp-tools/README.md +168 -0
  213. package/src/a11y-mcp-tools/bin/cli.js +452 -0
  214. package/src/a11y-mcp-tools/bin/server.js +244 -0
  215. package/src/a11y-mcp-tools/fixtures/requests/a11y.diagnose.ok.json +27 -0
  216. package/src/a11y-mcp-tools/fixtures/requests/a11y.evidence.ok.json +25 -0
  217. package/src/a11y-mcp-tools/fixtures/responses/a11y.diagnose.ok.json +139 -0
  218. package/src/a11y-mcp-tools/fixtures/responses/a11y.diagnose.provenance_fail.json +13 -0
  219. package/src/a11y-mcp-tools/fixtures/responses/a11y.evidence.ok.json +88 -0
  220. package/src/a11y-mcp-tools/package-lock.json +189 -0
  221. package/src/a11y-mcp-tools/package.json +49 -0
  222. package/src/a11y-mcp-tools/src/envelope.js +197 -0
  223. package/src/a11y-mcp-tools/src/index.js +9 -0
  224. package/src/a11y-mcp-tools/src/schemas/artifact.js +85 -0
  225. package/src/a11y-mcp-tools/src/schemas/diagnosis.schema.v0.1.json +137 -0
  226. package/src/a11y-mcp-tools/src/schemas/envelope.schema.v0.1.json +108 -0
  227. package/src/a11y-mcp-tools/src/schemas/evidence.bundle.schema.v0.1.json +129 -0
  228. package/src/a11y-mcp-tools/src/schemas/evidence.js +97 -0
  229. package/src/a11y-mcp-tools/src/schemas/index.js +11 -0
  230. package/src/a11y-mcp-tools/src/schemas/provenance.js +140 -0
  231. package/src/a11y-mcp-tools/src/schemas/tools/a11y.diagnose.request.schema.v0.1.json +77 -0
  232. package/src/a11y-mcp-tools/src/schemas/tools/a11y.diagnose.response.schema.v0.1.json +50 -0
  233. package/src/a11y-mcp-tools/src/schemas/tools/a11y.evidence.request.schema.v0.1.json +120 -0
  234. package/src/a11y-mcp-tools/src/schemas/tools/a11y.evidence.response.schema.v0.1.json +50 -0
  235. package/src/a11y-mcp-tools/src/tools/diagnose.js +597 -0
  236. package/src/a11y-mcp-tools/src/tools/evidence.js +481 -0
  237. package/src/a11y-mcp-tools/src/tools/index.js +10 -0
  238. package/src/a11y-mcp-tools/test/contract.test.mjs +154 -0
  239. package/src/a11y-mcp-tools/test/diagnose.test.js +485 -0
  240. package/src/a11y-mcp-tools/test/evidence.test.js +183 -0
  241. package/src/a11y-mcp-tools/test/schema.test.js +327 -0
@@ -0,0 +1,189 @@
1
+ {
2
+ "name": "a11y-mcp-tools",
3
+ "version": "0.2.0",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "a11y-mcp-tools",
9
+ "version": "0.2.0",
10
+ "license": "MIT",
11
+ "dependencies": {
12
+ "htmlparser2": "^9.1.0"
13
+ },
14
+ "bin": {
15
+ "a11y": "bin/cli.js",
16
+ "a11y-mcp": "bin/server.js"
17
+ },
18
+ "devDependencies": {
19
+ "ajv": "^8.17.1",
20
+ "ajv-formats": "^3.0.1"
21
+ },
22
+ "engines": {
23
+ "node": ">=18.0.0"
24
+ }
25
+ },
26
+ "node_modules/ajv": {
27
+ "version": "8.17.1",
28
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",
29
+ "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
30
+ "dev": true,
31
+ "license": "MIT",
32
+ "dependencies": {
33
+ "fast-deep-equal": "^3.1.3",
34
+ "fast-uri": "^3.0.1",
35
+ "json-schema-traverse": "^1.0.0",
36
+ "require-from-string": "^2.0.2"
37
+ },
38
+ "funding": {
39
+ "type": "github",
40
+ "url": "https://github.com/sponsors/epoberezkin"
41
+ }
42
+ },
43
+ "node_modules/ajv-formats": {
44
+ "version": "3.0.1",
45
+ "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz",
46
+ "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==",
47
+ "dev": true,
48
+ "license": "MIT",
49
+ "dependencies": {
50
+ "ajv": "^8.0.0"
51
+ },
52
+ "peerDependencies": {
53
+ "ajv": "^8.0.0"
54
+ },
55
+ "peerDependenciesMeta": {
56
+ "ajv": {
57
+ "optional": true
58
+ }
59
+ }
60
+ },
61
+ "node_modules/dom-serializer": {
62
+ "version": "2.0.0",
63
+ "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz",
64
+ "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==",
65
+ "license": "MIT",
66
+ "dependencies": {
67
+ "domelementtype": "^2.3.0",
68
+ "domhandler": "^5.0.2",
69
+ "entities": "^4.2.0"
70
+ },
71
+ "funding": {
72
+ "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1"
73
+ }
74
+ },
75
+ "node_modules/domelementtype": {
76
+ "version": "2.3.0",
77
+ "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz",
78
+ "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==",
79
+ "funding": [
80
+ {
81
+ "type": "github",
82
+ "url": "https://github.com/sponsors/fb55"
83
+ }
84
+ ],
85
+ "license": "BSD-2-Clause"
86
+ },
87
+ "node_modules/domhandler": {
88
+ "version": "5.0.3",
89
+ "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz",
90
+ "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==",
91
+ "license": "BSD-2-Clause",
92
+ "dependencies": {
93
+ "domelementtype": "^2.3.0"
94
+ },
95
+ "engines": {
96
+ "node": ">= 4"
97
+ },
98
+ "funding": {
99
+ "url": "https://github.com/fb55/domhandler?sponsor=1"
100
+ }
101
+ },
102
+ "node_modules/domutils": {
103
+ "version": "3.2.2",
104
+ "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz",
105
+ "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==",
106
+ "license": "BSD-2-Clause",
107
+ "dependencies": {
108
+ "dom-serializer": "^2.0.0",
109
+ "domelementtype": "^2.3.0",
110
+ "domhandler": "^5.0.3"
111
+ },
112
+ "funding": {
113
+ "url": "https://github.com/fb55/domutils?sponsor=1"
114
+ }
115
+ },
116
+ "node_modules/entities": {
117
+ "version": "4.5.0",
118
+ "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
119
+ "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",
120
+ "license": "BSD-2-Clause",
121
+ "engines": {
122
+ "node": ">=0.12"
123
+ },
124
+ "funding": {
125
+ "url": "https://github.com/fb55/entities?sponsor=1"
126
+ }
127
+ },
128
+ "node_modules/fast-deep-equal": {
129
+ "version": "3.1.3",
130
+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
131
+ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
132
+ "dev": true,
133
+ "license": "MIT"
134
+ },
135
+ "node_modules/fast-uri": {
136
+ "version": "3.1.0",
137
+ "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz",
138
+ "integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==",
139
+ "dev": true,
140
+ "funding": [
141
+ {
142
+ "type": "github",
143
+ "url": "https://github.com/sponsors/fastify"
144
+ },
145
+ {
146
+ "type": "opencollective",
147
+ "url": "https://opencollective.com/fastify"
148
+ }
149
+ ],
150
+ "license": "BSD-3-Clause"
151
+ },
152
+ "node_modules/htmlparser2": {
153
+ "version": "9.1.0",
154
+ "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-9.1.0.tgz",
155
+ "integrity": "sha512-5zfg6mHUoaer/97TxnGpxmbR7zJtPwIYFMZ/H5ucTlPZhKvtum05yiPK3Mgai3a0DyVxv7qYqoweaEd2nrYQzQ==",
156
+ "funding": [
157
+ "https://github.com/fb55/htmlparser2?sponsor=1",
158
+ {
159
+ "type": "github",
160
+ "url": "https://github.com/sponsors/fb55"
161
+ }
162
+ ],
163
+ "license": "MIT",
164
+ "dependencies": {
165
+ "domelementtype": "^2.3.0",
166
+ "domhandler": "^5.0.3",
167
+ "domutils": "^3.1.0",
168
+ "entities": "^4.5.0"
169
+ }
170
+ },
171
+ "node_modules/json-schema-traverse": {
172
+ "version": "1.0.0",
173
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
174
+ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
175
+ "dev": true,
176
+ "license": "MIT"
177
+ },
178
+ "node_modules/require-from-string": {
179
+ "version": "2.0.2",
180
+ "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
181
+ "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
182
+ "dev": true,
183
+ "license": "MIT",
184
+ "engines": {
185
+ "node": ">=0.10.0"
186
+ }
187
+ }
188
+ }
189
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@mcptoolshop/a11y-mcp-tools",
3
+ "version": "0.3.1",
4
+ "description": "MCP tools for accessibility evidence capture and diagnosis",
5
+ "main": "src/index.js",
6
+ "bin": {
7
+ "a11y": "./bin/cli.js",
8
+ "a11y-mcp": "./bin/server.js"
9
+ },
10
+ "scripts": {
11
+ "start": "node bin/server.js",
12
+ "test": "node --test test/*.test.js test/*.test.mjs"
13
+ },
14
+ "keywords": [
15
+ "mcp",
16
+ "accessibility",
17
+ "a11y",
18
+ "wcag",
19
+ "provenance",
20
+ "evidence",
21
+ "testing",
22
+ "audit"
23
+ ],
24
+ "author": "mcp-tool-shop <64996768+mcp-tool-shop@users.noreply.github.com>",
25
+ "license": "MIT",
26
+ "homepage": "https://github.com/mcp-tool-shop-org/accessibility-suite#readme",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/mcp-tool-shop-org/accessibility-suite.git",
30
+ "directory": "src/a11y-mcp-tools"
31
+ },
32
+ "bugs": {
33
+ "url": "https://github.com/mcp-tool-shop-org/accessibility-suite/issues"
34
+ },
35
+ "engines": {
36
+ "node": ">=18.0.0"
37
+ },
38
+ "dependencies": {
39
+ "htmlparser2": "^9.1.0"
40
+ },
41
+ "devDependencies": {
42
+ "ajv": "^8.17.1",
43
+ "ajv-formats": "^3.0.1"
44
+ },
45
+ "publishConfig": {
46
+ "access": "public",
47
+ "registry": "https://registry.npmjs.org"
48
+ }
49
+ }
@@ -0,0 +1,197 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * MCP Envelope utilities (v0.1).
5
+ *
6
+ * Wraps tool inputs/outputs in standard MCP envelopes with
7
+ * request IDs, client info, and structured error responses.
8
+ */
9
+
10
+ const crypto = require("crypto");
11
+
12
+ const ENVELOPE_VERSION = "mcp.envelope_v0_1";
13
+
14
+ /**
15
+ * Generate a unique request ID.
16
+ */
17
+ function generateRequestId() {
18
+ const bytes = crypto.randomBytes(12);
19
+ return `req_${bytes.toString("base64url")}`;
20
+ }
21
+
22
+ /**
23
+ * Create a request envelope.
24
+ *
25
+ * @param {string} tool - Tool name
26
+ * @param {Object} input - Tool input
27
+ * @param {Object} [client] - Client info
28
+ * @returns {Object} Request envelope
29
+ */
30
+ function createRequestEnvelope(tool, input, client = null) {
31
+ return {
32
+ mcp: {
33
+ envelope: ENVELOPE_VERSION,
34
+ request_id: generateRequestId(),
35
+ tool,
36
+ ...(client && { client }),
37
+ },
38
+ input,
39
+ };
40
+ }
41
+
42
+ /**
43
+ * Create a success response envelope.
44
+ *
45
+ * @param {string} requestId - Original request ID
46
+ * @param {string} tool - Tool name
47
+ * @param {Object} result - Tool result
48
+ * @returns {Object} Response envelope
49
+ */
50
+ function createResponseEnvelope(requestId, tool, result) {
51
+ return {
52
+ mcp: {
53
+ envelope: ENVELOPE_VERSION,
54
+ request_id: requestId,
55
+ tool,
56
+ ok: true,
57
+ },
58
+ result,
59
+ };
60
+ }
61
+
62
+ /**
63
+ * Create an error response envelope.
64
+ *
65
+ * @param {string} requestId - Original request ID
66
+ * @param {string} tool - Tool name
67
+ * @param {string} code - Error code
68
+ * @param {string} message - Error message
69
+ * @param {string} [fix] - Suggested fix
70
+ * @returns {Object} Error envelope
71
+ */
72
+ function createErrorEnvelope(requestId, tool, code, message, fix = null) {
73
+ return {
74
+ mcp: {
75
+ envelope: ENVELOPE_VERSION,
76
+ request_id: requestId,
77
+ tool,
78
+ ok: false,
79
+ },
80
+ error: {
81
+ code,
82
+ message,
83
+ ...(fix && { fix }),
84
+ },
85
+ };
86
+ }
87
+
88
+ /**
89
+ * Error codes for a11y tools.
90
+ */
91
+ const ERROR_CODES = {
92
+ // General errors
93
+ INVALID_INPUT: "INVALID_INPUT",
94
+ INTERNAL_ERROR: "INTERNAL_ERROR",
95
+
96
+ // Evidence errors
97
+ FILE_NOT_FOUND: "FILE_NOT_FOUND",
98
+ CAPTURE_FAILED: "CAPTURE_FAILED",
99
+
100
+ // Diagnosis errors
101
+ BUNDLE_NOT_FOUND: "BUNDLE_NOT_FOUND",
102
+ ARTIFACT_NOT_FOUND: "ARTIFACT_NOT_FOUND",
103
+ INVALID_BUNDLE: "INVALID_BUNDLE",
104
+
105
+ // Integrity errors
106
+ PROVENANCE_VERIFICATION_FAILED: "PROVENANCE_VERIFICATION_FAILED",
107
+ DIGEST_MISMATCH: "DIGEST_MISMATCH",
108
+
109
+ // Schema errors
110
+ SCHEMA_VALIDATION_FAILED: "SCHEMA_VALIDATION_FAILED",
111
+ };
112
+
113
+ /**
114
+ * Wrap a tool execution with envelope handling.
115
+ *
116
+ * @param {string} tool - Tool name
117
+ * @param {Function} handler - Tool handler function
118
+ * @returns {Function} Wrapped handler
119
+ */
120
+ function withEnvelope(tool, handler) {
121
+ return async (envelope) => {
122
+ const requestId = envelope?.mcp?.request_id || generateRequestId();
123
+
124
+ try {
125
+ // Validate envelope structure
126
+ if (!envelope?.input) {
127
+ return createErrorEnvelope(
128
+ requestId,
129
+ tool,
130
+ ERROR_CODES.INVALID_INPUT,
131
+ "Missing input in request envelope",
132
+ "Wrap your input in { mcp: { ... }, input: { ... } }"
133
+ );
134
+ }
135
+
136
+ // Execute handler
137
+ const result = await handler(envelope.input);
138
+
139
+ // Check for handler errors
140
+ if (result.ok === false) {
141
+ return createErrorEnvelope(
142
+ requestId,
143
+ tool,
144
+ result.error?.code || ERROR_CODES.INTERNAL_ERROR,
145
+ result.error?.message || "Unknown error",
146
+ result.error?.fix
147
+ );
148
+ }
149
+
150
+ // Return success envelope
151
+ return createResponseEnvelope(requestId, tool, result);
152
+ } catch (err) {
153
+ return createErrorEnvelope(
154
+ requestId,
155
+ tool,
156
+ ERROR_CODES.INTERNAL_ERROR,
157
+ err.message,
158
+ "Check tool input and try again"
159
+ );
160
+ }
161
+ };
162
+ }
163
+
164
+ /**
165
+ * Parse incoming request - supports both envelope and raw input.
166
+ *
167
+ * For backwards compatibility, accepts:
168
+ * 1. Full envelope: { mcp: { ... }, input: { ... } }
169
+ * 2. Raw input: { targets: [...], ... }
170
+ *
171
+ * @param {Object} request - Request (envelope or raw)
172
+ * @param {string} tool - Tool name
173
+ * @returns {Object} Normalized envelope
174
+ */
175
+ function normalizeRequest(request, tool) {
176
+ // Already an envelope
177
+ if (request?.mcp?.envelope) {
178
+ return request;
179
+ }
180
+
181
+ // Raw input - wrap in envelope
182
+ return createRequestEnvelope(tool, request, {
183
+ name: "a11y-mcp-tools",
184
+ version: "0.1.0",
185
+ });
186
+ }
187
+
188
+ module.exports = {
189
+ ENVELOPE_VERSION,
190
+ ERROR_CODES,
191
+ generateRequestId,
192
+ createRequestEnvelope,
193
+ createResponseEnvelope,
194
+ createErrorEnvelope,
195
+ withEnvelope,
196
+ normalizeRequest,
197
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ const tools = require("./tools/index.js");
4
+ const schemas = require("./schemas/index.js");
5
+
6
+ module.exports = {
7
+ ...tools,
8
+ schemas,
9
+ };
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Artifact schema and utilities.
5
+ *
6
+ * An artifact is a captured piece of content with:
7
+ * - Unique ID
8
+ * - Media type
9
+ * - Locator (where it came from)
10
+ * - Size and digest
11
+ * - Labels for categorization
12
+ */
13
+
14
+ const crypto = require("crypto");
15
+
16
+ /**
17
+ * Create an artifact object.
18
+ *
19
+ * @param {Object} params
20
+ * @param {string} params.id - Artifact ID (e.g., "artifact:html:index")
21
+ * @param {string} params.mediaType - MIME type
22
+ * @param {Object} params.locator - { kind: "file"|"derived"|"url", path|from|url }
23
+ * @param {Buffer|string} params.content - Raw content for hashing
24
+ * @param {string[]} [params.labels] - Optional labels
25
+ * @returns {Object} Artifact object
26
+ */
27
+ function createArtifact({ id, mediaType, locator, content, labels = [] }) {
28
+ const contentBuffer = Buffer.isBuffer(content)
29
+ ? content
30
+ : Buffer.from(content, "utf8");
31
+
32
+ const digest = crypto
33
+ .createHash("sha256")
34
+ .update(contentBuffer)
35
+ .digest("hex");
36
+
37
+ return {
38
+ artifact_id: id,
39
+ media_type: mediaType,
40
+ locator,
41
+ size_bytes: contentBuffer.length,
42
+ digest: {
43
+ alg: "sha256",
44
+ hex: digest,
45
+ },
46
+ labels,
47
+ };
48
+ }
49
+
50
+ /**
51
+ * Generate an artifact ID from kind and name.
52
+ *
53
+ * @param {string} kind - e.g., "html", "dom", "log"
54
+ * @param {string} name - e.g., "index", "contact"
55
+ * @returns {string} Artifact ID
56
+ */
57
+ function artifactId(kind, name) {
58
+ return `artifact:${kind}:${name}`;
59
+ }
60
+
61
+ /**
62
+ * Verify an artifact's digest.
63
+ *
64
+ * @param {Object} artifact - Artifact object
65
+ * @param {Buffer|string} content - Content to verify
66
+ * @returns {boolean}
67
+ */
68
+ function verifyArtifact(artifact, content) {
69
+ const contentBuffer = Buffer.isBuffer(content)
70
+ ? content
71
+ : Buffer.from(content, "utf8");
72
+
73
+ const computed = crypto
74
+ .createHash("sha256")
75
+ .update(contentBuffer)
76
+ .digest("hex");
77
+
78
+ return computed === artifact.digest.hex;
79
+ }
80
+
81
+ module.exports = {
82
+ createArtifact,
83
+ artifactId,
84
+ verifyArtifact,
85
+ };
@@ -0,0 +1,137 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mcp-tool-shop.github.io/schemas/diagnosis.v0.1.json",
4
+ "title": "Accessibility Diagnosis",
5
+ "description": "Deterministic diagnosis output with findings and provenance",
6
+ "type": "object",
7
+ "required": ["findings", "summary", "provenance"],
8
+ "properties": {
9
+ "findings": {
10
+ "type": "array",
11
+ "items": { "$ref": "#/$defs/Finding" }
12
+ },
13
+ "summary": { "$ref": "#/$defs/Summary" },
14
+ "provenance": { "$ref": "#/$defs/Provenance" }
15
+ },
16
+ "$defs": {
17
+ "Finding": {
18
+ "type": "object",
19
+ "required": ["id", "severity", "targets"],
20
+ "properties": {
21
+ "id": {
22
+ "type": "string",
23
+ "pattern": "^a11y\\.[a-z_]+\\.[a-z_]+$",
24
+ "description": "Finding ID (e.g., a11y.lang.missing)"
25
+ },
26
+ "wcag": {
27
+ "type": "string",
28
+ "pattern": "^wcag\\.[0-9]+\\.[0-9]+\\.[0-9]+$",
29
+ "description": "WCAG criterion reference"
30
+ },
31
+ "severity": {
32
+ "type": "string",
33
+ "enum": ["low", "medium", "high", "critical"]
34
+ },
35
+ "message": { "type": "string" },
36
+ "targets": {
37
+ "type": "array",
38
+ "items": { "$ref": "#/$defs/EvidenceAnchor" },
39
+ "minItems": 1
40
+ },
41
+ "fix": { "$ref": "#/$defs/FixGuidance" }
42
+ }
43
+ },
44
+ "EvidenceAnchor": {
45
+ "type": "object",
46
+ "required": ["artifact_id"],
47
+ "properties": {
48
+ "artifact_id": { "type": "string" },
49
+ "json_pointer": {
50
+ "type": "string",
51
+ "pattern": "^/.*$",
52
+ "description": "JSON Pointer (RFC 6901)"
53
+ },
54
+ "selector": {
55
+ "type": "string",
56
+ "description": "CSS selector"
57
+ },
58
+ "line_span": {
59
+ "type": "object",
60
+ "properties": {
61
+ "start": { "type": "integer", "minimum": 1 },
62
+ "end": { "type": "integer", "minimum": 1 }
63
+ }
64
+ },
65
+ "snippet": {
66
+ "type": "string",
67
+ "maxLength": 500,
68
+ "description": "Truncated source snippet"
69
+ }
70
+ }
71
+ },
72
+ "FixGuidance": {
73
+ "type": "object",
74
+ "required": ["safe"],
75
+ "properties": {
76
+ "safe": {
77
+ "type": "boolean",
78
+ "description": "True if fix is SAFE-only (intent patch, not direct write)"
79
+ },
80
+ "description": { "type": "string" },
81
+ "patch": {
82
+ "type": "object",
83
+ "description": "Intent patch for the fix",
84
+ "properties": {
85
+ "action": {
86
+ "type": "string",
87
+ "enum": ["add_attribute", "set_attribute", "add_element", "wrap_element"]
88
+ },
89
+ "target": { "type": "string" },
90
+ "value": { "type": "string" }
91
+ }
92
+ },
93
+ "wcag_ref": { "type": "string" }
94
+ }
95
+ },
96
+ "Summary": {
97
+ "type": "object",
98
+ "required": ["findings_total", "severity_counts"],
99
+ "properties": {
100
+ "findings_total": { "type": "integer", "minimum": 0 },
101
+ "severity_counts": {
102
+ "type": "object",
103
+ "properties": {
104
+ "critical": { "type": "integer", "minimum": 0 },
105
+ "high": { "type": "integer", "minimum": 0 },
106
+ "medium": { "type": "integer", "minimum": 0 },
107
+ "low": { "type": "integer", "minimum": 0 }
108
+ }
109
+ },
110
+ "rules_applied": {
111
+ "type": "array",
112
+ "items": { "type": "string" }
113
+ }
114
+ }
115
+ },
116
+ "Provenance": {
117
+ "type": "object",
118
+ "required": ["record_id", "methods", "inputs", "outputs"],
119
+ "properties": {
120
+ "record_id": { "type": "string" },
121
+ "methods": {
122
+ "type": "array",
123
+ "items": { "type": "string" }
124
+ },
125
+ "inputs": {
126
+ "type": "array",
127
+ "items": { "type": "string" }
128
+ },
129
+ "outputs": {
130
+ "type": "array",
131
+ "items": { "type": "string" }
132
+ },
133
+ "timestamp": { "type": "string", "format": "date-time" }
134
+ }
135
+ }
136
+ }
137
+ }