clavarium 0.2.20-next.1 → 0.2.20-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -70,10 +70,12 @@ Built slice by slice; the plan is in `blueprint/architecture.html`, tab
70
70
  Settings; the message is encrypted for that device alone.
71
71
 
72
72
  - **11 - the simple screen**: each conversation can be shown without its
73
- terminal, for whoever does not read one: a box to say what is wanted,
74
- what is ready to read, and what the tool says now as plain text, read by
75
- the page from its own screen. What is written is typed into the same
76
- terminal; the server reads nothing more.
73
+ terminal, for whoever does not read one: its chat (12). While its chat is
74
+ off, its Chat tab says so, with the one button that turns it on and asks
75
+ its tool to use it. A device given its terminal but not its chat keeps
76
+ the plain screen: a box to say what is wanted, what is ready to read, and
77
+ what the tool says now as plain text, read by the page from its own
78
+ screen; what is written is typed into the same terminal.
77
79
 
78
80
  - **12 - talk through the app**: a branching on Clavarium Parley, a project
79
81
  of its own (an npm dependency at an exact version, `clavarium-parley`). Every machine has a
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.20-next.1",
3
+ "version": "0.2.20-next.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "clavarium",
9
- "version": "0.2.20-next.1",
9
+ "version": "0.2.20-next.2",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@xterm/addon-fit": "^0.11.0",
13
13
  "@xterm/xterm": "^6.0.0",
14
- "clavarium-parley": "0.13.0",
14
+ "clavarium-parley": "0.13.1-next.1",
15
15
  "mermaid": "11.17.2",
16
16
  "node-pty": "^1.1.0",
17
17
  "pdfjs-dist": "6.4.299",
@@ -686,9 +686,9 @@
686
686
  }
687
687
  },
688
688
  "node_modules/clavarium-parley": {
689
- "version": "0.13.0",
690
- "resolved": "https://registry.npmjs.org/clavarium-parley/-/clavarium-parley-0.13.0.tgz",
691
- "integrity": "sha512-ZBoPVCucWaaY59bodXznl29Fh7Ig2cTiMIyftUnLYq5F+tqulHzXdTaY53/5s45VBz+ylT6XbbdG55eVjBSbDA==",
689
+ "version": "0.13.1-next.1",
690
+ "resolved": "https://registry.npmjs.org/clavarium-parley/-/clavarium-parley-0.13.1-next.1.tgz",
691
+ "integrity": "sha512-PMjSH3i2NiYYLsQCqrfPp/kgJsOPXgFJOFHcYbuZuqMXgy5oaWVcI4h0p3XCduS5ffYgV5B/iMwRnQCX+8E36Q==",
692
692
  "license": "MIT",
693
693
  "bin": {
694
694
  "parley": "bin/parley.mjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.20-next.1",
3
+ "version": "0.2.20-next.2",
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.",
@@ -44,7 +44,7 @@
44
44
  "dependencies": {
45
45
  "@xterm/addon-fit": "^0.11.0",
46
46
  "@xterm/xterm": "^6.0.0",
47
- "clavarium-parley": "0.13.0",
47
+ "clavarium-parley": "0.13.1-next.1",
48
48
  "mermaid": "11.17.2",
49
49
  "node-pty": "^1.1.0",
50
50
  "pdfjs-dist": "6.4.299",
package/web/app.js CHANGED
@@ -2262,15 +2262,23 @@
2262
2262
  const wanted = talk.on && talkOf === current;
2263
2263
  box.hidden = !wanted;
2264
2264
  /* Where the tool talks through the app, the chat is the whole screen: one box to write in. */
2265
- $('simple-plain').hidden = wanted;
2265
+ /* Its chat off, on this server's own page: said, with the button that turns it on (a device's page keeps the plain screen). */
2266
+ const offer = !DEVICE && !wanted && !noTerminal();
2267
+ $('simple-plain').hidden = wanted || offer;
2268
+ $('chat-turn').hidden = !offer;
2269
+ if (offer) {
2270
+ const possible = !(talkOf === current && talk.possible === false);
2271
+ $('chat-turn-on').hidden = !possible;
2272
+ $('chat-turn-why').textContent = possible ? 'Turned on, its tool talks with you here, as in a messaging app. Its terminal stays one click away.' : 'This conversation works on the disk of its machine: its chat needs its work folder kept here.';
2273
+ }
2266
2274
  $('simple').toggleAttribute('data-chat', wanted);
2267
2275
  /* The ready-made answers type into the terminal: not under a chat. */
2268
- $('room').toggleAttribute('data-chat', wanted && simple);
2276
+ $('room').toggleAttribute('data-chat', (wanted || offer) && simple);
2269
2277
  /* Its chat alone was given, and the owner has not turned it on: said, not left blank. */
2270
2278
  $('chat-off').hidden = !(noTerminal() && !wanted);
2271
2279
  if (noTerminal()) { $('room').setAttribute('data-chat', ''); keysForChat(); say(wanted ? 'chat' : 'chat off', wanted ? 'live' : 'waiting'); }
2272
2280
  /* The bar's dictation types into the terminal: not while the chat is in front, which has its own. */
2273
- if (wanted && simple && stopListening) stopVoice();
2281
+ if ((wanted || offer) && simple && stopListening) stopVoice();
2274
2282
  paintSimple();
2275
2283
  if (!wanted) { thread?.destroy(); thread = null; threadOf = ''; return; }
2276
2284
  if (thread && threadOf === current) { void thread.refresh(); return; }
@@ -2491,6 +2499,23 @@
2491
2499
  catch (error) { $('panel-error').textContent = error.message; $('panel-error').hidden = false; }
2492
2500
  });
2493
2501
  }
2502
+ /* From the Chat tab: on, then its tool is asked to use it -- the same two steps as in its settings. */
2503
+ $('chat-turn-on').addEventListener('click', async () => {
2504
+ const name = current; const button = $('chat-turn-on');
2505
+ if (button.dataset.open) { delete button.dataset.open; button.textContent = 'Turn the chat on'; $('chat-turn-said').textContent = ''; await readTalk(); await paintThread(); return; }
2506
+ button.disabled = true; $('chat-turn-said').textContent = '';
2507
+ try { await post(`${API}/conversations/${encodeURIComponent(name)}/talk`, { on: true }); }
2508
+ catch (error) { $('chat-turn-said').textContent = error.message; button.disabled = false; return; }
2509
+ let asked = '';
2510
+ try { await post(`${API}/conversations/${encodeURIComponent(name)}/talk/invite`, { lang: deviceLang() }); }
2511
+ catch (error) { asked = error.message; }
2512
+ button.disabled = false;
2513
+ if (name !== current) return;
2514
+ void paintGuide(conversations.find((x) => x.name === name));
2515
+ /* Its tool could not be asked: the chat is on all the same; said here, the chat one click away. */
2516
+ if (asked) { $('chat-turn-said').textContent = `The chat is on, but its tool could not be asked to use it: ${asked}`; button.textContent = 'Open the chat'; button.dataset.open = 'yes'; return; }
2517
+ await readTalk(); await paintThread();
2518
+ });
2494
2519
  $('talk-invite').addEventListener('click', async () => {
2495
2520
  try { await post(`${API}/conversations/${encodeURIComponent(current)}/talk/invite`, { lang: deviceLang() }); $('talk-invite').textContent = 'Asked'; setTimeout(() => { $('talk-invite').textContent = 'Ask the tool to use it'; }, 2500); }
2496
2521
  catch (error) { $('panel-error').textContent = error.message; $('panel-error').hidden = false; }
package/web/index.html CHANGED
@@ -97,6 +97,8 @@
97
97
  drawn by Parley, from what the tool posted, never from its screen. -->
98
98
  <div id="simple" hidden>
99
99
  <div id="simple-thread" hidden></div>
100
+ <!-- ITS CHAT TURNED OFF: said, with the one button that turns it on (and asks its tool to use it). -->
101
+ <div id="chat-turn" hidden><p><b>The chat is off for this conversation.</b></p><p id="chat-turn-why">Turned on, its tool talks with you here, as in a messaging app. Its terminal stays one click away.</p><button type="button" class="primary" id="chat-turn-on">Turn the chat on</button><p class="hint" id="chat-turn-said" role="status"></p></div>
100
102
  <div id="simple-plain">
101
103
  <p id="simple-state" role="status"></p>
102
104
  <form id="simple-say" autocomplete="off">
package/web/style.css CHANGED
@@ -385,6 +385,10 @@ footer button.careful { border-style: dashed; color: var(--ink2); }
385
385
  /* The chat takes the whole screen: its box stays at the bottom, the messages scroll above it. */
386
386
  /* On a light screen, brass text is too pale to read: the words in that colour are darker; the buttons keep it. */
387
387
  :root[data-theme="light"] #simple-thread { --parley-ask: #8a5d00; }
388
+ #chat-turn { margin: auto; max-width: 40ch; text-align: center; padding: 32px 8px; }
389
+ #chat-turn p { margin: 0 0 12px; font-size: 1rem; }
390
+ #chat-turn p + p { color: var(--ink2); }
391
+ #chat-turn .hint { margin-top: 10px; font-size: .875rem; }
388
392
  #chat-off { margin: auto; max-width: 36ch; text-align: center; padding: 24px 8px; }
389
393
  #chat-off p { margin: 0 0 10px; font-size: 1rem; }
390
394
  #chat-off p + p { color: var(--ink2); }
@@ -1363,6 +1367,8 @@ select.pill { appearance: auto; }
1363
1367
  @media (pointer: coarse) { #list-resize { width: 18px; margin-right: -9px; } }
1364
1368
  @media (max-width: 700px) { #list-resize { display: none; } }
1365
1369
  #app[data-list="folded"] #list-resize { display: none; }
1370
+ /* A picture open over the page (the chat's viewer, its drawing): nothing of the page under it is grabbed. */
1371
+ #app:has(.parley-zoom:not([hidden])) #list-resize { display: none; }
1366
1372
  /* "Seen" stands apart from what acts on the machine: in the colour of what is fine. */
1367
1373
  .parley-act[data-act="seen"], #health-dismiss { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 60%, transparent); }
1368
1374
  .parley-act[data-act="seen"]:hover, #health-dismiss:hover { background: color-mix(in srgb, var(--ok) 14%, transparent); }