clavarium 0.2.251-next.1 → 0.2.252-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 +3 -0
- package/server/talk.mjs +1 -1
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.252-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.252-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
|
@@ -714,6 +714,9 @@ export class Boxes {
|
|
|
714
714
|
const seconds = (pcm.length / 32_000).toFixed(1);
|
|
715
715
|
if (pcm.length < 16_000) { this.#log(`voice box ${box0.name}: ${seconds} s heard, too short for a sentence`); this.#tested(link, 'nothing'); link.send({ t: 'cue', name: 'done' }); return; } /* under half a second: a press, not a sentence */
|
|
716
716
|
link.send({ t: 'cue', name: 'thinking' });
|
|
717
|
+
/* Its sound, kept beside its conversation (the ten last, a week): its assistant can listen to what the box
|
|
718
|
+
really sent when the dictation goes wrong (02-11: "regarde la qualité de l'audio arrivant"). */
|
|
719
|
+
try { this.#keep?.(box0.conversation, 'phrase-boitier.wav', wavOf(pcm)); } catch { /* its chat may be off */ }
|
|
717
720
|
let text;
|
|
718
721
|
/* A sentence that goes nowhere is said so, in words, rather than with a beep nobody can read (31-10). */
|
|
719
722
|
const lost = async (words) => {
|
package/server/talk.mjs
CHANGED
|
@@ -527,7 +527,7 @@ export class Talk {
|
|
|
527
527
|
before.sort((a, b) => b.at - a.at);
|
|
528
528
|
before.forEach((x, i) => { if (i >= KEPT_TEXTS - 1 || Date.now() - x.at > KEPT_TEXT_DAYS * 86_400_000) rmSync(join(dir, FILES, x.name), { recursive: true, force: true }); });
|
|
529
529
|
mkdirSync(join(dir, FILES, id));
|
|
530
|
-
writeFileSync(join(dir, FILES, id, file), String(text ?? ''), { flag: 'wx', mode: 0o644 });
|
|
530
|
+
writeFileSync(join(dir, FILES, id, file), Buffer.isBuffer(text) ? text : String(text ?? ''), { flag: 'wx', mode: 0o644 });
|
|
531
531
|
return `${IN_MACHINE}/${FILES}/${id}/${file}`;
|
|
532
532
|
}
|
|
533
533
|
|