@helpai/elements 0.52.6 → 0.54.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/configurator.mjs +2 -2
- package/elements-web-component.esm.js +29 -29
- package/elements-web-component.esm.js.map +4 -4
- package/elements.cjs.js +28 -28
- package/elements.cjs.js.map +4 -4
- package/elements.esm.js +28 -28
- package/elements.esm.js.map +4 -4
- package/elements.js +27 -27
- package/elements.js.map +4 -4
- package/index.d.ts +4 -4
- package/index.mjs +326 -268
- package/package.json +1 -1
- package/schema.d.ts +1 -1
- package/schema.json +4 -4
- package/schema.mjs +2 -2
- package/web-component.mjs +326 -268
package/index.mjs
CHANGED
|
@@ -29,7 +29,7 @@ var BRAND = {
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
// src/core/version.ts
|
|
32
|
-
var ELEMENTS_VERSION = true ? "0.
|
|
32
|
+
var ELEMENTS_VERSION = true ? "0.54.0" : "0.0.0-dev";
|
|
33
33
|
var ELEMENTS_VERSION_PARAM = "_ev";
|
|
34
34
|
|
|
35
35
|
// src/i18n/strings.ts
|
|
@@ -116,7 +116,7 @@ var STRINGS_EN = {
|
|
|
116
116
|
newsLoading: "Loading news\u2026",
|
|
117
117
|
newsBack: "Back to news",
|
|
118
118
|
newsPublishedAt: "Published {date}",
|
|
119
|
-
// ── Forms + human-in-the-loop (forms / ask-
|
|
119
|
+
// ── Forms + human-in-the-loop (forms / ask-questions / approval) ────
|
|
120
120
|
formSubmit: "Submit",
|
|
121
121
|
formSkip: "Maybe later",
|
|
122
122
|
formSubmitted: "Completed",
|
|
@@ -136,26 +136,15 @@ var STRINGS_EN = {
|
|
|
136
136
|
formChooseAtMost: "Choose at most {max}",
|
|
137
137
|
formOther: "Other",
|
|
138
138
|
formOtherPlaceholder: "Type your answer\u2026",
|
|
139
|
-
inputRequired: "
|
|
140
|
-
inputBadge: "
|
|
139
|
+
inputRequired: "Questions for you",
|
|
140
|
+
inputBadge: "Questions",
|
|
141
141
|
inputAnswered: "Answered",
|
|
142
142
|
inputSkipped: "Skipped",
|
|
143
|
-
|
|
144
|
-
inputYourAnswer: "Your answer",
|
|
145
|
-
inputSubmit: "Submit answer",
|
|
143
|
+
inputSubmit: "Submit answers",
|
|
146
144
|
inputSubmitHint: "Enter to send \xB7 Shift+Enter = new line",
|
|
147
|
-
inputAnswerPlaceholder: "Type your answer\u2026",
|
|
148
145
|
inputSkip: "Skip",
|
|
149
146
|
confirmYes: "Yes",
|
|
150
147
|
confirmNo: "No",
|
|
151
|
-
inputConfirmHint: "Choose yes or no.",
|
|
152
|
-
inputOptionalNote: "Optional note",
|
|
153
|
-
inputOptionalNotePlaceholder: "Optional comment\u2026",
|
|
154
|
-
inputSubmitted: "Answer submitted",
|
|
155
|
-
respFreeText: "Free Text",
|
|
156
|
-
respSingleChoice: "Single Choice",
|
|
157
|
-
respMultiChoice: "Multiple Choice",
|
|
158
|
-
respConfirmation: "Confirmation",
|
|
159
148
|
approvalRequired: "Approval required",
|
|
160
149
|
approve: "Approve",
|
|
161
150
|
reject: "Reject",
|
|
@@ -260,7 +249,7 @@ var STRINGS_FR = {
|
|
|
260
249
|
newsLoading: "Chargement des actualit\xE9s\u2026",
|
|
261
250
|
newsBack: "Retour aux actualit\xE9s",
|
|
262
251
|
newsPublishedAt: "Publi\xE9 le {date}",
|
|
263
|
-
// ── Forms + human-in-the-loop (forms / ask-
|
|
252
|
+
// ── Forms + human-in-the-loop (forms / ask-questions / approval) ────
|
|
264
253
|
formSubmit: "Envoyer",
|
|
265
254
|
formSkip: "Plus tard",
|
|
266
255
|
formSubmitted: "Termin\xE9",
|
|
@@ -280,26 +269,15 @@ var STRINGS_FR = {
|
|
|
280
269
|
formChooseAtMost: "Choisissez au plus {max}",
|
|
281
270
|
formOther: "Autre",
|
|
282
271
|
formOtherPlaceholder: "Saisissez votre r\xE9ponse\u2026",
|
|
283
|
-
inputRequired: "
|
|
284
|
-
inputBadge: "
|
|
272
|
+
inputRequired: "Questions pour vous",
|
|
273
|
+
inputBadge: "Questions",
|
|
285
274
|
inputAnswered: "R\xE9pondu",
|
|
286
275
|
inputSkipped: "Ignor\xE9",
|
|
287
|
-
|
|
288
|
-
inputYourAnswer: "Votre r\xE9ponse",
|
|
289
|
-
inputSubmit: "Envoyer la r\xE9ponse",
|
|
276
|
+
inputSubmit: "Envoyer les r\xE9ponses",
|
|
290
277
|
inputSubmitHint: "Entr\xE9e pour envoyer \xB7 Maj+Entr\xE9e = saut de ligne",
|
|
291
|
-
inputAnswerPlaceholder: "Saisissez votre r\xE9ponse\u2026",
|
|
292
278
|
inputSkip: "Ignorer",
|
|
293
279
|
confirmYes: "Oui",
|
|
294
280
|
confirmNo: "Non",
|
|
295
|
-
inputConfirmHint: "Choisissez oui ou non.",
|
|
296
|
-
inputOptionalNote: "Note facultative",
|
|
297
|
-
inputOptionalNotePlaceholder: "Commentaire facultatif\u2026",
|
|
298
|
-
inputSubmitted: "R\xE9ponse envoy\xE9e",
|
|
299
|
-
respFreeText: "Texte libre",
|
|
300
|
-
respSingleChoice: "Choix unique",
|
|
301
|
-
respMultiChoice: "Choix multiple",
|
|
302
|
-
respConfirmation: "Confirmation",
|
|
303
281
|
approvalRequired: "Approbation requise",
|
|
304
282
|
approve: "Approuver",
|
|
305
283
|
reject: "Refuser",
|
|
@@ -404,7 +382,7 @@ var STRINGS_AR = {
|
|
|
404
382
|
newsLoading: "\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0623\u062E\u0628\u0627\u0631\u2026",
|
|
405
383
|
newsBack: "\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u0623\u062E\u0628\u0627\u0631",
|
|
406
384
|
newsPublishedAt: "\u0646\u064F\u0634\u0631 \u0641\u064A {date}",
|
|
407
|
-
// ── Forms + human-in-the-loop (forms / ask-
|
|
385
|
+
// ── Forms + human-in-the-loop (forms / ask-questions / approval) ────
|
|
408
386
|
formSubmit: "\u0625\u0631\u0633\u0627\u0644",
|
|
409
387
|
formSkip: "\u0644\u0627\u062D\u0642\u064B\u0627",
|
|
410
388
|
formSubmitted: "\u062A\u0645",
|
|
@@ -424,26 +402,15 @@ var STRINGS_AR = {
|
|
|
424
402
|
formChooseAtMost: "\u0627\u062E\u062A\u0631 {max} \u0639\u0644\u0649 \u0627\u0644\u0623\u0643\u062B\u0631",
|
|
425
403
|
formOther: "\u0623\u062E\u0631\u0649",
|
|
426
404
|
formOtherPlaceholder: "\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",
|
|
427
|
-
inputRequired: "\
|
|
428
|
-
inputBadge: "\
|
|
405
|
+
inputRequired: "\u0623\u0633\u0626\u0644\u0629 \u0644\u0643",
|
|
406
|
+
inputBadge: "\u0623\u0633\u0626\u0644\u0629",
|
|
429
407
|
inputAnswered: "\u062A\u0645\u062A \u0627\u0644\u0625\u062C\u0627\u0628\u0629",
|
|
430
408
|
inputSkipped: "\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A",
|
|
431
|
-
|
|
432
|
-
inputYourAnswer: "\u0625\u062C\u0627\u0628\u062A\u0643",
|
|
433
|
-
inputSubmit: "\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0629",
|
|
409
|
+
inputSubmit: "\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A",
|
|
434
410
|
inputSubmitHint: "Enter \u0644\u0644\u0625\u0631\u0633\u0627\u0644 \xB7 Shift+Enter = \u0633\u0637\u0631 \u062C\u062F\u064A\u062F",
|
|
435
|
-
inputAnswerPlaceholder: "\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",
|
|
436
411
|
inputSkip: "\u062A\u062E\u0637\u064D\u0651",
|
|
437
412
|
confirmYes: "\u0646\u0639\u0645",
|
|
438
413
|
confirmNo: "\u0644\u0627",
|
|
439
|
-
inputConfirmHint: "\u0627\u062E\u062A\u0631 \u0646\u0639\u0645 \u0623\u0648 \u0644\u0627.",
|
|
440
|
-
inputOptionalNote: "\u0645\u0644\u0627\u062D\u0638\u0629 \u0627\u062E\u062A\u064A\u0627\u0631\u064A\u0629",
|
|
441
|
-
inputOptionalNotePlaceholder: "\u062A\u0639\u0644\u064A\u0642 \u0627\u062E\u062A\u064A\u0627\u0631\u064A\u2026",
|
|
442
|
-
inputSubmitted: "\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0629",
|
|
443
|
-
respFreeText: "\u0646\u0635 \u062D\u0631",
|
|
444
|
-
respSingleChoice: "\u0627\u062E\u062A\u064A\u0627\u0631 \u0648\u0627\u062D\u062F",
|
|
445
|
-
respMultiChoice: "\u0627\u062E\u062A\u064A\u0627\u0631 \u0645\u062A\u0639\u062F\u062F",
|
|
446
|
-
respConfirmation: "\u062A\u0623\u0643\u064A\u062F",
|
|
447
414
|
approvalRequired: "\u0645\u0637\u0644\u0648\u0628 \u0645\u0648\u0627\u0641\u0642\u0629",
|
|
448
415
|
approve: "\u0645\u0648\u0627\u0641\u0642\u0629",
|
|
449
416
|
reject: "\u0631\u0641\u0636",
|
|
@@ -548,7 +515,7 @@ var STRINGS_ES = {
|
|
|
548
515
|
newsLoading: "Cargando novedades\u2026",
|
|
549
516
|
newsBack: "Volver a novedades",
|
|
550
517
|
newsPublishedAt: "Publicado el {date}",
|
|
551
|
-
// ── Forms + human-in-the-loop (forms / ask-
|
|
518
|
+
// ── Forms + human-in-the-loop (forms / ask-questions / approval) ────
|
|
552
519
|
formSubmit: "Enviar",
|
|
553
520
|
formSkip: "Quiz\xE1 m\xE1s tarde",
|
|
554
521
|
formSubmitted: "Completado",
|
|
@@ -568,26 +535,15 @@ var STRINGS_ES = {
|
|
|
568
535
|
formChooseAtMost: "Elige como m\xE1ximo {max}",
|
|
569
536
|
formOther: "Otro",
|
|
570
537
|
formOtherPlaceholder: "Escribe tu respuesta\u2026",
|
|
571
|
-
inputRequired: "
|
|
572
|
-
inputBadge: "
|
|
538
|
+
inputRequired: "Preguntas para ti",
|
|
539
|
+
inputBadge: "Preguntas",
|
|
573
540
|
inputAnswered: "Respondido",
|
|
574
541
|
inputSkipped: "Omitido",
|
|
575
|
-
|
|
576
|
-
inputYourAnswer: "Tu respuesta",
|
|
577
|
-
inputSubmit: "Enviar respuesta",
|
|
542
|
+
inputSubmit: "Enviar respuestas",
|
|
578
543
|
inputSubmitHint: "Enter para enviar \xB7 May\xFAs+Enter = nueva l\xEDnea",
|
|
579
|
-
inputAnswerPlaceholder: "Escribe tu respuesta\u2026",
|
|
580
544
|
inputSkip: "Omitir",
|
|
581
545
|
confirmYes: "S\xED",
|
|
582
546
|
confirmNo: "No",
|
|
583
|
-
inputConfirmHint: "Elige s\xED o no.",
|
|
584
|
-
inputOptionalNote: "Nota opcional",
|
|
585
|
-
inputOptionalNotePlaceholder: "Comentario opcional\u2026",
|
|
586
|
-
inputSubmitted: "Respuesta enviada",
|
|
587
|
-
respFreeText: "Texto libre",
|
|
588
|
-
respSingleChoice: "Opci\xF3n \xFAnica",
|
|
589
|
-
respMultiChoice: "Opci\xF3n m\xFAltiple",
|
|
590
|
-
respConfirmation: "Confirmaci\xF3n",
|
|
591
547
|
approvalRequired: "Aprobaci\xF3n requerida",
|
|
592
548
|
approve: "Aprobar",
|
|
593
549
|
reject: "Rechazar",
|
|
@@ -609,11 +565,145 @@ var STRINGS_ES = {
|
|
|
609
565
|
statusError: "Error",
|
|
610
566
|
statusSuperseded: "Omitido"
|
|
611
567
|
};
|
|
568
|
+
var STRINGS_HE = {
|
|
569
|
+
attach: "\u05E6\u05D9\u05E8\u05D5\u05E3 \u05E7\u05D1\u05E6\u05D9\u05DD",
|
|
570
|
+
attachmentMimeRejected: "\u05E1\u05D5\u05D2 \u05D4\u05E7\u05D5\u05D1\u05E5 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA",
|
|
571
|
+
attachmentTooLarge: "\u05D4\u05E7\u05D5\u05D1\u05E5 \u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9",
|
|
572
|
+
attachmentTooMany: "\u05D4\u05D2\u05E2\u05EA \u05DC\u05DE\u05E1\u05E4\u05E8 \u05D4\u05DE\u05E8\u05D1\u05D9 \u05E9\u05DC \u05E7\u05D1\u05E6\u05D9\u05DD \u05DE\u05E6\u05D5\u05E8\u05E4\u05D9\u05DD",
|
|
573
|
+
conversationClosed: "\u05D4\u05E9\u05D9\u05D7\u05D4 \u05D4\u05D6\u05D5 \u05E0\u05E1\u05D2\u05E8\u05D4",
|
|
574
|
+
conversationLoading: "\u05D8\u05D5\u05E2\u05DF \u05E9\u05D9\u05D7\u05D4\u2026",
|
|
575
|
+
close: "\u05E1\u05D2\u05D9\u05E8\u05D4",
|
|
576
|
+
collapse: "\u05DB\u05D9\u05D5\u05D5\u05E5",
|
|
577
|
+
collapseSidebar: "\u05DB\u05D9\u05D5\u05D5\u05E5 \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",
|
|
578
|
+
composerPlaceholder: "\u05DB\u05EA\u05D5\u05D1 \u05D4\u05D5\u05D3\u05E2\u05D4\u2026",
|
|
579
|
+
dateLastWeek: "7 \u05D4\u05D9\u05DE\u05D9\u05DD \u05D4\u05D0\u05D7\u05E8\u05D5\u05E0\u05D9\u05DD",
|
|
580
|
+
dateOlder: "\u05D9\u05E9\u05DF \u05D9\u05D5\u05EA\u05E8",
|
|
581
|
+
dateToday: "\u05D4\u05D9\u05D5\u05DD",
|
|
582
|
+
dateYesterday: "\u05D0\u05EA\u05DE\u05D5\u05DC",
|
|
583
|
+
dropZone: "\u05E9\u05D7\u05E8\u05E8 \u05E7\u05D1\u05E6\u05D9\u05DD \u05DB\u05D3\u05D9 \u05DC\u05E6\u05E8\u05E3",
|
|
584
|
+
errorGeneric: "\u05DE\u05E9\u05D4\u05D5 \u05D4\u05E9\u05EA\u05D1\u05E9",
|
|
585
|
+
errorRateLimited: "\u05D9\u05D5\u05EA\u05E8 \u05DE\u05D3\u05D9 \u05D1\u05E7\u05E9\u05D5\u05EA \u2014 \u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1 \u05D1\u05E2\u05D5\u05D3 \u05E8\u05D2\u05E2.",
|
|
586
|
+
errorRetry: "\u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1",
|
|
587
|
+
expand: "\u05D4\u05E8\u05D7\u05D1\u05D4",
|
|
588
|
+
expandSidebar: "\u05D4\u05E8\u05D7\u05D1\u05EA \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",
|
|
589
|
+
exitFullscreen: "\u05D9\u05E6\u05D9\u05D0\u05D4 \u05DE\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",
|
|
590
|
+
fullscreen: "\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",
|
|
591
|
+
history: "\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D4",
|
|
592
|
+
historyBack: "\u05D7\u05D6\u05E8\u05D4 \u05DC\u05E9\u05D9\u05D7\u05D4",
|
|
593
|
+
historyEmpty: "\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05E9\u05D9\u05D7\u05D5\u05EA \u05E7\u05D5\u05D3\u05DE\u05D5\u05EA",
|
|
594
|
+
historyContinue: "\u05D4\u05DE\u05E9\u05DA \u05E9\u05D9\u05D7\u05D4",
|
|
595
|
+
historyLoading: "\u05D8\u05D5\u05E2\u05DF \u05D0\u05EA \u05D4\u05E9\u05D9\u05D7\u05D5\u05EA \u05E9\u05DC\u05DA\u2026",
|
|
596
|
+
historyTitle: "\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D9\u05EA \u05E9\u05D9\u05D7\u05D5\u05EA",
|
|
597
|
+
language: "\u05E9\u05E4\u05D4",
|
|
598
|
+
launcherOpen: "\u05E4\u05EA\u05D9\u05D7\u05EA \u05E6\u05F3\u05D0\u05D8",
|
|
599
|
+
launcherLabel: "\u05D3\u05D1\u05E8\u05D5 \u05D0\u05D9\u05EA\u05E0\u05D5",
|
|
600
|
+
micStart: "\u05D4\u05EA\u05D7\u05DC\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",
|
|
601
|
+
micStop: "\u05E2\u05E6\u05D9\u05E8\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",
|
|
602
|
+
micUnsupported: "\u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA \u05D1\u05D3\u05E4\u05D3\u05E4\u05DF \u05D6\u05D4",
|
|
603
|
+
moreActions: "\u05E4\u05E2\u05D5\u05DC\u05D5\u05EA \u05E0\u05D5\u05E1\u05E4\u05D5\u05EA",
|
|
604
|
+
newConversation: "\u05E9\u05D9\u05D7\u05D4 \u05D7\u05D3\u05E9\u05D4",
|
|
605
|
+
panelTitle: "\u05E9\u05D9\u05D7\u05D4",
|
|
606
|
+
resizeHandle: "\u05D2\u05E8\u05D5\u05E8 \u05DC\u05E9\u05D9\u05E0\u05D5\u05D9 \u05D4\u05D2\u05D5\u05D3\u05DC",
|
|
607
|
+
scrollToBottom: "\u05DE\u05E2\u05D1\u05E8 \u05DC\u05D7\u05D3\u05E9 \u05D1\u05D9\u05D5\u05EA\u05E8",
|
|
608
|
+
send: "\u05E9\u05DC\u05D9\u05D7\u05D4",
|
|
609
|
+
soundOff: "\u05D4\u05E9\u05EA\u05E7\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",
|
|
610
|
+
soundOn: "\u05D4\u05E4\u05E2\u05DC\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",
|
|
611
|
+
startNewConversation: "\u05D4\u05EA\u05D7\u05DC\u05EA \u05E9\u05D9\u05D7\u05D4 \u05D7\u05D3\u05E9\u05D4",
|
|
612
|
+
stop: "\u05E2\u05E6\u05D9\u05E8\u05D4",
|
|
613
|
+
theme: "\u05E2\u05E8\u05DB\u05EA \u05E0\u05D5\u05E9\u05D0",
|
|
614
|
+
themeAuto: "\u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9",
|
|
615
|
+
themeDark: "\u05DB\u05D4\u05D4",
|
|
616
|
+
themeLight: "\u05D1\u05D4\u05D9\u05E8",
|
|
617
|
+
textSize: "\u05D2\u05D5\u05D3\u05DC \u05D8\u05E7\u05E1\u05D8",
|
|
618
|
+
textSizeSmall: "\u05E7\u05D8\u05DF",
|
|
619
|
+
textSizeNormal: "\u05E8\u05D2\u05D9\u05DC",
|
|
620
|
+
textSizeLarge: "\u05D2\u05D3\u05D5\u05DC",
|
|
621
|
+
loading: "\u05D8\u05D5\u05E2\u05DF\u2026",
|
|
622
|
+
thinking: "\u05D7\u05D5\u05E9\u05D1\u2026",
|
|
623
|
+
thoughts: "\u05DE\u05D7\u05E9\u05D1\u05D5\u05EA",
|
|
624
|
+
usedTool: "\u05DB\u05DC\u05D9 \u05D1\u05E9\u05D9\u05DE\u05D5\u05E9",
|
|
625
|
+
toolResult: "\u05EA\u05D5\u05E6\u05D0\u05D4",
|
|
626
|
+
sources: "\u05DE\u05E7\u05D5\u05E8\u05D5\u05EA",
|
|
627
|
+
// ── Messenger modules ──────────────────────────────────────────
|
|
628
|
+
tabHome: "\u05D1\u05D9\u05EA",
|
|
629
|
+
tabConversations: "\u05E9\u05D9\u05D7\u05D5\u05EA",
|
|
630
|
+
tabHelp: "\u05E2\u05D6\u05E8\u05D4",
|
|
631
|
+
tabNews: "\u05D7\u05D3\u05E9\u05D5\u05EA",
|
|
632
|
+
modulesEmpty: "\u05D0\u05D9\u05DF \u05DB\u05D0\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DB\u05DC\u05D5\u05DD",
|
|
633
|
+
moduleBack: "\u05D7\u05D6\u05E8\u05D4",
|
|
634
|
+
contentLoading: "\u05D8\u05D5\u05E2\u05DF\u2026",
|
|
635
|
+
homeGreeting: "\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",
|
|
636
|
+
homeGreetingNamed: "\u05E9\u05DC\u05D5\u05DD {name} \u{1F44B}",
|
|
637
|
+
homeGreetingLead: "\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",
|
|
638
|
+
homeSearchPlaceholder: "\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",
|
|
639
|
+
homeContentTitle: "\u05DE\u05D0\u05DE\u05E8\u05D9\u05DD \u05E4\u05D5\u05E4\u05D5\u05DC\u05E8\u05D9\u05D9\u05DD",
|
|
640
|
+
homeStatus: "\u05E1\u05D8\u05D8\u05D5\u05E1",
|
|
641
|
+
helpTitle: "\u05E2\u05D6\u05E8\u05D4",
|
|
642
|
+
helpSearchPlaceholder: "\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",
|
|
643
|
+
helpEmpty: "\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DE\u05D0\u05DE\u05E8\u05D9 \u05E2\u05D6\u05E8\u05D4",
|
|
644
|
+
helpLoading: "\u05D8\u05D5\u05E2\u05DF \u05E2\u05D6\u05E8\u05D4\u2026",
|
|
645
|
+
helpSearchEmpty: "\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D5 \u05EA\u05D5\u05E6\u05D0\u05D5\u05EA",
|
|
646
|
+
newsTitle: "\u05D7\u05D3\u05E9\u05D5\u05EA",
|
|
647
|
+
newsEmpty: "\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA",
|
|
648
|
+
newsLoading: "\u05D8\u05D5\u05E2\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA\u2026",
|
|
649
|
+
newsBack: "\u05D7\u05D6\u05E8\u05D4 \u05DC\u05D7\u05D3\u05E9\u05D5\u05EA",
|
|
650
|
+
newsPublishedAt: "\u05E4\u05D5\u05E8\u05E1\u05DD \u05D1-{date}",
|
|
651
|
+
// ── Forms + human-in-the-loop (forms / ask-questions / approval) ────
|
|
652
|
+
formSubmit: "\u05E9\u05DC\u05D9\u05D7\u05D4",
|
|
653
|
+
formSkip: "\u05D0\u05D7\u05E8 \u05DB\u05DA",
|
|
654
|
+
formSubmitted: "\u05E0\u05E9\u05DC\u05D7",
|
|
655
|
+
formSkipped: "\u05D3\u05D5\u05DC\u05D2",
|
|
656
|
+
formFillOut: "\u05DE\u05D9\u05DC\u05D5\u05D9",
|
|
657
|
+
formRequired: "\u05E9\u05D3\u05D4 \u05D7\u05D5\u05D1\u05D4",
|
|
658
|
+
formInvalidEmail: "\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC \u05EA\u05E7\u05D9\u05E0\u05D4",
|
|
659
|
+
formInvalidTel: "\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF \u05EA\u05E7\u05D9\u05DF",
|
|
660
|
+
formInvalidUrl: "\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA URL \u05EA\u05E7\u05D9\u05E0\u05D4",
|
|
661
|
+
formInvalidNumber: "\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05EA\u05E7\u05D9\u05DF",
|
|
662
|
+
formTooShort: "\u05E7\u05E6\u05E8 \u05DE\u05D3\u05D9 (\u05DC\u05E4\u05D7\u05D5\u05EA {min} \u05EA\u05D5\u05D5\u05D9\u05DD)",
|
|
663
|
+
formTooLong: "\u05D0\u05E8\u05D5\u05DA \u05DE\u05D3\u05D9 (\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max} \u05EA\u05D5\u05D5\u05D9\u05DD)",
|
|
664
|
+
formNumberTooSmall: "\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05E4\u05D7\u05D5\u05EA {min}",
|
|
665
|
+
formNumberTooLarge: "\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",
|
|
666
|
+
formPatternMismatch: "\u05D4\u05EA\u05D0\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA \u05D4\u05E0\u05D3\u05E8\u05E9\u05EA",
|
|
667
|
+
formChooseAtLeast: "\u05D1\u05D7\u05E8 \u05DC\u05E4\u05D7\u05D5\u05EA {min}",
|
|
668
|
+
formChooseAtMost: "\u05D1\u05D7\u05E8 \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",
|
|
669
|
+
formOther: "\u05D0\u05D7\u05E8",
|
|
670
|
+
formOtherPlaceholder: "\u05DB\u05EA\u05D5\u05D1 \u05D0\u05EA \u05EA\u05E9\u05D5\u05D1\u05EA\u05DA\u2026",
|
|
671
|
+
inputRequired: "\u05E9\u05D0\u05DC\u05D5\u05EA \u05E2\u05D1\u05D5\u05E8\u05DA",
|
|
672
|
+
inputBadge: "\u05E9\u05D0\u05DC\u05D5\u05EA",
|
|
673
|
+
inputAnswered: "\u05E0\u05E2\u05E0\u05D4",
|
|
674
|
+
inputSkipped: "\u05D3\u05D5\u05DC\u05D2",
|
|
675
|
+
inputSubmit: "\u05E9\u05DC\u05D9\u05D7\u05EA \u05EA\u05E9\u05D5\u05D1\u05D5\u05EA",
|
|
676
|
+
inputSubmitHint: "Enter \u05DC\u05E9\u05DC\u05D9\u05D7\u05D4 \xB7 Shift+Enter = \u05E9\u05D5\u05E8\u05D4 \u05D7\u05D3\u05E9\u05D4",
|
|
677
|
+
inputSkip: "\u05D3\u05D9\u05DC\u05D5\u05D2",
|
|
678
|
+
confirmYes: "\u05DB\u05DF",
|
|
679
|
+
confirmNo: "\u05DC\u05D0",
|
|
680
|
+
approvalRequired: "\u05E0\u05D3\u05E8\u05E9 \u05D0\u05D9\u05E9\u05D5\u05E8",
|
|
681
|
+
approve: "\u05D0\u05D9\u05E9\u05D5\u05E8",
|
|
682
|
+
reject: "\u05D3\u05D7\u05D9\u05D9\u05D4",
|
|
683
|
+
approved: "\u05D0\u05D5\u05E9\u05E8",
|
|
684
|
+
rejected: "\u05E0\u05D3\u05D7\u05D4",
|
|
685
|
+
approvalReason: "\u05D4\u05D5\u05E1\u05E3 \u05E1\u05D9\u05D1\u05D4 (\u05D0\u05D5\u05E4\u05E6\u05D9\u05D5\u05E0\u05DC\u05D9)",
|
|
686
|
+
approvalPrompt: "\u05D4\u05DB\u05DC\u05D9 {tool} \u05D3\u05D5\u05E8\u05E9 \u05D0\u05EA \u05D0\u05D9\u05E9\u05D5\u05E8\u05DA \u05DB\u05D3\u05D9 \u05DC\u05E4\u05E2\u05D5\u05DC.",
|
|
687
|
+
approvalBody: "\u05D1\u05D3\u05D5\u05E7 \u05D0\u05EA \u05E4\u05E8\u05DE\u05D8\u05E8\u05D9 \u05D4\u05DB\u05DC\u05D9 \u05E9\u05DC\u05DE\u05E2\u05DC\u05D4 \u05D5\u05D4\u05D7\u05DC\u05D8 \u05D0\u05DD \u05DC\u05D0\u05E9\u05E8 \u05E4\u05E2\u05D5\u05DC\u05D4 \u05D6\u05D5.",
|
|
688
|
+
approvalYourResponse: "\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA: {decision}",
|
|
689
|
+
approvalEditHint: "\u05E0\u05D9\u05EA\u05DF \u05DC\u05E2\u05E8\u05D5\u05DA \u05D0\u05EA \u05EA\u05D2\u05D5\u05D1\u05EA\u05DA \u05E2\u05D3 \u05E9\u05D4\u05E9\u05DC\u05D1 \u05D4\u05D6\u05D4 \u05D9\u05EA\u05D7\u05D3\u05E9.",
|
|
690
|
+
approvalSubmitting: "\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E0\u05E9\u05DC\u05D7\u05D4. \u05DE\u05D1\u05E6\u05E2\u2026",
|
|
691
|
+
edit: "\u05E2\u05E8\u05D9\u05DB\u05D4",
|
|
692
|
+
toolParameters: "\u05E4\u05E8\u05DE\u05D8\u05E8\u05D9\u05DD",
|
|
693
|
+
statusAwaiting: "\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8",
|
|
694
|
+
statusResponded: "\u05E0\u05E2\u05E0\u05D4",
|
|
695
|
+
statusRunning: "\u05E4\u05D5\u05E2\u05DC",
|
|
696
|
+
statusCompleted: "\u05D4\u05D5\u05E9\u05DC\u05DD",
|
|
697
|
+
statusDenied: "\u05E0\u05D3\u05D7\u05D4",
|
|
698
|
+
statusError: "\u05E9\u05D2\u05D9\u05D0\u05D4",
|
|
699
|
+
statusSuperseded: "\u05D3\u05D5\u05DC\u05D2"
|
|
700
|
+
};
|
|
612
701
|
var BUILTIN_STRINGS = {
|
|
613
702
|
en: STRINGS_EN,
|
|
614
703
|
fr: STRINGS_FR,
|
|
615
704
|
ar: STRINGS_AR,
|
|
616
|
-
es: STRINGS_ES
|
|
705
|
+
es: STRINGS_ES,
|
|
706
|
+
he: STRINGS_HE
|
|
617
707
|
};
|
|
618
708
|
function resolveStrings(locale, override) {
|
|
619
709
|
const tag = primaryTag(locale);
|
|
@@ -1767,7 +1857,7 @@ var EventBus = class {
|
|
|
1767
1857
|
import { h, render as renderPreact } from "preact";
|
|
1768
1858
|
|
|
1769
1859
|
// src/ui/app.tsx
|
|
1770
|
-
import { useCallback as useCallback6, useEffect as useEffect16, useLayoutEffect as useLayoutEffect3, useMemo as useMemo3, useRef as useRef9, useState as
|
|
1860
|
+
import { useCallback as useCallback6, useEffect as useEffect16, useLayoutEffect as useLayoutEffect3, useMemo as useMemo3, useRef as useRef9, useState as useState13 } from "preact/hooks";
|
|
1771
1861
|
import { batch, useComputed as useComputed8, useSignal } from "@preact/signals";
|
|
1772
1862
|
|
|
1773
1863
|
// src/core/handshake-shape.ts
|
|
@@ -3674,7 +3764,7 @@ var TID = {
|
|
|
3674
3764
|
helpArticle: `${p2}-help-article`,
|
|
3675
3765
|
/** News list item — suffix `-{id}`. */
|
|
3676
3766
|
newsItem: `${p2}-news-item`,
|
|
3677
|
-
// ── Forms + human-in-the-loop (forms / ask-
|
|
3767
|
+
// ── Forms + human-in-the-loop (forms / ask-questions / approval) ─────
|
|
3678
3768
|
/** Form gate root — a timeline row that locks the chat while open. */
|
|
3679
3769
|
formGate: `${p2}-form-gate`,
|
|
3680
3770
|
/** "Form submitted / skipped" marker row (wire-reconstructed on resume). */
|
|
@@ -3691,11 +3781,11 @@ var TID = {
|
|
|
3691
3781
|
formSkip: `${p2}-form-skip`,
|
|
3692
3782
|
/** A single form field control — suffix `-{name}` at the JSX site. */
|
|
3693
3783
|
formField: `${p2}-form-field`,
|
|
3694
|
-
/** Ask-
|
|
3695
|
-
|
|
3696
|
-
/** Ask-
|
|
3784
|
+
/** Ask-questions tool root (inline form in a message bubble). */
|
|
3785
|
+
toolAskQuestions: `${p2}-tool-ask-questions`,
|
|
3786
|
+
/** Ask-questions submit button. */
|
|
3697
3787
|
toolInputSubmit: `${p2}-tool-input-submit`,
|
|
3698
|
-
/** Ask-
|
|
3788
|
+
/** Ask-questions skip/cancel button. */
|
|
3699
3789
|
toolInputSkip: `${p2}-tool-input-skip`,
|
|
3700
3790
|
/** Tool-approval root (approve/reject prompt). */
|
|
3701
3791
|
toolApproval: `${p2}-tool-approval`,
|
|
@@ -3902,7 +3992,7 @@ var KEEP_VISIBLE = 56;
|
|
|
3902
3992
|
function useDragMove(panelEl, enabled) {
|
|
3903
3993
|
useEffect3(() => {
|
|
3904
3994
|
if (!enabled || !panelEl) return;
|
|
3905
|
-
const
|
|
3995
|
+
const num = (v) => Number.parseFloat(v) || 0;
|
|
3906
3996
|
const clamp = (v, max) => Math.min(max, Math.max(-max, v));
|
|
3907
3997
|
let drag = null;
|
|
3908
3998
|
const onDown = (e) => {
|
|
@@ -3913,8 +4003,8 @@ function useDragMove(panelEl, enabled) {
|
|
|
3913
4003
|
id: e.pointerId,
|
|
3914
4004
|
x: e.clientX,
|
|
3915
4005
|
y: e.clientY,
|
|
3916
|
-
dx:
|
|
3917
|
-
dy:
|
|
4006
|
+
dx: num(panelEl.style.getPropertyValue(`--${p4}-modal-dx`)),
|
|
4007
|
+
dy: num(panelEl.style.getPropertyValue(`--${p4}-modal-dy`)),
|
|
3918
4008
|
// Centred origin: |offset| ≤ (viewport + panel)/2 − keepVisible keeps a
|
|
3919
4009
|
// strip of the dialog reachable so it can never be lost off-screen.
|
|
3920
4010
|
maxX: (window.innerWidth + rect.width) / 2 - KEEP_VISIBLE,
|
|
@@ -4847,7 +4937,7 @@ function HeaderActions({ panelProps, variant }) {
|
|
|
4847
4937
|
}
|
|
4848
4938
|
|
|
4849
4939
|
// src/ui/message-list.tsx
|
|
4850
|
-
import { useEffect as useEffect7, useLayoutEffect as useLayoutEffect2, useRef as useRef5, useState as
|
|
4940
|
+
import { useEffect as useEffect7, useLayoutEffect as useLayoutEffect2, useRef as useRef5, useState as useState6 } from "preact/hooks";
|
|
4851
4941
|
import { useComputed as useComputed6 } from "@preact/signals";
|
|
4852
4942
|
|
|
4853
4943
|
// src/ui/form/dynamic-form.tsx
|
|
@@ -5247,10 +5337,10 @@ function FormDoneMarker({
|
|
|
5247
5337
|
import { useComputed as useComputed5 } from "@preact/signals";
|
|
5248
5338
|
|
|
5249
5339
|
// src/stream/constants.ts
|
|
5250
|
-
function
|
|
5340
|
+
function isAskUserQuestionsTool(toolName2) {
|
|
5251
5341
|
if (!toolName2) return false;
|
|
5252
5342
|
const name = toolName2.startsWith("tool:") ? toolName2.slice(5) : toolName2;
|
|
5253
|
-
return name === "ask-user-
|
|
5343
|
+
return name === "ask-user-questions" || name === "ask_user_questions";
|
|
5254
5344
|
}
|
|
5255
5345
|
|
|
5256
5346
|
// src/ui/markdown.tsx
|
|
@@ -5517,107 +5607,103 @@ function ToolApproval({ part, strings, active, superseded = false, onDecision, o
|
|
|
5517
5607
|
] });
|
|
5518
5608
|
}
|
|
5519
5609
|
|
|
5520
|
-
// src/ui/tool-ask-
|
|
5610
|
+
// src/ui/tool-ask-questions.tsx
|
|
5521
5611
|
import { useComputed as useComputed3 } from "@preact/signals";
|
|
5522
|
-
import { useState as useState6 } from "preact/hooks";
|
|
5523
5612
|
|
|
5524
5613
|
// src/ui/form/field.ts
|
|
5525
|
-
|
|
5614
|
+
var QUESTION_TYPES = /* @__PURE__ */ new Set([
|
|
5615
|
+
"text",
|
|
5616
|
+
"email",
|
|
5617
|
+
"phone",
|
|
5618
|
+
"number",
|
|
5619
|
+
"date",
|
|
5620
|
+
"single-select",
|
|
5621
|
+
"multi-select",
|
|
5622
|
+
"boolean"
|
|
5623
|
+
]);
|
|
5624
|
+
function parseAskUserQuestions(input) {
|
|
5526
5625
|
const raw = input && typeof input === "object" ? input : {};
|
|
5527
|
-
const
|
|
5626
|
+
const rawQuestions = Array.isArray(raw.questions) ? raw.questions : [];
|
|
5627
|
+
const questions = rawQuestions.map(parseQuestion).filter((q) => q !== null);
|
|
5628
|
+
return { intro: str(raw.intro), questions };
|
|
5629
|
+
}
|
|
5630
|
+
function parseQuestion(value, index) {
|
|
5631
|
+
if (!value || typeof value !== "object") return null;
|
|
5632
|
+
const raw = value;
|
|
5633
|
+
const type = QUESTION_TYPES.has(raw.type) ? raw.type : "text";
|
|
5528
5634
|
return {
|
|
5529
|
-
|
|
5635
|
+
key: str(raw.key) ?? `q${index + 1}`,
|
|
5530
5636
|
question: str(raw.question) ?? "Please provide the missing information.",
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
allowOther: typeof raw.allowOther === "boolean" ? raw.allowOther : void 0,
|
|
5536
|
-
required: typeof raw.required === "boolean" ? raw.required : true,
|
|
5537
|
-
defaultValues: Array.isArray(raw.defaultValues) ? raw.defaultValues.filter((v) => typeof v === "string") : void 0,
|
|
5538
|
-
minSelections: num(raw.minSelections),
|
|
5539
|
-
maxSelections: num(raw.maxSelections),
|
|
5540
|
-
validationHint: str(raw.validationHint)
|
|
5637
|
+
type,
|
|
5638
|
+
options: Array.isArray(raw.options) ? raw.options.filter((o) => typeof o === "string" && o.trim().length > 0) : void 0,
|
|
5639
|
+
required: typeof raw.required === "boolean" ? raw.required : void 0,
|
|
5640
|
+
helpText: str(raw.helpText)
|
|
5541
5641
|
};
|
|
5542
5642
|
}
|
|
5543
|
-
function
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5643
|
+
function fieldTypeFor(type) {
|
|
5644
|
+
switch (type) {
|
|
5645
|
+
case "text":
|
|
5646
|
+
return "textarea";
|
|
5647
|
+
case "phone":
|
|
5648
|
+
return "tel";
|
|
5649
|
+
case "single-select":
|
|
5650
|
+
case "boolean":
|
|
5651
|
+
return "radio";
|
|
5652
|
+
case "multi-select":
|
|
5653
|
+
return "multiselect";
|
|
5654
|
+
default:
|
|
5655
|
+
return type;
|
|
5656
|
+
}
|
|
5657
|
+
}
|
|
5658
|
+
function askQuestionsToFields(req, yesLabel, noLabel) {
|
|
5659
|
+
return req.questions.map((q) => {
|
|
5660
|
+
const type = fieldTypeFor(q.type);
|
|
5661
|
+
const options = q.type === "boolean" ? [
|
|
5662
|
+
{ value: "yes", label: yesLabel },
|
|
5663
|
+
{ value: "no", label: noLabel }
|
|
5664
|
+
] : (q.options ?? []).map((o) => ({ value: o, label: o }));
|
|
5665
|
+
return {
|
|
5666
|
+
name: q.key,
|
|
5667
|
+
label: q.question,
|
|
5554
5668
|
type,
|
|
5555
|
-
|
|
5556
|
-
required: req.required ?? true,
|
|
5557
|
-
defaultValue,
|
|
5669
|
+
required: q.required ?? false,
|
|
5558
5670
|
options: options.length > 0 ? options : void 0,
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
}
|
|
5563
|
-
];
|
|
5564
|
-
}
|
|
5565
|
-
function normalizeChoice(c) {
|
|
5566
|
-
if (typeof c === "string") return c ? { value: c, label: c } : null;
|
|
5567
|
-
if (c && typeof c.value === "string" && c.value)
|
|
5568
|
-
return { value: c.value, label: c.label ?? c.value, description: c.description };
|
|
5569
|
-
return null;
|
|
5671
|
+
validationHint: q.helpText
|
|
5672
|
+
};
|
|
5673
|
+
});
|
|
5570
5674
|
}
|
|
5571
5675
|
function str(v) {
|
|
5572
5676
|
return typeof v === "string" && v.trim() ? v.trim() : void 0;
|
|
5573
5677
|
}
|
|
5574
|
-
function num(v) {
|
|
5575
|
-
return typeof v === "number" && Number.isFinite(v) ? v : void 0;
|
|
5576
|
-
}
|
|
5577
5678
|
|
|
5578
|
-
// src/ui/tool-ask-
|
|
5679
|
+
// src/ui/tool-ask-questions.tsx
|
|
5579
5680
|
import { Fragment as Fragment4, jsx as jsx16, jsxs as jsxs13 } from "preact/jsx-runtime";
|
|
5580
5681
|
var p15 = BRAND.cssPrefix;
|
|
5581
|
-
function
|
|
5582
|
-
switch (req.responseType) {
|
|
5583
|
-
case "single-choice":
|
|
5584
|
-
return s.respSingleChoice;
|
|
5585
|
-
case "multi-choice":
|
|
5586
|
-
return s.respMultiChoice;
|
|
5587
|
-
case "confirmation":
|
|
5588
|
-
return s.respConfirmation;
|
|
5589
|
-
default:
|
|
5590
|
-
return s.respFreeText;
|
|
5591
|
-
}
|
|
5592
|
-
}
|
|
5593
|
-
function ToolAskInput({ part, strings, active, superseded = false, onSubmit, onDecision, onEdit }) {
|
|
5682
|
+
function ToolAskQuestions({ part, strings, active, superseded = false, onDecision, onEdit }) {
|
|
5594
5683
|
const state = useComputed3(() => part.stateSig.value);
|
|
5595
5684
|
const approval = useComputed3(() => part.approvalSig.value);
|
|
5596
|
-
const request = useComputed3(() =>
|
|
5685
|
+
const request = useComputed3(() => parseAskUserQuestions(part.inputSig.value));
|
|
5597
5686
|
const { terminal, responded, decided } = toolDecisionState(state.value, approval.value);
|
|
5598
|
-
const viaApproval = approval.value !== void 0;
|
|
5599
|
-
const resolve = (answer, accepted) => {
|
|
5600
|
-
if (viaApproval) onDecision(part.toolCallId, accepted, answer);
|
|
5601
|
-
else if (request.value.responseType === "confirmation") onSubmit(part.toolCallId, { confirmed: accepted });
|
|
5602
|
-
else onSubmit(part.toolCallId, accepted ? { answer } : {});
|
|
5603
|
-
};
|
|
5604
5687
|
const req = request.value;
|
|
5605
5688
|
if (decided) {
|
|
5606
5689
|
const editable = responded && active && !terminal;
|
|
5607
5690
|
return /* @__PURE__ */ jsx16(DecidedCard, { part, strings, req, editable, onEdit: () => onEdit(part.toolCallId) });
|
|
5608
5691
|
}
|
|
5609
5692
|
const stale = superseded;
|
|
5610
|
-
return /* @__PURE__ */ jsxs13("div", { class: `${p15}-toolui${stale ? ` ${p15}-toolui-stale` : ""}`, "data-testid": TID.
|
|
5693
|
+
return /* @__PURE__ */ jsxs13("div", { class: `${p15}-toolui${stale ? ` ${p15}-toolui-stale` : ""}`, "data-testid": TID.toolAskQuestions, children: [
|
|
5611
5694
|
/* @__PURE__ */ jsx16("div", { class: `${p15}-toolui-head`, children: stale ? /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
5612
5695
|
/* @__PURE__ */ jsx16("span", { class: `${p15}-toolui-badge ${p15}-toolui-badge-accent`, children: strings.inputBadge }),
|
|
5613
5696
|
/* @__PURE__ */ jsx16("span", { class: `${p15}-toolui-badge ${p15}-toolui-badge-muted`, children: strings.statusSuperseded })
|
|
5614
|
-
] }) : /* @__PURE__ */
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5697
|
+
] }) : /* @__PURE__ */ jsx16("span", { class: `${p15}-toolui-badge ${p15}-toolui-badge-accent`, children: strings.inputRequired }) }),
|
|
5698
|
+
req.intro ? /* @__PURE__ */ jsx16("div", { class: `${p15}-toolui-desc`, children: req.intro }) : null,
|
|
5699
|
+
stale ? null : /* @__PURE__ */ jsx16(
|
|
5700
|
+
AskBody,
|
|
5701
|
+
{
|
|
5702
|
+
req,
|
|
5703
|
+
strings,
|
|
5704
|
+
resolve: (reason, accepted) => onDecision(part.toolCallId, accepted, reason)
|
|
5705
|
+
}
|
|
5706
|
+
)
|
|
5621
5707
|
] });
|
|
5622
5708
|
}
|
|
5623
5709
|
function AskBody({
|
|
@@ -5625,72 +5711,32 @@ function AskBody({
|
|
|
5625
5711
|
strings,
|
|
5626
5712
|
resolve
|
|
5627
5713
|
}) {
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
}
|
|
5631
|
-
const fields = askInputToFields(req).map((f) => {
|
|
5632
|
-
f.label = strings.inputYourAnswer;
|
|
5633
|
-
f.placeholder = f.placeholder ?? strings.inputAnswerPlaceholder;
|
|
5634
|
-
return f;
|
|
5635
|
-
});
|
|
5714
|
+
const fields = askQuestionsToFields(req, strings.confirmYes, strings.confirmNo);
|
|
5715
|
+
const loneTextarea = req.questions.length === 1 && req.questions[0]?.type === "text";
|
|
5636
5716
|
return /* @__PURE__ */ jsx16(
|
|
5637
5717
|
DynamicForm,
|
|
5638
5718
|
{
|
|
5639
5719
|
fields,
|
|
5640
5720
|
strings,
|
|
5641
5721
|
submitLabel: strings.inputSubmit,
|
|
5642
|
-
footerHint:
|
|
5643
|
-
onSubmit: (values) => resolve(
|
|
5722
|
+
footerHint: loneTextarea ? strings.inputSubmitHint : void 0,
|
|
5723
|
+
onSubmit: (values) => resolve(buildAnswersReason(req.questions, values), true),
|
|
5644
5724
|
skipLabel: strings.inputSkip,
|
|
5645
5725
|
onSkip: () => resolve(void 0, false),
|
|
5646
|
-
submitOnEnter:
|
|
5726
|
+
submitOnEnter: loneTextarea,
|
|
5647
5727
|
submitTestId: TID.toolInputSubmit,
|
|
5648
5728
|
skipTestId: TID.toolInputSkip
|
|
5649
5729
|
}
|
|
5650
5730
|
);
|
|
5651
5731
|
}
|
|
5652
|
-
function
|
|
5653
|
-
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
|
|
5660
|
-
const no = () => resolve(void 0, false);
|
|
5661
|
-
const onKeyDown = (e) => {
|
|
5662
|
-
if (e.key !== "Enter" || e.shiftKey || e.isComposing) return;
|
|
5663
|
-
e.preventDefault();
|
|
5664
|
-
yes();
|
|
5665
|
-
};
|
|
5666
|
-
return /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
5667
|
-
supportsNote ? /* @__PURE__ */ jsxs13("label", { class: `${p15}-field`, children: [
|
|
5668
|
-
/* @__PURE__ */ jsx16("span", { class: `${p15}-field-label`, children: strings.inputOptionalNote }),
|
|
5669
|
-
/* @__PURE__ */ jsx16(
|
|
5670
|
-
"textarea",
|
|
5671
|
-
{
|
|
5672
|
-
class: `${p15}-field-input`,
|
|
5673
|
-
rows: 2,
|
|
5674
|
-
value: note,
|
|
5675
|
-
placeholder: req.placeholder ?? strings.inputOptionalNotePlaceholder,
|
|
5676
|
-
onInput: (e) => setNote(e.target.value),
|
|
5677
|
-
onKeyDown,
|
|
5678
|
-
"data-testid": `${TID.formField}-note`
|
|
5679
|
-
}
|
|
5680
|
-
)
|
|
5681
|
-
] }) : null,
|
|
5682
|
-
/* @__PURE__ */ jsxs13("div", { class: `${p15}-form-actions`, children: [
|
|
5683
|
-
/* @__PURE__ */ jsx16("span", { class: `${p15}-form-hint`, children: strings.inputConfirmHint }),
|
|
5684
|
-
/* @__PURE__ */ jsx16("button", { type: "button", class: `${p15}-form-skip`, onClick: no, "data-testid": TID.toolInputSkip, children: strings.confirmNo }),
|
|
5685
|
-
/* @__PURE__ */ jsx16("button", { type: "button", class: `${p15}-form-submit`, onClick: yes, "data-testid": TID.toolInputSubmit, children: strings.confirmYes })
|
|
5686
|
-
] })
|
|
5687
|
-
] });
|
|
5688
|
-
}
|
|
5689
|
-
function Section({ label, text }) {
|
|
5690
|
-
return /* @__PURE__ */ jsxs13("div", { class: `${p15}-toolui-section`, children: [
|
|
5691
|
-
/* @__PURE__ */ jsx16("span", { class: `${p15}-toolui-label`, children: label }),
|
|
5692
|
-
/* @__PURE__ */ jsx16("p", { class: `${p15}-toolui-text`, children: text })
|
|
5693
|
-
] });
|
|
5732
|
+
function buildAnswersReason(questions, values) {
|
|
5733
|
+
const answers = questions.flatMap((q) => {
|
|
5734
|
+
const flat = values[q.key];
|
|
5735
|
+
if (flat == null || flat.trim() === "") return [];
|
|
5736
|
+
const value = q.type === "multi-select" ? flat.split(",").map((s) => s.trim()).filter(Boolean) : flat;
|
|
5737
|
+
return [{ key: q.key, value }];
|
|
5738
|
+
});
|
|
5739
|
+
return JSON.stringify({ answers });
|
|
5694
5740
|
}
|
|
5695
5741
|
function DecidedCard({
|
|
5696
5742
|
part,
|
|
@@ -5699,31 +5745,44 @@ function DecidedCard({
|
|
|
5699
5745
|
editable,
|
|
5700
5746
|
onEdit
|
|
5701
5747
|
}) {
|
|
5702
|
-
const output = useComputed3(() => part.outputSig.value);
|
|
5703
5748
|
const approval = useComputed3(() => part.approvalSig.value);
|
|
5704
5749
|
const skipped = approval.value?.approved === false;
|
|
5705
|
-
const
|
|
5750
|
+
const answers = approval.value?.approved ? parseAnswers(approval.value.reason) : {};
|
|
5706
5751
|
return /* @__PURE__ */ jsxs13("div", { class: `${p15}-toolui`, "data-testid": TID.toolDecision, children: [
|
|
5707
5752
|
/* @__PURE__ */ jsxs13("div", { class: `${p15}-toolui-head`, children: [
|
|
5708
5753
|
/* @__PURE__ */ jsx16("span", { class: `${p15}-toolui-badge ${p15}-toolui-badge-accent`, children: strings.inputBadge }),
|
|
5709
5754
|
/* @__PURE__ */ jsx16("span", { class: `${p15}-toolui-badge`, children: skipped ? strings.inputSkipped : strings.inputAnswered })
|
|
5710
5755
|
] }),
|
|
5711
|
-
req.
|
|
5712
|
-
|
|
5713
|
-
|
|
5756
|
+
req.intro ? /* @__PURE__ */ jsx16("div", { class: `${p15}-toolui-desc`, children: req.intro }) : null,
|
|
5757
|
+
req.questions.map((q) => {
|
|
5758
|
+
const text = skipped ? "" : answers[q.key] ?? "";
|
|
5759
|
+
return /* @__PURE__ */ jsxs13("div", { class: `${p15}-toolui-section`, children: [
|
|
5760
|
+
/* @__PURE__ */ jsx16("span", { class: `${p15}-toolui-label`, children: q.question }),
|
|
5761
|
+
text ? /* @__PURE__ */ jsx16("p", { class: `${p15}-toolui-text`, children: text }) : null
|
|
5762
|
+
] }, q.key);
|
|
5763
|
+
}),
|
|
5714
5764
|
editable ? /* @__PURE__ */ jsx16("div", { class: `${p15}-toolui-actions`, children: /* @__PURE__ */ jsx16("button", { type: "button", class: `${p15}-form-skip`, onClick: onEdit, "data-testid": TID.toolEdit, children: strings.edit }) }) : null
|
|
5715
5765
|
] });
|
|
5716
5766
|
}
|
|
5717
|
-
function
|
|
5718
|
-
if (
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
|
|
5767
|
+
function parseAnswers(reason) {
|
|
5768
|
+
if (!reason) return {};
|
|
5769
|
+
const parsed = (() => {
|
|
5770
|
+
try {
|
|
5771
|
+
return JSON.parse(reason);
|
|
5772
|
+
} catch {
|
|
5773
|
+
return void 0;
|
|
5774
|
+
}
|
|
5775
|
+
})();
|
|
5776
|
+
const list = parsed?.answers;
|
|
5777
|
+
if (!Array.isArray(list)) return {};
|
|
5778
|
+
const out = {};
|
|
5779
|
+
for (const entry of list) {
|
|
5780
|
+
if (!entry || typeof entry !== "object") continue;
|
|
5781
|
+
const { key, value } = entry;
|
|
5782
|
+
if (typeof key !== "string") continue;
|
|
5783
|
+
out[key] = Array.isArray(value) ? value.filter((v) => typeof v === "string").join(", ") : String(value ?? "");
|
|
5725
5784
|
}
|
|
5726
|
-
return
|
|
5785
|
+
return out;
|
|
5727
5786
|
}
|
|
5728
5787
|
|
|
5729
5788
|
// src/ui/tool-call.tsx
|
|
@@ -5873,15 +5932,14 @@ function ToolPartView({
|
|
|
5873
5932
|
}) {
|
|
5874
5933
|
const hasApproval = useComputed5(() => part.approvalSig.value !== void 0);
|
|
5875
5934
|
if (tool?.humanInLoop) {
|
|
5876
|
-
if (
|
|
5935
|
+
if (isAskUserQuestionsTool(part.toolName)) {
|
|
5877
5936
|
return /* @__PURE__ */ jsx18(
|
|
5878
|
-
|
|
5937
|
+
ToolAskQuestions,
|
|
5879
5938
|
{
|
|
5880
5939
|
part,
|
|
5881
5940
|
strings,
|
|
5882
5941
|
active: interactive,
|
|
5883
5942
|
superseded,
|
|
5884
|
-
onSubmit: tool.onResult,
|
|
5885
5943
|
onDecision: tool.onDecision,
|
|
5886
5944
|
onEdit: tool.onEdit
|
|
5887
5945
|
}
|
|
@@ -5963,7 +6021,7 @@ function MessageList({
|
|
|
5963
6021
|
}) {
|
|
5964
6022
|
const ref = useRef5(null);
|
|
5965
6023
|
const messages = useComputed6(() => messagesSig.value);
|
|
5966
|
-
const [showJump, setShowJump] =
|
|
6024
|
+
const [showJump, setShowJump] = useState6(false);
|
|
5967
6025
|
const hasHydratedRef = useRef5(false);
|
|
5968
6026
|
const detachedRef = useRef5(false);
|
|
5969
6027
|
const interactingRef = useRef5(false);
|
|
@@ -6250,7 +6308,7 @@ function dayLabel(createdAt, strings) {
|
|
|
6250
6308
|
}
|
|
6251
6309
|
|
|
6252
6310
|
// src/ui/conversation-list.tsx
|
|
6253
|
-
import { useEffect as useEffect8, useState as
|
|
6311
|
+
import { useEffect as useEffect8, useState as useState7 } from "preact/hooks";
|
|
6254
6312
|
|
|
6255
6313
|
// src/ui/history-groups.ts
|
|
6256
6314
|
var HISTORY_BUCKETS = ["today", "yesterday", "lastWeek", "older"];
|
|
@@ -6309,8 +6367,8 @@ function ConversationList({
|
|
|
6309
6367
|
}) {
|
|
6310
6368
|
const p36 = BRAND.cssPrefix;
|
|
6311
6369
|
const seed = transport.peekConversations({ visitorId });
|
|
6312
|
-
const [state, setState] =
|
|
6313
|
-
const [conversations, setChats] =
|
|
6370
|
+
const [state, setState] = useState7(seed ? "loaded" : "loading");
|
|
6371
|
+
const [conversations, setChats] = useState7(seed?.conversations ?? []);
|
|
6314
6372
|
useEffect8(() => {
|
|
6315
6373
|
let cancelled = false;
|
|
6316
6374
|
transport.listConversations({ visitorId }).then((res) => {
|
|
@@ -6916,7 +6974,7 @@ var chatLayout = {
|
|
|
6916
6974
|
};
|
|
6917
6975
|
|
|
6918
6976
|
// src/ui/modules/help.tsx
|
|
6919
|
-
import { useEffect as useEffect10, useMemo as useMemo2, useState as
|
|
6977
|
+
import { useEffect as useEffect10, useMemo as useMemo2, useState as useState8 } from "preact/hooks";
|
|
6920
6978
|
|
|
6921
6979
|
// src/ui/back-header.tsx
|
|
6922
6980
|
import { jsx as jsx25, jsxs as jsxs21 } from "preact/jsx-runtime";
|
|
@@ -7033,11 +7091,11 @@ function ArticleRow({ article, nav }) {
|
|
|
7033
7091
|
}
|
|
7034
7092
|
function HelpRoot({ transport, strings, config, nav, bus, panelProps }) {
|
|
7035
7093
|
const tags = config.contentTags;
|
|
7036
|
-
const [state, setState] =
|
|
7037
|
-
const [errorMsg, setErrorMsg] =
|
|
7038
|
-
const [items, setItems] =
|
|
7039
|
-
const [query, setQuery] =
|
|
7040
|
-
const [reloadKey, setReloadKey] =
|
|
7094
|
+
const [state, setState] = useState8("loading");
|
|
7095
|
+
const [errorMsg, setErrorMsg] = useState8(strings.errorGeneric);
|
|
7096
|
+
const [items, setItems] = useState8([]);
|
|
7097
|
+
const [query, setQuery] = useState8("");
|
|
7098
|
+
const [reloadKey, setReloadKey] = useState8(0);
|
|
7041
7099
|
useEffect10(() => {
|
|
7042
7100
|
let cancelled = false;
|
|
7043
7101
|
setState("loading");
|
|
@@ -7091,7 +7149,7 @@ var helpLayout = {
|
|
|
7091
7149
|
};
|
|
7092
7150
|
|
|
7093
7151
|
// src/ui/modules/home.tsx
|
|
7094
|
-
import { useEffect as useEffect11, useState as
|
|
7152
|
+
import { useEffect as useEffect11, useState as useState9 } from "preact/hooks";
|
|
7095
7153
|
|
|
7096
7154
|
// src/ui/home-card.tsx
|
|
7097
7155
|
import { jsx as jsx30 } from "preact/jsx-runtime";
|
|
@@ -7119,8 +7177,8 @@ function resolveGreeting(props2) {
|
|
|
7119
7177
|
var openContent = (nav, item) => item.url ? nav.push({ kind: "iframe", url: item.url, title: item.title }) : nav.push({ kind: "content", id: item.id, title: item.title });
|
|
7120
7178
|
function HomeRoot(props2) {
|
|
7121
7179
|
const { transport, strings, config, nav, bus, panelProps } = props2;
|
|
7122
|
-
const [recent, setRecent] =
|
|
7123
|
-
const [content, setContent] =
|
|
7180
|
+
const [recent, setRecent] = useState9(null);
|
|
7181
|
+
const [content, setContent] = useState9([]);
|
|
7124
7182
|
const tagsKey = config.contentTags?.join(",");
|
|
7125
7183
|
useEffect11(() => {
|
|
7126
7184
|
if (!config.showRecentConversations) return;
|
|
@@ -7210,16 +7268,16 @@ var homeLayout = {
|
|
|
7210
7268
|
};
|
|
7211
7269
|
|
|
7212
7270
|
// src/ui/modules/news.tsx
|
|
7213
|
-
import { useEffect as useEffect12, useState as
|
|
7271
|
+
import { useEffect as useEffect12, useState as useState10 } from "preact/hooks";
|
|
7214
7272
|
import { jsx as jsx32, jsxs as jsxs27 } from "preact/jsx-runtime";
|
|
7215
7273
|
var p29 = BRAND.cssPrefix;
|
|
7216
7274
|
var log15 = logger.scope("news");
|
|
7217
7275
|
function NewsRoot({ transport, strings, config, nav, bus, panelProps }) {
|
|
7218
7276
|
const tags = config.contentTags;
|
|
7219
|
-
const [state, setState] =
|
|
7220
|
-
const [errorMsg, setErrorMsg] =
|
|
7221
|
-
const [items, setItems] =
|
|
7222
|
-
const [reloadKey, setReloadKey] =
|
|
7277
|
+
const [state, setState] = useState10("loading");
|
|
7278
|
+
const [errorMsg, setErrorMsg] = useState10(strings.errorGeneric);
|
|
7279
|
+
const [items, setItems] = useState10([]);
|
|
7280
|
+
const [reloadKey, setReloadKey] = useState10(0);
|
|
7223
7281
|
useEffect12(() => {
|
|
7224
7282
|
let cancelled = false;
|
|
7225
7283
|
setState("loading");
|
|
@@ -7342,15 +7400,15 @@ function IframeView({ url, title, strings, onBack, actions }) {
|
|
|
7342
7400
|
}
|
|
7343
7401
|
|
|
7344
7402
|
// src/ui/content-view.tsx
|
|
7345
|
-
import { useCallback as useCallback3, useEffect as useEffect13, useState as
|
|
7403
|
+
import { useCallback as useCallback3, useEffect as useEffect13, useState as useState11 } from "preact/hooks";
|
|
7346
7404
|
import { jsx as jsx35, jsxs as jsxs30 } from "preact/jsx-runtime";
|
|
7347
7405
|
var p32 = BRAND.cssPrefix;
|
|
7348
7406
|
var log16 = logger.scope("content");
|
|
7349
7407
|
var READ_DWELL_MS = 5e3;
|
|
7350
7408
|
function ContentView({ id, title, transport, strings, bus, onBack, actions }) {
|
|
7351
|
-
const [item, setItem] =
|
|
7352
|
-
const [failed, setFailed] =
|
|
7353
|
-
const [reloadKey, setReloadKey] =
|
|
7409
|
+
const [item, setItem] = useState11(null);
|
|
7410
|
+
const [failed, setFailed] = useState11(false);
|
|
7411
|
+
const [reloadKey, setReloadKey] = useState11(0);
|
|
7354
7412
|
const retry = useCallback3(() => {
|
|
7355
7413
|
setFailed(false);
|
|
7356
7414
|
setItem(null);
|
|
@@ -7594,11 +7652,11 @@ function ModulesEmpty({ strings, onClose }) {
|
|
|
7594
7652
|
}
|
|
7595
7653
|
|
|
7596
7654
|
// src/ui/use-launcher-callout.ts
|
|
7597
|
-
import { useCallback as useCallback5, useEffect as useEffect15, useState as
|
|
7655
|
+
import { useCallback as useCallback5, useEffect as useEffect15, useState as useState12 } from "preact/hooks";
|
|
7598
7656
|
function useLauncherCallout({ callout, persistence }) {
|
|
7599
7657
|
const textKey = callout?.text ?? "";
|
|
7600
7658
|
const persistent = callout?.persistent ?? true;
|
|
7601
|
-
const [dismissed, setDismissed] =
|
|
7659
|
+
const [dismissed, setDismissed] = useState12(() => persistent ? false : persistence.loadCalloutDismissed(textKey));
|
|
7602
7660
|
useEffect15(() => {
|
|
7603
7661
|
setDismissed(persistent ? false : persistence.loadCalloutDismissed(textKey));
|
|
7604
7662
|
}, [textKey, persistent, persistence]);
|
|
@@ -7627,21 +7685,21 @@ function isAbortError(error) {
|
|
|
7627
7685
|
return error instanceof DOMException ? error.name === "AbortError" : error?.name === "AbortError";
|
|
7628
7686
|
}
|
|
7629
7687
|
function App({ options, hostElement, bus }) {
|
|
7630
|
-
const [persistence] =
|
|
7688
|
+
const [persistence] = useState13(
|
|
7631
7689
|
() => createPersistence(options.widgetId, options.storage, options.aiAgentDeploymentId)
|
|
7632
7690
|
);
|
|
7633
|
-
const [visitorId, setVisitorId] =
|
|
7691
|
+
const [visitorId, setVisitorId] = useState13(() => persistence.getVisitorId());
|
|
7634
7692
|
const initialSettings = persistence.loadUserPrefs();
|
|
7635
|
-
const [activeLocale, setActiveLocale] =
|
|
7636
|
-
const [activeThemeMode, setActiveThemeMode] =
|
|
7693
|
+
const [activeLocale, setActiveLocale] = useState13(() => initialSettings.locale ?? options.locale);
|
|
7694
|
+
const [activeThemeMode, setActiveThemeMode] = useState13(
|
|
7637
7695
|
() => initialSettings.themeMode ?? options.themeMode
|
|
7638
7696
|
);
|
|
7639
|
-
const [activeTextSize, setActiveTextSize] =
|
|
7697
|
+
const [activeTextSize, setActiveTextSize] = useState13(() => initialSettings.textSize ?? options.textSize);
|
|
7640
7698
|
const conversationIdSig = useSignal(persistence.loadConversationId());
|
|
7641
7699
|
const messagesSig = useSignal([]);
|
|
7642
7700
|
const unreadCountSig = useSignal(0);
|
|
7643
|
-
const [loadingMessages, setLoadingMessages] =
|
|
7644
|
-
const [formMarkers, setFormMarkers] =
|
|
7701
|
+
const [loadingMessages, setLoadingMessages] = useState13(false);
|
|
7702
|
+
const [formMarkers, setFormMarkers] = useState13([]);
|
|
7645
7703
|
function landingTab() {
|
|
7646
7704
|
const list = options.modules.list;
|
|
7647
7705
|
const ids = new Set(list.map((m) => m.id));
|
|
@@ -7660,15 +7718,15 @@ function App({ options, hostElement, bus }) {
|
|
|
7660
7718
|
const homeNav = homeNavRef.current;
|
|
7661
7719
|
const chatTabIdRef = useRef9(void 0);
|
|
7662
7720
|
chatTabIdRef.current = chatTabId();
|
|
7663
|
-
const [conversationReady, setConversationReady] =
|
|
7664
|
-
const [remoteForms, setRemoteForms] =
|
|
7665
|
-
const [formsReady, setFormsReady] =
|
|
7721
|
+
const [conversationReady, setConversationReady] = useState13(false);
|
|
7722
|
+
const [remoteForms, setRemoteForms] = useState13(null);
|
|
7723
|
+
const [formsReady, setFormsReady] = useState13(false);
|
|
7666
7724
|
const isInlineLike = options.mode === "standalone" || options.mode === "inline";
|
|
7667
7725
|
const initialPanelRef = useRef9(
|
|
7668
7726
|
resolveInitialPanelState(options, currentViewportWidth(), persistence.loadPanelOpen(), persistence.loadPanelSize())
|
|
7669
7727
|
);
|
|
7670
|
-
const [isOpen, setIsOpen] =
|
|
7671
|
-
const [activated, setActivated] =
|
|
7728
|
+
const [isOpen, setIsOpen] = useState13(initialPanelRef.current.panelOpen);
|
|
7729
|
+
const [activated, setActivated] = useState13(initialPanelRef.current.panelOpen);
|
|
7672
7730
|
const activatedRef = useRef9(activated);
|
|
7673
7731
|
activatedRef.current = activated;
|
|
7674
7732
|
const pendingThreadRef = useRef9(false);
|
|
@@ -7677,7 +7735,7 @@ function App({ options, hostElement, bus }) {
|
|
|
7677
7735
|
if (isOpen) setActivated(true);
|
|
7678
7736
|
}, [isOpen]);
|
|
7679
7737
|
const initialPanelApplied = useRef9(false);
|
|
7680
|
-
const [launcherLeaving, setLauncherLeaving] =
|
|
7738
|
+
const [launcherLeaving, setLauncherLeaving] = useState13(false);
|
|
7681
7739
|
const { dismissed: calloutDismissed, dismissCallout: dismissCalloutRaw } = useLauncherCallout({
|
|
7682
7740
|
callout: options.launcher.callout,
|
|
7683
7741
|
persistence
|
|
@@ -7688,21 +7746,21 @@ function App({ options, hostElement, bus }) {
|
|
|
7688
7746
|
bus.emit("calloutDismiss", void 0);
|
|
7689
7747
|
dismissCalloutRaw();
|
|
7690
7748
|
}, [bus, dismissCalloutRaw]);
|
|
7691
|
-
const [panelSize, setPanelSize] =
|
|
7749
|
+
const [panelSize, setPanelSize] = useState13(initialPanelRef.current.panelSize);
|
|
7692
7750
|
const initialSizeApplied = useRef9(false);
|
|
7693
|
-
const [view, setView] =
|
|
7694
|
-
const [canSend, setCanSend] =
|
|
7695
|
-
const [streaming, setStreaming] =
|
|
7696
|
-
const [agent, setAgent] =
|
|
7697
|
-
const [suggestions, setSuggestions] =
|
|
7698
|
-
const [activeCancel, setActiveCancel] =
|
|
7699
|
-
const [activeDetach, setActiveDetach] =
|
|
7751
|
+
const [view, setView] = useState13("chat");
|
|
7752
|
+
const [canSend, setCanSend] = useState13(true);
|
|
7753
|
+
const [streaming, setStreaming] = useState13(false);
|
|
7754
|
+
const [agent, setAgent] = useState13(null);
|
|
7755
|
+
const [suggestions, setSuggestions] = useState13([]);
|
|
7756
|
+
const [activeCancel, setActiveCancel] = useState13(null);
|
|
7757
|
+
const [activeDetach, setActiveDetach] = useState13(null);
|
|
7700
7758
|
const stringsRef = useRef9(options.strings);
|
|
7701
|
-
const [parsedSite, setParsedSite] =
|
|
7702
|
-
const [parsedBlocks, setParsedBlocks] =
|
|
7703
|
-
const [sidebarCollapsed, setSidebarCollapsed] =
|
|
7704
|
-
const [formContext, setFormContext] =
|
|
7705
|
-
const [transport] =
|
|
7759
|
+
const [parsedSite, setParsedSite] = useState13(void 0);
|
|
7760
|
+
const [parsedBlocks, setParsedBlocks] = useState13(void 0);
|
|
7761
|
+
const [sidebarCollapsed, setSidebarCollapsed] = useState13(() => persistence.loadSidebarCollapsed() ?? false);
|
|
7762
|
+
const [formContext, setFormContext] = useState13({});
|
|
7763
|
+
const [transport] = useState13(
|
|
7706
7764
|
() => new AgentTransport({
|
|
7707
7765
|
agentApiBaseUrl: options.agentApiBaseUrl,
|
|
7708
7766
|
dataApiBaseUrl: options.dataApiBaseUrl,
|
|
@@ -7714,8 +7772,8 @@ function App({ options, hostElement, bus }) {
|
|
|
7714
7772
|
endpoints: options.endpoints
|
|
7715
7773
|
})
|
|
7716
7774
|
);
|
|
7717
|
-
const [reducer] =
|
|
7718
|
-
const [feedback] =
|
|
7775
|
+
const [reducer] = useState13(() => new StreamReducer(messagesSig));
|
|
7776
|
+
const [feedback] = useState13(() => new FeedbackBus(options.sound, options.haptics));
|
|
7719
7777
|
const patchAndSync = useCallback6(
|
|
7720
7778
|
(patch) => {
|
|
7721
7779
|
persistence.patchUserPrefs(patch);
|