Compare commits

..

54 Commits

Author SHA1 Message Date
kdletters 4a46f89c9b 接入 AGC 内置插件宿主并补齐 Cocos 编辑器能力 (#338)
Project CI / Repository checks (push) Successful in 2m45s
Project CI / Frontend tests (push) Successful in 3m27s
Project CI / Backend tests (push) Successful in 6m18s
Project CI / Native shell tests (push) Failing after 13m52s
客户端新增随包提供的插件宿主和 Cocos Creator 集成:识别并导入 Cocos 项目,通过内置桥接操作已打开的编辑器,无需安装项目 MCP 扩展。DirectProject 现在公开 36 个独立 cocos_* 工具,保留通用 JavaScript 执行入口。

- 通用插件 SDK、命令/能力/面板注册、编辑器适配器和跨进程内置插件开关。
- Cocos 场景、节点、组件、Prefab、UI、Layout/Widget、资源、保存、撤销、日志与预览调试;目录和实现由 JS/native 共用。
- 编辑事务回读、失败回滚、后续手动修改保护及不确定结果禁止重放;预览截图通过 MCP image 返回。
- DirectProject 跳过无关专业 Agent 历史,将项目打开和历史读取中的同步 I/O 移出窗口线程,消除 Cocos 执行与项目文件锁的错误耦合。

验证:
- 合并 master 后:类型/配置检查、编码检查、Rust 格式检查和提交钩子通过。
- 合并 master 后:Cocos 项目打开、插件面板和开发启动定向测试 10 通过、2 跳过;DirectProject MCP 测试 17 通过、1 项真实 Creator opt-in 忽略;插件宿主测试 9/9。
- 插件行为测试 17/17;native 测试 20/20,4 项 opt-in 测试默认忽略。
- 真实 Creator 3.8.8 的 36/36 操作 smoke,以及客户端 MCP tools/list、tools/call、UI/撤销和预览截图,在功能实现阶段已验证通过;本次 master 合并后未重复真实 GUI smoke。

验证边界:发行安装包和远端 CI 尚未验收。

Reviewed-on: #338
Co-authored-by: kdletters <kdletters@qq.com>
Co-committed-by: kdletters <kdletters@qq.com>
2026-09-13 14:48:55 +08:00
kdletters b12a81e9c2 修复 AGC 自主运行时测试目录权限与任务目录加固
Project CI / Repository checks (push) Successful in 2m47s
Project CI / Frontend tests (push) Successful in 3m15s
Project CI / Backend tests (push) Successful in 7m12s
Project CI / Native shell tests (push) Failing after 13m9s
恢复 relaxed autonomous lane 的美术工具与写入门禁旁路

统一 Runtime 任务与事件目录的安全创建和校验

测试临时目录在 Windows 下初始化当前用户 owner
2026-09-12 20:31:43 +08:00
lhk229 3f69ce8bb7 Merge pull request '重构策划agent,接入新工作流+harness' (#322) from design_agent_refactor into master
Project CI / Repository checks (push) Successful in 2m33s
Project CI / Frontend tests (push) Successful in 3m18s
Project CI / Backend tests (push) Successful in 6m13s
Project CI / Native shell tests (push) Successful in 17m28s
Reviewed-on: https://git.genarrative.world/git/GenarrativeAI/Genarrative/pulls/322
2026-09-12 16:10:07 +08:00
lhk229 2e87a1403a 自动隔离损坏的策划会话并修复 CI
Project CI / Repository checks (pull_request) Successful in 2m40s
Project CI / Frontend tests (pull_request) Successful in 3m20s
Project CI / Backend tests (pull_request) Successful in 6m3s
Project CI / Native shell tests (pull_request) Successful in 17m48s
会话读取损坏时自动备份并允许项目继续打开

登记会话重置命令并补齐 Native shell 配置检查
2026-09-12 07:48:07 +00:00
lhk229 f505d2792f 允许损坏策划会话降级打开项目
Project CI / Repository checks (pull_request) Successful in 2m34s
Project CI / Frontend tests (pull_request) Successful in 3m12s
Project CI / Native shell tests (pull_request) Failing after 4m5s
Project CI / Backend tests (pull_request) Successful in 5m51s
会话读取失败时保留工作台与产物访问能力

新增策划会话备份重置命令,不删除工作区产物
2026-09-12 07:33:49 +00:00
lhk229 74fad546ff 增加 Responses 槽位安全保险丝
拒绝超出 4096 的 output_index,避免异常上游输入触发巨额扩容

补充安全边界测试且不限制正常输出内容
2026-09-12 07:17:16 +00:00
lhk229 16a6cdaf79 修复策划审批回调跨项目污染
为审批响应增加项目路径与请求身份校验

防止旧项目回调覆盖当前会话并清理新项目状态
2026-09-12 07:11:40 +00:00
lhk229 832f1e8b59 修复策划项目重开运行态恢复
Project CI / Repository checks (pull_request) Successful in 2m17s
Project CI / Frontend tests (pull_request) Successful in 3m8s
Project CI / Backend tests (pull_request) Successful in 7m46s
Project CI / Native shell tests (pull_request) Successful in 19m52s
持久化策划项目 design 运行模式并在重开时恢复 design/game 工作台。

补充旧策划会话兼容判断、前端夹具和恢复回归测试。
2026-09-12 06:41:49 +00:00
suzmii 281e6ccf48 Merge branch 'master' into design_agent_refactor
Project CI / Repository checks (pull_request) Successful in 2m31s
Project CI / Frontend tests (pull_request) Successful in 3m5s
Project CI / Backend tests (pull_request) Successful in 6m27s
Project CI / Native shell tests (pull_request) Successful in 20m9s
2026-09-12 14:25:29 +08:00
lhk229 013c756b9e Merge pull request 'CI 偶发失败修复:独立 crate 的 crates.io 预热缺口与两条用例自身缺陷' (#328) from fix/ci-flaky-and-crates-io-fetch into master
Project CI / Repository checks (push) Successful in 2m42s
Project CI / Frontend tests (push) Successful in 3m28s
Project CI / Backend tests (push) Successful in 7m1s
Project CI / Native shell tests (push) Successful in 20m19s
Reviewed-on: https://git.genarrative.world/git/GenarrativeAI/Genarrative/pulls/328
Reviewed-by: 孔令弘 <ink29535@proton.me>
2026-09-12 14:23:46 +08:00
lhk229 e602d3b420 Merge branch 'master' into fix/ci-flaky-and-crates-io-fetch
Project CI / Repository checks (pull_request) Successful in 2m38s
Project CI / Frontend tests (pull_request) Successful in 3m23s
Project CI / Backend tests (pull_request) Successful in 13m24s
Project CI / Native shell tests (pull_request) Successful in 23m40s
2026-09-12 13:56:23 +08:00
lhk229 a4373d7494 修正策划资源文档引用路径
Project CI / Repository checks (pull_request) Successful in 2m38s
Project CI / Frontend tests (pull_request) Successful in 3m15s
Project CI / Backend tests (pull_request) Successful in 6m44s
Project CI / Native shell tests (pull_request) Successful in 17m36s
将阶段 Skill 和系统模块中的旧附件名称统一为资源逻辑路径。

修正模板、范例、系统总纲及模块配套文件引用。
2026-09-12 05:28:26 +00:00
lhk229 34616e1631 修复 CI 调试工作区测试
Project CI / Repository checks (pull_request) Successful in 2m42s
Project CI / Frontend tests (pull_request) Successful in 3m15s
Project CI / Backend tests (pull_request) Successful in 7m2s
Project CI / Native shell tests (pull_request) Successful in 19m28s
格式化 design runtime 调试命令

为 debug fixture 测试显式开启并清理 debug 环境变量
2026-09-12 05:21:21 +00:00
lhk229 226cfbc8a1 Merge branch 'master' into design_agent_refactor
Project CI / Repository checks (pull_request) Failing after 1m19s
Project CI / Frontend tests (pull_request) Failing after 2m23s
Project CI / Native shell tests (pull_request) Failing after 4m42s
Project CI / Backend tests (pull_request) Successful in 6m50s
2026-09-12 13:10:41 +08:00
lhk229 8853e3b48e 完善策划调试入口与顾问态切换
Project CI / Repository checks (pull_request) Failing after 16s
Project CI / Backend tests (pull_request) Failing after 16s
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
统一策划 Debug 日志、快速推进按钮和快速推进命令的开关。

将做成游戏入口放到顾问阶段条末尾并接入正常运行时切换。

登记策划产物资产并补充工作区调试入口测试与技术文档。
2026-09-12 05:06:48 +00:00
lhk229 22c4807612 删除策划对话栏未接通的文件浏览死接线
Project CI / Repository checks (pull_request) Successful in 2m21s
Project CI / Frontend tests (pull_request) Successful in 2m56s
Project CI / Backend tests (pull_request) Successful in 5m52s
Project CI / Native shell tests (pull_request) Successful in 17m55s
DesignAgentSurface 移除从未消费的 files 与预览 props

ProjectSupervisorView 同步移除死 props 声明与透传

App 移除 designWorkspaceFiles 等状态与 refreshDesignWorkspace,每轮策划事件不再多打一次 list_design_workspace
2026-09-12 09:44:09 +08:00
lhk229 86adaa738f 修复策划首轮错 lane 挂载导致 Agent 不工作
Project CI / Repository checks (pull_request) Successful in 2m38s
Project CI / Backend tests (pull_request) Successful in 6m24s
Project CI / Frontend tests (pull_request) Successful in 3m19s
Project CI / Native shell tests (pull_request) Successful in 17m51s
运行模式改为随项目上下文同步派生,移除 effect 后置修正

做成游戏切换记录按项目路径与创建时间定位,跨项目自动失效

消除首帧游戏运行时挂载消耗首轮 claim 后策划实例无法补发的问题
2026-09-12 00:48:02 +08:00
lhk229 c2f2b9867a 修复策划项目首轮运行模式初始化
Project CI / Repository checks (pull_request) Successful in 3m23s
Project CI / Frontend tests (pull_request) Successful in 3m34s
Project CI / Backend tests (pull_request) Successful in 8m44s
Project CI / Native shell tests (pull_request) Successful in 19m35s
规划项目首次挂载时保持 planning lane

保留切换游戏运行态后的 DirectProject 分流
2026-09-11 13:32:18 +00:00
lhk229 d77d0ca9eb 修复顾问态切换游戏后的策划分流
Project CI / Repository checks (pull_request) Failing after 2m39s
Project CI / Frontend tests (pull_request) Failing after 2m57s
Project CI / Backend tests (pull_request) Successful in 6m46s
Project CI / Native shell tests (pull_request) Failing after 6m5s
统一 runtime mode 下的 planningStartMode

游戏运行态拒绝策划 Agent 续轮与阶段审批

补充游戏态运行时守卫测试
2026-09-11 13:11:03 +00:00
lhk229 5646824daf 补充策划Agent思考展示预留
增加策划 Agent reasoningText 事件字段与默认折叠展示入口

补充正文、思考过程和工具状态的字体层级样式

记录当前 Provider 尚未输出 reasoning 的现状与后续边界
2026-09-11 13:02:55 +00:00
lhk229 d9530047db 兼容缺少槽位的非工具 Responses 事件
Project CI / Repository checks (pull_request) Successful in 2m41s
Project CI / Frontend tests (pull_request) Successful in 3m13s
Project CI / Backend tests (pull_request) Successful in 6m10s
Project CI / Native shell tests (pull_request) Successful in 19m54s
非 function_call output item 缺少 output_index 时忽略

保留 function_call 槽位缺失的 fail-closed 契约并补回归测试
2026-09-11 12:33:37 +00:00
lhk229 8012008d83 替换文档占位符
Project CI / Repository checks (pull_request) Successful in 2m24s
Project CI / Frontend tests (pull_request) Successful in 2m45s
Project CI / Backend tests (pull_request) Successful in 6m5s
Project CI / Native shell tests (pull_request) Successful in 18m40s
2026-09-11 12:22:46 +00:00
lhk229 8528c5ffce 修复直接创作首轮消息被误抑制
Project CI / Repository checks (pull_request) Successful in 2m26s
Project CI / Frontend tests (pull_request) Successful in 3m2s
Project CI / Backend tests (pull_request) Successful in 5m38s
Project CI / Native shell tests (pull_request) Successful in 19m38s
仅在顾问态切换到 GameAgent 时禁止自动首轮调用

恢复普通直接创作入口的初始需求投递
2026-09-11 12:12:24 +00:00
lhk229 3047434b33 接入策划顾问态做成游戏运行时切换
Project CI / Frontend tests (pull_request) Failing after 2m24s
Project CI / Repository checks (pull_request) Failing after 2m42s
Project CI / Native shell tests (pull_request) Failing after 5m45s
Project CI / Backend tests (pull_request) Successful in 6m46s
新增项目 Agent 运行时模式持久化与恢复判断

在顾问态增加做成游戏按钮并切换同项目 DirectProject

切换时不自动发起首轮 Provider 请求
2026-09-11 12:01:38 +00:00
lhk229 f8f1cdd1f4 清理未使用的策划会话入口
Project CI / Repository checks (pull_request) Successful in 2m46s
Project CI / Frontend tests (pull_request) Successful in 3m20s
Project CI / Backend tests (pull_request) Successful in 5m46s
Project CI / Native shell tests (pull_request) Successful in 17m26s
删除硬编码 quality 模型的 ensure_design_session

保留现有 selected_model_id 创建链路
2026-09-11 11:28:47 +00:00
lhk229 1102b5af23 Merge remote-tracking branch 'origin/master' into design_agent_refactor
Project CI / Repository checks (pull_request) Successful in 2m24s
Project CI / Frontend tests (pull_request) Successful in 3m13s
Project CI / Backend tests (pull_request) Successful in 6m15s
Project CI / Native shell tests (pull_request) Successful in 18m32s
2026-09-11 11:22:29 +00:00
lhk229 fd5a4c3136 调整策划调试日志默认开关
Project CI / Repository checks (pull_request) Failing after 13s
Project CI / Backend tests (pull_request) Failing after 13s
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
npm run agc 开发启动时默认开启 design debug

其他启动方式默认不创建 .debug 目录
2026-09-11 11:21:07 +00:00
lhk229 63f5a1d49e 精简项目写锁历史型注释
Project CI / Backend tests (pull_request) Failing after 15s
Project CI / Repository checks (pull_request) Failing after 15s
Project CI / Frontend tests (pull_request) Successful in 2m51s
Project CI / Native shell tests (pull_request) Successful in 18m39s
移除 Issue 编号和旧实现叙述

保留写锁等待与排障契约说明
2026-09-11 11:10:57 +00:00
lhk229 811abdd375 修复策划 Agent 四个审查问题
Project CI / Repository checks (pull_request) Failing after 15s
Project CI / Backend tests (pull_request) Failing after 15s
Project CI / Frontend tests (pull_request) Successful in 2m40s
Project CI / Native shell tests (pull_request) Successful in 17m42s
修复 Retry 流式回合身份与阶段审批 transient 清理

拒绝无效 write_file 内容并补齐顾问阶段导轨
2026-09-11 10:57:49 +00:00
lhk229 712f28e207 策划工作区改名为design_artifacts
Project CI / Repository checks (pull_request) Failing after 13s
Project CI / Backend tests (pull_request) Failing after 10s
Project CI / Frontend tests (pull_request) Successful in 3m20s
Project CI / Native shell tests (pull_request) Successful in 17m35s
更新策划文件工具和阶段产物检查路径

同步测试夹具与生产迁移方案文档
2026-09-11 10:16:15 +00:00
lhk229 d6a72c895c 修复策划项目命名相关 CI 检查
Project CI / Repository checks (pull_request) Successful in 2m47s
Project CI / Frontend tests (pull_request) Successful in 3m25s
Project CI / Backend tests (pull_request) Successful in 6m55s
Project CI / Native shell tests (pull_request) Successful in 20m14s
同步首页项目创建测试中的 planning 参数断言
格式化项目 Rust 测试文件以通过 rustfmt
2026-09-11 09:11:27 +00:00
suzmii 2c9e6fe272 修正 BGM 提示词助手限流用例的断言口径:只承诺客户端可见语义
Project CI / Repository checks (pull_request) Successful in 2m34s
Project CI / Frontend tests (pull_request) Successful in 3m4s
Project CI / Backend tests (pull_request) Successful in 6m32s
Project CI / Native shell tests (pull_request) Successful in 18m5s
- server-rs/crates/api-server/src/editor_background_music_prompt_assist.rs:consecutive_valid_requests_are_not_subject_to_a_feature_rate_limit
  的 assert_eq!(mock.finish().len(), 4) 改为「到达 provider 的请求不少于 4 次」,并在该断言失败时打印捕获到的请求原文

为什么新形态才是它真正承诺的语义:用例名只承诺「连续合法请求不被特性限流」,那是客户端可见口径;
本模块的简化路径本身允许一轮内容重试(同文件 simplification_retries_* 四条用例正是它的定向覆盖),
因此 provider 的精确调用次数是实现细节,把它钉死会让一次合法重试变成假红。
「4 次调用都到达 provider」与原有的 200/非 429 断言都保留:短路、提前拒绝、限流仍然会红。
根因见 #327 问题 2.2(PR #316 run 1950:left: 5, right: 4)。
2026-09-11 16:31:35 +08:00
suzmii f9e24f4e16 修复 bgfilter_worker 测试端口 TOCTOU:不再借用内核临时端口
- server-rs/crates/api-server/src/bgfilter_worker.rs:reserved_loopback_port 不再 bind("127.0.0.1:0") 取临时端口后 drop,
  改为在内核动态端口范围之外的固定测试带(20000-29999)内按进程内游标递增分配,并先探测可用性落点
- 同一文件:4 处调用点去掉不再需要的 .await(该 helper 现在是同步分配)

这样「先保持端口关闭、约 700ms 后才开始监听」的重启用例在整个空窗期内独占该端口,
重新 bind 不会再被同一测试二进制里其它用例的 bind(0) 抢走。
根因与证据见 #327 问题 2.1。本机 Windows 复现不出该抢占(动态端口范围 49152-65535,
连续 200 次 bind(0) 无一重复、也已实测刚释放的端口不被立即重新派发),它是 Linux 侧特性。
2026-09-11 16:31:17 +08:00
suzmii a6f5ab9d23 修复 Native shell 作业在测试阶段才解析 crates.io index 的缺口
- .gitea/workflows/project-ci.yml:Native shell tests 新增「Prepare standalone Rust crate dependencies」步骤,
  对被 server-rs workspace exclude 的 agent-runtime-core / agent-runtime-orchestration 先做 cargo fetch,
  把它们在测试阶段的 registry 解析与下载提前到依赖准备阶段;两 crate 未提交 Cargo.lock,故不能带 --locked
- scripts/project-ci-workflow.test.ts:新增用例钉住该步骤存在、覆盖两个独立 crate manifest、且命令不带锁标志

根因与影响见 #327:此前这两个 crate 只在 agent-runtime-*:check 中现场 `Updating crates.io index`,
crates.io 一抖动整条 native shell 作业就红(PR #316 run 1950)。
2026-09-11 16:18:43 +08:00
lhk229 e6e2a5fda6 调整策划项目命名
Project CI / Repository checks (pull_request) Failing after 2m57s
Project CI / Frontend tests (pull_request) Failing after 7m44s
Project CI / Backend tests (pull_request) Successful in 8m6s
Project CI / Native shell tests (pull_request) Failing after 4m31s
策划入口使用带随机短码的策划项目名称

保留游戏与素材入口的现有命名链路

补充自动建项测试与技术方案说明
2026-09-11 07:35:41 +00:00
lhk229 123c699db9 修复策划澄清卡自由文本回答
Project CI / Repository checks (pull_request) Successful in 5m25s
Project CI / Frontend tests (pull_request) Successful in 6m36s
Project CI / Backend tests (pull_request) Successful in 29m4s
Project CI / Native shell tests (pull_request) Successful in 33m51s
将自由文本与选项回答分开提交

补充澄清卡回归测试和迁移方案说明
2026-09-11 06:44:47 +00:00
lhk229 f2f786d69b 修复策划 Agent 模型选择链路
保存策划会话的模型目录 ID并交由 api-server 解析

移除官方直连路径的固定模型并补齐 AGC 客户端标记
2026-09-11 05:51:35 +00:00
lhk229 8444dee9e9 优化策划工作区后台刷新体验
Project CI / Repository checks (pull_request) Successful in 2m36s
Project CI / Frontend tests (pull_request) Successful in 3m27s
Project CI / Native shell tests (pull_request) Successful in 20m41s
Project CI / Backend tests (pull_request) Successful in 22m53s
合并 Agent 工具事件并避免刷新时清空文件树

仅首次打开和手动刷新显示加载状态
2026-09-11 05:28:05 +00:00
lhk229 26169102a0 修复策划工作区文件树显示
Project CI / Repository checks (pull_request) Successful in 2m44s
Project CI / Frontend tests (pull_request) Successful in 3m32s
Project CI / Backend tests (pull_request) Successful in 6m21s
Project CI / Native shell tests (pull_request) Successful in 18m20s
改用可展开的层级目录树显示文件

保留相对路径读取并修复目录内产物不可见问题
2026-09-11 05:16:39 +00:00
lhk229 87711e4034 修复策划审批按钮的界面测试回归
Project CI / Repository checks (pull_request) Successful in 3m5s
Project CI / Frontend tests (pull_request) Successful in 3m54s
Project CI / Backend tests (pull_request) Successful in 6m38s
Project CI / Native shell tests (pull_request) Successful in 17m51s
补齐批准和继续修改按钮的无障碍名称

同步审批按钮文档并通过 389 个界面用例
2026-09-11 04:03:21 +00:00
lhk229 fd09f61473 修复策划工作台输入框布局
Project CI / Frontend tests (pull_request) Failing after 2m16s
Project CI / Repository checks (pull_request) Failing after 2m27s
Project CI / Backend tests (pull_request) Successful in 6m58s
Project CI / Native shell tests (pull_request) Failing after 4m45s
让策划聊天消息区只占用剩余空间

确保输入框在工作台底部持续可见
2026-09-11 03:52:34 +00:00
lhk229 9345236b93 重构策划 Agent 工作台界面
Project CI / Frontend tests (pull_request) Failing after 3m19s
Project CI / Repository checks (pull_request) Failing after 3m25s
Project CI / Native shell tests (pull_request) Failing after 6m54s
Project CI / Backend tests (pull_request) Successful in 7m20s
新增始终可见的策划工作区与文件预览

复用 GameAgent 双栏布局并调整审批澄清交互

审批按钮改为文字与图标并保留现有 Runtime 行为
2026-09-11 03:34:56 +00:00
lhk229 7484764024 Merge remote-tracking branch 'web/design_agent_refactor' into design_agent_refactor
Project CI / Repository checks (pull_request) Successful in 3m8s
Project CI / Frontend tests (pull_request) Successful in 4m3s
Project CI / Backend tests (pull_request) Successful in 6m54s
Project CI / Native shell tests (pull_request) Successful in 18m8s
2026-09-11 02:49:02 +00:00
lhk229 782fa77950 Merge branch 'master' into design_agent_refactor
Project CI / Repository checks (pull_request) Successful in 3m43s
Project CI / Frontend tests (pull_request) Successful in 4m37s
Project CI / Backend tests (pull_request) Successful in 7m30s
Project CI / Native shell tests (pull_request) Successful in 18m45s
2026-09-10 23:50:49 +08:00
lhk229 8a93d69590 流式 Responses 从增量事件累积原生 output
completed 未带 output 时保留 output_item 与工具参数
补空 completed 与顶层 output 的回放测试并记录排障
2026-09-10 12:21:59 +00:00
lhk229 bb010b4b1e 清理策划文档空白以通过仓库检查
Project CI / Repository checks (pull_request) Successful in 2m52s
Project CI / Frontend tests (pull_request) Successful in 3m17s
Project CI / Backend tests (pull_request) Successful in 5m39s
Project CI / Native shell tests (pull_request) Successful in 18m32s
去掉 system-prompt 文件末多余空行
去掉迁移方案标题下的行尾空格
2026-09-10 11:48:37 +00:00
lhk229 5d24301ef5 修复策划样式插入导致 Tailwind 解析失败
Project CI / Frontend tests (pull_request) Successful in 3m22s
Project CI / Backend tests (pull_request) Successful in 6m2s
Project CI / Repository checks (pull_request) Failing after 2m34s
Project CI / Native shell tests (pull_request) Successful in 17m37s
把阶段进度 span 颜色补回原规则
删除 design-agent 预览后的孤儿声明
2026-09-10 11:40:52 +00:00
lhk229 36dc93222a 合并最新 master
Project CI / Frontend tests (pull_request) Successful in 3m23s
Project CI / Backend tests (pull_request) Successful in 5m41s
Project CI / Native shell tests (pull_request) Failing after 15m24s
Project CI / Repository checks (pull_request) Has been cancelled
2026-09-10 11:19:35 +00:00
lhk229 54ae60576d 修复策划 Agent CI 回归
按 rustfmt 整理策划 Runtime 与相关测试字面量
首页做方案用例改为断言设计 Agent 命令
2026-09-10 11:19:24 +00:00
lhk229 a38eec743a 补齐 LlmRunRequest 字面量的 responses_input 字段
Project CI / Repository checks (pull_request) Failing after 1m18s
Project CI / Frontend tests (pull_request) Failing after 2m15s
Project CI / Native shell tests (pull_request) Failing after 4m59s
Project CI / Backend tests (pull_request) Successful in 6m10s
api-server LLM 代理与 platform-agent 适配器补 None
避免 cargo run api-server 因缺字段编不过
2026-09-10 10:59:13 +00:00
lhk229 18ed9778d8 拆分策划 Agent 与 Codex 随包清单
Project CI / Repository checks (pull_request) Failing after 53s
Project CI / Frontend tests (pull_request) Failing after 2m17s
Project CI / Backend tests (pull_request) Failing after 3m39s
Project CI / Native shell tests (pull_request) Failing after 3m54s
将 design-agent 资源包放到全平台 Tauri 基础配置
Windows 配置只保留 pinned Codex sidecar
配置门禁分别校验两份清单,禁止互相混入
2026-09-10 10:28:07 +00:00
lhk229 af96174e07 接入策划 Agent 脚本化假 Provider 定向测试
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
拦截测试态 Provider 请求,按队列返回脚本响应或错误
覆盖五阶段推进、审批拒绝不唤醒、重启恢复、资源与工具失败及瞬态重试
同步迁移方案第 8 步验证口径
2026-09-10 09:42:26 +00:00
lhk229 cb79c4a9c6 对齐策划入口测试到新设计 Agent
Project CI / Repository checks (pull_request) Failing after 6m22s
Project CI / Frontend tests (pull_request) Failing after 6m48s
Project CI / Native shell tests (pull_request) Failing after 9m54s
Project CI / Backend tests (pull_request) Failing after 16m19s
新建策划入口走设计会话命令,已有 V2 会话仍走原链路
补审批与澄清卡界面用例
2026-09-10 09:09:37 +00:00
lhk229 aaa52c2b34 接入策划 Agent 生产迁移初版
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
新增独立设计会话、工作区工具和随包资源
platform-llm 支持 Responses 原生 input 续轮
无旧 V2 会话的策划入口切换到新设计 Agent
增加阶段审批、澄清卡和工作区文件浏览
同步迁移方案与决策记录
2026-09-10 08:45:11 +00:00
222 changed files with 27885 additions and 535 deletions
+31
View File
@@ -232,6 +232,37 @@ jobs:
done done
done done
- name: Prepare standalone Rust crate dependencies
shell: bash
run: |
set -euo pipefail
# agent-runtime-core / agent-runtime-orchestration 被 server-rs/Cargo.toml 的
# exclude 排除,不参与上面的 workspace 锁文件,因此上面那次锁定 fetch 覆盖不到它们;
# 而 check:native-shells 会经 agent-runtime-*:check 用 `cargo test --manifest-path`
# 单独跑这两个 crate。不在这里预热的话,这两条测试会在测试阶段自己
# `Updating crates.io index`crates.io 一抖动整条 native shell 作业就红
# (见 #327 / PR #316 run 1950)。
# 两个 crate 都没有提交 Cargo.lock,所以这里只能做不带锁标志的 fetch:
# 加锁标志会因为缺少锁文件直接失败。生成的 Cargo.lock 落在两个 crate 目录内,
# 已被各自的 .gitignore 忽略,只留在容器里;随后的测试阶段因此能用锁定版本
# 解析,不再触碰 registry index。
for manifest_path in \
server-rs/crates/agent-runtime-core/Cargo.toml \
server-rs/crates/agent-runtime-orchestration/Cargo.toml; do
for attempt in $(seq 1 5); do
if cargo fetch \
--target x86_64-unknown-linux-gnu \
--manifest-path "${manifest_path}"; then
break
fi
if [[ "${attempt}" -eq 5 ]]; then
echo "standalone crate dependency fetch failed after 5 attempts: ${manifest_path}" >&2
exit 1
fi
sleep $((attempt * 2))
done
done
- name: Run native shell gates - name: Run native shell gates
run: npm run check:native-shells run: npm run check:native-shells
+2
View File
@@ -40,6 +40,8 @@ temp*build*/
/apps/ai-game-creator-shell/src-tauri/resources/codex/win-x64/codex-path/ /apps/ai-game-creator-shell/src-tauri/resources/codex/win-x64/codex-path/
/apps/ai-game-creator-shell/src-tauri/resources/codex/win-x64/codex-resources/ /apps/ai-game-creator-shell/src-tauri/resources/codex/win-x64/codex-resources/
/apps/ai-game-creator-shell/src-tauri/resources/codex/win-x64/codex-package.json /apps/ai-game-creator-shell/src-tauri/resources/codex/win-x64/codex-package.json
/apps/ai-game-creator-shell/src-tauri/resources/plugins/
/plugins/agc-cocos-editor/native/payload/
/apps/ai-game-creator-shell/logs/ /apps/ai-game-creator-shell/logs/
/apps/ai-game-creator-shell/.llm-drafts/ /apps/ai-game-creator-shell/.llm-drafts/
/apps/ai-game-creator-shell/game-creator.config.local.json /apps/ai-game-creator-shell/game-creator.config.local.json
+4
View File
@@ -0,0 +1,4 @@
# resources/plugins 由 build.rs 从 plugins/ 复制生成,属于构建产物。
# 它在 dev 监听范围内,重新生成会让 Tauri dev 误判为源码改动而触发
# “构建 -> 监听 -> 再构建”的自触发循环。
resources/plugins/
@@ -4,6 +4,11 @@ import fs from 'node:fs';
import path from 'node:path'; import path from 'node:path';
import { fileURLToPath } from 'node:url'; import { fileURLToPath } from 'node:url';
import {
defaultEditorFeatures,
withDefaultCargoFeatures,
} from './cargo-features.mjs';
const appRoot = fileURLToPath(new URL('..', import.meta.url)); const appRoot = fileURLToPath(new URL('..', import.meta.url));
const defaultReleaseTarget = 'x86_64-pc-windows-msvc'; const defaultReleaseTarget = 'x86_64-pc-windows-msvc';
const releaseTarget = const releaseTarget =
@@ -159,10 +164,30 @@ export async function prepareReleaseVersion() {
return nextVersion; return nextVersion;
} }
export function runTauriBuild(args = []) { export function buildTauriBuildArguments(
args = [],
target = releaseTarget,
platform = process.platform,
) {
const noBundle = args.includes('--no-bundle'); const noBundle = args.includes('--no-bundle');
const hasTarget = args.includes('--target'); const targetIndex = args.indexOf('--target');
const targetArgs = noBundle || hasTarget ? [] : ['--target', releaseTarget]; const explicitTarget =
targetIndex >= 0
? args[targetIndex + 1]
: args
.find((value) => value.startsWith('--target='))
?.slice('--target='.length);
const targetArgs = noBundle || explicitTarget ? [] : ['--target', target];
const features = defaultEditorFeatures(
explicitTarget || (noBundle ? platform : target),
);
return [
'build',
...withDefaultCargoFeatures([...targetArgs, ...args], features),
];
}
export function runTauriBuild(args = []) {
const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm'; const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm';
const result = spawnSync( const result = spawnSync(
npmCommand, npmCommand,
@@ -172,9 +197,7 @@ export function runTauriBuild(args = []) {
'exec', 'exec',
'tauri', 'tauri',
'--', '--',
'build', ...buildTauriBuildArguments(args),
...targetArgs,
...args,
], ],
{ cwd: appRoot, stdio: 'inherit', shell: process.platform === 'win32' }, { cwd: appRoot, stdio: 'inherit', shell: process.platform === 'win32' },
); );
@@ -0,0 +1,24 @@
/** 默认桌面能力;显式 feature 参数优先,不把应用参数当 Cargo 参数。 */
export function withDefaultCargoFeatures(argv, features) {
const separator = argv.indexOf('--');
const cargoArgs = separator < 0 ? argv : argv.slice(0, separator);
if (
!features.length ||
cargoArgs.some(
(value) =>
value === '--features' ||
value === '-f' ||
value.startsWith('--features=') ||
/^-f.+/u.test(value),
)
) {
return argv;
}
return [`--features=${features.join(',')}`, ...argv];
}
export function defaultEditorFeatures(target) {
return target === 'win32' || target.includes('windows')
? ['cocos-editor-execute']
: [];
}
@@ -0,0 +1,49 @@
import assert from 'node:assert/strict';
import { test } from 'node:test';
import { buildTauriBuildArguments } from './build-release.mjs';
import { withDefaultCargoFeatures } from './cargo-features.mjs';
test('Windows release includes the same editor feature as development', () => {
assert.deepEqual(
buildTauriBuildArguments([], 'x86_64-pc-windows-msvc', 'win32'),
[
'build',
'--features=cocos-editor-execute',
'--target',
'x86_64-pc-windows-msvc',
],
);
assert.deepEqual(
buildTauriBuildArguments(
['--no-bundle'],
'x86_64-pc-windows-msvc',
'linux',
),
['build', '--no-bundle'],
);
assert.deepEqual(
buildTauriBuildArguments(['--target=aarch64-apple-darwin']),
['build', '--target=aarch64-apple-darwin'],
);
});
test('explicit Cargo features override defaults in every supported spelling', () => {
for (const args of [
['--features', 'custom'],
['--features=custom'],
['-f', 'custom'],
['-fcustom'],
]) {
assert.deepEqual(
withDefaultCargoFeatures(args, ['cocos-editor-execute']),
args,
);
}
assert.deepEqual(
withDefaultCargoFeatures(
['--', '--features=app'],
['cocos-editor-execute'],
),
['--features=cocos-editor-execute', '--', '--features=app'],
);
});
@@ -114,9 +114,20 @@ const allowedUncalledTauriCommands = [
'open_game_creator_launcher_window', 'open_game_creator_launcher_window',
'open_game_creator_workspace_window', 'open_game_creator_workspace_window',
'read_direct_project_conversation', 'read_direct_project_conversation',
'reset_design_agent_session',
'stop_local_game_preview_if_matches', 'stop_local_game_preview_if_matches',
'start_game_creator_external_mcp', 'start_game_creator_external_mcp',
'stop_game_creator_external_mcp', 'stop_game_creator_external_mcp',
'list_agc_plugins',
'list_agc_extensions',
'refresh_agc_plugins',
'start_agc_plugin',
'stop_agc_plugin',
'reload_agc_plugin',
'call_agc_plugin',
'read_agc_plugin_panel',
'set_agc_plugin_project_path',
'set_agc_plugin_enabled',
]; ];
const sourceExtensions = new Set([ const sourceExtensions = new Set([
'.json', '.json',
@@ -1285,7 +1296,10 @@ if (tauriConfig.identifier !== 'world.genarrative.ai-game-creator') {
throw new Error('AI game creator shell identifier drifted'); throw new Error('AI game creator shell identifier drifted');
} }
const expectedBundledCodexResources = { const expectedBundledDesignAgentResources = {
'design-agent': 'design-agent',
};
const expectedBundledWindowsResources = {
'resources/codex/win-x64/bin/codex.exe': 'codex/win-x64/bin/codex.exe', 'resources/codex/win-x64/bin/codex.exe': 'codex/win-x64/bin/codex.exe',
'resources/codex/win-x64/bin/codex-code-mode-host.exe': 'resources/codex/win-x64/bin/codex-code-mode-host.exe':
'codex/win-x64/bin/codex-code-mode-host.exe', 'codex/win-x64/bin/codex-code-mode-host.exe',
@@ -1299,17 +1313,35 @@ const expectedBundledCodexResources = {
'codex/win-x64/codex-package.json', 'codex/win-x64/codex-package.json',
'resources/codex/win-x64/NOTICE.md': 'codex/win-x64/NOTICE.md', 'resources/codex/win-x64/NOTICE.md': 'codex/win-x64/NOTICE.md',
'resources/codex/win-x64/manifest.json': 'codex/win-x64/manifest.json', 'resources/codex/win-x64/manifest.json': 'codex/win-x64/manifest.json',
'resources/plugins': 'plugins',
}; };
if (tauriConfig.bundle?.resources !== undefined) { assert.deepEqual(
throw new Error( tauriConfig.bundle?.resources,
'AI game creator shell base Tauri config must not require Windows-only Codex resources', expectedBundledDesignAgentResources,
); 'AI game creator shell base Tauri config must bundle the design-agent resource pack',
);
for (const key of Object.keys(tauriConfig.bundle?.resources ?? {})) {
if (String(key).includes('codex')) {
throw new Error(
'AI game creator shell base Tauri config must not require Windows-only Codex resources',
);
}
} }
assert.deepEqual( assert.deepEqual(
windowsTauriConfig.bundle?.resources, windowsTauriConfig.bundle?.resources,
expectedBundledCodexResources, expectedBundledWindowsResources,
'AI game creator shell Windows Tauri config must bundle the complete pinned Codex resource set', 'AI game creator shell Windows Tauri config must bundle the complete pinned Codex resource set and Cocos bridge payload directory',
); );
if (
Object.prototype.hasOwnProperty.call(
windowsTauriConfig.bundle?.resources ?? {},
'design-agent',
)
) {
throw new Error(
'design-agent resource pack must not be mixed into the Windows Codex sidecar bundle',
);
}
if (windowsTauriConfig.bundle?.useLocalToolsDir !== true) { if (windowsTauriConfig.bundle?.useLocalToolsDir !== true) {
throw new Error( throw new Error(
'AI game creator shell Windows Tauri config must cache bundling tools in the project target directory', 'AI game creator shell Windows Tauri config must cache bundling tools in the project target directory',
@@ -436,6 +436,10 @@ function spawnChild(command, args, options, spawnImpl = spawn) {
const child = spawnImpl(command, args, { const child = spawnImpl(command, args, {
...options, ...options,
shell: useShell, shell: useShell,
// npm.cmd and the Windows shell otherwise create a visible console for
// every service in the dev stack. Their stdout/stderr is already inherited
// by the launcher, so no separate terminal window is useful.
windowsHide: process.platform === 'win32' ? true : options.windowsHide,
// POSIX 下让每个长驻服务拥有独立进程组,退出时可以连同 npm、 // POSIX 下让每个长驻服务拥有独立进程组,退出时可以连同 npm、
// Node、Cargo 及其子进程一起清理,避免残留订阅任务持续刷日志。 // Node、Cargo 及其子进程一起清理,避免残留订阅任务持续刷日志。
detached: isPosix, detached: isPosix,
@@ -1,6 +1,7 @@
import { resolve } from 'node:path'; import { resolve } from 'node:path';
import { fileURLToPath } from 'node:url'; import { fileURLToPath } from 'node:url';
import { withDefaultCargoFeatures } from './cargo-features.mjs';
import { import {
readAgcDevEndpoint, readAgcDevEndpoint,
resolveAgcDevEndpoint, resolveAgcDevEndpoint,
@@ -20,6 +21,10 @@ import {
const appRoot = fileURLToPath(new URL('..', import.meta.url)); const appRoot = fileURLToPath(new URL('..', import.meta.url));
const repoRoot = resolve(appRoot, '../..'); const repoRoot = resolve(appRoot, '../..');
const tauriCliPath = resolve(repoRoot, 'node_modules/@tauri-apps/cli/tauri.js'); const tauriCliPath = resolve(repoRoot, 'node_modules/@tauri-apps/cli/tauri.js');
const AGC_DESIGN_DEBUG_ENV = 'GENARRATIVE_AGC_DESIGN_DEBUG';
const AGC_DESIGN_DEBUG_VITE_ENV = 'VITE_GENARRATIVE_AGC_DESIGN_DEBUG';
const designDebugEnabled =
process.env[AGC_DESIGN_DEBUG_ENV]?.trim() === '0' ? '0' : '1';
function buildTauriArguments(argv, devUrl = readAgcDevEndpoint().url) { function buildTauriArguments(argv, devUrl = readAgcDevEndpoint().url) {
const args = [...argv]; const args = [...argv];
@@ -43,6 +48,24 @@ function buildTauriArguments(argv, devUrl = readAgcDevEndpoint().url) {
]; ];
} }
// `agc_cocos_execute` 与 Cocos 编辑器适配器只在 `cocos-editor-execute` feature 下
// 注册。开发构建默认在 Windows 打开它,否则 Agent 的工具清单里根本没有该工具,
// 只能退化成改写脚本。可用 AGC_DEV_CARGO_FEATURES(逗号分隔)覆盖,传空串即关闭。
function readDevCargoFeatures(env = process.env) {
const override = env.AGC_DEV_CARGO_FEATURES;
if (override !== undefined) {
return override
.split(',')
.map((value) => value.trim())
.filter(Boolean);
}
return process.platform === 'win32' ? ['cocos-editor-execute'] : [];
}
function withDevCargoFeatures(argv, features = readDevCargoFeatures()) {
return withDefaultCargoFeatures(argv, features);
}
function spawnTauriCli(argv, { env = process.env } = {}) { function spawnTauriCli(argv, { env = process.env } = {}) {
return spawnChild(process.execPath, [tauriCliPath, ...argv], { return spawnChild(process.execPath, [tauriCliPath, ...argv], {
cwd: appRoot, cwd: appRoot,
@@ -106,9 +129,16 @@ async function runTauriDev(
shutdownRequested.then(() => false), shutdownRequested.then(() => false),
]); ]);
if (!prepared || shutdownSignal) return 1; if (!prepared || shutdownSignal) return 1;
const tauriArguments = buildTauriArguments(argv, endpoint.url); const tauriArguments = buildTauriArguments(
withDevCargoFeatures(argv),
endpoint.url,
);
child = spawnCli(tauriArguments, { child = spawnCli(tauriArguments, {
env: withAgcDevEndpointEnv(endpoint), env: {
...withAgcDevEndpointEnv(endpoint),
[AGC_DESIGN_DEBUG_ENV]: designDebugEnabled,
[AGC_DESIGN_DEBUG_VITE_ENV]: designDebugEnabled,
},
}); });
const childResult = waitForCli(child); const childResult = waitForCli(child);
const outcome = await Promise.race([ const outcome = await Promise.race([
@@ -157,7 +187,13 @@ async function prepareFrontendDev(endpoint, { onChild, signal }) {
const frontend = spawnChild( const frontend = spawnChild(
process.platform === 'win32' ? 'npm.cmd' : 'npm', process.platform === 'win32' ? 'npm.cmd' : 'npm',
['run', 'agc:serve'], ['run', 'agc:serve'],
{ cwd: repoRoot, env: withAgcDevEndpointEnv(endpoint) }, {
cwd: repoRoot,
env: {
...withAgcDevEndpointEnv(endpoint),
[AGC_DESIGN_DEBUG_VITE_ENV]: designDebugEnabled,
},
},
); );
onChild(frontend); onChild(frontend);
console.log( console.log(
@@ -193,6 +229,7 @@ export {
isDirectModuleExecution, isDirectModuleExecution,
runTauriDev, runTauriDev,
spawnTauriCli, spawnTauriCli,
withDevCargoFeatures,
}; };
if (isDirectModuleExecution()) { if (isDirectModuleExecution()) {
@@ -0,0 +1,4 @@
# resources/plugins 由 build.rs 从 plugins/ 复制生成,属于构建产物。
# 它在 dev 监听范围内,重新生成会让 Tauri dev 误判为源码改动而触发
# “构建 -> 监听 -> 再构建”的自触发循环。
resources/plugins/
+25
View File
@@ -733,6 +733,20 @@ dependencies = [
"error-code", "error-code",
] ]
[[package]]
name = "cocos-editor-bridge"
version = "0.1.0"
dependencies = [
"cc",
"editor-adapter-api",
"reqwest 0.12.28",
"serde",
"serde_json",
"sha2",
"tungstenite",
"windows-sys 0.61.2",
]
[[package]] [[package]]
name = "combine" name = "combine"
version = "4.6.7" version = "4.6.7"
@@ -1205,6 +1219,14 @@ version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555"
[[package]]
name = "editor-adapter-api"
version = "0.1.0"
dependencies = [
"serde",
"serde_json",
]
[[package]] [[package]]
name = "either" name = "either"
version = "1.16.0" version = "1.16.0"
@@ -1709,6 +1731,8 @@ dependencies = [
"axum", "axum",
"base64 0.22.1", "base64 0.22.1",
"chromiumoxide", "chromiumoxide",
"cocos-editor-bridge",
"editor-adapter-api",
"futures", "futures",
"getrandom 0.3.4", "getrandom 0.3.4",
"http", "http",
@@ -4281,6 +4305,7 @@ dependencies = [
"cookie", "cookie",
"cookie_store", "cookie_store",
"encoding_rs", "encoding_rs",
"futures-channel",
"futures-core", "futures-core",
"futures-util", "futures-util",
"h2", "h2",
@@ -6,6 +6,9 @@ publish = false
[features] [features]
default = [] default = []
cocos-editor = ["cocos-editor-bridge/process-discovery"]
cocos-editor-execute = ["cocos-editor", "cocos-editor-bridge/windows-bootstrap"]
cocos-editor-injection = ["cocos-editor-execute", "cocos-editor-bridge/windows-injection"]
[build-dependencies] [build-dependencies]
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }
@@ -19,6 +22,8 @@ ts-rs = "12.0.1"
typed_floats = { version = "1.0.7", features = ["serde"] } typed_floats = { version = "1.0.7", features = ["serde"] }
nalgebra = { version = "0.35.0", features = ["serde-serialize"] } nalgebra = { version = "0.35.0", features = ["serde-serialize"] }
agent-runtime-core = { path = "../../../server-rs/crates/agent-runtime-core" } agent-runtime-core = { path = "../../../server-rs/crates/agent-runtime-core" }
cocos-editor-bridge = { path = "../../../plugins/agc-cocos-editor/native/cocos-editor-bridge", default-features = false }
editor-adapter-api = { path = "../../../server-rs/crates/editor-adapter-api" }
base64 = "0.22" base64 = "0.22"
axum = "0.8" axum = "0.8"
chromiumoxide = "0.9.1" chromiumoxide = "0.9.1"
@@ -182,6 +182,8 @@ fn main() {
); );
let manifest_path = manifest_dir.join("prompts/runtime/manifest.json"); let manifest_path = manifest_dir.join("prompts/runtime/manifest.json");
stage_bundled_codex_cli(&manifest_dir); stage_bundled_codex_cli(&manifest_dir);
stage_plugin_workspace(&manifest_dir);
stage_cocos_editor_payload(&manifest_dir);
let compiled = runtime_prompt_bundle::compile_manifest(&manifest_path) let compiled = runtime_prompt_bundle::compile_manifest(&manifest_path)
.unwrap_or_else(|error| panic!("Prompt Bundle 编译失败:{error}")); .unwrap_or_else(|error| panic!("Prompt Bundle 编译失败:{error}"));
validate_seed_task_catalog(&compiled); validate_seed_task_catalog(&compiled);
@@ -203,3 +205,146 @@ fn main() {
} }
tauri_build::build() tauri_build::build()
} }
#[cfg(windows)]
fn stage_cocos_editor_payload(manifest_dir: &std::path::Path) {
if std::env::var_os("CARGO_FEATURE_COCOS_EDITOR_INJECTION").is_none() {
return;
}
let out_dir = std::path::PathBuf::from(std::env::var_os("OUT_DIR").expect("OUT_DIR"));
let profile_dir = out_dir
.ancestors()
.find(|path| path.file_name().is_some_and(|name| name == "build"))
.and_then(|build_dir| build_dir.parent())
.expect("AGC Cargo profile directory not found");
let candidates = [
profile_dir.join("deps/cocos_editor_bridge.dll"),
profile_dir.join("cocos_editor_bridge.dll"),
];
let source = candidates
.iter()
.find(|path| path.is_file())
.unwrap_or_else(|| {
panic!(
"Cocos bridge native payload 未构建:{}",
candidates
.iter()
.map(|p| p.display().to_string())
.collect::<Vec<_>>()
.join("")
)
});
for destination in [
// 插件工作区里的 payload 是开发态与打包态的唯一真源。
manifest_dir
.join("../../../plugins/agc-cocos-editor/native/payload/cocos-editor-bridge.dll"),
// 随包资源目录与 tauri.windows.conf.json 的 `resources/plugins` 映射保持一致。
manifest_dir
.join("resources/plugins/agc-cocos-editor/native/payload/cocos-editor-bridge.dll"),
] {
std::fs::create_dir_all(destination.parent().expect("payload resource parent"))
.expect("创建 Cocos bridge payload 目录失败");
std::fs::copy(source, &destination).expect("复制 Cocos bridge native payload 失败");
}
println!("cargo:rerun-if-changed={}", source.display());
}
#[cfg(not(windows))]
fn stage_cocos_editor_payload(_manifest_dir: &std::path::Path) {}
/// 把 `plugins/` 工作区里的插件包随包映射到应用资源目录。
///
/// 只复制插件运行需要的清单、入口、面板和 native payload,不复制 native 源码、
/// Cargo target 目录或 node_modules。
#[cfg(windows)]
fn stage_plugin_workspace(manifest_dir: &std::path::Path) {
let repo_root = manifest_dir
.parent()
.and_then(|app_root| app_root.parent())
.and_then(|apps_dir| apps_dir.parent())
.expect("AGC 应用必须位于仓库 apps 目录下")
.to_path_buf();
let workspace = repo_root.join("plugins");
let destination_root = manifest_dir.join("resources/plugins");
std::fs::create_dir_all(&destination_root).expect("创建插件资源目录失败");
let entries = match std::fs::read_dir(&workspace) {
Ok(entries) => entries,
Err(_) => return,
};
for entry in entries.flatten() {
let plugin_root = entry.path();
if !plugin_root.is_dir() || !plugin_root.join("plugin.json").is_file() {
continue;
}
let name = entry.file_name();
let destination = destination_root.join(&name);
copy_plugin_file(
&plugin_root.join("plugin.json"),
&destination.join("plugin.json"),
);
for relative in [
std::path::PathBuf::from("src"),
std::path::PathBuf::from("panels"),
std::path::PathBuf::from("native/payload"),
] {
copy_plugin_tree(&plugin_root.join(&relative), &destination.join(&relative));
}
println!("cargo:rerun-if-changed={}", plugin_root.display());
}
}
#[cfg(windows)]
fn stage_plugin_file(source: &std::path::Path, destination: &std::path::Path) {
let Ok(bytes) = std::fs::read(source) else {
return;
};
if std::fs::read(destination).is_ok_and(|existing| existing == bytes) {
return;
}
if let Some(parent) = destination.parent() {
std::fs::create_dir_all(parent).expect("创建插件资源目录失败");
}
std::fs::write(destination, bytes).expect("复制插件资源失败");
}
#[cfg(windows)]
fn copy_plugin_tree(source: &std::path::Path, destination: &std::path::Path) {
let entries = match std::fs::read_dir(source) {
Ok(entries) => entries,
Err(_) => return,
};
for entry in entries.flatten() {
let target = destination.join(entry.file_name());
let path = entry.path();
if path.is_dir() {
let name = entry.file_name();
let name = name.to_string_lossy();
if matches!(name.as_ref(), "target" | "node_modules" | ".git") {
continue;
}
std::fs::create_dir_all(&target).expect("创建插件资源目录失败");
copy_plugin_tree(&path, &target);
} else {
// 测试文件不随包分发。
let name = entry.file_name();
let name = name.to_string_lossy();
if name.contains(".test.") {
continue;
}
stage_plugin_file(&path, &target);
}
}
}
#[cfg(windows)]
fn copy_plugin_file(source: &std::path::Path, destination: &std::path::Path) {
if !source.is_file() {
return;
}
std::fs::create_dir_all(destination.parent().expect("插件资源父目录"))
.expect("创建插件资源目录失败");
std::fs::copy(source, destination).expect("复制插件资源失败");
}
#[cfg(not(windows))]
fn stage_plugin_workspace(_manifest_dir: &std::path::Path) {}
@@ -0,0 +1 @@
当前阶段:系统架构。明确系统清单、职责边界、依赖和数据归属。
@@ -0,0 +1,6 @@
共享过程文件(如需维护,请使用这些相对路径):
- project/analysis.md
- project/决策台账.md
- project/dialog.md
不要把正式产物写在工作区根目录,也不要等审批失败后再迁移。
阶段审批工具:当你判断本阶段必需产物已完成时,必须提交阶段审批。用户批准后 Runtime 自动进入下一阶段;你不能自行切换阶段。
@@ -0,0 +1 @@
当前阶段:概念设计。明确游戏是什么、不是什么,并形成概念设计产物。
@@ -0,0 +1,4 @@
顾问阶段不需要继续自主推动项目或主动安排下一步;遵照用户的具体指示行动。
根据用户指示回答问题、读取相关文档、修改工作区文件,并说明改动可能影响的已有产物。
涉及方向性变化或多个可行方案时,先向用户说明影响并等待用户决定;不要替用户做决定。
顾问阶段没有下一层,也不需要提交阶段审批。
@@ -0,0 +1 @@
当前阶段:项目顾问。五个策划阶段已经完成,后续由用户指示驱动协作。
@@ -0,0 +1,44 @@
概念阶段定稿时,还必须创建或更新 `project/速览卡.md`。Runtime 只检查该文件是否存在,不检查内容。请使用下面的固定结构,不要加入审批操作说明或独立的决定状态段落:
# 速览卡:《游戏名》
## 1. 游戏名称
## 2. 游戏分类
## 3. 美术风格
- 视觉类型:
- 风格关键词:
- 色彩与氛围:
- MVP 美术边界:
## 4. 一句话描述
## 5. 游戏支柱
| 支柱 | 玩家感受 | 实现机制 |
|---|---|---|
## 6. 核心循环
## 7. 目标用户
- 核心用户:
- 游戏偏好:
- 单次游玩时长:
- 参考游戏与参考点:
## 8. 平台事实
## 9. 最小 MVP 系统
| 系统 | 最小功能 | 为什么必须有 | 验证方法 |
|---|---|---|---|
## 10. 给创作者的关键提示
- 先做:
- 暂时不做:
- 这样验证:
- 达标再扩展:
### 待原型验证项
- 问题:
- 原型:
- 观察:
@@ -0,0 +1 @@
当前阶段:系统文档。逐个完成已确定系统的内部规则、接口和验证标准。
@@ -0,0 +1 @@
当前阶段:技术文档。完成数据与配表、技术实现、美术圣经和总册。
@@ -0,0 +1 @@
当前阶段:顶层设计。明确玩家持续游玩的循环、资源流、节奏和系统范围。
File diff suppressed because one or more lines are too long
@@ -0,0 +1,384 @@
{
"version": 1,
"resources": [
{
"path": "skills/concept.md",
"id": "skills.concept",
"summary": "概念阶段写作规则。",
"category": "skills",
"title": "概念设计分册",
"inject_phases": [
"concept"
]
},
{
"path": "skills/top_design.md",
"id": "skills.top_design",
"summary": "顶层设计阶段写作规则。",
"category": "skills",
"title": "顶层设计分册",
"inject_phases": [
"top_design"
]
},
{
"path": "skills/architecture.md",
"id": "skills.architecture",
"summary": "系统架构阶段写作规则。",
"category": "skills",
"title": "系统架构分册",
"inject_phases": [
"architecture"
]
},
{
"path": "skills/systems.md",
"id": "skills.systems",
"summary": "系统文档阶段写作规则。",
"category": "skills",
"title": "系统文档分册",
"inject_phases": [
"systems"
]
},
{
"path": "skills/tdd.md",
"id": "skills.tdd",
"summary": "技术文档阶段写作规则。",
"category": "skills",
"title": "技术文档分册",
"inject_phases": [
"tdd"
]
},
{
"id": "templates.analysis",
"category": "templates",
"title": "analysis",
"summary": "策划文档结构模板。",
"path": "templates/analysis.md"
},
{
"id": "templates.architecture",
"category": "templates",
"title": "architecture",
"summary": "策划文档结构模板。",
"path": "templates/architecture.md"
},
{
"id": "templates.concept_design",
"category": "templates",
"title": "concept-design",
"summary": "策划文档结构模板。",
"path": "templates/concept-design.md"
},
{
"id": "templates.stardew_analysis",
"category": "templates",
"title": "stardew-analysis",
"summary": "策划文档结构模板。",
"path": "templates/stardew-analysis.md"
},
{
"id": "templates.tdd_art_bible",
"category": "templates",
"title": "tdd-art-bible",
"summary": "策划文档结构模板。",
"path": "templates/tdd-art-bible.md"
},
{
"id": "templates.tdd_data",
"category": "templates",
"title": "tdd-data",
"summary": "策划文档结构模板。",
"path": "templates/tdd-data.md"
},
{
"id": "templates.tdd_master",
"category": "templates",
"title": "tdd-master",
"summary": "策划文档结构模板。",
"path": "templates/tdd-master.md"
},
{
"id": "templates.tdd_tech",
"category": "templates",
"title": "tdd-tech",
"summary": "策划文档结构模板。",
"path": "templates/tdd-tech.md"
},
{
"id": "templates.top_design",
"category": "templates",
"title": "top-design",
"summary": "策划文档结构模板。",
"path": "templates/top-design.md"
},
{
"id": "exemplars.decision_log",
"category": "exemplars",
"title": "decision-log",
"summary": "策划文档范例或需求附件。",
"path": "exemplars/decision-log.md"
},
{
"id": "exemplars.fast_gdd",
"category": "exemplars",
"title": "fast-gdd",
"summary": "策划文档范例或需求附件。",
"path": "exemplars/fast-gdd.md"
},
{
"id": "exemplars.overview_card",
"category": "exemplars",
"title": "overview-card",
"summary": "策划文档范例或需求附件。",
"path": "exemplars/overview-card.md"
},
{
"id": "exemplars.stardew_architecture",
"category": "exemplars",
"title": "stardew-architecture",
"summary": "策划文档范例或需求附件。",
"path": "exemplars/stardew-architecture.md"
},
{
"id": "exemplars.stardew_concept",
"category": "exemplars",
"title": "stardew-concept",
"summary": "策划文档范例或需求附件。",
"path": "exemplars/stardew-concept.md"
},
{
"id": "exemplars.stardew_s06_combat",
"category": "exemplars",
"title": "stardew-s06-combat",
"summary": "策划文档范例或需求附件。",
"path": "exemplars/stardew-s06-combat.md"
},
{
"id": "exemplars.stardew_tdd_art_bible",
"category": "exemplars",
"title": "stardew-tdd-art-bible",
"summary": "策划文档范例或需求附件。",
"path": "exemplars/stardew-tdd-art-bible.md"
},
{
"id": "exemplars.stardew_tdd_data",
"category": "exemplars",
"title": "stardew-tdd-data",
"summary": "策划文档范例或需求附件。",
"path": "exemplars/stardew-tdd-data.md"
},
{
"id": "exemplars.stardew_tdd_master",
"category": "exemplars",
"title": "stardew-tdd-master",
"summary": "策划文档范例或需求附件。",
"path": "exemplars/stardew-tdd-master.md"
},
{
"id": "exemplars.stardew_tdd_tech",
"category": "exemplars",
"title": "stardew-tdd-tech",
"summary": "策划文档范例或需求附件。",
"path": "exemplars/stardew-tdd-tech.md"
},
{
"id": "exemplars.stardew_top_design",
"category": "exemplars",
"title": "stardew-top-design",
"summary": "策划文档范例或需求附件。",
"path": "exemplars/stardew-top-design.md"
},
{
"id": "exemplars.tdd_art_bible_SKILL",
"category": "exemplars",
"title": "tdd-art-bible-SKILL",
"summary": "策划文档范例或需求附件。",
"path": "exemplars/tdd-art-bible-SKILL.md"
},
{
"id": "exemplars.tdd_data_SKILL",
"category": "exemplars",
"title": "tdd-data-SKILL",
"summary": "策划文档范例或需求附件。",
"path": "exemplars/tdd-data-SKILL.md"
},
{
"id": "exemplars.tdd_tech_SKILL",
"category": "exemplars",
"title": "tdd-tech-SKILL",
"summary": "策划文档范例或需求附件。",
"path": "exemplars/tdd-tech-SKILL.md"
},
{
"id": "system_types.核心玩法编排.skill",
"category": "system_types",
"title": "01_核心玩法编排 skill",
"summary": "系统类型写法规则或模板。",
"path": "modules/system-types/01_核心玩法编排/SKILL.md"
},
{
"id": "system_types.核心玩法编排.template",
"category": "system_types",
"title": "01_核心玩法编排 template",
"summary": "系统类型写法规则或模板。",
"path": "modules/system-types/01_核心玩法编排/模板.md"
},
{
"id": "system_types.时间与日程.skill",
"category": "system_types",
"title": "02_时间与日程 skill",
"summary": "系统类型写法规则或模板。",
"path": "modules/system-types/02_时间与日程/SKILL.md"
},
{
"id": "system_types.时间与日程.template",
"category": "system_types",
"title": "02_时间与日程 template",
"summary": "系统类型写法规则或模板。",
"path": "modules/system-types/02_时间与日程/模板.md"
},
{
"id": "system_types.生产种植经营.skill",
"category": "system_types",
"title": "03_生产种植经营 skill",
"summary": "系统类型写法规则或模板。",
"path": "modules/system-types/03_生产种植经营/SKILL.md"
},
{
"id": "system_types.生产种植经营.template",
"category": "system_types",
"title": "03_生产种植经营 template",
"summary": "系统类型写法规则或模板。",
"path": "modules/system-types/03_生产种植经营/模板.md"
},
{
"id": "system_types.地图与探索.skill",
"category": "system_types",
"title": "04_地图与探索 skill",
"summary": "系统类型写法规则或模板。",
"path": "modules/system-types/04_地图与探索/SKILL.md"
},
{
"id": "system_types.地图与探索.template",
"category": "system_types",
"title": "04_地图与探索 template",
"summary": "系统类型写法规则或模板。",
"path": "modules/system-types/04_地图与探索/模板.md"
},
{
"id": "system_types.采集与支线活动.skill",
"category": "system_types",
"title": "05_采集与支线活动 skill",
"summary": "系统类型写法规则或模板。",
"path": "modules/system-types/05_采集与支线活动/SKILL.md"
},
{
"id": "system_types.采集与支线活动.template",
"category": "system_types",
"title": "05_采集与支线活动 template",
"summary": "系统类型写法规则或模板。",
"path": "modules/system-types/05_采集与支线活动/模板.md"
},
{
"id": "system_types.战斗与敌人.skill",
"category": "system_types",
"title": "06_战斗与敌人 skill",
"summary": "系统类型写法规则或模板。",
"path": "modules/system-types/06_战斗与敌人/SKILL.md"
},
{
"id": "system_types.战斗与敌人.template",
"category": "system_types",
"title": "06_战斗与敌人 template",
"summary": "系统类型写法规则或模板。",
"path": "modules/system-types/06_战斗与敌人/模板.md"
},
{
"id": "system_types.物品背包与制作.skill",
"category": "system_types",
"title": "07_物品背包与制作 skill",
"summary": "系统类型写法规则或模板。",
"path": "modules/system-types/07_物品背包与制作/SKILL.md"
},
{
"id": "system_types.物品背包与制作.template",
"category": "system_types",
"title": "07_物品背包与制作 template",
"summary": "系统类型写法规则或模板。",
"path": "modules/system-types/07_物品背包与制作/模板.md"
},
{
"id": "system_types.成长与技能.skill",
"category": "system_types",
"title": "08_成长与技能 skill",
"summary": "系统类型写法规则或模板。",
"path": "modules/system-types/08_成长与技能/SKILL.md"
},
{
"id": "system_types.成长与技能.template",
"category": "system_types",
"title": "08_成长与技能 template",
"summary": "系统类型写法规则或模板。",
"path": "modules/system-types/08_成长与技能/模板.md"
},
{
"id": "system_types.NPC关系与任务.skill",
"category": "system_types",
"title": "09_NPC关系与任务 skill",
"summary": "系统类型写法规则或模板。",
"path": "modules/system-types/09_NPC关系与任务/SKILL.md"
},
{
"id": "system_types.NPC关系与任务.template",
"category": "system_types",
"title": "09_NPC关系与任务 template",
"summary": "系统类型写法规则或模板。",
"path": "modules/system-types/09_NPC关系与任务/模板.md"
},
{
"id": "system_types.经济与商店.skill",
"category": "system_types",
"title": "10_经济与商店 skill",
"summary": "系统类型写法规则或模板。",
"path": "modules/system-types/10_经济与商店/SKILL.md"
},
{
"id": "system_types.经济与商店.template",
"category": "system_types",
"title": "10_经济与商店 template",
"summary": "系统类型写法规则或模板。",
"path": "modules/system-types/10_经济与商店/模板.md"
},
{
"id": "system_types.事件与节日.skill",
"category": "system_types",
"title": "11_事件与节日 skill",
"summary": "系统类型写法规则或模板。",
"path": "modules/system-types/11_事件与节日/SKILL.md"
},
{
"id": "system_types.事件与节日.template",
"category": "system_types",
"title": "11_事件与节日 template",
"summary": "系统类型写法规则或模板。",
"path": "modules/system-types/11_事件与节日/模板.md"
},
{
"id": "system_types.UI与文本呈现.skill",
"category": "system_types",
"title": "12_UI与文本呈现 skill",
"summary": "系统类型写法规则或模板。",
"path": "modules/system-types/12_UI与文本呈现/SKILL.md"
},
{
"id": "system_types.UI与文本呈现.template",
"category": "system_types",
"title": "12_UI与文本呈现 template",
"summary": "系统类型写法规则或模板。",
"path": "modules/system-types/12_UI与文本呈现/模板.md"
}
]
}
@@ -0,0 +1,66 @@
# 决策台账:《星露谷物语》金样项目
版本:v3 | 规则:台账放活队列——design 只放结论、分析只放论证、决定与开放问题住这里。编号连续不复用;被推翻的行标 overturned 挂新行,不删行。
状态六态:`confirmed`(用户亲口/亲选)/ `auto_decided`(技术类代决,必带理由+推翻条件,用户一键可翻)/ `default_pending`(默认建议兜底,用户未点头)/ `prototype_pending`(待原型验证)/ `pending_user`(等用户拍板)/ `overturned`(被推翻,挂旧行编号)。
> 编号口径:D-01~D-13 与 exemplars/stardew-analysis.md 台账节选一致(D-04~D-06、D-08~D-10、D-12 原为"就地小权衡,直接登记未开条目",此处按登记口径展开);D-14 起为技术文档期新增,与 stardew-tdd-tech.md 开放问题回执互引。
## 当前待办(活队列)
### 等用户拍板(pending_user
| 编号 | 决定 | 层 | 谁 | 依据 | 推翻条件 | 状态 |
|---|---|---|---|---|---|---|
| D-14 | 体力与战斗共享单池 | TDD | user | 风险资源统一制造取舍(概念张力一);**暂按共享实现,改单拆只需改 S02 成本入口** | 战斗参与率实测过低(玩家回避矿井) | pending_user(暂按共享实现) |
| D-15 | 背包格子制 vs 重量制 | TDD | user | 格子制直觉、重量制焦虑感与 T5"休闲不打卡"冲突;暂按格子制实现、存档预留 capacity_type 字段 | 格子管理成为主要负面反馈 | pending_user(B 级阻断存档结构,暂按格子制) |
### 待原型验证(prototype_pending
| 编号 | 决定 | 层 | 谁 | 依据 | 推翻条件 | 状态 |
|---|---|---|---|---|---|---|
| D-13b | 战斗判定窗口手感(前摇帧数/无敌帧 450ms 基准) | 系统 | user | 数值可定、手感不可纸面验证 | 原型显示节奏拖慢/玩家困惑 | prototype_pending(规则本体见 D-13 confirmed |
### 默认建议兜底(default_pending
| 编号 | 决定 | 层 | 谁 | 依据 | 推翻条件 | 状态 |
|---|---|---|---|---|---|---|
| D-19 | 天气权重表具体数值(晴/雨/风暴按季节) | TDD | agent | 概念层只定"雨免浇水"定性;数值推内容期填 | 前 5 日出现连续 3 日雨/全无雨 | default_pending(默认值已进数据表,带 designer_note |
## 已采用决定
### 用户确认(confirmed
| 编号 | 决定 | 层 | 谁 | 依据 | 推翻条件 | 状态 |
|---|---|---|---|---|---|---|
| D-01 | 定调:牧场物语系参照、治愈慢节奏 | 概念 | user | 用户原始需求 | — | confirmed |
| D-02 | 单人体验,无多人 | 概念 | user | 概念层非目标 | — | confirmed |
| D-03 | 战斗保持伴生风险,不做装备驱动主轴 | 概念 | user | 概念期问题一 | 矿井流失率过半且归因战斗 | confirmed |
| D-07 | 日目标自设,季节与社区提供低频牵引 | 顶层 | user | 顶层期问题一 | 新手周流失归因无方向 | confirmed |
| D-11 | 采集/钓鱼/战斗统一"活动结果"接口 | 架构 | user | 架构期问题一 | 第三活动类型出现结构性差异 | confirmed |
| D-13 | 战斗采用节奏/指令判定 | 系统 | user | S06 问题一 | 原型显示节奏拖慢/玩家困惑 | confirmed(手感部分拆 D-13b prototype_pending |
### 技术代决(auto_decided——带理由与推翻条件,用户一键可翻)
| 编号 | 决定 | 层 | 谁 | 依据(理由) | 推翻条件 | 状态 |
|---|---|---|---|---|---|---|
| D-04 | 时间片制:700ms=10 游戏分钟 | 概念 | agent | 原作实证节拍;一天≈14 分钟真实时间贴合 T5"休闲" | 内测一天体感过短/过长 | auto_decided |
| D-05 | 分区域切换(区域独立场景,非连续地图) | 概念 | agent | 概念层"不是什么:无边界开放世界";区域小网络全部步行可达 | 场景切换成为移动负担反馈 | auto_decided |
| D-06 | 28 日/季、四季/年 | 顶层 | agent | 季节窗口制造"本季计划"节奏(支柱二) | 换季频率在测试中被无视 | auto_decided |
| D-09 | 商店营业时段走条件表 | 架构 | agent | 与配方/区域解锁共用 check(condition_id) 单一入口 | 条件表规模膨胀难维护 | auto_decided |
| D-10 | 出货箱日终统一结算 | 架构 | agent | 收入集中进日终面板,强化"一天一结算"叙事;商店现卖保留即时通道 | 玩家普遍绕开出货箱 | auto_decided |
| D-12 | 工具升级期间该工具不可用 | 系统 | agent | 升级=时间成本换效率(顶层张力二);备用旧工具暂不做(开放问题) | 升级期挫败感集中爆发 | auto_decided |
| D-16 | 矿井逐层生成本期不做(P2 | TDD | agent | GDD 已标"不做无限地牢";首期按布局池 8~12 模板拼装 | 内测要求深度爬塔玩法 | auto_decided |
| D-17 | 换装首期 5 层(基础体/裤/衣/发型/饰件),非 19 层 | TDD | agent | 外观自定义非首期卖点;层结构预留到 19 层 | 外观系统成核心诉求 | auto_decided |
| D-18 | 作物品质三档:普通/银/金 | TDD | agent | 经济分层需要(即时变现 vs 等待升值的取舍) | 银金档无人区分、一律普通出售 | auto_decided |
### 已推翻(overturned——旧行保留,挂新行)
| 编号 | 决定 | 层 | 谁 | 依据 | 推翻条件 | 状态 |
|---|---|---|---|---|---|---|
| D-08 | 作物品质两档:普通/银 | TDD | agent | 早期小权衡:两档最简 | — | **overturned → D-18**(经济分层不足,改三档;铱档留 P1) |
## 队列纪律(给 agent 的使用说明)
- 新决定入队:拿下一号(当前最大 D-19,下一号 D-20);就现代决可登记不开条目,但状态必须写 auto_decided 并带理由+推翻条件。
- 用户翻案:旧行标 overturned 挂新行,受影响文档节重写(本台账只记录,不代改)。
- 概念层变更定稿后:速览卡"决定状态与原型验证项"字段随本文件最新版同步(prompt 级纪律)。

Some files were not shown because too many files have changed in this diff Show More