···5252 // Write config before launch — Swift reads this instead of using --args
5353 await unlink(COOKIE_FILE).catch(() => {});
5454 await unlink(LOG_FILE).catch(() => {});
5555+ // Pre-create with owner-only permissions so the cookie is never world-readable.
5656+ // Swift writes non-atomically to preserve these permissions.
5757+ await writeFile(COOKIE_FILE, "", { mode: 0o600 });
5558 await writeFile(CONFIG_FILE, JSON.stringify({ signInUrl, cookieFile: COOKIE_FILE, logFile: LOG_FILE }));
56595760 await new Promise<void>((resolve, reject) => {