teodor-new-chat-ui 4.3.20 → 4.3.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,10 @@
1
+ import type { HydratedCheckpointSnapshot } from '@/types/api';
2
+ export interface CachedThreadEntry {
3
+ threadId: string;
4
+ snapshot: HydratedCheckpointSnapshot | null;
5
+ }
6
+ export declare function makeMessageCacheKey(prefix: string, threadId: string): string;
7
+ export declare function loadCachedThreadEntry(prefix: string, threadId: string): CachedThreadEntry | null;
8
+ export declare function saveCachedThreadEntry(prefix: string, entry: CachedThreadEntry, maxMessages?: number): void;
9
+ export declare function evictCachedThreadEntry(prefix: string, threadId: string): void;
10
+ export declare function clearAllMessageEntries(prefix: string): void;
@@ -0,0 +1,6 @@
1
+ import type { ChatMessage, HydratedCheckpointSnapshot, PendingInterrupt } from '@/types/api';
2
+ export declare function normalizeSnapshotInput(snapshot: HydratedCheckpointSnapshot | null | undefined, options?: {
3
+ cloneMessages?: boolean;
4
+ }): HydratedCheckpointSnapshot;
5
+ export declare function findLastInterrupt(messages: ChatMessage[]): PendingInterrupt;
6
+ export declare function interruptsEqual(a: PendingInterrupt, b: PendingInterrupt): boolean;
@@ -0,0 +1,6 @@
1
+ export declare const CACHE_SAVE_DEBOUNCE_MS = 300;
2
+ export declare function scheduleIdle(cb: () => void, timeout?: number): void;
3
+ export declare function canUseStorage(): boolean;
4
+ export declare function safeGetItem(key: string): string | null;
5
+ export declare function safeSetItem(key: string, value: string): void;
6
+ export declare function safeRemoveItem(key: string): void;
@@ -0,0 +1,16 @@
1
+ import type { ThreadSummary } from '@/types/api';
2
+ export declare const THREAD_CACHE_KEY = "cachedThreads";
3
+ export declare const MESSAGE_CACHE_VERSION = "v1";
4
+ export declare const MAX_CACHED_THREADS = 200;
5
+ export type ThreadsStore = {
6
+ byId: Record<string, ThreadSummary>;
7
+ order: string[];
8
+ };
9
+ export declare function hashString(str: string): string;
10
+ export declare function makeThreadCacheKey(baseHost: string, token?: string | null): string;
11
+ export declare function loadCachedThreads(): ThreadSummary[];
12
+ export declare function loadCachedThreadsByKey(key: string): ThreadSummary[];
13
+ export declare function persistThreadsByKey(key: string, threads: ThreadSummary[]): void;
14
+ export declare function migrateLegacyThreadsIfNeeded(scopedKey: string): ThreadSummary[];
15
+ export declare function buildStoreFromArray(arr: ThreadSummary[]): ThreadsStore;
16
+ export declare function storeToArray(store: ThreadsStore): ThreadSummary[];