Files
archy/aiui/packages/app/scripts/generate-seed-chats.ts
T
archipelago 7ba3109b6d Add 'aiui/' from commit 'e30ac1d1069532fb6d652d87e2d4a2fe9d1b4773'
git-subtree-dir: aiui
git-subtree-mainline: 0c4826f8cc
git-subtree-split: e30ac1d106
2026-08-03 15:07:11 -04:00

21 lines
776 B
TypeScript

/**
* Generate .dev/chats.json from the seed prompt index.
* Run: pnpm -C packages/app exec tsx scripts/generate-seed-chats.ts
*/
import { seedPromptsToConversation } from '../src/__tests__/fixtures/seedPrompts'
import { writeFileSync, mkdirSync, existsSync } from 'fs'
import { resolve, dirname } from 'path'
const outPath = resolve(dirname(new URL(import.meta.url).pathname), '../.dev/chats.json')
const dir = dirname(outPath)
if (!existsSync(dir)) mkdirSync(dir, { recursive: true })
const conv = seedPromptsToConversation()
const data = {
conversations: { [conv.id]: conv },
activeConversationId: conv.id,
}
writeFileSync(outPath, JSON.stringify(data, null, 2), 'utf-8')
console.log(`Wrote seed conversation (${conv.messages.length / 2} prompts) to ${outPath}`)