Documentation
¶
Overview ¶
Package engine is the supervisor: it owns run creation, subprocess execution, the auto-execution of run_command operations, response acceptance, and terminal handling. Every state change goes through the run log; every refusal goes through the guard.
Index ¶
- type Engine
- func (e *Engine) Continue(runID string) (*Progress, error)
- func (e *Engine) ListRuns() ([]string, error)
- func (e *Engine) Log(runID string) (*runlog.Log, error)
- func (e *Engine) Pending(runID string) (*protocol.RequestEnvelope, error)
- func (e *Engine) Replay(runID string) (*Progress, error)
- func (e *Engine) Respond(runID string, result json.RawMessage) (*Progress, error)
- func (e *Engine) RespondAt(runID string, expected *protocol.RequestEnvelope, result json.RawMessage) (*Progress, error)
- func (e *Engine) Resume(runID string, respBytes []byte, migrate bool) (*Progress, error)
- func (e *Engine) StartRun(input json.RawMessage) (*Progress, error)
- type Progress
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
SkillDir string
RunsDir string
// Stderr receives subprocess diagnostics (compile errors etc.).
Stderr *os.File
}
Engine binds a skill directory to a runs directory.
func New ¶
New creates an engine rooted at the skill directory; run logs live in <skillDir>/.yield/runs.
func NewWithRunsDir ¶ added in v0.1.20
NewWithRunsDir creates an engine whose durable run state is stored outside the workflow directory. Tests use this to avoid leaving local state behind.
func (*Engine) Continue ¶ added in v0.1.20
Continue recovers a run after a response was committed but the process stopped before the next frontier was recorded.
func (*Engine) Pending ¶ added in v0.1.20
func (e *Engine) Pending(runID string) (*protocol.RequestEnvelope, error)
Pending returns the current unanswered operation without changing the run.
func (*Engine) Replay ¶
Replay re-executes the program against the full journal and verifies it reproduces the run's recorded frontier — the determinism check.
func (*Engine) Respond ¶ added in v0.1.20
Respond binds a bare result to the frontier observed when the call began. The frontier is checked again under the run lock before the result is used.
func (*Engine) RespondAt ¶ added in v0.1.20
func (e *Engine) RespondAt(runID string, expected *protocol.RequestEnvelope, result json.RawMessage) (*Progress, error)
RespondAt binds a result only if expected is still the current frontier.
type Progress ¶
type Progress struct {
RunID string
Envelope *protocol.RequestEnvelope
Terminal *protocol.TerminalOutcome
}
Advance's result: either the next operation for the agent, or a terminal status.