holonovel 2026.8.22

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.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Holonovel
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import("../dist/index.js").catch((e) => {
3
+ console.error("holonovel failed to start:", e);
4
+ process.exit(1);
5
+ });
@@ -0,0 +1,116 @@
1
+ export interface SpeciesData {
2
+ name: string;
3
+ size?: string;
4
+ speed?: number;
5
+ abilityAdjustments?: Record<string, number>;
6
+ bonusFeat?: boolean;
7
+ bonusTrainedSkill?: boolean;
8
+ traits?: string[];
9
+ [key: string]: any;
10
+ }
11
+ export interface ClassData {
12
+ name: string;
13
+ hitDie?: number;
14
+ startingHp?: number;
15
+ bab?: number;
16
+ babType?: "good" | "poor";
17
+ defenseBonuses?: Record<string, number>;
18
+ classSkills?: string[];
19
+ bonusTalents?: string[];
20
+ startingFeats?: string[];
21
+ prerequisites?: string;
22
+ [key: string]: any;
23
+ }
24
+ export interface EquipmentItem {
25
+ name: string;
26
+ quantity?: number;
27
+ source?: string;
28
+ }
29
+ export interface DerivedStatDef {
30
+ key: string;
31
+ label: string;
32
+ section?: string;
33
+ formula: string;
34
+ }
35
+ export interface StatMethodDef {
36
+ dice?: string;
37
+ drop_lowest?: number;
38
+ point_buy?: Record<number, number>;
39
+ budget?: number;
40
+ array?: number[];
41
+ }
42
+ export interface CharacterRules {
43
+ steps?: string[];
44
+ ability_names?: string[];
45
+ ability_modifier_formula?: string;
46
+ stat_methods?: Record<string, StatMethodDef>;
47
+ default_ability_scores?: number[];
48
+ species?: Record<string, SpeciesData>;
49
+ classes?: Record<string, ClassData>;
50
+ prestige_classes?: Record<string, ClassData>;
51
+ starting_equipment?: Record<string, (string | EquipmentItem)[]>;
52
+ derived_stats?: DerivedStatDef[];
53
+ }
54
+ export type StatMethod = string;
55
+ export declare const ABILITY_NAMES: readonly ["Strength", "Dexterity", "Constitution", "Intelligence", "Wisdom", "Charisma"];
56
+ export type AbilityName = (typeof ABILITY_NAMES)[number];
57
+ export declare function abilityNames(rules?: CharacterRules): string[];
58
+ export declare function abilityModifier(score: number, rules?: CharacterRules): number;
59
+ export interface ClassLevel {
60
+ className: string;
61
+ levels: number;
62
+ }
63
+ export interface CharacterBuildInput {
64
+ name: string;
65
+ species: string;
66
+ classLevels: ClassLevel[];
67
+ abilityScores: Record<string, number>;
68
+ trainedSkills?: string[];
69
+ feats?: string[];
70
+ talents?: string[];
71
+ statMethod?: StatMethod;
72
+ seed?: string;
73
+ equipment?: string[];
74
+ }
75
+ export interface EvalContext {
76
+ level?: number;
77
+ bab?: number;
78
+ score?: number;
79
+ ability?: Record<string, number>;
80
+ ability_mod?: Record<string, number>;
81
+ class_bonus?: Record<string, number>;
82
+ species?: Record<string, any>;
83
+ }
84
+ export declare function evaluateFormula(expr: string, ctx?: EvalContext): number;
85
+ export declare function generateAbilityScores(method: StatMethod, rules?: CharacterRules, seed?: string): number[];
86
+ export declare function getSpecies(rules: CharacterRules, name: string): SpeciesData | undefined;
87
+ export declare function getClassData(rules: CharacterRules, name: string): ClassData | undefined;
88
+ export declare function applySpeciesAdjustments(raw: Record<string, number>, speciesName: string, rules?: CharacterRules): Record<string, number>;
89
+ export interface DerivedResult {
90
+ values: Record<string, number>;
91
+ labels: Record<string, string>;
92
+ sections: Record<string, string>;
93
+ order: string[];
94
+ }
95
+ export declare function computeDerived(build: CharacterBuildInput, rules: CharacterRules): DerivedResult;
96
+ export declare function startingEquipmentFor(classLevels: ClassLevel[], rules?: CharacterRules): EquipmentItem[];
97
+ export declare const CREATION_STEPS: readonly ["name", "species", "classes", "ability_scores", "skills", "equipment"];
98
+ export type CreationStep = (typeof CREATION_STEPS)[number];
99
+ export declare function creationSteps(rules?: CharacterRules): string[];
100
+ export interface CreationWorkflowState {
101
+ kind: "character_creation";
102
+ stepIndex: number;
103
+ rules: CharacterRules | null;
104
+ answers: Partial<{
105
+ name: string;
106
+ species: string;
107
+ classLevels: ClassLevel[];
108
+ statMethod: StatMethod;
109
+ abilityScores: Record<string, number>;
110
+ trainedSkills: string[];
111
+ feats: string[];
112
+ talents: string[];
113
+ equipment: string[];
114
+ }>;
115
+ }
116
+ export declare function creationStepPrompt(state: CreationWorkflowState): string;
@@ -0,0 +1,346 @@
1
+ // Ruleset-driven character creation (REQ-104, REQ-151, REQ-152, REQ-181,
2
+ // REQ-219, REQ-399).
3
+ //
4
+ // The host does not hard-code a ruleset's character rules. Character-creation
5
+ // data lives in the bound ruleset's package model under the reserved
6
+ // `character_creation` key (REQ-399a). Derived statistics are computed by a
7
+ // safe expression evaluator over ruleset-declared formulas (REQ-399b). When no
8
+ // ruleset is bound, or the bound package carries no character-creation data,
9
+ // creation degrades to a profile-only contract (REQ-219, REQ-399c).
10
+ import { createRng, rollWithRng } from "./rng.js";
11
+ // Neutral fallback used only when a ruleset does not declare ability names.
12
+ export const ABILITY_NAMES = ["Strength", "Dexterity", "Constitution", "Intelligence", "Wisdom", "Charisma"];
13
+ export function abilityNames(rules) {
14
+ return rules?.ability_names?.length ? rules.ability_names : [...ABILITY_NAMES];
15
+ }
16
+ export function abilityModifier(score, rules) {
17
+ const expr = rules?.ability_modifier_formula ?? "floor((score - 10) / 2)";
18
+ return evaluateFormula(expr, { score });
19
+ }
20
+ export function evaluateFormula(expr, ctx = {}) {
21
+ const s = String(expr).trim();
22
+ if (!s)
23
+ throw new Error("Empty formula.");
24
+ const parser = new FormulaParser(s, ctx);
25
+ const value = parser.parseExpression();
26
+ parser.skipWhitespace();
27
+ if (!parser.atEnd())
28
+ throw new Error(`Unexpected token '${parser.peek()}' in formula.`);
29
+ return value;
30
+ }
31
+ class FormulaParser {
32
+ src;
33
+ ctx;
34
+ pos = 0;
35
+ constructor(src, ctx) {
36
+ this.src = src;
37
+ this.ctx = ctx;
38
+ }
39
+ atEnd() { return this.pos >= this.src.length; }
40
+ peek() { return this.src[this.pos] ?? ""; }
41
+ skipWhitespace() { while (this.pos < this.src.length && /\s/.test(this.src[this.pos]))
42
+ this.pos++; }
43
+ parseExpression() {
44
+ let value = this.parseTerm();
45
+ while (true) {
46
+ this.skipWhitespace();
47
+ const ch = this.peek();
48
+ if (ch === "+") {
49
+ this.pos++;
50
+ value += this.parseTerm();
51
+ }
52
+ else if (ch === "-") {
53
+ this.pos++;
54
+ value -= this.parseTerm();
55
+ }
56
+ else
57
+ break;
58
+ }
59
+ return value;
60
+ }
61
+ parseTerm() {
62
+ let value = this.parseFactor();
63
+ while (true) {
64
+ this.skipWhitespace();
65
+ const ch = this.peek();
66
+ if (ch === "*") {
67
+ this.pos++;
68
+ value *= this.parseFactor();
69
+ }
70
+ else if (ch === "/") {
71
+ this.pos++;
72
+ value /= this.parseFactor();
73
+ }
74
+ else
75
+ break;
76
+ }
77
+ return value;
78
+ }
79
+ parseFactor() {
80
+ this.skipWhitespace();
81
+ const ch = this.peek();
82
+ if (ch === "(") {
83
+ this.pos++;
84
+ const v = this.parseExpression();
85
+ this.skipWhitespace();
86
+ if (this.peek() !== ")")
87
+ throw new Error("Unbalanced parentheses in formula.");
88
+ this.pos++;
89
+ return v;
90
+ }
91
+ if (ch === "-") {
92
+ this.pos++;
93
+ return -this.parseFactor();
94
+ }
95
+ if (ch === "+") {
96
+ this.pos++;
97
+ return this.parseFactor();
98
+ }
99
+ if (/[0-9.]/.test(ch))
100
+ return this.parseNumber();
101
+ if (/[a-zA-Z_]/.test(ch))
102
+ return this.parseIdentifierOrCall();
103
+ throw new Error(`Unexpected character '${ch}' in formula.`);
104
+ }
105
+ parseNumber() {
106
+ this.skipWhitespace();
107
+ const m = /^[0-9]*\.?[0-9]+/.exec(this.src.slice(this.pos));
108
+ if (!m)
109
+ throw new Error("Invalid number in formula.");
110
+ this.pos += m[0].length;
111
+ return parseFloat(m[0]);
112
+ }
113
+ parseIdentifierOrCall() {
114
+ let ident = this.parseIdent();
115
+ // Dotted identifier: a.b.c
116
+ while (this.peek() === ".") {
117
+ this.pos++;
118
+ ident += "." + this.parseIdent();
119
+ }
120
+ this.skipWhitespace();
121
+ if (this.peek() === "(") {
122
+ return this.parseCall(ident);
123
+ }
124
+ return this.resolveVar(ident);
125
+ }
126
+ parseCall(name) {
127
+ this.pos++; // consume '('
128
+ const args = [];
129
+ while (true) {
130
+ this.skipWhitespace();
131
+ if (this.peek() === ")") {
132
+ this.pos++;
133
+ break;
134
+ }
135
+ args.push(this.parseExpression());
136
+ this.skipWhitespace();
137
+ if (this.peek() === ",") {
138
+ this.pos++;
139
+ continue;
140
+ }
141
+ if (this.peek() === ")") {
142
+ this.pos++;
143
+ break;
144
+ }
145
+ throw new Error("Expected ',' or ')' in function call.");
146
+ }
147
+ switch (name.toLowerCase()) {
148
+ case "floor": return Math.floor(args[0]);
149
+ case "ceil": return Math.ceil(args[0]);
150
+ case "min": return Math.min(...args);
151
+ case "max": return Math.max(...args);
152
+ default: throw new Error(`Unknown function '${name}' in formula.`);
153
+ }
154
+ }
155
+ parseIdent() {
156
+ const m = /^[a-zA-Z_][a-zA-Z0-9_]*/.exec(this.src.slice(this.pos));
157
+ if (!m)
158
+ throw new Error("Invalid identifier in formula.");
159
+ this.pos += m[0].length;
160
+ return m[0];
161
+ }
162
+ resolveVar(ident) {
163
+ const L = ident.toLowerCase();
164
+ if (L === "level") {
165
+ if (this.ctx.level == null)
166
+ throw new Error("Formula references undefined 'level'.");
167
+ return this.ctx.level;
168
+ }
169
+ if (L === "bab") {
170
+ if (this.ctx.bab == null)
171
+ throw new Error("Formula references undefined 'bab'.");
172
+ return this.ctx.bab;
173
+ }
174
+ if (L === "score") {
175
+ if (this.ctx.score == null)
176
+ throw new Error("Formula references undefined 'score'.");
177
+ return this.ctx.score;
178
+ }
179
+ // dotted refs: a.b
180
+ const dot = ident.search(/[.]/);
181
+ if (dot === -1)
182
+ throw new Error(`Formula references undefined input '${ident}'.`);
183
+ const ns = ident.slice(0, dot).toLowerCase();
184
+ const key = ident.slice(dot + 1).toLowerCase();
185
+ const lookup = (band) => {
186
+ if (!band)
187
+ throw new Error(`Formula references undefined input '${ident}'.`);
188
+ const v = band[key] ?? band[ident.slice(dot + 1)];
189
+ if (v == null)
190
+ throw new Error(`Formula references undefined input '${ident}'.`);
191
+ return Number(v);
192
+ };
193
+ if (ns === "ability")
194
+ return lookup(this.ctx.ability);
195
+ if (ns === "ability_mod")
196
+ return lookup(this.ctx.ability_mod);
197
+ if (ns === "class_bonus")
198
+ return lookup(this.ctx.class_bonus);
199
+ if (ns === "species")
200
+ return lookup(this.ctx.species);
201
+ throw new Error(`Formula references undefined input '${ident}'.`);
202
+ }
203
+ }
204
+ // ── Generation helpers ──────────────────────────────────────────────────
205
+ export function generateAbilityScores(method, rules, seed) {
206
+ const names = abilityNames(rules);
207
+ const def = rules?.stat_methods?.[method];
208
+ if (method === "roll_4d6" || (def?.dice && method !== "standard" && method !== "planned")) {
209
+ const m = (def?.dice ?? "4d6").match(/^(\d+)d(\d+)$/i);
210
+ const count = m ? parseInt(m[1], 10) : 4;
211
+ const sides = m ? parseInt(m[2], 10) : 6;
212
+ const drop = def?.drop_lowest ?? 1;
213
+ const rng = createRng(seed ?? "0");
214
+ const scores = [];
215
+ for (let i = 0; i < names.length; i++) {
216
+ scores.push(rollWithRng(rng, count, sides, drop).total);
217
+ }
218
+ return scores;
219
+ }
220
+ if (method === "standard" || (def?.array && !def?.dice)) {
221
+ return [...(def?.array ?? rules?.default_ability_scores ?? [15, 14, 13, 12, 10, 8])];
222
+ }
223
+ // planned point-buy: neutral baseline (REQ-104b; documented heuristic).
224
+ return [...(rules?.default_ability_scores ?? [15, 14, 13, 12, 10, 8])];
225
+ }
226
+ export function getSpecies(rules, name) {
227
+ const s = rules.species;
228
+ if (!s)
229
+ return undefined;
230
+ return s[name.trim().toLowerCase()];
231
+ }
232
+ export function getClassData(rules, name) {
233
+ const key = name.trim().toLowerCase();
234
+ if (rules.classes?.[key])
235
+ return rules.classes[key];
236
+ if (rules.prestige_classes?.[key])
237
+ return rules.prestige_classes[key];
238
+ return undefined;
239
+ }
240
+ export function applySpeciesAdjustments(raw, speciesName, rules) {
241
+ const species = rules ? getSpecies(rules, speciesName) : undefined;
242
+ if (!species)
243
+ return { ...raw };
244
+ const out = { ...raw };
245
+ for (const [ability, adj] of Object.entries(species.abilityAdjustments || {})) {
246
+ // Case-insensitive ability-name match so ruleset data (which may use any
247
+ // capitalization) aligns with the canonical ability names.
248
+ const target = Object.keys(out).find((k) => k.toLowerCase() === ability.toLowerCase()) ?? ability;
249
+ out[target] = (out[target] ?? 10) + adj;
250
+ }
251
+ return out;
252
+ }
253
+ export function computeDerived(build, rules) {
254
+ const names = abilityNames(rules);
255
+ const raw = build.abilityScores;
256
+ const systemSpecies = getSpecies(rules, build.species) ?? { name: build.species, size: "Medium", speed: 6 };
257
+ let level = 0;
258
+ let bab = 0;
259
+ const classBonus = {};
260
+ const granted = new Set();
261
+ for (const cl of build.classLevels) {
262
+ const key = cl.className.trim().toLowerCase();
263
+ const cd = getClassData(rules, key);
264
+ if (!cd)
265
+ continue;
266
+ bab += cd.babType === "good" ? cl.levels * (cd.bab ?? 1) : (cd.babType === "poor" ? Math.floor(cl.levels / 2) : cl.levels * (cd.bab ?? 1));
267
+ level += cl.levels;
268
+ if (!granted.has(key)) {
269
+ for (const [dk, dv] of Object.entries(cd.defenseBonuses || {})) {
270
+ classBonus[dk] = (classBonus[dk] ?? 0) + dv;
271
+ }
272
+ granted.add(key);
273
+ }
274
+ }
275
+ // Build the evaluation context.
276
+ const ability = {};
277
+ const ability_mod = {};
278
+ for (const n of names) {
279
+ const lower = n.toLowerCase();
280
+ ability[lower] = raw[lower] ?? raw[n] ?? 10;
281
+ ability_mod[lower] = abilityModifier(ability[lower], rules);
282
+ }
283
+ const speciesCtx = {};
284
+ Object.assign(speciesCtx, systemSpecies);
285
+ const ctx = { level, bab, ability, ability_mod, class_bonus: classBonus, species: speciesCtx };
286
+ const values = {};
287
+ const labels = {};
288
+ const sections = {};
289
+ const order = [];
290
+ for (const def of rules.derived_stats || []) {
291
+ const value = evaluateFormula(def.formula, ctx);
292
+ values[def.key] = value;
293
+ labels[def.key] = def.label ?? def.key;
294
+ sections[def.key] = def.section ?? "derived";
295
+ order.push(def.key);
296
+ }
297
+ // Level is a primitive available to every derived-stat formula.
298
+ values["level"] = level;
299
+ return { values, labels, sections, order };
300
+ }
301
+ export function startingEquipmentFor(classLevels, rules) {
302
+ const out = [];
303
+ const seen = new Set();
304
+ for (const cl of classLevels) {
305
+ const key = cl.className.trim().toLowerCase();
306
+ const list = (rules?.starting_equipment ?? {})[key];
307
+ if (!list)
308
+ continue;
309
+ for (const item of list) {
310
+ const entry = typeof item === "string" ? { name: item, quantity: 1 } : { name: item.name, quantity: item.quantity ?? 1, source: item.source };
311
+ if (seen.has(entry.name))
312
+ continue;
313
+ seen.add(entry.name);
314
+ out.push(entry);
315
+ }
316
+ }
317
+ return out;
318
+ }
319
+ // ── Creation workflow (REQ-151) ─────────────────────────────────────────
320
+ export const CREATION_STEPS = ["name", "species", "classes", "ability_scores", "skills", "equipment"];
321
+ export function creationSteps(rules) {
322
+ return rules?.steps?.length ? rules.steps : [...CREATION_STEPS];
323
+ }
324
+ export function creationStepPrompt(state) {
325
+ const steps = creationSteps(state.rules ?? undefined);
326
+ const step = steps[state.stepIndex] ?? "name";
327
+ const names = abilityNames(state.rules ?? undefined);
328
+ const speciesOptions = state.rules?.species
329
+ ? Object.values(state.rules.species).map((s) => s.name).join(", ")
330
+ : "any";
331
+ const classOptions = state.rules?.classes
332
+ ? Object.values(state.rules.classes).map((c) => c.name).join(", ")
333
+ : "the ruleset's classes";
334
+ const idx = state.stepIndex + 1;
335
+ const total = steps.length;
336
+ switch (step) {
337
+ case "name": return `Character creation (${idx}/${total}): enter the character's name.`;
338
+ case "species": return `Character creation (${idx}/${total}): choose a species. Options: ${speciesOptions}.`;
339
+ case "classes": return `Character creation (${idx}/${total}): choose class levels, e.g. '${classOptions.split(",")[0] ?? "Class"} 1'. Classes: ${classOptions}.`;
340
+ case "ability_scores": return `Character creation (${idx}/${total}): provide ability scores (${names.join(", ")}), e.g. '${names.length ? names.map(() => 10).join(" ") : ""}'. Species adjustments are applied automatically.`;
341
+ case "skills": return `Character creation (${idx}/${total}): list trained skills, e.g. 'Perception, Persuasion'.`;
342
+ case "equipment": return `Character creation (${idx}/${total}): list starting equipment (or leave blank for class defaults).`;
343
+ default: return `Character creation (${idx}/${total}): enter ${step}.`;
344
+ }
345
+ }
346
+ //# sourceMappingURL=character-creation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"character-creation.js","sourceRoot":"","sources":["../../src/core/character-creation.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,qBAAqB;AACrB,EAAE;AACF,8EAA8E;AAC9E,qEAAqE;AACrE,4EAA4E;AAC5E,+EAA+E;AAC/E,6EAA6E;AAC7E,oEAAoE;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IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAClE,CAAC,CAAC,uBAAuB,CAAC;IAC5B,MAAM,GAAG,GAAG,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC;IAChC,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC;IAC3B,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,MAAM,EAAE,OAAO,uBAAuB,GAAG,IAAI,KAAK,gCAAgC,CAAC;QACxF,KAAK,SAAS,EAAE,OAAO,uBAAuB,GAAG,IAAI,KAAK,iCAAiC,cAAc,GAAG,CAAC;QAC7G,KAAK,SAAS,EAAE,OAAO,uBAAuB,GAAG,IAAI,KAAK,iCAAiC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,OAAO,iBAAiB,YAAY,GAAG,CAAC;QACjK,KAAK,gBAAgB,EAAE,OAAO,uBAAuB,GAAG,IAAI,KAAK,8BAA8B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,mDAAmD,CAAC;QAChO,KAAK,QAAQ,EAAE,OAAO,uBAAuB,GAAG,IAAI,KAAK,wDAAwD,CAAC;QAClH,KAAK,WAAW,EAAE,OAAO,uBAAuB,GAAG,IAAI,KAAK,iEAAiE,CAAC;QAC9H,SAAS,OAAO,uBAAuB,GAAG,IAAI,KAAK,YAAY,IAAI,GAAG,CAAC;IACzE,CAAC;AACH,CAAC"}
@@ -0,0 +1,45 @@
1
+ export interface EnrichmentItem {
2
+ content: string;
3
+ source_url: string;
4
+ confidence: "HIGH" | "MEDIUM" | "LOW";
5
+ tag?: string;
6
+ badge_scope: "player" | "game_master" | "shared";
7
+ category?: string;
8
+ }
9
+ export interface ActionPattern {
10
+ intent: string;
11
+ expected_categories: string[];
12
+ ruleset_section: string;
13
+ source_url?: string;
14
+ }
15
+ export interface NarrativeVoice {
16
+ name: string;
17
+ source: string;
18
+ media_title: string;
19
+ media_type: "film" | "novel" | "game" | "other";
20
+ description: string;
21
+ confidence: "HIGH" | "MEDIUM" | "LOW";
22
+ tag?: string;
23
+ badge_scope: "player" | "game_master" | "shared";
24
+ }
25
+ export interface EnrichmentManifest {
26
+ collected_at: string;
27
+ spec_version: string;
28
+ voice_examples: EnrichmentItem[];
29
+ briefing_order: {
30
+ sections: string[];
31
+ reason: string;
32
+ source_url: string;
33
+ confidence: string;
34
+ };
35
+ lore_templates: EnrichmentItem[];
36
+ action_patterns: ActionPattern[];
37
+ supplementary_guidance: EnrichmentItem[];
38
+ adventure_advice: {
39
+ templates: EnrichmentItem[];
40
+ scenario_starters: EnrichmentItem[];
41
+ table_expansions: EnrichmentItem[];
42
+ };
43
+ narrative_voices: NarrativeVoice[];
44
+ }
45
+ export declare const DEFAULT_ENRICHMENT: EnrichmentManifest;