From 341761ee3b8cb3183c7fb4e4d57458fe031cd2fb Mon Sep 17 00:00:00 2001 From: kdletters Date: Wed, 19 Aug 2026 19:03:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5AGC=E5=8D=95=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E5=8E=9F=E7=94=9F=E9=97=A8=E7=A6=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 禁止普通启动自动打开开发窗口 --- scripts/check-native-shells.mjs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) 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 [