teodor-new-chat-ui 4.3.183 → 4.3.190
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.
- package/dist/context/hooks/useCheckpointMetadataCache.d.ts +23 -0
- package/dist/index.esm.js +2468 -2436
- package/dist/index.umd.js +33 -33
- package/dist/lib/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useCheckpointMetadataCache
|
|
3
|
+
*
|
|
4
|
+
* Custom hook for managing checkpoint metadata cache per thread.
|
|
5
|
+
* Enables efficient checkpoint restoration without refetching metadata.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* const { cache, getCachedMetadata, setCacheForThread } = useCheckpointMetadataCache();
|
|
9
|
+
*/
|
|
10
|
+
export interface CachedCheckpointMetadata {
|
|
11
|
+
checkpointId: string;
|
|
12
|
+
checkpointNs?: string;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function useCheckpointMetadataCache(): {
|
|
16
|
+
cache: Map<string, CachedCheckpointMetadata[]>;
|
|
17
|
+
setCacheForThread: (threadId: string, metadata: CachedCheckpointMetadata[]) => void;
|
|
18
|
+
getCachedMetadata: (threadId: string, checkpointId: string) => CachedCheckpointMetadata | undefined;
|
|
19
|
+
checkpointExists: (threadId: string, checkpointId: string) => boolean;
|
|
20
|
+
getThreadMetadata: (threadId: string) => CachedCheckpointMetadata[] | undefined;
|
|
21
|
+
clearThreadCache: (threadId: string) => void;
|
|
22
|
+
clearAllCache: () => void;
|
|
23
|
+
};
|