/** * The `cite://` notation: `[visible text](cite:///[#q=&n=&p=])`. * * Agents are taught (via prompt) to emit this scheme when citing a document they actually * retrieved. The lib only parses the shape — what a namespace means and how a citation is * resolved belongs to the host app through `ChatCitationsConfig`. The id is expected to be * an identifier the agent could only know from a real retrieval, so a citation that fails * to resolve is rendered as unverified instead of trusted. */ /** * Bare cite tokens in prose; markdown link targets (`](cite://...`) are left to the link * renderer. Unlike VAULT_REGEX, `_` is allowed: source namespaces use it (`stf_sumulas`). */ export declare const CITE_REGEX: RegExp; export type CitationLocator = { /** Exact term whose occurrence the citation points at, for in-document highlight. */ term?: string; /** 1-based nth occurrence of `term`; defaults to the first when absent. */ occurrence?: number; /** 1-based page at the original source; only meaningful for paginated originals. */ page?: number; }; export type CitationRef = { namespace: string; id: string; locator?: CitationLocator; raw: string; }; export declare function isCitationUrl(url: string): boolean; export declare function parseCitationUrl(url: string): CitationRef | null; /** Cache key for resolution state: the locator addresses a spot inside the same document. */ export declare function citationCacheKey(ref: Pick): string; /** * Rewrites bare `cite://` tokens into `[id](cite://...)` markdown links so they render inline * through the link node instead of splitting the surrounding paragraph into block segments. * Square brackets that only wrap a token are dropped, since the citation chip already reads as * a reference. */ export declare function linkifyBareCitations(text: string): string;