import { closeDatabase } from "../cache/db.js";
import { resetEmbeddingService } from "../embedding/embed.js";
import { disposeRerankProvider } from "../providers/rerank-provider.js";
import { createLogger } from "../logger.js";
const log = createLogger("cli");
async function shutdownCli() {
  try {
    await disposeRerankProvider();
  } catch (err) {
    log.debug("rerank dispose failed", { error: err instanceof Error ? err.message : String(err) });
  }
  try {
    resetEmbeddingService();
  } catch (err) {
    log.debug("embedding reset failed", { error: err instanceof Error ? err.message : String(err) });
  }
  try {
    closeDatabase();
  } catch (err) {
    log.debug("database close failed", { error: err instanceof Error ? err.message : String(err) });
  }
}
export {
  shutdownCli
};
//# sourceMappingURL=shutdown.js.map