micro-models-agent 0.36.3 → 0.37.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 (2) hide show
  1. package/dist/main.js +37 -18
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -15726,34 +15726,53 @@ class ModuleRegistry {
15726
15726
 
15727
15727
  // src/modules/plugins/loader.ts
15728
15728
  import { readdirSync as readdirSync7, existsSync as existsSync26, statSync as statSync5 } from "fs";
15729
- import { join as join21 } from "path";
15729
+ import { join as join21, basename as basename2 } from "path";
15730
15730
 
15731
15731
  class PluginLoader {
15732
15732
  loadFromDir(dirPath, pluginManager, logger) {
15733
15733
  if (!existsSync26(dirPath))
15734
15734
  return;
15735
- const entries = readdirSync7(dirPath);
15735
+ const entries = readdirSync7(dirPath).sort();
15736
15736
  for (const entry of entries) {
15737
15737
  const fullPath = join21(dirPath, entry);
15738
- if (!statSync5(fullPath).isFile())
15739
- continue;
15740
- if (!entry.endsWith(".ts") && !entry.endsWith(".js"))
15741
- continue;
15742
- try {
15743
- const mod = __require(fullPath);
15744
- const plugin = mod.default || mod.plugin;
15745
- if (plugin && plugin.name) {
15746
- pluginManager.register(plugin);
15747
- logger?.warn(t("plugin.loaded", { name: plugin.name }));
15738
+ const stat = statSync5(fullPath);
15739
+ if (stat.isFile()) {
15740
+ if (!entry.endsWith(".ts") && !entry.endsWith(".js"))
15741
+ continue;
15742
+ this.tryLoad(fullPath, entry, pluginManager, logger);
15743
+ } else if (stat.isDirectory()) {
15744
+ const entryFile = this.findEntryFile(fullPath);
15745
+ if (entryFile) {
15746
+ this.tryLoad(entryFile, `${entry}/${basename2(entryFile)}`, pluginManager, logger);
15748
15747
  }
15749
- } catch (e) {
15750
- logger?.warn(t("plugin.skipped", { entry, message: e.message }));
15751
15748
  }
15752
15749
  }
15753
15750
  }
15751
+ findEntryFile(dir) {
15752
+ for (const name of FOLDER_ENTRY_NAMES) {
15753
+ const candidate = join21(dir, name);
15754
+ if (existsSync26(candidate))
15755
+ return candidate;
15756
+ }
15757
+ return null;
15758
+ }
15759
+ tryLoad(fullPath, label, pluginManager, logger) {
15760
+ try {
15761
+ const mod = __require(fullPath);
15762
+ const plugin = mod.default || mod.plugin;
15763
+ if (plugin && plugin.name) {
15764
+ pluginManager.register(plugin);
15765
+ logger?.warn(t("plugin.loaded", { name: plugin.name }));
15766
+ }
15767
+ } catch (e) {
15768
+ logger?.warn(t("plugin.skipped", { entry: label, message: e.message }));
15769
+ }
15770
+ }
15754
15771
  }
15772
+ var FOLDER_ENTRY_NAMES;
15755
15773
  var init_loader = __esm(() => {
15756
15774
  init_i18n();
15775
+ FOLDER_ENTRY_NAMES = ["plugin.ts", "plugin.js", "index.ts", "index.js"];
15757
15776
  });
15758
15777
 
15759
15778
  // src/modules/plugins/builtin/lint-on-write.ts
@@ -16265,12 +16284,12 @@ var init_audit_runners = __esm(() => {
16265
16284
 
16266
16285
  // src/modules/execution/auditor.ts
16267
16286
  import { existsSync as existsSync29, readdirSync as readdirSync9 } from "fs";
16268
- import { resolve as resolve18, join as join24, basename as basename2 } from "path";
16287
+ import { resolve as resolve18, join as join24, basename as basename3 } from "path";
16269
16288
  function findExistingFile(baseDir, filePath) {
16270
16289
  const direct = resolve18(baseDir, filePath);
16271
16290
  if (existsSync29(direct))
16272
16291
  return direct;
16273
- const name = basename2(filePath).toLowerCase();
16292
+ const name = basename3(filePath).toLowerCase();
16274
16293
  const suffix = filePath.replace(/\\/g, "/").toLowerCase();
16275
16294
  let found = null;
16276
16295
  const walk = (dir, depth) => {
@@ -16594,7 +16613,7 @@ function extractFilePaths(text) {
16594
16613
  }
16595
16614
  return result;
16596
16615
  }
16597
- function basename3(p) {
16616
+ function basename4(p) {
16598
16617
  const parts = p.split(/[/\\]/);
16599
16618
  return parts[parts.length - 1] ?? p;
16600
16619
  }
@@ -16606,7 +16625,7 @@ function checkPlanCoverage(taskText, stepDescriptions) {
16606
16625
  `);
16607
16626
  const missing = taskPaths.filter((p) => {
16608
16627
  const lower = p.toLowerCase();
16609
- const base = basename3(lower);
16628
+ const base = basename4(lower);
16610
16629
  return !stepText.includes(lower) && !stepText.includes(base);
16611
16630
  });
16612
16631
  return { missing };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "micro-models-agent",
3
- "version": "0.36.3",
3
+ "version": "0.37.0",
4
4
  "description": "Micro Models Agent (MMA) — LLM agent harness for small models (Qwen3.5-9B, 32K-64K context)",
5
5
  "type": "module",
6
6
  "bin": {