@inf-monkeys-tech/monkeys 1.1.4 → 1.1.5

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.
Files changed (36) hide show
  1. package/README.md +7 -0
  2. package/lib/contracts/declarative-control-http.d.ts +108182 -67435
  3. package/lib/contracts/declarative-control-http.d.ts.map +1 -1
  4. package/lib/contracts/declarative-control-http.js +14 -6
  5. package/lib/contracts/declarative-control-http.js.map +1 -1
  6. package/lib/contracts/declarative-control.d.ts +1106 -624
  7. package/lib/contracts/declarative-control.d.ts.map +1 -1
  8. package/lib/contracts/declarative-control.js +80 -6
  9. package/lib/contracts/declarative-control.js.map +1 -1
  10. package/lib/contracts/semantic.d.ts +68 -0
  11. package/lib/contracts/semantic.d.ts.map +1 -1
  12. package/lib/contracts/semantic.js +3 -1
  13. package/lib/contracts/semantic.js.map +1 -1
  14. package/lib/esm/contracts/index.mjs +85 -8
  15. package/lib/esm/contracts/index.mjs.map +1 -1
  16. package/lib/esm/index.mjs +164 -59
  17. package/lib/esm/index.mjs.map +1 -1
  18. package/lib/esm/runtime/index.mjs +158 -59
  19. package/lib/esm/runtime/index.mjs.map +1 -1
  20. package/lib/esm/schemas/index.mjs +84 -8
  21. package/lib/esm/schemas/index.mjs.map +1 -1
  22. package/lib/json-schema/navigation-release.schema.json +1 -0
  23. package/lib/json-schema/navigation-runtime-bundle.schema.json +1 -0
  24. package/lib/json-schema/page-release.schema.json +1 -0
  25. package/lib/json-schema/page-runtime-bundle.schema.json +1 -0
  26. package/lib/json-schema/workbench-release.schema.json +1 -0
  27. package/lib/json-schema/workbench-runtime-bundle.schema.json +1 -0
  28. package/lib/runtime/declarative-control-compiler.d.ts +6 -1
  29. package/lib/runtime/declarative-control-compiler.d.ts.map +1 -1
  30. package/lib/runtime/declarative-control-compiler.js +67 -39
  31. package/lib/runtime/declarative-control-compiler.js.map +1 -1
  32. package/lib/schemas/index.d.ts +251 -245
  33. package/lib/schemas/index.d.ts.map +1 -1
  34. package/lib/schemas/index.js +10 -5
  35. package/lib/schemas/index.js.map +1 -1
  36. package/package.json +1 -1
@@ -11171,6 +11171,7 @@ var ReleaseDependencyRoleSchema = z12.enum([
11171
11171
  "capability",
11172
11172
  "provider",
11173
11173
  "ontology-definition",
11174
+ "projection-spec",
11174
11175
  "query-definition",
11175
11176
  "view",
11176
11177
  "projection",
@@ -11200,6 +11201,7 @@ var DependencyKindByRole = {
11200
11201
  capability: "capability",
11201
11202
  provider: "view-provider",
11202
11203
  "ontology-definition": "ontology-definition",
11204
+ "projection-spec": "projection-spec",
11203
11205
  "query-definition": "domain-query-definition",
11204
11206
  view: "view",
11205
11207
  projection: "projection",
@@ -12384,6 +12386,58 @@ var OntologyBindingSchema = z12.object({
12384
12386
  });
12385
12387
  }
12386
12388
  });
12389
+ var LegacyOntologyBindingSchema = z12.object({
12390
+ ...OntologyBindingSchema.shape,
12391
+ viewRevisionRef: RevisionRefSchema.optional(),
12392
+ canonicalDataViewRevisionRef: z12.never().optional(),
12393
+ projectionRevisionRef: RevisionRefSchema.optional()
12394
+ }).strict().superRefine((value, context) => {
12395
+ if (Boolean(value.viewRevisionRef) === Boolean(value.projectionRevisionRef)) {
12396
+ context.addIssue({
12397
+ code: "custom",
12398
+ path: ["viewRevisionRef"],
12399
+ message: "Legacy bindings require exactly one View or projection revision."
12400
+ });
12401
+ }
12402
+ for (const [key, reference, kind] of [
12403
+ [
12404
+ "ontologyDefinitionRevisionRef",
12405
+ value.ontologyDefinitionRevisionRef,
12406
+ "ontology-definition"
12407
+ ],
12408
+ ["viewRevisionRef", value.viewRevisionRef, "view"],
12409
+ ["projectionRevisionRef", value.projectionRevisionRef, "projection-spec"]
12410
+ ]) {
12411
+ if (reference && reference.kind !== kind)
12412
+ context.addIssue({
12413
+ code: "custom",
12414
+ path: [key, "kind"],
12415
+ message: `Expected a ${kind} revision.`
12416
+ });
12417
+ }
12418
+ if (value.cursorWindow && value.pagination !== "cursor")
12419
+ context.addIssue({
12420
+ code: "custom",
12421
+ path: ["cursorWindow"],
12422
+ message: "Cursor-window navigation requires cursor pagination."
12423
+ });
12424
+ });
12425
+ var PersistedOntologyBindingSchema = z12.object({
12426
+ ...OntologyBindingSchema.shape,
12427
+ viewRevisionRef: RevisionRefSchema.optional(),
12428
+ canonicalDataViewRevisionRef: RevisionRefSchema.optional(),
12429
+ projectionRevisionRef: RevisionRefSchema.optional()
12430
+ }).strict().superRefine((value, context) => {
12431
+ const schema2 = value.canonicalDataViewRevisionRef ? OntologyBindingSchema : LegacyOntologyBindingSchema;
12432
+ const parsed = schema2.safeParse(value);
12433
+ if (!parsed.success)
12434
+ for (const issue of parsed.error.issues)
12435
+ context.addIssue({
12436
+ code: "custom",
12437
+ path: issue.path,
12438
+ message: issue.message
12439
+ });
12440
+ });
12387
12441
  var ActionResultBindingEffectSourceSchema = z12.discriminatedUnion(
12388
12442
  "kind",
12389
12443
  [
@@ -12926,7 +12980,7 @@ var ResolvedPageSchema = z12.object({
12926
12980
  stateDefinitions: z12.array(PageStateDefinitionSchema).optional(),
12927
12981
  entryTransitions: z12.array(PageEntryTransitionSchema).optional(),
12928
12982
  interactionBindings: z12.array(InteractionBindingSchema).optional(),
12929
- ontologyBindings: z12.array(OntologyBindingSchema),
12983
+ ontologyBindings: z12.array(PersistedOntologyBindingSchema),
12930
12984
  queryBindings: z12.array(QueryBindingSchema).optional(),
12931
12985
  actionBindings: z12.array(ActionBindingSchema),
12932
12986
  pageAccessPolicy: AccessPolicySchema,
@@ -14710,7 +14764,7 @@ var DeclarativeWorkbenchCatalogSchema = z12.object({
14710
14764
  });
14711
14765
  }
14712
14766
  });
14713
- var PageRuntimeBundleSchema = z12.object({
14767
+ var CompatiblePageRuntimeBundleSchema = z12.object({
14714
14768
  contract: z12.literal("PageRuntimeBundle"),
14715
14769
  ...RuntimeBundleBaseShape,
14716
14770
  pageId: ContractIdentifierSchema,
@@ -14719,7 +14773,7 @@ var PageRuntimeBundleSchema = z12.object({
14719
14773
  routeClaims: z12.array(CompiledRouteClaimSchema),
14720
14774
  routeStatePresentations: z12.array(PageRouteStatePresentationSchema).default([]),
14721
14775
  shellRevisionRef: RevisionRefSchema,
14722
- shellDescriptor: DeclarativeRuntimeShellDescriptorSchema,
14776
+ shellDescriptor: DeclarativeRuntimeShellDescriptorSchema.optional(),
14723
14777
  renderTree: RenderTreeSchema,
14724
14778
  capabilityInstances: z12.array(CapabilityInstanceSchema),
14725
14779
  deniedCapabilityInstanceIds: z12.array(ContractIdentifierSchema).default([]),
@@ -14727,7 +14781,7 @@ var PageRuntimeBundleSchema = z12.object({
14727
14781
  stateDefinitions: z12.array(PageStateDefinitionSchema).default([]),
14728
14782
  entryTransitions: z12.array(ResolvedPageEntryTransitionSchema).default([]),
14729
14783
  interactionBindings: z12.array(InteractionBindingSchema).default([]),
14730
- ontologyBindings: z12.array(OntologyBindingSchema),
14784
+ ontologyBindings: z12.array(PersistedOntologyBindingSchema),
14731
14785
  queryBindings: z12.array(QueryBindingSchema).default([]),
14732
14786
  actionBindings: z12.array(ActionBindingSchema),
14733
14787
  pageAccessPolicy: AccessPolicySchema,
@@ -14782,6 +14836,15 @@ var PageRuntimeBundleSchema = z12.object({
14782
14836
  var ResolvedWorkbenchAppInstanceSchema = WorkbenchAppInstanceSchema.extend({
14783
14837
  targetAccessPolicy: AccessPolicySchema
14784
14838
  }).strict();
14839
+ var PageRuntimeBundleSchema = CompatiblePageRuntimeBundleSchema.safeExtend({
14840
+ shellDescriptor: DeclarativeRuntimeShellDescriptorSchema,
14841
+ ontologyBindings: z12.array(OntologyBindingSchema)
14842
+ });
14843
+ var LegacyPageRuntimeBundleSchema = CompatiblePageRuntimeBundleSchema.safeExtend({
14844
+ shellDescriptor: z12.never().optional(),
14845
+ ontologyBindings: z12.array(LegacyOntologyBindingSchema)
14846
+ });
14847
+ var ReadablePageRuntimeBundleSchema = z12.union([PageRuntimeBundleSchema, LegacyPageRuntimeBundleSchema]);
14785
14848
  var WorkbenchRuntimeIdentitySchema = z12.object({
14786
14849
  name: I18nTextSchema,
14787
14850
  description: I18nTextSchema.optional()
@@ -15029,6 +15092,7 @@ var OntologyViewDefinitionSchema = z13.object({
15029
15092
  renderModelSchemaRevisionRef: ExactRefKindSchema("schema"),
15030
15093
  requiredPermissionCodes: z13.array(ContractIdentifierSchema).default([])
15031
15094
  }).strict();
15095
+ var LegacyOntologyViewDefinitionSchema = OntologyViewDefinitionSchema.omit({ canonicalDataViewRevisionRef: true });
15032
15096
  var ConceptRelationshipSchema = z13.object({
15033
15097
  kind: ContractIdentifierSchema,
15034
15098
  targetConceptId: ContractIdentifierSchema,
@@ -15590,6 +15654,7 @@ var DeclarativeRuntimeActionExecuteIntentSchema = DeclarativeRuntimePageTargetSc
15590
15654
  routePath: DeclarativeRuntimeActionRoutePathSchema.optional(),
15591
15655
  idempotencyKey: z14.string().trim().min(1).max(256)
15592
15656
  }).strict();
15657
+ var LegacyDeclarativeRuntimeActionExecuteIntentSchema = DeclarativeRuntimeActionExecuteIntentSchema.safeExtend({ pageState: DeclarativeRuntimeParametersSchema.default({}) });
15593
15658
  var DeclarativeNativeDownloadSchema = z14.object({
15594
15659
  url: z14.string().min(1).max(32768).refine((value) => {
15595
15660
  try {
@@ -15977,7 +16042,12 @@ var DeclarativeCreateTemplateRegistrationSchema = z14.object({
15977
16042
  description: I18nTextSchema,
15978
16043
  supportedSurfaces: z14.array(ProductSurfaceSchema).min(1),
15979
16044
  legacyMigrationSourcePageIds: z14.array(ContractIdentifierSchema).min(1).max(256).optional(),
15980
- document: z14.union([PageSchema, NavigationSchema, WorkbenchSchema]),
16045
+ document: z14.union([
16046
+ PageSchema,
16047
+ ResolvedPageSchema,
16048
+ NavigationSchema,
16049
+ WorkbenchSchema
16050
+ ]),
15981
16051
  sourceContentHash: Sha256Schema
15982
16052
  }).strict().superRefine((value, context) => {
15983
16053
  const expected = value.document.contract === "Page" ? "page" : value.document.contract === "Navigation" ? "navigation" : "workbench";
@@ -16473,6 +16543,7 @@ var DeclarativeCreateIntentSchema = z14.object({
16473
16543
  });
16474
16544
  var DeclarativeDocumentSchema = z14.union([
16475
16545
  PageSchema,
16546
+ ResolvedPageSchema,
16476
16547
  NavigationSchema,
16477
16548
  WorkbenchSchema
16478
16549
  ]);
@@ -16779,7 +16850,7 @@ var DeclarativePreviewResultSchema = z14.object({
16779
16850
  revision: z14.number().int().positive(),
16780
16851
  contentHash: Sha256Schema,
16781
16852
  bundle: z14.union([
16782
- PageRuntimeBundleSchema,
16853
+ ReadablePageRuntimeBundleSchema,
16783
16854
  NavigationRuntimeBundleSchema,
16784
16855
  WorkbenchRuntimeBundleSchema
16785
16856
  ]),
@@ -16796,7 +16867,7 @@ var DeclarativePublicationItemResultSchema = z14.object({
16796
16867
  WorkbenchReleaseSchema
16797
16868
  ]),
16798
16869
  bundle: z14.union([
16799
- PageRuntimeBundleSchema,
16870
+ ReadablePageRuntimeBundleSchema,
16800
16871
  NavigationRuntimeBundleSchema,
16801
16872
  WorkbenchRuntimeBundleSchema
16802
16873
  ]).optional()
@@ -17061,7 +17132,7 @@ var DeclarativeRuntimeResolvedSchema = z14.object({
17061
17132
  surface: ProductSurfaceSchema,
17062
17133
  normalizedPath: z14.string().trim().min(1),
17063
17134
  routeParameters: z14.record(ContractIdentifierSchema, z14.string()),
17064
- page: PageRuntimeBundleSchema.optional(),
17135
+ page: ReadablePageRuntimeBundleSchema.optional(),
17065
17136
  workbench: WorkbenchRuntimeBundleSchema.optional(),
17066
17137
  redirect: DeclarativeRuntimeRedirectSchema.optional(),
17067
17138
  navigation: NavigationRuntimeBundleSchema.optional(),
@@ -18372,11 +18443,19 @@ var pageDependencies = (page, compilerRevisionRef) => [
18372
18443
  role: "ontology-definition",
18373
18444
  revisionRef: binding.ontologyDefinitionRevisionRef
18374
18445
  },
18375
- { role: "view", revisionRef: binding.viewRevisionRef },
18376
- {
18377
- role: "view",
18378
- revisionRef: binding.canonicalDataViewRevisionRef
18379
- },
18446
+ ...binding.viewRevisionRef ? [{ role: "view", revisionRef: binding.viewRevisionRef }] : [],
18447
+ ..."projectionRevisionRef" in binding && binding.projectionRevisionRef ? [
18448
+ {
18449
+ role: "projection-spec",
18450
+ revisionRef: binding.projectionRevisionRef
18451
+ }
18452
+ ] : [],
18453
+ ...binding.canonicalDataViewRevisionRef ? [
18454
+ {
18455
+ role: "view",
18456
+ revisionRef: binding.canonicalDataViewRevisionRef
18457
+ }
18458
+ ] : [],
18380
18459
  {
18381
18460
  role: "schema",
18382
18461
  revisionRef: binding.renderModelSchemaRevisionRef
@@ -18950,8 +19029,30 @@ var resolvePage = (input) => {
18950
19029
  };
18951
19030
  return ResolvedPageSchema.parse(resolved);
18952
19031
  };
18953
- var compilePageRuntimeBundle = (input) => {
19032
+ var compileLegacyPageRuntimeBundle = (input) => deepFreeze(
19033
+ LegacyPageRuntimeBundleSchema.parse(
19034
+ compilePageRuntimeBundleInternal(input, true)
19035
+ )
19036
+ );
19037
+ var compilePageRuntimeBundle = (input) => deepFreeze(
19038
+ PageRuntimeBundleSchema.parse(
19039
+ compilePageRuntimeBundleInternal(input, false)
19040
+ )
19041
+ );
19042
+ var compilePageRuntimeBundleInternal = (input, legacy) => {
18954
19043
  const parsedPage = ResolvedPageSchema.parse(input.page);
19044
+ parsedPage.ontologyBindings.forEach(
19045
+ (binding) => (legacy ? LegacyOntologyBindingSchema : OntologyBindingSchema).parse(
19046
+ binding
19047
+ )
19048
+ );
19049
+ if (legacy && (parsedPage.queryBindings?.length || input.domainQueryRegistry?.length)) {
19050
+ throw new DeclarativeControlCompilationError(
19051
+ "QUERY_DEFINITION_MISMATCH",
19052
+ "queryBindings",
19053
+ "Domain queries require the current compiler and its governed registries."
19054
+ );
19055
+ }
18955
19056
  const page = {
18956
19057
  ...parsedPage,
18957
19058
  routeStatePresentations: parsedPage.routeStatePresentations ?? [],
@@ -19094,43 +19195,45 @@ var compilePageRuntimeBundle = (input) => {
19094
19195
  domainQueryDependencies(definition)
19095
19196
  );
19096
19197
  });
19097
- const shellRegistration = DeclarativeProductResourceRegistrationSchema.parse(
19098
- input.shellRegistration
19099
- );
19100
- if (shellRegistration.resourceKind !== "shell" || !sameRevisionRef(
19101
- shellRegistration.resourceRevisionRef,
19102
- page.shellRevisionRef
19103
- ) || declarativeProductResourceRevisionHash(shellRegistration) !== shellRegistration.resourceRevisionRef.contentHash || declarativeProductResourceSourceHash(shellRegistration.document) !== shellRegistration.sourceContentHash) {
19104
- throw new DeclarativeControlCompilationError(
19105
- "SHELL_REVISION_MISMATCH",
19106
- "shellRegistration",
19107
- "The active Shell registration does not match the Page exact Shell revision."
19198
+ const shellDescriptor = legacy ? void 0 : (() => {
19199
+ const shellRegistration = DeclarativeProductResourceRegistrationSchema.parse(
19200
+ input.shellRegistration
19108
19201
  );
19109
- }
19110
- if (!shellRegistration.supportedSurfaces.includes(release.target.surface)) {
19111
- throw new DeclarativeControlCompilationError(
19112
- "SHELL_SURFACE_MISMATCH",
19113
- "shellRegistration.supportedSurfaces",
19114
- "The active Shell registration does not support the release surface."
19202
+ if (shellRegistration.resourceKind !== "shell" || !sameRevisionRef(
19203
+ shellRegistration.resourceRevisionRef,
19204
+ page.shellRevisionRef
19205
+ ) || declarativeProductResourceRevisionHash(shellRegistration) !== shellRegistration.resourceRevisionRef.contentHash || declarativeProductResourceSourceHash(shellRegistration.document) !== shellRegistration.sourceContentHash) {
19206
+ throw new DeclarativeControlCompilationError(
19207
+ "SHELL_REVISION_MISMATCH",
19208
+ "shellRegistration",
19209
+ "The active Shell registration does not match the Page exact Shell revision."
19210
+ );
19211
+ }
19212
+ if (!shellRegistration.supportedSurfaces.includes(release.target.surface)) {
19213
+ throw new DeclarativeControlCompilationError(
19214
+ "SHELL_SURFACE_MISMATCH",
19215
+ "shellRegistration.supportedSurfaces",
19216
+ "The active Shell registration does not support the release surface."
19217
+ );
19218
+ }
19219
+ const shellDocument = DeclarativeShellResourceDocumentSchema.parse(
19220
+ shellRegistration.document
19115
19221
  );
19116
- }
19117
- const shellDocument = DeclarativeShellResourceDocumentSchema.parse(
19118
- shellRegistration.document
19119
- );
19120
- const shellChrome = shellDocument.surfaceChrome.find(
19121
- (entry) => entry.surface === release.target.surface
19122
- );
19123
- if (!shellChrome) {
19124
- throw new DeclarativeControlCompilationError(
19125
- "SHELL_CHROME_UNAVAILABLE",
19126
- "shellRegistration.document.surfaceChrome",
19127
- "The active Shell does not declare chrome for the release surface."
19222
+ const shellChrome = shellDocument.surfaceChrome.find(
19223
+ (entry) => entry.surface === release.target.surface
19128
19224
  );
19129
- }
19130
- const shellDescriptor = {
19131
- shellRevisionRef: page.shellRevisionRef,
19132
- header: shellChrome.header
19133
- };
19225
+ if (!shellChrome) {
19226
+ throw new DeclarativeControlCompilationError(
19227
+ "SHELL_CHROME_UNAVAILABLE",
19228
+ "shellRegistration.document.surfaceChrome",
19229
+ "The active Shell does not declare chrome for the release surface."
19230
+ );
19231
+ }
19232
+ return {
19233
+ shellRevisionRef: page.shellRevisionRef,
19234
+ header: shellChrome.header
19235
+ };
19236
+ })();
19134
19237
  if (page.renderTree.nodes.length > input.limits.maxRenderNodes)
19135
19238
  throw new DeclarativeControlCompilationError(
19136
19239
  "RENDER_NODE_LIMIT_EXCEEDED",
@@ -19229,23 +19332,23 @@ var compilePageRuntimeBundle = (input) => {
19229
19332
  "Page requests undeclared provider side effects."
19230
19333
  );
19231
19334
  }
19232
- if (!sameRevisionRef(
19335
+ if (!legacy && (!registration.propertySchemaRevisionRef || !sameRevisionRef(
19233
19336
  instance.propertySchemaRevisionRef,
19234
19337
  registration.propertySchemaRevisionRef
19235
- )) {
19338
+ ))) {
19236
19339
  throw new DeclarativeControlCompilationError(
19237
19340
  "CAPABILITY_BINDING_MISMATCH",
19238
19341
  `capabilityInstances[${index}].propertySchemaRevisionRef`,
19239
19342
  "Capability properties do not pin the exact schema registered by the active Design catalog."
19240
19343
  );
19241
19344
  }
19242
- if (!accessPolicyChainImplies(
19345
+ if (!legacy && (!registration.accessPolicy || !accessPolicyChainImplies(
19243
19346
  [
19244
19347
  page.pageAccessPolicy,
19245
19348
  ...instance.accessPolicy ? [instance.accessPolicy] : []
19246
19349
  ],
19247
19350
  registration.accessPolicy
19248
- )) {
19351
+ ))) {
19249
19352
  throw new DeclarativeControlCompilationError(
19250
19353
  "AUDIENCE_WIDER_THAN_TARGET",
19251
19354
  `capabilityInstances[${index}]`,
@@ -19575,7 +19678,7 @@ var compilePageRuntimeBundle = (input) => {
19575
19678
  (presentation) => presentation.surface === release.target.surface
19576
19679
  ),
19577
19680
  shellRevisionRef: page.shellRevisionRef,
19578
- shellDescriptor,
19681
+ ...shellDescriptor ? { shellDescriptor } : {},
19579
19682
  renderTree,
19580
19683
  capabilityInstances: page.capabilityInstances,
19581
19684
  deniedCapabilityInstanceIds: [],
@@ -19591,12 +19694,7 @@ var compilePageRuntimeBundle = (input) => {
19591
19694
  observationPolicyRevisionRef: page.observationPolicyRevisionRef,
19592
19695
  privacyClassification: page.privacyClassification
19593
19696
  };
19594
- return deepFreeze(
19595
- PageRuntimeBundleSchema.parse({
19596
- ...unsigned,
19597
- contentHash: canonicalContentHash(unsigned)
19598
- })
19599
- );
19697
+ return { ...unsigned, contentHash: canonicalContentHash(unsigned) };
19600
19698
  };
19601
19699
  var workbenchDependencyRole = (kind) => {
19602
19700
  switch (kind) {
@@ -25482,6 +25580,7 @@ export {
25482
25580
  compileDeclarativeRouteOwnerIndex,
25483
25581
  compileDeclarativeWorkbenchCatalog,
25484
25582
  compileDesignCapabilityCatalogArtifact,
25583
+ compileLegacyPageRuntimeBundle,
25485
25584
  compileLegacyRouteTakeoverAuthorization,
25486
25585
  compileMenuRuntimeBundle,
25487
25586
  compileNavigationRuntimeBundle,