@objectstack/spec 1.0.11 → 1.0.12

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 (147) hide show
  1. package/README.md +41 -1
  2. package/dist/ai/index.d.mts +2 -1
  3. package/dist/ai/index.d.ts +2 -1
  4. package/dist/ai/index.js +2047 -1944
  5. package/dist/ai/index.js.map +1 -1
  6. package/dist/ai/index.mjs +2047 -1944
  7. package/dist/ai/index.mjs.map +1 -1
  8. package/dist/api/index.d.mts +3 -1
  9. package/dist/api/index.d.ts +3 -1
  10. package/dist/api/index.js +2599 -2292
  11. package/dist/api/index.js.map +1 -1
  12. package/dist/api/index.mjs +2587 -2292
  13. package/dist/api/index.mjs.map +1 -1
  14. package/dist/automation/index.d.mts +2 -1
  15. package/dist/automation/index.d.ts +2 -1
  16. package/dist/automation/index.js +83 -0
  17. package/dist/automation/index.js.map +1 -1
  18. package/dist/automation/index.mjs +77 -0
  19. package/dist/automation/index.mjs.map +1 -1
  20. package/dist/contracts/index.d.mts +3 -2
  21. package/dist/contracts/index.d.ts +3 -2
  22. package/dist/data/index.d.mts +3 -2
  23. package/dist/data/index.d.ts +3 -2
  24. package/dist/data/index.js +658 -556
  25. package/dist/data/index.js.map +1 -1
  26. package/dist/data/index.mjs +656 -556
  27. package/dist/data/index.mjs.map +1 -1
  28. package/dist/{driver.zod-lfi00zVT.d.ts → driver.zod-CfGk9GYh.d.ts} +2164 -11
  29. package/dist/{driver.zod-BOM_Etco.d.mts → driver.zod-y1cX6R3c.d.mts} +2164 -11
  30. package/dist/hub/index.d.mts +1 -1
  31. package/dist/hub/index.d.ts +1 -1
  32. package/dist/hub/index.js +789 -724
  33. package/dist/hub/index.js.map +1 -1
  34. package/dist/hub/index.mjs +789 -724
  35. package/dist/hub/index.mjs.map +1 -1
  36. package/dist/{index-C67cfwmW.d.ts → index-B0Hf65bV.d.ts} +13 -5
  37. package/dist/{index-DLcySG7U.d.ts → index-B5pKM0My.d.ts} +335 -4370
  38. package/dist/{index-Os7lItRe.d.mts → index-BA022mg2.d.ts} +6178 -129
  39. package/dist/{index-B5-VbOKg.d.mts → index-BGeLoH2z.d.ts} +4251 -74
  40. package/dist/{index-CH5zloR3.d.ts → index-BwO__aqV.d.ts} +1 -1
  41. package/dist/{index-Dp7GFJ8V.d.mts → index-Cia3JPQ8.d.mts} +13 -5
  42. package/dist/{index-D12rNohm.d.mts → index-CpD1q1FP.d.ts} +35 -18
  43. package/dist/{index-Os7lItRe.d.ts → index-D5RSFPuB.d.mts} +6178 -129
  44. package/dist/{index-CU4m6noq.d.mts → index-DGjpaj0X.d.mts} +1 -1
  45. package/dist/{index-D12rNohm.d.ts → index-Dfn5VXl6.d.mts} +35 -18
  46. package/dist/{index-l6WIlmOD.d.mts → index-Dgybxlky.d.mts} +177 -158
  47. package/dist/{index-l6WIlmOD.d.ts → index-Dgybxlky.d.ts} +177 -158
  48. package/dist/{index-DLcySG7U.d.mts → index-Dpsk8PF4.d.mts} +335 -4370
  49. package/dist/{index-CyognKSZ.d.ts → index-DrNah5E0.d.ts} +1952 -6990
  50. package/dist/{index-DE_lJ11p.d.mts → index-OO84R20k.d.mts} +1952 -6990
  51. package/dist/{index-B5-VbOKg.d.ts → index-upA3Xt04.d.mts} +4251 -74
  52. package/dist/index.d.mts +8072 -1922
  53. package/dist/index.d.ts +8072 -1922
  54. package/dist/index.js +8563 -8249
  55. package/dist/index.js.map +1 -1
  56. package/dist/index.mjs +8563 -8249
  57. package/dist/index.mjs.map +1 -1
  58. package/dist/integration/index.d.mts +1 -1
  59. package/dist/integration/index.d.ts +1 -1
  60. package/dist/kernel/index.d.mts +2 -1
  61. package/dist/kernel/index.d.ts +2 -1
  62. package/dist/kernel/index.js +884 -684
  63. package/dist/kernel/index.js.map +1 -1
  64. package/dist/kernel/index.mjs +870 -684
  65. package/dist/kernel/index.mjs.map +1 -1
  66. package/dist/package-registry.zod-JMcOYNxM.d.mts +21119 -0
  67. package/dist/package-registry.zod-JMcOYNxM.d.ts +21119 -0
  68. package/dist/state-machine.zod-B-lFFSxQ.d.mts +285 -0
  69. package/dist/state-machine.zod-B-lFFSxQ.d.ts +285 -0
  70. package/dist/system/index.d.mts +2 -1
  71. package/dist/system/index.d.ts +2 -1
  72. package/dist/system/index.js +749 -651
  73. package/dist/system/index.js.map +1 -1
  74. package/dist/system/index.mjs +749 -651
  75. package/dist/system/index.mjs.map +1 -1
  76. package/dist/ui/index.d.mts +1 -1
  77. package/dist/ui/index.d.ts +1 -1
  78. package/json-schema/ai/Agent.json +499 -0
  79. package/json-schema/ai/DevOpsAgent.json +499 -0
  80. package/json-schema/ai/FeedbackLoop.json +2188 -186
  81. package/json-schema/ai/Resolution.json +2188 -186
  82. package/json-schema/api/ApiRoutes.json +4 -0
  83. package/json-schema/api/CompileManifestResponse.json +40 -10
  84. package/json-schema/api/DisablePackageRequest.json +18 -0
  85. package/json-schema/api/DisablePackageResponse.json +1521 -0
  86. package/json-schema/api/Discovery.json +4 -0
  87. package/json-schema/api/EnablePackageRequest.json +18 -0
  88. package/json-schema/api/EnablePackageResponse.json +1521 -0
  89. package/json-schema/api/GetDiscoveryResponse.json +4 -0
  90. package/json-schema/api/GetPackageRequest.json +18 -0
  91. package/json-schema/api/GetPackageResponse.json +1518 -0
  92. package/json-schema/api/InstallPackageRequest.json +1483 -0
  93. package/json-schema/api/InstallPackageResponse.json +1521 -0
  94. package/json-schema/api/ListPackagesRequest.json +42 -0
  95. package/json-schema/api/ListPackagesResponse.json +1525 -0
  96. package/json-schema/api/ObjectDefinitionResponse.json +1001 -0
  97. package/json-schema/api/ObjectStackProtocol.json +86 -1
  98. package/json-schema/api/RestApiConfig.json +5 -0
  99. package/json-schema/api/RestServerConfig.json +5 -0
  100. package/json-schema/api/UninstallPackageRequest.json +18 -0
  101. package/json-schema/api/UninstallPackageResponse.json +25 -0
  102. package/json-schema/automation/ActionRef.json +30 -0
  103. package/json-schema/automation/Event.json +24 -0
  104. package/json-schema/automation/Flow.json +1 -0
  105. package/json-schema/automation/FlowNode.json +1 -0
  106. package/json-schema/automation/FlowNodeAction.json +1 -0
  107. package/json-schema/automation/GuardRef.json +30 -0
  108. package/json-schema/automation/StateMachine.json +504 -0
  109. package/json-schema/automation/StateNode.json +324 -0
  110. package/json-schema/automation/Transition.json +73 -0
  111. package/json-schema/data/Object.json +1001 -0
  112. package/json-schema/data/ObjectExtension.json +2376 -0
  113. package/json-schema/data/ObjectOwnershipEnum.json +13 -0
  114. package/json-schema/hub/ComposerResponse.json +40 -10
  115. package/json-schema/kernel/DisablePackageRequest.json +18 -0
  116. package/json-schema/kernel/DisablePackageResponse.json +1521 -0
  117. package/json-schema/kernel/EnablePackageRequest.json +18 -0
  118. package/json-schema/kernel/EnablePackageResponse.json +1521 -0
  119. package/json-schema/kernel/EventBusConfig.json +15 -0
  120. package/json-schema/kernel/EventHandler.json +6 -0
  121. package/json-schema/kernel/EventPersistence.json +3 -0
  122. package/json-schema/kernel/EventRoute.json +3 -0
  123. package/json-schema/kernel/EventWebhookConfig.json +3 -0
  124. package/json-schema/kernel/GetPackageRequest.json +18 -0
  125. package/json-schema/kernel/GetPackageResponse.json +1518 -0
  126. package/json-schema/kernel/InstallPackageRequest.json +1483 -0
  127. package/json-schema/kernel/InstallPackageResponse.json +1521 -0
  128. package/json-schema/kernel/InstalledPackage.json +1509 -0
  129. package/json-schema/kernel/ListPackagesRequest.json +42 -0
  130. package/json-schema/kernel/ListPackagesResponse.json +1525 -0
  131. package/json-schema/kernel/Manifest.json +40 -10
  132. package/json-schema/kernel/PackageStatusEnum.json +16 -0
  133. package/json-schema/kernel/Plugin.json +5 -0
  134. package/json-schema/kernel/PluginContext.json +31 -7
  135. package/json-schema/kernel/PluginLifecycle.json +7 -1
  136. package/json-schema/kernel/RealTimeNotificationConfig.json +3 -0
  137. package/json-schema/kernel/UninstallPackageRequest.json +18 -0
  138. package/json-schema/kernel/UninstallPackageResponse.json +25 -0
  139. package/json-schema/system/ChangeSet.json +2188 -186
  140. package/json-schema/system/CreateObjectOperation.json +1001 -0
  141. package/json-schema/system/MigrationOperation.json +1001 -0
  142. package/package.json +29 -15
  143. package/prompts/create-new-project.md +37 -19
  144. package/dist/{index-I3piy4U4.d.mts → index-BmU_sD1f.d.mts} +8 -8
  145. package/dist/{index-CkhpsEUw.d.ts → index-BnXuc_HO.d.ts} +8 -8
  146. package/dist/{index-CIDI-8zR.d.mts → index-C_NTOcet.d.mts} +98 -98
  147. package/dist/{index-CIDI-8zR.d.ts → index-C_NTOcet.d.ts} +98 -98
@@ -3193,7 +3193,7 @@ var ChangeRequestSchema = z12.object({
3193
3193
  });
3194
3194
 
3195
3195
  // src/system/migration.zod.ts
3196
- import { z as z18 } from "zod";
3196
+ import { z as z19 } from "zod";
3197
3197
 
3198
3198
  // src/data/field.zod.ts
3199
3199
  import { z as z15 } from "zod";
@@ -3562,7 +3562,7 @@ var FieldSchema = z15.object({
3562
3562
  });
3563
3563
 
3564
3564
  // src/data/object.zod.ts
3565
- import { z as z17 } from "zod";
3565
+ import { z as z18 } from "zod";
3566
3566
 
3567
3567
  // src/data/validation.zod.ts
3568
3568
  import { z as z16 } from "zod";
@@ -3647,8 +3647,77 @@ var ConditionalValidationSchema = BaseValidationSchema.extend({
3647
3647
  otherwise: ValidationRuleSchema.optional().describe("Validation rule to apply when condition is false")
3648
3648
  });
3649
3649
 
3650
+ // src/automation/state-machine.zod.ts
3651
+ import { z as z17 } from "zod";
3652
+ var ActionRefSchema = z17.union([
3653
+ z17.string().describe("Action Name"),
3654
+ z17.object({
3655
+ type: z17.string(),
3656
+ // e.g., 'xstate.assign', 'log', 'email'
3657
+ params: z17.record(z17.string(), z17.any()).optional()
3658
+ })
3659
+ ]);
3660
+ var GuardRefSchema = z17.union([
3661
+ z17.string().describe('Guard Name (e.g., "isManager", "amountGT1000")'),
3662
+ z17.object({
3663
+ type: z17.string(),
3664
+ params: z17.record(z17.string(), z17.any()).optional()
3665
+ })
3666
+ ]);
3667
+ var TransitionSchema = z17.object({
3668
+ target: z17.string().optional().describe("Target State ID"),
3669
+ cond: GuardRefSchema.optional().describe("Condition (Guard) required to take this path"),
3670
+ actions: z17.array(ActionRefSchema).optional().describe("Actions to execute during transition"),
3671
+ description: z17.string().optional().describe("Human readable description of this rule")
3672
+ });
3673
+ var EventSchema = z17.object({
3674
+ type: z17.string().describe('Event Type (e.g. "APPROVE", "REJECT", "Submit")'),
3675
+ // Payload validation schema could go here if we want deep validation
3676
+ schema: z17.record(z17.string(), z17.any()).optional().describe("Expected event payload structure")
3677
+ });
3678
+ var StateNodeSchema = z17.lazy(() => z17.object({
3679
+ /** Type of state */
3680
+ type: z17.enum(["atomic", "compound", "parallel", "final", "history"]).default("atomic"),
3681
+ /** Entry/Exit Actions */
3682
+ entry: z17.array(ActionRefSchema).optional().describe("Actions to run when entering this state"),
3683
+ exit: z17.array(ActionRefSchema).optional().describe("Actions to run when leaving this state"),
3684
+ /** Transitions (Events) */
3685
+ on: z17.record(z17.string(), z17.union([
3686
+ z17.string(),
3687
+ // Shorthand target
3688
+ TransitionSchema,
3689
+ z17.array(TransitionSchema)
3690
+ ])).optional().describe("Map of Event Type -> Transition Definition"),
3691
+ /** Always Transitions (Eventless) */
3692
+ always: z17.array(TransitionSchema).optional(),
3693
+ /** Nesting (Hierarchical States) */
3694
+ initial: z17.string().optional().describe("Initial child state (if compound)"),
3695
+ states: z17.record(z17.string(), StateNodeSchema).optional(),
3696
+ /** Metadata for UI/AI */
3697
+ meta: z17.object({
3698
+ label: z17.string().optional(),
3699
+ description: z17.string().optional(),
3700
+ color: z17.string().optional(),
3701
+ // For UI diagrams
3702
+ // Instructions for AI Agent when in this state
3703
+ aiInstructions: z17.string().optional().describe("Specific instructions for AI when in this state")
3704
+ }).optional()
3705
+ }));
3706
+ var StateMachineSchema = z17.object({
3707
+ id: SnakeCaseIdentifierSchema.describe("Unique Machine ID"),
3708
+ description: z17.string().optional(),
3709
+ /** Context (Memory) Schema */
3710
+ contextSchema: z17.record(z17.string(), z17.any()).optional().describe("Zod Schema for the machine context/memory"),
3711
+ /** Initial State */
3712
+ initial: z17.string().describe("Initial State ID"),
3713
+ /** State Definitions */
3714
+ states: z17.record(z17.string(), StateNodeSchema).describe("State Nodes"),
3715
+ /** Global Listeners */
3716
+ on: z17.record(z17.string(), z17.union([z17.string(), TransitionSchema, z17.array(TransitionSchema)])).optional()
3717
+ });
3718
+
3650
3719
  // src/data/object.zod.ts
3651
- var ApiMethod = z17.enum([
3720
+ var ApiMethod = z18.enum([
3652
3721
  "get",
3653
3722
  "list",
3654
3723
  // Read
@@ -3673,65 +3742,65 @@ var ApiMethod = z17.enum([
3673
3742
  "export"
3674
3743
  // Data portability
3675
3744
  ]);
3676
- var ObjectCapabilities = z17.object({
3745
+ var ObjectCapabilities = z18.object({
3677
3746
  /** Enable history tracking (Audit Trail) */
3678
- trackHistory: z17.boolean().default(false).describe("Enable field history tracking for audit compliance"),
3747
+ trackHistory: z18.boolean().default(false).describe("Enable field history tracking for audit compliance"),
3679
3748
  /** Enable global search indexing */
3680
- searchable: z17.boolean().default(true).describe("Index records for global search"),
3749
+ searchable: z18.boolean().default(true).describe("Index records for global search"),
3681
3750
  /** Enable REST/GraphQL API access */
3682
- apiEnabled: z17.boolean().default(true).describe("Expose object via automatic APIs"),
3751
+ apiEnabled: z18.boolean().default(true).describe("Expose object via automatic APIs"),
3683
3752
  /**
3684
3753
  * API Supported Operations
3685
3754
  * Granular control over API exposure.
3686
3755
  */
3687
- apiMethods: z17.array(ApiMethod).optional().describe("Whitelist of allowed API operations"),
3756
+ apiMethods: z18.array(ApiMethod).optional().describe("Whitelist of allowed API operations"),
3688
3757
  /** Enable standard attachments/files engine */
3689
- files: z17.boolean().default(false).describe("Enable file attachments and document management"),
3758
+ files: z18.boolean().default(false).describe("Enable file attachments and document management"),
3690
3759
  /** Enable social collaboration (Comments, Mentions, Feeds) */
3691
- feeds: z17.boolean().default(false).describe("Enable social feed, comments, and mentions (Chatter-like)"),
3760
+ feeds: z18.boolean().default(false).describe("Enable social feed, comments, and mentions (Chatter-like)"),
3692
3761
  /** Enable standard Activity suite (Tasks, Calendars, Events) */
3693
- activities: z17.boolean().default(false).describe("Enable standard tasks and events tracking"),
3762
+ activities: z18.boolean().default(false).describe("Enable standard tasks and events tracking"),
3694
3763
  /** Enable Recycle Bin / Soft Delete */
3695
- trash: z17.boolean().default(true).describe("Enable soft-delete with restore capability"),
3764
+ trash: z18.boolean().default(true).describe("Enable soft-delete with restore capability"),
3696
3765
  /** Enable "Recently Viewed" tracking */
3697
- mru: z17.boolean().default(true).describe("Track Most Recently Used (MRU) list for users"),
3766
+ mru: z18.boolean().default(true).describe("Track Most Recently Used (MRU) list for users"),
3698
3767
  /** Allow cloning records */
3699
- clone: z17.boolean().default(true).describe("Allow record deep cloning")
3700
- });
3701
- var IndexSchema = z17.object({
3702
- name: z17.string().optional().describe("Index name (auto-generated if not provided)"),
3703
- fields: z17.array(z17.string()).describe("Fields included in the index"),
3704
- type: z17.enum(["btree", "hash", "gin", "gist", "fulltext"]).optional().default("btree").describe("Index algorithm type"),
3705
- unique: z17.boolean().optional().default(false).describe("Whether the index enforces uniqueness"),
3706
- partial: z17.string().optional().describe("Partial index condition (SQL WHERE clause for conditional indexes)")
3707
- });
3708
- var SearchConfigSchema2 = z17.object({
3709
- fields: z17.array(z17.string()).describe("Fields to index for full-text search weighting"),
3710
- displayFields: z17.array(z17.string()).optional().describe("Fields to display in search result cards"),
3711
- filters: z17.array(z17.string()).optional().describe("Default filters for search results")
3712
- });
3713
- var TenancyConfigSchema = z17.object({
3714
- enabled: z17.boolean().describe("Enable multi-tenancy for this object"),
3715
- strategy: z17.enum(["shared", "isolated", "hybrid"]).describe("Tenant isolation strategy: shared (single DB, row-level), isolated (separate DB per tenant), hybrid (mix)"),
3716
- tenantField: z17.string().default("tenant_id").describe("Field name for tenant identifier"),
3717
- crossTenantAccess: z17.boolean().default(false).describe("Allow cross-tenant data access (with explicit permission)")
3718
- });
3719
- var SoftDeleteConfigSchema = z17.object({
3720
- enabled: z17.boolean().describe("Enable soft delete (trash/recycle bin)"),
3721
- field: z17.string().default("deleted_at").describe("Field name for soft delete timestamp"),
3722
- cascadeDelete: z17.boolean().default(false).describe("Cascade soft delete to related records")
3723
- });
3724
- var VersioningConfigSchema = z17.object({
3725
- enabled: z17.boolean().describe("Enable record versioning"),
3726
- strategy: z17.enum(["snapshot", "delta", "event-sourcing"]).describe("Versioning strategy: snapshot (full copy), delta (changes only), event-sourcing (event log)"),
3727
- retentionDays: z17.number().min(1).optional().describe("Number of days to retain old versions (undefined = infinite)"),
3728
- versionField: z17.string().default("version").describe("Field name for version number/timestamp")
3729
- });
3730
- var PartitioningConfigSchema = z17.object({
3731
- enabled: z17.boolean().describe("Enable table partitioning"),
3732
- strategy: z17.enum(["range", "hash", "list"]).describe("Partitioning strategy: range (date ranges), hash (consistent hashing), list (predefined values)"),
3733
- key: z17.string().describe("Field name to partition by"),
3734
- interval: z17.string().optional().describe('Partition interval for range strategy (e.g., "1 month", "1 year")')
3768
+ clone: z18.boolean().default(true).describe("Allow record deep cloning")
3769
+ });
3770
+ var IndexSchema = z18.object({
3771
+ name: z18.string().optional().describe("Index name (auto-generated if not provided)"),
3772
+ fields: z18.array(z18.string()).describe("Fields included in the index"),
3773
+ type: z18.enum(["btree", "hash", "gin", "gist", "fulltext"]).optional().default("btree").describe("Index algorithm type"),
3774
+ unique: z18.boolean().optional().default(false).describe("Whether the index enforces uniqueness"),
3775
+ partial: z18.string().optional().describe("Partial index condition (SQL WHERE clause for conditional indexes)")
3776
+ });
3777
+ var SearchConfigSchema2 = z18.object({
3778
+ fields: z18.array(z18.string()).describe("Fields to index for full-text search weighting"),
3779
+ displayFields: z18.array(z18.string()).optional().describe("Fields to display in search result cards"),
3780
+ filters: z18.array(z18.string()).optional().describe("Default filters for search results")
3781
+ });
3782
+ var TenancyConfigSchema = z18.object({
3783
+ enabled: z18.boolean().describe("Enable multi-tenancy for this object"),
3784
+ strategy: z18.enum(["shared", "isolated", "hybrid"]).describe("Tenant isolation strategy: shared (single DB, row-level), isolated (separate DB per tenant), hybrid (mix)"),
3785
+ tenantField: z18.string().default("tenant_id").describe("Field name for tenant identifier"),
3786
+ crossTenantAccess: z18.boolean().default(false).describe("Allow cross-tenant data access (with explicit permission)")
3787
+ });
3788
+ var SoftDeleteConfigSchema = z18.object({
3789
+ enabled: z18.boolean().describe("Enable soft delete (trash/recycle bin)"),
3790
+ field: z18.string().default("deleted_at").describe("Field name for soft delete timestamp"),
3791
+ cascadeDelete: z18.boolean().default(false).describe("Cascade soft delete to related records")
3792
+ });
3793
+ var VersioningConfigSchema = z18.object({
3794
+ enabled: z18.boolean().describe("Enable record versioning"),
3795
+ strategy: z18.enum(["snapshot", "delta", "event-sourcing"]).describe("Versioning strategy: snapshot (full copy), delta (changes only), event-sourcing (event log)"),
3796
+ retentionDays: z18.number().min(1).optional().describe("Number of days to retain old versions (undefined = infinite)"),
3797
+ versionField: z18.string().default("version").describe("Field name for version number/timestamp")
3798
+ });
3799
+ var PartitioningConfigSchema = z18.object({
3800
+ enabled: z18.boolean().describe("Enable table partitioning"),
3801
+ strategy: z18.enum(["range", "hash", "list"]).describe("Partitioning strategy: range (date ranges), hash (consistent hashing), list (predefined values)"),
3802
+ key: z18.string().describe("Field name to partition by"),
3803
+ interval: z18.string().optional().describe('Partition interval for range strategy (e.g., "1 month", "1 year")')
3735
3804
  }).refine((data) => {
3736
3805
  if (data.strategy === "range" && !data.interval) {
3737
3806
  return false;
@@ -3740,39 +3809,39 @@ var PartitioningConfigSchema = z17.object({
3740
3809
  }, {
3741
3810
  message: 'interval is required when strategy is "range"'
3742
3811
  });
3743
- var CDCConfigSchema = z17.object({
3744
- enabled: z17.boolean().describe("Enable Change Data Capture"),
3745
- events: z17.array(z17.enum(["insert", "update", "delete"])).describe("Event types to capture"),
3746
- destination: z17.string().describe('Destination endpoint (e.g., "kafka://topic", "webhook://url")')
3812
+ var CDCConfigSchema = z18.object({
3813
+ enabled: z18.boolean().describe("Enable Change Data Capture"),
3814
+ events: z18.array(z18.enum(["insert", "update", "delete"])).describe("Event types to capture"),
3815
+ destination: z18.string().describe('Destination endpoint (e.g., "kafka://topic", "webhook://url")')
3747
3816
  });
3748
- var ObjectSchemaBase = z17.object({
3817
+ var ObjectSchemaBase = z18.object({
3749
3818
  /**
3750
3819
  * Identity & Metadata
3751
3820
  */
3752
- name: z17.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Machine unique key (snake_case). Immutable."),
3753
- label: z17.string().optional().describe('Human readable singular label (e.g. "Account")'),
3754
- pluralLabel: z17.string().optional().describe('Human readable plural label (e.g. "Accounts")'),
3755
- description: z17.string().optional().describe("Developer documentation / description"),
3756
- icon: z17.string().optional().describe("Icon name (Lucide/Material) for UI representation"),
3821
+ name: z18.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Machine unique key (snake_case). Immutable."),
3822
+ label: z18.string().optional().describe('Human readable singular label (e.g. "Account")'),
3823
+ pluralLabel: z18.string().optional().describe('Human readable plural label (e.g. "Accounts")'),
3824
+ description: z18.string().optional().describe("Developer documentation / description"),
3825
+ icon: z18.string().optional().describe("Icon name (Lucide/Material) for UI representation"),
3757
3826
  /**
3758
3827
  * Taxonomy & Organization
3759
3828
  */
3760
- tags: z17.array(z17.string()).optional().describe('Categorization tags (e.g. "sales", "system", "reference")'),
3761
- active: z17.boolean().optional().default(true).describe("Is the object active and usable"),
3762
- isSystem: z17.boolean().optional().default(false).describe("Is system object (protected from deletion)"),
3763
- abstract: z17.boolean().optional().default(false).describe("Is abstract base object (cannot be instantiated)"),
3829
+ tags: z18.array(z18.string()).optional().describe('Categorization tags (e.g. "sales", "system", "reference")'),
3830
+ active: z18.boolean().optional().default(true).describe("Is the object active and usable"),
3831
+ isSystem: z18.boolean().optional().default(false).describe("Is system object (protected from deletion)"),
3832
+ abstract: z18.boolean().optional().default(false).describe("Is abstract base object (cannot be instantiated)"),
3764
3833
  /**
3765
3834
  * Storage & Virtualization
3766
3835
  */
3767
- datasource: z17.string().optional().default("default").describe('Target Datasource ID. "default" is the primary DB.'),
3768
- tableName: z17.string().optional().describe("Physical table/collection name in the target datasource"),
3836
+ datasource: z18.string().optional().default("default").describe('Target Datasource ID. "default" is the primary DB.'),
3837
+ tableName: z18.string().optional().describe("Physical table/collection name in the target datasource"),
3769
3838
  /**
3770
3839
  * Data Model
3771
3840
  */
3772
- fields: z17.record(z17.string().regex(/^[a-z_][a-z0-9_]*$/, {
3841
+ fields: z18.record(z18.string().regex(/^[a-z_][a-z0-9_]*$/, {
3773
3842
  message: 'Field names must be lowercase snake_case (e.g., "first_name", "company", "annual_revenue")'
3774
3843
  }), FieldSchema).describe("Field definitions map. Keys must be snake_case identifiers."),
3775
- indexes: z17.array(IndexSchema).optional().describe("Database performance indexes"),
3844
+ indexes: z18.array(IndexSchema).optional().describe("Database performance indexes"),
3776
3845
  /**
3777
3846
  * Advanced Data Management
3778
3847
  */
@@ -3790,12 +3859,22 @@ var ObjectSchemaBase = z17.object({
3790
3859
  * Logic & Validation (Co-located)
3791
3860
  * Best Practice: Define rules close to data.
3792
3861
  */
3793
- validations: z17.array(ValidationRuleSchema).optional().describe("Object-level validation rules"),
3862
+ validations: z18.array(ValidationRuleSchema).optional().describe("Object-level validation rules"),
3863
+ /**
3864
+ * State Machine(s)
3865
+ * Supports a single machine (legacy) or a named record of machines.
3866
+ * Multiple machines allow parallel lifecycles (e.g., status + payment_status + approval_status).
3867
+ *
3868
+ * @example Single: stateMachine: { id: 'lifecycle', initial: 'draft', states: {...} }
3869
+ * @example Multiple: stateMachines: { lifecycle: {...}, payment: {...}, approval: {...} }
3870
+ */
3871
+ stateMachine: StateMachineSchema.optional().describe("Single state machine for record lifecycle (shorthand)"),
3872
+ stateMachines: z18.record(z18.string(), StateMachineSchema).optional().describe("Named state machines for parallel lifecycles (e.g., status, payment, approval)"),
3794
3873
  /**
3795
3874
  * Display & UI Hints (Data-Layer)
3796
3875
  */
3797
- titleFormat: z17.string().optional().describe('Title expression (e.g. "{name} - {code}"). Overrides nameField.'),
3798
- compactLayout: z17.array(z17.string()).optional().describe("Primary fields for hover/cards/lookups"),
3876
+ titleFormat: z18.string().optional().describe('Title expression (e.g. "{name} - {code}"). Overrides nameField.'),
3877
+ compactLayout: z18.array(z18.string()).optional().describe("Primary fields for hover/cards/lookups"),
3799
3878
  /**
3800
3879
  * Search Engine Config
3801
3880
  */
@@ -3808,45 +3887,64 @@ var ObjectSchemaBase = z17.object({
3808
3887
  var ObjectSchema = Object.assign(ObjectSchemaBase, {
3809
3888
  create: (config) => config
3810
3889
  });
3890
+ var ObjectOwnershipEnum = z18.enum(["own", "extend"]);
3891
+ var ObjectExtensionSchema = z18.object({
3892
+ /** The target object name (FQN) to extend */
3893
+ extend: z18.string().describe("Target object name (FQN) to extend"),
3894
+ /** Fields to merge into the target object (additive) */
3895
+ fields: z18.record(z18.string(), FieldSchema).optional().describe("Fields to add/override"),
3896
+ /** Override label */
3897
+ label: z18.string().optional(),
3898
+ /** Override plural label */
3899
+ pluralLabel: z18.string().optional(),
3900
+ /** Override description */
3901
+ description: z18.string().optional(),
3902
+ /** Additional validation rules to add */
3903
+ validations: z18.array(ValidationRuleSchema).optional(),
3904
+ /** Additional indexes to add */
3905
+ indexes: z18.array(IndexSchema).optional(),
3906
+ /** Merge priority. Higher number applied later (wins on conflict). Default: 200 */
3907
+ priority: z18.number().int().min(0).max(999).default(200).describe("Merge priority (higher = applied later)")
3908
+ });
3811
3909
 
3812
3910
  // src/system/migration.zod.ts
3813
- var AddFieldOperation = z18.object({
3814
- type: z18.literal("add_field"),
3815
- objectName: z18.string(),
3816
- fieldName: z18.string(),
3911
+ var AddFieldOperation = z19.object({
3912
+ type: z19.literal("add_field"),
3913
+ objectName: z19.string(),
3914
+ fieldName: z19.string(),
3817
3915
  field: FieldSchema
3818
3916
  });
3819
- var ModifyFieldOperation = z18.object({
3820
- type: z18.literal("modify_field"),
3821
- objectName: z18.string(),
3822
- fieldName: z18.string(),
3823
- changes: z18.record(z18.string(), z18.unknown())
3917
+ var ModifyFieldOperation = z19.object({
3918
+ type: z19.literal("modify_field"),
3919
+ objectName: z19.string(),
3920
+ fieldName: z19.string(),
3921
+ changes: z19.record(z19.string(), z19.unknown())
3824
3922
  // Partial field definition updates
3825
3923
  });
3826
- var RemoveFieldOperation = z18.object({
3827
- type: z18.literal("remove_field"),
3828
- objectName: z18.string(),
3829
- fieldName: z18.string()
3924
+ var RemoveFieldOperation = z19.object({
3925
+ type: z19.literal("remove_field"),
3926
+ objectName: z19.string(),
3927
+ fieldName: z19.string()
3830
3928
  });
3831
- var CreateObjectOperation = z18.object({
3832
- type: z18.literal("create_object"),
3929
+ var CreateObjectOperation = z19.object({
3930
+ type: z19.literal("create_object"),
3833
3931
  object: ObjectSchema
3834
3932
  });
3835
- var RenameObjectOperation = z18.object({
3836
- type: z18.literal("rename_object"),
3837
- oldName: z18.string(),
3838
- newName: z18.string()
3933
+ var RenameObjectOperation = z19.object({
3934
+ type: z19.literal("rename_object"),
3935
+ oldName: z19.string(),
3936
+ newName: z19.string()
3839
3937
  });
3840
- var DeleteObjectOperation = z18.object({
3841
- type: z18.literal("delete_object"),
3842
- objectName: z18.string()
3938
+ var DeleteObjectOperation = z19.object({
3939
+ type: z19.literal("delete_object"),
3940
+ objectName: z19.string()
3843
3941
  });
3844
- var ExecuteSqlOperation = z18.object({
3845
- type: z18.literal("execute_sql"),
3846
- sql: z18.string(),
3847
- description: z18.string().optional()
3942
+ var ExecuteSqlOperation = z19.object({
3943
+ type: z19.literal("execute_sql"),
3944
+ sql: z19.string(),
3945
+ description: z19.string().optional()
3848
3946
  });
3849
- var MigrationOperationSchema = z18.discriminatedUnion("type", [
3947
+ var MigrationOperationSchema = z19.discriminatedUnion("type", [
3850
3948
  AddFieldOperation,
3851
3949
  ModifyFieldOperation,
3852
3950
  RemoveFieldOperation,
@@ -3855,65 +3953,65 @@ var MigrationOperationSchema = z18.discriminatedUnion("type", [
3855
3953
  DeleteObjectOperation,
3856
3954
  ExecuteSqlOperation
3857
3955
  ]);
3858
- var MigrationDependencySchema = z18.object({
3859
- migrationId: z18.string(),
3860
- package: z18.string().optional()
3861
- });
3862
- var ChangeSetSchema = z18.object({
3863
- id: z18.string().uuid().describe("Unique identifier for this change set"),
3864
- name: z18.string().describe("Human readable name for the migration"),
3865
- description: z18.string().optional(),
3866
- author: z18.string().optional(),
3867
- createdAt: z18.string().datetime().optional(),
3956
+ var MigrationDependencySchema = z19.object({
3957
+ migrationId: z19.string(),
3958
+ package: z19.string().optional()
3959
+ });
3960
+ var ChangeSetSchema = z19.object({
3961
+ id: z19.string().uuid().describe("Unique identifier for this change set"),
3962
+ name: z19.string().describe("Human readable name for the migration"),
3963
+ description: z19.string().optional(),
3964
+ author: z19.string().optional(),
3965
+ createdAt: z19.string().datetime().optional(),
3868
3966
  // Dependencies ensure migrations run in order
3869
- dependencies: z18.array(MigrationDependencySchema).optional(),
3967
+ dependencies: z19.array(MigrationDependencySchema).optional(),
3870
3968
  // The actual atomic operations
3871
- operations: z18.array(MigrationOperationSchema),
3969
+ operations: z19.array(MigrationOperationSchema),
3872
3970
  // Rollback operations (AI should generate these too)
3873
- rollback: z18.array(MigrationOperationSchema).optional()
3971
+ rollback: z19.array(MigrationOperationSchema).optional()
3874
3972
  });
3875
3973
 
3876
3974
  // src/system/auth-config.zod.ts
3877
- import { z as z19 } from "zod";
3878
- var AuthProviderConfigSchema = z19.object({
3879
- id: z19.string().describe("Provider ID (github, google)"),
3880
- clientId: z19.string().describe("OAuth Client ID"),
3881
- clientSecret: z19.string().describe("OAuth Client Secret"),
3882
- scope: z19.array(z19.string()).optional().describe("Requested permissions")
3883
- });
3884
- var AuthPluginConfigSchema = z19.object({
3885
- organization: z19.boolean().default(false).describe("Enable Organization/Teams support"),
3886
- twoFactor: z19.boolean().default(false).describe("Enable 2FA"),
3887
- passkeys: z19.boolean().default(false).describe("Enable Passkey support"),
3888
- magicLink: z19.boolean().default(false).describe("Enable Magic Link login")
3889
- });
3890
- var AuthConfigSchema = z19.object({
3891
- secret: z19.string().optional().describe("Encryption secret"),
3892
- baseUrl: z19.string().optional().describe("Base URL for auth routes"),
3893
- databaseUrl: z19.string().optional().describe("Database connection string"),
3894
- providers: z19.array(AuthProviderConfigSchema).optional(),
3975
+ import { z as z20 } from "zod";
3976
+ var AuthProviderConfigSchema = z20.object({
3977
+ id: z20.string().describe("Provider ID (github, google)"),
3978
+ clientId: z20.string().describe("OAuth Client ID"),
3979
+ clientSecret: z20.string().describe("OAuth Client Secret"),
3980
+ scope: z20.array(z20.string()).optional().describe("Requested permissions")
3981
+ });
3982
+ var AuthPluginConfigSchema = z20.object({
3983
+ organization: z20.boolean().default(false).describe("Enable Organization/Teams support"),
3984
+ twoFactor: z20.boolean().default(false).describe("Enable 2FA"),
3985
+ passkeys: z20.boolean().default(false).describe("Enable Passkey support"),
3986
+ magicLink: z20.boolean().default(false).describe("Enable Magic Link login")
3987
+ });
3988
+ var AuthConfigSchema = z20.object({
3989
+ secret: z20.string().optional().describe("Encryption secret"),
3990
+ baseUrl: z20.string().optional().describe("Base URL for auth routes"),
3991
+ databaseUrl: z20.string().optional().describe("Database connection string"),
3992
+ providers: z20.array(AuthProviderConfigSchema).optional(),
3895
3993
  plugins: AuthPluginConfigSchema.optional(),
3896
- session: z19.object({
3897
- expiresIn: z19.number().default(60 * 60 * 24 * 7).describe("Session duration in seconds"),
3898
- updateAge: z19.number().default(60 * 60 * 24).describe("Session update frequency")
3994
+ session: z20.object({
3995
+ expiresIn: z20.number().default(60 * 60 * 24 * 7).describe("Session duration in seconds"),
3996
+ updateAge: z20.number().default(60 * 60 * 24).describe("Session update frequency")
3899
3997
  }).optional(),
3900
3998
  // Custom auth properties
3901
- [z19.string().regex(/^[^A-Z]+$/).toString()]: z19.any().optional()
3999
+ [z20.string().regex(/^[^A-Z]+$/).toString()]: z20.any().optional()
3902
4000
  });
3903
4001
 
3904
4002
  // src/system/compliance.zod.ts
3905
- import { z as z20 } from "zod";
3906
- var GDPRConfigSchema = z20.object({
3907
- enabled: z20.boolean(),
3908
- dataSubjectRights: z20.object({
3909
- rightToAccess: z20.boolean().default(true),
3910
- rightToRectification: z20.boolean().default(true),
3911
- rightToErasure: z20.boolean().default(true),
3912
- rightToRestriction: z20.boolean().default(true),
3913
- rightToPortability: z20.boolean().default(true),
3914
- rightToObjection: z20.boolean().default(true)
4003
+ import { z as z21 } from "zod";
4004
+ var GDPRConfigSchema = z21.object({
4005
+ enabled: z21.boolean(),
4006
+ dataSubjectRights: z21.object({
4007
+ rightToAccess: z21.boolean().default(true),
4008
+ rightToRectification: z21.boolean().default(true),
4009
+ rightToErasure: z21.boolean().default(true),
4010
+ rightToRestriction: z21.boolean().default(true),
4011
+ rightToPortability: z21.boolean().default(true),
4012
+ rightToObjection: z21.boolean().default(true)
3915
4013
  }),
3916
- legalBasis: z20.enum([
4014
+ legalBasis: z21.enum([
3917
4015
  "consent",
3918
4016
  "contract",
3919
4017
  "legal-obligation",
@@ -3921,34 +4019,34 @@ var GDPRConfigSchema = z20.object({
3921
4019
  "public-task",
3922
4020
  "legitimate-interests"
3923
4021
  ]),
3924
- consentTracking: z20.boolean().default(true),
3925
- dataRetentionDays: z20.number().optional(),
3926
- dataProcessingAgreement: z20.string().optional()
3927
- });
3928
- var HIPAAConfigSchema = z20.object({
3929
- enabled: z20.boolean(),
3930
- phi: z20.object({
3931
- encryption: z20.boolean().default(true),
3932
- accessControl: z20.boolean().default(true),
3933
- auditTrail: z20.boolean().default(true),
3934
- backupAndRecovery: z20.boolean().default(true)
4022
+ consentTracking: z21.boolean().default(true),
4023
+ dataRetentionDays: z21.number().optional(),
4024
+ dataProcessingAgreement: z21.string().optional()
4025
+ });
4026
+ var HIPAAConfigSchema = z21.object({
4027
+ enabled: z21.boolean(),
4028
+ phi: z21.object({
4029
+ encryption: z21.boolean().default(true),
4030
+ accessControl: z21.boolean().default(true),
4031
+ auditTrail: z21.boolean().default(true),
4032
+ backupAndRecovery: z21.boolean().default(true)
3935
4033
  }),
3936
- businessAssociateAgreement: z20.boolean().default(false)
3937
- });
3938
- var PCIDSSConfigSchema = z20.object({
3939
- enabled: z20.boolean(),
3940
- level: z20.enum(["1", "2", "3", "4"]),
3941
- cardDataFields: z20.array(z20.string()),
3942
- tokenization: z20.boolean().default(true),
3943
- encryptionInTransit: z20.boolean().default(true),
3944
- encryptionAtRest: z20.boolean().default(true)
3945
- });
3946
- var AuditLogConfigSchema = z20.object({
3947
- enabled: z20.boolean().default(true),
3948
- retentionDays: z20.number().default(365),
3949
- immutable: z20.boolean().default(true),
3950
- signLogs: z20.boolean().default(false),
3951
- events: z20.array(z20.enum([
4034
+ businessAssociateAgreement: z21.boolean().default(false)
4035
+ });
4036
+ var PCIDSSConfigSchema = z21.object({
4037
+ enabled: z21.boolean(),
4038
+ level: z21.enum(["1", "2", "3", "4"]),
4039
+ cardDataFields: z21.array(z21.string()),
4040
+ tokenization: z21.boolean().default(true),
4041
+ encryptionInTransit: z21.boolean().default(true),
4042
+ encryptionAtRest: z21.boolean().default(true)
4043
+ });
4044
+ var AuditLogConfigSchema = z21.object({
4045
+ enabled: z21.boolean().default(true),
4046
+ retentionDays: z21.number().default(365),
4047
+ immutable: z21.boolean().default(true),
4048
+ signLogs: z21.boolean().default(false),
4049
+ events: z21.array(z21.enum([
3952
4050
  "create",
3953
4051
  "read",
3954
4052
  "update",
@@ -3960,7 +4058,7 @@ var AuditLogConfigSchema = z20.object({
3960
4058
  "failed-login"
3961
4059
  ]))
3962
4060
  });
3963
- var ComplianceConfigSchema = z20.object({
4061
+ var ComplianceConfigSchema = z21.object({
3964
4062
  gdpr: GDPRConfigSchema.optional(),
3965
4063
  hipaa: HIPAAConfigSchema.optional(),
3966
4064
  pciDss: PCIDSSConfigSchema.optional(),
@@ -3968,57 +4066,57 @@ var ComplianceConfigSchema = z20.object({
3968
4066
  });
3969
4067
 
3970
4068
  // src/system/job.zod.ts
3971
- import { z as z21 } from "zod";
3972
- var CronScheduleSchema = z21.object({
3973
- type: z21.literal("cron"),
3974
- expression: z21.string().describe('Cron expression (e.g., "0 0 * * *" for daily at midnight)'),
3975
- timezone: z21.string().optional().default("UTC").describe('Timezone for cron execution (e.g., "America/New_York")')
4069
+ import { z as z22 } from "zod";
4070
+ var CronScheduleSchema = z22.object({
4071
+ type: z22.literal("cron"),
4072
+ expression: z22.string().describe('Cron expression (e.g., "0 0 * * *" for daily at midnight)'),
4073
+ timezone: z22.string().optional().default("UTC").describe('Timezone for cron execution (e.g., "America/New_York")')
3976
4074
  });
3977
- var IntervalScheduleSchema = z21.object({
3978
- type: z21.literal("interval"),
3979
- intervalMs: z21.number().int().positive().describe("Interval in milliseconds")
4075
+ var IntervalScheduleSchema = z22.object({
4076
+ type: z22.literal("interval"),
4077
+ intervalMs: z22.number().int().positive().describe("Interval in milliseconds")
3980
4078
  });
3981
- var OnceScheduleSchema = z21.object({
3982
- type: z21.literal("once"),
3983
- at: z21.string().datetime().describe("ISO 8601 datetime when to execute")
4079
+ var OnceScheduleSchema = z22.object({
4080
+ type: z22.literal("once"),
4081
+ at: z22.string().datetime().describe("ISO 8601 datetime when to execute")
3984
4082
  });
3985
- var ScheduleSchema = z21.discriminatedUnion("type", [
4083
+ var ScheduleSchema = z22.discriminatedUnion("type", [
3986
4084
  CronScheduleSchema,
3987
4085
  IntervalScheduleSchema,
3988
4086
  OnceScheduleSchema
3989
4087
  ]);
3990
- var RetryPolicySchema = z21.object({
3991
- maxRetries: z21.number().int().min(0).default(3).describe("Maximum number of retry attempts"),
3992
- backoffMs: z21.number().int().positive().default(1e3).describe("Initial backoff delay in milliseconds"),
3993
- backoffMultiplier: z21.number().positive().default(2).describe("Multiplier for exponential backoff")
3994
- });
3995
- var JobSchema = z21.object({
3996
- id: z21.string().describe("Unique job identifier"),
3997
- name: z21.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Job name (snake_case)"),
4088
+ var RetryPolicySchema = z22.object({
4089
+ maxRetries: z22.number().int().min(0).default(3).describe("Maximum number of retry attempts"),
4090
+ backoffMs: z22.number().int().positive().default(1e3).describe("Initial backoff delay in milliseconds"),
4091
+ backoffMultiplier: z22.number().positive().default(2).describe("Multiplier for exponential backoff")
4092
+ });
4093
+ var JobSchema = z22.object({
4094
+ id: z22.string().describe("Unique job identifier"),
4095
+ name: z22.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Job name (snake_case)"),
3998
4096
  schedule: ScheduleSchema.describe("Job schedule configuration"),
3999
- handler: z21.string().describe('Handler path (e.g. "path/to/file:functionName") or script ID'),
4097
+ handler: z22.string().describe('Handler path (e.g. "path/to/file:functionName") or script ID'),
4000
4098
  retryPolicy: RetryPolicySchema.optional().describe("Retry policy configuration"),
4001
- timeout: z21.number().int().positive().optional().describe("Timeout in milliseconds"),
4002
- enabled: z21.boolean().default(true).describe("Whether the job is enabled")
4099
+ timeout: z22.number().int().positive().optional().describe("Timeout in milliseconds"),
4100
+ enabled: z22.boolean().default(true).describe("Whether the job is enabled")
4003
4101
  });
4004
- var JobExecutionStatus = z21.enum([
4102
+ var JobExecutionStatus = z22.enum([
4005
4103
  "running",
4006
4104
  "success",
4007
4105
  "failed",
4008
4106
  "timeout"
4009
4107
  ]);
4010
- var JobExecutionSchema = z21.object({
4011
- jobId: z21.string().describe("Job identifier"),
4012
- startedAt: z21.string().datetime().describe("ISO 8601 datetime when execution started"),
4013
- completedAt: z21.string().datetime().optional().describe("ISO 8601 datetime when execution completed"),
4108
+ var JobExecutionSchema = z22.object({
4109
+ jobId: z22.string().describe("Job identifier"),
4110
+ startedAt: z22.string().datetime().describe("ISO 8601 datetime when execution started"),
4111
+ completedAt: z22.string().datetime().optional().describe("ISO 8601 datetime when execution completed"),
4014
4112
  status: JobExecutionStatus.describe("Execution status"),
4015
- error: z21.string().optional().describe("Error message if failed"),
4016
- duration: z21.number().int().optional().describe("Execution duration in milliseconds")
4113
+ error: z22.string().optional().describe("Error message if failed"),
4114
+ duration: z22.number().int().optional().describe("Execution duration in milliseconds")
4017
4115
  });
4018
4116
 
4019
4117
  // src/system/worker.zod.ts
4020
- import { z as z22 } from "zod";
4021
- var TaskPriority = z22.enum([
4118
+ import { z as z23 } from "zod";
4119
+ var TaskPriority = z23.enum([
4022
4120
  "critical",
4023
4121
  // 0 - Must execute immediately
4024
4122
  "high",
@@ -4037,7 +4135,7 @@ var TASK_PRIORITY_VALUES = {
4037
4135
  low: 3,
4038
4136
  background: 4
4039
4137
  };
4040
- var TaskStatus = z22.enum([
4138
+ var TaskStatus = z23.enum([
4041
4139
  "pending",
4042
4140
  // Waiting to be processed
4043
4141
  "queued",
@@ -4055,30 +4153,30 @@ var TaskStatus = z22.enum([
4055
4153
  "dead"
4056
4154
  // Moved to dead letter queue
4057
4155
  ]);
4058
- var TaskRetryPolicySchema = z22.object({
4059
- maxRetries: z22.number().int().min(0).default(3).describe("Maximum retry attempts"),
4060
- backoffStrategy: z22.enum(["fixed", "linear", "exponential"]).default("exponential").describe("Backoff strategy between retries"),
4061
- initialDelayMs: z22.number().int().positive().default(1e3).describe("Initial retry delay in milliseconds"),
4062
- maxDelayMs: z22.number().int().positive().default(6e4).describe("Maximum retry delay in milliseconds"),
4063
- backoffMultiplier: z22.number().positive().default(2).describe("Multiplier for exponential backoff")
4156
+ var TaskRetryPolicySchema = z23.object({
4157
+ maxRetries: z23.number().int().min(0).default(3).describe("Maximum retry attempts"),
4158
+ backoffStrategy: z23.enum(["fixed", "linear", "exponential"]).default("exponential").describe("Backoff strategy between retries"),
4159
+ initialDelayMs: z23.number().int().positive().default(1e3).describe("Initial retry delay in milliseconds"),
4160
+ maxDelayMs: z23.number().int().positive().default(6e4).describe("Maximum retry delay in milliseconds"),
4161
+ backoffMultiplier: z23.number().positive().default(2).describe("Multiplier for exponential backoff")
4064
4162
  });
4065
- var TaskSchema = z22.object({
4163
+ var TaskSchema = z23.object({
4066
4164
  /**
4067
4165
  * Unique task identifier
4068
4166
  */
4069
- id: z22.string().describe("Unique task identifier"),
4167
+ id: z23.string().describe("Unique task identifier"),
4070
4168
  /**
4071
4169
  * Task type (handler identifier)
4072
4170
  */
4073
- type: z22.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Task type (snake_case)"),
4171
+ type: z23.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Task type (snake_case)"),
4074
4172
  /**
4075
4173
  * Task payload data
4076
4174
  */
4077
- payload: z22.any().describe("Task payload data"),
4175
+ payload: z23.any().describe("Task payload data"),
4078
4176
  /**
4079
4177
  * Queue name
4080
4178
  */
4081
- queue: z22.string().default("default").describe("Queue name"),
4179
+ queue: z23.string().default("default").describe("Queue name"),
4082
4180
  /**
4083
4181
  * Task priority
4084
4182
  */
@@ -4090,15 +4188,15 @@ var TaskSchema = z22.object({
4090
4188
  /**
4091
4189
  * Execution timeout in milliseconds
4092
4190
  */
4093
- timeoutMs: z22.number().int().positive().optional().describe("Task timeout in milliseconds"),
4191
+ timeoutMs: z23.number().int().positive().optional().describe("Task timeout in milliseconds"),
4094
4192
  /**
4095
4193
  * Scheduled execution time
4096
4194
  */
4097
- scheduledAt: z22.string().datetime().optional().describe("ISO 8601 datetime to execute task"),
4195
+ scheduledAt: z23.string().datetime().optional().describe("ISO 8601 datetime to execute task"),
4098
4196
  /**
4099
4197
  * Maximum execution attempts
4100
4198
  */
4101
- attempts: z22.number().int().min(0).default(0).describe("Number of execution attempts"),
4199
+ attempts: z23.number().int().min(0).default(0).describe("Number of execution attempts"),
4102
4200
  /**
4103
4201
  * Task status
4104
4202
  */
@@ -4106,18 +4204,18 @@ var TaskSchema = z22.object({
4106
4204
  /**
4107
4205
  * Task metadata
4108
4206
  */
4109
- metadata: z22.object({
4110
- createdAt: z22.string().datetime().optional().describe("When task was created"),
4111
- updatedAt: z22.string().datetime().optional().describe("Last update time"),
4112
- createdBy: z22.string().optional().describe("User who created task"),
4113
- tags: z22.array(z22.string()).optional().describe("Task tags for filtering")
4207
+ metadata: z23.object({
4208
+ createdAt: z23.string().datetime().optional().describe("When task was created"),
4209
+ updatedAt: z23.string().datetime().optional().describe("Last update time"),
4210
+ createdBy: z23.string().optional().describe("User who created task"),
4211
+ tags: z23.array(z23.string()).optional().describe("Task tags for filtering")
4114
4212
  }).optional().describe("Task metadata")
4115
4213
  });
4116
- var TaskExecutionResultSchema = z22.object({
4214
+ var TaskExecutionResultSchema = z23.object({
4117
4215
  /**
4118
4216
  * Task identifier
4119
4217
  */
4120
- taskId: z22.string().describe("Task identifier"),
4218
+ taskId: z23.string().describe("Task identifier"),
4121
4219
  /**
4122
4220
  * Execution status
4123
4221
  */
@@ -4125,45 +4223,45 @@ var TaskExecutionResultSchema = z22.object({
4125
4223
  /**
4126
4224
  * Execution result data
4127
4225
  */
4128
- result: z22.any().optional().describe("Execution result data"),
4226
+ result: z23.any().optional().describe("Execution result data"),
4129
4227
  /**
4130
4228
  * Error information
4131
4229
  */
4132
- error: z22.object({
4133
- message: z22.string().describe("Error message"),
4134
- stack: z22.string().optional().describe("Error stack trace"),
4135
- code: z22.string().optional().describe("Error code")
4230
+ error: z23.object({
4231
+ message: z23.string().describe("Error message"),
4232
+ stack: z23.string().optional().describe("Error stack trace"),
4233
+ code: z23.string().optional().describe("Error code")
4136
4234
  }).optional().describe("Error details if failed"),
4137
4235
  /**
4138
4236
  * Execution duration
4139
4237
  */
4140
- durationMs: z22.number().int().optional().describe("Execution duration in milliseconds"),
4238
+ durationMs: z23.number().int().optional().describe("Execution duration in milliseconds"),
4141
4239
  /**
4142
4240
  * Execution timestamps
4143
4241
  */
4144
- startedAt: z22.string().datetime().describe("When execution started"),
4145
- completedAt: z22.string().datetime().optional().describe("When execution completed"),
4242
+ startedAt: z23.string().datetime().describe("When execution started"),
4243
+ completedAt: z23.string().datetime().optional().describe("When execution completed"),
4146
4244
  /**
4147
4245
  * Retry information
4148
4246
  */
4149
- attempt: z22.number().int().min(1).describe("Attempt number (1-indexed)"),
4150
- willRetry: z22.boolean().describe("Whether task will be retried")
4247
+ attempt: z23.number().int().min(1).describe("Attempt number (1-indexed)"),
4248
+ willRetry: z23.boolean().describe("Whether task will be retried")
4151
4249
  });
4152
- var QueueConfigSchema = z22.object({
4250
+ var QueueConfigSchema = z23.object({
4153
4251
  /**
4154
4252
  * Queue name
4155
4253
  */
4156
- name: z22.string().describe("Queue name (snake_case)"),
4254
+ name: z23.string().describe("Queue name (snake_case)"),
4157
4255
  /**
4158
4256
  * Maximum concurrent workers
4159
4257
  */
4160
- concurrency: z22.number().int().min(1).default(5).describe("Max concurrent task executions"),
4258
+ concurrency: z23.number().int().min(1).default(5).describe("Max concurrent task executions"),
4161
4259
  /**
4162
4260
  * Rate limiting
4163
4261
  */
4164
- rateLimit: z22.object({
4165
- max: z22.number().int().positive().describe("Maximum tasks per duration"),
4166
- duration: z22.number().int().positive().describe("Duration in milliseconds")
4262
+ rateLimit: z23.object({
4263
+ max: z23.number().int().positive().describe("Maximum tasks per duration"),
4264
+ duration: z23.number().int().positive().describe("Duration in milliseconds")
4167
4265
  }).optional().describe("Rate limit configuration"),
4168
4266
  /**
4169
4267
  * Default retry policy
@@ -4172,43 +4270,43 @@ var QueueConfigSchema = z22.object({
4172
4270
  /**
4173
4271
  * Dead letter queue
4174
4272
  */
4175
- deadLetterQueue: z22.string().optional().describe("Dead letter queue name"),
4273
+ deadLetterQueue: z23.string().optional().describe("Dead letter queue name"),
4176
4274
  /**
4177
4275
  * Queue priority
4178
4276
  */
4179
- priority: z22.number().int().min(0).default(0).describe("Queue priority (lower = higher priority)"),
4277
+ priority: z23.number().int().min(0).default(0).describe("Queue priority (lower = higher priority)"),
4180
4278
  /**
4181
4279
  * Auto-scaling configuration
4182
4280
  */
4183
- autoScale: z22.object({
4184
- enabled: z22.boolean().default(false).describe("Enable auto-scaling"),
4185
- minWorkers: z22.number().int().min(1).default(1).describe("Minimum workers"),
4186
- maxWorkers: z22.number().int().min(1).default(10).describe("Maximum workers"),
4187
- scaleUpThreshold: z22.number().int().positive().default(100).describe("Queue size to scale up"),
4188
- scaleDownThreshold: z22.number().int().min(0).default(10).describe("Queue size to scale down")
4281
+ autoScale: z23.object({
4282
+ enabled: z23.boolean().default(false).describe("Enable auto-scaling"),
4283
+ minWorkers: z23.number().int().min(1).default(1).describe("Minimum workers"),
4284
+ maxWorkers: z23.number().int().min(1).default(10).describe("Maximum workers"),
4285
+ scaleUpThreshold: z23.number().int().positive().default(100).describe("Queue size to scale up"),
4286
+ scaleDownThreshold: z23.number().int().min(0).default(10).describe("Queue size to scale down")
4189
4287
  }).optional().describe("Auto-scaling configuration")
4190
4288
  });
4191
- var BatchTaskSchema = z22.object({
4289
+ var BatchTaskSchema = z23.object({
4192
4290
  /**
4193
4291
  * Batch job identifier
4194
4292
  */
4195
- id: z22.string().describe("Unique batch job identifier"),
4293
+ id: z23.string().describe("Unique batch job identifier"),
4196
4294
  /**
4197
4295
  * Task type for processing each item
4198
4296
  */
4199
- type: z22.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Task type (snake_case)"),
4297
+ type: z23.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Task type (snake_case)"),
4200
4298
  /**
4201
4299
  * Items to process
4202
4300
  */
4203
- items: z22.array(z22.any()).describe("Array of items to process"),
4301
+ items: z23.array(z23.any()).describe("Array of items to process"),
4204
4302
  /**
4205
4303
  * Batch size (items per task)
4206
4304
  */
4207
- batchSize: z22.number().int().min(1).default(100).describe("Number of items per batch"),
4305
+ batchSize: z23.number().int().min(1).default(100).describe("Number of items per batch"),
4208
4306
  /**
4209
4307
  * Queue name
4210
4308
  */
4211
- queue: z22.string().default("batch").describe("Queue for batch tasks"),
4309
+ queue: z23.string().default("batch").describe("Queue for batch tasks"),
4212
4310
  /**
4213
4311
  * Priority
4214
4312
  */
@@ -4216,11 +4314,11 @@ var BatchTaskSchema = z22.object({
4216
4314
  /**
4217
4315
  * Parallel processing
4218
4316
  */
4219
- parallel: z22.boolean().default(true).describe("Process batches in parallel"),
4317
+ parallel: z23.boolean().default(true).describe("Process batches in parallel"),
4220
4318
  /**
4221
4319
  * Stop on error
4222
4320
  */
4223
- stopOnError: z22.boolean().default(false).describe("Stop batch if any item fails"),
4321
+ stopOnError: z23.boolean().default(false).describe("Stop batch if any item fails"),
4224
4322
  /**
4225
4323
  * Progress callback
4226
4324
  *
@@ -4230,118 +4328,118 @@ var BatchTaskSchema = z22.object({
4230
4328
  *
4231
4329
  * @param progress - Object containing processed count, total count, and failed count
4232
4330
  */
4233
- onProgress: z22.function().args(z22.object({
4234
- processed: z22.number(),
4235
- total: z22.number(),
4236
- failed: z22.number()
4237
- })).returns(z22.void()).optional().describe("Progress callback function (called after each batch)")
4331
+ onProgress: z23.function().args(z23.object({
4332
+ processed: z23.number(),
4333
+ total: z23.number(),
4334
+ failed: z23.number()
4335
+ })).returns(z23.void()).optional().describe("Progress callback function (called after each batch)")
4238
4336
  });
4239
- var BatchProgressSchema = z22.object({
4337
+ var BatchProgressSchema = z23.object({
4240
4338
  /**
4241
4339
  * Batch job identifier
4242
4340
  */
4243
- batchId: z22.string().describe("Batch job identifier"),
4341
+ batchId: z23.string().describe("Batch job identifier"),
4244
4342
  /**
4245
4343
  * Total items
4246
4344
  */
4247
- total: z22.number().int().min(0).describe("Total number of items"),
4345
+ total: z23.number().int().min(0).describe("Total number of items"),
4248
4346
  /**
4249
4347
  * Processed items
4250
4348
  */
4251
- processed: z22.number().int().min(0).default(0).describe("Items processed"),
4349
+ processed: z23.number().int().min(0).default(0).describe("Items processed"),
4252
4350
  /**
4253
4351
  * Successful items
4254
4352
  */
4255
- succeeded: z22.number().int().min(0).default(0).describe("Items succeeded"),
4353
+ succeeded: z23.number().int().min(0).default(0).describe("Items succeeded"),
4256
4354
  /**
4257
4355
  * Failed items
4258
4356
  */
4259
- failed: z22.number().int().min(0).default(0).describe("Items failed"),
4357
+ failed: z23.number().int().min(0).default(0).describe("Items failed"),
4260
4358
  /**
4261
4359
  * Progress percentage
4262
4360
  */
4263
- percentage: z22.number().min(0).max(100).describe("Progress percentage"),
4361
+ percentage: z23.number().min(0).max(100).describe("Progress percentage"),
4264
4362
  /**
4265
4363
  * Status
4266
4364
  */
4267
- status: z22.enum(["pending", "running", "completed", "failed", "cancelled"]).describe("Batch status"),
4365
+ status: z23.enum(["pending", "running", "completed", "failed", "cancelled"]).describe("Batch status"),
4268
4366
  /**
4269
4367
  * Timestamps
4270
4368
  */
4271
- startedAt: z22.string().datetime().optional().describe("When batch started"),
4272
- completedAt: z22.string().datetime().optional().describe("When batch completed")
4369
+ startedAt: z23.string().datetime().optional().describe("When batch started"),
4370
+ completedAt: z23.string().datetime().optional().describe("When batch completed")
4273
4371
  });
4274
- var WorkerConfigSchema = z22.object({
4372
+ var WorkerConfigSchema = z23.object({
4275
4373
  /**
4276
4374
  * Worker name
4277
4375
  */
4278
- name: z22.string().describe("Worker name"),
4376
+ name: z23.string().describe("Worker name"),
4279
4377
  /**
4280
4378
  * Queues to process
4281
4379
  */
4282
- queues: z22.array(z22.string()).min(1).describe("Queue names to process"),
4380
+ queues: z23.array(z23.string()).min(1).describe("Queue names to process"),
4283
4381
  /**
4284
4382
  * Queue configurations
4285
4383
  */
4286
- queueConfigs: z22.array(QueueConfigSchema).optional().describe("Queue configurations"),
4384
+ queueConfigs: z23.array(QueueConfigSchema).optional().describe("Queue configurations"),
4287
4385
  /**
4288
4386
  * Polling interval
4289
4387
  */
4290
- pollIntervalMs: z22.number().int().positive().default(1e3).describe("Queue polling interval in milliseconds"),
4388
+ pollIntervalMs: z23.number().int().positive().default(1e3).describe("Queue polling interval in milliseconds"),
4291
4389
  /**
4292
4390
  * Visibility timeout
4293
4391
  */
4294
- visibilityTimeoutMs: z22.number().int().positive().default(3e4).describe("How long a task is invisible after being claimed"),
4392
+ visibilityTimeoutMs: z23.number().int().positive().default(3e4).describe("How long a task is invisible after being claimed"),
4295
4393
  /**
4296
4394
  * Task timeout
4297
4395
  */
4298
- defaultTimeoutMs: z22.number().int().positive().default(3e5).describe("Default task timeout in milliseconds"),
4396
+ defaultTimeoutMs: z23.number().int().positive().default(3e5).describe("Default task timeout in milliseconds"),
4299
4397
  /**
4300
4398
  * Graceful shutdown timeout
4301
4399
  */
4302
- shutdownTimeoutMs: z22.number().int().positive().default(3e4).describe("Graceful shutdown timeout in milliseconds"),
4400
+ shutdownTimeoutMs: z23.number().int().positive().default(3e4).describe("Graceful shutdown timeout in milliseconds"),
4303
4401
  /**
4304
4402
  * Task handlers
4305
4403
  */
4306
- handlers: z22.record(z22.string(), z22.function()).optional().describe("Task type handlers")
4404
+ handlers: z23.record(z23.string(), z23.function()).optional().describe("Task type handlers")
4307
4405
  });
4308
- var WorkerStatsSchema = z22.object({
4406
+ var WorkerStatsSchema = z23.object({
4309
4407
  /**
4310
4408
  * Worker name
4311
4409
  */
4312
- workerName: z22.string().describe("Worker name"),
4410
+ workerName: z23.string().describe("Worker name"),
4313
4411
  /**
4314
4412
  * Total tasks processed
4315
4413
  */
4316
- totalProcessed: z22.number().int().min(0).describe("Total tasks processed"),
4414
+ totalProcessed: z23.number().int().min(0).describe("Total tasks processed"),
4317
4415
  /**
4318
4416
  * Successful tasks
4319
4417
  */
4320
- succeeded: z22.number().int().min(0).describe("Successful tasks"),
4418
+ succeeded: z23.number().int().min(0).describe("Successful tasks"),
4321
4419
  /**
4322
4420
  * Failed tasks
4323
4421
  */
4324
- failed: z22.number().int().min(0).describe("Failed tasks"),
4422
+ failed: z23.number().int().min(0).describe("Failed tasks"),
4325
4423
  /**
4326
4424
  * Active tasks
4327
4425
  */
4328
- active: z22.number().int().min(0).describe("Currently active tasks"),
4426
+ active: z23.number().int().min(0).describe("Currently active tasks"),
4329
4427
  /**
4330
4428
  * Average execution time
4331
4429
  */
4332
- avgExecutionMs: z22.number().min(0).optional().describe("Average execution time in milliseconds"),
4430
+ avgExecutionMs: z23.number().min(0).optional().describe("Average execution time in milliseconds"),
4333
4431
  /**
4334
4432
  * Uptime
4335
4433
  */
4336
- uptimeMs: z22.number().int().min(0).describe("Worker uptime in milliseconds"),
4434
+ uptimeMs: z23.number().int().min(0).describe("Worker uptime in milliseconds"),
4337
4435
  /**
4338
4436
  * Queue stats
4339
4437
  */
4340
- queues: z22.record(z22.string(), z22.object({
4341
- pending: z22.number().int().min(0).describe("Pending tasks"),
4342
- active: z22.number().int().min(0).describe("Active tasks"),
4343
- completed: z22.number().int().min(0).describe("Completed tasks"),
4344
- failed: z22.number().int().min(0).describe("Failed tasks")
4438
+ queues: z23.record(z23.string(), z23.object({
4439
+ pending: z23.number().int().min(0).describe("Pending tasks"),
4440
+ active: z23.number().int().min(0).describe("Active tasks"),
4441
+ completed: z23.number().int().min(0).describe("Completed tasks"),
4442
+ failed: z23.number().int().min(0).describe("Failed tasks")
4345
4443
  })).optional().describe("Per-queue statistics")
4346
4444
  });
4347
4445
  var Task = Object.assign(TaskSchema, {
@@ -4358,113 +4456,113 @@ var BatchTask = Object.assign(BatchTaskSchema, {
4358
4456
  });
4359
4457
 
4360
4458
  // src/system/notification.zod.ts
4361
- import { z as z23 } from "zod";
4362
- var EmailTemplateSchema = z23.object({
4459
+ import { z as z24 } from "zod";
4460
+ var EmailTemplateSchema = z24.object({
4363
4461
  /**
4364
4462
  * Unique identifier for the email template
4365
4463
  */
4366
- id: z23.string().describe("Template identifier"),
4464
+ id: z24.string().describe("Template identifier"),
4367
4465
  /**
4368
4466
  * Email subject line (supports variable interpolation)
4369
4467
  */
4370
- subject: z23.string().describe("Email subject"),
4468
+ subject: z24.string().describe("Email subject"),
4371
4469
  /**
4372
4470
  * Email body content
4373
4471
  */
4374
- body: z23.string().describe("Email body content"),
4472
+ body: z24.string().describe("Email body content"),
4375
4473
  /**
4376
4474
  * Content type of the email body
4377
4475
  * @default 'html'
4378
4476
  */
4379
- bodyType: z23.enum(["text", "html", "markdown"]).optional().default("html").describe("Body content type"),
4477
+ bodyType: z24.enum(["text", "html", "markdown"]).optional().default("html").describe("Body content type"),
4380
4478
  /**
4381
4479
  * List of template variables for dynamic content
4382
4480
  */
4383
- variables: z23.array(z23.string()).optional().describe("Template variables"),
4481
+ variables: z24.array(z24.string()).optional().describe("Template variables"),
4384
4482
  /**
4385
4483
  * File attachments to include with the email
4386
4484
  */
4387
- attachments: z23.array(z23.object({
4388
- name: z23.string().describe("Attachment filename"),
4389
- url: z23.string().url().describe("Attachment URL")
4485
+ attachments: z24.array(z24.object({
4486
+ name: z24.string().describe("Attachment filename"),
4487
+ url: z24.string().url().describe("Attachment URL")
4390
4488
  })).optional().describe("Email attachments")
4391
4489
  });
4392
- var SMSTemplateSchema = z23.object({
4490
+ var SMSTemplateSchema = z24.object({
4393
4491
  /**
4394
4492
  * Unique identifier for the SMS template
4395
4493
  */
4396
- id: z23.string().describe("Template identifier"),
4494
+ id: z24.string().describe("Template identifier"),
4397
4495
  /**
4398
4496
  * SMS message content (supports variable interpolation)
4399
4497
  */
4400
- message: z23.string().describe("SMS message content"),
4498
+ message: z24.string().describe("SMS message content"),
4401
4499
  /**
4402
4500
  * Maximum character length for the SMS
4403
4501
  * @default 160
4404
4502
  */
4405
- maxLength: z23.number().optional().default(160).describe("Maximum message length"),
4503
+ maxLength: z24.number().optional().default(160).describe("Maximum message length"),
4406
4504
  /**
4407
4505
  * List of template variables for dynamic content
4408
4506
  */
4409
- variables: z23.array(z23.string()).optional().describe("Template variables")
4507
+ variables: z24.array(z24.string()).optional().describe("Template variables")
4410
4508
  });
4411
- var PushNotificationSchema = z23.object({
4509
+ var PushNotificationSchema = z24.object({
4412
4510
  /**
4413
4511
  * Notification title
4414
4512
  */
4415
- title: z23.string().describe("Notification title"),
4513
+ title: z24.string().describe("Notification title"),
4416
4514
  /**
4417
4515
  * Notification body text
4418
4516
  */
4419
- body: z23.string().describe("Notification body"),
4517
+ body: z24.string().describe("Notification body"),
4420
4518
  /**
4421
4519
  * Icon URL to display with notification
4422
4520
  */
4423
- icon: z23.string().url().optional().describe("Notification icon URL"),
4521
+ icon: z24.string().url().optional().describe("Notification icon URL"),
4424
4522
  /**
4425
4523
  * Badge count to display on app icon
4426
4524
  */
4427
- badge: z23.number().optional().describe("Badge count"),
4525
+ badge: z24.number().optional().describe("Badge count"),
4428
4526
  /**
4429
4527
  * Custom data payload
4430
4528
  */
4431
- data: z23.record(z23.string(), z23.any()).optional().describe("Custom data"),
4529
+ data: z24.record(z24.string(), z24.any()).optional().describe("Custom data"),
4432
4530
  /**
4433
4531
  * Action buttons for the notification
4434
4532
  */
4435
- actions: z23.array(z23.object({
4436
- action: z23.string().describe("Action identifier"),
4437
- title: z23.string().describe("Action button title")
4533
+ actions: z24.array(z24.object({
4534
+ action: z24.string().describe("Action identifier"),
4535
+ title: z24.string().describe("Action button title")
4438
4536
  })).optional().describe("Notification actions")
4439
4537
  });
4440
- var InAppNotificationSchema = z23.object({
4538
+ var InAppNotificationSchema = z24.object({
4441
4539
  /**
4442
4540
  * Notification title
4443
4541
  */
4444
- title: z23.string().describe("Notification title"),
4542
+ title: z24.string().describe("Notification title"),
4445
4543
  /**
4446
4544
  * Notification message content
4447
4545
  */
4448
- message: z23.string().describe("Notification message"),
4546
+ message: z24.string().describe("Notification message"),
4449
4547
  /**
4450
4548
  * Notification severity type
4451
4549
  */
4452
- type: z23.enum(["info", "success", "warning", "error"]).describe("Notification type"),
4550
+ type: z24.enum(["info", "success", "warning", "error"]).describe("Notification type"),
4453
4551
  /**
4454
4552
  * Optional URL to navigate to when clicked
4455
4553
  */
4456
- actionUrl: z23.string().optional().describe("Action URL"),
4554
+ actionUrl: z24.string().optional().describe("Action URL"),
4457
4555
  /**
4458
4556
  * Whether the notification can be dismissed by the user
4459
4557
  * @default true
4460
4558
  */
4461
- dismissible: z23.boolean().optional().default(true).describe("User dismissible"),
4559
+ dismissible: z24.boolean().optional().default(true).describe("User dismissible"),
4462
4560
  /**
4463
4561
  * Timestamp when notification expires (Unix milliseconds)
4464
4562
  */
4465
- expiresAt: z23.number().optional().describe("Expiration timestamp")
4563
+ expiresAt: z24.number().optional().describe("Expiration timestamp")
4466
4564
  });
4467
- var NotificationChannelSchema = z23.enum([
4565
+ var NotificationChannelSchema = z24.enum([
4468
4566
  "email",
4469
4567
  "sms",
4470
4568
  "push",
@@ -4473,15 +4571,15 @@ var NotificationChannelSchema = z23.enum([
4473
4571
  "teams",
4474
4572
  "webhook"
4475
4573
  ]);
4476
- var NotificationConfigSchema = z23.object({
4574
+ var NotificationConfigSchema = z24.object({
4477
4575
  /**
4478
4576
  * Unique identifier for this notification configuration
4479
4577
  */
4480
- id: z23.string().describe("Notification ID"),
4578
+ id: z24.string().describe("Notification ID"),
4481
4579
  /**
4482
4580
  * Human-readable name for this notification
4483
4581
  */
4484
- name: z23.string().describe("Notification name"),
4582
+ name: z24.string().describe("Notification name"),
4485
4583
  /**
4486
4584
  * Delivery channel for the notification
4487
4585
  */
@@ -4489,7 +4587,7 @@ var NotificationConfigSchema = z23.object({
4489
4587
  /**
4490
4588
  * Notification template based on channel type
4491
4589
  */
4492
- template: z23.union([
4590
+ template: z24.union([
4493
4591
  EmailTemplateSchema,
4494
4592
  SMSTemplateSchema,
4495
4593
  PushNotificationSchema,
@@ -4498,106 +4596,106 @@ var NotificationConfigSchema = z23.object({
4498
4596
  /**
4499
4597
  * Recipient configuration
4500
4598
  */
4501
- recipients: z23.object({
4599
+ recipients: z24.object({
4502
4600
  /**
4503
4601
  * Primary recipients
4504
4602
  */
4505
- to: z23.array(z23.string()).describe("Primary recipients"),
4603
+ to: z24.array(z24.string()).describe("Primary recipients"),
4506
4604
  /**
4507
4605
  * CC recipients (email only)
4508
4606
  */
4509
- cc: z23.array(z23.string()).optional().describe("CC recipients"),
4607
+ cc: z24.array(z24.string()).optional().describe("CC recipients"),
4510
4608
  /**
4511
4609
  * BCC recipients (email only)
4512
4610
  */
4513
- bcc: z23.array(z23.string()).optional().describe("BCC recipients")
4611
+ bcc: z24.array(z24.string()).optional().describe("BCC recipients")
4514
4612
  }).describe("Recipients"),
4515
4613
  /**
4516
4614
  * Scheduling configuration
4517
4615
  */
4518
- schedule: z23.object({
4616
+ schedule: z24.object({
4519
4617
  /**
4520
4618
  * Scheduling type
4521
4619
  */
4522
- type: z23.enum(["immediate", "delayed", "scheduled"]).describe("Schedule type"),
4620
+ type: z24.enum(["immediate", "delayed", "scheduled"]).describe("Schedule type"),
4523
4621
  /**
4524
4622
  * Delay in milliseconds (for delayed type)
4525
4623
  */
4526
- delay: z23.number().optional().describe("Delay in milliseconds"),
4624
+ delay: z24.number().optional().describe("Delay in milliseconds"),
4527
4625
  /**
4528
4626
  * Scheduled send time (Unix timestamp in milliseconds)
4529
4627
  */
4530
- scheduledAt: z23.number().optional().describe("Scheduled timestamp")
4628
+ scheduledAt: z24.number().optional().describe("Scheduled timestamp")
4531
4629
  }).optional().describe("Scheduling"),
4532
4630
  /**
4533
4631
  * Retry policy for failed deliveries
4534
4632
  */
4535
- retryPolicy: z23.object({
4633
+ retryPolicy: z24.object({
4536
4634
  /**
4537
4635
  * Enable automatic retries
4538
4636
  * @default true
4539
4637
  */
4540
- enabled: z23.boolean().optional().default(true).describe("Enable retries"),
4638
+ enabled: z24.boolean().optional().default(true).describe("Enable retries"),
4541
4639
  /**
4542
4640
  * Maximum number of retry attempts
4543
4641
  * @default 3
4544
4642
  */
4545
- maxRetries: z23.number().optional().default(3).describe("Max retry attempts"),
4643
+ maxRetries: z24.number().optional().default(3).describe("Max retry attempts"),
4546
4644
  /**
4547
4645
  * Backoff strategy for retries
4548
4646
  */
4549
- backoffStrategy: z23.enum(["exponential", "linear", "fixed"]).describe("Backoff strategy")
4647
+ backoffStrategy: z24.enum(["exponential", "linear", "fixed"]).describe("Backoff strategy")
4550
4648
  }).optional().describe("Retry policy"),
4551
4649
  /**
4552
4650
  * Delivery tracking configuration
4553
4651
  */
4554
- tracking: z23.object({
4652
+ tracking: z24.object({
4555
4653
  /**
4556
4654
  * Track when emails are opened
4557
4655
  * @default false
4558
4656
  */
4559
- trackOpens: z23.boolean().optional().default(false).describe("Track opens"),
4657
+ trackOpens: z24.boolean().optional().default(false).describe("Track opens"),
4560
4658
  /**
4561
4659
  * Track when links are clicked
4562
4660
  * @default false
4563
4661
  */
4564
- trackClicks: z23.boolean().optional().default(false).describe("Track clicks"),
4662
+ trackClicks: z24.boolean().optional().default(false).describe("Track clicks"),
4565
4663
  /**
4566
4664
  * Track delivery status
4567
4665
  * @default true
4568
4666
  */
4569
- trackDelivery: z23.boolean().optional().default(true).describe("Track delivery")
4667
+ trackDelivery: z24.boolean().optional().default(true).describe("Track delivery")
4570
4668
  }).optional().describe("Tracking configuration")
4571
4669
  });
4572
4670
 
4573
4671
  // src/system/translation.zod.ts
4574
- import { z as z24 } from "zod";
4575
- var TranslationDataSchema = z24.object({
4672
+ import { z as z25 } from "zod";
4673
+ var TranslationDataSchema = z25.object({
4576
4674
  /** Object translations */
4577
- objects: z24.record(z24.string(), z24.object({
4578
- label: z24.string(),
4579
- pluralLabel: z24.string().optional(),
4580
- fields: z24.record(z24.string(), z24.object({
4581
- label: z24.string().optional(),
4582
- help: z24.string().optional(),
4583
- options: z24.record(z24.string(), z24.string()).optional()
4675
+ objects: z25.record(z25.string(), z25.object({
4676
+ label: z25.string(),
4677
+ pluralLabel: z25.string().optional(),
4678
+ fields: z25.record(z25.string(), z25.object({
4679
+ label: z25.string().optional(),
4680
+ help: z25.string().optional(),
4681
+ options: z25.record(z25.string(), z25.string()).optional()
4584
4682
  // Option value -> Label map
4585
4683
  })).optional()
4586
4684
  })).optional(),
4587
4685
  /** App/Menu translations */
4588
- apps: z24.record(z24.string(), z24.object({
4589
- label: z24.string(),
4590
- description: z24.string().optional()
4686
+ apps: z25.record(z25.string(), z25.object({
4687
+ label: z25.string(),
4688
+ description: z25.string().optional()
4591
4689
  })).optional(),
4592
4690
  /** UI Messages */
4593
- messages: z24.record(z24.string(), z24.string()).optional()
4691
+ messages: z25.record(z25.string(), z25.string()).optional()
4594
4692
  });
4595
- var LocaleSchema = z24.string().describe("BCP-47 Language Tag (e.g. en-US, zh-CN)");
4596
- var TranslationBundleSchema = z24.record(LocaleSchema, TranslationDataSchema);
4693
+ var LocaleSchema = z25.string().describe("BCP-47 Language Tag (e.g. en-US, zh-CN)");
4694
+ var TranslationBundleSchema = z25.record(LocaleSchema, TranslationDataSchema);
4597
4695
 
4598
4696
  // src/system/collaboration.zod.ts
4599
- import { z as z25 } from "zod";
4600
- var OTOperationType = z25.enum([
4697
+ import { z as z26 } from "zod";
4698
+ var OTOperationType = z26.enum([
4601
4699
  "insert",
4602
4700
  // Insert characters at position
4603
4701
  "delete",
@@ -4605,38 +4703,38 @@ var OTOperationType = z25.enum([
4605
4703
  "retain"
4606
4704
  // Keep characters (used for composing operations)
4607
4705
  ]);
4608
- var OTComponentSchema = z25.discriminatedUnion("type", [
4609
- z25.object({
4610
- type: z25.literal("insert"),
4611
- text: z25.string().describe("Text to insert"),
4612
- attributes: z25.record(z25.string(), z25.any()).optional().describe("Text formatting attributes (e.g., bold, italic)")
4706
+ var OTComponentSchema = z26.discriminatedUnion("type", [
4707
+ z26.object({
4708
+ type: z26.literal("insert"),
4709
+ text: z26.string().describe("Text to insert"),
4710
+ attributes: z26.record(z26.string(), z26.any()).optional().describe("Text formatting attributes (e.g., bold, italic)")
4613
4711
  }),
4614
- z25.object({
4615
- type: z25.literal("delete"),
4616
- count: z25.number().int().positive().describe("Number of characters to delete")
4712
+ z26.object({
4713
+ type: z26.literal("delete"),
4714
+ count: z26.number().int().positive().describe("Number of characters to delete")
4617
4715
  }),
4618
- z25.object({
4619
- type: z25.literal("retain"),
4620
- count: z25.number().int().positive().describe("Number of characters to retain"),
4621
- attributes: z25.record(z25.string(), z25.any()).optional().describe("Attribute changes to apply")
4716
+ z26.object({
4717
+ type: z26.literal("retain"),
4718
+ count: z26.number().int().positive().describe("Number of characters to retain"),
4719
+ attributes: z26.record(z26.string(), z26.any()).optional().describe("Attribute changes to apply")
4622
4720
  })
4623
4721
  ]);
4624
- var OTOperationSchema = z25.object({
4625
- operationId: z25.string().uuid().describe("Unique operation identifier"),
4626
- documentId: z25.string().describe("Document identifier"),
4627
- userId: z25.string().describe("User who created the operation"),
4628
- sessionId: z25.string().uuid().describe("Session identifier"),
4629
- components: z25.array(OTComponentSchema).describe("Operation components"),
4630
- baseVersion: z25.number().int().nonnegative().describe("Document version this operation is based on"),
4631
- timestamp: z25.string().datetime().describe("ISO 8601 datetime when operation was created"),
4632
- metadata: z25.record(z25.string(), z25.any()).optional().describe("Additional operation metadata")
4633
- });
4634
- var OTTransformResultSchema = z25.object({
4722
+ var OTOperationSchema = z26.object({
4723
+ operationId: z26.string().uuid().describe("Unique operation identifier"),
4724
+ documentId: z26.string().describe("Document identifier"),
4725
+ userId: z26.string().describe("User who created the operation"),
4726
+ sessionId: z26.string().uuid().describe("Session identifier"),
4727
+ components: z26.array(OTComponentSchema).describe("Operation components"),
4728
+ baseVersion: z26.number().int().nonnegative().describe("Document version this operation is based on"),
4729
+ timestamp: z26.string().datetime().describe("ISO 8601 datetime when operation was created"),
4730
+ metadata: z26.record(z26.string(), z26.any()).optional().describe("Additional operation metadata")
4731
+ });
4732
+ var OTTransformResultSchema = z26.object({
4635
4733
  operation: OTOperationSchema.describe("Transformed operation"),
4636
- transformed: z25.boolean().describe("Whether transformation was applied"),
4637
- conflicts: z25.array(z25.string()).optional().describe("Conflict descriptions if any")
4734
+ transformed: z26.boolean().describe("Whether transformation was applied"),
4735
+ conflicts: z26.array(z26.string()).optional().describe("Conflict descriptions if any")
4638
4736
  });
4639
- var CRDTType = z25.enum([
4737
+ var CRDTType = z26.enum([
4640
4738
  "lww-register",
4641
4739
  // Last-Write-Wins Register
4642
4740
  "g-counter",
@@ -4656,74 +4754,74 @@ var CRDTType = z25.enum([
4656
4754
  "json"
4657
4755
  // CRDT-based JSON (e.g., Automerge)
4658
4756
  ]);
4659
- var VectorClockSchema = z25.object({
4660
- clock: z25.record(z25.string(), z25.number().int().nonnegative()).describe("Map of replica ID to logical timestamp")
4661
- });
4662
- var LWWRegisterSchema = z25.object({
4663
- type: z25.literal("lww-register"),
4664
- value: z25.any().describe("Current register value"),
4665
- timestamp: z25.string().datetime().describe("ISO 8601 datetime of last write"),
4666
- replicaId: z25.string().describe("ID of replica that performed last write"),
4757
+ var VectorClockSchema = z26.object({
4758
+ clock: z26.record(z26.string(), z26.number().int().nonnegative()).describe("Map of replica ID to logical timestamp")
4759
+ });
4760
+ var LWWRegisterSchema = z26.object({
4761
+ type: z26.literal("lww-register"),
4762
+ value: z26.any().describe("Current register value"),
4763
+ timestamp: z26.string().datetime().describe("ISO 8601 datetime of last write"),
4764
+ replicaId: z26.string().describe("ID of replica that performed last write"),
4667
4765
  vectorClock: VectorClockSchema.optional().describe("Optional vector clock for causality tracking")
4668
4766
  });
4669
- var CounterOperationSchema = z25.object({
4670
- replicaId: z25.string().describe("Replica identifier"),
4671
- delta: z25.number().int().describe("Change amount (positive for increment, negative for decrement)"),
4672
- timestamp: z25.string().datetime().describe("ISO 8601 datetime of operation")
4673
- });
4674
- var GCounterSchema = z25.object({
4675
- type: z25.literal("g-counter"),
4676
- counts: z25.record(z25.string(), z25.number().int().nonnegative()).describe("Map of replica ID to count")
4677
- });
4678
- var PNCounterSchema = z25.object({
4679
- type: z25.literal("pn-counter"),
4680
- positive: z25.record(z25.string(), z25.number().int().nonnegative()).describe("Positive increments per replica"),
4681
- negative: z25.record(z25.string(), z25.number().int().nonnegative()).describe("Negative increments per replica")
4682
- });
4683
- var ORSetElementSchema = z25.object({
4684
- value: z25.any().describe("Element value"),
4685
- timestamp: z25.string().datetime().describe("Addition timestamp"),
4686
- replicaId: z25.string().describe("Replica that added the element"),
4687
- uid: z25.string().uuid().describe("Unique identifier for this addition"),
4688
- removed: z25.boolean().optional().default(false).describe("Whether element has been removed")
4689
- });
4690
- var ORSetSchema = z25.object({
4691
- type: z25.literal("or-set"),
4692
- elements: z25.array(ORSetElementSchema).describe("Set elements with metadata")
4693
- });
4694
- var TextCRDTOperationSchema = z25.object({
4695
- operationId: z25.string().uuid().describe("Unique operation identifier"),
4696
- replicaId: z25.string().describe("Replica identifier"),
4697
- position: z25.number().int().nonnegative().describe("Position in document"),
4698
- insert: z25.string().optional().describe("Text to insert"),
4699
- delete: z25.number().int().positive().optional().describe("Number of characters to delete"),
4700
- timestamp: z25.string().datetime().describe("ISO 8601 datetime of operation"),
4701
- lamportTimestamp: z25.number().int().nonnegative().describe("Lamport timestamp for ordering")
4702
- });
4703
- var TextCRDTStateSchema = z25.object({
4704
- type: z25.literal("text"),
4705
- documentId: z25.string().describe("Document identifier"),
4706
- content: z25.string().describe("Current text content"),
4707
- operations: z25.array(TextCRDTOperationSchema).describe("History of operations"),
4708
- lamportClock: z25.number().int().nonnegative().describe("Current Lamport clock value"),
4767
+ var CounterOperationSchema = z26.object({
4768
+ replicaId: z26.string().describe("Replica identifier"),
4769
+ delta: z26.number().int().describe("Change amount (positive for increment, negative for decrement)"),
4770
+ timestamp: z26.string().datetime().describe("ISO 8601 datetime of operation")
4771
+ });
4772
+ var GCounterSchema = z26.object({
4773
+ type: z26.literal("g-counter"),
4774
+ counts: z26.record(z26.string(), z26.number().int().nonnegative()).describe("Map of replica ID to count")
4775
+ });
4776
+ var PNCounterSchema = z26.object({
4777
+ type: z26.literal("pn-counter"),
4778
+ positive: z26.record(z26.string(), z26.number().int().nonnegative()).describe("Positive increments per replica"),
4779
+ negative: z26.record(z26.string(), z26.number().int().nonnegative()).describe("Negative increments per replica")
4780
+ });
4781
+ var ORSetElementSchema = z26.object({
4782
+ value: z26.any().describe("Element value"),
4783
+ timestamp: z26.string().datetime().describe("Addition timestamp"),
4784
+ replicaId: z26.string().describe("Replica that added the element"),
4785
+ uid: z26.string().uuid().describe("Unique identifier for this addition"),
4786
+ removed: z26.boolean().optional().default(false).describe("Whether element has been removed")
4787
+ });
4788
+ var ORSetSchema = z26.object({
4789
+ type: z26.literal("or-set"),
4790
+ elements: z26.array(ORSetElementSchema).describe("Set elements with metadata")
4791
+ });
4792
+ var TextCRDTOperationSchema = z26.object({
4793
+ operationId: z26.string().uuid().describe("Unique operation identifier"),
4794
+ replicaId: z26.string().describe("Replica identifier"),
4795
+ position: z26.number().int().nonnegative().describe("Position in document"),
4796
+ insert: z26.string().optional().describe("Text to insert"),
4797
+ delete: z26.number().int().positive().optional().describe("Number of characters to delete"),
4798
+ timestamp: z26.string().datetime().describe("ISO 8601 datetime of operation"),
4799
+ lamportTimestamp: z26.number().int().nonnegative().describe("Lamport timestamp for ordering")
4800
+ });
4801
+ var TextCRDTStateSchema = z26.object({
4802
+ type: z26.literal("text"),
4803
+ documentId: z26.string().describe("Document identifier"),
4804
+ content: z26.string().describe("Current text content"),
4805
+ operations: z26.array(TextCRDTOperationSchema).describe("History of operations"),
4806
+ lamportClock: z26.number().int().nonnegative().describe("Current Lamport clock value"),
4709
4807
  vectorClock: VectorClockSchema.describe("Vector clock for causality")
4710
4808
  });
4711
- var CRDTStateSchema = z25.discriminatedUnion("type", [
4809
+ var CRDTStateSchema = z26.discriminatedUnion("type", [
4712
4810
  LWWRegisterSchema,
4713
4811
  GCounterSchema,
4714
4812
  PNCounterSchema,
4715
4813
  ORSetSchema,
4716
4814
  TextCRDTStateSchema
4717
4815
  ]);
4718
- var CRDTMergeResultSchema = z25.object({
4816
+ var CRDTMergeResultSchema = z26.object({
4719
4817
  state: CRDTStateSchema.describe("Merged CRDT state"),
4720
- conflicts: z25.array(z25.object({
4721
- type: z25.string().describe("Conflict type"),
4722
- description: z25.string().describe("Conflict description"),
4723
- resolved: z25.boolean().describe("Whether conflict was automatically resolved")
4818
+ conflicts: z26.array(z26.object({
4819
+ type: z26.string().describe("Conflict type"),
4820
+ description: z26.string().describe("Conflict description"),
4821
+ resolved: z26.boolean().describe("Whether conflict was automatically resolved")
4724
4822
  })).optional().describe("Conflicts encountered during merge")
4725
4823
  });
4726
- var CursorColorPreset = z25.enum([
4824
+ var CursorColorPreset = z26.enum([
4727
4825
  "blue",
4728
4826
  "green",
4729
4827
  "red",
@@ -4735,49 +4833,49 @@ var CursorColorPreset = z25.enum([
4735
4833
  "indigo",
4736
4834
  "cyan"
4737
4835
  ]);
4738
- var CursorStyleSchema = z25.object({
4739
- color: z25.union([CursorColorPreset, z25.string()]).describe("Cursor color (preset or custom hex)"),
4740
- opacity: z25.number().min(0).max(1).optional().default(1).describe("Cursor opacity (0-1)"),
4741
- label: z25.string().optional().describe("Label to display with cursor (usually username)"),
4742
- showLabel: z25.boolean().optional().default(true).describe("Whether to show label"),
4743
- pulseOnUpdate: z25.boolean().optional().default(true).describe("Whether to pulse when cursor moves")
4744
- });
4745
- var CursorSelectionSchema = z25.object({
4746
- anchor: z25.object({
4747
- line: z25.number().int().nonnegative().describe("Anchor line number"),
4748
- column: z25.number().int().nonnegative().describe("Anchor column number")
4836
+ var CursorStyleSchema = z26.object({
4837
+ color: z26.union([CursorColorPreset, z26.string()]).describe("Cursor color (preset or custom hex)"),
4838
+ opacity: z26.number().min(0).max(1).optional().default(1).describe("Cursor opacity (0-1)"),
4839
+ label: z26.string().optional().describe("Label to display with cursor (usually username)"),
4840
+ showLabel: z26.boolean().optional().default(true).describe("Whether to show label"),
4841
+ pulseOnUpdate: z26.boolean().optional().default(true).describe("Whether to pulse when cursor moves")
4842
+ });
4843
+ var CursorSelectionSchema = z26.object({
4844
+ anchor: z26.object({
4845
+ line: z26.number().int().nonnegative().describe("Anchor line number"),
4846
+ column: z26.number().int().nonnegative().describe("Anchor column number")
4749
4847
  }).describe("Selection anchor (start point)"),
4750
- focus: z25.object({
4751
- line: z25.number().int().nonnegative().describe("Focus line number"),
4752
- column: z25.number().int().nonnegative().describe("Focus column number")
4848
+ focus: z26.object({
4849
+ line: z26.number().int().nonnegative().describe("Focus line number"),
4850
+ column: z26.number().int().nonnegative().describe("Focus column number")
4753
4851
  }).describe("Selection focus (end point)"),
4754
- direction: z25.enum(["forward", "backward"]).optional().describe("Selection direction")
4755
- });
4756
- var CollaborativeCursorSchema = z25.object({
4757
- userId: z25.string().describe("User identifier"),
4758
- sessionId: z25.string().uuid().describe("Session identifier"),
4759
- documentId: z25.string().describe("Document identifier"),
4760
- userName: z25.string().describe("Display name of user"),
4761
- position: z25.object({
4762
- line: z25.number().int().nonnegative().describe("Cursor line number (0-indexed)"),
4763
- column: z25.number().int().nonnegative().describe("Cursor column number (0-indexed)")
4852
+ direction: z26.enum(["forward", "backward"]).optional().describe("Selection direction")
4853
+ });
4854
+ var CollaborativeCursorSchema = z26.object({
4855
+ userId: z26.string().describe("User identifier"),
4856
+ sessionId: z26.string().uuid().describe("Session identifier"),
4857
+ documentId: z26.string().describe("Document identifier"),
4858
+ userName: z26.string().describe("Display name of user"),
4859
+ position: z26.object({
4860
+ line: z26.number().int().nonnegative().describe("Cursor line number (0-indexed)"),
4861
+ column: z26.number().int().nonnegative().describe("Cursor column number (0-indexed)")
4764
4862
  }).describe("Current cursor position"),
4765
4863
  selection: CursorSelectionSchema.optional().describe("Current text selection"),
4766
4864
  style: CursorStyleSchema.describe("Visual style for this cursor"),
4767
- isTyping: z25.boolean().optional().default(false).describe("Whether user is currently typing"),
4768
- lastUpdate: z25.string().datetime().describe("ISO 8601 datetime of last cursor update"),
4769
- metadata: z25.record(z25.string(), z25.any()).optional().describe("Additional cursor metadata")
4770
- });
4771
- var CursorUpdateSchema = z25.object({
4772
- position: z25.object({
4773
- line: z25.number().int().nonnegative(),
4774
- column: z25.number().int().nonnegative()
4865
+ isTyping: z26.boolean().optional().default(false).describe("Whether user is currently typing"),
4866
+ lastUpdate: z26.string().datetime().describe("ISO 8601 datetime of last cursor update"),
4867
+ metadata: z26.record(z26.string(), z26.any()).optional().describe("Additional cursor metadata")
4868
+ });
4869
+ var CursorUpdateSchema = z26.object({
4870
+ position: z26.object({
4871
+ line: z26.number().int().nonnegative(),
4872
+ column: z26.number().int().nonnegative()
4775
4873
  }).optional().describe("Updated cursor position"),
4776
4874
  selection: CursorSelectionSchema.optional().describe("Updated selection"),
4777
- isTyping: z25.boolean().optional().describe("Updated typing state"),
4778
- metadata: z25.record(z25.string(), z25.any()).optional().describe("Updated metadata")
4875
+ isTyping: z26.boolean().optional().describe("Updated typing state"),
4876
+ metadata: z26.record(z26.string(), z26.any()).optional().describe("Updated metadata")
4779
4877
  });
4780
- var UserActivityStatus = z25.enum([
4878
+ var UserActivityStatus = z26.enum([
4781
4879
  "active",
4782
4880
  // User is actively editing
4783
4881
  "idle",
@@ -4787,48 +4885,48 @@ var UserActivityStatus = z25.enum([
4787
4885
  "disconnected"
4788
4886
  // User is disconnected
4789
4887
  ]);
4790
- var AwarenessUserStateSchema = z25.object({
4791
- userId: z25.string().describe("User identifier"),
4792
- sessionId: z25.string().uuid().describe("Session identifier"),
4793
- userName: z25.string().describe("Display name"),
4794
- userAvatar: z25.string().optional().describe("User avatar URL"),
4888
+ var AwarenessUserStateSchema = z26.object({
4889
+ userId: z26.string().describe("User identifier"),
4890
+ sessionId: z26.string().uuid().describe("Session identifier"),
4891
+ userName: z26.string().describe("Display name"),
4892
+ userAvatar: z26.string().optional().describe("User avatar URL"),
4795
4893
  status: UserActivityStatus.describe("Current activity status"),
4796
- currentDocument: z25.string().optional().describe("Document ID user is currently editing"),
4797
- currentView: z25.string().optional().describe("Current view/page user is on"),
4798
- lastActivity: z25.string().datetime().describe("ISO 8601 datetime of last activity"),
4799
- joinedAt: z25.string().datetime().describe("ISO 8601 datetime when user joined session"),
4800
- permissions: z25.array(z25.string()).optional().describe("User permissions in this session"),
4801
- metadata: z25.record(z25.string(), z25.any()).optional().describe("Additional user state metadata")
4802
- });
4803
- var AwarenessSessionSchema = z25.object({
4804
- sessionId: z25.string().uuid().describe("Session identifier"),
4805
- documentId: z25.string().optional().describe("Document ID this session is for"),
4806
- users: z25.array(AwarenessUserStateSchema).describe("Active users in session"),
4807
- startedAt: z25.string().datetime().describe("ISO 8601 datetime when session started"),
4808
- lastUpdate: z25.string().datetime().describe("ISO 8601 datetime of last update"),
4809
- metadata: z25.record(z25.string(), z25.any()).optional().describe("Session metadata")
4810
- });
4811
- var AwarenessUpdateSchema = z25.object({
4894
+ currentDocument: z26.string().optional().describe("Document ID user is currently editing"),
4895
+ currentView: z26.string().optional().describe("Current view/page user is on"),
4896
+ lastActivity: z26.string().datetime().describe("ISO 8601 datetime of last activity"),
4897
+ joinedAt: z26.string().datetime().describe("ISO 8601 datetime when user joined session"),
4898
+ permissions: z26.array(z26.string()).optional().describe("User permissions in this session"),
4899
+ metadata: z26.record(z26.string(), z26.any()).optional().describe("Additional user state metadata")
4900
+ });
4901
+ var AwarenessSessionSchema = z26.object({
4902
+ sessionId: z26.string().uuid().describe("Session identifier"),
4903
+ documentId: z26.string().optional().describe("Document ID this session is for"),
4904
+ users: z26.array(AwarenessUserStateSchema).describe("Active users in session"),
4905
+ startedAt: z26.string().datetime().describe("ISO 8601 datetime when session started"),
4906
+ lastUpdate: z26.string().datetime().describe("ISO 8601 datetime of last update"),
4907
+ metadata: z26.record(z26.string(), z26.any()).optional().describe("Session metadata")
4908
+ });
4909
+ var AwarenessUpdateSchema = z26.object({
4812
4910
  status: UserActivityStatus.optional().describe("Updated status"),
4813
- currentDocument: z25.string().optional().describe("Updated current document"),
4814
- currentView: z25.string().optional().describe("Updated current view"),
4815
- metadata: z25.record(z25.string(), z25.any()).optional().describe("Updated metadata")
4816
- });
4817
- var AwarenessEventSchema = z25.object({
4818
- eventId: z25.string().uuid().describe("Event identifier"),
4819
- sessionId: z25.string().uuid().describe("Session identifier"),
4820
- eventType: z25.enum([
4911
+ currentDocument: z26.string().optional().describe("Updated current document"),
4912
+ currentView: z26.string().optional().describe("Updated current view"),
4913
+ metadata: z26.record(z26.string(), z26.any()).optional().describe("Updated metadata")
4914
+ });
4915
+ var AwarenessEventSchema = z26.object({
4916
+ eventId: z26.string().uuid().describe("Event identifier"),
4917
+ sessionId: z26.string().uuid().describe("Session identifier"),
4918
+ eventType: z26.enum([
4821
4919
  "user.joined",
4822
4920
  "user.left",
4823
4921
  "user.updated",
4824
4922
  "session.created",
4825
4923
  "session.ended"
4826
4924
  ]).describe("Type of awareness event"),
4827
- userId: z25.string().optional().describe("User involved in event"),
4828
- timestamp: z25.string().datetime().describe("ISO 8601 datetime of event"),
4829
- payload: z25.any().describe("Event payload")
4925
+ userId: z26.string().optional().describe("User involved in event"),
4926
+ timestamp: z26.string().datetime().describe("ISO 8601 datetime of event"),
4927
+ payload: z26.any().describe("Event payload")
4830
4928
  });
4831
- var CollaborationMode = z25.enum([
4929
+ var CollaborationMode = z26.enum([
4832
4930
  "ot",
4833
4931
  // Operational Transformation
4834
4932
  "crdt",
@@ -4838,36 +4936,36 @@ var CollaborationMode = z25.enum([
4838
4936
  "hybrid"
4839
4937
  // Hybrid approach
4840
4938
  ]);
4841
- var CollaborationSessionConfigSchema = z25.object({
4939
+ var CollaborationSessionConfigSchema = z26.object({
4842
4940
  mode: CollaborationMode.describe("Collaboration mode to use"),
4843
- enableCursorSharing: z25.boolean().optional().default(true).describe("Enable cursor sharing"),
4844
- enablePresence: z25.boolean().optional().default(true).describe("Enable presence tracking"),
4845
- enableAwareness: z25.boolean().optional().default(true).describe("Enable awareness state"),
4846
- maxUsers: z25.number().int().positive().optional().describe("Maximum concurrent users"),
4847
- idleTimeout: z25.number().int().positive().optional().default(3e5).describe("Idle timeout in milliseconds"),
4848
- conflictResolution: z25.enum(["ot", "crdt", "manual"]).optional().default("ot").describe("Conflict resolution strategy"),
4849
- persistence: z25.boolean().optional().default(true).describe("Enable operation persistence"),
4850
- snapshot: z25.object({
4851
- enabled: z25.boolean().describe("Enable periodic snapshots"),
4852
- interval: z25.number().int().positive().describe("Snapshot interval in milliseconds")
4941
+ enableCursorSharing: z26.boolean().optional().default(true).describe("Enable cursor sharing"),
4942
+ enablePresence: z26.boolean().optional().default(true).describe("Enable presence tracking"),
4943
+ enableAwareness: z26.boolean().optional().default(true).describe("Enable awareness state"),
4944
+ maxUsers: z26.number().int().positive().optional().describe("Maximum concurrent users"),
4945
+ idleTimeout: z26.number().int().positive().optional().default(3e5).describe("Idle timeout in milliseconds"),
4946
+ conflictResolution: z26.enum(["ot", "crdt", "manual"]).optional().default("ot").describe("Conflict resolution strategy"),
4947
+ persistence: z26.boolean().optional().default(true).describe("Enable operation persistence"),
4948
+ snapshot: z26.object({
4949
+ enabled: z26.boolean().describe("Enable periodic snapshots"),
4950
+ interval: z26.number().int().positive().describe("Snapshot interval in milliseconds")
4853
4951
  }).optional().describe("Snapshot configuration")
4854
4952
  });
4855
- var CollaborationSessionSchema = z25.object({
4856
- sessionId: z25.string().uuid().describe("Session identifier"),
4857
- documentId: z25.string().describe("Document identifier"),
4953
+ var CollaborationSessionSchema = z26.object({
4954
+ sessionId: z26.string().uuid().describe("Session identifier"),
4955
+ documentId: z26.string().describe("Document identifier"),
4858
4956
  config: CollaborationSessionConfigSchema.describe("Session configuration"),
4859
- users: z25.array(AwarenessUserStateSchema).describe("Active users"),
4860
- cursors: z25.array(CollaborativeCursorSchema).describe("Active cursors"),
4861
- version: z25.number().int().nonnegative().describe("Current document version"),
4862
- operations: z25.array(z25.union([OTOperationSchema, TextCRDTOperationSchema])).optional().describe("Recent operations"),
4863
- createdAt: z25.string().datetime().describe("ISO 8601 datetime when session was created"),
4864
- lastActivity: z25.string().datetime().describe("ISO 8601 datetime of last activity"),
4865
- status: z25.enum(["active", "idle", "ended"]).describe("Session status")
4957
+ users: z26.array(AwarenessUserStateSchema).describe("Active users"),
4958
+ cursors: z26.array(CollaborativeCursorSchema).describe("Active cursors"),
4959
+ version: z26.number().int().nonnegative().describe("Current document version"),
4960
+ operations: z26.array(z26.union([OTOperationSchema, TextCRDTOperationSchema])).optional().describe("Recent operations"),
4961
+ createdAt: z26.string().datetime().describe("ISO 8601 datetime when session was created"),
4962
+ lastActivity: z26.string().datetime().describe("ISO 8601 datetime of last activity"),
4963
+ status: z26.enum(["active", "idle", "ended"]).describe("Session status")
4866
4964
  });
4867
4965
 
4868
4966
  // src/system/metadata-persistence.zod.ts
4869
- import { z as z26 } from "zod";
4870
- var MetadataScopeSchema = z26.enum([
4967
+ import { z as z27 } from "zod";
4968
+ var MetadataScopeSchema = z27.enum([
4871
4969
  "system",
4872
4970
  // Defined in Code (Files). Read-only at runtime. Upgraded via deployment.
4873
4971
  "platform",
@@ -4875,7 +4973,7 @@ var MetadataScopeSchema = z26.enum([
4875
4973
  "user"
4876
4974
  // Defined in DB (Personal). User-configured. Overrides platform/system.
4877
4975
  ]);
4878
- var MetadataStateSchema = z26.enum([
4976
+ var MetadataStateSchema = z27.enum([
4879
4977
  "draft",
4880
4978
  // Work in progress, not active
4881
4979
  "active",
@@ -4885,24 +4983,24 @@ var MetadataStateSchema = z26.enum([
4885
4983
  "deprecated"
4886
4984
  // Running but flagged for removal
4887
4985
  ]);
4888
- var MetadataRecordSchema = z26.object({
4986
+ var MetadataRecordSchema = z27.object({
4889
4987
  /** Primary Key (UUID) */
4890
- _id: z26.string(),
4988
+ _id: z27.string(),
4891
4989
  /**
4892
4990
  * Machine Name
4893
4991
  * The unique identifier used in code references (e.g. "account_list_view").
4894
4992
  */
4895
- name: z26.string(),
4993
+ name: z27.string(),
4896
4994
  /**
4897
4995
  * Metadata Type
4898
4996
  * e.g. "object", "view", "permission_set", "flow"
4899
4997
  */
4900
- type: z26.string(),
4998
+ type: z27.string(),
4901
4999
  /**
4902
5000
  * Namespace / Module
4903
5001
  * Groups metadata into packages (e.g. "crm", "finance", "core").
4904
5002
  */
4905
- namespace: z26.string().default("default"),
5003
+ namespace: z27.string().default("default"),
4906
5004
  /**
4907
5005
  * Ownership differentiation
4908
5006
  */
@@ -4912,24 +5010,24 @@ var MetadataRecordSchema = z26.object({
4912
5010
  * Stores the actual configuration JSON.
4913
5011
  * This field holds the value of `ViewSchema`, `ObjectSchema`, etc.
4914
5012
  */
4915
- metadata: z26.record(z26.string(), z26.any()),
5013
+ metadata: z27.record(z27.string(), z27.any()),
4916
5014
  /**
4917
5015
  * Extension / Merge Strategy
4918
5016
  * If this record overrides a system record, how should it be applied?
4919
5017
  */
4920
- extends: z26.string().optional().describe("Name of the parent metadata to extend/override"),
4921
- strategy: z26.enum(["merge", "replace"]).default("merge"),
5018
+ extends: z27.string().optional().describe("Name of the parent metadata to extend/override"),
5019
+ strategy: z27.enum(["merge", "replace"]).default("merge"),
4922
5020
  /** Owner (for user-scope items) */
4923
- owner: z26.string().optional(),
5021
+ owner: z27.string().optional(),
4924
5022
  /** State */
4925
5023
  state: MetadataStateSchema.default("active"),
4926
5024
  /** Audit */
4927
- created_by: z26.string().optional(),
4928
- created_at: z26.date().optional(),
4929
- updated_by: z26.string().optional(),
4930
- updated_at: z26.date().optional()
5025
+ created_by: z27.string().optional(),
5026
+ created_at: z27.date().optional(),
5027
+ updated_by: z27.string().optional(),
5028
+ updated_at: z27.date().optional()
4931
5029
  });
4932
- var MetadataFormatSchema = z26.enum([
5030
+ var MetadataFormatSchema = z27.enum([
4933
5031
  "json",
4934
5032
  "yaml",
4935
5033
  "yml",
@@ -4939,120 +5037,120 @@ var MetadataFormatSchema = z26.enum([
4939
5037
  "javascript"
4940
5038
  // Aliases
4941
5039
  ]);
4942
- var MetadataStatsSchema = z26.object({
4943
- path: z26.string().optional(),
4944
- size: z26.number().optional(),
4945
- mtime: z26.date().optional(),
4946
- hash: z26.string().optional(),
4947
- etag: z26.string().optional(),
5040
+ var MetadataStatsSchema = z27.object({
5041
+ path: z27.string().optional(),
5042
+ size: z27.number().optional(),
5043
+ mtime: z27.date().optional(),
5044
+ hash: z27.string().optional(),
5045
+ etag: z27.string().optional(),
4948
5046
  // Required by local cache
4949
- modifiedAt: z26.date().optional(),
5047
+ modifiedAt: z27.date().optional(),
4950
5048
  // Alias for mtime
4951
5049
  format: MetadataFormatSchema.optional()
4952
5050
  // Required for serialization
4953
5051
  });
4954
- var MetadataLoaderContractSchema = z26.object({
4955
- name: z26.string(),
4956
- protocol: z26.string(),
5052
+ var MetadataLoaderContractSchema = z27.object({
5053
+ name: z27.string(),
5054
+ protocol: z27.string(),
4957
5055
  // e.g. 'file:', 'http:', 's3:'
4958
- description: z26.string().optional(),
4959
- supportedFormats: z26.array(z26.string()).optional(),
4960
- supportsWatch: z26.boolean().optional(),
4961
- supportsWrite: z26.boolean().optional(),
4962
- supportsCache: z26.boolean().optional(),
4963
- capabilities: z26.object({
4964
- read: z26.boolean().default(true),
4965
- write: z26.boolean().default(false),
4966
- watch: z26.boolean().default(false),
4967
- list: z26.boolean().default(true)
5056
+ description: z27.string().optional(),
5057
+ supportedFormats: z27.array(z27.string()).optional(),
5058
+ supportsWatch: z27.boolean().optional(),
5059
+ supportsWrite: z27.boolean().optional(),
5060
+ supportsCache: z27.boolean().optional(),
5061
+ capabilities: z27.object({
5062
+ read: z27.boolean().default(true),
5063
+ write: z27.boolean().default(false),
5064
+ watch: z27.boolean().default(false),
5065
+ list: z27.boolean().default(true)
4968
5066
  })
4969
5067
  });
4970
- var MetadataLoadOptionsSchema = z26.object({
5068
+ var MetadataLoadOptionsSchema = z27.object({
4971
5069
  scope: MetadataScopeSchema.optional(),
4972
- namespace: z26.string().optional(),
4973
- raw: z26.boolean().optional().describe("Return raw file content instead of parsed JSON"),
4974
- cache: z26.boolean().optional(),
4975
- useCache: z26.boolean().optional(),
5070
+ namespace: z27.string().optional(),
5071
+ raw: z27.boolean().optional().describe("Return raw file content instead of parsed JSON"),
5072
+ cache: z27.boolean().optional(),
5073
+ useCache: z27.boolean().optional(),
4976
5074
  // Alias for cache
4977
- validate: z26.boolean().optional(),
4978
- ifNoneMatch: z26.string().optional(),
5075
+ validate: z27.boolean().optional(),
5076
+ ifNoneMatch: z27.string().optional(),
4979
5077
  // For caching
4980
- recursive: z26.boolean().optional(),
4981
- limit: z26.number().optional(),
4982
- patterns: z26.array(z26.string()).optional(),
4983
- loader: z26.string().optional().describe("Specific loader to use (e.g. filesystem, database)")
5078
+ recursive: z27.boolean().optional(),
5079
+ limit: z27.number().optional(),
5080
+ patterns: z27.array(z27.string()).optional(),
5081
+ loader: z27.string().optional().describe("Specific loader to use (e.g. filesystem, database)")
4984
5082
  });
4985
- var MetadataLoadResultSchema = z26.object({
4986
- data: z26.any(),
5083
+ var MetadataLoadResultSchema = z27.object({
5084
+ data: z27.any(),
4987
5085
  stats: MetadataStatsSchema.optional(),
4988
5086
  format: MetadataFormatSchema.optional(),
4989
- source: z26.string().optional(),
5087
+ source: z27.string().optional(),
4990
5088
  // File path or URL
4991
- fromCache: z26.boolean().optional(),
4992
- etag: z26.string().optional(),
4993
- notModified: z26.boolean().optional(),
4994
- loadTime: z26.number().optional()
5089
+ fromCache: z27.boolean().optional(),
5090
+ etag: z27.string().optional(),
5091
+ notModified: z27.boolean().optional(),
5092
+ loadTime: z27.number().optional()
4995
5093
  });
4996
- var MetadataSaveOptionsSchema = z26.object({
5094
+ var MetadataSaveOptionsSchema = z27.object({
4997
5095
  format: MetadataFormatSchema.optional(),
4998
- create: z26.boolean().default(true),
4999
- overwrite: z26.boolean().default(true),
5000
- path: z26.string().optional(),
5001
- prettify: z26.boolean().optional(),
5002
- indent: z26.number().optional(),
5003
- sortKeys: z26.boolean().optional(),
5004
- backup: z26.boolean().optional(),
5005
- atomic: z26.boolean().optional(),
5006
- loader: z26.string().optional().describe("Specific loader to use (e.g. filesystem, database)")
5007
- });
5008
- var MetadataSaveResultSchema = z26.object({
5009
- success: z26.boolean(),
5010
- path: z26.string().optional(),
5096
+ create: z27.boolean().default(true),
5097
+ overwrite: z27.boolean().default(true),
5098
+ path: z27.string().optional(),
5099
+ prettify: z27.boolean().optional(),
5100
+ indent: z27.number().optional(),
5101
+ sortKeys: z27.boolean().optional(),
5102
+ backup: z27.boolean().optional(),
5103
+ atomic: z27.boolean().optional(),
5104
+ loader: z27.string().optional().describe("Specific loader to use (e.g. filesystem, database)")
5105
+ });
5106
+ var MetadataSaveResultSchema = z27.object({
5107
+ success: z27.boolean(),
5108
+ path: z27.string().optional(),
5011
5109
  stats: MetadataStatsSchema.optional(),
5012
- etag: z26.string().optional(),
5013
- size: z26.number().optional(),
5014
- saveTime: z26.number().optional(),
5015
- backupPath: z26.string().optional()
5016
- });
5017
- var MetadataWatchEventSchema = z26.object({
5018
- type: z26.enum(["add", "change", "unlink", "added", "changed", "deleted"]),
5019
- path: z26.string(),
5020
- name: z26.string().optional(),
5110
+ etag: z27.string().optional(),
5111
+ size: z27.number().optional(),
5112
+ saveTime: z27.number().optional(),
5113
+ backupPath: z27.string().optional()
5114
+ });
5115
+ var MetadataWatchEventSchema = z27.object({
5116
+ type: z27.enum(["add", "change", "unlink", "added", "changed", "deleted"]),
5117
+ path: z27.string(),
5118
+ name: z27.string().optional(),
5021
5119
  stats: MetadataStatsSchema.optional(),
5022
- metadataType: z26.string().optional(),
5023
- data: z26.any().optional(),
5024
- timestamp: z26.date().optional()
5025
- });
5026
- var MetadataCollectionInfoSchema = z26.object({
5027
- type: z26.string(),
5028
- count: z26.number(),
5029
- namespaces: z26.array(z26.string())
5030
- });
5031
- var MetadataExportOptionsSchema = z26.object({
5032
- types: z26.array(z26.string()).optional(),
5033
- namespaces: z26.array(z26.string()).optional(),
5034
- output: z26.string().describe("Output directory or file"),
5120
+ metadataType: z27.string().optional(),
5121
+ data: z27.any().optional(),
5122
+ timestamp: z27.date().optional()
5123
+ });
5124
+ var MetadataCollectionInfoSchema = z27.object({
5125
+ type: z27.string(),
5126
+ count: z27.number(),
5127
+ namespaces: z27.array(z27.string())
5128
+ });
5129
+ var MetadataExportOptionsSchema = z27.object({
5130
+ types: z27.array(z27.string()).optional(),
5131
+ namespaces: z27.array(z27.string()).optional(),
5132
+ output: z27.string().describe("Output directory or file"),
5035
5133
  format: MetadataFormatSchema.default("json")
5036
5134
  });
5037
- var MetadataImportOptionsSchema = z26.object({
5038
- source: z26.string().describe("Input directory or file"),
5039
- strategy: z26.enum(["merge", "replace", "skip"]).default("merge"),
5040
- validate: z26.boolean().default(true)
5041
- });
5042
- var MetadataManagerConfigSchema = z26.object({
5043
- loaders: z26.array(z26.any()).optional(),
5044
- watch: z26.boolean().optional(),
5045
- cache: z26.boolean().optional(),
5046
- basePath: z26.string().optional(),
5047
- rootDir: z26.string().optional(),
5048
- formats: z26.array(MetadataFormatSchema).optional(),
5049
- watchOptions: z26.any().optional()
5135
+ var MetadataImportOptionsSchema = z27.object({
5136
+ source: z27.string().describe("Input directory or file"),
5137
+ strategy: z27.enum(["merge", "replace", "skip"]).default("merge"),
5138
+ validate: z27.boolean().default(true)
5139
+ });
5140
+ var MetadataManagerConfigSchema = z27.object({
5141
+ loaders: z27.array(z27.any()).optional(),
5142
+ watch: z27.boolean().optional(),
5143
+ cache: z27.boolean().optional(),
5144
+ basePath: z27.string().optional(),
5145
+ rootDir: z27.string().optional(),
5146
+ formats: z27.array(MetadataFormatSchema).optional(),
5147
+ watchOptions: z27.any().optional()
5050
5148
  // Chokidar options
5051
5149
  });
5052
5150
 
5053
5151
  // src/system/service-registry.zod.ts
5054
- import { z as z27 } from "zod";
5055
- var CoreServiceName = z27.enum([
5152
+ import { z as z28 } from "zod";
5153
+ var CoreServiceName = z28.enum([
5056
5154
  // Core Data & Metadata
5057
5155
  "metadata",
5058
5156
  // Object/Field Definitions
@@ -5085,7 +5183,7 @@ var CoreServiceName = z27.enum([
5085
5183
  "notification"
5086
5184
  // Email/Push/SMS
5087
5185
  ]);
5088
- var ServiceCriticalitySchema = z27.enum([
5186
+ var ServiceCriticalitySchema = z28.enum([
5089
5187
  "required",
5090
5188
  // System fails to start if missing (Exit Code 1)
5091
5189
  "core",
@@ -5112,22 +5210,22 @@ var ServiceRequirementDef = {
5112
5210
  realtime: "optional",
5113
5211
  notification: "optional"
5114
5212
  };
5115
- var ServiceStatusSchema = z27.object({
5213
+ var ServiceStatusSchema = z28.object({
5116
5214
  name: CoreServiceName,
5117
- enabled: z27.boolean(),
5118
- status: z27.enum(["running", "stopped", "degraded", "initializing"]),
5119
- version: z27.string().optional(),
5120
- provider: z27.string().optional().describe('Implementation provider (e.g. "s3" for storage)'),
5121
- features: z27.array(z27.string()).optional().describe("List of supported sub-features")
5215
+ enabled: z28.boolean(),
5216
+ status: z28.enum(["running", "stopped", "degraded", "initializing"]),
5217
+ version: z28.string().optional(),
5218
+ provider: z28.string().optional().describe('Implementation provider (e.g. "s3" for storage)'),
5219
+ features: z28.array(z28.string()).optional().describe("List of supported sub-features")
5122
5220
  });
5123
- var KernelServiceMapSchema = z27.record(
5221
+ var KernelServiceMapSchema = z28.record(
5124
5222
  CoreServiceName,
5125
- z27.any().describe("Service Instance implementing the protocol interface")
5223
+ z28.any().describe("Service Instance implementing the protocol interface")
5126
5224
  );
5127
- var ServiceConfigSchema = z27.object({
5128
- id: z27.string(),
5225
+ var ServiceConfigSchema = z28.object({
5226
+ id: z28.string(),
5129
5227
  name: CoreServiceName,
5130
- options: z27.record(z27.string(), z27.any()).optional()
5228
+ options: z28.record(z28.string(), z28.any()).optional()
5131
5229
  });
5132
5230
  export {
5133
5231
  AccessControlConfigSchema,