/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { type Content } from '@google/genai'; import { EmojiFilter } from '../filters/EmojiFilter.js'; import { Storage } from '../config/storage.js'; export declare enum MessageSenderType { USER = "user" } export interface LogEntry { sessionId: string; messageId: number; timestamp: string; type: MessageSenderType; message: string; } /** * Encodes a string to be safe for use as a filename. * * It replaces any characters that are not alphanumeric or one of `_`, `-`, `.` * with a URL-like percent-encoding (`%` followed by the 2-digit hex code). * * @param str The input string to encode. * @returns The encoded, filename-safe string. */ export declare function encodeTagName(str: string): string; /** * Decodes a string that was encoded with the `encode` function. * * It finds any percent-encoded characters and converts them back to their * original representation. * * @param str The encoded string to decode. * @returns The decoded, original string. */ export declare function decodeTagName(str: string): string; export declare class Logger { private readonly storage; private llxprtDir; private logFilePath; private sessionId; private messageId; private initialized; private logs; constructor(sessionId: string, storage: Storage); private _readLogFile; private _backupCorruptedLogFile; initialize(): Promise; private _updateLogFile; getPreviousUserMessages(): Promise; logMessage(type: MessageSenderType, message: string): Promise; private _checkpointPath; private _getCheckpointPath; saveCheckpoint(conversation: Content[], tag: string, context?: object): Promise; loadCheckpoint(tag: string, emojiFilter?: EmojiFilter): Promise<{ history: Content[]; context?: object; }>; deleteCheckpoint(tag: string): Promise; checkpointExists(tag: string): Promise; close(): void; }