MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / getPreview

Function getPreview

server/src/creative-agent/preview-store.ts:28–36  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

26}
27
28export function getPreview(id: string): string | null {
29 const entry = store.get(id);
30 if (!entry) return null;
31 if (Date.now() > entry.expiresAt) {
32 store.delete(id);
33 return null;
34 }
35 return entry.html;
36}
37
38export function cleanExpiredPreviews(): void {
39 const now = Date.now();

Callers 2

Calls 3

nowMethod · 0.80
deleteMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected