同步AGC单窗口原生门禁
Project CI / Repository checks (push) Successful in 2m21s
Project CI / Frontend tests (push) Successful in 3m0s
Project CI / Backend tests (push) Successful in 4m5s
Project CI / Native shell tests (push) Successful in 14m20s

禁止普通启动自动打开开发窗口
This commit is contained in:
2026-08-19 19:03:54 +08:00
parent 4ba1859f10
commit 341761ee3b
+5 -13
View File
@@ -2588,22 +2588,14 @@ function assertAiGameCreatorShellUserDevBoundary() {
'AI game creator preview must not invoke the external browser', 'AI game creator preview must not invoke the external browser',
); );
} }
const developerWindowCallCount = [
...aiGameCreatorShellTauriSource.matchAll(
/open_developer_window\(app\.handle\(\)\)\?;/g,
),
].length;
if ( if (
!aiGameCreatorShellTauriSource.includes( aiGameCreatorShellTauriSource.includes('fn open_developer_window(') ||
'#[cfg(all(debug_assertions, not(test)))]\npub(crate) fn open_developer_window(', aiGameCreatorShellTauriSource.includes(
) || 'open_developer_window(app.handle())?;',
!/#\[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
) { ) {
throw new Error( 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 [ for (const snippet of [