Running bundled card scripts on a phone: MVU status bars, EJS templates, and one-time plugin grants
Shipping with the next Android and iPhone update: bundled TavernHelper character card scripts (MVU status bars, variable macros, script buttons) and EJS lorebook templates now run on mobile, alongside new background, tool-calling, network, and image capabilities for local zip plugins — governed by a single upfront permission prompt, per-turn/daily caps, and itemized request logs.

Until now, importing an interactive character card into Foreverse meant the app read its regex rules and HTML beautification, while leaving bundled TavernHelper scripts (extensions.tavern_helper.scripts) inert. Cards built around the MVU variable framework or <% %> lorebook logic could render their static markup, yet variables never ticked forward on their own and script buttons stayed hidden.
We have finished building card script execution and expanded user-plugin permissions on both Android and iPhone; everything below ships with the next update on both platforms. Starting in the next update, bundled card scripts run in the background of your chat, EJS lorebook templates evaluate before each send, and local zip plugins gain background hooks, mid-reply tool calling, scoped networking, and image generation — all organized around a single confirmation when you flip a switch on, backed by per-turn and daily caps and a line item for every paid call in your API request log.
1. Bundled character card scripts: one prompt on entry, one switch to manage
Starting in the next update, the first time you open a chat with a card carrying TavernHelper scripts, Foreverse shows a single prompt — “Run the scripts that come with [card name]?” — listing in plain language what those scripts can do:
- Read and write variables for this chat (stats, state);
- Rewrite, add, or hide chat messages;
- Append text to what gets sent to the AI;
- Display buttons, status bars, and small panels in the chat view and inside messages.
At the bottom sits an optional Call AI checkbox. Leaving it unchecked means the script cannot trigger model calls at all; checking it allows up to 3 calls per turn (which spend credits and appear in your API request log as Plugin · card_script:CardName). Tap Turn on once and the app stops asking — unless the card's scripts are updated later, which triggers a fresh prompt. Tap Not now and it stays quiet for that session.
Enabling a card's scripts also turns on the status bars and panel scripts inside its messages in one go, so you no longer have to tap “Script off · enable” on individual message bubbles. Script-registered buttons line up right above the message input bar; floating orbs or mini-panels drawn by a script hover over the chat canvas, capturing taps only on the widget itself while the rest of the screen scrolls and taps normally.
To check on scripts later or turn them off, open ⋮ → Current status → Automation → Card scripts (which shows “On · N” or “Off · N”). Turning the switch off stops script execution and removes buttons and floating widgets immediately, while keeping every variable and message already written. If a script fails to run, that row turns orange and the Automation console has the details. Right on the same Current status page sits a Regex styling row that jumps straight to regex management — handy when a card author exported their beautify regex switched off by default.
2. MVU status bars and TavernHelper variable macros
The MVU (MagVarUpdate) variable framework runs unmodified starting in the next update: variables update automatically after each AI reply, regenerating a reply rolls stats back to the previous message's snapshot, and card-supplied buttons (such as “Reprocess variables”) and status bars work as intended.
TavernHelper's variable macros are supported alongside it: {{get_message_variable::stat_data}}, get_chat_variable, get_global_variable, and the YAML-formatted format_…_variable family. Lorebook entries that use these macros to feed current affection, location, or inventory into the prompt now expand to live values at send time.
In our offline test harness, the real MVU package passed across eight popular community cards (Zhou Chengye, Pei Junyue, Tan Yao, Heart Journey System, Yin Bai'an, Border Tavern Management Notes, Saniwa's House of Trouble, and Poem of Destiny). We also ran “Zhou Chengye” against a live DeepSeek model in an Android test environment and verified its status bar values updating turn by turn.
3. EJS prompt templates in lorebooks
Many stateful cards embed <% %> EJS logic inside lorebook entries to swap lore branches or advance plot stages based on variables. When a card's lorebook contains EJS templates, the initial permission prompt includes an extra line noting that lorebook entries will be rendered against current variables before each send, for that request only.
At send time, templates evaluate against current variables: the rendered text goes into that single outgoing request without overwriting the saved lorebook entry, while any variables mutated inside the template do save back. If the renderer is not ready yet, hits the 8-second timeout, or throws an error, prompt assembly falls back cleanly without holding up your message — and never sends raw template code to the model.
Across a scan of 610 template entries pulled from 151 cards, 96.7% rendered cleanly; the rest were syntax errors in the cards themselves or calls to functions we do not provide. What is not built yet: display-time template rendering inside messages (such as [RENDER:*] or templates written directly in message prose) and templates inside character description or persona fields.
4. New capabilities for plugins you install yourself
Beyond the built-in switches covered in our Plugin Center tour, you can sideload local zip packages via Plugin center → My plugins → Install plugin (community distribution is not open yet; installation is local zip only). Each plugin declares its permissions in manifest.json: install lists every permission item by item (highlighting high-risk ones in red), and flipping the plugin on asks for confirmation once rather than nagging on every call.
Function signatures match TavernHelper — plugins can call helpers directly or as TavernHelper.xxx, and unimplemented calls throw an explicit FvUnsupportedError explaining why. Opening the Plugin center from inside a chat also exposes a This character only setting under each user plugin, so you can turn a plugin off for individual characters.
| Capability | How it surfaces at grant & runtime | Caps & boundaries |
|---|---|---|
| Background execution | Stays alive in the chat background receiving events (new reply, chat switch, regenerate); if you exceed the limit, an entry toast names which plugins were skipped so you can disable unused ones | Up to 4 background plugins per chat; extras stay off for that session |
| Plugin storage | Listed during install and enable | Scoped to the plugin's own data and wiped on uninstall |
| Prompt injection & macros | Appends text to model input or registers custom macros like {{好感度}} (affection) | Active while the plugin switch is on |
| Slash commands | Registers commands such as /affection +5 or /dice 2d6 | Cannot register names that collide with built-in commands |
| Pre-send request rewrite | Grant prompt lists on its own line: 'Read everything sent to the AI: chat history, world info and variables' | Modifies only the outgoing payload; never writes back to chat history |
| Mid-reply tool calling | Lets the model call a plugin function mid-reply (e.g. rolling dice) and continue writing; shows '“Plugin name” is working…'. Not offered to the model, with a clear notice, while Smart Roleplay is on | Up to 16 functions per plugin, at most 3 tool-call steps per turn |
| Call AI | Spends credits; logged in the API request log under the plugin's name | Default cap of 3 calls per turn (plugin may declare up to 6) |
| Generate images | Spends credits using the chat's image model; requests confirmed unsent refund daily quota. If an image generated but failed to save locally, a notice states 'Charged — generation succeeded, do not retry' so you can check Me → Request log | Default cap of 10 images per day (configurable per plugin manifest) |
| Play audio | Plays audio files bundled inside the plugin zip (such as BGM); playlists made entirely of remote URLs receive an explicit unsupported error | Corrupted audio files are skipped automatically |
| Network access | Every declared domain is listed individually on the permission prompt | Up to 16 domains, HTTPS only; blocks localhost, LAN, and raw IPs; never sends your account, API keys, or cookies, and strips credentials on cross-origin redirects; ≤ 1 MB per response, ≤ 30 requests/min per plugin |
5. Six sample plugins we built and tested
To verify these APIs against real extension workflows, we built six functional equivalents of popular desktop add-ons using our plugin interface (with automated test suites covering Dice Function and Affection & Dice):
| Sample plugin | Desktop counterpart | Measured behavior |
|---|---|---|
| Think Before Answering | Stepped Thinking | Injects a 'think it through first' instruction into the outgoing model request without cluttering the visible chat log |
| Live Weather | None | Fetched Shanghai 'Clear, 16°C' from Open-Meteo and carried it automatically into the next turn's prompt |
| Background Music | EchoCore | Auto-plays on chat entry with /bgm off, /bgm on, and /bgm 30 volume controls |
| Auto Illustration | Image Auto Generation | Spots 【插图:…】 (illustration) tags in replies, generates an image with a live image model, and attaches it below the message (capped at 5/day) |
| Dice Function | (Tool-calling demo) | Model pauses mid-reply to call roll_dice, receives the roll outcome, and writes the rest of the scene around it |
| Affection & Dice | Simplified status-bar extension | Provides a {{好感度}} (affection) macro alongside /affection +5 and /dice 2d6 commands |
6. What still does not work
Several clear boundaries remain in the next update, and we want them stated upfront:
- Desktop SillyTavern third-party extensions cannot be installed as-is: they mutate the desktop web app's DOM directly, and the mobile app has no such webpage. What we support is the TavernHelper script API and plugins written for our plugin API.
- Card scripts that manipulate the desktop tavern DOM cannot run: “mini-phone” cards are the classic example. When you open one, the chat itself runs fine and card diagnostics explain why the script was skipped rather than failing silently.
- Group chats do not run character card scripts: multiple cards each maintaining their own variable schemas would overwrite one another.
- Card scripts cannot make arbitrary network requests: a card script cannot edit the lorebook, and its own
fetchcannot reach the internet — the only two network paths are pinned public-CDN package downloads and explicitly granted networking inside message web widgets.
7. Why we designed it this way
In the Chinese roleplay community, MVU status bars, EJS lorebook templates, and mini-phone cards are all built on top of TavernHelper. Supporting the TavernHelper script interface unlocks existing cards right away — far more worthwhile than porting English desktop extensions one by one.
The permission model comes from an equally practical annoyance: nobody wants a confirmation modal popping up mid-scene every time a paid plugin runs. Moving consent to the moment you toggle a script or plugin on lets us spell out what it can touch and cap what it can spend per turn and per day, once. After that, the caps hold the ceiling and the API request log records every plugin charge under its own name. For message-level HTML and regex rendering rules, see the beautify spec.
FAQ
When can I run character card scripts and MVU status bars on my phone?
Everything described here is finished on both Android and iPhone and ships with the next update on both platforms. Once updated, opening a chat with a scripted card prompts you once to enable its scripts — turning on MVU status bars, variable macros, script buttons, EJS lorebook templates, and any status panels inside messages all together.
Can a card script or custom plugin quietly burn through my credits?
Hard caps and itemized logs keep spending bounded. Card scripts cannot call AI at all unless you tick 'Call AI' at the bottom of the permission prompt, and even then they are capped at 3 calls per turn. Sideloaded plugins default to at most 3 AI calls per turn (up to 6 if declared) and 10 generated images per day. Every charge appears in your API request log under the plugin's name or 'Plugin · card_script:CardName', and you can flip the switch off anytime.
Can I install desktop SillyTavern third-party extensions directly?
Not out of the box. Desktop SillyTavern extensions reach directly into the browser page's DOM, which does not exist in a native mobile app. What we support is the TavernHelper script API — plus local zip plugins written against our plugin API. Card scripts that directly manipulate the desktop tavern webpage (such as 'mini-phone' cards) cannot run either; card diagnostics will explain why.
How do MVU cards that pull packages from jsdelivr stay safe if the remote file changes?
The permission prompt names the download source upfront (restricted to URLs explicitly written in the card script on public CDNs: jsdelivr mirrors, unpkg, esm.sh, and cdnjs, capped at 12 MB per file and 48 MB per card). On first run, the app downloads the file once and pins it locally by content. Every run after that uses the local copy, so a remote edit by the card author cannot silently swap out code on your phone.
Questions or ideas? Join our Discord →