@archivist-gg/dnd5e 0.3.9 → 0.3.11

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.
@@ -21,7 +21,7 @@ import {
21
21
  } from "./chunk-YHYTW5QA.js";
22
22
  import {
23
23
  collectAdditionalSpells
24
- } from "./chunk-MI7P3NX3.js";
24
+ } from "./chunk-3HX5VLWP.js";
25
25
  import {
26
26
  isItemEntity,
27
27
  resolveEntityForEntry
@@ -56,7 +56,7 @@ import {
56
56
  } from "./chunk-EVMUJYUD.js";
57
57
  import {
58
58
  mirrorSpellShapes
59
- } from "./chunk-OZP6JFGT.js";
59
+ } from "./chunk-XY6X2APM.js";
60
60
  import {
61
61
  ABILITY_KEYS
62
62
  } from "./chunk-WELIKLZF.js";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-6X4KUDMU.js";
10
10
  import {
11
11
  mirrorSpellShapes
12
- } from "./chunk-OZP6JFGT.js";
12
+ } from "./chunk-XY6X2APM.js";
13
13
  import {
14
14
  ABILITY_KEYS
15
15
  } from "./chunk-WELIKLZF.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  parseFeat
3
- } from "./chunk-22MOUU2G.js";
3
+ } from "./chunk-T2SNEJOE.js";
4
4
 
5
5
  // src/feat/feat.codec.ts
6
6
  import yaml from "js-yaml";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  parseSpell
3
- } from "./chunk-OZP6JFGT.js";
3
+ } from "./chunk-XY6X2APM.js";
4
4
 
5
5
  // src/spell/spell.codec.ts
6
6
  import yaml from "js-yaml";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  featEntitySchema
3
- } from "./chunk-OYUEUKKF.js";
3
+ } from "./chunk-U3BABVJF.js";
4
4
 
5
5
  // src/feat/feat.parser.ts
6
6
  import { parseYaml } from "@archivist-gg/core";
@@ -69,13 +69,17 @@ var featEntitySchema = z.object({
69
69
  optionalfeature_progression: z.array(progressionSchema).optional(),
70
70
  // 4
71
71
  resources: z.array(resourceSchema).optional(),
72
- // closes the feat.types.ts `Feat.resources` schema/type asymmetry (C);
73
- // ZERO converter/bundle carriers (no census row) — the only behaviour delta is AUTHORED feats,
74
- // where the type has promised the field all along. Import resourceSchema.
72
+ // closes the feat.types.ts `Feat.resources` schema/type asymmetry (C).
73
+ // CONVERTER carriers since import-5etools cb382b6 (feat-mapper `mapFeatEconomy`): 69 of 287 feat docs,
74
+ // 72 entries (41 `prof`, 29 `1`, Lucky PHB `3`, Boon of Recovery `10` + die d10), ids owner-namespaced
75
+ // `<feat-slug-tail>:<tracker-slug>`; 0 SRD-bundle carriers. The resolver carries them onto the
76
+ // synthesized feat feature, so each draws a tracker. Import resourceSchema.
75
77
  action_cost: actionCostEnum.optional(),
76
- // ruling R-G1b-5 (gate1-r1 f1): a TOP-LEVEL bundle key on ONE
77
- // feat (`SRD 2024/Feats/Boon of the Night Spirit.md`, `action_cost: bonus-action` at entity top
78
- // level) — the ninth SRD-control non-kept row: top-level on the ENTITY, not featureSchema-shaped
78
+ // ruling R-G1b-5 (gate1-r1 f1): a TOP-LEVEL entity key. SRD bundle:
79
+ // one feat per edition (`SRD 2024/Feats/Boon of the Night Spirit.md` bonus-action; SRD 5e Grappler
80
+ // `action` through the `feat_features` overlay since 0.3.11). CONVERTER: 76 of 287 feat docs since
81
+ // import-5etools 1002a6c (31 bonus-action, 34 reaction, 11 action). Top-level at entity level
82
+ // — the ninth SRD-control non-kept row: top-level on the ENTITY, not featureSchema-shaped
79
83
  // (finding 14's nine rows split 4 featureSchema / 4 §2.8-arity / this one, which needed its own
80
84
  // declaration — gate1-r4 R4-1). `actionCostEnum` is exported from
81
85
  // `schemas/resource-schema.ts` (optionalFeatureEntitySchema already imports it). MAPPED since
@@ -0,0 +1,16 @@
1
+ // src/spell/casting-time.ts
2
+ function parseCastingTime(token) {
3
+ var _a;
4
+ const t = (_a = token == null ? void 0 : token.trim()) != null ? _a : "";
5
+ if (!t) return null;
6
+ if (/^(?:1\s*)?reaction\b/i.test(t)) return { kind: "reaction", count: 1 };
7
+ if (/^(?:1\s*)?bonus(?:[\s-]*action)?\b/i.test(t)) return { kind: "bonus", count: 1 };
8
+ if (/^(?:1\s*)?action\b/i.test(t)) return { kind: "action", count: 1 };
9
+ const m = /^(\d+)?[\s-]*(minute|min|hour|hr)s?\b/i.exec(t);
10
+ if (m) return { kind: "time", count: m[1] ? Number(m[1]) : 1, unit: /^h/i.test(m[2]) ? "hour" : "minute" };
11
+ return null;
12
+ }
13
+
14
+ export {
15
+ parseCastingTime
16
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  spellEntitySchema
3
- } from "./chunk-VQAXTIBW.js";
3
+ } from "./chunk-ZDAEGJH4.js";
4
4
 
5
5
  // src/spell/spell.parser.ts
6
6
  import { parseYaml, toStringSafe } from "@archivist-gg/core";
@@ -18,6 +18,7 @@ var KNOWN_KEYS = /* @__PURE__ */ new Set([
18
18
  "description",
19
19
  "at_higher_levels",
20
20
  "damage",
21
+ "damage_roll",
21
22
  "saving_throw",
22
23
  "casting_options",
23
24
  // §2 · the fourteen converter keys. This gate and `spellEntitySchema` are independent: a key
@@ -121,6 +122,7 @@ function parseSpell(source) {
121
122
  if (raw.description) spell.description = raw.description;
122
123
  if (raw.at_higher_levels) spell.at_higher_levels = raw.at_higher_levels.map(String);
123
124
  if (raw.damage) spell.damage = { types: raw.damage.types.map(String) };
125
+ if (raw.damage_roll != null) spell.damage_roll = raw.damage_roll;
124
126
  if (raw.saving_throw) spell.saving_throw = { ability: raw.saving_throw.ability };
125
127
  if (raw.casting_options) {
126
128
  spell.casting_options = raw.casting_options.map((opt) => {
@@ -59,6 +59,8 @@ var spellEntitySchema = z.object({
59
59
  description: z.string().optional(),
60
60
  at_higher_levels: z.array(z.string()).optional(),
61
61
  damage: z.object({ types: z.array(z.string()) }).optional(),
62
+ // The base roll at the spell's own level (a cantrip's tier-1 roll); see `Spell.damage_roll`.
63
+ damage_roll: z.string().optional(),
62
64
  saving_throw: z.object({ ability: z.string() }).optional(),
63
65
  casting_options: z.array(castingOptionSchema).optional(),
64
66
  // §2 · the fourteen converter keys this root refused before R4-G2. Doc counts are MEASURED over
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  featCodec
3
- } from "../chunk-3UNP3G4D.js";
4
- import "../chunk-22MOUU2G.js";
5
- import "../chunk-OYUEUKKF.js";
3
+ } from "../chunk-CHUALUIX.js";
4
+ import "../chunk-T2SNEJOE.js";
5
+ import "../chunk-U3BABVJF.js";
6
6
  import "../chunk-ZJXSXVFP.js";
7
7
  import "../chunk-2M34FLAY.js";
8
8
  import "../chunk-XTRDCSJB.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  parseFeat
3
- } from "../chunk-22MOUU2G.js";
4
- import "../chunk-OYUEUKKF.js";
3
+ } from "../chunk-T2SNEJOE.js";
4
+ import "../chunk-U3BABVJF.js";
5
5
  import "../chunk-ZJXSXVFP.js";
6
6
  import "../chunk-2M34FLAY.js";
7
7
  import "../chunk-XTRDCSJB.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  featEntitySchema
3
- } from "../chunk-OYUEUKKF.js";
3
+ } from "../chunk-U3BABVJF.js";
4
4
  import "../chunk-ZJXSXVFP.js";
5
5
  import "../chunk-2M34FLAY.js";
6
6
  import "../chunk-XTRDCSJB.js";