import {
  createCliProvider
} from "../chunk-5ZFOKZGR.js";
import "../chunk-2ESYSVXG.js";

// src/providers/podman.ts
var DEFAULT_IMAGE = process.env.PODMAN_IMAGE ?? "node:22";
var podmanProvider = Object.assign(
  createCliProvider({
    name: "podman",
    binary: "podman",
    createSteps: (name) => [
      ["create", "--name", name, DEFAULT_IMAGE, "sleep", "infinity"],
      ["start", name]
    ],
    deleteArgs: (name) => ["rm", "-f", name],
    execArgs: (name, argv) => ["exec", "-i", name, ...argv],
    listArgs: (prefix) => [
      "ps",
      "-a",
      "--filter",
      `name=${prefix}`,
      "--format",
      "{{.Names}}"
    ],
    parseList: (stdout) => stdout.trim().split("\n").filter(Boolean),
    checkCmd: ["version", "--format", "{{.Version}}"],
    checkFailMsg: (msg) => msg.includes("ENOENT") ? "Podman not installed. Run: brew install podman" : "Podman not running \u2014 run: podman machine start"
  }),
  { supportsWarmPool: true }
);
export {
  podmanProvider
};
