var currentProvider = null;
/**
* Register an embedding provider for the brain system.
* Validates that the provider's dimensions match the vec0 table.
*
* @throws Error if provider dimensions do not match EMBEDDING_DIMENSIONS
*/
function setEmbeddingProvider(provider) {
	if (provider.dimensions !== 384) throw new Error(`Embedding provider dimensions (${provider.dimensions}) do not match vec0 table (384)`);
	currentProvider = provider;
}
/**
* Embed text into a float vector using the registered provider.
* Returns null when no provider is set or not available (FTS5-only fallback).
*/
async function embedText(text) {
	if (!currentProvider?.isAvailable()) return null;
	return currentProvider.embed(text);
}
/** Check whether embedding is currently available. */
function isEmbeddingAvailable() {
	return currentProvider?.isAvailable() ?? false;
}
/**
* Initialize the default local embedding provider.
*
* Loads the LocalEmbeddingProvider dynamically and registers it via
* setEmbeddingProvider(). Should be called once at startup when
* `brain.embedding.enabled` is true.
*
* Uses dynamic import to avoid loading the heavy @huggingface/transformers
* bundle unless embedding is actually requested.
*
* @task T136 @epic T134
*/
async function initDefaultProvider() {
	const { LocalEmbeddingProvider } = await import('./embedding-local-xEnym8Ho.js');
	setEmbeddingProvider(new LocalEmbeddingProvider());
}

export { embedText, initDefaultProvider, isEmbeddingAvailable };
//# sourceMappingURL=brain-embedding-Djw9ekXu.js.map
