workflow

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Executions     *executions.API
	NodeExecutions *nodeexecutions.API
	Conversations  *conversations.API
	Worktrees      *worktrees.API
	Registry       *workflowruntime.Registry
	// contains filtered or unexported fields
}

func NewAPI

func NewAPI(ctrl *controller.Controller, rt *runtime.Runtime) *API

func (*API) BackfillWorkflowIDs

func (api *API) BackfillWorkflowIDs(ctx context.Context) error

BackfillWorkflowIDs links past runs to each installed workflow's permanent id. Idempotent — runs at startup so history recorded before a workflow was imported (e.g. from --file runs) still keys on it.

func (*API) Compose

func (api *API) Compose(ctx context.Context, requester interface{}, request *ComposeRequest) (*ComposeResponse, error)

func (*API) Create

func (api *API) Create(ctx context.Context, requester interface{}, request *CreateRequest) (*CreateResponse, error)

Create scaffolds a new named workflow as a draft — nothing lands in the registry until it is saved.

func (*API) DefaultProjectDir

func (api *API) DefaultProjectDir() string

DefaultProjectDir returns the effective default working directory used when a run does not specify a project. An empty configured value resolves to the server's current working directory, always returned as an absolute path.

func (*API) Delete

func (api *API) Delete(ctx context.Context, requester interface{}, request *DeleteRequest) (*DeleteResponse, error)

Delete removes a workflow from the library only — its run history and version archive stay untouched.

func (*API) DeleteDraft

func (api *API) DeleteDraft(ctx context.Context, requester interface{}, request *DeleteDraftRequest) (*DeleteDraftResponse, error)

func (*API) Get

func (api *API) Get(ctx context.Context, requester interface{}, request *GetRequest) (*GetResponse, error)

func (*API) List

func (api *API) List(ctx context.Context, requester interface{}, request *ListRequest) (*ListResponse, error)

func (*API) Rename

func (api *API) Rename(ctx context.Context, requester interface{}, request *RenameRequest) (*RenameResponse, error)

Rename edits a workflow's identity: id, display name, and/or description. An id change cascades: registry file, draft, versions archive, embedding specs, and the run history rows that key Monitor's views.

func (*API) SaveDraft

func (api *API) SaveDraft(ctx context.Context, requester interface{}, request *SaveDraftRequest) (*SaveDraftResponse, error)

func (*API) UpdateNode

func (api *API) UpdateNode(ctx context.Context, requester interface{}, request *UpdateNodeRequest) (*UpdateNodeResponse, error)

type ComposeRequest

type ComposeRequest struct {
	// WorkflowSlug is empty when the request should create a workflow.
	WorkflowSlug string `json:"workflow_slug"`
	Request      string `json:"request"`
	// Harness, Model, and ReasoningEffort override the settings
	// choice for this call only — empty means "use the configured
	// default" (medium, for the effort).
	Harness         string `json:"harness"`
	Model           string `json:"model"`
	ReasoningEffort string `json:"reasoning_effort"`
}

func (*ComposeRequest) Validate

func (r *ComposeRequest) Validate() error

type ComposeResponse

type ComposeResponse struct {
	WorkflowSlug    string `json:"workflow_slug"`
	Action          string `json:"action"`
	Summary         string `json:"summary"`
	Harness         string `json:"harness"`
	Model           string `json:"model"`
	ReasoningEffort string `json:"reasoning_effort"`
	// Draft is the proposed spec now waiting for Save — empty
	// when the composer proposed nothing.
	Draft string `json:"draft,omitempty"`
}

type CreateRequest

type CreateRequest struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	// WorkflowSlug overrides the id derived from the name.
	WorkflowSlug string `json:"workflow_slug"`
}

func (*CreateRequest) Validate

func (r *CreateRequest) Validate() error

type CreateResponse

type CreateResponse struct {
	WorkflowSlug string `json:"workflow_slug"`
	Name         string `json:"name"`
	// Draft is the scaffolded spec, waiting for nodes and Save.
	Draft string `json:"draft"`
}

type DeleteDraftRequest

type DeleteDraftRequest struct {
	WorkflowSlug string `json:"workflow_slug"`
}

func (*DeleteDraftRequest) Validate

func (r *DeleteDraftRequest) Validate() error

type DeleteDraftResponse

type DeleteDraftResponse struct {
	WorkflowSlug string `json:"workflow_slug"`
	Deleted      bool   `json:"deleted"`
}

type DeleteRequest

type DeleteRequest struct {
	WorkflowSlug string `json:"workflow_slug"`
}

func (*DeleteRequest) Validate

func (r *DeleteRequest) Validate() error

type DeleteResponse

type DeleteResponse struct {
	WorkflowSlug string `json:"workflow_slug"`
	Deleted      bool   `json:"deleted"`
}

type GetRequest

type GetRequest struct {
	WorkflowSlug string `json:"workflow_slug"`
}

func (*GetRequest) Validate

func (r *GetRequest) Validate() error

type GetResponse

type GetResponse struct {
	WorkflowSlug string `json:"workflow_slug"`
	Spec         string `json:"spec"`
	// Draft holds unsaved composer changes; empty when none exist.
	Draft string `json:"draft,omitempty"`
}

type ListRequest

type ListRequest struct{}

func (*ListRequest) Validate

func (r *ListRequest) Validate() error

type ListResponse

type ListResponse struct {
	Workflows []workflowruntime.WorkflowSummary `json:"workflows"`
}

type RenameRequest

type RenameRequest struct {
	WorkflowSlug string `json:"workflow_slug"`
	// NewID moves the workflow to a new id; empty keeps the current.
	NewID string `json:"new_id"`
	// Name sets the display name; empty keeps the current.
	Name string `json:"name"`
	// Description sets the description; nil keeps the current, ""
	// clears it.
	Description *string `json:"description,omitempty"`
}

func (*RenameRequest) Validate

func (r *RenameRequest) Validate() error

type RenameResponse

type RenameResponse struct {
	WorkflowSlug string `json:"workflow_slug"`
	// UpdatedRefs lists workflows whose specs were rewritten
	// because they embed the renamed workflow.
	UpdatedRefs []string `json:"updated_refs,omitempty"`
}

type SaveDraftRequest

type SaveDraftRequest struct {
	WorkflowSlug string `json:"workflow_slug"`
}

func (*SaveDraftRequest) Validate

func (r *SaveDraftRequest) Validate() error

type SaveDraftResponse

type SaveDraftResponse struct {
	WorkflowSlug string `json:"workflow_slug"`
	Version      string `json:"version"`
	Spec         string `json:"spec"`
}

type UpdateNodeRequest

type UpdateNodeRequest struct {
	WorkflowSlug string `json:"workflow_slug"`
	Node         string `json:"node"`
	// nil fields are left unchanged.
	Model       *string `json:"model,omitempty"`
	Harness     *string `json:"harness,omitempty"`
	Instruction *string `json:"instruction,omitempty"`
	// "" resets to the harness default.
	ReasoningEffort *string `json:"reasoning_effort,omitempty"`
	// "" resets to the compiler default (read_only).
	Permissions *string `json:"permissions,omitempty"`
}

func (*UpdateNodeRequest) Validate

func (r *UpdateNodeRequest) Validate() error

type UpdateNodeResponse

type UpdateNodeResponse struct {
	WorkflowSlug string `json:"workflow_slug"`
	Node         string `json:"node"`
	Spec         string `json:"spec"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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