@archivist-gg/dnd5e 0.1.0

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 (322) hide show
  1. package/LICENSE +21 -0
  2. package/LICENSES/SRD.md +37 -0
  3. package/README.md +65 -0
  4. package/dist/armor/armor.codec.d.ts +10 -0
  5. package/dist/armor/armor.codec.js +8 -0
  6. package/dist/armor/armor.entity-type.d.ts +2 -0
  7. package/dist/armor/armor.parser.d.ts +3 -0
  8. package/dist/armor/armor.parser.js +7 -0
  9. package/dist/armor/armor.schema.d.ts +25 -0
  10. package/dist/armor/armor.schema.js +6 -0
  11. package/dist/armor/armor.types.d.ts +26 -0
  12. package/dist/armor/armor.types.js +0 -0
  13. package/dist/background/background.codec.d.ts +9 -0
  14. package/dist/background/background.codec.js +11 -0
  15. package/dist/background/background.entity-type.d.ts +2 -0
  16. package/dist/background/background.parser.d.ts +3 -0
  17. package/dist/background/background.parser.js +10 -0
  18. package/dist/background/background.schema.d.ts +74 -0
  19. package/dist/background/background.schema.js +9 -0
  20. package/dist/background/background.types.d.ts +52 -0
  21. package/dist/background/background.types.js +0 -0
  22. package/dist/chunk-24GFQU7T.js +18 -0
  23. package/dist/chunk-3DZ74AKK.js +28 -0
  24. package/dist/chunk-3TM34RSJ.js +23 -0
  25. package/dist/chunk-3TRGRSCH.js +8 -0
  26. package/dist/chunk-4C2KOKLF.js +185 -0
  27. package/dist/chunk-4F6AIZ36.js +19 -0
  28. package/dist/chunk-4SSDYJS2.js +86 -0
  29. package/dist/chunk-4TIJKN6O.js +37 -0
  30. package/dist/chunk-537BHVSH.js +18 -0
  31. package/dist/chunk-5INR4NSL.js +18 -0
  32. package/dist/chunk-5XUXXAQJ.js +30 -0
  33. package/dist/chunk-656QCX4U.js +22 -0
  34. package/dist/chunk-66XXW2Z2.js +133 -0
  35. package/dist/chunk-6NK2MUD3.js +114 -0
  36. package/dist/chunk-6PXE7T7C.js +79 -0
  37. package/dist/chunk-7P65Q426.js +158 -0
  38. package/dist/chunk-A7T5L7SS.js +83 -0
  39. package/dist/chunk-AFKTJXRA.js +39 -0
  40. package/dist/chunk-B7UXKNLD.js +46 -0
  41. package/dist/chunk-BAXWWGFJ.js +45 -0
  42. package/dist/chunk-BH6AMZVY.js +25 -0
  43. package/dist/chunk-CDW7R2QT.js +62 -0
  44. package/dist/chunk-DABBCYTT.js +68 -0
  45. package/dist/chunk-DC74TZNA.js +46 -0
  46. package/dist/chunk-DNAJRMNN.js +68 -0
  47. package/dist/chunk-DRNZJNJP.js +19 -0
  48. package/dist/chunk-FEOB24KP.js +18 -0
  49. package/dist/chunk-FFULAF2P.js +63 -0
  50. package/dist/chunk-FUK7QSN5.js +19 -0
  51. package/dist/chunk-GIOH5JB5.js +19 -0
  52. package/dist/chunk-GJOI2GHP.js +25 -0
  53. package/dist/chunk-GZ46OVGZ.js +31 -0
  54. package/dist/chunk-HCP3GMHS.js +44 -0
  55. package/dist/chunk-IDTDACM6.js +19 -0
  56. package/dist/chunk-IKSMX4TN.js +0 -0
  57. package/dist/chunk-IXZXFFFW.js +269 -0
  58. package/dist/chunk-J2RYSZMQ.js +16 -0
  59. package/dist/chunk-JEYQU3JT.js +36 -0
  60. package/dist/chunk-LSLSG67V.js +31 -0
  61. package/dist/chunk-LWFTHJIE.js +24 -0
  62. package/dist/chunk-MDEJHMKK.js +52 -0
  63. package/dist/chunk-N2JE7BWL.js +81 -0
  64. package/dist/chunk-NAEPSZAM.js +88 -0
  65. package/dist/chunk-NXR3BD2V.js +90 -0
  66. package/dist/chunk-PKC77VZP.js +18 -0
  67. package/dist/chunk-PMADYMUI.js +19 -0
  68. package/dist/chunk-PTXBIDG7.js +63 -0
  69. package/dist/chunk-PZOWBI3B.js +49 -0
  70. package/dist/chunk-QQ5W2AZP.js +515 -0
  71. package/dist/chunk-QS5L5YTJ.js +24 -0
  72. package/dist/chunk-QYZV2MQA.js +97 -0
  73. package/dist/chunk-R2ZV233X.js +233 -0
  74. package/dist/chunk-RAWJTA45.js +271 -0
  75. package/dist/chunk-RSDRMH54.js +18 -0
  76. package/dist/chunk-RVYYKYFL.js +18 -0
  77. package/dist/chunk-SSXBYF3P.js +18 -0
  78. package/dist/chunk-TJCNX6UZ.js +521 -0
  79. package/dist/chunk-TZK36BU7.js +38 -0
  80. package/dist/chunk-UC4FE5X3.js +65 -0
  81. package/dist/chunk-WP2CX2JO.js +235 -0
  82. package/dist/chunk-WYGD2UGN.js +14 -0
  83. package/dist/chunk-XJNECUPT.js +31 -0
  84. package/dist/chunk-XURS6Q6Q.js +127 -0
  85. package/dist/chunk-Y4I74YEG.js +33 -0
  86. package/dist/chunk-Z4TL2V7S.js +18 -0
  87. package/dist/chunk-Z6GXV2GO.js +121 -0
  88. package/dist/chunk-ZLG6FQFB.js +237 -0
  89. package/dist/chunk-ZMR77DDL.js +18 -0
  90. package/dist/class/class.codec.d.ts +10 -0
  91. package/dist/class/class.codec.js +15 -0
  92. package/dist/class/class.entity-type.d.ts +2 -0
  93. package/dist/class/class.parser.d.ts +3 -0
  94. package/dist/class/class.parser.js +14 -0
  95. package/dist/class/class.schema.d.ts +202 -0
  96. package/dist/class/class.schema.js +13 -0
  97. package/dist/class/class.slug.d.ts +11 -0
  98. package/dist/class/class.slug.js +8 -0
  99. package/dist/class/class.types.d.ts +74 -0
  100. package/dist/class/class.types.js +0 -0
  101. package/dist/data-srd/index.generated.d.ts +7 -0
  102. package/dist/data-srd/index.generated.js +146 -0
  103. package/dist/dnd/constants.d.ts +16 -0
  104. package/dist/dnd/constants.js +36 -0
  105. package/dist/dnd/formula-tags.d.ts +16 -0
  106. package/dist/dnd/formula-tags.js +119 -0
  107. package/dist/dnd/math.d.ts +24 -0
  108. package/dist/dnd/math.js +35 -0
  109. package/dist/dnd/prose-tags.d.ts +16 -0
  110. package/dist/dnd/prose-tags.js +18 -0
  111. package/dist/dnd/resource-die.d.ts +6 -0
  112. package/dist/dnd/resource-die.js +17 -0
  113. package/dist/dnd/resource-formula.d.ts +41 -0
  114. package/dist/dnd/resource-formula.js +159 -0
  115. package/dist/dnd/srd-tag-converter.d.ts +44 -0
  116. package/dist/dnd/srd-tag-converter.js +12 -0
  117. package/dist/dnd/tag-grammar.d.ts +19 -0
  118. package/dist/dnd/tag-grammar.js +12 -0
  119. package/dist/encounter/encounter.ai-schema.d.ts +29 -0
  120. package/dist/encounter/encounter.ai-schema.js +8 -0
  121. package/dist/encounter/encounter.entity-type.d.ts +2 -0
  122. package/dist/encounter/encounter.generatable.d.ts +2 -0
  123. package/dist/entities/base-item-resolver.d.ts +21 -0
  124. package/dist/entities/base-item-resolver.js +9 -0
  125. package/dist/entities/slug.d.ts +5 -0
  126. package/dist/entities/slug.js +6 -0
  127. package/dist/feat/feat.codec.d.ts +9 -0
  128. package/dist/feat/feat.codec.js +10 -0
  129. package/dist/feat/feat.entity-type.d.ts +2 -0
  130. package/dist/feat/feat.parser.d.ts +3 -0
  131. package/dist/feat/feat.parser.js +9 -0
  132. package/dist/feat/feat.schema.d.ts +194 -0
  133. package/dist/feat/feat.schema.js +8 -0
  134. package/dist/feat/feat.types.d.ts +42 -0
  135. package/dist/feat/feat.types.js +0 -0
  136. package/dist/index.d.ts +12 -0
  137. package/dist/index.js +139149 -0
  138. package/dist/inline-tag-parser.d.ts +11 -0
  139. package/dist/inline-tag-parser.js +6 -0
  140. package/dist/item/item.actions-map.d.ts +41 -0
  141. package/dist/item/item.actions-map.js +85 -0
  142. package/dist/item/item.ai-schema.d.ts +35 -0
  143. package/dist/item/item.ai-schema.js +6 -0
  144. package/dist/item/item.attunement.d.ts +18 -0
  145. package/dist/item/item.attunement.js +12 -0
  146. package/dist/item/item.bonuses.d.ts +2 -0
  147. package/dist/item/item.bonuses.js +7 -0
  148. package/dist/item/item.codec.d.ts +3 -0
  149. package/dist/item/item.codec.js +8 -0
  150. package/dist/item/item.conditions.d.ts +10 -0
  151. package/dist/item/item.conditions.js +8 -0
  152. package/dist/item/item.conditions.types.d.ts +28 -0
  153. package/dist/item/item.conditions.types.js +0 -0
  154. package/dist/item/item.enrichment.d.ts +4 -0
  155. package/dist/item/item.enrichment.js +9 -0
  156. package/dist/item/item.entity-type.d.ts +2 -0
  157. package/dist/item/item.generatable.d.ts +2 -0
  158. package/dist/item/item.parser.d.ts +3 -0
  159. package/dist/item/item.parser.js +7 -0
  160. package/dist/item/item.schema.d.ts +174 -0
  161. package/dist/item/item.schema.js +8 -0
  162. package/dist/item/item.types.d.ts +108 -0
  163. package/dist/item/item.types.js +0 -0
  164. package/dist/monster/monster.ai-schema.d.ts +67 -0
  165. package/dist/monster/monster.ai-schema.js +6 -0
  166. package/dist/monster/monster.codec.d.ts +13 -0
  167. package/dist/monster/monster.enrichment.d.ts +10 -0
  168. package/dist/monster/monster.enrichment.js +19 -0
  169. package/dist/monster/monster.entity-type.d.ts +2 -0
  170. package/dist/monster/monster.generatable.d.ts +2 -0
  171. package/dist/monster/monster.parser.d.ts +3 -0
  172. package/dist/monster/monster.parser.js +6 -0
  173. package/dist/monster/monster.resolve.d.ts +10 -0
  174. package/dist/monster/monster.types.d.ts +29 -0
  175. package/dist/monster/monster.types.js +1 -0
  176. package/dist/npc/npc.ai-schema.d.ts +6 -0
  177. package/dist/npc/npc.entity-type.d.ts +2 -0
  178. package/dist/npc/npc.generatable.d.ts +2 -0
  179. package/dist/optional-feature/optional-feature.codec.d.ts +14 -0
  180. package/dist/optional-feature/optional-feature.codec.js +11 -0
  181. package/dist/optional-feature/optional-feature.entity-type.d.ts +2 -0
  182. package/dist/optional-feature/optional-feature.parser.d.ts +3 -0
  183. package/dist/optional-feature/optional-feature.parser.js +10 -0
  184. package/dist/optional-feature/optional-feature.schema.d.ts +236 -0
  185. package/dist/optional-feature/optional-feature.schema.js +9 -0
  186. package/dist/pack.d.ts +11 -0
  187. package/dist/pc/conditions.constants.d.ts +3 -0
  188. package/dist/pc/conditions.constants.js +8 -0
  189. package/dist/pc/decision-recognizer.d.ts +4 -0
  190. package/dist/pc/decision-recognizer.js +8 -0
  191. package/dist/pc/pc.conditions.d.ts +3 -0
  192. package/dist/pc/pc.conditions.js +6 -0
  193. package/dist/pc/pc.decision-engine.d.ts +97 -0
  194. package/dist/pc/pc.decision-engine.js +19 -0
  195. package/dist/pc/pc.equipment.d.ts +12 -0
  196. package/dist/pc/pc.equipment.js +15 -0
  197. package/dist/pc/pc.feature-effects.d.ts +95 -0
  198. package/dist/pc/pc.feature-effects.js +9 -0
  199. package/dist/pc/pc.formula-context.d.ts +4 -0
  200. package/dist/pc/pc.formula-context.js +11 -0
  201. package/dist/pc/pc.parser.d.ts +3 -0
  202. package/dist/pc/pc.parser.js +41 -0
  203. package/dist/pc/pc.pools.d.ts +12 -0
  204. package/dist/pc/pc.pools.js +15 -0
  205. package/dist/pc/pc.proficiencies.d.ts +8 -0
  206. package/dist/pc/pc.proficiencies.js +47 -0
  207. package/dist/pc/pc.proficiency-query.d.ts +11 -0
  208. package/dist/pc/pc.proficiency-query.js +17 -0
  209. package/dist/pc/pc.recalc.d.ts +105 -0
  210. package/dist/pc/pc.recalc.js +662 -0
  211. package/dist/pc/pc.resolver.d.ts +34 -0
  212. package/dist/pc/pc.resolver.js +267 -0
  213. package/dist/pc/pc.resource-seed.d.ts +10 -0
  214. package/dist/pc/pc.resource-seed.js +40 -0
  215. package/dist/pc/pc.rest.d.ts +23 -0
  216. package/dist/pc/pc.rest.js +128 -0
  217. package/dist/pc/pc.schema.d.ts +294 -0
  218. package/dist/pc/pc.schema.js +7 -0
  219. package/dist/pc/pc.slotting.d.ts +22 -0
  220. package/dist/pc/pc.slotting.js +20 -0
  221. package/dist/pc/pc.spellcasting.d.ts +56 -0
  222. package/dist/pc/pc.spellcasting.js +16 -0
  223. package/dist/pc/pc.table-column.d.ts +12 -0
  224. package/dist/pc/pc.table-column.js +8 -0
  225. package/dist/pc/pc.types.d.ts +514 -0
  226. package/dist/pc/pc.types.js +0 -0
  227. package/dist/race/race.codec.d.ts +9 -0
  228. package/dist/race/race.codec.js +13 -0
  229. package/dist/race/race.entity-type.d.ts +2 -0
  230. package/dist/race/race.parser.d.ts +3 -0
  231. package/dist/race/race.parser.js +12 -0
  232. package/dist/race/race.schema.d.ts +67 -0
  233. package/dist/race/race.schema.js +11 -0
  234. package/dist/race/race.types.d.ts +44 -0
  235. package/dist/race/race.types.js +0 -0
  236. package/dist/schemas/attack-schema.d.ts +38 -0
  237. package/dist/schemas/choice-schema.d.ts +5 -0
  238. package/dist/schemas/choice-schema.js +7 -0
  239. package/dist/schemas/duration-schema.d.ts +13 -0
  240. package/dist/schemas/duration-schema.js +6 -0
  241. package/dist/schemas/equipment-grant-schema.d.ts +6 -0
  242. package/dist/schemas/equipment-grant-schema.js +12 -0
  243. package/dist/schemas/feature-effect-schema.d.ts +131 -0
  244. package/dist/schemas/feature-effect-schema.js +6 -0
  245. package/dist/schemas/feature-schema.d.ts +2 -0
  246. package/dist/schemas/feature-schema.js +10 -0
  247. package/dist/schemas/index.d.ts +6 -0
  248. package/dist/schemas/resource-schema.d.ts +95 -0
  249. package/dist/schemas/resource-schema.js +12 -0
  250. package/dist/schemas/selection-pool-schema.d.ts +34 -0
  251. package/dist/schemas/selection-pool-schema.js +10 -0
  252. package/dist/spell/spell.access.d.ts +15 -0
  253. package/dist/spell/spell.access.js +25 -0
  254. package/dist/spell/spell.ai-schema.d.ts +24 -0
  255. package/dist/spell/spell.ai-schema.js +6 -0
  256. package/dist/spell/spell.codec.d.ts +3 -0
  257. package/dist/spell/spell.codec.js +8 -0
  258. package/dist/spell/spell.enrichment.d.ts +2 -0
  259. package/dist/spell/spell.enrichment.js +9 -0
  260. package/dist/spell/spell.entity-type.d.ts +2 -0
  261. package/dist/spell/spell.filter.d.ts +15 -0
  262. package/dist/spell/spell.filter.js +87 -0
  263. package/dist/spell/spell.generatable.d.ts +2 -0
  264. package/dist/spell/spell.parser.d.ts +3 -0
  265. package/dist/spell/spell.parser.js +7 -0
  266. package/dist/spell/spell.scaling.d.ts +14 -0
  267. package/dist/spell/spell.scaling.js +28 -0
  268. package/dist/spell/spell.schema.d.ts +31 -0
  269. package/dist/spell/spell.schema.js +6 -0
  270. package/dist/spell/spell.types.d.ts +25 -0
  271. package/dist/spell/spell.types.js +0 -0
  272. package/dist/srd-store.d.ts +53 -0
  273. package/dist/subclass/subclass.codec.d.ts +11 -0
  274. package/dist/subclass/subclass.codec.js +14 -0
  275. package/dist/subclass/subclass.entity-type.d.ts +2 -0
  276. package/dist/subclass/subclass.parser.d.ts +3 -0
  277. package/dist/subclass/subclass.parser.js +13 -0
  278. package/dist/subclass/subclass.schema.d.ts +118 -0
  279. package/dist/subclass/subclass.schema.js +12 -0
  280. package/dist/subclass/subclass.types.d.ts +20 -0
  281. package/dist/subclass/subclass.types.js +0 -0
  282. package/dist/types/abilities.d.ts +8 -0
  283. package/dist/types/abilities.js +0 -0
  284. package/dist/types/ac.d.ts +5 -0
  285. package/dist/types/attack.d.ts +22 -0
  286. package/dist/types/attack.js +0 -0
  287. package/dist/types/casting-option.d.ts +14 -0
  288. package/dist/types/casting-option.js +0 -0
  289. package/dist/types/choice.d.ts +66 -0
  290. package/dist/types/choice.js +6 -0
  291. package/dist/types/edition.d.ts +4 -0
  292. package/dist/types/edition.js +0 -0
  293. package/dist/types/equipment-grant.d.ts +41 -0
  294. package/dist/types/equipment-grant.js +0 -0
  295. package/dist/types/feature-effect.d.ts +79 -0
  296. package/dist/types/feature-effect.js +0 -0
  297. package/dist/types/feature.d.ts +41 -0
  298. package/dist/types/feature.js +0 -0
  299. package/dist/types/formula-context.d.ts +7 -0
  300. package/dist/types/formula-context.js +0 -0
  301. package/dist/types/hp.d.ts +4 -0
  302. package/dist/types/index.d.ts +10 -0
  303. package/dist/types/item-conditions.types.d.ts +63 -0
  304. package/dist/types/item-conditions.types.js +0 -0
  305. package/dist/types/optional-feature.types.d.ts +60 -0
  306. package/dist/types/optional-feature.types.js +0 -0
  307. package/dist/types/resource.d.ts +44 -0
  308. package/dist/types/resource.js +0 -0
  309. package/dist/types/selection-pool.d.ts +37 -0
  310. package/dist/types/selection-pool.js +0 -0
  311. package/dist/types/speed.d.ts +8 -0
  312. package/dist/weapon/weapon.codec.d.ts +12 -0
  313. package/dist/weapon/weapon.codec.js +8 -0
  314. package/dist/weapon/weapon.entity-type.d.ts +2 -0
  315. package/dist/weapon/weapon.parser.d.ts +3 -0
  316. package/dist/weapon/weapon.parser.js +7 -0
  317. package/dist/weapon/weapon.schema.d.ts +34 -0
  318. package/dist/weapon/weapon.schema.js +6 -0
  319. package/dist/weapon/weapon.types.d.ts +36 -0
  320. package/dist/weapon/weapon.types.js +0 -0
  321. package/package.json +32 -0
  322. package/src/data-srd/ATTRIBUTION.md +2 -0
@@ -0,0 +1,514 @@
1
+ import type { Ability } from "../types/choice.js";
2
+ import type { ArmorEntity } from "../armor/armor.types.js";
3
+ import type { WeaponEntity } from "../weapon/weapon.types.js";
4
+ import type { ItemEntity } from "../item/item.types.js";
5
+ import type { SkillSlug, Feature } from "@archivist-gg/dnd5e";
6
+ import type { ClassEntity } from "@archivist-gg/dnd5e/class/class.types";
7
+ import type { RaceEntity } from "@archivist-gg/dnd5e/race/race.types";
8
+ import type { SubclassEntity } from "@archivist-gg/dnd5e/subclass/subclass.types";
9
+ import type { BackgroundEntity } from "@archivist-gg/dnd5e/background/background.types";
10
+ import type { FeatEntity } from "@archivist-gg/dnd5e/feat/feat.types";
11
+ import type { Spell } from "@archivist-gg/dnd5e/spell/spell.types";
12
+ import type { OptionalFeatureEntity } from "@archivist-gg/dnd5e/types/optional-feature.types";
13
+ import type { ConditionSlug } from "./conditions.constants.js";
14
+ /** A persisted decision value: entity slug / inline value (string), multi-select
15
+ * slugs (string[]), or an ability-points allocation. Stale/odd legacy values
16
+ * survive parsing (schema is permissive); readers narrow defensively. */
17
+ export type ChoiceValue = string | string[] | Partial<Record<Ability, number>>;
18
+ export type LevelChoices = Record<string, ChoiceValue>;
19
+ export interface ClassEntry {
20
+ name: string;
21
+ level: number;
22
+ subclass: string | null;
23
+ choices: Record<number, LevelChoices>;
24
+ }
25
+ export type SlotKey = "mainhand" | "offhand" | "armor" | "shield";
26
+ export interface EquipmentEntryOverrides {
27
+ name?: string;
28
+ bonus?: number;
29
+ damage_bonus?: number;
30
+ extra_damage?: string;
31
+ ac_bonus?: number;
32
+ action?: "action" | "bonus-action" | "reaction" | "free" | "special";
33
+ range?: string;
34
+ resist?: string[];
35
+ immune?: string[];
36
+ vulnerable?: string[];
37
+ condition_immune?: string[];
38
+ }
39
+ export interface EquipmentEntryState {
40
+ charges?: {
41
+ current: number;
42
+ max: number;
43
+ };
44
+ recovery?: {
45
+ amount: string;
46
+ reset: "dawn" | "short" | "long" | "special";
47
+ };
48
+ depletion_risk?: {
49
+ trigger: string;
50
+ roll: string;
51
+ threshold: number;
52
+ effect: string;
53
+ };
54
+ }
55
+ export type EquipmentEntry = {
56
+ item: string;
57
+ equipped?: boolean;
58
+ attuned?: boolean;
59
+ qty?: number;
60
+ notes?: string;
61
+ slot?: SlotKey | null;
62
+ overrides?: EquipmentEntryOverrides;
63
+ state?: EquipmentEntryState;
64
+ /** Build-only provenance tag for gear the Builder's Equipment step seeded
65
+ * on the character's behalf (e.g. `"builder:starting"`, `"builder:gold-buy"`).
66
+ * Lets the step reconcile its own grants on re-pick / mode-switch without
67
+ * touching hand-managed entries. Stripped by finishBuild — absent on every
68
+ * finished file. */
69
+ granted_by?: string;
70
+ };
71
+ export interface ResolvedEquipped {
72
+ index: number;
73
+ entity: ArmorEntity | WeaponEntity | ItemEntity | null;
74
+ entityType: string | null;
75
+ entry: EquipmentEntry;
76
+ }
77
+ export interface EquippedSlots {
78
+ mainhand?: ResolvedEquipped;
79
+ offhand?: ResolvedEquipped;
80
+ armor?: ResolvedEquipped;
81
+ shield?: ResolvedEquipped;
82
+ }
83
+ export type Edition = "2014" | "2024";
84
+ export type AbilityMethod = "standard-array" | "point-buy" | "archivist-point-buy" | "rolled" | "manual";
85
+ export interface SpellOverride {
86
+ slug: string;
87
+ overrides: Record<string, unknown>;
88
+ }
89
+ export interface KnownSpellObject {
90
+ spell: string;
91
+ class?: string;
92
+ source?: "class" | "feat" | "item" | "race" | "domain";
93
+ prepared?: boolean;
94
+ always_prepared?: boolean;
95
+ }
96
+ export type KnownSpellEntry = string | KnownSpellObject;
97
+ export type PassiveKind = "perception" | "investigation" | "insight";
98
+ export interface CharacterOverrides {
99
+ scores?: Partial<Record<Ability, number>>;
100
+ saves?: Partial<Record<Ability, {
101
+ bonus?: number;
102
+ proficient?: boolean;
103
+ }>>;
104
+ skills?: Partial<Record<SkillSlug, {
105
+ bonus: number;
106
+ proficiency?: "none" | "proficient" | "expertise";
107
+ }>>;
108
+ passives?: Partial<{
109
+ perception: number;
110
+ investigation: number;
111
+ insight: number;
112
+ }>;
113
+ hp?: {
114
+ max?: number;
115
+ };
116
+ ac?: number;
117
+ speed?: number;
118
+ initiative?: number;
119
+ spellcasting?: {
120
+ saveDC?: number;
121
+ attackBonus?: number;
122
+ };
123
+ spell_slots?: Record<number, number>;
124
+ attunement_limit?: number;
125
+ }
126
+ export interface CharacterState {
127
+ hp: {
128
+ current: number;
129
+ max: number;
130
+ temp: number;
131
+ };
132
+ hit_dice: Record<string, {
133
+ used: number;
134
+ total: number;
135
+ }>;
136
+ spell_slots: Record<number, {
137
+ used: number;
138
+ total: number;
139
+ }>;
140
+ spell_slots_pact?: {
141
+ level: number;
142
+ used: number;
143
+ total: number;
144
+ };
145
+ concentration: string | null;
146
+ conditions: ConditionSlug[];
147
+ exhaustion: number;
148
+ death_saves?: {
149
+ successes: number;
150
+ failures: number;
151
+ };
152
+ inspiration: number;
153
+ feature_uses: Record<string, {
154
+ used: number;
155
+ max: number;
156
+ }>;
157
+ /** Phase 3 activatable buffs: ids/slugs of activatable features/boons currently
158
+ * toggled on. Their effects fold into recalc only while listed here. */
159
+ active_buffs?: string[];
160
+ /** @deprecated SP5: moved to Character.currency. Tolerated until Task 4 parser migration strips it. */
161
+ currency?: {
162
+ cp: number;
163
+ sp: number;
164
+ ep: number;
165
+ gp: number;
166
+ pp: number;
167
+ };
168
+ /** @deprecated SP5: removed; per-entry attuned flag is canonical. Tolerated until Task 4 parser migration strips it. */
169
+ attuned_items?: string[];
170
+ }
171
+ export interface Character {
172
+ name: string;
173
+ edition: Edition;
174
+ /** Present and `true` only while the file is a Builder draft (autosaved,
175
+ * resumable). Removed by the Builder's Finish action, which flips the file
176
+ * to the full character sheet. Absent on every pre-Builder/finished file. */
177
+ builder?: boolean;
178
+ alignment?: string;
179
+ /** Optional free-text age ("26", "Ageless") — Details step. */
180
+ age?: string;
181
+ race: string | null;
182
+ subrace: string | null;
183
+ background: string | null;
184
+ class: ClassEntry[];
185
+ /** Race/background decision selections, keyed `race:<choice-id>` /
186
+ * `background:<choice-id>` (SP2 Plan 3). */
187
+ origin_choices?: Record<string, ChoiceValue>;
188
+ abilities: Record<Ability, number>;
189
+ ability_method: AbilityMethod;
190
+ /** Persisted Roll-method ability pool (six 4d6-drop-lowest totals) while the
191
+ * file is a Builder draft. Present only in `rolled` mode during a build so
192
+ * the rolled pool survives view close / Obsidian restart (UI state cannot);
193
+ * the Abilities step + Base popover read their pool from here. Removed by the
194
+ * Builder's Finish action (see finishBuild) — a finished file carries none. */
195
+ builder_rolls?: number[];
196
+ /** Persisted Equipment-step mode while the file is a Builder draft: "starting"
197
+ * takes the class/background starting-gear grants, "gold" buys with rolled
198
+ * starting gold, "empty" begins with nothing. Present only during a build;
199
+ * removed by the Builder's Finish action (see finishBuild). */
200
+ builder_equipment_mode?: "starting" | "gold" | "empty";
201
+ skills: {
202
+ proficient: SkillSlug[];
203
+ expertise: SkillSlug[];
204
+ };
205
+ spells: {
206
+ known: KnownSpellEntry[];
207
+ overrides: SpellOverride[];
208
+ view?: "by-level" | "table";
209
+ };
210
+ equipment: EquipmentEntry[];
211
+ overrides: CharacterOverrides;
212
+ currency?: {
213
+ cp: number;
214
+ sp: number;
215
+ ep: number;
216
+ gp: number;
217
+ pp: number;
218
+ };
219
+ notes?: string;
220
+ defenses?: {
221
+ resistances?: string[];
222
+ immunities?: string[];
223
+ vulnerabilities?: string[];
224
+ condition_immunities?: string[];
225
+ };
226
+ state: CharacterState;
227
+ }
228
+ export type FeatureSource = {
229
+ kind: "class";
230
+ slug: string;
231
+ level: number;
232
+ } | {
233
+ kind: "subclass";
234
+ slug: string;
235
+ level: number;
236
+ } | {
237
+ kind: "race";
238
+ slug: string;
239
+ } | {
240
+ kind: "background";
241
+ slug: string;
242
+ } | {
243
+ kind: "feat";
244
+ slug: string;
245
+ };
246
+ export interface ResolvedFeature {
247
+ feature: Feature;
248
+ source: FeatureSource;
249
+ }
250
+ export interface ResolvedSpell {
251
+ entity: Spell;
252
+ slug: string;
253
+ classSlug: string | null;
254
+ source: "class" | "feat" | "item" | "race" | "domain";
255
+ prepared: boolean;
256
+ alwaysPrepared: boolean;
257
+ }
258
+ export interface ResolvedClass {
259
+ entity: ClassEntity | null;
260
+ level: number;
261
+ subclass: SubclassEntity | null;
262
+ choices: Record<number, LevelChoices>;
263
+ }
264
+ export interface ResolvedPoolEntry {
265
+ slug: string;
266
+ entity: OptionalFeatureEntity;
267
+ }
268
+ /** A materialized selection pool: count from the table column, prereq-filtered
269
+ * candidates, player picks (from the choices ledger), and subclass auto-grants. */
270
+ export interface ResolvedPool {
271
+ id: string;
272
+ label: string;
273
+ /** Which resolved class declared this pool (for ledger anchoring + writes). */
274
+ classIndex: number;
275
+ /** Picks allowed at the current level (table column value). */
276
+ count: number;
277
+ /** Lowest class level where count >= 1 — the stable persistence key level. */
278
+ anchorLevel: number;
279
+ selected: ResolvedPoolEntry[];
280
+ available: ResolvedPoolEntry[];
281
+ grants: ResolvedPoolEntry[];
282
+ }
283
+ export interface ResolvedCharacter {
284
+ definition: Character;
285
+ race: RaceEntity | null;
286
+ classes: ResolvedClass[];
287
+ background: BackgroundEntity | null;
288
+ feats: FeatEntity[];
289
+ totalLevel: number;
290
+ features: ResolvedFeature[];
291
+ spells: ResolvedSpell[];
292
+ pools: ResolvedPool[];
293
+ state: CharacterState;
294
+ }
295
+ export interface ProficiencySet {
296
+ categories: string[];
297
+ specific: string[];
298
+ }
299
+ export interface ACTerm {
300
+ source: string;
301
+ amount: number;
302
+ kind: "armor" | "shield" | "item" | "unarmored" | "override" | "dex" | "ability" | "feature";
303
+ }
304
+ export interface AttackRow {
305
+ id: string;
306
+ name: string;
307
+ range?: string;
308
+ toHit: number;
309
+ damageDice: string;
310
+ damageType: string;
311
+ extraDamage?: string;
312
+ properties: string[];
313
+ proficient: boolean;
314
+ breakdown: {
315
+ toHit: ACTerm[];
316
+ damage: ACTerm[];
317
+ };
318
+ informational?: import("@archivist-gg/dnd5e/item/item.conditions.types").InformationalBonus[];
319
+ /** Hand slot the attack came from. Used by Actions tab to find the
320
+ * originating equipment entry for the row-expand panel. */
321
+ slotKey?: "mainhand" | "offhand";
322
+ /** Short caption under the weapon name in the Actions tab table.
323
+ * e.g. "martial · versatile". Display-only. */
324
+ subLabel?: string;
325
+ /** Action-economy cost for the Cost badge. Defaults to "action" at
326
+ * render time when absent. Settable via entry.overrides.action. */
327
+ actionCost?: "action" | "bonus-action" | "reaction" | "free" | "special";
328
+ /** When set, the weapon is being wielded one-handed but has a versatile
329
+ * two-handed option. The Actions tab renders both lines stacked in the
330
+ * damage cell instead of emitting a second row. */
331
+ versatile?: {
332
+ damageDice: string;
333
+ };
334
+ /** Lowest natural-roll threshold that scores a critical hit on this attack,
335
+ * from `crit-range` feature effects (e.g. 19 = "crit on 19–20"). Display-only
336
+ * metadata mapped on in recalc; absent (undefined) for the normal 20-only
337
+ * crit so untouched attack rows are unchanged. The weapons table renders a
338
+ * "crit X–20" caption whenever it is set and < 20. */
339
+ critRange?: number;
340
+ /** Order-preserving display-only captions from `reroll-damage` / `attack-rule`
341
+ * feature effects (e.g. ["Reroll 2s", "No disadvantage firing in melee"]).
342
+ * Mapped on in recalc; absent (undefined) when no such effect is present so
343
+ * untouched attack rows are unchanged. The weapons table renders these joined
344
+ * with " · " as a muted caption under the weapon name. */
345
+ attackNotes?: string[];
346
+ }
347
+ export interface AppliedBonuses {
348
+ ability_bonuses: Partial<Record<Ability, number>>;
349
+ ability_statics: Partial<Record<Ability, number>>;
350
+ save_bonus: number;
351
+ speed_bonuses: {
352
+ walk: number;
353
+ fly: number | "walk" | null;
354
+ swim: number;
355
+ climb: number;
356
+ };
357
+ spell_attack: number;
358
+ spell_save_dc: number;
359
+ defenses: {
360
+ resistances: string[];
361
+ immunities: string[];
362
+ vulnerabilities: string[];
363
+ condition_immunities: string[];
364
+ };
365
+ informational: import("@archivist-gg/dnd5e/item/item.conditions.types").InformationalBonus[];
366
+ senses: Record<import("@archivist-gg/dnd5e/types/feature-effect").SenseType, number>;
367
+ }
368
+ export interface DerivedEquipment {
369
+ ac: number;
370
+ acBreakdown: ACTerm[];
371
+ acInformational: import("@archivist-gg/dnd5e/item/item.conditions.types").InformationalBonus[];
372
+ attacks: AttackRow[];
373
+ equippedSlots: EquippedSlots;
374
+ carriedWeight: number;
375
+ attunementUsed: number;
376
+ attunementLimit: number;
377
+ }
378
+ /**
379
+ * A structured advantage/disadvantage entry surfaced from a `roll-modifier`
380
+ * feature effect. Order-preserving pass-through list on DerivedStats (no
381
+ * dedupe/merge) — each entry carries the owning feature's name as `label`
382
+ * for tooltips. `scope` absent = applies to all rolls of that `roll` type;
383
+ * `condition` absent = always-on (not situational).
384
+ */
385
+ export interface RollModifierEntry {
386
+ mode: "advantage" | "disadvantage";
387
+ roll: "ability-check" | "saving-throw" | "attack";
388
+ scope?: string;
389
+ condition?: string;
390
+ label: string;
391
+ }
392
+ export interface DerivedStats {
393
+ totalLevel: number;
394
+ proficiencyBonus: number;
395
+ scores: Record<Ability, number>;
396
+ mods: Record<Ability, number>;
397
+ saves: Record<Ability, {
398
+ bonus: number;
399
+ proficient: boolean;
400
+ }>;
401
+ proficiencies: {
402
+ armor: ProficiencySet;
403
+ weapons: ProficiencySet;
404
+ tools: ProficiencySet;
405
+ languages: string[];
406
+ saves: Ability[];
407
+ };
408
+ skills: Record<SkillSlug, {
409
+ bonus: number;
410
+ proficiency: "none" | "proficient" | "expertise";
411
+ ability: Ability;
412
+ }>;
413
+ passives: {
414
+ perception: number;
415
+ investigation: number;
416
+ insight: number;
417
+ };
418
+ /** Computed senses: max of race vision and feature-effect sense ranges. 0 = none per type. */
419
+ senses: Record<import("@archivist-gg/dnd5e/types/feature-effect").SenseType, number>;
420
+ hp: {
421
+ max: number;
422
+ current: number;
423
+ temp: number;
424
+ };
425
+ ac: number;
426
+ speed: number;
427
+ initiative: number;
428
+ spellcasting: {
429
+ ability: Ability;
430
+ saveDC: number;
431
+ attackBonus: number;
432
+ preparedCount?: number;
433
+ } | null;
434
+ /** One entry per casting class (multiclass-aware). Empty for non-casters. */
435
+ spellcastingClasses: SpellcastingClassInfo[];
436
+ /** Derived standard slot totals by spell level (before user override). */
437
+ derivedSpellSlots: Record<number, number>;
438
+ /** Warlock Pact Magic, or null. */
439
+ pactMagic: {
440
+ level: number;
441
+ total: number;
442
+ } | null;
443
+ /** Per-class known/prepared + cantrip limits (advisory). */
444
+ spellLimits: SpellLimitInfo[];
445
+ warnings: string[];
446
+ defenses: {
447
+ resistances: string[];
448
+ immunities: string[];
449
+ vulnerabilities: string[];
450
+ condition_immunities: string[];
451
+ };
452
+ acBreakdown: ACTerm[];
453
+ acInformational: import("@archivist-gg/dnd5e/item/item.conditions.types").InformationalBonus[];
454
+ /** Situational saving-throw bonuses (e.g. +1 vs spells) for save tooltips. */
455
+ savesInformational: import("@archivist-gg/dnd5e/item/item.conditions.types").InformationalBonus[];
456
+ /** Situational spell attack / save-DC bonuses for spellcasting tooltips. */
457
+ spellcastingInformational: import("@archivist-gg/dnd5e/item/item.conditions.types").InformationalBonus[];
458
+ /** Situational speed bonuses (e.g. swim while underwater) for speed tooltips. */
459
+ speedInformational: import("@archivist-gg/dnd5e/item/item.conditions.types").InformationalBonus[];
460
+ /**
461
+ * Attacks per Attack action = 1 + max `extra-attack` effect count. Always ≥ 1
462
+ * (everyone gets one attack). The Actions "Attacks" heading shows `(×N)` when > 1.
463
+ */
464
+ attacksPerAction: number;
465
+ attacks: AttackRow[];
466
+ equippedSlots: EquippedSlots;
467
+ carriedWeight: number;
468
+ attunementUsed: number;
469
+ attunementLimit: number;
470
+ conditionEffects: ConditionEffects;
471
+ /**
472
+ * Structured advantage/disadvantage entries from `roll-modifier` effects.
473
+ * Order-preserving pass-through (no dedupe/merge); rendered as ADV/DIS chips.
474
+ */
475
+ rollModifiers: RollModifierEntry[];
476
+ }
477
+ export interface SpellcastingClassInfo {
478
+ classSlug: string;
479
+ className: string;
480
+ ability: Ability;
481
+ saveDC: number;
482
+ attackBonus: number;
483
+ casterType: "full" | "half" | "third" | "pact";
484
+ preparation: "known" | "prepared";
485
+ }
486
+ export interface SpellLimitInfo {
487
+ classSlug: string;
488
+ kind: "known" | "prepared";
489
+ cantripsKnown: number | null;
490
+ preparedOrKnown: number | null;
491
+ }
492
+ export interface ConditionEffects {
493
+ speed_multiplier: number;
494
+ speed_reduction_ft: number;
495
+ speed_floor_zero: boolean;
496
+ hp_max_multiplier: number;
497
+ d20_test_penalty: number;
498
+ exhaustion_level: number;
499
+ attack_disadvantage: boolean;
500
+ attack_advantage: boolean;
501
+ attack_advantage_against: boolean;
502
+ ability_check_disadvantage: boolean;
503
+ save_disadvantage_dex: boolean;
504
+ save_autofail_str: boolean;
505
+ save_autofail_dex: boolean;
506
+ saves_disadvantage_all: boolean;
507
+ actions_disabled: boolean;
508
+ reactions_disabled: boolean;
509
+ sources: Array<{
510
+ condition: ConditionSlug | "exhaustion";
511
+ level?: number;
512
+ effects: string[];
513
+ }>;
514
+ }
File without changes
@@ -0,0 +1,9 @@
1
+ import type { DocCodec } from "@archivist-gg/core";
2
+ import type { RaceEntity } from "./race.types.js";
3
+ /**
4
+ * Normalizing codec (0c.1a). `parse` delegates to `parseRace`, which seeds the
5
+ * `edition: "2014"` default and validates against `raceEntitySchema`. `serialize`
6
+ * stays `yaml.dump` (the edit-save path uses obsidian's separate serializer; gate
7
+ * (d) verifies `yaml.dump` round-trips through `parseRace`).
8
+ */
9
+ export declare const raceCodec: DocCodec<RaceEntity>;
@@ -0,0 +1,13 @@
1
+ import {
2
+ raceCodec
3
+ } from "../chunk-PKC77VZP.js";
4
+ import "../chunk-IDTDACM6.js";
5
+ import "../chunk-FFULAF2P.js";
6
+ import "../chunk-DABBCYTT.js";
7
+ import "../chunk-WYGD2UGN.js";
8
+ import "../chunk-PZOWBI3B.js";
9
+ import "../chunk-CDW7R2QT.js";
10
+ import "../chunk-NXR3BD2V.js";
11
+ export {
12
+ raceCodec
13
+ };
@@ -0,0 +1,2 @@
1
+ import type { EntityType } from "@archivist-gg/core";
2
+ export declare const raceEntityType: EntityType;
@@ -0,0 +1,3 @@
1
+ import type { RaceEntity } from "./race.types.js";
2
+ import { ParseResult } from "@archivist-gg/core";
3
+ export declare function parseRace(source: string): ParseResult<RaceEntity>;
@@ -0,0 +1,12 @@
1
+ import {
2
+ parseRace
3
+ } from "../chunk-IDTDACM6.js";
4
+ import "../chunk-FFULAF2P.js";
5
+ import "../chunk-DABBCYTT.js";
6
+ import "../chunk-WYGD2UGN.js";
7
+ import "../chunk-PZOWBI3B.js";
8
+ import "../chunk-CDW7R2QT.js";
9
+ import "../chunk-NXR3BD2V.js";
10
+ export {
11
+ parseRace
12
+ };
@@ -0,0 +1,67 @@
1
+ import { z } from "zod";
2
+ export declare const raceEntitySchema: z.ZodObject<{
3
+ slug: z.ZodString;
4
+ name: z.ZodString;
5
+ edition: z.ZodEnum<{
6
+ 2014: "2014";
7
+ 2024: "2024";
8
+ }>;
9
+ source: z.ZodString;
10
+ description: z.ZodString;
11
+ size: z.ZodEnum<{
12
+ medium: "medium";
13
+ tiny: "tiny";
14
+ small: "small";
15
+ large: "large";
16
+ huge: "huge";
17
+ }>;
18
+ speed: z.ZodObject<{
19
+ walk: z.ZodOptional<z.ZodNumber>;
20
+ fly: z.ZodOptional<z.ZodNumber>;
21
+ swim: z.ZodOptional<z.ZodNumber>;
22
+ climb: z.ZodOptional<z.ZodNumber>;
23
+ burrow: z.ZodOptional<z.ZodNumber>;
24
+ hover: z.ZodOptional<z.ZodBoolean>;
25
+ }, z.core.$strip>;
26
+ ability_score_increases: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
27
+ ability: z.ZodEnum<{
28
+ str: "str";
29
+ dex: "dex";
30
+ con: "con";
31
+ int: "int";
32
+ wis: "wis";
33
+ cha: "cha";
34
+ }>;
35
+ amount: z.ZodNumber;
36
+ }, z.core.$strip>, z.ZodObject<{
37
+ choose: z.ZodNumber;
38
+ pool: z.ZodArray<z.ZodEnum<{
39
+ str: "str";
40
+ dex: "dex";
41
+ con: "con";
42
+ int: "int";
43
+ wis: "wis";
44
+ cha: "cha";
45
+ }>>;
46
+ amount: z.ZodNumber;
47
+ }, z.core.$strip>]>>;
48
+ age: z.ZodString;
49
+ alignment: z.ZodString;
50
+ vision: z.ZodObject<{
51
+ darkvision: z.ZodOptional<z.ZodNumber>;
52
+ blindsight: z.ZodOptional<z.ZodNumber>;
53
+ tremorsense: z.ZodOptional<z.ZodNumber>;
54
+ truesight: z.ZodOptional<z.ZodNumber>;
55
+ }, z.core.$strip>;
56
+ languages: z.ZodObject<{
57
+ fixed: z.ZodArray<z.ZodString>;
58
+ choice: z.ZodOptional<z.ZodObject<{
59
+ count: z.ZodNumber;
60
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
61
+ }, z.core.$strip>>;
62
+ }, z.core.$strip>;
63
+ variant_label: z.ZodString;
64
+ traits: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
65
+ choices: z.ZodOptional<z.ZodArray<z.ZodType<import("../index.js").Choice, unknown, z.core.$ZodTypeInternals<import("../index.js").Choice, unknown>>>>;
66
+ subspecies_of: z.ZodOptional<z.ZodString>;
67
+ }, z.core.$strip>;
@@ -0,0 +1,11 @@
1
+ import {
2
+ raceEntitySchema
3
+ } from "../chunk-FFULAF2P.js";
4
+ import "../chunk-DABBCYTT.js";
5
+ import "../chunk-WYGD2UGN.js";
6
+ import "../chunk-PZOWBI3B.js";
7
+ import "../chunk-CDW7R2QT.js";
8
+ import "../chunk-NXR3BD2V.js";
9
+ export {
10
+ raceEntitySchema
11
+ };
@@ -0,0 +1,44 @@
1
+ import type { Feature, Ability, Speed, Choice } from "@archivist-gg/dnd5e";
2
+ import type { Edition } from "@archivist-gg/dnd5e/types/edition";
3
+ export type Size = "tiny" | "small" | "medium" | "large" | "huge";
4
+ export type FixedAbilityIncrease = {
5
+ ability: Ability;
6
+ amount: number;
7
+ };
8
+ export type ChoiceAbilityIncrease = {
9
+ choose: number;
10
+ pool: Ability[];
11
+ amount: number;
12
+ };
13
+ export type AbilityScoreIncrease = FixedAbilityIncrease | ChoiceAbilityIncrease;
14
+ export interface Vision {
15
+ darkvision?: number;
16
+ blindsight?: number;
17
+ tremorsense?: number;
18
+ truesight?: number;
19
+ }
20
+ export interface LanguageProficiencies {
21
+ fixed: string[];
22
+ choice?: {
23
+ count: number;
24
+ from: string | string[];
25
+ };
26
+ }
27
+ export interface RaceEntity {
28
+ slug: string;
29
+ name: string;
30
+ edition: Edition;
31
+ source: string;
32
+ description: string;
33
+ size: Size;
34
+ speed: Speed;
35
+ ability_score_increases: AbilityScoreIncrease[];
36
+ age: string;
37
+ alignment: string;
38
+ vision: Vision;
39
+ languages: LanguageProficiencies;
40
+ variant_label: string;
41
+ traits: Feature[];
42
+ choices?: Choice[];
43
+ subspecies_of?: string;
44
+ }
File without changes