mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
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#8638
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/8500
Author: @kolacheee
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @kolacheee
Base:
staging← Head:claude/project-thread-mhcusi📝 Commits (2)
a13266fLet Browser Extensions register dice formats for /roll6be8c6dTreat a blank dice-format description or read text as absent📊 Changes
9 files changed (+797 additions, -5 deletions)
View changed files
📝
docs/extending/personal-extensions.md(+35 -0)📝
docs/extending/writing-personal-extensions.md(+2 -1)📝
packages/client/src/components/layout/PersonalExtensionInjector.tsx(+33 -1)➕
packages/client/src/lib/personal-extension-dice-formats.ts(+219 -0)📝
packages/client/src/lib/slash-commands.ts(+23 -1)📝
packages/server/src/routes/personal-extensions.routes.ts(+139 -1)📝
packages/shared/src/types/personal-extension.ts(+25 -0)➕
scripts/regressions/extension-dice-formats.regression.ts(+320 -0)📝
scripts/regressions/extension-security.regression.ts(+1 -1)📄 Description
Linked issue
Part of #8489. It follows #8495 and #8497 and is item 3 of the plan posted on the issue: a small hook so an extension can bring a dice system (for example Genesys-style narrative dice) to
/rollwithout being able to choose its own faces.Why this change
The issue asks for extension-defined dice formats. Marinara's plain rollers only read
NdMand keep/drop pools, so any other notation is refused. Letting extensions roll on their own would let them pick the faces; this keeps the throwing in Marinara.What changed
marinara.dice.registerFormat({ id, label, description?, parse, read }).parse(notation)returnsnull, or{ dice: [sides, ...] }naming the dice to throw (1-100 dice, 2-1000 sides). Anything else it returns stays in the sandbox and comes back toreadasplan.read({ notation, dice, rolls, plan }), which returns{ total, text?, kept? }./rollasks the registered formats, in registration order, only for notation the shared grammar does not read.2d6,4d6kh3and even a refused500d6never reach an extension. The first format whoseparsereturns dice rolls it./rollin the browser. The GM'sroll_dicetool and other server-side rolls keep the built-in notation and ruleset dice, and full-page extensions don't get the hook.Validation
pnpm checkpasses locallyCONTRIBUTING.mdClient and server typecheck clean. New
extension-dice-formatsregression runs the real sandbox Worker source and the host registry. It covers registering and validating formats, the host throwing the named dice and the extension only seeing those faces, refused dice/faces/totals/text/kept on both sides, stopping an extension mid-request, and/rollescaping the extension's text and never sendingNdMto an extension. Also passing: extension-security (API version assertion moved to 6), extension-token-estimator, extension-ipc, dice-notation, roleplay-commands.Manual verification notes
docs/extending/personal-extensions.md, imported as an External Extension, makes/roll 2 boost 1 setbackpost the faces, total and text./roll 2d6still rolls normally with that extension enabled./roll 2 boostshow "Invalid dice notation" again.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)docs/extending/personal-extensions.mdgains an "Add a dice format" section, anddocs/extending/writing-personal-extensions.mdgains one API table row. Both are added to the docs-i18n catch-up issue #8499.UI evidence (if applicable)
No new UI. An extension roll posts as an ordinary narrator message, without the dice card (the card draws one die shape per roll, which doesn't fit mixed or symbol dice).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.