02a7abeb3f
Project CI / AI game creator shell Rust crates (push) Successful in 2m53s
Project CI / AI game creator shell Rust smoke (push) Successful in 3m42s
Project CI / AI game creator shell Rust lane 2/2 (push) Has been cancelled
Project CI / Backend tests (push) Has been cancelled
Project CI / Frontend tests (push) Has been cancelled
Project CI / Repository checks (push) Has been cancelled
Project CI / AI game creator shell web tests (push) Has been cancelled
Project CI / AI game creator shell Rust lane 1/2 (push) Has been cancelled
Project CI / Native shell tests (push) Has been cancelled
- 后台新增「模板管理」页:按权限查看并编辑模板名称/简介/标签/封面,支持上架与下架;路由、侧栏、tab 权限、API 客户端与 DTO 同步接入 - api-server 新增 /admin/api/agc-templates 读取与更新路由,复用现有后台鉴权与 tab 权限校验,权限不足按既有失败关闭口径拒绝 - module-assets 收敛模板库纯规则(active/inactive 投影、索引 schema 与重复项校验、ZIP 大小与摘要核对),platform-oss 承担对象存储读写、不可变对象复用与发布互斥锁 - shared-contracts 补后台模板 DTO;spacetime-module 账号存储适配保持既有 schema 不变 - AGC 壳内置模板索引与建项读取改为内容寻址对象,补模板安装、越界归档、索引不匹配等用例 - 模板库发布脚本支持定向发布与上架/下架合并、内容地址复用与锁语义,CLI 守卫用例同步;jenkins 两条客户端打包管线统一触发邮件通知 Job 并传递首装包链接 - 内置 5 个 Cocos 官方模板载荷与索引 fixture(内容地址对象,共 90 个文件) - 补「后台模板管理」里程碑与实施计划,更新模板库技术方案、开发运维文档与共享记忆 - 验证:admin-web 39 项用例与 typecheck、发布脚本 25 项用例、api-server 与 AGC 壳编译、模板库定向 Rust 用例(AGC 壳 18 项、module-assets/platform-oss 16 项、后台权限 1 项)、check:encoding / check:doc-index / check:production-ops / rustfmt 全部通过
shared-contracts 共享 crate 说明
日期:2026-04-21
1. crate 职责
shared-contracts 是前后端兼容 contract 共享 crate,后续负责:
- HTTP 请求与响应 DTO
- SSE 事件结构与事件名约定
- response envelope、错误结构、兼容头部契约
- 各模块对外暴露的共享协议类型
2. 当前阶段说明
当前阶段已完成 Stage1 最小真实落地:
- 统一 response envelope / 头部常量
auth/login-optionsauth/meauth/sessionsruntime/settings
当前阶段继续补齐的 Stage2 鉴权 DTO:
auth/entryauth/refreshauth/logoutauth/logout-allauth/phone/send-codeauth/phone/loginauth/wechat/startauth/wechat/callbackauth/wechat/bind-phoneauth/wechat/miniprogram-login
当前阶段继续补齐的 Stage3 公开请求 DTO:
assets/direct-upload-ticketsassets/read-urlassets/objects/confirmassets/objects/bindstory-sessions/beginstory-sessions/continue
当前阶段继续补齐的 Stage4 显式成功响应 DTO:
assets/direct-upload-ticketsassets/read-urlassets/objects/confirmassets/objects/bindstory-sessions/beginstory-sessions/continue
当前阶段新增 Stage6 character visual 兼容 DTO:
assets/character-visual/generateassets/character-visual/jobs/:taskIdassets/character-visual/publish
当前阶段新增 Stage7 character animation 模板与导入兼容 DTO:
assets/character-animation/templatesassets/character-animation/import-video
当前阶段新增 Stage8 character workflow cache 第一批兼容 DTO:
assets/character-workflow-cacheassets/character-workflow-cache/:characterId
当前阶段新增 Stage9 character animation 主链兼容 DTO:
assets/character-animation/generateassets/character-animation/jobs/:taskIdassets/character-animation/publish
当前阶段新增 Stage5 story session scoped runtime story 写读 DTO:
BeginStoryRuntimeSessionRequestResolveStoryRuntimeActionRequestStoryRuntimeProjectionResponseStoryRuntimeMutationResponseStoryRuntimeSnapshotPayload仅用于 story session scoped 写侧持久化边界,不复用旧/api/runtime/story/*总入口 contract。
WP-DEL 已删除旧 runtime story HTTP DTO:RuntimeStoryStateResolveRequest、RuntimeStoryBootstrapRequest/Response、RuntimeStoryActionResponse 和旧 RuntimeStorySnapshotPayload。runtime_story 模块中仍保留的 RuntimeStoryViewModel、RuntimeStoryPresentation、RuntimeStoryPatch 与 battle presentation 是当前投影/表现构件,不作为旧 HTTP 写入口。
当前仍刻意未做:
- SSE 事件结构
- 自动代码生成或跨语言 contract 同步
- 其他尚未收口模块的 handler 响应体显式 DTO 化
3. 边界约束
shared-contracts只放协议类型与兼容结构,不承接业务规则、供应商适配或状态写入逻辑。- 各模块 crate 对外暴露的协议优先复用这里的共享定义,避免重复散落。
- 前端兼容契约一旦进入本 crate,就必须与任务清单和基线文档同步维护。
assets模块依赖platform-oss的稳定返回类型,默认通过oss-contractsfeature 给api-server使用;SpacetimeDB WASM 构建链路必须通过 workspace 依赖关闭默认 feature,避免把platform-oss/reqwest/wasm-bindgen带进spacetime-module。