补充封面缩略图聊天入口

新增 /cover 封面与缩略图检查摘要

补充 /next 与 /help 的封面入口覆盖

验证 /cover 不触发文件读取、运行、预览、导出或 agent 控制

同步 AI 游戏创作 App 技术方案和决策记录
This commit is contained in:
AIGameCreator App
2026-07-04 13:25:36 +08:00
parent 2d526b4ea1
commit f6ad06eb1a
4 changed files with 209 additions and 3 deletions
+93
View File
@@ -1889,6 +1889,7 @@ const chatCommandHelp = [
'/invite:准备试玩邀请文案',
'/bug-report:准备缺陷复现记录',
'/survey:准备试玩问卷问题',
'/cover:准备封面与缩略图检查',
'/screenshots:准备宣传截图清单',
'/trailer:准备试玩短视频脚本',
'/faq:准备试玩常见问答',
@@ -3921,6 +3922,80 @@ function summarizeProjectPlaytestSurvey(
};
}
function summarizeProjectCoverChecklist(
nextManifest: GameCreationAppManifest,
trace: GameCreationAgentRunTrace | null,
) {
const preview = nextManifest.preview;
const previewRunning = preview?.status === 'running' && preview.url;
const previewSummary = previewRunning
? `运行中 ${preview.url}`
: preview
? previewStatusLabels[preview.status]
: '未启动';
const tracePassed = isAgentRunTracePassed(trace);
const blockedTrace =
trace?.lifecycleStatus === 'killed' ||
trace?.status === 'failed' ||
trace?.status === 'needs-revision' ||
trace?.stopReason === 'max-passes-exhausted';
const visualAssets = nextManifest.assets.filter(isProjectVisualAsset);
const coverCandidate =
visualAssets.find(
(asset) =>
asset.source.kind === 'canvas' || asset.source.kind === 'generated',
) ??
visualAssets[0] ??
null;
const canvasOrGeneratedCount = visualAssets.filter(
(asset) =>
asset.source.kind === 'canvas' || asset.source.kind === 'generated',
).length;
const coverCandidateSummary = coverCandidate
? `${coverCandidate.localPath} · ${coverCandidate.mediaType} · ${assetSourceKindLabels[coverCandidate.source.kind]}`
: '暂无 · 先用 /screenshots 或 /art 准备';
let draftCommand = coverCandidate ? '/listing' : '/art';
let draftCommandLabel = coverCandidate ? '准备作品页' : '查看美术素材';
if (!trace) {
draftCommand = '/next';
draftCommandLabel = '查看下一步';
} else if (blockedTrace) {
draftCommand = '/review';
draftCommandLabel = '查看评审';
} else if (!tracePassed) {
draftCommand = '/trace';
draftCommandLabel = '查看 trace';
} else if (!previewRunning) {
draftCommand = '/run';
draftCommandLabel = '启动试玩';
}
return {
text: [
'封面与缩略图:',
`- 项目:${nextManifest.name}`,
`- 当前状态:${
tracePassed
? `最近 run 已通过${trace?.runId ? ` ${trace.runId}` : ''}`
: trace
? `最近 run 未通过 ${trace.status} / ${trace.stopReason}`
: '暂无最近 run'
} ${previewSummary}`,
`- 可用素材:视觉素材 ${visualAssets.length} 个;画板/生成候选 ${canvasOrGeneratedCount} 个;总资产 ${nextManifest.assets.length}`,
`- 封面候选:${coverCandidateSummary}`,
'- 用途尺寸:作品页封面 16:9;社区缩略图 1:1;移动首屏 9:16',
'- 选择口径:优先展示核心玩法状态;避免内部路径、调试面板、密钥配置或纯空场景',
'- 补齐路径:有可试玩时先 /screenshots;缺美术时 /art;作品页文案走 /listing',
'- 参考:/screenshots/listing/media-kit/credits',
'- 边界:只准备封面与缩略图检查;不截屏;不裁剪;不读取文件;不启动或打开预览;不导出试玩包;不上传云端;不发布作品;不写项目',
`- 建议:${draftCommand}`,
].join('\n'),
draftCommand,
draftCommandLabel,
};
}
function summarizeProjectScreenshotChecklist(
nextManifest: GameCreationAppManifest,
trace: GameCreationAgentRunTrace | null,
@@ -5853,6 +5928,7 @@ function summarizeNextProjectActions(
addSuggestion('准备试玩邀请文案', '/invite');
addSuggestion('准备缺陷复现记录', '/bug-report');
addSuggestion('准备试玩问卷问题', '/survey');
addSuggestion('准备封面与缩略图检查', '/cover');
addSuggestion('准备宣传截图清单', '/screenshots');
addSuggestion('准备试玩短视频脚本', '/trailer');
addSuggestion('准备试玩常见问答', '/faq');
@@ -9916,6 +9992,23 @@ export function App() {
return;
}
if (prompt === '/cover') {
if (!requireChatProjectForUserAction()) {
return;
}
const summary = summarizeProjectCoverChecklist(manifest, agentRunTrace);
setMessages((current) => [
...current,
{
role: 'assistant',
text: summary.text,
draftCommand: summary.draftCommand,
draftCommandLabel: summary.draftCommandLabel,
},
]);
return;
}
if (prompt === '/screenshots') {
if (!requireChatProjectForUserAction()) {
return;
@@ -4749,6 +4749,7 @@ describe('AI 游戏创作 App 界面边界', () => {
expect(screen.getByText(/准备试玩邀请文案:\/invite/)).not.toBeNull();
expect(screen.getByText(/准备缺陷复现记录:\/bug-report/)).not.toBeNull();
expect(screen.getByText(/准备试玩问卷问题:\/survey/)).not.toBeNull();
expect(screen.getByText(/准备封面与缩略图检查:\/cover/)).not.toBeNull();
expect(screen.getByText(/准备宣传截图清单:\/screenshots/)).not.toBeNull();
expect(screen.getByText(/准备试玩短视频脚本:\/trailer/)).not.toBeNull();
expect(screen.getByText(/准备试玩常见问答:\/faq/)).not.toBeNull();
@@ -5532,6 +5533,114 @@ describe('AI 游戏创作 App 界面边界', () => {
invoke.mock.calls.filter(([command]) => command === 'control_agent_run'),
).toHaveLength(commandCountsBeforeSurvey.controlAgentRun);
const commandCountsBeforeCover = {
manifestRead: invoke.mock.calls.filter(
([command]) => command === 'get_local_game_manifest',
).length,
fileRead: invoke.mock.calls.filter(
([command]) => command === 'read_local_project_file',
).length,
fileList: invoke.mock.calls.filter(
([command]) => command === 'list_local_project_files',
).length,
runLocal: invoke.mock.calls.filter(
([command]) => command === 'run_limited_local_command',
).length,
startPreview: invoke.mock.calls.filter(
([command]) => command === 'start_local_game_preview',
).length,
openPreview: invoke.mock.calls.filter(
([command]) => command === 'open_local_game_preview',
).length,
exportPackage: invoke.mock.calls.filter(
([command]) => command === 'export_local_project_package',
).length,
exportList: invoke.mock.calls.filter(
([command]) => command === 'list_local_project_export_packages',
).length,
controlAgentRun: invoke.mock.calls.filter(
([command]) => command === 'control_agent_run',
).length,
};
submitChat('/cover');
const coverMessages = await screen.findAllByText(/封面与缩略图:/);
const coverMessage = coverMessages[coverMessages.length - 1];
expect(coverMessage.textContent).toContain('项目:未命名游戏原型');
expect(coverMessage.textContent).toContain(
'当前状态:最近 run 已通过 run-main-shortcut-trace;预览 未启动',
);
expect(coverMessage.textContent).toContain(
'可用素材:视觉素材 1 个;画板/生成候选 1 个;总资产 2 个',
);
expect(coverMessage.textContent).toContain(
'封面候选:assets/canvas-sync/tiles.png · image/png · 画板',
);
expect(coverMessage.textContent).toContain(
'用途尺寸:作品页封面 16:9;社区缩略图 1:1;移动首屏 9:16',
);
expect(coverMessage.textContent).toContain(
'选择口径:优先展示核心玩法状态;避免内部路径、调试面板、密钥配置或纯空场景',
);
expect(coverMessage.textContent).toContain(
'补齐路径:有可试玩时先 /screenshots;缺美术时 /art;作品页文案走 /listing',
);
expect(coverMessage.textContent).toContain(
'参考:/screenshots/listing/media-kit/credits',
);
expect(coverMessage.textContent).toContain(
'边界:只准备封面与缩略图检查;不截屏;不裁剪;不读取文件;不启动或打开预览;不导出试玩包;不上传云端;不发布作品;不写项目',
);
expect(coverMessage.textContent).toContain('建议:/run');
const coverMessageList = document.querySelector('.message-list');
expect(coverMessageList).not.toBeNull();
const coverDraftButtons = within(coverMessageList as HTMLElement)
.getAllByRole('button', { name: '启动试玩' });
fireEvent.click(coverDraftButtons[coverDraftButtons.length - 1]);
expect(screen.getByLabelText('创作想法')).toHaveProperty('value', '/run');
expect(
invoke.mock.calls.filter(
([command]) => command === 'get_local_game_manifest',
),
).toHaveLength(commandCountsBeforeCover.manifestRead);
expect(
invoke.mock.calls.filter(
([command]) => command === 'read_local_project_file',
),
).toHaveLength(commandCountsBeforeCover.fileRead);
expect(
invoke.mock.calls.filter(
([command]) => command === 'list_local_project_files',
),
).toHaveLength(commandCountsBeforeCover.fileList);
expect(
invoke.mock.calls.filter(
([command]) => command === 'run_limited_local_command',
),
).toHaveLength(commandCountsBeforeCover.runLocal);
expect(
invoke.mock.calls.filter(
([command]) => command === 'start_local_game_preview',
),
).toHaveLength(commandCountsBeforeCover.startPreview);
expect(
invoke.mock.calls.filter(
([command]) => command === 'open_local_game_preview',
),
).toHaveLength(commandCountsBeforeCover.openPreview);
expect(
invoke.mock.calls.filter(
([command]) => command === 'export_local_project_package',
),
).toHaveLength(commandCountsBeforeCover.exportPackage);
expect(
invoke.mock.calls.filter(
([command]) => command === 'list_local_project_export_packages',
),
).toHaveLength(commandCountsBeforeCover.exportList);
expect(
invoke.mock.calls.filter(([command]) => command === 'control_agent_run'),
).toHaveLength(commandCountsBeforeCover.controlAgentRun);
const commandCountsBeforeScreenshots = {
manifestRead: invoke.mock.calls.filter(
([command]) => command === 'get_local_game_manifest',
@@ -12273,6 +12382,7 @@ describe('AI 游戏创作 App 界面边界', () => {
screen.getByText(/\/bug-report:准备缺陷复现记录/),
).not.toBeNull();
expect(screen.getByText(/\/survey:准备试玩问卷问题/)).not.toBeNull();
expect(screen.getByText(/\/cover:准备封面与缩略图检查/)).not.toBeNull();
expect(screen.getByText(/\/screenshots:准备宣传截图清单/)).not.toBeNull();
expect(screen.getByText(/\/trailer:准备试玩短视频脚本/)).not.toBeNull();
expect(screen.getByText(/\/faq:准备试玩常见问答/)).not.toBeNull();
@@ -3899,6 +3899,7 @@
- 2026-07-04 调整:普通用户通过聊天输入 `/invite` 准备试玩邀请文案,只基于主窗口当前已加载的 manifest、最近 run trace 和 preview 状态汇总邀请对象、短文案、发送前检查和收反馈口径,并提供 `/run``/feedback``/review``/trace``/next` 草稿;该入口不得触发 Tauri 读写、不得读取文件、不得启动或打开预览、不得导出试玩包、不得写项目,也不得新增普通用户邀请面板。
- 2026-07-04 调整:普通用户通过聊天输入 `/bug-report` 准备缺陷复现记录,只基于主窗口当前已加载的 manifest、最近 run trace 和 preview 状态汇总复现入口、最近试玩证据、记录模板、严重度口径和修复草稿,并提供 `/run``/agent-resume 缺陷修复:``/review``/trace``/next` 草稿;该入口不得触发 Tauri 读写、不得读取文件、不得启动或打开预览、不得导出试玩包、不得写项目,也不得新增普通用户缺陷面板。
- 2026-07-04 调整:普通用户通过聊天输入 `/survey` 准备试玩问卷问题,只基于主窗口当前已加载的 manifest、最近 run trace 和 preview 状态汇总问卷使用场景、五个核心问题、记录格式和追踪方式,并提供 `/run``/invite``/review``/trace``/next` 草稿;该入口不得触发 Tauri 读写、不得读取文件、不得启动或打开预览、不得导出试玩包、不得写项目,也不得新增普通用户问卷面板。
- 2026-07-04 调整:普通用户通过聊天输入 `/cover` 准备封面与缩略图检查,只基于主窗口当前已加载的 manifest、最近 run trace、preview 和资产状态汇总封面候选、用途尺寸、选择口径和补齐路径,并提供 `/run``/art``/listing``/review``/trace``/next` 草稿;该入口不得触发 Tauri 读写、不得截屏、不得裁剪、不得读取文件、不得启动或打开预览、不得导出试玩包、不得上传云端、不得发布作品、不得写项目,也不得新增普通用户封面面板。
- 2026-07-04 调整:普通用户通过聊天输入 `/screenshots` 准备宣传截图清单,只基于主窗口当前已加载的 manifest、最近 run trace、preview 和资产状态汇总截图目标、拍摄顺序、命名建议和作品页搭配,并提供 `/run``/listing``/review``/trace``/next` 草稿;该入口不得触发 Tauri 读写、不得截屏、不得读取文件、不得启动或打开预览、不得导出试玩包、不得写项目,也不得新增普通用户截图面板。
- 2026-07-04 调整:普通用户通过聊天输入 `/trailer` 准备试玩短视频脚本,只基于主窗口当前已加载的 manifest、最近 run trace、preview 和资产状态汇总 15 秒结构、镜头清单、口播节奏和录制提示,并提供 `/run``/share``/review``/trace``/next` 草稿;该入口不得触发 Tauri 读写、不得录屏、不得读取文件、不得启动或打开预览、不得导出试玩包、不得上传云端、不得写项目,也不得新增普通用户录屏面板。
- 2026-07-04 调整:普通用户通过聊天输入 `/faq` 准备试玩常见问答,只基于主窗口当前已加载的 manifest、最近 run trace 和 preview 状态汇总试玩问答、回答口径、测试者提醒和交付搭配,并提供 `/run``/share``/review``/trace``/next` 草稿;该入口不得触发 Tauri 读写、不得读取文件、不得启动或打开预览、不得导出试玩包、不得上传云端、不得写项目,也不得新增普通用户 FAQ 面板。
@@ -3919,7 +3920,7 @@
- 2026-07-03 调整:普通用户通过聊天输入 `/balance` 查看数值与难度口径,只基于当前 manifest.tasks、最近 run trace.taskGraph、trace artifacts 和 steps 汇总数值组任务、验收口径、`game/balance.json` 状态和最近数值步骤,并提供 `/read game/balance.json``/agent-resume 数值调整:...` 草稿;该入口不得触发 Tauri 读写、不得读取数值表、不得启动预览或继续 run,也不得新增普通用户数值面板。
- 2026-07-03 调整:主窗口新增常用生成产物读取入口,只把入口 HTML、设计、数值、美术清单、音频清单和发布说明对应的 `/read` 草稿填入聊天输入框;聊天命令 `/artifacts` 只列出同一组固定读取命令并提供首个读取草稿,`/run-artifacts` 只列出最近 trace 里的产物读取命令并提供首个 `/read` 草稿,`/logs` 只列出固定日志读取命令;实际读取仍走聊天侧 `file.read` 权限流,不直接读本地文件。
- 2026-07-03 调整:普通用户通过聊天输入 `/share` 准备试玩交付清单,只基于当前 manifest、授权项目路径、最近 run trace、preview 状态和 manifest.commandRuns 汇总原型通过状态、本地预览、本地试玩包、测试者说明和反馈收集方向,并提供 `/export``/exports``/trace``/review``/next` 草稿;该入口不得触发 Tauri 读写、不得导出试玩包、不得列出历史包、不得上传云端、不得生成公开分享链接,也不得新增普通用户分享面板。
- 2026-07-03 调整,2026-07-04 更新:普通用户通过聊天输入 `/next` 触发下一步建议入口,只基于主窗口当前已加载的 manifest、最近 run trace 和最近命令摘要生成聊天建议,列出 `/goal``/spec``/mvp``/pitch``/demo``/rules``/tutorial``/mobile``/accessibility``/performance``/polish``/blockers``/ready``/deps``/revise``/privacy``/audience``/invite``/bug-report``/survey``/screenshots``/trailer``/faq``/post``/store``/media-kit``/release-notes``/tasks``/criteria``/groups``/balance``/budget``/qa``/changes``/todo``/trace``/review``/context``/timeline``/playtest``/test-plan``/feedback``/share``/listing``/run``/open-preview``/assets``/credits``/art``/audio``/publish``/artifacts``/run-artifacts``/passes``/run-files``/internals``/logs``/agent-resume ` 等安全命令草稿方向,并提供一个首选草稿;该命令不得直接执行 Tauri 读写、启动或打开预览、读取本地文件,也不得绕过原有命令确认和 `file.read` 权限流。
- 2026-07-03 调整,2026-07-04 更新:普通用户通过聊天输入 `/next` 触发下一步建议入口,只基于主窗口当前已加载的 manifest、最近 run trace 和最近命令摘要生成聊天建议,列出 `/goal``/spec``/mvp``/pitch``/demo``/rules``/tutorial``/mobile``/accessibility``/performance``/polish``/blockers``/ready``/deps``/revise``/privacy``/audience``/invite``/bug-report``/survey``/cover``/screenshots``/trailer``/faq``/post``/store``/media-kit``/release-notes``/tasks``/criteria``/groups``/balance``/budget``/qa``/changes``/todo``/trace``/review``/context``/timeline``/playtest``/test-plan``/feedback``/share``/listing``/run``/open-preview``/assets``/credits``/art``/audio``/publish``/artifacts``/run-artifacts``/passes``/run-files``/internals``/logs``/agent-resume ` 等安全命令草稿方向,并提供一个首选草稿;该命令不得直接执行 Tauri 读写、启动或打开预览、读取本地文件,也不得绕过原有命令确认和 `file.read` 权限流。
- 2026-07-03 调整:普通用户通过聊天输入 `/publish` 生成发布准备清单,只基于主窗口当前已加载的 manifest、最近 run trace、预览状态、资产来源和最近命令摘要列出原型通过、预览、任务、资产、音频、包装说明和试玩包状态,并提供 `/run``/trace``/agent-resume ``/export` 草稿;该入口不得触发 Tauri 读写、不得启动或打开预览、不得读取文件,也不得新增普通用户发布面板。
- 2026-07-03 调整:普通用户通过聊天输入 `/internals` 只列出 `.agent/manifest.json``.agent/run.latest.json``.agent/spec.md``.agent/findings.md``.agent/policy.json``.agent/project.index.json``.agent/agent.db``.agent/conversations/project.jsonl``/read` 草稿,并提供首个读取草稿;该入口不得直接读取内部文件、不得触发 Tauri 读写,也不得新增普通用户内部文件面板。
- 2026-07-03 调整:普通用户通过聊天输入 `/passes` 只从当前已加载的最近 run trace artifacts 中筛选 `.agent/passes/` 轮次产物,列出 `/read` 草稿并提供首个读取草稿;该入口不得直接读取轮次文件、不得触发 Tauri 读写,也不得新增普通用户轮次面板。
File diff suppressed because one or more lines are too long