import { commercialApiHold } from "../model-policy.js";
import type { LlamaCpp } from "../llm.js";
import type {
  EmbeddingProvider,
  ProviderEmbedOptions,
  ProviderEmbedding,
  ProviderHealth,
  ProviderKind,
} from "./provider.js";

export type LocalLlamaCppProviderConfig = { llm?: LlamaCpp; modelId?: string };

/** Historical SDK symbol. Construction is blocked by the commercial-only policy. */
export class LocalLlamaCppProvider implements EmbeddingProvider {
  readonly kind: ProviderKind = "local";

  constructor(_config: LocalLlamaCppProviderConfig = {}) {
    throw commercialApiHold("LocalLlamaCppProvider is disabled; configure an approved commercial API");
  }

  getModelId(): string { return "disabled-local-provider"; }
  getDimensions(): number | undefined { return undefined; }
  getLastError(): string | undefined { return "QMD_COMMERCIAL_API_HOLD"; }
  async healthcheck(_signal?: AbortSignal): Promise<ProviderHealth> {
    throw commercialApiHold("local provider healthcheck is disabled");
  }
  async embed(_text: string, _options: ProviderEmbedOptions = {}): Promise<ProviderEmbedding | null> {
    throw commercialApiHold("local embedding is disabled");
  }
  async embedBatch(_texts: string[], _options: ProviderEmbedOptions = {}): Promise<(ProviderEmbedding | null)[]> {
    throw commercialApiHold("local batch embedding is disabled");
  }
  async dispose(): Promise<void> {}
}
