05ae530442
Install current verified harness releases inside Docker, preserve persistent accounts and settings, and provide separate interactive and pipeline model defaults with terminal onboarding and fuzzy pickers. Add Docker-aware authoring transport, Pi stage execution, bounded workflow controls, reliable final-result readback and usage settlement, and finite short-lived CLI pipe draining. Keep dated installation evidence and packaged authoring guidance consistent. Verified with a real Docker installation, both harness stages and interactive authors, the built-in plan/implement/review starter, independent host race/vet checks, installer tests, and packaged skill tests. Generated release receipts stay ignored in clean checkouts.
35 lines
966 B
Go
35 lines
966 B
Go
package pipeline
|
|
|
|
import "strings"
|
|
|
|
func WithDefaults(source, model, backend string) string {
|
|
source = WithDefaultModel(source, model)
|
|
if backend != "opencode" && backend != "pi" {
|
|
return source
|
|
}
|
|
lines := strings.Split(source, "\n")
|
|
active := false
|
|
hasHarness := false
|
|
modelStage := true
|
|
var result []string
|
|
for _, line := range lines {
|
|
if strings.TrimSpace(line) == "```configs" {
|
|
active = true
|
|
hasHarness = false
|
|
modelStage = true
|
|
} else if active && strings.HasPrefix(strings.TrimSpace(line), "type=") && strings.TrimSpace(line) != "type=model" {
|
|
modelStage = false
|
|
} else if active && strings.HasPrefix(strings.TrimSpace(line), "harness=") {
|
|
line = "harness=" + backend
|
|
hasHarness = true
|
|
} else if active && strings.TrimSpace(line) == "```" {
|
|
if modelStage && !hasHarness {
|
|
result = append(result, "harness="+backend)
|
|
}
|
|
active = false
|
|
}
|
|
result = append(result, line)
|
|
}
|
|
return strings.Join(result, "\n")
|
|
}
|