[PR #496] [MERGED] beholder 1.3.0: ship the paper doll as a toolbar capability #999

Closed
opened 2026-10-20 17:33:06 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/496
Author: @GetBeholder
Created: 8/22/2026
Status: ✅ Merged
Merged: 8/22/2026
Merged by: @GetBeholder

Base: staging ← Head: feat/beholder-capability-ui


📝 Commits (5)

  • af5c331 beholder 1.3.0: ship the paper doll as a toolbar capability
  • c7d8cd0 test(beholder): make the doll fixture exercise what it claims
  • 0586e4c fix(beholder): escape prose-derived values, drop the unused merge engine
  • 9c17744 fix(beholder): build the character map without a prototype
  • df9bdc5 Merge remote-tracking branch 'origin/staging' into feat/beholder-capability-ui

📊 Changes

22 files changed (+8507 additions, -32 deletions)

View changed files

➕ artifacts/beholder-1.3.0.zip (+0 -0)
📝 catalog/catalog.json (+19 -8)
📝 catalog/v2/catalog.json (+19 -8)
📝 catalog/v3/catalog.json (+19 -8)
📝 eslint.config.mjs (+23 -0)
📝 packages/beholder/agents.json (+1 -1)
➕ packages/beholder/bh-logo.png (+0 -0)
➕ packages/beholder/client.js (+2279 -0)
📝 packages/beholder/locales/en.json (+2 -2)
📝 packages/beholder/manifest.json (+16 -5)
➕ packages/beholder/src/00-prelude.js (+90 -0)
➕ packages/beholder/src/10-garment-data.js (+19 -0)
➕ packages/beholder/src/12-colors.js (+63 -0)
➕ packages/beholder/src/15-state.js (+78 -0)
➕ packages/beholder/src/30-paperdoll.js (+1598 -0)
➕ packages/beholder/src/80-dock.js (+283 -0)
➕ packages/beholder/src/90-element.js (+124 -0)
➕ packages/beholder/src/fa-embed.css (+4 -0)
➕ packages/beholder/src/locales/en.json (+15 -0)
➕ packages/beholder/src/style.css (+3502 -0)

...and 2 more files

📄 Description

Pull request

Linked issue

Closes #497

Why this change

  • Beholder has tracked physical state since 1.0 but never showed it: there was no way to see what the agent believes, catch it being wrong, or understand what it feeds the prompt.
  • The panel has to stay opt-in. Beholder is an optional agent, so its UI is contributed by the package and mounted by the host only for chats where the agent is switched on — installs that never add Beholder see nothing, and no Beholder-specific UI lands in the Engine client.

What changed

  • beholder 1.3.0: adds entrypoints.client and the conversation-toolbar slot; client.js, artifact and catalog entry regenerated.
  • The paper doll is a port, not a reimplementation. The reference extension's renderer is plain ES modules with a pure dependency graph, so its garment data, colors, state helpers and renderer are carried over as package-owned source with imports/exports stripped, concatenated into one IIFE — the shape Pixelforge uses. Markup, class names and stylesheet come with them, which is what keeps the doll identical to the extension's.
  • New host seam only: the toggle uses the host's own toolbarButtonClass rather than cloning a neighbour's classes; the dock slides in from the right and the chat reflows via --tracker-chat-avoid-right; offsets are measured from the live layout on open so it never parks on another right-side panel; narrow viewports get the bottom sheet and compact list. Panel state lives in module scope so it survives the remounts the host performs on chat switch, version bump and error retry.
  • State is read from the agent's existing same-origin route. Extraction lands a few seconds after generation, so the dock re-reads on a short staggered schedule after each turn and stops as soon as the state changes, instead of polling.
  • scripts/build-beholder-package.mjs is new: build-agent-catalog.mjs skips client-bearing packages by design, so Beholder owns its build the way Pixelforge does.
  • agents.json prompt templates are untouched — the model is trained against those exact strings. The builder only stamps the description the catalog requires to match the manifest, so the diff there is one line.
  • The stylesheet's remote webfont @import is dropped so the client makes no third-party request at runtime.

Package and security impact

  • Affected package IDs: beholder
  • Engine compatibility impact: unchanged (min stays 2.4.4); the conversation-toolbar slot and toolbarButtonClass are already provided by that line.
  • New or changed permissions/entrypoints: adds entrypoints.client and contributions.slots: ["conversation-toolbar"]. Permissions are unchanged — ui was already declared, and it is the one a client entrypoint requires. No network permission: the client only calls the Engine's own same-origin route, and the test asserts the bundle references no remote host.
  • Restart, storage, update, or uninstall impact: restartRequired stays false. The client stores two display preferences (layout, layer toggles) in localStorage under marinara.beholder.*; nothing else is persisted client-side. Uninstalling removes the contribution, so the toggle and panel disappear with it.

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup
  • Read and followed CONTRIBUTING.md

Manual verification notes

Two unticked boxes above are honest: this has not been installed through a running Engine yet, because the catalog artifact URL resolves only once this is on main. What was verified:

  1. Renderer parity. Rendered a fixture through the reference extension's own renderer and through the ported modules, and compared SHA-256 of the markup across all three layouts × both views — identical in all six. Re-verified after Prettier reformatted the ported files.
  2. Regression test (npx tsx tests/beholder-client-contract.regression.ts): pins those six digests, asserts the fixture actually exercises worn / held / missing / bare / wound / chip markers, and checks the bundle contract (element registration, no remote hosts, every source module present, shipped bytes match the manifest). Confirmed it fails when a renderer module is altered, so it is not vacuous.
  3. Functional check in Chromium (Playwright), driving the shipped client.js against a stubbed host: element registers; the toggle renders with the host's class, the brand mark and the localized label; no panel exists until it is clicked; clicking docks the panel on screen below the top bar, sets body.bh-dock-open and --tracker-chat-avoid-right: min(500px,94vw); the doll renders (2 character tabs, 76 slot elements, the silhouette SVG, ~20KB markup) with worn chips, the held-item marker, the missing cascade on arm+hand, the bare foot and the bleeding wound card; the Color/Damage/Wounds layer toggles apply bh-hide-*; the close button collapses the dock and releases the reflow. No console or page errors.
  4. node scripts/validate-package-locales.mjs, npm run test:security, and npm run check — the 8 remaining Prettier warnings are pre-existing on staging; every file added here is clean.

Happy to do the install/uninstall/mode pass against a locally served catalog before merge if you would like that ticked first.

Documentation impact

  • No documentation changes needed

The package description now mentions the panel, and it is generated from one constant in the builder so the manifest, agents.json and locale cannot drift.

UI evidence (if applicable)

Captured from the Chromium check above (docked panel, Maggie active, Kheza tab showing an unviewed marker):

  • header with the layer bar (Color / Damage / Wounds), character tabs, and Maggie · human
  • head wound card — serious, bleeding
  • chest Blouse (torn, white swatch), waist Belt (brown), left_leg Trouser (bloodied, black), left_hand Lantern with the held-item marker on the silhouette
  • r. arm and r. hand struck through and tagged MISSING (the distal cascade), r. foot tagged BARE
  • FRONT ⇄ BACK toggle and the three-way layout switcher

I can attach the screenshots to this PR on request.

Summary by CodeRabbit

  • New Features
    • Added the Beholder paper-doll interface for viewing tracked character state from the roleplay toolbar.
    • Supports front/back views, multiple body types, equipment, wounds, colors, held items, and character switching.
    • Added responsive desktop/mobile docking with configurable layers, layouts, character ordering, and saved preferences.
    • Added accessibility labels, tooltips, empty states, and localized interface text.
  • Improvements
    • Improved handling of character updates, hidden characters, aliases, refreshed conversation state, and varied garment and color names.
    • Updated Beholder to version 1.3.0.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Agents/pull/496 **Author:** [@GetBeholder](https://github.com/GetBeholder) **Created:** 8/22/2026 **Status:** ✅ Merged **Merged:** 8/22/2026 **Merged by:** [@GetBeholder](https://github.com/GetBeholder) **Base:** `staging` ← **Head:** `feat/beholder-capability-ui` --- ### 📝 Commits (5) - [`af5c331`](https://github.com/Pasta-Devs/Marinara-Agents/commit/af5c331cbb75735ed11c266e7c259d01b9802ac5) beholder 1.3.0: ship the paper doll as a toolbar capability - [`c7d8cd0`](https://github.com/Pasta-Devs/Marinara-Agents/commit/c7d8cd0ebaac61cc352de6c8302e23de729b6740) test(beholder): make the doll fixture exercise what it claims - [`0586e4c`](https://github.com/Pasta-Devs/Marinara-Agents/commit/0586e4c98a6227b2a704e0ebdc30c724fde19011) fix(beholder): escape prose-derived values, drop the unused merge engine - [`9c17744`](https://github.com/Pasta-Devs/Marinara-Agents/commit/9c177445d42da2ad057f3456438c1ace8a45e05d) fix(beholder): build the character map without a prototype - [`df9bdc5`](https://github.com/Pasta-Devs/Marinara-Agents/commit/df9bdc5b479ed2b5a2de07fe61971800e6f04d2f) Merge remote-tracking branch 'origin/staging' into feat/beholder-capability-ui ### 📊 Changes **22 files changed** (+8507 additions, -32 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/beholder-1.3.0.zip` (+0 -0) 📝 `catalog/catalog.json` (+19 -8) 📝 `catalog/v2/catalog.json` (+19 -8) 📝 `catalog/v3/catalog.json` (+19 -8) 📝 `eslint.config.mjs` (+23 -0) 📝 `packages/beholder/agents.json` (+1 -1) ➕ `packages/beholder/bh-logo.png` (+0 -0) ➕ `packages/beholder/client.js` (+2279 -0) 📝 `packages/beholder/locales/en.json` (+2 -2) 📝 `packages/beholder/manifest.json` (+16 -5) ➕ `packages/beholder/src/00-prelude.js` (+90 -0) ➕ `packages/beholder/src/10-garment-data.js` (+19 -0) ➕ `packages/beholder/src/12-colors.js` (+63 -0) ➕ `packages/beholder/src/15-state.js` (+78 -0) ➕ `packages/beholder/src/30-paperdoll.js` (+1598 -0) ➕ `packages/beholder/src/80-dock.js` (+283 -0) ➕ `packages/beholder/src/90-element.js` (+124 -0) ➕ `packages/beholder/src/fa-embed.css` (+4 -0) ➕ `packages/beholder/src/locales/en.json` (+15 -0) ➕ `packages/beholder/src/style.css` (+3502 -0) _...and 2 more files_ </details> ### 📄 Description # Pull request ## Linked issue Closes #497 ## Why this change - Beholder has tracked physical state since 1.0 but never showed it: there was no way to see what the agent believes, catch it being wrong, or understand what it feeds the prompt. - The panel has to stay opt-in. Beholder is an optional agent, so its UI is contributed by the package and mounted by the host only for chats where the agent is switched on — installs that never add Beholder see nothing, and no Beholder-specific UI lands in the Engine client. ## What changed - `beholder` 1.3.0: adds `entrypoints.client` and the `conversation-toolbar` slot; `client.js`, artifact and catalog entry regenerated. - The paper doll is a **port, not a reimplementation**. The reference extension's renderer is plain ES modules with a pure dependency graph, so its garment data, colors, state helpers and renderer are carried over as package-owned source with imports/exports stripped, concatenated into one IIFE — the shape Pixelforge uses. Markup, class names and stylesheet come with them, which is what keeps the doll identical to the extension's. - New host seam only: the toggle uses the host's own `toolbarButtonClass` rather than cloning a neighbour's classes; the dock slides in from the right and the chat reflows via `--tracker-chat-avoid-right`; offsets are measured from the live layout on open so it never parks on another right-side panel; narrow viewports get the bottom sheet and compact list. Panel state lives in module scope so it survives the remounts the host performs on chat switch, version bump and error retry. - State is read from the agent's existing same-origin route. Extraction lands a few seconds after generation, so the dock re-reads on a short staggered schedule after each turn and stops as soon as the state changes, instead of polling. - `scripts/build-beholder-package.mjs` is new: `build-agent-catalog.mjs` skips client-bearing packages by design, so Beholder owns its build the way Pixelforge does. - `agents.json` prompt templates are untouched — the model is trained against those exact strings. The builder only stamps the `description` the catalog requires to match the manifest, so the diff there is one line. - The stylesheet's remote webfont `@import` is dropped so the client makes no third-party request at runtime. ## Package and security impact - Affected package IDs: `beholder` - Engine compatibility impact: unchanged (`min` stays 2.4.4); the `conversation-toolbar` slot and `toolbarButtonClass` are already provided by that line. - New or changed permissions/entrypoints: adds `entrypoints.client` and `contributions.slots: ["conversation-toolbar"]`. Permissions are unchanged — `ui` was already declared, and it is the one a client entrypoint requires. No `network` permission: the client only calls the Engine's own same-origin route, and the test asserts the bundle references no remote host. - Restart, storage, update, or uninstall impact: `restartRequired` stays false. The client stores two display preferences (layout, layer toggles) in `localStorage` under `marinara.beholder.*`; nothing else is persisted client-side. Uninstalling removes the contribution, so the toggle and panel disappear with it. ## Validation - [x] `node scripts/validate-catalog.mjs` passes locally - [x] `git diff --check` passes locally - [x] Rebuilt every affected manifest, payload, artifact, and catalog entry - [ ] Installed or updated the affected package through Marinara Engine - [ ] Checked supported modes, restart behavior, and uninstall cleanup - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes Two unticked boxes above are honest: this has **not** been installed through a running Engine yet, because the catalog artifact URL resolves only once this is on `main`. What was verified: 1. **Renderer parity.** Rendered a fixture through the reference extension's own renderer and through the ported modules, and compared SHA-256 of the markup across all three layouts × both views — identical in all six. Re-verified after Prettier reformatted the ported files. 2. **Regression test** (`npx tsx tests/beholder-client-contract.regression.ts`): pins those six digests, asserts the fixture actually exercises worn / held / missing / bare / wound / chip markers, and checks the bundle contract (element registration, no remote hosts, every source module present, shipped bytes match the manifest). Confirmed it *fails* when a renderer module is altered, so it is not vacuous. 3. **Functional check in Chromium** (Playwright), driving the shipped `client.js` against a stubbed host: element registers; the toggle renders with the host's class, the brand mark and the localized label; **no panel exists until it is clicked**; clicking docks the panel on screen below the top bar, sets `body.bh-dock-open` and `--tracker-chat-avoid-right: min(500px,94vw)`; the doll renders (2 character tabs, 76 slot elements, the silhouette SVG, ~20KB markup) with worn chips, the held-item marker, the missing cascade on arm+hand, the bare foot and the bleeding wound card; the Color/Damage/Wounds layer toggles apply `bh-hide-*`; the close button collapses the dock and releases the reflow. No console or page errors. 4. `node scripts/validate-package-locales.mjs`, `npm run test:security`, and `npm run check` — the 8 remaining Prettier warnings are pre-existing on `staging`; every file added here is clean. Happy to do the install/uninstall/mode pass against a locally served catalog before merge if you would like that ticked first. ## Documentation impact - [x] No documentation changes needed The package description now mentions the panel, and it is generated from one constant in the builder so the manifest, `agents.json` and locale cannot drift. ## UI evidence (if applicable) Captured from the Chromium check above (docked panel, Maggie active, Kheza tab showing an unviewed marker): - header with the layer bar (Color / Damage / Wounds), character tabs, and `Maggie · human` - head wound card — `serious`, `bleeding` - `chest` Blouse (`torn`, white swatch), `waist` Belt (brown), `left_leg` Trouser (`bloodied`, black), `left_hand` Lantern with the held-item marker on the silhouette - `r. arm` and `r. hand` struck through and tagged MISSING (the distal cascade), `r. foot` tagged BARE - FRONT ⇄ BACK toggle and the three-way layout switcher I can attach the screenshots to this PR on request. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added the Beholder paper-doll interface for viewing tracked character state from the roleplay toolbar. - Supports front/back views, multiple body types, equipment, wounds, colors, held items, and character switching. - Added responsive desktop/mobile docking with configurable layers, layouts, character ordering, and saved preferences. - Added accessibility labels, tooltips, empty states, and localized interface text. - **Improvements** - Improved handling of character updates, hidden characters, aliases, refreshed conversation state, and varied garment and color names. - Updated Beholder to version 1.3.0. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-20 17:33:06 +07:00
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-Agents#999
No description provided.