@openclaw/plugin-inspector 0.3.22 → 0.3.23

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/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.3.23 - 2026-08-30
6
+
7
+ ### Fixed
8
+
9
+ - Mask source comments in spans so inspecting large bundled JavaScript stays within serverless memory limits while preserving source offsets and findings.
10
+
5
11
  ## 0.3.22 - 2026-08-30
6
12
 
7
13
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/plugin-inspector",
3
- "version": "0.3.22",
3
+ "version": "0.3.23",
4
4
  "private": false,
5
5
  "description": "Offline compatibility inspector for OpenClaw plugins.",
6
6
  "type": "module",
package/src/inspector.js CHANGED
@@ -727,38 +727,11 @@ function lineForOffset(text, offset) {
727
727
  }
728
728
 
729
729
  function stripComments(text) {
730
- let result = "";
731
- for (let index = 0; index < text.length; index += 1) {
732
- const char = text[index];
733
- const next = text[index + 1];
734
- if (char === "/" && next === "*") {
735
- result += " ";
736
- index += 2;
737
- while (index < text.length && !(text[index] === "*" && text[index + 1] === "/")) {
738
- result += blankCommentChar(text[index]);
739
- index += 1;
740
- }
741
- if (index < text.length) {
742
- result += " ";
743
- index += 1;
744
- }
745
- } else if (char === "/" && next === "/") {
746
- result += " ";
747
- index += 2;
748
- while (index < text.length && text[index] !== "\n" && text[index] !== "\r") {
749
- result += " ";
750
- index += 1;
751
- }
752
- index -= 1;
753
- } else {
754
- result += char;
755
- }
756
- }
757
- return result;
758
- }
759
-
760
- function blankCommentChar(char) {
761
- return char === "\n" || char === "\r" ? char : " ";
730
+ // Mask spans rather than building one string node per UTF-16 code unit.
731
+ // Keep offsets and CR/LF intact for findings, including unterminated comments.
732
+ return text.replace(/\/\*[\s\S]*?(?:\*\/|$)|\/\/[^\r\n]*/g, (comment) =>
733
+ comment.replace(/[^\r\n]+/g, (span) => " ".repeat(span.length)),
734
+ );
762
735
  }
763
736
 
764
737
  function sortDetails(details) {