@aiqa/sdk 2.2.0 → 2.3.0-develop.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/README.md CHANGED
@@ -129,6 +129,7 @@ going so far.
129
129
  agent_id: string;
130
130
  agent_first_name: string;
131
131
  agent_last_name: string;
132
+ external_status?: string;
132
133
  verification?: ApplicationVerificationSummary;
133
134
  }
134
135
  ```
@@ -140,6 +141,12 @@ going so far.
140
141
  [Reading `verification`](#reading-verification) for the exception.
141
142
  `agent_first_name` and `agent_last_name` come back empty; use
142
143
  `updateConversation({ agentName })` if you need to record an agent's name.
144
+ `external_status` is the value you last sent with
145
+ `updateConversation({ externalStatus })`, lowercased — one of
146
+ [`ExternalStatus`](#externalstatus) — and is **missing** until you send one.
147
+ Read it to recover the status after a reconnect instead of keeping your own
148
+ copy. It is the one field here that never comes from the authentication
149
+ snapshot, so on the fallback path it is absent rather than stale.
143
150
 
144
151
  ```typescript
145
152
  const application = await sdk.getApplication();
@@ -296,6 +303,8 @@ a timeout, a rejected payload.
296
303
  question: string;
297
304
  expected_answer: any;
298
305
  answer_format: { type: "STRING" }
306
+ /** Optional (default: `false`). Use `true` when the fact was collected before the conversation started. It is stored, not verified. */
307
+ prefilled?: boolean
299
308
  /**
300
309
  * Optional. Your own identifiers for this fact — a form field ID, a
301
310
  * section name, anything that lets your UI map the result back to the
@@ -506,6 +515,8 @@ Rules:
506
515
  `unmatched`). Show progress from the `FACT_VERIFIED` event, show the final
507
516
  result from the Promise.
508
517
  - **Handle a `verification_status` you don't recognize as `processing`.**
518
+ - **A fact sent with `prefilled: true` is never verified**, so it gets no
519
+ `verification_status` and no `FACT_VERIFIED` event.
509
520
  - **`pending_confirmation_*` is never final.** The answer can still change,
510
521
  so don't show it as a decision.
511
522
  - **A fact can be revised after `addFact()` has resolved.** If you keep its
@@ -527,6 +538,10 @@ type Application = {
527
538
  agent_id: string;
528
539
  agent_first_name: string; // comes back empty
529
540
  agent_last_name: string; // comes back empty
541
+ // The externalStatus you last sent, lowercased. Missing until you send one
542
+ // — not the same as "draft". Never in the authentication snapshot, so on the
543
+ // fallback path below it is absent, not stale.
544
+ external_status?: ExternalStatus | (string & {});
530
545
  // Missing when there is no summary for the call — not the same as zeros.
531
546
  // See "Reading verification" above.
532
547
  verification?: ApplicationVerificationSummary;
@@ -725,6 +740,8 @@ type ApplicationFactInput = {
725
740
  // and one of them sets status to "critical_errors".
726
741
  critical?: boolean;
727
742
  is_skipped?: boolean;
743
+ /** Optional (default: `false`). Use `true` when the fact was collected before the conversation started. It is stored, not verified. */
744
+ prefilled?: boolean;
728
745
  /**
729
746
  * Optional. Your own identifiers for this fact — a form field ID, a section
730
747
  * name, anything that lets your UI map the result back to the right place.
@@ -56,6 +56,17 @@ type Application = {
56
56
  agent_first_name: string;
57
57
  /** Comes back empty. Set an agent name with `updateConversation()`. */
58
58
  agent_last_name: string;
59
+ /**
60
+ * The status you last reported with `updateConversation({ externalStatus })`,
61
+ * folded to lowercase by the server. Missing when you never reported one —
62
+ * which is not the same as `"draft"`. Unlike the fields above it is never in
63
+ * the authentication snapshot, so on the fallback path described under
64
+ * `verification` it is absent rather than stale.
65
+ *
66
+ * Same open union as the input side: the members autocomplete, and a status
67
+ * the server learns before this package does still type-checks.
68
+ */
69
+ external_status?: ExternalStatus | (string & {});
59
70
  /**
60
71
  * How the call is going so far. When it is missing there is no summary —
61
72
  * which is not the same as all zeros — and the fields above may then be the
@@ -170,6 +181,8 @@ type ApplicationFactInput = {
170
181
  */
171
182
  critical?: boolean;
172
183
  is_skipped?: boolean;
184
+ /** Optional (default: `false`). Use `true` when the fact was collected before the conversation started. It is stored, not verified. */
185
+ prefilled?: boolean;
173
186
  /**
174
187
  * Your own identifiers for this fact — a form field ID, a section name,
175
188
  * anything that lets your UI map the result back to the right place.
@@ -217,6 +230,7 @@ interface AddFactResult {
217
230
  answer_type?: string;
218
231
  agent_answer?: string;
219
232
  ai_answer?: string;
233
+ /** `false` for a fact that was never verified, such as a prefilled one. */
220
234
  is_valid_answer: boolean;
221
235
  question_asked?: boolean;
222
236
  /**
@@ -3406,7 +3406,7 @@ var compareVersions = (left, right) => {
3406
3406
  // package.json
3407
3407
  var package_default = {
3408
3408
  name: "@aiqa/sdk",
3409
- version: "2.2.0-develop.1",
3409
+ version: "2.2.0-develop.3",
3410
3410
  main: "dist/node/node.js",
3411
3411
  module: "dist/node/node.js",
3412
3412
  types: "dist/node/node.d.ts",