补充产物读取命令入口

新增聊天侧常用生成产物命令列表

补充入口HTML读取草稿和用户面测试

同步AI游戏创作App技术方案和共享决策记录
This commit is contained in:
AIGameCreator App
2026-07-03 03:20:10 +08:00
parent c88678c28d
commit bd1dfe198b
4 changed files with 44 additions and 3 deletions
+27
View File
@@ -219,6 +219,7 @@ type ProjectFileActionDraft = {
};
const commonProjectArtifactReadDrafts = [
{ label: '读入口', path: 'game/index.html' },
{ label: '读设计', path: 'game/game_design.md' },
{ label: '读数值', path: 'game/balance.json' },
{ label: '读美术清单', path: 'assets/manifest.art.json' },
@@ -1839,6 +1840,7 @@ const chatCommandHelp = [
'/history:重新读取当前项目对话历史',
'/files:列出本地项目文件',
'/assets:列出本地项目资产',
'/artifacts:列出常用生成产物读取命令',
'/asset-register 路径 [kind] [mediaType]:登记项目内已有资产',
'/read 路径:读取本地项目内文本文件',
'/run:运行自检,启动本地 HTTP 预览并交给外部浏览器',
@@ -2271,6 +2273,15 @@ function projectFileActionDrafts(localPath: string): ProjectFileActionDraft {
};
}
function summarizeCommonProjectArtifactReadDrafts() {
return `常用生成产物:\n${commonProjectArtifactReadDrafts
.map(
(artifact) =>
`- ${artifact.label} · ${artifact.path} · /read ${artifact.path}`,
)
.join('\n')}`;
}
function summarizeProjectAssets(nextManifest: GameCreationAppManifest) {
if (nextManifest.assets.length === 0) {
return '本地项目还没有登记资产。';
@@ -5228,6 +5239,22 @@ export function App() {
return;
}
if (prompt === '/artifacts') {
if (!requireChatProjectForUserAction()) {
return;
}
setMessages((current) => [
...current,
{
role: 'assistant',
text: summarizeCommonProjectArtifactReadDrafts(),
draftCommand: `/read ${commonProjectArtifactReadDrafts[0].path}`,
draftCommandLabel: commonProjectArtifactReadDrafts[0].label,
},
]);
return;
}
if (prompt.startsWith('/asset-register ')) {
if (!requireChatProjectForUserAction()) {
return;
@@ -2086,6 +2086,7 @@ describe('AI 游戏创作 App 界面边界', () => {
),
).not.toBeNull();
for (const [buttonName, draftValue] of [
['读入口', '/read game/index.html'],
['读设计', '/read game/game_design.md'],
['读数值', '/read game/balance.json'],
['读美术清单', '/read assets/manifest.art.json'],
@@ -2096,6 +2097,16 @@ describe('AI 游戏创作 App 界面边界', () => {
expect(composerInput).toHaveProperty('value', draftValue);
await waitFor(() => expect(document.activeElement).toBe(composerInput));
}
submitChat('/artifacts');
expect(await screen.findByText(/常用生成产物:/)).not.toBeNull();
expect(screen.getByText(/读入口 · game\/index\.html/)).not.toBeNull();
expect(
screen.getByText(/读发布说明 · exports\/README\.md/),
).not.toBeNull();
const readEntryButtons = screen.getAllByRole('button', { name: '读入口' });
fireEvent.click(readEntryButtons[readEntryButtons.length - 1]);
expect(composerInput).toHaveProperty('value', '/read game/index.html');
await waitFor(() => expect(document.activeElement).toBe(composerInput));
fireEvent.click(screen.getByRole('button', { name: '打开画板' }));
expect(composerInput).toHaveProperty('value', '/canvas ');
await waitFor(() => expect(document.activeElement).toBe(composerInput));
@@ -7509,6 +7520,9 @@ describe('AI 游戏创作 App 界面边界', () => {
/\/asset-register 路径 \[kind\] \[mediaType\]:登记项目内已有资产/,
),
).not.toBeNull();
expect(
screen.getByText(/\/artifacts:列出常用生成产物读取命令/),
).not.toBeNull();
expect(
screen.getByText(/\/canvas 画板项目ID:打开本机画板项目/),
).not.toBeNull();
@@ -3860,7 +3860,7 @@
- 2026-07-03 调整:开发窗口日志面板提供 `.agent/logs/command.log``.agent/logs/preview.log``.agent/logs/agent.log` 的只读查看入口,复用 `file.read` 授权策略;普通用户窗口仍只通过聊天 `/read` 和摘要消息查看需要的日志,不新增日志面板。
- 2026-07-03 调整:单 Agent 对话面板允许用户把当前输入手动追加到该 agent 的 `memory/agents/<group>/<role>.md` 私有记忆;写入复用 `memory.write` 项目策略、项目锁和 Tauri 本地目录能力,不把普通对话流水自动混入私有记忆。
- 2026-07-03 调整:主窗口新增音效登记和画板音频导入快捷入口,只填入 `/asset-register assets/audio/sfx.wav audio audio/wav``/import-canvas-asset assets/audio/sfx.wav ` 草稿;音乐组仍复用现有资产登记 / 画板回流链路,不新增独立音频生成系统。
- 2026-07-03 调整:主窗口新增常用生成产物读取入口,只把设计、数值、美术清单、音频清单和发布说明对应的 `/read` 草稿填入聊天输入框;实际读取仍走聊天侧 `file.read` 权限流,不直接读本地文件。
- 2026-07-03 调整:主窗口新增常用生成产物读取入口,只把入口 HTML、设计、数值、美术清单、音频清单和发布说明对应的 `/read` 草稿填入聊天输入框;聊天命令 `/artifacts` 只列出同一组固定读取命令并提供首个读取草稿;实际读取仍走聊天侧 `file.read` 权限流,不直接读本地文件。
- 2026-06-25 调整:本地 HTTP 预览静态 `HEAD` 必须返回与 `GET` 相同的真实 `Content-Length`,但不返回 body;浏览器、图片、音频和视频探测不能拿到 `Content-Length: 0` 的假响应。
- 2026-06-25 调整:普通用户通过聊天输入 `/run` 触发待确认 `game.run_local`,确认后只能复用白名单 `game.static_smoke` 自检当前 `game/index.html`,通过后启动 `127.0.0.1` 本地 HTTP 预览。独立执行 `game.static_smoke` 时如果已有 `.agent/run.latest.json`,必须追加 `Playtest / game.static_smoke` trace step,避免“运行了代码但编排 trace 不可见”。
- 2026-06-25 调整:普通用户通过聊天输入 `/trace` 触发只读 `agent.trace_read`,读取 `.agent/run.latest.json` 并在聊天里摘要 loop 轮次、stopReason、nextStep、active / carry-over 任务、repairRoutes、agent 建议命令和最近 step。trace 面板仍只在开发窗口展示,普通用户窗口不新增面板。
File diff suppressed because one or more lines are too long