@reticular/speakable 1.1.1 → 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/dist/mcp.js CHANGED
@@ -15,8 +15,15 @@ var ParsingError = class extends Error {
15
15
  this.name = "ParsingError";
16
16
  }
17
17
  };
18
+ var MAX_INPUT_SIZE = 10 * 1024 * 1024;
18
19
  function parseHTML(html) {
19
20
  const warnings = [];
21
+ const inputSize = Buffer.byteLength(html, "utf-8");
22
+ if (inputSize > MAX_INPUT_SIZE) {
23
+ throw new ParsingError(
24
+ `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.`
25
+ );
26
+ }
20
27
  try {
21
28
  const dom = new JSDOM(html, {
22
29
  contentType: "text/html",