clavarium 0.2.415-next.1 → 0.2.417-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.415-next.1",
3
+ "version": "0.2.417-next.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "clavarium",
9
- "version": "0.2.415-next.1",
9
+ "version": "0.2.417-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.415-next.1",
3
+ "version": "0.2.417-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.",
package/server/api.mjs CHANGED
@@ -25,6 +25,7 @@
25
25
  * POST /api/binder/suggest {id}: at most three quick actions for that card -> {actions: [{key, label, why, on, ask?}]}
26
26
  * POST /api/mailboxes/<name>/live {smtp, email?}: that mailbox connected live too (send, move...), its password reused
27
27
  * POST /api/conversations/<name>/erase {confirm: <its name>}: deleted for good -- its machine and its work files
28
+ * POST /api/conversations/<name>/into-machine {machine, machineMb?}: moved into a shared machine (#221), its tool's state along (202)
28
29
  * POST /api/conversations/<name>/rebuild {reset?, confirm?}: built again; reset (confirm: its name) for a working one too
29
30
  * POST /api/conversations/<name>/ask-first {on}: its tool asks before acting (true), or acts without asking in its machine (false, the default), from its next start
30
31
  * POST /api/conversations/<name>/resume {on}: its tool takes up its last session when it starts (true), or starts fresh
@@ -996,6 +997,12 @@ export async function handleApi(request, response, conversations, headers, resou
996
997
  if (!conversations.list().some((c) => c.name === conversation)) throw new Refusal(404, 'No such conversation.');
997
998
  return send(200, await repair(conversation)), true;
998
999
  }
1000
+ /* Moved into a shared machine (#221): one there already, or a new one of the size given. */
1001
+ const moving = /^\/api\/conversations\/([^/]+)\/into-machine$/.exec(pathname);
1002
+ if (moving) {
1003
+ const machineMb = body?.machineMb === undefined ? undefined : Number(body.machineMb);
1004
+ return send(202, await conversations.moveToShared(decodeURIComponent(moving[1]), { machine: body?.machine, machineMb })), true;
1005
+ }
999
1006
  const again = /^\/api\/conversations\/([^/]+)\/rebuild$/.exec(pathname);
1000
1007
  if (again) {
1001
1008
  const reset = body?.reset === true;
@@ -9,12 +9,14 @@
9
9
  import { isConversationName, identifierFrom, titleProblem, groupProblem } from './names.mjs';
10
10
  import { JsonFile } from './store.mjs';
11
11
  import { attachCommand, SOCKET } from './tmux.mjs';
12
- import { WORK, VM_USER, SHARING_STEP, stepLine } from './vm.mjs';
12
+ import { WORK, VM_USER, SHARING_STEP, stepLine, vmName } from './vm.mjs';
13
13
  import { resumeOrFresh } from './tools.mjs';
14
14
  import { TOOLS_PATH, LAUNCH } from './toolbox.mjs';
15
15
  import { availableParallelism } from 'node:os';
16
16
  import { spawn } from 'node:child_process';
17
- import { readFileSync } from 'node:fs';
17
+ import { readFileSync, createReadStream, createWriteStream, mkdtempSync, rmSync } from 'node:fs';
18
+ import { tmpdir } from 'node:os';
19
+ import { join } from 'node:path';
18
20
 
19
21
  export const SESSION = 'main';
20
22
  export const STOP_DELAY_MS = 60_000;
@@ -75,7 +77,7 @@ const DOWN = ['polite', 'force', 'term', 'kill', 'check'];
75
77
  const NEXT = Object.freeze({ polite: 'force', force: 'term', term: 'kill' });
76
78
  /* Each step in words, for the journal and the chat (the page has its own, web/app.js). */
77
79
  const STEP_WORDS = Object.freeze({ polite: 'polite stop', force: 'forced stop', term: 'SIGTERM', kill: 'SIGKILL', check: 'check', start: 'start', suspend: 'sleep', resleep: 'wake and sleep again', stop: 'clean stop' });
78
- const KIND_DOING = Object.freeze({ start: 'starting', stop: 'stopping', restart: 'restarting', sleep: 'going to sleep', force: 'being forced off', resize: 'being resized' });
80
+ const KIND_DOING = Object.freeze({ start: 'starting', stop: 'stopping', restart: 'restarting', sleep: 'going to sleep', force: 'being forced off', resize: 'being resized', move: 'moving to a shared machine' });
79
81
  /* THE WATCHDOG of a machine (watchdog.mjs), as its owner set it: on, with how long it may stay mute or
80
82
  full before it is forced off and started again. The defaults, and what may be chosen (minutes). */
81
83
  export const WATCHDOG_DELAY_MIN = 60;
@@ -943,6 +945,12 @@ export class Conversations {
943
945
  if ((await this.#vms.state(name).catch(() => undefined)) !== 'Running') throw new Refusal(409, 'Its machine is not running: open the conversation first.', { retry: false });
944
946
  this.drop(name);
945
947
  await this.#vms.exec(name, ['tmux', '-L', SOCKET, 'kill-server'], { timeoutMs: 10_000 }).catch(() => {});
948
+ try { return { tool: c.tool, from: await this.#unpack(name, c.tool, input) }; } finally { this.ready(name); }
949
+ }
950
+
951
+ /* An exported state unpacked into its home (its tool stopped by the caller): its manifest checked, then each
952
+ part put in place of the old. -> the manifest's { name, at }, or null. */
953
+ async #unpack(name, toolId, input) {
946
954
  /* Unpacked aside first: its manifest read, its tool checked; then moved into the home. */
947
955
  /* Aside in the home itself (never /tmp, which may be memory): then each part moved in place of the old. */
948
956
  const script = 'set -e; m=$(mktemp -d "$HOME/.clavarium-import.XXXXXX"); trap \'rm -rf "$m"\' EXIT; tar -xzf - -C "$m"; '
@@ -950,19 +958,105 @@ export class Conversations {
950
958
  + 'grep -q "\\"tool\\":\\"$1\\"" "$m/clavarium-conversation.json" || { echo "another tool" >&2; exit 4; }; '
951
959
  + 'cat "$m/clavarium-conversation.json"; rm -f "$m/clavarium-conversation.json"; '
952
960
  + 'for e in "$m"/.[!.]* "$m"/*; do if [ ! -e "$e" ]; then continue; fi; b=$(basename "$e"); rm -rf "$HOME/$b"; mv "$e" "$HOME/$b"; done';
953
- const argv = this.#vms.execArgv(name, ['sh', '-c', script, 'import', c.tool]);
961
+ const argv = this.#vms.execArgv(name, ['sh', '-c', script, 'import', toolId]);
954
962
  const child = spawn(argv[0], argv.slice(1), { stdio: ['pipe', 'pipe', 'pipe'] });
955
963
  const out = []; const err = [];
956
964
  child.stdout.on('data', (d) => out.push(d)); child.stderr.on('data', (d) => err.push(d));
957
965
  input.pipe(child.stdin);
958
966
  child.stdin.on('error', () => { /* it stopped reading: said below */ });
959
967
  const code = await new Promise((ok) => child.on('close', ok));
960
- this.ready(name);
961
968
  if (code === 3) throw new Refusal(400, 'This is not an exported conversation.');
962
969
  if (code === 4) throw new Refusal(400, `This export is of another tool: import it into a conversation with that tool.`);
963
970
  if (code !== 0) throw new Refusal(502, `Not imported: ${firstLine(Buffer.concat(err).toString()) || `exit ${code}`}`);
964
971
  let from = null; try { from = JSON.parse(Buffer.concat(out).toString()); } catch { /* said nothing */ }
965
- return { tool: c.tool, from: from ? { name: from.name, at: from.at } : null };
972
+ return from ? { name: from.name, at: from.at } : null;
973
+ }
974
+
975
+ /* MOVED INTO A SHARED MACHINE (#221, 12-11, its owner's ask: put existing conversations together). From a
976
+ machine of its own: its tool's state carried (state.keep, as an export), its machine stopped -- kept until the
977
+ end, to go back to -- its place made in the shared machine as for a new one, the state put back in its home,
978
+ then its old machine deleted. Its work folder is kept by the server: it simply follows. One on its machine's
979
+ own disk is refused (its files would stay behind): kept first (its settings, Its files).
980
+ -> the record, at once; `this.built`: the end of it. */
981
+ async moveToShared(name, { machine, machineMb } = {}) {
982
+ const c = this.#busyCheck(name);
983
+ if (c.sharedMachine) throw new Refusal(409, `It lives in the shared machine ${c.sharedMachine} already.`);
984
+ if (typeof machine !== 'string' || !isConversationName(machine)) throw new Refusal(400, 'A machine name is 1 to 32 lower-case letters, digits or hyphens; it starts with a letter.');
985
+ if (machine === name || this.#store.get(machine)) throw new Refusal(400, 'A shared machine has a name of its own, not a conversation\'s.');
986
+ if (c.work !== 'kept') throw new Refusal(409, 'Its work is on its own machine\'s disk: it would stay behind. Keep it here first (Its files), then move it.');
987
+ const tool = this.#tools.find((t) => t.id === c.tool);
988
+ if (!tool) throw new Refusal(400, 'The tool of this conversation is no longer offered.');
989
+ const there = this.#machineMbOf(machine);
990
+ const size = there ?? machineMb ?? SHARED_MB;
991
+ if (there === undefined && (!Number.isInteger(size) || size < 1024 || size > 16384)) throw new Refusal(400, 'A shared machine has 1024 to 16384 MB of memory.');
992
+ const memory = Math.max(tool.memoryMb, Math.min(Number(c.memoryMb) || tool.memoryMb, size));
993
+ if (memory > size) throw new Refusal(400, `The machine ${machine} has ${size} MB of memory: ${tool.label} needs ${tool.memoryMb} MB.`);
994
+ const state = await this.#vms.state(name, { fresh: true }).catch(() => undefined);
995
+ if (tool.state && state !== 'Running') throw new Refusal(409, 'Its machine is not running: open the conversation first, so that its tool\'s state can come along.', { retry: false });
996
+ /* A new shared machine takes its size; its own, running, is stopped before it starts: that memory is given back. */
997
+ if (there === undefined) await this.room({ kind: 'create', memoryMb: Math.max(0, size - (state === 'Running' ? Number(c.memoryMb) || 0 : 0)) });
998
+ const act = this.#take(name, 'move');
999
+ this.#cancelStop(name);
1000
+ const now = new Date().toISOString();
1001
+ this.#store.patch(name, { phase: 'building', step: `Moving to the shared machine ${machine}`, buildingSince: now, progress: buildProgress(now) });
1002
+ this.built = this.#moving(name, c, tool, machine, size, memory, state).finally(() => this.#give(name, act));
1003
+ return this.#store.get(name);
1004
+ }
1005
+
1006
+ async #moving(name, c, tool, machine, size, memory, state) {
1007
+ const old = vmName(name);
1008
+ const dir = mkdtempSync(join(tmpdir(), 'clv-move-'));
1009
+ const carried = join(dir, 'state.tar.gz');
1010
+ const back = (why) => {
1011
+ /* Back to its own machine, as it was (stopped: the next opening wakes it). */
1012
+ this.#store.patch(name, { sharedMachine: undefined, machineMb: undefined, machineUser: undefined, memoryMb: c.memoryMb, phase: 'ready', step: undefined, progress: undefined, buildingSince: undefined, error: undefined });
1013
+ this.#fresh.add(name); this.#mountAgain.add(name);
1014
+ try { this.renewed(name, `Not moved to the shared machine ${machine}: ${why} It stays in its own machine, as it was.`, false); } catch { /* told, nothing more */ }
1015
+ };
1016
+ try {
1017
+ this.drop(name);
1018
+ if (state === 'Running') await this.#vms.exec(name, ['tmux', '-L', SOCKET, 'kill-server'], { timeoutMs: 10_000 }).catch(() => {});
1019
+ if (tool.state) {
1020
+ this.#store.patch(name, { step: `Taking ${tool.label}'s state along` });
1021
+ const { stream, child } = await this.exportState(name);
1022
+ const failed = new Promise((ok) => child.on('error', () => ok(-1)));
1023
+ const file = createWriteStream(carried, { mode: 0o600 });
1024
+ stream.pipe(file);
1025
+ const code = await Promise.race([new Promise((ok) => child.on('close', ok)), failed]);
1026
+ await new Promise((ok) => (file.writableFinished ? ok() : file.on('finish', ok)));
1027
+ if (code !== 0) return back(`its tool's state could not be taken (exit ${code}).`);
1028
+ }
1029
+ if (state !== undefined) {
1030
+ this.#store.patch(name, { step: 'Stopping its own machine' });
1031
+ const stopped = await this.#vms.stop(name);
1032
+ if (stopped.code !== 0) return back(`its machine did not stop: ${firstLine(stopped.stderr) || `exit ${stopped.code}`}.`);
1033
+ }
1034
+ this.#store.patch(name, { sharedMachine: machine, machineMb: size, memoryMb: memory });
1035
+ await this.#buildShared(name, tool, memory);
1036
+ const now = this.#store.get(name);
1037
+ if (!now) return undefined; /* archived meanwhile */
1038
+ if (now.phase !== 'ready') {
1039
+ const why = now.error ?? 'its place there could not be made.';
1040
+ await this.#vms.unshare(name).catch(() => {});
1041
+ return back(`${why.replace(/\.?$/, '.')}`);
1042
+ }
1043
+ if (tool.state) {
1044
+ /* Not opened while its state is put back: building still, to the end. */
1045
+ this.#store.patch(name, { phase: 'building', step: `Putting ${tool.label}'s state back` });
1046
+ this.drop(name);
1047
+ try { await this.#unpack(name, c.tool, createReadStream(carried)); } catch (error) {
1048
+ this.#store.patch(name, { phase: 'ready', step: undefined });
1049
+ this.ready(name);
1050
+ this.renewed(name, `Moved to the shared machine ${machine}, but ${tool.label}'s state did not come along (${error.message}): it starts afresh. Its old machine is kept, stopped.`, true);
1051
+ return undefined;
1052
+ }
1053
+ this.#store.patch(name, { phase: 'ready', step: undefined });
1054
+ this.ready(name);
1055
+ }
1056
+ await this.#vms.removeVm(old).catch(() => {});
1057
+ this.renewed(name, `Moved to the shared machine ${machine}: its work folder${tool.state ? `, ${tool.label}'s state` : ''} and this chat came along. Its own machine is deleted.`, true);
1058
+ return undefined;
1059
+ } finally { rmSync(dir, { recursive: true, force: true }); }
966
1060
  }
967
1061
 
968
1062
  async #fixup(name, tool) {
@@ -1123,7 +1217,8 @@ export class Conversations {
1123
1217
 
1124
1218
  /* What the VM manager says the machine has, written in its record. */
1125
1219
  async reconcile(name) {
1126
- if (!this.#store.get(name)) return;
1220
+ /* In a shared machine (#221): what the machine has is the machine's; its memory is its own limit there. */
1221
+ if (!this.#store.get(name) || this.#store.get(name).sharedMachine) return;
1127
1222
  const real = await this.#vms.size(name).catch(() => ({}));
1128
1223
  const patch = {};
1129
1224
  if (real.memoryMb !== undefined && real.memoryMb !== this.#store.get(name).memoryMb) patch.memoryMb = real.memoryMb;
package/server/events.mjs CHANGED
@@ -33,6 +33,7 @@ const SAID = [
33
33
  [/^\/api\/conversations\/([^/]+)\/machine\/cancel$/, 'machine', (m) => `Machine of ${m[1]}: the size kept for its wake given up`],
34
34
  [/^\/api\/conversations\/([^/]+)\/sleep$/, 'machine', (m) => `Machine of ${m[1]} put to sleep`],
35
35
  [/^\/api\/conversations\/([^/]+)\/rebuild$/, 'machine', (m) => `Machine of ${m[1]} built again`],
36
+ [/^\/api\/conversations\/([^/]+)\/into-machine$/, 'machine', (m, b) => `${m[1]} moved into the shared machine ${clip(String(b?.machine ?? '?'), 32)}`],
36
37
  [/^\/api\/conversations\/([^/]+)\/network$/, 'machine', (m, b) => `${m[1]} ${b.online ? 'put online' : 'put offline'}`],
37
38
  [/^\/api\/conversations\/([^/]+)\/share$/, 'access', (m) => `A pairing code made for ${m[1]}`],
38
39
  [/^\/api\/devices\/([^/]+)\/revoke$/, 'access', (m) => `Device ${clip(m[1], 40)} revoked`],
package/web/app.js CHANGED
@@ -2983,6 +2983,14 @@
2983
2983
  $('machine-size-title').textContent = sharedHere ? 'Memory' : 'Memory, cores and disk';
2984
2984
  if (sharedHere) { $('machine-size-hint').textContent = 'Its limit in the shared machine · from its next start'; $('machine-size-apply').textContent = 'Apply'; }
2985
2985
  $('shared-size').hidden = !sharedHere || here.phase !== 'ready';
2986
+ /* Into a shared machine (#221): offered to one in a machine of its own; a shared machine there is offered first. */
2987
+ $('into-shared').hidden = sharedHere || DEVICE || !here || here.phase !== 'ready';
2988
+ if (!$('into-shared').hidden && document.activeElement !== $('into-shared-name')) {
2989
+ const names = [...new Set(conversations.map((x) => x.sharedMachine).filter(Boolean))].sort();
2990
+ $('machine-names').replaceChildren(...names.map((n) => Object.assign(document.createElement('option'), { value: n })));
2991
+ if (!$('into-shared-name').value && names.length) $('into-shared-name').value = names[0];
2992
+ paintIntoShared();
2993
+ }
2986
2994
  if (sharedHere && document.activeElement !== $('shared-memory')) {
2987
2995
  const inIt = conversations.filter((x) => x.sharedMachine === here.sharedMachine);
2988
2996
  const floor = Math.max(1024, ...inIt.map((x) => x.memoryMb ?? 0)); const now = here.machineMb ?? floor;
@@ -3100,6 +3108,35 @@
3100
3108
  });
3101
3109
 
3102
3110
  /* ITS SHARED MACHINE'S MEMORY (#221): asked first, naming every conversation it interrupts. */
3111
+ /* A new shared machine: its memory chosen; one that is there keeps its own. Work on its own disk: kept here first. */
3112
+ function paintIntoShared() {
3113
+ const here = conversations.find((x) => x.name === current);
3114
+ const names = new Set(conversations.map((x) => x.sharedMachine).filter(Boolean));
3115
+ const known = names.has($('into-shared-name').value.trim());
3116
+ $('into-shared-mb').hidden = known; $('into-shared-mb-label').hidden = known;
3117
+ const onDisk = here?.work === 'disk';
3118
+ $('into-shared-hint').textContent = onDisk ? 'Keep its files here first (Where the tool works)' : 'Trial · work and tool state come along';
3119
+ $('into-shared-apply').disabled = onDisk;
3120
+ }
3121
+ $('into-shared-name').addEventListener('input', () => paintIntoShared());
3122
+ $('into-shared').addEventListener('submit', (event) => {
3123
+ event.preventDefault();
3124
+ const name = current;
3125
+ const here = conversations.find((x) => x.name === name);
3126
+ if (!here || here.sharedMachine) return;
3127
+ const machine = $('into-shared-name').value.trim();
3128
+ if (!machine) { $('panel-error').textContent = 'Name the shared machine first.'; $('panel-error').hidden = false; return; }
3129
+ const known = conversations.some((x) => x.sharedMachine === machine);
3130
+ const machineMb = known ? undefined : Number($('into-shared-mb').value);
3131
+ leavePanel();
3132
+ const resume = socket && state.dataset.state === 'live' ? () => { notice.hidden = true; focusTerminal(); } : enter;
3133
+ show(`Move ${here.title ?? here.name} into the shared machine « ${machine} »${known ? '' : ` (new, ${sizeWords(machineMb)})`}? Its tool stops, its work and its state come along, then ITS OWN MACHINE IS DELETED.`,
3134
+ 'Move it', async () => {
3135
+ disconnect(); say('moving', 'connecting'); show('Moving...'); $('notice-spin').hidden = false;
3136
+ try { await post(`${API}/conversations/${encodeURIComponent(name)}/into-machine`, { machine, ...(machineMb ? { machineMb } : {}) }); await refresh(); enter(); }
3137
+ catch (error) { show(error.message, 'Back', enter); }
3138
+ }, resume);
3139
+ });
3103
3140
  $('shared-size').addEventListener('submit', (event) => {
3104
3141
  event.preventDefault();
3105
3142
  const name = current;
package/web/index.html CHANGED
@@ -234,6 +234,15 @@
234
234
  <p class="hint" id="shared-size-hint">Restarts every conversation in it</p>
235
235
  <div class="row"><button type="submit" id="shared-size-apply">Change...</button></div>
236
236
  </form>
237
+ <!-- MOVED INTO A SHARED MACHINE (#221, 12-11): its work and its tool's state along, its own machine deleted. -->
238
+ <form id="into-shared" autocomplete="off" hidden>
239
+ <label for="into-shared-name">Into a shared machine</label>
240
+ <input id="into-shared-name" maxlength="32" list="machine-names" placeholder="assistants" spellcheck="false" autocapitalize="off" autocomplete="off">
241
+ <label for="into-shared-mb" id="into-shared-mb-label">Its memory</label>
242
+ <select id="into-shared-mb"><option value="2048">2 GB</option><option value="4096" selected>4 GB</option><option value="6144">6 GB</option><option value="8192">8 GB</option><option value="12288">12 GB</option><option value="16384">16 GB</option></select>
243
+ <p class="hint" id="into-shared-hint">Trial · work and tool state come along</p>
244
+ <div class="row"><button type="submit" id="into-shared-apply">Move...</button></div>
245
+ </form>
237
246
  <div id="work-box">
238
247
  <div class="panel-top"><b>Where the tool works</b></div>
239
248
  <p id="work-now" class="hint"><span><span id="work-now-text"></span></span><span id="work-now-why" class="tip" hidden></span></p>
package/web/style.css CHANGED
@@ -498,9 +498,9 @@ details.chapter.reached { outline: 2px solid var(--brass); outline-offset: 2px;
498
498
  .facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
499
499
  .facts dt { color: var(--ink2); }
500
500
  .facts dd { margin: 0; overflow-wrap: anywhere; }
501
- #machine-size, #shared-size { display: flex; flex-direction: column; gap: 6px; max-width: 30rem; }
502
- #machine-size label, #shared-size label { font-size: .8125rem; color: var(--ink2); }
503
- #machine-size select, #shared-size select { width: 100%; min-height: 40px; font: .875rem var(--sans); color: var(--ink); background-color: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; }
501
+ #machine-size, #shared-size, #into-shared { display: flex; flex-direction: column; gap: 6px; max-width: 30rem; }
502
+ #machine-size label, #shared-size label, #into-shared label { font-size: .8125rem; color: var(--ink2); }
503
+ #machine-size select, #shared-size select, #into-shared :is(select, input) { width: 100%; min-height: 40px; font: .875rem var(--sans); color: var(--ink); background-color: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; }
504
504
  .health-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
505
505
  .health-lines li { padding-left: 1.3em; position: relative; }
506
506
  .health-lines li::before { content: ""; position: absolute; left: .2em; top: .45em; width: .55em; height: .55em; border-radius: 50%; background: var(--ok); }
@@ -1909,12 +1909,12 @@ button.tip-btn:hover, button.tip-btn[aria-expanded="true"] { color: var(--brass-
1909
1909
  :is(#settings, #panel) .chapter-body .panel-top { border: 0; }
1910
1910
  :is(#settings, #panel) .chapter-body .panel-top > b { font-size: .6875rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); }
1911
1911
  /* The machine's size: each a row, its name on the left, its choice on the right. */
1912
- #panel :is(#machine-size, #shared-size) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 16rem); gap: 10px 16px; align-items: center; max-width: none; }
1913
- #panel :is(#machine-size, #shared-size) > label { font-size: .875rem; font-weight: 600; color: var(--ink); }
1914
- #panel :is(#machine-size, #shared-size) > :is(p, .row) { grid-column: 1 / -1; }
1915
- #panel :is(#machine-size, #shared-size) > .row { justify-content: flex-end; }
1916
- #shared-size[hidden] { display: none; }
1917
- @media (max-width: 560px) { #panel #machine-size { grid-template-columns: minmax(0, 1fr); } }
1912
+ #panel :is(#machine-size, #shared-size, #into-shared) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 16rem); gap: 10px 16px; align-items: center; max-width: none; }
1913
+ #panel :is(#machine-size, #shared-size, #into-shared) > label { font-size: .875rem; font-weight: 600; color: var(--ink); }
1914
+ #panel :is(#machine-size, #shared-size, #into-shared) > :is(p, .row) { grid-column: 1 / -1; }
1915
+ #panel :is(#machine-size, #shared-size, #into-shared) > .row { justify-content: flex-end; }
1916
+ #shared-size[hidden], #into-shared[hidden], #into-shared [hidden] { display: none; }
1917
+ @media (max-width: 560px) { #panel :is(#machine-size, #into-shared) { grid-template-columns: minmax(0, 1fr); } }
1918
1918
  /* A chapter whose body is one block (Updates, Network): its pieces are the rows, not the block. */
1919
1919
  :is(#settings, #panel) .chapter-body > :is(#updates, #wifi) { padding: 0; }
1920
1920
  :is(#updates, #wifi) > * { margin: 0; padding: 12px 16px; }