@plaisolutions/react 0.16.0 → 0.17.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/dist/components/index.d.ts +130 -6
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +424 -44
- package/dist/components/index.js.map +1 -1
- package/dist/index.d.ts +65 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +494 -44
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -2
package/dist/components/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Bot, Brain, CalendarDays, Check, CheckCircle2, ChevronDown, CircleAlert, CircleX, Clock, Copy, Database, ExternalLink, File, FileText, Globe, LoaderCircle, Mail, MessageSquare, Minus, Plug, Plus, RotateCcw, ThumbsDown, ThumbsUp, Video, Workflow, XCircle } from "lucide-react";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, forwardRef, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
4
|
-
import { HttpStatusError } from "@plaisolutions/client";
|
|
4
|
+
import { HttpStatusError, isHiddenMessage, toolConfirmationAt } from "@plaisolutions/client";
|
|
5
5
|
|
|
6
6
|
//#region src/components/internal/join-classes.ts
|
|
7
7
|
function joinClasses(...classes) {
|
|
@@ -3899,7 +3899,29 @@ const ENGLISH = {
|
|
|
3899
3899
|
actionFailed: "Failed",
|
|
3900
3900
|
openEmail: "Open email",
|
|
3901
3901
|
openEvent: "Open event",
|
|
3902
|
-
replyInThread: "Reply in the same thread"
|
|
3902
|
+
replyInThread: "Reply in the same thread",
|
|
3903
|
+
confirmSend: "Send",
|
|
3904
|
+
confirmCreate: "Create",
|
|
3905
|
+
confirmUpdate: "Save changes",
|
|
3906
|
+
confirmDelete: "Delete",
|
|
3907
|
+
confirmGeneric: "Confirm",
|
|
3908
|
+
cancel: "Cancel",
|
|
3909
|
+
confirming: "Confirming…",
|
|
3910
|
+
cancelling: "Cancelling…",
|
|
3911
|
+
verifying: "Checking status…",
|
|
3912
|
+
expiresIn: "Expires in {{minutes}} min",
|
|
3913
|
+
expiresSoon: "Expires in less than a minute",
|
|
3914
|
+
statusExecuting: "Running…",
|
|
3915
|
+
statusExecuted: "Done",
|
|
3916
|
+
statusRejected: "Cancelled",
|
|
3917
|
+
statusExpired: "Expired: ask again in the chat",
|
|
3918
|
+
statusSuperseded: "Replaced by a newer version",
|
|
3919
|
+
statusInvalidated: "Can no longer run: ask again",
|
|
3920
|
+
statusFailed: "Failed",
|
|
3921
|
+
statusUnknown: "Outcome unknown: check before trying again",
|
|
3922
|
+
statusNotFound: "Not available in this conversation",
|
|
3923
|
+
toolUnavailable: "The tool for this action isn’t available right now",
|
|
3924
|
+
decisionError: "Your decision couldn’t be sent. Try again."
|
|
3903
3925
|
};
|
|
3904
3926
|
const COPY = {
|
|
3905
3927
|
en: {},
|
|
@@ -3951,7 +3973,29 @@ const COPY = {
|
|
|
3951
3973
|
actionFailed: "Error",
|
|
3952
3974
|
openEmail: "Abrir correo",
|
|
3953
3975
|
openEvent: "Abrir evento",
|
|
3954
|
-
replyInThread: "Respuesta en el mismo hilo"
|
|
3976
|
+
replyInThread: "Respuesta en el mismo hilo",
|
|
3977
|
+
confirmSend: "Enviar",
|
|
3978
|
+
confirmCreate: "Crear",
|
|
3979
|
+
confirmUpdate: "Guardar cambios",
|
|
3980
|
+
confirmDelete: "Eliminar",
|
|
3981
|
+
confirmGeneric: "Confirmar",
|
|
3982
|
+
cancel: "Cancelar",
|
|
3983
|
+
confirming: "Confirmando…",
|
|
3984
|
+
cancelling: "Cancelando…",
|
|
3985
|
+
verifying: "Comprobando el estado…",
|
|
3986
|
+
expiresIn: "Caduca en {{minutes}} min",
|
|
3987
|
+
expiresSoon: "Caduca en menos de un minuto",
|
|
3988
|
+
statusExecuting: "Ejecutando…",
|
|
3989
|
+
statusExecuted: "Hecho",
|
|
3990
|
+
statusRejected: "Cancelada",
|
|
3991
|
+
statusExpired: "Caducada: pídelo de nuevo en el chat",
|
|
3992
|
+
statusSuperseded: "Sustituida por una versión más reciente",
|
|
3993
|
+
statusInvalidated: "Ya no se puede ejecutar: pídelo de nuevo",
|
|
3994
|
+
statusFailed: "No se pudo completar",
|
|
3995
|
+
statusUnknown: "Resultado desconocido: compruébalo antes de repetirlo",
|
|
3996
|
+
statusNotFound: "No disponible en esta conversación",
|
|
3997
|
+
toolUnavailable: "La herramienta de esta acción no está disponible ahora",
|
|
3998
|
+
decisionError: "No se pudo enviar tu decisión. Inténtalo de nuevo."
|
|
3955
3999
|
},
|
|
3956
4000
|
ca: {
|
|
3957
4001
|
searchingMail: "Cercant a {{service}}",
|
|
@@ -4001,7 +4045,29 @@ const COPY = {
|
|
|
4001
4045
|
actionFailed: "Error",
|
|
4002
4046
|
openEmail: "Obre el correu",
|
|
4003
4047
|
openEvent: "Obre l’esdeveniment",
|
|
4004
|
-
replyInThread: "Resposta al mateix fil"
|
|
4048
|
+
replyInThread: "Resposta al mateix fil",
|
|
4049
|
+
confirmSend: "Envia",
|
|
4050
|
+
confirmCreate: "Crea",
|
|
4051
|
+
confirmUpdate: "Desa els canvis",
|
|
4052
|
+
confirmDelete: "Elimina",
|
|
4053
|
+
confirmGeneric: "Confirma",
|
|
4054
|
+
cancel: "Cancel·la",
|
|
4055
|
+
confirming: "Confirmant…",
|
|
4056
|
+
cancelling: "Cancel·lant…",
|
|
4057
|
+
verifying: "Comprovant l’estat…",
|
|
4058
|
+
expiresIn: "Caduca d’aquí a {{minutes}} min",
|
|
4059
|
+
expiresSoon: "Caduca en menys d’un minut",
|
|
4060
|
+
statusExecuting: "Executant…",
|
|
4061
|
+
statusExecuted: "Fet",
|
|
4062
|
+
statusRejected: "Cancel·lada",
|
|
4063
|
+
statusExpired: "Caducada: torna-ho a demanar al xat",
|
|
4064
|
+
statusSuperseded: "Substituïda per una versió més recent",
|
|
4065
|
+
statusInvalidated: "Ja no es pot executar: torna-ho a demanar",
|
|
4066
|
+
statusFailed: "No s’ha pogut completar",
|
|
4067
|
+
statusUnknown: "Resultat desconegut: comprova-ho abans de repetir-ho",
|
|
4068
|
+
statusNotFound: "No disponible en aquesta conversa",
|
|
4069
|
+
toolUnavailable: "L’eina d’aquesta acció no està disponible ara",
|
|
4070
|
+
decisionError: "No s’ha pogut enviar la teva decisió. Torna-ho a provar."
|
|
4005
4071
|
},
|
|
4006
4072
|
fr: {
|
|
4007
4073
|
searchingMail: "Recherche dans {{service}}",
|
|
@@ -4051,7 +4117,29 @@ const COPY = {
|
|
|
4051
4117
|
actionFailed: "Échec",
|
|
4052
4118
|
openEmail: "Ouvrir l’e-mail",
|
|
4053
4119
|
openEvent: "Ouvrir l’événement",
|
|
4054
|
-
replyInThread: "Réponse dans le même fil"
|
|
4120
|
+
replyInThread: "Réponse dans le même fil",
|
|
4121
|
+
confirmSend: "Envoyer",
|
|
4122
|
+
confirmCreate: "Créer",
|
|
4123
|
+
confirmUpdate: "Enregistrer les modifications",
|
|
4124
|
+
confirmDelete: "Supprimer",
|
|
4125
|
+
confirmGeneric: "Confirmer",
|
|
4126
|
+
cancel: "Annuler",
|
|
4127
|
+
confirming: "Confirmation…",
|
|
4128
|
+
cancelling: "Annulation…",
|
|
4129
|
+
verifying: "Vérification de l’état…",
|
|
4130
|
+
expiresIn: "Expire dans {{minutes}} min",
|
|
4131
|
+
expiresSoon: "Expire dans moins d’une minute",
|
|
4132
|
+
statusExecuting: "En cours…",
|
|
4133
|
+
statusExecuted: "Terminé",
|
|
4134
|
+
statusRejected: "Annulée",
|
|
4135
|
+
statusExpired: "Expirée : redemandez-la dans le chat",
|
|
4136
|
+
statusSuperseded: "Remplacée par une version plus récente",
|
|
4137
|
+
statusInvalidated: "Ne peut plus être exécutée : redemandez-la",
|
|
4138
|
+
statusFailed: "Échec",
|
|
4139
|
+
statusUnknown: "Résultat inconnu : vérifiez avant de réessayer",
|
|
4140
|
+
statusNotFound: "Indisponible dans cette conversation",
|
|
4141
|
+
toolUnavailable: "L’outil de cette action n’est pas disponible pour le moment",
|
|
4142
|
+
decisionError: "Impossible d’envoyer votre décision. Réessayez."
|
|
4055
4143
|
},
|
|
4056
4144
|
it: {
|
|
4057
4145
|
searchingMail: "Ricerca in {{service}}",
|
|
@@ -4101,7 +4189,29 @@ const COPY = {
|
|
|
4101
4189
|
actionFailed: "Errore",
|
|
4102
4190
|
openEmail: "Apri email",
|
|
4103
4191
|
openEvent: "Apri evento",
|
|
4104
|
-
replyInThread: "Risposta nello stesso thread"
|
|
4192
|
+
replyInThread: "Risposta nello stesso thread",
|
|
4193
|
+
confirmSend: "Invia",
|
|
4194
|
+
confirmCreate: "Crea",
|
|
4195
|
+
confirmUpdate: "Salva modifiche",
|
|
4196
|
+
confirmDelete: "Elimina",
|
|
4197
|
+
confirmGeneric: "Conferma",
|
|
4198
|
+
cancel: "Annulla",
|
|
4199
|
+
confirming: "Conferma in corso…",
|
|
4200
|
+
cancelling: "Annullamento in corso…",
|
|
4201
|
+
verifying: "Verifica dello stato…",
|
|
4202
|
+
expiresIn: "Scade tra {{minutes}} min",
|
|
4203
|
+
expiresSoon: "Scade tra meno di un minuto",
|
|
4204
|
+
statusExecuting: "In esecuzione…",
|
|
4205
|
+
statusExecuted: "Fatto",
|
|
4206
|
+
statusRejected: "Annullata",
|
|
4207
|
+
statusExpired: "Scaduta: richiedila di nuovo nella chat",
|
|
4208
|
+
statusSuperseded: "Sostituita da una versione più recente",
|
|
4209
|
+
statusInvalidated: "Non può più essere eseguita: richiedila di nuovo",
|
|
4210
|
+
statusFailed: "Non riuscita",
|
|
4211
|
+
statusUnknown: "Esito sconosciuto: verifica prima di riprovare",
|
|
4212
|
+
statusNotFound: "Non disponibile in questa conversazione",
|
|
4213
|
+
toolUnavailable: "Lo strumento di questa azione non è disponibile ora",
|
|
4214
|
+
decisionError: "Impossibile inviare la tua decisione. Riprova."
|
|
4105
4215
|
},
|
|
4106
4216
|
de: {
|
|
4107
4217
|
searchingMail: "Suche in {{service}}",
|
|
@@ -4151,7 +4261,29 @@ const COPY = {
|
|
|
4151
4261
|
actionFailed: "Fehlgeschlagen",
|
|
4152
4262
|
openEmail: "E-Mail öffnen",
|
|
4153
4263
|
openEvent: "Termin öffnen",
|
|
4154
|
-
replyInThread: "Antwort im selben Verlauf"
|
|
4264
|
+
replyInThread: "Antwort im selben Verlauf",
|
|
4265
|
+
confirmSend: "Senden",
|
|
4266
|
+
confirmCreate: "Erstellen",
|
|
4267
|
+
confirmUpdate: "Änderungen speichern",
|
|
4268
|
+
confirmDelete: "Löschen",
|
|
4269
|
+
confirmGeneric: "Bestätigen",
|
|
4270
|
+
cancel: "Abbrechen",
|
|
4271
|
+
confirming: "Wird bestätigt…",
|
|
4272
|
+
cancelling: "Wird abgebrochen…",
|
|
4273
|
+
verifying: "Status wird geprüft…",
|
|
4274
|
+
expiresIn: "Läuft in {{minutes}} Min. ab",
|
|
4275
|
+
expiresSoon: "Läuft in weniger als einer Minute ab",
|
|
4276
|
+
statusExecuting: "Wird ausgeführt…",
|
|
4277
|
+
statusExecuted: "Erledigt",
|
|
4278
|
+
statusRejected: "Abgebrochen",
|
|
4279
|
+
statusExpired: "Abgelaufen: bitte im Chat erneut anfragen",
|
|
4280
|
+
statusSuperseded: "Durch eine neuere Version ersetzt",
|
|
4281
|
+
statusInvalidated: "Kann nicht mehr ausgeführt werden: bitte erneut anfragen",
|
|
4282
|
+
statusFailed: "Fehlgeschlagen",
|
|
4283
|
+
statusUnknown: "Ergebnis unbekannt: vor dem Wiederholen prüfen",
|
|
4284
|
+
statusNotFound: "In dieser Unterhaltung nicht verfügbar",
|
|
4285
|
+
toolUnavailable: "Das Tool für diese Aktion ist gerade nicht verfügbar",
|
|
4286
|
+
decisionError: "Deine Entscheidung konnte nicht gesendet werden. Versuche es erneut."
|
|
4155
4287
|
},
|
|
4156
4288
|
da: {
|
|
4157
4289
|
searchingMail: "Søger i {{service}}",
|
|
@@ -4201,7 +4333,29 @@ const COPY = {
|
|
|
4201
4333
|
actionFailed: "Mislykkedes",
|
|
4202
4334
|
openEmail: "Åbn e-mail",
|
|
4203
4335
|
openEvent: "Åbn begivenhed",
|
|
4204
|
-
replyInThread: "Svar i samme tråd"
|
|
4336
|
+
replyInThread: "Svar i samme tråd",
|
|
4337
|
+
confirmSend: "Send",
|
|
4338
|
+
confirmCreate: "Opret",
|
|
4339
|
+
confirmUpdate: "Gem ændringer",
|
|
4340
|
+
confirmDelete: "Slet",
|
|
4341
|
+
confirmGeneric: "Bekræft",
|
|
4342
|
+
cancel: "Annuller",
|
|
4343
|
+
confirming: "Bekræfter…",
|
|
4344
|
+
cancelling: "Annullerer…",
|
|
4345
|
+
verifying: "Tjekker status…",
|
|
4346
|
+
expiresIn: "Udløber om {{minutes}} min.",
|
|
4347
|
+
expiresSoon: "Udløber om under et minut",
|
|
4348
|
+
statusExecuting: "Kører…",
|
|
4349
|
+
statusExecuted: "Udført",
|
|
4350
|
+
statusRejected: "Annulleret",
|
|
4351
|
+
statusExpired: "Udløbet: bed om det igen i chatten",
|
|
4352
|
+
statusSuperseded: "Erstattet af en nyere version",
|
|
4353
|
+
statusInvalidated: "Kan ikke længere udføres: bed om det igen",
|
|
4354
|
+
statusFailed: "Mislykkedes",
|
|
4355
|
+
statusUnknown: "Ukendt resultat: tjek før du prøver igen",
|
|
4356
|
+
statusNotFound: "Ikke tilgængelig i denne samtale",
|
|
4357
|
+
toolUnavailable: "Værktøjet til denne handling er ikke tilgængeligt lige nu",
|
|
4358
|
+
decisionError: "Din beslutning kunne ikke sendes. Prøv igen."
|
|
4205
4359
|
},
|
|
4206
4360
|
sv: {
|
|
4207
4361
|
searchingMail: "Söker i {{service}}",
|
|
@@ -4251,7 +4405,29 @@ const COPY = {
|
|
|
4251
4405
|
actionFailed: "Misslyckades",
|
|
4252
4406
|
openEmail: "Öppna mejl",
|
|
4253
4407
|
openEvent: "Öppna händelse",
|
|
4254
|
-
replyInThread: "Svar i samma tråd"
|
|
4408
|
+
replyInThread: "Svar i samma tråd",
|
|
4409
|
+
confirmSend: "Skicka",
|
|
4410
|
+
confirmCreate: "Skapa",
|
|
4411
|
+
confirmUpdate: "Spara ändringar",
|
|
4412
|
+
confirmDelete: "Ta bort",
|
|
4413
|
+
confirmGeneric: "Bekräfta",
|
|
4414
|
+
cancel: "Avbryt",
|
|
4415
|
+
confirming: "Bekräftar…",
|
|
4416
|
+
cancelling: "Avbryter…",
|
|
4417
|
+
verifying: "Kontrollerar status…",
|
|
4418
|
+
expiresIn: "Går ut om {{minutes}} min",
|
|
4419
|
+
expiresSoon: "Går ut om mindre än en minut",
|
|
4420
|
+
statusExecuting: "Körs…",
|
|
4421
|
+
statusExecuted: "Klart",
|
|
4422
|
+
statusRejected: "Avbruten",
|
|
4423
|
+
statusExpired: "Utgången: be om det igen i chatten",
|
|
4424
|
+
statusSuperseded: "Ersatt av en nyare version",
|
|
4425
|
+
statusInvalidated: "Kan inte längre köras: be om det igen",
|
|
4426
|
+
statusFailed: "Misslyckades",
|
|
4427
|
+
statusUnknown: "Okänt resultat: kontrollera innan du försöker igen",
|
|
4428
|
+
statusNotFound: "Inte tillgänglig i den här konversationen",
|
|
4429
|
+
toolUnavailable: "Verktyget för den här åtgärden är inte tillgängligt just nu",
|
|
4430
|
+
decisionError: "Ditt beslut kunde inte skickas. Försök igen."
|
|
4255
4431
|
},
|
|
4256
4432
|
no: {
|
|
4257
4433
|
searchingMail: "Søker i {{service}}",
|
|
@@ -4301,7 +4477,29 @@ const COPY = {
|
|
|
4301
4477
|
actionFailed: "Mislyktes",
|
|
4302
4478
|
openEmail: "Åpne e-post",
|
|
4303
4479
|
openEvent: "Åpne hendelse",
|
|
4304
|
-
replyInThread: "Svar i samme tråd"
|
|
4480
|
+
replyInThread: "Svar i samme tråd",
|
|
4481
|
+
confirmSend: "Send",
|
|
4482
|
+
confirmCreate: "Opprett",
|
|
4483
|
+
confirmUpdate: "Lagre endringer",
|
|
4484
|
+
confirmDelete: "Slett",
|
|
4485
|
+
confirmGeneric: "Bekreft",
|
|
4486
|
+
cancel: "Avbryt",
|
|
4487
|
+
confirming: "Bekrefter…",
|
|
4488
|
+
cancelling: "Avbryter…",
|
|
4489
|
+
verifying: "Sjekker status…",
|
|
4490
|
+
expiresIn: "Utløper om {{minutes}} min",
|
|
4491
|
+
expiresSoon: "Utløper om under ett minutt",
|
|
4492
|
+
statusExecuting: "Kjører…",
|
|
4493
|
+
statusExecuted: "Fullført",
|
|
4494
|
+
statusRejected: "Avbrutt",
|
|
4495
|
+
statusExpired: "Utløpt: be om det igjen i chatten",
|
|
4496
|
+
statusSuperseded: "Erstattet av en nyere versjon",
|
|
4497
|
+
statusInvalidated: "Kan ikke lenger utføres: be om det igjen",
|
|
4498
|
+
statusFailed: "Mislyktes",
|
|
4499
|
+
statusUnknown: "Ukjent resultat: sjekk før du prøver igjen",
|
|
4500
|
+
statusNotFound: "Ikke tilgjengelig i denne samtalen",
|
|
4501
|
+
toolUnavailable: "Verktøyet for denne handlingen er ikke tilgjengelig nå",
|
|
4502
|
+
decisionError: "Beslutningen din kunne ikke sendes. Prøv igjen."
|
|
4305
4503
|
},
|
|
4306
4504
|
pt: {
|
|
4307
4505
|
searchingMail: "Pesquisando no {{service}}",
|
|
@@ -4351,7 +4549,29 @@ const COPY = {
|
|
|
4351
4549
|
actionFailed: "Falhou",
|
|
4352
4550
|
openEmail: "Abrir e-mail",
|
|
4353
4551
|
openEvent: "Abrir evento",
|
|
4354
|
-
replyInThread: "Resposta na mesma conversa"
|
|
4552
|
+
replyInThread: "Resposta na mesma conversa",
|
|
4553
|
+
confirmSend: "Enviar",
|
|
4554
|
+
confirmCreate: "Criar",
|
|
4555
|
+
confirmUpdate: "Salvar alterações",
|
|
4556
|
+
confirmDelete: "Excluir",
|
|
4557
|
+
confirmGeneric: "Confirmar",
|
|
4558
|
+
cancel: "Cancelar",
|
|
4559
|
+
confirming: "Confirmando…",
|
|
4560
|
+
cancelling: "Cancelando…",
|
|
4561
|
+
verifying: "Verificando o status…",
|
|
4562
|
+
expiresIn: "Expira em {{minutes}} min",
|
|
4563
|
+
expiresSoon: "Expira em menos de um minuto",
|
|
4564
|
+
statusExecuting: "Executando…",
|
|
4565
|
+
statusExecuted: "Concluído",
|
|
4566
|
+
statusRejected: "Cancelada",
|
|
4567
|
+
statusExpired: "Expirada: peça novamente no chat",
|
|
4568
|
+
statusSuperseded: "Substituída por uma versão mais recente",
|
|
4569
|
+
statusInvalidated: "Não pode mais ser executada: peça novamente",
|
|
4570
|
+
statusFailed: "Falhou",
|
|
4571
|
+
statusUnknown: "Resultado desconhecido: verifique antes de tentar de novo",
|
|
4572
|
+
statusNotFound: "Indisponível nesta conversa",
|
|
4573
|
+
toolUnavailable: "A ferramenta desta ação não está disponível agora",
|
|
4574
|
+
decisionError: "Não foi possível enviar sua decisão. Tente novamente."
|
|
4355
4575
|
}
|
|
4356
4576
|
};
|
|
4357
4577
|
function getPersonalConnectorCopy(locale) {
|
|
@@ -4364,6 +4584,153 @@ function fillCopy(template, values) {
|
|
|
4364
4584
|
return template.replace(/\{\{(\w+)\}\}/g, (match, key) => key in values ? String(values[key]) : match);
|
|
4365
4585
|
}
|
|
4366
4586
|
|
|
4587
|
+
//#endregion
|
|
4588
|
+
//#region src/components/tool-confirmation-controls.tsx
|
|
4589
|
+
const MINUTE = 6e4;
|
|
4590
|
+
/** Re-renders every `intervalMs` while `active`, for countdowns. */
|
|
4591
|
+
function useNow(active, intervalMs = 15e3) {
|
|
4592
|
+
const [now, setNow] = useState(() => Date.now());
|
|
4593
|
+
useEffect(() => {
|
|
4594
|
+
if (!active) return;
|
|
4595
|
+
setNow(Date.now());
|
|
4596
|
+
const timer = setInterval(() => setNow(Date.now()), intervalMs);
|
|
4597
|
+
return () => clearInterval(timer);
|
|
4598
|
+
}, [active, intervalMs]);
|
|
4599
|
+
return now;
|
|
4600
|
+
}
|
|
4601
|
+
/** Server state of a held action, with expiry kept current. */
|
|
4602
|
+
function useToolConfirmationState(pending, toolConfirmation) {
|
|
4603
|
+
const now = useNow((pending ? toolConfirmation?.states.items[pending.action_id] : void 0)?.status === "pending");
|
|
4604
|
+
return toolConfirmation && pending ? toolConfirmationAt(toolConfirmation.states, pending.action_id, now) : void 0;
|
|
4605
|
+
}
|
|
4606
|
+
function verbFor(operation, copy) {
|
|
4607
|
+
switch (operation) {
|
|
4608
|
+
case "send": return copy.confirmSend;
|
|
4609
|
+
case "create": return copy.confirmCreate;
|
|
4610
|
+
case "update": return copy.confirmUpdate;
|
|
4611
|
+
case "delete": return copy.confirmDelete;
|
|
4612
|
+
default: return copy.confirmGeneric;
|
|
4613
|
+
}
|
|
4614
|
+
}
|
|
4615
|
+
const STATUS_COPY = {
|
|
4616
|
+
executing: "statusExecuting",
|
|
4617
|
+
executed: "statusExecuted",
|
|
4618
|
+
rejected: "statusRejected",
|
|
4619
|
+
expired: "statusExpired",
|
|
4620
|
+
superseded: "statusSuperseded",
|
|
4621
|
+
invalidated: "statusInvalidated",
|
|
4622
|
+
failed: "statusFailed",
|
|
4623
|
+
unknown: "statusUnknown",
|
|
4624
|
+
not_found: "statusNotFound"
|
|
4625
|
+
};
|
|
4626
|
+
function statusLabel(status, copy) {
|
|
4627
|
+
const key = STATUS_COPY[status];
|
|
4628
|
+
return key ? copy[key] : null;
|
|
4629
|
+
}
|
|
4630
|
+
const BADGE_TONE = {
|
|
4631
|
+
pending: "border-amber-200 bg-amber-50 text-amber-800",
|
|
4632
|
+
executing: "border-sky-200 bg-sky-50 text-sky-800",
|
|
4633
|
+
executed: "border-emerald-200 bg-emerald-50 text-emerald-800",
|
|
4634
|
+
failed: "border-rose-200 bg-rose-50 text-rose-800",
|
|
4635
|
+
unknown: "border-amber-300 bg-amber-50 text-amber-900"
|
|
4636
|
+
};
|
|
4637
|
+
/** Header badge of a held action: "Awaiting your confirmation" or its outcome. */
|
|
4638
|
+
function ConfirmationBadge({ state, copy }) {
|
|
4639
|
+
const status = state?.status ?? "pending";
|
|
4640
|
+
const label = status === "pending" ? copy.awaitingConfirmation : statusLabel(status, copy);
|
|
4641
|
+
const Icon = status === "executed" ? CheckCircle2 : status === "failed" ? XCircle : status === "executing" ? LoaderCircle : Clock;
|
|
4642
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
4643
|
+
className: joinClasses("ml-auto inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 font-medium", BADGE_TONE[status] ?? "border-neutral-200 bg-neutral-50 text-neutral-700"),
|
|
4644
|
+
"data-confirmation-status": status,
|
|
4645
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
4646
|
+
className: joinClasses("h-3 w-3", status === "executing" ? "animate-spin" : void 0),
|
|
4647
|
+
"aria-hidden": "true"
|
|
4648
|
+
}), label]
|
|
4649
|
+
});
|
|
4650
|
+
}
|
|
4651
|
+
function expiryText(state, serverOffsetMs, now, copy) {
|
|
4652
|
+
if (!state.expiresAt) return null;
|
|
4653
|
+
const left = Date.parse(state.expiresAt) - (now + serverOffsetMs);
|
|
4654
|
+
if (Number.isNaN(left) || left <= 0) return null;
|
|
4655
|
+
return left < MINUTE ? copy.expiresSoon : fillCopy(copy.expiresIn, { minutes: Math.floor(left / MINUTE) });
|
|
4656
|
+
}
|
|
4657
|
+
/**
|
|
4658
|
+
* Footer of a held action. Without `toolConfirmation` it keeps the text hint
|
|
4659
|
+
* (reply "yes"); with it, buttons once the server state is known.
|
|
4660
|
+
*/
|
|
4661
|
+
function PendingConfirmationFooter({ pending, toolConfirmation, copy }) {
|
|
4662
|
+
const state = useToolConfirmationState(pending, toolConfirmation);
|
|
4663
|
+
const now = useNow(state?.status === "pending");
|
|
4664
|
+
const [sending, setSending] = useState(null);
|
|
4665
|
+
const [failed, setFailed] = useState(false);
|
|
4666
|
+
if (!toolConfirmation) return /* @__PURE__ */ jsx("p", {
|
|
4667
|
+
className: "border-t border-amber-100 bg-amber-50/60 px-3 py-2 text-xs text-neutral-700",
|
|
4668
|
+
children: copy.confirmHint
|
|
4669
|
+
});
|
|
4670
|
+
if (!state) return /* @__PURE__ */ jsx("p", {
|
|
4671
|
+
className: "border-t border-neutral-100 bg-neutral-50 px-3 py-2 text-xs text-neutral-500",
|
|
4672
|
+
"aria-live": "polite",
|
|
4673
|
+
children: copy.verifying
|
|
4674
|
+
});
|
|
4675
|
+
if (state.status !== "pending") {
|
|
4676
|
+
const label = statusLabel(state.status, copy);
|
|
4677
|
+
return label ? /* @__PURE__ */ jsxs("p", {
|
|
4678
|
+
className: "border-t border-neutral-100 bg-neutral-50 px-3 py-2 text-xs text-neutral-700",
|
|
4679
|
+
"aria-live": "polite",
|
|
4680
|
+
children: [label, state.status === "failed" && state.error ? `: ${state.error}` : null]
|
|
4681
|
+
}) : null;
|
|
4682
|
+
}
|
|
4683
|
+
const decide = async (decision) => {
|
|
4684
|
+
setSending(decision);
|
|
4685
|
+
setFailed(false);
|
|
4686
|
+
try {
|
|
4687
|
+
await toolConfirmation.decide([{
|
|
4688
|
+
action_id: pending.action_id,
|
|
4689
|
+
decision
|
|
4690
|
+
}]);
|
|
4691
|
+
} catch {
|
|
4692
|
+
setFailed(true);
|
|
4693
|
+
} finally {
|
|
4694
|
+
setSending(null);
|
|
4695
|
+
}
|
|
4696
|
+
};
|
|
4697
|
+
const disabled = Boolean(toolConfirmation.disabled) || sending !== null;
|
|
4698
|
+
const destructive = pending.operation === "delete";
|
|
4699
|
+
const expiry = expiryText(state, toolConfirmation.states.serverOffsetMs, now, copy);
|
|
4700
|
+
const unavailable = state.error === "tool_unavailable";
|
|
4701
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
4702
|
+
className: "flex flex-wrap items-center gap-2 border-t border-amber-100 bg-amber-50/60 px-3 py-2",
|
|
4703
|
+
"data-confirmation-actions": pending.action_id,
|
|
4704
|
+
children: [
|
|
4705
|
+
state.canConfirm ? /* @__PURE__ */ jsxs("button", {
|
|
4706
|
+
type: "button",
|
|
4707
|
+
disabled,
|
|
4708
|
+
onClick: () => void decide("confirm"),
|
|
4709
|
+
className: joinClasses("inline-flex items-center rounded-md px-3 py-1.5 text-xs font-medium text-white disabled:opacity-50", destructive ? "bg-rose-600 hover:bg-rose-700" : "bg-neutral-900 hover:bg-neutral-800"),
|
|
4710
|
+
children: [sending === "confirm" ? /* @__PURE__ */ jsx(LoaderCircle, {
|
|
4711
|
+
className: "mr-2 size-3 animate-spin",
|
|
4712
|
+
"aria-hidden": "true"
|
|
4713
|
+
}) : null, sending === "confirm" ? copy.confirming : verbFor(pending.operation, copy)]
|
|
4714
|
+
}) : null,
|
|
4715
|
+
state.canReject ? /* @__PURE__ */ jsxs("button", {
|
|
4716
|
+
type: "button",
|
|
4717
|
+
disabled,
|
|
4718
|
+
onClick: () => void decide("reject"),
|
|
4719
|
+
className: "inline-flex items-center rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-xs font-medium text-neutral-800 hover:bg-neutral-50 disabled:opacity-50",
|
|
4720
|
+
children: [sending === "reject" ? /* @__PURE__ */ jsx(LoaderCircle, {
|
|
4721
|
+
className: "mr-2 size-3 animate-spin",
|
|
4722
|
+
"aria-hidden": "true"
|
|
4723
|
+
}) : null, sending === "reject" ? copy.cancelling : copy.cancel]
|
|
4724
|
+
}) : null,
|
|
4725
|
+
/* @__PURE__ */ jsx("span", {
|
|
4726
|
+
className: "ml-auto text-xs text-neutral-600",
|
|
4727
|
+
"aria-live": "polite",
|
|
4728
|
+
children: failed ? copy.decisionError : unavailable ? copy.toolUnavailable : expiry
|
|
4729
|
+
})
|
|
4730
|
+
]
|
|
4731
|
+
});
|
|
4732
|
+
}
|
|
4733
|
+
|
|
4367
4734
|
//#endregion
|
|
4368
4735
|
//#region src/components/tool-result-personal-connector-card.tsx
|
|
4369
4736
|
const COLLAPSED_ITEMS = 5;
|
|
@@ -4962,28 +5329,15 @@ function PendingEventView({ operation, pending, locale, copy }) {
|
|
|
4962
5329
|
]
|
|
4963
5330
|
});
|
|
4964
5331
|
}
|
|
4965
|
-
function PendingBadge({ copy }) {
|
|
4966
|
-
return /* @__PURE__ */ jsxs("span", {
|
|
4967
|
-
className: "ml-auto inline-flex shrink-0 items-center gap-1 rounded-full border border-amber-200 bg-amber-50 px-2 py-0.5 font-medium text-amber-800",
|
|
4968
|
-
children: [/* @__PURE__ */ jsx(Clock, {
|
|
4969
|
-
className: "h-3 w-3",
|
|
4970
|
-
"aria-hidden": "true"
|
|
4971
|
-
}), copy.awaitingConfirmation]
|
|
4972
|
-
});
|
|
4973
|
-
}
|
|
4974
|
-
function PendingFooter({ copy }) {
|
|
4975
|
-
return /* @__PURE__ */ jsx("p", {
|
|
4976
|
-
className: "border-t border-amber-100 bg-amber-50/60 px-3 py-2 text-xs text-neutral-700",
|
|
4977
|
-
children: copy.confirmHint
|
|
4978
|
-
});
|
|
4979
|
-
}
|
|
4980
5332
|
function headerCount(view, copy) {
|
|
4981
5333
|
if (view.kind === "mail-list") return count(copy, view.messages.length, copy.emailCountOne, copy.emailCountOther);
|
|
4982
5334
|
if (view.kind === "events") return count(copy, view.events.length, copy.eventCountOne, copy.eventCountOther);
|
|
4983
5335
|
return null;
|
|
4984
5336
|
}
|
|
4985
|
-
function ToolResultPersonalConnectorCard({ part, locale, className }) {
|
|
5337
|
+
function ToolResultPersonalConnectorCard({ part, locale, className, toolConfirmation }) {
|
|
4986
5338
|
const view = getView(part);
|
|
5339
|
+
const pending = view?.kind === "pending-mail" || view?.kind === "pending-event" ? view.pending : null;
|
|
5340
|
+
const confirmationState = useToolConfirmationState(pending, toolConfirmation);
|
|
4987
5341
|
if (!view) return null;
|
|
4988
5342
|
const copy = getPersonalConnectorCopy(locale);
|
|
4989
5343
|
const connector = getConnector(part);
|
|
@@ -5011,7 +5365,10 @@ function ToolResultPersonalConnectorCard({ part, locale, className }) {
|
|
|
5011
5365
|
className: "min-w-0 truncate border-neutral-500 border px-2 py-0.5 rounded-md text-xs text-neutral-500",
|
|
5012
5366
|
children: connector.account_email
|
|
5013
5367
|
}) : null,
|
|
5014
|
-
isPending ? /* @__PURE__ */ jsx(
|
|
5368
|
+
isPending ? /* @__PURE__ */ jsx(ConfirmationBadge, {
|
|
5369
|
+
state: confirmationState,
|
|
5370
|
+
copy
|
|
5371
|
+
}) : total ? /* @__PURE__ */ jsx("span", {
|
|
5015
5372
|
className: "ml-auto shrink-0",
|
|
5016
5373
|
children: total
|
|
5017
5374
|
}) : null
|
|
@@ -5042,7 +5399,11 @@ function ToolResultPersonalConnectorCard({ part, locale, className }) {
|
|
|
5042
5399
|
view,
|
|
5043
5400
|
copy
|
|
5044
5401
|
}),
|
|
5045
|
-
|
|
5402
|
+
pending ? /* @__PURE__ */ jsx(PendingConfirmationFooter, {
|
|
5403
|
+
pending,
|
|
5404
|
+
toolConfirmation,
|
|
5405
|
+
copy
|
|
5406
|
+
}) : null
|
|
5046
5407
|
]
|
|
5047
5408
|
});
|
|
5048
5409
|
}
|
|
@@ -5066,24 +5427,31 @@ function ConfirmedActionRow({ action, copy }) {
|
|
|
5066
5427
|
const operation = typeof metadata?.action === "string" ? metadata.action : "";
|
|
5067
5428
|
const doneKey = DONE_LABELS[operation];
|
|
5068
5429
|
const failed = action.status === "failed";
|
|
5069
|
-
const
|
|
5430
|
+
const executed = action.status === "executed";
|
|
5431
|
+
const label = doneKey ? copy[doneKey] : fillCopy(copy.actionDone, { tool: action.tool_name ?? "" });
|
|
5070
5432
|
const link = text(asRecord(metadata?.result)?.link);
|
|
5433
|
+
const outcome = action.error === "tool_unavailable" ? copy.toolUnavailable : statusLabel(action.status, copy);
|
|
5434
|
+
const title = executed ? label : failed ? `${copy.actionFailed}: ${label}` : action.tool_name ? `${outcome}: ${action.tool_name}` : outcome;
|
|
5071
5435
|
return /* @__PURE__ */ jsxs("li", {
|
|
5072
5436
|
className: "flex items-start gap-2 px-3 py-2",
|
|
5437
|
+
"data-confirmation-status": action.status,
|
|
5073
5438
|
children: [
|
|
5074
5439
|
failed ? /* @__PURE__ */ jsx(XCircle, {
|
|
5075
5440
|
className: "mt-0.5 h-4 w-4 shrink-0 text-rose-600",
|
|
5076
5441
|
"aria-hidden": "true"
|
|
5077
|
-
}) : /* @__PURE__ */ jsx(CheckCircle2, {
|
|
5442
|
+
}) : executed ? /* @__PURE__ */ jsx(CheckCircle2, {
|
|
5078
5443
|
className: "mt-0.5 h-4 w-4 shrink-0 text-emerald-600",
|
|
5079
5444
|
"aria-hidden": "true"
|
|
5445
|
+
}) : /* @__PURE__ */ jsx(Clock, {
|
|
5446
|
+
className: "mt-0.5 h-4 w-4 shrink-0 text-neutral-500",
|
|
5447
|
+
"aria-hidden": "true"
|
|
5080
5448
|
}),
|
|
5081
5449
|
/* @__PURE__ */ jsxs("div", {
|
|
5082
5450
|
className: "min-w-0 flex-1 space-y-0.5",
|
|
5083
5451
|
children: [
|
|
5084
5452
|
/* @__PURE__ */ jsx("p", {
|
|
5085
5453
|
className: "text-sm font-medium text-neutral-950",
|
|
5086
|
-
children:
|
|
5454
|
+
children: title
|
|
5087
5455
|
}),
|
|
5088
5456
|
connector ? /* @__PURE__ */ jsxs("div", {
|
|
5089
5457
|
className: "flex items-center gap-2 truncate text-xs text-neutral-500",
|
|
@@ -5098,7 +5466,7 @@ function ConfirmedActionRow({ action, copy }) {
|
|
|
5098
5466
|
}) : null
|
|
5099
5467
|
]
|
|
5100
5468
|
}),
|
|
5101
|
-
|
|
5469
|
+
executed && link ? /* @__PURE__ */ jsx(ExternalAnchor, {
|
|
5102
5470
|
href: link,
|
|
5103
5471
|
className: "shrink-0",
|
|
5104
5472
|
children: operation === "send" ? copy.openEmail : copy.openEvent
|
|
@@ -5129,8 +5497,9 @@ function formatValue(value) {
|
|
|
5129
5497
|
return JSON.stringify(value, null, 2);
|
|
5130
5498
|
}
|
|
5131
5499
|
/** Generic preview of a held tool call: its name and the exact arguments. */
|
|
5132
|
-
function ToolResultPendingConfirmationCard({ part, locale, className }) {
|
|
5500
|
+
function ToolResultPendingConfirmationCard({ part, locale, className, toolConfirmation }) {
|
|
5133
5501
|
const pending = getPendingConfirmation(part);
|
|
5502
|
+
const confirmationState = useToolConfirmationState(pending, toolConfirmation);
|
|
5134
5503
|
if (!pending) return null;
|
|
5135
5504
|
const copy = getPersonalConnectorCopy(locale);
|
|
5136
5505
|
const entries = Object.entries(pending.action).filter(([key, value]) => key !== "operation" && value !== null && value !== void 0);
|
|
@@ -5144,7 +5513,10 @@ function ToolResultPendingConfirmationCard({ part, locale, className }) {
|
|
|
5144
5513
|
children: [/* @__PURE__ */ jsx("span", {
|
|
5145
5514
|
className: "truncate font-mono font-medium text-neutral-900",
|
|
5146
5515
|
children: part.name
|
|
5147
|
-
}), /* @__PURE__ */ jsx(
|
|
5516
|
+
}), /* @__PURE__ */ jsx(ConfirmationBadge, {
|
|
5517
|
+
state: confirmationState,
|
|
5518
|
+
copy
|
|
5519
|
+
})]
|
|
5148
5520
|
}),
|
|
5149
5521
|
entries.length > 0 ? /* @__PURE__ */ jsx("dl", {
|
|
5150
5522
|
className: "space-y-1.5 px-3 py-3",
|
|
@@ -5156,7 +5528,11 @@ function ToolResultPendingConfirmationCard({ part, locale, className }) {
|
|
|
5156
5528
|
})
|
|
5157
5529
|
}, key))
|
|
5158
5530
|
}) : null,
|
|
5159
|
-
/* @__PURE__ */ jsx(
|
|
5531
|
+
/* @__PURE__ */ jsx(PendingConfirmationFooter, {
|
|
5532
|
+
pending,
|
|
5533
|
+
toolConfirmation,
|
|
5534
|
+
copy
|
|
5535
|
+
})
|
|
5160
5536
|
]
|
|
5161
5537
|
});
|
|
5162
5538
|
}
|
|
@@ -5484,7 +5860,7 @@ function getDatasourceResources$1(part) {
|
|
|
5484
5860
|
const resources = part.metadata.resources;
|
|
5485
5861
|
return Array.isArray(resources) ? resources.filter(isDatasourceResource) : [];
|
|
5486
5862
|
}
|
|
5487
|
-
function ToolResultCard({ part, className, detailsOpen = true, locale, onOpenAgentThread, getResourceDownloadUrl, memoryProposal }) {
|
|
5863
|
+
function ToolResultCard({ part, className, detailsOpen = true, locale, onOpenAgentThread, getResourceDownloadUrl, memoryProposal, toolConfirmation }) {
|
|
5488
5864
|
const copy = getUiCopy(locale);
|
|
5489
5865
|
if (part.toolType === "memory_proposal") {
|
|
5490
5866
|
const proposal = part.metadata?.proposal;
|
|
@@ -5515,7 +5891,8 @@ function ToolResultCard({ part, className, detailsOpen = true, locale, onOpenAge
|
|
|
5515
5891
|
if (part.toolType !== "personal_connector" && getPendingConfirmation(part)) return /* @__PURE__ */ jsx(ToolResultPendingConfirmationCard, {
|
|
5516
5892
|
part,
|
|
5517
5893
|
locale,
|
|
5518
|
-
className
|
|
5894
|
+
className,
|
|
5895
|
+
toolConfirmation
|
|
5519
5896
|
});
|
|
5520
5897
|
const officeMediaFiles = getOfficeDocumentMediaFiles(part);
|
|
5521
5898
|
const datasourceResources = getDatasourceResources$1(part);
|
|
@@ -5558,7 +5935,8 @@ function ToolResultCard({ part, className, detailsOpen = true, locale, onOpenAge
|
|
|
5558
5935
|
if (part.toolType === "personal_connector" && hasPersonalConnectorView(part)) return /* @__PURE__ */ jsx(ToolResultPersonalConnectorCard, {
|
|
5559
5936
|
part,
|
|
5560
5937
|
locale,
|
|
5561
|
-
className
|
|
5938
|
+
className,
|
|
5939
|
+
toolConfirmation
|
|
5562
5940
|
});
|
|
5563
5941
|
if (part.toolType === "workflow_dispatch") return /* @__PURE__ */ jsx(ToolResultWorkflowDispatchCard, {
|
|
5564
5942
|
part,
|
|
@@ -5783,7 +6161,7 @@ function getMessageTextClassName(role) {
|
|
|
5783
6161
|
function getMessageTextAlignmentClassName(role) {
|
|
5784
6162
|
return role === "user" ? "text-right" : "text-left";
|
|
5785
6163
|
}
|
|
5786
|
-
function renderPart(part, index, message, isStreaming, onOpenAgentThread, getResourceDownloadUrl, locale, memoryProposal, renderText, renderToolCall, renderThinking, thinkingLabel, completedThinkingLabel, textClassName) {
|
|
6164
|
+
function renderPart(part, index, message, isStreaming, onOpenAgentThread, getResourceDownloadUrl, locale, memoryProposal, renderText, renderToolCall, renderThinking, thinkingLabel, completedThinkingLabel, textClassName, toolConfirmation) {
|
|
5787
6165
|
const copy = getUiCopy(locale);
|
|
5788
6166
|
if (part.type === "text") {
|
|
5789
6167
|
if (renderText) return /* @__PURE__ */ jsx("div", { children: renderText(part, {
|
|
@@ -5842,7 +6220,8 @@ function renderPart(part, index, message, isStreaming, onOpenAgentThread, getRes
|
|
|
5842
6220
|
locale,
|
|
5843
6221
|
onOpenAgentThread,
|
|
5844
6222
|
getResourceDownloadUrl,
|
|
5845
|
-
memoryProposal
|
|
6223
|
+
memoryProposal,
|
|
6224
|
+
toolConfirmation
|
|
5846
6225
|
}, `tool-${part.id}-${index}`);
|
|
5847
6226
|
}
|
|
5848
6227
|
if (part.type === "thinking") {
|
|
@@ -5899,7 +6278,7 @@ function aggregateSourceToolParts(parts, position) {
|
|
|
5899
6278
|
...remainingParts.slice(insertionIndex)
|
|
5900
6279
|
];
|
|
5901
6280
|
}
|
|
5902
|
-
function MessageParts({ message, collapseThreshold = DEFAULT_COLLAPSE_THRESHOLD, sourceToolResultsLayout = "aggregated", sourceToolResultsPosition, maxVisibleSourceCards = 3, datasourceToolResultsPosition, onOpenAgentThread, getResourceDownloadUrl, locale, memoryProposal, renderText, renderToolCall, renderThinking, isStreaming = false, thinkingLabel, completedThinkingLabel, readMoreLabel, readLessLabel, className,...props }) {
|
|
6281
|
+
function MessageParts({ message, collapseThreshold = DEFAULT_COLLAPSE_THRESHOLD, sourceToolResultsLayout = "aggregated", sourceToolResultsPosition, maxVisibleSourceCards = 3, datasourceToolResultsPosition, onOpenAgentThread, getResourceDownloadUrl, locale, memoryProposal, toolConfirmation, renderText, renderToolCall, renderThinking, isStreaming = false, thinkingLabel, completedThinkingLabel, readMoreLabel, readLessLabel, className,...props }) {
|
|
5903
6282
|
const copy = getUiCopy(locale);
|
|
5904
6283
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
5905
6284
|
const textContent = useMemo(() => message.parts.filter((part) => part.type === "text").map((part) => part.text).join("\n"), [message.parts]);
|
|
@@ -5930,7 +6309,7 @@ function MessageParts({ message, collapseThreshold = DEFAULT_COLLAPSE_THRESHOLD,
|
|
|
5930
6309
|
locale,
|
|
5931
6310
|
maxVisible: maxVisibleSourceCards,
|
|
5932
6311
|
getResourceDownloadUrl
|
|
5933
|
-
}, `source-results-${item.index}`) : renderPart(item.part, item.index, message, isStreaming, onOpenAgentThread, getResourceDownloadUrl, locale, memoryProposal, renderText, renderToolCall, renderThinking, thinkingLabel, completedThinkingLabel, textClassName)), canCollapse ? /* @__PURE__ */ jsx("button", {
|
|
6312
|
+
}, `source-results-${item.index}`) : renderPart(item.part, item.index, message, isStreaming, onOpenAgentThread, getResourceDownloadUrl, locale, memoryProposal, renderText, renderToolCall, renderThinking, thinkingLabel, completedThinkingLabel, textClassName, toolConfirmation)), canCollapse ? /* @__PURE__ */ jsx("button", {
|
|
5934
6313
|
type: "button",
|
|
5935
6314
|
className: "text-xs font-medium text-slate-600 hover:text-slate-900",
|
|
5936
6315
|
onClick: () => setIsExpanded((previous) => !previous),
|
|
@@ -6020,6 +6399,7 @@ function isRoutedMessageProps(props) {
|
|
|
6020
6399
|
function Message(props) {
|
|
6021
6400
|
if (!isRoutedMessageProps(props)) return /* @__PURE__ */ jsx(MessageRoot, { ...props });
|
|
6022
6401
|
const { message, avatar, footer, messageClassName, contentClassName, partsClassName, toolResultsClassName, toolPartsClassName, messagePartsProps, getResourceDownloadUrl, className,...rootProps } = props;
|
|
6402
|
+
if (isHiddenMessage(message)) return null;
|
|
6023
6403
|
const routedMessagePartsProps = getResourceDownloadUrl ? {
|
|
6024
6404
|
...messagePartsProps,
|
|
6025
6405
|
getResourceDownloadUrl
|
|
@@ -6660,5 +7040,5 @@ async function dummyTranscribeAudio(_audio, signal) {
|
|
|
6660
7040
|
}
|
|
6661
7041
|
|
|
6662
7042
|
//#endregion
|
|
6663
|
-
export { AggregatedSourceResults, ArrowUp, AssistantMessage, ChatError, Clipboard, DatasourceFolderCard, DatasourceToolResources, DatasourceToolResultCard, Loader, MemoryProposalCard, Message, MessageAvatar, MessageContent, MessageFooter, MessageHeader, MessageParts, MessageRoot, Microphone, PROMPT_FORM_FILE_ACCEPT, Paperclip, PromptForm, PromptFormAttachButton, PromptFormIconButton, Reload, ResourceCard, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, SpeechToTextToggle, Stop, Thinking, ThumbDown, ThumbUp, ToolError, ToolResultAgentInvocationCard, ToolResultBrowserCard, ToolResultCard, ToolResultExternalDatasourceCard, ToolResultHttpRequestCard, ToolResultMcpCard, ToolResultOfficeDocumentsCard, ToolResultPendingConfirmationCard, ToolResultPersonalConnectorCard, ToolResultToolConfirmationCard, ToolResultWebSearchCard, ToolResultWorkflowDispatchCard, ToolUseIndicator, UserMessage, X, dummyTranscribeAudio, getLocalizedOpenGraphValue, getPendingConfirmation, getResourceDescription, getResourceIcon, getResourceOpenGraphImage, getResourceOpenGraphType, getResourceTitle, getResourceType, getResourceUrl, getToolUseLabel, hasPersonalConnectorView, hasToolConfirmationView, isAllowedPromptFormFile, partitionPromptFormFiles, useSpeechToText };
|
|
7043
|
+
export { AggregatedSourceResults, ArrowUp, AssistantMessage, ChatError, Clipboard, ConfirmationBadge, DatasourceFolderCard, DatasourceToolResources, DatasourceToolResultCard, Loader, MemoryProposalCard, Message, MessageAvatar, MessageContent, MessageFooter, MessageHeader, MessageParts, MessageRoot, Microphone, PROMPT_FORM_FILE_ACCEPT, Paperclip, PendingConfirmationFooter, PromptForm, PromptFormAttachButton, PromptFormIconButton, Reload, ResourceCard, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, SpeechToTextToggle, Stop, Thinking, ThumbDown, ThumbUp, ToolError, ToolResultAgentInvocationCard, ToolResultBrowserCard, ToolResultCard, ToolResultExternalDatasourceCard, ToolResultHttpRequestCard, ToolResultMcpCard, ToolResultOfficeDocumentsCard, ToolResultPendingConfirmationCard, ToolResultPersonalConnectorCard, ToolResultToolConfirmationCard, ToolResultWebSearchCard, ToolResultWorkflowDispatchCard, ToolUseIndicator, UserMessage, X, dummyTranscribeAudio, getLocalizedOpenGraphValue, getPendingConfirmation, getResourceDescription, getResourceIcon, getResourceOpenGraphImage, getResourceOpenGraphType, getResourceTitle, getResourceType, getResourceUrl, getToolUseLabel, hasPersonalConnectorView, hasToolConfirmationView, isAllowedPromptFormFile, partitionPromptFormFiles, useSpeechToText };
|
|
6664
7044
|
//# sourceMappingURL=index.js.map
|