@objectstack/spec 1.0.11 → 1.1.0
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.
- package/README.md +41 -1
- package/dist/ai/index.d.mts +2 -1
- package/dist/ai/index.d.ts +2 -1
- package/dist/ai/index.js +2047 -1944
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/index.mjs +2047 -1944
- package/dist/ai/index.mjs.map +1 -1
- package/dist/api/index.d.mts +3 -1
- package/dist/api/index.d.ts +3 -1
- package/dist/api/index.js +2599 -2292
- package/dist/api/index.js.map +1 -1
- package/dist/api/index.mjs +2587 -2292
- package/dist/api/index.mjs.map +1 -1
- package/dist/automation/index.d.mts +2 -1
- package/dist/automation/index.d.ts +2 -1
- package/dist/automation/index.js +83 -0
- package/dist/automation/index.js.map +1 -1
- package/dist/automation/index.mjs +77 -0
- package/dist/automation/index.mjs.map +1 -1
- package/dist/contracts/index.d.mts +3 -2
- package/dist/contracts/index.d.ts +3 -2
- package/dist/data/index.d.mts +3 -2
- package/dist/data/index.d.ts +3 -2
- package/dist/data/index.js +658 -556
- package/dist/data/index.js.map +1 -1
- package/dist/data/index.mjs +656 -556
- package/dist/data/index.mjs.map +1 -1
- package/dist/{driver.zod-lfi00zVT.d.ts → driver.zod-CfGk9GYh.d.ts} +2164 -11
- package/dist/{driver.zod-BOM_Etco.d.mts → driver.zod-y1cX6R3c.d.mts} +2164 -11
- package/dist/hub/index.d.mts +1 -1
- package/dist/hub/index.d.ts +1 -1
- package/dist/hub/index.js +789 -724
- package/dist/hub/index.js.map +1 -1
- package/dist/hub/index.mjs +789 -724
- package/dist/hub/index.mjs.map +1 -1
- package/dist/{index-C67cfwmW.d.ts → index-B0Hf65bV.d.ts} +13 -5
- package/dist/{index-DLcySG7U.d.ts → index-B5pKM0My.d.ts} +335 -4370
- package/dist/{index-Os7lItRe.d.mts → index-BA022mg2.d.ts} +6178 -129
- package/dist/{index-B5-VbOKg.d.mts → index-BGeLoH2z.d.ts} +4251 -74
- package/dist/{index-CH5zloR3.d.ts → index-BwO__aqV.d.ts} +1 -1
- package/dist/{index-Dp7GFJ8V.d.mts → index-Cia3JPQ8.d.mts} +13 -5
- package/dist/{index-D12rNohm.d.mts → index-CpD1q1FP.d.ts} +35 -18
- package/dist/{index-Os7lItRe.d.ts → index-D5RSFPuB.d.mts} +6178 -129
- package/dist/{index-CU4m6noq.d.mts → index-DGjpaj0X.d.mts} +1 -1
- package/dist/{index-D12rNohm.d.ts → index-Dfn5VXl6.d.mts} +35 -18
- package/dist/{index-l6WIlmOD.d.mts → index-Dgybxlky.d.mts} +177 -158
- package/dist/{index-l6WIlmOD.d.ts → index-Dgybxlky.d.ts} +177 -158
- package/dist/{index-DLcySG7U.d.mts → index-Dpsk8PF4.d.mts} +335 -4370
- package/dist/{index-CyognKSZ.d.ts → index-DrNah5E0.d.ts} +1952 -6990
- package/dist/{index-DE_lJ11p.d.mts → index-OO84R20k.d.mts} +1952 -6990
- package/dist/{index-B5-VbOKg.d.ts → index-upA3Xt04.d.mts} +4251 -74
- package/dist/index.d.mts +8072 -1922
- package/dist/index.d.ts +8072 -1922
- package/dist/index.js +8563 -8249
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8563 -8249
- package/dist/index.mjs.map +1 -1
- package/dist/integration/index.d.mts +1 -1
- package/dist/integration/index.d.ts +1 -1
- package/dist/kernel/index.d.mts +2 -1
- package/dist/kernel/index.d.ts +2 -1
- package/dist/kernel/index.js +884 -684
- package/dist/kernel/index.js.map +1 -1
- package/dist/kernel/index.mjs +870 -684
- package/dist/kernel/index.mjs.map +1 -1
- package/dist/package-registry.zod-JMcOYNxM.d.mts +21119 -0
- package/dist/package-registry.zod-JMcOYNxM.d.ts +21119 -0
- package/dist/state-machine.zod-B-lFFSxQ.d.mts +285 -0
- package/dist/state-machine.zod-B-lFFSxQ.d.ts +285 -0
- package/dist/system/index.d.mts +2 -1
- package/dist/system/index.d.ts +2 -1
- package/dist/system/index.js +749 -651
- package/dist/system/index.js.map +1 -1
- package/dist/system/index.mjs +749 -651
- package/dist/system/index.mjs.map +1 -1
- package/dist/ui/index.d.mts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/json-schema/ai/Agent.json +499 -0
- package/json-schema/ai/DevOpsAgent.json +499 -0
- package/json-schema/ai/FeedbackLoop.json +2188 -186
- package/json-schema/ai/Resolution.json +2188 -186
- package/json-schema/api/ApiRoutes.json +4 -0
- package/json-schema/api/CompileManifestResponse.json +40 -10
- package/json-schema/api/DisablePackageRequest.json +18 -0
- package/json-schema/api/DisablePackageResponse.json +1521 -0
- package/json-schema/api/Discovery.json +4 -0
- package/json-schema/api/EnablePackageRequest.json +18 -0
- package/json-schema/api/EnablePackageResponse.json +1521 -0
- package/json-schema/api/GetDiscoveryResponse.json +4 -0
- package/json-schema/api/GetPackageRequest.json +18 -0
- package/json-schema/api/GetPackageResponse.json +1518 -0
- package/json-schema/api/InstallPackageRequest.json +1483 -0
- package/json-schema/api/InstallPackageResponse.json +1521 -0
- package/json-schema/api/ListPackagesRequest.json +42 -0
- package/json-schema/api/ListPackagesResponse.json +1525 -0
- package/json-schema/api/ObjectDefinitionResponse.json +1001 -0
- package/json-schema/api/ObjectStackProtocol.json +86 -1
- package/json-schema/api/RestApiConfig.json +5 -0
- package/json-schema/api/RestServerConfig.json +5 -0
- package/json-schema/api/UninstallPackageRequest.json +18 -0
- package/json-schema/api/UninstallPackageResponse.json +25 -0
- package/json-schema/automation/ActionRef.json +30 -0
- package/json-schema/automation/Event.json +24 -0
- package/json-schema/automation/Flow.json +1 -0
- package/json-schema/automation/FlowNode.json +1 -0
- package/json-schema/automation/FlowNodeAction.json +1 -0
- package/json-schema/automation/GuardRef.json +30 -0
- package/json-schema/automation/StateMachine.json +504 -0
- package/json-schema/automation/StateNode.json +324 -0
- package/json-schema/automation/Transition.json +73 -0
- package/json-schema/data/Object.json +1001 -0
- package/json-schema/data/ObjectExtension.json +2376 -0
- package/json-schema/data/ObjectOwnershipEnum.json +13 -0
- package/json-schema/hub/ComposerResponse.json +40 -10
- package/json-schema/kernel/DisablePackageRequest.json +18 -0
- package/json-schema/kernel/DisablePackageResponse.json +1521 -0
- package/json-schema/kernel/EnablePackageRequest.json +18 -0
- package/json-schema/kernel/EnablePackageResponse.json +1521 -0
- package/json-schema/kernel/EventBusConfig.json +15 -0
- package/json-schema/kernel/EventHandler.json +6 -0
- package/json-schema/kernel/EventPersistence.json +3 -0
- package/json-schema/kernel/EventRoute.json +3 -0
- package/json-schema/kernel/EventWebhookConfig.json +3 -0
- package/json-schema/kernel/GetPackageRequest.json +18 -0
- package/json-schema/kernel/GetPackageResponse.json +1518 -0
- package/json-schema/kernel/InstallPackageRequest.json +1483 -0
- package/json-schema/kernel/InstallPackageResponse.json +1521 -0
- package/json-schema/kernel/InstalledPackage.json +1509 -0
- package/json-schema/kernel/ListPackagesRequest.json +42 -0
- package/json-schema/kernel/ListPackagesResponse.json +1525 -0
- package/json-schema/kernel/Manifest.json +40 -10
- package/json-schema/kernel/PackageStatusEnum.json +16 -0
- package/json-schema/kernel/Plugin.json +5 -0
- package/json-schema/kernel/PluginContext.json +31 -7
- package/json-schema/kernel/PluginLifecycle.json +7 -1
- package/json-schema/kernel/RealTimeNotificationConfig.json +3 -0
- package/json-schema/kernel/UninstallPackageRequest.json +18 -0
- package/json-schema/kernel/UninstallPackageResponse.json +25 -0
- package/json-schema/system/ChangeSet.json +2188 -186
- package/json-schema/system/CreateObjectOperation.json +1001 -0
- package/json-schema/system/MigrationOperation.json +1001 -0
- package/package.json +29 -15
- package/prompts/create-new-project.md +37 -19
- package/dist/{index-I3piy4U4.d.mts → index-BmU_sD1f.d.mts} +8 -8
- package/dist/{index-CkhpsEUw.d.ts → index-BnXuc_HO.d.ts} +8 -8
- package/dist/{index-CIDI-8zR.d.mts → index-C_NTOcet.d.mts} +98 -98
- package/dist/{index-CIDI-8zR.d.ts → index-C_NTOcet.d.ts} +98 -98
package/dist/system/index.js
CHANGED
|
@@ -3433,7 +3433,7 @@ var ChangeRequestSchema = import_zod12.z.object({
|
|
|
3433
3433
|
});
|
|
3434
3434
|
|
|
3435
3435
|
// src/system/migration.zod.ts
|
|
3436
|
-
var
|
|
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
|
|
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 =
|
|
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 =
|
|
3985
|
+
var ObjectCapabilities = import_zod18.z.object({
|
|
3917
3986
|
/** Enable history tracking (Audit Trail) */
|
|
3918
|
-
trackHistory:
|
|
3987
|
+
trackHistory: import_zod18.z.boolean().default(false).describe("Enable field history tracking for audit compliance"),
|
|
3919
3988
|
/** Enable global search indexing */
|
|
3920
|
-
searchable:
|
|
3989
|
+
searchable: import_zod18.z.boolean().default(true).describe("Index records for global search"),
|
|
3921
3990
|
/** Enable REST/GraphQL API access */
|
|
3922
|
-
apiEnabled:
|
|
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:
|
|
3996
|
+
apiMethods: import_zod18.z.array(ApiMethod).optional().describe("Whitelist of allowed API operations"),
|
|
3928
3997
|
/** Enable standard attachments/files engine */
|
|
3929
|
-
files:
|
|
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:
|
|
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:
|
|
4002
|
+
activities: import_zod18.z.boolean().default(false).describe("Enable standard tasks and events tracking"),
|
|
3934
4003
|
/** Enable Recycle Bin / Soft Delete */
|
|
3935
|
-
trash:
|
|
4004
|
+
trash: import_zod18.z.boolean().default(true).describe("Enable soft-delete with restore capability"),
|
|
3936
4005
|
/** Enable "Recently Viewed" tracking */
|
|
3937
|
-
mru:
|
|
4006
|
+
mru: import_zod18.z.boolean().default(true).describe("Track Most Recently Used (MRU) list for users"),
|
|
3938
4007
|
/** Allow cloning records */
|
|
3939
|
-
clone:
|
|
3940
|
-
});
|
|
3941
|
-
var IndexSchema =
|
|
3942
|
-
name:
|
|
3943
|
-
fields:
|
|
3944
|
-
type:
|
|
3945
|
-
unique:
|
|
3946
|
-
partial:
|
|
3947
|
-
});
|
|
3948
|
-
var SearchConfigSchema2 =
|
|
3949
|
-
fields:
|
|
3950
|
-
displayFields:
|
|
3951
|
-
filters:
|
|
3952
|
-
});
|
|
3953
|
-
var TenancyConfigSchema =
|
|
3954
|
-
enabled:
|
|
3955
|
-
strategy:
|
|
3956
|
-
tenantField:
|
|
3957
|
-
crossTenantAccess:
|
|
3958
|
-
});
|
|
3959
|
-
var SoftDeleteConfigSchema =
|
|
3960
|
-
enabled:
|
|
3961
|
-
field:
|
|
3962
|
-
cascadeDelete:
|
|
3963
|
-
});
|
|
3964
|
-
var VersioningConfigSchema =
|
|
3965
|
-
enabled:
|
|
3966
|
-
strategy:
|
|
3967
|
-
retentionDays:
|
|
3968
|
-
versionField:
|
|
3969
|
-
});
|
|
3970
|
-
var PartitioningConfigSchema =
|
|
3971
|
-
enabled:
|
|
3972
|
-
strategy:
|
|
3973
|
-
key:
|
|
3974
|
-
interval:
|
|
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 =
|
|
3984
|
-
enabled:
|
|
3985
|
-
events:
|
|
3986
|
-
destination:
|
|
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 =
|
|
4057
|
+
var ObjectSchemaBase = import_zod18.z.object({
|
|
3989
4058
|
/**
|
|
3990
4059
|
* Identity & Metadata
|
|
3991
4060
|
*/
|
|
3992
|
-
name:
|
|
3993
|
-
label:
|
|
3994
|
-
pluralLabel:
|
|
3995
|
-
description:
|
|
3996
|
-
icon:
|
|
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:
|
|
4001
|
-
active:
|
|
4002
|
-
isSystem:
|
|
4003
|
-
abstract:
|
|
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:
|
|
4008
|
-
tableName:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
4038
|
-
compactLayout:
|
|
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 =
|
|
4054
|
-
type:
|
|
4055
|
-
objectName:
|
|
4056
|
-
fieldName:
|
|
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 =
|
|
4060
|
-
type:
|
|
4061
|
-
objectName:
|
|
4062
|
-
fieldName:
|
|
4063
|
-
changes:
|
|
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 =
|
|
4067
|
-
type:
|
|
4068
|
-
objectName:
|
|
4069
|
-
fieldName:
|
|
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 =
|
|
4072
|
-
type:
|
|
4169
|
+
var CreateObjectOperation = import_zod19.z.object({
|
|
4170
|
+
type: import_zod19.z.literal("create_object"),
|
|
4073
4171
|
object: ObjectSchema
|
|
4074
4172
|
});
|
|
4075
|
-
var RenameObjectOperation =
|
|
4076
|
-
type:
|
|
4077
|
-
oldName:
|
|
4078
|
-
newName:
|
|
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 =
|
|
4081
|
-
type:
|
|
4082
|
-
objectName:
|
|
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 =
|
|
4085
|
-
type:
|
|
4086
|
-
sql:
|
|
4087
|
-
description:
|
|
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 =
|
|
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 =
|
|
4099
|
-
migrationId:
|
|
4100
|
-
package:
|
|
4101
|
-
});
|
|
4102
|
-
var ChangeSetSchema =
|
|
4103
|
-
id:
|
|
4104
|
-
name:
|
|
4105
|
-
description:
|
|
4106
|
-
author:
|
|
4107
|
-
createdAt:
|
|
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:
|
|
4207
|
+
dependencies: import_zod19.z.array(MigrationDependencySchema).optional(),
|
|
4110
4208
|
// The actual atomic operations
|
|
4111
|
-
operations:
|
|
4209
|
+
operations: import_zod19.z.array(MigrationOperationSchema),
|
|
4112
4210
|
// Rollback operations (AI should generate these too)
|
|
4113
|
-
rollback:
|
|
4211
|
+
rollback: import_zod19.z.array(MigrationOperationSchema).optional()
|
|
4114
4212
|
});
|
|
4115
4213
|
|
|
4116
4214
|
// src/system/auth-config.zod.ts
|
|
4117
|
-
var
|
|
4118
|
-
var AuthProviderConfigSchema =
|
|
4119
|
-
id:
|
|
4120
|
-
clientId:
|
|
4121
|
-
clientSecret:
|
|
4122
|
-
scope:
|
|
4123
|
-
});
|
|
4124
|
-
var AuthPluginConfigSchema =
|
|
4125
|
-
organization:
|
|
4126
|
-
twoFactor:
|
|
4127
|
-
passkeys:
|
|
4128
|
-
magicLink:
|
|
4129
|
-
});
|
|
4130
|
-
var AuthConfigSchema =
|
|
4131
|
-
secret:
|
|
4132
|
-
baseUrl:
|
|
4133
|
-
databaseUrl:
|
|
4134
|
-
providers:
|
|
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:
|
|
4137
|
-
expiresIn:
|
|
4138
|
-
updateAge:
|
|
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
|
-
[
|
|
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
|
|
4146
|
-
var GDPRConfigSchema =
|
|
4147
|
-
enabled:
|
|
4148
|
-
dataSubjectRights:
|
|
4149
|
-
rightToAccess:
|
|
4150
|
-
rightToRectification:
|
|
4151
|
-
rightToErasure:
|
|
4152
|
-
rightToRestriction:
|
|
4153
|
-
rightToPortability:
|
|
4154
|
-
rightToObjection:
|
|
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:
|
|
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:
|
|
4165
|
-
dataRetentionDays:
|
|
4166
|
-
dataProcessingAgreement:
|
|
4167
|
-
});
|
|
4168
|
-
var HIPAAConfigSchema =
|
|
4169
|
-
enabled:
|
|
4170
|
-
phi:
|
|
4171
|
-
encryption:
|
|
4172
|
-
accessControl:
|
|
4173
|
-
auditTrail:
|
|
4174
|
-
backupAndRecovery:
|
|
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:
|
|
4177
|
-
});
|
|
4178
|
-
var PCIDSSConfigSchema =
|
|
4179
|
-
enabled:
|
|
4180
|
-
level:
|
|
4181
|
-
cardDataFields:
|
|
4182
|
-
tokenization:
|
|
4183
|
-
encryptionInTransit:
|
|
4184
|
-
encryptionAtRest:
|
|
4185
|
-
});
|
|
4186
|
-
var AuditLogConfigSchema =
|
|
4187
|
-
enabled:
|
|
4188
|
-
retentionDays:
|
|
4189
|
-
immutable:
|
|
4190
|
-
signLogs:
|
|
4191
|
-
events:
|
|
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 =
|
|
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
|
|
4212
|
-
var CronScheduleSchema =
|
|
4213
|
-
type:
|
|
4214
|
-
expression:
|
|
4215
|
-
timezone:
|
|
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 =
|
|
4218
|
-
type:
|
|
4219
|
-
intervalMs:
|
|
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 =
|
|
4222
|
-
type:
|
|
4223
|
-
at:
|
|
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 =
|
|
4323
|
+
var ScheduleSchema = import_zod22.z.discriminatedUnion("type", [
|
|
4226
4324
|
CronScheduleSchema,
|
|
4227
4325
|
IntervalScheduleSchema,
|
|
4228
4326
|
OnceScheduleSchema
|
|
4229
4327
|
]);
|
|
4230
|
-
var RetryPolicySchema =
|
|
4231
|
-
maxRetries:
|
|
4232
|
-
backoffMs:
|
|
4233
|
-
backoffMultiplier:
|
|
4234
|
-
});
|
|
4235
|
-
var JobSchema =
|
|
4236
|
-
id:
|
|
4237
|
-
name:
|
|
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:
|
|
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:
|
|
4242
|
-
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 =
|
|
4342
|
+
var JobExecutionStatus = import_zod22.z.enum([
|
|
4245
4343
|
"running",
|
|
4246
4344
|
"success",
|
|
4247
4345
|
"failed",
|
|
4248
4346
|
"timeout"
|
|
4249
4347
|
]);
|
|
4250
|
-
var JobExecutionSchema =
|
|
4251
|
-
jobId:
|
|
4252
|
-
startedAt:
|
|
4253
|
-
completedAt:
|
|
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:
|
|
4256
|
-
duration:
|
|
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
|
|
4261
|
-
var TaskPriority =
|
|
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 =
|
|
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 =
|
|
4299
|
-
maxRetries:
|
|
4300
|
-
backoffStrategy:
|
|
4301
|
-
initialDelayMs:
|
|
4302
|
-
maxDelayMs:
|
|
4303
|
-
backoffMultiplier:
|
|
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 =
|
|
4403
|
+
var TaskSchema = import_zod23.z.object({
|
|
4306
4404
|
/**
|
|
4307
4405
|
* Unique task identifier
|
|
4308
4406
|
*/
|
|
4309
|
-
id:
|
|
4407
|
+
id: import_zod23.z.string().describe("Unique task identifier"),
|
|
4310
4408
|
/**
|
|
4311
4409
|
* Task type (handler identifier)
|
|
4312
4410
|
*/
|
|
4313
|
-
type:
|
|
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:
|
|
4415
|
+
payload: import_zod23.z.any().describe("Task payload data"),
|
|
4318
4416
|
/**
|
|
4319
4417
|
* Queue name
|
|
4320
4418
|
*/
|
|
4321
|
-
queue:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
4350
|
-
createdAt:
|
|
4351
|
-
updatedAt:
|
|
4352
|
-
createdBy:
|
|
4353
|
-
tags:
|
|
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 =
|
|
4454
|
+
var TaskExecutionResultSchema = import_zod23.z.object({
|
|
4357
4455
|
/**
|
|
4358
4456
|
* Task identifier
|
|
4359
4457
|
*/
|
|
4360
|
-
taskId:
|
|
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:
|
|
4466
|
+
result: import_zod23.z.any().optional().describe("Execution result data"),
|
|
4369
4467
|
/**
|
|
4370
4468
|
* Error information
|
|
4371
4469
|
*/
|
|
4372
|
-
error:
|
|
4373
|
-
message:
|
|
4374
|
-
stack:
|
|
4375
|
-
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:
|
|
4478
|
+
durationMs: import_zod23.z.number().int().optional().describe("Execution duration in milliseconds"),
|
|
4381
4479
|
/**
|
|
4382
4480
|
* Execution timestamps
|
|
4383
4481
|
*/
|
|
4384
|
-
startedAt:
|
|
4385
|
-
completedAt:
|
|
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:
|
|
4390
|
-
willRetry:
|
|
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 =
|
|
4490
|
+
var QueueConfigSchema = import_zod23.z.object({
|
|
4393
4491
|
/**
|
|
4394
4492
|
* Queue name
|
|
4395
4493
|
*/
|
|
4396
|
-
name:
|
|
4494
|
+
name: import_zod23.z.string().describe("Queue name (snake_case)"),
|
|
4397
4495
|
/**
|
|
4398
4496
|
* Maximum concurrent workers
|
|
4399
4497
|
*/
|
|
4400
|
-
concurrency:
|
|
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:
|
|
4405
|
-
max:
|
|
4406
|
-
duration:
|
|
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:
|
|
4513
|
+
deadLetterQueue: import_zod23.z.string().optional().describe("Dead letter queue name"),
|
|
4416
4514
|
/**
|
|
4417
4515
|
* Queue priority
|
|
4418
4516
|
*/
|
|
4419
|
-
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:
|
|
4424
|
-
enabled:
|
|
4425
|
-
minWorkers:
|
|
4426
|
-
maxWorkers:
|
|
4427
|
-
scaleUpThreshold:
|
|
4428
|
-
scaleDownThreshold:
|
|
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 =
|
|
4529
|
+
var BatchTaskSchema = import_zod23.z.object({
|
|
4432
4530
|
/**
|
|
4433
4531
|
* Batch job identifier
|
|
4434
4532
|
*/
|
|
4435
|
-
id:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
4557
|
+
parallel: import_zod23.z.boolean().default(true).describe("Process batches in parallel"),
|
|
4460
4558
|
/**
|
|
4461
4559
|
* Stop on error
|
|
4462
4560
|
*/
|
|
4463
|
-
stopOnError:
|
|
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:
|
|
4474
|
-
processed:
|
|
4475
|
-
total:
|
|
4476
|
-
failed:
|
|
4477
|
-
})).returns(
|
|
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 =
|
|
4577
|
+
var BatchProgressSchema = import_zod23.z.object({
|
|
4480
4578
|
/**
|
|
4481
4579
|
* Batch job identifier
|
|
4482
4580
|
*/
|
|
4483
|
-
batchId:
|
|
4581
|
+
batchId: import_zod23.z.string().describe("Batch job identifier"),
|
|
4484
4582
|
/**
|
|
4485
4583
|
* Total items
|
|
4486
4584
|
*/
|
|
4487
|
-
total:
|
|
4585
|
+
total: import_zod23.z.number().int().min(0).describe("Total number of items"),
|
|
4488
4586
|
/**
|
|
4489
4587
|
* Processed items
|
|
4490
4588
|
*/
|
|
4491
|
-
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:
|
|
4593
|
+
succeeded: import_zod23.z.number().int().min(0).default(0).describe("Items succeeded"),
|
|
4496
4594
|
/**
|
|
4497
4595
|
* Failed items
|
|
4498
4596
|
*/
|
|
4499
|
-
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:
|
|
4601
|
+
percentage: import_zod23.z.number().min(0).max(100).describe("Progress percentage"),
|
|
4504
4602
|
/**
|
|
4505
4603
|
* Status
|
|
4506
4604
|
*/
|
|
4507
|
-
status:
|
|
4605
|
+
status: import_zod23.z.enum(["pending", "running", "completed", "failed", "cancelled"]).describe("Batch status"),
|
|
4508
4606
|
/**
|
|
4509
4607
|
* Timestamps
|
|
4510
4608
|
*/
|
|
4511
|
-
startedAt:
|
|
4512
|
-
completedAt:
|
|
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 =
|
|
4612
|
+
var WorkerConfigSchema = import_zod23.z.object({
|
|
4515
4613
|
/**
|
|
4516
4614
|
* Worker name
|
|
4517
4615
|
*/
|
|
4518
|
-
name:
|
|
4616
|
+
name: import_zod23.z.string().describe("Worker name"),
|
|
4519
4617
|
/**
|
|
4520
4618
|
* Queues to process
|
|
4521
4619
|
*/
|
|
4522
|
-
queues:
|
|
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:
|
|
4624
|
+
queueConfigs: import_zod23.z.array(QueueConfigSchema).optional().describe("Queue configurations"),
|
|
4527
4625
|
/**
|
|
4528
4626
|
* Polling interval
|
|
4529
4627
|
*/
|
|
4530
|
-
pollIntervalMs:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
4644
|
+
handlers: import_zod23.z.record(import_zod23.z.string(), import_zod23.z.function()).optional().describe("Task type handlers")
|
|
4547
4645
|
});
|
|
4548
|
-
var WorkerStatsSchema =
|
|
4646
|
+
var WorkerStatsSchema = import_zod23.z.object({
|
|
4549
4647
|
/**
|
|
4550
4648
|
* Worker name
|
|
4551
4649
|
*/
|
|
4552
|
-
workerName:
|
|
4650
|
+
workerName: import_zod23.z.string().describe("Worker name"),
|
|
4553
4651
|
/**
|
|
4554
4652
|
* Total tasks processed
|
|
4555
4653
|
*/
|
|
4556
|
-
totalProcessed:
|
|
4654
|
+
totalProcessed: import_zod23.z.number().int().min(0).describe("Total tasks processed"),
|
|
4557
4655
|
/**
|
|
4558
4656
|
* Successful tasks
|
|
4559
4657
|
*/
|
|
4560
|
-
succeeded:
|
|
4658
|
+
succeeded: import_zod23.z.number().int().min(0).describe("Successful tasks"),
|
|
4561
4659
|
/**
|
|
4562
4660
|
* Failed tasks
|
|
4563
4661
|
*/
|
|
4564
|
-
failed:
|
|
4662
|
+
failed: import_zod23.z.number().int().min(0).describe("Failed tasks"),
|
|
4565
4663
|
/**
|
|
4566
4664
|
* Active tasks
|
|
4567
4665
|
*/
|
|
4568
|
-
active:
|
|
4666
|
+
active: import_zod23.z.number().int().min(0).describe("Currently active tasks"),
|
|
4569
4667
|
/**
|
|
4570
4668
|
* Average execution time
|
|
4571
4669
|
*/
|
|
4572
|
-
avgExecutionMs:
|
|
4670
|
+
avgExecutionMs: import_zod23.z.number().min(0).optional().describe("Average execution time in milliseconds"),
|
|
4573
4671
|
/**
|
|
4574
4672
|
* Uptime
|
|
4575
4673
|
*/
|
|
4576
|
-
uptimeMs:
|
|
4674
|
+
uptimeMs: import_zod23.z.number().int().min(0).describe("Worker uptime in milliseconds"),
|
|
4577
4675
|
/**
|
|
4578
4676
|
* Queue stats
|
|
4579
4677
|
*/
|
|
4580
|
-
queues:
|
|
4581
|
-
pending:
|
|
4582
|
-
active:
|
|
4583
|
-
completed:
|
|
4584
|
-
failed:
|
|
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
|
|
4602
|
-
var EmailTemplateSchema =
|
|
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:
|
|
4704
|
+
id: import_zod24.z.string().describe("Template identifier"),
|
|
4607
4705
|
/**
|
|
4608
4706
|
* Email subject line (supports variable interpolation)
|
|
4609
4707
|
*/
|
|
4610
|
-
subject:
|
|
4708
|
+
subject: import_zod24.z.string().describe("Email subject"),
|
|
4611
4709
|
/**
|
|
4612
4710
|
* Email body content
|
|
4613
4711
|
*/
|
|
4614
|
-
body:
|
|
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:
|
|
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:
|
|
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:
|
|
4628
|
-
name:
|
|
4629
|
-
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 =
|
|
4730
|
+
var SMSTemplateSchema = import_zod24.z.object({
|
|
4633
4731
|
/**
|
|
4634
4732
|
* Unique identifier for the SMS template
|
|
4635
4733
|
*/
|
|
4636
|
-
id:
|
|
4734
|
+
id: import_zod24.z.string().describe("Template identifier"),
|
|
4637
4735
|
/**
|
|
4638
4736
|
* SMS message content (supports variable interpolation)
|
|
4639
4737
|
*/
|
|
4640
|
-
message:
|
|
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:
|
|
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:
|
|
4747
|
+
variables: import_zod24.z.array(import_zod24.z.string()).optional().describe("Template variables")
|
|
4650
4748
|
});
|
|
4651
|
-
var PushNotificationSchema =
|
|
4749
|
+
var PushNotificationSchema = import_zod24.z.object({
|
|
4652
4750
|
/**
|
|
4653
4751
|
* Notification title
|
|
4654
4752
|
*/
|
|
4655
|
-
title:
|
|
4753
|
+
title: import_zod24.z.string().describe("Notification title"),
|
|
4656
4754
|
/**
|
|
4657
4755
|
* Notification body text
|
|
4658
4756
|
*/
|
|
4659
|
-
body:
|
|
4757
|
+
body: import_zod24.z.string().describe("Notification body"),
|
|
4660
4758
|
/**
|
|
4661
4759
|
* Icon URL to display with notification
|
|
4662
4760
|
*/
|
|
4663
|
-
icon:
|
|
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:
|
|
4765
|
+
badge: import_zod24.z.number().optional().describe("Badge count"),
|
|
4668
4766
|
/**
|
|
4669
4767
|
* Custom data payload
|
|
4670
4768
|
*/
|
|
4671
|
-
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:
|
|
4676
|
-
action:
|
|
4677
|
-
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 =
|
|
4778
|
+
var InAppNotificationSchema = import_zod24.z.object({
|
|
4681
4779
|
/**
|
|
4682
4780
|
* Notification title
|
|
4683
4781
|
*/
|
|
4684
|
-
title:
|
|
4782
|
+
title: import_zod24.z.string().describe("Notification title"),
|
|
4685
4783
|
/**
|
|
4686
4784
|
* Notification message content
|
|
4687
4785
|
*/
|
|
4688
|
-
message:
|
|
4786
|
+
message: import_zod24.z.string().describe("Notification message"),
|
|
4689
4787
|
/**
|
|
4690
4788
|
* Notification severity type
|
|
4691
4789
|
*/
|
|
4692
|
-
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:
|
|
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:
|
|
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:
|
|
4803
|
+
expiresAt: import_zod24.z.number().optional().describe("Expiration timestamp")
|
|
4706
4804
|
});
|
|
4707
|
-
var NotificationChannelSchema =
|
|
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 =
|
|
4814
|
+
var NotificationConfigSchema = import_zod24.z.object({
|
|
4717
4815
|
/**
|
|
4718
4816
|
* Unique identifier for this notification configuration
|
|
4719
4817
|
*/
|
|
4720
|
-
id:
|
|
4818
|
+
id: import_zod24.z.string().describe("Notification ID"),
|
|
4721
4819
|
/**
|
|
4722
4820
|
* Human-readable name for this notification
|
|
4723
4821
|
*/
|
|
4724
|
-
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:
|
|
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:
|
|
4839
|
+
recipients: import_zod24.z.object({
|
|
4742
4840
|
/**
|
|
4743
4841
|
* Primary recipients
|
|
4744
4842
|
*/
|
|
4745
|
-
to:
|
|
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:
|
|
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:
|
|
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:
|
|
4856
|
+
schedule: import_zod24.z.object({
|
|
4759
4857
|
/**
|
|
4760
4858
|
* Scheduling type
|
|
4761
4859
|
*/
|
|
4762
|
-
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:
|
|
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:
|
|
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:
|
|
4873
|
+
retryPolicy: import_zod24.z.object({
|
|
4776
4874
|
/**
|
|
4777
4875
|
* Enable automatic retries
|
|
4778
4876
|
* @default true
|
|
4779
4877
|
*/
|
|
4780
|
-
enabled:
|
|
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:
|
|
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:
|
|
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:
|
|
4892
|
+
tracking: import_zod24.z.object({
|
|
4795
4893
|
/**
|
|
4796
4894
|
* Track when emails are opened
|
|
4797
4895
|
* @default false
|
|
4798
4896
|
*/
|
|
4799
|
-
trackOpens:
|
|
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:
|
|
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:
|
|
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
|
|
4815
|
-
var TranslationDataSchema =
|
|
4912
|
+
var import_zod25 = require("zod");
|
|
4913
|
+
var TranslationDataSchema = import_zod25.z.object({
|
|
4816
4914
|
/** Object translations */
|
|
4817
|
-
objects:
|
|
4818
|
-
label:
|
|
4819
|
-
pluralLabel:
|
|
4820
|
-
fields:
|
|
4821
|
-
label:
|
|
4822
|
-
help:
|
|
4823
|
-
options:
|
|
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:
|
|
4829
|
-
label:
|
|
4830
|
-
description:
|
|
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:
|
|
4931
|
+
messages: import_zod25.z.record(import_zod25.z.string(), import_zod25.z.string()).optional()
|
|
4834
4932
|
});
|
|
4835
|
-
var LocaleSchema =
|
|
4836
|
-
var TranslationBundleSchema =
|
|
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
|
|
4840
|
-
var OTOperationType =
|
|
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 =
|
|
4849
|
-
|
|
4850
|
-
type:
|
|
4851
|
-
text:
|
|
4852
|
-
attributes:
|
|
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
|
-
|
|
4855
|
-
type:
|
|
4856
|
-
count:
|
|
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
|
-
|
|
4859
|
-
type:
|
|
4860
|
-
count:
|
|
4861
|
-
attributes:
|
|
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 =
|
|
4865
|
-
operationId:
|
|
4866
|
-
documentId:
|
|
4867
|
-
userId:
|
|
4868
|
-
sessionId:
|
|
4869
|
-
components:
|
|
4870
|
-
baseVersion:
|
|
4871
|
-
timestamp:
|
|
4872
|
-
metadata:
|
|
4873
|
-
});
|
|
4874
|
-
var OTTransformResultSchema =
|
|
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:
|
|
4877
|
-
conflicts:
|
|
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 =
|
|
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 =
|
|
4900
|
-
clock:
|
|
4901
|
-
});
|
|
4902
|
-
var LWWRegisterSchema =
|
|
4903
|
-
type:
|
|
4904
|
-
value:
|
|
4905
|
-
timestamp:
|
|
4906
|
-
replicaId:
|
|
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 =
|
|
4910
|
-
replicaId:
|
|
4911
|
-
delta:
|
|
4912
|
-
timestamp:
|
|
4913
|
-
});
|
|
4914
|
-
var GCounterSchema =
|
|
4915
|
-
type:
|
|
4916
|
-
counts:
|
|
4917
|
-
});
|
|
4918
|
-
var PNCounterSchema =
|
|
4919
|
-
type:
|
|
4920
|
-
positive:
|
|
4921
|
-
negative:
|
|
4922
|
-
});
|
|
4923
|
-
var ORSetElementSchema =
|
|
4924
|
-
value:
|
|
4925
|
-
timestamp:
|
|
4926
|
-
replicaId:
|
|
4927
|
-
uid:
|
|
4928
|
-
removed:
|
|
4929
|
-
});
|
|
4930
|
-
var ORSetSchema =
|
|
4931
|
-
type:
|
|
4932
|
-
elements:
|
|
4933
|
-
});
|
|
4934
|
-
var TextCRDTOperationSchema =
|
|
4935
|
-
operationId:
|
|
4936
|
-
replicaId:
|
|
4937
|
-
position:
|
|
4938
|
-
insert:
|
|
4939
|
-
delete:
|
|
4940
|
-
timestamp:
|
|
4941
|
-
lamportTimestamp:
|
|
4942
|
-
});
|
|
4943
|
-
var TextCRDTStateSchema =
|
|
4944
|
-
type:
|
|
4945
|
-
documentId:
|
|
4946
|
-
content:
|
|
4947
|
-
operations:
|
|
4948
|
-
lamportClock:
|
|
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 =
|
|
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 =
|
|
5056
|
+
var CRDTMergeResultSchema = import_zod26.z.object({
|
|
4959
5057
|
state: CRDTStateSchema.describe("Merged CRDT state"),
|
|
4960
|
-
conflicts:
|
|
4961
|
-
type:
|
|
4962
|
-
description:
|
|
4963
|
-
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 =
|
|
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 =
|
|
4979
|
-
color:
|
|
4980
|
-
opacity:
|
|
4981
|
-
label:
|
|
4982
|
-
showLabel:
|
|
4983
|
-
pulseOnUpdate:
|
|
4984
|
-
});
|
|
4985
|
-
var CursorSelectionSchema =
|
|
4986
|
-
anchor:
|
|
4987
|
-
line:
|
|
4988
|
-
column:
|
|
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:
|
|
4991
|
-
line:
|
|
4992
|
-
column:
|
|
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:
|
|
4995
|
-
});
|
|
4996
|
-
var CollaborativeCursorSchema =
|
|
4997
|
-
userId:
|
|
4998
|
-
sessionId:
|
|
4999
|
-
documentId:
|
|
5000
|
-
userName:
|
|
5001
|
-
position:
|
|
5002
|
-
line:
|
|
5003
|
-
column:
|
|
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:
|
|
5008
|
-
lastUpdate:
|
|
5009
|
-
metadata:
|
|
5010
|
-
});
|
|
5011
|
-
var CursorUpdateSchema =
|
|
5012
|
-
position:
|
|
5013
|
-
line:
|
|
5014
|
-
column:
|
|
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:
|
|
5018
|
-
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 =
|
|
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 =
|
|
5031
|
-
userId:
|
|
5032
|
-
sessionId:
|
|
5033
|
-
userName:
|
|
5034
|
-
userAvatar:
|
|
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:
|
|
5037
|
-
currentView:
|
|
5038
|
-
lastActivity:
|
|
5039
|
-
joinedAt:
|
|
5040
|
-
permissions:
|
|
5041
|
-
metadata:
|
|
5042
|
-
});
|
|
5043
|
-
var AwarenessSessionSchema =
|
|
5044
|
-
sessionId:
|
|
5045
|
-
documentId:
|
|
5046
|
-
users:
|
|
5047
|
-
startedAt:
|
|
5048
|
-
lastUpdate:
|
|
5049
|
-
metadata:
|
|
5050
|
-
});
|
|
5051
|
-
var AwarenessUpdateSchema =
|
|
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:
|
|
5054
|
-
currentView:
|
|
5055
|
-
metadata:
|
|
5056
|
-
});
|
|
5057
|
-
var AwarenessEventSchema =
|
|
5058
|
-
eventId:
|
|
5059
|
-
sessionId:
|
|
5060
|
-
eventType:
|
|
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:
|
|
5068
|
-
timestamp:
|
|
5069
|
-
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 =
|
|
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 =
|
|
5179
|
+
var CollaborationSessionConfigSchema = import_zod26.z.object({
|
|
5082
5180
|
mode: CollaborationMode.describe("Collaboration mode to use"),
|
|
5083
|
-
enableCursorSharing:
|
|
5084
|
-
enablePresence:
|
|
5085
|
-
enableAwareness:
|
|
5086
|
-
maxUsers:
|
|
5087
|
-
idleTimeout:
|
|
5088
|
-
conflictResolution:
|
|
5089
|
-
persistence:
|
|
5090
|
-
snapshot:
|
|
5091
|
-
enabled:
|
|
5092
|
-
interval:
|
|
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 =
|
|
5096
|
-
sessionId:
|
|
5097
|
-
documentId:
|
|
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:
|
|
5100
|
-
cursors:
|
|
5101
|
-
version:
|
|
5102
|
-
operations:
|
|
5103
|
-
createdAt:
|
|
5104
|
-
lastActivity:
|
|
5105
|
-
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
|
|
5110
|
-
var MetadataScopeSchema =
|
|
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 =
|
|
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 =
|
|
5226
|
+
var MetadataRecordSchema = import_zod27.z.object({
|
|
5129
5227
|
/** Primary Key (UUID) */
|
|
5130
|
-
_id:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
5161
|
-
strategy:
|
|
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:
|
|
5261
|
+
owner: import_zod27.z.string().optional(),
|
|
5164
5262
|
/** State */
|
|
5165
5263
|
state: MetadataStateSchema.default("active"),
|
|
5166
5264
|
/** Audit */
|
|
5167
|
-
created_by:
|
|
5168
|
-
created_at:
|
|
5169
|
-
updated_by:
|
|
5170
|
-
updated_at:
|
|
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 =
|
|
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 =
|
|
5183
|
-
path:
|
|
5184
|
-
size:
|
|
5185
|
-
mtime:
|
|
5186
|
-
hash:
|
|
5187
|
-
etag:
|
|
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:
|
|
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 =
|
|
5195
|
-
name:
|
|
5196
|
-
protocol:
|
|
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:
|
|
5199
|
-
supportedFormats:
|
|
5200
|
-
supportsWatch:
|
|
5201
|
-
supportsWrite:
|
|
5202
|
-
supportsCache:
|
|
5203
|
-
capabilities:
|
|
5204
|
-
read:
|
|
5205
|
-
write:
|
|
5206
|
-
watch:
|
|
5207
|
-
list:
|
|
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 =
|
|
5308
|
+
var MetadataLoadOptionsSchema = import_zod27.z.object({
|
|
5211
5309
|
scope: MetadataScopeSchema.optional(),
|
|
5212
|
-
namespace:
|
|
5213
|
-
raw:
|
|
5214
|
-
cache:
|
|
5215
|
-
useCache:
|
|
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:
|
|
5218
|
-
ifNoneMatch:
|
|
5315
|
+
validate: import_zod27.z.boolean().optional(),
|
|
5316
|
+
ifNoneMatch: import_zod27.z.string().optional(),
|
|
5219
5317
|
// For caching
|
|
5220
|
-
recursive:
|
|
5221
|
-
limit:
|
|
5222
|
-
patterns:
|
|
5223
|
-
loader:
|
|
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 =
|
|
5226
|
-
data:
|
|
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:
|
|
5327
|
+
source: import_zod27.z.string().optional(),
|
|
5230
5328
|
// File path or URL
|
|
5231
|
-
fromCache:
|
|
5232
|
-
etag:
|
|
5233
|
-
notModified:
|
|
5234
|
-
loadTime:
|
|
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 =
|
|
5334
|
+
var MetadataSaveOptionsSchema = import_zod27.z.object({
|
|
5237
5335
|
format: MetadataFormatSchema.optional(),
|
|
5238
|
-
create:
|
|
5239
|
-
overwrite:
|
|
5240
|
-
path:
|
|
5241
|
-
prettify:
|
|
5242
|
-
indent:
|
|
5243
|
-
sortKeys:
|
|
5244
|
-
backup:
|
|
5245
|
-
atomic:
|
|
5246
|
-
loader:
|
|
5247
|
-
});
|
|
5248
|
-
var MetadataSaveResultSchema =
|
|
5249
|
-
success:
|
|
5250
|
-
path:
|
|
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:
|
|
5253
|
-
size:
|
|
5254
|
-
saveTime:
|
|
5255
|
-
backupPath:
|
|
5256
|
-
});
|
|
5257
|
-
var MetadataWatchEventSchema =
|
|
5258
|
-
type:
|
|
5259
|
-
path:
|
|
5260
|
-
name:
|
|
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:
|
|
5263
|
-
data:
|
|
5264
|
-
timestamp:
|
|
5265
|
-
});
|
|
5266
|
-
var MetadataCollectionInfoSchema =
|
|
5267
|
-
type:
|
|
5268
|
-
count:
|
|
5269
|
-
namespaces:
|
|
5270
|
-
});
|
|
5271
|
-
var MetadataExportOptionsSchema =
|
|
5272
|
-
types:
|
|
5273
|
-
namespaces:
|
|
5274
|
-
output:
|
|
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 =
|
|
5278
|
-
source:
|
|
5279
|
-
strategy:
|
|
5280
|
-
validate:
|
|
5281
|
-
});
|
|
5282
|
-
var MetadataManagerConfigSchema =
|
|
5283
|
-
loaders:
|
|
5284
|
-
watch:
|
|
5285
|
-
cache:
|
|
5286
|
-
basePath:
|
|
5287
|
-
rootDir:
|
|
5288
|
-
formats:
|
|
5289
|
-
watchOptions:
|
|
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
|
|
5295
|
-
var CoreServiceName =
|
|
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 =
|
|
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 =
|
|
5453
|
+
var ServiceStatusSchema = import_zod28.z.object({
|
|
5356
5454
|
name: CoreServiceName,
|
|
5357
|
-
enabled:
|
|
5358
|
-
status:
|
|
5359
|
-
version:
|
|
5360
|
-
provider:
|
|
5361
|
-
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 =
|
|
5461
|
+
var KernelServiceMapSchema = import_zod28.z.record(
|
|
5364
5462
|
CoreServiceName,
|
|
5365
|
-
|
|
5463
|
+
import_zod28.z.any().describe("Service Instance implementing the protocol interface")
|
|
5366
5464
|
);
|
|
5367
|
-
var ServiceConfigSchema =
|
|
5368
|
-
id:
|
|
5465
|
+
var ServiceConfigSchema = import_zod28.z.object({
|
|
5466
|
+
id: import_zod28.z.string(),
|
|
5369
5467
|
name: CoreServiceName,
|
|
5370
|
-
options:
|
|
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 = {
|