Skip to content

[Tracking] Adventure import: actor-model sync between module and Elixir proxy #9

Description

@digitsu

Tracking issue for the actor-sync feature.

When a GM imports an adventure PDF, the AI extracts a character roster (PCs and NPCs) which is stored on the Elixir proxy and shown in the cast selection dialog. The current flow handles the case where extraction yields nothing (the dialog shows "no playable characters" and the GM can cancel), but there is no bridge between the extracted character roster and Foundry Actor documents:

  • Extracted PCs are not reconciled against existing game.actors — the GM has to manually create or match Actors to characters.
  • Extracted NPCs marked "Loremaster controlled" don't materialise as Actors that the AI can reference via tool-handlers.mjs actor-query tools.
  • Edits made on the Foundry Actor side (stats, biographies, items) don't flow back to the proxy's character store, so the AI's view of the cast can drift from what's on the table.

Affected files:

  • scripts/cast-selection-dialog.mjs
  • scripts/content-manager.mjs:1430-1487
  • scripts/data-extractor.mjs
  • Server-side character store on the Elixir proxy

User-reported symptom: importing adventures that don't have clear preset actors requires a manual character sync to the actor model.

Proposed scope:

  1. Reconciliation pass on cast selection: match extracted character names against existing game.actors; offer "create Actor", "link to existing Actor", or "skip" per character.
  2. Bidirectional sync: changes on either side propagate. Server-side authoritative for AI-controlled NPCs; Foundry-side authoritative for player-controlled PCs.
  3. Tool-handler integration: the AI can query an Actor by character name and get current stats from Foundry, not just the proxy's stale roster snapshot.
  4. Conflict handling: define what wins when both sides edit between syncs.

Out of scope (first cut):

  • Token placement / scene wiring
  • Compendium import

Sequencing: the UI structural bugs filed alongside this tracking issue should be cleaned up first; this work resumes after that. Filed now so the design discussion has somewhere to live.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions