import { createRequire } from "node:module";
/**
 * Single runtime source of truth for the bridge package version.
 *
 * Read from package.json at load time via createRequire (a runtime require,
 * not a compile-time JSON import) so the value cannot drift from what npm
 * actually published: dist/version.js resolves ../package.json to the package
 * root in both local dev and a globally-installed tarball. /health and the
 * `patchtrail --version` CLI both read this, and the skew guard compares it to
 * the vendored frontend bundle.
 */
const require = createRequire(import.meta.url);
const pkg = require("../package.json");
if (typeof pkg.version !== "string" || pkg.version.length === 0) {
    throw new Error("patchtrail-agent-bridge package.json is missing a version");
}
export const BRIDGE_VERSION = pkg.version;
