@inf-monkeys-tech/monkeys 1.1.7 → 1.1.8

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.
package/lib/esm/index.mjs CHANGED
@@ -24289,6 +24289,27 @@ var compileNavigationRuntimeBundle = (input) => {
24289
24289
  input.compilerRevisionRef
24290
24290
  );
24291
24291
  const scope = TenantScopeSchema.parse(navigation.tenantScope);
24292
+ const verifiedKernelPageReferences = [...input.verifiedKernelPageReferences ?? []].map((reference, index) => {
24293
+ const parsed = RevisionRefSchema.parse(reference);
24294
+ if (release.target.surface !== "kernel" || parsed.visibility !== "tenant" || !parsed.tenantScope?.teamRef?.id.startsWith("kernel-page.") || parsed.ownerRepo !== "monkeys-server" || !["page", "page-release"].includes(parsed.kind)) {
24295
+ throw new DeclarativeControlCompilationError(
24296
+ "CROSS_TENANT_REFERENCE",
24297
+ `verifiedKernelPageReferences[${index}]`,
24298
+ "Verified Kernel Page references must be exact tenant-scoped Page and PageRelease revisions from the Kernel page catalog."
24299
+ );
24300
+ }
24301
+ if (scopeKey(parsed.tenantScope) === scopeKey(scope)) {
24302
+ throw new DeclarativeControlCompilationError(
24303
+ "CROSS_TENANT_REFERENCE",
24304
+ `verifiedKernelPageReferences[${index}]`,
24305
+ "Verified Kernel Page references must belong to a different tenant scope."
24306
+ );
24307
+ }
24308
+ return parsed;
24309
+ });
24310
+ const verifiedKernelPageReferenceKeys = new Set(
24311
+ verifiedKernelPageReferences.map(revisionRefKey)
24312
+ );
24292
24313
  assertSameTenantScope(release.tenantScope, scope, "release.tenantScope");
24293
24314
  if (navigation.nodes.length > input.limits.maxNavigationNodes)
24294
24315
  throw new DeclarativeControlCompilationError(
@@ -24529,11 +24550,32 @@ var compileNavigationRuntimeBundle = (input) => {
24529
24550
  "Navigation target is active on another surface."
24530
24551
  );
24531
24552
  }
24532
- assertTenantCompatible(
24533
- registration.targetRevisionRef,
24534
- scope,
24535
- `nodes[${index}].targetRef`
24536
- );
24553
+ const targetIsForeignTenant = registration.targetRevisionRef.visibility === "tenant" && scopeKey(registration.targetRevisionRef.tenantScope) !== scopeKey(scope);
24554
+ if (targetIsForeignTenant) {
24555
+ const releaseReference = registration.kind === "route" ? registration.releaseRevisionRef : void 0;
24556
+ if (release.target.surface !== "kernel" || registration.kind !== "route" || registration.targetRevisionRef.kind !== "page" || !releaseReference || !verifiedKernelPageReferenceKeys.has(
24557
+ revisionRefKey(registration.targetRevisionRef)
24558
+ ) || !verifiedKernelPageReferenceKeys.has(revisionRefKey(releaseReference))) {
24559
+ throw new DeclarativeControlCompilationError(
24560
+ "CROSS_TENANT_REFERENCE",
24561
+ `nodes[${index}].targetRef`,
24562
+ "Kernel Navigation may retain only Page references independently verified by the authenticated Kernel page catalog."
24563
+ );
24564
+ }
24565
+ if (scopeKey(releaseReference.tenantScope) !== scopeKey(registration.targetRevisionRef.tenantScope)) {
24566
+ throw new DeclarativeControlCompilationError(
24567
+ "CROSS_TENANT_REFERENCE",
24568
+ `nodes[${index}].targetRef`,
24569
+ "Verified Kernel Page and PageRelease references must belong to the same tenant scope."
24570
+ );
24571
+ }
24572
+ } else {
24573
+ assertTenantCompatible(
24574
+ registration.targetRevisionRef,
24575
+ scope,
24576
+ `nodes[${index}].targetRef`
24577
+ );
24578
+ }
24537
24579
  if (!accessPolicyChainImplies(
24538
24580
  [...ancestors, node.audience],
24539
24581
  registration.accessPolicy