@promptbook/remote-server
Version:
Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action
40 lines (39 loc) • 1.61 kB
TypeScript
import type { ChatParticipant } from '../types/ChatParticipant';
import type { ParsedCitation } from './parseCitationsFromContent';
/**
* Returns whether the provided value is a valid HTTP(S) URL.
*
* @param value - Candidate string to inspect.
* @returns True when the value parses as an HTTP or HTTPS URL.
*
* @private utility of `<Chat/>` citation rendering
*/
export declare function isCitationUrl(value: string): boolean;
/**
* Determines whether a citation should be displayed as a text snippet instead of a file/URL.
*
* @param citation - Parsed citation metadata.
* @returns True when the citation looks like inline text instead of a document or URL.
*
* @private utility of `<Chat/>` citation rendering
*/
export declare function isPlainTextCitation(citation: ParsedCitation): boolean;
/**
* Builds a label that matches the desired chip/modal title for a citation.
*
* @param citation - Parsed citation metadata.
* @returns The friendly label shown on chips and modal headers.
*
* @private utility of `<Chat/>` citation rendering
*/
export declare function getCitationLabel(citation: ParsedCitation): string;
/**
* Resolves the preview URL used inside the citation modal iframe.
*
* @param citation - Parsed citation metadata.
* @param participants - Known chat participants for agent knowledge lookup.
* @returns URL string suitable for iframe preview or null when unavailable.
*
* @private utility of `<Chat/>` citation rendering
*/
export declare function resolveCitationPreviewUrl(citation: ParsedCitation, participants: ReadonlyArray<ChatParticipant>): string | null;