@delt/claude-alarm 0.6.11 → 0.6.12
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.
|
@@ -1403,11 +1403,14 @@
|
|
|
1403
1403
|
if (!raw) return { text: '' };
|
|
1404
1404
|
let p = null;
|
|
1405
1405
|
try { p = JSON.parse(raw); } catch {
|
|
1406
|
-
// Truncated JSON - extract known fields with regex
|
|
1407
|
-
const cmdMatch = raw.match(/"command"\s*:\s*"((?:[^"\\]|\\.)*)"
|
|
1408
|
-
const fileMatch = raw.match(/"file_path"\s*:\s*"((?:[^"\\]|\\.)*)"
|
|
1409
|
-
const patternMatch = raw.match(/"pattern"\s*:\s*"((?:[^"\\]|\\.)*)"
|
|
1410
|
-
const contentMatch = raw.match(/"content"\s*:\s*"((?:[^"\\]|\\.)*)"
|
|
1406
|
+
// Truncated JSON - extract known fields with regex (closing quote optional for truncated strings)
|
|
1407
|
+
const cmdMatch = raw.match(/"command"\s*:\s*"((?:[^"\\]|\\.)*)"?/);
|
|
1408
|
+
const fileMatch = raw.match(/"file_path"\s*:\s*"((?:[^"\\]|\\.)*)"?/);
|
|
1409
|
+
const patternMatch = raw.match(/"pattern"\s*:\s*"((?:[^"\\]|\\.)*)"?/);
|
|
1410
|
+
const contentMatch = raw.match(/"content"\s*:\s*"((?:[^"\\]|\\.)*)"?/);
|
|
1411
|
+
const titleMatch = raw.match(/"title"\s*:\s*"((?:[^"\\]|\\.)*)"?/);
|
|
1412
|
+
const msgMatch = raw.match(/"message"\s*:\s*"((?:[^"\\]|\\.)*)"?/);
|
|
1413
|
+
if (titleMatch && msgMatch) return { text: msgMatch[1] };
|
|
1411
1414
|
if (cmdMatch) return { text: '$ ' + cmdMatch[1] };
|
|
1412
1415
|
if (fileMatch) return { text: fileMatch[1] };
|
|
1413
1416
|
if (patternMatch) return { text: patternMatch[1] };
|
package/package.json
CHANGED
package/src/dashboard/index.html
CHANGED
|
@@ -1403,11 +1403,14 @@
|
|
|
1403
1403
|
if (!raw) return { text: '' };
|
|
1404
1404
|
let p = null;
|
|
1405
1405
|
try { p = JSON.parse(raw); } catch {
|
|
1406
|
-
// Truncated JSON - extract known fields with regex
|
|
1407
|
-
const cmdMatch = raw.match(/"command"\s*:\s*"((?:[^"\\]|\\.)*)"
|
|
1408
|
-
const fileMatch = raw.match(/"file_path"\s*:\s*"((?:[^"\\]|\\.)*)"
|
|
1409
|
-
const patternMatch = raw.match(/"pattern"\s*:\s*"((?:[^"\\]|\\.)*)"
|
|
1410
|
-
const contentMatch = raw.match(/"content"\s*:\s*"((?:[^"\\]|\\.)*)"
|
|
1406
|
+
// Truncated JSON - extract known fields with regex (closing quote optional for truncated strings)
|
|
1407
|
+
const cmdMatch = raw.match(/"command"\s*:\s*"((?:[^"\\]|\\.)*)"?/);
|
|
1408
|
+
const fileMatch = raw.match(/"file_path"\s*:\s*"((?:[^"\\]|\\.)*)"?/);
|
|
1409
|
+
const patternMatch = raw.match(/"pattern"\s*:\s*"((?:[^"\\]|\\.)*)"?/);
|
|
1410
|
+
const contentMatch = raw.match(/"content"\s*:\s*"((?:[^"\\]|\\.)*)"?/);
|
|
1411
|
+
const titleMatch = raw.match(/"title"\s*:\s*"((?:[^"\\]|\\.)*)"?/);
|
|
1412
|
+
const msgMatch = raw.match(/"message"\s*:\s*"((?:[^"\\]|\\.)*)"?/);
|
|
1413
|
+
if (titleMatch && msgMatch) return { text: msgMatch[1] };
|
|
1411
1414
|
if (cmdMatch) return { text: '$ ' + cmdMatch[1] };
|
|
1412
1415
|
if (fileMatch) return { text: fileMatch[1] };
|
|
1413
1416
|
if (patternMatch) return { text: patternMatch[1] };
|