[GH-ISSUE #8586] [Feature]: On-demand Immersive HTML — a narrator command that asks the agent for a specific artifact #8414

Closed
opened 2026-11-07 16:42:49 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @ylli-selmani on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8586

Originally assigned to: @ylli-selmani on GitHub.

What problem does this solve?

Roleplay Mode can put in-world HTML on screen in exactly two ways, and both sit at an extreme:

  • The Documents command ([document: kind="note|letter|journal|report|poster|terminal" title="…" content="…"]) is instant and free, but the Engine renders one of six fixed kinds with a randomized built-in style, and its prompt line explicitly forbids HTML/CSS. A narrator cannot ask for a bespoke artifact; "a spellbook page" becomes a letter-styled card.
  • The Immersive HTML agent produces genuinely bespoke HTML/CSS/JS, but it is a post-processing rewrite that runs automatically after every reply (one model call per message) and chooses the visual itself. There is no way to say "this moment needs exactly this, make it".

Users therefore either pay an agent call on every message for artifacts they may not want, or settle for a generic styled card. Some presets go the other way and paste full HTML instructions into the narrator prompt, bloating it for every turn.

Proposed solution

Let the narrator request an artifact with a free-form instruction, the same way [illustrate: subject="…"] requests an image from the Illustrator, and run the Immersive HTML agent once, only then:

  • New Roleplay command [html: prompt="…"], advertised to the model only when the Immersive HTML agent is added to the chat (mirroring [illustrate], which requires the Illustrator).
  • When a reply carries the command, the text-rewrite stage runs the HTML agent solo (never merged with Prose Guardian / Continuity) with an injected guided-request block, so the artifact is built for that request instead of the agent deciding on its own. The command is stripped from the visible text and the artifact lands in the message.
  • A per-chat setting on the Immersive HTML card, Automatic (today's behavior, default) or Only when asked (no automatic runs; the command is the only trigger).
  • A user-facing twin, /html <prompt>, mirroring /illustrate — a one-shot run on the current message that also works when the agent is not added.
  • The six prebuilt document kinds stay exactly as they are: they remain the free, zero-call path.

Alternatives considered

  • Extend [document] with an optional prompt= field instead of a new key. Cheaper (no new toggle), but gives one command two very different cost and behavior profiles, and makes its kind/style rendering meaningless for agent runs.
  • Return a standalone artifact card instead of rewriting the reply. Closer in spirit to Documents, but needs a new result type, storage and client renderer — much larger than the rewrite contract the agent already has.
  • Reuse agent-wide runInterval: 0 for manual-only. No new UI, but it is per-agent rather than per-chat, and 0 currently means "never" for every other agent type. It also does nothing for text_rewrite agents today, so the skip logic is needed either way.

Additional context

  • Vision item: .tmp/vision_list.md § Other, with three screenshots (vision-screenshots/2026-10-31-1565879834062880939-{1,2,3}.png).
  • Precedent: [illustrate: subject="…"] (advertised only with the Illustrator active), and the Gallery//illustrate one-shot retry that runs an agent without opting the chat into automatic runs.
  • Follow-up on the agent side: the html agent is a downloadable capability package (packages/html in Pasta-Devs/Marinara-Agents), so teaching it to use the guided-request block gracefully is a separate PR there. The Engine side is self-contained.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @ylli-selmani on GitHub (Oct 31, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8586 Originally assigned to: @ylli-selmani on GitHub. ## What problem does this solve? Roleplay Mode can put in-world HTML on screen in exactly two ways, and both sit at an extreme: - The **Documents** command (`[document: kind="note|letter|journal|report|poster|terminal" title="…" content="…"]`) is instant and free, but the Engine renders one of six fixed kinds with a randomized built-in style, and its prompt line explicitly forbids HTML/CSS. A narrator cannot ask for a bespoke artifact; "a spellbook page" becomes a letter-styled card. - The **Immersive HTML** agent produces genuinely bespoke HTML/CSS/JS, but it is a post-processing rewrite that runs automatically after every reply (one model call per message) and chooses the visual itself. There is no way to say "this moment needs exactly this, make it". Users therefore either pay an agent call on every message for artifacts they may not want, or settle for a generic styled card. Some presets go the other way and paste full HTML instructions into the narrator prompt, bloating it for every turn. ## Proposed solution Let the narrator **request** an artifact with a free-form instruction, the same way `[illustrate: subject="…"]` requests an image from the Illustrator, and run the Immersive HTML agent once, only then: - New Roleplay command `[html: prompt="…"]`, advertised to the model only when the Immersive HTML agent is added to the chat (mirroring `[illustrate]`, which requires the Illustrator). - When a reply carries the command, the text-rewrite stage runs the HTML agent **solo** (never merged with Prose Guardian / Continuity) with an injected guided-request block, so the artifact is built for that request instead of the agent deciding on its own. The command is stripped from the visible text and the artifact lands in the message. - A per-chat setting on the Immersive HTML card, **Automatic** (today's behavior, default) or **Only when asked** (no automatic runs; the command is the only trigger). - A user-facing twin, `/html <prompt>`, mirroring `/illustrate` — a one-shot run on the current message that also works when the agent is not added. - The six prebuilt document kinds stay exactly as they are: they remain the free, zero-call path. ## Alternatives considered - **Extend `[document]` with an optional `prompt=` field** instead of a new key. Cheaper (no new toggle), but gives one command two very different cost and behavior profiles, and makes its `kind`/style rendering meaningless for agent runs. - **Return a standalone artifact card** instead of rewriting the reply. Closer in spirit to Documents, but needs a new result type, storage and client renderer — much larger than the rewrite contract the agent already has. - **Reuse agent-wide `runInterval: 0`** for manual-only. No new UI, but it is per-agent rather than per-chat, and 0 currently means "never" for every other agent type. It also does nothing for `text_rewrite` agents today, so the skip logic is needed either way. ## Additional context - Vision item: `.tmp/vision_list.md` § Other, with three screenshots (`vision-screenshots/2026-10-31-1565879834062880939-{1,2,3}.png`). - Precedent: `[illustrate: subject="…"]` (advertised only with the Illustrator active), and the Gallery/`/illustrate` one-shot retry that runs an agent without opting the chat into automatic runs. - Follow-up on the agent side: the `html` agent is a downloadable capability package (`packages/html` in `Pasta-Devs/Marinara-Agents`), so teaching it to use the guided-request block gracefully is a separate PR there. The Engine side is self-contained. ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-11-07 16:42:49 +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-Engine#8414
No description provided.