@kb-labs/cli-commands 2.93.0 → 2.94.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.
@@ -1,5 +1,5 @@
1
- import { d as CommandManifest, A as AvailabilityCheck, R as RegisteredCommand, l as CommandRegistry, D as DiscoveryResult } from '../discover-D_Is1Qqq.js';
2
- export { b as CacheFile, c as CommandLookupResult, e as CommandModule, f as CommandType, F as FlagDefinition, G as GlobalFlags, g as PackageCacheEntry, P as ProductGroup, _ as __test, h as discoverManifests, i as discoverManifestsByNamespace, j as findCommand, k as findCommandWithType, r as registry, m as resetInProcCache } from '../discover-D_Is1Qqq.js';
1
+ import { d as CommandManifest, A as AvailabilityCheck, R as RegisteredCommand, l as CommandRegistry, D as DiscoveryResult } from '../discover-CCE84_5E.js';
2
+ export { b as CacheFile, c as CommandLookupResult, e as CommandModule, f as CommandType, F as FlagDefinition, G as GlobalFlags, g as PackageCacheEntry, P as ProductGroup, _ as __test, h as discoverManifests, i as discoverManifestsByNamespace, j as findCommand, k as findCommandWithType, r as registry, m as resetInProcCache } from '../discover-CCE84_5E.js';
3
3
  import { ILogger } from '@kb-labs/core-platform';
4
4
  import '@kb-labs/plugin-contracts';
5
5
 
@@ -830,14 +830,14 @@ function deduplicateManifests(all) {
830
830
  byPackageName.set(result.packageName, projectEntry);
831
831
  continue;
832
832
  }
833
- const winner = existing.scope === "platform" ? existing : result;
834
- const loser = existing.scope === "platform" ? result : existing;
835
- log("warn", JSON.stringify({
836
- code: "DISCOVERY_SCOPE_COLLISION",
833
+ const winner = existing.scope === "project" ? existing : result;
834
+ const loser = existing.scope === "project" ? result : existing;
835
+ log("debug", JSON.stringify({
836
+ code: "DISCOVERY_SCOPE_OVERRIDE",
837
837
  packageName: result.packageName,
838
- platformPath: winner.pkgRoot,
839
- projectPath: loser.pkgRoot,
840
- message: "Package exists in both platform and project scopes \u2014 platform wins."
838
+ projectPath: winner.pkgRoot,
839
+ platformPath: loser.pkgRoot,
840
+ message: "Package exists in both platform and project scopes \u2014 project wins."
841
841
  }));
842
842
  byPackageName.set(result.packageName, winner);
843
843
  continue;
@@ -1134,8 +1134,21 @@ async function discoverManifests(cwd, noCache = false, options = {}) {
1134
1134
  if (projectLocal.length > 0) {
1135
1135
  log("info", `Discovered ${projectLocal.length} project-local plugins`);
1136
1136
  }
1137
+ let projectWorkspace = [];
1138
+ if (roots.projectRoot !== roots.platformRoot) {
1139
+ try {
1140
+ const pwStart = Date.now();
1141
+ const raw = await discoverWorkspace(roots.projectRoot);
1142
+ projectWorkspace = raw.map((r) => ({ ...r, scope: "project" }));
1143
+ timings.projectWorkspace = Date.now() - pwStart;
1144
+ if (projectWorkspace.length > 0) {
1145
+ log("info", `Discovered ${projectWorkspace.length} project workspace packages with CLI manifests`);
1146
+ }
1147
+ } catch {
1148
+ }
1149
+ }
1137
1150
  const dedupStart = Date.now();
1138
- const results = deduplicateManifests([...workspace, ...installed, ...projectLocal]);
1151
+ const results = deduplicateManifests([...workspace, ...installed, ...projectLocal, ...projectWorkspace]);
1139
1152
  timings.deduplicate = Date.now() - dedupStart;
1140
1153
  const saveStart = Date.now();
1141
1154
  await saveCache(cwd, results, roots);