/** * Prose pipeline — orchestrates the per-turn event → block translation. * * Pipeline stages (from `processTurn`): * 1. Filter — drop `system.*` and `platform.*` events. * 2. Sort — apply ADR-094 chain-metadata ordering. * 3. Route — try the messageId path first (ADR-097), then dispatch * by event type to a handler family. * 4. Assemble — handlers themselves call `createBlock`, so by the * time blocks return here they already carry parsed * bracket decorations and final `className`s. * * Public interface: `class ProsePipeline implements IProsePipeline`. * Engine constructs one instance during `setStory()` and calls * `processTurn` per turn (same three call sites as the retiring * `TextService`). * * Owner context: `@sharpee/engine` — internal prose pipeline. * * @see ADR-174 §Internal interfaces * @see ADR-094 Event Chaining (sort stage) * @see ADR-097 Domain Events with messageId (domain-message handler) */ import type { ITextBlock } from '@sharpee/text-blocks'; import type { LanguageProvider } from '@sharpee/if-domain'; import type { ISemanticEvent } from '@sharpee/core'; import { type WorldModelLike } from './render-context'; import type { IProsePipeline, SlotContributor } from './types'; /** * Engine-internal prose pipeline. * * Stateless transformer: events in, blocks out. Constructed once per * `setStory()` call with the active language provider; called per * turn by `GameEngine.executeTurn`, `GameEngine.restartGame`, and * the meta-command path (same three sites the retired * `TextService.processTurn` had). */ export declare class ProsePipeline implements IProsePipeline { private readonly languageProvider; private readonly world?; /** Realize-time slot contributors, run in registration order each turn (ADR-195 §3). */ private readonly slotContributors; /** * @param languageProvider the active language provider (template → text) * @param world the read-only world model; when supplied, each turn builds a * phrase-pipeline render-context factory (ADR-192, W2). Optional so legacy * and test construction (string path only) keeps working without a world. */ constructor(languageProvider: LanguageProvider, world?: WorldModelLike); /** * Register a realize-time slot contributor (ADR-195 §3). Contributors run once * per turn at the top of `processTurn`, in registration order; that order feeds * the `(order, insertion)` tie-break of the slot store. * * @param contributor the slot contributor to run each turn. */ registerSlotContributor(contributor: SlotContributor): void; processTurn(events: ISemanticEvent[]): ITextBlock[]; /** * Route an event to its handler family. * * Order: try the ADR-097 messageId path first (catches every stdlib * domain event); then fall through to type-keyed handlers; finally * the catch-all generic handler. */ private routeToHandler; } /** * Construct a `ProsePipeline` for the given language provider. * * Mirrors the `createTextService` factory the retired text-service * package exposed; callers can swap one for the other without * changing call shapes. */ export declare function createProsePipeline(languageProvider: LanguageProvider, world?: WorldModelLike): IProsePipeline; //# sourceMappingURL=pipeline.d.ts.map