/** * CortexModel: branded opaque type for type-safe model passing. * * Wraps pi-ai's Model with a branded type to prevent consumers * from accidentally passing raw pi-ai models where cortex models * are expected (and vice versa). * * The consumer can read provider, modelId, and contextWindow for * display and configuration. The underlying pi-ai Model object is * accessed internally by CortexAgent when constructing the * pi-agent-core Agent. * * Reference: provider-manager.md */ /** * Opaque model handle. The consumer receives this from ProviderManager * and passes it to CortexAgent. The consumer never inspects its internals * beyond the declared fields. * * Internally, this wraps pi-ai's Model type. */ export interface CortexModel { /** @internal Brand tag for nominal type safety. */ readonly __brand: 'CortexModel'; /** Provider identifier (e.g., 'anthropic', 'openai', 'google'). */ readonly provider: string; /** Model identifier (e.g., 'claude-sonnet-4-20250514'). */ readonly modelId: string; /** Context window size in tokens. */ readonly contextWindow: number; } /** * Wrap a pi-ai Model object into a CortexModel. * * @param model - The pi-ai Model object to wrap * @param provider - The provider identifier * @param modelId - The model identifier * @param contextWindow - The context window size (default: 200000) * @returns An opaque CortexModel handle */ export declare function wrapModel(model: unknown, provider: string, modelId: string, contextWindow?: number): CortexModel; /** * Unwrap a CortexModel to retrieve the underlying pi-ai Model object. * * @param cortexModel - The CortexModel to unwrap * @returns The underlying pi-ai Model object * @throws Error if the object is not a valid CortexModel */ export declare function unwrapModel(cortexModel: CortexModel): unknown; /** * Check whether a value is a valid CortexModel (has the correct brand * and contains a wrapped inner model). * * @param value - The value to check * @returns True if the value is a valid CortexModel */ export declare function isCortexModel(value: unknown): value is CortexModel; //# sourceMappingURL=model-wrapper.d.ts.map