Skip to content

Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.

622 B
Raw Blame
export interface MemorySubjectDescriptor {
  agentManagementId: string;
  agentActorId: string;
  agentDisplayName: string;
  representedHumanActorId: string;
  representedHumanDisplayName: string;
  userProfileRevisionId?: string;
  userProfileMarkdown?: string;
}

export function memorySubjectKey(subject: MemorySubjectDescriptor): string {
  return assertSafeMemorySubjectKey(subject.agentManagementId);
}

export function assertSafeMemorySubjectKey(subjectKey: string): string {
  if (!/^[A-Za-z0-9_-]+$/.test(subjectKey)) {
    throw new Error(`Unsafe memory subject key: ${subjectKey}`);
  }
  return subjectKey;
}