@archivist-gg/dnd5e 0.3.13 → 0.3.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/background/background.codec.js +5 -5
  2. package/dist/background/background.parser.js +4 -4
  3. package/dist/background/background.schema.js +3 -3
  4. package/dist/chunk-3LWMFYKS.js +57 -0
  5. package/dist/{chunk-4SLOJXJ4.js → chunk-3SFGWFVQ.js} +1 -1
  6. package/dist/{chunk-Q6UOHCCT.js → chunk-3SIUAFDQ.js} +1 -1
  7. package/dist/chunk-4J6DS3EJ.js +30 -0
  8. package/dist/{chunk-RLGQ5PZZ.js → chunk-5JXFJ5AU.js} +11 -1
  9. package/dist/{chunk-4BZ47YJ4.js → chunk-64VNLMSG.js} +59 -16
  10. package/dist/{chunk-XY6X2APM.js → chunk-7Q2VPKCD.js} +17 -0
  11. package/dist/{chunk-Q5XTEYHD.js → chunk-7XJHI5H5.js} +16 -9
  12. package/dist/{chunk-FPGXFD2M.js → chunk-B2QHP6UF.js} +2 -2
  13. package/dist/{chunk-HJQNK3J5.js → chunk-B3DP42OM.js} +1 -4
  14. package/dist/{chunk-MC5YJ4PB.js → chunk-BJGOSM76.js} +1 -1
  15. package/dist/{chunk-VDPRBUU5.js → chunk-BJWSOQUC.js} +1 -1
  16. package/dist/{chunk-QEO7LYTG.js → chunk-EJD47JHL.js} +181 -93
  17. package/dist/{chunk-X7VZY4ON.js → chunk-FJYBLXV7.js} +2 -2
  18. package/dist/{chunk-QSBJ6NEM.js → chunk-FMUD3LDV.js} +1 -1
  19. package/dist/{chunk-LVX6TQ3R.js → chunk-FMYWORTP.js} +2 -2
  20. package/dist/{chunk-PX25R3DK.js → chunk-FVXLP7P3.js} +1 -1
  21. package/dist/{chunk-XJRNEQPD.js → chunk-GVWEFECG.js} +1 -1
  22. package/dist/{chunk-R2V5LN3I.js → chunk-HY2SRSVM.js} +1 -1
  23. package/dist/{chunk-ZMJQUZQH.js → chunk-JXWNXIIZ.js} +24 -0
  24. package/dist/chunk-KR6JF3BF.js +14 -0
  25. package/dist/{chunk-DPM6V7YX.js → chunk-LICYHPI3.js} +82 -6
  26. package/dist/{chunk-J53ERF6K.js → chunk-LNT64X7C.js} +1 -1
  27. package/dist/{chunk-RQNJXADQ.js → chunk-NKZMQV2C.js} +1 -1
  28. package/dist/{chunk-UE6LKRXQ.js → chunk-NTU2DXNG.js} +24 -1
  29. package/dist/{chunk-T5GZBKIQ.js → chunk-NXUY5XQN.js} +168 -33
  30. package/dist/{chunk-M2OWVAZG.js → chunk-NZO7M5GV.js} +1 -1
  31. package/dist/{chunk-BRGLDWUP.js → chunk-OOL4KMG2.js} +7 -3
  32. package/dist/{chunk-MWCCGPG3.js → chunk-OOSRUJBI.js} +3 -2
  33. package/dist/{chunk-H5PTKYXL.js → chunk-QA3YCOML.js} +1 -1
  34. package/dist/{chunk-MUIU7RZ3.js → chunk-QFWQKS3M.js} +1 -1
  35. package/dist/chunk-RD2MID3M.js +292 -0
  36. package/dist/chunk-TRBGC4ZG.js +112 -0
  37. package/dist/{chunk-PLOSP4XQ.js → chunk-UJCK5IW4.js} +11 -2
  38. package/dist/{chunk-5KGV6TF7.js → chunk-UNYR5GLI.js} +1 -1
  39. package/dist/{chunk-JNNNBEUH.js → chunk-VN5DLURA.js} +7 -2
  40. package/dist/{chunk-EL6QPF6I.js → chunk-VP5TIXDK.js} +1 -1
  41. package/dist/chunk-WOHX7YTH.js +165 -0
  42. package/dist/{chunk-G7ED5H2G.js → chunk-XTEFPUSN.js} +1 -1
  43. package/dist/{chunk-6ZY3U6BQ.js → chunk-ZOWKWMD2.js} +1 -1
  44. package/dist/class/class.codec.js +6 -6
  45. package/dist/class/class.parser.js +5 -5
  46. package/dist/class/class.schema.d.ts +8 -0
  47. package/dist/class/class.schema.js +4 -4
  48. package/dist/class/class.standard-array.d.ts +16 -0
  49. package/dist/class/class.standard-array.js +20 -0
  50. package/dist/class/class.types.d.ts +3 -0
  51. package/dist/dnd/amount-text.d.ts +42 -0
  52. package/dist/dnd/amount-text.js +15 -0
  53. package/dist/dnd/resource-words.d.ts +4 -0
  54. package/dist/dnd/resource-words.js +30 -0
  55. package/dist/entities/registry-revision.d.ts +25 -0
  56. package/dist/entities/registry-revision.js +10 -0
  57. package/dist/feat/feat.codec.js +5 -5
  58. package/dist/feat/feat.parser.js +4 -4
  59. package/dist/feat/feat.schema.d.ts +34 -0
  60. package/dist/feat/feat.schema.js +3 -3
  61. package/dist/index.js +4027 -383
  62. package/dist/monster/monster.parser.js +5 -5
  63. package/dist/monster/monster.schema.js +4 -4
  64. package/dist/optional-feature/optional-feature.codec.js +5 -4
  65. package/dist/optional-feature/optional-feature.parser.js +4 -3
  66. package/dist/optional-feature/optional-feature.schema.d.ts +35 -0
  67. package/dist/optional-feature/optional-feature.schema.js +3 -2
  68. package/dist/pc/pc.additional-spells.d.ts +16 -2
  69. package/dist/pc/pc.additional-spells.js +5 -2
  70. package/dist/pc/pc.amount-bindings.d.ts +41 -0
  71. package/dist/pc/pc.amount-bindings.js +28 -0
  72. package/dist/pc/pc.decision-engine.d.ts +11 -0
  73. package/dist/pc/pc.decision-engine.js +20 -16
  74. package/dist/pc/pc.entry-overrides.js +3 -2
  75. package/dist/pc/pc.equipment.js +7 -5
  76. package/dist/pc/pc.feature-effects.d.ts +21 -2
  77. package/dist/pc/pc.feature-effects.js +15 -2
  78. package/dist/pc/pc.infusions.d.ts +9 -1
  79. package/dist/pc/pc.infusions.js +3 -2
  80. package/dist/pc/pc.member-choices.d.ts +122 -0
  81. package/dist/pc/pc.member-choices.js +39 -0
  82. package/dist/pc/pc.parser.js +1 -1
  83. package/dist/pc/pc.pools.d.ts +7 -0
  84. package/dist/pc/pc.pools.js +5 -2
  85. package/dist/pc/pc.proficiencies.d.ts +14 -0
  86. package/dist/pc/pc.proficiencies.js +72 -22
  87. package/dist/pc/pc.proficiency-normalize.d.ts +14 -0
  88. package/dist/pc/pc.proficiency-normalize.js +9 -3
  89. package/dist/pc/pc.proficiency-query.js +7 -1
  90. package/dist/pc/pc.recalc.js +212 -99
  91. package/dist/pc/pc.resolver.d.ts +6 -2
  92. package/dist/pc/pc.resolver.js +16 -14
  93. package/dist/pc/pc.rest.js +4 -3
  94. package/dist/pc/pc.schema.d.ts +48 -2
  95. package/dist/pc/pc.schema.js +1 -1
  96. package/dist/pc/pc.spell-scope.d.ts +22 -0
  97. package/dist/pc/pc.tool-picks.js +2 -2
  98. package/dist/pc/pc.types.d.ts +110 -6
  99. package/dist/pc/pc.weapon-grant.d.ts +15 -0
  100. package/dist/pc/pool-layout.d.ts +3 -9
  101. package/dist/pc/pool-layout.js +1 -3
  102. package/dist/pc/resource-equivalents.d.ts +44 -0
  103. package/dist/pc/spell-source.js +4 -9
  104. package/dist/race/race.codec.js +6 -6
  105. package/dist/race/race.parser.js +5 -5
  106. package/dist/race/race.schema.js +4 -4
  107. package/dist/schemas/choice-schema.js +2 -2
  108. package/dist/schemas/feature-effect-schema.d.ts +34 -0
  109. package/dist/schemas/feature-effect-schema.js +1 -1
  110. package/dist/schemas/feature-schema.js +3 -3
  111. package/dist/spell/spell.codec.js +2 -2
  112. package/dist/spell/spell.parser.d.ts +6 -1
  113. package/dist/spell/spell.parser.js +5 -3
  114. package/dist/spell/spell.types.d.ts +10 -0
  115. package/dist/subclass/subclass.codec.js +6 -6
  116. package/dist/subclass/subclass.parser.js +5 -5
  117. package/dist/subclass/subclass.schema.js +4 -4
  118. package/dist/types/choice.d.ts +7 -2
  119. package/dist/types/feature-effect.d.ts +24 -0
  120. package/dist/types/optional-feature.types.d.ts +6 -1
  121. package/dist/types/selection-pool.d.ts +2 -2
  122. package/package.json +1 -1
@@ -90,6 +90,14 @@ export declare const characterOverridesShape: z.ZodObject<{
90
90
  proficient: "proficient";
91
91
  }>>>;
92
92
  }, z.core.$strip>>;
93
+ weapons: z.ZodOptional<z.ZodObject<{
94
+ add: z.ZodOptional<z.ZodArray<z.ZodString>>;
95
+ remove: z.ZodOptional<z.ZodArray<z.ZodString>>;
96
+ }, z.core.$strip>>;
97
+ armor: z.ZodOptional<z.ZodObject<{
98
+ add: z.ZodOptional<z.ZodArray<z.ZodString>>;
99
+ remove: z.ZodOptional<z.ZodArray<z.ZodString>>;
100
+ }, z.core.$strip>>;
93
101
  defenses: z.ZodOptional<z.ZodObject<{
94
102
  resistances: z.ZodOptional<z.ZodObject<{
95
103
  remove: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -381,6 +389,14 @@ export declare const characterSchema: z.ZodObject<{
381
389
  proficient: "proficient";
382
390
  }>>>;
383
391
  }, z.core.$strip>>;
392
+ weapons: z.ZodOptional<z.ZodObject<{
393
+ add: z.ZodOptional<z.ZodArray<z.ZodString>>;
394
+ remove: z.ZodOptional<z.ZodArray<z.ZodString>>;
395
+ }, z.core.$strip>>;
396
+ armor: z.ZodOptional<z.ZodObject<{
397
+ add: z.ZodOptional<z.ZodArray<z.ZodString>>;
398
+ remove: z.ZodOptional<z.ZodArray<z.ZodString>>;
399
+ }, z.core.$strip>>;
384
400
  defenses: z.ZodOptional<z.ZodObject<{
385
401
  resistances: z.ZodOptional<z.ZodObject<{
386
402
  remove: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -411,6 +427,36 @@ export declare const characterSchema: z.ZodObject<{
411
427
  vulnerabilities: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
412
428
  condition_immunities: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
413
429
  }, z.core.$strip>>;
430
+ sheet: z.ZodOptional<z.ZodObject<{
431
+ layout: z.ZodOptional<z.ZodObject<{
432
+ saves: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
433
+ section: "section";
434
+ }>>>;
435
+ body: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
436
+ wide: "wide";
437
+ }>>>;
438
+ }, z.core.$strip>>;
439
+ favorites: z.ZodOptional<z.ZodArray<z.ZodString>>;
440
+ filters: z.ZodOptional<z.ZodObject<{
441
+ actions: z.ZodOptional<z.ZodObject<{
442
+ show: z.ZodOptional<z.ZodArray<z.ZodString>>;
443
+ hide: z.ZodOptional<z.ZodArray<z.ZodString>>;
444
+ }, z.core.$strip>>;
445
+ passive: z.ZodOptional<z.ZodObject<{
446
+ show: z.ZodOptional<z.ZodArray<z.ZodString>>;
447
+ hide: z.ZodOptional<z.ZodArray<z.ZodString>>;
448
+ }, z.core.$strip>>;
449
+ }, z.core.$strip>>;
450
+ pools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
451
+ show: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
452
+ known: "known";
453
+ granted: "granted";
454
+ "not-known": "not-known";
455
+ }>>>;
456
+ off: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
457
+ folded: z.ZodOptional<z.ZodArray<z.ZodString>>;
458
+ }, z.core.$strip>>>;
459
+ }, z.core.$strip>>;
414
460
  state: z.ZodObject<{
415
461
  hp: z.ZodObject<{
416
462
  current: z.ZodNumber;
@@ -432,19 +478,19 @@ export declare const characterSchema: z.ZodObject<{
432
478
  }, z.core.$strip>>;
433
479
  concentration: z.ZodDefault<z.ZodNullable<z.ZodString>>;
434
480
  conditions: z.ZodDefault<z.ZodArray<z.ZodEnum<{
481
+ incapacitated: "incapacitated";
482
+ unconscious: "unconscious";
435
483
  poisoned: "poisoned";
436
484
  grappled: "grappled";
437
485
  paralyzed: "paralyzed";
438
486
  petrified: "petrified";
439
487
  prone: "prone";
440
488
  restrained: "restrained";
441
- unconscious: "unconscious";
442
489
  charmed: "charmed";
443
490
  frightened: "frightened";
444
491
  blinded: "blinded";
445
492
  deafened: "deafened";
446
493
  stunned: "stunned";
447
- incapacitated: "incapacitated";
448
494
  invisible: "invisible";
449
495
  }>>>;
450
496
  exhaustion: z.ZodDefault<z.ZodNumber>;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  characterOverridesShape,
3
3
  characterSchema
4
- } from "../chunk-UE6LKRXQ.js";
4
+ } from "../chunk-NTU2DXNG.js";
5
5
  import "../chunk-S7REMWW4.js";
6
6
  export {
7
7
  characterOverridesShape,
@@ -0,0 +1,22 @@
1
+ /**
2
+ * A spell damage rider's `spell_scope` read against the character's spells (found 2026-09-29: Potent Spellcasting,
3
+ * Empowered Evocation, Elemental Affinity, Radiant Soul and the Artificer riders said which spells they reach only in
4
+ * prose, so they reached none). Data, not per-feature code: every word of the scope is one test on the spell entity.
5
+ */
6
+ import type { SpellScope } from "../types/feature-effect.js";
7
+ import type { Spell } from "../spell/spell.types.js";
8
+ import type { ResolvedCharacter, ResolvedSpell } from "./pc.types.js";
9
+ /** Does `spell` deal damage? Its data names at least one damage type. */
10
+ export declare function dealsDamage(spell: Pick<Spell, "damage">): boolean;
11
+ /**
12
+ * The slugs of the character's `spells` a rider with `scope` reaches, unique, in `spells` order: every spell that DEALS
13
+ * DAMAGE and matches every word the scope carries (see `SpellScope`). `pickedTypes` answers `damage_type_pick` (the
14
+ * types the character's pick names; none reaches no spell). No scope reaches none; an empty scope every damaging spell.
15
+ */
16
+ export declare function spellsInScope(scope: SpellScope | undefined, spells: ReadonlyArray<Pick<ResolvedSpell, "slug" | "entity">>, pickedTypes: (choiceId: string) => string[]): string[];
17
+ /**
18
+ * The damage types the character chose at the `select-inline` `choiceId` of one of its class or subclass features (the
19
+ * 2014 Dragon Ancestor's "Red (Fire)", the 2024 Elemental Affinity's "fire"): the canonical types its answer's option
20
+ * names, in its value or its label. Empty when no feature offers that choice or it is unanswered.
21
+ */
22
+ export declare function pickedDamageTypes(resolved: Pick<ResolvedCharacter, "classes">, choiceId: string): string[];
@@ -5,9 +5,9 @@ import {
5
5
  classToolPicks,
6
6
  expandToolPool,
7
7
  toolCategoriesOf
8
- } from "../chunk-H5PTKYXL.js";
8
+ } from "../chunk-QA3YCOML.js";
9
9
  import "../chunk-KU3YLF6D.js";
10
- import "../chunk-RLGQ5PZZ.js";
10
+ import "../chunk-5JXFJ5AU.js";
11
11
  export {
12
12
  TOOL_CATEGORIES,
13
13
  backgroundToolPicks,
@@ -1,7 +1,7 @@
1
- import type { Ability } from "../types/choice.js";
1
+ import type { Ability, EntityFilter } from "../types/choice.js";
2
2
  import type { ArmorEntity } from "../armor/armor.types.js";
3
3
  import type { WeaponEntity } from "../weapon/weapon.types.js";
4
- import type { WeaponScope } from "../types/feature-effect.js";
4
+ import type { SpellScope, WeaponScope } from "../types/feature-effect.js";
5
5
  import type { ItemEntity } from "../item/item.types.js";
6
6
  import type { SkillSlug, Feature, Choice } from "@archivist-gg/dnd5e";
7
7
  import type { ClassEntity } from "@archivist-gg/dnd5e/class/class.types";
@@ -125,8 +125,8 @@ export type KnownSpellEntry = string | KnownSpellObject;
125
125
  export type PassiveKind = "perception" | "investigation" | "insight";
126
126
  /** The manual proficiency tri, in ONE place. The runtime twin is `proficiencyTri`
127
127
  * (pc.schema.ts); `pc.recalc.ts` imports this name for the skills tri, and the plugin's
128
- * `CharacterEditState.setToolProficiency` and `ProficiencyEditModal` import it for the
129
- * tools tri (R4-G4 §9.3, UR1), so no consumer re-spells the union. */
128
+ * `CharacterEditState` imports it for the tools tri its writers keep (R4-G4 §9.3, UR1;
129
+ * `setToolExpertise` since D4 A), so no consumer re-spells the union. */
130
130
  export type ProficiencyTri = "none" | "proficient" | "expertise";
131
131
  export interface CharacterOverrides {
132
132
  scores?: Partial<Record<Ability, number>>;
@@ -181,6 +181,18 @@ export interface CharacterOverrides {
181
181
  remove?: string[];
182
182
  proficiency?: Record<string, ProficiencyTri>;
183
183
  };
184
+ /** D4 A: the same add / remove pair for WEAPON and ARMOR proficiencies. A weapon value is a category (`simple`,
185
+ * `martial`) or one weapon (`longsword`, `hand-crossbow`); an armor value is `light`, `medium`, `heavy` or `shield`.
186
+ * Read through `proficiencyKey` (pc.proficiency-normalize.ts), so any spelling of a grant matches. No defaults, like
187
+ * `languages`/`tools`: an untouched note stays byte-identical. */
188
+ weapons?: {
189
+ add?: string[];
190
+ remove?: string[];
191
+ };
192
+ armor?: {
193
+ add?: string[];
194
+ remove?: string[];
195
+ };
184
196
  /** Manual defense edits, mirroring `characterOverridesShape` (pc.schema.ts). SUPPRESSION-ONLY:
185
197
  * the absent `add` channel is a DELIBERATE asymmetry with `languages`/`tools` above, not an
186
198
  * oversight · do not "complete the pattern". The additive store is `character.defenses.*`,
@@ -251,6 +263,30 @@ export interface CharacterState {
251
263
  /** @deprecated SP5: removed; per-entry attuned flag is canonical. Tolerated until Task 4 parser migration strips it. */
252
264
  attuned_items?: string[];
253
265
  }
266
+ /** Per-character sheet state (phases AF and SL): layout and Actions/Passive view choices. Mirrors `sheetStateSchema`. */
267
+ export interface SheetViewFilter {
268
+ show?: string[];
269
+ hide?: string[];
270
+ }
271
+ /** PT (spec §7): one pool tab's view: what Show keeps, the facet values un-ticked (by facet id), the folded groups. */
272
+ export interface SheetPoolView {
273
+ show?: "known" | "granted" | "not-known";
274
+ off?: Record<string, string[]>;
275
+ folded?: string[];
276
+ }
277
+ export interface CharacterSheetState {
278
+ /** `saves: section` (SL) draws the saves as a sidebar section; `body: wide` (D13) is the wide three-column sheet. */
279
+ layout?: {
280
+ saves?: "section";
281
+ body?: "wide";
282
+ };
283
+ favorites?: string[];
284
+ filters?: {
285
+ actions?: SheetViewFilter;
286
+ passive?: SheetViewFilter;
287
+ };
288
+ pools?: Record<string, SheetPoolView>;
289
+ }
254
290
  export interface Character {
255
291
  name: string;
256
292
  edition: Edition;
@@ -309,6 +345,7 @@ export interface Character {
309
345
  vulnerabilities?: string[];
310
346
  condition_immunities?: string[];
311
347
  };
348
+ sheet?: CharacterSheetState;
312
349
  state: CharacterState;
313
350
  }
314
351
  /** R4-G7 T8 RIDER-23 (F-FEATSRC) · the slot that granted a feat: a class's `choices[<level>].feat` pick, or a 2024
@@ -321,6 +358,20 @@ export type FeatVia = {
321
358
  } | {
322
359
  kind: "background";
323
360
  slug: string;
361
+ }
362
+ /** SRD-G T4 (audit §3b): a feat picked through a species trait (the SRD 5.2 Human's Versatile origin feat). */
363
+ | {
364
+ kind: "race";
365
+ slug: string;
366
+ }
367
+ /** D2b-A (design §2.2 step 6): a feat a POOL MEMBER grants (Lessons of the First Ones' Origin feat). `slug` is the
368
+ * member's note slug and `name` its display name; `classSlug` / `level` are the pool's class and anchor level. */
369
+ | {
370
+ kind: "pool";
371
+ slug: string;
372
+ name: string;
373
+ classSlug: string;
374
+ level: number;
324
375
  };
325
376
  export type FeatureSource = {
326
377
  kind: "class";
@@ -362,6 +413,10 @@ export interface ResolvedFeature {
362
413
  renderSuppressed?: boolean;
363
414
  /** The feat's entire substance is a full ability-score improvement (a pure ASI). The DISPLAY layer hides these. */
364
415
  buildOnly?: boolean;
416
+ /** The spells this feature's spell-scoped damage riders reach, as its data names them (`memberSpellTargets`): set by
417
+ * `assembleEffectFeatures` on a pool member (Agonizing Blast's cantrip pick, the 2014 invocation's `spell-known`
418
+ * prerequisite). A wrapper-only field; absent on every other feature, whose spell riders then reach no spell. */
419
+ spellTargets?: SpellTargets;
365
420
  /** R4-G7 §7.1: EVERY LOWER copy the resolve-time fold collapsed into this wrapper, ASCENDING by level, with
366
421
  * that copy's own card identity (`name`, and `description` = its `description` else its `entries` joined) and
367
422
  * its `choices` when it carries any. A wrapper-only field, the `chosenInline` precedent: the shared registry
@@ -408,6 +463,9 @@ export interface ResolvedSpell {
408
463
  /** True ONLY for a row from character.spells.known (removable / toggleable);
409
464
  * absent on every grant · R4-G3b §5.2.7. */
410
465
  persisted?: boolean;
466
+ /** True for a spell cast at will without a spell slot: a pool member's `innate` at-will grant (Armor of Shadows'
467
+ * Mage Armor). The Spells tab gives it the At Will chip, never a slot's CAST. Absent on every other row. */
468
+ atWill?: boolean;
411
469
  }
412
470
  export interface ResolvedClass {
413
471
  entity: ClassEntity | null;
@@ -463,8 +521,9 @@ export interface ResolvedPool {
463
521
  * 2026-09-05 with `grep -rn "pool\.layout" packages/obsidian/src`, one line) and reads
464
522
  * authored-then-derived-then-default before handing the string to the `PoolTab` constructor. */
465
523
  layout?: PoolLayout;
466
- /** The OWNED resource id the members spend (majority of `consumes.resource` among the ids the
467
- * character owns); undefined when no member consumes an owned id (R4-G4 §4.2.3, Gate 0 B1). */
524
+ /** The OWNED resource id the members spend: the majority of the members' PAYERS (H3b `payingResourceId`: the named id
525
+ * when owned, else its owned declared equivalent, the pool's class first); undefined when no member has an owned payer
526
+ * (R4-G4 §4.2.3, Gate 0 B1; H3b spec §4). */
468
527
  resource?: string;
469
528
  /** ART-a (spec §4.5): the declaration's `count.label`, copied raw; read through `poolCountLabel` (absent reads "Known"). */
470
529
  countLabel?: string;
@@ -579,6 +638,42 @@ export interface DamageRider {
579
638
  source?: string;
580
639
  condition?: string;
581
640
  scope?: WeaponScope[];
641
+ /** D2b-A: the source of the feature the rider comes from, so its amount resolves against the OWNING class's level
642
+ * and spellcasting modifier (a multiclass character's Guided Precision reads the Artificer's INT). Set by
643
+ * `computeFeatureEffects`; consumed and DROPPED by recalc's rider resolution (an attack row never carries it). */
644
+ owner?: FeatureSource;
645
+ }
646
+ /** The spells a feature's spell-scoped damage rider reaches, as the member's DATA names them (`memberSpellTargets`):
647
+ * `refs` are the answers of its target picks (`target: true`, Agonizing Blast's cantrip) and its `spell-known`
648
+ * prerequisites (the 2014 invocation's Eldritch Blast); `open` holds the filter of each target pick left unanswered,
649
+ * which reaches a spell only when the character has exactly one legal answer (`spellsReached`). */
650
+ export interface SpellTargets {
651
+ refs: string[];
652
+ open: EntityFilter[];
653
+ }
654
+ /** A `damage-bonus` effect with `applies_to: spell` (Agonizing Blast's "your Charisma modifier") or `all` (Hexblade's
655
+ * Curse). The fold carries the authored amount with its `owner`, `targets` and `scope`; recalc resolves the amount against
656
+ * the owning class, reads the targets and the scope against the character's spells into `spells` and drops `owner`,
657
+ * `targets` and `scope`, keeping only riders that reach a spell. `damage_type` survives only when it is a canonical type
658
+ * (a `chosen` or prose type is the spell's own). How the sheet prints it is `addSpellDamageRiders` (inside the roll: an
659
+ * unconditional rider of the spell's own type) and `spellDamageRiderLines` (its own line: a `condition`, like a
660
+ * conditional weapon rider, or another damage type). */
661
+ export interface SpellDamageRider {
662
+ amount: string;
663
+ damage_type?: string;
664
+ source?: string;
665
+ condition?: string;
666
+ /** The scope's `once`: the rider adds to one damage roll of the casting ("one damage roll of that spell"). */
667
+ once?: boolean;
668
+ /** The slugs of the character's resolved spells this rider reaches (recalc). */
669
+ spells?: string[];
670
+ /** Fold only: see {@link DamageRider.owner}. */
671
+ owner?: FeatureSource;
672
+ /** Fold only: the feature's {@link SpellTargets} (a pool member's named spells). */
673
+ targets?: SpellTargets;
674
+ /** Fold only: the effect's `spell_scope` ({} for an unscoped `applies_to: all`: every damaging spell). Absent (and no
675
+ * `targets`) reaches no spell. */
676
+ scope?: SpellScope;
582
677
  }
583
678
  export interface AttackRow {
584
679
  id: string;
@@ -660,6 +755,12 @@ export interface AppliedBonuses {
660
755
  ability_bonuses: Partial<Record<Ability, number>>;
661
756
  ability_statics: Partial<Record<Ability, number>>;
662
757
  save_bonus: number;
758
+ /** SL (spec §11.3): `save_bonus` term by term, one per item, each named by the entry's display name (`overrides.name`, else
759
+ * the item's). The saves breakdown lists these, never a lumped "Equipment" term. */
760
+ save_terms: {
761
+ source: string;
762
+ amount: number;
763
+ }[];
663
764
  speed_bonuses: {
664
765
  walk: number;
665
766
  fly: number | "walk" | null;
@@ -885,6 +986,9 @@ export interface DerivedStats {
885
986
  */
886
987
  attacksPerAction: number;
887
988
  attacks: AttackRow[];
989
+ /** Spell-scoped damage riders that reach at least one of the character's spells, amounts resolved (Agonizing Blast's
990
+ * "3" on Eldritch Blast). Absent when none does. The Spells tab adds them into the spell's roll. */
991
+ spellDamageRiders?: SpellDamageRider[];
888
992
  equippedSlots: EquippedSlots;
889
993
  carriedWeight: number;
890
994
  attunementUsed: number;
@@ -0,0 +1,15 @@
1
+ import type { WeaponEntity } from "@archivist-gg/dnd5e/weapon/weapon.types";
2
+ export interface QualifiedWeaponGrant {
3
+ category: "simple" | "martial";
4
+ /** Absent: melee and ranged alike. */
5
+ range?: "melee" | "ranged";
6
+ /** Weapon property keys as the weapon notes carry them (`two_handed`, `finesse`). */
7
+ properties: string[];
8
+ /** true: the weapon has NONE of `properties` ("that don't have"); false: it has ANY of them ("that have"). */
9
+ without: boolean;
10
+ }
11
+ /** The grant a phrase states, or null when it is not a property-qualified category phrase (a weapon name, "simple"). */
12
+ export declare function parseQualifiedWeaponGrant(text: string): QualifiedWeaponGrant | null;
13
+ /** Does the qualified grant `text` cover `weapon`? False for any text that is not such a grant. Melee / ranged is the attack
14
+ * mode the classifier reconstructs, not the category suffix (a thrown melee weapon may be filed `*-ranged`). */
15
+ export declare function qualifiedGrantCovers(text: string, weapon: Pick<WeaponEntity, "category" | "properties" | "range" | "slug">): boolean;
@@ -17,19 +17,13 @@ export declare const RENDERING_HINT_LAYOUT: Readonly<Record<string, PoolLayout>>
17
17
  * function as the layout, and one junk member beside genuine `dice-pool` members collapsed a
18
18
  * correct majority into a phantom tie. */
19
19
  export declare function derivePoolLayout(entries: ReadonlyArray<ResolvedPoolEntry>): PoolLayout | undefined;
20
- /** ART-D (spec §7.2): the rows every pool tab draws unless its declaration authors `spell-like`. Applied AT READ by
21
- * {@link poolPresentation}, never as a zod `.default()`, so a parsed note gains no key (the importer's round trip). */
22
- export declare const DEFAULT_POOL_ROWS: "blocks";
23
20
  export type PoolHead = "dice" | "points";
24
- export type PoolRows = "blocks" | "spell-like";
25
21
  export interface PoolPresentation {
26
22
  head: PoolHead;
27
- rows: PoolRows;
28
23
  }
29
- /** ART-D (spec §7.2, Gate 1 C1): a pool tab's two data axes.
30
- * - HEAD: an authored `dice-pool` / `point-pool` wins; otherwise the DERIVED layout decides (points for `point-pool`,
31
- * dice for anything else).
32
- * - ROWS: `spell-like` only when the declaration AUTHORS it; otherwise {@link DEFAULT_POOL_ROWS}. */
24
+ /** A pool tab's ONE data axis (PT spec §9; ART-D's rows axis is retired: every pool tab draws the table).
25
+ * HEAD: an authored `dice-pool` / `point-pool` wins; otherwise the DERIVED layout decides (points for `point-pool`,
26
+ * dice for anything else). An authored `blocks` or `spell-like` still parses and is ignored. */
33
27
  export declare function poolPresentation(authored?: PoolLayout, derived?: PoolLayout): PoolPresentation;
34
28
  /** The ONE `rendering_hint` to `EntryAffordance` table (R4-G5 §4.2.1, invariant 3): the PER-ENTRY sibling of
35
29
  * `RENDERING_HINT_LAYOUT`. `granted-die-to-ally` is its only key, and the four documents carrying it
@@ -1,16 +1,14 @@
1
1
  import {
2
2
  AFFORDANCE_CAPTIONS,
3
- DEFAULT_POOL_ROWS,
4
3
  RENDERING_HINT_AFFORDANCE,
5
4
  RENDERING_HINT_LAYOUT,
6
5
  deriveEntryAffordance,
7
6
  derivePoolLayout,
8
7
  formatAffordanceCaption,
9
8
  poolPresentation
10
- } from "../chunk-HJQNK3J5.js";
9
+ } from "../chunk-B3DP42OM.js";
11
10
  export {
12
11
  AFFORDANCE_CAPTIONS,
13
- DEFAULT_POOL_ROWS,
14
12
  RENDERING_HINT_AFFORDANCE,
15
13
  RENDERING_HINT_LAYOUT,
16
14
  deriveEntryAffordance,
@@ -0,0 +1,44 @@
1
+ import type { ResourceIndex } from "./pc.resources.js";
2
+ import type { FeatureSource, ResolvedClass, ResolvedFeature } from "./pc.types.js";
3
+ /**
4
+ * H3b (spec `2026-09-28-h3b-resource-equivalents-design.md` §2): DECLARED equivalent resource ids. Each group says "these
5
+ * ids name ONE resource": the books and the SRD data mint different ids for the same pool (edition twins such as
6
+ * `fighter:superiority-dice` / `fighter-2024:superiority-dice`, book drift such as `monk:ki` / `monk:focus-point`,
7
+ * singular / plural such as `sorcerer:sorcery-point(s)`). Nothing is ever derived from an id's shape: an id in no group
8
+ * has no equivalent. The order inside a group is the fallback preference ({@link payingResourceId} step 4).
9
+ *
10
+ * The groups were measured over the installed vault (every class paired with every subclass of the same class, census in
11
+ * `.superpowers/sdd/h3b-evidence/`) and each checked against its declaring notes. The bare `channel-divinity` is the SRD
12
+ * 2024 id of BOTH the Cleric and the Paladin, so it sits in both Channel Divinity groups. Equivalence is read as "shares a
13
+ * group with", never transitively: `cleric:` / `cleric-2024:` never answer for `paladin:` / `paladin-2024:`. The bare id
14
+ * does answer for both, so a paladin consumer whose own class owns no Channel Divinity pays from a bare id another class
15
+ * (an SRD 2024 Cleric) declares: the one Channel Divinity pool of the 2014 multiclass rule (review m1, H3b).
16
+ */
17
+ export interface ResourceEquivalentGroup {
18
+ readonly name: string;
19
+ readonly ids: readonly string[];
20
+ }
21
+ export declare const RESOURCE_EQUIVALENTS: readonly ResourceEquivalentGroup[];
22
+ /** Every id that shares a group with `id`, in declared order (group order, then the order inside the group), `id` itself
23
+ * excluded, each once. Empty for an id in no group. */
24
+ export declare function equivalentResourceIds(id: string, groups?: readonly ResourceEquivalentGroup[]): string[];
25
+ /**
26
+ * THE rule (spec §3): which OWNED resource pays for a consumption naming `id`.
27
+ * 1. the candidates are `id`, then its declared equivalents in declared order, kept only when the character owns them;
28
+ * 2. none: `undefined` (the caller keeps the raw id: no control, never a spend from nothing);
29
+ * 3. the first candidate the consumer's OWN class entry declares (`owner`, its class or subclass) pays, so a class's
30
+ * feature or pool member spends its class's pool even when a feat owns a twin id (TCE Metamagic Adept on a 2014
31
+ * Sorcerer declares `sorcerer-2024:sorcery-point`);
32
+ * 4. else the first candidate: the named id itself when it is owned.
33
+ * Exactly one id per consumer, so a spend writes one `feature_uses` key.
34
+ */
35
+ export declare function payingResourceId(id: string, index: ResourceIndex, owner?: ResolvedClass | null, groups?: readonly ResourceEquivalentGroup[]): string | undefined;
36
+ /** The class entry a feature belongs to: a class feature's class, a subclass feature's class; none for a race,
37
+ * background, feat or campaign feature. */
38
+ export declare function classOfSource(source: FeatureSource, classes: readonly ResolvedClass[]): ResolvedClass | null;
39
+ /**
40
+ * Spec §4: every resolved feature whose `consumes.resource` has a different payer becomes a COPY (wrapper, feature and
41
+ * consumes; only `resource` changes). The registry `Feature` is shared by every open sheet and is never written; a
42
+ * feature with no `consumes.resource`, one paid by the id it names, or one with no owned candidate keeps its identity.
43
+ */
44
+ export declare function bindFeatureConsumers(features: ResolvedFeature[], index: ResourceIndex, classes: readonly ResolvedClass[]): ResolvedFeature[];
@@ -1,12 +1,7 @@
1
- // src/pc/spell-source.ts
2
- var SPELL_SOURCE = {
3
- class: { ownAbility: false, section: "spellbook", freeCastWhenNoSlot: false, showInPrepare: true, countsAsGranted: false },
4
- feat: { ownAbility: true, section: "spellbook", freeCastWhenNoSlot: true, showInPrepare: true, countsAsGranted: true },
5
- item: { ownAbility: false, section: "consumable", freeCastWhenNoSlot: false, showInPrepare: false, countsAsGranted: true },
6
- race: { ownAbility: true, section: "spellbook", freeCastWhenNoSlot: true, showInPrepare: true, countsAsGranted: true },
7
- domain: { ownAbility: false, section: "spellbook", freeCastWhenNoSlot: false, showInPrepare: true, countsAsGranted: false }
8
- };
9
- var spellSource = (s) => SPELL_SOURCE[s.source];
1
+ import {
2
+ SPELL_SOURCE,
3
+ spellSource
4
+ } from "../chunk-KR6JF3BF.js";
10
5
  export {
11
6
  SPELL_SOURCE,
12
7
  spellSource
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  raceCodec
3
- } from "../chunk-MC5YJ4PB.js";
4
- import "../chunk-R2V5LN3I.js";
5
- import "../chunk-X7VZY4ON.js";
3
+ } from "../chunk-BJGOSM76.js";
4
+ import "../chunk-HY2SRSVM.js";
5
+ import "../chunk-FJYBLXV7.js";
6
6
  import "../chunk-4U55VNC7.js";
7
- import "../chunk-FPGXFD2M.js";
7
+ import "../chunk-B2QHP6UF.js";
8
8
  import "../chunk-WYGD2UGN.js";
9
9
  import "../chunk-ZJXSXVFP.js";
10
- import "../chunk-BRGLDWUP.js";
11
- import "../chunk-ZMJQUZQH.js";
10
+ import "../chunk-OOL4KMG2.js";
11
+ import "../chunk-JXWNXIIZ.js";
12
12
  import "../chunk-UA5KS2PL.js";
13
13
  export {
14
14
  raceCodec
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  parseRace
3
- } from "../chunk-R2V5LN3I.js";
4
- import "../chunk-X7VZY4ON.js";
3
+ } from "../chunk-HY2SRSVM.js";
4
+ import "../chunk-FJYBLXV7.js";
5
5
  import "../chunk-4U55VNC7.js";
6
- import "../chunk-FPGXFD2M.js";
6
+ import "../chunk-B2QHP6UF.js";
7
7
  import "../chunk-WYGD2UGN.js";
8
8
  import "../chunk-ZJXSXVFP.js";
9
- import "../chunk-BRGLDWUP.js";
10
- import "../chunk-ZMJQUZQH.js";
9
+ import "../chunk-OOL4KMG2.js";
10
+ import "../chunk-JXWNXIIZ.js";
11
11
  import "../chunk-UA5KS2PL.js";
12
12
  export {
13
13
  parseRace
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  fixedAsiSchema,
3
3
  raceEntitySchema
4
- } from "../chunk-X7VZY4ON.js";
5
- import "../chunk-FPGXFD2M.js";
4
+ } from "../chunk-FJYBLXV7.js";
5
+ import "../chunk-B2QHP6UF.js";
6
6
  import "../chunk-WYGD2UGN.js";
7
7
  import "../chunk-ZJXSXVFP.js";
8
- import "../chunk-BRGLDWUP.js";
9
- import "../chunk-ZMJQUZQH.js";
8
+ import "../chunk-OOL4KMG2.js";
9
+ import "../chunk-JXWNXIIZ.js";
10
10
  import "../chunk-UA5KS2PL.js";
11
11
  export {
12
12
  fixedAsiSchema,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  choiceSchema
3
- } from "../chunk-BRGLDWUP.js";
4
- import "../chunk-ZMJQUZQH.js";
3
+ } from "../chunk-OOL4KMG2.js";
4
+ import "../chunk-JXWNXIIZ.js";
5
5
  export {
6
6
  choiceSchema
7
7
  };
@@ -18,6 +18,31 @@ export declare const featureEffectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
18
18
  minimum: z.ZodOptional<z.ZodNumber>;
19
19
  condition: z.ZodOptional<z.ZodString>;
20
20
  subject: z.ZodOptional<z.ZodString>;
21
+ }, z.core.$strip>, z.ZodObject<{
22
+ kind: z.ZodLiteral<"save-bonus">;
23
+ ability: z.ZodEnum<{
24
+ str: "str";
25
+ dex: "dex";
26
+ con: "con";
27
+ int: "int";
28
+ wis: "wis";
29
+ cha: "cha";
30
+ }>;
31
+ minimum: z.ZodOptional<z.ZodNumber>;
32
+ saves: z.ZodOptional<z.ZodArray<z.ZodEnum<{
33
+ str: "str";
34
+ dex: "dex";
35
+ con: "con";
36
+ int: "int";
37
+ wis: "wis";
38
+ cha: "cha";
39
+ }>>>;
40
+ inactive_while: z.ZodOptional<z.ZodEnum<{
41
+ incapacitated: "incapacitated";
42
+ unconscious: "unconscious";
43
+ }>>;
44
+ condition: z.ZodOptional<z.ZodString>;
45
+ subject: z.ZodOptional<z.ZodString>;
21
46
  }, z.core.$strip>, z.ZodObject<{
22
47
  kind: z.ZodLiteral<"half-proficiency">;
23
48
  skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -111,6 +136,15 @@ export declare const featureEffectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
111
136
  finesse: "finesse";
112
137
  thrown: "thrown";
113
138
  }>>]>>;
139
+ spell_scope: z.ZodOptional<z.ZodObject<{
140
+ list: z.ZodOptional<z.ZodString>;
141
+ level: z.ZodOptional<z.ZodNumber>;
142
+ school: z.ZodOptional<z.ZodString>;
143
+ damage_types: z.ZodOptional<z.ZodArray<z.ZodString>>;
144
+ damage_type_pick: z.ZodOptional<z.ZodString>;
145
+ spells: z.ZodOptional<z.ZodArray<z.ZodString>>;
146
+ once: z.ZodOptional<z.ZodBoolean>;
147
+ }, z.core.$strict>>;
114
148
  condition: z.ZodOptional<z.ZodString>;
115
149
  subject: z.ZodOptional<z.ZodString>;
116
150
  }, z.core.$strip>, z.ZodObject<{
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  featureEffectSchema
3
- } from "../chunk-ZMJQUZQH.js";
3
+ } from "../chunk-JXWNXIIZ.js";
4
4
  export {
5
5
  featureEffectSchema
6
6
  };
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  featureObjectSchema,
3
3
  featureSchema
4
- } from "../chunk-FPGXFD2M.js";
4
+ } from "../chunk-B2QHP6UF.js";
5
5
  import "../chunk-WYGD2UGN.js";
6
6
  import "../chunk-ZJXSXVFP.js";
7
- import "../chunk-BRGLDWUP.js";
8
- import "../chunk-ZMJQUZQH.js";
7
+ import "../chunk-OOL4KMG2.js";
8
+ import "../chunk-JXWNXIIZ.js";
9
9
  export {
10
10
  featureObjectSchema,
11
11
  featureSchema
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  spellCodec
3
- } from "../chunk-MWCCGPG3.js";
4
- import "../chunk-XY6X2APM.js";
3
+ } from "../chunk-OOSRUJBI.js";
4
+ import "../chunk-7Q2VPKCD.js";
5
5
  import "../chunk-ZDAEGJH4.js";
6
6
  import "../chunk-UA5KS2PL.js";
7
7
  export {
@@ -1,4 +1,4 @@
1
- import { Spell } from "./spell.types.js";
1
+ import { Spell, SpellMaterial } from "./spell.types.js";
2
2
  import { ParseResult } from "@archivist-gg/core";
3
3
  /**
4
4
  * §3.3 · collapse the converter's structured `components` object to the corpus's own string form
@@ -13,6 +13,11 @@ import { ParseResult } from "@archivist-gg/core";
13
13
  * the unreachable-shape fallback (the schema has already accepted the value by the time we run).
14
14
  */
15
15
  export declare function normalizeSpellComponents(value: unknown): string;
16
+ /**
17
+ * D2b-B · the structured material component the string form cannot carry: `components.m` when it is an OBJECT (`text` with an
18
+ * optional `cost` and `consume`), copied field by field; `undefined` for every other shape. Structural narrowing, as above.
19
+ */
20
+ export declare function spellMaterialOf(value: unknown): SpellMaterial | undefined;
16
21
  /**
17
22
  * §3.3 · collapse the converter's structured `duration` array to the corpus's own lowercase string
18
23
  * form (`until dispelled`, `up to 1 hour`), leaving a string input byte-unchanged. Concentration is
@@ -2,13 +2,15 @@ import {
2
2
  mirrorSpellShapes,
3
3
  normalizeSpellComponents,
4
4
  normalizeSpellDuration,
5
- parseSpell
6
- } from "../chunk-XY6X2APM.js";
5
+ parseSpell,
6
+ spellMaterialOf
7
+ } from "../chunk-7Q2VPKCD.js";
7
8
  import "../chunk-ZDAEGJH4.js";
8
9
  import "../chunk-UA5KS2PL.js";
9
10
  export {
10
11
  mirrorSpellShapes,
11
12
  normalizeSpellComponents,
12
13
  normalizeSpellDuration,
13
- parseSpell
14
+ parseSpell,
15
+ spellMaterialOf
14
16
  };