You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: system detection and character field templates (F-3)
Enable Foundry module to detect game system and match against Chronicle.
Prerequisite for actor/character sheet sync in F-4.
Server:
- Expand dnd5e character preset from 4 to 15 fields (ability scores, HP, AC, speed, proficiency)
- Add pf2e character preset with 15 PF2e-specific fields (ancestry, heritage, ability mods, etc)
- Add CharacterPreset() helper on SystemManifest for finding character presets
- New GET /api/v1/campaigns/:id/systems endpoint returning systems with enabled flag
- Inject AddonChecker into APIHandler via SetAddonChecker()
Foundry module:
- SYSTEM_MAP table mapping Foundry game.system.id to Chronicle system IDs
- SyncManager._detectSystem() queries systems API on start, stores matched system
- New syncCharacters boolean setting and detectedSystem internal setting
- Dashboard Status tab shows system match info and character sync availability
- i18n keys for system detection UI
https://claude.ai/code/session_01XMwxFR8BCi5XvgaSVMSBZB
2026-03-12 -- **Sprint F-3: System Detection & Character Field Templates.**
12
+
13
+
33.**Sprint F-3: System detection & character field templates (DONE).**
14
+
-**Server: Manifest expansion** — dnd5e character preset expanded from 4 to 15 fields (added ability scores, HP, AC, speed, proficiency_bonus). New pf2e character preset with 15 PF2e-specific fields (ancestry, heritage, ability mods, perception, etc). Added `CharacterPreset()` method on `SystemManifest`.
15
+
-**Server: Systems API** — New `GET /api/v1/campaigns/:id/systems` endpoint returning all registered systems with `enabled` flag per campaign (via `AddonChecker`). `addonChecker` injected into `APIHandler` via `SetAddonChecker()`.
16
+
-**Foundry: System detection** — `SYSTEM_MAP` maps Foundry `game.system.id` → Chronicle system IDs (`dnd5e`, `pf2e`, `drawsteel`). `SyncManager._detectSystem()` queries systems API on start, stores matched system in `detectedSystem` setting. New `syncCharacters` boolean setting (gated on system match).
17
+
-**Foundry: Dashboard** — Status tab shows Foundry system, Chronicle system match (green check/red X), and character sync availability.
18
+
-**Next:** F-4 (Actor ↔ Entity Sync) — new `actor-sync.mjs` with system-specific adapters.
-[x]**Sprint F-1: Journal Sync Fidelity** — Multi-page journal sync (split entity `entry_html` by headings into Foundry pages, concatenate pages back on Foundry→Chronicle). Ownership change hook (detect ownership changes in `updateJournalEntry` hook, push to Chronicle). Helpers: `_splitByHeadings`, `_collectTextPages`, `_syncPagesToJournal`.
287
287
-[x]**Sprint F-2: Granular Permission Mapping** — Map Chronicle `visibility: 'custom'` + `entity_permissions` to Foundry per-user ownership levels (view→OBSERVER, edit→OWNER). New syncapi endpoints: `GET /entities/:eid/permissions`, `PUT /entities/:eid/permissions`. Reverse-map Foundry ownership changes back to Chronicle. Helpers: `_buildOwnership`, `_pushPermissions`. User-specific grants stored in flags but not mapped to Foundry users (requires user ID mapping table — deferred).
288
-
-[]**Sprint F-3: System Detection & Character Field Templates** — Foundry module reads `game.system.id`, matches against Chronicle campaign systems via `GET /campaigns/:id/systems`. System ID mapping table (`dnd5e→dnd5e`, `pf2e→pathfinder2e`). `CharacterFields()` on System interface. Per-system `character_fields.json` (D&D 5e: abilities, HP, AC, level, class, skills; PF2e: equivalent). Apply field template to "Character" entity type on system enable.
288
+
-[x]**Sprint F-3: System Detection & Character Field Templates** — Expanded dnd5e character preset (15 fields: class, level, race, alignment + 6 ability scores + HP/AC/speed/proficiency). Added pf2e character preset (15 fields: class, level, ancestry, heritage + 6 ability mods + HP/AC/perception/speed). `CharacterPreset()`helper on `SystemManifest`. New `GET /api/v1/campaigns/:id/systems` endpoint returns available systems with enabled flag. Foundry module: `syncCharacters` + `detectedSystem` settings, `SYSTEM_MAP` table, `_detectSystem()` on start, `getMatchedSystem()` accessor. Dashboard Status tab shows system match info and character sync availability.
289
289
-[ ]**Sprint F-4: Actor ↔ Entity Sync** — New `actor-sync.mjs` module. Foundry Actor (type: "character") ↔ Chronicle entity (type: "character"). System-specific adapters (`dnd5e-adapter.mjs`, `pf2e-adapter.mjs`) with `toChronicleFields(actor)` / `fromChronicleFields(entity)`. Hooks: `createActor`, `updateActor`, `deleteActor`. WebSocket: `entity.updated` with character type. Same `_syncing` guard pattern. Dashboard "Characters" tab.
290
290
-[ ]**Sprint F-5: NPC Viewer / Hall** — Campaign route `/campaigns/:id/npcs`. Gallery/grid of revealed NPCs (non-private character entities). Portrait, name, description, location, faction. Filters by location/organization/relation. "Reveal" = DM toggles `is_private`. Foundry integration: ownership change on NPC journal → auto-reveal on Chronicle. Long-term: NPC relationship map (filtered relation graph).
291
291
-[ ]**Sprint F-6: Armory / Inventory System** — Items as entities with game-mechanic fields (weight, cost, rarity, damage, properties). Character "Inventory" tab/block via entity relations. Relation metadata: equipped, quantity, attunement. System-specific item templates (dnd5e ≠ pf2e). Foundry sync: Actor inventory ↔ Chronicle inventory relations. "Armory" campaign page showing all catalogued items.
0 commit comments