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
|
@@ -1,24 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
const MASS_EDIT_THRESHOLD = 10;
|
|
1
|
+
import { execSync } from 'child_process';
|
|
2
|
+
import { existsSync } from 'fs';
|
|
3
|
+
import { resolve, join } from 'path';
|
|
4
|
+
import { t } from '../../i18n/index';
|
|
6
5
|
export class Auditor {
|
|
7
6
|
baseDir;
|
|
8
7
|
constructor(baseDir) {
|
|
9
8
|
this.baseDir = baseDir;
|
|
10
9
|
}
|
|
11
10
|
async audit(plan) {
|
|
12
|
-
const allStepText = plan.steps
|
|
13
|
-
.map((s) => s.description.replace(/\([^)]*\)/g, " "))
|
|
14
|
-
.join(" ");
|
|
11
|
+
const allStepText = plan.steps.map(s => s.description).join(' ');
|
|
15
12
|
const fileMatches = allStepText.match(/\b[\w./-]+\.[a-z]+/gi) || [];
|
|
16
|
-
|
|
17
|
-
// not files — drop them before existence checks (false "missing file"
|
|
18
|
-
// warnings).
|
|
19
|
-
const uniqueFiles = [
|
|
20
|
-
...new Set(fileMatches.filter((f) => !isJsMemberAccess(f))),
|
|
21
|
-
];
|
|
13
|
+
const uniqueFiles = [...new Set(fileMatches)];
|
|
22
14
|
const missingFiles = [];
|
|
23
15
|
const existingFiles = [];
|
|
24
16
|
for (const filePath of uniqueFiles) {
|
|
@@ -30,29 +22,22 @@ export class Auditor {
|
|
|
30
22
|
missingFiles.push(filePath);
|
|
31
23
|
}
|
|
32
24
|
}
|
|
33
|
-
const doneSteps = plan.steps.filter(
|
|
25
|
+
const doneSteps = plan.steps.filter(s => s.status === 'done').length;
|
|
34
26
|
const totalSteps = plan.steps.length;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
massEditWarning = t("exec.mass_edit_warning", {
|
|
38
|
-
count: String(uniqueFiles.length),
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
const passed = missingFiles.length === 0;
|
|
27
|
+
const typeCheckError = await this.runProjectTypeCheck();
|
|
28
|
+
const passed = missingFiles.length === 0 && !typeCheckError;
|
|
42
29
|
let summary;
|
|
43
30
|
if (passed) {
|
|
44
|
-
summary = t(
|
|
45
|
-
done: doneSteps,
|
|
46
|
-
total: totalSteps,
|
|
47
|
-
files: existingFiles.length,
|
|
48
|
-
});
|
|
31
|
+
summary = t('exec.audit_pass', { done: doneSteps, total: totalSteps, files: existingFiles.length });
|
|
49
32
|
}
|
|
50
33
|
else {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
total: totalSteps,
|
|
54
|
-
|
|
55
|
-
|
|
34
|
+
const missingCount = missingFiles.length;
|
|
35
|
+
if (typeCheckError) {
|
|
36
|
+
summary = t('exec.audit_fail_typecheck', { done: doneSteps, total: totalSteps, missing: missingCount, typeError: typeCheckError });
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
summary = t('exec.audit_fail', { done: doneSteps, total: totalSteps, files: missingCount });
|
|
40
|
+
}
|
|
56
41
|
}
|
|
57
42
|
return {
|
|
58
43
|
passed,
|
|
@@ -60,7 +45,28 @@ export class Auditor {
|
|
|
60
45
|
createdFiles: existingFiles,
|
|
61
46
|
modifiedFiles: [],
|
|
62
47
|
summary,
|
|
63
|
-
|
|
48
|
+
typeCheckError,
|
|
64
49
|
};
|
|
65
50
|
}
|
|
51
|
+
async runProjectTypeCheck() {
|
|
52
|
+
const tsconfigPath = join(this.baseDir, 'tsconfig.json');
|
|
53
|
+
if (!existsSync(tsconfigPath)) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
execSync(`npx tsc --noEmit --skipLibCheck`, { cwd: this.baseDir, stdio: 'pipe', timeout: 30000 });
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
if (err.status === 127 || err.message.includes('not found') || err.message.includes('ENOENT')) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
const stderr = err.stderr?.toString() || err.stdout?.toString() || '';
|
|
65
|
+
if (stderr.includes('error TS')) {
|
|
66
|
+
const firstError = stderr.split('\n').find((line) => line.includes('error TS')) || 'TypeScript type error';
|
|
67
|
+
return firstError.trim();
|
|
68
|
+
}
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
66
72
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
export { ExecutionModule } from
|
|
2
|
-
export { PlanCreator } from
|
|
3
|
-
export { PlanTracker } from
|
|
4
|
-
export { StepVerifier } from
|
|
5
|
-
export { StuckDetector } from
|
|
6
|
-
export { Auditor } from
|
|
7
|
-
export { PlanPersister } from "./plan-persister";
|
|
8
|
-
export { PlanStore } from "./plan-store";
|
|
1
|
+
export { ExecutionModule } from './module';
|
|
2
|
+
export { PlanCreator } from './planner';
|
|
3
|
+
export { PlanTracker } from './tracker';
|
|
4
|
+
export { StepVerifier } from './verifier';
|
|
5
|
+
export { StuckDetector } from './stuck-detector';
|
|
6
|
+
export { Auditor } from './auditor';
|