@inf-monkeys-tech/monkeys 1.1.13 → 1.1.14

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.
@@ -24682,7 +24682,6 @@ var assertCompatibleCapabilityUpgrade = (previous, next) => {
24682
24682
  }
24683
24683
  const manifestContract = (entry) => ({
24684
24684
  kind: entry.manifest.kind,
24685
- ports: entry.manifest.ports,
24686
24685
  runtime: { ...entry.manifest.runtime, providerBindings: entry.manifest.runtime.providerBindings.map((binding) => ({ ...binding, providerRef: { ...binding.providerRef, version: void 0 } })) },
24687
24686
  placement: entry.manifest.placement,
24688
24687
  accessibility: entry.manifest.accessibility
@@ -24709,7 +24708,15 @@ var assertCompatibleCapabilityUpgrade = (previous, next) => {
24709
24708
  for (const direction of ["inputPorts", "outputPorts"]) {
24710
24709
  const oldPorts = oldRegistration[direction];
24711
24710
  const newPorts = newRegistration[direction];
24712
- if (oldPorts.length !== newPorts.length) throw new TypeError("Public runtime ports cannot be removed or replaced.");
24711
+ const oldManifestPorts = previous.manifest.ports?.[direction === "inputPorts" ? "inputs" : "outputs"] ?? [];
24712
+ const newManifestPorts = next.manifest.ports?.[direction === "inputPorts" ? "inputs" : "outputs"] ?? [];
24713
+ for (const port of oldManifestPorts) {
24714
+ const replacement = newManifestPorts.find((candidate) => candidate.name === port.name);
24715
+ if (!replacement || canonicalContentHash(port) !== canonicalContentHash(replacement)) throw new TypeError("Published runtime port semantics changed.");
24716
+ }
24717
+ if (newManifestPorts.some((port) => port.required && !oldManifestPorts.some((previousPort) => previousPort.name === port.name)) || newPorts.some((port) => port.required && !oldPorts.some((previousPort) => previousPort.name === port.name))) {
24718
+ throw new TypeError("New runtime ports must be optional for published declarations.");
24719
+ }
24713
24720
  for (const port of oldPorts) {
24714
24721
  const replacement = newPorts.find((candidate) => candidate.name === port.name);
24715
24722
  if (!replacement || port.required !== replacement.required || port.multiple !== replacement.multiple) throw new TypeError("Public runtime port cardinality changed.");
@@ -24723,7 +24730,12 @@ var assertCompatibleCapabilityUpgrade = (previous, next) => {
24723
24730
  if (canonicalContentHash(requirements(oldRegistration)) !== canonicalContentHash(requirements(newRegistration))) {
24724
24731
  throw new TypeError("Runtime Ontology access requirements changed.");
24725
24732
  }
24726
- for (const key of ["allowedSideEffects", "actionRequirements", "allowedSlots", "supportedSurfaces", "allowedParentCapabilityRefs", "allowedChildCapabilityRefs"]) {
24733
+ const existingOutputs = new Set(oldRegistration.outputPorts.map((port) => port.name));
24734
+ const existingActions = newRegistration.actionRequirements.filter((requirement) => existingOutputs.has(requirement.outputPort));
24735
+ if (canonicalContentHash(oldRegistration.actionRequirements) !== canonicalContentHash(existingActions)) {
24736
+ throw new TypeError("Published output action and permission requirements changed.");
24737
+ }
24738
+ for (const key of ["allowedSideEffects", "allowedSlots", "supportedSurfaces", "allowedParentCapabilityRefs", "allowedChildCapabilityRefs"]) {
24727
24739
  if (canonicalContentHash(oldRegistration[key]) !== canonicalContentHash(newRegistration[key])) throw new TypeError(`Runtime contract ${key} changed.`);
24728
24740
  }
24729
24741
  };