clavarium 0.2.145-beta.1 → 0.2.146-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,19 +1,19 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.145-beta.1",
3
+ "version": "0.2.146-beta.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "clavarium",
9
- "version": "0.2.145-beta.1",
9
+ "version": "0.2.146-beta.1",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@xterm/addon-fit": "^0.11.0",
13
13
  "@xterm/xterm": "^6.0.0",
14
14
  "clavarium-binder": "0.1.59-next.1",
15
15
  "clavarium-docket": "0.1.2-next.2",
16
- "clavarium-parley": "0.17.52-next.1",
16
+ "clavarium-parley": "0.17.54-next.1",
17
17
  "clavarium-tether": "0.1.0-next.49",
18
18
  "mammoth": "1.13.0",
19
19
  "mermaid": "11.17.2",
@@ -787,9 +787,9 @@
787
787
  }
788
788
  },
789
789
  "node_modules/clavarium-parley": {
790
- "version": "0.17.52-next.1",
791
- "resolved": "https://registry.npmjs.org/clavarium-parley/-/clavarium-parley-0.17.52-next.1.tgz",
792
- "integrity": "sha512-He/rzgLU8zQR0jDtQdoyTQqEaaHibPDJVopM5QlBRFGOvjw6R4TWXLPGL1kznjdyo3uKkfEgdv5snhdy5rq3Ng==",
790
+ "version": "0.17.54-next.1",
791
+ "resolved": "https://registry.npmjs.org/clavarium-parley/-/clavarium-parley-0.17.54-next.1.tgz",
792
+ "integrity": "sha512-lawxH2UM/DTWsqkWVWISi8movr4B7G9LewFMMq8i+t/OBTH0pb3+eQ54YkT+rWJ7b9ulkWoRGHdtuSsubez3+w==",
793
793
  "license": "MIT",
794
794
  "bin": {
795
795
  "parley": "bin/parley.mjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.145-beta.1",
3
+ "version": "0.2.146-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.",
@@ -46,7 +46,7 @@
46
46
  "@xterm/xterm": "^6.0.0",
47
47
  "clavarium-binder": "0.1.59-next.1",
48
48
  "clavarium-docket": "0.1.2-next.2",
49
- "clavarium-parley": "0.17.52-next.1",
49
+ "clavarium-parley": "0.17.54-next.1",
50
50
  "clavarium-tether": "0.1.0-next.49",
51
51
  "mammoth": "1.13.0",
52
52
  "mermaid": "11.17.2",
package/server/main.mjs CHANGED
@@ -595,7 +595,7 @@ export async function startHome({ port, host, dataDir, mntDir = dataDir, gitRese
595
595
  const text = `Its tool was stopped: the machine ran out of memory${size}. Give it more in Settings → Machine → Memory, or start it fresh.`;
596
596
  events.add({ kind: 'machine', text: `Machine of ${name}: its tool was stopped for lack of memory${size}`, conversation: name });
597
597
  void alerts.tell({ title: `${name}: its tool ran out of memory`, body: text, url: `/?c=${encodeURIComponent(name)}&open=settings` });
598
- try { talk.event(name, { kind: 'machine-problem', text, tone: 'warn', topic: 'Machine' }); } catch { /* its chat may be off */ }
598
+ try { talk.event(name, { kind: 'machine-problem', text, tone: 'warn', topic: 'Machine', brief: 'Out of memory', actions: ['memory', 'restart', 'terminal'] }); } catch { /* its chat may be off */ }
599
599
  };
600
600
  const stopWatch = capacity.start();
601
601
  /* The curves of the resources (history.mjs): one look a minute, from what the server knows already. */
@@ -630,22 +630,25 @@ export async function startHome({ port, host, dataDir, mntDir = dataDir, gitRese
630
630
  /* The voice by default: Kyutai's Pocket TTS, run here (pocket.mjs); CLAVARIUM_POCKET=0 to leave it out. */
631
631
  pocket: process.env.CLAVARIUM_POCKET === '0' ? null : new Pocket({ dir: `${dataDir}/voices`, log: speechLog }) });
632
632
  boxes = new Boxes({ file: new JsonFile(`${dataDir}/boxes.json`, []),
633
- exists: (name) => all.list().some((c) => c.name === name),
633
+ /* A box speaks in a conversation, or in a room ('room:<id>', #281). */
634
+ exists: (name) => all.list().some((c) => c.name === name) || (/^room:/.test(name) && Boolean(rooms?.has(name.slice(5)))),
634
635
  /* A long recording (a meeting): transcribed in parts, kept beside the conversation for its assistant. */
635
636
  react: (said) => voice.reaction(said),
636
637
  recordDir: `${dataDir}/recordings`, parts: (wav) => voice.transcribeParts(wav), keep: (name, file, text) => talk.keepText(name, file, text),
637
638
  hear: (wav, lang) => hearBox(voice, wav, lang), /* any language heard; one neither the box's (its page's) nor English heard again in the box's (voice.mjs) */
638
639
  /* Said as the person's own message, the room named (one speaker for now). */
639
- say: (name, text, by) => talk.say(name, text, undefined, undefined, 'voice', { by }),
640
+ say: (name, text, by) => (/^room:/.test(name) ? rooms.say(name.slice(5), text, { box: by?.id }) : talk.say(name, text, undefined, undefined, 'voice', { by })),
640
641
  /* Each conversation's thread knows its boxes: their names, and the ids its agent answers. */
641
642
  origin: () => publicOrigin ?? null,
642
- changed: () => { for (const c of all.list()) talk.speakers(c.name, boxes.speakersOf(c.name)); try { syncTargets(tethers.store(), boxes.all()); } catch (error) { console.error(`voice boxes in Tether: ${error.message}`); } },
643
+ changed: () => { try { rooms?.boxesBound(boxes.all()); } catch (error) { console.error(`voice boxes in rooms: ${error.message}`); } for (const c of all.list()) talk.speakers(c.name, boxes.speakersOf(c.name)); try { syncTargets(tethers.store(), boxes.all()); } catch (error) { console.error(`voice boxes in Tether: ${error.message}`); } },
643
644
  speak: (text) => speech.speak(text),
644
645
  log: (line) => events.add({ kind: 'server', text: line }) });
645
646
  /* Rooms (#268): a thread shared by several AIs, the person and boxes (rooms.mjs). */
646
647
  rooms = new Rooms({ file: new JsonFile(`${dataDir}/rooms.json`, []), dir: `${dataDir}/rooms`,
647
648
  say: (name, text, extra) => talk.say(name, text, undefined, undefined, undefined, extra),
648
- rooms: (name, list) => talk.rooms(name, list), conversations: () => all.list(), boxes: () => boxes.all() });
649
+ rooms: (name, list) => talk.rooms(name, list), conversations: () => all.list(), boxes: () => boxes.all(),
650
+ speak: (where, text, ids, how) => { void boxes.agentSaid(where, text, ids, how); } });
651
+ rooms.boxesBound(boxes.all());
649
652
  rooms.refresh();
650
653
  const { server, listening } = serve(port, all, folders, { gate, originOk, shortcuts, voice, sharing, door, secrets, network, signin, mailboxes, gitReview, platform, answerer, wakeups, alerts, talk, gitAccess, gitKeeper, shelf, health, setup, guide, capacity, updates, instance, certificate, team, reacting, machinesMove, serverLogs, history, events, wifi, binders, meshcentral, tethers, accounts, groups, boxes, catalogue, rooms, bundles: new Bundles({ dir: `${dataDir}/imports`, folder: (name) => folders.folder(name) }), repair: (name) => repairTerminal(name) });
651
654
  server.on('close', () => { closing = true; stopBinders(); stopTethers(); clearInterval(historyTimer); clearInterval(secretsTimer); history.save(); stopVmWatch(); stopShelf(); stopHealth(); stopUpdates(); stopWatch(); clearInterval(mailTimer); clearInterval(restartTimer); clearInterval(expiryTimer); clearInterval(answerTimer); clearInterval(wakeTimer); clearInterval(docketTimer); dockets.stop(); clearInterval(gitTimer); talk.stop(); });
package/server/rooms.mjs CHANGED
@@ -24,15 +24,18 @@ export const ROOMS_MAX = 20;
24
24
  export const MEMBERS_MAX = 40;
25
25
  /* Hand-overs between AIs after the person (or a box) last spoke in a room: a few, never a loop. */
26
26
  export const HOPS_MAX = 8;
27
+ /* How long an AI given a message is said to be thinking, at most (it may never answer). */
28
+ export const THINKING_MS = 10 * 60_000;
27
29
  const KINDS = ['person', 'ai', 'box'];
28
30
  const nameOf = (v) => String(v ?? '').replace(/\s+/g, ' ').trim().slice(0, ROOM_NAME_MAX);
29
31
 
30
32
  export class Rooms {
31
- #file; #dir; #say; #rooms; #conversations; #boxes; #now; #hops = new Map();
33
+ #file; #dir; #say; #rooms; #conversations; #boxes; #now; #speak; #hops = new Map(); #thinking = new Map();
32
34
  /* file: a JsonFile of the rooms; dir: where their threads are; say(name, text, extra): a message written in a
33
35
  conversation's own chat (talk.say); rooms(name, list): what a conversation is told of its rooms (talk.rooms);
34
36
  conversations(): the conversations there are; boxes(): the voice boxes there are. */
35
- constructor({ file, dir, say, rooms = () => {}, conversations = () => [], boxes = () => [], now = () => new Date() }) {
37
+ constructor({ file, dir, say, rooms = () => {}, conversations = () => [], boxes = () => [], speak = () => {}, now = () => new Date() }) {
38
+ this.#speak = speak;
36
39
  this.#file = file; this.#dir = dir; this.#say = say; this.#rooms = rooms; this.#conversations = conversations; this.#boxes = boxes; this.#now = now;
37
40
  }
38
41
  #all() { const v = this.#file.get(); return Array.isArray(v) ? v : []; }
@@ -48,7 +51,13 @@ export class Rooms {
48
51
  return room.members.filter((m) => (m.kind === 'ai' ? convs.has(m.ref) : m.kind === 'box' ? boxes.has(m.ref) : true))
49
52
  .map((m) => ({ id: m.id, kind: m.kind, name: m.kind === 'box' ? (boxes.get(m.ref)?.name ?? m.name) : m.kind === 'ai' ? convs.get(m.ref) : m.name, ref: m.ref, ...(m.id === room.host ? { host: true } : {}) }));
50
53
  }
51
- list() { return this.#all().map((r) => ({ id: r.id, name: r.name, host: r.host, members: this.#shown(r), at: r.at })); }
54
+ #think(room, member, on) { const m = this.#thinking.get(room) ?? new Map(); if (on) m.set(member, Date.now()); else m.delete(member); this.#thinking.set(room, m); }
55
+ has(id) { return this.#all().some((r) => r.id === id); }
56
+ /* What came since the owner last looked (#282): the AIs' and the boxes' messages after it. */
57
+ #unread(r) { try { const seen = Date.parse(r.seen ?? '') || 0; return this.#thread(r.id).read({ last: 200 }).messages.filter((m) => (m.from === 'agent' || m.by) && (Date.parse(m.at) || 0) > seen).length; } catch { return 0; } }
58
+ /* Its last message, for the list: when, and its first words. */
59
+ #last(r) { try { const m = this.#thread(r.id).read({ last: 1 }).messages.at(-1); return m ? { at: m.at, text: String(m.text ?? '').replace(/\s+/g, ' ').slice(0, 120), ...(m.by?.name ? { by: m.by.name } : {}) } : null; } catch { return null; } }
60
+ list() { return this.#all().map((r) => ({ id: r.id, name: r.name, host: r.host, members: this.#shown(r), at: r.at, unread: this.#unread(r), last: this.#last(r) })); }
52
61
  get(id) { const r = this.#find(id); return { id: r.id, name: r.name, host: r.host, members: this.#shown(r), at: r.at }; }
53
62
 
54
63
  /* A new room: its name, its AIs (conversation names), its boxes (ids), and which AI is the host (the first by default). */
@@ -111,14 +120,18 @@ export class Rooms {
111
120
  const read = t.read(options);
112
121
  /* A member named in a text (@{id}): its name of the moment, on the screen. */
113
122
  const named = (text) => String(text ?? '').replace(/@\{([0-9a-f-]{36})\}/g, (whole, mid) => { const m = members.find((x) => x.id === mid); return m ? `@${m.name}` : whole; });
114
- return { room: this.get(id), ...read, messages: (read.messages ?? []).map((m) => (typeof m.text === 'string' && m.text.includes('@{') ? { ...m, text: named(m.text) } : m)) };
123
+ if (options?.seen !== false) { const list = this.#all(); const r = list.find((x) => x.id === id); if (r) { r.seen = this.#now().toISOString(); this.#file.set(list); } }
124
+ /* Who has a message of the room and has not answered yet (#282): "Hugo réfléchit…" on the screen. */
125
+ const thinking = [...(this.#thinking.get(id) ?? new Map()).entries()].filter(([, at]) => Date.now() - at < THINKING_MS).map(([mid]) => members.find((m) => m.id === mid)?.name).filter(Boolean);
126
+ return { room: this.get(id), thinking, ...read, messages: (read.messages ?? []).map((m) => (typeof m.text === 'string' && m.text.includes('@{') ? { ...m, text: named(m.text) } : m)) };
115
127
  }
116
128
 
117
129
  /* SOMEONE OF THE PERSON'S SIDE SPEAKS (the person here, a box): kept in the room, given to the host -- or to the
118
130
  AIs named (to: their member ids). */
119
- async say(id, text, { by, to } = {}) {
131
+ async say(id, text, { by, box, to } = {}) {
120
132
  const room = this.#find(id); const members = this.#shown(room);
121
- const who = by ? members.find((m) => m.id === by && m.kind !== 'ai') : members.find((m) => m.kind === 'person');
133
+ /* A box bound to this room speaks in it in its own name (#281): found by its box id. */
134
+ const who = box ? members.find((m) => m.kind === 'box' && m.ref === box) : by ? members.find((m) => m.id === by && m.kind !== 'ai') : members.find((m) => m.kind === 'person');
122
135
  if (!who) throw new Refusal(400, 'Not a member of this room.');
123
136
  const t = this.#thread(room.id);
124
137
  this.#hops.set(room.id, 0);
@@ -128,6 +141,7 @@ export class Rooms {
128
141
  const named = (Array.isArray(to) ? to : []).map((x) => members.find((m) => m.id === x && m.kind === 'ai')).filter(Boolean);
129
142
  const host = members.find((m) => m.id === room.host);
130
143
  for (const ai of named.length ? named : host ? [host] : []) {
144
+ this.#think(room.id, ai.id, true);
131
145
  await this.#say(ai.ref, said.text, { by: { id: who.id, name: who.name, kind: who.kind }, room: { id: room.id, name: room.name, message: said.id } });
132
146
  }
133
147
  return this.read(id);
@@ -145,6 +159,7 @@ export class Rooms {
145
159
  const all = () => t.read({ all: true }).messages;
146
160
  const find = (id) => (typeof id === 'string' && id.length >= 8 ? all().find((m) => m.id.startsWith(id)) : undefined);
147
161
  const re = find(entry.re)?.id;
162
+ if (kind !== 'doing') this.#think(room.id, me.id, false);
148
163
  const ids = new Set(members.map((m) => m.id));
149
164
  const to = Array.isArray(entry.to) ? entry.to.filter((x) => ids.has(x) && x !== me.id) : [];
150
165
  /* The other AIs it is sent to (#280): they get it in their own chat, as said in the room -- never beyond a few
@@ -154,6 +169,7 @@ export class Rooms {
154
169
  const n = (this.#hops.get(room.id) ?? 0) + 1;
155
170
  if (n > HOPS_MAX) return false;
156
171
  this.#hops.set(room.id, n);
172
+ this.#think(room.id, ai.id, true);
157
173
  void this.#say(ai.ref, text, { by: from, room: { id: room.id, name: room.name, message } }).catch(() => {});
158
174
  return true;
159
175
  };
@@ -168,6 +184,9 @@ export class Rooms {
168
184
  /* @Name of a member, exactly: kept as its id (the screen says its name of the moment). */
169
185
  const text = String(entry.text).replace(/@([^\s@{][^@\n]{0,40}?)(?=[\s,.;:!?)]|$)/g, (whole, name) => { const m = members.find((x) => x.name.toLowerCase() === name.toLowerCase()); return m ? `@{${m.id}}` : whole; });
170
186
  const id = t.relay({ text, by: { id: me.id, name: me.name, kind: 'ai' }, to, re, kind: kind === 'doing' ? 'doing' : 'say' });
187
+ /* The boxes it is sent to say it aloud (#281): its words, a member named by its name, never an id. */
188
+ const boxes = to.map((x) => members.find((m) => m.id === x && m.kind === 'box')).filter(Boolean).map((m) => m.ref);
189
+ if (boxes.length) { const aloud = text.replace(/@\{([0-9a-f-]{36})\}/g, (w, mid) => members.find((x) => x.id === mid)?.name ?? ''); try { this.#speak(`room:${room.id}`, aloud, boxes, { doing: kind === 'doing', asked: kind === 'ask' }); } catch { /* the boxes' */ } }
171
190
  if (!forwarded && kind !== 'doing') for (const ai of ais) handOver(ai, text, { id: me.id, name: me.name, kind: 'ai' }, id);
172
191
  return id;
173
192
  }
@@ -182,6 +201,16 @@ export class Rooms {
182
201
  }
183
202
  }
184
203
  refresh() { this.#tellConversations(this.#all()); }
204
+ /* The boxes bound to a room (their conversation 'room:<id>') are members of it, by themselves (#281). */
205
+ boxesBound(boxes) {
206
+ const list = this.#all(); let changed = false;
207
+ for (const b of Array.isArray(boxes) ? boxes : []) {
208
+ const m = /^room:([0-9a-f-]{36})$/.exec(String(b.conversation ?? '')); if (!m) continue;
209
+ const room = list.find((r) => r.id === m[1]);
210
+ if (room && !room.members.some((x) => x.kind === 'box' && x.ref === b.id)) { room.members.push({ id: randomUUID(), kind: 'box', ref: b.id, name: b.name }); changed = true; }
211
+ }
212
+ if (changed) this.#save(list);
213
+ }
185
214
  /* A conversation renamed: its member follows it. */
186
215
  conversationRenamed(from, to) { const list = this.#all(); let moved = false; for (const r of list) for (const m of r.members) if (m.kind === 'ai' && m.ref === from) { m.ref = to; m.name = to; moved = true; } if (moved) this.#save(list); }
187
216
  }
package/server/talk.mjs CHANGED
@@ -293,7 +293,7 @@ export class Talk {
293
293
  if (event.type === 'person-wrote') { this.#want(name); return; }
294
294
  /* What the tool says or asks: a voice box of this conversation may read it aloud (boxes.mjs). */
295
295
  /* Answered in a room it is in (#268): the room takes it, signed by where it came from (rooms.mjs). */
296
- if (['agent-said', 'agent-asked', 'agent-doing'].includes(event.type) && typeof event.message?.room === 'string') { try { this.#inRoom(name, event.message, event.type === 'agent-doing' ? 'doing' : 'say'); } catch { /* the room's */ } return; }
296
+ if (['agent-said', 'agent-asked', 'agent-doing'].includes(event.type) && typeof event.message?.room === 'string') { try { this.#inRoom(name, event.message, event.type === 'agent-doing' ? 'doing' : event.type === 'agent-asked' ? 'ask' : 'say'); } catch { /* the room's */ } return; }
297
297
  if (event.type === 'agent-said' || event.type === 'agent-asked') this.#spoke(name, event.message?.text ?? '', Array.isArray(event.message?.to) ? event.message.to : null, { asked: event.type === 'agent-asked' });
298
298
  /* What it is doing: said by a box that was just spoken to, so nobody waits in silence. */
299
299
  if (event.type === 'agent-doing') this.#spoke(name, event.message?.text ?? '', Array.isArray(event.message?.to) ? event.message.to : null, { doing: true });
@@ -604,7 +604,7 @@ export class Talk {
604
604
  const gone = record.state === 'Running' ? [...before].filter((k) => !keys.includes(k)) : [];
605
605
  if (gone.length) {
606
606
  const said = [...new Set(gone.map((k) => (/^disk:/.test(k) ? 'Its disk has room again.' : k === 'memory-low' ? 'Its memory is no longer short.' : /^oom:/.test(k) ? '' : 'What was wrong with its machine is gone.')).filter(Boolean))];
607
- if (said.length) this.event(name, { kind: 'machine-ok', text: said.join(' '), topic: 'Machine' });
607
+ if (said.length) this.event(name, { kind: 'machine-ok', text: said.join(' '), topic: 'Machine', brief: 'Fixed' });
608
608
  }
609
609
  if (fresh.length === 0) return;
610
610
  this.event(name, {
@@ -612,6 +612,8 @@ export class Talk {
612
612
  text: fresh.map((p) => p.text).join(' '),
613
613
  tone: fresh.some((p) => p.level === 'bad') ? 'bad' : 'warn',
614
614
  topic: 'Machine',
615
+ /* Its name on the one line a problem is in the simple view (Parley, 03-11). */
616
+ brief: fresh.some((p) => p.kind === 'memory' || /^oom:|^memory/.test(p.key ?? '')) ? 'Out of memory' : fresh.every((p) => p.kind === 'disk') ? 'Disk almost full' : 'Machine problem',
615
617
  /* What can be done: a disk short of room is looked at (what takes it) or made larger --
616
618
  a restart frees nothing; otherwise more memory where memory is short, a restart, its terminal. */
617
619
  actions: [...(fresh.every((p) => p.kind === 'disk') ? ['room', 'disk'] : [...(fresh.some((p) => p.kind === 'memory') ? ['memory'] : []), 'restart', 'terminal']), 'seen'],
package/web/app.js CHANGED
@@ -478,6 +478,8 @@
478
478
  document.documentElement.dataset.theme = light ? 'light' : 'dark';
479
479
  /* The chat's colours of meaning (notes, warnings, code) follow the page's theme, not the device's. */
480
480
  $('simple-thread').dataset.theme = light ? 'light' : 'dark';
481
+ /* A room's thread is the same chat (Parley), in the same colours (03-11). */
482
+ $('salon-thread').dataset.theme = light ? 'light' : 'dark';
481
483
  for (const view of document.querySelectorAll('.md-view')) view.dataset.theme = light ? 'light' : 'dark';
482
484
  terminal.options.theme = light ? LIGHT : DARK;
483
485
  document.querySelector('meta[name=theme-color]')?.setAttribute('content', light ? LIGHT.background : DARK.background);
@@ -1228,7 +1230,21 @@
1228
1230
  /* `label`: the name shown; the conversations in no group are one of their own ("Not filed", key NONE). */
1229
1231
  const NONE = '\u0000none';
1230
1232
  /* The two sections above the groups, folded or not like a group (never a group's name: those are plain words). */
1231
- const NEEDS = '\u0001needs'; const RECENT = '\u0001recent'; const GROUPS = '\u0001groups';
1233
+ const NEEDS = '\u0001needs'; const RECENT = '\u0001recent'; const GROUPS = '\u0001groups'; const ROOMS = '\u0001rooms';
1234
+ /* A ROOM IN THE LIST (03-11): like a conversation's row -- its name, its last words, when -- a room's chips before it. */
1235
+ /* The rooms known, even before their part of this page has run (a list painted early). */
1236
+ const roomsNow = () => { try { return Array.isArray(rooms) ? rooms : []; } catch { return []; } };
1237
+ const roomOpenNow = () => { try { return place === 'salon' ? salonId : ''; } catch { return ''; } };
1238
+ function roomItem(r) {
1239
+ const b = document.createElement('button'); b.type = 'button'; b.className = 'item room-item'; b.dataset.room = r.id;
1240
+ const head = document.createElement('b'); head.textContent = r.name;
1241
+ const last = document.createElement('small'); last.textContent = r.last ? `${r.last.by ? `${r.last.by}: ` : ''}${r.last.text}` : `Room \u00b7 ${r.members.filter((m) => m.kind === 'ai').length} AIs`;
1242
+ b.append(head, last);
1243
+ if (r.unread > 0) { const n = document.createElement('span'); n.className = 'salon-unread room-item-unread'; n.textContent = String(r.unread); b.append(n); }
1244
+ if (r.id === roomOpenNow()) b.setAttribute('aria-current', 'true');
1245
+ b.addEventListener('click', () => { void openSalon(r.id); });
1246
+ return b;
1247
+ }
1232
1248
  /* What was just unfolded comes in gently, once (the next paints show it as it is). */
1233
1249
  let justOpened = null;
1234
1250
  const unfolding = (key, els) => { if (justOpened === key) { for (const e of els) e.classList.add('unfolding'); justOpened = null; } return els; };
@@ -1307,8 +1323,11 @@
1307
1323
  const openOne = recent.find((c) => c.name === current);
1308
1324
  if (openOne && !inSight.includes(openOne)) inSight.push(openOne);
1309
1325
  const few = inSight.length;
1310
- if (recent.length && groups.length && section(RECENT, 'Recent', recent)) {
1311
- top.append(...unfolding(RECENT, (showAllRecent ? recent : recent.filter((c) => inSight.includes(c))).map((c) => itemButton(c, true))));
1326
+ /* The rooms used in the last day, among them by when (03-11: « dans le récent, indifféremment »). */
1327
+ const recentRooms = roomsNow().filter((r) => r.last && Date.parse(r.last.at) >= dayAgo);
1328
+ const rowsOfRecent = (list) => [...list.map((c) => ({ at: activityOf(c), el: () => itemButton(c, true) })), ...recentRooms.map((r) => ({ at: Date.parse(r.last.at), el: () => roomItem(r) }))].sort((a, b) => b.at - a.at).map((x) => x.el());
1329
+ if ((recent.length || recentRooms.length) && groups.length && section(RECENT, 'Recent', recent)) {
1330
+ top.append(...unfolding(RECENT, rowsOfRecent(showAllRecent ? recent : recent.filter((c) => inSight.includes(c)))));
1312
1331
  if (recent.length > few) {
1313
1332
  const more = document.createElement('button'); more.type = 'button'; more.className = 'inline more-recent';
1314
1333
  /* A chevron, centred: the words for the pointer and for a screen reader. */
@@ -1322,7 +1341,7 @@
1322
1341
  /* GROUPS: the order chosen by hand, and those in no group as one of their own. */
1323
1342
  if (groups.length) {
1324
1343
  const loose = shown.filter((c) => !c.group);
1325
- groupsOpen = section(GROUPS, 'Groups', conversations.filter((c) => c.hidden !== true));
1344
+ groupsOpen = section(GROUPS, 'Conversation groups', conversations.filter((c) => c.hidden !== true));
1326
1345
  if (loose.length && groupsOpen) items.append(groupBox(NONE, loose, conversations.filter((c) => !c.group).sort(byRank), !folded.has(NONE), 'Not filed'));
1327
1346
  } else {
1328
1347
  /* No group yet: one list, each with what was said last and when -- without those in Needs you
@@ -1343,6 +1362,17 @@
1343
1362
  items.append(groupBox(g, inside, conversations.filter((c) => c.group === g).sort(byRank), Boolean(query) || !folded.has(g)));
1344
1363
  }
1345
1364
  if (groupsOpen) unfolding(GROUPS, [...items.children]);
1365
+ /* ROOMS (03-11): their own list, after the groups of conversations; a search finds them by name. */
1366
+ const roomsShown = roomsNow().filter((r) => !query || r.name.toLowerCase().includes(String(query).toLowerCase()));
1367
+ if (!DEVICE && roomsShown.length) {
1368
+ const b = document.createElement('button'); b.type = 'button'; b.className = 'list-head list-fold'; b.dataset.section = 'rooms';
1369
+ const open = !folded.has(ROOMS); b.setAttribute('aria-expanded', String(open));
1370
+ const chevron = document.createElement('span'); chevron.className = 'list-chevron'; chevron.setAttribute('aria-hidden', 'true'); chevron.textContent = open ? '\u25BE' : '\u25B8';
1371
+ b.append(chevron, document.createTextNode('Rooms'));
1372
+ b.addEventListener('click', () => { if (folded.has(ROOMS)) folded.delete(ROOMS); else folded.add(ROOMS); keepFolded(); paint(); });
1373
+ items.append(b);
1374
+ if (open) items.append(...roomsShown.map((r) => roomItem(r)));
1375
+ }
1346
1376
  /* The folders there are, offered where one is chosen. */
1347
1377
  $('group-names').replaceChildren(...groupsInOrder().map((g) => { const o = document.createElement('option'); o.value = g; return o; }));
1348
1378
  const hits = [...items.querySelectorAll('.item')];
@@ -1539,6 +1569,8 @@
1539
1569
  if (leaving(r)) return;
1540
1570
  if (!r.ok) throw new Error('no api');
1541
1571
  conversations = await r.json();
1572
+ /* The rooms, for the list (their rows, Recent). */
1573
+ try { await loadRooms(); } catch { /* not set up yet */ }
1542
1574
  await readDevices();
1543
1575
  $('list').hidden = false; $('back').hidden = false; $('nav').hidden = false; $('list-resize').hidden = false;
1544
1576
  }
@@ -5074,6 +5106,8 @@
5074
5106
  const card = el('button', 'conv-card conv-card-room'); card.type = 'button'; card.dataset.room = r.id;
5075
5107
  const plate = el('span', 'conv-card-plate'); const dot = el('span', 'conv-card-dot'); dot.dataset.state = 'ready';
5076
5108
  plate.append(dot, el('b', '', r.name));
5109
+ /* What came since it was last opened (#282). */
5110
+ if (r.unread > 0) { const n = el('span', 'salon-unread', String(r.unread > 99 ? '99+' : r.unread)); n.setAttribute('aria-label', `${r.unread} new`); plate.append(n); dot.dataset.state = 'waits'; }
5077
5111
  const art = el('span', 'conv-card-art'); art.style.setProperty('--h', String(huePick(r.name)));
5078
5112
  art.append(el('span', 'conv-card-initial', '\u2302'), memberChips(r.members));
5079
5113
  card.append(plate, art, el('span', 'conv-card-type', `Room \u00b7 ${countOf(r.members)}`), el('span', 'conv-card-text'));
@@ -5096,32 +5130,58 @@
5096
5130
  $('salon-members').replaceChildren(...rows);
5097
5131
  const [{ mount }, words] = await Promise.all([import(new URL('vendor/parley-ui.js', new URL('/', location.href)).href), readWords()]);
5098
5132
  if (salonId !== id) return;
5133
+ $('salon-thread').dataset.theme = document.documentElement.dataset.theme === 'light' ? 'light' : 'dark';
5099
5134
  salonThread = mount($('salon-thread'), {
5100
5135
  words, markdown: true, agentName: '',
5101
- load: (asked = {}) => fetch(`${API}/rooms/${id}/talk${asked.last ? `?last=${asked.last}` : ''}`).then((x) => x.json()),
5136
+ load: (asked = {}) => fetch(`${API}/rooms/${id}/talk${asked.last ? `?last=${asked.last}` : ''}`).then((x) => x.json()).then((d) => {
5137
+ /* Who was given a message and has not answered yet (#282): « Hugo réfléchit… ». */
5138
+ const who = Array.isArray(d?.thinking) ? d.thinking : [];
5139
+ $('salon-thinking').hidden = who.length === 0;
5140
+ $('salon-thinking').replaceChildren(el('span', 'state-dot'), document.createTextNode(`${who.join(', ')} ${who.length > 1 ? 'are' : 'is'} thinking\u2026`));
5141
+ $('salon-thinking').firstChild.dataset.state = 'work';
5142
+ return d;
5143
+ }),
5102
5144
  send: (text) => post(`${API}/rooms/${id}/talk`, { text }),
5145
+ /* The same chat as a conversation's (03-11): its view, its formulas, its dictation, its keyboard rule. */
5146
+ view: chatView, onView: (v) => { chatView = v; try { localStorage.setItem('clavarium-chat-view', v); } catch { /* as above */ } },
5147
+ math: { url: new URL('vendor/katex/katex.mjs', new URL('/', location.href)).href },
5103
5148
  diagram: drawDiagram, highlight: colourCode, touch: touchScreen,
5149
+ voice: chatVoice(), autoSend: chatAuto, onAutoSend: (on) => { chatAuto = on; try { localStorage.setItem('clavarium-chat-auto', on ? '1' : '0'); } catch { /* as above */ } },
5150
+ draft: `room:${id}`,
5104
5151
  });
5105
5152
  salonTimer = setInterval(() => { if (salonThread && salonId === id) void salonThread.refresh(); }, 3000);
5106
5153
  }
5107
5154
  $('salon-close').addEventListener('click', () => leavePlace());
5108
5155
  $('salon-who').addEventListener('click', () => { const open = $('salon-members').hidden; $('salon-members').hidden = !open; $('salon-who').setAttribute('aria-expanded', String(open)); });
5109
- /* A NEW ROOM: its name, its AIs (the first ticked is its host), its boxes. */
5156
+ /* A NEW ROOM (03-11, in the look of a new conversation): its name, its AIs as tiles to pick (the first one
5157
+ picked welcomes the room), its boxes the same. */
5158
+ let salonPicked = [];
5159
+ const salonTile = (value, name, about, box) => {
5160
+ const b = el('button'); b.type = 'button'; b.setAttribute('role', 'checkbox'); b.setAttribute('aria-checked', 'false'); b.dataset.value = value;
5161
+ b.append(el('b', '', name), el('small', '', about));
5162
+ b.addEventListener('click', () => {
5163
+ const on = b.getAttribute('aria-checked') !== 'true'; b.setAttribute('aria-checked', String(on));
5164
+ if (!box) { salonPicked = on ? [...salonPicked, value] : salonPicked.filter((x) => x !== value); paintWelcome(); }
5165
+ });
5166
+ return b;
5167
+ };
5168
+ const paintWelcome = () => { for (const b of $('salon-new-ais').children) { const small = b.querySelector('small'); const host = salonPicked[0] === b.dataset.value; small.replaceChildren(host ? el('span', 'salon-welcome', 'Welcomes the room') : document.createTextNode(small.dataset.about ?? '')); } };
5110
5169
  async function openSalonNew(push = true) {
5111
5170
  if (DEVICE) return;
5112
5171
  enterPlace('salon-new', push);
5113
- $('salon-new-error').hidden = true; $('salon-new-name').value = '';
5114
- const tick = (value, label) => { const l = el('label', 'check'); const i = document.createElement('input'); i.type = 'checkbox'; i.value = value; l.append(i, document.createTextNode(label)); return l; };
5115
- $('salon-new-ais').replaceChildren(...conversations.map((c) => tick(c.name, shownName(c))));
5172
+ $('salon-new-error').hidden = true; $('salon-new-name').value = ''; salonPicked = [];
5173
+ $('salon-new-ais').replaceChildren(...conversations.map((c) => { const t = salonTile(c.name, shownName(c), [c.chatName, c.toolLabel ?? c.tool].filter(Boolean).join(' \u00b7 ') || 'AI'); t.querySelector('small').dataset.about = t.querySelector('small').textContent; return t; }));
5116
5174
  let boxes = []; try { const x = await fetch(`${API}/boxes`); boxes = x.ok ? await x.json() : []; } catch { boxes = []; }
5117
- $('salon-new-boxes').replaceChildren(...(boxes.length ? boxes.map((b) => tick(b.id, b.name)) : [el('span', 'hint', 'None')]));
5175
+ $('salon-new-boxes-card').hidden = boxes.length === 0;
5176
+ $('salon-new-boxes').replaceChildren(...boxes.map((b) => salonTile(b.id, b.name, b.place || 'Voice box', true)));
5118
5177
  $('salon-new-name').focus();
5119
5178
  }
5120
5179
  $('salon-new-close').addEventListener('click', () => leavePlace());
5180
+ $('salon-new-cancel').addEventListener('click', () => leavePlace());
5121
5181
  $('salon-new-create').addEventListener('click', async () => {
5122
- const picked = (box) => [...$(box).querySelectorAll('input:checked')].map((i) => i.value);
5182
+ const boxes = [...$('salon-new-boxes').querySelectorAll('[aria-checked="true"]')].map((b) => b.dataset.value);
5123
5183
  try {
5124
- const made = await post(`${API}/rooms`, { name: $('salon-new-name').value, conversations: picked('salon-new-ais'), boxes: picked('salon-new-boxes') });
5184
+ const made = await post(`${API}/rooms`, { name: $('salon-new-name').value, conversations: salonPicked, boxes, host: salonPicked[0] });
5125
5185
  await openSalon(made.id, false);
5126
5186
  } catch (error) { $('salon-new-error').textContent = error.message; $('salon-new-error').hidden = false; }
5127
5187
  });
@@ -5320,6 +5380,8 @@
5320
5380
  $('assets').hidden = which !== 'assets';
5321
5381
  $('deck').hidden = which !== 'deck';
5322
5382
  $('salon').hidden = which !== 'salon'; $('salon-new').hidden = which !== 'salon-new';
5383
+ /* The places of the whole have a part of the page of their own, over the conversation (03-11). */
5384
+ $('places').hidden = !['access', 'settings', 'assets', 'deck', 'new', 'salon', 'salon-new'].includes(which);
5323
5385
  if (which !== 'salon') { try { salonLeft(); } catch { /* not yet set up */ } }
5324
5386
  $('newconv').hidden = which !== 'new';
5325
5387
  if (which !== 'access') composing = false;
@@ -9311,7 +9373,7 @@
9311
9373
  }
9312
9374
  /* ---- voice boxes (boxes.mjs): pairing codes, the flash from this browser, the list ---- */
9313
9375
  async function paintBoxes() {
9314
- const list = await getJson('/boxes', []);
9376
+ const list = await getJson('/boxes', []); await loadRooms();
9315
9377
  const rows = $('box-list'); rows.replaceChildren();
9316
9378
  const places = el('datalist'); places.id = 'box-places';
9317
9379
  for (const p of [...new Set(list.map((b) => b.place).filter(Boolean))]) { const o = el('option'); o.value = p; places.append(o); }
@@ -9336,6 +9398,8 @@
9336
9398
  /* Its conversation: where what it hears is said, and whose answers it speaks. Changed here at any time. */
9337
9399
  const where = el('select'); where.setAttribute('aria-label', `Conversation of ${b.name}`);
9338
9400
  for (const c of conversations) { const o = el('option', '', shownName(c)); o.value = c.name; where.append(o); }
9401
+ /* Or a room (#281): it speaks there, and says what is sent to it there. */
9402
+ if (rooms.length) { const g = document.createElement('optgroup'); g.label = 'Rooms'; for (const r of rooms) { const o = el('option', '', r.name); o.value = `room:${r.id}`; g.append(o); } where.append(g); }
9339
9403
  where.value = b.conversation;
9340
9404
  where.addEventListener('change', async () => { await post(`${API}/boxes/${b.id}/move`, { conversation: where.value }).catch(() => {}); await paintBoxes(); });
9341
9405
  const whereRow = el('label', 'box-where'); whereRow.append('Speaks in ', where);
package/web/index.html CHANGED
@@ -363,6 +363,176 @@
363
363
  its flows), the devices and what each was given, the assets kept
364
364
  here. Export and Import stay in its header, whatever the tab. A
365
365
  conversation opens it filtered on itself: a badge takes that away. -->
366
+ <!-- SETTINGS: the platform, and this device. -->
367
+ <!-- ASSETS (H): everything kept on this server, by kind; one opened on the
368
+ right: who uses it, its state, its settings. The forms that make
369
+ one, and a repository's remote, wait in #assets-forms and are moved
370
+ into the detail when asked for. -->
371
+ <div id="copy" class="sheet" hidden>
372
+ <div class="panel-top"><b>Copy from the screen</b><button type="button" id="copy-close" aria-label="Close" title="Close">&times;</button></div>
373
+ <p class="hint">The terminal draws its text itself, so it cannot be selected by touch. Here is the same text as ordinary text: select what you need, or copy it all.</p>
374
+ <div class="row"><button type="button" id="copy-all" class="primary">Copy everything</button><span id="copy-status" class="hint" role="status"></span></div>
375
+ <textarea id="copy-text" readonly spellcheck="false" aria-label="Text of the screen"></textarea>
376
+ <b>Paste into the terminal</b>
377
+ <div class="row"><button type="button" id="paste-now" class="primary">Paste what I copied</button><span id="paste-status" class="hint" role="status"></span></div>
378
+ <p class="hint">Or put it here first (a long press offers "Paste"), then send it:</p>
379
+ <textarea id="paste-text" spellcheck="false" aria-label="Text to send to the terminal" placeholder="Paste here"></textarea>
380
+ <div class="row"><button type="button" id="paste-send">Send to the terminal</button></div>
381
+ </div>
382
+ <div id="files" class="sheet" hidden>
383
+ <div class="panel-top"><b>Files</b><button type="button" id="files-close" aria-label="Close" title="Close">&times;</button></div>
384
+ <div id="files-tabs" class="choices" role="tablist" aria-label="Attached folders"></div>
385
+ <p id="files-none" class="hint" hidden>This conversation works on the disk of its machine, and no folder is attached to it. Attach one with "Folders".</p>
386
+ <div class="files-bar">
387
+ <div id="files-path" class="path"></div>
388
+ <div id="files-views" class="levels" role="group" aria-label="Show as">
389
+ <button type="button" data-view="list" aria-pressed="true" title="Show as a list">List</button><button type="button" data-view="icons" aria-pressed="false" title="Show as icons, with pictures">Icons</button>
390
+ </div>
391
+ </div>
392
+ <div class="row" id="files-actions" hidden>
393
+ <button type="button" id="files-import" class="primary"><span class="long">Upload files</span><span class="short">Upload</span></button>
394
+ <button type="button" id="files-import-folder" hidden><span class="long">Upload a folder</span><span class="short">Folder</span></button>
395
+ <button type="button" id="files-new-file"><span class="long">New file</span><span class="short">+ File</span></button>
396
+ <button type="button" id="files-new-folder"><span class="long">New folder</span><span class="short">+ Folder</span></button>
397
+ <span id="files-drop-hint" class="hint" hidden>or drop files and folders here</span>
398
+ <input type="file" id="files-pick" multiple hidden>
399
+ <input type="file" id="files-pick-folder" multiple hidden>
400
+ <span id="files-status" class="hint" role="status"></span>
401
+ </div>
402
+ <p id="files-readonly" class="hint" hidden>Attached read-only: nothing can be imported here.</p>
403
+ <p id="files-error" class="error" role="alert" hidden></p>
404
+ <div id="files-progress" class="files-card" hidden>
405
+ <div class="row"><b id="files-progress-text">Uploading...</b><span class="sp"></span><button type="button" id="files-progress-stop">Stop</button></div>
406
+ <div class="bar" role="progressbar" aria-labelledby="files-progress-text" aria-valuemin="0" aria-valuemax="100" id="files-progress-bar"><span></span></div>
407
+ <small id="files-progress-bytes" class="hint"></small>
408
+ </div>
409
+ <div id="files-ask" class="files-card callout confirm" role="alertdialog" aria-labelledby="files-ask-text" hidden>
410
+ <b id="files-ask-text"></b>
411
+ <div class="action-row"><button type="button" id="files-ask-skip">Skip</button><button type="button" id="files-ask-replace">Replace</button><button type="button" id="files-ask-keep" class="primary">Keep both</button></div>
412
+ <label class="check" id="files-ask-all-line"><input type="checkbox" id="files-ask-all"> <span id="files-ask-all-text">Do the same for the others</span></label>
413
+ </div>
414
+ <form id="files-name" class="files-card" autocomplete="off" hidden>
415
+ <label for="files-name-input" id="files-name-label">Name</label>
416
+ <input id="files-name-input" maxlength="120" spellcheck="false" autocapitalize="none" required>
417
+ <p id="files-name-error" class="error" role="alert" hidden></p>
418
+ <div class="row"><button type="submit" class="primary" id="files-name-go">Create</button><button type="button" id="files-name-cancel">Cancel</button></div>
419
+ </form>
420
+ <div id="files-rows" data-view="list"></div>
421
+ <p id="files-empty" class="hint" hidden>This folder is empty.</p>
422
+ <div id="files-drop" hidden><p id="files-drop-text">Drop to upload here</p></div>
423
+ </div>
424
+ <!-- THE REVIEW (E): one page for what a repository would send, or for one
425
+ commit. The diff is drawn by diff2html from the text of the diff:
426
+ every line is escaped there, nothing the agent wrote is markup. -->
427
+ <div id="gitview" class="review" hidden>
428
+ <div class="rv-head">
429
+ <button type="button" id="gitview-close" class="as-link">&lsaquo; <span id="gitview-back">Back</span></button>
430
+ <b id="gitview-name">Repository</b>
431
+ <span class="rv-branches"><span id="gitview-branch-row" hidden><label for="gitview-branch" class="sr">The agent's branch</label><select id="gitview-branch" class="pill agent"></select></span><span id="gitview-from" class="pill agent"></span><span id="gitview-arrow" aria-hidden="true">&rarr;</span><span id="gitview-target-row" hidden><label for="gitview-target" class="sr">Send to the branch</label><select id="gitview-target" class="pill target"></select><input id="gitview-newbranch" spellcheck="false" autocapitalize="off" autocomplete="off" maxlength="200" placeholder="new-branch-name" aria-label="Name of the new branch" hidden><button type="button" id="gitview-newbranch-go" hidden>Look</button></span></span>
432
+ <span class="rv-acts"><button type="button" id="gitview-again" title="Look again">&#8635;</button><button type="button" id="gitview-check" hidden>Run the checks again</button><button type="button" id="gitview-push" class="primary" hidden>Send</button></span>
433
+ </div>
434
+ <p id="gitview-numbers" class="rv-numbers"></p>
435
+ <p id="gitview-state" role="status"></p>
436
+ <p id="gitview-error" class="error" role="alert" hidden></p>
437
+ <div class="row" id="gitview-offer-row" hidden><button type="button" id="gitview-offer"></button><span class="hint">Only for checks about old dates, modes and author lines, which old tools got wrong. Never for what protects a checkout.</span></div>
438
+ <p id="gitview-remote-go" class="hint" hidden><button type="button" id="gitview-set-remote" class="as-link">Set where it is sent, in Assets</button></p>
439
+ <p id="gitview-read" class="hint" role="status" hidden></p>
440
+ <p id="gitview-dropped" class="hint" hidden></p>
441
+ <div id="gitview-guards" class="rv-good" hidden><b>Good to know</b><ul id="gitview-guards-list"></ul></div>
442
+ <div id="gitview-tabs" class="rv-tabs" role="tablist" aria-label="Review">
443
+ <button type="button" role="tab" data-tab="changes" aria-selected="true">Changes <span class="count" id="gitview-n-files"></span></button>
444
+ <button type="button" role="tab" data-tab="commits" aria-selected="false">Commits <span class="count" id="gitview-n-commits"></span></button>
445
+ <button type="button" role="tab" data-tab="checks" aria-selected="false">Checks <span id="gitview-n-checks"></span></button>
446
+ <span class="rv-layout levels" id="gitview-layout" role="group" aria-label="Layout"><button type="button" data-layout="side-by-side" aria-pressed="true">Side by side</button><button type="button" data-layout="line-by-line" aria-pressed="false">Unified</button></span>
447
+ </div>
448
+ <div id="gitview-pane-changes" class="rv-pane">
449
+ <div class="rv-picker" id="gitview-picker" hidden><button type="button" data-step="-1" aria-label="Previous file">&lsaquo;</button><span id="gitview-picker-at"></span><button type="button" data-step="1" aria-label="Next file">&rsaquo;</button></div>
450
+ <div class="rv-body"><nav id="gitview-tree" class="rv-tree" aria-label="Files changed"></nav><div id="gitview-diff" class="rv-diff"></div></div>
451
+ <pre id="gitview-stat" hidden></pre>
452
+ </div>
453
+ <div id="gitview-pane-commits" class="rv-pane" hidden><div id="gitview-commits"></div></div>
454
+ <div id="gitview-pane-checks" class="rv-pane" hidden>
455
+ <div id="gitview-checks" hidden>
456
+ <p class="hint">Checks run in the agent's machine (its pre-push hook, your check command): a safeguard, not a proof. The tool could make them pass.</p>
457
+ <p id="gitview-checks-state" role="status"></p>
458
+ <pre id="gitview-checks-output"></pre>
459
+ </div>
460
+ <div id="gitview-origin" hidden>
461
+ <p class="hint" id="gitview-origin-where"></p>
462
+ <div class="row"><code id="gitview-origin-fetch"></code></div>
463
+ <div class="row"><button type="button" id="gitview-refresh">Refresh now</button><span class="hint" id="gitview-origin-state" role="status"></span></div>
464
+ </div>
465
+ <details id="gitview-keep-box">
466
+ <summary>Checks, origin, automatic sending</summary>
467
+ <form id="gitview-keep" class="set-rows" autocomplete="off">
468
+ <div class="set-row"><div class="set-what"><label for="gitview-runhook">Pre-push hook</label><small>The project's own, if it has one</small></div><div class="set-control"><input type="checkbox" id="gitview-runhook"></div></div>
469
+ <div class="set-row"><div class="set-what"><label for="gitview-checkcommand">Check command</label><small>Run in the agent's machine, optional</small></div><div class="set-control"><input id="gitview-checkcommand" spellcheck="false" autocapitalize="off" maxlength="500" placeholder="npm test"></div></div>
470
+ <div class="set-row"><div class="set-what"><label for="gitview-checkseconds">Time limit</label><small>Of the checks, in seconds</small></div><div class="set-control"><input id="gitview-checkseconds" type="number" min="10" max="3600" step="1" inputmode="numeric"></div></div>
471
+ <div class="set-row"><div class="set-what"><label for="gitview-require">Checks required</label><small>Send only after they passed</small></div><div class="set-control"><input type="checkbox" id="gitview-require"></div></div>
472
+ <div class="set-row"><div class="set-what"><label for="gitview-refreshminutes">Origin refresh</label><small>Every N minutes · 0: by hand only</small></div><div class="set-control"><input id="gitview-refreshminutes" type="number" min="0" max="1440" step="1" inputmode="numeric"></div></div>
473
+ <div class="set-row"><div class="set-what"><label for="gitview-alert">Phone alerts</label><small>On automatic sendings</small></div><div class="set-control"><input type="checkbox" id="gitview-alert"></div></div>
474
+ <div class="set-row"><div class="set-what"><label for="gitview-tellmoves">Branch moves</label><small>Told to the agent · origin/* is fetched anyway</small></div><div class="set-control"><input type="checkbox" id="gitview-tellmoves"></div></div>
475
+ <p class="hint">Refresh and automatic sending: only while a running machine has it attached. "Refresh now": any time.</p>
476
+ <p class="hint" id="gitview-auto-where">Automatic sending: set for each conversation, in its Access (Write).</p>
477
+ <div class="action-row"><span class="hint" id="gitview-keep-said" role="status"></span><button type="submit" class="primary">Save</button></div>
478
+ </form>
479
+ <b>What was sent by itself, and what went wrong</b>
480
+ <p id="gitview-log-empty" class="hint">Nothing yet.</p>
481
+ <div id="gitview-log"></div>
482
+ </details>
483
+ </div>
484
+ </div>
485
+ <!-- A file, shown over whatever is on the screen; closing it leaves you where you were. -->
486
+ <div id="viewer" role="dialog" aria-modal="true" aria-labelledby="preview-name" hidden>
487
+ <div id="viewer-card">
488
+ <div class="row"><b id="preview-name"></b><span class="sp"></span><button type="button" id="preview-where" class="ico" hidden title="Show in Assets" aria-label="Show in Assets"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 2 2 7l10 5 10-5-10-5z"/><path d="M2 17l10 5 10-5M2 12l10 5 10-5"/></svg></button><button type="button" id="preview-attach" class="ico" hidden title="Attach to a card" aria-label="Attach to a card"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"/></svg></button><button type="button" id="preview-edit" class="ico" hidden title="Edit" aria-label="Edit"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 20h9"/><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z"/></svg></button><button type="button" id="preview-copy" class="ico" hidden title="Copy" aria-label="Copy"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg></button><button type="button" id="preview-full" class="ico" title="Full screen" aria-label="Full screen" aria-pressed="false"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 3H5a2 2 0 0 0-2 2v3M21 8V5a2 2 0 0 0-2-2h-3M3 16v3a2 2 0 0 0 2 2h3M16 21h3a2 2 0 0 0 2-2v-3"/></svg></button><a id="preview-download" class="button ico primary" title="Download" aria-label="Download"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 3v12M7 11l5 5 5-5"/><path d="M5 21h14"/></svg></a><button type="button" id="preview-close" aria-label="Close" title="Close">&times;</button></div>
489
+ <p id="preview-note" class="hint" hidden></p>
490
+ <div id="preview-body"></div>
491
+ </div>
492
+ </div>
493
+ <div id="notice" hidden>
494
+ <span id="notice-spin" class="spin" aria-hidden="true" hidden></span>
495
+ <!-- A start told step by step: what it is, which step of how many, and the time so far. -->
496
+ <div id="notice-head" hidden><p id="notice-title"></p><p id="notice-count"></p></div>
497
+ <ol id="notice-steps" aria-live="polite" hidden></ol>
498
+ <p id="notice-text"></p>
499
+ <ul id="notice-health" class="health-lines" hidden></ul>
500
+ <div class="row"><button id="notice-action" type="button" class="primary"></button><button id="notice-restart" type="button" hidden>Restart the machine...</button><button id="notice-cancel" type="button" hidden>Cancel</button></div>
501
+ </div>
502
+ </main>
503
+ <p id="voice-line" role="status" hidden></p>
504
+ <!-- Saved texts, sent with one click. -->
505
+ <div id="shortcuts" hidden>
506
+ <div id="shortcut-row" class="chips-row"></div>
507
+ <form id="shortcut-new" hidden autocomplete="off">
508
+ <input id="shortcut-label" maxlength="40" placeholder="Label on the button" required aria-label="Label on the button">
509
+ <input id="shortcut-text" maxlength="2000" placeholder="Text typed into the terminal" required aria-label="Text typed into the terminal">
510
+ <label class="check"><input type="checkbox" id="shortcut-enter" checked> press Enter after it</label>
511
+ <div class="row"><button type="submit" class="primary">Save</button><button type="button" id="shortcut-cancel">Cancel</button>
512
+ <span id="shortcut-error" class="error" role="alert" hidden></span></div>
513
+ </form>
514
+ </div>
515
+ <!-- The keys a phone keyboard does not have. -->
516
+ <footer id="keys" data-more="false" title="To select text with the mouse, hold Shift while dragging: what is selected is copied. With a finger, press and hold.">
517
+ <button type="button" data-keys="esc">Esc</button>
518
+ <button type="button" data-keys="tab" class="extra">Tab</button>
519
+ <button type="button" data-keys="left" aria-label="Left">&larr;</button>
520
+ <button type="button" data-keys="down" aria-label="Down">&darr;</button>
521
+ <button type="button" data-keys="up" aria-label="Up">&uarr;</button>
522
+ <button type="button" data-keys="right" aria-label="Right">&rarr;</button>
523
+ <button type="button" data-keys="backspace" class="extra" aria-label="Backspace">&#9003;</button>
524
+ <button type="button" data-keys="enter" class="wide">Enter</button>
525
+ <button type="button" data-keys="stop" class="careful extra" title="Ctrl+C: interrupts what is running">Ctrl+C</button>
526
+ <button type="button" id="copy-open" class="extra" hidden title="Copy text of the screen, or paste">Copy / paste</button>
527
+ <button type="button" id="kbd" aria-pressed="false" data-short="Kbd" hidden title="Show or hide the on-screen keyboard">Keyboard</button>
528
+ <button type="button" id="mic" aria-pressed="false" data-short="Mic" hidden>Dictate</button>
529
+ <button type="button" id="auto" class="extra" aria-pressed="false" hidden title="Press Enter when I stop talking">auto</button>
530
+ <button type="button" id="keys-more" aria-expanded="false" title="More keys, and the ready-made answers">More</button>
531
+ </footer>
532
+ </section>
533
+ <!-- The places of the whole (settings, access, assets, the deck, rooms, a new conversation): not a conversation's,
534
+ so not under its bar -- over it, on their own (03-11). -->
535
+ <section id="places" hidden>
366
536
  <div id="access" class="sheet" hidden>
367
537
  <div class="panel-top access-top">
368
538
  <b>Access</b>
@@ -475,11 +645,6 @@
475
645
  </div>
476
646
  </div>
477
647
  </div>
478
- <!-- SETTINGS: the platform, and this device. -->
479
- <!-- ASSETS (H): everything kept on this server, by kind; one opened on the
480
- right: who uses it, its state, its settings. The forms that make
481
- one, and a repository's remote, wait in #assets-forms and are moved
482
- into the detail when asked for. -->
483
648
  <div id="deck" class="sheet as-place" hidden>
484
649
  <div class="panel-top"><b id="deck-title">Conversations</b><button type="button" id="deck-close" class="as-link place-back">&lsaquo; Back</button></div>
485
650
  <div id="deck-cards" class="deck"></div>
@@ -491,17 +656,26 @@
491
656
  <button type="button" id="salon-who" class="salon-who" aria-expanded="false"></button>
492
657
  <div id="salon-members" class="salon-members" hidden></div>
493
658
  <div id="salon-thread" class="salon-thread"></div>
659
+ <p id="salon-thinking" class="salon-thinking" hidden></p>
494
660
  </div>
495
661
  <div id="salon-new" class="sheet as-place" hidden>
496
662
  <div class="panel-top"><b>New room</b><button type="button" id="salon-new-close" class="as-link place-back">&lsaquo; Back</button></div>
497
- <div class="salon-new-body">
498
- <label class="salon-field">Name<input id="salon-new-name" maxlength="60" placeholder="Home" autocomplete="off"></label>
499
- <h3 class="list-head">AIs</h3><div id="salon-new-ais" class="salon-pick"></div>
500
- <h3 class="list-head">Voice boxes</h3><div id="salon-new-boxes" class="salon-pick"></div>
501
- <p class="hint">The first AI ticked welcomes the room: it answers, or hands the message on.</p>
502
- <p id="salon-new-error" class="error" hidden></p>
503
- <div class="salon-new-acts"><button type="button" id="salon-new-create" class="primary">Create</button></div>
663
+ <div class="nc-body">
664
+ <div class="nc-card">
665
+ <div class="set-row"><div class="set-what"><label for="salon-new-name">Name</label><small>Shown on its card. Can be changed</small></div><div class="set-control"><input id="salon-new-name" maxlength="60" placeholder="Home" spellcheck="false" autocomplete="off"></div></div>
666
+ </div>
667
+ <div class="nc-card">
668
+ <span class="sub-head">AIs</span>
669
+ <div id="salon-new-ais" class="pick" role="group" aria-label="AIs"></div>
670
+ <small class="hint">The first one picked welcomes the room: it answers, or hands the message on.</small>
671
+ </div>
672
+ <div class="nc-card" id="salon-new-boxes-card">
673
+ <span class="sub-head">Voice boxes</span>
674
+ <div id="salon-new-boxes" class="pick" role="group" aria-label="Voice boxes"></div>
675
+ </div>
676
+ <span id="salon-new-error" class="err" role="alert" hidden></span>
504
677
  </div>
678
+ <div class="action-row"><span class="hint" id="salon-new-status"></span><button type="button" id="salon-new-cancel">Cancel</button><button type="button" id="salon-new-create" class="primary">Create</button></div>
505
679
  </div>
506
680
  <div id="assets" class="sheet as-place" hidden>
507
681
  <div class="panel-top"><b>Assets</b><button type="button" id="assets-close" class="as-link place-back">&lsaquo; Conversations</button></div>
@@ -1064,167 +1238,6 @@
1064
1238
  </div>
1065
1239
  <div class="action-row"><span id="newconv-status" class="hint" role="status">Ready in a few minutes</span><button type="button" id="newconv-cancel">Cancel</button><button type="submit" id="newconv-create" class="primary">Create</button></div>
1066
1240
  </form>
1067
- <div id="copy" class="sheet" hidden>
1068
- <div class="panel-top"><b>Copy from the screen</b><button type="button" id="copy-close" aria-label="Close" title="Close">&times;</button></div>
1069
- <p class="hint">The terminal draws its text itself, so it cannot be selected by touch. Here is the same text as ordinary text: select what you need, or copy it all.</p>
1070
- <div class="row"><button type="button" id="copy-all" class="primary">Copy everything</button><span id="copy-status" class="hint" role="status"></span></div>
1071
- <textarea id="copy-text" readonly spellcheck="false" aria-label="Text of the screen"></textarea>
1072
- <b>Paste into the terminal</b>
1073
- <div class="row"><button type="button" id="paste-now" class="primary">Paste what I copied</button><span id="paste-status" class="hint" role="status"></span></div>
1074
- <p class="hint">Or put it here first (a long press offers "Paste"), then send it:</p>
1075
- <textarea id="paste-text" spellcheck="false" aria-label="Text to send to the terminal" placeholder="Paste here"></textarea>
1076
- <div class="row"><button type="button" id="paste-send">Send to the terminal</button></div>
1077
- </div>
1078
- <div id="files" class="sheet" hidden>
1079
- <div class="panel-top"><b>Files</b><button type="button" id="files-close" aria-label="Close" title="Close">&times;</button></div>
1080
- <div id="files-tabs" class="choices" role="tablist" aria-label="Attached folders"></div>
1081
- <p id="files-none" class="hint" hidden>This conversation works on the disk of its machine, and no folder is attached to it. Attach one with "Folders".</p>
1082
- <div class="files-bar">
1083
- <div id="files-path" class="path"></div>
1084
- <div id="files-views" class="levels" role="group" aria-label="Show as">
1085
- <button type="button" data-view="list" aria-pressed="true" title="Show as a list">List</button><button type="button" data-view="icons" aria-pressed="false" title="Show as icons, with pictures">Icons</button>
1086
- </div>
1087
- </div>
1088
- <div class="row" id="files-actions" hidden>
1089
- <button type="button" id="files-import" class="primary"><span class="long">Upload files</span><span class="short">Upload</span></button>
1090
- <button type="button" id="files-import-folder" hidden><span class="long">Upload a folder</span><span class="short">Folder</span></button>
1091
- <button type="button" id="files-new-file"><span class="long">New file</span><span class="short">+ File</span></button>
1092
- <button type="button" id="files-new-folder"><span class="long">New folder</span><span class="short">+ Folder</span></button>
1093
- <span id="files-drop-hint" class="hint" hidden>or drop files and folders here</span>
1094
- <input type="file" id="files-pick" multiple hidden>
1095
- <input type="file" id="files-pick-folder" multiple hidden>
1096
- <span id="files-status" class="hint" role="status"></span>
1097
- </div>
1098
- <p id="files-readonly" class="hint" hidden>Attached read-only: nothing can be imported here.</p>
1099
- <p id="files-error" class="error" role="alert" hidden></p>
1100
- <div id="files-progress" class="files-card" hidden>
1101
- <div class="row"><b id="files-progress-text">Uploading...</b><span class="sp"></span><button type="button" id="files-progress-stop">Stop</button></div>
1102
- <div class="bar" role="progressbar" aria-labelledby="files-progress-text" aria-valuemin="0" aria-valuemax="100" id="files-progress-bar"><span></span></div>
1103
- <small id="files-progress-bytes" class="hint"></small>
1104
- </div>
1105
- <div id="files-ask" class="files-card callout confirm" role="alertdialog" aria-labelledby="files-ask-text" hidden>
1106
- <b id="files-ask-text"></b>
1107
- <div class="action-row"><button type="button" id="files-ask-skip">Skip</button><button type="button" id="files-ask-replace">Replace</button><button type="button" id="files-ask-keep" class="primary">Keep both</button></div>
1108
- <label class="check" id="files-ask-all-line"><input type="checkbox" id="files-ask-all"> <span id="files-ask-all-text">Do the same for the others</span></label>
1109
- </div>
1110
- <form id="files-name" class="files-card" autocomplete="off" hidden>
1111
- <label for="files-name-input" id="files-name-label">Name</label>
1112
- <input id="files-name-input" maxlength="120" spellcheck="false" autocapitalize="none" required>
1113
- <p id="files-name-error" class="error" role="alert" hidden></p>
1114
- <div class="row"><button type="submit" class="primary" id="files-name-go">Create</button><button type="button" id="files-name-cancel">Cancel</button></div>
1115
- </form>
1116
- <div id="files-rows" data-view="list"></div>
1117
- <p id="files-empty" class="hint" hidden>This folder is empty.</p>
1118
- <div id="files-drop" hidden><p id="files-drop-text">Drop to upload here</p></div>
1119
- </div>
1120
- <!-- THE REVIEW (E): one page for what a repository would send, or for one
1121
- commit. The diff is drawn by diff2html from the text of the diff:
1122
- every line is escaped there, nothing the agent wrote is markup. -->
1123
- <div id="gitview" class="review" hidden>
1124
- <div class="rv-head">
1125
- <button type="button" id="gitview-close" class="as-link">&lsaquo; <span id="gitview-back">Back</span></button>
1126
- <b id="gitview-name">Repository</b>
1127
- <span class="rv-branches"><span id="gitview-branch-row" hidden><label for="gitview-branch" class="sr">The agent's branch</label><select id="gitview-branch" class="pill agent"></select></span><span id="gitview-from" class="pill agent"></span><span id="gitview-arrow" aria-hidden="true">&rarr;</span><span id="gitview-target-row" hidden><label for="gitview-target" class="sr">Send to the branch</label><select id="gitview-target" class="pill target"></select><input id="gitview-newbranch" spellcheck="false" autocapitalize="off" autocomplete="off" maxlength="200" placeholder="new-branch-name" aria-label="Name of the new branch" hidden><button type="button" id="gitview-newbranch-go" hidden>Look</button></span></span>
1128
- <span class="rv-acts"><button type="button" id="gitview-again" title="Look again">&#8635;</button><button type="button" id="gitview-check" hidden>Run the checks again</button><button type="button" id="gitview-push" class="primary" hidden>Send</button></span>
1129
- </div>
1130
- <p id="gitview-numbers" class="rv-numbers"></p>
1131
- <p id="gitview-state" role="status"></p>
1132
- <p id="gitview-error" class="error" role="alert" hidden></p>
1133
- <div class="row" id="gitview-offer-row" hidden><button type="button" id="gitview-offer"></button><span class="hint">Only for checks about old dates, modes and author lines, which old tools got wrong. Never for what protects a checkout.</span></div>
1134
- <p id="gitview-remote-go" class="hint" hidden><button type="button" id="gitview-set-remote" class="as-link">Set where it is sent, in Assets</button></p>
1135
- <p id="gitview-read" class="hint" role="status" hidden></p>
1136
- <p id="gitview-dropped" class="hint" hidden></p>
1137
- <div id="gitview-guards" class="rv-good" hidden><b>Good to know</b><ul id="gitview-guards-list"></ul></div>
1138
- <div id="gitview-tabs" class="rv-tabs" role="tablist" aria-label="Review">
1139
- <button type="button" role="tab" data-tab="changes" aria-selected="true">Changes <span class="count" id="gitview-n-files"></span></button>
1140
- <button type="button" role="tab" data-tab="commits" aria-selected="false">Commits <span class="count" id="gitview-n-commits"></span></button>
1141
- <button type="button" role="tab" data-tab="checks" aria-selected="false">Checks <span id="gitview-n-checks"></span></button>
1142
- <span class="rv-layout levels" id="gitview-layout" role="group" aria-label="Layout"><button type="button" data-layout="side-by-side" aria-pressed="true">Side by side</button><button type="button" data-layout="line-by-line" aria-pressed="false">Unified</button></span>
1143
- </div>
1144
- <div id="gitview-pane-changes" class="rv-pane">
1145
- <div class="rv-picker" id="gitview-picker" hidden><button type="button" data-step="-1" aria-label="Previous file">&lsaquo;</button><span id="gitview-picker-at"></span><button type="button" data-step="1" aria-label="Next file">&rsaquo;</button></div>
1146
- <div class="rv-body"><nav id="gitview-tree" class="rv-tree" aria-label="Files changed"></nav><div id="gitview-diff" class="rv-diff"></div></div>
1147
- <pre id="gitview-stat" hidden></pre>
1148
- </div>
1149
- <div id="gitview-pane-commits" class="rv-pane" hidden><div id="gitview-commits"></div></div>
1150
- <div id="gitview-pane-checks" class="rv-pane" hidden>
1151
- <div id="gitview-checks" hidden>
1152
- <p class="hint">Checks run in the agent's machine (its pre-push hook, your check command): a safeguard, not a proof. The tool could make them pass.</p>
1153
- <p id="gitview-checks-state" role="status"></p>
1154
- <pre id="gitview-checks-output"></pre>
1155
- </div>
1156
- <div id="gitview-origin" hidden>
1157
- <p class="hint" id="gitview-origin-where"></p>
1158
- <div class="row"><code id="gitview-origin-fetch"></code></div>
1159
- <div class="row"><button type="button" id="gitview-refresh">Refresh now</button><span class="hint" id="gitview-origin-state" role="status"></span></div>
1160
- </div>
1161
- <details id="gitview-keep-box">
1162
- <summary>Checks, origin, automatic sending</summary>
1163
- <form id="gitview-keep" class="set-rows" autocomplete="off">
1164
- <div class="set-row"><div class="set-what"><label for="gitview-runhook">Pre-push hook</label><small>The project's own, if it has one</small></div><div class="set-control"><input type="checkbox" id="gitview-runhook"></div></div>
1165
- <div class="set-row"><div class="set-what"><label for="gitview-checkcommand">Check command</label><small>Run in the agent's machine, optional</small></div><div class="set-control"><input id="gitview-checkcommand" spellcheck="false" autocapitalize="off" maxlength="500" placeholder="npm test"></div></div>
1166
- <div class="set-row"><div class="set-what"><label for="gitview-checkseconds">Time limit</label><small>Of the checks, in seconds</small></div><div class="set-control"><input id="gitview-checkseconds" type="number" min="10" max="3600" step="1" inputmode="numeric"></div></div>
1167
- <div class="set-row"><div class="set-what"><label for="gitview-require">Checks required</label><small>Send only after they passed</small></div><div class="set-control"><input type="checkbox" id="gitview-require"></div></div>
1168
- <div class="set-row"><div class="set-what"><label for="gitview-refreshminutes">Origin refresh</label><small>Every N minutes · 0: by hand only</small></div><div class="set-control"><input id="gitview-refreshminutes" type="number" min="0" max="1440" step="1" inputmode="numeric"></div></div>
1169
- <div class="set-row"><div class="set-what"><label for="gitview-alert">Phone alerts</label><small>On automatic sendings</small></div><div class="set-control"><input type="checkbox" id="gitview-alert"></div></div>
1170
- <div class="set-row"><div class="set-what"><label for="gitview-tellmoves">Branch moves</label><small>Told to the agent · origin/* is fetched anyway</small></div><div class="set-control"><input type="checkbox" id="gitview-tellmoves"></div></div>
1171
- <p class="hint">Refresh and automatic sending: only while a running machine has it attached. "Refresh now": any time.</p>
1172
- <p class="hint" id="gitview-auto-where">Automatic sending: set for each conversation, in its Access (Write).</p>
1173
- <div class="action-row"><span class="hint" id="gitview-keep-said" role="status"></span><button type="submit" class="primary">Save</button></div>
1174
- </form>
1175
- <b>What was sent by itself, and what went wrong</b>
1176
- <p id="gitview-log-empty" class="hint">Nothing yet.</p>
1177
- <div id="gitview-log"></div>
1178
- </details>
1179
- </div>
1180
- </div>
1181
- <!-- A file, shown over whatever is on the screen; closing it leaves you where you were. -->
1182
- <div id="viewer" role="dialog" aria-modal="true" aria-labelledby="preview-name" hidden>
1183
- <div id="viewer-card">
1184
- <div class="row"><b id="preview-name"></b><span class="sp"></span><button type="button" id="preview-where" class="ico" hidden title="Show in Assets" aria-label="Show in Assets"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 2 2 7l10 5 10-5-10-5z"/><path d="M2 17l10 5 10-5M2 12l10 5 10-5"/></svg></button><button type="button" id="preview-attach" class="ico" hidden title="Attach to a card" aria-label="Attach to a card"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"/></svg></button><button type="button" id="preview-edit" class="ico" hidden title="Edit" aria-label="Edit"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 20h9"/><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z"/></svg></button><button type="button" id="preview-copy" class="ico" hidden title="Copy" aria-label="Copy"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg></button><button type="button" id="preview-full" class="ico" title="Full screen" aria-label="Full screen" aria-pressed="false"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 3H5a2 2 0 0 0-2 2v3M21 8V5a2 2 0 0 0-2-2h-3M3 16v3a2 2 0 0 0 2 2h3M16 21h3a2 2 0 0 0 2-2v-3"/></svg></button><a id="preview-download" class="button ico primary" title="Download" aria-label="Download"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 3v12M7 11l5 5 5-5"/><path d="M5 21h14"/></svg></a><button type="button" id="preview-close" aria-label="Close" title="Close">&times;</button></div>
1185
- <p id="preview-note" class="hint" hidden></p>
1186
- <div id="preview-body"></div>
1187
- </div>
1188
- </div>
1189
- <div id="notice" hidden>
1190
- <span id="notice-spin" class="spin" aria-hidden="true" hidden></span>
1191
- <!-- A start told step by step: what it is, which step of how many, and the time so far. -->
1192
- <div id="notice-head" hidden><p id="notice-title"></p><p id="notice-count"></p></div>
1193
- <ol id="notice-steps" aria-live="polite" hidden></ol>
1194
- <p id="notice-text"></p>
1195
- <ul id="notice-health" class="health-lines" hidden></ul>
1196
- <div class="row"><button id="notice-action" type="button" class="primary"></button><button id="notice-restart" type="button" hidden>Restart the machine...</button><button id="notice-cancel" type="button" hidden>Cancel</button></div>
1197
- </div>
1198
- </main>
1199
- <p id="voice-line" role="status" hidden></p>
1200
- <!-- Saved texts, sent with one click. -->
1201
- <div id="shortcuts" hidden>
1202
- <div id="shortcut-row" class="chips-row"></div>
1203
- <form id="shortcut-new" hidden autocomplete="off">
1204
- <input id="shortcut-label" maxlength="40" placeholder="Label on the button" required aria-label="Label on the button">
1205
- <input id="shortcut-text" maxlength="2000" placeholder="Text typed into the terminal" required aria-label="Text typed into the terminal">
1206
- <label class="check"><input type="checkbox" id="shortcut-enter" checked> press Enter after it</label>
1207
- <div class="row"><button type="submit" class="primary">Save</button><button type="button" id="shortcut-cancel">Cancel</button>
1208
- <span id="shortcut-error" class="error" role="alert" hidden></span></div>
1209
- </form>
1210
- </div>
1211
- <!-- The keys a phone keyboard does not have. -->
1212
- <footer id="keys" data-more="false" title="To select text with the mouse, hold Shift while dragging: what is selected is copied. With a finger, press and hold.">
1213
- <button type="button" data-keys="esc">Esc</button>
1214
- <button type="button" data-keys="tab" class="extra">Tab</button>
1215
- <button type="button" data-keys="left" aria-label="Left">&larr;</button>
1216
- <button type="button" data-keys="down" aria-label="Down">&darr;</button>
1217
- <button type="button" data-keys="up" aria-label="Up">&uarr;</button>
1218
- <button type="button" data-keys="right" aria-label="Right">&rarr;</button>
1219
- <button type="button" data-keys="backspace" class="extra" aria-label="Backspace">&#9003;</button>
1220
- <button type="button" data-keys="enter" class="wide">Enter</button>
1221
- <button type="button" data-keys="stop" class="careful extra" title="Ctrl+C: interrupts what is running">Ctrl+C</button>
1222
- <button type="button" id="copy-open" class="extra" hidden title="Copy text of the screen, or paste">Copy / paste</button>
1223
- <button type="button" id="kbd" aria-pressed="false" data-short="Kbd" hidden title="Show or hide the on-screen keyboard">Keyboard</button>
1224
- <button type="button" id="mic" aria-pressed="false" data-short="Mic" hidden>Dictate</button>
1225
- <button type="button" id="auto" class="extra" aria-pressed="false" hidden title="Press Enter when I stop talking">auto</button>
1226
- <button type="button" id="keys-more" aria-expanded="false" title="More keys, and the ready-made answers">More</button>
1227
- </footer>
1228
1241
  </section>
1229
1242
  </div>
1230
1243
  <script src="/vendor/xterm.js"></script>
package/web/style.css CHANGED
@@ -439,7 +439,7 @@ footer button.careful { border-style: dashed; color: var(--ink2); }
439
439
  /* The conversation with the tool is drawn by Parley; here, only where it sits and this page's colours. */
440
440
  /* The chat takes the whole screen: its box stays at the bottom, the messages scroll above it. */
441
441
  /* On a light screen, brass text is too pale to read: the words in that colour are darker; the buttons keep it. */
442
- :root[data-theme="light"] #simple-thread { --parley-ask: var(--brass-ink); }
442
+ :root[data-theme="light"] :is(#simple-thread, #salon-thread) { --parley-ask: var(--brass-ink); }
443
443
  #chat-turn { margin: auto; max-width: 40ch; text-align: center; padding: 32px 8px; }
444
444
  #chat-turn p { margin: 0 0 12px; font-size: 1rem; }
445
445
  #chat-turn p + p { color: var(--ink2); }
@@ -1107,8 +1107,8 @@ header .ic, #folders .ic { width: 18px; height: 18px; fill: none; stroke: curren
1107
1107
  @media (max-width: 700px) { html:not([data-door="device"]) #room > header #menu { display: none; } }
1108
1108
 
1109
1109
  /* The chat's display settings: an eye, not sliders (Parley draws its own sign; it is masked here). */
1110
- #simple-thread .parley-prefs-open svg { display: none; }
1111
- #simple-thread .parley-prefs-open::before { content: ""; display: inline-block; width: 20px; height: 20px; background: currentColor; vertical-align: middle;
1110
+ #simple-thread .parley-prefs-open svg, #salon-thread .parley-prefs-open svg { display: none; }
1111
+ #simple-thread .parley-prefs-open::before, #salon-thread .parley-prefs-open::before { content: ""; display: inline-block; width: 20px; height: 20px; background: currentColor; vertical-align: middle;
1112
1112
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
1113
1113
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat; }
1114
1114
 
@@ -1888,15 +1888,15 @@ span.callout.confirm { display: inline-flex; justify-content: flex-end; padding:
1888
1888
  /* ---------- A NEW CONVERSATION: a page of its own, as Settings ----------
1889
1889
  The pieces of "one look" (set-row, sub-head, more, chapter, action-row);
1890
1890
  a choice of a few is a card each; Create stays in sight at the bottom. */
1891
- #newconv { gap: 12px; padding: 14px 20px 0; }
1892
- #newconv > .panel-top b { font-size: 1.125rem; }
1893
- #newconv > .nc-body { display: flex; flex-direction: column; gap: 12px; max-width: 720px; width: 100%; }
1894
- #newconv :is(input:not([type=checkbox]):not([type=radio]), select) { font: .875rem var(--sans); color: var(--ink); background-color: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; min-height: 40px; max-width: 100%; box-sizing: border-box; }
1891
+ #salon-new, #newconv { gap: 12px; padding: 14px 20px 0; }
1892
+ :is(#newconv, #salon-new) > .panel-top b { font-size: 1.125rem; }
1893
+ :is(#newconv, #salon-new) > .nc-body { display: flex; flex-direction: column; gap: 12px; max-width: 720px; width: 100%; }
1894
+ :is(#newconv, #salon-new) :is(input:not([type=checkbox]):not([type=radio]), select) { font: .875rem var(--sans); color: var(--ink); background-color: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; min-height: 40px; max-width: 100%; box-sizing: border-box; }
1895
1895
  #newconv select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--ink2) 50%), linear-gradient(135deg, var(--ink2) 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
1896
- #newconv :is(input, select):focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }
1896
+ :is(#newconv, #salon-new) :is(input, select):focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }
1897
1897
  @media (pointer: coarse) { #newconv :is(input:not([type=checkbox]):not([type=radio]), select) { min-height: 44px; } }
1898
1898
  #newconv .set-control > :is(input, select)[aria-invalid=true]:not([type=checkbox]):not([type=radio]) { border-color: var(--danger); }
1899
- #newconv .set-row > .set-control > :is(input, select) { width: 18rem; }
1899
+ :is(#newconv, #salon-new) .set-row > .set-control > :is(input, select) { width: 18rem; }
1900
1900
  #newconv .set-what > .err { font-size: .75rem; color: var(--danger); }
1901
1901
  /* A card of rows, as an open chapter without its fold. */
1902
1902
  .nc-card, #newconv details.chapter { flex-shrink: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--bar); }
@@ -2001,8 +2001,8 @@ details.commit > pre { margin: 6px 0 0 1.6em; white-space: pre-wrap; overflow-wr
2001
2001
  }
2002
2002
  /* Batches beside the chat, on a touch screen: each box to tick and each title take a fingertip, their look unchanged. */
2003
2003
  @media (pointer: coarse) {
2004
- #simple-thread :is(.parley-panel-tick, .parley-panel-title) { position: relative; }
2005
- #simple-thread :is(.parley-panel-tick, .parley-panel-title)::after { content: ""; position: absolute; inset: -6px; }
2004
+ :is(#simple-thread, #salon-thread) :is(.parley-panel-tick, .parley-panel-title) { position: relative; }
2005
+ :is(#simple-thread, #salon-thread) :is(.parley-panel-tick, .parley-panel-title)::after { content: ""; position: absolute; inset: -6px; }
2006
2006
  }
2007
2007
  /* The review on a light screen: line numbers and the "changed" tag readable (diff2html's own greys are too pale). */
2008
2008
  :root[data-theme="light"] .rv-diff { --d2h-dim-color: #5d6b7a; --d2h-change-label-color: var(--brass-ink); }
@@ -2234,8 +2234,19 @@ body.as-dragging #assets-rows .as-row { touch-action: none; }
2234
2234
  .salon-members-row > .hint { width: 4.5rem; }
2235
2235
  .salon-member { display: inline-flex; align-items: center; gap: 6px; font-size: .8125rem; }
2236
2236
  .salon-host { font-size: .6875rem; color: var(--ink2); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; }
2237
- .salon-thread { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 14px 12px; --parley-bg: var(--bg); --parley-text: var(--ink); --parley-dim: var(--ink2); --parley-line: var(--line); --parley-agent: var(--panel); --parley-person: var(--bar); --parley-ask: var(--brass-ink); --parley-wait: var(--wait); --parley-ok: var(--ok); --parley-action: var(--brass-ink); --parley-on-action: var(--on-brass); --parley-live: var(--danger); }
2238
- .salon-new-body { display: flex; flex-direction: column; gap: 10px; padding: 0 14px 24px; max-width: 32rem; }
2239
- .salon-field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .8125rem; }
2240
- .salon-pick { display: flex; flex-direction: column; gap: 4px; }
2241
- .salon-new-acts { display: flex; justify-content: flex-end; }
2237
+ #salon-thread { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 14px 12px; --parley-bg: var(--bg); --parley-text: var(--ink); --parley-dim: var(--ink2); --parley-line: var(--line); --parley-agent: var(--panel); --parley-person: var(--bar); --parley-ask: var(--brass-ink); --parley-wait: var(--wait); --parley-ok: var(--ok); --parley-action: var(--brass-ink); --parley-on-action: var(--on-brass); --parley-live: var(--danger); }
2238
+
2239
+ .salon-unread { font-size: .6875rem; font-weight: 600; min-width: 1.5em; text-align: center; padding: 0 5px; border-radius: 999px; background: var(--wait); color: var(--bg); }
2240
+ .salon-thinking { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0 14px 8px; font-size: .75rem; color: var(--ink2); order: 2; }
2241
+ #salon-new { display: flex; flex-direction: column; }
2242
+ #salon-new[hidden] { display: none; }
2243
+ #salon-new .nc-card > .hint { display: block; padding-top: 0; border-top: 0; }
2244
+ #salon-new .pick .salon-welcome { color: var(--brass-ink); }
2245
+
2246
+ /* THE PLACES OF THE WHOLE (03-11): settings, access, assets, the deck, rooms, a new conversation are not a
2247
+ conversation's -- in a part of the page of their own, over the conversation (which stays as it was, its
2248
+ terminal included), never under its bar. */
2249
+ #places { grid-column: 2; grid-row: 1 / span 2; position: relative; z-index: 4; min-width: 0; min-height: 0; background: var(--panel); }
2250
+ #places[hidden] { display: none; }
2251
+ @media (max-width: 700px) { #places { grid-column: 1; grid-row: 1; } }
2252
+ #app:has(> #list[hidden]) #places { grid-column: 1 / -1; }