@blackbelt-technology/pi-dashboard-session-distiller 0.11.0 → 0.12.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/package.json +1 -1
- package/src/signals.ts +7 -1
package/package.json
CHANGED
package/src/signals.ts
CHANGED
|
@@ -34,7 +34,13 @@ function slug(s: string): string {
|
|
|
34
34
|
return s.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "").slice(0, 48);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Coarse error class of a tool-result text (`enoent`, `not-found`, first-line
|
|
39
|
+
* slug). Exported for sim-extension failure signatures `err:<tool>:<class>`;
|
|
40
|
+
* changing it changes every recorded signature. See change:
|
|
41
|
+
* add-self-improvement-memory.
|
|
42
|
+
*/
|
|
43
|
+
export function errorClass(text: string): string {
|
|
38
44
|
const m = text.match(/\b(ENOENT|EACCES|cannot find module|not found|undefined|type ?error|syntax ?error|permission denied|timeout)\b/i);
|
|
39
45
|
if (m) return slug(m[1]);
|
|
40
46
|
return slug(text.split(/[:\n]/)[0] ?? text).slice(0, 24);
|