/** * OS Keychain Integration * * macOS: `security` CLI (Keychain Services) * Linux: `secret-tool` CLI (libsecret) * Fallback: null (config.json 평문 유지) * * 외부 의존성 없이 OS CLI만 사용합니다. */ /** * #145 (적대 검증 2R-M2 / 3R-M1) — 키체인 호출 상한. * * 🔴 왜 필요한가: `#145` fix 로 평문 키가 config 에서 사라지면 `load()` 의 `if (!apiKey)` 단락이 * 풀려 **6개 훅 전부**가 이 경로를 탄다(PostToolUse 는 도구 호출마다). 잠긴 키체인에서는 macOS 가 * 승인 프롬프트를 띄우고 `execFileSync` 가 **무한 대기**한다 — 이 파일의 `getKeychainStore()` 주석이 * 기록한 사고(*"CI/백그라운드에서 무한 대기 … 3회 재현"*)가 정확히 그것이다. * * 🔴 `.get` 만 걸면 안 닫힌다(3R-M1): `isAvailable`/`set`/`delete` 와 `security help` 도 * 같은 프로세스를 띄운다. 열거가 아니라 **전 사이트 공유 상수**로 둔다. */ export declare const KEYCHAIN_TIMEOUT_MS = 2000; export interface KeychainStore { get(account: string): string | null; set(account: string, password: string): boolean; delete(account: string): boolean; isAvailable(): boolean; } /** * macOS Keychain (security CLI) */ declare class MacOSKeychain implements KeychainStore { isAvailable(): boolean; get(account: string): string | null; set(account: string, password: string): boolean; delete(account: string): boolean; } /** * Linux Secret Service (secret-tool CLI) */ declare class LinuxKeychain implements KeychainStore { isAvailable(): boolean; get(account: string): string | null; set(account: string, password: string): boolean; delete(account: string): boolean; } /** * Fallback (항상 null 반환 — config.json 평문 사용) */ declare class NoOpKeychain implements KeychainStore { isAvailable(): boolean; get(_account: string): string | null; set(_account: string, _password: string): boolean; delete(_account: string): boolean; } /** * 플랫폼에 맞는 KeychainStore 생성 */ export declare function createKeychainStore(): KeychainStore; export declare function getKeychainStore(): KeychainStore; export declare function resetKeychainStore(): void; export { MacOSKeychain, LinuxKeychain, NoOpKeychain }; //# sourceMappingURL=keychain.d.ts.map