@eum-agent/extension-catalog 1.0.0 → 1.0.1

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/index.js +4 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -380,6 +380,7 @@ function createDefaultsService(options) {
380
380
  record.lastReasonCode = "INSTALL_FAILED";
381
381
  }
382
382
  }
383
+ if (record.lastReasonCode === "INSTALL_FAILED" && !record.candidates.some((candidate) => candidate.state === "pending")) delete record.lastReasonCode;
383
384
  persist(record);
384
385
  }
385
386
  async function joinOperation(operationId) {
@@ -447,7 +448,7 @@ function createDefaultsService(options) {
447
448
  }
448
449
  if (record.state === "complete") return;
449
450
  const observations = await options.installer.observe();
450
- for (const candidate of record.candidates.filter((c) => c.state === "pending")) if (observations.some((o) => o.packageName === candidate.packageName)) {
451
+ for (const candidate of record.candidates.filter((c) => c.state === "pending")) if (observations.some((o) => o.packageName === candidate.packageName && o.declared.origin !== void 0)) {
451
452
  candidate.state = "user-managed";
452
453
  candidate.reasonCode = "USER_DECLARATION_PRESERVED";
453
454
  } else {
@@ -852,7 +853,7 @@ function createCatalogService(options) {
852
853
  if (!release || release.artifact.integrity !== selection.artifactIntegrity) throw new CatalogError("RELEASE_UNLISTED", "Selected exact release is not listed");
853
854
  if (!releaseCompatible(release, host)) throw new CatalogError("RELEASE_INCOMPATIBLE", "Selected release does not accept the current product and host target");
854
855
  const existing = observations.find((o) => o.packageName === release.packageName);
855
- if (automatic && existing) throw new CatalogError("STALE_PREVIEW", "A user declaration now owns this default extension");
856
+ if (automatic && existing?.declared.origin !== void 0) throw new CatalogError("STALE_PREVIEW", "A user declaration now owns this default extension");
856
857
  if (selection.expectedInstalledReceiptId !== void 0 && existing?.receipt?.receiptId !== selection.expectedInstalledReceiptId) throw new CatalogError("STALE_PREVIEW", "Current installed receipt differs from the displayed selection");
857
858
  const prior = roots.find((r) => r.packageName === release.packageName);
858
859
  if (prior && recordDigest(prior) !== recordDigest(release)) throw new CatalogError("DEPENDENCY_UNRESOLVED", "Extension roots select conflicting exact releases");
@@ -882,7 +883,7 @@ function createCatalogService(options) {
882
883
  if (!semver.satisfies(selected.version, range)) throw new CatalogError("DEPENDENCY_UNRESOLVED", "Exact closure cannot satisfy all extension requirements");
883
884
  continue;
884
885
  }
885
- const installed = observations.find((o) => o.packageName === name);
886
+ const installed = observations.find((o) => o.packageName === name && o.declared.origin !== void 0);
886
887
  if (automatic && installed && (!installed.declared.installed || !installed.declared.enabled)) throw new CatalogError("DEPENDENCY_USER_MANAGED", "An existing dependency declaration does not permit default installation");
887
888
  const installedVersion = installed?.receipt?.version ?? installed?.declared.version ?? installed?.summary?.version;
888
889
  if (installedVersion && semver.valid(installedVersion) && semver.satisfies(installedVersion, range)) continue;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "en-US": "Extension Catalog",
5
5
  "zh-CN": "扩展目录"
6
6
  },
7
- "version": "1.0.0",
7
+ "version": "1.0.1",
8
8
  "type": "module",
9
9
  "description": "Extension Catalog",
10
10
  "license": "MIT",