import type { Message, MessagePlugin, TokenEstimator } from './types'; /** * Environment functions for conversation operations. * Allows dependency injection for testing and custom ID generation. */ export interface ConversationEnvironment { now: () => string; randomId: () => string; estimateTokens: TokenEstimator; plugins: MessagePlugin[]; } /** * Simple character-based token estimator. * Approximates ~4 characters per token (rough average for English text). */ export declare function simpleTokenEstimator(message: Message): number; /** * Default environment using Date.toISOString(), crypto.randomUUID(), and simple token estimation. */ export declare const defaultConversationEnvironment: ConversationEnvironment; /** * Merges a partial environment with defaults. * Returns a complete environment with all required functions. */ export declare function resolveConversationEnvironment(environment?: Partial): ConversationEnvironment; /** * Type guard to distinguish environment objects from message inputs. * Returns true if the value has environment functions but no role property. */ export declare function isConversationEnvironmentParameter(value: unknown): value is Partial; /** * Binds a partial environment to a function that accepts an environment as its last argument. */ export declare function withEnvironment(environment: Partial, fn: (...args: [...T, Partial?]) => R): (...args: T) => R; //# sourceMappingURL=environment.d.ts.map