@volley/recognition-client-sdk 0.1.418 → 0.1.419
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/index.js +3 -3
- package/dist/index.js.map +2 -2
- package/package.json +3 -3
- package/src/index.ts +1 -1
- package/src/simplified-vgf-recognition-client.ts +2 -2
- package/src/vgf-recognition-mapper.spec.ts +6 -6
- package/src/vgf-recognition-mapper.ts +1 -1
- package/dist/browser.bundled.d.ts +0 -1185
- package/dist/browser.d.ts +0 -10
- package/dist/browser.d.ts.map +0 -1
- package/dist/config-builder.d.ts +0 -134
- package/dist/config-builder.d.ts.map +0 -1
- package/dist/errors.d.ts +0 -41
- package/dist/errors.d.ts.map +0 -1
- package/dist/factory.d.ts +0 -36
- package/dist/factory.d.ts.map +0 -1
- package/dist/index.bundled.d.ts +0 -2396
- package/dist/index.d.ts +0 -16
- package/dist/index.d.ts.map +0 -1
- package/dist/recog-client-sdk.browser.d.ts +0 -10
- package/dist/recog-client-sdk.browser.d.ts.map +0 -1
- package/dist/recognition-client.d.ts +0 -124
- package/dist/recognition-client.d.ts.map +0 -1
- package/dist/recognition-client.types.d.ts +0 -271
- package/dist/recognition-client.types.d.ts.map +0 -1
- package/dist/simplified-vgf-recognition-client.d.ts +0 -178
- package/dist/simplified-vgf-recognition-client.d.ts.map +0 -1
- package/dist/utils/audio-ring-buffer.d.ts +0 -69
- package/dist/utils/audio-ring-buffer.d.ts.map +0 -1
- package/dist/utils/message-handler.d.ts +0 -45
- package/dist/utils/message-handler.d.ts.map +0 -1
- package/dist/utils/url-builder.d.ts +0 -28
- package/dist/utils/url-builder.d.ts.map +0 -1
- package/dist/vgf-recognition-mapper.d.ts +0 -66
- package/dist/vgf-recognition-mapper.d.ts.map +0 -1
- package/dist/vgf-recognition-state.d.ts +0 -91
- package/dist/vgf-recognition-state.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volley/recognition-client-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.419",
|
|
4
4
|
"description": "Recognition Service TypeScript/Node.js Client SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"ts-jest": "29.4.5",
|
|
56
56
|
"typescript": "5.1.6",
|
|
57
57
|
"@recog/shared-config": "1.0.0",
|
|
58
|
+
"@recog/shared-utils": "1.0.0",
|
|
58
59
|
"@recog/websocket": "1.0.0",
|
|
59
|
-
"@recog/shared-types": "1.0.0"
|
|
60
|
-
"@recog/shared-utils": "1.0.0"
|
|
60
|
+
"@recog/shared-types": "1.0.0"
|
|
61
61
|
},
|
|
62
62
|
"keywords": [
|
|
63
63
|
"recognition",
|
package/src/index.ts
CHANGED
|
@@ -69,7 +69,7 @@ export {
|
|
|
69
69
|
isValidRecordingStatusTransition
|
|
70
70
|
} from './vgf-recognition-state.js';
|
|
71
71
|
|
|
72
|
-
export {
|
|
72
|
+
export { resetRecognitionVGFState } from './vgf-recognition-mapper.js';
|
|
73
73
|
|
|
74
74
|
// Re-export WebSocket protocol types for advanced usage
|
|
75
75
|
export { AudioEncoding } from '@recog/websocket';
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
mapTranscriptionResultToState,
|
|
26
26
|
mapErrorToState,
|
|
27
27
|
updateStateOnStop,
|
|
28
|
-
|
|
28
|
+
resetRecognitionVGFState
|
|
29
29
|
} from './vgf-recognition-mapper.js';
|
|
30
30
|
import { RecognitionContextTypeV1 } from '@recog/shared-types';
|
|
31
31
|
|
|
@@ -171,7 +171,7 @@ export class SimplifiedVGFRecognitionClient implements ISimplifiedVGFRecognition
|
|
|
171
171
|
(initialState.recognitionActionProcessingState !== undefined && initialState.recognitionActionProcessingState !== RecognitionActionProcessingState.COMPLETED);
|
|
172
172
|
if (needsNewUuid) {
|
|
173
173
|
// Reset session state with new UUID
|
|
174
|
-
this.state =
|
|
174
|
+
this.state = resetRecognitionVGFState(initialState);
|
|
175
175
|
const newUUID = this.state.audioUtteranceId;
|
|
176
176
|
|
|
177
177
|
if (clientConfig.logger) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
|
|
6
|
+
resetRecognitionVGFState
|
|
7
7
|
} from './vgf-recognition-mapper.js';
|
|
8
8
|
import {
|
|
9
9
|
RecognitionState,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
RecognitionActionProcessingState
|
|
13
13
|
} from './vgf-recognition-state.js';
|
|
14
14
|
|
|
15
|
-
describe('
|
|
15
|
+
describe('resetRecognitionVGFState', () => {
|
|
16
16
|
it('should generate a new UUID', () => {
|
|
17
17
|
const originalState: RecognitionState = {
|
|
18
18
|
audioUtteranceId: 'old-uuid-123',
|
|
@@ -23,7 +23,7 @@ describe('resetSessionState', () => {
|
|
|
23
23
|
finalTranscript: 'hello world'
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
const newState =
|
|
26
|
+
const newState = resetRecognitionVGFState(originalState);
|
|
27
27
|
|
|
28
28
|
expect(newState.audioUtteranceId).not.toBe('old-uuid-123');
|
|
29
29
|
expect(newState.audioUtteranceId).toMatch(/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i);
|
|
@@ -39,7 +39,7 @@ describe('resetSessionState', () => {
|
|
|
39
39
|
finalTranscript: 'hello world'
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
const newState =
|
|
42
|
+
const newState = resetRecognitionVGFState(originalState);
|
|
43
43
|
|
|
44
44
|
expect(newState.transcriptionStatus).toBe(TranscriptionStatus.NOT_STARTED);
|
|
45
45
|
expect(newState.startRecordingStatus).toBe(RecordingStatus.READY);
|
|
@@ -56,7 +56,7 @@ describe('resetSessionState', () => {
|
|
|
56
56
|
asrConfig: '{"provider":"deepgram"}'
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
const newState =
|
|
59
|
+
const newState = resetRecognitionVGFState(originalState);
|
|
60
60
|
|
|
61
61
|
expect(newState.promptSlotMap).toEqual({ artist: ['taylor swift'], song: ['shake it off'] });
|
|
62
62
|
expect(newState.asrConfig).toBe('{"provider":"deepgram"}');
|
|
@@ -68,7 +68,7 @@ describe('resetSessionState', () => {
|
|
|
68
68
|
pendingTranscript: ''
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
-
const newState =
|
|
71
|
+
const newState = resetRecognitionVGFState(originalState);
|
|
72
72
|
|
|
73
73
|
expect(newState.audioUtteranceId).not.toBe('old-uuid');
|
|
74
74
|
expect(newState.transcriptionStatus).toBe(TranscriptionStatus.NOT_STARTED);
|
|
@@ -160,7 +160,7 @@ export function updateStateOnStop(currentState: RecognitionState): RecognitionSt
|
|
|
160
160
|
* @param currentState - The current recognition state
|
|
161
161
|
* @returns A new state with reset session fields and a new UUID
|
|
162
162
|
*/
|
|
163
|
-
export function
|
|
163
|
+
export function resetRecognitionVGFState(currentState: RecognitionState): RecognitionState {
|
|
164
164
|
return {
|
|
165
165
|
...currentState,
|
|
166
166
|
audioUtteranceId: uuidv4(),
|