@objectstack/spec 1.0.10 → 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
@@ -3433,7 +3433,7 @@ var ChangeRequestSchema = import_zod12.z.object({
3433
3433
  });
3434
3434
 
3435
3435
  // src/system/migration.zod.ts
3436
- var import_zod18 = require("zod");
3436
+ var import_zod19 = require("zod");
3437
3437
 
3438
3438
  // src/data/field.zod.ts
3439
3439
  var import_zod15 = require("zod");
@@ -3802,7 +3802,7 @@ var FieldSchema = import_zod15.z.object({
3802
3802
  });
3803
3803
 
3804
3804
  // src/data/object.zod.ts
3805
- var import_zod17 = require("zod");
3805
+ var import_zod18 = require("zod");
3806
3806
 
3807
3807
  // src/data/validation.zod.ts
3808
3808
  var import_zod16 = require("zod");
@@ -3887,8 +3887,77 @@ var ConditionalValidationSchema = BaseValidationSchema.extend({
3887
3887
  otherwise: ValidationRuleSchema.optional().describe("Validation rule to apply when condition is false")
3888
3888
  });
3889
3889
 
3890
+ // src/automation/state-machine.zod.ts
3891
+ var import_zod17 = require("zod");
3892
+ var ActionRefSchema = import_zod17.z.union([
3893
+ import_zod17.z.string().describe("Action Name"),
3894
+ import_zod17.z.object({
3895
+ type: import_zod17.z.string(),
3896
+ // e.g., 'xstate.assign', 'log', 'email'
3897
+ params: import_zod17.z.record(import_zod17.z.string(), import_zod17.z.any()).optional()
3898
+ })
3899
+ ]);
3900
+ var GuardRefSchema = import_zod17.z.union([
3901
+ import_zod17.z.string().describe('Guard Name (e.g., "isManager", "amountGT1000")'),
3902
+ import_zod17.z.object({
3903
+ type: import_zod17.z.string(),
3904
+ params: import_zod17.z.record(import_zod17.z.string(), import_zod17.z.any()).optional()
3905
+ })
3906
+ ]);
3907
+ var TransitionSchema = import_zod17.z.object({
3908
+ target: import_zod17.z.string().optional().describe("Target State ID"),
3909
+ cond: GuardRefSchema.optional().describe("Condition (Guard) required to take this path"),
3910
+ actions: import_zod17.z.array(ActionRefSchema).optional().describe("Actions to execute during transition"),
3911
+ description: import_zod17.z.string().optional().describe("Human readable description of this rule")
3912
+ });
3913
+ var EventSchema = import_zod17.z.object({
3914
+ type: import_zod17.z.string().describe('Event Type (e.g. "APPROVE", "REJECT", "Submit")'),
3915
+ // Payload validation schema could go here if we want deep validation
3916
+ schema: import_zod17.z.record(import_zod17.z.string(), import_zod17.z.any()).optional().describe("Expected event payload structure")
3917
+ });
3918
+ var StateNodeSchema = import_zod17.z.lazy(() => import_zod17.z.object({
3919
+ /** Type of state */
3920
+ type: import_zod17.z.enum(["atomic", "compound", "parallel", "final", "history"]).default("atomic"),
3921
+ /** Entry/Exit Actions */
3922
+ entry: import_zod17.z.array(ActionRefSchema).optional().describe("Actions to run when entering this state"),
3923
+ exit: import_zod17.z.array(ActionRefSchema).optional().describe("Actions to run when leaving this state"),
3924
+ /** Transitions (Events) */
3925
+ on: import_zod17.z.record(import_zod17.z.string(), import_zod17.z.union([
3926
+ import_zod17.z.string(),
3927
+ // Shorthand target
3928
+ TransitionSchema,
3929
+ import_zod17.z.array(TransitionSchema)
3930
+ ])).optional().describe("Map of Event Type -> Transition Definition"),
3931
+ /** Always Transitions (Eventless) */
3932
+ always: import_zod17.z.array(TransitionSchema).optional(),
3933
+ /** Nesting (Hierarchical States) */
3934
+ initial: import_zod17.z.string().optional().describe("Initial child state (if compound)"),
3935
+ states: import_zod17.z.record(import_zod17.z.string(), StateNodeSchema).optional(),
3936
+ /** Metadata for UI/AI */
3937
+ meta: import_zod17.z.object({
3938
+ label: import_zod17.z.string().optional(),
3939
+ description: import_zod17.z.string().optional(),
3940
+ color: import_zod17.z.string().optional(),
3941
+ // For UI diagrams
3942
+ // Instructions for AI Agent when in this state
3943
+ aiInstructions: import_zod17.z.string().optional().describe("Specific instructions for AI when in this state")
3944
+ }).optional()
3945
+ }));
3946
+ var StateMachineSchema = import_zod17.z.object({
3947
+ id: SnakeCaseIdentifierSchema.describe("Unique Machine ID"),
3948
+ description: import_zod17.z.string().optional(),
3949
+ /** Context (Memory) Schema */
3950
+ contextSchema: import_zod17.z.record(import_zod17.z.string(), import_zod17.z.any()).optional().describe("Zod Schema for the machine context/memory"),
3951
+ /** Initial State */
3952
+ initial: import_zod17.z.string().describe("Initial State ID"),
3953
+ /** State Definitions */
3954
+ states: import_zod17.z.record(import_zod17.z.string(), StateNodeSchema).describe("State Nodes"),
3955
+ /** Global Listeners */
3956
+ on: import_zod17.z.record(import_zod17.z.string(), import_zod17.z.union([import_zod17.z.string(), TransitionSchema, import_zod17.z.array(TransitionSchema)])).optional()
3957
+ });
3958
+
3890
3959
  // src/data/object.zod.ts
3891
- var ApiMethod = import_zod17.z.enum([
3960
+ var ApiMethod = import_zod18.z.enum([
3892
3961
  "get",
3893
3962
  "list",
3894
3963
  // Read
@@ -3913,65 +3982,65 @@ var ApiMethod = import_zod17.z.enum([
3913
3982
  "export"
3914
3983
  // Data portability
3915
3984
  ]);
3916
- var ObjectCapabilities = import_zod17.z.object({
3985
+ var ObjectCapabilities = import_zod18.z.object({
3917
3986
  /** Enable history tracking (Audit Trail) */
3918
- trackHistory: import_zod17.z.boolean().default(false).describe("Enable field history tracking for audit compliance"),
3987
+ trackHistory: import_zod18.z.boolean().default(false).describe("Enable field history tracking for audit compliance"),
3919
3988
  /** Enable global search indexing */
3920
- searchable: import_zod17.z.boolean().default(true).describe("Index records for global search"),
3989
+ searchable: import_zod18.z.boolean().default(true).describe("Index records for global search"),
3921
3990
  /** Enable REST/GraphQL API access */
3922
- apiEnabled: import_zod17.z.boolean().default(true).describe("Expose object via automatic APIs"),
3991
+ apiEnabled: import_zod18.z.boolean().default(true).describe("Expose object via automatic APIs"),
3923
3992
  /**
3924
3993
  * API Supported Operations
3925
3994
  * Granular control over API exposure.
3926
3995
  */
3927
- apiMethods: import_zod17.z.array(ApiMethod).optional().describe("Whitelist of allowed API operations"),
3996
+ apiMethods: import_zod18.z.array(ApiMethod).optional().describe("Whitelist of allowed API operations"),
3928
3997
  /** Enable standard attachments/files engine */
3929
- files: import_zod17.z.boolean().default(false).describe("Enable file attachments and document management"),
3998
+ files: import_zod18.z.boolean().default(false).describe("Enable file attachments and document management"),
3930
3999
  /** Enable social collaboration (Comments, Mentions, Feeds) */
3931
- feeds: import_zod17.z.boolean().default(false).describe("Enable social feed, comments, and mentions (Chatter-like)"),
4000
+ feeds: import_zod18.z.boolean().default(false).describe("Enable social feed, comments, and mentions (Chatter-like)"),
3932
4001
  /** Enable standard Activity suite (Tasks, Calendars, Events) */
3933
- activities: import_zod17.z.boolean().default(false).describe("Enable standard tasks and events tracking"),
4002
+ activities: import_zod18.z.boolean().default(false).describe("Enable standard tasks and events tracking"),
3934
4003
  /** Enable Recycle Bin / Soft Delete */
3935
- trash: import_zod17.z.boolean().default(true).describe("Enable soft-delete with restore capability"),
4004
+ trash: import_zod18.z.boolean().default(true).describe("Enable soft-delete with restore capability"),
3936
4005
  /** Enable "Recently Viewed" tracking */
3937
- mru: import_zod17.z.boolean().default(true).describe("Track Most Recently Used (MRU) list for users"),
4006
+ mru: import_zod18.z.boolean().default(true).describe("Track Most Recently Used (MRU) list for users"),
3938
4007
  /** Allow cloning records */
3939
- clone: import_zod17.z.boolean().default(true).describe("Allow record deep cloning")
3940
- });
3941
- var IndexSchema = import_zod17.z.object({
3942
- name: import_zod17.z.string().optional().describe("Index name (auto-generated if not provided)"),
3943
- fields: import_zod17.z.array(import_zod17.z.string()).describe("Fields included in the index"),
3944
- type: import_zod17.z.enum(["btree", "hash", "gin", "gist", "fulltext"]).optional().default("btree").describe("Index algorithm type"),
3945
- unique: import_zod17.z.boolean().optional().default(false).describe("Whether the index enforces uniqueness"),
3946
- partial: import_zod17.z.string().optional().describe("Partial index condition (SQL WHERE clause for conditional indexes)")
3947
- });
3948
- var SearchConfigSchema2 = import_zod17.z.object({
3949
- fields: import_zod17.z.array(import_zod17.z.string()).describe("Fields to index for full-text search weighting"),
3950
- displayFields: import_zod17.z.array(import_zod17.z.string()).optional().describe("Fields to display in search result cards"),
3951
- filters: import_zod17.z.array(import_zod17.z.string()).optional().describe("Default filters for search results")
3952
- });
3953
- var TenancyConfigSchema = import_zod17.z.object({
3954
- enabled: import_zod17.z.boolean().describe("Enable multi-tenancy for this object"),
3955
- strategy: import_zod17.z.enum(["shared", "isolated", "hybrid"]).describe("Tenant isolation strategy: shared (single DB, row-level), isolated (separate DB per tenant), hybrid (mix)"),
3956
- tenantField: import_zod17.z.string().default("tenant_id").describe("Field name for tenant identifier"),
3957
- crossTenantAccess: import_zod17.z.boolean().default(false).describe("Allow cross-tenant data access (with explicit permission)")
3958
- });
3959
- var SoftDeleteConfigSchema = import_zod17.z.object({
3960
- enabled: import_zod17.z.boolean().describe("Enable soft delete (trash/recycle bin)"),
3961
- field: import_zod17.z.string().default("deleted_at").describe("Field name for soft delete timestamp"),
3962
- cascadeDelete: import_zod17.z.boolean().default(false).describe("Cascade soft delete to related records")
3963
- });
3964
- var VersioningConfigSchema = import_zod17.z.object({
3965
- enabled: import_zod17.z.boolean().describe("Enable record versioning"),
3966
- strategy: import_zod17.z.enum(["snapshot", "delta", "event-sourcing"]).describe("Versioning strategy: snapshot (full copy), delta (changes only), event-sourcing (event log)"),
3967
- retentionDays: import_zod17.z.number().min(1).optional().describe("Number of days to retain old versions (undefined = infinite)"),
3968
- versionField: import_zod17.z.string().default("version").describe("Field name for version number/timestamp")
3969
- });
3970
- var PartitioningConfigSchema = import_zod17.z.object({
3971
- enabled: import_zod17.z.boolean().describe("Enable table partitioning"),
3972
- strategy: import_zod17.z.enum(["range", "hash", "list"]).describe("Partitioning strategy: range (date ranges), hash (consistent hashing), list (predefined values)"),
3973
- key: import_zod17.z.string().describe("Field name to partition by"),
3974
- interval: import_zod17.z.string().optional().describe('Partition interval for range strategy (e.g., "1 month", "1 year")')
4008
+ clone: import_zod18.z.boolean().default(true).describe("Allow record deep cloning")
4009
+ });
4010
+ var IndexSchema = import_zod18.z.object({
4011
+ name: import_zod18.z.string().optional().describe("Index name (auto-generated if not provided)"),
4012
+ fields: import_zod18.z.array(import_zod18.z.string()).describe("Fields included in the index"),
4013
+ type: import_zod18.z.enum(["btree", "hash", "gin", "gist", "fulltext"]).optional().default("btree").describe("Index algorithm type"),
4014
+ unique: import_zod18.z.boolean().optional().default(false).describe("Whether the index enforces uniqueness"),
4015
+ partial: import_zod18.z.string().optional().describe("Partial index condition (SQL WHERE clause for conditional indexes)")
4016
+ });
4017
+ var SearchConfigSchema2 = import_zod18.z.object({
4018
+ fields: import_zod18.z.array(import_zod18.z.string()).describe("Fields to index for full-text search weighting"),
4019
+ displayFields: import_zod18.z.array(import_zod18.z.string()).optional().describe("Fields to display in search result cards"),
4020
+ filters: import_zod18.z.array(import_zod18.z.string()).optional().describe("Default filters for search results")
4021
+ });
4022
+ var TenancyConfigSchema = import_zod18.z.object({
4023
+ enabled: import_zod18.z.boolean().describe("Enable multi-tenancy for this object"),
4024
+ strategy: import_zod18.z.enum(["shared", "isolated", "hybrid"]).describe("Tenant isolation strategy: shared (single DB, row-level), isolated (separate DB per tenant), hybrid (mix)"),
4025
+ tenantField: import_zod18.z.string().default("tenant_id").describe("Field name for tenant identifier"),
4026
+ crossTenantAccess: import_zod18.z.boolean().default(false).describe("Allow cross-tenant data access (with explicit permission)")
4027
+ });
4028
+ var SoftDeleteConfigSchema = import_zod18.z.object({
4029
+ enabled: import_zod18.z.boolean().describe("Enable soft delete (trash/recycle bin)"),
4030
+ field: import_zod18.z.string().default("deleted_at").describe("Field name for soft delete timestamp"),
4031
+ cascadeDelete: import_zod18.z.boolean().default(false).describe("Cascade soft delete to related records")
4032
+ });
4033
+ var VersioningConfigSchema = import_zod18.z.object({
4034
+ enabled: import_zod18.z.boolean().describe("Enable record versioning"),
4035
+ strategy: import_zod18.z.enum(["snapshot", "delta", "event-sourcing"]).describe("Versioning strategy: snapshot (full copy), delta (changes only), event-sourcing (event log)"),
4036
+ retentionDays: import_zod18.z.number().min(1).optional().describe("Number of days to retain old versions (undefined = infinite)"),
4037
+ versionField: import_zod18.z.string().default("version").describe("Field name for version number/timestamp")
4038
+ });
4039
+ var PartitioningConfigSchema = import_zod18.z.object({
4040
+ enabled: import_zod18.z.boolean().describe("Enable table partitioning"),
4041
+ strategy: import_zod18.z.enum(["range", "hash", "list"]).describe("Partitioning strategy: range (date ranges), hash (consistent hashing), list (predefined values)"),
4042
+ key: import_zod18.z.string().describe("Field name to partition by"),
4043
+ interval: import_zod18.z.string().optional().describe('Partition interval for range strategy (e.g., "1 month", "1 year")')
3975
4044
  }).refine((data) => {
3976
4045
  if (data.strategy === "range" && !data.interval) {
3977
4046
  return false;
@@ -3980,39 +4049,39 @@ var PartitioningConfigSchema = import_zod17.z.object({
3980
4049
  }, {
3981
4050
  message: 'interval is required when strategy is "range"'
3982
4051
  });
3983
- var CDCConfigSchema = import_zod17.z.object({
3984
- enabled: import_zod17.z.boolean().describe("Enable Change Data Capture"),
3985
- events: import_zod17.z.array(import_zod17.z.enum(["insert", "update", "delete"])).describe("Event types to capture"),
3986
- destination: import_zod17.z.string().describe('Destination endpoint (e.g., "kafka://topic", "webhook://url")')
4052
+ var CDCConfigSchema = import_zod18.z.object({
4053
+ enabled: import_zod18.z.boolean().describe("Enable Change Data Capture"),
4054
+ events: import_zod18.z.array(import_zod18.z.enum(["insert", "update", "delete"])).describe("Event types to capture"),
4055
+ destination: import_zod18.z.string().describe('Destination endpoint (e.g., "kafka://topic", "webhook://url")')
3987
4056
  });
3988
- var ObjectSchemaBase = import_zod17.z.object({
4057
+ var ObjectSchemaBase = import_zod18.z.object({
3989
4058
  /**
3990
4059
  * Identity & Metadata
3991
4060
  */
3992
- name: import_zod17.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Machine unique key (snake_case). Immutable."),
3993
- label: import_zod17.z.string().optional().describe('Human readable singular label (e.g. "Account")'),
3994
- pluralLabel: import_zod17.z.string().optional().describe('Human readable plural label (e.g. "Accounts")'),
3995
- description: import_zod17.z.string().optional().describe("Developer documentation / description"),
3996
- icon: import_zod17.z.string().optional().describe("Icon name (Lucide/Material) for UI representation"),
4061
+ name: import_zod18.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Machine unique key (snake_case). Immutable."),
4062
+ label: import_zod18.z.string().optional().describe('Human readable singular label (e.g. "Account")'),
4063
+ pluralLabel: import_zod18.z.string().optional().describe('Human readable plural label (e.g. "Accounts")'),
4064
+ description: import_zod18.z.string().optional().describe("Developer documentation / description"),
4065
+ icon: import_zod18.z.string().optional().describe("Icon name (Lucide/Material) for UI representation"),
3997
4066
  /**
3998
4067
  * Taxonomy & Organization
3999
4068
  */
4000
- tags: import_zod17.z.array(import_zod17.z.string()).optional().describe('Categorization tags (e.g. "sales", "system", "reference")'),
4001
- active: import_zod17.z.boolean().optional().default(true).describe("Is the object active and usable"),
4002
- isSystem: import_zod17.z.boolean().optional().default(false).describe("Is system object (protected from deletion)"),
4003
- abstract: import_zod17.z.boolean().optional().default(false).describe("Is abstract base object (cannot be instantiated)"),
4069
+ tags: import_zod18.z.array(import_zod18.z.string()).optional().describe('Categorization tags (e.g. "sales", "system", "reference")'),
4070
+ active: import_zod18.z.boolean().optional().default(true).describe("Is the object active and usable"),
4071
+ isSystem: import_zod18.z.boolean().optional().default(false).describe("Is system object (protected from deletion)"),
4072
+ abstract: import_zod18.z.boolean().optional().default(false).describe("Is abstract base object (cannot be instantiated)"),
4004
4073
  /**
4005
4074
  * Storage & Virtualization
4006
4075
  */
4007
- datasource: import_zod17.z.string().optional().default("default").describe('Target Datasource ID. "default" is the primary DB.'),
4008
- tableName: import_zod17.z.string().optional().describe("Physical table/collection name in the target datasource"),
4076
+ datasource: import_zod18.z.string().optional().default("default").describe('Target Datasource ID. "default" is the primary DB.'),
4077
+ tableName: import_zod18.z.string().optional().describe("Physical table/collection name in the target datasource"),
4009
4078
  /**
4010
4079
  * Data Model
4011
4080
  */
4012
- fields: import_zod17.z.record(import_zod17.z.string().regex(/^[a-z_][a-z0-9_]*$/, {
4081
+ fields: import_zod18.z.record(import_zod18.z.string().regex(/^[a-z_][a-z0-9_]*$/, {
4013
4082
  message: 'Field names must be lowercase snake_case (e.g., "first_name", "company", "annual_revenue")'
4014
4083
  }), FieldSchema).describe("Field definitions map. Keys must be snake_case identifiers."),
4015
- indexes: import_zod17.z.array(IndexSchema).optional().describe("Database performance indexes"),
4084
+ indexes: import_zod18.z.array(IndexSchema).optional().describe("Database performance indexes"),
4016
4085
  /**
4017
4086
  * Advanced Data Management
4018
4087
  */
@@ -4030,12 +4099,22 @@ var ObjectSchemaBase = import_zod17.z.object({
4030
4099
  * Logic & Validation (Co-located)
4031
4100
  * Best Practice: Define rules close to data.
4032
4101
  */
4033
- validations: import_zod17.z.array(ValidationRuleSchema).optional().describe("Object-level validation rules"),
4102
+ validations: import_zod18.z.array(ValidationRuleSchema).optional().describe("Object-level validation rules"),
4103
+ /**
4104
+ * State Machine(s)
4105
+ * Supports a single machine (legacy) or a named record of machines.
4106
+ * Multiple machines allow parallel lifecycles (e.g., status + payment_status + approval_status).
4107
+ *
4108
+ * @example Single: stateMachine: { id: 'lifecycle', initial: 'draft', states: {...} }
4109
+ * @example Multiple: stateMachines: { lifecycle: {...}, payment: {...}, approval: {...} }
4110
+ */
4111
+ stateMachine: StateMachineSchema.optional().describe("Single state machine for record lifecycle (shorthand)"),
4112
+ stateMachines: import_zod18.z.record(import_zod18.z.string(), StateMachineSchema).optional().describe("Named state machines for parallel lifecycles (e.g., status, payment, approval)"),
4034
4113
  /**
4035
4114
  * Display & UI Hints (Data-Layer)
4036
4115
  */
4037
- titleFormat: import_zod17.z.string().optional().describe('Title expression (e.g. "{name} - {code}"). Overrides nameField.'),
4038
- compactLayout: import_zod17.z.array(import_zod17.z.string()).optional().describe("Primary fields for hover/cards/lookups"),
4116
+ titleFormat: import_zod18.z.string().optional().describe('Title expression (e.g. "{name} - {code}"). Overrides nameField.'),
4117
+ compactLayout: import_zod18.z.array(import_zod18.z.string()).optional().describe("Primary fields for hover/cards/lookups"),
4039
4118
  /**
4040
4119
  * Search Engine Config
4041
4120
  */
@@ -4048,45 +4127,64 @@ var ObjectSchemaBase = import_zod17.z.object({
4048
4127
  var ObjectSchema = Object.assign(ObjectSchemaBase, {
4049
4128
  create: (config) => config
4050
4129
  });
4130
+ var ObjectOwnershipEnum = import_zod18.z.enum(["own", "extend"]);
4131
+ var ObjectExtensionSchema = import_zod18.z.object({
4132
+ /** The target object name (FQN) to extend */
4133
+ extend: import_zod18.z.string().describe("Target object name (FQN) to extend"),
4134
+ /** Fields to merge into the target object (additive) */
4135
+ fields: import_zod18.z.record(import_zod18.z.string(), FieldSchema).optional().describe("Fields to add/override"),
4136
+ /** Override label */
4137
+ label: import_zod18.z.string().optional(),
4138
+ /** Override plural label */
4139
+ pluralLabel: import_zod18.z.string().optional(),
4140
+ /** Override description */
4141
+ description: import_zod18.z.string().optional(),
4142
+ /** Additional validation rules to add */
4143
+ validations: import_zod18.z.array(ValidationRuleSchema).optional(),
4144
+ /** Additional indexes to add */
4145
+ indexes: import_zod18.z.array(IndexSchema).optional(),
4146
+ /** Merge priority. Higher number applied later (wins on conflict). Default: 200 */
4147
+ priority: import_zod18.z.number().int().min(0).max(999).default(200).describe("Merge priority (higher = applied later)")
4148
+ });
4051
4149
 
4052
4150
  // src/system/migration.zod.ts
4053
- var AddFieldOperation = import_zod18.z.object({
4054
- type: import_zod18.z.literal("add_field"),
4055
- objectName: import_zod18.z.string(),
4056
- fieldName: import_zod18.z.string(),
4151
+ var AddFieldOperation = import_zod19.z.object({
4152
+ type: import_zod19.z.literal("add_field"),
4153
+ objectName: import_zod19.z.string(),
4154
+ fieldName: import_zod19.z.string(),
4057
4155
  field: FieldSchema
4058
4156
  });
4059
- var ModifyFieldOperation = import_zod18.z.object({
4060
- type: import_zod18.z.literal("modify_field"),
4061
- objectName: import_zod18.z.string(),
4062
- fieldName: import_zod18.z.string(),
4063
- changes: import_zod18.z.record(import_zod18.z.string(), import_zod18.z.unknown())
4157
+ var ModifyFieldOperation = import_zod19.z.object({
4158
+ type: import_zod19.z.literal("modify_field"),
4159
+ objectName: import_zod19.z.string(),
4160
+ fieldName: import_zod19.z.string(),
4161
+ changes: import_zod19.z.record(import_zod19.z.string(), import_zod19.z.unknown())
4064
4162
  // Partial field definition updates
4065
4163
  });
4066
- var RemoveFieldOperation = import_zod18.z.object({
4067
- type: import_zod18.z.literal("remove_field"),
4068
- objectName: import_zod18.z.string(),
4069
- fieldName: import_zod18.z.string()
4164
+ var RemoveFieldOperation = import_zod19.z.object({
4165
+ type: import_zod19.z.literal("remove_field"),
4166
+ objectName: import_zod19.z.string(),
4167
+ fieldName: import_zod19.z.string()
4070
4168
  });
4071
- var CreateObjectOperation = import_zod18.z.object({
4072
- type: import_zod18.z.literal("create_object"),
4169
+ var CreateObjectOperation = import_zod19.z.object({
4170
+ type: import_zod19.z.literal("create_object"),
4073
4171
  object: ObjectSchema
4074
4172
  });
4075
- var RenameObjectOperation = import_zod18.z.object({
4076
- type: import_zod18.z.literal("rename_object"),
4077
- oldName: import_zod18.z.string(),
4078
- newName: import_zod18.z.string()
4173
+ var RenameObjectOperation = import_zod19.z.object({
4174
+ type: import_zod19.z.literal("rename_object"),
4175
+ oldName: import_zod19.z.string(),
4176
+ newName: import_zod19.z.string()
4079
4177
  });
4080
- var DeleteObjectOperation = import_zod18.z.object({
4081
- type: import_zod18.z.literal("delete_object"),
4082
- objectName: import_zod18.z.string()
4178
+ var DeleteObjectOperation = import_zod19.z.object({
4179
+ type: import_zod19.z.literal("delete_object"),
4180
+ objectName: import_zod19.z.string()
4083
4181
  });
4084
- var ExecuteSqlOperation = import_zod18.z.object({
4085
- type: import_zod18.z.literal("execute_sql"),
4086
- sql: import_zod18.z.string(),
4087
- description: import_zod18.z.string().optional()
4182
+ var ExecuteSqlOperation = import_zod19.z.object({
4183
+ type: import_zod19.z.literal("execute_sql"),
4184
+ sql: import_zod19.z.string(),
4185
+ description: import_zod19.z.string().optional()
4088
4186
  });
4089
- var MigrationOperationSchema = import_zod18.z.discriminatedUnion("type", [
4187
+ var MigrationOperationSchema = import_zod19.z.discriminatedUnion("type", [
4090
4188
  AddFieldOperation,
4091
4189
  ModifyFieldOperation,
4092
4190
  RemoveFieldOperation,
@@ -4095,65 +4193,65 @@ var MigrationOperationSchema = import_zod18.z.discriminatedUnion("type", [
4095
4193
  DeleteObjectOperation,
4096
4194
  ExecuteSqlOperation
4097
4195
  ]);
4098
- var MigrationDependencySchema = import_zod18.z.object({
4099
- migrationId: import_zod18.z.string(),
4100
- package: import_zod18.z.string().optional()
4101
- });
4102
- var ChangeSetSchema = import_zod18.z.object({
4103
- id: import_zod18.z.string().uuid().describe("Unique identifier for this change set"),
4104
- name: import_zod18.z.string().describe("Human readable name for the migration"),
4105
- description: import_zod18.z.string().optional(),
4106
- author: import_zod18.z.string().optional(),
4107
- createdAt: import_zod18.z.string().datetime().optional(),
4196
+ var MigrationDependencySchema = import_zod19.z.object({
4197
+ migrationId: import_zod19.z.string(),
4198
+ package: import_zod19.z.string().optional()
4199
+ });
4200
+ var ChangeSetSchema = import_zod19.z.object({
4201
+ id: import_zod19.z.string().uuid().describe("Unique identifier for this change set"),
4202
+ name: import_zod19.z.string().describe("Human readable name for the migration"),
4203
+ description: import_zod19.z.string().optional(),
4204
+ author: import_zod19.z.string().optional(),
4205
+ createdAt: import_zod19.z.string().datetime().optional(),
4108
4206
  // Dependencies ensure migrations run in order
4109
- dependencies: import_zod18.z.array(MigrationDependencySchema).optional(),
4207
+ dependencies: import_zod19.z.array(MigrationDependencySchema).optional(),
4110
4208
  // The actual atomic operations
4111
- operations: import_zod18.z.array(MigrationOperationSchema),
4209
+ operations: import_zod19.z.array(MigrationOperationSchema),
4112
4210
  // Rollback operations (AI should generate these too)
4113
- rollback: import_zod18.z.array(MigrationOperationSchema).optional()
4211
+ rollback: import_zod19.z.array(MigrationOperationSchema).optional()
4114
4212
  });
4115
4213
 
4116
4214
  // src/system/auth-config.zod.ts
4117
- var import_zod19 = require("zod");
4118
- var AuthProviderConfigSchema = import_zod19.z.object({
4119
- id: import_zod19.z.string().describe("Provider ID (github, google)"),
4120
- clientId: import_zod19.z.string().describe("OAuth Client ID"),
4121
- clientSecret: import_zod19.z.string().describe("OAuth Client Secret"),
4122
- scope: import_zod19.z.array(import_zod19.z.string()).optional().describe("Requested permissions")
4123
- });
4124
- var AuthPluginConfigSchema = import_zod19.z.object({
4125
- organization: import_zod19.z.boolean().default(false).describe("Enable Organization/Teams support"),
4126
- twoFactor: import_zod19.z.boolean().default(false).describe("Enable 2FA"),
4127
- passkeys: import_zod19.z.boolean().default(false).describe("Enable Passkey support"),
4128
- magicLink: import_zod19.z.boolean().default(false).describe("Enable Magic Link login")
4129
- });
4130
- var AuthConfigSchema = import_zod19.z.object({
4131
- secret: import_zod19.z.string().optional().describe("Encryption secret"),
4132
- baseUrl: import_zod19.z.string().optional().describe("Base URL for auth routes"),
4133
- databaseUrl: import_zod19.z.string().optional().describe("Database connection string"),
4134
- providers: import_zod19.z.array(AuthProviderConfigSchema).optional(),
4215
+ var import_zod20 = require("zod");
4216
+ var AuthProviderConfigSchema = import_zod20.z.object({
4217
+ id: import_zod20.z.string().describe("Provider ID (github, google)"),
4218
+ clientId: import_zod20.z.string().describe("OAuth Client ID"),
4219
+ clientSecret: import_zod20.z.string().describe("OAuth Client Secret"),
4220
+ scope: import_zod20.z.array(import_zod20.z.string()).optional().describe("Requested permissions")
4221
+ });
4222
+ var AuthPluginConfigSchema = import_zod20.z.object({
4223
+ organization: import_zod20.z.boolean().default(false).describe("Enable Organization/Teams support"),
4224
+ twoFactor: import_zod20.z.boolean().default(false).describe("Enable 2FA"),
4225
+ passkeys: import_zod20.z.boolean().default(false).describe("Enable Passkey support"),
4226
+ magicLink: import_zod20.z.boolean().default(false).describe("Enable Magic Link login")
4227
+ });
4228
+ var AuthConfigSchema = import_zod20.z.object({
4229
+ secret: import_zod20.z.string().optional().describe("Encryption secret"),
4230
+ baseUrl: import_zod20.z.string().optional().describe("Base URL for auth routes"),
4231
+ databaseUrl: import_zod20.z.string().optional().describe("Database connection string"),
4232
+ providers: import_zod20.z.array(AuthProviderConfigSchema).optional(),
4135
4233
  plugins: AuthPluginConfigSchema.optional(),
4136
- session: import_zod19.z.object({
4137
- expiresIn: import_zod19.z.number().default(60 * 60 * 24 * 7).describe("Session duration in seconds"),
4138
- updateAge: import_zod19.z.number().default(60 * 60 * 24).describe("Session update frequency")
4234
+ session: import_zod20.z.object({
4235
+ expiresIn: import_zod20.z.number().default(60 * 60 * 24 * 7).describe("Session duration in seconds"),
4236
+ updateAge: import_zod20.z.number().default(60 * 60 * 24).describe("Session update frequency")
4139
4237
  }).optional(),
4140
4238
  // Custom auth properties
4141
- [import_zod19.z.string().regex(/^[^A-Z]+$/).toString()]: import_zod19.z.any().optional()
4239
+ [import_zod20.z.string().regex(/^[^A-Z]+$/).toString()]: import_zod20.z.any().optional()
4142
4240
  });
4143
4241
 
4144
4242
  // src/system/compliance.zod.ts
4145
- var import_zod20 = require("zod");
4146
- var GDPRConfigSchema = import_zod20.z.object({
4147
- enabled: import_zod20.z.boolean(),
4148
- dataSubjectRights: import_zod20.z.object({
4149
- rightToAccess: import_zod20.z.boolean().default(true),
4150
- rightToRectification: import_zod20.z.boolean().default(true),
4151
- rightToErasure: import_zod20.z.boolean().default(true),
4152
- rightToRestriction: import_zod20.z.boolean().default(true),
4153
- rightToPortability: import_zod20.z.boolean().default(true),
4154
- rightToObjection: import_zod20.z.boolean().default(true)
4243
+ var import_zod21 = require("zod");
4244
+ var GDPRConfigSchema = import_zod21.z.object({
4245
+ enabled: import_zod21.z.boolean(),
4246
+ dataSubjectRights: import_zod21.z.object({
4247
+ rightToAccess: import_zod21.z.boolean().default(true),
4248
+ rightToRectification: import_zod21.z.boolean().default(true),
4249
+ rightToErasure: import_zod21.z.boolean().default(true),
4250
+ rightToRestriction: import_zod21.z.boolean().default(true),
4251
+ rightToPortability: import_zod21.z.boolean().default(true),
4252
+ rightToObjection: import_zod21.z.boolean().default(true)
4155
4253
  }),
4156
- legalBasis: import_zod20.z.enum([
4254
+ legalBasis: import_zod21.z.enum([
4157
4255
  "consent",
4158
4256
  "contract",
4159
4257
  "legal-obligation",
@@ -4161,34 +4259,34 @@ var GDPRConfigSchema = import_zod20.z.object({
4161
4259
  "public-task",
4162
4260
  "legitimate-interests"
4163
4261
  ]),
4164
- consentTracking: import_zod20.z.boolean().default(true),
4165
- dataRetentionDays: import_zod20.z.number().optional(),
4166
- dataProcessingAgreement: import_zod20.z.string().optional()
4167
- });
4168
- var HIPAAConfigSchema = import_zod20.z.object({
4169
- enabled: import_zod20.z.boolean(),
4170
- phi: import_zod20.z.object({
4171
- encryption: import_zod20.z.boolean().default(true),
4172
- accessControl: import_zod20.z.boolean().default(true),
4173
- auditTrail: import_zod20.z.boolean().default(true),
4174
- backupAndRecovery: import_zod20.z.boolean().default(true)
4262
+ consentTracking: import_zod21.z.boolean().default(true),
4263
+ dataRetentionDays: import_zod21.z.number().optional(),
4264
+ dataProcessingAgreement: import_zod21.z.string().optional()
4265
+ });
4266
+ var HIPAAConfigSchema = import_zod21.z.object({
4267
+ enabled: import_zod21.z.boolean(),
4268
+ phi: import_zod21.z.object({
4269
+ encryption: import_zod21.z.boolean().default(true),
4270
+ accessControl: import_zod21.z.boolean().default(true),
4271
+ auditTrail: import_zod21.z.boolean().default(true),
4272
+ backupAndRecovery: import_zod21.z.boolean().default(true)
4175
4273
  }),
4176
- businessAssociateAgreement: import_zod20.z.boolean().default(false)
4177
- });
4178
- var PCIDSSConfigSchema = import_zod20.z.object({
4179
- enabled: import_zod20.z.boolean(),
4180
- level: import_zod20.z.enum(["1", "2", "3", "4"]),
4181
- cardDataFields: import_zod20.z.array(import_zod20.z.string()),
4182
- tokenization: import_zod20.z.boolean().default(true),
4183
- encryptionInTransit: import_zod20.z.boolean().default(true),
4184
- encryptionAtRest: import_zod20.z.boolean().default(true)
4185
- });
4186
- var AuditLogConfigSchema = import_zod20.z.object({
4187
- enabled: import_zod20.z.boolean().default(true),
4188
- retentionDays: import_zod20.z.number().default(365),
4189
- immutable: import_zod20.z.boolean().default(true),
4190
- signLogs: import_zod20.z.boolean().default(false),
4191
- events: import_zod20.z.array(import_zod20.z.enum([
4274
+ businessAssociateAgreement: import_zod21.z.boolean().default(false)
4275
+ });
4276
+ var PCIDSSConfigSchema = import_zod21.z.object({
4277
+ enabled: import_zod21.z.boolean(),
4278
+ level: import_zod21.z.enum(["1", "2", "3", "4"]),
4279
+ cardDataFields: import_zod21.z.array(import_zod21.z.string()),
4280
+ tokenization: import_zod21.z.boolean().default(true),
4281
+ encryptionInTransit: import_zod21.z.boolean().default(true),
4282
+ encryptionAtRest: import_zod21.z.boolean().default(true)
4283
+ });
4284
+ var AuditLogConfigSchema = import_zod21.z.object({
4285
+ enabled: import_zod21.z.boolean().default(true),
4286
+ retentionDays: import_zod21.z.number().default(365),
4287
+ immutable: import_zod21.z.boolean().default(true),
4288
+ signLogs: import_zod21.z.boolean().default(false),
4289
+ events: import_zod21.z.array(import_zod21.z.enum([
4192
4290
  "create",
4193
4291
  "read",
4194
4292
  "update",
@@ -4200,7 +4298,7 @@ var AuditLogConfigSchema = import_zod20.z.object({
4200
4298
  "failed-login"
4201
4299
  ]))
4202
4300
  });
4203
- var ComplianceConfigSchema = import_zod20.z.object({
4301
+ var ComplianceConfigSchema = import_zod21.z.object({
4204
4302
  gdpr: GDPRConfigSchema.optional(),
4205
4303
  hipaa: HIPAAConfigSchema.optional(),
4206
4304
  pciDss: PCIDSSConfigSchema.optional(),
@@ -4208,57 +4306,57 @@ var ComplianceConfigSchema = import_zod20.z.object({
4208
4306
  });
4209
4307
 
4210
4308
  // src/system/job.zod.ts
4211
- var import_zod21 = require("zod");
4212
- var CronScheduleSchema = import_zod21.z.object({
4213
- type: import_zod21.z.literal("cron"),
4214
- expression: import_zod21.z.string().describe('Cron expression (e.g., "0 0 * * *" for daily at midnight)'),
4215
- timezone: import_zod21.z.string().optional().default("UTC").describe('Timezone for cron execution (e.g., "America/New_York")')
4309
+ var import_zod22 = require("zod");
4310
+ var CronScheduleSchema = import_zod22.z.object({
4311
+ type: import_zod22.z.literal("cron"),
4312
+ expression: import_zod22.z.string().describe('Cron expression (e.g., "0 0 * * *" for daily at midnight)'),
4313
+ timezone: import_zod22.z.string().optional().default("UTC").describe('Timezone for cron execution (e.g., "America/New_York")')
4216
4314
  });
4217
- var IntervalScheduleSchema = import_zod21.z.object({
4218
- type: import_zod21.z.literal("interval"),
4219
- intervalMs: import_zod21.z.number().int().positive().describe("Interval in milliseconds")
4315
+ var IntervalScheduleSchema = import_zod22.z.object({
4316
+ type: import_zod22.z.literal("interval"),
4317
+ intervalMs: import_zod22.z.number().int().positive().describe("Interval in milliseconds")
4220
4318
  });
4221
- var OnceScheduleSchema = import_zod21.z.object({
4222
- type: import_zod21.z.literal("once"),
4223
- at: import_zod21.z.string().datetime().describe("ISO 8601 datetime when to execute")
4319
+ var OnceScheduleSchema = import_zod22.z.object({
4320
+ type: import_zod22.z.literal("once"),
4321
+ at: import_zod22.z.string().datetime().describe("ISO 8601 datetime when to execute")
4224
4322
  });
4225
- var ScheduleSchema = import_zod21.z.discriminatedUnion("type", [
4323
+ var ScheduleSchema = import_zod22.z.discriminatedUnion("type", [
4226
4324
  CronScheduleSchema,
4227
4325
  IntervalScheduleSchema,
4228
4326
  OnceScheduleSchema
4229
4327
  ]);
4230
- var RetryPolicySchema = import_zod21.z.object({
4231
- maxRetries: import_zod21.z.number().int().min(0).default(3).describe("Maximum number of retry attempts"),
4232
- backoffMs: import_zod21.z.number().int().positive().default(1e3).describe("Initial backoff delay in milliseconds"),
4233
- backoffMultiplier: import_zod21.z.number().positive().default(2).describe("Multiplier for exponential backoff")
4234
- });
4235
- var JobSchema = import_zod21.z.object({
4236
- id: import_zod21.z.string().describe("Unique job identifier"),
4237
- name: import_zod21.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Job name (snake_case)"),
4328
+ var RetryPolicySchema = import_zod22.z.object({
4329
+ maxRetries: import_zod22.z.number().int().min(0).default(3).describe("Maximum number of retry attempts"),
4330
+ backoffMs: import_zod22.z.number().int().positive().default(1e3).describe("Initial backoff delay in milliseconds"),
4331
+ backoffMultiplier: import_zod22.z.number().positive().default(2).describe("Multiplier for exponential backoff")
4332
+ });
4333
+ var JobSchema = import_zod22.z.object({
4334
+ id: import_zod22.z.string().describe("Unique job identifier"),
4335
+ name: import_zod22.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Job name (snake_case)"),
4238
4336
  schedule: ScheduleSchema.describe("Job schedule configuration"),
4239
- handler: import_zod21.z.string().describe('Handler path (e.g. "path/to/file:functionName") or script ID'),
4337
+ handler: import_zod22.z.string().describe('Handler path (e.g. "path/to/file:functionName") or script ID'),
4240
4338
  retryPolicy: RetryPolicySchema.optional().describe("Retry policy configuration"),
4241
- timeout: import_zod21.z.number().int().positive().optional().describe("Timeout in milliseconds"),
4242
- enabled: import_zod21.z.boolean().default(true).describe("Whether the job is enabled")
4339
+ timeout: import_zod22.z.number().int().positive().optional().describe("Timeout in milliseconds"),
4340
+ enabled: import_zod22.z.boolean().default(true).describe("Whether the job is enabled")
4243
4341
  });
4244
- var JobExecutionStatus = import_zod21.z.enum([
4342
+ var JobExecutionStatus = import_zod22.z.enum([
4245
4343
  "running",
4246
4344
  "success",
4247
4345
  "failed",
4248
4346
  "timeout"
4249
4347
  ]);
4250
- var JobExecutionSchema = import_zod21.z.object({
4251
- jobId: import_zod21.z.string().describe("Job identifier"),
4252
- startedAt: import_zod21.z.string().datetime().describe("ISO 8601 datetime when execution started"),
4253
- completedAt: import_zod21.z.string().datetime().optional().describe("ISO 8601 datetime when execution completed"),
4348
+ var JobExecutionSchema = import_zod22.z.object({
4349
+ jobId: import_zod22.z.string().describe("Job identifier"),
4350
+ startedAt: import_zod22.z.string().datetime().describe("ISO 8601 datetime when execution started"),
4351
+ completedAt: import_zod22.z.string().datetime().optional().describe("ISO 8601 datetime when execution completed"),
4254
4352
  status: JobExecutionStatus.describe("Execution status"),
4255
- error: import_zod21.z.string().optional().describe("Error message if failed"),
4256
- duration: import_zod21.z.number().int().optional().describe("Execution duration in milliseconds")
4353
+ error: import_zod22.z.string().optional().describe("Error message if failed"),
4354
+ duration: import_zod22.z.number().int().optional().describe("Execution duration in milliseconds")
4257
4355
  });
4258
4356
 
4259
4357
  // src/system/worker.zod.ts
4260
- var import_zod22 = require("zod");
4261
- var TaskPriority = import_zod22.z.enum([
4358
+ var import_zod23 = require("zod");
4359
+ var TaskPriority = import_zod23.z.enum([
4262
4360
  "critical",
4263
4361
  // 0 - Must execute immediately
4264
4362
  "high",
@@ -4277,7 +4375,7 @@ var TASK_PRIORITY_VALUES = {
4277
4375
  low: 3,
4278
4376
  background: 4
4279
4377
  };
4280
- var TaskStatus = import_zod22.z.enum([
4378
+ var TaskStatus = import_zod23.z.enum([
4281
4379
  "pending",
4282
4380
  // Waiting to be processed
4283
4381
  "queued",
@@ -4295,30 +4393,30 @@ var TaskStatus = import_zod22.z.enum([
4295
4393
  "dead"
4296
4394
  // Moved to dead letter queue
4297
4395
  ]);
4298
- var TaskRetryPolicySchema = import_zod22.z.object({
4299
- maxRetries: import_zod22.z.number().int().min(0).default(3).describe("Maximum retry attempts"),
4300
- backoffStrategy: import_zod22.z.enum(["fixed", "linear", "exponential"]).default("exponential").describe("Backoff strategy between retries"),
4301
- initialDelayMs: import_zod22.z.number().int().positive().default(1e3).describe("Initial retry delay in milliseconds"),
4302
- maxDelayMs: import_zod22.z.number().int().positive().default(6e4).describe("Maximum retry delay in milliseconds"),
4303
- backoffMultiplier: import_zod22.z.number().positive().default(2).describe("Multiplier for exponential backoff")
4396
+ var TaskRetryPolicySchema = import_zod23.z.object({
4397
+ maxRetries: import_zod23.z.number().int().min(0).default(3).describe("Maximum retry attempts"),
4398
+ backoffStrategy: import_zod23.z.enum(["fixed", "linear", "exponential"]).default("exponential").describe("Backoff strategy between retries"),
4399
+ initialDelayMs: import_zod23.z.number().int().positive().default(1e3).describe("Initial retry delay in milliseconds"),
4400
+ maxDelayMs: import_zod23.z.number().int().positive().default(6e4).describe("Maximum retry delay in milliseconds"),
4401
+ backoffMultiplier: import_zod23.z.number().positive().default(2).describe("Multiplier for exponential backoff")
4304
4402
  });
4305
- var TaskSchema = import_zod22.z.object({
4403
+ var TaskSchema = import_zod23.z.object({
4306
4404
  /**
4307
4405
  * Unique task identifier
4308
4406
  */
4309
- id: import_zod22.z.string().describe("Unique task identifier"),
4407
+ id: import_zod23.z.string().describe("Unique task identifier"),
4310
4408
  /**
4311
4409
  * Task type (handler identifier)
4312
4410
  */
4313
- type: import_zod22.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Task type (snake_case)"),
4411
+ type: import_zod23.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Task type (snake_case)"),
4314
4412
  /**
4315
4413
  * Task payload data
4316
4414
  */
4317
- payload: import_zod22.z.any().describe("Task payload data"),
4415
+ payload: import_zod23.z.any().describe("Task payload data"),
4318
4416
  /**
4319
4417
  * Queue name
4320
4418
  */
4321
- queue: import_zod22.z.string().default("default").describe("Queue name"),
4419
+ queue: import_zod23.z.string().default("default").describe("Queue name"),
4322
4420
  /**
4323
4421
  * Task priority
4324
4422
  */
@@ -4330,15 +4428,15 @@ var TaskSchema = import_zod22.z.object({
4330
4428
  /**
4331
4429
  * Execution timeout in milliseconds
4332
4430
  */
4333
- timeoutMs: import_zod22.z.number().int().positive().optional().describe("Task timeout in milliseconds"),
4431
+ timeoutMs: import_zod23.z.number().int().positive().optional().describe("Task timeout in milliseconds"),
4334
4432
  /**
4335
4433
  * Scheduled execution time
4336
4434
  */
4337
- scheduledAt: import_zod22.z.string().datetime().optional().describe("ISO 8601 datetime to execute task"),
4435
+ scheduledAt: import_zod23.z.string().datetime().optional().describe("ISO 8601 datetime to execute task"),
4338
4436
  /**
4339
4437
  * Maximum execution attempts
4340
4438
  */
4341
- attempts: import_zod22.z.number().int().min(0).default(0).describe("Number of execution attempts"),
4439
+ attempts: import_zod23.z.number().int().min(0).default(0).describe("Number of execution attempts"),
4342
4440
  /**
4343
4441
  * Task status
4344
4442
  */
@@ -4346,18 +4444,18 @@ var TaskSchema = import_zod22.z.object({
4346
4444
  /**
4347
4445
  * Task metadata
4348
4446
  */
4349
- metadata: import_zod22.z.object({
4350
- createdAt: import_zod22.z.string().datetime().optional().describe("When task was created"),
4351
- updatedAt: import_zod22.z.string().datetime().optional().describe("Last update time"),
4352
- createdBy: import_zod22.z.string().optional().describe("User who created task"),
4353
- tags: import_zod22.z.array(import_zod22.z.string()).optional().describe("Task tags for filtering")
4447
+ metadata: import_zod23.z.object({
4448
+ createdAt: import_zod23.z.string().datetime().optional().describe("When task was created"),
4449
+ updatedAt: import_zod23.z.string().datetime().optional().describe("Last update time"),
4450
+ createdBy: import_zod23.z.string().optional().describe("User who created task"),
4451
+ tags: import_zod23.z.array(import_zod23.z.string()).optional().describe("Task tags for filtering")
4354
4452
  }).optional().describe("Task metadata")
4355
4453
  });
4356
- var TaskExecutionResultSchema = import_zod22.z.object({
4454
+ var TaskExecutionResultSchema = import_zod23.z.object({
4357
4455
  /**
4358
4456
  * Task identifier
4359
4457
  */
4360
- taskId: import_zod22.z.string().describe("Task identifier"),
4458
+ taskId: import_zod23.z.string().describe("Task identifier"),
4361
4459
  /**
4362
4460
  * Execution status
4363
4461
  */
@@ -4365,45 +4463,45 @@ var TaskExecutionResultSchema = import_zod22.z.object({
4365
4463
  /**
4366
4464
  * Execution result data
4367
4465
  */
4368
- result: import_zod22.z.any().optional().describe("Execution result data"),
4466
+ result: import_zod23.z.any().optional().describe("Execution result data"),
4369
4467
  /**
4370
4468
  * Error information
4371
4469
  */
4372
- error: import_zod22.z.object({
4373
- message: import_zod22.z.string().describe("Error message"),
4374
- stack: import_zod22.z.string().optional().describe("Error stack trace"),
4375
- code: import_zod22.z.string().optional().describe("Error code")
4470
+ error: import_zod23.z.object({
4471
+ message: import_zod23.z.string().describe("Error message"),
4472
+ stack: import_zod23.z.string().optional().describe("Error stack trace"),
4473
+ code: import_zod23.z.string().optional().describe("Error code")
4376
4474
  }).optional().describe("Error details if failed"),
4377
4475
  /**
4378
4476
  * Execution duration
4379
4477
  */
4380
- durationMs: import_zod22.z.number().int().optional().describe("Execution duration in milliseconds"),
4478
+ durationMs: import_zod23.z.number().int().optional().describe("Execution duration in milliseconds"),
4381
4479
  /**
4382
4480
  * Execution timestamps
4383
4481
  */
4384
- startedAt: import_zod22.z.string().datetime().describe("When execution started"),
4385
- completedAt: import_zod22.z.string().datetime().optional().describe("When execution completed"),
4482
+ startedAt: import_zod23.z.string().datetime().describe("When execution started"),
4483
+ completedAt: import_zod23.z.string().datetime().optional().describe("When execution completed"),
4386
4484
  /**
4387
4485
  * Retry information
4388
4486
  */
4389
- attempt: import_zod22.z.number().int().min(1).describe("Attempt number (1-indexed)"),
4390
- willRetry: import_zod22.z.boolean().describe("Whether task will be retried")
4487
+ attempt: import_zod23.z.number().int().min(1).describe("Attempt number (1-indexed)"),
4488
+ willRetry: import_zod23.z.boolean().describe("Whether task will be retried")
4391
4489
  });
4392
- var QueueConfigSchema = import_zod22.z.object({
4490
+ var QueueConfigSchema = import_zod23.z.object({
4393
4491
  /**
4394
4492
  * Queue name
4395
4493
  */
4396
- name: import_zod22.z.string().describe("Queue name (snake_case)"),
4494
+ name: import_zod23.z.string().describe("Queue name (snake_case)"),
4397
4495
  /**
4398
4496
  * Maximum concurrent workers
4399
4497
  */
4400
- concurrency: import_zod22.z.number().int().min(1).default(5).describe("Max concurrent task executions"),
4498
+ concurrency: import_zod23.z.number().int().min(1).default(5).describe("Max concurrent task executions"),
4401
4499
  /**
4402
4500
  * Rate limiting
4403
4501
  */
4404
- rateLimit: import_zod22.z.object({
4405
- max: import_zod22.z.number().int().positive().describe("Maximum tasks per duration"),
4406
- duration: import_zod22.z.number().int().positive().describe("Duration in milliseconds")
4502
+ rateLimit: import_zod23.z.object({
4503
+ max: import_zod23.z.number().int().positive().describe("Maximum tasks per duration"),
4504
+ duration: import_zod23.z.number().int().positive().describe("Duration in milliseconds")
4407
4505
  }).optional().describe("Rate limit configuration"),
4408
4506
  /**
4409
4507
  * Default retry policy
@@ -4412,43 +4510,43 @@ var QueueConfigSchema = import_zod22.z.object({
4412
4510
  /**
4413
4511
  * Dead letter queue
4414
4512
  */
4415
- deadLetterQueue: import_zod22.z.string().optional().describe("Dead letter queue name"),
4513
+ deadLetterQueue: import_zod23.z.string().optional().describe("Dead letter queue name"),
4416
4514
  /**
4417
4515
  * Queue priority
4418
4516
  */
4419
- priority: import_zod22.z.number().int().min(0).default(0).describe("Queue priority (lower = higher priority)"),
4517
+ priority: import_zod23.z.number().int().min(0).default(0).describe("Queue priority (lower = higher priority)"),
4420
4518
  /**
4421
4519
  * Auto-scaling configuration
4422
4520
  */
4423
- autoScale: import_zod22.z.object({
4424
- enabled: import_zod22.z.boolean().default(false).describe("Enable auto-scaling"),
4425
- minWorkers: import_zod22.z.number().int().min(1).default(1).describe("Minimum workers"),
4426
- maxWorkers: import_zod22.z.number().int().min(1).default(10).describe("Maximum workers"),
4427
- scaleUpThreshold: import_zod22.z.number().int().positive().default(100).describe("Queue size to scale up"),
4428
- scaleDownThreshold: import_zod22.z.number().int().min(0).default(10).describe("Queue size to scale down")
4521
+ autoScale: import_zod23.z.object({
4522
+ enabled: import_zod23.z.boolean().default(false).describe("Enable auto-scaling"),
4523
+ minWorkers: import_zod23.z.number().int().min(1).default(1).describe("Minimum workers"),
4524
+ maxWorkers: import_zod23.z.number().int().min(1).default(10).describe("Maximum workers"),
4525
+ scaleUpThreshold: import_zod23.z.number().int().positive().default(100).describe("Queue size to scale up"),
4526
+ scaleDownThreshold: import_zod23.z.number().int().min(0).default(10).describe("Queue size to scale down")
4429
4527
  }).optional().describe("Auto-scaling configuration")
4430
4528
  });
4431
- var BatchTaskSchema = import_zod22.z.object({
4529
+ var BatchTaskSchema = import_zod23.z.object({
4432
4530
  /**
4433
4531
  * Batch job identifier
4434
4532
  */
4435
- id: import_zod22.z.string().describe("Unique batch job identifier"),
4533
+ id: import_zod23.z.string().describe("Unique batch job identifier"),
4436
4534
  /**
4437
4535
  * Task type for processing each item
4438
4536
  */
4439
- type: import_zod22.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Task type (snake_case)"),
4537
+ type: import_zod23.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Task type (snake_case)"),
4440
4538
  /**
4441
4539
  * Items to process
4442
4540
  */
4443
- items: import_zod22.z.array(import_zod22.z.any()).describe("Array of items to process"),
4541
+ items: import_zod23.z.array(import_zod23.z.any()).describe("Array of items to process"),
4444
4542
  /**
4445
4543
  * Batch size (items per task)
4446
4544
  */
4447
- batchSize: import_zod22.z.number().int().min(1).default(100).describe("Number of items per batch"),
4545
+ batchSize: import_zod23.z.number().int().min(1).default(100).describe("Number of items per batch"),
4448
4546
  /**
4449
4547
  * Queue name
4450
4548
  */
4451
- queue: import_zod22.z.string().default("batch").describe("Queue for batch tasks"),
4549
+ queue: import_zod23.z.string().default("batch").describe("Queue for batch tasks"),
4452
4550
  /**
4453
4551
  * Priority
4454
4552
  */
@@ -4456,11 +4554,11 @@ var BatchTaskSchema = import_zod22.z.object({
4456
4554
  /**
4457
4555
  * Parallel processing
4458
4556
  */
4459
- parallel: import_zod22.z.boolean().default(true).describe("Process batches in parallel"),
4557
+ parallel: import_zod23.z.boolean().default(true).describe("Process batches in parallel"),
4460
4558
  /**
4461
4559
  * Stop on error
4462
4560
  */
4463
- stopOnError: import_zod22.z.boolean().default(false).describe("Stop batch if any item fails"),
4561
+ stopOnError: import_zod23.z.boolean().default(false).describe("Stop batch if any item fails"),
4464
4562
  /**
4465
4563
  * Progress callback
4466
4564
  *
@@ -4470,118 +4568,118 @@ var BatchTaskSchema = import_zod22.z.object({
4470
4568
  *
4471
4569
  * @param progress - Object containing processed count, total count, and failed count
4472
4570
  */
4473
- onProgress: import_zod22.z.function().args(import_zod22.z.object({
4474
- processed: import_zod22.z.number(),
4475
- total: import_zod22.z.number(),
4476
- failed: import_zod22.z.number()
4477
- })).returns(import_zod22.z.void()).optional().describe("Progress callback function (called after each batch)")
4571
+ onProgress: import_zod23.z.function().args(import_zod23.z.object({
4572
+ processed: import_zod23.z.number(),
4573
+ total: import_zod23.z.number(),
4574
+ failed: import_zod23.z.number()
4575
+ })).returns(import_zod23.z.void()).optional().describe("Progress callback function (called after each batch)")
4478
4576
  });
4479
- var BatchProgressSchema = import_zod22.z.object({
4577
+ var BatchProgressSchema = import_zod23.z.object({
4480
4578
  /**
4481
4579
  * Batch job identifier
4482
4580
  */
4483
- batchId: import_zod22.z.string().describe("Batch job identifier"),
4581
+ batchId: import_zod23.z.string().describe("Batch job identifier"),
4484
4582
  /**
4485
4583
  * Total items
4486
4584
  */
4487
- total: import_zod22.z.number().int().min(0).describe("Total number of items"),
4585
+ total: import_zod23.z.number().int().min(0).describe("Total number of items"),
4488
4586
  /**
4489
4587
  * Processed items
4490
4588
  */
4491
- processed: import_zod22.z.number().int().min(0).default(0).describe("Items processed"),
4589
+ processed: import_zod23.z.number().int().min(0).default(0).describe("Items processed"),
4492
4590
  /**
4493
4591
  * Successful items
4494
4592
  */
4495
- succeeded: import_zod22.z.number().int().min(0).default(0).describe("Items succeeded"),
4593
+ succeeded: import_zod23.z.number().int().min(0).default(0).describe("Items succeeded"),
4496
4594
  /**
4497
4595
  * Failed items
4498
4596
  */
4499
- failed: import_zod22.z.number().int().min(0).default(0).describe("Items failed"),
4597
+ failed: import_zod23.z.number().int().min(0).default(0).describe("Items failed"),
4500
4598
  /**
4501
4599
  * Progress percentage
4502
4600
  */
4503
- percentage: import_zod22.z.number().min(0).max(100).describe("Progress percentage"),
4601
+ percentage: import_zod23.z.number().min(0).max(100).describe("Progress percentage"),
4504
4602
  /**
4505
4603
  * Status
4506
4604
  */
4507
- status: import_zod22.z.enum(["pending", "running", "completed", "failed", "cancelled"]).describe("Batch status"),
4605
+ status: import_zod23.z.enum(["pending", "running", "completed", "failed", "cancelled"]).describe("Batch status"),
4508
4606
  /**
4509
4607
  * Timestamps
4510
4608
  */
4511
- startedAt: import_zod22.z.string().datetime().optional().describe("When batch started"),
4512
- completedAt: import_zod22.z.string().datetime().optional().describe("When batch completed")
4609
+ startedAt: import_zod23.z.string().datetime().optional().describe("When batch started"),
4610
+ completedAt: import_zod23.z.string().datetime().optional().describe("When batch completed")
4513
4611
  });
4514
- var WorkerConfigSchema = import_zod22.z.object({
4612
+ var WorkerConfigSchema = import_zod23.z.object({
4515
4613
  /**
4516
4614
  * Worker name
4517
4615
  */
4518
- name: import_zod22.z.string().describe("Worker name"),
4616
+ name: import_zod23.z.string().describe("Worker name"),
4519
4617
  /**
4520
4618
  * Queues to process
4521
4619
  */
4522
- queues: import_zod22.z.array(import_zod22.z.string()).min(1).describe("Queue names to process"),
4620
+ queues: import_zod23.z.array(import_zod23.z.string()).min(1).describe("Queue names to process"),
4523
4621
  /**
4524
4622
  * Queue configurations
4525
4623
  */
4526
- queueConfigs: import_zod22.z.array(QueueConfigSchema).optional().describe("Queue configurations"),
4624
+ queueConfigs: import_zod23.z.array(QueueConfigSchema).optional().describe("Queue configurations"),
4527
4625
  /**
4528
4626
  * Polling interval
4529
4627
  */
4530
- pollIntervalMs: import_zod22.z.number().int().positive().default(1e3).describe("Queue polling interval in milliseconds"),
4628
+ pollIntervalMs: import_zod23.z.number().int().positive().default(1e3).describe("Queue polling interval in milliseconds"),
4531
4629
  /**
4532
4630
  * Visibility timeout
4533
4631
  */
4534
- visibilityTimeoutMs: import_zod22.z.number().int().positive().default(3e4).describe("How long a task is invisible after being claimed"),
4632
+ visibilityTimeoutMs: import_zod23.z.number().int().positive().default(3e4).describe("How long a task is invisible after being claimed"),
4535
4633
  /**
4536
4634
  * Task timeout
4537
4635
  */
4538
- defaultTimeoutMs: import_zod22.z.number().int().positive().default(3e5).describe("Default task timeout in milliseconds"),
4636
+ defaultTimeoutMs: import_zod23.z.number().int().positive().default(3e5).describe("Default task timeout in milliseconds"),
4539
4637
  /**
4540
4638
  * Graceful shutdown timeout
4541
4639
  */
4542
- shutdownTimeoutMs: import_zod22.z.number().int().positive().default(3e4).describe("Graceful shutdown timeout in milliseconds"),
4640
+ shutdownTimeoutMs: import_zod23.z.number().int().positive().default(3e4).describe("Graceful shutdown timeout in milliseconds"),
4543
4641
  /**
4544
4642
  * Task handlers
4545
4643
  */
4546
- handlers: import_zod22.z.record(import_zod22.z.string(), import_zod22.z.function()).optional().describe("Task type handlers")
4644
+ handlers: import_zod23.z.record(import_zod23.z.string(), import_zod23.z.function()).optional().describe("Task type handlers")
4547
4645
  });
4548
- var WorkerStatsSchema = import_zod22.z.object({
4646
+ var WorkerStatsSchema = import_zod23.z.object({
4549
4647
  /**
4550
4648
  * Worker name
4551
4649
  */
4552
- workerName: import_zod22.z.string().describe("Worker name"),
4650
+ workerName: import_zod23.z.string().describe("Worker name"),
4553
4651
  /**
4554
4652
  * Total tasks processed
4555
4653
  */
4556
- totalProcessed: import_zod22.z.number().int().min(0).describe("Total tasks processed"),
4654
+ totalProcessed: import_zod23.z.number().int().min(0).describe("Total tasks processed"),
4557
4655
  /**
4558
4656
  * Successful tasks
4559
4657
  */
4560
- succeeded: import_zod22.z.number().int().min(0).describe("Successful tasks"),
4658
+ succeeded: import_zod23.z.number().int().min(0).describe("Successful tasks"),
4561
4659
  /**
4562
4660
  * Failed tasks
4563
4661
  */
4564
- failed: import_zod22.z.number().int().min(0).describe("Failed tasks"),
4662
+ failed: import_zod23.z.number().int().min(0).describe("Failed tasks"),
4565
4663
  /**
4566
4664
  * Active tasks
4567
4665
  */
4568
- active: import_zod22.z.number().int().min(0).describe("Currently active tasks"),
4666
+ active: import_zod23.z.number().int().min(0).describe("Currently active tasks"),
4569
4667
  /**
4570
4668
  * Average execution time
4571
4669
  */
4572
- avgExecutionMs: import_zod22.z.number().min(0).optional().describe("Average execution time in milliseconds"),
4670
+ avgExecutionMs: import_zod23.z.number().min(0).optional().describe("Average execution time in milliseconds"),
4573
4671
  /**
4574
4672
  * Uptime
4575
4673
  */
4576
- uptimeMs: import_zod22.z.number().int().min(0).describe("Worker uptime in milliseconds"),
4674
+ uptimeMs: import_zod23.z.number().int().min(0).describe("Worker uptime in milliseconds"),
4577
4675
  /**
4578
4676
  * Queue stats
4579
4677
  */
4580
- queues: import_zod22.z.record(import_zod22.z.string(), import_zod22.z.object({
4581
- pending: import_zod22.z.number().int().min(0).describe("Pending tasks"),
4582
- active: import_zod22.z.number().int().min(0).describe("Active tasks"),
4583
- completed: import_zod22.z.number().int().min(0).describe("Completed tasks"),
4584
- failed: import_zod22.z.number().int().min(0).describe("Failed tasks")
4678
+ queues: import_zod23.z.record(import_zod23.z.string(), import_zod23.z.object({
4679
+ pending: import_zod23.z.number().int().min(0).describe("Pending tasks"),
4680
+ active: import_zod23.z.number().int().min(0).describe("Active tasks"),
4681
+ completed: import_zod23.z.number().int().min(0).describe("Completed tasks"),
4682
+ failed: import_zod23.z.number().int().min(0).describe("Failed tasks")
4585
4683
  })).optional().describe("Per-queue statistics")
4586
4684
  });
4587
4685
  var Task = Object.assign(TaskSchema, {
@@ -4598,113 +4696,113 @@ var BatchTask = Object.assign(BatchTaskSchema, {
4598
4696
  });
4599
4697
 
4600
4698
  // src/system/notification.zod.ts
4601
- var import_zod23 = require("zod");
4602
- var EmailTemplateSchema = import_zod23.z.object({
4699
+ var import_zod24 = require("zod");
4700
+ var EmailTemplateSchema = import_zod24.z.object({
4603
4701
  /**
4604
4702
  * Unique identifier for the email template
4605
4703
  */
4606
- id: import_zod23.z.string().describe("Template identifier"),
4704
+ id: import_zod24.z.string().describe("Template identifier"),
4607
4705
  /**
4608
4706
  * Email subject line (supports variable interpolation)
4609
4707
  */
4610
- subject: import_zod23.z.string().describe("Email subject"),
4708
+ subject: import_zod24.z.string().describe("Email subject"),
4611
4709
  /**
4612
4710
  * Email body content
4613
4711
  */
4614
- body: import_zod23.z.string().describe("Email body content"),
4712
+ body: import_zod24.z.string().describe("Email body content"),
4615
4713
  /**
4616
4714
  * Content type of the email body
4617
4715
  * @default 'html'
4618
4716
  */
4619
- bodyType: import_zod23.z.enum(["text", "html", "markdown"]).optional().default("html").describe("Body content type"),
4717
+ bodyType: import_zod24.z.enum(["text", "html", "markdown"]).optional().default("html").describe("Body content type"),
4620
4718
  /**
4621
4719
  * List of template variables for dynamic content
4622
4720
  */
4623
- variables: import_zod23.z.array(import_zod23.z.string()).optional().describe("Template variables"),
4721
+ variables: import_zod24.z.array(import_zod24.z.string()).optional().describe("Template variables"),
4624
4722
  /**
4625
4723
  * File attachments to include with the email
4626
4724
  */
4627
- attachments: import_zod23.z.array(import_zod23.z.object({
4628
- name: import_zod23.z.string().describe("Attachment filename"),
4629
- url: import_zod23.z.string().url().describe("Attachment URL")
4725
+ attachments: import_zod24.z.array(import_zod24.z.object({
4726
+ name: import_zod24.z.string().describe("Attachment filename"),
4727
+ url: import_zod24.z.string().url().describe("Attachment URL")
4630
4728
  })).optional().describe("Email attachments")
4631
4729
  });
4632
- var SMSTemplateSchema = import_zod23.z.object({
4730
+ var SMSTemplateSchema = import_zod24.z.object({
4633
4731
  /**
4634
4732
  * Unique identifier for the SMS template
4635
4733
  */
4636
- id: import_zod23.z.string().describe("Template identifier"),
4734
+ id: import_zod24.z.string().describe("Template identifier"),
4637
4735
  /**
4638
4736
  * SMS message content (supports variable interpolation)
4639
4737
  */
4640
- message: import_zod23.z.string().describe("SMS message content"),
4738
+ message: import_zod24.z.string().describe("SMS message content"),
4641
4739
  /**
4642
4740
  * Maximum character length for the SMS
4643
4741
  * @default 160
4644
4742
  */
4645
- maxLength: import_zod23.z.number().optional().default(160).describe("Maximum message length"),
4743
+ maxLength: import_zod24.z.number().optional().default(160).describe("Maximum message length"),
4646
4744
  /**
4647
4745
  * List of template variables for dynamic content
4648
4746
  */
4649
- variables: import_zod23.z.array(import_zod23.z.string()).optional().describe("Template variables")
4747
+ variables: import_zod24.z.array(import_zod24.z.string()).optional().describe("Template variables")
4650
4748
  });
4651
- var PushNotificationSchema = import_zod23.z.object({
4749
+ var PushNotificationSchema = import_zod24.z.object({
4652
4750
  /**
4653
4751
  * Notification title
4654
4752
  */
4655
- title: import_zod23.z.string().describe("Notification title"),
4753
+ title: import_zod24.z.string().describe("Notification title"),
4656
4754
  /**
4657
4755
  * Notification body text
4658
4756
  */
4659
- body: import_zod23.z.string().describe("Notification body"),
4757
+ body: import_zod24.z.string().describe("Notification body"),
4660
4758
  /**
4661
4759
  * Icon URL to display with notification
4662
4760
  */
4663
- icon: import_zod23.z.string().url().optional().describe("Notification icon URL"),
4761
+ icon: import_zod24.z.string().url().optional().describe("Notification icon URL"),
4664
4762
  /**
4665
4763
  * Badge count to display on app icon
4666
4764
  */
4667
- badge: import_zod23.z.number().optional().describe("Badge count"),
4765
+ badge: import_zod24.z.number().optional().describe("Badge count"),
4668
4766
  /**
4669
4767
  * Custom data payload
4670
4768
  */
4671
- data: import_zod23.z.record(import_zod23.z.string(), import_zod23.z.any()).optional().describe("Custom data"),
4769
+ data: import_zod24.z.record(import_zod24.z.string(), import_zod24.z.any()).optional().describe("Custom data"),
4672
4770
  /**
4673
4771
  * Action buttons for the notification
4674
4772
  */
4675
- actions: import_zod23.z.array(import_zod23.z.object({
4676
- action: import_zod23.z.string().describe("Action identifier"),
4677
- title: import_zod23.z.string().describe("Action button title")
4773
+ actions: import_zod24.z.array(import_zod24.z.object({
4774
+ action: import_zod24.z.string().describe("Action identifier"),
4775
+ title: import_zod24.z.string().describe("Action button title")
4678
4776
  })).optional().describe("Notification actions")
4679
4777
  });
4680
- var InAppNotificationSchema = import_zod23.z.object({
4778
+ var InAppNotificationSchema = import_zod24.z.object({
4681
4779
  /**
4682
4780
  * Notification title
4683
4781
  */
4684
- title: import_zod23.z.string().describe("Notification title"),
4782
+ title: import_zod24.z.string().describe("Notification title"),
4685
4783
  /**
4686
4784
  * Notification message content
4687
4785
  */
4688
- message: import_zod23.z.string().describe("Notification message"),
4786
+ message: import_zod24.z.string().describe("Notification message"),
4689
4787
  /**
4690
4788
  * Notification severity type
4691
4789
  */
4692
- type: import_zod23.z.enum(["info", "success", "warning", "error"]).describe("Notification type"),
4790
+ type: import_zod24.z.enum(["info", "success", "warning", "error"]).describe("Notification type"),
4693
4791
  /**
4694
4792
  * Optional URL to navigate to when clicked
4695
4793
  */
4696
- actionUrl: import_zod23.z.string().optional().describe("Action URL"),
4794
+ actionUrl: import_zod24.z.string().optional().describe("Action URL"),
4697
4795
  /**
4698
4796
  * Whether the notification can be dismissed by the user
4699
4797
  * @default true
4700
4798
  */
4701
- dismissible: import_zod23.z.boolean().optional().default(true).describe("User dismissible"),
4799
+ dismissible: import_zod24.z.boolean().optional().default(true).describe("User dismissible"),
4702
4800
  /**
4703
4801
  * Timestamp when notification expires (Unix milliseconds)
4704
4802
  */
4705
- expiresAt: import_zod23.z.number().optional().describe("Expiration timestamp")
4803
+ expiresAt: import_zod24.z.number().optional().describe("Expiration timestamp")
4706
4804
  });
4707
- var NotificationChannelSchema = import_zod23.z.enum([
4805
+ var NotificationChannelSchema = import_zod24.z.enum([
4708
4806
  "email",
4709
4807
  "sms",
4710
4808
  "push",
@@ -4713,15 +4811,15 @@ var NotificationChannelSchema = import_zod23.z.enum([
4713
4811
  "teams",
4714
4812
  "webhook"
4715
4813
  ]);
4716
- var NotificationConfigSchema = import_zod23.z.object({
4814
+ var NotificationConfigSchema = import_zod24.z.object({
4717
4815
  /**
4718
4816
  * Unique identifier for this notification configuration
4719
4817
  */
4720
- id: import_zod23.z.string().describe("Notification ID"),
4818
+ id: import_zod24.z.string().describe("Notification ID"),
4721
4819
  /**
4722
4820
  * Human-readable name for this notification
4723
4821
  */
4724
- name: import_zod23.z.string().describe("Notification name"),
4822
+ name: import_zod24.z.string().describe("Notification name"),
4725
4823
  /**
4726
4824
  * Delivery channel for the notification
4727
4825
  */
@@ -4729,7 +4827,7 @@ var NotificationConfigSchema = import_zod23.z.object({
4729
4827
  /**
4730
4828
  * Notification template based on channel type
4731
4829
  */
4732
- template: import_zod23.z.union([
4830
+ template: import_zod24.z.union([
4733
4831
  EmailTemplateSchema,
4734
4832
  SMSTemplateSchema,
4735
4833
  PushNotificationSchema,
@@ -4738,106 +4836,106 @@ var NotificationConfigSchema = import_zod23.z.object({
4738
4836
  /**
4739
4837
  * Recipient configuration
4740
4838
  */
4741
- recipients: import_zod23.z.object({
4839
+ recipients: import_zod24.z.object({
4742
4840
  /**
4743
4841
  * Primary recipients
4744
4842
  */
4745
- to: import_zod23.z.array(import_zod23.z.string()).describe("Primary recipients"),
4843
+ to: import_zod24.z.array(import_zod24.z.string()).describe("Primary recipients"),
4746
4844
  /**
4747
4845
  * CC recipients (email only)
4748
4846
  */
4749
- cc: import_zod23.z.array(import_zod23.z.string()).optional().describe("CC recipients"),
4847
+ cc: import_zod24.z.array(import_zod24.z.string()).optional().describe("CC recipients"),
4750
4848
  /**
4751
4849
  * BCC recipients (email only)
4752
4850
  */
4753
- bcc: import_zod23.z.array(import_zod23.z.string()).optional().describe("BCC recipients")
4851
+ bcc: import_zod24.z.array(import_zod24.z.string()).optional().describe("BCC recipients")
4754
4852
  }).describe("Recipients"),
4755
4853
  /**
4756
4854
  * Scheduling configuration
4757
4855
  */
4758
- schedule: import_zod23.z.object({
4856
+ schedule: import_zod24.z.object({
4759
4857
  /**
4760
4858
  * Scheduling type
4761
4859
  */
4762
- type: import_zod23.z.enum(["immediate", "delayed", "scheduled"]).describe("Schedule type"),
4860
+ type: import_zod24.z.enum(["immediate", "delayed", "scheduled"]).describe("Schedule type"),
4763
4861
  /**
4764
4862
  * Delay in milliseconds (for delayed type)
4765
4863
  */
4766
- delay: import_zod23.z.number().optional().describe("Delay in milliseconds"),
4864
+ delay: import_zod24.z.number().optional().describe("Delay in milliseconds"),
4767
4865
  /**
4768
4866
  * Scheduled send time (Unix timestamp in milliseconds)
4769
4867
  */
4770
- scheduledAt: import_zod23.z.number().optional().describe("Scheduled timestamp")
4868
+ scheduledAt: import_zod24.z.number().optional().describe("Scheduled timestamp")
4771
4869
  }).optional().describe("Scheduling"),
4772
4870
  /**
4773
4871
  * Retry policy for failed deliveries
4774
4872
  */
4775
- retryPolicy: import_zod23.z.object({
4873
+ retryPolicy: import_zod24.z.object({
4776
4874
  /**
4777
4875
  * Enable automatic retries
4778
4876
  * @default true
4779
4877
  */
4780
- enabled: import_zod23.z.boolean().optional().default(true).describe("Enable retries"),
4878
+ enabled: import_zod24.z.boolean().optional().default(true).describe("Enable retries"),
4781
4879
  /**
4782
4880
  * Maximum number of retry attempts
4783
4881
  * @default 3
4784
4882
  */
4785
- maxRetries: import_zod23.z.number().optional().default(3).describe("Max retry attempts"),
4883
+ maxRetries: import_zod24.z.number().optional().default(3).describe("Max retry attempts"),
4786
4884
  /**
4787
4885
  * Backoff strategy for retries
4788
4886
  */
4789
- backoffStrategy: import_zod23.z.enum(["exponential", "linear", "fixed"]).describe("Backoff strategy")
4887
+ backoffStrategy: import_zod24.z.enum(["exponential", "linear", "fixed"]).describe("Backoff strategy")
4790
4888
  }).optional().describe("Retry policy"),
4791
4889
  /**
4792
4890
  * Delivery tracking configuration
4793
4891
  */
4794
- tracking: import_zod23.z.object({
4892
+ tracking: import_zod24.z.object({
4795
4893
  /**
4796
4894
  * Track when emails are opened
4797
4895
  * @default false
4798
4896
  */
4799
- trackOpens: import_zod23.z.boolean().optional().default(false).describe("Track opens"),
4897
+ trackOpens: import_zod24.z.boolean().optional().default(false).describe("Track opens"),
4800
4898
  /**
4801
4899
  * Track when links are clicked
4802
4900
  * @default false
4803
4901
  */
4804
- trackClicks: import_zod23.z.boolean().optional().default(false).describe("Track clicks"),
4902
+ trackClicks: import_zod24.z.boolean().optional().default(false).describe("Track clicks"),
4805
4903
  /**
4806
4904
  * Track delivery status
4807
4905
  * @default true
4808
4906
  */
4809
- trackDelivery: import_zod23.z.boolean().optional().default(true).describe("Track delivery")
4907
+ trackDelivery: import_zod24.z.boolean().optional().default(true).describe("Track delivery")
4810
4908
  }).optional().describe("Tracking configuration")
4811
4909
  });
4812
4910
 
4813
4911
  // src/system/translation.zod.ts
4814
- var import_zod24 = require("zod");
4815
- var TranslationDataSchema = import_zod24.z.object({
4912
+ var import_zod25 = require("zod");
4913
+ var TranslationDataSchema = import_zod25.z.object({
4816
4914
  /** Object translations */
4817
- objects: import_zod24.z.record(import_zod24.z.string(), import_zod24.z.object({
4818
- label: import_zod24.z.string(),
4819
- pluralLabel: import_zod24.z.string().optional(),
4820
- fields: import_zod24.z.record(import_zod24.z.string(), import_zod24.z.object({
4821
- label: import_zod24.z.string().optional(),
4822
- help: import_zod24.z.string().optional(),
4823
- options: import_zod24.z.record(import_zod24.z.string(), import_zod24.z.string()).optional()
4915
+ objects: import_zod25.z.record(import_zod25.z.string(), import_zod25.z.object({
4916
+ label: import_zod25.z.string(),
4917
+ pluralLabel: import_zod25.z.string().optional(),
4918
+ fields: import_zod25.z.record(import_zod25.z.string(), import_zod25.z.object({
4919
+ label: import_zod25.z.string().optional(),
4920
+ help: import_zod25.z.string().optional(),
4921
+ options: import_zod25.z.record(import_zod25.z.string(), import_zod25.z.string()).optional()
4824
4922
  // Option value -> Label map
4825
4923
  })).optional()
4826
4924
  })).optional(),
4827
4925
  /** App/Menu translations */
4828
- apps: import_zod24.z.record(import_zod24.z.string(), import_zod24.z.object({
4829
- label: import_zod24.z.string(),
4830
- description: import_zod24.z.string().optional()
4926
+ apps: import_zod25.z.record(import_zod25.z.string(), import_zod25.z.object({
4927
+ label: import_zod25.z.string(),
4928
+ description: import_zod25.z.string().optional()
4831
4929
  })).optional(),
4832
4930
  /** UI Messages */
4833
- messages: import_zod24.z.record(import_zod24.z.string(), import_zod24.z.string()).optional()
4931
+ messages: import_zod25.z.record(import_zod25.z.string(), import_zod25.z.string()).optional()
4834
4932
  });
4835
- var LocaleSchema = import_zod24.z.string().describe("BCP-47 Language Tag (e.g. en-US, zh-CN)");
4836
- var TranslationBundleSchema = import_zod24.z.record(LocaleSchema, TranslationDataSchema);
4933
+ var LocaleSchema = import_zod25.z.string().describe("BCP-47 Language Tag (e.g. en-US, zh-CN)");
4934
+ var TranslationBundleSchema = import_zod25.z.record(LocaleSchema, TranslationDataSchema);
4837
4935
 
4838
4936
  // src/system/collaboration.zod.ts
4839
- var import_zod25 = require("zod");
4840
- var OTOperationType = import_zod25.z.enum([
4937
+ var import_zod26 = require("zod");
4938
+ var OTOperationType = import_zod26.z.enum([
4841
4939
  "insert",
4842
4940
  // Insert characters at position
4843
4941
  "delete",
@@ -4845,38 +4943,38 @@ var OTOperationType = import_zod25.z.enum([
4845
4943
  "retain"
4846
4944
  // Keep characters (used for composing operations)
4847
4945
  ]);
4848
- var OTComponentSchema = import_zod25.z.discriminatedUnion("type", [
4849
- import_zod25.z.object({
4850
- type: import_zod25.z.literal("insert"),
4851
- text: import_zod25.z.string().describe("Text to insert"),
4852
- attributes: import_zod25.z.record(import_zod25.z.string(), import_zod25.z.any()).optional().describe("Text formatting attributes (e.g., bold, italic)")
4946
+ var OTComponentSchema = import_zod26.z.discriminatedUnion("type", [
4947
+ import_zod26.z.object({
4948
+ type: import_zod26.z.literal("insert"),
4949
+ text: import_zod26.z.string().describe("Text to insert"),
4950
+ attributes: import_zod26.z.record(import_zod26.z.string(), import_zod26.z.any()).optional().describe("Text formatting attributes (e.g., bold, italic)")
4853
4951
  }),
4854
- import_zod25.z.object({
4855
- type: import_zod25.z.literal("delete"),
4856
- count: import_zod25.z.number().int().positive().describe("Number of characters to delete")
4952
+ import_zod26.z.object({
4953
+ type: import_zod26.z.literal("delete"),
4954
+ count: import_zod26.z.number().int().positive().describe("Number of characters to delete")
4857
4955
  }),
4858
- import_zod25.z.object({
4859
- type: import_zod25.z.literal("retain"),
4860
- count: import_zod25.z.number().int().positive().describe("Number of characters to retain"),
4861
- attributes: import_zod25.z.record(import_zod25.z.string(), import_zod25.z.any()).optional().describe("Attribute changes to apply")
4956
+ import_zod26.z.object({
4957
+ type: import_zod26.z.literal("retain"),
4958
+ count: import_zod26.z.number().int().positive().describe("Number of characters to retain"),
4959
+ attributes: import_zod26.z.record(import_zod26.z.string(), import_zod26.z.any()).optional().describe("Attribute changes to apply")
4862
4960
  })
4863
4961
  ]);
4864
- var OTOperationSchema = import_zod25.z.object({
4865
- operationId: import_zod25.z.string().uuid().describe("Unique operation identifier"),
4866
- documentId: import_zod25.z.string().describe("Document identifier"),
4867
- userId: import_zod25.z.string().describe("User who created the operation"),
4868
- sessionId: import_zod25.z.string().uuid().describe("Session identifier"),
4869
- components: import_zod25.z.array(OTComponentSchema).describe("Operation components"),
4870
- baseVersion: import_zod25.z.number().int().nonnegative().describe("Document version this operation is based on"),
4871
- timestamp: import_zod25.z.string().datetime().describe("ISO 8601 datetime when operation was created"),
4872
- metadata: import_zod25.z.record(import_zod25.z.string(), import_zod25.z.any()).optional().describe("Additional operation metadata")
4873
- });
4874
- var OTTransformResultSchema = import_zod25.z.object({
4962
+ var OTOperationSchema = import_zod26.z.object({
4963
+ operationId: import_zod26.z.string().uuid().describe("Unique operation identifier"),
4964
+ documentId: import_zod26.z.string().describe("Document identifier"),
4965
+ userId: import_zod26.z.string().describe("User who created the operation"),
4966
+ sessionId: import_zod26.z.string().uuid().describe("Session identifier"),
4967
+ components: import_zod26.z.array(OTComponentSchema).describe("Operation components"),
4968
+ baseVersion: import_zod26.z.number().int().nonnegative().describe("Document version this operation is based on"),
4969
+ timestamp: import_zod26.z.string().datetime().describe("ISO 8601 datetime when operation was created"),
4970
+ metadata: import_zod26.z.record(import_zod26.z.string(), import_zod26.z.any()).optional().describe("Additional operation metadata")
4971
+ });
4972
+ var OTTransformResultSchema = import_zod26.z.object({
4875
4973
  operation: OTOperationSchema.describe("Transformed operation"),
4876
- transformed: import_zod25.z.boolean().describe("Whether transformation was applied"),
4877
- conflicts: import_zod25.z.array(import_zod25.z.string()).optional().describe("Conflict descriptions if any")
4974
+ transformed: import_zod26.z.boolean().describe("Whether transformation was applied"),
4975
+ conflicts: import_zod26.z.array(import_zod26.z.string()).optional().describe("Conflict descriptions if any")
4878
4976
  });
4879
- var CRDTType = import_zod25.z.enum([
4977
+ var CRDTType = import_zod26.z.enum([
4880
4978
  "lww-register",
4881
4979
  // Last-Write-Wins Register
4882
4980
  "g-counter",
@@ -4896,74 +4994,74 @@ var CRDTType = import_zod25.z.enum([
4896
4994
  "json"
4897
4995
  // CRDT-based JSON (e.g., Automerge)
4898
4996
  ]);
4899
- var VectorClockSchema = import_zod25.z.object({
4900
- clock: import_zod25.z.record(import_zod25.z.string(), import_zod25.z.number().int().nonnegative()).describe("Map of replica ID to logical timestamp")
4901
- });
4902
- var LWWRegisterSchema = import_zod25.z.object({
4903
- type: import_zod25.z.literal("lww-register"),
4904
- value: import_zod25.z.any().describe("Current register value"),
4905
- timestamp: import_zod25.z.string().datetime().describe("ISO 8601 datetime of last write"),
4906
- replicaId: import_zod25.z.string().describe("ID of replica that performed last write"),
4997
+ var VectorClockSchema = import_zod26.z.object({
4998
+ clock: import_zod26.z.record(import_zod26.z.string(), import_zod26.z.number().int().nonnegative()).describe("Map of replica ID to logical timestamp")
4999
+ });
5000
+ var LWWRegisterSchema = import_zod26.z.object({
5001
+ type: import_zod26.z.literal("lww-register"),
5002
+ value: import_zod26.z.any().describe("Current register value"),
5003
+ timestamp: import_zod26.z.string().datetime().describe("ISO 8601 datetime of last write"),
5004
+ replicaId: import_zod26.z.string().describe("ID of replica that performed last write"),
4907
5005
  vectorClock: VectorClockSchema.optional().describe("Optional vector clock for causality tracking")
4908
5006
  });
4909
- var CounterOperationSchema = import_zod25.z.object({
4910
- replicaId: import_zod25.z.string().describe("Replica identifier"),
4911
- delta: import_zod25.z.number().int().describe("Change amount (positive for increment, negative for decrement)"),
4912
- timestamp: import_zod25.z.string().datetime().describe("ISO 8601 datetime of operation")
4913
- });
4914
- var GCounterSchema = import_zod25.z.object({
4915
- type: import_zod25.z.literal("g-counter"),
4916
- counts: import_zod25.z.record(import_zod25.z.string(), import_zod25.z.number().int().nonnegative()).describe("Map of replica ID to count")
4917
- });
4918
- var PNCounterSchema = import_zod25.z.object({
4919
- type: import_zod25.z.literal("pn-counter"),
4920
- positive: import_zod25.z.record(import_zod25.z.string(), import_zod25.z.number().int().nonnegative()).describe("Positive increments per replica"),
4921
- negative: import_zod25.z.record(import_zod25.z.string(), import_zod25.z.number().int().nonnegative()).describe("Negative increments per replica")
4922
- });
4923
- var ORSetElementSchema = import_zod25.z.object({
4924
- value: import_zod25.z.any().describe("Element value"),
4925
- timestamp: import_zod25.z.string().datetime().describe("Addition timestamp"),
4926
- replicaId: import_zod25.z.string().describe("Replica that added the element"),
4927
- uid: import_zod25.z.string().uuid().describe("Unique identifier for this addition"),
4928
- removed: import_zod25.z.boolean().optional().default(false).describe("Whether element has been removed")
4929
- });
4930
- var ORSetSchema = import_zod25.z.object({
4931
- type: import_zod25.z.literal("or-set"),
4932
- elements: import_zod25.z.array(ORSetElementSchema).describe("Set elements with metadata")
4933
- });
4934
- var TextCRDTOperationSchema = import_zod25.z.object({
4935
- operationId: import_zod25.z.string().uuid().describe("Unique operation identifier"),
4936
- replicaId: import_zod25.z.string().describe("Replica identifier"),
4937
- position: import_zod25.z.number().int().nonnegative().describe("Position in document"),
4938
- insert: import_zod25.z.string().optional().describe("Text to insert"),
4939
- delete: import_zod25.z.number().int().positive().optional().describe("Number of characters to delete"),
4940
- timestamp: import_zod25.z.string().datetime().describe("ISO 8601 datetime of operation"),
4941
- lamportTimestamp: import_zod25.z.number().int().nonnegative().describe("Lamport timestamp for ordering")
4942
- });
4943
- var TextCRDTStateSchema = import_zod25.z.object({
4944
- type: import_zod25.z.literal("text"),
4945
- documentId: import_zod25.z.string().describe("Document identifier"),
4946
- content: import_zod25.z.string().describe("Current text content"),
4947
- operations: import_zod25.z.array(TextCRDTOperationSchema).describe("History of operations"),
4948
- lamportClock: import_zod25.z.number().int().nonnegative().describe("Current Lamport clock value"),
5007
+ var CounterOperationSchema = import_zod26.z.object({
5008
+ replicaId: import_zod26.z.string().describe("Replica identifier"),
5009
+ delta: import_zod26.z.number().int().describe("Change amount (positive for increment, negative for decrement)"),
5010
+ timestamp: import_zod26.z.string().datetime().describe("ISO 8601 datetime of operation")
5011
+ });
5012
+ var GCounterSchema = import_zod26.z.object({
5013
+ type: import_zod26.z.literal("g-counter"),
5014
+ counts: import_zod26.z.record(import_zod26.z.string(), import_zod26.z.number().int().nonnegative()).describe("Map of replica ID to count")
5015
+ });
5016
+ var PNCounterSchema = import_zod26.z.object({
5017
+ type: import_zod26.z.literal("pn-counter"),
5018
+ positive: import_zod26.z.record(import_zod26.z.string(), import_zod26.z.number().int().nonnegative()).describe("Positive increments per replica"),
5019
+ negative: import_zod26.z.record(import_zod26.z.string(), import_zod26.z.number().int().nonnegative()).describe("Negative increments per replica")
5020
+ });
5021
+ var ORSetElementSchema = import_zod26.z.object({
5022
+ value: import_zod26.z.any().describe("Element value"),
5023
+ timestamp: import_zod26.z.string().datetime().describe("Addition timestamp"),
5024
+ replicaId: import_zod26.z.string().describe("Replica that added the element"),
5025
+ uid: import_zod26.z.string().uuid().describe("Unique identifier for this addition"),
5026
+ removed: import_zod26.z.boolean().optional().default(false).describe("Whether element has been removed")
5027
+ });
5028
+ var ORSetSchema = import_zod26.z.object({
5029
+ type: import_zod26.z.literal("or-set"),
5030
+ elements: import_zod26.z.array(ORSetElementSchema).describe("Set elements with metadata")
5031
+ });
5032
+ var TextCRDTOperationSchema = import_zod26.z.object({
5033
+ operationId: import_zod26.z.string().uuid().describe("Unique operation identifier"),
5034
+ replicaId: import_zod26.z.string().describe("Replica identifier"),
5035
+ position: import_zod26.z.number().int().nonnegative().describe("Position in document"),
5036
+ insert: import_zod26.z.string().optional().describe("Text to insert"),
5037
+ delete: import_zod26.z.number().int().positive().optional().describe("Number of characters to delete"),
5038
+ timestamp: import_zod26.z.string().datetime().describe("ISO 8601 datetime of operation"),
5039
+ lamportTimestamp: import_zod26.z.number().int().nonnegative().describe("Lamport timestamp for ordering")
5040
+ });
5041
+ var TextCRDTStateSchema = import_zod26.z.object({
5042
+ type: import_zod26.z.literal("text"),
5043
+ documentId: import_zod26.z.string().describe("Document identifier"),
5044
+ content: import_zod26.z.string().describe("Current text content"),
5045
+ operations: import_zod26.z.array(TextCRDTOperationSchema).describe("History of operations"),
5046
+ lamportClock: import_zod26.z.number().int().nonnegative().describe("Current Lamport clock value"),
4949
5047
  vectorClock: VectorClockSchema.describe("Vector clock for causality")
4950
5048
  });
4951
- var CRDTStateSchema = import_zod25.z.discriminatedUnion("type", [
5049
+ var CRDTStateSchema = import_zod26.z.discriminatedUnion("type", [
4952
5050
  LWWRegisterSchema,
4953
5051
  GCounterSchema,
4954
5052
  PNCounterSchema,
4955
5053
  ORSetSchema,
4956
5054
  TextCRDTStateSchema
4957
5055
  ]);
4958
- var CRDTMergeResultSchema = import_zod25.z.object({
5056
+ var CRDTMergeResultSchema = import_zod26.z.object({
4959
5057
  state: CRDTStateSchema.describe("Merged CRDT state"),
4960
- conflicts: import_zod25.z.array(import_zod25.z.object({
4961
- type: import_zod25.z.string().describe("Conflict type"),
4962
- description: import_zod25.z.string().describe("Conflict description"),
4963
- resolved: import_zod25.z.boolean().describe("Whether conflict was automatically resolved")
5058
+ conflicts: import_zod26.z.array(import_zod26.z.object({
5059
+ type: import_zod26.z.string().describe("Conflict type"),
5060
+ description: import_zod26.z.string().describe("Conflict description"),
5061
+ resolved: import_zod26.z.boolean().describe("Whether conflict was automatically resolved")
4964
5062
  })).optional().describe("Conflicts encountered during merge")
4965
5063
  });
4966
- var CursorColorPreset = import_zod25.z.enum([
5064
+ var CursorColorPreset = import_zod26.z.enum([
4967
5065
  "blue",
4968
5066
  "green",
4969
5067
  "red",
@@ -4975,49 +5073,49 @@ var CursorColorPreset = import_zod25.z.enum([
4975
5073
  "indigo",
4976
5074
  "cyan"
4977
5075
  ]);
4978
- var CursorStyleSchema = import_zod25.z.object({
4979
- color: import_zod25.z.union([CursorColorPreset, import_zod25.z.string()]).describe("Cursor color (preset or custom hex)"),
4980
- opacity: import_zod25.z.number().min(0).max(1).optional().default(1).describe("Cursor opacity (0-1)"),
4981
- label: import_zod25.z.string().optional().describe("Label to display with cursor (usually username)"),
4982
- showLabel: import_zod25.z.boolean().optional().default(true).describe("Whether to show label"),
4983
- pulseOnUpdate: import_zod25.z.boolean().optional().default(true).describe("Whether to pulse when cursor moves")
4984
- });
4985
- var CursorSelectionSchema = import_zod25.z.object({
4986
- anchor: import_zod25.z.object({
4987
- line: import_zod25.z.number().int().nonnegative().describe("Anchor line number"),
4988
- column: import_zod25.z.number().int().nonnegative().describe("Anchor column number")
5076
+ var CursorStyleSchema = import_zod26.z.object({
5077
+ color: import_zod26.z.union([CursorColorPreset, import_zod26.z.string()]).describe("Cursor color (preset or custom hex)"),
5078
+ opacity: import_zod26.z.number().min(0).max(1).optional().default(1).describe("Cursor opacity (0-1)"),
5079
+ label: import_zod26.z.string().optional().describe("Label to display with cursor (usually username)"),
5080
+ showLabel: import_zod26.z.boolean().optional().default(true).describe("Whether to show label"),
5081
+ pulseOnUpdate: import_zod26.z.boolean().optional().default(true).describe("Whether to pulse when cursor moves")
5082
+ });
5083
+ var CursorSelectionSchema = import_zod26.z.object({
5084
+ anchor: import_zod26.z.object({
5085
+ line: import_zod26.z.number().int().nonnegative().describe("Anchor line number"),
5086
+ column: import_zod26.z.number().int().nonnegative().describe("Anchor column number")
4989
5087
  }).describe("Selection anchor (start point)"),
4990
- focus: import_zod25.z.object({
4991
- line: import_zod25.z.number().int().nonnegative().describe("Focus line number"),
4992
- column: import_zod25.z.number().int().nonnegative().describe("Focus column number")
5088
+ focus: import_zod26.z.object({
5089
+ line: import_zod26.z.number().int().nonnegative().describe("Focus line number"),
5090
+ column: import_zod26.z.number().int().nonnegative().describe("Focus column number")
4993
5091
  }).describe("Selection focus (end point)"),
4994
- direction: import_zod25.z.enum(["forward", "backward"]).optional().describe("Selection direction")
4995
- });
4996
- var CollaborativeCursorSchema = import_zod25.z.object({
4997
- userId: import_zod25.z.string().describe("User identifier"),
4998
- sessionId: import_zod25.z.string().uuid().describe("Session identifier"),
4999
- documentId: import_zod25.z.string().describe("Document identifier"),
5000
- userName: import_zod25.z.string().describe("Display name of user"),
5001
- position: import_zod25.z.object({
5002
- line: import_zod25.z.number().int().nonnegative().describe("Cursor line number (0-indexed)"),
5003
- column: import_zod25.z.number().int().nonnegative().describe("Cursor column number (0-indexed)")
5092
+ direction: import_zod26.z.enum(["forward", "backward"]).optional().describe("Selection direction")
5093
+ });
5094
+ var CollaborativeCursorSchema = import_zod26.z.object({
5095
+ userId: import_zod26.z.string().describe("User identifier"),
5096
+ sessionId: import_zod26.z.string().uuid().describe("Session identifier"),
5097
+ documentId: import_zod26.z.string().describe("Document identifier"),
5098
+ userName: import_zod26.z.string().describe("Display name of user"),
5099
+ position: import_zod26.z.object({
5100
+ line: import_zod26.z.number().int().nonnegative().describe("Cursor line number (0-indexed)"),
5101
+ column: import_zod26.z.number().int().nonnegative().describe("Cursor column number (0-indexed)")
5004
5102
  }).describe("Current cursor position"),
5005
5103
  selection: CursorSelectionSchema.optional().describe("Current text selection"),
5006
5104
  style: CursorStyleSchema.describe("Visual style for this cursor"),
5007
- isTyping: import_zod25.z.boolean().optional().default(false).describe("Whether user is currently typing"),
5008
- lastUpdate: import_zod25.z.string().datetime().describe("ISO 8601 datetime of last cursor update"),
5009
- metadata: import_zod25.z.record(import_zod25.z.string(), import_zod25.z.any()).optional().describe("Additional cursor metadata")
5010
- });
5011
- var CursorUpdateSchema = import_zod25.z.object({
5012
- position: import_zod25.z.object({
5013
- line: import_zod25.z.number().int().nonnegative(),
5014
- column: import_zod25.z.number().int().nonnegative()
5105
+ isTyping: import_zod26.z.boolean().optional().default(false).describe("Whether user is currently typing"),
5106
+ lastUpdate: import_zod26.z.string().datetime().describe("ISO 8601 datetime of last cursor update"),
5107
+ metadata: import_zod26.z.record(import_zod26.z.string(), import_zod26.z.any()).optional().describe("Additional cursor metadata")
5108
+ });
5109
+ var CursorUpdateSchema = import_zod26.z.object({
5110
+ position: import_zod26.z.object({
5111
+ line: import_zod26.z.number().int().nonnegative(),
5112
+ column: import_zod26.z.number().int().nonnegative()
5015
5113
  }).optional().describe("Updated cursor position"),
5016
5114
  selection: CursorSelectionSchema.optional().describe("Updated selection"),
5017
- isTyping: import_zod25.z.boolean().optional().describe("Updated typing state"),
5018
- metadata: import_zod25.z.record(import_zod25.z.string(), import_zod25.z.any()).optional().describe("Updated metadata")
5115
+ isTyping: import_zod26.z.boolean().optional().describe("Updated typing state"),
5116
+ metadata: import_zod26.z.record(import_zod26.z.string(), import_zod26.z.any()).optional().describe("Updated metadata")
5019
5117
  });
5020
- var UserActivityStatus = import_zod25.z.enum([
5118
+ var UserActivityStatus = import_zod26.z.enum([
5021
5119
  "active",
5022
5120
  // User is actively editing
5023
5121
  "idle",
@@ -5027,48 +5125,48 @@ var UserActivityStatus = import_zod25.z.enum([
5027
5125
  "disconnected"
5028
5126
  // User is disconnected
5029
5127
  ]);
5030
- var AwarenessUserStateSchema = import_zod25.z.object({
5031
- userId: import_zod25.z.string().describe("User identifier"),
5032
- sessionId: import_zod25.z.string().uuid().describe("Session identifier"),
5033
- userName: import_zod25.z.string().describe("Display name"),
5034
- userAvatar: import_zod25.z.string().optional().describe("User avatar URL"),
5128
+ var AwarenessUserStateSchema = import_zod26.z.object({
5129
+ userId: import_zod26.z.string().describe("User identifier"),
5130
+ sessionId: import_zod26.z.string().uuid().describe("Session identifier"),
5131
+ userName: import_zod26.z.string().describe("Display name"),
5132
+ userAvatar: import_zod26.z.string().optional().describe("User avatar URL"),
5035
5133
  status: UserActivityStatus.describe("Current activity status"),
5036
- currentDocument: import_zod25.z.string().optional().describe("Document ID user is currently editing"),
5037
- currentView: import_zod25.z.string().optional().describe("Current view/page user is on"),
5038
- lastActivity: import_zod25.z.string().datetime().describe("ISO 8601 datetime of last activity"),
5039
- joinedAt: import_zod25.z.string().datetime().describe("ISO 8601 datetime when user joined session"),
5040
- permissions: import_zod25.z.array(import_zod25.z.string()).optional().describe("User permissions in this session"),
5041
- metadata: import_zod25.z.record(import_zod25.z.string(), import_zod25.z.any()).optional().describe("Additional user state metadata")
5042
- });
5043
- var AwarenessSessionSchema = import_zod25.z.object({
5044
- sessionId: import_zod25.z.string().uuid().describe("Session identifier"),
5045
- documentId: import_zod25.z.string().optional().describe("Document ID this session is for"),
5046
- users: import_zod25.z.array(AwarenessUserStateSchema).describe("Active users in session"),
5047
- startedAt: import_zod25.z.string().datetime().describe("ISO 8601 datetime when session started"),
5048
- lastUpdate: import_zod25.z.string().datetime().describe("ISO 8601 datetime of last update"),
5049
- metadata: import_zod25.z.record(import_zod25.z.string(), import_zod25.z.any()).optional().describe("Session metadata")
5050
- });
5051
- var AwarenessUpdateSchema = import_zod25.z.object({
5134
+ currentDocument: import_zod26.z.string().optional().describe("Document ID user is currently editing"),
5135
+ currentView: import_zod26.z.string().optional().describe("Current view/page user is on"),
5136
+ lastActivity: import_zod26.z.string().datetime().describe("ISO 8601 datetime of last activity"),
5137
+ joinedAt: import_zod26.z.string().datetime().describe("ISO 8601 datetime when user joined session"),
5138
+ permissions: import_zod26.z.array(import_zod26.z.string()).optional().describe("User permissions in this session"),
5139
+ metadata: import_zod26.z.record(import_zod26.z.string(), import_zod26.z.any()).optional().describe("Additional user state metadata")
5140
+ });
5141
+ var AwarenessSessionSchema = import_zod26.z.object({
5142
+ sessionId: import_zod26.z.string().uuid().describe("Session identifier"),
5143
+ documentId: import_zod26.z.string().optional().describe("Document ID this session is for"),
5144
+ users: import_zod26.z.array(AwarenessUserStateSchema).describe("Active users in session"),
5145
+ startedAt: import_zod26.z.string().datetime().describe("ISO 8601 datetime when session started"),
5146
+ lastUpdate: import_zod26.z.string().datetime().describe("ISO 8601 datetime of last update"),
5147
+ metadata: import_zod26.z.record(import_zod26.z.string(), import_zod26.z.any()).optional().describe("Session metadata")
5148
+ });
5149
+ var AwarenessUpdateSchema = import_zod26.z.object({
5052
5150
  status: UserActivityStatus.optional().describe("Updated status"),
5053
- currentDocument: import_zod25.z.string().optional().describe("Updated current document"),
5054
- currentView: import_zod25.z.string().optional().describe("Updated current view"),
5055
- metadata: import_zod25.z.record(import_zod25.z.string(), import_zod25.z.any()).optional().describe("Updated metadata")
5056
- });
5057
- var AwarenessEventSchema = import_zod25.z.object({
5058
- eventId: import_zod25.z.string().uuid().describe("Event identifier"),
5059
- sessionId: import_zod25.z.string().uuid().describe("Session identifier"),
5060
- eventType: import_zod25.z.enum([
5151
+ currentDocument: import_zod26.z.string().optional().describe("Updated current document"),
5152
+ currentView: import_zod26.z.string().optional().describe("Updated current view"),
5153
+ metadata: import_zod26.z.record(import_zod26.z.string(), import_zod26.z.any()).optional().describe("Updated metadata")
5154
+ });
5155
+ var AwarenessEventSchema = import_zod26.z.object({
5156
+ eventId: import_zod26.z.string().uuid().describe("Event identifier"),
5157
+ sessionId: import_zod26.z.string().uuid().describe("Session identifier"),
5158
+ eventType: import_zod26.z.enum([
5061
5159
  "user.joined",
5062
5160
  "user.left",
5063
5161
  "user.updated",
5064
5162
  "session.created",
5065
5163
  "session.ended"
5066
5164
  ]).describe("Type of awareness event"),
5067
- userId: import_zod25.z.string().optional().describe("User involved in event"),
5068
- timestamp: import_zod25.z.string().datetime().describe("ISO 8601 datetime of event"),
5069
- payload: import_zod25.z.any().describe("Event payload")
5165
+ userId: import_zod26.z.string().optional().describe("User involved in event"),
5166
+ timestamp: import_zod26.z.string().datetime().describe("ISO 8601 datetime of event"),
5167
+ payload: import_zod26.z.any().describe("Event payload")
5070
5168
  });
5071
- var CollaborationMode = import_zod25.z.enum([
5169
+ var CollaborationMode = import_zod26.z.enum([
5072
5170
  "ot",
5073
5171
  // Operational Transformation
5074
5172
  "crdt",
@@ -5078,36 +5176,36 @@ var CollaborationMode = import_zod25.z.enum([
5078
5176
  "hybrid"
5079
5177
  // Hybrid approach
5080
5178
  ]);
5081
- var CollaborationSessionConfigSchema = import_zod25.z.object({
5179
+ var CollaborationSessionConfigSchema = import_zod26.z.object({
5082
5180
  mode: CollaborationMode.describe("Collaboration mode to use"),
5083
- enableCursorSharing: import_zod25.z.boolean().optional().default(true).describe("Enable cursor sharing"),
5084
- enablePresence: import_zod25.z.boolean().optional().default(true).describe("Enable presence tracking"),
5085
- enableAwareness: import_zod25.z.boolean().optional().default(true).describe("Enable awareness state"),
5086
- maxUsers: import_zod25.z.number().int().positive().optional().describe("Maximum concurrent users"),
5087
- idleTimeout: import_zod25.z.number().int().positive().optional().default(3e5).describe("Idle timeout in milliseconds"),
5088
- conflictResolution: import_zod25.z.enum(["ot", "crdt", "manual"]).optional().default("ot").describe("Conflict resolution strategy"),
5089
- persistence: import_zod25.z.boolean().optional().default(true).describe("Enable operation persistence"),
5090
- snapshot: import_zod25.z.object({
5091
- enabled: import_zod25.z.boolean().describe("Enable periodic snapshots"),
5092
- interval: import_zod25.z.number().int().positive().describe("Snapshot interval in milliseconds")
5181
+ enableCursorSharing: import_zod26.z.boolean().optional().default(true).describe("Enable cursor sharing"),
5182
+ enablePresence: import_zod26.z.boolean().optional().default(true).describe("Enable presence tracking"),
5183
+ enableAwareness: import_zod26.z.boolean().optional().default(true).describe("Enable awareness state"),
5184
+ maxUsers: import_zod26.z.number().int().positive().optional().describe("Maximum concurrent users"),
5185
+ idleTimeout: import_zod26.z.number().int().positive().optional().default(3e5).describe("Idle timeout in milliseconds"),
5186
+ conflictResolution: import_zod26.z.enum(["ot", "crdt", "manual"]).optional().default("ot").describe("Conflict resolution strategy"),
5187
+ persistence: import_zod26.z.boolean().optional().default(true).describe("Enable operation persistence"),
5188
+ snapshot: import_zod26.z.object({
5189
+ enabled: import_zod26.z.boolean().describe("Enable periodic snapshots"),
5190
+ interval: import_zod26.z.number().int().positive().describe("Snapshot interval in milliseconds")
5093
5191
  }).optional().describe("Snapshot configuration")
5094
5192
  });
5095
- var CollaborationSessionSchema = import_zod25.z.object({
5096
- sessionId: import_zod25.z.string().uuid().describe("Session identifier"),
5097
- documentId: import_zod25.z.string().describe("Document identifier"),
5193
+ var CollaborationSessionSchema = import_zod26.z.object({
5194
+ sessionId: import_zod26.z.string().uuid().describe("Session identifier"),
5195
+ documentId: import_zod26.z.string().describe("Document identifier"),
5098
5196
  config: CollaborationSessionConfigSchema.describe("Session configuration"),
5099
- users: import_zod25.z.array(AwarenessUserStateSchema).describe("Active users"),
5100
- cursors: import_zod25.z.array(CollaborativeCursorSchema).describe("Active cursors"),
5101
- version: import_zod25.z.number().int().nonnegative().describe("Current document version"),
5102
- operations: import_zod25.z.array(import_zod25.z.union([OTOperationSchema, TextCRDTOperationSchema])).optional().describe("Recent operations"),
5103
- createdAt: import_zod25.z.string().datetime().describe("ISO 8601 datetime when session was created"),
5104
- lastActivity: import_zod25.z.string().datetime().describe("ISO 8601 datetime of last activity"),
5105
- status: import_zod25.z.enum(["active", "idle", "ended"]).describe("Session status")
5197
+ users: import_zod26.z.array(AwarenessUserStateSchema).describe("Active users"),
5198
+ cursors: import_zod26.z.array(CollaborativeCursorSchema).describe("Active cursors"),
5199
+ version: import_zod26.z.number().int().nonnegative().describe("Current document version"),
5200
+ operations: import_zod26.z.array(import_zod26.z.union([OTOperationSchema, TextCRDTOperationSchema])).optional().describe("Recent operations"),
5201
+ createdAt: import_zod26.z.string().datetime().describe("ISO 8601 datetime when session was created"),
5202
+ lastActivity: import_zod26.z.string().datetime().describe("ISO 8601 datetime of last activity"),
5203
+ status: import_zod26.z.enum(["active", "idle", "ended"]).describe("Session status")
5106
5204
  });
5107
5205
 
5108
5206
  // src/system/metadata-persistence.zod.ts
5109
- var import_zod26 = require("zod");
5110
- var MetadataScopeSchema = import_zod26.z.enum([
5207
+ var import_zod27 = require("zod");
5208
+ var MetadataScopeSchema = import_zod27.z.enum([
5111
5209
  "system",
5112
5210
  // Defined in Code (Files). Read-only at runtime. Upgraded via deployment.
5113
5211
  "platform",
@@ -5115,7 +5213,7 @@ var MetadataScopeSchema = import_zod26.z.enum([
5115
5213
  "user"
5116
5214
  // Defined in DB (Personal). User-configured. Overrides platform/system.
5117
5215
  ]);
5118
- var MetadataStateSchema = import_zod26.z.enum([
5216
+ var MetadataStateSchema = import_zod27.z.enum([
5119
5217
  "draft",
5120
5218
  // Work in progress, not active
5121
5219
  "active",
@@ -5125,24 +5223,24 @@ var MetadataStateSchema = import_zod26.z.enum([
5125
5223
  "deprecated"
5126
5224
  // Running but flagged for removal
5127
5225
  ]);
5128
- var MetadataRecordSchema = import_zod26.z.object({
5226
+ var MetadataRecordSchema = import_zod27.z.object({
5129
5227
  /** Primary Key (UUID) */
5130
- _id: import_zod26.z.string(),
5228
+ _id: import_zod27.z.string(),
5131
5229
  /**
5132
5230
  * Machine Name
5133
5231
  * The unique identifier used in code references (e.g. "account_list_view").
5134
5232
  */
5135
- name: import_zod26.z.string(),
5233
+ name: import_zod27.z.string(),
5136
5234
  /**
5137
5235
  * Metadata Type
5138
5236
  * e.g. "object", "view", "permission_set", "flow"
5139
5237
  */
5140
- type: import_zod26.z.string(),
5238
+ type: import_zod27.z.string(),
5141
5239
  /**
5142
5240
  * Namespace / Module
5143
5241
  * Groups metadata into packages (e.g. "crm", "finance", "core").
5144
5242
  */
5145
- namespace: import_zod26.z.string().default("default"),
5243
+ namespace: import_zod27.z.string().default("default"),
5146
5244
  /**
5147
5245
  * Ownership differentiation
5148
5246
  */
@@ -5152,24 +5250,24 @@ var MetadataRecordSchema = import_zod26.z.object({
5152
5250
  * Stores the actual configuration JSON.
5153
5251
  * This field holds the value of `ViewSchema`, `ObjectSchema`, etc.
5154
5252
  */
5155
- metadata: import_zod26.z.record(import_zod26.z.string(), import_zod26.z.any()),
5253
+ metadata: import_zod27.z.record(import_zod27.z.string(), import_zod27.z.any()),
5156
5254
  /**
5157
5255
  * Extension / Merge Strategy
5158
5256
  * If this record overrides a system record, how should it be applied?
5159
5257
  */
5160
- extends: import_zod26.z.string().optional().describe("Name of the parent metadata to extend/override"),
5161
- strategy: import_zod26.z.enum(["merge", "replace"]).default("merge"),
5258
+ extends: import_zod27.z.string().optional().describe("Name of the parent metadata to extend/override"),
5259
+ strategy: import_zod27.z.enum(["merge", "replace"]).default("merge"),
5162
5260
  /** Owner (for user-scope items) */
5163
- owner: import_zod26.z.string().optional(),
5261
+ owner: import_zod27.z.string().optional(),
5164
5262
  /** State */
5165
5263
  state: MetadataStateSchema.default("active"),
5166
5264
  /** Audit */
5167
- created_by: import_zod26.z.string().optional(),
5168
- created_at: import_zod26.z.date().optional(),
5169
- updated_by: import_zod26.z.string().optional(),
5170
- updated_at: import_zod26.z.date().optional()
5265
+ created_by: import_zod27.z.string().optional(),
5266
+ created_at: import_zod27.z.date().optional(),
5267
+ updated_by: import_zod27.z.string().optional(),
5268
+ updated_at: import_zod27.z.date().optional()
5171
5269
  });
5172
- var MetadataFormatSchema = import_zod26.z.enum([
5270
+ var MetadataFormatSchema = import_zod27.z.enum([
5173
5271
  "json",
5174
5272
  "yaml",
5175
5273
  "yml",
@@ -5179,120 +5277,120 @@ var MetadataFormatSchema = import_zod26.z.enum([
5179
5277
  "javascript"
5180
5278
  // Aliases
5181
5279
  ]);
5182
- var MetadataStatsSchema = import_zod26.z.object({
5183
- path: import_zod26.z.string().optional(),
5184
- size: import_zod26.z.number().optional(),
5185
- mtime: import_zod26.z.date().optional(),
5186
- hash: import_zod26.z.string().optional(),
5187
- etag: import_zod26.z.string().optional(),
5280
+ var MetadataStatsSchema = import_zod27.z.object({
5281
+ path: import_zod27.z.string().optional(),
5282
+ size: import_zod27.z.number().optional(),
5283
+ mtime: import_zod27.z.date().optional(),
5284
+ hash: import_zod27.z.string().optional(),
5285
+ etag: import_zod27.z.string().optional(),
5188
5286
  // Required by local cache
5189
- modifiedAt: import_zod26.z.date().optional(),
5287
+ modifiedAt: import_zod27.z.date().optional(),
5190
5288
  // Alias for mtime
5191
5289
  format: MetadataFormatSchema.optional()
5192
5290
  // Required for serialization
5193
5291
  });
5194
- var MetadataLoaderContractSchema = import_zod26.z.object({
5195
- name: import_zod26.z.string(),
5196
- protocol: import_zod26.z.string(),
5292
+ var MetadataLoaderContractSchema = import_zod27.z.object({
5293
+ name: import_zod27.z.string(),
5294
+ protocol: import_zod27.z.string(),
5197
5295
  // e.g. 'file:', 'http:', 's3:'
5198
- description: import_zod26.z.string().optional(),
5199
- supportedFormats: import_zod26.z.array(import_zod26.z.string()).optional(),
5200
- supportsWatch: import_zod26.z.boolean().optional(),
5201
- supportsWrite: import_zod26.z.boolean().optional(),
5202
- supportsCache: import_zod26.z.boolean().optional(),
5203
- capabilities: import_zod26.z.object({
5204
- read: import_zod26.z.boolean().default(true),
5205
- write: import_zod26.z.boolean().default(false),
5206
- watch: import_zod26.z.boolean().default(false),
5207
- list: import_zod26.z.boolean().default(true)
5296
+ description: import_zod27.z.string().optional(),
5297
+ supportedFormats: import_zod27.z.array(import_zod27.z.string()).optional(),
5298
+ supportsWatch: import_zod27.z.boolean().optional(),
5299
+ supportsWrite: import_zod27.z.boolean().optional(),
5300
+ supportsCache: import_zod27.z.boolean().optional(),
5301
+ capabilities: import_zod27.z.object({
5302
+ read: import_zod27.z.boolean().default(true),
5303
+ write: import_zod27.z.boolean().default(false),
5304
+ watch: import_zod27.z.boolean().default(false),
5305
+ list: import_zod27.z.boolean().default(true)
5208
5306
  })
5209
5307
  });
5210
- var MetadataLoadOptionsSchema = import_zod26.z.object({
5308
+ var MetadataLoadOptionsSchema = import_zod27.z.object({
5211
5309
  scope: MetadataScopeSchema.optional(),
5212
- namespace: import_zod26.z.string().optional(),
5213
- raw: import_zod26.z.boolean().optional().describe("Return raw file content instead of parsed JSON"),
5214
- cache: import_zod26.z.boolean().optional(),
5215
- useCache: import_zod26.z.boolean().optional(),
5310
+ namespace: import_zod27.z.string().optional(),
5311
+ raw: import_zod27.z.boolean().optional().describe("Return raw file content instead of parsed JSON"),
5312
+ cache: import_zod27.z.boolean().optional(),
5313
+ useCache: import_zod27.z.boolean().optional(),
5216
5314
  // Alias for cache
5217
- validate: import_zod26.z.boolean().optional(),
5218
- ifNoneMatch: import_zod26.z.string().optional(),
5315
+ validate: import_zod27.z.boolean().optional(),
5316
+ ifNoneMatch: import_zod27.z.string().optional(),
5219
5317
  // For caching
5220
- recursive: import_zod26.z.boolean().optional(),
5221
- limit: import_zod26.z.number().optional(),
5222
- patterns: import_zod26.z.array(import_zod26.z.string()).optional(),
5223
- loader: import_zod26.z.string().optional().describe("Specific loader to use (e.g. filesystem, database)")
5318
+ recursive: import_zod27.z.boolean().optional(),
5319
+ limit: import_zod27.z.number().optional(),
5320
+ patterns: import_zod27.z.array(import_zod27.z.string()).optional(),
5321
+ loader: import_zod27.z.string().optional().describe("Specific loader to use (e.g. filesystem, database)")
5224
5322
  });
5225
- var MetadataLoadResultSchema = import_zod26.z.object({
5226
- data: import_zod26.z.any(),
5323
+ var MetadataLoadResultSchema = import_zod27.z.object({
5324
+ data: import_zod27.z.any(),
5227
5325
  stats: MetadataStatsSchema.optional(),
5228
5326
  format: MetadataFormatSchema.optional(),
5229
- source: import_zod26.z.string().optional(),
5327
+ source: import_zod27.z.string().optional(),
5230
5328
  // File path or URL
5231
- fromCache: import_zod26.z.boolean().optional(),
5232
- etag: import_zod26.z.string().optional(),
5233
- notModified: import_zod26.z.boolean().optional(),
5234
- loadTime: import_zod26.z.number().optional()
5329
+ fromCache: import_zod27.z.boolean().optional(),
5330
+ etag: import_zod27.z.string().optional(),
5331
+ notModified: import_zod27.z.boolean().optional(),
5332
+ loadTime: import_zod27.z.number().optional()
5235
5333
  });
5236
- var MetadataSaveOptionsSchema = import_zod26.z.object({
5334
+ var MetadataSaveOptionsSchema = import_zod27.z.object({
5237
5335
  format: MetadataFormatSchema.optional(),
5238
- create: import_zod26.z.boolean().default(true),
5239
- overwrite: import_zod26.z.boolean().default(true),
5240
- path: import_zod26.z.string().optional(),
5241
- prettify: import_zod26.z.boolean().optional(),
5242
- indent: import_zod26.z.number().optional(),
5243
- sortKeys: import_zod26.z.boolean().optional(),
5244
- backup: import_zod26.z.boolean().optional(),
5245
- atomic: import_zod26.z.boolean().optional(),
5246
- loader: import_zod26.z.string().optional().describe("Specific loader to use (e.g. filesystem, database)")
5247
- });
5248
- var MetadataSaveResultSchema = import_zod26.z.object({
5249
- success: import_zod26.z.boolean(),
5250
- path: import_zod26.z.string().optional(),
5336
+ create: import_zod27.z.boolean().default(true),
5337
+ overwrite: import_zod27.z.boolean().default(true),
5338
+ path: import_zod27.z.string().optional(),
5339
+ prettify: import_zod27.z.boolean().optional(),
5340
+ indent: import_zod27.z.number().optional(),
5341
+ sortKeys: import_zod27.z.boolean().optional(),
5342
+ backup: import_zod27.z.boolean().optional(),
5343
+ atomic: import_zod27.z.boolean().optional(),
5344
+ loader: import_zod27.z.string().optional().describe("Specific loader to use (e.g. filesystem, database)")
5345
+ });
5346
+ var MetadataSaveResultSchema = import_zod27.z.object({
5347
+ success: import_zod27.z.boolean(),
5348
+ path: import_zod27.z.string().optional(),
5251
5349
  stats: MetadataStatsSchema.optional(),
5252
- etag: import_zod26.z.string().optional(),
5253
- size: import_zod26.z.number().optional(),
5254
- saveTime: import_zod26.z.number().optional(),
5255
- backupPath: import_zod26.z.string().optional()
5256
- });
5257
- var MetadataWatchEventSchema = import_zod26.z.object({
5258
- type: import_zod26.z.enum(["add", "change", "unlink", "added", "changed", "deleted"]),
5259
- path: import_zod26.z.string(),
5260
- name: import_zod26.z.string().optional(),
5350
+ etag: import_zod27.z.string().optional(),
5351
+ size: import_zod27.z.number().optional(),
5352
+ saveTime: import_zod27.z.number().optional(),
5353
+ backupPath: import_zod27.z.string().optional()
5354
+ });
5355
+ var MetadataWatchEventSchema = import_zod27.z.object({
5356
+ type: import_zod27.z.enum(["add", "change", "unlink", "added", "changed", "deleted"]),
5357
+ path: import_zod27.z.string(),
5358
+ name: import_zod27.z.string().optional(),
5261
5359
  stats: MetadataStatsSchema.optional(),
5262
- metadataType: import_zod26.z.string().optional(),
5263
- data: import_zod26.z.any().optional(),
5264
- timestamp: import_zod26.z.date().optional()
5265
- });
5266
- var MetadataCollectionInfoSchema = import_zod26.z.object({
5267
- type: import_zod26.z.string(),
5268
- count: import_zod26.z.number(),
5269
- namespaces: import_zod26.z.array(import_zod26.z.string())
5270
- });
5271
- var MetadataExportOptionsSchema = import_zod26.z.object({
5272
- types: import_zod26.z.array(import_zod26.z.string()).optional(),
5273
- namespaces: import_zod26.z.array(import_zod26.z.string()).optional(),
5274
- output: import_zod26.z.string().describe("Output directory or file"),
5360
+ metadataType: import_zod27.z.string().optional(),
5361
+ data: import_zod27.z.any().optional(),
5362
+ timestamp: import_zod27.z.date().optional()
5363
+ });
5364
+ var MetadataCollectionInfoSchema = import_zod27.z.object({
5365
+ type: import_zod27.z.string(),
5366
+ count: import_zod27.z.number(),
5367
+ namespaces: import_zod27.z.array(import_zod27.z.string())
5368
+ });
5369
+ var MetadataExportOptionsSchema = import_zod27.z.object({
5370
+ types: import_zod27.z.array(import_zod27.z.string()).optional(),
5371
+ namespaces: import_zod27.z.array(import_zod27.z.string()).optional(),
5372
+ output: import_zod27.z.string().describe("Output directory or file"),
5275
5373
  format: MetadataFormatSchema.default("json")
5276
5374
  });
5277
- var MetadataImportOptionsSchema = import_zod26.z.object({
5278
- source: import_zod26.z.string().describe("Input directory or file"),
5279
- strategy: import_zod26.z.enum(["merge", "replace", "skip"]).default("merge"),
5280
- validate: import_zod26.z.boolean().default(true)
5281
- });
5282
- var MetadataManagerConfigSchema = import_zod26.z.object({
5283
- loaders: import_zod26.z.array(import_zod26.z.any()).optional(),
5284
- watch: import_zod26.z.boolean().optional(),
5285
- cache: import_zod26.z.boolean().optional(),
5286
- basePath: import_zod26.z.string().optional(),
5287
- rootDir: import_zod26.z.string().optional(),
5288
- formats: import_zod26.z.array(MetadataFormatSchema).optional(),
5289
- watchOptions: import_zod26.z.any().optional()
5375
+ var MetadataImportOptionsSchema = import_zod27.z.object({
5376
+ source: import_zod27.z.string().describe("Input directory or file"),
5377
+ strategy: import_zod27.z.enum(["merge", "replace", "skip"]).default("merge"),
5378
+ validate: import_zod27.z.boolean().default(true)
5379
+ });
5380
+ var MetadataManagerConfigSchema = import_zod27.z.object({
5381
+ loaders: import_zod27.z.array(import_zod27.z.any()).optional(),
5382
+ watch: import_zod27.z.boolean().optional(),
5383
+ cache: import_zod27.z.boolean().optional(),
5384
+ basePath: import_zod27.z.string().optional(),
5385
+ rootDir: import_zod27.z.string().optional(),
5386
+ formats: import_zod27.z.array(MetadataFormatSchema).optional(),
5387
+ watchOptions: import_zod27.z.any().optional()
5290
5388
  // Chokidar options
5291
5389
  });
5292
5390
 
5293
5391
  // src/system/service-registry.zod.ts
5294
- var import_zod27 = require("zod");
5295
- var CoreServiceName = import_zod27.z.enum([
5392
+ var import_zod28 = require("zod");
5393
+ var CoreServiceName = import_zod28.z.enum([
5296
5394
  // Core Data & Metadata
5297
5395
  "metadata",
5298
5396
  // Object/Field Definitions
@@ -5325,7 +5423,7 @@ var CoreServiceName = import_zod27.z.enum([
5325
5423
  "notification"
5326
5424
  // Email/Push/SMS
5327
5425
  ]);
5328
- var ServiceCriticalitySchema = import_zod27.z.enum([
5426
+ var ServiceCriticalitySchema = import_zod28.z.enum([
5329
5427
  "required",
5330
5428
  // System fails to start if missing (Exit Code 1)
5331
5429
  "core",
@@ -5352,22 +5450,22 @@ var ServiceRequirementDef = {
5352
5450
  realtime: "optional",
5353
5451
  notification: "optional"
5354
5452
  };
5355
- var ServiceStatusSchema = import_zod27.z.object({
5453
+ var ServiceStatusSchema = import_zod28.z.object({
5356
5454
  name: CoreServiceName,
5357
- enabled: import_zod27.z.boolean(),
5358
- status: import_zod27.z.enum(["running", "stopped", "degraded", "initializing"]),
5359
- version: import_zod27.z.string().optional(),
5360
- provider: import_zod27.z.string().optional().describe('Implementation provider (e.g. "s3" for storage)'),
5361
- features: import_zod27.z.array(import_zod27.z.string()).optional().describe("List of supported sub-features")
5455
+ enabled: import_zod28.z.boolean(),
5456
+ status: import_zod28.z.enum(["running", "stopped", "degraded", "initializing"]),
5457
+ version: import_zod28.z.string().optional(),
5458
+ provider: import_zod28.z.string().optional().describe('Implementation provider (e.g. "s3" for storage)'),
5459
+ features: import_zod28.z.array(import_zod28.z.string()).optional().describe("List of supported sub-features")
5362
5460
  });
5363
- var KernelServiceMapSchema = import_zod27.z.record(
5461
+ var KernelServiceMapSchema = import_zod28.z.record(
5364
5462
  CoreServiceName,
5365
- import_zod27.z.any().describe("Service Instance implementing the protocol interface")
5463
+ import_zod28.z.any().describe("Service Instance implementing the protocol interface")
5366
5464
  );
5367
- var ServiceConfigSchema = import_zod27.z.object({
5368
- id: import_zod27.z.string(),
5465
+ var ServiceConfigSchema = import_zod28.z.object({
5466
+ id: import_zod28.z.string(),
5369
5467
  name: CoreServiceName,
5370
- options: import_zod27.z.record(import_zod27.z.string(), import_zod27.z.any()).optional()
5468
+ options: import_zod28.z.record(import_zod28.z.string(), import_zod28.z.any()).optional()
5371
5469
  });
5372
5470
  // Annotate the CommonJS export names for ESM import in node:
5373
5471
  0 && (module.exports = {