From 18ed9778d8c8f13b894c90746cb66bd0d966e66b Mon Sep 17 00:00:00 2001 From: Linghong Date: Thu, 10 Sep 2026 10:28:07 +0000 Subject: [PATCH] =?UTF-8?q?=E6=8B=86=E5=88=86=E7=AD=96=E5=88=92=20Agent=20?= =?UTF-8?q?=E4=B8=8E=20Codex=20=E9=9A=8F=E5=8C=85=E6=B8=85=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将 design-agent 资源包放到全平台 Tauri 基础配置 Windows 配置只保留 pinned Codex sidecar 配置门禁分别校验两份清单,禁止互相混入 --- .../scripts/check-config.mjs | 28 ++++++++++++++++--- .../src-tauri/tauri.conf.json | 3 ++ .../src-tauri/tauri.windows.conf.json | 3 +- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/apps/ai-game-creator-shell/scripts/check-config.mjs b/apps/ai-game-creator-shell/scripts/check-config.mjs index f2c19ac58..037526aaa 100644 --- a/apps/ai-game-creator-shell/scripts/check-config.mjs +++ b/apps/ai-game-creator-shell/scripts/check-config.mjs @@ -1285,6 +1285,9 @@ if (tauriConfig.identifier !== 'world.genarrative.ai-game-creator') { throw new Error('AI game creator shell identifier drifted'); } +const expectedBundledDesignAgentResources = { + 'design-agent': 'design-agent', +}; const expectedBundledCodexResources = { 'resources/codex/win-x64/bin/codex.exe': 'codex/win-x64/bin/codex.exe', 'resources/codex/win-x64/bin/codex-code-mode-host.exe': @@ -1300,16 +1303,33 @@ const expectedBundledCodexResources = { 'resources/codex/win-x64/NOTICE.md': 'codex/win-x64/NOTICE.md', 'resources/codex/win-x64/manifest.json': 'codex/win-x64/manifest.json', }; -if (tauriConfig.bundle?.resources !== undefined) { - throw new Error( - 'AI game creator shell base Tauri config must not require Windows-only Codex resources', - ); +assert.deepEqual( + tauriConfig.bundle?.resources, + expectedBundledDesignAgentResources, + 'AI game creator shell base Tauri config must bundle the design-agent resource pack', +); +for (const key of Object.keys(tauriConfig.bundle?.resources ?? {})) { + if (String(key).includes('codex')) { + throw new Error( + 'AI game creator shell base Tauri config must not require Windows-only Codex resources', + ); + } } assert.deepEqual( windowsTauriConfig.bundle?.resources, expectedBundledCodexResources, 'AI game creator shell Windows Tauri config must bundle the complete pinned Codex resource set', ); +if ( + Object.prototype.hasOwnProperty.call( + windowsTauriConfig.bundle?.resources ?? {}, + 'design-agent', + ) +) { + throw new Error( + 'design-agent resource pack must not be mixed into the Windows Codex sidecar bundle', + ); +} if (windowsTauriConfig.bundle?.useLocalToolsDir !== true) { throw new Error( 'AI game creator shell Windows Tauri config must cache bundling tools in the project target directory', diff --git a/apps/ai-game-creator-shell/src-tauri/tauri.conf.json b/apps/ai-game-creator-shell/src-tauri/tauri.conf.json index 1eb8e0319..15e394d98 100644 --- a/apps/ai-game-creator-shell/src-tauri/tauri.conf.json +++ b/apps/ai-game-creator-shell/src-tauri/tauri.conf.json @@ -31,6 +31,9 @@ "bundle": { "active": true, "targets": "all", + "resources": { + "design-agent": "design-agent" + }, "linux": { "deb": { "depends": ["bubblewrap"] diff --git a/apps/ai-game-creator-shell/src-tauri/tauri.windows.conf.json b/apps/ai-game-creator-shell/src-tauri/tauri.windows.conf.json index 8e53a3cd4..ad932ab58 100644 --- a/apps/ai-game-creator-shell/src-tauri/tauri.windows.conf.json +++ b/apps/ai-game-creator-shell/src-tauri/tauri.windows.conf.json @@ -11,8 +11,7 @@ "resources/codex/win-x64/codex-resources/codex-windows-sandbox-setup.exe": "codex/win-x64/codex-resources/codex-windows-sandbox-setup.exe", "resources/codex/win-x64/codex-package.json": "codex/win-x64/codex-package.json", "resources/codex/win-x64/NOTICE.md": "codex/win-x64/NOTICE.md", - "resources/codex/win-x64/manifest.json": "codex/win-x64/manifest.json", - "design-agent": "design-agent" + "resources/codex/win-x64/manifest.json": "codex/win-x64/manifest.json" } } }