@trillet-ai/web-sdk 1.5.5 → 1.5.7

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.
@@ -97,7 +97,7 @@ export class TrilletWebSDK extends EventEmitter {
97
97
  var _a, _b;
98
98
  const text = await reader.readAll();
99
99
  const attributes = ((_a = reader.info) === null || _a === void 0 ? void 0 : _a.attributes) || {};
100
- const isFinal = attributes['lk.transcription_final'] === 'true' || attributes['lk.transcribed_track_id'];
100
+ const isFinal = attributes['lk.transcription_final'] === 'true';
101
101
  if (!info)
102
102
  return;
103
103
  const participant = (_b = this.room) === null || _b === void 0 ? void 0 : _b.getParticipantByIdentity(info.identity);
package/dist/index.d.ts CHANGED
@@ -42,5 +42,5 @@ export declare class TrilletAgent extends EventEmitter {
42
42
  * @param responseTimeout - Timeout in milliseconds (default: 30000)
43
43
  */
44
44
  sendRpcMessage(method: string, payload: any, responseTimeout?: number): Promise<any>;
45
- sendTextMessage(text: string): void;
45
+ sendTextMessage(text: string): Promise<void>;
46
46
  }
package/dist/index.js CHANGED
@@ -276,7 +276,7 @@ export class TrilletAgent extends EventEmitter {
276
276
  throw error;
277
277
  }
278
278
  }
279
- sendTextMessage(text) {
279
+ async sendTextMessage(text) {
280
280
  if (this.config.mode !== 'text') {
281
281
  console.warn('Cannot send text message in voice mode.');
282
282
  return;
@@ -289,13 +289,9 @@ export class TrilletAgent extends EventEmitter {
289
289
  // Add user message to transcripts immediately
290
290
  this.transcriptManager.addMessage('user', text, room.localParticipant.identity);
291
291
  this.emit('transcriptUpdate', this.getTranscripts());
292
- // Send the raw text string over the data channel. The LiveKit agent framework
293
- // is designed to receive this and process it as user input.
292
+ // Send the text message using LiveKit's sendText API with topic 'lk.chat'.
294
293
  try {
295
- const encoder = new TextEncoder();
296
- const data = encoder.encode(text);
297
- // We use publishData directly, which is what `sendText` wraps.
298
- room.localParticipant.publishData(data, { reliable: true });
294
+ await room.localParticipant.sendText(text, { topic: 'lk.chat' });
299
295
  console.log('Text message sent to agent:', text);
300
296
  }
301
297
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trillet-ai/web-sdk",
3
- "version": "1.5.5",
3
+ "version": "1.5.7",
4
4
  "description": "Trillet Web SDK for real-time audio communication with AI agents",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",