import { createLogger } from "../logger.js";
const log = createLogger("providers");
let cached = null;
function getVectorStore() {
  if (cached) return cached;
  cached = (async () => {
    const [{ SqliteVecStore }, { getDatabase }] = await Promise.all([
      import("../cache/sqlite-vec-store.js"),
      import("../cache/db.js")
    ]);
    const db = getDatabase();
    log.info("vector store ready", { provider: "vector-store", impl: "sqlite-vec" });
    return new SqliteVecStore(db);
  })().catch((err) => {
    cached = null;
    throw err;
  });
  return cached;
}
function _resetVectorStoreForTest() {
  cached = null;
}
export {
  _resetVectorStoreForTest,
  getVectorStore
};
//# sourceMappingURL=vector-store.js.map