@reticular/speakable 1.1.0 → 1.2.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/README.md +29 -0
- package/dist/cli.js +17 -2
- package/dist/cli.js.map +1 -1
- package/dist/mcp.js +7 -0
- package/dist/mcp.js.map +1 -1
- package/package.json +12 -4
package/README.md
CHANGED
|
@@ -159,6 +159,35 @@ Verify that the accessibility model serializes and deserializes consistently:
|
|
|
159
159
|
speakable page.html --validate
|
|
160
160
|
```
|
|
161
161
|
|
|
162
|
+
## MCP Integration (AI Assistants)
|
|
163
|
+
|
|
164
|
+
Speakable includes a Model Context Protocol (MCP) server that lets AI coding assistants analyze accessibility in real-time. Ask your assistant "check if this component is accessible" and it calls Speakable automatically.
|
|
165
|
+
|
|
166
|
+
### Setup
|
|
167
|
+
|
|
168
|
+
Add to your MCP config (Kiro, VS Code, Cursor, Claude Desktop, Windsurf):
|
|
169
|
+
|
|
170
|
+
```json
|
|
171
|
+
{
|
|
172
|
+
"mcpServers": {
|
|
173
|
+
"speakable": {
|
|
174
|
+
"command": "npx",
|
|
175
|
+
"args": ["-y", "@reticular/speakable-mcp"]
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Available Tools
|
|
182
|
+
|
|
183
|
+
| Tool | Description |
|
|
184
|
+
|------|-------------|
|
|
185
|
+
| `analyze_html` | Predict screen reader output for NVDA, JAWS, and VoiceOver |
|
|
186
|
+
| `audit_html` | Generate accessibility audit report with issues and remediation |
|
|
187
|
+
| `diff_html` | Compare two HTML versions for accessibility regressions |
|
|
188
|
+
|
|
189
|
+
All tools run locally — no network requests, no data leaves your machine. See the [MCP Integration docs](https://getspeakable.dev/docs/mcp-integration) for full setup instructions.
|
|
190
|
+
|
|
162
191
|
## CI/CD Integration
|
|
163
192
|
|
|
164
193
|
### GitHub Actions
|
package/dist/cli.js
CHANGED
|
@@ -240,8 +240,15 @@ var ParsingError = class extends Error {
|
|
|
240
240
|
this.name = "ParsingError";
|
|
241
241
|
}
|
|
242
242
|
};
|
|
243
|
+
var MAX_INPUT_SIZE = 10 * 1024 * 1024;
|
|
243
244
|
function parseHTML(html) {
|
|
244
245
|
const warnings = [];
|
|
246
|
+
const inputSize = Buffer.byteLength(html, "utf-8");
|
|
247
|
+
if (inputSize > MAX_INPUT_SIZE) {
|
|
248
|
+
throw new ParsingError(
|
|
249
|
+
`Input exceeds maximum size of ${MAX_INPUT_SIZE / (1024 * 1024)} MB (received ${(inputSize / (1024 * 1024)).toFixed(1)} MB). Use CSS selectors to analyze specific sections of large documents.`
|
|
250
|
+
);
|
|
251
|
+
}
|
|
245
252
|
try {
|
|
246
253
|
const dom = new JSDOM(html, {
|
|
247
254
|
contentType: "text/html",
|
|
@@ -2554,14 +2561,22 @@ function processHTML(html, options, diffHTML) {
|
|
|
2554
2561
|
}
|
|
2555
2562
|
return processNormal(html, options, warnings, colorize);
|
|
2556
2563
|
} catch (error) {
|
|
2557
|
-
if (error instanceof
|
|
2564
|
+
if (error instanceof ParsingError) {
|
|
2558
2565
|
return {
|
|
2559
|
-
output: `
|
|
2566
|
+
output: `Parse error: ${error.message}`,
|
|
2560
2567
|
exitCode: 2,
|
|
2561
2568
|
// Content error
|
|
2562
2569
|
warnings
|
|
2563
2570
|
};
|
|
2564
2571
|
}
|
|
2572
|
+
if (error instanceof Error) {
|
|
2573
|
+
return {
|
|
2574
|
+
output: `Error: ${error.message}`,
|
|
2575
|
+
exitCode: 3,
|
|
2576
|
+
// System error
|
|
2577
|
+
warnings
|
|
2578
|
+
};
|
|
2579
|
+
}
|
|
2565
2580
|
throw error;
|
|
2566
2581
|
}
|
|
2567
2582
|
}
|