@voctiv/agent-sdk 0.2.0 → 0.2.2
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/README.md +458 -0
- 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
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* @packageDocumentation
|
|
3
3
|
* **Agent scripting SDK** for `node-asr-tts-connector`: typed **`defineScript`** context,
|
|
4
4
|
* {@link import('./types/media-channel').MediaChannel}, ASR/TTS, LLM, SIP, and Voctiv platform (LE-compat) helpers.
|
|
5
|
+
* These exports are types plus the `defineScript` identity helper; behavior is provided by
|
|
6
|
+
* the `apps/api` scripting runtime that loads and executes your script.
|
|
5
7
|
*
|
|
6
8
|
* ### Selecting ASR/TTS credentials by `key_storage.name` (Voctiv platform)
|
|
7
9
|
*
|
|
@@ -15,11 +17,14 @@
|
|
|
15
17
|
* - {@link import('./types/mixer').PlayOptions.name} or **`ttsConfig.name`** on **`say`/`play`/`presay`**
|
|
16
18
|
*
|
|
17
19
|
* Channel defaults **`defaultAsrName`** / **`defaultTtsName`** apply when **`name`** is omitted.
|
|
20
|
+
*
|
|
21
|
+
* Legacy platform APIs (`platform.nlu`, `platform.call`, messaging sends, dialog writes, and phrase
|
|
22
|
+
* records) require `context.legacyV3Compat === true` in the current API runtime.
|
|
18
23
|
*/
|
|
19
24
|
export { defineScript } from './define-script';
|
|
20
25
|
export type { ScriptContext, ScriptDialogContext, ScriptRunTime, ScriptResult, PersistedScriptResult, ScriptError, ScriptFn, NluScriptApi, PlatformApi, DialogApi, ScheduleCallOptions, SendMessageOptions, InboundMessage, MessagingApi, } from './define-script';
|
|
21
26
|
export type { ScriptLogger } from './types/logger';
|
|
22
|
-
export type { MediaChannel, ChannelAudio, ChannelEvents, ChannelLlm, ChannelSip, LlmOptions, LlmStreamChunk, ExtractOptions, PersistentLlmStreamHandle, } from './types/media-channel';
|
|
27
|
+
export type { MediaChannel, ChannelAudio, ChannelEvents, ChannelLlm, ChannelSip, SipState, SipProgressEvent, LlmOptions, LlmStreamChunk, ExtractOptions, PersistentLlmStreamHandle, } from './types/media-channel';
|
|
23
28
|
export type { AsrHandle, AsrConfig, AsrVadConfig, AsrSmartTurnConfig } from './types/asr-handle';
|
|
24
29
|
export type { MixerQueueControl, PlayOptions, TtsStrategy, TtsVendor } from './types/mixer';
|
|
25
30
|
export type { LegacyPhraseRecord, LegacyGetRecordsParams, LegacySavePhraseOptions, } from './types/legacy-phrase';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,YAAY,EACV,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,qBAAqB,EACrB,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,UAAU,EACV,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,cAAc,EACd,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACjG,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC5F,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,YAAY,EACV,SAAS,EACT,OAAO,EACP,SAAS,EACT,WAAW,GACZ,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* @packageDocumentation
|
|
4
4
|
* **Agent scripting SDK** for `node-asr-tts-connector`: typed **`defineScript`** context,
|
|
5
5
|
* {@link import('./types/media-channel').MediaChannel}, ASR/TTS, LLM, SIP, and Voctiv platform (LE-compat) helpers.
|
|
6
|
+
* These exports are types plus the `defineScript` identity helper; behavior is provided by
|
|
7
|
+
* the `apps/api` scripting runtime that loads and executes your script.
|
|
6
8
|
*
|
|
7
9
|
* ### Selecting ASR/TTS credentials by `key_storage.name` (Voctiv platform)
|
|
8
10
|
*
|
|
@@ -16,6 +18,9 @@
|
|
|
16
18
|
* - {@link import('./types/mixer').PlayOptions.name} or **`ttsConfig.name`** on **`say`/`play`/`presay`**
|
|
17
19
|
*
|
|
18
20
|
* Channel defaults **`defaultAsrName`** / **`defaultTtsName`** apply when **`name`** is omitted.
|
|
21
|
+
*
|
|
22
|
+
* Legacy platform APIs (`platform.nlu`, `platform.call`, messaging sends, dialog writes, and phrase
|
|
23
|
+
* records) require `context.legacyV3Compat === true` in the current API runtime.
|
|
19
24
|
*/
|
|
20
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
26
|
exports.isLegacyPhraseRecord = exports.LEGACY_PHRASE_RECORD_BRAND = exports.defineScript = void 0;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;AAEH,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AAuCrB,uDAG+B;AAF7B,2HAAA,0BAA0B,OAAA;AAC1B,qHAAA,oBAAoB,OAAA"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
/**
|
|
3
|
-
* Voice Activity Detection (VAD) tuning
|
|
4
|
-
*
|
|
3
|
+
* Voice Activity Detection (VAD) tuning.
|
|
4
|
+
*
|
|
5
|
+
* SIP sessions use the call-level telephony VAD when available. WS sessions create one
|
|
6
|
+
* VAD instance for the whole socket session on the first `createAsr()` call and merge
|
|
7
|
+
* these options with runtime defaults. When no VAD is available, audio is forwarded to
|
|
8
|
+
* ASR continuously and most VAD observables are empty.
|
|
5
9
|
*/
|
|
6
10
|
export interface AsrVadConfig {
|
|
7
11
|
/** Energy threshold to start speech detection (0.0–1.0). */
|
|
@@ -14,14 +18,19 @@ export interface AsrVadConfig {
|
|
|
14
18
|
energyFloor?: number;
|
|
15
19
|
/** Smoothing factor for noise floor estimation (0.0–1.0). */
|
|
16
20
|
noiseFloorAlpha?: number;
|
|
17
|
-
/** Frames of PCM (typically 20 ms @
|
|
21
|
+
/** Frames of PCM (typically 20 ms @ 16 kHz / 640 bytes) to prepend before detected speech start. */
|
|
18
22
|
preSpeechFrames?: number;
|
|
19
|
-
/**
|
|
23
|
+
/** Frames of post-speech PCM to still forward to ASR after VAD speech end. */
|
|
20
24
|
postSpeechFrames?: number;
|
|
21
25
|
}
|
|
22
26
|
/**
|
|
23
27
|
* Smart turn-taking — controls when the runtime finalizes an utterance (end-of-turn) while
|
|
24
28
|
* streaming audio to ASR. Reduces cutting off the user mid-sentence when enabled.
|
|
29
|
+
*
|
|
30
|
+
* On WS sessions these values are passed to the telephony VAD/SmartTurn service.
|
|
31
|
+
* On SIP sessions, `enabled: true` also ensures the ASR connector has an
|
|
32
|
+
* `utterance_end_ms` value (defaulting to `1000`) when the resolved connector config
|
|
33
|
+
* did not already provide one.
|
|
25
34
|
*/
|
|
26
35
|
export interface AsrSmartTurnConfig {
|
|
27
36
|
/** When `true`, turn-taking heuristics are applied (defaults vary by host). */
|
|
@@ -52,8 +61,8 @@ export interface AsrSmartTurnConfig {
|
|
|
52
61
|
* - If neither is set, credentials fall back to the usual **`authentication_data.asr.<engine>`**
|
|
53
62
|
* blob for the resolved vendor (main/reserved keys on the agent).
|
|
54
63
|
*
|
|
55
|
-
* You may also set the same selector as **`data.name
|
|
56
|
-
*
|
|
64
|
+
* You may also set the same selector as **`data.name`**. The runtime treats it as
|
|
65
|
+
* the storage-row selector and strips it before sending connector params to the ASR vendor.
|
|
57
66
|
*
|
|
58
67
|
* ### Vendor
|
|
59
68
|
*
|
|
@@ -76,10 +85,12 @@ export interface AsrConfig {
|
|
|
76
85
|
/** Recognition language (BCP-47), e.g. `"ru-RU"`. Passed through to the connector as `language`. */
|
|
77
86
|
language?: string;
|
|
78
87
|
/**
|
|
79
|
-
* Vendor-specific connection parameters (URLs, timeouts, model ids, …).
|
|
80
|
-
* catalog credentials so the script can override
|
|
81
|
-
*
|
|
82
|
-
*
|
|
88
|
+
* Vendor-specific connection parameters (URLs, timeouts, model ids, nested JSON, …).
|
|
89
|
+
* Merged last over channel defaults and catalog credentials so the script can override
|
|
90
|
+
* per call. Primitives are stringified; objects and arrays are JSON-serialized.
|
|
91
|
+
*
|
|
92
|
+
* Do not rely on **`name`** here for third-party “model name” fields — the runtime consumes
|
|
93
|
+
* it as the storage row selector and removes it before vendor config is built.
|
|
83
94
|
*/
|
|
84
95
|
data?: Record<string, unknown>;
|
|
85
96
|
/** Optional VAD tuning for this session (see host implementation). */
|
|
@@ -91,8 +102,11 @@ export interface AsrConfig {
|
|
|
91
102
|
* Live speech recognition session returned by {@link import('./media-channel').MediaChannel.createAsr}.
|
|
92
103
|
*
|
|
93
104
|
* Subscribe to **`partial$`** / **`result$`** for transcripts; wire **`speechStart$`** /
|
|
94
|
-
* **`speechEnd$`** / **`interrupt$`** for barge-in and UI.
|
|
105
|
+
* **`speechEnd$`** / **`interrupt$`** for barge-in and UI. Call **`destroy()`** when done
|
|
95
106
|
* (e.g. on `channel.events.terminated$`) to release connector and subscriptions.
|
|
107
|
+
*
|
|
108
|
+
* If connector creation fails, SIP/WS return a degraded handle: VAD observables still
|
|
109
|
+
* mirror the channel where possible, but `partial$` and `result$` do not emit real STT.
|
|
96
110
|
*/
|
|
97
111
|
export interface AsrHandle {
|
|
98
112
|
/** Opaque id (passed to `channel.textInput` helpers in automated tests). */
|
|
@@ -118,7 +132,7 @@ export interface AsrHandle {
|
|
|
118
132
|
readonly interrupt$: Observable<void>;
|
|
119
133
|
/** Normalized voice-activity probability 0–1 when the host exposes it; else may be inert. */
|
|
120
134
|
readonly vadProbability$: Observable<number>;
|
|
121
|
-
/** Pause audio
|
|
135
|
+
/** Pause forwarding new audio frames to the recognizer; skipped audio is not replayed. */
|
|
122
136
|
pause(): void;
|
|
123
137
|
/** Resume after {@link pause}. */
|
|
124
138
|
resume(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asr-handle.d.ts","sourceRoot":"","sources":["../../src/types/asr-handle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC
|
|
1
|
+
{"version":3,"file":"asr-handle.d.ts","sourceRoot":"","sources":["../../src/types/asr-handle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,4DAA4D;IAC5D,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,0DAA0D;IAC1D,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iEAAiE;IACjE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gCAAgC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oGAAoG;IACpG,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,8EAA8E;IAC9E,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IACjC,+EAA+E;IAC/E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,oEAAoE;IACpE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mEAAmE;IACnE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4FAA4F;IAC5F,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,SAAS;IACxB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oGAAoG;IACpG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,sEAAsE;IACtE,GAAG,CAAC,EAAE,YAAY,CAAC;IACnB,mDAAmD;IACnD,SAAS,CAAC,EAAE,kBAAkB,CAAC;CAChC;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,SAAS;IACxB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IACrC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAClE,kEAAkE;IAClE,QAAQ,CAAC,YAAY,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;IACxC,wDAAwD;IACxD,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;IACtC,gFAAgF;IAChF,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;IACtC,6FAA6F;IAC7F,QAAQ,CAAC,eAAe,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IAE7C,0FAA0F;IAC1F,KAAK,IAAI,IAAI,CAAC;IACd,kCAAkC;IAClC,MAAM,IAAI,IAAI,CAAC;IACf,kFAAkF;IAClF,QAAQ,IAAI,IAAI,CAAC;IACjB,8FAA8F;IAC9F,OAAO,IAAI,IAAI,CAAC;CACjB"}
|
package/dist/types/events.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/** DTMF digit event from the remote party. */
|
|
2
2
|
export interface DtmfEvent {
|
|
3
|
-
/** The pressed digit
|
|
3
|
+
/** The pressed digit. SIP emits `0`–`9`, `*`, `#`; WS input also accepts `A`–`D`. */
|
|
4
4
|
digit: string;
|
|
5
|
-
/** Duration of the tone in milliseconds. */
|
|
5
|
+
/** Duration of the tone in milliseconds, normalized by the channel when available. */
|
|
6
6
|
duration: number;
|
|
7
7
|
}
|
|
8
8
|
/** Incoming SIP INFO message. */
|
|
9
9
|
export interface SipInfo {
|
|
10
|
-
/** MIME content type (e.g. `"application/dtmf-relay"`). */
|
|
10
|
+
/** MIME content type (e.g. `"application/dtmf-relay"`). May be empty for low-level Sofia events. */
|
|
11
11
|
contentType: string;
|
|
12
|
-
/** Message body. */
|
|
12
|
+
/** Message body. May be empty for low-level Sofia events. */
|
|
13
13
|
body: string;
|
|
14
14
|
}
|
|
15
15
|
/** SIP call state change signal. */
|
|
16
16
|
export interface SipSignal {
|
|
17
|
-
/**
|
|
17
|
+
/** Raw telephony/Sofia call state, not normalized to SDK `SipState`. */
|
|
18
18
|
state: string;
|
|
19
19
|
/** SIP response status code (e.g. `200`, `486`). */
|
|
20
20
|
statusCode?: number;
|
|
@@ -23,11 +23,11 @@ export interface SipSignal {
|
|
|
23
23
|
/** SDP body (for media negotiation events). */
|
|
24
24
|
sdp?: string;
|
|
25
25
|
}
|
|
26
|
-
/** Arbitrary data message
|
|
26
|
+
/** Arbitrary data message used for WS data-channel communication between script and client. */
|
|
27
27
|
export interface DataMessage {
|
|
28
28
|
/** Event name / type identifier. */
|
|
29
29
|
event: string;
|
|
30
|
-
/** Event payload
|
|
30
|
+
/** Event payload. Keep it JSON-serializable for WS clients and worker proxying. */
|
|
31
31
|
payload: unknown;
|
|
32
32
|
}
|
|
33
33
|
//# sourceMappingURL=events.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,MAAM,WAAW,SAAS;IACxB,
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,MAAM,WAAW,SAAS;IACxB,qFAAqF;IACrF,KAAK,EAAE,MAAM,CAAC;IACd,sFAAsF;IACtF,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,iCAAiC;AACjC,MAAM,WAAW,OAAO;IACtB,oGAAoG;IACpG,WAAW,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;CACd;AAED,oCAAoC;AACpC,MAAM,WAAW,SAAS;IACxB,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,+FAA+F;AAC/F,MAAM,WAAW,WAAW;IAC1B,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,mFAAmF;IACnF,OAAO,EAAE,OAAO,CAAC;CAClB"}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Marker for pre-recorded phrase rows loaded from the Voctiv platform LE PostgreSQL DB
|
|
3
3
|
* ({@link PlatformApi.getRecords}). Pass to {@link ChannelAudio.play} instead of a URL/path string.
|
|
4
4
|
*
|
|
5
|
-
* Only used when Voctiv platform compatibility mode is enabled
|
|
5
|
+
* Only used when Voctiv platform compatibility mode is enabled and the server has resolved
|
|
6
|
+
* a trusted LE agent id/UUID plus `LEGACY_V3_RECORD_PHRASE_ROOT`.
|
|
6
7
|
*/
|
|
7
8
|
export declare const LEGACY_PHRASE_RECORD_BRAND: "__legacyPhraseRecord";
|
|
8
9
|
export interface LegacyPhraseRecord {
|
|
@@ -17,18 +18,24 @@ export interface LegacyPhraseRecord {
|
|
|
17
18
|
export declare function isLegacyPhraseRecord(source: unknown): source is LegacyPhraseRecord;
|
|
18
19
|
/** Parameters for {@link PlatformApi.getRecords} (Voctiv platform LE `RecordPhrase` / `record_phrase_file`). */
|
|
19
20
|
export interface LegacyGetRecordsParams {
|
|
21
|
+
/** Phrase group/name (`record_phrase.name`). */
|
|
20
22
|
phraseName: string;
|
|
23
|
+
/** Business flag used by the phrase catalog, normally `context.flag`. */
|
|
21
24
|
flag: string;
|
|
25
|
+
/** Language key used by the phrase catalog, normally `context.language`. */
|
|
22
26
|
language: string;
|
|
23
27
|
}
|
|
24
28
|
/**
|
|
25
|
-
* When set on {@link PlayOptions}, after TTS the audio is copied under the Voctiv platform
|
|
26
|
-
* and a `record_phrase` / `record_phrase_file` row is inserted so
|
|
27
|
-
* can retrieve it. Also registers the PCM in the TTS file
|
|
29
|
+
* When set on {@link PlayOptions}, after TTS the audio is copied under the Voctiv platform
|
|
30
|
+
* record-phrase root and a `record_phrase` / `record_phrase_file` row is inserted so
|
|
31
|
+
* {@link PlatformApi.getRecords} can retrieve it. Also registers the PCM in the TTS file
|
|
32
|
+
* cache for subsequent `say`/`presay`.
|
|
28
33
|
*
|
|
29
|
-
* Only honored when Voctiv platform compatibility mode is active
|
|
34
|
+
* Only honored when Voctiv platform compatibility mode is active, `LEGACY_V3_RECORD_PHRASE_ROOT`
|
|
35
|
+
* is set, TTS cache is available, and the server resolved a trusted LE agent id/UUID.
|
|
30
36
|
*/
|
|
31
37
|
export interface LegacySavePhraseOptions {
|
|
38
|
+
/** Phrase group/name to create or update. */
|
|
32
39
|
phraseName: string;
|
|
33
40
|
/** Defaults to dialog `flag` from channel params when omitted. */
|
|
34
41
|
flag?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legacy-phrase.d.ts","sourceRoot":"","sources":["../../src/types/legacy-phrase.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"legacy-phrase.d.ts","sourceRoot":"","sources":["../../src/types/legacy-phrase.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,wBAAkC,CAAC;AAE1E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,CAAC,0BAA0B,CAAC,EAAE,IAAI,CAAC;IAC5C,yGAAyG;IACzG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,0CAA0C;IAC1C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,kBAAkB,CAOlF;AAED,gHAAgH;AAChH,MAAM,WAAW,sBAAsB;IACrC,gDAAgD;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,uBAAuB;IACtC,6CAA6C;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -6,7 +6,8 @@ exports.isLegacyPhraseRecord = isLegacyPhraseRecord;
|
|
|
6
6
|
* Marker for pre-recorded phrase rows loaded from the Voctiv platform LE PostgreSQL DB
|
|
7
7
|
* ({@link PlatformApi.getRecords}). Pass to {@link ChannelAudio.play} instead of a URL/path string.
|
|
8
8
|
*
|
|
9
|
-
* Only used when Voctiv platform compatibility mode is enabled
|
|
9
|
+
* Only used when Voctiv platform compatibility mode is enabled and the server has resolved
|
|
10
|
+
* a trusted LE agent id/UUID plus `LEGACY_V3_RECORD_PHRASE_ROOT`.
|
|
10
11
|
*/
|
|
11
12
|
exports.LEGACY_PHRASE_RECORD_BRAND = '__legacyPhraseRecord';
|
|
12
13
|
function isLegacyPhraseRecord(source) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legacy-phrase.js","sourceRoot":"","sources":["../../src/types/legacy-phrase.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"legacy-phrase.js","sourceRoot":"","sources":["../../src/types/legacy-phrase.ts"],"names":[],"mappings":";;;AAmBA,oDAOC;AA1BD;;;;;;GAMG;AACU,QAAA,0BAA0B,GAAG,sBAA+B,CAAC;AAY1E,SAAgB,oBAAoB,CAAC,MAAe;IAClD,OAAO,CACL,OAAO,MAAM,KAAK,QAAQ;QAC1B,MAAM,KAAK,IAAI;QACd,MAA6B,CAAC,kCAA0B,CAAC,KAAK,IAAI;QACnE,OAAQ,MAA6B,CAAC,IAAI,KAAK,QAAQ,CACxD,CAAC;AACJ,CAAC"}
|
package/dist/types/logger.d.ts
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* In Voctiv platform compatibility mode, log entries are also batch-written
|
|
5
5
|
* to the `dialog_stats` DB table (equivalent of old LE `nn.log`).
|
|
6
|
+
* In all modes they go to the API process logger. Debug streaming, when enabled,
|
|
7
|
+
* forwards only logs from the current script session to the configured debug endpoint.
|
|
6
8
|
*/
|
|
7
9
|
export interface ScriptLogger {
|
|
8
10
|
/** Info-level log entry. */
|
|
@@ -11,7 +13,7 @@ export interface ScriptLogger {
|
|
|
11
13
|
warn(message: string, data?: Record<string, unknown>): void;
|
|
12
14
|
/** Error-level log entry. */
|
|
13
15
|
error(message: string, data?: Record<string, unknown>): void;
|
|
14
|
-
/** Debug-level log entry
|
|
16
|
+
/** Debug-level log entry; intended for process/debug stream output rather than legacy DB stats. */
|
|
15
17
|
debug(message: string, data?: Record<string, unknown>): void;
|
|
16
18
|
/**
|
|
17
19
|
* Enable real-time log streaming to a remote debug endpoint.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/types/logger.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/types/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,4BAA4B;IAC5B,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC3D,+BAA+B;IAC/B,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC5D,6BAA6B;IAC7B,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC7D,mGAAmG;IACnG,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAE7D;;;;;;OAMG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpC,kEAAkE;IAClE,YAAY,IAAI,IAAI,CAAC;IAErB;;;;;;;;;OASG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9E"}
|