yasuki_web.snapshot.serialize_snapshot#

serialize_snapshot(snapshot, token_names=None)[source]#

Serialize a redacted ViewSnapshot to the JSON-ready shape the board client renders from.

Cards the viewer may not identify are already HiddenCard stubs in the snapshot, so this serializer cannot leak an identity it was not handed. Zone and deck keys are flattened to stable strings ("P1:province:0", "P2:fate").

token_names maps a creatable-token card id to its display name; when given, a battlefield or province card that creates tokens carries a creates list for the per-card “Create” menu (a face-down province card is a HiddenCard stub, so its creations stay concealed).