import path from "path";
import fs from "fs";
//#region src/sync/microsoft-auth.ts
async function getMicrosoftToken(dataDir) {
	const tokenPath = path.join(dataDir, ".agentic", "microsoft-token.json");
	if (!fs.existsSync(tokenPath)) return null;
	try {
		const raw = JSON.parse(fs.readFileSync(tokenPath, "utf-8"));
		return raw.accessToken ?? raw.access_token ?? null;
	} catch {
		return null;
	}
}
//#endregion
export { getMicrosoftToken };

//# sourceMappingURL=microsoft-auth-B8_S45gh.js.map