@inf-monkeys-tech/monkeys 1.0.45 → 1.0.47

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 (47) hide show
  1. package/lib/contracts/access.d.ts +60 -0
  2. package/lib/contracts/access.d.ts.map +1 -0
  3. package/lib/contracts/access.js +47 -0
  4. package/lib/contracts/access.js.map +1 -0
  5. package/lib/contracts/index.d.ts +1 -0
  6. package/lib/contracts/index.d.ts.map +1 -1
  7. package/lib/contracts/index.js +1 -0
  8. package/lib/contracts/index.js.map +1 -1
  9. package/lib/contracts/menu.d.ts +1 -1
  10. package/lib/contracts/page.d.ts +3 -3
  11. package/lib/contracts/render.d.ts +4 -4
  12. package/lib/contracts/semantic.d.ts +1 -1
  13. package/lib/contracts/tenant.d.ts +80 -5
  14. package/lib/contracts/tenant.d.ts.map +1 -1
  15. package/lib/contracts/tenant.js +10 -0
  16. package/lib/contracts/tenant.js.map +1 -1
  17. package/lib/esm/contracts/index.mjs +1445 -1399
  18. package/lib/esm/contracts/index.mjs.map +1 -1
  19. package/lib/esm/index.mjs +1503 -1401
  20. package/lib/esm/index.mjs.map +1 -1
  21. package/lib/esm/runtime/index.mjs +100 -2
  22. package/lib/esm/runtime/index.mjs.map +1 -1
  23. package/lib/esm/schemas/index.mjs +1445 -1399
  24. package/lib/esm/schemas/index.mjs.map +1 -1
  25. package/lib/index.d.ts +1 -0
  26. package/lib/index.d.ts.map +1 -1
  27. package/lib/index.js +3 -1
  28. package/lib/index.js.map +1 -1
  29. package/lib/json-schema/tenant-product-config.schema.json +58 -0
  30. package/lib/json-schema/tenant-runtime-config.schema.json +58 -0
  31. package/lib/runtime/access-compiler.d.ts +10 -0
  32. package/lib/runtime/access-compiler.d.ts.map +1 -0
  33. package/lib/runtime/access-compiler.js +63 -0
  34. package/lib/runtime/access-compiler.js.map +1 -0
  35. package/lib/runtime/index.d.ts +1 -0
  36. package/lib/runtime/index.d.ts.map +1 -1
  37. package/lib/runtime/index.js +1 -0
  38. package/lib/runtime/index.js.map +1 -1
  39. package/lib/runtime/menu-compiler.d.ts +0 -1
  40. package/lib/runtime/menu-compiler.d.ts.map +1 -1
  41. package/lib/runtime/menu-compiler.js +1 -2
  42. package/lib/runtime/menu-compiler.js.map +1 -1
  43. package/lib/schemas/index.d.ts +59 -8
  44. package/lib/schemas/index.d.ts.map +1 -1
  45. package/lib/schemas/index.js +10 -5
  46. package/lib/schemas/index.js.map +1 -1
  47. package/package.json +1 -1
package/lib/esm/index.mjs CHANGED
@@ -6600,7 +6600,7 @@ var WorkflowTriggerType = /* @__PURE__ */ ((WorkflowTriggerType2) => {
6600
6600
  return WorkflowTriggerType2;
6601
6601
  })(WorkflowTriggerType || {});
6602
6602
 
6603
- // src/contracts/artifact.ts
6603
+ // src/contracts/access.ts
6604
6604
  import { z as z2 } from "zod";
6605
6605
 
6606
6606
  // src/contracts/common.ts
@@ -6641,72 +6641,107 @@ var EntityRefSchema = z.object({
6641
6641
  ownerRepo: ContractIdentifierSchema.optional()
6642
6642
  }).strict();
6643
6643
 
6644
+ // src/contracts/access.ts
6645
+ var PermissionDefinitionSchema = z2.object({
6646
+ code: ContractIdentifierSchema,
6647
+ name: LocalizedTextSchema,
6648
+ description: LocalizedTextSchema.optional(),
6649
+ resource: ContractIdentifierSchema,
6650
+ action: ContractIdentifierSchema,
6651
+ domain: ContractIdentifierSchema.optional()
6652
+ }).strict();
6653
+ var PermissionBundleSchema = z2.object({
6654
+ bundleId: ContractIdentifierSchema,
6655
+ name: LocalizedTextSchema,
6656
+ permissionCodes: z2.array(ContractIdentifierSchema).default([])
6657
+ }).strict();
6658
+ var SystemGroupDefinitionSchema = z2.object({
6659
+ groupCode: ContractIdentifierSchema,
6660
+ name: LocalizedTextSchema,
6661
+ description: LocalizedTextSchema.optional(),
6662
+ permissionPolicy: z2.enum(["bundles", "studio_current", "all_current"]).default("bundles"),
6663
+ permissionBundleIds: z2.array(ContractIdentifierSchema).default([])
6664
+ }).strict().refine((value) => value.permissionPolicy !== "bundles" || value.permissionBundleIds.length > 0, {
6665
+ message: "A bundles permission policy requires at least one permission bundle.",
6666
+ path: ["permissionBundleIds"]
6667
+ });
6668
+ var ProductAccessDeclarationSchema = z2.object({
6669
+ contract: z2.literal("ProductAccessDeclaration"),
6670
+ declarationId: ContractIdentifierSchema,
6671
+ version: ContractVersionSchema,
6672
+ ownerRepo: ContractIdentifierSchema,
6673
+ permissions: z2.array(PermissionDefinitionSchema).default([]),
6674
+ permissionBundles: z2.array(PermissionBundleSchema).default([]),
6675
+ systemGroups: z2.array(SystemGroupDefinitionSchema).min(1)
6676
+ }).strict();
6677
+
6644
6678
  // src/contracts/artifact.ts
6645
- var StorageLocatorSchema = z2.object({
6679
+ import { z as z3 } from "zod";
6680
+ var StorageLocatorSchema = z3.object({
6646
6681
  provider: ContractIdentifierSchema,
6647
6682
  bucket: ContractIdentifierSchema.optional(),
6648
6683
  key: ContractIdentifierSchema,
6649
6684
  region: ContractIdentifierSchema.optional(),
6650
- url: z2.string().url().optional(),
6685
+ url: z3.string().url().optional(),
6651
6686
  expiresAt: IsoDateTimeSchema.optional()
6652
6687
  }).strict();
6653
- var ArtifactAccessSchema = z2.object({
6688
+ var ArtifactAccessSchema = z3.object({
6654
6689
  tenantId: ContractIdentifierSchema.optional(),
6655
6690
  teamId: ContractIdentifierSchema.optional(),
6656
6691
  ownerRef: EntityRefSchema.optional(),
6657
- visibility: z2.enum(["private", "team", "tenant", "public"])
6692
+ visibility: z3.enum(["private", "team", "tenant", "public"])
6658
6693
  }).strict();
6659
- var ArtifactManifestSchema = z2.object({
6660
- contract: z2.literal("ArtifactManifest"),
6694
+ var ArtifactManifestSchema = z3.object({
6695
+ contract: z3.literal("ArtifactManifest"),
6661
6696
  artifactId: ContractIdentifierSchema,
6662
6697
  kind: ContractIdentifierSchema,
6663
- mimeType: z2.string().trim().min(1),
6664
- byteSize: z2.number().int().nonnegative().optional(),
6698
+ mimeType: z3.string().trim().min(1),
6699
+ byteSize: z3.number().int().nonnegative().optional(),
6665
6700
  sha256: Sha256Schema,
6666
6701
  storage: StorageLocatorSchema,
6667
6702
  sourceRef: EntityRefSchema.optional(),
6668
6703
  runRef: EntityRefSchema,
6669
6704
  outputRef: EntityRefSchema,
6670
- producer: z2.object({
6705
+ producer: z3.object({
6671
6706
  service: ContractIdentifierSchema,
6672
6707
  version: ContractIdentifierSchema,
6673
6708
  capabilityRef: EntityRefSchema.optional()
6674
6709
  }).strict(),
6675
6710
  access: ArtifactAccessSchema,
6676
- metadata: z2.record(z2.string(), JsonValueSchema).default({}),
6711
+ metadata: z3.record(z3.string(), JsonValueSchema).default({}),
6677
6712
  createdAt: IsoDateTimeSchema
6678
6713
  }).strict();
6679
- var OutputRecordSchema = z2.object({
6680
- contract: z2.literal("OutputRecord"),
6714
+ var OutputRecordSchema = z3.object({
6715
+ contract: z3.literal("OutputRecord"),
6681
6716
  outputId: ContractIdentifierSchema,
6682
6717
  runRef: EntityRefSchema,
6683
6718
  outputPort: ContractIdentifierSchema,
6684
6719
  value: JsonValueSchema.optional(),
6685
- artifactRefs: z2.array(EntityRefSchema).default([]),
6720
+ artifactRefs: z3.array(EntityRefSchema).default([]),
6686
6721
  schemaRef: ContractIdentifierSchema.optional(),
6687
6722
  createdAt: IsoDateTimeSchema
6688
6723
  }).strict();
6689
6724
 
6690
6725
  // src/contracts/agent.ts
6691
- import { z as z3 } from "zod";
6692
- var StudioAgentModeSchema = z3.enum(["chat", "work"]);
6726
+ import { z as z4 } from "zod";
6727
+ var StudioAgentModeSchema = z4.enum(["chat", "work"]);
6693
6728
  var AgentModeSchema = StudioAgentModeSchema;
6694
- var AgentConfigurationCapabilitySchema = z3.enum([
6729
+ var AgentConfigurationCapabilitySchema = z4.enum([
6695
6730
  "models",
6696
6731
  "skills",
6697
6732
  "tools",
6698
6733
  "mcp",
6699
6734
  "reasoning"
6700
6735
  ]);
6701
- var AgentModeCapabilitiesSchema = z3.object({
6702
- models: z3.boolean(),
6703
- skills: z3.boolean(),
6704
- tools: z3.boolean(),
6705
- mcp: z3.boolean(),
6706
- reasoning: z3.boolean()
6736
+ var AgentModeCapabilitiesSchema = z4.object({
6737
+ models: z4.boolean(),
6738
+ skills: z4.boolean(),
6739
+ tools: z4.boolean(),
6740
+ mcp: z4.boolean(),
6741
+ reasoning: z4.boolean()
6707
6742
  }).strict();
6708
- var AgentResourceModeSupportSchema = z3.object({
6709
- modes: z3.array(AgentModeSchema).min(1)
6743
+ var AgentResourceModeSupportSchema = z4.object({
6744
+ modes: z4.array(AgentModeSchema).min(1)
6710
6745
  }).strict();
6711
6746
  var AGENT_MODE_CAPABILITIES = Object.freeze({
6712
6747
  chat: AgentModeCapabilitiesSchema.parse({
@@ -6733,7 +6768,7 @@ function agentModeHasCapability(mode, capability) {
6733
6768
  function isAgentResourceModeCompatible(support, mode) {
6734
6769
  return support?.modes.includes(mode) ?? false;
6735
6770
  }
6736
- var AgentSessionCapabilitySchema = z3.enum([
6771
+ var AgentSessionCapabilitySchema = z4.enum([
6737
6772
  "text",
6738
6773
  "reasoning",
6739
6774
  "plan",
@@ -6756,30 +6791,30 @@ var AgentSessionCapabilitySchema = z3.enum([
6756
6791
  "steering",
6757
6792
  "summary"
6758
6793
  ]);
6759
- var AgentSessionCapabilitiesSchema = z3.object({
6760
- text: z3.boolean().default(true),
6761
- reasoning: z3.boolean().default(false),
6762
- plan: z3.boolean().default(false),
6763
- tasks: z3.boolean().default(false),
6764
- tools: z3.boolean().default(false),
6765
- mcp: z3.boolean().default(false),
6766
- shell: z3.boolean().default(false),
6767
- fileChange: z3.boolean().default(false),
6768
- skills: z3.boolean().default(false),
6769
- approval: z3.boolean().default(false),
6770
- artifacts: z3.boolean().default(false),
6771
- usage: z3.boolean().default(false),
6772
- resume: z3.boolean().default(false),
6773
- diff: z3.boolean().default(false),
6774
- workspaceFiles: z3.boolean().default(false),
6775
- terminal: z3.boolean().default(false),
6776
- testResults: z3.boolean().default(false),
6777
- threadForking: z3.boolean().default(false),
6778
- editAndRerun: z3.boolean().default(false),
6779
- steering: z3.boolean().default(false),
6780
- summary: z3.boolean().default(false)
6781
- }).strict();
6782
- var AgentSessionPermissionProfileSchema = z3.enum([
6794
+ var AgentSessionCapabilitiesSchema = z4.object({
6795
+ text: z4.boolean().default(true),
6796
+ reasoning: z4.boolean().default(false),
6797
+ plan: z4.boolean().default(false),
6798
+ tasks: z4.boolean().default(false),
6799
+ tools: z4.boolean().default(false),
6800
+ mcp: z4.boolean().default(false),
6801
+ shell: z4.boolean().default(false),
6802
+ fileChange: z4.boolean().default(false),
6803
+ skills: z4.boolean().default(false),
6804
+ approval: z4.boolean().default(false),
6805
+ artifacts: z4.boolean().default(false),
6806
+ usage: z4.boolean().default(false),
6807
+ resume: z4.boolean().default(false),
6808
+ diff: z4.boolean().default(false),
6809
+ workspaceFiles: z4.boolean().default(false),
6810
+ terminal: z4.boolean().default(false),
6811
+ testResults: z4.boolean().default(false),
6812
+ threadForking: z4.boolean().default(false),
6813
+ editAndRerun: z4.boolean().default(false),
6814
+ steering: z4.boolean().default(false),
6815
+ summary: z4.boolean().default(false)
6816
+ }).strict();
6817
+ var AgentSessionPermissionProfileSchema = z4.enum([
6783
6818
  "approval-required",
6784
6819
  "auto-approve",
6785
6820
  "full-access"
@@ -6823,13 +6858,13 @@ function findUnsupportedAgentSessionCapabilities(capabilities, evidence) {
6823
6858
  return !requirement.eventTypes.some((eventType) => eventTypes.has(eventType)) && !requirement.commandTypes.some((commandType) => commandTypes.has(commandType));
6824
6859
  });
6825
6860
  }
6826
- var AgentSessionSnapshotSchema = z3.object({
6861
+ var AgentSessionSnapshotSchema = z4.object({
6827
6862
  mode: AgentModeSchema,
6828
- modelId: z3.string().trim().min(1),
6863
+ modelId: z4.string().trim().min(1),
6829
6864
  capabilities: AgentSessionCapabilitiesSchema,
6830
6865
  permissionProfile: AgentSessionPermissionProfileSchema.optional()
6831
6866
  }).strict();
6832
- var AgentSessionStatusSchema = z3.enum([
6867
+ var AgentSessionStatusSchema = z4.enum([
6833
6868
  "queued",
6834
6869
  "running",
6835
6870
  "waiting_approval",
@@ -6838,56 +6873,56 @@ var AgentSessionStatusSchema = z3.enum([
6838
6873
  "completed",
6839
6874
  "failed"
6840
6875
  ]);
6841
- var AgentSessionTerminalStatusSchema = z3.enum(["stopped", "completed", "failed"]);
6842
- var AgentSessionLineageSchema = z3.object({
6876
+ var AgentSessionTerminalStatusSchema = z4.enum(["stopped", "completed", "failed"]);
6877
+ var AgentSessionLineageSchema = z4.object({
6843
6878
  forkedFromThreadId: ContractIdentifierSchema,
6844
6879
  forkedFromMessageId: ContractIdentifierSchema,
6845
6880
  sourceRunId: ContractIdentifierSchema
6846
6881
  }).strict();
6847
- var AgentSessionContextInheritanceSchema = z3.object({
6848
- messages: z3.enum(["through-source-message", "exclude"]),
6849
- attachments: z3.enum(["inherit", "exclude"]),
6850
- summaries: z3.enum(["inherit", "exclude"]),
6851
- toolResults: z3.enum(["inherit", "exclude"]),
6852
- codeChanges: z3.enum(["inherit", "exclude"])
6882
+ var AgentSessionContextInheritanceSchema = z4.object({
6883
+ messages: z4.enum(["through-source-message", "exclude"]),
6884
+ attachments: z4.enum(["inherit", "exclude"]),
6885
+ summaries: z4.enum(["inherit", "exclude"]),
6886
+ toolResults: z4.enum(["inherit", "exclude"]),
6887
+ codeChanges: z4.enum(["inherit", "exclude"])
6853
6888
  }).strict();
6854
- var AgentSessionInheritedContextMessageSchema = z3.object({
6889
+ var AgentSessionInheritedContextMessageSchema = z4.object({
6855
6890
  messageId: ContractIdentifierSchema,
6856
- role: z3.enum(["user", "assistant"]),
6857
- parts: z3.array(JsonValueSchema).min(1)
6891
+ role: z4.enum(["user", "assistant"]),
6892
+ parts: z4.array(JsonValueSchema).min(1)
6858
6893
  }).strict();
6859
- var AgentSessionUnavailableResourceSchema = z3.object({
6894
+ var AgentSessionUnavailableResourceSchema = z4.object({
6860
6895
  messageId: ContractIdentifierSchema,
6861
- kind: z3.enum(["attachment", "tool-result", "code-change"]),
6862
- reason: z3.enum(["excluded", "unavailable", "unsupported"])
6896
+ kind: z4.enum(["attachment", "tool-result", "code-change"]),
6897
+ reason: z4.enum(["excluded", "unavailable", "unsupported"])
6863
6898
  }).strict();
6864
- var AgentSessionInheritedContextSchema = z3.object({
6899
+ var AgentSessionInheritedContextSchema = z4.object({
6865
6900
  sourceThreadId: ContractIdentifierSchema,
6866
6901
  sourceMessageId: ContractIdentifierSchema,
6867
6902
  sourceRunId: ContractIdentifierSchema,
6868
- messages: z3.array(AgentSessionInheritedContextMessageSchema).max(24),
6869
- summary: z3.string().trim().min(1).optional(),
6870
- unavailableResources: z3.array(AgentSessionUnavailableResourceSchema).default([]),
6903
+ messages: z4.array(AgentSessionInheritedContextMessageSchema).max(24),
6904
+ summary: z4.string().trim().min(1).optional(),
6905
+ unavailableResources: z4.array(AgentSessionUnavailableResourceSchema).default([]),
6871
6906
  capturedAt: IsoDateTimeSchema
6872
6907
  }).strict();
6873
- var AgentSessionContinuationRequestSchema = z3.object({
6874
- contract: z3.literal("AgentSessionContinuationRequest"),
6908
+ var AgentSessionContinuationRequestSchema = z4.object({
6909
+ contract: z4.literal("AgentSessionContinuationRequest"),
6875
6910
  idempotencyKey: ContractIdentifierSchema,
6876
6911
  sourceMessageId: ContractIdentifierSchema,
6877
6912
  sourceRunId: ContractIdentifierSchema,
6878
6913
  inheritance: AgentSessionContextInheritanceSchema
6879
6914
  }).strict();
6880
- var AgentSessionContinuationResultSchema = z3.object({
6881
- contract: z3.literal("AgentSessionContinuationResult"),
6915
+ var AgentSessionContinuationResultSchema = z4.object({
6916
+ contract: z4.literal("AgentSessionContinuationResult"),
6882
6917
  idempotencyKey: ContractIdentifierSchema,
6883
6918
  threadId: ContractIdentifierSchema,
6884
6919
  lineage: AgentSessionLineageSchema,
6885
6920
  inheritance: AgentSessionContextInheritanceSchema,
6886
- unavailableResources: z3.array(AgentSessionUnavailableResourceSchema).default([]),
6887
- duplicate: z3.boolean(),
6921
+ unavailableResources: z4.array(AgentSessionUnavailableResourceSchema).default([]),
6922
+ duplicate: z4.boolean(),
6888
6923
  createdAt: IsoDateTimeSchema
6889
6924
  }).strict();
6890
- var AgentSessionActiveBranchSchema = z3.object({
6925
+ var AgentSessionActiveBranchSchema = z4.object({
6891
6926
  branchId: ContractIdentifierSchema,
6892
6927
  threadId: ContractIdentifierSchema,
6893
6928
  sourceMessageId: ContractIdentifierSchema,
@@ -6895,7 +6930,7 @@ var AgentSessionActiveBranchSchema = z3.object({
6895
6930
  lineage: AgentSessionLineageSchema.optional(),
6896
6931
  createdAt: IsoDateTimeSchema
6897
6932
  }).strict();
6898
- var AgentSessionRunSchema = z3.object({
6933
+ var AgentSessionRunSchema = z4.object({
6899
6934
  runId: ContractIdentifierSchema,
6900
6935
  sessionId: ContractIdentifierSchema,
6901
6936
  sourceMessageId: ContractIdentifierSchema,
@@ -6905,7 +6940,7 @@ var AgentSessionRunSchema = z3.object({
6905
6940
  stoppedAt: IsoDateTimeSchema.optional(),
6906
6941
  completedAt: IsoDateTimeSchema.optional(),
6907
6942
  failedAt: IsoDateTimeSchema.optional(),
6908
- durationMs: z3.number().nonnegative().optional()
6943
+ durationMs: z4.number().nonnegative().optional()
6909
6944
  }).strict().superRefine((value, context) => {
6910
6945
  const terminalTimestamps = [value.stoppedAt, value.completedAt, value.failedAt].filter(Boolean);
6911
6946
  if (terminalTimestamps.length > 1) {
@@ -6952,7 +6987,7 @@ var AgentSessionRunSchema = z3.object({
6952
6987
  });
6953
6988
  }
6954
6989
  });
6955
- var AgentSessionCommandTypeSchema = z3.enum([
6990
+ var AgentSessionCommandTypeSchema = z4.enum([
6956
6991
  "stop",
6957
6992
  "resume",
6958
6993
  "retry",
@@ -6962,22 +6997,22 @@ var AgentSessionCommandTypeSchema = z3.enum([
6962
6997
  "edit-and-rerun",
6963
6998
  "steer"
6964
6999
  ]);
6965
- var AgentSessionCommandHeaderSchema = z3.object({
6966
- contract: z3.literal("AgentSessionCommand"),
7000
+ var AgentSessionCommandHeaderSchema = z4.object({
7001
+ contract: z4.literal("AgentSessionCommand"),
6967
7002
  commandId: ContractIdentifierSchema,
6968
7003
  sessionId: ContractIdentifierSchema,
6969
7004
  runId: ContractIdentifierSchema.optional(),
6970
7005
  idempotencyKey: ContractIdentifierSchema,
6971
- expectedSequence: z3.number().int().min(-1),
7006
+ expectedSequence: z4.number().int().min(-1),
6972
7007
  issuedAt: IsoDateTimeSchema
6973
7008
  }).strict();
6974
7009
  var sessionCommand = (commandType, payload) => AgentSessionCommandHeaderSchema.extend({
6975
- commandType: z3.literal(commandType),
6976
- payload: z3.object(payload).strict()
7010
+ commandType: z4.literal(commandType),
7011
+ payload: z4.object(payload).strict()
6977
7012
  }).strict();
6978
- var AgentSessionCommandSchema = z3.discriminatedUnion("commandType", [
7013
+ var AgentSessionCommandSchema = z4.discriminatedUnion("commandType", [
6979
7014
  sessionCommand("stop", {
6980
- reason: z3.string().trim().min(1).optional()
7015
+ reason: z4.string().trim().min(1).optional()
6981
7016
  }),
6982
7017
  sessionCommand("resume", {
6983
7018
  resumeEventId: ContractIdentifierSchema.optional()
@@ -6991,8 +7026,8 @@ var AgentSessionCommandSchema = z3.discriminatedUnion("commandType", [
6991
7026
  }),
6992
7027
  sessionCommand("approval", {
6993
7028
  approvalId: ContractIdentifierSchema,
6994
- decision: z3.enum(["approved", "rejected"]),
6995
- reason: z3.string().trim().min(1).optional()
7029
+ decision: z4.enum(["approved", "rejected"]),
7030
+ reason: z4.string().trim().min(1).optional()
6996
7031
  }),
6997
7032
  sessionCommand("fork", {
6998
7033
  sourceThreadId: ContractIdentifierSchema,
@@ -7004,12 +7039,12 @@ var AgentSessionCommandSchema = z3.discriminatedUnion("commandType", [
7004
7039
  sourceThreadId: ContractIdentifierSchema,
7005
7040
  sourceMessageId: ContractIdentifierSchema,
7006
7041
  sourceRunId: ContractIdentifierSchema,
7007
- replacementParts: z3.array(JsonValueSchema).min(1),
7042
+ replacementParts: z4.array(JsonValueSchema).min(1),
7008
7043
  inheritance: AgentSessionContextInheritanceSchema
7009
7044
  }),
7010
7045
  sessionCommand("steer", {
7011
7046
  targetRunId: ContractIdentifierSchema,
7012
- text: z3.string().trim().min(1)
7047
+ text: z4.string().trim().min(1)
7013
7048
  })
7014
7049
  ]).superRefine((value, context) => {
7015
7050
  if (value.commandType === "steer" && value.runId !== value.payload.targetRunId) {
@@ -7028,9 +7063,9 @@ var AgentSessionCommandSchema = z3.discriminatedUnion("commandType", [
7028
7063
  }
7029
7064
  });
7030
7065
  var AgentSessionTargetedCommandSchema = AgentSessionCommandSchema.and(
7031
- z3.object({ runId: ContractIdentifierSchema })
7066
+ z4.object({ runId: ContractIdentifierSchema })
7032
7067
  );
7033
- var AgentSessionCommandErrorCodeSchema = z3.enum([
7068
+ var AgentSessionCommandErrorCodeSchema = z4.enum([
7034
7069
  "SESSION_NOT_FOUND",
7035
7070
  "RUN_NOT_FOUND",
7036
7071
  "ACTIVE_RUN_NOT_FOUND",
@@ -7051,25 +7086,25 @@ var AgentSessionCommandErrorCodeSchema = z3.enum([
7051
7086
  "ACTIVE_BRANCH_NOT_FOUND",
7052
7087
  "COMMAND_EXECUTION_FAILED"
7053
7088
  ]);
7054
- var AgentSessionCommandResultSchema = z3.object({
7055
- contract: z3.literal("AgentSessionCommandResult"),
7089
+ var AgentSessionCommandResultSchema = z4.object({
7090
+ contract: z4.literal("AgentSessionCommandResult"),
7056
7091
  commandId: ContractIdentifierSchema,
7057
7092
  sessionId: ContractIdentifierSchema,
7058
7093
  runId: ContractIdentifierSchema.optional(),
7059
7094
  idempotencyKey: ContractIdentifierSchema,
7060
- outcome: z3.enum(["accepted", "duplicate", "rejected", "failed"]),
7095
+ outcome: z4.enum(["accepted", "duplicate", "rejected", "failed"]),
7061
7096
  sessionStatus: AgentSessionStatusSchema,
7062
- acceptedSequence: z3.number().int().nonnegative().optional(),
7063
- resultEventIds: z3.array(ContractIdentifierSchema).default([]),
7064
- operation: z3.object({
7097
+ acceptedSequence: z4.number().int().nonnegative().optional(),
7098
+ resultEventIds: z4.array(ContractIdentifierSchema).default([]),
7099
+ operation: z4.object({
7065
7100
  lineage: AgentSessionLineageSchema,
7066
7101
  activeBranch: AgentSessionActiveBranchSchema
7067
7102
  }).strict().optional(),
7068
- termination: z3.enum(["requested", "confirmed"]).optional(),
7069
- error: z3.object({
7103
+ termination: z4.enum(["requested", "confirmed"]).optional(),
7104
+ error: z4.object({
7070
7105
  code: AgentSessionCommandErrorCodeSchema,
7071
- message: z3.string(),
7072
- retryable: z3.boolean()
7106
+ message: z4.string(),
7107
+ retryable: z4.boolean()
7073
7108
  }).strict().optional(),
7074
7109
  occurredAt: IsoDateTimeSchema
7075
7110
  }).strict().superRefine((value, context) => {
@@ -7132,13 +7167,13 @@ var AGENT_SESSION_COMMAND_TRANSITIONS = {
7132
7167
  "edit-and-rerun": {},
7133
7168
  steer: {}
7134
7169
  };
7135
- var AgentSessionCommandPolicySchema = z3.object({
7170
+ var AgentSessionCommandPolicySchema = z4.object({
7136
7171
  capability: AgentSessionCapabilitySchema.optional(),
7137
- allowedStatuses: z3.array(AgentSessionStatusSchema).min(1),
7138
- requiresRunId: z3.boolean(),
7139
- sourceSessionEffect: z3.enum(["transition", "preserve"]),
7140
- idempotencyScope: z3.literal("session-command"),
7141
- sequenceRule: z3.enum(["match-current", "target-run"])
7172
+ allowedStatuses: z4.array(AgentSessionStatusSchema).min(1),
7173
+ requiresRunId: z4.boolean(),
7174
+ sourceSessionEffect: z4.enum(["transition", "preserve"]),
7175
+ idempotencyScope: z4.literal("session-command"),
7176
+ sequenceRule: z4.enum(["match-current", "target-run"])
7142
7177
  }).strict();
7143
7178
  var sessionCommandPolicy = (policy) => AgentSessionCommandPolicySchema.parse(policy);
7144
7179
  var AGENT_SESSION_COMMAND_POLICIES = Object.freeze({
@@ -7230,150 +7265,150 @@ function canApplyAgentSessionRunStatus(current, next) {
7230
7265
  };
7231
7266
  return transitions[current].includes(next);
7232
7267
  }
7233
- var AgentSessionEventHeaderSchema = z3.object({
7234
- contract: z3.literal("AgentSessionEvent"),
7268
+ var AgentSessionEventHeaderSchema = z4.object({
7269
+ contract: z4.literal("AgentSessionEvent"),
7235
7270
  eventId: ContractIdentifierSchema,
7236
7271
  sessionId: ContractIdentifierSchema,
7237
7272
  runId: ContractIdentifierSchema.optional(),
7238
7273
  sourceMessageId: ContractIdentifierSchema.optional(),
7239
- sequence: z3.number().int().nonnegative(),
7274
+ sequence: z4.number().int().nonnegative(),
7240
7275
  idempotencyKey: ContractIdentifierSchema,
7241
7276
  occurredAt: IsoDateTimeSchema
7242
7277
  }).strict();
7243
7278
  var sessionEvent = (eventType, payload) => AgentSessionEventHeaderSchema.extend({
7244
- eventType: z3.literal(eventType),
7245
- payload: z3.object(payload).strict()
7279
+ eventType: z4.literal(eventType),
7280
+ payload: z4.object(payload).strict()
7246
7281
  }).strict();
7247
- var AgentSessionEventSchema = z3.discriminatedUnion("eventType", [
7282
+ var AgentSessionEventSchema = z4.discriminatedUnion("eventType", [
7248
7283
  sessionEvent("message", {
7249
7284
  messageId: ContractIdentifierSchema,
7250
- role: z3.enum(["user", "assistant", "system"]),
7251
- operation: z3.enum(["append", "replace"]).default("append"),
7252
- parts: z3.array(JsonValueSchema),
7253
- status: z3.enum(["streaming", "completed", "failed"]).optional()
7285
+ role: z4.enum(["user", "assistant", "system"]),
7286
+ operation: z4.enum(["append", "replace"]).default("append"),
7287
+ parts: z4.array(JsonValueSchema),
7288
+ status: z4.enum(["streaming", "completed", "failed"]).optional()
7254
7289
  }),
7255
7290
  sessionEvent("reasoning", {
7256
7291
  reasoningId: ContractIdentifierSchema,
7257
- text: z3.string(),
7258
- status: z3.enum(["streaming", "completed"])
7292
+ text: z4.string(),
7293
+ status: z4.enum(["streaming", "completed"])
7259
7294
  }),
7260
7295
  sessionEvent("plan", {
7261
7296
  planId: ContractIdentifierSchema,
7262
- title: z3.string().optional(),
7263
- status: z3.enum(["pending", "running", "completed", "failed"]),
7264
- steps: z3.array(
7265
- z3.object({
7297
+ title: z4.string().optional(),
7298
+ status: z4.enum(["pending", "running", "completed", "failed"]),
7299
+ steps: z4.array(
7300
+ z4.object({
7266
7301
  id: ContractIdentifierSchema,
7267
- title: z3.string(),
7268
- status: z3.enum(["pending", "running", "completed", "failed", "skipped"])
7302
+ title: z4.string(),
7303
+ status: z4.enum(["pending", "running", "completed", "failed", "skipped"])
7269
7304
  }).strict()
7270
7305
  )
7271
7306
  }),
7272
7307
  sessionEvent("task", {
7273
7308
  taskId: ContractIdentifierSchema,
7274
- title: z3.string(),
7275
- status: z3.enum(["pending", "running", "completed", "failed", "skipped"]),
7276
- detail: z3.string().optional()
7309
+ title: z4.string(),
7310
+ status: z4.enum(["pending", "running", "completed", "failed", "skipped"]),
7311
+ detail: z4.string().optional()
7277
7312
  }),
7278
7313
  sessionEvent("tool", {
7279
7314
  toolCallId: ContractIdentifierSchema,
7280
- toolName: z3.string().trim().min(1),
7281
- status: z3.enum(["pending", "running", "completed", "failed", "denied"]),
7315
+ toolName: z4.string().trim().min(1),
7316
+ status: z4.enum(["pending", "running", "completed", "failed", "denied"]),
7282
7317
  input: JsonValueSchema.optional(),
7283
7318
  output: JsonValueSchema.optional(),
7284
- error: z3.string().optional(),
7319
+ error: z4.string().optional(),
7285
7320
  startedAt: IsoDateTimeSchema.optional(),
7286
7321
  completedAt: IsoDateTimeSchema.optional()
7287
7322
  }),
7288
7323
  sessionEvent("approval", {
7289
7324
  approvalId: ContractIdentifierSchema,
7290
7325
  toolCallId: ContractIdentifierSchema.optional(),
7291
- status: z3.enum(["requested", "approved", "rejected", "expired"]),
7292
- title: z3.string(),
7293
- description: z3.string().optional(),
7326
+ status: z4.enum(["requested", "approved", "rejected", "expired"]),
7327
+ title: z4.string(),
7328
+ description: z4.string().optional(),
7294
7329
  requestedAction: JsonValueSchema.optional()
7295
7330
  }),
7296
7331
  sessionEvent("status", {
7297
7332
  status: AgentSessionStatusSchema,
7298
- detail: z3.string().optional(),
7333
+ detail: z4.string().optional(),
7299
7334
  startedAt: IsoDateTimeSchema.optional(),
7300
7335
  stoppingRequestedAt: IsoDateTimeSchema.optional(),
7301
7336
  stoppedAt: IsoDateTimeSchema.optional(),
7302
7337
  completedAt: IsoDateTimeSchema.optional(),
7303
7338
  failedAt: IsoDateTimeSchema.optional(),
7304
- durationMs: z3.number().nonnegative().optional()
7339
+ durationMs: z4.number().nonnegative().optional()
7305
7340
  }),
7306
7341
  sessionEvent("artifact", {
7307
7342
  artifactId: ContractIdentifierSchema,
7308
- name: z3.string().trim().min(1),
7309
- kind: z3.enum(["file", "image", "video", "audio", "web", "other"]),
7310
- status: z3.enum(["pending", "ready", "failed"]),
7311
- mimeType: z3.string().optional(),
7312
- url: z3.string().url().optional(),
7313
- size: z3.number().int().nonnegative().optional(),
7343
+ name: z4.string().trim().min(1),
7344
+ kind: z4.enum(["file", "image", "video", "audio", "web", "other"]),
7345
+ status: z4.enum(["pending", "ready", "failed"]),
7346
+ mimeType: z4.string().optional(),
7347
+ url: z4.string().url().optional(),
7348
+ size: z4.number().int().nonnegative().optional(),
7314
7349
  sourceEventId: ContractIdentifierSchema.optional()
7315
7350
  }),
7316
7351
  sessionEvent("usage", {
7317
- inputTokens: z3.number().int().nonnegative().optional(),
7318
- outputTokens: z3.number().int().nonnegative().optional(),
7319
- totalTokens: z3.number().int().nonnegative().optional(),
7320
- contextTokens: z3.number().int().nonnegative().optional(),
7321
- contextWindow: z3.number().int().positive().optional()
7352
+ inputTokens: z4.number().int().nonnegative().optional(),
7353
+ outputTokens: z4.number().int().nonnegative().optional(),
7354
+ totalTokens: z4.number().int().nonnegative().optional(),
7355
+ contextTokens: z4.number().int().nonnegative().optional(),
7356
+ contextWindow: z4.number().int().positive().optional()
7322
7357
  }),
7323
7358
  sessionEvent("resume", {
7324
- resumable: z3.boolean(),
7359
+ resumable: z4.boolean(),
7325
7360
  state: JsonObjectSchema.optional(),
7326
- reason: z3.string().optional()
7361
+ reason: z4.string().optional()
7327
7362
  }),
7328
7363
  sessionEvent("error", {
7329
- code: z3.string().trim().min(1),
7330
- message: z3.string(),
7331
- retryable: z3.boolean(),
7364
+ code: z4.string().trim().min(1),
7365
+ message: z4.string(),
7366
+ retryable: z4.boolean(),
7332
7367
  sourceEventId: ContractIdentifierSchema.optional(),
7333
7368
  details: JsonObjectSchema.optional()
7334
7369
  }),
7335
7370
  sessionEvent("diff", {
7336
- path: z3.string().trim().min(1),
7337
- status: z3.enum(["added", "modified", "deleted", "renamed"]),
7338
- patch: z3.string().optional()
7371
+ path: z4.string().trim().min(1),
7372
+ status: z4.enum(["added", "modified", "deleted", "renamed"]),
7373
+ patch: z4.string().optional()
7339
7374
  }),
7340
7375
  sessionEvent("workspace-file", {
7341
- path: z3.string().trim().min(1),
7342
- operation: z3.enum(["upsert", "delete"]),
7343
- mimeType: z3.string().optional(),
7344
- size: z3.number().int().nonnegative().optional()
7376
+ path: z4.string().trim().min(1),
7377
+ operation: z4.enum(["upsert", "delete"]),
7378
+ mimeType: z4.string().optional(),
7379
+ size: z4.number().int().nonnegative().optional()
7345
7380
  }),
7346
7381
  sessionEvent("terminal", {
7347
7382
  terminalId: ContractIdentifierSchema,
7348
- stream: z3.enum(["stdin", "stdout", "stderr", "status"]),
7349
- chunk: z3.string(),
7350
- exitCode: z3.number().int().optional()
7383
+ stream: z4.enum(["stdin", "stdout", "stderr", "status"]),
7384
+ chunk: z4.string(),
7385
+ exitCode: z4.number().int().optional()
7351
7386
  }),
7352
7387
  sessionEvent("test-result", {
7353
7388
  testId: ContractIdentifierSchema,
7354
- name: z3.string(),
7355
- status: z3.enum(["running", "passed", "failed", "skipped"]),
7356
- durationMs: z3.number().nonnegative().optional(),
7357
- output: z3.string().optional()
7389
+ name: z4.string(),
7390
+ status: z4.enum(["running", "passed", "failed", "skipped"]),
7391
+ durationMs: z4.number().nonnegative().optional(),
7392
+ output: z4.string().optional()
7358
7393
  }),
7359
7394
  sessionEvent("steer", {
7360
7395
  commandId: ContractIdentifierSchema,
7361
7396
  targetRunId: ContractIdentifierSchema,
7362
- text: z3.string().trim().min(1),
7363
- status: z3.enum(["accepted", "applied", "failed"]),
7364
- error: z3.object({
7397
+ text: z4.string().trim().min(1),
7398
+ status: z4.enum(["accepted", "applied", "failed"]),
7399
+ error: z4.object({
7365
7400
  code: AgentSessionCommandErrorCodeSchema,
7366
- message: z3.string(),
7367
- retryable: z3.boolean()
7401
+ message: z4.string(),
7402
+ retryable: z4.boolean()
7368
7403
  }).strict().optional()
7369
7404
  }),
7370
7405
  sessionEvent("summary", {
7371
7406
  summaryId: ContractIdentifierSchema,
7372
7407
  runId: ContractIdentifierSchema,
7373
- text: z3.string(),
7374
- highlights: z3.array(z3.string()),
7375
- pendingItems: z3.array(z3.string()),
7376
- status: z3.enum(["generating", "completed", "failed"])
7408
+ text: z4.string(),
7409
+ highlights: z4.array(z4.string()),
7410
+ pendingItems: z4.array(z4.string()),
7411
+ status: z4.enum(["generating", "completed", "failed"])
7377
7412
  })
7378
7413
  ]).superRefine((value, context) => {
7379
7414
  if (value.eventType === "steer") {
@@ -7429,14 +7464,14 @@ var AgentSessionRunEventSchema = AgentSessionEventSchema.superRefine((value, con
7429
7464
  });
7430
7465
  }
7431
7466
  });
7432
- var AgentSessionViewModelSchema = z3.object({
7433
- contract: z3.literal("AgentSessionViewModel"),
7467
+ var AgentSessionViewModelSchema = z4.object({
7468
+ contract: z4.literal("AgentSessionViewModel"),
7434
7469
  sessionId: ContractIdentifierSchema,
7435
7470
  snapshot: AgentSessionSnapshotSchema,
7436
7471
  status: AgentSessionStatusSchema,
7437
- events: z3.array(AgentSessionEventSchema),
7438
- lastSequence: z3.number().int().min(-1),
7439
- resumable: z3.boolean().default(false),
7472
+ events: z4.array(AgentSessionEventSchema),
7473
+ lastSequence: z4.number().int().min(-1),
7474
+ resumable: z4.boolean().default(false),
7440
7475
  lineage: AgentSessionLineageSchema.optional(),
7441
7476
  activeBranch: AgentSessionActiveBranchSchema.optional()
7442
7477
  }).strict().superRefine((value, context) => {
@@ -7485,55 +7520,55 @@ var AgentSessionViewModelSchema = z3.object({
7485
7520
  });
7486
7521
  }
7487
7522
  });
7488
- var AgentWorkbenchNavigationItemStatusSchema = z3.enum(["idle", "running", "completed", "error"]);
7489
- var AgentWorkbenchCollectionStatusSchema = z3.enum(["loading", "ready", "error"]);
7490
- var AgentWorkbenchAgentItemSchema = z3.object({
7523
+ var AgentWorkbenchNavigationItemStatusSchema = z4.enum(["idle", "running", "completed", "error"]);
7524
+ var AgentWorkbenchCollectionStatusSchema = z4.enum(["loading", "ready", "error"]);
7525
+ var AgentWorkbenchAgentItemSchema = z4.object({
7491
7526
  id: ContractIdentifierSchema,
7492
- name: z3.string().min(1),
7493
- description: z3.string().optional(),
7494
- iconUrl: z3.string().url().optional(),
7495
- builtIn: z3.boolean().default(false),
7496
- pinned: z3.boolean().default(false),
7497
- pinPending: z3.boolean().default(false)
7498
- }).strict();
7499
- var AgentWorkbenchSessionItemSchema = z3.object({
7527
+ name: z4.string().min(1),
7528
+ description: z4.string().optional(),
7529
+ iconUrl: z4.string().url().optional(),
7530
+ builtIn: z4.boolean().default(false),
7531
+ pinned: z4.boolean().default(false),
7532
+ pinPending: z4.boolean().default(false)
7533
+ }).strict();
7534
+ var AgentWorkbenchSessionItemSchema = z4.object({
7500
7535
  id: ContractIdentifierSchema,
7501
- title: z3.string().min(1),
7536
+ title: z4.string().min(1),
7502
7537
  updatedAt: IsoDateTimeSchema,
7503
- thumbnailUrl: z3.string().url().optional(),
7538
+ thumbnailUrl: z4.string().url().optional(),
7504
7539
  mode: AgentModeSchema.optional(),
7505
7540
  status: AgentWorkbenchNavigationItemStatusSchema.default("idle"),
7506
- pinned: z3.boolean().default(false),
7507
- contextUsage: z3.object({
7508
- usedTokens: z3.number().int().nonnegative(),
7509
- maxTokens: z3.number().int().positive()
7541
+ pinned: z4.boolean().default(false),
7542
+ contextUsage: z4.object({
7543
+ usedTokens: z4.number().int().nonnegative(),
7544
+ maxTokens: z4.number().int().positive()
7510
7545
  }).strict().optional()
7511
7546
  }).strict();
7512
- var AgentWorkbenchNavigationCapabilitiesSchema = z3.object({
7513
- createAgent: z3.boolean().default(false),
7514
- createSession: z3.boolean().default(true),
7515
- manageCapabilities: z3.boolean().default(false),
7516
- manageAgentSettings: z3.boolean().default(false),
7517
- pinAgents: z3.boolean().default(false),
7518
- pinSessions: z3.boolean().default(false),
7519
- renameSessions: z3.boolean().default(false),
7520
- deleteSessions: z3.boolean().default(false)
7521
- }).strict();
7522
- var AgentWorkbenchNavigationViewModelSchema = z3.object({
7523
- contract: z3.literal("AgentWorkbenchNavigationViewModel"),
7524
- activeTab: z3.enum(["agents", "sessions"]).default("sessions"),
7525
- searchQuery: z3.string().default(""),
7547
+ var AgentWorkbenchNavigationCapabilitiesSchema = z4.object({
7548
+ createAgent: z4.boolean().default(false),
7549
+ createSession: z4.boolean().default(true),
7550
+ manageCapabilities: z4.boolean().default(false),
7551
+ manageAgentSettings: z4.boolean().default(false),
7552
+ pinAgents: z4.boolean().default(false),
7553
+ pinSessions: z4.boolean().default(false),
7554
+ renameSessions: z4.boolean().default(false),
7555
+ deleteSessions: z4.boolean().default(false)
7556
+ }).strict();
7557
+ var AgentWorkbenchNavigationViewModelSchema = z4.object({
7558
+ contract: z4.literal("AgentWorkbenchNavigationViewModel"),
7559
+ activeTab: z4.enum(["agents", "sessions"]).default("sessions"),
7560
+ searchQuery: z4.string().default(""),
7526
7561
  selectedAgentItem: ContractIdentifierSchema.optional(),
7527
7562
  selectedSessionItem: ContractIdentifierSchema.optional(),
7528
- agents: z3.object({
7563
+ agents: z4.object({
7529
7564
  status: AgentWorkbenchCollectionStatusSchema,
7530
- items: z3.array(AgentWorkbenchAgentItemSchema),
7531
- error: z3.string().optional()
7565
+ items: z4.array(AgentWorkbenchAgentItemSchema),
7566
+ error: z4.string().optional()
7532
7567
  }).strict(),
7533
- sessions: z3.object({
7568
+ sessions: z4.object({
7534
7569
  status: AgentWorkbenchCollectionStatusSchema,
7535
- items: z3.array(AgentWorkbenchSessionItemSchema),
7536
- error: z3.string().optional()
7570
+ items: z4.array(AgentWorkbenchSessionItemSchema),
7571
+ error: z4.string().optional()
7537
7572
  }).strict(),
7538
7573
  capabilities: AgentWorkbenchNavigationCapabilitiesSchema
7539
7574
  }).strict().superRefine((value, context) => {
@@ -7549,44 +7584,44 @@ var AgentWorkbenchNavigationViewModelSchema = z3.object({
7549
7584
  validateCollection(value.agents, "agents");
7550
7585
  validateCollection(value.sessions, "sessions");
7551
7586
  });
7552
- var AgentWorkbenchComposerStatusSchema = z3.enum([
7587
+ var AgentWorkbenchComposerStatusSchema = z4.enum([
7553
7588
  "idle",
7554
7589
  "loading",
7555
7590
  "streaming",
7556
7591
  "stopping",
7557
7592
  "error"
7558
7593
  ]);
7559
- var AgentWorkbenchComposerAttachmentSchema = z3.object({
7594
+ var AgentWorkbenchComposerAttachmentSchema = z4.object({
7560
7595
  id: ContractIdentifierSchema,
7561
- name: z3.string().min(1),
7562
- mediaType: z3.string().min(1).optional(),
7563
- previewUrl: z3.string().min(1).optional(),
7564
- status: z3.enum(["uploading", "ready", "error"]).default("ready")
7596
+ name: z4.string().min(1),
7597
+ mediaType: z4.string().min(1).optional(),
7598
+ previewUrl: z4.string().min(1).optional(),
7599
+ status: z4.enum(["uploading", "ready", "error"]).default("ready")
7565
7600
  }).strict();
7566
- var AgentWorkbenchComposerQueueItemSchema = z3.object({
7601
+ var AgentWorkbenchComposerQueueItemSchema = z4.object({
7567
7602
  id: ContractIdentifierSchema,
7568
- text: z3.string(),
7569
- attachmentCount: z3.number().int().nonnegative().default(0),
7570
- status: z3.enum(["queued", "sending", "error"]).default("queued")
7603
+ text: z4.string(),
7604
+ attachmentCount: z4.number().int().nonnegative().default(0),
7605
+ status: z4.enum(["queued", "sending", "error"]).default("queued")
7571
7606
  }).strict();
7572
- var AgentWorkbenchComposerModelOptionSchema = z3.object({
7607
+ var AgentWorkbenchComposerModelOptionSchema = z4.object({
7573
7608
  id: ContractIdentifierSchema,
7574
- label: z3.string().min(1),
7575
- provider: z3.string().min(1).optional(),
7609
+ label: z4.string().min(1),
7610
+ provider: z4.string().min(1).optional(),
7576
7611
  mode: AgentModeSchema,
7577
- disabled: z3.boolean().default(false)
7578
- }).strict();
7579
- var AgentWorkbenchComposerCapabilitiesSchema = z3.object({
7580
- attachments: z3.boolean().default(false),
7581
- voiceInput: z3.boolean().default(false),
7582
- webSearch: z3.boolean().default(false),
7583
- modelSelection: z3.boolean().default(false),
7584
- reasoning: z3.boolean().default(false),
7585
- permissions: z3.boolean().default(false),
7586
- queue: z3.boolean().default(false),
7587
- stop: z3.boolean().default(false)
7588
- }).strict();
7589
- var AgentWorkbenchQuickStartIconSchema = z3.enum([
7612
+ disabled: z4.boolean().default(false)
7613
+ }).strict();
7614
+ var AgentWorkbenchComposerCapabilitiesSchema = z4.object({
7615
+ attachments: z4.boolean().default(false),
7616
+ voiceInput: z4.boolean().default(false),
7617
+ webSearch: z4.boolean().default(false),
7618
+ modelSelection: z4.boolean().default(false),
7619
+ reasoning: z4.boolean().default(false),
7620
+ permissions: z4.boolean().default(false),
7621
+ queue: z4.boolean().default(false),
7622
+ stop: z4.boolean().default(false)
7623
+ }).strict();
7624
+ var AgentWorkbenchQuickStartIconSchema = z4.enum([
7590
7625
  "sparkles",
7591
7626
  "palette",
7592
7627
  "search",
@@ -7594,55 +7629,55 @@ var AgentWorkbenchQuickStartIconSchema = z3.enum([
7594
7629
  "code",
7595
7630
  "shopping-bag"
7596
7631
  ]);
7597
- var AgentWorkbenchQuickStartTemplateActionSchema = z3.enum(["prompt", "upload"]);
7598
- var AgentWorkbenchQuickStartTemplateSchema = z3.object({
7632
+ var AgentWorkbenchQuickStartTemplateActionSchema = z4.enum(["prompt", "upload"]);
7633
+ var AgentWorkbenchQuickStartTemplateSchema = z4.object({
7599
7634
  id: ContractIdentifierSchema,
7600
- title: z3.string().min(1),
7601
- description: z3.string().min(1).optional(),
7602
- prompt: z3.string().min(1),
7635
+ title: z4.string().min(1),
7636
+ description: z4.string().min(1).optional(),
7637
+ prompt: z4.string().min(1),
7603
7638
  action: AgentWorkbenchQuickStartTemplateActionSchema.default("prompt"),
7604
7639
  icon: AgentWorkbenchQuickStartIconSchema.optional(),
7605
- coverImageUrl: z3.string().min(1).optional(),
7606
- accept: z3.string().min(1).default("*/*"),
7607
- multiple: z3.boolean().default(false),
7608
- modes: z3.array(AgentModeSchema).min(1).optional()
7640
+ coverImageUrl: z4.string().min(1).optional(),
7641
+ accept: z4.string().min(1).default("*/*"),
7642
+ multiple: z4.boolean().default(false),
7643
+ modes: z4.array(AgentModeSchema).min(1).optional()
7609
7644
  }).strict();
7610
- var AgentWorkbenchQuickStartSectionSchema = z3.object({
7645
+ var AgentWorkbenchQuickStartSectionSchema = z4.object({
7611
7646
  id: ContractIdentifierSchema,
7612
- label: z3.string().min(1),
7613
- templates: z3.array(AgentWorkbenchQuickStartTemplateSchema).min(1)
7647
+ label: z4.string().min(1),
7648
+ templates: z4.array(AgentWorkbenchQuickStartTemplateSchema).min(1)
7614
7649
  }).strict();
7615
- var AgentWorkbenchQuickStartCategorySchema = z3.object({
7650
+ var AgentWorkbenchQuickStartCategorySchema = z4.object({
7616
7651
  id: ContractIdentifierSchema,
7617
- label: z3.string().min(1),
7652
+ label: z4.string().min(1),
7618
7653
  icon: AgentWorkbenchQuickStartIconSchema.optional(),
7619
- sections: z3.array(AgentWorkbenchQuickStartSectionSchema).min(1)
7654
+ sections: z4.array(AgentWorkbenchQuickStartSectionSchema).min(1)
7620
7655
  }).strict();
7621
- var AgentWorkbenchQuickStartViewModelSchema = z3.object({
7622
- contract: z3.literal("AgentWorkbenchQuickStartViewModel"),
7656
+ var AgentWorkbenchQuickStartViewModelSchema = z4.object({
7657
+ contract: z4.literal("AgentWorkbenchQuickStartViewModel"),
7623
7658
  mode: AgentModeSchema,
7624
- categories: z3.array(AgentWorkbenchQuickStartCategorySchema).min(1),
7625
- disabled: z3.boolean().default(false)
7659
+ categories: z4.array(AgentWorkbenchQuickStartCategorySchema).min(1),
7660
+ disabled: z4.boolean().default(false)
7626
7661
  }).strict();
7627
- var AgentWorkbenchComposerViewModelSchema = z3.object({
7628
- contract: z3.literal("AgentWorkbenchComposerViewModel"),
7629
- value: z3.string().default(""),
7662
+ var AgentWorkbenchComposerViewModelSchema = z4.object({
7663
+ contract: z4.literal("AgentWorkbenchComposerViewModel"),
7664
+ value: z4.string().default(""),
7630
7665
  status: AgentWorkbenchComposerStatusSchema.default("idle"),
7631
7666
  mode: AgentModeSchema,
7632
- placeholder: z3.string().optional(),
7633
- attachments: z3.array(AgentWorkbenchComposerAttachmentSchema).default([]),
7634
- queuedDrafts: z3.array(AgentWorkbenchComposerQueueItemSchema).default([]),
7635
- model: z3.object({
7667
+ placeholder: z4.string().optional(),
7668
+ attachments: z4.array(AgentWorkbenchComposerAttachmentSchema).default([]),
7669
+ queuedDrafts: z4.array(AgentWorkbenchComposerQueueItemSchema).default([]),
7670
+ model: z4.object({
7636
7671
  selectedId: ContractIdentifierSchema.optional(),
7637
- options: z3.array(AgentWorkbenchComposerModelOptionSchema)
7672
+ options: z4.array(AgentWorkbenchComposerModelOptionSchema)
7638
7673
  }).strict(),
7639
- reasoning: z3.object({
7640
- value: z3.enum(["low", "medium", "high", "xhigh"]),
7641
- options: z3.array(z3.enum(["low", "medium", "high", "xhigh"])).min(1)
7674
+ reasoning: z4.object({
7675
+ value: z4.enum(["low", "medium", "high", "xhigh"]),
7676
+ options: z4.array(z4.enum(["low", "medium", "high", "xhigh"])).min(1)
7642
7677
  }).strict().optional(),
7643
7678
  permissionProfile: AgentSessionPermissionProfileSchema.optional(),
7644
- webSearchEnabled: z3.boolean().default(false),
7645
- error: z3.string().optional(),
7679
+ webSearchEnabled: z4.boolean().default(false),
7680
+ error: z4.string().optional(),
7646
7681
  capabilities: AgentWorkbenchComposerCapabilitiesSchema
7647
7682
  }).strict().superRefine((value, context) => {
7648
7683
  if (value.status === "error" && !value.error) {
@@ -7673,12 +7708,12 @@ var normalizeAgentMode = normalizeStudioAgentMode;
7673
7708
  var normalizeAgentExecutionMode = normalizeStudioAgentMode;
7674
7709
 
7675
7710
  // src/contracts/capability.ts
7676
- import { z as z5 } from "zod";
7711
+ import { z as z6 } from "zod";
7677
7712
 
7678
7713
  // src/contracts/render.ts
7679
- import { z as z4 } from "zod";
7680
- var ProductContextSchema = z4.enum(["studio", "kernel", "compute"]);
7681
- var RenderNodeStateSchema = z4.enum([
7714
+ import { z as z5 } from "zod";
7715
+ var ProductContextSchema = z5.enum(["studio", "kernel", "compute"]);
7716
+ var RenderNodeStateSchema = z5.enum([
7682
7717
  "idle",
7683
7718
  "loading",
7684
7719
  "empty",
@@ -7687,7 +7722,7 @@ var RenderNodeStateSchema = z4.enum([
7687
7722
  "disabled",
7688
7723
  "selected"
7689
7724
  ]);
7690
- var RenderNodeKindSchema = z4.enum([
7725
+ var RenderNodeKindSchema = z5.enum([
7691
7726
  "shell",
7692
7727
  "page",
7693
7728
  "navigation",
@@ -7699,16 +7734,16 @@ var RenderNodeKindSchema = z4.enum([
7699
7734
  "overlay",
7700
7735
  "professional-provider"
7701
7736
  ]);
7702
- var RenderSurfaceSchema = z4.object({
7703
- frameOwner: z4.enum(["host", "provider", "none"]),
7737
+ var RenderSurfaceSchema = z5.object({
7738
+ frameOwner: z5.enum(["host", "provider", "none"]),
7704
7739
  tone: ContractIdentifierSchema.optional(),
7705
- density: z4.enum(["compact", "default", "comfortable"])
7740
+ density: z5.enum(["compact", "default", "comfortable"])
7706
7741
  }).strict();
7707
- var RenderScrollSchema = z4.object({
7708
- owner: z4.enum(["page", "surface", "provider"]),
7709
- axis: z4.enum(["x", "y", "both", "none"]),
7742
+ var RenderScrollSchema = z5.object({
7743
+ owner: z5.enum(["page", "surface", "provider"]),
7744
+ axis: z5.enum(["x", "y", "both", "none"]),
7710
7745
  restoreKey: ContractIdentifierSchema.optional(),
7711
- virtualizationBoundary: z4.boolean()
7746
+ virtualizationBoundary: z5.boolean()
7712
7747
  }).strict().superRefine((scroll, context) => {
7713
7748
  if (scroll.owner === "provider" && scroll.restoreKey) {
7714
7749
  context.addIssue({
@@ -7725,11 +7760,11 @@ var RenderScrollSchema = z4.object({
7725
7760
  });
7726
7761
  }
7727
7762
  });
7728
- var RenderActivationSchema = z4.object({
7763
+ var RenderActivationSchema = z5.object({
7729
7764
  activationId: ContractIdentifierSchema,
7730
- mode: z4.enum(["navigate", "select", "drawer", "modal", "fullscreen", "inline"]),
7731
- targetPath: z4.string().trim().regex(/^\/(?!\/)/, "Expected an application-relative path.").optional(),
7732
- history: z4.enum(["push", "replace"]).optional()
7765
+ mode: z5.enum(["navigate", "select", "drawer", "modal", "fullscreen", "inline"]),
7766
+ targetPath: z5.string().trim().regex(/^\/(?!\/)/, "Expected an application-relative path.").optional(),
7767
+ history: z5.enum(["push", "replace"]).optional()
7733
7768
  }).strict().superRefine((activation, context) => {
7734
7769
  if (activation.mode === "navigate" && !activation.targetPath) {
7735
7770
  context.addIssue({ code: "custom", path: ["targetPath"], message: "Navigate activation requires an application-relative targetPath." });
@@ -7738,19 +7773,19 @@ var RenderActivationSchema = z4.object({
7738
7773
  context.addIssue({ code: "custom", path: ["targetPath"], message: "Only navigate activation may declare targetPath." });
7739
7774
  }
7740
7775
  });
7741
- var RenderLifecycleSchema = z4.object({
7742
- mountPolicy: z4.enum(["always", "when-visible", "when-active"]),
7743
- queryPolicy: z4.enum(["always", "when-visible", "when-active", "manual"]),
7744
- retainOnDeactivate: z4.boolean(),
7745
- deepLink: z4.boolean(),
7746
- focusReturn: z4.boolean()
7747
- }).strict();
7748
- var RenderLayoutSchema = z4.object({
7749
- mode: z4.enum(["contents", "block", "flex", "grid", "absolute"]),
7750
- direction: z4.enum(["row", "column"]).optional(),
7751
- columns: z4.number().int().positive().optional(),
7752
- align: z4.enum(["start", "center", "end", "stretch"]).optional(),
7753
- justify: z4.enum(["start", "center", "end", "between", "around"]).optional(),
7776
+ var RenderLifecycleSchema = z5.object({
7777
+ mountPolicy: z5.enum(["always", "when-visible", "when-active"]),
7778
+ queryPolicy: z5.enum(["always", "when-visible", "when-active", "manual"]),
7779
+ retainOnDeactivate: z5.boolean(),
7780
+ deepLink: z5.boolean(),
7781
+ focusReturn: z5.boolean()
7782
+ }).strict();
7783
+ var RenderLayoutSchema = z5.object({
7784
+ mode: z5.enum(["contents", "block", "flex", "grid", "absolute"]),
7785
+ direction: z5.enum(["row", "column"]).optional(),
7786
+ columns: z5.number().int().positive().optional(),
7787
+ align: z5.enum(["start", "center", "end", "stretch"]).optional(),
7788
+ justify: z5.enum(["start", "center", "end", "between", "around"]).optional(),
7754
7789
  gapTokenRef: EntityRefSchema.optional()
7755
7790
  }).strict().superRefine((layout, context) => {
7756
7791
  if (layout.direction && layout.mode !== "flex") {
@@ -7763,9 +7798,9 @@ var RenderLayoutSchema = z4.object({
7763
7798
  context.addIssue({ code: "custom", path: ["gapTokenRef", "kind"], message: "gapTokenRef must reference design-token." });
7764
7799
  }
7765
7800
  });
7766
- var RenderResponsiveRuleSchema = z4.object({
7767
- minWidthPx: z4.number().nonnegative().optional(),
7768
- maxWidthPx: z4.number().positive().optional(),
7801
+ var RenderResponsiveRuleSchema = z5.object({
7802
+ minWidthPx: z5.number().nonnegative().optional(),
7803
+ maxWidthPx: z5.number().positive().optional(),
7769
7804
  layout: RenderLayoutSchema
7770
7805
  }).strict().superRefine((rule, context) => {
7771
7806
  if (rule.minWidthPx === void 0 && rule.maxWidthPx === void 0) {
@@ -7803,14 +7838,14 @@ var requirePinnedOwnedRef = (reference, expectedKind, path, context) => {
7803
7838
  });
7804
7839
  }
7805
7840
  };
7806
- var RenderNodeSchema = z4.object({
7807
- contract: z4.literal("RenderNode"),
7841
+ var RenderNodeSchema = z5.object({
7842
+ contract: z5.literal("RenderNode"),
7808
7843
  nodeId: ContractIdentifierSchema,
7809
7844
  kind: RenderNodeKindSchema,
7810
7845
  version: ContractVersionSchema,
7811
7846
  ownerRepo: ContractIdentifierSchema,
7812
7847
  parentNodeId: ContractIdentifierSchema.optional(),
7813
- children: z4.array(ContractIdentifierSchema),
7848
+ children: z5.array(ContractIdentifierSchema),
7814
7849
  slot: ContractIdentifierSchema.optional(),
7815
7850
  pageRef: EntityRefSchema,
7816
7851
  semanticRef: EntityRefSchema.optional(),
@@ -7823,7 +7858,7 @@ var RenderNodeSchema = z4.object({
7823
7858
  activation: RenderActivationSchema,
7824
7859
  lifecycle: RenderLifecycleSchema,
7825
7860
  layout: RenderLayoutSchema,
7826
- responsive: z4.array(RenderResponsiveRuleSchema),
7861
+ responsive: z5.array(RenderResponsiveRuleSchema),
7827
7862
  accessRef: EntityRefSchema.optional(),
7828
7863
  evidenceRef: EntityRefSchema.optional(),
7829
7864
  state: RenderNodeStateSchema,
@@ -7855,39 +7890,39 @@ var RenderNodeSchema = z4.object({
7855
7890
  });
7856
7891
  }
7857
7892
  });
7858
- var RenderTreeSchema = z4.object({
7859
- contract: z4.literal("RenderTree"),
7893
+ var RenderTreeSchema = z5.object({
7894
+ contract: z5.literal("RenderTree"),
7860
7895
  treeId: ContractIdentifierSchema,
7861
7896
  product: ProductContextSchema,
7862
7897
  rootNodeId: ContractIdentifierSchema,
7863
- nodes: z4.array(RenderNodeSchema).min(1)
7898
+ nodes: z5.array(RenderNodeSchema).min(1)
7864
7899
  }).strict();
7865
- var OverlayZIndexLaneSchema = z4.enum([
7900
+ var OverlayZIndexLaneSchema = z5.enum([
7866
7901
  "popover",
7867
7902
  "drawer",
7868
7903
  "modal",
7869
7904
  "fullscreen",
7870
7905
  "system"
7871
7906
  ]);
7872
- var OverlayNodeSchema = z4.object({
7873
- contract: z4.literal("OverlayNode"),
7907
+ var OverlayNodeSchema = z5.object({
7908
+ contract: z5.literal("OverlayNode"),
7874
7909
  overlayId: ContractIdentifierSchema,
7875
7910
  renderNode: RenderNodeSchema,
7876
- presentation: z4.enum(["drawer", "modal", "fullscreen"]),
7911
+ presentation: z5.enum(["drawer", "modal", "fullscreen"]),
7877
7912
  zIndexLane: OverlayZIndexLaneSchema,
7878
- url: z4.object({
7913
+ url: z5.object({
7879
7914
  parameter: ContractIdentifierSchema,
7880
7915
  value: ContractIdentifierSchema,
7881
- openMode: z4.enum(["push", "replace"]),
7882
- closeMode: z4.enum(["back", "replace"])
7916
+ openMode: z5.enum(["push", "replace"]),
7917
+ closeMode: z5.enum(["back", "replace"])
7883
7918
  }).strict(),
7884
- focus: z4.object({
7885
- initial: z4.enum(["first-interactive", "container", "explicit"]),
7886
- trap: z4.boolean()
7919
+ focus: z5.object({
7920
+ initial: z5.enum(["first-interactive", "container", "explicit"]),
7921
+ trap: z5.boolean()
7887
7922
  }).strict(),
7888
- close: z4.object({
7889
- escape: z4.boolean(),
7890
- backdrop: z4.boolean()
7923
+ close: z5.object({
7924
+ escape: z5.boolean(),
7925
+ backdrop: z5.boolean()
7891
7926
  }).strict()
7892
7927
  }).strict().superRefine((value, context) => {
7893
7928
  if (value.renderNode.kind !== "overlay") {
@@ -7926,8 +7961,8 @@ var OverlayNodeSchema = z4.object({
7926
7961
  });
7927
7962
  }
7928
7963
  });
7929
- var ProductPathSchema = z4.string().trim().regex(/^\/(?!\/)/, "Expected an application-relative path.");
7930
- var ApplicationHandoffEndpointSchema = z4.object({
7964
+ var ProductPathSchema = z5.string().trim().regex(/^\/(?!\/)/, "Expected an application-relative path.");
7965
+ var ApplicationHandoffEndpointSchema = z5.object({
7931
7966
  product: ProductContextSchema,
7932
7967
  pageId: ContractIdentifierSchema,
7933
7968
  viewId: ContractIdentifierSchema.optional(),
@@ -7936,8 +7971,8 @@ var ApplicationHandoffEndpointSchema = z4.object({
7936
7971
  activationId: ContractIdentifierSchema.optional(),
7937
7972
  path: ProductPathSchema
7938
7973
  }).strict();
7939
- var ApplicationHandoffSchema = z4.object({
7940
- contract: z4.literal("ApplicationHandoff"),
7974
+ var ApplicationHandoffSchema = z5.object({
7975
+ contract: z5.literal("ApplicationHandoff"),
7941
7976
  handoffId: ContractIdentifierSchema,
7942
7977
  source: ApplicationHandoffEndpointSchema,
7943
7978
  target: ApplicationHandoffEndpointSchema,
@@ -7953,8 +7988,8 @@ var ApplicationHandoffSchema = z4.object({
7953
7988
  });
7954
7989
  }
7955
7990
  });
7956
- var ViewProviderDescriptorSchema = z4.object({
7957
- contract: z4.literal("ViewProviderDescriptor"),
7991
+ var ViewProviderDescriptorSchema = z5.object({
7992
+ contract: z5.literal("ViewProviderDescriptor"),
7958
7993
  providerId: ContractIdentifierSchema,
7959
7994
  providerVersion: ContractIdentifierSchema,
7960
7995
  ownerRepo: ContractIdentifierSchema,
@@ -7962,22 +7997,22 @@ var ViewProviderDescriptorSchema = z4.object({
7962
7997
  rendererKey: ContractIdentifierSchema,
7963
7998
  renderModelSchemaRef: ContractIdentifierSchema,
7964
7999
  intentSchemaRef: ContractIdentifierSchema.optional(),
7965
- loading: z4.enum(["eager", "lazy", "viewport", "on-activation"]),
7966
- stateOwner: z4.enum(["host", "provider", "external"]),
7967
- supportedPageTypes: z4.array(ContractIdentifierSchema).min(1),
7968
- supportedSurfaces: z4.array(z4.enum(["page", "workspace", "view", "record", "action", "overlay", "agent"])).min(1),
7969
- frameOwner: z4.enum(["host", "provider", "none"]),
7970
- sideEffects: z4.array(z4.enum(["network", "storage", "navigation", "worker", "websocket"])),
8000
+ loading: z5.enum(["eager", "lazy", "viewport", "on-activation"]),
8001
+ stateOwner: z5.enum(["host", "provider", "external"]),
8002
+ supportedPageTypes: z5.array(ContractIdentifierSchema).min(1),
8003
+ supportedSurfaces: z5.array(z5.enum(["page", "workspace", "view", "record", "action", "overlay", "agent"])).min(1),
8004
+ frameOwner: z5.enum(["host", "provider", "none"]),
8005
+ sideEffects: z5.array(z5.enum(["network", "storage", "navigation", "worker", "websocket"])),
7971
8006
  sideEffectAdapterRef: EntityRefSchema.optional(),
7972
- lifecycle: z4.object({
7973
- preserveMount: z4.boolean(),
7974
- preserveScroll: z4.boolean(),
8007
+ lifecycle: z5.object({
8008
+ preserveMount: z5.boolean(),
8009
+ preserveScroll: z5.boolean(),
7975
8010
  focusModel: ContractIdentifierSchema
7976
8011
  }).strict(),
7977
- performance: z4.object({
7978
- lazy: z4.boolean(),
7979
- virtualized: z4.boolean(),
7980
- budgetMs: z4.number().positive().optional()
8012
+ performance: z5.object({
8013
+ lazy: z5.boolean(),
8014
+ virtualized: z5.boolean(),
8015
+ budgetMs: z5.number().positive().optional()
7981
8016
  }).strict(),
7982
8017
  accessRef: EntityRefSchema.optional(),
7983
8018
  evidenceRef: EntityRefSchema.optional()
@@ -8009,54 +8044,54 @@ var ViewProviderDescriptorSchema = z4.object({
8009
8044
  });
8010
8045
 
8011
8046
  // src/contracts/capability.ts
8012
- var ContractPortSchema = z5.object({
8047
+ var ContractPortSchema = z6.object({
8013
8048
  name: ContractIdentifierSchema,
8014
8049
  schemaRef: ContractIdentifierSchema,
8015
- required: z5.boolean().default(false),
8016
- multiple: z5.boolean().default(false),
8017
- description: z5.string().optional()
8050
+ required: z6.boolean().default(false),
8051
+ multiple: z6.boolean().default(false),
8052
+ description: z6.string().optional()
8018
8053
  }).strict();
8019
- var CapabilityProviderBindingSchema = z5.object({
8054
+ var CapabilityProviderBindingSchema = z6.object({
8020
8055
  providerRef: EntityRefSchema,
8021
- productContexts: z5.array(ProductContextSchema).default([]),
8022
- priority: z5.number().int().default(0)
8056
+ productContexts: z6.array(ProductContextSchema).default([]),
8057
+ priority: z6.number().int().default(0)
8023
8058
  }).strict();
8024
- var CapabilityManifestSchema = z5.object({
8025
- contract: z5.literal("CapabilityManifest"),
8059
+ var CapabilityManifestSchema = z6.object({
8060
+ contract: z6.literal("CapabilityManifest"),
8026
8061
  id: ContractIdentifierSchema,
8027
8062
  capabilityVersion: ContractIdentifierSchema,
8028
8063
  ownerRepo: ContractIdentifierSchema,
8029
- kind: z5.enum(["primitive", "composite", "view", "professional-provider", "tool", "workflow"]),
8030
- displayName: z5.string().trim().min(1),
8031
- description: z5.string().optional(),
8032
- ports: z5.object({
8033
- inputs: z5.array(ContractPortSchema).default([]),
8034
- outputs: z5.array(ContractPortSchema).default([])
8064
+ kind: z6.enum(["primitive", "composite", "view", "professional-provider", "tool", "workflow"]),
8065
+ displayName: z6.string().trim().min(1),
8066
+ description: z6.string().optional(),
8067
+ ports: z6.object({
8068
+ inputs: z6.array(ContractPortSchema).default([]),
8069
+ outputs: z6.array(ContractPortSchema).default([])
8035
8070
  }).strict(),
8036
- runtime: z5.object({
8037
- providerBindings: z5.array(CapabilityProviderBindingSchema).min(1),
8038
- loading: z5.enum(["eager", "lazy", "viewport", "on-activation"]),
8071
+ runtime: z6.object({
8072
+ providerBindings: z6.array(CapabilityProviderBindingSchema).min(1),
8073
+ loading: z6.enum(["eager", "lazy", "viewport", "on-activation"]),
8039
8074
  fallbackCapabilityRef: EntityRefSchema.optional(),
8040
- stateOwner: z5.enum(["host", "provider", "external"]),
8075
+ stateOwner: z6.enum(["host", "provider", "external"]),
8041
8076
  stateSchemaRef: ContractIdentifierSchema.optional(),
8042
- sideEffects: z5.array(z5.enum(["network", "storage", "navigation", "worker", "websocket"])).default([])
8077
+ sideEffects: z6.array(z6.enum(["network", "storage", "navigation", "worker", "websocket"])).default([])
8043
8078
  }).strict(),
8044
- placement: z5.object({
8045
- surfaces: z5.array(ContractIdentifierSchema).min(1),
8046
- slots: z5.array(ContractIdentifierSchema).default([]),
8047
- variants: z5.array(ContractIdentifierSchema).default([]),
8048
- tokenRefs: z5.array(ContractIdentifierSchema).default([])
8079
+ placement: z6.object({
8080
+ surfaces: z6.array(ContractIdentifierSchema).min(1),
8081
+ slots: z6.array(ContractIdentifierSchema).default([]),
8082
+ variants: z6.array(ContractIdentifierSchema).default([]),
8083
+ tokenRefs: z6.array(ContractIdentifierSchema).default([])
8049
8084
  }).strict(),
8050
- accessibility: z5.object({
8085
+ accessibility: z6.object({
8051
8086
  keyboardModel: ContractIdentifierSchema,
8052
8087
  focusModel: ContractIdentifierSchema,
8053
8088
  labelContract: ContractIdentifierSchema
8054
8089
  }).strict(),
8055
- observability: z5.object({
8090
+ observability: z6.object({
8056
8091
  eventNamespace: ContractIdentifierSchema,
8057
- metrics: z5.array(ContractIdentifierSchema).default([]),
8058
- evidenceRefs: z5.array(ContractIdentifierSchema).default([]),
8059
- performanceBudgetMs: z5.number().positive().optional()
8092
+ metrics: z6.array(ContractIdentifierSchema).default([]),
8093
+ evidenceRefs: z6.array(ContractIdentifierSchema).default([]),
8094
+ performanceBudgetMs: z6.number().positive().optional()
8060
8095
  }).strict()
8061
8096
  }).strict().superRefine((manifest, context) => {
8062
8097
  const providerIds = /* @__PURE__ */ new Set();
@@ -8078,25 +8113,25 @@ var CapabilityManifestSchema = z5.object({
8078
8113
  }
8079
8114
  });
8080
8115
  });
8081
- var CapabilitySourceTypeSchema = z5.enum([
8116
+ var CapabilitySourceTypeSchema = z6.enum([
8082
8117
  "tool-manifest",
8083
8118
  "plugin-manifest",
8084
8119
  "openapi",
8085
8120
  "workflow",
8086
8121
  "comfyui"
8087
8122
  ]);
8088
- var CapabilityRegistrySourceSchema = z5.object({
8123
+ var CapabilityRegistrySourceSchema = z6.object({
8089
8124
  sourceType: CapabilitySourceTypeSchema,
8090
8125
  sourceId: ContractIdentifierSchema,
8091
8126
  ownerRepo: ContractIdentifierSchema
8092
8127
  }).strict();
8093
- var CapabilityRegistryEntrySchema = z5.object({
8128
+ var CapabilityRegistryEntrySchema = z6.object({
8094
8129
  manifest: CapabilityManifestSchema,
8095
- sources: z5.array(CapabilityRegistrySourceSchema).min(1)
8130
+ sources: z6.array(CapabilityRegistrySourceSchema).min(1)
8096
8131
  }).strict();
8097
- var CapabilityRegistryDocumentSchema = z5.object({
8098
- contract: z5.literal("CapabilityRegistry"),
8099
- entries: z5.array(CapabilityRegistryEntrySchema)
8132
+ var CapabilityRegistryDocumentSchema = z6.object({
8133
+ contract: z6.literal("CapabilityRegistry"),
8134
+ entries: z6.array(CapabilityRegistryEntrySchema)
8100
8135
  }).strict().superRefine((registry, context) => {
8101
8136
  const ids = /* @__PURE__ */ new Set();
8102
8137
  registry.entries.forEach((entry, index) => {
@@ -8112,38 +8147,38 @@ var CapabilityRegistryDocumentSchema = z5.object({
8112
8147
  });
8113
8148
 
8114
8149
  // src/contracts/context.ts
8115
- import { z as z6 } from "zod";
8116
- var ActorRefSchema = z6.object({
8117
- kind: z6.enum(["human", "agent", "service", "tenant", "public"]),
8150
+ import { z as z7 } from "zod";
8151
+ var ActorRefSchema = z7.object({
8152
+ kind: z7.enum(["human", "agent", "service", "tenant", "public"]),
8118
8153
  id: ContractIdentifierSchema.optional(),
8119
8154
  userId: ContractIdentifierSchema.optional(),
8120
8155
  agentId: ContractIdentifierSchema.optional(),
8121
8156
  serviceId: ContractIdentifierSchema.optional()
8122
8157
  }).strict();
8123
- var AuthorityScopeSchema = z6.object({
8158
+ var AuthorityScopeSchema = z7.object({
8124
8159
  resource: ContractIdentifierSchema,
8125
- actions: z6.array(ContractIdentifierSchema).min(1),
8126
- constraints: z6.record(z6.string(), JsonValueSchema).optional()
8160
+ actions: z7.array(ContractIdentifierSchema).min(1),
8161
+ constraints: z7.record(z7.string(), JsonValueSchema).optional()
8127
8162
  }).strict();
8128
- var RequestScopeSchema = z6.object({
8129
- contract: z6.literal("RequestScope"),
8163
+ var RequestScopeSchema = z7.object({
8164
+ contract: z7.literal("RequestScope"),
8130
8165
  requestId: ContractIdentifierSchema,
8131
8166
  traceId: ContractIdentifierSchema.optional(),
8132
8167
  appId: ContractIdentifierSchema,
8133
8168
  tenantId: ContractIdentifierSchema.optional(),
8134
8169
  teamId: ContractIdentifierSchema.optional(),
8135
8170
  actor: ActorRefSchema,
8136
- session: z6.object({
8171
+ session: z7.object({
8137
8172
  authType: ContractIdentifierSchema,
8138
- authenticated: z6.boolean(),
8139
- membershipVerified: z6.boolean()
8173
+ authenticated: z7.boolean(),
8174
+ membershipVerified: z7.boolean()
8140
8175
  }).strict(),
8141
- permissionCodes: z6.array(ContractIdentifierSchema).default([]),
8142
- authority: z6.array(AuthorityScopeSchema).default([]),
8176
+ permissionCodes: z7.array(ContractIdentifierSchema).default([]),
8177
+ authority: z7.array(AuthorityScopeSchema).default([]),
8143
8178
  issuedAt: IsoDateTimeSchema
8144
8179
  }).strict();
8145
- var ExecutionLinkSchema = z6.object({
8146
- contract: z6.literal("ExecutionLink"),
8180
+ var ExecutionLinkSchema = z7.object({
8181
+ contract: z7.literal("ExecutionLink"),
8147
8182
  requestId: ContractIdentifierSchema,
8148
8183
  traceId: ContractIdentifierSchema.optional(),
8149
8184
  correlationId: ContractIdentifierSchema.optional(),
@@ -8153,43 +8188,43 @@ var ExecutionLinkSchema = z6.object({
8153
8188
  taskRef: EntityRefSchema.optional(),
8154
8189
  parentRunRef: EntityRefSchema.optional()
8155
8190
  }).strict();
8156
- var CompletionHeaderSchema = z6.object({
8157
- contract: z6.literal("CompletionHeader"),
8191
+ var CompletionHeaderSchema = z7.object({
8192
+ contract: z7.literal("CompletionHeader"),
8158
8193
  eventId: ContractIdentifierSchema,
8159
8194
  runtimeEventId: ContractIdentifierSchema,
8160
8195
  idempotencyKey: ContractIdentifierSchema,
8161
- sequence: z6.number().int().nonnegative(),
8196
+ sequence: z7.number().int().nonnegative(),
8162
8197
  execution: ExecutionLinkSchema,
8163
- producer: z6.object({
8198
+ producer: z7.object({
8164
8199
  service: ContractIdentifierSchema,
8165
8200
  runtime: ContractIdentifierSchema,
8166
8201
  version: ContractIdentifierSchema
8167
8202
  }).strict(),
8168
- status: z6.enum(["SUCCEEDED", "FAILED", "CANCELLED", "TIMED_OUT"]),
8203
+ status: z7.enum(["SUCCEEDED", "FAILED", "CANCELLED", "TIMED_OUT"]),
8169
8204
  occurredAt: IsoDateTimeSchema,
8170
8205
  payloadSchemaRef: ContractIdentifierSchema.optional()
8171
8206
  }).strict();
8172
- var CompletionEventSchema = z6.object({
8207
+ var CompletionEventSchema = z7.object({
8173
8208
  header: CompletionHeaderSchema,
8174
8209
  payload: JsonValueSchema.optional()
8175
8210
  }).strict();
8176
- var AgentRuntimeEventSchema = z6.object({
8177
- contract: z6.literal("AgentRuntimeEvent"),
8211
+ var AgentRuntimeEventSchema = z7.object({
8212
+ contract: z7.literal("AgentRuntimeEvent"),
8178
8213
  runtimeEventId: ContractIdentifierSchema,
8179
8214
  streamId: ContractIdentifierSchema,
8180
- sequence: z6.number().int().nonnegative(),
8215
+ sequence: z7.number().int().nonnegative(),
8181
8216
  requestId: ContractIdentifierSchema,
8182
8217
  teamId: ContractIdentifierSchema,
8183
8218
  threadId: ContractIdentifierSchema.optional(),
8184
- eventType: z6.enum(["messages:append", "messages:update", "thread:update", "tool-call:upsert", "session:event"]),
8219
+ eventType: z7.enum(["messages:append", "messages:update", "thread:update", "tool-call:upsert", "session:event"]),
8185
8220
  payload: JsonValueSchema,
8186
8221
  occurredAt: IsoDateTimeSchema
8187
8222
  }).strict();
8188
8223
 
8189
8224
  // src/contracts/continuity.ts
8190
- import { z as z7 } from "zod";
8191
- var DataContinuityEnvelopeSchema = z7.object({
8192
- contract: z7.literal("DataContinuityEnvelope"),
8225
+ import { z as z8 } from "zod";
8226
+ var DataContinuityEnvelopeSchema = z8.object({
8227
+ contract: z8.literal("DataContinuityEnvelope"),
8193
8228
  tenantId: ContractIdentifierSchema,
8194
8229
  teamId: ContractIdentifierSchema,
8195
8230
  sourceRef: EntityRefSchema.optional(),
@@ -8204,28 +8239,28 @@ var DataContinuityEnvelopeSchema = z7.object({
8204
8239
  (value) => Boolean(value.sourceRef || value.bodyRef || value.runRef || value.outputRef || value.artifactRef),
8205
8240
  "At least one continuity ref is required."
8206
8241
  );
8207
- var BodyRelationRecordSchema = z7.object({
8208
- contract: z7.literal("BodyRelationRecord"),
8242
+ var BodyRelationRecordSchema = z8.object({
8243
+ contract: z8.literal("BodyRelationRecord"),
8209
8244
  relationId: ContractIdentifierSchema,
8210
8245
  relationKind: ContractIdentifierSchema,
8211
8246
  subjectRef: EntityRefSchema,
8212
8247
  objectRef: EntityRefSchema,
8213
8248
  ownerRepo: ContractIdentifierSchema,
8214
- authorityScope: z7.enum(["tenant", "team", "global"]),
8249
+ authorityScope: z8.enum(["tenant", "team", "global"]),
8215
8250
  properties: JsonObjectSchema.default({}),
8216
8251
  createdAt: IsoDateTimeSchema,
8217
8252
  updatedAt: IsoDateTimeSchema
8218
8253
  }).strict();
8219
- var ApplicationRunSchema = z7.object({
8220
- contract: z7.literal("ApplicationRun"),
8254
+ var ApplicationRunSchema = z8.object({
8255
+ contract: z8.literal("ApplicationRun"),
8221
8256
  runId: ContractIdentifierSchema,
8222
8257
  definitionRef: EntityRefSchema,
8223
8258
  runtimeLedgerRef: EntityRefSchema.optional(),
8224
8259
  requestId: ContractIdentifierSchema,
8225
8260
  actorRef: EntityRefSchema,
8226
- status: z7.enum(["PENDING", "RUNNING", "COMPLETED", "FAILED", "CANCELLED", "EXPIRED"]),
8227
- inputRefs: z7.array(EntityRefSchema).default([]),
8228
- outputRefs: z7.array(EntityRefSchema).default([]),
8261
+ status: z8.enum(["PENDING", "RUNNING", "COMPLETED", "FAILED", "CANCELLED", "EXPIRED"]),
8262
+ inputRefs: z8.array(EntityRefSchema).default([]),
8263
+ outputRefs: z8.array(EntityRefSchema).default([]),
8229
8264
  startedAt: IsoDateTimeSchema.optional(),
8230
8265
  completedAt: IsoDateTimeSchema.optional(),
8231
8266
  expiresAt: IsoDateTimeSchema.optional(),
@@ -8267,77 +8302,77 @@ var ApplicationRunSchema = z7.object({
8267
8302
  });
8268
8303
  }
8269
8304
  });
8270
- var ExpiringAccessGrantSchema = z7.object({
8271
- contract: z7.literal("ExpiringAccessGrant"),
8305
+ var ExpiringAccessGrantSchema = z8.object({
8306
+ contract: z8.literal("ExpiringAccessGrant"),
8272
8307
  grantId: ContractIdentifierSchema,
8273
8308
  subjectRef: EntityRefSchema,
8274
8309
  resourceRef: EntityRefSchema,
8275
- permissions: z7.array(ContractIdentifierSchema).min(1),
8310
+ permissions: z8.array(ContractIdentifierSchema).min(1),
8276
8311
  issuedAt: IsoDateTimeSchema,
8277
8312
  expiresAt: IsoDateTimeSchema,
8278
8313
  revokedAt: IsoDateTimeSchema.optional()
8279
8314
  }).strict().refine((value) => Date.parse(value.expiresAt) > Date.parse(value.issuedAt), "expiresAt must be after issuedAt");
8280
8315
 
8281
8316
  // src/contracts/data.ts
8282
- import { z as z8 } from "zod";
8283
- var SourceRecordRefSchema = z8.object({
8317
+ import { z as z9 } from "zod";
8318
+ var SourceRecordRefSchema = z9.object({
8284
8319
  sourceId: ContractIdentifierSchema,
8285
8320
  recordId: ContractIdentifierSchema,
8286
- recordVersion: z8.union([z8.number().int().nonnegative(), ContractIdentifierSchema]),
8321
+ recordVersion: z9.union([z9.number().int().nonnegative(), ContractIdentifierSchema]),
8287
8322
  hash: Sha256Schema
8288
8323
  }).strict();
8289
- var OntologyDefinitionSchema = z8.object({
8290
- contract: z8.literal("OntologyDefinition"),
8324
+ var OntologyDefinitionSchema = z9.object({
8325
+ contract: z9.literal("OntologyDefinition"),
8291
8326
  ontologyId: ContractIdentifierSchema,
8292
8327
  dataSpaceId: ContractIdentifierSchema,
8293
8328
  ownerRepo: ContractIdentifierSchema,
8294
8329
  bodySchemaRef: ContractIdentifierSchema,
8295
- authority: z8.object({
8330
+ authority: z9.object({
8296
8331
  service: ContractIdentifierSchema,
8297
8332
  storage: ContractIdentifierSchema,
8298
- scope: z8.enum(["tenant", "team", "user", "global"])
8333
+ scope: z9.enum(["tenant", "team", "user", "global"])
8299
8334
  }).strict(),
8300
- relationKinds: z8.array(ContractIdentifierSchema).default([]),
8301
- metricKinds: z8.array(ContractIdentifierSchema).default([])
8335
+ relationKinds: z9.array(ContractIdentifierSchema).default([]),
8336
+ metricKinds: z9.array(ContractIdentifierSchema).default([])
8302
8337
  }).strict();
8303
- var ProjectionSpecSchema = z8.object({
8304
- contract: z8.literal("ProjectionSpec"),
8338
+ var ProjectionSpecSchema = z9.object({
8339
+ contract: z9.literal("ProjectionSpec"),
8305
8340
  projectionId: ContractIdentifierSchema,
8306
- ontologyIds: z8.array(ContractIdentifierSchema).min(1),
8341
+ ontologyIds: z9.array(ContractIdentifierSchema).min(1),
8307
8342
  outputSchemaRef: ContractIdentifierSchema,
8308
- operator: z8.object({
8309
- kind: z8.enum(["query", "aggregate", "relationship", "search", "custom"]),
8310
- configuration: z8.record(z8.string(), JsonValueSchema).default({})
8343
+ operator: z9.object({
8344
+ kind: z9.enum(["query", "aggregate", "relationship", "search", "custom"]),
8345
+ configuration: z9.record(z9.string(), JsonValueSchema).default({})
8311
8346
  }).strict(),
8312
- materialization: z8.enum(["on-demand", "event-driven", "scheduled"]),
8313
- invalidationEvents: z8.array(ContractIdentifierSchema).default([]),
8314
- rebuildable: z8.literal(true),
8315
- lineagePolicy: z8.object({
8316
- sourceRecords: z8.boolean(),
8317
- bodyVersions: z8.boolean(),
8318
- runRefs: z8.boolean(),
8319
- actorRefs: z8.boolean()
8347
+ materialization: z9.enum(["on-demand", "event-driven", "scheduled"]),
8348
+ invalidationEvents: z9.array(ContractIdentifierSchema).default([]),
8349
+ rebuildable: z9.literal(true),
8350
+ lineagePolicy: z9.object({
8351
+ sourceRecords: z9.boolean(),
8352
+ bodyVersions: z9.boolean(),
8353
+ runRefs: z9.boolean(),
8354
+ actorRefs: z9.boolean()
8320
8355
  }).strict()
8321
8356
  }).strict();
8322
- var LineageRecordSchema = z8.object({
8323
- contract: z8.literal("LineageRecord"),
8357
+ var LineageRecordSchema = z9.object({
8358
+ contract: z9.literal("LineageRecord"),
8324
8359
  lineageId: ContractIdentifierSchema,
8325
8360
  subjectRef: EntityRefSchema,
8326
- sourceRecords: z8.array(SourceRecordRefSchema).default([]),
8327
- bodyRefs: z8.array(EntityRefSchema).default([]),
8328
- runRefs: z8.array(EntityRefSchema).default([]),
8329
- outputRefs: z8.array(EntityRefSchema).default([]),
8330
- artifactRefs: z8.array(EntityRefSchema).default([]),
8331
- actorRefs: z8.array(EntityRefSchema).default([]),
8332
- evidenceRefs: z8.array(EntityRefSchema).default([]),
8361
+ sourceRecords: z9.array(SourceRecordRefSchema).default([]),
8362
+ bodyRefs: z9.array(EntityRefSchema).default([]),
8363
+ runRefs: z9.array(EntityRefSchema).default([]),
8364
+ outputRefs: z9.array(EntityRefSchema).default([]),
8365
+ artifactRefs: z9.array(EntityRefSchema).default([]),
8366
+ actorRefs: z9.array(EntityRefSchema).default([]),
8367
+ evidenceRefs: z9.array(EntityRefSchema).default([]),
8333
8368
  recordedAt: IsoDateTimeSchema
8334
8369
  }).strict();
8335
- var DomainEventSchema = z8.object({
8336
- contract: z8.literal("DomainEvent"),
8370
+ var DomainEventSchema = z9.object({
8371
+ contract: z9.literal("DomainEvent"),
8337
8372
  eventId: ContractIdentifierSchema,
8338
8373
  eventType: ContractIdentifierSchema,
8339
8374
  aggregateRef: EntityRefSchema,
8340
- aggregateVersion: z8.number().int().nonnegative(),
8375
+ aggregateVersion: z9.number().int().nonnegative(),
8341
8376
  requestId: ContractIdentifierSchema,
8342
8377
  actorRef: EntityRefSchema,
8343
8378
  payload: JsonValueSchema,
@@ -8345,11 +8380,11 @@ var DomainEventSchema = z8.object({
8345
8380
  }).strict();
8346
8381
 
8347
8382
  // src/contracts/menu.ts
8348
- import { z as z10 } from "zod";
8383
+ import { z as z11 } from "zod";
8349
8384
 
8350
8385
  // src/contracts/page.ts
8351
- import { z as z9 } from "zod";
8352
- var PageTypeSchema = z9.enum([
8386
+ import { z as z10 } from "zod";
8387
+ var PageTypeSchema = z10.enum([
8353
8388
  "page",
8354
8389
  "workspace",
8355
8390
  "view",
@@ -8370,14 +8405,14 @@ var PageTypeSchema = z9.enum([
8370
8405
  "global-design-board",
8371
8406
  "iframe"
8372
8407
  ]);
8373
- var PageVisibilitySchema = z9.object({
8374
- authenticated: z9.boolean().default(true),
8375
- permissionAllOf: z9.array(ContractIdentifierSchema).default([]),
8376
- permissionAnyOf: z9.array(ContractIdentifierSchema).default([]),
8377
- featureFlags: z9.array(ContractIdentifierSchema).default([]),
8378
- productContexts: z9.array(z9.enum(["studio", "kernel", "compute"])).min(1)
8379
- }).strict();
8380
- var PageRoutePathSchema = z9.string().trim().regex(/^\/(?!\/)/, "Expected an application-relative route path.");
8408
+ var PageVisibilitySchema = z10.object({
8409
+ authenticated: z10.boolean().default(true),
8410
+ permissionAllOf: z10.array(ContractIdentifierSchema).default([]),
8411
+ permissionAnyOf: z10.array(ContractIdentifierSchema).default([]),
8412
+ featureFlags: z10.array(ContractIdentifierSchema).default([]),
8413
+ productContexts: z10.array(z10.enum(["studio", "kernel", "compute"])).min(1)
8414
+ }).strict();
8415
+ var PageRoutePathSchema = z10.string().trim().regex(/^\/(?!\/)/, "Expected an application-relative route path.");
8381
8416
  var requireCapabilityReference = (reference, path, context) => {
8382
8417
  if (reference.kind !== "capability") {
8383
8418
  context.addIssue({
@@ -8401,53 +8436,53 @@ var requireCapabilityReference = (reference, path, context) => {
8401
8436
  });
8402
8437
  }
8403
8438
  };
8404
- var PageDefinitionSchema = z9.object({
8405
- contract: z9.literal("PageDefinition"),
8439
+ var PageDefinitionSchema = z10.object({
8440
+ contract: z10.literal("PageDefinition"),
8406
8441
  pageId: ContractIdentifierSchema,
8407
8442
  ownerRepo: ContractIdentifierSchema,
8408
8443
  title: LocalizedTextSchema,
8409
8444
  pageType: PageTypeSchema,
8410
- ownership: z9.object({
8445
+ ownership: z10.object({
8411
8446
  teamId: ContractIdentifierSchema.optional(),
8412
8447
  creatorRef: EntityRefSchema.optional(),
8413
8448
  studioId: ContractIdentifierSchema.optional(),
8414
- builtIn: z9.boolean()
8449
+ builtIn: z10.boolean()
8415
8450
  }).strict(),
8416
- record: z9.object({
8417
- createdTimestamp: z9.number().int().nonnegative().optional(),
8418
- updatedTimestamp: z9.number().int().nonnegative().optional(),
8419
- deleted: z9.boolean().default(false)
8451
+ record: z10.object({
8452
+ createdTimestamp: z10.number().int().nonnegative().optional(),
8453
+ updatedTimestamp: z10.number().int().nonnegative().optional(),
8454
+ deleted: z10.boolean().default(false)
8420
8455
  }).strict(),
8421
- surface: z9.enum(["page", "workspace", "view", "record", "action", "overlay", "agent"]),
8456
+ surface: z10.enum(["page", "workspace", "view", "record", "action", "overlay", "agent"]),
8422
8457
  routeId: ContractIdentifierSchema,
8423
8458
  routePath: PageRoutePathSchema,
8424
8459
  rendererKey: ContractIdentifierSchema,
8425
8460
  capabilityRef: EntityRefSchema,
8426
- capabilityRefs: z9.array(EntityRefSchema).default([]),
8461
+ capabilityRefs: z10.array(EntityRefSchema).default([]),
8427
8462
  workflowRef: EntityRefSchema.optional(),
8428
- binding: z9.object({
8463
+ binding: z10.object({
8429
8464
  sourceRef: ContractIdentifierSchema.optional(),
8430
8465
  ontologyId: ContractIdentifierSchema.optional(),
8431
8466
  projectionRef: ContractIdentifierSchema.optional(),
8432
8467
  stateRef: ContractIdentifierSchema.optional()
8433
8468
  }).strict(),
8434
- access: z9.object({
8435
- actions: z9.array(z9.enum(["read", "write", "execute", "manage-permissions"])).default([])
8469
+ access: z10.object({
8470
+ actions: z10.array(z10.enum(["read", "write", "execute", "manage-permissions"])).default([])
8436
8471
  }).strict(),
8437
- input: z9.object({
8472
+ input: z10.object({
8438
8473
  schemaRef: ContractIdentifierSchema
8439
8474
  }).strict().optional(),
8440
- rendererConfig: z9.object({
8475
+ rendererConfig: z10.object({
8441
8476
  schemaRef: ContractIdentifierSchema,
8442
8477
  value: JsonObjectSchema
8443
8478
  }).strict(),
8444
- navigation: z9.object({
8479
+ navigation: z10.object({
8445
8480
  label: LocalizedTextSchema,
8446
8481
  iconRef: ContractIdentifierSchema.optional(),
8447
8482
  parentPageId: ContractIdentifierSchema.optional(),
8448
- order: z9.number().int().optional(),
8449
- hidden: z9.boolean().default(false),
8450
- pinned: z9.boolean().default(false)
8483
+ order: z10.number().int().optional(),
8484
+ hidden: z10.boolean().default(false),
8485
+ pinned: z10.boolean().default(false)
8451
8486
  }).strict(),
8452
8487
  visibility: PageVisibilitySchema
8453
8488
  }).strict().superRefine((page, context) => {
@@ -8468,8 +8503,8 @@ var PageDefinitionSchema = z9.object({
8468
8503
  });
8469
8504
  if (page.workflowRef && page.workflowRef.kind !== "workflow") context.addIssue({ code: "custom", path: ["workflowRef", "kind"], message: "workflowRef must reference a workflow." });
8470
8505
  });
8471
- var PageRuntimeDescriptorSchema = z9.object({
8472
- contract: z9.literal("PageRuntimeDescriptor"),
8506
+ var PageRuntimeDescriptorSchema = z10.object({
8507
+ contract: z10.literal("PageRuntimeDescriptor"),
8473
8508
  page: PageDefinitionSchema,
8474
8509
  nodeId: ContractIdentifierSchema,
8475
8510
  parentNodeId: ContractIdentifierSchema.optional(),
@@ -8477,54 +8512,54 @@ var PageRuntimeDescriptorSchema = z9.object({
8477
8512
  semanticRef: ContractIdentifierSchema.optional(),
8478
8513
  dataContextRef: ContractIdentifierSchema.optional(),
8479
8514
  providerRef: EntityRefSchema.optional(),
8480
- surface: z9.object({
8515
+ surface: z10.object({
8481
8516
  frameOwner: ContractIdentifierSchema,
8482
8517
  tone: ContractIdentifierSchema.optional(),
8483
- density: z9.enum(["compact", "default", "comfortable"]).default("default")
8518
+ density: z10.enum(["compact", "default", "comfortable"]).default("default")
8484
8519
  }).strict(),
8485
- scroll: z9.object({
8486
- owner: z9.enum(["page", "surface", "provider"]),
8487
- axis: z9.enum(["x", "y", "both", "none"]),
8520
+ scroll: z10.object({
8521
+ owner: z10.enum(["page", "surface", "provider"]),
8522
+ axis: z10.enum(["x", "y", "both", "none"]),
8488
8523
  restoreKey: ContractIdentifierSchema.optional(),
8489
- virtualized: z9.boolean().default(false)
8524
+ virtualized: z10.boolean().default(false)
8490
8525
  }).strict(),
8491
- activation: z9.enum(["navigate", "select", "drawer", "modal", "fullscreen"]),
8492
- lifecycle: z9.object({
8493
- mountPolicy: z9.enum(["always", "when-visible", "when-active"]),
8494
- queryPolicy: z9.enum(["always", "when-visible", "when-active", "manual"]),
8495
- deepLink: z9.boolean(),
8496
- focusReturn: z9.boolean()
8526
+ activation: z10.enum(["navigate", "select", "drawer", "modal", "fullscreen"]),
8527
+ lifecycle: z10.object({
8528
+ mountPolicy: z10.enum(["always", "when-visible", "when-active"]),
8529
+ queryPolicy: z10.enum(["always", "when-visible", "when-active", "manual"]),
8530
+ deepLink: z10.boolean(),
8531
+ focusReturn: z10.boolean()
8497
8532
  }).strict()
8498
8533
  }).strict();
8499
- var PageRouteProjectionSchema = z9.object({
8534
+ var PageRouteProjectionSchema = z10.object({
8500
8535
  pageId: ContractIdentifierSchema,
8501
8536
  routeId: ContractIdentifierSchema,
8502
8537
  path: PageRoutePathSchema
8503
8538
  }).strict();
8504
- var PageNavigationProjectionSchema = z9.object({
8539
+ var PageNavigationProjectionSchema = z10.object({
8505
8540
  pageId: ContractIdentifierSchema,
8506
8541
  routeId: ContractIdentifierSchema,
8507
8542
  path: PageRoutePathSchema,
8508
8543
  label: LocalizedTextSchema,
8509
8544
  iconRef: ContractIdentifierSchema.optional(),
8510
8545
  parentPageId: ContractIdentifierSchema.optional(),
8511
- order: z9.number().int().optional(),
8512
- pinned: z9.boolean()
8546
+ order: z10.number().int().optional(),
8547
+ pinned: z10.boolean()
8513
8548
  }).strict();
8514
- var PageGuardProjectionSchema = z9.object({
8549
+ var PageGuardProjectionSchema = z10.object({
8515
8550
  pageId: ContractIdentifierSchema,
8516
- authenticated: z9.boolean(),
8517
- permissionAllOf: z9.array(ContractIdentifierSchema),
8518
- permissionAnyOf: z9.array(ContractIdentifierSchema),
8519
- featureFlags: z9.array(ContractIdentifierSchema),
8520
- actions: z9.array(z9.enum(["read", "write", "execute", "manage-permissions"]))
8551
+ authenticated: z10.boolean(),
8552
+ permissionAllOf: z10.array(ContractIdentifierSchema),
8553
+ permissionAnyOf: z10.array(ContractIdentifierSchema),
8554
+ featureFlags: z10.array(ContractIdentifierSchema),
8555
+ actions: z10.array(z10.enum(["read", "write", "execute", "manage-permissions"]))
8521
8556
  }).strict();
8522
- var PageRendererProjectionSchema = z9.object({
8557
+ var PageRendererProjectionSchema = z10.object({
8523
8558
  pageId: ContractIdentifierSchema,
8524
- surface: z9.enum(["page", "workspace", "view", "record", "action", "overlay", "agent"]),
8559
+ surface: z10.enum(["page", "workspace", "view", "record", "action", "overlay", "agent"]),
8525
8560
  rendererKey: ContractIdentifierSchema,
8526
8561
  capabilityRef: EntityRefSchema,
8527
- capabilityRefs: z9.array(EntityRefSchema),
8562
+ capabilityRefs: z10.array(EntityRefSchema),
8528
8563
  providerRef: EntityRefSchema,
8529
8564
  binding: PageDefinitionSchema.shape.binding,
8530
8565
  rendererConfig: PageDefinitionSchema.shape.rendererConfig,
@@ -8565,13 +8600,13 @@ var duplicateProjectionIdentity = (values, identity) => {
8565
8600
  }
8566
8601
  return void 0;
8567
8602
  };
8568
- var PageRuntimeProjectionSchema = z9.object({
8569
- contract: z9.literal("PageRuntimeProjection"),
8570
- product: z9.enum(["studio", "kernel", "compute"]),
8571
- routes: z9.array(PageRouteProjectionSchema),
8572
- navigation: z9.array(PageNavigationProjectionSchema),
8573
- guards: z9.array(PageGuardProjectionSchema),
8574
- renderers: z9.array(PageRendererProjectionSchema)
8603
+ var PageRuntimeProjectionSchema = z10.object({
8604
+ contract: z10.literal("PageRuntimeProjection"),
8605
+ product: z10.enum(["studio", "kernel", "compute"]),
8606
+ routes: z10.array(PageRouteProjectionSchema),
8607
+ navigation: z10.array(PageNavigationProjectionSchema),
8608
+ guards: z10.array(PageGuardProjectionSchema),
8609
+ renderers: z10.array(PageRendererProjectionSchema)
8575
8610
  }).strict().superRefine((projection, context) => {
8576
8611
  const tables = [
8577
8612
  ["routes", projection.routes.map((value) => value.pageId)],
@@ -8634,7 +8669,7 @@ var MENU_MAX_NODES = 1024;
8634
8669
  var MENU_MAX_TREE_DEPTH = 16;
8635
8670
  var MENU_MAX_INPUT_BYTES = 64 * 1024;
8636
8671
  var MENU_MAX_INPUT_VALUES = 2048;
8637
- var MenuOrderSchema = z10.number().int().min(-1e6).max(1e6);
8672
+ var MenuOrderSchema = z11.number().int().min(-1e6).max(1e6);
8638
8673
  var inspectJsonValue = (value) => {
8639
8674
  let maxDepth = 0;
8640
8675
  let values = 0;
@@ -8677,30 +8712,30 @@ var MenuBoundedInputSchema = JsonObjectSchema.superRefine((value, context) => {
8677
8712
  });
8678
8713
  }
8679
8714
  });
8680
- var MenuPageRefSchema = z10.object({
8715
+ var MenuPageRefSchema = z11.object({
8681
8716
  applicationId: ContractIdentifierSchema,
8682
8717
  pageId: ContractIdentifierSchema
8683
8718
  }).strict();
8684
- var MenuSourceInputBindingSchema = z10.discriminatedUnion("exposure", [
8685
- z10.object({ exposure: z10.literal("client"), value: MenuBoundedInputSchema }).strict(),
8686
- z10.object({ exposure: z10.literal("server"), value: MenuBoundedInputSchema }).strict()
8719
+ var MenuSourceInputBindingSchema = z11.discriminatedUnion("exposure", [
8720
+ z11.object({ exposure: z11.literal("client"), value: MenuBoundedInputSchema }).strict(),
8721
+ z11.object({ exposure: z11.literal("server"), value: MenuBoundedInputSchema }).strict()
8687
8722
  ]);
8688
- var MenuRuntimeInputBindingSchema = z10.discriminatedUnion("exposure", [
8689
- z10.object({ exposure: z10.literal("client"), value: MenuBoundedInputSchema }).strict(),
8690
- z10.object({ exposure: z10.literal("server") }).strict()
8723
+ var MenuRuntimeInputBindingSchema = z11.discriminatedUnion("exposure", [
8724
+ z11.object({ exposure: z11.literal("client"), value: MenuBoundedInputSchema }).strict(),
8725
+ z11.object({ exposure: z11.literal("server") }).strict()
8691
8726
  ]);
8692
- var MenuNavigateBehaviorSchema = z10.object({
8693
- kind: z10.literal("navigate"),
8727
+ var MenuNavigateBehaviorSchema = z11.object({
8728
+ kind: z11.literal("navigate"),
8694
8729
  page: MenuPageRefSchema,
8695
8730
  activationId: ContractIdentifierSchema.optional(),
8696
8731
  input: MenuSourceInputBindingSchema.optional()
8697
8732
  }).strict();
8698
- var MenuActionBehaviorSchema = z10.object({
8699
- kind: z10.literal("action"),
8733
+ var MenuActionBehaviorSchema = z11.object({
8734
+ kind: z11.literal("action"),
8700
8735
  actionRef: ContractIdentifierSchema,
8701
8736
  input: MenuBoundedInputSchema.optional()
8702
8737
  }).strict();
8703
- var MenuBehaviorSchema = z10.discriminatedUnion("kind", [
8738
+ var MenuBehaviorSchema = z11.discriminatedUnion("kind", [
8704
8739
  MenuNavigateBehaviorSchema,
8705
8740
  MenuActionBehaviorSchema
8706
8741
  ]);
@@ -8709,33 +8744,33 @@ var MenuNodeBaseShape = {
8709
8744
  parentNodeId: ContractIdentifierSchema.optional(),
8710
8745
  order: MenuOrderSchema
8711
8746
  };
8712
- var MenuGroupNodeSchema = z10.object({
8747
+ var MenuGroupNodeSchema = z11.object({
8713
8748
  ...MenuNodeBaseShape,
8714
- kind: z10.literal("group"),
8749
+ kind: z11.literal("group"),
8715
8750
  label: LocalizedTextSchema.optional(),
8716
8751
  iconRef: ContractIdentifierSchema.optional(),
8717
- disabled: z10.boolean().optional()
8752
+ disabled: z11.boolean().optional()
8718
8753
  }).strict();
8719
- var MenuDividerNodeSchema = z10.object({
8754
+ var MenuDividerNodeSchema = z11.object({
8720
8755
  ...MenuNodeBaseShape,
8721
- kind: z10.literal("divider")
8756
+ kind: z11.literal("divider")
8722
8757
  }).strict();
8723
- var MenuItemNodeSchema = z10.object({
8758
+ var MenuItemNodeSchema = z11.object({
8724
8759
  ...MenuNodeBaseShape,
8725
- kind: z10.literal("item"),
8760
+ kind: z11.literal("item"),
8726
8761
  label: LocalizedTextSchema,
8727
8762
  iconRef: ContractIdentifierSchema.optional(),
8728
- tone: z10.enum(["default", "danger"]).optional(),
8729
- disabled: z10.boolean().optional(),
8763
+ tone: z11.enum(["default", "danger"]).optional(),
8764
+ disabled: z11.boolean().optional(),
8730
8765
  requiredPermission: ContractIdentifierSchema.optional(),
8731
8766
  behavior: MenuBehaviorSchema
8732
8767
  }).strict();
8733
- var MenuNodeSchema = z10.discriminatedUnion("kind", [
8768
+ var MenuNodeSchema = z11.discriminatedUnion("kind", [
8734
8769
  MenuGroupNodeSchema,
8735
8770
  MenuDividerNodeSchema,
8736
8771
  MenuItemNodeSchema
8737
8772
  ]);
8738
- var MenuContributionSchema = z10.object({
8773
+ var MenuContributionSchema = z11.object({
8739
8774
  providerId: ContractIdentifierSchema,
8740
8775
  parentNodeId: ContractIdentifierSchema.optional(),
8741
8776
  order: MenuOrderSchema
@@ -8805,55 +8840,55 @@ var validateMenuStructure = (menu, context) => {
8805
8840
  contributionKeys.add(key);
8806
8841
  });
8807
8842
  };
8808
- var MenuDefinitionSchema = z10.object({
8809
- contract: z10.literal("MenuDefinition"),
8810
- version: z10.literal(MENU_CONTRACT_VERSION),
8843
+ var MenuDefinitionSchema = z11.object({
8844
+ contract: z11.literal("MenuDefinition"),
8845
+ version: z11.literal(MENU_CONTRACT_VERSION),
8811
8846
  applicationId: ContractIdentifierSchema,
8812
8847
  surface: ContractIdentifierSchema,
8813
8848
  menuId: ContractIdentifierSchema,
8814
- nodes: z10.array(MenuNodeSchema).max(MENU_MAX_NODES),
8815
- contributions: z10.array(MenuContributionSchema).max(MENU_MAX_NODES).default([])
8849
+ nodes: z11.array(MenuNodeSchema).max(MENU_MAX_NODES),
8850
+ contributions: z11.array(MenuContributionSchema).max(MENU_MAX_NODES).default([])
8816
8851
  }).strict().superRefine(validateMenuStructure);
8817
- var MenuDefinitionSetSchema = z10.union([
8818
- z10.literal("*"),
8819
- z10.object({
8820
- version: z10.literal(MENU_CONTRACT_VERSION),
8821
- definitions: z10.array(MenuDefinitionSchema).max(MENU_MAX_DEFINITIONS)
8852
+ var MenuDefinitionSetSchema = z11.union([
8853
+ z11.literal("*"),
8854
+ z11.object({
8855
+ version: z11.literal(MENU_CONTRACT_VERSION),
8856
+ definitions: z11.array(MenuDefinitionSchema).max(MENU_MAX_DEFINITIONS)
8822
8857
  }).strict()
8823
8858
  ]);
8824
- var MenuAccessRequirementSchema = z10.object({
8825
- authenticated: z10.boolean().default(true),
8826
- permissionAllOf: z10.array(ContractIdentifierSchema).default([]),
8827
- permissionAnyOf: z10.array(ContractIdentifierSchema).default([]),
8828
- featureFlags: z10.array(ContractIdentifierSchema).default([])
8859
+ var MenuAccessRequirementSchema = z11.object({
8860
+ authenticated: z11.boolean().default(true),
8861
+ permissionAllOf: z11.array(ContractIdentifierSchema).default([]),
8862
+ permissionAnyOf: z11.array(ContractIdentifierSchema).default([]),
8863
+ featureFlags: z11.array(ContractIdentifierSchema).default([])
8829
8864
  }).strict();
8830
- var MenuPageRegistrationSchema = z10.object({
8865
+ var MenuPageRegistrationSchema = z11.object({
8831
8866
  applicationId: ContractIdentifierSchema,
8832
8867
  page: PageDefinitionSchema
8833
8868
  }).strict();
8834
- var MenuActionRegistrationSchema = z10.object({
8869
+ var MenuActionRegistrationSchema = z11.object({
8835
8870
  applicationId: ContractIdentifierSchema,
8836
8871
  actionRef: ContractIdentifierSchema,
8837
8872
  inputSchemaRef: ContractIdentifierSchema.optional(),
8838
8873
  access: MenuAccessRequirementSchema
8839
8874
  }).strict();
8840
- var MenuContributionProviderRegistrationSchema = z10.object({
8875
+ var MenuContributionProviderRegistrationSchema = z11.object({
8841
8876
  applicationId: ContractIdentifierSchema,
8842
8877
  providerId: ContractIdentifierSchema,
8843
- surfaces: z10.array(ContractIdentifierSchema).min(1).optional()
8878
+ surfaces: z11.array(ContractIdentifierSchema).min(1).optional()
8844
8879
  }).strict();
8845
- var CompiledMenuNavigateBehaviorSchema = z10.object({
8846
- kind: z10.literal("navigate"),
8880
+ var CompiledMenuNavigateBehaviorSchema = z11.object({
8881
+ kind: z11.literal("navigate"),
8847
8882
  page: MenuPageRefSchema,
8848
8883
  activationId: ContractIdentifierSchema,
8849
8884
  input: MenuRuntimeInputBindingSchema.optional()
8850
8885
  }).strict();
8851
- var CompiledMenuActionBehaviorSchema = z10.object({
8852
- kind: z10.literal("action"),
8886
+ var CompiledMenuActionBehaviorSchema = z11.object({
8887
+ kind: z11.literal("action"),
8853
8888
  actionRef: ContractIdentifierSchema,
8854
8889
  input: MenuBoundedInputSchema.optional()
8855
8890
  }).strict();
8856
- var CompiledMenuBehaviorSchema = z10.discriminatedUnion("kind", [
8891
+ var CompiledMenuBehaviorSchema = z11.discriminatedUnion("kind", [
8857
8892
  CompiledMenuNavigateBehaviorSchema,
8858
8893
  CompiledMenuActionBehaviorSchema
8859
8894
  ]);
@@ -8866,76 +8901,76 @@ var CompiledMenuItemNodeSchema = MenuItemNodeSchema.omit({ behavior: true, requi
8866
8901
  behavior: CompiledMenuBehaviorSchema,
8867
8902
  access: CompiledMenuItemAccessSchema
8868
8903
  }).strict();
8869
- var CompiledMenuNodeSchema = z10.discriminatedUnion("kind", [
8904
+ var CompiledMenuNodeSchema = z11.discriminatedUnion("kind", [
8870
8905
  CompiledMenuGroupNodeSchema,
8871
8906
  CompiledMenuDividerNodeSchema,
8872
8907
  CompiledMenuItemNodeSchema
8873
8908
  ]);
8874
- var CompiledMenuProjectionSchema = z10.object({
8909
+ var CompiledMenuProjectionSchema = z11.object({
8875
8910
  applicationId: ContractIdentifierSchema,
8876
8911
  surface: ContractIdentifierSchema,
8877
8912
  menuId: ContractIdentifierSchema,
8878
- nodes: z10.array(CompiledMenuNodeSchema).max(MENU_MAX_NODES),
8879
- contributions: z10.array(MenuContributionSchema).max(MENU_MAX_NODES)
8913
+ nodes: z11.array(CompiledMenuNodeSchema).max(MENU_MAX_NODES),
8914
+ contributions: z11.array(MenuContributionSchema).max(MENU_MAX_NODES)
8880
8915
  }).strict();
8881
- var MenuNavigationTargetSchema = z10.object({
8916
+ var MenuNavigationTargetSchema = z11.object({
8882
8917
  page: MenuPageRefSchema,
8883
8918
  activationId: ContractIdentifierSchema,
8884
8919
  input: MenuRuntimeInputBindingSchema.optional()
8885
8920
  }).strict();
8886
- var MenuRuntimeBundleSchema = z10.object({
8887
- contract: z10.literal("MenuRuntimeBundle"),
8888
- version: z10.literal(MENU_CONTRACT_VERSION),
8921
+ var MenuRuntimeBundleSchema = z11.object({
8922
+ contract: z11.literal("MenuRuntimeBundle"),
8923
+ version: z11.literal(MENU_CONTRACT_VERSION),
8889
8924
  applicationId: ContractIdentifierSchema,
8890
8925
  sourceVersion: ContractIdentifierSchema,
8891
8926
  contentHash: Sha256Schema,
8892
- menus: z10.array(CompiledMenuProjectionSchema).max(MENU_MAX_DEFINITIONS),
8893
- navigationTargets: z10.array(MenuNavigationTargetSchema),
8894
- sourceMap: z10.record(z10.string(), ContractIdentifierSchema).default({})
8927
+ menus: z11.array(CompiledMenuProjectionSchema).max(MENU_MAX_DEFINITIONS),
8928
+ navigationTargets: z11.array(MenuNavigationTargetSchema),
8929
+ sourceMap: z11.record(z11.string(), ContractIdentifierSchema).default({})
8895
8930
  }).strict();
8896
- var MenuContributionResultSchema = z10.object({
8897
- contract: z10.literal("MenuContributionResult"),
8931
+ var MenuContributionResultSchema = z11.object({
8932
+ contract: z11.literal("MenuContributionResult"),
8898
8933
  applicationId: ContractIdentifierSchema,
8899
8934
  surface: ContractIdentifierSchema,
8900
8935
  menuId: ContractIdentifierSchema,
8901
8936
  providerId: ContractIdentifierSchema,
8902
- nodes: z10.array(CompiledMenuNodeSchema).max(MENU_MAX_NODES)
8937
+ nodes: z11.array(CompiledMenuNodeSchema).max(MENU_MAX_NODES)
8903
8938
  }).strict();
8904
8939
 
8905
8940
  // src/contracts/semantic.ts
8906
- import { z as z11 } from "zod";
8907
- var ConceptRelationshipSchema = z11.object({
8941
+ import { z as z12 } from "zod";
8942
+ var ConceptRelationshipSchema = z12.object({
8908
8943
  kind: ContractIdentifierSchema,
8909
8944
  targetConceptId: ContractIdentifierSchema,
8910
- cardinality: z11.enum(["one", "optional", "many"])
8945
+ cardinality: z12.enum(["one", "optional", "many"])
8911
8946
  }).strict();
8912
- var ConceptDefinitionSchema = z11.object({
8913
- contract: z11.literal("ConceptDefinition"),
8947
+ var ConceptDefinitionSchema = z12.object({
8948
+ contract: z12.literal("ConceptDefinition"),
8914
8949
  conceptId: ContractIdentifierSchema,
8915
8950
  ownerRepo: ContractIdentifierSchema,
8916
- displayName: z11.string().trim().min(1),
8917
- description: z11.string().optional(),
8951
+ displayName: z12.string().trim().min(1),
8952
+ description: z12.string().optional(),
8918
8953
  schemaRef: ContractIdentifierSchema,
8919
8954
  ontologyId: ContractIdentifierSchema.optional(),
8920
- capabilityIds: z11.array(ContractIdentifierSchema).default([]),
8921
- commandNames: z11.array(ContractIdentifierSchema).default([]),
8922
- relationships: z11.array(ConceptRelationshipSchema).default([])
8955
+ capabilityIds: z12.array(ContractIdentifierSchema).default([]),
8956
+ commandNames: z12.array(ContractIdentifierSchema).default([]),
8957
+ relationships: z12.array(ConceptRelationshipSchema).default([])
8923
8958
  }).strict();
8924
- var DomainCommandDefinitionSchema = z11.object({
8925
- contract: z11.literal("DomainCommandDefinition"),
8959
+ var DomainCommandDefinitionSchema = z12.object({
8960
+ contract: z12.literal("DomainCommandDefinition"),
8926
8961
  commandName: ContractIdentifierSchema,
8927
8962
  ownerRepo: ContractIdentifierSchema,
8928
- displayName: z11.string().trim().min(1),
8929
- description: z11.string().optional(),
8930
- targetKinds: z11.array(ContractIdentifierSchema).min(1),
8963
+ displayName: z12.string().trim().min(1),
8964
+ description: z12.string().optional(),
8965
+ targetKinds: z12.array(ContractIdentifierSchema).min(1),
8931
8966
  inputSchemaRef: ContractIdentifierSchema,
8932
8967
  outputSchemaRef: ContractIdentifierSchema.optional(),
8933
- requiredPermissionCodes: z11.array(ContractIdentifierSchema).default([]),
8968
+ requiredPermissionCodes: z12.array(ContractIdentifierSchema).default([]),
8934
8969
  handlerRef: EntityRefSchema,
8935
- sideEffects: z11.array(z11.enum(["data-write", "execution", "navigation", "notification", "external-call"])).default([])
8970
+ sideEffects: z12.array(z12.enum(["data-write", "execution", "navigation", "notification", "external-call"])).default([])
8936
8971
  }).strict();
8937
- var DomainCommandSchema = z11.object({
8938
- contract: z11.literal("DomainCommand"),
8972
+ var DomainCommandSchema = z12.object({
8973
+ contract: z12.literal("DomainCommand"),
8939
8974
  commandId: ContractIdentifierSchema,
8940
8975
  commandName: ContractIdentifierSchema,
8941
8976
  requestId: ContractIdentifierSchema,
@@ -8943,30 +8978,30 @@ var DomainCommandSchema = z11.object({
8943
8978
  idempotencyKey: ContractIdentifierSchema,
8944
8979
  targetRef: EntityRefSchema,
8945
8980
  actorRef: EntityRefSchema,
8946
- source: z11.object({
8947
- product: z11.enum(["studio", "kernel", "compute", "agent", "mcp", "service"]),
8981
+ source: z12.object({
8982
+ product: z12.enum(["studio", "kernel", "compute", "agent", "mcp", "service"]),
8948
8983
  pageId: ContractIdentifierSchema.optional(),
8949
8984
  capabilityId: ContractIdentifierSchema.optional()
8950
8985
  }).strict(),
8951
8986
  payload: JsonObjectSchema,
8952
8987
  issuedAt: IsoDateTimeSchema
8953
8988
  }).strict();
8954
- var ProductDeclarationSchema = z11.object({
8955
- contract: z11.literal("ProductDeclaration"),
8989
+ var ProductDeclarationSchema = z12.object({
8990
+ contract: z12.literal("ProductDeclaration"),
8956
8991
  declarationId: ContractIdentifierSchema,
8957
8992
  ownerRepo: ContractIdentifierSchema,
8958
- concepts: z11.array(ConceptDefinitionSchema).default([]),
8959
- ontologies: z11.array(OntologyDefinitionSchema).default([]),
8960
- projections: z11.array(ProjectionSpecSchema).default([]),
8961
- commands: z11.array(DomainCommandDefinitionSchema).default([]),
8962
- capabilities: z11.array(CapabilityManifestSchema).default([]),
8963
- pages: z11.array(PageDefinitionSchema).default([]),
8964
- menus: z11.array(MenuDefinitionSchema).default([])
8965
- }).strict();
8966
- var DeclarationGraphEdgeSchema = z11.object({
8993
+ concepts: z12.array(ConceptDefinitionSchema).default([]),
8994
+ ontologies: z12.array(OntologyDefinitionSchema).default([]),
8995
+ projections: z12.array(ProjectionSpecSchema).default([]),
8996
+ commands: z12.array(DomainCommandDefinitionSchema).default([]),
8997
+ capabilities: z12.array(CapabilityManifestSchema).default([]),
8998
+ pages: z12.array(PageDefinitionSchema).default([]),
8999
+ menus: z12.array(MenuDefinitionSchema).default([])
9000
+ }).strict();
9001
+ var DeclarationGraphEdgeSchema = z12.object({
8967
9002
  from: EntityRefSchema,
8968
9003
  to: EntityRefSchema,
8969
- relation: z11.enum([
9004
+ relation: z12.enum([
8970
9005
  "uses-ontology",
8971
9006
  "uses-projection",
8972
9007
  "uses-capability",
@@ -8974,25 +9009,25 @@ var DeclarationGraphEdgeSchema = z11.object({
8974
9009
  "relates-to-concept"
8975
9010
  ])
8976
9011
  }).strict();
8977
- var ChangeImpactSchema = z11.object({
9012
+ var ChangeImpactSchema = z12.object({
8978
9013
  changedRef: EntityRefSchema,
8979
- affectedRefs: z11.array(EntityRefSchema),
8980
- reasons: z11.array(ContractIdentifierSchema).min(1)
9014
+ affectedRefs: z12.array(EntityRefSchema),
9015
+ reasons: z12.array(ContractIdentifierSchema).min(1)
8981
9016
  }).strict();
8982
- var ChangeImpactGraphSchema = z11.object({
8983
- contract: z11.literal("ChangeImpactGraph"),
9017
+ var ChangeImpactGraphSchema = z12.object({
9018
+ contract: z12.literal("ChangeImpactGraph"),
8984
9019
  declarationId: ContractIdentifierSchema,
8985
- nodes: z11.array(EntityRefSchema),
8986
- edges: z11.array(DeclarationGraphEdgeSchema),
8987
- impacts: z11.array(ChangeImpactSchema),
9020
+ nodes: z12.array(EntityRefSchema),
9021
+ edges: z12.array(DeclarationGraphEdgeSchema),
9022
+ impacts: z12.array(ChangeImpactSchema),
8988
9023
  generatedAt: IsoDateTimeSchema
8989
9024
  }).strict();
8990
9025
 
8991
9026
  // src/contracts/tenant.ts
8992
- import { z as z13 } from "zod";
9027
+ import { z as z14 } from "zod";
8993
9028
 
8994
9029
  // src/contracts/theme.ts
8995
- import { z as z12 } from "zod";
9030
+ import { z as z13 } from "zod";
8996
9031
 
8997
9032
  // src/theme-tokens/core.ts
8998
9033
  var import_ajv = __toESM(require_ajv());
@@ -11219,20 +11254,20 @@ function assertMonkeysThemeTokensComplete(input) {
11219
11254
  }
11220
11255
 
11221
11256
  // src/contracts/theme.ts
11222
- var ThemeTokenTypeSchema = z12.enum(THEME_TOKEN_TYPES);
11223
- var ThemeTokenSchema = z12.record(z12.string(), z12.unknown()).superRefine((input, context) => {
11257
+ var ThemeTokenTypeSchema = z13.enum(THEME_TOKEN_TYPES);
11258
+ var ThemeTokenSchema = z13.record(z13.string(), z13.unknown()).superRefine((input, context) => {
11224
11259
  const issues = validateThemeTokensDocumentStructure({ token: input });
11225
11260
  for (const issue of issues) {
11226
11261
  context.addIssue({ code: "custom", message: `${issue.path} ${issue.message}` });
11227
11262
  }
11228
11263
  });
11229
- var ThemeTokenGroupSchema = z12.record(z12.string(), z12.unknown()).superRefine((input, context) => {
11264
+ var ThemeTokenGroupSchema = z13.record(z13.string(), z13.unknown()).superRefine((input, context) => {
11230
11265
  const issues = validateThemeTokensDocumentStructure(input);
11231
11266
  for (const issue of issues) {
11232
11267
  context.addIssue({ code: "custom", message: `${issue.path} ${issue.message}` });
11233
11268
  }
11234
11269
  });
11235
- var ThemeTokensSchema = z12.record(z12.string(), z12.unknown()).superRefine((input, context) => {
11270
+ var ThemeTokensSchema = z13.record(z13.string(), z13.unknown()).superRefine((input, context) => {
11236
11271
  const issues = validateThemeTokensDocument(input);
11237
11272
  for (const issue of issues) {
11238
11273
  context.addIssue({ code: "custom", message: `${issue.path} ${issue.message}` });
@@ -11259,9 +11294,9 @@ var ResolvedThemeTokensSchema = ThemeTokensSchema.superRefine((input, context) =
11259
11294
  });
11260
11295
 
11261
11296
  // src/contracts/tenant.ts
11262
- var DesignTokenFileSourceSchema = z13.object({
11263
- type: z13.literal("file"),
11264
- path: z13.string().trim().min(1).superRefine((source, context) => {
11297
+ var DesignTokenFileSourceSchema = z14.object({
11298
+ type: z14.literal("file"),
11299
+ path: z14.string().trim().min(1).superRefine((source, context) => {
11265
11300
  if (/^[a-z][a-z\d+.-]*:/i.test(source)) {
11266
11301
  context.addIssue({
11267
11302
  code: "custom",
@@ -11270,9 +11305,9 @@ var DesignTokenFileSourceSchema = z13.object({
11270
11305
  }
11271
11306
  })
11272
11307
  }).strict();
11273
- var DesignTokenUrlSourceSchema = z13.object({
11274
- type: z13.literal("url"),
11275
- url: z13.string().trim().min(1).superRefine((source, context) => {
11308
+ var DesignTokenUrlSourceSchema = z14.object({
11309
+ type: z14.literal("url"),
11310
+ url: z14.string().trim().min(1).superRefine((source, context) => {
11276
11311
  if (!/^https?:\/\//i.test(source)) {
11277
11312
  context.addIssue({
11278
11313
  code: "custom",
@@ -11281,99 +11316,99 @@ var DesignTokenUrlSourceSchema = z13.object({
11281
11316
  }
11282
11317
  })
11283
11318
  }).strict();
11284
- var DesignTokenInlineSourceSchema = z13.object({
11285
- type: z13.literal("inline"),
11319
+ var DesignTokenInlineSourceSchema = z14.object({
11320
+ type: z14.literal("inline"),
11286
11321
  document: ThemeTokensSchema
11287
11322
  }).strict();
11288
- var DesignTokenSourceSchema = z13.discriminatedUnion("type", [
11323
+ var DesignTokenSourceSchema = z14.discriminatedUnion("type", [
11289
11324
  DesignTokenFileSourceSchema,
11290
11325
  DesignTokenUrlSourceSchema,
11291
11326
  DesignTokenInlineSourceSchema
11292
11327
  ]);
11293
- var TenantDesignTokensConfigSchema = z13.object({
11328
+ var TenantDesignTokensConfigSchema = z14.object({
11294
11329
  /** Ordered tenant overrides. The backend always applies the product default first. */
11295
- tokenSources: z13.array(DesignTokenSourceSchema)
11330
+ tokenSources: z14.array(DesignTokenSourceSchema)
11296
11331
  }).strict();
11297
- var TenantAuthBindingSchema = z13.object({
11298
- kind: z13.literal("auth-provider"),
11332
+ var TenantAuthBindingSchema = z14.object({
11333
+ kind: z14.literal("auth-provider"),
11299
11334
  providerId: ContractIdentifierSchema,
11300
11335
  policyRef: ContractIdentifierSchema.optional()
11301
11336
  }).strict();
11302
- var TenantDataBindingSchema = z13.discriminatedUnion("kind", [
11303
- z13.object({
11304
- kind: z13.literal("data-provider"),
11337
+ var TenantDataBindingSchema = z14.discriminatedUnion("kind", [
11338
+ z14.object({
11339
+ kind: z14.literal("data-provider"),
11305
11340
  providerId: ContractIdentifierSchema,
11306
11341
  domainRef: ContractIdentifierSchema.optional()
11307
11342
  }).strict(),
11308
- z13.object({
11309
- kind: z13.literal("projection"),
11343
+ z14.object({
11344
+ kind: z14.literal("projection"),
11310
11345
  projectionRef: ContractIdentifierSchema,
11311
11346
  domainRef: ContractIdentifierSchema.optional()
11312
11347
  }).strict()
11313
11348
  ]);
11314
- var TenantAuthBindingsSchema = z13.record(
11349
+ var TenantAuthBindingsSchema = z14.record(
11315
11350
  ContractIdentifierSchema,
11316
11351
  TenantAuthBindingSchema
11317
11352
  );
11318
- var TenantDataBindingsSchema = z13.record(
11353
+ var TenantDataBindingsSchema = z14.record(
11319
11354
  ContractIdentifierSchema,
11320
11355
  TenantDataBindingSchema
11321
11356
  );
11322
- var TenantTrendRadarSourceSchema = z13.object({
11357
+ var TenantTrendRadarSourceSchema = z14.object({
11323
11358
  ontologyId: ContractIdentifierSchema,
11324
11359
  viewId: ContractIdentifierSchema
11325
11360
  }).strict();
11326
- var TenantTrendRadarCollectionTargetSchema = z13.object({
11361
+ var TenantTrendRadarCollectionTargetSchema = z14.object({
11327
11362
  ontologyId: ContractIdentifierSchema
11328
11363
  }).strict();
11329
- var TenantTrendRadarSourcesSchema = z13.object({
11364
+ var TenantTrendRadarSourcesSchema = z14.object({
11330
11365
  products: TenantTrendRadarSourceSchema.optional(),
11331
11366
  hotwords: TenantTrendRadarSourceSchema.optional(),
11332
11367
  brands: TenantTrendRadarSourceSchema.optional(),
11333
11368
  collection: TenantTrendRadarCollectionTargetSchema.optional()
11334
11369
  }).strict();
11335
- var AssetVariantsSchema = z13.object({
11336
- light: z13.string().optional(),
11337
- dark: z13.string().optional()
11370
+ var AssetVariantsSchema = z14.object({
11371
+ light: z14.string().optional(),
11372
+ dark: z14.string().optional()
11338
11373
  }).strict();
11339
11374
  var LEGACY_CURRENT_USER_MENU_ITEM_IDS = ["dark-mode", "language", "settings", "logout"];
11340
11375
  var CURRENT_USER_MENU_CONTROL_REFS = ["dark-mode", "language"];
11341
11376
  var CURRENT_USER_MENU_ACTION_REFS = ["logout"];
11342
- var CurrentUserMenuIdentifierSchema = z13.string().trim().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/, "Expected a stable current-user menu identifier.");
11343
- var CurrentUserMenuDisplayTextSchema = z13.union([
11344
- z13.string().trim().min(1),
11345
- z13.record(z13.string().trim().min(1), z13.string().trim().min(1)).refine((value) => Object.keys(value).length > 0, "Localized menu text must contain at least one locale.")
11377
+ var CurrentUserMenuIdentifierSchema = z14.string().trim().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/, "Expected a stable current-user menu identifier.");
11378
+ var CurrentUserMenuDisplayTextSchema = z14.union([
11379
+ z14.string().trim().min(1),
11380
+ 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.")
11346
11381
  ]);
11347
- var CurrentUserMenuNavigationItemSchema = z13.object({
11382
+ var CurrentUserMenuNavigationItemSchema = z14.object({
11348
11383
  id: CurrentUserMenuIdentifierSchema,
11349
- kind: z13.literal("navigation"),
11384
+ kind: z14.literal("navigation"),
11350
11385
  ref: CurrentUserMenuIdentifierSchema
11351
11386
  }).strict();
11352
- var CurrentUserMenuControlItemSchema = z13.object({
11387
+ var CurrentUserMenuControlItemSchema = z14.object({
11353
11388
  id: CurrentUserMenuIdentifierSchema,
11354
- kind: z13.literal("control"),
11355
- ref: z13.enum(CURRENT_USER_MENU_CONTROL_REFS)
11389
+ kind: z14.literal("control"),
11390
+ ref: z14.enum(CURRENT_USER_MENU_CONTROL_REFS)
11356
11391
  }).strict();
11357
- var CurrentUserMenuActionItemSchema = z13.object({
11392
+ var CurrentUserMenuActionItemSchema = z14.object({
11358
11393
  id: CurrentUserMenuIdentifierSchema,
11359
- kind: z13.literal("action"),
11360
- ref: z13.enum(CURRENT_USER_MENU_ACTION_REFS),
11361
- tone: z13.enum(["default", "danger"]).optional()
11394
+ kind: z14.literal("action"),
11395
+ ref: z14.enum(CURRENT_USER_MENU_ACTION_REFS),
11396
+ tone: z14.enum(["default", "danger"]).optional()
11362
11397
  }).strict();
11363
- var CurrentUserMenuItemSchema = z13.discriminatedUnion("kind", [
11398
+ var CurrentUserMenuItemSchema = z14.discriminatedUnion("kind", [
11364
11399
  CurrentUserMenuNavigationItemSchema,
11365
11400
  CurrentUserMenuControlItemSchema,
11366
11401
  CurrentUserMenuActionItemSchema
11367
11402
  ]);
11368
- var CurrentUserMenuSectionSchema = z13.object({
11403
+ var CurrentUserMenuSectionSchema = z14.object({
11369
11404
  id: CurrentUserMenuIdentifierSchema,
11370
11405
  label: CurrentUserMenuDisplayTextSchema.optional(),
11371
- dividerBefore: z13.boolean().optional(),
11372
- items: z13.array(CurrentUserMenuItemSchema)
11406
+ dividerBefore: z14.boolean().optional(),
11407
+ items: z14.array(CurrentUserMenuItemSchema)
11373
11408
  }).strict();
11374
- var CurrentUserMenuConfigSchema = z13.object({
11375
- version: z13.literal(1),
11376
- sections: z13.array(CurrentUserMenuSectionSchema).max(20)
11409
+ var CurrentUserMenuConfigSchema = z14.object({
11410
+ version: z14.literal(1),
11411
+ sections: z14.array(CurrentUserMenuSectionSchema).max(20)
11377
11412
  }).strict().superRefine((value, context) => {
11378
11413
  const sectionIds = /* @__PURE__ */ new Set();
11379
11414
  const itemIds = /* @__PURE__ */ new Set();
@@ -11407,7 +11442,7 @@ var CurrentUserMenuConfigSchema = z13.object({
11407
11442
  });
11408
11443
  }
11409
11444
  });
11410
- var LegacyCurrentUserMenuProfileSchema = z13.array(z13.enum(LEGACY_CURRENT_USER_MENU_ITEM_IDS)).superRefine((value, context) => {
11445
+ var LegacyCurrentUserMenuProfileSchema = z14.array(z14.enum(LEGACY_CURRENT_USER_MENU_ITEM_IDS)).superRefine((value, context) => {
11411
11446
  const seen = /* @__PURE__ */ new Set();
11412
11447
  value.forEach((item, index) => {
11413
11448
  if (seen.has(item)) {
@@ -11420,73 +11455,73 @@ var LegacyCurrentUserMenuProfileSchema = z13.array(z13.enum(LEGACY_CURRENT_USER_
11420
11455
  seen.add(item);
11421
11456
  });
11422
11457
  });
11423
- var CurrentUserMenuProfileSchema = z13.union([
11424
- z13.literal("*"),
11458
+ var CurrentUserMenuProfileSchema = z14.union([
11459
+ z14.literal("*"),
11425
11460
  LegacyCurrentUserMenuProfileSchema,
11426
11461
  CurrentUserMenuConfigSchema
11427
11462
  ]);
11428
- var ThemeHeadbarSchema = z13.object({
11429
- theme: z13.enum(["card", "glassy", "ghost"]).optional(),
11430
- navPosition: z13.enum(["left", "center", "right"]).optional(),
11431
- actions: z13.union([z13.literal("*"), z13.array(ContractIdentifierSchema)]).optional(),
11463
+ var ThemeHeadbarSchema = z14.object({
11464
+ theme: z14.enum(["card", "glassy", "ghost"]).optional(),
11465
+ navPosition: z14.enum(["left", "center", "right"]).optional(),
11466
+ actions: z14.union([z14.literal("*"), z14.array(ContractIdentifierSchema)]).optional(),
11432
11467
  profile: CurrentUserMenuProfileSchema.optional(),
11433
- showTeamQuota: z13.boolean().optional()
11468
+ showTeamQuota: z14.boolean().optional()
11434
11469
  }).strict();
11435
- var TenantHeadbarModuleLeafSchema = z13.object({
11470
+ var TenantHeadbarModuleLeafSchema = z14.object({
11436
11471
  id: ContractIdentifierSchema,
11437
- extraInfo: z13.boolean().optional(),
11438
- displayName: z13.union([z13.string(), z13.record(LocaleIdentifierSchema, z13.string())]).optional(),
11439
- visible: z13.boolean().optional(),
11440
- disabled: z13.boolean().optional(),
11441
- icon: z13.string().optional(),
11442
- showQuickSwitcher: z13.boolean().optional(),
11443
- showSidebar: z13.boolean().optional(),
11444
- showContentFrame: z13.boolean().optional()
11472
+ extraInfo: z14.boolean().optional(),
11473
+ displayName: z14.union([z14.string(), z14.record(LocaleIdentifierSchema, z14.string())]).optional(),
11474
+ visible: z14.boolean().optional(),
11475
+ disabled: z14.boolean().optional(),
11476
+ icon: z14.string().optional(),
11477
+ showQuickSwitcher: z14.boolean().optional(),
11478
+ showSidebar: z14.boolean().optional(),
11479
+ showContentFrame: z14.boolean().optional()
11445
11480
  }).strict();
11446
11481
  var TenantHeadbarModuleItemSchema = TenantHeadbarModuleLeafSchema.extend({
11447
- children: z13.array(TenantHeadbarModuleLeafSchema).optional()
11448
- }).strict();
11449
- var KernelHeadbarSchema = z13.object({
11450
- theme: z13.literal("card").optional(),
11451
- layoutMode: z13.enum(["boxed", "full-bleed"]).optional(),
11452
- heightPx: z13.number().positive().optional(),
11453
- navPosition: z13.enum(["left", "center", "right"]).optional(),
11454
- brandTitle: z13.string().optional(),
11455
- menuRadius: z13.enum(["default", "none", "sm", "md", "lg", "xl", "full"]).optional()
11456
- }).strict();
11457
- var CustomIconSchema = z13.object({
11458
- color: z13.string().optional(),
11459
- url: z13.string().optional(),
11460
- type: z13.enum(["svg", "image"]).optional(),
11461
- hintTextColor: z13.string().optional()
11462
- }).strict();
11463
- var WorkbenchCustomerToolSchema = z13.object({
11482
+ children: z14.array(TenantHeadbarModuleLeafSchema).optional()
11483
+ }).strict();
11484
+ var KernelHeadbarSchema = z14.object({
11485
+ theme: z14.literal("card").optional(),
11486
+ layoutMode: z14.enum(["boxed", "full-bleed"]).optional(),
11487
+ heightPx: z14.number().positive().optional(),
11488
+ navPosition: z14.enum(["left", "center", "right"]).optional(),
11489
+ brandTitle: z14.string().optional(),
11490
+ menuRadius: z14.enum(["default", "none", "sm", "md", "lg", "xl", "full"]).optional()
11491
+ }).strict();
11492
+ var CustomIconSchema = z14.object({
11493
+ color: z14.string().optional(),
11494
+ url: z14.string().optional(),
11495
+ type: z14.enum(["svg", "image"]).optional(),
11496
+ hintTextColor: z14.string().optional()
11497
+ }).strict();
11498
+ var WorkbenchCustomerToolSchema = z14.object({
11464
11499
  id: ContractIdentifierSchema,
11465
- label: z13.union([z13.string(), z13.record(LocaleIdentifierSchema, z13.string())]).optional(),
11466
- fixed: z13.boolean().optional()
11500
+ label: z14.union([z14.string(), z14.record(LocaleIdentifierSchema, z14.string())]).optional(),
11501
+ fixed: z14.boolean().optional()
11467
11502
  }).strict();
11468
- var WorkbenchStudioOverrideSchema = z13.object({
11469
- studioName: z13.string().trim().min(1),
11470
- dropdownToolsDefault: z13.array(ContractIdentifierSchema).optional(),
11471
- existingToolsDefault: z13.array(ContractIdentifierSchema).optional(),
11472
- historyColumnsDefault: z13.number().int().min(1).max(6).optional()
11503
+ var WorkbenchStudioOverrideSchema = z14.object({
11504
+ studioName: z14.string().trim().min(1),
11505
+ dropdownToolsDefault: z14.array(ContractIdentifierSchema).optional(),
11506
+ existingToolsDefault: z14.array(ContractIdentifierSchema).optional(),
11507
+ historyColumnsDefault: z14.number().int().min(1).max(6).optional()
11473
11508
  }).strict();
11474
- var TenantWorkbenchPageContextSchema = z13.object({
11509
+ var TenantWorkbenchPageContextSchema = z14.object({
11475
11510
  workflow: JsonObjectSchema.optional(),
11476
11511
  agent: JsonObjectSchema.optional(),
11477
11512
  agentId: ContractIdentifierSchema.optional(),
11478
11513
  designProject: JsonObjectSchema.optional(),
11479
11514
  designMetadataId: ContractIdentifierSchema.optional(),
11480
- iframeUrl: z13.string().trim().min(1).optional(),
11481
- info: z13.object({
11515
+ iframeUrl: z14.string().trim().min(1).optional(),
11516
+ info: z14.object({
11482
11517
  displayName: LocalizedTextSchema.optional(),
11483
11518
  description: LocalizedTextSchema.optional(),
11484
- iconUrl: z13.string().trim().min(1).optional()
11519
+ iconUrl: z14.string().trim().min(1).optional()
11485
11520
  }).strict().optional(),
11486
- isBuiltinPinned: z13.boolean().optional(),
11487
- isBuiltinReadonly: z13.boolean().optional()
11521
+ isBuiltinPinned: z14.boolean().optional(),
11522
+ isBuiltinReadonly: z14.boolean().optional()
11488
11523
  }).strict();
11489
- var TenantWorkbenchPageEnvelopeSchema = z13.object({
11524
+ var TenantWorkbenchPageEnvelopeSchema = z14.object({
11490
11525
  definition: PageDefinitionSchema,
11491
11526
  context: TenantWorkbenchPageContextSchema
11492
11527
  }).strict().superRefine(({ definition }, context) => {
@@ -11519,56 +11554,56 @@ var TenantWorkbenchPageEnvelopeSchema = z13.object({
11519
11554
  });
11520
11555
  }
11521
11556
  });
11522
- var TenantWorkbenchPageGroupSchema = z13.object({
11557
+ var TenantWorkbenchPageGroupSchema = z14.object({
11523
11558
  id: ContractIdentifierSchema,
11524
- pageIds: z13.array(ContractIdentifierSchema),
11559
+ pageIds: z14.array(ContractIdentifierSchema),
11525
11560
  displayName: LocalizedTextSchema,
11526
- isBuiltIn: z13.boolean(),
11527
- iconUrl: z13.string().optional(),
11528
- sortIndex: z13.number().int().nullable().optional(),
11561
+ isBuiltIn: z14.boolean(),
11562
+ iconUrl: z14.string().optional(),
11563
+ sortIndex: z14.number().int().nullable().optional(),
11529
11564
  presetRelationId: ContractIdentifierSchema.optional(),
11530
11565
  relationKey: ContractIdentifierSchema.nullable().optional(),
11531
11566
  studioId: ContractIdentifierSchema.optional()
11532
11567
  }).strict();
11533
- var TenantWorkbenchConfigSchema = z13.object({
11534
- pages: z13.array(TenantWorkbenchPageEnvelopeSchema),
11535
- pageGroups: z13.array(TenantWorkbenchPageGroupSchema),
11536
- catalog: z13.object({ enabled: z13.boolean().optional(), defaultEntry: z13.boolean().optional() }).strict().optional(),
11537
- quickSwitcherMaxItems: z13.number().int().nonnegative().optional(),
11538
- defaultOrder: z13.object({
11539
- groups: z13.array(ContractIdentifierSchema),
11540
- pages: z13.record(ContractIdentifierSchema, z13.array(ContractIdentifierSchema))
11568
+ var TenantWorkbenchConfigSchema = z14.object({
11569
+ pages: z14.array(TenantWorkbenchPageEnvelopeSchema),
11570
+ pageGroups: z14.array(TenantWorkbenchPageGroupSchema),
11571
+ catalog: z14.object({ enabled: z14.boolean().optional(), defaultEntry: z14.boolean().optional() }).strict().optional(),
11572
+ quickSwitcherMaxItems: z14.number().int().nonnegative().optional(),
11573
+ defaultOrder: z14.object({
11574
+ groups: z14.array(ContractIdentifierSchema),
11575
+ pages: z14.record(ContractIdentifierSchema, z14.array(ContractIdentifierSchema))
11541
11576
  }).strict().optional(),
11542
- customers: z13.object({
11543
- dropdownToolsDefault: z13.array(ContractIdentifierSchema).optional(),
11544
- layoutManagerTools: z13.array(WorkbenchCustomerToolSchema).optional(),
11545
- studioTabsMode: z13.enum(["dropdown", "tabs"]).optional(),
11546
- historyWatermark: z13.object({
11547
- svgUrl: z13.string().optional(),
11548
- coverage: z13.array(z13.enum(["list", "detail", "download"])).optional(),
11549
- maxLongEdgeRatio: z13.number().positive().optional(),
11550
- sizing: z13.object({
11577
+ customers: z14.object({
11578
+ dropdownToolsDefault: z14.array(ContractIdentifierSchema).optional(),
11579
+ layoutManagerTools: z14.array(WorkbenchCustomerToolSchema).optional(),
11580
+ studioTabsMode: z14.enum(["dropdown", "tabs"]).optional(),
11581
+ historyWatermark: z14.object({
11582
+ svgUrl: z14.string().optional(),
11583
+ coverage: z14.array(z14.enum(["list", "detail", "download"])).optional(),
11584
+ maxLongEdgeRatio: z14.number().positive().optional(),
11585
+ sizing: z14.object({
11551
11586
  mode: ContractIdentifierSchema,
11552
- heightRatio: z13.number().positive().optional(),
11553
- minHeightPx: z13.number().nonnegative().optional(),
11554
- maxHeightPx: z13.number().nonnegative().optional()
11587
+ heightRatio: z14.number().positive().optional(),
11588
+ minHeightPx: z14.number().nonnegative().optional(),
11589
+ maxHeightPx: z14.number().nonnegative().optional()
11555
11590
  }).strict().optional(),
11556
- enhance: z13.object({
11557
- enabled: z13.boolean().optional(),
11558
- backgroundLumaThreshold: z13.number().min(0).max(1).optional(),
11559
- stroke: z13.object({
11560
- color: z13.string().optional(),
11561
- opacity: z13.number().min(0).max(1).optional(),
11562
- widthRatio: z13.number().nonnegative().optional(),
11563
- blurRatio: z13.number().nonnegative().optional(),
11564
- steps: z13.number().int().positive().optional()
11591
+ enhance: z14.object({
11592
+ enabled: z14.boolean().optional(),
11593
+ backgroundLumaThreshold: z14.number().min(0).max(1).optional(),
11594
+ stroke: z14.object({
11595
+ color: z14.string().optional(),
11596
+ opacity: z14.number().min(0).max(1).optional(),
11597
+ widthRatio: z14.number().nonnegative().optional(),
11598
+ blurRatio: z14.number().nonnegative().optional(),
11599
+ steps: z14.number().int().positive().optional()
11565
11600
  }).strict().optional()
11566
11601
  }).strict().optional()
11567
11602
  }).strict().optional(),
11568
- layoutManagerEnabled: z13.boolean().optional(),
11569
- existingToolsDefault: z13.array(ContractIdentifierSchema).optional(),
11570
- historyColumnsDefault: z13.number().int().min(1).max(6).optional(),
11571
- studioOverrides: z13.array(WorkbenchStudioOverrideSchema).optional()
11603
+ layoutManagerEnabled: z14.boolean().optional(),
11604
+ existingToolsDefault: z14.array(ContractIdentifierSchema).optional(),
11605
+ historyColumnsDefault: z14.number().int().min(1).max(6).optional(),
11606
+ studioOverrides: z14.array(WorkbenchStudioOverrideSchema).optional()
11572
11607
  }).strict().optional()
11573
11608
  }).strict().superRefine(({ pages, pageGroups }, context) => {
11574
11609
  const pageIds = pages.map(({ definition }) => definition.pageId);
@@ -11592,38 +11627,38 @@ var TenantWorkbenchConfigSchema = z13.object({
11592
11627
  });
11593
11628
  });
11594
11629
  });
11595
- var LoginPageSchema = z13.object({
11596
- background: z13.object({ imageUrl: z13.string().optional(), gradient: z13.string().optional() }).strict().optional(),
11597
- logo: z13.object({
11598
- url: z13.string().optional(),
11599
- lightUrl: z13.string().optional(),
11600
- darkUrl: z13.string().optional(),
11601
- position: z13.enum(["top", "middle", "bottom"]).optional(),
11602
- scale: z13.number().positive().optional()
11630
+ var LoginPageSchema = z14.object({
11631
+ background: z14.object({ imageUrl: z14.string().optional(), gradient: z14.string().optional() }).strict().optional(),
11632
+ logo: z14.object({
11633
+ url: z14.string().optional(),
11634
+ lightUrl: z14.string().optional(),
11635
+ darkUrl: z14.string().optional(),
11636
+ position: z14.enum(["top", "middle", "bottom"]).optional(),
11637
+ scale: z14.number().positive().optional()
11603
11638
  }).strict().optional(),
11604
- customCss: z13.string().optional()
11639
+ customCss: z14.string().optional()
11605
11640
  }).strict();
11606
11641
  var LandingPageHeadbarConfigShape = {
11607
- headbarMode: z13.enum(["shared", "hidden"]).optional()
11642
+ headbarMode: z14.enum(["shared", "hidden"]).optional()
11608
11643
  };
11609
- var LandingPageDefaultConfigSchema = z13.object({
11610
- mode: z13.literal("default"),
11644
+ var LandingPageDefaultConfigSchema = z14.object({
11645
+ mode: z14.literal("default"),
11611
11646
  ...LandingPageHeadbarConfigShape
11612
11647
  }).strict();
11613
- var LandingPageMarkdownConfigSchema = z13.object({
11614
- mode: z13.literal("markdown"),
11615
- content: z13.string(),
11648
+ var LandingPageMarkdownConfigSchema = z14.object({
11649
+ mode: z14.literal("markdown"),
11650
+ content: z14.string(),
11616
11651
  ...LandingPageHeadbarConfigShape
11617
11652
  }).strict();
11618
- var LandingPageHtmlConfigSchema = z13.object({
11619
- mode: z13.literal("html"),
11620
- content: z13.string(),
11653
+ var LandingPageHtmlConfigSchema = z14.object({
11654
+ mode: z14.literal("html"),
11655
+ content: z14.string(),
11621
11656
  ...LandingPageHeadbarConfigShape
11622
11657
  }).strict();
11623
- var LandingPageIframeConfigSchema = z13.object({
11624
- mode: z13.literal("iframe"),
11658
+ var LandingPageIframeConfigSchema = z14.object({
11659
+ mode: z14.literal("iframe"),
11625
11660
  ...LandingPageHeadbarConfigShape,
11626
- url: z13.string().refine((value) => {
11661
+ url: z14.string().refine((value) => {
11627
11662
  if (/^\/(?!\/)/.test(value)) {
11628
11663
  return !value.includes("\\");
11629
11664
  }
@@ -11635,473 +11670,480 @@ var LandingPageIframeConfigSchema = z13.object({
11635
11670
  }
11636
11671
  }, "Landing page iframe URL must use a root-relative path or HTTP(S) without embedded credentials.")
11637
11672
  }).strict();
11638
- var TenantLandingPageConfigSchema = z13.discriminatedUnion("mode", [
11673
+ var TenantLandingPageConfigSchema = z14.discriminatedUnion("mode", [
11639
11674
  LandingPageDefaultConfigSchema,
11640
11675
  LandingPageMarkdownConfigSchema,
11641
11676
  LandingPageHtmlConfigSchema,
11642
11677
  LandingPageIframeConfigSchema
11643
11678
  ]);
11644
- var TenantApplicationConfigSchema = z13.object({
11645
- theme: z13.object({
11646
- id: z13.string().optional(),
11647
- name: z13.string().optional(),
11648
- title: z13.string().optional(),
11679
+ var TenantApplicationConfigSchema = z14.object({
11680
+ theme: z14.object({
11681
+ id: z14.string().optional(),
11682
+ name: z14.string().optional(),
11683
+ title: z14.string().optional(),
11649
11684
  favicon: AssetVariantsSchema.optional(),
11650
11685
  logo: AssetVariantsSchema.optional(),
11651
- pwaIcon: z13.string().optional(),
11652
- form: z13.object({ variant: z13.enum(["bento", "ghost"]) }).strict().optional(),
11653
- toast: z13.object({
11654
- position: z13.enum(["top-right", "top-left", "bottom-right", "bottom-left", "top-center", "bottom-center"])
11686
+ pwaIcon: z14.string().optional(),
11687
+ form: z14.object({ variant: z14.enum(["bento", "ghost"]) }).strict().optional(),
11688
+ toast: z14.object({
11689
+ position: z14.enum(["top-right", "top-left", "bottom-right", "bottom-left", "top-center", "bottom-center"])
11655
11690
  }).strict().optional(),
11656
- icons: z13.object({ error: CustomIconSchema.optional(), empty: CustomIconSchema.optional() }).strict().optional(),
11657
- views: z13.object({
11658
- form: z13.object({
11659
- toast: z13.object({ afterCreate: z13.boolean(), afterDelete: z13.boolean() }).strict(),
11660
- progress: z13.enum(["estimate", "infinite"]),
11661
- onlyResult: z13.boolean(),
11662
- tabular: z13.object({ theme: z13.enum(["default", "tentiary", "primary"]) }).strict()
11691
+ icons: z14.object({ error: CustomIconSchema.optional(), empty: CustomIconSchema.optional() }).strict().optional(),
11692
+ views: z14.object({
11693
+ form: z14.object({
11694
+ toast: z14.object({ afterCreate: z14.boolean(), afterDelete: z14.boolean() }).strict(),
11695
+ progress: z14.enum(["estimate", "infinite"]),
11696
+ onlyResult: z14.boolean(),
11697
+ tabular: z14.object({ theme: z14.enum(["default", "tentiary", "primary"]) }).strict()
11663
11698
  }).strict()
11664
11699
  }).strict().optional(),
11665
11700
  loginPage: LoginPageSchema.optional(),
11666
- extraLanguageURL: z13.record(z13.string(), z13.string()).optional(),
11667
- hideSpaceHeader: z13.boolean().optional(),
11668
- showSidebarTeamSelector: z13.boolean().optional(),
11669
- showWorkbenchSidebar: z13.boolean().optional(),
11670
- workbenchViewTheme: z13.enum(["default", "bsd-blue"]).optional(),
11671
- defaults: z13.object({
11672
- showFormInImageDetail: z13.boolean().optional(),
11673
- darkMode: z13.enum(["light", "dark", "auto"]).optional(),
11674
- language: z13.enum(["en-US", "zh-CN", "ja-JP"]).optional(),
11675
- showDarkModeToggle: z13.boolean().optional(),
11676
- showLanguageToggle: z13.boolean().optional()
11701
+ extraLanguageURL: z14.record(z14.string(), z14.string()).optional(),
11702
+ hideSpaceHeader: z14.boolean().optional(),
11703
+ showSidebarTeamSelector: z14.boolean().optional(),
11704
+ showWorkbenchSidebar: z14.boolean().optional(),
11705
+ workbenchViewTheme: z14.enum(["default", "bsd-blue"]).optional(),
11706
+ defaults: z14.object({
11707
+ showFormInImageDetail: z14.boolean().optional(),
11708
+ darkMode: z14.enum(["light", "dark", "auto"]).optional(),
11709
+ language: z14.enum(["en-US", "zh-CN", "ja-JP"]).optional(),
11710
+ showDarkModeToggle: z14.boolean().optional(),
11711
+ showLanguageToggle: z14.boolean().optional()
11677
11712
  }).strict().optional(),
11678
- modules: z13.object({
11679
- monkeysSpaceSidebar: z13.union([z13.literal("*"), z13.array(ContractIdentifierSchema)]).optional(),
11680
- monkeysSpaceHeadbar: z13.union([
11681
- z13.literal("*"),
11682
- z13.array(TenantHeadbarModuleItemSchema)
11713
+ modules: z14.object({
11714
+ monkeysSpaceSidebar: z14.union([z14.literal("*"), z14.array(ContractIdentifierSchema)]).optional(),
11715
+ monkeysSpaceHeadbar: z14.union([
11716
+ z14.literal("*"),
11717
+ z14.array(TenantHeadbarModuleItemSchema)
11683
11718
  ]).optional(),
11684
- settingsSidebar: z13.union([z13.literal("*"), z13.array(ContractIdentifierSchema)]).optional()
11719
+ settingsSidebar: z14.union([z14.literal("*"), z14.array(ContractIdentifierSchema)]).optional()
11685
11720
  }).strict().optional(),
11686
11721
  headbar: ThemeHeadbarSchema.optional(),
11687
- kernelLayout: z13.object({
11688
- navigationMode: z13.enum(["sidebar", "topbar"]).optional(),
11689
- allowNavigationModeSwitch: z13.boolean().optional(),
11722
+ kernelLayout: z14.object({
11723
+ navigationMode: z14.enum(["sidebar", "topbar"]).optional(),
11724
+ allowNavigationModeSwitch: z14.boolean().optional(),
11690
11725
  headbar: KernelHeadbarSchema.optional()
11691
11726
  }).strict().optional(),
11692
- paginationPosition: z13.enum(["left", "right"]).optional(),
11693
- ugcViewIconOnlyMode: z13.boolean().optional(),
11694
- workflowPreviewExecutionGrid: z13.object({
11695
- selectionModeDisplayType: z13.enum(["operation-button", "dropdown-menu"]).optional(),
11696
- clickBehavior: z13.enum(["preview", "select", "fill-form", "none"]).optional(),
11697
- showErrorFilter: z13.boolean().optional(),
11698
- displayType: z13.enum(["grid", "masonry"]).optional(),
11699
- showDetailButton: z13.boolean().optional()
11727
+ paginationPosition: z14.enum(["left", "right"]).optional(),
11728
+ ugcViewIconOnlyMode: z14.boolean().optional(),
11729
+ workflowPreviewExecutionGrid: z14.object({
11730
+ selectionModeDisplayType: z14.enum(["operation-button", "dropdown-menu"]).optional(),
11731
+ clickBehavior: z14.enum(["preview", "select", "fill-form", "none"]).optional(),
11732
+ showErrorFilter: z14.boolean().optional(),
11733
+ displayType: z14.enum(["grid", "masonry"]).optional(),
11734
+ showDetailButton: z14.boolean().optional()
11700
11735
  }).strict().optional(),
11701
- workbenchSidebarDefaultOpen: z13.boolean().optional(),
11702
- workbenchSidebarMoreAction: z13.boolean().optional(),
11703
- workbenchSidebarApart: z13.boolean().optional(),
11704
- workbenchSidebarToggleGroupDetail: z13.boolean().optional(),
11705
- workbenchSidebarViewType: z13.boolean().optional(),
11706
- workbenchSidebarFormViewEmbed: z13.boolean().optional(),
11707
- workbenchSidebarModernMode: z13.boolean().optional(),
11708
- ugc: z13.object({ onItemClick: z13.boolean(), subtitle: z13.boolean().optional() }).strict().optional(),
11709
- uniImagePreview: z13.boolean().optional(),
11710
- imagePreviewStyle: z13.union([z13.literal(false), z13.enum(["simple", "normal", "uni"])]).optional(),
11711
- teamAsUser: z13.boolean().optional(),
11712
- themeMode: z13.enum(["shadow", "border"]).optional(),
11713
- density: z13.enum(["compact", "default", "comfortable"]).optional(),
11714
- pageZoom: z13.number().positive().optional(),
11715
- miniMode: z13.object({ showPreviewViewExecutionResultGrid: z13.boolean() }).strict().optional(),
11716
- workflow: z13.object({ allowConcurrentRuns: z13.boolean() }).strict().optional(),
11717
- historyResult: z13.object({ display: z13.boolean() }).strict().optional(),
11718
- uploader: z13.object({
11719
- orientation: z13.enum(["vertical", "horizontal"]),
11720
- pasteButton: z13.boolean(),
11721
- statusText: z13.boolean()
11736
+ workbenchSidebarDefaultOpen: z14.boolean().optional(),
11737
+ workbenchSidebarMoreAction: z14.boolean().optional(),
11738
+ workbenchSidebarApart: z14.boolean().optional(),
11739
+ workbenchSidebarToggleGroupDetail: z14.boolean().optional(),
11740
+ workbenchSidebarViewType: z14.boolean().optional(),
11741
+ workbenchSidebarFormViewEmbed: z14.boolean().optional(),
11742
+ workbenchSidebarModernMode: z14.boolean().optional(),
11743
+ ugc: z14.object({ onItemClick: z14.boolean(), subtitle: z14.boolean().optional() }).strict().optional(),
11744
+ uniImagePreview: z14.boolean().optional(),
11745
+ imagePreviewStyle: z14.union([z14.literal(false), z14.enum(["simple", "normal", "uni"])]).optional(),
11746
+ teamAsUser: z14.boolean().optional(),
11747
+ themeMode: z14.enum(["shadow", "border"]).optional(),
11748
+ density: z14.enum(["compact", "default", "comfortable"]).optional(),
11749
+ statusStates: z14.object({
11750
+ loading: z14.object({ variant: z14.enum(["spinner", "skeleton"]).optional() }).strict().optional(),
11751
+ empty: z14.object({ variant: z14.enum(["default", "compact"]).optional() }).strict().optional(),
11752
+ error: z14.object({ showRetry: z14.boolean().optional() }).strict().optional(),
11753
+ permission: z14.object({ showRequestAccess: z14.boolean().optional() }).strict().optional(),
11754
+ density: z14.enum(["compact", "default", "comfortable"]).optional()
11722
11755
  }).strict().optional(),
11723
- designProjects: z13.object({
11724
- oneOnOne: z13.boolean(),
11725
- newTabOpenBoard: z13.boolean(),
11726
- defaultShowGrid: z13.boolean().optional(),
11727
- createDefaultFrame: z13.boolean(),
11728
- showPageMenu: z13.boolean(),
11729
- showMainMenu: z13.boolean(),
11730
- showStylePanel: z13.boolean(),
11731
- showToolbar: z13.boolean(),
11732
- toolbarPosition: z13.enum(["bottom", "left"]).optional(),
11733
- showContextMenu: z13.boolean(),
11734
- showActionsMenu: z13.boolean(),
11735
- showPageAndLayerSidebar: z13.boolean().optional(),
11736
- showBoardOperationSidebar: z13.boolean().optional(),
11737
- showMiniToolsToolbar: z13.boolean().optional(),
11738
- showRightSidebar: z13.boolean().optional(),
11739
- showRealtimeDrawing: z13.boolean().optional(),
11740
- showWorkflow: z13.boolean().optional(),
11741
- showVersionManager: z13.boolean().optional(),
11742
- showAgent: z13.boolean().optional(),
11743
- AgentTools: z13.array(ContractIdentifierSchema).optional()
11756
+ pageZoom: z14.number().positive().optional(),
11757
+ miniMode: z14.object({ showPreviewViewExecutionResultGrid: z14.boolean() }).strict().optional(),
11758
+ workflow: z14.object({ allowConcurrentRuns: z14.boolean() }).strict().optional(),
11759
+ historyResult: z14.object({ display: z14.boolean() }).strict().optional(),
11760
+ uploader: z14.object({
11761
+ orientation: z14.enum(["vertical", "horizontal"]),
11762
+ pasteButton: z14.boolean(),
11763
+ statusText: z14.boolean()
11764
+ }).strict().optional(),
11765
+ designProjects: z14.object({
11766
+ oneOnOne: z14.boolean(),
11767
+ newTabOpenBoard: z14.boolean(),
11768
+ defaultShowGrid: z14.boolean().optional(),
11769
+ createDefaultFrame: z14.boolean(),
11770
+ showPageMenu: z14.boolean(),
11771
+ showMainMenu: z14.boolean(),
11772
+ showStylePanel: z14.boolean(),
11773
+ showToolbar: z14.boolean(),
11774
+ toolbarPosition: z14.enum(["bottom", "left"]).optional(),
11775
+ showContextMenu: z14.boolean(),
11776
+ showActionsMenu: z14.boolean(),
11777
+ showPageAndLayerSidebar: z14.boolean().optional(),
11778
+ showBoardOperationSidebar: z14.boolean().optional(),
11779
+ showMiniToolsToolbar: z14.boolean().optional(),
11780
+ showRightSidebar: z14.boolean().optional(),
11781
+ showRealtimeDrawing: z14.boolean().optional(),
11782
+ showWorkflow: z14.boolean().optional(),
11783
+ showVersionManager: z14.boolean().optional(),
11784
+ showAgent: z14.boolean().optional(),
11785
+ AgentTools: z14.array(ContractIdentifierSchema).optional()
11744
11786
  }).strict().optional(),
11745
11787
  workbench: TenantWorkbenchConfigSchema.optional(),
11746
- visionProWorkflows: z13.array(ContractIdentifierSchema).optional(),
11747
- initTeam: z13.boolean().optional(),
11748
- imageThumbnail: z13.boolean().optional(),
11749
- pages: z13.object({
11750
- allowPageKeys: z13.union([z13.literal("*"), z13.array(ContractIdentifierSchema)]),
11788
+ visionProWorkflows: z14.array(ContractIdentifierSchema).optional(),
11789
+ initTeam: z14.boolean().optional(),
11790
+ imageThumbnail: z14.boolean().optional(),
11791
+ pages: z14.object({
11792
+ allowPageKeys: z14.union([z14.literal("*"), z14.array(ContractIdentifierSchema)]),
11751
11793
  defaultPageKey: ContractIdentifierSchema.optional(),
11752
- homeEntryEnabled: z13.boolean().optional()
11794
+ homeEntryEnabled: z14.boolean().optional()
11753
11795
  }).strict().optional(),
11754
- agent: z13.object({
11796
+ agent: z14.object({
11755
11797
  logo: AssetVariantsSchema.optional(),
11756
- brandDisplayMode: z13.enum(["auto", "logo-only", "logo-name", "name-only"]).optional(),
11757
- density: z13.enum(["compact", "default", "comfortable"]).optional(),
11758
- sessionCentric: z13.boolean().optional(),
11759
- quickStartEnabled: z13.boolean().optional()
11798
+ brandDisplayMode: z14.enum(["auto", "logo-only", "logo-name", "name-only"]).optional(),
11799
+ density: z14.enum(["compact", "default", "comfortable"]).optional(),
11800
+ sessionCentric: z14.boolean().optional(),
11801
+ quickStartEnabled: z14.boolean().optional()
11760
11802
  }).strict().optional()
11761
11803
  }).strict(),
11762
11804
  landingPage: TenantLandingPageConfigSchema.optional(),
11763
- auth: z13.object({
11764
- enabled: z13.array(ContractIdentifierSchema).default([]),
11765
- oidc: z13.object({ buttonText: z13.string().optional(), autoSignin: z13.boolean().optional() }).strict().optional(),
11766
- password: z13.object({ disableAutoRegister: z13.boolean().optional() }).strict().optional(),
11767
- hideAuthToast: z13.boolean().optional(),
11768
- autoReload: z13.boolean().optional(),
11769
- defaultOtherTeam: z13.boolean().optional()
11805
+ auth: z14.object({
11806
+ enabled: z14.array(ContractIdentifierSchema).default([]),
11807
+ oidc: z14.object({ buttonText: z14.string().optional(), autoSignin: z14.boolean().optional() }).strict().optional(),
11808
+ password: z14.object({ disableAutoRegister: z14.boolean().optional() }).strict().optional(),
11809
+ hideAuthToast: z14.boolean().optional(),
11810
+ autoReload: z14.boolean().optional(),
11811
+ defaultOtherTeam: z14.boolean().optional()
11770
11812
  }).strict(),
11771
- endpoints: z13.record(ContractIdentifierSchema, z13.string()),
11772
- module: z13.union([z13.literal("*"), z13.array(ContractIdentifierSchema)]),
11773
- behavior: z13.object({
11774
- clearWorkflowFormStorageAfterUpdate: z13.boolean().optional(),
11775
- autoApproveOAuth: z13.boolean().optional(),
11776
- rememberWorkflowModelSelection: z13.boolean().optional()
11813
+ endpoints: z14.record(ContractIdentifierSchema, z14.string()),
11814
+ module: z14.union([z14.literal("*"), z14.array(ContractIdentifierSchema)]),
11815
+ behavior: z14.object({
11816
+ clearWorkflowFormStorageAfterUpdate: z14.boolean().optional(),
11817
+ autoApproveOAuth: z14.boolean().optional(),
11818
+ rememberWorkflowModelSelection: z14.boolean().optional()
11777
11819
  }).strict(),
11778
- dataManagement: z13.object({
11779
- favoriteOntologyId: z13.string().optional(),
11780
- pairedOntologyId: z13.string().optional(),
11781
- galleryOntologyIds: z13.array(ContractIdentifierSchema).max(20).optional(),
11782
- galleryOntologyId: z13.string().optional(),
11783
- dataBrowserDefaultOntologyId: z13.string().optional(),
11784
- workflowResultOntologyId: z13.string().optional(),
11785
- homeAdvertisement: z13.object({
11820
+ dataManagement: z14.object({
11821
+ favoriteOntologyId: z14.string().optional(),
11822
+ pairedOntologyId: z14.string().optional(),
11823
+ galleryOntologyIds: z14.array(ContractIdentifierSchema).max(20).optional(),
11824
+ galleryOntologyId: z14.string().optional(),
11825
+ dataBrowserDefaultOntologyId: z14.string().optional(),
11826
+ workflowResultOntologyId: z14.string().optional(),
11827
+ homeAdvertisement: z14.object({
11786
11828
  ontologyId: ContractIdentifierSchema,
11787
11829
  viewId: ContractIdentifierSchema.optional(),
11788
- viewType: z13.enum(["filter", "container", "share_link"]).optional(),
11830
+ viewType: z14.enum(["filter", "container", "share_link"]).optional(),
11789
11831
  teamId: ContractIdentifierSchema.optional(),
11790
- teamOnly: z13.boolean().optional(),
11791
- pageSize: z13.number().int().positive().optional(),
11792
- sortBy: z13.enum(["pin_order", "asset_id", "updated_timestamp", "created_timestamp"]).optional(),
11793
- sortOrder: z13.enum(["asc", "desc"]).optional(),
11794
- fieldMap: z13.record(z13.string(), z13.string()).optional(),
11795
- columnIds: z13.record(z13.string(), z13.string()).optional()
11832
+ teamOnly: z14.boolean().optional(),
11833
+ pageSize: z14.number().int().positive().optional(),
11834
+ sortBy: z14.enum(["pin_order", "asset_id", "updated_timestamp", "created_timestamp"]).optional(),
11835
+ sortOrder: z14.enum(["asc", "desc"]).optional(),
11836
+ fieldMap: z14.record(z14.string(), z14.string()).optional(),
11837
+ columnIds: z14.record(z14.string(), z14.string()).optional()
11796
11838
  }).strict().optional(),
11797
- homeTrendAssistant: z13.object({
11839
+ homeTrendAssistant: z14.object({
11798
11840
  ontologyId: ContractIdentifierSchema.optional(),
11799
11841
  viewId: ContractIdentifierSchema.optional(),
11800
11842
  viewInstanceId: ContractIdentifierSchema.optional(),
11801
- viewName: z13.string().optional(),
11843
+ viewName: z14.string().optional(),
11802
11844
  teamId: ContractIdentifierSchema.optional(),
11803
11845
  designOptionsWorkflowId: ContractIdentifierSchema.optional(),
11804
- tep: z13.object({ baseUrl: z13.string().optional(), timeoutMs: z13.number().int().positive().optional() }).strict().optional(),
11805
- runtime: z13.object({ appId: ContractIdentifierSchema, tepBaseUrlConfigured: z13.boolean(), tepAuthorizationConfigured: z13.boolean(), tepCookieConfigured: z13.boolean() }).strict().optional()
11846
+ tep: z14.object({ baseUrl: z14.string().optional(), timeoutMs: z14.number().int().positive().optional() }).strict().optional(),
11847
+ runtime: z14.object({ appId: ContractIdentifierSchema, tepBaseUrlConfigured: z14.boolean(), tepAuthorizationConfigured: z14.boolean(), tepCookieConfigured: z14.boolean() }).strict().optional()
11806
11848
  }).strict().optional(),
11807
11849
  trendRadar: TenantTrendRadarSourcesSchema.optional(),
11808
- sharing: z13.object({
11809
- silentViewLinks: z13.object({ enabled: z13.boolean().optional(), placement: z13.object({ mode: z13.enum(["sourceOntology", "ontology"]).optional(), ontologyId: ContractIdentifierSchema.optional(), parentId: ContractIdentifierSchema.optional(), navId: ContractIdentifierSchema.optional() }).strict().optional() }).strict().optional(),
11810
- shareAccess: z13.object({ publicLinksEnabled: z13.boolean().optional(), passwordGateEnabled: z13.boolean().optional(), passwordAccessTtlSeconds: z13.number().int().positive().optional(), defaultViewTreeDelivery: z13.enum(["manual", "auto"]).optional() }).strict().optional(),
11811
- shareDialog: z13.object({
11812
- audience: z13.object({ enabled: z13.boolean().optional(), allowed: z13.array(z13.enum(["user", "team", "public"])).optional(), default: z13.enum(["user", "team", "public"]).optional() }).strict().optional(),
11813
- accessLevel: z13.object({ enabled: z13.boolean().optional(), allowed: z13.array(z13.enum(["read", "write"])).optional(), default: z13.enum(["read", "write"]).optional() }).strict().optional(),
11814
- viewTreeDelivery: z13.object({ enabled: z13.boolean().optional(), allowed: z13.array(z13.enum(["manual", "auto"])).optional(), default: z13.enum(["manual", "auto"]).optional() }).strict().optional()
11850
+ sharing: z14.object({
11851
+ 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(),
11852
+ 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(),
11853
+ shareDialog: z14.object({
11854
+ 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(),
11855
+ accessLevel: z14.object({ enabled: z14.boolean().optional(), allowed: z14.array(z14.enum(["read", "write"])).optional(), default: z14.enum(["read", "write"]).optional() }).strict().optional(),
11856
+ viewTreeDelivery: z14.object({ enabled: z14.boolean().optional(), allowed: z14.array(z14.enum(["manual", "auto"])).optional(), default: z14.enum(["manual", "auto"]).optional() }).strict().optional()
11815
11857
  }).strict().optional()
11816
11858
  }).strict().optional()
11817
11859
  }).strict().optional(),
11818
- compute: z13.object({
11819
- integrations: z13.object({
11820
- harbor: z13.object({ endpoint: z13.string().optional(), projectScopes: z13.array(z13.string()).optional(), authMode: z13.string().optional(), principal: z13.string().optional(), autoSync: z13.boolean().optional(), proxyUrl: z13.string().optional() }).strict().optional(),
11821
- gitlab: z13.object({ baseUrl: z13.string().optional(), groupScopes: z13.array(z13.string()).optional(), tokenMode: z13.string().optional(), deployProjectPath: z13.string().optional(), deploymentReportsEnabled: z13.boolean().optional(), proxyUrl: z13.string().optional() }).strict().optional(),
11822
- kubernetes: z13.object({ accessMode: z13.string().optional(), clusterAlias: z13.string().optional(), agentProjectPath: z13.string().optional(), agentName: z13.string().optional(), namespaceScopes: z13.array(z13.string()).optional(), rolloutObserverEnabled: z13.boolean().optional(), proxyUrl: z13.string().optional() }).strict().optional()
11860
+ compute: z14.object({
11861
+ integrations: z14.object({
11862
+ 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(),
11863
+ 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(),
11864
+ 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()
11823
11865
  }).strict().optional()
11824
11866
  }).strict().optional(),
11825
- data: z13.object({}).strict().optional(),
11826
- storage: z13.object({
11827
- presignMode: z13.enum(["frontend", "backend", "both"]).optional(),
11828
- presign: z13.object({
11829
- expiresInSeconds: z13.number().int().positive(),
11830
- buckets: z13.array(
11831
- z13.object({
11867
+ data: z14.object({}).strict().optional(),
11868
+ storage: z14.object({
11869
+ presignMode: z14.enum(["frontend", "backend", "both"]).optional(),
11870
+ presign: z14.object({
11871
+ expiresInSeconds: z14.number().int().positive(),
11872
+ buckets: z14.array(
11873
+ z14.object({
11832
11874
  id: ContractIdentifierSchema,
11833
11875
  provider: ContractIdentifierSchema,
11834
11876
  preferredUrlPatternId: ContractIdentifierSchema,
11835
- urlPatterns: z13.array(
11836
- z13.object({
11877
+ urlPatterns: z14.array(
11878
+ z14.object({
11837
11879
  id: ContractIdentifierSchema,
11838
- type: z13.enum(["bucket-hostname", "provider-hostname"]),
11839
- hostname: z13.string().trim().min(1),
11840
- preferred: z13.boolean().optional(),
11841
- bucketSegment: z13.string().optional()
11880
+ type: z14.enum(["bucket-hostname", "provider-hostname"]),
11881
+ hostname: z14.string().trim().min(1),
11882
+ preferred: z14.boolean().optional(),
11883
+ bucketSegment: z14.string().optional()
11842
11884
  }).strict()
11843
11885
  )
11844
11886
  }).strict()
11845
11887
  )
11846
11888
  }).strict().optional()
11847
11889
  }).strict().optional(),
11848
- monkeyData: z13.object({ baseUrl: z13.string().optional() }).strict().optional()
11890
+ monkeyData: z14.object({ baseUrl: z14.string().optional() }).strict().optional()
11849
11891
  }).strict();
11850
- var TenantProductConfigSchema = z13.object({
11851
- contract: z13.literal("TenantProductConfig"),
11892
+ var TenantProductConfigSchema = z14.object({
11893
+ contract: z14.literal("TenantProductConfig"),
11852
11894
  tenantId: ContractIdentifierSchema,
11853
11895
  appId: ContractIdentifierSchema,
11854
11896
  environment: ContractIdentifierSchema,
11855
11897
  designTokens: TenantDesignTokensConfigSchema,
11856
- moduleRefs: z13.array(ContractIdentifierSchema).default([]),
11857
- pageRefs: z13.array(ContractIdentifierSchema).default([]),
11858
- featureFlags: z13.record(z13.string(), z13.boolean()).default({}),
11898
+ moduleRefs: z14.array(ContractIdentifierSchema).default([]),
11899
+ pageRefs: z14.array(ContractIdentifierSchema).default([]),
11900
+ featureFlags: z14.record(z14.string(), z14.boolean()).default({}),
11859
11901
  authBinding: TenantAuthBindingsSchema,
11860
11902
  dataBinding: TenantDataBindingsSchema,
11861
- sourceMap: z13.record(z13.string(), ContractIdentifierSchema),
11862
- warnings: z13.array(z13.string()).default([]),
11903
+ sourceMap: z14.record(z14.string(), ContractIdentifierSchema),
11904
+ warnings: z14.array(z14.string()).default([]),
11863
11905
  menus: MenuDefinitionSetSchema.optional(),
11864
11906
  applicationConfig: TenantApplicationConfigSchema
11865
11907
  }).strict();
11866
- var TenantRuntimeConfigSchema = z13.object({
11867
- contract: z13.literal("TenantRuntimeConfig"),
11908
+ var TenantRuntimeConfigSchema = z14.object({
11909
+ contract: z14.literal("TenantRuntimeConfig"),
11868
11910
  tenantId: ContractIdentifierSchema,
11869
11911
  appId: ContractIdentifierSchema,
11870
11912
  environment: ContractIdentifierSchema,
11871
11913
  designTokens: ResolvedThemeTokensSchema,
11872
- moduleRefs: z13.array(ContractIdentifierSchema).default([]),
11873
- pageRefs: z13.array(ContractIdentifierSchema).default([]),
11874
- featureFlags: z13.record(z13.string(), z13.boolean()).default({}),
11914
+ moduleRefs: z14.array(ContractIdentifierSchema).default([]),
11915
+ pageRefs: z14.array(ContractIdentifierSchema).default([]),
11916
+ featureFlags: z14.record(z14.string(), z14.boolean()).default({}),
11875
11917
  authBinding: TenantAuthBindingsSchema,
11876
11918
  dataBinding: TenantDataBindingsSchema,
11877
- sourceMap: z13.record(z13.string(), ContractIdentifierSchema),
11878
- warnings: z13.array(z13.string()).default([]),
11919
+ sourceMap: z14.record(z14.string(), ContractIdentifierSchema),
11920
+ warnings: z14.array(z14.string()).default([]),
11879
11921
  menuBundle: MenuRuntimeBundleSchema.optional(),
11880
11922
  applicationConfig: TenantApplicationConfigSchema
11881
11923
  }).strict();
11882
11924
 
11883
11925
  // src/contracts/trend.ts
11884
- import { z as z14 } from "zod";
11885
- var RadarDecisionMetricsSchema = z14.object({
11886
- currentSales: z14.number().finite(),
11887
- forecastSales: z14.number().finite(),
11888
- searchHeat: z14.number().finite(),
11889
- socialHeat: z14.number().finite(),
11890
- confidence: z14.number().min(0).max(1)
11891
- }).strict();
11892
- var TrendSourceSchema = z14.object({
11926
+ import { z as z15 } from "zod";
11927
+ var RadarDecisionMetricsSchema = z15.object({
11928
+ currentSales: z15.number().finite(),
11929
+ forecastSales: z15.number().finite(),
11930
+ searchHeat: z15.number().finite(),
11931
+ socialHeat: z15.number().finite(),
11932
+ confidence: z15.number().min(0).max(1)
11933
+ }).strict();
11934
+ var TrendSourceSchema = z15.object({
11893
11935
  sourceId: ContractIdentifierSchema,
11894
11936
  provider: ContractIdentifierSchema,
11895
- channel: z14.enum(["trend", "ecommerce", "social", "search", "internal"]),
11937
+ channel: z15.enum(["trend", "ecommerce", "social", "search", "internal"]),
11896
11938
  collectedAt: IsoDateTimeSchema,
11897
- sourceUrl: z14.string().url().optional(),
11898
- evidenceRefs: z14.array(EntityRefSchema).default([])
11939
+ sourceUrl: z15.string().url().optional(),
11940
+ evidenceRefs: z15.array(EntityRefSchema).default([])
11899
11941
  }).strict();
11900
- var TrendIngestRunSchema = z14.object({
11901
- contract: z14.literal("TrendIngestRun"),
11942
+ var TrendIngestRunSchema = z15.object({
11943
+ contract: z15.literal("TrendIngestRun"),
11902
11944
  ingestRunId: ContractIdentifierSchema,
11903
11945
  sourceId: ContractIdentifierSchema,
11904
11946
  requestId: ContractIdentifierSchema,
11905
11947
  idempotencyKey: ContractIdentifierSchema,
11906
- status: z14.enum(["RUNNING", "SUCCEEDED", "FAILED", "PARTIAL"]),
11907
- recordCount: z14.number().int().nonnegative(),
11908
- errorCount: z14.number().int().nonnegative(),
11948
+ status: z15.enum(["RUNNING", "SUCCEEDED", "FAILED", "PARTIAL"]),
11949
+ recordCount: z15.number().int().nonnegative(),
11950
+ errorCount: z15.number().int().nonnegative(),
11909
11951
  startedAt: IsoDateTimeSchema,
11910
11952
  completedAt: IsoDateTimeSchema.optional()
11911
11953
  }).strict();
11912
- var TrendSourceRecordSchema = z14.object({
11913
- contract: z14.literal("TrendSourceRecord"),
11954
+ var TrendSourceRecordSchema = z15.object({
11955
+ contract: z15.literal("TrendSourceRecord"),
11914
11956
  sourceRecordId: ContractIdentifierSchema,
11915
11957
  source: TrendSourceSchema,
11916
11958
  ingestRunRef: EntityRefSchema,
11917
- recordVersion: z14.number().int().positive(),
11959
+ recordVersion: z15.number().int().positive(),
11918
11960
  contentHash: Sha256Schema,
11919
11961
  payload: JsonValueSchema,
11920
11962
  idempotencyKey: ContractIdentifierSchema,
11921
11963
  collectedAt: IsoDateTimeSchema
11922
11964
  }).strict();
11923
- var HotwordBodySchema = z14.object({
11924
- contract: z14.literal("HotwordBody"),
11965
+ var HotwordBodySchema = z15.object({
11966
+ contract: z15.literal("HotwordBody"),
11925
11967
  hotwordId: ContractIdentifierSchema,
11926
- label: z14.string().trim().min(1),
11927
- normalizedLabel: z14.string().trim().min(1),
11928
- categories: z14.array(ContractIdentifierSchema).default([]),
11929
- sourceRefs: z14.array(TrendSourceSchema).min(1),
11930
- relationRefs: z14.array(EntityRefSchema).default([]),
11968
+ label: z15.string().trim().min(1),
11969
+ normalizedLabel: z15.string().trim().min(1),
11970
+ categories: z15.array(ContractIdentifierSchema).default([]),
11971
+ sourceRefs: z15.array(TrendSourceSchema).min(1),
11972
+ relationRefs: z15.array(EntityRefSchema).default([]),
11931
11973
  createdAt: IsoDateTimeSchema,
11932
11974
  updatedAt: IsoDateTimeSchema
11933
11975
  }).strict();
11934
11976
  var CommerceBodyFieldsSchema = {
11935
- displayName: z14.string().trim().min(1),
11936
- normalizedName: z14.string().trim().min(1),
11937
- categories: z14.array(ContractIdentifierSchema).default([]),
11938
- sourceRefs: z14.array(EntityRefSchema).min(1),
11939
- relationRefs: z14.array(EntityRefSchema).default([]),
11977
+ displayName: z15.string().trim().min(1),
11978
+ normalizedName: z15.string().trim().min(1),
11979
+ categories: z15.array(ContractIdentifierSchema).default([]),
11980
+ sourceRefs: z15.array(EntityRefSchema).min(1),
11981
+ relationRefs: z15.array(EntityRefSchema).default([]),
11940
11982
  createdAt: IsoDateTimeSchema,
11941
11983
  updatedAt: IsoDateTimeSchema
11942
11984
  };
11943
- var BrandBodySchema = z14.object({
11944
- contract: z14.literal("BrandBody"),
11985
+ var BrandBodySchema = z15.object({
11986
+ contract: z15.literal("BrandBody"),
11945
11987
  brandId: ContractIdentifierSchema,
11946
11988
  ...CommerceBodyFieldsSchema
11947
11989
  }).strict();
11948
- var ProductBodySchema = z14.object({
11949
- contract: z14.literal("ProductBody"),
11990
+ var ProductBodySchema = z15.object({
11991
+ contract: z15.literal("ProductBody"),
11950
11992
  productId: ContractIdentifierSchema,
11951
11993
  brandRef: EntityRefSchema.optional(),
11952
11994
  ...CommerceBodyFieldsSchema
11953
11995
  }).strict();
11954
- var TrendMetricSnapshotSchema = z14.object({
11955
- contract: z14.literal("TrendMetricSnapshot"),
11996
+ var TrendMetricSnapshotSchema = z15.object({
11997
+ contract: z15.literal("TrendMetricSnapshot"),
11956
11998
  snapshotId: ContractIdentifierSchema,
11957
11999
  subjectRef: EntityRefSchema,
11958
12000
  observedAt: IsoDateTimeSchema,
11959
- metrics: z14.record(z14.string(), z14.number().finite()),
11960
- confidence: z14.number().min(0).max(1),
11961
- evidenceRefs: z14.array(EntityRefSchema).min(1)
12001
+ metrics: z15.record(z15.string(), z15.number().finite()),
12002
+ confidence: z15.number().min(0).max(1),
12003
+ evidenceRefs: z15.array(EntityRefSchema).min(1)
11962
12004
  }).strict();
11963
- var RadarScoreModelBodySchema = z14.object({
11964
- contract: z14.literal("RadarScoreModelBody"),
12005
+ var RadarScoreModelBodySchema = z15.object({
12006
+ contract: z15.literal("RadarScoreModelBody"),
11965
12007
  modelId: ContractIdentifierSchema,
11966
- version: z14.number().int().positive(),
12008
+ version: z15.number().int().positive(),
11967
12009
  weights: RadarDecisionMetricsSchema,
11968
- thresholds: z14.record(z14.string(), z14.number().finite()).default({}),
11969
- explanationRules: z14.record(z14.string(), z14.string().trim().min(1)).default({}),
12010
+ thresholds: z15.record(z15.string(), z15.number().finite()).default({}),
12011
+ explanationRules: z15.record(z15.string(), z15.string().trim().min(1)).default({}),
11970
12012
  createdAt: IsoDateTimeSchema
11971
12013
  }).strict();
11972
- var RadarScoreProjectionSchema = z14.object({
11973
- contract: z14.literal("RadarScoreProjection"),
12014
+ var RadarScoreProjectionSchema = z15.object({
12015
+ contract: z15.literal("RadarScoreProjection"),
11974
12016
  projectionId: ContractIdentifierSchema,
11975
12017
  subjectRef: EntityRefSchema,
11976
12018
  modelRef: EntityRefSchema,
11977
- totalScore: z14.number().finite(),
12019
+ totalScore: z15.number().finite(),
11978
12020
  dimensions: RadarDecisionMetricsSchema,
11979
- evidenceRefs: z14.array(EntityRefSchema).min(1),
12021
+ evidenceRefs: z15.array(EntityRefSchema).min(1),
11980
12022
  freshnessAt: IsoDateTimeSchema
11981
12023
  }).strict();
11982
- var RadarPanoramaNodeSchema = z14.object({
12024
+ var RadarPanoramaNodeSchema = z15.object({
11983
12025
  ref: EntityRefSchema,
11984
- label: z14.string().trim().min(1),
11985
- categories: z14.array(ContractIdentifierSchema).default([]),
11986
- score: z14.number().finite().optional(),
12026
+ label: z15.string().trim().min(1),
12027
+ categories: z15.array(ContractIdentifierSchema).default([]),
12028
+ score: z15.number().finite().optional(),
11987
12029
  freshnessAt: IsoDateTimeSchema.optional()
11988
12030
  }).strict();
11989
- var RadarPanoramaEdgeSchema = z14.object({
12031
+ var RadarPanoramaEdgeSchema = z15.object({
11990
12032
  sourceRef: EntityRefSchema,
11991
12033
  targetRef: EntityRefSchema,
11992
12034
  relation: ContractIdentifierSchema,
11993
- evidenceRefs: z14.array(EntityRefSchema).default([])
12035
+ evidenceRefs: z15.array(EntityRefSchema).default([])
11994
12036
  }).strict();
11995
- var RadarPanoramaSchema = z14.object({
11996
- contract: z14.literal("RadarPanorama"),
11997
- nodes: z14.array(RadarPanoramaNodeSchema),
11998
- edges: z14.array(RadarPanoramaEdgeSchema),
12037
+ var RadarPanoramaSchema = z15.object({
12038
+ contract: z15.literal("RadarPanorama"),
12039
+ nodes: z15.array(RadarPanoramaNodeSchema),
12040
+ edges: z15.array(RadarPanoramaEdgeSchema),
11999
12041
  generatedAt: IsoDateTimeSchema
12000
12042
  }).strict();
12001
- var BrandGeneticsProfileSchema = z14.object({
12002
- contract: z14.literal("BrandGeneticsProfile"),
12043
+ var BrandGeneticsProfileSchema = z15.object({
12044
+ contract: z15.literal("BrandGeneticsProfile"),
12003
12045
  brandRef: EntityRefSchema,
12004
- categories: z14.array(ContractIdentifierSchema).default([]),
12005
- signature: z14.record(ContractIdentifierSchema, z14.number().finite()),
12006
- relatedRefs: z14.array(EntityRefSchema).default([]),
12007
- evidenceRefs: z14.array(EntityRefSchema).default([]),
12046
+ categories: z15.array(ContractIdentifierSchema).default([]),
12047
+ signature: z15.record(ContractIdentifierSchema, z15.number().finite()),
12048
+ relatedRefs: z15.array(EntityRefSchema).default([]),
12049
+ evidenceRefs: z15.array(EntityRefSchema).default([]),
12008
12050
  computedAt: IsoDateTimeSchema
12009
12051
  }).strict();
12010
- var RadarOpportunityMatrixPointSchema = z14.object({
12052
+ var RadarOpportunityMatrixPointSchema = z15.object({
12011
12053
  subjectRef: EntityRefSchema,
12012
- label: z14.string().trim().min(1),
12013
- x: z14.number().finite(),
12014
- y: z14.number().finite(),
12015
- score: z14.number().finite(),
12016
- evidenceRefs: z14.array(EntityRefSchema).default([])
12017
- }).strict();
12018
- var RadarOpportunityMatrixSchema = z14.object({
12019
- contract: z14.literal("RadarOpportunityMatrix"),
12020
- xMetric: z14.enum(["currentSales", "forecastSales", "searchHeat", "socialHeat", "confidence"]),
12021
- yMetric: z14.enum(["currentSales", "forecastSales", "searchHeat", "socialHeat", "confidence"]),
12022
- points: z14.array(RadarOpportunityMatrixPointSchema),
12054
+ label: z15.string().trim().min(1),
12055
+ x: z15.number().finite(),
12056
+ y: z15.number().finite(),
12057
+ score: z15.number().finite(),
12058
+ evidenceRefs: z15.array(EntityRefSchema).default([])
12059
+ }).strict();
12060
+ var RadarOpportunityMatrixSchema = z15.object({
12061
+ contract: z15.literal("RadarOpportunityMatrix"),
12062
+ xMetric: z15.enum(["currentSales", "forecastSales", "searchHeat", "socialHeat", "confidence"]),
12063
+ yMetric: z15.enum(["currentSales", "forecastSales", "searchHeat", "socialHeat", "confidence"]),
12064
+ points: z15.array(RadarOpportunityMatrixPointSchema),
12023
12065
  computedAt: IsoDateTimeSchema
12024
12066
  }).strict();
12025
- var RadarQueryBodySchema = z14.object({
12026
- contract: z14.literal("RadarQueryBody"),
12067
+ var RadarQueryBodySchema = z15.object({
12068
+ contract: z15.literal("RadarQueryBody"),
12027
12069
  queryId: ContractIdentifierSchema,
12028
- filters: z14.record(z14.string(), JsonValueSchema).default({}),
12029
- sort: z14.object({
12070
+ filters: z15.record(z15.string(), JsonValueSchema).default({}),
12071
+ sort: z15.object({
12030
12072
  field: ContractIdentifierSchema,
12031
- direction: z14.enum(["asc", "desc"])
12073
+ direction: z15.enum(["asc", "desc"])
12032
12074
  }).strict(),
12033
- pageSize: z14.number().int().min(1).max(200),
12075
+ pageSize: z15.number().int().min(1).max(200),
12034
12076
  updatedAt: IsoDateTimeSchema
12035
12077
  }).strict();
12036
- var SavedRadarQuerySchema = z14.object({
12037
- contract: z14.literal("SavedRadarQuery"),
12078
+ var SavedRadarQuerySchema = z15.object({
12079
+ contract: z15.literal("SavedRadarQuery"),
12038
12080
  savedQueryId: ContractIdentifierSchema,
12039
12081
  teamId: ContractIdentifierSchema,
12040
12082
  ownerRef: EntityRefSchema,
12041
- name: z14.string().trim().min(1),
12083
+ name: z15.string().trim().min(1),
12042
12084
  queryRef: EntityRefSchema,
12043
- expectedVersion: z14.number().int().nonnegative(),
12085
+ expectedVersion: z15.number().int().nonnegative(),
12044
12086
  updatedAt: IsoDateTimeSchema
12045
12087
  }).strict();
12046
- var RadarSelectionSchema = z14.object({
12047
- contract: z14.literal("RadarSelection"),
12088
+ var RadarSelectionSchema = z15.object({
12089
+ contract: z15.literal("RadarSelection"),
12048
12090
  selectionId: ContractIdentifierSchema,
12049
12091
  teamId: ContractIdentifierSchema,
12050
12092
  ownerRef: EntityRefSchema,
12051
- subjectRefs: z14.array(EntityRefSchema),
12052
- status: z14.enum(["stashed", "selected", "rejected", "archived"]),
12053
- note: z14.string().optional(),
12054
- expectedVersion: z14.number().int().nonnegative(),
12093
+ subjectRefs: z15.array(EntityRefSchema),
12094
+ status: z15.enum(["stashed", "selected", "rejected", "archived"]),
12095
+ note: z15.string().optional(),
12096
+ expectedVersion: z15.number().int().nonnegative(),
12055
12097
  updatedAt: IsoDateTimeSchema
12056
12098
  }).strict();
12057
12099
  var versionedRefFields = {
12058
12100
  id: ContractIdentifierSchema,
12059
- version: z14.union([z14.number().int().positive(), z14.string().trim().min(1)]).optional(),
12101
+ version: z15.union([z15.number().int().positive(), z15.string().trim().min(1)]).optional(),
12060
12102
  ownerRepo: ContractIdentifierSchema.optional()
12061
12103
  };
12062
- var TrendRadarCollectionAssetRefSchema = z14.object({
12063
- kind: z14.literal("asset"),
12104
+ var TrendRadarCollectionAssetRefSchema = z15.object({
12105
+ kind: z15.literal("asset"),
12064
12106
  ...versionedRefFields
12065
12107
  }).strict();
12066
- var TrendRadarCollectionSelectionRefSchema = z14.object({
12067
- kind: z14.literal("radar-selection"),
12108
+ var TrendRadarCollectionSelectionRefSchema = z15.object({
12109
+ kind: z15.literal("radar-selection"),
12068
12110
  ...versionedRefFields
12069
12111
  }).strict();
12070
- var TrendRadarCollectionRunRefSchema = z14.object({
12071
- kind: z14.literal("radar-analysis-run"),
12112
+ var TrendRadarCollectionRunRefSchema = z15.object({
12113
+ kind: z15.literal("radar-analysis-run"),
12072
12114
  ...versionedRefFields
12073
12115
  }).strict();
12074
- var TrendRadarCollectionSubjectRefSchema = z14.object({
12075
- kind: z14.literal("hotword"),
12116
+ var TrendRadarCollectionSubjectRefSchema = z15.object({
12117
+ kind: z15.literal("hotword"),
12076
12118
  ...versionedRefFields
12077
12119
  }).strict();
12078
- var TrendRadarCollectionArtifactRefSchema = z14.object({
12079
- kind: z14.literal("artifact"),
12120
+ var TrendRadarCollectionArtifactRefSchema = z15.object({
12121
+ kind: z15.literal("artifact"),
12080
12122
  ...versionedRefFields
12081
12123
  }).strict();
12082
- var TrendRadarCollectionRecipeEntrySchema = z14.object({
12124
+ var TrendRadarCollectionRecipeEntrySchema = z15.object({
12083
12125
  subjectRef: TrendRadarCollectionSubjectRefSchema,
12084
- label: z14.string().trim().min(1).max(200)
12126
+ label: z15.string().trim().min(1).max(200)
12085
12127
  }).strict();
12086
- var TrendRadarCollectionRecipeSchema = z14.object({
12087
- category: z14.array(TrendRadarCollectionRecipeEntrySchema),
12088
- design: z14.array(TrendRadarCollectionRecipeEntrySchema),
12089
- audience: z14.array(TrendRadarCollectionRecipeEntrySchema)
12128
+ var TrendRadarCollectionRecipeSchema = z15.object({
12129
+ category: z15.array(TrendRadarCollectionRecipeEntrySchema),
12130
+ design: z15.array(TrendRadarCollectionRecipeEntrySchema),
12131
+ audience: z15.array(TrendRadarCollectionRecipeEntrySchema)
12090
12132
  }).strict().refine(
12091
12133
  (recipe) => recipe.category.length + recipe.design.length + recipe.audience.length > 0,
12092
12134
  "A Trend Radar collection recipe must contain at least one subject."
12093
12135
  );
12094
- var TrendRadarCollectionDecisionAxisSchema = z14.object({
12136
+ var TrendRadarCollectionDecisionAxisSchema = z15.object({
12095
12137
  key: ContractIdentifierSchema,
12096
- label: z14.string().trim().min(1).max(200).optional(),
12097
- value: z14.number().finite()
12098
- }).strict();
12099
- var TrendRadarCollectionDecisionProjectionSchema = z14.object({
12100
- axes: z14.array(TrendRadarCollectionDecisionAxisSchema).max(32).optional(),
12101
- overallScore: z14.number().finite().optional(),
12102
- itemRank: z14.number().finite().optional(),
12103
- sourceRefs: z14.array(EntityRefSchema).optional(),
12104
- outputRefs: z14.array(EntityRefSchema).optional()
12138
+ label: z15.string().trim().min(1).max(200).optional(),
12139
+ value: z15.number().finite()
12140
+ }).strict();
12141
+ var TrendRadarCollectionDecisionProjectionSchema = z15.object({
12142
+ axes: z15.array(TrendRadarCollectionDecisionAxisSchema).max(32).optional(),
12143
+ overallScore: z15.number().finite().optional(),
12144
+ itemRank: z15.number().finite().optional(),
12145
+ sourceRefs: z15.array(EntityRefSchema).optional(),
12146
+ outputRefs: z15.array(EntityRefSchema).optional()
12105
12147
  }).strict().superRefine((projection, context) => {
12106
12148
  const hasProjection = Boolean(
12107
12149
  projection.axes?.length || projection.overallScore !== void 0 || projection.itemRank !== void 0 || projection.sourceRefs?.length || projection.outputRefs?.length
@@ -12124,20 +12166,20 @@ var TrendRadarCollectionDecisionProjectionSchema = z14.object({
12124
12166
  seenAxisKeys.add(axis.key);
12125
12167
  });
12126
12168
  });
12127
- var TrendRadarCollectionArtifactProjectionSchema = z14.object({
12169
+ var TrendRadarCollectionArtifactProjectionSchema = z15.object({
12128
12170
  artifactRef: TrendRadarCollectionArtifactRefSchema,
12129
- url: z14.string().url().optional(),
12130
- thumbnailUrl: z14.string().url().optional(),
12131
- mimeType: z14.string().trim().min(1).optional(),
12171
+ url: z15.string().url().optional(),
12172
+ thumbnailUrl: z15.string().url().optional(),
12173
+ mimeType: z15.string().trim().min(1).optional(),
12132
12174
  metadata: JsonObjectSchema.optional()
12133
12175
  }).strict();
12134
- var TrendRadarCollectionProjectionWritebackSchema = z14.object({
12135
- status: z14.enum(["PENDING", "APPLIED", "FAILED"]),
12176
+ var TrendRadarCollectionProjectionWritebackSchema = z15.object({
12177
+ status: z15.enum(["PENDING", "APPLIED", "FAILED"]),
12136
12178
  updatedAt: IsoDateTimeSchema,
12137
- error: z14.object({
12179
+ error: z15.object({
12138
12180
  code: ContractIdentifierSchema,
12139
- message: z14.string().trim().min(1),
12140
- retryable: z14.boolean()
12181
+ message: z15.string().trim().min(1),
12182
+ retryable: z15.boolean()
12141
12183
  }).strict().optional()
12142
12184
  }).strict().superRefine((writeback, context) => {
12143
12185
  if (writeback.status === "FAILED" && !writeback.error) {
@@ -12155,12 +12197,12 @@ var TrendRadarCollectionProjectionWritebackSchema = z14.object({
12155
12197
  });
12156
12198
  }
12157
12199
  });
12158
- var TrendRadarCollectionItemSchema = z14.object({
12159
- contract: z14.literal("TrendRadarCollectionItem"),
12160
- schemaVersion: z14.literal(1),
12200
+ var TrendRadarCollectionItemSchema = z15.object({
12201
+ contract: z15.literal("TrendRadarCollectionItem"),
12202
+ schemaVersion: z15.literal(1),
12161
12203
  selectionRef: TrendRadarCollectionSelectionRefSchema,
12162
12204
  recipe: TrendRadarCollectionRecipeSchema,
12163
- status: z14.enum(["SAVED", "QUEUED", "RUNNING", "SUCCEEDED", "FAILED", "CANCELLED", "PARTIAL"]),
12205
+ status: z15.enum(["SAVED", "QUEUED", "RUNNING", "SUCCEEDED", "FAILED", "CANCELLED", "PARTIAL"]),
12164
12206
  latestRunRef: TrendRadarCollectionRunRefSchema.optional(),
12165
12207
  decisionProjection: TrendRadarCollectionDecisionProjectionSchema.optional(),
12166
12208
  artifactProjection: TrendRadarCollectionArtifactProjectionSchema.optional(),
@@ -12168,8 +12210,8 @@ var TrendRadarCollectionItemSchema = z14.object({
12168
12210
  updatedAt: IsoDateTimeSchema,
12169
12211
  generatedAt: IsoDateTimeSchema.optional()
12170
12212
  }).strict();
12171
- var RadarAnalysisRunSchema = z14.object({
12172
- contract: z14.literal("RadarAnalysisRun"),
12213
+ var RadarAnalysisRunSchema = z15.object({
12214
+ contract: z15.literal("RadarAnalysisRun"),
12173
12215
  runId: ContractIdentifierSchema,
12174
12216
  teamId: ContractIdentifierSchema,
12175
12217
  selectionRef: EntityRefSchema,
@@ -12180,66 +12222,66 @@ var RadarAnalysisRunSchema = z14.object({
12180
12222
  collectionAssetRef: TrendRadarCollectionAssetRefSchema.optional(),
12181
12223
  collectionProjectionWriteback: TrendRadarCollectionProjectionWritebackSchema.optional(),
12182
12224
  workflowDefinitionTeamId: ContractIdentifierSchema.optional(),
12183
- workflowInput: z14.record(z14.string(), JsonValueSchema).default({}),
12184
- createDesignProject: z14.boolean().default(true),
12185
- designProjectName: z14.string().trim().min(1).max(200).optional(),
12225
+ workflowInput: z15.record(z15.string(), JsonValueSchema).default({}),
12226
+ createDesignProject: z15.boolean().default(true),
12227
+ designProjectName: z15.string().trim().min(1).max(200).optional(),
12186
12228
  modelRef: EntityRefSchema,
12187
12229
  requestId: ContractIdentifierSchema,
12188
12230
  idempotencyKey: ContractIdentifierSchema,
12189
- status: z14.enum(["QUEUED", "RUNNING", "SUCCEEDED", "FAILED", "CANCELLED", "PARTIAL"]),
12190
- outputRefs: z14.array(EntityRefSchema).default([]),
12191
- error: z14.object({
12231
+ status: z15.enum(["QUEUED", "RUNNING", "SUCCEEDED", "FAILED", "CANCELLED", "PARTIAL"]),
12232
+ outputRefs: z15.array(EntityRefSchema).default([]),
12233
+ error: z15.object({
12192
12234
  code: ContractIdentifierSchema,
12193
- message: z14.string().trim().min(1),
12194
- retryable: z14.boolean()
12235
+ message: z15.string().trim().min(1),
12236
+ retryable: z15.boolean()
12195
12237
  }).strict().optional(),
12196
12238
  startedAt: IsoDateTimeSchema.optional(),
12197
12239
  completedAt: IsoDateTimeSchema.optional(),
12198
12240
  createdAt: IsoDateTimeSchema
12199
12241
  }).strict();
12200
- var RadarAnalysisAssetSchema = z14.object({
12242
+ var RadarAnalysisAssetSchema = z15.object({
12201
12243
  artifactRef: EntityRefSchema,
12202
12244
  kind: ContractIdentifierSchema,
12203
- mimeType: z14.string().trim().min(1).optional(),
12204
- url: z14.string().url(),
12205
- metadata: z14.record(z14.string(), JsonValueSchema).default({}),
12245
+ mimeType: z15.string().trim().min(1).optional(),
12246
+ url: z15.string().url(),
12247
+ metadata: z15.record(z15.string(), JsonValueSchema).default({}),
12206
12248
  createdAt: IsoDateTimeSchema
12207
12249
  }).strict();
12208
- var RadarAnalysisDetailSchema = z14.object({
12209
- contract: z14.literal("RadarAnalysisDetail"),
12250
+ var RadarAnalysisDetailSchema = z15.object({
12251
+ contract: z15.literal("RadarAnalysisDetail"),
12210
12252
  run: RadarAnalysisRunSchema,
12211
- runVersion: z14.number().int().positive(),
12253
+ runVersion: z15.number().int().positive(),
12212
12254
  selection: RadarSelectionSchema,
12213
- outputs: z14.array(OutputRecordSchema),
12214
- assets: z14.array(RadarAnalysisAssetSchema),
12215
- lineage: z14.array(LineageRecordSchema)
12255
+ outputs: z15.array(OutputRecordSchema),
12256
+ assets: z15.array(RadarAnalysisAssetSchema),
12257
+ lineage: z15.array(LineageRecordSchema)
12216
12258
  }).strict();
12217
- var RadarActionRecordSchema = z14.object({
12218
- contract: z14.literal("RadarActionRecord"),
12259
+ var RadarActionRecordSchema = z15.object({
12260
+ contract: z15.literal("RadarActionRecord"),
12219
12261
  actionId: ContractIdentifierSchema,
12220
12262
  teamId: ContractIdentifierSchema,
12221
12263
  actorRef: EntityRefSchema,
12222
- action: z14.enum(["stash", "select", "reject", "archive", "launch", "retry", "replay", "rollback"]),
12264
+ action: z15.enum(["stash", "select", "reject", "archive", "launch", "retry", "replay", "rollback"]),
12223
12265
  targetRef: EntityRefSchema,
12224
12266
  requestId: ContractIdentifierSchema,
12225
12267
  idempotencyKey: ContractIdentifierSchema,
12226
- expectedVersion: z14.number().int().nonnegative(),
12268
+ expectedVersion: z15.number().int().nonnegative(),
12227
12269
  occurredAt: IsoDateTimeSchema
12228
12270
  }).strict();
12229
- var RadarWritebackRecordSchema = z14.object({
12230
- contract: z14.literal("RadarWritebackRecord"),
12271
+ var RadarWritebackRecordSchema = z15.object({
12272
+ contract: z15.literal("RadarWritebackRecord"),
12231
12273
  writebackId: ContractIdentifierSchema,
12232
12274
  actionRef: EntityRefSchema,
12233
12275
  targetRef: EntityRefSchema,
12234
- status: z14.enum(["PENDING", "APPLIED", "FAILED"]),
12235
- resultingVersion: z14.number().int().nonnegative().optional(),
12236
- error: z14.string().trim().min(1).optional(),
12276
+ status: z15.enum(["PENDING", "APPLIED", "FAILED"]),
12277
+ resultingVersion: z15.number().int().nonnegative().optional(),
12278
+ error: z15.string().trim().min(1).optional(),
12237
12279
  recordedAt: IsoDateTimeSchema
12238
12280
  }).strict();
12239
12281
 
12240
12282
  // src/contracts/workflow-definition.ts
12241
- import { z as z15 } from "zod";
12242
- var ConductorTaskTypeSchema = z15.enum([
12283
+ import { z as z16 } from "zod";
12284
+ var ConductorTaskTypeSchema = z16.enum([
12243
12285
  "SIMPLE",
12244
12286
  "DYNAMIC",
12245
12287
  "FORK_JOIN",
@@ -12288,46 +12330,46 @@ var requiredTaskFields = {
12288
12330
  WAIT: ["inputParameters"],
12289
12331
  TERMINATE: ["inputParameters"]
12290
12332
  };
12291
- var ConductorTaskDefinitionSchema = z15.lazy(
12292
- () => z15.object({
12333
+ var ConductorTaskDefinitionSchema = z16.lazy(
12334
+ () => z16.object({
12293
12335
  name: ContractIdentifierSchema,
12294
12336
  taskReferenceName: ContractIdentifierSchema,
12295
12337
  type: ConductorTaskTypeSchema,
12296
- inputParameters: z15.record(z15.string(), JsonValueSchema).optional(),
12297
- startDelay: z15.number().int().nonnegative().optional(),
12298
- optional: z15.boolean().optional(),
12299
- asyncComplete: z15.boolean().optional(),
12300
- rateLimited: z15.boolean().optional(),
12301
- retryCount: z15.number().int().nonnegative().optional(),
12302
- taskDefinition: z15.record(z15.string(), JsonValueSchema).optional(),
12303
- loopCondition: z15.string().optional(),
12304
- loopOver: z15.array(ConductorTaskDefinitionSchema).optional(),
12305
- sink: z15.string().optional(),
12306
- forkTasks: z15.array(z15.array(ConductorTaskDefinitionSchema)).optional(),
12307
- joinOn: z15.array(ContractIdentifierSchema).optional(),
12308
- defaultExclusiveJoinTask: z15.array(ContractIdentifierSchema).optional(),
12309
- dynamicForkTasksParam: z15.string().optional(),
12310
- dynamicForkTasksInputParamName: z15.string().optional(),
12311
- subWorkflowParam: z15.object({
12312
- $ref: z15.string().optional(),
12338
+ inputParameters: z16.record(z16.string(), JsonValueSchema).optional(),
12339
+ startDelay: z16.number().int().nonnegative().optional(),
12340
+ optional: z16.boolean().optional(),
12341
+ asyncComplete: z16.boolean().optional(),
12342
+ rateLimited: z16.boolean().optional(),
12343
+ retryCount: z16.number().int().nonnegative().optional(),
12344
+ taskDefinition: z16.record(z16.string(), JsonValueSchema).optional(),
12345
+ loopCondition: z16.string().optional(),
12346
+ loopOver: z16.array(ConductorTaskDefinitionSchema).optional(),
12347
+ sink: z16.string().optional(),
12348
+ forkTasks: z16.array(z16.array(ConductorTaskDefinitionSchema)).optional(),
12349
+ joinOn: z16.array(ContractIdentifierSchema).optional(),
12350
+ defaultExclusiveJoinTask: z16.array(ContractIdentifierSchema).optional(),
12351
+ dynamicForkTasksParam: z16.string().optional(),
12352
+ dynamicForkTasksInputParamName: z16.string().optional(),
12353
+ subWorkflowParam: z16.object({
12354
+ $ref: z16.string().optional(),
12313
12355
  name: ContractIdentifierSchema,
12314
- version: z15.number().int().positive().optional(),
12315
- taskToDomain: z15.record(z15.string(), z15.string()).optional(),
12316
- workflowDefinition: z15.record(z15.string(), JsonValueSchema).optional()
12356
+ version: z16.number().int().positive().optional(),
12357
+ taskToDomain: z16.record(z16.string(), z16.string()).optional(),
12358
+ workflowDefinition: z16.record(z16.string(), JsonValueSchema).optional()
12317
12359
  }).strict().optional(),
12318
- decisionCases: z15.record(z15.string(), z15.array(ConductorTaskDefinitionSchema)).optional(),
12319
- defaultCase: z15.array(ConductorTaskDefinitionSchema).optional(),
12320
- evaluatorType: z15.enum(["value-param", "javascript", "graaljs"]).optional(),
12321
- expression: z15.string().optional(),
12360
+ decisionCases: z16.record(z16.string(), z16.array(ConductorTaskDefinitionSchema)).optional(),
12361
+ defaultCase: z16.array(ConductorTaskDefinitionSchema).optional(),
12362
+ evaluatorType: z16.enum(["value-param", "javascript", "graaljs"]).optional(),
12363
+ expression: z16.string().optional(),
12322
12364
  __alias: JsonValueSchema.optional(),
12323
- callbackFromWorker: z15.boolean().optional(),
12365
+ callbackFromWorker: z16.boolean().optional(),
12324
12366
  caseExpression: JsonValueSchema.optional(),
12325
- caseValueParam: z15.string().optional(),
12326
- dependencies: z15.array(JsonValueSchema).optional(),
12327
- description: z15.string().optional(),
12328
- dynamicTaskNameParam: z15.string().optional(),
12329
- joinMode: z15.string().optional(),
12330
- permissive: z15.boolean().optional(),
12367
+ caseValueParam: z16.string().optional(),
12368
+ dependencies: z16.array(JsonValueSchema).optional(),
12369
+ description: z16.string().optional(),
12370
+ dynamicTaskNameParam: z16.string().optional(),
12371
+ joinMode: z16.string().optional(),
12372
+ permissive: z16.boolean().optional(),
12331
12373
  joinTaskRef: ContractIdentifierSchema.optional(),
12332
12374
  forkTaskRef: ContractIdentifierSchema.optional()
12333
12375
  }).strict().superRefine((task, context) => {
@@ -12341,29 +12383,29 @@ var ConductorTaskDefinitionSchema = z15.lazy(
12341
12383
  }
12342
12384
  })
12343
12385
  );
12344
- var ConductorWorkflowDefinitionSchema = z15.object({
12345
- ownerApp: z15.string().optional(),
12346
- createTime: z15.number().int().nonnegative().optional(),
12347
- updateTime: z15.number().int().nonnegative().optional(),
12348
- createdBy: z15.string().optional(),
12349
- updatedBy: z15.string().optional(),
12386
+ var ConductorWorkflowDefinitionSchema = z16.object({
12387
+ ownerApp: z16.string().optional(),
12388
+ createTime: z16.number().int().nonnegative().optional(),
12389
+ updateTime: z16.number().int().nonnegative().optional(),
12390
+ createdBy: z16.string().optional(),
12391
+ updatedBy: z16.string().optional(),
12350
12392
  name: ContractIdentifierSchema,
12351
- description: z15.string().optional(),
12352
- version: z15.number().int().positive(),
12353
- tasks: z15.array(ConductorTaskDefinitionSchema),
12354
- inputParameters: z15.array(ContractIdentifierSchema),
12355
- outputParameters: z15.record(z15.string(), JsonValueSchema).optional(),
12393
+ description: z16.string().optional(),
12394
+ version: z16.number().int().positive(),
12395
+ tasks: z16.array(ConductorTaskDefinitionSchema),
12396
+ inputParameters: z16.array(ContractIdentifierSchema),
12397
+ outputParameters: z16.record(z16.string(), JsonValueSchema).optional(),
12356
12398
  failureWorkflow: ContractIdentifierSchema.optional(),
12357
- schemaVersion: z15.number().int().positive().optional(),
12358
- restartable: z15.boolean().optional(),
12359
- workflowStatusListenerEnabled: z15.boolean().optional(),
12360
- ownerEmail: z15.string().email().optional(),
12361
- timeoutPolicy: z15.enum(["TIME_OUT_WF", "ALERT_ONLY"]).optional(),
12362
- timeoutSeconds: z15.number().int().nonnegative(),
12363
- variables: z15.record(z15.string(), JsonValueSchema).optional(),
12364
- inputTemplate: z15.record(z15.string(), JsonValueSchema).optional()
12365
- }).strict();
12366
- var WorkflowParameterTypeSchema = z15.enum([
12399
+ schemaVersion: z16.number().int().positive().optional(),
12400
+ restartable: z16.boolean().optional(),
12401
+ workflowStatusListenerEnabled: z16.boolean().optional(),
12402
+ ownerEmail: z16.string().email().optional(),
12403
+ timeoutPolicy: z16.enum(["TIME_OUT_WF", "ALERT_ONLY"]).optional(),
12404
+ timeoutSeconds: z16.number().int().nonnegative(),
12405
+ variables: z16.record(z16.string(), JsonValueSchema).optional(),
12406
+ inputTemplate: z16.record(z16.string(), JsonValueSchema).optional()
12407
+ }).strict();
12408
+ var WorkflowParameterTypeSchema = z16.enum([
12367
12409
  "string",
12368
12410
  "file",
12369
12411
  "number",
@@ -12373,213 +12415,213 @@ var WorkflowParameterTypeSchema = z15.enum([
12373
12415
  "notice",
12374
12416
  "canvas-assist"
12375
12417
  ]);
12376
- var WorkflowConditionalStateSchema = z15.object({
12377
- conditions: z15.array(
12378
- z15.object({
12379
- field: z15.string(),
12380
- operator: z15.enum(["is", "isNot", "isGreaterThan", "isLessThan", "isGreaterThanOrEqual", "isLessThanOrEqual", "in", "notIn"]),
12418
+ var WorkflowConditionalStateSchema = z16.object({
12419
+ conditions: z16.array(
12420
+ z16.object({
12421
+ field: z16.string(),
12422
+ operator: z16.enum(["is", "isNot", "isGreaterThan", "isLessThan", "isGreaterThanOrEqual", "isLessThanOrEqual", "in", "notIn"]),
12381
12423
  value: JsonValueSchema
12382
12424
  }).strict()
12383
12425
  ),
12384
- logic: z15.enum(["AND", "OR"]).optional()
12385
- }).strict();
12386
- var ImageSelectMappingAppearanceSchema = z15.object({
12387
- columns: z15.number().int().min(1).max(4).optional(),
12388
- cardSize: z15.enum(["sm", "md", "lg"]).optional(),
12389
- imageAspectRatio: z15.enum(["square", "4:5", "3:4", "16:9"]).optional(),
12390
- gap: z15.enum(["sm", "md", "lg"]).optional(),
12391
- radius: z15.enum(["sm", "md", "lg", "xl"]).optional(),
12392
- borderStyle: z15.enum(["none", "soft", "strong"]).optional(),
12393
- borderWidth: z15.union([z15.literal(0), z15.literal(1), z15.literal(2)]).optional(),
12394
- enableScroll: z15.boolean().optional(),
12395
- maxHeight: z15.number().int().min(160).max(1200).optional(),
12396
- enableCollapse: z15.boolean().optional(),
12397
- visibleRows: z15.number().int().min(1).max(6).optional(),
12398
- hideLabel: z15.boolean().optional(),
12399
- hideDescription: z15.boolean().optional(),
12400
- hideValue: z15.boolean().optional()
12401
- }).strict();
12402
- var ComfyWorkflowPortBindingSchema = z15.object({
12403
- node: z15.union([z15.string(), z15.number()]),
12404
- key: z15.string().optional()
12405
- }).strict();
12406
- var WorkflowParameterTypeOptionsSchema = z15.object({
12407
- editor: z15.enum(["code", "codeNodeEditor", "htmlEditor", "sqlEditor", "json"]).optional(),
12408
- editorLanguage: z15.enum(["javaScript", "json", "python", "sql"]).optional(),
12409
- maxValue: z15.number().optional(),
12410
- minValue: z15.number().optional(),
12411
- max: z15.number().optional(),
12412
- min: z15.number().optional(),
12413
- multipleValues: z15.boolean().optional(),
12414
- numberPrecision: z15.number().nonnegative().optional(),
12415
- password: z15.boolean().optional(),
12416
- rows: z15.number().int().positive().optional(),
12417
- assetType: z15.string().optional(),
12418
- accept: z15.string().optional(),
12419
- maxSize: z15.number().positive().optional(),
12420
- fileType: z15.string().optional(),
12421
- aiMultiShotMainImageField: z15.string().optional(),
12422
- aiMultiShotWorkflowAppId: z15.string().optional(),
12423
- aiMultiShotWorkflowId: z15.string().optional(),
12424
- allowCustomInput: z15.boolean().optional(),
12425
- allowUploadVideo: z15.boolean().optional(),
12426
- aspectRatioField: z15.string().optional(),
12427
- assemblyValueType: z15.string().optional(),
12428
- autoAnalyzeDesignImage: z15.boolean().optional(),
12429
- autoDetectAspectRatio: z15.boolean().optional(),
12430
- autoIncrementId: z15.boolean().optional(),
12426
+ logic: z16.enum(["AND", "OR"]).optional()
12427
+ }).strict();
12428
+ var ImageSelectMappingAppearanceSchema = z16.object({
12429
+ columns: z16.number().int().min(1).max(4).optional(),
12430
+ cardSize: z16.enum(["sm", "md", "lg"]).optional(),
12431
+ imageAspectRatio: z16.enum(["square", "4:5", "3:4", "16:9"]).optional(),
12432
+ gap: z16.enum(["sm", "md", "lg"]).optional(),
12433
+ radius: z16.enum(["sm", "md", "lg", "xl"]).optional(),
12434
+ borderStyle: z16.enum(["none", "soft", "strong"]).optional(),
12435
+ borderWidth: z16.union([z16.literal(0), z16.literal(1), z16.literal(2)]).optional(),
12436
+ enableScroll: z16.boolean().optional(),
12437
+ maxHeight: z16.number().int().min(160).max(1200).optional(),
12438
+ enableCollapse: z16.boolean().optional(),
12439
+ visibleRows: z16.number().int().min(1).max(6).optional(),
12440
+ hideLabel: z16.boolean().optional(),
12441
+ hideDescription: z16.boolean().optional(),
12442
+ hideValue: z16.boolean().optional()
12443
+ }).strict();
12444
+ var ComfyWorkflowPortBindingSchema = z16.object({
12445
+ node: z16.union([z16.string(), z16.number()]),
12446
+ key: z16.string().optional()
12447
+ }).strict();
12448
+ var WorkflowParameterTypeOptionsSchema = z16.object({
12449
+ editor: z16.enum(["code", "codeNodeEditor", "htmlEditor", "sqlEditor", "json"]).optional(),
12450
+ editorLanguage: z16.enum(["javaScript", "json", "python", "sql"]).optional(),
12451
+ maxValue: z16.number().optional(),
12452
+ minValue: z16.number().optional(),
12453
+ max: z16.number().optional(),
12454
+ min: z16.number().optional(),
12455
+ multipleValues: z16.boolean().optional(),
12456
+ numberPrecision: z16.number().nonnegative().optional(),
12457
+ password: z16.boolean().optional(),
12458
+ rows: z16.number().int().positive().optional(),
12459
+ assetType: z16.string().optional(),
12460
+ accept: z16.string().optional(),
12461
+ maxSize: z16.number().positive().optional(),
12462
+ fileType: z16.string().optional(),
12463
+ aiMultiShotMainImageField: z16.string().optional(),
12464
+ aiMultiShotWorkflowAppId: z16.string().optional(),
12465
+ aiMultiShotWorkflowId: z16.string().optional(),
12466
+ allowCustomInput: z16.boolean().optional(),
12467
+ allowUploadVideo: z16.boolean().optional(),
12468
+ aspectRatioField: z16.string().optional(),
12469
+ assemblyValueType: z16.string().optional(),
12470
+ autoAnalyzeDesignImage: z16.boolean().optional(),
12471
+ autoDetectAspectRatio: z16.boolean().optional(),
12472
+ autoIncrementId: z16.boolean().optional(),
12431
12473
  comfyOptions: ComfyWorkflowPortBindingSchema.optional(),
12432
- comfyuiModelServerId: z15.string().optional(),
12433
- comfyuiModelTypeName: z15.string().optional(),
12474
+ comfyuiModelServerId: z16.string().optional(),
12475
+ comfyuiModelTypeName: z16.string().optional(),
12434
12476
  defaultCustomInput: JsonValueSchema.optional(),
12435
- descriptionAlert: z15.boolean().optional(),
12436
- disabled: z15.union([z15.boolean(), WorkflowConditionalStateSchema]).optional(),
12437
- editable: z15.union([z15.boolean(), WorkflowConditionalStateSchema]).optional(),
12438
- enableAiMultiShot: z15.boolean().optional(),
12439
- enableBooleanSwitchMode: z15.boolean().optional(),
12440
- enableClear: z15.boolean().optional(),
12441
- enableExpand: z15.boolean().optional(),
12442
- enableImageMask: z15.boolean().optional(),
12443
- enableImageOverlay: z15.boolean().optional(),
12444
- enablePopupEditor: z15.boolean().optional(),
12445
- enablePromptFontSize: z15.boolean().optional(),
12446
- enableReset: z15.boolean().optional(),
12447
- enableSelectItemIcon: z15.boolean().optional(),
12448
- enableSelectList: z15.boolean().optional(),
12449
- enableSelectSearch: z15.boolean().optional(),
12450
- enableSliderEnterMode: z15.boolean().optional(),
12451
- enableVoice: z15.boolean().optional(),
12452
- expandButtonText: z15.string().optional(),
12453
- foldUp: z15.boolean().optional(),
12454
- hidden: z15.boolean().optional(),
12455
- hideRequiredDot: z15.boolean().optional(),
12456
- inlineTitleWithSelect: z15.boolean().optional(),
12457
- knowledgeGraphButtonText: z15.string().optional(),
12458
- identifyAttributeCount: z15.union([z15.number().nonnegative(), z15.string().min(1), z15.object({ min: z15.number().nonnegative().optional(), max: z15.number().nonnegative().optional() }).strict()]).optional(),
12459
- identifyAttributes: z15.array(JsonValueSchema).optional(),
12460
- identifyMaxVariants: z15.number().int().nonnegative().optional(),
12461
- identifySourceField: z15.string().optional(),
12462
- imageOverlayBaseField: z15.string().optional(),
12463
- imageOverlayOverlayField: z15.string().optional(),
12477
+ descriptionAlert: z16.boolean().optional(),
12478
+ disabled: z16.union([z16.boolean(), WorkflowConditionalStateSchema]).optional(),
12479
+ editable: z16.union([z16.boolean(), WorkflowConditionalStateSchema]).optional(),
12480
+ enableAiMultiShot: z16.boolean().optional(),
12481
+ enableBooleanSwitchMode: z16.boolean().optional(),
12482
+ enableClear: z16.boolean().optional(),
12483
+ enableExpand: z16.boolean().optional(),
12484
+ enableImageMask: z16.boolean().optional(),
12485
+ enableImageOverlay: z16.boolean().optional(),
12486
+ enablePopupEditor: z16.boolean().optional(),
12487
+ enablePromptFontSize: z16.boolean().optional(),
12488
+ enableReset: z16.boolean().optional(),
12489
+ enableSelectItemIcon: z16.boolean().optional(),
12490
+ enableSelectList: z16.boolean().optional(),
12491
+ enableSelectSearch: z16.boolean().optional(),
12492
+ enableSliderEnterMode: z16.boolean().optional(),
12493
+ enableVoice: z16.boolean().optional(),
12494
+ expandButtonText: z16.string().optional(),
12495
+ foldUp: z16.boolean().optional(),
12496
+ hidden: z16.boolean().optional(),
12497
+ hideRequiredDot: z16.boolean().optional(),
12498
+ inlineTitleWithSelect: z16.boolean().optional(),
12499
+ knowledgeGraphButtonText: z16.string().optional(),
12500
+ identifyAttributeCount: z16.union([z16.number().nonnegative(), z16.string().min(1), z16.object({ min: z16.number().nonnegative().optional(), max: z16.number().nonnegative().optional() }).strict()]).optional(),
12501
+ identifyAttributes: z16.array(JsonValueSchema).optional(),
12502
+ identifyMaxVariants: z16.number().int().nonnegative().optional(),
12503
+ identifySourceField: z16.string().optional(),
12504
+ imageOverlayBaseField: z16.string().optional(),
12505
+ imageOverlayOverlayField: z16.string().optional(),
12464
12506
  imageSelectMappingAppearance: ImageSelectMappingAppearanceSchema.optional(),
12465
- imageSelectMappingColumns: z15.number().int().min(1).max(4).optional(),
12466
- imageSelectMappingEnableCustomUpload: z15.boolean().optional(),
12467
- imageSelectMappingHideLabel: z15.boolean().optional(),
12468
- imageSelectMappingHideLink: z15.boolean().optional(),
12469
- imageSelectMappingHideMeta: z15.boolean().optional(),
12470
- imageSelectMappingInlineUseLargeUploadBox: z15.boolean().optional(),
12471
- imageSelectMappingPromptField: z15.string().optional(),
12472
- imageSelectMappingTabOrder: z15.enum(["template-first", "upload-first"]).optional(),
12473
- imageSelectMappingTabWidthMode: z15.enum(["content", "fill"]).optional(),
12507
+ imageSelectMappingColumns: z16.number().int().min(1).max(4).optional(),
12508
+ imageSelectMappingEnableCustomUpload: z16.boolean().optional(),
12509
+ imageSelectMappingHideLabel: z16.boolean().optional(),
12510
+ imageSelectMappingHideLink: z16.boolean().optional(),
12511
+ imageSelectMappingHideMeta: z16.boolean().optional(),
12512
+ imageSelectMappingInlineUseLargeUploadBox: z16.boolean().optional(),
12513
+ imageSelectMappingPromptField: z16.string().optional(),
12514
+ imageSelectMappingTabOrder: z16.enum(["template-first", "upload-first"]).optional(),
12515
+ imageSelectMappingTabWidthMode: z16.enum(["content", "fill"]).optional(),
12474
12516
  imageSelectMappingTemplatePrompt: LocalizedTextSchema.optional(),
12475
12517
  imageSelectMappingTemplateTabTitle: LocalizedTextSchema.optional(),
12476
- imageSelectMappingUploadMode: z15.enum(["tabs", "inline"]).optional(),
12518
+ imageSelectMappingUploadMode: z16.enum(["tabs", "inline"]).optional(),
12477
12519
  imageSelectMappingUploadPrompt: LocalizedTextSchema.optional(),
12478
12520
  imageSelectMappingUploadTabTitle: LocalizedTextSchema.optional(),
12479
- endpoints: z15.array(JsonValueSchema).optional(),
12480
- examples: z15.array(JsonValueSchema).optional(),
12521
+ endpoints: z16.array(JsonValueSchema).optional(),
12522
+ examples: z16.array(JsonValueSchema).optional(),
12481
12523
  extraData: JsonValueSchema.optional(),
12482
12524
  layer: JsonValueSchema.optional(),
12483
12525
  map: JsonValueSchema.optional(),
12484
- multiline: z15.boolean().optional(),
12485
- options: z15.array(JsonValueSchema).optional(),
12486
- originalFiles: z15.array(JsonValueSchema).optional(),
12526
+ multiline: z16.boolean().optional(),
12527
+ options: z16.array(JsonValueSchema).optional(),
12528
+ originalFiles: z16.array(JsonValueSchema).optional(),
12487
12529
  placeholder: LocalizedTextSchema.optional(),
12488
- preserveSelectListOrder: z15.boolean().optional(),
12530
+ preserveSelectListOrder: z16.boolean().optional(),
12489
12531
  promptDictionary: JsonValueSchema.optional(),
12490
- promptFontSize: z15.number().optional(),
12532
+ promptFontSize: z16.number().optional(),
12491
12533
  promptModeToggle: JsonValueSchema.optional(),
12492
- requireActiveSelectFilter: z15.boolean().optional(),
12493
- restoreDefaultOnEmptyEnter: z15.boolean().optional(),
12494
- search: z15.boolean().optional(),
12495
- selectButtonEnableCollapse: z15.boolean().optional(),
12496
- selectButtonVisibleRows: z15.number().int().positive().optional(),
12497
- selectList: z15.array(JsonValueSchema).optional(),
12498
- selectListDisplayMode: z15.string().optional(),
12499
- selectPromptField: z15.string().optional(),
12500
- showAddLocalFileButton: z15.boolean().optional(),
12501
- singleColumn: z15.boolean().optional(),
12502
- singleFrameForMultiple: z15.boolean().optional(),
12503
- textSingleLine: z15.boolean().optional(),
12504
- textareaMiniHeight: z15.number().nonnegative().optional(),
12534
+ requireActiveSelectFilter: z16.boolean().optional(),
12535
+ restoreDefaultOnEmptyEnter: z16.boolean().optional(),
12536
+ search: z16.boolean().optional(),
12537
+ selectButtonEnableCollapse: z16.boolean().optional(),
12538
+ selectButtonVisibleRows: z16.number().int().positive().optional(),
12539
+ selectList: z16.array(JsonValueSchema).optional(),
12540
+ selectListDisplayMode: z16.string().optional(),
12541
+ selectPromptField: z16.string().optional(),
12542
+ showAddLocalFileButton: z16.boolean().optional(),
12543
+ singleColumn: z16.boolean().optional(),
12544
+ singleFrameForMultiple: z16.boolean().optional(),
12545
+ textSingleLine: z16.boolean().optional(),
12546
+ textareaMiniHeight: z16.number().nonnegative().optional(),
12505
12547
  tips: LocalizedTextSchema.optional(),
12506
12548
  visibility: JsonValueSchema.optional(),
12507
- voiceButtonText: z15.string().optional(),
12508
- designAnalysisFields: z15.array(JsonValueSchema).optional(),
12509
- designAnalysisFillStrategy: z15.string().optional(),
12510
- designAnalysisMaxFields: z15.number().int().nonnegative().optional(),
12511
- designAnalysisType: z15.string().optional(),
12512
- designAnalysisFieldPrefix: z15.string().optional()
12513
- }).strict();
12514
- var WorkflowParameterSchema = z15.lazy(
12515
- () => z15.object({
12549
+ voiceButtonText: z16.string().optional(),
12550
+ designAnalysisFields: z16.array(JsonValueSchema).optional(),
12551
+ designAnalysisFillStrategy: z16.string().optional(),
12552
+ designAnalysisMaxFields: z16.number().int().nonnegative().optional(),
12553
+ designAnalysisType: z16.string().optional(),
12554
+ designAnalysisFieldPrefix: z16.string().optional()
12555
+ }).strict();
12556
+ var WorkflowParameterSchema = z16.lazy(
12557
+ () => z16.object({
12516
12558
  displayName: LocalizedTextSchema,
12517
12559
  name: ContractIdentifierSchema,
12518
12560
  type: WorkflowParameterTypeSchema,
12519
12561
  typeOptions: WorkflowParameterTypeOptionsSchema.optional(),
12520
12562
  default: JsonValueSchema.optional(),
12521
12563
  description: LocalizedTextSchema.optional(),
12522
- hint: z15.string().optional(),
12523
- displayOptions: z15.object({
12524
- hide: z15.record(z15.string(), z15.array(JsonValueSchema)).optional(),
12525
- show: z15.record(z15.string(), z15.array(JsonValueSchema)).optional()
12564
+ hint: z16.string().optional(),
12565
+ displayOptions: z16.object({
12566
+ hide: z16.record(z16.string(), z16.array(JsonValueSchema)).optional(),
12567
+ show: z16.record(z16.string(), z16.array(JsonValueSchema)).optional()
12526
12568
  }).strict().optional(),
12527
- options: z15.array(z15.union([
12528
- z15.object({ name: LocalizedTextSchema, value: z15.union([z15.string(), z15.number(), z15.boolean()]), action: z15.string().optional(), description: LocalizedTextSchema.optional() }).strict(),
12569
+ options: z16.array(z16.union([
12570
+ z16.object({ name: LocalizedTextSchema, value: z16.union([z16.string(), z16.number(), z16.boolean()]), action: z16.string().optional(), description: LocalizedTextSchema.optional() }).strict(),
12529
12571
  WorkflowParameterSchema,
12530
- z15.object({ displayName: z15.string(), name: ContractIdentifierSchema, values: z15.array(WorkflowParameterSchema) }).strict()
12572
+ z16.object({ displayName: z16.string(), name: ContractIdentifierSchema, values: z16.array(WorkflowParameterSchema) }).strict()
12531
12573
  ])).optional(),
12532
12574
  placeholder: LocalizedTextSchema.optional(),
12533
- isNodeSetting: z15.boolean().optional(),
12534
- noDataExpression: z15.boolean().optional(),
12535
- required: z15.boolean().optional(),
12536
- example: z15.string().optional(),
12537
- extractValue: z15.object({ type: z15.literal("regex"), regex: z15.string() }).strict().optional(),
12538
- properties: z15.array(WorkflowParameterSchema).optional(),
12539
- assetType: z15.string().optional(),
12540
- flag: z15.boolean().optional(),
12541
- enableExpand: z15.boolean().optional(),
12542
- enableVoice: z15.boolean().optional(),
12543
- expandButtonText: z15.string().optional(),
12544
- knowledgeGraphButtonText: z15.string().optional(),
12545
- selectListDisplayMode: z15.string().optional(),
12546
- voiceButtonText: z15.string().optional()
12575
+ isNodeSetting: z16.boolean().optional(),
12576
+ noDataExpression: z16.boolean().optional(),
12577
+ required: z16.boolean().optional(),
12578
+ example: z16.string().optional(),
12579
+ extractValue: z16.object({ type: z16.literal("regex"), regex: z16.string() }).strict().optional(),
12580
+ properties: z16.array(WorkflowParameterSchema).optional(),
12581
+ assetType: z16.string().optional(),
12582
+ flag: z16.boolean().optional(),
12583
+ enableExpand: z16.boolean().optional(),
12584
+ enableVoice: z16.boolean().optional(),
12585
+ expandButtonText: z16.string().optional(),
12586
+ knowledgeGraphButtonText: z16.string().optional(),
12587
+ selectListDisplayMode: z16.string().optional(),
12588
+ voiceButtonText: z16.string().optional()
12547
12589
  }).strict()
12548
12590
  );
12549
- var WorkflowOutputBindingSchema = z15.object({ key: ContractIdentifierSchema, value: z15.string() }).strict();
12550
- var WorkflowNodeSchema = z15.object({
12591
+ var WorkflowOutputBindingSchema = z16.object({ key: ContractIdentifierSchema, value: z16.string() }).strict();
12592
+ var WorkflowNodeSchema = z16.object({
12551
12593
  id: ContractIdentifierSchema,
12552
12594
  referenceName: ContractIdentifierSchema,
12553
12595
  capabilityRef: ContractIdentifierSchema,
12554
12596
  capabilityVersion: ContractIdentifierSchema.optional(),
12555
- inputBindings: z15.record(z15.string(), JsonValueSchema).default({}),
12556
- configuration: z15.object({ executor: z15.literal("conductor"), task: ConductorTaskDefinitionSchema }).strict()
12597
+ inputBindings: z16.record(z16.string(), JsonValueSchema).default({}),
12598
+ configuration: z16.object({ executor: z16.literal("conductor"), task: ConductorTaskDefinitionSchema }).strict()
12557
12599
  }).strict().superRefine((node, context) => {
12558
12600
  if (node.configuration.task.taskReferenceName !== node.referenceName) context.addIssue({ code: "custom", path: ["configuration", "task", "taskReferenceName"], message: "Conductor task reference must match node referenceName." });
12559
12601
  if (node.configuration.task.name !== node.capabilityRef) context.addIssue({ code: "custom", path: ["configuration", "task", "name"], message: "Conductor task name must match node capabilityRef." });
12560
12602
  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." });
12561
12603
  });
12562
- var WorkflowEdgeSchema = z15.object({
12604
+ var WorkflowEdgeSchema = z16.object({
12563
12605
  from: ContractIdentifierSchema,
12564
12606
  to: ContractIdentifierSchema,
12565
12607
  outputPort: ContractIdentifierSchema.optional(),
12566
12608
  inputPort: ContractIdentifierSchema.optional(),
12567
- condition: z15.string().optional()
12609
+ condition: z16.string().optional()
12568
12610
  }).strict();
12569
- var WorkflowTriggerSchema = z15.object({
12611
+ var WorkflowTriggerSchema = z16.object({
12570
12612
  id: ContractIdentifierSchema,
12571
- type: z15.enum(["manual", "schedule", "webhook", "event", "api"]),
12572
- enabled: z15.boolean(),
12573
- schedule: z15.object({ cron: z15.string().trim().min(1) }).strict().optional(),
12574
- webhook: z15.object({
12575
- path: z15.string().trim().min(1).optional(),
12576
- method: z15.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"]),
12577
- auth: z15.enum(["NONE", "BASIC", "CUSTOM_HEADER"]),
12578
- basicAuth: z15.object({ username: z15.string(), password: z15.string() }).strict().optional(),
12579
- headerAuth: z15.object({ name: z15.string().trim().min(1), value: z15.string() }).strict().optional(),
12580
- responseUntil: z15.enum(["WORKFLOW_STARTED", "WORKFLOW_COMPLETED_OR_FINISHED"])
12613
+ type: z16.enum(["manual", "schedule", "webhook", "event", "api"]),
12614
+ enabled: z16.boolean(),
12615
+ schedule: z16.object({ cron: z16.string().trim().min(1) }).strict().optional(),
12616
+ webhook: z16.object({
12617
+ path: z16.string().trim().min(1).optional(),
12618
+ method: z16.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"]),
12619
+ auth: z16.enum(["NONE", "BASIC", "CUSTOM_HEADER"]),
12620
+ basicAuth: z16.object({ username: z16.string(), password: z16.string() }).strict().optional(),
12621
+ headerAuth: z16.object({ name: z16.string().trim().min(1), value: z16.string() }).strict().optional(),
12622
+ responseUntil: z16.enum(["WORKFLOW_STARTED", "WORKFLOW_COMPLETED_OR_FINISHED"])
12581
12623
  }).strict().optional(),
12582
- event: z15.object({
12624
+ event: z16.object({
12583
12625
  eventType: ContractIdentifierSchema,
12584
12626
  configuration: JsonValueSchema.optional()
12585
12627
  }).strict().optional()
@@ -12588,63 +12630,63 @@ var WorkflowTriggerSchema = z15.object({
12588
12630
  if (trigger.type === "webhook" && !trigger.webhook) context.addIssue({ code: "custom", path: ["webhook"], message: "Webhook trigger requires webhook configuration." });
12589
12631
  if (trigger.type === "event" && !trigger.event) context.addIssue({ code: "custom", path: ["event"], message: "Event trigger requires event configuration." });
12590
12632
  });
12591
- var WorkflowValidationIssueSchema = z15.object({
12633
+ var WorkflowValidationIssueSchema = z16.object({
12592
12634
  taskReferenceName: ContractIdentifierSchema,
12593
- issueType: z15.enum(["ERROR", "WARNING"]),
12594
- detailReason: z15.object({ type: ContractIdentifierSchema, name: ContractIdentifierSchema, detailInformation: JsonValueSchema.optional() }).strict(),
12595
- humanMessage: z15.object({ en: z15.string(), zh: z15.string() }).strict()
12635
+ issueType: z16.enum(["ERROR", "WARNING"]),
12636
+ detailReason: z16.object({ type: ContractIdentifierSchema, name: ContractIdentifierSchema, detailInformation: JsonValueSchema.optional() }).strict(),
12637
+ humanMessage: z16.object({ en: z16.string(), zh: z16.string() }).strict()
12596
12638
  }).strict();
12597
- var WorkflowDefinitionSchema = z15.object({
12598
- contract: z15.literal("WorkflowDefinition"),
12639
+ var WorkflowDefinitionSchema = z16.object({
12640
+ contract: z16.literal("WorkflowDefinition"),
12599
12641
  metadata: ContractMetadataSchema.omit({ name: true, description: true, labels: true }).extend({
12600
12642
  name: LocalizedTextSchema,
12601
12643
  description: LocalizedTextSchema.optional(),
12602
- role: z15.enum(["workflow", "template"]),
12644
+ role: z16.enum(["workflow", "template"]),
12603
12645
  teamId: ContractIdentifierSchema,
12604
12646
  creatorRef: EntityRefSchema,
12605
- tags: z15.array(ContractIdentifierSchema).default([])
12647
+ tags: z16.array(ContractIdentifierSchema).default([])
12606
12648
  }).strict(),
12607
- revision: z15.object({
12608
- kind: z15.enum(["release", "backup"]),
12609
- recordVersion: z15.number().int().positive(),
12610
- sourceVersion: z15.number().int().positive().optional()
12649
+ revision: z16.object({
12650
+ kind: z16.enum(["release", "backup"]),
12651
+ recordVersion: z16.number().int().positive(),
12652
+ sourceVersion: z16.number().int().positive().optional()
12611
12653
  }).strict().superRefine((revision, context) => {
12612
12654
  if (revision.kind === "backup" && revision.sourceVersion === void 0) context.addIssue({ code: "custom", path: ["sourceVersion"], message: "Backup revisions require a sourceVersion." });
12613
12655
  }),
12614
- presentation: z15.object({ iconUrl: z15.string().optional(), thumbnail: z15.string().optional() }).strict(),
12615
- ports: z15.object({ inputs: z15.array(ContractPortSchema).default([]), outputs: z15.array(ContractPortSchema).default([]) }).strict(),
12616
- parameters: z15.object({ variables: z15.array(WorkflowParameterSchema).default([]), outputs: z15.array(WorkflowOutputBindingSchema).default([]) }).strict(),
12617
- graph: z15.object({ nodes: z15.array(WorkflowNodeSchema), edges: z15.array(WorkflowEdgeSchema).default([]) }).strict(),
12618
- execution: z15.object({
12619
- timeoutMs: z15.number().int().positive().optional(),
12620
- retries: z15.number().int().nonnegative().default(0),
12621
- concurrencyLimit: z15.number().int().positive().optional(),
12622
- idempotency: z15.enum(["required", "supported", "none"]),
12623
- rateLimit: z15.object({ enabled: z15.boolean(), max: z15.number().int().nonnegative(), windowMs: z15.number().int().nonnegative() }).strict().superRefine((rateLimit, context) => {
12656
+ presentation: z16.object({ iconUrl: z16.string().optional(), thumbnail: z16.string().optional() }).strict(),
12657
+ ports: z16.object({ inputs: z16.array(ContractPortSchema).default([]), outputs: z16.array(ContractPortSchema).default([]) }).strict(),
12658
+ parameters: z16.object({ variables: z16.array(WorkflowParameterSchema).default([]), outputs: z16.array(WorkflowOutputBindingSchema).default([]) }).strict(),
12659
+ graph: z16.object({ nodes: z16.array(WorkflowNodeSchema), edges: z16.array(WorkflowEdgeSchema).default([]) }).strict(),
12660
+ execution: z16.object({
12661
+ timeoutMs: z16.number().int().positive().optional(),
12662
+ retries: z16.number().int().nonnegative().default(0),
12663
+ concurrencyLimit: z16.number().int().positive().optional(),
12664
+ idempotency: z16.enum(["required", "supported", "none"]),
12665
+ rateLimit: z16.object({ enabled: z16.boolean(), max: z16.number().int().nonnegative(), windowMs: z16.number().int().nonnegative() }).strict().superRefine((rateLimit, context) => {
12624
12666
  if (rateLimit.enabled && (rateLimit.max === 0 || rateLimit.windowMs === 0)) context.addIssue({ code: "custom", message: "Enabled rate limit requires positive max and windowMs." });
12625
12667
  }).optional(),
12626
- conductor: z15.object({
12627
- ownerApp: z15.string().optional(),
12628
- createTime: z15.number().int().nonnegative().optional(),
12629
- updateTime: z15.number().int().nonnegative().optional(),
12630
- createdBy: z15.string().optional(),
12631
- updatedBy: z15.string().optional(),
12668
+ conductor: z16.object({
12669
+ ownerApp: z16.string().optional(),
12670
+ createTime: z16.number().int().nonnegative().optional(),
12671
+ updateTime: z16.number().int().nonnegative().optional(),
12672
+ createdBy: z16.string().optional(),
12673
+ updatedBy: z16.string().optional(),
12632
12674
  failureWorkflow: ContractIdentifierSchema.optional(),
12633
- schemaVersion: z15.number().int().positive().optional(),
12634
- restartable: z15.boolean().optional(),
12635
- workflowStatusListenerEnabled: z15.boolean().optional(),
12636
- ownerEmail: z15.string().email().optional(),
12637
- timeoutPolicy: z15.enum(["TIME_OUT_WF", "ALERT_ONLY"]).optional(),
12638
- variables: z15.record(z15.string(), JsonValueSchema).optional(),
12639
- inputTemplate: z15.record(z15.string(), JsonValueSchema).optional()
12675
+ schemaVersion: z16.number().int().positive().optional(),
12676
+ restartable: z16.boolean().optional(),
12677
+ workflowStatusListenerEnabled: z16.boolean().optional(),
12678
+ ownerEmail: z16.string().email().optional(),
12679
+ timeoutPolicy: z16.enum(["TIME_OUT_WF", "ALERT_ONLY"]).optional(),
12680
+ variables: z16.record(z16.string(), JsonValueSchema).optional(),
12681
+ inputTemplate: z16.record(z16.string(), JsonValueSchema).optional()
12640
12682
  }).strict()
12641
12683
  }).strict(),
12642
- triggers: z15.array(WorkflowTriggerSchema).default([]),
12643
- views: z15.array(z15.object({ pageRef: ContractIdentifierSchema, placement: ContractIdentifierSchema.optional() }).strict()).default([]),
12644
- dataContracts: z15.object({ reads: z15.array(ContractIdentifierSchema).default([]), writes: z15.array(ContractIdentifierSchema).default([]), emits: z15.array(ContractIdentifierSchema).default([]) }).strict(),
12645
- governance: z15.object({ activated: z15.boolean(), validated: z15.boolean(), validationIssues: z15.array(WorkflowValidationIssueSchema).default([]), hidden: z15.boolean().optional() }).strict(),
12646
- interfaces: z15.object({
12647
- openai: z15.object({ enabled: z15.boolean(), modelName: z15.string().trim().min(1).optional() }).strict(),
12684
+ triggers: z16.array(WorkflowTriggerSchema).default([]),
12685
+ views: z16.array(z16.object({ pageRef: ContractIdentifierSchema, placement: ContractIdentifierSchema.optional() }).strict()).default([]),
12686
+ dataContracts: z16.object({ reads: z16.array(ContractIdentifierSchema).default([]), writes: z16.array(ContractIdentifierSchema).default([]), emits: z16.array(ContractIdentifierSchema).default([]) }).strict(),
12687
+ governance: z16.object({ activated: z16.boolean(), validated: z16.boolean(), validationIssues: z16.array(WorkflowValidationIssueSchema).default([]), hidden: z16.boolean().optional() }).strict(),
12688
+ interfaces: z16.object({
12689
+ openai: z16.object({ enabled: z16.boolean(), modelName: z16.string().trim().min(1).optional() }).strict(),
12648
12690
  shortcutRef: EntityRefSchema.optional(),
12649
12691
  preferredAppId: ContractIdentifierSchema.optional()
12650
12692
  }).strict().superRefine((interfaces, context) => {
@@ -12663,21 +12705,21 @@ var WorkflowDefinitionSchema = z15.object({
12663
12705
  });
12664
12706
 
12665
12707
  // src/contracts/workflow-runtime.ts
12666
- import { z as z16 } from "zod";
12667
- var WorkflowCatalogEntrySchema = z16.object({
12668
- contract: z16.literal("WorkflowCatalogEntry"),
12708
+ import { z as z17 } from "zod";
12709
+ var WorkflowCatalogEntrySchema = z17.object({
12710
+ contract: z17.literal("WorkflowCatalogEntry"),
12669
12711
  workflowId: ContractIdentifierSchema,
12670
12712
  teamId: ContractIdentifierSchema,
12671
12713
  creatorRef: EntityRefSchema,
12672
12714
  currentDefinitionRef: EntityRefSchema,
12673
- lifecycle: z16.enum(["ACTIVE", "DELETED"]),
12674
- asset: z16.object({
12675
- preset: z16.boolean(),
12676
- marketplacePublished: z16.boolean(),
12715
+ lifecycle: z17.enum(["ACTIVE", "DELETED"]),
12716
+ asset: z17.object({
12717
+ preset: z17.boolean(),
12718
+ marketplacePublished: z17.boolean(),
12677
12719
  publishConfig: JsonObjectSchema.optional(),
12678
- sort: z16.number().int(),
12720
+ sort: z17.number().int(),
12679
12721
  forkFromRef: EntityRefSchema.optional(),
12680
- notAuthorized: z16.boolean()
12722
+ notAuthorized: z17.boolean()
12681
12723
  }).strict(),
12682
12724
  createdAt: IsoDateTimeSchema,
12683
12725
  updatedAt: IsoDateTimeSchema,
@@ -12712,17 +12754,17 @@ var WorkflowCatalogEntrySchema = z16.object({
12712
12754
  });
12713
12755
  }
12714
12756
  });
12715
- var WorkflowPublicationSchema = z16.object({
12716
- contract: z16.literal("WorkflowPublication"),
12757
+ var WorkflowPublicationSchema = z17.object({
12758
+ contract: z17.literal("WorkflowPublication"),
12717
12759
  publicationId: ContractIdentifierSchema,
12718
12760
  definitionRef: EntityRefSchema,
12719
12761
  runtimeDefinitionRef: EntityRefSchema,
12720
12762
  sourceHash: Sha256Schema,
12721
12763
  compiledHash: Sha256Schema,
12722
- status: z16.enum(["PENDING", "PUBLISHED", "FAILED", "RETIRED"]),
12764
+ status: z17.enum(["PENDING", "PUBLISHED", "FAILED", "RETIRED"]),
12723
12765
  publisherRef: EntityRefSchema,
12724
12766
  publishedAt: IsoDateTimeSchema.optional(),
12725
- failureReason: z16.string().trim().min(1).optional()
12767
+ failureReason: z17.string().trim().min(1).optional()
12726
12768
  }).strict().superRefine((publication, context) => {
12727
12769
  if (publication.definitionRef.kind !== "workflow-definition") {
12728
12770
  context.addIssue({
@@ -12753,12 +12795,12 @@ var WorkflowPublicationSchema = z16.object({
12753
12795
  });
12754
12796
  }
12755
12797
  });
12756
- var WorkflowCompletionCommitSchema = z16.object({
12757
- contract: z16.literal("WorkflowCompletionCommit"),
12798
+ var WorkflowCompletionCommitSchema = z17.object({
12799
+ contract: z17.literal("WorkflowCompletionCommit"),
12758
12800
  commitId: ContractIdentifierSchema,
12759
12801
  run: ApplicationRunSchema,
12760
- outputs: z16.array(OutputRecordSchema),
12761
- artifacts: z16.array(ArtifactManifestSchema),
12802
+ outputs: z17.array(OutputRecordSchema),
12803
+ artifacts: z17.array(ArtifactManifestSchema),
12762
12804
  lineage: LineageRecordSchema,
12763
12805
  completedAt: IsoDateTimeSchema
12764
12806
  }).strict().superRefine((commit, context) => {
@@ -12800,15 +12842,15 @@ var WorkflowCompletionCommitSchema = z16.object({
12800
12842
  }
12801
12843
  });
12802
12844
  });
12803
- var WorkflowCompletionReceiptSchema = z16.object({
12804
- contract: z16.literal("WorkflowCompletionReceipt"),
12845
+ var WorkflowCompletionReceiptSchema = z17.object({
12846
+ contract: z17.literal("WorkflowCompletionReceipt"),
12805
12847
  commitId: ContractIdentifierSchema,
12806
12848
  runRef: EntityRefSchema,
12807
- outputRefs: z16.array(EntityRefSchema),
12808
- artifactRefs: z16.array(EntityRefSchema),
12849
+ outputRefs: z17.array(EntityRefSchema),
12850
+ artifactRefs: z17.array(EntityRefSchema),
12809
12851
  contentHash: Sha256Schema,
12810
12852
  committedAt: IsoDateTimeSchema,
12811
- idempotentReplay: z16.boolean()
12853
+ idempotentReplay: z17.boolean()
12812
12854
  }).strict().superRefine((receipt, context) => {
12813
12855
  if (receipt.runRef.kind !== "application-run") {
12814
12856
  context.addIssue({
@@ -13652,14 +13694,13 @@ var evaluateAccess = (item, context) => {
13652
13694
  if (!context.sessionResolved && protectedBySession) reasons.push("session-unresolved");
13653
13695
  if (item.access.authenticated && !context.authenticated) reasons.push("authentication");
13654
13696
  const granted = new Set(context.permissionCodes);
13655
- const elevated = context.isKernelSuperAdmin === true || granted.has("*");
13656
13697
  if (item.access.permissionAllOf.some((permission) => !granted.has(permission))) {
13657
13698
  reasons.push("permission-all");
13658
13699
  }
13659
13700
  if (item.access.permissionAnyOf.length > 0 && !item.access.permissionAnyOf.some((permission) => granted.has(permission))) {
13660
13701
  reasons.push("permission-any");
13661
13702
  }
13662
- if (!elevated && item.access.requiredPermission && !granted.has(item.access.requiredPermission)) {
13703
+ if (item.access.requiredPermission && !granted.has(item.access.requiredPermission)) {
13663
13704
  reasons.push("required-permission");
13664
13705
  }
13665
13706
  if (item.access.featureFlags.some((flag) => context.featureFlags[flag] !== true)) {
@@ -14671,6 +14712,62 @@ var compileWorkflowPersistenceProjection = (input) => {
14671
14712
  output: Object.freeze(workflow.parameters.outputs)
14672
14713
  });
14673
14714
  };
14715
+
14716
+ // src/runtime/access-compiler.ts
14717
+ var uniqueBy = (values, key, label) => {
14718
+ const result = /* @__PURE__ */ new Map();
14719
+ for (const value of values) {
14720
+ const id = key(value);
14721
+ if (result.has(id)) throw new Error(`Duplicate ${label} ${id}.`);
14722
+ result.set(id, value);
14723
+ }
14724
+ return result;
14725
+ };
14726
+ var compileProductAccessDeclaration = (input) => {
14727
+ const declaration = ProductAccessDeclarationSchema.parse(input);
14728
+ const permissionsByCode = uniqueBy(declaration.permissions, (item) => item.code, "permission");
14729
+ const bundlesById = uniqueBy(declaration.permissionBundles, (item) => item.bundleId, "permission bundle");
14730
+ uniqueBy(declaration.systemGroups, (item) => item.groupCode, "system group");
14731
+ const permissionCodesByBundle = /* @__PURE__ */ new Map();
14732
+ for (const bundle of declaration.permissionBundles) {
14733
+ for (const permissionCode of bundle.permissionCodes) {
14734
+ if (!permissionsByCode.has(permissionCode)) {
14735
+ throw new Error(`Permission bundle ${bundle.bundleId} references unknown permission ${permissionCode}.`);
14736
+ }
14737
+ }
14738
+ permissionCodesByBundle.set(bundle.bundleId, [...new Set(bundle.permissionCodes)]);
14739
+ }
14740
+ const permissionCodesBySystemGroup = /* @__PURE__ */ new Map();
14741
+ const permissionPolicyBySystemGroup = /* @__PURE__ */ new Map();
14742
+ for (const group of declaration.systemGroups) {
14743
+ const permissionCodes = /* @__PURE__ */ new Set();
14744
+ permissionPolicyBySystemGroup.set(group.groupCode, group.permissionPolicy);
14745
+ if (group.permissionPolicy === "all_current") {
14746
+ for (const permission of declaration.permissions) permissionCodes.add(permission.code);
14747
+ }
14748
+ if (group.permissionPolicy === "studio_current") {
14749
+ for (const permission of declaration.permissions) {
14750
+ if (permission.domain === "studio" || permission.code.startsWith("studio:")) permissionCodes.add(permission.code);
14751
+ }
14752
+ }
14753
+ for (const bundleId of group.permissionBundleIds) {
14754
+ if (!bundlesById.has(bundleId)) {
14755
+ throw new Error(`System group ${group.groupCode} references unknown permission bundle ${bundleId}.`);
14756
+ }
14757
+ for (const permissionCode of permissionCodesByBundle.get(bundleId) ?? []) {
14758
+ permissionCodes.add(permissionCode);
14759
+ }
14760
+ }
14761
+ permissionCodesBySystemGroup.set(group.groupCode, [...permissionCodes]);
14762
+ }
14763
+ return {
14764
+ declaration,
14765
+ permissionsByCode,
14766
+ permissionCodesByBundle,
14767
+ permissionCodesBySystemGroup,
14768
+ permissionPolicyBySystemGroup
14769
+ };
14770
+ };
14674
14771
  export {
14675
14772
  AGENT_MODE_CAPABILITIES,
14676
14773
  AGENT_SESSION_CAPABILITY_EVIDENCE,
@@ -14836,6 +14933,9 @@ export {
14836
14933
  PageRuntimeProjectionSchema,
14837
14934
  PageTypeSchema,
14838
14935
  PageVisibilitySchema,
14936
+ PermissionBundleSchema,
14937
+ PermissionDefinitionSchema,
14938
+ ProductAccessDeclarationSchema,
14839
14939
  ProductBodySchema,
14840
14940
  ProductContextSchema,
14841
14941
  ProductDeclarationSchema,
@@ -14872,6 +14972,7 @@ export {
14872
14972
  SourceRecordRefSchema,
14873
14973
  StorageLocatorSchema,
14874
14974
  StudioAgentModeSchema,
14975
+ SystemGroupDefinitionSchema,
14875
14976
  TenantApplicationConfigSchema,
14876
14977
  TenantAuthBindingSchema,
14877
14978
  TenantAuthBindingsSchema,
@@ -14941,6 +15042,7 @@ export {
14941
15042
  compileConductorWorkflowDefinition,
14942
15043
  compileMenuRuntimeBundle,
14943
15044
  compilePageRuntimeProjection,
15045
+ compileProductAccessDeclaration,
14944
15046
  compileProductDeclaration,
14945
15047
  compileProductRuntimeCatalog,
14946
15048
  compileRenderTree,