[Foundry P2] pf2e npc_to_actor + "Send to Foundry" on NPC generation #9

Open
opened 2026-06-23 00:42:34 +00:00 by rbrooks · 3 comments
Owner

Push Quest Board-generated NPCs into Foundry.

Scope

  • Extend the pf2e adapter with npc_to_actor(generated_npc).
  • Add a "Send to Foundry" button on the NPC generation UI.
  • POST the generated stat block to Foundry's actor directory via the REST API.
  • Button is hidden when the active campaign's adapter returns None for npc_to_actor.

Done when

  • A GM can push a generated PF2e NPC into the connected Foundry world's actor directory in one click.

Roadmap: Phase 2 steps 7-9. Depends on Phase 1 (#adapter scaffolding, settings, health check).

Push Quest Board-generated NPCs into Foundry. ## Scope - Extend the `pf2e` adapter with `npc_to_actor(generated_npc)`. - Add a **"Send to Foundry"** button on the NPC generation UI. - POST the generated stat block to Foundry's actor directory via the REST API. - Button is hidden when the active campaign's adapter returns `None` for `npc_to_actor`. ## Done when - A GM can push a generated PF2e NPC into the connected Foundry world's actor directory in one click. _Roadmap: Phase 2 steps 7-9. Depends on Phase 1 (#adapter scaffolding, settings, health check)._
rbrooks added this to the (deleted) milestone 2026-06-23 00:42:34 +00:00
Collaborator

Picked up as Foundry slice 2, "Push" (2026-11-08). The contract is docs/design/foundry-push.md on feat/9-foundry-push, over slice 1 (#5, #6, PR #1368).

It covers #9, #146 (links), #7 (adapters, keyed by the campaign's one game system, #151) and #148 (sidebar rows), plus:

  • the D335 queue: Postgres, claimed atomically by the holder, a Redis DB 0 nudge, a heartbeat drain, requeue on close, failed after 5 tries, expiry;
  • applied-once through actor flags;
  • the D342 whispers;
  • "N waiting" on Settings → Foundry.

Found while scoping:

  • Conjure's NPCs have no stats (name, occupation, want, secret, voice).
  • The importer drops a creature's embedded items (attacks and spells).
  • pf2e schema_v1 has no saves or skills.

That's why there are three questions for the owner: Q251 (where the button goes), Q252 (rules-library creatures; the recommendation is the world's own compendium first) and Q253 (how long a send waits; 14 days recommended). The backend and the module are being built now in a way that suits any answer.

**Picked up as Foundry slice 2, "Push" (2026-11-08).** The contract is `docs/design/foundry-push.md` on `feat/9-foundry-push`, over slice 1 (#5, #6, PR #1368). It covers #9, #146 (links), #7 (adapters, keyed by the campaign's one game system, #151) and #148 (sidebar rows), plus: - the D335 queue: Postgres, claimed atomically by the holder, a Redis DB 0 nudge, a heartbeat drain, requeue on close, failed after 5 tries, expiry; - applied-once through actor flags; - the D342 whispers; - "N waiting" on Settings → Foundry. **Found while scoping:** - Conjure's NPCs have no stats (name, occupation, want, secret, voice). - The importer drops a creature's embedded items (attacks and spells). - pf2e `schema_v1` has no saves or skills. That's why there are three questions for the owner: Q251 (where the button goes), Q252 (rules-library creatures; the recommendation is the world's own compendium first) and Q253 (how long a send waits; 14 days recommended). The backend and the module are being built now in a way that suits any answer.
Collaborator

Owner's answers (2026-11-09), recorded as D343–D345, all as recommended:

  • Where the button goes: Send to Foundry goes on a conjured NPC (name and notes) and on an NPC's wiki page (stat block); a rules-library creature gets it too. The split button and live scene stay v5.1.
  • Rules-library creatures: the world's own pf2e compendium first; otherwise our copy without attacks, saying so.
  • Waiting: a send waits 14 days, then fails with the reason and can be sent again.

The backend (#1369, CI green) already does D344 and D345. The buttons and "N waiting" are being built now. Their wording, with the seven whispers, is on the Wording Review page as part "ad" (23 rows).

**Owner's answers (2026-11-09), recorded as D343–D345, all as recommended:** - **Where the button goes:** Send to Foundry goes on a conjured NPC (name and notes) and on an NPC's wiki page (stat block); a rules-library creature gets it too. The split button and live scene stay v5.1. - **Rules-library creatures:** the world's own pf2e compendium first; otherwise our copy without attacks, saying so. - **Waiting:** a send waits 14 days, then fails with the reason and can be sent again. The backend (#1369, CI green) already does D344 and D345. The buttons and "N waiting" are being built now. Their wording, with the seven whispers, is on the Wording Review page as part "ad" (23 rows).
Collaborator

Send to Foundry UI built and checked (2026-11-09), on #1369:

  • Placements (D343): the button is on a conjured NPC (Prep drawer), an NPC or creature wiki page and a rules-library creature. Settings → Foundry has the waiting list with Cancel, plus failure, expired and mismatch lines.
  • can_send: the status now carries it (paired, an adapter for the campaign's game system, and no mismatch), so the button never shows when a send can't work.
  • Security review: sidebar rows go by an allowlist (only the table's in public, only the GMs' in GM notes). Page text was fixed earlier: the table's text in public, :::gm blocks in private, players' blocks never sent.
  • Render check: 36 shots, no console errors, no overflow at 390. The one axe finding, label-content-name-mismatch, is fixed: the names now start with the visible label.
  • Wording: part "ad" (25 rows) is all approved by the owner, and the code matches.

Left before merge: a live push to foundry-dev with the owner (after the first pairing, #5), and v4.8.0 final.

**Send to Foundry UI built and checked (2026-11-09), on #1369:** - **Placements (D343):** the button is on a conjured NPC (Prep drawer), an NPC or creature wiki page and a rules-library creature. Settings → Foundry has the waiting list with Cancel, plus failure, expired and mismatch lines. - **`can_send`:** the status now carries it (paired, an adapter for the campaign's game system, and no mismatch), so the button never shows when a send can't work. - **Security review:** sidebar rows go by an allowlist (only the table's in public, only the GMs' in GM notes). Page text was fixed earlier: the table's text in public, `:::gm` blocks in private, players' blocks never sent. - **Render check:** 36 shots, no console errors, no overflow at 390. The one axe finding, label-content-name-mismatch, is fixed: the names now start with the visible label. - **Wording:** part "ad" (25 rows) is all approved by the owner, and the code matches. **Left before merge:** a live push to foundry-dev with the owner (after the first pairing, #5), and v4.8.0 final.
Sign in to join this conversation.
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rbrooks/Quest-Board#9
No description provided.