/** * Hook 공유 유틸리티 * 프로세스 내 DB 싱글톤으로 중복 초기화 방지 */ import { MemoryDatabase } from '../db/database.js'; /** * 프로세스 내 DB 싱글톤 조회/생성 */ export declare function getSharedDb(dbPath: string): MemoryDatabase; /** * DB 종료 (프로세스 종료 시 호출) */ export declare function closeSharedDb(): void; /** * 테스트용 리셋 */ export declare function resetSharedDb(): void; /** * Claude Code stdin 입력을 내부 camelCase 형식으로 변환 * * Claude Code는 snake_case로 전송: * session_id, hook_event_name, tool_name, tool_input, tool_response, cwd, transcript_path * Plugin 내부는 camelCase 사용: * sessionId, hookName, toolName, toolInput, toolResult, projectPath, cwd */ export declare function normalizeHookInput(raw: Record): Record; /** * ADR-019: 주입된 메모리별 keyword 맵 구성. * 매칭 시 어떤 memory가 활용됐는지 역추적하기 위해 memory_id → keywords 형태로 저장. * * 규칙 (salient term 방식 — 서두 위치 5토큰 → 빈도 상위 5): * - content를 소문자화 + 구두점/공백 분리 (file: → file) * - length > 3 + 불용어(STOP_WORDS) + 보일러플레이트(KEYWORD_BOILERPLATE) 제거 * - 빈도(TF) 상위 5개 salient term 선택 (위치 무관) * - memory_id가 없는 항목은 스킵 (방어) * * Why: 기존 "앞 5토큰"은 자동 캡처 메모리 서두("File: /path", "tool: edit result:")가 * keyword가 되어 hit 판정이 문자열 우연 일치로 붕괴(effectiveness 2%). salient term은 * 메모리 본문의 실제 주제어를 뽑아 매칭 정밀도를 높인다. */ export declare function buildMemoryKeywordMap(memories: Array<{ memory: { id: string; content: string; }; }>): Record; /** * ADR-019: injected_keywords JSON 파싱. * 레거시(flat array) vs 신규(map) 포맷 자동 판별. * * @returns { isMap: boolean, data: string[] | Record } */ export declare function parseInjectedKeywords(raw: string | null | undefined): { isMap: false; keywords: string[]; } | { isMap: true; keywordMap: Record; }; export declare function extractSearchKeywords(prompt: string): string; //# sourceMappingURL=shared.d.ts.map