/** * Runtime chunker registry (ADR-097 § 5 Q3, mmnto-ai/totem#1769). * * Replaces the closed `CHUNKER_MAP` keyed by the closed `ChunkStrategy` Zod * enum. The registry is a string-keyed Map populated by: * * 1. Built-in chunkers self-registering at module load (this file's bottom). * 2. Pack registration callbacks invoked by `loadInstalledPacks()` during * boot (mmnto-ai/totem#1768) — they register via the * `PackRegistrationAPI.registerChunkStrategy()` surface, which calls * through to `register()` in this module. * * After boot completes, the engine seals (`pack-discovery.ts` flips * `engineSealed = true`) and any further `register()` call throws. * * The registry has no concept of which built-in vs pack-registered an * entry is — that distinction is enforced at registration time (see * `register()` and `BUILTIN_CHUNKER_NAMES`). */ import type { Chunker } from './chunker.js'; /** * Register a chunker under a strategy name. Called by built-ins at module * load and by Pack registration callbacks during boot. Throws when: * * - `engineSealed` (per `pack-discovery.ts`) is true. * - The strategy name is already registered (built-ins are immutable; * pack-vs-pack collisions are also rejected). * * Boot vs pack distinction: built-ins call `register()` directly at * module-load time (sealed === false, name not yet in registry → succeeds). * Packs call via `PackRegistrationAPI.registerChunkStrategy` which routes * to this same function. The seal check + name-collision check covers both * in one place. */ export declare function register(name: string, chunkerCtor: new () => Chunker): void; /** * Look up a chunker class by strategy name. Returns undefined when the * name isn't registered — callers decide whether absence is a hard error * (Zod validation), a fail-loud at runtime (createChunker), or a soft * miss. */ export declare function lookup(name: string): (new () => Chunker) | undefined; /** * Snapshot of currently-registered strategy names. Used for: * * - `ChunkStrategySchema` validation error messages (suggesting the valid set). * - `totem describe` output enumerating effective strategies. * * Returns a sorted array for deterministic output. */ export declare function registeredNames(): readonly string[]; /** * True iff the strategy name is one of the built-ins (vs pack-registered). * Used by tooling that needs to distinguish core-shipped strategies from * pack-contributed ones. */ export declare function isBuiltin(name: string): boolean; /** * Mark the registry as sealed. After this, `register()` calls throw. * Called by `pack-discovery.ts` `loadInstalledPacks()` after every pack * callback returns. * * The seal applies process-wide. Tests that need to register additional * fixture chunkers between cases use `__unsealForTests()`. */ export declare function seal(): void; /** True iff the registry has been sealed. */ export declare function isSealed(): boolean; /** * Test-only: reset the registry and re-register built-ins. Lets per-test * fixtures register without leaking state across tests. NEVER call from * production code. */ export declare function __resetForTests(): void; /** Test-only: clear the seal so subsequent registrations succeed. */ export declare function __unsealForTests(): void; //# sourceMappingURL=chunker-registry.d.ts.map