import { t as Ignitor } from "./main-B2M1tZ4I.js";
import { t as IgnitorFactory } from "./ignitor-CSR3YT32.js";
import { t as createAceKernel } from "./create_kernel-Bx7xtr5F.js";
//#region factories/core/ace.ts
/**
* Factory for creating and configuring Ace command kernel instances.
* This factory provides a convenient way to create Ace kernels either from
* an existing Ignitor instance or by creating a new one from scratch.
*
* @example
* ```ts
* // Create from URL
* const aceFactory = new AceFactory()
* const kernel = await aceFactory.make(new URL('../', import.meta.url))
*
* // Create from existing ignitor
* const ignitor = new Ignitor(appRoot)
* const kernel = await aceFactory.make(ignitor)
*
* // Run commands
* await kernel.handle(['make:controller', 'UserController'])
* ```
*/
var AceFactory = class {
	async make(ignitorOrAppRoot, options) {
		if (ignitorOrAppRoot instanceof Ignitor) {
			const app = ignitorOrAppRoot.createApp("console");
			await app.init();
			return createAceKernel(app);
		}
		const app = new IgnitorFactory().withCoreConfig().withCoreProviders().create(ignitorOrAppRoot, options).createApp("console");
		await app.init();
		return createAceKernel(app);
	}
};
//#endregion
export { AceFactory as t };
