@gguf/claw
Version:
Multi-channel AI gateway with extensible messaging integrations
43 lines (42 loc) • 2.15 kB
TypeScript
import type { SessionPreviewItem } from "./session-utils.types.js";
type SessionTitleFields = {
firstUserMessage: string | null;
lastMessagePreview: string | null;
};
export declare function readSessionMessages(sessionId: string, storePath: string | undefined, sessionFile?: string): unknown[];
export declare function resolveSessionTranscriptCandidates(sessionId: string, storePath: string | undefined, sessionFile?: string, agentId?: string): string[];
export type ArchiveFileReason = "bak" | "reset" | "deleted";
export declare function archiveFileOnDisk(filePath: string, reason: ArchiveFileReason): string;
/**
* Archives all transcript files for a given session.
* Best-effort: silently skips files that don't exist or fail to rename.
*/
export declare function archiveSessionTranscripts(opts: {
sessionId: string;
storePath: string | undefined;
sessionFile?: string;
agentId?: string;
reason: "reset" | "deleted";
}): string[];
export declare function cleanupArchivedSessionTranscripts(opts: {
directories: string[];
olderThanMs: number;
reason?: "deleted";
nowMs?: number;
}): Promise<{
removed: number;
scanned: number;
}>;
export declare function capArrayByJsonBytes<T>(items: T[], maxBytes: number): {
items: T[];
bytes: number;
};
export declare function readSessionTitleFieldsFromTranscript(sessionId: string, storePath: string | undefined, sessionFile?: string, agentId?: string, opts?: {
includeInterSession?: boolean;
}): SessionTitleFields;
export declare function readFirstUserMessageFromTranscript(sessionId: string, storePath: string | undefined, sessionFile?: string, agentId?: string, opts?: {
includeInterSession?: boolean;
}): string | null;
export declare function readLastMessagePreviewFromTranscript(sessionId: string, storePath: string | undefined, sessionFile?: string, agentId?: string): string | null;
export declare function readSessionPreviewItemsFromTranscript(sessionId: string, storePath: string | undefined, sessionFile: string | undefined, agentId: string | undefined, maxItems: number, maxChars: number): SessionPreviewItem[];
export {};