export {
	clearPendingGate,
	getPendingGate,
	isDepthConfirmationAnswer,
	isDepthVerified,
	isGateQuestionId,
	isQueuePhaseActive,
	setPendingGate,
	setQueuePhaseActive,
	shouldBlockContextWrite,
	shouldBlockPendingGate,
	shouldBlockPendingGateBash,
	shouldBlockQueueExecution,
} from "./bootstrap/write-gate.js";
export default async function registerExtension(pi) {
	// Always register the core SF commands first, in isolation.
	// This ensures commands such as /autonomous and /plan are available even if
	// the full bootstrap (shortcuts,
	// tools, hooks) fails — e.g. due to a Windows-specific import error.
	const { registerSFCommands } = await import("./commands/index.js");
	registerSFCommands(pi);
	// Full setup (shortcuts, tools, hooks) in a separate try/catch so that
	// any platform-specific load failure doesn't take out the core command.
	try {
		const { registerSfExtension } = await import(
			"./bootstrap/register-extension.js"
		);
		registerSfExtension(pi);
	} catch (err) {
		const { logWarning } = await import("./workflow-logger.js");
		logWarning(
			"bootstrap",
			`Extension setup partially failed — SF commands are available but shortcuts/tools may be missing: ${err instanceof Error ? err.message : String(err)}`,
		);
	}
}
