/** * Prompt Retrieval Module * * Functions to retrieve prompts from the hazo_prompts database table. * Searches by prompt_area, prompt_key, and optional local filters. */ import type { Database as SqlJsDatabase } from 'sql.js'; import type { Logger, PromptRecord } from '../llm_api/types.js'; /** * Options for local filter fields when retrieving prompts */ export interface LocalFilterOptions { local_1?: string | null; local_2?: string | null; local_3?: string | null; } /** * Retrieve a prompt from the database by prompt_area and prompt_key * @param db - Database instance * @param prompt_area - Area/category of the prompt * @param prompt_key - Key identifier for the prompt * @param logger - Logger instance * @returns The prompt record if found, null otherwise */ export declare function get_prompt_by_area_and_key(db: SqlJsDatabase, prompt_area: string, prompt_key: string, logger: Logger): PromptRecord | null; /** * Retrieve a prompt from the database by prompt_area, prompt_key, and optional local filters * Uses fallback logic: tries most specific match first, then progressively less specific * * Fallback order: * 1. Exact match with all specified local filters * 2. Match with local_1 and local_2 only (if local_3 was specified) * 3. Match with local_1 only (if local_2 was specified) * 4. Match with no local filters (base prompt) * * @param db - Database instance * @param prompt_area - Area/category of the prompt * @param prompt_key - Key identifier for the prompt * @param locals - Optional local filter values * @param logger - Logger instance * @returns The prompt record if found, null otherwise */ export declare function get_prompt_by_area_key_and_locals(db: SqlJsDatabase, prompt_area: string, prompt_key: string, locals: LocalFilterOptions | null, logger: Logger): PromptRecord | null; /** * Retrieve the full prompt text only by prompt_area and prompt_key * Returns prompt_text_full (concatenation of head + body + tail) * @param db - Database instance * @param prompt_area - Area/category of the prompt * @param prompt_key - Key identifier for the prompt * @param logger - Logger instance * @returns The full prompt text if found, null otherwise */ export declare function get_prompt_text(db: SqlJsDatabase, prompt_area: string, prompt_key: string, logger: Logger): string | null; /** * Get all prompts by prompt_area * @param db - Database instance * @param prompt_area - Area/category of the prompts * @param logger - Logger instance * @returns Array of prompt records */ export declare function get_prompts_by_area(db: SqlJsDatabase, prompt_area: string, logger: Logger): PromptRecord[]; /** * Get a prompt by its ID (UUID) * @param db - Database instance * @param id - ID (UUID) of the prompt * @param logger - Logger instance * @returns The prompt record if found, null otherwise */ export declare function get_prompt_by_id(db: SqlJsDatabase, id: string, logger: Logger): PromptRecord | null; /** * Get all prompts from the library * @param db - Database instance * @param logger - Logger instance * @returns Array of all prompt records */ export declare function get_all_prompts(db: SqlJsDatabase, logger: Logger): PromptRecord[]; //# sourceMappingURL=get_prompt.d.ts.map