Download this file
| 1 | package thin |
| 2 | |
| 3 | import ( |
| 4 | "context" |
| 5 | "os" |
| 6 | |
| 7 | "amadan.net/oficina/equipo/internal/runner/provider" |
| 8 | "amadan.net/oficina/equipo/internal/toolproxy" |
| 9 | ) |
| 10 | |
| 11 | // serveToolProxy is the tool proxy the Pi step tests run from a copy of |
| 12 | // this binary (Linux only, as the tool proxy is). |
| 13 | func serveToolProxy(args []string) int { |
| 14 | if len(args) == 4 && args[1] == provider.DarwinToolProxyCommand { |
| 15 | // The darwin MCP config's command line (provider.DarwinToolMCP). |
| 16 | args = append(args[:1], args[2:]...) |
| 17 | } |
| 18 | if len(args) != 3 || args[1] != "--socket" || toolproxy.Serve(context.Background(), os.Stdin, os.Stdout, args[2]) != nil { |
| 19 | return 1 |
| 20 | } |
| 21 | return 0 |
| 22 | } |
| 23 | |