//#region src/agent/media-generation/model-ref.ts
/**
* Parse `"provider/model"` (anything before the first `/`).
*
* Returns `null` for missing slashes, empty halves, or non-string input.
* Surrounding whitespace is trimmed.
*/
function parseCapabilityModelRef(raw) {
	if (typeof raw !== "string") return null;
	const trimmed = raw.trim();
	if (!trimmed) return null;
	const slash = trimmed.indexOf("/");
	if (slash <= 0 || slash === trimmed.length - 1) return null;
	const provider = trimmed.slice(0, slash).trim().toLowerCase();
	const model = trimmed.slice(slash + 1).trim();
	if (!provider || !model) return null;
	return {
		provider,
		model
	};
}
/** Compose a `provider/model` ref. Returns `null` if either half is empty. */
function formatCapabilityModelRef(provider, model) {
	const p = (provider ?? "").trim().toLowerCase();
	const m = (model ?? "").trim();
	if (!p || !m) return null;
	return `${p}/${m}`;
}
//#endregion
export { formatCapabilityModelRef, parseCapabilityModelRef };

//# sourceMappingURL=model-ref.js.map