完善Agent受控命令与推理配置

新增受控 command.exec 固定程序、参数策略、隔离环境和有界审计
接入项目 revision、验证资格、确认动作复核与失败核对门禁
支持全局及每 Agent 独立推理档位并提供发布默认配置
补齐前端配置、共享契约、Runtime 回归和真实 Provider 验收
同步开发流程、技术方案与项目共享决策记录
This commit is contained in:
AIGameCreator App
2026-07-12 23:22:11 +08:00
parent 5e627a4677
commit 49ea9eec67
18 changed files with 4068 additions and 111 deletions
@@ -17,6 +17,13 @@ import {
describe('AI 游戏创作 App 共享契约', () => {
it('keeps command permissions explicit', () => {
const commandIds = GAME_CREATION_APP_COMMANDS.map((command) => command.id);
expect(GAME_CREATION_APP_COMMANDS).toHaveLength(52);
expect(commandIds).toContain('command.exec');
expect(commandIds.indexOf('command.exec')).toBe(
commandIds.indexOf('command.run_limited') + 1,
);
expect(
GAME_CREATION_APP_COMMANDS.find((command) => command.id === 'help.show')
?.permission,
@@ -26,6 +33,11 @@ describe('AI 游戏创作 App 共享契约', () => {
(command) => command.id === 'command.run_limited',
)?.permission,
).toBe('confirm');
expect(
GAME_CREATION_APP_COMMANDS.find(
(command) => command.id === 'command.exec',
)?.permission,
).toBe('confirm');
expect(
GAME_CREATION_APP_COMMANDS.find(
(command) => command.id === 'project.verify',
@@ -162,6 +174,7 @@ describe('AI 游戏创作 App 共享契约', () => {
(capability) => capability.id,
);
expect(GAME_CREATION_AGENT_CAPABILITIES).toHaveLength(32);
expect(capabilityIds).toEqual(
expect.arrayContaining([
'chat',
@@ -186,8 +199,19 @@ describe('AI 游戏创作 App 共享契约', () => {
'canvas-project-sync',
'local-preview',
'developer-window',
'command-exec',
]),
);
expect(
GAME_CREATION_AGENT_CAPABILITIES.find(
(capability) => capability.id === 'command-exec',
),
).toEqual({
id: 'command-exec',
area: 'dev-runtime',
title:
'受控命令执行(固定 program + argv、非 shell、项目内 cwd、有界输出)',
});
expect(
GAME_CREATION_AGENT_CAPABILITIES.find(
(capability) => capability.id === 'conversation-history',
@@ -54,6 +54,7 @@ export const GAME_CREATION_APP_COMMANDS = [
{ id: 'preview.stop', permission: 'auto' },
{ id: 'preview.status', permission: 'auto' },
{ id: 'command.run_limited', permission: 'confirm' },
{ id: 'command.exec', permission: 'confirm' },
{ id: 'canvas.project_open', permission: 'confirm' },
{ id: 'canvas.project_sync', permission: 'confirm' },
{ id: 'canvas.asset_import', permission: 'confirm' },
@@ -149,6 +150,12 @@ export const GAME_CREATION_AGENT_CAPABILITIES = [
},
{ id: 'developer-window', area: 'dev-runtime', title: '开发窗口' },
{ id: 'persistent-runner', area: 'dev-runtime', title: '独立持久 Runner' },
{
id: 'command-exec',
area: 'dev-runtime',
title:
'受控命令执行(固定 program + argv、非 shell、项目内 cwd、有界输出)',
},
{ id: 'guardrails', area: 'dev-runtime', title: '权限 Gate' },
{ id: 'project-policy', area: 'dev-runtime', title: '项目级权限策略' },
{ id: 'trace-log', area: 'dev-runtime', title: '执行日志' },