/** * ProfileStore (v2.18 + v2.19 cipher support) * * SQLite-backed CRUD for profile definitions. Uses v2.16 multi-backend SQLite, * and transparently switches to SQLCipher when a non-empty `cipherKey` is * passed to the constructor (v2.19). */ import type { Profile, ProfileInput } from './profile-manager.js'; export interface ProfileStoreOptions { /** * v2.19: SQLCipher key for transparent encryption of the entire * profiles.db. Undefined/empty → plaintext (v2.18 behavior). * Caller is responsible for sourcing this from a safe location * (env var, OS keyring, etc.). */ cipherKey?: string; } export declare class ProfileStore { readonly dbPath: string; private conn; private initPromise; private cipherKey?; private _encrypted; /** v2.19: true after init() once the backend is known to be SQLCipher. */ get encrypted(): boolean; constructor(dbPath: string, options?: ProfileStoreOptions); private init; create(input: ProfileInput, createdBy?: string): Promise; /** * v5.0.0: save() is a deprecated alias for create(). Existing callers (unit tests, * external consumers) keep working without changes. New code should use create() * to make the INSERT-only semantic visible at the call site. */ save(input: ProfileInput, createdBy?: string): Promise; /** * v5.0.0: 修改已存在的 profile(只 UPDATE,profile 名不存在则抛错)。 * 注意:profile 名是 primary key,但通常不会改 name(改了所有引用都失效)。 * use_count / created_at / created_by / id 不变。 */ update(input: ProfileInput): Promise; list(filter?: { role?: string; tag?: string; enabled?: boolean; }): Promise; get(name: string): Promise; delete(name: string): Promise; setEnabled(name: string, enabled: boolean): Promise; incrementUseCount(name: string): Promise; close(): Promise; /** * v2.20: rotate the cipher key of profiles.db. * Atomically re-encrypts all rows under the new key. * The store's existing connection is closed before rotation and reopened * with `newKey` after success. */ rotateKey(newKey: string): Promise; private queryAll; private rowToProfile; } //# sourceMappingURL=profile-store.d.ts.map