micro-models-agent 0.15.0 → 0.16.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/dist/cli/main.js +15 -0
- package/dist/cli/setup.js +16 -1
- package/dist/config/security.js +2 -1
- package/dist/i18n/en.json +6 -0
- package/dist/i18n/ru.json +6 -0
- package/dist/modules/security/command-validator.js +1 -1
- package/package.json +1 -1
package/dist/cli/main.js
CHANGED
|
@@ -87,6 +87,21 @@ async function main() {
|
|
|
87
87
|
config.contextWindow = answers.contextWindow;
|
|
88
88
|
config.maxToolIterations = answers.maxToolIterations;
|
|
89
89
|
config.locale = answers.locale;
|
|
90
|
+
if (config.security) {
|
|
91
|
+
config.security.bash.blockDangerousFlags = answers.securityFlagsBlock;
|
|
92
|
+
if (answers.securityBashBlock) {
|
|
93
|
+
config.security.bash.blacklist = [
|
|
94
|
+
...new Set([
|
|
95
|
+
...config.security.bash.blacklist,
|
|
96
|
+
"rm", "dd", "chmod", "wget", "curl", "scp", "ssh", "nc", "netcat",
|
|
97
|
+
"sudo", "su", "kill", "pkill", "killall", "shutdown", "reboot",
|
|
98
|
+
]),
|
|
99
|
+
];
|
|
100
|
+
}
|
|
101
|
+
if (!answers.securityPathsDeny) {
|
|
102
|
+
config.security.paths.denied = [];
|
|
103
|
+
}
|
|
104
|
+
}
|
|
90
105
|
saveConfig(config, configPath);
|
|
91
106
|
}
|
|
92
107
|
const { agent, config, sessionManager, skillsModule, pluginManager, configDir, baseDir, } = await bootstrap(undefined, projectDir, noAgentsMd, exitOnComplete);
|
package/dist/cli/setup.js
CHANGED
|
@@ -185,7 +185,19 @@ export async function runSetup() {
|
|
|
185
185
|
}
|
|
186
186
|
console.log(t("setup.agent_settings"));
|
|
187
187
|
const contextWindow = parseInt(await ask(rl, t("setup.context_window"), "32768"));
|
|
188
|
-
const maxIterations = parseInt(await ask(rl, t("setup.max_iters"), "
|
|
188
|
+
const maxIterations = parseInt(await ask(rl, t("setup.max_iters"), "1000"));
|
|
189
|
+
// Security settings
|
|
190
|
+
console.log(t("setup.security_header"));
|
|
191
|
+
console.log(pc.dim(t("setup.security_status_off")));
|
|
192
|
+
const configureSecurity = await ask(rl, t("setup.security_configure"), "n");
|
|
193
|
+
let securityBashBlock = false;
|
|
194
|
+
let securityFlagsBlock = false;
|
|
195
|
+
let securityPathsDeny = true;
|
|
196
|
+
if (configureSecurity.toLowerCase() === "y" || configureSecurity.toLowerCase() === "yes") {
|
|
197
|
+
securityBashBlock = (await ask(rl, t("setup.security_bash_block"), "n")).toLowerCase() === "y";
|
|
198
|
+
securityFlagsBlock = (await ask(rl, t("setup.security_flags_block"), "n")).toLowerCase() === "y";
|
|
199
|
+
securityPathsDeny = (await ask(rl, t("setup.security_paths_deny"), "Y")).toLowerCase() !== "n";
|
|
200
|
+
}
|
|
189
201
|
rl.close();
|
|
190
202
|
const answers = {
|
|
191
203
|
provider,
|
|
@@ -195,6 +207,9 @@ export async function runSetup() {
|
|
|
195
207
|
contextWindow,
|
|
196
208
|
maxToolIterations: maxIterations,
|
|
197
209
|
locale,
|
|
210
|
+
securityBashBlock,
|
|
211
|
+
securityFlagsBlock,
|
|
212
|
+
securityPathsDeny,
|
|
198
213
|
};
|
|
199
214
|
console.log(pc.green(pc.bold(t("setup.complete"))));
|
|
200
215
|
const summary = renderTable([
|
package/dist/config/security.js
CHANGED
|
@@ -45,7 +45,8 @@ export const DEFAULT_SECURITY_CONFIG = {
|
|
|
45
45
|
// If whitelist is non-empty, only these commands are allowed
|
|
46
46
|
whitelist: [],
|
|
47
47
|
// Block dangerous flags like --force, -rf, etc.
|
|
48
|
-
|
|
48
|
+
// Disabled by default — enable in config if needed.
|
|
49
|
+
blockDangerousFlags: false,
|
|
49
50
|
// Log all executed commands to audit log
|
|
50
51
|
logCommands: true,
|
|
51
52
|
// Dangerous flags that are always blocked
|
package/dist/i18n/en.json
CHANGED
|
@@ -354,6 +354,12 @@
|
|
|
354
354
|
"setup.testing_spinner": "Testing chat with \"{model}\"…",
|
|
355
355
|
"setup.summary_setting": "Setting",
|
|
356
356
|
"setup.summary_value": "Value",
|
|
357
|
+
"setup.security_header": "\n --- Security ---",
|
|
358
|
+
"setup.security_status_off": " Security: OFF (default — all commands allowed)",
|
|
359
|
+
"setup.security_configure": " Configure security? (y/N)",
|
|
360
|
+
"setup.security_bash_block": " Block dangerous commands (rm, sudo, ssh, etc.)? (y/N)",
|
|
361
|
+
"setup.security_flags_block": " Block dangerous flags (--force, -rf, etc.)? (y/N)",
|
|
362
|
+
"setup.security_paths_deny": " Deny .git/, .env, node_modules/? (Y/n)",
|
|
357
363
|
"skill.already_loaded": "Skill \"{name}\" is already loaded",
|
|
358
364
|
"skill.not_found": "Skill \"{name}\" not found in any source directory",
|
|
359
365
|
"skill.no_match": "No skills match for: {task}",
|
package/dist/i18n/ru.json
CHANGED
|
@@ -354,6 +354,12 @@
|
|
|
354
354
|
"setup.testing_spinner": "Проверка чата с \"{model}\"…",
|
|
355
355
|
"setup.summary_setting": "Параметр",
|
|
356
356
|
"setup.summary_value": "Значение",
|
|
357
|
+
"setup.security_header": "\n --- Безопасность ---",
|
|
358
|
+
"setup.security_status_off": " Безопасность: ВЫКЛ (по умолчанию — все команды разрешены)",
|
|
359
|
+
"setup.security_configure": " Настроить безопасность? (y/N)",
|
|
360
|
+
"setup.security_bash_block": " Блокировать опасные команды (rm, sudo, ssh и т.д.)? (y/N)",
|
|
361
|
+
"setup.security_flags_block": " Блокировать опасные флаги (--force, -rf и т.д.)? (y/N)",
|
|
362
|
+
"setup.security_paths_deny": " Запретить .git/, .env, node_modules/? (Y/n)",
|
|
357
363
|
"skill.already_loaded": "Скилл \"{name}\" уже загружен",
|
|
358
364
|
"skill.not_found": "Скилл \"{name}\" не найден ни в одном каталоге",
|
|
359
365
|
"skill.no_match": "Нет скиллов подходящих для: {task}",
|
|
@@ -3,7 +3,7 @@ import { DEFAULT_SECURITY_CONFIG } from "../../config/security";
|
|
|
3
3
|
const FALLBACK_BASH_CONFIG = {
|
|
4
4
|
blacklist: ['rm', 'dd', 'chmod', 'wget', 'curl', 'scp', 'ssh', 'nc', 'netcat'],
|
|
5
5
|
whitelist: [],
|
|
6
|
-
blockDangerousFlags:
|
|
6
|
+
blockDangerousFlags: false,
|
|
7
7
|
dangerousFlags: ['--force', '-rf', '--no-preserve-root'],
|
|
8
8
|
dangerousOperators: ['>', '>>', '2>', '2>>', '|', '&&', '||', ';', '`'],
|
|
9
9
|
logCommands: true,
|