/** * @license * Copyright 2025 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ import type { ServiceRegistry } from "./ServiceRegistry"; /** * A compactor function that converts a resolved instance back to its string ID. * Returns undefined if the value cannot be compacted (e.g., missing ID field). * * @param value The resolved instance to compact * @param format The full format string (e.g., "model:TextEmbedding", "storage:tabular") * @param registry The service registry to use for lookups */ export type InputCompactorFn = (value: unknown, format: string, registry: ServiceRegistry) => string | undefined | Promise; /** * Service token for the input compactor registry. * Maps format prefixes to compactor functions. */ export declare const INPUT_COMPACTORS: import("./ServiceRegistry").ServiceToken>; /** * Registers an empty compactor map on the given registry if absent. * Called as part of `bootstrapWorkglow` / `createOrchestrationContext`. */ export declare function registerInputCompactorDefaults(registry?: ServiceRegistry): void; /** * Gets the input compactor registry from the given registry (defaults to global). */ export declare function getInputCompactors(registry?: ServiceRegistry): Map; /** * Registers an input compactor for a format prefix. * The compactor will be called to convert resolved instances back to string IDs. * * @param formatPrefix The format prefix to match (e.g., "model", "knowledge-base") * @param compactor The compactor function * * @example * ```typescript * // Register model compactor — extracts model_id from a ModelConfig * registerInputCompactor("model", (value) => { * if (typeof value === "object" && value !== null && "model_id" in value) { * const id = (value as Record).model_id; * return typeof id === "string" ? id : undefined; * } * return undefined; * }); * ``` */ export declare function registerInputCompactor(formatPrefix: string, compactor: InputCompactorFn, registry?: ServiceRegistry): void; //# sourceMappingURL=InputCompactorRegistry.d.ts.map