clavarium 0.2.481-next.1 → 0.2.483-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.481-next.1",
3
+ "version": "0.2.483-next.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "clavarium",
9
- "version": "0.2.481-next.1",
9
+ "version": "0.2.483-next.1",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@xterm/addon-fit": "^0.11.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.481-next.1",
3
+ "version": "0.2.483-next.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "A conversation is a VM with a terminal in it. Everything else is a folder.",
@@ -1961,6 +1961,19 @@ export class Conversations {
1961
1961
  /* The conversations whose machine should be running: built, not asleep. */
1962
1962
  /* (Stopped by its owner: not running either, until somebody starts it.) */
1963
1963
  awake() { return this.#store.all().filter((c) => c.phase === 'ready' && c.asleep !== true && c.stopped !== true).map((c) => c.name); }
1964
+ /* Every machine running, its disk trimmed (vm.mjs trim), one machine at a time, a shared one once. */
1965
+ async trimAll() {
1966
+ const seen = new Set();
1967
+ for (const name of this.awake()) {
1968
+ const vm = this.#vms.vmOf?.(name) ?? name;
1969
+ if (seen.has(vm)) continue;
1970
+ seen.add(vm);
1971
+ if ((await this.#vms.state(name).catch(() => undefined)) !== 'Running') continue;
1972
+ await this.#trim(name);
1973
+ }
1974
+ }
1975
+ /* Before a stop or a sleep: what it erased given back first, never holding the stop up long. */
1976
+ async #trim(name, timeoutMs) { if (typeof this.#vms.trim !== 'function') return; await this.#vms.trim(name, timeoutMs).catch(() => undefined); }
1964
1977
  /* Put to sleep, and nothing else: not one being built (02-11: a reset machine was taken for a sleeper and
1965
1978
  suspended mid-build), not a failed one. */
1966
1979
  /* (One woken the time a copy reads it -- #borrowed -- is not asleep then: its memory is never "reclaimed" under it.) */
@@ -2171,6 +2184,7 @@ export class Conversations {
2171
2184
  this.#plan(name, act, ['suspend']);
2172
2185
  this.drop(name);
2173
2186
  act.ctl = new AbortController();
2187
+ await this.#trim(name, 60_000);
2174
2188
  const r = await this.#vms.suspend(name, { signal: act.ctl.signal, onLine: (line) => this.#seen(name, act, line) });
2175
2189
  if (r.aborted) result = { ok: false, preempted: true };
2176
2190
  else {
@@ -2285,12 +2299,13 @@ export class Conversations {
2285
2299
  has its tool, a screen or an action: then only this one's programs end, the others go on. */
2286
2300
  async #stopUnlessShared(name) {
2287
2301
  const shared = this.#store.get(name)?.sharedMachine;
2288
- if (!shared) return this.#vms.stop(name);
2302
+ if (!shared) { await this.#trim(name, 60_000); return this.#vms.stop(name); }
2289
2303
  for (const other of this.#store.all().filter((x) => x.name !== name && x.sharedMachine === shared)) {
2290
2304
  if (this.#watching.has(other.name) || this.#acts.has(other.name) || this.#timers.has(other.name)) return this.#endShared(name);
2291
2305
  const alive = await this.#vms.exec(other.name, ['tmux', '-L', SOCKET, 'has-session', '-t', `=${SESSION}`]).catch(() => ({ code: 1 }));
2292
2306
  if (alive.code === 0) return this.#endShared(name);
2293
2307
  }
2308
+ await this.#trim(name, 60_000);
2294
2309
  return this.#vms.stop(name);
2295
2310
  }
2296
2311
  #endShared(name) { return this.#vms.execMachine(name, ['sudo', '-n', 'pkill', '-KILL', '-u', `c-${name}`], { timeoutMs: STEP_MS }).catch(() => undefined); }
@@ -97,11 +97,24 @@ exit "$status"`;
97
97
  // eslint-disable-next-line no-control-regex
98
98
  const printable = (text) => String(text ?? '').replace(/\x1b\[[0-9;?]*[A-Za-z]/g, '').replace(/[\u0000-\u0008\u000B-\u001F\u007F]/gu, '').slice(-OUTPUT_MAX);
99
99
 
100
+ /* The agents' copies brought up to date at most so many at a time, across every repository: each is a
101
+ sudo and a `vm exec` on the host, and the keeper's tick reads its repositories side by side -- after a
102
+ start, every reference is due at once, and one fetch per repository and machine (48 seen in a few
103
+ seconds, 17-11) held up the host while the new server was watched for its answer. */
104
+ export const FETCHES_AT_ONCE = 2;
105
+
100
106
  export class GitChecks {
101
- #vms; #conversations; #resources; #now;
107
+ #vms; #conversations; #resources; #now; #free; #waiting = [];
102
108
 
103
- constructor({ vms, conversations, resources, now = () => new Date() }) {
109
+ constructor({ vms, conversations, resources, now = () => new Date(), fetchesAtOnce = FETCHES_AT_ONCE }) {
104
110
  this.#vms = vms; this.#conversations = conversations; this.#resources = resources; this.#now = now;
111
+ this.#free = Math.max(1, fetchesAtOnce);
112
+ }
113
+ /* A place among the fetches running, waited for in turn; given back by the function it resolves to. */
114
+ async #slot() {
115
+ if (this.#free > 0) this.#free -= 1; else await new Promise((go) => this.#waiting.push(go));
116
+ let given = false;
117
+ return () => { if (given) return; given = true; const next = this.#waiting.shift(); if (next) next(); else this.#free += 1; };
105
118
  }
106
119
 
107
120
  /* A machine that runs and has the repository attached: one it may write
@@ -119,8 +132,9 @@ export class GitChecks {
119
132
  origin/* only: its branches, its files and what it left uncommitted are not touched.
120
133
  -> { ok, moved: [{ branch, upstream, from, to }] }: the branches it follows whose upstream moved. */
121
134
  async fetchIn(conversation, repository) {
135
+ const done = await this.#slot();
122
136
  const r = await this.#vms.exec(conversation, ['timeout', '-k', '10', '120', 'sh', '-c', FETCH_SCRIPT, 'clavarium-fetch', `/resources/${repository}`, `/resources/${originFolder(repository)}`], { timeoutMs: 180_000 })
123
- .catch(() => ({ code: -1, stdout: '' }));
137
+ .catch(() => ({ code: -1, stdout: '' })).finally(done);
124
138
  if (r.code !== 0) return { ok: false, moved: [] };
125
139
  const moved = String(r.stdout ?? '').split('\n').map((l) => l.trim().split(' ')).filter((x) => x.length === 4 && /^[0-9a-f]{40,64}$/.test(x[2]) && /^[0-9a-f]{40,64}$/.test(x[3]))
126
140
  .map(([branch, upstream, from, to]) => ({ branch: printable(branch), upstream: printable(upstream), from, to }));
package/server/main.mjs CHANGED
@@ -788,6 +788,8 @@ export async function startHome({ port, host, dataDir, mntDir = dataDir, gitRese
788
788
  for (const name of all.awake()) { const now = await secrets.reconcile(name, delivered.get(name)).catch(() => null); if (now !== null) delivered.set(name, now); }
789
789
  };
790
790
  const secretsTimer = setInterval(() => { void secretsGuard().catch(() => {}); }, 60_000); secretsTimer.unref?.();
791
+ /* The machines' disks give back what was erased, every hour (conversations.trimAll, vm.mjs trim). */
792
+ const trimTimer = setInterval(() => { void all.trimAll().catch(() => {}); }, 60 * 60_000); trimTimer.unref?.();
791
793
  /* The certificate the front serves, said in Settings (certificate.mjs). */
792
794
  const certificate = new Certificate({ origin: publicOrigin, alerts });
793
795
  /* All the machines to another disk, from Settings (machinesmove.mjs). */
@@ -924,7 +926,7 @@ export async function startHome({ port, host, dataDir, mntDir = dataDir, gitRese
924
926
  screen: await quick(screenNow(), 1500, null), catalogue: await quick(catalogue.providers().catch(() => []), 1500, []),
925
927
  }) });
926
928
  const { server, listening } = serve(port, all, folders, { gate, originOk, shortcuts, voice, sharing, door, secrets, network, signin, mailboxes, gitReview, platform, answerer, wakeups, alerts, talk, gitAccess, gitKeeper, shelf, health, setup, guide, capacity, updates, instance, certificate, team, reacting, machinesMove, serverLogs, history, events, wifi, binders, meshcentral, tethers, accounts, groups, boxes, catalogue, rooms, machineList, features, desks: new Desks({ file: new JsonFile(`${dataDir}/desktops.json`, {}) }), apikeys, relayJoin: host.length ? new RelayJoin({ host: asHost }) : null, bundles: new Bundles({ dir: `${dataDir}/imports`, folder: (name) => folders.folder(name) }), repair: (name) => repairTerminal(name) });
927
- server.on('close', () => { closing = true; stopBinders(); stopTethers(); clearInterval(historyTimer); clearInterval(secretsTimer); history.save(); stopVmWatch(); stopShelf(); stopHealth(); stopNetworkWatch(); stopUpdates(); stopWatch(); clearInterval(mailTimer); clearInterval(restartTimer); clearInterval(expiryTimer); clearInterval(answerTimer); clearInterval(wakeTimer); clearInterval(docketTimer); clearInterval(stopSigninHelp); dockets.stop(); clearInterval(gitTimer); talk.stop(); });
929
+ server.on('close', () => { closing = true; stopBinders(); stopTethers(); clearInterval(historyTimer); clearInterval(secretsTimer); clearInterval(trimTimer); history.save(); stopVmWatch(); stopShelf(); stopHealth(); stopNetworkWatch(); stopUpdates(); stopWatch(); clearInterval(mailTimer); clearInterval(restartTimer); clearInterval(expiryTimer); clearInterval(answerTimer); clearInterval(wakeTimer); clearInterval(docketTimer); clearInterval(stopSigninHelp); dockets.stop(); clearInterval(gitTimer); talk.stop(); });
928
930
  let closing = false;
929
931
  boxes.attach(server, WebSocketServer);
930
932
  browsers.attach(server, WebSocketServer); server.on('close', () => browsers.shutdown());
package/server/vm.mjs CHANGED
@@ -79,6 +79,7 @@ export function runner(prefix) {
79
79
  }
80
80
 
81
81
  /* The verbs that change a machine: its state is asked again after them. */
82
+ export const TRIM_MS = 120_000;
82
83
  const CHANGES = new Set(['launch', 'clone', 'start', 'stop', 'suspend', 'kill', 'halt', 'hardstop', 'delete', 'purge', 'set', 'rename', 'restore', 'snapshot', 'revive', 'reclaim']);
83
84
  export const STATES_FRESH_MS = 3000;
84
85
  /* The VM manager did not say what a machine is in: not an answer about the machine. */
@@ -141,6 +142,11 @@ export class Vms {
141
142
  }
142
143
  /* In a shared machine: its machine-wide work, as its admin user, never through a door (the door itself installed). */
143
144
  execMachine(conversation, argv, options) { return this.run(['vm', 'exec', this.vmOf(conversation), '--', ...argv], options); }
145
+ /* ITS DISK GIVES BACK WHAT WAS ERASED (17-11): the system inside tells the disk which blocks are free
146
+ (fstrim; the VM manager's disks take it, discard=unmap), and the disk file on the host shrinks to what
147
+ is really used. Ubuntu does it once a week by itself; asked here every hour and before each stop or
148
+ sleep. A second one is quick: only what changed since is looked at. */
149
+ trim(conversation, timeoutMs = TRIM_MS) { return this.execMachine(conversation, ['sudo', '-n', 'fstrim', '--all'], { timeoutMs }); }
144
150
  /* The host's list of who lives in a shared machine (vm share / unshare). */
145
151
  share(conversation) { return this.run(['vm', 'share', this.vmOf(conversation), conversation]); }
146
152
  unshare(conversation) { return this.run(['vm', 'unshare', this.vmOf(conversation), conversation]); }
package/web/app.js CHANGED
@@ -1971,7 +1971,19 @@
1971
1971
  $('items').querySelector(again)?.focus();
1972
1972
  });
1973
1973
 
1974
- async function refresh() {
1974
+ /* One reading of the list at a time: one asked while one runs waits for it, then one more is made for all
1975
+ who asked meanwhile (what they just changed is in it) -- never two side by side, nor two timers left armed. */
1976
+ let refreshing = null;
1977
+ let refreshAgain = null;
1978
+ function refresh() {
1979
+ if (refreshing) { refreshAgain ??= refreshing.then(() => { refreshAgain = null; return refresh(); }); return refreshAgain; }
1980
+ refreshing = refreshOnce().finally(() => { refreshing = null; });
1981
+ return refreshing;
1982
+ }
1983
+ /* A page out of sight (another tab, a tablet asleep) reads its list seldom; shown again, at once. */
1984
+ const HIDDEN_POLL_MS = 30_000;
1985
+ document.addEventListener('visibilitychange', () => { if (!document.hidden && home) void refresh(); });
1986
+ async function refreshOnce() {
1975
1987
  clearTimeout(pollTimer);
1976
1988
  try {
1977
1989
  const mark = (x) => (x ? `${x.phase}/${x.asleep === true}/${holds(x)}/${Boolean(x.machine)}/${x.stopped === true}/${Boolean(x.lentTo)}` : '');
@@ -2024,7 +2036,9 @@
2024
2036
  if (!DEVICE && panelShown) { void paintAnswerer(); paintWakeups(); paintMachine(conversations.find((x) => x.name === current)); }
2025
2037
  if (!DEVICE && home) void paintJobs();
2026
2038
  /* A start told step by step is asked about more often: its tool appears soon after its last step. */
2027
- if (home) pollTimer = setTimeout(refresh, conversations.some(holds) || conversations.some((c) => c.machine) ? 1500 : conversations.some((c) => c.phase === 'building' || c.phase === 'moving' || c.phase === 'restarting') ? 2500 : 10000);
2039
+ clearTimeout(pollTimer);
2040
+ const every = conversations.some(holds) || conversations.some((c) => c.machine) ? 1500 : conversations.some((c) => c.phase === 'building' || c.phase === 'moving' || c.phase === 'restarting') ? 2500 : 10000;
2041
+ if (home) pollTimer = setTimeout(refresh, document.hidden ? Math.max(every, HIDDEN_POLL_MS) : every);
2028
2042
  }
2029
2043
 
2030
2044
  /* ---------- WHAT IT IS DOING (jobs.mjs, 14-11) ----------
@@ -3573,7 +3587,8 @@
3573
3587
  : state === 'live' ? 'It is there. Below: what is ready, and what it says now.' : `Its screen: ${state}.`;
3574
3588
  $('simple-state').dataset.needs = String(Boolean(c?.answerer?.needs));
3575
3589
  $('simple-says').textContent = saysNow() || 'Nothing on its screen yet.';
3576
- if (Date.now() - simpleFilesAt > 8000) void paintSimpleFiles();
3590
+ /* Its files are under the plain screen: not read while the chat covers it. */
3591
+ if (Date.now() - simpleFilesAt > 8000 && !$('simple-plain').hidden) void paintSimpleFiles();
3577
3592
  }
3578
3593
  $('simple-toggle').addEventListener('click', () => toggleSimple());
3579
3594
  function toggleSimple() {
@@ -3596,6 +3611,7 @@
3596
3611
  it moved, and then only what changed (the server's cursor). The chat open keeps its own copy as it
3597
3612
  looks again. Opened, the copy is drawn at once, then the whole window is fetched and put in its place. */
3598
3613
  const KEPT_LAST = 50;
3614
+ const KEPT_EVERY_MS = 10_000;
3599
3615
  const kept = new Map();
3600
3616
  /* Kept once loaded: an import() asked again resolves only after the next frame, a blank one. */
3601
3617
  let parleyLoaded = null;
@@ -3613,6 +3629,8 @@
3613
3629
  const mark = JSON.stringify(c.talk);
3614
3630
  const was = kept.get(c.name);
3615
3631
  if (was?.mark === mark && was.thread) continue;
3632
+ /* Moved again soon after (the list read every 1.5 s while a machine works): its copy waits a little. */
3633
+ if (was?.thread && Date.now() - (was.at ?? 0) < KEPT_EVERY_MS) continue;
3616
3634
  const cursor = typeof was?.thread?.cursor === 'string' && was.thread.cursor ? was.thread.cursor : null;
3617
3635
  const ask = (params) => fetch(talkPath(c.name, '', params)).then((r) => (r.ok ? r.json() : null)).catch(() => null);
3618
3636
  const [state, got] = await Promise.all([ask({ state: 1 }), ask({ last: KEPT_LAST, ...(cursor ? { since: cursor } : {}) })]);
@@ -3620,7 +3638,7 @@
3620
3638
  if (c.name === threadOf) continue;
3621
3639
  if (state && state.on !== true) { kept.delete(c.name); continue; }
3622
3640
  if (!state || !Array.isArray(got?.messages)) continue;
3623
- kept.set(c.name, { state, thread: cursor ? since(was.thread, got) : got, mark });
3641
+ kept.set(c.name, { state, thread: cursor ? since(was.thread, got) : got, mark, at: Date.now() });
3624
3642
  }
3625
3643
  } finally { keeping = false; }
3626
3644
  }
@@ -3668,7 +3686,8 @@
3668
3686
  if (talk.on) keptOf(name).state = talk; else kept.delete(name);
3669
3687
  return talk;
3670
3688
  }
3671
- async function paintThread() {
3689
+ /* `look`: false from the clock below -- the thread drawn already is not asked again (its own clock does). */
3690
+ async function paintThread(look = true) {
3672
3691
  const box = $('simple-thread');
3673
3692
  const wanted = talk.on && talkOf === current;
3674
3693
  box.hidden = !wanted;
@@ -3696,7 +3715,7 @@
3696
3715
  if ((wanted || offer) && simple && stopListening) stopVoice();
3697
3716
  paintSimple();
3698
3717
  if (!wanted) { thread?.destroy(); thread = null; threadOf = ''; return; }
3699
- if (thread && threadOf === current) { void thread.refresh(); return; }
3718
+ if (thread && threadOf === current) { if (look !== false) void thread.refresh(); return; }
3700
3719
  thread?.destroy(); thread = null; threadOf = '';
3701
3720
  const name = current;
3702
3721
  /* From where this page is: a device's page lives under /c/, and nothing else is open to it. */
@@ -3851,7 +3870,7 @@
3851
3870
  tasksTimer = setInterval(async () => {
3852
3871
  if (!thread) { clearInterval(tasksTimer); tasksTimer = null; return; }
3853
3872
  if (document.hidden) return;
3854
- const now = await getJson('/binder/people', null);
3873
+ const now = await peopleNow();
3855
3874
  if (!now || now.changes === tasksChanges) return;
3856
3875
  tasksChanges = now.changes; binderPeople = now.people;
3857
3876
  void paintTasks(threadOf);
@@ -4249,7 +4268,9 @@
4249
4268
  all.hidden = !all.hidden;
4250
4269
  if (!all.hidden && wordsSettings) all.textContent = JSON.stringify(Object.fromEntries(Object.entries(wordsSettings.english).filter(([key]) => key !== 'lang')), null, 2);
4251
4270
  });
4252
- setInterval(() => { if (!document.hidden && current) void readTalk().then(() => { if (simple) void paintThread(); paintSimple(); }); }, 5000);
4271
+ /* Its chat drawn already: Parley's own clock looks at its thread (every 3 s) -- not asked again here,
4272
+ which made two looks side by side (paintThread(false)). */
4273
+ setInterval(() => { if (!document.hidden && current) void readTalk().then(() => { if (simple) void paintThread(false); paintSimple(); }); }, 5000);
4253
4274
 
4254
4275
  $('simple-say').addEventListener('submit', (event) => {
4255
4276
  event.preventDefault();
@@ -4536,6 +4557,17 @@
4536
4557
  }
4537
4558
  return fallback;
4538
4559
  };
4560
+ /* WHO MAY OWN A CARD, and the binders' count of changes (GET /binder/people): asked by two clocks (the chat's
4561
+ batches, the Binders tab) and a binder opened. One question at a time, and its answer kept a moment, under
4562
+ the 4 s of those clocks: each still sees a change at its next turn, without asking twice. */
4563
+ const PEOPLE_KEPT_MS = 3000;
4564
+ let peopleAsked = null; let peopleAt = 0;
4565
+ const peopleNow = () => {
4566
+ if (peopleAsked && (peopleAt === 0 || Date.now() - peopleAt < PEOPLE_KEPT_MS)) return peopleAsked;
4567
+ const asking = getJson('/binder/people', null).then((got) => { if (peopleAsked === asking) { if (got) peopleAt = Date.now(); else peopleAsked = null; } return got; });
4568
+ peopleAsked = asking; peopleAt = 0;
4569
+ return asking;
4570
+ };
4539
4571
  const el = (tag, cls, text) => { const e = document.createElement(tag); if (cls) e.className = cls; if (text !== undefined) e.textContent = text; return e; };
4540
4572
  /* A commit: its line, and the rest of its message under it, opened by a click. */
4541
4573
  function commitRow(c) {
@@ -6618,6 +6650,8 @@
6618
6650
  if (v.root.isConnected) { v.away = 0; continue; }
6619
6651
  v.away += 1;
6620
6652
  if (v.away >= 3 && v.socket) { const ws = v.socket; v.socket = null; v.phase = 'closed'; try { ws.close(); } catch { /* gone */ } }
6653
+ /* Its chat too: not read every 3 s for a screen no longer there (drawn again when it is shown). */
6654
+ if (v.away >= 3 && v.chat) { v.chat.destroy(); v.chat = null; v.chatOf = ''; }
6621
6655
  }
6622
6656
  }, 10_000);
6623
6657
  /* The parts: the console (kept), then what the AI proposes and has typed, then the journal (drawn each paint). */
@@ -6633,6 +6667,7 @@
6633
6667
  if (!v.opened) { v.term.open(v.screen); v.opened = true; }
6634
6668
  v.fit();
6635
6669
  if (!v.socket) consoleConnect(v);
6670
+ if ((v.full || v.below) && !v.chatOf) void consoleChat(v);
6636
6671
  if (hadFocus) v.term.focus();
6637
6672
  });
6638
6673
  consolePaint(v);
@@ -7101,7 +7136,7 @@
7101
7136
  card.dataset.room = r.id;
7102
7137
  return card;
7103
7138
  }
7104
- let salonThread = null; let salonId = ''; let salonTimer = null;
7139
+ let salonThread = null; let salonId = '';
7105
7140
  /* A room's bar while one of its AIs speaks: its dot at work (gold, breathing), the words under its name. */
7106
7141
  function salonLive(who) {
7107
7142
  const dot = $('salon-state'); const line = $('salon-live');
@@ -7118,7 +7153,7 @@
7118
7153
  const rows = ['person', 'ai', 'box'].map((k) => { const of = r.members.filter((m) => m.kind === k); if (!of.length) return null; const row = el('div', 'salon-members-row'); row.append(el('span', 'hint', k === 'person' ? uiSaid('set-room-people', 'People') : k === 'ai' ? uiSaid('set-room-ais-of', 'AIs') : uiSaid('set-room-boxes-of', 'Boxes')), ...of.map((m) => { const x = el('span', 'salon-member'); x.append(memberChips([m], 1), document.createTextNode(m.name)); if (m.host) x.append(el('span', 'salon-host', uiSaid('set-room-host-mark', 'host'))); return x; })); return row; }).filter(Boolean);
7119
7154
  $('salon-members').replaceChildren(...rows);
7120
7155
  }
7121
- function salonLeft() { clearInterval(salonTimer); salonTimer = null; salonThread?.destroy(); salonThread = null; salonId = ''; }
7156
+ function salonLeft() { salonThread?.destroy(); salonThread = null; salonId = ''; }
7122
7157
  /* `step`: picked by the owner (the list, the deck): as a conversation picked, the list folds. */
7123
7158
  async function openSalon(id, push = true, { step = false } = {}) {
7124
7159
  if (DEVICE) return;
@@ -7204,7 +7239,7 @@
7204
7239
  draft: `room:${id}`,
7205
7240
  act: (action) => { tetherAct(action, () => salonThread?.refresh?.()); },
7206
7241
  });
7207
- salonTimer = setInterval(() => { if (salonThread && salonId === id) void salonThread.refresh(); }, 3000);
7242
+ /* Looked at again by Parley's own clock (every 3 s, while the page is in sight): no second clock here. */
7208
7243
  }
7209
7244
  $('salon-close').addEventListener('click', () => leavePlace());
7210
7245
  $('salon-who').addEventListener('click', () => { const open = $('salon-members').hidden; $('salon-members').hidden = !open; $('salon-who').setAttribute('aria-expanded', String(open)); });
@@ -7902,7 +7937,7 @@
7902
7937
  /* `still()`: whether it is still wanted once its parts are read (another one asked meanwhile: not drawn). */
7903
7938
  async function mountBinder(holder, keep, { onLists, of, place: at = null, steps = null, still = () => true } = {}) {
7904
7939
  binderParts ??= Promise.all([import(new URL('vendor/binder-ui.js', new URL('/', location.href)).href), fetch(`/vendor/binder-${binderLang()}.json`).then((r) => r.json()).catch(() => ({}))]);
7905
- const [[{ mount }, words], seen] = await Promise.all([binderParts, getJson('/binder/people', null)]);
7940
+ const [[{ mount }, words], seen] = await Promise.all([binderParts, peopleNow()]);
7906
7941
  if (seen) { binderPeople = seen.people; binderChanges = seen.changes; }
7907
7942
  if (!holder.isConnected || !still()) return null;
7908
7943
  let shown = [];
@@ -8099,7 +8134,7 @@
8099
8134
  /* Read again every screen of a binder when the binders changed. Taken as seen only once every
8100
8135
  screen read it again: one that failed (the server restarting) is read again at the next turn. */
8101
8136
  async function catchUpBinders() {
8102
- const now = await getJson('/binder/people', null);
8137
+ const now = await peopleNow();
8103
8138
  if (!now) return;
8104
8139
  binderPeople = now.people;
8105
8140
  if (now.changes === binderChanges) return;