diff --git a/scripts/check-native-shells.mjs b/scripts/check-native-shells.mjs index f99af428f..fdb11629e 100644 --- a/scripts/check-native-shells.mjs +++ b/scripts/check-native-shells.mjs @@ -2588,22 +2588,14 @@ function assertAiGameCreatorShellUserDevBoundary() { 'AI game creator preview must not invoke the external browser', ); } - const developerWindowCallCount = [ - ...aiGameCreatorShellTauriSource.matchAll( - /open_developer_window\(app\.handle\(\)\)\?;/g, - ), - ].length; if ( - !aiGameCreatorShellTauriSource.includes( - '#[cfg(all(debug_assertions, not(test)))]\npub(crate) fn open_developer_window(', - ) || - !/#\[cfg\(all\(debug_assertions, not\(test\)\)\)\]\s+if game_chat_launch\.is_none\(\) \{\s+open_developer_window\(app\.handle\(\)\)\?;\s+\}/u.test( - aiGameCreatorShellTauriSource, - ) || - developerWindowCallCount !== 1 + aiGameCreatorShellTauriSource.includes('fn open_developer_window(') || + aiGameCreatorShellTauriSource.includes( + 'open_developer_window(app.handle())?;', + ) ) { throw new Error( - 'AI game creator developer window must stay compile-time debug-only and outside game-chat launch', + 'AI game creator normal startup must not automatically open a developer window', ); } for (const snippet of [