@promptbook/remote-server
Version:
Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action
57 lines (56 loc) • 1.7 kB
TypeScript
/**
* Normalizes a JSON string so it can be safely rendered without double escaping.
*
* @param value Candidate JSON string.
*
* @private function of ParameterEscaping
*/
declare function normalizeJsonString(value: string): string | null;
/**
* Hides brackets in a string to avoid confusion with template parameters.
*
* @param value Input string with literal brackets.
*
* @private function of ParameterEscaping
*/
declare function hideBrackets(value: string): string;
/**
* Restores hidden brackets.
*
* @param value String with hidden brackets.
*
* @private function of ParameterEscaping
*/
declare function restoreBrackets(value: string): string;
/**
* Decides whether a parameter can be inlined safely.
*
* @param value Parameter rendered as string.
*
* @private function of ParameterEscaping
*/
declare function shouldInlineParameterValue(value: string): boolean;
/**
* Escapes prompt parameter content to avoid breaking the template structure.
*
* @param value Parameter value to escape.
* @param options Escape options for additional characters.
*
* @private function of ParameterEscaping
*/
declare function escapePromptParameterValue(value: string, options: {
includeBraces: boolean;
}): string;
/**
* Collection of utilities that keep prompt parameters safe during interpolation.
*
* @private helper of prompt notation
*/
export declare const ParameterEscaping: {
normalizeJsonString: typeof normalizeJsonString;
hideBrackets: typeof hideBrackets;
restoreBrackets: typeof restoreBrackets;
shouldInlineParameterValue: typeof shouldInlineParameterValue;
escapePromptParameterValue: typeof escapePromptParameterValue;
};
export {};