feat: support freeform persona initialization seeds

This commit is contained in:
2026-05-11 17:47:12 +09:00
parent 5be64756ac
commit 202d9316a5
4 changed files with 66 additions and 6 deletions

View File

@@ -53,6 +53,32 @@ describe('initializePersona', () => {
expect(facts.map((fact) => fact.statement)).toContain('Minji grew up near the sea.');
});
it('accepts a single freeform persona seed string and forwards it to the biography generation step', async () => {
const db = await createDb();
const prompts: string[] = [];
const structured = createStructuredAdapter(prompts);
const seedText =
'Mina is 29, grew up in Busan, moved to Seoul for product design work, values loyalty and quiet consistency, loves indie music and late-night walks, dislikes loud restaurants, and is very close to her older brother Jisoo.';
const persona = await initializePersona(db, {
id: 'mina',
displayName: 'Mina',
seedText,
currentDate: '2026-05-11',
structuredModel: structured,
});
expect(persona).toMatchObject({
id: 'mina',
displayName: 'Mina',
spaceName: 'persona:mina',
});
expect(prompts[0]).toContain('Freeform persona seed');
expect(prompts[0]).toContain(seedText);
expect(prompts[0]).toContain('infer personality, history, values, likes, dislikes, and relationships');
expect(prompts[0]).toContain('Current date: 2026-05-11');
});
it('does not call the image adapter unless a profile image is requested', async () => {
const db = await createDb();
const structured = createStructuredAdapter([]);