All import paths updated to git.wntrmute.dev/mc/. Bumps mcdsl to v1.2.0, mc-proxy to v1.1.0. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
32 lines
772 B
Go
32 lines
772 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
mcpv1 "git.wntrmute.dev/mc/mcp/gen/mcp/v1"
|
|
"git.wntrmute.dev/mc/mcp/internal/config"
|
|
)
|
|
|
|
// findNodeAddress looks up a node by name in the CLI config and returns
|
|
// its address.
|
|
func findNodeAddress(cfg *config.CLIConfig, nodeName string) (string, error) {
|
|
for _, n := range cfg.Nodes {
|
|
if n.Name == nodeName {
|
|
return n.Address, nil
|
|
}
|
|
}
|
|
return "", fmt.Errorf("node %q not found in config", nodeName)
|
|
}
|
|
|
|
// printComponentResults prints the result of each component operation.
|
|
func printComponentResults(results []*mcpv1.ComponentResult) {
|
|
for _, r := range results {
|
|
if r.GetSuccess() {
|
|
fmt.Printf(" %s: ok\n", r.GetName())
|
|
} else {
|
|
fmt.Fprintf(os.Stderr, " %s: error: %s\n", r.GetName(), r.GetError())
|
|
}
|
|
}
|
|
}
|