@happyvertical/smrt-scanner 0.70.3 → 0.71.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.
@@ -3901,7 +3901,12 @@ var ManifestAdapter = class ManifestAdapter {
3901
3901
  const manifestKey = definition.qualifiedName || definition.name.toLowerCase();
3902
3902
  objects[manifestKey] = definition;
3903
3903
  }
3904
- const recipes = this.qualifyRecipes(options.recipes ?? [], options.packageName);
3904
+ const ownerByClass = /* @__PURE__ */ new Map();
3905
+ for (const definition of Object.values(objects)) {
3906
+ if (!definition.packageName) continue;
3907
+ if (ownerByClass.get(definition.className) === void 0 || definition.packageName === options.packageName) ownerByClass.set(definition.className, definition.packageName);
3908
+ }
3909
+ const recipes = this.qualifyRecipes(options.recipes ?? [], options.packageName, ownerByClass);
3905
3910
  const selectorEntries = Object.entries(options.uiSelectors ?? {}).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
3906
3911
  const selectors = selectorEntries.length > 0 ? Object.fromEntries(selectorEntries.map(([id, decl]) => [id, {
3907
3912
  slotId: decl.slotId,
@@ -3921,8 +3926,11 @@ var ManifestAdapter = class ManifestAdapter {
3921
3926
  };
3922
3927
  }
3923
3928
  /** Qualify recipe model names (`@scope/pkg:Class`) once the package is known. */
3924
- qualifyRecipes(recipes, packageName) {
3925
- const qualify = (className) => packageName ? createQualifiedName(packageName, className) : className;
3929
+ qualifyRecipes(recipes, packageName, ownerByClass = /* @__PURE__ */ new Map()) {
3930
+ const qualify = (className) => {
3931
+ const owner = ownerByClass.get(className) ?? packageName;
3932
+ return owner ? createQualifiedName(owner, className) : className;
3933
+ };
3926
3934
  return recipes.map((recipe) => ({
3927
3935
  ...recipe,
3928
3936
  models: recipe.models.map(qualify),
@@ -3992,7 +4000,7 @@ var ManifestAdapter = class ManifestAdapter {
3992
4000
  if (converted) methods[method.name] = converted;
3993
4001
  }
3994
4002
  const collection = typeof classDef.decoratorConfig?.collection === "string" ? classDef.decoratorConfig.collection : defaultCollectionName(classDef.className);
3995
- const packageName = options.packageName || classDef.packageName;
4003
+ const packageName = options.packageNameForFile?.(classDef.filePath) || options.packageName || classDef.packageName;
3996
4004
  const qualifiedName = packageName ? createQualifiedName(packageName, classDef.className) : void 0;
3997
4005
  const extendsQualified = importedParentQualifiedName(classDef, packageName || void 0);
3998
4006
  return {
@@ -5161,4 +5169,4 @@ var OxcScanner = class {
5161
5169
  //#endregion
5162
5170
  export { isPrunedAgentSurfacePath as C, getLineColumn as D, sourceMayDeclareAgentSurface as E, isAgentSurfaceSourcePath as S, scanSvelteAgentSurface as T, normalizeGlobSeparators as _, extractSmrtImports as a, emptyAgentSurface as b, parseRecipeFile as c, extractRecipes as d, resolveRecipes as f, discoverSourceFiles as g, resolveEnumValues as h, defaultCollectionName as i, parseSource as l, InheritanceResolver as m, parseUiSelectorsFile as n, parseAgentSurfaceFile as o, sourceMayDeclareRecipe as p, ManifestAdapter as r, parseFile as s, OxcScanner as t, deriveHelpFieldRefs as u, relativeGlobToCwd as v, mergeAgentSurfaces as w, extractAgentSurface as x, checkAgentSurfaceToolNames as y };
5163
5171
 
5164
- //# sourceMappingURL=scanner-tseYDUFG.js.map
5172
+ //# sourceMappingURL=scanner-Bw5Uq9X9.js.map