@red-hat-developer-hub/backstage-plugin-lightspeed 0.5.4 → 0.5.6

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 (36) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +3 -3
  3. package/dist/api/LightspeedApiClient.esm.js +34 -0
  4. package/dist/api/LightspeedApiClient.esm.js.map +1 -1
  5. package/dist/api/api.esm.js.map +1 -1
  6. package/dist/components/LightSpeedChat.esm.js +5 -2
  7. package/dist/components/LightSpeedChat.esm.js.map +1 -1
  8. package/dist/components/LightspeedChatBox.esm.js +10 -2
  9. package/dist/components/LightspeedChatBox.esm.js.map +1 -1
  10. package/dist/components/LightspeedPage.esm.js +9 -2
  11. package/dist/components/LightspeedPage.esm.js.map +1 -1
  12. package/dist/components/PermissionRequiredState.esm.js +1 -1
  13. package/dist/components/PermissionRequiredState.esm.js.map +1 -1
  14. package/dist/const.esm.js +4 -4
  15. package/dist/const.esm.js.map +1 -1
  16. package/dist/hooks/useCaptureFeedback.esm.js +21 -0
  17. package/dist/hooks/useCaptureFeedback.esm.js.map +1 -0
  18. package/dist/hooks/useConversationMessages.esm.js +10 -11
  19. package/dist/hooks/useConversationMessages.esm.js.map +1 -1
  20. package/dist/hooks/useFeedbackActions.esm.js +246 -0
  21. package/dist/hooks/useFeedbackActions.esm.js.map +1 -0
  22. package/dist/hooks/useFeedbackState.esm.js +93 -0
  23. package/dist/hooks/useFeedbackState.esm.js.map +1 -0
  24. package/dist/hooks/useFeedbackStatus.esm.js +14 -0
  25. package/dist/hooks/useFeedbackStatus.esm.js.map +1 -0
  26. package/dist/hooks/useLightspeedDeletePermission.esm.js +2 -2
  27. package/dist/hooks/useLightspeedDeletePermission.esm.js.map +1 -1
  28. package/dist/hooks/useLightspeedViewPermission.esm.js +7 -7
  29. package/dist/hooks/useLightspeedViewPermission.esm.js.map +1 -1
  30. package/dist/images/bot-avatar.svg +15 -0
  31. package/dist/images/user-avatar.svg +4 -0
  32. package/dist/types.esm.js.map +1 -1
  33. package/dist/utils/lightspeed-chatbox-utils.esm.js +7 -8
  34. package/dist/utils/lightspeed-chatbox-utils.esm.js.map +1 -1
  35. package/package.json +4 -4
  36. package/dist/images/logo.svg +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"useLightspeedViewPermission.esm.js","sources":["../../src/hooks/useLightspeedViewPermission.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 { usePermission } from '@backstage/plugin-permission-react';\n\nimport {\n lightspeedConversationsCreatePermission,\n lightspeedConversationsReadPermission,\n} from '@red-hat-developer-hub/backstage-plugin-lightspeed-common';\n\nexport const useLightspeedViewPermission = () => {\n const canReadConversations = usePermission({\n permission: lightspeedConversationsReadPermission,\n });\n\n const canCreateConversations = usePermission({\n permission: lightspeedConversationsCreatePermission,\n });\n\n return {\n loading: canReadConversations.loading || canCreateConversations.loading,\n allowed: canReadConversations.allowed && canCreateConversations.allowed,\n };\n};\n"],"names":[],"mappings":";;;AAuBO,MAAM,8BAA8B,MAAM;AAC/C,EAAA,MAAM,uBAAuB,aAAc,CAAA;AAAA,IACzC,UAAY,EAAA;AAAA,GACb,CAAA;AAED,EAAA,MAAM,yBAAyB,aAAc,CAAA;AAAA,IAC3C,UAAY,EAAA;AAAA,GACb,CAAA;AAED,EAAO,OAAA;AAAA,IACL,OAAA,EAAS,oBAAqB,CAAA,OAAA,IAAW,sBAAuB,CAAA,OAAA;AAAA,IAChE,OAAA,EAAS,oBAAqB,CAAA,OAAA,IAAW,sBAAuB,CAAA;AAAA,GAClE;AACF;;;;"}
1
+ {"version":3,"file":"useLightspeedViewPermission.esm.js","sources":["../../src/hooks/useLightspeedViewPermission.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 { usePermission } from '@backstage/plugin-permission-react';\n\nimport {\n lightspeedChatCreatePermission,\n lightspeedChatReadPermission,\n} from '@red-hat-developer-hub/backstage-plugin-lightspeed-common';\n\nexport const useLightspeedViewPermission = () => {\n const canReadChats = usePermission({\n permission: lightspeedChatReadPermission,\n });\n\n const canCreateChats = usePermission({\n permission: lightspeedChatCreatePermission,\n });\n\n return {\n loading: canReadChats.loading || canCreateChats.loading,\n allowed: canReadChats.allowed && canCreateChats.allowed,\n };\n};\n"],"names":[],"mappings":";;;AAuBO,MAAM,8BAA8B,MAAM;AAC/C,EAAA,MAAM,eAAe,aAAc,CAAA;AAAA,IACjC,UAAY,EAAA;AAAA,GACb,CAAA;AAED,EAAA,MAAM,iBAAiB,aAAc,CAAA;AAAA,IACnC,UAAY,EAAA;AAAA,GACb,CAAA;AAED,EAAO,OAAA;AAAA,IACL,OAAA,EAAS,YAAa,CAAA,OAAA,IAAW,cAAe,CAAA,OAAA;AAAA,IAChD,OAAA,EAAS,YAAa,CAAA,OAAA,IAAW,cAAe,CAAA;AAAA,GAClD;AACF;;;;"}
@@ -0,0 +1,15 @@
1
+ <svg width="47" height="47" viewBox="0 0 47 47" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="23.5" cy="23.5" r="22.75" fill="white" stroke="#E0E0E0" stroke-width="1.5"/>
3
+ <path d="M24.5067 18.9867C24.0533 18.9867 23.68 18.6133 23.68 18.16V8.82667C23.68 8.37333 24.0533 8 24.5067 8C24.96 8 25.3333 8.37333 25.3333 8.82667V18.16C25.3333 18.6133 24.96 18.9867 24.5067 18.9867Z" fill="#EE0000"/>
4
+ <path d="M19.1733 24.3203H9.84C9.38667 24.3203 9.01334 23.947 9.01334 23.4937C9.01334 23.0403 9.38667 22.667 9.84 22.667H19.1733C19.6267 22.667 20 23.0403 20 23.4937C20 23.947 19.6267 24.3203 19.1733 24.3203Z" fill="#EE0000"/>
5
+ <path d="M24.5067 38.9867C24.0533 38.9867 23.68 38.6133 23.68 38.16V28.8267C23.68 28.3733 24.0533 28 24.5067 28C24.96 28 25.3333 28.3733 25.3333 28.8267V38.16C25.3333 38.6133 24.96 38.9867 24.5067 38.9867Z" fill="#EE0000"/>
6
+ <path d="M38.6133 23.813C38.6533 23.7197 38.6667 23.6263 38.6667 23.533C38.6667 23.533 38.6667 23.5063 38.6667 23.493C38.6667 23.4797 38.6667 23.4663 38.6667 23.453C38.6667 23.3597 38.6533 23.2663 38.6133 23.173C38.5867 23.1063 38.5467 23.053 38.5067 22.9997C38.48 22.973 38.4667 22.933 38.44 22.893L35.7733 20.2263C35.4533 19.9063 34.92 19.9063 34.6 20.2263C34.28 20.5463 34.28 21.0797 34.6 21.3997L35.84 22.6397H23.1867C22.7333 22.6397 22.36 23.013 22.36 23.4663C22.36 23.9197 22.7333 24.293 23.1867 24.293H35.84L34.6 25.533C34.28 25.853 34.28 26.3863 34.6 26.7063C34.76 26.8663 34.9733 26.9463 35.1867 26.9463C35.4 26.9463 35.6133 26.8663 35.7733 26.7063L38.44 24.0397C38.44 24.0397 38.48 23.973 38.5067 23.933C38.5467 23.8797 38.5867 23.8263 38.6133 23.7597V23.813Z" fill="black"/>
7
+ <path d="M20.5067 20.3197C20.2933 20.3197 20.08 20.2397 19.92 20.0797L14.5867 14.7463C14.2667 14.4263 14.2667 13.893 14.5867 13.573C14.9067 13.253 15.44 13.253 15.76 13.573L21.0933 18.9063C21.4133 19.2263 21.4133 19.7597 21.0933 20.0797C20.9333 20.2397 20.72 20.3197 20.5067 20.3197Z" fill="black"/>
8
+ <path d="M15.1733 33.6537C14.96 33.6537 14.7467 33.5737 14.5867 33.4137C14.2667 33.0937 14.2667 32.5603 14.5867 32.2403L19.92 26.907C20.24 26.587 20.7733 26.587 21.0933 26.907C21.4133 27.227 21.4133 27.7603 21.0933 28.0803L15.76 33.4137C15.6 33.5737 15.3867 33.6537 15.1733 33.6537Z" fill="black"/>
9
+ <path d="M21.0667 16.3205C20.68 16.3205 20.3333 16.0538 20.2533 15.6538L19.6933 12.9871C19.6 12.5338 19.88 12.0938 20.3333 12.0005C20.7867 11.8938 21.2267 12.1871 21.32 12.6405L21.88 15.3071C21.9733 15.7605 21.6933 16.2005 21.24 16.2938C21.1867 16.2938 21.12 16.3071 21.0667 16.3071V16.3205Z" fill="#EE0000"/>
10
+ <path d="M16.5067 20.8938C16.5067 20.8938 16.3867 20.8938 16.3333 20.8805L13.6667 20.3205C13.2133 20.2271 12.9333 19.7871 13.0267 19.3338C13.12 18.8805 13.56 18.5871 14.0133 18.6938L16.68 19.2538C17.1333 19.3471 17.4133 19.7871 17.32 20.2405C17.24 20.6271 16.8933 20.9071 16.5067 20.9071V20.8938Z" fill="#EE0000"/>
11
+ <path d="M20.5067 34.9868C20.5067 34.9868 20.3867 34.9868 20.3333 34.9735C19.88 34.8801 19.6 34.4401 19.6933 33.9868L20.2533 31.3201C20.3467 30.8668 20.7867 30.5735 21.24 30.6801C21.6933 30.7735 21.9733 31.2135 21.88 31.6668L21.32 34.3335C21.24 34.7201 20.8933 35.0001 20.5067 35.0001V34.9868Z" fill="#EE0000"/>
12
+ <path d="M13.84 28.3202C13.4533 28.3202 13.1067 28.0536 13.0267 27.6536C12.9333 27.2002 13.2133 26.7602 13.6667 26.6669L16.3333 26.1069C16.7867 26.0002 17.2267 26.2936 17.32 26.7469C17.4133 27.2002 17.1333 27.6402 16.68 27.7336L14.0133 28.2936C14.0133 28.2936 13.8933 28.3069 13.84 28.3069V28.3202Z" fill="#EE0000"/>
13
+ <path d="M9.84 18.9996C9.62667 18.9996 9.41333 18.9063 9.25333 18.7463C9.17333 18.6662 9.12 18.5863 9.06667 18.4796C9.02667 18.3729 9 18.2663 9 18.1596C9 17.9463 9.09333 17.7329 9.25333 17.5729C9.56 17.2663 10.12 17.2529 10.4267 17.5729C10.5867 17.7329 10.68 17.9463 10.68 18.1596C10.68 18.2663 10.6533 18.3729 10.6133 18.4796C10.5733 18.5863 10.5067 18.6662 10.4267 18.7463C10.2667 18.9063 10.0533 18.9996 9.84 18.9996Z" fill="black"/>
14
+ <path d="M9.84 29.6666C9.62667 29.6666 9.41333 29.5732 9.25333 29.4132C9.09333 29.2666 9 29.0399 9 28.8266C9 28.6132 9.09333 28.3999 9.25333 28.2399C9.56 27.9332 10.1067 27.9199 10.4267 28.2399C10.5867 28.3999 10.68 28.6132 10.68 28.8266C10.68 29.0399 10.5867 29.2666 10.4267 29.4132C10.2667 29.5732 10.0533 29.6666 9.84 29.6666Z" fill="black"/>
15
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="24" cy="24" r="24" fill="white"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M24.0625 23.5C27.7908 23.5 30.8125 20.4783 30.8125 16.75C30.8125 13.0217 27.7908 10 24.0625 10C20.3342 10 17.3125 13.0217 17.3125 16.75C17.3125 20.4783 20.3342 23.5 24.0625 23.5ZM33.3437 36.9999C34.7412 36.9999 35.8749 35.8661 35.8749 34.4687V32.275C35.8749 28.3621 32.7003 25.1875 28.7874 25.1875H27.9068C26.7361 25.7254 25.4336 26.0312 24.0625 26.0312C22.6914 26.0312 21.3941 25.7254 20.2181 25.1875H19.3375C15.4246 25.1875 12.25 28.3621 12.25 32.275V34.4687C12.25 35.8661 13.3838 36.9999 14.7812 36.9999H33.3437Z" fill="#1F1F1F"/>
4
+ </svg>
@@ -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 ReferencedDocuments = {\n doc_title: string;\n doc_url: string;\n}[];\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"],"names":["SupportedFileType"],"mappings":"AA0DY,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 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;;;;"}
@@ -5,7 +5,7 @@ const getFootnoteProps = (additionalClassName) => ({
5
5
  className: additionalClassName ?? ""
6
6
  },
7
7
  title: "Verify accuracy",
8
- description: `While 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.`,
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.`,
9
9
  bannerImage: {
10
10
  src: "https://cdn.dribbble.com/userupload/10651749/file/original-8a07b8e39d9e8bf002358c66fce1223e.gif",
11
11
  alt: "Example image for footnote popover"
@@ -83,13 +83,12 @@ const transformDocumentsToSources = (referenced_documents) => {
83
83
  return undefined;
84
84
  }
85
85
  return {
86
- sources: referenced_documents.map(
87
- (doc) => ({
88
- title: doc.doc_title,
89
- link: doc?.doc_url,
90
- isExternal: true
91
- })
92
- )
86
+ sources: referenced_documents.map((doc) => ({
87
+ body: doc.doc_description,
88
+ title: doc.doc_title,
89
+ link: doc?.doc_url,
90
+ isExternal: true
91
+ }))
93
92
  };
94
93
  };
95
94
  const getDayDifference = (sourceTime, targetTime) => {
@@ -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 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 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(\n (doc: { doc_title: string; doc_url: string }) => ({\n title: doc.doc_title,\n link: doc?.doc_url,\n isExternal: true,\n }),\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;\n};\n"],"names":[],"mappings":"AAyBa,MAAA,gBAAA,GAAmB,CAAC,mBAAiC,MAAA;AAAA,EAChE,KAAO,EAAA,oEAAA;AAAA,EACP,OAAS,EAAA;AAAA,IACP,YAAc,EAAA;AAAA,MACZ,WAAW,mBAAuB,IAAA;AAAA,KACpC;AAAA,IACA,KAAO,EAAA,iBAAA;AAAA,IACP,WAAa,EAAA,CAAA,oNAAA,CAAA;AAAA,IACb,WAAa,EAAA;AAAA,MACX,GAAK,EAAA,iGAAA;AAAA,MACL,GAAK,EAAA;AAAA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,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 = (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;\n};\n"],"names":[],"mappings":"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,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;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@red-hat-developer-hub/backstage-plugin-lightspeed",
3
- "version": "0.5.4",
3
+ "version": "0.5.6",
4
4
  "main": "dist/index.esm.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -44,9 +44,9 @@
44
44
  "@material-ui/core": "^4.9.13",
45
45
  "@material-ui/lab": "^4.0.0-alpha.61",
46
46
  "@mui/icons-material": "^6.1.8",
47
- "@patternfly/chatbot": "6.3.0-prerelease.23",
47
+ "@patternfly/chatbot": "6.3.0-prerelease.25",
48
48
  "@patternfly/react-core": "6.3.0-prerelease.17",
49
- "@red-hat-developer-hub/backstage-plugin-lightspeed-common": "^0.3.1",
49
+ "@red-hat-developer-hub/backstage-plugin-lightspeed-common": "^0.3.3",
50
50
  "@tanstack/react-query": "^5.59.15",
51
51
  "openai": "^4.52.6",
52
52
  "react-markdown": "^9.0.1",
@@ -69,7 +69,7 @@
69
69
  "@testing-library/react": "^15.0.0",
70
70
  "@testing-library/user-event": "14.6.1",
71
71
  "msw": "1.3.5",
72
- "prettier": "3.5.3",
72
+ "prettier": "3.6.2",
73
73
  "react": "16.13.1 || ^17.0.0 || ^18.0.0",
74
74
  "react-dom": "16.13.1 || ^17.0.0 || ^18.0.0",
75
75
  "react-router-dom": "^6.0.0"
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?><svg id="uuid-46701468-6641-48cb-987a-ad8aaaa4cc57" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 38"><defs><style>.uuid-05c8f53d-396a-4a77-b610-4cae1607b37f{fill:#e00;}.uuid-058b635d-b61c-46f4-982a-a91d6a2263eb{fill:#fff;}.uuid-0168188c-d0a6-496e-a2d8-5cd6ee30dcb2{fill:#e0e0e0;}</style></defs><path class="uuid-058b635d-b61c-46f4-982a-a91d6a2263eb" d="m28,1H10C5.02944,1,1,5.02944,1,10v18c0,4.97057,4.02944,9,9,9h18c4.97056,0,9-4.02943,9-9V10c0-4.97056-4.02944-9-9-9h0Z"/><path class="uuid-0168188c-d0a6-496e-a2d8-5cd6ee30dcb2" d="m28,2.25c4.27332,0,7.75,3.47664,7.75,7.75v18c0,4.27336-3.47668,7.75-7.75,7.75H10c-4.27332,0-7.75-3.47664-7.75-7.75V10c0-4.27336,3.47668-7.75,7.75-7.75h18m0-1.25H10C5.02942,1,1,5.02944,1,10v18c0,4.97057,4.02942,9,9,9h18c4.97058,0,9-4.02943,9-9V10c0-4.97056-4.02942-9-9-9h0Z"/><path class="uuid-05c8f53d-396a-4a77-b610-4cae1607b37f" d="m20,15.625c-.34473,0-.625-.28027-.625-.625v-7c0-.34473.28027-.625.625-.625s.625.28027.625.625v7c0,.34473-.28027.625-.625.625Z"/><path class="uuid-05c8f53d-396a-4a77-b610-4cae1607b37f" d="m16,19.625h-7c-.34473,0-.625-.28027-.625-.625s.28027-.625.625-.625h7c.34473,0,.625.28027.625.625s-.28027.625-.625.625Z"/><path class="uuid-05c8f53d-396a-4a77-b610-4cae1607b37f" d="m20,30.625c-.34473,0-.625-.28027-.625-.625v-7c0-.34473.28027-.625.625-.625s.625.28027.625.625v7c0,.34473-.28027.625-.625.625Z"/><path d="m30.57654,19.23944c.02795-.06769.03955-.13947.04285-.21149.00049-.00983.00562-.01807.00562-.02795s-.00513-.01813-.00562-.02795c-.0033-.07202-.01489-.1438-.04285-.21149-.02002-.04791-.05383-.08667-.08447-.12775-.01807-.02448-.02759-.05304-.04968-.0752l-2-2c-.24414-.24414-.64062-.24414-.88477,0-.24316.24414-.24316.64062,0,.88477l.93323.93262h-9.49084c-.34473,0-.625.28027-.625.625s.28027.625.625.625h9.49084l-.93323.93262c-.24316.24414-.24316.64062,0,.88477.12207.12207.28223.18262.44238.18262s.32031-.06055.44238-.18262l2-2c.02209-.02216.03162-.05072.04968-.0752.03064-.04108.06445-.07983.08447-.12775Z"/><path d="m17,16.625c-.16016,0-.32031-.06055-.44238-.18262l-4-4c-.24316-.24414-.24316-.64062,0-.88477.24414-.24414.64062-.24414.88477,0l4,4c.24316.24414.24316.64062,0,.88477-.12207.12207-.28223.18262-.44238.18262Z"/><path d="m13,26.625c-.16016,0-.32031-.06055-.44238-.18262-.24316-.24414-.24316-.64062,0-.88477l4-4c.24414-.24414.64062-.24414.88477,0,.24316.24414.24316.64062,0,.88477l-4,4c-.12207.12207-.28223.18262-.44238.18262Z"/><path class="uuid-05c8f53d-396a-4a77-b610-4cae1607b37f" d="m17.42383,13.625c-.28809,0-.54785-.20117-.61035-.49512l-.4248-2c-.07129-.33789.14355-.66992.48145-.74121.33887-.0752.66992.14355.74121.48145l.4248,2c.07129.33789-.14355.66992-.48145.74121-.04395.00977-.08789.01367-.13086.01367Z"/><path class="uuid-05c8f53d-396a-4a77-b610-4cae1607b37f" d="m14.00098,17.0498c-.04297,0-.08691-.00391-.13086-.01367l-2-.4248c-.33789-.07129-.55273-.40332-.48145-.74121.07227-.33789.40234-.55859.74121-.48145l2,.4248c.33789.07129.55273.40332.48145.74121-.0625.29395-.32227.49512-.61035.49512Z"/><path class="uuid-05c8f53d-396a-4a77-b610-4cae1607b37f" d="m17.00098,27.625c-.04297,0-.08691-.00391-.13086-.01367-.33789-.07129-.55273-.40332-.48145-.74121l.4248-2c.07227-.33789.40137-.55566.74121-.48145.33789.07129.55273.40332.48145.74121l-.4248,2c-.0625.29395-.32227.49512-.61035.49512Z"/><path class="uuid-05c8f53d-396a-4a77-b610-4cae1607b37f" d="m11.99902,22.625c-.28809,0-.54785-.20117-.61035-.49512-.07129-.33789.14355-.66992.48145-.74121l2-.4248c.34082-.07617.66992.14355.74121.48145s-.14355.66992-.48145.74121l-2,.4248c-.04395.00977-.08789.01367-.13086.01367Z"/><path d="m9,15.62988c-.16016,0-.32031-.07031-.44043-.19043-.05957-.05957-.09961-.12012-.13965-.19922-.03027-.08008-.0498-.16016-.0498-.24023,0-.16016.06934-.32031.18945-.44043.23047-.22949.65039-.24023.87988,0,.12012.12012.19043.28027.19043.44043,0,.08008-.02051.16016-.0498.24023-.03027.0791-.08008.13965-.14062.19922-.12012.12012-.2793.19043-.43945.19043Z"/><path d="m9,23.62988c-.16016,0-.32031-.07031-.44043-.19043-.12012-.10938-.18945-.2793-.18945-.43945s.06934-.32031.18945-.44043c.23047-.22949.64062-.24023.87988,0,.12012.12012.19043.28027.19043.44043s-.07031.33008-.19043.43945c-.12012.12012-.2793.19043-.43945.19043Z"/></svg>