One room per project for everyone in it, held by a few worker_threads, each room with a replica of the document that Hocuspocus' direct connection keeps open: changes go in, what the room writes comes back. /sim?project=... signs in as /sync does and says refusals and partings as the socket's closing; only a write grant changes the room. The state names who started the simulation. After the last person the room stays 60 s, then stops, writes back and ends. Freezing stops a running simulation and refuses to start one, deleting ends the room without writing back, revoking lets the person go from the room too; a failed thread ends its rooms, stopping the service stops them all. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
31 lines
903 B
JSON
31 lines
903 B
JSON
{
|
|
"name": "@mdg-filius/server",
|
|
"version": "0.0.0",
|
|
"private": true,
|
|
"license": "GPL-3.0-only",
|
|
"type": "module",
|
|
"exports": {
|
|
".": "./src/index.ts"
|
|
},
|
|
"scripts": {
|
|
"build": "esbuild src/main.ts src/simWorker.ts --bundle --platform=node --format=esm --target=node20 --outdir=dist --out-extension:.js=.mjs --external:pg-native --banner:js=\"import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);\"",
|
|
"start": "node dist/main.mjs"
|
|
},
|
|
"dependencies": {
|
|
"@hocuspocus/server": "3.4.4",
|
|
"@mdg-filius/core": "0.0.0",
|
|
"@mdg-filius/doc": "0.0.0",
|
|
"@mdg-filius/protocol": "0.0.0",
|
|
"@mdg-filius/sim": "0.0.0",
|
|
"pg": "8.23.1",
|
|
"ws": "8.22.0",
|
|
"y-protocols": "1.0.6",
|
|
"yjs": "^13.6.33"
|
|
},
|
|
"devDependencies": {
|
|
"@hocuspocus/provider": "3.4.4",
|
|
"@types/pg": "8.23.1",
|
|
"@types/ws": "8.18.2"
|
|
}
|
|
}
|