Build an action's scope from a clicked chat-card element's dataset.
A card's button carries its per-action scope as a single serialized blob in
data-scope — JSON.stringify(defaultToJSON(scope)) — holding the rich
objects (results, modifiers, request payloads) with their __kind tags. This
revives it with defaultFromJSON, so a nested AttackResult /
OpposedTestResult comes back as a live instance. Routing/dispatch metadata
(data-action, the data-*-handler-uuid keys) lives in its own flat
attributes, read directly off the dataset before scope — it is deliberately
not folded into scope.
Parameters
dataset: DOMStringMap
The clicked element's dataset.
parent: unknown
The owning logic supplied to revived registered instances.
Returns UnknownObject
The revived data-scope payload (empty object when absent).
Throws
Error if data-scope contains a legacy __func__: code marker —
rejected outright as defense-in-depth on this untrusted cross-client path
(see the Security Model). May also propagate a JSON.parse error for a
malformed blob.
Build an action's
scopefrom a clicked chat-card element's dataset.A card's button carries its per-action
scopeas a single serialized blob indata-scope—JSON.stringify(defaultToJSON(scope))— holding the rich objects (results, modifiers, request payloads) with their__kindtags. This revives it with defaultFromJSON, so a nestedAttackResult/OpposedTestResultcomes back as a live instance. Routing/dispatch metadata (data-action, thedata-*-handler-uuidkeys) lives in its own flat attributes, read directly off the dataset before scope — it is deliberately not folded into scope.