@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.
- package/.github/workflows/ci.yml +63 -0
- package/LICENSE +21 -0
- package/README.md +37 -0
- package/docs/prov-spec/.github/workflows/ci.yml +68 -0
- package/docs/prov-spec/CHANGELOG.md +69 -0
- package/docs/prov-spec/CODE_OF_CONDUCT.md +129 -0
- package/docs/prov-spec/CONFORMANCE_LEVELS.md +223 -0
- package/docs/prov-spec/CONTRIBUTING.md +145 -0
- package/docs/prov-spec/IMPLEMENTER_CHECKLIST.md +137 -0
- package/docs/prov-spec/LICENSE +21 -0
- package/docs/prov-spec/PRESS_RELEASE.md +74 -0
- package/docs/prov-spec/README.md +182 -0
- package/docs/prov-spec/SETUP.md +135 -0
- package/docs/prov-spec/WHY.md +86 -0
- package/docs/prov-spec/examples/artifact.example.json +14 -0
- package/docs/prov-spec/examples/artifact.ref.example.json +9 -0
- package/docs/prov-spec/examples/evidence.example.json +6 -0
- package/docs/prov-spec/examples/mcp.envelope.example.json +97 -0
- package/docs/prov-spec/examples/mcp.request.example.json +28 -0
- package/docs/prov-spec/examples/prov.record.example.json +35 -0
- package/docs/prov-spec/interop/PROOF_NODE_ENGINE.md +114 -0
- package/docs/prov-spec/spec/MCP_COMPATIBILITY.md +241 -0
- package/docs/prov-spec/spec/PROV_METHODS_CATALOG.md +142 -0
- package/docs/prov-spec/spec/PROV_METHODS_SPEC.md +397 -0
- package/docs/prov-spec/spec/methods.json +213 -0
- package/docs/prov-spec/spec/schemas/artifact.ref.schema.v0.1.json +58 -0
- package/docs/prov-spec/spec/schemas/artifact.schema.v0.1.json +61 -0
- package/docs/prov-spec/spec/schemas/assist.request.schema.v0.1.json +52 -0
- package/docs/prov-spec/spec/schemas/assist.response.schema.v0.1.json +70 -0
- package/docs/prov-spec/spec/schemas/cli.error.schema.v0.1.json +78 -0
- package/docs/prov-spec/spec/schemas/evidence.schema.v0.1.json +37 -0
- package/docs/prov-spec/spec/schemas/mcp.envelope.schema.v0.1.json +141 -0
- package/docs/prov-spec/spec/schemas/mcp.request.schema.v0.1.json +79 -0
- package/docs/prov-spec/spec/schemas/methods.schema.json +93 -0
- package/docs/prov-spec/spec/schemas/prov-capabilities.schema.json +122 -0
- package/docs/prov-spec/spec/schemas/prov.record.schema.v0.1.json +133 -0
- package/docs/prov-spec/spec/vectors/adapter.wrap.envelope_v0_1/expected.json +4 -0
- package/docs/prov-spec/spec/vectors/adapter.wrap.envelope_v0_1/input.json +1 -0
- package/docs/prov-spec/spec/vectors/adapter.wrap.envelope_v0_1/negative/double_wrapped.json +14 -0
- package/docs/prov-spec/spec/vectors/adapter.wrap.envelope_v0_1/negative/wrong_schema_version.json +11 -0
- package/docs/prov-spec/spec/vectors/engine.extract.evidence.json_pointer/expected.json +24 -0
- package/docs/prov-spec/spec/vectors/engine.extract.evidence.json_pointer/input.json +8 -0
- package/docs/prov-spec/spec/vectors/integrity.digest.sha256/expected.json +7 -0
- package/docs/prov-spec/spec/vectors/integrity.digest.sha256/input.json +1 -0
- package/docs/prov-spec/spec/vectors/integrity.digest.sha256/negative/non_hex_chars.json +16 -0
- package/docs/prov-spec/spec/vectors/integrity.digest.sha256/negative/uppercase_hex.json +16 -0
- package/docs/prov-spec/spec/vectors/integrity.digest.sha256/negative/wrong_length.json +16 -0
- package/docs/prov-spec/spec/vectors/method_id_syntax/negative/hyphen_separator.json +8 -0
- package/docs/prov-spec/spec/vectors/method_id_syntax/negative/reserved_namespace.json +8 -0
- package/docs/prov-spec/spec/vectors/method_id_syntax/negative/starts_with_digit.json +8 -0
- package/docs/prov-spec/spec/vectors/method_id_syntax/negative/uppercase.json +8 -0
- package/docs/prov-spec/spec/vectors/method_id_syntax/positive/valid_ids.json +18 -0
- package/docs/prov-spec/tools/python/prov_validator.py +428 -0
- package/examples/a11y-demo-site/.github/workflows/a11y-artifacts.yml +81 -0
- package/examples/a11y-demo-site/.github/workflows/a11y.yml +34 -0
- package/examples/a11y-demo-site/CODE_OF_CONDUCT.md +129 -0
- package/examples/a11y-demo-site/CONTRIBUTING.md +83 -0
- package/examples/a11y-demo-site/LICENSE +21 -0
- package/examples/a11y-demo-site/README.md +155 -0
- package/examples/a11y-demo-site/html/contact.html +15 -0
- package/examples/a11y-demo-site/html/index.html +20 -0
- package/examples/a11y-demo-site/scripts/a11y.sh +20 -0
- package/package.json +26 -0
- package/src/a11y-assist/.github/workflows/publish.yml +52 -0
- package/src/a11y-assist/.github/workflows/test.yml +30 -0
- package/src/a11y-assist/A11Y_ASSIST_TEST_COVERAGE_REQUIREMENTS.md +104 -0
- package/src/a11y-assist/CODE_OF_CONDUCT.md +129 -0
- package/src/a11y-assist/CONTRIBUTING.md +98 -0
- package/src/a11y-assist/ENGINE.md +363 -0
- package/src/a11y-assist/LICENSE +21 -0
- package/src/a11y-assist/PRESS_RELEASE.md +71 -0
- package/src/a11y-assist/QUICKSTART.md +101 -0
- package/src/a11y-assist/README.md +192 -0
- package/src/a11y-assist/RELEASE_NOTES.md +319 -0
- package/src/a11y-assist/a11y_assist/__init__.py +3 -0
- package/src/a11y-assist/a11y_assist/cli.py +599 -0
- package/src/a11y-assist/a11y_assist/from_cli_error.py +149 -0
- package/src/a11y-assist/a11y_assist/guard.py +444 -0
- package/src/a11y-assist/a11y_assist/ingest.py +407 -0
- package/src/a11y-assist/a11y_assist/methods.py +137 -0
- package/src/a11y-assist/a11y_assist/parse_raw.py +71 -0
- package/src/a11y-assist/a11y_assist/profiles/__init__.py +29 -0
- package/src/a11y-assist/a11y_assist/profiles/cognitive_load.py +245 -0
- package/src/a11y-assist/a11y_assist/profiles/cognitive_load_render.py +86 -0
- package/src/a11y-assist/a11y_assist/profiles/dyslexia.py +144 -0
- package/src/a11y-assist/a11y_assist/profiles/dyslexia_render.py +77 -0
- package/src/a11y-assist/a11y_assist/profiles/plain_language.py +119 -0
- package/src/a11y-assist/a11y_assist/profiles/plain_language_render.py +66 -0
- package/src/a11y-assist/a11y_assist/profiles/screen_reader.py +348 -0
- package/src/a11y-assist/a11y_assist/profiles/screen_reader_render.py +89 -0
- package/src/a11y-assist/a11y_assist/render.py +95 -0
- package/src/a11y-assist/a11y_assist/schemas/assist.request.schema.v0.1.json +52 -0
- package/src/a11y-assist/a11y_assist/schemas/assist.response.schema.v0.1.json +70 -0
- package/src/a11y-assist/a11y_assist/schemas/cli.error.schema.v0.1.json +78 -0
- package/src/a11y-assist/a11y_assist/storage.py +31 -0
- package/src/a11y-assist/pyproject.toml +60 -0
- package/src/a11y-assist/tests/__init__.py +1 -0
- package/src/a11y-assist/tests/fixtures/base_inputs/cli_error_high.json +18 -0
- package/src/a11y-assist/tests/fixtures/base_inputs/cli_error_medium.json +16 -0
- package/src/a11y-assist/tests/fixtures/base_inputs/raw_text_low.txt +3 -0
- package/src/a11y-assist/tests/fixtures/cli_error_good.json +9 -0
- package/src/a11y-assist/tests/fixtures/cli_error_missing_id.json +7 -0
- package/src/a11y-assist/tests/fixtures/cli_error_string_format.json +7 -0
- package/src/a11y-assist/tests/fixtures/expected/cognitive_load_high.txt +20 -0
- package/src/a11y-assist/tests/fixtures/expected/dyslexia_high.txt +20 -0
- package/src/a11y-assist/tests/fixtures/expected/lowvision_high.txt +18 -0
- package/src/a11y-assist/tests/fixtures/expected/plain_language_high.txt +14 -0
- package/src/a11y-assist/tests/fixtures/expected/screen_reader_high.txt +19 -0
- package/src/a11y-assist/tests/fixtures/golden_screen_reader_cli_error.txt +16 -0
- package/src/a11y-assist/tests/fixtures/golden_screen_reader_raw_no_id.txt +14 -0
- package/src/a11y-assist/tests/fixtures/golden_screen_reader_raw_with_id.txt +14 -0
- package/src/a11y-assist/tests/fixtures/raw_good.txt +11 -0
- package/src/a11y-assist/tests/fixtures/raw_no_id.txt +2 -0
- package/src/a11y-assist/tests/test_cognitive_load.py +469 -0
- package/src/a11y-assist/tests/test_dyslexia.py +337 -0
- package/src/a11y-assist/tests/test_explain.py +74 -0
- package/src/a11y-assist/tests/test_golden.py +127 -0
- package/src/a11y-assist/tests/test_guard.py +819 -0
- package/src/a11y-assist/tests/test_guard_integration.py +457 -0
- package/src/a11y-assist/tests/test_ingest.py +311 -0
- package/src/a11y-assist/tests/test_methods_metadata.py +236 -0
- package/src/a11y-assist/tests/test_plain_language.py +348 -0
- package/src/a11y-assist/tests/test_render.py +117 -0
- package/src/a11y-assist/tests/test_screen_reader.py +703 -0
- package/src/a11y-assist/tests/test_storage_last.py +61 -0
- package/src/a11y-assist/tests/test_triage.py +86 -0
- package/src/a11y-ci/.github/workflows/ci.yml +43 -0
- package/src/a11y-ci/.github/workflows/test.yml +30 -0
- package/src/a11y-ci/A11Y_CI_TEST_COVERAGE_REQUIREMENTS.md +94 -0
- package/src/a11y-ci/CODE_OF_CONDUCT.md +129 -0
- package/src/a11y-ci/CONTRIBUTING.md +142 -0
- package/src/a11y-ci/LICENSE +21 -0
- package/src/a11y-ci/README.md +105 -0
- package/src/a11y-ci/a11y_ci/__init__.py +3 -0
- package/src/a11y-ci/a11y_ci/allowlist.py +83 -0
- package/src/a11y-ci/a11y_ci/cli.py +145 -0
- package/src/a11y-ci/a11y_ci/gate.py +131 -0
- package/src/a11y-ci/a11y_ci/render.py +48 -0
- package/src/a11y-ci/a11y_ci/schemas/allowlist.schema.json +24 -0
- package/src/a11y-ci/a11y_ci/scorecard.py +99 -0
- package/src/a11y-ci/npm/package.json +35 -0
- package/src/a11y-ci/pyproject.toml +64 -0
- package/src/a11y-ci/tests/__init__.py +1 -0
- package/src/a11y-ci/tests/fixtures/allowlist_expired.json +10 -0
- package/src/a11y-ci/tests/fixtures/allowlist_ok.json +10 -0
- package/src/a11y-ci/tests/fixtures/baseline_ok.json +7 -0
- package/src/a11y-ci/tests/fixtures/current_fail.json +6 -0
- package/src/a11y-ci/tests/fixtures/current_ok.json +6 -0
- package/src/a11y-ci/tests/fixtures/current_regresses.json +7 -0
- package/src/a11y-ci/tests/test_gate.py +134 -0
- package/src/a11y-evidence-engine/.github/workflows/ci.yml +53 -0
- package/src/a11y-evidence-engine/CODE_OF_CONDUCT.md +129 -0
- package/src/a11y-evidence-engine/CONTRIBUTING.md +128 -0
- package/src/a11y-evidence-engine/LICENSE +21 -0
- package/src/a11y-evidence-engine/README.md +71 -0
- package/src/a11y-evidence-engine/bin/a11y-engine.js +11 -0
- package/src/a11y-evidence-engine/fixtures/bad/button-no-name.html +30 -0
- package/src/a11y-evidence-engine/fixtures/bad/img-missing-alt.html +19 -0
- package/src/a11y-evidence-engine/fixtures/bad/input-missing-label.html +26 -0
- package/src/a11y-evidence-engine/fixtures/bad/missing-lang.html +11 -0
- package/src/a11y-evidence-engine/fixtures/good/index.html +29 -0
- package/src/a11y-evidence-engine/package-lock.json +109 -0
- package/src/a11y-evidence-engine/package.json +45 -0
- package/src/a11y-evidence-engine/src/cli.js +74 -0
- package/src/a11y-evidence-engine/src/evidence/canonicalize.js +52 -0
- package/src/a11y-evidence-engine/src/evidence/json_pointer.js +34 -0
- package/src/a11y-evidence-engine/src/evidence/prov_emit.js +153 -0
- package/src/a11y-evidence-engine/src/fswalk.js +56 -0
- package/src/a11y-evidence-engine/src/html_parse.js +117 -0
- package/src/a11y-evidence-engine/src/ids.js +53 -0
- package/src/a11y-evidence-engine/src/rules/document_missing_lang.js +50 -0
- package/src/a11y-evidence-engine/src/rules/form_control_missing_label.js +105 -0
- package/src/a11y-evidence-engine/src/rules/img_missing_alt.js +77 -0
- package/src/a11y-evidence-engine/src/rules/index.js +37 -0
- package/src/a11y-evidence-engine/src/rules/interactive_missing_name.js +129 -0
- package/src/a11y-evidence-engine/src/scan.js +128 -0
- package/src/a11y-evidence-engine/test/scan.test.js +149 -0
- package/src/a11y-evidence-engine/test/vectors.test.js +200 -0
- package/src/a11y-lint/.github/workflows/ci.yml +46 -0
- package/src/a11y-lint/.github/workflows/test.yml +34 -0
- package/src/a11y-lint/CODE_OF_CONDUCT.md +129 -0
- package/src/a11y-lint/CONTRIBUTING.md +70 -0
- package/src/a11y-lint/GOVERNANCE.md +57 -0
- package/src/a11y-lint/LICENSE +21 -0
- package/src/a11y-lint/PRESS_RELEASE.md +50 -0
- package/src/a11y-lint/README.md +276 -0
- package/src/a11y-lint/RELEASE_NOTES.md +57 -0
- package/src/a11y-lint/RELEASING.md +57 -0
- package/src/a11y-lint/a11y_lint/__init__.py +64 -0
- package/src/a11y-lint/a11y_lint/cli.py +319 -0
- package/src/a11y-lint/a11y_lint/errors.py +252 -0
- package/src/a11y-lint/a11y_lint/render.py +293 -0
- package/src/a11y-lint/a11y_lint/report_md.py +289 -0
- package/src/a11y-lint/a11y_lint/scan_cli_text.py +434 -0
- package/src/a11y-lint/a11y_lint/schemas/cli.error.schema.v0.1.json +83 -0
- package/src/a11y-lint/a11y_lint/scorecard.py +244 -0
- package/src/a11y-lint/a11y_lint/validate.py +225 -0
- package/src/a11y-lint/pyproject.toml +75 -0
- package/src/a11y-lint/tests/__init__.py +1 -0
- package/src/a11y-lint/tests/test_cli.py +200 -0
- package/src/a11y-lint/tests/test_errors.py +188 -0
- package/src/a11y-lint/tests/test_render.py +202 -0
- package/src/a11y-lint/tests/test_report_md.py +188 -0
- package/src/a11y-lint/tests/test_scan_cli_text.py +290 -0
- package/src/a11y-lint/tests/test_scorecard.py +195 -0
- package/src/a11y-lint/tests/test_validate.py +257 -0
- package/src/a11y-mcp-tools/.github/workflows/ci.yml +53 -0
- package/src/a11y-mcp-tools/CODE_OF_CONDUCT.md +129 -0
- package/src/a11y-mcp-tools/CONTRIBUTING.md +136 -0
- package/src/a11y-mcp-tools/LICENSE +21 -0
- package/src/a11y-mcp-tools/PROV_METHODS_CATALOG.md +104 -0
- package/src/a11y-mcp-tools/README.md +168 -0
- package/src/a11y-mcp-tools/bin/cli.js +452 -0
- package/src/a11y-mcp-tools/bin/server.js +244 -0
- package/src/a11y-mcp-tools/fixtures/requests/a11y.diagnose.ok.json +27 -0
- package/src/a11y-mcp-tools/fixtures/requests/a11y.evidence.ok.json +25 -0
- package/src/a11y-mcp-tools/fixtures/responses/a11y.diagnose.ok.json +139 -0
- package/src/a11y-mcp-tools/fixtures/responses/a11y.diagnose.provenance_fail.json +13 -0
- package/src/a11y-mcp-tools/fixtures/responses/a11y.evidence.ok.json +88 -0
- package/src/a11y-mcp-tools/package-lock.json +189 -0
- package/src/a11y-mcp-tools/package.json +49 -0
- package/src/a11y-mcp-tools/src/envelope.js +197 -0
- package/src/a11y-mcp-tools/src/index.js +9 -0
- package/src/a11y-mcp-tools/src/schemas/artifact.js +85 -0
- package/src/a11y-mcp-tools/src/schemas/diagnosis.schema.v0.1.json +137 -0
- package/src/a11y-mcp-tools/src/schemas/envelope.schema.v0.1.json +108 -0
- package/src/a11y-mcp-tools/src/schemas/evidence.bundle.schema.v0.1.json +129 -0
- package/src/a11y-mcp-tools/src/schemas/evidence.js +97 -0
- package/src/a11y-mcp-tools/src/schemas/index.js +11 -0
- package/src/a11y-mcp-tools/src/schemas/provenance.js +140 -0
- package/src/a11y-mcp-tools/src/schemas/tools/a11y.diagnose.request.schema.v0.1.json +77 -0
- package/src/a11y-mcp-tools/src/schemas/tools/a11y.diagnose.response.schema.v0.1.json +50 -0
- package/src/a11y-mcp-tools/src/schemas/tools/a11y.evidence.request.schema.v0.1.json +120 -0
- package/src/a11y-mcp-tools/src/schemas/tools/a11y.evidence.response.schema.v0.1.json +50 -0
- package/src/a11y-mcp-tools/src/tools/diagnose.js +597 -0
- package/src/a11y-mcp-tools/src/tools/evidence.js +481 -0
- package/src/a11y-mcp-tools/src/tools/index.js +10 -0
- package/src/a11y-mcp-tools/test/contract.test.mjs +154 -0
- package/src/a11y-mcp-tools/test/diagnose.test.js +485 -0
- package/src/a11y-mcp-tools/test/evidence.test.js +183 -0
- package/src/a11y-mcp-tools/test/schema.test.js +327 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://mcp-tool-shop.github.io/schemas/mcp.envelope.v0.1.json",
|
|
4
|
+
"title": "MCP Envelope v0.1",
|
|
5
|
+
"description": "Standard request/response envelope for MCP tools",
|
|
6
|
+
"oneOf": [
|
|
7
|
+
{ "$ref": "#/$defs/Request" },
|
|
8
|
+
{ "$ref": "#/$defs/Response" },
|
|
9
|
+
{ "$ref": "#/$defs/ErrorResponse" }
|
|
10
|
+
],
|
|
11
|
+
"$defs": {
|
|
12
|
+
"EnvelopeHeader": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"required": ["envelope", "request_id", "tool"],
|
|
15
|
+
"properties": {
|
|
16
|
+
"envelope": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"const": "mcp.envelope_v0_1"
|
|
19
|
+
},
|
|
20
|
+
"request_id": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"pattern": "^req_[a-zA-Z0-9]+$",
|
|
23
|
+
"description": "Unique request identifier"
|
|
24
|
+
},
|
|
25
|
+
"tool": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "Tool name (e.g., a11y.evidence, a11y.diagnose)"
|
|
28
|
+
},
|
|
29
|
+
"client": {
|
|
30
|
+
"type": "object",
|
|
31
|
+
"properties": {
|
|
32
|
+
"name": { "type": "string" },
|
|
33
|
+
"version": { "type": "string" }
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"Request": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"required": ["mcp", "input"],
|
|
41
|
+
"properties": {
|
|
42
|
+
"mcp": { "$ref": "#/$defs/EnvelopeHeader" },
|
|
43
|
+
"input": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"description": "Tool-specific input parameters"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"Response": {
|
|
50
|
+
"type": "object",
|
|
51
|
+
"required": ["mcp", "result"],
|
|
52
|
+
"properties": {
|
|
53
|
+
"mcp": {
|
|
54
|
+
"allOf": [
|
|
55
|
+
{ "$ref": "#/$defs/EnvelopeHeader" },
|
|
56
|
+
{
|
|
57
|
+
"type": "object",
|
|
58
|
+
"required": ["ok"],
|
|
59
|
+
"properties": {
|
|
60
|
+
"ok": { "type": "boolean", "const": true }
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
"result": {
|
|
66
|
+
"type": "object",
|
|
67
|
+
"description": "Tool-specific result"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"ErrorResponse": {
|
|
72
|
+
"type": "object",
|
|
73
|
+
"required": ["mcp", "error"],
|
|
74
|
+
"properties": {
|
|
75
|
+
"mcp": {
|
|
76
|
+
"allOf": [
|
|
77
|
+
{ "$ref": "#/$defs/EnvelopeHeader" },
|
|
78
|
+
{
|
|
79
|
+
"type": "object",
|
|
80
|
+
"required": ["ok"],
|
|
81
|
+
"properties": {
|
|
82
|
+
"ok": { "type": "boolean", "const": false }
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
"error": {
|
|
88
|
+
"type": "object",
|
|
89
|
+
"required": ["code", "message"],
|
|
90
|
+
"properties": {
|
|
91
|
+
"code": {
|
|
92
|
+
"type": "string",
|
|
93
|
+
"description": "Machine-readable error code"
|
|
94
|
+
},
|
|
95
|
+
"message": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"description": "Human-readable error message"
|
|
98
|
+
},
|
|
99
|
+
"fix": {
|
|
100
|
+
"type": "string",
|
|
101
|
+
"description": "Suggested fix for the error"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://mcp-tool-shop.github.io/schemas/evidence.bundle.v0.1.json",
|
|
4
|
+
"title": "Evidence Bundle",
|
|
5
|
+
"description": "Tamper-evident bundle with artifacts and provenance",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["bundle_id", "artifacts", "provenance"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"bundle_id": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"pattern": "^bundle:[a-z0-9_-]+:[a-f0-9]{8}$",
|
|
12
|
+
"description": "Unique bundle identifier"
|
|
13
|
+
},
|
|
14
|
+
"artifacts": {
|
|
15
|
+
"type": "array",
|
|
16
|
+
"items": { "$ref": "#/$defs/Artifact" },
|
|
17
|
+
"minItems": 1
|
|
18
|
+
},
|
|
19
|
+
"provenance": { "$ref": "#/$defs/Provenance" },
|
|
20
|
+
"environment": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"description": "Optional capture environment info",
|
|
23
|
+
"properties": {
|
|
24
|
+
"os": {
|
|
25
|
+
"oneOf": [
|
|
26
|
+
{ "type": "string" },
|
|
27
|
+
{
|
|
28
|
+
"type": "object",
|
|
29
|
+
"properties": {
|
|
30
|
+
"platform": { "type": "string" },
|
|
31
|
+
"arch": { "type": "string" }
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"node": { "type": "string" },
|
|
37
|
+
"browser": { "type": "string" },
|
|
38
|
+
"tool_versions": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"additionalProperties": { "type": "string" }
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"additionalProperties": true
|
|
44
|
+
},
|
|
45
|
+
"labels": {
|
|
46
|
+
"type": "array",
|
|
47
|
+
"items": { "type": "string" },
|
|
48
|
+
"description": "User-supplied classification labels"
|
|
49
|
+
},
|
|
50
|
+
"created_at": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"format": "date-time",
|
|
53
|
+
"description": "Bundle creation timestamp"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"$defs": {
|
|
57
|
+
"Artifact": {
|
|
58
|
+
"type": "object",
|
|
59
|
+
"required": ["artifact_id", "media_type", "digest"],
|
|
60
|
+
"properties": {
|
|
61
|
+
"artifact_id": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"pattern": "^artifact:[a-z]+:[a-z0-9_-]+$"
|
|
64
|
+
},
|
|
65
|
+
"media_type": { "type": "string" },
|
|
66
|
+
"locator": {
|
|
67
|
+
"oneOf": [
|
|
68
|
+
{ "type": "string", "format": "uri" },
|
|
69
|
+
{
|
|
70
|
+
"type": "object",
|
|
71
|
+
"properties": {
|
|
72
|
+
"kind": { "type": "string", "enum": ["file", "derived", "url"] },
|
|
73
|
+
"path": { "type": "string" },
|
|
74
|
+
"from": { "type": "string" },
|
|
75
|
+
"url": { "type": "string", "format": "uri" }
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
"size_bytes": { "type": "integer", "minimum": 0 },
|
|
81
|
+
"digest": { "$ref": "#/$defs/Digest" },
|
|
82
|
+
"labels": {
|
|
83
|
+
"type": "array",
|
|
84
|
+
"items": { "type": "string" }
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"Digest": {
|
|
89
|
+
"type": "object",
|
|
90
|
+
"required": ["alg", "hex"],
|
|
91
|
+
"properties": {
|
|
92
|
+
"alg": { "type": "string", "enum": ["sha256"] },
|
|
93
|
+
"hex": { "type": "string", "pattern": "^[a-f0-9]{64}$" }
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"Provenance": {
|
|
97
|
+
"type": "object",
|
|
98
|
+
"required": ["record_id", "methods", "inputs", "outputs"],
|
|
99
|
+
"properties": {
|
|
100
|
+
"record_id": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"pattern": "^prov:[a-z]+:[a-z0-9_-]+$"
|
|
103
|
+
},
|
|
104
|
+
"methods": {
|
|
105
|
+
"type": "array",
|
|
106
|
+
"items": { "type": "string" },
|
|
107
|
+
"minItems": 1
|
|
108
|
+
},
|
|
109
|
+
"inputs": {
|
|
110
|
+
"type": "array",
|
|
111
|
+
"items": { "type": "string" }
|
|
112
|
+
},
|
|
113
|
+
"outputs": {
|
|
114
|
+
"type": "array",
|
|
115
|
+
"items": { "type": "string" }
|
|
116
|
+
},
|
|
117
|
+
"timestamp": { "type": "string", "format": "date-time" },
|
|
118
|
+
"verified": { "type": "boolean" },
|
|
119
|
+
"agent": {
|
|
120
|
+
"type": "object",
|
|
121
|
+
"properties": {
|
|
122
|
+
"name": { "type": "string" },
|
|
123
|
+
"version": { "type": "string" }
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Evidence anchor schema and utilities.
|
|
5
|
+
*
|
|
6
|
+
* An evidence anchor points to a specific location within an artifact:
|
|
7
|
+
* - JSON Pointer for structured data
|
|
8
|
+
* - CSS selector for DOM elements
|
|
9
|
+
* - Line span for source files
|
|
10
|
+
* - Snippet for context
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Create an evidence anchor.
|
|
15
|
+
*
|
|
16
|
+
* @param {Object} params
|
|
17
|
+
* @param {string} params.artifactId - Reference to artifact
|
|
18
|
+
* @param {string} [params.jsonPointer] - JSON Pointer (RFC 6901)
|
|
19
|
+
* @param {string} [params.selector] - CSS selector
|
|
20
|
+
* @param {Object} [params.lineSpan] - { start, end }
|
|
21
|
+
* @param {string} [params.snippet] - Context snippet
|
|
22
|
+
* @returns {Object} Evidence anchor
|
|
23
|
+
*/
|
|
24
|
+
function createEvidenceAnchor({
|
|
25
|
+
artifactId,
|
|
26
|
+
jsonPointer,
|
|
27
|
+
selector,
|
|
28
|
+
lineSpan,
|
|
29
|
+
snippet,
|
|
30
|
+
}) {
|
|
31
|
+
const anchor = {
|
|
32
|
+
artifact_id: artifactId,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
if (jsonPointer) anchor.json_pointer = jsonPointer;
|
|
36
|
+
if (selector) anchor.selector = selector;
|
|
37
|
+
if (lineSpan) anchor.line_span = lineSpan;
|
|
38
|
+
if (snippet) anchor.snippet = snippet;
|
|
39
|
+
|
|
40
|
+
return anchor;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Create a JSON Pointer from a node index.
|
|
45
|
+
*
|
|
46
|
+
* @param {number} index - Node index in flat array
|
|
47
|
+
* @returns {string} JSON Pointer
|
|
48
|
+
*/
|
|
49
|
+
function nodePointer(index) {
|
|
50
|
+
return `/nodes/${index}`;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Create a JSON Pointer for a DOM path.
|
|
55
|
+
*
|
|
56
|
+
* @param {string[]} path - Array of element names/indices
|
|
57
|
+
* @returns {string} JSON Pointer
|
|
58
|
+
*/
|
|
59
|
+
function domPointer(path) {
|
|
60
|
+
return "/dom/" + path.map(escapePointerSegment).join("/");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Escape a JSON Pointer segment.
|
|
65
|
+
*/
|
|
66
|
+
function escapePointerSegment(str) {
|
|
67
|
+
return String(str).replace(/~/g, "~0").replace(/\//g, "~1");
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Extract a snippet from content around a position.
|
|
72
|
+
*
|
|
73
|
+
* @param {string} content - Full content
|
|
74
|
+
* @param {number} start - Start position
|
|
75
|
+
* @param {number} [maxLength=100] - Maximum snippet length
|
|
76
|
+
* @returns {string} Snippet
|
|
77
|
+
*/
|
|
78
|
+
function extractSnippet(content, start, maxLength = 100) {
|
|
79
|
+
const halfLen = Math.floor(maxLength / 2);
|
|
80
|
+
const snippetStart = Math.max(0, start - halfLen);
|
|
81
|
+
const snippetEnd = Math.min(content.length, start + halfLen);
|
|
82
|
+
|
|
83
|
+
let snippet = content.slice(snippetStart, snippetEnd);
|
|
84
|
+
|
|
85
|
+
if (snippetStart > 0) snippet = "..." + snippet;
|
|
86
|
+
if (snippetEnd < content.length) snippet = snippet + "...";
|
|
87
|
+
|
|
88
|
+
return snippet;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
module.exports = {
|
|
92
|
+
createEvidenceAnchor,
|
|
93
|
+
nodePointer,
|
|
94
|
+
domPointer,
|
|
95
|
+
escapePointerSegment,
|
|
96
|
+
extractSnippet,
|
|
97
|
+
};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Provenance record utilities.
|
|
5
|
+
*
|
|
6
|
+
* Creates prov-spec compatible records for evidence capture and diagnosis.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const crypto = require("crypto");
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Create a provenance record for evidence capture.
|
|
13
|
+
*
|
|
14
|
+
* @param {Object} params
|
|
15
|
+
* @param {string[]} params.methods - Method IDs applied
|
|
16
|
+
* @param {string[]} params.inputs - Input paths/IDs
|
|
17
|
+
* @param {string[]} params.outputs - Output artifact IDs
|
|
18
|
+
* @param {string} [params.agentName] - Agent name
|
|
19
|
+
* @param {string} [params.agentVersion] - Agent version
|
|
20
|
+
* @returns {Object} Provenance record
|
|
21
|
+
*/
|
|
22
|
+
function createProvenanceRecord({
|
|
23
|
+
methods,
|
|
24
|
+
inputs,
|
|
25
|
+
outputs,
|
|
26
|
+
agentName = "a11y-mcp-tools",
|
|
27
|
+
agentVersion = "0.1.0",
|
|
28
|
+
}) {
|
|
29
|
+
const recordId = `prov:record:${crypto.randomUUID()}`;
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
record_id: recordId,
|
|
33
|
+
methods,
|
|
34
|
+
inputs,
|
|
35
|
+
outputs,
|
|
36
|
+
verified: false,
|
|
37
|
+
timestamp: new Date().toISOString(),
|
|
38
|
+
agent: {
|
|
39
|
+
name: agentName,
|
|
40
|
+
version: agentVersion,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Create a full prov.record.v0.1 structure.
|
|
47
|
+
*
|
|
48
|
+
* @param {Object} params
|
|
49
|
+
* @param {string} params.methodId - Primary method ID
|
|
50
|
+
* @param {Object[]} params.inputArtifacts - Input artifact refs
|
|
51
|
+
* @param {Object[]} params.outputArtifacts - Output artifact refs
|
|
52
|
+
* @param {string} [params.agentName]
|
|
53
|
+
* @param {string} [params.agentVersion]
|
|
54
|
+
* @returns {Object} prov.record.v0.1 structure
|
|
55
|
+
*/
|
|
56
|
+
function createProvRecordV01({
|
|
57
|
+
methodId,
|
|
58
|
+
inputArtifacts,
|
|
59
|
+
outputArtifacts,
|
|
60
|
+
agentName = "a11y-mcp-tools",
|
|
61
|
+
agentVersion = "0.1.0",
|
|
62
|
+
}) {
|
|
63
|
+
return {
|
|
64
|
+
"prov.record.v0.1": {
|
|
65
|
+
method_id: methodId,
|
|
66
|
+
timestamp: new Date().toISOString(),
|
|
67
|
+
inputs: inputArtifacts.map((a) => ({
|
|
68
|
+
"artifact.v0.1": {
|
|
69
|
+
name: a.name || a.artifact_id,
|
|
70
|
+
uri: a.uri || `artifact://${a.artifact_id}`,
|
|
71
|
+
digest: a.digest,
|
|
72
|
+
},
|
|
73
|
+
})),
|
|
74
|
+
outputs: outputArtifacts.map((a) => ({
|
|
75
|
+
"artifact.v0.1": {
|
|
76
|
+
name: a.name || a.artifact_id,
|
|
77
|
+
content: a.content,
|
|
78
|
+
digest: a.digest,
|
|
79
|
+
},
|
|
80
|
+
})),
|
|
81
|
+
agent: {
|
|
82
|
+
name: agentName,
|
|
83
|
+
version: agentVersion,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Locked Method ID Catalog (v0.1)
|
|
91
|
+
*
|
|
92
|
+
* These IDs are stable and MUST NOT change within a major version.
|
|
93
|
+
* See: https://github.com/mcp-tool-shop-org/prov-spec
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Method IDs for envelope/adapter operations.
|
|
98
|
+
*/
|
|
99
|
+
const ADAPTER_METHODS = {
|
|
100
|
+
// Wrap request/response in MCP envelope
|
|
101
|
+
WRAP_ENVELOPE: "adapter.wrap.envelope_v0_1",
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Method IDs for evidence capture.
|
|
106
|
+
*/
|
|
107
|
+
const EVIDENCE_METHODS = {
|
|
108
|
+
// Capture raw HTML with canonicalization
|
|
109
|
+
CAPTURE_HTML: "engine.capture.html_canonicalize_v0_1",
|
|
110
|
+
// Extract DOM snapshot for analysis
|
|
111
|
+
CAPTURE_DOM: "engine.capture.dom_snapshot_v0_1",
|
|
112
|
+
// Generic file capture
|
|
113
|
+
CAPTURE_FILE: "engine.capture.file_v0_1",
|
|
114
|
+
// SHA-256 integrity verification
|
|
115
|
+
INTEGRITY_SHA256: "adapter.integrity.sha256_v0_1",
|
|
116
|
+
// Provenance record creation
|
|
117
|
+
PROVENANCE_RECORD: "adapter.provenance.record_v0_1",
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Method IDs for diagnosis.
|
|
122
|
+
*/
|
|
123
|
+
const DIAGNOSE_METHODS = {
|
|
124
|
+
// WCAG rule evaluation engine
|
|
125
|
+
WCAG_RULES: "engine.diagnose.wcag_rules_v0_1",
|
|
126
|
+
// JSON Pointer evidence extraction
|
|
127
|
+
EXTRACT_POINTER: "engine.extract.evidence.json_pointer_v0_1",
|
|
128
|
+
// CSS selector evidence extraction
|
|
129
|
+
EXTRACT_SELECTOR: "engine.extract.evidence.selector_v0_1",
|
|
130
|
+
// Fix guidance generation
|
|
131
|
+
GENERATE_FIX: "engine.generate.fix_guidance_v0_1",
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
module.exports = {
|
|
135
|
+
createProvenanceRecord,
|
|
136
|
+
createProvRecordV01,
|
|
137
|
+
ADAPTER_METHODS,
|
|
138
|
+
EVIDENCE_METHODS,
|
|
139
|
+
DIAGNOSE_METHODS,
|
|
140
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://mcp-tool-shop.github.io/schemas/tools/a11y.diagnose.request.schema.v0.1.json",
|
|
4
|
+
"title": "Tool Request Schema: a11y.diagnose v0.1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["mcp", "input"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"mcp": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"additionalProperties": false,
|
|
12
|
+
"required": ["envelope", "request_id", "tool", "client"],
|
|
13
|
+
"properties": {
|
|
14
|
+
"envelope": { "const": "mcp.envelope_v0_1" },
|
|
15
|
+
"request_id": { "type": "string", "minLength": 1 },
|
|
16
|
+
"tool": { "const": "a11y.diagnose" },
|
|
17
|
+
"client": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"additionalProperties": false,
|
|
20
|
+
"required": ["name", "version"],
|
|
21
|
+
"properties": {
|
|
22
|
+
"name": { "type": "string", "minLength": 1 },
|
|
23
|
+
"version": { "type": "string", "minLength": 1 }
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"not": {
|
|
28
|
+
"anyOf": [
|
|
29
|
+
{ "required": ["ok"] }
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"input": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"required": ["bundle_id", "artifacts", "profile"],
|
|
37
|
+
"properties": {
|
|
38
|
+
"bundle_id": { "type": "string", "minLength": 1 },
|
|
39
|
+
"artifacts": {
|
|
40
|
+
"type": "array",
|
|
41
|
+
"minItems": 1,
|
|
42
|
+
"items": { "type": "string", "minLength": 1 }
|
|
43
|
+
},
|
|
44
|
+
"profile": { "type": "string", "minLength": 1 },
|
|
45
|
+
"rules": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"additionalProperties": false,
|
|
48
|
+
"properties": {
|
|
49
|
+
"include": { "type": "array", "items": { "type": "string" }, "default": [] },
|
|
50
|
+
"exclude": { "type": "array", "items": { "type": "string" }, "default": [] }
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"output": {
|
|
54
|
+
"type": "object",
|
|
55
|
+
"additionalProperties": false,
|
|
56
|
+
"properties": {
|
|
57
|
+
"include_fix_guidance": { "type": "boolean", "default": true },
|
|
58
|
+
"include_evidence": { "type": "boolean", "default": true }
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"integrity": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"additionalProperties": false,
|
|
64
|
+
"properties": {
|
|
65
|
+
"verify_provenance": { "type": "boolean", "default": true }
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"not": {
|
|
72
|
+
"anyOf": [
|
|
73
|
+
{ "required": ["result"] },
|
|
74
|
+
{ "required": ["error"] }
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://mcp-tool-shop.github.io/schemas/tools/a11y.diagnose.response.schema.v0.1.json",
|
|
4
|
+
"title": "Tool Response Schema: a11y.diagnose v0.1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["mcp"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"mcp": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"additionalProperties": false,
|
|
12
|
+
"required": ["envelope", "request_id", "tool", "ok"],
|
|
13
|
+
"properties": {
|
|
14
|
+
"envelope": { "const": "mcp.envelope_v0_1" },
|
|
15
|
+
"request_id": { "type": "string", "minLength": 1 },
|
|
16
|
+
"tool": { "const": "a11y.diagnose" },
|
|
17
|
+
"ok": { "type": "boolean" }
|
|
18
|
+
},
|
|
19
|
+
"not": { "required": ["client"] }
|
|
20
|
+
},
|
|
21
|
+
"result": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"additionalProperties": false,
|
|
24
|
+
"required": ["diagnosis"],
|
|
25
|
+
"properties": {
|
|
26
|
+
"diagnosis": { "$ref": "https://mcp-tool-shop.github.io/schemas/diagnosis.v0.1.json" }
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"error": {
|
|
30
|
+
"type": "object",
|
|
31
|
+
"additionalProperties": false,
|
|
32
|
+
"required": ["code", "message", "fix"],
|
|
33
|
+
"properties": {
|
|
34
|
+
"code": { "type": "string", "minLength": 1 },
|
|
35
|
+
"message": { "type": "string", "minLength": 1 },
|
|
36
|
+
"fix": { "type": "string", "minLength": 1 }
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"allOf": [
|
|
41
|
+
{
|
|
42
|
+
"if": { "properties": { "mcp": { "properties": { "ok": { "const": true } } } } },
|
|
43
|
+
"then": { "required": ["result"], "not": { "required": ["error"] } }
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"if": { "properties": { "mcp": { "properties": { "ok": { "const": false } } } } },
|
|
47
|
+
"then": { "required": ["error"], "not": { "required": ["result"] } }
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|