mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7539] [MERGED] feat(avatars): shared contract for the 2D and 3D avatar agents #7783
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#7783
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7539
Author: @SpicyMarinara
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/avatars-contract📝 Commits (6)
15af58ffeat(avatars): shared contract for the 2D and 3D avatar agentsdf53866fix(avatars): refuse Windows device names in stored paths and point code at the developer notese00796bMerge branch 'staging' into feat/avatars-contractb8d4873Merge branch 'staging' into feat/avatars-contract8fd3829Merge branch 'staging' into feat/avatars-contract1e9e587test(avatars): catch bare renderer imports outside the lazy modules📊 Changes
37 files changed (+1954 additions, -5 deletions)
View changed files
📝
docs/agents/agents-overview.md(+1 -0)➕
docs/agents/avatars.md(+44 -0)📝
docs/development/optional-agent-packages.md(+19 -0)📝
packages/client/package.json(+5 -0)➕
packages/client/src/features/avatars/audio/avatar-audio.ts(+13 -0)➕
packages/client/src/features/avatars/contract.ts(+198 -0)➕
packages/client/src/features/avatars/director/avatar-director.ts(+24 -0)➕
packages/client/src/features/avatars/generation/AvatarGenerationPanel.tsx(+8 -0)➕
packages/client/src/features/avatars/renderers/mesh-avatar/MeshAvatarSetupPanel.tsx(+7 -0)➕
packages/client/src/features/avatars/renderers/mesh-avatar/mesh-avatar-renderer.ts(+20 -0)➕
packages/client/src/features/avatars/renderers/pngtuber/PngtuberSetupPanel.tsx(+7 -0)➕
packages/client/src/features/avatars/renderers/pngtuber/pngtuber-renderer.ts(+19 -0)➕
packages/client/src/features/avatars/renderers/vrm/VrmSetupPanel.tsx(+7 -0)➕
packages/client/src/features/avatars/renderers/vrm/vrm-renderer.ts(+20 -0)➕
packages/client/src/features/avatars/setup/AvatarAgentSetup.tsx(+13 -0)➕
packages/client/src/features/avatars/stage/AvatarStage.tsx(+15 -0)📝
packages/client/vite.config.ts(+7 -0)➕
packages/server/src/routes/avatar-classify.routes.ts(+11 -0)➕
packages/server/src/routes/avatar-generation.routes.ts(+13 -0)➕
packages/server/src/routes/avatar-models.routes.ts(+19 -0)...and 17 more files
📄 Description
Linked issue
Refs #7537 (epic: 2D and 3D avatar agents). This is the contract PR; the epic stays open for the lanes.
Why this change
What changed
packages/shared/src/types/avatars.ts, exported from the shared index): agent ids2d-avatarsand3d-avatars; the expression contract (AVATAR_EMOTIONS,AVATAR_VISEMES,AVATAR_STATES,AvatarFrameInput);AvatarKind(pngtuber,mesh-avatar,vrm) and which agent owns each kind; the sprite label → emotion mapping for the 17 labels the sprite editors suggest plus word stems for free-form Game Master expressions;AvatarConfigv1 (avatar.json) with expression bindings that record their source and confidence; import, classifier and generation API types;AVATAR_PROMPT_TEMPLATE_IDSwith their variables (the prompt text will live in the packages).avatar.jsonand the request bodies (packages/shared/src/schemas/avatars.schema.ts). Stored paths must match<kind>/<name>and may not be a Windows device name (CON, NUL, COM1, …), so nothing can point outside the owner's folder.avatarGenerationTemplatesmerge and reset like other built-in prompt template collections.docs/development/optional-agent-packages.md./api/avatar-models,/api/avatar-classifyand/api/avatar-generationplugins (registered, no routes yet); storage service signatures forDATA_DIR/avatar-models/<ownerType>/<ownerId>/; importer stubs for.save,.mavatarand.vrm/.vrmabehind one fixed registry; classifier and generation service stubs. The existing/api/avatarsprofile-picture route is untouched.packages/client/src/features/avatars/:contract.ts(renderer, director, audio-source and setup-panel interfaces, the performance budget, lazy loaders that useimport()), and stub modules for each lane.three0.186.1,@pixiv/three-vrm3.5.5,@pixiv/three-vrm-animation3.5.5,mesh-avatar0.1.1,@types/three0.186.0 (dev). Vite puts them in their own lazy vendor chunks, never invendor-misc.docs/agents/avatars.md, with one section per lane, linked from the agents overview.scripts/regressions/avatar-contract.regression.ts: label mapping, bindings,avatar.jsonvalidation (including path escapes and device names), template merging, inert stubs, and a guard that onlyfeatures/avatars/renderers/may import three,@pixiv/*or mesh-avatar.Validation
pnpm checkpasses locallyCONTRIBUTING.mdCommands run by the agent (results as reported; boxes above are for the human reviewer):
pnpm install --prefer-offline(lockfile update for the five new pins only; additive)pnpm check: passed (impeccable, localization with no new keys, Prettier, ESLint with one existing warning inHomeProfessorMariChat.tsx, e2e and token-estimation types, full build)node scripts/run-regressions.mjs --filter <name>foravatar-contract,capability-package-lifecycle,capability-gm-verb-runtime,docs-language,expression-tool-retirement,game-ruleset-catalogs,world-map-packs,prompt.regression(7 files),zip-reader,sprite-list-security: all passednode scripts/run-regressions.mjs(full suite): 621/622 passed. The one failure,termux-sharp.regression.mjs, is local only: it installs offline frompnpm store path, which in this worktree points at an empty.pnpm-storebecause the worktree was installed from the main checkout's store (ERR_PNPM_NO_OFFLINE_TARBALLfor tslib). This PR does not touch the server's lockfile entries; CI'scomplete-node-regressionsruns it with a real store.Bundle: no file in
packages/client/distcontains three, three-vrm or mesh-avatar code, and the entry is unchanged in content (304 KiB). A throwaway local build (not committed) that imported the libraries from the stub renderers and calledloadAvatarRenderer()frommain.tsxput them in lazy chunks only:vendor-three404 kB,vendor-three-core233 kB,vendor-three-vrm156 kB,vendor-mesh-avatar89 kB, none in the entry's static import graph and all under the 500 KiB chunk budget.Local CodeRabbit (
coderabbit review --agent --committed, Pasta-Devs org): 2 minor findings, both left as they are. (1) "docs/agents/avatars.mdhas placeholder sections": the per-lane headings are the requested skeleton, so each lane writes only its own section; the intro says the guide fills in as parts land, and no avatar package is in the catalog yet, so nobody can reach the feature half-built. (2) "Mirror the docs change ondocs-i18nor open a follow-up": done, #7540 covers all three changed guides.GitHub CodeRabbit on
15af58f10: 4 threads. Fixed indf538660f: Windows device names in stored paths, and the contract comments now point at the developer notes instead of the user guide. Answered: the docs-i18n follow-up is #7540; the 1.73 bump stays (the contract fixes the value for the packages lane), and the developer notes now say the packages publish only after the Engine's setup, stage and a renderer are onstaging. After the fixes,avatar-contractpasses, and shared, server and client typecheck and Prettier are clean.Manual verification notes
This PR has no user-visible change, so manual checks confirm that nothing moved:
vendor-three,vendor-three-core,vendor-three-vrmorvendor-mesh-avatarfile is requested.GET /api/avatar-modelsandPOST /api/avatar-classifyanswer 404 (no routes yet), andGET /api/avatars/...profile pictures still load.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Docs changed: new
docs/agents/avatars.md(skeleton), one link indocs/agents/agents-overview.md, and the Capability API 1.73 section indocs/development/optional-agent-packages.md. Translation follow-up: #7540 (translate after the lanes fill the guide). No version bump.UI evidence (if applicable)
None: no UI changes.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.