@inf-monkeys-tech/monkeys 1.1.6 → 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
@@ -15007,11 +15007,6 @@ var DeclarativeAuthoringActionSchema = z18.enum([
15007
15007
  "publish",
15008
15008
  "rollback"
15009
15009
  ]);
15010
- var DeclarativeLegacyMigrationKindSchema = z18.enum([
15011
- "page",
15012
- "page-data-assets",
15013
- "workbench"
15014
- ]);
15015
15010
  var encodePath = (value) => encodeURIComponent(value);
15016
15011
  var declarativeControlRoutes = {
15017
15012
  validate: (kind, resourceId) => `${DECLARATIVE_CONTROL_API_PREFIX}/resources/${kind}/${encodePath(resourceId)}/validate`,
@@ -15032,10 +15027,6 @@ var declarativeControlRoutes = {
15032
15027
  navigationPlacements: () => `${DECLARATIVE_CONTROL_API_PREFIX}/authoring/navigation/placements`,
15033
15028
  navigationImport: (placement) => `${DECLARATIVE_CONTROL_API_PREFIX}/authoring/navigation/placements/${encodePath(placement)}/import`,
15034
15029
  navigationSeedMigration: (placement) => `${DECLARATIVE_CONTROL_API_PREFIX}/authoring/navigation/placements/${encodePath(placement)}/seed-migration`,
15035
- migrationInspect: (kind, legacyResourceId) => `${DECLARATIVE_CONTROL_API_PREFIX}/authoring/migrations/${kind}/${encodePath(legacyResourceId)}/inspect`,
15036
- migrationCreateDraft: (kind, legacyResourceId) => `${DECLARATIVE_CONTROL_API_PREFIX}/authoring/migrations/${kind}/${encodePath(legacyResourceId)}/draft`,
15037
- migrationCutover: (kind, targetResourceId) => `${DECLARATIVE_CONTROL_API_PREFIX}/authoring/resources/${kind === "workbench" ? "workbench" : "page"}/${encodePath(targetResourceId)}/publish`,
15038
- migrationRollback: (kind, targetResourceId) => `${DECLARATIVE_CONTROL_API_PREFIX}/authoring/resources/${kind === "workbench" ? "workbench" : "page"}/${encodePath(targetResourceId)}/rollback`,
15039
15030
  publicationPlan: () => `${DECLARATIVE_CONTROL_API_PREFIX}/authoring/publication-plans`,
15040
15031
  runtimeResolve: () => `${DECLARATIVE_CONTROL_API_PREFIX}/runtime/resolve`,
15041
15032
  runtimeNavigationBootstrap: () => `${DECLARATIVE_CONTROL_API_PREFIX}/runtime/navigations/bootstrap`,
@@ -16531,73 +16522,6 @@ var DeclarativePublicationResultSchema = z18.union([
16531
16522
  DeclarativeDirectPublicationResultSchema,
16532
16523
  DeclarativeAtomicPublicationPlanResultSchema
16533
16524
  ]);
16534
- var DeclarativeMigrationDiffEntrySchema = z18.object({
16535
- path: z18.string().trim().startsWith("/").max(1024),
16536
- status: z18.enum(["added", "changed", "removed", "unchanged"]),
16537
- legacyValueHash: Sha256Schema.optional(),
16538
- declarativeValueHash: Sha256Schema.optional()
16539
- }).strict();
16540
- var DeclarativeMigrationBlockerSchema = z18.object({
16541
- code: ContractIdentifierSchema,
16542
- path: z18.string().trim().max(1024).optional(),
16543
- message: z18.string().trim().min(1).max(4096)
16544
- }).strict();
16545
- var DeclarativeLegacyMigrationInspectionSchema = z18.object({
16546
- contract: z18.literal("DeclarativeLegacyMigrationInspection"),
16547
- schemaVersion: z18.literal(1),
16548
- migrationKind: DeclarativeLegacyMigrationKindSchema,
16549
- legacyResourceId: ContractIdentifierSchema,
16550
- sourceRevisionRef: RevisionRefSchema,
16551
- sourceContentHash: Sha256Schema,
16552
- legacyAdapterRevisionRef: RevisionRefSchema,
16553
- targetResourceRef: StableRefSchema,
16554
- environmentRevisionRef: RevisionRefSchema,
16555
- routeSpaceRevisionRef: RevisionRefSchema,
16556
- normalizedPath: z18.string().trim().startsWith("/").max(2048),
16557
- takeoverAuthorization: LegacyRouteTakeoverAuthorizationSchema,
16558
- diff: z18.array(DeclarativeMigrationDiffEntrySchema).max(256),
16559
- blockers: z18.array(DeclarativeMigrationBlockerSchema).max(128),
16560
- canCreateDraft: z18.boolean(),
16561
- inspectionFingerprint: Sha256Schema
16562
- }).strict().superRefine((value, context) => {
16563
- const expectedKind = value.migrationKind === "workbench" ? "workbench" : "page";
16564
- if (value.targetResourceRef.kind !== expectedKind) {
16565
- context.addIssue({
16566
- code: "custom",
16567
- path: ["targetResourceRef", "kind"],
16568
- message: `A ${value.migrationKind} migration must target ${expectedKind}.`
16569
- });
16570
- }
16571
- if (value.takeoverAuthorization.inspectedSourceContentHash !== value.sourceContentHash || value.takeoverAuthorization.normalizedPath !== value.normalizedPath || value.takeoverAuthorization.targetResourceRef.kind !== value.targetResourceRef.kind || value.takeoverAuthorization.targetResourceRef.id !== value.targetResourceRef.id || value.takeoverAuthorization.targetResourceRef.ownerRepo !== value.targetResourceRef.ownerRepo) {
16572
- context.addIssue({
16573
- code: "custom",
16574
- path: ["takeoverAuthorization"],
16575
- message: "The takeover authority must bind the exact inspected source, path and target."
16576
- });
16577
- }
16578
- if (value.canCreateDraft !== (value.blockers.length === 0)) {
16579
- context.addIssue({
16580
- code: "custom",
16581
- path: ["canCreateDraft"],
16582
- message: "Draft creation is allowed exactly when inspection has no blockers."
16583
- });
16584
- }
16585
- });
16586
- var DeclarativeLegacyMigrationCreateDraftIntentSchema = z18.object({
16587
- inspectionFingerprint: Sha256Schema,
16588
- expectedSourceRevisionRef: RevisionRefSchema,
16589
- expectedSourceContentHash: Sha256Schema,
16590
- idempotencyKey: z18.string().trim().min(1).max(256)
16591
- }).strict();
16592
- var DeclarativeLegacyMigrationCreateDraftResultSchema = z18.object({
16593
- migrationKind: DeclarativeLegacyMigrationKindSchema,
16594
- legacyResourceId: ContractIdentifierSchema,
16595
- inspectionFingerprint: Sha256Schema,
16596
- sourceRevisionRef: RevisionRefSchema,
16597
- sourceContentHash: Sha256Schema,
16598
- takeoverAuthorization: LegacyRouteTakeoverAuthorizationSchema,
16599
- draft: DeclarativeDraftResultSchema
16600
- }).strict();
16601
16525
  var DECLARATIVE_MIGRATION_ERROR_CODES = {
16602
16526
  sourceChanged: "DECLARATIVE_LEGACY_SOURCE_CHANGED",
16603
16527
  reservedTakeoverForbidden: "DECLARATIVE_RESERVED_ROUTE_TAKEOVER_FORBIDDEN",
@@ -24365,6 +24289,27 @@ var compileNavigationRuntimeBundle = (input) => {
24365
24289
  input.compilerRevisionRef
24366
24290
  );
24367
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
+ );
24368
24313
  assertSameTenantScope(release.tenantScope, scope, "release.tenantScope");
24369
24314
  if (navigation.nodes.length > input.limits.maxNavigationNodes)
24370
24315
  throw new DeclarativeControlCompilationError(
@@ -24605,11 +24550,32 @@ var compileNavigationRuntimeBundle = (input) => {
24605
24550
  "Navigation target is active on another surface."
24606
24551
  );
24607
24552
  }
24608
- assertTenantCompatible(
24609
- registration.targetRevisionRef,
24610
- scope,
24611
- `nodes[${index}].targetRef`
24612
- );
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
+ }
24613
24579
  if (!accessPolicyChainImplies(
24614
24580
  [...ancestors, node.audience],
24615
24581
  registration.accessPolicy
@@ -26859,14 +26825,8 @@ export {
26859
26825
  DeclarativeEnvironmentResourceDocumentSchema,
26860
26826
  DeclarativeErrorEnvelopeSchema,
26861
26827
  DeclarativeLayoutPolicyResourceDocumentSchema,
26862
- DeclarativeLegacyMigrationCreateDraftIntentSchema,
26863
- DeclarativeLegacyMigrationCreateDraftResultSchema,
26864
- DeclarativeLegacyMigrationInspectionSchema,
26865
- DeclarativeLegacyMigrationKindSchema,
26866
26828
  DeclarativeLegacyWorkbenchSummarySchema,
26867
26829
  DeclarativeLifecycleSchema,
26868
- DeclarativeMigrationBlockerSchema,
26869
- DeclarativeMigrationDiffEntrySchema,
26870
26830
  DeclarativeNativeDownloadSchema,
26871
26831
  DeclarativeNavigationImportIntentSchema,
26872
26832
  DeclarativeNavigationImportResultSchema,