@plaisolutions/react 0.21.0 → 0.22.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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { HttpStatusError, OPEN_TOOL_CONFIRMATION_STATUSES, PlaiChat, ToolDecisionRejectedError, isHiddenMessage, pendingActionIds, toolConfirmationAt } from "@plaisolutions/client";
1
+ import { HttpStatusError, OPEN_TOOL_CONFIRMATION_STATUSES, PlaiChat, ToolDecisionRejectedError, ToolSubmissionConflictError, isHiddenMessage, pendingActionIds, toolConfirmationAt } from "@plaisolutions/client";
2
2
  import { createContext, forwardRef, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
3
3
  import { ArrowUpRight, Bot, Brain, CalendarDays, Check, CheckCircle2, ChevronDown, ChevronUp, CircleAlert, CircleX, Clock, Copy, Database, Download, File, FileText, Globe, LoaderCircle, Mail, MessageSquare, Paperclip as Paperclip$1, Plug, RotateCcw, ThumbsDown, ThumbsUp, Video, Workflow, X as X$1, XCircle } from "lucide-react";
4
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -4377,7 +4377,17 @@ const ENGLISH = {
4377
4377
  errorEndBeforeStart: "The end must be after the start",
4378
4378
  editNoLongerApplies: "Your changes no longer apply to this action. Review them and try again.",
4379
4379
  editedLabel: "Edited",
4380
- seeNewerVersion: "See the newer version"
4380
+ seeNewerVersion: "See the newer version",
4381
+ invalidatedConfigurationChanged: "The tool, account or its settings changed after this was prepared. Ask again in the chat.",
4382
+ invalidatedNoSnapshot: "This action was prepared by an older version and can’t run. Ask again in the chat.",
4383
+ invalidatedResourceChanged: "The event changed after this was prepared, so nothing was modified. Ask again in the chat.",
4384
+ unknownOutcome: "The provider didn’t confirm whether it happened. Check your sent mail or calendar before trying again.",
4385
+ unknownInterrupted: "The action was interrupted and it isn’t known whether it happened. Check your account before trying again.",
4386
+ applyingNow: "This is already being applied…",
4387
+ errorPlainText: "Use plain text, without HTML",
4388
+ errorOffsetMismatch: "The UTC offset doesn’t match the time zone of the event",
4389
+ errorNotEditable: "This field can’t be edited",
4390
+ errorInvalidValue: "This value isn’t valid"
4381
4391
  };
4382
4392
  const COPY = {
4383
4393
  en: {},
@@ -4469,7 +4479,17 @@ const COPY = {
4469
4479
  errorEndBeforeStart: "El final debe ser posterior al inicio",
4470
4480
  editNoLongerApplies: "Tus cambios ya no se aplican a esta acción. Revísalos e inténtalo de nuevo.",
4471
4481
  editedLabel: "Editada",
4472
- seeNewerVersion: "Ver la versión más reciente"
4482
+ seeNewerVersion: "Ver la versión más reciente",
4483
+ invalidatedConfigurationChanged: "La herramienta, la cuenta o su configuración cambiaron después de preparar esto. Pídelo de nuevo en el chat.",
4484
+ invalidatedNoSnapshot: "Esta acción la preparó una versión anterior y no se puede ejecutar. Pídelo de nuevo en el chat.",
4485
+ invalidatedResourceChanged: "El evento cambió después de preparar esto, así que no se modificó nada. Pídelo de nuevo en el chat.",
4486
+ unknownOutcome: "El proveedor no confirmó si llegó a ocurrir. Comprueba tus enviados o tu calendario antes de intentarlo de nuevo.",
4487
+ unknownInterrupted: "La acción se interrumpió y no se sabe si llegó a ocurrir. Comprueba tu cuenta antes de intentarlo de nuevo.",
4488
+ applyingNow: "Ya se está aplicando…",
4489
+ errorPlainText: "Usa texto sin formato, sin HTML",
4490
+ errorOffsetMismatch: "El desfase UTC no coincide con la zona horaria del evento",
4491
+ errorNotEditable: "Este campo no se puede editar",
4492
+ errorInvalidValue: "Este valor no es válido"
4473
4493
  },
4474
4494
  ca: {
4475
4495
  searchingMail: "Cercant a {{service}}",
@@ -4559,7 +4579,17 @@ const COPY = {
4559
4579
  errorEndBeforeStart: "El final ha de ser posterior a l’inici",
4560
4580
  editNoLongerApplies: "Els teus canvis ja no s’apliquen a aquesta acció. Revisa’ls i torna-ho a provar.",
4561
4581
  editedLabel: "Editada",
4562
- seeNewerVersion: "Mostra la versió més recent"
4582
+ seeNewerVersion: "Mostra la versió més recent",
4583
+ invalidatedConfigurationChanged: "L’eina, el compte o la seva configuració han canviat després de preparar això. Torna-ho a demanar al xat.",
4584
+ invalidatedNoSnapshot: "Aquesta acció la va preparar una versió anterior i no es pot executar. Torna-ho a demanar al xat.",
4585
+ invalidatedResourceChanged: "L’esdeveniment ha canviat després de preparar això, així que no s’ha modificat res. Torna-ho a demanar al xat.",
4586
+ unknownOutcome: "El proveïdor no ha confirmat si va arribar a passar. Comprova els enviats o el calendari abans de tornar-ho a provar.",
4587
+ unknownInterrupted: "L’acció s’ha interromput i no se sap si va arribar a passar. Comprova el teu compte abans de tornar-ho a provar.",
4588
+ applyingNow: "Ja s’està aplicant…",
4589
+ errorPlainText: "Utilitza text sense format, sense HTML",
4590
+ errorOffsetMismatch: "El desfasament UTC no coincideix amb la zona horària de l’esdeveniment",
4591
+ errorNotEditable: "Aquest camp no es pot editar",
4592
+ errorInvalidValue: "Aquest valor no és vàlid"
4563
4593
  },
4564
4594
  fr: {
4565
4595
  searchingMail: "Recherche dans {{service}}",
@@ -4649,7 +4679,17 @@ const COPY = {
4649
4679
  errorEndBeforeStart: "La fin doit être postérieure au début",
4650
4680
  editNoLongerApplies: "Vos modifications ne s’appliquent plus à cette action. Vérifiez-les et réessayez.",
4651
4681
  editedLabel: "Modifiée",
4652
- seeNewerVersion: "Voir la version la plus récente"
4682
+ seeNewerVersion: "Voir la version la plus récente",
4683
+ invalidatedConfigurationChanged: "L’outil, le compte ou sa configuration ont changé après la préparation. Redemandez-le dans le chat.",
4684
+ invalidatedNoSnapshot: "Cette action a été préparée par une version antérieure et ne peut pas s’exécuter. Redemandez-la dans le chat.",
4685
+ invalidatedResourceChanged: "L’événement a changé après la préparation, donc rien n’a été modifié. Redemandez-le dans le chat.",
4686
+ unknownOutcome: "Le fournisseur n’a pas confirmé si cela a eu lieu. Vérifiez vos envois ou votre agenda avant de réessayer.",
4687
+ unknownInterrupted: "L’action a été interrompue et on ne sait pas si elle a eu lieu. Vérifiez votre compte avant de réessayer.",
4688
+ applyingNow: "Déjà en cours d’application…",
4689
+ errorPlainText: "Utilisez du texte brut, sans HTML",
4690
+ errorOffsetMismatch: "Le décalage UTC ne correspond pas au fuseau horaire de l’événement",
4691
+ errorNotEditable: "Ce champ ne peut pas être modifié",
4692
+ errorInvalidValue: "Cette valeur n’est pas valide"
4653
4693
  },
4654
4694
  it: {
4655
4695
  searchingMail: "Ricerca in {{service}}",
@@ -4739,7 +4779,17 @@ const COPY = {
4739
4779
  errorEndBeforeStart: "La fine deve essere successiva all’inizio",
4740
4780
  editNoLongerApplies: "Le tue modifiche non si applicano più a questa azione. Controllale e riprova.",
4741
4781
  editedLabel: "Modificata",
4742
- seeNewerVersion: "Vedi la versione più recente"
4782
+ seeNewerVersion: "Vedi la versione più recente",
4783
+ invalidatedConfigurationChanged: "Lo strumento, l’account o la sua configurazione sono cambiati dopo la preparazione. Chiedilo di nuovo nella chat.",
4784
+ invalidatedNoSnapshot: "Questa azione è stata preparata da una versione precedente e non può essere eseguita. Chiedilo di nuovo nella chat.",
4785
+ invalidatedResourceChanged: "L’evento è cambiato dopo la preparazione, quindi non è stato modificato nulla. Chiedilo di nuovo nella chat.",
4786
+ unknownOutcome: "Il provider non ha confermato se sia avvenuto. Controlla la posta inviata o il calendario prima di riprovare.",
4787
+ unknownInterrupted: "L’azione è stata interrotta e non si sa se sia avvenuta. Controlla il tuo account prima di riprovare.",
4788
+ applyingNow: "È già in corso di applicazione…",
4789
+ errorPlainText: "Usa testo semplice, senza HTML",
4790
+ errorOffsetMismatch: "Lo scostamento UTC non corrisponde al fuso orario dell’evento",
4791
+ errorNotEditable: "Questo campo non può essere modificato",
4792
+ errorInvalidValue: "Questo valore non è valido"
4743
4793
  },
4744
4794
  de: {
4745
4795
  searchingMail: "Suche in {{service}}",
@@ -4829,7 +4879,17 @@ const COPY = {
4829
4879
  errorEndBeforeStart: "Das Ende muss nach dem Beginn liegen",
4830
4880
  editNoLongerApplies: "Deine Änderungen gelten für diese Aktion nicht mehr. Prüfe sie und versuche es erneut.",
4831
4881
  editedLabel: "Bearbeitet",
4832
- seeNewerVersion: "Neuere Version ansehen"
4882
+ seeNewerVersion: "Neuere Version ansehen",
4883
+ invalidatedConfigurationChanged: "Das Tool, das Konto oder dessen Konfiguration haben sich nach der Vorbereitung geändert. Frag im Chat erneut an.",
4884
+ invalidatedNoSnapshot: "Diese Aktion wurde von einer älteren Version vorbereitet und kann nicht ausgeführt werden. Frag im Chat erneut an.",
4885
+ invalidatedResourceChanged: "Der Termin hat sich nach der Vorbereitung geändert, daher wurde nichts verändert. Frag im Chat erneut an.",
4886
+ unknownOutcome: "Der Anbieter hat nicht bestätigt, ob es passiert ist. Prüfe deine gesendeten Mails oder deinen Kalender, bevor du es erneut versuchst.",
4887
+ unknownInterrupted: "Die Aktion wurde unterbrochen und es ist nicht bekannt, ob sie ausgeführt wurde. Prüfe dein Konto, bevor du es erneut versuchst.",
4888
+ applyingNow: "Wird bereits angewendet…",
4889
+ errorPlainText: "Verwende reinen Text, ohne HTML",
4890
+ errorOffsetMismatch: "Der UTC-Versatz passt nicht zur Zeitzone des Termins",
4891
+ errorNotEditable: "Dieses Feld kann nicht bearbeitet werden",
4892
+ errorInvalidValue: "Dieser Wert ist ungültig"
4833
4893
  },
4834
4894
  da: {
4835
4895
  searchingMail: "Søger i {{service}}",
@@ -4919,7 +4979,17 @@ const COPY = {
4919
4979
  errorEndBeforeStart: "Slutningen skal være efter starten",
4920
4980
  editNoLongerApplies: "Dine ændringer gælder ikke længere for denne handling. Gennemgå dem og prøv igen.",
4921
4981
  editedLabel: "Redigeret",
4922
- seeNewerVersion: "Se den nyere version"
4982
+ seeNewerVersion: "Se den nyere version",
4983
+ invalidatedConfigurationChanged: "Værktøjet, kontoen eller dens konfiguration er ændret, efter at dette blev forberedt. Spørg igen i chatten.",
4984
+ invalidatedNoSnapshot: "Denne handling blev forberedt af en ældre version og kan ikke udføres. Spørg igen i chatten.",
4985
+ invalidatedResourceChanged: "Begivenheden er ændret, efter at dette blev forberedt, så intet blev ændret. Spørg igen i chatten.",
4986
+ unknownOutcome: "Udbyderen bekræftede ikke, om det skete. Tjek dine sendte mails eller din kalender, før du prøver igen.",
4987
+ unknownInterrupted: "Handlingen blev afbrudt, og det vides ikke, om den skete. Tjek din konto, før du prøver igen.",
4988
+ applyingNow: "Bliver allerede anvendt…",
4989
+ errorPlainText: "Brug almindelig tekst uden HTML",
4990
+ errorOffsetMismatch: "UTC-forskydningen passer ikke til begivenhedens tidszone",
4991
+ errorNotEditable: "Dette felt kan ikke redigeres",
4992
+ errorInvalidValue: "Denne værdi er ugyldig"
4923
4993
  },
4924
4994
  sv: {
4925
4995
  searchingMail: "Söker i {{service}}",
@@ -5009,7 +5079,17 @@ const COPY = {
5009
5079
  errorEndBeforeStart: "Slutet måste vara efter starten",
5010
5080
  editNoLongerApplies: "Dina ändringar gäller inte längre för den här åtgärden. Granska dem och försök igen.",
5011
5081
  editedLabel: "Redigerad",
5012
- seeNewerVersion: "Se den nyare versionen"
5082
+ seeNewerVersion: "Se den nyare versionen",
5083
+ invalidatedConfigurationChanged: "Verktyget, kontot eller dess inställningar ändrades efter att detta förbereddes. Fråga igen i chatten.",
5084
+ invalidatedNoSnapshot: "Den här åtgärden förbereddes av en äldre version och kan inte köras. Fråga igen i chatten.",
5085
+ invalidatedResourceChanged: "Händelsen ändrades efter att detta förbereddes, så inget ändrades. Fråga igen i chatten.",
5086
+ unknownOutcome: "Leverantören bekräftade inte om det hände. Kontrollera dina skickade mejl eller din kalender innan du försöker igen.",
5087
+ unknownInterrupted: "Åtgärden avbröts och det är inte känt om den hände. Kontrollera ditt konto innan du försöker igen.",
5088
+ applyingNow: "Tillämpas redan…",
5089
+ errorPlainText: "Använd vanlig text, utan HTML",
5090
+ errorOffsetMismatch: "UTC-förskjutningen stämmer inte med händelsens tidszon",
5091
+ errorNotEditable: "Det här fältet kan inte redigeras",
5092
+ errorInvalidValue: "Det här värdet är ogiltigt"
5013
5093
  },
5014
5094
  no: {
5015
5095
  searchingMail: "Søker i {{service}}",
@@ -5099,7 +5179,17 @@ const COPY = {
5099
5179
  errorEndBeforeStart: "Slutten må være etter starten",
5100
5180
  editNoLongerApplies: "Endringene dine gjelder ikke lenger for denne handlingen. Gå gjennom dem og prøv igjen.",
5101
5181
  editedLabel: "Redigert",
5102
- seeNewerVersion: "Se den nyere versjonen"
5182
+ seeNewerVersion: "Se den nyere versjonen",
5183
+ invalidatedConfigurationChanged: "Verktøyet, kontoen eller konfigurasjonen ble endret etter at dette ble forberedt. Spør igjen i chatten.",
5184
+ invalidatedNoSnapshot: "Denne handlingen ble forberedt av en eldre versjon og kan ikke kjøres. Spør igjen i chatten.",
5185
+ invalidatedResourceChanged: "Hendelsen ble endret etter at dette ble forberedt, så ingenting ble endret. Spør igjen i chatten.",
5186
+ unknownOutcome: "Leverandøren bekreftet ikke om det skjedde. Sjekk sendte e-poster eller kalenderen før du prøver igjen.",
5187
+ unknownInterrupted: "Handlingen ble avbrutt, og det er ikke kjent om den skjedde. Sjekk kontoen din før du prøver igjen.",
5188
+ applyingNow: "Blir allerede brukt…",
5189
+ errorPlainText: "Bruk vanlig tekst, uten HTML",
5190
+ errorOffsetMismatch: "UTC-forskyvningen stemmer ikke med hendelsens tidssone",
5191
+ errorNotEditable: "Dette feltet kan ikke redigeres",
5192
+ errorInvalidValue: "Denne verdien er ugyldig"
5103
5193
  },
5104
5194
  pt: {
5105
5195
  searchingMail: "Pesquisando no {{service}}",
@@ -5189,7 +5279,17 @@ const COPY = {
5189
5279
  errorEndBeforeStart: "O fim deve ser posterior ao início",
5190
5280
  editNoLongerApplies: "Suas alterações não se aplicam mais a esta ação. Revise-as e tente novamente.",
5191
5281
  editedLabel: "Editada",
5192
- seeNewerVersion: "Ver a versão mais recente"
5282
+ seeNewerVersion: "Ver a versão mais recente",
5283
+ invalidatedConfigurationChanged: "A ferramenta, a conta ou a configuração mudaram depois de preparar isto. Peça de novo no chat.",
5284
+ invalidatedNoSnapshot: "Esta ação foi preparada por uma versão anterior e não pode ser executada. Peça de novo no chat.",
5285
+ invalidatedResourceChanged: "O evento mudou depois de preparar isto, então nada foi modificado. Peça de novo no chat.",
5286
+ unknownOutcome: "O provedor não confirmou se aconteceu. Verifique seus enviados ou sua agenda antes de tentar de novo.",
5287
+ unknownInterrupted: "A ação foi interrompida e não se sabe se aconteceu. Verifique sua conta antes de tentar de novo.",
5288
+ applyingNow: "Já está sendo aplicado…",
5289
+ errorPlainText: "Use texto simples, sem HTML",
5290
+ errorOffsetMismatch: "O deslocamento UTC não corresponde ao fuso horário do evento",
5291
+ errorNotEditable: "Este campo não pode ser editado",
5292
+ errorInvalidValue: "Este valor não é válido"
5193
5293
  }
5194
5294
  };
5195
5295
  function getPersonalConnectorCopy(locale) {
@@ -5232,6 +5332,28 @@ function editableFields(pending) {
5232
5332
  const allowed = new Set(pending.editable ?? []);
5233
5333
  return FIELD_ORDER.filter((field) => allowed.has(field));
5234
5334
  }
5335
+ /**
5336
+ * Copy of each stable code the server sends for a rejected edit. A code this client does
5337
+ * not know falls back to the server's English message instead of hiding the problem.
5338
+ */
5339
+ const SERVER_ERROR_COPY = {
5340
+ needs_recipient: "errorNoRecipients",
5341
+ invalid_address: "errorInvalidAddress",
5342
+ must_be_address_list: "errorInvalidAddress",
5343
+ too_many_addresses: "errorInvalidAddress",
5344
+ cannot_be_empty: "errorRequired",
5345
+ cannot_be_null: "errorRequired",
5346
+ plain_text_only: "errorPlainText",
5347
+ invalid_datetime: "errorInvalidDateTime",
5348
+ ambiguous_time: "errorAmbiguousTime",
5349
+ end_before_start: "errorEndBeforeStart",
5350
+ offset_mismatch: "errorOffsetMismatch",
5351
+ not_editable: "errorNotEditable",
5352
+ cannot_change: "errorNotEditable",
5353
+ not_replaceable: "errorNotEditable",
5354
+ must_be_text: "errorInvalidValue",
5355
+ too_long: "errorInvalidValue"
5356
+ };
5235
5357
  const OFFSET_SUFFIX = /(Z|[+-]\d{2}:?\d{2})$/i;
5236
5358
  function parseOffsetMinutes(value) {
5237
5359
  const match = OFFSET_SUFFIX.exec(value.trim());
@@ -5468,7 +5590,9 @@ function ToolConfirmationEditForm({ pending, draft, onChange, errors, serverErro
5468
5590
  const id = `${baseId}-${field}`;
5469
5591
  const errorId = `${id}-error`;
5470
5592
  const clientError = errors[field];
5471
- const message = clientError ? fillCopy(copy[ERROR_COPY[clientError.key]], { zone: clientError.zone ?? zone }) : serverErrors[field];
5593
+ const serverError = serverErrors[field];
5594
+ const serverKey = serverError?.code ? SERVER_ERROR_COPY[serverError.code] : void 0;
5595
+ const message = clientError ? fillCopy(copy[ERROR_COPY[clientError.key]], { zone: clientError.zone ?? zone }) : serverKey ? fillCopy(copy[serverKey], { zone }) : serverError?.message;
5472
5596
  const common = {
5473
5597
  id,
5474
5598
  name: field,
@@ -5564,6 +5688,26 @@ function statusLabel(status, copy) {
5564
5688
  const key = STATUS_COPY[status];
5565
5689
  return key ? copy[key] : null;
5566
5690
  }
5691
+ const REASON_COPY = {
5692
+ invalidated: {
5693
+ configuration_changed: "invalidatedConfigurationChanged",
5694
+ no_snapshot: "invalidatedNoSnapshot",
5695
+ resource_changed: "invalidatedResourceChanged"
5696
+ },
5697
+ unknown: {
5698
+ outcome_unknown: "unknownOutcome",
5699
+ interrupted: "unknownInterrupted"
5700
+ }
5701
+ };
5702
+ /**
5703
+ * Why an action ended as `invalidated` or `unknown`, from the safe reason code the
5704
+ * server stores. A code this client does not know shows nothing extra: the status
5705
+ * label still says what happened.
5706
+ */
5707
+ function reasonLabel(status, reason, copy) {
5708
+ const key = reason ? REASON_COPY[status]?.[reason] : void 0;
5709
+ return key ? copy[key] : null;
5710
+ }
5567
5711
  const BADGE_TONE = {
5568
5712
  pending: "border-warning-border bg-warning-subtle text-warning-strong",
5569
5713
  executing: "border-sky-200 bg-sky-50 text-sky-800",
@@ -5621,6 +5765,7 @@ function PendingConfirmationFooter({ pending, toolConfirmation, copy }) {
5621
5765
  const [draft, setDraft] = useState({});
5622
5766
  const [fieldErrors, setFieldErrors] = useState({});
5623
5767
  const [serverErrors, setServerErrors] = useState({});
5768
+ const [applying, setApplying] = useState(false);
5624
5769
  if (!toolConfirmation) return /* @__PURE__ */ jsx("p", {
5625
5770
  className: "border-t border-border bg-warning-subtle/60 px-3 py-2 text-xs text-strong",
5626
5771
  children: copy.confirmHint
@@ -5632,11 +5777,17 @@ function PendingConfirmationFooter({ pending, toolConfirmation, copy }) {
5632
5777
  });
5633
5778
  if (state.status !== "pending") {
5634
5779
  const label = statusLabel(state.status, copy);
5780
+ const reason = reasonLabel(state.status, state.error, copy);
5635
5781
  return label ? /* @__PURE__ */ jsxs("p", {
5636
5782
  className: "flex flex-wrap items-center gap-2 border-t border-divider bg-surface-muted px-3 py-2 text-xs text-strong",
5637
5783
  "aria-live": "polite",
5638
5784
  children: [
5639
5785
  /* @__PURE__ */ jsxs("span", { children: [label, state.status === "failed" && state.error ? `: ${state.error}` : null] }),
5786
+ reason ? /* @__PURE__ */ jsx("span", {
5787
+ className: "basis-full text-muted",
5788
+ "data-confirmation-reason": true,
5789
+ children: reason
5790
+ }) : null,
5640
5791
  state.status === "superseded" && state.supersededBy ? /* @__PURE__ */ jsx("button", {
5641
5792
  type: "button",
5642
5793
  className: "underline underline-offset-2 hover:text-foreground",
@@ -5652,10 +5803,15 @@ function PendingConfirmationFooter({ pending, toolConfirmation, copy }) {
5652
5803
  }
5653
5804
  const decide = async (decisions) => {
5654
5805
  setFailed(false);
5806
+ setApplying(false);
5655
5807
  try {
5656
5808
  await toolConfirmation.decide(decisions);
5657
5809
  } catch (error) {
5658
- if (error instanceof ToolDecisionRejectedError && error.details.actionId === pending.action_id) setServerErrors(Object.fromEntries(error.details.errors.map(({ field, message }) => [field, message])));
5810
+ if (error instanceof ToolDecisionRejectedError && error.details.actionId === pending.action_id) setServerErrors(Object.fromEntries(error.details.errors.map(({ field, message, code }) => [field, {
5811
+ message,
5812
+ ...code ? { code } : {}
5813
+ }])));
5814
+ else if (error instanceof ToolSubmissionConflictError && error.details.code === "decision_in_progress") setApplying(true);
5659
5815
  else setFailed(true);
5660
5816
  }
5661
5817
  };
@@ -5754,7 +5910,7 @@ function PendingConfirmationFooter({ pending, toolConfirmation, copy }) {
5754
5910
  /* @__PURE__ */ jsx("span", {
5755
5911
  className: "ml-auto text-xs text-secondary",
5756
5912
  "aria-live": "polite",
5757
- children: failed ? copy.decisionError : unavailable ? copy.toolUnavailable : editStale ? copy.editNoLongerApplies : expiry
5913
+ children: failed ? copy.decisionError : applying ? copy.applyingNow : unavailable ? copy.toolUnavailable : editStale ? copy.editNoLongerApplies : expiry
5758
5914
  })
5759
5915
  ]
5760
5916
  })] });