micro-models-agent 0.7.10 → 0.8.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/commands.js +173 -0
- package/dist/cli/completer.js +168 -0
- package/dist/cli/index.js +2 -0
- package/dist/cli/main.js +95 -0
- package/dist/cli/repl.js +762 -0
- package/dist/cli/security-commands.js +166 -0
- package/dist/cli/setup.js +214 -0
- package/dist/config/config.js +123 -0
- package/dist/config/defaults.js +91 -0
- package/dist/config/experts.js +15 -0
- package/dist/config/index.js +3 -0
- package/dist/config/security.js +187 -0
- package/dist/config/types.js +1 -0
- package/dist/core/agent.js +626 -0
- package/dist/core/bootstrap.js +307 -0
- package/dist/core/index.js +2 -0
- package/dist/core/prompt-builder.js +55 -0
- package/dist/core/types.js +1 -0
- package/dist/i18n/en.json +405 -0
- package/dist/i18n/index.js +43 -0
- package/dist/i18n/ru.json +405 -0
- package/dist/index.js +22 -0
- package/dist/llm/index.js +4 -0
- package/dist/llm/model-loader.js +78 -0
- package/dist/llm/openai-compat.js +277 -0
- package/dist/llm/orchestrator.js +194 -0
- package/dist/llm/provider.js +2 -0
- package/dist/llm/response.js +39 -0
- package/dist/llm/token-counter.js +37 -0
- package/dist/llm/types.js +1 -0
- package/dist/logger/app-logger.js +76 -0
- package/dist/logger/index.js +1 -0
- package/dist/migration/backup.js +45 -0
- package/dist/migration/detect.js +50 -0
- package/dist/migration/index.js +2 -0
- package/dist/modules/browser/actions.js +46 -0
- package/dist/modules/browser/cookie-store.js +24 -0
- package/dist/modules/browser/index.js +5 -0
- package/dist/modules/browser/module.js +28 -0
- package/dist/modules/browser/session.js +287 -0
- package/dist/modules/browser/snapshot.js +114 -0
- package/dist/modules/browser/types.js +9 -0
- package/dist/modules/context/history.js +15 -0
- package/dist/modules/context/index.js +1 -0
- package/dist/modules/context/manager.js +179 -0
- package/dist/modules/execution/auditor.js +72 -0
- package/dist/modules/execution/index.js +6 -0
- package/dist/modules/execution/module.js +334 -0
- package/dist/modules/execution/moe-executor.js +196 -0
- package/dist/modules/execution/plan-validator.js +153 -0
- package/dist/modules/execution/planner.js +35 -0
- package/dist/modules/execution/stuck-detector.js +113 -0
- package/dist/modules/execution/tracker.js +53 -0
- package/dist/modules/execution/types.js +1 -0
- package/dist/modules/execution/verifier.js +149 -0
- package/dist/modules/hallucination/confidence.js +47 -0
- package/dist/modules/hallucination/consistency.js +32 -0
- package/dist/modules/hallucination/detector.js +41 -0
- package/dist/modules/hallucination/factual.js +128 -0
- package/dist/modules/hallucination/index.js +4 -0
- package/dist/modules/index.js +5 -0
- package/dist/modules/indexer/cache.js +38 -0
- package/dist/modules/indexer/index.js +3 -0
- package/dist/modules/indexer/module.js +192 -0
- package/dist/modules/indexer/walker.js +101 -0
- package/dist/modules/mcp/client.js +393 -0
- package/dist/modules/mcp/index.js +3 -0
- package/dist/modules/mcp/module.js +146 -0
- package/dist/modules/mcp/registry.js +15 -0
- package/dist/modules/memory/index.js +1 -0
- package/dist/modules/memory/search.js +26 -0
- package/dist/modules/memory/store.js +38 -0
- package/dist/modules/pipelines/engine.js +60 -0
- package/dist/modules/pipelines/index.js +3 -0
- package/dist/modules/pipelines/parser.js +53 -0
- package/dist/modules/pipelines/template.js +14 -0
- package/dist/modules/plugins/builtin/lint-on-write.js +121 -0
- package/dist/modules/plugins/builtin/notify.js +8 -0
- package/dist/modules/plugins/index.js +1 -0
- package/dist/modules/plugins/loader.js +28 -0
- package/dist/modules/plugins/manager.js +161 -0
- package/dist/modules/plugins/types.js +1 -0
- package/dist/modules/registry.js +45 -0
- package/dist/modules/security/audit-log.js +108 -0
- package/dist/modules/security/audit-notifier.js +292 -0
- package/dist/modules/security/command-validator.js +91 -0
- package/dist/modules/security/content-scanner.js +52 -0
- package/dist/modules/security/data-sanitizer.js +97 -0
- package/dist/modules/security/encryption.js +218 -0
- package/dist/modules/security/index.js +14 -0
- package/dist/modules/security/network-validator.js +79 -0
- package/dist/modules/security/path-validator.js +155 -0
- package/dist/modules/security/rate-limiter.js +119 -0
- package/dist/modules/security/security-policies.js +393 -0
- package/dist/modules/security/session-encryption.js +193 -0
- package/dist/modules/security/session-isolation.js +95 -0
- package/dist/modules/session/index.js +3 -0
- package/dist/modules/session/manager.js +167 -0
- package/dist/modules/session/module.js +28 -0
- package/dist/modules/session/store.js +174 -0
- package/dist/modules/session/types.js +1 -0
- package/dist/modules/skills/index.js +3 -0
- package/dist/modules/skills/loader.js +72 -0
- package/dist/modules/skills/matcher.js +27 -0
- package/dist/modules/skills/module.js +180 -0
- package/dist/modules/types.js +1 -0
- package/dist/modules/updater/checker.js +32 -0
- package/dist/modules/updater/index.js +1 -0
- package/dist/modules/user-profile/compressor.js +16 -0
- package/dist/modules/user-profile/index.js +1 -0
- package/dist/modules/user-profile/profile.js +68 -0
- package/dist/tools/approve.js +32 -0
- package/dist/tools/bash.js +77 -0
- package/dist/tools/browser.js +97 -0
- package/dist/tools/create-dir.js +57 -0
- package/dist/tools/delete-file.js +64 -0
- package/dist/tools/edit-file.js +78 -0
- package/dist/tools/executor.js +83 -0
- package/dist/tools/file-info.js +46 -0
- package/dist/tools/filter-tools.js +10 -0
- package/dist/tools/glob-tool.js +19 -0
- package/dist/tools/grep-tool.js +51 -0
- package/dist/tools/index.js +44 -0
- package/dist/tools/list-dir.js +40 -0
- package/dist/tools/load-skill.js +48 -0
- package/dist/tools/mcp-call.js +68 -0
- package/dist/tools/move-file.js +84 -0
- package/dist/tools/pipeline-run.js +39 -0
- package/dist/tools/question.js +142 -0
- package/dist/tools/read-file.js +65 -0
- package/dist/tools/registry.js +36 -0
- package/dist/tools/scope-check.js +30 -0
- package/dist/tools/search-history.js +64 -0
- package/dist/tools/subagent.js +130 -0
- package/dist/tools/types.js +1 -0
- package/dist/tools/user-input.js +123 -0
- package/dist/tools/web-browse.js +51 -0
- package/dist/tools/web-fetch.js +62 -0
- package/dist/tools/web-search.js +59 -0
- package/dist/tools/write-file.js +80 -0
- package/dist/ui/box.js +81 -0
- package/dist/ui/colors.js +4 -0
- package/dist/ui/diff.js +185 -0
- package/dist/ui/index.js +6 -0
- package/dist/ui/md-formatter.js +212 -0
- package/dist/ui/output.js +13 -0
- package/dist/ui/renderer.js +141 -0
- package/dist/ui/spinner.js +70 -0
- package/dist/ui/table.js +144 -0
- package/package.json +1 -1
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default security configuration for MMA.
|
|
3
|
+
* These settings provide a balance between security and usability.
|
|
4
|
+
*/
|
|
5
|
+
export const DEFAULT_SECURITY_CONFIG = {
|
|
6
|
+
bash: {
|
|
7
|
+
// Commands that are always blocked (dangerous)
|
|
8
|
+
blacklist: [
|
|
9
|
+
"rm",
|
|
10
|
+
"dd",
|
|
11
|
+
"chmod",
|
|
12
|
+
"wget",
|
|
13
|
+
"curl",
|
|
14
|
+
"scp",
|
|
15
|
+
"ssh",
|
|
16
|
+
"nc",
|
|
17
|
+
"netcat",
|
|
18
|
+
"mknod",
|
|
19
|
+
"mkfifo",
|
|
20
|
+
"ln",
|
|
21
|
+
"chown",
|
|
22
|
+
"chgrp",
|
|
23
|
+
"useradd",
|
|
24
|
+
"usermod",
|
|
25
|
+
"passwd",
|
|
26
|
+
"sudo",
|
|
27
|
+
"su",
|
|
28
|
+
"exec",
|
|
29
|
+
"eval",
|
|
30
|
+
"source",
|
|
31
|
+
"kill",
|
|
32
|
+
"pkill",
|
|
33
|
+
"killall",
|
|
34
|
+
"shutdown",
|
|
35
|
+
"reboot",
|
|
36
|
+
"halt",
|
|
37
|
+
"poweroff",
|
|
38
|
+
"format",
|
|
39
|
+
"fdisk",
|
|
40
|
+
"parted",
|
|
41
|
+
"mkfs",
|
|
42
|
+
"mount",
|
|
43
|
+
"umount",
|
|
44
|
+
],
|
|
45
|
+
// If whitelist is non-empty, only these commands are allowed
|
|
46
|
+
whitelist: [],
|
|
47
|
+
// Block dangerous flags like --force, -rf, etc.
|
|
48
|
+
blockDangerousFlags: true,
|
|
49
|
+
// Log all executed commands to audit log
|
|
50
|
+
logCommands: true,
|
|
51
|
+
// Dangerous flags that are always blocked
|
|
52
|
+
dangerousFlags: [
|
|
53
|
+
"--force",
|
|
54
|
+
"-rf",
|
|
55
|
+
"--no-preserve-root",
|
|
56
|
+
"--recursive",
|
|
57
|
+
"--all",
|
|
58
|
+
"-x",
|
|
59
|
+
"-e",
|
|
60
|
+
"--delete",
|
|
61
|
+
"--remove",
|
|
62
|
+
"--dangerous",
|
|
63
|
+
"--yes",
|
|
64
|
+
"-y",
|
|
65
|
+
"--no-confirm",
|
|
66
|
+
],
|
|
67
|
+
// Dangerous operators that are always blocked
|
|
68
|
+
dangerousOperators: [">", ">>", "2>", "2>>", "|", "&&", "||", ";", "&", "`"],
|
|
69
|
+
},
|
|
70
|
+
paths: {
|
|
71
|
+
// Glob patterns for paths that are always denied
|
|
72
|
+
denied: [
|
|
73
|
+
".git/",
|
|
74
|
+
"node_modules/",
|
|
75
|
+
".env",
|
|
76
|
+
"*.key",
|
|
77
|
+
"*.pem",
|
|
78
|
+
"*.crt",
|
|
79
|
+
"*.p12",
|
|
80
|
+
"*.pfx",
|
|
81
|
+
"*.secret",
|
|
82
|
+
"*.token",
|
|
83
|
+
"package-lock.json",
|
|
84
|
+
"bun.lock",
|
|
85
|
+
"yarn.lock",
|
|
86
|
+
"pnpm-lock.yaml",
|
|
87
|
+
],
|
|
88
|
+
// If allowed is non-empty, only these paths are allowed
|
|
89
|
+
allowed: [],
|
|
90
|
+
},
|
|
91
|
+
network: {
|
|
92
|
+
// Domains that are always denied
|
|
93
|
+
deniedDomains: [],
|
|
94
|
+
// If allowedDomains is non-empty, only these domains are allowed
|
|
95
|
+
allowedDomains: [],
|
|
96
|
+
// Timeout for network requests (ms)
|
|
97
|
+
requestTimeout: 15000,
|
|
98
|
+
// Maximum response size (bytes)
|
|
99
|
+
maxResponseSize: 15000,
|
|
100
|
+
},
|
|
101
|
+
// Maximum depth of subagent recursion
|
|
102
|
+
maxRecursionDepth: 3,
|
|
103
|
+
// Maximum number of file operations per session
|
|
104
|
+
maxFileOperations: 100,
|
|
105
|
+
// Rate limits for LLM requests
|
|
106
|
+
rateLimits: {
|
|
107
|
+
maxRequestsPerMinute: 60,
|
|
108
|
+
maxParallelTasks: 5,
|
|
109
|
+
},
|
|
110
|
+
// Content scanning settings
|
|
111
|
+
contentScan: {
|
|
112
|
+
enabled: true,
|
|
113
|
+
// Patterns that are considered dangerous in file content
|
|
114
|
+
dangerousPatterns: [
|
|
115
|
+
/eval\(/,
|
|
116
|
+
/new Function\(/,
|
|
117
|
+
/child_process\.exec\(/,
|
|
118
|
+
/child_process\.spawn\(/,
|
|
119
|
+
/require\('child_process'\)/,
|
|
120
|
+
/require\('http'\)\.createServer/,
|
|
121
|
+
/require\('net'\)\.createServer/,
|
|
122
|
+
/process\.exit\(/,
|
|
123
|
+
/while\(true\)/,
|
|
124
|
+
/for\(\;\;\)/,
|
|
125
|
+
/rm -rf/,
|
|
126
|
+
/dd if=/,
|
|
127
|
+
/chmod 777/,
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
|
+
// Session file encryption settings
|
|
131
|
+
sessionEncryption: {
|
|
132
|
+
enabled: false,
|
|
133
|
+
encryptHistory: true,
|
|
134
|
+
encryptSessionLog: true,
|
|
135
|
+
},
|
|
136
|
+
// Audit notification settings
|
|
137
|
+
auditNotifier: {
|
|
138
|
+
enabled: false,
|
|
139
|
+
minSeverity: 'medium',
|
|
140
|
+
eventTypes: [
|
|
141
|
+
'security_block',
|
|
142
|
+
'bash_command',
|
|
143
|
+
'file_operation',
|
|
144
|
+
'network_request',
|
|
145
|
+
],
|
|
146
|
+
maxRetries: 3,
|
|
147
|
+
webhookTimeout: 5000,
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Merge user-provided security config with defaults.
|
|
152
|
+
* User config takes precedence over defaults.
|
|
153
|
+
*/
|
|
154
|
+
export function mergeSecurityConfig(userConfig) {
|
|
155
|
+
return {
|
|
156
|
+
bash: {
|
|
157
|
+
...DEFAULT_SECURITY_CONFIG.bash,
|
|
158
|
+
...userConfig?.bash,
|
|
159
|
+
},
|
|
160
|
+
paths: {
|
|
161
|
+
...DEFAULT_SECURITY_CONFIG.paths,
|
|
162
|
+
...userConfig?.paths,
|
|
163
|
+
},
|
|
164
|
+
network: {
|
|
165
|
+
...DEFAULT_SECURITY_CONFIG.network,
|
|
166
|
+
...userConfig?.network,
|
|
167
|
+
},
|
|
168
|
+
maxRecursionDepth: userConfig?.maxRecursionDepth ?? DEFAULT_SECURITY_CONFIG.maxRecursionDepth,
|
|
169
|
+
maxFileOperations: userConfig?.maxFileOperations ?? DEFAULT_SECURITY_CONFIG.maxFileOperations,
|
|
170
|
+
rateLimits: {
|
|
171
|
+
...DEFAULT_SECURITY_CONFIG.rateLimits,
|
|
172
|
+
...userConfig?.rateLimits,
|
|
173
|
+
},
|
|
174
|
+
contentScan: {
|
|
175
|
+
...DEFAULT_SECURITY_CONFIG.contentScan,
|
|
176
|
+
...userConfig?.contentScan,
|
|
177
|
+
},
|
|
178
|
+
sessionEncryption: {
|
|
179
|
+
...DEFAULT_SECURITY_CONFIG.sessionEncryption,
|
|
180
|
+
...userConfig?.sessionEncryption,
|
|
181
|
+
},
|
|
182
|
+
auditNotifier: {
|
|
183
|
+
...DEFAULT_SECURITY_CONFIG.auditNotifier,
|
|
184
|
+
...userConfig?.auditNotifier,
|
|
185
|
+
},
|
|
186
|
+
};
|
|
187
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|