poses: read labels only from the catalogue; add a client-status pose line
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>
This commit is contained in:
parent
6411266092
commit
a1101e90a6
94 changed files with 441 additions and 38 deletions
24
scripts/sync-poses.mjs
Normal file
24
scripts/sync-poses.mjs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
// 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}`);
|
||||
Loading…
Reference in a new issue