clavarium 0.2.222-beta.1 → 0.2.223-beta.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.222-beta.1",
3
+ "version": "0.2.223-beta.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "clavarium",
9
- "version": "0.2.222-beta.1",
9
+ "version": "0.2.223-beta.1",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@xterm/addon-fit": "^0.11.0",
@@ -14,7 +14,7 @@
14
14
  "clavarium-binder": "0.1.63-next.1",
15
15
  "clavarium-docket": "0.1.2-next.2",
16
16
  "clavarium-parley": "0.17.95-next.1",
17
- "clavarium-tether": "0.1.0-next.72",
17
+ "clavarium-tether": "0.1.0-next.73",
18
18
  "mammoth": "1.13.0",
19
19
  "mermaid": "11.17.2",
20
20
  "node-pty": "^1.1.0",
@@ -800,9 +800,9 @@
800
800
  }
801
801
  },
802
802
  "node_modules/clavarium-tether": {
803
- "version": "0.1.0-next.72",
804
- "resolved": "https://registry.npmjs.org/clavarium-tether/-/clavarium-tether-0.1.0-next.72.tgz",
805
- "integrity": "sha512-v8dr19nsZ+hY8GTZd0aLy6G5FP430yruhOZKVhjcQhJtT9X2iTnCzT8LNseEdSkHZ4pHPrfy00VxfvlPp13rAQ==",
803
+ "version": "0.1.0-next.73",
804
+ "resolved": "https://registry.npmjs.org/clavarium-tether/-/clavarium-tether-0.1.0-next.73.tgz",
805
+ "integrity": "sha512-uCOyxj8aQGnspdXvp/E7eoCjwt0FwAGFKLQtJyHd61rulozuPkHswTH1fCis7yjmrc730eTkGpReWpdbOpbOnw==",
806
806
  "license": "MIT",
807
807
  "bin": {
808
808
  "tether": "bin/cli.mjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.222-beta.1",
3
+ "version": "0.2.223-beta.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.",
@@ -48,7 +48,7 @@
48
48
  "clavarium-binder": "0.1.63-next.1",
49
49
  "clavarium-docket": "0.1.2-next.2",
50
50
  "clavarium-parley": "0.17.95-next.1",
51
- "clavarium-tether": "0.1.0-next.72",
51
+ "clavarium-tether": "0.1.0-next.73",
52
52
  "mammoth": "1.13.0",
53
53
  "mermaid": "11.17.2",
54
54
  "node-pty": "^1.1.0",
package/server/agenda.mjs CHANGED
@@ -83,6 +83,9 @@ const SHOW = { busy: 'busy', free: 'free', tentative: 'tentative', oof: 'away',
83
83
  panels read only the top level, and fell back to the text lines: no invitation text, no link, no organizer). */
84
84
  export const handed = (got) => (got?.data?.data && typeof got.data.data === 'object' && !Array.isArray(got.data.data) ? { ...got, data: got.data.data } : got);
85
85
 
86
+ /* A meeting its organiser cancelled: Tether says so (Microsoft's isCancelled), or its title does, as the calendar
87
+ servers write it on an invitee's copy (« Annulé : », "Canceled:"). The page strikes it out (17-11). */
88
+ export const CANCELLED = /^\s*(annul[ée]e?|canceled|cancelled|abgesagt|cancelado|annullato)\s*:/i;
86
89
  /* One event Tether handed as data, kept to the fields the page shows. */
87
90
  export function eventOf(e) {
88
91
  const start = timeOf(e?.start);
@@ -93,6 +96,7 @@ export function eventOf(e) {
93
96
  id: line(e.id, 2048), title: line(e.title) || '(no title)', start, end: timeOf(e.end), allDay,
94
97
  location: line(e.location), organizer: line(e.organizer, 320), online: linkOf(e.online), notes: notesOf(e.notes),
95
98
  attendees: Number.isInteger(n) && n >= 0 ? n : null, show: SHOW[String(e.show ?? '').toLowerCase()] ?? null,
99
+ cancelled: e.cancelled === true || CANCELLED.test(String(e.title ?? '')),
96
100
  };
97
101
  }
98
102
 
package/server/api.mjs CHANGED
@@ -175,6 +175,8 @@
175
175
  * POST /api/tether/agenda {target, from?, to?}: a calendar's events of a window, read now (agenda.mjs)
176
176
  * POST /api/tether/mail-list|mail-read {target, folder?, text?} | {target, id, folder?}: a mailbox's latest messages, one as text (mailview.mjs)
177
177
  * POST /api/tether/contacts|contact {target, text?} | {target, id}: an address book's contacts, one (contactview.mjs)
178
+ * POST /api/tether/ssh-add {title, host, port?, user, key, pin?}: a machine over SSH, opened with a key made
179
+ * here; its host key read and pinned first (sshmachine.mjs)
178
180
  * POST /api/tether/console-journal {target}: a machine's shared console, its short journal (sshconsole.mjs);
179
181
  * the console itself is a WebSocket, /api/tether/console?target=ID
180
182
  * POST /api/files/import?c=...&r=...&p=<folder>&name=<file name>[&dir=<subfolders>&exists=keep|replace|skip&batch=<id>] the body IS the file
@@ -183,6 +185,7 @@
183
185
  * A request that changes something must come from this site's own pages: the
184
186
  * Origin header is compared, and the body must be JSON, which a form on
185
187
  * another site cannot send. */
188
+ import { addMachine } from './sshmachine.mjs';
186
189
  import { openCodeConfig } from './catalog.mjs';
187
190
  import { writeFileSync } from 'node:fs';
188
191
  import { suggest } from './suggest.mjs';
@@ -709,6 +712,7 @@ export async function handleApi(request, response, conversations, headers, resou
709
712
  /* External MCP servers (mcpx.mjs): added with their key (kept host-only in the vault, Tether given its name),
710
713
  imported from a pasted mcpServers block, listed again, a conversation's rights on their tools, new tools seen. */
711
714
  /* Signing in to one with OAuth: the link the owner opens ({ url }), or { need: 'client' } for a client id to paste. */
715
+ if (pathname === '/api/tether/ssh-add' && tethers && gitAccess) return send(201, await addMachine({ tethers, keys: gitAccess, ...(tethers.sshProbe ? { probe: tethers.sshProbe } : {}) }, body ?? {})), true;
712
716
  if (pathname === '/api/tether/mcp-oauth' && tethers?.oauth) return send(200, await tethers.oauth.start({ tethers }, body ?? {}, sharing?.origin?.(request.headers) ?? `http://${request.headers.host}`)), true;
713
717
  const mcpOp = /^\/api\/tether\/mcp-(add|import|refresh|rights|seen)$/.exec(pathname);
714
718
  if (mcpOp && tethers) {
@@ -146,7 +146,7 @@ const quote = (s) => `'${String(s).replace(/'/g, `'\\''`)}'`;
146
146
  const originOf = (address) => `https://${address.host}${address.port ? `:${address.port}` : ''}`;
147
147
 
148
148
  export class GitAccess {
149
- #keys; #credentials; #vault; #dir; #ssh;
149
+ #keys; #credentials; #vault; #dir; #ssh; #machines = () => [];
150
150
 
151
151
  /* `ssh`: the ssh program. A test gives a stand-in that plays a remote. */
152
152
  constructor({ vault, dataDir, keys = new Store(`${dataDir}/git-keys.json`), credentials = new Store(`${dataDir}/git-access.json`), ssh = 'ssh' }) {
@@ -160,7 +160,16 @@ export class GitAccess {
160
160
  /* Where a key lives for the length of one git command. */
161
161
  get runDir() { return `${this.#dir}/run`; }
162
162
 
163
- #usersOf(key) { return this.#credentials.all().filter((c) => c.method === 'ssh-key' && c.key === key).map((c) => c.name); }
163
+ #usersOf(key) { return [...this.#credentials.all().filter((c) => c.method === 'ssh-key' && c.key === key).map((c) => c.name), ...this.#machines(key)]; }
164
+
165
+ /* THE SAME KEYS OPEN MACHINES (Tether's SSH accesses, sshmachine.mjs, 17-11): `using(key)` names the machines a key
166
+ opens, so that "used by" says them and a key in use is not removed. */
167
+ machinesUsing(using) { this.#machines = typeof using === 'function' ? using : () => []; }
168
+ /* The private half, for Tether's SSH connector alone (tethers.mjs reveal): never sent to the page. */
169
+ privateKeyOf(name) {
170
+ const key = this.#keys.get(String(name ?? ''));
171
+ return key ? this.#vault.open(key.sealed) : undefined;
172
+ }
164
173
 
165
174
  /* What the page may know of the keys: the public half, never the private one. */
166
175
  keys() {
@@ -183,7 +192,7 @@ export class GitAccess {
183
192
  removeKey(name) {
184
193
  if (!this.#keys.get(String(name))) throw new Refusal(404, 'No such key.');
185
194
  const used = this.#usersOf(String(name));
186
- if (used.length > 0) throw new Refusal(409, `This key is how ${used.join(', ')} ${used.length > 1 ? 'are' : 'is'} reached: removing it would cut ${used.length > 1 ? 'them' : 'it'} off. Remove ${used.length > 1 ? 'those repositories' : 'that repository'} first.`);
195
+ if (used.length > 0) throw new Refusal(409, `This key is how ${used.join(', ')} ${used.length > 1 ? 'are' : 'is'} reached: removing it would cut ${used.length > 1 ? 'them' : 'it'} off. Remove ${used.length > 1 ? 'them' : 'it'} first.`);
187
196
  this.#keys.remove(String(name));
188
197
  }
189
198
 
package/server/main.mjs CHANGED
@@ -54,6 +54,7 @@ import { Mailboxes, recentMessages } from './mailbox.mjs';
54
54
  import { Grants } from './grants.mjs';
55
55
  import { Groups } from './groups.mjs';
56
56
  import { GitReview } from './gitpush.mjs';
57
+ import { machinesUsing } from './sshmachine.mjs';
57
58
  import { GitAccess } from './gitaccess.mjs';
58
59
  import { GitChecks } from './gitchecks.mjs';
59
60
  import { GitKeeper } from './gitkeeper.mjs';
@@ -312,7 +313,7 @@ const PARLEY_WAIT_MS = 20_000;
312
313
  /* The product: conversations are VMs. `host` is how the host program is
313
314
  reached on this installation, as an argument vector: it is the ONLY thing
314
315
  this server runs with more rights than its own. */
315
- export async function startHome({ port, host, dataDir, mntDir = dataDir, gitReserveBytes, env = process.env, conversations, resources, operators = [], publicOrigin, vaultKey, tools = loadTools(), stopDelayMs, mailReader, gitLocalRemotes = false, gitSsh, answerFetcher, answerEveryMs, wakeEveryMs, alertSend, talkEveryMs, gitEveryMs, shelfEveryMs, shelfFirstMs, healthEveryMs, healthSettleMs, setupPollMs, rereadAfterMs, serverRoomMs, updateState, updateConf, appName, startWaitMs = 20_000, vmWatchEveryMs, historyEveryMs = HISTORY_STEP_MS, tetherConnectors }) {
316
+ export async function startHome({ port, host, dataDir, mntDir = dataDir, gitReserveBytes, env = process.env, conversations, resources, operators = [], publicOrigin, vaultKey, tools = loadTools(), stopDelayMs, mailReader, gitLocalRemotes = false, gitSsh, answerFetcher, answerEveryMs, wakeEveryMs, alertSend, talkEveryMs, gitEveryMs, shelfEveryMs, shelfFirstMs, healthEveryMs, healthSettleMs, setupPollMs, rereadAfterMs, serverRoomMs, updateState, updateConf, appName, startWaitMs = 20_000, vmWatchEveryMs, historyEveryMs = HISTORY_STEP_MS, tetherConnectors, sshProbe }) {
316
317
  /* The data, in the format this code reads, before anything reads it (dataformat.mjs). */
317
318
  const migrated = migrateData(dataDir);
318
319
  if (migrated.ran.length) console.log(`data: format ${migrated.from} -> ${migrated.to}`);
@@ -509,6 +510,11 @@ export async function startHome({ port, host, dataDir, mntDir = dataDir, gitRese
509
510
  let tethers = null;
510
511
  const browsers = new Browsers({ dataDir, store: () => tethers?.store(), log: (line) => console.log(line) });
511
512
  tethers = new Tethers({ dataDir, resources: folders, conversations: () => all.list().map((c) => c.name), secrets, dockets, browsers, connectors: { voicebox: { run: (...a) => voiceboxConnector(boxes).run(...a) }, ...(tetherConnectors ?? {}) } });
513
+ /* The SSH keys made here open machines too (sshmachine.mjs): Tether asks the private half by name; "used by" names them. */
514
+ tethers.sshKeys = gitAccess;
515
+ gitAccess.machinesUsing(machinesUsing(tethers));
516
+ /* A test reads a machine's host key from a stand-in (no network). */
517
+ if (sshProbe) tethers.sshProbe = sshProbe;
512
518
  /* External MCP servers signed in with OAuth: their tokens held here, refreshed here (mcpoauth.mjs). */
513
519
  tethers.oauth = new McpOAuth({ secrets });
514
520
  const stopTethers = tethers.start();
@@ -212,6 +212,11 @@ export const SETTINGS_WORDS_FR = {
212
212
  'set-rt-mcp-hint-frame': 'Votre choix pour chaque sorte d\'outil',
213
213
  /* A browser paired through the Tether extension (browsers.mjs): the form, its panel, Frame's sites. */
214
214
  'set-na-k-browser': 'Navigateur', 'set-br-head': 'Associer un navigateur',
215
+ 'set-ag-cancelled': 'Annulé', 'set-na-k-machine': 'Machine (SSH)', 'set-mc-head': 'Ajouter une machine (SSH)', 'set-mc-hint': 'Sa console, ses fichiers ; la clé reste ici.',
216
+ 'set-mc-title': 'Nom', 'set-mc-host': 'Adresse', 'set-mc-user': 'Utilisateur', 'set-mc-key': 'Clé', 'set-mc-no-key': 'Pas encore de clé : en faire une', 'set-mc-key-name': 'Nom de la nouvelle clé',
217
+ 'set-mc-key-line': 'À ajouter dans ~/.ssh/authorized_keys', 'set-mc-more': 'Empreinte du serveur (facultatif)',
218
+ 'set-mc-pin-hint': 'Lue et retenue au premier contact.',
219
+ 'set-mc-add': 'Ajouter', 'set-mc-pinned': 'Empreinte du serveur retenue : {pin}',
215
220
  'set-br-step-install': 'Installez l\'extension Tether.', 'set-br-step-make': 'Créez la configuration, puis copiez-la.',
216
221
  'set-br-step-paste': 'Collez-la dans la fenêtre de l\'extension.', 'set-br-make': 'Créer la configuration',
217
222
  'set-br-config': 'Configuration (une fois, 10 minutes)', 'set-br-wait': 'En attente de l\'extension…',
@@ -0,0 +1,76 @@
1
+ /* A MACHINE REACHED OVER SSH, MADE FROM THE PAGE (17-11): Tether's SSH access (its `ssh` connector), opened
2
+ * with a key MADE HERE -- the same keys as the git repositories (gitaccess.mjs), one list. Its private half
3
+ * never leaves this server: the target names it (`secrets.key` = "sshkey:<name>"), and the keeper asks it
4
+ * of this server at connect time (tethers.mjs reveal), for the connector alone. The person adds the public
5
+ * half to the machine's ~/.ssh/authorized_keys.
6
+ *
7
+ * THE SERVER'S IDENTITY IS PINNED AT ONCE: before the target is made, this server reaches the machine once
8
+ * and reads its host key (no login: the key comes before any authentication). The fingerprint is kept
9
+ * in the target (`config.pin`); a different key later is refused by the connector. A pin given by the
10
+ * person is checked against what the machine shows: they must match.
11
+ *
12
+ * addMachine({ tethers, keys, probe }, body) body { title, host, port?, user, key, pin? }
13
+ * probeHostKey(host, port) -> "SHA256:…" (ssh2, no login)
14
+ */
15
+ import { createHash } from 'node:crypto';
16
+ import { Refusal } from './conversations.mjs';
17
+
18
+ const HOST = /^(?:[A-Za-z0-9](?:[A-Za-z0-9.-]{0,252})|\[[0-9A-Fa-f:.]{2,45}\]|[0-9A-Fa-f:.]{2,45})$/;
19
+ const USER = /^[A-Za-z0-9._][A-Za-z0-9._-]{0,63}$/;
20
+ const KEY = /^[a-z]([a-z0-9-]{0,30}[a-z0-9])?$/;
21
+ export const PROBE_MS = 8000;
22
+ export const SSH_KEY_PREFIX = 'sshkey:';
23
+
24
+ export const fingerprint = (keyBuf) => `SHA256:${createHash('sha256').update(keyBuf).digest('base64').replace(/=+$/, '')}`;
25
+ const samePrint = (a, b) => String(a).replace(/=+$/, '').toLowerCase() === String(b).replace(/=+$/, '').toLowerCase();
26
+
27
+ /* The machine's host key, read once without logging in. */
28
+ export async function probeHostKey(host, port = 22, { Client = null, ms = PROBE_MS } = {}) {
29
+ const C = Client ?? (await import('ssh2')).Client;
30
+ return new Promise((ok, fail) => {
31
+ const client = new C();
32
+ let seen = null; let done = false;
33
+ const end = (fn, v) => { if (done) return; done = true; clearTimeout(timer); try { client.end(); } catch { /* gone */ } fn(v); };
34
+ const timer = setTimeout(() => end(fail, new Error('no answer')), ms);
35
+ client.on('error', (e) => (seen ? end(ok, seen) : end(fail, e)));
36
+ client.on('close', () => (seen ? end(ok, seen) : end(fail, new Error('closed'))));
37
+ client.on('ready', () => end(seen ? ok : fail, seen ?? new Error('no host key')));
38
+ try {
39
+ client.connect({ host, port, username: 'probe', readyTimeout: ms, tryKeyboard: false,
40
+ hostVerifier: (key, cb) => { seen = fingerprint(Buffer.isBuffer(key) ? key : Buffer.from(String(key), 'base64')); if (typeof cb === 'function') { cb(false); return undefined; } return false; } });
41
+ } catch (e) { end(fail, e); }
42
+ });
43
+ }
44
+
45
+ /* An id for the target: from its title, lower case, never taken. */
46
+ const idFrom = (title, taken) => {
47
+ const base = String(title).normalize('NFD').replace(/[̀-ͯ]/g, '').toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 40) || 'machine';
48
+ let id = base; for (let n = 2; taken.has(id); n += 1) id = `${base}-${n}`;
49
+ return id;
50
+ };
51
+
52
+ export async function addMachine({ tethers, keys, probe = probeHostKey }, body) {
53
+ const title = String(body?.title ?? '').trim().slice(0, 80);
54
+ const host = String(body?.host ?? '').trim();
55
+ const user = String(body?.user ?? '').trim();
56
+ const key = String(body?.key ?? '').trim();
57
+ const port = body?.port === undefined || body?.port === '' || body?.port === null ? 22 : Number(body.port);
58
+ if (!title) throw new Refusal(400, 'Give the machine a name.');
59
+ if (!HOST.test(host)) throw new Refusal(400, 'The address is a host name or an IP address, without user or port.');
60
+ if (!Number.isInteger(port) || port < 1 || port > 65535) throw new Refusal(400, 'The port is a number from 1 to 65535.');
61
+ if (!USER.test(user)) throw new Refusal(400, 'The user is a login name: letters, digits, dot, hyphen, underscore.');
62
+ if (!KEY.test(key) || !keys?.keys?.().some((k) => k.name === key)) throw new Refusal(400, 'Choose a key made here, or make one.');
63
+ let seen;
64
+ try { seen = await probe(host, port); } catch (e) { throw new Refusal(502, `The machine could not be reached at ${host}:${port} (${String(e?.message ?? e).slice(0, 120)}).`); }
65
+ const given = String(body?.pin ?? '').trim();
66
+ if (given && !samePrint(given, seen)) throw new Refusal(409, `The machine shows ${seen}, not the fingerprint given: nothing was made. It may not be the machine you think.`);
67
+ const store = tethers.store();
68
+ const id = idFrom(title, new Set(store.targets().map((t) => t.id)));
69
+ const t = store.putTarget({ id, title, kind: 'ssh', connector: 'ssh', config: { host, port, user, pin: seen }, secrets: { key: `${SSH_KEY_PREFIX}${key}` } });
70
+ return { id: t.id, title: t.title, pin: seen };
71
+ }
72
+
73
+ /* The machines a key opens (their titles), for "used by". */
74
+ export const machinesUsing = (tethers) => (key) => {
75
+ try { return tethers.store().targets().filter((t) => t.kind === 'ssh' && (t.secrets?.key ?? '') === `${SSH_KEY_PREFIX}${key}`).map((t) => t.title || t.id); } catch { return []; }
76
+ };
@@ -252,6 +252,12 @@ export class Tethers {
252
252
  at once when Tether says the server refused the one it had (opts.fresh, 16-11). */
253
253
  const fresh = await this.oauth?.access?.(name, { fresh: opts?.fresh === true });
254
254
  if (fresh !== undefined) return fresh;
255
+ /* A machine's SSH key made here (sshmachine.mjs): its private half, from the keys of git access. */
256
+ if (String(name).startsWith('sshkey:')) {
257
+ const key = this.sshKeys?.privateKeyOf?.(String(name).slice('sshkey:'.length));
258
+ if (!key) throw new Error(`no SSH key named "${String(name).slice('sshkey:'.length)}" on this server`);
259
+ return key;
260
+ }
255
261
  const value = this.#secrets?.reveal?.(name);
256
262
  if (value === undefined || value === null) throw new Error(`no secret named "${name}" on this server`);
257
263
  return value;
package/web/app.js CHANGED
@@ -4546,7 +4546,7 @@
4546
4546
  line.append(summary, el('pre', '', rest));
4547
4547
  return line;
4548
4548
  }
4549
- const kindIcon = (kind) => { const name = kind === 'send' || kind === 'demandes' ? 'arrow-up' : kind === 'box' ? 'mic' : kind === 'device' ? 'smartphone' : kind === 'mcp' ? 'link' : kind === 'browser' ? 'globe' : ASSET_KINDS.find((k) => k[0] === kind)?.[2]; const holder = el('span', 'as-ic'); holder.dataset.kind = kind; const svg = kind === 'list' ? listIcon() : name ? window.clavariumIcons?.icon(name) : null; if (svg) holder.append(svg); return holder; };
4549
+ const kindIcon = (kind) => { const name = kind === 'send' || kind === 'demandes' ? 'arrow-up' : kind === 'box' ? 'mic' : kind === 'device' ? 'smartphone' : kind === 'mcp' ? 'link' : kind === 'browser' ? 'globe' : kind === 'machine' ? 'square-terminal' : ASSET_KINDS.find((k) => k[0] === kind)?.[2]; const holder = el('span', 'as-ic'); holder.dataset.kind = kind; const svg = kind === 'list' ? listIcon() : name ? window.clavariumIcons?.icon(name) : null; if (svg) holder.append(svg); return holder; };
4550
4550
  /* A list (Binder's): the set has no such sign, so it is drawn here, in its style. */
4551
4551
  function listIcon() {
4552
4552
  const SVG = 'http://www.w3.org/2000/svg';
@@ -5368,7 +5368,7 @@
5368
5368
  onKind: (k) => {
5369
5369
  giveNew.kind = k; giveNew.level = ''; justMade = null; $('cassets-error').hidden = true; void paintRoomAssets();
5370
5370
  /* Its keys, read here too: Assets may not have been opened yet. */
5371
- if (k === 'git') void getJson('/git-keys', []).then((keys) => paintKeys(keys));
5371
+ if (k === 'git' || k === 'machine') void getJson('/git-keys', []).then((keys) => paintKeys(keys));
5372
5372
  },
5373
5373
  onBack: () => { giveNew.kind = ''; $('cassets-error').hidden = true; void paintRoomAssets(); },
5374
5374
  onAnother: () => { giveNew.kind = made.kind; justMade = null; void paintRoomAssets(); },
@@ -5720,7 +5720,7 @@
5720
5720
  const newKinds = () => [['folder', uiSaid('set-na-k-folder', 'Folder')], ['git', uiSaid('set-na-k-git', 'Git repository')], ['mailbox', uiSaid('set-na-k-mailbox', 'Mailbox')],
5721
5721
  ['agenda', uiSaid('set-na-k-agenda', 'Calendar')], ['contacts', uiSaid('set-na-k-contacts', 'Contacts')], ['secret', uiSaid('set-na-k-secret', 'Secret')], ['list', uiSaid('set-na-k-list', LISTS_WORD.one)],
5722
5722
  /* Step 4: a voice box (paired with a code) and a device (the share sheet, its code) are two kinds of it too. */
5723
- ['box', uiSaid('set-na-k-box', 'Voice box')], ['device', uiSaid('set-na-k-device', 'Device')], ['mcp', uiSaid('set-na-k-mcp', 'MCP server')], ['browser', uiSaid('set-na-k-browser', 'Browser')]]
5723
+ ['box', uiSaid('set-na-k-box', 'Voice box')], ['device', uiSaid('set-na-k-device', 'Device')], ['mcp', uiSaid('set-na-k-mcp', 'MCP server')], ['machine', uiSaid('set-na-k-machine', 'Machine (SSH)')], ['browser', uiSaid('set-na-k-browser', 'Browser')]]
5724
5724
  .map(([kind, label]) => ({ kind, label, icon: kindIcon(kind) }));
5725
5725
  /* A voice box's steps after its kind (the flow: "A NEW VOICE BOX", with the boxes), and the one under way. */
5726
5726
  const BOX_STEPS = ['where', 'plug', 'pair'];
@@ -5750,6 +5750,7 @@
5750
5750
  if (kind === 'box') return paintBoxFlow();
5751
5751
  const form = $(`${addForm(kind)}-box`); form.hidden = false;
5752
5752
  if (kind === 'git') { fillKeyChoice(); showVia(); }
5753
+ if (kind === 'machine') { fillKeyChoice(); void getJson('/git-keys', []).then((keys) => paintKeys(keys)); }
5753
5754
  if (kind === 'list') void fillTemplates();
5754
5755
  if (kind === 'browser') $('browser-address').value = browserAddress();
5755
5756
  return form;
@@ -6302,11 +6303,14 @@
6302
6303
  }
6303
6304
  function agendaEvent(ev) {
6304
6305
  const box = el('details', 'ag-event'); box.dataset.show = ev.show ?? 'busy';
6306
+ if (ev.cancelled) box.dataset.cancelled = '';
6305
6307
  if (agendaOpen === ev.id) box.open = true;
6306
6308
  box.addEventListener('toggle', () => { if (box.open) agendaOpen = ev.id; else if (agendaOpen === ev.id) agendaOpen = ''; });
6307
6309
  const head = el('summary', 'ag-row');
6308
6310
  head.append(el('span', 'ag-time', ev.allDay ? uiSaid('set-ag-allday', 'All day') : hourOf(ev.start)));
6309
6311
  const what = el('span', 'ag-what'); what.append(el('span', 'ag-title', ev.title));
6312
+ /* Cancelled: struck out, and said in words (not by the line alone). */
6313
+ if (ev.cancelled) what.prepend(el('span', 'ag-cancelled', uiSaid('set-ag-cancelled', 'Cancelled')));
6310
6314
  if (ev.location) what.append(el('span', 'ag-where hint', ev.location));
6311
6315
  head.append(what);
6312
6316
  const facts = el('dl', 'ag-facts');
@@ -6360,10 +6364,20 @@
6360
6364
  if (answer.partial) notes.push(el('p', 'hint', uiSaid('set-ag-partial', 'Start times only, for now')));
6361
6365
  holder.replaceChildren(shown, list, ...notes);
6362
6366
  }
6367
+ /* WHILE A CALENDAR, A MAILBOX OR AN ADDRESS BOOK IS READ (17-11, the transitions persona): seen at once -- a turning
6368
+ sign, the word, and grey lines where the rows will come; read again over what is shown, a moving bar on top
6369
+ (style.css, [aria-busy]). Said once to a screen reader (role=status). */
6370
+ function readingNote(rows) {
6371
+ const box = el('div', 'as-reading'); box.setAttribute('role', 'status');
6372
+ const head = el('p', 'as-reading-head'); head.append(el('span', 'as-spin'), el('span', '', uiSaid('set-ag-reading', 'Reading…')));
6373
+ box.append(head);
6374
+ for (let i = 0; i < rows; i++) { const r = el('div', 'as-skel'); r.setAttribute('aria-hidden', 'true'); r.style.setProperty('--w', `${[78, 62, 86, 54][i % 4]}%`); box.append(r); }
6375
+ return box;
6376
+ }
6363
6377
  async function agendaFill(holder, target, opts) {
6364
6378
  const from = agendaFrom.get(target) ?? wallNow(agendaZone).slice(0, 10);
6365
6379
  holder.setAttribute('aria-busy', 'true');
6366
- if (!holder.childElementCount) holder.append(el('p', 'hint', uiSaid('set-ag-reading', 'Reading…')));
6380
+ if (!holder.childElementCount) holder.append(readingNote(4));
6367
6381
  const answer = await agendaRead(target, from, opts);
6368
6382
  holder.removeAttribute('aria-busy');
6369
6383
  if (!holder.isConnected) return;
@@ -6400,7 +6414,7 @@
6400
6414
  function consoleView(target) {
6401
6415
  let v = consoleViews.get(target.id);
6402
6416
  if (v) { v.target = target; return v; }
6403
- v = { id: target.id, target, state: null, socket: null, phase: 'connecting', focused: false, full: false, chat: null, chatOf: '', chatPick: '', waiting: [], opened: false, retry: 0, away: 0, from: '' };
6417
+ v = { id: target.id, target, state: null, socket: null, phase: 'connecting', focused: false, full: false, below: false, chat: null, chatOf: '', chatPick: '', waiting: [], opened: false, retry: 0, away: 0, from: '' };
6404
6418
  consoleViews.set(target.id, v);
6405
6419
  const root = el('div', 'sc'); root.dataset.target = target.id;
6406
6420
  const presence = el('div', 'sc-presence'); presence.setAttribute('aria-live', 'polite');
@@ -6413,15 +6427,17 @@
6413
6427
  const secret = scButton('sc-secret', uiSaid('set-sc-secret', 'Hidden input')); secret.setAttribute('aria-pressed', 'false');
6414
6428
  const ctrlc = scButton('quiet sc-ctrlc', 'Ctrl C'); ctrlc.title = uiSaid('set-sc-ctrlc', 'Interrupts what is running');
6415
6429
  const full = scButton('quiet sc-full-btn', uiSaid('set-sc-full', 'Full screen')); full.setAttribute('aria-pressed', 'false');
6430
+ /* The chat of the conversation that holds the machine, under the console (17-11: the same chat, never one of its own). */
6431
+ const chatBtn = scButton('quiet sc-chat-btn', uiSaid('set-sc-chat', 'Chat')); chatBtn.setAttribute('aria-pressed', 'false');
6416
6432
  const reopen = scButton('primary sc-reopen', uiSaid('set-sc-reopen', 'Open it again')); reopen.hidden = true;
6417
- const tools = el('div', 'sc-tools'); tools.append(take, hideAi, secret, el('span', 'sc-space'), ctrlc, full);
6433
+ const tools = el('div', 'sc-tools'); tools.append(take, hideAi, secret, el('span', 'sc-space'), ctrlc, chatBtn, full);
6418
6434
  const main = el('div', 'sc-main'); main.append(presence, screen, banner, keys, tools);
6419
6435
  /* Full screen: the chat of a conversation that holds the machine, beside the console. */
6420
6436
  const chatHead = el('div', 'sc-chat-head');
6421
6437
  const chatBox = el('div', 'sc-chat-thread');
6422
6438
  const side = el('aside', 'sc-chat'); side.setAttribute('aria-label', uiSaid('set-sc-chat', 'Chat')); side.hidden = true; side.append(chatHead, chatBox);
6423
6439
  root.append(main, side);
6424
- Object.assign(v, { root, presence, screen, banner, take, hideAi, secret, fullBtn: full, reopen, chatHead, chatBox, side });
6440
+ Object.assign(v, { root, presence, screen, banner, take, hideAi, secret, fullBtn: full, chatBtn, reopen, chatHead, chatBox, side });
6425
6441
  const term = new Terminal({ ...terminalOptions(), scrollback: 3000 });
6426
6442
  const fitter = new FitAddon.FitAddon(); term.loadAddon(fitter);
6427
6443
  v.term = term; v.fit = () => { if (v.opened && screen.isConnected && screen.offsetWidth > 0) { try { fitter.fit(); } catch { /* not drawn yet */ } } };
@@ -6438,6 +6454,7 @@
6438
6454
  hideAi.addEventListener('click', () => { sendJson({ type: 'hide-ai', on: !(v.state?.hideAi) }); });
6439
6455
  secret.addEventListener('click', () => { sendJson({ type: 'hidden', on: !(v.state?.hidden) }); term.focus(); });
6440
6456
  full.addEventListener('click', () => consoleFull(v, !v.full));
6457
+ chatBtn.addEventListener('click', () => consoleBelow(v, !v.below));
6441
6458
  reopen.addEventListener('click', () => { reopen.hidden = true; consoleConnect(v); });
6442
6459
  /* Where the focus is, kept across paints: given back once the console is in the new panel. */
6443
6460
  root.addEventListener('focusin', () => { v.focused = true; });
@@ -6513,7 +6530,8 @@
6513
6530
  if (v.full === on) return;
6514
6531
  v.full = on;
6515
6532
  v.root.classList.toggle('sc-full', on);
6516
- v.side.hidden = !on;
6533
+ v.side.hidden = !on && !v.below;
6534
+ v.chatBtn.hidden = on;
6517
6535
  const b = v.fullBtn;
6518
6536
  b.setAttribute('aria-pressed', String(on));
6519
6537
  b.textContent = on ? uiSaid('set-sc-leave-full', 'Leave full screen') : uiSaid('set-sc-full', 'Full screen');
@@ -6526,10 +6544,21 @@
6526
6544
  void consoleChat(v);
6527
6545
  } else {
6528
6546
  if (v.fullStep) { const step = v.fullStep; v.fullStep = null; nav.drop(step); }
6529
- v.chat?.destroy(); v.chat = null; v.chatOf = '';
6547
+ if (!v.below) { v.chat?.destroy(); v.chat = null; v.chatOf = ''; }
6530
6548
  }
6531
6549
  requestAnimationFrame(() => { v.fit(); v.term.focus(); });
6532
6550
  }
6551
+ /* The chat under the console, out of full screen: shown or not (the button says which). */
6552
+ function consoleBelow(v, on) {
6553
+ if (v.below === on) return;
6554
+ v.below = on;
6555
+ v.root.classList.toggle('sc-below', on);
6556
+ v.chatBtn.setAttribute('aria-pressed', String(on));
6557
+ if (!v.full) v.side.hidden = !on;
6558
+ if (on) void consoleChat(v);
6559
+ else if (!v.full) { v.chat?.destroy(); v.chat = null; v.chatOf = ''; }
6560
+ requestAnimationFrame(() => v.fit());
6561
+ }
6533
6562
  /* The conversations that hold the machine; the one whose chat is shown: picked, else the one on the console now,
6534
6563
  else the conversation this panel is seen from, else the first. */
6535
6564
  function consoleHolders(v) {
@@ -6557,7 +6586,7 @@
6557
6586
  v.chatBox.replaceChildren();
6558
6587
  if (!conversations.find((c) => c.name === name)?.talk) { v.chatBox.append(el('p', 'hint', uiSaid('set-sc-chat-off', 'The chat of this conversation is off.'))); return; }
6559
6588
  const [{ mount }, words] = await Promise.all([parleyUi(), readWords()]);
6560
- if (!v.full || v.chatOf !== name) return;
6589
+ if (!(v.full || v.below) || v.chatOf !== name) return;
6561
6590
  v.chatBox.dataset.theme = document.documentElement.dataset.theme === 'light' ? 'light' : 'dark';
6562
6591
  /* Parley's own chat view, as in the conversation: its thread read and written the same way. */
6563
6592
  v.chat = mount(v.chatBox, {
@@ -6741,7 +6770,7 @@
6741
6770
  const body = box.querySelector('.mv-body');
6742
6771
  if (body.dataset.filled) return;
6743
6772
  body.dataset.filled = '1';
6744
- body.replaceChildren(el('p', 'hint', uiSaid('set-ag-reading', 'Reading…')));
6773
+ body.replaceChildren(readingNote(2));
6745
6774
  const got = await peekRead(`mail-read|${target}|${folder}|${m.id}`, 'mail-read', { target, id: m.id, folder }, uiSaid('set-mv-failed-one', 'This message could not be read.'));
6746
6775
  if (!body.isConnected) return;
6747
6776
  if (got.error) { delete body.dataset.filled; body.replaceChildren(el('p', 'error', got.error)); return; }
@@ -6785,7 +6814,7 @@
6785
6814
  async function mailFill(holder, target, opts) {
6786
6815
  const s = peekOf(target);
6787
6816
  holder.setAttribute('aria-busy', 'true');
6788
- if (!holder.childElementCount) holder.append(el('p', 'hint', uiSaid('set-ag-reading', 'Reading…')));
6817
+ if (!holder.childElementCount) holder.append(readingNote(4));
6789
6818
  const answer = await peekRead(`mail-list|${target}|${s.folder}|${s.text}`, 'mail-list', { target, folder: s.folder, text: s.text }, uiSaid('set-mv-failed', 'The mailbox could not be read.'), opts);
6790
6819
  holder.removeAttribute('aria-busy');
6791
6820
  if (!holder.isConnected) return;
@@ -6827,7 +6856,7 @@
6827
6856
  const body = box.querySelector('.mv-body');
6828
6857
  if (body.dataset.filled) return;
6829
6858
  body.dataset.filled = '1';
6830
- body.replaceChildren(el('p', 'hint', uiSaid('set-ag-reading', 'Reading…')));
6859
+ body.replaceChildren(readingNote(2));
6831
6860
  const got = await peekRead(`contact|${target}|${c.id}`, 'contact', { target, id: c.id }, uiSaid('set-ct-failed-one', 'This contact could not be read.'));
6832
6861
  if (!body.isConnected) return;
6833
6862
  if (got.error) { delete body.dataset.filled; body.replaceChildren(el('p', 'error', got.error)); return; }
@@ -6858,7 +6887,7 @@
6858
6887
  async function contactsFill(holder, target, opts) {
6859
6888
  const s = peekOf(target);
6860
6889
  holder.setAttribute('aria-busy', 'true');
6861
- if (!holder.childElementCount) holder.append(el('p', 'hint', uiSaid('set-ag-reading', 'Reading…')));
6890
+ if (!holder.childElementCount) holder.append(readingNote(4));
6862
6891
  const answer = await peekRead(`contacts|${target}|${s.text}`, 'contacts', { target, text: s.text }, uiSaid('set-ct-failed', 'The address book could not be read.'), opts);
6863
6892
  holder.removeAttribute('aria-busy');
6864
6893
  if (!holder.isConnected) return;
@@ -7563,7 +7592,7 @@
7563
7592
  copy.addEventListener('click', () => { void copyField(field, copy); });
7564
7593
  const remove = document.createElement('button'); remove.type = 'button'; remove.textContent = 'Remove';
7565
7594
  const why = document.createElement('span'); why.className = 'hint';
7566
- if (key.usedBy.length) { remove.disabled = true; why.textContent = `removing it would cut ${key.usedBy.join(', ')} off: remove ${key.usedBy.length > 1 ? 'those repositories' : 'that repository'} first`; }
7595
+ if (key.usedBy.length) { remove.disabled = true; why.textContent = `removing it would cut ${key.usedBy.join(', ')} off: remove ${key.usedBy.length > 1 ? 'them' : 'it'} first`; }
7567
7596
  remove.addEventListener('click', () => {
7568
7597
  const sure = document.createElement('button'); sure.type = 'button'; sure.className = 'danger'; sure.textContent = `Yes, remove the key ${key.name} (it cannot be made again)`;
7569
7598
  sure.addEventListener('click', async () => {
@@ -7607,9 +7636,57 @@
7607
7636
  for (const [id, key] of [['git-key-new', 'set-na-new-key'], ['git-key-make-go', 'set-na-create']]) { const b = gitKeyPick.querySelector?.(`#${id}`); if (b) b.dataset.said = key; }
7608
7637
  /* The key offered in "New repository": the one chosen stays chosen. */
7609
7638
  function fillKeyChoice(chosen = $('git-key').value) {
7610
- gitKeyPick.set(gitKeys.map((key) => ({ value: key.name, label: key.usedBy.length ? `${key.name} (used by ${key.usedBy.join(', ')})` : key.name })), chosen);
7639
+ const offered = gitKeys.map((key) => ({ value: key.name, label: key.usedBy.length ? `${key.name} (used by ${key.usedBy.join(', ')})` : key.name }));
7640
+ gitKeyPick.set(offered, chosen);
7611
7641
  showChosenKey();
7642
+ machineKeyPick.set(offered, $('machine-key')?.value || chosen);
7643
+ showMachineKey();
7644
+ }
7645
+ /* A MACHINE (SSH, sshmachine.mjs): the same keys made here; the line for its authorized_keys under the one chosen. */
7646
+ const machineKeyPick = KIT.SecretPicker({
7647
+ ids: { select: 'machine-key', add: 'machine-key-new', row: 'machine-key-make', name: 'machine-key-name', go: 'machine-key-make-go' },
7648
+ none: uiSaid('set-mc-no-key', 'No key yet: make one'), addLabel: uiSaid('set-na-new-key', '+ New key…'), makeLabel: uiSaid('set-na-create', 'Create'), nameLabel: uiSaid('set-mc-key-name', 'Name of the new key'),
7649
+ nameAttrs: { maxlength: '32', pattern: '[a-z]([a-z0-9-]{0,30}[a-z0-9])?', placeholder: 'server-key', spellcheck: 'false', autocapitalize: 'off' },
7650
+ suggest: () => {
7651
+ const taken = new Set(gitKeys.map((k) => k.name));
7652
+ const wanted = $('machine-title').value.trim().normalize('NFD').replace(/[\u0300-\u036f]/g, '').toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^[^a-z]+|-+$/g, '').slice(0, 32);
7653
+ let suggestion = wanted && !taken.has(wanted) ? wanted : '';
7654
+ for (let n = 1; !suggestion; n += 1) if (!taken.has(`key-${n}`)) suggestion = `key-${n}`;
7655
+ return suggestion;
7656
+ },
7657
+ onMake: async (name) => {
7658
+ $('machine-error').hidden = true;
7659
+ try {
7660
+ const made = await post(`${API}/git-keys`, { name });
7661
+ paintKeys(await fetch(`${API}/git-keys`).then((r) => r.json()));
7662
+ machineKeyPick.set(gitKeys.map((key) => ({ value: key.name, label: key.name })), made.name);
7663
+ fillKeyChoice($('git-key').value);
7664
+ showMachineKey();
7665
+ return true;
7666
+ } catch (error) { $('machine-error').textContent = error.message; $('machine-error').hidden = false; return false; }
7667
+ },
7668
+ onChange: () => showMachineKey(),
7669
+ });
7670
+ $('machine-key-pick').append(machineKeyPick);
7671
+ function showMachineKey() {
7672
+ const key = gitKeys.find((k) => k.name === $('machine-key')?.value);
7673
+ $('machine-key-shown').hidden = !key;
7674
+ $('machine-key-line').value = key?.publicKey ?? '';
7612
7675
  }
7676
+ $('machine-key-copy').addEventListener('click', () => { void copyField($('machine-key-line'), $('machine-key-copy')); });
7677
+ $('machine-new').addEventListener('submit', async (event) => {
7678
+ event.preventDefault();
7679
+ $('machine-error').hidden = true;
7680
+ const btn = $('machine-add'); btn.disabled = true;
7681
+ try {
7682
+ const made = await post(`${API}/tether/ssh-add`, { title: $('machine-title').value.trim(), host: $('machine-host').value.trim(), port: $('machine-port').value.trim(), user: $('machine-user').value.trim(), key: $('machine-key').value, pin: $('machine-pin').value.trim() });
7683
+ $('machine-new').reset();
7684
+ paintKeys(await getJson('/git-keys', []));
7685
+ await assetMade($('machine-box'), { key: `connexion:${made.id}`, name: made.title, note: uiSaid('set-mc-pinned', 'Server fingerprint kept: {pin}', { pin: made.pin }), give: (to, level) => grantTarget(made.id, to, targetLevel(level)) });
7686
+ } catch (error) { $('machine-error').textContent = error.message; $('machine-error').hidden = false; }
7687
+ finally { btn.disabled = false; }
7688
+ await paintAssets();
7689
+ });
7613
7690
  function showChosenKey() {
7614
7691
  const key = gitKeys.find((k) => k.name === $('git-key').value);
7615
7692
  $('git-key-shown').hidden = !key;
package/web/index.html CHANGED
@@ -934,6 +934,29 @@
934
934
  </details>
935
935
  </form>
936
936
  </div>
937
+ <div id="machine-box" class="as-form" data-kind="machine"><h3 data-said="set-mc-head">Add a machine (SSH)</h3>
938
+ <p class="hint" data-said="set-mc-hint">Its console, its files; the key stays here.</p>
939
+ <form id="machine-new" autocomplete="off" novalidate>
940
+ <label for="machine-title" data-said="set-mc-title">Name</label>
941
+ <input id="machine-title" maxlength="80" spellcheck="false" placeholder="Home server">
942
+ <label for="machine-host" data-said="set-mc-host">Address</label>
943
+ <div class="row"><input id="machine-host" maxlength="253" spellcheck="false" autocapitalize="off" inputmode="url" placeholder="server.example.com"><input id="machine-port" class="mc-port" inputmode="numeric" maxlength="5" placeholder="22" aria-label="Port"></div>
944
+ <label for="machine-user" data-said="set-mc-user">User</label>
945
+ <input id="machine-user" maxlength="64" spellcheck="false" autocapitalize="off" placeholder="admin">
946
+ <label for="machine-key" data-said="set-mc-key">Key</label>
947
+ <div id="machine-key-pick"></div>
948
+ <div id="machine-key-shown" hidden>
949
+ <label for="machine-key-line" data-said="set-mc-key-line">Add to ~/.ssh/authorized_keys</label>
950
+ <div class="row"><textarea id="machine-key-line" class="public-key" readonly rows="3" spellcheck="false"></textarea><button type="button" id="machine-key-copy">Copy</button></div>
951
+ </div>
952
+ <details class="more"><summary data-said="set-mc-more">Server fingerprint (optional)</summary>
953
+ <p class="hint" data-said="set-mc-pin-hint">Read and kept on first contact.</p>
954
+ <input id="machine-pin" maxlength="200" spellcheck="false" autocapitalize="off" placeholder="SHA256:…" aria-label="Fingerprint">
955
+ </details>
956
+ <p id="machine-error" class="error" role="alert" hidden></p>
957
+ <div class="row"><button type="submit" id="machine-add" class="primary" data-said="set-mc-add">Add</button></div>
958
+ </form>
959
+ </div>
937
960
  <div id="browser-box" class="as-form" data-kind="browser"><h3 data-said="set-br-head">Pair a browser</h3>
938
961
  <ol class="hint br-steps"><li data-said="set-br-step-install">Install the Tether extension.</li><li data-said="set-br-step-make">Make the configuration below, then copy it.</li><li data-said="set-br-step-paste">Paste it in the extension's popup.</li></ol>
939
962
  <form id="browser-new" autocomplete="off">
package/web/style.css CHANGED
@@ -789,6 +789,12 @@ svg.lk-links path.temp { stroke: var(--k-pick); stroke-dasharray: 4 4; }
789
789
  #nav button[aria-current="page"] .nav-ic { stroke: var(--brass); }
790
790
  /* On a wide screen the list above is the menu, always there (the « button shows it when folded): the bar holds only the places of the whole. A phone keeps it: there the list is a screen of its own. */
791
791
  @media (min-width: 701px) { #nav #nav-conversations { display: none; } }
792
+ /* Wide enough, the four places two by two (17-11: a lighter block under the list); narrow, one a line. */
793
+ @media (min-width: 701px) {
794
+ #nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 6.5rem), 1fr)); }
795
+ #nav button { gap: 8px; padding-inline: 8px; min-width: 0; }
796
+ #nav button > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
797
+ }
792
798
  @media (max-width: 700px) {
793
799
  /* A phone: a bar along the bottom, above the system's own strip; gone inside a conversation and while typing. */
794
800
  #nav { grid-row: 2; flex-direction: row; gap: 0; padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0)); border-right: 0; }
@@ -1259,6 +1265,18 @@ header .ic, #folders .ic { width: 18px; height: 18px; fill: none; stroke: curren
1259
1265
  .ag-bar button { padding: 4px 10px; }
1260
1266
  .as-agenda { display: flex; flex-direction: column; gap: 6px; }
1261
1267
  .as-agenda[aria-busy="true"] .ag-days { opacity: .6; }
1268
+ .as-reading { display: flex; flex-direction: column; gap: 8px; padding: 10px 2px; }
1269
+ .as-reading-head { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--ink2); font-size: .875rem; }
1270
+ .as-spin { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--ink2) 30%, transparent); border-top-color: var(--brass); animation: as-spin .8s linear infinite; }
1271
+ .as-skel { height: 12px; width: var(--w, 70%); border-radius: 6px; background: linear-gradient(90deg, color-mix(in srgb, var(--ink) 7%, transparent) 25%, color-mix(in srgb, var(--ink) 14%, transparent) 50%, color-mix(in srgb, var(--ink) 7%, transparent) 75%); background-size: 200% 100%; animation: as-shimmer 1.4s ease-in-out infinite; }
1272
+ /* Read again over what is shown: a bar moving along the top, the rows dimmed. */
1273
+ .as-agenda { position: relative; }
1274
+ .as-agenda[aria-busy="true"]:has(> :not(.as-reading))::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; border-radius: 3px; z-index: 1; background: linear-gradient(90deg, transparent, var(--brass), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: as-bar 1.1s ease-in-out infinite; }
1275
+ .as-agenda[aria-busy="true"] > :not(.as-reading) { opacity: .6; transition: opacity .2s; }
1276
+ @keyframes as-spin { to { transform: rotate(360deg); } }
1277
+ @keyframes as-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
1278
+ @keyframes as-bar { from { background-position: -40% 0; } to { background-position: 140% 0; } }
1279
+ @media (prefers-reduced-motion: reduce) { .as-spin, .as-skel, .as-agenda[aria-busy="true"]::before { animation: none; } }
1262
1280
  .ag-days { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bar); padding: 8px 12px; }
1263
1281
  .ag-day { display: flex; flex-direction: column; gap: 2px; }
1264
1282
  .ag-dayhead { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; font-size: .8125rem; color: var(--ink2); text-transform: capitalize; }
@@ -1278,6 +1296,8 @@ header .ic, #folders .ic { width: 18px; height: 18px; fill: none; stroke: curren
1278
1296
  .ag-where { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1279
1297
  .ag-event[data-show="tentative"] .ag-title { font-style: italic; }
1280
1298
  .ag-event[data-show="free"] .ag-title { font-weight: 400; color: var(--ink2); }
1299
+ .ag-event[data-cancelled] .ag-title, .ag-event[data-cancelled] .ag-where { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--ink2); }
1300
+ .ag-cancelled { align-self: flex-start; font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--danger); }
1281
1301
  .ag-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 0; padding: 4px 6px 8px calc(4.5em + 14px); font-size: .8125rem; }
1282
1302
  .ag-facts dt { color: var(--ink2); }
1283
1303
  .ag-facts dd { margin: 0; overflow-wrap: anywhere; }
@@ -3400,6 +3420,8 @@ span.tile-spark { display: block; height: 22px; }
3400
3420
  .sc-chat-pick { flex: 1; min-width: 0; font: inherit; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; }
3401
3421
  .sc-chat-thread { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
3402
3422
  .sc-chat-thread > .hint { padding: 12px; }
3423
+ /* Out of full screen, the chat under the console (its button): a fixed height, the thread scrolls inside. */
3424
+ .sc.sc-below:not(.sc-full) .sc-chat { height: min(440px, 60vh); margin-top: 10px; }
3403
3425
  :root[data-sc-full] body { overflow: hidden; }
3404
3426
  @media (max-width: 760px), (pointer: coarse) {
3405
3427
  .sc-keys { display: flex; }
@@ -3411,3 +3433,5 @@ span.tile-spark { display: block; height: 22px; }
3411
3433
  .sc.sc-full { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 58fr) minmax(0, 42fr); padding: 6px; gap: 6px; }
3412
3434
  }
3413
3435
  @media (prefers-reduced-motion: reduce) { .sc-main { transition: none; } }
3436
+ .mc-port { max-width: 6em; flex: 0 0 6em; }
3437
+ .kit-na-made .hint { overflow-wrap: anywhere; }