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

// src/providers/docker.ts
var DEFAULT_IMAGE = process.env.DOCKER_IMAGE ?? "node:22";
var dockerProvider = Object.assign(
  createCliProvider({
    name: "docker",
    binary: "docker",
    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", "{{.Server.Version}}"],
    checkFailMsg: (msg) => msg.includes("ENOENT") ? "Docker not installed. Run: brew install --cask docker" : "Docker not running \u2014 launch Docker Desktop"
  }),
  { supportsWarmPool: true }
);

export {
  dockerProvider
};
