No description
Find a file
Vassili Minaev c7159ee84b End Session macro flow
Adds the GM-facing end-of-session orchestration. The expected use is a
Foundry macro of type Script with body:

  seitimeBridge.endSession();

Flow:
1. Fetch scheduled sessions for this world from Frappe.
2. If 0 → notify and abort. If 1 → confirm dialog. If 2+ → picker dialog.
3. POST complete_session to mark the chosen session Completed and
   schedule the next one (Frappe-side schedule_next_session).
4. Push snapshots for every PC in parallel (Promise.allSettled — partial
   failures are surfaced, not fatal).
5. Whisper a summary chat message to the GM (counts and any failed
   actor names with errors).

scripts/macros.js holds the orchestration; scripts/api.js gains thin
fetch wrappers for list_scheduled_sessions and complete_session. HTML in
dialogs and chat is escaped on output since session titles ultimately
come from user input.

Public API now: testConnection, pushManifest, pushSnapshot,
pushAllSnapshots, endSession.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 02:51:01 -06:00
scripts End Session macro flow 2026-05-10 02:51:01 -06:00
.gitignore Initial scaffolding: settings + manifest push 2026-05-10 02:26:53 -06:00
module.json Initial scaffolding: settings + manifest push 2026-05-10 02:26:53 -06:00