Skip to content

feat(tscene): add text scene/prefab format, validation, conversion, and nested override parity - #1068

Open
yyf0202 wants to merge 2 commits into
cocos:ai-nativefrom
yyf0202:ai-native
Open

yyf0202 wants to merge 2 commits into
cocos:ai-nativefrom
yyf0202:ai-native

Conversation

@yyf0202

@yyf0202 yyf0202 commented Dec 2, 2026

Copy link
Copy Markdown

Introduce the AI-friendly text scene and prefab format (.tscene / .tprefab) alongside zero-baking metadata extraction, strict validation with auto-fix, bidirectional project conversion, and native-parity nested prefab override handling.

Summary

  • Text format codec & round-trip stability (src/core/tscene/): type-driven YAML-subset encoder/decoder, built-in defaults manifest, explicit component state tracking, float32 baseline stabilization, sticky ~n disambiguation, and explicit node id: anchors.
  • Nested prefab override anchoring & native runtime parity: compact inline localID chains for overrides, mounted parents, -Components, and $ref; tolerant override handling matching native .scene runtime semantics with warnings across open, save, and conversion.
  • Metadata provider, active asset aliases & build gate: layered metadata resolution (src/core/metadata/), O(1) live asset:// alias index with copy remapping, and build-time .tscene gate.
  • CLI & MCP integration: validate (strict diagnostics + --fix with conflict guards and transactional rollback), scene convert (bidirectional json <-> text conversion with rollback and URL rewriting), create format mode, and format-aware MCP tools (tscene-validate, tscene-convert).

Validation

  • npx tsc -b --noEmit (0 errors)
  • npx jest src/core/tscene/test/ src/core/scene/test/editor-close-options.test.ts src/core/metadata/test/metadata.test.ts tests/mcp-tscene-mode.test.ts --runInBand (11 suites, 74 tests passed)

yangyifan added 2 commits December 2, 2026 17:58
…nd nested override parity

Introduce the AI-friendly text scene and prefab format (.tscene / .tprefab)
alongside zero-baking metadata extraction, strict validation with auto-fix,
bidirectional project conversion, and native-parity nested prefab override
handling.
…d manifest

Keep explicit-state.ts free of node:crypto and node:path imports so build:scene-runtime succeeds, preserve the 2-argument Project.create overload with updated DTS snapshots, and build the component manifest during npm run build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant