flowjson

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodeTypeACP        = "acp"
	NodeTypeAction     = "action"
	NodeTypeCompute    = "compute"
	NodeTypeCheckpoint = "checkpoint"
)
View Source
const FormatVersion = 1

Variables

View Source
var ErrInvalidDefinition = errors.New("invalid acpx flow definition")

Functions

This section is empty.

Types

type Definition

type Definition struct {
	FormatVersion int      `json:"format_version"`
	Name          string   `json:"name,omitempty"`
	Requires      []string `json:"requires,omitempty"`
	StartAt       string   `json:"start_at"`
	Nodes         []Node   `json:"nodes"`
	Edges         []Edge   `json:"edges,omitempty"`
}

func (Definition) ExecutionOrder

func (def Definition) ExecutionOrder() ([]string, error)

func (Definition) ToSnapshot

func (def Definition) ToSnapshot() (acpx.FlowSnapshot, error)

func (Definition) Validate

func (def Definition) Validate() error

type Edge

type Edge struct {
	From   string      `json:"from"`
	To     string      `json:"to,omitempty"`
	Switch *SwitchEdge `json:"switch,omitempty"`
}

type Node

type Node struct {
	ID       string            `json:"id"`
	Type     string            `json:"type"`
	Prompt   string            `json:"prompt,omitempty"`
	Agent    string            `json:"agent,omitempty"`
	Command  string            `json:"command,omitempty"`
	Args     []string          `json:"args,omitempty"`
	Session  string            `json:"session,omitempty"`
	Cwd      string            `json:"cwd,omitempty"`
	Env      map[string]string `json:"env,omitempty"`
	Input    json.RawMessage   `json:"input,omitempty"`
	Value    json.RawMessage   `json:"value,omitempty"`
	Select   string            `json:"select,omitempty"`
	Requires []string          `json:"requires,omitempty"`
}

type SwitchEdge

type SwitchEdge struct {
	On    string            `json:"on"`
	Cases map[string]string `json:"cases"`
}

Jump to

Keyboard shortcuts

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