ttp-agent-sdk 2.45.12 → 2.45.14

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.
@@ -11944,7 +11944,7 @@ var TextChatSDK = /*#__PURE__*/function (_EventEmitter) {
11944
11944
 
11945
11945
  // SDK build time for debugging
11946
11946
  if (true) {
11947
- helloMessage.lastBuildTime = "2026-06-28T10:02:02.645Z";
11947
+ helloMessage.lastBuildTime = "2026-06-29T06:35:24.857Z";
11948
11948
  }
11949
11949
  try {
11950
11950
  this.ws.send(JSON.stringify(helloMessage));
@@ -20303,8 +20303,8 @@ var VoiceSDK = _v2_VoiceSDK_js__WEBPACK_IMPORTED_MODULE_0__["default"];
20303
20303
 
20304
20304
 
20305
20305
  // Version - injected at build time from package.json via webpack DefinePlugin
20306
- var VERSION = "2.45.12";
20307
- var BUILD_TIME = "2026-06-28T10:02:02.645Z";
20306
+ var VERSION = "2.45.14";
20307
+ var BUILD_TIME = "2026-06-29T06:35:24.857Z";
20308
20308
  console.log("%c TTP Agent SDK v".concat(VERSION, " (").concat(BUILD_TIME, ") "), 'background: #4f46e5; color: white; font-size: 12px; font-weight: bold; padding: 2px 6px; border-radius: 4px;');
20309
20309
 
20310
20310
  // Named exports
@@ -25063,6 +25063,14 @@ var AudioPlayer = /*#__PURE__*/function (_EventEmitter) {
25063
25063
  });
25064
25064
  _this4.currentSegmentId = _this4.pendingSegmentId;
25065
25065
  console.log("\uD83D\uDCDD AudioPlayer: Sentence scheduled at ".concat(_this4.nextStartTime.toFixed(3), "s (segmentId: ").concat(_this4.pendingSegmentId, "): \"").concat((_this4.pendingSentenceText || '').substring(0, 40), "...\" (synced: ").concat(_this4.pendingSynced ? _this4.pendingSynced.length : 0, ")"));
25066
+ // Per-segment START signal: this segment's first frame just scheduled (≈ playback start).
25067
+ // Mirrors the per-segment 'segmentDone' (end) event; lets the backend fire speech-synced
25068
+ // actions exactly when THIS line begins playing (vs the coarse, once-per-burst playbackStarted).
25069
+ if (_this4.currentSegmentId != null) {
25070
+ _this4.emit('segmentStarted', {
25071
+ segmentId: _this4.currentSegmentId
25072
+ });
25073
+ }
25066
25074
  _this4.pendingSentenceText = null;
25067
25075
  _this4.pendingSynced = null;
25068
25076
  _this4.pendingSegmentId = null;
@@ -27566,6 +27574,20 @@ var VoiceSDK_v2 = /*#__PURE__*/function (_EventEmitter) {
27566
27574
  });
27567
27575
  }
27568
27576
  });
27577
+
27578
+ // Per-segment START — fired when a sentence's first frame schedules (≈ it begins playing).
27579
+ // The backend uses this to fire sync_with_speech tool execution exactly as the line is heard.
27580
+
27581
+ this.audioPlayer.on('segmentStarted', function (info) {
27582
+ if (!info || info.segmentId == null) return;
27583
+ if (_this3.isConnected) {
27584
+ console.log('📤 VoiceSDK v2: Sending audio_segment_started (segmentId: ' + info.segmentId + ')');
27585
+ _this3.sendMessage({
27586
+ t: 'audio_segment_started',
27587
+ segmentId: info.segmentId
27588
+ });
27589
+ }
27590
+ });
27569
27591
  this.audioPlayer.on('playbackError', function (error) {
27570
27592
  _this3.emit('playbackError', error);
27571
27593
  _this3.emit('error', error);
@@ -27930,7 +27952,7 @@ var VoiceSDK_v2 = /*#__PURE__*/function (_EventEmitter) {
27930
27952
 
27931
27953
  // Include SDK build time for debugging
27932
27954
  if (true) {
27933
- helloMessage.lastBuildTime = "2026-06-28T10:02:02.645Z";
27955
+ helloMessage.lastBuildTime = "2026-06-29T06:35:24.857Z";
27934
27956
  }
27935
27957
 
27936
27958
  // Page context is intentionally NOT attached to the hello message.
@@ -33832,7 +33854,7 @@ var TTPChatWidget = /*#__PURE__*/function () {
33832
33854
  return;
33833
33855
  }
33834
33856
  this._ensureAboutStyles();
33835
- var version = true ? "2.45.12" : 0;
33857
+ var version = true ? "2.45.14" : 0;
33836
33858
  var convId = this._getLastConversationId();
33837
33859
  var t = function t(k, fb) {
33838
33860
  try {