Files
alan 05ae530442 Make Pipelines Docker-only with OpenCode and Pi
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.
2026-10-11 23:00:25 +01:00

35 lines
1010 B
Go

package client
import (
"net/url"
"os"
)
// transportTarget applies the scoped Docker transport aliases embedded in an
// authoring/debug prompt CLI prefix. It rewrites the requested endpoint only when
// both aliases are present, valid ws/wss URLs with source != target, and the
// requested URL exactly equals SOURCE. Anything else is dialed unchanged, so
// remote and unmatched targets are never redirected.
func transportTarget(requested string) string {
source := os.Getenv("PIPELINES_TRANSPORT_SOURCE")
target := os.Getenv("PIPELINES_TRANSPORT_TARGET")
if source == "" || target == "" || source == target {
return requested
}
if !validWebSocketURL(source) || !validWebSocketURL(target) {
return requested
}
if requested == source {
return target
}
return requested
}
func validWebSocketURL(value string) bool {
u, err := url.Parse(value)
if err != nil {
return false
}
return (u.Scheme == "ws" || u.Scheme == "wss") && u.Hostname() != "" && u.User == nil && u.Fragment == ""
}