Soul Module
Export, import, and list portable NPC souls via API-backed thunks
The current SDK exposes Soul workflows through thunks and CLI commands.
Export, import, and list portable NPC souls via API-backed thunks
The current SDK exposes Soul workflows through thunks and CLI commands.
1 import { createSDKStore, setNPCInfo, remoteExportSoulThunk } from '@forbocai/core'; 2 3 const store = createSDKStore(); 4 5 store.dispatch(setNPCInfo({ id: 'npc_1', persona: 'A careful merchant' })); 6 7 const exported = await store.dispatch(remoteExportSoulThunk({ 8 npcId: 'npc_1', 9 apiUrl: 'https://api.forboc.ai', 10 apiKey: process.env.FORBOCAI_API_KEY 11 })).unwrap(); 12 13 console.log(exported.txId, exported.url);
1 import { importSoulFromArweaveThunk } from '@forbocai/core'; 2 3 const soul = await store.dispatch(importSoulFromArweaveThunk({ 4 txId: 'arweave_tx_id_here', 5 apiUrl: 'https://api.forboc.ai', 6 apiKey: process.env.FORBOCAI_API_KEY 7 })).unwrap(); 8 9 console.log(soul.name, soul.persona);
1 import { getSoulListThunk } from '@forbocai/core'; 2 3 const souls = await store.dispatch(getSoulListThunk({ 4 limit: 20, 5 apiUrl: 'https://api.forboc.ai', 6 apiKey: process.env.FORBOCAI_API_KEY 7 })).unwrap(); 8 9 console.log(souls.length);
$ npx forbocai soul export <npcId> $ npx forbocai soul import <txId-or-local-json-file> $ npx forbocai soul list 20 $ npx forbocai soul chat <npcId>