/** * Subject Store — SDK-managed identity selection & namespaced cache * --------------------------------------------------------------- * - Keeps track of the current subject (opaque id + metadata) * - Namespaces grant/audit/session caches per subject * - Provides TTL-aware get/set/del on top of any async key-value storage * - Emits 'subject_changed' so apps/agents can react */ export type Subject = { id: string; displayName?: string; avatarUrl?: string; subject?: string; }; export type AsyncKV = { get(key: string): Promise; set(key: string, val: string, ttlSec?: number): Promise; del(key: string): Promise; }; export declare class SubjectStore { private kv; private emitter; private current; private keySubjects; private keyCurrent; constructor(kv: AsyncKV); onSubjectChanged(cb: (s: Subject | null) => void): () => void; getSubject(): Promise; setSubject(subject: Subject): Promise; ensureSubject(pick: () => Promise): Promise; switchSubject(id: string): Promise; listSubjects(): Promise; saveSubject(s: Subject): Promise; removeSubject(id: string): Promise; nsKey(subjId: string, key: string): string; nsGet(subjId: string, key: string): Promise; nsSet(subjId: string, key: string, val: string, ttlSec?: number): Promise; nsDel(subjId: string, key: string): Promise; curGet(key: string): Promise; curSet(key: string, val: string, ttlSec?: number): Promise; curDel(key: string): Promise; private setCurrent; private getSubjectById; } //# sourceMappingURL=subject-store.d.ts.map