@inf-monkeys-tech/monkeys 1.0.64 → 1.0.66

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