Documentation
¶
Index ¶
- func RegisterBuiltins(reg *Registry, validator *validation.JSONSchemaValidator, httpCfg HTTPConfig, ...) error
- func RegisterWorkflowActions(reg *Registry, deps WorkflowActionDeps) error
- type Action
- type ActionInfo
- type ActionInput
- type ActionOutput
- type ActionRegistry
- type ActionSchema
- type AgentNotifier
- type FSConfig
- type HTTPConfig
- type HTTPGetAction
- type HTTPPostAction
- type HTTPRequestAction
- type Registry
- type ShellConfig
- type SubWorkflowRunner
- type WorkflowActionDeps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterBuiltins ¶
func RegisterBuiltins(reg *Registry, validator *validation.JSONSchemaValidator, httpCfg HTTPConfig, fsCfg FSConfig, shellCfg ShellConfig) error
RegisterBuiltins registers all built-in actions in the given registry.
func RegisterWorkflowActions ¶
func RegisterWorkflowActions(reg *Registry, deps WorkflowActionDeps) error
RegisterWorkflowActions registers workflow actions into the given registry. Called after the executor is created so the SubWorkflowRunner can be wired.
Types ¶
type Action ¶
type Action interface {
Name() string
Schema() ActionSchema
Execute(ctx context.Context, input ActionInput) (*ActionOutput, error)
Validate(input map[string]any) error
}
Action is an executable unit of work within a workflow step.
func AssertActions ¶
func AssertActions(validator *validation.JSONSchemaValidator) []Action
AssertActions returns all assertion-related actions.
func CryptoActions ¶
func CryptoActions() []Action
CryptoActions returns all crypto-related actions.
func ShellActions ¶
func ShellActions(cfg ShellConfig) []Action
ShellActions returns all shell-related actions.
func WorkflowActions ¶
func WorkflowActions(deps WorkflowActionDeps) []Action
WorkflowActions returns the six workflow-scoped actions.
type ActionInfo ¶
type ActionInfo struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
}
ActionInfo is a summary of a registered action for listing.
type ActionInput ¶
type ActionInput struct {
Params map[string]any `json:"params"`
Context map[string]any `json:"context,omitempty"`
}
ActionInput is the data provided to an action at execution time.
type ActionOutput ¶
type ActionOutput struct {
Data json.RawMessage `json:"data,omitempty"`
}
ActionOutput is the result of an action execution.
type ActionRegistry ¶
type ActionRegistry interface {
Register(action Action) error
Get(name string) (Action, error)
List() []ActionInfo
}
ActionRegistry manages the lifecycle and lookup of available actions.
type ActionSchema ¶
type ActionSchema struct {
InputSchema json.RawMessage `json:"input_schema,omitempty"`
OutputSchema json.RawMessage `json:"output_schema,omitempty"`
Description string `json:"description,omitempty"`
}
ActionSchema describes the input/output contract of an action.
type AgentNotifier ¶
type AgentNotifier interface {
Notify(ctx context.Context, agentID string, payload map[string]any) error
}
AgentNotifier pushes notifications to connected agents via MCP SSE.
type FSConfig ¶
type FSConfig struct {
Limits isolation.ResourceLimits
MaxReadSize int64
}
FSConfig configures the filesystem actions.
type HTTPConfig ¶
HTTPConfig configures the HTTP actions.
type HTTPGetAction ¶
type HTTPGetAction struct {
// contains filtered or unexported fields
}
HTTPGetAction implements the "http.get" convenience action.
func NewHTTPGetAction ¶
func NewHTTPGetAction(cfg HTTPConfig) *HTTPGetAction
NewHTTPGetAction creates a new http.get action.
func (*HTTPGetAction) Execute ¶
func (a *HTTPGetAction) Execute(ctx context.Context, input ActionInput) (*ActionOutput, error)
func (*HTTPGetAction) Name ¶
func (a *HTTPGetAction) Name() string
func (*HTTPGetAction) Schema ¶
func (a *HTTPGetAction) Schema() ActionSchema
type HTTPPostAction ¶
type HTTPPostAction struct {
// contains filtered or unexported fields
}
HTTPPostAction implements the "http.post" convenience action.
func NewHTTPPostAction ¶
func NewHTTPPostAction(cfg HTTPConfig) *HTTPPostAction
NewHTTPPostAction creates a new http.post action.
func (*HTTPPostAction) Execute ¶
func (a *HTTPPostAction) Execute(ctx context.Context, input ActionInput) (*ActionOutput, error)
func (*HTTPPostAction) Name ¶
func (a *HTTPPostAction) Name() string
func (*HTTPPostAction) Schema ¶
func (a *HTTPPostAction) Schema() ActionSchema
type HTTPRequestAction ¶
type HTTPRequestAction struct {
// contains filtered or unexported fields
}
HTTPRequestAction implements the "http.request" action.
func NewHTTPRequestAction ¶
func NewHTTPRequestAction(cfg HTTPConfig) *HTTPRequestAction
NewHTTPRequestAction creates a new http.request action.
func (*HTTPRequestAction) Execute ¶
func (a *HTTPRequestAction) Execute(ctx context.Context, input ActionInput) (*ActionOutput, error)
func (*HTTPRequestAction) Name ¶
func (a *HTTPRequestAction) Name() string
func (*HTTPRequestAction) Schema ¶
func (a *HTTPRequestAction) Schema() ActionSchema
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is the concrete thread-safe ActionRegistry implementation.
func (*Registry) List ¶
func (r *Registry) List() []ActionInfo
List returns info for all registered actions, sorted by name.
type ShellConfig ¶
type ShellConfig struct {
Isolator isolation.Isolator
DefaultTimeout time.Duration
DefaultLimits isolation.ResourceLimits
MaxOutputSize int64
}
ShellConfig configures the shell.exec action.
type SubWorkflowRunner ¶
type SubWorkflowRunner func(ctx context.Context, templateName, version string, params map[string]any, parentID, agentID string) (json.RawMessage, error)
SubWorkflowRunner is a function that executes a child workflow and returns its output. The executor satisfies this by wiring it after construction (late-bind).
type WorkflowActionDeps ¶
type WorkflowActionDeps struct {
RunSubWorkflow SubWorkflowRunner
Store store.Store
Hub streaming.EventHub
Notifier AgentNotifier
Logger *slog.Logger
}
WorkflowActionDeps holds the dependencies injected into workflow actions.