@inf-monkeys-tech/monkeys 1.0.64 → 1.0.66
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/README.md +6 -0
- package/lib/contracts/capability.d.ts +4 -0
- package/lib/contracts/capability.d.ts.map +1 -1
- package/lib/contracts/capability.js +1 -0
- package/lib/contracts/capability.js.map +1 -1
- package/lib/contracts/declarative-control-http.d.ts +81284 -0
- package/lib/contracts/declarative-control-http.d.ts.map +1 -0
- package/lib/contracts/declarative-control-http.js +926 -0
- package/lib/contracts/declarative-control-http.js.map +1 -0
- package/lib/contracts/declarative-control.d.ts +17709 -0
- package/lib/contracts/declarative-control.d.ts.map +1 -0
- package/lib/contracts/declarative-control.js +1075 -0
- package/lib/contracts/declarative-control.js.map +1 -0
- package/lib/contracts/index.d.ts +2 -0
- package/lib/contracts/index.d.ts.map +1 -1
- package/lib/contracts/index.js +2 -0
- package/lib/contracts/index.js.map +1 -1
- package/lib/contracts/menu.d.ts +1 -1
- package/lib/contracts/page.d.ts +3 -3
- package/lib/contracts/semantic.d.ts +78 -1
- package/lib/contracts/semantic.d.ts.map +1 -1
- package/lib/contracts/semantic.js +27 -1
- package/lib/contracts/semantic.js.map +1 -1
- package/lib/contracts/tenant.d.ts +57 -13
- package/lib/contracts/tenant.d.ts.map +1 -1
- package/lib/contracts/tenant.js +19 -2
- package/lib/contracts/tenant.js.map +1 -1
- package/lib/contracts/trend.d.ts +4 -4
- package/lib/esm/contracts/index.mjs +2882 -1027
- package/lib/esm/contracts/index.mjs.map +1 -1
- package/lib/esm/index.mjs +5752 -3018
- package/lib/esm/index.mjs.map +1 -1
- package/lib/esm/runtime/index.mjs +2427 -593
- package/lib/esm/runtime/index.mjs.map +1 -1
- package/lib/esm/schemas/index.mjs +2000 -961
- package/lib/esm/schemas/index.mjs.map +1 -1
- package/lib/json-schema/capability-registry.schema.json +2 -1
- package/lib/json-schema/declarative-control-ontology-definition.schema.json +130 -0
- package/lib/json-schema/index.json +13 -0
- package/lib/json-schema/navigation-release.schema.json +2037 -0
- package/lib/json-schema/navigation-runtime-bundle.schema.json +7497 -0
- package/lib/json-schema/navigation.schema.json +4649 -0
- package/lib/json-schema/page-release.schema.json +2457 -0
- package/lib/json-schema/page-runtime-bundle.schema.json +5705 -0
- package/lib/json-schema/page.schema.json +7944 -0
- package/lib/json-schema/publication-plan.schema.json +1286 -0
- package/lib/json-schema/route-space.schema.json +93 -0
- package/lib/json-schema/stable-ref-alias-map.schema.json +535 -0
- package/lib/json-schema/tenant-product-config.schema.json +40 -0
- package/lib/json-schema/tenant-runtime-config.schema.json +40 -0
- package/lib/json-schema/workbench-release.schema.json +2473 -0
- package/lib/json-schema/workbench-runtime-bundle.schema.json +5274 -0
- package/lib/json-schema/workbench.schema.json +6698 -0
- package/lib/runtime/declarative-control-compiler.d.ts +141 -0
- package/lib/runtime/declarative-control-compiler.d.ts.map +1 -0
- package/lib/runtime/declarative-control-compiler.js +874 -0
- package/lib/runtime/declarative-control-compiler.js.map +1 -0
- package/lib/runtime/index.d.ts +1 -0
- package/lib/runtime/index.d.ts.map +1 -1
- package/lib/runtime/index.js +1 -0
- package/lib/runtime/index.js.map +1 -1
- package/lib/schemas/index.d.ts +14140 -3963
- package/lib/schemas/index.d.ts.map +1 -1
- package/lib/schemas/index.js +78 -4
- package/lib/schemas/index.js.map +1 -1
- package/package.json +1 -1
- package/test/fixtures/tenant-product-config.public.json +8 -0
|
@@ -7012,7 +7012,8 @@ var CapabilitySourceTypeSchema = z3.enum([
|
|
|
7012
7012
|
"plugin-manifest",
|
|
7013
7013
|
"openapi",
|
|
7014
7014
|
"workflow",
|
|
7015
|
-
"comfyui"
|
|
7015
|
+
"comfyui",
|
|
7016
|
+
"design-view-provider"
|
|
7016
7017
|
]);
|
|
7017
7018
|
var CapabilityRegistrySourceSchema = z3.object({
|
|
7018
7019
|
sourceType: CapabilitySourceTypeSchema,
|
|
@@ -8680,7 +8681,7 @@ function toAgentSessionViewModel(projection, snapshot) {
|
|
|
8680
8681
|
}
|
|
8681
8682
|
|
|
8682
8683
|
// src/contracts/semantic.ts
|
|
8683
|
-
import { z as
|
|
8684
|
+
import { z as z10 } from "zod";
|
|
8684
8685
|
|
|
8685
8686
|
// src/contracts/data.ts
|
|
8686
8687
|
import { z as z6 } from "zod";
|
|
@@ -9306,39 +9307,993 @@ var MenuContributionResultSchema = z8.object({
|
|
|
9306
9307
|
nodes: z8.array(CompiledMenuNodeSchema).max(MENU_MAX_NODES)
|
|
9307
9308
|
}).strict();
|
|
9308
9309
|
|
|
9310
|
+
// src/contracts/declarative-control.ts
|
|
9311
|
+
import { z as z9 } from "zod";
|
|
9312
|
+
var DECLARATIVE_CONTROL_SCHEMA_VERSION = 1;
|
|
9313
|
+
var uniqueArray = (values, identity) => {
|
|
9314
|
+
const seen = /* @__PURE__ */ new Set();
|
|
9315
|
+
for (const value of values) {
|
|
9316
|
+
const key = identity(value);
|
|
9317
|
+
if (seen.has(key)) return key;
|
|
9318
|
+
seen.add(key);
|
|
9319
|
+
}
|
|
9320
|
+
return void 0;
|
|
9321
|
+
};
|
|
9322
|
+
var I18nTextSchema = z9.object({
|
|
9323
|
+
defaultLocale: LocaleIdentifierSchema,
|
|
9324
|
+
values: z9.record(LocaleIdentifierSchema, z9.string().trim().min(1))
|
|
9325
|
+
}).strict().superRefine((value, context) => {
|
|
9326
|
+
if (!Object.prototype.hasOwnProperty.call(value.values, value.defaultLocale)) {
|
|
9327
|
+
context.addIssue({
|
|
9328
|
+
code: "custom",
|
|
9329
|
+
path: ["values", value.defaultLocale],
|
|
9330
|
+
message: "I18nText values must contain the default locale."
|
|
9331
|
+
});
|
|
9332
|
+
}
|
|
9333
|
+
});
|
|
9334
|
+
var ScopedIdentityRefSchema = z9.object({
|
|
9335
|
+
kind: ContractIdentifierSchema,
|
|
9336
|
+
id: ContractIdentifierSchema,
|
|
9337
|
+
ownerRepo: ContractIdentifierSchema
|
|
9338
|
+
}).strict();
|
|
9339
|
+
var TenantScopeSchema = z9.object({
|
|
9340
|
+
tenantRef: ScopedIdentityRefSchema,
|
|
9341
|
+
dataSpaceRef: ScopedIdentityRefSchema,
|
|
9342
|
+
teamRef: ScopedIdentityRefSchema.optional()
|
|
9343
|
+
}).strict().superRefine((value, context) => {
|
|
9344
|
+
const expectedKinds = [
|
|
9345
|
+
["tenantRef", value.tenantRef, "tenant"],
|
|
9346
|
+
["dataSpaceRef", value.dataSpaceRef, "data-space"],
|
|
9347
|
+
["teamRef", value.teamRef, "team"]
|
|
9348
|
+
];
|
|
9349
|
+
expectedKinds.forEach(([field, reference, expectedKind]) => {
|
|
9350
|
+
if (reference && reference.kind !== expectedKind) {
|
|
9351
|
+
context.addIssue({ code: "custom", path: [field, "kind"], message: `${field} must reference ${expectedKind}.` });
|
|
9352
|
+
}
|
|
9353
|
+
});
|
|
9354
|
+
});
|
|
9355
|
+
var ReferenceVisibilitySchema = z9.enum(["tenant", "global", "public"]);
|
|
9356
|
+
var StableRefShape = {
|
|
9357
|
+
kind: ContractIdentifierSchema,
|
|
9358
|
+
id: ContractIdentifierSchema,
|
|
9359
|
+
ownerRepo: ContractIdentifierSchema,
|
|
9360
|
+
visibility: ReferenceVisibilitySchema,
|
|
9361
|
+
tenantScope: TenantScopeSchema.optional()
|
|
9362
|
+
};
|
|
9363
|
+
var validateReferenceScope = (value, context) => {
|
|
9364
|
+
if (value.visibility === "tenant" && !value.tenantScope) {
|
|
9365
|
+
context.addIssue({ code: "custom", path: ["tenantScope"], message: "Tenant references require an explicit tenant scope." });
|
|
9366
|
+
}
|
|
9367
|
+
if (value.visibility !== "tenant" && value.tenantScope) {
|
|
9368
|
+
context.addIssue({ code: "custom", path: ["tenantScope"], message: "Global and public references cannot carry a tenant scope." });
|
|
9369
|
+
}
|
|
9370
|
+
};
|
|
9371
|
+
var StableRefSchema = z9.object(StableRefShape).strict().superRefine(validateReferenceScope);
|
|
9372
|
+
var RevisionRefSchema = z9.object({
|
|
9373
|
+
...StableRefShape,
|
|
9374
|
+
revision: z9.number().int().positive(),
|
|
9375
|
+
schemaVersion: ContractVersionSchema,
|
|
9376
|
+
contentHash: Sha256Schema
|
|
9377
|
+
}).strict().superRefine(validateReferenceScope);
|
|
9378
|
+
var scopedIdentityKey = (reference) => `${reference.kind}:${reference.id}:${reference.ownerRepo}`;
|
|
9379
|
+
var tenantScopeKey = (scope) => `${scopedIdentityKey(scope.tenantRef)}:${scopedIdentityKey(scope.dataSpaceRef)}:${scope.teamRef ? scopedIdentityKey(scope.teamRef) : ""}`;
|
|
9380
|
+
var stableRefIdentity = (reference) => `${reference.visibility}:${reference.tenantScope ? tenantScopeKey(reference.tenantScope) : ""}:${reference.kind}:${reference.id}:${reference.ownerRepo}`;
|
|
9381
|
+
var exactRevisionRef = (left, right) => stableRefIdentity(left) === stableRefIdentity(right) && left.revision === right.revision && left.schemaVersion === right.schemaVersion && left.contentHash === right.contentHash;
|
|
9382
|
+
var StableRefAliasSchema = z9.object({
|
|
9383
|
+
aliasRef: StableRefSchema,
|
|
9384
|
+
canonicalRef: StableRefSchema,
|
|
9385
|
+
validFrom: IsoDateTimeSchema,
|
|
9386
|
+
validUntil: IsoDateTimeSchema.nullable(),
|
|
9387
|
+
evidenceRef: RevisionRefSchema
|
|
9388
|
+
}).strict().superRefine((value, context) => {
|
|
9389
|
+
if (value.aliasRef.kind !== value.canonicalRef.kind) {
|
|
9390
|
+
context.addIssue({ code: "custom", path: ["canonicalRef", "kind"], message: "Alias and canonical references must have the same kind." });
|
|
9391
|
+
}
|
|
9392
|
+
if (value.validUntil && value.validUntil <= value.validFrom) {
|
|
9393
|
+
context.addIssue({ code: "custom", path: ["validUntil"], message: "Alias validUntil must be later than validFrom." });
|
|
9394
|
+
}
|
|
9395
|
+
});
|
|
9396
|
+
var StableRefAliasMapSchema = z9.object({
|
|
9397
|
+
contract: z9.literal("StableRefAliasMap"),
|
|
9398
|
+
schemaVersion: z9.literal(DECLARATIVE_CONTROL_SCHEMA_VERSION),
|
|
9399
|
+
tenantScope: TenantScopeSchema,
|
|
9400
|
+
aliases: z9.array(StableRefAliasSchema),
|
|
9401
|
+
contentHash: Sha256Schema
|
|
9402
|
+
}).strict().superRefine((value, context) => {
|
|
9403
|
+
const duplicate = uniqueArray(value.aliases, (entry) => stableRefIdentity(entry.aliasRef));
|
|
9404
|
+
if (duplicate) context.addIssue({ code: "custom", path: ["aliases"], message: `Duplicate alias reference: ${duplicate}` });
|
|
9405
|
+
});
|
|
9406
|
+
var DeclarativeLifecycleSchema = z9.enum(["active", "deprecated", "retired"]);
|
|
9407
|
+
var ProductSurfaceSchema = z9.enum(["studio", "kernel"]);
|
|
9408
|
+
var GroupRefSchema = StableRefSchema.superRefine((value, context) => {
|
|
9409
|
+
if (value.kind !== "group") context.addIssue({ code: "custom", path: ["kind"], message: "Access group references must use kind group." });
|
|
9410
|
+
});
|
|
9411
|
+
var AccessConditionRefSchema = RevisionRefSchema.superRefine((value, context) => {
|
|
9412
|
+
if (value.kind !== "access-condition") {
|
|
9413
|
+
context.addIssue({ code: "custom", path: ["kind"], message: "Access condition references must use kind access-condition." });
|
|
9414
|
+
}
|
|
9415
|
+
});
|
|
9416
|
+
var AccessPolicySchema = z9.object({
|
|
9417
|
+
authenticated: z9.boolean(),
|
|
9418
|
+
groupAllOf: z9.array(GroupRefSchema),
|
|
9419
|
+
groupAnyOf: z9.array(GroupRefSchema),
|
|
9420
|
+
permissionAllOf: z9.array(ContractIdentifierSchema),
|
|
9421
|
+
permissionAnyOf: z9.array(ContractIdentifierSchema),
|
|
9422
|
+
conditionAllOf: z9.array(AccessConditionRefSchema)
|
|
9423
|
+
}).strict().superRefine((value, context) => {
|
|
9424
|
+
const checks = [
|
|
9425
|
+
["groupAllOf", value.groupAllOf, (candidate) => stableRefIdentity(candidate)],
|
|
9426
|
+
["groupAnyOf", value.groupAnyOf, (candidate) => stableRefIdentity(candidate)],
|
|
9427
|
+
["permissionAllOf", value.permissionAllOf, String],
|
|
9428
|
+
["permissionAnyOf", value.permissionAnyOf, String],
|
|
9429
|
+
["conditionAllOf", value.conditionAllOf, (candidate) => `${stableRefIdentity(candidate)}@${candidate.revision}`]
|
|
9430
|
+
];
|
|
9431
|
+
checks.forEach(([field, values, identity]) => {
|
|
9432
|
+
if (uniqueArray(values, identity)) context.addIssue({ code: "custom", path: [field], message: `${field} entries must be unique.` });
|
|
9433
|
+
});
|
|
9434
|
+
});
|
|
9435
|
+
var ManagementAccessSchema = z9.object({
|
|
9436
|
+
edit: AccessPolicySchema,
|
|
9437
|
+
preview: AccessPolicySchema,
|
|
9438
|
+
publish: AccessPolicySchema,
|
|
9439
|
+
deactivate: AccessPolicySchema,
|
|
9440
|
+
rollback: AccessPolicySchema,
|
|
9441
|
+
retire: AccessPolicySchema
|
|
9442
|
+
}).strict();
|
|
9443
|
+
var RoutePathTemplateSchema = z9.string().trim().regex(/^\/(?!\/)/, "Expected an application-relative path.").superRefine((value, context) => {
|
|
9444
|
+
if (value.includes("?") || value.includes("#") || value.includes("\\")) {
|
|
9445
|
+
context.addIssue({ code: "custom", message: "Route paths cannot contain query strings, fragments, or backslashes." });
|
|
9446
|
+
}
|
|
9447
|
+
if (value.split("/").some((segment) => segment === "." || segment === "..")) {
|
|
9448
|
+
context.addIssue({ code: "custom", message: "Route paths cannot contain traversal segments." });
|
|
9449
|
+
}
|
|
9450
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(value) || value.includes("://")) {
|
|
9451
|
+
context.addIssue({ code: "custom", message: "Route paths cannot contain a scheme or host." });
|
|
9452
|
+
}
|
|
9453
|
+
});
|
|
9454
|
+
var RouteSpaceParameterSchema = z9.object({
|
|
9455
|
+
name: ContractIdentifierSchema,
|
|
9456
|
+
type: z9.enum(["identifier", "integer", "slug", "uuid"]),
|
|
9457
|
+
required: z9.boolean()
|
|
9458
|
+
}).strict();
|
|
9459
|
+
var RouteSpaceSchema = z9.object({
|
|
9460
|
+
contract: z9.literal("RouteSpace"),
|
|
9461
|
+
schemaVersion: z9.literal(DECLARATIVE_CONTROL_SCHEMA_VERSION),
|
|
9462
|
+
routeSpaceId: ContractIdentifierSchema,
|
|
9463
|
+
supportedSurface: ProductSurfaceSchema,
|
|
9464
|
+
basePath: RoutePathTemplateSchema,
|
|
9465
|
+
caseSensitive: z9.boolean(),
|
|
9466
|
+
trailingSlash: z9.enum(["preserve", "remove", "require"]),
|
|
9467
|
+
reservedPaths: z9.array(RoutePathTemplateSchema),
|
|
9468
|
+
parameters: z9.array(RouteSpaceParameterSchema)
|
|
9469
|
+
}).strict().superRefine((value, context) => {
|
|
9470
|
+
if (uniqueArray(value.parameters, (parameter) => parameter.name)) {
|
|
9471
|
+
context.addIssue({ code: "custom", path: ["parameters"], message: "RouteSpace parameter names must be unique." });
|
|
9472
|
+
}
|
|
9473
|
+
if (uniqueArray(value.reservedPaths, (path) => path)) {
|
|
9474
|
+
context.addIssue({ code: "custom", path: ["reservedPaths"], message: "RouteSpace reserved paths must be unique." });
|
|
9475
|
+
}
|
|
9476
|
+
});
|
|
9477
|
+
var RouteClaimBaseSchema = z9.object({
|
|
9478
|
+
kind: z9.enum(["canonical", "alias", "redirect"]),
|
|
9479
|
+
routeSpaceRevisionRef: RevisionRefSchema,
|
|
9480
|
+
pathTemplate: RoutePathTemplateSchema,
|
|
9481
|
+
redirectTargetRef: StableRefSchema.optional()
|
|
9482
|
+
}).strict().superRefine((value, context) => {
|
|
9483
|
+
if (value.routeSpaceRevisionRef.kind !== "route-space") {
|
|
9484
|
+
context.addIssue({ code: "custom", path: ["routeSpaceRevisionRef", "kind"], message: "Route claims must reference a route-space revision." });
|
|
9485
|
+
}
|
|
9486
|
+
if (value.kind === "redirect" && !value.redirectTargetRef) {
|
|
9487
|
+
context.addIssue({ code: "custom", path: ["redirectTargetRef"], message: "Redirect claims require a governed target reference." });
|
|
9488
|
+
}
|
|
9489
|
+
if (value.kind !== "redirect" && value.redirectTargetRef) {
|
|
9490
|
+
context.addIssue({ code: "custom", path: ["redirectTargetRef"], message: "Only redirect claims may declare redirectTargetRef." });
|
|
9491
|
+
}
|
|
9492
|
+
});
|
|
9493
|
+
var LegacyRouteClaimSchema = RouteClaimBaseSchema;
|
|
9494
|
+
var RouteClaimSchema = RouteClaimBaseSchema.safeExtend({
|
|
9495
|
+
surface: ProductSurfaceSchema
|
|
9496
|
+
}).strict();
|
|
9497
|
+
var DeclarativeRouteClaimSchema = RouteClaimSchema;
|
|
9498
|
+
var LegacyDeclarativeRouteClaimSchema = LegacyRouteClaimSchema;
|
|
9499
|
+
var CompiledRouteMatcherSchema = z9.object({
|
|
9500
|
+
caseSensitive: z9.boolean(),
|
|
9501
|
+
trailingSlash: z9.enum(["preserve", "remove", "require"]),
|
|
9502
|
+
parameters: z9.array(RouteSpaceParameterSchema)
|
|
9503
|
+
}).strict();
|
|
9504
|
+
var CompiledRouteClaimSchema = RouteClaimSchema.safeExtend({
|
|
9505
|
+
normalizedPath: RoutePathTemplateSchema,
|
|
9506
|
+
matcher: CompiledRouteMatcherSchema
|
|
9507
|
+
}).strict();
|
|
9508
|
+
var LegacyCompiledRouteClaimSchema = LegacyRouteClaimSchema.safeExtend({
|
|
9509
|
+
normalizedPath: RoutePathTemplateSchema,
|
|
9510
|
+
matcher: CompiledRouteMatcherSchema
|
|
9511
|
+
}).strict();
|
|
9512
|
+
var validateDeclaredRouteSurfaces = (supportedSurfaces, routeClaims, context) => {
|
|
9513
|
+
if (uniqueArray(supportedSurfaces, (surface) => surface)) {
|
|
9514
|
+
context.addIssue({ code: "custom", path: ["supportedSurfaces"], message: "Supported surfaces must be unique." });
|
|
9515
|
+
}
|
|
9516
|
+
const explicitClaims = routeClaims.filter((claim) => "surface" in claim);
|
|
9517
|
+
if (explicitClaims.length > 0 && explicitClaims.length < routeClaims.length) {
|
|
9518
|
+
context.addIssue({ code: "custom", path: ["routeClaims"], message: "Route claims must either all declare surface or all omit it for legacy compatibility." });
|
|
9519
|
+
return;
|
|
9520
|
+
}
|
|
9521
|
+
routeClaims.forEach((claim, index) => {
|
|
9522
|
+
if ("surface" in claim && !supportedSurfaces.includes(claim.surface)) {
|
|
9523
|
+
context.addIssue({ code: "custom", path: ["routeClaims", index, "surface"], message: "Route claim surface must be declared by supportedSurfaces." });
|
|
9524
|
+
}
|
|
9525
|
+
});
|
|
9526
|
+
if (explicitClaims.length !== routeClaims.length) return;
|
|
9527
|
+
supportedSurfaces.forEach((surface) => {
|
|
9528
|
+
const canonicalCount = explicitClaims.filter((claim) => claim.surface === surface && claim.kind === "canonical").length;
|
|
9529
|
+
if (canonicalCount !== 1) {
|
|
9530
|
+
context.addIssue({ code: "custom", path: ["routeClaims"], message: `Surface ${surface} requires exactly one canonical route claim.` });
|
|
9531
|
+
}
|
|
9532
|
+
});
|
|
9533
|
+
};
|
|
9534
|
+
var ReleaseOperationSchema = z9.enum(["activate", "deactivate", "rollback"]);
|
|
9535
|
+
var ReleaseDependencyRoleSchema = z9.enum([
|
|
9536
|
+
"route-space",
|
|
9537
|
+
"shell",
|
|
9538
|
+
"page",
|
|
9539
|
+
"page-release",
|
|
9540
|
+
"workbench",
|
|
9541
|
+
"workbench-release",
|
|
9542
|
+
"navigation",
|
|
9543
|
+
"navigation-release",
|
|
9544
|
+
"menu-action",
|
|
9545
|
+
"application-menu-catalog",
|
|
9546
|
+
"capability",
|
|
9547
|
+
"provider",
|
|
9548
|
+
"ontology-definition",
|
|
9549
|
+
"view",
|
|
9550
|
+
"projection",
|
|
9551
|
+
"action",
|
|
9552
|
+
"token",
|
|
9553
|
+
"schema",
|
|
9554
|
+
"compiler",
|
|
9555
|
+
"workflow",
|
|
9556
|
+
"agent",
|
|
9557
|
+
"built-in-application",
|
|
9558
|
+
"design",
|
|
9559
|
+
"layout-policy",
|
|
9560
|
+
"performance-budget",
|
|
9561
|
+
"observation-policy"
|
|
9562
|
+
]);
|
|
9563
|
+
var DependencyKindByRole = {
|
|
9564
|
+
"route-space": "route-space",
|
|
9565
|
+
shell: "shell",
|
|
9566
|
+
page: "page",
|
|
9567
|
+
"page-release": "page-release",
|
|
9568
|
+
workbench: "workbench",
|
|
9569
|
+
"workbench-release": "workbench-release",
|
|
9570
|
+
navigation: "navigation",
|
|
9571
|
+
"navigation-release": "navigation-release",
|
|
9572
|
+
"menu-action": "menu-action",
|
|
9573
|
+
"application-menu-catalog": "application-menu-catalog",
|
|
9574
|
+
capability: "capability",
|
|
9575
|
+
provider: "view-provider",
|
|
9576
|
+
"ontology-definition": "ontology-definition",
|
|
9577
|
+
view: "view",
|
|
9578
|
+
projection: "projection",
|
|
9579
|
+
action: "domain-command",
|
|
9580
|
+
token: "design-token",
|
|
9581
|
+
schema: "schema",
|
|
9582
|
+
compiler: "compiler",
|
|
9583
|
+
workflow: "workflow",
|
|
9584
|
+
agent: "agent",
|
|
9585
|
+
"built-in-application": "built-in-application",
|
|
9586
|
+
design: "design",
|
|
9587
|
+
"layout-policy": "layout-policy",
|
|
9588
|
+
"performance-budget": "performance-budget",
|
|
9589
|
+
"observation-policy": "observation-policy"
|
|
9590
|
+
};
|
|
9591
|
+
var ReleaseDependencySchema = z9.object({
|
|
9592
|
+
role: ReleaseDependencyRoleSchema,
|
|
9593
|
+
revisionRef: RevisionRefSchema
|
|
9594
|
+
}).strict().superRefine((value, context) => {
|
|
9595
|
+
const expectedKind = DependencyKindByRole[value.role];
|
|
9596
|
+
if (value.revisionRef.kind !== expectedKind) {
|
|
9597
|
+
context.addIssue({
|
|
9598
|
+
code: "custom",
|
|
9599
|
+
path: ["revisionRef", "kind"],
|
|
9600
|
+
message: `Dependency role ${value.role} requires reference kind ${expectedKind}.`
|
|
9601
|
+
});
|
|
9602
|
+
}
|
|
9603
|
+
});
|
|
9604
|
+
var ReleaseValidationSchema = z9.object({
|
|
9605
|
+
result: z9.enum(["pass", "fail"]),
|
|
9606
|
+
inputHash: Sha256Schema,
|
|
9607
|
+
diagnosticRefs: z9.array(RevisionRefSchema)
|
|
9608
|
+
}).strict();
|
|
9609
|
+
var ReleaseEvidenceSchema = z9.object({
|
|
9610
|
+
publicationPlanRef: StableRefSchema,
|
|
9611
|
+
expectedHeadRevisionRef: RevisionRefSchema.nullable(),
|
|
9612
|
+
validation: ReleaseValidationSchema,
|
|
9613
|
+
approvalPolicyRevisionRef: RevisionRefSchema,
|
|
9614
|
+
approvalDecisionRevisionRef: RevisionRefSchema,
|
|
9615
|
+
actorRef: StableRefSchema,
|
|
9616
|
+
reason: z9.string().trim().min(1).max(4096),
|
|
9617
|
+
idempotencyKey: ContractIdentifierSchema,
|
|
9618
|
+
occurredAt: IsoDateTimeSchema,
|
|
9619
|
+
evidenceRefs: z9.array(RevisionRefSchema).min(1)
|
|
9620
|
+
}).strict().superRefine((value, context) => {
|
|
9621
|
+
const expectedKinds = [
|
|
9622
|
+
["publicationPlanRef", value.publicationPlanRef, "publication-plan"],
|
|
9623
|
+
["approvalPolicyRevisionRef", value.approvalPolicyRevisionRef, "approval-policy"],
|
|
9624
|
+
["approvalDecisionRevisionRef", value.approvalDecisionRevisionRef, "approval-decision"],
|
|
9625
|
+
["actorRef", value.actorRef, "actor"]
|
|
9626
|
+
];
|
|
9627
|
+
expectedKinds.forEach(([field, reference, expectedKind]) => {
|
|
9628
|
+
if (reference.kind !== expectedKind) {
|
|
9629
|
+
context.addIssue({ code: "custom", path: [field, "kind"], message: `${field} must reference ${expectedKind}.` });
|
|
9630
|
+
}
|
|
9631
|
+
});
|
|
9632
|
+
value.evidenceRefs.forEach((reference, index) => {
|
|
9633
|
+
if (reference.kind !== "evidence") context.addIssue({ code: "custom", path: ["evidenceRefs", index, "kind"], message: "Release evidenceRefs must reference evidence revisions." });
|
|
9634
|
+
});
|
|
9635
|
+
});
|
|
9636
|
+
var PublicationPlanOperationSchema = z9.object({
|
|
9637
|
+
releaseKind: z9.enum(["page-release", "workbench-release", "navigation-release"]),
|
|
9638
|
+
releaseSlotId: ContractIdentifierSchema,
|
|
9639
|
+
releaseRevisionRef: RevisionRefSchema,
|
|
9640
|
+
expectedHeadRevisionRef: RevisionRefSchema.nullable()
|
|
9641
|
+
}).strict().superRefine((value, context) => {
|
|
9642
|
+
if (value.releaseRevisionRef.kind !== value.releaseKind || value.releaseRevisionRef.id !== value.releaseSlotId) {
|
|
9643
|
+
context.addIssue({ code: "custom", path: ["releaseRevisionRef"], message: "Publication Plan operation must pin the exact release slot revision." });
|
|
9644
|
+
}
|
|
9645
|
+
if (value.expectedHeadRevisionRef && (value.expectedHeadRevisionRef.kind !== value.releaseKind || value.expectedHeadRevisionRef.id !== value.releaseSlotId)) {
|
|
9646
|
+
context.addIssue({ code: "custom", path: ["expectedHeadRevisionRef"], message: "Expected head must identify the same release slot." });
|
|
9647
|
+
}
|
|
9648
|
+
});
|
|
9649
|
+
var PublicationPlanSchema = z9.object({
|
|
9650
|
+
contract: z9.literal("PublicationPlan"),
|
|
9651
|
+
schemaVersion: z9.literal(DECLARATIVE_CONTROL_SCHEMA_VERSION),
|
|
9652
|
+
planId: ContractIdentifierSchema,
|
|
9653
|
+
tenantScope: TenantScopeSchema,
|
|
9654
|
+
environmentRef: StableRefSchema,
|
|
9655
|
+
operations: z9.array(PublicationPlanOperationSchema).min(1),
|
|
9656
|
+
validation: ReleaseValidationSchema,
|
|
9657
|
+
approvalPolicyRevisionRef: RevisionRefSchema,
|
|
9658
|
+
approvalDecisionRevisionRef: RevisionRefSchema,
|
|
9659
|
+
actorRef: StableRefSchema,
|
|
9660
|
+
idempotencyKey: ContractIdentifierSchema,
|
|
9661
|
+
evidenceRefs: z9.array(RevisionRefSchema).min(1),
|
|
9662
|
+
createdAt: IsoDateTimeSchema
|
|
9663
|
+
}).strict().superRefine((value, context) => {
|
|
9664
|
+
if (value.environmentRef.kind !== "environment") context.addIssue({ code: "custom", path: ["environmentRef", "kind"], message: "Publication Plan requires an environment reference." });
|
|
9665
|
+
const governedRefs = [
|
|
9666
|
+
["approvalPolicyRevisionRef", value.approvalPolicyRevisionRef, "approval-policy"],
|
|
9667
|
+
["approvalDecisionRevisionRef", value.approvalDecisionRevisionRef, "approval-decision"],
|
|
9668
|
+
["actorRef", value.actorRef, "actor"]
|
|
9669
|
+
];
|
|
9670
|
+
governedRefs.forEach(([field, reference, expectedKind]) => {
|
|
9671
|
+
if (reference.kind !== expectedKind) context.addIssue({ code: "custom", path: [field, "kind"], message: `${field} must reference ${expectedKind}.` });
|
|
9672
|
+
});
|
|
9673
|
+
value.operations.forEach((operation, index) => {
|
|
9674
|
+
[operation.releaseRevisionRef, operation.expectedHeadRevisionRef].forEach((reference, referenceIndex) => {
|
|
9675
|
+
if (reference?.tenantScope && tenantScopeKey(reference.tenantScope) !== tenantScopeKey(value.tenantScope)) {
|
|
9676
|
+
const field = referenceIndex === 0 ? "releaseRevisionRef" : "expectedHeadRevisionRef";
|
|
9677
|
+
context.addIssue({ code: "custom", path: ["operations", index, field, "tenantScope"], message: "Publication Plan operation belongs to another tenant scope." });
|
|
9678
|
+
}
|
|
9679
|
+
});
|
|
9680
|
+
});
|
|
9681
|
+
value.evidenceRefs.forEach((reference, index) => {
|
|
9682
|
+
if (reference.kind !== "evidence") context.addIssue({ code: "custom", path: ["evidenceRefs", index, "kind"], message: "Publication Plan evidenceRefs must reference evidence revisions." });
|
|
9683
|
+
});
|
|
9684
|
+
if (uniqueArray(value.operations, (operation) => `${operation.releaseKind}:${operation.releaseSlotId}`)) {
|
|
9685
|
+
context.addIssue({ code: "custom", path: ["operations"], message: "Publication Plan release slots must be unique." });
|
|
9686
|
+
}
|
|
9687
|
+
});
|
|
9688
|
+
var IdentitySchema = z9.object({
|
|
9689
|
+
name: I18nTextSchema,
|
|
9690
|
+
description: I18nTextSchema.optional(),
|
|
9691
|
+
tags: z9.array(ContractIdentifierSchema).default([])
|
|
9692
|
+
}).strict();
|
|
9693
|
+
var WorkbenchIdentitySchema = IdentitySchema.extend({ iconRef: StableRefSchema.optional() }).strict();
|
|
9694
|
+
var ReleaseBaseShape = {
|
|
9695
|
+
schemaVersion: z9.literal(DECLARATIVE_CONTROL_SCHEMA_VERSION),
|
|
9696
|
+
releaseSlotId: ContractIdentifierSchema,
|
|
9697
|
+
tenantScope: TenantScopeSchema,
|
|
9698
|
+
operation: ReleaseOperationSchema,
|
|
9699
|
+
dependencySnapshot: z9.array(ReleaseDependencySchema),
|
|
9700
|
+
evidence: ReleaseEvidenceSchema
|
|
9701
|
+
};
|
|
9702
|
+
var validateDependencySnapshot = (snapshot, context) => {
|
|
9703
|
+
const duplicate = uniqueArray(snapshot, (dependency) => `${dependency.role}:${stableRefIdentity(dependency.revisionRef)}@${dependency.revisionRef.revision}`);
|
|
9704
|
+
if (duplicate) context.addIssue({ code: "custom", path: ["dependencySnapshot"], message: `Duplicate dependency: ${duplicate}` });
|
|
9705
|
+
};
|
|
9706
|
+
var validateReleaseExpectedHead = (value, expectedKind, context) => {
|
|
9707
|
+
const expectedHead = value.evidence.expectedHeadRevisionRef;
|
|
9708
|
+
if (expectedHead && (expectedHead.kind !== expectedKind || expectedHead.id !== value.releaseSlotId)) {
|
|
9709
|
+
context.addIssue({ code: "custom", path: ["evidence", "expectedHeadRevisionRef"], message: "Expected head must identify the same release slot." });
|
|
9710
|
+
}
|
|
9711
|
+
if (expectedHead?.tenantScope && tenantScopeKey(expectedHead.tenantScope) !== tenantScopeKey(value.tenantScope)) {
|
|
9712
|
+
context.addIssue({ code: "custom", path: ["evidence", "expectedHeadRevisionRef", "tenantScope"], message: "Expected head belongs to another tenant scope." });
|
|
9713
|
+
}
|
|
9714
|
+
};
|
|
9715
|
+
var BindingSourceSchema = z9.discriminatedUnion("kind", [
|
|
9716
|
+
z9.object({ kind: z9.literal("constant"), value: z9.union([z9.string(), z9.number().finite(), z9.boolean(), z9.null()]) }).strict(),
|
|
9717
|
+
z9.object({ kind: z9.literal("route-parameter"), name: ContractIdentifierSchema }).strict(),
|
|
9718
|
+
z9.object({ kind: z9.literal("query-parameter"), name: ContractIdentifierSchema }).strict(),
|
|
9719
|
+
z9.object({ kind: z9.literal("identity"), name: z9.enum(["tenantId", "teamId", "userId"]) }).strict(),
|
|
9720
|
+
z9.object({ kind: z9.literal("intent-field"), path: z9.string().trim().regex(/^[A-Za-z0-9_.-]+$/) }).strict(),
|
|
9721
|
+
z9.object({ kind: z9.literal("binding-field"), bindingId: ContractIdentifierSchema, path: z9.string().trim().regex(/^[A-Za-z0-9_.-]+$/) }).strict()
|
|
9722
|
+
]);
|
|
9723
|
+
var CapabilityInstanceSchema = z9.object({
|
|
9724
|
+
instanceId: ContractIdentifierSchema,
|
|
9725
|
+
nodeId: ContractIdentifierSchema,
|
|
9726
|
+
capabilityRevisionRef: RevisionRefSchema,
|
|
9727
|
+
providerRevisionRef: RevisionRefSchema,
|
|
9728
|
+
propertySchemaRevisionRef: RevisionRefSchema,
|
|
9729
|
+
properties: JsonObjectSchema,
|
|
9730
|
+
allowedSideEffects: z9.array(z9.enum(["network", "storage", "navigation", "worker", "websocket"]))
|
|
9731
|
+
}).strict();
|
|
9732
|
+
var OntologyBindingSchema = z9.object({
|
|
9733
|
+
bindingId: ContractIdentifierSchema,
|
|
9734
|
+
ontologyDefinitionRevisionRef: RevisionRefSchema,
|
|
9735
|
+
viewRevisionRef: RevisionRefSchema.optional(),
|
|
9736
|
+
projectionRevisionRef: RevisionRefSchema.optional(),
|
|
9737
|
+
parameters: z9.record(ContractIdentifierSchema, BindingSourceSchema),
|
|
9738
|
+
target: z9.object({ capabilityInstanceId: ContractIdentifierSchema, port: ContractIdentifierSchema }).strict(),
|
|
9739
|
+
renderModelSchemaRevisionRef: RevisionRefSchema,
|
|
9740
|
+
pagination: z9.enum(["none", "cursor", "offset"]),
|
|
9741
|
+
cache: z9.enum(["none", "identity-scoped", "tenant-scoped"]),
|
|
9742
|
+
cancelOnChange: z9.boolean()
|
|
9743
|
+
}).strict().superRefine((value, context) => {
|
|
9744
|
+
if ((value.viewRevisionRef ? 1 : 0) + (value.projectionRevisionRef ? 1 : 0) !== 1) {
|
|
9745
|
+
context.addIssue({ code: "custom", path: ["viewRevisionRef"], message: "Ontology bindings require exactly one View or Projection revision." });
|
|
9746
|
+
}
|
|
9747
|
+
if (value.ontologyDefinitionRevisionRef.kind !== "ontology-definition") {
|
|
9748
|
+
context.addIssue({ code: "custom", path: ["ontologyDefinitionRevisionRef", "kind"], message: "Expected an ontology-definition revision." });
|
|
9749
|
+
}
|
|
9750
|
+
});
|
|
9751
|
+
var ActionBindingSchema = z9.object({
|
|
9752
|
+
bindingId: ContractIdentifierSchema,
|
|
9753
|
+
commandRevisionRef: RevisionRefSchema,
|
|
9754
|
+
source: z9.object({ capabilityInstanceId: ContractIdentifierSchema, port: ContractIdentifierSchema }).strict(),
|
|
9755
|
+
sourceIntentSchemaRevisionRef: RevisionRefSchema,
|
|
9756
|
+
inputSchemaRevisionRef: RevisionRefSchema,
|
|
9757
|
+
inputMapping: z9.record(ContractIdentifierSchema, BindingSourceSchema),
|
|
9758
|
+
accessPolicy: AccessPolicySchema,
|
|
9759
|
+
confirmation: I18nTextSchema.optional(),
|
|
9760
|
+
idempotencyKeySource: z9.enum(["interaction", "record-and-interaction", "caller-provided"]),
|
|
9761
|
+
compensationCommandRevisionRef: RevisionRefSchema.optional(),
|
|
9762
|
+
resultSchemaRevisionRef: RevisionRefSchema,
|
|
9763
|
+
success: z9.object({
|
|
9764
|
+
refreshBindingIds: z9.array(ContractIdentifierSchema),
|
|
9765
|
+
navigationTargetRef: StableRefSchema.optional()
|
|
9766
|
+
}).strict(),
|
|
9767
|
+
recovery: z9.enum(["retry-safe", "compensating-command", "manual-review"]),
|
|
9768
|
+
lineageRequired: z9.literal(true)
|
|
9769
|
+
}).strict().superRefine((value, context) => {
|
|
9770
|
+
if (value.commandRevisionRef.kind !== "domain-command") {
|
|
9771
|
+
context.addIssue({ code: "custom", path: ["commandRevisionRef", "kind"], message: "Action bindings must reference a domain-command revision." });
|
|
9772
|
+
}
|
|
9773
|
+
if (value.sourceIntentSchemaRevisionRef.kind !== "schema") {
|
|
9774
|
+
context.addIssue({ code: "custom", path: ["sourceIntentSchemaRevisionRef", "kind"], message: "Action source intents must pin a schema revision." });
|
|
9775
|
+
}
|
|
9776
|
+
if (value.inputSchemaRevisionRef.kind !== "schema") {
|
|
9777
|
+
context.addIssue({ code: "custom", path: ["inputSchemaRevisionRef", "kind"], message: "Action command inputs must pin a schema revision." });
|
|
9778
|
+
}
|
|
9779
|
+
if (value.recovery === "compensating-command" && !value.compensationCommandRevisionRef) {
|
|
9780
|
+
context.addIssue({ code: "custom", path: ["compensationCommandRevisionRef"], message: "Compensating recovery requires a compensation command." });
|
|
9781
|
+
}
|
|
9782
|
+
});
|
|
9783
|
+
var PageSchema = z9.object({
|
|
9784
|
+
contract: z9.literal("Page"),
|
|
9785
|
+
schemaVersion: z9.literal(DECLARATIVE_CONTROL_SCHEMA_VERSION),
|
|
9786
|
+
pageId: ContractIdentifierSchema,
|
|
9787
|
+
tenantScope: TenantScopeSchema,
|
|
9788
|
+
identity: IdentitySchema,
|
|
9789
|
+
supportedSurfaces: z9.array(ProductSurfaceSchema).min(1),
|
|
9790
|
+
lifecycle: DeclarativeLifecycleSchema,
|
|
9791
|
+
routeClaims: z9.array(z9.union([DeclarativeRouteClaimSchema, LegacyDeclarativeRouteClaimSchema])).min(1),
|
|
9792
|
+
shellRevisionRef: RevisionRefSchema,
|
|
9793
|
+
renderTree: RenderTreeSchema,
|
|
9794
|
+
capabilityInstances: z9.array(CapabilityInstanceSchema).min(1),
|
|
9795
|
+
ontologyBindings: z9.array(OntologyBindingSchema),
|
|
9796
|
+
actionBindings: z9.array(ActionBindingSchema),
|
|
9797
|
+
pageAccessPolicy: AccessPolicySchema,
|
|
9798
|
+
managementAccess: ManagementAccessSchema,
|
|
9799
|
+
tokenRevisionRefs: z9.array(RevisionRefSchema).min(1),
|
|
9800
|
+
performanceBudgetRef: RevisionRefSchema,
|
|
9801
|
+
observationPolicyRevisionRef: RevisionRefSchema,
|
|
9802
|
+
privacyClassification: z9.enum(["public", "internal", "confidential", "restricted"])
|
|
9803
|
+
}).strict().superRefine((value, context) => {
|
|
9804
|
+
validateDeclaredRouteSurfaces(value.supportedSurfaces, value.routeClaims, context);
|
|
9805
|
+
const uniqueness = [
|
|
9806
|
+
["capabilityInstances", value.capabilityInstances, (candidate) => String(candidate.instanceId)],
|
|
9807
|
+
["ontologyBindings", value.ontologyBindings, (candidate) => String(candidate.bindingId)],
|
|
9808
|
+
["actionBindings", value.actionBindings, (candidate) => String(candidate.bindingId)]
|
|
9809
|
+
];
|
|
9810
|
+
uniqueness.forEach(([field, values, identity]) => {
|
|
9811
|
+
if (uniqueArray(values, identity)) context.addIssue({ code: "custom", path: [field], message: `${field} identities must be unique.` });
|
|
9812
|
+
});
|
|
9813
|
+
const instanceIds = new Set(value.capabilityInstances.map((instance) => instance.instanceId));
|
|
9814
|
+
value.ontologyBindings.forEach((binding, index) => {
|
|
9815
|
+
if (!instanceIds.has(binding.target.capabilityInstanceId)) {
|
|
9816
|
+
context.addIssue({ code: "custom", path: ["ontologyBindings", index, "target", "capabilityInstanceId"], message: "Ontology binding targets an unknown capability instance." });
|
|
9817
|
+
}
|
|
9818
|
+
});
|
|
9819
|
+
value.actionBindings.forEach((binding, index) => {
|
|
9820
|
+
if (!instanceIds.has(binding.source.capabilityInstanceId)) {
|
|
9821
|
+
context.addIssue({ code: "custom", path: ["actionBindings", index, "source", "capabilityInstanceId"], message: "Action binding sources an unknown capability instance." });
|
|
9822
|
+
}
|
|
9823
|
+
binding.success.refreshBindingIds.forEach((bindingId) => {
|
|
9824
|
+
if (!value.ontologyBindings.some((candidate) => candidate.bindingId === bindingId)) {
|
|
9825
|
+
context.addIssue({ code: "custom", path: ["actionBindings", index, "success", "refreshBindingIds"], message: `Unknown refresh binding: ${bindingId}` });
|
|
9826
|
+
}
|
|
9827
|
+
});
|
|
9828
|
+
});
|
|
9829
|
+
if (value.shellRevisionRef.kind !== "shell") context.addIssue({ code: "custom", path: ["shellRevisionRef", "kind"], message: "Page shellRevisionRef must reference a shell." });
|
|
9830
|
+
value.capabilityInstances.forEach((instance, index) => {
|
|
9831
|
+
const refs = [
|
|
9832
|
+
["capabilityRevisionRef", instance.capabilityRevisionRef, "capability"],
|
|
9833
|
+
["providerRevisionRef", instance.providerRevisionRef, "view-provider"],
|
|
9834
|
+
["propertySchemaRevisionRef", instance.propertySchemaRevisionRef, "schema"]
|
|
9835
|
+
];
|
|
9836
|
+
refs.forEach(([field, reference, expectedKind]) => {
|
|
9837
|
+
if (reference.kind !== expectedKind) context.addIssue({ code: "custom", path: ["capabilityInstances", index, field, "kind"], message: `${field} must reference ${expectedKind}.` });
|
|
9838
|
+
});
|
|
9839
|
+
});
|
|
9840
|
+
value.tokenRevisionRefs.forEach((reference, index) => {
|
|
9841
|
+
if (reference.kind !== "design-token") context.addIssue({ code: "custom", path: ["tokenRevisionRefs", index, "kind"], message: "Page token references must use kind design-token." });
|
|
9842
|
+
});
|
|
9843
|
+
if (value.performanceBudgetRef.kind !== "performance-budget") context.addIssue({ code: "custom", path: ["performanceBudgetRef", "kind"], message: "Page requires a performance-budget revision." });
|
|
9844
|
+
if (value.observationPolicyRevisionRef.kind !== "observation-policy") context.addIssue({ code: "custom", path: ["observationPolicyRevisionRef", "kind"], message: "Page requires an observation-policy revision." });
|
|
9845
|
+
});
|
|
9846
|
+
var PageReleaseSchema = z9.object({
|
|
9847
|
+
contract: z9.literal("PageRelease"),
|
|
9848
|
+
...ReleaseBaseShape,
|
|
9849
|
+
pageRevisionRef: RevisionRefSchema,
|
|
9850
|
+
target: z9.object({
|
|
9851
|
+
environmentRef: StableRefSchema,
|
|
9852
|
+
surface: ProductSurfaceSchema,
|
|
9853
|
+
routeSpaceRevisionRef: RevisionRefSchema,
|
|
9854
|
+
normalizedPath: RoutePathTemplateSchema,
|
|
9855
|
+
routeClaim: z9.union([CompiledRouteClaimSchema, LegacyCompiledRouteClaimSchema])
|
|
9856
|
+
}).strict()
|
|
9857
|
+
}).strict().superRefine((value, context) => {
|
|
9858
|
+
validateDependencySnapshot(value.dependencySnapshot, context);
|
|
9859
|
+
validateReleaseExpectedHead(value, "page-release", context);
|
|
9860
|
+
if (value.pageRevisionRef.kind !== "page") context.addIssue({ code: "custom", path: ["pageRevisionRef", "kind"], message: "Expected a page revision." });
|
|
9861
|
+
if (value.target.environmentRef.kind !== "environment") context.addIssue({ code: "custom", path: ["target", "environmentRef", "kind"], message: "Page release target requires an environment reference." });
|
|
9862
|
+
if (value.target.routeSpaceRevisionRef.kind !== "route-space") context.addIssue({ code: "custom", path: ["target", "routeSpaceRevisionRef", "kind"], message: "Page release target requires a route-space revision." });
|
|
9863
|
+
if (value.target.normalizedPath !== value.target.routeClaim.normalizedPath || !exactRevisionRef(value.target.routeSpaceRevisionRef, value.target.routeClaim.routeSpaceRevisionRef)) {
|
|
9864
|
+
context.addIssue({ code: "custom", path: ["target", "routeClaim"], message: "Page Release route authority must pin the exact compiled claim and normalized path." });
|
|
9865
|
+
}
|
|
9866
|
+
if ("surface" in value.target.routeClaim && value.target.routeClaim.surface !== value.target.surface) {
|
|
9867
|
+
context.addIssue({ code: "custom", path: ["target", "routeClaim", "surface"], message: "Page Release route claim must match the target surface." });
|
|
9868
|
+
}
|
|
9869
|
+
});
|
|
9870
|
+
var WorkbenchGroupSchema = z9.object({
|
|
9871
|
+
groupId: ContractIdentifierSchema,
|
|
9872
|
+
label: I18nTextSchema,
|
|
9873
|
+
iconRef: StableRefSchema.optional(),
|
|
9874
|
+
order: z9.number().int(),
|
|
9875
|
+
collapsedByDefault: z9.boolean(),
|
|
9876
|
+
accessPolicy: AccessPolicySchema.optional()
|
|
9877
|
+
}).strict();
|
|
9878
|
+
var WorkbenchAppInstanceSchema = z9.object({
|
|
9879
|
+
instanceId: ContractIdentifierSchema,
|
|
9880
|
+
kind: z9.enum(["built-in-application", "workflow-form", "workflow", "agent", "design", "capability"]),
|
|
9881
|
+
targetRevisionRef: RevisionRefSchema,
|
|
9882
|
+
providerRevisionRef: RevisionRefSchema,
|
|
9883
|
+
inputSchemaRevisionRef: RevisionRefSchema,
|
|
9884
|
+
input: JsonObjectSchema,
|
|
9885
|
+
groupId: ContractIdentifierSchema,
|
|
9886
|
+
order: z9.number().int(),
|
|
9887
|
+
display: z9.object({ name: I18nTextSchema.optional(), iconRef: StableRefSchema.optional() }).strict(),
|
|
9888
|
+
accessPolicy: AccessPolicySchema
|
|
9889
|
+
}).strict();
|
|
9890
|
+
var WorkbenchSchema = z9.object({
|
|
9891
|
+
contract: z9.literal("Workbench"),
|
|
9892
|
+
schemaVersion: z9.literal(DECLARATIVE_CONTROL_SCHEMA_VERSION),
|
|
9893
|
+
workbenchId: ContractIdentifierSchema,
|
|
9894
|
+
tenantScope: TenantScopeSchema,
|
|
9895
|
+
purpose: z9.enum(["instance", "template"]),
|
|
9896
|
+
sourceTemplateRevisionRef: RevisionRefSchema.optional(),
|
|
9897
|
+
identity: WorkbenchIdentitySchema,
|
|
9898
|
+
supportedSurfaces: z9.array(ProductSurfaceSchema).min(1),
|
|
9899
|
+
lifecycle: DeclarativeLifecycleSchema,
|
|
9900
|
+
routeClaims: z9.array(z9.union([DeclarativeRouteClaimSchema, LegacyDeclarativeRouteClaimSchema])).min(1),
|
|
9901
|
+
groups: z9.array(WorkbenchGroupSchema).min(1),
|
|
9902
|
+
appInstances: z9.array(WorkbenchAppInstanceSchema).min(1),
|
|
9903
|
+
defaultEntry: z9.object({ groupId: ContractIdentifierSchema, instanceId: ContractIdentifierSchema, showDefaultGroup: z9.boolean() }).strict(),
|
|
9904
|
+
layout: z9.object({
|
|
9905
|
+
hostCapabilityRevisionRef: RevisionRefSchema,
|
|
9906
|
+
hostProviderRevisionRef: RevisionRefSchema,
|
|
9907
|
+
layoutPolicyRevisionRef: RevisionRefSchema,
|
|
9908
|
+
tokenRevisionRefs: z9.array(RevisionRefSchema).min(1)
|
|
9909
|
+
}).strict(),
|
|
9910
|
+
workbenchAccessPolicy: AccessPolicySchema,
|
|
9911
|
+
managementAccess: ManagementAccessSchema,
|
|
9912
|
+
personalPreferencesPolicy: z9.object({
|
|
9913
|
+
allowed: z9.array(z9.enum(["collapsed-groups", "recent-entry", "layout-density"])),
|
|
9914
|
+
authority: z9.literal("identity-overlay")
|
|
9915
|
+
}).strict(),
|
|
9916
|
+
performanceBudgetRef: RevisionRefSchema,
|
|
9917
|
+
observationPolicyRevisionRef: RevisionRefSchema,
|
|
9918
|
+
privacyClassification: z9.enum(["public", "internal", "confidential", "restricted"])
|
|
9919
|
+
}).strict().superRefine((value, context) => {
|
|
9920
|
+
validateDeclaredRouteSurfaces(value.supportedSurfaces, value.routeClaims, context);
|
|
9921
|
+
if (value.purpose === "template" && value.sourceTemplateRevisionRef) {
|
|
9922
|
+
context.addIssue({ code: "custom", path: ["sourceTemplateRevisionRef"], message: "Templates cannot derive from another template at runtime." });
|
|
9923
|
+
}
|
|
9924
|
+
const duplicateGroup = uniqueArray(value.groups, (group) => group.groupId);
|
|
9925
|
+
if (duplicateGroup) context.addIssue({ code: "custom", path: ["groups"], message: `Duplicate Workbench group: ${duplicateGroup}` });
|
|
9926
|
+
const duplicateInstance = uniqueArray(value.appInstances, (instance) => instance.instanceId);
|
|
9927
|
+
if (duplicateInstance) context.addIssue({ code: "custom", path: ["appInstances"], message: `Duplicate Workbench instance: ${duplicateInstance}` });
|
|
9928
|
+
const groupIds = new Set(value.groups.map((group) => group.groupId));
|
|
9929
|
+
value.appInstances.forEach((instance, index) => {
|
|
9930
|
+
if (!groupIds.has(instance.groupId)) context.addIssue({ code: "custom", path: ["appInstances", index, "groupId"], message: "Workbench app references an unknown group." });
|
|
9931
|
+
});
|
|
9932
|
+
const defaultInstance = value.appInstances.find((instance) => instance.instanceId === value.defaultEntry.instanceId);
|
|
9933
|
+
if (!defaultInstance || defaultInstance.groupId !== value.defaultEntry.groupId) {
|
|
9934
|
+
context.addIssue({ code: "custom", path: ["defaultEntry"], message: "Workbench default entry must reference an app in the declared group." });
|
|
9935
|
+
}
|
|
9936
|
+
const targetKindByInstanceKind = {
|
|
9937
|
+
"built-in-application": "built-in-application",
|
|
9938
|
+
"workflow-form": "workflow",
|
|
9939
|
+
workflow: "workflow",
|
|
9940
|
+
agent: "agent",
|
|
9941
|
+
design: "design",
|
|
9942
|
+
capability: "capability"
|
|
9943
|
+
};
|
|
9944
|
+
value.appInstances.forEach((instance, index) => {
|
|
9945
|
+
if (instance.targetRevisionRef.kind !== targetKindByInstanceKind[instance.kind]) context.addIssue({ code: "custom", path: ["appInstances", index, "targetRevisionRef", "kind"], message: `Workbench ${instance.kind} target has an incompatible reference kind.` });
|
|
9946
|
+
if (instance.providerRevisionRef.kind !== "view-provider") context.addIssue({ code: "custom", path: ["appInstances", index, "providerRevisionRef", "kind"], message: "Workbench app provider must use kind view-provider." });
|
|
9947
|
+
if (instance.inputSchemaRevisionRef.kind !== "schema") context.addIssue({ code: "custom", path: ["appInstances", index, "inputSchemaRevisionRef", "kind"], message: "Workbench app input must pin a schema revision." });
|
|
9948
|
+
});
|
|
9949
|
+
const layoutRefs = [
|
|
9950
|
+
["hostCapabilityRevisionRef", value.layout.hostCapabilityRevisionRef, "capability"],
|
|
9951
|
+
["hostProviderRevisionRef", value.layout.hostProviderRevisionRef, "view-provider"],
|
|
9952
|
+
["layoutPolicyRevisionRef", value.layout.layoutPolicyRevisionRef, "layout-policy"]
|
|
9953
|
+
];
|
|
9954
|
+
layoutRefs.forEach(([field, reference, expectedKind]) => {
|
|
9955
|
+
if (reference.kind !== expectedKind) context.addIssue({ code: "custom", path: ["layout", field, "kind"], message: `${field} must reference ${expectedKind}.` });
|
|
9956
|
+
});
|
|
9957
|
+
value.layout.tokenRevisionRefs.forEach((reference, index) => {
|
|
9958
|
+
if (reference.kind !== "design-token") context.addIssue({ code: "custom", path: ["layout", "tokenRevisionRefs", index, "kind"], message: "Workbench token references must use kind design-token." });
|
|
9959
|
+
});
|
|
9960
|
+
});
|
|
9961
|
+
var WorkbenchReleaseSchema = z9.object({
|
|
9962
|
+
contract: z9.literal("WorkbenchRelease"),
|
|
9963
|
+
...ReleaseBaseShape,
|
|
9964
|
+
workbenchRevisionRef: RevisionRefSchema,
|
|
9965
|
+
target: z9.object({
|
|
9966
|
+
environmentRef: StableRefSchema,
|
|
9967
|
+
surface: ProductSurfaceSchema,
|
|
9968
|
+
workbenchId: ContractIdentifierSchema,
|
|
9969
|
+
routeSpaceRevisionRef: RevisionRefSchema,
|
|
9970
|
+
normalizedPath: RoutePathTemplateSchema,
|
|
9971
|
+
routeClaim: z9.union([CompiledRouteClaimSchema, LegacyCompiledRouteClaimSchema]),
|
|
9972
|
+
order: z9.number().int(),
|
|
9973
|
+
isDefaultCandidate: z9.boolean()
|
|
9974
|
+
}).strict()
|
|
9975
|
+
}).strict().superRefine((value, context) => {
|
|
9976
|
+
validateDependencySnapshot(value.dependencySnapshot, context);
|
|
9977
|
+
validateReleaseExpectedHead(value, "workbench-release", context);
|
|
9978
|
+
if (value.workbenchRevisionRef.kind !== "workbench") context.addIssue({ code: "custom", path: ["workbenchRevisionRef", "kind"], message: "Expected a workbench revision." });
|
|
9979
|
+
if (value.target.environmentRef.kind !== "environment") context.addIssue({ code: "custom", path: ["target", "environmentRef", "kind"], message: "Workbench release target requires an environment reference." });
|
|
9980
|
+
if (value.target.routeSpaceRevisionRef.kind !== "route-space") context.addIssue({ code: "custom", path: ["target", "routeSpaceRevisionRef", "kind"], message: "Workbench release target requires a route-space revision." });
|
|
9981
|
+
if (value.target.normalizedPath !== value.target.routeClaim.normalizedPath || !exactRevisionRef(value.target.routeSpaceRevisionRef, value.target.routeClaim.routeSpaceRevisionRef)) {
|
|
9982
|
+
context.addIssue({ code: "custom", path: ["target", "routeClaim"], message: "Workbench Release route authority must pin the exact compiled claim and normalized path." });
|
|
9983
|
+
}
|
|
9984
|
+
if ("surface" in value.target.routeClaim && value.target.routeClaim.surface !== value.target.surface) {
|
|
9985
|
+
context.addIssue({ code: "custom", path: ["target", "routeClaim", "surface"], message: "Workbench Release route claim must match the target surface." });
|
|
9986
|
+
}
|
|
9987
|
+
});
|
|
9988
|
+
var NavigationNodeBaseShape = {
|
|
9989
|
+
nodeId: ContractIdentifierSchema,
|
|
9990
|
+
parentNodeId: ContractIdentifierSchema.nullable(),
|
|
9991
|
+
order: z9.number().int(),
|
|
9992
|
+
disabled: z9.boolean().optional()
|
|
9993
|
+
};
|
|
9994
|
+
var NavigationGroupNodeSchema = z9.object({
|
|
9995
|
+
...NavigationNodeBaseShape,
|
|
9996
|
+
kind: z9.literal("group"),
|
|
9997
|
+
label: I18nTextSchema,
|
|
9998
|
+
iconRef: StableRefSchema.optional(),
|
|
9999
|
+
collapsedByDefault: z9.boolean(),
|
|
10000
|
+
audience: AccessPolicySchema
|
|
10001
|
+
}).strict();
|
|
10002
|
+
var NavigationTargetNodeSchema = z9.object({
|
|
10003
|
+
...NavigationNodeBaseShape,
|
|
10004
|
+
kind: z9.literal("target"),
|
|
10005
|
+
label: I18nTextSchema,
|
|
10006
|
+
iconRef: StableRefSchema.optional(),
|
|
10007
|
+
tone: z9.enum(["default", "danger"]).optional(),
|
|
10008
|
+
targetRef: StableRefSchema,
|
|
10009
|
+
parameterMapping: z9.record(ContractIdentifierSchema, BindingSourceSchema),
|
|
10010
|
+
audience: AccessPolicySchema
|
|
10011
|
+
}).strict();
|
|
10012
|
+
var NavigationSeparatorNodeSchema = z9.object({
|
|
10013
|
+
...NavigationNodeBaseShape,
|
|
10014
|
+
kind: z9.literal("separator")
|
|
10015
|
+
}).strict();
|
|
10016
|
+
var NavigationNodeSchema = z9.discriminatedUnion("kind", [
|
|
10017
|
+
NavigationGroupNodeSchema,
|
|
10018
|
+
NavigationTargetNodeSchema,
|
|
10019
|
+
NavigationSeparatorNodeSchema
|
|
10020
|
+
]);
|
|
10021
|
+
var validateNavigationTree = (nodes, context) => {
|
|
10022
|
+
const byId = /* @__PURE__ */ new Map();
|
|
10023
|
+
nodes.forEach((node, index) => {
|
|
10024
|
+
if (byId.has(node.nodeId)) context.addIssue({ code: "custom", path: ["nodes", index, "nodeId"], message: `Duplicate Navigation node: ${node.nodeId}` });
|
|
10025
|
+
else byId.set(node.nodeId, { node, index });
|
|
10026
|
+
});
|
|
10027
|
+
const siblingOrders = /* @__PURE__ */ new Set();
|
|
10028
|
+
nodes.forEach((node, index) => {
|
|
10029
|
+
const orderKey = `${node.parentNodeId ?? ""}:${node.order}`;
|
|
10030
|
+
if (siblingOrders.has(orderKey)) context.addIssue({ code: "custom", path: ["nodes", index, "order"], message: "Sibling Navigation order values must be unique." });
|
|
10031
|
+
siblingOrders.add(orderKey);
|
|
10032
|
+
if (node.parentNodeId) {
|
|
10033
|
+
const parent = byId.get(node.parentNodeId)?.node;
|
|
10034
|
+
if (!parent) context.addIssue({ code: "custom", path: ["nodes", index, "parentNodeId"], message: "Navigation node has an unknown parent." });
|
|
10035
|
+
else if (parent.kind !== "group") context.addIssue({ code: "custom", path: ["nodes", index, "parentNodeId"], message: "Navigation parents must be groups." });
|
|
10036
|
+
}
|
|
10037
|
+
const ancestors = /* @__PURE__ */ new Set([node.nodeId]);
|
|
10038
|
+
let parentId = node.parentNodeId;
|
|
10039
|
+
while (parentId) {
|
|
10040
|
+
if (ancestors.has(parentId)) {
|
|
10041
|
+
context.addIssue({ code: "custom", path: ["nodes", index, "parentNodeId"], message: `Navigation cycle contains ${node.nodeId}.` });
|
|
10042
|
+
break;
|
|
10043
|
+
}
|
|
10044
|
+
ancestors.add(parentId);
|
|
10045
|
+
parentId = byId.get(parentId)?.node.parentNodeId ?? null;
|
|
10046
|
+
}
|
|
10047
|
+
});
|
|
10048
|
+
};
|
|
10049
|
+
var NavigationSchema = z9.object({
|
|
10050
|
+
contract: z9.literal("Navigation"),
|
|
10051
|
+
schemaVersion: z9.literal(DECLARATIVE_CONTROL_SCHEMA_VERSION),
|
|
10052
|
+
navigationId: ContractIdentifierSchema,
|
|
10053
|
+
tenantScope: TenantScopeSchema,
|
|
10054
|
+
identity: IdentitySchema,
|
|
10055
|
+
supportedSurfaces: z9.array(ProductSurfaceSchema).min(1),
|
|
10056
|
+
placements: z9.array(ContractIdentifierSchema).min(1),
|
|
10057
|
+
lifecycle: DeclarativeLifecycleSchema,
|
|
10058
|
+
nodes: z9.array(NavigationNodeSchema),
|
|
10059
|
+
managementAccess: ManagementAccessSchema,
|
|
10060
|
+
performanceBudgetRef: RevisionRefSchema,
|
|
10061
|
+
observationPolicyRevisionRef: RevisionRefSchema
|
|
10062
|
+
}).strict().superRefine((value, context) => {
|
|
10063
|
+
validateNavigationTree(value.nodes, context);
|
|
10064
|
+
value.nodes.forEach((node, index) => {
|
|
10065
|
+
if (node.kind === "target" && !["page", "workbench", "menu-action", "domain-command"].includes(node.targetRef.kind)) {
|
|
10066
|
+
context.addIssue({ code: "custom", path: ["nodes", index, "targetRef", "kind"], message: "Navigation targets must reference Page, Workbench, registered Menu Action, or DomainCommand identities." });
|
|
10067
|
+
}
|
|
10068
|
+
});
|
|
10069
|
+
});
|
|
10070
|
+
var ResolvedNavigationTargetSchema = z9.object({
|
|
10071
|
+
nodeId: ContractIdentifierSchema,
|
|
10072
|
+
stableTargetRef: StableRefSchema,
|
|
10073
|
+
targetRevisionRef: RevisionRefSchema,
|
|
10074
|
+
releaseRevisionRef: RevisionRefSchema.optional()
|
|
10075
|
+
}).strict();
|
|
10076
|
+
var NavigationReleaseSchema = z9.object({
|
|
10077
|
+
contract: z9.literal("NavigationRelease"),
|
|
10078
|
+
...ReleaseBaseShape,
|
|
10079
|
+
navigationRevisionRef: RevisionRefSchema,
|
|
10080
|
+
target: z9.object({
|
|
10081
|
+
environmentRef: StableRefSchema,
|
|
10082
|
+
surface: ProductSurfaceSchema,
|
|
10083
|
+
placement: ContractIdentifierSchema
|
|
10084
|
+
}).strict(),
|
|
10085
|
+
resolvedTargets: z9.array(ResolvedNavigationTargetSchema)
|
|
10086
|
+
}).strict().superRefine((value, context) => {
|
|
10087
|
+
validateDependencySnapshot(value.dependencySnapshot, context);
|
|
10088
|
+
validateReleaseExpectedHead(value, "navigation-release", context);
|
|
10089
|
+
if (value.navigationRevisionRef.kind !== "navigation") context.addIssue({ code: "custom", path: ["navigationRevisionRef", "kind"], message: "Expected a navigation revision." });
|
|
10090
|
+
if (value.target.environmentRef.kind !== "environment") context.addIssue({ code: "custom", path: ["target", "environmentRef", "kind"], message: "Navigation release target requires an environment reference." });
|
|
10091
|
+
if (uniqueArray(value.resolvedTargets, (target) => target.nodeId)) context.addIssue({ code: "custom", path: ["resolvedTargets"], message: "Resolved Navigation node IDs must be unique." });
|
|
10092
|
+
});
|
|
10093
|
+
var RuntimeDiagnosticSchema = z9.object({
|
|
10094
|
+
code: ContractIdentifierSchema,
|
|
10095
|
+
severity: z9.enum(["info", "warning", "error"]),
|
|
10096
|
+
path: z9.string().trim().min(1),
|
|
10097
|
+
message: z9.string().trim().min(1)
|
|
10098
|
+
}).strict();
|
|
10099
|
+
var RuntimeBundleBaseShape = {
|
|
10100
|
+
schemaVersion: z9.literal(DECLARATIVE_CONTROL_SCHEMA_VERSION),
|
|
10101
|
+
tenantScope: TenantScopeSchema,
|
|
10102
|
+
releaseRevisionRef: RevisionRefSchema,
|
|
10103
|
+
compilerRevisionRef: RevisionRefSchema,
|
|
10104
|
+
generation: z9.number().int().nonnegative(),
|
|
10105
|
+
dependencySnapshot: z9.array(ReleaseDependencySchema),
|
|
10106
|
+
contentHash: Sha256Schema,
|
|
10107
|
+
rebuildable: z9.literal(true),
|
|
10108
|
+
diagnostics: z9.array(RuntimeDiagnosticSchema)
|
|
10109
|
+
};
|
|
10110
|
+
var PageRuntimeBundleSchema = z9.object({
|
|
10111
|
+
contract: z9.literal("PageRuntimeBundle"),
|
|
10112
|
+
...RuntimeBundleBaseShape,
|
|
10113
|
+
pageId: ContractIdentifierSchema,
|
|
10114
|
+
pageRevisionRef: RevisionRefSchema,
|
|
10115
|
+
surface: ProductSurfaceSchema,
|
|
10116
|
+
routeClaims: z9.array(CompiledRouteClaimSchema),
|
|
10117
|
+
shellRevisionRef: RevisionRefSchema,
|
|
10118
|
+
renderTree: RenderTreeSchema,
|
|
10119
|
+
capabilityInstances: z9.array(CapabilityInstanceSchema),
|
|
10120
|
+
ontologyBindings: z9.array(OntologyBindingSchema),
|
|
10121
|
+
actionBindings: z9.array(ActionBindingSchema),
|
|
10122
|
+
pageAccessPolicy: AccessPolicySchema,
|
|
10123
|
+
tokenRevisionRefs: z9.array(RevisionRefSchema),
|
|
10124
|
+
performanceBudgetRef: RevisionRefSchema,
|
|
10125
|
+
observationPolicyRevisionRef: RevisionRefSchema,
|
|
10126
|
+
privacyClassification: z9.enum(["public", "internal", "confidential", "restricted"])
|
|
10127
|
+
}).strict();
|
|
10128
|
+
var ResolvedWorkbenchAppInstanceSchema = WorkbenchAppInstanceSchema.extend({
|
|
10129
|
+
targetAccessPolicy: AccessPolicySchema
|
|
10130
|
+
}).strict();
|
|
10131
|
+
var WorkbenchRuntimeTargetSchema = WorkbenchReleaseSchema.shape.target.safeExtend({
|
|
10132
|
+
routeClaim: CompiledRouteClaimSchema
|
|
10133
|
+
}).strict();
|
|
10134
|
+
var WorkbenchRuntimeBundleSchema = z9.object({
|
|
10135
|
+
contract: z9.literal("WorkbenchRuntimeBundle"),
|
|
10136
|
+
...RuntimeBundleBaseShape,
|
|
10137
|
+
workbenchId: ContractIdentifierSchema,
|
|
10138
|
+
workbenchRevisionRef: RevisionRefSchema,
|
|
10139
|
+
surface: ProductSurfaceSchema,
|
|
10140
|
+
routeClaims: z9.array(CompiledRouteClaimSchema),
|
|
10141
|
+
groups: z9.array(WorkbenchGroupSchema),
|
|
10142
|
+
appInstances: z9.array(ResolvedWorkbenchAppInstanceSchema),
|
|
10143
|
+
defaultEntry: WorkbenchSchema.shape.defaultEntry,
|
|
10144
|
+
layout: WorkbenchSchema.shape.layout,
|
|
10145
|
+
workbenchAccessPolicy: AccessPolicySchema,
|
|
10146
|
+
personalPreferencesPolicy: WorkbenchSchema.shape.personalPreferencesPolicy,
|
|
10147
|
+
target: WorkbenchRuntimeTargetSchema,
|
|
10148
|
+
performanceBudgetRef: RevisionRefSchema,
|
|
10149
|
+
observationPolicyRevisionRef: RevisionRefSchema,
|
|
10150
|
+
privacyClassification: z9.enum(["public", "internal", "confidential", "restricted"])
|
|
10151
|
+
}).strict();
|
|
10152
|
+
var CompiledNavigationTargetSchema = ResolvedNavigationTargetSchema.extend({
|
|
10153
|
+
kind: z9.literal("route"),
|
|
10154
|
+
accessPolicy: AccessPolicySchema,
|
|
10155
|
+
routeClaim: CompiledRouteClaimSchema
|
|
10156
|
+
}).strict();
|
|
10157
|
+
var CompiledNavigationRegisteredMenuActionTargetSchema = ResolvedNavigationTargetSchema.extend({
|
|
10158
|
+
kind: z9.literal("registered-menu-action"),
|
|
10159
|
+
accessPolicy: AccessPolicySchema,
|
|
10160
|
+
execution: z9.literal("client"),
|
|
10161
|
+
applicationId: ContractIdentifierSchema,
|
|
10162
|
+
actionRef: ContractIdentifierSchema,
|
|
10163
|
+
inputSchemaRef: ContractIdentifierSchema.optional(),
|
|
10164
|
+
input: JsonObjectSchema,
|
|
10165
|
+
sourceCatalogRevisionRef: RevisionRefSchema
|
|
10166
|
+
}).strict();
|
|
10167
|
+
var CompiledNavigationDomainCommandTargetSchema = ResolvedNavigationTargetSchema.extend({
|
|
10168
|
+
kind: z9.literal("governed-domain-command"),
|
|
10169
|
+
accessPolicy: AccessPolicySchema,
|
|
10170
|
+
execution: z9.literal("server"),
|
|
10171
|
+
commandRevisionRef: RevisionRefSchema,
|
|
10172
|
+
inputSchemaRevisionRef: RevisionRefSchema,
|
|
10173
|
+
resultSchemaRevisionRef: RevisionRefSchema.optional(),
|
|
10174
|
+
input: JsonObjectSchema
|
|
10175
|
+
}).strict();
|
|
10176
|
+
var CompiledNavigationResolvedTargetSchema = z9.discriminatedUnion("kind", [
|
|
10177
|
+
CompiledNavigationTargetSchema,
|
|
10178
|
+
CompiledNavigationRegisteredMenuActionTargetSchema,
|
|
10179
|
+
CompiledNavigationDomainCommandTargetSchema
|
|
10180
|
+
]);
|
|
10181
|
+
var CompiledNavigationGroupNodeSchema = NavigationGroupNodeSchema.extend({
|
|
10182
|
+
ancestorAccessPolicies: z9.array(AccessPolicySchema)
|
|
10183
|
+
}).strict();
|
|
10184
|
+
var CompiledNavigationTargetNodeSchema = NavigationTargetNodeSchema.extend({
|
|
10185
|
+
ancestorAccessPolicies: z9.array(AccessPolicySchema),
|
|
10186
|
+
resolvedTarget: CompiledNavigationResolvedTargetSchema
|
|
10187
|
+
}).strict();
|
|
10188
|
+
var CompiledNavigationSeparatorNodeSchema = NavigationSeparatorNodeSchema.extend({
|
|
10189
|
+
ancestorAccessPolicies: z9.array(AccessPolicySchema)
|
|
10190
|
+
}).strict();
|
|
10191
|
+
var CompiledNavigationNodeSchema = z9.discriminatedUnion("kind", [
|
|
10192
|
+
CompiledNavigationGroupNodeSchema,
|
|
10193
|
+
CompiledNavigationTargetNodeSchema,
|
|
10194
|
+
CompiledNavigationSeparatorNodeSchema
|
|
10195
|
+
]);
|
|
10196
|
+
var NavigationRuntimeBundleSchema = z9.object({
|
|
10197
|
+
contract: z9.literal("NavigationRuntimeBundle"),
|
|
10198
|
+
...RuntimeBundleBaseShape,
|
|
10199
|
+
navigationId: ContractIdentifierSchema,
|
|
10200
|
+
navigationRevisionRef: RevisionRefSchema,
|
|
10201
|
+
surface: ProductSurfaceSchema,
|
|
10202
|
+
placement: ContractIdentifierSchema,
|
|
10203
|
+
nodes: z9.array(CompiledNavigationNodeSchema),
|
|
10204
|
+
performanceBudgetRef: RevisionRefSchema,
|
|
10205
|
+
observationPolicyRevisionRef: RevisionRefSchema
|
|
10206
|
+
}).strict();
|
|
10207
|
+
var DeclarativeControlOntologyDefinitionSchema = OntologyDefinitionSchema.extend({
|
|
10208
|
+
classification: z9.literal("control"),
|
|
10209
|
+
discovery: z9.object({
|
|
10210
|
+
ordinaryDataBrowser: z9.literal(false),
|
|
10211
|
+
businessSearch: z9.literal(false),
|
|
10212
|
+
businessStatistics: z9.literal(false),
|
|
10213
|
+
ordinaryExport: z9.literal(false),
|
|
10214
|
+
genericWrite: z9.literal(false)
|
|
10215
|
+
}).strict()
|
|
10216
|
+
}).strict();
|
|
10217
|
+
var controlDefinition = (ontologyId, bodySchemaRef) => DeclarativeControlOntologyDefinitionSchema.parse({
|
|
10218
|
+
contract: "OntologyDefinition",
|
|
10219
|
+
ontologyId,
|
|
10220
|
+
dataSpaceId: "monkeys.control",
|
|
10221
|
+
ownerRepo: "monkeys-js-sdk",
|
|
10222
|
+
bodySchemaRef,
|
|
10223
|
+
authority: { service: "monkeys-data-server", storage: "domain-record", scope: "tenant" },
|
|
10224
|
+
relationKinds: [],
|
|
10225
|
+
metricKinds: [],
|
|
10226
|
+
classification: "control",
|
|
10227
|
+
discovery: {
|
|
10228
|
+
ordinaryDataBrowser: false,
|
|
10229
|
+
businessSearch: false,
|
|
10230
|
+
businessStatistics: false,
|
|
10231
|
+
ordinaryExport: false,
|
|
10232
|
+
genericWrite: false
|
|
10233
|
+
}
|
|
10234
|
+
});
|
|
10235
|
+
var DECLARATIVE_CONTROL_ONTOLOGY_DEFINITIONS = Object.freeze([
|
|
10236
|
+
controlDefinition("monkeys.system.page", "monkeys.system.page/v1"),
|
|
10237
|
+
controlDefinition("monkeys.system.page-release", "monkeys.system.page-release/v1"),
|
|
10238
|
+
controlDefinition("monkeys.system.workbench", "monkeys.system.workbench/v1"),
|
|
10239
|
+
controlDefinition("monkeys.system.workbench-release", "monkeys.system.workbench-release/v1"),
|
|
10240
|
+
controlDefinition("monkeys.system.navigation", "monkeys.system.navigation/v1"),
|
|
10241
|
+
controlDefinition("monkeys.system.navigation-release", "monkeys.system.navigation-release/v1")
|
|
10242
|
+
]);
|
|
10243
|
+
|
|
9309
10244
|
// src/contracts/semantic.ts
|
|
9310
|
-
var
|
|
10245
|
+
var ExactRefKindSchema = (kind) => RevisionRefSchema.superRefine((value, context) => {
|
|
10246
|
+
if (value.kind !== kind) context.addIssue({ code: "custom", path: ["kind"], message: `Reference must use kind ${kind}.` });
|
|
10247
|
+
});
|
|
10248
|
+
var SchemaDefinitionSchema = z10.object({
|
|
10249
|
+
contract: z10.literal("Schema"),
|
|
10250
|
+
schemaVersion: z10.literal(1),
|
|
10251
|
+
schemaId: ContractIdentifierSchema,
|
|
10252
|
+
ownerRepo: ContractIdentifierSchema,
|
|
10253
|
+
dialect: z10.literal("https://json-schema.org/draft/2020-12/schema"),
|
|
10254
|
+
document: JsonObjectSchema
|
|
10255
|
+
}).strict();
|
|
10256
|
+
var OntologyViewDefinitionSchema = z10.object({
|
|
10257
|
+
contract: z10.literal("View"),
|
|
10258
|
+
schemaVersion: z10.literal(1),
|
|
10259
|
+
viewId: ContractIdentifierSchema,
|
|
10260
|
+
ownerRepo: ContractIdentifierSchema,
|
|
10261
|
+
ontologyDefinitionRevisionRef: ExactRefKindSchema("ontology-definition"),
|
|
10262
|
+
renderModelSchemaRevisionRef: ExactRefKindSchema("schema"),
|
|
10263
|
+
requiredPermissionCodes: z10.array(ContractIdentifierSchema).default([])
|
|
10264
|
+
}).strict();
|
|
10265
|
+
var ConceptRelationshipSchema = z10.object({
|
|
9311
10266
|
kind: ContractIdentifierSchema,
|
|
9312
10267
|
targetConceptId: ContractIdentifierSchema,
|
|
9313
|
-
cardinality:
|
|
10268
|
+
cardinality: z10.enum(["one", "optional", "many"])
|
|
9314
10269
|
}).strict();
|
|
9315
|
-
var ConceptDefinitionSchema =
|
|
9316
|
-
contract:
|
|
10270
|
+
var ConceptDefinitionSchema = z10.object({
|
|
10271
|
+
contract: z10.literal("ConceptDefinition"),
|
|
9317
10272
|
conceptId: ContractIdentifierSchema,
|
|
9318
10273
|
ownerRepo: ContractIdentifierSchema,
|
|
9319
|
-
displayName:
|
|
9320
|
-
description:
|
|
10274
|
+
displayName: z10.string().trim().min(1),
|
|
10275
|
+
description: z10.string().optional(),
|
|
9321
10276
|
schemaRef: ContractIdentifierSchema,
|
|
9322
10277
|
ontologyId: ContractIdentifierSchema.optional(),
|
|
9323
|
-
capabilityIds:
|
|
9324
|
-
commandNames:
|
|
9325
|
-
relationships:
|
|
10278
|
+
capabilityIds: z10.array(ContractIdentifierSchema).default([]),
|
|
10279
|
+
commandNames: z10.array(ContractIdentifierSchema).default([]),
|
|
10280
|
+
relationships: z10.array(ConceptRelationshipSchema).default([])
|
|
9326
10281
|
}).strict();
|
|
9327
|
-
var DomainCommandDefinitionSchema =
|
|
9328
|
-
contract:
|
|
10282
|
+
var DomainCommandDefinitionSchema = z10.object({
|
|
10283
|
+
contract: z10.literal("DomainCommandDefinition"),
|
|
9329
10284
|
commandName: ContractIdentifierSchema,
|
|
9330
10285
|
ownerRepo: ContractIdentifierSchema,
|
|
9331
|
-
displayName:
|
|
9332
|
-
description:
|
|
9333
|
-
targetKinds:
|
|
10286
|
+
displayName: z10.string().trim().min(1),
|
|
10287
|
+
description: z10.string().optional(),
|
|
10288
|
+
targetKinds: z10.array(ContractIdentifierSchema).min(1),
|
|
9334
10289
|
inputSchemaRef: ContractIdentifierSchema,
|
|
9335
10290
|
outputSchemaRef: ContractIdentifierSchema.optional(),
|
|
9336
|
-
requiredPermissionCodes:
|
|
10291
|
+
requiredPermissionCodes: z10.array(ContractIdentifierSchema).default([]),
|
|
9337
10292
|
handlerRef: EntityRefSchema,
|
|
9338
|
-
sideEffects:
|
|
10293
|
+
sideEffects: z10.array(z10.enum(["data-write", "execution", "navigation", "notification", "external-call"])).default([])
|
|
9339
10294
|
}).strict();
|
|
9340
|
-
var DomainCommandSchema =
|
|
9341
|
-
contract:
|
|
10295
|
+
var DomainCommandSchema = z10.object({
|
|
10296
|
+
contract: z10.literal("DomainCommand"),
|
|
9342
10297
|
commandId: ContractIdentifierSchema,
|
|
9343
10298
|
commandName: ContractIdentifierSchema,
|
|
9344
10299
|
requestId: ContractIdentifierSchema,
|
|
@@ -9346,30 +10301,30 @@ var DomainCommandSchema = z9.object({
|
|
|
9346
10301
|
idempotencyKey: ContractIdentifierSchema,
|
|
9347
10302
|
targetRef: EntityRefSchema,
|
|
9348
10303
|
actorRef: EntityRefSchema,
|
|
9349
|
-
source:
|
|
9350
|
-
product:
|
|
10304
|
+
source: z10.object({
|
|
10305
|
+
product: z10.enum(["studio", "kernel", "agent", "mcp", "service"]),
|
|
9351
10306
|
pageId: ContractIdentifierSchema.optional(),
|
|
9352
10307
|
capabilityId: ContractIdentifierSchema.optional()
|
|
9353
10308
|
}).strict(),
|
|
9354
10309
|
payload: JsonObjectSchema,
|
|
9355
10310
|
issuedAt: IsoDateTimeSchema
|
|
9356
10311
|
}).strict();
|
|
9357
|
-
var ProductDeclarationSchema =
|
|
9358
|
-
contract:
|
|
10312
|
+
var ProductDeclarationSchema = z10.object({
|
|
10313
|
+
contract: z10.literal("ProductDeclaration"),
|
|
9359
10314
|
declarationId: ContractIdentifierSchema,
|
|
9360
10315
|
ownerRepo: ContractIdentifierSchema,
|
|
9361
|
-
concepts:
|
|
9362
|
-
ontologies:
|
|
9363
|
-
projections:
|
|
9364
|
-
commands:
|
|
9365
|
-
capabilities:
|
|
9366
|
-
pages:
|
|
9367
|
-
menus:
|
|
9368
|
-
}).strict();
|
|
9369
|
-
var DeclarationGraphEdgeSchema =
|
|
10316
|
+
concepts: z10.array(ConceptDefinitionSchema).default([]),
|
|
10317
|
+
ontologies: z10.array(OntologyDefinitionSchema).default([]),
|
|
10318
|
+
projections: z10.array(ProjectionSpecSchema).default([]),
|
|
10319
|
+
commands: z10.array(DomainCommandDefinitionSchema).default([]),
|
|
10320
|
+
capabilities: z10.array(CapabilityManifestSchema).default([]),
|
|
10321
|
+
pages: z10.array(PageDefinitionSchema).default([]),
|
|
10322
|
+
menus: z10.array(MenuDefinitionSchema).default([])
|
|
10323
|
+
}).strict();
|
|
10324
|
+
var DeclarationGraphEdgeSchema = z10.object({
|
|
9370
10325
|
from: EntityRefSchema,
|
|
9371
10326
|
to: EntityRefSchema,
|
|
9372
|
-
relation:
|
|
10327
|
+
relation: z10.enum([
|
|
9373
10328
|
"uses-ontology",
|
|
9374
10329
|
"uses-projection",
|
|
9375
10330
|
"uses-capability",
|
|
@@ -9377,17 +10332,17 @@ var DeclarationGraphEdgeSchema = z9.object({
|
|
|
9377
10332
|
"relates-to-concept"
|
|
9378
10333
|
])
|
|
9379
10334
|
}).strict();
|
|
9380
|
-
var ChangeImpactSchema =
|
|
10335
|
+
var ChangeImpactSchema = z10.object({
|
|
9381
10336
|
changedRef: EntityRefSchema,
|
|
9382
|
-
affectedRefs:
|
|
9383
|
-
reasons:
|
|
10337
|
+
affectedRefs: z10.array(EntityRefSchema),
|
|
10338
|
+
reasons: z10.array(ContractIdentifierSchema).min(1)
|
|
9384
10339
|
}).strict();
|
|
9385
|
-
var ChangeImpactGraphSchema =
|
|
9386
|
-
contract:
|
|
10340
|
+
var ChangeImpactGraphSchema = z10.object({
|
|
10341
|
+
contract: z10.literal("ChangeImpactGraph"),
|
|
9387
10342
|
declarationId: ContractIdentifierSchema,
|
|
9388
|
-
nodes:
|
|
9389
|
-
edges:
|
|
9390
|
-
impacts:
|
|
10343
|
+
nodes: z10.array(EntityRefSchema),
|
|
10344
|
+
edges: z10.array(DeclarationGraphEdgeSchema),
|
|
10345
|
+
impacts: z10.array(ChangeImpactSchema),
|
|
9391
10346
|
generatedAt: IsoDateTimeSchema
|
|
9392
10347
|
}).strict();
|
|
9393
10348
|
|
|
@@ -9560,118 +10515,1036 @@ var compileProductDeclaration = (input) => {
|
|
|
9560
10515
|
if (!capabilitiesById.has(capabilityId)) throw new Error(`Concept ${concept.conceptId} references unknown capability ${capabilityId}.`);
|
|
9561
10516
|
addEdge(ref("concept", concept.conceptId), ref("capability", capabilityId), "uses-capability");
|
|
9562
10517
|
}
|
|
9563
|
-
for (const commandName of concept.commandNames) {
|
|
9564
|
-
if (!commandsByName.has(commandName)) throw new Error(`Concept ${concept.conceptId} references unknown command ${commandName}.`);
|
|
9565
|
-
addEdge(ref("concept", concept.conceptId), ref("command", commandName), "uses-command");
|
|
10518
|
+
for (const commandName of concept.commandNames) {
|
|
10519
|
+
if (!commandsByName.has(commandName)) throw new Error(`Concept ${concept.conceptId} references unknown command ${commandName}.`);
|
|
10520
|
+
addEdge(ref("concept", concept.conceptId), ref("command", commandName), "uses-command");
|
|
10521
|
+
}
|
|
10522
|
+
for (const relationship of concept.relationships) {
|
|
10523
|
+
if (!conceptsById.has(relationship.targetConceptId)) {
|
|
10524
|
+
throw new Error(`Concept ${concept.conceptId} references unknown concept ${relationship.targetConceptId}.`);
|
|
10525
|
+
}
|
|
10526
|
+
addEdge(ref("concept", concept.conceptId), ref("concept", relationship.targetConceptId), "relates-to-concept");
|
|
10527
|
+
}
|
|
10528
|
+
}
|
|
10529
|
+
for (const page of declaration.pages) {
|
|
10530
|
+
addNode("page", page.pageId);
|
|
10531
|
+
if (page.binding.ontologyId) {
|
|
10532
|
+
if (!ontologiesById.has(page.binding.ontologyId)) throw new Error(`Page ${page.pageId} references unknown ontology ${page.binding.ontologyId}.`);
|
|
10533
|
+
addEdge(ref("page", page.pageId), ref("ontology", page.binding.ontologyId), "uses-ontology");
|
|
10534
|
+
}
|
|
10535
|
+
if (page.binding.projectionRef) {
|
|
10536
|
+
if (!projectionsById.has(page.binding.projectionRef)) throw new Error(`Page ${page.pageId} references unknown projection ${page.binding.projectionRef}.`);
|
|
10537
|
+
addEdge(ref("page", page.pageId), ref("projection", page.binding.projectionRef), "uses-projection");
|
|
10538
|
+
}
|
|
10539
|
+
for (const capabilityRef of [page.capabilityRef, ...page.capabilityRefs].filter(Boolean)) {
|
|
10540
|
+
if (!capabilitiesById.has(capabilityRef.id)) throw new Error(`Page ${page.pageId} references unknown capability ${capabilityRef.id}.`);
|
|
10541
|
+
addEdge(ref("page", page.pageId), ref("capability", capabilityRef.id), "uses-capability");
|
|
10542
|
+
}
|
|
10543
|
+
}
|
|
10544
|
+
uniqueIndex(nodes, refKey, "declaration node");
|
|
10545
|
+
return Object.freeze({
|
|
10546
|
+
declaration: Object.freeze(declaration),
|
|
10547
|
+
conceptsById,
|
|
10548
|
+
ontologiesById,
|
|
10549
|
+
projectionsById,
|
|
10550
|
+
commandsByName,
|
|
10551
|
+
capabilitiesById,
|
|
10552
|
+
pagesById,
|
|
10553
|
+
menusByKey,
|
|
10554
|
+
nodes: Object.freeze(nodes),
|
|
10555
|
+
edges: Object.freeze(edges)
|
|
10556
|
+
});
|
|
10557
|
+
};
|
|
10558
|
+
var validateDomainCommand = (input, definitions, permissionCodes) => {
|
|
10559
|
+
const command = DomainCommandSchema.parse(input);
|
|
10560
|
+
const commandsByName = uniqueIndex(
|
|
10561
|
+
definitions.map((definition2) => DomainCommandDefinitionSchema.parse(definition2)),
|
|
10562
|
+
(definition2) => definition2.commandName,
|
|
10563
|
+
"command name"
|
|
10564
|
+
);
|
|
10565
|
+
const definition = commandsByName.get(command.commandName);
|
|
10566
|
+
if (!definition) throw new Error(`Unknown domain command: ${command.commandName}`);
|
|
10567
|
+
if (!definition.targetKinds.includes(command.targetRef.kind)) {
|
|
10568
|
+
throw new Error(`Command ${command.commandName} does not accept target kind ${command.targetRef.kind}.`);
|
|
10569
|
+
}
|
|
10570
|
+
const granted = new Set(permissionCodes);
|
|
10571
|
+
const missing = definition.requiredPermissionCodes.filter((permission) => !granted.has(permission));
|
|
10572
|
+
if (missing.length) throw new Error(`Command ${command.commandName} requires permissions: ${missing.join(", ")}`);
|
|
10573
|
+
return Object.freeze(command);
|
|
10574
|
+
};
|
|
10575
|
+
var declarationValuesByRef = (compiled) => {
|
|
10576
|
+
const values = /* @__PURE__ */ new Map();
|
|
10577
|
+
for (const value of compiled.declaration.ontologies) values.set(refKey(ref("ontology", value.ontologyId)), value);
|
|
10578
|
+
for (const value of compiled.declaration.projections) values.set(refKey(ref("projection", value.projectionId)), value);
|
|
10579
|
+
for (const value of compiled.declaration.commands) values.set(refKey(ref("command", value.commandName)), value);
|
|
10580
|
+
for (const value of compiled.declaration.capabilities) values.set(refKey(ref("capability", value.id)), value);
|
|
10581
|
+
for (const value of compiled.declaration.concepts) values.set(refKey(ref("concept", value.conceptId)), value);
|
|
10582
|
+
for (const value of compiled.declaration.pages) values.set(refKey(ref("page", value.pageId)), value);
|
|
10583
|
+
return values;
|
|
10584
|
+
};
|
|
10585
|
+
var buildChangeImpactGraph = (previousInput, nextInput, generatedAt = (/* @__PURE__ */ new Date()).toISOString()) => {
|
|
10586
|
+
const previous = compileProductDeclaration(previousInput);
|
|
10587
|
+
const next = compileProductDeclaration(nextInput);
|
|
10588
|
+
const previousValues = declarationValuesByRef(previous);
|
|
10589
|
+
const nextValues = declarationValuesByRef(next);
|
|
10590
|
+
const changedKeys = /* @__PURE__ */ new Set();
|
|
10591
|
+
for (const key of /* @__PURE__ */ new Set([...previousValues.keys(), ...nextValues.keys()])) {
|
|
10592
|
+
if (JSON.stringify(previousValues.get(key)) !== JSON.stringify(nextValues.get(key))) changedKeys.add(key);
|
|
10593
|
+
}
|
|
10594
|
+
const reverse = /* @__PURE__ */ new Map();
|
|
10595
|
+
for (const edge of [...previous.edges, ...next.edges]) {
|
|
10596
|
+
const dependency = refKey(edge.to);
|
|
10597
|
+
const dependent = refKey(edge.from);
|
|
10598
|
+
const values = reverse.get(dependency) ?? /* @__PURE__ */ new Set();
|
|
10599
|
+
values.add(dependent);
|
|
10600
|
+
reverse.set(dependency, values);
|
|
10601
|
+
}
|
|
10602
|
+
const refs = /* @__PURE__ */ new Map();
|
|
10603
|
+
for (const node of [...previous.nodes, ...next.nodes]) refs.set(refKey(node), node);
|
|
10604
|
+
const impacts = Array.from(changedKeys).sort().map((changedKey) => {
|
|
10605
|
+
const affected = /* @__PURE__ */ new Set();
|
|
10606
|
+
const queue = [...reverse.get(changedKey) ?? []];
|
|
10607
|
+
while (queue.length) {
|
|
10608
|
+
const current = queue.shift();
|
|
10609
|
+
if (affected.has(current)) continue;
|
|
10610
|
+
affected.add(current);
|
|
10611
|
+
queue.push(...reverse.get(current) ?? []);
|
|
10612
|
+
}
|
|
10613
|
+
return {
|
|
10614
|
+
changedRef: refs.get(changedKey) ?? (() => {
|
|
10615
|
+
const separator = changedKey.indexOf(":");
|
|
10616
|
+
return ref(changedKey.slice(0, separator), changedKey.slice(separator + 1));
|
|
10617
|
+
})(),
|
|
10618
|
+
affectedRefs: Array.from(affected).sort().map((key) => refs.get(key)),
|
|
10619
|
+
reasons: affected.size ? ["dependency"] : ["direct-change"]
|
|
10620
|
+
};
|
|
10621
|
+
});
|
|
10622
|
+
return ChangeImpactGraphSchema.parse({
|
|
10623
|
+
contract: "ChangeImpactGraph",
|
|
10624
|
+
declarationId: next.declaration.declarationId,
|
|
10625
|
+
nodes: Array.from(refs.values()).sort((left, right) => refKey(left).localeCompare(refKey(right))),
|
|
10626
|
+
edges: next.edges,
|
|
10627
|
+
impacts,
|
|
10628
|
+
generatedAt
|
|
10629
|
+
});
|
|
10630
|
+
};
|
|
10631
|
+
|
|
10632
|
+
// src/runtime/render-tree-compiler.ts
|
|
10633
|
+
var compileRenderTree = (input) => {
|
|
10634
|
+
const tree = RenderTreeSchema.parse(input);
|
|
10635
|
+
const nodesById = /* @__PURE__ */ new Map();
|
|
10636
|
+
for (const node of tree.nodes) {
|
|
10637
|
+
if (nodesById.has(node.nodeId)) throw new Error(`Duplicate render node id: ${node.nodeId}`);
|
|
10638
|
+
nodesById.set(node.nodeId, node);
|
|
10639
|
+
}
|
|
10640
|
+
const root = nodesById.get(tree.rootNodeId);
|
|
10641
|
+
if (!root) throw new Error(`Render tree ${tree.treeId} has no root node ${tree.rootNodeId}.`);
|
|
10642
|
+
if (root.parentNodeId !== void 0) throw new Error(`Render tree root ${root.nodeId} cannot declare a parent.`);
|
|
10643
|
+
for (const node of tree.nodes) {
|
|
10644
|
+
if (node.nodeId !== root.nodeId && node.parentNodeId === void 0) {
|
|
10645
|
+
throw new Error(`Render node ${node.nodeId} is disconnected from root ${root.nodeId}.`);
|
|
10646
|
+
}
|
|
10647
|
+
if (node.parentNodeId !== void 0) {
|
|
10648
|
+
const parent = nodesById.get(node.parentNodeId);
|
|
10649
|
+
if (!parent) throw new Error(`Render node ${node.nodeId} references missing parent ${node.parentNodeId}.`);
|
|
10650
|
+
if (!parent.children.includes(node.nodeId)) {
|
|
10651
|
+
throw new Error(`Render node ${node.nodeId} is not declared by parent ${parent.nodeId}.`);
|
|
10652
|
+
}
|
|
10653
|
+
}
|
|
10654
|
+
for (const childId of node.children) {
|
|
10655
|
+
const child = nodesById.get(childId);
|
|
10656
|
+
if (!child) throw new Error(`Render node ${node.nodeId} references missing child ${childId}.`);
|
|
10657
|
+
if (child.parentNodeId !== node.nodeId) {
|
|
10658
|
+
throw new Error(`Render child ${childId} does not point back to parent ${node.nodeId}.`);
|
|
10659
|
+
}
|
|
10660
|
+
}
|
|
10661
|
+
}
|
|
10662
|
+
const visiting = /* @__PURE__ */ new Set();
|
|
10663
|
+
const visited = /* @__PURE__ */ new Set();
|
|
10664
|
+
const traversal = [];
|
|
10665
|
+
const visit = (node) => {
|
|
10666
|
+
if (visiting.has(node.nodeId)) throw new Error(`Render tree ${tree.treeId} contains a cycle at ${node.nodeId}.`);
|
|
10667
|
+
if (visited.has(node.nodeId)) return;
|
|
10668
|
+
visiting.add(node.nodeId);
|
|
10669
|
+
traversal.push(node);
|
|
10670
|
+
node.children.forEach((childId) => visit(nodesById.get(childId)));
|
|
10671
|
+
visiting.delete(node.nodeId);
|
|
10672
|
+
visited.add(node.nodeId);
|
|
10673
|
+
};
|
|
10674
|
+
visit(root);
|
|
10675
|
+
if (visited.size !== nodesById.size) {
|
|
10676
|
+
const disconnected = tree.nodes.find((node) => !visited.has(node.nodeId));
|
|
10677
|
+
throw new Error(`Render node ${disconnected.nodeId} is not reachable from root ${root.nodeId}.`);
|
|
10678
|
+
}
|
|
10679
|
+
const childrenOf = (nodeId) => {
|
|
10680
|
+
const node = nodesById.get(nodeId);
|
|
10681
|
+
if (!node) throw new Error(`Unknown render node: ${nodeId}`);
|
|
10682
|
+
return Object.freeze(node.children.map((childId) => nodesById.get(childId)));
|
|
10683
|
+
};
|
|
10684
|
+
const ancestorsOf = (nodeId) => {
|
|
10685
|
+
let node = nodesById.get(nodeId);
|
|
10686
|
+
if (!node) throw new Error(`Unknown render node: ${nodeId}`);
|
|
10687
|
+
const ancestors = [];
|
|
10688
|
+
while (node.parentNodeId !== void 0) {
|
|
10689
|
+
node = nodesById.get(node.parentNodeId);
|
|
10690
|
+
ancestors.push(node);
|
|
10691
|
+
}
|
|
10692
|
+
return Object.freeze(ancestors);
|
|
10693
|
+
};
|
|
10694
|
+
return Object.freeze({
|
|
10695
|
+
tree,
|
|
10696
|
+
root,
|
|
10697
|
+
nodesById,
|
|
10698
|
+
traversal: Object.freeze(traversal),
|
|
10699
|
+
childrenOf,
|
|
10700
|
+
ancestorsOf
|
|
10701
|
+
});
|
|
10702
|
+
};
|
|
10703
|
+
|
|
10704
|
+
// src/runtime/declarative-control-compiler.ts
|
|
10705
|
+
var DeclarativeControlCompilationError = class extends Error {
|
|
10706
|
+
constructor(code, path, message) {
|
|
10707
|
+
super(`${code} at ${path}: ${message}`);
|
|
10708
|
+
this.code = code;
|
|
10709
|
+
this.path = path;
|
|
10710
|
+
this.name = "DeclarativeControlCompilationError";
|
|
10711
|
+
}
|
|
10712
|
+
};
|
|
10713
|
+
var scopedIdentityKey2 = (reference) => `${reference.kind}:${reference.id}:${reference.ownerRepo}`;
|
|
10714
|
+
var scopeKey = (scope) => `${scopedIdentityKey2(scope.tenantRef)}:${scopedIdentityKey2(scope.dataSpaceRef)}:${scope.teamRef ? scopedIdentityKey2(scope.teamRef) : ""}`;
|
|
10715
|
+
var stableRefKey = (reference) => `${reference.visibility}:${reference.tenantScope ? scopeKey(reference.tenantScope) : ""}:${reference.kind}:${reference.id}:${reference.ownerRepo}`;
|
|
10716
|
+
var revisionRefKey = (reference) => `${stableRefKey(reference)}@${reference.revision}:v${reference.schemaVersion}:${reference.contentHash.toLowerCase()}`;
|
|
10717
|
+
var sameStableRef = (left, right) => stableRefKey(left) === stableRefKey(right);
|
|
10718
|
+
var sameRevisionRef = (left, right) => revisionRefKey(left) === revisionRefKey(right);
|
|
10719
|
+
var assertUniqueRegistryKeys = (keys, path) => {
|
|
10720
|
+
const seen = /* @__PURE__ */ new Set();
|
|
10721
|
+
keys.forEach((key, index) => {
|
|
10722
|
+
if (seen.has(key)) {
|
|
10723
|
+
throw new DeclarativeControlCompilationError("REGISTRY_CONFLICT", `${path}[${index}]`, `Duplicate registry identity: ${key}`);
|
|
10724
|
+
}
|
|
10725
|
+
seen.add(key);
|
|
10726
|
+
});
|
|
10727
|
+
};
|
|
10728
|
+
var stableSerialize = (value) => {
|
|
10729
|
+
if (value === void 0) return "null";
|
|
10730
|
+
if (value === null || typeof value !== "object") return JSON.stringify(value) ?? "null";
|
|
10731
|
+
if (Array.isArray(value)) return `[${value.map((item) => stableSerialize(item)).join(",")}]`;
|
|
10732
|
+
const record = value;
|
|
10733
|
+
return `{${Object.keys(record).filter((key) => record[key] !== void 0).sort().map((key) => `${JSON.stringify(key)}:${stableSerialize(record[key])}`).join(",")}}`;
|
|
10734
|
+
};
|
|
10735
|
+
var SHA256_INITIAL = [
|
|
10736
|
+
1779033703,
|
|
10737
|
+
3144134277,
|
|
10738
|
+
1013904242,
|
|
10739
|
+
2773480762,
|
|
10740
|
+
1359893119,
|
|
10741
|
+
2600822924,
|
|
10742
|
+
528734635,
|
|
10743
|
+
1541459225
|
|
10744
|
+
];
|
|
10745
|
+
var SHA256_ROUND = [
|
|
10746
|
+
1116352408,
|
|
10747
|
+
1899447441,
|
|
10748
|
+
3049323471,
|
|
10749
|
+
3921009573,
|
|
10750
|
+
961987163,
|
|
10751
|
+
1508970993,
|
|
10752
|
+
2453635748,
|
|
10753
|
+
2870763221,
|
|
10754
|
+
3624381080,
|
|
10755
|
+
310598401,
|
|
10756
|
+
607225278,
|
|
10757
|
+
1426881987,
|
|
10758
|
+
1925078388,
|
|
10759
|
+
2162078206,
|
|
10760
|
+
2614888103,
|
|
10761
|
+
3248222580,
|
|
10762
|
+
3835390401,
|
|
10763
|
+
4022224774,
|
|
10764
|
+
264347078,
|
|
10765
|
+
604807628,
|
|
10766
|
+
770255983,
|
|
10767
|
+
1249150122,
|
|
10768
|
+
1555081692,
|
|
10769
|
+
1996064986,
|
|
10770
|
+
2554220882,
|
|
10771
|
+
2821834349,
|
|
10772
|
+
2952996808,
|
|
10773
|
+
3210313671,
|
|
10774
|
+
3336571891,
|
|
10775
|
+
3584528711,
|
|
10776
|
+
113926993,
|
|
10777
|
+
338241895,
|
|
10778
|
+
666307205,
|
|
10779
|
+
773529912,
|
|
10780
|
+
1294757372,
|
|
10781
|
+
1396182291,
|
|
10782
|
+
1695183700,
|
|
10783
|
+
1986661051,
|
|
10784
|
+
2177026350,
|
|
10785
|
+
2456956037,
|
|
10786
|
+
2730485921,
|
|
10787
|
+
2820302411,
|
|
10788
|
+
3259730800,
|
|
10789
|
+
3345764771,
|
|
10790
|
+
3516065817,
|
|
10791
|
+
3600352804,
|
|
10792
|
+
4094571909,
|
|
10793
|
+
275423344,
|
|
10794
|
+
430227734,
|
|
10795
|
+
506948616,
|
|
10796
|
+
659060556,
|
|
10797
|
+
883997877,
|
|
10798
|
+
958139571,
|
|
10799
|
+
1322822218,
|
|
10800
|
+
1537002063,
|
|
10801
|
+
1747873779,
|
|
10802
|
+
1955562222,
|
|
10803
|
+
2024104815,
|
|
10804
|
+
2227730452,
|
|
10805
|
+
2361852424,
|
|
10806
|
+
2428436474,
|
|
10807
|
+
2756734187,
|
|
10808
|
+
3204031479,
|
|
10809
|
+
3329325298
|
|
10810
|
+
];
|
|
10811
|
+
var rotateRight = (value, amount) => value >>> amount | value << 32 - amount;
|
|
10812
|
+
var sha256Hex = (value) => {
|
|
10813
|
+
const source = [...new TextEncoder().encode(value)];
|
|
10814
|
+
const bitLength = source.length * 8;
|
|
10815
|
+
source.push(128);
|
|
10816
|
+
while (source.length % 64 !== 56) source.push(0);
|
|
10817
|
+
const high = Math.floor(bitLength / 4294967296);
|
|
10818
|
+
const low = bitLength >>> 0;
|
|
10819
|
+
for (let shift = 24; shift >= 0; shift -= 8) source.push(high >>> shift & 255);
|
|
10820
|
+
for (let shift = 24; shift >= 0; shift -= 8) source.push(low >>> shift & 255);
|
|
10821
|
+
const hash = [...SHA256_INITIAL];
|
|
10822
|
+
const words = new Array(64).fill(0);
|
|
10823
|
+
for (let offset = 0; offset < source.length; offset += 64) {
|
|
10824
|
+
for (let index = 0; index < 16; index += 1) {
|
|
10825
|
+
const start = offset + index * 4;
|
|
10826
|
+
words[index] = (source[start] << 24 | source[start + 1] << 16 | source[start + 2] << 8 | source[start + 3]) >>> 0;
|
|
10827
|
+
}
|
|
10828
|
+
for (let index = 16; index < 64; index += 1) {
|
|
10829
|
+
const previous = words[index - 15];
|
|
10830
|
+
const recent = words[index - 2];
|
|
10831
|
+
const small0 = rotateRight(previous, 7) ^ rotateRight(previous, 18) ^ previous >>> 3;
|
|
10832
|
+
const small1 = rotateRight(recent, 17) ^ rotateRight(recent, 19) ^ recent >>> 10;
|
|
10833
|
+
words[index] = words[index - 16] + small0 + words[index - 7] + small1 >>> 0;
|
|
10834
|
+
}
|
|
10835
|
+
let [a, b, c, d, e, f, g, h] = hash;
|
|
10836
|
+
for (let index = 0; index < 64; index += 1) {
|
|
10837
|
+
const big1 = rotateRight(e, 6) ^ rotateRight(e, 11) ^ rotateRight(e, 25);
|
|
10838
|
+
const choice = e & f ^ ~e & g;
|
|
10839
|
+
const temp1 = h + big1 + choice + SHA256_ROUND[index] + words[index] >>> 0;
|
|
10840
|
+
const big0 = rotateRight(a, 2) ^ rotateRight(a, 13) ^ rotateRight(a, 22);
|
|
10841
|
+
const majority = a & b ^ a & c ^ b & c;
|
|
10842
|
+
const temp2 = big0 + majority >>> 0;
|
|
10843
|
+
h = g;
|
|
10844
|
+
g = f;
|
|
10845
|
+
f = e;
|
|
10846
|
+
e = d + temp1 >>> 0;
|
|
10847
|
+
d = c;
|
|
10848
|
+
c = b;
|
|
10849
|
+
b = a;
|
|
10850
|
+
a = temp1 + temp2 >>> 0;
|
|
10851
|
+
}
|
|
10852
|
+
hash[0] = hash[0] + a >>> 0;
|
|
10853
|
+
hash[1] = hash[1] + b >>> 0;
|
|
10854
|
+
hash[2] = hash[2] + c >>> 0;
|
|
10855
|
+
hash[3] = hash[3] + d >>> 0;
|
|
10856
|
+
hash[4] = hash[4] + e >>> 0;
|
|
10857
|
+
hash[5] = hash[5] + f >>> 0;
|
|
10858
|
+
hash[6] = hash[6] + g >>> 0;
|
|
10859
|
+
hash[7] = hash[7] + h >>> 0;
|
|
10860
|
+
}
|
|
10861
|
+
return hash.map((part) => part.toString(16).padStart(8, "0")).join("");
|
|
10862
|
+
};
|
|
10863
|
+
var canonicalContentHash = (value) => sha256Hex(stableSerialize(value));
|
|
10864
|
+
var declarativeCreateTemplateSourceHash = (document) => canonicalContentHash(document);
|
|
10865
|
+
var declarativeCreateTemplateRevisionHash = (registration) => canonicalContentHash(registration.document);
|
|
10866
|
+
var declarativeRouteSpaceSourceHash = (routeSpace) => canonicalContentHash(routeSpace);
|
|
10867
|
+
var declarativeRouteSpaceRevisionHash = (registration) => canonicalContentHash(registration.routeSpace);
|
|
10868
|
+
var declarativeProductResourceSourceHash = (document) => canonicalContentHash(document);
|
|
10869
|
+
var declarativeProductResourceRevisionHash = (registration) => canonicalContentHash(registration.document);
|
|
10870
|
+
var deepFreeze = (value) => {
|
|
10871
|
+
if (value === null || typeof value !== "object" || Object.isFrozen(value)) return value;
|
|
10872
|
+
Object.values(value).forEach((child) => deepFreeze(child));
|
|
10873
|
+
return Object.freeze(value);
|
|
10874
|
+
};
|
|
10875
|
+
var assertTenantCompatible = (reference, scope, path) => {
|
|
10876
|
+
if (reference.visibility === "tenant" && scopeKey(reference.tenantScope) !== scopeKey(scope)) {
|
|
10877
|
+
throw new DeclarativeControlCompilationError("CROSS_TENANT_REFERENCE", path, `Reference ${reference.kind}/${reference.id} belongs to another tenant scope.`);
|
|
10878
|
+
}
|
|
10879
|
+
};
|
|
10880
|
+
var assertSameTenantScope = (candidate, expected, path) => {
|
|
10881
|
+
if (scopeKey(candidate) !== scopeKey(expected)) {
|
|
10882
|
+
throw new DeclarativeControlCompilationError("CROSS_TENANT_REFERENCE", path, "Record and release tenant scopes do not match.");
|
|
10883
|
+
}
|
|
10884
|
+
};
|
|
10885
|
+
var stableFromRevision = (reference) => StableRefSchema.parse({
|
|
10886
|
+
kind: reference.kind,
|
|
10887
|
+
id: reference.id,
|
|
10888
|
+
ownerRepo: reference.ownerRepo,
|
|
10889
|
+
visibility: reference.visibility,
|
|
10890
|
+
...reference.tenantScope ? { tenantScope: reference.tenantScope } : {}
|
|
10891
|
+
});
|
|
10892
|
+
var assertRevisionIdentity = (reference, expectedKind, expectedId, scope, path) => {
|
|
10893
|
+
if (reference.kind !== expectedKind || reference.id !== expectedId) {
|
|
10894
|
+
throw new DeclarativeControlCompilationError("REVISION_MISMATCH", path, `Expected ${expectedKind}/${expectedId}, received ${reference.kind}/${reference.id}.`);
|
|
10895
|
+
}
|
|
10896
|
+
assertTenantCompatible(reference, scope, path);
|
|
10897
|
+
};
|
|
10898
|
+
var dependencyKey = (role, reference) => `${role}:${revisionRefKey(reference)}`;
|
|
10899
|
+
var requireDependencies = (snapshot, required) => {
|
|
10900
|
+
const available = new Set(snapshot.map((dependency) => dependencyKey(dependency.role, dependency.revisionRef)));
|
|
10901
|
+
for (const dependency of required) {
|
|
10902
|
+
const key = dependencyKey(dependency.role, dependency.revisionRef);
|
|
10903
|
+
if (!available.has(key)) {
|
|
10904
|
+
throw new DeclarativeControlCompilationError("DEPENDENCY_MISSING", "dependencySnapshot", `Missing exact ${dependency.role} dependency ${revisionRefKey(dependency.revisionRef)}.`);
|
|
10905
|
+
}
|
|
10906
|
+
}
|
|
10907
|
+
};
|
|
10908
|
+
var assertDependencyScopes = (snapshot, scope) => snapshot.forEach((dependency, index) => assertTenantCompatible(dependency.revisionRef, scope, `dependencySnapshot[${index}].revisionRef`));
|
|
10909
|
+
var requireReleaseReady = (release) => {
|
|
10910
|
+
if (release.evidence.validation.result !== "pass") {
|
|
10911
|
+
throw new DeclarativeControlCompilationError("RELEASE_VALIDATION_FAILED", "evidence.validation.result", "Runtime bundles require a passing release validation result.");
|
|
10912
|
+
}
|
|
10913
|
+
};
|
|
10914
|
+
var refSet = (values) => new Set(values.map(stableRefKey));
|
|
10915
|
+
var chainRequiresAll = (policies, field) => {
|
|
10916
|
+
if (field === "permissionAllOf") return new Set(policies.flatMap((policy) => policy.permissionAllOf));
|
|
10917
|
+
if (field === "groupAllOf") return refSet(policies.flatMap((policy) => policy.groupAllOf));
|
|
10918
|
+
return new Set(policies.flatMap((policy) => policy.conditionAllOf.map(revisionRefKey)));
|
|
10919
|
+
};
|
|
10920
|
+
var chainImpliesAny = (policies, targetAny, allValues, anyValues) => {
|
|
10921
|
+
if (targetAny.size === 0) return true;
|
|
10922
|
+
if ([...allValues].some((value) => targetAny.has(value))) return true;
|
|
10923
|
+
return policies.some((policy) => {
|
|
10924
|
+
const values = anyValues(policy);
|
|
10925
|
+
return values.length > 0 && values.every((value) => targetAny.has(value));
|
|
10926
|
+
});
|
|
10927
|
+
};
|
|
10928
|
+
var accessPolicyChainImplies = (policyInputs, targetInput) => {
|
|
10929
|
+
const policies = policyInputs.map((policy) => AccessPolicySchema.parse(policy));
|
|
10930
|
+
const target = AccessPolicySchema.parse(targetInput);
|
|
10931
|
+
if (target.authenticated && !policies.some((policy) => policy.authenticated)) return false;
|
|
10932
|
+
const permissionAll = chainRequiresAll(policies, "permissionAllOf");
|
|
10933
|
+
if (target.permissionAllOf.some((permission) => !permissionAll.has(permission))) return false;
|
|
10934
|
+
if (!chainImpliesAny(policies, new Set(target.permissionAnyOf), permissionAll, (policy) => policy.permissionAnyOf)) return false;
|
|
10935
|
+
const groupAll = chainRequiresAll(policies, "groupAllOf");
|
|
10936
|
+
if (target.groupAllOf.some((group) => !groupAll.has(stableRefKey(group)))) return false;
|
|
10937
|
+
if (!chainImpliesAny(
|
|
10938
|
+
policies,
|
|
10939
|
+
refSet(target.groupAnyOf),
|
|
10940
|
+
groupAll,
|
|
10941
|
+
(policy) => policy.groupAnyOf.map(stableRefKey)
|
|
10942
|
+
)) return false;
|
|
10943
|
+
const conditionAll = chainRequiresAll(policies, "conditionAllOf");
|
|
10944
|
+
if (target.conditionAllOf.some((condition) => !conditionAll.has(revisionRefKey(condition)))) return false;
|
|
10945
|
+
return true;
|
|
10946
|
+
};
|
|
10947
|
+
var normalizePath = (path, routeSpace) => {
|
|
10948
|
+
let normalized = path;
|
|
10949
|
+
if (!routeSpace.caseSensitive) {
|
|
10950
|
+
normalized = normalized.split("/").map((segment) => segment.startsWith(":") ? segment : segment.toLowerCase()).join("/");
|
|
10951
|
+
}
|
|
10952
|
+
if (routeSpace.trailingSlash === "remove" && normalized.length > 1) normalized = normalized.replace(/\/+$/, "");
|
|
10953
|
+
if (routeSpace.trailingSlash === "require" && normalized.length > 1 && !normalized.endsWith("/")) normalized += "/";
|
|
10954
|
+
return normalized;
|
|
10955
|
+
};
|
|
10956
|
+
var compileRouteClaims = (input) => {
|
|
10957
|
+
const registrations = input.routeSpaces.map((entry, index) => {
|
|
10958
|
+
const revisionRef = RevisionRefSchema.parse(entry.revisionRef);
|
|
10959
|
+
const routeSpace = RouteSpaceSchema.parse(entry.routeSpace);
|
|
10960
|
+
if (revisionRef.kind !== "route-space" || revisionRef.id !== routeSpace.routeSpaceId) {
|
|
10961
|
+
throw new DeclarativeControlCompilationError("ROUTE_SPACE_MISMATCH", `routeSpaces[${index}]`, "RouteSpace registration identity does not match its pinned revision.");
|
|
10962
|
+
}
|
|
10963
|
+
return { revisionRef, routeSpace };
|
|
10964
|
+
});
|
|
10965
|
+
assertUniqueRegistryKeys(registrations.map((entry) => revisionRefKey(entry.revisionRef)), "routeSpaces");
|
|
10966
|
+
const routeSpacesByRevision = new Map(registrations.map((entry) => [revisionRefKey(entry.revisionRef), entry.routeSpace]));
|
|
10967
|
+
const normalizedPaths = /* @__PURE__ */ new Set();
|
|
10968
|
+
const compiled = [];
|
|
10969
|
+
input.claims.forEach((inputClaim, index) => {
|
|
10970
|
+
const parsedClaim = "surface" in inputClaim ? RouteClaimSchema.parse(inputClaim) : LegacyRouteClaimSchema.parse(inputClaim);
|
|
10971
|
+
const routeSpace = routeSpacesByRevision.get(revisionRefKey(parsedClaim.routeSpaceRevisionRef));
|
|
10972
|
+
if (!routeSpace) throw new DeclarativeControlCompilationError("ROUTE_SPACE_MISSING", `routeClaims[${index}].routeSpaceRevisionRef`, "No exact RouteSpace registration exists.");
|
|
10973
|
+
const claim = RouteClaimSchema.parse({
|
|
10974
|
+
...parsedClaim,
|
|
10975
|
+
surface: "surface" in parsedClaim ? parsedClaim.surface : routeSpace.supportedSurface
|
|
10976
|
+
});
|
|
10977
|
+
if (routeSpace.supportedSurface !== claim.surface) {
|
|
10978
|
+
throw new DeclarativeControlCompilationError("ROUTE_SPACE_MISMATCH", `routeClaims[${index}].surface`, `Route claim surface ${claim.surface} does not match RouteSpace ${routeSpace.routeSpaceId}.`);
|
|
10979
|
+
}
|
|
10980
|
+
if (claim.surface !== input.surface) return;
|
|
10981
|
+
const normalizedPath = normalizePath(claim.pathTemplate, routeSpace);
|
|
10982
|
+
const knownParameters = new Set(routeSpace.parameters.map((parameter) => parameter.name));
|
|
10983
|
+
const pathParameters = [...normalizedPath.matchAll(/:([A-Za-z][A-Za-z0-9_-]*)/g)].map((match) => match[1]);
|
|
10984
|
+
if (new Set(pathParameters).size !== pathParameters.length) {
|
|
10985
|
+
throw new DeclarativeControlCompilationError("ROUTE_SPACE_MISMATCH", `routeClaims[${index}].pathTemplate`, "Route parameters must be unique within a path.");
|
|
10986
|
+
}
|
|
10987
|
+
const unknownParameter = pathParameters.find((parameter) => !knownParameters.has(parameter));
|
|
10988
|
+
if (unknownParameter) {
|
|
10989
|
+
throw new DeclarativeControlCompilationError("ROUTE_SPACE_MISMATCH", `routeClaims[${index}].pathTemplate`, `Route parameter ${unknownParameter} is not declared by ${routeSpace.routeSpaceId}.`);
|
|
10990
|
+
}
|
|
10991
|
+
const reserved = routeSpace.reservedPaths.some((candidate) => {
|
|
10992
|
+
const normalizedReserved = normalizePath(candidate, routeSpace);
|
|
10993
|
+
return normalizedPath === normalizedReserved || normalizedPath.startsWith(`${normalizedReserved}/`);
|
|
10994
|
+
});
|
|
10995
|
+
if (reserved) throw new DeclarativeControlCompilationError("ROUTE_RESERVED", `routeClaims[${index}].pathTemplate`, `Route ${normalizedPath} is reserved by ${routeSpace.routeSpaceId}.`);
|
|
10996
|
+
const routeIdentity = `${revisionRefKey(claim.routeSpaceRevisionRef)}:${normalizedPath}`;
|
|
10997
|
+
if (normalizedPaths.has(routeIdentity)) throw new DeclarativeControlCompilationError("ROUTE_CONFLICT", `routeClaims[${index}].pathTemplate`, `Duplicate normalized route ${normalizedPath}.`);
|
|
10998
|
+
normalizedPaths.add(routeIdentity);
|
|
10999
|
+
compiled.push(CompiledRouteClaimSchema.parse({
|
|
11000
|
+
...claim,
|
|
11001
|
+
normalizedPath,
|
|
11002
|
+
matcher: {
|
|
11003
|
+
caseSensitive: routeSpace.caseSensitive,
|
|
11004
|
+
trailingSlash: routeSpace.trailingSlash,
|
|
11005
|
+
parameters: routeSpace.parameters
|
|
11006
|
+
}
|
|
11007
|
+
}));
|
|
11008
|
+
});
|
|
11009
|
+
if (!compiled.some((claim) => claim.kind === "canonical")) {
|
|
11010
|
+
throw new DeclarativeControlCompilationError("ROUTE_CONFLICT", "routeClaims", "At least one canonical route claim is required.");
|
|
11011
|
+
}
|
|
11012
|
+
return Object.freeze(compiled);
|
|
11013
|
+
};
|
|
11014
|
+
var routeParameterPattern = (type) => {
|
|
11015
|
+
if (type === "integer") return /^-?\d+$/;
|
|
11016
|
+
if (type === "uuid") return /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
11017
|
+
if (type === "slug") return /^[A-Za-z0-9]+(?:[._-][A-Za-z0-9]+)*$/;
|
|
11018
|
+
return /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
11019
|
+
};
|
|
11020
|
+
var materializeRouteSpacePath = (input) => {
|
|
11021
|
+
const routeSpace = RouteSpaceSchema.parse(input.routeSpace);
|
|
11022
|
+
const applicationPath = RoutePathTemplateSchema.parse(input.applicationPath);
|
|
11023
|
+
const basePath = routeSpace.basePath === "/" ? "" : routeSpace.basePath.replace(/\/+$/, "");
|
|
11024
|
+
let browserTemplate = normalizePath(`${basePath}${applicationPath === "/" ? "/" : applicationPath}` || "/", routeSpace);
|
|
11025
|
+
const parameters = input.parameters || {};
|
|
11026
|
+
const declared = new Map(routeSpace.parameters.map((parameter) => [parameter.name, parameter]));
|
|
11027
|
+
const referenced = [...browserTemplate.matchAll(/:([A-Za-z][A-Za-z0-9_-]*)/g)].map((match) => match[1]);
|
|
11028
|
+
for (const name of referenced) {
|
|
11029
|
+
const definition = declared.get(name);
|
|
11030
|
+
const raw = parameters[name];
|
|
11031
|
+
if (!definition || raw === void 0 || raw === null || String(raw).trim() === "") {
|
|
11032
|
+
throw new DeclarativeControlCompilationError("ROUTE_SPACE_MISMATCH", "parameters", `Route parameter ${name} is not resolved by ${routeSpace.routeSpaceId}.`);
|
|
11033
|
+
}
|
|
11034
|
+
const value = String(raw);
|
|
11035
|
+
if (!routeParameterPattern(definition.type).test(value)) {
|
|
11036
|
+
throw new DeclarativeControlCompilationError("ROUTE_SPACE_MISMATCH", `parameters.${name}`, `Route parameter ${name} does not satisfy ${definition.type}.`);
|
|
11037
|
+
}
|
|
11038
|
+
browserTemplate = browserTemplate.replace(`:${name}`, encodeURIComponent(value));
|
|
11039
|
+
}
|
|
11040
|
+
const unknown = Object.keys(parameters).find((name) => !declared.has(name));
|
|
11041
|
+
if (unknown) throw new DeclarativeControlCompilationError("ROUTE_SPACE_MISMATCH", `parameters.${unknown}`, `RouteSpace ${routeSpace.routeSpaceId} does not declare ${unknown}.`);
|
|
11042
|
+
return browserTemplate;
|
|
11043
|
+
};
|
|
11044
|
+
var renderTreeDepth = (tree) => {
|
|
11045
|
+
const byId = new Map(tree.nodes.map((node) => [node.nodeId, node]));
|
|
11046
|
+
let maximum = 0;
|
|
11047
|
+
tree.nodes.forEach((node) => {
|
|
11048
|
+
let depth = 1;
|
|
11049
|
+
let parentId = node.parentNodeId;
|
|
11050
|
+
while (parentId) {
|
|
11051
|
+
depth += 1;
|
|
11052
|
+
parentId = byId.get(parentId)?.parentNodeId;
|
|
11053
|
+
}
|
|
11054
|
+
maximum = Math.max(maximum, depth);
|
|
11055
|
+
});
|
|
11056
|
+
return maximum;
|
|
11057
|
+
};
|
|
11058
|
+
var compareLegacyEntityRef = (reference, revision) => reference.kind === revision.kind && reference.id === revision.id && String(reference.version) === String(revision.revision) && reference.ownerRepo === revision.ownerRepo;
|
|
11059
|
+
var pageDependencies = (page, compilerRevisionRef) => [
|
|
11060
|
+
...page.routeClaims.map((claim) => ({ role: "route-space", revisionRef: claim.routeSpaceRevisionRef })),
|
|
11061
|
+
{ role: "shell", revisionRef: page.shellRevisionRef },
|
|
11062
|
+
...page.capabilityInstances.flatMap((instance) => [
|
|
11063
|
+
{ role: "capability", revisionRef: instance.capabilityRevisionRef },
|
|
11064
|
+
{ role: "provider", revisionRef: instance.providerRevisionRef },
|
|
11065
|
+
{ role: "schema", revisionRef: instance.propertySchemaRevisionRef }
|
|
11066
|
+
]),
|
|
11067
|
+
...page.ontologyBindings.flatMap((binding) => [
|
|
11068
|
+
{ role: "ontology-definition", revisionRef: binding.ontologyDefinitionRevisionRef },
|
|
11069
|
+
...binding.viewRevisionRef ? [{ role: "view", revisionRef: binding.viewRevisionRef }] : [],
|
|
11070
|
+
...binding.projectionRevisionRef ? [{ role: "projection", revisionRef: binding.projectionRevisionRef }] : [],
|
|
11071
|
+
{ role: "schema", revisionRef: binding.renderModelSchemaRevisionRef }
|
|
11072
|
+
]),
|
|
11073
|
+
...page.actionBindings.flatMap((binding) => [
|
|
11074
|
+
{ role: "action", revisionRef: binding.commandRevisionRef },
|
|
11075
|
+
{ role: "schema", revisionRef: binding.sourceIntentSchemaRevisionRef },
|
|
11076
|
+
{ role: "schema", revisionRef: binding.inputSchemaRevisionRef },
|
|
11077
|
+
{ role: "schema", revisionRef: binding.resultSchemaRevisionRef },
|
|
11078
|
+
...binding.compensationCommandRevisionRef ? [{ role: "action", revisionRef: binding.compensationCommandRevisionRef }] : []
|
|
11079
|
+
]),
|
|
11080
|
+
...page.tokenRevisionRefs.map((revisionRef) => ({ role: "token", revisionRef })),
|
|
11081
|
+
{ role: "performance-budget", revisionRef: page.performanceBudgetRef },
|
|
11082
|
+
{ role: "observation-policy", revisionRef: page.observationPolicyRevisionRef },
|
|
11083
|
+
{ role: "compiler", revisionRef: compilerRevisionRef }
|
|
11084
|
+
];
|
|
11085
|
+
var compilePageRuntimeBundle = (input) => {
|
|
11086
|
+
const page = PageSchema.parse(input.page);
|
|
11087
|
+
const pageRevisionRef = RevisionRefSchema.parse(input.pageRevisionRef);
|
|
11088
|
+
const release = PageReleaseSchema.parse(input.release);
|
|
11089
|
+
const releaseRevisionRef = RevisionRefSchema.parse(input.releaseRevisionRef);
|
|
11090
|
+
const compilerRevisionRef = RevisionRefSchema.parse(input.compilerRevisionRef);
|
|
11091
|
+
const scope = TenantScopeSchema.parse(page.tenantScope);
|
|
11092
|
+
assertSameTenantScope(release.tenantScope, scope, "release.tenantScope");
|
|
11093
|
+
assertRevisionIdentity(pageRevisionRef, "page", page.pageId, scope, "pageRevisionRef");
|
|
11094
|
+
assertRevisionIdentity(release.pageRevisionRef, "page", page.pageId, scope, "release.pageRevisionRef");
|
|
11095
|
+
if (!sameRevisionRef(pageRevisionRef, release.pageRevisionRef)) throw new DeclarativeControlCompilationError("REVISION_MISMATCH", "release.pageRevisionRef", "Release does not pin the supplied Page revision.");
|
|
11096
|
+
assertRevisionIdentity(releaseRevisionRef, "page-release", release.releaseSlotId, scope, "releaseRevisionRef");
|
|
11097
|
+
requireReleaseReady(release);
|
|
11098
|
+
requireDependencies(release.dependencySnapshot, pageDependencies(page, compilerRevisionRef));
|
|
11099
|
+
assertDependencyScopes(release.dependencySnapshot, scope);
|
|
11100
|
+
if (page.renderTree.nodes.length > input.limits.maxRenderNodes) throw new DeclarativeControlCompilationError("RENDER_NODE_LIMIT_EXCEEDED", "page.renderTree.nodes", "RenderTree exceeds the caller-approved node limit.");
|
|
11101
|
+
if (renderTreeDepth(page.renderTree) > input.limits.maxRenderDepth) throw new DeclarativeControlCompilationError("RENDER_DEPTH_EXCEEDED", "page.renderTree.nodes", "RenderTree exceeds the caller-approved depth limit.");
|
|
11102
|
+
const renderTree = compileRenderTree(page.renderTree).tree;
|
|
11103
|
+
const instancesByNode = new Map(page.capabilityInstances.map((instance) => [instance.nodeId, instance]));
|
|
11104
|
+
const registrations = input.capabilityRegistry.map((registration, registrationIndex) => ({
|
|
11105
|
+
...registration,
|
|
11106
|
+
capabilityRevisionRef: RevisionRefSchema.parse(registration.capabilityRevisionRef),
|
|
11107
|
+
providerRevisionRef: RevisionRefSchema.parse(registration.providerRevisionRef),
|
|
11108
|
+
inputPorts: registration.inputPorts.map((port, portIndex) => {
|
|
11109
|
+
const schemaRevisionRef = RevisionRefSchema.parse(port.schemaRevisionRef);
|
|
11110
|
+
if (schemaRevisionRef.kind !== "schema") {
|
|
11111
|
+
throw new DeclarativeControlCompilationError("PORT_TYPE_MISMATCH", `capabilityRegistry[${registrationIndex}].inputPorts[${portIndex}].schemaRevisionRef`, "Capability ports must pin schema revisions.");
|
|
11112
|
+
}
|
|
11113
|
+
return { ...port, schemaRevisionRef };
|
|
11114
|
+
}),
|
|
11115
|
+
outputPorts: registration.outputPorts.map((port, portIndex) => {
|
|
11116
|
+
const schemaRevisionRef = RevisionRefSchema.parse(port.schemaRevisionRef);
|
|
11117
|
+
if (schemaRevisionRef.kind !== "schema") {
|
|
11118
|
+
throw new DeclarativeControlCompilationError("PORT_TYPE_MISMATCH", `capabilityRegistry[${registrationIndex}].outputPorts[${portIndex}].schemaRevisionRef`, "Capability ports must pin schema revisions.");
|
|
11119
|
+
}
|
|
11120
|
+
return { ...port, schemaRevisionRef };
|
|
11121
|
+
})
|
|
11122
|
+
}));
|
|
11123
|
+
assertUniqueRegistryKeys(registrations.map((registration) => `${revisionRefKey(registration.capabilityRevisionRef)}:${revisionRefKey(registration.providerRevisionRef)}`), "capabilityRegistry");
|
|
11124
|
+
const registrationsByPair = new Map(registrations.map((registration) => [
|
|
11125
|
+
`${revisionRefKey(registration.capabilityRevisionRef)}:${revisionRefKey(registration.providerRevisionRef)}`,
|
|
11126
|
+
registration
|
|
11127
|
+
]));
|
|
11128
|
+
page.capabilityInstances.forEach((instance, index) => {
|
|
11129
|
+
const node = renderTree.nodes.find((candidate) => candidate.nodeId === instance.nodeId);
|
|
11130
|
+
if (!node || !compareLegacyEntityRef(node.capabilityRef, instance.capabilityRevisionRef) || !node.providerRef || !compareLegacyEntityRef(node.providerRef, instance.providerRevisionRef) || node.pageRef.id !== page.pageId) {
|
|
11131
|
+
throw new DeclarativeControlCompilationError("CAPABILITY_BINDING_MISMATCH", `capabilityInstances[${index}]`, "RenderTree node identity does not match the declared capability/provider instance.");
|
|
9566
11132
|
}
|
|
9567
|
-
|
|
9568
|
-
|
|
9569
|
-
|
|
9570
|
-
}
|
|
9571
|
-
addEdge(ref("concept", concept.conceptId), ref("concept", relationship.targetConceptId), "relates-to-concept");
|
|
11133
|
+
const registration = registrationsByPair.get(`${revisionRefKey(instance.capabilityRevisionRef)}:${revisionRefKey(instance.providerRevisionRef)}`);
|
|
11134
|
+
if (!registration?.editorEligible) {
|
|
11135
|
+
throw new DeclarativeControlCompilationError("CAPABILITY_NOT_EDITOR_ELIGIBLE", `capabilityInstances[${index}]`, "Capability/provider pair is not editor-eligible.");
|
|
9572
11136
|
}
|
|
9573
|
-
|
|
9574
|
-
|
|
9575
|
-
addNode("page", page.pageId);
|
|
9576
|
-
if (page.binding.ontologyId) {
|
|
9577
|
-
if (!ontologiesById.has(page.binding.ontologyId)) throw new Error(`Page ${page.pageId} references unknown ontology ${page.binding.ontologyId}.`);
|
|
9578
|
-
addEdge(ref("page", page.pageId), ref("ontology", page.binding.ontologyId), "uses-ontology");
|
|
11137
|
+
if (instance.allowedSideEffects.some((sideEffect) => !registration.allowedSideEffects.includes(sideEffect))) {
|
|
11138
|
+
throw new DeclarativeControlCompilationError("CAPABILITY_BINDING_MISMATCH", `capabilityInstances[${index}].allowedSideEffects`, "Page requests undeclared provider side effects.");
|
|
9579
11139
|
}
|
|
9580
|
-
|
|
9581
|
-
|
|
9582
|
-
|
|
11140
|
+
});
|
|
11141
|
+
page.ontologyBindings.forEach((binding, index) => {
|
|
11142
|
+
const instance = page.capabilityInstances.find((candidate) => candidate.instanceId === binding.target.capabilityInstanceId);
|
|
11143
|
+
const registration = instance && registrationsByPair.get(`${revisionRefKey(instance.capabilityRevisionRef)}:${revisionRefKey(instance.providerRevisionRef)}`);
|
|
11144
|
+
const port = registration?.inputPorts.find((candidate) => candidate.name === binding.target.port);
|
|
11145
|
+
if (!port || !sameRevisionRef(port.schemaRevisionRef, binding.renderModelSchemaRevisionRef)) {
|
|
11146
|
+
throw new DeclarativeControlCompilationError("PORT_TYPE_MISMATCH", `ontologyBindings[${index}].target.port`, "Ontology render model does not match the registered capability input port.");
|
|
9583
11147
|
}
|
|
9584
|
-
|
|
9585
|
-
|
|
9586
|
-
|
|
11148
|
+
});
|
|
11149
|
+
page.actionBindings.forEach((binding, index) => {
|
|
11150
|
+
const instance = page.capabilityInstances.find((candidate) => candidate.instanceId === binding.source.capabilityInstanceId);
|
|
11151
|
+
const registration = instance && registrationsByPair.get(`${revisionRefKey(instance.capabilityRevisionRef)}:${revisionRefKey(instance.providerRevisionRef)}`);
|
|
11152
|
+
const port = registration?.outputPorts.find((candidate) => candidate.name === binding.source.port);
|
|
11153
|
+
if (!port || !sameRevisionRef(port.schemaRevisionRef, binding.sourceIntentSchemaRevisionRef)) {
|
|
11154
|
+
throw new DeclarativeControlCompilationError("PORT_TYPE_MISMATCH", `actionBindings[${index}].sourceIntentSchemaRevisionRef`, "Action source intent does not match the registered capability output port.");
|
|
9587
11155
|
}
|
|
9588
|
-
}
|
|
9589
|
-
uniqueIndex(nodes, refKey, "declaration node");
|
|
9590
|
-
return Object.freeze({
|
|
9591
|
-
declaration: Object.freeze(declaration),
|
|
9592
|
-
conceptsById,
|
|
9593
|
-
ontologiesById,
|
|
9594
|
-
projectionsById,
|
|
9595
|
-
commandsByName,
|
|
9596
|
-
capabilitiesById,
|
|
9597
|
-
pagesById,
|
|
9598
|
-
menusByKey,
|
|
9599
|
-
nodes: Object.freeze(nodes),
|
|
9600
|
-
edges: Object.freeze(edges)
|
|
9601
11156
|
});
|
|
11157
|
+
const routeClaims = compileRouteClaims({ claims: page.routeClaims, routeSpaces: input.routeSpaces, surface: release.target.surface });
|
|
11158
|
+
const releaseRoute = routeClaims.find((claim) => claim.kind === "canonical" && claim.normalizedPath === release.target.normalizedPath);
|
|
11159
|
+
if (!releaseRoute || !sameRevisionRef(releaseRoute.routeSpaceRevisionRef, release.target.routeSpaceRevisionRef)) {
|
|
11160
|
+
throw new DeclarativeControlCompilationError("ROUTE_SPACE_MISMATCH", "release.target", "Release target does not match a canonical Page route claim.");
|
|
11161
|
+
}
|
|
11162
|
+
if (!page.supportedSurfaces.includes(release.target.surface)) {
|
|
11163
|
+
throw new DeclarativeControlCompilationError("ROUTE_SPACE_MISMATCH", "release.target.surface", "Page does not support the release surface.");
|
|
11164
|
+
}
|
|
11165
|
+
const unsigned = {
|
|
11166
|
+
contract: "PageRuntimeBundle",
|
|
11167
|
+
schemaVersion: 1,
|
|
11168
|
+
tenantScope: scope,
|
|
11169
|
+
releaseRevisionRef,
|
|
11170
|
+
compilerRevisionRef,
|
|
11171
|
+
generation: input.generation,
|
|
11172
|
+
dependencySnapshot: release.dependencySnapshot,
|
|
11173
|
+
rebuildable: true,
|
|
11174
|
+
diagnostics: [],
|
|
11175
|
+
pageId: page.pageId,
|
|
11176
|
+
pageRevisionRef,
|
|
11177
|
+
surface: release.target.surface,
|
|
11178
|
+
routeClaims,
|
|
11179
|
+
shellRevisionRef: page.shellRevisionRef,
|
|
11180
|
+
renderTree,
|
|
11181
|
+
capabilityInstances: page.capabilityInstances,
|
|
11182
|
+
ontologyBindings: page.ontologyBindings,
|
|
11183
|
+
actionBindings: page.actionBindings,
|
|
11184
|
+
pageAccessPolicy: page.pageAccessPolicy,
|
|
11185
|
+
tokenRevisionRefs: page.tokenRevisionRefs,
|
|
11186
|
+
performanceBudgetRef: page.performanceBudgetRef,
|
|
11187
|
+
observationPolicyRevisionRef: page.observationPolicyRevisionRef,
|
|
11188
|
+
privacyClassification: page.privacyClassification
|
|
11189
|
+
};
|
|
11190
|
+
return deepFreeze(PageRuntimeBundleSchema.parse({ ...unsigned, contentHash: canonicalContentHash(unsigned) }));
|
|
9602
11191
|
};
|
|
9603
|
-
var
|
|
9604
|
-
|
|
9605
|
-
|
|
9606
|
-
|
|
9607
|
-
|
|
9608
|
-
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
|
|
9612
|
-
|
|
9613
|
-
|
|
11192
|
+
var workbenchDependencyRole = (kind) => {
|
|
11193
|
+
switch (kind) {
|
|
11194
|
+
case "workflow":
|
|
11195
|
+
return "workflow";
|
|
11196
|
+
case "agent":
|
|
11197
|
+
return "agent";
|
|
11198
|
+
case "capability":
|
|
11199
|
+
return "capability";
|
|
11200
|
+
case "design":
|
|
11201
|
+
return "design";
|
|
11202
|
+
case "built-in-application":
|
|
11203
|
+
return "built-in-application";
|
|
11204
|
+
default:
|
|
11205
|
+
return "workflow";
|
|
9614
11206
|
}
|
|
9615
|
-
const granted = new Set(permissionCodes);
|
|
9616
|
-
const missing = definition.requiredPermissionCodes.filter((permission) => !granted.has(permission));
|
|
9617
|
-
if (missing.length) throw new Error(`Command ${command.commandName} requires permissions: ${missing.join(", ")}`);
|
|
9618
|
-
return Object.freeze(command);
|
|
9619
11207
|
};
|
|
9620
|
-
var
|
|
9621
|
-
|
|
9622
|
-
|
|
9623
|
-
|
|
9624
|
-
|
|
9625
|
-
|
|
9626
|
-
|
|
9627
|
-
|
|
9628
|
-
|
|
11208
|
+
var workbenchDependencies = (workbench, compilerRevisionRef) => [
|
|
11209
|
+
...workbench.routeClaims.map((claim) => ({ role: "route-space", revisionRef: claim.routeSpaceRevisionRef })),
|
|
11210
|
+
...workbench.appInstances.flatMap((instance) => [
|
|
11211
|
+
{ role: workbenchDependencyRole(instance.targetRevisionRef.kind), revisionRef: instance.targetRevisionRef },
|
|
11212
|
+
{ role: "provider", revisionRef: instance.providerRevisionRef },
|
|
11213
|
+
{ role: "schema", revisionRef: instance.inputSchemaRevisionRef }
|
|
11214
|
+
]),
|
|
11215
|
+
{ role: "capability", revisionRef: workbench.layout.hostCapabilityRevisionRef },
|
|
11216
|
+
{ role: "provider", revisionRef: workbench.layout.hostProviderRevisionRef },
|
|
11217
|
+
{ role: "layout-policy", revisionRef: workbench.layout.layoutPolicyRevisionRef },
|
|
11218
|
+
...workbench.layout.tokenRevisionRefs.map((revisionRef) => ({ role: "token", revisionRef })),
|
|
11219
|
+
{ role: "performance-budget", revisionRef: workbench.performanceBudgetRef },
|
|
11220
|
+
{ role: "observation-policy", revisionRef: workbench.observationPolicyRevisionRef },
|
|
11221
|
+
{ role: "compiler", revisionRef: compilerRevisionRef }
|
|
11222
|
+
];
|
|
11223
|
+
var compileWorkbenchRuntimeBundle = (input) => {
|
|
11224
|
+
const workbench = WorkbenchSchema.parse(input.workbench);
|
|
11225
|
+
const workbenchRevisionRef = RevisionRefSchema.parse(input.workbenchRevisionRef);
|
|
11226
|
+
const release = WorkbenchReleaseSchema.parse(input.release);
|
|
11227
|
+
const releaseRevisionRef = RevisionRefSchema.parse(input.releaseRevisionRef);
|
|
11228
|
+
const compilerRevisionRef = RevisionRefSchema.parse(input.compilerRevisionRef);
|
|
11229
|
+
const scope = TenantScopeSchema.parse(workbench.tenantScope);
|
|
11230
|
+
assertSameTenantScope(release.tenantScope, scope, "release.tenantScope");
|
|
11231
|
+
if (workbench.purpose === "template") throw new DeclarativeControlCompilationError("WORKBENCH_TEMPLATE_UNRELEASABLE", "workbench.purpose", "Workbench templates cannot be activated.");
|
|
11232
|
+
if (workbench.groups.length > input.limits.maxWorkbenchGroups || workbench.appInstances.length > input.limits.maxWorkbenchInstances) {
|
|
11233
|
+
throw new DeclarativeControlCompilationError("WORKBENCH_INSTANCE_LIMIT_EXCEEDED", "workbench", "Workbench exceeds caller-approved compilation limits.");
|
|
11234
|
+
}
|
|
11235
|
+
assertRevisionIdentity(workbenchRevisionRef, "workbench", workbench.workbenchId, scope, "workbenchRevisionRef");
|
|
11236
|
+
assertRevisionIdentity(release.workbenchRevisionRef, "workbench", workbench.workbenchId, scope, "release.workbenchRevisionRef");
|
|
11237
|
+
if (!sameRevisionRef(workbenchRevisionRef, release.workbenchRevisionRef)) throw new DeclarativeControlCompilationError("REVISION_MISMATCH", "release.workbenchRevisionRef", "Release does not pin the supplied Workbench revision.");
|
|
11238
|
+
assertRevisionIdentity(releaseRevisionRef, "workbench-release", release.releaseSlotId, scope, "releaseRevisionRef");
|
|
11239
|
+
if (release.target.workbenchId !== workbench.workbenchId) throw new DeclarativeControlCompilationError("REVISION_MISMATCH", "release.target.workbenchId", "Release target does not match Workbench identity.");
|
|
11240
|
+
requireReleaseReady(release);
|
|
11241
|
+
requireDependencies(release.dependencySnapshot, workbenchDependencies(workbench, compilerRevisionRef));
|
|
11242
|
+
assertDependencyScopes(release.dependencySnapshot, scope);
|
|
11243
|
+
const routeClaims = compileRouteClaims({ claims: workbench.routeClaims, routeSpaces: input.routeSpaces, surface: release.target.surface });
|
|
11244
|
+
const releaseRoute = routeClaims.find((claim) => claim.kind === "canonical" && claim.normalizedPath === release.target.normalizedPath);
|
|
11245
|
+
if (!releaseRoute || !sameRevisionRef(releaseRoute.routeSpaceRevisionRef, release.target.routeSpaceRevisionRef)) {
|
|
11246
|
+
throw new DeclarativeControlCompilationError("ROUTE_SPACE_MISMATCH", "release.target", "Release target does not match a canonical Workbench route claim.");
|
|
11247
|
+
}
|
|
11248
|
+
const targetRegistry = input.targetRegistry.map((registration) => ({
|
|
11249
|
+
stableTargetRef: StableRefSchema.parse(registration.stableTargetRef),
|
|
11250
|
+
targetRevisionRef: RevisionRefSchema.parse(registration.targetRevisionRef),
|
|
11251
|
+
accessPolicy: AccessPolicySchema.parse(registration.accessPolicy)
|
|
11252
|
+
}));
|
|
11253
|
+
assertUniqueRegistryKeys(targetRegistry.map((registration) => stableRefKey(registration.stableTargetRef)), "targetRegistry");
|
|
11254
|
+
const targetsByStableRef = new Map(targetRegistry.map((registration) => [stableRefKey(registration.stableTargetRef), registration]));
|
|
11255
|
+
const groupsById = new Map(workbench.groups.map((group) => [group.groupId, group]));
|
|
11256
|
+
const appInstances = workbench.appInstances.map((instance, index) => {
|
|
11257
|
+
const stableTarget = StableRefSchema.parse({
|
|
11258
|
+
kind: instance.targetRevisionRef.kind,
|
|
11259
|
+
id: instance.targetRevisionRef.id,
|
|
11260
|
+
ownerRepo: instance.targetRevisionRef.ownerRepo,
|
|
11261
|
+
visibility: instance.targetRevisionRef.visibility,
|
|
11262
|
+
...instance.targetRevisionRef.tenantScope ? { tenantScope: instance.targetRevisionRef.tenantScope } : {}
|
|
11263
|
+
});
|
|
11264
|
+
const registration = targetsByStableRef.get(stableRefKey(stableTarget));
|
|
11265
|
+
if (!registration || !sameStableRef(registration.stableTargetRef, stableFromRevision(registration.targetRevisionRef)) || !sameRevisionRef(registration.targetRevisionRef, instance.targetRevisionRef)) {
|
|
11266
|
+
throw new DeclarativeControlCompilationError("NAV_TARGET_UNRELEASED", `appInstances[${index}].targetRevisionRef`, "Workbench app target is not present at the exact registered revision.");
|
|
11267
|
+
}
|
|
11268
|
+
assertTenantCompatible(instance.targetRevisionRef, scope, `appInstances[${index}].targetRevisionRef`);
|
|
11269
|
+
const group = groupsById.get(instance.groupId);
|
|
11270
|
+
const chain = [workbench.workbenchAccessPolicy, ...group?.accessPolicy ? [group.accessPolicy] : [], instance.accessPolicy];
|
|
11271
|
+
if (!accessPolicyChainImplies(chain, registration.accessPolicy)) {
|
|
11272
|
+
throw new DeclarativeControlCompilationError("AUDIENCE_WIDER_THAN_TARGET", `appInstances[${index}].accessPolicy`, "Workbench and instance audience is wider than the target audience.");
|
|
11273
|
+
}
|
|
11274
|
+
return { ...instance, targetAccessPolicy: registration.accessPolicy };
|
|
11275
|
+
});
|
|
11276
|
+
const unsigned = {
|
|
11277
|
+
contract: "WorkbenchRuntimeBundle",
|
|
11278
|
+
schemaVersion: 1,
|
|
11279
|
+
tenantScope: scope,
|
|
11280
|
+
releaseRevisionRef,
|
|
11281
|
+
compilerRevisionRef,
|
|
11282
|
+
generation: input.generation,
|
|
11283
|
+
dependencySnapshot: release.dependencySnapshot,
|
|
11284
|
+
rebuildable: true,
|
|
11285
|
+
diagnostics: [],
|
|
11286
|
+
workbenchId: workbench.workbenchId,
|
|
11287
|
+
workbenchRevisionRef,
|
|
11288
|
+
surface: release.target.surface,
|
|
11289
|
+
routeClaims,
|
|
11290
|
+
groups: workbench.groups,
|
|
11291
|
+
appInstances,
|
|
11292
|
+
defaultEntry: workbench.defaultEntry,
|
|
11293
|
+
layout: workbench.layout,
|
|
11294
|
+
workbenchAccessPolicy: workbench.workbenchAccessPolicy,
|
|
11295
|
+
personalPreferencesPolicy: workbench.personalPreferencesPolicy,
|
|
11296
|
+
target: { ...release.target, routeClaim: releaseRoute },
|
|
11297
|
+
performanceBudgetRef: workbench.performanceBudgetRef,
|
|
11298
|
+
observationPolicyRevisionRef: workbench.observationPolicyRevisionRef,
|
|
11299
|
+
privacyClassification: workbench.privacyClassification
|
|
11300
|
+
};
|
|
11301
|
+
return deepFreeze(WorkbenchRuntimeBundleSchema.parse({ ...unsigned, contentHash: canonicalContentHash(unsigned) }));
|
|
9629
11302
|
};
|
|
9630
|
-
var
|
|
9631
|
-
const
|
|
9632
|
-
|
|
9633
|
-
|
|
9634
|
-
|
|
9635
|
-
|
|
9636
|
-
|
|
9637
|
-
|
|
9638
|
-
|
|
9639
|
-
|
|
9640
|
-
|
|
9641
|
-
|
|
9642
|
-
|
|
9643
|
-
|
|
9644
|
-
|
|
9645
|
-
|
|
9646
|
-
|
|
9647
|
-
|
|
9648
|
-
|
|
9649
|
-
|
|
9650
|
-
|
|
9651
|
-
|
|
9652
|
-
|
|
9653
|
-
|
|
9654
|
-
|
|
9655
|
-
|
|
9656
|
-
|
|
11303
|
+
var navigationDepth = (navigation) => {
|
|
11304
|
+
const byId = new Map(navigation.nodes.map((node) => [node.nodeId, node]));
|
|
11305
|
+
let maximum = 0;
|
|
11306
|
+
navigation.nodes.forEach((node) => {
|
|
11307
|
+
let depth = 1;
|
|
11308
|
+
let parentId = node.parentNodeId;
|
|
11309
|
+
while (parentId) {
|
|
11310
|
+
depth += 1;
|
|
11311
|
+
parentId = byId.get(parentId)?.parentNodeId ?? null;
|
|
11312
|
+
}
|
|
11313
|
+
maximum = Math.max(maximum, depth);
|
|
11314
|
+
});
|
|
11315
|
+
return maximum;
|
|
11316
|
+
};
|
|
11317
|
+
var orderedNavigationNodes = (navigation) => {
|
|
11318
|
+
const children = /* @__PURE__ */ new Map();
|
|
11319
|
+
navigation.nodes.forEach((node) => {
|
|
11320
|
+
const parent = node.parentNodeId ?? "";
|
|
11321
|
+
const siblings = children.get(parent) ?? [];
|
|
11322
|
+
children.set(parent, [...siblings, node]);
|
|
11323
|
+
});
|
|
11324
|
+
children.forEach((siblings) => siblings.sort((left, right) => left.order - right.order || left.nodeId.localeCompare(right.nodeId)));
|
|
11325
|
+
const ordered = [];
|
|
11326
|
+
const append = (parentId) => {
|
|
11327
|
+
for (const node of children.get(parentId) ?? []) {
|
|
11328
|
+
ordered.push(node);
|
|
11329
|
+
append(node.nodeId);
|
|
11330
|
+
}
|
|
11331
|
+
};
|
|
11332
|
+
append("");
|
|
11333
|
+
return ordered;
|
|
11334
|
+
};
|
|
11335
|
+
var navigationDependencies = (navigation, release, compilerRevisionRef) => [
|
|
11336
|
+
...release.resolvedTargets.flatMap((target) => [
|
|
11337
|
+
{ role: target.targetRevisionRef.kind === "domain-command" ? "action" : target.targetRevisionRef.kind, revisionRef: target.targetRevisionRef },
|
|
11338
|
+
...target.releaseRevisionRef ? [{ role: target.releaseRevisionRef.kind, revisionRef: target.releaseRevisionRef }] : []
|
|
11339
|
+
]),
|
|
11340
|
+
{ role: "performance-budget", revisionRef: navigation.performanceBudgetRef },
|
|
11341
|
+
{ role: "observation-policy", revisionRef: navigation.observationPolicyRevisionRef },
|
|
11342
|
+
{ role: "compiler", revisionRef: compilerRevisionRef }
|
|
11343
|
+
];
|
|
11344
|
+
var compileNavigationRuntimeBundle = (input) => {
|
|
11345
|
+
const navigation = NavigationSchema.parse(input.navigation);
|
|
11346
|
+
const navigationRevisionRef = RevisionRefSchema.parse(input.navigationRevisionRef);
|
|
11347
|
+
const release = NavigationReleaseSchema.parse(input.release);
|
|
11348
|
+
const releaseRevisionRef = RevisionRefSchema.parse(input.releaseRevisionRef);
|
|
11349
|
+
const compilerRevisionRef = RevisionRefSchema.parse(input.compilerRevisionRef);
|
|
11350
|
+
const scope = TenantScopeSchema.parse(navigation.tenantScope);
|
|
11351
|
+
assertSameTenantScope(release.tenantScope, scope, "release.tenantScope");
|
|
11352
|
+
if (navigation.nodes.length > input.limits.maxNavigationNodes) throw new DeclarativeControlCompilationError("NAV_NODE_LIMIT_EXCEEDED", "navigation.nodes", "Navigation exceeds the caller-approved node limit.");
|
|
11353
|
+
if (navigationDepth(navigation) > input.limits.maxNavigationDepth) throw new DeclarativeControlCompilationError("NAV_DEPTH_EXCEEDED", "navigation.nodes", "Navigation exceeds the caller-approved depth limit.");
|
|
11354
|
+
assertRevisionIdentity(navigationRevisionRef, "navigation", navigation.navigationId, scope, "navigationRevisionRef");
|
|
11355
|
+
assertRevisionIdentity(release.navigationRevisionRef, "navigation", navigation.navigationId, scope, "release.navigationRevisionRef");
|
|
11356
|
+
if (!sameRevisionRef(navigationRevisionRef, release.navigationRevisionRef)) throw new DeclarativeControlCompilationError("REVISION_MISMATCH", "release.navigationRevisionRef", "Release does not pin the supplied Navigation revision.");
|
|
11357
|
+
assertRevisionIdentity(releaseRevisionRef, "navigation-release", release.releaseSlotId, scope, "releaseRevisionRef");
|
|
11358
|
+
if (release.target.surface !== navigation.supportedSurfaces.find((surface) => surface === release.target.surface) || !navigation.placements.includes(release.target.placement)) {
|
|
11359
|
+
throw new DeclarativeControlCompilationError("REVISION_MISMATCH", "release.target", "Navigation release target is not declared by the Navigation record.");
|
|
11360
|
+
}
|
|
11361
|
+
requireReleaseReady(release);
|
|
11362
|
+
requireDependencies(release.dependencySnapshot, navigationDependencies(navigation, release, compilerRevisionRef));
|
|
11363
|
+
assertDependencyScopes(release.dependencySnapshot, scope);
|
|
11364
|
+
const targetRegistry = input.targetRegistry.map((registration, index) => {
|
|
11365
|
+
const common = {
|
|
11366
|
+
stableTargetRef: StableRefSchema.parse(registration.stableTargetRef),
|
|
11367
|
+
targetRevisionRef: RevisionRefSchema.parse(registration.targetRevisionRef),
|
|
11368
|
+
surface: ProductSurfaceSchema.parse(registration.surface),
|
|
11369
|
+
accessPolicy: AccessPolicySchema.parse(registration.accessPolicy)
|
|
11370
|
+
};
|
|
11371
|
+
if (registration.kind === "route") {
|
|
11372
|
+
const routeClaim = CompiledRouteClaimSchema.parse(registration.routeClaim);
|
|
11373
|
+
if (routeClaim.surface !== common.surface) {
|
|
11374
|
+
throw new DeclarativeControlCompilationError("ROUTE_SPACE_MISMATCH", `targetRegistry[${index}].routeClaim.surface`, "Navigation route claim must match its registered surface.");
|
|
11375
|
+
}
|
|
11376
|
+
return {
|
|
11377
|
+
...common,
|
|
11378
|
+
kind: "route",
|
|
11379
|
+
releaseRevisionRef: registration.releaseRevisionRef ? RevisionRefSchema.parse(registration.releaseRevisionRef) : void 0,
|
|
11380
|
+
routeClaim
|
|
11381
|
+
};
|
|
11382
|
+
}
|
|
11383
|
+
if (registration.kind === "registered-menu-action") {
|
|
11384
|
+
const sourceCatalogRevisionRef = RevisionRefSchema.parse(registration.sourceCatalogRevisionRef);
|
|
11385
|
+
if (sourceCatalogRevisionRef.kind !== "application-menu-catalog" || registration.targetRevisionRef.kind !== "menu-action") {
|
|
11386
|
+
throw new DeclarativeControlCompilationError("NAV_TARGET_UNRELEASED", "targetRegistry", "Registered Menu Actions require exact menu-action and application-menu-catalog revisions.");
|
|
11387
|
+
}
|
|
11388
|
+
if (registration.inputSchemaRef && !registration.validateInput) {
|
|
11389
|
+
throw new DeclarativeControlCompilationError("NAV_TARGET_UNRELEASED", "targetRegistry", "Registered Menu Actions with input schemas require the active catalog validator.");
|
|
11390
|
+
}
|
|
11391
|
+
return { ...common, kind: "registered-menu-action", applicationId: registration.applicationId, actionRef: registration.actionRef, inputSchemaRef: registration.inputSchemaRef, validateInput: registration.validateInput, sourceCatalogRevisionRef };
|
|
11392
|
+
}
|
|
11393
|
+
if (registration.targetRevisionRef.kind !== "domain-command") {
|
|
11394
|
+
throw new DeclarativeControlCompilationError("NAV_TARGET_UNRELEASED", "targetRegistry", "Governed DomainCommand actions require an exact domain-command revision.");
|
|
11395
|
+
}
|
|
11396
|
+
const inputSchemaRevisionRef = RevisionRefSchema.parse(registration.inputSchemaRevisionRef);
|
|
11397
|
+
const resultSchemaRevisionRef = registration.resultSchemaRevisionRef ? RevisionRefSchema.parse(registration.resultSchemaRevisionRef) : void 0;
|
|
11398
|
+
if (inputSchemaRevisionRef.kind !== "schema" || resultSchemaRevisionRef && resultSchemaRevisionRef.kind !== "schema") {
|
|
11399
|
+
throw new DeclarativeControlCompilationError("NAV_TARGET_UNRELEASED", "targetRegistry", "Governed DomainCommand actions require exact input and output Schema revisions.");
|
|
11400
|
+
}
|
|
11401
|
+
return { ...common, kind: "governed-domain-command", inputSchemaRevisionRef, resultSchemaRevisionRef };
|
|
11402
|
+
});
|
|
11403
|
+
assertUniqueRegistryKeys(targetRegistry.map((registration) => stableRefKey(registration.stableTargetRef)), "targetRegistry");
|
|
11404
|
+
const targetsByStableRef = new Map(targetRegistry.map((registration) => [stableRefKey(registration.stableTargetRef), registration]));
|
|
11405
|
+
const releasedByNodeId = new Map(release.resolvedTargets.map((target) => [target.nodeId, target]));
|
|
11406
|
+
const nodesById = new Map(navigation.nodes.map((node) => [node.nodeId, node]));
|
|
11407
|
+
const nodes = orderedNavigationNodes(navigation).map((node, index) => {
|
|
11408
|
+
const ancestors = [];
|
|
11409
|
+
let parentId = node.parentNodeId;
|
|
11410
|
+
while (parentId) {
|
|
11411
|
+
const parent = nodesById.get(parentId);
|
|
11412
|
+
if (parent?.kind === "group") ancestors.unshift(parent.audience);
|
|
11413
|
+
parentId = parent?.parentNodeId ?? null;
|
|
11414
|
+
}
|
|
11415
|
+
if (node.kind !== "target") return { ...node, ancestorAccessPolicies: ancestors };
|
|
11416
|
+
if (!["page", "workbench", "menu-action", "domain-command"].includes(node.targetRef.kind)) {
|
|
11417
|
+
throw new DeclarativeControlCompilationError("NAV_TARGET_UNRELEASED", `nodes[${index}].targetRef.kind`, "Navigation targets may reference only Page, Workbench, registered Menu Action, or DomainCommand identities.");
|
|
11418
|
+
}
|
|
11419
|
+
const registration = targetsByStableRef.get(stableRefKey(node.targetRef));
|
|
11420
|
+
const released = releasedByNodeId.get(node.nodeId);
|
|
11421
|
+
if (!registration || !released || !sameStableRef(registration.stableTargetRef, stableFromRevision(registration.targetRevisionRef)) || !sameStableRef(registration.stableTargetRef, released.stableTargetRef) || !sameRevisionRef(registration.targetRevisionRef, released.targetRevisionRef) || registration.kind === "route" && (Boolean(registration.releaseRevisionRef) !== Boolean(released.releaseRevisionRef) || registration.releaseRevisionRef && released.releaseRevisionRef && !sameRevisionRef(registration.releaseRevisionRef, released.releaseRevisionRef))) {
|
|
11422
|
+
throw new DeclarativeControlCompilationError("NAV_TARGET_UNRELEASED", `nodes[${index}].targetRef`, "Navigation target is not resolved to the exact active release recorded by NavigationRelease.");
|
|
11423
|
+
}
|
|
11424
|
+
if (registration.surface !== release.target.surface) {
|
|
11425
|
+
throw new DeclarativeControlCompilationError("NAV_TARGET_UNRELEASED", `nodes[${index}].targetRef`, "Navigation target is active on another surface.");
|
|
11426
|
+
}
|
|
11427
|
+
assertTenantCompatible(registration.targetRevisionRef, scope, `nodes[${index}].targetRef`);
|
|
11428
|
+
if (!accessPolicyChainImplies([...ancestors, node.audience], registration.accessPolicy)) {
|
|
11429
|
+
throw new DeclarativeControlCompilationError("AUDIENCE_WIDER_THAN_TARGET", `nodes[${index}].audience`, "Effective Navigation audience is wider than the target audience.");
|
|
11430
|
+
}
|
|
11431
|
+
const mappedInput = Object.fromEntries(Object.entries(node.parameterMapping).map(([name, source]) => {
|
|
11432
|
+
if (source.kind !== "constant") {
|
|
11433
|
+
throw new DeclarativeControlCompilationError("NAV_TARGET_UNRELEASED", `nodes[${index}].parameterMapping.${name}`, "Navigation actions accept only publication-time constant input.");
|
|
11434
|
+
}
|
|
11435
|
+
return [name, source.value];
|
|
11436
|
+
}));
|
|
11437
|
+
let resolvedTarget;
|
|
11438
|
+
if (registration.kind === "route") {
|
|
11439
|
+
resolvedTarget = { ...released, kind: "route", accessPolicy: registration.accessPolicy, routeClaim: registration.routeClaim };
|
|
11440
|
+
} else if (registration.kind === "registered-menu-action") {
|
|
11441
|
+
if (!registration.inputSchemaRef && Object.keys(mappedInput).length > 0) {
|
|
11442
|
+
throw new DeclarativeControlCompilationError("NAV_TARGET_UNRELEASED", `nodes[${index}].parameterMapping`, "The registered Menu Action does not accept input.");
|
|
11443
|
+
}
|
|
11444
|
+
let input2;
|
|
11445
|
+
try {
|
|
11446
|
+
input2 = JsonObjectSchema.parse(registration.validateInput ? registration.validateInput(mappedInput) : mappedInput);
|
|
11447
|
+
} catch (error) {
|
|
11448
|
+
throw new DeclarativeControlCompilationError(
|
|
11449
|
+
"NAV_ACTION_INPUT_INVALID",
|
|
11450
|
+
`nodes[${index}].parameterMapping`,
|
|
11451
|
+
`Registered Menu Action input failed its active catalog schema: ${error instanceof Error ? error.message : String(error)}`
|
|
11452
|
+
);
|
|
11453
|
+
}
|
|
11454
|
+
const sourceDependency = release.dependencySnapshot.find((dependency) => dependency.role === "application-menu-catalog" && sameRevisionRef(dependency.revisionRef, registration.sourceCatalogRevisionRef));
|
|
11455
|
+
if (!sourceDependency) throw new DeclarativeControlCompilationError("DEPENDENCY_MISSING", `nodes[${index}].targetRef`, "Registered Menu Action source catalog is not pinned by NavigationRelease.");
|
|
11456
|
+
resolvedTarget = {
|
|
11457
|
+
...released,
|
|
11458
|
+
kind: "registered-menu-action",
|
|
11459
|
+
accessPolicy: registration.accessPolicy,
|
|
11460
|
+
execution: "client",
|
|
11461
|
+
applicationId: registration.applicationId,
|
|
11462
|
+
actionRef: registration.actionRef,
|
|
11463
|
+
...registration.inputSchemaRef ? { inputSchemaRef: registration.inputSchemaRef } : {},
|
|
11464
|
+
input: input2,
|
|
11465
|
+
sourceCatalogRevisionRef: registration.sourceCatalogRevisionRef
|
|
11466
|
+
};
|
|
11467
|
+
} else {
|
|
11468
|
+
const inputDependency = release.dependencySnapshot.find(
|
|
11469
|
+
(dependency) => dependency.role === "schema" && sameRevisionRef(dependency.revisionRef, registration.inputSchemaRevisionRef)
|
|
11470
|
+
);
|
|
11471
|
+
const resultDependency = registration.resultSchemaRevisionRef ? release.dependencySnapshot.find(
|
|
11472
|
+
(dependency) => dependency.role === "schema" && sameRevisionRef(dependency.revisionRef, registration.resultSchemaRevisionRef)
|
|
11473
|
+
) : void 0;
|
|
11474
|
+
if (!inputDependency || registration.resultSchemaRevisionRef && !resultDependency) {
|
|
11475
|
+
throw new DeclarativeControlCompilationError("DEPENDENCY_MISSING", `nodes[${index}].targetRef`, "Governed DomainCommand schemas are not pinned by NavigationRelease.");
|
|
11476
|
+
}
|
|
11477
|
+
resolvedTarget = {
|
|
11478
|
+
...released,
|
|
11479
|
+
kind: "governed-domain-command",
|
|
11480
|
+
accessPolicy: registration.accessPolicy,
|
|
11481
|
+
execution: "server",
|
|
11482
|
+
commandRevisionRef: registration.targetRevisionRef,
|
|
11483
|
+
inputSchemaRevisionRef: registration.inputSchemaRevisionRef,
|
|
11484
|
+
...registration.resultSchemaRevisionRef ? { resultSchemaRevisionRef: registration.resultSchemaRevisionRef } : {},
|
|
11485
|
+
input: JsonObjectSchema.parse(mappedInput)
|
|
11486
|
+
};
|
|
9657
11487
|
}
|
|
9658
11488
|
return {
|
|
9659
|
-
|
|
9660
|
-
|
|
9661
|
-
|
|
9662
|
-
})(),
|
|
9663
|
-
affectedRefs: Array.from(affected).sort().map((key) => refs.get(key)),
|
|
9664
|
-
reasons: affected.size ? ["dependency"] : ["direct-change"]
|
|
11489
|
+
...node,
|
|
11490
|
+
ancestorAccessPolicies: ancestors,
|
|
11491
|
+
resolvedTarget
|
|
9665
11492
|
};
|
|
9666
11493
|
});
|
|
9667
|
-
|
|
9668
|
-
contract: "
|
|
9669
|
-
|
|
9670
|
-
|
|
9671
|
-
|
|
9672
|
-
|
|
9673
|
-
|
|
11494
|
+
const unsigned = {
|
|
11495
|
+
contract: "NavigationRuntimeBundle",
|
|
11496
|
+
schemaVersion: 1,
|
|
11497
|
+
tenantScope: scope,
|
|
11498
|
+
releaseRevisionRef,
|
|
11499
|
+
compilerRevisionRef,
|
|
11500
|
+
generation: input.generation,
|
|
11501
|
+
dependencySnapshot: release.dependencySnapshot,
|
|
11502
|
+
rebuildable: true,
|
|
11503
|
+
diagnostics: [],
|
|
11504
|
+
navigationId: navigation.navigationId,
|
|
11505
|
+
navigationRevisionRef,
|
|
11506
|
+
surface: release.target.surface,
|
|
11507
|
+
placement: release.target.placement,
|
|
11508
|
+
nodes,
|
|
11509
|
+
performanceBudgetRef: navigation.performanceBudgetRef,
|
|
11510
|
+
observationPolicyRevisionRef: navigation.observationPolicyRevisionRef
|
|
11511
|
+
};
|
|
11512
|
+
return deepFreeze(NavigationRuntimeBundleSchema.parse({ ...unsigned, contentHash: canonicalContentHash(unsigned) }));
|
|
11513
|
+
};
|
|
11514
|
+
var validateWorkbenchRuntimeSet = (bundleInputs) => {
|
|
11515
|
+
const bundles = bundleInputs.map((bundle) => WorkbenchRuntimeBundleSchema.parse(bundle));
|
|
11516
|
+
if (bundles.length === 0) {
|
|
11517
|
+
throw new DeclarativeControlCompilationError("WORKBENCH_RELEASE_SET_INVALID", "bundles", "An active Workbench release set must retain at least one Workbench.");
|
|
11518
|
+
}
|
|
11519
|
+
const first = bundles[0];
|
|
11520
|
+
const seenIds = /* @__PURE__ */ new Set();
|
|
11521
|
+
const seenOrders = /* @__PURE__ */ new Set();
|
|
11522
|
+
let defaultCount = 0;
|
|
11523
|
+
bundles.forEach((bundle, index) => {
|
|
11524
|
+
if (scopeKey(bundle.tenantScope) !== scopeKey(first.tenantScope) || bundle.surface !== first.surface || !sameStableRef(bundle.target.environmentRef, first.target.environmentRef)) {
|
|
11525
|
+
throw new DeclarativeControlCompilationError("WORKBENCH_RELEASE_SET_INVALID", `bundles[${index}]`, "Workbench release set entries must share tenant, environment, and surface.");
|
|
11526
|
+
}
|
|
11527
|
+
if (seenIds.has(bundle.workbenchId)) throw new DeclarativeControlCompilationError("WORKBENCH_RELEASE_SET_INVALID", `bundles[${index}].workbenchId`, "Workbench identities must be unique in an active release set.");
|
|
11528
|
+
if (seenOrders.has(bundle.target.order)) throw new DeclarativeControlCompilationError("WORKBENCH_RELEASE_SET_INVALID", `bundles[${index}].target.order`, "Workbench order values must be unique in an active release set.");
|
|
11529
|
+
seenIds.add(bundle.workbenchId);
|
|
11530
|
+
seenOrders.add(bundle.target.order);
|
|
11531
|
+
if (bundle.target.isDefaultCandidate) defaultCount += 1;
|
|
9674
11532
|
});
|
|
11533
|
+
if (defaultCount > 1) throw new DeclarativeControlCompilationError("WORKBENCH_RELEASE_SET_INVALID", "bundles", "An active Workbench release set may have at most one default candidate.");
|
|
11534
|
+
return Object.freeze([...bundles].sort((left, right) => left.target.order - right.target.order || left.workbenchId.localeCompare(right.workbenchId)));
|
|
11535
|
+
};
|
|
11536
|
+
var resolveWorkbenchEntry = (input) => {
|
|
11537
|
+
if (input.requestedWorkbenchId) {
|
|
11538
|
+
const requested = input.bundles.find((bundle) => bundle.workbenchId === input.requestedWorkbenchId);
|
|
11539
|
+
if (!requested) return { status: "not-found", workbenchId: input.requestedWorkbenchId };
|
|
11540
|
+
if (!input.isAllowed(requested)) return { status: "forbidden", workbenchId: input.requestedWorkbenchId };
|
|
11541
|
+
return { status: "resolved", bundle: requested, source: "explicit" };
|
|
11542
|
+
}
|
|
11543
|
+
const allowed = input.bundles.filter(input.isAllowed).sort((left, right) => left.target.order - right.target.order || left.workbenchId.localeCompare(right.workbenchId));
|
|
11544
|
+
const defaultBundle = allowed.find((bundle) => bundle.target.isDefaultCandidate);
|
|
11545
|
+
if (defaultBundle) return { status: "resolved", bundle: defaultBundle, source: "default" };
|
|
11546
|
+
if (allowed[0]) return { status: "resolved", bundle: allowed[0], source: "first-accessible" };
|
|
11547
|
+
return { status: "forbidden", workbenchId: "" };
|
|
9675
11548
|
};
|
|
9676
11549
|
|
|
9677
11550
|
// src/runtime/menu-compiler.ts
|
|
@@ -9688,19 +11561,19 @@ var pageKey = (page) => `${page.applicationId}\0${page.pageId}`;
|
|
|
9688
11561
|
var targetKey = (page, activationId) => `${page.applicationId}\0${page.pageId}\0${activationId}`;
|
|
9689
11562
|
var actionKey = (applicationId, actionRef) => `${applicationId}\0${actionRef}`;
|
|
9690
11563
|
var providerKey = (applicationId, providerId) => `${applicationId}\0${providerId}`;
|
|
9691
|
-
var
|
|
11564
|
+
var stableSerialize2 = (value) => {
|
|
9692
11565
|
if (value === void 0) return "null";
|
|
9693
11566
|
if (value === null || typeof value !== "object") return JSON.stringify(value) ?? "null";
|
|
9694
|
-
if (Array.isArray(value)) return `[${value.map((item) =>
|
|
11567
|
+
if (Array.isArray(value)) return `[${value.map((item) => stableSerialize2(item)).join(",")}]`;
|
|
9695
11568
|
const record = value;
|
|
9696
|
-
return `{${Object.keys(record).filter((key) => record[key] !== void 0).sort().map((key) => `${JSON.stringify(key)}:${
|
|
11569
|
+
return `{${Object.keys(record).filter((key) => record[key] !== void 0).sort().map((key) => `${JSON.stringify(key)}:${stableSerialize2(record[key])}`).join(",")}}`;
|
|
9697
11570
|
};
|
|
9698
|
-
var
|
|
11571
|
+
var deepFreeze2 = (value) => {
|
|
9699
11572
|
if (value === null || typeof value !== "object" || Object.isFrozen(value)) return value;
|
|
9700
|
-
Object.values(value).forEach((child) =>
|
|
11573
|
+
Object.values(value).forEach((child) => deepFreeze2(child));
|
|
9701
11574
|
return Object.freeze(value);
|
|
9702
11575
|
};
|
|
9703
|
-
var
|
|
11576
|
+
var SHA256_INITIAL2 = [
|
|
9704
11577
|
1779033703,
|
|
9705
11578
|
3144134277,
|
|
9706
11579
|
1013904242,
|
|
@@ -9710,7 +11583,7 @@ var SHA256_INITIAL = [
|
|
|
9710
11583
|
528734635,
|
|
9711
11584
|
1541459225
|
|
9712
11585
|
];
|
|
9713
|
-
var
|
|
11586
|
+
var SHA256_ROUND2 = [
|
|
9714
11587
|
1116352408,
|
|
9715
11588
|
1899447441,
|
|
9716
11589
|
3049323471,
|
|
@@ -9776,8 +11649,8 @@ var SHA256_ROUND = [
|
|
|
9776
11649
|
3204031479,
|
|
9777
11650
|
3329325298
|
|
9778
11651
|
];
|
|
9779
|
-
var
|
|
9780
|
-
var
|
|
11652
|
+
var rotateRight2 = (value, amount) => value >>> amount | value << 32 - amount;
|
|
11653
|
+
var sha256Hex2 = (value) => {
|
|
9781
11654
|
const source = [...new TextEncoder().encode(value)];
|
|
9782
11655
|
const bitLength = source.length * 8;
|
|
9783
11656
|
source.push(128);
|
|
@@ -9786,7 +11659,7 @@ var sha256Hex = (value) => {
|
|
|
9786
11659
|
const low = bitLength >>> 0;
|
|
9787
11660
|
for (let shift = 24; shift >= 0; shift -= 8) source.push(high >>> shift & 255);
|
|
9788
11661
|
for (let shift = 24; shift >= 0; shift -= 8) source.push(low >>> shift & 255);
|
|
9789
|
-
const hash = [...
|
|
11662
|
+
const hash = [...SHA256_INITIAL2];
|
|
9790
11663
|
const words = new Array(64).fill(0);
|
|
9791
11664
|
for (let offset = 0; offset < source.length; offset += 64) {
|
|
9792
11665
|
for (let index = 0; index < 16; index += 1) {
|
|
@@ -9796,16 +11669,16 @@ var sha256Hex = (value) => {
|
|
|
9796
11669
|
for (let index = 16; index < 64; index += 1) {
|
|
9797
11670
|
const previous = words[index - 15];
|
|
9798
11671
|
const recent = words[index - 2];
|
|
9799
|
-
const small0 =
|
|
9800
|
-
const small1 =
|
|
11672
|
+
const small0 = rotateRight2(previous, 7) ^ rotateRight2(previous, 18) ^ previous >>> 3;
|
|
11673
|
+
const small1 = rotateRight2(recent, 17) ^ rotateRight2(recent, 19) ^ recent >>> 10;
|
|
9801
11674
|
words[index] = words[index - 16] + small0 + words[index - 7] + small1 >>> 0;
|
|
9802
11675
|
}
|
|
9803
11676
|
let [a, b, c, d, e, f, g, h] = hash;
|
|
9804
11677
|
for (let index = 0; index < 64; index += 1) {
|
|
9805
|
-
const big1 =
|
|
11678
|
+
const big1 = rotateRight2(e, 6) ^ rotateRight2(e, 11) ^ rotateRight2(e, 25);
|
|
9806
11679
|
const choice = e & f ^ ~e & g;
|
|
9807
|
-
const temp1 = h + big1 + choice +
|
|
9808
|
-
const big0 =
|
|
11680
|
+
const temp1 = h + big1 + choice + SHA256_ROUND2[index] + words[index] >>> 0;
|
|
11681
|
+
const big0 = rotateRight2(a, 2) ^ rotateRight2(a, 13) ^ rotateRight2(a, 22);
|
|
9809
11682
|
const majority = a & b ^ a & c ^ b & c;
|
|
9810
11683
|
const temp2 = big0 + majority >>> 0;
|
|
9811
11684
|
h = g;
|
|
@@ -10033,10 +11906,10 @@ var compileMenuRuntimeBundle = (input) => {
|
|
|
10033
11906
|
normalizedSourceInput = { exposure: node.behavior.input.exposure, value: normalized };
|
|
10034
11907
|
runtimeInput = node.behavior.input.exposure === "client" ? { exposure: "client", value: normalized } : { exposure: "server" };
|
|
10035
11908
|
if (node.behavior.input.exposure === "server" && definition.applicationId === applicationId) {
|
|
10036
|
-
serverInputByTargetKey.set(identity,
|
|
11909
|
+
serverInputByTargetKey.set(identity, deepFreeze2(normalized));
|
|
10037
11910
|
}
|
|
10038
11911
|
}
|
|
10039
|
-
const signature =
|
|
11912
|
+
const signature = stableSerialize2({
|
|
10040
11913
|
kind: "navigate",
|
|
10041
11914
|
page: node.behavior.page,
|
|
10042
11915
|
activationId,
|
|
@@ -10144,7 +12017,7 @@ var compileMenuRuntimeBundle = (input) => {
|
|
|
10144
12017
|
};
|
|
10145
12018
|
const document = MenuRuntimeBundleSchema.parse({
|
|
10146
12019
|
...unsignedDocument,
|
|
10147
|
-
contentHash:
|
|
12020
|
+
contentHash: sha256Hex2(stableSerialize2(unsignedDocument))
|
|
10148
12021
|
});
|
|
10149
12022
|
const menusByKey = new Map(document.menus.map((menu) => [
|
|
10150
12023
|
menuKey(menu.applicationId, menu.surface, menu.menuId),
|
|
@@ -10171,7 +12044,7 @@ var compileMenuRuntimeBundle = (input) => {
|
|
|
10171
12044
|
return target ? Object.freeze({ status: "resolved", target }) : Object.freeze({ status: "unmatched" });
|
|
10172
12045
|
};
|
|
10173
12046
|
return Object.freeze({
|
|
10174
|
-
document:
|
|
12047
|
+
document: deepFreeze2(document),
|
|
10175
12048
|
menusByKey,
|
|
10176
12049
|
navigationTargetsByKey: documentTargetsByKey,
|
|
10177
12050
|
serverInputByTargetKey,
|
|
@@ -10586,83 +12459,11 @@ var buildApplicationHandoffUrl = (targetPath, handoff) => {
|
|
|
10586
12459
|
return isRelative ? `${url.pathname}${url.search}${url.hash}` : url.toString();
|
|
10587
12460
|
};
|
|
10588
12461
|
|
|
10589
|
-
// src/runtime/render-tree-compiler.ts
|
|
10590
|
-
var compileRenderTree = (input) => {
|
|
10591
|
-
const tree = RenderTreeSchema.parse(input);
|
|
10592
|
-
const nodesById = /* @__PURE__ */ new Map();
|
|
10593
|
-
for (const node of tree.nodes) {
|
|
10594
|
-
if (nodesById.has(node.nodeId)) throw new Error(`Duplicate render node id: ${node.nodeId}`);
|
|
10595
|
-
nodesById.set(node.nodeId, node);
|
|
10596
|
-
}
|
|
10597
|
-
const root = nodesById.get(tree.rootNodeId);
|
|
10598
|
-
if (!root) throw new Error(`Render tree ${tree.treeId} has no root node ${tree.rootNodeId}.`);
|
|
10599
|
-
if (root.parentNodeId !== void 0) throw new Error(`Render tree root ${root.nodeId} cannot declare a parent.`);
|
|
10600
|
-
for (const node of tree.nodes) {
|
|
10601
|
-
if (node.nodeId !== root.nodeId && node.parentNodeId === void 0) {
|
|
10602
|
-
throw new Error(`Render node ${node.nodeId} is disconnected from root ${root.nodeId}.`);
|
|
10603
|
-
}
|
|
10604
|
-
if (node.parentNodeId !== void 0) {
|
|
10605
|
-
const parent = nodesById.get(node.parentNodeId);
|
|
10606
|
-
if (!parent) throw new Error(`Render node ${node.nodeId} references missing parent ${node.parentNodeId}.`);
|
|
10607
|
-
if (!parent.children.includes(node.nodeId)) {
|
|
10608
|
-
throw new Error(`Render node ${node.nodeId} is not declared by parent ${parent.nodeId}.`);
|
|
10609
|
-
}
|
|
10610
|
-
}
|
|
10611
|
-
for (const childId of node.children) {
|
|
10612
|
-
const child = nodesById.get(childId);
|
|
10613
|
-
if (!child) throw new Error(`Render node ${node.nodeId} references missing child ${childId}.`);
|
|
10614
|
-
if (child.parentNodeId !== node.nodeId) {
|
|
10615
|
-
throw new Error(`Render child ${childId} does not point back to parent ${node.nodeId}.`);
|
|
10616
|
-
}
|
|
10617
|
-
}
|
|
10618
|
-
}
|
|
10619
|
-
const visiting = /* @__PURE__ */ new Set();
|
|
10620
|
-
const visited = /* @__PURE__ */ new Set();
|
|
10621
|
-
const traversal = [];
|
|
10622
|
-
const visit = (node) => {
|
|
10623
|
-
if (visiting.has(node.nodeId)) throw new Error(`Render tree ${tree.treeId} contains a cycle at ${node.nodeId}.`);
|
|
10624
|
-
if (visited.has(node.nodeId)) return;
|
|
10625
|
-
visiting.add(node.nodeId);
|
|
10626
|
-
traversal.push(node);
|
|
10627
|
-
node.children.forEach((childId) => visit(nodesById.get(childId)));
|
|
10628
|
-
visiting.delete(node.nodeId);
|
|
10629
|
-
visited.add(node.nodeId);
|
|
10630
|
-
};
|
|
10631
|
-
visit(root);
|
|
10632
|
-
if (visited.size !== nodesById.size) {
|
|
10633
|
-
const disconnected = tree.nodes.find((node) => !visited.has(node.nodeId));
|
|
10634
|
-
throw new Error(`Render node ${disconnected.nodeId} is not reachable from root ${root.nodeId}.`);
|
|
10635
|
-
}
|
|
10636
|
-
const childrenOf = (nodeId) => {
|
|
10637
|
-
const node = nodesById.get(nodeId);
|
|
10638
|
-
if (!node) throw new Error(`Unknown render node: ${nodeId}`);
|
|
10639
|
-
return Object.freeze(node.children.map((childId) => nodesById.get(childId)));
|
|
10640
|
-
};
|
|
10641
|
-
const ancestorsOf = (nodeId) => {
|
|
10642
|
-
let node = nodesById.get(nodeId);
|
|
10643
|
-
if (!node) throw new Error(`Unknown render node: ${nodeId}`);
|
|
10644
|
-
const ancestors = [];
|
|
10645
|
-
while (node.parentNodeId !== void 0) {
|
|
10646
|
-
node = nodesById.get(node.parentNodeId);
|
|
10647
|
-
ancestors.push(node);
|
|
10648
|
-
}
|
|
10649
|
-
return Object.freeze(ancestors);
|
|
10650
|
-
};
|
|
10651
|
-
return Object.freeze({
|
|
10652
|
-
tree,
|
|
10653
|
-
root,
|
|
10654
|
-
nodesById,
|
|
10655
|
-
traversal: Object.freeze(traversal),
|
|
10656
|
-
childrenOf,
|
|
10657
|
-
ancestorsOf
|
|
10658
|
-
});
|
|
10659
|
-
};
|
|
10660
|
-
|
|
10661
12462
|
// src/contracts/tenant.ts
|
|
10662
|
-
import { z as
|
|
12463
|
+
import { z as z12 } from "zod";
|
|
10663
12464
|
|
|
10664
12465
|
// src/contracts/theme.ts
|
|
10665
|
-
import { z as
|
|
12466
|
+
import { z as z11 } from "zod";
|
|
10666
12467
|
|
|
10667
12468
|
// src/theme-tokens/core.ts
|
|
10668
12469
|
var import_ajv = __toESM(require_ajv());
|
|
@@ -12889,20 +14690,20 @@ function assertMonkeysThemeTokensComplete(input) {
|
|
|
12889
14690
|
}
|
|
12890
14691
|
|
|
12891
14692
|
// src/contracts/theme.ts
|
|
12892
|
-
var ThemeTokenTypeSchema =
|
|
12893
|
-
var ThemeTokenSchema =
|
|
14693
|
+
var ThemeTokenTypeSchema = z11.enum(THEME_TOKEN_TYPES);
|
|
14694
|
+
var ThemeTokenSchema = z11.record(z11.string(), z11.unknown()).superRefine((input, context) => {
|
|
12894
14695
|
const issues = validateThemeTokensDocumentStructure({ token: input });
|
|
12895
14696
|
for (const issue of issues) {
|
|
12896
14697
|
context.addIssue({ code: "custom", message: `${issue.path} ${issue.message}` });
|
|
12897
14698
|
}
|
|
12898
14699
|
});
|
|
12899
|
-
var ThemeTokenGroupSchema =
|
|
14700
|
+
var ThemeTokenGroupSchema = z11.record(z11.string(), z11.unknown()).superRefine((input, context) => {
|
|
12900
14701
|
const issues = validateThemeTokensDocumentStructure(input);
|
|
12901
14702
|
for (const issue of issues) {
|
|
12902
14703
|
context.addIssue({ code: "custom", message: `${issue.path} ${issue.message}` });
|
|
12903
14704
|
}
|
|
12904
14705
|
});
|
|
12905
|
-
var ThemeTokensSchema =
|
|
14706
|
+
var ThemeTokensSchema = z11.record(z11.string(), z11.unknown()).superRefine((input, context) => {
|
|
12906
14707
|
const issues = validateThemeTokensDocument(input);
|
|
12907
14708
|
for (const issue of issues) {
|
|
12908
14709
|
context.addIssue({ code: "custom", message: `${issue.path} ${issue.message}` });
|
|
@@ -12929,9 +14730,9 @@ var ResolvedThemeTokensSchema = ThemeTokensSchema.superRefine((input, context) =
|
|
|
12929
14730
|
});
|
|
12930
14731
|
|
|
12931
14732
|
// src/contracts/tenant.ts
|
|
12932
|
-
var DesignTokenFileSourceSchema =
|
|
12933
|
-
type:
|
|
12934
|
-
path:
|
|
14733
|
+
var DesignTokenFileSourceSchema = z12.object({
|
|
14734
|
+
type: z12.literal("file"),
|
|
14735
|
+
path: z12.string().trim().min(1).superRefine((source, context) => {
|
|
12935
14736
|
const isWindowsDrivePath = /^[a-z]:[\\/]/i.test(source);
|
|
12936
14737
|
if (!isWindowsDrivePath && /^[a-z][a-z\d+.-]*:/i.test(source)) {
|
|
12937
14738
|
context.addIssue({
|
|
@@ -12941,9 +14742,9 @@ var DesignTokenFileSourceSchema = z11.object({
|
|
|
12941
14742
|
}
|
|
12942
14743
|
})
|
|
12943
14744
|
}).strict();
|
|
12944
|
-
var DesignTokenUrlSourceSchema =
|
|
12945
|
-
type:
|
|
12946
|
-
url:
|
|
14745
|
+
var DesignTokenUrlSourceSchema = z12.object({
|
|
14746
|
+
type: z12.literal("url"),
|
|
14747
|
+
url: z12.string().trim().min(1).superRefine((source, context) => {
|
|
12947
14748
|
if (!/^https?:\/\//i.test(source)) {
|
|
12948
14749
|
context.addIssue({
|
|
12949
14750
|
code: "custom",
|
|
@@ -12952,109 +14753,122 @@ var DesignTokenUrlSourceSchema = z11.object({
|
|
|
12952
14753
|
}
|
|
12953
14754
|
})
|
|
12954
14755
|
}).strict();
|
|
12955
|
-
var DesignTokenInlineSourceSchema =
|
|
12956
|
-
type:
|
|
14756
|
+
var DesignTokenInlineSourceSchema = z12.object({
|
|
14757
|
+
type: z12.literal("inline"),
|
|
12957
14758
|
document: ThemeTokensSchema
|
|
12958
14759
|
}).strict();
|
|
12959
|
-
var DesignTokenSourceSchema =
|
|
14760
|
+
var DesignTokenSourceSchema = z12.discriminatedUnion("type", [
|
|
12960
14761
|
DesignTokenFileSourceSchema,
|
|
12961
14762
|
DesignTokenUrlSourceSchema,
|
|
12962
14763
|
DesignTokenInlineSourceSchema
|
|
12963
14764
|
]);
|
|
12964
|
-
var TenantDesignTokensConfigSchema =
|
|
14765
|
+
var TenantDesignTokensConfigSchema = z12.object({
|
|
12965
14766
|
/** Ordered tenant overrides. The backend always applies the product default first. */
|
|
12966
|
-
tokenSources:
|
|
14767
|
+
tokenSources: z12.array(DesignTokenSourceSchema)
|
|
12967
14768
|
}).strict();
|
|
12968
|
-
var TenantAuthBindingSchema =
|
|
12969
|
-
kind:
|
|
14769
|
+
var TenantAuthBindingSchema = z12.object({
|
|
14770
|
+
kind: z12.literal("auth-provider"),
|
|
12970
14771
|
providerId: ContractIdentifierSchema,
|
|
12971
14772
|
policyRef: ContractIdentifierSchema.optional()
|
|
12972
14773
|
}).strict();
|
|
12973
|
-
var TenantDataBindingSchema =
|
|
12974
|
-
|
|
12975
|
-
kind:
|
|
14774
|
+
var TenantDataBindingSchema = z12.discriminatedUnion("kind", [
|
|
14775
|
+
z12.object({
|
|
14776
|
+
kind: z12.literal("data-provider"),
|
|
12976
14777
|
providerId: ContractIdentifierSchema,
|
|
12977
14778
|
domainRef: ContractIdentifierSchema.optional()
|
|
12978
14779
|
}).strict(),
|
|
12979
|
-
|
|
12980
|
-
kind:
|
|
14780
|
+
z12.object({
|
|
14781
|
+
kind: z12.literal("projection"),
|
|
12981
14782
|
projectionRef: ContractIdentifierSchema,
|
|
12982
14783
|
domainRef: ContractIdentifierSchema.optional()
|
|
12983
14784
|
}).strict()
|
|
12984
14785
|
]);
|
|
12985
|
-
var TenantAuthBindingsSchema =
|
|
14786
|
+
var TenantAuthBindingsSchema = z12.record(
|
|
12986
14787
|
ContractIdentifierSchema,
|
|
12987
14788
|
TenantAuthBindingSchema
|
|
12988
14789
|
);
|
|
12989
|
-
var TenantDataBindingsSchema =
|
|
14790
|
+
var TenantDataBindingsSchema = z12.record(
|
|
12990
14791
|
ContractIdentifierSchema,
|
|
12991
14792
|
TenantDataBindingSchema
|
|
12992
14793
|
);
|
|
12993
|
-
var TenantTrendRadarSourceSchema =
|
|
14794
|
+
var TenantTrendRadarSourceSchema = z12.object({
|
|
12994
14795
|
ontologyId: ContractIdentifierSchema,
|
|
12995
14796
|
viewId: ContractIdentifierSchema
|
|
12996
14797
|
}).strict();
|
|
12997
|
-
var TenantTrendRadarCollectionTargetSchema =
|
|
14798
|
+
var TenantTrendRadarCollectionTargetSchema = z12.object({
|
|
12998
14799
|
ontologyId: ContractIdentifierSchema
|
|
12999
14800
|
}).strict();
|
|
13000
|
-
var
|
|
14801
|
+
var TenantTrendRadarEvaluationSchema = z12.object({
|
|
14802
|
+
workflowId: ContractIdentifierSchema
|
|
14803
|
+
}).strict();
|
|
14804
|
+
var TenantTrendRadarDerivedMetricsSchema = z12.object({
|
|
14805
|
+
productCountFieldKey: ContractIdentifierSchema,
|
|
14806
|
+
salesValueCountFieldKey: ContractIdentifierSchema,
|
|
14807
|
+
salesSumFieldKey: ContractIdentifierSchema
|
|
14808
|
+
}).strict().refine(
|
|
14809
|
+
({ productCountFieldKey, salesValueCountFieldKey, salesSumFieldKey }) => (/* @__PURE__ */ new Set([productCountFieldKey, salesValueCountFieldKey, salesSumFieldKey])).size === 3,
|
|
14810
|
+
{ message: "Trend Radar derived metric Field Keys must be distinct." }
|
|
14811
|
+
);
|
|
14812
|
+
var TenantTrendRadarSourcesSchema = z12.object({
|
|
13001
14813
|
products: TenantTrendRadarSourceSchema.optional(),
|
|
13002
14814
|
hotwords: TenantTrendRadarSourceSchema.optional(),
|
|
13003
14815
|
brands: TenantTrendRadarSourceSchema.optional(),
|
|
13004
|
-
collection: TenantTrendRadarCollectionTargetSchema.optional()
|
|
14816
|
+
collection: TenantTrendRadarCollectionTargetSchema.optional(),
|
|
14817
|
+
derivedMetrics: TenantTrendRadarDerivedMetricsSchema.optional(),
|
|
14818
|
+
evaluation: TenantTrendRadarEvaluationSchema.optional()
|
|
13005
14819
|
}).strict();
|
|
13006
|
-
var AssetVariantsSchema =
|
|
13007
|
-
light:
|
|
13008
|
-
dark:
|
|
14820
|
+
var AssetVariantsSchema = z12.object({
|
|
14821
|
+
light: z12.string().optional(),
|
|
14822
|
+
dark: z12.string().optional()
|
|
13009
14823
|
}).strict();
|
|
13010
|
-
var TenantAgentThemeConfigSchema =
|
|
14824
|
+
var TenantAgentThemeConfigSchema = z12.object({
|
|
13011
14825
|
logo: AssetVariantsSchema.optional(),
|
|
13012
|
-
brandDisplayMode:
|
|
13013
|
-
density:
|
|
14826
|
+
brandDisplayMode: z12.enum(["auto", "logo-only", "logo-name", "name-only"]).optional(),
|
|
14827
|
+
density: z12.enum(["compact", "default", "comfortable"]).optional(),
|
|
13014
14828
|
sidebar: AgentWorkbenchSidebarConfigSchema.optional(),
|
|
13015
14829
|
/** @deprecated Use sidebar.navigationMode. */
|
|
13016
|
-
navigationMode:
|
|
14830
|
+
navigationMode: z12.enum(["default", "session", "trend"]).optional(),
|
|
13017
14831
|
/** @deprecated Use sidebar.quickStartEnabled. */
|
|
13018
|
-
quickStartEnabled:
|
|
14832
|
+
quickStartEnabled: z12.boolean().optional()
|
|
13019
14833
|
}).strict();
|
|
13020
14834
|
var LEGACY_CURRENT_USER_MENU_ITEM_IDS = ["dark-mode", "language", "settings", "logout"];
|
|
13021
14835
|
var CURRENT_USER_MENU_CONTROL_REFS = ["dark-mode", "language"];
|
|
13022
14836
|
var CURRENT_USER_MENU_ACTION_REFS = ["logout"];
|
|
13023
|
-
var CurrentUserMenuIdentifierSchema =
|
|
13024
|
-
var CurrentUserMenuDisplayTextSchema =
|
|
13025
|
-
|
|
13026
|
-
|
|
14837
|
+
var CurrentUserMenuIdentifierSchema = z12.string().trim().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/, "Expected a stable current-user menu identifier.");
|
|
14838
|
+
var CurrentUserMenuDisplayTextSchema = z12.union([
|
|
14839
|
+
z12.string().trim().min(1),
|
|
14840
|
+
z12.record(z12.string().trim().min(1), z12.string().trim().min(1)).refine((value) => Object.keys(value).length > 0, "Localized menu text must contain at least one locale.")
|
|
13027
14841
|
]);
|
|
13028
|
-
var CurrentUserMenuNavigationItemSchema =
|
|
14842
|
+
var CurrentUserMenuNavigationItemSchema = z12.object({
|
|
13029
14843
|
id: CurrentUserMenuIdentifierSchema,
|
|
13030
|
-
kind:
|
|
14844
|
+
kind: z12.literal("navigation"),
|
|
13031
14845
|
ref: CurrentUserMenuIdentifierSchema
|
|
13032
14846
|
}).strict();
|
|
13033
|
-
var CurrentUserMenuControlItemSchema =
|
|
14847
|
+
var CurrentUserMenuControlItemSchema = z12.object({
|
|
13034
14848
|
id: CurrentUserMenuIdentifierSchema,
|
|
13035
|
-
kind:
|
|
13036
|
-
ref:
|
|
14849
|
+
kind: z12.literal("control"),
|
|
14850
|
+
ref: z12.enum(CURRENT_USER_MENU_CONTROL_REFS)
|
|
13037
14851
|
}).strict();
|
|
13038
|
-
var CurrentUserMenuActionItemSchema =
|
|
14852
|
+
var CurrentUserMenuActionItemSchema = z12.object({
|
|
13039
14853
|
id: CurrentUserMenuIdentifierSchema,
|
|
13040
|
-
kind:
|
|
13041
|
-
ref:
|
|
13042
|
-
tone:
|
|
14854
|
+
kind: z12.literal("action"),
|
|
14855
|
+
ref: z12.enum(CURRENT_USER_MENU_ACTION_REFS),
|
|
14856
|
+
tone: z12.enum(["default", "danger"]).optional()
|
|
13043
14857
|
}).strict();
|
|
13044
|
-
var CurrentUserMenuItemSchema =
|
|
14858
|
+
var CurrentUserMenuItemSchema = z12.discriminatedUnion("kind", [
|
|
13045
14859
|
CurrentUserMenuNavigationItemSchema,
|
|
13046
14860
|
CurrentUserMenuControlItemSchema,
|
|
13047
14861
|
CurrentUserMenuActionItemSchema
|
|
13048
14862
|
]);
|
|
13049
|
-
var CurrentUserMenuSectionSchema =
|
|
14863
|
+
var CurrentUserMenuSectionSchema = z12.object({
|
|
13050
14864
|
id: CurrentUserMenuIdentifierSchema,
|
|
13051
14865
|
label: CurrentUserMenuDisplayTextSchema.optional(),
|
|
13052
|
-
dividerBefore:
|
|
13053
|
-
items:
|
|
14866
|
+
dividerBefore: z12.boolean().optional(),
|
|
14867
|
+
items: z12.array(CurrentUserMenuItemSchema)
|
|
13054
14868
|
}).strict();
|
|
13055
|
-
var CurrentUserMenuConfigSchema =
|
|
13056
|
-
version:
|
|
13057
|
-
sections:
|
|
14869
|
+
var CurrentUserMenuConfigSchema = z12.object({
|
|
14870
|
+
version: z12.literal(1),
|
|
14871
|
+
sections: z12.array(CurrentUserMenuSectionSchema).max(20)
|
|
13058
14872
|
}).strict().superRefine((value, context) => {
|
|
13059
14873
|
const sectionIds = /* @__PURE__ */ new Set();
|
|
13060
14874
|
const itemIds = /* @__PURE__ */ new Set();
|
|
@@ -13088,7 +14902,7 @@ var CurrentUserMenuConfigSchema = z11.object({
|
|
|
13088
14902
|
});
|
|
13089
14903
|
}
|
|
13090
14904
|
});
|
|
13091
|
-
var LegacyCurrentUserMenuProfileSchema =
|
|
14905
|
+
var LegacyCurrentUserMenuProfileSchema = z12.array(z12.enum(LEGACY_CURRENT_USER_MENU_ITEM_IDS)).superRefine((value, context) => {
|
|
13092
14906
|
const seen = /* @__PURE__ */ new Set();
|
|
13093
14907
|
value.forEach((item, index) => {
|
|
13094
14908
|
if (seen.has(item)) {
|
|
@@ -13101,73 +14915,73 @@ var LegacyCurrentUserMenuProfileSchema = z11.array(z11.enum(LEGACY_CURRENT_USER_
|
|
|
13101
14915
|
seen.add(item);
|
|
13102
14916
|
});
|
|
13103
14917
|
});
|
|
13104
|
-
var CurrentUserMenuProfileSchema =
|
|
13105
|
-
|
|
14918
|
+
var CurrentUserMenuProfileSchema = z12.union([
|
|
14919
|
+
z12.literal("*"),
|
|
13106
14920
|
LegacyCurrentUserMenuProfileSchema,
|
|
13107
14921
|
CurrentUserMenuConfigSchema
|
|
13108
14922
|
]);
|
|
13109
|
-
var ThemeHeadbarSchema =
|
|
13110
|
-
theme:
|
|
13111
|
-
navPosition:
|
|
13112
|
-
actions:
|
|
14923
|
+
var ThemeHeadbarSchema = z12.object({
|
|
14924
|
+
theme: z12.enum(["card", "glassy", "ghost"]).optional(),
|
|
14925
|
+
navPosition: z12.enum(["left", "center", "right"]).optional(),
|
|
14926
|
+
actions: z12.union([z12.literal("*"), z12.array(ContractIdentifierSchema)]).optional(),
|
|
13113
14927
|
profile: CurrentUserMenuProfileSchema.optional(),
|
|
13114
|
-
showTeamQuota:
|
|
14928
|
+
showTeamQuota: z12.boolean().optional()
|
|
13115
14929
|
}).strict();
|
|
13116
|
-
var TenantHeadbarModuleLeafSchema =
|
|
14930
|
+
var TenantHeadbarModuleLeafSchema = z12.object({
|
|
13117
14931
|
id: ContractIdentifierSchema,
|
|
13118
|
-
extraInfo:
|
|
13119
|
-
displayName:
|
|
13120
|
-
visible:
|
|
13121
|
-
disabled:
|
|
13122
|
-
icon:
|
|
13123
|
-
showQuickSwitcher:
|
|
13124
|
-
showSidebar:
|
|
13125
|
-
showContentFrame:
|
|
14932
|
+
extraInfo: z12.boolean().optional(),
|
|
14933
|
+
displayName: z12.union([z12.string(), z12.record(LocaleIdentifierSchema, z12.string())]).optional(),
|
|
14934
|
+
visible: z12.boolean().optional(),
|
|
14935
|
+
disabled: z12.boolean().optional(),
|
|
14936
|
+
icon: z12.string().optional(),
|
|
14937
|
+
showQuickSwitcher: z12.boolean().optional(),
|
|
14938
|
+
showSidebar: z12.boolean().optional(),
|
|
14939
|
+
showContentFrame: z12.boolean().optional()
|
|
13126
14940
|
}).strict();
|
|
13127
14941
|
var TenantHeadbarModuleItemSchema = TenantHeadbarModuleLeafSchema.extend({
|
|
13128
|
-
children:
|
|
13129
|
-
}).strict();
|
|
13130
|
-
var KernelHeadbarSchema =
|
|
13131
|
-
theme:
|
|
13132
|
-
layoutMode:
|
|
13133
|
-
heightPx:
|
|
13134
|
-
navPosition:
|
|
13135
|
-
brandTitle:
|
|
13136
|
-
menuRadius:
|
|
13137
|
-
}).strict();
|
|
13138
|
-
var CustomIconSchema =
|
|
13139
|
-
color:
|
|
13140
|
-
url:
|
|
13141
|
-
type:
|
|
13142
|
-
hintTextColor:
|
|
13143
|
-
}).strict();
|
|
13144
|
-
var WorkbenchCustomerToolSchema =
|
|
14942
|
+
children: z12.array(TenantHeadbarModuleLeafSchema).optional()
|
|
14943
|
+
}).strict();
|
|
14944
|
+
var KernelHeadbarSchema = z12.object({
|
|
14945
|
+
theme: z12.literal("card").optional(),
|
|
14946
|
+
layoutMode: z12.enum(["boxed", "full-bleed"]).optional(),
|
|
14947
|
+
heightPx: z12.number().positive().optional(),
|
|
14948
|
+
navPosition: z12.enum(["left", "center", "right"]).optional(),
|
|
14949
|
+
brandTitle: z12.string().optional(),
|
|
14950
|
+
menuRadius: z12.enum(["default", "none", "sm", "md", "lg", "xl", "full"]).optional()
|
|
14951
|
+
}).strict();
|
|
14952
|
+
var CustomIconSchema = z12.object({
|
|
14953
|
+
color: z12.string().optional(),
|
|
14954
|
+
url: z12.string().optional(),
|
|
14955
|
+
type: z12.enum(["svg", "image"]).optional(),
|
|
14956
|
+
hintTextColor: z12.string().optional()
|
|
14957
|
+
}).strict();
|
|
14958
|
+
var WorkbenchCustomerToolSchema = z12.object({
|
|
13145
14959
|
id: ContractIdentifierSchema,
|
|
13146
|
-
label:
|
|
13147
|
-
fixed:
|
|
14960
|
+
label: z12.union([z12.string(), z12.record(LocaleIdentifierSchema, z12.string())]).optional(),
|
|
14961
|
+
fixed: z12.boolean().optional()
|
|
13148
14962
|
}).strict();
|
|
13149
|
-
var WorkbenchStudioOverrideSchema =
|
|
13150
|
-
studioName:
|
|
13151
|
-
dropdownToolsDefault:
|
|
13152
|
-
existingToolsDefault:
|
|
13153
|
-
historyColumnsDefault:
|
|
14963
|
+
var WorkbenchStudioOverrideSchema = z12.object({
|
|
14964
|
+
studioName: z12.string().trim().min(1),
|
|
14965
|
+
dropdownToolsDefault: z12.array(ContractIdentifierSchema).optional(),
|
|
14966
|
+
existingToolsDefault: z12.array(ContractIdentifierSchema).optional(),
|
|
14967
|
+
historyColumnsDefault: z12.number().int().min(1).max(6).optional()
|
|
13154
14968
|
}).strict();
|
|
13155
|
-
var TenantWorkbenchPageContextSchema =
|
|
14969
|
+
var TenantWorkbenchPageContextSchema = z12.object({
|
|
13156
14970
|
workflow: JsonObjectSchema.optional(),
|
|
13157
14971
|
agent: JsonObjectSchema.optional(),
|
|
13158
14972
|
agentId: ContractIdentifierSchema.optional(),
|
|
13159
14973
|
designProject: JsonObjectSchema.optional(),
|
|
13160
14974
|
designMetadataId: ContractIdentifierSchema.optional(),
|
|
13161
|
-
iframeUrl:
|
|
13162
|
-
info:
|
|
14975
|
+
iframeUrl: z12.string().trim().min(1).optional(),
|
|
14976
|
+
info: z12.object({
|
|
13163
14977
|
displayName: LocalizedTextSchema.optional(),
|
|
13164
14978
|
description: LocalizedTextSchema.optional(),
|
|
13165
|
-
iconUrl:
|
|
14979
|
+
iconUrl: z12.string().trim().min(1).optional()
|
|
13166
14980
|
}).strict().optional(),
|
|
13167
|
-
isBuiltinPinned:
|
|
13168
|
-
isBuiltinReadonly:
|
|
14981
|
+
isBuiltinPinned: z12.boolean().optional(),
|
|
14982
|
+
isBuiltinReadonly: z12.boolean().optional()
|
|
13169
14983
|
}).strict();
|
|
13170
|
-
var TenantWorkbenchPageEnvelopeSchema =
|
|
14984
|
+
var TenantWorkbenchPageEnvelopeSchema = z12.object({
|
|
13171
14985
|
definition: PageDefinitionSchema,
|
|
13172
14986
|
context: TenantWorkbenchPageContextSchema
|
|
13173
14987
|
}).strict().superRefine(({ definition }, context) => {
|
|
@@ -13200,56 +15014,56 @@ var TenantWorkbenchPageEnvelopeSchema = z11.object({
|
|
|
13200
15014
|
});
|
|
13201
15015
|
}
|
|
13202
15016
|
});
|
|
13203
|
-
var TenantWorkbenchPageGroupSchema =
|
|
15017
|
+
var TenantWorkbenchPageGroupSchema = z12.object({
|
|
13204
15018
|
id: ContractIdentifierSchema,
|
|
13205
|
-
pageIds:
|
|
15019
|
+
pageIds: z12.array(ContractIdentifierSchema),
|
|
13206
15020
|
displayName: LocalizedTextSchema,
|
|
13207
|
-
isBuiltIn:
|
|
13208
|
-
iconUrl:
|
|
13209
|
-
sortIndex:
|
|
15021
|
+
isBuiltIn: z12.boolean(),
|
|
15022
|
+
iconUrl: z12.string().optional(),
|
|
15023
|
+
sortIndex: z12.number().int().nullable().optional(),
|
|
13210
15024
|
presetRelationId: ContractIdentifierSchema.optional(),
|
|
13211
15025
|
relationKey: ContractIdentifierSchema.nullable().optional(),
|
|
13212
15026
|
studioId: ContractIdentifierSchema.optional()
|
|
13213
15027
|
}).strict();
|
|
13214
|
-
var TenantWorkbenchConfigSchema =
|
|
13215
|
-
pages:
|
|
13216
|
-
pageGroups:
|
|
13217
|
-
catalog:
|
|
13218
|
-
quickSwitcherMaxItems:
|
|
13219
|
-
defaultOrder:
|
|
13220
|
-
groups:
|
|
13221
|
-
pages:
|
|
15028
|
+
var TenantWorkbenchConfigSchema = z12.object({
|
|
15029
|
+
pages: z12.array(TenantWorkbenchPageEnvelopeSchema),
|
|
15030
|
+
pageGroups: z12.array(TenantWorkbenchPageGroupSchema),
|
|
15031
|
+
catalog: z12.object({ enabled: z12.boolean().optional(), defaultEntry: z12.boolean().optional() }).strict().optional(),
|
|
15032
|
+
quickSwitcherMaxItems: z12.number().int().nonnegative().optional(),
|
|
15033
|
+
defaultOrder: z12.object({
|
|
15034
|
+
groups: z12.array(ContractIdentifierSchema),
|
|
15035
|
+
pages: z12.record(ContractIdentifierSchema, z12.array(ContractIdentifierSchema))
|
|
13222
15036
|
}).strict().optional(),
|
|
13223
|
-
customers:
|
|
13224
|
-
dropdownToolsDefault:
|
|
13225
|
-
layoutManagerTools:
|
|
13226
|
-
studioTabsMode:
|
|
13227
|
-
historyWatermark:
|
|
13228
|
-
svgUrl:
|
|
13229
|
-
coverage:
|
|
13230
|
-
maxLongEdgeRatio:
|
|
13231
|
-
sizing:
|
|
15037
|
+
customers: z12.object({
|
|
15038
|
+
dropdownToolsDefault: z12.array(ContractIdentifierSchema).optional(),
|
|
15039
|
+
layoutManagerTools: z12.array(WorkbenchCustomerToolSchema).optional(),
|
|
15040
|
+
studioTabsMode: z12.enum(["dropdown", "tabs"]).optional(),
|
|
15041
|
+
historyWatermark: z12.object({
|
|
15042
|
+
svgUrl: z12.string().optional(),
|
|
15043
|
+
coverage: z12.array(z12.enum(["list", "detail", "download"])).optional(),
|
|
15044
|
+
maxLongEdgeRatio: z12.number().positive().optional(),
|
|
15045
|
+
sizing: z12.object({
|
|
13232
15046
|
mode: ContractIdentifierSchema,
|
|
13233
|
-
heightRatio:
|
|
13234
|
-
minHeightPx:
|
|
13235
|
-
maxHeightPx:
|
|
15047
|
+
heightRatio: z12.number().positive().optional(),
|
|
15048
|
+
minHeightPx: z12.number().nonnegative().optional(),
|
|
15049
|
+
maxHeightPx: z12.number().nonnegative().optional()
|
|
13236
15050
|
}).strict().optional(),
|
|
13237
|
-
enhance:
|
|
13238
|
-
enabled:
|
|
13239
|
-
backgroundLumaThreshold:
|
|
13240
|
-
stroke:
|
|
13241
|
-
color:
|
|
13242
|
-
opacity:
|
|
13243
|
-
widthRatio:
|
|
13244
|
-
blurRatio:
|
|
13245
|
-
steps:
|
|
15051
|
+
enhance: z12.object({
|
|
15052
|
+
enabled: z12.boolean().optional(),
|
|
15053
|
+
backgroundLumaThreshold: z12.number().min(0).max(1).optional(),
|
|
15054
|
+
stroke: z12.object({
|
|
15055
|
+
color: z12.string().optional(),
|
|
15056
|
+
opacity: z12.number().min(0).max(1).optional(),
|
|
15057
|
+
widthRatio: z12.number().nonnegative().optional(),
|
|
15058
|
+
blurRatio: z12.number().nonnegative().optional(),
|
|
15059
|
+
steps: z12.number().int().positive().optional()
|
|
13246
15060
|
}).strict().optional()
|
|
13247
15061
|
}).strict().optional()
|
|
13248
15062
|
}).strict().optional(),
|
|
13249
|
-
layoutManagerEnabled:
|
|
13250
|
-
existingToolsDefault:
|
|
13251
|
-
historyColumnsDefault:
|
|
13252
|
-
studioOverrides:
|
|
15063
|
+
layoutManagerEnabled: z12.boolean().optional(),
|
|
15064
|
+
existingToolsDefault: z12.array(ContractIdentifierSchema).optional(),
|
|
15065
|
+
historyColumnsDefault: z12.number().int().min(1).max(6).optional(),
|
|
15066
|
+
studioOverrides: z12.array(WorkbenchStudioOverrideSchema).optional()
|
|
13253
15067
|
}).strict().optional()
|
|
13254
15068
|
}).strict().superRefine(({ pages, pageGroups }, context) => {
|
|
13255
15069
|
const pageIds = pages.map(({ definition }) => definition.pageId);
|
|
@@ -13273,38 +15087,38 @@ var TenantWorkbenchConfigSchema = z11.object({
|
|
|
13273
15087
|
});
|
|
13274
15088
|
});
|
|
13275
15089
|
});
|
|
13276
|
-
var LoginPageSchema =
|
|
13277
|
-
background:
|
|
13278
|
-
logo:
|
|
13279
|
-
url:
|
|
13280
|
-
lightUrl:
|
|
13281
|
-
darkUrl:
|
|
13282
|
-
position:
|
|
13283
|
-
scale:
|
|
15090
|
+
var LoginPageSchema = z12.object({
|
|
15091
|
+
background: z12.object({ imageUrl: z12.string().optional(), gradient: z12.string().optional() }).strict().optional(),
|
|
15092
|
+
logo: z12.object({
|
|
15093
|
+
url: z12.string().optional(),
|
|
15094
|
+
lightUrl: z12.string().optional(),
|
|
15095
|
+
darkUrl: z12.string().optional(),
|
|
15096
|
+
position: z12.enum(["top", "middle", "bottom"]).optional(),
|
|
15097
|
+
scale: z12.number().positive().optional()
|
|
13284
15098
|
}).strict().optional(),
|
|
13285
|
-
customCss:
|
|
15099
|
+
customCss: z12.string().optional()
|
|
13286
15100
|
}).strict();
|
|
13287
15101
|
var LandingPageHeadbarConfigShape = {
|
|
13288
|
-
headbarMode:
|
|
15102
|
+
headbarMode: z12.enum(["shared", "hidden"]).optional()
|
|
13289
15103
|
};
|
|
13290
|
-
var LandingPageDefaultConfigSchema =
|
|
13291
|
-
mode:
|
|
15104
|
+
var LandingPageDefaultConfigSchema = z12.object({
|
|
15105
|
+
mode: z12.literal("default"),
|
|
13292
15106
|
...LandingPageHeadbarConfigShape
|
|
13293
15107
|
}).strict();
|
|
13294
|
-
var LandingPageMarkdownConfigSchema =
|
|
13295
|
-
mode:
|
|
13296
|
-
content:
|
|
15108
|
+
var LandingPageMarkdownConfigSchema = z12.object({
|
|
15109
|
+
mode: z12.literal("markdown"),
|
|
15110
|
+
content: z12.string(),
|
|
13297
15111
|
...LandingPageHeadbarConfigShape
|
|
13298
15112
|
}).strict();
|
|
13299
|
-
var LandingPageHtmlConfigSchema =
|
|
13300
|
-
mode:
|
|
13301
|
-
content:
|
|
15113
|
+
var LandingPageHtmlConfigSchema = z12.object({
|
|
15114
|
+
mode: z12.literal("html"),
|
|
15115
|
+
content: z12.string(),
|
|
13302
15116
|
...LandingPageHeadbarConfigShape
|
|
13303
15117
|
}).strict();
|
|
13304
|
-
var LandingPageIframeConfigSchema =
|
|
13305
|
-
mode:
|
|
15118
|
+
var LandingPageIframeConfigSchema = z12.object({
|
|
15119
|
+
mode: z12.literal("iframe"),
|
|
13306
15120
|
...LandingPageHeadbarConfigShape,
|
|
13307
|
-
url:
|
|
15121
|
+
url: z12.string().refine((value) => {
|
|
13308
15122
|
if (/^\/(?!\/)/.test(value)) {
|
|
13309
15123
|
return !value.includes("\\");
|
|
13310
15124
|
}
|
|
@@ -13316,13 +15130,13 @@ var LandingPageIframeConfigSchema = z11.object({
|
|
|
13316
15130
|
}
|
|
13317
15131
|
}, "Landing page iframe URL must use a root-relative path or HTTP(S) without embedded credentials.")
|
|
13318
15132
|
}).strict();
|
|
13319
|
-
var TenantLandingPageConfigSchema =
|
|
15133
|
+
var TenantLandingPageConfigSchema = z12.discriminatedUnion("mode", [
|
|
13320
15134
|
LandingPageDefaultConfigSchema,
|
|
13321
15135
|
LandingPageMarkdownConfigSchema,
|
|
13322
15136
|
LandingPageHtmlConfigSchema,
|
|
13323
15137
|
LandingPageIframeConfigSchema
|
|
13324
15138
|
]);
|
|
13325
|
-
var ListFooterPageSizeOptionsSchema =
|
|
15139
|
+
var ListFooterPageSizeOptionsSchema = z12.array(z12.number().int().positive().max(1e3)).min(1).max(10).superRefine((options, context) => {
|
|
13326
15140
|
const seen = /* @__PURE__ */ new Set();
|
|
13327
15141
|
options.forEach((option, index) => {
|
|
13328
15142
|
if (seen.has(option)) {
|
|
@@ -13335,263 +15149,263 @@ var ListFooterPageSizeOptionsSchema = z11.array(z11.number().int().positive().ma
|
|
|
13335
15149
|
seen.add(option);
|
|
13336
15150
|
});
|
|
13337
15151
|
});
|
|
13338
|
-
var TenantListFooterConfigSchema =
|
|
13339
|
-
showTotal:
|
|
13340
|
-
showPageSize:
|
|
15152
|
+
var TenantListFooterConfigSchema = z12.object({
|
|
15153
|
+
showTotal: z12.boolean().optional(),
|
|
15154
|
+
showPageSize: z12.boolean().optional(),
|
|
13341
15155
|
pageSizeOptions: ListFooterPageSizeOptionsSchema.optional(),
|
|
13342
|
-
paginationMode:
|
|
13343
|
-
alignment:
|
|
13344
|
-
density:
|
|
13345
|
-
}).strict();
|
|
13346
|
-
var TenantApplicationConfigSchema =
|
|
13347
|
-
theme:
|
|
13348
|
-
id:
|
|
13349
|
-
name:
|
|
13350
|
-
title:
|
|
15156
|
+
paginationMode: z12.enum(["auto", "pages", "compact"]).optional(),
|
|
15157
|
+
alignment: z12.enum(["start", "end", "space-between"]).optional(),
|
|
15158
|
+
density: z12.enum(["compact", "default", "comfortable"]).optional()
|
|
15159
|
+
}).strict();
|
|
15160
|
+
var TenantApplicationConfigSchema = z12.object({
|
|
15161
|
+
theme: z12.object({
|
|
15162
|
+
id: z12.string().optional(),
|
|
15163
|
+
name: z12.string().optional(),
|
|
15164
|
+
title: z12.string().optional(),
|
|
13351
15165
|
favicon: AssetVariantsSchema.optional(),
|
|
13352
15166
|
logo: AssetVariantsSchema.optional(),
|
|
13353
|
-
pwaIcon:
|
|
13354
|
-
form:
|
|
13355
|
-
toast:
|
|
13356
|
-
position:
|
|
15167
|
+
pwaIcon: z12.string().optional(),
|
|
15168
|
+
form: z12.object({ variant: z12.enum(["bento", "ghost"]) }).strict().optional(),
|
|
15169
|
+
toast: z12.object({
|
|
15170
|
+
position: z12.enum(["top-right", "top-left", "bottom-right", "bottom-left", "top-center", "bottom-center"])
|
|
13357
15171
|
}).strict().optional(),
|
|
13358
|
-
icons:
|
|
13359
|
-
views:
|
|
13360
|
-
form:
|
|
13361
|
-
toast:
|
|
13362
|
-
progress:
|
|
13363
|
-
onlyResult:
|
|
13364
|
-
tabular:
|
|
15172
|
+
icons: z12.object({ error: CustomIconSchema.optional(), empty: CustomIconSchema.optional() }).strict().optional(),
|
|
15173
|
+
views: z12.object({
|
|
15174
|
+
form: z12.object({
|
|
15175
|
+
toast: z12.object({ afterCreate: z12.boolean(), afterDelete: z12.boolean() }).strict(),
|
|
15176
|
+
progress: z12.enum(["estimate", "infinite"]),
|
|
15177
|
+
onlyResult: z12.boolean(),
|
|
15178
|
+
tabular: z12.object({ theme: z12.enum(["default", "tentiary", "primary"]) }).strict()
|
|
13365
15179
|
}).strict()
|
|
13366
15180
|
}).strict().optional(),
|
|
13367
15181
|
loginPage: LoginPageSchema.optional(),
|
|
13368
|
-
extraLanguageURL:
|
|
13369
|
-
hideSpaceHeader:
|
|
13370
|
-
showSidebarTeamSelector:
|
|
13371
|
-
showWorkbenchSidebar:
|
|
13372
|
-
workbenchViewTheme:
|
|
13373
|
-
defaults:
|
|
13374
|
-
showFormInImageDetail:
|
|
13375
|
-
darkMode:
|
|
13376
|
-
language:
|
|
13377
|
-
showDarkModeToggle:
|
|
13378
|
-
showLanguageToggle:
|
|
15182
|
+
extraLanguageURL: z12.record(z12.string(), z12.string()).optional(),
|
|
15183
|
+
hideSpaceHeader: z12.boolean().optional(),
|
|
15184
|
+
showSidebarTeamSelector: z12.boolean().optional(),
|
|
15185
|
+
showWorkbenchSidebar: z12.boolean().optional(),
|
|
15186
|
+
workbenchViewTheme: z12.enum(["default", "bsd-blue"]).optional(),
|
|
15187
|
+
defaults: z12.object({
|
|
15188
|
+
showFormInImageDetail: z12.boolean().optional(),
|
|
15189
|
+
darkMode: z12.enum(["light", "dark", "auto"]).optional(),
|
|
15190
|
+
language: z12.enum(["en-US", "zh-CN", "ja-JP"]).optional(),
|
|
15191
|
+
showDarkModeToggle: z12.boolean().optional(),
|
|
15192
|
+
showLanguageToggle: z12.boolean().optional()
|
|
13379
15193
|
}).strict().optional(),
|
|
13380
|
-
modules:
|
|
13381
|
-
monkeysSpaceSidebar:
|
|
13382
|
-
monkeysSpaceHeadbar:
|
|
13383
|
-
|
|
13384
|
-
|
|
15194
|
+
modules: z12.object({
|
|
15195
|
+
monkeysSpaceSidebar: z12.union([z12.literal("*"), z12.array(ContractIdentifierSchema)]).optional(),
|
|
15196
|
+
monkeysSpaceHeadbar: z12.union([
|
|
15197
|
+
z12.literal("*"),
|
|
15198
|
+
z12.array(TenantHeadbarModuleItemSchema)
|
|
13385
15199
|
]).optional(),
|
|
13386
|
-
settingsSidebar:
|
|
15200
|
+
settingsSidebar: z12.union([z12.literal("*"), z12.array(ContractIdentifierSchema)]).optional()
|
|
13387
15201
|
}).strict().optional(),
|
|
13388
15202
|
headbar: ThemeHeadbarSchema.optional(),
|
|
13389
|
-
kernelLayout:
|
|
13390
|
-
navigationMode:
|
|
13391
|
-
allowNavigationModeSwitch:
|
|
15203
|
+
kernelLayout: z12.object({
|
|
15204
|
+
navigationMode: z12.enum(["sidebar", "topbar"]).optional(),
|
|
15205
|
+
allowNavigationModeSwitch: z12.boolean().optional(),
|
|
13392
15206
|
headbar: KernelHeadbarSchema.optional()
|
|
13393
15207
|
}).strict().optional(),
|
|
13394
|
-
paginationPosition:
|
|
15208
|
+
paginationPosition: z12.enum(["left", "right"]).optional(),
|
|
13395
15209
|
listFooter: TenantListFooterConfigSchema.optional(),
|
|
13396
|
-
ugcViewIconOnlyMode:
|
|
13397
|
-
workflowPreviewExecutionGrid:
|
|
13398
|
-
selectionModeDisplayType:
|
|
13399
|
-
clickBehavior:
|
|
13400
|
-
showErrorFilter:
|
|
13401
|
-
displayType:
|
|
13402
|
-
showDetailButton:
|
|
13403
|
-
aspectRatio:
|
|
15210
|
+
ugcViewIconOnlyMode: z12.boolean().optional(),
|
|
15211
|
+
workflowPreviewExecutionGrid: z12.object({
|
|
15212
|
+
selectionModeDisplayType: z12.enum(["operation-button", "dropdown-menu"]).optional(),
|
|
15213
|
+
clickBehavior: z12.enum(["preview", "select", "fill-form", "none"]).optional(),
|
|
15214
|
+
showErrorFilter: z12.boolean().optional(),
|
|
15215
|
+
displayType: z12.enum(["grid", "masonry"]).optional(),
|
|
15216
|
+
showDetailButton: z12.boolean().optional(),
|
|
15217
|
+
aspectRatio: z12.enum(["1:1", "4:3", "3:4", "16:9", "9:16"]).optional()
|
|
13404
15218
|
}).strict().optional(),
|
|
13405
|
-
workbenchSidebarDefaultOpen:
|
|
13406
|
-
workbenchSidebarMoreAction:
|
|
13407
|
-
workbenchSidebarApart:
|
|
13408
|
-
workbenchSidebarToggleGroupDetail:
|
|
13409
|
-
workbenchSidebarViewType:
|
|
13410
|
-
workbenchSidebarFormViewEmbed:
|
|
13411
|
-
workbenchSidebarModernMode:
|
|
13412
|
-
ugc:
|
|
13413
|
-
uniImagePreview:
|
|
13414
|
-
imagePreviewStyle:
|
|
13415
|
-
teamAsUser:
|
|
13416
|
-
themeMode:
|
|
13417
|
-
density:
|
|
13418
|
-
statusStates:
|
|
13419
|
-
loading:
|
|
13420
|
-
empty:
|
|
13421
|
-
error:
|
|
13422
|
-
permission:
|
|
13423
|
-
density:
|
|
15219
|
+
workbenchSidebarDefaultOpen: z12.boolean().optional(),
|
|
15220
|
+
workbenchSidebarMoreAction: z12.boolean().optional(),
|
|
15221
|
+
workbenchSidebarApart: z12.boolean().optional(),
|
|
15222
|
+
workbenchSidebarToggleGroupDetail: z12.boolean().optional(),
|
|
15223
|
+
workbenchSidebarViewType: z12.boolean().optional(),
|
|
15224
|
+
workbenchSidebarFormViewEmbed: z12.boolean().optional(),
|
|
15225
|
+
workbenchSidebarModernMode: z12.boolean().optional(),
|
|
15226
|
+
ugc: z12.object({ onItemClick: z12.boolean(), subtitle: z12.boolean().optional() }).strict().optional(),
|
|
15227
|
+
uniImagePreview: z12.boolean().optional(),
|
|
15228
|
+
imagePreviewStyle: z12.union([z12.literal(false), z12.enum(["simple", "normal", "uni"])]).optional(),
|
|
15229
|
+
teamAsUser: z12.boolean().optional(),
|
|
15230
|
+
themeMode: z12.enum(["shadow", "border"]).optional(),
|
|
15231
|
+
density: z12.enum(["compact", "default", "comfortable"]).optional(),
|
|
15232
|
+
statusStates: z12.object({
|
|
15233
|
+
loading: z12.object({ variant: z12.enum(["spinner", "skeleton"]).optional() }).strict().optional(),
|
|
15234
|
+
empty: z12.object({ variant: z12.enum(["default", "compact"]).optional() }).strict().optional(),
|
|
15235
|
+
error: z12.object({ showRetry: z12.boolean().optional() }).strict().optional(),
|
|
15236
|
+
permission: z12.object({ showRequestAccess: z12.boolean().optional() }).strict().optional(),
|
|
15237
|
+
density: z12.enum(["compact", "default", "comfortable"]).optional()
|
|
13424
15238
|
}).strict().optional(),
|
|
13425
|
-
pageZoom:
|
|
13426
|
-
miniMode:
|
|
13427
|
-
workflow:
|
|
13428
|
-
historyResult:
|
|
13429
|
-
uploader:
|
|
13430
|
-
orientation:
|
|
13431
|
-
pasteButton:
|
|
13432
|
-
statusText:
|
|
15239
|
+
pageZoom: z12.number().positive().optional(),
|
|
15240
|
+
miniMode: z12.object({ showPreviewViewExecutionResultGrid: z12.boolean() }).strict().optional(),
|
|
15241
|
+
workflow: z12.object({ allowConcurrentRuns: z12.boolean() }).strict().optional(),
|
|
15242
|
+
historyResult: z12.object({ display: z12.boolean() }).strict().optional(),
|
|
15243
|
+
uploader: z12.object({
|
|
15244
|
+
orientation: z12.enum(["vertical", "horizontal"]),
|
|
15245
|
+
pasteButton: z12.boolean(),
|
|
15246
|
+
statusText: z12.boolean()
|
|
13433
15247
|
}).strict().optional(),
|
|
13434
|
-
designProjects:
|
|
13435
|
-
oneOnOne:
|
|
13436
|
-
newTabOpenBoard:
|
|
13437
|
-
defaultShowGrid:
|
|
13438
|
-
createDefaultFrame:
|
|
13439
|
-
showPageMenu:
|
|
13440
|
-
showMainMenu:
|
|
13441
|
-
showStylePanel:
|
|
13442
|
-
showToolbar:
|
|
13443
|
-
toolbarPosition:
|
|
13444
|
-
showContextMenu:
|
|
13445
|
-
showActionsMenu:
|
|
13446
|
-
showPageAndLayerSidebar:
|
|
13447
|
-
showBoardOperationSidebar:
|
|
13448
|
-
showMiniToolsToolbar:
|
|
13449
|
-
showRightSidebar:
|
|
13450
|
-
showRealtimeDrawing:
|
|
13451
|
-
showWorkflow:
|
|
13452
|
-
showVersionManager:
|
|
13453
|
-
showAgent:
|
|
13454
|
-
AgentTools:
|
|
15248
|
+
designProjects: z12.object({
|
|
15249
|
+
oneOnOne: z12.boolean(),
|
|
15250
|
+
newTabOpenBoard: z12.boolean(),
|
|
15251
|
+
defaultShowGrid: z12.boolean().optional(),
|
|
15252
|
+
createDefaultFrame: z12.boolean(),
|
|
15253
|
+
showPageMenu: z12.boolean(),
|
|
15254
|
+
showMainMenu: z12.boolean(),
|
|
15255
|
+
showStylePanel: z12.boolean(),
|
|
15256
|
+
showToolbar: z12.boolean(),
|
|
15257
|
+
toolbarPosition: z12.enum(["bottom", "left"]).optional(),
|
|
15258
|
+
showContextMenu: z12.boolean(),
|
|
15259
|
+
showActionsMenu: z12.boolean(),
|
|
15260
|
+
showPageAndLayerSidebar: z12.boolean().optional(),
|
|
15261
|
+
showBoardOperationSidebar: z12.boolean().optional(),
|
|
15262
|
+
showMiniToolsToolbar: z12.boolean().optional(),
|
|
15263
|
+
showRightSidebar: z12.boolean().optional(),
|
|
15264
|
+
showRealtimeDrawing: z12.boolean().optional(),
|
|
15265
|
+
showWorkflow: z12.boolean().optional(),
|
|
15266
|
+
showVersionManager: z12.boolean().optional(),
|
|
15267
|
+
showAgent: z12.boolean().optional(),
|
|
15268
|
+
AgentTools: z12.array(ContractIdentifierSchema).optional()
|
|
13455
15269
|
}).strict().optional(),
|
|
13456
15270
|
workbench: TenantWorkbenchConfigSchema.optional(),
|
|
13457
|
-
visionProWorkflows:
|
|
13458
|
-
initTeam:
|
|
13459
|
-
imageThumbnail:
|
|
13460
|
-
pages:
|
|
13461
|
-
allowPageKeys:
|
|
15271
|
+
visionProWorkflows: z12.array(ContractIdentifierSchema).optional(),
|
|
15272
|
+
initTeam: z12.boolean().optional(),
|
|
15273
|
+
imageThumbnail: z12.boolean().optional(),
|
|
15274
|
+
pages: z12.object({
|
|
15275
|
+
allowPageKeys: z12.union([z12.literal("*"), z12.array(ContractIdentifierSchema)]),
|
|
13462
15276
|
defaultPageKey: ContractIdentifierSchema.optional(),
|
|
13463
|
-
homeEntryEnabled:
|
|
15277
|
+
homeEntryEnabled: z12.boolean().optional()
|
|
13464
15278
|
}).strict().optional(),
|
|
13465
15279
|
agent: TenantAgentThemeConfigSchema.optional()
|
|
13466
15280
|
}).strict(),
|
|
13467
15281
|
landingPage: TenantLandingPageConfigSchema.optional(),
|
|
13468
|
-
auth:
|
|
13469
|
-
enabled:
|
|
13470
|
-
oidc:
|
|
13471
|
-
password:
|
|
13472
|
-
registrationEnabled:
|
|
13473
|
-
disableAutoRegister:
|
|
15282
|
+
auth: z12.object({
|
|
15283
|
+
enabled: z12.array(ContractIdentifierSchema).default([]),
|
|
15284
|
+
oidc: z12.object({ buttonText: z12.string().optional(), autoSignin: z12.boolean().optional() }).strict().optional(),
|
|
15285
|
+
password: z12.object({
|
|
15286
|
+
registrationEnabled: z12.boolean().optional(),
|
|
15287
|
+
disableAutoRegister: z12.boolean().optional()
|
|
13474
15288
|
}).strict().optional(),
|
|
13475
|
-
registrationApproval:
|
|
13476
|
-
enabled:
|
|
15289
|
+
registrationApproval: z12.object({
|
|
15290
|
+
enabled: z12.boolean().optional()
|
|
13477
15291
|
}).strict().optional(),
|
|
13478
|
-
hideAuthToast:
|
|
13479
|
-
autoReload:
|
|
13480
|
-
defaultOtherTeam:
|
|
15292
|
+
hideAuthToast: z12.boolean().optional(),
|
|
15293
|
+
autoReload: z12.boolean().optional(),
|
|
15294
|
+
defaultOtherTeam: z12.boolean().optional()
|
|
13481
15295
|
}).strict(),
|
|
13482
|
-
endpoints:
|
|
13483
|
-
module:
|
|
13484
|
-
behavior:
|
|
13485
|
-
clearWorkflowFormStorageAfterUpdate:
|
|
13486
|
-
autoApproveOAuth:
|
|
13487
|
-
rememberWorkflowModelSelection:
|
|
15296
|
+
endpoints: z12.record(ContractIdentifierSchema, z12.string()),
|
|
15297
|
+
module: z12.union([z12.literal("*"), z12.array(ContractIdentifierSchema)]),
|
|
15298
|
+
behavior: z12.object({
|
|
15299
|
+
clearWorkflowFormStorageAfterUpdate: z12.boolean().optional(),
|
|
15300
|
+
autoApproveOAuth: z12.boolean().optional(),
|
|
15301
|
+
rememberWorkflowModelSelection: z12.boolean().optional()
|
|
13488
15302
|
}).strict(),
|
|
13489
|
-
dataManagement:
|
|
13490
|
-
favoriteOntologyId:
|
|
13491
|
-
pairedOntologyId:
|
|
13492
|
-
galleryOntologyIds:
|
|
13493
|
-
galleryOntologyId:
|
|
13494
|
-
dataBrowserDefaultOntologyId:
|
|
13495
|
-
workflowResultOntologyId:
|
|
13496
|
-
homeAdvertisement:
|
|
15303
|
+
dataManagement: z12.object({
|
|
15304
|
+
favoriteOntologyId: z12.string().optional(),
|
|
15305
|
+
pairedOntologyId: z12.string().optional(),
|
|
15306
|
+
galleryOntologyIds: z12.array(ContractIdentifierSchema).max(20).optional(),
|
|
15307
|
+
galleryOntologyId: z12.string().optional(),
|
|
15308
|
+
dataBrowserDefaultOntologyId: z12.string().optional(),
|
|
15309
|
+
workflowResultOntologyId: z12.string().optional(),
|
|
15310
|
+
homeAdvertisement: z12.object({
|
|
13497
15311
|
ontologyId: ContractIdentifierSchema,
|
|
13498
15312
|
viewId: ContractIdentifierSchema.optional(),
|
|
13499
|
-
viewType:
|
|
15313
|
+
viewType: z12.enum(["filter", "container", "share_link"]).optional(),
|
|
13500
15314
|
teamId: ContractIdentifierSchema.optional(),
|
|
13501
|
-
teamOnly:
|
|
13502
|
-
pageSize:
|
|
13503
|
-
sortBy:
|
|
13504
|
-
sortOrder:
|
|
13505
|
-
fieldMap:
|
|
13506
|
-
columnIds:
|
|
15315
|
+
teamOnly: z12.boolean().optional(),
|
|
15316
|
+
pageSize: z12.number().int().positive().optional(),
|
|
15317
|
+
sortBy: z12.enum(["pin_order", "asset_id", "updated_timestamp", "created_timestamp"]).optional(),
|
|
15318
|
+
sortOrder: z12.enum(["asc", "desc"]).optional(),
|
|
15319
|
+
fieldMap: z12.record(z12.string(), z12.string()).optional(),
|
|
15320
|
+
columnIds: z12.record(z12.string(), z12.string()).optional()
|
|
13507
15321
|
}).strict().optional(),
|
|
13508
|
-
homeTrendAssistant:
|
|
15322
|
+
homeTrendAssistant: z12.object({
|
|
13509
15323
|
ontologyId: ContractIdentifierSchema.optional(),
|
|
13510
15324
|
viewId: ContractIdentifierSchema.optional(),
|
|
13511
15325
|
viewInstanceId: ContractIdentifierSchema.optional(),
|
|
13512
|
-
viewName:
|
|
15326
|
+
viewName: z12.string().optional(),
|
|
13513
15327
|
teamId: ContractIdentifierSchema.optional(),
|
|
13514
15328
|
designOptionsWorkflowId: ContractIdentifierSchema.optional(),
|
|
13515
|
-
tep:
|
|
13516
|
-
runtime:
|
|
15329
|
+
tep: z12.object({ baseUrl: z12.string().optional(), timeoutMs: z12.number().int().positive().optional() }).strict().optional(),
|
|
15330
|
+
runtime: z12.object({ appId: ContractIdentifierSchema, tepBaseUrlConfigured: z12.boolean(), tepAuthorizationConfigured: z12.boolean(), tepCookieConfigured: z12.boolean() }).strict().optional()
|
|
13517
15331
|
}).strict().optional(),
|
|
13518
|
-
staticTrendReport:
|
|
15332
|
+
staticTrendReport: z12.object({
|
|
13519
15333
|
ontologyId: ContractIdentifierSchema,
|
|
13520
15334
|
viewId: ContractIdentifierSchema.optional(),
|
|
13521
15335
|
teamId: ContractIdentifierSchema.optional()
|
|
13522
15336
|
}).strict().optional(),
|
|
13523
15337
|
trendRadar: TenantTrendRadarSourcesSchema.optional(),
|
|
13524
|
-
sharing:
|
|
13525
|
-
silentViewLinks:
|
|
13526
|
-
shareAccess:
|
|
13527
|
-
shareDialog:
|
|
13528
|
-
audience:
|
|
13529
|
-
accessLevel:
|
|
13530
|
-
viewTreeDelivery:
|
|
15338
|
+
sharing: z12.object({
|
|
15339
|
+
silentViewLinks: z12.object({ enabled: z12.boolean().optional(), placement: z12.object({ mode: z12.enum(["sourceOntology", "ontology"]).optional(), ontologyId: ContractIdentifierSchema.optional(), parentId: ContractIdentifierSchema.optional(), navId: ContractIdentifierSchema.optional() }).strict().optional() }).strict().optional(),
|
|
15340
|
+
shareAccess: z12.object({ publicLinksEnabled: z12.boolean().optional(), passwordGateEnabled: z12.boolean().optional(), passwordAccessTtlSeconds: z12.number().int().positive().optional(), defaultViewTreeDelivery: z12.enum(["manual", "auto"]).optional() }).strict().optional(),
|
|
15341
|
+
shareDialog: z12.object({
|
|
15342
|
+
audience: z12.object({ enabled: z12.boolean().optional(), allowed: z12.array(z12.enum(["user", "team", "public"])).optional(), default: z12.enum(["user", "team", "public"]).optional() }).strict().optional(),
|
|
15343
|
+
accessLevel: z12.object({ enabled: z12.boolean().optional(), allowed: z12.array(z12.enum(["read", "write"])).optional(), default: z12.enum(["read", "write"]).optional() }).strict().optional(),
|
|
15344
|
+
viewTreeDelivery: z12.object({ enabled: z12.boolean().optional(), allowed: z12.array(z12.enum(["manual", "auto"])).optional(), default: z12.enum(["manual", "auto"]).optional() }).strict().optional()
|
|
13531
15345
|
}).strict().optional()
|
|
13532
15346
|
}).strict().optional()
|
|
13533
15347
|
}).strict().optional(),
|
|
13534
|
-
kernelRuntime:
|
|
13535
|
-
integrations:
|
|
13536
|
-
harbor:
|
|
13537
|
-
gitlab:
|
|
13538
|
-
kubernetes:
|
|
15348
|
+
kernelRuntime: z12.object({
|
|
15349
|
+
integrations: z12.object({
|
|
15350
|
+
harbor: z12.object({ endpoint: z12.string().optional(), projectScopes: z12.array(z12.string()).optional(), authMode: z12.string().optional(), principal: z12.string().optional(), autoSync: z12.boolean().optional(), proxyUrl: z12.string().optional() }).strict().optional(),
|
|
15351
|
+
gitlab: z12.object({ baseUrl: z12.string().optional(), groupScopes: z12.array(z12.string()).optional(), tokenMode: z12.string().optional(), deployProjectPath: z12.string().optional(), deploymentReportsEnabled: z12.boolean().optional(), proxyUrl: z12.string().optional() }).strict().optional(),
|
|
15352
|
+
kubernetes: z12.object({ accessMode: z12.string().optional(), clusterAlias: z12.string().optional(), agentProjectPath: z12.string().optional(), agentName: z12.string().optional(), namespaceScopes: z12.array(z12.string()).optional(), rolloutObserverEnabled: z12.boolean().optional(), proxyUrl: z12.string().optional() }).strict().optional()
|
|
13539
15353
|
}).strict().optional()
|
|
13540
15354
|
}).strict().optional(),
|
|
13541
|
-
data:
|
|
13542
|
-
storage:
|
|
13543
|
-
presignMode:
|
|
13544
|
-
presign:
|
|
13545
|
-
expiresInSeconds:
|
|
13546
|
-
buckets:
|
|
13547
|
-
|
|
15355
|
+
data: z12.object({}).strict().optional(),
|
|
15356
|
+
storage: z12.object({
|
|
15357
|
+
presignMode: z12.enum(["frontend", "backend", "both"]).optional(),
|
|
15358
|
+
presign: z12.object({
|
|
15359
|
+
expiresInSeconds: z12.number().int().positive(),
|
|
15360
|
+
buckets: z12.array(
|
|
15361
|
+
z12.object({
|
|
13548
15362
|
id: ContractIdentifierSchema,
|
|
13549
15363
|
provider: ContractIdentifierSchema,
|
|
13550
15364
|
preferredUrlPatternId: ContractIdentifierSchema,
|
|
13551
|
-
urlPatterns:
|
|
13552
|
-
|
|
15365
|
+
urlPatterns: z12.array(
|
|
15366
|
+
z12.object({
|
|
13553
15367
|
id: ContractIdentifierSchema,
|
|
13554
|
-
type:
|
|
13555
|
-
hostname:
|
|
13556
|
-
preferred:
|
|
13557
|
-
bucketSegment:
|
|
15368
|
+
type: z12.enum(["bucket-hostname", "provider-hostname"]),
|
|
15369
|
+
hostname: z12.string().trim().min(1),
|
|
15370
|
+
preferred: z12.boolean().optional(),
|
|
15371
|
+
bucketSegment: z12.string().optional()
|
|
13558
15372
|
}).strict()
|
|
13559
15373
|
)
|
|
13560
15374
|
}).strict()
|
|
13561
15375
|
)
|
|
13562
15376
|
}).strict().optional()
|
|
13563
15377
|
}).strict().optional(),
|
|
13564
|
-
monkeyData:
|
|
15378
|
+
monkeyData: z12.object({ baseUrl: z12.string().optional() }).strict().optional()
|
|
13565
15379
|
}).strict();
|
|
13566
|
-
var TenantProductConfigSchema =
|
|
13567
|
-
contract:
|
|
15380
|
+
var TenantProductConfigSchema = z12.object({
|
|
15381
|
+
contract: z12.literal("TenantProductConfig"),
|
|
13568
15382
|
tenantId: ContractIdentifierSchema,
|
|
13569
15383
|
appId: ContractIdentifierSchema,
|
|
13570
15384
|
environment: ContractIdentifierSchema,
|
|
13571
15385
|
designTokens: TenantDesignTokensConfigSchema,
|
|
13572
|
-
moduleRefs:
|
|
13573
|
-
pageRefs:
|
|
13574
|
-
featureFlags:
|
|
15386
|
+
moduleRefs: z12.array(ContractIdentifierSchema).default([]),
|
|
15387
|
+
pageRefs: z12.array(ContractIdentifierSchema).default([]),
|
|
15388
|
+
featureFlags: z12.record(z12.string(), z12.boolean()).default({}),
|
|
13575
15389
|
authBinding: TenantAuthBindingsSchema,
|
|
13576
15390
|
dataBinding: TenantDataBindingsSchema,
|
|
13577
|
-
sourceMap:
|
|
13578
|
-
warnings:
|
|
15391
|
+
sourceMap: z12.record(z12.string(), ContractIdentifierSchema),
|
|
15392
|
+
warnings: z12.array(z12.string()).default([]),
|
|
13579
15393
|
menus: MenuDefinitionSetSchema.optional(),
|
|
13580
15394
|
applicationConfig: TenantApplicationConfigSchema
|
|
13581
15395
|
}).strict();
|
|
13582
|
-
var TenantRuntimeConfigSchema =
|
|
13583
|
-
contract:
|
|
15396
|
+
var TenantRuntimeConfigSchema = z12.object({
|
|
15397
|
+
contract: z12.literal("TenantRuntimeConfig"),
|
|
13584
15398
|
tenantId: ContractIdentifierSchema,
|
|
13585
15399
|
appId: ContractIdentifierSchema,
|
|
13586
15400
|
environment: ContractIdentifierSchema,
|
|
13587
15401
|
designTokens: ResolvedThemeTokensSchema,
|
|
13588
|
-
moduleRefs:
|
|
13589
|
-
pageRefs:
|
|
13590
|
-
featureFlags:
|
|
15402
|
+
moduleRefs: z12.array(ContractIdentifierSchema).default([]),
|
|
15403
|
+
pageRefs: z12.array(ContractIdentifierSchema).default([]),
|
|
15404
|
+
featureFlags: z12.record(z12.string(), z12.boolean()).default({}),
|
|
13591
15405
|
authBinding: TenantAuthBindingsSchema,
|
|
13592
15406
|
dataBinding: TenantDataBindingsSchema,
|
|
13593
|
-
sourceMap:
|
|
13594
|
-
warnings:
|
|
15407
|
+
sourceMap: z12.record(z12.string(), ContractIdentifierSchema),
|
|
15408
|
+
warnings: z12.array(z12.string()).default([]),
|
|
13595
15409
|
menuBundle: MenuRuntimeBundleSchema.optional(),
|
|
13596
15410
|
applicationConfig: TenantApplicationConfigSchema
|
|
13597
15411
|
}).strict();
|
|
@@ -13867,8 +15681,8 @@ var compileWorkflowPersistenceProjection = (input) => {
|
|
|
13867
15681
|
};
|
|
13868
15682
|
|
|
13869
15683
|
// src/contracts/access.ts
|
|
13870
|
-
import { z as
|
|
13871
|
-
var PermissionDefinitionSchema =
|
|
15684
|
+
import { z as z13 } from "zod";
|
|
15685
|
+
var PermissionDefinitionSchema = z13.object({
|
|
13872
15686
|
code: ContractIdentifierSchema,
|
|
13873
15687
|
name: LocalizedTextSchema,
|
|
13874
15688
|
description: LocalizedTextSchema.optional(),
|
|
@@ -13876,29 +15690,29 @@ var PermissionDefinitionSchema = z12.object({
|
|
|
13876
15690
|
action: ContractIdentifierSchema,
|
|
13877
15691
|
domain: ContractIdentifierSchema.optional()
|
|
13878
15692
|
}).strict();
|
|
13879
|
-
var PermissionBundleSchema =
|
|
15693
|
+
var PermissionBundleSchema = z13.object({
|
|
13880
15694
|
bundleId: ContractIdentifierSchema,
|
|
13881
15695
|
name: LocalizedTextSchema,
|
|
13882
|
-
permissionCodes:
|
|
15696
|
+
permissionCodes: z13.array(ContractIdentifierSchema).default([])
|
|
13883
15697
|
}).strict();
|
|
13884
|
-
var SystemGroupDefinitionSchema =
|
|
15698
|
+
var SystemGroupDefinitionSchema = z13.object({
|
|
13885
15699
|
groupCode: ContractIdentifierSchema,
|
|
13886
15700
|
name: LocalizedTextSchema,
|
|
13887
15701
|
description: LocalizedTextSchema.optional(),
|
|
13888
|
-
permissionPolicy:
|
|
13889
|
-
permissionBundleIds:
|
|
15702
|
+
permissionPolicy: z13.enum(["bundles", "studio_current", "all_current"]).default("bundles"),
|
|
15703
|
+
permissionBundleIds: z13.array(ContractIdentifierSchema).default([])
|
|
13890
15704
|
}).strict().refine((value) => value.permissionPolicy !== "bundles" || value.permissionBundleIds.length > 0, {
|
|
13891
15705
|
message: "A bundles permission policy requires at least one permission bundle.",
|
|
13892
15706
|
path: ["permissionBundleIds"]
|
|
13893
15707
|
});
|
|
13894
|
-
var ProductAccessDeclarationSchema =
|
|
13895
|
-
contract:
|
|
15708
|
+
var ProductAccessDeclarationSchema = z13.object({
|
|
15709
|
+
contract: z13.literal("ProductAccessDeclaration"),
|
|
13896
15710
|
declarationId: ContractIdentifierSchema,
|
|
13897
15711
|
version: ContractVersionSchema,
|
|
13898
15712
|
ownerRepo: ContractIdentifierSchema,
|
|
13899
|
-
permissions:
|
|
13900
|
-
permissionBundles:
|
|
13901
|
-
systemGroups:
|
|
15713
|
+
permissions: z13.array(PermissionDefinitionSchema).default([]),
|
|
15714
|
+
permissionBundles: z13.array(PermissionBundleSchema).default([]),
|
|
15715
|
+
systemGroups: z13.array(SystemGroupDefinitionSchema).min(1)
|
|
13902
15716
|
}).strict();
|
|
13903
15717
|
|
|
13904
15718
|
// src/runtime/access-compiler.ts
|
|
@@ -13959,27 +15773,34 @@ var compileProductAccessDeclaration = (input) => {
|
|
|
13959
15773
|
export {
|
|
13960
15774
|
APPLICATION_HANDOFF_QUERY_PARAMETER,
|
|
13961
15775
|
DEFAULT_CONDUCTOR_OWNER_EMAIL,
|
|
15776
|
+
DeclarativeControlCompilationError,
|
|
13962
15777
|
MONKEYS_REQUIRED_THEME_TOKEN_PATHS,
|
|
13963
15778
|
MenuCompilationError,
|
|
13964
15779
|
ThemeTokenValidationError,
|
|
15780
|
+
accessPolicyChainImplies,
|
|
13965
15781
|
applyViewRuntimeBindings,
|
|
13966
15782
|
assertMonkeysThemeTokensComplete,
|
|
13967
15783
|
assertThemeTokensDocumentStructure,
|
|
13968
15784
|
buildApplicationHandoffUrl,
|
|
13969
15785
|
buildChangeImpactGraph,
|
|
15786
|
+
canonicalContentHash,
|
|
13970
15787
|
compileCapabilityRegistry,
|
|
13971
15788
|
compileConductorWorkflowDefinition,
|
|
13972
15789
|
compileMenuRuntimeBundle,
|
|
15790
|
+
compileNavigationRuntimeBundle,
|
|
15791
|
+
compilePageRuntimeBundle,
|
|
13973
15792
|
compilePageRuntimeProjection,
|
|
13974
15793
|
compileProductAccessDeclaration,
|
|
13975
15794
|
compileProductDeclaration,
|
|
13976
15795
|
compileProductRuntimeCatalog,
|
|
13977
15796
|
compileRenderTree,
|
|
15797
|
+
compileRouteClaims,
|
|
13978
15798
|
compileTenantRuntimeBindings,
|
|
13979
15799
|
compileTenantRuntimeConfig,
|
|
13980
15800
|
compileToolCapabilityManifest,
|
|
13981
15801
|
compileViewProviderInput,
|
|
13982
15802
|
compileViewProviderRegistry,
|
|
15803
|
+
compileWorkbenchRuntimeBundle,
|
|
13983
15804
|
compileWorkflowDefinitionFromConductor,
|
|
13984
15805
|
compileWorkflowPersistenceProjection,
|
|
13985
15806
|
createAgentSessionEventProjection,
|
|
@@ -13987,8 +15808,15 @@ export {
|
|
|
13987
15808
|
createOpenApiCapabilityRegistrySource,
|
|
13988
15809
|
createToolCapabilityManifest,
|
|
13989
15810
|
createWorkflowCapabilityManifest,
|
|
15811
|
+
declarativeCreateTemplateRevisionHash,
|
|
15812
|
+
declarativeCreateTemplateSourceHash,
|
|
15813
|
+
declarativeProductResourceRevisionHash,
|
|
15814
|
+
declarativeProductResourceSourceHash,
|
|
15815
|
+
declarativeRouteSpaceRevisionHash,
|
|
15816
|
+
declarativeRouteSpaceSourceHash,
|
|
13990
15817
|
extractOpenApiCapabilityManifests,
|
|
13991
15818
|
isCompiledMenuItemSelected,
|
|
15819
|
+
materializeRouteSpacePath,
|
|
13992
15820
|
mergeThemeTokenDocuments,
|
|
13993
15821
|
parseApplicationHandoff,
|
|
13994
15822
|
projectAgentSessionEvents,
|
|
@@ -13997,11 +15825,17 @@ export {
|
|
|
13997
15825
|
readMenuActivationFromSearch,
|
|
13998
15826
|
resolveMenuActivationId,
|
|
13999
15827
|
resolveThemeTokens,
|
|
15828
|
+
resolveWorkbenchEntry,
|
|
15829
|
+
revisionRefKey,
|
|
15830
|
+
sameRevisionRef,
|
|
15831
|
+
sameStableRef,
|
|
14000
15832
|
serializeApplicationHandoff,
|
|
14001
15833
|
serializeMenuActivationSearch,
|
|
15834
|
+
stableRefKey,
|
|
14002
15835
|
toAgentSessionViewModel,
|
|
14003
15836
|
validateDomainCommand,
|
|
14004
15837
|
validateThemeTokensDocument,
|
|
14005
|
-
validateThemeTokensDocumentStructure
|
|
15838
|
+
validateThemeTokensDocumentStructure,
|
|
15839
|
+
validateWorkbenchRuntimeSet
|
|
14006
15840
|
};
|
|
14007
15841
|
//# sourceMappingURL=index.mjs.map
|