roll-parser 3.0.0-alpha.0 → 3.0.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 (163) hide show
  1. package/CHANGELOG.md +189 -0
  2. package/MIGRATION.md +147 -0
  3. package/README.md +985 -43
  4. package/dist/cli/args.d.ts +1 -0
  5. package/dist/cli/args.d.ts.map +1 -1
  6. package/dist/cli/args.js +81 -0
  7. package/dist/cli/args.js.map +1 -0
  8. package/dist/cli/format.d.ts +16 -4
  9. package/dist/cli/format.d.ts.map +1 -1
  10. package/dist/cli/format.js +17 -0
  11. package/dist/cli/format.js.map +1 -0
  12. package/dist/cli/index.d.ts +3 -0
  13. package/dist/cli/index.d.ts.map +1 -1
  14. package/dist/cli/index.js +14 -0
  15. package/dist/cli/index.js.map +1 -0
  16. package/dist/cli/main.d.ts +36 -0
  17. package/dist/cli/main.d.ts.map +1 -0
  18. package/dist/cli/main.js +83 -0
  19. package/dist/cli/main.js.map +1 -0
  20. package/dist/errors.d.ts +332 -14
  21. package/dist/errors.d.ts.map +1 -1
  22. package/dist/errors.js +141 -0
  23. package/dist/errors.js.map +1 -0
  24. package/dist/evaluator/die.d.ts +26 -0
  25. package/dist/evaluator/die.d.ts.map +1 -0
  26. package/dist/evaluator/die.js +19 -0
  27. package/dist/evaluator/die.js.map +1 -0
  28. package/dist/evaluator/env.d.ts +58 -0
  29. package/dist/evaluator/env.d.ts.map +1 -0
  30. package/dist/evaluator/env.js +11 -0
  31. package/dist/evaluator/env.js.map +1 -0
  32. package/dist/evaluator/evaluator.d.ts +62 -40
  33. package/dist/evaluator/evaluator.d.ts.map +1 -1
  34. package/dist/evaluator/evaluator.js +906 -0
  35. package/dist/evaluator/evaluator.js.map +1 -0
  36. package/dist/evaluator/modifiers/compare.d.ts +1 -1
  37. package/dist/evaluator/modifiers/compare.d.ts.map +1 -1
  38. package/dist/evaluator/modifiers/compare.js +15 -0
  39. package/dist/evaluator/modifiers/compare.js.map +1 -0
  40. package/dist/evaluator/modifiers/crit-threshold.d.ts +27 -0
  41. package/dist/evaluator/modifiers/crit-threshold.d.ts.map +1 -0
  42. package/dist/evaluator/modifiers/crit-threshold.js +23 -0
  43. package/dist/evaluator/modifiers/crit-threshold.js.map +1 -0
  44. package/dist/evaluator/modifiers/die-bound.d.ts +26 -0
  45. package/dist/evaluator/modifiers/die-bound.d.ts.map +1 -0
  46. package/dist/evaluator/modifiers/die-bound.js +14 -0
  47. package/dist/evaluator/modifiers/die-bound.js.map +1 -0
  48. package/dist/evaluator/modifiers/explode.d.ts +18 -6
  49. package/dist/evaluator/modifiers/explode.d.ts.map +1 -1
  50. package/dist/evaluator/modifiers/explode.js +103 -0
  51. package/dist/evaluator/modifiers/explode.js.map +1 -0
  52. package/dist/evaluator/modifiers/flags.d.ts +37 -0
  53. package/dist/evaluator/modifiers/flags.d.ts.map +1 -0
  54. package/dist/evaluator/modifiers/flags.js +18 -0
  55. package/dist/evaluator/modifiers/flags.js.map +1 -0
  56. package/dist/evaluator/modifiers/keep-drop.d.ts +12 -28
  57. package/dist/evaluator/modifiers/keep-drop.d.ts.map +1 -1
  58. package/dist/evaluator/modifiers/keep-drop.js +82 -0
  59. package/dist/evaluator/modifiers/keep-drop.js.map +1 -0
  60. package/dist/evaluator/modifiers/reroll.d.ts +14 -6
  61. package/dist/evaluator/modifiers/reroll.d.ts.map +1 -1
  62. package/dist/evaluator/modifiers/reroll.js +62 -0
  63. package/dist/evaluator/modifiers/reroll.js.map +1 -0
  64. package/dist/evaluator/modifiers/sort.d.ts +27 -0
  65. package/dist/evaluator/modifiers/sort.d.ts.map +1 -0
  66. package/dist/evaluator/modifiers/sort.js +13 -0
  67. package/dist/evaluator/modifiers/sort.js.map +1 -0
  68. package/dist/evaluator/modifiers/success-count.d.ts +2 -6
  69. package/dist/evaluator/modifiers/success-count.d.ts.map +1 -1
  70. package/dist/evaluator/modifiers/success-count.js +24 -0
  71. package/dist/evaluator/modifiers/success-count.js.map +1 -0
  72. package/dist/index.d.ts +35 -13
  73. package/dist/index.d.ts.map +1 -1
  74. package/dist/index.js +12 -1723
  75. package/dist/index.js.map +1 -0
  76. package/dist/lexer/lexer.d.ts +68 -8
  77. package/dist/lexer/lexer.d.ts.map +1 -1
  78. package/dist/lexer/lexer.js +260 -0
  79. package/dist/lexer/lexer.js.map +1 -0
  80. package/dist/lexer/tokens.d.ts +52 -7
  81. package/dist/lexer/tokens.d.ts.map +1 -1
  82. package/dist/lexer/tokens.js +42 -0
  83. package/dist/lexer/tokens.js.map +1 -0
  84. package/dist/parser/ast.d.ts +419 -80
  85. package/dist/parser/ast.d.ts.map +1 -1
  86. package/dist/parser/ast.js +52 -0
  87. package/dist/parser/ast.js.map +1 -0
  88. package/dist/parser/guards.d.ts +106 -0
  89. package/dist/parser/guards.d.ts.map +1 -0
  90. package/dist/parser/guards.js +121 -0
  91. package/dist/parser/guards.js.map +1 -0
  92. package/dist/parser/parser.d.ts +162 -15
  93. package/dist/parser/parser.d.ts.map +1 -1
  94. package/dist/parser/parser.js +751 -0
  95. package/dist/parser/parser.js.map +1 -0
  96. package/dist/rng/mock.d.ts +74 -13
  97. package/dist/rng/mock.d.ts.map +1 -1
  98. package/dist/rng/mock.js +30 -0
  99. package/dist/rng/mock.js.map +1 -0
  100. package/dist/rng/seeded.d.ts +149 -10
  101. package/dist/rng/seeded.d.ts.map +1 -1
  102. package/dist/rng/seeded.js +138 -0
  103. package/dist/rng/seeded.js.map +1 -0
  104. package/dist/rng/types.d.ts +57 -0
  105. package/dist/rng/types.d.ts.map +1 -1
  106. package/dist/rng/types.js +2 -0
  107. package/dist/rng/types.js.map +1 -0
  108. package/dist/roll.d.ts +59 -25
  109. package/dist/roll.d.ts.map +1 -1
  110. package/dist/roll.js +8 -0
  111. package/dist/roll.js.map +1 -0
  112. package/dist/testing.d.ts +5 -4
  113. package/dist/testing.d.ts.map +1 -1
  114. package/dist/testing.js +2 -38
  115. package/dist/testing.js.map +1 -0
  116. package/dist/types.d.ts +427 -24
  117. package/dist/types.d.ts.map +1 -1
  118. package/dist/types.js +8 -0
  119. package/dist/types.js.map +1 -0
  120. package/dist/version.d.ts +2 -0
  121. package/dist/version.d.ts.map +1 -0
  122. package/dist/version.js +2 -0
  123. package/dist/version.js.map +1 -0
  124. package/package.json +93 -40
  125. package/src/cli/args.ts +66 -9
  126. package/src/cli/format.ts +30 -7
  127. package/src/cli/index.ts +27 -67
  128. package/src/cli/main.ts +129 -0
  129. package/src/errors.ts +488 -23
  130. package/src/evaluator/die.ts +50 -0
  131. package/src/evaluator/env.ts +73 -0
  132. package/src/evaluator/evaluator.ts +1296 -349
  133. package/src/evaluator/modifiers/compare.ts +1 -1
  134. package/src/evaluator/modifiers/crit-threshold.ts +56 -0
  135. package/src/evaluator/modifiers/die-bound.ts +39 -0
  136. package/src/evaluator/modifiers/explode.ts +82 -76
  137. package/src/evaluator/modifiers/flags.ts +61 -0
  138. package/src/evaluator/modifiers/keep-drop.ts +124 -126
  139. package/src/evaluator/modifiers/reroll.ts +36 -64
  140. package/src/evaluator/modifiers/sort.ts +43 -0
  141. package/src/evaluator/modifiers/success-count.ts +6 -9
  142. package/src/index.ts +73 -34
  143. package/src/lexer/lexer.ts +201 -35
  144. package/src/lexer/tokens.ts +72 -7
  145. package/src/parser/ast.ts +453 -104
  146. package/src/parser/guards.ts +248 -0
  147. package/src/parser/parser.ts +835 -135
  148. package/src/rng/mock.ts +75 -14
  149. package/src/rng/seeded.ts +323 -58
  150. package/src/rng/types.ts +57 -0
  151. package/src/roll.ts +66 -41
  152. package/src/testing.ts +5 -9
  153. package/src/types.ts +416 -24
  154. package/src/version.ts +2 -0
  155. package/dist/cli.js +0 -1775
  156. package/dist/evaluator/index.d.ts +0 -8
  157. package/dist/evaluator/index.d.ts.map +0 -1
  158. package/dist/index.mjs +0 -1724
  159. package/dist/rng/index.d.ts +0 -8
  160. package/dist/rng/index.d.ts.map +0 -1
  161. package/dist/testing.mjs +0 -39
  162. package/src/evaluator/index.ts +0 -14
  163. package/src/rng/index.ts +0 -8
package/dist/types.d.ts CHANGED
@@ -3,29 +3,105 @@
3
3
  *
4
4
  * @module types
5
5
  */
6
- import type { ASTNode } from './parser/ast';
6
+ import type { ASTNode } from './parser/ast.js';
7
7
  /**
8
- * Comparison operator for compare points.
8
+ * Comparison operator for compare points. Spelled exactly as it appears in
9
+ * notation — `4d6!>=5` carries `'>='`, bare `f1` normalizes to `'='`.
10
+ *
11
+ * @category AST
9
12
  */
10
13
  export type CompareOp = '>' | '>=' | '<' | '<=' | '=';
11
14
  /**
12
- * A comparison threshold used by exploding dice, reroll, and success counting.
15
+ * A comparison threshold used by exploding dice, reroll, success counting, and
16
+ * crit-threshold overrides.
17
+ *
18
+ * The value is an {@link ASTNode} to support computed thresholds
19
+ * (`1d6!>(1d2+3)`), matching the pattern used by `DiceNode.count` and
20
+ * `DiceNode.sides`. The evaluated counterpart is {@link ResolvedComparePoint}.
13
21
  *
14
- * The value is an ASTNode to support computed thresholds (e.g., `>=ceil(5)`),
15
- * matching the pattern used by DiceNode.count and DiceNode.sides.
22
+ * @category AST
16
23
  */
17
24
  export type ComparePoint = {
18
- operator: CompareOp;
19
- value: ASTNode;
25
+ readonly operator: CompareOp;
26
+ readonly value: ASTNode;
27
+ };
28
+ /**
29
+ * A {@link ComparePoint} whose value has been evaluated to a number. Used
30
+ * throughout {@link RollPart}, where meta-expressions are already resolved —
31
+ * `1d6!>(1d2+3)` surfaces as `{ operator: '>', value: 5 }`.
32
+ *
33
+ * @category Results
34
+ */
35
+ export type ResolvedComparePoint = {
36
+ readonly operator: CompareOp;
37
+ readonly value: number;
20
38
  };
21
39
  /**
22
- * Modifier flags applied to individual die results.
40
+ * A resolved crit threshold `'default'` means the per-die default rule
41
+ * (`result === sides` for critical, `result === 1` for fumble), which is what
42
+ * bare `cs` / `cf` produce.
43
+ *
44
+ * @category Results
45
+ */
46
+ export type ResolvedCritThreshold = ResolvedComparePoint | 'default';
47
+ /**
48
+ * Tags attached to a {@link DieResult} by the evaluator. A die can carry more
49
+ * than one (an exploded die that was later dropped is `['dropped',
50
+ * 'exploded']`), and the set drives the markers in `RollResult.rendered`.
51
+ *
52
+ * | Tag | Meaning | Rendered as |
53
+ * |-----|---------|-------------|
54
+ * | `'kept'` | Counted toward the total. Every non-dropped die carries it. | plain |
55
+ * | `'dropped'` | Excluded from the total by `kh`/`kl`/`dh`/`dl` or group selection. | `~~n~~` |
56
+ * | `'exploded'` | Produced by, or the trigger of, an explosion (`!`, `!!`, `!p`). | plain |
57
+ * | `'rerolled'` | A discarded intermediate from `r` / `ro`, always paired with `'dropped'` — the replacement die carries no tag. | `~~n~~` (via `'dropped'`) |
58
+ * | `'min'` | Raised to a `minN` bound; `initialResult` keeps the raw face. | plain |
59
+ * | `'max'` | Lowered to a `maxN` bound; `initialResult` keeps the raw face. | plain |
60
+ * | `'success'` | Met a success-count threshold (`>=6`). | `**n**` |
61
+ * | `'failure'` | Met a failure threshold (`f1`). | `__n__` |
62
+ * | `'meta'` | Rolled by a meta-expression rather than by the visible pool. | not shown |
63
+ * | `'dc'` | The DC side of a `vs` comparison. Never part of the roll-side pool. | plain |
64
+ *
65
+ * `'meta'` is the one tag with no counterpart in the notation. Dice counts,
66
+ * sides, modifier counts and computed thresholds may themselves be dice
67
+ * (`(1d4)d6`, `4d6kh(1d2)`, `1d6!>(1d2+3)`). Those inner dice are not part of
68
+ * any pool, so they never appear in a {@link RollPart}; they are appended to
69
+ * `RollResult.rolls` tagged `'meta'` so an audit log can still show what the
70
+ * meta-expression rolled. Filter them out when summing or displaying a pool.
71
+ *
72
+ * `'dc'` marks the DC side of a `vs` comparison. Unlike `'meta'` these dice do
73
+ * render — `1d20[3] vs 2d10[5, 6]` shows both sides — but they are not part of
74
+ * the roll-side pool, so no modifier may sum, select, clamp, reroll, explode,
75
+ * or tally them. Filter them out when summing a pool, exactly as with `'meta'`.
76
+ *
77
+ * @category Results
23
78
  */
24
- export type DieModifier = 'dropped' | 'kept' | 'exploded' | 'rerolled' | 'success' | 'failure';
79
+ export type DieModifier = 'dropped' | 'kept' | 'exploded' | 'rerolled' | 'min' | 'max' | 'success' | 'failure' | 'meta' | 'dc';
25
80
  /**
26
81
  * PF2e Degree of Success. Produced by the `vs` operator when comparing a
27
82
  * roll against a Difficulty Class. Ordering is significant — natural 20
28
83
  * upgrades one step and natural 1 downgrades one step.
84
+ *
85
+ * Numeric by design: the enum members are plain numbers, so `--json` CLI
86
+ * output and `JSON.stringify` emit `0`–`3` and comparisons like
87
+ * `degree >= DegreeOfSuccess.Success` work.
88
+ *
89
+ * @example
90
+ * ```typescript
91
+ * import { DegreeOfSuccess, roll } from 'roll-parser';
92
+ * import { createMockRng } from 'roll-parser/testing';
93
+ *
94
+ * const result = roll('1d20+7 vs 15', { rng: createMockRng([12]) });
95
+ * result.degree; // DegreeOfSuccess.Success (2)
96
+ * result.natural; // 12 — the raw d20 face, used for the ±1 step
97
+ * result.rendered; // '1d20[12] + 7 vs 15 = Success'
98
+ *
99
+ * if (result.degree != null && result.degree >= DegreeOfSuccess.Success) {
100
+ * // hit
101
+ * }
102
+ * ```
103
+ *
104
+ * @category Results
29
105
  */
30
106
  export declare enum DegreeOfSuccess {
31
107
  CriticalFailure = 0,
@@ -34,7 +110,25 @@ export declare enum DegreeOfSuccess {
34
110
  CriticalSuccess = 3
35
111
  }
36
112
  /**
37
- * Individual die roll result with metadata.
113
+ * One physical die and everything the evaluator learned about it.
114
+ *
115
+ * The same object is shared between `RollResult.rolls` and the `rolls[]` of
116
+ * the {@link RollPart} that produced it — there is no deep clone, so mutating
117
+ * a die is visible through both views.
118
+ *
119
+ * @example
120
+ * ```typescript
121
+ * import { roll } from 'roll-parser';
122
+ * import { createMockRng } from 'roll-parser/testing';
123
+ *
124
+ * const result = roll('4d6kh3', { rng: createMockRng([3, 6, 2, 5]) });
125
+ * result.rolls[1];
126
+ * // { sides: 6, result: 6, modifiers: ['kept'], critical: true, fumble: false }
127
+ * result.rolls[2];
128
+ * // { sides: 6, result: 2, modifiers: ['dropped'], critical: false, fumble: false }
129
+ * ```
130
+ *
131
+ * @category Results
38
132
  */
39
133
  export type DieResult = {
40
134
  /**
@@ -45,6 +139,13 @@ export type DieResult = {
45
139
  sides: number;
46
140
  /** The rolled value */
47
141
  result: number;
142
+ /**
143
+ * Raw first roll before any mutation (e.g., compound-explode accumulation).
144
+ * Only populated when `result` has been overwritten with a computed value.
145
+ * Consumers that need the original face (nat-20 / nat-1 detection) should
146
+ * read `initialResult ?? result`.
147
+ */
148
+ initialResult?: number;
48
149
  /** Modifiers applied to this die */
49
150
  modifiers: DieModifier[];
50
151
  /** True if rolled the maximum value (always false for Fate dice) */
@@ -53,9 +154,242 @@ export type DieResult = {
53
154
  fumble: boolean;
54
155
  };
55
156
  /**
56
- * Complete roll result with all metadata.
157
+ * One entry inside a flattened keep/drop chain. Counts are resolved at
158
+ * evaluation time (meta-expressions like `kh(1d2)` become the rolled number).
159
+ *
160
+ * Chained keep/drop modifiers flatten into one list — `4d6kh3dl1` yields two
161
+ * specs against a single pool, each applied independently, with drop sets
162
+ * unioned (Roll20 semantics).
163
+ *
164
+ * @category Results
165
+ */
166
+ export type KeepDropSpec = {
167
+ readonly kind: 'keep' | 'drop';
168
+ readonly selector: 'highest' | 'lowest';
169
+ readonly count: number;
170
+ };
171
+ /**
172
+ * Fields shared by every {@link RollPart} variant. `start`/`end` mirror the
173
+ * source span of the AST node the part was evaluated from — present whenever
174
+ * the AST came from `parse()`, absent on hand-built ASTs.
175
+ *
176
+ * Useful for code that walks the parts tree generically: any part can be
177
+ * narrowed to this shape without switching on `type` first.
178
+ *
179
+ * @category Results
180
+ */
181
+ export type RollPartBase = {
182
+ /** Sub-total this part contributed to its parent. */
183
+ total: number;
184
+ start?: number;
185
+ end?: number;
186
+ };
187
+ /**
188
+ * Structured breakdown of an evaluated expression, mirroring the AST 1:1 —
189
+ * every ASTNode produces exactly one RollPart. Discriminants are lowercase
190
+ * camelCase to distinguish evaluation-tree types from `ASTNode.type`
191
+ * (PascalCase) at a glance.
192
+ *
193
+ * Invariants:
194
+ * - `RollResult.parts.total === RollResult.total`.
195
+ * - `successCount.total === successes - failures`.
196
+ * - `literal.total === value` and `variable.total === value`.
197
+ * - Each part's `rolls[]` shares `DieResult` references with
198
+ * `RollResult.rolls[]`; both reflect post-evaluation state (explode
199
+ * accumulation, reroll flags, keep/drop flags). No deep clone.
200
+ *
201
+ * Meta-expression sub-trees (`4d6kh(1d2)`, `(1+1)d6` counts/sides, computed
202
+ * thresholds) are not surfaced as nested parts — their resolved numbers
203
+ * appear in the owning part, and their dice are inspectable in
204
+ * `RollResult.rolls` via the `'meta'` modifier tag.
205
+ *
206
+ * @example Walking the tree with an exhaustive switch
207
+ * ```typescript
208
+ * import type { RollPart } from 'roll-parser';
209
+ *
210
+ * function describe(part: RollPart): string {
211
+ * switch (part.type) {
212
+ * case 'literal':
213
+ * return String(part.value);
214
+ * case 'variable':
215
+ * return `@${part.name}`;
216
+ * case 'dice':
217
+ * return `${part.count}d${part.sides}[${part.rolls.map((d) => d.result).join(', ')}]`;
218
+ * case 'fateDice':
219
+ * return `${part.count}dF`;
220
+ * case 'grouped':
221
+ * return `(${describe(part.inner)})`;
222
+ * case 'binaryOp':
223
+ * return `${describe(part.left)} ${part.operator} ${describe(part.right)}`;
224
+ * case 'unaryOp':
225
+ * return `-${describe(part.operand)}`;
226
+ * case 'keepDrop':
227
+ * return `${describe(part.target)} [${part.specs.length} keep/drop]`;
228
+ * case 'explode':
229
+ * return `${describe(part.target)} (${part.variant} explode)`;
230
+ * case 'reroll':
231
+ * return `${describe(part.target)} (reroll${part.once ? ' once' : ''})`;
232
+ * case 'dieBound':
233
+ * return `${describe(part.target)} (${part.bound} ${part.value})`;
234
+ * case 'successCount':
235
+ * return `${describe(part.target)} => ${part.successes}-${part.failures}`;
236
+ * case 'versus':
237
+ * return `${describe(part.roll)} vs ${describe(part.dc)}`;
238
+ * case 'functionCall':
239
+ * return `${part.name}(${part.args.map(describe).join(', ')})`;
240
+ * case 'group':
241
+ * return `{${part.parts.map(describe).join(', ')}}`;
242
+ * case 'sort':
243
+ * return `${describe(part.target)} (${part.order})`;
244
+ * case 'critThreshold':
245
+ * return `${describe(part.target)} (crit override)`;
246
+ * }
247
+ * }
248
+ * ```
249
+ *
250
+ * @example Reading a concrete tree
251
+ * ```typescript
252
+ * import { roll } from 'roll-parser';
253
+ * import { createMockRng } from 'roll-parser/testing';
254
+ *
255
+ * const result = roll('4d6kh3 + 2', { rng: createMockRng([3, 6, 2, 5]) });
256
+ * result.parts.type; // 'binaryOp'
257
+ * result.parts.total; // 16 — always equal to result.total
258
+ * describe(result.parts); // '4d6[3, 6, 2, 5] [1 keep/drop] + 2'
259
+ * ```
260
+ *
261
+ * @category Results
262
+ */
263
+ export type RollPart = (RollPartBase & {
264
+ type: 'literal';
265
+ value: number;
266
+ }) | (RollPartBase & {
267
+ type: 'variable';
268
+ name: string;
269
+ value: number;
270
+ }) | (RollPartBase & {
271
+ type: 'dice';
272
+ count: number;
273
+ sides: number;
274
+ rolls: DieResult[];
275
+ }) | (RollPartBase & {
276
+ type: 'fateDice';
277
+ count: number;
278
+ rolls: DieResult[];
279
+ }) | (RollPartBase & {
280
+ type: 'grouped';
281
+ inner: RollPart;
282
+ }) | (RollPartBase & {
283
+ type: 'binaryOp';
284
+ operator: '+' | '-' | '*' | '/' | '%' | '**';
285
+ left: RollPart;
286
+ right: RollPart;
287
+ }) | (RollPartBase & {
288
+ type: 'unaryOp';
289
+ operator: '-';
290
+ operand: RollPart;
291
+ }) | (RollPartBase & {
292
+ type: 'keepDrop';
293
+ specs: KeepDropSpec[];
294
+ target: RollPart;
295
+ }) | (RollPartBase & {
296
+ type: 'explode';
297
+ variant: 'standard' | 'compound' | 'penetrating';
298
+ threshold?: ResolvedComparePoint;
299
+ target: RollPart;
300
+ }) | (RollPartBase & {
301
+ type: 'reroll';
302
+ once: boolean;
303
+ condition: ResolvedComparePoint;
304
+ target: RollPart;
305
+ }) | (RollPartBase & {
306
+ type: 'dieBound';
307
+ bound: 'min' | 'max';
308
+ value: number;
309
+ target: RollPart;
310
+ }) | (RollPartBase & {
311
+ type: 'successCount';
312
+ threshold: ResolvedComparePoint;
313
+ failThreshold?: ResolvedComparePoint;
314
+ target: RollPart;
315
+ successes: number;
316
+ failures: number;
317
+ }) | (RollPartBase & {
318
+ type: 'versus';
319
+ roll: RollPart;
320
+ dc: RollPart;
321
+ degree: DegreeOfSuccess;
322
+ }) | (RollPartBase & {
323
+ type: 'functionCall';
324
+ name: string;
325
+ args: RollPart[];
326
+ }) | (RollPartBase & {
327
+ type: 'group';
328
+ parts: RollPart[];
329
+ keptIndices?: number[];
330
+ }) | (RollPartBase & {
331
+ type: 'sort';
332
+ order: 'ascending' | 'descending';
333
+ /**
334
+ * Every die the target produced, in sorted order, sharing `DieResult`
335
+ * references with `target` — so flags set after the sort (`4d6s dl1`)
336
+ * show through both. Like `RollResult.rolls` it keeps `'meta'` dice,
337
+ * which `rendered` omits from the bracket.
338
+ */
339
+ rolls: DieResult[];
340
+ target: RollPart;
341
+ }) | (RollPartBase & {
342
+ type: 'critThreshold';
343
+ successThresholds: ResolvedCritThreshold[];
344
+ failThresholds: ResolvedCritThreshold[];
345
+ target: RollPart;
346
+ });
347
+ /**
348
+ * The 17 discriminant strings of {@link RollPart}. Convenience alias for
349
+ * consumers writing exhaustive switches or part-type lookup tables.
350
+ *
351
+ * @category Results
352
+ */
353
+ export type RollPartType = RollPart['type'];
354
+ /**
355
+ * Complete roll result with all metadata — what {@link roll} and
356
+ * {@link evaluate} return.
357
+ *
358
+ * The top level is `Readonly` — a result describes one completed evaluation
359
+ * and is never re-targeted. The `rolls` array and the `parts` tree stay
360
+ * mutable so consumers can annotate or re-sort their own views.
361
+ *
362
+ * Fully JSON-serializable; this is exactly what the CLI's `--json` flag emits.
363
+ *
364
+ * @example
365
+ * ```typescript
366
+ * import { roll } from 'roll-parser';
367
+ * import { createMockRng } from 'roll-parser/testing';
368
+ *
369
+ * const result = roll('3d6', { rng: createMockRng([4, 2, 6]) });
370
+ *
371
+ * JSON.stringify(result);
372
+ * // {
373
+ * // "total": 12,
374
+ * // "notation": "3d6",
375
+ * // "expression": "3d6",
376
+ * // "rendered": "3d6[4, 2, 6] = 12",
377
+ * // "rolls": [
378
+ * // { "sides": 6, "result": 4, "modifiers": ["kept"], "critical": false, "fumble": false },
379
+ * // { "sides": 6, "result": 2, "modifiers": ["kept"], "critical": false, "fumble": false },
380
+ * // { "sides": 6, "result": 6, "modifiers": ["kept"], "critical": true, "fumble": false }
381
+ * // ],
382
+ * // "parts": {
383
+ * // "type": "dice", "count": 3, "sides": 6,
384
+ * // "rolls": [ ...the same three objects... ],
385
+ * // "total": 12, "start": 0, "end": 3
386
+ * // }
387
+ * // }
388
+ * ```
389
+ *
390
+ * @category Results
57
391
  */
58
- export type RollResult = {
392
+ export type RollResult = Readonly<{
59
393
  /** Final computed total */
60
394
  total: number;
61
395
  /** Original input notation */
@@ -64,18 +398,28 @@ export type RollResult = {
64
398
  expression: string;
65
399
  /** Rendered result with individual rolls shown */
66
400
  rendered: string;
67
- /** All individual die results */
401
+ /**
402
+ * All individual die results, in evaluation order.
403
+ *
404
+ * Shares `DieResult` object references with the `rolls[]` arrays inside
405
+ * `parts` — no deep clone. Mutating a die here is visible through the part
406
+ * tree and vice versa; clone first if that matters.
407
+ */
68
408
  rolls: DieResult[];
409
+ /** Structured breakdown of the evaluated expression, mirroring the AST 1:1. */
410
+ parts: RollPart;
69
411
  /**
70
412
  * Number of dice tagged as success across the whole expression. Present
71
413
  * only when a success-counting modifier was used. Independent of `total` —
72
- * arithmetic on top of a success count (e.g. `5d6>=5 * 2`) affects `total`
73
- * but not `successes`.
414
+ * arithmetic on top of a success count (e.g. `{5d6>=5}+2`) affects `total`
415
+ * but not `successes`. Success counts are terminal, so the group braces are
416
+ * required: `5d6>=5 * 2` is an `INVALID_SUCCESS_COUNT_TARGET` parse error.
74
417
  */
75
418
  successes?: number;
76
419
  /**
77
420
  * Number of dice tagged as failure across the whole expression. Present
78
- * only when a success-counting modifier with a fail threshold was used.
421
+ * whenever a success-counting modifier was used `0` when no failure
422
+ * threshold was given, since nothing can be tagged as a failure.
79
423
  */
80
424
  failures?: number;
81
425
  /**
@@ -88,18 +432,77 @@ export type RollResult = {
88
432
  * exactly one kept d20 was rolled on the roll side of a `vs` expression.
89
433
  */
90
434
  natural?: number;
91
- };
435
+ }>;
92
436
  /**
93
- * Options for the evaluate function.
437
+ * Evaluation guardrails and variable resolution, shared by `EvaluateOptions`
438
+ * and `RollOptions`. Every field is optional — the defaults bound adversarial
439
+ * notation without capping any realistic expression.
440
+ *
441
+ * Tighten them when the notation comes from users you do not control; the
442
+ * caps are the difference between a typed `EvaluatorError` and a request that
443
+ * rolls ten million dice. Parse depth is capped separately and
444
+ * unconditionally by {@link MAX_PARSE_DEPTH}.
445
+ *
446
+ * The three numeric limits fail closed: omit one — or pass `undefined` or
447
+ * `null`, the no-options path a partial config produces — and it takes its
448
+ * default, but supply anything else that is not a safe integer in range — a
449
+ * string, `NaN`, `±Infinity`, a negative, a fraction — and evaluation throws
450
+ * `INVALID_EVALUATION_LIMIT` before rolling. `maxDice` accepts `>= 1`, the two
451
+ * iteration limits `>= 0`. No coercion: `maxDice: Number(input)` on
452
+ * unparseable input rejects rather than quietly reverting to the permissive
453
+ * default.
454
+ *
455
+ * @example Untrusted input
456
+ * ```typescript
457
+ * import { isRollParserError, roll } from 'roll-parser';
458
+ *
459
+ * const limits = {
460
+ * maxDice: 100,
461
+ * maxExplodeIterations: 20,
462
+ * maxRerollIterations: 20,
463
+ * };
464
+ *
465
+ * try {
466
+ * roll('99999d6', limits).total;
467
+ * } catch (error) {
468
+ * isRollParserError(error) && error.code; // 'DICE_LIMIT_EXCEEDED'
469
+ * }
470
+ * ```
471
+ *
472
+ * @example Variables
473
+ * ```typescript
474
+ * import { roll } from 'roll-parser';
475
+ *
476
+ * roll('1d20+@str', { context: { str: 4 }, seed: 'demo' }).total; // 5
477
+ * roll('1d20+@str', { onMissingVariable: 'zero', seed: 'demo' }).total; // 1
478
+ * ```
479
+ *
480
+ * @category Core
94
481
  */
95
- export type EvaluateOptions = {
96
- /** Original notation string (for result metadata) */
97
- notation?: string;
98
- /** Maximum total dice allowed per evaluation (default: 10,000) */
482
+ export type EvaluationOptions = {
483
+ /** Maximum total dice allowed per evaluation; integer >= 1 (default: 10,000) */
99
484
  maxDice?: number;
100
- /** Maximum explosion iterations allowed per die (default: 1,000) */
485
+ /** Maximum explosion iterations allowed per die; integer >= 0 (default: 1,000) */
101
486
  maxExplodeIterations?: number;
102
- /** Maximum reroll iterations allowed per die (default: 1,000) */
487
+ /** Maximum reroll iterations allowed per die; integer >= 0 (default: 1,000) */
103
488
  maxRerollIterations?: number;
489
+ /** Variable context for `@name` / `@{name}` references (default: empty) */
490
+ context?: Readonly<Record<string, number>>;
491
+ /** Behavior when a referenced variable is missing from context (default: 'throw') */
492
+ onMissingVariable?: 'throw' | 'zero';
493
+ };
494
+ /**
495
+ * Options for {@link evaluate}: the shared {@link EvaluationOptions} plus the
496
+ * original notation, which `evaluate` cannot recover from an AST.
497
+ *
498
+ * @category Core
499
+ */
500
+ export type EvaluateOptions = EvaluationOptions & {
501
+ /**
502
+ * Original notation string, echoed back as `RollResult.notation`. When
503
+ * omitted, falls back to the normalized `expression` reconstructed from the
504
+ * AST — {@link roll} always forwards the string the caller typed.
505
+ */
506
+ notation?: string;
104
507
  };
105
508
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,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;;;OAMG;IACH,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,+EAA+E;IAC/E,KAAK,EAAE,QAAQ,CAAC;IAChB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kFAAkF;IAClF,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,+EAA+E;IAC/E,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,2EAA2E;IAC3E,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3C,qFAAqF;IACrF,iBAAiB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CACtC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,iBAAiB,GAAG;IAChD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC"}
package/dist/types.js ADDED
@@ -0,0 +1,8 @@
1
+ export var DegreeOfSuccess;
2
+ (function (DegreeOfSuccess) {
3
+ DegreeOfSuccess[DegreeOfSuccess["CriticalFailure"] = 0] = "CriticalFailure";
4
+ DegreeOfSuccess[DegreeOfSuccess["Failure"] = 1] = "Failure";
5
+ DegreeOfSuccess[DegreeOfSuccess["Success"] = 2] = "Success";
6
+ DegreeOfSuccess[DegreeOfSuccess["CriticalSuccess"] = 3] = "CriticalSuccess";
7
+ })(DegreeOfSuccess || (DegreeOfSuccess = {}));
8
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AA0HA,MAAM,CAAN,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,2EAAmB,CAAA;IACnB,2DAAW,CAAA;IACX,2DAAW,CAAA;IACX,2EAAmB,CAAA;AACrB,CAAC,EALW,eAAe,KAAf,eAAe,QAK1B"}
@@ -0,0 +1,2 @@
1
+ export declare const version = "3.0.0";
2
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ export const version = '3.0.0';
2
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC"}