@orkestrel/scaffold 0.0.115 → 0.0.117

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 (70) hide show
  1. package/dist/bin/main.js +138 -16
  2. package/dist/bin/main.js.map +1 -1
  3. package/dist/host/agents/skills/orkestrel-publish/references/wave.md +1 -1
  4. package/dist/host/claude/agents/orkestrel.md +2 -2
  5. package/dist/host/claude/rules/names.md +3 -1
  6. package/dist/host/guides/abort.md +17 -17
  7. package/dist/host/guides/agent.md +445 -445
  8. package/dist/host/guides/brief.md +143 -143
  9. package/dist/host/guides/browser.md +731 -731
  10. package/dist/host/guides/budget.md +39 -39
  11. package/dist/host/guides/capture.md +298 -298
  12. package/dist/host/guides/console.md +109 -109
  13. package/dist/host/guides/contract.md +335 -335
  14. package/dist/host/guides/csv.md +30 -30
  15. package/dist/host/guides/database.md +163 -163
  16. package/dist/host/guides/emitter.md +17 -17
  17. package/dist/host/guides/form.md +99 -99
  18. package/dist/host/guides/guide.md +368 -183
  19. package/dist/host/guides/html.md +49 -49
  20. package/dist/host/guides/indexeddb.md +40 -40
  21. package/dist/host/guides/interpret.md +139 -139
  22. package/dist/host/guides/lsp.md +114 -114
  23. package/dist/host/guides/markdown.md +68 -68
  24. package/dist/host/guides/mcp.md +3745 -3745
  25. package/dist/host/guides/middleware.md +170 -170
  26. package/dist/host/guides/msg.md +95 -95
  27. package/dist/host/guides/ndjson.md +8 -8
  28. package/dist/host/guides/ollama.md +56 -56
  29. package/dist/host/guides/pool.md +21 -21
  30. package/dist/host/guides/probe.md +82 -82
  31. package/dist/host/guides/process.md +99 -99
  32. package/dist/host/guides/program.md +98 -96
  33. package/dist/host/guides/qualifier.md +70 -70
  34. package/dist/host/guides/queue.md +37 -37
  35. package/dist/host/guides/rater.md +38 -38
  36. package/dist/host/guides/reason.md +308 -308
  37. package/dist/host/guides/relation.md +50 -50
  38. package/dist/host/guides/router.md +58 -58
  39. package/dist/host/guides/scaffold.md +558 -419
  40. package/dist/host/guides/sea.md +128 -128
  41. package/dist/host/guides/server.md +100 -100
  42. package/dist/host/guides/sqlite.md +28 -28
  43. package/dist/host/guides/sse.md +20 -20
  44. package/dist/host/guides/study.md +444 -444
  45. package/dist/host/guides/table.md +82 -82
  46. package/dist/host/guides/template.md +41 -41
  47. package/dist/host/guides/terminal.md +121 -121
  48. package/dist/host/guides/test.md +273 -273
  49. package/dist/host/guides/timeout.md +18 -18
  50. package/dist/host/guides/tool.md +27 -27
  51. package/dist/host/guides/toolbox.md +166 -166
  52. package/dist/host/guides/websocket.md +54 -54
  53. package/dist/host/guides/worker.md +24 -24
  54. package/dist/host/guides/workflow.md +187 -187
  55. package/dist/host/guides/workspace.md +55 -55
  56. package/dist/host/manifest.json +55 -55
  57. package/dist/host/tests/setupPolicy.ts +5 -3
  58. package/dist/src/core/index.cjs +90 -4
  59. package/dist/src/core/index.cjs.map +1 -1
  60. package/dist/src/core/index.d.cts +229 -144
  61. package/dist/src/core/index.d.ts +229 -144
  62. package/dist/src/core/index.js +88 -5
  63. package/dist/src/core/index.js.map +1 -1
  64. package/dist/src/server/index.cjs +295 -66
  65. package/dist/src/server/index.cjs.map +1 -1
  66. package/dist/src/server/index.d.cts +193 -6
  67. package/dist/src/server/index.d.ts +193 -6
  68. package/dist/src/server/index.js +290 -69
  69. package/dist/src/server/index.js.map +1 -1
  70. package/package.json +5 -4
@@ -73,86 +73,86 @@ throwing, and never an arbitrary fallback template. An interpretation is complet
73
73
 
74
74
  A `Shape` cell holds an interface's data members as bare names in braces, `?` marking an optional member and `plus` introducing its call-signature members, and a type alias's own type literal with a union's arms escaped as `\|`.
75
75
 
76
- | Type | Kind | Shape | Summary |
77
- | ---------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
78
- | `ProvenanceCategory` | type | `'extracted' \| 'carried' \| 'default' \| 'computed' \| 'subject'` | Names how one `FieldMapping` or `Entity` value was obtained. |
79
- | `InterpretStage` | type | `'normalize' \| 'extract' \| 'clarify' \| 'format' \| 'generate'` | Names the fixed pipeline phases an `InterpretInterface#interpret` run produces one `StageRecord` for, in order. |
80
- | `InterpretErrorCode` | type | `'NORMALIZE_FAILED' \| 'EXTRACT_FAILED' \| 'CLARIFY_FAILED' \| 'FORMAT_FAILED' \| 'GENERATE_FAILED' \| 'NO_TEMPLATE' \| 'LOW_CONFIDENCE' \| 'DESTROYED'` | Names the coded misuse or failure conditions thrown as an `InterpretError` or carried on a `StageFailure`. |
81
- | `EntityMapping` | interface | `{ entity, aliases, field, required? }` | Represents one entity-extraction rule inside a `Template`: which literal alias phrases identify a value, and which subject field it lands on. |
82
- | `FieldDefault` | interface | `{ field, value }` | Represents a fallback value a `Template` fills onto a field left unresolved by extraction. |
83
- | `ComputedField` | interface | `{ field, expression }` | Represents a declaratively computed field: evaluate `expression` against the entities already resolved for this interpretation, and land the result on `field`. |
84
- | `Template` | interface | `{ id, name, domain, intents, mappings, defaults, computations, definition }` | Represents a named, versionable interpretation template: which intents it answers, how to mine entities for it, its fallback data, its computed fields, and the reasons `Definition` it ultimately produces a `Subject` for. |
85
- | `Provenance` | interface | `{ category, detail? }` | Describes how one value landed — its origin category plus an optional strategy detail. |
86
- | `Intent` | interface | `{ action?, domain?, confidence }` | Represents the classified action + domain for one interpretation, with a combined confidence. |
87
- | `Entity` | interface | `{ name, value, provenance, confidence }` | Represents one value assigned to a template's entity mapping, with its provenance and confidence. |
88
- | `Ambiguity` | interface | `{ field, question, candidates, required }` | Represents an unresolved field surfaced as a human-readable question, never bare prose. |
89
- | `FieldMapping` | interface | `{ field, entity?, value, provenance, confidence }` | Represents one audited field of the built subject — its resolved value, provenance, and confidence. |
90
- | `TextChange` | interface | `{ from, to }` | Represents one normalization substitution applied to the raw text. |
91
- | `StageRecord` | interface | `{ stage, input, output, failed, error? }` | Represents a structured input/output snapshot of one pipeline phase. |
92
- | `StageFailure` | interface | `{ stage, code, message }` | Represents a visible marker for a stage that threw, carrying its coded reason. |
93
- | `NormalizeResult` | interface | `{ text, changes }` | Represents the `Normalizer` stage's output: the cleaned text plus every substitution applied. |
94
- | `ExtractResult` | interface | `{ intent, numbers }` | Represents the `Extractor` stage's output: intent classification plus raw numbers. |
95
- | `ClarifyResult` | interface | `{ entities, ambiguities }` | Represents the `Clarifier` stage's output: resolved entities plus any remaining ambiguities. |
96
- | `FormatResult` | interface | `{ prompt }` | Represents the `Formatter` stage's output: the refined natural-language prompt. |
97
- | `GenerateResult` | interface | `{ subject, definition, mappings, confidence }` | Represents the `Generator` stage's output: the built subject/definition pair plus its full field audit. |
98
- | `Interpretation` | interface | `{ text, normalized, intent, entities, subject?, definition?, mappings, ambiguities, prompt, stages, failures, confidence, digest }` | Represents the full, replayable outcome of one `interpret()` call. |
99
- | `TemplateRecord` | interface | `{ id, template, version, hash }` | Represents a versioned, content-hashed `Template` as held by a `TemplateManagerInterface`. |
100
- | `SubjectRecord` | interface | `{ id, subject, version, hash }` | Represents a versioned, content-hashed `Subject` as held by a `SubjectManagerInterface`. |
101
- | `DefinitionRecord` | interface | `{ id, definition, version, hash }` | Represents a versioned, content-hashed `Definition` as held by a `DefinitionManagerInterface`. |
102
- | `InterpretEventMap` | type | `{ interpret, add, error, destroy }` | Represents the push observation surface of an `InterpretInterface`. |
103
- | `RecordEventMap` | type | `{ add, remove, destroy }` | Represents the push observation surface shared by every record registry — an id-keyed collection, so `add` and `remove` are the events (never ordered-list `append`/`prepend`). |
104
- | `TemplateManagerEventMap` | type | `RecordEventMap` | Represents the push observation surface of a `TemplateManagerInterface`. |
105
- | `SubjectManagerEventMap` | type | `RecordEventMap` | Represents the push observation surface of a `SubjectManagerInterface`, whose `add` carries the own-minted record id. |
106
- | `DefinitionManagerEventMap` | type | `RecordEventMap` | Represents the push observation surface of a `DefinitionManagerInterface`. |
107
- | `InterpretContextEventMap` | type | `{ add, clear, destroy }` | Represents the push observation surface of an `InterpretContextInterface`. |
108
- | `NarratorFormatter` | type | `(value: unknown) => string` | Represents a pure formatting function for one lexicon `value()` unit. |
109
- | `Lexicon` | interface | `{ phrases?, labels?, templates? }` | Represents caller-injected wording data for the reverse direction — mechanism, never policy. Every phrase, label, and template string a `Narrator` renders is data supplied here, never a core literal. |
110
- | `NarratorOptions` | interface | `{ lexicon?, formatters? }` | Represents the options for `createNarrator` and the `Narrator` constructor. |
111
- | `NormalizerOptions` | interface | `{ contractions?, abbreviations?, corrections? }` | Represents the options for `createNormalizer` and the `Normalizer` constructor. |
112
- | `ExtractorOptions` | interface | `{ actions?, domains? }` | Represents the options for `createExtractor` and the `Extractor` constructor. |
113
- | `ClarifierOptions` | interface | `{ floor?, narrator? }` | Represents the options for `createClarifier` and the `Clarifier` constructor. |
114
- | `FormatterOptions` | interface | `{ verbs?, narrator? }` | Represents the options for `createFormatter` and the `Formatter` constructor. |
115
- | `TemplateManagerOptions` | interface | `{ templates?, on?, error? }` | Represents the options for `createTemplateManager` and the `TemplateManager` constructor — the initial seed collection. |
116
- | `SubjectManagerOptions` | interface | `{ subjects?, on?, error? }` | Represents the options for `createSubjectManager` and the `SubjectManager` constructor — the initial seed collection. |
117
- | `DefinitionManagerOptions` | interface | `{ definitions?, on?, error? }` | Represents the options for `createDefinitionManager` and the `DefinitionManager` constructor — the initial seed collection. |
118
- | `RecordStamp` | interface | `{ id, version, hash }` | Represents the identity, version, and content hash a `RecordManagerInterface` derives for one record before its concrete shape is built. |
119
- | `RecordFunction` | type | `(stamp: RecordStamp, value: TValue) => TRecord` | Builds one concrete record from the `RecordStamp` its registry derived and the value that record holds. |
120
- | `RecordManagerOptions` | interface | `{ entity, on?, error? }` | Represents the options for the `RecordManager` constructor. |
121
- | `RecordManagerInterface` | interface | `{ emitter, count } plus has, record, records, add, remove, destroy` | Represents the shared registry engine every record manager composes — the `Map`, the content-hash and version rule, the batch `remove` overloads, and teardown. |
122
- | `RecordOptions` | interface | `{ id? }` | Represents the per-call options for the record a manager's `add` mints. |
123
- | `InterpretContextOptions` | interface | `{ session?, history?, on?, error? }` | Represents the options for `createInterpretContext` and the `InterpretContext` constructor. |
124
- | `InterpretOptions` | interface | `{ templates?, context?, normalizer?, extractor?, clarifier?, formatter?, generator?, similarity?, floor?, history?, narrator?, on?, error? }` | Represents the options for `createInterpret` and the `Interpret` constructor. |
125
- | `NormalizerInterface` | interface | `{} plus normalize` | Represents the `Normalizer` stage contract: raw text in, cleaned text + applied changes out. |
126
- | `ExtractorInterface` | interface | `{} plus extract` | Represents the `Extractor` stage contract: template-agnostic intent classification + raw number mining. |
127
- | `ClarifierInterface` | interface | `{} plus clarify` | Represents the `Clarifier` stage contract: resolve carry-over, defaults, and computed fields against a set of already-assigned entities, surfacing ambiguities for anything required that stays unresolved. |
128
- | `FormatterInterface` | interface | `{} plus format` | Represents the `Formatter` stage contract: render the refined natural-language prompt for a matched template. |
129
- | `GeneratorInterface` | interface | `{} plus generate` | Represents the `Generator` stage contract: build the final subject/definition pair plus its field audit. |
130
- | `NarratorInterface` | interface | `{} plus phrase, label, line, value, describe, narrate` | Represents the `Narrator` contract — a stateless, total, lexicon-driven rendering engine for the reverse direction. |
131
- | `TemplateManagerInterface` | interface | `{ emitter, count } plus has, template, templates, add, remove, destroy` | Represents the template registry — a self-owning, versioned/hashed record-holder with the singular/plural accessor pair and the batch `remove` overloads. |
132
- | `SubjectManagerInterface` | interface | `{ emitter, count } plus has, subject, subjects, add, remove, destroy` | Represents the subject registry — a self-owning, versioned/hashed record-holder that mints its own record ids (a `Subject` carries none). |
133
- | `DefinitionManagerInterface` | interface | `{ emitter, count } plus has, definition, definitions, add, remove, destroy` | Represents the definition registry — a self-owning, versioned/hashed record-holder. |
134
- | `InterpretContextInterface` | interface | `{ emitter, session, subjects, definitions } plus previous, entities, add, clear, destroy` | Represents the cross-turn interpretation context: a capped, replayable history plus the subject/definition registries carry-over reads from. |
135
- | `InterpretInterface` | interface | `{ emitter } plus interpret, add, remove, template, templates, describe, narrate, destroy` | Represents the interpretation orchestrator — the sole public entry point, mirroring `reasons`' `Reason` orchestrator shape. |
76
+ | Name | Kind | Signature | Summary |
77
+ | ---------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
78
+ | `ProvenanceCategory` | type | `'extracted' \| 'carried' \| 'default' \| 'computed' \| 'subject'` | Names how one `FieldMapping` or `Entity` value was obtained. |
79
+ | `InterpretStage` | type | `'normalize' \| 'extract' \| 'clarify' \| 'format' \| 'generate'` | Names the fixed pipeline phases an `InterpretInterface#interpret` run produces one `StageRecord` for, in order. |
80
+ | `InterpretErrorCode` | type | `'NORMALIZE_FAILED' \| 'EXTRACT_FAILED' \| 'CLARIFY_FAILED' \| 'FORMAT_FAILED' \| 'GENERATE_FAILED' \| 'NO_TEMPLATE' \| 'LOW_CONFIDENCE' \| 'DESTROYED'` | Names the coded misuse or failure conditions thrown as an `InterpretError` or carried on a `StageFailure`. |
81
+ | `EntityMapping` | interface | `{ entity, aliases, field, required? }` | Represents one entity-extraction rule inside a `Template`: which literal alias phrases identify a value, and which subject field it lands on. |
82
+ | `FieldDefault` | interface | `{ field, value }` | Represents a fallback value a `Template` fills onto a field left unresolved by extraction. |
83
+ | `ComputedField` | interface | `{ field, expression }` | Represents a declaratively computed field: evaluate `expression` against the entities already resolved for this interpretation, and land the result on `field`. |
84
+ | `Template` | interface | `{ id, name, domain, intents, mappings, defaults, computations, definition }` | Represents a named, versionable interpretation template: which intents it answers, how to mine entities for it, its fallback data, its computed fields, and the reasons `Definition` it ultimately produces a `Subject` for. |
85
+ | `Provenance` | interface | `{ category, detail? }` | Describes how one value landed — its origin category plus an optional strategy detail. |
86
+ | `Intent` | interface | `{ action?, domain?, confidence }` | Represents the classified action + domain for one interpretation, with a combined confidence. |
87
+ | `Entity` | interface | `{ name, value, provenance, confidence }` | Represents one value assigned to a template's entity mapping, with its provenance and confidence. |
88
+ | `Ambiguity` | interface | `{ field, question, candidates, required }` | Represents an unresolved field surfaced as a human-readable question, never bare prose. |
89
+ | `FieldMapping` | interface | `{ field, entity?, value, provenance, confidence }` | Represents one audited field of the built subject — its resolved value, provenance, and confidence. |
90
+ | `TextChange` | interface | `{ from, to }` | Represents one normalization substitution applied to the raw text. |
91
+ | `StageRecord` | interface | `{ stage, input, output, failed, error? }` | Represents a structured input/output snapshot of one pipeline phase. |
92
+ | `StageFailure` | interface | `{ stage, code, message }` | Represents a visible marker for a stage that threw, carrying its coded reason. |
93
+ | `NormalizeResult` | interface | `{ text, changes }` | Represents the `Normalizer` stage's output: the cleaned text plus every substitution applied. |
94
+ | `ExtractResult` | interface | `{ intent, numbers }` | Represents the `Extractor` stage's output: intent classification plus raw numbers. |
95
+ | `ClarifyResult` | interface | `{ entities, ambiguities }` | Represents the `Clarifier` stage's output: resolved entities plus any remaining ambiguities. |
96
+ | `FormatResult` | interface | `{ prompt }` | Represents the `Formatter` stage's output: the refined natural-language prompt. |
97
+ | `GenerateResult` | interface | `{ subject, definition, mappings, confidence }` | Represents the `Generator` stage's output: the built subject/definition pair plus its full field audit. |
98
+ | `Interpretation` | interface | `{ text, normalized, intent, entities, subject?, definition?, mappings, ambiguities, prompt, stages, failures, confidence, digest }` | Represents the full, replayable outcome of one `interpret()` call. |
99
+ | `TemplateRecord` | interface | `{ id, template, version, hash }` | Represents a versioned, content-hashed `Template` as held by a `TemplateManagerInterface`. |
100
+ | `SubjectRecord` | interface | `{ id, subject, version, hash }` | Represents a versioned, content-hashed `Subject` as held by a `SubjectManagerInterface`. |
101
+ | `DefinitionRecord` | interface | `{ id, definition, version, hash }` | Represents a versioned, content-hashed `Definition` as held by a `DefinitionManagerInterface`. |
102
+ | `InterpretEventMap` | type | `{ readonly interpret: readonly [result: Interpretation]; readonly add: readonly [templateId: string]; readonly error: readonly [error: unknown]; readonly destroy: readonly []; }` | Represents the push observation surface of an `InterpretInterface`. |
103
+ | `RecordEventMap` | type | `{ readonly add: readonly [id: string]; readonly remove: readonly [id: string]; readonly destroy: readonly []; }` | Represents the push observation surface shared by every record registry — an id-keyed collection, so `add` and `remove` are the events (never ordered-list `append`/`prepend`). |
104
+ | `TemplateManagerEventMap` | type | `RecordEventMap` | Represents the push observation surface of a `TemplateManagerInterface`. |
105
+ | `SubjectManagerEventMap` | type | `RecordEventMap` | Represents the push observation surface of a `SubjectManagerInterface`, whose `add` carries the own-minted record id. |
106
+ | `DefinitionManagerEventMap` | type | `RecordEventMap` | Represents the push observation surface of a `DefinitionManagerInterface`. |
107
+ | `InterpretContextEventMap` | type | `{ readonly add: readonly [digest: string]; readonly clear: readonly []; readonly destroy: readonly []; }` | Represents the push observation surface of an `InterpretContextInterface`. |
108
+ | `NarratorFormatter` | type | `(value: unknown) => string` | Represents a pure formatting function for one lexicon `value()` unit. |
109
+ | `Lexicon` | interface | `{ phrases?, labels?, templates? }` | Represents caller-injected wording data for the reverse direction — mechanism, never policy. Every phrase, label, and template string a `Narrator` renders is data supplied here, never a core literal. |
110
+ | `NarratorOptions` | interface | `{ lexicon?, formatters? }` | Represents the options for `createNarrator` and the `Narrator` constructor. |
111
+ | `NormalizerOptions` | interface | `{ contractions?, abbreviations?, corrections? }` | Represents the options for `createNormalizer` and the `Normalizer` constructor. |
112
+ | `ExtractorOptions` | interface | `{ actions?, domains? }` | Represents the options for `createExtractor` and the `Extractor` constructor. |
113
+ | `ClarifierOptions` | interface | `{ floor?, narrator? }` | Represents the options for `createClarifier` and the `Clarifier` constructor. |
114
+ | `FormatterOptions` | interface | `{ verbs?, narrator? }` | Represents the options for `createFormatter` and the `Formatter` constructor. |
115
+ | `TemplateManagerOptions` | interface | `{ templates?, on?, error? }` | Represents the options for `createTemplateManager` and the `TemplateManager` constructor — the initial seed collection. |
116
+ | `SubjectManagerOptions` | interface | `{ subjects?, on?, error? }` | Represents the options for `createSubjectManager` and the `SubjectManager` constructor — the initial seed collection. |
117
+ | `DefinitionManagerOptions` | interface | `{ definitions?, on?, error? }` | Represents the options for `createDefinitionManager` and the `DefinitionManager` constructor — the initial seed collection. |
118
+ | `RecordStamp` | interface | `{ id, version, hash }` | Represents the identity, version, and content hash a `RecordManagerInterface` derives for one record before its concrete shape is built. |
119
+ | `RecordFunction` | type | `(stamp: RecordStamp, value: TValue) => TRecord` | Builds one concrete record from the `RecordStamp` its registry derived and the value that record holds. |
120
+ | `RecordManagerOptions` | interface | `{ entity, on?, error? }` | Represents the options for the `RecordManager` constructor. |
121
+ | `RecordManagerInterface` | interface | `{ emitter, count, has(), record(), records(), add(), remove(), destroy() }` | Represents the shared registry engine every record manager composes — the `Map`, the content-hash and version rule, the batch `remove` overloads, and teardown. |
122
+ | `RecordOptions` | interface | `{ id? }` | Represents the per-call options for the record a manager's `add` mints. |
123
+ | `InterpretContextOptions` | interface | `{ session?, history?, on?, error? }` | Represents the options for `createInterpretContext` and the `InterpretContext` constructor. |
124
+ | `InterpretOptions` | interface | `{ templates?, context?, normalizer?, extractor?, clarifier?, formatter?, generator?, similarity?, floor?, history?, narrator?, on?, error? }` | Represents the options for `createInterpret` and the `Interpret` constructor. |
125
+ | `NormalizerInterface` | interface | `{ normalize() }` | Represents the `Normalizer` stage contract: raw text in, cleaned text + applied changes out. |
126
+ | `ExtractorInterface` | interface | `{ extract() }` | Represents the `Extractor` stage contract: template-agnostic intent classification + raw number mining. |
127
+ | `ClarifierInterface` | interface | `{ clarify() }` | Represents the `Clarifier` stage contract: resolve carry-over, defaults, and computed fields against a set of already-assigned entities, surfacing ambiguities for anything required that stays unresolved. |
128
+ | `FormatterInterface` | interface | `{ format() }` | Represents the `Formatter` stage contract: render the refined natural-language prompt for a matched template. |
129
+ | `GeneratorInterface` | interface | `{ generate() }` | Represents the `Generator` stage contract: build the final subject/definition pair plus its field audit. |
130
+ | `NarratorInterface` | interface | `{ phrase(), label(), line(), value(), describe(), narrate() }` | Represents the `Narrator` contract — a stateless, total, lexicon-driven rendering engine for the reverse direction. |
131
+ | `TemplateManagerInterface` | interface | `{ emitter, count, has(), template(), templates(), add(), remove(), destroy() }` | Represents the template registry — a self-owning, versioned/hashed record-holder with the singular/plural accessor pair and the batch `remove` overloads. |
132
+ | `SubjectManagerInterface` | interface | `{ emitter, count, has(), subject(), subjects(), add(), remove(), destroy() }` | Represents the subject registry — a self-owning, versioned/hashed record-holder that mints its own record ids (a `Subject` carries none). |
133
+ | `DefinitionManagerInterface` | interface | `{ emitter, count, has(), definition(), definitions(), add(), remove(), destroy() }` | Represents the definition registry — a self-owning, versioned/hashed record-holder. |
134
+ | `InterpretContextInterface` | interface | `{ emitter, session, subjects, definitions, previous(), entities(), add(), clear(), destroy() }` | Represents the cross-turn interpretation context: a capped, replayable history plus the subject/definition registries carry-over reads from. |
135
+ | `InterpretInterface` | interface | `{ emitter, interpret(), add(), remove(), template(), templates(), describe(), narrate(), destroy() }` | Represents the interpretation orchestrator — the sole public entry point, mirroring `reasons`' `Reason` orchestrator shape. |
136
136
 
137
137
  ### Constants
138
138
 
139
139
  A `Shape` cell holds the constant's declared type.
140
140
 
141
- | API | Kind | Shape | Summary |
141
+ | Name | Kind | Signature | Summary |
142
142
  | ------------------------------ | ----- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
143
- | `DEFAULT_INTERPRET_SIMILARITY` | const | `number` | Names the default `similarity` for `createInterpret` and `matchAlias`, 0.8 — the fuzzy alias-match score threshold, between 0 and 1. |
144
- | `DEFAULT_INTERPRET_FLOOR` | const | `number` | Names the default `floor` for `createInterpret` and `matchTemplate`, 0.3 — the minimum intent confidence a template match, or the classified intent itself, must clear. |
145
- | `DEFAULT_INTERPRET_HISTORY` | const | `number` | Names the default `history` cap for an `InterpretContext`'s `previous()` ring buffer, 16. |
143
+ | `DEFAULT_INTERPRET_SIMILARITY` | const | `0.8` | Names the default `similarity` for `createInterpret` and `matchAlias`, 0.8 — the fuzzy alias-match score threshold, between 0 and 1. |
144
+ | `DEFAULT_INTERPRET_FLOOR` | const | `0.3` | Names the default `floor` for `createInterpret` and `matchTemplate`, 0.3 — the minimum intent confidence a template match, or the classified intent itself, must clear. |
145
+ | `DEFAULT_INTERPRET_HISTORY` | const | `16` | Names the default `history` cap for an `InterpretContext`'s `previous()` ring buffer, 16. |
146
146
  | `PROVENANCE_CATEGORIES` | const | `readonly ProvenanceCategory[]` | Lists every `ProvenanceCategory` literal, frozen — the one home the result guards check the union from, so a new category added to `types.ts` is added here rather than silently rejected by `isProvenance`. |
147
147
  | `INTERPRET_STAGES` | const | `readonly InterpretStage[]` | Lists every `InterpretStage` literal in pipeline order, frozen — the one home the result guards check the union from. |
148
148
  | `INTERPRET_ERROR_CODES` | const | `readonly InterpretErrorCode[]` | Lists every `InterpretErrorCode` literal, frozen — the one home the result guards check the union from. |
149
- | `CONFIDENCE_EXACT` | const | `number` | Names the confidence assigned to an exact keyword-proximity entity match, 1. |
150
- | `CONFIDENCE_ALIAS` | const | `number` | Names the confidence assigned to an exact alias-phrase entity match, 0.9. |
151
- | `CONFIDENCE_COLLECT` | const | `number` | Names the confidence assigned when a single entity mapping collects every extracted number, 0.9. |
152
- | `CONFIDENCE_POSITIONAL` | const | `number` | Names the confidence assigned to a positional (order-based) entity match fallback, 0.7. |
153
- | `CONFIDENCE_CARRIED` | const | `number` | Names the confidence assigned to a same-domain carried-over field, 0.7. |
154
- | `CONFIDENCE_DEFAULT` | const | `number` | Names the confidence assigned to a template default fill, 1. |
155
- | `CONFIDENCE_COMPUTED` | const | `number` | Names the confidence assigned to a successfully resolved computed field, 0.9. |
149
+ | `CONFIDENCE_EXACT` | const | `1` | Names the confidence assigned to an exact keyword-proximity entity match, 1. |
150
+ | `CONFIDENCE_ALIAS` | const | `0.9` | Names the confidence assigned to an exact alias-phrase entity match, 0.9. |
151
+ | `CONFIDENCE_COLLECT` | const | `0.9` | Names the confidence assigned when a single entity mapping collects every extracted number, 0.9. |
152
+ | `CONFIDENCE_POSITIONAL` | const | `0.7` | Names the confidence assigned to a positional (order-based) entity match fallback, 0.7. |
153
+ | `CONFIDENCE_CARRIED` | const | `0.7` | Names the confidence assigned to a same-domain carried-over field, 0.7. |
154
+ | `CONFIDENCE_DEFAULT` | const | `1` | Names the confidence assigned to a template default fill, 1. |
155
+ | `CONFIDENCE_COMPUTED` | const | `0.9` | Names the confidence assigned to a successfully resolved computed field, 0.9. |
156
156
  | `NUMBER_PATTERN` | const | `RegExp` | Holds the numeric-entity extraction pattern shared by `extractNumbers` and `assignEntities` — an optional leading `$`, thousands-comma-grouped digits, an optional decimal fraction, and an optional trailing `%`. |
157
157
  | `UNSAFE_FIELD_SEGMENTS` | const | `readonly string[]` | Lists the prototype-pollution-unsafe field-path segments, `__proto__`, `prototype`, and `constructor` — `setField` refuses to write any path containing one, and returns its input unchanged. |
158
158
  | `DEFAULT_CONTRACTIONS` | const | `Readonly<Record<string, string>>` | Holds the neutral built-in contraction expansions for `Normalizer` — small on purpose; callers merge their own map over this one. |
@@ -196,10 +196,10 @@ DEFAULT_LEXICON.templates?.['ambiguity.entity'] // 'What is your {{entity}}?'
196
196
 
197
197
  ### Errors
198
198
 
199
- | API | Kind | Summary |
200
- | ------------------ | -------- | ---------------------------------------------------------------------------------------------------------------------- |
201
- | `InterpretError` | class | Represents an error thrown by the interprets layer, carrying an `InterpretErrorCode` and an optional `context` record. |
202
- | `isInterpretError` | function | Narrows an unknown caught value to an `InterpretError`. |
199
+ | Name | Kind | Signature | Summary |
200
+ | ------------------ | -------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
201
+ | `InterpretError` | class | `new (code: InterpretErrorCode, message: string, context?: Readonly<Record<string, unknown>>) => InterpretError` | Represents an error thrown by the interprets layer, carrying an `InterpretErrorCode` and an optional `context` record. |
202
+ | `isInterpretError` | function | `(value: unknown) => value is InterpretError` | Narrows an unknown caught value to an `InterpretError`. |
203
203
 
204
204
  ```ts
205
205
  import { InterpretError, isInterpretError } from '@orkestrel/interpret'
@@ -226,20 +226,20 @@ published member conforms, because a foreign engine's return is not this package
226
226
 
227
227
  In a guard table a `Shape` cell holds the type the guard narrows to.
228
228
 
229
- | API | Kind | Shape | Summary |
230
- | ------------------ | -------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
231
- | `isEntityMapping` | function | `EntityMapping` | Determines whether a value is an exact `EntityMapping` input record — a literal alias-phrase extraction rule pointing at a subject field. |
232
- | `isFieldDefault` | function | `FieldDefault` | Determines whether a value is an exact `FieldDefault` input record — a fallback value a `Template` fills onto an unresolved field. |
233
- | `isComputedField` | function | `ComputedField` | Determines whether a value is an exact `ComputedField` input record — a declaratively computed field carrying a reasons `SymbolicExpression` tree. |
234
- | `isTemplate` | function | `Template` | Determines whether a value is an exact `Template` input record — a named, versionable interpretation template. |
235
- | `isProvenance` | function | `Provenance` | Determines whether a value is an open `Provenance` result record. |
236
- | `isIntent` | function | `Intent` | Determines whether a value is an open `Intent` result record. |
237
- | `isEntity` | function | `Entity` | Determines whether a value is an open `Entity` result record. |
238
- | `isFieldMapping` | function | `FieldMapping` | Determines whether a value is an open `FieldMapping` result record. |
239
- | `isAmbiguity` | function | `Ambiguity` | Determines whether a value is an open `Ambiguity` result record. |
240
- | `isStageRecord` | function | `StageRecord` | Determines whether a value is an open `StageRecord` result record. |
241
- | `isStageFailure` | function | `StageFailure` | Determines whether a value is an open `StageFailure` result record. |
242
- | `isInterpretation` | function | `Interpretation` | Determines whether a value is an open `Interpretation` result record. |
229
+ | Name | Kind | Signature | Summary |
230
+ | ------------------ | -------- | --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
231
+ | `isEntityMapping` | function | `(value: unknown) => value is EntityMapping` | Determines whether a value is an exact `EntityMapping` input record — a literal alias-phrase extraction rule pointing at a subject field. |
232
+ | `isFieldDefault` | function | `(value: unknown) => value is FieldDefault` | Determines whether a value is an exact `FieldDefault` input record — a fallback value a `Template` fills onto an unresolved field. |
233
+ | `isComputedField` | function | `(value: unknown) => value is ComputedField` | Determines whether a value is an exact `ComputedField` input record — a declaratively computed field carrying a reasons `SymbolicExpression` tree. |
234
+ | `isTemplate` | function | `(value: unknown) => value is Template` | Determines whether a value is an exact `Template` input record — a named, versionable interpretation template. |
235
+ | `isProvenance` | function | `(value: unknown) => value is Provenance` | Determines whether a value is an open `Provenance` result record. |
236
+ | `isIntent` | function | `(value: unknown) => value is Intent` | Determines whether a value is an open `Intent` result record. |
237
+ | `isEntity` | function | `(value: unknown) => value is Entity` | Determines whether a value is an open `Entity` result record. |
238
+ | `isFieldMapping` | function | `(value: unknown) => value is FieldMapping` | Determines whether a value is an open `FieldMapping` result record. |
239
+ | `isAmbiguity` | function | `(value: unknown) => value is Ambiguity` | Determines whether a value is an open `Ambiguity` result record. |
240
+ | `isStageRecord` | function | `(value: unknown) => value is StageRecord` | Determines whether a value is an open `StageRecord` result record. |
241
+ | `isStageFailure` | function | `(value: unknown) => value is StageFailure` | Determines whether a value is an open `StageFailure` result record. |
242
+ | `isInterpretation` | function | `(value: unknown) => value is Interpretation` | Determines whether a value is an open `Interpretation` result record. |
243
243
 
244
244
  ```ts
245
245
  import {
@@ -304,26 +304,26 @@ guardEngine.destroy()
304
304
  Pure, exported utility functions — the referentially-transparent leaves
305
305
  behind the `Interpret` orchestrator and its stages.
306
306
 
307
- | API | Kind | Summary |
308
- | -------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------- |
309
- | `escapeRegExp` | function | Escapes every regex metacharacter in `text` so it matches literally when compiled into a `RegExp`. |
310
- | `setField` | function | Writes a value at a (possibly nested) field path on a subject, copy-on-write. |
311
- | `applyReplacements` | function | Replaces every whole-word occurrence of a map's keys with their values. |
312
- | `collapseWhitespace` | function | Collapses every run of whitespace to a single space and trims the ends. |
313
- | `tokenize` | function | Splits text into lowercase tokens, stripping punctuation outside a small numeric/currency-safe allowlist. |
314
- | `extractNumbers` | function | Mines every numeric literal from text — optional leading `$`, thousands commas, an optional decimal fraction, an optional trailing `%`. |
315
- | `assignEntities` | function | Assigns already-extracted numbers to a matched template's entity mappings. |
316
- | `classifyIntent` | function | Classifies the action + domain intent of a text against caller-supplied vocabularies. |
317
- | `scoreSimilarity` | function | Measures bigram (Dice coefficient) string similarity, case-insensitive. |
318
- | `matchAlias` | function | Returns the best `scoreSimilarity` a token achieves against a list of aliases, gated by a threshold. |
319
- | `canonicalize` | function | Renders a value into a canonical, key-order-stable string — the pre-image of `digestValue`. |
320
- | `canonicalizeNode` | function | Renders one node of a value into its canonical, key-order-stable string, against the object ancestors already on the recursion path. |
321
- | `digestValue` | function | Computes a canonical structural digest of a pure-JSON value — a key-order-stable FNV-1a hash rendered as an 8-hex-digit string. |
322
- | `scoreTemplate` | function | Scores how well a classified intent matches one template's domain + action. |
323
- | `matchTemplate` | function | Finds the best-scoring added template for a classified intent, gated by a confidence floor. |
324
- | `variablesOf` | function | Collects every variable name referenced by a symbolic expression tree, in first-occurrence order. |
325
- | `resolveExpression` | function | Evaluates a symbolic expression tree against resolved bindings. |
326
- | `renderSubject` | function | Renders a one-line, display-neutral description of a reasons `Subject`, through an injected `Narrator`. |
307
+ | Name | Kind | Signature | Summary |
308
+ | -------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
309
+ | `escapeRegExp` | function | `(text: string) => string` | Escapes every regex metacharacter in `text` so it matches literally when compiled into a `RegExp`. |
310
+ | `setField` | function | `(subject: Subject, field: FieldPath, value: unknown) => Subject` | Writes a value at a (possibly nested) field path on a subject, copy-on-write. |
311
+ | `applyReplacements` | function | `(text: string, map: Readonly<Record<string, string>>) => string` | Replaces every whole-word occurrence of a map's keys with their values. |
312
+ | `collapseWhitespace` | function | `(text: string) => string` | Collapses every run of whitespace to a single space and trims the ends. |
313
+ | `tokenize` | function | `(text: string) => readonly string[]` | Splits text into lowercase tokens, stripping punctuation outside a small numeric/currency-safe allowlist. |
314
+ | `extractNumbers` | function | `(text: string) => readonly number[]` | Mines every numeric literal from text — optional leading `$`, thousands commas, an optional decimal fraction, an optional trailing `%`. |
315
+ | `assignEntities` | function | `(numbers: readonly number[], mappings: readonly EntityMapping[], text: string, similarity: number) => readonly Entity[]` | Assigns already-extracted numbers to a matched template's entity mappings. |
316
+ | `classifyIntent` | function | `(text: string, actions: Readonly<Record<string, string>>, domains: Readonly<Record<string, readonly string[]>>) => Intent` | Classifies the action + domain intent of a text against caller-supplied vocabularies. |
317
+ | `scoreSimilarity` | function | `(a: string, b: string) => number` | Measures bigram (Dice coefficient) string similarity, case-insensitive. |
318
+ | `matchAlias` | function | `(token: string, aliases: readonly string[], threshold: number) => number` | Returns the best `scoreSimilarity` a token achieves against a list of aliases, gated by a threshold. |
319
+ | `canonicalize` | function | `(value: unknown) => string` | Renders a value into a canonical, key-order-stable string — the pre-image of `digestValue`. |
320
+ | `canonicalizeNode` | function | `(value: unknown, ancestors: ReadonlySet<object>) => string` | Renders one node of a value into its canonical, key-order-stable string, against the object ancestors already on the recursion path. |
321
+ | `digestValue` | function | `(value: unknown) => string` | Computes a canonical structural digest of a pure-JSON value — a key-order-stable FNV-1a hash rendered as an 8-hex-digit string. |
322
+ | `scoreTemplate` | function | `(intent: Intent, template: Template) => number` | Scores how well a classified intent matches one template's domain + action. |
323
+ | `matchTemplate` | function | `(intent: Intent, templates: readonly Template[], floor: number) => Template \| undefined` | Finds the best-scoring added template for a classified intent, gated by a confidence floor. |
324
+ | `variablesOf` | function | `(expression: SymbolicExpression) => readonly string[]` | Collects every variable name referenced by a symbolic expression tree, in first-occurrence order. |
325
+ | `resolveExpression` | function | `(expression: SymbolicExpression, bindings: Readonly<Record<string, number>>) => number \| undefined` | Evaluates a symbolic expression tree against resolved bindings. |
326
+ | `renderSubject` | function | `(subject: Subject, narrator: NarratorInterface) => string` | Renders a one-line, display-neutral description of a reasons `Subject`, through an injected `Narrator`. |
327
327
 
328
328
  ```ts
329
329
  import {
@@ -423,9 +423,9 @@ Coercers — each returns its type or `undefined` off-shape, and never throws.
423
423
  Template intake is total: an off-shape template returns `undefined`, and a
424
424
  caller who wants a throw raises its own error from that `undefined`.
425
425
 
426
- | API | Kind | Summary |
427
- | --------------- | -------- | ---------------------------------------------------------------------------------------------------------- |
428
- | `parseTemplate` | function | Parses a JSON string into a `Template`, or `undefined` on invalid JSON or a shape that fails `isTemplate`. |
426
+ | Name | Kind | Signature | Summary |
427
+ | --------------- | -------- | ------------------------------------------ | ---------------------------------------------------------------------------------------------------------- |
428
+ | `parseTemplate` | function | `(value: string) => Template \| undefined` | Parses a JSON string into a `Template`, or `undefined` on invalid JSON or a shape that fails `isTemplate`. |
429
429
 
430
430
  ```ts
431
431
  import { parseTemplate } from '@orkestrel/interpret'
@@ -435,19 +435,19 @@ parseTemplate('not json') // undefined
435
435
 
436
436
  ### Factories
437
437
 
438
- | API | Kind | Summary |
439
- | ------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
440
- | `createInterpret` | function | Creates an interpretation orchestrator, returning an `InterpretInterface` seeded from `InterpretOptions`. |
441
- | `createNormalizer` | function | Creates a text normalizer, returning a stateless `NormalizerInterface`. |
442
- | `createExtractor` | function | Creates a template-agnostic intent classifier and number extractor, returning a stateless `ExtractorInterface`. |
443
- | `createClarifier` | function | Creates a clarifier — carry-over, defaults, and computed-field resolution against an assigned entity set — returning a stateless `ClarifierInterface`. |
444
- | `createFormatter` | function | Creates a prompt formatter, returning a stateless `FormatterInterface`. |
445
- | `createGenerator` | function | Creates a subject and definition generator, returning a stateless `GeneratorInterface`. |
446
- | `createTemplateManager` | function | Creates a template registry, returning a working `TemplateManagerInterface`. |
447
- | `createSubjectManager` | function | Creates a subject registry, returning a working `SubjectManagerInterface`. |
448
- | `createDefinitionManager` | function | Creates a definition registry, returning a working `DefinitionManagerInterface`. |
449
- | `createInterpretContext` | function | Creates a cross-turn interpretation context, returning a working `InterpretContextInterface`. |
450
- | `createNarrator` | function | Creates a lexicon-driven reverse-direction rendering engine, returning a stateless `NarratorInterface`. |
438
+ | Name | Kind | Signature | Summary |
439
+ | ------------------------- | -------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
440
+ | `createInterpret` | function | `(options?: InterpretOptions) => InterpretInterface` | Creates an interpretation orchestrator, returning an `InterpretInterface` seeded from `InterpretOptions`. |
441
+ | `createNormalizer` | function | `(options?: NormalizerOptions) => NormalizerInterface` | Creates a text normalizer, returning a stateless `NormalizerInterface`. |
442
+ | `createExtractor` | function | `(options?: ExtractorOptions) => ExtractorInterface` | Creates a template-agnostic intent classifier and number extractor, returning a stateless `ExtractorInterface`. |
443
+ | `createClarifier` | function | `(options?: ClarifierOptions) => ClarifierInterface` | Creates a clarifier — carry-over, defaults, and computed-field resolution against an assigned entity set — returning a stateless `ClarifierInterface`. |
444
+ | `createFormatter` | function | `(options?: FormatterOptions) => FormatterInterface` | Creates a prompt formatter, returning a stateless `FormatterInterface`. |
445
+ | `createGenerator` | function | `() => GeneratorInterface` | Creates a subject and definition generator, returning a stateless `GeneratorInterface`. |
446
+ | `createTemplateManager` | function | `(options?: TemplateManagerOptions) => TemplateManagerInterface` | Creates a template registry, returning a working `TemplateManagerInterface`. |
447
+ | `createSubjectManager` | function | `(options?: SubjectManagerOptions) => SubjectManagerInterface` | Creates a subject registry, returning a working `SubjectManagerInterface`. |
448
+ | `createDefinitionManager` | function | `(options?: DefinitionManagerOptions) => DefinitionManagerInterface` | Creates a definition registry, returning a working `DefinitionManagerInterface`. |
449
+ | `createInterpretContext` | function | `(options?: InterpretContextOptions) => InterpretContextInterface` | Creates a cross-turn interpretation context, returning a working `InterpretContextInterface`. |
450
+ | `createNarrator` | function | `(options?: NarratorOptions) => NarratorInterface` | Creates a lexicon-driven reverse-direction rendering engine, returning a stateless `NarratorInterface`. |
451
451
 
452
452
  ```ts
453
453
  import {
@@ -511,20 +511,20 @@ createDefinitionManager({
511
511
 
512
512
  ### Classes
513
513
 
514
- | API | Kind | Summary |
515
- | ------------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
516
- | `Interpret` | class | Implements the interpretation orchestrator — the sole public entry point of the `interprets` module, mirroring the reasons `Reason` orchestrator shape: it runs the `[normalize, extract, clarify, format, generate]` pipeline, owns the template registry and the context, and exposes the reverse direction. |
517
- | `Narrator` | class | Implements a stateless, total, lexicon-driven rendering engine for the reverse direction — the reverse-direction mirror of the forward `Formatter`'s `verbs` seam, supplying mechanism rather than wording policy. |
518
- | `Normalizer` | class | Implements the normalize stage: applies contraction, abbreviation, and correction substitutions in order, then collapses whitespace. |
519
- | `Extractor` | class | Implements the extract stage: template-agnostic intent classification plus raw numeric-entity mining. |
520
- | `Clarifier` | class | Implements the clarify stage: resolves same-domain carry-over, template defaults, and declaratively computed fields against an already-assigned entity set, surfacing an `Ambiguity` for every required mapping that stays unresolved. |
521
- | `Formatter` | class | Implements the format stage: renders the refined natural-language prompt for a matched template. |
522
- | `Generator` | class | Implements the generate stage: builds the final `Subject` from a fully resolved entity set, plus its complete field audit. |
523
- | `RecordManager` | class | Implements the shared registry engine behind every record manager in this module — it owns the `Map`, the content-hash and version rule, the batch `remove` overloads, and teardown. |
524
- | `TemplateManager` | class | Implements the template registry — a self-owning, versioned and content-hashed record-holder for the `Template`s an `Interpret` orchestrator matches against. |
525
- | `SubjectManager` | class | Implements the subject registry — a self-owning, versioned and content-hashed record-holder that mints its own record identity for every `Subject` (a `Subject` carries no `id` field of its own). |
526
- | `DefinitionManager` | class | Implements the definition registry — a self-owning, versioned and content-hashed record-holder for the reasons `Definition`s an interpretation produces. |
527
- | `InterpretContext` | class | Implements the cross-turn interpretation context — a capped, replayable history of completed `Interpretation`s plus the subject and definition registries carry-over reads from. |
514
+ | Name | Kind | Signature | Summary |
515
+ | ------------------- | ----- | --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
516
+ | `Interpret` | class | `new (options?: InterpretOptions) => InterpretInterface` | Implements the interpretation orchestrator — the sole public entry point of the `interprets` module, mirroring the reasons `Reason` orchestrator shape: it runs the `[normalize, extract, clarify, format, generate]` pipeline, owns the template registry and the context, and exposes the reverse direction. |
517
+ | `Narrator` | class | `new (options?: NarratorOptions) => NarratorInterface` | Implements a stateless, total, lexicon-driven rendering engine for the reverse direction — the reverse-direction mirror of the forward `Formatter`'s `verbs` seam, supplying mechanism rather than wording policy. |
518
+ | `Normalizer` | class | `new (options?: NormalizerOptions) => NormalizerInterface` | Implements the normalize stage: applies contraction, abbreviation, and correction substitutions in order, then collapses whitespace. |
519
+ | `Extractor` | class | `new (options?: ExtractorOptions) => ExtractorInterface` | Implements the extract stage: template-agnostic intent classification plus raw numeric-entity mining. |
520
+ | `Clarifier` | class | `new (options?: ClarifierOptions) => ClarifierInterface` | Implements the clarify stage: resolves same-domain carry-over, template defaults, and declaratively computed fields against an already-assigned entity set, surfacing an `Ambiguity` for every required mapping that stays unresolved. |
521
+ | `Formatter` | class | `new (options?: FormatterOptions) => FormatterInterface` | Implements the format stage: renders the refined natural-language prompt for a matched template. |
522
+ | `Generator` | class | `new () => GeneratorInterface` | Implements the generate stage: builds the final `Subject` from a fully resolved entity set, plus its complete field audit. |
523
+ | `RecordManager` | class | `new <TValue, TRecord extends RecordStamp>(options: RecordManagerOptions) => RecordManagerInterface<TValue, TRecord>` | Implements the shared registry engine behind every record manager in this module — it owns the `Map`, the content-hash and version rule, the batch `remove` overloads, and teardown. |
524
+ | `TemplateManager` | class | `new (options?: TemplateManagerOptions) => TemplateManagerInterface` | Implements the template registry — a self-owning, versioned and content-hashed record-holder for the `Template`s an `Interpret` orchestrator matches against. |
525
+ | `SubjectManager` | class | `new (options?: SubjectManagerOptions) => SubjectManagerInterface` | Implements the subject registry — a self-owning, versioned and content-hashed record-holder that mints its own record identity for every `Subject` (a `Subject` carries no `id` field of its own). |
526
+ | `DefinitionManager` | class | `new (options?: DefinitionManagerOptions) => DefinitionManagerInterface` | Implements the definition registry — a self-owning, versioned and content-hashed record-holder for the reasons `Definition`s an interpretation produces. |
527
+ | `InterpretContext` | class | `new (options?: InterpretContextOptions) => InterpretContextInterface` | Implements the cross-turn interpretation context — a capped, replayable history of completed `Interpretation`s plus the subject and definition registries carry-over reads from. |
528
528
 
529
529
  ## Methods
530
530