micro-models-agent 0.28.17 → 0.29.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 +3 -116
- package/dist/cli/main.js +8 -35
- package/dist/cli/repl.js +611 -110
- package/dist/cli/setup.js +12 -32
- package/dist/config/config.js +30 -46
- package/dist/config/defaults.js +1 -10
- package/dist/config/security.js +8 -15
- package/dist/core/agent-moe.js +12 -24
- package/dist/core/agent.js +47 -281
- package/dist/core/bootstrap.js +36 -52
- package/dist/core/session-logger.js +2 -35
- package/dist/i18n/en.json +15 -79
- package/dist/i18n/index.js +9 -12
- package/dist/i18n/ru.json +15 -79
- package/dist/index.js +13 -13
- package/dist/llm/openai-compat.js +10 -39
- package/dist/logger/app-logger.js +16 -83
- package/dist/main.js +624 -243
- package/dist/modules/browser/session.js +60 -108
- package/dist/modules/context/history.js +15 -0
- package/dist/modules/context/manager.js +10 -119
- package/dist/modules/execution/auditor.js +39 -33
- package/dist/modules/execution/index.js +6 -8
- package/dist/modules/execution/module.js +32 -474
- package/dist/modules/execution/moe-executor.js +40 -97
- package/dist/modules/execution/planner.js +13 -63
- package/dist/modules/execution/stuck-detector.js +39 -252
- package/dist/modules/execution/tracker.js +7 -21
- package/dist/modules/execution/verifier.js +17 -46
- package/dist/modules/hallucination/confidence.js +2 -7
- package/dist/modules/hallucination/consistency.js +42 -8
- package/dist/modules/hallucination/detector.js +21 -26
- package/dist/modules/hallucination/factual.js +150 -170
- package/dist/modules/hallucination/index.js +4 -5
- package/dist/modules/index.js +5 -5
- package/dist/modules/mcp/client.js +2 -8
- package/dist/modules/memory/store.js +0 -4
- package/dist/modules/plugins/builtin/lint-on-write.js +38 -143
- package/dist/modules/processes/detect.js +34 -0
- package/dist/modules/processes/index.js +2 -1
- package/dist/modules/processes/registry.js +35 -125
- package/dist/modules/processes/runner.js +110 -9
- package/dist/modules/security/audit-log.js +10 -30
- package/dist/modules/security/command-validator.js +16 -42
- package/dist/modules/security/content-scanner.js +8 -9
- package/dist/modules/security/network-validator.js +2 -2
- package/dist/modules/security/path-validator.js +10 -64
- package/dist/modules/security/security-policies.js +67 -221
- package/dist/modules/security/session-encryption.js +25 -42
- package/dist/modules/session/manager.js +10 -15
- package/dist/modules/session/store.js +8 -62
- package/dist/modules/skills/index.js +3 -2
- package/dist/modules/skills/matcher.js +27 -0
- package/dist/modules/skills/module.js +23 -10
- package/dist/tools/bash.js +90 -287
- package/dist/tools/create-dir.js +1 -0
- package/dist/tools/delete-file.js +1 -0
- package/dist/tools/edit-file.js +8 -10
- package/dist/tools/executor.js +7 -57
- package/dist/tools/grep-tool.js +29 -51
- package/dist/tools/index.js +40 -55
- package/dist/tools/load-skill.js +18 -14
- package/dist/tools/move-file.js +2 -3
- package/dist/tools/pipeline-run.js +1 -1
- package/dist/tools/read-file.js +5 -15
- package/dist/tools/search-history.js +22 -42
- package/dist/tools/subagent.js +12 -21
- package/dist/tools/web-browse.js +25 -54
- package/dist/tools/web-fetch.js +34 -60
- package/dist/tools/web-search.js +20 -39
- package/dist/tools/write-file.js +10 -13
- package/dist/ui/diff.js +16 -9
- package/dist/ui/renderer.js +6 -69
- package/package.json +1 -1
- package/dist/cli/repl-commands.js +0 -633
- package/dist/core/workspace.js +0 -76
- package/dist/logger/file-log.js +0 -151
- package/dist/modules/certification/cli.js +0 -176
- package/dist/modules/certification/fact-checker.js +0 -84
- package/dist/modules/certification/loader.js +0 -111
- package/dist/modules/certification/manifest.js +0 -50
- package/dist/modules/certification/runner.js +0 -162
- package/dist/modules/certification/scenarios.js +0 -124
- package/dist/modules/certification/types.js +0 -1
- package/dist/modules/execution/plan-coverage.js +0 -68
- package/dist/modules/execution/plan-persister.js +0 -46
- package/dist/modules/execution/plan-store.js +0 -159
- package/dist/modules/hallucination/js-identifiers.js +0 -72
- package/dist/modules/hallucination/llm-judge.js +0 -103
- package/dist/modules/lsp/client.js +0 -235
- package/dist/modules/lsp/config.js +0 -81
- package/dist/modules/lsp/index.js +0 -3
- package/dist/modules/lsp/module.js +0 -68
- package/dist/modules/lsp/types.js +0 -1
package/dist/cli/commands.js
CHANGED
|
@@ -3,32 +3,10 @@ import { bootstrap } from "../core/bootstrap";
|
|
|
3
3
|
import { saveConfig } from "../config/config";
|
|
4
4
|
import { runSetup } from "./setup";
|
|
5
5
|
import { t } from "../i18n/index";
|
|
6
|
-
import { join
|
|
6
|
+
import { join } from "path";
|
|
7
7
|
import { homedir } from "os";
|
|
8
|
-
import { existsSync, readFileSync } from "fs";
|
|
9
8
|
import { createSecurityCommand } from "./security-commands";
|
|
10
|
-
import {
|
|
11
|
-
function readVersion() {
|
|
12
|
-
const here = dirname(fileURLToPath(import.meta.url));
|
|
13
|
-
const candidates = [
|
|
14
|
-
join(here, "..", "..", "package.json"),
|
|
15
|
-
join(here, "..", "package.json"),
|
|
16
|
-
];
|
|
17
|
-
for (const p of candidates) {
|
|
18
|
-
if (existsSync(p)) {
|
|
19
|
-
try {
|
|
20
|
-
const raw = JSON.parse(readFileSync(p, "utf8"));
|
|
21
|
-
if (raw.version)
|
|
22
|
-
return raw.version;
|
|
23
|
-
}
|
|
24
|
-
catch {
|
|
25
|
-
// Broken package.json — fall through to the next candidate
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return "0.0.0";
|
|
30
|
-
}
|
|
31
|
-
const version = readVersion();
|
|
9
|
+
import { version } from "../../package.json";
|
|
32
10
|
export function createProgram() {
|
|
33
11
|
const program = new Command()
|
|
34
12
|
.name("mma")
|
|
@@ -52,41 +30,6 @@ export function createProgram() {
|
|
|
52
30
|
config.contextWindow = answers.contextWindow;
|
|
53
31
|
config.maxToolIterations = answers.maxToolIterations;
|
|
54
32
|
config.locale = answers.locale;
|
|
55
|
-
// Apply security settings from wizard
|
|
56
|
-
if (config.security) {
|
|
57
|
-
config.security.enabled =
|
|
58
|
-
answers.securityBashBlock ||
|
|
59
|
-
answers.securityFlagsBlock ||
|
|
60
|
-
!answers.securityPathsDeny;
|
|
61
|
-
config.security.bash.enabled = config.security.enabled;
|
|
62
|
-
config.security.bash.blockDangerousFlags = answers.securityFlagsBlock;
|
|
63
|
-
if (answers.securityBashBlock) {
|
|
64
|
-
config.security.bash.blacklist = [
|
|
65
|
-
...new Set([
|
|
66
|
-
...config.security.bash.blacklist,
|
|
67
|
-
"rm",
|
|
68
|
-
"dd",
|
|
69
|
-
"chmod",
|
|
70
|
-
"wget",
|
|
71
|
-
"curl",
|
|
72
|
-
"scp",
|
|
73
|
-
"ssh",
|
|
74
|
-
"nc",
|
|
75
|
-
"netcat",
|
|
76
|
-
"sudo",
|
|
77
|
-
"su",
|
|
78
|
-
"kill",
|
|
79
|
-
"pkill",
|
|
80
|
-
"killall",
|
|
81
|
-
"shutdown",
|
|
82
|
-
"reboot",
|
|
83
|
-
]),
|
|
84
|
-
];
|
|
85
|
-
}
|
|
86
|
-
if (!answers.securityPathsDeny) {
|
|
87
|
-
config.security.paths.denied = [];
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
33
|
saveConfig(config, configPath);
|
|
91
34
|
console.log(t("cli.config_saved"));
|
|
92
35
|
});
|
|
@@ -152,12 +95,9 @@ export function createProgram() {
|
|
|
152
95
|
s.stop();
|
|
153
96
|
if (models.length > 0) {
|
|
154
97
|
console.log(t("cli.available_models"));
|
|
155
|
-
const { getCertMark } = await import("../modules/certification/manifest");
|
|
156
98
|
for (const m of models) {
|
|
157
99
|
const marker = m === config.model ? "* " : " ";
|
|
158
|
-
|
|
159
|
-
const cert = mark === "certified" ? "✔" : mark === "stale" ? "○" : "·";
|
|
160
|
-
console.log(` ${marker}${cert} ${m}`);
|
|
100
|
+
console.log(` ${marker}${m}`);
|
|
161
101
|
}
|
|
162
102
|
}
|
|
163
103
|
else {
|
|
@@ -181,59 +121,6 @@ export function createProgram() {
|
|
|
181
121
|
saveConfig(config, configPath);
|
|
182
122
|
console.log(t("cli.model_set", { name }));
|
|
183
123
|
});
|
|
184
|
-
model
|
|
185
|
-
.command("certify")
|
|
186
|
-
.argument("<name>", "Model name")
|
|
187
|
-
.option("--provider-url <url>", t("cli.cert_provider_url"))
|
|
188
|
-
.option("--provider-key <key>", t("cli.cert_provider_key"))
|
|
189
|
-
.option("--context-window <n>", t("cli.cert_context_window"))
|
|
190
|
-
.option("--tags <tags>", t("cli.cert_tags"), "core")
|
|
191
|
-
.option("--reps <n>", t("cli.cert_reps"))
|
|
192
|
-
.option("--force", t("cli.cert_force"))
|
|
193
|
-
.option("--clean", t("cli.cert_clean"))
|
|
194
|
-
.description(t("cli.certify"))
|
|
195
|
-
.action(async (name, cmdOpts) => {
|
|
196
|
-
const { config } = await bootstrap();
|
|
197
|
-
const { certify, parseTags } = await import("../modules/certification/cli");
|
|
198
|
-
await certify({
|
|
199
|
-
name,
|
|
200
|
-
providerUrl: cmdOpts.providerUrl,
|
|
201
|
-
providerKey: cmdOpts.providerKey,
|
|
202
|
-
contextWindow: cmdOpts.contextWindow
|
|
203
|
-
? parseInt(cmdOpts.contextWindow, 10)
|
|
204
|
-
: undefined,
|
|
205
|
-
tags: parseTags(cmdOpts.tags),
|
|
206
|
-
reps: cmdOpts.reps ? parseInt(cmdOpts.reps, 10) : 3,
|
|
207
|
-
force: cmdOpts.force === true,
|
|
208
|
-
clean: cmdOpts.clean === true,
|
|
209
|
-
config,
|
|
210
|
-
});
|
|
211
|
-
});
|
|
212
|
-
model
|
|
213
|
-
.command("cert-status")
|
|
214
|
-
.argument("<name>", "Model name")
|
|
215
|
-
.description(t("cli.cert_status"))
|
|
216
|
-
.action(async (name) => {
|
|
217
|
-
const { config } = await bootstrap();
|
|
218
|
-
const { certStatus } = await import("../modules/certification/cli");
|
|
219
|
-
await certStatus(name, config);
|
|
220
|
-
});
|
|
221
|
-
model
|
|
222
|
-
.command("cert-list")
|
|
223
|
-
.description(t("cli.cert_list"))
|
|
224
|
-
.action(async () => {
|
|
225
|
-
const { certList } = await import("../modules/certification/cli");
|
|
226
|
-
await certList();
|
|
227
|
-
});
|
|
228
|
-
model
|
|
229
|
-
.command("uncertify")
|
|
230
|
-
.argument("<name>", "Model name")
|
|
231
|
-
.description(t("cli.cert_uncertify"))
|
|
232
|
-
.action(async (name) => {
|
|
233
|
-
const { config } = await bootstrap();
|
|
234
|
-
const { uncertify } = await import("../modules/certification/cli");
|
|
235
|
-
await uncertify(name, config);
|
|
236
|
-
});
|
|
237
124
|
// Context window command
|
|
238
125
|
program
|
|
239
126
|
.command("context")
|
package/dist/cli/main.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Repl } from "./repl";
|
|
|
4
4
|
import { formatMarkdown } from "../ui/md-formatter";
|
|
5
5
|
import { Renderer } from "../ui/renderer";
|
|
6
6
|
import { runSetup } from "./setup";
|
|
7
|
-
import { saveConfig
|
|
7
|
+
import { saveConfig } from "../config/config";
|
|
8
8
|
import { t } from "../i18n/index";
|
|
9
9
|
import { pc } from "../ui/colors";
|
|
10
10
|
import { existsSync } from "fs";
|
|
@@ -43,16 +43,13 @@ async function main() {
|
|
|
43
43
|
process.stdout.write("\n");
|
|
44
44
|
process.exit(result.success ? 0 : 1);
|
|
45
45
|
}
|
|
46
|
-
const renderer = new Renderer({
|
|
47
|
-
spinner: config.ui?.spinner ?? true,
|
|
48
|
-
toolStyle: config.ui?.toolStyle ?? "inline",
|
|
49
|
-
});
|
|
46
|
+
const renderer = new Renderer({ spinner: config.ui?.spinner ?? true });
|
|
50
47
|
const result = await agent.run(prompt, (chunk) => renderer.text(chunk), (meta) => renderer.meta(meta), (ev) => {
|
|
51
48
|
if (ev.type === "start") {
|
|
52
49
|
renderer.toolStart(ev.tool, ev.args);
|
|
53
50
|
}
|
|
54
51
|
else {
|
|
55
|
-
renderer.toolEnd(ev.tool, ev.duration ?? 0, ev.error
|
|
52
|
+
renderer.toolEnd(ev.tool, ev.duration ?? 0, ev.error);
|
|
56
53
|
}
|
|
57
54
|
}, (phase) => {
|
|
58
55
|
if (phase === "thinking") {
|
|
@@ -82,12 +79,7 @@ async function main() {
|
|
|
82
79
|
if (!existsSync(configPath)) {
|
|
83
80
|
console.log(pc.yellow("\n " + t("cli.first_run") + "\n"));
|
|
84
81
|
const answers = await runSetup();
|
|
85
|
-
const config =
|
|
86
|
-
configDir: join(homedir(), ".mma"),
|
|
87
|
-
projectConfigPath: projectDir
|
|
88
|
-
? join(projectDir, ".mmrc")
|
|
89
|
-
: join(process.cwd(), ".mmrc"),
|
|
90
|
-
});
|
|
82
|
+
const { config } = await bootstrap(undefined, projectDir, noAgentsMd, exitOnComplete);
|
|
91
83
|
config.provider.type = answers.provider;
|
|
92
84
|
config.provider.baseUrl = answers.apiBase;
|
|
93
85
|
config.provider.apiKey = answers.apiKey;
|
|
@@ -96,32 +88,13 @@ async function main() {
|
|
|
96
88
|
config.maxToolIterations = answers.maxToolIterations;
|
|
97
89
|
config.locale = answers.locale;
|
|
98
90
|
if (config.security) {
|
|
99
|
-
config.security.enabled =
|
|
100
|
-
answers.securityBashBlock ||
|
|
101
|
-
answers.securityFlagsBlock ||
|
|
102
|
-
!answers.securityPathsDeny;
|
|
103
|
-
config.security.bash.enabled = config.security.enabled;
|
|
104
91
|
config.security.bash.blockDangerousFlags = answers.securityFlagsBlock;
|
|
105
92
|
if (answers.securityBashBlock) {
|
|
106
93
|
config.security.bash.blacklist = [
|
|
107
94
|
...new Set([
|
|
108
95
|
...config.security.bash.blacklist,
|
|
109
|
-
"rm",
|
|
110
|
-
"
|
|
111
|
-
"chmod",
|
|
112
|
-
"wget",
|
|
113
|
-
"curl",
|
|
114
|
-
"scp",
|
|
115
|
-
"ssh",
|
|
116
|
-
"nc",
|
|
117
|
-
"netcat",
|
|
118
|
-
"sudo",
|
|
119
|
-
"su",
|
|
120
|
-
"kill",
|
|
121
|
-
"pkill",
|
|
122
|
-
"killall",
|
|
123
|
-
"shutdown",
|
|
124
|
-
"reboot",
|
|
96
|
+
"rm", "dd", "chmod", "wget", "curl", "scp", "ssh", "nc", "netcat",
|
|
97
|
+
"sudo", "su", "kill", "pkill", "killall", "shutdown", "reboot",
|
|
125
98
|
]),
|
|
126
99
|
];
|
|
127
100
|
}
|
|
@@ -131,8 +104,8 @@ async function main() {
|
|
|
131
104
|
}
|
|
132
105
|
saveConfig(config, configPath);
|
|
133
106
|
}
|
|
134
|
-
const { agent, config, sessionManager, skillsModule, pluginManager, configDir, baseDir,
|
|
135
|
-
const repl = new Repl(agent, config, sessionManager, skillsModule, pluginManager, configDir, baseDir, noAgentsMd
|
|
107
|
+
const { agent, config, sessionManager, skillsModule, pluginManager, configDir, baseDir, } = await bootstrap(undefined, projectDir, noAgentsMd, exitOnComplete);
|
|
108
|
+
const repl = new Repl(agent, config, sessionManager, skillsModule, pluginManager, configDir, baseDir, noAgentsMd);
|
|
136
109
|
repl.start();
|
|
137
110
|
}
|
|
138
111
|
}
|