@jskit-ai/jskit-cli 0.2.113 → 0.2.114

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.
@@ -0,0 +1,11 @@
1
+ export default Object.freeze({
2
+ bundleVersion: 1,
3
+ bundleId: "auth-local",
4
+ version: "0.1.0",
5
+ description: "Core authentication foundation, auth web package, and local file-backed auth provider.",
6
+ packages: [
7
+ "@jskit-ai/auth-core",
8
+ "@jskit-ai/auth-web",
9
+ "@jskit-ai/auth-provider-local-core"
10
+ ]
11
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/jskit-cli",
3
- "version": "0.2.113",
3
+ "version": "0.2.114",
4
4
  "description": "Bundle and package orchestration CLI for JSKIT apps.",
5
5
  "type": "module",
6
6
  "files": [
@@ -20,9 +20,9 @@
20
20
  "test": "node --test"
21
21
  },
22
22
  "dependencies": {
23
- "@jskit-ai/jskit-catalog": "0.1.108",
24
- "@jskit-ai/kernel": "0.1.101",
25
- "@jskit-ai/shell-web": "0.1.100",
23
+ "@jskit-ai/jskit-catalog": "0.1.109",
24
+ "@jskit-ai/kernel": "0.1.102",
25
+ "@jskit-ai/shell-web": "0.1.101",
26
26
  "@vue/compiler-sfc": "^3.5.29",
27
27
  "ts-morph": "^28.0.0"
28
28
  },
@@ -8,6 +8,7 @@ import {
8
8
  const BUILTIN_CAPABILITY_PROVIDERS = Object.freeze({
9
9
  "runtime.actions": Object.freeze(["@jskit-ai/kernel"])
10
10
  });
11
+ const EXCLUSIVE_CAPABILITIES = Object.freeze(["auth.provider"]);
11
12
 
12
13
  function listDeclaredCapabilities(capabilitiesSection, fieldName) {
13
14
  const section = ensureObject(capabilitiesSection);
@@ -168,9 +169,39 @@ function collectPlannedCapabilityIssues(plannedPackageIds, packageRegistry) {
168
169
  return issues;
169
170
  }
170
171
 
172
+ function collectExclusiveCapabilityIssues(plannedPackageIds, packageRegistry) {
173
+ const selectedPackageIds = sortStrings(
174
+ [...new Set(ensureArray(plannedPackageIds).map((value) => String(value || "").trim()).filter(Boolean))]
175
+ );
176
+ const issues = [];
177
+
178
+ for (const capabilityId of EXCLUSIVE_CAPABILITIES) {
179
+ const providers = [];
180
+ for (const packageId of selectedPackageIds) {
181
+ const packageEntry = packageRegistry.get(packageId);
182
+ if (!packageEntry) {
183
+ continue;
184
+ }
185
+ const provides = listDeclaredCapabilities(packageEntry.descriptor.capabilities, "provides");
186
+ if (provides.includes(capabilityId)) {
187
+ providers.push(packageId);
188
+ }
189
+ }
190
+ if (providers.length > 1) {
191
+ issues.push({
192
+ capabilityId,
193
+ providers: sortStrings(providers)
194
+ });
195
+ }
196
+ }
197
+
198
+ return issues;
199
+ }
200
+
171
201
  function validatePlannedCapabilityClosure(plannedPackageIds, packageRegistry, actionLabel) {
172
202
  const issues = collectPlannedCapabilityIssues(plannedPackageIds, packageRegistry);
173
- if (issues.length === 0) {
203
+ const exclusiveIssues = collectExclusiveCapabilityIssues(plannedPackageIds, packageRegistry);
204
+ if (issues.length === 0 && exclusiveIssues.length === 0) {
174
205
  return;
175
206
  }
176
207
 
@@ -183,6 +214,11 @@ function validatePlannedCapabilityClosure(plannedPackageIds, packageRegistry, ac
183
214
  `- ${issue.packageId} requires capability ${issue.capabilityId}, but no selected package provides it.${providersHint}`
184
215
  );
185
216
  }
217
+ for (const issue of exclusiveIssues) {
218
+ lines.push(
219
+ `- capability ${issue.capabilityId} is exclusive, but multiple selected packages provide it: ${issue.providers.join(", ")}.`
220
+ );
221
+ }
186
222
 
187
223
  throw createCliError(lines.join("\n"));
188
224
  }