@inf-monkeys-tech/monkeys 1.0.65 → 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.
Files changed (61) hide show
  1. package/README.md +6 -0
  2. package/lib/contracts/capability.d.ts +4 -0
  3. package/lib/contracts/capability.d.ts.map +1 -1
  4. package/lib/contracts/capability.js +1 -0
  5. package/lib/contracts/capability.js.map +1 -1
  6. package/lib/contracts/declarative-control-http.d.ts +81284 -0
  7. package/lib/contracts/declarative-control-http.d.ts.map +1 -0
  8. package/lib/contracts/declarative-control-http.js +926 -0
  9. package/lib/contracts/declarative-control-http.js.map +1 -0
  10. package/lib/contracts/declarative-control.d.ts +17709 -0
  11. package/lib/contracts/declarative-control.d.ts.map +1 -0
  12. package/lib/contracts/declarative-control.js +1075 -0
  13. package/lib/contracts/declarative-control.js.map +1 -0
  14. package/lib/contracts/index.d.ts +2 -0
  15. package/lib/contracts/index.d.ts.map +1 -1
  16. package/lib/contracts/index.js +2 -0
  17. package/lib/contracts/index.js.map +1 -1
  18. package/lib/contracts/menu.d.ts +1 -1
  19. package/lib/contracts/page.d.ts +3 -3
  20. package/lib/contracts/semantic.d.ts +78 -1
  21. package/lib/contracts/semantic.d.ts.map +1 -1
  22. package/lib/contracts/semantic.js +27 -1
  23. package/lib/contracts/semantic.js.map +1 -1
  24. package/lib/contracts/tenant.d.ts +12 -12
  25. package/lib/contracts/trend.d.ts +4 -4
  26. package/lib/esm/contracts/index.mjs +2868 -1028
  27. package/lib/esm/contracts/index.mjs.map +1 -1
  28. package/lib/esm/index.mjs +5746 -3027
  29. package/lib/esm/index.mjs.map +1 -1
  30. package/lib/esm/runtime/index.mjs +2415 -594
  31. package/lib/esm/runtime/index.mjs.map +1 -1
  32. package/lib/esm/schemas/index.mjs +1986 -962
  33. package/lib/esm/schemas/index.mjs.map +1 -1
  34. package/lib/json-schema/capability-registry.schema.json +2 -1
  35. package/lib/json-schema/declarative-control-ontology-definition.schema.json +130 -0
  36. package/lib/json-schema/index.json +13 -0
  37. package/lib/json-schema/navigation-release.schema.json +2037 -0
  38. package/lib/json-schema/navigation-runtime-bundle.schema.json +7497 -0
  39. package/lib/json-schema/navigation.schema.json +4649 -0
  40. package/lib/json-schema/page-release.schema.json +2457 -0
  41. package/lib/json-schema/page-runtime-bundle.schema.json +5705 -0
  42. package/lib/json-schema/page.schema.json +7944 -0
  43. package/lib/json-schema/publication-plan.schema.json +1286 -0
  44. package/lib/json-schema/route-space.schema.json +93 -0
  45. package/lib/json-schema/stable-ref-alias-map.schema.json +535 -0
  46. package/lib/json-schema/workbench-release.schema.json +2473 -0
  47. package/lib/json-schema/workbench-runtime-bundle.schema.json +5274 -0
  48. package/lib/json-schema/workbench.schema.json +6698 -0
  49. package/lib/runtime/declarative-control-compiler.d.ts +141 -0
  50. package/lib/runtime/declarative-control-compiler.d.ts.map +1 -0
  51. package/lib/runtime/declarative-control-compiler.js +874 -0
  52. package/lib/runtime/declarative-control-compiler.js.map +1 -0
  53. package/lib/runtime/index.d.ts +1 -0
  54. package/lib/runtime/index.d.ts.map +1 -1
  55. package/lib/runtime/index.js +1 -0
  56. package/lib/runtime/index.js.map +1 -1
  57. package/lib/schemas/index.d.ts +14116 -3955
  58. package/lib/schemas/index.d.ts.map +1 -1
  59. package/lib/schemas/index.js +76 -4
  60. package/lib/schemas/index.js.map +1 -1
  61. package/package.json +1 -1
@@ -7096,7 +7096,8 @@ var CapabilitySourceTypeSchema = z5.enum([
7096
7096
  "plugin-manifest",
7097
7097
  "openapi",
7098
7098
  "workflow",
7099
- "comfyui"
7099
+ "comfyui",
7100
+ "design-view-provider"
7100
7101
  ]);
7101
7102
  var CapabilityRegistrySourceSchema = z5.object({
7102
7103
  sourceType: CapabilitySourceTypeSchema,
@@ -8352,12 +8353,946 @@ var DomainEventSchema = z9.object({
8352
8353
  occurredAt: IsoDateTimeSchema
8353
8354
  }).strict();
8354
8355
 
8356
+ // src/contracts/declarative-control.ts
8357
+ import { z as z10 } from "zod";
8358
+ var DECLARATIVE_CONTROL_SCHEMA_VERSION = 1;
8359
+ var uniqueArray = (values, identity) => {
8360
+ const seen = /* @__PURE__ */ new Set();
8361
+ for (const value of values) {
8362
+ const key = identity(value);
8363
+ if (seen.has(key)) return key;
8364
+ seen.add(key);
8365
+ }
8366
+ return void 0;
8367
+ };
8368
+ var I18nTextSchema = z10.object({
8369
+ defaultLocale: LocaleIdentifierSchema,
8370
+ values: z10.record(LocaleIdentifierSchema, z10.string().trim().min(1))
8371
+ }).strict().superRefine((value, context) => {
8372
+ if (!Object.prototype.hasOwnProperty.call(value.values, value.defaultLocale)) {
8373
+ context.addIssue({
8374
+ code: "custom",
8375
+ path: ["values", value.defaultLocale],
8376
+ message: "I18nText values must contain the default locale."
8377
+ });
8378
+ }
8379
+ });
8380
+ var ScopedIdentityRefSchema = z10.object({
8381
+ kind: ContractIdentifierSchema,
8382
+ id: ContractIdentifierSchema,
8383
+ ownerRepo: ContractIdentifierSchema
8384
+ }).strict();
8385
+ var TenantScopeSchema = z10.object({
8386
+ tenantRef: ScopedIdentityRefSchema,
8387
+ dataSpaceRef: ScopedIdentityRefSchema,
8388
+ teamRef: ScopedIdentityRefSchema.optional()
8389
+ }).strict().superRefine((value, context) => {
8390
+ const expectedKinds = [
8391
+ ["tenantRef", value.tenantRef, "tenant"],
8392
+ ["dataSpaceRef", value.dataSpaceRef, "data-space"],
8393
+ ["teamRef", value.teamRef, "team"]
8394
+ ];
8395
+ expectedKinds.forEach(([field, reference, expectedKind]) => {
8396
+ if (reference && reference.kind !== expectedKind) {
8397
+ context.addIssue({ code: "custom", path: [field, "kind"], message: `${field} must reference ${expectedKind}.` });
8398
+ }
8399
+ });
8400
+ });
8401
+ var ReferenceVisibilitySchema = z10.enum(["tenant", "global", "public"]);
8402
+ var StableRefShape = {
8403
+ kind: ContractIdentifierSchema,
8404
+ id: ContractIdentifierSchema,
8405
+ ownerRepo: ContractIdentifierSchema,
8406
+ visibility: ReferenceVisibilitySchema,
8407
+ tenantScope: TenantScopeSchema.optional()
8408
+ };
8409
+ var validateReferenceScope = (value, context) => {
8410
+ if (value.visibility === "tenant" && !value.tenantScope) {
8411
+ context.addIssue({ code: "custom", path: ["tenantScope"], message: "Tenant references require an explicit tenant scope." });
8412
+ }
8413
+ if (value.visibility !== "tenant" && value.tenantScope) {
8414
+ context.addIssue({ code: "custom", path: ["tenantScope"], message: "Global and public references cannot carry a tenant scope." });
8415
+ }
8416
+ };
8417
+ var StableRefSchema = z10.object(StableRefShape).strict().superRefine(validateReferenceScope);
8418
+ var RevisionRefSchema = z10.object({
8419
+ ...StableRefShape,
8420
+ revision: z10.number().int().positive(),
8421
+ schemaVersion: ContractVersionSchema,
8422
+ contentHash: Sha256Schema
8423
+ }).strict().superRefine(validateReferenceScope);
8424
+ var scopedIdentityKey = (reference) => `${reference.kind}:${reference.id}:${reference.ownerRepo}`;
8425
+ var tenantScopeKey = (scope) => `${scopedIdentityKey(scope.tenantRef)}:${scopedIdentityKey(scope.dataSpaceRef)}:${scope.teamRef ? scopedIdentityKey(scope.teamRef) : ""}`;
8426
+ var stableRefIdentity = (reference) => `${reference.visibility}:${reference.tenantScope ? tenantScopeKey(reference.tenantScope) : ""}:${reference.kind}:${reference.id}:${reference.ownerRepo}`;
8427
+ var exactRevisionRef = (left, right) => stableRefIdentity(left) === stableRefIdentity(right) && left.revision === right.revision && left.schemaVersion === right.schemaVersion && left.contentHash === right.contentHash;
8428
+ var StableRefAliasSchema = z10.object({
8429
+ aliasRef: StableRefSchema,
8430
+ canonicalRef: StableRefSchema,
8431
+ validFrom: IsoDateTimeSchema,
8432
+ validUntil: IsoDateTimeSchema.nullable(),
8433
+ evidenceRef: RevisionRefSchema
8434
+ }).strict().superRefine((value, context) => {
8435
+ if (value.aliasRef.kind !== value.canonicalRef.kind) {
8436
+ context.addIssue({ code: "custom", path: ["canonicalRef", "kind"], message: "Alias and canonical references must have the same kind." });
8437
+ }
8438
+ if (value.validUntil && value.validUntil <= value.validFrom) {
8439
+ context.addIssue({ code: "custom", path: ["validUntil"], message: "Alias validUntil must be later than validFrom." });
8440
+ }
8441
+ });
8442
+ var StableRefAliasMapSchema = z10.object({
8443
+ contract: z10.literal("StableRefAliasMap"),
8444
+ schemaVersion: z10.literal(DECLARATIVE_CONTROL_SCHEMA_VERSION),
8445
+ tenantScope: TenantScopeSchema,
8446
+ aliases: z10.array(StableRefAliasSchema),
8447
+ contentHash: Sha256Schema
8448
+ }).strict().superRefine((value, context) => {
8449
+ const duplicate = uniqueArray(value.aliases, (entry) => stableRefIdentity(entry.aliasRef));
8450
+ if (duplicate) context.addIssue({ code: "custom", path: ["aliases"], message: `Duplicate alias reference: ${duplicate}` });
8451
+ });
8452
+ var DeclarativeLifecycleSchema = z10.enum(["active", "deprecated", "retired"]);
8453
+ var ProductSurfaceSchema = z10.enum(["studio", "kernel"]);
8454
+ var GroupRefSchema = StableRefSchema.superRefine((value, context) => {
8455
+ if (value.kind !== "group") context.addIssue({ code: "custom", path: ["kind"], message: "Access group references must use kind group." });
8456
+ });
8457
+ var AccessConditionRefSchema = RevisionRefSchema.superRefine((value, context) => {
8458
+ if (value.kind !== "access-condition") {
8459
+ context.addIssue({ code: "custom", path: ["kind"], message: "Access condition references must use kind access-condition." });
8460
+ }
8461
+ });
8462
+ var AccessPolicySchema = z10.object({
8463
+ authenticated: z10.boolean(),
8464
+ groupAllOf: z10.array(GroupRefSchema),
8465
+ groupAnyOf: z10.array(GroupRefSchema),
8466
+ permissionAllOf: z10.array(ContractIdentifierSchema),
8467
+ permissionAnyOf: z10.array(ContractIdentifierSchema),
8468
+ conditionAllOf: z10.array(AccessConditionRefSchema)
8469
+ }).strict().superRefine((value, context) => {
8470
+ const checks = [
8471
+ ["groupAllOf", value.groupAllOf, (candidate) => stableRefIdentity(candidate)],
8472
+ ["groupAnyOf", value.groupAnyOf, (candidate) => stableRefIdentity(candidate)],
8473
+ ["permissionAllOf", value.permissionAllOf, String],
8474
+ ["permissionAnyOf", value.permissionAnyOf, String],
8475
+ ["conditionAllOf", value.conditionAllOf, (candidate) => `${stableRefIdentity(candidate)}@${candidate.revision}`]
8476
+ ];
8477
+ checks.forEach(([field, values, identity]) => {
8478
+ if (uniqueArray(values, identity)) context.addIssue({ code: "custom", path: [field], message: `${field} entries must be unique.` });
8479
+ });
8480
+ });
8481
+ var ManagementAccessSchema = z10.object({
8482
+ edit: AccessPolicySchema,
8483
+ preview: AccessPolicySchema,
8484
+ publish: AccessPolicySchema,
8485
+ deactivate: AccessPolicySchema,
8486
+ rollback: AccessPolicySchema,
8487
+ retire: AccessPolicySchema
8488
+ }).strict();
8489
+ var RoutePathTemplateSchema = z10.string().trim().regex(/^\/(?!\/)/, "Expected an application-relative path.").superRefine((value, context) => {
8490
+ if (value.includes("?") || value.includes("#") || value.includes("\\")) {
8491
+ context.addIssue({ code: "custom", message: "Route paths cannot contain query strings, fragments, or backslashes." });
8492
+ }
8493
+ if (value.split("/").some((segment) => segment === "." || segment === "..")) {
8494
+ context.addIssue({ code: "custom", message: "Route paths cannot contain traversal segments." });
8495
+ }
8496
+ if (/^[a-z][a-z0-9+.-]*:/i.test(value) || value.includes("://")) {
8497
+ context.addIssue({ code: "custom", message: "Route paths cannot contain a scheme or host." });
8498
+ }
8499
+ });
8500
+ var RouteSpaceParameterSchema = z10.object({
8501
+ name: ContractIdentifierSchema,
8502
+ type: z10.enum(["identifier", "integer", "slug", "uuid"]),
8503
+ required: z10.boolean()
8504
+ }).strict();
8505
+ var RouteSpaceSchema = z10.object({
8506
+ contract: z10.literal("RouteSpace"),
8507
+ schemaVersion: z10.literal(DECLARATIVE_CONTROL_SCHEMA_VERSION),
8508
+ routeSpaceId: ContractIdentifierSchema,
8509
+ supportedSurface: ProductSurfaceSchema,
8510
+ basePath: RoutePathTemplateSchema,
8511
+ caseSensitive: z10.boolean(),
8512
+ trailingSlash: z10.enum(["preserve", "remove", "require"]),
8513
+ reservedPaths: z10.array(RoutePathTemplateSchema),
8514
+ parameters: z10.array(RouteSpaceParameterSchema)
8515
+ }).strict().superRefine((value, context) => {
8516
+ if (uniqueArray(value.parameters, (parameter) => parameter.name)) {
8517
+ context.addIssue({ code: "custom", path: ["parameters"], message: "RouteSpace parameter names must be unique." });
8518
+ }
8519
+ if (uniqueArray(value.reservedPaths, (path) => path)) {
8520
+ context.addIssue({ code: "custom", path: ["reservedPaths"], message: "RouteSpace reserved paths must be unique." });
8521
+ }
8522
+ });
8523
+ var RouteClaimBaseSchema = z10.object({
8524
+ kind: z10.enum(["canonical", "alias", "redirect"]),
8525
+ routeSpaceRevisionRef: RevisionRefSchema,
8526
+ pathTemplate: RoutePathTemplateSchema,
8527
+ redirectTargetRef: StableRefSchema.optional()
8528
+ }).strict().superRefine((value, context) => {
8529
+ if (value.routeSpaceRevisionRef.kind !== "route-space") {
8530
+ context.addIssue({ code: "custom", path: ["routeSpaceRevisionRef", "kind"], message: "Route claims must reference a route-space revision." });
8531
+ }
8532
+ if (value.kind === "redirect" && !value.redirectTargetRef) {
8533
+ context.addIssue({ code: "custom", path: ["redirectTargetRef"], message: "Redirect claims require a governed target reference." });
8534
+ }
8535
+ if (value.kind !== "redirect" && value.redirectTargetRef) {
8536
+ context.addIssue({ code: "custom", path: ["redirectTargetRef"], message: "Only redirect claims may declare redirectTargetRef." });
8537
+ }
8538
+ });
8539
+ var LegacyRouteClaimSchema = RouteClaimBaseSchema;
8540
+ var RouteClaimSchema = RouteClaimBaseSchema.safeExtend({
8541
+ surface: ProductSurfaceSchema
8542
+ }).strict();
8543
+ var DeclarativeRouteClaimSchema = RouteClaimSchema;
8544
+ var LegacyDeclarativeRouteClaimSchema = LegacyRouteClaimSchema;
8545
+ var CompiledRouteMatcherSchema = z10.object({
8546
+ caseSensitive: z10.boolean(),
8547
+ trailingSlash: z10.enum(["preserve", "remove", "require"]),
8548
+ parameters: z10.array(RouteSpaceParameterSchema)
8549
+ }).strict();
8550
+ var CompiledRouteClaimSchema = RouteClaimSchema.safeExtend({
8551
+ normalizedPath: RoutePathTemplateSchema,
8552
+ matcher: CompiledRouteMatcherSchema
8553
+ }).strict();
8554
+ var LegacyCompiledRouteClaimSchema = LegacyRouteClaimSchema.safeExtend({
8555
+ normalizedPath: RoutePathTemplateSchema,
8556
+ matcher: CompiledRouteMatcherSchema
8557
+ }).strict();
8558
+ var validateDeclaredRouteSurfaces = (supportedSurfaces, routeClaims, context) => {
8559
+ if (uniqueArray(supportedSurfaces, (surface) => surface)) {
8560
+ context.addIssue({ code: "custom", path: ["supportedSurfaces"], message: "Supported surfaces must be unique." });
8561
+ }
8562
+ const explicitClaims = routeClaims.filter((claim) => "surface" in claim);
8563
+ if (explicitClaims.length > 0 && explicitClaims.length < routeClaims.length) {
8564
+ context.addIssue({ code: "custom", path: ["routeClaims"], message: "Route claims must either all declare surface or all omit it for legacy compatibility." });
8565
+ return;
8566
+ }
8567
+ routeClaims.forEach((claim, index) => {
8568
+ if ("surface" in claim && !supportedSurfaces.includes(claim.surface)) {
8569
+ context.addIssue({ code: "custom", path: ["routeClaims", index, "surface"], message: "Route claim surface must be declared by supportedSurfaces." });
8570
+ }
8571
+ });
8572
+ if (explicitClaims.length !== routeClaims.length) return;
8573
+ supportedSurfaces.forEach((surface) => {
8574
+ const canonicalCount = explicitClaims.filter((claim) => claim.surface === surface && claim.kind === "canonical").length;
8575
+ if (canonicalCount !== 1) {
8576
+ context.addIssue({ code: "custom", path: ["routeClaims"], message: `Surface ${surface} requires exactly one canonical route claim.` });
8577
+ }
8578
+ });
8579
+ };
8580
+ var ReleaseOperationSchema = z10.enum(["activate", "deactivate", "rollback"]);
8581
+ var ReleaseDependencyRoleSchema = z10.enum([
8582
+ "route-space",
8583
+ "shell",
8584
+ "page",
8585
+ "page-release",
8586
+ "workbench",
8587
+ "workbench-release",
8588
+ "navigation",
8589
+ "navigation-release",
8590
+ "menu-action",
8591
+ "application-menu-catalog",
8592
+ "capability",
8593
+ "provider",
8594
+ "ontology-definition",
8595
+ "view",
8596
+ "projection",
8597
+ "action",
8598
+ "token",
8599
+ "schema",
8600
+ "compiler",
8601
+ "workflow",
8602
+ "agent",
8603
+ "built-in-application",
8604
+ "design",
8605
+ "layout-policy",
8606
+ "performance-budget",
8607
+ "observation-policy"
8608
+ ]);
8609
+ var DependencyKindByRole = {
8610
+ "route-space": "route-space",
8611
+ shell: "shell",
8612
+ page: "page",
8613
+ "page-release": "page-release",
8614
+ workbench: "workbench",
8615
+ "workbench-release": "workbench-release",
8616
+ navigation: "navigation",
8617
+ "navigation-release": "navigation-release",
8618
+ "menu-action": "menu-action",
8619
+ "application-menu-catalog": "application-menu-catalog",
8620
+ capability: "capability",
8621
+ provider: "view-provider",
8622
+ "ontology-definition": "ontology-definition",
8623
+ view: "view",
8624
+ projection: "projection",
8625
+ action: "domain-command",
8626
+ token: "design-token",
8627
+ schema: "schema",
8628
+ compiler: "compiler",
8629
+ workflow: "workflow",
8630
+ agent: "agent",
8631
+ "built-in-application": "built-in-application",
8632
+ design: "design",
8633
+ "layout-policy": "layout-policy",
8634
+ "performance-budget": "performance-budget",
8635
+ "observation-policy": "observation-policy"
8636
+ };
8637
+ var ReleaseDependencySchema = z10.object({
8638
+ role: ReleaseDependencyRoleSchema,
8639
+ revisionRef: RevisionRefSchema
8640
+ }).strict().superRefine((value, context) => {
8641
+ const expectedKind = DependencyKindByRole[value.role];
8642
+ if (value.revisionRef.kind !== expectedKind) {
8643
+ context.addIssue({
8644
+ code: "custom",
8645
+ path: ["revisionRef", "kind"],
8646
+ message: `Dependency role ${value.role} requires reference kind ${expectedKind}.`
8647
+ });
8648
+ }
8649
+ });
8650
+ var ReleaseValidationSchema = z10.object({
8651
+ result: z10.enum(["pass", "fail"]),
8652
+ inputHash: Sha256Schema,
8653
+ diagnosticRefs: z10.array(RevisionRefSchema)
8654
+ }).strict();
8655
+ var ReleaseEvidenceSchema = z10.object({
8656
+ publicationPlanRef: StableRefSchema,
8657
+ expectedHeadRevisionRef: RevisionRefSchema.nullable(),
8658
+ validation: ReleaseValidationSchema,
8659
+ approvalPolicyRevisionRef: RevisionRefSchema,
8660
+ approvalDecisionRevisionRef: RevisionRefSchema,
8661
+ actorRef: StableRefSchema,
8662
+ reason: z10.string().trim().min(1).max(4096),
8663
+ idempotencyKey: ContractIdentifierSchema,
8664
+ occurredAt: IsoDateTimeSchema,
8665
+ evidenceRefs: z10.array(RevisionRefSchema).min(1)
8666
+ }).strict().superRefine((value, context) => {
8667
+ const expectedKinds = [
8668
+ ["publicationPlanRef", value.publicationPlanRef, "publication-plan"],
8669
+ ["approvalPolicyRevisionRef", value.approvalPolicyRevisionRef, "approval-policy"],
8670
+ ["approvalDecisionRevisionRef", value.approvalDecisionRevisionRef, "approval-decision"],
8671
+ ["actorRef", value.actorRef, "actor"]
8672
+ ];
8673
+ expectedKinds.forEach(([field, reference, expectedKind]) => {
8674
+ if (reference.kind !== expectedKind) {
8675
+ context.addIssue({ code: "custom", path: [field, "kind"], message: `${field} must reference ${expectedKind}.` });
8676
+ }
8677
+ });
8678
+ value.evidenceRefs.forEach((reference, index) => {
8679
+ if (reference.kind !== "evidence") context.addIssue({ code: "custom", path: ["evidenceRefs", index, "kind"], message: "Release evidenceRefs must reference evidence revisions." });
8680
+ });
8681
+ });
8682
+ var PublicationPlanOperationSchema = z10.object({
8683
+ releaseKind: z10.enum(["page-release", "workbench-release", "navigation-release"]),
8684
+ releaseSlotId: ContractIdentifierSchema,
8685
+ releaseRevisionRef: RevisionRefSchema,
8686
+ expectedHeadRevisionRef: RevisionRefSchema.nullable()
8687
+ }).strict().superRefine((value, context) => {
8688
+ if (value.releaseRevisionRef.kind !== value.releaseKind || value.releaseRevisionRef.id !== value.releaseSlotId) {
8689
+ context.addIssue({ code: "custom", path: ["releaseRevisionRef"], message: "Publication Plan operation must pin the exact release slot revision." });
8690
+ }
8691
+ if (value.expectedHeadRevisionRef && (value.expectedHeadRevisionRef.kind !== value.releaseKind || value.expectedHeadRevisionRef.id !== value.releaseSlotId)) {
8692
+ context.addIssue({ code: "custom", path: ["expectedHeadRevisionRef"], message: "Expected head must identify the same release slot." });
8693
+ }
8694
+ });
8695
+ var PublicationPlanSchema = z10.object({
8696
+ contract: z10.literal("PublicationPlan"),
8697
+ schemaVersion: z10.literal(DECLARATIVE_CONTROL_SCHEMA_VERSION),
8698
+ planId: ContractIdentifierSchema,
8699
+ tenantScope: TenantScopeSchema,
8700
+ environmentRef: StableRefSchema,
8701
+ operations: z10.array(PublicationPlanOperationSchema).min(1),
8702
+ validation: ReleaseValidationSchema,
8703
+ approvalPolicyRevisionRef: RevisionRefSchema,
8704
+ approvalDecisionRevisionRef: RevisionRefSchema,
8705
+ actorRef: StableRefSchema,
8706
+ idempotencyKey: ContractIdentifierSchema,
8707
+ evidenceRefs: z10.array(RevisionRefSchema).min(1),
8708
+ createdAt: IsoDateTimeSchema
8709
+ }).strict().superRefine((value, context) => {
8710
+ if (value.environmentRef.kind !== "environment") context.addIssue({ code: "custom", path: ["environmentRef", "kind"], message: "Publication Plan requires an environment reference." });
8711
+ const governedRefs = [
8712
+ ["approvalPolicyRevisionRef", value.approvalPolicyRevisionRef, "approval-policy"],
8713
+ ["approvalDecisionRevisionRef", value.approvalDecisionRevisionRef, "approval-decision"],
8714
+ ["actorRef", value.actorRef, "actor"]
8715
+ ];
8716
+ governedRefs.forEach(([field, reference, expectedKind]) => {
8717
+ if (reference.kind !== expectedKind) context.addIssue({ code: "custom", path: [field, "kind"], message: `${field} must reference ${expectedKind}.` });
8718
+ });
8719
+ value.operations.forEach((operation, index) => {
8720
+ [operation.releaseRevisionRef, operation.expectedHeadRevisionRef].forEach((reference, referenceIndex) => {
8721
+ if (reference?.tenantScope && tenantScopeKey(reference.tenantScope) !== tenantScopeKey(value.tenantScope)) {
8722
+ const field = referenceIndex === 0 ? "releaseRevisionRef" : "expectedHeadRevisionRef";
8723
+ context.addIssue({ code: "custom", path: ["operations", index, field, "tenantScope"], message: "Publication Plan operation belongs to another tenant scope." });
8724
+ }
8725
+ });
8726
+ });
8727
+ value.evidenceRefs.forEach((reference, index) => {
8728
+ if (reference.kind !== "evidence") context.addIssue({ code: "custom", path: ["evidenceRefs", index, "kind"], message: "Publication Plan evidenceRefs must reference evidence revisions." });
8729
+ });
8730
+ if (uniqueArray(value.operations, (operation) => `${operation.releaseKind}:${operation.releaseSlotId}`)) {
8731
+ context.addIssue({ code: "custom", path: ["operations"], message: "Publication Plan release slots must be unique." });
8732
+ }
8733
+ });
8734
+ var IdentitySchema = z10.object({
8735
+ name: I18nTextSchema,
8736
+ description: I18nTextSchema.optional(),
8737
+ tags: z10.array(ContractIdentifierSchema).default([])
8738
+ }).strict();
8739
+ var WorkbenchIdentitySchema = IdentitySchema.extend({ iconRef: StableRefSchema.optional() }).strict();
8740
+ var ReleaseBaseShape = {
8741
+ schemaVersion: z10.literal(DECLARATIVE_CONTROL_SCHEMA_VERSION),
8742
+ releaseSlotId: ContractIdentifierSchema,
8743
+ tenantScope: TenantScopeSchema,
8744
+ operation: ReleaseOperationSchema,
8745
+ dependencySnapshot: z10.array(ReleaseDependencySchema),
8746
+ evidence: ReleaseEvidenceSchema
8747
+ };
8748
+ var validateDependencySnapshot = (snapshot, context) => {
8749
+ const duplicate = uniqueArray(snapshot, (dependency) => `${dependency.role}:${stableRefIdentity(dependency.revisionRef)}@${dependency.revisionRef.revision}`);
8750
+ if (duplicate) context.addIssue({ code: "custom", path: ["dependencySnapshot"], message: `Duplicate dependency: ${duplicate}` });
8751
+ };
8752
+ var validateReleaseExpectedHead = (value, expectedKind, context) => {
8753
+ const expectedHead = value.evidence.expectedHeadRevisionRef;
8754
+ if (expectedHead && (expectedHead.kind !== expectedKind || expectedHead.id !== value.releaseSlotId)) {
8755
+ context.addIssue({ code: "custom", path: ["evidence", "expectedHeadRevisionRef"], message: "Expected head must identify the same release slot." });
8756
+ }
8757
+ if (expectedHead?.tenantScope && tenantScopeKey(expectedHead.tenantScope) !== tenantScopeKey(value.tenantScope)) {
8758
+ context.addIssue({ code: "custom", path: ["evidence", "expectedHeadRevisionRef", "tenantScope"], message: "Expected head belongs to another tenant scope." });
8759
+ }
8760
+ };
8761
+ var BindingSourceSchema = z10.discriminatedUnion("kind", [
8762
+ z10.object({ kind: z10.literal("constant"), value: z10.union([z10.string(), z10.number().finite(), z10.boolean(), z10.null()]) }).strict(),
8763
+ z10.object({ kind: z10.literal("route-parameter"), name: ContractIdentifierSchema }).strict(),
8764
+ z10.object({ kind: z10.literal("query-parameter"), name: ContractIdentifierSchema }).strict(),
8765
+ z10.object({ kind: z10.literal("identity"), name: z10.enum(["tenantId", "teamId", "userId"]) }).strict(),
8766
+ z10.object({ kind: z10.literal("intent-field"), path: z10.string().trim().regex(/^[A-Za-z0-9_.-]+$/) }).strict(),
8767
+ z10.object({ kind: z10.literal("binding-field"), bindingId: ContractIdentifierSchema, path: z10.string().trim().regex(/^[A-Za-z0-9_.-]+$/) }).strict()
8768
+ ]);
8769
+ var CapabilityInstanceSchema = z10.object({
8770
+ instanceId: ContractIdentifierSchema,
8771
+ nodeId: ContractIdentifierSchema,
8772
+ capabilityRevisionRef: RevisionRefSchema,
8773
+ providerRevisionRef: RevisionRefSchema,
8774
+ propertySchemaRevisionRef: RevisionRefSchema,
8775
+ properties: JsonObjectSchema,
8776
+ allowedSideEffects: z10.array(z10.enum(["network", "storage", "navigation", "worker", "websocket"]))
8777
+ }).strict();
8778
+ var OntologyBindingSchema = z10.object({
8779
+ bindingId: ContractIdentifierSchema,
8780
+ ontologyDefinitionRevisionRef: RevisionRefSchema,
8781
+ viewRevisionRef: RevisionRefSchema.optional(),
8782
+ projectionRevisionRef: RevisionRefSchema.optional(),
8783
+ parameters: z10.record(ContractIdentifierSchema, BindingSourceSchema),
8784
+ target: z10.object({ capabilityInstanceId: ContractIdentifierSchema, port: ContractIdentifierSchema }).strict(),
8785
+ renderModelSchemaRevisionRef: RevisionRefSchema,
8786
+ pagination: z10.enum(["none", "cursor", "offset"]),
8787
+ cache: z10.enum(["none", "identity-scoped", "tenant-scoped"]),
8788
+ cancelOnChange: z10.boolean()
8789
+ }).strict().superRefine((value, context) => {
8790
+ if ((value.viewRevisionRef ? 1 : 0) + (value.projectionRevisionRef ? 1 : 0) !== 1) {
8791
+ context.addIssue({ code: "custom", path: ["viewRevisionRef"], message: "Ontology bindings require exactly one View or Projection revision." });
8792
+ }
8793
+ if (value.ontologyDefinitionRevisionRef.kind !== "ontology-definition") {
8794
+ context.addIssue({ code: "custom", path: ["ontologyDefinitionRevisionRef", "kind"], message: "Expected an ontology-definition revision." });
8795
+ }
8796
+ });
8797
+ var ActionBindingSchema = z10.object({
8798
+ bindingId: ContractIdentifierSchema,
8799
+ commandRevisionRef: RevisionRefSchema,
8800
+ source: z10.object({ capabilityInstanceId: ContractIdentifierSchema, port: ContractIdentifierSchema }).strict(),
8801
+ sourceIntentSchemaRevisionRef: RevisionRefSchema,
8802
+ inputSchemaRevisionRef: RevisionRefSchema,
8803
+ inputMapping: z10.record(ContractIdentifierSchema, BindingSourceSchema),
8804
+ accessPolicy: AccessPolicySchema,
8805
+ confirmation: I18nTextSchema.optional(),
8806
+ idempotencyKeySource: z10.enum(["interaction", "record-and-interaction", "caller-provided"]),
8807
+ compensationCommandRevisionRef: RevisionRefSchema.optional(),
8808
+ resultSchemaRevisionRef: RevisionRefSchema,
8809
+ success: z10.object({
8810
+ refreshBindingIds: z10.array(ContractIdentifierSchema),
8811
+ navigationTargetRef: StableRefSchema.optional()
8812
+ }).strict(),
8813
+ recovery: z10.enum(["retry-safe", "compensating-command", "manual-review"]),
8814
+ lineageRequired: z10.literal(true)
8815
+ }).strict().superRefine((value, context) => {
8816
+ if (value.commandRevisionRef.kind !== "domain-command") {
8817
+ context.addIssue({ code: "custom", path: ["commandRevisionRef", "kind"], message: "Action bindings must reference a domain-command revision." });
8818
+ }
8819
+ if (value.sourceIntentSchemaRevisionRef.kind !== "schema") {
8820
+ context.addIssue({ code: "custom", path: ["sourceIntentSchemaRevisionRef", "kind"], message: "Action source intents must pin a schema revision." });
8821
+ }
8822
+ if (value.inputSchemaRevisionRef.kind !== "schema") {
8823
+ context.addIssue({ code: "custom", path: ["inputSchemaRevisionRef", "kind"], message: "Action command inputs must pin a schema revision." });
8824
+ }
8825
+ if (value.recovery === "compensating-command" && !value.compensationCommandRevisionRef) {
8826
+ context.addIssue({ code: "custom", path: ["compensationCommandRevisionRef"], message: "Compensating recovery requires a compensation command." });
8827
+ }
8828
+ });
8829
+ var PageSchema = z10.object({
8830
+ contract: z10.literal("Page"),
8831
+ schemaVersion: z10.literal(DECLARATIVE_CONTROL_SCHEMA_VERSION),
8832
+ pageId: ContractIdentifierSchema,
8833
+ tenantScope: TenantScopeSchema,
8834
+ identity: IdentitySchema,
8835
+ supportedSurfaces: z10.array(ProductSurfaceSchema).min(1),
8836
+ lifecycle: DeclarativeLifecycleSchema,
8837
+ routeClaims: z10.array(z10.union([DeclarativeRouteClaimSchema, LegacyDeclarativeRouteClaimSchema])).min(1),
8838
+ shellRevisionRef: RevisionRefSchema,
8839
+ renderTree: RenderTreeSchema,
8840
+ capabilityInstances: z10.array(CapabilityInstanceSchema).min(1),
8841
+ ontologyBindings: z10.array(OntologyBindingSchema),
8842
+ actionBindings: z10.array(ActionBindingSchema),
8843
+ pageAccessPolicy: AccessPolicySchema,
8844
+ managementAccess: ManagementAccessSchema,
8845
+ tokenRevisionRefs: z10.array(RevisionRefSchema).min(1),
8846
+ performanceBudgetRef: RevisionRefSchema,
8847
+ observationPolicyRevisionRef: RevisionRefSchema,
8848
+ privacyClassification: z10.enum(["public", "internal", "confidential", "restricted"])
8849
+ }).strict().superRefine((value, context) => {
8850
+ validateDeclaredRouteSurfaces(value.supportedSurfaces, value.routeClaims, context);
8851
+ const uniqueness = [
8852
+ ["capabilityInstances", value.capabilityInstances, (candidate) => String(candidate.instanceId)],
8853
+ ["ontologyBindings", value.ontologyBindings, (candidate) => String(candidate.bindingId)],
8854
+ ["actionBindings", value.actionBindings, (candidate) => String(candidate.bindingId)]
8855
+ ];
8856
+ uniqueness.forEach(([field, values, identity]) => {
8857
+ if (uniqueArray(values, identity)) context.addIssue({ code: "custom", path: [field], message: `${field} identities must be unique.` });
8858
+ });
8859
+ const instanceIds = new Set(value.capabilityInstances.map((instance) => instance.instanceId));
8860
+ value.ontologyBindings.forEach((binding, index) => {
8861
+ if (!instanceIds.has(binding.target.capabilityInstanceId)) {
8862
+ context.addIssue({ code: "custom", path: ["ontologyBindings", index, "target", "capabilityInstanceId"], message: "Ontology binding targets an unknown capability instance." });
8863
+ }
8864
+ });
8865
+ value.actionBindings.forEach((binding, index) => {
8866
+ if (!instanceIds.has(binding.source.capabilityInstanceId)) {
8867
+ context.addIssue({ code: "custom", path: ["actionBindings", index, "source", "capabilityInstanceId"], message: "Action binding sources an unknown capability instance." });
8868
+ }
8869
+ binding.success.refreshBindingIds.forEach((bindingId) => {
8870
+ if (!value.ontologyBindings.some((candidate) => candidate.bindingId === bindingId)) {
8871
+ context.addIssue({ code: "custom", path: ["actionBindings", index, "success", "refreshBindingIds"], message: `Unknown refresh binding: ${bindingId}` });
8872
+ }
8873
+ });
8874
+ });
8875
+ if (value.shellRevisionRef.kind !== "shell") context.addIssue({ code: "custom", path: ["shellRevisionRef", "kind"], message: "Page shellRevisionRef must reference a shell." });
8876
+ value.capabilityInstances.forEach((instance, index) => {
8877
+ const refs = [
8878
+ ["capabilityRevisionRef", instance.capabilityRevisionRef, "capability"],
8879
+ ["providerRevisionRef", instance.providerRevisionRef, "view-provider"],
8880
+ ["propertySchemaRevisionRef", instance.propertySchemaRevisionRef, "schema"]
8881
+ ];
8882
+ refs.forEach(([field, reference, expectedKind]) => {
8883
+ if (reference.kind !== expectedKind) context.addIssue({ code: "custom", path: ["capabilityInstances", index, field, "kind"], message: `${field} must reference ${expectedKind}.` });
8884
+ });
8885
+ });
8886
+ value.tokenRevisionRefs.forEach((reference, index) => {
8887
+ if (reference.kind !== "design-token") context.addIssue({ code: "custom", path: ["tokenRevisionRefs", index, "kind"], message: "Page token references must use kind design-token." });
8888
+ });
8889
+ if (value.performanceBudgetRef.kind !== "performance-budget") context.addIssue({ code: "custom", path: ["performanceBudgetRef", "kind"], message: "Page requires a performance-budget revision." });
8890
+ if (value.observationPolicyRevisionRef.kind !== "observation-policy") context.addIssue({ code: "custom", path: ["observationPolicyRevisionRef", "kind"], message: "Page requires an observation-policy revision." });
8891
+ });
8892
+ var PageReleaseSchema = z10.object({
8893
+ contract: z10.literal("PageRelease"),
8894
+ ...ReleaseBaseShape,
8895
+ pageRevisionRef: RevisionRefSchema,
8896
+ target: z10.object({
8897
+ environmentRef: StableRefSchema,
8898
+ surface: ProductSurfaceSchema,
8899
+ routeSpaceRevisionRef: RevisionRefSchema,
8900
+ normalizedPath: RoutePathTemplateSchema,
8901
+ routeClaim: z10.union([CompiledRouteClaimSchema, LegacyCompiledRouteClaimSchema])
8902
+ }).strict()
8903
+ }).strict().superRefine((value, context) => {
8904
+ validateDependencySnapshot(value.dependencySnapshot, context);
8905
+ validateReleaseExpectedHead(value, "page-release", context);
8906
+ if (value.pageRevisionRef.kind !== "page") context.addIssue({ code: "custom", path: ["pageRevisionRef", "kind"], message: "Expected a page revision." });
8907
+ if (value.target.environmentRef.kind !== "environment") context.addIssue({ code: "custom", path: ["target", "environmentRef", "kind"], message: "Page release target requires an environment reference." });
8908
+ if (value.target.routeSpaceRevisionRef.kind !== "route-space") context.addIssue({ code: "custom", path: ["target", "routeSpaceRevisionRef", "kind"], message: "Page release target requires a route-space revision." });
8909
+ if (value.target.normalizedPath !== value.target.routeClaim.normalizedPath || !exactRevisionRef(value.target.routeSpaceRevisionRef, value.target.routeClaim.routeSpaceRevisionRef)) {
8910
+ context.addIssue({ code: "custom", path: ["target", "routeClaim"], message: "Page Release route authority must pin the exact compiled claim and normalized path." });
8911
+ }
8912
+ if ("surface" in value.target.routeClaim && value.target.routeClaim.surface !== value.target.surface) {
8913
+ context.addIssue({ code: "custom", path: ["target", "routeClaim", "surface"], message: "Page Release route claim must match the target surface." });
8914
+ }
8915
+ });
8916
+ var WorkbenchGroupSchema = z10.object({
8917
+ groupId: ContractIdentifierSchema,
8918
+ label: I18nTextSchema,
8919
+ iconRef: StableRefSchema.optional(),
8920
+ order: z10.number().int(),
8921
+ collapsedByDefault: z10.boolean(),
8922
+ accessPolicy: AccessPolicySchema.optional()
8923
+ }).strict();
8924
+ var WorkbenchAppInstanceSchema = z10.object({
8925
+ instanceId: ContractIdentifierSchema,
8926
+ kind: z10.enum(["built-in-application", "workflow-form", "workflow", "agent", "design", "capability"]),
8927
+ targetRevisionRef: RevisionRefSchema,
8928
+ providerRevisionRef: RevisionRefSchema,
8929
+ inputSchemaRevisionRef: RevisionRefSchema,
8930
+ input: JsonObjectSchema,
8931
+ groupId: ContractIdentifierSchema,
8932
+ order: z10.number().int(),
8933
+ display: z10.object({ name: I18nTextSchema.optional(), iconRef: StableRefSchema.optional() }).strict(),
8934
+ accessPolicy: AccessPolicySchema
8935
+ }).strict();
8936
+ var WorkbenchSchema = z10.object({
8937
+ contract: z10.literal("Workbench"),
8938
+ schemaVersion: z10.literal(DECLARATIVE_CONTROL_SCHEMA_VERSION),
8939
+ workbenchId: ContractIdentifierSchema,
8940
+ tenantScope: TenantScopeSchema,
8941
+ purpose: z10.enum(["instance", "template"]),
8942
+ sourceTemplateRevisionRef: RevisionRefSchema.optional(),
8943
+ identity: WorkbenchIdentitySchema,
8944
+ supportedSurfaces: z10.array(ProductSurfaceSchema).min(1),
8945
+ lifecycle: DeclarativeLifecycleSchema,
8946
+ routeClaims: z10.array(z10.union([DeclarativeRouteClaimSchema, LegacyDeclarativeRouteClaimSchema])).min(1),
8947
+ groups: z10.array(WorkbenchGroupSchema).min(1),
8948
+ appInstances: z10.array(WorkbenchAppInstanceSchema).min(1),
8949
+ defaultEntry: z10.object({ groupId: ContractIdentifierSchema, instanceId: ContractIdentifierSchema, showDefaultGroup: z10.boolean() }).strict(),
8950
+ layout: z10.object({
8951
+ hostCapabilityRevisionRef: RevisionRefSchema,
8952
+ hostProviderRevisionRef: RevisionRefSchema,
8953
+ layoutPolicyRevisionRef: RevisionRefSchema,
8954
+ tokenRevisionRefs: z10.array(RevisionRefSchema).min(1)
8955
+ }).strict(),
8956
+ workbenchAccessPolicy: AccessPolicySchema,
8957
+ managementAccess: ManagementAccessSchema,
8958
+ personalPreferencesPolicy: z10.object({
8959
+ allowed: z10.array(z10.enum(["collapsed-groups", "recent-entry", "layout-density"])),
8960
+ authority: z10.literal("identity-overlay")
8961
+ }).strict(),
8962
+ performanceBudgetRef: RevisionRefSchema,
8963
+ observationPolicyRevisionRef: RevisionRefSchema,
8964
+ privacyClassification: z10.enum(["public", "internal", "confidential", "restricted"])
8965
+ }).strict().superRefine((value, context) => {
8966
+ validateDeclaredRouteSurfaces(value.supportedSurfaces, value.routeClaims, context);
8967
+ if (value.purpose === "template" && value.sourceTemplateRevisionRef) {
8968
+ context.addIssue({ code: "custom", path: ["sourceTemplateRevisionRef"], message: "Templates cannot derive from another template at runtime." });
8969
+ }
8970
+ const duplicateGroup = uniqueArray(value.groups, (group) => group.groupId);
8971
+ if (duplicateGroup) context.addIssue({ code: "custom", path: ["groups"], message: `Duplicate Workbench group: ${duplicateGroup}` });
8972
+ const duplicateInstance = uniqueArray(value.appInstances, (instance) => instance.instanceId);
8973
+ if (duplicateInstance) context.addIssue({ code: "custom", path: ["appInstances"], message: `Duplicate Workbench instance: ${duplicateInstance}` });
8974
+ const groupIds = new Set(value.groups.map((group) => group.groupId));
8975
+ value.appInstances.forEach((instance, index) => {
8976
+ if (!groupIds.has(instance.groupId)) context.addIssue({ code: "custom", path: ["appInstances", index, "groupId"], message: "Workbench app references an unknown group." });
8977
+ });
8978
+ const defaultInstance = value.appInstances.find((instance) => instance.instanceId === value.defaultEntry.instanceId);
8979
+ if (!defaultInstance || defaultInstance.groupId !== value.defaultEntry.groupId) {
8980
+ context.addIssue({ code: "custom", path: ["defaultEntry"], message: "Workbench default entry must reference an app in the declared group." });
8981
+ }
8982
+ const targetKindByInstanceKind = {
8983
+ "built-in-application": "built-in-application",
8984
+ "workflow-form": "workflow",
8985
+ workflow: "workflow",
8986
+ agent: "agent",
8987
+ design: "design",
8988
+ capability: "capability"
8989
+ };
8990
+ value.appInstances.forEach((instance, index) => {
8991
+ 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.` });
8992
+ if (instance.providerRevisionRef.kind !== "view-provider") context.addIssue({ code: "custom", path: ["appInstances", index, "providerRevisionRef", "kind"], message: "Workbench app provider must use kind view-provider." });
8993
+ if (instance.inputSchemaRevisionRef.kind !== "schema") context.addIssue({ code: "custom", path: ["appInstances", index, "inputSchemaRevisionRef", "kind"], message: "Workbench app input must pin a schema revision." });
8994
+ });
8995
+ const layoutRefs = [
8996
+ ["hostCapabilityRevisionRef", value.layout.hostCapabilityRevisionRef, "capability"],
8997
+ ["hostProviderRevisionRef", value.layout.hostProviderRevisionRef, "view-provider"],
8998
+ ["layoutPolicyRevisionRef", value.layout.layoutPolicyRevisionRef, "layout-policy"]
8999
+ ];
9000
+ layoutRefs.forEach(([field, reference, expectedKind]) => {
9001
+ if (reference.kind !== expectedKind) context.addIssue({ code: "custom", path: ["layout", field, "kind"], message: `${field} must reference ${expectedKind}.` });
9002
+ });
9003
+ value.layout.tokenRevisionRefs.forEach((reference, index) => {
9004
+ if (reference.kind !== "design-token") context.addIssue({ code: "custom", path: ["layout", "tokenRevisionRefs", index, "kind"], message: "Workbench token references must use kind design-token." });
9005
+ });
9006
+ });
9007
+ var WorkbenchReleaseSchema = z10.object({
9008
+ contract: z10.literal("WorkbenchRelease"),
9009
+ ...ReleaseBaseShape,
9010
+ workbenchRevisionRef: RevisionRefSchema,
9011
+ target: z10.object({
9012
+ environmentRef: StableRefSchema,
9013
+ surface: ProductSurfaceSchema,
9014
+ workbenchId: ContractIdentifierSchema,
9015
+ routeSpaceRevisionRef: RevisionRefSchema,
9016
+ normalizedPath: RoutePathTemplateSchema,
9017
+ routeClaim: z10.union([CompiledRouteClaimSchema, LegacyCompiledRouteClaimSchema]),
9018
+ order: z10.number().int(),
9019
+ isDefaultCandidate: z10.boolean()
9020
+ }).strict()
9021
+ }).strict().superRefine((value, context) => {
9022
+ validateDependencySnapshot(value.dependencySnapshot, context);
9023
+ validateReleaseExpectedHead(value, "workbench-release", context);
9024
+ if (value.workbenchRevisionRef.kind !== "workbench") context.addIssue({ code: "custom", path: ["workbenchRevisionRef", "kind"], message: "Expected a workbench revision." });
9025
+ if (value.target.environmentRef.kind !== "environment") context.addIssue({ code: "custom", path: ["target", "environmentRef", "kind"], message: "Workbench release target requires an environment reference." });
9026
+ if (value.target.routeSpaceRevisionRef.kind !== "route-space") context.addIssue({ code: "custom", path: ["target", "routeSpaceRevisionRef", "kind"], message: "Workbench release target requires a route-space revision." });
9027
+ if (value.target.normalizedPath !== value.target.routeClaim.normalizedPath || !exactRevisionRef(value.target.routeSpaceRevisionRef, value.target.routeClaim.routeSpaceRevisionRef)) {
9028
+ context.addIssue({ code: "custom", path: ["target", "routeClaim"], message: "Workbench Release route authority must pin the exact compiled claim and normalized path." });
9029
+ }
9030
+ if ("surface" in value.target.routeClaim && value.target.routeClaim.surface !== value.target.surface) {
9031
+ context.addIssue({ code: "custom", path: ["target", "routeClaim", "surface"], message: "Workbench Release route claim must match the target surface." });
9032
+ }
9033
+ });
9034
+ var NavigationNodeBaseShape = {
9035
+ nodeId: ContractIdentifierSchema,
9036
+ parentNodeId: ContractIdentifierSchema.nullable(),
9037
+ order: z10.number().int(),
9038
+ disabled: z10.boolean().optional()
9039
+ };
9040
+ var NavigationGroupNodeSchema = z10.object({
9041
+ ...NavigationNodeBaseShape,
9042
+ kind: z10.literal("group"),
9043
+ label: I18nTextSchema,
9044
+ iconRef: StableRefSchema.optional(),
9045
+ collapsedByDefault: z10.boolean(),
9046
+ audience: AccessPolicySchema
9047
+ }).strict();
9048
+ var NavigationTargetNodeSchema = z10.object({
9049
+ ...NavigationNodeBaseShape,
9050
+ kind: z10.literal("target"),
9051
+ label: I18nTextSchema,
9052
+ iconRef: StableRefSchema.optional(),
9053
+ tone: z10.enum(["default", "danger"]).optional(),
9054
+ targetRef: StableRefSchema,
9055
+ parameterMapping: z10.record(ContractIdentifierSchema, BindingSourceSchema),
9056
+ audience: AccessPolicySchema
9057
+ }).strict();
9058
+ var NavigationSeparatorNodeSchema = z10.object({
9059
+ ...NavigationNodeBaseShape,
9060
+ kind: z10.literal("separator")
9061
+ }).strict();
9062
+ var NavigationNodeSchema = z10.discriminatedUnion("kind", [
9063
+ NavigationGroupNodeSchema,
9064
+ NavigationTargetNodeSchema,
9065
+ NavigationSeparatorNodeSchema
9066
+ ]);
9067
+ var validateNavigationTree = (nodes, context) => {
9068
+ const byId = /* @__PURE__ */ new Map();
9069
+ nodes.forEach((node, index) => {
9070
+ if (byId.has(node.nodeId)) context.addIssue({ code: "custom", path: ["nodes", index, "nodeId"], message: `Duplicate Navigation node: ${node.nodeId}` });
9071
+ else byId.set(node.nodeId, { node, index });
9072
+ });
9073
+ const siblingOrders = /* @__PURE__ */ new Set();
9074
+ nodes.forEach((node, index) => {
9075
+ const orderKey = `${node.parentNodeId ?? ""}:${node.order}`;
9076
+ if (siblingOrders.has(orderKey)) context.addIssue({ code: "custom", path: ["nodes", index, "order"], message: "Sibling Navigation order values must be unique." });
9077
+ siblingOrders.add(orderKey);
9078
+ if (node.parentNodeId) {
9079
+ const parent = byId.get(node.parentNodeId)?.node;
9080
+ if (!parent) context.addIssue({ code: "custom", path: ["nodes", index, "parentNodeId"], message: "Navigation node has an unknown parent." });
9081
+ else if (parent.kind !== "group") context.addIssue({ code: "custom", path: ["nodes", index, "parentNodeId"], message: "Navigation parents must be groups." });
9082
+ }
9083
+ const ancestors = /* @__PURE__ */ new Set([node.nodeId]);
9084
+ let parentId = node.parentNodeId;
9085
+ while (parentId) {
9086
+ if (ancestors.has(parentId)) {
9087
+ context.addIssue({ code: "custom", path: ["nodes", index, "parentNodeId"], message: `Navigation cycle contains ${node.nodeId}.` });
9088
+ break;
9089
+ }
9090
+ ancestors.add(parentId);
9091
+ parentId = byId.get(parentId)?.node.parentNodeId ?? null;
9092
+ }
9093
+ });
9094
+ };
9095
+ var NavigationSchema = z10.object({
9096
+ contract: z10.literal("Navigation"),
9097
+ schemaVersion: z10.literal(DECLARATIVE_CONTROL_SCHEMA_VERSION),
9098
+ navigationId: ContractIdentifierSchema,
9099
+ tenantScope: TenantScopeSchema,
9100
+ identity: IdentitySchema,
9101
+ supportedSurfaces: z10.array(ProductSurfaceSchema).min(1),
9102
+ placements: z10.array(ContractIdentifierSchema).min(1),
9103
+ lifecycle: DeclarativeLifecycleSchema,
9104
+ nodes: z10.array(NavigationNodeSchema),
9105
+ managementAccess: ManagementAccessSchema,
9106
+ performanceBudgetRef: RevisionRefSchema,
9107
+ observationPolicyRevisionRef: RevisionRefSchema
9108
+ }).strict().superRefine((value, context) => {
9109
+ validateNavigationTree(value.nodes, context);
9110
+ value.nodes.forEach((node, index) => {
9111
+ if (node.kind === "target" && !["page", "workbench", "menu-action", "domain-command"].includes(node.targetRef.kind)) {
9112
+ context.addIssue({ code: "custom", path: ["nodes", index, "targetRef", "kind"], message: "Navigation targets must reference Page, Workbench, registered Menu Action, or DomainCommand identities." });
9113
+ }
9114
+ });
9115
+ });
9116
+ var ResolvedNavigationTargetSchema = z10.object({
9117
+ nodeId: ContractIdentifierSchema,
9118
+ stableTargetRef: StableRefSchema,
9119
+ targetRevisionRef: RevisionRefSchema,
9120
+ releaseRevisionRef: RevisionRefSchema.optional()
9121
+ }).strict();
9122
+ var NavigationReleaseSchema = z10.object({
9123
+ contract: z10.literal("NavigationRelease"),
9124
+ ...ReleaseBaseShape,
9125
+ navigationRevisionRef: RevisionRefSchema,
9126
+ target: z10.object({
9127
+ environmentRef: StableRefSchema,
9128
+ surface: ProductSurfaceSchema,
9129
+ placement: ContractIdentifierSchema
9130
+ }).strict(),
9131
+ resolvedTargets: z10.array(ResolvedNavigationTargetSchema)
9132
+ }).strict().superRefine((value, context) => {
9133
+ validateDependencySnapshot(value.dependencySnapshot, context);
9134
+ validateReleaseExpectedHead(value, "navigation-release", context);
9135
+ if (value.navigationRevisionRef.kind !== "navigation") context.addIssue({ code: "custom", path: ["navigationRevisionRef", "kind"], message: "Expected a navigation revision." });
9136
+ if (value.target.environmentRef.kind !== "environment") context.addIssue({ code: "custom", path: ["target", "environmentRef", "kind"], message: "Navigation release target requires an environment reference." });
9137
+ if (uniqueArray(value.resolvedTargets, (target) => target.nodeId)) context.addIssue({ code: "custom", path: ["resolvedTargets"], message: "Resolved Navigation node IDs must be unique." });
9138
+ });
9139
+ var RuntimeDiagnosticSchema = z10.object({
9140
+ code: ContractIdentifierSchema,
9141
+ severity: z10.enum(["info", "warning", "error"]),
9142
+ path: z10.string().trim().min(1),
9143
+ message: z10.string().trim().min(1)
9144
+ }).strict();
9145
+ var RuntimeBundleBaseShape = {
9146
+ schemaVersion: z10.literal(DECLARATIVE_CONTROL_SCHEMA_VERSION),
9147
+ tenantScope: TenantScopeSchema,
9148
+ releaseRevisionRef: RevisionRefSchema,
9149
+ compilerRevisionRef: RevisionRefSchema,
9150
+ generation: z10.number().int().nonnegative(),
9151
+ dependencySnapshot: z10.array(ReleaseDependencySchema),
9152
+ contentHash: Sha256Schema,
9153
+ rebuildable: z10.literal(true),
9154
+ diagnostics: z10.array(RuntimeDiagnosticSchema)
9155
+ };
9156
+ var PageRuntimeBundleSchema = z10.object({
9157
+ contract: z10.literal("PageRuntimeBundle"),
9158
+ ...RuntimeBundleBaseShape,
9159
+ pageId: ContractIdentifierSchema,
9160
+ pageRevisionRef: RevisionRefSchema,
9161
+ surface: ProductSurfaceSchema,
9162
+ routeClaims: z10.array(CompiledRouteClaimSchema),
9163
+ shellRevisionRef: RevisionRefSchema,
9164
+ renderTree: RenderTreeSchema,
9165
+ capabilityInstances: z10.array(CapabilityInstanceSchema),
9166
+ ontologyBindings: z10.array(OntologyBindingSchema),
9167
+ actionBindings: z10.array(ActionBindingSchema),
9168
+ pageAccessPolicy: AccessPolicySchema,
9169
+ tokenRevisionRefs: z10.array(RevisionRefSchema),
9170
+ performanceBudgetRef: RevisionRefSchema,
9171
+ observationPolicyRevisionRef: RevisionRefSchema,
9172
+ privacyClassification: z10.enum(["public", "internal", "confidential", "restricted"])
9173
+ }).strict();
9174
+ var ResolvedWorkbenchAppInstanceSchema = WorkbenchAppInstanceSchema.extend({
9175
+ targetAccessPolicy: AccessPolicySchema
9176
+ }).strict();
9177
+ var WorkbenchRuntimeTargetSchema = WorkbenchReleaseSchema.shape.target.safeExtend({
9178
+ routeClaim: CompiledRouteClaimSchema
9179
+ }).strict();
9180
+ var WorkbenchRuntimeBundleSchema = z10.object({
9181
+ contract: z10.literal("WorkbenchRuntimeBundle"),
9182
+ ...RuntimeBundleBaseShape,
9183
+ workbenchId: ContractIdentifierSchema,
9184
+ workbenchRevisionRef: RevisionRefSchema,
9185
+ surface: ProductSurfaceSchema,
9186
+ routeClaims: z10.array(CompiledRouteClaimSchema),
9187
+ groups: z10.array(WorkbenchGroupSchema),
9188
+ appInstances: z10.array(ResolvedWorkbenchAppInstanceSchema),
9189
+ defaultEntry: WorkbenchSchema.shape.defaultEntry,
9190
+ layout: WorkbenchSchema.shape.layout,
9191
+ workbenchAccessPolicy: AccessPolicySchema,
9192
+ personalPreferencesPolicy: WorkbenchSchema.shape.personalPreferencesPolicy,
9193
+ target: WorkbenchRuntimeTargetSchema,
9194
+ performanceBudgetRef: RevisionRefSchema,
9195
+ observationPolicyRevisionRef: RevisionRefSchema,
9196
+ privacyClassification: z10.enum(["public", "internal", "confidential", "restricted"])
9197
+ }).strict();
9198
+ var CompiledNavigationTargetSchema = ResolvedNavigationTargetSchema.extend({
9199
+ kind: z10.literal("route"),
9200
+ accessPolicy: AccessPolicySchema,
9201
+ routeClaim: CompiledRouteClaimSchema
9202
+ }).strict();
9203
+ var CompiledNavigationRegisteredMenuActionTargetSchema = ResolvedNavigationTargetSchema.extend({
9204
+ kind: z10.literal("registered-menu-action"),
9205
+ accessPolicy: AccessPolicySchema,
9206
+ execution: z10.literal("client"),
9207
+ applicationId: ContractIdentifierSchema,
9208
+ actionRef: ContractIdentifierSchema,
9209
+ inputSchemaRef: ContractIdentifierSchema.optional(),
9210
+ input: JsonObjectSchema,
9211
+ sourceCatalogRevisionRef: RevisionRefSchema
9212
+ }).strict();
9213
+ var CompiledNavigationDomainCommandTargetSchema = ResolvedNavigationTargetSchema.extend({
9214
+ kind: z10.literal("governed-domain-command"),
9215
+ accessPolicy: AccessPolicySchema,
9216
+ execution: z10.literal("server"),
9217
+ commandRevisionRef: RevisionRefSchema,
9218
+ inputSchemaRevisionRef: RevisionRefSchema,
9219
+ resultSchemaRevisionRef: RevisionRefSchema.optional(),
9220
+ input: JsonObjectSchema
9221
+ }).strict();
9222
+ var CompiledNavigationResolvedTargetSchema = z10.discriminatedUnion("kind", [
9223
+ CompiledNavigationTargetSchema,
9224
+ CompiledNavigationRegisteredMenuActionTargetSchema,
9225
+ CompiledNavigationDomainCommandTargetSchema
9226
+ ]);
9227
+ var CompiledNavigationGroupNodeSchema = NavigationGroupNodeSchema.extend({
9228
+ ancestorAccessPolicies: z10.array(AccessPolicySchema)
9229
+ }).strict();
9230
+ var CompiledNavigationTargetNodeSchema = NavigationTargetNodeSchema.extend({
9231
+ ancestorAccessPolicies: z10.array(AccessPolicySchema),
9232
+ resolvedTarget: CompiledNavigationResolvedTargetSchema
9233
+ }).strict();
9234
+ var CompiledNavigationSeparatorNodeSchema = NavigationSeparatorNodeSchema.extend({
9235
+ ancestorAccessPolicies: z10.array(AccessPolicySchema)
9236
+ }).strict();
9237
+ var CompiledNavigationNodeSchema = z10.discriminatedUnion("kind", [
9238
+ CompiledNavigationGroupNodeSchema,
9239
+ CompiledNavigationTargetNodeSchema,
9240
+ CompiledNavigationSeparatorNodeSchema
9241
+ ]);
9242
+ var NavigationRuntimeBundleSchema = z10.object({
9243
+ contract: z10.literal("NavigationRuntimeBundle"),
9244
+ ...RuntimeBundleBaseShape,
9245
+ navigationId: ContractIdentifierSchema,
9246
+ navigationRevisionRef: RevisionRefSchema,
9247
+ surface: ProductSurfaceSchema,
9248
+ placement: ContractIdentifierSchema,
9249
+ nodes: z10.array(CompiledNavigationNodeSchema),
9250
+ performanceBudgetRef: RevisionRefSchema,
9251
+ observationPolicyRevisionRef: RevisionRefSchema
9252
+ }).strict();
9253
+ var DeclarativeControlOntologyDefinitionSchema = OntologyDefinitionSchema.extend({
9254
+ classification: z10.literal("control"),
9255
+ discovery: z10.object({
9256
+ ordinaryDataBrowser: z10.literal(false),
9257
+ businessSearch: z10.literal(false),
9258
+ businessStatistics: z10.literal(false),
9259
+ ordinaryExport: z10.literal(false),
9260
+ genericWrite: z10.literal(false)
9261
+ }).strict()
9262
+ }).strict();
9263
+ var controlDefinition = (ontologyId, bodySchemaRef) => DeclarativeControlOntologyDefinitionSchema.parse({
9264
+ contract: "OntologyDefinition",
9265
+ ontologyId,
9266
+ dataSpaceId: "monkeys.control",
9267
+ ownerRepo: "monkeys-js-sdk",
9268
+ bodySchemaRef,
9269
+ authority: { service: "monkeys-data-server", storage: "domain-record", scope: "tenant" },
9270
+ relationKinds: [],
9271
+ metricKinds: [],
9272
+ classification: "control",
9273
+ discovery: {
9274
+ ordinaryDataBrowser: false,
9275
+ businessSearch: false,
9276
+ businessStatistics: false,
9277
+ ordinaryExport: false,
9278
+ genericWrite: false
9279
+ }
9280
+ });
9281
+ var DECLARATIVE_CONTROL_ONTOLOGY_DEFINITIONS = Object.freeze([
9282
+ controlDefinition("monkeys.system.page", "monkeys.system.page/v1"),
9283
+ controlDefinition("monkeys.system.page-release", "monkeys.system.page-release/v1"),
9284
+ controlDefinition("monkeys.system.workbench", "monkeys.system.workbench/v1"),
9285
+ controlDefinition("monkeys.system.workbench-release", "monkeys.system.workbench-release/v1"),
9286
+ controlDefinition("monkeys.system.navigation", "monkeys.system.navigation/v1"),
9287
+ controlDefinition("monkeys.system.navigation-release", "monkeys.system.navigation-release/v1")
9288
+ ]);
9289
+
8355
9290
  // src/contracts/menu.ts
8356
- import { z as z11 } from "zod";
9291
+ import { z as z12 } from "zod";
8357
9292
 
8358
9293
  // src/contracts/page.ts
8359
- import { z as z10 } from "zod";
8360
- var PageTypeSchema = z10.enum([
9294
+ import { z as z11 } from "zod";
9295
+ var PageTypeSchema = z11.enum([
8361
9296
  "page",
8362
9297
  "workspace",
8363
9298
  "view",
@@ -8378,14 +9313,14 @@ var PageTypeSchema = z10.enum([
8378
9313
  "global-design-board",
8379
9314
  "iframe"
8380
9315
  ]);
8381
- var PageVisibilitySchema = z10.object({
8382
- authenticated: z10.boolean().default(true),
8383
- permissionAllOf: z10.array(ContractIdentifierSchema).default([]),
8384
- permissionAnyOf: z10.array(ContractIdentifierSchema).default([]),
8385
- featureFlags: z10.array(ContractIdentifierSchema).default([]),
8386
- productContexts: z10.array(z10.enum(["studio", "kernel"])).min(1)
8387
- }).strict();
8388
- var PageRoutePathSchema = z10.string().trim().regex(/^\/(?!\/)/, "Expected an application-relative route path.");
9316
+ var PageVisibilitySchema = z11.object({
9317
+ authenticated: z11.boolean().default(true),
9318
+ permissionAllOf: z11.array(ContractIdentifierSchema).default([]),
9319
+ permissionAnyOf: z11.array(ContractIdentifierSchema).default([]),
9320
+ featureFlags: z11.array(ContractIdentifierSchema).default([]),
9321
+ productContexts: z11.array(z11.enum(["studio", "kernel"])).min(1)
9322
+ }).strict();
9323
+ var PageRoutePathSchema = z11.string().trim().regex(/^\/(?!\/)/, "Expected an application-relative route path.");
8389
9324
  var requireCapabilityReference = (reference, path, context) => {
8390
9325
  if (reference.kind !== "capability") {
8391
9326
  context.addIssue({
@@ -8409,53 +9344,53 @@ var requireCapabilityReference = (reference, path, context) => {
8409
9344
  });
8410
9345
  }
8411
9346
  };
8412
- var PageDefinitionSchema = z10.object({
8413
- contract: z10.literal("PageDefinition"),
9347
+ var PageDefinitionSchema = z11.object({
9348
+ contract: z11.literal("PageDefinition"),
8414
9349
  pageId: ContractIdentifierSchema,
8415
9350
  ownerRepo: ContractIdentifierSchema,
8416
9351
  title: LocalizedTextSchema,
8417
9352
  pageType: PageTypeSchema,
8418
- ownership: z10.object({
9353
+ ownership: z11.object({
8419
9354
  teamId: ContractIdentifierSchema.optional(),
8420
9355
  creatorRef: EntityRefSchema.optional(),
8421
9356
  studioId: ContractIdentifierSchema.optional(),
8422
- builtIn: z10.boolean()
9357
+ builtIn: z11.boolean()
8423
9358
  }).strict(),
8424
- record: z10.object({
8425
- createdTimestamp: z10.number().int().nonnegative().optional(),
8426
- updatedTimestamp: z10.number().int().nonnegative().optional(),
8427
- deleted: z10.boolean().default(false)
9359
+ record: z11.object({
9360
+ createdTimestamp: z11.number().int().nonnegative().optional(),
9361
+ updatedTimestamp: z11.number().int().nonnegative().optional(),
9362
+ deleted: z11.boolean().default(false)
8428
9363
  }).strict(),
8429
- surface: z10.enum(["page", "workspace", "view", "record", "action", "overlay", "agent"]),
9364
+ surface: z11.enum(["page", "workspace", "view", "record", "action", "overlay", "agent"]),
8430
9365
  routeId: ContractIdentifierSchema,
8431
9366
  routePath: PageRoutePathSchema,
8432
9367
  rendererKey: ContractIdentifierSchema,
8433
9368
  capabilityRef: EntityRefSchema,
8434
- capabilityRefs: z10.array(EntityRefSchema).default([]),
9369
+ capabilityRefs: z11.array(EntityRefSchema).default([]),
8435
9370
  workflowRef: EntityRefSchema.optional(),
8436
- binding: z10.object({
9371
+ binding: z11.object({
8437
9372
  sourceRef: ContractIdentifierSchema.optional(),
8438
9373
  ontologyId: ContractIdentifierSchema.optional(),
8439
9374
  projectionRef: ContractIdentifierSchema.optional(),
8440
9375
  stateRef: ContractIdentifierSchema.optional()
8441
9376
  }).strict(),
8442
- access: z10.object({
8443
- actions: z10.array(z10.enum(["read", "write", "execute", "manage-permissions"])).default([])
9377
+ access: z11.object({
9378
+ actions: z11.array(z11.enum(["read", "write", "execute", "manage-permissions"])).default([])
8444
9379
  }).strict(),
8445
- input: z10.object({
9380
+ input: z11.object({
8446
9381
  schemaRef: ContractIdentifierSchema
8447
9382
  }).strict().optional(),
8448
- rendererConfig: z10.object({
9383
+ rendererConfig: z11.object({
8449
9384
  schemaRef: ContractIdentifierSchema,
8450
9385
  value: JsonObjectSchema
8451
9386
  }).strict(),
8452
- navigation: z10.object({
9387
+ navigation: z11.object({
8453
9388
  label: LocalizedTextSchema,
8454
9389
  iconRef: ContractIdentifierSchema.optional(),
8455
9390
  parentPageId: ContractIdentifierSchema.optional(),
8456
- order: z10.number().int().optional(),
8457
- hidden: z10.boolean().default(false),
8458
- pinned: z10.boolean().default(false)
9391
+ order: z11.number().int().optional(),
9392
+ hidden: z11.boolean().default(false),
9393
+ pinned: z11.boolean().default(false)
8459
9394
  }).strict(),
8460
9395
  visibility: PageVisibilitySchema
8461
9396
  }).strict().superRefine((page, context) => {
@@ -8476,8 +9411,8 @@ var PageDefinitionSchema = z10.object({
8476
9411
  });
8477
9412
  if (page.workflowRef && page.workflowRef.kind !== "workflow") context.addIssue({ code: "custom", path: ["workflowRef", "kind"], message: "workflowRef must reference a workflow." });
8478
9413
  });
8479
- var PageRuntimeDescriptorSchema = z10.object({
8480
- contract: z10.literal("PageRuntimeDescriptor"),
9414
+ var PageRuntimeDescriptorSchema = z11.object({
9415
+ contract: z11.literal("PageRuntimeDescriptor"),
8481
9416
  page: PageDefinitionSchema,
8482
9417
  nodeId: ContractIdentifierSchema,
8483
9418
  parentNodeId: ContractIdentifierSchema.optional(),
@@ -8485,54 +9420,54 @@ var PageRuntimeDescriptorSchema = z10.object({
8485
9420
  semanticRef: ContractIdentifierSchema.optional(),
8486
9421
  dataContextRef: ContractIdentifierSchema.optional(),
8487
9422
  providerRef: EntityRefSchema.optional(),
8488
- surface: z10.object({
9423
+ surface: z11.object({
8489
9424
  frameOwner: ContractIdentifierSchema,
8490
9425
  tone: ContractIdentifierSchema.optional(),
8491
- density: z10.enum(["compact", "default", "comfortable"]).default("default")
9426
+ density: z11.enum(["compact", "default", "comfortable"]).default("default")
8492
9427
  }).strict(),
8493
- scroll: z10.object({
8494
- owner: z10.enum(["page", "surface", "provider"]),
8495
- axis: z10.enum(["x", "y", "both", "none"]),
9428
+ scroll: z11.object({
9429
+ owner: z11.enum(["page", "surface", "provider"]),
9430
+ axis: z11.enum(["x", "y", "both", "none"]),
8496
9431
  restoreKey: ContractIdentifierSchema.optional(),
8497
- virtualized: z10.boolean().default(false)
9432
+ virtualized: z11.boolean().default(false)
8498
9433
  }).strict(),
8499
- activation: z10.enum(["navigate", "select", "drawer", "modal", "fullscreen"]),
8500
- lifecycle: z10.object({
8501
- mountPolicy: z10.enum(["always", "when-visible", "when-active"]),
8502
- queryPolicy: z10.enum(["always", "when-visible", "when-active", "manual"]),
8503
- deepLink: z10.boolean(),
8504
- focusReturn: z10.boolean()
9434
+ activation: z11.enum(["navigate", "select", "drawer", "modal", "fullscreen"]),
9435
+ lifecycle: z11.object({
9436
+ mountPolicy: z11.enum(["always", "when-visible", "when-active"]),
9437
+ queryPolicy: z11.enum(["always", "when-visible", "when-active", "manual"]),
9438
+ deepLink: z11.boolean(),
9439
+ focusReturn: z11.boolean()
8505
9440
  }).strict()
8506
9441
  }).strict();
8507
- var PageRouteProjectionSchema = z10.object({
9442
+ var PageRouteProjectionSchema = z11.object({
8508
9443
  pageId: ContractIdentifierSchema,
8509
9444
  routeId: ContractIdentifierSchema,
8510
9445
  path: PageRoutePathSchema
8511
9446
  }).strict();
8512
- var PageNavigationProjectionSchema = z10.object({
9447
+ var PageNavigationProjectionSchema = z11.object({
8513
9448
  pageId: ContractIdentifierSchema,
8514
9449
  routeId: ContractIdentifierSchema,
8515
9450
  path: PageRoutePathSchema,
8516
9451
  label: LocalizedTextSchema,
8517
9452
  iconRef: ContractIdentifierSchema.optional(),
8518
9453
  parentPageId: ContractIdentifierSchema.optional(),
8519
- order: z10.number().int().optional(),
8520
- pinned: z10.boolean()
9454
+ order: z11.number().int().optional(),
9455
+ pinned: z11.boolean()
8521
9456
  }).strict();
8522
- var PageGuardProjectionSchema = z10.object({
9457
+ var PageGuardProjectionSchema = z11.object({
8523
9458
  pageId: ContractIdentifierSchema,
8524
- authenticated: z10.boolean(),
8525
- permissionAllOf: z10.array(ContractIdentifierSchema),
8526
- permissionAnyOf: z10.array(ContractIdentifierSchema),
8527
- featureFlags: z10.array(ContractIdentifierSchema),
8528
- actions: z10.array(z10.enum(["read", "write", "execute", "manage-permissions"]))
9459
+ authenticated: z11.boolean(),
9460
+ permissionAllOf: z11.array(ContractIdentifierSchema),
9461
+ permissionAnyOf: z11.array(ContractIdentifierSchema),
9462
+ featureFlags: z11.array(ContractIdentifierSchema),
9463
+ actions: z11.array(z11.enum(["read", "write", "execute", "manage-permissions"]))
8529
9464
  }).strict();
8530
- var PageRendererProjectionSchema = z10.object({
9465
+ var PageRendererProjectionSchema = z11.object({
8531
9466
  pageId: ContractIdentifierSchema,
8532
- surface: z10.enum(["page", "workspace", "view", "record", "action", "overlay", "agent"]),
9467
+ surface: z11.enum(["page", "workspace", "view", "record", "action", "overlay", "agent"]),
8533
9468
  rendererKey: ContractIdentifierSchema,
8534
9469
  capabilityRef: EntityRefSchema,
8535
- capabilityRefs: z10.array(EntityRefSchema),
9470
+ capabilityRefs: z11.array(EntityRefSchema),
8536
9471
  providerRef: EntityRefSchema,
8537
9472
  binding: PageDefinitionSchema.shape.binding,
8538
9473
  rendererConfig: PageDefinitionSchema.shape.rendererConfig,
@@ -8573,13 +9508,13 @@ var duplicateProjectionIdentity = (values, identity) => {
8573
9508
  }
8574
9509
  return void 0;
8575
9510
  };
8576
- var PageRuntimeProjectionSchema = z10.object({
8577
- contract: z10.literal("PageRuntimeProjection"),
8578
- product: z10.enum(["studio", "kernel"]),
8579
- routes: z10.array(PageRouteProjectionSchema),
8580
- navigation: z10.array(PageNavigationProjectionSchema),
8581
- guards: z10.array(PageGuardProjectionSchema),
8582
- renderers: z10.array(PageRendererProjectionSchema)
9511
+ var PageRuntimeProjectionSchema = z11.object({
9512
+ contract: z11.literal("PageRuntimeProjection"),
9513
+ product: z11.enum(["studio", "kernel"]),
9514
+ routes: z11.array(PageRouteProjectionSchema),
9515
+ navigation: z11.array(PageNavigationProjectionSchema),
9516
+ guards: z11.array(PageGuardProjectionSchema),
9517
+ renderers: z11.array(PageRendererProjectionSchema)
8583
9518
  }).strict().superRefine((projection, context) => {
8584
9519
  const tables = [
8585
9520
  ["routes", projection.routes.map((value) => value.pageId)],
@@ -8641,7 +9576,7 @@ var MENU_MAX_NODES = 1024;
8641
9576
  var MENU_MAX_TREE_DEPTH = 16;
8642
9577
  var MENU_MAX_INPUT_BYTES = 64 * 1024;
8643
9578
  var MENU_MAX_INPUT_VALUES = 2048;
8644
- var MenuOrderSchema = z11.number().int().min(-1e6).max(1e6);
9579
+ var MenuOrderSchema = z12.number().int().min(-1e6).max(1e6);
8645
9580
  var inspectJsonValue = (value) => {
8646
9581
  let maxDepth = 0;
8647
9582
  let values = 0;
@@ -8684,30 +9619,30 @@ var MenuBoundedInputSchema = JsonObjectSchema.superRefine((value, context) => {
8684
9619
  });
8685
9620
  }
8686
9621
  });
8687
- var MenuPageRefSchema = z11.object({
9622
+ var MenuPageRefSchema = z12.object({
8688
9623
  applicationId: ContractIdentifierSchema,
8689
9624
  pageId: ContractIdentifierSchema
8690
9625
  }).strict();
8691
- var MenuSourceInputBindingSchema = z11.discriminatedUnion("exposure", [
8692
- z11.object({ exposure: z11.literal("client"), value: MenuBoundedInputSchema }).strict(),
8693
- z11.object({ exposure: z11.literal("server"), value: MenuBoundedInputSchema }).strict()
9626
+ var MenuSourceInputBindingSchema = z12.discriminatedUnion("exposure", [
9627
+ z12.object({ exposure: z12.literal("client"), value: MenuBoundedInputSchema }).strict(),
9628
+ z12.object({ exposure: z12.literal("server"), value: MenuBoundedInputSchema }).strict()
8694
9629
  ]);
8695
- var MenuRuntimeInputBindingSchema = z11.discriminatedUnion("exposure", [
8696
- z11.object({ exposure: z11.literal("client"), value: MenuBoundedInputSchema }).strict(),
8697
- z11.object({ exposure: z11.literal("server") }).strict()
9630
+ var MenuRuntimeInputBindingSchema = z12.discriminatedUnion("exposure", [
9631
+ z12.object({ exposure: z12.literal("client"), value: MenuBoundedInputSchema }).strict(),
9632
+ z12.object({ exposure: z12.literal("server") }).strict()
8698
9633
  ]);
8699
- var MenuNavigateBehaviorSchema = z11.object({
8700
- kind: z11.literal("navigate"),
9634
+ var MenuNavigateBehaviorSchema = z12.object({
9635
+ kind: z12.literal("navigate"),
8701
9636
  page: MenuPageRefSchema,
8702
9637
  activationId: ContractIdentifierSchema.optional(),
8703
9638
  input: MenuSourceInputBindingSchema.optional()
8704
9639
  }).strict();
8705
- var MenuActionBehaviorSchema = z11.object({
8706
- kind: z11.literal("action"),
9640
+ var MenuActionBehaviorSchema = z12.object({
9641
+ kind: z12.literal("action"),
8707
9642
  actionRef: ContractIdentifierSchema,
8708
9643
  input: MenuBoundedInputSchema.optional()
8709
9644
  }).strict();
8710
- var MenuBehaviorSchema = z11.discriminatedUnion("kind", [
9645
+ var MenuBehaviorSchema = z12.discriminatedUnion("kind", [
8711
9646
  MenuNavigateBehaviorSchema,
8712
9647
  MenuActionBehaviorSchema
8713
9648
  ]);
@@ -8716,33 +9651,33 @@ var MenuNodeBaseShape = {
8716
9651
  parentNodeId: ContractIdentifierSchema.optional(),
8717
9652
  order: MenuOrderSchema
8718
9653
  };
8719
- var MenuGroupNodeSchema = z11.object({
9654
+ var MenuGroupNodeSchema = z12.object({
8720
9655
  ...MenuNodeBaseShape,
8721
- kind: z11.literal("group"),
9656
+ kind: z12.literal("group"),
8722
9657
  label: LocalizedTextSchema.optional(),
8723
9658
  iconRef: ContractIdentifierSchema.optional(),
8724
- disabled: z11.boolean().optional()
9659
+ disabled: z12.boolean().optional()
8725
9660
  }).strict();
8726
- var MenuDividerNodeSchema = z11.object({
9661
+ var MenuDividerNodeSchema = z12.object({
8727
9662
  ...MenuNodeBaseShape,
8728
- kind: z11.literal("divider")
9663
+ kind: z12.literal("divider")
8729
9664
  }).strict();
8730
- var MenuItemNodeSchema = z11.object({
9665
+ var MenuItemNodeSchema = z12.object({
8731
9666
  ...MenuNodeBaseShape,
8732
- kind: z11.literal("item"),
9667
+ kind: z12.literal("item"),
8733
9668
  label: LocalizedTextSchema,
8734
9669
  iconRef: ContractIdentifierSchema.optional(),
8735
- tone: z11.enum(["default", "danger"]).optional(),
8736
- disabled: z11.boolean().optional(),
9670
+ tone: z12.enum(["default", "danger"]).optional(),
9671
+ disabled: z12.boolean().optional(),
8737
9672
  requiredPermission: ContractIdentifierSchema.optional(),
8738
9673
  behavior: MenuBehaviorSchema
8739
9674
  }).strict();
8740
- var MenuNodeSchema = z11.discriminatedUnion("kind", [
9675
+ var MenuNodeSchema = z12.discriminatedUnion("kind", [
8741
9676
  MenuGroupNodeSchema,
8742
9677
  MenuDividerNodeSchema,
8743
9678
  MenuItemNodeSchema
8744
9679
  ]);
8745
- var MenuContributionSchema = z11.object({
9680
+ var MenuContributionSchema = z12.object({
8746
9681
  providerId: ContractIdentifierSchema,
8747
9682
  parentNodeId: ContractIdentifierSchema.optional(),
8748
9683
  order: MenuOrderSchema
@@ -8812,55 +9747,55 @@ var validateMenuStructure = (menu, context) => {
8812
9747
  contributionKeys.add(key);
8813
9748
  });
8814
9749
  };
8815
- var MenuDefinitionSchema = z11.object({
8816
- contract: z11.literal("MenuDefinition"),
8817
- version: z11.literal(MENU_CONTRACT_VERSION),
9750
+ var MenuDefinitionSchema = z12.object({
9751
+ contract: z12.literal("MenuDefinition"),
9752
+ version: z12.literal(MENU_CONTRACT_VERSION),
8818
9753
  applicationId: ContractIdentifierSchema,
8819
9754
  surface: ContractIdentifierSchema,
8820
9755
  menuId: ContractIdentifierSchema,
8821
- nodes: z11.array(MenuNodeSchema).max(MENU_MAX_NODES),
8822
- contributions: z11.array(MenuContributionSchema).max(MENU_MAX_NODES).default([])
9756
+ nodes: z12.array(MenuNodeSchema).max(MENU_MAX_NODES),
9757
+ contributions: z12.array(MenuContributionSchema).max(MENU_MAX_NODES).default([])
8823
9758
  }).strict().superRefine(validateMenuStructure);
8824
- var MenuDefinitionSetSchema = z11.union([
8825
- z11.literal("*"),
8826
- z11.object({
8827
- version: z11.literal(MENU_CONTRACT_VERSION),
8828
- definitions: z11.array(MenuDefinitionSchema).max(MENU_MAX_DEFINITIONS)
9759
+ var MenuDefinitionSetSchema = z12.union([
9760
+ z12.literal("*"),
9761
+ z12.object({
9762
+ version: z12.literal(MENU_CONTRACT_VERSION),
9763
+ definitions: z12.array(MenuDefinitionSchema).max(MENU_MAX_DEFINITIONS)
8829
9764
  }).strict()
8830
9765
  ]);
8831
- var MenuAccessRequirementSchema = z11.object({
8832
- authenticated: z11.boolean().default(true),
8833
- permissionAllOf: z11.array(ContractIdentifierSchema).default([]),
8834
- permissionAnyOf: z11.array(ContractIdentifierSchema).default([]),
8835
- featureFlags: z11.array(ContractIdentifierSchema).default([])
9766
+ var MenuAccessRequirementSchema = z12.object({
9767
+ authenticated: z12.boolean().default(true),
9768
+ permissionAllOf: z12.array(ContractIdentifierSchema).default([]),
9769
+ permissionAnyOf: z12.array(ContractIdentifierSchema).default([]),
9770
+ featureFlags: z12.array(ContractIdentifierSchema).default([])
8836
9771
  }).strict();
8837
- var MenuPageRegistrationSchema = z11.object({
9772
+ var MenuPageRegistrationSchema = z12.object({
8838
9773
  applicationId: ContractIdentifierSchema,
8839
9774
  page: PageDefinitionSchema
8840
9775
  }).strict();
8841
- var MenuActionRegistrationSchema = z11.object({
9776
+ var MenuActionRegistrationSchema = z12.object({
8842
9777
  applicationId: ContractIdentifierSchema,
8843
9778
  actionRef: ContractIdentifierSchema,
8844
9779
  inputSchemaRef: ContractIdentifierSchema.optional(),
8845
9780
  access: MenuAccessRequirementSchema
8846
9781
  }).strict();
8847
- var MenuContributionProviderRegistrationSchema = z11.object({
9782
+ var MenuContributionProviderRegistrationSchema = z12.object({
8848
9783
  applicationId: ContractIdentifierSchema,
8849
9784
  providerId: ContractIdentifierSchema,
8850
- surfaces: z11.array(ContractIdentifierSchema).min(1).optional()
9785
+ surfaces: z12.array(ContractIdentifierSchema).min(1).optional()
8851
9786
  }).strict();
8852
- var CompiledMenuNavigateBehaviorSchema = z11.object({
8853
- kind: z11.literal("navigate"),
9787
+ var CompiledMenuNavigateBehaviorSchema = z12.object({
9788
+ kind: z12.literal("navigate"),
8854
9789
  page: MenuPageRefSchema,
8855
9790
  activationId: ContractIdentifierSchema,
8856
9791
  input: MenuRuntimeInputBindingSchema.optional()
8857
9792
  }).strict();
8858
- var CompiledMenuActionBehaviorSchema = z11.object({
8859
- kind: z11.literal("action"),
9793
+ var CompiledMenuActionBehaviorSchema = z12.object({
9794
+ kind: z12.literal("action"),
8860
9795
  actionRef: ContractIdentifierSchema,
8861
9796
  input: MenuBoundedInputSchema.optional()
8862
9797
  }).strict();
8863
- var CompiledMenuBehaviorSchema = z11.discriminatedUnion("kind", [
9798
+ var CompiledMenuBehaviorSchema = z12.discriminatedUnion("kind", [
8864
9799
  CompiledMenuNavigateBehaviorSchema,
8865
9800
  CompiledMenuActionBehaviorSchema
8866
9801
  ]);
@@ -8873,76 +9808,96 @@ var CompiledMenuItemNodeSchema = MenuItemNodeSchema.omit({ behavior: true, requi
8873
9808
  behavior: CompiledMenuBehaviorSchema,
8874
9809
  access: CompiledMenuItemAccessSchema
8875
9810
  }).strict();
8876
- var CompiledMenuNodeSchema = z11.discriminatedUnion("kind", [
9811
+ var CompiledMenuNodeSchema = z12.discriminatedUnion("kind", [
8877
9812
  CompiledMenuGroupNodeSchema,
8878
9813
  CompiledMenuDividerNodeSchema,
8879
9814
  CompiledMenuItemNodeSchema
8880
9815
  ]);
8881
- var CompiledMenuProjectionSchema = z11.object({
9816
+ var CompiledMenuProjectionSchema = z12.object({
8882
9817
  applicationId: ContractIdentifierSchema,
8883
9818
  surface: ContractIdentifierSchema,
8884
9819
  menuId: ContractIdentifierSchema,
8885
- nodes: z11.array(CompiledMenuNodeSchema).max(MENU_MAX_NODES),
8886
- contributions: z11.array(MenuContributionSchema).max(MENU_MAX_NODES)
9820
+ nodes: z12.array(CompiledMenuNodeSchema).max(MENU_MAX_NODES),
9821
+ contributions: z12.array(MenuContributionSchema).max(MENU_MAX_NODES)
8887
9822
  }).strict();
8888
- var MenuNavigationTargetSchema = z11.object({
9823
+ var MenuNavigationTargetSchema = z12.object({
8889
9824
  page: MenuPageRefSchema,
8890
9825
  activationId: ContractIdentifierSchema,
8891
9826
  input: MenuRuntimeInputBindingSchema.optional()
8892
9827
  }).strict();
8893
- var MenuRuntimeBundleSchema = z11.object({
8894
- contract: z11.literal("MenuRuntimeBundle"),
8895
- version: z11.literal(MENU_CONTRACT_VERSION),
9828
+ var MenuRuntimeBundleSchema = z12.object({
9829
+ contract: z12.literal("MenuRuntimeBundle"),
9830
+ version: z12.literal(MENU_CONTRACT_VERSION),
8896
9831
  applicationId: ContractIdentifierSchema,
8897
9832
  sourceVersion: ContractIdentifierSchema,
8898
9833
  contentHash: Sha256Schema,
8899
- menus: z11.array(CompiledMenuProjectionSchema).max(MENU_MAX_DEFINITIONS),
8900
- navigationTargets: z11.array(MenuNavigationTargetSchema),
8901
- sourceMap: z11.record(z11.string(), ContractIdentifierSchema).default({})
9834
+ menus: z12.array(CompiledMenuProjectionSchema).max(MENU_MAX_DEFINITIONS),
9835
+ navigationTargets: z12.array(MenuNavigationTargetSchema),
9836
+ sourceMap: z12.record(z12.string(), ContractIdentifierSchema).default({})
8902
9837
  }).strict();
8903
- var MenuContributionResultSchema = z11.object({
8904
- contract: z11.literal("MenuContributionResult"),
9838
+ var MenuContributionResultSchema = z12.object({
9839
+ contract: z12.literal("MenuContributionResult"),
8905
9840
  applicationId: ContractIdentifierSchema,
8906
9841
  surface: ContractIdentifierSchema,
8907
9842
  menuId: ContractIdentifierSchema,
8908
9843
  providerId: ContractIdentifierSchema,
8909
- nodes: z11.array(CompiledMenuNodeSchema).max(MENU_MAX_NODES)
9844
+ nodes: z12.array(CompiledMenuNodeSchema).max(MENU_MAX_NODES)
8910
9845
  }).strict();
8911
9846
 
8912
9847
  // src/contracts/semantic.ts
8913
- import { z as z12 } from "zod";
8914
- var ConceptRelationshipSchema = z12.object({
9848
+ import { z as z13 } from "zod";
9849
+ var ExactRefKindSchema = (kind) => RevisionRefSchema.superRefine((value, context) => {
9850
+ if (value.kind !== kind) context.addIssue({ code: "custom", path: ["kind"], message: `Reference must use kind ${kind}.` });
9851
+ });
9852
+ var SchemaDefinitionSchema = z13.object({
9853
+ contract: z13.literal("Schema"),
9854
+ schemaVersion: z13.literal(1),
9855
+ schemaId: ContractIdentifierSchema,
9856
+ ownerRepo: ContractIdentifierSchema,
9857
+ dialect: z13.literal("https://json-schema.org/draft/2020-12/schema"),
9858
+ document: JsonObjectSchema
9859
+ }).strict();
9860
+ var OntologyViewDefinitionSchema = z13.object({
9861
+ contract: z13.literal("View"),
9862
+ schemaVersion: z13.literal(1),
9863
+ viewId: ContractIdentifierSchema,
9864
+ ownerRepo: ContractIdentifierSchema,
9865
+ ontologyDefinitionRevisionRef: ExactRefKindSchema("ontology-definition"),
9866
+ renderModelSchemaRevisionRef: ExactRefKindSchema("schema"),
9867
+ requiredPermissionCodes: z13.array(ContractIdentifierSchema).default([])
9868
+ }).strict();
9869
+ var ConceptRelationshipSchema = z13.object({
8915
9870
  kind: ContractIdentifierSchema,
8916
9871
  targetConceptId: ContractIdentifierSchema,
8917
- cardinality: z12.enum(["one", "optional", "many"])
9872
+ cardinality: z13.enum(["one", "optional", "many"])
8918
9873
  }).strict();
8919
- var ConceptDefinitionSchema = z12.object({
8920
- contract: z12.literal("ConceptDefinition"),
9874
+ var ConceptDefinitionSchema = z13.object({
9875
+ contract: z13.literal("ConceptDefinition"),
8921
9876
  conceptId: ContractIdentifierSchema,
8922
9877
  ownerRepo: ContractIdentifierSchema,
8923
- displayName: z12.string().trim().min(1),
8924
- description: z12.string().optional(),
9878
+ displayName: z13.string().trim().min(1),
9879
+ description: z13.string().optional(),
8925
9880
  schemaRef: ContractIdentifierSchema,
8926
9881
  ontologyId: ContractIdentifierSchema.optional(),
8927
- capabilityIds: z12.array(ContractIdentifierSchema).default([]),
8928
- commandNames: z12.array(ContractIdentifierSchema).default([]),
8929
- relationships: z12.array(ConceptRelationshipSchema).default([])
9882
+ capabilityIds: z13.array(ContractIdentifierSchema).default([]),
9883
+ commandNames: z13.array(ContractIdentifierSchema).default([]),
9884
+ relationships: z13.array(ConceptRelationshipSchema).default([])
8930
9885
  }).strict();
8931
- var DomainCommandDefinitionSchema = z12.object({
8932
- contract: z12.literal("DomainCommandDefinition"),
9886
+ var DomainCommandDefinitionSchema = z13.object({
9887
+ contract: z13.literal("DomainCommandDefinition"),
8933
9888
  commandName: ContractIdentifierSchema,
8934
9889
  ownerRepo: ContractIdentifierSchema,
8935
- displayName: z12.string().trim().min(1),
8936
- description: z12.string().optional(),
8937
- targetKinds: z12.array(ContractIdentifierSchema).min(1),
9890
+ displayName: z13.string().trim().min(1),
9891
+ description: z13.string().optional(),
9892
+ targetKinds: z13.array(ContractIdentifierSchema).min(1),
8938
9893
  inputSchemaRef: ContractIdentifierSchema,
8939
9894
  outputSchemaRef: ContractIdentifierSchema.optional(),
8940
- requiredPermissionCodes: z12.array(ContractIdentifierSchema).default([]),
9895
+ requiredPermissionCodes: z13.array(ContractIdentifierSchema).default([]),
8941
9896
  handlerRef: EntityRefSchema,
8942
- sideEffects: z12.array(z12.enum(["data-write", "execution", "navigation", "notification", "external-call"])).default([])
9897
+ sideEffects: z13.array(z13.enum(["data-write", "execution", "navigation", "notification", "external-call"])).default([])
8943
9898
  }).strict();
8944
- var DomainCommandSchema = z12.object({
8945
- contract: z12.literal("DomainCommand"),
9899
+ var DomainCommandSchema = z13.object({
9900
+ contract: z13.literal("DomainCommand"),
8946
9901
  commandId: ContractIdentifierSchema,
8947
9902
  commandName: ContractIdentifierSchema,
8948
9903
  requestId: ContractIdentifierSchema,
@@ -8950,30 +9905,30 @@ var DomainCommandSchema = z12.object({
8950
9905
  idempotencyKey: ContractIdentifierSchema,
8951
9906
  targetRef: EntityRefSchema,
8952
9907
  actorRef: EntityRefSchema,
8953
- source: z12.object({
8954
- product: z12.enum(["studio", "kernel", "agent", "mcp", "service"]),
9908
+ source: z13.object({
9909
+ product: z13.enum(["studio", "kernel", "agent", "mcp", "service"]),
8955
9910
  pageId: ContractIdentifierSchema.optional(),
8956
9911
  capabilityId: ContractIdentifierSchema.optional()
8957
9912
  }).strict(),
8958
9913
  payload: JsonObjectSchema,
8959
9914
  issuedAt: IsoDateTimeSchema
8960
9915
  }).strict();
8961
- var ProductDeclarationSchema = z12.object({
8962
- contract: z12.literal("ProductDeclaration"),
9916
+ var ProductDeclarationSchema = z13.object({
9917
+ contract: z13.literal("ProductDeclaration"),
8963
9918
  declarationId: ContractIdentifierSchema,
8964
9919
  ownerRepo: ContractIdentifierSchema,
8965
- concepts: z12.array(ConceptDefinitionSchema).default([]),
8966
- ontologies: z12.array(OntologyDefinitionSchema).default([]),
8967
- projections: z12.array(ProjectionSpecSchema).default([]),
8968
- commands: z12.array(DomainCommandDefinitionSchema).default([]),
8969
- capabilities: z12.array(CapabilityManifestSchema).default([]),
8970
- pages: z12.array(PageDefinitionSchema).default([]),
8971
- menus: z12.array(MenuDefinitionSchema).default([])
8972
- }).strict();
8973
- var DeclarationGraphEdgeSchema = z12.object({
9920
+ concepts: z13.array(ConceptDefinitionSchema).default([]),
9921
+ ontologies: z13.array(OntologyDefinitionSchema).default([]),
9922
+ projections: z13.array(ProjectionSpecSchema).default([]),
9923
+ commands: z13.array(DomainCommandDefinitionSchema).default([]),
9924
+ capabilities: z13.array(CapabilityManifestSchema).default([]),
9925
+ pages: z13.array(PageDefinitionSchema).default([]),
9926
+ menus: z13.array(MenuDefinitionSchema).default([])
9927
+ }).strict();
9928
+ var DeclarationGraphEdgeSchema = z13.object({
8974
9929
  from: EntityRefSchema,
8975
9930
  to: EntityRefSchema,
8976
- relation: z12.enum([
9931
+ relation: z13.enum([
8977
9932
  "uses-ontology",
8978
9933
  "uses-projection",
8979
9934
  "uses-capability",
@@ -8981,25 +9936,25 @@ var DeclarationGraphEdgeSchema = z12.object({
8981
9936
  "relates-to-concept"
8982
9937
  ])
8983
9938
  }).strict();
8984
- var ChangeImpactSchema = z12.object({
9939
+ var ChangeImpactSchema = z13.object({
8985
9940
  changedRef: EntityRefSchema,
8986
- affectedRefs: z12.array(EntityRefSchema),
8987
- reasons: z12.array(ContractIdentifierSchema).min(1)
9941
+ affectedRefs: z13.array(EntityRefSchema),
9942
+ reasons: z13.array(ContractIdentifierSchema).min(1)
8988
9943
  }).strict();
8989
- var ChangeImpactGraphSchema = z12.object({
8990
- contract: z12.literal("ChangeImpactGraph"),
9944
+ var ChangeImpactGraphSchema = z13.object({
9945
+ contract: z13.literal("ChangeImpactGraph"),
8991
9946
  declarationId: ContractIdentifierSchema,
8992
- nodes: z12.array(EntityRefSchema),
8993
- edges: z12.array(DeclarationGraphEdgeSchema),
8994
- impacts: z12.array(ChangeImpactSchema),
9947
+ nodes: z13.array(EntityRefSchema),
9948
+ edges: z13.array(DeclarationGraphEdgeSchema),
9949
+ impacts: z13.array(ChangeImpactSchema),
8995
9950
  generatedAt: IsoDateTimeSchema
8996
9951
  }).strict();
8997
9952
 
8998
9953
  // src/contracts/tenant.ts
8999
- import { z as z14 } from "zod";
9954
+ import { z as z15 } from "zod";
9000
9955
 
9001
9956
  // src/contracts/theme.ts
9002
- import { z as z13 } from "zod";
9957
+ import { z as z14 } from "zod";
9003
9958
 
9004
9959
  // src/theme-tokens/core.ts
9005
9960
  var import_ajv = __toESM(require_ajv());
@@ -11193,20 +12148,20 @@ var MONKEYS_REQUIRED_THEME_TOKEN_PATHS = Object.freeze({
11193
12148
  });
11194
12149
 
11195
12150
  // src/contracts/theme.ts
11196
- var ThemeTokenTypeSchema = z13.enum(THEME_TOKEN_TYPES);
11197
- var ThemeTokenSchema = z13.record(z13.string(), z13.unknown()).superRefine((input, context) => {
12151
+ var ThemeTokenTypeSchema = z14.enum(THEME_TOKEN_TYPES);
12152
+ var ThemeTokenSchema = z14.record(z14.string(), z14.unknown()).superRefine((input, context) => {
11198
12153
  const issues = validateThemeTokensDocumentStructure({ token: input });
11199
12154
  for (const issue of issues) {
11200
12155
  context.addIssue({ code: "custom", message: `${issue.path} ${issue.message}` });
11201
12156
  }
11202
12157
  });
11203
- var ThemeTokenGroupSchema = z13.record(z13.string(), z13.unknown()).superRefine((input, context) => {
12158
+ var ThemeTokenGroupSchema = z14.record(z14.string(), z14.unknown()).superRefine((input, context) => {
11204
12159
  const issues = validateThemeTokensDocumentStructure(input);
11205
12160
  for (const issue of issues) {
11206
12161
  context.addIssue({ code: "custom", message: `${issue.path} ${issue.message}` });
11207
12162
  }
11208
12163
  });
11209
- var ThemeTokensSchema = z13.record(z13.string(), z13.unknown()).superRefine((input, context) => {
12164
+ var ThemeTokensSchema = z14.record(z14.string(), z14.unknown()).superRefine((input, context) => {
11210
12165
  const issues = validateThemeTokensDocument(input);
11211
12166
  for (const issue of issues) {
11212
12167
  context.addIssue({ code: "custom", message: `${issue.path} ${issue.message}` });
@@ -11233,9 +12188,9 @@ var ResolvedThemeTokensSchema = ThemeTokensSchema.superRefine((input, context) =
11233
12188
  });
11234
12189
 
11235
12190
  // src/contracts/tenant.ts
11236
- var DesignTokenFileSourceSchema = z14.object({
11237
- type: z14.literal("file"),
11238
- path: z14.string().trim().min(1).superRefine((source, context) => {
12191
+ var DesignTokenFileSourceSchema = z15.object({
12192
+ type: z15.literal("file"),
12193
+ path: z15.string().trim().min(1).superRefine((source, context) => {
11239
12194
  const isWindowsDrivePath = /^[a-z]:[\\/]/i.test(source);
11240
12195
  if (!isWindowsDrivePath && /^[a-z][a-z\d+.-]*:/i.test(source)) {
11241
12196
  context.addIssue({
@@ -11245,9 +12200,9 @@ var DesignTokenFileSourceSchema = z14.object({
11245
12200
  }
11246
12201
  })
11247
12202
  }).strict();
11248
- var DesignTokenUrlSourceSchema = z14.object({
11249
- type: z14.literal("url"),
11250
- url: z14.string().trim().min(1).superRefine((source, context) => {
12203
+ var DesignTokenUrlSourceSchema = z15.object({
12204
+ type: z15.literal("url"),
12205
+ url: z15.string().trim().min(1).superRefine((source, context) => {
11251
12206
  if (!/^https?:\/\//i.test(source)) {
11252
12207
  context.addIssue({
11253
12208
  code: "custom",
@@ -11256,55 +12211,55 @@ var DesignTokenUrlSourceSchema = z14.object({
11256
12211
  }
11257
12212
  })
11258
12213
  }).strict();
11259
- var DesignTokenInlineSourceSchema = z14.object({
11260
- type: z14.literal("inline"),
12214
+ var DesignTokenInlineSourceSchema = z15.object({
12215
+ type: z15.literal("inline"),
11261
12216
  document: ThemeTokensSchema
11262
12217
  }).strict();
11263
- var DesignTokenSourceSchema = z14.discriminatedUnion("type", [
12218
+ var DesignTokenSourceSchema = z15.discriminatedUnion("type", [
11264
12219
  DesignTokenFileSourceSchema,
11265
12220
  DesignTokenUrlSourceSchema,
11266
12221
  DesignTokenInlineSourceSchema
11267
12222
  ]);
11268
- var TenantDesignTokensConfigSchema = z14.object({
12223
+ var TenantDesignTokensConfigSchema = z15.object({
11269
12224
  /** Ordered tenant overrides. The backend always applies the product default first. */
11270
- tokenSources: z14.array(DesignTokenSourceSchema)
12225
+ tokenSources: z15.array(DesignTokenSourceSchema)
11271
12226
  }).strict();
11272
- var TenantAuthBindingSchema = z14.object({
11273
- kind: z14.literal("auth-provider"),
12227
+ var TenantAuthBindingSchema = z15.object({
12228
+ kind: z15.literal("auth-provider"),
11274
12229
  providerId: ContractIdentifierSchema,
11275
12230
  policyRef: ContractIdentifierSchema.optional()
11276
12231
  }).strict();
11277
- var TenantDataBindingSchema = z14.discriminatedUnion("kind", [
11278
- z14.object({
11279
- kind: z14.literal("data-provider"),
12232
+ var TenantDataBindingSchema = z15.discriminatedUnion("kind", [
12233
+ z15.object({
12234
+ kind: z15.literal("data-provider"),
11280
12235
  providerId: ContractIdentifierSchema,
11281
12236
  domainRef: ContractIdentifierSchema.optional()
11282
12237
  }).strict(),
11283
- z14.object({
11284
- kind: z14.literal("projection"),
12238
+ z15.object({
12239
+ kind: z15.literal("projection"),
11285
12240
  projectionRef: ContractIdentifierSchema,
11286
12241
  domainRef: ContractIdentifierSchema.optional()
11287
12242
  }).strict()
11288
12243
  ]);
11289
- var TenantAuthBindingsSchema = z14.record(
12244
+ var TenantAuthBindingsSchema = z15.record(
11290
12245
  ContractIdentifierSchema,
11291
12246
  TenantAuthBindingSchema
11292
12247
  );
11293
- var TenantDataBindingsSchema = z14.record(
12248
+ var TenantDataBindingsSchema = z15.record(
11294
12249
  ContractIdentifierSchema,
11295
12250
  TenantDataBindingSchema
11296
12251
  );
11297
- var TenantTrendRadarSourceSchema = z14.object({
12252
+ var TenantTrendRadarSourceSchema = z15.object({
11298
12253
  ontologyId: ContractIdentifierSchema,
11299
12254
  viewId: ContractIdentifierSchema
11300
12255
  }).strict();
11301
- var TenantTrendRadarCollectionTargetSchema = z14.object({
12256
+ var TenantTrendRadarCollectionTargetSchema = z15.object({
11302
12257
  ontologyId: ContractIdentifierSchema
11303
12258
  }).strict();
11304
- var TenantTrendRadarEvaluationSchema = z14.object({
12259
+ var TenantTrendRadarEvaluationSchema = z15.object({
11305
12260
  workflowId: ContractIdentifierSchema
11306
12261
  }).strict();
11307
- var TenantTrendRadarDerivedMetricsSchema = z14.object({
12262
+ var TenantTrendRadarDerivedMetricsSchema = z15.object({
11308
12263
  productCountFieldKey: ContractIdentifierSchema,
11309
12264
  salesValueCountFieldKey: ContractIdentifierSchema,
11310
12265
  salesSumFieldKey: ContractIdentifierSchema
@@ -11312,7 +12267,7 @@ var TenantTrendRadarDerivedMetricsSchema = z14.object({
11312
12267
  ({ productCountFieldKey, salesValueCountFieldKey, salesSumFieldKey }) => (/* @__PURE__ */ new Set([productCountFieldKey, salesValueCountFieldKey, salesSumFieldKey])).size === 3,
11313
12268
  { message: "Trend Radar derived metric Field Keys must be distinct." }
11314
12269
  );
11315
- var TenantTrendRadarSourcesSchema = z14.object({
12270
+ var TenantTrendRadarSourcesSchema = z15.object({
11316
12271
  products: TenantTrendRadarSourceSchema.optional(),
11317
12272
  hotwords: TenantTrendRadarSourceSchema.optional(),
11318
12273
  brands: TenantTrendRadarSourceSchema.optional(),
@@ -11320,58 +12275,58 @@ var TenantTrendRadarSourcesSchema = z14.object({
11320
12275
  derivedMetrics: TenantTrendRadarDerivedMetricsSchema.optional(),
11321
12276
  evaluation: TenantTrendRadarEvaluationSchema.optional()
11322
12277
  }).strict();
11323
- var AssetVariantsSchema = z14.object({
11324
- light: z14.string().optional(),
11325
- dark: z14.string().optional()
12278
+ var AssetVariantsSchema = z15.object({
12279
+ light: z15.string().optional(),
12280
+ dark: z15.string().optional()
11326
12281
  }).strict();
11327
- var TenantAgentThemeConfigSchema = z14.object({
12282
+ var TenantAgentThemeConfigSchema = z15.object({
11328
12283
  logo: AssetVariantsSchema.optional(),
11329
- brandDisplayMode: z14.enum(["auto", "logo-only", "logo-name", "name-only"]).optional(),
11330
- density: z14.enum(["compact", "default", "comfortable"]).optional(),
12284
+ brandDisplayMode: z15.enum(["auto", "logo-only", "logo-name", "name-only"]).optional(),
12285
+ density: z15.enum(["compact", "default", "comfortable"]).optional(),
11331
12286
  sidebar: AgentWorkbenchSidebarConfigSchema.optional(),
11332
12287
  /** @deprecated Use sidebar.navigationMode. */
11333
- navigationMode: z14.enum(["default", "session", "trend"]).optional(),
12288
+ navigationMode: z15.enum(["default", "session", "trend"]).optional(),
11334
12289
  /** @deprecated Use sidebar.quickStartEnabled. */
11335
- quickStartEnabled: z14.boolean().optional()
12290
+ quickStartEnabled: z15.boolean().optional()
11336
12291
  }).strict();
11337
12292
  var LEGACY_CURRENT_USER_MENU_ITEM_IDS = ["dark-mode", "language", "settings", "logout"];
11338
12293
  var CURRENT_USER_MENU_CONTROL_REFS = ["dark-mode", "language"];
11339
12294
  var CURRENT_USER_MENU_ACTION_REFS = ["logout"];
11340
- var CurrentUserMenuIdentifierSchema = z14.string().trim().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/, "Expected a stable current-user menu identifier.");
11341
- var CurrentUserMenuDisplayTextSchema = z14.union([
11342
- z14.string().trim().min(1),
11343
- z14.record(z14.string().trim().min(1), z14.string().trim().min(1)).refine((value) => Object.keys(value).length > 0, "Localized menu text must contain at least one locale.")
12295
+ var CurrentUserMenuIdentifierSchema = z15.string().trim().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/, "Expected a stable current-user menu identifier.");
12296
+ var CurrentUserMenuDisplayTextSchema = z15.union([
12297
+ z15.string().trim().min(1),
12298
+ z15.record(z15.string().trim().min(1), z15.string().trim().min(1)).refine((value) => Object.keys(value).length > 0, "Localized menu text must contain at least one locale.")
11344
12299
  ]);
11345
- var CurrentUserMenuNavigationItemSchema = z14.object({
12300
+ var CurrentUserMenuNavigationItemSchema = z15.object({
11346
12301
  id: CurrentUserMenuIdentifierSchema,
11347
- kind: z14.literal("navigation"),
12302
+ kind: z15.literal("navigation"),
11348
12303
  ref: CurrentUserMenuIdentifierSchema
11349
12304
  }).strict();
11350
- var CurrentUserMenuControlItemSchema = z14.object({
12305
+ var CurrentUserMenuControlItemSchema = z15.object({
11351
12306
  id: CurrentUserMenuIdentifierSchema,
11352
- kind: z14.literal("control"),
11353
- ref: z14.enum(CURRENT_USER_MENU_CONTROL_REFS)
12307
+ kind: z15.literal("control"),
12308
+ ref: z15.enum(CURRENT_USER_MENU_CONTROL_REFS)
11354
12309
  }).strict();
11355
- var CurrentUserMenuActionItemSchema = z14.object({
12310
+ var CurrentUserMenuActionItemSchema = z15.object({
11356
12311
  id: CurrentUserMenuIdentifierSchema,
11357
- kind: z14.literal("action"),
11358
- ref: z14.enum(CURRENT_USER_MENU_ACTION_REFS),
11359
- tone: z14.enum(["default", "danger"]).optional()
12312
+ kind: z15.literal("action"),
12313
+ ref: z15.enum(CURRENT_USER_MENU_ACTION_REFS),
12314
+ tone: z15.enum(["default", "danger"]).optional()
11360
12315
  }).strict();
11361
- var CurrentUserMenuItemSchema = z14.discriminatedUnion("kind", [
12316
+ var CurrentUserMenuItemSchema = z15.discriminatedUnion("kind", [
11362
12317
  CurrentUserMenuNavigationItemSchema,
11363
12318
  CurrentUserMenuControlItemSchema,
11364
12319
  CurrentUserMenuActionItemSchema
11365
12320
  ]);
11366
- var CurrentUserMenuSectionSchema = z14.object({
12321
+ var CurrentUserMenuSectionSchema = z15.object({
11367
12322
  id: CurrentUserMenuIdentifierSchema,
11368
12323
  label: CurrentUserMenuDisplayTextSchema.optional(),
11369
- dividerBefore: z14.boolean().optional(),
11370
- items: z14.array(CurrentUserMenuItemSchema)
12324
+ dividerBefore: z15.boolean().optional(),
12325
+ items: z15.array(CurrentUserMenuItemSchema)
11371
12326
  }).strict();
11372
- var CurrentUserMenuConfigSchema = z14.object({
11373
- version: z14.literal(1),
11374
- sections: z14.array(CurrentUserMenuSectionSchema).max(20)
12327
+ var CurrentUserMenuConfigSchema = z15.object({
12328
+ version: z15.literal(1),
12329
+ sections: z15.array(CurrentUserMenuSectionSchema).max(20)
11375
12330
  }).strict().superRefine((value, context) => {
11376
12331
  const sectionIds = /* @__PURE__ */ new Set();
11377
12332
  const itemIds = /* @__PURE__ */ new Set();
@@ -11405,7 +12360,7 @@ var CurrentUserMenuConfigSchema = z14.object({
11405
12360
  });
11406
12361
  }
11407
12362
  });
11408
- var LegacyCurrentUserMenuProfileSchema = z14.array(z14.enum(LEGACY_CURRENT_USER_MENU_ITEM_IDS)).superRefine((value, context) => {
12363
+ var LegacyCurrentUserMenuProfileSchema = z15.array(z15.enum(LEGACY_CURRENT_USER_MENU_ITEM_IDS)).superRefine((value, context) => {
11409
12364
  const seen = /* @__PURE__ */ new Set();
11410
12365
  value.forEach((item, index) => {
11411
12366
  if (seen.has(item)) {
@@ -11418,73 +12373,73 @@ var LegacyCurrentUserMenuProfileSchema = z14.array(z14.enum(LEGACY_CURRENT_USER_
11418
12373
  seen.add(item);
11419
12374
  });
11420
12375
  });
11421
- var CurrentUserMenuProfileSchema = z14.union([
11422
- z14.literal("*"),
12376
+ var CurrentUserMenuProfileSchema = z15.union([
12377
+ z15.literal("*"),
11423
12378
  LegacyCurrentUserMenuProfileSchema,
11424
12379
  CurrentUserMenuConfigSchema
11425
12380
  ]);
11426
- var ThemeHeadbarSchema = z14.object({
11427
- theme: z14.enum(["card", "glassy", "ghost"]).optional(),
11428
- navPosition: z14.enum(["left", "center", "right"]).optional(),
11429
- actions: z14.union([z14.literal("*"), z14.array(ContractIdentifierSchema)]).optional(),
12381
+ var ThemeHeadbarSchema = z15.object({
12382
+ theme: z15.enum(["card", "glassy", "ghost"]).optional(),
12383
+ navPosition: z15.enum(["left", "center", "right"]).optional(),
12384
+ actions: z15.union([z15.literal("*"), z15.array(ContractIdentifierSchema)]).optional(),
11430
12385
  profile: CurrentUserMenuProfileSchema.optional(),
11431
- showTeamQuota: z14.boolean().optional()
12386
+ showTeamQuota: z15.boolean().optional()
11432
12387
  }).strict();
11433
- var TenantHeadbarModuleLeafSchema = z14.object({
12388
+ var TenantHeadbarModuleLeafSchema = z15.object({
11434
12389
  id: ContractIdentifierSchema,
11435
- extraInfo: z14.boolean().optional(),
11436
- displayName: z14.union([z14.string(), z14.record(LocaleIdentifierSchema, z14.string())]).optional(),
11437
- visible: z14.boolean().optional(),
11438
- disabled: z14.boolean().optional(),
11439
- icon: z14.string().optional(),
11440
- showQuickSwitcher: z14.boolean().optional(),
11441
- showSidebar: z14.boolean().optional(),
11442
- showContentFrame: z14.boolean().optional()
12390
+ extraInfo: z15.boolean().optional(),
12391
+ displayName: z15.union([z15.string(), z15.record(LocaleIdentifierSchema, z15.string())]).optional(),
12392
+ visible: z15.boolean().optional(),
12393
+ disabled: z15.boolean().optional(),
12394
+ icon: z15.string().optional(),
12395
+ showQuickSwitcher: z15.boolean().optional(),
12396
+ showSidebar: z15.boolean().optional(),
12397
+ showContentFrame: z15.boolean().optional()
11443
12398
  }).strict();
11444
12399
  var TenantHeadbarModuleItemSchema = TenantHeadbarModuleLeafSchema.extend({
11445
- children: z14.array(TenantHeadbarModuleLeafSchema).optional()
11446
- }).strict();
11447
- var KernelHeadbarSchema = z14.object({
11448
- theme: z14.literal("card").optional(),
11449
- layoutMode: z14.enum(["boxed", "full-bleed"]).optional(),
11450
- heightPx: z14.number().positive().optional(),
11451
- navPosition: z14.enum(["left", "center", "right"]).optional(),
11452
- brandTitle: z14.string().optional(),
11453
- menuRadius: z14.enum(["default", "none", "sm", "md", "lg", "xl", "full"]).optional()
11454
- }).strict();
11455
- var CustomIconSchema = z14.object({
11456
- color: z14.string().optional(),
11457
- url: z14.string().optional(),
11458
- type: z14.enum(["svg", "image"]).optional(),
11459
- hintTextColor: z14.string().optional()
11460
- }).strict();
11461
- var WorkbenchCustomerToolSchema = z14.object({
12400
+ children: z15.array(TenantHeadbarModuleLeafSchema).optional()
12401
+ }).strict();
12402
+ var KernelHeadbarSchema = z15.object({
12403
+ theme: z15.literal("card").optional(),
12404
+ layoutMode: z15.enum(["boxed", "full-bleed"]).optional(),
12405
+ heightPx: z15.number().positive().optional(),
12406
+ navPosition: z15.enum(["left", "center", "right"]).optional(),
12407
+ brandTitle: z15.string().optional(),
12408
+ menuRadius: z15.enum(["default", "none", "sm", "md", "lg", "xl", "full"]).optional()
12409
+ }).strict();
12410
+ var CustomIconSchema = z15.object({
12411
+ color: z15.string().optional(),
12412
+ url: z15.string().optional(),
12413
+ type: z15.enum(["svg", "image"]).optional(),
12414
+ hintTextColor: z15.string().optional()
12415
+ }).strict();
12416
+ var WorkbenchCustomerToolSchema = z15.object({
11462
12417
  id: ContractIdentifierSchema,
11463
- label: z14.union([z14.string(), z14.record(LocaleIdentifierSchema, z14.string())]).optional(),
11464
- fixed: z14.boolean().optional()
12418
+ label: z15.union([z15.string(), z15.record(LocaleIdentifierSchema, z15.string())]).optional(),
12419
+ fixed: z15.boolean().optional()
11465
12420
  }).strict();
11466
- var WorkbenchStudioOverrideSchema = z14.object({
11467
- studioName: z14.string().trim().min(1),
11468
- dropdownToolsDefault: z14.array(ContractIdentifierSchema).optional(),
11469
- existingToolsDefault: z14.array(ContractIdentifierSchema).optional(),
11470
- historyColumnsDefault: z14.number().int().min(1).max(6).optional()
12421
+ var WorkbenchStudioOverrideSchema = z15.object({
12422
+ studioName: z15.string().trim().min(1),
12423
+ dropdownToolsDefault: z15.array(ContractIdentifierSchema).optional(),
12424
+ existingToolsDefault: z15.array(ContractIdentifierSchema).optional(),
12425
+ historyColumnsDefault: z15.number().int().min(1).max(6).optional()
11471
12426
  }).strict();
11472
- var TenantWorkbenchPageContextSchema = z14.object({
12427
+ var TenantWorkbenchPageContextSchema = z15.object({
11473
12428
  workflow: JsonObjectSchema.optional(),
11474
12429
  agent: JsonObjectSchema.optional(),
11475
12430
  agentId: ContractIdentifierSchema.optional(),
11476
12431
  designProject: JsonObjectSchema.optional(),
11477
12432
  designMetadataId: ContractIdentifierSchema.optional(),
11478
- iframeUrl: z14.string().trim().min(1).optional(),
11479
- info: z14.object({
12433
+ iframeUrl: z15.string().trim().min(1).optional(),
12434
+ info: z15.object({
11480
12435
  displayName: LocalizedTextSchema.optional(),
11481
12436
  description: LocalizedTextSchema.optional(),
11482
- iconUrl: z14.string().trim().min(1).optional()
12437
+ iconUrl: z15.string().trim().min(1).optional()
11483
12438
  }).strict().optional(),
11484
- isBuiltinPinned: z14.boolean().optional(),
11485
- isBuiltinReadonly: z14.boolean().optional()
12439
+ isBuiltinPinned: z15.boolean().optional(),
12440
+ isBuiltinReadonly: z15.boolean().optional()
11486
12441
  }).strict();
11487
- var TenantWorkbenchPageEnvelopeSchema = z14.object({
12442
+ var TenantWorkbenchPageEnvelopeSchema = z15.object({
11488
12443
  definition: PageDefinitionSchema,
11489
12444
  context: TenantWorkbenchPageContextSchema
11490
12445
  }).strict().superRefine(({ definition }, context) => {
@@ -11517,56 +12472,56 @@ var TenantWorkbenchPageEnvelopeSchema = z14.object({
11517
12472
  });
11518
12473
  }
11519
12474
  });
11520
- var TenantWorkbenchPageGroupSchema = z14.object({
12475
+ var TenantWorkbenchPageGroupSchema = z15.object({
11521
12476
  id: ContractIdentifierSchema,
11522
- pageIds: z14.array(ContractIdentifierSchema),
12477
+ pageIds: z15.array(ContractIdentifierSchema),
11523
12478
  displayName: LocalizedTextSchema,
11524
- isBuiltIn: z14.boolean(),
11525
- iconUrl: z14.string().optional(),
11526
- sortIndex: z14.number().int().nullable().optional(),
12479
+ isBuiltIn: z15.boolean(),
12480
+ iconUrl: z15.string().optional(),
12481
+ sortIndex: z15.number().int().nullable().optional(),
11527
12482
  presetRelationId: ContractIdentifierSchema.optional(),
11528
12483
  relationKey: ContractIdentifierSchema.nullable().optional(),
11529
12484
  studioId: ContractIdentifierSchema.optional()
11530
12485
  }).strict();
11531
- var TenantWorkbenchConfigSchema = z14.object({
11532
- pages: z14.array(TenantWorkbenchPageEnvelopeSchema),
11533
- pageGroups: z14.array(TenantWorkbenchPageGroupSchema),
11534
- catalog: z14.object({ enabled: z14.boolean().optional(), defaultEntry: z14.boolean().optional() }).strict().optional(),
11535
- quickSwitcherMaxItems: z14.number().int().nonnegative().optional(),
11536
- defaultOrder: z14.object({
11537
- groups: z14.array(ContractIdentifierSchema),
11538
- pages: z14.record(ContractIdentifierSchema, z14.array(ContractIdentifierSchema))
12486
+ var TenantWorkbenchConfigSchema = z15.object({
12487
+ pages: z15.array(TenantWorkbenchPageEnvelopeSchema),
12488
+ pageGroups: z15.array(TenantWorkbenchPageGroupSchema),
12489
+ catalog: z15.object({ enabled: z15.boolean().optional(), defaultEntry: z15.boolean().optional() }).strict().optional(),
12490
+ quickSwitcherMaxItems: z15.number().int().nonnegative().optional(),
12491
+ defaultOrder: z15.object({
12492
+ groups: z15.array(ContractIdentifierSchema),
12493
+ pages: z15.record(ContractIdentifierSchema, z15.array(ContractIdentifierSchema))
11539
12494
  }).strict().optional(),
11540
- customers: z14.object({
11541
- dropdownToolsDefault: z14.array(ContractIdentifierSchema).optional(),
11542
- layoutManagerTools: z14.array(WorkbenchCustomerToolSchema).optional(),
11543
- studioTabsMode: z14.enum(["dropdown", "tabs"]).optional(),
11544
- historyWatermark: z14.object({
11545
- svgUrl: z14.string().optional(),
11546
- coverage: z14.array(z14.enum(["list", "detail", "download"])).optional(),
11547
- maxLongEdgeRatio: z14.number().positive().optional(),
11548
- sizing: z14.object({
12495
+ customers: z15.object({
12496
+ dropdownToolsDefault: z15.array(ContractIdentifierSchema).optional(),
12497
+ layoutManagerTools: z15.array(WorkbenchCustomerToolSchema).optional(),
12498
+ studioTabsMode: z15.enum(["dropdown", "tabs"]).optional(),
12499
+ historyWatermark: z15.object({
12500
+ svgUrl: z15.string().optional(),
12501
+ coverage: z15.array(z15.enum(["list", "detail", "download"])).optional(),
12502
+ maxLongEdgeRatio: z15.number().positive().optional(),
12503
+ sizing: z15.object({
11549
12504
  mode: ContractIdentifierSchema,
11550
- heightRatio: z14.number().positive().optional(),
11551
- minHeightPx: z14.number().nonnegative().optional(),
11552
- maxHeightPx: z14.number().nonnegative().optional()
12505
+ heightRatio: z15.number().positive().optional(),
12506
+ minHeightPx: z15.number().nonnegative().optional(),
12507
+ maxHeightPx: z15.number().nonnegative().optional()
11553
12508
  }).strict().optional(),
11554
- enhance: z14.object({
11555
- enabled: z14.boolean().optional(),
11556
- backgroundLumaThreshold: z14.number().min(0).max(1).optional(),
11557
- stroke: z14.object({
11558
- color: z14.string().optional(),
11559
- opacity: z14.number().min(0).max(1).optional(),
11560
- widthRatio: z14.number().nonnegative().optional(),
11561
- blurRatio: z14.number().nonnegative().optional(),
11562
- steps: z14.number().int().positive().optional()
12509
+ enhance: z15.object({
12510
+ enabled: z15.boolean().optional(),
12511
+ backgroundLumaThreshold: z15.number().min(0).max(1).optional(),
12512
+ stroke: z15.object({
12513
+ color: z15.string().optional(),
12514
+ opacity: z15.number().min(0).max(1).optional(),
12515
+ widthRatio: z15.number().nonnegative().optional(),
12516
+ blurRatio: z15.number().nonnegative().optional(),
12517
+ steps: z15.number().int().positive().optional()
11563
12518
  }).strict().optional()
11564
12519
  }).strict().optional()
11565
12520
  }).strict().optional(),
11566
- layoutManagerEnabled: z14.boolean().optional(),
11567
- existingToolsDefault: z14.array(ContractIdentifierSchema).optional(),
11568
- historyColumnsDefault: z14.number().int().min(1).max(6).optional(),
11569
- studioOverrides: z14.array(WorkbenchStudioOverrideSchema).optional()
12521
+ layoutManagerEnabled: z15.boolean().optional(),
12522
+ existingToolsDefault: z15.array(ContractIdentifierSchema).optional(),
12523
+ historyColumnsDefault: z15.number().int().min(1).max(6).optional(),
12524
+ studioOverrides: z15.array(WorkbenchStudioOverrideSchema).optional()
11570
12525
  }).strict().optional()
11571
12526
  }).strict().superRefine(({ pages, pageGroups }, context) => {
11572
12527
  const pageIds = pages.map(({ definition }) => definition.pageId);
@@ -11590,38 +12545,38 @@ var TenantWorkbenchConfigSchema = z14.object({
11590
12545
  });
11591
12546
  });
11592
12547
  });
11593
- var LoginPageSchema = z14.object({
11594
- background: z14.object({ imageUrl: z14.string().optional(), gradient: z14.string().optional() }).strict().optional(),
11595
- logo: z14.object({
11596
- url: z14.string().optional(),
11597
- lightUrl: z14.string().optional(),
11598
- darkUrl: z14.string().optional(),
11599
- position: z14.enum(["top", "middle", "bottom"]).optional(),
11600
- scale: z14.number().positive().optional()
12548
+ var LoginPageSchema = z15.object({
12549
+ background: z15.object({ imageUrl: z15.string().optional(), gradient: z15.string().optional() }).strict().optional(),
12550
+ logo: z15.object({
12551
+ url: z15.string().optional(),
12552
+ lightUrl: z15.string().optional(),
12553
+ darkUrl: z15.string().optional(),
12554
+ position: z15.enum(["top", "middle", "bottom"]).optional(),
12555
+ scale: z15.number().positive().optional()
11601
12556
  }).strict().optional(),
11602
- customCss: z14.string().optional()
12557
+ customCss: z15.string().optional()
11603
12558
  }).strict();
11604
12559
  var LandingPageHeadbarConfigShape = {
11605
- headbarMode: z14.enum(["shared", "hidden"]).optional()
12560
+ headbarMode: z15.enum(["shared", "hidden"]).optional()
11606
12561
  };
11607
- var LandingPageDefaultConfigSchema = z14.object({
11608
- mode: z14.literal("default"),
12562
+ var LandingPageDefaultConfigSchema = z15.object({
12563
+ mode: z15.literal("default"),
11609
12564
  ...LandingPageHeadbarConfigShape
11610
12565
  }).strict();
11611
- var LandingPageMarkdownConfigSchema = z14.object({
11612
- mode: z14.literal("markdown"),
11613
- content: z14.string(),
12566
+ var LandingPageMarkdownConfigSchema = z15.object({
12567
+ mode: z15.literal("markdown"),
12568
+ content: z15.string(),
11614
12569
  ...LandingPageHeadbarConfigShape
11615
12570
  }).strict();
11616
- var LandingPageHtmlConfigSchema = z14.object({
11617
- mode: z14.literal("html"),
11618
- content: z14.string(),
12571
+ var LandingPageHtmlConfigSchema = z15.object({
12572
+ mode: z15.literal("html"),
12573
+ content: z15.string(),
11619
12574
  ...LandingPageHeadbarConfigShape
11620
12575
  }).strict();
11621
- var LandingPageIframeConfigSchema = z14.object({
11622
- mode: z14.literal("iframe"),
12576
+ var LandingPageIframeConfigSchema = z15.object({
12577
+ mode: z15.literal("iframe"),
11623
12578
  ...LandingPageHeadbarConfigShape,
11624
- url: z14.string().refine((value) => {
12579
+ url: z15.string().refine((value) => {
11625
12580
  if (/^\/(?!\/)/.test(value)) {
11626
12581
  return !value.includes("\\");
11627
12582
  }
@@ -11633,13 +12588,13 @@ var LandingPageIframeConfigSchema = z14.object({
11633
12588
  }
11634
12589
  }, "Landing page iframe URL must use a root-relative path or HTTP(S) without embedded credentials.")
11635
12590
  }).strict();
11636
- var TenantLandingPageConfigSchema = z14.discriminatedUnion("mode", [
12591
+ var TenantLandingPageConfigSchema = z15.discriminatedUnion("mode", [
11637
12592
  LandingPageDefaultConfigSchema,
11638
12593
  LandingPageMarkdownConfigSchema,
11639
12594
  LandingPageHtmlConfigSchema,
11640
12595
  LandingPageIframeConfigSchema
11641
12596
  ]);
11642
- var ListFooterPageSizeOptionsSchema = z14.array(z14.number().int().positive().max(1e3)).min(1).max(10).superRefine((options, context) => {
12597
+ var ListFooterPageSizeOptionsSchema = z15.array(z15.number().int().positive().max(1e3)).min(1).max(10).superRefine((options, context) => {
11643
12598
  const seen = /* @__PURE__ */ new Set();
11644
12599
  options.forEach((option, index) => {
11645
12600
  if (seen.has(option)) {
@@ -11652,489 +12607,489 @@ var ListFooterPageSizeOptionsSchema = z14.array(z14.number().int().positive().ma
11652
12607
  seen.add(option);
11653
12608
  });
11654
12609
  });
11655
- var TenantListFooterConfigSchema = z14.object({
11656
- showTotal: z14.boolean().optional(),
11657
- showPageSize: z14.boolean().optional(),
12610
+ var TenantListFooterConfigSchema = z15.object({
12611
+ showTotal: z15.boolean().optional(),
12612
+ showPageSize: z15.boolean().optional(),
11658
12613
  pageSizeOptions: ListFooterPageSizeOptionsSchema.optional(),
11659
- paginationMode: z14.enum(["auto", "pages", "compact"]).optional(),
11660
- alignment: z14.enum(["start", "end", "space-between"]).optional(),
11661
- density: z14.enum(["compact", "default", "comfortable"]).optional()
11662
- }).strict();
11663
- var TenantApplicationConfigSchema = z14.object({
11664
- theme: z14.object({
11665
- id: z14.string().optional(),
11666
- name: z14.string().optional(),
11667
- title: z14.string().optional(),
12614
+ paginationMode: z15.enum(["auto", "pages", "compact"]).optional(),
12615
+ alignment: z15.enum(["start", "end", "space-between"]).optional(),
12616
+ density: z15.enum(["compact", "default", "comfortable"]).optional()
12617
+ }).strict();
12618
+ var TenantApplicationConfigSchema = z15.object({
12619
+ theme: z15.object({
12620
+ id: z15.string().optional(),
12621
+ name: z15.string().optional(),
12622
+ title: z15.string().optional(),
11668
12623
  favicon: AssetVariantsSchema.optional(),
11669
12624
  logo: AssetVariantsSchema.optional(),
11670
- pwaIcon: z14.string().optional(),
11671
- form: z14.object({ variant: z14.enum(["bento", "ghost"]) }).strict().optional(),
11672
- toast: z14.object({
11673
- position: z14.enum(["top-right", "top-left", "bottom-right", "bottom-left", "top-center", "bottom-center"])
12625
+ pwaIcon: z15.string().optional(),
12626
+ form: z15.object({ variant: z15.enum(["bento", "ghost"]) }).strict().optional(),
12627
+ toast: z15.object({
12628
+ position: z15.enum(["top-right", "top-left", "bottom-right", "bottom-left", "top-center", "bottom-center"])
11674
12629
  }).strict().optional(),
11675
- icons: z14.object({ error: CustomIconSchema.optional(), empty: CustomIconSchema.optional() }).strict().optional(),
11676
- views: z14.object({
11677
- form: z14.object({
11678
- toast: z14.object({ afterCreate: z14.boolean(), afterDelete: z14.boolean() }).strict(),
11679
- progress: z14.enum(["estimate", "infinite"]),
11680
- onlyResult: z14.boolean(),
11681
- tabular: z14.object({ theme: z14.enum(["default", "tentiary", "primary"]) }).strict()
12630
+ icons: z15.object({ error: CustomIconSchema.optional(), empty: CustomIconSchema.optional() }).strict().optional(),
12631
+ views: z15.object({
12632
+ form: z15.object({
12633
+ toast: z15.object({ afterCreate: z15.boolean(), afterDelete: z15.boolean() }).strict(),
12634
+ progress: z15.enum(["estimate", "infinite"]),
12635
+ onlyResult: z15.boolean(),
12636
+ tabular: z15.object({ theme: z15.enum(["default", "tentiary", "primary"]) }).strict()
11682
12637
  }).strict()
11683
12638
  }).strict().optional(),
11684
12639
  loginPage: LoginPageSchema.optional(),
11685
- extraLanguageURL: z14.record(z14.string(), z14.string()).optional(),
11686
- hideSpaceHeader: z14.boolean().optional(),
11687
- showSidebarTeamSelector: z14.boolean().optional(),
11688
- showWorkbenchSidebar: z14.boolean().optional(),
11689
- workbenchViewTheme: z14.enum(["default", "bsd-blue"]).optional(),
11690
- defaults: z14.object({
11691
- showFormInImageDetail: z14.boolean().optional(),
11692
- darkMode: z14.enum(["light", "dark", "auto"]).optional(),
11693
- language: z14.enum(["en-US", "zh-CN", "ja-JP"]).optional(),
11694
- showDarkModeToggle: z14.boolean().optional(),
11695
- showLanguageToggle: z14.boolean().optional()
12640
+ extraLanguageURL: z15.record(z15.string(), z15.string()).optional(),
12641
+ hideSpaceHeader: z15.boolean().optional(),
12642
+ showSidebarTeamSelector: z15.boolean().optional(),
12643
+ showWorkbenchSidebar: z15.boolean().optional(),
12644
+ workbenchViewTheme: z15.enum(["default", "bsd-blue"]).optional(),
12645
+ defaults: z15.object({
12646
+ showFormInImageDetail: z15.boolean().optional(),
12647
+ darkMode: z15.enum(["light", "dark", "auto"]).optional(),
12648
+ language: z15.enum(["en-US", "zh-CN", "ja-JP"]).optional(),
12649
+ showDarkModeToggle: z15.boolean().optional(),
12650
+ showLanguageToggle: z15.boolean().optional()
11696
12651
  }).strict().optional(),
11697
- modules: z14.object({
11698
- monkeysSpaceSidebar: z14.union([z14.literal("*"), z14.array(ContractIdentifierSchema)]).optional(),
11699
- monkeysSpaceHeadbar: z14.union([
11700
- z14.literal("*"),
11701
- z14.array(TenantHeadbarModuleItemSchema)
12652
+ modules: z15.object({
12653
+ monkeysSpaceSidebar: z15.union([z15.literal("*"), z15.array(ContractIdentifierSchema)]).optional(),
12654
+ monkeysSpaceHeadbar: z15.union([
12655
+ z15.literal("*"),
12656
+ z15.array(TenantHeadbarModuleItemSchema)
11702
12657
  ]).optional(),
11703
- settingsSidebar: z14.union([z14.literal("*"), z14.array(ContractIdentifierSchema)]).optional()
12658
+ settingsSidebar: z15.union([z15.literal("*"), z15.array(ContractIdentifierSchema)]).optional()
11704
12659
  }).strict().optional(),
11705
12660
  headbar: ThemeHeadbarSchema.optional(),
11706
- kernelLayout: z14.object({
11707
- navigationMode: z14.enum(["sidebar", "topbar"]).optional(),
11708
- allowNavigationModeSwitch: z14.boolean().optional(),
12661
+ kernelLayout: z15.object({
12662
+ navigationMode: z15.enum(["sidebar", "topbar"]).optional(),
12663
+ allowNavigationModeSwitch: z15.boolean().optional(),
11709
12664
  headbar: KernelHeadbarSchema.optional()
11710
12665
  }).strict().optional(),
11711
- paginationPosition: z14.enum(["left", "right"]).optional(),
12666
+ paginationPosition: z15.enum(["left", "right"]).optional(),
11712
12667
  listFooter: TenantListFooterConfigSchema.optional(),
11713
- ugcViewIconOnlyMode: z14.boolean().optional(),
11714
- workflowPreviewExecutionGrid: z14.object({
11715
- selectionModeDisplayType: z14.enum(["operation-button", "dropdown-menu"]).optional(),
11716
- clickBehavior: z14.enum(["preview", "select", "fill-form", "none"]).optional(),
11717
- showErrorFilter: z14.boolean().optional(),
11718
- displayType: z14.enum(["grid", "masonry"]).optional(),
11719
- showDetailButton: z14.boolean().optional(),
11720
- aspectRatio: z14.enum(["1:1", "4:3", "3:4", "16:9", "9:16"]).optional()
12668
+ ugcViewIconOnlyMode: z15.boolean().optional(),
12669
+ workflowPreviewExecutionGrid: z15.object({
12670
+ selectionModeDisplayType: z15.enum(["operation-button", "dropdown-menu"]).optional(),
12671
+ clickBehavior: z15.enum(["preview", "select", "fill-form", "none"]).optional(),
12672
+ showErrorFilter: z15.boolean().optional(),
12673
+ displayType: z15.enum(["grid", "masonry"]).optional(),
12674
+ showDetailButton: z15.boolean().optional(),
12675
+ aspectRatio: z15.enum(["1:1", "4:3", "3:4", "16:9", "9:16"]).optional()
11721
12676
  }).strict().optional(),
11722
- workbenchSidebarDefaultOpen: z14.boolean().optional(),
11723
- workbenchSidebarMoreAction: z14.boolean().optional(),
11724
- workbenchSidebarApart: z14.boolean().optional(),
11725
- workbenchSidebarToggleGroupDetail: z14.boolean().optional(),
11726
- workbenchSidebarViewType: z14.boolean().optional(),
11727
- workbenchSidebarFormViewEmbed: z14.boolean().optional(),
11728
- workbenchSidebarModernMode: z14.boolean().optional(),
11729
- ugc: z14.object({ onItemClick: z14.boolean(), subtitle: z14.boolean().optional() }).strict().optional(),
11730
- uniImagePreview: z14.boolean().optional(),
11731
- imagePreviewStyle: z14.union([z14.literal(false), z14.enum(["simple", "normal", "uni"])]).optional(),
11732
- teamAsUser: z14.boolean().optional(),
11733
- themeMode: z14.enum(["shadow", "border"]).optional(),
11734
- density: z14.enum(["compact", "default", "comfortable"]).optional(),
11735
- statusStates: z14.object({
11736
- loading: z14.object({ variant: z14.enum(["spinner", "skeleton"]).optional() }).strict().optional(),
11737
- empty: z14.object({ variant: z14.enum(["default", "compact"]).optional() }).strict().optional(),
11738
- error: z14.object({ showRetry: z14.boolean().optional() }).strict().optional(),
11739
- permission: z14.object({ showRequestAccess: z14.boolean().optional() }).strict().optional(),
11740
- density: z14.enum(["compact", "default", "comfortable"]).optional()
12677
+ workbenchSidebarDefaultOpen: z15.boolean().optional(),
12678
+ workbenchSidebarMoreAction: z15.boolean().optional(),
12679
+ workbenchSidebarApart: z15.boolean().optional(),
12680
+ workbenchSidebarToggleGroupDetail: z15.boolean().optional(),
12681
+ workbenchSidebarViewType: z15.boolean().optional(),
12682
+ workbenchSidebarFormViewEmbed: z15.boolean().optional(),
12683
+ workbenchSidebarModernMode: z15.boolean().optional(),
12684
+ ugc: z15.object({ onItemClick: z15.boolean(), subtitle: z15.boolean().optional() }).strict().optional(),
12685
+ uniImagePreview: z15.boolean().optional(),
12686
+ imagePreviewStyle: z15.union([z15.literal(false), z15.enum(["simple", "normal", "uni"])]).optional(),
12687
+ teamAsUser: z15.boolean().optional(),
12688
+ themeMode: z15.enum(["shadow", "border"]).optional(),
12689
+ density: z15.enum(["compact", "default", "comfortable"]).optional(),
12690
+ statusStates: z15.object({
12691
+ loading: z15.object({ variant: z15.enum(["spinner", "skeleton"]).optional() }).strict().optional(),
12692
+ empty: z15.object({ variant: z15.enum(["default", "compact"]).optional() }).strict().optional(),
12693
+ error: z15.object({ showRetry: z15.boolean().optional() }).strict().optional(),
12694
+ permission: z15.object({ showRequestAccess: z15.boolean().optional() }).strict().optional(),
12695
+ density: z15.enum(["compact", "default", "comfortable"]).optional()
11741
12696
  }).strict().optional(),
11742
- pageZoom: z14.number().positive().optional(),
11743
- miniMode: z14.object({ showPreviewViewExecutionResultGrid: z14.boolean() }).strict().optional(),
11744
- workflow: z14.object({ allowConcurrentRuns: z14.boolean() }).strict().optional(),
11745
- historyResult: z14.object({ display: z14.boolean() }).strict().optional(),
11746
- uploader: z14.object({
11747
- orientation: z14.enum(["vertical", "horizontal"]),
11748
- pasteButton: z14.boolean(),
11749
- statusText: z14.boolean()
12697
+ pageZoom: z15.number().positive().optional(),
12698
+ miniMode: z15.object({ showPreviewViewExecutionResultGrid: z15.boolean() }).strict().optional(),
12699
+ workflow: z15.object({ allowConcurrentRuns: z15.boolean() }).strict().optional(),
12700
+ historyResult: z15.object({ display: z15.boolean() }).strict().optional(),
12701
+ uploader: z15.object({
12702
+ orientation: z15.enum(["vertical", "horizontal"]),
12703
+ pasteButton: z15.boolean(),
12704
+ statusText: z15.boolean()
11750
12705
  }).strict().optional(),
11751
- designProjects: z14.object({
11752
- oneOnOne: z14.boolean(),
11753
- newTabOpenBoard: z14.boolean(),
11754
- defaultShowGrid: z14.boolean().optional(),
11755
- createDefaultFrame: z14.boolean(),
11756
- showPageMenu: z14.boolean(),
11757
- showMainMenu: z14.boolean(),
11758
- showStylePanel: z14.boolean(),
11759
- showToolbar: z14.boolean(),
11760
- toolbarPosition: z14.enum(["bottom", "left"]).optional(),
11761
- showContextMenu: z14.boolean(),
11762
- showActionsMenu: z14.boolean(),
11763
- showPageAndLayerSidebar: z14.boolean().optional(),
11764
- showBoardOperationSidebar: z14.boolean().optional(),
11765
- showMiniToolsToolbar: z14.boolean().optional(),
11766
- showRightSidebar: z14.boolean().optional(),
11767
- showRealtimeDrawing: z14.boolean().optional(),
11768
- showWorkflow: z14.boolean().optional(),
11769
- showVersionManager: z14.boolean().optional(),
11770
- showAgent: z14.boolean().optional(),
11771
- AgentTools: z14.array(ContractIdentifierSchema).optional()
12706
+ designProjects: z15.object({
12707
+ oneOnOne: z15.boolean(),
12708
+ newTabOpenBoard: z15.boolean(),
12709
+ defaultShowGrid: z15.boolean().optional(),
12710
+ createDefaultFrame: z15.boolean(),
12711
+ showPageMenu: z15.boolean(),
12712
+ showMainMenu: z15.boolean(),
12713
+ showStylePanel: z15.boolean(),
12714
+ showToolbar: z15.boolean(),
12715
+ toolbarPosition: z15.enum(["bottom", "left"]).optional(),
12716
+ showContextMenu: z15.boolean(),
12717
+ showActionsMenu: z15.boolean(),
12718
+ showPageAndLayerSidebar: z15.boolean().optional(),
12719
+ showBoardOperationSidebar: z15.boolean().optional(),
12720
+ showMiniToolsToolbar: z15.boolean().optional(),
12721
+ showRightSidebar: z15.boolean().optional(),
12722
+ showRealtimeDrawing: z15.boolean().optional(),
12723
+ showWorkflow: z15.boolean().optional(),
12724
+ showVersionManager: z15.boolean().optional(),
12725
+ showAgent: z15.boolean().optional(),
12726
+ AgentTools: z15.array(ContractIdentifierSchema).optional()
11772
12727
  }).strict().optional(),
11773
12728
  workbench: TenantWorkbenchConfigSchema.optional(),
11774
- visionProWorkflows: z14.array(ContractIdentifierSchema).optional(),
11775
- initTeam: z14.boolean().optional(),
11776
- imageThumbnail: z14.boolean().optional(),
11777
- pages: z14.object({
11778
- allowPageKeys: z14.union([z14.literal("*"), z14.array(ContractIdentifierSchema)]),
12729
+ visionProWorkflows: z15.array(ContractIdentifierSchema).optional(),
12730
+ initTeam: z15.boolean().optional(),
12731
+ imageThumbnail: z15.boolean().optional(),
12732
+ pages: z15.object({
12733
+ allowPageKeys: z15.union([z15.literal("*"), z15.array(ContractIdentifierSchema)]),
11779
12734
  defaultPageKey: ContractIdentifierSchema.optional(),
11780
- homeEntryEnabled: z14.boolean().optional()
12735
+ homeEntryEnabled: z15.boolean().optional()
11781
12736
  }).strict().optional(),
11782
12737
  agent: TenantAgentThemeConfigSchema.optional()
11783
12738
  }).strict(),
11784
12739
  landingPage: TenantLandingPageConfigSchema.optional(),
11785
- auth: z14.object({
11786
- enabled: z14.array(ContractIdentifierSchema).default([]),
11787
- oidc: z14.object({ buttonText: z14.string().optional(), autoSignin: z14.boolean().optional() }).strict().optional(),
11788
- password: z14.object({
11789
- registrationEnabled: z14.boolean().optional(),
11790
- disableAutoRegister: z14.boolean().optional()
12740
+ auth: z15.object({
12741
+ enabled: z15.array(ContractIdentifierSchema).default([]),
12742
+ oidc: z15.object({ buttonText: z15.string().optional(), autoSignin: z15.boolean().optional() }).strict().optional(),
12743
+ password: z15.object({
12744
+ registrationEnabled: z15.boolean().optional(),
12745
+ disableAutoRegister: z15.boolean().optional()
11791
12746
  }).strict().optional(),
11792
- registrationApproval: z14.object({
11793
- enabled: z14.boolean().optional()
12747
+ registrationApproval: z15.object({
12748
+ enabled: z15.boolean().optional()
11794
12749
  }).strict().optional(),
11795
- hideAuthToast: z14.boolean().optional(),
11796
- autoReload: z14.boolean().optional(),
11797
- defaultOtherTeam: z14.boolean().optional()
12750
+ hideAuthToast: z15.boolean().optional(),
12751
+ autoReload: z15.boolean().optional(),
12752
+ defaultOtherTeam: z15.boolean().optional()
11798
12753
  }).strict(),
11799
- endpoints: z14.record(ContractIdentifierSchema, z14.string()),
11800
- module: z14.union([z14.literal("*"), z14.array(ContractIdentifierSchema)]),
11801
- behavior: z14.object({
11802
- clearWorkflowFormStorageAfterUpdate: z14.boolean().optional(),
11803
- autoApproveOAuth: z14.boolean().optional(),
11804
- rememberWorkflowModelSelection: z14.boolean().optional()
12754
+ endpoints: z15.record(ContractIdentifierSchema, z15.string()),
12755
+ module: z15.union([z15.literal("*"), z15.array(ContractIdentifierSchema)]),
12756
+ behavior: z15.object({
12757
+ clearWorkflowFormStorageAfterUpdate: z15.boolean().optional(),
12758
+ autoApproveOAuth: z15.boolean().optional(),
12759
+ rememberWorkflowModelSelection: z15.boolean().optional()
11805
12760
  }).strict(),
11806
- dataManagement: z14.object({
11807
- favoriteOntologyId: z14.string().optional(),
11808
- pairedOntologyId: z14.string().optional(),
11809
- galleryOntologyIds: z14.array(ContractIdentifierSchema).max(20).optional(),
11810
- galleryOntologyId: z14.string().optional(),
11811
- dataBrowserDefaultOntologyId: z14.string().optional(),
11812
- workflowResultOntologyId: z14.string().optional(),
11813
- homeAdvertisement: z14.object({
12761
+ dataManagement: z15.object({
12762
+ favoriteOntologyId: z15.string().optional(),
12763
+ pairedOntologyId: z15.string().optional(),
12764
+ galleryOntologyIds: z15.array(ContractIdentifierSchema).max(20).optional(),
12765
+ galleryOntologyId: z15.string().optional(),
12766
+ dataBrowserDefaultOntologyId: z15.string().optional(),
12767
+ workflowResultOntologyId: z15.string().optional(),
12768
+ homeAdvertisement: z15.object({
11814
12769
  ontologyId: ContractIdentifierSchema,
11815
12770
  viewId: ContractIdentifierSchema.optional(),
11816
- viewType: z14.enum(["filter", "container", "share_link"]).optional(),
12771
+ viewType: z15.enum(["filter", "container", "share_link"]).optional(),
11817
12772
  teamId: ContractIdentifierSchema.optional(),
11818
- teamOnly: z14.boolean().optional(),
11819
- pageSize: z14.number().int().positive().optional(),
11820
- sortBy: z14.enum(["pin_order", "asset_id", "updated_timestamp", "created_timestamp"]).optional(),
11821
- sortOrder: z14.enum(["asc", "desc"]).optional(),
11822
- fieldMap: z14.record(z14.string(), z14.string()).optional(),
11823
- columnIds: z14.record(z14.string(), z14.string()).optional()
12773
+ teamOnly: z15.boolean().optional(),
12774
+ pageSize: z15.number().int().positive().optional(),
12775
+ sortBy: z15.enum(["pin_order", "asset_id", "updated_timestamp", "created_timestamp"]).optional(),
12776
+ sortOrder: z15.enum(["asc", "desc"]).optional(),
12777
+ fieldMap: z15.record(z15.string(), z15.string()).optional(),
12778
+ columnIds: z15.record(z15.string(), z15.string()).optional()
11824
12779
  }).strict().optional(),
11825
- homeTrendAssistant: z14.object({
12780
+ homeTrendAssistant: z15.object({
11826
12781
  ontologyId: ContractIdentifierSchema.optional(),
11827
12782
  viewId: ContractIdentifierSchema.optional(),
11828
12783
  viewInstanceId: ContractIdentifierSchema.optional(),
11829
- viewName: z14.string().optional(),
12784
+ viewName: z15.string().optional(),
11830
12785
  teamId: ContractIdentifierSchema.optional(),
11831
12786
  designOptionsWorkflowId: ContractIdentifierSchema.optional(),
11832
- tep: z14.object({ baseUrl: z14.string().optional(), timeoutMs: z14.number().int().positive().optional() }).strict().optional(),
11833
- runtime: z14.object({ appId: ContractIdentifierSchema, tepBaseUrlConfigured: z14.boolean(), tepAuthorizationConfigured: z14.boolean(), tepCookieConfigured: z14.boolean() }).strict().optional()
12787
+ tep: z15.object({ baseUrl: z15.string().optional(), timeoutMs: z15.number().int().positive().optional() }).strict().optional(),
12788
+ runtime: z15.object({ appId: ContractIdentifierSchema, tepBaseUrlConfigured: z15.boolean(), tepAuthorizationConfigured: z15.boolean(), tepCookieConfigured: z15.boolean() }).strict().optional()
11834
12789
  }).strict().optional(),
11835
- staticTrendReport: z14.object({
12790
+ staticTrendReport: z15.object({
11836
12791
  ontologyId: ContractIdentifierSchema,
11837
12792
  viewId: ContractIdentifierSchema.optional(),
11838
12793
  teamId: ContractIdentifierSchema.optional()
11839
12794
  }).strict().optional(),
11840
12795
  trendRadar: TenantTrendRadarSourcesSchema.optional(),
11841
- sharing: z14.object({
11842
- silentViewLinks: z14.object({ enabled: z14.boolean().optional(), placement: z14.object({ mode: z14.enum(["sourceOntology", "ontology"]).optional(), ontologyId: ContractIdentifierSchema.optional(), parentId: ContractIdentifierSchema.optional(), navId: ContractIdentifierSchema.optional() }).strict().optional() }).strict().optional(),
11843
- shareAccess: z14.object({ publicLinksEnabled: z14.boolean().optional(), passwordGateEnabled: z14.boolean().optional(), passwordAccessTtlSeconds: z14.number().int().positive().optional(), defaultViewTreeDelivery: z14.enum(["manual", "auto"]).optional() }).strict().optional(),
11844
- shareDialog: z14.object({
11845
- audience: z14.object({ enabled: z14.boolean().optional(), allowed: z14.array(z14.enum(["user", "team", "public"])).optional(), default: z14.enum(["user", "team", "public"]).optional() }).strict().optional(),
11846
- accessLevel: z14.object({ enabled: z14.boolean().optional(), allowed: z14.array(z14.enum(["read", "write"])).optional(), default: z14.enum(["read", "write"]).optional() }).strict().optional(),
11847
- viewTreeDelivery: z14.object({ enabled: z14.boolean().optional(), allowed: z14.array(z14.enum(["manual", "auto"])).optional(), default: z14.enum(["manual", "auto"]).optional() }).strict().optional()
12796
+ sharing: z15.object({
12797
+ silentViewLinks: z15.object({ enabled: z15.boolean().optional(), placement: z15.object({ mode: z15.enum(["sourceOntology", "ontology"]).optional(), ontologyId: ContractIdentifierSchema.optional(), parentId: ContractIdentifierSchema.optional(), navId: ContractIdentifierSchema.optional() }).strict().optional() }).strict().optional(),
12798
+ shareAccess: z15.object({ publicLinksEnabled: z15.boolean().optional(), passwordGateEnabled: z15.boolean().optional(), passwordAccessTtlSeconds: z15.number().int().positive().optional(), defaultViewTreeDelivery: z15.enum(["manual", "auto"]).optional() }).strict().optional(),
12799
+ shareDialog: z15.object({
12800
+ audience: z15.object({ enabled: z15.boolean().optional(), allowed: z15.array(z15.enum(["user", "team", "public"])).optional(), default: z15.enum(["user", "team", "public"]).optional() }).strict().optional(),
12801
+ accessLevel: z15.object({ enabled: z15.boolean().optional(), allowed: z15.array(z15.enum(["read", "write"])).optional(), default: z15.enum(["read", "write"]).optional() }).strict().optional(),
12802
+ viewTreeDelivery: z15.object({ enabled: z15.boolean().optional(), allowed: z15.array(z15.enum(["manual", "auto"])).optional(), default: z15.enum(["manual", "auto"]).optional() }).strict().optional()
11848
12803
  }).strict().optional()
11849
12804
  }).strict().optional()
11850
12805
  }).strict().optional(),
11851
- kernelRuntime: z14.object({
11852
- integrations: z14.object({
11853
- harbor: z14.object({ endpoint: z14.string().optional(), projectScopes: z14.array(z14.string()).optional(), authMode: z14.string().optional(), principal: z14.string().optional(), autoSync: z14.boolean().optional(), proxyUrl: z14.string().optional() }).strict().optional(),
11854
- gitlab: z14.object({ baseUrl: z14.string().optional(), groupScopes: z14.array(z14.string()).optional(), tokenMode: z14.string().optional(), deployProjectPath: z14.string().optional(), deploymentReportsEnabled: z14.boolean().optional(), proxyUrl: z14.string().optional() }).strict().optional(),
11855
- kubernetes: z14.object({ accessMode: z14.string().optional(), clusterAlias: z14.string().optional(), agentProjectPath: z14.string().optional(), agentName: z14.string().optional(), namespaceScopes: z14.array(z14.string()).optional(), rolloutObserverEnabled: z14.boolean().optional(), proxyUrl: z14.string().optional() }).strict().optional()
12806
+ kernelRuntime: z15.object({
12807
+ integrations: z15.object({
12808
+ harbor: z15.object({ endpoint: z15.string().optional(), projectScopes: z15.array(z15.string()).optional(), authMode: z15.string().optional(), principal: z15.string().optional(), autoSync: z15.boolean().optional(), proxyUrl: z15.string().optional() }).strict().optional(),
12809
+ gitlab: z15.object({ baseUrl: z15.string().optional(), groupScopes: z15.array(z15.string()).optional(), tokenMode: z15.string().optional(), deployProjectPath: z15.string().optional(), deploymentReportsEnabled: z15.boolean().optional(), proxyUrl: z15.string().optional() }).strict().optional(),
12810
+ kubernetes: z15.object({ accessMode: z15.string().optional(), clusterAlias: z15.string().optional(), agentProjectPath: z15.string().optional(), agentName: z15.string().optional(), namespaceScopes: z15.array(z15.string()).optional(), rolloutObserverEnabled: z15.boolean().optional(), proxyUrl: z15.string().optional() }).strict().optional()
11856
12811
  }).strict().optional()
11857
12812
  }).strict().optional(),
11858
- data: z14.object({}).strict().optional(),
11859
- storage: z14.object({
11860
- presignMode: z14.enum(["frontend", "backend", "both"]).optional(),
11861
- presign: z14.object({
11862
- expiresInSeconds: z14.number().int().positive(),
11863
- buckets: z14.array(
11864
- z14.object({
12813
+ data: z15.object({}).strict().optional(),
12814
+ storage: z15.object({
12815
+ presignMode: z15.enum(["frontend", "backend", "both"]).optional(),
12816
+ presign: z15.object({
12817
+ expiresInSeconds: z15.number().int().positive(),
12818
+ buckets: z15.array(
12819
+ z15.object({
11865
12820
  id: ContractIdentifierSchema,
11866
12821
  provider: ContractIdentifierSchema,
11867
12822
  preferredUrlPatternId: ContractIdentifierSchema,
11868
- urlPatterns: z14.array(
11869
- z14.object({
12823
+ urlPatterns: z15.array(
12824
+ z15.object({
11870
12825
  id: ContractIdentifierSchema,
11871
- type: z14.enum(["bucket-hostname", "provider-hostname"]),
11872
- hostname: z14.string().trim().min(1),
11873
- preferred: z14.boolean().optional(),
11874
- bucketSegment: z14.string().optional()
12826
+ type: z15.enum(["bucket-hostname", "provider-hostname"]),
12827
+ hostname: z15.string().trim().min(1),
12828
+ preferred: z15.boolean().optional(),
12829
+ bucketSegment: z15.string().optional()
11875
12830
  }).strict()
11876
12831
  )
11877
12832
  }).strict()
11878
12833
  )
11879
12834
  }).strict().optional()
11880
12835
  }).strict().optional(),
11881
- monkeyData: z14.object({ baseUrl: z14.string().optional() }).strict().optional()
12836
+ monkeyData: z15.object({ baseUrl: z15.string().optional() }).strict().optional()
11882
12837
  }).strict();
11883
- var TenantProductConfigSchema = z14.object({
11884
- contract: z14.literal("TenantProductConfig"),
12838
+ var TenantProductConfigSchema = z15.object({
12839
+ contract: z15.literal("TenantProductConfig"),
11885
12840
  tenantId: ContractIdentifierSchema,
11886
12841
  appId: ContractIdentifierSchema,
11887
12842
  environment: ContractIdentifierSchema,
11888
12843
  designTokens: TenantDesignTokensConfigSchema,
11889
- moduleRefs: z14.array(ContractIdentifierSchema).default([]),
11890
- pageRefs: z14.array(ContractIdentifierSchema).default([]),
11891
- featureFlags: z14.record(z14.string(), z14.boolean()).default({}),
12844
+ moduleRefs: z15.array(ContractIdentifierSchema).default([]),
12845
+ pageRefs: z15.array(ContractIdentifierSchema).default([]),
12846
+ featureFlags: z15.record(z15.string(), z15.boolean()).default({}),
11892
12847
  authBinding: TenantAuthBindingsSchema,
11893
12848
  dataBinding: TenantDataBindingsSchema,
11894
- sourceMap: z14.record(z14.string(), ContractIdentifierSchema),
11895
- warnings: z14.array(z14.string()).default([]),
12849
+ sourceMap: z15.record(z15.string(), ContractIdentifierSchema),
12850
+ warnings: z15.array(z15.string()).default([]),
11896
12851
  menus: MenuDefinitionSetSchema.optional(),
11897
12852
  applicationConfig: TenantApplicationConfigSchema
11898
12853
  }).strict();
11899
- var TenantRuntimeConfigSchema = z14.object({
11900
- contract: z14.literal("TenantRuntimeConfig"),
12854
+ var TenantRuntimeConfigSchema = z15.object({
12855
+ contract: z15.literal("TenantRuntimeConfig"),
11901
12856
  tenantId: ContractIdentifierSchema,
11902
12857
  appId: ContractIdentifierSchema,
11903
12858
  environment: ContractIdentifierSchema,
11904
12859
  designTokens: ResolvedThemeTokensSchema,
11905
- moduleRefs: z14.array(ContractIdentifierSchema).default([]),
11906
- pageRefs: z14.array(ContractIdentifierSchema).default([]),
11907
- featureFlags: z14.record(z14.string(), z14.boolean()).default({}),
12860
+ moduleRefs: z15.array(ContractIdentifierSchema).default([]),
12861
+ pageRefs: z15.array(ContractIdentifierSchema).default([]),
12862
+ featureFlags: z15.record(z15.string(), z15.boolean()).default({}),
11908
12863
  authBinding: TenantAuthBindingsSchema,
11909
12864
  dataBinding: TenantDataBindingsSchema,
11910
- sourceMap: z14.record(z14.string(), ContractIdentifierSchema),
11911
- warnings: z14.array(z14.string()).default([]),
12865
+ sourceMap: z15.record(z15.string(), ContractIdentifierSchema),
12866
+ warnings: z15.array(z15.string()).default([]),
11912
12867
  menuBundle: MenuRuntimeBundleSchema.optional(),
11913
12868
  applicationConfig: TenantApplicationConfigSchema
11914
12869
  }).strict();
11915
12870
 
11916
12871
  // src/contracts/trend.ts
11917
- import { z as z15 } from "zod";
11918
- var RadarDecisionMetricsSchema = z15.object({
11919
- currentSales: z15.number().finite(),
11920
- forecastSales: z15.number().finite(),
11921
- searchHeat: z15.number().finite(),
11922
- socialHeat: z15.number().finite(),
11923
- confidence: z15.number().min(0).max(1)
11924
- }).strict();
11925
- var TrendSourceSchema = z15.object({
12872
+ import { z as z16 } from "zod";
12873
+ var RadarDecisionMetricsSchema = z16.object({
12874
+ currentSales: z16.number().finite(),
12875
+ forecastSales: z16.number().finite(),
12876
+ searchHeat: z16.number().finite(),
12877
+ socialHeat: z16.number().finite(),
12878
+ confidence: z16.number().min(0).max(1)
12879
+ }).strict();
12880
+ var TrendSourceSchema = z16.object({
11926
12881
  sourceId: ContractIdentifierSchema,
11927
12882
  provider: ContractIdentifierSchema,
11928
- channel: z15.enum(["trend", "ecommerce", "social", "search", "internal"]),
12883
+ channel: z16.enum(["trend", "ecommerce", "social", "search", "internal"]),
11929
12884
  collectedAt: IsoDateTimeSchema,
11930
- sourceUrl: z15.string().url().optional(),
11931
- evidenceRefs: z15.array(EntityRefSchema).default([])
12885
+ sourceUrl: z16.string().url().optional(),
12886
+ evidenceRefs: z16.array(EntityRefSchema).default([])
11932
12887
  }).strict();
11933
- var TrendIngestRunSchema = z15.object({
11934
- contract: z15.literal("TrendIngestRun"),
12888
+ var TrendIngestRunSchema = z16.object({
12889
+ contract: z16.literal("TrendIngestRun"),
11935
12890
  ingestRunId: ContractIdentifierSchema,
11936
12891
  sourceId: ContractIdentifierSchema,
11937
12892
  requestId: ContractIdentifierSchema,
11938
12893
  idempotencyKey: ContractIdentifierSchema,
11939
- status: z15.enum(["RUNNING", "SUCCEEDED", "FAILED", "PARTIAL"]),
11940
- recordCount: z15.number().int().nonnegative(),
11941
- errorCount: z15.number().int().nonnegative(),
12894
+ status: z16.enum(["RUNNING", "SUCCEEDED", "FAILED", "PARTIAL"]),
12895
+ recordCount: z16.number().int().nonnegative(),
12896
+ errorCount: z16.number().int().nonnegative(),
11942
12897
  startedAt: IsoDateTimeSchema,
11943
12898
  completedAt: IsoDateTimeSchema.optional()
11944
12899
  }).strict();
11945
- var TrendSourceRecordSchema = z15.object({
11946
- contract: z15.literal("TrendSourceRecord"),
12900
+ var TrendSourceRecordSchema = z16.object({
12901
+ contract: z16.literal("TrendSourceRecord"),
11947
12902
  sourceRecordId: ContractIdentifierSchema,
11948
12903
  source: TrendSourceSchema,
11949
12904
  ingestRunRef: EntityRefSchema,
11950
- recordVersion: z15.number().int().positive(),
12905
+ recordVersion: z16.number().int().positive(),
11951
12906
  contentHash: Sha256Schema,
11952
12907
  payload: JsonValueSchema,
11953
12908
  idempotencyKey: ContractIdentifierSchema,
11954
12909
  collectedAt: IsoDateTimeSchema
11955
12910
  }).strict();
11956
- var HotwordBodySchema = z15.object({
11957
- contract: z15.literal("HotwordBody"),
12911
+ var HotwordBodySchema = z16.object({
12912
+ contract: z16.literal("HotwordBody"),
11958
12913
  hotwordId: ContractIdentifierSchema,
11959
- label: z15.string().trim().min(1),
11960
- normalizedLabel: z15.string().trim().min(1),
11961
- categories: z15.array(ContractIdentifierSchema).default([]),
11962
- sourceRefs: z15.array(TrendSourceSchema).min(1),
11963
- relationRefs: z15.array(EntityRefSchema).default([]),
12914
+ label: z16.string().trim().min(1),
12915
+ normalizedLabel: z16.string().trim().min(1),
12916
+ categories: z16.array(ContractIdentifierSchema).default([]),
12917
+ sourceRefs: z16.array(TrendSourceSchema).min(1),
12918
+ relationRefs: z16.array(EntityRefSchema).default([]),
11964
12919
  createdAt: IsoDateTimeSchema,
11965
12920
  updatedAt: IsoDateTimeSchema
11966
12921
  }).strict();
11967
12922
  var CommerceBodyFieldsSchema = {
11968
- displayName: z15.string().trim().min(1),
11969
- normalizedName: z15.string().trim().min(1),
11970
- categories: z15.array(ContractIdentifierSchema).default([]),
11971
- sourceRefs: z15.array(EntityRefSchema).min(1),
11972
- relationRefs: z15.array(EntityRefSchema).default([]),
12923
+ displayName: z16.string().trim().min(1),
12924
+ normalizedName: z16.string().trim().min(1),
12925
+ categories: z16.array(ContractIdentifierSchema).default([]),
12926
+ sourceRefs: z16.array(EntityRefSchema).min(1),
12927
+ relationRefs: z16.array(EntityRefSchema).default([]),
11973
12928
  createdAt: IsoDateTimeSchema,
11974
12929
  updatedAt: IsoDateTimeSchema
11975
12930
  };
11976
- var BrandBodySchema = z15.object({
11977
- contract: z15.literal("BrandBody"),
12931
+ var BrandBodySchema = z16.object({
12932
+ contract: z16.literal("BrandBody"),
11978
12933
  brandId: ContractIdentifierSchema,
11979
12934
  ...CommerceBodyFieldsSchema
11980
12935
  }).strict();
11981
- var ProductBodySchema = z15.object({
11982
- contract: z15.literal("ProductBody"),
12936
+ var ProductBodySchema = z16.object({
12937
+ contract: z16.literal("ProductBody"),
11983
12938
  productId: ContractIdentifierSchema,
11984
12939
  brandRef: EntityRefSchema.optional(),
11985
12940
  ...CommerceBodyFieldsSchema
11986
12941
  }).strict();
11987
- var TrendMetricSnapshotSchema = z15.object({
11988
- contract: z15.literal("TrendMetricSnapshot"),
12942
+ var TrendMetricSnapshotSchema = z16.object({
12943
+ contract: z16.literal("TrendMetricSnapshot"),
11989
12944
  snapshotId: ContractIdentifierSchema,
11990
12945
  subjectRef: EntityRefSchema,
11991
12946
  observedAt: IsoDateTimeSchema,
11992
- metrics: z15.record(z15.string(), z15.number().finite()),
11993
- confidence: z15.number().min(0).max(1),
11994
- evidenceRefs: z15.array(EntityRefSchema).min(1)
12947
+ metrics: z16.record(z16.string(), z16.number().finite()),
12948
+ confidence: z16.number().min(0).max(1),
12949
+ evidenceRefs: z16.array(EntityRefSchema).min(1)
11995
12950
  }).strict();
11996
- var RadarScoreModelBodySchema = z15.object({
11997
- contract: z15.literal("RadarScoreModelBody"),
12951
+ var RadarScoreModelBodySchema = z16.object({
12952
+ contract: z16.literal("RadarScoreModelBody"),
11998
12953
  modelId: ContractIdentifierSchema,
11999
- version: z15.number().int().positive(),
12954
+ version: z16.number().int().positive(),
12000
12955
  weights: RadarDecisionMetricsSchema,
12001
- thresholds: z15.record(z15.string(), z15.number().finite()).default({}),
12002
- explanationRules: z15.record(z15.string(), z15.string().trim().min(1)).default({}),
12956
+ thresholds: z16.record(z16.string(), z16.number().finite()).default({}),
12957
+ explanationRules: z16.record(z16.string(), z16.string().trim().min(1)).default({}),
12003
12958
  createdAt: IsoDateTimeSchema
12004
12959
  }).strict();
12005
- var RadarScoreProjectionSchema = z15.object({
12006
- contract: z15.literal("RadarScoreProjection"),
12960
+ var RadarScoreProjectionSchema = z16.object({
12961
+ contract: z16.literal("RadarScoreProjection"),
12007
12962
  projectionId: ContractIdentifierSchema,
12008
12963
  subjectRef: EntityRefSchema,
12009
12964
  modelRef: EntityRefSchema,
12010
- totalScore: z15.number().finite(),
12965
+ totalScore: z16.number().finite(),
12011
12966
  dimensions: RadarDecisionMetricsSchema,
12012
- evidenceRefs: z15.array(EntityRefSchema).min(1),
12967
+ evidenceRefs: z16.array(EntityRefSchema).min(1),
12013
12968
  freshnessAt: IsoDateTimeSchema
12014
12969
  }).strict();
12015
- var RadarPanoramaNodeSchema = z15.object({
12970
+ var RadarPanoramaNodeSchema = z16.object({
12016
12971
  ref: EntityRefSchema,
12017
- label: z15.string().trim().min(1),
12018
- categories: z15.array(ContractIdentifierSchema).default([]),
12019
- score: z15.number().finite().optional(),
12972
+ label: z16.string().trim().min(1),
12973
+ categories: z16.array(ContractIdentifierSchema).default([]),
12974
+ score: z16.number().finite().optional(),
12020
12975
  freshnessAt: IsoDateTimeSchema.optional()
12021
12976
  }).strict();
12022
- var RadarPanoramaEdgeSchema = z15.object({
12977
+ var RadarPanoramaEdgeSchema = z16.object({
12023
12978
  sourceRef: EntityRefSchema,
12024
12979
  targetRef: EntityRefSchema,
12025
12980
  relation: ContractIdentifierSchema,
12026
- evidenceRefs: z15.array(EntityRefSchema).default([])
12981
+ evidenceRefs: z16.array(EntityRefSchema).default([])
12027
12982
  }).strict();
12028
- var RadarPanoramaSchema = z15.object({
12029
- contract: z15.literal("RadarPanorama"),
12030
- nodes: z15.array(RadarPanoramaNodeSchema),
12031
- edges: z15.array(RadarPanoramaEdgeSchema),
12983
+ var RadarPanoramaSchema = z16.object({
12984
+ contract: z16.literal("RadarPanorama"),
12985
+ nodes: z16.array(RadarPanoramaNodeSchema),
12986
+ edges: z16.array(RadarPanoramaEdgeSchema),
12032
12987
  generatedAt: IsoDateTimeSchema
12033
12988
  }).strict();
12034
- var BrandGeneticsProfileSchema = z15.object({
12035
- contract: z15.literal("BrandGeneticsProfile"),
12989
+ var BrandGeneticsProfileSchema = z16.object({
12990
+ contract: z16.literal("BrandGeneticsProfile"),
12036
12991
  brandRef: EntityRefSchema,
12037
- categories: z15.array(ContractIdentifierSchema).default([]),
12038
- signature: z15.record(ContractIdentifierSchema, z15.number().finite()),
12039
- relatedRefs: z15.array(EntityRefSchema).default([]),
12040
- evidenceRefs: z15.array(EntityRefSchema).default([]),
12992
+ categories: z16.array(ContractIdentifierSchema).default([]),
12993
+ signature: z16.record(ContractIdentifierSchema, z16.number().finite()),
12994
+ relatedRefs: z16.array(EntityRefSchema).default([]),
12995
+ evidenceRefs: z16.array(EntityRefSchema).default([]),
12041
12996
  computedAt: IsoDateTimeSchema
12042
12997
  }).strict();
12043
- var RadarOpportunityMatrixPointSchema = z15.object({
12998
+ var RadarOpportunityMatrixPointSchema = z16.object({
12044
12999
  subjectRef: EntityRefSchema,
12045
- label: z15.string().trim().min(1),
12046
- x: z15.number().finite(),
12047
- y: z15.number().finite(),
12048
- score: z15.number().finite(),
12049
- evidenceRefs: z15.array(EntityRefSchema).default([])
12050
- }).strict();
12051
- var RadarOpportunityMatrixSchema = z15.object({
12052
- contract: z15.literal("RadarOpportunityMatrix"),
12053
- xMetric: z15.enum(["currentSales", "forecastSales", "searchHeat", "socialHeat", "confidence"]),
12054
- yMetric: z15.enum(["currentSales", "forecastSales", "searchHeat", "socialHeat", "confidence"]),
12055
- points: z15.array(RadarOpportunityMatrixPointSchema),
13000
+ label: z16.string().trim().min(1),
13001
+ x: z16.number().finite(),
13002
+ y: z16.number().finite(),
13003
+ score: z16.number().finite(),
13004
+ evidenceRefs: z16.array(EntityRefSchema).default([])
13005
+ }).strict();
13006
+ var RadarOpportunityMatrixSchema = z16.object({
13007
+ contract: z16.literal("RadarOpportunityMatrix"),
13008
+ xMetric: z16.enum(["currentSales", "forecastSales", "searchHeat", "socialHeat", "confidence"]),
13009
+ yMetric: z16.enum(["currentSales", "forecastSales", "searchHeat", "socialHeat", "confidence"]),
13010
+ points: z16.array(RadarOpportunityMatrixPointSchema),
12056
13011
  computedAt: IsoDateTimeSchema
12057
13012
  }).strict();
12058
- var RadarQueryBodySchema = z15.object({
12059
- contract: z15.literal("RadarQueryBody"),
13013
+ var RadarQueryBodySchema = z16.object({
13014
+ contract: z16.literal("RadarQueryBody"),
12060
13015
  queryId: ContractIdentifierSchema,
12061
- filters: z15.record(z15.string(), JsonValueSchema).default({}),
12062
- sort: z15.object({
13016
+ filters: z16.record(z16.string(), JsonValueSchema).default({}),
13017
+ sort: z16.object({
12063
13018
  field: ContractIdentifierSchema,
12064
- direction: z15.enum(["asc", "desc"])
13019
+ direction: z16.enum(["asc", "desc"])
12065
13020
  }).strict(),
12066
- pageSize: z15.number().int().min(1).max(200),
13021
+ pageSize: z16.number().int().min(1).max(200),
12067
13022
  updatedAt: IsoDateTimeSchema
12068
13023
  }).strict();
12069
- var SavedRadarQuerySchema = z15.object({
12070
- contract: z15.literal("SavedRadarQuery"),
13024
+ var SavedRadarQuerySchema = z16.object({
13025
+ contract: z16.literal("SavedRadarQuery"),
12071
13026
  savedQueryId: ContractIdentifierSchema,
12072
13027
  teamId: ContractIdentifierSchema,
12073
13028
  ownerRef: EntityRefSchema,
12074
- name: z15.string().trim().min(1),
13029
+ name: z16.string().trim().min(1),
12075
13030
  queryRef: EntityRefSchema,
12076
- expectedVersion: z15.number().int().nonnegative(),
13031
+ expectedVersion: z16.number().int().nonnegative(),
12077
13032
  updatedAt: IsoDateTimeSchema
12078
13033
  }).strict();
12079
- var RadarSelectionSchema = z15.object({
12080
- contract: z15.literal("RadarSelection"),
13034
+ var RadarSelectionSchema = z16.object({
13035
+ contract: z16.literal("RadarSelection"),
12081
13036
  selectionId: ContractIdentifierSchema,
12082
13037
  teamId: ContractIdentifierSchema,
12083
13038
  ownerRef: EntityRefSchema,
12084
- subjectRefs: z15.array(EntityRefSchema),
12085
- status: z15.enum(["stashed", "selected", "rejected", "archived"]),
12086
- note: z15.string().optional(),
12087
- expectedVersion: z15.number().int().nonnegative(),
13039
+ subjectRefs: z16.array(EntityRefSchema),
13040
+ status: z16.enum(["stashed", "selected", "rejected", "archived"]),
13041
+ note: z16.string().optional(),
13042
+ expectedVersion: z16.number().int().nonnegative(),
12088
13043
  updatedAt: IsoDateTimeSchema
12089
13044
  }).strict();
12090
13045
  var versionedRefFields = {
12091
13046
  id: ContractIdentifierSchema,
12092
- version: z15.union([z15.number().int().positive(), z15.string().trim().min(1)]).optional(),
13047
+ version: z16.union([z16.number().int().positive(), z16.string().trim().min(1)]).optional(),
12093
13048
  ownerRepo: ContractIdentifierSchema.optional()
12094
13049
  };
12095
- var TrendRadarCollectionAssetRefSchema = z15.object({
12096
- kind: z15.literal("asset"),
13050
+ var TrendRadarCollectionAssetRefSchema = z16.object({
13051
+ kind: z16.literal("asset"),
12097
13052
  ...versionedRefFields
12098
13053
  }).strict();
12099
- var TrendRadarCollectionSelectionRefSchema = z15.object({
12100
- kind: z15.literal("radar-selection"),
13054
+ var TrendRadarCollectionSelectionRefSchema = z16.object({
13055
+ kind: z16.literal("radar-selection"),
12101
13056
  ...versionedRefFields
12102
13057
  }).strict();
12103
- var TrendRadarCollectionRunRefSchema = z15.object({
12104
- kind: z15.literal("radar-analysis-run"),
13058
+ var TrendRadarCollectionRunRefSchema = z16.object({
13059
+ kind: z16.literal("radar-analysis-run"),
12105
13060
  ...versionedRefFields
12106
13061
  }).strict();
12107
- var TrendRadarCollectionSubjectRefSchema = z15.object({
12108
- kind: z15.literal("hotword"),
13062
+ var TrendRadarCollectionSubjectRefSchema = z16.object({
13063
+ kind: z16.literal("hotword"),
12109
13064
  ...versionedRefFields
12110
13065
  }).strict();
12111
- var TrendRadarCollectionArtifactRefSchema = z15.object({
12112
- kind: z15.literal("artifact"),
13066
+ var TrendRadarCollectionArtifactRefSchema = z16.object({
13067
+ kind: z16.literal("artifact"),
12113
13068
  ...versionedRefFields
12114
13069
  }).strict();
12115
- var TrendRadarCollectionRecipeEntrySchema = z15.object({
13070
+ var TrendRadarCollectionRecipeEntrySchema = z16.object({
12116
13071
  subjectRef: TrendRadarCollectionSubjectRefSchema,
12117
- label: z15.string().trim().min(1).max(200)
13072
+ label: z16.string().trim().min(1).max(200)
12118
13073
  }).strict();
12119
- var TrendRadarCollectionRecipeSchema = z15.object({
12120
- category: z15.array(TrendRadarCollectionRecipeEntrySchema),
12121
- design: z15.array(TrendRadarCollectionRecipeEntrySchema),
12122
- audience: z15.array(TrendRadarCollectionRecipeEntrySchema)
13074
+ var TrendRadarCollectionRecipeSchema = z16.object({
13075
+ category: z16.array(TrendRadarCollectionRecipeEntrySchema),
13076
+ design: z16.array(TrendRadarCollectionRecipeEntrySchema),
13077
+ audience: z16.array(TrendRadarCollectionRecipeEntrySchema)
12123
13078
  }).strict().refine(
12124
13079
  (recipe) => recipe.category.length + recipe.design.length + recipe.audience.length > 0,
12125
13080
  "A Trend Radar collection recipe must contain at least one subject."
12126
13081
  );
12127
- var TrendRadarCollectionDecisionAxisSchema = z15.object({
13082
+ var TrendRadarCollectionDecisionAxisSchema = z16.object({
12128
13083
  key: ContractIdentifierSchema,
12129
- label: z15.string().trim().min(1).max(200).optional(),
12130
- value: z15.number().finite()
12131
- }).strict();
12132
- var TrendRadarCollectionDecisionProjectionSchema = z15.object({
12133
- axes: z15.array(TrendRadarCollectionDecisionAxisSchema).max(32).optional(),
12134
- overallScore: z15.number().finite().optional(),
12135
- itemRank: z15.number().finite().optional(),
12136
- sourceRefs: z15.array(EntityRefSchema).optional(),
12137
- outputRefs: z15.array(EntityRefSchema).optional()
13084
+ label: z16.string().trim().min(1).max(200).optional(),
13085
+ value: z16.number().finite()
13086
+ }).strict();
13087
+ var TrendRadarCollectionDecisionProjectionSchema = z16.object({
13088
+ axes: z16.array(TrendRadarCollectionDecisionAxisSchema).max(32).optional(),
13089
+ overallScore: z16.number().finite().optional(),
13090
+ itemRank: z16.number().finite().optional(),
13091
+ sourceRefs: z16.array(EntityRefSchema).optional(),
13092
+ outputRefs: z16.array(EntityRefSchema).optional()
12138
13093
  }).strict().superRefine((projection, context) => {
12139
13094
  const hasProjection = Boolean(
12140
13095
  projection.axes?.length || projection.overallScore !== void 0 || projection.itemRank !== void 0 || projection.sourceRefs?.length || projection.outputRefs?.length
@@ -12157,20 +13112,20 @@ var TrendRadarCollectionDecisionProjectionSchema = z15.object({
12157
13112
  seenAxisKeys.add(axis.key);
12158
13113
  });
12159
13114
  });
12160
- var TrendRadarCollectionArtifactProjectionSchema = z15.object({
13115
+ var TrendRadarCollectionArtifactProjectionSchema = z16.object({
12161
13116
  artifactRef: TrendRadarCollectionArtifactRefSchema,
12162
- url: z15.string().url().optional(),
12163
- thumbnailUrl: z15.string().url().optional(),
12164
- mimeType: z15.string().trim().min(1).optional(),
13117
+ url: z16.string().url().optional(),
13118
+ thumbnailUrl: z16.string().url().optional(),
13119
+ mimeType: z16.string().trim().min(1).optional(),
12165
13120
  metadata: JsonObjectSchema.optional()
12166
13121
  }).strict();
12167
- var TrendRadarCollectionProjectionWritebackSchema = z15.object({
12168
- status: z15.enum(["PENDING", "APPLIED", "FAILED"]),
13122
+ var TrendRadarCollectionProjectionWritebackSchema = z16.object({
13123
+ status: z16.enum(["PENDING", "APPLIED", "FAILED"]),
12169
13124
  updatedAt: IsoDateTimeSchema,
12170
- error: z15.object({
13125
+ error: z16.object({
12171
13126
  code: ContractIdentifierSchema,
12172
- message: z15.string().trim().min(1),
12173
- retryable: z15.boolean()
13127
+ message: z16.string().trim().min(1),
13128
+ retryable: z16.boolean()
12174
13129
  }).strict().optional()
12175
13130
  }).strict().superRefine((writeback, context) => {
12176
13131
  if (writeback.status === "FAILED" && !writeback.error) {
@@ -12188,12 +13143,12 @@ var TrendRadarCollectionProjectionWritebackSchema = z15.object({
12188
13143
  });
12189
13144
  }
12190
13145
  });
12191
- var TrendRadarCollectionItemSchema = z15.object({
12192
- contract: z15.literal("TrendRadarCollectionItem"),
12193
- schemaVersion: z15.literal(1),
13146
+ var TrendRadarCollectionItemSchema = z16.object({
13147
+ contract: z16.literal("TrendRadarCollectionItem"),
13148
+ schemaVersion: z16.literal(1),
12194
13149
  selectionRef: TrendRadarCollectionSelectionRefSchema,
12195
13150
  recipe: TrendRadarCollectionRecipeSchema,
12196
- status: z15.enum(["SAVED", "QUEUED", "RUNNING", "SUCCEEDED", "FAILED", "CANCELLED", "PARTIAL"]),
13151
+ status: z16.enum(["SAVED", "QUEUED", "RUNNING", "SUCCEEDED", "FAILED", "CANCELLED", "PARTIAL"]),
12197
13152
  latestRunRef: TrendRadarCollectionRunRefSchema.optional(),
12198
13153
  decisionProjection: TrendRadarCollectionDecisionProjectionSchema.optional(),
12199
13154
  artifactProjection: TrendRadarCollectionArtifactProjectionSchema.optional(),
@@ -12201,8 +13156,8 @@ var TrendRadarCollectionItemSchema = z15.object({
12201
13156
  updatedAt: IsoDateTimeSchema,
12202
13157
  generatedAt: IsoDateTimeSchema.optional()
12203
13158
  }).strict();
12204
- var RadarAnalysisRunSchema = z15.object({
12205
- contract: z15.literal("RadarAnalysisRun"),
13159
+ var RadarAnalysisRunSchema = z16.object({
13160
+ contract: z16.literal("RadarAnalysisRun"),
12206
13161
  runId: ContractIdentifierSchema,
12207
13162
  teamId: ContractIdentifierSchema,
12208
13163
  selectionRef: EntityRefSchema,
@@ -12213,66 +13168,66 @@ var RadarAnalysisRunSchema = z15.object({
12213
13168
  collectionAssetRef: TrendRadarCollectionAssetRefSchema.optional(),
12214
13169
  collectionProjectionWriteback: TrendRadarCollectionProjectionWritebackSchema.optional(),
12215
13170
  workflowDefinitionTeamId: ContractIdentifierSchema.optional(),
12216
- workflowInput: z15.record(z15.string(), JsonValueSchema).default({}),
12217
- createDesignProject: z15.boolean().default(true),
12218
- designProjectName: z15.string().trim().min(1).max(200).optional(),
13171
+ workflowInput: z16.record(z16.string(), JsonValueSchema).default({}),
13172
+ createDesignProject: z16.boolean().default(true),
13173
+ designProjectName: z16.string().trim().min(1).max(200).optional(),
12219
13174
  modelRef: EntityRefSchema,
12220
13175
  requestId: ContractIdentifierSchema,
12221
13176
  idempotencyKey: ContractIdentifierSchema,
12222
- status: z15.enum(["QUEUED", "RUNNING", "SUCCEEDED", "FAILED", "CANCELLED", "PARTIAL"]),
12223
- outputRefs: z15.array(EntityRefSchema).default([]),
12224
- error: z15.object({
13177
+ status: z16.enum(["QUEUED", "RUNNING", "SUCCEEDED", "FAILED", "CANCELLED", "PARTIAL"]),
13178
+ outputRefs: z16.array(EntityRefSchema).default([]),
13179
+ error: z16.object({
12225
13180
  code: ContractIdentifierSchema,
12226
- message: z15.string().trim().min(1),
12227
- retryable: z15.boolean()
13181
+ message: z16.string().trim().min(1),
13182
+ retryable: z16.boolean()
12228
13183
  }).strict().optional(),
12229
13184
  startedAt: IsoDateTimeSchema.optional(),
12230
13185
  completedAt: IsoDateTimeSchema.optional(),
12231
13186
  createdAt: IsoDateTimeSchema
12232
13187
  }).strict();
12233
- var RadarAnalysisAssetSchema = z15.object({
13188
+ var RadarAnalysisAssetSchema = z16.object({
12234
13189
  artifactRef: EntityRefSchema,
12235
13190
  kind: ContractIdentifierSchema,
12236
- mimeType: z15.string().trim().min(1).optional(),
12237
- url: z15.string().url(),
12238
- metadata: z15.record(z15.string(), JsonValueSchema).default({}),
13191
+ mimeType: z16.string().trim().min(1).optional(),
13192
+ url: z16.string().url(),
13193
+ metadata: z16.record(z16.string(), JsonValueSchema).default({}),
12239
13194
  createdAt: IsoDateTimeSchema
12240
13195
  }).strict();
12241
- var RadarAnalysisDetailSchema = z15.object({
12242
- contract: z15.literal("RadarAnalysisDetail"),
13196
+ var RadarAnalysisDetailSchema = z16.object({
13197
+ contract: z16.literal("RadarAnalysisDetail"),
12243
13198
  run: RadarAnalysisRunSchema,
12244
- runVersion: z15.number().int().positive(),
13199
+ runVersion: z16.number().int().positive(),
12245
13200
  selection: RadarSelectionSchema,
12246
- outputs: z15.array(OutputRecordSchema),
12247
- assets: z15.array(RadarAnalysisAssetSchema),
12248
- lineage: z15.array(LineageRecordSchema)
13201
+ outputs: z16.array(OutputRecordSchema),
13202
+ assets: z16.array(RadarAnalysisAssetSchema),
13203
+ lineage: z16.array(LineageRecordSchema)
12249
13204
  }).strict();
12250
- var RadarActionRecordSchema = z15.object({
12251
- contract: z15.literal("RadarActionRecord"),
13205
+ var RadarActionRecordSchema = z16.object({
13206
+ contract: z16.literal("RadarActionRecord"),
12252
13207
  actionId: ContractIdentifierSchema,
12253
13208
  teamId: ContractIdentifierSchema,
12254
13209
  actorRef: EntityRefSchema,
12255
- action: z15.enum(["stash", "select", "reject", "archive", "launch", "retry", "replay", "rollback"]),
13210
+ action: z16.enum(["stash", "select", "reject", "archive", "launch", "retry", "replay", "rollback"]),
12256
13211
  targetRef: EntityRefSchema,
12257
13212
  requestId: ContractIdentifierSchema,
12258
13213
  idempotencyKey: ContractIdentifierSchema,
12259
- expectedVersion: z15.number().int().nonnegative(),
13214
+ expectedVersion: z16.number().int().nonnegative(),
12260
13215
  occurredAt: IsoDateTimeSchema
12261
13216
  }).strict();
12262
- var RadarWritebackRecordSchema = z15.object({
12263
- contract: z15.literal("RadarWritebackRecord"),
13217
+ var RadarWritebackRecordSchema = z16.object({
13218
+ contract: z16.literal("RadarWritebackRecord"),
12264
13219
  writebackId: ContractIdentifierSchema,
12265
13220
  actionRef: EntityRefSchema,
12266
13221
  targetRef: EntityRefSchema,
12267
- status: z15.enum(["PENDING", "APPLIED", "FAILED"]),
12268
- resultingVersion: z15.number().int().nonnegative().optional(),
12269
- error: z15.string().trim().min(1).optional(),
13222
+ status: z16.enum(["PENDING", "APPLIED", "FAILED"]),
13223
+ resultingVersion: z16.number().int().nonnegative().optional(),
13224
+ error: z16.string().trim().min(1).optional(),
12270
13225
  recordedAt: IsoDateTimeSchema
12271
13226
  }).strict();
12272
13227
 
12273
13228
  // src/contracts/workflow-definition.ts
12274
- import { z as z16 } from "zod";
12275
- var ConductorTaskTypeSchema = z16.enum([
13229
+ import { z as z17 } from "zod";
13230
+ var ConductorTaskTypeSchema = z17.enum([
12276
13231
  "SIMPLE",
12277
13232
  "DYNAMIC",
12278
13233
  "FORK_JOIN",
@@ -12321,46 +13276,46 @@ var requiredTaskFields = {
12321
13276
  WAIT: ["inputParameters"],
12322
13277
  TERMINATE: ["inputParameters"]
12323
13278
  };
12324
- var ConductorTaskDefinitionSchema = z16.lazy(
12325
- () => z16.object({
13279
+ var ConductorTaskDefinitionSchema = z17.lazy(
13280
+ () => z17.object({
12326
13281
  name: ContractIdentifierSchema,
12327
13282
  taskReferenceName: ContractIdentifierSchema,
12328
13283
  type: ConductorTaskTypeSchema,
12329
- inputParameters: z16.record(z16.string(), JsonValueSchema).optional(),
12330
- startDelay: z16.number().int().nonnegative().optional(),
12331
- optional: z16.boolean().optional(),
12332
- asyncComplete: z16.boolean().optional(),
12333
- rateLimited: z16.boolean().optional(),
12334
- retryCount: z16.number().int().nonnegative().optional(),
12335
- taskDefinition: z16.record(z16.string(), JsonValueSchema).optional(),
12336
- loopCondition: z16.string().optional(),
12337
- loopOver: z16.array(ConductorTaskDefinitionSchema).optional(),
12338
- sink: z16.string().optional(),
12339
- forkTasks: z16.array(z16.array(ConductorTaskDefinitionSchema)).optional(),
12340
- joinOn: z16.array(ContractIdentifierSchema).optional(),
12341
- defaultExclusiveJoinTask: z16.array(ContractIdentifierSchema).optional(),
12342
- dynamicForkTasksParam: z16.string().optional(),
12343
- dynamicForkTasksInputParamName: z16.string().optional(),
12344
- subWorkflowParam: z16.object({
12345
- $ref: z16.string().optional(),
13284
+ inputParameters: z17.record(z17.string(), JsonValueSchema).optional(),
13285
+ startDelay: z17.number().int().nonnegative().optional(),
13286
+ optional: z17.boolean().optional(),
13287
+ asyncComplete: z17.boolean().optional(),
13288
+ rateLimited: z17.boolean().optional(),
13289
+ retryCount: z17.number().int().nonnegative().optional(),
13290
+ taskDefinition: z17.record(z17.string(), JsonValueSchema).optional(),
13291
+ loopCondition: z17.string().optional(),
13292
+ loopOver: z17.array(ConductorTaskDefinitionSchema).optional(),
13293
+ sink: z17.string().optional(),
13294
+ forkTasks: z17.array(z17.array(ConductorTaskDefinitionSchema)).optional(),
13295
+ joinOn: z17.array(ContractIdentifierSchema).optional(),
13296
+ defaultExclusiveJoinTask: z17.array(ContractIdentifierSchema).optional(),
13297
+ dynamicForkTasksParam: z17.string().optional(),
13298
+ dynamicForkTasksInputParamName: z17.string().optional(),
13299
+ subWorkflowParam: z17.object({
13300
+ $ref: z17.string().optional(),
12346
13301
  name: ContractIdentifierSchema,
12347
- version: z16.number().int().positive().optional(),
12348
- taskToDomain: z16.record(z16.string(), z16.string()).optional(),
12349
- workflowDefinition: z16.record(z16.string(), JsonValueSchema).optional()
13302
+ version: z17.number().int().positive().optional(),
13303
+ taskToDomain: z17.record(z17.string(), z17.string()).optional(),
13304
+ workflowDefinition: z17.record(z17.string(), JsonValueSchema).optional()
12350
13305
  }).strict().optional(),
12351
- decisionCases: z16.record(z16.string(), z16.array(ConductorTaskDefinitionSchema)).optional(),
12352
- defaultCase: z16.array(ConductorTaskDefinitionSchema).optional(),
12353
- evaluatorType: z16.enum(["value-param", "javascript", "graaljs"]).optional(),
12354
- expression: z16.string().optional(),
13306
+ decisionCases: z17.record(z17.string(), z17.array(ConductorTaskDefinitionSchema)).optional(),
13307
+ defaultCase: z17.array(ConductorTaskDefinitionSchema).optional(),
13308
+ evaluatorType: z17.enum(["value-param", "javascript", "graaljs"]).optional(),
13309
+ expression: z17.string().optional(),
12355
13310
  __alias: JsonValueSchema.optional(),
12356
- callbackFromWorker: z16.boolean().optional(),
13311
+ callbackFromWorker: z17.boolean().optional(),
12357
13312
  caseExpression: JsonValueSchema.optional(),
12358
- caseValueParam: z16.string().optional(),
12359
- dependencies: z16.array(JsonValueSchema).optional(),
12360
- description: z16.string().optional(),
12361
- dynamicTaskNameParam: z16.string().optional(),
12362
- joinMode: z16.string().optional(),
12363
- permissive: z16.boolean().optional(),
13313
+ caseValueParam: z17.string().optional(),
13314
+ dependencies: z17.array(JsonValueSchema).optional(),
13315
+ description: z17.string().optional(),
13316
+ dynamicTaskNameParam: z17.string().optional(),
13317
+ joinMode: z17.string().optional(),
13318
+ permissive: z17.boolean().optional(),
12364
13319
  joinTaskRef: ContractIdentifierSchema.optional(),
12365
13320
  forkTaskRef: ContractIdentifierSchema.optional()
12366
13321
  }).strict().superRefine((task, context) => {
@@ -12374,29 +13329,29 @@ var ConductorTaskDefinitionSchema = z16.lazy(
12374
13329
  }
12375
13330
  })
12376
13331
  );
12377
- var ConductorWorkflowDefinitionSchema = z16.object({
12378
- ownerApp: z16.string().optional(),
12379
- createTime: z16.number().int().nonnegative().optional(),
12380
- updateTime: z16.number().int().nonnegative().optional(),
12381
- createdBy: z16.string().optional(),
12382
- updatedBy: z16.string().optional(),
13332
+ var ConductorWorkflowDefinitionSchema = z17.object({
13333
+ ownerApp: z17.string().optional(),
13334
+ createTime: z17.number().int().nonnegative().optional(),
13335
+ updateTime: z17.number().int().nonnegative().optional(),
13336
+ createdBy: z17.string().optional(),
13337
+ updatedBy: z17.string().optional(),
12383
13338
  name: ContractIdentifierSchema,
12384
- description: z16.string().optional(),
12385
- version: z16.number().int().positive(),
12386
- tasks: z16.array(ConductorTaskDefinitionSchema),
12387
- inputParameters: z16.array(ContractIdentifierSchema),
12388
- outputParameters: z16.record(z16.string(), JsonValueSchema).optional(),
13339
+ description: z17.string().optional(),
13340
+ version: z17.number().int().positive(),
13341
+ tasks: z17.array(ConductorTaskDefinitionSchema),
13342
+ inputParameters: z17.array(ContractIdentifierSchema),
13343
+ outputParameters: z17.record(z17.string(), JsonValueSchema).optional(),
12389
13344
  failureWorkflow: ContractIdentifierSchema.optional(),
12390
- schemaVersion: z16.number().int().positive().optional(),
12391
- restartable: z16.boolean().optional(),
12392
- workflowStatusListenerEnabled: z16.boolean().optional(),
12393
- ownerEmail: z16.string().email().optional(),
12394
- timeoutPolicy: z16.enum(["TIME_OUT_WF", "ALERT_ONLY"]).optional(),
12395
- timeoutSeconds: z16.number().int().nonnegative(),
12396
- variables: z16.record(z16.string(), JsonValueSchema).optional(),
12397
- inputTemplate: z16.record(z16.string(), JsonValueSchema).optional()
12398
- }).strict();
12399
- var WorkflowParameterTypeSchema = z16.enum([
13345
+ schemaVersion: z17.number().int().positive().optional(),
13346
+ restartable: z17.boolean().optional(),
13347
+ workflowStatusListenerEnabled: z17.boolean().optional(),
13348
+ ownerEmail: z17.string().email().optional(),
13349
+ timeoutPolicy: z17.enum(["TIME_OUT_WF", "ALERT_ONLY"]).optional(),
13350
+ timeoutSeconds: z17.number().int().nonnegative(),
13351
+ variables: z17.record(z17.string(), JsonValueSchema).optional(),
13352
+ inputTemplate: z17.record(z17.string(), JsonValueSchema).optional()
13353
+ }).strict();
13354
+ var WorkflowParameterTypeSchema = z17.enum([
12400
13355
  "string",
12401
13356
  "file",
12402
13357
  "number",
@@ -12406,213 +13361,213 @@ var WorkflowParameterTypeSchema = z16.enum([
12406
13361
  "notice",
12407
13362
  "canvas-assist"
12408
13363
  ]);
12409
- var WorkflowConditionalStateSchema = z16.object({
12410
- conditions: z16.array(
12411
- z16.object({
12412
- field: z16.string(),
12413
- operator: z16.enum(["is", "isNot", "isGreaterThan", "isLessThan", "isGreaterThanOrEqual", "isLessThanOrEqual", "in", "notIn"]),
13364
+ var WorkflowConditionalStateSchema = z17.object({
13365
+ conditions: z17.array(
13366
+ z17.object({
13367
+ field: z17.string(),
13368
+ operator: z17.enum(["is", "isNot", "isGreaterThan", "isLessThan", "isGreaterThanOrEqual", "isLessThanOrEqual", "in", "notIn"]),
12414
13369
  value: JsonValueSchema
12415
13370
  }).strict()
12416
13371
  ),
12417
- logic: z16.enum(["AND", "OR"]).optional()
12418
- }).strict();
12419
- var ImageSelectMappingAppearanceSchema = z16.object({
12420
- columns: z16.number().int().min(1).max(4).optional(),
12421
- cardSize: z16.enum(["sm", "md", "lg"]).optional(),
12422
- imageAspectRatio: z16.enum(["square", "4:5", "3:4", "16:9"]).optional(),
12423
- gap: z16.enum(["sm", "md", "lg"]).optional(),
12424
- radius: z16.enum(["sm", "md", "lg", "xl"]).optional(),
12425
- borderStyle: z16.enum(["none", "soft", "strong"]).optional(),
12426
- borderWidth: z16.union([z16.literal(0), z16.literal(1), z16.literal(2)]).optional(),
12427
- enableScroll: z16.boolean().optional(),
12428
- maxHeight: z16.number().int().min(160).max(1200).optional(),
12429
- enableCollapse: z16.boolean().optional(),
12430
- visibleRows: z16.number().int().min(1).max(6).optional(),
12431
- hideLabel: z16.boolean().optional(),
12432
- hideDescription: z16.boolean().optional(),
12433
- hideValue: z16.boolean().optional()
12434
- }).strict();
12435
- var ComfyWorkflowPortBindingSchema = z16.object({
12436
- node: z16.union([z16.string(), z16.number()]),
12437
- key: z16.string().optional()
12438
- }).strict();
12439
- var WorkflowParameterTypeOptionsSchema = z16.object({
12440
- editor: z16.enum(["code", "codeNodeEditor", "htmlEditor", "sqlEditor", "json"]).optional(),
12441
- editorLanguage: z16.enum(["javaScript", "json", "python", "sql"]).optional(),
12442
- maxValue: z16.number().optional(),
12443
- minValue: z16.number().optional(),
12444
- max: z16.number().optional(),
12445
- min: z16.number().optional(),
12446
- multipleValues: z16.boolean().optional(),
12447
- numberPrecision: z16.number().nonnegative().optional(),
12448
- password: z16.boolean().optional(),
12449
- rows: z16.number().int().positive().optional(),
12450
- assetType: z16.string().optional(),
12451
- accept: z16.string().optional(),
12452
- maxSize: z16.number().positive().optional(),
12453
- fileType: z16.string().optional(),
12454
- aiMultiShotMainImageField: z16.string().optional(),
12455
- aiMultiShotWorkflowAppId: z16.string().optional(),
12456
- aiMultiShotWorkflowId: z16.string().optional(),
12457
- allowCustomInput: z16.boolean().optional(),
12458
- allowUploadVideo: z16.boolean().optional(),
12459
- aspectRatioField: z16.string().optional(),
12460
- assemblyValueType: z16.string().optional(),
12461
- autoAnalyzeDesignImage: z16.boolean().optional(),
12462
- autoDetectAspectRatio: z16.boolean().optional(),
12463
- autoIncrementId: z16.boolean().optional(),
13372
+ logic: z17.enum(["AND", "OR"]).optional()
13373
+ }).strict();
13374
+ var ImageSelectMappingAppearanceSchema = z17.object({
13375
+ columns: z17.number().int().min(1).max(4).optional(),
13376
+ cardSize: z17.enum(["sm", "md", "lg"]).optional(),
13377
+ imageAspectRatio: z17.enum(["square", "4:5", "3:4", "16:9"]).optional(),
13378
+ gap: z17.enum(["sm", "md", "lg"]).optional(),
13379
+ radius: z17.enum(["sm", "md", "lg", "xl"]).optional(),
13380
+ borderStyle: z17.enum(["none", "soft", "strong"]).optional(),
13381
+ borderWidth: z17.union([z17.literal(0), z17.literal(1), z17.literal(2)]).optional(),
13382
+ enableScroll: z17.boolean().optional(),
13383
+ maxHeight: z17.number().int().min(160).max(1200).optional(),
13384
+ enableCollapse: z17.boolean().optional(),
13385
+ visibleRows: z17.number().int().min(1).max(6).optional(),
13386
+ hideLabel: z17.boolean().optional(),
13387
+ hideDescription: z17.boolean().optional(),
13388
+ hideValue: z17.boolean().optional()
13389
+ }).strict();
13390
+ var ComfyWorkflowPortBindingSchema = z17.object({
13391
+ node: z17.union([z17.string(), z17.number()]),
13392
+ key: z17.string().optional()
13393
+ }).strict();
13394
+ var WorkflowParameterTypeOptionsSchema = z17.object({
13395
+ editor: z17.enum(["code", "codeNodeEditor", "htmlEditor", "sqlEditor", "json"]).optional(),
13396
+ editorLanguage: z17.enum(["javaScript", "json", "python", "sql"]).optional(),
13397
+ maxValue: z17.number().optional(),
13398
+ minValue: z17.number().optional(),
13399
+ max: z17.number().optional(),
13400
+ min: z17.number().optional(),
13401
+ multipleValues: z17.boolean().optional(),
13402
+ numberPrecision: z17.number().nonnegative().optional(),
13403
+ password: z17.boolean().optional(),
13404
+ rows: z17.number().int().positive().optional(),
13405
+ assetType: z17.string().optional(),
13406
+ accept: z17.string().optional(),
13407
+ maxSize: z17.number().positive().optional(),
13408
+ fileType: z17.string().optional(),
13409
+ aiMultiShotMainImageField: z17.string().optional(),
13410
+ aiMultiShotWorkflowAppId: z17.string().optional(),
13411
+ aiMultiShotWorkflowId: z17.string().optional(),
13412
+ allowCustomInput: z17.boolean().optional(),
13413
+ allowUploadVideo: z17.boolean().optional(),
13414
+ aspectRatioField: z17.string().optional(),
13415
+ assemblyValueType: z17.string().optional(),
13416
+ autoAnalyzeDesignImage: z17.boolean().optional(),
13417
+ autoDetectAspectRatio: z17.boolean().optional(),
13418
+ autoIncrementId: z17.boolean().optional(),
12464
13419
  comfyOptions: ComfyWorkflowPortBindingSchema.optional(),
12465
- comfyuiModelServerId: z16.string().optional(),
12466
- comfyuiModelTypeName: z16.string().optional(),
13420
+ comfyuiModelServerId: z17.string().optional(),
13421
+ comfyuiModelTypeName: z17.string().optional(),
12467
13422
  defaultCustomInput: JsonValueSchema.optional(),
12468
- descriptionAlert: z16.boolean().optional(),
12469
- disabled: z16.union([z16.boolean(), WorkflowConditionalStateSchema]).optional(),
12470
- editable: z16.union([z16.boolean(), WorkflowConditionalStateSchema]).optional(),
12471
- enableAiMultiShot: z16.boolean().optional(),
12472
- enableBooleanSwitchMode: z16.boolean().optional(),
12473
- enableClear: z16.boolean().optional(),
12474
- enableExpand: z16.boolean().optional(),
12475
- enableImageMask: z16.boolean().optional(),
12476
- enableImageOverlay: z16.boolean().optional(),
12477
- enablePopupEditor: z16.boolean().optional(),
12478
- enablePromptFontSize: z16.boolean().optional(),
12479
- enableReset: z16.boolean().optional(),
12480
- enableSelectItemIcon: z16.boolean().optional(),
12481
- enableSelectList: z16.boolean().optional(),
12482
- enableSelectSearch: z16.boolean().optional(),
12483
- enableSliderEnterMode: z16.boolean().optional(),
12484
- enableVoice: z16.boolean().optional(),
12485
- expandButtonText: z16.string().optional(),
12486
- foldUp: z16.boolean().optional(),
12487
- hidden: z16.boolean().optional(),
12488
- hideRequiredDot: z16.boolean().optional(),
12489
- inlineTitleWithSelect: z16.boolean().optional(),
12490
- knowledgeGraphButtonText: z16.string().optional(),
12491
- identifyAttributeCount: z16.union([z16.number().nonnegative(), z16.string().min(1), z16.object({ min: z16.number().nonnegative().optional(), max: z16.number().nonnegative().optional() }).strict()]).optional(),
12492
- identifyAttributes: z16.array(JsonValueSchema).optional(),
12493
- identifyMaxVariants: z16.number().int().nonnegative().optional(),
12494
- identifySourceField: z16.string().optional(),
12495
- imageOverlayBaseField: z16.string().optional(),
12496
- imageOverlayOverlayField: z16.string().optional(),
13423
+ descriptionAlert: z17.boolean().optional(),
13424
+ disabled: z17.union([z17.boolean(), WorkflowConditionalStateSchema]).optional(),
13425
+ editable: z17.union([z17.boolean(), WorkflowConditionalStateSchema]).optional(),
13426
+ enableAiMultiShot: z17.boolean().optional(),
13427
+ enableBooleanSwitchMode: z17.boolean().optional(),
13428
+ enableClear: z17.boolean().optional(),
13429
+ enableExpand: z17.boolean().optional(),
13430
+ enableImageMask: z17.boolean().optional(),
13431
+ enableImageOverlay: z17.boolean().optional(),
13432
+ enablePopupEditor: z17.boolean().optional(),
13433
+ enablePromptFontSize: z17.boolean().optional(),
13434
+ enableReset: z17.boolean().optional(),
13435
+ enableSelectItemIcon: z17.boolean().optional(),
13436
+ enableSelectList: z17.boolean().optional(),
13437
+ enableSelectSearch: z17.boolean().optional(),
13438
+ enableSliderEnterMode: z17.boolean().optional(),
13439
+ enableVoice: z17.boolean().optional(),
13440
+ expandButtonText: z17.string().optional(),
13441
+ foldUp: z17.boolean().optional(),
13442
+ hidden: z17.boolean().optional(),
13443
+ hideRequiredDot: z17.boolean().optional(),
13444
+ inlineTitleWithSelect: z17.boolean().optional(),
13445
+ knowledgeGraphButtonText: z17.string().optional(),
13446
+ identifyAttributeCount: z17.union([z17.number().nonnegative(), z17.string().min(1), z17.object({ min: z17.number().nonnegative().optional(), max: z17.number().nonnegative().optional() }).strict()]).optional(),
13447
+ identifyAttributes: z17.array(JsonValueSchema).optional(),
13448
+ identifyMaxVariants: z17.number().int().nonnegative().optional(),
13449
+ identifySourceField: z17.string().optional(),
13450
+ imageOverlayBaseField: z17.string().optional(),
13451
+ imageOverlayOverlayField: z17.string().optional(),
12497
13452
  imageSelectMappingAppearance: ImageSelectMappingAppearanceSchema.optional(),
12498
- imageSelectMappingColumns: z16.number().int().min(1).max(4).optional(),
12499
- imageSelectMappingEnableCustomUpload: z16.boolean().optional(),
12500
- imageSelectMappingHideLabel: z16.boolean().optional(),
12501
- imageSelectMappingHideLink: z16.boolean().optional(),
12502
- imageSelectMappingHideMeta: z16.boolean().optional(),
12503
- imageSelectMappingInlineUseLargeUploadBox: z16.boolean().optional(),
12504
- imageSelectMappingPromptField: z16.string().optional(),
12505
- imageSelectMappingTabOrder: z16.enum(["template-first", "upload-first"]).optional(),
12506
- imageSelectMappingTabWidthMode: z16.enum(["content", "fill"]).optional(),
13453
+ imageSelectMappingColumns: z17.number().int().min(1).max(4).optional(),
13454
+ imageSelectMappingEnableCustomUpload: z17.boolean().optional(),
13455
+ imageSelectMappingHideLabel: z17.boolean().optional(),
13456
+ imageSelectMappingHideLink: z17.boolean().optional(),
13457
+ imageSelectMappingHideMeta: z17.boolean().optional(),
13458
+ imageSelectMappingInlineUseLargeUploadBox: z17.boolean().optional(),
13459
+ imageSelectMappingPromptField: z17.string().optional(),
13460
+ imageSelectMappingTabOrder: z17.enum(["template-first", "upload-first"]).optional(),
13461
+ imageSelectMappingTabWidthMode: z17.enum(["content", "fill"]).optional(),
12507
13462
  imageSelectMappingTemplatePrompt: LocalizedTextSchema.optional(),
12508
13463
  imageSelectMappingTemplateTabTitle: LocalizedTextSchema.optional(),
12509
- imageSelectMappingUploadMode: z16.enum(["tabs", "inline"]).optional(),
13464
+ imageSelectMappingUploadMode: z17.enum(["tabs", "inline"]).optional(),
12510
13465
  imageSelectMappingUploadPrompt: LocalizedTextSchema.optional(),
12511
13466
  imageSelectMappingUploadTabTitle: LocalizedTextSchema.optional(),
12512
- endpoints: z16.array(JsonValueSchema).optional(),
12513
- examples: z16.array(JsonValueSchema).optional(),
13467
+ endpoints: z17.array(JsonValueSchema).optional(),
13468
+ examples: z17.array(JsonValueSchema).optional(),
12514
13469
  extraData: JsonValueSchema.optional(),
12515
13470
  layer: JsonValueSchema.optional(),
12516
13471
  map: JsonValueSchema.optional(),
12517
- multiline: z16.boolean().optional(),
12518
- options: z16.array(JsonValueSchema).optional(),
12519
- originalFiles: z16.array(JsonValueSchema).optional(),
13472
+ multiline: z17.boolean().optional(),
13473
+ options: z17.array(JsonValueSchema).optional(),
13474
+ originalFiles: z17.array(JsonValueSchema).optional(),
12520
13475
  placeholder: LocalizedTextSchema.optional(),
12521
- preserveSelectListOrder: z16.boolean().optional(),
13476
+ preserveSelectListOrder: z17.boolean().optional(),
12522
13477
  promptDictionary: JsonValueSchema.optional(),
12523
- promptFontSize: z16.number().optional(),
13478
+ promptFontSize: z17.number().optional(),
12524
13479
  promptModeToggle: JsonValueSchema.optional(),
12525
- requireActiveSelectFilter: z16.boolean().optional(),
12526
- restoreDefaultOnEmptyEnter: z16.boolean().optional(),
12527
- search: z16.boolean().optional(),
12528
- selectButtonEnableCollapse: z16.boolean().optional(),
12529
- selectButtonVisibleRows: z16.number().int().positive().optional(),
12530
- selectList: z16.array(JsonValueSchema).optional(),
12531
- selectListDisplayMode: z16.string().optional(),
12532
- selectPromptField: z16.string().optional(),
12533
- showAddLocalFileButton: z16.boolean().optional(),
12534
- singleColumn: z16.boolean().optional(),
12535
- singleFrameForMultiple: z16.boolean().optional(),
12536
- textSingleLine: z16.boolean().optional(),
12537
- textareaMiniHeight: z16.number().nonnegative().optional(),
13480
+ requireActiveSelectFilter: z17.boolean().optional(),
13481
+ restoreDefaultOnEmptyEnter: z17.boolean().optional(),
13482
+ search: z17.boolean().optional(),
13483
+ selectButtonEnableCollapse: z17.boolean().optional(),
13484
+ selectButtonVisibleRows: z17.number().int().positive().optional(),
13485
+ selectList: z17.array(JsonValueSchema).optional(),
13486
+ selectListDisplayMode: z17.string().optional(),
13487
+ selectPromptField: z17.string().optional(),
13488
+ showAddLocalFileButton: z17.boolean().optional(),
13489
+ singleColumn: z17.boolean().optional(),
13490
+ singleFrameForMultiple: z17.boolean().optional(),
13491
+ textSingleLine: z17.boolean().optional(),
13492
+ textareaMiniHeight: z17.number().nonnegative().optional(),
12538
13493
  tips: LocalizedTextSchema.optional(),
12539
13494
  visibility: JsonValueSchema.optional(),
12540
- voiceButtonText: z16.string().optional(),
12541
- designAnalysisFields: z16.array(JsonValueSchema).optional(),
12542
- designAnalysisFillStrategy: z16.string().optional(),
12543
- designAnalysisMaxFields: z16.number().int().nonnegative().optional(),
12544
- designAnalysisType: z16.string().optional(),
12545
- designAnalysisFieldPrefix: z16.string().optional()
12546
- }).strict();
12547
- var WorkflowParameterSchema = z16.lazy(
12548
- () => z16.object({
13495
+ voiceButtonText: z17.string().optional(),
13496
+ designAnalysisFields: z17.array(JsonValueSchema).optional(),
13497
+ designAnalysisFillStrategy: z17.string().optional(),
13498
+ designAnalysisMaxFields: z17.number().int().nonnegative().optional(),
13499
+ designAnalysisType: z17.string().optional(),
13500
+ designAnalysisFieldPrefix: z17.string().optional()
13501
+ }).strict();
13502
+ var WorkflowParameterSchema = z17.lazy(
13503
+ () => z17.object({
12549
13504
  displayName: LocalizedTextSchema,
12550
13505
  name: ContractIdentifierSchema,
12551
13506
  type: WorkflowParameterTypeSchema,
12552
13507
  typeOptions: WorkflowParameterTypeOptionsSchema.optional(),
12553
13508
  default: JsonValueSchema.optional(),
12554
13509
  description: LocalizedTextSchema.optional(),
12555
- hint: z16.string().optional(),
12556
- displayOptions: z16.object({
12557
- hide: z16.record(z16.string(), z16.array(JsonValueSchema)).optional(),
12558
- show: z16.record(z16.string(), z16.array(JsonValueSchema)).optional()
13510
+ hint: z17.string().optional(),
13511
+ displayOptions: z17.object({
13512
+ hide: z17.record(z17.string(), z17.array(JsonValueSchema)).optional(),
13513
+ show: z17.record(z17.string(), z17.array(JsonValueSchema)).optional()
12559
13514
  }).strict().optional(),
12560
- options: z16.array(z16.union([
12561
- z16.object({ name: LocalizedTextSchema, value: z16.union([z16.string(), z16.number(), z16.boolean()]), action: z16.string().optional(), description: LocalizedTextSchema.optional() }).strict(),
13515
+ options: z17.array(z17.union([
13516
+ z17.object({ name: LocalizedTextSchema, value: z17.union([z17.string(), z17.number(), z17.boolean()]), action: z17.string().optional(), description: LocalizedTextSchema.optional() }).strict(),
12562
13517
  WorkflowParameterSchema,
12563
- z16.object({ displayName: z16.string(), name: ContractIdentifierSchema, values: z16.array(WorkflowParameterSchema) }).strict()
13518
+ z17.object({ displayName: z17.string(), name: ContractIdentifierSchema, values: z17.array(WorkflowParameterSchema) }).strict()
12564
13519
  ])).optional(),
12565
13520
  placeholder: LocalizedTextSchema.optional(),
12566
- isNodeSetting: z16.boolean().optional(),
12567
- noDataExpression: z16.boolean().optional(),
12568
- required: z16.boolean().optional(),
12569
- example: z16.string().optional(),
12570
- extractValue: z16.object({ type: z16.literal("regex"), regex: z16.string() }).strict().optional(),
12571
- properties: z16.array(WorkflowParameterSchema).optional(),
12572
- assetType: z16.string().optional(),
12573
- flag: z16.boolean().optional(),
12574
- enableExpand: z16.boolean().optional(),
12575
- enableVoice: z16.boolean().optional(),
12576
- expandButtonText: z16.string().optional(),
12577
- knowledgeGraphButtonText: z16.string().optional(),
12578
- selectListDisplayMode: z16.string().optional(),
12579
- voiceButtonText: z16.string().optional()
13521
+ isNodeSetting: z17.boolean().optional(),
13522
+ noDataExpression: z17.boolean().optional(),
13523
+ required: z17.boolean().optional(),
13524
+ example: z17.string().optional(),
13525
+ extractValue: z17.object({ type: z17.literal("regex"), regex: z17.string() }).strict().optional(),
13526
+ properties: z17.array(WorkflowParameterSchema).optional(),
13527
+ assetType: z17.string().optional(),
13528
+ flag: z17.boolean().optional(),
13529
+ enableExpand: z17.boolean().optional(),
13530
+ enableVoice: z17.boolean().optional(),
13531
+ expandButtonText: z17.string().optional(),
13532
+ knowledgeGraphButtonText: z17.string().optional(),
13533
+ selectListDisplayMode: z17.string().optional(),
13534
+ voiceButtonText: z17.string().optional()
12580
13535
  }).strict()
12581
13536
  );
12582
- var WorkflowOutputBindingSchema = z16.object({ key: ContractIdentifierSchema, value: z16.string() }).strict();
12583
- var WorkflowNodeSchema = z16.object({
13537
+ var WorkflowOutputBindingSchema = z17.object({ key: ContractIdentifierSchema, value: z17.string() }).strict();
13538
+ var WorkflowNodeSchema = z17.object({
12584
13539
  id: ContractIdentifierSchema,
12585
13540
  referenceName: ContractIdentifierSchema,
12586
13541
  capabilityRef: ContractIdentifierSchema,
12587
13542
  capabilityVersion: ContractIdentifierSchema.optional(),
12588
- inputBindings: z16.record(z16.string(), JsonValueSchema).default({}),
12589
- configuration: z16.object({ executor: z16.literal("conductor"), task: ConductorTaskDefinitionSchema }).strict()
13543
+ inputBindings: z17.record(z17.string(), JsonValueSchema).default({}),
13544
+ configuration: z17.object({ executor: z17.literal("conductor"), task: ConductorTaskDefinitionSchema }).strict()
12590
13545
  }).strict().superRefine((node, context) => {
12591
13546
  if (node.configuration.task.taskReferenceName !== node.referenceName) context.addIssue({ code: "custom", path: ["configuration", "task", "taskReferenceName"], message: "Conductor task reference must match node referenceName." });
12592
13547
  if (node.configuration.task.name !== node.capabilityRef) context.addIssue({ code: "custom", path: ["configuration", "task", "name"], message: "Conductor task name must match node capabilityRef." });
12593
13548
  if (JSON.stringify(node.configuration.task.inputParameters ?? {}) !== JSON.stringify(node.inputBindings)) context.addIssue({ code: "custom", path: ["configuration", "task", "inputParameters"], message: "Conductor task inputs must match node inputBindings." });
12594
13549
  });
12595
- var WorkflowEdgeSchema = z16.object({
13550
+ var WorkflowEdgeSchema = z17.object({
12596
13551
  from: ContractIdentifierSchema,
12597
13552
  to: ContractIdentifierSchema,
12598
13553
  outputPort: ContractIdentifierSchema.optional(),
12599
13554
  inputPort: ContractIdentifierSchema.optional(),
12600
- condition: z16.string().optional()
13555
+ condition: z17.string().optional()
12601
13556
  }).strict();
12602
- var WorkflowTriggerSchema = z16.object({
13557
+ var WorkflowTriggerSchema = z17.object({
12603
13558
  id: ContractIdentifierSchema,
12604
- type: z16.enum(["manual", "schedule", "webhook", "event", "api"]),
12605
- enabled: z16.boolean(),
12606
- schedule: z16.object({ cron: z16.string().trim().min(1) }).strict().optional(),
12607
- webhook: z16.object({
12608
- path: z16.string().trim().min(1).optional(),
12609
- method: z16.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"]),
12610
- auth: z16.enum(["NONE", "BASIC", "CUSTOM_HEADER"]),
12611
- basicAuth: z16.object({ username: z16.string(), password: z16.string() }).strict().optional(),
12612
- headerAuth: z16.object({ name: z16.string().trim().min(1), value: z16.string() }).strict().optional(),
12613
- responseUntil: z16.enum(["WORKFLOW_STARTED", "WORKFLOW_COMPLETED_OR_FINISHED"])
13559
+ type: z17.enum(["manual", "schedule", "webhook", "event", "api"]),
13560
+ enabled: z17.boolean(),
13561
+ schedule: z17.object({ cron: z17.string().trim().min(1) }).strict().optional(),
13562
+ webhook: z17.object({
13563
+ path: z17.string().trim().min(1).optional(),
13564
+ method: z17.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"]),
13565
+ auth: z17.enum(["NONE", "BASIC", "CUSTOM_HEADER"]),
13566
+ basicAuth: z17.object({ username: z17.string(), password: z17.string() }).strict().optional(),
13567
+ headerAuth: z17.object({ name: z17.string().trim().min(1), value: z17.string() }).strict().optional(),
13568
+ responseUntil: z17.enum(["WORKFLOW_STARTED", "WORKFLOW_COMPLETED_OR_FINISHED"])
12614
13569
  }).strict().optional(),
12615
- event: z16.object({
13570
+ event: z17.object({
12616
13571
  eventType: ContractIdentifierSchema,
12617
13572
  configuration: JsonValueSchema.optional()
12618
13573
  }).strict().optional()
@@ -12621,63 +13576,63 @@ var WorkflowTriggerSchema = z16.object({
12621
13576
  if (trigger.type === "webhook" && !trigger.webhook) context.addIssue({ code: "custom", path: ["webhook"], message: "Webhook trigger requires webhook configuration." });
12622
13577
  if (trigger.type === "event" && !trigger.event) context.addIssue({ code: "custom", path: ["event"], message: "Event trigger requires event configuration." });
12623
13578
  });
12624
- var WorkflowValidationIssueSchema = z16.object({
13579
+ var WorkflowValidationIssueSchema = z17.object({
12625
13580
  taskReferenceName: ContractIdentifierSchema,
12626
- issueType: z16.enum(["ERROR", "WARNING"]),
12627
- detailReason: z16.object({ type: ContractIdentifierSchema, name: ContractIdentifierSchema, detailInformation: JsonValueSchema.optional() }).strict(),
12628
- humanMessage: z16.object({ en: z16.string(), zh: z16.string() }).strict()
13581
+ issueType: z17.enum(["ERROR", "WARNING"]),
13582
+ detailReason: z17.object({ type: ContractIdentifierSchema, name: ContractIdentifierSchema, detailInformation: JsonValueSchema.optional() }).strict(),
13583
+ humanMessage: z17.object({ en: z17.string(), zh: z17.string() }).strict()
12629
13584
  }).strict();
12630
- var WorkflowDefinitionSchema = z16.object({
12631
- contract: z16.literal("WorkflowDefinition"),
13585
+ var WorkflowDefinitionSchema = z17.object({
13586
+ contract: z17.literal("WorkflowDefinition"),
12632
13587
  metadata: ContractMetadataSchema.omit({ name: true, description: true, labels: true }).extend({
12633
13588
  name: LocalizedTextSchema,
12634
13589
  description: LocalizedTextSchema.optional(),
12635
- role: z16.enum(["workflow", "template"]),
13590
+ role: z17.enum(["workflow", "template"]),
12636
13591
  teamId: ContractIdentifierSchema,
12637
13592
  creatorRef: EntityRefSchema,
12638
- tags: z16.array(ContractIdentifierSchema).default([])
13593
+ tags: z17.array(ContractIdentifierSchema).default([])
12639
13594
  }).strict(),
12640
- revision: z16.object({
12641
- kind: z16.enum(["release", "backup"]),
12642
- recordVersion: z16.number().int().positive(),
12643
- sourceVersion: z16.number().int().positive().optional()
13595
+ revision: z17.object({
13596
+ kind: z17.enum(["release", "backup"]),
13597
+ recordVersion: z17.number().int().positive(),
13598
+ sourceVersion: z17.number().int().positive().optional()
12644
13599
  }).strict().superRefine((revision, context) => {
12645
13600
  if (revision.kind === "backup" && revision.sourceVersion === void 0) context.addIssue({ code: "custom", path: ["sourceVersion"], message: "Backup revisions require a sourceVersion." });
12646
13601
  }),
12647
- presentation: z16.object({ iconUrl: z16.string().optional(), thumbnail: z16.string().optional() }).strict(),
12648
- ports: z16.object({ inputs: z16.array(ContractPortSchema).default([]), outputs: z16.array(ContractPortSchema).default([]) }).strict(),
12649
- parameters: z16.object({ variables: z16.array(WorkflowParameterSchema).default([]), outputs: z16.array(WorkflowOutputBindingSchema).default([]) }).strict(),
12650
- graph: z16.object({ nodes: z16.array(WorkflowNodeSchema), edges: z16.array(WorkflowEdgeSchema).default([]) }).strict(),
12651
- execution: z16.object({
12652
- timeoutMs: z16.number().int().positive().optional(),
12653
- retries: z16.number().int().nonnegative().default(0),
12654
- concurrencyLimit: z16.number().int().positive().optional(),
12655
- idempotency: z16.enum(["required", "supported", "none"]),
12656
- rateLimit: z16.object({ enabled: z16.boolean(), max: z16.number().int().nonnegative(), windowMs: z16.number().int().nonnegative() }).strict().superRefine((rateLimit, context) => {
13602
+ presentation: z17.object({ iconUrl: z17.string().optional(), thumbnail: z17.string().optional() }).strict(),
13603
+ ports: z17.object({ inputs: z17.array(ContractPortSchema).default([]), outputs: z17.array(ContractPortSchema).default([]) }).strict(),
13604
+ parameters: z17.object({ variables: z17.array(WorkflowParameterSchema).default([]), outputs: z17.array(WorkflowOutputBindingSchema).default([]) }).strict(),
13605
+ graph: z17.object({ nodes: z17.array(WorkflowNodeSchema), edges: z17.array(WorkflowEdgeSchema).default([]) }).strict(),
13606
+ execution: z17.object({
13607
+ timeoutMs: z17.number().int().positive().optional(),
13608
+ retries: z17.number().int().nonnegative().default(0),
13609
+ concurrencyLimit: z17.number().int().positive().optional(),
13610
+ idempotency: z17.enum(["required", "supported", "none"]),
13611
+ rateLimit: z17.object({ enabled: z17.boolean(), max: z17.number().int().nonnegative(), windowMs: z17.number().int().nonnegative() }).strict().superRefine((rateLimit, context) => {
12657
13612
  if (rateLimit.enabled && (rateLimit.max === 0 || rateLimit.windowMs === 0)) context.addIssue({ code: "custom", message: "Enabled rate limit requires positive max and windowMs." });
12658
13613
  }).optional(),
12659
- conductor: z16.object({
12660
- ownerApp: z16.string().optional(),
12661
- createTime: z16.number().int().nonnegative().optional(),
12662
- updateTime: z16.number().int().nonnegative().optional(),
12663
- createdBy: z16.string().optional(),
12664
- updatedBy: z16.string().optional(),
13614
+ conductor: z17.object({
13615
+ ownerApp: z17.string().optional(),
13616
+ createTime: z17.number().int().nonnegative().optional(),
13617
+ updateTime: z17.number().int().nonnegative().optional(),
13618
+ createdBy: z17.string().optional(),
13619
+ updatedBy: z17.string().optional(),
12665
13620
  failureWorkflow: ContractIdentifierSchema.optional(),
12666
- schemaVersion: z16.number().int().positive().optional(),
12667
- restartable: z16.boolean().optional(),
12668
- workflowStatusListenerEnabled: z16.boolean().optional(),
12669
- ownerEmail: z16.string().email().optional(),
12670
- timeoutPolicy: z16.enum(["TIME_OUT_WF", "ALERT_ONLY"]).optional(),
12671
- variables: z16.record(z16.string(), JsonValueSchema).optional(),
12672
- inputTemplate: z16.record(z16.string(), JsonValueSchema).optional()
13621
+ schemaVersion: z17.number().int().positive().optional(),
13622
+ restartable: z17.boolean().optional(),
13623
+ workflowStatusListenerEnabled: z17.boolean().optional(),
13624
+ ownerEmail: z17.string().email().optional(),
13625
+ timeoutPolicy: z17.enum(["TIME_OUT_WF", "ALERT_ONLY"]).optional(),
13626
+ variables: z17.record(z17.string(), JsonValueSchema).optional(),
13627
+ inputTemplate: z17.record(z17.string(), JsonValueSchema).optional()
12673
13628
  }).strict()
12674
13629
  }).strict(),
12675
- triggers: z16.array(WorkflowTriggerSchema).default([]),
12676
- views: z16.array(z16.object({ pageRef: ContractIdentifierSchema, placement: ContractIdentifierSchema.optional() }).strict()).default([]),
12677
- dataContracts: z16.object({ reads: z16.array(ContractIdentifierSchema).default([]), writes: z16.array(ContractIdentifierSchema).default([]), emits: z16.array(ContractIdentifierSchema).default([]) }).strict(),
12678
- governance: z16.object({ activated: z16.boolean(), validated: z16.boolean(), validationIssues: z16.array(WorkflowValidationIssueSchema).default([]), hidden: z16.boolean().optional() }).strict(),
12679
- interfaces: z16.object({
12680
- openai: z16.object({ enabled: z16.boolean(), modelName: z16.string().trim().min(1).optional() }).strict(),
13630
+ triggers: z17.array(WorkflowTriggerSchema).default([]),
13631
+ views: z17.array(z17.object({ pageRef: ContractIdentifierSchema, placement: ContractIdentifierSchema.optional() }).strict()).default([]),
13632
+ dataContracts: z17.object({ reads: z17.array(ContractIdentifierSchema).default([]), writes: z17.array(ContractIdentifierSchema).default([]), emits: z17.array(ContractIdentifierSchema).default([]) }).strict(),
13633
+ governance: z17.object({ activated: z17.boolean(), validated: z17.boolean(), validationIssues: z17.array(WorkflowValidationIssueSchema).default([]), hidden: z17.boolean().optional() }).strict(),
13634
+ interfaces: z17.object({
13635
+ openai: z17.object({ enabled: z17.boolean(), modelName: z17.string().trim().min(1).optional() }).strict(),
12681
13636
  shortcutRef: EntityRefSchema.optional(),
12682
13637
  preferredAppId: ContractIdentifierSchema.optional()
12683
13638
  }).strict().superRefine((interfaces, context) => {
@@ -12696,21 +13651,21 @@ var WorkflowDefinitionSchema = z16.object({
12696
13651
  });
12697
13652
 
12698
13653
  // src/contracts/workflow-runtime.ts
12699
- import { z as z17 } from "zod";
12700
- var WorkflowCatalogEntrySchema = z17.object({
12701
- contract: z17.literal("WorkflowCatalogEntry"),
13654
+ import { z as z18 } from "zod";
13655
+ var WorkflowCatalogEntrySchema = z18.object({
13656
+ contract: z18.literal("WorkflowCatalogEntry"),
12702
13657
  workflowId: ContractIdentifierSchema,
12703
13658
  teamId: ContractIdentifierSchema,
12704
13659
  creatorRef: EntityRefSchema,
12705
13660
  currentDefinitionRef: EntityRefSchema,
12706
- lifecycle: z17.enum(["ACTIVE", "DELETED"]),
12707
- asset: z17.object({
12708
- preset: z17.boolean(),
12709
- marketplacePublished: z17.boolean(),
13661
+ lifecycle: z18.enum(["ACTIVE", "DELETED"]),
13662
+ asset: z18.object({
13663
+ preset: z18.boolean(),
13664
+ marketplacePublished: z18.boolean(),
12710
13665
  publishConfig: JsonObjectSchema.optional(),
12711
- sort: z17.number().int(),
13666
+ sort: z18.number().int(),
12712
13667
  forkFromRef: EntityRefSchema.optional(),
12713
- notAuthorized: z17.boolean()
13668
+ notAuthorized: z18.boolean()
12714
13669
  }).strict(),
12715
13670
  createdAt: IsoDateTimeSchema,
12716
13671
  updatedAt: IsoDateTimeSchema,
@@ -12745,17 +13700,17 @@ var WorkflowCatalogEntrySchema = z17.object({
12745
13700
  });
12746
13701
  }
12747
13702
  });
12748
- var WorkflowPublicationSchema = z17.object({
12749
- contract: z17.literal("WorkflowPublication"),
13703
+ var WorkflowPublicationSchema = z18.object({
13704
+ contract: z18.literal("WorkflowPublication"),
12750
13705
  publicationId: ContractIdentifierSchema,
12751
13706
  definitionRef: EntityRefSchema,
12752
13707
  runtimeDefinitionRef: EntityRefSchema,
12753
13708
  sourceHash: Sha256Schema,
12754
13709
  compiledHash: Sha256Schema,
12755
- status: z17.enum(["PENDING", "PUBLISHED", "FAILED", "RETIRED"]),
13710
+ status: z18.enum(["PENDING", "PUBLISHED", "FAILED", "RETIRED"]),
12756
13711
  publisherRef: EntityRefSchema,
12757
13712
  publishedAt: IsoDateTimeSchema.optional(),
12758
- failureReason: z17.string().trim().min(1).optional()
13713
+ failureReason: z18.string().trim().min(1).optional()
12759
13714
  }).strict().superRefine((publication, context) => {
12760
13715
  if (publication.definitionRef.kind !== "workflow-definition") {
12761
13716
  context.addIssue({
@@ -12786,12 +13741,12 @@ var WorkflowPublicationSchema = z17.object({
12786
13741
  });
12787
13742
  }
12788
13743
  });
12789
- var WorkflowCompletionCommitSchema = z17.object({
12790
- contract: z17.literal("WorkflowCompletionCommit"),
13744
+ var WorkflowCompletionCommitSchema = z18.object({
13745
+ contract: z18.literal("WorkflowCompletionCommit"),
12791
13746
  commitId: ContractIdentifierSchema,
12792
13747
  run: ApplicationRunSchema,
12793
- outputs: z17.array(OutputRecordSchema),
12794
- artifacts: z17.array(ArtifactManifestSchema),
13748
+ outputs: z18.array(OutputRecordSchema),
13749
+ artifacts: z18.array(ArtifactManifestSchema),
12795
13750
  lineage: LineageRecordSchema,
12796
13751
  completedAt: IsoDateTimeSchema
12797
13752
  }).strict().superRefine((commit, context) => {
@@ -12833,15 +13788,15 @@ var WorkflowCompletionCommitSchema = z17.object({
12833
13788
  }
12834
13789
  });
12835
13790
  });
12836
- var WorkflowCompletionReceiptSchema = z17.object({
12837
- contract: z17.literal("WorkflowCompletionReceipt"),
13791
+ var WorkflowCompletionReceiptSchema = z18.object({
13792
+ contract: z18.literal("WorkflowCompletionReceipt"),
12838
13793
  commitId: ContractIdentifierSchema,
12839
13794
  runRef: EntityRefSchema,
12840
- outputRefs: z17.array(EntityRefSchema),
12841
- artifactRefs: z17.array(EntityRefSchema),
13795
+ outputRefs: z18.array(EntityRefSchema),
13796
+ artifactRefs: z18.array(EntityRefSchema),
12842
13797
  contentHash: Sha256Schema,
12843
13798
  committedAt: IsoDateTimeSchema,
12844
- idempotentReplay: z17.boolean()
13799
+ idempotentReplay: z18.boolean()
12845
13800
  }).strict().superRefine((receipt, context) => {
12846
13801
  if (receipt.runRef.kind !== "application-run") {
12847
13802
  context.addIssue({
@@ -12902,6 +13857,7 @@ var canonicalContractSchemas = {
12902
13857
  "domain-command": DomainCommandSchema,
12903
13858
  "domain-command-definition": DomainCommandDefinitionSchema,
12904
13859
  "data-continuity-envelope": DataContinuityEnvelopeSchema,
13860
+ "declarative-control-ontology-definition": DeclarativeControlOntologyDefinitionSchema,
12905
13861
  "execution-link": ExecutionLinkSchema,
12906
13862
  "expiring-access-grant": ExpiringAccessGrantSchema,
12907
13863
  "hotword-body": HotwordBodySchema,
@@ -12909,13 +13865,20 @@ var canonicalContractSchemas = {
12909
13865
  "menu-definition": MenuDefinitionSchema,
12910
13866
  "menu-definition-set": MenuDefinitionSetSchema,
12911
13867
  "menu-runtime-bundle": MenuRuntimeBundleSchema,
13868
+ "navigation": NavigationSchema,
13869
+ "navigation-release": NavigationReleaseSchema,
13870
+ "navigation-runtime-bundle": NavigationRuntimeBundleSchema,
12912
13871
  "ontology-definition": OntologyDefinitionSchema,
12913
13872
  "overlay-node": OverlayNodeSchema,
12914
13873
  "output-record": OutputRecordSchema,
12915
13874
  "page-definition": PageDefinitionSchema,
13875
+ "page": PageSchema,
13876
+ "page-release": PageReleaseSchema,
13877
+ "page-runtime-bundle": PageRuntimeBundleSchema,
12916
13878
  "page-runtime-descriptor": PageRuntimeDescriptorSchema,
12917
13879
  "page-runtime-projection": PageRuntimeProjectionSchema,
12918
13880
  "projection-spec": ProjectionSpecSchema,
13881
+ "publication-plan": PublicationPlanSchema,
12919
13882
  "product-declaration": ProductDeclarationSchema,
12920
13883
  "product-body": ProductBodySchema,
12921
13884
  "radar-action-record": RadarActionRecordSchema,
@@ -12929,9 +13892,11 @@ var canonicalContractSchemas = {
12929
13892
  "radar-selection": RadarSelectionSchema,
12930
13893
  "radar-writeback-record": RadarWritebackRecordSchema,
12931
13894
  "request-scope": RequestScopeSchema,
13895
+ "route-space": RouteSpaceSchema,
12932
13896
  "render-node": RenderNodeSchema,
12933
13897
  "render-tree": RenderTreeSchema,
12934
13898
  "saved-radar-query": SavedRadarQuerySchema,
13899
+ "stable-ref-alias-map": StableRefAliasMapSchema,
12935
13900
  "tenant-product-config": TenantProductConfigSchema,
12936
13901
  "tenant-runtime-config": TenantRuntimeConfigSchema,
12937
13902
  "theme-tokens": ThemeTokensSchema,
@@ -12940,6 +13905,9 @@ var canonicalContractSchemas = {
12940
13905
  "trend-metric-snapshot": TrendMetricSnapshotSchema,
12941
13906
  "trend-source-record": TrendSourceRecordSchema,
12942
13907
  "view-provider-descriptor": ViewProviderDescriptorSchema,
13908
+ "workbench": WorkbenchSchema,
13909
+ "workbench-release": WorkbenchReleaseSchema,
13910
+ "workbench-runtime-bundle": WorkbenchRuntimeBundleSchema,
12943
13911
  "workflow-definition": WorkflowDefinitionSchema,
12944
13912
  "workflow-catalog-entry": WorkflowCatalogEntrySchema,
12945
13913
  "workflow-publication": WorkflowPublicationSchema,
@@ -12947,6 +13915,8 @@ var canonicalContractSchemas = {
12947
13915
  "workflow-completion-receipt": WorkflowCompletionReceiptSchema
12948
13916
  };
12949
13917
  export {
13918
+ AccessPolicySchema,
13919
+ ActionBindingSchema,
12950
13920
  AgentConfigurationCapabilitySchema,
12951
13921
  AgentExecutionModeSchema,
12952
13922
  AgentModeCapabilitiesSchema,
@@ -13002,9 +13972,11 @@ export {
13002
13972
  ApplicationHandoffSchema,
13003
13973
  ApplicationRunSchema,
13004
13974
  ArtifactManifestSchema,
13975
+ BindingSourceSchema,
13005
13976
  BodyRelationRecordSchema,
13006
13977
  BrandBodySchema,
13007
13978
  BrandGeneticsProfileSchema,
13979
+ CapabilityInstanceSchema,
13008
13980
  CapabilityManifestSchema,
13009
13981
  CapabilityRegistryDocumentSchema,
13010
13982
  CapabilityRegistryEntrySchema,
@@ -13020,6 +13992,15 @@ export {
13020
13992
  CompiledMenuNavigateBehaviorSchema,
13021
13993
  CompiledMenuNodeSchema,
13022
13994
  CompiledMenuProjectionSchema,
13995
+ CompiledNavigationDomainCommandTargetSchema,
13996
+ CompiledNavigationGroupNodeSchema,
13997
+ CompiledNavigationNodeSchema,
13998
+ CompiledNavigationRegisteredMenuActionTargetSchema,
13999
+ CompiledNavigationResolvedTargetSchema,
14000
+ CompiledNavigationSeparatorNodeSchema,
14001
+ CompiledNavigationTargetNodeSchema,
14002
+ CompiledRouteClaimSchema,
14003
+ CompiledRouteMatcherSchema,
13023
14004
  CompletionEventSchema,
13024
14005
  CompletionHeaderSchema,
13025
14006
  ConceptDefinitionSchema,
@@ -13037,6 +14018,9 @@ export {
13037
14018
  CurrentUserMenuProfileSchema,
13038
14019
  CurrentUserMenuSectionSchema,
13039
14020
  DataContinuityEnvelopeSchema,
14021
+ DeclarativeControlOntologyDefinitionSchema,
14022
+ DeclarativeLifecycleSchema,
14023
+ DeclarativeRouteClaimSchema,
13040
14024
  DomainCommandDefinitionSchema,
13041
14025
  DomainCommandSchema,
13042
14026
  DomainEventSchema,
@@ -13044,9 +14028,12 @@ export {
13044
14028
  ExecutionLinkSchema,
13045
14029
  ExpiringAccessGrantSchema,
13046
14030
  HotwordBodySchema,
14031
+ I18nTextSchema,
13047
14032
  JsonObjectSchema,
13048
14033
  JsonValueSchema,
14034
+ LegacyRouteClaimSchema,
13049
14035
  LineageRecordSchema,
14036
+ ManagementAccessSchema,
13050
14037
  MenuAccessRequirementSchema,
13051
14038
  MenuActionBehaviorSchema,
13052
14039
  MenuActionRegistrationSchema,
@@ -13068,6 +14055,14 @@ export {
13068
14055
  MenuRuntimeBundleSchema,
13069
14056
  MenuRuntimeInputBindingSchema,
13070
14057
  MenuSourceInputBindingSchema,
14058
+ NavigationGroupNodeSchema,
14059
+ NavigationNodeSchema,
14060
+ NavigationReleaseSchema,
14061
+ NavigationRuntimeBundleSchema,
14062
+ NavigationSchema,
14063
+ NavigationSeparatorNodeSchema,
14064
+ NavigationTargetNodeSchema,
14065
+ OntologyBindingSchema,
13071
14066
  OntologyDefinitionSchema,
13072
14067
  OutputRecordSchema,
13073
14068
  OverlayNodeSchema,
@@ -13075,10 +14070,13 @@ export {
13075
14070
  PageDefinitionSchema,
13076
14071
  PageGuardProjectionSchema,
13077
14072
  PageNavigationProjectionSchema,
14073
+ PageReleaseSchema,
13078
14074
  PageRendererProjectionSchema,
13079
14075
  PageRouteProjectionSchema,
14076
+ PageRuntimeBundleSchema,
13080
14077
  PageRuntimeDescriptorSchema,
13081
14078
  PageRuntimeProjectionSchema,
14079
+ PageSchema,
13082
14080
  PageTypeSchema,
13083
14081
  PageVisibilitySchema,
13084
14082
  PermissionBundleSchema,
@@ -13087,7 +14085,10 @@ export {
13087
14085
  ProductBodySchema,
13088
14086
  ProductContextSchema,
13089
14087
  ProductDeclarationSchema,
14088
+ ProductSurfaceSchema,
13090
14089
  ProjectionSpecSchema,
14090
+ PublicationPlanOperationSchema,
14091
+ PublicationPlanSchema,
13091
14092
  RadarActionRecordSchema,
13092
14093
  RadarAnalysisAssetSchema,
13093
14094
  RadarAnalysisDetailSchema,
@@ -13103,6 +14104,12 @@ export {
13103
14104
  RadarScoreProjectionSchema,
13104
14105
  RadarSelectionSchema,
13105
14106
  RadarWritebackRecordSchema,
14107
+ ReferenceVisibilitySchema,
14108
+ ReleaseDependencyRoleSchema,
14109
+ ReleaseDependencySchema,
14110
+ ReleaseEvidenceSchema,
14111
+ ReleaseOperationSchema,
14112
+ ReleaseValidationSchema,
13106
14113
  RenderActivationSchema,
13107
14114
  RenderLayoutSchema,
13108
14115
  RenderLifecycleSchema,
@@ -13114,9 +14121,20 @@ export {
13114
14121
  RenderSurfaceSchema,
13115
14122
  RenderTreeSchema,
13116
14123
  RequestScopeSchema,
14124
+ ResolvedNavigationTargetSchema,
13117
14125
  ResolvedThemeTokensSchema,
14126
+ ResolvedWorkbenchAppInstanceSchema,
14127
+ RevisionRefSchema,
14128
+ RouteClaimSchema,
14129
+ RoutePathTemplateSchema,
14130
+ RouteSpaceParameterSchema,
14131
+ RouteSpaceSchema,
13118
14132
  SavedRadarQuerySchema,
14133
+ ScopedIdentityRefSchema,
13119
14134
  SourceRecordRefSchema,
14135
+ StableRefAliasMapSchema,
14136
+ StableRefAliasSchema,
14137
+ StableRefSchema,
13120
14138
  StorageLocatorSchema,
13121
14139
  StudioAgentModeSchema,
13122
14140
  SystemGroupDefinitionSchema,
@@ -13126,6 +14144,7 @@ export {
13126
14144
  TenantListFooterConfigSchema,
13127
14145
  TenantProductConfigSchema,
13128
14146
  TenantRuntimeConfigSchema,
14147
+ TenantScopeSchema,
13129
14148
  TenantTrendRadarCollectionTargetSchema,
13130
14149
  TenantTrendRadarDerivedMetricsSchema,
13131
14150
  TenantTrendRadarEvaluationSchema,
@@ -13156,6 +14175,11 @@ export {
13156
14175
  TrendSourceRecordSchema,
13157
14176
  TrendSourceSchema,
13158
14177
  ViewProviderDescriptorSchema,
14178
+ WorkbenchAppInstanceSchema,
14179
+ WorkbenchGroupSchema,
14180
+ WorkbenchReleaseSchema,
14181
+ WorkbenchRuntimeBundleSchema,
14182
+ WorkbenchSchema,
13159
14183
  WorkflowCatalogEntrySchema,
13160
14184
  WorkflowCompletionCommitSchema,
13161
14185
  WorkflowCompletionReceiptSchema,