@@ -13,49 +13,57 @@ type FilterVM struct {
1313 Value any `json:"value"`
1414}
1515
16+ // FlowCommandVM is one step in a flow's command chain. Condition (nil on the
17+ // first entry) is how this command joins to the previous one when the chain
18+ // is concatenated into a single shell line at dispatch time.
19+ type FlowCommandVM struct {
20+ Command string `json:"command" binding:"required"`
21+ Condition * domain.Condition `json:"condition,omitempty" binding:"omitempty,oneof=OnSuccess OnFailure Always"`
22+ }
23+
1624type CreateRuleRequest struct {
17- ID * int64 `json:"id"`
18- Name string `json:"name" binding:"required,max=150"`
19- Description string `json:"description" binding:"omitempty,max=512"`
20- Conditions []FilterVM `json:"conditions" binding:"required,min=1"`
21- Commands []string `json:"commands" binding:"required,min=1"`
22- Active * bool `json:"active" binding:"required"`
23- AgentPlatform string `json:"agentPlatform" binding:"required"`
24- DefaultAgent string `json:"defaultAgent" binding:"omitempty,max=500"`
25- Shell string `json:"shell" binding:"omitempty,max=20"`
26- ExcludedAgents []string `json:"excludedAgents"`
25+ ID * int64 `json:"id"`
26+ Name string `json:"name" binding:"required,max=150"`
27+ Description string `json:"description" binding:"omitempty,max=512"`
28+ Conditions []FilterVM `json:"conditions" binding:"required,min=1"`
29+ Commands []FlowCommandVM `json:"commands" binding:"required,min=1,dive "`
30+ Active * bool `json:"active" binding:"required"`
31+ AgentPlatform string `json:"agentPlatform" binding:"required"`
32+ DefaultAgent string `json:"defaultAgent" binding:"omitempty,max=500"`
33+ Shell string `json:"shell" binding:"omitempty,max=20"`
34+ ExcludedAgents []string `json:"excludedAgents"`
2735}
2836
2937type UpdateRuleRequest struct {
30- ID * int64 `json:"id"`
31- Name string `json:"name" binding:"required,max=150"`
32- Description string `json:"description" binding:"omitempty,max=512"`
33- Conditions []FilterVM `json:"conditions" binding:"required,min=1"`
34- Commands []string `json:"commands" binding:"required,min=1"`
35- Active * bool `json:"active" binding:"required"`
36- AgentPlatform string `json:"agentPlatform" binding:"required"`
37- DefaultAgent string `json:"defaultAgent" binding:"omitempty,max=500"`
38- Shell string `json:"shell" binding:"omitempty,max=20"`
39- ExcludedAgents []string `json:"excludedAgents"`
38+ ID * int64 `json:"id"`
39+ Name string `json:"name" binding:"required,max=150"`
40+ Description string `json:"description" binding:"omitempty,max=512"`
41+ Conditions []FilterVM `json:"conditions" binding:"required,min=1"`
42+ Commands []FlowCommandVM `json:"commands" binding:"required,min=1,dive "`
43+ Active * bool `json:"active" binding:"required"`
44+ AgentPlatform string `json:"agentPlatform" binding:"required"`
45+ DefaultAgent string `json:"defaultAgent" binding:"omitempty,max=500"`
46+ Shell string `json:"shell" binding:"omitempty,max=20"`
47+ ExcludedAgents []string `json:"excludedAgents"`
4048}
4149
4250type ToggleRuleRequest struct {
4351 Enabled bool `json:"enabled"`
4452}
4553
4654type RuleResponse struct {
47- RelPath string `json:"relPath"`
48- Name string `json:"name"`
49- Description string `json:"description,omitempty"`
50- Conditions []FilterVM `json:"conditions"`
51- Commands []string `json:"commands"`
52- Active bool `json:"active"`
53- AgentPlatform string `json:"agentPlatform,omitempty"`
54- DefaultAgent string `json:"defaultAgent,omitempty"`
55- Shell string `json:"shell,omitempty"`
56- ExcludedAgents []string `json:"excludedAgents,omitempty"`
57- SystemOwner bool `json:"systemOwner"`
58- LastModifiedDate * time.Time `json:"lastModifiedDate,omitempty"`
55+ RelPath string `json:"relPath"`
56+ Name string `json:"name"`
57+ Description string `json:"description,omitempty"`
58+ Conditions []FilterVM `json:"conditions"`
59+ Commands []FlowCommandVM `json:"commands"`
60+ Active bool `json:"active"`
61+ AgentPlatform string `json:"agentPlatform,omitempty"`
62+ DefaultAgent string `json:"defaultAgent,omitempty"`
63+ Shell string `json:"shell,omitempty"`
64+ ExcludedAgents []string `json:"excludedAgents,omitempty"`
65+ SystemOwner bool `json:"systemOwner"`
66+ LastModifiedDate * time.Time `json:"lastModifiedDate,omitempty"`
5967}
6068
6169type RuleFilters struct {
0 commit comments