Foundry side of the per-PC snapshot flow: the primary GM pushes a debounced
snapshot of any character that gets edited, including embedded item changes
(updateItem/createItem/deleteItem don't trigger updateActor in v12).
Payload is actor.toObject() augmented with a denormalized _player_name
field — the Frappe extractor reads it from there since Foundry's ownership
map uses opaque user IDs.
Per-actor debouncers (default 5s, configurable) keep combat HP edits from
spamming the webhook. Toggle off via the snapshotAutoSync setting if you
want explicit-only pushes from a macro.
API exposed at globalThis.seitimeBridge.pushSnapshot(actor) for manual
pushes (single argument: a Foundry Actor document).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Foundry v12 ESM module that pushes the world's PC actor manifest to a
companion Frappe app via webhook.
Structure:
- scripts/main.js: registers settings on init, exposes API on ready,
wires createActor/deleteActor/periodic hooks. All push operations
gated to game.users.activeGM to avoid duplicate pushes from co-GMs.
- scripts/settings.js: Frappe URL, shared secret, world ID, periodic
interval. Secret uses `secret: true` for masked input but is still
readable by all connected clients (documented in setting hint).
- scripts/api.js: bridgeFetch helper with X-Bridge-Secret/-World
headers, pushManifest, testConnection.
- scripts/constants.js: MODULE_ID.
Public API exposed at globalThis.seitimeBridge:
seitimeBridge.testConnection() // round-trip empty manifest
seitimeBridge.pushManifest() // push current world manifest
dnd5e is declared as a related system in module.json.
Snapshot push and End Session macro come in subsequent commits.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>