@red-hat-developer-hub/backstage-plugin-lightspeed 0.5.7 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/app-config.yaml +4 -0
  3. package/dist/alpha.d.ts +111 -0
  4. package/dist/alpha.esm.js +3 -0
  5. package/dist/alpha.esm.js.map +1 -0
  6. package/dist/components/Attachment.esm.js +71 -61
  7. package/dist/components/Attachment.esm.js.map +1 -1
  8. package/dist/components/AttachmentContext.esm.js +32 -23
  9. package/dist/components/AttachmentContext.esm.js.map +1 -1
  10. package/dist/components/DeleteModal.esm.js +24 -15
  11. package/dist/components/DeleteModal.esm.js.map +1 -1
  12. package/dist/components/FilePreview.esm.js +16 -13
  13. package/dist/components/FilePreview.esm.js.map +1 -1
  14. package/dist/components/LightSpeedChat.esm.js +172 -129
  15. package/dist/components/LightSpeedChat.esm.js.map +1 -1
  16. package/dist/components/LightspeedChatBox.esm.js +43 -34
  17. package/dist/components/LightspeedChatBox.esm.js.map +1 -1
  18. package/dist/components/LightspeedChatBoxHeader.esm.js +15 -12
  19. package/dist/components/LightspeedChatBoxHeader.esm.js.map +1 -1
  20. package/dist/components/LightspeedIcon.esm.js +11 -2
  21. package/dist/components/LightspeedIcon.esm.js.map +1 -1
  22. package/dist/components/LightspeedPage.esm.js +32 -26
  23. package/dist/components/LightspeedPage.esm.js.map +1 -1
  24. package/dist/components/PermissionRequiredIcon.esm.js +10 -2
  25. package/dist/components/PermissionRequiredIcon.esm.js.map +1 -1
  26. package/dist/components/PermissionRequiredState.esm.js +25 -11
  27. package/dist/components/PermissionRequiredState.esm.js.map +1 -1
  28. package/dist/components/Trans.esm.js +33 -0
  29. package/dist/components/Trans.esm.js.map +1 -0
  30. package/dist/const.esm.js +20 -43
  31. package/dist/const.esm.js.map +1 -1
  32. package/dist/hooks/useAutoScroll.esm.js +11 -11
  33. package/dist/hooks/useAutoScroll.esm.js.map +1 -1
  34. package/dist/hooks/useBufferedMessages.esm.js +5 -5
  35. package/dist/hooks/useBufferedMessages.esm.js.map +1 -1
  36. package/dist/hooks/useConversationMessages.esm.js +8 -8
  37. package/dist/hooks/useConversationMessages.esm.js.map +1 -1
  38. package/dist/hooks/useFeedbackActions.esm.js +47 -18
  39. package/dist/hooks/useFeedbackActions.esm.js.map +1 -1
  40. package/dist/hooks/useIsMobile.esm.js +3 -3
  41. package/dist/hooks/useIsMobile.esm.js.map +1 -1
  42. package/dist/hooks/useLastOpenedConversation.esm.js.map +1 -1
  43. package/dist/hooks/useTranslation.esm.js +7 -0
  44. package/dist/hooks/useTranslation.esm.js.map +1 -0
  45. package/dist/hooks/useWelcomePrompts.esm.js +21 -6
  46. package/dist/hooks/useWelcomePrompts.esm.js.map +1 -1
  47. package/dist/index.d.ts +3 -4
  48. package/dist/translations/de.esm.js +128 -0
  49. package/dist/translations/de.esm.js.map +1 -0
  50. package/dist/translations/es.esm.js +128 -0
  51. package/dist/translations/es.esm.js.map +1 -0
  52. package/dist/translations/fr.esm.js +128 -0
  53. package/dist/translations/fr.esm.js.map +1 -0
  54. package/dist/translations/index.esm.js +14 -0
  55. package/dist/translations/index.esm.js.map +1 -0
  56. package/dist/translations/ref.esm.js +128 -0
  57. package/dist/translations/ref.esm.js.map +1 -0
  58. package/dist/types.esm.js.map +1 -1
  59. package/dist/utils/lightspeed-chatbox-utils.esm.js +24 -21
  60. package/dist/utils/lightspeed-chatbox-utils.esm.js.map +1 -1
  61. package/package.json +40 -24
@@ -0,0 +1,128 @@
1
+ import { createTranslationMessages } from '@backstage/core-plugin-api/alpha';
2
+ import { lightspeedTranslationRef } from './ref.esm.js';
3
+
4
+ const lightspeedTranslationFr = createTranslationMessages({
5
+ ref: lightspeedTranslationRef,
6
+ messages: {
7
+ // Page titles and headers
8
+ "page.title": "Lightspeed",
9
+ "page.subtitle": "Assistant de d\xE9veloppement aliment\xE9 par l'IA",
10
+ // Sample prompts - General Development
11
+ "prompts.codeReadability.title": "Obtenir de l'aide sur la lisibilit\xE9 du code",
12
+ "prompts.codeReadability.message": "Pouvez-vous sugg\xE9rer des techniques que je peux utiliser pour rendre mon code plus lisible et maintenable ?",
13
+ "prompts.debugging.title": "Obtenir de l'aide pour le d\xE9bogage",
14
+ "prompts.debugging.message": "Mon application lance une erreur lors de la tentative de connexion \xE0 la base de donn\xE9es. Pouvez-vous m'aider \xE0 identifier le probl\xE8me ?",
15
+ "prompts.developmentConcept.title": "Expliquer un concept de d\xE9veloppement",
16
+ "prompts.developmentConcept.message": "Pouvez-vous expliquer comment fonctionne l'architecture des microservices et ses avantages par rapport \xE0 une conception monolithique ?",
17
+ "prompts.codeOptimization.title": "Sugg\xE9rer des optimisations de code",
18
+ "prompts.codeOptimization.message": "Pouvez-vous sugg\xE9rer des moyens courants d'optimiser le code pour obtenir de meilleures performances ?",
19
+ "prompts.documentation.title": "R\xE9sum\xE9 de la documentation",
20
+ "prompts.documentation.message": "Pouvez-vous r\xE9sumer la documentation pour impl\xE9menter l'authentification OAuth 2.0 dans une application web ?",
21
+ "prompts.gitWorkflows.title": "Flux de travail avec Git",
22
+ "prompts.gitWorkflows.message": "Je veux apporter des modifications au code sur une autre branche sans perdre mon travail existant. Quelle est la proc\xE9dure pour faire cela en utilisant Git ?",
23
+ "prompts.testingStrategies.title": "Sugg\xE9rer des strat\xE9gies de test",
24
+ "prompts.testingStrategies.message": "Pouvez-vous recommander des strat\xE9gies de test courantes qui rendront mon application robuste et sans erreur ?",
25
+ "prompts.sortingAlgorithms.title": "D\xE9mystifier les algorithmes de tri",
26
+ "prompts.sortingAlgorithms.message": "Pouvez-vous expliquer la diff\xE9rence entre un algorithme de tri rapide et un algorithme de tri par fusion, et quand utiliser chacun ?",
27
+ "prompts.eventDriven.title": "Comprendre l'architecture orient\xE9e \xE9v\xE9nements",
28
+ "prompts.eventDriven.message": "Pouvez-vous expliquer ce qu'est l'architecture orient\xE9e \xE9v\xE9nements et quand il est b\xE9n\xE9fique de l'utiliser dans le d\xE9veloppement de logiciels ?",
29
+ // Sample prompts - RHDH Specific
30
+ "prompts.tekton.title": "D\xE9ployer avec Tekton",
31
+ "prompts.tekton.message": "Pouvez-vous m'aider \xE0 automatiser le d\xE9ploiement de mon application en utilisant des pipelines Tekton ?",
32
+ "prompts.openshift.title": "Cr\xE9er un d\xE9ploiement OpenShift",
33
+ "prompts.openshift.message": "Pouvez-vous me guider \xE0 travers la cr\xE9ation d'un nouveau d\xE9ploiement dans OpenShift pour une application conteneuris\xE9e ?",
34
+ "prompts.rhdh.title": "Commencer avec Red Hat Developer Hub",
35
+ "prompts.rhdh.message": "Pouvez-vous me guider \xE0 travers les premi\xE8res \xE9tapes pour commencer \xE0 utiliser Developer Hub en tant que d\xE9veloppeur, comme explorer le Catalogue de Logiciels et ajouter mon service ?",
36
+ // Conversation history
37
+ "conversation.history.confirm.title": "Supprimer le chat ?",
38
+ "conversation.history.confirm.message": "Vous ne verrez plus ce chat ici. Cela supprimera \xE9galement l'activit\xE9 connexe comme les invites, les r\xE9ponses et les commentaires de votre Activit\xE9 Lightspeed.",
39
+ "conversation.history.confirm.delete": "Supprimer",
40
+ // Permissions
41
+ "permission.required.title": "Permissions manquantes",
42
+ "permission.required.description": "Pour voir le plugin lightspeed, contactez votre administrateur pour qu'il vous donne les permissions <b>lightspeed.chat.read</b> et <b>lightspeed.chat.create</b>.",
43
+ // Disclaimers
44
+ "disclaimer.withValidation": "Developer Lightspeed peut r\xE9pondre \xE0 des questions sur de nombreux sujets en utilisant vos mod\xE8les configur\xE9s. Les r\xE9ponses de Developer Lightspeed sont influenc\xE9es par la documentation de Red Hat Developer Hub, mais Developer Lightspeed n'a pas acc\xE8s \xE0 votre Catalogue de Logiciels, TechDocs ou Mod\xE8les, etc. Developer Lightspeed utilise la validation des questions (invites) pour s'assurer que les conversations restent ax\xE9es sur des sujets techniques pertinents pour Red Hat Developer Hub, tels que Backstage, Kubernetes et OpenShift. N'incluez pas d'informations personnelles ou sensibles dans votre saisie. Les interactions avec Developer Lightspeed peuvent \xEAtre examin\xE9es et utilis\xE9es pour am\xE9liorer les produits ou services.",
45
+ "disclaimer.withoutValidation": "Developer Lightspeed peut r\xE9pondre \xE0 des questions sur de nombreux sujets en utilisant vos mod\xE8les configur\xE9s. Les r\xE9ponses de Developer Lightspeed sont influenc\xE9es par la documentation de Red Hat Developer Hub, mais Developer Lightspeed n'a pas acc\xE8s \xE0 votre Catalogue de Logiciels, TechDocs ou Mod\xE8les, etc. N'incluez pas d'informations personnelles ou sensibles dans votre saisie. Les interactions avec Developer Lightspeed peuvent \xEAtre examin\xE9es et utilis\xE9es pour am\xE9liorer les produits ou services.",
46
+ // Footer and feedback
47
+ "footer.accuracy.label": "V\xE9rifiez toujours l'exactitude des r\xE9ponses g\xE9n\xE9r\xE9es par l'IA/LLM avant de les utiliser.",
48
+ "footer.accuracy.popover.title": "V\xE9rifier l'exactitude",
49
+ "footer.accuracy.popover.description": "Bien que Developer Lightspeed s'efforce d'\xEAtre exact, il y a toujours une possibilit\xE9 d'erreurs. C'est une bonne pratique de v\xE9rifier les informations critiques aupr\xE8s de sources fiables, surtout si c'est crucial pour la prise de d\xE9cision ou les actions.",
50
+ "footer.accuracy.popover.image.alt": "Image d'exemple pour le popover de note de bas de page",
51
+ "footer.accuracy.popover.cta.label": "Compris",
52
+ "footer.accuracy.popover.link.label": "En savoir plus",
53
+ // Common actions
54
+ "common.cancel": "Annuler",
55
+ // Menu items
56
+ "menu.newConversation": "Nouveau Chat",
57
+ // Chat-specific UI elements
58
+ "chatbox.header.title": "Developer Lightspeed",
59
+ "chatbox.search.placeholder": "Rechercher dans les chats pr\xE9c\xE9dents...",
60
+ "chatbox.welcome.greeting": "Bonjour, {{userName}}",
61
+ "chatbox.welcome.description": "Comment puis-je vous aider aujourd'hui ?",
62
+ "chatbox.message.placeholder": "Envoyez un message et t\xE9l\xE9chargez optionnellement un fichier JSON, YAML, TXT ou XML...",
63
+ "chatbox.fileUpload.failed": "Le t\xE9l\xE9chargement du fichier a \xE9chou\xE9",
64
+ "chatbox.fileUpload.infoText": "Les types de fichiers pris en charge sont : .txt, .yaml, .json et .xml. La taille maximale du fichier est de 25 Mo.",
65
+ // Accessibility and ARIA labels
66
+ "aria.chatbotSelector": "S\xE9lecteur de chatbot",
67
+ "aria.important": "Important",
68
+ // Modal actions
69
+ "modal.edit": "Modifier",
70
+ "modal.save": "Enregistrer",
71
+ "modal.close": "Fermer",
72
+ "modal.cancel": "Annuler",
73
+ // Conversation actions
74
+ "conversation.delete": "Supprimer",
75
+ "conversation.announcement.userMessage": "Message de l'utilisateur : {{prompt}}. Le message du bot se charge.",
76
+ // User states
77
+ "user.guest": "Invit\xE9",
78
+ "user.loading": "...",
79
+ // Button tooltips and labels
80
+ "tooltip.attach": "Joindre",
81
+ "tooltip.send": "Envoyer",
82
+ "tooltip.microphone.active": "Arr\xEAter d'\xE9couter",
83
+ "tooltip.microphone.inactive": "Utiliser le microphone",
84
+ "button.newChat": "Nouveau chat",
85
+ // Modal titles
86
+ "modal.title.preview": "Aper\xE7u de la pi\xE8ce jointe",
87
+ "modal.title.edit": "Modifier la pi\xE8ce jointe",
88
+ // Alt texts for icons
89
+ "icon.lightspeed.alt": "ic\xF4ne lightspeed",
90
+ "icon.permissionRequired.alt": "ic\xF4ne de permission requise",
91
+ // Message utilities
92
+ "message.options.label": "Options",
93
+ // File attachment errors
94
+ "file.upload.error.alreadyExists": "Le fichier existe d\xE9j\xE0.",
95
+ "file.upload.error.multipleFiles": "Plus d'un fichier a \xE9t\xE9 t\xE9l\xE9charg\xE9.",
96
+ "file.upload.error.unsupportedType": "Type de fichier non pris en charge. Les types pris en charge sont : .txt, .yaml, .json et .xml.",
97
+ "file.upload.error.fileTooLarge": "La taille de votre fichier est trop importante. Veuillez vous assurer que votre fichier fait moins de 25 Mo.",
98
+ "file.upload.error.readFailed": "\xC9chec de la lecture du fichier : {{errorMessage}}",
99
+ // Developer error messages
100
+ "error.context.fileAttachment": "useFileAttachmentContext doit \xEAtre dans un FileAttachmentContextProvider",
101
+ // Feedback actions
102
+ "feedback.form.title": "Pourquoi avez-vous choisi cette \xE9valuation ?",
103
+ "feedback.form.textAreaPlaceholder": "Fournissez des commentaires suppl\xE9mentaires optionnels",
104
+ "feedback.form.submitWord": "Soumettre",
105
+ "feedback.tooltips.goodResponse": "Bonne R\xE9ponse",
106
+ "feedback.tooltips.badResponse": "Mauvaise R\xE9ponse",
107
+ "feedback.tooltips.copied": "Copi\xE9",
108
+ "feedback.tooltips.copy": "Copier",
109
+ "feedback.tooltips.listening": "\xC9coute",
110
+ "feedback.tooltips.listen": "\xC9couter",
111
+ "feedback.quickResponses.positive.helpful": "Informations utiles",
112
+ "feedback.quickResponses.positive.easyToUnderstand": "Facile \xE0 comprendre",
113
+ "feedback.quickResponses.positive.resolvedIssue": "A r\xE9solu mon probl\xE8me",
114
+ "feedback.quickResponses.negative.didntAnswer": "N'a pas r\xE9pondu \xE0 ma question",
115
+ "feedback.quickResponses.negative.hardToUnderstand": "Difficile \xE0 comprendre",
116
+ "feedback.quickResponses.negative.notHelpful": "Pas utile",
117
+ "feedback.completion.title": "Feedback soumis",
118
+ "feedback.completion.body": "Nous avons re\xE7u votre r\xE9ponse. Merci de partager votre feedback !",
119
+ // Conversation categorization
120
+ "conversation.category.today": "Aujourd'hui",
121
+ "conversation.category.yesterday": "Hier",
122
+ "conversation.category.previous7Days": "7 derniers jours",
123
+ "conversation.category.previous30Days": "30 derniers jours"
124
+ }
125
+ });
126
+
127
+ export { lightspeedTranslationFr as default };
128
+ //# sourceMappingURL=fr.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fr.esm.js","sources":["../../src/translations/fr.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTranslationMessages } from '@backstage/core-plugin-api/alpha';\n\nimport { lightspeedTranslationRef } from './ref';\n\n/**\n * French translation for Developer Lightspeed.\n * @public\n */\nconst lightspeedTranslationFr = createTranslationMessages({\n ref: lightspeedTranslationRef,\n messages: {\n // Page titles and headers\n 'page.title': 'Lightspeed',\n 'page.subtitle': \"Assistant de développement alimenté par l'IA\",\n\n // Sample prompts - General Development\n 'prompts.codeReadability.title':\n \"Obtenir de l'aide sur la lisibilité du code\",\n 'prompts.codeReadability.message':\n 'Pouvez-vous suggérer des techniques que je peux utiliser pour rendre mon code plus lisible et maintenable ?',\n 'prompts.debugging.title': \"Obtenir de l'aide pour le débogage\",\n 'prompts.debugging.message':\n \"Mon application lance une erreur lors de la tentative de connexion à la base de données. Pouvez-vous m'aider à identifier le problème ?\",\n 'prompts.developmentConcept.title': 'Expliquer un concept de développement',\n 'prompts.developmentConcept.message':\n \"Pouvez-vous expliquer comment fonctionne l'architecture des microservices et ses avantages par rapport à une conception monolithique ?\",\n 'prompts.codeOptimization.title': 'Suggérer des optimisations de code',\n 'prompts.codeOptimization.message':\n \"Pouvez-vous suggérer des moyens courants d'optimiser le code pour obtenir de meilleures performances ?\",\n 'prompts.documentation.title': 'Résumé de la documentation',\n 'prompts.documentation.message':\n \"Pouvez-vous résumer la documentation pour implémenter l'authentification OAuth 2.0 dans une application web ?\",\n 'prompts.gitWorkflows.title': 'Flux de travail avec Git',\n 'prompts.gitWorkflows.message':\n 'Je veux apporter des modifications au code sur une autre branche sans perdre mon travail existant. Quelle est la procédure pour faire cela en utilisant Git ?',\n 'prompts.testingStrategies.title': 'Suggérer des stratégies de test',\n 'prompts.testingStrategies.message':\n 'Pouvez-vous recommander des stratégies de test courantes qui rendront mon application robuste et sans erreur ?',\n 'prompts.sortingAlgorithms.title': 'Démystifier les algorithmes de tri',\n 'prompts.sortingAlgorithms.message':\n 'Pouvez-vous expliquer la différence entre un algorithme de tri rapide et un algorithme de tri par fusion, et quand utiliser chacun ?',\n 'prompts.eventDriven.title':\n \"Comprendre l'architecture orientée événements\",\n 'prompts.eventDriven.message':\n \"Pouvez-vous expliquer ce qu'est l'architecture orientée événements et quand il est bénéfique de l'utiliser dans le développement de logiciels ?\",\n\n // Sample prompts - RHDH Specific\n 'prompts.tekton.title': 'Déployer avec Tekton',\n 'prompts.tekton.message':\n \"Pouvez-vous m'aider à automatiser le déploiement de mon application en utilisant des pipelines Tekton ?\",\n 'prompts.openshift.title': 'Créer un déploiement OpenShift',\n 'prompts.openshift.message':\n \"Pouvez-vous me guider à travers la création d'un nouveau déploiement dans OpenShift pour une application conteneurisée ?\",\n 'prompts.rhdh.title': 'Commencer avec Red Hat Developer Hub',\n 'prompts.rhdh.message':\n 'Pouvez-vous me guider à travers les premières étapes pour commencer à utiliser Developer Hub en tant que développeur, comme explorer le Catalogue de Logiciels et ajouter mon service ?',\n\n // Conversation history\n 'conversation.history.confirm.title': 'Supprimer le chat ?',\n 'conversation.history.confirm.message':\n \"Vous ne verrez plus ce chat ici. Cela supprimera également l'activité connexe comme les invites, les réponses et les commentaires de votre Activité Lightspeed.\",\n 'conversation.history.confirm.delete': 'Supprimer',\n\n // Permissions\n 'permission.required.title': 'Permissions manquantes',\n 'permission.required.description':\n \"Pour voir le plugin lightspeed, contactez votre administrateur pour qu'il vous donne les permissions <b>lightspeed.chat.read</b> et <b>lightspeed.chat.create</b>.\",\n\n // Disclaimers\n 'disclaimer.withValidation':\n \"Developer Lightspeed peut répondre à des questions sur de nombreux sujets en utilisant vos modèles configurés. Les réponses de Developer Lightspeed sont influencées par la documentation de Red Hat Developer Hub, mais Developer Lightspeed n'a pas accès à votre Catalogue de Logiciels, TechDocs ou Modèles, etc. Developer Lightspeed utilise la validation des questions (invites) pour s'assurer que les conversations restent axées sur des sujets techniques pertinents pour Red Hat Developer Hub, tels que Backstage, Kubernetes et OpenShift. N'incluez pas d'informations personnelles ou sensibles dans votre saisie. Les interactions avec Developer Lightspeed peuvent être examinées et utilisées pour améliorer les produits ou services.\",\n 'disclaimer.withoutValidation':\n \"Developer Lightspeed peut répondre à des questions sur de nombreux sujets en utilisant vos modèles configurés. Les réponses de Developer Lightspeed sont influencées par la documentation de Red Hat Developer Hub, mais Developer Lightspeed n'a pas accès à votre Catalogue de Logiciels, TechDocs ou Modèles, etc. N'incluez pas d'informations personnelles ou sensibles dans votre saisie. Les interactions avec Developer Lightspeed peuvent être examinées et utilisées pour améliorer les produits ou services.\",\n\n // Footer and feedback\n 'footer.accuracy.label':\n \"Vérifiez toujours l'exactitude des réponses générées par l'IA/LLM avant de les utiliser.\",\n 'footer.accuracy.popover.title': \"Vérifier l'exactitude\",\n 'footer.accuracy.popover.description':\n \"Bien que Developer Lightspeed s'efforce d'être exact, il y a toujours une possibilité d'erreurs. C'est une bonne pratique de vérifier les informations critiques auprès de sources fiables, surtout si c'est crucial pour la prise de décision ou les actions.\",\n 'footer.accuracy.popover.image.alt':\n \"Image d'exemple pour le popover de note de bas de page\",\n 'footer.accuracy.popover.cta.label': 'Compris',\n 'footer.accuracy.popover.link.label': 'En savoir plus',\n\n // Common actions\n 'common.cancel': 'Annuler',\n\n // Menu items\n 'menu.newConversation': 'Nouveau Chat',\n\n // Chat-specific UI elements\n 'chatbox.header.title': 'Developer Lightspeed',\n 'chatbox.search.placeholder': 'Rechercher dans les chats précédents...',\n 'chatbox.welcome.greeting': 'Bonjour, {{userName}}',\n 'chatbox.welcome.description': \"Comment puis-je vous aider aujourd'hui ?\",\n 'chatbox.message.placeholder':\n 'Envoyez un message et téléchargez optionnellement un fichier JSON, YAML, TXT ou XML...',\n 'chatbox.fileUpload.failed': 'Le téléchargement du fichier a échoué',\n 'chatbox.fileUpload.infoText':\n 'Les types de fichiers pris en charge sont : .txt, .yaml, .json et .xml. La taille maximale du fichier est de 25 Mo.',\n\n // Accessibility and ARIA labels\n 'aria.chatbotSelector': 'Sélecteur de chatbot',\n 'aria.important': 'Important',\n\n // Modal actions\n 'modal.edit': 'Modifier',\n 'modal.save': 'Enregistrer',\n 'modal.close': 'Fermer',\n 'modal.cancel': 'Annuler',\n\n // Conversation actions\n 'conversation.delete': 'Supprimer',\n 'conversation.announcement.userMessage':\n \"Message de l'utilisateur : {{prompt}}. Le message du bot se charge.\",\n\n // User states\n 'user.guest': 'Invité',\n 'user.loading': '...',\n\n // Button tooltips and labels\n 'tooltip.attach': 'Joindre',\n 'tooltip.send': 'Envoyer',\n 'tooltip.microphone.active': \"Arrêter d'écouter\",\n 'tooltip.microphone.inactive': 'Utiliser le microphone',\n 'button.newChat': 'Nouveau chat',\n\n // Modal titles\n 'modal.title.preview': 'Aperçu de la pièce jointe',\n 'modal.title.edit': 'Modifier la pièce jointe',\n\n // Alt texts for icons\n 'icon.lightspeed.alt': 'icône lightspeed',\n 'icon.permissionRequired.alt': 'icône de permission requise',\n\n // Message utilities\n 'message.options.label': 'Options',\n\n // File attachment errors\n 'file.upload.error.alreadyExists': 'Le fichier existe déjà.',\n 'file.upload.error.multipleFiles': \"Plus d'un fichier a été téléchargé.\",\n 'file.upload.error.unsupportedType':\n 'Type de fichier non pris en charge. Les types pris en charge sont : .txt, .yaml, .json et .xml.',\n 'file.upload.error.fileTooLarge':\n 'La taille de votre fichier est trop importante. Veuillez vous assurer que votre fichier fait moins de 25 Mo.',\n 'file.upload.error.readFailed':\n 'Échec de la lecture du fichier : {{errorMessage}}',\n\n // Developer error messages\n 'error.context.fileAttachment':\n 'useFileAttachmentContext doit être dans un FileAttachmentContextProvider',\n\n // Feedback actions\n 'feedback.form.title': 'Pourquoi avez-vous choisi cette évaluation ?',\n 'feedback.form.textAreaPlaceholder':\n 'Fournissez des commentaires supplémentaires optionnels',\n 'feedback.form.submitWord': 'Soumettre',\n 'feedback.tooltips.goodResponse': 'Bonne Réponse',\n 'feedback.tooltips.badResponse': 'Mauvaise Réponse',\n 'feedback.tooltips.copied': 'Copié',\n 'feedback.tooltips.copy': 'Copier',\n 'feedback.tooltips.listening': 'Écoute',\n 'feedback.tooltips.listen': 'Écouter',\n 'feedback.quickResponses.positive.helpful': 'Informations utiles',\n 'feedback.quickResponses.positive.easyToUnderstand': 'Facile à comprendre',\n 'feedback.quickResponses.positive.resolvedIssue': 'A résolu mon problème',\n 'feedback.quickResponses.negative.didntAnswer':\n \"N'a pas répondu à ma question\",\n 'feedback.quickResponses.negative.hardToUnderstand':\n 'Difficile à comprendre',\n 'feedback.quickResponses.negative.notHelpful': 'Pas utile',\n 'feedback.completion.title': 'Feedback soumis',\n 'feedback.completion.body':\n 'Nous avons reçu votre réponse. Merci de partager votre feedback !',\n\n // Conversation categorization\n 'conversation.category.today': \"Aujourd'hui\",\n 'conversation.category.yesterday': 'Hier',\n 'conversation.category.previous7Days': '7 derniers jours',\n 'conversation.category.previous30Days': '30 derniers jours',\n },\n});\n\nexport default lightspeedTranslationFr;\n"],"names":[],"mappings":";;;AAwBA,MAAM,0BAA0B,yBAA0B,CAAA;AAAA,EACxD,GAAK,EAAA,wBAAA;AAAA,EACL,QAAU,EAAA;AAAA;AAAA,IAER,YAAc,EAAA,YAAA;AAAA,IACd,eAAiB,EAAA,oDAAA;AAAA;AAAA,IAGjB,+BACE,EAAA,gDAAA;AAAA,IACF,iCACE,EAAA,gHAAA;AAAA,IACF,yBAA2B,EAAA,uCAAA;AAAA,IAC3B,2BACE,EAAA,qJAAA;AAAA,IACF,kCAAoC,EAAA,0CAAA;AAAA,IACpC,oCACE,EAAA,2IAAA;AAAA,IACF,gCAAkC,EAAA,uCAAA;AAAA,IAClC,kCACE,EAAA,2GAAA;AAAA,IACF,6BAA+B,EAAA,kCAAA;AAAA,IAC/B,+BACE,EAAA,qHAAA;AAAA,IACF,4BAA8B,EAAA,0BAAA;AAAA,IAC9B,8BACE,EAAA,kKAAA;AAAA,IACF,iCAAmC,EAAA,uCAAA;AAAA,IACnC,mCAC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AAA;AAAA,IACF,6CAA+C,EAAA,WAAA;AAAA,IAC/C,2BAA6B,EAAA,iBAAA;AAAA,IAC7B,0BACE,EAAA,yEAAA;AAAA;AAAA,IAGF,6BAA+B,EAAA,aAAA;AAAA,IAC/B,iCAAmC,EAAA,MAAA;AAAA,IACnC,qCAAuC,EAAA,kBAAA;AAAA,IACvC,sCAAwC,EAAA;AAAA;AAE5C,CAAC;;;;"}
@@ -0,0 +1,14 @@
1
+ import { createTranslationResource } from '@backstage/core-plugin-api/alpha';
2
+ import { lightspeedTranslationRef } from './ref.esm.js';
3
+
4
+ const lightspeedTranslations = createTranslationResource({
5
+ ref: lightspeedTranslationRef,
6
+ translations: {
7
+ es: () => import('./es.esm.js'),
8
+ fr: () => import('./fr.esm.js'),
9
+ de: () => import('./de.esm.js')
10
+ }
11
+ });
12
+
13
+ export { lightspeedTranslationRef, lightspeedTranslations };
14
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":["../../src/translations/index.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTranslationResource } from '@backstage/core-plugin-api/alpha';\n\nimport { lightspeedTranslationRef } from './ref';\n\n/**\n * Translation Resource for Developer lightspeed\n * @alpha\n **/\nexport const lightspeedTranslations = createTranslationResource({\n ref: lightspeedTranslationRef,\n translations: {\n es: () => import('./es'),\n fr: () => import('./fr'),\n de: () => import('./de'),\n },\n});\n\n// @alpha\nexport { lightspeedTranslationRef };\n"],"names":[],"mappings":";;;AAwBO,MAAM,yBAAyB,yBAA0B,CAAA;AAAA,EAC9D,GAAK,EAAA,wBAAA;AAAA,EACL,YAAc,EAAA;AAAA,IACZ,EAAA,EAAI,MAAM,OAAO,aAAM,CAAA;AAAA,IACvB,EAAA,EAAI,MAAM,OAAO,aAAM,CAAA;AAAA,IACvB,EAAA,EAAI,MAAM,OAAO,aAAM;AAAA;AAE3B,CAAC;;;;"}
@@ -0,0 +1,128 @@
1
+ import { createTranslationRef } from '@backstage/core-plugin-api/alpha';
2
+
3
+ const lightspeedMessages = {
4
+ // Page titles and headers
5
+ "page.title": "Lightspeed",
6
+ "page.subtitle": "AI-powered development assistant",
7
+ // Sample prompts - General Development
8
+ "prompts.codeReadability.title": "Get Help On Code Readability",
9
+ "prompts.codeReadability.message": "Can you suggest techniques I can use to make my code more readable and maintainable?",
10
+ "prompts.debugging.title": "Get Help With Debugging",
11
+ "prompts.debugging.message": "My application is throwing an error when trying to connect to the database. Can you help me identify the issue?",
12
+ "prompts.developmentConcept.title": "Explain a Development Concept",
13
+ "prompts.developmentConcept.message": "Can you explain how microservices architecture works and its advantages over a monolithic design?",
14
+ "prompts.codeOptimization.title": "Suggest Code Optimizations",
15
+ "prompts.codeOptimization.message": "Can you suggest common ways to optimize code to achieve better performance?",
16
+ "prompts.documentation.title": "Documentation Summary",
17
+ "prompts.documentation.message": "Can you summarize the documentation for implementing OAuth 2.0 authentication in a web app?",
18
+ "prompts.gitWorkflows.title": "Workflows With Git",
19
+ "prompts.gitWorkflows.message": "I want to make changes to code on another branch without losing my existing work. What is the procedure to do this using Git?",
20
+ "prompts.testingStrategies.title": "Suggest Testing Strategies",
21
+ "prompts.testingStrategies.message": "Can you recommend some common testing strategies that will make my application robust and error-free?",
22
+ "prompts.sortingAlgorithms.title": "Demystify Sorting Algorithms",
23
+ "prompts.sortingAlgorithms.message": "Can you explain the difference between a quicksort and a merge sort algorithm, and when to use each?",
24
+ "prompts.eventDriven.title": "Understand Event-Driven Architecture",
25
+ "prompts.eventDriven.message": "Can you explain what event-driven architecture is and when it's beneficial to use it in software development?",
26
+ // Sample prompts - RHDH Specific
27
+ "prompts.tekton.title": "Deploy With Tekton",
28
+ "prompts.tekton.message": "Can you help me automate the deployment of my application using Tekton pipelines?",
29
+ "prompts.openshift.title": "Create An OpenShift Deployment",
30
+ "prompts.openshift.message": "Can you guide me through creating a new deployment in OpenShift for a containerized application?",
31
+ "prompts.rhdh.title": "Getting Started with Red Hat Developer Hub",
32
+ "prompts.rhdh.message": "Can you guide me through the first steps to start using Developer Hub as a developer, like exploring the Software Catalog and adding my service?",
33
+ // Conversation history
34
+ "conversation.history.confirm.title": "Delete chat?",
35
+ "conversation.history.confirm.message": "You'll no longer see this chat here. This will also delete related activity like prompts, responses, and feedback from your Lightspeed Activity.",
36
+ "conversation.history.confirm.delete": "Delete",
37
+ // Permissions
38
+ "permission.required.title": "Missing permissions",
39
+ "permission.required.description": "To view lightspeed plugin, contact your administrator to give the <b>lightspeed.chat.read</b> and <b>lightspeed.chat.create</b> permissions.",
40
+ // Disclaimers
41
+ "disclaimer.withValidation": "Developer Lightspeed can answer questions on many topics using your configured models. Developer Lightspeed's responses are influenced by the Red Hat Developer Hub documentation but Developer Lightspeed does not have access to your Software Catalog, TechDocs, or Templates etc. Developer Lightspeed uses question (prompt) validation to ensure that conversations remain focused on technical topics relevant to Red Hat Developer Hub, such as Backstage, Kubernetes, and OpenShift. Do not include personal or sensitive information in your input. Interactions with Developer Lightspeed may be reviewed and used to improve products or services.",
42
+ "disclaimer.withoutValidation": "Developer Lightspeed can answer questions on many topics using your configured models. Developer Lightspeed's responses are influenced by the Red Hat Developer Hub documentation but Developer Lightspeed does not have access to your Software Catalog, TechDocs, or Templates etc. Do not include personal or sensitive information in your input. Interactions with Developer Lightspeed may be reviewed and used to improve products or services.",
43
+ // Footer and feedback
44
+ "footer.accuracy.label": "Always check AI/LLM generated responses for accuracy prior to use.",
45
+ "footer.accuracy.popover.title": "Verify accuracy",
46
+ "footer.accuracy.popover.description": "While Developer Lightspeed strives for accuracy, there's always a possibility of errors. It's a good practice to verify critical information from reliable sources, especially if it's crucial for decision-making or actions.",
47
+ "footer.accuracy.popover.image.alt": "Example image for footnote popover",
48
+ "footer.accuracy.popover.cta.label": "Got it",
49
+ "footer.accuracy.popover.link.label": "Learn more",
50
+ // Common actions
51
+ "common.cancel": "Cancel",
52
+ // Menu items
53
+ "menu.newConversation": "New Chat",
54
+ // Chat-specific UI elements
55
+ "chatbox.header.title": "Developer Lightspeed",
56
+ "chatbox.search.placeholder": "Search previous chats...",
57
+ "chatbox.welcome.greeting": "Hello, {{userName}}",
58
+ "chatbox.welcome.description": "How can I help you today?",
59
+ "chatbox.message.placeholder": "Send a message and optionally upload a JSON, YAML, TXT, or XML file...",
60
+ "chatbox.fileUpload.failed": "File upload failed",
61
+ "chatbox.fileUpload.infoText": "Supported file types are: .txt, .yaml, .json and .xml. The maximum file size is 25 MB.",
62
+ // Accessibility and ARIA labels
63
+ "aria.chatbotSelector": "Chatbot selector",
64
+ "aria.important": "Important",
65
+ // Modal actions
66
+ "modal.edit": "Edit",
67
+ "modal.save": "Save",
68
+ "modal.close": "Close",
69
+ "modal.cancel": "Cancel",
70
+ // Conversation actions
71
+ "conversation.delete": "Delete",
72
+ "conversation.announcement.userMessage": "Message from User: {{prompt}}. Message from Bot is loading.",
73
+ // User states
74
+ "user.guest": "Guest",
75
+ "user.loading": "...",
76
+ // Button tooltips and labels
77
+ "tooltip.attach": "Attach",
78
+ "tooltip.send": "Send",
79
+ "tooltip.microphone.active": "Stop listening",
80
+ "tooltip.microphone.inactive": "Use microphone",
81
+ "button.newChat": "New chat",
82
+ // Modal titles
83
+ "modal.title.preview": "Preview attachment",
84
+ "modal.title.edit": "Edit attachment",
85
+ // Alt texts for icons
86
+ "icon.lightspeed.alt": "lightspeed icon",
87
+ "icon.permissionRequired.alt": "permission required icon",
88
+ // Message utilities
89
+ "message.options.label": "Options",
90
+ // File attachment errors
91
+ "file.upload.error.alreadyExists": "File already exists.",
92
+ "file.upload.error.multipleFiles": "Uploaded more than one file.",
93
+ "file.upload.error.unsupportedType": "Unsupported file type. Supported types are: .txt, .yaml, .json and .xml.",
94
+ "file.upload.error.fileTooLarge": "Your file size is too large. Please ensure that your file is less than 25 MB.",
95
+ "file.upload.error.readFailed": "Failed to read file: {{errorMessage}}",
96
+ // Developer error messages
97
+ "error.context.fileAttachment": "useFileAttachmentContext must be within a FileAttachmentContextProvider",
98
+ // Feedback actions
99
+ "feedback.form.title": "Why did you choose this rating?",
100
+ "feedback.form.textAreaPlaceholder": "Provide optional additional feedback",
101
+ "feedback.form.submitWord": "Submit",
102
+ "feedback.tooltips.goodResponse": "Good Response",
103
+ "feedback.tooltips.badResponse": "Bad Response",
104
+ "feedback.tooltips.copied": "Copied",
105
+ "feedback.tooltips.copy": "Copy",
106
+ "feedback.tooltips.listening": "Listening",
107
+ "feedback.tooltips.listen": "Listen",
108
+ "feedback.quickResponses.positive.helpful": "Helpful information",
109
+ "feedback.quickResponses.positive.easyToUnderstand": "Easy to understand",
110
+ "feedback.quickResponses.positive.resolvedIssue": "Resolved my issue",
111
+ "feedback.quickResponses.negative.didntAnswer": "Didn't answer my question",
112
+ "feedback.quickResponses.negative.hardToUnderstand": "Hard to understand",
113
+ "feedback.quickResponses.negative.notHelpful": "Not Helpful",
114
+ "feedback.completion.title": "Feedback submitted",
115
+ "feedback.completion.body": "We've received your response. Thank you for sharing your feedback!",
116
+ // Conversation categorization
117
+ "conversation.category.today": "Today",
118
+ "conversation.category.yesterday": "Yesterday",
119
+ "conversation.category.previous7Days": "Previous 7 Days",
120
+ "conversation.category.previous30Days": "Previous 30 Days"
121
+ };
122
+ const lightspeedTranslationRef = createTranslationRef({
123
+ id: "plugin.lightspeed",
124
+ messages: lightspeedMessages
125
+ });
126
+
127
+ export { lightspeedMessages, lightspeedTranslationRef };
128
+ //# sourceMappingURL=ref.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ref.esm.js","sources":["../../src/translations/ref.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/**\n * Messages object containing all English translations.\n * This is our single source of truth for translations.\n * @alpha\n */\nexport const lightspeedMessages = {\n // Page titles and headers\n 'page.title': 'Lightspeed',\n 'page.subtitle': 'AI-powered development assistant',\n\n // Sample prompts - General Development\n 'prompts.codeReadability.title': 'Get Help On Code Readability',\n 'prompts.codeReadability.message':\n 'Can you suggest techniques I can use to make my code more readable and maintainable?',\n 'prompts.debugging.title': 'Get Help With Debugging',\n 'prompts.debugging.message':\n 'My application is throwing an error when trying to connect to the database. Can you help me identify the issue?',\n 'prompts.developmentConcept.title': 'Explain a Development Concept',\n 'prompts.developmentConcept.message':\n 'Can you explain how microservices architecture works and its advantages over a monolithic design?',\n 'prompts.codeOptimization.title': 'Suggest Code Optimizations',\n 'prompts.codeOptimization.message':\n 'Can you suggest common ways to optimize code to achieve better performance?',\n 'prompts.documentation.title': 'Documentation Summary',\n 'prompts.documentation.message':\n 'Can you summarize the documentation for implementing OAuth 2.0 authentication in a web app?',\n 'prompts.gitWorkflows.title': 'Workflows With Git',\n 'prompts.gitWorkflows.message':\n 'I want to make changes to code on another branch without losing my existing work. What is the procedure to do this using Git?',\n 'prompts.testingStrategies.title': 'Suggest Testing Strategies',\n 'prompts.testingStrategies.message':\n 'Can you recommend some common testing strategies that will make my application robust and error-free?',\n 'prompts.sortingAlgorithms.title': 'Demystify Sorting Algorithms',\n 'prompts.sortingAlgorithms.message':\n 'Can you explain the difference between a quicksort and a merge sort algorithm, and when to use each?',\n 'prompts.eventDriven.title': 'Understand Event-Driven Architecture',\n 'prompts.eventDriven.message':\n \"Can you explain what event-driven architecture is and when it's beneficial to use it in software development?\",\n\n // Sample prompts - RHDH Specific\n 'prompts.tekton.title': 'Deploy With Tekton',\n 'prompts.tekton.message':\n 'Can you help me automate the deployment of my application using Tekton pipelines?',\n 'prompts.openshift.title': 'Create An OpenShift Deployment',\n 'prompts.openshift.message':\n 'Can you guide me through creating a new deployment in OpenShift for a containerized application?',\n 'prompts.rhdh.title': 'Getting Started with Red Hat Developer Hub',\n 'prompts.rhdh.message':\n 'Can you guide me through the first steps to start using Developer Hub as a developer, like exploring the Software Catalog and adding my service?',\n\n // Conversation history\n 'conversation.history.confirm.title': 'Delete chat?',\n 'conversation.history.confirm.message':\n \"You'll no longer see this chat here. This will also delete related activity like prompts, responses, and feedback from your Lightspeed Activity.\",\n 'conversation.history.confirm.delete': 'Delete',\n\n // Permissions\n 'permission.required.title': 'Missing permissions',\n 'permission.required.description':\n 'To view lightspeed plugin, contact your administrator to give the <b>lightspeed.chat.read</b> and <b>lightspeed.chat.create</b> permissions.',\n\n // Disclaimers\n 'disclaimer.withValidation':\n \"Developer Lightspeed can answer questions on many topics using your configured models. Developer Lightspeed's responses are influenced by the Red Hat Developer Hub documentation but Developer Lightspeed does not have access to your Software Catalog, TechDocs, or Templates etc. Developer Lightspeed uses question (prompt) validation to ensure that conversations remain focused on technical topics relevant to Red Hat Developer Hub, such as Backstage, Kubernetes, and OpenShift. Do not include personal or sensitive information in your input. Interactions with Developer Lightspeed may be reviewed and used to improve products or services.\",\n 'disclaimer.withoutValidation':\n \"Developer Lightspeed can answer questions on many topics using your configured models. Developer Lightspeed's responses are influenced by the Red Hat Developer Hub documentation but Developer Lightspeed does not have access to your Software Catalog, TechDocs, or Templates etc. Do not include personal or sensitive information in your input. Interactions with Developer Lightspeed may be reviewed and used to improve products or services.\",\n\n // Footer and feedback\n 'footer.accuracy.label':\n 'Always check AI/LLM generated responses for accuracy prior to use.',\n 'footer.accuracy.popover.title': 'Verify accuracy',\n 'footer.accuracy.popover.description':\n \"While Developer Lightspeed strives for accuracy, there's always a possibility of errors. It's a good practice to verify critical information from reliable sources, especially if it's crucial for decision-making or actions.\",\n 'footer.accuracy.popover.image.alt': 'Example image for footnote popover',\n 'footer.accuracy.popover.cta.label': 'Got it',\n 'footer.accuracy.popover.link.label': 'Learn more',\n\n // Common actions\n 'common.cancel': 'Cancel',\n\n // Menu items\n 'menu.newConversation': 'New Chat',\n\n // Chat-specific UI elements\n 'chatbox.header.title': 'Developer Lightspeed',\n 'chatbox.search.placeholder': 'Search previous chats...',\n 'chatbox.welcome.greeting': 'Hello, {{userName}}',\n 'chatbox.welcome.description': 'How can I help you today?',\n 'chatbox.message.placeholder':\n 'Send a message and optionally upload a JSON, YAML, TXT, or XML file...',\n 'chatbox.fileUpload.failed': 'File upload failed',\n 'chatbox.fileUpload.infoText':\n 'Supported file types are: .txt, .yaml, .json and .xml. The maximum file size is 25 MB.',\n\n // Accessibility and ARIA labels\n 'aria.chatbotSelector': 'Chatbot selector',\n 'aria.important': 'Important',\n\n // Modal actions\n 'modal.edit': 'Edit',\n 'modal.save': 'Save',\n 'modal.close': 'Close',\n 'modal.cancel': 'Cancel',\n\n // Conversation actions\n 'conversation.delete': 'Delete',\n 'conversation.announcement.userMessage':\n 'Message from User: {{prompt}}. Message from Bot is loading.',\n\n // User states\n 'user.guest': 'Guest',\n 'user.loading': '...',\n\n // Button tooltips and labels\n 'tooltip.attach': 'Attach',\n 'tooltip.send': 'Send',\n 'tooltip.microphone.active': 'Stop listening',\n 'tooltip.microphone.inactive': 'Use microphone',\n 'button.newChat': 'New chat',\n\n // Modal titles\n 'modal.title.preview': 'Preview attachment',\n 'modal.title.edit': 'Edit attachment',\n\n // Alt texts for icons\n 'icon.lightspeed.alt': 'lightspeed icon',\n 'icon.permissionRequired.alt': 'permission required icon',\n\n // Message utilities\n 'message.options.label': 'Options',\n\n // File attachment errors\n 'file.upload.error.alreadyExists': 'File already exists.',\n 'file.upload.error.multipleFiles': 'Uploaded more than one file.',\n 'file.upload.error.unsupportedType':\n 'Unsupported file type. Supported types are: .txt, .yaml, .json and .xml.',\n 'file.upload.error.fileTooLarge':\n 'Your file size is too large. Please ensure that your file is less than 25 MB.',\n 'file.upload.error.readFailed': 'Failed to read file: {{errorMessage}}',\n\n // Developer error messages\n 'error.context.fileAttachment':\n 'useFileAttachmentContext must be within a FileAttachmentContextProvider',\n\n // Feedback actions\n 'feedback.form.title': 'Why did you choose this rating?',\n 'feedback.form.textAreaPlaceholder': 'Provide optional additional feedback',\n 'feedback.form.submitWord': 'Submit',\n 'feedback.tooltips.goodResponse': 'Good Response',\n 'feedback.tooltips.badResponse': 'Bad Response',\n 'feedback.tooltips.copied': 'Copied',\n 'feedback.tooltips.copy': 'Copy',\n 'feedback.tooltips.listening': 'Listening',\n 'feedback.tooltips.listen': 'Listen',\n 'feedback.quickResponses.positive.helpful': 'Helpful information',\n 'feedback.quickResponses.positive.easyToUnderstand': 'Easy to understand',\n 'feedback.quickResponses.positive.resolvedIssue': 'Resolved my issue',\n 'feedback.quickResponses.negative.didntAnswer': \"Didn't answer my question\",\n 'feedback.quickResponses.negative.hardToUnderstand': 'Hard to understand',\n 'feedback.quickResponses.negative.notHelpful': 'Not Helpful',\n 'feedback.completion.title': 'Feedback submitted',\n 'feedback.completion.body':\n \"We've received your response. Thank you for sharing your feedback!\",\n\n // Conversation categorization\n 'conversation.category.today': 'Today',\n 'conversation.category.yesterday': 'Yesterday',\n 'conversation.category.previous7Days': 'Previous 7 Days',\n 'conversation.category.previous30Days': 'Previous 30 Days',\n};\n\n/**\n * Translation Reference for Developer Lightspeed\n * @alpha\n **/\nexport const lightspeedTranslationRef = createTranslationRef({\n id: 'plugin.lightspeed',\n messages: lightspeedMessages,\n});\n"],"names":[],"mappings":";;AAuBO,MAAM,kBAAqB,GAAA;AAAA;AAAA,EAEhC,YAAc,EAAA,YAAA;AAAA,EACd,eAAiB,EAAA,kC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AA,EAGF,qBAAuB,EAAA,iCAAA;AAAA,EACvB,mCAAqC,EAAA,sCAAA;AAAA,EACrC,0BAA4B,EAAA,QAAA;AAAA,EAC5B,gCAAkC,EAAA,eAAA;AAAA,EAClC,+BAAiC,EAAA,cAAA;AAAA,EACjC,0BAA4B,EAAA,QAAA;AAAA,EAC5B,wBAA0B,EAAA,MAAA;AAAA,EAC1B,6BAA+B,EAAA,WAAA;AAAA,EAC/B,0BAA4B,EAAA,QAAA;AAAA,EAC5B,0CAA4C,EAAA,qBAAA;AAAA,EAC5C,mDAAqD,EAAA,oBAAA;AAAA,EACrD,gDAAkD,EAAA,mBAAA;AAAA,EAClD,8CAAgD,EAAA,2BAAA;AAAA,EAChD,mDAAqD,EAAA,oBAAA;AAAA,EACrD,6CAA+C,EAAA,aAAA;AAAA,EAC/C,2BAA6B,EAAA,oBAAA;AAAA,EAC7B,0BACE,EAAA,oEAAA;AAAA;AAAA,EAGF,6BAA+B,EAAA,OAAA;AAAA,EAC/B,iCAAmC,EAAA,WAAA;AAAA,EACnC,qCAAuC,EAAA,iBAAA;AAAA,EACvC,sCAAwC,EAAA;AAC1C;AAMO,MAAM,2BAA2B,oBAAqB,CAAA;AAAA,EAC3D,EAAI,EAAA,mBAAA;AAAA,EACJ,QAAU,EAAA;AACZ,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.esm.js","sources":["../src/types.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SourcesCardProps } from '@patternfly/chatbot';\nimport { AlertProps } from '@patternfly/react-core';\n\nexport type Conversations = {\n [key: string]: {\n user: string;\n bot: string;\n model: string;\n loading: boolean;\n timestamp: string;\n botTimestamp: string;\n error?: AlertProps;\n };\n};\n\nexport type ReferencedDocument = {\n doc_title: string;\n doc_url: string;\n doc_description?: string;\n};\n\nexport type ReferencedDocuments = ReferencedDocument[];\nexport interface BaseMessage {\n name: string;\n type: string;\n id: number;\n content: string;\n response_metadata: {\n model?: string;\n created_at: number;\n role?: string;\n };\n sources?: SourcesCardProps;\n additional_kwargs: {\n referenced_documents?: ReferencedDocuments;\n [_key: string]: any;\n };\n error?: AlertProps;\n}\nexport type ConversationSummary = {\n conversation_id: string;\n last_message_timestamp: number;\n topic_summary: string;\n};\n\nexport enum SupportedFileType {\n JSON = 'application/json',\n YAML = 'application/x-yaml',\n TEXT = 'text/plain',\n XML = 'text/xml',\n}\nexport interface FileContent {\n content: string;\n type: string;\n name: string;\n}\n\nexport type Attachment = {\n attachment_type: string;\n content_type: string;\n content: string;\n};\n\nexport type ConversationList = ConversationSummary[];\n\nexport type SamplePrompts = {\n title: string;\n message: string;\n}[];\n\nexport type CaptureFeedback = {\n conversation_id: string;\n user_question: string;\n llm_response: string;\n user_feedback: string;\n sentiment: number;\n};\n"],"names":["SupportedFileType"],"mappings":"AA6DY,IAAA,iBAAA,qBAAAA,kBAAL,KAAA;AACL,EAAAA,mBAAA,MAAO,CAAA,GAAA,kBAAA;AACP,EAAAA,mBAAA,MAAO,CAAA,GAAA,oBAAA;AACP,EAAAA,mBAAA,MAAO,CAAA,GAAA,YAAA;AACP,EAAAA,mBAAA,KAAM,CAAA,GAAA,UAAA;AAJI,EAAAA,OAAAA,kBAAAA;AAAA,CAAA,EAAA,iBAAA,IAAA,EAAA;;;;"}
1
+ {"version":3,"file":"types.esm.js","sources":["../src/types.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SourcesCardProps } from '@patternfly/chatbot';\nimport { AlertProps } from '@patternfly/react-core';\n\nexport type Conversations = {\n [key: string]: {\n user: string;\n bot: string;\n model: string;\n loading: boolean;\n timestamp: string;\n botTimestamp: string;\n error?: AlertProps;\n };\n};\n\nexport type ReferencedDocument = {\n doc_title: string;\n doc_url: string;\n doc_description?: string;\n};\n\nexport type ReferencedDocuments = ReferencedDocument[];\nexport interface BaseMessage {\n name: string;\n type: string;\n id: number;\n content: string;\n response_metadata: {\n model?: string;\n created_at: number;\n role?: string;\n };\n sources?: SourcesCardProps;\n additional_kwargs: {\n referenced_documents?: ReferencedDocuments;\n [_key: string]: any;\n };\n error?: AlertProps;\n}\nexport type ConversationSummary = {\n conversation_id: string;\n last_message_timestamp: number;\n topic_summary: string;\n};\n\nexport enum SupportedFileType {\n JSON = 'application/json',\n YAML = 'application/x-yaml',\n TEXT = 'text/plain',\n XML = 'text/xml',\n}\nexport interface FileContent {\n content: string;\n type: string;\n name: string;\n}\n\nexport type Attachment = {\n attachment_type: string;\n content_type: string;\n content: string;\n};\n\nexport type ConversationList = ConversationSummary[];\n\nexport type SamplePrompt =\n | {\n title: string;\n message: string;\n }\n | {\n titleKey: string;\n messageKey: string;\n };\n\nexport type SamplePrompts = SamplePrompt[];\n\nexport type CaptureFeedback = {\n conversation_id: string;\n user_question: string;\n llm_response: string;\n user_feedback: string;\n sentiment: number;\n};\n"],"names":["SupportedFileType"],"mappings":"AA6DY,IAAA,iBAAA,qBAAAA,kBAAL,KAAA;AACL,EAAAA,mBAAA,MAAO,CAAA,GAAA,kBAAA;AACP,EAAAA,mBAAA,MAAO,CAAA,GAAA,oBAAA;AACP,EAAAA,mBAAA,MAAO,CAAA,GAAA,YAAA;AACP,EAAAA,mBAAA,KAAM,CAAA,GAAA,UAAA;AAJI,EAAAA,OAAAA,kBAAAA;AAAA,CAAA,EAAA,iBAAA,IAAA,EAAA;;;;"}
@@ -1,22 +1,22 @@
1
- const getFootnoteProps = (additionalClassName) => ({
2
- label: "Always check AI/LLM generated responses for accuracy prior to use.",
1
+ const getFootnoteProps = (additionalClassName, t) => ({
2
+ label: t?.("footer.accuracy.label") || "Always check AI/LLM generated responses for accuracy prior to use.",
3
3
  popover: {
4
4
  popoverProps: {
5
5
  className: additionalClassName ?? ""
6
6
  },
7
- title: "Verify accuracy",
8
- description: `While Developer Lightspeed strives for accuracy, there's always a possibility of errors. It's a good practice to verify critical information from reliable sources, especially if it's crucial for decision-making or actions.`,
7
+ title: t?.("footer.accuracy.popover.title") || "Verify accuracy",
8
+ description: t?.("footer.accuracy.popover.description") || `While Developer Lightspeed strives for accuracy, there's always a possibility of errors. It's a good practice to verify critical information from reliable sources, especially if it's crucial for decision-making or actions.`,
9
9
  bannerImage: {
10
10
  src: "https://cdn.dribbble.com/userupload/10651749/file/original-8a07b8e39d9e8bf002358c66fce1223e.gif",
11
- alt: "Example image for footnote popover"
11
+ alt: t?.("footer.accuracy.popover.image.alt") || "Example image for footnote popover"
12
12
  },
13
13
  cta: {
14
- label: "Got it",
14
+ label: t?.("footer.accuracy.popover.cta.label") || "Got it",
15
15
  onClick: () => {
16
16
  }
17
17
  },
18
18
  link: {
19
- label: "Learn more",
19
+ label: t?.("footer.accuracy.popover.link.label") || "Learn more",
20
20
  url: "https://www.redhat.com/"
21
21
  }
22
22
  }
@@ -44,16 +44,17 @@ const getTimestamp = (unix_timestamp) => {
44
44
  };
45
45
  const createMessage = ({
46
46
  role,
47
- name = "Guest",
47
+ name,
48
48
  avatar,
49
49
  isLoading = false,
50
50
  content,
51
51
  timestamp,
52
52
  error,
53
- sources
53
+ sources,
54
+ defaultUserName = "Guest"
54
55
  }) => ({
55
56
  role,
56
- name,
57
+ name: name || defaultUserName,
57
58
  avatar,
58
59
  isLoading,
59
60
  content,
@@ -64,7 +65,7 @@ const createMessage = ({
64
65
  const createUserMessage = (props) => createMessage({
65
66
  ...props,
66
67
  role: "user",
67
- name: props.name ?? "Guest"
68
+ defaultUserName: props.defaultUserName
68
69
  });
69
70
  const createBotMessage = (props) => createMessage({
70
71
  ...props,
@@ -99,14 +100,14 @@ const getDayDifference = (sourceTime, targetTime) => {
99
100
  const timeDifference = sourceDate.getTime() - targetDate.getTime();
100
101
  return Math.floor(timeDifference / (1e3 * 60 * 60 * 24));
101
102
  };
102
- const getCategorizeMessages = (messages, addProps) => {
103
+ const getCategorizeMessages = (messages, addProps, t) => {
103
104
  const now = /* @__PURE__ */ new Date();
104
105
  const today = now.toDateString();
105
106
  const categorizedMessages = {
106
- Today: [],
107
- Yesterday: [],
108
- "Previous 7 Days": [],
109
- "Previous 30 Days": []
107
+ [t?.("conversation.category.today") || "Today"]: [],
108
+ [t?.("conversation.category.yesterday") || "Yesterday"]: [],
109
+ [t?.("conversation.category.previous7Days") || "Previous 7 Days"]: [],
110
+ [t?.("conversation.category.previous30Days") || "Previous 30 Days"]: []
110
111
  };
111
112
  messages.sort((a, b) => b.last_message_timestamp - a.last_message_timestamp).forEach((c) => {
112
113
  const messageDate = new Date(c.last_message_timestamp * 1e3);
@@ -118,17 +119,19 @@ const getCategorizeMessages = (messages, addProps) => {
118
119
  const message = {
119
120
  id: c.conversation_id,
120
121
  text: c.topic_summary,
121
- label: "Options",
122
+ label: t?.("message.options.label") || "Options",
122
123
  ...addProps(c)
123
124
  };
124
125
  if (messageDayString === today) {
125
- categorizedMessages.Today.push(message);
126
+ categorizedMessages[t?.("conversation.category.today") || "Today"].push(
127
+ message
128
+ );
126
129
  } else if (dayDifference === 1) {
127
- categorizedMessages.Yesterday.push(message);
130
+ categorizedMessages[t?.("conversation.category.yesterday") || "Yesterday"].push(message);
128
131
  } else if (dayDifference <= 7) {
129
- categorizedMessages["Previous 7 Days"].push(message);
132
+ categorizedMessages[t?.("conversation.category.previous7Days") || "Previous 7 Days"].push(message);
130
133
  } else if (dayDifference <= 30) {
131
- categorizedMessages["Previous 30 Days"].push(message);
134
+ categorizedMessages[t?.("conversation.category.previous30Days") || "Previous 30 Days"].push(message);
132
135
  } else {
133
136
  const monthYear = messageDate.toLocaleString("default", {
134
137
  month: "long",
@@ -1 +1 @@
1
- {"version":3,"file":"lightspeed-chatbox-utils.esm.js","sources":["../../src/utils/lightspeed-chatbox-utils.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Conversation, SourcesCardProps } from '@patternfly/chatbot';\nimport { PopoverProps } from '@patternfly/react-core';\n\nimport {\n BaseMessage,\n ConversationList,\n ConversationSummary,\n ReferencedDocument,\n ReferencedDocuments,\n} from '../types';\n\nexport const getFootnoteProps = (additionalClassName: string) => ({\n label: 'Always check AI/LLM generated responses for accuracy prior to use.',\n popover: {\n popoverProps: {\n className: additionalClassName ?? '',\n } as PopoverProps,\n title: 'Verify accuracy',\n description: `While Developer Lightspeed strives for accuracy, there's always a possibility of errors. It's a good practice to verify critical information from reliable sources, especially if it's crucial for decision-making or actions.`,\n bannerImage: {\n src: 'https://cdn.dribbble.com/userupload/10651749/file/original-8a07b8e39d9e8bf002358c66fce1223e.gif',\n alt: 'Example image for footnote popover',\n },\n cta: {\n label: 'Got it',\n onClick: () => {},\n },\n link: {\n label: 'Learn more',\n url: 'https://www.redhat.com/',\n },\n },\n});\n\nexport const getTimestampVariablesString = (v: number) => {\n if (v < 10) {\n return `0${v}`;\n }\n return `${v}`;\n};\n\nexport const getTimestamp = (unix_timestamp: number) => {\n if (typeof unix_timestamp !== 'number' || isNaN(unix_timestamp)) {\n // eslint-disable-next-line no-console\n console.error('Invalid Unix timestamp provided');\n return '';\n }\n\n const a = new Date(unix_timestamp);\n const month = getTimestampVariablesString(a.getMonth() + 1);\n const year = a.getFullYear();\n const date = getTimestampVariablesString(a.getDate());\n const hour = getTimestampVariablesString(a.getHours());\n const min = getTimestampVariablesString(a.getMinutes());\n const sec = getTimestampVariablesString(a.getSeconds());\n const time = `${date}/${month}/${year}, ${hour}:${min}:${sec}`;\n return time;\n};\n\nexport const splitJsonStrings = (jsonString: string): string[] => {\n const chunks = jsonString.split('}{');\n\n if (chunks.length <= 1) {\n return [jsonString];\n }\n\n return chunks.map((chunk, index, arr) => {\n if (index === 0) {\n return `${chunk}}`;\n } else if (index === arr.length - 1) {\n return `{${chunk}`;\n }\n return `{${chunk}}`;\n });\n};\n\ntype MessageProps = {\n content: string;\n timestamp: string;\n name?: string;\n avatar?: string | any;\n isLoading?: boolean;\n error?: {\n title: string;\n };\n sources?: SourcesCardProps;\n};\n\nexport const createMessage = ({\n role,\n name = 'Guest',\n avatar,\n isLoading = false,\n content,\n timestamp,\n error,\n sources,\n}: MessageProps & { role: 'user' | 'bot' }) => ({\n role,\n name,\n avatar,\n isLoading,\n content,\n timestamp,\n error,\n sources,\n});\n\nexport const createUserMessage = (props: MessageProps) =>\n createMessage({\n ...props,\n role: 'user',\n name: props.name ?? 'Guest',\n });\n\nexport const createBotMessage = (props: MessageProps) =>\n createMessage({\n ...props,\n role: 'bot',\n });\n\nexport const getMessageData = (message: BaseMessage) => {\n return {\n model: message?.response_metadata?.model,\n content: message?.content || '',\n timestamp: getTimestamp(message?.response_metadata?.created_at * 1000),\n referencedDocuments: message?.additional_kwargs?.referenced_documents ?? [],\n };\n};\n\nexport const transformDocumentsToSources = (\n referenced_documents: ReferencedDocuments,\n): SourcesCardProps | undefined => {\n if (!referenced_documents || referenced_documents?.length === 0) {\n return undefined;\n }\n return {\n sources: referenced_documents.map((doc: ReferencedDocument) => ({\n body: doc.doc_description,\n title: doc.doc_title,\n link: doc?.doc_url,\n isExternal: true,\n })),\n };\n};\n\nexport const getDayDifference = (sourceTime: number, targetTime: number) => {\n const sourceDate = new Date(sourceTime);\n const targetDate = new Date(targetTime);\n\n sourceDate.setHours(0, 0, 0, 0);\n targetDate.setHours(0, 0, 0, 0);\n\n const timeDifference = sourceDate.getTime() - targetDate.getTime();\n\n return Math.floor(timeDifference / (1000 * 60 * 60 * 24));\n};\n\nexport const getCategorizeMessages = (\n messages: ConversationList,\n addProps: (c: ConversationSummary) => { [k: string]: any },\n): { [k: string]: Conversation[] } => {\n const now: any = new Date();\n const today = now.toDateString();\n\n const categorizedMessages: { [k: string]: Conversation[] } = {\n Today: [],\n Yesterday: [],\n 'Previous 7 Days': [],\n 'Previous 30 Days': [],\n };\n messages\n .sort((a, b) => b.last_message_timestamp - a.last_message_timestamp)\n .forEach(c => {\n const messageDate = new Date(c.last_message_timestamp * 1000);\n const messageDayString = messageDate.toDateString();\n const dayDifference = getDayDifference(\n now,\n c.last_message_timestamp * 1000,\n );\n const message: Conversation = {\n id: c.conversation_id,\n text: c.topic_summary,\n label: 'Options',\n ...addProps(c),\n };\n\n if (messageDayString === today) {\n categorizedMessages.Today.push(message);\n } else if (dayDifference === 1) {\n categorizedMessages.Yesterday.push(message);\n } else if (dayDifference <= 7) {\n categorizedMessages['Previous 7 Days'].push(message);\n } else if (dayDifference <= 30) {\n categorizedMessages['Previous 30 Days'].push(message);\n } else {\n // handle month-wise grouping\n const monthYear = messageDate.toLocaleString('default', {\n month: 'long',\n year: 'numeric',\n });\n if (!categorizedMessages[monthYear]) {\n categorizedMessages[monthYear] = [];\n }\n categorizedMessages[monthYear].push(message);\n }\n });\n\n const filteredCategories = Object.keys(categorizedMessages).reduce(\n (result, category) => {\n if (categorizedMessages[category].length > 0) {\n result[category] = categorizedMessages[category];\n }\n return result;\n },\n {} as any,\n );\n\n return filteredCategories;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;AAAA,OACP,CAAA;AACD,MAAI,IAAA,CAAC,mBAAoB,CAAA,SAAS,CAAG,EAAA;AACnC,QAAoB,mBAAA,CAAA,SAAS,IAAI,EAAC;AAAA;AAEpC,MAAoB,mBAAA,CAAA,SAAS,CAAE,CAAA,IAAA,CAAK,OAAO,CAAA;AAAA;AAC7C,GACD,CAAA;AAEH,EAAA,MAAM,kBAAqB,GAAA,MAAA,CAAO,IAAK,CAAA,mBAAmB,CAAE,CAAA,MAAA;AAAA,IAC1D,CAAC,QAAQ,QAAa,KAAA;AACpB,MAAA,IAAI,mBAAoB,CAAA,QAAQ,CAAE,CAAA,MAAA,GAAS,CAAG,EAAA;AAC5C,QAAO,MAAA,CAAA,QAAQ,CAAI,GAAA,mBAAA,CAAoB,QAAQ,CAAA;AAAA;AAEjD,MAAO,OAAA,MAAA;AAAA,KACT;AAAA,IACA;AAAC,GACH;AAEA,EAAO,OAAA,kBAAA;AACT;;;;"}
1
+ {"version":3,"file":"lightspeed-chatbox-utils.esm.js","sources":["../../src/utils/lightspeed-chatbox-utils.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Conversation, SourcesCardProps } from '@patternfly/chatbot';\nimport { PopoverProps } from '@patternfly/react-core';\n\nimport {\n BaseMessage,\n ConversationList,\n ConversationSummary,\n ReferencedDocument,\n ReferencedDocuments,\n} from '../types';\n\nexport const getFootnoteProps = (\n additionalClassName: string,\n t?: (key: string, params?: any) => string,\n) => ({\n label:\n t?.('footer.accuracy.label') ||\n 'Always check AI/LLM generated responses for accuracy prior to use.',\n popover: {\n popoverProps: {\n className: additionalClassName ?? '',\n } as PopoverProps,\n title: t?.('footer.accuracy.popover.title') || 'Verify accuracy',\n description:\n t?.('footer.accuracy.popover.description') ||\n `While Developer Lightspeed strives for accuracy, there's always a possibility of errors. It's a good practice to verify critical information from reliable sources, especially if it's crucial for decision-making or actions.`,\n bannerImage: {\n src: 'https://cdn.dribbble.com/userupload/10651749/file/original-8a07b8e39d9e8bf002358c66fce1223e.gif',\n alt:\n t?.('footer.accuracy.popover.image.alt') ||\n 'Example image for footnote popover',\n },\n cta: {\n label: t?.('footer.accuracy.popover.cta.label') || 'Got it',\n onClick: () => {},\n },\n link: {\n label: t?.('footer.accuracy.popover.link.label') || 'Learn more',\n url: 'https://www.redhat.com/',\n },\n },\n});\n\nexport const getTimestampVariablesString = (v: number) => {\n if (v < 10) {\n return `0${v}`;\n }\n return `${v}`;\n};\n\nexport const getTimestamp = (unix_timestamp: number) => {\n if (typeof unix_timestamp !== 'number' || isNaN(unix_timestamp)) {\n // eslint-disable-next-line no-console\n console.error('Invalid Unix timestamp provided');\n return '';\n }\n\n const a = new Date(unix_timestamp);\n const month = getTimestampVariablesString(a.getMonth() + 1);\n const year = a.getFullYear();\n const date = getTimestampVariablesString(a.getDate());\n const hour = getTimestampVariablesString(a.getHours());\n const min = getTimestampVariablesString(a.getMinutes());\n const sec = getTimestampVariablesString(a.getSeconds());\n const time = `${date}/${month}/${year}, ${hour}:${min}:${sec}`;\n return time;\n};\n\nexport const splitJsonStrings = (jsonString: string): string[] => {\n const chunks = jsonString.split('}{');\n\n if (chunks.length <= 1) {\n return [jsonString];\n }\n\n return chunks.map((chunk, index, arr) => {\n if (index === 0) {\n return `${chunk}}`;\n } else if (index === arr.length - 1) {\n return `{${chunk}`;\n }\n return `{${chunk}}`;\n });\n};\n\ntype MessageProps = {\n content: string;\n timestamp: string;\n name?: string;\n avatar?: string | any;\n isLoading?: boolean;\n error?: {\n title: string;\n };\n sources?: SourcesCardProps;\n};\n\nexport const createMessage = ({\n role,\n name,\n avatar,\n isLoading = false,\n content,\n timestamp,\n error,\n sources,\n defaultUserName = 'Guest',\n}: MessageProps & { role: 'user' | 'bot'; defaultUserName?: string }) => ({\n role,\n name: name || defaultUserName,\n avatar,\n isLoading,\n content,\n timestamp,\n error,\n sources,\n});\n\nexport const createUserMessage = (\n props: MessageProps & { defaultUserName?: string },\n) =>\n createMessage({\n ...props,\n role: 'user',\n defaultUserName: props.defaultUserName,\n });\n\nexport const createBotMessage = (props: MessageProps) =>\n createMessage({\n ...props,\n role: 'bot',\n });\n\nexport const getMessageData = (message: BaseMessage) => {\n return {\n model: message?.response_metadata?.model,\n content: message?.content || '',\n timestamp: getTimestamp(message?.response_metadata?.created_at * 1000),\n referencedDocuments: message?.additional_kwargs?.referenced_documents ?? [],\n };\n};\n\nexport const transformDocumentsToSources = (\n referenced_documents: ReferencedDocuments,\n): SourcesCardProps | undefined => {\n if (!referenced_documents || referenced_documents?.length === 0) {\n return undefined;\n }\n return {\n sources: referenced_documents.map((doc: ReferencedDocument) => ({\n body: doc.doc_description,\n title: doc.doc_title,\n link: doc?.doc_url,\n isExternal: true,\n })),\n };\n};\n\nexport const getDayDifference = (sourceTime: number, targetTime: number) => {\n const sourceDate = new Date(sourceTime);\n const targetDate = new Date(targetTime);\n\n sourceDate.setHours(0, 0, 0, 0);\n targetDate.setHours(0, 0, 0, 0);\n\n const timeDifference = sourceDate.getTime() - targetDate.getTime();\n\n return Math.floor(timeDifference / (1000 * 60 * 60 * 24));\n};\n\nexport const getCategorizeMessages = (\n messages: ConversationList,\n addProps: (c: ConversationSummary) => { [k: string]: any },\n t?: (key: string, params?: any) => string,\n): { [k: string]: Conversation[] } => {\n const now: any = new Date();\n const today = now.toDateString();\n\n const categorizedMessages: { [k: string]: Conversation[] } = {\n [t?.('conversation.category.today') || 'Today']: [],\n [t?.('conversation.category.yesterday') || 'Yesterday']: [],\n [t?.('conversation.category.previous7Days') || 'Previous 7 Days']: [],\n [t?.('conversation.category.previous30Days') || 'Previous 30 Days']: [],\n };\n messages\n .sort((a, b) => b.last_message_timestamp - a.last_message_timestamp)\n .forEach(c => {\n const messageDate = new Date(c.last_message_timestamp * 1000);\n const messageDayString = messageDate.toDateString();\n const dayDifference = getDayDifference(\n now,\n c.last_message_timestamp * 1000,\n );\n const message: Conversation = {\n id: c.conversation_id,\n text: c.topic_summary,\n label: t?.('message.options.label') || 'Options',\n ...addProps(c),\n };\n\n if (messageDayString === today) {\n categorizedMessages[t?.('conversation.category.today') || 'Today'].push(\n message,\n );\n } else if (dayDifference === 1) {\n categorizedMessages[\n t?.('conversation.category.yesterday') || 'Yesterday'\n ].push(message);\n } else if (dayDifference <= 7) {\n categorizedMessages[\n t?.('conversation.category.previous7Days') || 'Previous 7 Days'\n ].push(message);\n } else if (dayDifference <= 30) {\n categorizedMessages[\n t?.('conversation.category.previous30Days') || 'Previous 30 Days'\n ].push(message);\n } else {\n // handle month-wise grouping\n const monthYear = messageDate.toLocaleString('default', {\n month: 'long',\n year: 'numeric',\n });\n if (!categorizedMessages[monthYear]) {\n categorizedMessages[monthYear] = [];\n }\n categorizedMessages[monthYear].push(message);\n }\n });\n\n const filteredCategories = Object.keys(categorizedMessages).reduce(\n (result, category) => {\n if (categorizedMessages[category].length > 0) {\n result[category] = categorizedMessages[category];\n }\n return result;\n },\n {} as any,\n );\n\n return filteredCategories;\n};\n"],"names":[],"mappings":"AA0Ba,MAAA,gBAAA,GAAmB,CAC9B,mBAAA,EACA,CACI,MAAA;AAAA,EACJ,KAAA,EACE,CAAI,GAAA,uBAAuB,CAC3B,IAAA,oEAAA;AAAA,EACF,OAAS,EAAA;AAAA,IACP,YAAc,EAAA;AAAA,MACZ,WAAW,mBAAuB,IAAA;AAAA,KACpC;AAAA,IACA,KAAA,EAAO,CAAI,GAAA,+BAA+B,CAAK,IAAA,iBAAA;AAAA,IAC/C,WAAA,EACE,CAAI,GAAA,qCAAqC,CACzC,IAAA,CAAA,8NAAA,CAAA;AAAA,IACF,WAAa,EAAA;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