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