workflow

package
v0.0.40 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentConfig

type AgentConfig struct {
	ID               string   `yaml:"id"`
	WorkflowStatusID string   `yaml:"workflow_status_id"`
	Name             string   `yaml:"name"`
	Description      string   `yaml:"description"`
	Instructions     string   `yaml:"instructions"`
	AllowedTools     []string `yaml:"allowed_tools"`
}

type HookActionType

type HookActionType string
const (
	HookActionTypeUnspecified HookActionType = ""
	HookActionTypeSkill       HookActionType = "skill"
	HookActionTypeScript      HookActionType = "script"
)

type HookTrigger

type HookTrigger string
const (
	HookTriggerUnspecified            HookTrigger = ""
	HookTriggerBeforeTaskExecution    HookTrigger = "before_task_execution"
	HookTriggerAfterTaskExecution     HookTrigger = "after_task_execution"
	HookTriggerAfterWorktreeCreation  HookTrigger = "after_worktree_creation"
	HookTriggerBeforeWorktreeCreation HookTrigger = "before_worktree_creation"
)

type Repository

type Repository interface {
	Create(ctx context.Context, w *Workflow) error
	Get(ctx context.Context, id string) (*Workflow, error)
	List(ctx context.Context, projectID string, limit, offset int) ([]*Workflow, int, error)
	Update(ctx context.Context, w *Workflow) error
	Delete(ctx context.Context, id string) error
}

type Status

type Status struct {
	Name          string       `yaml:"name"`
	Order         int32        `yaml:"order"`
	IsInitial     bool         `yaml:"is_initial"`
	IsTerminal    bool         `yaml:"is_terminal"`
	TransitionsTo []string     `yaml:"transitions_to"`
	AgentID       string       `yaml:"agent_id,omitempty"`
	Hooks         []StatusHook `yaml:"hooks,omitempty"`

	// EnableAgentMDHarness controls whether a background AGENT.md review
	// harness runs when a task exits this status. Default is true (enabled).
	EnableAgentMDHarness             bool `yaml:"enable_agent_md_harness"`
	AgentMDHarnessExplicitlyDisabled bool `yaml:"agent_md_harness_explicitly_disabled,omitempty"`

	// PermissionMode for agents executing tasks in this status.
	PermissionMode string `yaml:"permission_mode,omitempty"`
}

type StatusHook

type StatusHook struct {
	ID         string         `yaml:"id"`
	SkillID    string         `yaml:"skill_id"`
	Trigger    HookTrigger    `yaml:"trigger"`
	Order      int32          `yaml:"order"`
	Name       string         `yaml:"name"`
	ActionType HookActionType `yaml:"action_type,omitempty"`
	ActionID   string         `yaml:"action_id,omitempty"`
}

type Workflow

type Workflow struct {
	ID           string        `yaml:"id"`
	ProjectID    string        `yaml:"project_id"`
	Name         string        `yaml:"name"`
	Description  string        `yaml:"description"`
	Statuses     []Status      `yaml:"statuses"`
	AgentConfigs []AgentConfig `yaml:"agent_configs"`
	CreatedAt    time.Time     `yaml:"created_at"`
	UpdatedAt    time.Time     `yaml:"updated_at"`

	// Task defaults
	DefaultPermissionMode string `yaml:"default_permission_mode"`
	DefaultUseWorktree    bool   `yaml:"default_use_worktree"`

	// Custom prompt prepended to agent instructions for tasks in this workflow
	CustomPrompt string `yaml:"custom_prompt"`
}

func (*Workflow) FindAgentIDForStatus

func (w *Workflow) FindAgentIDForStatus(statusName string) string

FindAgentIDForStatus returns the agent ID configured for the given status. It first checks the status-level AgentID field, then falls back to the legacy AgentConfig list on the workflow. Returns "" if no agent is configured.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL