/** * Session Parts - Components within a session * * Manages context, memory, and tools within sessions. */ /** * Part type */ export type SessionPartType = 'context' | 'memory' | 'tool' | 'history' | 'metadata' | 'custom'; /** * Session part */ export interface SessionPart { id: string; type: SessionPartType; name: string; data: T; createdAt: number; updatedAt: number; metadata?: Record; } /** * Parts manager configuration */ export interface SessionPartsConfig { /** Enable logging */ logging?: boolean; /** Max parts per type */ maxPartsPerType?: number; } /** * SessionParts - Manage session components */ export declare class SessionParts { readonly id: string; private parts; private byType; private config; constructor(config?: SessionPartsConfig); /** * Add a part */ add(type: SessionPartType, name: string, data: T, metadata?: Record): SessionPart; /** * Get part by ID */ get(id: string): SessionPart | undefined; /** * Get part by name and type */ getByName(type: SessionPartType, name: string): SessionPart | undefined; /** * Get all parts by type */ getByType(type: SessionPartType): SessionPart[]; /** * Update part data */ update(id: string, data: Partial): boolean; /** * Replace part data */ replace(id: string, data: T): boolean; /** * Remove part */ remove(id: string): boolean; /** * Remove all parts of a type */ removeByType(type: SessionPartType): number; /** * Clear all parts */ clear(): void; /** * Get all parts */ getAll(): SessionPart[]; /** * Get stats */ getStats(): { total: number; byType: Record; }; /** * Export parts */ export(): SessionPart[]; /** * Import parts */ import(parts: SessionPart[]): void; /** * Add context part */ addContext(name: string, data: any): SessionPart; /** * Add memory part */ addMemory(name: string, data: any): SessionPart; /** * Add tool part */ addTool(name: string, data: any): SessionPart; /** * Get context parts */ getContext(): SessionPart[]; /** * Get memory parts */ getMemory(): SessionPart[]; /** * Get tool parts */ getTools(): SessionPart[]; } /** * Create session parts manager */ export declare function createSessionParts(config?: SessionPartsConfig): SessionParts; export default SessionParts;