@matatbread/matbot-core 0.3.5 → 0.3.7

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/package.json +2 -2
  2. package/src/registry.ts +6 -1
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "node",
5
5
  "browser"
6
6
  ],
7
- "version": "0.3.5",
7
+ "version": "0.3.7",
8
8
  "engines": {
9
9
  "node": ">=24.0.0"
10
10
  },
@@ -35,7 +35,7 @@
35
35
  "access": "public"
36
36
  },
37
37
  "dependencies": {
38
- "@matatbread/matbot-plugin-api": "^0.3.5"
38
+ "@matatbread/matbot-plugin-api": "^0.3.7"
39
39
  },
40
40
  "devDependencies": {
41
41
  "typescript": "^6.0.3"
package/src/registry.ts CHANGED
@@ -175,9 +175,14 @@ export async function instantiateProvider(services: MatbotRuntime, config: Provi
175
175
  // already). The stored profile is NEVER rewritten: it stays exactly as the source wrote it (yaml path,
176
176
  // npm name, or a storage-backend manifest entry), so `provider list` reports the source truth rather than
177
177
  // a mix of specifiers and package names that depends on which profiles happen to have been used.
178
+ // The specifier→name scan only matches the *exact* string a profile was loaded with, so two profiles
179
+ // naming one adapter by different specifiers (a yaml path and the package name) miss each other; the
180
+ // host resolver closes that gap by deriving the canonical name the registry is actually keyed by —
181
+ // without it the second specifier force-loads and dies on "already registered".
178
182
  const name = tryResolveProviderFactory(config.module) !== undefined
179
183
  ? config.module
180
- : getPluginNameForSpecifier(config.module);
184
+ : getPluginNameForSpecifier(config.module)
185
+ ?? await services.resolver?.identify(config.module).catch(() => undefined);
181
186
  if (name !== undefined) {
182
187
  const factory = tryResolveProviderFactory(name);
183
188
  if (factory !== undefined) return factory(config);