Documentation
¶
Index ¶
- Constants
- func EnsureProjectSkill(projectRoot string) (path string, created bool, err error)
- func NewLispEvaluator() *elispvm.Evaluator
- func RegisterTools(registry *tools.Registry, manager *internalagent.AgentManager, store Store)
- type ActiveRegistry
- type AgentHost
- type AgentResult
- type AgentTask
- type CancelTool
- func (t *CancelTool) Description() string
- func (t *CancelTool) Execute(ctx context.Context, params map[string]any) (tools.ToolResult, error)
- func (t *CancelTool) Name() string
- func (t *CancelTool) Parameters() json.RawMessage
- func (t *CancelTool) PromptGuidelines() []string
- func (t *CancelTool) PromptSnippet() string
- type FileStore
- type Host
- type LintTool
- func (t *LintTool) Description() string
- func (t *LintTool) Execute(ctx context.Context, params map[string]any) (tools.ToolResult, error)
- func (t *LintTool) Name() string
- func (t *LintTool) Parameters() json.RawMessage
- func (t *LintTool) PromptGuidelines() []string
- func (t *LintTool) PromptSnippet() string
- type PhaseState
- type ProgressEvent
- type RunState
- type RunTool
- func (t *RunTool) Description() string
- func (t *RunTool) Execute(ctx context.Context, params map[string]any) (tools.ToolResult, error)
- func (t *RunTool) ExecutionTimeout(params map[string]any) (time.Duration, bool)
- func (t *RunTool) Name() string
- func (t *RunTool) Parameters() json.RawMessage
- func (t *RunTool) PromptGuidelines() []string
- func (t *RunTool) PromptSnippet() string
- type Runner
- type StatusTool
- func (t *StatusTool) Description() string
- func (t *StatusTool) Execute(ctx context.Context, params map[string]any) (tools.ToolResult, error)
- func (t *StatusTool) Name() string
- func (t *StatusTool) Parameters() json.RawMessage
- func (t *StatusTool) PromptGuidelines() []string
- func (t *StatusTool) PromptSnippet() string
- type Store
- type WorkflowLog
Constants ¶
const ( StatusRunning = "running" StatusDone = "done" StatusError = "error" StatusCanceled = "canceled" )
const SkillName = "workflow-elisp"
Variables ¶
This section is empty.
Functions ¶
func EnsureProjectSkill ¶
EnsureProjectSkill creates the project-local workflow skill if it does not already exist. Existing SKILL.md or skill.md files are never overwritten so users can customize the workflow authoring instructions.
func NewLispEvaluator ¶
NewLispEvaluator creates an evaluator for workflow DSL execution.
Workflow-specific forms and functions such as workflow, phase, parallel, agent, result, and log must be registered by the workflow runner. The VM itself remains a generic Elisp subset implementation.
func RegisterTools ¶
func RegisterTools(registry *tools.Registry, manager *internalagent.AgentManager, store Store)
RegisterTools registers workflow tools.
Types ¶
type ActiveRegistry ¶
type ActiveRegistry struct {
// contains filtered or unexported fields
}
ActiveRegistry tracks workflow runs that can be canceled in this process.
func DefaultActiveRegistry ¶
func DefaultActiveRegistry() *ActiveRegistry
func NewActiveRegistry ¶
func NewActiveRegistry() *ActiveRegistry
func (*ActiveRegistry) Cancel ¶
func (r *ActiveRegistry) Cancel(id string) bool
func (*ActiveRegistry) IsActive ¶
func (r *ActiveRegistry) IsActive(id string) bool
func (*ActiveRegistry) Register ¶
func (r *ActiveRegistry) Register(id string, cancel context.CancelFunc) error
func (*ActiveRegistry) Unregister ¶
func (r *ActiveRegistry) Unregister(id string)
type AgentHost ¶
type AgentHost struct {
Manager *internalagent.AgentManager
ParentID agentpkg.AgentID
ParentMode string
ParentEventCh chan<- internalagent.Event
ParentRunCtx context.Context
}
AgentHost runs workflow tasks through the existing AgentManager.
type AgentResult ¶
type AgentResult struct {
Key string `json:"key"`
Name string `json:"name"`
Phase string `json:"phase,omitempty"`
InstanceKey string `json:"instanceKey,omitempty"`
Status string `json:"status"`
Result string `json:"result,omitempty"`
Error string `json:"error,omitempty"`
StartedAt time.Time `json:"startedAt"`
FinishedAt time.Time `json:"finishedAt,omitempty"`
Duration string `json:"duration,omitempty"`
}
AgentResult captures the completed worker-agent output.
type AgentTask ¶
type AgentTask struct {
Name string `json:"name"`
Phase string `json:"phase,omitempty"`
InstanceKey string `json:"instanceKey,omitempty"`
Prompt string `json:"prompt"`
Mode string `json:"mode,omitempty"`
WorkDir string `json:"workDir,omitempty"`
Tools []string `json:"tools,omitempty"`
MaxIterations int `json:"maxIterations,omitempty"`
SystemPromptExtra string `json:"systemPromptExtra,omitempty"`
}
AgentTask describes one workflow worker-agent invocation.
type CancelTool ¶
type CancelTool struct {
// contains filtered or unexported fields
}
func NewCancelTool ¶
func NewCancelTool(active *ActiveRegistry) *CancelTool
func (*CancelTool) Description ¶
func (t *CancelTool) Description() string
func (*CancelTool) Execute ¶
func (t *CancelTool) Execute(ctx context.Context, params map[string]any) (tools.ToolResult, error)
func (*CancelTool) Name ¶
func (t *CancelTool) Name() string
func (*CancelTool) Parameters ¶
func (t *CancelTool) Parameters() json.RawMessage
func (*CancelTool) PromptGuidelines ¶
func (t *CancelTool) PromptGuidelines() []string
func (*CancelTool) PromptSnippet ¶
func (t *CancelTool) PromptSnippet() string
type FileStore ¶
type FileStore struct {
// contains filtered or unexported fields
}
FileStore persists workflow state as JSON files.
func NewFileStore ¶
NewFileStore creates a file-backed workflow store rooted at dir.
type Host ¶
type Host interface {
RunAgent(ctx context.Context, task AgentTask) (AgentResult, error)
}
Host runs workflow worker-agent tasks.
type LintTool ¶
type LintTool struct{}
func NewLintTool ¶
func NewLintTool() *LintTool
func (*LintTool) Description ¶
func (*LintTool) Parameters ¶
func (t *LintTool) Parameters() json.RawMessage
func (*LintTool) PromptGuidelines ¶
func (*LintTool) PromptSnippet ¶
type PhaseState ¶
type PhaseState struct {
Name string `json:"name"`
Status string `json:"status"`
StartedAt time.Time `json:"startedAt"`
FinishedAt time.Time `json:"finishedAt,omitempty"`
Tasks []string `json:"tasks,omitempty"`
Error string `json:"error,omitempty"`
}
PhaseState captures runtime state for a workflow phase.
type ProgressEvent ¶
type ProgressEvent struct {
RunID string
Name string
Phase string
Task string
Status string
Message string
Time time.Time
}
ProgressEvent captures a lightweight workflow lifecycle update.
type RunState ¶
type RunState struct {
ID string `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
StartedAt time.Time `json:"startedAt"`
UpdatedAt time.Time `json:"updatedAt"`
FinishedAt time.Time `json:"finishedAt,omitempty"`
Phases []PhaseState `json:"phases,omitempty"`
Results map[string]AgentResult `json:"results,omitempty"`
Logs []WorkflowLog `json:"logs,omitempty"`
Error string `json:"error,omitempty"`
}
RunState is the persisted workflow run state.
type RunTool ¶
type RunTool struct {
// contains filtered or unexported fields
}
func NewRunTool ¶
func NewRunTool(manager *internalagent.AgentManager, store Store) *RunTool
func NewRunToolWithActive ¶
func NewRunToolWithActive(manager *internalagent.AgentManager, store Store, active *ActiveRegistry) *RunTool
func (*RunTool) Description ¶
func (*RunTool) ExecutionTimeout ¶
func (*RunTool) Parameters ¶
func (t *RunTool) Parameters() json.RawMessage
func (*RunTool) PromptGuidelines ¶
func (*RunTool) PromptSnippet ¶
type Runner ¶
type Runner struct {
Host Host
Store Store
Active *ActiveRegistry
Concurrency int
Now func() time.Time
Progress func(ProgressEvent)
}
Runner evaluates Elisp workflow DSL and delegates agent tasks to a Host.
type StatusTool ¶
type StatusTool struct {
// contains filtered or unexported fields
}
func NewStatusTool ¶
func NewStatusTool(store Store) *StatusTool
func (*StatusTool) Description ¶
func (t *StatusTool) Description() string
func (*StatusTool) Execute ¶
func (t *StatusTool) Execute(ctx context.Context, params map[string]any) (tools.ToolResult, error)
func (*StatusTool) Name ¶
func (t *StatusTool) Name() string
func (*StatusTool) Parameters ¶
func (t *StatusTool) Parameters() json.RawMessage
func (*StatusTool) PromptGuidelines ¶
func (t *StatusTool) PromptGuidelines() []string
func (*StatusTool) PromptSnippet ¶
func (t *StatusTool) PromptSnippet() string
type Store ¶
type Store interface {
Save(ctx context.Context, state *RunState) error
Load(ctx context.Context, id string) (*RunState, error)
List(ctx context.Context) ([]RunState, error)
}
Store persists workflow run state.
func DefaultStore ¶
func DefaultStore() Store
type WorkflowLog ¶
WorkflowLog is a timestamped log entry emitted by workflow DSL.