clavarium 0.2.350-next.1 → 0.2.351-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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.350-next.1",
3
+ "version": "0.2.351-next.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "clavarium",
9
- "version": "0.2.350-next.1",
9
+ "version": "0.2.351-next.1",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@xterm/addon-fit": "^0.11.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.350-next.1",
3
+ "version": "0.2.351-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.",
package/server/boxes.mjs CHANGED
@@ -787,7 +787,7 @@ export class Boxes {
787
787
  this.#log(`voice box ${box.name}: a sentence while recording here, the recording closed`);
788
788
  r.out.end(() => { void this.#recorded(link, r); });
789
789
  }
790
- if (m.t === 'listen.start') { link.why = whyOf(m); link.wakeCheck = null; link.voice = NaN; link.endReason = ''; } /* its clip, if any, comes after listen.start: an older check never carries over */
790
+ if (m.t === 'listen.start') { link.why = whyOf(m); link.wakeCheck = null; link.voice = NaN; link.endReason = ''; link.startReason = String(m.reason ?? ''); link.clipSeen = false; } /* its clip, if any, comes after listen.start: an older check never carries over */
791
791
  if (m.t === 'listen.start') { if (this.stop(box.id)) this.#log(`voice box ${box.name}: stopped playing, someone speaks`); sentence = []; size = 0; return; }
792
792
  if (m.t === 'listen.end' && sentence && m.reason === 'nobody') {
793
793
  /* Listened again, nobody spoke: a conversation ends there, in silence. */
@@ -923,6 +923,16 @@ export class Boxes {
923
923
  /* The wake word heard again (wake.clip): said beside the message; dropped in silence only once that is
924
924
  turned on (WAKE_DROP), after its results were looked at -- a real call must never be lost to it. */
925
925
  const check = link.wakeCheck ? await link.wakeCheck.catch(() => null) : null; link.wakeCheck = null;
926
+ /* WOKEN BY THE WORD, BUT NO CLIP TO CHECK IT (06-11: « ce ne sera pas au niveau de fond », voice 195, passed): as a
927
+ clip with no word in it -- dropped only when faint too; a firm voice, a button, a knock still go. */
928
+ if (!check && link.startReason === 'wake' && dropsWake(false, link.voice, link.endReason, '')) {
929
+ if (Number.isFinite(link.voice) && link.voice > 0 && link.voice < WAKE_FAINT) {
930
+ link.send({ t: 'cue', name: 'done' });
931
+ this.#log(`voice box ${box.name}: wake ignored (no wake clip to check, faint voice ${Math.round(link.voice)})`);
932
+ try { this.#note?.(box.conversation, { kind: 'box-wake-ignored', text: `Wake ignored on ${box.name}: no wake word to check, faint voice`, topic: 'Voice box', tone: 'info' }); } catch { /* the log has it */ }
933
+ return;
934
+ }
935
+ }
926
936
  if (check) {
927
937
  /* First in the line: Parley keeps 120 characters of `why`, and the end stats after it can pass that. */
928
938
  link.why = `mot ${check.ok ? '\u2713' : '\u2717'} « ${check.heard.slice(0, 30)} »${link.why ? ` · ${link.why}` : ''}`;