clavarium 0.2.119-beta.1 → 0.2.120-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 +2 -2
- package/package.json +1 -1
- package/server/boxes.mjs +4 -5
- package/server/voice.mjs +3 -0
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.120-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.120-beta.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
|
@@ -476,7 +476,7 @@ export class Boxes {
|
|
|
476
476
|
}
|
|
477
477
|
if (boxes.length === 0) return;
|
|
478
478
|
/* A question: the box listens again right after, no wake word needed. So does a box in CONVERSATION:
|
|
479
|
-
asked for ("mode conversation")
|
|
479
|
+
asked for ("mode conversation") -- never by itself any more (01-11);
|
|
480
480
|
it ends when nobody answers, or on "fin de la conversation". */
|
|
481
481
|
const question = !doing && (asked || /\?\s*$/.test(words));
|
|
482
482
|
for (const l of boxes) { l.answeredAt = this.#now(); clearTimeout(l.thinkingA); clearTimeout(l.thinkingB); }
|
|
@@ -499,11 +499,10 @@ export class Boxes {
|
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
|
+
/* Only when asked ("mode conversation"): opened by itself after two sentences, it stayed listening and
|
|
503
|
+
took in the room's talk -- the circle kept lit, stray words sent (01-11). */
|
|
502
504
|
#chatting(link) {
|
|
503
|
-
|
|
504
|
-
const now = this.#now();
|
|
505
|
-
link.recent = (link.recent ?? []).filter((t) => now - t < CHAT_WITHIN_MS);
|
|
506
|
-
return link.recent.length >= 2;
|
|
505
|
+
return Boolean(link.chat);
|
|
507
506
|
}
|
|
508
507
|
|
|
509
508
|
/* A box connected with its key: speaks protocol v1 on `socket` (a ws WebSocket). */
|
package/server/voice.mjs
CHANGED
|
@@ -80,6 +80,9 @@ const PHANTOMS = [
|
|
|
80
80
|
/sous[- ]titr(?:age|es?)\s+(?:par\s+)?(?:la\s+)?société\s+radio[- ]canada[.!]?/giu,
|
|
81
81
|
/* A credit to a person, when it is all that was "heard" ("Sous-titres par Jérémy Diaz", 31-10). */
|
|
82
82
|
/^\s*[Ss]ous[- ]titr(?:age|es?)(?:\s+réalisés?)?\s+par\s+(?:\p{Lu}[\p{L}'-]*\s*){1,3}[.!]?\s*$/gu,
|
|
83
|
+
/* YouTube endings, heard on a button press with nothing said (01-11: "Thank you for watching and see
|
|
84
|
+
you in the next video!"): only when they are all of it. */
|
|
85
|
+
/^\s*(?:thank(?:s| you) (?:so much )?for watching[.!,]?\s*(?:(?:and )?see you (?:in the |on the )?next (?:video|time)[.!]?)?|see you (?:in the )?next (?:video|time)[.!]?|merci d'avoir regardé(?: cette vidéo)?\s*[.!]?(?:\s*[àa] bient[ôo]t[.!]?)?)\s*$/giu,
|
|
83
86
|
/untertitel(?:ung)?\s+(?:im\s+auftrag\s+)?des\s+zdf(?:\s+für\s+funk)?,?\s*\d{0,4}[.!]?/giu,
|
|
84
87
|
];
|
|
85
88
|
export function withoutPhantoms(text) {
|