Seed phone + merit nodes (and NPC contacts) via the graph seeder
authorGraph now seeds merit nodes' awards_flag and phone-node terminals bound to an NPC (npc key -> npc_id, the callee dialed); authorMystery seeds cast phone_number/email. Importer types updated so mystery.json can carry these, matching how Glass Harbour is seeded — the Barricelli graph can now be authored as data. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -32,7 +32,7 @@ export type PlaythroughAdvanceResult = {
|
||||
export type MysteryAuthoring = {
|
||||
slug: string
|
||||
title: string
|
||||
cast: { key: string; name: string; role?: string; defaultPose?: string; poses?: { poseKey: string; assetId: string }[] }[]
|
||||
cast: { key: string; name: string; role?: string; defaultPose?: string; phoneNumber?: string; email?: string; poses?: { poseKey: string; assetId: string }[] }[]
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -212,8 +212,8 @@ export function createNarrativeRepository(pool: Pool, objectStorage: ObjectStora
|
||||
const existing = await client.query('SELECT 1 FROM osint.npcs WHERE npc_key=$1 AND mystery_id IS NULL', [npc.key])
|
||||
if (existing.rows[0]) continue
|
||||
const npcId = randomUUID()
|
||||
await client.query('INSERT INTO osint.npcs (id,mystery_id,npc_key,name,role,default_pose_key) VALUES ($1,NULL,$2,$3,$4,$5)',
|
||||
[npcId, npc.key, npc.name, npc.role || '', npc.defaultPose || null])
|
||||
await client.query('INSERT INTO osint.npcs (id,mystery_id,npc_key,name,role,default_pose_key,phone_number,email) VALUES ($1,NULL,$2,$3,$4,$5,$6,$7)',
|
||||
[npcId, npc.key, npc.name, npc.role || '', npc.defaultPose || null, npc.phoneNumber || null, npc.email || null])
|
||||
for (const pose of npc.poses || []) await client.query(
|
||||
'INSERT INTO osint.npc_poses (id,npc_id,pose_key,asset_id) VALUES ($1,$2,$3,$4)', [randomUUID(), npcId, pose.poseKey, pose.assetId])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user