@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
@@ -3635,6 +3635,1007 @@
3635
3635
  },
3636
3636
  "description": "Object-level validation rules"
3637
3637
  },
3638
+ "stateMachine": {
3639
+ "type": "object",
3640
+ "properties": {
3641
+ "id": {
3642
+ "type": "string",
3643
+ "minLength": 2,
3644
+ "pattern": "^[a-z][a-z0-9_]*$",
3645
+ "description": "Unique Machine ID"
3646
+ },
3647
+ "description": {
3648
+ "type": "string"
3649
+ },
3650
+ "contextSchema": {
3651
+ "type": "object",
3652
+ "additionalProperties": {},
3653
+ "description": "Zod Schema for the machine context/memory"
3654
+ },
3655
+ "initial": {
3656
+ "type": "string",
3657
+ "description": "Initial State ID"
3658
+ },
3659
+ "states": {
3660
+ "type": "object",
3661
+ "additionalProperties": {
3662
+ "type": "object",
3663
+ "properties": {
3664
+ "type": {
3665
+ "type": "string",
3666
+ "enum": [
3667
+ "atomic",
3668
+ "compound",
3669
+ "parallel",
3670
+ "final",
3671
+ "history"
3672
+ ],
3673
+ "default": "atomic"
3674
+ },
3675
+ "entry": {
3676
+ "type": "array",
3677
+ "items": {
3678
+ "anyOf": [
3679
+ {
3680
+ "type": "string",
3681
+ "description": "Action Name"
3682
+ },
3683
+ {
3684
+ "type": "object",
3685
+ "properties": {
3686
+ "type": {
3687
+ "type": "string"
3688
+ },
3689
+ "params": {
3690
+ "type": "object",
3691
+ "additionalProperties": {}
3692
+ }
3693
+ },
3694
+ "required": [
3695
+ "type"
3696
+ ],
3697
+ "additionalProperties": false
3698
+ }
3699
+ ]
3700
+ },
3701
+ "description": "Actions to run when entering this state"
3702
+ },
3703
+ "exit": {
3704
+ "type": "array",
3705
+ "items": {
3706
+ "anyOf": [
3707
+ {
3708
+ "type": "string",
3709
+ "description": "Action Name"
3710
+ },
3711
+ {
3712
+ "type": "object",
3713
+ "properties": {
3714
+ "type": {
3715
+ "type": "string"
3716
+ },
3717
+ "params": {
3718
+ "type": "object",
3719
+ "additionalProperties": {}
3720
+ }
3721
+ },
3722
+ "required": [
3723
+ "type"
3724
+ ],
3725
+ "additionalProperties": false
3726
+ }
3727
+ ]
3728
+ },
3729
+ "description": "Actions to run when leaving this state"
3730
+ },
3731
+ "on": {
3732
+ "type": "object",
3733
+ "additionalProperties": {
3734
+ "anyOf": [
3735
+ {
3736
+ "type": "string"
3737
+ },
3738
+ {
3739
+ "type": "object",
3740
+ "properties": {
3741
+ "target": {
3742
+ "type": "string",
3743
+ "description": "Target State ID"
3744
+ },
3745
+ "cond": {
3746
+ "anyOf": [
3747
+ {
3748
+ "type": "string",
3749
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
3750
+ },
3751
+ {
3752
+ "type": "object",
3753
+ "properties": {
3754
+ "type": {
3755
+ "type": "string"
3756
+ },
3757
+ "params": {
3758
+ "type": "object",
3759
+ "additionalProperties": {}
3760
+ }
3761
+ },
3762
+ "required": [
3763
+ "type"
3764
+ ],
3765
+ "additionalProperties": false
3766
+ }
3767
+ ],
3768
+ "description": "Condition (Guard) required to take this path"
3769
+ },
3770
+ "actions": {
3771
+ "type": "array",
3772
+ "items": {
3773
+ "anyOf": [
3774
+ {
3775
+ "type": "string",
3776
+ "description": "Action Name"
3777
+ },
3778
+ {
3779
+ "type": "object",
3780
+ "properties": {
3781
+ "type": {
3782
+ "type": "string"
3783
+ },
3784
+ "params": {
3785
+ "type": "object",
3786
+ "additionalProperties": {}
3787
+ }
3788
+ },
3789
+ "required": [
3790
+ "type"
3791
+ ],
3792
+ "additionalProperties": false
3793
+ }
3794
+ ]
3795
+ },
3796
+ "description": "Actions to execute during transition"
3797
+ },
3798
+ "description": {
3799
+ "type": "string",
3800
+ "description": "Human readable description of this rule"
3801
+ }
3802
+ },
3803
+ "additionalProperties": false
3804
+ },
3805
+ {
3806
+ "type": "array",
3807
+ "items": {
3808
+ "type": "object",
3809
+ "properties": {
3810
+ "target": {
3811
+ "type": "string",
3812
+ "description": "Target State ID"
3813
+ },
3814
+ "cond": {
3815
+ "anyOf": [
3816
+ {
3817
+ "type": "string",
3818
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
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
+ "description": "Condition (Guard) required to take this path"
3838
+ },
3839
+ "actions": {
3840
+ "type": "array",
3841
+ "items": {
3842
+ "anyOf": [
3843
+ {
3844
+ "type": "string",
3845
+ "description": "Action Name"
3846
+ },
3847
+ {
3848
+ "type": "object",
3849
+ "properties": {
3850
+ "type": {
3851
+ "type": "string"
3852
+ },
3853
+ "params": {
3854
+ "type": "object",
3855
+ "additionalProperties": {}
3856
+ }
3857
+ },
3858
+ "required": [
3859
+ "type"
3860
+ ],
3861
+ "additionalProperties": false
3862
+ }
3863
+ ]
3864
+ },
3865
+ "description": "Actions to execute during transition"
3866
+ },
3867
+ "description": {
3868
+ "type": "string",
3869
+ "description": "Human readable description of this rule"
3870
+ }
3871
+ },
3872
+ "additionalProperties": false
3873
+ }
3874
+ }
3875
+ ]
3876
+ },
3877
+ "description": "Map of Event Type -> Transition Definition"
3878
+ },
3879
+ "always": {
3880
+ "type": "array",
3881
+ "items": {
3882
+ "type": "object",
3883
+ "properties": {
3884
+ "target": {
3885
+ "type": "string",
3886
+ "description": "Target State ID"
3887
+ },
3888
+ "cond": {
3889
+ "anyOf": [
3890
+ {
3891
+ "type": "string",
3892
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
3893
+ },
3894
+ {
3895
+ "type": "object",
3896
+ "properties": {
3897
+ "type": {
3898
+ "type": "string"
3899
+ },
3900
+ "params": {
3901
+ "type": "object",
3902
+ "additionalProperties": {}
3903
+ }
3904
+ },
3905
+ "required": [
3906
+ "type"
3907
+ ],
3908
+ "additionalProperties": false
3909
+ }
3910
+ ],
3911
+ "description": "Condition (Guard) required to take this path"
3912
+ },
3913
+ "actions": {
3914
+ "type": "array",
3915
+ "items": {
3916
+ "anyOf": [
3917
+ {
3918
+ "type": "string",
3919
+ "description": "Action Name"
3920
+ },
3921
+ {
3922
+ "type": "object",
3923
+ "properties": {
3924
+ "type": {
3925
+ "type": "string"
3926
+ },
3927
+ "params": {
3928
+ "type": "object",
3929
+ "additionalProperties": {}
3930
+ }
3931
+ },
3932
+ "required": [
3933
+ "type"
3934
+ ],
3935
+ "additionalProperties": false
3936
+ }
3937
+ ]
3938
+ },
3939
+ "description": "Actions to execute during transition"
3940
+ },
3941
+ "description": {
3942
+ "type": "string",
3943
+ "description": "Human readable description of this rule"
3944
+ }
3945
+ },
3946
+ "additionalProperties": false
3947
+ }
3948
+ },
3949
+ "initial": {
3950
+ "type": "string",
3951
+ "description": "Initial child state (if compound)"
3952
+ },
3953
+ "states": {
3954
+ "type": "object",
3955
+ "additionalProperties": {}
3956
+ },
3957
+ "meta": {
3958
+ "type": "object",
3959
+ "properties": {
3960
+ "label": {
3961
+ "type": "string"
3962
+ },
3963
+ "description": {
3964
+ "type": "string"
3965
+ },
3966
+ "color": {
3967
+ "type": "string"
3968
+ },
3969
+ "aiInstructions": {
3970
+ "type": "string",
3971
+ "description": "Specific instructions for AI when in this state"
3972
+ }
3973
+ },
3974
+ "additionalProperties": false
3975
+ }
3976
+ },
3977
+ "additionalProperties": false
3978
+ },
3979
+ "description": "State Nodes"
3980
+ },
3981
+ "on": {
3982
+ "type": "object",
3983
+ "additionalProperties": {
3984
+ "anyOf": [
3985
+ {
3986
+ "type": "string"
3987
+ },
3988
+ {
3989
+ "type": "object",
3990
+ "properties": {
3991
+ "target": {
3992
+ "type": "string",
3993
+ "description": "Target State ID"
3994
+ },
3995
+ "cond": {
3996
+ "anyOf": [
3997
+ {
3998
+ "type": "string",
3999
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
4000
+ },
4001
+ {
4002
+ "type": "object",
4003
+ "properties": {
4004
+ "type": {
4005
+ "type": "string"
4006
+ },
4007
+ "params": {
4008
+ "type": "object",
4009
+ "additionalProperties": {}
4010
+ }
4011
+ },
4012
+ "required": [
4013
+ "type"
4014
+ ],
4015
+ "additionalProperties": false
4016
+ }
4017
+ ],
4018
+ "description": "Condition (Guard) required to take this path"
4019
+ },
4020
+ "actions": {
4021
+ "type": "array",
4022
+ "items": {
4023
+ "anyOf": [
4024
+ {
4025
+ "type": "string",
4026
+ "description": "Action Name"
4027
+ },
4028
+ {
4029
+ "type": "object",
4030
+ "properties": {
4031
+ "type": {
4032
+ "type": "string"
4033
+ },
4034
+ "params": {
4035
+ "type": "object",
4036
+ "additionalProperties": {}
4037
+ }
4038
+ },
4039
+ "required": [
4040
+ "type"
4041
+ ],
4042
+ "additionalProperties": false
4043
+ }
4044
+ ]
4045
+ },
4046
+ "description": "Actions to execute during transition"
4047
+ },
4048
+ "description": {
4049
+ "type": "string",
4050
+ "description": "Human readable description of this rule"
4051
+ }
4052
+ },
4053
+ "additionalProperties": false
4054
+ },
4055
+ {
4056
+ "type": "array",
4057
+ "items": {
4058
+ "type": "object",
4059
+ "properties": {
4060
+ "target": {
4061
+ "type": "string",
4062
+ "description": "Target State ID"
4063
+ },
4064
+ "cond": {
4065
+ "anyOf": [
4066
+ {
4067
+ "type": "string",
4068
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
4069
+ },
4070
+ {
4071
+ "type": "object",
4072
+ "properties": {
4073
+ "type": {
4074
+ "type": "string"
4075
+ },
4076
+ "params": {
4077
+ "type": "object",
4078
+ "additionalProperties": {}
4079
+ }
4080
+ },
4081
+ "required": [
4082
+ "type"
4083
+ ],
4084
+ "additionalProperties": false
4085
+ }
4086
+ ],
4087
+ "description": "Condition (Guard) required to take this path"
4088
+ },
4089
+ "actions": {
4090
+ "type": "array",
4091
+ "items": {
4092
+ "anyOf": [
4093
+ {
4094
+ "type": "string",
4095
+ "description": "Action Name"
4096
+ },
4097
+ {
4098
+ "type": "object",
4099
+ "properties": {
4100
+ "type": {
4101
+ "type": "string"
4102
+ },
4103
+ "params": {
4104
+ "type": "object",
4105
+ "additionalProperties": {}
4106
+ }
4107
+ },
4108
+ "required": [
4109
+ "type"
4110
+ ],
4111
+ "additionalProperties": false
4112
+ }
4113
+ ]
4114
+ },
4115
+ "description": "Actions to execute during transition"
4116
+ },
4117
+ "description": {
4118
+ "type": "string",
4119
+ "description": "Human readable description of this rule"
4120
+ }
4121
+ },
4122
+ "additionalProperties": false
4123
+ }
4124
+ }
4125
+ ]
4126
+ }
4127
+ }
4128
+ },
4129
+ "required": [
4130
+ "id",
4131
+ "initial",
4132
+ "states"
4133
+ ],
4134
+ "additionalProperties": false,
4135
+ "description": "Single state machine for record lifecycle (shorthand)"
4136
+ },
4137
+ "stateMachines": {
4138
+ "type": "object",
4139
+ "additionalProperties": {
4140
+ "type": "object",
4141
+ "properties": {
4142
+ "id": {
4143
+ "type": "string",
4144
+ "minLength": 2,
4145
+ "pattern": "^[a-z][a-z0-9_]*$",
4146
+ "description": "Unique Machine ID"
4147
+ },
4148
+ "description": {
4149
+ "type": "string"
4150
+ },
4151
+ "contextSchema": {
4152
+ "type": "object",
4153
+ "additionalProperties": {},
4154
+ "description": "Zod Schema for the machine context/memory"
4155
+ },
4156
+ "initial": {
4157
+ "type": "string",
4158
+ "description": "Initial State ID"
4159
+ },
4160
+ "states": {
4161
+ "type": "object",
4162
+ "additionalProperties": {
4163
+ "type": "object",
4164
+ "properties": {
4165
+ "type": {
4166
+ "type": "string",
4167
+ "enum": [
4168
+ "atomic",
4169
+ "compound",
4170
+ "parallel",
4171
+ "final",
4172
+ "history"
4173
+ ],
4174
+ "default": "atomic"
4175
+ },
4176
+ "entry": {
4177
+ "type": "array",
4178
+ "items": {
4179
+ "anyOf": [
4180
+ {
4181
+ "type": "string",
4182
+ "description": "Action Name"
4183
+ },
4184
+ {
4185
+ "type": "object",
4186
+ "properties": {
4187
+ "type": {
4188
+ "type": "string"
4189
+ },
4190
+ "params": {
4191
+ "type": "object",
4192
+ "additionalProperties": {}
4193
+ }
4194
+ },
4195
+ "required": [
4196
+ "type"
4197
+ ],
4198
+ "additionalProperties": false
4199
+ }
4200
+ ]
4201
+ },
4202
+ "description": "Actions to run when entering this state"
4203
+ },
4204
+ "exit": {
4205
+ "type": "array",
4206
+ "items": {
4207
+ "anyOf": [
4208
+ {
4209
+ "type": "string",
4210
+ "description": "Action Name"
4211
+ },
4212
+ {
4213
+ "type": "object",
4214
+ "properties": {
4215
+ "type": {
4216
+ "type": "string"
4217
+ },
4218
+ "params": {
4219
+ "type": "object",
4220
+ "additionalProperties": {}
4221
+ }
4222
+ },
4223
+ "required": [
4224
+ "type"
4225
+ ],
4226
+ "additionalProperties": false
4227
+ }
4228
+ ]
4229
+ },
4230
+ "description": "Actions to run when leaving this state"
4231
+ },
4232
+ "on": {
4233
+ "type": "object",
4234
+ "additionalProperties": {
4235
+ "anyOf": [
4236
+ {
4237
+ "type": "string"
4238
+ },
4239
+ {
4240
+ "type": "object",
4241
+ "properties": {
4242
+ "target": {
4243
+ "type": "string",
4244
+ "description": "Target State ID"
4245
+ },
4246
+ "cond": {
4247
+ "anyOf": [
4248
+ {
4249
+ "type": "string",
4250
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
4251
+ },
4252
+ {
4253
+ "type": "object",
4254
+ "properties": {
4255
+ "type": {
4256
+ "type": "string"
4257
+ },
4258
+ "params": {
4259
+ "type": "object",
4260
+ "additionalProperties": {}
4261
+ }
4262
+ },
4263
+ "required": [
4264
+ "type"
4265
+ ],
4266
+ "additionalProperties": false
4267
+ }
4268
+ ],
4269
+ "description": "Condition (Guard) required to take this path"
4270
+ },
4271
+ "actions": {
4272
+ "type": "array",
4273
+ "items": {
4274
+ "anyOf": [
4275
+ {
4276
+ "type": "string",
4277
+ "description": "Action Name"
4278
+ },
4279
+ {
4280
+ "type": "object",
4281
+ "properties": {
4282
+ "type": {
4283
+ "type": "string"
4284
+ },
4285
+ "params": {
4286
+ "type": "object",
4287
+ "additionalProperties": {}
4288
+ }
4289
+ },
4290
+ "required": [
4291
+ "type"
4292
+ ],
4293
+ "additionalProperties": false
4294
+ }
4295
+ ]
4296
+ },
4297
+ "description": "Actions to execute during transition"
4298
+ },
4299
+ "description": {
4300
+ "type": "string",
4301
+ "description": "Human readable description of this rule"
4302
+ }
4303
+ },
4304
+ "additionalProperties": false
4305
+ },
4306
+ {
4307
+ "type": "array",
4308
+ "items": {
4309
+ "type": "object",
4310
+ "properties": {
4311
+ "target": {
4312
+ "type": "string",
4313
+ "description": "Target State ID"
4314
+ },
4315
+ "cond": {
4316
+ "anyOf": [
4317
+ {
4318
+ "type": "string",
4319
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
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
+ "description": "Condition (Guard) required to take this path"
4339
+ },
4340
+ "actions": {
4341
+ "type": "array",
4342
+ "items": {
4343
+ "anyOf": [
4344
+ {
4345
+ "type": "string",
4346
+ "description": "Action Name"
4347
+ },
4348
+ {
4349
+ "type": "object",
4350
+ "properties": {
4351
+ "type": {
4352
+ "type": "string"
4353
+ },
4354
+ "params": {
4355
+ "type": "object",
4356
+ "additionalProperties": {}
4357
+ }
4358
+ },
4359
+ "required": [
4360
+ "type"
4361
+ ],
4362
+ "additionalProperties": false
4363
+ }
4364
+ ]
4365
+ },
4366
+ "description": "Actions to execute during transition"
4367
+ },
4368
+ "description": {
4369
+ "type": "string",
4370
+ "description": "Human readable description of this rule"
4371
+ }
4372
+ },
4373
+ "additionalProperties": false
4374
+ }
4375
+ }
4376
+ ]
4377
+ },
4378
+ "description": "Map of Event Type -> Transition Definition"
4379
+ },
4380
+ "always": {
4381
+ "type": "array",
4382
+ "items": {
4383
+ "type": "object",
4384
+ "properties": {
4385
+ "target": {
4386
+ "type": "string",
4387
+ "description": "Target State ID"
4388
+ },
4389
+ "cond": {
4390
+ "anyOf": [
4391
+ {
4392
+ "type": "string",
4393
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
4394
+ },
4395
+ {
4396
+ "type": "object",
4397
+ "properties": {
4398
+ "type": {
4399
+ "type": "string"
4400
+ },
4401
+ "params": {
4402
+ "type": "object",
4403
+ "additionalProperties": {}
4404
+ }
4405
+ },
4406
+ "required": [
4407
+ "type"
4408
+ ],
4409
+ "additionalProperties": false
4410
+ }
4411
+ ],
4412
+ "description": "Condition (Guard) required to take this path"
4413
+ },
4414
+ "actions": {
4415
+ "type": "array",
4416
+ "items": {
4417
+ "anyOf": [
4418
+ {
4419
+ "type": "string",
4420
+ "description": "Action Name"
4421
+ },
4422
+ {
4423
+ "type": "object",
4424
+ "properties": {
4425
+ "type": {
4426
+ "type": "string"
4427
+ },
4428
+ "params": {
4429
+ "type": "object",
4430
+ "additionalProperties": {}
4431
+ }
4432
+ },
4433
+ "required": [
4434
+ "type"
4435
+ ],
4436
+ "additionalProperties": false
4437
+ }
4438
+ ]
4439
+ },
4440
+ "description": "Actions to execute during transition"
4441
+ },
4442
+ "description": {
4443
+ "type": "string",
4444
+ "description": "Human readable description of this rule"
4445
+ }
4446
+ },
4447
+ "additionalProperties": false
4448
+ }
4449
+ },
4450
+ "initial": {
4451
+ "type": "string",
4452
+ "description": "Initial child state (if compound)"
4453
+ },
4454
+ "states": {
4455
+ "type": "object",
4456
+ "additionalProperties": {}
4457
+ },
4458
+ "meta": {
4459
+ "type": "object",
4460
+ "properties": {
4461
+ "label": {
4462
+ "type": "string"
4463
+ },
4464
+ "description": {
4465
+ "type": "string"
4466
+ },
4467
+ "color": {
4468
+ "type": "string"
4469
+ },
4470
+ "aiInstructions": {
4471
+ "type": "string",
4472
+ "description": "Specific instructions for AI when in this state"
4473
+ }
4474
+ },
4475
+ "additionalProperties": false
4476
+ }
4477
+ },
4478
+ "additionalProperties": false
4479
+ },
4480
+ "description": "State Nodes"
4481
+ },
4482
+ "on": {
4483
+ "type": "object",
4484
+ "additionalProperties": {
4485
+ "anyOf": [
4486
+ {
4487
+ "type": "string"
4488
+ },
4489
+ {
4490
+ "type": "object",
4491
+ "properties": {
4492
+ "target": {
4493
+ "type": "string",
4494
+ "description": "Target State ID"
4495
+ },
4496
+ "cond": {
4497
+ "anyOf": [
4498
+ {
4499
+ "type": "string",
4500
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
4501
+ },
4502
+ {
4503
+ "type": "object",
4504
+ "properties": {
4505
+ "type": {
4506
+ "type": "string"
4507
+ },
4508
+ "params": {
4509
+ "type": "object",
4510
+ "additionalProperties": {}
4511
+ }
4512
+ },
4513
+ "required": [
4514
+ "type"
4515
+ ],
4516
+ "additionalProperties": false
4517
+ }
4518
+ ],
4519
+ "description": "Condition (Guard) required to take this path"
4520
+ },
4521
+ "actions": {
4522
+ "type": "array",
4523
+ "items": {
4524
+ "anyOf": [
4525
+ {
4526
+ "type": "string",
4527
+ "description": "Action Name"
4528
+ },
4529
+ {
4530
+ "type": "object",
4531
+ "properties": {
4532
+ "type": {
4533
+ "type": "string"
4534
+ },
4535
+ "params": {
4536
+ "type": "object",
4537
+ "additionalProperties": {}
4538
+ }
4539
+ },
4540
+ "required": [
4541
+ "type"
4542
+ ],
4543
+ "additionalProperties": false
4544
+ }
4545
+ ]
4546
+ },
4547
+ "description": "Actions to execute during transition"
4548
+ },
4549
+ "description": {
4550
+ "type": "string",
4551
+ "description": "Human readable description of this rule"
4552
+ }
4553
+ },
4554
+ "additionalProperties": false
4555
+ },
4556
+ {
4557
+ "type": "array",
4558
+ "items": {
4559
+ "type": "object",
4560
+ "properties": {
4561
+ "target": {
4562
+ "type": "string",
4563
+ "description": "Target State ID"
4564
+ },
4565
+ "cond": {
4566
+ "anyOf": [
4567
+ {
4568
+ "type": "string",
4569
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
4570
+ },
4571
+ {
4572
+ "type": "object",
4573
+ "properties": {
4574
+ "type": {
4575
+ "type": "string"
4576
+ },
4577
+ "params": {
4578
+ "type": "object",
4579
+ "additionalProperties": {}
4580
+ }
4581
+ },
4582
+ "required": [
4583
+ "type"
4584
+ ],
4585
+ "additionalProperties": false
4586
+ }
4587
+ ],
4588
+ "description": "Condition (Guard) required to take this path"
4589
+ },
4590
+ "actions": {
4591
+ "type": "array",
4592
+ "items": {
4593
+ "anyOf": [
4594
+ {
4595
+ "type": "string",
4596
+ "description": "Action Name"
4597
+ },
4598
+ {
4599
+ "type": "object",
4600
+ "properties": {
4601
+ "type": {
4602
+ "type": "string"
4603
+ },
4604
+ "params": {
4605
+ "type": "object",
4606
+ "additionalProperties": {}
4607
+ }
4608
+ },
4609
+ "required": [
4610
+ "type"
4611
+ ],
4612
+ "additionalProperties": false
4613
+ }
4614
+ ]
4615
+ },
4616
+ "description": "Actions to execute during transition"
4617
+ },
4618
+ "description": {
4619
+ "type": "string",
4620
+ "description": "Human readable description of this rule"
4621
+ }
4622
+ },
4623
+ "additionalProperties": false
4624
+ }
4625
+ }
4626
+ ]
4627
+ }
4628
+ }
4629
+ },
4630
+ "required": [
4631
+ "id",
4632
+ "initial",
4633
+ "states"
4634
+ ],
4635
+ "additionalProperties": false
4636
+ },
4637
+ "description": "Named state machines for parallel lifecycles (e.g., status, payment, approval)"
4638
+ },
3638
4639
  "titleFormat": {
3639
4640
  "type": "string",
3640
4641
  "description": "Title expression (e.g. \"{name} - {code}\"). Overrides nameField."
@@ -6946,7 +7947,167 @@
6946
7947
  "name",
6947
7948
  "message",
6948
7949
  "type",
6949
- "field"
7950
+ "field"
7951
+ ],
7952
+ "additionalProperties": false
7953
+ },
7954
+ {
7955
+ "type": "object",
7956
+ "properties": {
7957
+ "name": {
7958
+ "type": "string",
7959
+ "pattern": "^[a-z_][a-z0-9_]*$",
7960
+ "description": "Unique rule name (snake_case)"
7961
+ },
7962
+ "label": {
7963
+ "type": "string",
7964
+ "description": "Human-readable label for the rule listing"
7965
+ },
7966
+ "description": {
7967
+ "type": "string",
7968
+ "description": "Administrative notes explaining the business reason"
7969
+ },
7970
+ "active": {
7971
+ "type": "boolean",
7972
+ "default": true
7973
+ },
7974
+ "events": {
7975
+ "type": "array",
7976
+ "items": {
7977
+ "type": "string",
7978
+ "enum": [
7979
+ "insert",
7980
+ "update",
7981
+ "delete"
7982
+ ]
7983
+ },
7984
+ "default": [
7985
+ "insert",
7986
+ "update"
7987
+ ],
7988
+ "description": "Validation contexts"
7989
+ },
7990
+ "tags": {
7991
+ "type": "array",
7992
+ "items": {
7993
+ "type": "string"
7994
+ },
7995
+ "description": "Categorization tags (e.g., \"compliance\", \"billing\")"
7996
+ },
7997
+ "severity": {
7998
+ "type": "string",
7999
+ "enum": [
8000
+ "error",
8001
+ "warning",
8002
+ "info"
8003
+ ],
8004
+ "default": "error"
8005
+ },
8006
+ "message": {
8007
+ "type": "string",
8008
+ "description": "Error message to display to the user"
8009
+ },
8010
+ "type": {
8011
+ "type": "string",
8012
+ "const": "cross_field"
8013
+ },
8014
+ "condition": {
8015
+ "type": "string",
8016
+ "description": "Formula expression comparing fields (e.g. \"end_date > start_date\")"
8017
+ },
8018
+ "fields": {
8019
+ "type": "array",
8020
+ "items": {
8021
+ "type": "string"
8022
+ },
8023
+ "description": "Fields involved in the validation"
8024
+ }
8025
+ },
8026
+ "required": [
8027
+ "name",
8028
+ "message",
8029
+ "type",
8030
+ "condition",
8031
+ "fields"
8032
+ ],
8033
+ "additionalProperties": false
8034
+ },
8035
+ {
8036
+ "type": "object",
8037
+ "properties": {
8038
+ "name": {
8039
+ "type": "string",
8040
+ "pattern": "^[a-z_][a-z0-9_]*$",
8041
+ "description": "Unique rule name (snake_case)"
8042
+ },
8043
+ "label": {
8044
+ "type": "string",
8045
+ "description": "Human-readable label for the rule listing"
8046
+ },
8047
+ "description": {
8048
+ "type": "string",
8049
+ "description": "Administrative notes explaining the business reason"
8050
+ },
8051
+ "active": {
8052
+ "type": "boolean",
8053
+ "default": true
8054
+ },
8055
+ "events": {
8056
+ "type": "array",
8057
+ "items": {
8058
+ "type": "string",
8059
+ "enum": [
8060
+ "insert",
8061
+ "update",
8062
+ "delete"
8063
+ ]
8064
+ },
8065
+ "default": [
8066
+ "insert",
8067
+ "update"
8068
+ ],
8069
+ "description": "Validation contexts"
8070
+ },
8071
+ "tags": {
8072
+ "type": "array",
8073
+ "items": {
8074
+ "type": "string"
8075
+ },
8076
+ "description": "Categorization tags (e.g., \"compliance\", \"billing\")"
8077
+ },
8078
+ "severity": {
8079
+ "type": "string",
8080
+ "enum": [
8081
+ "error",
8082
+ "warning",
8083
+ "info"
8084
+ ],
8085
+ "default": "error"
8086
+ },
8087
+ "message": {
8088
+ "type": "string",
8089
+ "description": "Error message to display to the user"
8090
+ },
8091
+ "type": {
8092
+ "type": "string",
8093
+ "const": "json_schema"
8094
+ },
8095
+ "field": {
8096
+ "type": "string",
8097
+ "description": "JSON field to validate"
8098
+ },
8099
+ "schema": {
8100
+ "type": "object",
8101
+ "additionalProperties": {},
8102
+ "description": "JSON Schema object definition"
8103
+ }
8104
+ },
8105
+ "required": [
8106
+ "name",
8107
+ "message",
8108
+ "type",
8109
+ "field",
8110
+ "schema"
6950
8111
  ],
6951
8112
  "additionalProperties": false
6952
8113
  },
@@ -7008,26 +8169,56 @@
7008
8169
  },
7009
8170
  "type": {
7010
8171
  "type": "string",
7011
- "const": "cross_field"
8172
+ "const": "async"
7012
8173
  },
7013
- "condition": {
8174
+ "field": {
7014
8175
  "type": "string",
7015
- "description": "Formula expression comparing fields (e.g. \"end_date > start_date\")"
8176
+ "description": "Field to validate"
7016
8177
  },
7017
- "fields": {
7018
- "type": "array",
7019
- "items": {
8178
+ "validatorUrl": {
8179
+ "type": "string",
8180
+ "description": "External API endpoint for validation"
8181
+ },
8182
+ "method": {
8183
+ "type": "string",
8184
+ "enum": [
8185
+ "GET",
8186
+ "POST"
8187
+ ],
8188
+ "default": "GET",
8189
+ "description": "HTTP method for external call"
8190
+ },
8191
+ "headers": {
8192
+ "type": "object",
8193
+ "additionalProperties": {
7020
8194
  "type": "string"
7021
8195
  },
7022
- "description": "Fields involved in the validation"
8196
+ "description": "Custom headers for the request"
8197
+ },
8198
+ "validatorFunction": {
8199
+ "type": "string",
8200
+ "description": "Reference to custom validator function"
8201
+ },
8202
+ "timeout": {
8203
+ "type": "number",
8204
+ "default": 5000,
8205
+ "description": "Timeout in milliseconds"
8206
+ },
8207
+ "debounce": {
8208
+ "type": "number",
8209
+ "description": "Debounce delay in milliseconds"
8210
+ },
8211
+ "params": {
8212
+ "type": "object",
8213
+ "additionalProperties": {},
8214
+ "description": "Additional parameters to pass to validator"
7023
8215
  }
7024
8216
  },
7025
8217
  "required": [
7026
8218
  "name",
7027
8219
  "message",
7028
8220
  "type",
7029
- "condition",
7030
- "fields"
8221
+ "field"
7031
8222
  ],
7032
8223
  "additionalProperties": false
7033
8224
  },
@@ -7089,236 +8280,1047 @@
7089
8280
  },
7090
8281
  "type": {
7091
8282
  "type": "string",
7092
- "const": "json_schema"
8283
+ "const": "custom"
7093
8284
  },
7094
- "field": {
8285
+ "handler": {
7095
8286
  "type": "string",
7096
- "description": "JSON field to validate"
8287
+ "description": "Name of the custom validation function registered in the system"
7097
8288
  },
7098
- "schema": {
8289
+ "params": {
7099
8290
  "type": "object",
7100
8291
  "additionalProperties": {},
7101
- "description": "JSON Schema object definition"
8292
+ "description": "Parameters passed to the custom handler"
7102
8293
  }
7103
8294
  },
7104
8295
  "required": [
7105
8296
  "name",
7106
8297
  "message",
7107
8298
  "type",
7108
- "field",
7109
- "schema"
8299
+ "handler"
7110
8300
  ],
7111
8301
  "additionalProperties": false
7112
8302
  },
7113
- {
7114
- "type": "object",
7115
- "properties": {
7116
- "name": {
7117
- "type": "string",
7118
- "pattern": "^[a-z_][a-z0-9_]*$",
7119
- "description": "Unique rule name (snake_case)"
7120
- },
7121
- "label": {
7122
- "type": "string",
7123
- "description": "Human-readable label for the rule listing"
8303
+ {}
8304
+ ],
8305
+ "description": "Validation rule to apply when condition is true"
8306
+ },
8307
+ "otherwise": {
8308
+ "description": "Validation rule to apply when condition is false"
8309
+ }
8310
+ },
8311
+ "required": [
8312
+ "name",
8313
+ "message",
8314
+ "type",
8315
+ "when",
8316
+ "then"
8317
+ ],
8318
+ "additionalProperties": false
8319
+ }
8320
+ ]
8321
+ },
8322
+ "description": "Object-level validation rules"
8323
+ },
8324
+ "stateMachine": {
8325
+ "type": "object",
8326
+ "properties": {
8327
+ "id": {
8328
+ "type": "string",
8329
+ "minLength": 2,
8330
+ "pattern": "^[a-z][a-z0-9_]*$",
8331
+ "description": "Unique Machine ID"
8332
+ },
8333
+ "description": {
8334
+ "type": "string"
8335
+ },
8336
+ "contextSchema": {
8337
+ "type": "object",
8338
+ "additionalProperties": {},
8339
+ "description": "Zod Schema for the machine context/memory"
8340
+ },
8341
+ "initial": {
8342
+ "type": "string",
8343
+ "description": "Initial State ID"
8344
+ },
8345
+ "states": {
8346
+ "type": "object",
8347
+ "additionalProperties": {
8348
+ "type": "object",
8349
+ "properties": {
8350
+ "type": {
8351
+ "type": "string",
8352
+ "enum": [
8353
+ "atomic",
8354
+ "compound",
8355
+ "parallel",
8356
+ "final",
8357
+ "history"
8358
+ ],
8359
+ "default": "atomic"
8360
+ },
8361
+ "entry": {
8362
+ "type": "array",
8363
+ "items": {
8364
+ "anyOf": [
8365
+ {
8366
+ "type": "string",
8367
+ "description": "Action Name"
8368
+ },
8369
+ {
8370
+ "type": "object",
8371
+ "properties": {
8372
+ "type": {
8373
+ "type": "string"
8374
+ },
8375
+ "params": {
8376
+ "type": "object",
8377
+ "additionalProperties": {}
8378
+ }
7124
8379
  },
7125
- "description": {
7126
- "type": "string",
7127
- "description": "Administrative notes explaining the business reason"
8380
+ "required": [
8381
+ "type"
8382
+ ],
8383
+ "additionalProperties": false
8384
+ }
8385
+ ]
8386
+ },
8387
+ "description": "Actions to run when entering this state"
8388
+ },
8389
+ "exit": {
8390
+ "type": "array",
8391
+ "items": {
8392
+ "anyOf": [
8393
+ {
8394
+ "type": "string",
8395
+ "description": "Action Name"
8396
+ },
8397
+ {
8398
+ "type": "object",
8399
+ "properties": {
8400
+ "type": {
8401
+ "type": "string"
8402
+ },
8403
+ "params": {
8404
+ "type": "object",
8405
+ "additionalProperties": {}
8406
+ }
7128
8407
  },
7129
- "active": {
7130
- "type": "boolean",
7131
- "default": true
8408
+ "required": [
8409
+ "type"
8410
+ ],
8411
+ "additionalProperties": false
8412
+ }
8413
+ ]
8414
+ },
8415
+ "description": "Actions to run when leaving this state"
8416
+ },
8417
+ "on": {
8418
+ "type": "object",
8419
+ "additionalProperties": {
8420
+ "anyOf": [
8421
+ {
8422
+ "type": "string"
8423
+ },
8424
+ {
8425
+ "type": "object",
8426
+ "properties": {
8427
+ "target": {
8428
+ "type": "string",
8429
+ "description": "Target State ID"
8430
+ },
8431
+ "cond": {
8432
+ "anyOf": [
8433
+ {
8434
+ "type": "string",
8435
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
8436
+ },
8437
+ {
8438
+ "type": "object",
8439
+ "properties": {
8440
+ "type": {
8441
+ "type": "string"
8442
+ },
8443
+ "params": {
8444
+ "type": "object",
8445
+ "additionalProperties": {}
8446
+ }
8447
+ },
8448
+ "required": [
8449
+ "type"
8450
+ ],
8451
+ "additionalProperties": false
8452
+ }
8453
+ ],
8454
+ "description": "Condition (Guard) required to take this path"
8455
+ },
8456
+ "actions": {
8457
+ "type": "array",
8458
+ "items": {
8459
+ "anyOf": [
8460
+ {
8461
+ "type": "string",
8462
+ "description": "Action Name"
8463
+ },
8464
+ {
8465
+ "type": "object",
8466
+ "properties": {
8467
+ "type": {
8468
+ "type": "string"
8469
+ },
8470
+ "params": {
8471
+ "type": "object",
8472
+ "additionalProperties": {}
8473
+ }
8474
+ },
8475
+ "required": [
8476
+ "type"
8477
+ ],
8478
+ "additionalProperties": false
8479
+ }
8480
+ ]
8481
+ },
8482
+ "description": "Actions to execute during transition"
8483
+ },
8484
+ "description": {
8485
+ "type": "string",
8486
+ "description": "Human readable description of this rule"
8487
+ }
7132
8488
  },
7133
- "events": {
7134
- "type": "array",
7135
- "items": {
8489
+ "additionalProperties": false
8490
+ },
8491
+ {
8492
+ "type": "array",
8493
+ "items": {
8494
+ "type": "object",
8495
+ "properties": {
8496
+ "target": {
8497
+ "type": "string",
8498
+ "description": "Target State ID"
8499
+ },
8500
+ "cond": {
8501
+ "anyOf": [
8502
+ {
8503
+ "type": "string",
8504
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
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
+ ],
8523
+ "description": "Condition (Guard) required to take this path"
8524
+ },
8525
+ "actions": {
8526
+ "type": "array",
8527
+ "items": {
8528
+ "anyOf": [
8529
+ {
8530
+ "type": "string",
8531
+ "description": "Action Name"
8532
+ },
8533
+ {
8534
+ "type": "object",
8535
+ "properties": {
8536
+ "type": {
8537
+ "type": "string"
8538
+ },
8539
+ "params": {
8540
+ "type": "object",
8541
+ "additionalProperties": {}
8542
+ }
8543
+ },
8544
+ "required": [
8545
+ "type"
8546
+ ],
8547
+ "additionalProperties": false
8548
+ }
8549
+ ]
8550
+ },
8551
+ "description": "Actions to execute during transition"
8552
+ },
8553
+ "description": {
8554
+ "type": "string",
8555
+ "description": "Human readable description of this rule"
8556
+ }
8557
+ },
8558
+ "additionalProperties": false
8559
+ }
8560
+ }
8561
+ ]
8562
+ },
8563
+ "description": "Map of Event Type -> Transition Definition"
8564
+ },
8565
+ "always": {
8566
+ "type": "array",
8567
+ "items": {
8568
+ "type": "object",
8569
+ "properties": {
8570
+ "target": {
8571
+ "type": "string",
8572
+ "description": "Target State ID"
8573
+ },
8574
+ "cond": {
8575
+ "anyOf": [
8576
+ {
7136
8577
  "type": "string",
7137
- "enum": [
7138
- "insert",
7139
- "update",
7140
- "delete"
7141
- ]
8578
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
7142
8579
  },
7143
- "default": [
7144
- "insert",
7145
- "update"
7146
- ],
7147
- "description": "Validation contexts"
8580
+ {
8581
+ "type": "object",
8582
+ "properties": {
8583
+ "type": {
8584
+ "type": "string"
8585
+ },
8586
+ "params": {
8587
+ "type": "object",
8588
+ "additionalProperties": {}
8589
+ }
8590
+ },
8591
+ "required": [
8592
+ "type"
8593
+ ],
8594
+ "additionalProperties": false
8595
+ }
8596
+ ],
8597
+ "description": "Condition (Guard) required to take this path"
8598
+ },
8599
+ "actions": {
8600
+ "type": "array",
8601
+ "items": {
8602
+ "anyOf": [
8603
+ {
8604
+ "type": "string",
8605
+ "description": "Action Name"
8606
+ },
8607
+ {
8608
+ "type": "object",
8609
+ "properties": {
8610
+ "type": {
8611
+ "type": "string"
8612
+ },
8613
+ "params": {
8614
+ "type": "object",
8615
+ "additionalProperties": {}
8616
+ }
8617
+ },
8618
+ "required": [
8619
+ "type"
8620
+ ],
8621
+ "additionalProperties": false
8622
+ }
8623
+ ]
7148
8624
  },
7149
- "tags": {
7150
- "type": "array",
7151
- "items": {
7152
- "type": "string"
8625
+ "description": "Actions to execute during transition"
8626
+ },
8627
+ "description": {
8628
+ "type": "string",
8629
+ "description": "Human readable description of this rule"
8630
+ }
8631
+ },
8632
+ "additionalProperties": false
8633
+ }
8634
+ },
8635
+ "initial": {
8636
+ "type": "string",
8637
+ "description": "Initial child state (if compound)"
8638
+ },
8639
+ "states": {
8640
+ "type": "object",
8641
+ "additionalProperties": {}
8642
+ },
8643
+ "meta": {
8644
+ "type": "object",
8645
+ "properties": {
8646
+ "label": {
8647
+ "type": "string"
8648
+ },
8649
+ "description": {
8650
+ "type": "string"
8651
+ },
8652
+ "color": {
8653
+ "type": "string"
8654
+ },
8655
+ "aiInstructions": {
8656
+ "type": "string",
8657
+ "description": "Specific instructions for AI when in this state"
8658
+ }
8659
+ },
8660
+ "additionalProperties": false
8661
+ }
8662
+ },
8663
+ "additionalProperties": false
8664
+ },
8665
+ "description": "State Nodes"
8666
+ },
8667
+ "on": {
8668
+ "type": "object",
8669
+ "additionalProperties": {
8670
+ "anyOf": [
8671
+ {
8672
+ "type": "string"
8673
+ },
8674
+ {
8675
+ "type": "object",
8676
+ "properties": {
8677
+ "target": {
8678
+ "type": "string",
8679
+ "description": "Target State ID"
8680
+ },
8681
+ "cond": {
8682
+ "anyOf": [
8683
+ {
8684
+ "type": "string",
8685
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
8686
+ },
8687
+ {
8688
+ "type": "object",
8689
+ "properties": {
8690
+ "type": {
8691
+ "type": "string"
8692
+ },
8693
+ "params": {
8694
+ "type": "object",
8695
+ "additionalProperties": {}
8696
+ }
8697
+ },
8698
+ "required": [
8699
+ "type"
8700
+ ],
8701
+ "additionalProperties": false
8702
+ }
8703
+ ],
8704
+ "description": "Condition (Guard) required to take this path"
8705
+ },
8706
+ "actions": {
8707
+ "type": "array",
8708
+ "items": {
8709
+ "anyOf": [
8710
+ {
8711
+ "type": "string",
8712
+ "description": "Action Name"
8713
+ },
8714
+ {
8715
+ "type": "object",
8716
+ "properties": {
8717
+ "type": {
8718
+ "type": "string"
8719
+ },
8720
+ "params": {
8721
+ "type": "object",
8722
+ "additionalProperties": {}
8723
+ }
8724
+ },
8725
+ "required": [
8726
+ "type"
8727
+ ],
8728
+ "additionalProperties": false
8729
+ }
8730
+ ]
8731
+ },
8732
+ "description": "Actions to execute during transition"
8733
+ },
8734
+ "description": {
8735
+ "type": "string",
8736
+ "description": "Human readable description of this rule"
8737
+ }
8738
+ },
8739
+ "additionalProperties": false
8740
+ },
8741
+ {
8742
+ "type": "array",
8743
+ "items": {
8744
+ "type": "object",
8745
+ "properties": {
8746
+ "target": {
8747
+ "type": "string",
8748
+ "description": "Target State ID"
8749
+ },
8750
+ "cond": {
8751
+ "anyOf": [
8752
+ {
8753
+ "type": "string",
8754
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
7153
8755
  },
7154
- "description": "Categorization tags (e.g., \"compliance\", \"billing\")"
7155
- },
7156
- "severity": {
7157
- "type": "string",
7158
- "enum": [
7159
- "error",
7160
- "warning",
7161
- "info"
7162
- ],
7163
- "default": "error"
7164
- },
7165
- "message": {
7166
- "type": "string",
7167
- "description": "Error message to display to the user"
7168
- },
7169
- "type": {
7170
- "type": "string",
7171
- "const": "async"
8756
+ {
8757
+ "type": "object",
8758
+ "properties": {
8759
+ "type": {
8760
+ "type": "string"
8761
+ },
8762
+ "params": {
8763
+ "type": "object",
8764
+ "additionalProperties": {}
8765
+ }
8766
+ },
8767
+ "required": [
8768
+ "type"
8769
+ ],
8770
+ "additionalProperties": false
8771
+ }
8772
+ ],
8773
+ "description": "Condition (Guard) required to take this path"
8774
+ },
8775
+ "actions": {
8776
+ "type": "array",
8777
+ "items": {
8778
+ "anyOf": [
8779
+ {
8780
+ "type": "string",
8781
+ "description": "Action Name"
8782
+ },
8783
+ {
8784
+ "type": "object",
8785
+ "properties": {
8786
+ "type": {
8787
+ "type": "string"
8788
+ },
8789
+ "params": {
8790
+ "type": "object",
8791
+ "additionalProperties": {}
8792
+ }
8793
+ },
8794
+ "required": [
8795
+ "type"
8796
+ ],
8797
+ "additionalProperties": false
8798
+ }
8799
+ ]
7172
8800
  },
7173
- "field": {
8801
+ "description": "Actions to execute during transition"
8802
+ },
8803
+ "description": {
8804
+ "type": "string",
8805
+ "description": "Human readable description of this rule"
8806
+ }
8807
+ },
8808
+ "additionalProperties": false
8809
+ }
8810
+ }
8811
+ ]
8812
+ }
8813
+ }
8814
+ },
8815
+ "required": [
8816
+ "id",
8817
+ "initial",
8818
+ "states"
8819
+ ],
8820
+ "additionalProperties": false,
8821
+ "description": "Single state machine for record lifecycle (shorthand)"
8822
+ },
8823
+ "stateMachines": {
8824
+ "type": "object",
8825
+ "additionalProperties": {
8826
+ "type": "object",
8827
+ "properties": {
8828
+ "id": {
8829
+ "type": "string",
8830
+ "minLength": 2,
8831
+ "pattern": "^[a-z][a-z0-9_]*$",
8832
+ "description": "Unique Machine ID"
8833
+ },
8834
+ "description": {
8835
+ "type": "string"
8836
+ },
8837
+ "contextSchema": {
8838
+ "type": "object",
8839
+ "additionalProperties": {},
8840
+ "description": "Zod Schema for the machine context/memory"
8841
+ },
8842
+ "initial": {
8843
+ "type": "string",
8844
+ "description": "Initial State ID"
8845
+ },
8846
+ "states": {
8847
+ "type": "object",
8848
+ "additionalProperties": {
8849
+ "type": "object",
8850
+ "properties": {
8851
+ "type": {
8852
+ "type": "string",
8853
+ "enum": [
8854
+ "atomic",
8855
+ "compound",
8856
+ "parallel",
8857
+ "final",
8858
+ "history"
8859
+ ],
8860
+ "default": "atomic"
8861
+ },
8862
+ "entry": {
8863
+ "type": "array",
8864
+ "items": {
8865
+ "anyOf": [
8866
+ {
7174
8867
  "type": "string",
7175
- "description": "Field to validate"
8868
+ "description": "Action Name"
7176
8869
  },
7177
- "validatorUrl": {
8870
+ {
8871
+ "type": "object",
8872
+ "properties": {
8873
+ "type": {
8874
+ "type": "string"
8875
+ },
8876
+ "params": {
8877
+ "type": "object",
8878
+ "additionalProperties": {}
8879
+ }
8880
+ },
8881
+ "required": [
8882
+ "type"
8883
+ ],
8884
+ "additionalProperties": false
8885
+ }
8886
+ ]
8887
+ },
8888
+ "description": "Actions to run when entering this state"
8889
+ },
8890
+ "exit": {
8891
+ "type": "array",
8892
+ "items": {
8893
+ "anyOf": [
8894
+ {
7178
8895
  "type": "string",
7179
- "description": "External API endpoint for validation"
8896
+ "description": "Action Name"
7180
8897
  },
7181
- "method": {
7182
- "type": "string",
7183
- "enum": [
7184
- "GET",
7185
- "POST"
8898
+ {
8899
+ "type": "object",
8900
+ "properties": {
8901
+ "type": {
8902
+ "type": "string"
8903
+ },
8904
+ "params": {
8905
+ "type": "object",
8906
+ "additionalProperties": {}
8907
+ }
8908
+ },
8909
+ "required": [
8910
+ "type"
7186
8911
  ],
7187
- "default": "GET",
7188
- "description": "HTTP method for external call"
8912
+ "additionalProperties": false
8913
+ }
8914
+ ]
8915
+ },
8916
+ "description": "Actions to run when leaving this state"
8917
+ },
8918
+ "on": {
8919
+ "type": "object",
8920
+ "additionalProperties": {
8921
+ "anyOf": [
8922
+ {
8923
+ "type": "string"
7189
8924
  },
7190
- "headers": {
8925
+ {
7191
8926
  "type": "object",
7192
- "additionalProperties": {
7193
- "type": "string"
8927
+ "properties": {
8928
+ "target": {
8929
+ "type": "string",
8930
+ "description": "Target State ID"
8931
+ },
8932
+ "cond": {
8933
+ "anyOf": [
8934
+ {
8935
+ "type": "string",
8936
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
8937
+ },
8938
+ {
8939
+ "type": "object",
8940
+ "properties": {
8941
+ "type": {
8942
+ "type": "string"
8943
+ },
8944
+ "params": {
8945
+ "type": "object",
8946
+ "additionalProperties": {}
8947
+ }
8948
+ },
8949
+ "required": [
8950
+ "type"
8951
+ ],
8952
+ "additionalProperties": false
8953
+ }
8954
+ ],
8955
+ "description": "Condition (Guard) required to take this path"
8956
+ },
8957
+ "actions": {
8958
+ "type": "array",
8959
+ "items": {
8960
+ "anyOf": [
8961
+ {
8962
+ "type": "string",
8963
+ "description": "Action Name"
8964
+ },
8965
+ {
8966
+ "type": "object",
8967
+ "properties": {
8968
+ "type": {
8969
+ "type": "string"
8970
+ },
8971
+ "params": {
8972
+ "type": "object",
8973
+ "additionalProperties": {}
8974
+ }
8975
+ },
8976
+ "required": [
8977
+ "type"
8978
+ ],
8979
+ "additionalProperties": false
8980
+ }
8981
+ ]
8982
+ },
8983
+ "description": "Actions to execute during transition"
8984
+ },
8985
+ "description": {
8986
+ "type": "string",
8987
+ "description": "Human readable description of this rule"
8988
+ }
7194
8989
  },
7195
- "description": "Custom headers for the request"
7196
- },
7197
- "validatorFunction": {
7198
- "type": "string",
7199
- "description": "Reference to custom validator function"
7200
- },
7201
- "timeout": {
7202
- "type": "number",
7203
- "default": 5000,
7204
- "description": "Timeout in milliseconds"
7205
- },
7206
- "debounce": {
7207
- "type": "number",
7208
- "description": "Debounce delay in milliseconds"
8990
+ "additionalProperties": false
7209
8991
  },
7210
- "params": {
7211
- "type": "object",
7212
- "additionalProperties": {},
7213
- "description": "Additional parameters to pass to validator"
8992
+ {
8993
+ "type": "array",
8994
+ "items": {
8995
+ "type": "object",
8996
+ "properties": {
8997
+ "target": {
8998
+ "type": "string",
8999
+ "description": "Target State ID"
9000
+ },
9001
+ "cond": {
9002
+ "anyOf": [
9003
+ {
9004
+ "type": "string",
9005
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
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
+ }
9023
+ ],
9024
+ "description": "Condition (Guard) required to take this path"
9025
+ },
9026
+ "actions": {
9027
+ "type": "array",
9028
+ "items": {
9029
+ "anyOf": [
9030
+ {
9031
+ "type": "string",
9032
+ "description": "Action Name"
9033
+ },
9034
+ {
9035
+ "type": "object",
9036
+ "properties": {
9037
+ "type": {
9038
+ "type": "string"
9039
+ },
9040
+ "params": {
9041
+ "type": "object",
9042
+ "additionalProperties": {}
9043
+ }
9044
+ },
9045
+ "required": [
9046
+ "type"
9047
+ ],
9048
+ "additionalProperties": false
9049
+ }
9050
+ ]
9051
+ },
9052
+ "description": "Actions to execute during transition"
9053
+ },
9054
+ "description": {
9055
+ "type": "string",
9056
+ "description": "Human readable description of this rule"
9057
+ }
9058
+ },
9059
+ "additionalProperties": false
9060
+ }
7214
9061
  }
7215
- },
7216
- "required": [
7217
- "name",
7218
- "message",
7219
- "type",
7220
- "field"
7221
- ],
7222
- "additionalProperties": false
9062
+ ]
7223
9063
  },
7224
- {
9064
+ "description": "Map of Event Type -> Transition Definition"
9065
+ },
9066
+ "always": {
9067
+ "type": "array",
9068
+ "items": {
7225
9069
  "type": "object",
7226
9070
  "properties": {
7227
- "name": {
9071
+ "target": {
7228
9072
  "type": "string",
7229
- "pattern": "^[a-z_][a-z0-9_]*$",
7230
- "description": "Unique rule name (snake_case)"
7231
- },
7232
- "label": {
7233
- "type": "string",
7234
- "description": "Human-readable label for the rule listing"
7235
- },
7236
- "description": {
7237
- "type": "string",
7238
- "description": "Administrative notes explaining the business reason"
7239
- },
7240
- "active": {
7241
- "type": "boolean",
7242
- "default": true
9073
+ "description": "Target State ID"
9074
+ },
9075
+ "cond": {
9076
+ "anyOf": [
9077
+ {
9078
+ "type": "string",
9079
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
9080
+ },
9081
+ {
9082
+ "type": "object",
9083
+ "properties": {
9084
+ "type": {
9085
+ "type": "string"
9086
+ },
9087
+ "params": {
9088
+ "type": "object",
9089
+ "additionalProperties": {}
9090
+ }
9091
+ },
9092
+ "required": [
9093
+ "type"
9094
+ ],
9095
+ "additionalProperties": false
9096
+ }
9097
+ ],
9098
+ "description": "Condition (Guard) required to take this path"
7243
9099
  },
7244
- "events": {
9100
+ "actions": {
7245
9101
  "type": "array",
7246
9102
  "items": {
7247
- "type": "string",
7248
- "enum": [
7249
- "insert",
7250
- "update",
7251
- "delete"
9103
+ "anyOf": [
9104
+ {
9105
+ "type": "string",
9106
+ "description": "Action Name"
9107
+ },
9108
+ {
9109
+ "type": "object",
9110
+ "properties": {
9111
+ "type": {
9112
+ "type": "string"
9113
+ },
9114
+ "params": {
9115
+ "type": "object",
9116
+ "additionalProperties": {}
9117
+ }
9118
+ },
9119
+ "required": [
9120
+ "type"
9121
+ ],
9122
+ "additionalProperties": false
9123
+ }
7252
9124
  ]
7253
9125
  },
7254
- "default": [
7255
- "insert",
7256
- "update"
7257
- ],
7258
- "description": "Validation contexts"
9126
+ "description": "Actions to execute during transition"
7259
9127
  },
7260
- "tags": {
7261
- "type": "array",
7262
- "items": {
7263
- "type": "string"
9128
+ "description": {
9129
+ "type": "string",
9130
+ "description": "Human readable description of this rule"
9131
+ }
9132
+ },
9133
+ "additionalProperties": false
9134
+ }
9135
+ },
9136
+ "initial": {
9137
+ "type": "string",
9138
+ "description": "Initial child state (if compound)"
9139
+ },
9140
+ "states": {
9141
+ "type": "object",
9142
+ "additionalProperties": {}
9143
+ },
9144
+ "meta": {
9145
+ "type": "object",
9146
+ "properties": {
9147
+ "label": {
9148
+ "type": "string"
9149
+ },
9150
+ "description": {
9151
+ "type": "string"
9152
+ },
9153
+ "color": {
9154
+ "type": "string"
9155
+ },
9156
+ "aiInstructions": {
9157
+ "type": "string",
9158
+ "description": "Specific instructions for AI when in this state"
9159
+ }
9160
+ },
9161
+ "additionalProperties": false
9162
+ }
9163
+ },
9164
+ "additionalProperties": false
9165
+ },
9166
+ "description": "State Nodes"
9167
+ },
9168
+ "on": {
9169
+ "type": "object",
9170
+ "additionalProperties": {
9171
+ "anyOf": [
9172
+ {
9173
+ "type": "string"
9174
+ },
9175
+ {
9176
+ "type": "object",
9177
+ "properties": {
9178
+ "target": {
9179
+ "type": "string",
9180
+ "description": "Target State ID"
9181
+ },
9182
+ "cond": {
9183
+ "anyOf": [
9184
+ {
9185
+ "type": "string",
9186
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
7264
9187
  },
7265
- "description": "Categorization tags (e.g., \"compliance\", \"billing\")"
9188
+ {
9189
+ "type": "object",
9190
+ "properties": {
9191
+ "type": {
9192
+ "type": "string"
9193
+ },
9194
+ "params": {
9195
+ "type": "object",
9196
+ "additionalProperties": {}
9197
+ }
9198
+ },
9199
+ "required": [
9200
+ "type"
9201
+ ],
9202
+ "additionalProperties": false
9203
+ }
9204
+ ],
9205
+ "description": "Condition (Guard) required to take this path"
9206
+ },
9207
+ "actions": {
9208
+ "type": "array",
9209
+ "items": {
9210
+ "anyOf": [
9211
+ {
9212
+ "type": "string",
9213
+ "description": "Action Name"
9214
+ },
9215
+ {
9216
+ "type": "object",
9217
+ "properties": {
9218
+ "type": {
9219
+ "type": "string"
9220
+ },
9221
+ "params": {
9222
+ "type": "object",
9223
+ "additionalProperties": {}
9224
+ }
9225
+ },
9226
+ "required": [
9227
+ "type"
9228
+ ],
9229
+ "additionalProperties": false
9230
+ }
9231
+ ]
7266
9232
  },
7267
- "severity": {
9233
+ "description": "Actions to execute during transition"
9234
+ },
9235
+ "description": {
9236
+ "type": "string",
9237
+ "description": "Human readable description of this rule"
9238
+ }
9239
+ },
9240
+ "additionalProperties": false
9241
+ },
9242
+ {
9243
+ "type": "array",
9244
+ "items": {
9245
+ "type": "object",
9246
+ "properties": {
9247
+ "target": {
7268
9248
  "type": "string",
7269
- "enum": [
7270
- "error",
7271
- "warning",
7272
- "info"
9249
+ "description": "Target State ID"
9250
+ },
9251
+ "cond": {
9252
+ "anyOf": [
9253
+ {
9254
+ "type": "string",
9255
+ "description": "Guard Name (e.g., \"isManager\", \"amountGT1000\")"
9256
+ },
9257
+ {
9258
+ "type": "object",
9259
+ "properties": {
9260
+ "type": {
9261
+ "type": "string"
9262
+ },
9263
+ "params": {
9264
+ "type": "object",
9265
+ "additionalProperties": {}
9266
+ }
9267
+ },
9268
+ "required": [
9269
+ "type"
9270
+ ],
9271
+ "additionalProperties": false
9272
+ }
7273
9273
  ],
7274
- "default": "error"
7275
- },
7276
- "message": {
7277
- "type": "string",
7278
- "description": "Error message to display to the user"
9274
+ "description": "Condition (Guard) required to take this path"
7279
9275
  },
7280
- "type": {
7281
- "type": "string",
7282
- "const": "custom"
9276
+ "actions": {
9277
+ "type": "array",
9278
+ "items": {
9279
+ "anyOf": [
9280
+ {
9281
+ "type": "string",
9282
+ "description": "Action Name"
9283
+ },
9284
+ {
9285
+ "type": "object",
9286
+ "properties": {
9287
+ "type": {
9288
+ "type": "string"
9289
+ },
9290
+ "params": {
9291
+ "type": "object",
9292
+ "additionalProperties": {}
9293
+ }
9294
+ },
9295
+ "required": [
9296
+ "type"
9297
+ ],
9298
+ "additionalProperties": false
9299
+ }
9300
+ ]
9301
+ },
9302
+ "description": "Actions to execute during transition"
7283
9303
  },
7284
- "handler": {
9304
+ "description": {
7285
9305
  "type": "string",
7286
- "description": "Name of the custom validation function registered in the system"
7287
- },
7288
- "params": {
7289
- "type": "object",
7290
- "additionalProperties": {},
7291
- "description": "Parameters passed to the custom handler"
9306
+ "description": "Human readable description of this rule"
7292
9307
  }
7293
9308
  },
7294
- "required": [
7295
- "name",
7296
- "message",
7297
- "type",
7298
- "handler"
7299
- ],
7300
9309
  "additionalProperties": false
7301
- },
7302
- {}
7303
- ],
7304
- "description": "Validation rule to apply when condition is true"
7305
- },
7306
- "otherwise": {
7307
- "description": "Validation rule to apply when condition is false"
7308
- }
7309
- },
7310
- "required": [
7311
- "name",
7312
- "message",
7313
- "type",
7314
- "when",
7315
- "then"
7316
- ],
7317
- "additionalProperties": false
9310
+ }
9311
+ }
9312
+ ]
9313
+ }
7318
9314
  }
7319
- ]
9315
+ },
9316
+ "required": [
9317
+ "id",
9318
+ "initial",
9319
+ "states"
9320
+ ],
9321
+ "additionalProperties": false
7320
9322
  },
7321
- "description": "Object-level validation rules"
9323
+ "description": "Named state machines for parallel lifecycles (e.g., status, payment, approval)"
7322
9324
  },
7323
9325
  "titleFormat": {
7324
9326
  "type": "string",