补充创作目标聊天入口
新增 /goal 创作目标来源摘要和细化草稿 补充 /next 与 /help 的目标入口覆盖 同步技术方案和项目决策记录
This commit is contained in:
@@ -1868,6 +1868,7 @@ const chatCommandHelp = [
|
||||
'/audit:审计当前项目的 Agent 能力证据',
|
||||
'/status:查看项目状态',
|
||||
'/brief:生成当前项目简报',
|
||||
'/goal:查看创作目标',
|
||||
'/risks:查看当前项目风险',
|
||||
'/criteria:查看当前任务验收标准',
|
||||
'/groups:查看专业组进度',
|
||||
@@ -2082,6 +2083,33 @@ function summarizeProjectBrief(
|
||||
}`;
|
||||
}
|
||||
|
||||
function summarizeProjectGoal(
|
||||
nextManifest: GameCreationAppManifest,
|
||||
trace: GameCreationAgentRunTrace | null,
|
||||
) {
|
||||
const manifestGoal = nextManifest.goal?.trim() || '';
|
||||
const runGoal = trace?.goal?.trim() || '';
|
||||
const taskGraphGoal = trace?.taskGraph.goal?.trim() || '';
|
||||
const draftCommand = trace ? '/agent-resume 细化目标:' : '/next';
|
||||
|
||||
return {
|
||||
text: [
|
||||
'创作目标:',
|
||||
`- 项目:${nextManifest.name}`,
|
||||
`- Manifest:${manifestGoal || '暂无'}`,
|
||||
trace ? `- Run:${trace.runId} · ${formatAgentRunStatus(trace)}` : null,
|
||||
`- Run 目标:${runGoal || '暂无'}`,
|
||||
`- 任务图目标:${taskGraphGoal || '暂无'}`,
|
||||
'- 上下文:/context',
|
||||
`- 建议:${draftCommand}`,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join('\n'),
|
||||
draftCommand,
|
||||
draftCommandLabel: trace ? '补充目标' : '查看下一步',
|
||||
};
|
||||
}
|
||||
|
||||
function summarizeProjectRisks(
|
||||
nextManifest: GameCreationAppManifest,
|
||||
trace: GameCreationAgentRunTrace | null,
|
||||
@@ -3026,6 +3054,7 @@ function summarizeNextProjectActions(
|
||||
} else {
|
||||
addSuggestion('查看最近 loop 进展', '/trace');
|
||||
}
|
||||
addSuggestion('查看创作目标', '/goal');
|
||||
|
||||
const readyTasks = selectGameCreationAppReadyTasks({
|
||||
tasks: taskRowsFromManifest(nextManifest),
|
||||
@@ -6641,6 +6670,23 @@ export function App() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (prompt === '/goal') {
|
||||
if (!requireChatProjectForUserAction()) {
|
||||
return;
|
||||
}
|
||||
const summary = summarizeProjectGoal(manifest, agentRunTrace);
|
||||
setMessages((current) => [
|
||||
...current,
|
||||
{
|
||||
role: 'assistant',
|
||||
text: summary.text,
|
||||
draftCommand: summary.draftCommand,
|
||||
draftCommandLabel: summary.draftCommandLabel,
|
||||
},
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (prompt === '/risks') {
|
||||
if (!requireChatProjectForUserAction()) {
|
||||
return;
|
||||
|
||||
@@ -1710,6 +1710,7 @@ describe('AI 游戏创作 App 界面边界', () => {
|
||||
'local-project-draft',
|
||||
'未命名游戏原型',
|
||||
);
|
||||
manifest.goal = '做一个厨房弹幕游戏';
|
||||
manifest.assets.push({
|
||||
id: 'asset-hero',
|
||||
kind: 'uploaded',
|
||||
@@ -2208,6 +2209,48 @@ describe('AI 游戏创作 App 界面边界', () => {
|
||||
),
|
||||
).toHaveLength(manifestReadCountBeforeBrief);
|
||||
|
||||
const manifestReadCountBeforeGoal = invoke.mock.calls.filter(
|
||||
([command]) => command === 'get_local_game_manifest',
|
||||
).length;
|
||||
const fileReadCountBeforeGoal = invoke.mock.calls.filter(
|
||||
([command]) => command === 'read_local_project_file',
|
||||
).length;
|
||||
const runLocalCountBeforeGoal = invoke.mock.calls.filter(
|
||||
([command]) => command === 'run_limited_local_command',
|
||||
).length;
|
||||
submitChat('/goal');
|
||||
expect(await screen.findByText(/创作目标:/)).not.toBeNull();
|
||||
const goalMessages = screen.getAllByText(/创作目标:/);
|
||||
const goalMessage = goalMessages[goalMessages.length - 1];
|
||||
expect(goalMessage.textContent).toContain('Manifest:做一个厨房弹幕游戏');
|
||||
expect(goalMessage.textContent).toContain(
|
||||
'Run:run-main-shortcut-trace · passed / done · 1/3 轮 · evaluator-passed',
|
||||
);
|
||||
expect(goalMessage.textContent).toContain('Run 目标:做一个厨房弹幕游戏');
|
||||
expect(goalMessage.textContent).toContain('任务图目标:做一个厨房弹幕游戏');
|
||||
expect(goalMessage.textContent).toContain('上下文:/context');
|
||||
expect(goalMessage.textContent).toContain('建议:/agent-resume 细化目标:');
|
||||
fireEvent.click(screen.getByRole('button', { name: '补充目标' }));
|
||||
expect(screen.getByLabelText('创作想法')).toHaveProperty(
|
||||
'value',
|
||||
'/agent-resume 细化目标:',
|
||||
);
|
||||
expect(
|
||||
invoke.mock.calls.filter(
|
||||
([command]) => command === 'get_local_game_manifest',
|
||||
),
|
||||
).toHaveLength(manifestReadCountBeforeGoal);
|
||||
expect(
|
||||
invoke.mock.calls.filter(
|
||||
([command]) => command === 'read_local_project_file',
|
||||
),
|
||||
).toHaveLength(fileReadCountBeforeGoal);
|
||||
expect(
|
||||
invoke.mock.calls.filter(
|
||||
([command]) => command === 'run_limited_local_command',
|
||||
),
|
||||
).toHaveLength(runLocalCountBeforeGoal);
|
||||
|
||||
const manifestReadCountBeforeRisks = invoke.mock.calls.filter(
|
||||
([command]) => command === 'get_local_game_manifest',
|
||||
).length;
|
||||
@@ -2785,6 +2828,7 @@ describe('AI 游戏创作 App 界面边界', () => {
|
||||
submitChat('/next');
|
||||
expect(await screen.findByText(/下一步建议:/)).not.toBeNull();
|
||||
expect(screen.getByText(/运行自检并启动本地预览:\/run/)).not.toBeNull();
|
||||
expect(screen.getByText(/查看创作目标:\/goal/)).not.toBeNull();
|
||||
expect(screen.getByText(/查看 .* 个 ready 任务:\/tasks/)).not.toBeNull();
|
||||
expect(screen.getByText(/查看当前任务验收标准:\/criteria/)).not.toBeNull();
|
||||
expect(screen.getByText(/查看专业组进度:\/groups/)).not.toBeNull();
|
||||
@@ -8687,6 +8731,7 @@ describe('AI 游戏创作 App 界面边界', () => {
|
||||
screen.getByText(/\/switch-project:回到项目启动器切换工作区/),
|
||||
).not.toBeNull();
|
||||
expect(screen.getByText(/\/brief:生成当前项目简报/)).not.toBeNull();
|
||||
expect(screen.getByText(/\/goal:查看创作目标/)).not.toBeNull();
|
||||
expect(screen.getByText(/\/risks:查看当前项目风险/)).not.toBeNull();
|
||||
expect(screen.getByText(/\/criteria:查看当前任务验收标准/)).not.toBeNull();
|
||||
expect(screen.getByText(/\/groups:查看专业组进度/)).not.toBeNull();
|
||||
|
||||
@@ -3866,6 +3866,7 @@
|
||||
- 2026-07-03 调整:主窗口 Agent 状态栏新增“继续说明”,只把 `/agent-resume ` 填入聊天输入框,让用户补充说明后再走原确认流;策略快捷入口新增 project.index、asset.register、memory.write、preview.open、preview.stop、conversation.read 和 conversation.write 确认草稿,同样只填输入框,不直接写 `.agent/policy.json`。
|
||||
- 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 调整:普通用户通过聊天输入 `/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 文件,也不得新增普通用户专业组面板。
|
||||
@@ -3885,7 +3886,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 和最近命令摘要生成聊天建议,列出 `/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`、`/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