import { St as loadSKYKOIPlugins } from "./reply-Bnpxcafr.js";
import { t as createSubsystemLogger } from "./subsystem-hATE68va.js";
import { l as resolveKoiWorkspaceDir, r as resolveDefaultKoiId } from "./koi-scope-je0O-Kk9.js";
import { o as loadConfig } from "./config-ZjEd8561.js";

//#region src/cli/command-options.ts
function hasExplicitOptions(command, names) {
	if (typeof command.getOptionValueSource !== "function") return false;
	return names.some((name) => command.getOptionValueSource(name) === "cli");
}

//#endregion
//#region src/cli/plugin-registry.ts
const log = createSubsystemLogger("plugins");
let pluginRegistryLoaded = false;
function ensurePluginRegistryLoaded() {
	if (pluginRegistryLoaded) return;
	const config = loadConfig();
	loadSKYKOIPlugins({
		config,
		workspaceDir: resolveKoiWorkspaceDir(config, resolveDefaultKoiId(config)),
		logger: {
			info: (msg) => log.info(msg),
			warn: (msg) => log.warn(msg),
			error: (msg) => log.error(msg),
			debug: (msg) => log.debug(msg)
		}
	});
	pluginRegistryLoaded = true;
}

//#endregion
export { hasExplicitOptions as n, ensurePluginRegistryLoaded as t };