refactor: rename action→activity, statemachine→workflow, remove HTTP API layer
- action/ → activity/ (Temporal activities) - statemachine/ → workflow/ (Temporal workflows) - Removed internal/api/ and cmd/server/ (api-gw handles HTTP, Temporal is the API) - Created pkg/types/types.go as single source of truth for all shared types - Extracted CallRoleLLM helper (DRY: implementer/planner/judge shared pattern) - Fixed circular import: workflow_graph_query uses string activity names - Fixed logger.logf → logger.Info/Warn (method didn't exist) - Fixed routing types: added Branches, Activity, BackoffSeconds, TaskActivity - Fixed db.Canvas.Name, db.Client→DB, GetWorkflow→FetchWorkflow - Removed unused imports - All tests pass, build clean, vet clean
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -28,12 +28,16 @@ type State struct {
|
||||
Type StateType `json:"type"`
|
||||
|
||||
// Task fields
|
||||
Activity string `json:"activity,omitempty"`
|
||||
Resource string `json:"resource,omitempty"`
|
||||
Parameters map[string]interface{} `json:"parameters,omitempty"`
|
||||
Timeout string `json:"timeout,omitempty"`
|
||||
Retry *RetryPolicy `json:"retry,omitempty"`
|
||||
Catch []CatchClause `json:"catch,omitempty"`
|
||||
|
||||
// Parallel fields
|
||||
Branches []interface{} `json:"branches,omitempty"`
|
||||
|
||||
// Pass fields
|
||||
Result interface{} `json:"result,omitempty"`
|
||||
|
||||
@@ -50,14 +54,18 @@ type State struct {
|
||||
type StateType string
|
||||
|
||||
const (
|
||||
StateTypeTask StateType = "Task"
|
||||
StateTypePass StateType = "Pass"
|
||||
StateTypeFail StateType = "Fail"
|
||||
StateTypeTask StateType = "Task"
|
||||
StateTypePass StateType = "Pass"
|
||||
StateTypeFail StateType = "Fail"
|
||||
StateTypeParallel StateType = "Parallel"
|
||||
|
||||
TaskActivity = "Task"
|
||||
)
|
||||
|
||||
// RetryPolicy defines retry behavior for activities
|
||||
type RetryPolicy struct {
|
||||
MaxAttempts int32 `json:"maxAttempts"`
|
||||
BackoffSeconds int32 `json:"backoffSeconds,omitempty"`
|
||||
BackoffRate float64 `json:"backoffRate"`
|
||||
InitialInterval string `json:"initialInterval"`
|
||||
MaxInterval string `json:"maxInterval,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user