clavarium 0.2.374-next.1 → 0.2.375-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.
- package/npm-shrinkwrap.json +6 -6
- package/package.json +2 -2
- package/server/api.mjs +1 -1
- package/server/talk.mjs +8 -7
- package/web/app.js +1 -1
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.375-next.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.375-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.62-next.1",
|
|
15
15
|
"clavarium-docket": "0.1.2-next.2",
|
|
16
|
-
"clavarium-parley": "0.17.
|
|
16
|
+
"clavarium-parley": "0.17.88-next.1",
|
|
17
17
|
"clavarium-tether": "0.1.0-next.57",
|
|
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.88-next.1",
|
|
791
|
+
"resolved": "https://registry.npmjs.org/clavarium-parley/-/clavarium-parley-0.17.88-next.1.tgz",
|
|
792
|
+
"integrity": "sha512-oZGzOfga9EXqlta35fRp/SIgUJb2J3tWzJhLnArkbxiMHrVkxgoMu6lX1F5ckAw2pWLjfgOo49TAbRZFHIigsA==",
|
|
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.375-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.62-next.1",
|
|
48
48
|
"clavarium-docket": "0.1.2-next.2",
|
|
49
|
-
"clavarium-parley": "0.17.
|
|
49
|
+
"clavarium-parley": "0.17.88-next.1",
|
|
50
50
|
"clavarium-tether": "0.1.0-next.57",
|
|
51
51
|
"mammoth": "1.13.0",
|
|
52
52
|
"mermaid": "11.17.2",
|
package/server/api.mjs
CHANGED
|
@@ -757,7 +757,7 @@ export async function handleApi(request, response, conversations, headers, resou
|
|
|
757
757
|
if (talking && talk) {
|
|
758
758
|
const conversation = decodeURIComponent(talking[1]);
|
|
759
759
|
if (talking[2] === '/invite') return send(200, await talk.invite(conversation, typeof body.lang === 'string' ? body.lang : 'en')), true;
|
|
760
|
-
if (talking[2] === '/remind') return send(200, await talk.remind(conversation)), true;
|
|
760
|
+
if (talking[2] === '/remind') return send(200, await talk.remind(conversation, { urgent: body?.urgent === true })), true;
|
|
761
761
|
if (talking[2] === '/react') return send(200, await talk.react(conversation, body.to, body.reaction ?? null)), true;
|
|
762
762
|
if (typeof body.on === 'boolean') { const now = await talk.set(conversation, body.on); retell(conversation); return send(200, now), true; }
|
|
763
763
|
/* 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). */
|
package/server/talk.mjs
CHANGED
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
import { posix, join } from 'node:path';
|
|
62
62
|
import { randomUUID, createHash } from 'node:crypto';
|
|
63
63
|
import { mkdirSync, lstatSync, rmSync, readFileSync, writeFileSync, readdirSync } from 'node:fs';
|
|
64
|
-
import { install, Parley, WAKE, reread, texts, fill, LANGUAGES, SHOWN_MAX, FILES_MAX } from 'clavarium-parley/host';
|
|
64
|
+
import { install, Parley, WAKE, URGENT, reread, texts, fill, LANGUAGES, SHOWN_MAX, FILES_MAX } from 'clavarium-parley/host';
|
|
65
65
|
import { featureWords } from './features.mjs';
|
|
66
66
|
import { settingsWords } from './settingswords.mjs';
|
|
67
67
|
import { importFile } from './files.mjs';
|
|
@@ -717,14 +717,14 @@ export class Talk {
|
|
|
717
717
|
'typed', 'read' (nothing waits), 'told' (typed already, not read yet),
|
|
718
718
|
'asleep', 'typing', 'failed' -- the last three wait, and are tried
|
|
719
719
|
again. `again`: the owner asked to remind it, typed before or not. */
|
|
720
|
-
#wake(name, again = false) {
|
|
720
|
+
#wake(name, again = false, urgent = false) {
|
|
721
721
|
const going = this.#trying.get(name);
|
|
722
722
|
if (going) return going;
|
|
723
|
-
const run = this.#tryWake(name, again).finally(() => this.#trying.delete(name));
|
|
723
|
+
const run = this.#tryWake(name, again, urgent).finally(() => this.#trying.delete(name));
|
|
724
724
|
this.#trying.set(name, run);
|
|
725
725
|
return run;
|
|
726
726
|
}
|
|
727
|
-
async #tryWake(name, again) {
|
|
727
|
+
async #tryWake(name, again, urgent = false) {
|
|
728
728
|
const r = this.#store.get(name);
|
|
729
729
|
if (r?.on !== true) return 'read';
|
|
730
730
|
const waits = (why, ms) => { this.#store.put({ ...this.#store.get(name), pending: true, why, again }); this.#nextTry.set(name, this.#now() + ms); return why; };
|
|
@@ -736,15 +736,16 @@ export class Talk {
|
|
|
736
736
|
const quiet = this.#now() - (this.#typedAt.get(name) ?? 0);
|
|
737
737
|
if (quiet < TYPING_QUIET_MS) return waits('typing', TYPING_QUIET_MS - quiet + 100);
|
|
738
738
|
if (!(await this.#runs(name))) return waits('asleep', RETRY_MS);
|
|
739
|
-
if (!(await this.#type(name, WAKE).catch(() => false))) return waits('failed', RETRY_MS);
|
|
739
|
+
if (!(await this.#type(name, urgent ? URGENT : WAKE).catch(() => false))) return waits('failed', RETRY_MS);
|
|
740
740
|
this.#store.put({ ...this.#store.get(name), pending: false, woke: true, why: null, again: false, typedAt: new Date(this.#now()).toISOString() });
|
|
741
741
|
return 'typed';
|
|
742
742
|
}
|
|
743
743
|
|
|
744
744
|
/* The owner asks to remind it: the line is typed again, now if it can be. */
|
|
745
|
-
|
|
745
|
+
/* `urgent` (#322): the owner wants it read now, while it works -- the line says so. */
|
|
746
|
+
async remind(name, { urgent = false } = {}) {
|
|
746
747
|
if (!this.of(name).on) throw new Refusal(409, 'Talking through the app is not turned on for this conversation.');
|
|
747
|
-
const told = await this.#wake(name, true);
|
|
748
|
+
const told = await this.#wake(name, true, urgent === true);
|
|
748
749
|
return { ...this.of(name), told };
|
|
749
750
|
}
|
|
750
751
|
|
package/web/app.js
CHANGED
|
@@ -3192,7 +3192,7 @@
|
|
|
3192
3192
|
/* Short-lived secrets of this conversation: the stars say their time left and offer to forget them. */
|
|
3193
3193
|
secrets: chatSecrets,
|
|
3194
3194
|
forget: (secretName) => post(`${API}/conversations/${encodeURIComponent(name)}/secrets/${encodeURIComponent(secretName)}/forget`, {}).then(() => { delete chatSecrets[secretName]; if (thread && threadOf === name) void thread.refresh(); }).catch(() => {}),
|
|
3195
|
-
remind: () => post(talkPath(name, '/remind'), {}),
|
|
3195
|
+
remind: (o) => post(talkPath(name, '/remind'), o?.urgent ? { urgent: true } : {}),
|
|
3196
3196
|
/* The helpers of the terminal, in the chat: this page's voice, the owner's ready answers, the keyboard rule of this device. */
|
|
3197
3197
|
voice: chatVoice(), autoSend: chatAuto, autoSendMs: chatAutoMs, onAutoSendMs: keepAutoMs,
|
|
3198
3198
|
onAutoSend: (on) => { chatAuto = on; try { localStorage.setItem('clavarium-chat-auto', on ? '1' : '0'); } catch { /* as above */ } },
|