[GH-ISSUE #5091] Packages cannot ship general static assets — the asset route serves at most 2 home-tab icons #2815

Closed
opened 2026-10-21 05:56:05 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kolacheee on GitHub (Aug 15, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5091

Originally assigned to: @kolacheee on GitHub.

The gap

An installed Agent package can serve at most two images over HTTP — and only if it declares the home-browser-tab slot. The only package asset route, GET /api/capability-packages/:id/assets/*, serves a path exclusively when it appears in contributions.homeBrowserTab.iconPaths, which the manifest schema caps at 1–2 entries with an image-extension gate (packages/server/src/services/capability-packages/package-manager.service.ts browserTabAsset; packages/shared/src/schemas/capability-package.schema.ts iconPaths .min(1).max(2)).

That's fine for browser-tab icons, but it means a package that needs real art or data files — a game-surface Experience shipping a tileset, sprite atlas, or tilemap JSON — cannot ship them at all. The workarounds are both bad:

  • inlining art as data: URIs bloats a client bundle that must already be a single file (only entrypoints.client is served as JS), and
  • writing art into the user's game-assets tree from a client bundle abuses an unrelated upload route.

Try it yourself

  1. Install any package and add a file to its version directory + manifest.json files[].
  2. GET /api/capability-packages/<id>/assets/<that-file> → 404, because the path isn't one of the (max 2) iconPaths — there is no way for a manifest to declare general assets.

Suggested fix

A manifest-declared static asset allowlist, served through the exact same verification chain the icon route already uses (path containment, files[] membership, content-type allowlist, hash + TOCTOU re-verification on every read):

  • contributions.assets.paths: string[] in the manifest schema (bounded count and path length; image extensions + .json for tilemap/atlas metadata; no SVG — active document),
  • the browserTabAsset resolver generalized so its allowlist is the union of iconPaths and contributions.assets.paths, with nothing else in the chain moving,
  • a Capability API minor bump so a package declaring the new field fails cleanly at install on older engines (strict schema).

With #5082's caching in place, declared assets requested with ?v=<installed version> are already served immutable, so shipped tilesets cost one download per version.

Motivation: this is the single hard blocker for the pixel-RPG game-surface Experience shipping authored art (Tier-1 of its art pipeline). Verified against staging @ f01272320.

Originally created by @kolacheee on GitHub (Aug 15, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5091 Originally assigned to: @kolacheee on GitHub. ### The gap An installed Agent package can serve at most **two** images over HTTP — and only if it declares the `home-browser-tab` slot. The only package asset route, `GET /api/capability-packages/:id/assets/*`, serves a path exclusively when it appears in `contributions.homeBrowserTab.iconPaths`, which the manifest schema caps at 1–2 entries with an image-extension gate (`packages/server/src/services/capability-packages/package-manager.service.ts` `browserTabAsset`; `packages/shared/src/schemas/capability-package.schema.ts` `iconPaths .min(1).max(2)`). That's fine for browser-tab icons, but it means a package that needs real art or data files — a game-surface Experience shipping a tileset, sprite atlas, or tilemap JSON — cannot ship them at all. The workarounds are both bad: - inlining art as `data:` URIs bloats a client bundle that must already be a single file (only `entrypoints.client` is served as JS), and - writing art into the user's game-assets tree from a client bundle abuses an unrelated upload route. ### Try it yourself 1. Install any package and add a file to its version directory + `manifest.json` `files[]`. 2. `GET /api/capability-packages/<id>/assets/<that-file>` → `404`, because the path isn't one of the (max 2) `iconPaths` — there is no way for a manifest to declare general assets. ### Suggested fix A manifest-declared static asset allowlist, served through the exact same verification chain the icon route already uses (path containment, `files[]` membership, content-type allowlist, hash + TOCTOU re-verification on every read): - `contributions.assets.paths: string[]` in the manifest schema (bounded count and path length; image extensions + `.json` for tilemap/atlas metadata; **no SVG** — active document), - the `browserTabAsset` resolver generalized so its allowlist is the union of `iconPaths` and `contributions.assets.paths`, with nothing else in the chain moving, - a Capability API minor bump so a package declaring the new field fails cleanly at install on older engines (strict schema). With #5082's caching in place, declared assets requested with `?v=<installed version>` are already served `immutable`, so shipped tilesets cost one download per version. Motivation: this is the single hard blocker for the pixel-RPG game-surface Experience shipping authored art (Tier-1 of its art pipeline). Verified against `staging` @ f01272320.
bsakaguchi 2026-10-21 05:56:05 +07:00
Author
Owner

@kolacheee commented on GitHub (Aug 15, 2026):

Taking this one (agent working from kolacheee's fork) — draft PR is up. Two review-driven notes for whoever looks at it: (1) it includes a forward-compat fix that matters beyond this feature — catalog parsing is now per-entry tolerant, because the first published package with ANY future manifest key would previously have bricked the whole Agents browser on older Engines; (2) publishing guidance — an assets-declaring package should wait until 1.10 Engines are widely installed, since only Engines with this PR parse the catalog tolerantly.

<!-- gh-comment-id:5304013337 --> @kolacheee commented on GitHub (Aug 15, 2026): Taking this one (agent working from kolacheee's fork) — draft PR is up. Two review-driven notes for whoever looks at it: (1) it includes a forward-compat fix that matters beyond this feature — catalog parsing is now per-entry tolerant, because the first published package with ANY future manifest key would previously have bricked the whole Agents browser on older Engines; (2) publishing guidance — an assets-declaring package should wait until 1.10 Engines are widely installed, since only Engines with this PR parse the catalog tolerantly.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#2815
No description provided.