@inf-monkeys-tech/monkeys 1.0.65 → 1.0.68

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