补充Agent对话与继续草稿入口
新增对话读写策略确认草稿入口 新增Agent继续说明草稿入口 补充用户面快捷入口测试 同步AI游戏创作App技术方案和共享决策记录
This commit is contained in:
@@ -9479,6 +9479,24 @@ export function App() {
|
||||
>
|
||||
Agent确认
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
disabled={!localProject}
|
||||
onClick={() =>
|
||||
prepareChatCommandDraft('/policy-confirm conversation.read')
|
||||
}
|
||||
>
|
||||
读对话确认
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
disabled={!localProject}
|
||||
onClick={() =>
|
||||
prepareChatCommandDraft('/policy-confirm conversation.write')
|
||||
}
|
||||
>
|
||||
存对话确认
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
disabled={!localProject}
|
||||
@@ -9894,6 +9912,13 @@ export function App() {
|
||||
>
|
||||
继续
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
disabled={!localProject}
|
||||
onClick={() => prepareChatCommandDraft('/agent-resume ')}
|
||||
>
|
||||
继续说明
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
disabled={!localProject}
|
||||
|
||||
@@ -247,6 +247,20 @@ describe('AI 游戏创作 App 界面边界', () => {
|
||||
(screen.getByRole('button', { name: 'Agent确认' }) as HTMLButtonElement)
|
||||
.disabled,
|
||||
).toBe(true);
|
||||
expect(
|
||||
(
|
||||
screen.getByRole('button', {
|
||||
name: '读对话确认',
|
||||
}) as HTMLButtonElement
|
||||
).disabled,
|
||||
).toBe(true);
|
||||
expect(
|
||||
(
|
||||
screen.getByRole('button', {
|
||||
name: '存对话确认',
|
||||
}) as HTMLButtonElement
|
||||
).disabled,
|
||||
).toBe(true);
|
||||
expect(
|
||||
(screen.getByRole('button', { name: 'Trace' }) as HTMLButtonElement)
|
||||
.disabled,
|
||||
@@ -343,6 +357,10 @@ describe('AI 游戏创作 App 界面边界', () => {
|
||||
(screen.getByRole('button', { name: '继续' }) as HTMLButtonElement)
|
||||
.disabled,
|
||||
).toBe(true);
|
||||
expect(
|
||||
(screen.getByRole('button', { name: '继续说明' }) as HTMLButtonElement)
|
||||
.disabled,
|
||||
).toBe(true);
|
||||
expect(
|
||||
(screen.getByRole('button', { name: '输出' }) as HTMLButtonElement)
|
||||
.disabled,
|
||||
@@ -1920,6 +1938,16 @@ describe('AI 游戏创作 App 界面边界', () => {
|
||||
'value',
|
||||
'/policy-confirm agent.run_status',
|
||||
);
|
||||
fireEvent.click(screen.getByRole('button', { name: '读对话确认' }));
|
||||
expect(composerInput).toHaveProperty(
|
||||
'value',
|
||||
'/policy-confirm conversation.read',
|
||||
);
|
||||
fireEvent.click(screen.getByRole('button', { name: '存对话确认' }));
|
||||
expect(composerInput).toHaveProperty(
|
||||
'value',
|
||||
'/policy-confirm conversation.write',
|
||||
);
|
||||
expect(screen.queryByText('project.policy_write')).toBeNull();
|
||||
expect(invoke).not.toHaveBeenCalledWith(
|
||||
'write_project_permission_policy',
|
||||
@@ -14929,6 +14957,9 @@ describe('AI 游戏创作 App 界面边界', () => {
|
||||
detail: undefined,
|
||||
});
|
||||
});
|
||||
const composerInput = screen.getByLabelText('创作想法');
|
||||
fireEvent.click(screen.getByRole('button', { name: '继续说明' }));
|
||||
expect(composerInput).toHaveProperty('value', '/agent-resume ');
|
||||
});
|
||||
|
||||
it('requires project policy confirmation before reading agent run status from the panel', async () => {
|
||||
|
||||
@@ -3854,6 +3854,7 @@
|
||||
- 2026-06-25 调整:`project.create` 成功后的 durable 权限证据必须在聊天 `/project` 和开发窗口初始化两条入口统一写入 `.agent/logs/command.log`,避免同一能力因为入口不同导致 `/audit` 或开发排障证据不一致。
|
||||
- 2026-06-25 调整:`.agent/run.latest.json` 和 `.agent/runs/<runId>.json` 必须记录 loop 的 `maxPasses` 与 `stopReason`,开发窗口直接展示该状态,避免只从 summary 文案推断 loop 是否跑满、通过、返工、写入产物或进入预览。本地 HTTP 预览的 `/` 映射到 `game/index.html`,路径解析必须 canonicalize 项目根目录和目标文件,只允许访问项目内 `game/` 与 `assets/`,拒绝 `memory/`、`.agent/`、`exports/`、`..`、反斜杠和符号链接越界;常见图片、音频、视频和 Web 资源必须返回对应 MIME。这样上传和画板回流资产能被生成游戏引用,但记忆、trace 和导出包不会被预览服务暴露。
|
||||
- 2026-06-26 调整,2026-07-03 更新:AI 游戏创作 App 借鉴 Harbour 的控制平面思想,但不搬 Harbour 后台。最近 run 在 `.agent/run.latest.json` 增加可选 `lifecycleStatus`,并通过 `/agent-status`、`/agent-kill`、`/agent-retry`、`/agent-resume [说明]` 控制本地生命周期,写入 `.agent/activity.jsonl`、`.agent/output.jsonl` 和 `.agent/context.bundle.json`;聊天里的状态 / 控制结果可填入 `/read .agent/output.jsonl` 草稿继续查看 run 输出,但不直接读取文件或绕过 `file.read` 策略。v1 的 kill/retry/resume 只更新本地状态和上下文包,不伪装成能中断已发出的上游 LLM 请求;后续引入独立 runner 后再把 `pending` 接入 claim。
|
||||
- 2026-07-03 调整:主窗口 Agent 状态栏新增“继续说明”,只把 `/agent-resume ` 填入聊天输入框,让用户补充说明后再走原确认流;策略快捷入口新增 conversation.read / conversation.write 确认草稿,同样只填输入框,不直接写 `.agent/policy.json`。
|
||||
- 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
Reference in New Issue
Block a user