package models import ( "context" "time" "tangled.org/core/api/tangled" "tangled.org/core/spindle/secrets" ) type Engine interface { // NewWorkflowSchema returns an empty schema struct that will be used to unmarshal // the workflow YAML. This allows each engine to define its own YAML structure // with engine-specific fields (e.g., dependencies for nixery, image/architecture for k8s). NewWorkflowSchema() interface{} // InitWorkflow is called after the workflow has been parsed and initial steps created. // Engines should use this to: // - Extract their schema from wf.Data // - Prepend any setup steps (e.g., clone, dependency installation) // - Transform or replace steps if needed // - Store final metadata in wf.Data for use in SetupWorkflow InitWorkflow(wf *Workflow, tpl tangled.Pipeline) error SetupWorkflow(ctx context.Context, wid WorkflowId, wf *Workflow) error WorkflowTimeout() time.Duration DestroyWorkflow(ctx context.Context, wid WorkflowId) error RunStep(ctx context.Context, wid WorkflowId, w *Workflow, idx int, secrets []secrets.UnlockedSecret, wfLogger *WorkflowLogger) error }