clavarium 0.2.258-next.1 → 0.2.259-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 +8 -2
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.259-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.259-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
|
@@ -150,7 +150,8 @@ export function endOf(ep, reason = '') {
|
|
|
150
150
|
if (n(ep.mean)) parts.push(`moy ${Math.round(ep.mean)}`);
|
|
151
151
|
return parts.join(' · ');
|
|
152
152
|
}
|
|
153
|
-
|
|
153
|
+
/* 02-11: the light turning says it is at work; a word only when it really takes long. */
|
|
154
|
+
export const THINKING_AFTER_MS = 15_000;
|
|
154
155
|
export const LONGER_AFTER_MS = 12_000;
|
|
155
156
|
export const THINKING = ['Hmm…', 'Voyons…', 'Hmm, voyons voir…'];
|
|
156
157
|
/* WHY A BOX LISTENED, in a few words beside the message (01-11): what woke it (and the wake word's score), and
|
|
@@ -539,6 +540,7 @@ export class Boxes {
|
|
|
539
540
|
let boxes;
|
|
540
541
|
if (doing) {
|
|
541
542
|
/* "I'm looking in the calendar": once per sentence heard, on the box that heard it, within two minutes. */
|
|
543
|
+
/* 02-11: what it really does, in its words (« je regarde dans ton agenda »); never a stock phrase. */
|
|
542
544
|
boxes = [...this.#links.values()].filter((l) => l.box().conversation === conversation && l.heardAt && !l.doingSaid && this.#now() - l.heardAt < DOING_WITHIN_MS);
|
|
543
545
|
for (const l of boxes) l.doingSaid = true;
|
|
544
546
|
} else {
|
|
@@ -737,7 +739,11 @@ export class Boxes {
|
|
|
737
739
|
}
|
|
738
740
|
}
|
|
739
741
|
};
|
|
740
|
-
|
|
742
|
+
/* A part the engine fails on is left out (02-11: « la dictée ne répond pas » said while the rest was
|
|
743
|
+
understood); only when every part fails is it said. */
|
|
744
|
+
let failed = null;
|
|
745
|
+
for (const piece of piecesOf(pcm)) { try { said.push(String(await hear(wavOf(piece)) ?? '').trim()); } catch (error) { failed = error; } }
|
|
746
|
+
if (failed && !said.some(Boolean)) throw failed;
|
|
741
747
|
text = said.filter(Boolean).join(' ');
|
|
742
748
|
} catch (error) { this.#log(`voice box ${box0.name}: ${seconds} s heard, dictation failed (${error.message})`); if (this.#tested(link, 'failed', error.message)) { link.send({ t: 'cue', name: 'error' }); return; } await lost('Pardon, la dictée ne répond pas. Tu peux répéter ?'); return; }
|
|
743
749
|
if (link.testing?.state === 'listening' && this.#now() <= link.testing.until) {
|