import { readFileSync } from 'fs';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';

// src/index.ts
var PACKAGE_NAME = "@twentytwohundred/2200-cli";
function readVersion() {
  let dir = dirname(fileURLToPath(import.meta.url));
  for (let depth = 0; depth < 8; depth++) {
    const candidate = join(dir, "package.json");
    try {
      const raw = readFileSync(candidate, "utf8");
      const parsed = JSON.parse(raw);
      if (parsed.name === PACKAGE_NAME && typeof parsed.version === "string") {
        return parsed.version;
      }
    } catch {
    }
    const parent = dirname(dir);
    if (parent === dir) break;
    dir = parent;
  }
  return "0.0.0-unknown";
}
var VERSION = readVersion();

export { VERSION };
//# sourceMappingURL=index.js.map
//# sourceMappingURL=index.js.map