export class PlatformTargetResolver {
    platform;
    arch;
    constructor(platform = process.platform, arch = process.arch) {
        this.platform = platform;
        this.arch = arch;
    }
    runtimePlatform() {
        if (this.platform === "darwin" && this.arch === "arm64")
            return "darwin-arm64";
        if (this.platform === "darwin" && this.arch === "x64")
            return "darwin-x64";
        if (this.platform === "linux" && this.arch === "arm64")
            return "linux-arm64";
        if (this.platform === "linux" && this.arch === "x64")
            return "linux-x64";
        if (this.platform === "win32" && this.arch === "x64")
            return "win32-x64";
        throw new Error(`Unsupported OpenCode runtime platform: ${this.platform}/${this.arch}`);
    }
    targetPath() {
        return `opencode/${this.runtimePlatform()}`;
    }
}
