import { initWorkspaceCore } from "./init-workspace-core.js";
//#region src/cli/utils/init-workspace.ts
/**
* Single idempotent workspace + config initialisation for CLI, gateway, onboard, and Electron.
* Skips saveConfig (and backup rotation) when the persisted JSON would be unchanged.
*
* Electron main should import {@link initWorkspaceCore} directly to avoid bundling channel plugins.
*/
async function initWorkspace(options) {
	const skipChannelPluginValidation = options.skipChannelPluginValidation ?? false;
	let assertChannelPlugins;
	if (!skipChannelPluginValidation) {
		const { assertChannelPluginConfigs } = await import("../../config/validate-channel-configs.js");
		assertChannelPlugins = assertChannelPluginConfigs;
	}
	const { skipChannelPluginValidation: _skip, ...coreOptions } = options;
	return initWorkspaceCore({
		...coreOptions,
		assertChannelPlugins
	});
}
//#endregion
export { initWorkspace };

//# sourceMappingURL=init-workspace.js.map