clavarium 0.2.413-next.1 → 0.2.416-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.
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/server/api.mjs +7 -0
- package/server/conversations.mjs +96 -6
- package/server/events.mjs +1 -0
- package/server/guide.mjs +2 -0
- package/web/app.js +37 -0
- package/web/index.html +9 -0
- package/web/style.css +9 -9
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.416-next.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "clavarium",
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.416-next.1",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/package.json
CHANGED
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;
|
package/server/conversations.mjs
CHANGED
|
@@ -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,101 @@ 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',
|
|
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
|
|
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
|
+
if (there === undefined) await this.room({ kind: 'create', memoryMb: size });
|
|
997
|
+
const act = this.#take(name, 'move');
|
|
998
|
+
this.#cancelStop(name);
|
|
999
|
+
const now = new Date().toISOString();
|
|
1000
|
+
this.#store.patch(name, { phase: 'building', step: `Moving to the shared machine ${machine}`, buildingSince: now, progress: buildProgress(now) });
|
|
1001
|
+
this.built = this.#moving(name, c, tool, machine, size, memory, state).finally(() => this.#give(name, act));
|
|
1002
|
+
return this.#store.get(name);
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
async #moving(name, c, tool, machine, size, memory, state) {
|
|
1006
|
+
const old = vmName(name);
|
|
1007
|
+
const dir = mkdtempSync(join(tmpdir(), 'clv-move-'));
|
|
1008
|
+
const carried = join(dir, 'state.tar.gz');
|
|
1009
|
+
const back = (why) => {
|
|
1010
|
+
/* Back to its own machine, as it was (stopped: the next opening wakes it). */
|
|
1011
|
+
this.#store.patch(name, { sharedMachine: undefined, machineMb: undefined, machineUser: undefined, memoryMb: c.memoryMb, phase: 'ready', step: undefined, progress: undefined, buildingSince: undefined, error: undefined });
|
|
1012
|
+
this.#fresh.add(name); this.#mountAgain.add(name);
|
|
1013
|
+
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 */ }
|
|
1014
|
+
};
|
|
1015
|
+
try {
|
|
1016
|
+
this.drop(name);
|
|
1017
|
+
if (state === 'Running') await this.#vms.exec(name, ['tmux', '-L', SOCKET, 'kill-server'], { timeoutMs: 10_000 }).catch(() => {});
|
|
1018
|
+
if (tool.state) {
|
|
1019
|
+
this.#store.patch(name, { step: `Taking ${tool.label}'s state along` });
|
|
1020
|
+
const { stream, child } = await this.exportState(name);
|
|
1021
|
+
const failed = new Promise((ok) => child.on('error', () => ok(-1)));
|
|
1022
|
+
const file = createWriteStream(carried, { mode: 0o600 });
|
|
1023
|
+
stream.pipe(file);
|
|
1024
|
+
const code = await Promise.race([new Promise((ok) => child.on('close', ok)), failed]);
|
|
1025
|
+
await new Promise((ok) => (file.writableFinished ? ok() : file.on('finish', ok)));
|
|
1026
|
+
if (code !== 0) return back(`its tool's state could not be taken (exit ${code}).`);
|
|
1027
|
+
}
|
|
1028
|
+
if (state !== undefined) {
|
|
1029
|
+
this.#store.patch(name, { step: 'Stopping its own machine' });
|
|
1030
|
+
const stopped = await this.#vms.stop(name);
|
|
1031
|
+
if (stopped.code !== 0) return back(`its machine did not stop: ${firstLine(stopped.stderr) || `exit ${stopped.code}`}.`);
|
|
1032
|
+
}
|
|
1033
|
+
this.#store.patch(name, { sharedMachine: machine, machineMb: size, memoryMb: memory });
|
|
1034
|
+
await this.#buildShared(name, tool, memory);
|
|
1035
|
+
const now = this.#store.get(name);
|
|
1036
|
+
if (!now) return undefined; /* archived meanwhile */
|
|
1037
|
+
if (now.phase !== 'ready') {
|
|
1038
|
+
const why = now.error ?? 'its place there could not be made.';
|
|
1039
|
+
await this.#vms.unshare(name).catch(() => {});
|
|
1040
|
+
return back(`${why.replace(/\.?$/, '.')}`);
|
|
1041
|
+
}
|
|
1042
|
+
if (tool.state) {
|
|
1043
|
+
this.#store.patch(name, { step: `Putting ${tool.label}'s state back` });
|
|
1044
|
+
this.drop(name);
|
|
1045
|
+
try { await this.#unpack(name, c.tool, createReadStream(carried)); } catch (error) {
|
|
1046
|
+
this.ready(name);
|
|
1047
|
+
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);
|
|
1048
|
+
return undefined;
|
|
1049
|
+
}
|
|
1050
|
+
this.ready(name);
|
|
1051
|
+
}
|
|
1052
|
+
await this.#vms.removeVm(old).catch(() => {});
|
|
1053
|
+
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);
|
|
1054
|
+
return undefined;
|
|
1055
|
+
} finally { rmSync(dir, { recursive: true, force: true }); }
|
|
966
1056
|
}
|
|
967
1057
|
|
|
968
1058
|
async #fixup(name, tool) {
|
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/server/guide.mjs
CHANGED
|
@@ -89,6 +89,8 @@ export function commonText() {
|
|
|
89
89
|
'- To talk to the person, when their chat is on: parley guide says how (parley --help, every command).',
|
|
90
90
|
/* Dictation into the terminal is marked once per message (app.js); in the chat, parley read says it. */
|
|
91
91
|
'- A message in your terminal that starts with a microphone sign (U+1F3A4), or that parley read says was dictated, came by voice: a word may be misheard; when a key word seems wrong, ask rather than guess.',
|
|
92
|
+
/* The commands, the one path every assistant has, MCP or not (#352): MCP tools, where given, are the same. */
|
|
93
|
+
'- Commands installed (each with --help): parley (the chat), docket (what woke you, your reminders), binder (the lists you were given), tether (your accesses, alone: what you were given; a server of tools: tether mcp TARGET, then tether mcp TARGET TOOL \'{json}\'). The same may also be among your tools (MCP).',
|
|
92
94
|
'- The rest is yours to explore (ls, --help).',
|
|
93
95
|
'',
|
|
94
96
|
].join('\n');
|
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; }
|