@layercode/js-sdk 2.1.2 → 2.1.4
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/dist/types/index.d.ts
CHANGED
|
@@ -2,13 +2,8 @@
|
|
|
2
2
|
* Interface for LayercodeClient public methods
|
|
3
3
|
*/
|
|
4
4
|
interface ILayercodeClient {
|
|
5
|
-
connect(
|
|
6
|
-
|
|
7
|
-
newConversation?: boolean;
|
|
8
|
-
}): Promise<void>;
|
|
9
|
-
disconnect(opts?: {
|
|
10
|
-
clearConversationId?: boolean;
|
|
11
|
-
}): Promise<void>;
|
|
5
|
+
connect(): Promise<void>;
|
|
6
|
+
disconnect(): Promise<void>;
|
|
12
7
|
triggerUserTurnStarted(): Promise<void>;
|
|
13
8
|
triggerUserTurnFinished(): Promise<void>;
|
|
14
9
|
getStream(): MediaStream | null;
|
|
@@ -133,18 +128,13 @@ declare class LayercodeClient implements ILayercodeClient {
|
|
|
133
128
|
private _setupAmplitudeMonitoring;
|
|
134
129
|
private _stopAmplitudeMonitoring;
|
|
135
130
|
/**
|
|
136
|
-
* Connects to the Layercode agent and starts the audio conversation
|
|
131
|
+
* Connects to the Layercode agent using the stored conversation ID and starts the audio conversation
|
|
137
132
|
* @async
|
|
138
133
|
* @returns {Promise<void>}
|
|
139
134
|
*/
|
|
140
|
-
connect(
|
|
141
|
-
conversationId?: string;
|
|
142
|
-
newConversation?: boolean;
|
|
143
|
-
}): Promise<void>;
|
|
135
|
+
connect(): Promise<void>;
|
|
144
136
|
private _resetTurnTracking;
|
|
145
|
-
disconnect(
|
|
146
|
-
clearConversationId?: boolean;
|
|
147
|
-
}): Promise<void>;
|
|
137
|
+
disconnect(): Promise<void>;
|
|
148
138
|
/**
|
|
149
139
|
* Gets the microphone MediaStream used by this client
|
|
150
140
|
* @returns {MediaStream|null} The microphone stream or null if not initialized
|
|
@@ -168,6 +158,9 @@ declare class LayercodeClient implements ILayercodeClient {
|
|
|
168
158
|
*/
|
|
169
159
|
private _setupDeviceChangeListener;
|
|
170
160
|
private _teardownDeviceListeners;
|
|
161
|
+
/**
|
|
162
|
+
* Releases audio resources and listeners after a disconnect
|
|
163
|
+
*/
|
|
171
164
|
private _performDisconnectCleanup;
|
|
172
165
|
private _getDeviceComparisonKey;
|
|
173
166
|
/**
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"author": "Layercode",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"name": "@layercode/js-sdk",
|
|
5
|
-
"version": "2.1.
|
|
5
|
+
"version": "2.1.4",
|
|
6
6
|
"description": "Layercode JavaScript SDK for browser usage",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/layercode-js-sdk.esm.js",
|
|
@@ -48,4 +48,4 @@
|
|
|
48
48
|
"@ricky0123/vad-web": "^0.0.24",
|
|
49
49
|
"onnxruntime-web": "^1.21.1"
|
|
50
50
|
}
|
|
51
|
-
}
|
|
51
|
+
}
|