@red-hat-developer-hub/backstage-plugin-intelligent-assistant 5.0.0 → 5.0.2

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 (102) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/alpha.d.ts +1 -2
  3. package/dist/components/Attachment.esm.js +14 -14
  4. package/dist/components/Attachment.esm.js.map +1 -1
  5. package/dist/components/CollapsedHistoryStrip.esm.js +46 -51
  6. package/dist/components/CollapsedHistoryStrip.esm.js.map +1 -1
  7. package/dist/components/DeleteModal.esm.js +1 -0
  8. package/dist/components/DeleteModal.esm.js.map +1 -1
  9. package/dist/components/FilePreview.esm.js +3 -2
  10. package/dist/components/FilePreview.esm.js.map +1 -1
  11. package/dist/components/LightSpeedChat.esm.js +580 -745
  12. package/dist/components/LightSpeedChat.esm.js.map +1 -1
  13. package/dist/components/LightspeedChatBox.esm.js +44 -72
  14. package/dist/components/LightspeedChatBox.esm.js.map +1 -1
  15. package/dist/components/LightspeedChatBoxHeader.esm.js +38 -34
  16. package/dist/components/LightspeedChatBoxHeader.esm.js.map +1 -1
  17. package/dist/components/LightspeedChatContainer.esm.js +6 -8
  18. package/dist/components/LightspeedChatContainer.esm.js.map +1 -1
  19. package/dist/components/LightspeedChatModelsState.esm.js +67 -73
  20. package/dist/components/LightspeedChatModelsState.esm.js.map +1 -1
  21. package/dist/components/LightspeedDrawerContext.esm.js.map +1 -1
  22. package/dist/components/LightspeedDrawerProvider.esm.js +13 -16
  23. package/dist/components/LightspeedDrawerProvider.esm.js.map +1 -1
  24. package/dist/components/LightspeedFABContent.esm.js +40 -9
  25. package/dist/components/LightspeedFABContent.esm.js.map +1 -1
  26. package/dist/components/LightspeedPage.esm.js +1 -10
  27. package/dist/components/LightspeedPage.esm.js.map +1 -1
  28. package/dist/components/McpConfigureServerModal.esm.js +79 -86
  29. package/dist/components/McpConfigureServerModal.esm.js.map +1 -1
  30. package/dist/components/McpServersSettings.esm.js +246 -212
  31. package/dist/components/McpServersSettings.esm.js.map +1 -1
  32. package/dist/components/MessageBarModelSelector.esm.js +29 -33
  33. package/dist/components/MessageBarModelSelector.esm.js.map +1 -1
  34. package/dist/components/PermissionRequiredState.esm.js +63 -63
  35. package/dist/components/PermissionRequiredState.esm.js.map +1 -1
  36. package/dist/components/RagSourceLabel.esm.js +22 -0
  37. package/dist/components/RagSourceLabel.esm.js.map +1 -0
  38. package/dist/components/RenameConversationModal.esm.js +38 -31
  39. package/dist/components/RenameConversationModal.esm.js.map +1 -1
  40. package/dist/components/Router.esm.js +4 -13
  41. package/dist/components/Router.esm.js.map +1 -1
  42. package/dist/components/SourcesChipModal.esm.js +94 -89
  43. package/dist/components/SourcesChipModal.esm.js.map +1 -1
  44. package/dist/components/ToastAlertGroup.esm.js +24 -40
  45. package/dist/components/ToastAlertGroup.esm.js.map +1 -1
  46. package/dist/components/ToolCallContent.esm.js +8 -11
  47. package/dist/components/ToolCallContent.esm.js.map +1 -1
  48. package/dist/components/notebooks/AddDocumentModal.esm.js +232 -252
  49. package/dist/components/notebooks/AddDocumentModal.esm.js.map +1 -1
  50. package/dist/components/notebooks/DeleteDocumentModal.esm.js +35 -77
  51. package/dist/components/notebooks/DeleteDocumentModal.esm.js.map +1 -1
  52. package/dist/components/notebooks/DeleteNotebookModal.esm.js +46 -81
  53. package/dist/components/notebooks/DeleteNotebookModal.esm.js.map +1 -1
  54. package/dist/components/notebooks/DocumentSidebar.esm.js +172 -196
  55. package/dist/components/notebooks/DocumentSidebar.esm.js.map +1 -1
  56. package/dist/components/notebooks/FileListItem.esm.js +69 -57
  57. package/dist/components/notebooks/FileListItem.esm.js.map +1 -1
  58. package/dist/components/notebooks/FileTypeIcon.esm.js +17 -27
  59. package/dist/components/notebooks/FileTypeIcon.esm.js.map +1 -1
  60. package/dist/components/notebooks/NotebookCard.esm.js +86 -25
  61. package/dist/components/notebooks/NotebookCard.esm.js.map +1 -1
  62. package/dist/components/notebooks/NotebookView.esm.js +367 -380
  63. package/dist/components/notebooks/NotebookView.esm.js.map +1 -1
  64. package/dist/components/notebooks/NotebooksTab.esm.js +93 -30
  65. package/dist/components/notebooks/NotebooksTab.esm.js.map +1 -1
  66. package/dist/components/notebooks/OverwriteConfirmModal.esm.js +142 -184
  67. package/dist/components/notebooks/OverwriteConfirmModal.esm.js.map +1 -1
  68. package/dist/components/notebooks/UploadResourceScreen.esm.js +58 -50
  69. package/dist/components/notebooks/UploadResourceScreen.esm.js.map +1 -1
  70. package/dist/components/notebooks/notebookDialogStyles.esm.js +33 -37
  71. package/dist/components/notebooks/notebookDialogStyles.esm.js.map +1 -1
  72. package/dist/const.esm.js +15 -2
  73. package/dist/const.esm.js.map +1 -1
  74. package/dist/hooks/useAutoScroll.esm.js +11 -11
  75. package/dist/hooks/useAutoScroll.esm.js.map +1 -1
  76. package/dist/hooks/useBufferedMessages.esm.js +5 -5
  77. package/dist/hooks/useBufferedMessages.esm.js.map +1 -1
  78. package/dist/hooks/useFeedbackActions.esm.js.map +1 -1
  79. package/dist/hooks/useIsMobile.esm.js +3 -3
  80. package/dist/hooks/useIsMobile.esm.js.map +1 -1
  81. package/dist/translations/de.esm.js +1 -2
  82. package/dist/translations/de.esm.js.map +1 -1
  83. package/dist/translations/es.esm.js +1 -2
  84. package/dist/translations/es.esm.js.map +1 -1
  85. package/dist/translations/fr.esm.js +1 -2
  86. package/dist/translations/fr.esm.js.map +1 -1
  87. package/dist/translations/it.esm.js +1 -2
  88. package/dist/translations/it.esm.js.map +1 -1
  89. package/dist/translations/ja.esm.js +1 -2
  90. package/dist/translations/ja.esm.js.map +1 -1
  91. package/dist/translations/ref.esm.js +1 -2
  92. package/dist/translations/ref.esm.js.map +1 -1
  93. package/dist/types.esm.js.map +1 -1
  94. package/dist/utils/fab-anchor-utils.esm.js +41 -0
  95. package/dist/utils/fab-anchor-utils.esm.js.map +1 -0
  96. package/dist/utils/lightspeed-chatbox-utils.esm.js +13 -6
  97. package/dist/utils/lightspeed-chatbox-utils.esm.js.map +1 -1
  98. package/dist/utils/scoped-dialog-utils.esm.js +6 -3
  99. package/dist/utils/scoped-dialog-utils.esm.js.map +1 -1
  100. package/package.json +5 -9
  101. package/dist/utils/generateClassName.esm.js +0 -12
  102. package/dist/utils/generateClassName.esm.js.map +0 -1
@@ -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\n/**\n * @public\n * Referenced document metadata\n */\nexport type ReferencedDocument = {\n doc_title: string;\n doc_url: string;\n doc_description?: string;\n};\n\n/**\n * @public\n * List of referenced documents\n */\nexport type ReferencedDocuments = ReferencedDocument[];\n\n/**\n * @public\n * LCS model type - embedding or llm\n */\nexport type LCSModelType = 'embedding' | 'llm';\n\n/**\n * @public\n * LCS model API model type\n */\nexport type LCSModelApiModelType = 'embedding' | 'llm';\n\n/**\n * @public\n * LCS Model interface\n */\nexport interface LCSModel {\n identifier: string;\n metadata: {\n embedding_dimension: number;\n };\n api_model_type: LCSModelApiModelType;\n provider_id: string;\n type: 'model';\n provider_resource_id: string;\n model_type: LCSModelType;\n}\nexport interface LCSConversation {\n provider: string;\n model: string;\n messages: BaseMessage[];\n started_at: string;\n completed_at: string;\n referenced_documents?: ReferencedDocuments;\n}\n\nexport interface LCSShield {\n identifier: string;\n provider_id: string;\n type: 'shield';\n params: {};\n provider_resource_id: string;\n}\n\n/**\n * @public\n * Base message interface for chat messages\n */\nexport interface BaseMessage {\n name: string;\n type: string;\n id: number;\n content: string;\n model: string;\n timestamp: string;\n sources?: SourcesCardProps;\n referenced_documents?: ReferencedDocuments;\n error?: AlertProps;\n}\n\n/**\n * @public\n * Conversation summary type\n */\nexport type ConversationSummary = {\n conversation_id: string;\n last_message_timestamp: number;\n topic_summary: string | null;\n};\n\nexport enum SupportedFileType {\n JSON = 'application/json',\n YAML = 'application/x-yaml',\n TEXT = 'text/plain',\n}\nexport interface FileContent {\n content: string;\n type: string;\n name: string;\n}\n\n/**\n * @public\n * Attachment type for file attachments in chat messages\n */\nexport type Attachment = {\n attachment_type: string;\n content_type: string;\n content: string;\n};\n\n/**\n * @public\n * List of conversation summaries\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\n/**\n * @public\n * Feedback capture payload for user feedback on AI responses\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\n// Tool Calling Types\nexport interface ToolCall {\n id: number | string;\n toolName: string;\n description?: string;\n arguments: Record<string, any>;\n response?: string;\n startTime: number;\n endTime?: number;\n executionTime?: number; // in seconds\n isLoading: boolean;\n}\n\nexport interface ToolCallEvent {\n id: number | string;\n token?: string | { tool_name: string; arguments: Record<string, any> };\n name?: string;\n args?: Record<string, any>;\n arguments?: Record<string, any>;\n type?: string;\n}\n\nexport interface ToolResultEvent {\n id: number | string;\n token?: { tool_name: string; response: string };\n status?: string;\n content?: string;\n}\n\n/**\n * @public\n * Notebook session metadata from AI Notebooks API\n */\nexport type NotebookSessionMetadata = {\n category?: string;\n tags?: string[];\n project?: string;\n document_ids?: string[];\n conversation_id?: string;\n};\n\n/**\n * @public\n * Notebook session from AI Notebooks API\n */\nexport type NotebookSession = {\n session_id: string;\n user_id: string;\n name: string;\n description?: string;\n created_at: string;\n updated_at: string;\n document_count?: number;\n metadata?: NotebookSessionMetadata;\n};\n\n/**\n * @public\n * Supported file types for notebook document uploads\n */\nexport type NotebookDocumentSourceType =\n 'text' | 'pdf' | 'md' | 'json' | 'yaml' | 'log';\n\n/**\n * @public\n * Document within a notebook session\n */\nexport type SessionDocument = {\n document_id: string;\n title: string;\n session_id: string;\n user_id: string;\n source_type: NotebookDocumentSourceType;\n created_at: string;\n metadata?: Record<string, any>;\n};\n\n/**\n * @public\n * Response from the document upload endpoint (HTTP 202)\n */\nexport type UploadDocumentResponse = {\n status: 'processing';\n document_id: string;\n session_id: string;\n message: string;\n};\n\n/**\n * @public\n * Document processing status from the status polling endpoint\n */\nexport type DocumentStatus = {\n status: 'in_progress' | 'completed' | 'failed' | 'cancelled';\n document_id: string;\n session_id: string;\n error?: string;\n};\n\n/**\n * @public\n * Response wrapper for session creation\n */\nexport type SessionResponse = {\n status: 'success' | 'error';\n session?: NotebookSession;\n message?: string;\n error?: string;\n};\n\n/**\n * @public\n * Response wrapper for document list\n */\nexport type DocumentListResponse = {\n status: 'success' | 'error';\n session_id?: string;\n documents?: SessionDocument[];\n count?: number;\n error?: string;\n};\n"],"names":["SupportedFileType"],"mappings":"AAqHO,IAAK,iBAAA,qBAAAA,kBAAAA,KAAL;AACL,EAAAA,mBAAA,MAAA,CAAA,GAAO,kBAAA;AACP,EAAAA,mBAAA,MAAA,CAAA,GAAO,oBAAA;AACP,EAAAA,mBAAA,MAAA,CAAA,GAAO,YAAA;AAHG,EAAA,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\n/**\n * @public\n * Referenced document metadata\n */\nexport type ReferencedDocument = {\n doc_title: string;\n doc_url: string;\n doc_description?: string;\n source?: string;\n};\n\n/**\n * @public\n * List of referenced documents\n */\nexport type ReferencedDocuments = ReferencedDocument[];\n\n/**\n * @public\n * LCS model type - embedding or llm\n */\nexport type LCSModelType = 'embedding' | 'llm';\n\n/**\n * @public\n * LCS model API model type\n */\nexport type LCSModelApiModelType = 'embedding' | 'llm';\n\n/**\n * @public\n * LCS Model interface\n */\nexport interface LCSModel {\n identifier: string;\n metadata: {\n embedding_dimension: number;\n };\n api_model_type: LCSModelApiModelType;\n provider_id: string;\n type: 'model';\n provider_resource_id: string;\n model_type: LCSModelType;\n /**\n * Whether the model supports vision (JPEG image) input, set by the backend\n * GET /v1/models handler; absent if capability could not be determined.\n */\n supportsVision?: boolean;\n}\nexport interface LCSConversation {\n provider: string;\n model: string;\n messages: BaseMessage[];\n started_at: string;\n completed_at: string;\n referenced_documents?: ReferencedDocuments;\n}\n\nexport interface LCSShield {\n identifier: string;\n provider_id: string;\n type: 'shield';\n params: {};\n provider_resource_id: string;\n}\n\n/**\n * @public\n * Base message interface for chat messages\n */\nexport interface BaseMessage {\n name: string;\n type: string;\n id: number;\n content: string;\n model: string;\n timestamp: string;\n sources?: SourcesCardProps;\n referenced_documents?: ReferencedDocuments;\n error?: AlertProps;\n}\n\n/**\n * @public\n * Conversation summary type\n */\nexport type ConversationSummary = {\n conversation_id: string;\n last_message_timestamp: number;\n topic_summary: string | null;\n};\n\nexport enum SupportedFileType {\n JSON = 'application/json',\n YAML = 'application/x-yaml',\n TEXT = 'text/plain',\n}\nexport interface FileContent {\n content: string;\n type: string;\n name: string;\n}\n\n/**\n * @public\n * Attachment type for file attachments in chat messages\n */\nexport type Attachment = {\n attachment_type: string;\n content_type: string;\n content: string;\n};\n\n/**\n * @public\n * List of conversation summaries\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\n/**\n * @public\n * Feedback capture payload for user feedback on AI responses\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\n// Tool Calling Types\nexport interface ToolCall {\n id: number | string;\n toolName: string;\n description?: string;\n arguments: Record<string, any>;\n response?: string;\n startTime: number;\n endTime?: number;\n executionTime?: number; // in seconds\n isLoading: boolean;\n}\n\nexport interface ToolCallEvent {\n id: number | string;\n token?: string | { tool_name: string; arguments: Record<string, any> };\n name?: string;\n args?: Record<string, any>;\n arguments?: Record<string, any>;\n type?: string;\n}\n\nexport interface ToolResultEvent {\n id: number | string;\n token?: { tool_name: string; response: string };\n status?: string;\n content?: string;\n}\n\n/**\n * @public\n * Notebook session metadata from AI Notebooks API\n */\nexport type NotebookSessionMetadata = {\n category?: string;\n tags?: string[];\n project?: string;\n document_ids?: string[];\n conversation_id?: string;\n};\n\n/**\n * @public\n * Notebook session from AI Notebooks API\n */\nexport type NotebookSession = {\n session_id: string;\n user_id: string;\n name: string;\n description?: string;\n created_at: string;\n updated_at: string;\n document_count?: number;\n metadata?: NotebookSessionMetadata;\n};\n\n/**\n * @public\n * Supported file types for notebook document uploads\n */\nexport type NotebookDocumentSourceType =\n 'text' | 'pdf' | 'md' | 'json' | 'yaml' | 'log';\n\n/**\n * @public\n * Document within a notebook session\n */\nexport type SessionDocument = {\n document_id: string;\n title: string;\n session_id: string;\n user_id: string;\n source_type: NotebookDocumentSourceType;\n created_at: string;\n metadata?: Record<string, any>;\n};\n\n/**\n * @public\n * Response from the document upload endpoint (HTTP 202)\n */\nexport type UploadDocumentResponse = {\n status: 'processing';\n document_id: string;\n session_id: string;\n message: string;\n};\n\n/**\n * @public\n * Document processing status from the status polling endpoint\n */\nexport type DocumentStatus = {\n status: 'in_progress' | 'completed' | 'failed' | 'cancelled';\n document_id: string;\n session_id: string;\n error?: string;\n};\n\n/**\n * @public\n * Response wrapper for session creation\n */\nexport type SessionResponse = {\n status: 'success' | 'error';\n session?: NotebookSession;\n message?: string;\n error?: string;\n};\n\n/**\n * @public\n * Response wrapper for document list\n */\nexport type DocumentListResponse = {\n status: 'success' | 'error';\n session_id?: string;\n documents?: SessionDocument[];\n count?: number;\n error?: string;\n};\n"],"names":["SupportedFileType"],"mappings":"AA2HO,IAAK,iBAAA,qBAAAA,kBAAAA,KAAL;AACL,EAAAA,mBAAA,MAAA,CAAA,GAAO,kBAAA;AACP,EAAAA,mBAAA,MAAA,CAAA,GAAO,oBAAA;AACP,EAAAA,mBAAA,MAAA,CAAA,GAAO,YAAA;AAHG,EAAA,OAAAA,kBAAAA;AAAA,CAAA,EAAA,iBAAA,IAAA,EAAA;;;;"}
@@ -0,0 +1,41 @@
1
+ import { LIGHTSPEED_FAB_ANCHOR_VARS } from '../const.esm.js';
2
+
3
+ const getLightspeedFabEdgeInset = (theme) => theme.spacing(2);
4
+ const getLightspeedOverlayGap = (theme) => theme.spacing(2);
5
+ const getLightspeedDockedDrawerGutter = (theme) => theme.spacing(3);
6
+ function publishLightspeedFabAnchorVars({
7
+ fabElement,
8
+ theme
9
+ }) {
10
+ const root = document.documentElement;
11
+ root.style.setProperty(
12
+ LIGHTSPEED_FAB_ANCHOR_VARS.overlayGap,
13
+ getLightspeedOverlayGap(theme)
14
+ );
15
+ root.style.setProperty(
16
+ LIGHTSPEED_FAB_ANCHOR_VARS.dockedDrawerGutter,
17
+ getLightspeedDockedDrawerGutter(theme)
18
+ );
19
+ const rect = fabElement.getBoundingClientRect();
20
+ if (rect.width < 1 || rect.height < 1) {
21
+ return;
22
+ }
23
+ root.style.setProperty(
24
+ LIGHTSPEED_FAB_ANCHOR_VARS.insetBlockEnd,
25
+ `${window.innerHeight - rect.bottom}px`
26
+ );
27
+ root.style.setProperty(
28
+ LIGHTSPEED_FAB_ANCHOR_VARS.insetInlineEnd,
29
+ `${window.innerWidth - rect.right}px`
30
+ );
31
+ root.style.setProperty(LIGHTSPEED_FAB_ANCHOR_VARS.height, `${rect.height}px`);
32
+ }
33
+ function clearLightspeedFabAnchorVars() {
34
+ const root = document.documentElement;
35
+ Object.values(LIGHTSPEED_FAB_ANCHOR_VARS).forEach((varName) => {
36
+ root.style.removeProperty(varName);
37
+ });
38
+ }
39
+
40
+ export { clearLightspeedFabAnchorVars, getLightspeedDockedDrawerGutter, getLightspeedFabEdgeInset, getLightspeedOverlayGap, publishLightspeedFabAnchorVars };
41
+ //# sourceMappingURL=fab-anchor-utils.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fab-anchor-utils.esm.js","sources":["../../src/utils/fab-anchor-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 */\n\nimport type { Theme } from '@mui/material/styles';\n\nimport { LIGHTSPEED_FAB_ANCHOR_VARS } from '../const';\n\n/** Viewport edge inset for the FAB anchor wrapper (theme spacing token). */\nexport const getLightspeedFabEdgeInset = (theme: Theme) => theme.spacing(2);\n\n/** Gap between the FAB and overlay chatbot (theme spacing token). */\nexport const getLightspeedOverlayGap = (theme: Theme) => theme.spacing(2);\n\n/**\n * Extra gutter between the docked app drawer and shifted FAB/overlay.\n * Matches the legacy app shell `1.5em` gutter using theme spacing.\n */\nexport const getLightspeedDockedDrawerGutter = (theme: Theme) =>\n theme.spacing(3);\n\ntype PublishFabAnchorArgs = {\n fabElement: HTMLElement;\n theme: Theme;\n};\n\n/**\n * Publishes FAB anchor metrics on :root for overlay/docked layout.\n * All positioning consumers must read these vars — no duplicate calc logic.\n */\nexport function publishLightspeedFabAnchorVars({\n fabElement,\n theme,\n}: PublishFabAnchorArgs) {\n const root = document.documentElement;\n root.style.setProperty(\n LIGHTSPEED_FAB_ANCHOR_VARS.overlayGap,\n getLightspeedOverlayGap(theme),\n );\n root.style.setProperty(\n LIGHTSPEED_FAB_ANCHOR_VARS.dockedDrawerGutter,\n getLightspeedDockedDrawerGutter(theme),\n );\n\n const rect = fabElement.getBoundingClientRect();\n if (rect.width < 1 || rect.height < 1) {\n return;\n }\n\n root.style.setProperty(\n LIGHTSPEED_FAB_ANCHOR_VARS.insetBlockEnd,\n `${window.innerHeight - rect.bottom}px`,\n );\n root.style.setProperty(\n LIGHTSPEED_FAB_ANCHOR_VARS.insetInlineEnd,\n `${window.innerWidth - rect.right}px`,\n );\n root.style.setProperty(LIGHTSPEED_FAB_ANCHOR_VARS.height, `${rect.height}px`);\n}\n\nexport function clearLightspeedFabAnchorVars() {\n const root = document.documentElement;\n Object.values(LIGHTSPEED_FAB_ANCHOR_VARS).forEach(varName => {\n root.style.removeProperty(varName);\n });\n}\n"],"names":[],"mappings":";;AAqBO,MAAM,yBAAA,GAA4B,CAAC,KAAA,KAAiB,KAAA,CAAM,QAAQ,CAAC;AAGnE,MAAM,uBAAA,GAA0B,CAAC,KAAA,KAAiB,KAAA,CAAM,QAAQ,CAAC;AAMjE,MAAM,+BAAA,GAAkC,CAAC,KAAA,KAC9C,KAAA,CAAM,QAAQ,CAA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atbotFootnote } from '@patternfly/chatbot';
3
3
  import { Spinner } from '@patternfly/react-core';
4
4
  import { ThumbtackIcon } from '@patternfly/react-icons';
5
5
  import { RhUiAiInfoIcon } from '@patternfly/react-icons/dist/esm/icons/rh-ui-ai-info-icon';
6
+ import { RagSourceLabel } from '../components/RagSourceLabel.esm.js';
6
7
 
7
8
  const getFootnoteProps = (t) => ({
8
9
  label: t?.("footer.accuracy.label") || "Always review AI generated content prior to use."
@@ -151,12 +152,18 @@ const transformDocumentsToSources = (referenced_documents) => {
151
152
  return void 0;
152
153
  }
153
154
  return {
154
- sources: referenced_documents.map((doc) => ({
155
- body: doc.doc_description,
156
- title: doc.doc_title,
157
- link: doc?.doc_url,
158
- isExternal: !!doc?.doc_url
159
- }))
155
+ sources: referenced_documents.map(
156
+ (doc) => ({
157
+ body: doc.doc_description,
158
+ title: doc.doc_title,
159
+ link: doc?.doc_url,
160
+ isExternal: !!doc?.doc_url,
161
+ ...doc.source ? {
162
+ headerContent: /* @__PURE__ */ jsx(RagSourceLabel, { source: doc.source }),
163
+ ragSource: doc.source
164
+ } : {}
165
+ })
166
+ )
160
167
  };
161
168
  };
162
169
  const sortConversations = (messages, sortOption) => {
@@ -1 +1 @@
1
- {"version":3,"file":"lightspeed-chatbox-utils.esm.js","sources":["../../src/utils/lightspeed-chatbox-utils.tsx"],"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 {\n ChatbotFootnote,\n Conversation,\n SourcesCardProps,\n} from '@patternfly/chatbot';\nimport { Spinner } from '@patternfly/react-core';\nimport { ThumbtackIcon } from '@patternfly/react-icons';\nimport { RhUiAiInfoIcon } from '@patternfly/react-icons/dist/esm/icons/rh-ui-ai-info-icon';\n\nimport {\n BaseMessage,\n ConversationList,\n ConversationSummary,\n LCSConversation,\n ReferencedDocument,\n ReferencedDocuments,\n ToolCall,\n} from '../types';\n\nexport const getFootnoteProps = (\n t?: (key: string, params?: any) => string,\n) => ({\n label:\n t?.('footer.accuracy.label') ||\n 'Always review AI generated content prior to use.',\n});\n\nexport const ChatbotFootnoteWithIcon = ({ label }: { label: string }) => (\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: '4px',\n }}\n >\n <RhUiAiInfoIcon style={{ width: '14px', height: '14px', flexShrink: 0 }} />\n <ChatbotFootnote label={label} />\n </div>\n);\n\nexport const getTimestampVariablesString = (v: number) => {\n if (v < 10) {\n return `0${v}`;\n }\n return `${v}`;\n};\n\nconst isBlankLine = (line: string) => !line.trim();\n\n/** Ordered list item at line start (CommonMark), ignoring leading spaces. */\nconst isOrderedListLine = (line: string) => /^\\s*\\d+\\.\\s/.test(line);\n\n/** ASCII bullets; also U+2022 (•) — not a CommonMark marker, but users paste it as a list. */\nconst isBulletListLine = (line: string) =>\n /^\\s*[-*+]\\s/.test(line) || /^\\s*\\u2022(?:\\s+|\\S|$)/u.test(line);\n\nconst escapeBulletListMarker = (line: string) => {\n if (/^\\s*\\u2022/u.test(line)) {\n return line;\n }\n return line.replace(/^(\\s*)([*+-])(\\s)/, '$1\\\\$2$3');\n};\n\nconst escapeOrderedListMarker = (line: string) =>\n line.replace(/^(\\s*)(\\d+)\\.(\\s)/, '$1$2\\\\.$3');\n\n/**\n * When intro lines (no blank lines among them) are followed by a contiguous run of\n * list lines, join intro + list into one Markdown paragraph using hard breaks and\n * per-line escaping so the block does not split awkwardly in the chat UI.\n */\nconst foldListWithIntro = (\n s: string,\n isListItemLine: (line: string) => boolean,\n escapeListLine: (line: string) => string,\n): string => {\n const lines = s.split('\\n');\n let firstListIdx = -1;\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n if (line !== undefined && isListItemLine(line)) {\n firstListIdx = i;\n break;\n }\n }\n if (firstListIdx < 0) {\n return s;\n }\n\n const intro = lines.slice(0, firstListIdx);\n if (intro.some(isBlankLine)) {\n return s;\n }\n\n const rest = lines.slice(firstListIdx);\n const restItems = rest.filter(l => !isBlankLine(l));\n if (restItems.length === 0 || !restItems.every(isListItemLine)) {\n return s;\n }\n\n const escaped = restItems.map(escapeListLine);\n if (intro.length === 0) {\n return escaped.join(' \\n');\n }\n return `${intro.join(' \\n')} \\n${escaped.join(' \\n')}`;\n};\n\n/**\n * Paragraph + ordered list (even with a single newline) parses as two blocks; merge\n * intro + contiguous numbered lines into one paragraph using hard breaks (two spaces\n * + newline) and escaped `1.` markers so Markdown stays a single block.\n */\nconst foldOrderedListWithIntro = (s: string) =>\n foldListWithIntro(s, isOrderedListLine, escapeOrderedListMarker);\n\n/** Same idea as ordered lists for intro + bullet lines. */\nconst foldBulletListWithIntro = (s: string) =>\n foldListWithIntro(s, isBulletListLine, escapeBulletListMarker);\n\n/**\n * Trims user chat input and reduces blank lines that split Markdown blocks\n * (e.g. paragraph + blank line + ordered list) so PatternFly renders one user bubble.\n */\nexport const normalizeChatUserInput = (input: string): string => {\n let s = input.replace(/\\r\\n/g, '\\n').trim();\n if (!s) {\n return s;\n }\n s = s.replace(/\\n{3,}/g, '\\n\\n');\n s = s.replace(/\\n\\n(?=\\s*\\d+\\.\\s)/gm, '\\n');\n s = s.replace(/\\n\\n(?=\\s*[-*+]\\s)/gm, '\\n');\n s = s.replace(/\\n\\n(?=\\s*\\u2022)/gm, '\\n');\n s = foldOrderedListWithIntro(s);\n s = foldBulletListWithIntro(s);\n return s.trim();\n};\n\nexport const getTimestamp = (unix_timestamp: number) => {\n if (typeof unix_timestamp !== 'number' || 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 toolCalls?: ToolCall[];\n};\n\nexport const createMessage = ({\n role,\n name,\n avatar,\n isLoading = false,\n content,\n timestamp,\n error,\n sources,\n toolCalls,\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 toolCalls,\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 getConversationsData = (\n conversation: LCSConversation,\n): [BaseMessage, BaseMessage] => {\n const [userMessage, botMessage] = conversation.messages || [];\n return [\n {\n ...userMessage,\n timestamp: getTimestamp(\n conversation.started_at\n ? new Date(conversation.started_at).getTime()\n : Date.now(),\n ),\n },\n {\n ...botMessage,\n timestamp: getTimestamp(\n conversation.completed_at\n ? new Date(conversation.completed_at).getTime()\n : Date.now(),\n ),\n referenced_documents: botMessage?.referenced_documents ?? [],\n },\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: !!doc?.doc_url,\n })),\n };\n};\n\nexport type SortOption =\n 'newest' | 'oldest' | 'alphabeticalAsc' | 'alphabeticalDesc';\n\nconst sortConversations = (\n messages: ConversationList,\n sortOption: SortOption,\n): ConversationList => {\n return [...messages].sort((a, b) => {\n const aTopicSummary = a.topic_summary || '';\n const bTopicSummary = b.topic_summary || '';\n switch (sortOption) {\n case 'oldest':\n return a.last_message_timestamp - b.last_message_timestamp;\n case 'alphabeticalAsc':\n return aTopicSummary.localeCompare(bTopicSummary, undefined, {\n sensitivity: 'base',\n });\n case 'alphabeticalDesc':\n return bTopicSummary.localeCompare(aTopicSummary, undefined, {\n sensitivity: 'base',\n });\n case 'newest':\n default:\n return b.last_message_timestamp - a.last_message_timestamp;\n }\n });\n};\n\nexport const getCategorizeMessages = (\n messages: ConversationList,\n pinnedChats: string[],\n addProps: (c: ConversationSummary) => { [k: string]: any },\n t?: (key: string, params?: any) => string,\n sortOption: SortOption = 'newest',\n): { [k: string]: Conversation[] } => {\n const pinnedChatsKey =\n t?.('conversation.category.pinnedChats') || 'Pinned chats';\n const recentKey = t?.('conversation.category.recent') || 'Chats';\n const categorizedMessages: { [k: string]: Conversation[] } = {\n [pinnedChatsKey]: [],\n [recentKey]: [],\n };\n const sortedMessages = sortConversations(messages, sortOption);\n sortedMessages.forEach(c => {\n const message: Conversation = {\n id: c.conversation_id,\n text: c.topic_summary ?? '',\n icon: c.topic_summary ? undefined : <Spinner size=\"sm\" />,\n label: t?.('message.options.label') || 'Options',\n additionalProps: {\n 'aria-label': t?.('aria.options.label') || 'Options',\n },\n ...addProps(c),\n };\n\n if (pinnedChats.includes(c.conversation_id)) {\n categorizedMessages[pinnedChatsKey].push({\n ...message,\n icon: (\n <ThumbtackIcon\n style={{\n width: '1rem',\n height: '1rem',\n display: 'flex',\n alignItems: 'center',\n }}\n />\n ),\n });\n } else {\n categorizedMessages[recentKey].push(message);\n }\n });\n\n const filteredCategories = Object.keys(categorizedMessages).reduce(\n (result, category) => {\n result[category] = categorizedMessages[category];\n return result;\n },\n {} as any,\n );\n\n return filteredCategories;\n};\n"],"names":[],"mappings":";;;;;;AAkCO,MAAM,gBAAA,GAAmB,CAC9B,CAAA,MACI;AAAA,EACJ,KAAA,EACE,CAAA,GAAI,uBAAuB,CAAA,IAC3B;AACJ,CAAA;AAEO,MAAM,uBAAA,GAA0B,CAAC,EAAE,KAAA,EAAM,qBAC9C,IAAA;AAAA,EAAC,KAAA;AAAA,EAAA;AAAA,IACC,KAAA,EAAO;AAAA,MACL,OAAA,EAAS,MAAA;AAAA,MACT,UAAA,EAAY,QAAA;AAAA,MACZ,cAAA,EAAgB,QAAA;AAAA,MAChB,GAAA,EAAK;AAAA,KACP;AAAA,IAEA,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,cAAA,EAAA,EAAe,OAAO,EAAE,KAAA,EAAO,QAAQ,MAAA,EAAQ,MAAA,EAAQ,UAAA,EAAY,CAAA,EAAE,EAAG,CAAA;AAAA,sBACzE,GAAA,CAAC,mBAAgB,KAAA,EAAc;AAAA;AAAA;AACjC;AAGK,MAAM,2BAAA,GAA8B,CAAC,CAAA,KAAc;AACxD,EAAA,IAAI,IAAI,EAAA,EAAI;AACV,IAAA,OAAO,IAAI,CAAC,CAAA,CAAA;AAAA,EACd;AACA,EAAA,OAAO,GAAG,CAAC,CAAA,CAAA;AACb;AAEA,MAAM,WAAA,GAAc,CAAC,IAAA,KAAiB,CAAC,KAAK,IAAA,EAAK;AAGjD,MAAM,iBAAA,GAAoB,CAAC,IAAA,KAAiB,aAAA,CAAc,KAAK,IAAI,CAAA;AAGnE,MAAM,gBAAA,GAAmB,CAAC,IAAA,KACxB,aAAA,CAAc,K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MAAA,MAAA,CAAO,QAAQ,CAAA,GAAI,mBAAA,CAAoB,QAAQ,CAAA;AAC/C,MAAA,OAAO,MAAA;AAAA,IACT,CAAA;AAAA,IACA;AAAC,GACH;AAEA,EAAA,OAAO,kBAAA;AACT;;;;"}
1
+ {"version":3,"file":"lightspeed-chatbox-utils.esm.js","sources":["../../src/utils/lightspeed-chatbox-utils.tsx"],"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 {\n ChatbotFootnote,\n Conversation,\n SourcesCardProps,\n} from '@patternfly/chatbot';\nimport { Spinner } from '@patternfly/react-core';\nimport { ThumbtackIcon } from '@patternfly/react-icons';\nimport { RhUiAiInfoIcon } from '@patternfly/react-icons/dist/esm/icons/rh-ui-ai-info-icon';\n\nimport { RagSourceLabel } from '../components/RagSourceLabel';\nimport {\n BaseMessage,\n ConversationList,\n ConversationSummary,\n LCSConversation,\n ReferencedDocument,\n ReferencedDocuments,\n ToolCall,\n} from '../types';\n\nexport const getFootnoteProps = (\n t?: (key: string, params?: any) => string,\n) => ({\n label:\n t?.('footer.accuracy.label') ||\n 'Always review AI generated content prior to use.',\n});\n\nexport const ChatbotFootnoteWithIcon = ({ label }: { label: string }) => (\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: '4px',\n }}\n >\n <RhUiAiInfoIcon style={{ width: '14px', height: '14px', flexShrink: 0 }} />\n <ChatbotFootnote label={label} />\n </div>\n);\n\nexport const getTimestampVariablesString = (v: number) => {\n if (v < 10) {\n return `0${v}`;\n }\n return `${v}`;\n};\n\nconst isBlankLine = (line: string) => !line.trim();\n\n/** Ordered list item at line start (CommonMark), ignoring leading spaces. */\nconst isOrderedListLine = (line: string) => /^\\s*\\d+\\.\\s/.test(line);\n\n/** ASCII bullets; also U+2022 (•) — not a CommonMark marker, but users paste it as a list. */\nconst isBulletListLine = (line: string) =>\n /^\\s*[-*+]\\s/.test(line) || /^\\s*\\u2022(?:\\s+|\\S|$)/u.test(line);\n\nconst escapeBulletListMarker = (line: string) => {\n if (/^\\s*\\u2022/u.test(line)) {\n return line;\n }\n return line.replace(/^(\\s*)([*+-])(\\s)/, '$1\\\\$2$3');\n};\n\nconst escapeOrderedListMarker = (line: string) =>\n line.replace(/^(\\s*)(\\d+)\\.(\\s)/, '$1$2\\\\.$3');\n\n/**\n * When intro lines (no blank lines among them) are followed by a contiguous run of\n * list lines, join intro + list into one Markdown paragraph using hard breaks and\n * per-line escaping so the block does not split awkwardly in the chat UI.\n */\nconst foldListWithIntro = (\n s: string,\n isListItemLine: (line: string) => boolean,\n escapeListLine: (line: string) => string,\n): string => {\n const lines = s.split('\\n');\n let firstListIdx = -1;\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n if (line !== undefined && isListItemLine(line)) {\n firstListIdx = i;\n break;\n }\n }\n if (firstListIdx < 0) {\n return s;\n }\n\n const intro = lines.slice(0, firstListIdx);\n if (intro.some(isBlankLine)) {\n return s;\n }\n\n const rest = lines.slice(firstListIdx);\n const restItems = rest.filter(l => !isBlankLine(l));\n if (restItems.length === 0 || !restItems.every(isListItemLine)) {\n return s;\n }\n\n const escaped = restItems.map(escapeListLine);\n if (intro.length === 0) {\n return escaped.join(' \\n');\n }\n return `${intro.join(' \\n')} \\n${escaped.join(' \\n')}`;\n};\n\n/**\n * Paragraph + ordered list (even with a single newline) parses as two blocks; merge\n * intro + contiguous numbered lines into one paragraph using hard breaks (two spaces\n * + newline) and escaped `1.` markers so Markdown stays a single block.\n */\nconst foldOrderedListWithIntro = (s: string) =>\n foldListWithIntro(s, isOrderedListLine, escapeOrderedListMarker);\n\n/** Same idea as ordered lists for intro + bullet lines. */\nconst foldBulletListWithIntro = (s: string) =>\n foldListWithIntro(s, isBulletListLine, escapeBulletListMarker);\n\n/**\n * Trims user chat input and reduces blank lines that split Markdown blocks\n * (e.g. paragraph + blank line + ordered list) so PatternFly renders one user bubble.\n */\nexport const normalizeChatUserInput = (input: string): string => {\n let s = input.replace(/\\r\\n/g, '\\n').trim();\n if (!s) {\n return s;\n }\n s = s.replace(/\\n{3,}/g, '\\n\\n');\n s = s.replace(/\\n\\n(?=\\s*\\d+\\.\\s)/gm, '\\n');\n s = s.replace(/\\n\\n(?=\\s*[-*+]\\s)/gm, '\\n');\n s = s.replace(/\\n\\n(?=\\s*\\u2022)/gm, '\\n');\n s = foldOrderedListWithIntro(s);\n s = foldBulletListWithIntro(s);\n return s.trim();\n};\n\nexport const getTimestamp = (unix_timestamp: number) => {\n if (typeof unix_timestamp !== 'number' || 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 toolCalls?: ToolCall[];\n};\n\nexport const createMessage = ({\n role,\n name,\n avatar,\n isLoading = false,\n content,\n timestamp,\n error,\n sources,\n toolCalls,\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 toolCalls,\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 getConversationsData = (\n conversation: LCSConversation,\n): [BaseMessage, BaseMessage] => {\n const [userMessage, botMessage] = conversation.messages || [];\n return [\n {\n ...userMessage,\n timestamp: getTimestamp(\n conversation.started_at\n ? new Date(conversation.started_at).getTime()\n : Date.now(),\n ),\n },\n {\n ...botMessage,\n timestamp: getTimestamp(\n conversation.completed_at\n ? new Date(conversation.completed_at).getTime()\n : Date.now(),\n ),\n referenced_documents: botMessage?.referenced_documents ?? [],\n },\n ];\n};\n\nexport type SourceWithRagId = SourcesCardProps['sources'][number] & {\n /** Full LCORE RAG source id for chip-modal labels. */\n ragSource?: string;\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: ReferencedDocument): SourceWithRagId => ({\n body: doc.doc_description,\n title: doc.doc_title,\n link: doc?.doc_url,\n isExternal: !!doc?.doc_url,\n ...(doc.source\n ? {\n headerContent: <RagSourceLabel source={doc.source} />,\n ragSource: doc.source,\n }\n : {}),\n }),\n ),\n };\n};\n\nexport type SortOption =\n 'newest' | 'oldest' | 'alphabeticalAsc' | 'alphabeticalDesc';\n\nconst sortConversations = (\n messages: ConversationList,\n sortOption: SortOption,\n): ConversationList => {\n return [...messages].sort((a, b) => {\n const aTopicSummary = a.topic_summary || '';\n const bTopicSummary = b.topic_summary || '';\n switch (sortOption) {\n case 'oldest':\n return a.last_message_timestamp - b.last_message_timestamp;\n case 'alphabeticalAsc':\n return aTopicSummary.localeCompare(bTopicSummary, undefined, {\n sensitivity: 'base',\n });\n case 'alphabeticalDesc':\n return bTopicSummary.localeCompare(aTopicSummary, undefined, {\n sensitivity: 'base',\n });\n case 'newest':\n default:\n return b.last_message_timestamp - a.last_message_timestamp;\n }\n });\n};\n\nexport const getCategorizeMessages = (\n messages: ConversationList,\n pinnedChats: string[],\n addProps: (c: ConversationSummary) => { [k: string]: any },\n t?: (key: string, params?: any) => string,\n sortOption: SortOption = 'newest',\n): { [k: string]: Conversation[] } => {\n const pinnedChatsKey =\n t?.('conversation.category.pinnedChats') || 'Pinned chats';\n const recentKey = t?.('conversation.category.recent') || 'Chats';\n const categorizedMessages: { [k: string]: Conversation[] } = {\n [pinnedChatsKey]: [],\n [recentKey]: [],\n };\n const sortedMessages = sortConversations(messages, sortOption);\n sortedMessages.forEach(c => {\n const message: Conversation = {\n id: c.conversation_id,\n text: c.topic_summary ?? '',\n icon: c.topic_summary ? undefined : <Spinner size=\"sm\" />,\n label: t?.('message.options.label') || 'Options',\n additionalProps: {\n 'aria-label': t?.('aria.options.label') || 'Options',\n },\n ...addProps(c),\n };\n\n if (pinnedChats.includes(c.conversation_id)) {\n categorizedMessages[pinnedChatsKey].push({\n ...message,\n icon: (\n <ThumbtackIcon\n style={{\n width: '1rem',\n height: '1rem',\n display: 'flex',\n alignItems: 'center',\n }}\n />\n ),\n });\n } else {\n categorizedMessages[recentKey].push(message);\n }\n });\n\n const filteredCategories = Object.keys(categorizedMessages).reduce(\n (result, category) => {\n result[category] = categorizedMessages[category];\n return result;\n },\n {} as any,\n );\n\n return filteredCategories;\n};\n"],"names":[],"mappings":";;;;;;;AAmCO,MAAM,gBAAA,GAAmB,CAC9B,CAAA,MACI;AAAA,EACJ,KAAA,EACE,CAAA,GAAI,uBAAuB,CAAA,IAC3B;AACJ,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isCompact) {
2
- if (!isCompact) return {};
1
+ function getScopedDialogProps(isCompact, options) {
2
+ if (!isCompact) {
3
+ return {};
4
+ }
3
5
  return {
4
6
  disablePortal: true,
5
7
  disableScrollLock: true,
@@ -11,7 +13,8 @@ function getScopedDialogProps(isCompact) {
11
13
  margin: 0,
12
14
  '& [class*="Backdrop-root"]': {
13
15
  position: "absolute"
14
- }
16
+ },
17
+ ...{}
15
18
  },
16
19
  PaperProps: {
17
20
  sx: {
@@ -1 +1 @@
1
- {"version":3,"file":"scoped-dialog-utils.esm.js","sources":["../../src/utils/scoped-dialog-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 */\n\nimport type { DialogProps } from '@mui/material/Dialog';\n\nexport function getScopedDialogProps(isCompact: boolean): Partial<DialogProps> {\n if (!isCompact) return {};\n return {\n disablePortal: true,\n disableScrollLock: true,\n fullWidth: true,\n maxWidth: false,\n sx: {\n position: 'absolute',\n inset: 0,\n margin: 0,\n '& [class*=\"Backdrop-root\"]': {\n position: 'absolute',\n },\n },\n PaperProps: {\n sx: {\n marginTop: '16px !important',\n marginBottom: '16px !important',\n marginLeft: '40px !important',\n marginRight: '40px !important',\n borderRadius: '12px !important',\n width: 'calc(100% - 80px) !important',\n maxWidth: 'min(480px, calc(100% - 80px)) !important',\n maxHeight: 'calc(100% - 32px) !important',\n overflowX: 'hidden',\n overflowY: 'auto',\n boxSizing: 'border-box',\n },\n },\n };\n}\n"],"names":[],"mappings":"AAkBO,SAAS,qBAAqB,SAAA,EAA0C;AAC7E,EAAA,IAAI,CAAC,SAAA,EAAW,OAAO,EAAC;AACxB,EAAA,OAAO;AAAA,IACL,aAAA,EAAe,IAAA;AAAA,IACf,iBAAA,EAAmB,IAAA;AAAA,IACnB,SAAA,EAAW,IAAA;AAAA,IACX,QAAA,EAAU,KAAA;AAAA,IACV,EAAA,EAAI;AAAA,MACF,QAAA,EAAU,UAAA;AAAA,MACV,KAAA,EAAO,CAAA;AAAA,MACP,MAAA,EAAQ,CAAA;AAAA,MACR,4BAAA,EAA8B;AAAA,QAC5B,QAAA,EAAU;AAAA;AACZ,KACF;AAAA,IACA,UAAA,EAAY;AAAA,MACV,EAAA,EAAI;AAAA,QACF,SAAA,EAAW,iBAAA;AAAA,QACX,YAAA,EAAc,iBAAA;AAAA,QACd,UAAA,EAAY,iBAAA;AAAA,QACZ,WAAA,EAAa,iBAAA;AAAA,QACb,YAAA,EAAc,iBAAA;AAAA,QACd,KAAA,EAAO,8BAAA;AAAA,QACP,QAAA,EAAU,0CAAA;AAAA,QACV,SAAA,EAAW,8BAAA;AAAA,QACX,SAAA,EAAW,QAAA;AAAA,QACX,SAAA,EAAW,MAAA;AAAA,QACX,SAAA,EAAW;AAAA;AACb;AACF,GACF;AACF;;;;"}
1
+ {"version":3,"file":"scoped-dialog-utils.esm.js","sources":["../../src/utils/scoped-dialog-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 */\n\nimport type { DialogProps } from '@mui/material/Dialog';\nimport type { SxProps, Theme } from '@mui/material/styles';\n\nexport type ScopedDialogPlacement = 'center' | 'top-right';\n\nconst topRightContainerSx = {\n '& .MuiDialog-container': {\n alignItems: 'flex-start',\n justifyContent: 'flex-end',\n padding: '16px',\n },\n} as const;\n\nexport function getScopedDialogProps(\n isCompact: boolean,\n options?: { placement?: ScopedDialogPlacement },\n): Partial<DialogProps> {\n const placement = options?.placement ?? 'center';\n const placementSx: SxProps<Theme> | undefined =\n placement === 'top-right' ? topRightContainerSx : undefined;\n\n if (!isCompact) {\n return placementSx ? { sx: placementSx } : {};\n }\n\n return {\n disablePortal: true,\n disableScrollLock: true,\n fullWidth: true,\n maxWidth: false,\n sx: {\n position: 'absolute',\n inset: 0,\n margin: 0,\n '& [class*=\"Backdrop-root\"]': {\n position: 'absolute',\n },\n ...(placement === 'top-right' ? topRightContainerSx : {}),\n },\n PaperProps: {\n sx: {\n marginTop: '16px !important',\n marginBottom:\n placement === 'top-right' ? 'auto !important' : '16px !important',\n marginLeft:\n placement === 'top-right' ? 'auto !important' : '40px !important',\n marginRight:\n placement === 'top-right' ? '16px !important' : '40px !important',\n borderRadius: '12px !important',\n width:\n placement === 'top-right'\n ? 'min(400px, calc(100% - 32px)) !important'\n : 'calc(100% - 80px) !important',\n maxWidth:\n placement === 'top-right'\n ? 'min(400px, calc(100% - 32px)) !important'\n : 'min(480px, calc(100% - 80px)) !important',\n maxHeight: 'calc(100% - 32px) !important',\n overflowX: 'hidden',\n overflowY: 'auto',\n boxSizing: 'border-box',\n },\n },\n };\n}\n"],"names":[],"mappings":"AA6BO,SAAS,oBAAA,CACd,WACA,OAAA,EACsB;AAKtB,EAAA,IAAI,CAAC,SAAA,EAAW;AACd,IAAA,OAA2C,EAAC;AAAA,EAC9C;AAEA,EAAA,OAAO;AAAA,IACL,aAAA,EAAe,IAAA;AAAA,IACf,iBAAA,EAAmB,IAAA;AAAA,IACnB,SAAA,EAAW,IAAA;AAAA,IACX,QAAA,EAAU,KAAA;AAAA,IACV,EAAA,EAAI;AAAA,MACF,QAAA,EAAU,UAAA;AAAA,MACV,KAAA,EAAO,CAAA;AAAA,MACP,MAAA,EAAQ,CAAA;AAAA,MACR,4BAAA,EAA8B;AAAA,QAC5B,QAAA,EAAU;AAAA,OACZ;AAAA,MACA,GAAsD;AAAC,KACzD;AAAA,IACA,UAAA,EAAY;AAAA,MACV,EAAA,EAAI;AAAA,QACF,SAAA,EAAW,iBAAA;AAAA,QACX,YAAA,EACkD,iBAAA;AAAA,QAClD,UAAA,EACkD,iBAAA;AAAA,QAClD,WAAA,EACkD,iBAAA;AAAA,QAClD,YAAA,EAAc,iBAAA;AAAA,QACd,KAAA,EAGM,8BAAA;AAAA,QACN,QAAA,EAGM,0CAAA;AAAA,QACN,SAAA,EAAW,8BAAA;AAAA,QACX,SAAA,EAAW,QAAA;AAAA,QACX,SAAA,EAAW,MAAA;AAAA,QACX,SAAA,EAAW;AAAA;AACb;AACF,GACF;AACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@red-hat-developer-hub/backstage-plugin-intelligent-assistant",
3
- "version": "5.0.0",
3
+ "version": "5.0.2",
4
4
  "main": "./dist/index.esm.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -103,17 +103,15 @@
103
103
  "@backstage/plugin-app-react": "^0.2.6",
104
104
  "@backstage/plugin-permission-react": "^0.5.4",
105
105
  "@backstage/theme": "^0.7.3",
106
- "@material-ui/core": "^4.9.13",
107
106
  "@monaco-editor/react": "^4.7.0",
108
107
  "@mui/icons-material": "^6.1.8",
109
108
  "@mui/material": "^5.12.2",
110
- "@mui/styles": "5.18.0",
111
- "@patternfly/chatbot": "6.6.0",
109
+ "@patternfly/chatbot": "6.9.0-prerelease.2",
112
110
  "@patternfly/react-core": "6.6.0",
113
111
  "@patternfly/react-icons": "^6.5.0",
114
112
  "@patternfly/react-table": "^6.4.1",
115
113
  "@red-hat-developer-hub/backstage-plugin-app-react": "^1.0.0",
116
- "@red-hat-developer-hub/backstage-plugin-intelligent-assistant-common": "^5.0.0",
114
+ "@red-hat-developer-hub/backstage-plugin-intelligent-assistant-common": "^5.0.2",
117
115
  "@red-hat-developer-hub/backstage-plugin-theme": "^0.14.10",
118
116
  "@tanstack/react-query": "^5.59.15",
119
117
  "html2canvas-pro": "^1.5.0",
@@ -123,14 +121,12 @@
123
121
  },
124
122
  "peerDependencies": {
125
123
  "react": "^18.0.0",
126
- "react-router-dom": "^6.0.0"
124
+ "react-router-dom": "^6.30.6"
127
125
  },
128
126
  "devDependencies": {
129
127
  "@backstage/cli": "^0.36.5",
130
- "@backstage/core-app-api": "^1.20.4",
131
128
  "@backstage/dev-utils": "^1.1.26",
132
129
  "@backstage/test-utils": "^1.7.21",
133
- "@emotion/is-prop-valid": "^1.3.1",
134
130
  "@ianvs/prettier-plugin-sort-imports": "^4.4.0",
135
131
  "@spotify/prettier-config": "^15.0.0",
136
132
  "@testing-library/dom": "^10.0.0",
@@ -140,7 +136,7 @@
140
136
  "prettier": "3.9.6",
141
137
  "react": "^18.0.0",
142
138
  "react-dom": "^18.0.0",
143
- "react-router-dom": "^6.0.0"
139
+ "react-router-dom": "^6.30.6"
144
140
  },
145
141
  "files": [
146
142
  "dist",
@@ -1,12 +0,0 @@
1
- import { createGenerateClassName as createGenerateClassName$1 } from '@material-ui/core/styles';
2
- import { createGenerateClassName } from '@mui/styles';
3
-
4
- const generateClassName = createGenerateClassName({
5
- seed: "intelligent-assistant"
6
- });
7
- const generateClassNameV4 = createGenerateClassName$1({
8
- seed: "intelligent-assistant"
9
- });
10
-
11
- export { generateClassName, generateClassNameV4 };
12
- //# sourceMappingURL=generateClassName.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generateClassName.esm.js","sources":["../../src/utils/generateClassName.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 { createGenerateClassName as createGenerateClassNameV4 } from '@material-ui/core/styles';\nimport { createGenerateClassName } from '@mui/styles';\n\nexport const generateClassName = createGenerateClassName({\n seed: 'intelligent-assistant',\n});\n\nexport const generateClassNameV4 = createGenerateClassNameV4({\n seed: 'intelligent-assistant',\n});\n"],"names":["createGenerateClassNameV4"],"mappings":";;;AAmBO,MAAM,oBAAoB,uBAAA,CAAwB;AAAA,EACvD,IAAA,EAAM;AACR,CAAC;AAEM,MAAM,sBAAsBA,yBAAA,CAA0B;AAAA,EAC3D,IAAA,EAAM;AACR,CAAC;;;;"}