clavarium 0.2.203-beta.1 → 0.2.204-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.
- package/npm-shrinkwrap.json +6 -6
- package/package.json +2 -2
- package/server/api.mjs +1 -1
- package/server/conversations.mjs +6 -2
- package/server/door.mjs +1 -1
- package/server/settingswords.mjs +1 -1
- package/server/talk.mjs +7 -1
- package/web/app.js +14 -5
- package/web/style.css +7 -0
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.204-beta.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "clavarium",
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.204-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.62-next.1",
|
|
15
15
|
"clavarium-docket": "0.1.2-next.2",
|
|
16
|
-
"clavarium-parley": "0.17.
|
|
16
|
+
"clavarium-parley": "0.17.92-next.1",
|
|
17
17
|
"clavarium-tether": "0.1.0-next.67",
|
|
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.
|
|
791
|
-
"resolved": "https://registry.npmjs.org/clavarium-parley/-/clavarium-parley-0.17.
|
|
792
|
-
"integrity": "sha512-
|
|
790
|
+
"version": "0.17.92-next.1",
|
|
791
|
+
"resolved": "https://registry.npmjs.org/clavarium-parley/-/clavarium-parley-0.17.92-next.1.tgz",
|
|
792
|
+
"integrity": "sha512-THH8l0YkllcG6J4H1suSthJLgRWYbGnRMj6m90OSqyui7ttVBaeCC1sREVROs+D6KnHS7yZXRdWeFwiK0gwzdQ==",
|
|
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.
|
|
3
|
+
"version": "0.2.204-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.",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@xterm/xterm": "^6.0.0",
|
|
48
48
|
"clavarium-binder": "0.1.62-next.1",
|
|
49
49
|
"clavarium-docket": "0.1.2-next.2",
|
|
50
|
-
"clavarium-parley": "0.17.
|
|
50
|
+
"clavarium-parley": "0.17.92-next.1",
|
|
51
51
|
"clavarium-tether": "0.1.0-next.67",
|
|
52
52
|
"mammoth": "1.13.0",
|
|
53
53
|
"mermaid": "11.17.2",
|
package/server/api.mjs
CHANGED
|
@@ -829,7 +829,7 @@ export async function handleApi(request, response, conversations, headers, resou
|
|
|
829
829
|
if (talking[2] === '/pin') return send(200, await talk.pin(conversation, body.to, body.on !== false)), true;
|
|
830
830
|
if (typeof body.on === 'boolean') { const now = await talk.set(conversation, body.on); retell(conversation); return send(200, now), true; }
|
|
831
831
|
/* What the chat may add to an answer: the choices ticked, the answers of a group, the zone of a picture it is about (Parley checks each). */
|
|
832
|
-
return send(201, await talk.say(conversation, body.text, body.answers, body.files, body.via, { picked: body.picked, replies: body.replies, about: body.about })), true;
|
|
832
|
+
return send(201, await talk.say(conversation, body.text, body.answers, body.files, body.via, { picked: body.picked, replies: body.replies, about: body.about, quick: body.quick === true })), true;
|
|
833
833
|
}
|
|
834
834
|
const docketed = /^\/api\/conversations\/([^/]+)\/docket(\/cancel)?$/.exec(pathname);
|
|
835
835
|
if (docketed && wakeups) {
|
package/server/conversations.mjs
CHANGED
|
@@ -948,7 +948,8 @@ export class Conversations {
|
|
|
948
948
|
/* In its machine: the manifest written aside, then one archive -- the manifest first, then what is kept
|
|
949
949
|
(a path it has not made yet left out), the cache left out. */
|
|
950
950
|
/* (Its paths are plain -- letters, digits, . _ / - -- checked by tools.mjs: given as words.) */
|
|
951
|
-
|
|
951
|
+
/* A reading of an earlier try that never ended (14-11: three left, each holding its pipe): ended first. */
|
|
952
|
+
const script = 'for p in $(pgrep -f "^tar -czf - --warning=no-file-changed -C /tmp/"); do kill $p 2>/dev/null; done; m=$(mktemp -d) || exit 2; printf "%s" "$1" > "$m/clavarium-conversation.json"; '
|
|
952
953
|
+ 'ex=""; for a in $2; do ex="$ex --exclude=./$a"; done; ks=""; for a in $3; do if [ -e "$HOME/$a" ]; then ks="$ks ./$a"; fi; done; '
|
|
953
954
|
+ 'rc=0; tar -czf - --warning=no-file-changed -C "$m" clavarium-conversation.json -C "$HOME" $ex $ks || rc=$?; rm -rf "$m"; '
|
|
954
955
|
/* 1: a file changed while read (its tool writing its log as it is read, 14-11: a live Claude Code): the
|
|
@@ -1074,7 +1075,10 @@ export class Conversations {
|
|
|
1074
1075
|
(D: waiting on the disk), its load, its free memory -- or said not to answer at all. Said with the
|
|
1075
1076
|
wait, and in the end's why (14-11: stuck at 36 KB on the owner's server, never here). */
|
|
1076
1077
|
let seen = '';
|
|
1077
|
-
|
|
1078
|
+
/* Each tar and gzip: its state, what the kernel has it wait on (wchan), the file it holds and that
|
|
1079
|
+
file's filesystem -- enough to tell a disk, a network mount or a pipe nobody empties. */
|
|
1080
|
+
const probe = 'for p in $(pgrep -x tar) $(pgrep -x gzip); do f=$(ls -l /proc/$p/fd 2>/dev/null | grep -o "/home/[^ ]*" | tail -1); '
|
|
1081
|
+
+ 'echo "$(cat /proc/$p/comm) $p $(cut -d" " -f3 /proc/$p/stat) $(cat /proc/$p/wchan 2>/dev/null) ${f#$HOME/}${f:+ [$(stat -f -c %T "$f" 2>/dev/null)]}"; done; '
|
|
1078
1082
|
+ 'echo "load $(cut -d" " -f1 /proc/loadavg)"; awk \'/MemAvailable/{print "free " int($2/1024) " MB"}\' /proc/meminfo';
|
|
1079
1083
|
const ask = () => { seen = '…'; this.#vms.exec(from, ['sh', '-c', probe], { timeoutMs: 20_000 }).then((r) => { seen = r.code === 0 ? (r.stdout || '').trim().split('\n').join(', ').slice(0, 200) : 'its machine did not answer'; }, () => { seen = 'its machine did not answer'; }); };
|
|
1080
1084
|
const watch = setInterval(() => {
|
package/server/door.mjs
CHANGED
|
@@ -188,7 +188,7 @@ export async function handleDoor(request, response, { devices, conversations, re
|
|
|
188
188
|
if (request.headers['content-type'] !== 'application/octet-stream') return send(400, { error: 'An attachment is a file.' });
|
|
189
189
|
return send(201, await talk.attach(name, url.searchParams.get('name') ?? '', request));
|
|
190
190
|
}
|
|
191
|
-
if (request.method === 'POST' && talking[1] === undefined) { const body = await readJson(request); return send(201, await talk.say(name, body.text, body.answers, body.files, body.via)); }
|
|
191
|
+
if (request.method === 'POST' && talking[1] === undefined) { const body = await readJson(request); return send(201, await talk.say(name, body.text, body.answers, body.files, body.via, { quick: body.quick === true })); }
|
|
192
192
|
}
|
|
193
193
|
/* Its terminal does not come: only a device given it asks for it to be repaired. */
|
|
194
194
|
if (request.method === 'POST' && route === '/terminal/repair') { need(part.terminal, 'the terminal'); return send(200, await repair(name)); }
|
package/server/settingswords.mjs
CHANGED
|
@@ -135,7 +135,7 @@ export const SETTINGS_WORDS_FR = {
|
|
|
135
135
|
'set-list-not-filed': 'Sans groupe', 'set-list-asks': 'vous demande', 'set-list-waits': 'vous attend',
|
|
136
136
|
'set-list-asks-for': 'le répondeur vous demande', 'set-list-answered': 'a répondu à votre place',
|
|
137
137
|
'set-list-wakeup': '1 réveil', 'set-list-wakeups': '{n} réveils', 'set-list-hidden': 'cachée',
|
|
138
|
-
'set-list-asleep': 'en veille', 'set-list-stopped': 'arrêtée',
|
|
138
|
+
'set-list-asleep': 'en veille', 'set-list-stopped': 'arrêtée', 'set-reaching': 'Je la retrouve :',
|
|
139
139
|
'set-lent-page': 'Lue pour sa copie « {t} » · rien à faire', 'set-carry-down': 'Elle doit tourner pour exporter ou importer', 'set-list-starting': 'démarre', 'set-list-restarting': 'redémarre',
|
|
140
140
|
'set-list-moving': 'déplace son travail', 'set-list-failed': 'en échec', 'set-list-you': 'Vous : {text}',
|
|
141
141
|
'set-list-fewer': 'En montrer moins', 'set-list-more': 'En montrer {n} de plus',
|
package/server/talk.mjs
CHANGED
|
@@ -497,8 +497,13 @@ export class Talk {
|
|
|
497
497
|
/* The rooms it is in, and who is there (#268): told to its agent, which answers there by their ids. */
|
|
498
498
|
rooms(name, list) { try { this.#parley(name).setRooms(list); } catch { /* its folder is not there yet */ } }
|
|
499
499
|
|
|
500
|
+
/* Whether its chat is on, without reading the thread (`of` builds it all: too dear before each message). */
|
|
501
|
+
#on(name) { return this.#known(name).work === 'kept' && this.#store.get(name)?.on === true; }
|
|
502
|
+
|
|
503
|
+
/* `extra.quick` (the page's own send, 14-11): answered as soon as the message is written -- its tool told
|
|
504
|
+
after, by itself -- so that the message shows at once; the page draws the thread again anyway. */
|
|
500
505
|
async say(name, text, answers, files, via, extra) {
|
|
501
|
-
if (!this
|
|
506
|
+
if (!this.#on(name)) throw new Refusal(409, 'Talking through the app is not turned on for this conversation.');
|
|
502
507
|
const given = files === undefined || files === null ? [] : files;
|
|
503
508
|
if (!Array.isArray(given) || given.length > FILES_MAX) throw new Refusal(400, `A message has ${FILES_MAX} files at most.`);
|
|
504
509
|
/* Only files put here by `attach`: their paths are this server's, and each is there. Each is
|
|
@@ -519,6 +524,7 @@ export class Talk {
|
|
|
519
524
|
let said = text ?? '';
|
|
520
525
|
if (this.#screen && said) { try { said = await this.#screen(name, said); } catch { said = text ?? ''; } }
|
|
521
526
|
try { this.#parley(name).say(said, answers, attached, { via: via === 'voice' ? 'voice' : undefined, ...(extra && typeof extra === 'object' ? { picked: extra.picked, replies: extra.replies, about: extra.about, by: extra.by, room: extra.room } : {}) }); } catch (error) { if (error instanceof RangeError) throw new Refusal(400, error.message); throw error; }
|
|
527
|
+
if (extra?.quick === true) { void this.#wake(name).catch(() => {}); return { ok: true, told: 'later' }; }
|
|
522
528
|
const told = await this.#wake(name);
|
|
523
529
|
return { ...this.of(name), told };
|
|
524
530
|
}
|
package/web/app.js
CHANGED
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
if (pose === null) { if (m) m.hidden = true; return; }
|
|
141
141
|
if (!m) {
|
|
142
142
|
m = document.createElement('div'); m.id = 'notice-mascot'; m.className = 'mascot';
|
|
143
|
-
m.innerHTML = `${MASCOTS[MASCOT]()}<span class="m-z">z</span><span class="m-z">z</span><span class="m-z">z</span>`;
|
|
143
|
+
m.innerHTML = `${MASCOTS[MASCOT]()}<span class="m-z">z</span><span class="m-z">z</span><span class="m-z">z</span><span class="m-q" aria-hidden="true">?</span>`;
|
|
144
144
|
$('notice-text').before(m);
|
|
145
145
|
}
|
|
146
146
|
m.hidden = false;
|
|
@@ -169,9 +169,18 @@
|
|
|
169
169
|
}
|
|
170
170
|
m.classList.remove('waking', 'stirring');
|
|
171
171
|
m.classList.toggle('asleep', pose === 'asleep');
|
|
172
|
+
/* Finding its way back (14-11): the page come back after a while, the server asked again -- a question mark over it. */
|
|
173
|
+
m.classList.toggle('wondering', pose === 'wondering');
|
|
172
174
|
m.dataset.pose = pose;
|
|
173
175
|
};
|
|
174
176
|
|
|
177
|
+
/* A wait that ends goes in a short fade (14-11: not abrupt), its place given back at once. */
|
|
178
|
+
const fadeAway = (box) => {
|
|
179
|
+
if (box.hidden) return;
|
|
180
|
+
if (matchMedia('(prefers-reduced-motion: reduce)').matches) { box.hidden = true; return; }
|
|
181
|
+
box.classList.add('fading-out');
|
|
182
|
+
setTimeout(() => { box.classList.remove('fading-out'); box.hidden = true; }, 160);
|
|
183
|
+
};
|
|
175
184
|
const show = (text, action, run, cancel) => {
|
|
176
185
|
$('notice-text').textContent = text;
|
|
177
186
|
$('notice-action').textContent = action ?? '';
|
|
@@ -869,7 +878,7 @@
|
|
|
869
878
|
it said then was lost -- nobody listened yet. The bridge listens
|
|
870
879
|
from "ready" on. Until it hears, the tool draws for the old size
|
|
871
880
|
and whatever is typed meanwhile lands in a garbled screen. */
|
|
872
|
-
if (message.type === 'ready') { say('live', 'live'); notice
|
|
881
|
+
if (message.type === 'ready') { say('live', 'live'); fadeAway(notice); fit.fit(); sendSize(); setTimeout(() => { fit.fit(); sendSize(); }, 300); }
|
|
873
882
|
/* A start told step by step: the same panel as a build or a restart. */
|
|
874
883
|
if (message.type === 'status' && message.progress) {
|
|
875
884
|
if (message.text) say(String(message.text), 'connecting');
|
|
@@ -881,13 +890,13 @@
|
|
|
881
890
|
not enough for a wait that can last minutes (a tester waited
|
|
882
891
|
three, with nothing else to read). One sentence, with the time
|
|
883
892
|
it has taken so far, said again each second. */
|
|
884
|
-
const said = String(message.text);
|
|
893
|
+
const said = message.text ? String(message.text) : uiSaid('set-reaching', 'Reaching it again:');
|
|
885
894
|
const since = waitingSince || Date.now();
|
|
886
895
|
const tell = () => {
|
|
887
896
|
const s = Math.floor((Date.now() - since) / 1000);
|
|
888
897
|
$('notice-text').textContent = `${said} ${Math.floor(s / 60)}:${String(s % 60).padStart(2, '0')} so far; a start usually takes a minute or two. Its work, its files and its chat are kept.`;
|
|
889
898
|
};
|
|
890
|
-
show(''); tell();
|
|
899
|
+
show(''); tell(); mascot('wondering');
|
|
891
900
|
const ticking = setInterval(() => { if (socket !== mine || output || notice.hidden) { clearInterval(ticking); return; } tell(); }, 1000);
|
|
892
901
|
slowTimers.push(ticking);
|
|
893
902
|
}
|
|
@@ -3515,7 +3524,7 @@
|
|
|
3515
3524
|
/* The whole thread searched, however little of it is shown. */
|
|
3516
3525
|
search: (q) => fetch(talkPath(name, '/search', { q })).then((r) => (r.ok ? r.json() : { matches: [], count: 0 })),
|
|
3517
3526
|
/* `via: 'voice'`: part of it was dictated, said to the tool. */
|
|
3518
|
-
send: (text, answers, files, extra) => post(talkPath(name), { text, answers, ...(files ? { files: files.map((f) => (f.note ? { path: f.path, note: f.note } : f.path)) } : {}), ...(extra?.via === 'voice' ? { via: 'voice' } : {}),
|
|
3527
|
+
send: (text, answers, files, extra) => post(talkPath(name), { text, answers, quick: true, ...(files ? { files: files.map((f) => (f.note ? { path: f.path, note: f.note } : f.path)) } : {}), ...(extra?.via === 'voice' ? { via: 'voice' } : {}),
|
|
3519
3528
|
/* The choices ticked, the answers of a group, the zone of a picture the answer is about. */
|
|
3520
3529
|
...(extra?.picked ? { picked: extra.picked } : {}), ...(extra?.replies ? { replies: extra.replies } : {}), ...(extra?.about ? { about: extra.about } : {}) }),
|
|
3521
3530
|
/* Formulas: Parley's own KaTeX, served here. Zones and people may point to a file of a shared folder (file:/work/...). */
|
package/web/style.css
CHANGED
|
@@ -3078,3 +3078,10 @@ button.kit-switch[aria-checked="true"]::after { left: 18px; background: var(--ok
|
|
|
3078
3078
|
.hand-switches .set-row > .set-what { flex: none; }
|
|
3079
3079
|
.hand-switches .set-row > .set-control { flex: 0 1 auto; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
|
|
3080
3080
|
a.button[aria-disabled] { opacity: .5; pointer-events: none; }
|
|
3081
|
+
|
|
3082
|
+
/* Finding its way back (14-11): a question mark that rises over the sheep, slowly. */
|
|
3083
|
+
.mascot .m-q { position: absolute; left: 80%; top: -10%; font: 700 18px var(--sans, system-ui); color: var(--brass); opacity: 0; pointer-events: none; }
|
|
3084
|
+
.mascot.wondering .m-q { animation: m-q 2.4s ease-in-out infinite; }
|
|
3085
|
+
@keyframes m-q { 0% { opacity: 0; transform: translateY(6px) rotate(-8deg); } 30%, 70% { opacity: 1; transform: translateY(0) rotate(6deg); } 100% { opacity: 0; transform: translateY(-4px) rotate(-4deg); } }
|
|
3086
|
+
.fading-out { transition: opacity .15s ease-out; opacity: 0; }
|
|
3087
|
+
@media (prefers-reduced-motion: reduce) { .mascot.wondering .m-q { animation: none; opacity: 1; } }
|