// behaviors/embeddings.ts
var cache = null;
async function loadManifest() {
  if (cache) return cache;
  try {
    const { readFileSync } = await import('fs');
    const { resolve, dirname } = await import('path');
    const { fileURLToPath } = await import('url');
    const dir = dirname(fileURLToPath(import.meta.url));
    const raw = readFileSync(resolve(dir, "behaviors-embeddings.json"), "utf-8");
    const parsed = JSON.parse(raw);
    if (typeof parsed?.version !== "string" || typeof parsed?.model !== "string" || typeof parsed?.dimensions !== "number" || !parsed?.vectors || typeof parsed.vectors !== "object") {
      return null;
    }
    cache = parsed;
    return cache;
  } catch {
    return null;
  }
}
async function getBehaviorEmbeddings() {
  return loadManifest();
}
async function getBehaviorEmbedding(behaviorName) {
  const manifest = await loadManifest();
  if (!manifest) return null;
  return manifest.vectors[behaviorName] ?? null;
}

export { getBehaviorEmbedding, getBehaviorEmbeddings };
//# sourceMappingURL=embeddings.js.map
//# sourceMappingURL=embeddings.js.map