补充 MVP 范围聊天入口
新增 /mvp 最小可玩范围摘要和后续草稿 补充 /next 与 /help 的 MVP 入口覆盖 同步技术方案和项目决策记录
This commit is contained in:
@@ -1869,6 +1869,7 @@ const chatCommandHelp = [
|
||||
'/status:查看项目状态',
|
||||
'/brief:生成当前项目简报',
|
||||
'/goal:查看创作目标',
|
||||
'/mvp:查看本轮最小可玩范围',
|
||||
'/risks:查看当前项目风险',
|
||||
'/criteria:查看当前任务验收标准',
|
||||
'/groups:查看专业组进度',
|
||||
@@ -2110,6 +2111,80 @@ function summarizeProjectGoal(
|
||||
};
|
||||
}
|
||||
|
||||
function summarizeProjectMvpScope(
|
||||
nextManifest: GameCreationAppManifest,
|
||||
trace: GameCreationAgentRunTrace | null,
|
||||
) {
|
||||
const tasks = taskRowsFromManifest(nextManifest);
|
||||
const completedCount = tasks.filter(
|
||||
(task) => task.status === 'completed',
|
||||
).length;
|
||||
const failedCount = tasks.filter((task) => task.status === 'failed').length;
|
||||
const readyCount = selectGameCreationAppReadyTasks({ tasks }).length;
|
||||
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 exported = (nextManifest.commandRuns ?? []).some(
|
||||
(commandRun) =>
|
||||
commandRun.commandId === 'project.export_package' &&
|
||||
commandRun.status === 'completed',
|
||||
);
|
||||
const goal =
|
||||
nextManifest.goal?.trim() ||
|
||||
trace?.goal?.trim() ||
|
||||
trace?.taskGraph.goal?.trim() ||
|
||||
'暂无';
|
||||
|
||||
let draftCommand = '/next';
|
||||
let draftCommandLabel = '查看下一步';
|
||||
if (blockedTrace) {
|
||||
draftCommand = '/review';
|
||||
draftCommandLabel = '查看评审';
|
||||
} else if (trace && !tracePassed) {
|
||||
draftCommand = readyCount > 0 ? '/criteria' : '/trace';
|
||||
draftCommandLabel = readyCount > 0 ? '查看验收' : '查看 trace';
|
||||
} else if (tracePassed && !previewRunning) {
|
||||
draftCommand = '/run';
|
||||
draftCommandLabel = '启动预览';
|
||||
} else if (tracePassed && !exported) {
|
||||
draftCommand = '/export';
|
||||
draftCommandLabel = '导出试玩包';
|
||||
} else if (exported) {
|
||||
draftCommand = '/exports';
|
||||
draftCommandLabel = '查看试玩包';
|
||||
}
|
||||
|
||||
return {
|
||||
text: [
|
||||
'MVP 范围:',
|
||||
`- 项目:${nextManifest.name}`,
|
||||
`- 目标:${goal}`,
|
||||
`- MVP 内:可运行 Web 原型;基础输入 / 胜负 / 重开;本地预览;本地试玩包`,
|
||||
trace
|
||||
? `- 当前状态:最近 run ${trace.runId} · ${formatAgentRunStatus(trace)}`
|
||||
: '- 当前状态:暂无最近 run',
|
||||
`- 任务:完成 ${completedCount}/${tasks.length} · ready ${readyCount} · 失败 ${failedCount}`,
|
||||
`- 预览:${previewSummary}`,
|
||||
`- 资产:${nextManifest.assets.length} 个`,
|
||||
`- 试玩包:${exported ? '已导出' : tracePassed ? '待导出' : '待原型通过'}`,
|
||||
'- 先不做:云同步;Unity/Godot;插件市场;任意 shell;深度资产精修',
|
||||
`- 建议:${draftCommand}`,
|
||||
].join('\n'),
|
||||
draftCommand,
|
||||
draftCommandLabel,
|
||||
};
|
||||
}
|
||||
|
||||
function summarizeProjectRisks(
|
||||
nextManifest: GameCreationAppManifest,
|
||||
trace: GameCreationAgentRunTrace | null,
|
||||
@@ -3055,6 +3130,7 @@ function summarizeNextProjectActions(
|
||||
addSuggestion('查看最近 loop 进展', '/trace');
|
||||
}
|
||||
addSuggestion('查看创作目标', '/goal');
|
||||
addSuggestion('查看本轮 MVP 范围', '/mvp');
|
||||
|
||||
const readyTasks = selectGameCreationAppReadyTasks({
|
||||
tasks: taskRowsFromManifest(nextManifest),
|
||||
@@ -6687,6 +6763,23 @@ export function App() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (prompt === '/mvp') {
|
||||
if (!requireChatProjectForUserAction()) {
|
||||
return;
|
||||
}
|
||||
const summary = summarizeProjectMvpScope(manifest, agentRunTrace);
|
||||
setMessages((current) => [
|
||||
...current,
|
||||
{
|
||||
role: 'assistant',
|
||||
text: summary.text,
|
||||
draftCommand: summary.draftCommand,
|
||||
draftCommandLabel: summary.draftCommandLabel,
|
||||
},
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (prompt === '/risks') {
|
||||
if (!requireChatProjectForUserAction()) {
|
||||
return;
|
||||
|
||||
@@ -2251,6 +2251,103 @@ describe('AI 游戏创作 App 界面边界', () => {
|
||||
),
|
||||
).toHaveLength(runLocalCountBeforeGoal);
|
||||
|
||||
const commandCountsBeforeMvp = {
|
||||
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,
|
||||
};
|
||||
submitChat('/mvp');
|
||||
expect(await screen.findByText(/MVP 范围:/)).not.toBeNull();
|
||||
const mvpMessages = screen.getAllByText(/MVP 范围:/);
|
||||
const mvpMessage = mvpMessages[mvpMessages.length - 1];
|
||||
expect(mvpMessage.textContent).toContain('项目:未命名游戏原型');
|
||||
expect(mvpMessage.textContent).toContain('目标:做一个厨房弹幕游戏');
|
||||
expect(mvpMessage.textContent).toContain(
|
||||
'MVP 内:可运行 Web 原型;基础输入 / 胜负 / 重开;本地预览;本地试玩包',
|
||||
);
|
||||
expect(mvpMessage.textContent).toContain(
|
||||
'当前状态:最近 run run-main-shortcut-trace · passed / done · 1/3 轮 · evaluator-passed',
|
||||
);
|
||||
expect(mvpMessage.textContent).toContain(
|
||||
'任务:完成 0/16 · ready 1 · 失败 0',
|
||||
);
|
||||
expect(mvpMessage.textContent).toContain('预览:未启动');
|
||||
expect(mvpMessage.textContent).toContain('资产:2 个');
|
||||
expect(mvpMessage.textContent).toContain('试玩包:待导出');
|
||||
expect(mvpMessage.textContent).toContain(
|
||||
'先不做:云同步;Unity/Godot;插件市场;任意 shell;深度资产精修',
|
||||
);
|
||||
expect(mvpMessage.textContent).toContain('建议:/run');
|
||||
const mvpMessageList = document.querySelector('.message-list');
|
||||
expect(mvpMessageList).not.toBeNull();
|
||||
const mvpDraftButtons = within(mvpMessageList as HTMLElement).getAllByRole(
|
||||
'button',
|
||||
{ name: '启动预览' },
|
||||
);
|
||||
fireEvent.click(mvpDraftButtons[mvpDraftButtons.length - 1]);
|
||||
expect(screen.getByLabelText('创作想法')).toHaveProperty('value', '/run');
|
||||
expect(
|
||||
invoke.mock.calls.filter(
|
||||
([command]) => command === 'get_local_game_manifest',
|
||||
),
|
||||
).toHaveLength(commandCountsBeforeMvp.manifestRead);
|
||||
expect(
|
||||
invoke.mock.calls.filter(
|
||||
([command]) => command === 'read_local_project_file',
|
||||
),
|
||||
).toHaveLength(commandCountsBeforeMvp.fileRead);
|
||||
expect(
|
||||
invoke.mock.calls.filter(
|
||||
([command]) => command === 'list_local_project_files',
|
||||
),
|
||||
).toHaveLength(commandCountsBeforeMvp.fileList);
|
||||
expect(
|
||||
invoke.mock.calls.filter(
|
||||
([command]) => command === 'run_limited_local_command',
|
||||
),
|
||||
).toHaveLength(commandCountsBeforeMvp.runLocal);
|
||||
expect(
|
||||
invoke.mock.calls.filter(
|
||||
([command]) => command === 'start_local_game_preview',
|
||||
),
|
||||
).toHaveLength(commandCountsBeforeMvp.startPreview);
|
||||
expect(
|
||||
invoke.mock.calls.filter(
|
||||
([command]) => command === 'open_local_game_preview',
|
||||
),
|
||||
).toHaveLength(commandCountsBeforeMvp.openPreview);
|
||||
expect(
|
||||
invoke.mock.calls.filter(
|
||||
([command]) => command === 'export_local_project_package',
|
||||
),
|
||||
).toHaveLength(commandCountsBeforeMvp.exportPackage);
|
||||
expect(
|
||||
invoke.mock.calls.filter(
|
||||
([command]) => command === 'list_local_project_export_packages',
|
||||
),
|
||||
).toHaveLength(commandCountsBeforeMvp.exportList);
|
||||
|
||||
const manifestReadCountBeforeRisks = invoke.mock.calls.filter(
|
||||
([command]) => command === 'get_local_game_manifest',
|
||||
).length;
|
||||
@@ -2829,6 +2926,7 @@ describe('AI 游戏创作 App 界面边界', () => {
|
||||
expect(await screen.findByText(/下一步建议:/)).not.toBeNull();
|
||||
expect(screen.getByText(/运行自检并启动本地预览:\/run/)).not.toBeNull();
|
||||
expect(screen.getByText(/查看创作目标:\/goal/)).not.toBeNull();
|
||||
expect(screen.getByText(/查看本轮 MVP 范围:\/mvp/)).not.toBeNull();
|
||||
expect(screen.getByText(/查看 .* 个 ready 任务:\/tasks/)).not.toBeNull();
|
||||
expect(screen.getByText(/查看当前任务验收标准:\/criteria/)).not.toBeNull();
|
||||
expect(screen.getByText(/查看专业组进度:\/groups/)).not.toBeNull();
|
||||
@@ -8732,6 +8830,7 @@ describe('AI 游戏创作 App 界面边界', () => {
|
||||
).not.toBeNull();
|
||||
expect(screen.getByText(/\/brief:生成当前项目简报/)).not.toBeNull();
|
||||
expect(screen.getByText(/\/goal:查看创作目标/)).not.toBeNull();
|
||||
expect(screen.getByText(/\/mvp:查看本轮最小可玩范围/)).not.toBeNull();
|
||||
expect(screen.getByText(/\/risks:查看当前项目风险/)).not.toBeNull();
|
||||
expect(screen.getByText(/\/criteria:查看当前任务验收标准/)).not.toBeNull();
|
||||
expect(screen.getByText(/\/groups:查看专业组进度/)).not.toBeNull();
|
||||
|
||||
@@ -3867,6 +3867,7 @@
|
||||
- 2026-07-03 调整:主窗口 header 常驻项目摘要只从当前已加载的 manifest / trace 派生任务完成数、ready 数、资产来源分布和最近命令结果;未选择工作区时不显示,不为了摘要额外触发 Tauri 读取或写入,也不把任务、文件、run history 或预览开发面板搬进普通用户窗口。
|
||||
- 2026-07-03 调整:普通用户通过聊天输入 `/brief` 触发项目简报入口,只基于主窗口当前已加载的 manifest、最近 run trace、预览状态、资产数量和最近命令生成聊天内简报,并提供 `/next` 作为后续草稿;该入口不得触发 Tauri 读写、不得读取文件、不得启动或打开预览,也不得新增普通用户面板。
|
||||
- 2026-07-03 调整:普通用户通过聊天输入 `/goal` 查看创作目标,只基于当前 manifest.goal、最近 run goal 和 taskGraph.goal 汇总项目目标来源,并提供 `/agent-resume 细化目标:` 或 `/next` 草稿;该入口不得触发 Tauri 读写、不得读取 spec、上下文或 trace 文件,也不得新增普通用户目标面板。
|
||||
- 2026-07-03 调整:普通用户通过聊天输入 `/mvp` 查看本轮最小可玩范围,只基于当前 manifest、最近 run trace、preview、任务、资产和最近命令汇总 MVP 内、当前状态、试玩包状态和暂不做事项,并提供 `/review`、`/criteria`、`/trace`、`/run`、`/export`、`/exports` 或 `/next` 草稿;该入口不得触发 Tauri 读写、不得读取文件、不得启动或打开预览、不得导出试玩包,也不得新增普通用户 MVP 面板。
|
||||
- 2026-07-03 调整:普通用户通过聊天输入 `/risks` 查看当前项目风险,只基于主窗口当前已加载的 manifest、最近 run trace、预览状态、任务状态、资产来源和最近命令派生风险摘要,并提供首个风险处理草稿;该入口不得触发 Tauri 读写、不得读取文件、不得启动或打开预览,也不得新增普通用户面板。
|
||||
- 2026-07-03 调整:普通用户通过聊天输入 `/criteria` 查看当前任务验收标准,只基于当前 manifest.tasks 和最近 run trace.taskGraph 汇总 active、carry、ready、失败或待处理任务的验收条件和产物,并提供 `/tasks` 草稿;该入口不得触发 Tauri 读写、不得读取任务文件或 trace 文件,也不得新增普通用户验收面板。
|
||||
- 2026-07-03 调整:普通用户通过聊天输入 `/groups` 查看专业组进度,只基于当前 manifest.tasks 和最近 run trace.taskGraph / passPlans 汇总六个专业组的完成、active、carry、ready、失败数量和下一步任务,并提供 `/tasks` 草稿;该入口不得触发 Tauri 读写、不得读取任务文件或 trace 文件,也不得新增普通用户专业组面板。
|
||||
@@ -3886,7 +3887,7 @@
|
||||
- 2026-07-03 调整:普通用户通过聊天输入 `/art` 查看美术素材,只基于当前 manifest 盘点图片、视频和序列帧素材的数量、来源、画板接入状态和路径,并提供 `/generate-art 首版核心美术素材` 或 `/read assets/manifest.art.json` 草稿;该入口不得触发 Tauri 读写、平台生成、画板同步或新增普通用户美术面板。
|
||||
- 2026-07-03 调整:主窗口新增音效登记和画板音频导入快捷入口,只填入 `/asset-register assets/audio/sfx.wav audio audio/wav` 或 `/import-canvas-asset assets/audio/sfx.wav ` 草稿;聊天输入 `/audio` 只基于当前 manifest 盘点音频素材、来源和路径,并给出登记音效或读取 `assets/manifest.audio.json` 的草稿。音乐组仍复用现有资产登记 / 画板回流链路,不新增独立音频生成系统。
|
||||
- 2026-07-03 调整:主窗口新增常用生成产物读取入口,只把入口 HTML、设计、数值、美术清单、音频清单和发布说明对应的 `/read` 草稿填入聊天输入框;聊天命令 `/artifacts` 只列出同一组固定读取命令并提供首个读取草稿,`/run-artifacts` 只列出最近 trace 里的产物读取命令并提供首个 `/read` 草稿,`/logs` 只列出固定日志读取命令;实际读取仍走聊天侧 `file.read` 权限流,不直接读本地文件。
|
||||
- 2026-07-03 调整:普通用户通过聊天输入 `/next` 触发下一步建议入口,只基于主窗口当前已加载的 manifest、最近 run trace 和最近命令摘要生成聊天建议,列出 `/goal`、`/tasks`、`/criteria`、`/groups`、`/budget`、`/qa`、`/changes`、`/trace`、`/review`、`/context`、`/timeline`、`/playtest`、`/run`、`/open-preview`、`/assets`、`/art`、`/audio`、`/publish`、`/artifacts`、`/run-artifacts`、`/passes`、`/run-files`、`/internals`、`/logs`、`/agent-resume ` 等安全命令草稿方向,并提供一个首选草稿;该命令不得直接执行 Tauri 读写、启动或打开预览、读取本地文件,也不得绕过原有命令确认和 `file.read` 权限流。
|
||||
- 2026-07-03 调整:普通用户通过聊天输入 `/next` 触发下一步建议入口,只基于主窗口当前已加载的 manifest、最近 run trace 和最近命令摘要生成聊天建议,列出 `/goal`、`/mvp`、`/tasks`、`/criteria`、`/groups`、`/budget`、`/qa`、`/changes`、`/trace`、`/review`、`/context`、`/timeline`、`/playtest`、`/run`、`/open-preview`、`/assets`、`/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
Reference in New Issue
Block a user