@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.
- package/LICENSE +21 -0
- package/LICENSES/SRD.md +37 -0
- package/README.md +65 -0
- package/dist/armor/armor.codec.d.ts +10 -0
- package/dist/armor/armor.codec.js +8 -0
- package/dist/armor/armor.entity-type.d.ts +2 -0
- package/dist/armor/armor.parser.d.ts +3 -0
- package/dist/armor/armor.parser.js +7 -0
- package/dist/armor/armor.schema.d.ts +25 -0
- package/dist/armor/armor.schema.js +6 -0
- package/dist/armor/armor.types.d.ts +26 -0
- package/dist/armor/armor.types.js +0 -0
- package/dist/background/background.codec.d.ts +9 -0
- package/dist/background/background.codec.js +11 -0
- package/dist/background/background.entity-type.d.ts +2 -0
- package/dist/background/background.parser.d.ts +3 -0
- package/dist/background/background.parser.js +10 -0
- package/dist/background/background.schema.d.ts +74 -0
- package/dist/background/background.schema.js +9 -0
- package/dist/background/background.types.d.ts +52 -0
- package/dist/background/background.types.js +0 -0
- package/dist/chunk-24GFQU7T.js +18 -0
- package/dist/chunk-3DZ74AKK.js +28 -0
- package/dist/chunk-3TM34RSJ.js +23 -0
- package/dist/chunk-3TRGRSCH.js +8 -0
- package/dist/chunk-4C2KOKLF.js +185 -0
- package/dist/chunk-4F6AIZ36.js +19 -0
- package/dist/chunk-4SSDYJS2.js +86 -0
- package/dist/chunk-4TIJKN6O.js +37 -0
- package/dist/chunk-537BHVSH.js +18 -0
- package/dist/chunk-5INR4NSL.js +18 -0
- package/dist/chunk-5XUXXAQJ.js +30 -0
- package/dist/chunk-656QCX4U.js +22 -0
- package/dist/chunk-66XXW2Z2.js +133 -0
- package/dist/chunk-6NK2MUD3.js +114 -0
- package/dist/chunk-6PXE7T7C.js +79 -0
- package/dist/chunk-7P65Q426.js +158 -0
- package/dist/chunk-A7T5L7SS.js +83 -0
- package/dist/chunk-AFKTJXRA.js +39 -0
- package/dist/chunk-B7UXKNLD.js +46 -0
- package/dist/chunk-BAXWWGFJ.js +45 -0
- package/dist/chunk-BH6AMZVY.js +25 -0
- package/dist/chunk-CDW7R2QT.js +62 -0
- package/dist/chunk-DABBCYTT.js +68 -0
- package/dist/chunk-DC74TZNA.js +46 -0
- package/dist/chunk-DNAJRMNN.js +68 -0
- package/dist/chunk-DRNZJNJP.js +19 -0
- package/dist/chunk-FEOB24KP.js +18 -0
- package/dist/chunk-FFULAF2P.js +63 -0
- package/dist/chunk-FUK7QSN5.js +19 -0
- package/dist/chunk-GIOH5JB5.js +19 -0
- package/dist/chunk-GJOI2GHP.js +25 -0
- package/dist/chunk-GZ46OVGZ.js +31 -0
- package/dist/chunk-HCP3GMHS.js +44 -0
- package/dist/chunk-IDTDACM6.js +19 -0
- package/dist/chunk-IKSMX4TN.js +0 -0
- package/dist/chunk-IXZXFFFW.js +269 -0
- package/dist/chunk-J2RYSZMQ.js +16 -0
- package/dist/chunk-JEYQU3JT.js +36 -0
- package/dist/chunk-LSLSG67V.js +31 -0
- package/dist/chunk-LWFTHJIE.js +24 -0
- package/dist/chunk-MDEJHMKK.js +52 -0
- package/dist/chunk-N2JE7BWL.js +81 -0
- package/dist/chunk-NAEPSZAM.js +88 -0
- package/dist/chunk-NXR3BD2V.js +90 -0
- package/dist/chunk-PKC77VZP.js +18 -0
- package/dist/chunk-PMADYMUI.js +19 -0
- package/dist/chunk-PTXBIDG7.js +63 -0
- package/dist/chunk-PZOWBI3B.js +49 -0
- package/dist/chunk-QQ5W2AZP.js +515 -0
- package/dist/chunk-QS5L5YTJ.js +24 -0
- package/dist/chunk-QYZV2MQA.js +97 -0
- package/dist/chunk-R2ZV233X.js +233 -0
- package/dist/chunk-RAWJTA45.js +271 -0
- package/dist/chunk-RSDRMH54.js +18 -0
- package/dist/chunk-RVYYKYFL.js +18 -0
- package/dist/chunk-SSXBYF3P.js +18 -0
- package/dist/chunk-TJCNX6UZ.js +521 -0
- package/dist/chunk-TZK36BU7.js +38 -0
- package/dist/chunk-UC4FE5X3.js +65 -0
- package/dist/chunk-WP2CX2JO.js +235 -0
- package/dist/chunk-WYGD2UGN.js +14 -0
- package/dist/chunk-XJNECUPT.js +31 -0
- package/dist/chunk-XURS6Q6Q.js +127 -0
- package/dist/chunk-Y4I74YEG.js +33 -0
- package/dist/chunk-Z4TL2V7S.js +18 -0
- package/dist/chunk-Z6GXV2GO.js +121 -0
- package/dist/chunk-ZLG6FQFB.js +237 -0
- package/dist/chunk-ZMR77DDL.js +18 -0
- package/dist/class/class.codec.d.ts +10 -0
- package/dist/class/class.codec.js +15 -0
- package/dist/class/class.entity-type.d.ts +2 -0
- package/dist/class/class.parser.d.ts +3 -0
- package/dist/class/class.parser.js +14 -0
- package/dist/class/class.schema.d.ts +202 -0
- package/dist/class/class.schema.js +13 -0
- package/dist/class/class.slug.d.ts +11 -0
- package/dist/class/class.slug.js +8 -0
- package/dist/class/class.types.d.ts +74 -0
- package/dist/class/class.types.js +0 -0
- package/dist/data-srd/index.generated.d.ts +7 -0
- package/dist/data-srd/index.generated.js +146 -0
- package/dist/dnd/constants.d.ts +16 -0
- package/dist/dnd/constants.js +36 -0
- package/dist/dnd/formula-tags.d.ts +16 -0
- package/dist/dnd/formula-tags.js +119 -0
- package/dist/dnd/math.d.ts +24 -0
- package/dist/dnd/math.js +35 -0
- package/dist/dnd/prose-tags.d.ts +16 -0
- package/dist/dnd/prose-tags.js +18 -0
- package/dist/dnd/resource-die.d.ts +6 -0
- package/dist/dnd/resource-die.js +17 -0
- package/dist/dnd/resource-formula.d.ts +41 -0
- package/dist/dnd/resource-formula.js +159 -0
- package/dist/dnd/srd-tag-converter.d.ts +44 -0
- package/dist/dnd/srd-tag-converter.js +12 -0
- package/dist/dnd/tag-grammar.d.ts +19 -0
- package/dist/dnd/tag-grammar.js +12 -0
- package/dist/encounter/encounter.ai-schema.d.ts +29 -0
- package/dist/encounter/encounter.ai-schema.js +8 -0
- package/dist/encounter/encounter.entity-type.d.ts +2 -0
- package/dist/encounter/encounter.generatable.d.ts +2 -0
- package/dist/entities/base-item-resolver.d.ts +21 -0
- package/dist/entities/base-item-resolver.js +9 -0
- package/dist/entities/slug.d.ts +5 -0
- package/dist/entities/slug.js +6 -0
- package/dist/feat/feat.codec.d.ts +9 -0
- package/dist/feat/feat.codec.js +10 -0
- package/dist/feat/feat.entity-type.d.ts +2 -0
- package/dist/feat/feat.parser.d.ts +3 -0
- package/dist/feat/feat.parser.js +9 -0
- package/dist/feat/feat.schema.d.ts +194 -0
- package/dist/feat/feat.schema.js +8 -0
- package/dist/feat/feat.types.d.ts +42 -0
- package/dist/feat/feat.types.js +0 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +139149 -0
- package/dist/inline-tag-parser.d.ts +11 -0
- package/dist/inline-tag-parser.js +6 -0
- package/dist/item/item.actions-map.d.ts +41 -0
- package/dist/item/item.actions-map.js +85 -0
- package/dist/item/item.ai-schema.d.ts +35 -0
- package/dist/item/item.ai-schema.js +6 -0
- package/dist/item/item.attunement.d.ts +18 -0
- package/dist/item/item.attunement.js +12 -0
- package/dist/item/item.bonuses.d.ts +2 -0
- package/dist/item/item.bonuses.js +7 -0
- package/dist/item/item.codec.d.ts +3 -0
- package/dist/item/item.codec.js +8 -0
- package/dist/item/item.conditions.d.ts +10 -0
- package/dist/item/item.conditions.js +8 -0
- package/dist/item/item.conditions.types.d.ts +28 -0
- package/dist/item/item.conditions.types.js +0 -0
- package/dist/item/item.enrichment.d.ts +4 -0
- package/dist/item/item.enrichment.js +9 -0
- package/dist/item/item.entity-type.d.ts +2 -0
- package/dist/item/item.generatable.d.ts +2 -0
- package/dist/item/item.parser.d.ts +3 -0
- package/dist/item/item.parser.js +7 -0
- package/dist/item/item.schema.d.ts +174 -0
- package/dist/item/item.schema.js +8 -0
- package/dist/item/item.types.d.ts +108 -0
- package/dist/item/item.types.js +0 -0
- package/dist/monster/monster.ai-schema.d.ts +67 -0
- package/dist/monster/monster.ai-schema.js +6 -0
- package/dist/monster/monster.codec.d.ts +13 -0
- package/dist/monster/monster.enrichment.d.ts +10 -0
- package/dist/monster/monster.enrichment.js +19 -0
- package/dist/monster/monster.entity-type.d.ts +2 -0
- package/dist/monster/monster.generatable.d.ts +2 -0
- package/dist/monster/monster.parser.d.ts +3 -0
- package/dist/monster/monster.parser.js +6 -0
- package/dist/monster/monster.resolve.d.ts +10 -0
- package/dist/monster/monster.types.d.ts +29 -0
- package/dist/monster/monster.types.js +1 -0
- package/dist/npc/npc.ai-schema.d.ts +6 -0
- package/dist/npc/npc.entity-type.d.ts +2 -0
- package/dist/npc/npc.generatable.d.ts +2 -0
- package/dist/optional-feature/optional-feature.codec.d.ts +14 -0
- package/dist/optional-feature/optional-feature.codec.js +11 -0
- package/dist/optional-feature/optional-feature.entity-type.d.ts +2 -0
- package/dist/optional-feature/optional-feature.parser.d.ts +3 -0
- package/dist/optional-feature/optional-feature.parser.js +10 -0
- package/dist/optional-feature/optional-feature.schema.d.ts +236 -0
- package/dist/optional-feature/optional-feature.schema.js +9 -0
- package/dist/pack.d.ts +11 -0
- package/dist/pc/conditions.constants.d.ts +3 -0
- package/dist/pc/conditions.constants.js +8 -0
- package/dist/pc/decision-recognizer.d.ts +4 -0
- package/dist/pc/decision-recognizer.js +8 -0
- package/dist/pc/pc.conditions.d.ts +3 -0
- package/dist/pc/pc.conditions.js +6 -0
- package/dist/pc/pc.decision-engine.d.ts +97 -0
- package/dist/pc/pc.decision-engine.js +19 -0
- package/dist/pc/pc.equipment.d.ts +12 -0
- package/dist/pc/pc.equipment.js +15 -0
- package/dist/pc/pc.feature-effects.d.ts +95 -0
- package/dist/pc/pc.feature-effects.js +9 -0
- package/dist/pc/pc.formula-context.d.ts +4 -0
- package/dist/pc/pc.formula-context.js +11 -0
- package/dist/pc/pc.parser.d.ts +3 -0
- package/dist/pc/pc.parser.js +41 -0
- package/dist/pc/pc.pools.d.ts +12 -0
- package/dist/pc/pc.pools.js +15 -0
- package/dist/pc/pc.proficiencies.d.ts +8 -0
- package/dist/pc/pc.proficiencies.js +47 -0
- package/dist/pc/pc.proficiency-query.d.ts +11 -0
- package/dist/pc/pc.proficiency-query.js +17 -0
- package/dist/pc/pc.recalc.d.ts +105 -0
- package/dist/pc/pc.recalc.js +662 -0
- package/dist/pc/pc.resolver.d.ts +34 -0
- package/dist/pc/pc.resolver.js +267 -0
- package/dist/pc/pc.resource-seed.d.ts +10 -0
- package/dist/pc/pc.resource-seed.js +40 -0
- package/dist/pc/pc.rest.d.ts +23 -0
- package/dist/pc/pc.rest.js +128 -0
- package/dist/pc/pc.schema.d.ts +294 -0
- package/dist/pc/pc.schema.js +7 -0
- package/dist/pc/pc.slotting.d.ts +22 -0
- package/dist/pc/pc.slotting.js +20 -0
- package/dist/pc/pc.spellcasting.d.ts +56 -0
- package/dist/pc/pc.spellcasting.js +16 -0
- package/dist/pc/pc.table-column.d.ts +12 -0
- package/dist/pc/pc.table-column.js +8 -0
- package/dist/pc/pc.types.d.ts +514 -0
- package/dist/pc/pc.types.js +0 -0
- package/dist/race/race.codec.d.ts +9 -0
- package/dist/race/race.codec.js +13 -0
- package/dist/race/race.entity-type.d.ts +2 -0
- package/dist/race/race.parser.d.ts +3 -0
- package/dist/race/race.parser.js +12 -0
- package/dist/race/race.schema.d.ts +67 -0
- package/dist/race/race.schema.js +11 -0
- package/dist/race/race.types.d.ts +44 -0
- package/dist/race/race.types.js +0 -0
- package/dist/schemas/attack-schema.d.ts +38 -0
- package/dist/schemas/choice-schema.d.ts +5 -0
- package/dist/schemas/choice-schema.js +7 -0
- package/dist/schemas/duration-schema.d.ts +13 -0
- package/dist/schemas/duration-schema.js +6 -0
- package/dist/schemas/equipment-grant-schema.d.ts +6 -0
- package/dist/schemas/equipment-grant-schema.js +12 -0
- package/dist/schemas/feature-effect-schema.d.ts +131 -0
- package/dist/schemas/feature-effect-schema.js +6 -0
- package/dist/schemas/feature-schema.d.ts +2 -0
- package/dist/schemas/feature-schema.js +10 -0
- package/dist/schemas/index.d.ts +6 -0
- package/dist/schemas/resource-schema.d.ts +95 -0
- package/dist/schemas/resource-schema.js +12 -0
- package/dist/schemas/selection-pool-schema.d.ts +34 -0
- package/dist/schemas/selection-pool-schema.js +10 -0
- package/dist/spell/spell.access.d.ts +15 -0
- package/dist/spell/spell.access.js +25 -0
- package/dist/spell/spell.ai-schema.d.ts +24 -0
- package/dist/spell/spell.ai-schema.js +6 -0
- package/dist/spell/spell.codec.d.ts +3 -0
- package/dist/spell/spell.codec.js +8 -0
- package/dist/spell/spell.enrichment.d.ts +2 -0
- package/dist/spell/spell.enrichment.js +9 -0
- package/dist/spell/spell.entity-type.d.ts +2 -0
- package/dist/spell/spell.filter.d.ts +15 -0
- package/dist/spell/spell.filter.js +87 -0
- package/dist/spell/spell.generatable.d.ts +2 -0
- package/dist/spell/spell.parser.d.ts +3 -0
- package/dist/spell/spell.parser.js +7 -0
- package/dist/spell/spell.scaling.d.ts +14 -0
- package/dist/spell/spell.scaling.js +28 -0
- package/dist/spell/spell.schema.d.ts +31 -0
- package/dist/spell/spell.schema.js +6 -0
- package/dist/spell/spell.types.d.ts +25 -0
- package/dist/spell/spell.types.js +0 -0
- package/dist/srd-store.d.ts +53 -0
- package/dist/subclass/subclass.codec.d.ts +11 -0
- package/dist/subclass/subclass.codec.js +14 -0
- package/dist/subclass/subclass.entity-type.d.ts +2 -0
- package/dist/subclass/subclass.parser.d.ts +3 -0
- package/dist/subclass/subclass.parser.js +13 -0
- package/dist/subclass/subclass.schema.d.ts +118 -0
- package/dist/subclass/subclass.schema.js +12 -0
- package/dist/subclass/subclass.types.d.ts +20 -0
- package/dist/subclass/subclass.types.js +0 -0
- package/dist/types/abilities.d.ts +8 -0
- package/dist/types/abilities.js +0 -0
- package/dist/types/ac.d.ts +5 -0
- package/dist/types/attack.d.ts +22 -0
- package/dist/types/attack.js +0 -0
- package/dist/types/casting-option.d.ts +14 -0
- package/dist/types/casting-option.js +0 -0
- package/dist/types/choice.d.ts +66 -0
- package/dist/types/choice.js +6 -0
- package/dist/types/edition.d.ts +4 -0
- package/dist/types/edition.js +0 -0
- package/dist/types/equipment-grant.d.ts +41 -0
- package/dist/types/equipment-grant.js +0 -0
- package/dist/types/feature-effect.d.ts +79 -0
- package/dist/types/feature-effect.js +0 -0
- package/dist/types/feature.d.ts +41 -0
- package/dist/types/feature.js +0 -0
- package/dist/types/formula-context.d.ts +7 -0
- package/dist/types/formula-context.js +0 -0
- package/dist/types/hp.d.ts +4 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/item-conditions.types.d.ts +63 -0
- package/dist/types/item-conditions.types.js +0 -0
- package/dist/types/optional-feature.types.d.ts +60 -0
- package/dist/types/optional-feature.types.js +0 -0
- package/dist/types/resource.d.ts +44 -0
- package/dist/types/resource.js +0 -0
- package/dist/types/selection-pool.d.ts +37 -0
- package/dist/types/selection-pool.js +0 -0
- package/dist/types/speed.d.ts +8 -0
- package/dist/weapon/weapon.codec.d.ts +12 -0
- package/dist/weapon/weapon.codec.js +8 -0
- package/dist/weapon/weapon.entity-type.d.ts +2 -0
- package/dist/weapon/weapon.parser.d.ts +3 -0
- package/dist/weapon/weapon.parser.js +7 -0
- package/dist/weapon/weapon.schema.d.ts +34 -0
- package/dist/weapon/weapon.schema.js +6 -0
- package/dist/weapon/weapon.types.d.ts +36 -0
- package/dist/weapon/weapon.types.js +0 -0
- package/package.json +32 -0
- package/src/data-srd/ATTRIBUTION.md +2 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const monsterInputSchema: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
size: z.ZodEnum<{
|
|
5
|
+
Tiny: "Tiny";
|
|
6
|
+
Small: "Small";
|
|
7
|
+
Medium: "Medium";
|
|
8
|
+
Large: "Large";
|
|
9
|
+
Huge: "Huge";
|
|
10
|
+
Gargantuan: "Gargantuan";
|
|
11
|
+
}>;
|
|
12
|
+
type: z.ZodString;
|
|
13
|
+
subtype: z.ZodOptional<z.ZodString>;
|
|
14
|
+
alignment: z.ZodString;
|
|
15
|
+
cr: z.ZodString;
|
|
16
|
+
abilities: z.ZodObject<{
|
|
17
|
+
str: z.ZodNumber;
|
|
18
|
+
dex: z.ZodNumber;
|
|
19
|
+
con: z.ZodNumber;
|
|
20
|
+
int: z.ZodNumber;
|
|
21
|
+
wis: z.ZodNumber;
|
|
22
|
+
cha: z.ZodNumber;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
ac: z.ZodArray<z.ZodObject<{
|
|
25
|
+
ac: z.ZodNumber;
|
|
26
|
+
from: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
27
|
+
condition: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, z.core.$strip>>;
|
|
29
|
+
hp: z.ZodObject<{
|
|
30
|
+
average: z.ZodNumber;
|
|
31
|
+
formula: z.ZodString;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
speed: z.ZodObject<{
|
|
34
|
+
walk: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
fly: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
swim: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
climb: z.ZodOptional<z.ZodNumber>;
|
|
38
|
+
burrow: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
saves: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
41
|
+
skills: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
42
|
+
damage_vulnerabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
43
|
+
damage_resistances: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
44
|
+
damage_immunities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
45
|
+
condition_immunities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
46
|
+
senses: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
47
|
+
passive_perception: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
49
|
+
traits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
50
|
+
name: z.ZodString;
|
|
51
|
+
entries: z.ZodArray<z.ZodString>;
|
|
52
|
+
}, z.core.$strip>>>;
|
|
53
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
54
|
+
name: z.ZodString;
|
|
55
|
+
entries: z.ZodArray<z.ZodString>;
|
|
56
|
+
}, z.core.$strip>>>;
|
|
57
|
+
reactions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
58
|
+
name: z.ZodString;
|
|
59
|
+
entries: z.ZodArray<z.ZodString>;
|
|
60
|
+
}, z.core.$strip>>>;
|
|
61
|
+
legendary_actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
62
|
+
name: z.ZodString;
|
|
63
|
+
entries: z.ZodArray<z.ZodString>;
|
|
64
|
+
}, z.core.$strip>>>;
|
|
65
|
+
legendary_action_uses: z.ZodOptional<z.ZodNumber>;
|
|
66
|
+
legendary_resistance: z.ZodOptional<z.ZodNumber>;
|
|
67
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DocCodec } from "@archivist-gg/core";
|
|
2
|
+
import type { Monster } from "./monster.types.js";
|
|
3
|
+
/** Deprecated alias kept for the barrel re-export (`index.ts:7`) + `monster.resolve.ts:2`. */
|
|
4
|
+
export type MonsterRaw = Monster;
|
|
5
|
+
/**
|
|
6
|
+
* Normalizing codec (0c.1a B8). `parse` delegates to `parseMonster`, which maps
|
|
7
|
+
* the `legendary` alias and extracts Legendary-Resistance from trait text into the
|
|
8
|
+
* canonical `legendary_resistance` field. This canonicalization is intended and
|
|
9
|
+
* persists on save (B3); resolve-derived PB/XP are NOT added here. `serialize` stays
|
|
10
|
+
* `yaml.dump` (the edit-save path uses obsidian's separate `editableToYaml` — document
|
|
11
|
+
* that two-serializer split here; gate (d) Step 6 verifies `yaml.dump` round-trips).
|
|
12
|
+
*/
|
|
13
|
+
export declare const monsterCodec: DocCodec<Monster>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Monster } from "./monster.types.js";
|
|
2
|
+
export declare const CR_TO_XP: Record<string, number>;
|
|
3
|
+
export declare function parseCR(cr: string): number;
|
|
4
|
+
export declare function getChallengeRatingXP(cr: string): number;
|
|
5
|
+
export declare function getProficiencyBonus(cr: string): number;
|
|
6
|
+
export declare function enrichMonster(raw: Record<string, unknown>): Monster & {
|
|
7
|
+
xp?: number;
|
|
8
|
+
proficiency_bonus?: number;
|
|
9
|
+
};
|
|
10
|
+
export declare function convertMonsterEntries(monster: Monster & Record<string, unknown>, cr: string): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CR_TO_XP,
|
|
3
|
+
convertMonsterEntries,
|
|
4
|
+
enrichMonster,
|
|
5
|
+
getChallengeRatingXP,
|
|
6
|
+
getProficiencyBonus,
|
|
7
|
+
parseCR
|
|
8
|
+
} from "../chunk-66XXW2Z2.js";
|
|
9
|
+
import "../chunk-RAWJTA45.js";
|
|
10
|
+
import "../chunk-NAEPSZAM.js";
|
|
11
|
+
import "../chunk-WP2CX2JO.js";
|
|
12
|
+
export {
|
|
13
|
+
CR_TO_XP,
|
|
14
|
+
convertMonsterEntries,
|
|
15
|
+
enrichMonster,
|
|
16
|
+
getChallengeRatingXP,
|
|
17
|
+
getProficiencyBonus,
|
|
18
|
+
parseCR
|
|
19
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ResolveContext } from "@archivist-gg/core";
|
|
2
|
+
import type { MonsterRaw } from "./monster.codec.js";
|
|
3
|
+
/**
|
|
4
|
+
* Light, non-mutating derivation: computes proficiency bonus and XP from the
|
|
5
|
+
* monster's challenge rating. Returns a new object; the input `raw` is untouched.
|
|
6
|
+
*/
|
|
7
|
+
export declare function resolveMonster(raw: MonsterRaw, _ctx: ResolveContext): MonsterRaw & {
|
|
8
|
+
proficiency_bonus: number;
|
|
9
|
+
xp: number;
|
|
10
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Abilities, AC, HP, Speed, Feature } from "../types/index.js";
|
|
2
|
+
export interface Monster {
|
|
3
|
+
name: string;
|
|
4
|
+
size?: string;
|
|
5
|
+
type?: string;
|
|
6
|
+
subtype?: string;
|
|
7
|
+
alignment?: string;
|
|
8
|
+
cr?: string;
|
|
9
|
+
ac?: AC[];
|
|
10
|
+
hp?: HP;
|
|
11
|
+
speed?: Speed;
|
|
12
|
+
abilities?: Abilities;
|
|
13
|
+
saves?: Partial<Record<string, number>>;
|
|
14
|
+
skills?: Record<string, number>;
|
|
15
|
+
senses?: string[];
|
|
16
|
+
passive_perception?: number;
|
|
17
|
+
languages?: string[];
|
|
18
|
+
damage_vulnerabilities?: string[];
|
|
19
|
+
damage_resistances?: string[];
|
|
20
|
+
damage_immunities?: string[];
|
|
21
|
+
condition_immunities?: string[];
|
|
22
|
+
traits?: Feature[];
|
|
23
|
+
actions?: Feature[];
|
|
24
|
+
reactions?: Feature[];
|
|
25
|
+
legendary_actions?: Feature[];
|
|
26
|
+
legendary_action_uses?: number;
|
|
27
|
+
legendary_resistance?: number;
|
|
28
|
+
columns?: number;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../chunk-IKSMX4TN.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DocCodec } from "@archivist-gg/core";
|
|
2
|
+
import type { OptionalFeatureEntity } from "@archivist-gg/dnd5e/types/optional-feature.types";
|
|
3
|
+
/**
|
|
4
|
+
* Normalizing codec (0c.1a). `parse` delegates to `parseOptionalFeature`, which
|
|
5
|
+
* seeds the `edition: "2014"` default and validates against
|
|
6
|
+
* `optionalFeatureEntitySchema`. `serialize` stays `yaml.dump` (the edit-save
|
|
7
|
+
* path uses obsidian's separate serializer; gate (d) verifies `yaml.dump`
|
|
8
|
+
* round-trips through `parseOptionalFeature`).
|
|
9
|
+
*
|
|
10
|
+
* SPECIAL (0c.1a Task 7): the entity type already lives at
|
|
11
|
+
* `@archivist-gg/dnd5e/types/optional-feature.types` (moved in 0c.0), so the codec
|
|
12
|
+
* imports it from there rather than a sibling `./optional-feature.types`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const optionalFeatureCodec: DocCodec<OptionalFeatureEntity>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
optionalFeatureCodec
|
|
3
|
+
} from "../chunk-RSDRMH54.js";
|
|
4
|
+
import "../chunk-4F6AIZ36.js";
|
|
5
|
+
import "../chunk-MDEJHMKK.js";
|
|
6
|
+
import "../chunk-WYGD2UGN.js";
|
|
7
|
+
import "../chunk-PZOWBI3B.js";
|
|
8
|
+
import "../chunk-NXR3BD2V.js";
|
|
9
|
+
export {
|
|
10
|
+
optionalFeatureCodec
|
|
11
|
+
};
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const optionalFeatureEntitySchema: 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
|
+
feature_type: z.ZodString;
|
|
11
|
+
description: z.ZodString;
|
|
12
|
+
prerequisites: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
13
|
+
kind: z.ZodLiteral<"level">;
|
|
14
|
+
min: z.ZodNumber;
|
|
15
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
16
|
+
kind: z.ZodLiteral<"spell-known">;
|
|
17
|
+
spell: z.ZodString;
|
|
18
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
19
|
+
kind: z.ZodLiteral<"pact">;
|
|
20
|
+
pact: z.ZodEnum<{
|
|
21
|
+
tome: "tome";
|
|
22
|
+
blade: "blade";
|
|
23
|
+
chain: "chain";
|
|
24
|
+
talisman: "talisman";
|
|
25
|
+
}>;
|
|
26
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
27
|
+
kind: z.ZodLiteral<"class">;
|
|
28
|
+
class: z.ZodString;
|
|
29
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
30
|
+
kind: z.ZodLiteral<"ability">;
|
|
31
|
+
ability: z.ZodEnum<{
|
|
32
|
+
str: "str";
|
|
33
|
+
dex: "dex";
|
|
34
|
+
con: "con";
|
|
35
|
+
int: "int";
|
|
36
|
+
wis: "wis";
|
|
37
|
+
cha: "cha";
|
|
38
|
+
}>;
|
|
39
|
+
min: z.ZodNumber;
|
|
40
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
41
|
+
kind: z.ZodLiteral<"other">;
|
|
42
|
+
detail: z.ZodString;
|
|
43
|
+
}, z.core.$strip>], "kind">>;
|
|
44
|
+
available_to: z.ZodArray<z.ZodString>;
|
|
45
|
+
effects: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
46
|
+
kind: z.ZodLiteral<"initiative-bonus">;
|
|
47
|
+
value: z.ZodNumber;
|
|
48
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
49
|
+
kind: z.ZodLiteral<"immune-condition">;
|
|
50
|
+
condition: z.ZodString;
|
|
51
|
+
while: z.ZodOptional<z.ZodString>;
|
|
52
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
53
|
+
kind: z.ZodLiteral<"resistance">;
|
|
54
|
+
damage_type: z.ZodString;
|
|
55
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
56
|
+
kind: z.ZodLiteral<"hp-per-level-bonus">;
|
|
57
|
+
value: z.ZodNumber;
|
|
58
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
59
|
+
kind: z.ZodLiteral<"speed-bonus">;
|
|
60
|
+
mode: z.ZodEnum<{
|
|
61
|
+
walk: "walk";
|
|
62
|
+
fly: "fly";
|
|
63
|
+
swim: "swim";
|
|
64
|
+
climb: "climb";
|
|
65
|
+
burrow: "burrow";
|
|
66
|
+
}>;
|
|
67
|
+
value: z.ZodNumber;
|
|
68
|
+
set: z.ZodOptional<z.ZodBoolean>;
|
|
69
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
70
|
+
kind: z.ZodLiteral<"sense">;
|
|
71
|
+
type: z.ZodEnum<{
|
|
72
|
+
darkvision: "darkvision";
|
|
73
|
+
blindsight: "blindsight";
|
|
74
|
+
tremorsense: "tremorsense";
|
|
75
|
+
truesight: "truesight";
|
|
76
|
+
}>;
|
|
77
|
+
range: z.ZodNumber;
|
|
78
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
79
|
+
kind: z.ZodLiteral<"apply-condition">;
|
|
80
|
+
condition: z.ZodString;
|
|
81
|
+
duration: z.ZodOptional<z.ZodString>;
|
|
82
|
+
ends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
83
|
+
save_repeat: z.ZodOptional<z.ZodObject<{
|
|
84
|
+
ability: z.ZodString;
|
|
85
|
+
timing: z.ZodString;
|
|
86
|
+
}, z.core.$strip>>;
|
|
87
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
88
|
+
kind: z.ZodLiteral<"damage-bonus">;
|
|
89
|
+
damage_type: z.ZodString;
|
|
90
|
+
amount: z.ZodString;
|
|
91
|
+
applies_to: z.ZodOptional<z.ZodEnum<{
|
|
92
|
+
weapon: "weapon";
|
|
93
|
+
spell: "spell";
|
|
94
|
+
all: "all";
|
|
95
|
+
}>>;
|
|
96
|
+
condition: z.ZodOptional<z.ZodString>;
|
|
97
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
98
|
+
kind: z.ZodLiteral<"proficiency">;
|
|
99
|
+
proficiency_type: z.ZodEnum<{
|
|
100
|
+
weapon: "weapon";
|
|
101
|
+
skill: "skill";
|
|
102
|
+
tool: "tool";
|
|
103
|
+
language: "language";
|
|
104
|
+
"saving-throw": "saving-throw";
|
|
105
|
+
armor: "armor";
|
|
106
|
+
}>;
|
|
107
|
+
value: z.ZodString;
|
|
108
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
109
|
+
kind: z.ZodLiteral<"ac-bonus">;
|
|
110
|
+
value: z.ZodNumber;
|
|
111
|
+
requires_armor: z.ZodOptional<z.ZodBoolean>;
|
|
112
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
113
|
+
kind: z.ZodLiteral<"unarmored-ac">;
|
|
114
|
+
abilities: z.ZodArray<z.ZodEnum<{
|
|
115
|
+
str: "str";
|
|
116
|
+
dex: "dex";
|
|
117
|
+
con: "con";
|
|
118
|
+
int: "int";
|
|
119
|
+
wis: "wis";
|
|
120
|
+
cha: "cha";
|
|
121
|
+
}>>;
|
|
122
|
+
base: z.ZodOptional<z.ZodNumber>;
|
|
123
|
+
allow_shield: z.ZodOptional<z.ZodBoolean>;
|
|
124
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
125
|
+
kind: z.ZodLiteral<"weapon-ability">;
|
|
126
|
+
ability: z.ZodUnion<readonly [z.ZodEnum<{
|
|
127
|
+
str: "str";
|
|
128
|
+
dex: "dex";
|
|
129
|
+
con: "con";
|
|
130
|
+
int: "int";
|
|
131
|
+
wis: "wis";
|
|
132
|
+
cha: "cha";
|
|
133
|
+
}>, z.ZodLiteral<"spellcasting">]>;
|
|
134
|
+
weapons: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"chosen">, z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
135
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
136
|
+
kind: z.ZodLiteral<"roll-modifier">;
|
|
137
|
+
mode: z.ZodEnum<{
|
|
138
|
+
advantage: "advantage";
|
|
139
|
+
disadvantage: "disadvantage";
|
|
140
|
+
}>;
|
|
141
|
+
roll: z.ZodEnum<{
|
|
142
|
+
"saving-throw": "saving-throw";
|
|
143
|
+
"ability-check": "ability-check";
|
|
144
|
+
attack: "attack";
|
|
145
|
+
}>;
|
|
146
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
147
|
+
condition: z.ZodOptional<z.ZodString>;
|
|
148
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
149
|
+
kind: z.ZodLiteral<"extra-attack">;
|
|
150
|
+
count: z.ZodNumber;
|
|
151
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
152
|
+
kind: z.ZodLiteral<"crit-range">;
|
|
153
|
+
min_roll: z.ZodNumber;
|
|
154
|
+
applies_to: z.ZodOptional<z.ZodEnum<{
|
|
155
|
+
weapon: "weapon";
|
|
156
|
+
spell: "spell";
|
|
157
|
+
all: "all";
|
|
158
|
+
}>>;
|
|
159
|
+
condition: z.ZodOptional<z.ZodString>;
|
|
160
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
161
|
+
kind: z.ZodLiteral<"reroll-damage">;
|
|
162
|
+
max_reroll: z.ZodNumber;
|
|
163
|
+
applies_to: z.ZodOptional<z.ZodEnum<{
|
|
164
|
+
weapon: "weapon";
|
|
165
|
+
spell: "spell";
|
|
166
|
+
all: "all";
|
|
167
|
+
}>>;
|
|
168
|
+
once_per_die: z.ZodOptional<z.ZodBoolean>;
|
|
169
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
170
|
+
kind: z.ZodLiteral<"attack-rule">;
|
|
171
|
+
flag: z.ZodEnum<{
|
|
172
|
+
"no-ranged-in-melee-disadvantage": "no-ranged-in-melee-disadvantage";
|
|
173
|
+
}>;
|
|
174
|
+
}, z.core.$strip>], "kind">>;
|
|
175
|
+
action_cost: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
176
|
+
action: "action";
|
|
177
|
+
"bonus-action": "bonus-action";
|
|
178
|
+
reaction: "reaction";
|
|
179
|
+
free: "free";
|
|
180
|
+
special: "special";
|
|
181
|
+
}>>>;
|
|
182
|
+
uses: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
183
|
+
max: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
184
|
+
recharge: z.ZodEnum<{
|
|
185
|
+
"short-rest": "short-rest";
|
|
186
|
+
"long-rest": "long-rest";
|
|
187
|
+
dawn: "dawn";
|
|
188
|
+
dusk: "dusk";
|
|
189
|
+
turn: "turn";
|
|
190
|
+
round: "round";
|
|
191
|
+
custom: "custom";
|
|
192
|
+
}>;
|
|
193
|
+
}, z.core.$strip>>>;
|
|
194
|
+
consumes: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
195
|
+
source: z.ZodOptional<z.ZodEnum<{
|
|
196
|
+
resource: "resource";
|
|
197
|
+
"class-column": "class-column";
|
|
198
|
+
"attack-dice": "attack-dice";
|
|
199
|
+
}>>;
|
|
200
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
201
|
+
column: z.ZodOptional<z.ZodString>;
|
|
202
|
+
amount: z.ZodNumber;
|
|
203
|
+
expend_condition: z.ZodOptional<z.ZodEnum<{
|
|
204
|
+
roll_succeeds: "roll_succeeds";
|
|
205
|
+
roll_fails: "roll_fails";
|
|
206
|
+
target_takes_damage: "target_takes_damage";
|
|
207
|
+
always: "always";
|
|
208
|
+
}>>;
|
|
209
|
+
free_uses: z.ZodOptional<z.ZodObject<{
|
|
210
|
+
amount: z.ZodNumber;
|
|
211
|
+
reset: z.ZodEnum<{
|
|
212
|
+
"short-rest": "short-rest";
|
|
213
|
+
"long-rest": "long-rest";
|
|
214
|
+
dawn: "dawn";
|
|
215
|
+
dusk: "dusk";
|
|
216
|
+
turn: "turn";
|
|
217
|
+
round: "round";
|
|
218
|
+
custom: "custom";
|
|
219
|
+
}>;
|
|
220
|
+
state_key: z.ZodOptional<z.ZodString>;
|
|
221
|
+
}, z.core.$strip>>;
|
|
222
|
+
}, z.core.$strip>>>;
|
|
223
|
+
duration: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"instantaneous">, z.ZodLiteral<"until-dispelled">, z.ZodObject<{
|
|
224
|
+
amount: z.ZodNumber;
|
|
225
|
+
unit: z.ZodEnum<{
|
|
226
|
+
round: "round";
|
|
227
|
+
minute: "minute";
|
|
228
|
+
hour: "hour";
|
|
229
|
+
day: "day";
|
|
230
|
+
}>;
|
|
231
|
+
}, z.core.$strict>]>>>;
|
|
232
|
+
passive: z.ZodOptional<z.ZodBoolean>;
|
|
233
|
+
activatable: z.ZodOptional<z.ZodBoolean>;
|
|
234
|
+
}, z.core.$strip>;
|
|
235
|
+
export type OptionalFeatureSchemaInput = z.input<typeof optionalFeatureEntitySchema>;
|
|
236
|
+
export type OptionalFeatureSchemaOutput = z.output<typeof optionalFeatureEntitySchema>;
|
package/dist/pack.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SystemPack } from "@archivist-gg/core";
|
|
2
|
+
/**
|
|
3
|
+
* The real `dnd5e` SystemPack. It owns the parse/resolve/generate contract for
|
|
4
|
+
* D&D 5e entity types via their {@link EntityType} definitions; presentation
|
|
5
|
+
* (renderer/edit/modal) stays in the obsidian package. It is the only pack the
|
|
6
|
+
* kernel registers.
|
|
7
|
+
*
|
|
8
|
+
* All 11 authored types are ported, plus the two generate-only types (npc and
|
|
9
|
+
* encounter); a new entity type joins by appending its EntityType here.
|
|
10
|
+
*/
|
|
11
|
+
export declare const dnd5ePack: SystemPack;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type ConditionSlug = "blinded" | "charmed" | "deafened" | "frightened" | "grappled" | "incapacitated" | "invisible" | "paralyzed" | "petrified" | "poisoned" | "prone" | "restrained" | "stunned" | "unconscious";
|
|
2
|
+
export declare const CONDITION_SLUGS: readonly ["blinded", "charmed", "deafened", "frightened", "grappled", "incapacitated", "invisible", "paralyzed", "petrified", "poisoned", "prone", "restrained", "stunned", "unconscious"];
|
|
3
|
+
export declare const CONDITION_DISPLAY_NAMES: Record<ConditionSlug, string>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Feature } from "@archivist-gg/dnd5e/types/feature";
|
|
2
|
+
import type { Choice } from "@archivist-gg/dnd5e/types/choice";
|
|
3
|
+
export declare const DECISION_SIGNAL: RegExp[];
|
|
4
|
+
export declare function recognizeDecision(feature: Feature): Choice[] | "informational" | null;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { CharacterState, Edition, ConditionEffects } from "./pc.types.js";
|
|
2
|
+
import type { Ability } from "@archivist-gg/dnd5e";
|
|
3
|
+
export declare function computeConditionEffects(state: CharacterState, edition: Edition, _scores: Record<Ability, number>): ConditionEffects;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { Choice, EntityFilter, Ability } from "@archivist-gg/dnd5e/types/choice";
|
|
2
|
+
import type { ResolvedCharacter, ChoiceValue, FeatureSource } from "./pc.types.js";
|
|
3
|
+
import type { RegisteredEntity } from "@archivist-gg/core";
|
|
4
|
+
export interface DecisionRegistry {
|
|
5
|
+
search(query: string, entityType: string, limit: number): RegisteredEntity[];
|
|
6
|
+
getByTypeAndSlug(entityType: string, slug: string): RegisteredEntity | undefined;
|
|
7
|
+
}
|
|
8
|
+
export interface ResolvedOption {
|
|
9
|
+
value: string;
|
|
10
|
+
label: string;
|
|
11
|
+
entity?: RegisteredEntity;
|
|
12
|
+
/** The option's own prose (a select-inline InlineOption may supply one — e.g. each
|
|
13
|
+
* Combat Mastery describes what it does). Surfaced by the strip near the chips. */
|
|
14
|
+
description?: string;
|
|
15
|
+
/** True when a `from` slug has no entity behind it — render visible-but-inert. */
|
|
16
|
+
missing?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Status contract: over-selection (n > need) reports `resolved` — the engine
|
|
20
|
+
* never reports an error for too many picks; the picker UI owns cap enforcement.
|
|
21
|
+
* Likewise for ability-points `max_per`: the engine only sums total points
|
|
22
|
+
* allocated, so per-ability caps are picker-enforced, not reflected here.
|
|
23
|
+
*/
|
|
24
|
+
export type DecisionStatus = "resolved" | "partial" | "unresolved" | "informational";
|
|
25
|
+
export interface DecisionItem {
|
|
26
|
+
key: string;
|
|
27
|
+
source: FeatureSource;
|
|
28
|
+
level: number;
|
|
29
|
+
featureName: string;
|
|
30
|
+
/**
|
|
31
|
+
* The source feature/trait's own description (race trait, background feature,
|
|
32
|
+
* class feature) — threaded through from the walk that emits the item so the
|
|
33
|
+
* decision strip can render it as a quiet markdown block at the top of the
|
|
34
|
+
* row's nest (smoke r7). Top-level rows only; a child inherits NOTHING from
|
|
35
|
+
* its parent — it carries the sub-choice option's own `description` (when the
|
|
36
|
+
* authored InlineOption supplies one) or none.
|
|
37
|
+
*/
|
|
38
|
+
description?: string;
|
|
39
|
+
/**
|
|
40
|
+
* When `status === "informational"` this is a placeholder sentinel and MUST
|
|
41
|
+
* NOT be rendered — informational items render from `featureName` only
|
|
42
|
+
* (Task 16 contract). For every other status it is the real choice to render.
|
|
43
|
+
*/
|
|
44
|
+
choice: Choice;
|
|
45
|
+
options: ResolvedOption[];
|
|
46
|
+
selected: ChoiceValue | undefined;
|
|
47
|
+
status: DecisionStatus;
|
|
48
|
+
/**
|
|
49
|
+
* Populated only for the selected branch of a select-inline (the
|
|
50
|
+
* revealed-on-selection rule): a child decision becomes visible once its
|
|
51
|
+
* parent option is chosen. An unresolved child downgrades the parent's
|
|
52
|
+
* status to "partial".
|
|
53
|
+
*/
|
|
54
|
+
children?: DecisionItem[];
|
|
55
|
+
}
|
|
56
|
+
export interface DecisionLedger {
|
|
57
|
+
classes: Array<{
|
|
58
|
+
classIndex: number;
|
|
59
|
+
levels: Array<{
|
|
60
|
+
level: number;
|
|
61
|
+
items: DecisionItem[];
|
|
62
|
+
}>;
|
|
63
|
+
}>;
|
|
64
|
+
origin: DecisionItem[];
|
|
65
|
+
}
|
|
66
|
+
export interface DecisionContext {
|
|
67
|
+
registry: DecisionRegistry;
|
|
68
|
+
}
|
|
69
|
+
/** "[[SRD 2024/Classes/Fighter]]" → "fighter" (tail segment, slugified). */
|
|
70
|
+
export declare function wikilinkTailSlug(link: string): string;
|
|
71
|
+
/** "srd-2024_fighter" → "fighter". Tolerates a nullish slug (degrades to "") so a
|
|
72
|
+
* malformed entity can't hard-crash the builder; the resolver backfills real slugs. */
|
|
73
|
+
export declare function bareEntitySlug(slug: string | null | undefined): string;
|
|
74
|
+
declare function matchesFilter(e: RegisteredEntity, where: EntityFilter, ownerBare: string): boolean;
|
|
75
|
+
/** Test-only export of {@link matchesFilter} (Task B2). */
|
|
76
|
+
export declare const __matchesFilterForTest: typeof matchesFilter;
|
|
77
|
+
/** Walk every decision definition + persisted selection and collect chosen
|
|
78
|
+
* proficiencies. Pure; called by recalc. Values are validated against the
|
|
79
|
+
* decision's option pool — stale slugs (outside `from`) are ignored. */
|
|
80
|
+
export declare function collectChosenProficiencies(resolved: ResolvedCharacter): {
|
|
81
|
+
skills: string[];
|
|
82
|
+
expertise: string[];
|
|
83
|
+
languages: string[];
|
|
84
|
+
tools: string[];
|
|
85
|
+
};
|
|
86
|
+
export interface OriginAbilityPoints {
|
|
87
|
+
race: Partial<Record<Ability, number>>;
|
|
88
|
+
background: Partial<Record<Ability, number>>;
|
|
89
|
+
}
|
|
90
|
+
/** Pure: folds ORIGIN (race/background) `ability-points` decisions out of
|
|
91
|
+
* origin_choices into per-namespace totals. Values are clamped picker-side
|
|
92
|
+
* already, but clamp again defensively: per-ability max_per, then stop at the
|
|
93
|
+
* points total walking ABILITY_KEYS order. Class-level ASI stays on the
|
|
94
|
+
* legacy choices[lvl].asi path recalc already folds — do not double-count. */
|
|
95
|
+
export declare function collectChosenAbilityPoints(resolved: ResolvedCharacter): OriginAbilityPoints;
|
|
96
|
+
export declare function buildDecisionLedger(resolved: ResolvedCharacter, ctx: DecisionContext): DecisionLedger;
|
|
97
|
+
export {};
|