@kb-labs/cli-commands 2.15.0 → 2.17.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/index.js CHANGED
@@ -1112,10 +1112,13 @@ var InMemoryRegistry = class {
1112
1112
  * Returns the colliding key if found, null otherwise.
1113
1113
  */
1114
1114
  _findSystemCollision(manifest, canonicalId) {
1115
- if (this.systemCommands.has(canonicalId)) return canonicalId;
1116
- if (this.systemCommands.has(manifest.id)) return manifest.id;
1115
+ if (this.systemCommands.has(canonicalId)) {
1116
+ return canonicalId;
1117
+ }
1117
1118
  const space = canonicalId.replace(/:/g, " ");
1118
- if (this.systemCommands.has(space)) return space;
1119
+ if (this.systemCommands.has(space)) {
1120
+ return space;
1121
+ }
1119
1122
  return null;
1120
1123
  }
1121
1124
  /**
@@ -3761,23 +3764,24 @@ async function registerManifests(discoveryResults, registry2, options = {}) {
3761
3764
  } catch (hookError) {
3762
3765
  log3.debug(`Lifecycle hooks unavailable for ${manifest.id}: ${hookError.message}`);
3763
3766
  }
3764
- const existing = globalIds.get(manifest.id);
3767
+ const canonicalKey = manifest.group ? `${manifest.group}:${manifest.id}` : manifest.id;
3768
+ const existing = globalIds.get(canonicalKey);
3765
3769
  if (existing) {
3766
3770
  const collision = checkCollision(manifest, existing, result.source, namespace);
3767
3771
  if (collision.shouldShadow) {
3768
3772
  existing.shadowed = true;
3769
- globalIds.set(manifest.id, cmd);
3773
+ globalIds.set(canonicalKey, cmd);
3770
3774
  if (logLevel === "info" || logLevel === "debug") {
3771
- log3.info(`${manifest.id} from ${result.source} shadows ${existing.source} version`);
3775
+ log3.info(`${canonicalKey} from ${result.source} shadows ${existing.source} version`);
3772
3776
  }
3773
3777
  } else {
3774
3778
  cmd.shadowed = true;
3775
3779
  if (logLevel === "info" || logLevel === "debug") {
3776
- log3.info(`${manifest.id} from ${result.source} shadowed by ${existing.source} version`);
3780
+ log3.info(`${canonicalKey} from ${result.source} shadowed by ${existing.source} version`);
3777
3781
  }
3778
3782
  }
3779
3783
  } else {
3780
- globalIds.set(manifest.id, cmd);
3784
+ globalIds.set(canonicalKey, cmd);
3781
3785
  }
3782
3786
  const aliasesToCheck = manifest.aliases || [];
3783
3787
  for (const alias of aliasesToCheck) {