package examples import ( "embed" "git.a-wan.net/alan/pipelines/internal/protocol" ) // Only checked-in Markdown examples are shipped. No runtime databases or user drafts. // //go:embed *.md var sources embed.FS // The examples are a graded set, read in order: each one adds a feature to the // previous. They are offered by the template picker and seeded once into a brand // new database (see pipeline.Store.SeedExamples). var starters = []protocol.Template{ {Key: "one-stage", Name: "Example 1: one stage", Description: "One read-only stage reviews the files you name. Changes nothing."}, {Key: "two-stages", Name: "Example 2: two stages", Description: "A draft stage hands its output to a check stage that corrects it. Changes nothing."}, {Key: "feedback-loop", Name: "Example 3: feedback loop", Description: "Implement, then review; a rejected review sends findings back, at most three reviews. Shows retries and timeouts. Leaves changes uncommitted."}, {Key: "human-decision", Name: "Example 4: human decision", Description: "Plan, then wait for a person to approve, revise or abort before acting, with notifications. Leaves changes uncommitted."}, } func Catalog() []protocol.Template { result := make([]protocol.Template, 0, len(starters)) for _, item := range starters { data, _ := sources.ReadFile(item.Key + ".md") item.Source = string(data) // Schedules are saved run configurations, never starter definitions. item.Scheduled = false result = append(result, item) } return result }