@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 ADDED
@@ -0,0 +1,458 @@
1
+ # @voctiv/agent-sdk
2
+
3
+ TypeScript SDK for scripts executed by the `node-asr-tts-connector` scripting runtime.
4
+
5
+ The package exports the `defineScript()` identity helper and the public runtime types for voice channels, SIP calls, ASR, TTS, VAD, Smart Turn, LLM, dialog context, logging, and Voctiv legacy platform compatibility APIs.
6
+
7
+ Runtime behavior is provided by `apps/api`. The SDK itself does not open SIP calls, run ASR/TTS, or talk to platform services; it describes the objects injected into your script by the host.
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ npm install @voctiv/agent-sdk rxjs
13
+ ```
14
+
15
+ `rxjs` is a peer dependency because the runtime API exposes observables for ASR, SIP, channel events, queues, and LLM streams.
16
+
17
+ ## Basic Script
18
+
19
+ Scripts export a function created with `defineScript()`. The runtime loads the module and calls it with `{ channel, logger, context, platform }`.
20
+
21
+ ```ts
22
+ import { defineScript } from '@voctiv/agent-sdk';
23
+ import { firstValueFrom } from 'rxjs';
24
+
25
+ export default defineScript(async ({ channel, logger, context, platform }) => {
26
+ logger.log('Script started', { dialogUuid: context.dialogUuid });
27
+
28
+ const asr = await channel.createAsr({
29
+ language: context.language || 'ru-RU',
30
+ smartTurn: { enabled: true },
31
+ });
32
+
33
+ await channel.audio.say('Hello! How can I help you?');
34
+ const userText = await firstValueFrom(asr.result$);
35
+
36
+ const nlu = await platform.nlu.extract(userText);
37
+ logger.log('NLU result', { nlu });
38
+
39
+ asr.destroy();
40
+ return { output: { userText, nlu } };
41
+ });
42
+ ```
43
+
44
+ ## What The SDK Contains
45
+
46
+ `defineScript(fn)` marks the default export as the script entry point. It returns the same function and exists to give TypeScript the correct `ScriptContext` shape.
47
+
48
+ `ScriptContext` is the top-level object passed to a script:
49
+
50
+ - `channel` is the media channel for SIP, WS, ASR, TTS, audio playback, LLM, and structured data messages.
51
+ - `logger` writes structured script logs and can stream logs to a debug endpoint.
52
+ - `context` contains dialog identity, caller/called numbers, language, flags, params, entry point, persisted env, and runtime budget.
53
+ - `platform` exposes legacy platform operations: NLU, dialog state, outbound call scheduling, messaging, and phrase records.
54
+
55
+ `MediaChannel` is the main real-time API:
56
+
57
+ - `channel.type` is `"sip"` for telephony and `"ws"` for WebSocket/script-manager sessions. Headless sessions currently expose a synthetic `"ws"` channel; check `context.headless` to detect them.
58
+ - `channel.params` is the merged runtime parameter map. Treat unknown keys as host-specific.
59
+ - `channel.createAsr()` creates an ASR handle.
60
+ - `channel.audio` controls TTS, raw playback, pre-synthesis, and mixer queues.
61
+ - `channel.sip` controls SIP state, pre-answer media, DTMF, hold/mute/hangup, outbound calls, and bridging.
62
+ - `channel.llm` talks to the Omni LLM backend.
63
+ - `channel.events` exposes speech, interrupt, termination, and WS data message observables.
64
+ - `channel.textInput` injects synthetic ASR results for tests and debug clients.
65
+
66
+ ## SIP And Pre-Answer Media
67
+
68
+ SIP sessions expose call state through `channel.sip.state`, `state$`, `progress$`, `early$`, and `answered$`.
69
+
70
+ The important states are:
71
+
72
+ - `ringing`: INVITE is in progress, but no media is available yet.
73
+ - `early`: RTP is ready before the final 200 OK answer. ASR, TTS, playback, and DTMF work in this state.
74
+ - `active`: final 200 OK has been received or sent.
75
+ - `terminated`: the call ended and no more audio is possible.
76
+
77
+ ### Outbound Pre-Answer
78
+
79
+ For outbound calls, early media starts when the remote side sends a provisional response with SDP, usually `183 Session Progress`. This is useful for IVRs that speak before answering.
80
+
81
+ ```ts
82
+ const bLeg = await channel.sip.makeCall({
83
+ sipUri: 'sip:+12025551234@trunk.example.com',
84
+ });
85
+
86
+ await bLeg.sip.waitForEarly();
87
+
88
+ const asr = await bLeg.createAsr({ language: 'en-US' });
89
+ asr.result$.subscribe((text) => {
90
+ if (/press one/i.test(text)) {
91
+ bLeg.sip.sendDtmf('1');
92
+ }
93
+ });
94
+ ```
95
+
96
+ `waitForEarly()` resolves when the call reaches either `early` or `active`. If a carrier skips early media and answers directly, it resolves on the final answer.
97
+
98
+ ### Inbound Pre-Answer
99
+
100
+ For inbound calls, call `channel.sip.sendProgress()` to send `183 Session Progress` with SDP. This enters `early` state and enables full-duplex audio before the final answer.
101
+
102
+ ```ts
103
+ import { firstValueFrom } from 'rxjs';
104
+
105
+ channel.sip.sendProgress();
106
+ await channel.sip.waitForEarly();
107
+
108
+ const asr = await channel.createAsr({ language: 'en-US' });
109
+ await channel.audio.say('Please say your account number.');
110
+
111
+ const account = await firstValueFrom(asr.result$);
112
+
113
+ channel.sip.answer();
114
+ await channel.audio.say(`Thank you. Looking up account ${account}.`);
115
+ ```
116
+
117
+ The API does not mark the call as answered until `answer()` sends final `200 OK`. External billing still depends on carrier policy.
118
+
119
+ ### Audio Auto-Wait
120
+
121
+ On SIP channels, `channel.audio.say()` and `channel.audio.play()` automatically wait until RTP is ready (`early` or `active`). You only need explicit `waitForEarly()` / `waitForAnswer()` when your script logic depends on the state transition.
122
+
123
+ If the call terminates before media becomes available, deferred audio resolves as a no-op.
124
+
125
+ ### SIP Controls
126
+
127
+ `channel.sip` also supports:
128
+
129
+ - `answer()` for inbound final answer.
130
+ - `sendDtmf(digit, duration?)` for IVR navigation.
131
+ - `sendInfo(contentType, body)` for SIP INFO messages.
132
+ - `hold()` / `unhold()` for SIP hold.
133
+ - `mute()` / `unmute()` for local outgoing audio suppression.
134
+ - `hangup()` to terminate the call.
135
+ - `makeCall()` to create an outbound SIP B-leg from the main SIP channel.
136
+ - `bridge(other)` to cross-connect two SIP channels.
137
+
138
+ `makeCall()` and `bridge()` are only supported by the main SIP channel. Worker-isolated, WS, and headless channels do not create nested SIP legs.
139
+
140
+ ## ASR, VAD, And Smart Turn
141
+
142
+ Create ASR with `channel.createAsr(config?)`.
143
+
144
+ ```ts
145
+ const asr = await channel.createAsr({
146
+ vendor: 'Y',
147
+ name: 'main-yandex-key',
148
+ language: 'ru-RU',
149
+ vad: {
150
+ positiveThreshold: 0.55,
151
+ negativeThreshold: 0.35,
152
+ preSpeechFrames: 12,
153
+ postSpeechFrames: 12,
154
+ },
155
+ smartTurn: {
156
+ enabled: true,
157
+ silenceTimeoutMs: 1200,
158
+ },
159
+ });
160
+ ```
161
+
162
+ `AsrHandle` exposes:
163
+
164
+ - `result$`: finalized utterances.
165
+ - `partial$`: streaming partial hypotheses.
166
+ - `speechStart$` / `speechEnd$`: VAD speech boundaries.
167
+ - `interrupt$`: barge-in / interrupt events where the host supports them.
168
+ - `vadProbability$`: normalized VAD probability when available.
169
+ - `pause()` / `resume()` to stop or resume forwarding new audio frames.
170
+ - `finalize()` to force the current utterance to flush.
171
+ - `destroy()` to close connector streams and subscriptions.
172
+
173
+ SIP sessions use the call-level telephony VAD when it is available. WS sessions create one VAD/SmartTurn instance for the socket session on the first `createAsr()` call. Headless sessions return an inert ASR handle with empty observables.
174
+
175
+ If ASR connector creation fails, SIP/WS return a degraded handle. VAD observables still mirror the channel where possible, but no real STT results are emitted.
176
+
177
+ ## ASR Credentials And Vendors
178
+
179
+ `AsrConfig.vendor` is an engine hint, for example `"Y"`, `"D"`, `"yandex"`, or `"neuro_v3"`, resolved by the host vendor alias mapping.
180
+
181
+ In Voctiv legacy compatibility mode, ASR credentials can be selected by logic-executor `key_storage.name`:
182
+
183
+ ```ts
184
+ const asr = await channel.createAsr({
185
+ name: 'main-asr-key',
186
+ language: 'ru-RU',
187
+ });
188
+ ```
189
+
190
+ The runtime looks in `channel.params.authentication_data.legacyAsrKeysByName[name]` for the current dialog agent and company. If `name` is omitted, `channel.params.defaultAsrName` may be used. Vendor-specific overrides go into `data`; primitives are stringified and objects/arrays are JSON-serialized before connector config is built.
191
+
192
+ ## TTS, Playback, And Mixer Queues
193
+
194
+ `channel.audio.say(textOrObservable, options?)` synthesizes text and plays it through the mixer.
195
+
196
+ ```ts
197
+ await channel.audio.say('Please wait while I check that.', {
198
+ queue: 0,
199
+ alias: 'main-response',
200
+ ttsVendor: 'E',
201
+ ttsStrategy: 'sentence',
202
+ ttsConfig: {
203
+ voice_id: 'voice-id',
204
+ output_format: 'pcm_16000',
205
+ },
206
+ });
207
+ ```
208
+
209
+ `channel.audio.play(source, options?)` plays raw audio from a URL/path or a `LegacyPhraseRecord`.
210
+
211
+ ```ts
212
+ await channel.audio.play('/opt/prompts/welcome.wav', {
213
+ queue: 1,
214
+ alias: 'welcome-earcon',
215
+ });
216
+ ```
217
+
218
+ `channel.audio.presay(text, options?)` pre-synthesizes TTS into the host TTS cache. If the cache is not available, the runtime logs a warning and resolves without throwing.
219
+
220
+ `channel.audio.preload(source)` decodes a raw audio source through the audio player. It does not synthesize TTS and does not populate the TTS cache used by `presay()`.
221
+
222
+ ### TTS Strategies
223
+
224
+ `ttsStrategy` controls how text is chunked:
225
+
226
+ - `sentence`: split on sentence boundaries and synthesize each sentence. This is the default.
227
+ - `streaming`: send chunks incrementally for streaming-capable vendors.
228
+ - `full`: accumulate the whole input and synthesize it as one segment after the input completes.
229
+
230
+ When using an `Observable<string>` input, WS clients also receive text progress events for streamed chunks.
231
+
232
+ ### Mixer Queues
233
+
234
+ The mixer has queues `0` through `4`. Use separate queues for main speech, earcons, hold music, or background audio.
235
+
236
+ ```ts
237
+ const music = channel.audio.queue(2);
238
+ music.volume = 0.25;
239
+
240
+ await channel.audio.play('/opt/audio/hold.wav', {
241
+ queue: 2,
242
+ alias: 'hold-music',
243
+ loop: true,
244
+ });
245
+
246
+ channel.audio.stop(2);
247
+ ```
248
+
249
+ `PlayOptions.volume` changes the whole queue volume, not just one item. `stop(queue)` clears a queue and aborts in-flight sentence TTS for that queue. `stopAll()` clears every queue.
250
+
251
+ For sentence-split TTS, internal queue item aliases are suffixed as `alias-0`, `alias-1`, and so on. Raw `play()` and direct streaming TTS use the alias exactly.
252
+
253
+ ## TTS Credentials And Saved Phrases
254
+
255
+ In Voctiv legacy compatibility mode, TTS credentials can be selected by `PlayOptions.name` or `ttsConfig.name`.
256
+
257
+ ```ts
258
+ await channel.audio.say('Здравствуйте!', {
259
+ name: 'main-tts-key',
260
+ ttsConfig: {
261
+ voice: 'alena',
262
+ },
263
+ });
264
+ ```
265
+
266
+ The runtime looks in `channel.params.authentication_data.legacyTtsKeysByName[name]`. If `name` is omitted, `channel.params.defaultTtsName` may be used.
267
+
268
+ `legacySavePhrase` stores synthesized audio under the Voctiv record phrase storage root and inserts phrase metadata so it can later be loaded with `platform.getRecords()`.
269
+
270
+ ```ts
271
+ await channel.audio.say('Welcome back.', {
272
+ legacySavePhrase: {
273
+ phraseName: 'welcome_back',
274
+ flag: context.flag,
275
+ language: context.language,
276
+ },
277
+ });
278
+
279
+ const records = await platform.getRecords?.({
280
+ phraseName: 'welcome_back',
281
+ flag: context.flag,
282
+ language: context.language,
283
+ });
284
+
285
+ if (records?.[0]) {
286
+ await channel.audio.play(records[0]);
287
+ }
288
+ ```
289
+
290
+ This requires legacy compatibility mode, a trusted LE agent id/UUID, TTS cache, and `LEGACY_V3_RECORD_PHRASE_ROOT`.
291
+
292
+ ## LLM API
293
+
294
+ `channel.llm` talks to the Omni LLM backend.
295
+
296
+ ```ts
297
+ const answer = await channel.llm.ask('Summarize the user request', {
298
+ role: 'assistant',
299
+ hidden: true,
300
+ agentUuid: context.agentUuid,
301
+ });
302
+
303
+ await channel.audio.say(answer);
304
+ ```
305
+
306
+ For streaming:
307
+
308
+ ```ts
309
+ const stream$ = channel.llm.stream('Answer briefly', {
310
+ role: 'assistant',
311
+ });
312
+
313
+ await channel.audio.say(
314
+ stream$.pipe(map((chunk) => chunk.content)),
315
+ { ttsStrategy: 'streaming' },
316
+ );
317
+ ```
318
+
319
+ `channel.llm.extract(options?)` runs structured extraction via Omni. `makePersistentStream(options?)` opens a long-lived Socket.IO stream and lets you send multiple turns without reconnecting.
320
+
321
+ ## Platform API
322
+
323
+ `platform` exposes Voctiv legacy-compatible operations.
324
+
325
+ `platform.nlu.extract(utterance, options?)` calls NLU v3 `/infer`. The runtime sends `phrase`, `context`, and `agent_id`. If `options.context` is omitted, current dialog params are serialized and used as NLU context.
326
+
327
+ ```ts
328
+ const result = await platform.nlu.extract('I want to reschedule', {
329
+ intents: ['reschedule', 'cancel'],
330
+ entities: ['date', 'time'],
331
+ use_synonyms: true,
332
+ });
333
+ ```
334
+
335
+ Legacy platform APIs require `context.legacyV3Compat === true` in the current `apps/api` runtime. This includes NLU, outbound calls, dialog writes, messaging sends, and phrase records.
336
+
337
+ ### Dialog State
338
+
339
+ ```ts
340
+ platform.dialog.entryPoint = 'on_recall';
341
+ platform.dialog.result = 'done';
342
+ ```
343
+
344
+ Setters update the local value immediately and ask the platform DB to persist asynchronously. They are not awaitable and should not be used as transactional writes.
345
+
346
+ ### Outbound Calls
347
+
348
+ ```ts
349
+ await platform.call('+12025551234', {
350
+ date: new Date(Date.now() + 60_000),
351
+ entryPoint: 'on_callback',
352
+ recallCount: 2,
353
+ recallDelay: 300,
354
+ priority: 10,
355
+ });
356
+ ```
357
+
358
+ This creates a row in the legacy `call` table. The dialer picks it up and originates the SIP call.
359
+
360
+ ### Messaging
361
+
362
+ ```ts
363
+ await platform.messaging.send({
364
+ src: 'bot',
365
+ destination: '+12025551234',
366
+ text: 'Your appointment is confirmed.',
367
+ });
368
+ ```
369
+
370
+ Outbound messages are transported through legacy Redis streams. `platform.messaging.message$` currently replays the inbound message that started a headless messaging script; it is not a live subscription to all future Redis messages.
371
+
372
+ ## Dialog Context And Persisted Env
373
+
374
+ `context` includes identity, telephony fields, params, routing metadata, and runtime helpers.
375
+
376
+ Important fields:
377
+
378
+ - `context.dialogUuid`: current dialog UUID.
379
+ - `context.callerId` / `context.msisdn`: caller identity.
380
+ - `context.destinationNumber`: called number.
381
+ - `context.language` / `context.lang`: language selected for the run.
382
+ - `context.flag`: business flag.
383
+ - `context.initialData`: shallow snapshot of params at script start.
384
+ - `context.dialogParams`: live param map for the run.
385
+ - `context.entryPoint`: current routing entry point.
386
+ - `context.headless`: true for offline/queue/messaging sessions without a real media channel.
387
+ - `context.runTime`: async execution budget helper.
388
+ - `context.env$`: persisted dialog environment as an RxJS `BehaviorSubject`.
389
+
390
+ Use `env$` for persisted script state:
391
+
392
+ ```ts
393
+ const current = context.env$?.getValue() ?? {};
394
+ context.env$?.next({
395
+ ...current,
396
+ lastIntent: 'reschedule',
397
+ });
398
+ ```
399
+
400
+ Do not return `env` from the script. The runtime snapshots `context.env$` after completion and attaches it to the persisted result.
401
+
402
+ ## Logging And Debugging
403
+
404
+ Use `logger.log()`, `warn()`, `error()`, and `debug()` for structured logs.
405
+
406
+ ```ts
407
+ logger.log('ASR result received', { text });
408
+ logger.warn('Low confidence intent', { confidence });
409
+ ```
410
+
411
+ `logger.enableDebug(endpoint)` streams logs from the current script instance to a remote debug endpoint. `logger.breakpoint(label, snapshot?)` pauses only when an active debug session is connected; otherwise it resolves immediately.
412
+
413
+ ## WS And Headless Behavior
414
+
415
+ WS channels behave like active media channels:
416
+
417
+ - `channel.sip.state` is effectively active.
418
+ - `sendDtmf()` emits `dtmf-send` to the WS client.
419
+ - `sendMessage()` emits a structured `data` event.
420
+ - ASR reads socket audio frames or synthetic text input.
421
+
422
+ Headless channels are for offline, queue, or messaging sessions:
423
+
424
+ - Audio methods are no-ops that log warnings.
425
+ - SIP methods are mostly no-ops.
426
+ - `createAsr()` returns an inert handle.
427
+ - LLM and platform APIs still work.
428
+
429
+ Use `context.headless` to branch when a script must behave differently without a real media channel.
430
+
431
+ ## Text Input For Tests
432
+
433
+ `channel.textInput` injects synthetic ASR output into a live ASR handle.
434
+
435
+ ```ts
436
+ const asr = await channel.createAsr();
437
+
438
+ channel.textInput.pushPartial(asr.id, 'hello', false);
439
+ channel.textInput.pushResult(asr.id, 'hello world');
440
+ ```
441
+
442
+ This is mainly for WS debug clients and automated tests. Unknown ASR ids are ignored.
443
+
444
+ ## Package Notes
445
+
446
+ The package is published as CommonJS with TypeScript declarations in `dist`.
447
+
448
+ Build locally with:
449
+
450
+ ```bash
451
+ npm run build
452
+ ```
453
+
454
+ The package exports only the public SDK entry point:
455
+
456
+ ```ts
457
+ import { defineScript, type MediaChannel, type AsrHandle } from '@voctiv/agent-sdk';
458
+ ```
@@ -6,20 +6,32 @@ import type { LegacyGetRecordsParams, LegacyPhraseRecord } from './types/legacy-
6
6
  /**
7
7
  * NLU (Natural Language Understanding) API.
8
8
  *
9
- * Provides intent/entity extraction from user utterances.
10
- * Compatible with logic-executor `nn.extract()`.
9
+ * Provides intent/entity extraction through the legacy NLU v3 `/infer` endpoint.
10
+ * The current `apps/api` runtime only allows this API when `context.legacyV3Compat`
11
+ * is `true` and NLU runtime settings are configured (`NLU_V3_BASE_URL` plus a
12
+ * resolved numeric agent id). Calls fail fast with a descriptive error otherwise.
13
+ *
14
+ * Compatible with logic-executor `nn.extract()` request/response shape.
11
15
  */
12
16
  export interface NluScriptApi {
13
17
  /**
14
- * Extract intents and entities from text.
18
+ * Extract intents and entities from one user utterance.
19
+ *
20
+ * The runtime sends `{ phrase, context, agent_id }` to NLU v3. If
21
+ * `options.context` is omitted, it serializes the current dialog params
22
+ * (`context.dialogParams`, then legacy fallbacks) as the request context.
23
+ *
15
24
  * @param utterance - User input text to analyze.
16
- * @param options - Filter by specific intents/entities, add context, etc.
17
- * @returns Parsed NLU result with intents, entities, and confidence scores.
25
+ * @param options - Optional NLU filters and flags. `entities`, `intents`,
26
+ * `use_neuro_api`, and `use_synonyms` are forwarded by the current API runtime.
27
+ * @returns Raw parsed JSON response from the NLU `/infer` endpoint.
18
28
  */
19
29
  extract(utterance: string, options?: NluExtractOptions): Promise<NluInferResult>;
20
30
  /**
21
- * Same as {@link extract} but returns an RxJS Observable
22
- * (useful for streaming pipelines).
31
+ * Observable wrapper around {@link extract}.
32
+ *
33
+ * This is not a streaming NLU session: every subscription performs one
34
+ * `extract()` call and emits exactly one result or one error.
23
35
  */
24
36
  extract$(utterance: string, options?: NluExtractOptions): Observable<NluInferResult>;
25
37
  }
@@ -51,7 +63,14 @@ export interface ScriptDialogContext {
51
63
  scriptName: string;
52
64
  /** Agent UUID from Omni platform (links script to an NLU agent). */
53
65
  agentUuid?: string;
54
- /** Numeric NLU agent ID used for extract() calls. */
66
+ /**
67
+ * Numeric NLU agent id used for `platform.nlu.extract()` and legacy DB operations.
68
+ *
69
+ * Resolved by the server from Omni/LE mapping or env (`NLU_DEFAULT_AGENT_ID` /
70
+ * `AGENT_ID`). Client/session params named `agent_id`, `agentId`, `agentUuid`,
71
+ * and `agent_uuid` are stripped before context construction and cannot spoof it.
72
+ * May be `0` when no agent id is configured; NLU and `platform.call()` will then fail.
73
+ */
55
74
  agentId: number;
56
75
  /**
57
76
  * **Snapshot** of dialog/session payload when the script run started.
@@ -78,16 +97,19 @@ export interface ScriptDialogContext {
78
97
  /** `true` when the script runs without a real media channel (offline / queue / messaging). */
79
98
  headless: boolean;
80
99
  /**
81
- * Persisted dialog environment for this conversation. On each call the platform loads the
82
- * previous snapshot and seeds {@link env$}. On the first call the value is `undefined`.
100
+ * Persisted dialog environment for this conversation. The API runtime converts the
101
+ * plain persisted `env` snapshot into this `BehaviorSubject` before invoking the script.
102
+ * On the first call the value is `undefined`.
83
103
  *
84
104
  * **Read/write only via `env$`:** use `env$.getValue()`, `env$.next(partialOrNext)`, or
85
105
  * `env$.subscribe(...)`. Do not use a plain `context.env` — it is not provided.
86
106
  *
87
107
  * **Persistence:** On script completion (success or error), the runtime snapshots `env$` and
88
- * persists it; the script return value must not carry env (see {@link ScriptResult}).
108
+ * attaches it to the persisted result; the script return value must not carry env
109
+ * (see {@link ScriptResult}).
89
110
  *
90
- * Only active in Voctiv platform compatibility mode.
111
+ * Session runners decide where that snapshot is stored. In Voctiv platform compatibility
112
+ * mode it is used as the LE-style dialog environment.
91
113
  */
92
114
  env$?: BehaviorSubject<Record<string, unknown> | undefined>;
93
115
  /** Raw `dialog` table row from the Voctiv platform database. */
@@ -173,35 +195,46 @@ export interface ScheduleCallOptions {
173
195
  date?: string | Date;
174
196
  /** Deadline — don't call after this time. */
175
197
  dateEnd?: string | Date;
176
- /** Entry point to pass to the script when the call connects. */
198
+ /**
199
+ * Entry point to pass to the script when the call connects.
200
+ *
201
+ * Stored in the created call params as `entry_point`.
202
+ */
177
203
  entryPoint?: string;
178
- /** Override script name/path for the outbound call. */
204
+ /**
205
+ * Legacy compatibility field for callers that schedule without a current `scriptId`.
206
+ *
207
+ * The current `apps/api` scheduler only uses this to allow validation when
208
+ * `scriptId` is missing; it does not resolve the script name/path itself.
209
+ */
179
210
  script?: string;
180
- /** SIP channel/trunk name override. */
211
+ /** Reserved SIP channel/trunk hint. The current `apps/api` scheduler does not persist it. */
181
212
  channel?: string;
182
- /** How many times to retry on failure. */
213
+ /** How many times to retry on failure. Stored as `recall_count` in call params. */
183
214
  recallCount?: number;
184
- /** Delay in seconds between retries. */
215
+ /** Delay in seconds between retries. Stored as `recall_delay` in call params. */
185
216
  recallDelay?: number;
186
- /** Entry point to use after a successful call. */
217
+ /** Entry point to use after a successful call. Stored as `on_success_call`. */
187
218
  onSuccessCall?: string;
188
- /** Entry point to use after a failed call. */
219
+ /** Entry point to use after a failed call. Stored as `on_failed_call`. */
189
220
  onFailedCall?: string;
190
221
  /** Call priority (higher = processed sooner by dialer). */
191
222
  priority?: number;
192
- /** Timezone offset (hours) for date interpretation. */
223
+ /** Timezone offset passed to the legacy call row as `timeZone`. */
193
224
  timezone?: number;
194
- /** Extra SIP headers or protocol-level params. */
225
+ /** Extra SIP headers or protocol-level params. Stored as `proto_additional` in call params. */
195
226
  protoAdditional?: Record<string, string>;
196
227
  }
197
228
  /**
198
229
  * Dialog state API — read and update dialog routing metadata.
199
230
  *
200
- * Setting `entryPoint` or `result` immediately persists the change
201
- * to the Voctiv platform database (non-blocking, fire-and-forget).
231
+ * Setting `entryPoint` or `result` updates the local value immediately and asks
232
+ * the Voctiv platform database to persist the change asynchronously. In worker
233
+ * sessions the setter sends an RPC to the main thread; in direct sessions errors
234
+ * are logged. There is no awaitable setter, so do not use it for transactional flow.
202
235
  */
203
236
  export interface DialogApi {
204
- /** Current script entry point (e.g. `"on_recall"`). Set to change routing for next call. */
237
+ /** Current script entry point (e.g. `"on_recall"`). Set to change routing for the next call. */
205
238
  entryPoint: string | undefined;
206
239
  /** Dialog outcome (e.g. `"done"`, `"busy"`, `"no_answer"`). Set to finalize dialog. */
207
240
  result: string | undefined;
@@ -212,11 +245,11 @@ export interface DialogApi {
212
245
  }
213
246
  /** Options for sending an outbound message via {@link MessagingApi.send}. */
214
247
  export interface SendMessageOptions {
215
- /** Sender identifier (your service ID or phone number). */
248
+ /** Sender identifier (service id, bot id, or phone number expected by the MA consumer). */
216
249
  src: string;
217
- /** Recipient identifier (phone number, user ID, etc.). */
250
+ /** Recipient identifier (phone number, user id, or channel-specific address). */
218
251
  destination: string;
219
- /** Text body of the message. */
252
+ /** Text body of the message. When present in legacy mode, it is also mirrored to dialog stats. */
220
253
  text?: string;
221
254
  /** URL of an attachment (image, document, etc.). */
222
255
  attachment?: string;
@@ -237,8 +270,10 @@ export interface InboundMessage {
237
270
  /**
238
271
  * Messaging API — send and receive messages through external channels.
239
272
  *
240
- * Messages are transported via Redis Streams (`ma_send` / `ma_receive`),
241
- * compatible with the old LE messaging architecture.
273
+ * Outbound messages are transported via Redis Streams (`ma_send` / `ma_receive`),
274
+ * compatible with the old LE messaging architecture. `message$` is currently a
275
+ * one-shot replay of the inbound message that started a headless messaging script,
276
+ * not a live subscription to all future Redis messages.
242
277
  */
243
278
  export interface MessagingApi {
244
279
  /**
@@ -257,11 +292,12 @@ export interface MessagingApi {
257
292
  * Platform API — Voctiv platform–compatible operations available to scripts.
258
293
  *
259
294
  * Provides access to NLU, dialog state management, outbound call scheduling,
260
- * and messaging. Only functional in Voctiv platform compatibility mode
261
- * (except `nlu` which is always available).
295
+ * phrase records, and messaging. These operations are legacy-platform backed:
296
+ * the current `apps/api` runtime requires `context.legacyV3Compat === true` for
297
+ * NLU, `call`, `dialog` writes, messaging sends, and `getRecords`.
262
298
  */
263
299
  export interface PlatformApi {
264
- /** NLU intent/entity extraction API. */
300
+ /** NLU intent/entity extraction API; throws outside legacy V3 compatibility mode. */
265
301
  readonly nlu: NluScriptApi;
266
302
  /** Dialog state — read/write entry point and result. */
267
303
  readonly dialog: DialogApi;
@@ -1 +1 @@
1
- {"version":3,"file":"define-script.d.ts","sourceRoot":"","sources":["../src/define-script.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,KAAK,EACV,sBAAsB,EACtB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAE/B;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,OAAO,CACL,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,cAAc,CAAC,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CACN,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,UAAU,CAAC,cAAc,CAAC,CAAC;CAC/B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,QAAQ,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,iBAAiB,EAAE,MAAM,CAAC;IAC1B,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,kCA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AAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;CAC5E;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,OAAO,EAAE,YAAY,CAAC;IACtB,0FAA0F;IAC1F,MAAM,EAAE,YAAY,CAAC;IACrB,wFAAwF;IACxF,OAAO,EAAE,mBAAmB,CAAC;IAC7B,mEAAmE;IACnE,QAAQ,EAAE,WAAW,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,CACrB,GAAG,EAAE,aAAa,KACf,IAAI,GAAG,YAAY,GAAG,OAAO,CAAC,IAAI,GAAG,YAAY,CAAC,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,QAAQ,GAAG,QAAQ,CAEnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"define-script.js","sourceRoot":"","sources":["../src/define-script.ts"],"names":[],"mappings":";;AAoYA,oCAEC;AA3BD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAgB,YAAY,CAAC,EAAY;IACvC,OAAO,EAAE,CAAC;AACZ,CAAC"}
1
+ {"version":3,"file":"define-script.js","sourceRoot":"","sources":["../src/define-script.ts"],"names":[],"mappings":";;AAwaA,oCAEC;AA3BD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAgB,YAAY,CAAC,EAAY;IACvC,OAAO,EAAE,CAAC;AACZ,CAAC"}