@zhongqian97-code/ecode 0.3.1 → 0.3.3
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/index.js +15 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -231,6 +231,17 @@ var DEFAULT_DANGER_LIST = [
|
|
|
231
231
|
"curl -X DELETE",
|
|
232
232
|
"wget --delete-after"
|
|
233
233
|
];
|
|
234
|
+
var INDIRECT_EXEC_LIST = [
|
|
235
|
+
"xargs",
|
|
236
|
+
"python -c",
|
|
237
|
+
"python3 -c",
|
|
238
|
+
"node -e",
|
|
239
|
+
"perl -e",
|
|
240
|
+
"ruby -e"
|
|
241
|
+
];
|
|
242
|
+
function hasFindExec(cmd) {
|
|
243
|
+
return /^find(\s|$)/.test(cmd) && /\s-exec(\s|$)/.test(cmd);
|
|
244
|
+
}
|
|
234
245
|
function matchesEntry(cmd, entry) {
|
|
235
246
|
return cmd === entry || cmd.startsWith(entry + " ");
|
|
236
247
|
}
|
|
@@ -321,6 +332,10 @@ function classifyCommand(cmd, dangerPatterns, _depth = 0) {
|
|
|
321
332
|
for (const entry of patterns) {
|
|
322
333
|
if (matchesEntry(trimmed, entry)) return "danger";
|
|
323
334
|
}
|
|
335
|
+
for (const entry of INDIRECT_EXEC_LIST) {
|
|
336
|
+
if (matchesEntry(trimmed, entry)) return "danger";
|
|
337
|
+
}
|
|
338
|
+
if (hasFindExec(trimmed)) return "danger";
|
|
324
339
|
for (const entry of ALLOWLIST) {
|
|
325
340
|
if (matchesEntry(trimmed, entry)) return "allow";
|
|
326
341
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhongqian97-code/ecode",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "A minimal Claude Code clone with REPL interface and bash tool calling",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "zhongqian97-code",
|
|
@@ -47,11 +47,11 @@
|
|
|
47
47
|
"react": "^19.2.5"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@types/node": "^
|
|
50
|
+
"@types/node": "^25.6.2",
|
|
51
51
|
"tsup": "^8.0.0",
|
|
52
52
|
"tsx": "^4.0.0",
|
|
53
53
|
"typescript": "^5.0.0",
|
|
54
|
-
"vitest": "^
|
|
54
|
+
"vitest": "^4.1.5"
|
|
55
55
|
},
|
|
56
56
|
"engines": {
|
|
57
57
|
"node": ">=18"
|