micro-models-agent 0.39.0 → 0.40.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/bin/mma.mjs +41 -41
- package/dist/cli/commands.js +116 -3
- package/dist/cli/main.js +35 -8
- package/dist/cli/repl-commands.js +633 -0
- package/dist/cli/repl.js +110 -611
- package/dist/cli/setup.js +32 -12
- package/dist/config/config.js +46 -30
- package/dist/config/defaults.js +10 -1
- package/dist/config/security.js +15 -8
- package/dist/core/agent-moe.js +24 -12
- package/dist/core/agent.js +281 -47
- package/dist/core/bootstrap.js +52 -36
- package/dist/core/session-logger.js +35 -2
- package/dist/core/workspace.js +76 -0
- package/dist/i18n/en.json +79 -15
- package/dist/i18n/index.js +12 -9
- package/dist/i18n/ru.json +79 -15
- package/dist/index.js +13 -13
- package/dist/llm/openai-compat.js +39 -10
- package/dist/logger/app-logger.js +83 -16
- package/dist/logger/file-log.js +151 -0
- package/dist/main.js +537 -284
- package/dist/modules/browser/bridge-server.mjs +113 -105
- package/dist/modules/browser/session.js +108 -60
- package/dist/modules/certification/cli.js +176 -0
- package/dist/modules/certification/fact-checker.js +84 -0
- package/dist/modules/certification/loader.js +111 -0
- package/dist/modules/certification/manifest.js +50 -0
- package/dist/modules/certification/runner.js +162 -0
- package/dist/modules/certification/scenarios.js +124 -0
- package/dist/modules/certification/types.js +1 -0
- package/dist/modules/context/manager.js +119 -10
- package/dist/modules/execution/auditor.js +33 -39
- package/dist/modules/execution/index.js +8 -6
- package/dist/modules/execution/module.js +474 -32
- package/dist/modules/execution/moe-executor.js +97 -40
- package/dist/modules/execution/plan-coverage.js +68 -0
- package/dist/modules/execution/plan-persister.js +46 -0
- package/dist/modules/execution/plan-store.js +159 -0
- package/dist/modules/execution/planner.js +63 -13
- package/dist/modules/execution/stuck-detector.js +252 -39
- package/dist/modules/execution/tracker.js +21 -7
- package/dist/modules/execution/verifier.js +46 -17
- package/dist/modules/hallucination/confidence.js +7 -2
- package/dist/modules/hallucination/consistency.js +8 -42
- package/dist/modules/hallucination/detector.js +26 -21
- package/dist/modules/hallucination/factual.js +170 -150
- package/dist/modules/hallucination/index.js +5 -4
- package/dist/modules/hallucination/js-identifiers.js +72 -0
- package/dist/modules/hallucination/llm-judge.js +103 -0
- package/dist/modules/index.js +5 -5
- package/dist/modules/lsp/client.js +235 -0
- package/dist/modules/lsp/config.js +81 -0
- package/dist/modules/lsp/index.js +3 -0
- package/dist/modules/lsp/module.js +68 -0
- package/dist/modules/lsp/types.js +1 -0
- package/dist/modules/mcp/client.js +8 -2
- package/dist/modules/memory/store.js +4 -0
- package/dist/modules/plugins/builtin/lint-on-write.js +143 -38
- package/dist/modules/processes/index.js +1 -2
- package/dist/modules/processes/registry.js +125 -35
- package/dist/modules/processes/runner.js +9 -110
- package/dist/modules/security/audit-log.js +30 -10
- package/dist/modules/security/command-validator.js +42 -16
- package/dist/modules/security/content-scanner.js +9 -8
- package/dist/modules/security/network-validator.js +2 -2
- package/dist/modules/security/path-validator.js +64 -10
- package/dist/modules/security/security-policies.js +221 -67
- package/dist/modules/security/session-encryption.js +42 -25
- package/dist/modules/session/manager.js +15 -10
- package/dist/modules/session/store.js +62 -8
- package/dist/modules/skills/index.js +2 -3
- package/dist/modules/skills/module.js +10 -23
- package/dist/tools/bash.js +287 -90
- package/dist/tools/create-dir.js +0 -1
- package/dist/tools/delete-file.js +0 -1
- package/dist/tools/edit-file.js +10 -8
- package/dist/tools/executor.js +57 -7
- package/dist/tools/grep-tool.js +51 -29
- package/dist/tools/index.js +55 -40
- package/dist/tools/load-skill.js +14 -18
- package/dist/tools/move-file.js +3 -2
- package/dist/tools/pipeline-run.js +1 -1
- package/dist/tools/read-file.js +15 -5
- package/dist/tools/search-history.js +42 -22
- package/dist/tools/subagent.js +21 -12
- package/dist/tools/web-browse.js +54 -25
- package/dist/tools/web-fetch.js +60 -34
- package/dist/tools/web-search.js +39 -20
- package/dist/tools/write-file.js +13 -10
- package/dist/ui/diff.js +9 -16
- package/dist/ui/renderer.js +69 -6
- package/package.json +48 -45
- package/dist/modules/context/history.js +0 -15
- package/dist/modules/processes/detect.js +0 -34
- package/dist/modules/skills/matcher.js +0 -27
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { appendFileSync, mkdirSync, existsSync } from 'fs';
|
|
2
|
-
import { join } from 'path';
|
|
3
|
-
export class SessionHistoryWriter {
|
|
4
|
-
historyPath;
|
|
5
|
-
constructor(sessionsDir, sessionId) {
|
|
6
|
-
const sessionDir = join(sessionsDir, sessionId);
|
|
7
|
-
if (!existsSync(sessionDir)) {
|
|
8
|
-
mkdirSync(sessionDir, { recursive: true });
|
|
9
|
-
}
|
|
10
|
-
this.historyPath = join(sessionDir, 'history.jsonl');
|
|
11
|
-
}
|
|
12
|
-
append(msg) {
|
|
13
|
-
appendFileSync(this.historyPath, JSON.stringify(msg) + '\n', 'utf-8');
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Heuristic detection of long-running (server/watch) commands.
|
|
3
|
-
*
|
|
4
|
-
* The explicit `background: true` bash parameter always wins; this list is a
|
|
5
|
-
* convenience so dev servers don't block the agent. It only inspects the raw
|
|
6
|
-
* shell command (a technical process-type decision, not task classification).
|
|
7
|
-
*/
|
|
8
|
-
const LONG_RUNNING_PATTERNS = [
|
|
9
|
-
/\b(npm|pnpm|yarn|bun|npx)\s+(run\s+)?(dev|start|serve|preview|watch|server)\b/i,
|
|
10
|
-
/\b(deno|node)\s+.*\b(run\s+)?(dev|serve|watch|server)\b/i,
|
|
11
|
-
/(^|\s)--watch\b/i,
|
|
12
|
-
/(^|\s)-w\b/i,
|
|
13
|
-
/\bnodemon\b/i,
|
|
14
|
-
/\btsx watch\b/i,
|
|
15
|
-
/\b(ts-node|tsc)\s+.*--watch\b/i,
|
|
16
|
-
/\bvite(?!\s+(build|create))\b/i,
|
|
17
|
-
/\bwebpack(-dev-server|\s+serve)\b/i,
|
|
18
|
-
/\bastro dev\b/i,
|
|
19
|
-
/\bnext (dev|start)\b/i,
|
|
20
|
-
/\bnuxt (dev|start)\b/i,
|
|
21
|
-
/\bsvelte-kit (dev|preview)\b/i,
|
|
22
|
-
/\bgatsby develop\b/i,
|
|
23
|
-
/\bdocker(-compose)?\s+.*\bup\b/i,
|
|
24
|
-
/\buvicorn\b|\bgunicorn\b/i,
|
|
25
|
-
/\bpython\s+-m\s+http\.server\b/i,
|
|
26
|
-
/\bflask run\b/i,
|
|
27
|
-
/\bphp artisan serve\b/i,
|
|
28
|
-
/\brails (server|s)\b/i,
|
|
29
|
-
/\bvitest watch\b/i,
|
|
30
|
-
/\bjest --watch\b/i,
|
|
31
|
-
];
|
|
32
|
-
export function isLongRunningCommand(command) {
|
|
33
|
-
return LONG_RUNNING_PATTERNS.some((pattern) => pattern.test(command));
|
|
34
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const MIN_WORD_LENGTH = 4;
|
|
2
|
-
export class SkillsMatcher {
|
|
3
|
-
match(taskDescription, skills, maxResults = 3) {
|
|
4
|
-
const taskWords = taskDescription.toLowerCase().split(/\W+/).filter(w => w.length >= MIN_WORD_LENGTH);
|
|
5
|
-
const scored = skills.map(skill => {
|
|
6
|
-
const allKeywords = [
|
|
7
|
-
skill.name.toLowerCase(),
|
|
8
|
-
skill.description.toLowerCase(),
|
|
9
|
-
...skill.keywords.map(k => k.toLowerCase()),
|
|
10
|
-
];
|
|
11
|
-
let score = 0;
|
|
12
|
-
for (const word of taskWords) {
|
|
13
|
-
for (const kw of allKeywords) {
|
|
14
|
-
if (kw === word || (kw.length >= MIN_WORD_LENGTH && kw.includes(word))) {
|
|
15
|
-
score++;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return { skill, score };
|
|
20
|
-
});
|
|
21
|
-
return scored
|
|
22
|
-
.filter(s => s.score > 0)
|
|
23
|
-
.sort((a, b) => b.score - a.score)
|
|
24
|
-
.slice(0, maxResults)
|
|
25
|
-
.map(s => s.skill);
|
|
26
|
-
}
|
|
27
|
-
}
|