// behaviors/data-dir.ts
var cached = null;
async function resolveStdDataDir() {
  if (cached !== null) return cached;
  const override = typeof process !== "undefined" && process.env?.ALMADAR_STD_DATA_DIR || "";
  if (override) return cached = override;
  if (typeof process === "undefined" || !process.versions?.node) return cached = "";
  const [{ createRequire }, nodePath, nodeUrl] = await Promise.all([
    import('module'),
    import('path'),
    import('url')
  ]);
  try {
    const req = createRequire(import.meta.url);
    return cached = nodePath.resolve(nodePath.dirname(req.resolve("@almadar/std/package.json")), "dist");
  } catch {
  }
  return cached = nodePath.dirname(nodeUrl.fileURLToPath(import.meta.url));
}

// behaviors/knob-embeddings.ts
var cache = null;
async function loadManifest() {
  if (cache) return cache;
  try {
    const { readFileSync } = await import('fs');
    const { resolve } = await import('path');
    const dir = await resolveStdDataDir();
    const raw = readFileSync(resolve(dir, "knob-embeddings.json"), "utf-8");
    const parsed = JSON.parse(raw);
    if (typeof parsed?.model !== "string" || typeof parsed?.dimensions !== "number" || typeof parsed?.vectors !== "object" || parsed.vectors === null) {
      return null;
    }
    cache = parsed;
    return cache;
  } catch {
    return null;
  }
}
async function getKnobEmbeddings() {
  return loadManifest();
}

export { getKnobEmbeddings };
//# sourceMappingURL=knob-embeddings.js.map
//# sourceMappingURL=knob-embeddings.js.map