clavarium 0.2.57-next.1 → 0.2.58-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.57-next.1",
3
+ "version": "0.2.58-next.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "clavarium",
9
- "version": "0.2.57-next.1",
9
+ "version": "0.2.58-next.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.8-next.1",
15
15
  "clavarium-docket": "0.1.1",
16
- "clavarium-parley": "0.17.5-next.1",
16
+ "clavarium-parley": "0.17.6-next.1",
17
17
  "mermaid": "11.17.2",
18
18
  "node-pty": "^1.1.0",
19
19
  "pdfjs-dist": "6.4.299",
@@ -714,9 +714,9 @@
714
714
  }
715
715
  },
716
716
  "node_modules/clavarium-parley": {
717
- "version": "0.17.5-next.1",
718
- "resolved": "https://registry.npmjs.org/clavarium-parley/-/clavarium-parley-0.17.5-next.1.tgz",
719
- "integrity": "sha512-6yk6eLIs1LLHzByJubOPjc5h4D1lApHhzMwIUrdHEQLxKfplzGgxfD0oPW+kYha5CFfELaKLkHiVSy09lo1JjA==",
717
+ "version": "0.17.6-next.1",
718
+ "resolved": "https://registry.npmjs.org/clavarium-parley/-/clavarium-parley-0.17.6-next.1.tgz",
719
+ "integrity": "sha512-7boIq+mByiORcAHRtkqp/KVYhZWDC1EaT3S4ak1PyYPYZtMFUdIy5w73Affst3+7bnoSvgYrMD0R5YHI8P+LbQ==",
720
720
  "license": "MIT",
721
721
  "bin": {
722
722
  "parley": "bin/parley.mjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.57-next.1",
3
+ "version": "0.2.58-next.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "A conversation is a VM with a terminal in it. Everything else is a folder.",
@@ -46,7 +46,7 @@
46
46
  "@xterm/xterm": "^6.0.0",
47
47
  "clavarium-binder": "0.1.8-next.1",
48
48
  "clavarium-docket": "0.1.1",
49
- "clavarium-parley": "0.17.5-next.1",
49
+ "clavarium-parley": "0.17.6-next.1",
50
50
  "mermaid": "11.17.2",
51
51
  "node-pty": "^1.1.0",
52
52
  "pdfjs-dist": "6.4.299",
package/web/app.js CHANGED
@@ -2519,6 +2519,11 @@
2519
2519
  const name = current;
2520
2520
  if (name !== current || (thread && threadOf === current)) return;
2521
2521
  threadOf = name;
2522
+ /* The short-lived secrets live in this conversation now (secret-scan.mjs): the chat shows each as
2523
+ stars with its time left and a way to forget it. Kept current on each reload, read on each repaint. */
2524
+ const chatSecrets = {};
2525
+ const refreshSecrets = () => { for (const k of Object.keys(chatSecrets)) delete chatSecrets[k]; for (const s of conversations.find((x) => x.name === name)?.ephemeralSecrets ?? []) chatSecrets[s.name] = { expiresInMs: s.expiresInMs }; };
2526
+ refreshSecrets();
2522
2527
  /* The lines of its machine seen so far: what changed comes alone, and their buttons are worked out on all of them. */
2523
2528
  const lines = new Map();
2524
2529
  const withLines = (data, asked) => {
@@ -2532,7 +2537,7 @@
2532
2537
  onView: (v) => { chatView = v; try { localStorage.setItem('clavarium-chat-view', v); } catch { /* as above */ } },
2533
2538
  /* A part of the thread: its end at first, then what changed, the page before on demand (Parley's window). */
2534
2539
  window: windowFor(chatWindow),
2535
- load: (asked = {}) => fetch(talkPath(name, '', asked)).then((r) => r.json()).then((data) => withLines(data, asked)).then(machineLines).then((data) => withMachine(data, name)),
2540
+ load: (asked = {}) => fetch(talkPath(name, '', asked)).then((r) => r.json()).then((data) => withLines(data, asked)).then(machineLines).then((data) => withMachine(data, name)).then((data) => (refreshSecrets(), data)),
2536
2541
  /* The whole thread searched, however little of it is shown. */
2537
2542
  search: (q) => fetch(talkPath(name, '/search', { q })).then((r) => (r.ok ? r.json() : { matches: [], count: 0 })),
2538
2543
  /* `via: 'voice'`: part of it was dictated, said to the tool. */
@@ -2565,6 +2570,9 @@
2565
2570
  /* Its pictures, from the shared folders only, by the same route as the thumbnails of Files (type proved by the bytes, never SVG). */
2566
2571
  picture: (file) => { if (!file.open) return null; const at = file.open.indexOf(':'); return `${API}/files/thumb?${new URLSearchParams({ c: name, r: file.open.slice(0, at), p: file.open.slice(at + 1) })}`; },
2567
2572
  diagram: drawDiagram, highlight: colourCode,
2573
+ /* Short-lived secrets of this conversation: the stars say their time left and offer to forget them. */
2574
+ secrets: chatSecrets,
2575
+ forget: (secretName) => post(`${API}/conversations/${encodeURIComponent(name)}/secrets/${encodeURIComponent(secretName)}/forget`, {}).then(() => { delete chatSecrets[secretName]; if (thread && threadOf === name) void thread.refresh(); }).catch(() => {}),
2568
2576
  remind: () => post(talkPath(name, '/remind'), {}),
2569
2577
  /* The helpers of the terminal, in the chat: this page's voice, the owner's ready answers, the keyboard rule of this device. */
2570
2578
  voice: chatVoice(), autoSend: chatAuto,