55 lines
1.6 KiB
Go
55 lines
1.6 KiB
Go
package stage
|
|
|
|
import (
|
|
"context"
|
|
"log/slog"
|
|
|
|
"gitea.maximumdirect.net/eric/narratio/internal/adapters/audita"
|
|
"gitea.maximumdirect.net/eric/narratio/internal/adapters/notify"
|
|
"gitea.maximumdirect.net/eric/narratio/internal/adapters/scriptorium"
|
|
"gitea.maximumdirect.net/eric/narratio/internal/adapters/seriatim"
|
|
"gitea.maximumdirect.net/eric/narratio/internal/adapters/storage"
|
|
"gitea.maximumdirect.net/eric/narratio/internal/adapters/whisperx"
|
|
"gitea.maximumdirect.net/eric/narratio/internal/artifacts"
|
|
"gitea.maximumdirect.net/eric/narratio/internal/config"
|
|
"gitea.maximumdirect.net/eric/narratio/internal/manifest"
|
|
)
|
|
|
|
// Env is the shared dependency container visible to stages.
|
|
type Env struct {
|
|
Config *config.Config
|
|
SelectedArtifactKeys []string
|
|
ArtifactStore artifacts.Store
|
|
ManifestStore manifest.Store
|
|
Logger *slog.Logger
|
|
|
|
WhisperX whisperx.Client
|
|
Seriatim seriatim.Runner
|
|
Audita audita.Runner
|
|
Scriptorium scriptorium.Runner
|
|
Storage storage.Backend
|
|
ObjectStore storage.ObjectStore
|
|
Notifier notify.Sender
|
|
}
|
|
|
|
// IODecl declares the intended input/output artifact kinds for a stage.
|
|
type IODecl struct {
|
|
Inputs []artifacts.Ref
|
|
Outputs []artifacts.Ref
|
|
}
|
|
|
|
// Stage is the pipeline unit contract.
|
|
type Stage interface {
|
|
Name() string
|
|
Declares() IODecl
|
|
Run(ctx context.Context, env *Env, m *manifest.Manifest) (*StageResult, error)
|
|
}
|
|
|
|
// StageResult is the declared output of a stage execution.
|
|
type StageResult struct {
|
|
Outputs []artifacts.Ref
|
|
Logs []string
|
|
GeneratedConfigs []string
|
|
Metadata map[string]any
|
|
}
|