The client's own SHARED_POSES/MIND_POSES lists and the committed webp art are gone. catalogue.json (cast-art poses/catalogue.json, synced by npm run sync:poses) is the only list of Minds, labels and art paths. RoomViewPoseStatus draws "Ratatoskr: <Mind> is <pose>, since HH:MM" from the loaded timeline; it is never sent to a room. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
24 lines
998 B
JavaScript
24 lines
998 B
JavaScript
// Copies the pose catalogue and the art it names from the cast-art directory.
|
|
// The catalogue is the only list of poses the client knows; the art is not committed.
|
|
import { copyFileSync, mkdirSync, readFileSync } from 'node:fs';
|
|
import { dirname, join } from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
const src = process.argv[2] ?? '/opt/commons/cast-art/poses';
|
|
const root = join(dirname(fileURLToPath(import.meta.url)), '..');
|
|
const catalogue = JSON.parse(readFileSync(join(src, 'catalogue.json'), 'utf8'));
|
|
|
|
copyFileSync(
|
|
join(src, 'catalogue.json'),
|
|
join(root, 'src/app/components/message/pose/catalogue.json')
|
|
);
|
|
const files = Object.values(catalogue.minds).flatMap((m) => [
|
|
...Object.values(m.shared),
|
|
...Object.values(m.signatures),
|
|
]);
|
|
files.forEach((f) => {
|
|
const dest = join(root, 'public/poses', f);
|
|
mkdirSync(dirname(dest), { recursive: true });
|
|
copyFileSync(join(src, f), dest);
|
|
});
|
|
console.log(`synced catalogue and ${files.length} images from ${src}`);
|