@alxxsck/ai-assistant 2.22.3 → 2.23.0

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
@@ -186,32 +186,43 @@ Closing a hidden-launcher widget leaves it non-interactive until the product cal
186
186
 
187
187
  ## Attachments
188
188
 
189
- The composer is opt-in. Enable it with one option; without a transport it uses a
190
- local mock for visual QA and staged integration. The mock supports image previews,
191
- document cards, retry UI and downloads, but is never durable storage.
189
+ Attachment support is enabled by default and uses Lola Backend's
190
+ quarantine-and-scan pipeline. The picker and drag-and-drop target appear only when
191
+ the current server-authoritative responder presentation is `CURRENT` and human
192
+ support is `ASSIGNED`; they stay unavailable before a current human-support
193
+ assignment exists, including `NONE` and `ROUTING`. If that assignment is released
194
+ after a file was selected, the draft remains removable but is not sent while the
195
+ assignment is absent. The SDK sends only attachments that reach `READY`; uploaded
196
+ bytes never become durable message URLs. Set `attachments.enabled` to `false` only
197
+ when embedding against a legacy backend.
192
198
 
193
199
  ```ts
194
200
  const widget = new ChatWidgetInstance({
195
201
  customerInteractionSession: session,
196
- attachments: { enabled: true },
202
+ // Optional: attachments: { enabled: false },
197
203
  });
198
204
  ```
199
205
 
200
- For production, pass the signed-upload adapter owned by the product/backend. It
201
- returns a permanent attachment id and download URL. Enable `sendAttachmentIds`
202
- when the receiving endpoint has been rolled out; the SDK then includes the returned
203
- ids in the next message command and renders attachments from history and realtime
204
- frames.
206
+ The default adapter hashes the file, creates an upload intent, streams the bytes to
207
+ the presigned storage URL with progress, completes the upload, and waits for the
208
+ malware scan. Download and image/PDF preview grants are fetched only when the user
209
+ asks for them. Signed URLs are never retained in chat history.
210
+
211
+ For controlled demos or tests, a custom transport can replace that adapter. READY
212
+ attachment ids are sent by default; `sendAttachmentIds: false` is a temporary
213
+ legacy-backend escape hatch.
205
214
 
206
215
  ```ts
207
216
  attachments: {
208
217
  enabled: true,
209
- sendAttachmentIds: true, // enable once the receiving chat endpoint accepts them
218
+ sendAttachmentIds: true,
210
219
  transport: {
211
- upload: async ({ file, onProgress, signal }) => {
220
+ upload: async ({ file, conversationId, onProgress, onStage, signal }) => {
212
221
  // Create an upload session, PUT the file, then complete it.
213
- // Return { id, fileName, mediaType, size, kind, downloadUrl, previewUrl }.
222
+ // Return durable metadata: { id, fileName, mediaType, size, kind }.
214
223
  },
224
+ grant: async ({ attachmentId, conversationId }) => ({ url, expiresAt }),
225
+ revoke: async ({ attachmentId, conversationId }) => {},
215
226
  },
216
227
  }
217
228
  ```
@@ -1,4 +1,4 @@
1
- import { a0 as $s } from "./index-BBsPIKJB.js";
1
+ import { a1 as $s } from "./index-DMOAaoVj.js";
2
2
  var Fr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
3
3
  const Ul = "182", Hf = 0, bc = 1, Wf = 2, js = 1, Ku = 2, Gr = 3, di = 0, jt = 1, Zn = 2, $n = 0, ur = 1, Ac = 2, Ec = 3, wc = 4, Xf = 5, Ci = 100, qf = 101, Yf = 102, Kf = 103, Zf = 104, $f = 200, jf = 201, Jf = 202, Qf = 203, wo = 204, Ro = 205, ed = 206, td = 207, nd = 208, id = 209, rd = 210, sd = 211, ad = 212, od = 213, ld = 214, Co = 0, Po = 1, Io = 2, dr = 3, Do = 4, Lo = 5, Fo = 6, Uo = 7, xa = 0, cd = 1, ud = 2, Un = 0, Zu = 1, $u = 2, ju = 3, Ju = 4, Qu = 5, eh = 6, th = 7, Rc = "attached", hd = "detached", nh = 300, Oi = 301, pr = 302, aa = 303, No = 304, ya = 306, wt = 1e3, En = 1001, Oo = 1002, Lt = 1003, fd = 1004, Ss = 1005, kt = 1006, La = 1007, Ii = 1008, sn = 1009, ih = 1010, rh = 1011, ts = 1012, Nl = 1013, Bn = 1014, wn = 1015, Jn = 1016, Ol = 1017, Bl = 1018, ns = 1020, sh = 35902, ah = 35899, oh = 1021, lh = 1022, mn = 1023, Qn = 1026, Di = 1027, ch = 1028, kl = 1029, mr = 1030, Vl = 1031, zl = 1033, Js = 33776, Qs = 33777, ea = 33778, ta = 33779, Bo = 35840, ko = 35841, Vo = 35842, zo = 35843, Go = 36196, Ho = 37492, Wo = 37496, Xo = 37488, qo = 37489, Yo = 37490, Ko = 37491, Zo = 37808, $o = 37809, jo = 37810, Jo = 37811, Qo = 37812, el = 37813, tl = 37814, nl = 37815, il = 37816, rl = 37817, sl = 37818, al = 37819, ol = 37820, ll = 37821, cl = 36492, ul = 36494, hl = 36495, fl = 36283, dl = 36284, pl = 36285, ml = 36286, uh = 2200, dd = 2201, pd = 2202, oa = 2300, _l = 2301, Fa = 2302, sr = 2400, ar = 2401, la = 2402, Gl = 2500, md = 2501, _d = 3200, Sa = 0, gd = 1, ci = "", Ue = "srgb", _r = "srgb-linear", ca = "linear", nt = "srgb", Gi = 7680, Cc = 519, vd = 512, xd = 513, yd = 514, Hl = 515, Sd = 516, Md = 517, Wl = 518, Td = 519, Pc = 35044, Ic = "300 es", Fn = 2e3, ua = 2001;
4
4
  function hh(s) {