Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
35 lines
975 B
Go
35 lines
975 B
Go
package conformance
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
"strings"
|
|
|
|
agenthost "github.com/tutti-os/tutti/packages/agent/host"
|
|
)
|
|
|
|
func environmentValue(env []string, key string) (string, bool) {
|
|
prefix := key + "="
|
|
for _, entry := range env {
|
|
if strings.HasPrefix(entry, prefix) {
|
|
return strings.TrimPrefix(entry, prefix), true
|
|
}
|
|
}
|
|
return "", false
|
|
}
|
|
|
|
func requireRuntimeRailPlacement(env []string, want agenthost.RailPlacement) error {
|
|
runtimePlacementValue, found := environmentValue(env, agenthost.AgentRailPlacementEnvironmentVariable)
|
|
if !found {
|
|
return fmt.Errorf("env=%#v, want %s", env, agenthost.AgentRailPlacementEnvironmentVariable)
|
|
}
|
|
var placement agenthost.RailPlacement
|
|
if err := json.Unmarshal([]byte(runtimePlacementValue), &placement); err != nil {
|
|
return fmt.Errorf("decode rail placement %q: %w", runtimePlacementValue, err)
|
|
}
|
|
if placement != want {
|
|
return fmt.Errorf("rail placement=%#v, want %#v", placement, want)
|
|
}
|
|
return nil
|
|
}
|