@aiqa/sdk 1.5.0-develop.1 → 1.5.0-develop.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.
@@ -32,7 +32,7 @@ declare enum ConversationLanguage {
32
32
  ES = "es",
33
33
  FR = "fr"
34
34
  }
35
- type SdkEvent = Methods | "connect" | "disconnect" | "close" | "error" | "reconnect_attempt" | "reconnect_error" | "reconnect_failed" | "authenticated" | "app_version" | "FACT_VERIFIED";
35
+ type SdkEvent = Methods | "connect" | "disconnect" | "close" | "error" | "reconnect_attempt" | "reconnect_error" | "reconnect_failed" | "authenticated" | "app_version" | "FACT_VERIFIED" | "TRANSCRIPTION_UPDATED";
36
36
  declare enum FactAnswerFormatType {
37
37
  string = "STRING",
38
38
  number = "NUMBER",
@@ -182,6 +182,72 @@ interface FactVerifiedPayload {
182
182
  type FlagFactResult = {
183
183
  success: boolean;
184
184
  };
185
+ /**
186
+ * Coarse dialog-act label produced by the backend's `UtteranceEnricher`.
187
+ * Advisory only — do not gate production behaviour on this value; the
188
+ * enricher emits its best-effort categorical guess plus a separate
189
+ * `dialog_act_confidence` band.
190
+ *
191
+ * Mirrors `DialogAct` in
192
+ * `libs/types/src/utterance-enrichment.ts` on the backend.
193
+ */
194
+ type DialogAct = "question" | "answer" | "acknowledgement" | "filler" | "other";
195
+ /**
196
+ * Categorical confidence band for `dialog_act` ONLY. Named distinctly
197
+ * from the numeric STT `confidence` field on the same utterance — the
198
+ * two are unrelated and conflating them is a documented drift hazard on
199
+ * the backend.
200
+ *
201
+ * Mirrors `DialogActConfidence` in
202
+ * `libs/types/src/utterance-enrichment.ts` on the backend.
203
+ */
204
+ type DialogActConfidence = "high" | "medium" | "low";
205
+ /**
206
+ * Persisted utterance shape — matches `TranscriptionUtteranceDto` on the
207
+ * gateway (`apps/realtime-verification/src/socket/realtimeVerification.gateway.output.dto.ts`)
208
+ * and the `Utterance` interface in `libs/types/src/common.ts` field for
209
+ * field. Sent over the wire by the `TRANSCRIPTION_UPDATED` broadcast.
210
+ *
211
+ * The 7 enricher classification fields are all optional because
212
+ * pre-cutover utterances (persisted before backend PR #234) lack them.
213
+ * Treat any missing or nullish value as "unknown" — NOT as a deliberate
214
+ * negative signal. `is_ivr_filler_candidate === false` in particular
215
+ * does NOT round-trip through `undefined`, so consumer logic that wants
216
+ * "definitely not a filler" must check `=== false` after confirming the
217
+ * field is present.
218
+ */
219
+ type Utterance = {
220
+ /** UUIDv7 — chronologically sortable. Use `id` (NOT `order`) for sorting. */
221
+ id: string;
222
+ call_id: number;
223
+ /**
224
+ * NOT YET IMPLEMENTED — currently hardcoded to 0 at write sites on
225
+ * the backend. Do not use for sorting; sort by `id` (UUIDv7) instead.
226
+ */
227
+ order: number;
228
+ is_agent: boolean | null;
229
+ speaker: number;
230
+ text: string;
231
+ text_en: string | null;
232
+ start_time: number;
233
+ end_time: number;
234
+ dialog_act?: DialogAct;
235
+ dialog_act_confidence?: DialogActConfidence;
236
+ confidence?: number | null;
237
+ top_alt_margin?: number | null;
238
+ is_ivr_filler_candidate?: boolean;
239
+ spoken_digits_normalized?: string | null;
240
+ vendor?: string | null;
241
+ };
242
+ /**
243
+ * Payload of the `TRANSCRIPTION_UPDATED` broadcast event. Mirrors
244
+ * `TranscriptionUpdateResponseDto` on the gateway.
245
+ */
246
+ type TranscriptionUpdate = {
247
+ policyNumber: string;
248
+ conversationId: string;
249
+ utterance: Utterance;
250
+ };
185
251
  type SdkError = {
186
252
  code: "INVALID_CONFIG" | "CONNECTION_ERROR" | "TIMEOUT" | "SERVER_ERROR" | "UNEXPECTED_RESPONSE";
187
253
  message: string;
@@ -229,4 +295,4 @@ declare class AiQaSdk implements IAiqaSdk {
229
295
  private isManagerEvent;
230
296
  }
231
297
 
232
- export { type AddFactResult, AiQaSdk, type Application, type ApplicationFact, type ApplicationFactAnswerChoice, type ApplicationFactAnswerFormat, type ApplicationFactInput, ConversationLanguage, FactAnswerFormatType, type FactVerifiedPayload, type FlagFactResult, IAiqaSdk, Methods, type QuestionStatus, type SdkError, type SdkEvent, type SetConversationLanguageResult, type SetConversationProductResult, type VerificationStatus };
298
+ export { type AddFactResult, AiQaSdk, type Application, type ApplicationFact, type ApplicationFactAnswerChoice, type ApplicationFactAnswerFormat, type ApplicationFactInput, ConversationLanguage, type DialogAct, type DialogActConfidence, FactAnswerFormatType, type FactVerifiedPayload, type FlagFactResult, IAiqaSdk, Methods, type QuestionStatus, type SdkError, type SdkEvent, type SetConversationLanguageResult, type SetConversationProductResult, type TranscriptionUpdate, type Utterance, type VerificationStatus };
@@ -3396,7 +3396,7 @@ var compareVersions = (left, right) => {
3396
3396
  // package.json
3397
3397
  var package_default = {
3398
3398
  name: "@aiqa/sdk",
3399
- version: "1.4.0-develop.3",
3399
+ version: "1.5.0-develop.1",
3400
3400
  main: "dist/node/node.js",
3401
3401
  module: "dist/node/node.js",
3402
3402
  types: "dist/node/node.d.ts",