clavarium 0.2.357-next.1 → 0.2.358-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 +2 -2
- package/package.json +1 -1
- package/server/boxes.mjs +5 -1
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.358-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.358-next.1",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/package.json
CHANGED
package/server/boxes.mjs
CHANGED
|
@@ -40,6 +40,9 @@ export const WAKE_DROP = process.env.CLAVARIUM_WAKE_DROP === '1';
|
|
|
40
40
|
the room (« Oui, à l'ombre ») not. */
|
|
41
41
|
const WAKE_SOUND = /^(?:\S+ )?[ml](?:a|e|i|ai|ei)(?:s|z|ss|se|ze|sse) (?:a|e|o)n|^m[ae]s doi/;
|
|
42
42
|
export const wakeHeard = (text) => { const t = plainWords(text); return WAKE_HEARD.test(t) || WAKE_SOUND.test(t.replace(/^l /, '')); };
|
|
43
|
+
/* Heard by its sound only (« Mise en œuvre », « Mise en jeu »), not by its spelling: the real calls read so had a
|
|
44
|
+
firm voice; with a faint one it is the room's talk (06-11, 23h20: « Mise en œuvre… moment », voice 396). */
|
|
45
|
+
export const wakeBySoundOnly = (text) => { const t = plainWords(text); return !WAKE_HEARD.test(t) && WAKE_SOUND.test(t.replace(/^l /, '')); };
|
|
43
46
|
/* DROPPED IN SILENCE (05-11, the owner's go): a wake whose word is not heard again AND whose voice was faint --
|
|
44
47
|
the room's talk from afar, not someone speaking to the box. Every real call of 05-11 that the word missed
|
|
45
48
|
had a firm voice or none measured; the false wake of 05-11, 429. Said by one discreet line in the thread. */
|
|
@@ -937,7 +940,8 @@ export class Boxes {
|
|
|
937
940
|
/* First in the line: Parley keeps 120 characters of `why`, and the end stats after it can pass that. */
|
|
938
941
|
link.why = `mot ${check.ok ? '\u2713' : '\u2717'} « ${check.heard.slice(0, 30)} »${link.why ? ` · ${link.why}` : ''}`;
|
|
939
942
|
this.#log(`voice box ${box.name}: wake word heard again: ${check.ok ? 'yes' : 'NO'} (« ${check.heard.slice(0, 40)} »)`);
|
|
940
|
-
|
|
943
|
+
const soundOnlyFaint = check.ok && wakeBySoundOnly(check.heard) && Number.isFinite(link.voice) && link.voice > 0 && link.voice < WAKE_FAINT;
|
|
944
|
+
if (dropsWake(check.ok, link.voice, link.endReason, check.heard) || soundOnlyFaint) {
|
|
941
945
|
link.send({ t: 'cue', name: 'done' });
|
|
942
946
|
this.#log(`voice box ${box.name}: wake ignored (word not heard again, ${link.endReason === 'timeout' ? 'a sentence that never ended' : !check.heard.trim() ? 'no word in its clip' : `faint voice ${Math.round(link.voice || 0)}`})`);
|
|
943
947
|
try { this.#note?.(box.conversation, { kind: 'box-wake-ignored', text: `Wake ignored on ${box.name}: « ${check.heard.slice(0, 40)} », ${link.endReason === 'timeout' ? 'a sound that never stopped (radio, TV)' : !check.heard.trim() ? 'no word where the wake word should be' : 'faint voice'}`, topic: 'Voice box', tone: 'info' }); } catch { /* the log has it */ }
|