@voctiv/agent-sdk 0.2.0 → 0.2.1
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/define-script.d.ts +68 -32
- package/dist/define-script.d.ts.map +1 -1
- package/dist/define-script.js.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/types/asr-handle.d.ts +26 -12
- package/dist/types/asr-handle.d.ts.map +1 -1
- package/dist/types/events.d.ts +7 -7
- package/dist/types/events.d.ts.map +1 -1
- package/dist/types/legacy-phrase.d.ts +12 -5
- package/dist/types/legacy-phrase.d.ts.map +1 -1
- package/dist/types/legacy-phrase.js +2 -1
- package/dist/types/legacy-phrase.js.map +1 -1
- package/dist/types/logger.d.ts +3 -1
- package/dist/types/logger.d.ts.map +1 -1
- package/dist/types/media-channel.d.ts +538 -23
- package/dist/types/media-channel.d.ts.map +1 -1
- package/dist/types/mixer.d.ts +23 -10
- package/dist/types/mixer.d.ts.map +1 -1
- package/dist/types/nlu.d.ts +20 -10
- package/dist/types/nlu.d.ts.map +1 -1
- package/dist/types/text-input.d.ts +11 -1
- package/dist/types/text-input.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-channel.d.ts","sourceRoot":"","sources":["../../src/types/media-channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE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3B,QAAQ,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEzC;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAElD,mFAAmF;IACnF,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAE9B,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;IAEzB,6GAA6G;IAC7G,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;IACrC,wFAAwF;IACxF,OAAO,IAAI,IAAI,CAAC;CACjB"}
|
package/dist/types/mixer.d.ts
CHANGED
|
@@ -3,9 +3,10 @@ import type { LegacySavePhraseOptions } from './legacy-phrase';
|
|
|
3
3
|
/**
|
|
4
4
|
* How TTS audio is chunked and fed to the mixer.
|
|
5
5
|
*
|
|
6
|
-
* - **`sentence`**: split on sentence boundaries (default).
|
|
7
|
-
* - **`streaming`**: incremental chunks as they arrive
|
|
8
|
-
* -
|
|
6
|
+
* - **`sentence`**: split on sentence boundaries and start synthesis per sentence (default).
|
|
7
|
+
* - **`streaming`**: incremental chunks as they arrive, only for streaming-capable vendors
|
|
8
|
+
* (for non-streaming vendors the runtime falls back to sentence handling).
|
|
9
|
+
* - **`full`**: accumulate the whole input and synthesize it as one segment after the input completes.
|
|
9
10
|
*/
|
|
10
11
|
export type TtsStrategy = 'sentence' | 'streaming' | 'full';
|
|
11
12
|
/**
|
|
@@ -41,19 +42,30 @@ export interface PlayOptions {
|
|
|
41
42
|
/**
|
|
42
43
|
* Mixer queue index **0–4**. Use separate queues to layer music, earcons, and agent TTS
|
|
43
44
|
* so **`stop(queue)`** does not cut unrelated audio.
|
|
45
|
+
*
|
|
46
|
+
* SIP/WS runtimes pass this to the mixer; invalid indices are not part of the public contract.
|
|
44
47
|
* @defaultValue 0
|
|
45
48
|
*/
|
|
46
49
|
queue?: number;
|
|
47
50
|
/**
|
|
48
51
|
* Stable id for this queue item — used with **`remove`**, debug UIs, and completion tracking.
|
|
49
52
|
* Should be unique per logical utterance if you need to cancel a specific playback.
|
|
53
|
+
*
|
|
54
|
+
* For sentence-split TTS the runtime creates internal item aliases by suffixing
|
|
55
|
+
* this value (`alias-0`, `alias-1`, ...). For raw `play()` and direct streaming TTS,
|
|
56
|
+
* the item uses this alias exactly.
|
|
50
57
|
*/
|
|
51
58
|
alias?: string;
|
|
52
59
|
/** When `true`, the item restarts after it finishes until **`stop`** / **`remove`**. */
|
|
53
60
|
loop?: boolean;
|
|
54
61
|
/** Milliseconds of silence between loop iterations (if **`loop`**). */
|
|
55
62
|
loopDelayMs?: number;
|
|
56
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* Linear gain for the whole mixer queue **0.0** (mute) – **1.0** (unity).
|
|
65
|
+
*
|
|
66
|
+
* This is not per-item volume: setting it on one `say()`/`play()` changes the queue
|
|
67
|
+
* volume for subsequent items until it is changed again.
|
|
68
|
+
*/
|
|
57
69
|
volume?: number;
|
|
58
70
|
/** Chunking strategy for TTS; see {@link TtsStrategy}. */
|
|
59
71
|
ttsStrategy?: TtsStrategy;
|
|
@@ -68,11 +80,12 @@ export interface PlayOptions {
|
|
|
68
80
|
*/
|
|
69
81
|
name?: string;
|
|
70
82
|
/**
|
|
71
|
-
*
|
|
72
|
-
*
|
|
83
|
+
* Parameters passed to the TTS connector (voice id, model, `output_format`, nested JSON, …).
|
|
84
|
+
* Primitives are stringified; objects and arrays are JSON-serialized. Merged after channel
|
|
85
|
+
* defaults and catalog credentials; later wins. The key **`name`** is reserved for the
|
|
73
86
|
* storage-row selector and is removed before sending to the vendor.
|
|
74
87
|
*/
|
|
75
|
-
ttsConfig?: Record<string,
|
|
88
|
+
ttsConfig?: Record<string, unknown>;
|
|
76
89
|
/**
|
|
77
90
|
* Voctiv platform only: after synthesis, persist audio under **`record_phrase`** + filesystem root so
|
|
78
91
|
* {@link import('./define-script').PlatformApi.getRecords} can return a {@link import('./legacy-phrase').LegacyPhraseRecord}.
|
|
@@ -87,13 +100,13 @@ export interface PlayOptions {
|
|
|
87
100
|
export interface MixerQueueControl {
|
|
88
101
|
/** Queue index **0–4** (matches **`PlayOptions.queue`**). */
|
|
89
102
|
readonly index: number;
|
|
90
|
-
/** Current linear volume **0.0–1.0**; assign to change gain for this queue. */
|
|
103
|
+
/** Current linear volume **0.0–1.0**; assign to change gain for this entire queue. */
|
|
91
104
|
volume: number;
|
|
92
105
|
/** Emits **`alias`** when an item in this queue starts playing. */
|
|
93
106
|
readonly itemStarted$: Observable<string>;
|
|
94
|
-
/** Emits **`alias`** when an item finishes
|
|
107
|
+
/** Emits **`alias`** when an item finishes, is removed, or is skipped by queue clear. */
|
|
95
108
|
readonly itemFinished$: Observable<string>;
|
|
96
|
-
/** Emits
|
|
109
|
+
/** Emits whenever the queue becomes empty after all pending/current items are gone. */
|
|
97
110
|
readonly queueEmpty$: Observable<void>;
|
|
98
111
|
/**
|
|
99
112
|
* Remove a single item by **`alias`**.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mixer.d.ts","sourceRoot":"","sources":["../../src/types/mixer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE/D
|
|
1
|
+
{"version":3,"file":"mixer.d.ts","sourceRoot":"","sources":["../../src/types/mixer.ts"],"names":[],"mappings":"AAAA,OAA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WAAW,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;IAEvC;;;OAGG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,uDAAuD;IACvD,KAAK,IAAI,IAAI,CAAC;CACf"}
|
package/dist/types/nlu.d.ts
CHANGED
|
@@ -1,23 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Options for
|
|
3
|
-
*
|
|
2
|
+
* Options for `platform.nlu.extract()`.
|
|
3
|
+
*
|
|
4
|
+
* Compatible with logic-executor `NeuroNluRecognitionRequest`. The current
|
|
5
|
+
* `apps/api` runtime forwards `entities`, `intents`, `context`,
|
|
6
|
+
* `use_neuro_api`, and `use_synonyms` to NLU v3 `/infer`. Exclude fields are
|
|
7
|
+
* kept in the SDK for source compatibility with older scripts, but are not
|
|
8
|
+
* forwarded by the current runtime implementation.
|
|
4
9
|
*/
|
|
5
10
|
export interface NluExtractOptions {
|
|
6
|
-
/** Include only these entity types (e.g. `"date"`, `"phone"`)
|
|
11
|
+
/** Include only these entity types (e.g. `"date"`, `"phone"`); forwarded as `entities`. */
|
|
7
12
|
entities?: string | string[] | null;
|
|
8
|
-
/**
|
|
13
|
+
/** Legacy compatibility field; currently not forwarded by `apps/api`. */
|
|
9
14
|
entities_exclude?: string | string[] | null;
|
|
10
|
-
/** Include only these intent names
|
|
15
|
+
/** Include only these intent names; forwarded as `intents`. */
|
|
11
16
|
intents?: string | string[] | null;
|
|
12
|
-
/**
|
|
17
|
+
/** Legacy compatibility field; currently not forwarded by `apps/api`. */
|
|
13
18
|
intents_exclude?: string | string[] | null;
|
|
14
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Additional context for disambiguation.
|
|
21
|
+
*
|
|
22
|
+
* Objects and arrays are JSON-stringified before sending. If omitted, the runtime
|
|
23
|
+
* serializes current dialog params and uses that as NLU context.
|
|
24
|
+
*/
|
|
15
25
|
context?: string | unknown[] | Record<string, unknown> | null;
|
|
16
|
-
/**
|
|
26
|
+
/** Forwarded as `use_neuro_api`; backend-specific flag for the NLU service. */
|
|
17
27
|
use_neuro_api?: boolean;
|
|
18
|
-
/**
|
|
28
|
+
/** Forwarded as `use_synonyms`; enables synonym expansion in the NLU service. */
|
|
19
29
|
use_synonyms?: boolean;
|
|
20
30
|
}
|
|
21
|
-
/** Raw JSON response from NLU v3 `/infer` endpoint. */
|
|
31
|
+
/** Raw parsed JSON response from NLU v3 `/infer` endpoint. */
|
|
22
32
|
export type NluInferResult = Record<string, unknown>;
|
|
23
33
|
//# sourceMappingURL=nlu.d.ts.map
|
package/dist/types/nlu.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nlu.d.ts","sourceRoot":"","sources":["../../src/types/nlu.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"nlu.d.ts","sourceRoot":"","sources":["../../src/types/nlu.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IAChC,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;IACpC,yEAAyE;IACzE,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;IAC5C,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;IACnC,yEAAyE;IACzE,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;IAC3C;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC9D,+EAA+E;IAC/E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iFAAiF;IACjF,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,8DAA8D;AAC9D,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -3,17 +3,27 @@
|
|
|
3
3
|
* as if the speech recognizer had produced it. Used by WebSocket test clients and automation
|
|
4
4
|
* **without** sending real microphone audio.
|
|
5
5
|
*
|
|
6
|
+
* SIP/WS runtimes also emit speech-start / speech-end and barge-in-style signals where
|
|
7
|
+
* possible so scripts written around VAD observables behave the same in text tests.
|
|
8
|
+
* Unknown `asrId` values are ignored.
|
|
9
|
+
*
|
|
6
10
|
* Methods require the **`asrId`** returned by **`AsrHandle.id`** from **`channel.createAsr()`**.
|
|
7
11
|
*/
|
|
8
12
|
export interface TextInput {
|
|
9
13
|
/**
|
|
10
14
|
* Inject a **final** transcript for the given ASR instance.
|
|
15
|
+
*
|
|
16
|
+
* Emits a final partial first, then `result$`, then speech-end style signals.
|
|
11
17
|
* @param asrId - Value of **`(await channel.createAsr()).id`**.
|
|
12
18
|
* @param text - Full utterance text (final result).
|
|
13
19
|
*/
|
|
14
20
|
pushResult(asrId: string, text: string): void;
|
|
15
21
|
/**
|
|
16
|
-
* Inject a partial
|
|
22
|
+
* Inject a partial hypothesis.
|
|
23
|
+
*
|
|
24
|
+
* Unlike {@link pushResult}, this does not emit `result$` and does not close the
|
|
25
|
+
* synthetic turn by itself. Pass `isFinal` only to mark the partial as final-like
|
|
26
|
+
* for consumers of `partial$`.
|
|
17
27
|
* @param asrId - Target ASR **`id`**.
|
|
18
28
|
* @param text - Partial or final text.
|
|
19
29
|
* @param isFinal - When `true`, marks this partial as the last before a final (host may align with **`result$`**).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-input.d.ts","sourceRoot":"","sources":["../../src/types/text-input.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"text-input.d.ts","sourceRoot":"","sources":["../../src/types/text-input.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;;OAMG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9C;;;;;;;;;OASG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACnE"}
|
package/package.json
CHANGED