Documentation
¶
Overview ¶
Package runtime implements the local pipeline execution engine. It parses pipeline.yaml, traverses the DAG, executes native and local-component steps, and writes a trace file under .cnips/traces/.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RunOptions ¶
type RunOptions struct {
Root string
Pipeline string // pipeline name
Payload string // initial JSON payload (string)
Environment string // environment name (e.g. "dev")
FromStep string // optional step ID to resume execution from
TraceRunID string // optional previous trace used to seed resume context
AutoApprove bool
AutoReject bool
Verbose bool
LogWriter io.Writer
Progress io.Writer
ExecutionDir string
LogPath string
}
RunOptions controls how the pipeline is executed.
type StepTrace ¶
type StepTrace struct {
ID string `json:"id"`
Uses string `json:"uses"`
ParentID string `json:"parentId,omitempty"`
LoopIndex *int `json:"loopIndex,omitempty"`
Status string `json:"status"` // ok | error | skipped | approval
DurationMs int64 `json:"durationMs"`
Input json.RawMessage `json:"input,omitempty"`
Output json.RawMessage `json:"output,omitempty"`
Error string `json:"error,omitempty"`
Logs []string `json:"logs,omitempty"`
Children []StepTrace `json:"children,omitempty"`
}
StepTrace holds execution data for one step.
type Trace ¶
type Trace struct {
RunID string `json:"runId"`
Pipeline string `json:"pipeline"`
Status string `json:"status"`
StartedAt time.Time `json:"startedAt"`
DurationMs int64 `json:"durationMs"`
Steps []StepTrace `json:"steps"`
Error string `json:"error,omitempty"`
LogPath string `json:"logPath,omitempty"`
}
Trace is the full run record written to .cnips/traces/run_<id>.json.
func Run ¶
func Run(opts RunOptions) (*Trace, error)
Run executes the pipeline and returns the trace.
Click to show internal directories.
Click to hide internal directories.