import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
import {
  createEmbeddingProvider,
  createLlmProvider
} from "./chunk-V5R6O6RP.js";
import "./chunk-MWW62YZP.js";
import {
  loadConfig
} from "./chunk-YG6MLLGL.js";
import "./chunk-JSK7L46L.js";
import "./chunk-WBLTISAK.js";
import "./chunk-PZUWP5VK.js";

// src/cli/verify.ts
var VERIFY_LLM_PROMPT = "Respond with OK";
var VERIFY_EMBEDDING_INPUT = "test";
async function run(_args, vaultDir) {
  const config = loadConfig(vaultDir);
  const { llm: llmConfig, embedding: embeddingConfig } = config.intelligence;
  let llmOk = false;
  let embeddingOk = false;
  let embeddingDimensions = 0;
  try {
    const llm = createLlmProvider(llmConfig);
    const response = await llm.summarize(VERIFY_LLM_PROMPT);
    llmOk = response.text.length > 0;
  } catch (err) {
    llmOk = false;
  }
  const llmLabel = `LLM (${llmConfig.provider} / ${llmConfig.model}):`;
  console.log(`${llmLabel.padEnd(40)} ${llmOk ? "OK" : "FAIL"}`);
  try {
    const emb = createEmbeddingProvider(embeddingConfig);
    const response = await emb.embed(VERIFY_EMBEDDING_INPUT);
    embeddingDimensions = response.dimensions;
    embeddingOk = embeddingDimensions > 0;
  } catch (err) {
    embeddingOk = false;
  }
  const embLabel = `Embedding (${embeddingConfig.provider} / ${embeddingConfig.model}):`;
  const embStatus = embeddingOk ? `OK (${embeddingDimensions} dimensions)` : "FAIL";
  console.log(`${embLabel.padEnd(40)} ${embStatus}`);
  if (!llmOk || !embeddingOk) {
    process.exit(1);
  }
}
export {
  run
};
//# sourceMappingURL=verify-MG5O7SBU.js.map