@acidicsoil/portable-capabilities 0.1.13 → 0.1.15

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.
@@ -12153,6 +12153,15 @@ function resolveRuntimeEvidence(claim4, runtimeVersion) {
12153
12153
  reason: !applicable ? "version-inapplicable" : !sufficientState ? "insufficient-evidence" : !verified ? "unverified" : !confident ? "low-confidence" : !sourceComplete ? "incomplete-source" : claim4.stability === "deprecated" ? "deprecated" : "usable"
12154
12154
  };
12155
12155
  }
12156
+ function areRuntimeEvidenceClaimsUsable(claimIds, runtimeId, claims, runtimeVersion) {
12157
+ if (claimIds.length === 0) return false;
12158
+ return claimIds.every((claimId) => {
12159
+ const claim4 = claims.find(
12160
+ (candidate) => candidate.id === claimId && candidate.runtimeId === runtimeId
12161
+ );
12162
+ return claim4 !== void 0 && resolveRuntimeEvidence(claim4, runtimeVersion).usableForAutomaticInstall;
12163
+ });
12164
+ }
12156
12165
 
12157
12166
  // packages/compiler/src/negotiation/adapter-registry.ts
12158
12167
  var adapterIds = Object.freeze([
@@ -12175,7 +12184,9 @@ function negotiateCapability(artifact, descriptor, claims, version) {
12175
12184
  return artifact.invocationIntents.map((intent) => {
12176
12185
  const surface = descriptor.surfaces.find(
12177
12186
  (x) => x.semanticKind === intent && (x.versionRange === void 0 || isRuntimeVersionInRange(x.versionRange, version)) && x.evidenceClaimIds.some((claimId) => {
12178
- const claim4 = claims.find((candidate) => candidate.id === claimId);
12187
+ const claim4 = claims.find(
12188
+ (candidate) => candidate.id === claimId && candidate.runtimeId === descriptor.id
12189
+ );
12179
12190
  return claim4 !== void 0 && resolveRuntimeEvidence(claim4, version).reason !== "version-inapplicable";
12180
12191
  })
12181
12192
  );
@@ -12192,8 +12203,12 @@ function negotiateCapability(artifact, descriptor, claims, version) {
12192
12203
  evidenceClaimIds: [],
12193
12204
  reason: "no matching surface"
12194
12205
  };
12195
- const related = claims.filter((c4) => surface.evidenceClaimIds.includes(c4.id));
12196
- const usable = related.length > 0 && related.every((c4) => resolveRuntimeEvidence(c4, version).usableForAutomaticInstall);
12206
+ const usable = areRuntimeEvidenceClaimsUsable(
12207
+ surface.evidenceClaimIds,
12208
+ descriptor.id,
12209
+ claims,
12210
+ version
12211
+ );
12197
12212
  const degraded = descriptor.degradation.find((d) => d.from === intent);
12198
12213
  return {
12199
12214
  intent,
@@ -12454,7 +12469,22 @@ function planSetup(request, artifact, descriptor, claims, ownershipManifest) {
12454
12469
  request.runtimeVersion
12455
12470
  );
12456
12471
  const projectionPlan = planProjection(artifact, descriptor.id, request.scope, negotiations);
12457
- const baseInstallationPlan = planInstallation(projectionPlan, descriptor, request.runtimeVersion);
12472
+ const evidenceBackedDescriptor = {
12473
+ ...descriptor,
12474
+ locations: descriptor.locations.filter(
12475
+ (location) => location.installation === "manual" || location.installation === "unsupported" || areRuntimeEvidenceClaimsUsable(
12476
+ location.evidenceClaimIds,
12477
+ descriptor.id,
12478
+ policyClaims,
12479
+ request.runtimeVersion
12480
+ )
12481
+ )
12482
+ };
12483
+ const baseInstallationPlan = planInstallation(
12484
+ projectionPlan,
12485
+ evidenceBackedDescriptor,
12486
+ request.runtimeVersion
12487
+ );
12458
12488
  const mutatingIntent = request.intent === "setup" || request.intent === "update";
12459
12489
  let installationPlan = mutatingIntent ? baseInstallationPlan : { ...baseInstallationPlan, operations: [] };
12460
12490
  if (request.intent === "remove") {
@@ -12640,7 +12670,7 @@ async function resolveVerifiedCapabilityEntrypoint(options) {
12640
12670
  }
12641
12671
 
12642
12672
  // packages/cli/src/release.ts
12643
- var cliVersion = true ? "0.1.13" : createRequire(import.meta.url)("../../../package.json").version;
12673
+ var cliVersion = true ? "0.1.15" : createRequire(import.meta.url)("../../../package.json").version;
12644
12674
 
12645
12675
  // packages/adapters/src/antigravity/materialize.ts
12646
12676
  import { resolve as resolve4 } from "node:path";
@@ -16226,6 +16256,7 @@ function operationalContract(role) {
16226
16256
  resources: [
16227
16257
  roleFacet(role, "resources"),
16228
16258
  "Load [resource:resources/contract.json] for the complete role contract.",
16259
+ "Load [resource:resources/input.schema.json] before interpreting capability inputs.",
16229
16260
  "Load [resource:resources/output.schema.json] before constructing the final output."
16230
16261
  ],
16231
16262
  ambiguityAndAbstention: [roleFacet(role, "ambiguity"), roleFacet(role, "abstention")],
@@ -16270,6 +16301,20 @@ async function loadCanonicalArtifact(catalogRoot, capabilityId) {
16270
16301
  if (isAbsolute3(schemaRelativePath) || schemaRelativePath.startsWith(".."))
16271
16302
  throw new Error(`Canonical output schema escapes catalog: ${role.output.schema}`);
16272
16303
  const schemaContent = await readFile6(schemaFile, "utf8");
16304
+ const inputSchemaContent = `${JSON.stringify(
16305
+ {
16306
+ $schema: "https://json-schema.org/draft/2020-12/schema",
16307
+ type: "object",
16308
+ properties: Object.fromEntries(
16309
+ role.inputs.map((input) => [input.name, { description: input.description }])
16310
+ ),
16311
+ required: role.inputs.filter((input) => input.required).map((input) => input.name),
16312
+ additionalProperties: true
16313
+ },
16314
+ null,
16315
+ 2
16316
+ )}
16317
+ `;
16273
16318
  const contract = operationalContract(role);
16274
16319
  const contractContent = `${JSON.stringify(
16275
16320
  { ...role, output: { ...role.output, schema: "resources/output.schema.json" } },
@@ -16278,6 +16323,13 @@ async function loadCanonicalArtifact(catalogRoot, capabilityId) {
16278
16323
  )}
16279
16324
  `;
16280
16325
  const resources = [
16326
+ resource(
16327
+ file,
16328
+ "role.inputs",
16329
+ "resources/input.schema.json",
16330
+ "application/schema+json",
16331
+ inputSchemaContent
16332
+ ),
16281
16333
  resource(
16282
16334
  file,
16283
16335
  role.output.schema,