@todoforai/voiceloop 0.1.23 → 0.1.24

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@todoforai/voiceloop",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "description": "Fast, interruptible browser voice agent: VAD → STT → LLM → TTS with real barge-in, echo filtering, streaming first-sentence TTS and tap-to-seek. Zero runtime dependencies.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -979,6 +979,11 @@ export class VoiceAgent {
979
979
  // so it could only ever become a stuck spinner — drop it. The outcome chunk still lands.
980
980
  if (finalized || !item.id || known) continue;
981
981
  accept(item).announced = true;
982
+ // While the cursor is live the answer is only published on playback ticks, so the host's
983
+ // copy may lag the tokens generated just before this call. Publish the exact answer at
984
+ // the boundary FIRST: a host that splits the reply around its calls (text → chip → text
985
+ // after the result) then cuts at the model's real position, not a frame-old one.
986
+ if (self._cursorLive) self.onEvent({ type: 'assistant', text: self._replyText, full: answer, final: false, turn });
982
987
  self.onEvent({ type: 'tool', name: item.tool, id: item.id, args: item.args, running: true });
983
988
  continue;
984
989
  }