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.
Files changed (94) hide show
  1. package/dist/cli/commands.js +3 -116
  2. package/dist/cli/main.js +8 -35
  3. package/dist/cli/repl.js +611 -110
  4. package/dist/cli/setup.js +12 -32
  5. package/dist/config/config.js +30 -46
  6. package/dist/config/defaults.js +1 -10
  7. package/dist/config/security.js +8 -15
  8. package/dist/core/agent-moe.js +12 -24
  9. package/dist/core/agent.js +47 -281
  10. package/dist/core/bootstrap.js +36 -52
  11. package/dist/core/session-logger.js +2 -35
  12. package/dist/i18n/en.json +15 -79
  13. package/dist/i18n/index.js +9 -12
  14. package/dist/i18n/ru.json +15 -79
  15. package/dist/index.js +13 -13
  16. package/dist/llm/openai-compat.js +10 -39
  17. package/dist/logger/app-logger.js +16 -83
  18. package/dist/main.js +624 -243
  19. package/dist/modules/browser/session.js +60 -108
  20. package/dist/modules/context/history.js +15 -0
  21. package/dist/modules/context/manager.js +10 -119
  22. package/dist/modules/execution/auditor.js +39 -33
  23. package/dist/modules/execution/index.js +6 -8
  24. package/dist/modules/execution/module.js +32 -474
  25. package/dist/modules/execution/moe-executor.js +40 -97
  26. package/dist/modules/execution/planner.js +13 -63
  27. package/dist/modules/execution/stuck-detector.js +39 -252
  28. package/dist/modules/execution/tracker.js +7 -21
  29. package/dist/modules/execution/verifier.js +17 -46
  30. package/dist/modules/hallucination/confidence.js +2 -7
  31. package/dist/modules/hallucination/consistency.js +42 -8
  32. package/dist/modules/hallucination/detector.js +21 -26
  33. package/dist/modules/hallucination/factual.js +150 -170
  34. package/dist/modules/hallucination/index.js +4 -5
  35. package/dist/modules/index.js +5 -5
  36. package/dist/modules/mcp/client.js +2 -8
  37. package/dist/modules/memory/store.js +0 -4
  38. package/dist/modules/plugins/builtin/lint-on-write.js +38 -143
  39. package/dist/modules/processes/detect.js +34 -0
  40. package/dist/modules/processes/index.js +2 -1
  41. package/dist/modules/processes/registry.js +35 -125
  42. package/dist/modules/processes/runner.js +110 -9
  43. package/dist/modules/security/audit-log.js +10 -30
  44. package/dist/modules/security/command-validator.js +16 -42
  45. package/dist/modules/security/content-scanner.js +8 -9
  46. package/dist/modules/security/network-validator.js +2 -2
  47. package/dist/modules/security/path-validator.js +10 -64
  48. package/dist/modules/security/security-policies.js +67 -221
  49. package/dist/modules/security/session-encryption.js +25 -42
  50. package/dist/modules/session/manager.js +10 -15
  51. package/dist/modules/session/store.js +8 -62
  52. package/dist/modules/skills/index.js +3 -2
  53. package/dist/modules/skills/matcher.js +27 -0
  54. package/dist/modules/skills/module.js +23 -10
  55. package/dist/tools/bash.js +90 -287
  56. package/dist/tools/create-dir.js +1 -0
  57. package/dist/tools/delete-file.js +1 -0
  58. package/dist/tools/edit-file.js +8 -10
  59. package/dist/tools/executor.js +7 -57
  60. package/dist/tools/grep-tool.js +29 -51
  61. package/dist/tools/index.js +40 -55
  62. package/dist/tools/load-skill.js +18 -14
  63. package/dist/tools/move-file.js +2 -3
  64. package/dist/tools/pipeline-run.js +1 -1
  65. package/dist/tools/read-file.js +5 -15
  66. package/dist/tools/search-history.js +22 -42
  67. package/dist/tools/subagent.js +12 -21
  68. package/dist/tools/web-browse.js +25 -54
  69. package/dist/tools/web-fetch.js +34 -60
  70. package/dist/tools/web-search.js +20 -39
  71. package/dist/tools/write-file.js +10 -13
  72. package/dist/ui/diff.js +16 -9
  73. package/dist/ui/renderer.js +6 -69
  74. package/package.json +1 -1
  75. package/dist/cli/repl-commands.js +0 -633
  76. package/dist/core/workspace.js +0 -76
  77. package/dist/logger/file-log.js +0 -151
  78. package/dist/modules/certification/cli.js +0 -176
  79. package/dist/modules/certification/fact-checker.js +0 -84
  80. package/dist/modules/certification/loader.js +0 -111
  81. package/dist/modules/certification/manifest.js +0 -50
  82. package/dist/modules/certification/runner.js +0 -162
  83. package/dist/modules/certification/scenarios.js +0 -124
  84. package/dist/modules/certification/types.js +0 -1
  85. package/dist/modules/execution/plan-coverage.js +0 -68
  86. package/dist/modules/execution/plan-persister.js +0 -46
  87. package/dist/modules/execution/plan-store.js +0 -159
  88. package/dist/modules/hallucination/js-identifiers.js +0 -72
  89. package/dist/modules/hallucination/llm-judge.js +0 -103
  90. package/dist/modules/lsp/client.js +0 -235
  91. package/dist/modules/lsp/config.js +0 -81
  92. package/dist/modules/lsp/index.js +0 -3
  93. package/dist/modules/lsp/module.js +0 -68
  94. package/dist/modules/lsp/types.js +0 -1
@@ -1,24 +1,16 @@
1
- import { existsSync } from "fs";
2
- import { resolve } from "path";
3
- import { t } from "../../i18n/index";
4
- import { isJsMemberAccess } from "../hallucination/js-identifiers";
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
- // process.env / console.log in step descriptions are JS member access,
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((s) => s.status === "done").length;
25
+ const doneSteps = plan.steps.filter(s => s.status === 'done').length;
34
26
  const totalSteps = plan.steps.length;
35
- let massEditWarning = null;
36
- if (uniqueFiles.length > MASS_EDIT_THRESHOLD) {
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("exec.audit_pass", {
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
- summary = t("exec.audit_fail", {
52
- done: doneSteps,
53
- total: totalSteps,
54
- files: missingFiles.length,
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
- massEditWarning,
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 "./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";
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';