@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.
Files changed (147) hide show
  1. package/README.md +41 -1
  2. package/dist/ai/index.d.mts +2 -1
  3. package/dist/ai/index.d.ts +2 -1
  4. package/dist/ai/index.js +2047 -1944
  5. package/dist/ai/index.js.map +1 -1
  6. package/dist/ai/index.mjs +2047 -1944
  7. package/dist/ai/index.mjs.map +1 -1
  8. package/dist/api/index.d.mts +3 -1
  9. package/dist/api/index.d.ts +3 -1
  10. package/dist/api/index.js +2599 -2292
  11. package/dist/api/index.js.map +1 -1
  12. package/dist/api/index.mjs +2587 -2292
  13. package/dist/api/index.mjs.map +1 -1
  14. package/dist/automation/index.d.mts +2 -1
  15. package/dist/automation/index.d.ts +2 -1
  16. package/dist/automation/index.js +83 -0
  17. package/dist/automation/index.js.map +1 -1
  18. package/dist/automation/index.mjs +77 -0
  19. package/dist/automation/index.mjs.map +1 -1
  20. package/dist/contracts/index.d.mts +3 -2
  21. package/dist/contracts/index.d.ts +3 -2
  22. package/dist/data/index.d.mts +3 -2
  23. package/dist/data/index.d.ts +3 -2
  24. package/dist/data/index.js +658 -556
  25. package/dist/data/index.js.map +1 -1
  26. package/dist/data/index.mjs +656 -556
  27. package/dist/data/index.mjs.map +1 -1
  28. package/dist/{driver.zod-lfi00zVT.d.ts → driver.zod-CfGk9GYh.d.ts} +2164 -11
  29. package/dist/{driver.zod-BOM_Etco.d.mts → driver.zod-y1cX6R3c.d.mts} +2164 -11
  30. package/dist/hub/index.d.mts +1 -1
  31. package/dist/hub/index.d.ts +1 -1
  32. package/dist/hub/index.js +789 -724
  33. package/dist/hub/index.js.map +1 -1
  34. package/dist/hub/index.mjs +789 -724
  35. package/dist/hub/index.mjs.map +1 -1
  36. package/dist/{index-C67cfwmW.d.ts → index-B0Hf65bV.d.ts} +13 -5
  37. package/dist/{index-DLcySG7U.d.ts → index-B5pKM0My.d.ts} +335 -4370
  38. package/dist/{index-Os7lItRe.d.mts → index-BA022mg2.d.ts} +6178 -129
  39. package/dist/{index-B5-VbOKg.d.mts → index-BGeLoH2z.d.ts} +4251 -74
  40. package/dist/{index-CH5zloR3.d.ts → index-BwO__aqV.d.ts} +1 -1
  41. package/dist/{index-Dp7GFJ8V.d.mts → index-Cia3JPQ8.d.mts} +13 -5
  42. package/dist/{index-D12rNohm.d.mts → index-CpD1q1FP.d.ts} +35 -18
  43. package/dist/{index-Os7lItRe.d.ts → index-D5RSFPuB.d.mts} +6178 -129
  44. package/dist/{index-CU4m6noq.d.mts → index-DGjpaj0X.d.mts} +1 -1
  45. package/dist/{index-D12rNohm.d.ts → index-Dfn5VXl6.d.mts} +35 -18
  46. package/dist/{index-l6WIlmOD.d.mts → index-Dgybxlky.d.mts} +177 -158
  47. package/dist/{index-l6WIlmOD.d.ts → index-Dgybxlky.d.ts} +177 -158
  48. package/dist/{index-DLcySG7U.d.mts → index-Dpsk8PF4.d.mts} +335 -4370
  49. package/dist/{index-CyognKSZ.d.ts → index-DrNah5E0.d.ts} +1952 -6990
  50. package/dist/{index-DE_lJ11p.d.mts → index-OO84R20k.d.mts} +1952 -6990
  51. package/dist/{index-B5-VbOKg.d.ts → index-upA3Xt04.d.mts} +4251 -74
  52. package/dist/index.d.mts +8072 -1922
  53. package/dist/index.d.ts +8072 -1922
  54. package/dist/index.js +8563 -8249
  55. package/dist/index.js.map +1 -1
  56. package/dist/index.mjs +8563 -8249
  57. package/dist/index.mjs.map +1 -1
  58. package/dist/integration/index.d.mts +1 -1
  59. package/dist/integration/index.d.ts +1 -1
  60. package/dist/kernel/index.d.mts +2 -1
  61. package/dist/kernel/index.d.ts +2 -1
  62. package/dist/kernel/index.js +884 -684
  63. package/dist/kernel/index.js.map +1 -1
  64. package/dist/kernel/index.mjs +870 -684
  65. package/dist/kernel/index.mjs.map +1 -1
  66. package/dist/package-registry.zod-JMcOYNxM.d.mts +21119 -0
  67. package/dist/package-registry.zod-JMcOYNxM.d.ts +21119 -0
  68. package/dist/state-machine.zod-B-lFFSxQ.d.mts +285 -0
  69. package/dist/state-machine.zod-B-lFFSxQ.d.ts +285 -0
  70. package/dist/system/index.d.mts +2 -1
  71. package/dist/system/index.d.ts +2 -1
  72. package/dist/system/index.js +749 -651
  73. package/dist/system/index.js.map +1 -1
  74. package/dist/system/index.mjs +749 -651
  75. package/dist/system/index.mjs.map +1 -1
  76. package/dist/ui/index.d.mts +1 -1
  77. package/dist/ui/index.d.ts +1 -1
  78. package/json-schema/ai/Agent.json +499 -0
  79. package/json-schema/ai/DevOpsAgent.json +499 -0
  80. package/json-schema/ai/FeedbackLoop.json +2188 -186
  81. package/json-schema/ai/Resolution.json +2188 -186
  82. package/json-schema/api/ApiRoutes.json +4 -0
  83. package/json-schema/api/CompileManifestResponse.json +40 -10
  84. package/json-schema/api/DisablePackageRequest.json +18 -0
  85. package/json-schema/api/DisablePackageResponse.json +1521 -0
  86. package/json-schema/api/Discovery.json +4 -0
  87. package/json-schema/api/EnablePackageRequest.json +18 -0
  88. package/json-schema/api/EnablePackageResponse.json +1521 -0
  89. package/json-schema/api/GetDiscoveryResponse.json +4 -0
  90. package/json-schema/api/GetPackageRequest.json +18 -0
  91. package/json-schema/api/GetPackageResponse.json +1518 -0
  92. package/json-schema/api/InstallPackageRequest.json +1483 -0
  93. package/json-schema/api/InstallPackageResponse.json +1521 -0
  94. package/json-schema/api/ListPackagesRequest.json +42 -0
  95. package/json-schema/api/ListPackagesResponse.json +1525 -0
  96. package/json-schema/api/ObjectDefinitionResponse.json +1001 -0
  97. package/json-schema/api/ObjectStackProtocol.json +86 -1
  98. package/json-schema/api/RestApiConfig.json +5 -0
  99. package/json-schema/api/RestServerConfig.json +5 -0
  100. package/json-schema/api/UninstallPackageRequest.json +18 -0
  101. package/json-schema/api/UninstallPackageResponse.json +25 -0
  102. package/json-schema/automation/ActionRef.json +30 -0
  103. package/json-schema/automation/Event.json +24 -0
  104. package/json-schema/automation/Flow.json +1 -0
  105. package/json-schema/automation/FlowNode.json +1 -0
  106. package/json-schema/automation/FlowNodeAction.json +1 -0
  107. package/json-schema/automation/GuardRef.json +30 -0
  108. package/json-schema/automation/StateMachine.json +504 -0
  109. package/json-schema/automation/StateNode.json +324 -0
  110. package/json-schema/automation/Transition.json +73 -0
  111. package/json-schema/data/Object.json +1001 -0
  112. package/json-schema/data/ObjectExtension.json +2376 -0
  113. package/json-schema/data/ObjectOwnershipEnum.json +13 -0
  114. package/json-schema/hub/ComposerResponse.json +40 -10
  115. package/json-schema/kernel/DisablePackageRequest.json +18 -0
  116. package/json-schema/kernel/DisablePackageResponse.json +1521 -0
  117. package/json-schema/kernel/EnablePackageRequest.json +18 -0
  118. package/json-schema/kernel/EnablePackageResponse.json +1521 -0
  119. package/json-schema/kernel/EventBusConfig.json +15 -0
  120. package/json-schema/kernel/EventHandler.json +6 -0
  121. package/json-schema/kernel/EventPersistence.json +3 -0
  122. package/json-schema/kernel/EventRoute.json +3 -0
  123. package/json-schema/kernel/EventWebhookConfig.json +3 -0
  124. package/json-schema/kernel/GetPackageRequest.json +18 -0
  125. package/json-schema/kernel/GetPackageResponse.json +1518 -0
  126. package/json-schema/kernel/InstallPackageRequest.json +1483 -0
  127. package/json-schema/kernel/InstallPackageResponse.json +1521 -0
  128. package/json-schema/kernel/InstalledPackage.json +1509 -0
  129. package/json-schema/kernel/ListPackagesRequest.json +42 -0
  130. package/json-schema/kernel/ListPackagesResponse.json +1525 -0
  131. package/json-schema/kernel/Manifest.json +40 -10
  132. package/json-schema/kernel/PackageStatusEnum.json +16 -0
  133. package/json-schema/kernel/Plugin.json +5 -0
  134. package/json-schema/kernel/PluginContext.json +31 -7
  135. package/json-schema/kernel/PluginLifecycle.json +7 -1
  136. package/json-schema/kernel/RealTimeNotificationConfig.json +3 -0
  137. package/json-schema/kernel/UninstallPackageRequest.json +18 -0
  138. package/json-schema/kernel/UninstallPackageResponse.json +25 -0
  139. package/json-schema/system/ChangeSet.json +2188 -186
  140. package/json-schema/system/CreateObjectOperation.json +1001 -0
  141. package/json-schema/system/MigrationOperation.json +1001 -0
  142. package/package.json +29 -15
  143. package/prompts/create-new-project.md +37 -19
  144. package/dist/{index-I3piy4U4.d.mts → index-BmU_sD1f.d.mts} +8 -8
  145. package/dist/{index-CkhpsEUw.d.ts → index-BnXuc_HO.d.ts} +8 -8
  146. package/dist/{index-CIDI-8zR.d.mts → index-C_NTOcet.d.mts} +98 -98
  147. package/dist/{index-CIDI-8zR.d.ts → index-C_NTOcet.d.ts} +98 -98
@@ -3534,6 +3534,1007 @@
3534
3534
  },
3535
3535
  "description": "Object-level validation rules"
3536
3536
  },
3537
+ "stateMachine": {
3538
+ "type": "object",
3539
+ "properties": {
3540
+ "id": {
3541
+ "type": "string",
3542
+ "minLength": 2,
3543
+ "pattern": "^[a-z][a-z0-9_]*$",
3544
+ "description": "Unique Machine ID"
3545
+ },
3546
+ "description": {
3547
+ "type": "string"
3548
+ },
3549
+ "contextSchema": {
3550
+ "type": "object",
3551
+ "additionalProperties": {},
3552
+ "description": "Zod Schema for the machine context/memory"
3553
+ },
3554
+ "initial": {
3555
+ "type": "string",
3556
+ "description": "Initial State ID"
3557
+ },
3558
+ "states": {
3559
+ "type": "object",
3560
+ "additionalProperties": {
3561
+ "type": "object",
3562
+ "properties": {
3563
+ "type": {
3564
+ "type": "string",
3565
+ "enum": [
3566
+ "atomic",
3567
+ "compound",
3568
+ "parallel",
3569
+ "final",
3570
+ "history"
3571
+ ],
3572
+ "default": "atomic"
3573
+ },
3574
+ "entry": {
3575
+ "type": "array",
3576
+ "items": {
3577
+ "anyOf": [
3578
+ {
3579
+ "type": "string",
3580
+ "description": "Action Name"
3581
+ },
3582
+ {
3583
+ "type": "object",
3584
+ "properties": {
3585
+ "type": {
3586
+ "type": "string"
3587
+ },
3588
+ "params": {
3589
+ "type": "object",
3590
+ "additionalProperties": {}
3591
+ }
3592
+ },
3593
+ "required": [
3594
+ "type"
3595
+ ],
3596
+ "additionalProperties": false
3597
+ }
3598
+ ]
3599
+ },
3600
+ "description": "Actions to run when entering this state"
3601
+ },
3602
+ "exit": {
3603
+ "type": "array",
3604
+ "items": {
3605
+ "anyOf": [
3606
+ {
3607
+ "type": "string",
3608
+ "description": "Action Name"
3609
+ },
3610
+ {
3611
+ "type": "object",
3612
+ "properties": {
3613
+ "type": {
3614
+ "type": "string"
3615
+ },
3616
+ "params": {
3617
+ "type": "object",
3618
+ "additionalProperties": {}
3619
+ }
3620
+ },
3621
+ "required": [
3622
+ "type"
3623
+ ],
3624
+ "additionalProperties": false
3625
+ }
3626
+ ]
3627
+ },
3628
+ "description": "Actions to run when leaving this state"
3629
+ },
3630
+ "on": {
3631
+ "type": "object",
3632
+ "additionalProperties": {
3633
+ "anyOf": [
3634
+ {
3635
+ "type": "string"
3636
+ },
3637
+ {
3638
+ "type": "object",
3639
+ "properties": {
3640
+ "target": {
3641
+ "type": "string",
3642
+ "description": "Target State ID"
3643
+ },
3644
+ "cond": {
3645
+ "anyOf": [
3646
+ {
3647
+ "type": "string",
3648
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
3649
+ },
3650
+ {
3651
+ "type": "object",
3652
+ "properties": {
3653
+ "type": {
3654
+ "type": "string"
3655
+ },
3656
+ "params": {
3657
+ "type": "object",
3658
+ "additionalProperties": {}
3659
+ }
3660
+ },
3661
+ "required": [
3662
+ "type"
3663
+ ],
3664
+ "additionalProperties": false
3665
+ }
3666
+ ],
3667
+ "description": "Condition (Guard) required to take this path"
3668
+ },
3669
+ "actions": {
3670
+ "type": "array",
3671
+ "items": {
3672
+ "anyOf": [
3673
+ {
3674
+ "type": "string",
3675
+ "description": "Action Name"
3676
+ },
3677
+ {
3678
+ "type": "object",
3679
+ "properties": {
3680
+ "type": {
3681
+ "type": "string"
3682
+ },
3683
+ "params": {
3684
+ "type": "object",
3685
+ "additionalProperties": {}
3686
+ }
3687
+ },
3688
+ "required": [
3689
+ "type"
3690
+ ],
3691
+ "additionalProperties": false
3692
+ }
3693
+ ]
3694
+ },
3695
+ "description": "Actions to execute during transition"
3696
+ },
3697
+ "description": {
3698
+ "type": "string",
3699
+ "description": "Human readable description of this rule"
3700
+ }
3701
+ },
3702
+ "additionalProperties": false
3703
+ },
3704
+ {
3705
+ "type": "array",
3706
+ "items": {
3707
+ "type": "object",
3708
+ "properties": {
3709
+ "target": {
3710
+ "type": "string",
3711
+ "description": "Target State ID"
3712
+ },
3713
+ "cond": {
3714
+ "anyOf": [
3715
+ {
3716
+ "type": "string",
3717
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
3718
+ },
3719
+ {
3720
+ "type": "object",
3721
+ "properties": {
3722
+ "type": {
3723
+ "type": "string"
3724
+ },
3725
+ "params": {
3726
+ "type": "object",
3727
+ "additionalProperties": {}
3728
+ }
3729
+ },
3730
+ "required": [
3731
+ "type"
3732
+ ],
3733
+ "additionalProperties": false
3734
+ }
3735
+ ],
3736
+ "description": "Condition (Guard) required to take this path"
3737
+ },
3738
+ "actions": {
3739
+ "type": "array",
3740
+ "items": {
3741
+ "anyOf": [
3742
+ {
3743
+ "type": "string",
3744
+ "description": "Action Name"
3745
+ },
3746
+ {
3747
+ "type": "object",
3748
+ "properties": {
3749
+ "type": {
3750
+ "type": "string"
3751
+ },
3752
+ "params": {
3753
+ "type": "object",
3754
+ "additionalProperties": {}
3755
+ }
3756
+ },
3757
+ "required": [
3758
+ "type"
3759
+ ],
3760
+ "additionalProperties": false
3761
+ }
3762
+ ]
3763
+ },
3764
+ "description": "Actions to execute during transition"
3765
+ },
3766
+ "description": {
3767
+ "type": "string",
3768
+ "description": "Human readable description of this rule"
3769
+ }
3770
+ },
3771
+ "additionalProperties": false
3772
+ }
3773
+ }
3774
+ ]
3775
+ },
3776
+ "description": "Map of Event Type -> Transition Definition"
3777
+ },
3778
+ "always": {
3779
+ "type": "array",
3780
+ "items": {
3781
+ "type": "object",
3782
+ "properties": {
3783
+ "target": {
3784
+ "type": "string",
3785
+ "description": "Target State ID"
3786
+ },
3787
+ "cond": {
3788
+ "anyOf": [
3789
+ {
3790
+ "type": "string",
3791
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
3792
+ },
3793
+ {
3794
+ "type": "object",
3795
+ "properties": {
3796
+ "type": {
3797
+ "type": "string"
3798
+ },
3799
+ "params": {
3800
+ "type": "object",
3801
+ "additionalProperties": {}
3802
+ }
3803
+ },
3804
+ "required": [
3805
+ "type"
3806
+ ],
3807
+ "additionalProperties": false
3808
+ }
3809
+ ],
3810
+ "description": "Condition (Guard) required to take this path"
3811
+ },
3812
+ "actions": {
3813
+ "type": "array",
3814
+ "items": {
3815
+ "anyOf": [
3816
+ {
3817
+ "type": "string",
3818
+ "description": "Action Name"
3819
+ },
3820
+ {
3821
+ "type": "object",
3822
+ "properties": {
3823
+ "type": {
3824
+ "type": "string"
3825
+ },
3826
+ "params": {
3827
+ "type": "object",
3828
+ "additionalProperties": {}
3829
+ }
3830
+ },
3831
+ "required": [
3832
+ "type"
3833
+ ],
3834
+ "additionalProperties": false
3835
+ }
3836
+ ]
3837
+ },
3838
+ "description": "Actions to execute during transition"
3839
+ },
3840
+ "description": {
3841
+ "type": "string",
3842
+ "description": "Human readable description of this rule"
3843
+ }
3844
+ },
3845
+ "additionalProperties": false
3846
+ }
3847
+ },
3848
+ "initial": {
3849
+ "type": "string",
3850
+ "description": "Initial child state (if compound)"
3851
+ },
3852
+ "states": {
3853
+ "type": "object",
3854
+ "additionalProperties": {}
3855
+ },
3856
+ "meta": {
3857
+ "type": "object",
3858
+ "properties": {
3859
+ "label": {
3860
+ "type": "string"
3861
+ },
3862
+ "description": {
3863
+ "type": "string"
3864
+ },
3865
+ "color": {
3866
+ "type": "string"
3867
+ },
3868
+ "aiInstructions": {
3869
+ "type": "string",
3870
+ "description": "Specific instructions for AI when in this state"
3871
+ }
3872
+ },
3873
+ "additionalProperties": false
3874
+ }
3875
+ },
3876
+ "additionalProperties": false
3877
+ },
3878
+ "description": "State Nodes"
3879
+ },
3880
+ "on": {
3881
+ "type": "object",
3882
+ "additionalProperties": {
3883
+ "anyOf": [
3884
+ {
3885
+ "type": "string"
3886
+ },
3887
+ {
3888
+ "type": "object",
3889
+ "properties": {
3890
+ "target": {
3891
+ "type": "string",
3892
+ "description": "Target State ID"
3893
+ },
3894
+ "cond": {
3895
+ "anyOf": [
3896
+ {
3897
+ "type": "string",
3898
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
3899
+ },
3900
+ {
3901
+ "type": "object",
3902
+ "properties": {
3903
+ "type": {
3904
+ "type": "string"
3905
+ },
3906
+ "params": {
3907
+ "type": "object",
3908
+ "additionalProperties": {}
3909
+ }
3910
+ },
3911
+ "required": [
3912
+ "type"
3913
+ ],
3914
+ "additionalProperties": false
3915
+ }
3916
+ ],
3917
+ "description": "Condition (Guard) required to take this path"
3918
+ },
3919
+ "actions": {
3920
+ "type": "array",
3921
+ "items": {
3922
+ "anyOf": [
3923
+ {
3924
+ "type": "string",
3925
+ "description": "Action Name"
3926
+ },
3927
+ {
3928
+ "type": "object",
3929
+ "properties": {
3930
+ "type": {
3931
+ "type": "string"
3932
+ },
3933
+ "params": {
3934
+ "type": "object",
3935
+ "additionalProperties": {}
3936
+ }
3937
+ },
3938
+ "required": [
3939
+ "type"
3940
+ ],
3941
+ "additionalProperties": false
3942
+ }
3943
+ ]
3944
+ },
3945
+ "description": "Actions to execute during transition"
3946
+ },
3947
+ "description": {
3948
+ "type": "string",
3949
+ "description": "Human readable description of this rule"
3950
+ }
3951
+ },
3952
+ "additionalProperties": false
3953
+ },
3954
+ {
3955
+ "type": "array",
3956
+ "items": {
3957
+ "type": "object",
3958
+ "properties": {
3959
+ "target": {
3960
+ "type": "string",
3961
+ "description": "Target State ID"
3962
+ },
3963
+ "cond": {
3964
+ "anyOf": [
3965
+ {
3966
+ "type": "string",
3967
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
3968
+ },
3969
+ {
3970
+ "type": "object",
3971
+ "properties": {
3972
+ "type": {
3973
+ "type": "string"
3974
+ },
3975
+ "params": {
3976
+ "type": "object",
3977
+ "additionalProperties": {}
3978
+ }
3979
+ },
3980
+ "required": [
3981
+ "type"
3982
+ ],
3983
+ "additionalProperties": false
3984
+ }
3985
+ ],
3986
+ "description": "Condition (Guard) required to take this path"
3987
+ },
3988
+ "actions": {
3989
+ "type": "array",
3990
+ "items": {
3991
+ "anyOf": [
3992
+ {
3993
+ "type": "string",
3994
+ "description": "Action Name"
3995
+ },
3996
+ {
3997
+ "type": "object",
3998
+ "properties": {
3999
+ "type": {
4000
+ "type": "string"
4001
+ },
4002
+ "params": {
4003
+ "type": "object",
4004
+ "additionalProperties": {}
4005
+ }
4006
+ },
4007
+ "required": [
4008
+ "type"
4009
+ ],
4010
+ "additionalProperties": false
4011
+ }
4012
+ ]
4013
+ },
4014
+ "description": "Actions to execute during transition"
4015
+ },
4016
+ "description": {
4017
+ "type": "string",
4018
+ "description": "Human readable description of this rule"
4019
+ }
4020
+ },
4021
+ "additionalProperties": false
4022
+ }
4023
+ }
4024
+ ]
4025
+ }
4026
+ }
4027
+ },
4028
+ "required": [
4029
+ "id",
4030
+ "initial",
4031
+ "states"
4032
+ ],
4033
+ "additionalProperties": false,
4034
+ "description": "Single state machine for record lifecycle (shorthand)"
4035
+ },
4036
+ "stateMachines": {
4037
+ "type": "object",
4038
+ "additionalProperties": {
4039
+ "type": "object",
4040
+ "properties": {
4041
+ "id": {
4042
+ "type": "string",
4043
+ "minLength": 2,
4044
+ "pattern": "^[a-z][a-z0-9_]*$",
4045
+ "description": "Unique Machine ID"
4046
+ },
4047
+ "description": {
4048
+ "type": "string"
4049
+ },
4050
+ "contextSchema": {
4051
+ "type": "object",
4052
+ "additionalProperties": {},
4053
+ "description": "Zod Schema for the machine context/memory"
4054
+ },
4055
+ "initial": {
4056
+ "type": "string",
4057
+ "description": "Initial State ID"
4058
+ },
4059
+ "states": {
4060
+ "type": "object",
4061
+ "additionalProperties": {
4062
+ "type": "object",
4063
+ "properties": {
4064
+ "type": {
4065
+ "type": "string",
4066
+ "enum": [
4067
+ "atomic",
4068
+ "compound",
4069
+ "parallel",
4070
+ "final",
4071
+ "history"
4072
+ ],
4073
+ "default": "atomic"
4074
+ },
4075
+ "entry": {
4076
+ "type": "array",
4077
+ "items": {
4078
+ "anyOf": [
4079
+ {
4080
+ "type": "string",
4081
+ "description": "Action Name"
4082
+ },
4083
+ {
4084
+ "type": "object",
4085
+ "properties": {
4086
+ "type": {
4087
+ "type": "string"
4088
+ },
4089
+ "params": {
4090
+ "type": "object",
4091
+ "additionalProperties": {}
4092
+ }
4093
+ },
4094
+ "required": [
4095
+ "type"
4096
+ ],
4097
+ "additionalProperties": false
4098
+ }
4099
+ ]
4100
+ },
4101
+ "description": "Actions to run when entering this state"
4102
+ },
4103
+ "exit": {
4104
+ "type": "array",
4105
+ "items": {
4106
+ "anyOf": [
4107
+ {
4108
+ "type": "string",
4109
+ "description": "Action Name"
4110
+ },
4111
+ {
4112
+ "type": "object",
4113
+ "properties": {
4114
+ "type": {
4115
+ "type": "string"
4116
+ },
4117
+ "params": {
4118
+ "type": "object",
4119
+ "additionalProperties": {}
4120
+ }
4121
+ },
4122
+ "required": [
4123
+ "type"
4124
+ ],
4125
+ "additionalProperties": false
4126
+ }
4127
+ ]
4128
+ },
4129
+ "description": "Actions to run when leaving this state"
4130
+ },
4131
+ "on": {
4132
+ "type": "object",
4133
+ "additionalProperties": {
4134
+ "anyOf": [
4135
+ {
4136
+ "type": "string"
4137
+ },
4138
+ {
4139
+ "type": "object",
4140
+ "properties": {
4141
+ "target": {
4142
+ "type": "string",
4143
+ "description": "Target State ID"
4144
+ },
4145
+ "cond": {
4146
+ "anyOf": [
4147
+ {
4148
+ "type": "string",
4149
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
4150
+ },
4151
+ {
4152
+ "type": "object",
4153
+ "properties": {
4154
+ "type": {
4155
+ "type": "string"
4156
+ },
4157
+ "params": {
4158
+ "type": "object",
4159
+ "additionalProperties": {}
4160
+ }
4161
+ },
4162
+ "required": [
4163
+ "type"
4164
+ ],
4165
+ "additionalProperties": false
4166
+ }
4167
+ ],
4168
+ "description": "Condition (Guard) required to take this path"
4169
+ },
4170
+ "actions": {
4171
+ "type": "array",
4172
+ "items": {
4173
+ "anyOf": [
4174
+ {
4175
+ "type": "string",
4176
+ "description": "Action Name"
4177
+ },
4178
+ {
4179
+ "type": "object",
4180
+ "properties": {
4181
+ "type": {
4182
+ "type": "string"
4183
+ },
4184
+ "params": {
4185
+ "type": "object",
4186
+ "additionalProperties": {}
4187
+ }
4188
+ },
4189
+ "required": [
4190
+ "type"
4191
+ ],
4192
+ "additionalProperties": false
4193
+ }
4194
+ ]
4195
+ },
4196
+ "description": "Actions to execute during transition"
4197
+ },
4198
+ "description": {
4199
+ "type": "string",
4200
+ "description": "Human readable description of this rule"
4201
+ }
4202
+ },
4203
+ "additionalProperties": false
4204
+ },
4205
+ {
4206
+ "type": "array",
4207
+ "items": {
4208
+ "type": "object",
4209
+ "properties": {
4210
+ "target": {
4211
+ "type": "string",
4212
+ "description": "Target State ID"
4213
+ },
4214
+ "cond": {
4215
+ "anyOf": [
4216
+ {
4217
+ "type": "string",
4218
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
4219
+ },
4220
+ {
4221
+ "type": "object",
4222
+ "properties": {
4223
+ "type": {
4224
+ "type": "string"
4225
+ },
4226
+ "params": {
4227
+ "type": "object",
4228
+ "additionalProperties": {}
4229
+ }
4230
+ },
4231
+ "required": [
4232
+ "type"
4233
+ ],
4234
+ "additionalProperties": false
4235
+ }
4236
+ ],
4237
+ "description": "Condition (Guard) required to take this path"
4238
+ },
4239
+ "actions": {
4240
+ "type": "array",
4241
+ "items": {
4242
+ "anyOf": [
4243
+ {
4244
+ "type": "string",
4245
+ "description": "Action Name"
4246
+ },
4247
+ {
4248
+ "type": "object",
4249
+ "properties": {
4250
+ "type": {
4251
+ "type": "string"
4252
+ },
4253
+ "params": {
4254
+ "type": "object",
4255
+ "additionalProperties": {}
4256
+ }
4257
+ },
4258
+ "required": [
4259
+ "type"
4260
+ ],
4261
+ "additionalProperties": false
4262
+ }
4263
+ ]
4264
+ },
4265
+ "description": "Actions to execute during transition"
4266
+ },
4267
+ "description": {
4268
+ "type": "string",
4269
+ "description": "Human readable description of this rule"
4270
+ }
4271
+ },
4272
+ "additionalProperties": false
4273
+ }
4274
+ }
4275
+ ]
4276
+ },
4277
+ "description": "Map of Event Type -> Transition Definition"
4278
+ },
4279
+ "always": {
4280
+ "type": "array",
4281
+ "items": {
4282
+ "type": "object",
4283
+ "properties": {
4284
+ "target": {
4285
+ "type": "string",
4286
+ "description": "Target State ID"
4287
+ },
4288
+ "cond": {
4289
+ "anyOf": [
4290
+ {
4291
+ "type": "string",
4292
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
4293
+ },
4294
+ {
4295
+ "type": "object",
4296
+ "properties": {
4297
+ "type": {
4298
+ "type": "string"
4299
+ },
4300
+ "params": {
4301
+ "type": "object",
4302
+ "additionalProperties": {}
4303
+ }
4304
+ },
4305
+ "required": [
4306
+ "type"
4307
+ ],
4308
+ "additionalProperties": false
4309
+ }
4310
+ ],
4311
+ "description": "Condition (Guard) required to take this path"
4312
+ },
4313
+ "actions": {
4314
+ "type": "array",
4315
+ "items": {
4316
+ "anyOf": [
4317
+ {
4318
+ "type": "string",
4319
+ "description": "Action Name"
4320
+ },
4321
+ {
4322
+ "type": "object",
4323
+ "properties": {
4324
+ "type": {
4325
+ "type": "string"
4326
+ },
4327
+ "params": {
4328
+ "type": "object",
4329
+ "additionalProperties": {}
4330
+ }
4331
+ },
4332
+ "required": [
4333
+ "type"
4334
+ ],
4335
+ "additionalProperties": false
4336
+ }
4337
+ ]
4338
+ },
4339
+ "description": "Actions to execute during transition"
4340
+ },
4341
+ "description": {
4342
+ "type": "string",
4343
+ "description": "Human readable description of this rule"
4344
+ }
4345
+ },
4346
+ "additionalProperties": false
4347
+ }
4348
+ },
4349
+ "initial": {
4350
+ "type": "string",
4351
+ "description": "Initial child state (if compound)"
4352
+ },
4353
+ "states": {
4354
+ "type": "object",
4355
+ "additionalProperties": {}
4356
+ },
4357
+ "meta": {
4358
+ "type": "object",
4359
+ "properties": {
4360
+ "label": {
4361
+ "type": "string"
4362
+ },
4363
+ "description": {
4364
+ "type": "string"
4365
+ },
4366
+ "color": {
4367
+ "type": "string"
4368
+ },
4369
+ "aiInstructions": {
4370
+ "type": "string",
4371
+ "description": "Specific instructions for AI when in this state"
4372
+ }
4373
+ },
4374
+ "additionalProperties": false
4375
+ }
4376
+ },
4377
+ "additionalProperties": false
4378
+ },
4379
+ "description": "State Nodes"
4380
+ },
4381
+ "on": {
4382
+ "type": "object",
4383
+ "additionalProperties": {
4384
+ "anyOf": [
4385
+ {
4386
+ "type": "string"
4387
+ },
4388
+ {
4389
+ "type": "object",
4390
+ "properties": {
4391
+ "target": {
4392
+ "type": "string",
4393
+ "description": "Target State ID"
4394
+ },
4395
+ "cond": {
4396
+ "anyOf": [
4397
+ {
4398
+ "type": "string",
4399
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
4400
+ },
4401
+ {
4402
+ "type": "object",
4403
+ "properties": {
4404
+ "type": {
4405
+ "type": "string"
4406
+ },
4407
+ "params": {
4408
+ "type": "object",
4409
+ "additionalProperties": {}
4410
+ }
4411
+ },
4412
+ "required": [
4413
+ "type"
4414
+ ],
4415
+ "additionalProperties": false
4416
+ }
4417
+ ],
4418
+ "description": "Condition (Guard) required to take this path"
4419
+ },
4420
+ "actions": {
4421
+ "type": "array",
4422
+ "items": {
4423
+ "anyOf": [
4424
+ {
4425
+ "type": "string",
4426
+ "description": "Action Name"
4427
+ },
4428
+ {
4429
+ "type": "object",
4430
+ "properties": {
4431
+ "type": {
4432
+ "type": "string"
4433
+ },
4434
+ "params": {
4435
+ "type": "object",
4436
+ "additionalProperties": {}
4437
+ }
4438
+ },
4439
+ "required": [
4440
+ "type"
4441
+ ],
4442
+ "additionalProperties": false
4443
+ }
4444
+ ]
4445
+ },
4446
+ "description": "Actions to execute during transition"
4447
+ },
4448
+ "description": {
4449
+ "type": "string",
4450
+ "description": "Human readable description of this rule"
4451
+ }
4452
+ },
4453
+ "additionalProperties": false
4454
+ },
4455
+ {
4456
+ "type": "array",
4457
+ "items": {
4458
+ "type": "object",
4459
+ "properties": {
4460
+ "target": {
4461
+ "type": "string",
4462
+ "description": "Target State ID"
4463
+ },
4464
+ "cond": {
4465
+ "anyOf": [
4466
+ {
4467
+ "type": "string",
4468
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
4469
+ },
4470
+ {
4471
+ "type": "object",
4472
+ "properties": {
4473
+ "type": {
4474
+ "type": "string"
4475
+ },
4476
+ "params": {
4477
+ "type": "object",
4478
+ "additionalProperties": {}
4479
+ }
4480
+ },
4481
+ "required": [
4482
+ "type"
4483
+ ],
4484
+ "additionalProperties": false
4485
+ }
4486
+ ],
4487
+ "description": "Condition (Guard) required to take this path"
4488
+ },
4489
+ "actions": {
4490
+ "type": "array",
4491
+ "items": {
4492
+ "anyOf": [
4493
+ {
4494
+ "type": "string",
4495
+ "description": "Action Name"
4496
+ },
4497
+ {
4498
+ "type": "object",
4499
+ "properties": {
4500
+ "type": {
4501
+ "type": "string"
4502
+ },
4503
+ "params": {
4504
+ "type": "object",
4505
+ "additionalProperties": {}
4506
+ }
4507
+ },
4508
+ "required": [
4509
+ "type"
4510
+ ],
4511
+ "additionalProperties": false
4512
+ }
4513
+ ]
4514
+ },
4515
+ "description": "Actions to execute during transition"
4516
+ },
4517
+ "description": {
4518
+ "type": "string",
4519
+ "description": "Human readable description of this rule"
4520
+ }
4521
+ },
4522
+ "additionalProperties": false
4523
+ }
4524
+ }
4525
+ ]
4526
+ }
4527
+ }
4528
+ },
4529
+ "required": [
4530
+ "id",
4531
+ "initial",
4532
+ "states"
4533
+ ],
4534
+ "additionalProperties": false
4535
+ },
4536
+ "description": "Named state machines for parallel lifecycles (e.g., status, payment, approval)"
4537
+ },
3537
4538
  "titleFormat": {
3538
4539
  "type": "string",
3539
4540
  "description": "Title expression (e.g. \"{name} - {code}\"). Overrides nameField."
@@ -6845,7 +7846,167 @@
6845
7846
  "name",
6846
7847
  "message",
6847
7848
  "type",
6848
- "field"
7849
+ "field"
7850
+ ],
7851
+ "additionalProperties": false
7852
+ },
7853
+ {
7854
+ "type": "object",
7855
+ "properties": {
7856
+ "name": {
7857
+ "type": "string",
7858
+ "pattern": "^[a-z_][a-z0-9_]*$",
7859
+ "description": "Unique rule name (snake_case)"
7860
+ },
7861
+ "label": {
7862
+ "type": "string",
7863
+ "description": "Human-readable label for the rule listing"
7864
+ },
7865
+ "description": {
7866
+ "type": "string",
7867
+ "description": "Administrative notes explaining the business reason"
7868
+ },
7869
+ "active": {
7870
+ "type": "boolean",
7871
+ "default": true
7872
+ },
7873
+ "events": {
7874
+ "type": "array",
7875
+ "items": {
7876
+ "type": "string",
7877
+ "enum": [
7878
+ "insert",
7879
+ "update",
7880
+ "delete"
7881
+ ]
7882
+ },
7883
+ "default": [
7884
+ "insert",
7885
+ "update"
7886
+ ],
7887
+ "description": "Validation contexts"
7888
+ },
7889
+ "tags": {
7890
+ "type": "array",
7891
+ "items": {
7892
+ "type": "string"
7893
+ },
7894
+ "description": "Categorization tags (e.g., \"compliance\", \"billing\")"
7895
+ },
7896
+ "severity": {
7897
+ "type": "string",
7898
+ "enum": [
7899
+ "error",
7900
+ "warning",
7901
+ "info"
7902
+ ],
7903
+ "default": "error"
7904
+ },
7905
+ "message": {
7906
+ "type": "string",
7907
+ "description": "Error message to display to the user"
7908
+ },
7909
+ "type": {
7910
+ "type": "string",
7911
+ "const": "cross_field"
7912
+ },
7913
+ "condition": {
7914
+ "type": "string",
7915
+ "description": "Formula expression comparing fields (e.g. \"end_date > start_date\")"
7916
+ },
7917
+ "fields": {
7918
+ "type": "array",
7919
+ "items": {
7920
+ "type": "string"
7921
+ },
7922
+ "description": "Fields involved in the validation"
7923
+ }
7924
+ },
7925
+ "required": [
7926
+ "name",
7927
+ "message",
7928
+ "type",
7929
+ "condition",
7930
+ "fields"
7931
+ ],
7932
+ "additionalProperties": false
7933
+ },
7934
+ {
7935
+ "type": "object",
7936
+ "properties": {
7937
+ "name": {
7938
+ "type": "string",
7939
+ "pattern": "^[a-z_][a-z0-9_]*$",
7940
+ "description": "Unique rule name (snake_case)"
7941
+ },
7942
+ "label": {
7943
+ "type": "string",
7944
+ "description": "Human-readable label for the rule listing"
7945
+ },
7946
+ "description": {
7947
+ "type": "string",
7948
+ "description": "Administrative notes explaining the business reason"
7949
+ },
7950
+ "active": {
7951
+ "type": "boolean",
7952
+ "default": true
7953
+ },
7954
+ "events": {
7955
+ "type": "array",
7956
+ "items": {
7957
+ "type": "string",
7958
+ "enum": [
7959
+ "insert",
7960
+ "update",
7961
+ "delete"
7962
+ ]
7963
+ },
7964
+ "default": [
7965
+ "insert",
7966
+ "update"
7967
+ ],
7968
+ "description": "Validation contexts"
7969
+ },
7970
+ "tags": {
7971
+ "type": "array",
7972
+ "items": {
7973
+ "type": "string"
7974
+ },
7975
+ "description": "Categorization tags (e.g., \"compliance\", \"billing\")"
7976
+ },
7977
+ "severity": {
7978
+ "type": "string",
7979
+ "enum": [
7980
+ "error",
7981
+ "warning",
7982
+ "info"
7983
+ ],
7984
+ "default": "error"
7985
+ },
7986
+ "message": {
7987
+ "type": "string",
7988
+ "description": "Error message to display to the user"
7989
+ },
7990
+ "type": {
7991
+ "type": "string",
7992
+ "const": "json_schema"
7993
+ },
7994
+ "field": {
7995
+ "type": "string",
7996
+ "description": "JSON field to validate"
7997
+ },
7998
+ "schema": {
7999
+ "type": "object",
8000
+ "additionalProperties": {},
8001
+ "description": "JSON Schema object definition"
8002
+ }
8003
+ },
8004
+ "required": [
8005
+ "name",
8006
+ "message",
8007
+ "type",
8008
+ "field",
8009
+ "schema"
6849
8010
  ],
6850
8011
  "additionalProperties": false
6851
8012
  },
@@ -6907,26 +8068,56 @@
6907
8068
  },
6908
8069
  "type": {
6909
8070
  "type": "string",
6910
- "const": "cross_field"
8071
+ "const": "async"
6911
8072
  },
6912
- "condition": {
8073
+ "field": {
6913
8074
  "type": "string",
6914
- "description": "Formula expression comparing fields (e.g. \"end_date > start_date\")"
8075
+ "description": "Field to validate"
6915
8076
  },
6916
- "fields": {
6917
- "type": "array",
6918
- "items": {
8077
+ "validatorUrl": {
8078
+ "type": "string",
8079
+ "description": "External API endpoint for validation"
8080
+ },
8081
+ "method": {
8082
+ "type": "string",
8083
+ "enum": [
8084
+ "GET",
8085
+ "POST"
8086
+ ],
8087
+ "default": "GET",
8088
+ "description": "HTTP method for external call"
8089
+ },
8090
+ "headers": {
8091
+ "type": "object",
8092
+ "additionalProperties": {
6919
8093
  "type": "string"
6920
8094
  },
6921
- "description": "Fields involved in the validation"
8095
+ "description": "Custom headers for the request"
8096
+ },
8097
+ "validatorFunction": {
8098
+ "type": "string",
8099
+ "description": "Reference to custom validator function"
8100
+ },
8101
+ "timeout": {
8102
+ "type": "number",
8103
+ "default": 5000,
8104
+ "description": "Timeout in milliseconds"
8105
+ },
8106
+ "debounce": {
8107
+ "type": "number",
8108
+ "description": "Debounce delay in milliseconds"
8109
+ },
8110
+ "params": {
8111
+ "type": "object",
8112
+ "additionalProperties": {},
8113
+ "description": "Additional parameters to pass to validator"
6922
8114
  }
6923
8115
  },
6924
8116
  "required": [
6925
8117
  "name",
6926
8118
  "message",
6927
8119
  "type",
6928
- "condition",
6929
- "fields"
8120
+ "field"
6930
8121
  ],
6931
8122
  "additionalProperties": false
6932
8123
  },
@@ -6988,236 +8179,1047 @@
6988
8179
  },
6989
8180
  "type": {
6990
8181
  "type": "string",
6991
- "const": "json_schema"
8182
+ "const": "custom"
6992
8183
  },
6993
- "field": {
8184
+ "handler": {
6994
8185
  "type": "string",
6995
- "description": "JSON field to validate"
8186
+ "description": "Name of the custom validation function registered in the system"
6996
8187
  },
6997
- "schema": {
8188
+ "params": {
6998
8189
  "type": "object",
6999
8190
  "additionalProperties": {},
7000
- "description": "JSON Schema object definition"
8191
+ "description": "Parameters passed to the custom handler"
7001
8192
  }
7002
8193
  },
7003
8194
  "required": [
7004
8195
  "name",
7005
8196
  "message",
7006
8197
  "type",
7007
- "field",
7008
- "schema"
8198
+ "handler"
7009
8199
  ],
7010
8200
  "additionalProperties": false
7011
8201
  },
7012
- {
7013
- "type": "object",
7014
- "properties": {
7015
- "name": {
7016
- "type": "string",
7017
- "pattern": "^[a-z_][a-z0-9_]*$",
7018
- "description": "Unique rule name (snake_case)"
7019
- },
7020
- "label": {
7021
- "type": "string",
7022
- "description": "Human-readable label for the rule listing"
8202
+ {}
8203
+ ],
8204
+ "description": "Validation rule to apply when condition is true"
8205
+ },
8206
+ "otherwise": {
8207
+ "description": "Validation rule to apply when condition is false"
8208
+ }
8209
+ },
8210
+ "required": [
8211
+ "name",
8212
+ "message",
8213
+ "type",
8214
+ "when",
8215
+ "then"
8216
+ ],
8217
+ "additionalProperties": false
8218
+ }
8219
+ ]
8220
+ },
8221
+ "description": "Object-level validation rules"
8222
+ },
8223
+ "stateMachine": {
8224
+ "type": "object",
8225
+ "properties": {
8226
+ "id": {
8227
+ "type": "string",
8228
+ "minLength": 2,
8229
+ "pattern": "^[a-z][a-z0-9_]*$",
8230
+ "description": "Unique Machine ID"
8231
+ },
8232
+ "description": {
8233
+ "type": "string"
8234
+ },
8235
+ "contextSchema": {
8236
+ "type": "object",
8237
+ "additionalProperties": {},
8238
+ "description": "Zod Schema for the machine context/memory"
8239
+ },
8240
+ "initial": {
8241
+ "type": "string",
8242
+ "description": "Initial State ID"
8243
+ },
8244
+ "states": {
8245
+ "type": "object",
8246
+ "additionalProperties": {
8247
+ "type": "object",
8248
+ "properties": {
8249
+ "type": {
8250
+ "type": "string",
8251
+ "enum": [
8252
+ "atomic",
8253
+ "compound",
8254
+ "parallel",
8255
+ "final",
8256
+ "history"
8257
+ ],
8258
+ "default": "atomic"
8259
+ },
8260
+ "entry": {
8261
+ "type": "array",
8262
+ "items": {
8263
+ "anyOf": [
8264
+ {
8265
+ "type": "string",
8266
+ "description": "Action Name"
8267
+ },
8268
+ {
8269
+ "type": "object",
8270
+ "properties": {
8271
+ "type": {
8272
+ "type": "string"
8273
+ },
8274
+ "params": {
8275
+ "type": "object",
8276
+ "additionalProperties": {}
8277
+ }
7023
8278
  },
7024
- "description": {
7025
- "type": "string",
7026
- "description": "Administrative notes explaining the business reason"
8279
+ "required": [
8280
+ "type"
8281
+ ],
8282
+ "additionalProperties": false
8283
+ }
8284
+ ]
8285
+ },
8286
+ "description": "Actions to run when entering this state"
8287
+ },
8288
+ "exit": {
8289
+ "type": "array",
8290
+ "items": {
8291
+ "anyOf": [
8292
+ {
8293
+ "type": "string",
8294
+ "description": "Action Name"
8295
+ },
8296
+ {
8297
+ "type": "object",
8298
+ "properties": {
8299
+ "type": {
8300
+ "type": "string"
8301
+ },
8302
+ "params": {
8303
+ "type": "object",
8304
+ "additionalProperties": {}
8305
+ }
7027
8306
  },
7028
- "active": {
7029
- "type": "boolean",
7030
- "default": true
8307
+ "required": [
8308
+ "type"
8309
+ ],
8310
+ "additionalProperties": false
8311
+ }
8312
+ ]
8313
+ },
8314
+ "description": "Actions to run when leaving this state"
8315
+ },
8316
+ "on": {
8317
+ "type": "object",
8318
+ "additionalProperties": {
8319
+ "anyOf": [
8320
+ {
8321
+ "type": "string"
8322
+ },
8323
+ {
8324
+ "type": "object",
8325
+ "properties": {
8326
+ "target": {
8327
+ "type": "string",
8328
+ "description": "Target State ID"
8329
+ },
8330
+ "cond": {
8331
+ "anyOf": [
8332
+ {
8333
+ "type": "string",
8334
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
8335
+ },
8336
+ {
8337
+ "type": "object",
8338
+ "properties": {
8339
+ "type": {
8340
+ "type": "string"
8341
+ },
8342
+ "params": {
8343
+ "type": "object",
8344
+ "additionalProperties": {}
8345
+ }
8346
+ },
8347
+ "required": [
8348
+ "type"
8349
+ ],
8350
+ "additionalProperties": false
8351
+ }
8352
+ ],
8353
+ "description": "Condition (Guard) required to take this path"
8354
+ },
8355
+ "actions": {
8356
+ "type": "array",
8357
+ "items": {
8358
+ "anyOf": [
8359
+ {
8360
+ "type": "string",
8361
+ "description": "Action Name"
8362
+ },
8363
+ {
8364
+ "type": "object",
8365
+ "properties": {
8366
+ "type": {
8367
+ "type": "string"
8368
+ },
8369
+ "params": {
8370
+ "type": "object",
8371
+ "additionalProperties": {}
8372
+ }
8373
+ },
8374
+ "required": [
8375
+ "type"
8376
+ ],
8377
+ "additionalProperties": false
8378
+ }
8379
+ ]
8380
+ },
8381
+ "description": "Actions to execute during transition"
8382
+ },
8383
+ "description": {
8384
+ "type": "string",
8385
+ "description": "Human readable description of this rule"
8386
+ }
7031
8387
  },
7032
- "events": {
7033
- "type": "array",
7034
- "items": {
8388
+ "additionalProperties": false
8389
+ },
8390
+ {
8391
+ "type": "array",
8392
+ "items": {
8393
+ "type": "object",
8394
+ "properties": {
8395
+ "target": {
8396
+ "type": "string",
8397
+ "description": "Target State ID"
8398
+ },
8399
+ "cond": {
8400
+ "anyOf": [
8401
+ {
8402
+ "type": "string",
8403
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
8404
+ },
8405
+ {
8406
+ "type": "object",
8407
+ "properties": {
8408
+ "type": {
8409
+ "type": "string"
8410
+ },
8411
+ "params": {
8412
+ "type": "object",
8413
+ "additionalProperties": {}
8414
+ }
8415
+ },
8416
+ "required": [
8417
+ "type"
8418
+ ],
8419
+ "additionalProperties": false
8420
+ }
8421
+ ],
8422
+ "description": "Condition (Guard) required to take this path"
8423
+ },
8424
+ "actions": {
8425
+ "type": "array",
8426
+ "items": {
8427
+ "anyOf": [
8428
+ {
8429
+ "type": "string",
8430
+ "description": "Action Name"
8431
+ },
8432
+ {
8433
+ "type": "object",
8434
+ "properties": {
8435
+ "type": {
8436
+ "type": "string"
8437
+ },
8438
+ "params": {
8439
+ "type": "object",
8440
+ "additionalProperties": {}
8441
+ }
8442
+ },
8443
+ "required": [
8444
+ "type"
8445
+ ],
8446
+ "additionalProperties": false
8447
+ }
8448
+ ]
8449
+ },
8450
+ "description": "Actions to execute during transition"
8451
+ },
8452
+ "description": {
8453
+ "type": "string",
8454
+ "description": "Human readable description of this rule"
8455
+ }
8456
+ },
8457
+ "additionalProperties": false
8458
+ }
8459
+ }
8460
+ ]
8461
+ },
8462
+ "description": "Map of Event Type -> Transition Definition"
8463
+ },
8464
+ "always": {
8465
+ "type": "array",
8466
+ "items": {
8467
+ "type": "object",
8468
+ "properties": {
8469
+ "target": {
8470
+ "type": "string",
8471
+ "description": "Target State ID"
8472
+ },
8473
+ "cond": {
8474
+ "anyOf": [
8475
+ {
7035
8476
  "type": "string",
7036
- "enum": [
7037
- "insert",
7038
- "update",
7039
- "delete"
7040
- ]
8477
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
7041
8478
  },
7042
- "default": [
7043
- "insert",
7044
- "update"
7045
- ],
7046
- "description": "Validation contexts"
8479
+ {
8480
+ "type": "object",
8481
+ "properties": {
8482
+ "type": {
8483
+ "type": "string"
8484
+ },
8485
+ "params": {
8486
+ "type": "object",
8487
+ "additionalProperties": {}
8488
+ }
8489
+ },
8490
+ "required": [
8491
+ "type"
8492
+ ],
8493
+ "additionalProperties": false
8494
+ }
8495
+ ],
8496
+ "description": "Condition (Guard) required to take this path"
8497
+ },
8498
+ "actions": {
8499
+ "type": "array",
8500
+ "items": {
8501
+ "anyOf": [
8502
+ {
8503
+ "type": "string",
8504
+ "description": "Action Name"
8505
+ },
8506
+ {
8507
+ "type": "object",
8508
+ "properties": {
8509
+ "type": {
8510
+ "type": "string"
8511
+ },
8512
+ "params": {
8513
+ "type": "object",
8514
+ "additionalProperties": {}
8515
+ }
8516
+ },
8517
+ "required": [
8518
+ "type"
8519
+ ],
8520
+ "additionalProperties": false
8521
+ }
8522
+ ]
7047
8523
  },
7048
- "tags": {
7049
- "type": "array",
7050
- "items": {
7051
- "type": "string"
8524
+ "description": "Actions to execute during transition"
8525
+ },
8526
+ "description": {
8527
+ "type": "string",
8528
+ "description": "Human readable description of this rule"
8529
+ }
8530
+ },
8531
+ "additionalProperties": false
8532
+ }
8533
+ },
8534
+ "initial": {
8535
+ "type": "string",
8536
+ "description": "Initial child state (if compound)"
8537
+ },
8538
+ "states": {
8539
+ "type": "object",
8540
+ "additionalProperties": {}
8541
+ },
8542
+ "meta": {
8543
+ "type": "object",
8544
+ "properties": {
8545
+ "label": {
8546
+ "type": "string"
8547
+ },
8548
+ "description": {
8549
+ "type": "string"
8550
+ },
8551
+ "color": {
8552
+ "type": "string"
8553
+ },
8554
+ "aiInstructions": {
8555
+ "type": "string",
8556
+ "description": "Specific instructions for AI when in this state"
8557
+ }
8558
+ },
8559
+ "additionalProperties": false
8560
+ }
8561
+ },
8562
+ "additionalProperties": false
8563
+ },
8564
+ "description": "State Nodes"
8565
+ },
8566
+ "on": {
8567
+ "type": "object",
8568
+ "additionalProperties": {
8569
+ "anyOf": [
8570
+ {
8571
+ "type": "string"
8572
+ },
8573
+ {
8574
+ "type": "object",
8575
+ "properties": {
8576
+ "target": {
8577
+ "type": "string",
8578
+ "description": "Target State ID"
8579
+ },
8580
+ "cond": {
8581
+ "anyOf": [
8582
+ {
8583
+ "type": "string",
8584
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
8585
+ },
8586
+ {
8587
+ "type": "object",
8588
+ "properties": {
8589
+ "type": {
8590
+ "type": "string"
8591
+ },
8592
+ "params": {
8593
+ "type": "object",
8594
+ "additionalProperties": {}
8595
+ }
8596
+ },
8597
+ "required": [
8598
+ "type"
8599
+ ],
8600
+ "additionalProperties": false
8601
+ }
8602
+ ],
8603
+ "description": "Condition (Guard) required to take this path"
8604
+ },
8605
+ "actions": {
8606
+ "type": "array",
8607
+ "items": {
8608
+ "anyOf": [
8609
+ {
8610
+ "type": "string",
8611
+ "description": "Action Name"
8612
+ },
8613
+ {
8614
+ "type": "object",
8615
+ "properties": {
8616
+ "type": {
8617
+ "type": "string"
8618
+ },
8619
+ "params": {
8620
+ "type": "object",
8621
+ "additionalProperties": {}
8622
+ }
8623
+ },
8624
+ "required": [
8625
+ "type"
8626
+ ],
8627
+ "additionalProperties": false
8628
+ }
8629
+ ]
8630
+ },
8631
+ "description": "Actions to execute during transition"
8632
+ },
8633
+ "description": {
8634
+ "type": "string",
8635
+ "description": "Human readable description of this rule"
8636
+ }
8637
+ },
8638
+ "additionalProperties": false
8639
+ },
8640
+ {
8641
+ "type": "array",
8642
+ "items": {
8643
+ "type": "object",
8644
+ "properties": {
8645
+ "target": {
8646
+ "type": "string",
8647
+ "description": "Target State ID"
8648
+ },
8649
+ "cond": {
8650
+ "anyOf": [
8651
+ {
8652
+ "type": "string",
8653
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
7052
8654
  },
7053
- "description": "Categorization tags (e.g., \"compliance\", \"billing\")"
7054
- },
7055
- "severity": {
7056
- "type": "string",
7057
- "enum": [
7058
- "error",
7059
- "warning",
7060
- "info"
7061
- ],
7062
- "default": "error"
7063
- },
7064
- "message": {
7065
- "type": "string",
7066
- "description": "Error message to display to the user"
7067
- },
7068
- "type": {
7069
- "type": "string",
7070
- "const": "async"
8655
+ {
8656
+ "type": "object",
8657
+ "properties": {
8658
+ "type": {
8659
+ "type": "string"
8660
+ },
8661
+ "params": {
8662
+ "type": "object",
8663
+ "additionalProperties": {}
8664
+ }
8665
+ },
8666
+ "required": [
8667
+ "type"
8668
+ ],
8669
+ "additionalProperties": false
8670
+ }
8671
+ ],
8672
+ "description": "Condition (Guard) required to take this path"
8673
+ },
8674
+ "actions": {
8675
+ "type": "array",
8676
+ "items": {
8677
+ "anyOf": [
8678
+ {
8679
+ "type": "string",
8680
+ "description": "Action Name"
8681
+ },
8682
+ {
8683
+ "type": "object",
8684
+ "properties": {
8685
+ "type": {
8686
+ "type": "string"
8687
+ },
8688
+ "params": {
8689
+ "type": "object",
8690
+ "additionalProperties": {}
8691
+ }
8692
+ },
8693
+ "required": [
8694
+ "type"
8695
+ ],
8696
+ "additionalProperties": false
8697
+ }
8698
+ ]
7071
8699
  },
7072
- "field": {
8700
+ "description": "Actions to execute during transition"
8701
+ },
8702
+ "description": {
8703
+ "type": "string",
8704
+ "description": "Human readable description of this rule"
8705
+ }
8706
+ },
8707
+ "additionalProperties": false
8708
+ }
8709
+ }
8710
+ ]
8711
+ }
8712
+ }
8713
+ },
8714
+ "required": [
8715
+ "id",
8716
+ "initial",
8717
+ "states"
8718
+ ],
8719
+ "additionalProperties": false,
8720
+ "description": "Single state machine for record lifecycle (shorthand)"
8721
+ },
8722
+ "stateMachines": {
8723
+ "type": "object",
8724
+ "additionalProperties": {
8725
+ "type": "object",
8726
+ "properties": {
8727
+ "id": {
8728
+ "type": "string",
8729
+ "minLength": 2,
8730
+ "pattern": "^[a-z][a-z0-9_]*$",
8731
+ "description": "Unique Machine ID"
8732
+ },
8733
+ "description": {
8734
+ "type": "string"
8735
+ },
8736
+ "contextSchema": {
8737
+ "type": "object",
8738
+ "additionalProperties": {},
8739
+ "description": "Zod Schema for the machine context/memory"
8740
+ },
8741
+ "initial": {
8742
+ "type": "string",
8743
+ "description": "Initial State ID"
8744
+ },
8745
+ "states": {
8746
+ "type": "object",
8747
+ "additionalProperties": {
8748
+ "type": "object",
8749
+ "properties": {
8750
+ "type": {
8751
+ "type": "string",
8752
+ "enum": [
8753
+ "atomic",
8754
+ "compound",
8755
+ "parallel",
8756
+ "final",
8757
+ "history"
8758
+ ],
8759
+ "default": "atomic"
8760
+ },
8761
+ "entry": {
8762
+ "type": "array",
8763
+ "items": {
8764
+ "anyOf": [
8765
+ {
7073
8766
  "type": "string",
7074
- "description": "Field to validate"
8767
+ "description": "Action Name"
7075
8768
  },
7076
- "validatorUrl": {
8769
+ {
8770
+ "type": "object",
8771
+ "properties": {
8772
+ "type": {
8773
+ "type": "string"
8774
+ },
8775
+ "params": {
8776
+ "type": "object",
8777
+ "additionalProperties": {}
8778
+ }
8779
+ },
8780
+ "required": [
8781
+ "type"
8782
+ ],
8783
+ "additionalProperties": false
8784
+ }
8785
+ ]
8786
+ },
8787
+ "description": "Actions to run when entering this state"
8788
+ },
8789
+ "exit": {
8790
+ "type": "array",
8791
+ "items": {
8792
+ "anyOf": [
8793
+ {
7077
8794
  "type": "string",
7078
- "description": "External API endpoint for validation"
8795
+ "description": "Action Name"
7079
8796
  },
7080
- "method": {
7081
- "type": "string",
7082
- "enum": [
7083
- "GET",
7084
- "POST"
8797
+ {
8798
+ "type": "object",
8799
+ "properties": {
8800
+ "type": {
8801
+ "type": "string"
8802
+ },
8803
+ "params": {
8804
+ "type": "object",
8805
+ "additionalProperties": {}
8806
+ }
8807
+ },
8808
+ "required": [
8809
+ "type"
7085
8810
  ],
7086
- "default": "GET",
7087
- "description": "HTTP method for external call"
8811
+ "additionalProperties": false
8812
+ }
8813
+ ]
8814
+ },
8815
+ "description": "Actions to run when leaving this state"
8816
+ },
8817
+ "on": {
8818
+ "type": "object",
8819
+ "additionalProperties": {
8820
+ "anyOf": [
8821
+ {
8822
+ "type": "string"
7088
8823
  },
7089
- "headers": {
8824
+ {
7090
8825
  "type": "object",
7091
- "additionalProperties": {
7092
- "type": "string"
8826
+ "properties": {
8827
+ "target": {
8828
+ "type": "string",
8829
+ "description": "Target State ID"
8830
+ },
8831
+ "cond": {
8832
+ "anyOf": [
8833
+ {
8834
+ "type": "string",
8835
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
8836
+ },
8837
+ {
8838
+ "type": "object",
8839
+ "properties": {
8840
+ "type": {
8841
+ "type": "string"
8842
+ },
8843
+ "params": {
8844
+ "type": "object",
8845
+ "additionalProperties": {}
8846
+ }
8847
+ },
8848
+ "required": [
8849
+ "type"
8850
+ ],
8851
+ "additionalProperties": false
8852
+ }
8853
+ ],
8854
+ "description": "Condition (Guard) required to take this path"
8855
+ },
8856
+ "actions": {
8857
+ "type": "array",
8858
+ "items": {
8859
+ "anyOf": [
8860
+ {
8861
+ "type": "string",
8862
+ "description": "Action Name"
8863
+ },
8864
+ {
8865
+ "type": "object",
8866
+ "properties": {
8867
+ "type": {
8868
+ "type": "string"
8869
+ },
8870
+ "params": {
8871
+ "type": "object",
8872
+ "additionalProperties": {}
8873
+ }
8874
+ },
8875
+ "required": [
8876
+ "type"
8877
+ ],
8878
+ "additionalProperties": false
8879
+ }
8880
+ ]
8881
+ },
8882
+ "description": "Actions to execute during transition"
8883
+ },
8884
+ "description": {
8885
+ "type": "string",
8886
+ "description": "Human readable description of this rule"
8887
+ }
7093
8888
  },
7094
- "description": "Custom headers for the request"
7095
- },
7096
- "validatorFunction": {
7097
- "type": "string",
7098
- "description": "Reference to custom validator function"
7099
- },
7100
- "timeout": {
7101
- "type": "number",
7102
- "default": 5000,
7103
- "description": "Timeout in milliseconds"
7104
- },
7105
- "debounce": {
7106
- "type": "number",
7107
- "description": "Debounce delay in milliseconds"
8889
+ "additionalProperties": false
7108
8890
  },
7109
- "params": {
7110
- "type": "object",
7111
- "additionalProperties": {},
7112
- "description": "Additional parameters to pass to validator"
8891
+ {
8892
+ "type": "array",
8893
+ "items": {
8894
+ "type": "object",
8895
+ "properties": {
8896
+ "target": {
8897
+ "type": "string",
8898
+ "description": "Target State ID"
8899
+ },
8900
+ "cond": {
8901
+ "anyOf": [
8902
+ {
8903
+ "type": "string",
8904
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
8905
+ },
8906
+ {
8907
+ "type": "object",
8908
+ "properties": {
8909
+ "type": {
8910
+ "type": "string"
8911
+ },
8912
+ "params": {
8913
+ "type": "object",
8914
+ "additionalProperties": {}
8915
+ }
8916
+ },
8917
+ "required": [
8918
+ "type"
8919
+ ],
8920
+ "additionalProperties": false
8921
+ }
8922
+ ],
8923
+ "description": "Condition (Guard) required to take this path"
8924
+ },
8925
+ "actions": {
8926
+ "type": "array",
8927
+ "items": {
8928
+ "anyOf": [
8929
+ {
8930
+ "type": "string",
8931
+ "description": "Action Name"
8932
+ },
8933
+ {
8934
+ "type": "object",
8935
+ "properties": {
8936
+ "type": {
8937
+ "type": "string"
8938
+ },
8939
+ "params": {
8940
+ "type": "object",
8941
+ "additionalProperties": {}
8942
+ }
8943
+ },
8944
+ "required": [
8945
+ "type"
8946
+ ],
8947
+ "additionalProperties": false
8948
+ }
8949
+ ]
8950
+ },
8951
+ "description": "Actions to execute during transition"
8952
+ },
8953
+ "description": {
8954
+ "type": "string",
8955
+ "description": "Human readable description of this rule"
8956
+ }
8957
+ },
8958
+ "additionalProperties": false
8959
+ }
7113
8960
  }
7114
- },
7115
- "required": [
7116
- "name",
7117
- "message",
7118
- "type",
7119
- "field"
7120
- ],
7121
- "additionalProperties": false
8961
+ ]
7122
8962
  },
7123
- {
8963
+ "description": "Map of Event Type -> Transition Definition"
8964
+ },
8965
+ "always": {
8966
+ "type": "array",
8967
+ "items": {
7124
8968
  "type": "object",
7125
8969
  "properties": {
7126
- "name": {
8970
+ "target": {
7127
8971
  "type": "string",
7128
- "pattern": "^[a-z_][a-z0-9_]*$",
7129
- "description": "Unique rule name (snake_case)"
7130
- },
7131
- "label": {
7132
- "type": "string",
7133
- "description": "Human-readable label for the rule listing"
7134
- },
7135
- "description": {
7136
- "type": "string",
7137
- "description": "Administrative notes explaining the business reason"
7138
- },
7139
- "active": {
7140
- "type": "boolean",
7141
- "default": true
8972
+ "description": "Target State ID"
8973
+ },
8974
+ "cond": {
8975
+ "anyOf": [
8976
+ {
8977
+ "type": "string",
8978
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
8979
+ },
8980
+ {
8981
+ "type": "object",
8982
+ "properties": {
8983
+ "type": {
8984
+ "type": "string"
8985
+ },
8986
+ "params": {
8987
+ "type": "object",
8988
+ "additionalProperties": {}
8989
+ }
8990
+ },
8991
+ "required": [
8992
+ "type"
8993
+ ],
8994
+ "additionalProperties": false
8995
+ }
8996
+ ],
8997
+ "description": "Condition (Guard) required to take this path"
7142
8998
  },
7143
- "events": {
8999
+ "actions": {
7144
9000
  "type": "array",
7145
9001
  "items": {
7146
- "type": "string",
7147
- "enum": [
7148
- "insert",
7149
- "update",
7150
- "delete"
9002
+ "anyOf": [
9003
+ {
9004
+ "type": "string",
9005
+ "description": "Action Name"
9006
+ },
9007
+ {
9008
+ "type": "object",
9009
+ "properties": {
9010
+ "type": {
9011
+ "type": "string"
9012
+ },
9013
+ "params": {
9014
+ "type": "object",
9015
+ "additionalProperties": {}
9016
+ }
9017
+ },
9018
+ "required": [
9019
+ "type"
9020
+ ],
9021
+ "additionalProperties": false
9022
+ }
7151
9023
  ]
7152
9024
  },
7153
- "default": [
7154
- "insert",
7155
- "update"
7156
- ],
7157
- "description": "Validation contexts"
9025
+ "description": "Actions to execute during transition"
7158
9026
  },
7159
- "tags": {
7160
- "type": "array",
7161
- "items": {
7162
- "type": "string"
9027
+ "description": {
9028
+ "type": "string",
9029
+ "description": "Human readable description of this rule"
9030
+ }
9031
+ },
9032
+ "additionalProperties": false
9033
+ }
9034
+ },
9035
+ "initial": {
9036
+ "type": "string",
9037
+ "description": "Initial child state (if compound)"
9038
+ },
9039
+ "states": {
9040
+ "type": "object",
9041
+ "additionalProperties": {}
9042
+ },
9043
+ "meta": {
9044
+ "type": "object",
9045
+ "properties": {
9046
+ "label": {
9047
+ "type": "string"
9048
+ },
9049
+ "description": {
9050
+ "type": "string"
9051
+ },
9052
+ "color": {
9053
+ "type": "string"
9054
+ },
9055
+ "aiInstructions": {
9056
+ "type": "string",
9057
+ "description": "Specific instructions for AI when in this state"
9058
+ }
9059
+ },
9060
+ "additionalProperties": false
9061
+ }
9062
+ },
9063
+ "additionalProperties": false
9064
+ },
9065
+ "description": "State Nodes"
9066
+ },
9067
+ "on": {
9068
+ "type": "object",
9069
+ "additionalProperties": {
9070
+ "anyOf": [
9071
+ {
9072
+ "type": "string"
9073
+ },
9074
+ {
9075
+ "type": "object",
9076
+ "properties": {
9077
+ "target": {
9078
+ "type": "string",
9079
+ "description": "Target State ID"
9080
+ },
9081
+ "cond": {
9082
+ "anyOf": [
9083
+ {
9084
+ "type": "string",
9085
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
7163
9086
  },
7164
- "description": "Categorization tags (e.g., \"compliance\", \"billing\")"
9087
+ {
9088
+ "type": "object",
9089
+ "properties": {
9090
+ "type": {
9091
+ "type": "string"
9092
+ },
9093
+ "params": {
9094
+ "type": "object",
9095
+ "additionalProperties": {}
9096
+ }
9097
+ },
9098
+ "required": [
9099
+ "type"
9100
+ ],
9101
+ "additionalProperties": false
9102
+ }
9103
+ ],
9104
+ "description": "Condition (Guard) required to take this path"
9105
+ },
9106
+ "actions": {
9107
+ "type": "array",
9108
+ "items": {
9109
+ "anyOf": [
9110
+ {
9111
+ "type": "string",
9112
+ "description": "Action Name"
9113
+ },
9114
+ {
9115
+ "type": "object",
9116
+ "properties": {
9117
+ "type": {
9118
+ "type": "string"
9119
+ },
9120
+ "params": {
9121
+ "type": "object",
9122
+ "additionalProperties": {}
9123
+ }
9124
+ },
9125
+ "required": [
9126
+ "type"
9127
+ ],
9128
+ "additionalProperties": false
9129
+ }
9130
+ ]
7165
9131
  },
7166
- "severity": {
9132
+ "description": "Actions to execute during transition"
9133
+ },
9134
+ "description": {
9135
+ "type": "string",
9136
+ "description": "Human readable description of this rule"
9137
+ }
9138
+ },
9139
+ "additionalProperties": false
9140
+ },
9141
+ {
9142
+ "type": "array",
9143
+ "items": {
9144
+ "type": "object",
9145
+ "properties": {
9146
+ "target": {
7167
9147
  "type": "string",
7168
- "enum": [
7169
- "error",
7170
- "warning",
7171
- "info"
9148
+ "description": "Target State ID"
9149
+ },
9150
+ "cond": {
9151
+ "anyOf": [
9152
+ {
9153
+ "type": "string",
9154
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
9155
+ },
9156
+ {
9157
+ "type": "object",
9158
+ "properties": {
9159
+ "type": {
9160
+ "type": "string"
9161
+ },
9162
+ "params": {
9163
+ "type": "object",
9164
+ "additionalProperties": {}
9165
+ }
9166
+ },
9167
+ "required": [
9168
+ "type"
9169
+ ],
9170
+ "additionalProperties": false
9171
+ }
7172
9172
  ],
7173
- "default": "error"
7174
- },
7175
- "message": {
7176
- "type": "string",
7177
- "description": "Error message to display to the user"
9173
+ "description": "Condition (Guard) required to take this path"
7178
9174
  },
7179
- "type": {
7180
- "type": "string",
7181
- "const": "custom"
9175
+ "actions": {
9176
+ "type": "array",
9177
+ "items": {
9178
+ "anyOf": [
9179
+ {
9180
+ "type": "string",
9181
+ "description": "Action Name"
9182
+ },
9183
+ {
9184
+ "type": "object",
9185
+ "properties": {
9186
+ "type": {
9187
+ "type": "string"
9188
+ },
9189
+ "params": {
9190
+ "type": "object",
9191
+ "additionalProperties": {}
9192
+ }
9193
+ },
9194
+ "required": [
9195
+ "type"
9196
+ ],
9197
+ "additionalProperties": false
9198
+ }
9199
+ ]
9200
+ },
9201
+ "description": "Actions to execute during transition"
7182
9202
  },
7183
- "handler": {
9203
+ "description": {
7184
9204
  "type": "string",
7185
- "description": "Name of the custom validation function registered in the system"
7186
- },
7187
- "params": {
7188
- "type": "object",
7189
- "additionalProperties": {},
7190
- "description": "Parameters passed to the custom handler"
9205
+ "description": "Human readable description of this rule"
7191
9206
  }
7192
9207
  },
7193
- "required": [
7194
- "name",
7195
- "message",
7196
- "type",
7197
- "handler"
7198
- ],
7199
9208
  "additionalProperties": false
7200
- },
7201
- {}
7202
- ],
7203
- "description": "Validation rule to apply when condition is true"
7204
- },
7205
- "otherwise": {
7206
- "description": "Validation rule to apply when condition is false"
7207
- }
7208
- },
7209
- "required": [
7210
- "name",
7211
- "message",
7212
- "type",
7213
- "when",
7214
- "then"
7215
- ],
7216
- "additionalProperties": false
9209
+ }
9210
+ }
9211
+ ]
9212
+ }
7217
9213
  }
7218
- ]
9214
+ },
9215
+ "required": [
9216
+ "id",
9217
+ "initial",
9218
+ "states"
9219
+ ],
9220
+ "additionalProperties": false
7219
9221
  },
7220
- "description": "Object-level validation rules"
9222
+ "description": "Named state machines for parallel lifecycles (e.g., status, payment, approval)"
7221
9223
  },
7222
9224
  "titleFormat": {
7223
9225
  "type": "string",