@nexrall/code-core 1.3.0 → 1.3.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../src/tools/executor.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAyB,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../src/tools/executor.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAyB,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AAkrDtE,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,WAAW,CAAC,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,EAClC,OAAO,CAAC,EAAE,aAAa,EACvB,OAAO,CAAC,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,UAAU,CAAC,CAiBrB"}
|
package/dist/tools/executor.js
CHANGED
|
@@ -59,10 +59,15 @@ const MAX_OUTPUT_CHARS = 100000; // bash / grep output cap (~100 KB)
|
|
|
59
59
|
// hidden in a fake heredoc/quote (e.g. `echo "<<EOF"\nrm -rf /\nEOF`) is still
|
|
60
60
|
// caught.
|
|
61
61
|
const BLOCKED_REGEXES = [
|
|
62
|
-
// Filesystem destruction — match rm/chmod with any whitespace between flags
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
/rm\s+-rf\s
|
|
62
|
+
// Filesystem destruction — match rm/chmod with any whitespace between flags.
|
|
63
|
+
// Only root itself and BARE top-level system dirs are blocked; ordinary
|
|
64
|
+
// absolute subpaths (/tmp/x, /var/folders/x, /Users/me/proj/node_modules)
|
|
65
|
+
// must stay allowed — the old /rm\s+-rf\s+\// matched every absolute path.
|
|
66
|
+
// `-[a-z]*(?:rf|fr)[a-z]*` accepts -rf, -fr, -rfv, -vrf … (combined flag).
|
|
67
|
+
/rm\s+-[a-z]*(?:rf|fr)[a-z]*\s+\/(?:\*|\s|;|&|\||$)/, // rm -rf / · / * · root, bare
|
|
68
|
+
/rm\s+-[a-z]*(?:rf|fr)[a-z]*\s+\/(?:bin|sbin|etc|usr|var|lib|lib64|boot|sys|proc|dev|root|home|system|library|applications|opt|users)(?:\/)?(?:\*|\s|;|&|\||$)/, // rm -rf /etc … bare system dir
|
|
69
|
+
/rm\s+-[a-z]*(?:rf|fr)[a-z]*\s+~(?:\/)?(?:\*|\s|;|&|\||$)/, // rm -rf ~ · ~/ · ~/*
|
|
70
|
+
/rm\s+-[a-z]*(?:rf|fr)[a-z]*\s+\*/, // rm -rf *
|
|
66
71
|
/rm\s+--no-preserve-root/,
|
|
67
72
|
/chmod\s+-[rr]\s+777\s+\//,
|
|
68
73
|
/chown\s+-[rr]/,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexrall/code-core",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Core agent loop, tools, and extension primitives for Nexrall Code — embed an AI coding agent in any Node.js application.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Nexrall <support@nexrall.com> (https://nexrall.com)",
|