@red-hat-developer-hub/backstage-plugin-intelligent-assistant 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +681 -0
- package/README.md +378 -0
- package/config.d.ts +70 -0
- package/dist/alpha.d.ts +285 -0
- package/dist/alpha.esm.js +3 -0
- package/dist/alpha.esm.js.map +1 -0
- package/dist/api/LightspeedApiClient.esm.js +234 -0
- package/dist/api/LightspeedApiClient.esm.js.map +1 -0
- package/dist/api/NotebooksApiClient.esm.js +179 -0
- package/dist/api/NotebooksApiClient.esm.js.map +1 -0
- package/dist/api/api.esm.js +8 -0
- package/dist/api/api.esm.js.map +1 -0
- package/dist/api/notebooksApi.esm.js +10 -0
- package/dist/api/notebooksApi.esm.js.map +1 -0
- package/dist/components/Attachment.esm.js +108 -0
- package/dist/components/Attachment.esm.js.map +1 -0
- package/dist/components/AttachmentContext.esm.js +125 -0
- package/dist/components/AttachmentContext.esm.js.map +1 -0
- package/dist/components/CollapsedHistoryStrip.esm.js +87 -0
- package/dist/components/CollapsedHistoryStrip.esm.js.map +1 -0
- package/dist/components/DeleteModal.esm.js +92 -0
- package/dist/components/DeleteModal.esm.js.map +1 -0
- package/dist/components/FilePreview.esm.js +49 -0
- package/dist/components/FilePreview.esm.js.map +1 -0
- package/dist/components/LightSpeedChat.esm.js +1898 -0
- package/dist/components/LightSpeedChat.esm.js.map +1 -0
- package/dist/components/LightspeedChatBox.esm.js +252 -0
- package/dist/components/LightspeedChatBox.esm.js.map +1 -0
- package/dist/components/LightspeedChatBoxHeader.esm.js +210 -0
- package/dist/components/LightspeedChatBoxHeader.esm.js.map +1 -0
- package/dist/components/LightspeedChatContainer.esm.js +162 -0
- package/dist/components/LightspeedChatContainer.esm.js.map +1 -0
- package/dist/components/LightspeedChatModelsState.esm.js +198 -0
- package/dist/components/LightspeedChatModelsState.esm.js.map +1 -0
- package/dist/components/LightspeedDrawerContext.esm.js +15 -0
- package/dist/components/LightspeedDrawerContext.esm.js.map +1 -0
- package/dist/components/LightspeedDrawerProvider.esm.js +44 -0
- package/dist/components/LightspeedDrawerProvider.esm.js.map +1 -0
- package/dist/components/LightspeedDrawerStateExposer.esm.js +34 -0
- package/dist/components/LightspeedDrawerStateExposer.esm.js.map +1 -0
- package/dist/components/LightspeedFAB.esm.js +6 -0
- package/dist/components/LightspeedFAB.esm.js.map +1 -0
- package/dist/components/LightspeedFABContent.esm.js +65 -0
- package/dist/components/LightspeedFABContent.esm.js.map +1 -0
- package/dist/components/LightspeedIcon.esm.js +46 -0
- package/dist/components/LightspeedIcon.esm.js.map +1 -0
- package/dist/components/LightspeedPage.esm.js +31 -0
- package/dist/components/LightspeedPage.esm.js.map +1 -0
- package/dist/components/McpServersSettings.esm.js +953 -0
- package/dist/components/McpServersSettings.esm.js.map +1 -0
- package/dist/components/McpSettingsIcon.esm.js +18 -0
- package/dist/components/McpSettingsIcon.esm.js.map +1 -0
- package/dist/components/MessageBarModelSelector.esm.js +92 -0
- package/dist/components/MessageBarModelSelector.esm.js.map +1 -0
- package/dist/components/PermissionRequiredIcon.esm.js +18 -0
- package/dist/components/PermissionRequiredIcon.esm.js.map +1 -0
- package/dist/components/PermissionRequiredState.esm.js +88 -0
- package/dist/components/PermissionRequiredState.esm.js.map +1 -0
- package/dist/components/RenameConversationModal.esm.js +157 -0
- package/dist/components/RenameConversationModal.esm.js.map +1 -0
- package/dist/components/Router.esm.js +35 -0
- package/dist/components/Router.esm.js.map +1 -0
- package/dist/components/SourcesChipModal.esm.js +124 -0
- package/dist/components/SourcesChipModal.esm.js.map +1 -0
- package/dist/components/ToolCallContent.esm.js +208 -0
- package/dist/components/ToolCallContent.esm.js.map +1 -0
- package/dist/components/Trans.esm.js +33 -0
- package/dist/components/Trans.esm.js.map +1 -0
- package/dist/components/notebooks/AddDocumentModal.esm.js +271 -0
- package/dist/components/notebooks/AddDocumentModal.esm.js.map +1 -0
- package/dist/components/notebooks/DeleteDocumentModal.esm.js +131 -0
- package/dist/components/notebooks/DeleteDocumentModal.esm.js.map +1 -0
- package/dist/components/notebooks/DeleteNotebookModal.esm.js +143 -0
- package/dist/components/notebooks/DeleteNotebookModal.esm.js.map +1 -0
- package/dist/components/notebooks/DocumentSidebar.esm.js +235 -0
- package/dist/components/notebooks/DocumentSidebar.esm.js.map +1 -0
- package/dist/components/notebooks/FileListItem.esm.js +94 -0
- package/dist/components/notebooks/FileListItem.esm.js.map +1 -0
- package/dist/components/notebooks/FileTypeIcon.esm.js +59 -0
- package/dist/components/notebooks/FileTypeIcon.esm.js.map +1 -0
- package/dist/components/notebooks/NotebookCard.esm.js +118 -0
- package/dist/components/notebooks/NotebookCard.esm.js.map +1 -0
- package/dist/components/notebooks/NotebookView.esm.js +681 -0
- package/dist/components/notebooks/NotebookView.esm.js.map +1 -0
- package/dist/components/notebooks/NotebooksTab.esm.js +71 -0
- package/dist/components/notebooks/NotebooksTab.esm.js.map +1 -0
- package/dist/components/notebooks/OverwriteConfirmModal.esm.js +142 -0
- package/dist/components/notebooks/OverwriteConfirmModal.esm.js.map +1 -0
- package/dist/components/notebooks/RenameNotebookModal.esm.js +187 -0
- package/dist/components/notebooks/RenameNotebookModal.esm.js.map +1 -0
- package/dist/components/notebooks/SidebarCollapseIcon.esm.js +50 -0
- package/dist/components/notebooks/SidebarCollapseIcon.esm.js.map +1 -0
- package/dist/components/notebooks/UploadResourceScreen.esm.js +79 -0
- package/dist/components/notebooks/UploadResourceScreen.esm.js.map +1 -0
- package/dist/const.esm.js +74 -0
- package/dist/const.esm.js.map +1 -0
- package/dist/dev.d.ts +2 -0
- package/dist/dev.esm.js +48 -0
- package/dist/dev.esm.js.map +1 -0
- package/dist/hooks/notebooks/useCreateNotebook.esm.js +19 -0
- package/dist/hooks/notebooks/useCreateNotebook.esm.js.map +1 -0
- package/dist/hooks/notebooks/useCreateNotebookMessage.esm.js +24 -0
- package/dist/hooks/notebooks/useCreateNotebookMessage.esm.js.map +1 -0
- package/dist/hooks/notebooks/useDeleteNotebook.esm.js +19 -0
- package/dist/hooks/notebooks/useDeleteNotebook.esm.js.map +1 -0
- package/dist/hooks/notebooks/useDocumentStatusPolling.esm.js +40 -0
- package/dist/hooks/notebooks/useDocumentStatusPolling.esm.js.map +1 -0
- package/dist/hooks/notebooks/useLightspeedNotebooksPermission.esm.js +15 -0
- package/dist/hooks/notebooks/useLightspeedNotebooksPermission.esm.js.map +1 -0
- package/dist/hooks/notebooks/useNotebookDocuments.esm.js +18 -0
- package/dist/hooks/notebooks/useNotebookDocuments.esm.js.map +1 -0
- package/dist/hooks/notebooks/useNotebookSession.esm.js +18 -0
- package/dist/hooks/notebooks/useNotebookSession.esm.js.map +1 -0
- package/dist/hooks/notebooks/useNotebookSessions.esm.js +18 -0
- package/dist/hooks/notebooks/useNotebookSessions.esm.js.map +1 -0
- package/dist/hooks/notebooks/useRenameNotebook.esm.js +19 -0
- package/dist/hooks/notebooks/useRenameNotebook.esm.js.map +1 -0
- package/dist/hooks/notebooks/useUploadDocument.esm.js +28 -0
- package/dist/hooks/notebooks/useUploadDocument.esm.js.map +1 -0
- package/dist/hooks/toolCallsCacheStore.esm.js +61 -0
- package/dist/hooks/toolCallsCacheStore.esm.js.map +1 -0
- package/dist/hooks/useAllModels.esm.js +20 -0
- package/dist/hooks/useAllModels.esm.js.map +1 -0
- package/dist/hooks/useAutoScroll.esm.js +78 -0
- package/dist/hooks/useAutoScroll.esm.js.map +1 -0
- package/dist/hooks/useBackstageUserIdentity.esm.js +14 -0
- package/dist/hooks/useBackstageUserIdentity.esm.js.map +1 -0
- package/dist/hooks/useBufferedMessages.esm.js +27 -0
- package/dist/hooks/useBufferedMessages.esm.js.map +1 -0
- package/dist/hooks/useCaptureFeedback.esm.js +21 -0
- package/dist/hooks/useCaptureFeedback.esm.js.map +1 -0
- package/dist/hooks/useConversationMessages.esm.js +544 -0
- package/dist/hooks/useConversationMessages.esm.js.map +1 -0
- package/dist/hooks/useConversations.esm.js +25 -0
- package/dist/hooks/useConversations.esm.js.map +1 -0
- package/dist/hooks/useCreateCoversationMessage.esm.js +33 -0
- package/dist/hooks/useCreateCoversationMessage.esm.js.map +1 -0
- package/dist/hooks/useDeleteConversation.esm.js +39 -0
- package/dist/hooks/useDeleteConversation.esm.js.map +1 -0
- package/dist/hooks/useDisplayModeSettings.esm.js +57 -0
- package/dist/hooks/useDisplayModeSettings.esm.js.map +1 -0
- package/dist/hooks/useFeedbackActions.esm.js +275 -0
- package/dist/hooks/useFeedbackActions.esm.js.map +1 -0
- package/dist/hooks/useFeedbackState.esm.js +93 -0
- package/dist/hooks/useFeedbackState.esm.js.map +1 -0
- package/dist/hooks/useFeedbackStatus.esm.js +14 -0
- package/dist/hooks/useFeedbackStatus.esm.js.map +1 -0
- package/dist/hooks/useIsMobile.esm.js +14 -0
- package/dist/hooks/useIsMobile.esm.js.map +1 -0
- package/dist/hooks/useLastOpenedConversation.esm.js +51 -0
- package/dist/hooks/useLastOpenedConversation.esm.js.map +1 -0
- package/dist/hooks/useLightspeedDeletePermission.esm.js +12 -0
- package/dist/hooks/useLightspeedDeletePermission.esm.js.map +1 -0
- package/dist/hooks/useLightspeedDrawerContext.esm.js +15 -0
- package/dist/hooks/useLightspeedDrawerContext.esm.js.map +1 -0
- package/dist/hooks/useLightspeedProviderState.esm.js +277 -0
- package/dist/hooks/useLightspeedProviderState.esm.js.map +1 -0
- package/dist/hooks/useLightspeedUpdatePermission.esm.js +12 -0
- package/dist/hooks/useLightspeedUpdatePermission.esm.js.map +1 -0
- package/dist/hooks/useLightspeedViewPermission.esm.js +18 -0
- package/dist/hooks/useLightspeedViewPermission.esm.js.map +1 -0
- package/dist/hooks/useNotebookConversationIds.esm.js +19 -0
- package/dist/hooks/useNotebookConversationIds.esm.js.map +1 -0
- package/dist/hooks/useNotebookWelcomePrompts.esm.js +14 -0
- package/dist/hooks/useNotebookWelcomePrompts.esm.js.map +1 -0
- package/dist/hooks/usePinnedChatsSettings.esm.js +118 -0
- package/dist/hooks/usePinnedChatsSettings.esm.js.map +1 -0
- package/dist/hooks/useQuestionValidation.esm.js +16 -0
- package/dist/hooks/useQuestionValidation.esm.js.map +1 -0
- package/dist/hooks/useRenameConversation.esm.js +44 -0
- package/dist/hooks/useRenameConversation.esm.js.map +1 -0
- package/dist/hooks/useSortSettings.esm.js +60 -0
- package/dist/hooks/useSortSettings.esm.js.map +1 -0
- package/dist/hooks/useStopConversation.esm.js +18 -0
- package/dist/hooks/useStopConversation.esm.js.map +1 -0
- package/dist/hooks/useTranslation.esm.js +7 -0
- package/dist/hooks/useTranslation.esm.js.map +1 -0
- package/dist/hooks/useWelcomePrompts.esm.js +36 -0
- package/dist/hooks/useWelcomePrompts.esm.js.map +1 -0
- package/dist/images/bot-avatar-dark.svg +4 -0
- package/dist/images/bot-avatar.svg +4 -0
- package/dist/images/permission-required.svg +319 -0
- package/dist/images/user-avatar.svg +4 -0
- package/dist/index.d.ts +113 -0
- package/dist/index.esm.js +137 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/intelligent-assistant-fab-module.d.ts +4 -0
- package/dist/intelligent-assistant-fab-module.esm.js +2 -0
- package/dist/intelligent-assistant-fab-module.esm.js.map +1 -0
- package/dist/intelligent-assistant-translations-module.d.ts +4 -0
- package/dist/intelligent-assistant-translations-module.esm.js +2 -0
- package/dist/intelligent-assistant-translations-module.esm.js.map +1 -0
- package/dist/legacy.d.ts +75 -0
- package/dist/legacy.esm.js +13 -0
- package/dist/legacy.esm.js.map +1 -0
- package/dist/plugin.esm.js +84 -0
- package/dist/plugin.esm.js.map +1 -0
- package/dist/routes.esm.js +23 -0
- package/dist/routes.esm.js.map +1 -0
- package/dist/translations/de.esm.js +278 -0
- package/dist/translations/de.esm.js.map +1 -0
- package/dist/translations/es.esm.js +278 -0
- package/dist/translations/es.esm.js.map +1 -0
- package/dist/translations/fr.esm.js +278 -0
- package/dist/translations/fr.esm.js.map +1 -0
- package/dist/translations/index.esm.js +16 -0
- package/dist/translations/index.esm.js.map +1 -0
- package/dist/translations/it.esm.js +278 -0
- package/dist/translations/it.esm.js.map +1 -0
- package/dist/translations/ja.esm.js +278 -0
- package/dist/translations/ja.esm.js.map +1 -0
- package/dist/translations/ref.esm.js +315 -0
- package/dist/translations/ref.esm.js.map +1 -0
- package/dist/types.esm.js +9 -0
- package/dist/types.esm.js.map +1 -0
- package/dist/utils/attachment-utils.esm.js +30 -0
- package/dist/utils/attachment-utils.esm.js.map +1 -0
- package/dist/utils/formatToolResponseForMarkdown.esm.js +98 -0
- package/dist/utils/formatToolResponseForMarkdown.esm.js.map +1 -0
- package/dist/utils/generateClassName.esm.js +12 -0
- package/dist/utils/generateClassName.esm.js.map +1 -0
- package/dist/utils/lightspeed-chatbox-utils.esm.js +232 -0
- package/dist/utils/lightspeed-chatbox-utils.esm.js.map +1 -0
- package/dist/utils/notebook-upload-utils.esm.js +48 -0
- package/dist/utils/notebook-upload-utils.esm.js.map +1 -0
- package/dist/utils/notebooks-utils.esm.js +25 -0
- package/dist/utils/notebooks-utils.esm.js.map +1 -0
- package/dist/utils/prompt-utils.esm.js +17 -0
- package/dist/utils/prompt-utils.esm.js.map +1 -0
- package/dist/utils/queryClient.esm.js +6 -0
- package/dist/utils/queryClient.esm.js.map +1 -0
- package/dist/utils/reasoningParser.esm.js +33 -0
- package/dist/utils/reasoningParser.esm.js.map +1 -0
- package/dist/utils/toolCallMapper.esm.js +15 -0
- package/dist/utils/toolCallMapper.esm.js.map +1 -0
- package/dist/utils/user-utils.esm.js +7 -0
- package/dist/utils/user-utils.esm.js.map +1 -0
- package/package.json +182 -0
package/dist/alpha.d.ts
ADDED
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Translation Reference for Developer Hub Intelligent Assistant
|
|
5
|
+
* @alpha
|
|
6
|
+
**/
|
|
7
|
+
declare const intelligentAssistantTranslationRef: _backstage_frontend_plugin_api.TranslationRef<"plugin.intelligent-assistant", {
|
|
8
|
+
readonly 'disclaimer.withoutValidation': string;
|
|
9
|
+
readonly 'disclaimer.withValidation': string;
|
|
10
|
+
readonly 'prompts.codeReadability.title': string;
|
|
11
|
+
readonly 'prompts.codeReadability.message': string;
|
|
12
|
+
readonly 'prompts.debugging.title': string;
|
|
13
|
+
readonly 'prompts.debugging.message': string;
|
|
14
|
+
readonly 'prompts.developmentConcept.title': string;
|
|
15
|
+
readonly 'prompts.developmentConcept.message': string;
|
|
16
|
+
readonly 'prompts.codeOptimization.title': string;
|
|
17
|
+
readonly 'prompts.codeOptimization.message': string;
|
|
18
|
+
readonly 'prompts.documentation.title': string;
|
|
19
|
+
readonly 'prompts.documentation.message': string;
|
|
20
|
+
readonly 'prompts.gitWorkflows.title': string;
|
|
21
|
+
readonly 'prompts.gitWorkflows.message': string;
|
|
22
|
+
readonly 'prompts.testingStrategies.title': string;
|
|
23
|
+
readonly 'prompts.testingStrategies.message': string;
|
|
24
|
+
readonly 'prompts.sortingAlgorithms.title': string;
|
|
25
|
+
readonly 'prompts.sortingAlgorithms.message': string;
|
|
26
|
+
readonly 'prompts.eventDriven.title': string;
|
|
27
|
+
readonly 'prompts.eventDriven.message': string;
|
|
28
|
+
readonly 'prompts.tekton.title': string;
|
|
29
|
+
readonly 'prompts.tekton.message': string;
|
|
30
|
+
readonly 'prompts.openshift.title': string;
|
|
31
|
+
readonly 'prompts.openshift.message': string;
|
|
32
|
+
readonly 'prompts.rhdh.title': string;
|
|
33
|
+
readonly 'prompts.rhdh.message': string;
|
|
34
|
+
readonly 'notebooks.prompts.coreConcepts.title': string;
|
|
35
|
+
readonly 'notebooks.prompts.vulnerabilities.title': string;
|
|
36
|
+
readonly 'notebooks.prompts.accessIssue.title': string;
|
|
37
|
+
readonly 'page.title': string;
|
|
38
|
+
readonly 'page.subtitle': string;
|
|
39
|
+
readonly 'tabs.ariaLabel': string;
|
|
40
|
+
readonly 'tabs.chat': string;
|
|
41
|
+
readonly 'tabs.notebooks': string;
|
|
42
|
+
readonly 'tabs.notebooks.devPreview': string;
|
|
43
|
+
readonly 'tabs.notebooks.empty': string;
|
|
44
|
+
readonly 'notebooks.title': string;
|
|
45
|
+
readonly 'notebooks.empty.title': string;
|
|
46
|
+
readonly 'notebooks.empty.description': string;
|
|
47
|
+
readonly 'notebooks.empty.action': string;
|
|
48
|
+
readonly 'notebooks.documents': string;
|
|
49
|
+
readonly 'notebooks.actions.rename': string;
|
|
50
|
+
readonly 'notebooks.actions.delete': string;
|
|
51
|
+
readonly 'notebooks.rename.title': string;
|
|
52
|
+
readonly 'notebooks.rename.description': string;
|
|
53
|
+
readonly 'notebooks.rename.label': string;
|
|
54
|
+
readonly 'notebooks.rename.placeholder': string;
|
|
55
|
+
readonly 'notebooks.rename.action': string;
|
|
56
|
+
readonly 'notebooks.delete.title': string;
|
|
57
|
+
readonly 'notebooks.delete.message': string;
|
|
58
|
+
readonly 'notebooks.delete.action': string;
|
|
59
|
+
readonly 'notebooks.delete.toast': string;
|
|
60
|
+
readonly 'notebooks.updated.today': string;
|
|
61
|
+
readonly 'notebooks.updated.yesterday': string;
|
|
62
|
+
readonly 'notebooks.updated.days': string;
|
|
63
|
+
readonly 'notebooks.updated.on': string;
|
|
64
|
+
readonly 'notebooks.card.openAria': string;
|
|
65
|
+
readonly 'notebook.view.title': string;
|
|
66
|
+
readonly 'notebook.view.close': string;
|
|
67
|
+
readonly 'notebook.view.documents.count': string;
|
|
68
|
+
readonly 'notebook.view.documents.add': string;
|
|
69
|
+
readonly 'notebook.view.upload.heading': string;
|
|
70
|
+
readonly 'notebook.view.upload.action': string;
|
|
71
|
+
readonly 'notebook.view.processing.heading': string;
|
|
72
|
+
readonly 'notebook.view.processing.description': string;
|
|
73
|
+
readonly 'notebook.view.input.placeholder': string;
|
|
74
|
+
readonly 'notebook.view.input.disabledTooltip': string;
|
|
75
|
+
readonly 'notebook.view.sidebar.collapse': string;
|
|
76
|
+
readonly 'notebook.view.sidebar.expand': string;
|
|
77
|
+
readonly 'notebook.view.sidebar.resize': string;
|
|
78
|
+
readonly 'notebook.view.documents.uploading': string;
|
|
79
|
+
readonly 'notebook.view.documents.maxReached': string;
|
|
80
|
+
readonly 'notebook.view.documents.uploadsInProgress': string;
|
|
81
|
+
readonly 'notebook.upload.failed': string;
|
|
82
|
+
readonly 'notebook.upload.modal.title': string;
|
|
83
|
+
readonly 'notebook.upload.modal.dragDropTitle': string;
|
|
84
|
+
readonly 'notebook.upload.modal.browseButton': string;
|
|
85
|
+
readonly 'notebook.upload.modal.separator': string;
|
|
86
|
+
readonly 'notebook.upload.modal.infoText': string;
|
|
87
|
+
readonly 'notebook.upload.modal.selectedFiles': string;
|
|
88
|
+
readonly 'notebook.upload.modal.addButton': string;
|
|
89
|
+
readonly 'notebook.upload.modal.removeFile': string;
|
|
90
|
+
readonly 'notebook.upload.error.unsupportedType': string;
|
|
91
|
+
readonly 'notebook.upload.error.fileTooLarge': string;
|
|
92
|
+
readonly 'notebook.upload.error.tooManyFiles': string;
|
|
93
|
+
readonly 'notebook.overwrite.modal.title': string;
|
|
94
|
+
readonly 'notebook.overwrite.modal.description': string;
|
|
95
|
+
readonly 'notebook.overwrite.modal.action': string;
|
|
96
|
+
readonly 'notebook.document.delete': string;
|
|
97
|
+
readonly 'notebook.document.delete.title': string;
|
|
98
|
+
readonly 'notebook.document.delete.description': string;
|
|
99
|
+
readonly 'notebook.document.delete.action': string;
|
|
100
|
+
readonly 'notebook.document.delete.success': string;
|
|
101
|
+
readonly 'conversation.delete.confirm.title': string;
|
|
102
|
+
readonly 'conversation.delete.confirm.message': string;
|
|
103
|
+
readonly 'conversation.delete.confirm.action': string;
|
|
104
|
+
readonly 'conversation.rename.confirm.title': string;
|
|
105
|
+
readonly 'conversation.rename.confirm.action': string;
|
|
106
|
+
readonly 'conversation.rename.placeholder': string;
|
|
107
|
+
readonly 'permission.required.title': string;
|
|
108
|
+
readonly 'permission.required.description': string;
|
|
109
|
+
readonly 'permission.subject.plugin': string;
|
|
110
|
+
readonly 'permission.subject.notebooks': string;
|
|
111
|
+
readonly 'permission.notebooks.goBack': string;
|
|
112
|
+
readonly 'lcore.notConfigured.title': string;
|
|
113
|
+
readonly 'lcore.notConfigured.description': string;
|
|
114
|
+
readonly 'lcore.notConfigured.developerLightspeedDocs': string;
|
|
115
|
+
readonly 'lcore.notConfigured.backendDocs': string;
|
|
116
|
+
readonly 'lcore.loadError.title': string;
|
|
117
|
+
readonly 'lcore.loadError.description': string;
|
|
118
|
+
readonly 'footer.accuracy.label': string;
|
|
119
|
+
readonly 'common.cancel': string;
|
|
120
|
+
readonly 'common.close': string;
|
|
121
|
+
readonly 'common.readMore': string;
|
|
122
|
+
readonly 'common.retry': string;
|
|
123
|
+
readonly 'common.loading': string;
|
|
124
|
+
readonly 'common.noSearchResults': string;
|
|
125
|
+
readonly 'menu.newConversation': string;
|
|
126
|
+
readonly 'chatbox.header.title': string;
|
|
127
|
+
readonly 'chatbox.search.placeholder': string;
|
|
128
|
+
readonly 'chatbox.provider.other': string;
|
|
129
|
+
readonly 'chatbox.emptyState.noPinnedChats': string;
|
|
130
|
+
readonly 'chatbox.emptyState.noRecentChats': string;
|
|
131
|
+
readonly 'chatbox.emptyState.noResults.title': string;
|
|
132
|
+
readonly 'chatbox.emptyState.noResults.body': string;
|
|
133
|
+
readonly 'chatbox.welcome.greeting': string;
|
|
134
|
+
readonly 'chatbox.welcome.description': string;
|
|
135
|
+
readonly 'chatbox.message.placeholder': string;
|
|
136
|
+
readonly 'chatbox.fileUpload.failed': string;
|
|
137
|
+
readonly 'chatbox.fileUpload.infoText': string;
|
|
138
|
+
readonly 'aria.chatbotSelector': string;
|
|
139
|
+
readonly 'aria.important': string;
|
|
140
|
+
readonly 'aria.chatHistoryMenu': string;
|
|
141
|
+
readonly 'aria.closeDrawerPanel': string;
|
|
142
|
+
readonly 'aria.search.placeholder': string;
|
|
143
|
+
readonly 'aria.searchPreviousConversations': string;
|
|
144
|
+
readonly 'aria.resize': string;
|
|
145
|
+
readonly 'aria.options.label': string;
|
|
146
|
+
readonly 'aria.scroll.down': string;
|
|
147
|
+
readonly 'aria.scroll.up': string;
|
|
148
|
+
readonly 'aria.close': string;
|
|
149
|
+
readonly 'modal.edit': string;
|
|
150
|
+
readonly 'modal.save': string;
|
|
151
|
+
readonly 'modal.close': string;
|
|
152
|
+
readonly 'modal.cancel': string;
|
|
153
|
+
readonly 'conversation.delete': string;
|
|
154
|
+
readonly 'conversation.rename': string;
|
|
155
|
+
readonly 'conversation.addToPinnedChats': string;
|
|
156
|
+
readonly 'conversation.removeFromPinnedChats': string;
|
|
157
|
+
readonly 'conversation.announcement.userMessage': string;
|
|
158
|
+
readonly 'conversation.announcement.responseStopped': string;
|
|
159
|
+
readonly 'user.guest': string;
|
|
160
|
+
readonly 'user.loading': string;
|
|
161
|
+
readonly 'tooltip.attach': string;
|
|
162
|
+
readonly 'tooltip.send': string;
|
|
163
|
+
readonly 'tooltip.microphone.active': string;
|
|
164
|
+
readonly 'tooltip.microphone.inactive': string;
|
|
165
|
+
readonly 'tooltip.expandHistoryPanel': string;
|
|
166
|
+
readonly 'tooltip.collapseHistoryPanel': string;
|
|
167
|
+
readonly 'tooltip.quickNewChat': string;
|
|
168
|
+
readonly 'button.newChat': string;
|
|
169
|
+
readonly 'tooltip.chatHistoryMenu': string;
|
|
170
|
+
readonly 'tooltip.responseRecorded': string;
|
|
171
|
+
readonly 'tooltip.backToTop': string;
|
|
172
|
+
readonly 'tooltip.backToBottom': string;
|
|
173
|
+
readonly 'tooltip.settings': string;
|
|
174
|
+
readonly 'tooltip.close': string;
|
|
175
|
+
readonly 'tooltip.fab.open': string;
|
|
176
|
+
readonly 'tooltip.fab.close': string;
|
|
177
|
+
readonly 'attach.menu.title': string;
|
|
178
|
+
readonly 'attach.menu.description': string;
|
|
179
|
+
readonly 'modal.title.preview': string;
|
|
180
|
+
readonly 'modal.title.edit': string;
|
|
181
|
+
readonly 'icon.lightspeed.alt': string;
|
|
182
|
+
readonly 'icon.permissionRequired.alt': string;
|
|
183
|
+
readonly 'message.options.label': string;
|
|
184
|
+
readonly 'file.upload.error.alreadyExists': string;
|
|
185
|
+
readonly 'file.upload.error.multipleFiles': string;
|
|
186
|
+
readonly 'file.upload.error.unsupportedType': string;
|
|
187
|
+
readonly 'file.upload.error.fileTooLarge': string;
|
|
188
|
+
readonly 'file.upload.error.readFailed': string;
|
|
189
|
+
readonly 'error.context.fileAttachment': string;
|
|
190
|
+
readonly 'feedback.form.title': string;
|
|
191
|
+
readonly 'feedback.form.textAreaPlaceholder': string;
|
|
192
|
+
readonly 'feedback.form.submitWord': string;
|
|
193
|
+
readonly 'feedback.tooltips.goodResponse': string;
|
|
194
|
+
readonly 'feedback.tooltips.badResponse': string;
|
|
195
|
+
readonly 'feedback.tooltips.copied': string;
|
|
196
|
+
readonly 'feedback.tooltips.copy': string;
|
|
197
|
+
readonly 'feedback.tooltips.listening': string;
|
|
198
|
+
readonly 'feedback.tooltips.listen': string;
|
|
199
|
+
readonly 'feedback.quickResponses.positive.helpful': string;
|
|
200
|
+
readonly 'feedback.quickResponses.positive.easyToUnderstand': string;
|
|
201
|
+
readonly 'feedback.quickResponses.positive.resolvedIssue': string;
|
|
202
|
+
readonly 'feedback.quickResponses.negative.didntAnswer': string;
|
|
203
|
+
readonly 'feedback.quickResponses.negative.hardToUnderstand': string;
|
|
204
|
+
readonly 'feedback.quickResponses.negative.notHelpful': string;
|
|
205
|
+
readonly 'feedback.completion.title': string;
|
|
206
|
+
readonly 'feedback.completion.body': string;
|
|
207
|
+
readonly 'conversation.category.pinnedChats': string;
|
|
208
|
+
readonly 'conversation.category.recent': string;
|
|
209
|
+
readonly 'settings.pinned.enable': string;
|
|
210
|
+
readonly 'settings.pinned.disable': string;
|
|
211
|
+
readonly 'settings.pinned.enabled.description': string;
|
|
212
|
+
readonly 'settings.pinned.disabled.description': string;
|
|
213
|
+
readonly 'settings.mcp.label': string;
|
|
214
|
+
readonly 'settings.mcp.badge': string;
|
|
215
|
+
readonly 'mcp.settings.title': string;
|
|
216
|
+
readonly 'mcp.settings.selectedCount': string;
|
|
217
|
+
readonly 'mcp.settings.closeAriaLabel': string;
|
|
218
|
+
readonly 'mcp.settings.readOnlyAccess': string;
|
|
219
|
+
readonly 'mcp.settings.tableAriaLabel': string;
|
|
220
|
+
readonly 'mcp.settings.enabled': string;
|
|
221
|
+
readonly 'mcp.settings.name': string;
|
|
222
|
+
readonly 'mcp.settings.status': string;
|
|
223
|
+
readonly 'mcp.settings.edit': string;
|
|
224
|
+
readonly 'mcp.settings.loading': string;
|
|
225
|
+
readonly 'mcp.settings.noneAvailable': string;
|
|
226
|
+
readonly 'mcp.settings.status.disabled': string;
|
|
227
|
+
readonly 'mcp.settings.status.tokenRequired': string;
|
|
228
|
+
readonly 'mcp.settings.status.failed': string;
|
|
229
|
+
readonly 'mcp.settings.status.oneTool': string;
|
|
230
|
+
readonly 'mcp.settings.status.manyTools': string;
|
|
231
|
+
readonly 'mcp.settings.status.unknown': string;
|
|
232
|
+
readonly 'mcp.settings.modalDescriptionDcr': string;
|
|
233
|
+
readonly 'mcp.settings.toggleServerAriaLabel': string;
|
|
234
|
+
readonly 'mcp.settings.editServerAriaLabel': string;
|
|
235
|
+
readonly 'mcp.settings.configureServerTitle': string;
|
|
236
|
+
readonly 'mcp.settings.closeConfigureModalAriaLabel': string;
|
|
237
|
+
readonly 'mcp.settings.modalDescription': string;
|
|
238
|
+
readonly 'mcp.settings.savedToken': string;
|
|
239
|
+
readonly 'mcp.settings.personalAccessToken': string;
|
|
240
|
+
readonly 'mcp.settings.usingAdminCredential': string;
|
|
241
|
+
readonly 'mcp.settings.enterToken': string;
|
|
242
|
+
readonly 'mcp.settings.removePersonalToken': string;
|
|
243
|
+
readonly 'mcp.settings.token.clearAriaLabel': string;
|
|
244
|
+
readonly 'mcp.settings.token.validating': string;
|
|
245
|
+
readonly 'mcp.settings.token.savingAndValidating': string;
|
|
246
|
+
readonly 'mcp.settings.token.urlUnavailableForValidation': string;
|
|
247
|
+
readonly 'mcp.settings.token.invalidCredentials': string;
|
|
248
|
+
readonly 'mcp.settings.token.validationFailed': string;
|
|
249
|
+
readonly 'mcp.settings.token.connectionSuccessful': string;
|
|
250
|
+
readonly 'toolCall.header': string;
|
|
251
|
+
readonly 'toolCall.thinking': string;
|
|
252
|
+
readonly 'toolCall.executionTime': string;
|
|
253
|
+
readonly 'toolCall.parameters': string;
|
|
254
|
+
readonly 'toolCall.response': string;
|
|
255
|
+
readonly 'toolCall.showMore': string;
|
|
256
|
+
readonly 'toolCall.showLess': string;
|
|
257
|
+
readonly 'toolCall.loading': string;
|
|
258
|
+
readonly 'toolCall.executing': string;
|
|
259
|
+
readonly 'toolCall.copyResponse': string;
|
|
260
|
+
readonly 'toolCall.summary': string;
|
|
261
|
+
readonly 'toolCall.mcpServer': string;
|
|
262
|
+
readonly 'settings.displayMode.label': string;
|
|
263
|
+
readonly 'settings.displayMode.overlay': string;
|
|
264
|
+
readonly 'settings.displayMode.docked': string;
|
|
265
|
+
readonly 'settings.displayMode.fullscreen': string;
|
|
266
|
+
readonly 'sort.label': string;
|
|
267
|
+
readonly 'sort.newest': string;
|
|
268
|
+
readonly 'sort.oldest': string;
|
|
269
|
+
readonly 'sort.alphabeticalAsc': string;
|
|
270
|
+
readonly 'sort.alphabeticalDesc': string;
|
|
271
|
+
readonly 'sources.chip.label_one': string;
|
|
272
|
+
readonly 'sources.chip.label_other': string;
|
|
273
|
+
readonly 'sources.modal.title': string;
|
|
274
|
+
readonly 'sources.modal.description': string;
|
|
275
|
+
readonly 'sources.popover.closeAriaLabel': string;
|
|
276
|
+
readonly 'reasoning.thinking': string;
|
|
277
|
+
}>;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Translation Resource for Developer Hub intelligent assistant
|
|
281
|
+
* @alpha
|
|
282
|
+
**/
|
|
283
|
+
declare const lightspeedTranslations: _backstage_frontend_plugin_api.TranslationResource<"plugin.intelligent-assistant">;
|
|
284
|
+
|
|
285
|
+
export { intelligentAssistantTranslationRef, lightspeedTranslations };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { TEMP_CONVERSATION_ID, VALID_TOPIC_RESTRICTION_PROVIDER_IDS } from '../const.esm.js';
|
|
2
|
+
|
|
3
|
+
class LightspeedApiClient {
|
|
4
|
+
configApi;
|
|
5
|
+
fetchApi;
|
|
6
|
+
constructor(options) {
|
|
7
|
+
this.configApi = options.configApi;
|
|
8
|
+
this.fetchApi = options.fetchApi;
|
|
9
|
+
}
|
|
10
|
+
async getBaseUrl() {
|
|
11
|
+
return `${this.configApi.getString("backend.baseUrl")}/api/intelligent-assistant`;
|
|
12
|
+
}
|
|
13
|
+
async createMessage(prompt, selectedModel, selectedProvider, conversation_id, attachments) {
|
|
14
|
+
const baseUrl = await this.getBaseUrl();
|
|
15
|
+
const response = await this.fetchApi.fetch(`${baseUrl}/v1/query`, {
|
|
16
|
+
method: "POST",
|
|
17
|
+
headers: {
|
|
18
|
+
"Content-Type": "application/json"
|
|
19
|
+
},
|
|
20
|
+
body: JSON.stringify({
|
|
21
|
+
conversation_id: conversation_id === TEMP_CONVERSATION_ID ? void 0 : conversation_id,
|
|
22
|
+
model: selectedModel,
|
|
23
|
+
provider: selectedProvider,
|
|
24
|
+
query: prompt,
|
|
25
|
+
attachments
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
if (!response.body) {
|
|
29
|
+
throw new Error("Readable stream is not supported or there is no body.");
|
|
30
|
+
}
|
|
31
|
+
if (!response.ok) {
|
|
32
|
+
const body = await response.body.getReader();
|
|
33
|
+
const reader = body.read();
|
|
34
|
+
const decoder = new TextDecoder("utf-8");
|
|
35
|
+
const text = await reader.then(({ done, value }) => {
|
|
36
|
+
if (done) {
|
|
37
|
+
return "";
|
|
38
|
+
}
|
|
39
|
+
return decoder.decode(value);
|
|
40
|
+
});
|
|
41
|
+
const errorMessage = JSON.parse(text);
|
|
42
|
+
if (errorMessage?.error) {
|
|
43
|
+
throw new Error(`failed to create message: ${errorMessage.error}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return response.body.getReader();
|
|
47
|
+
}
|
|
48
|
+
async fetcher(url) {
|
|
49
|
+
const response = await this.fetchApi.fetch(url, {
|
|
50
|
+
headers: {
|
|
51
|
+
"Content-Type": "application/json"
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
if (!response.ok) {
|
|
55
|
+
throw new Error(
|
|
56
|
+
`failed to fetch data, status ${response.status}: ${response.statusText}`
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
return response;
|
|
60
|
+
}
|
|
61
|
+
async isTopicRestrictionEnabled() {
|
|
62
|
+
const baseUrl = await this.getBaseUrl();
|
|
63
|
+
const result = await this.fetcher(`${baseUrl}/v1/shields`);
|
|
64
|
+
if (!result.ok) {
|
|
65
|
+
throw new Error(
|
|
66
|
+
`failed to get shields, status ${result.status}: ${result.statusText}`
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
const response = await result.json();
|
|
70
|
+
if (!response?.shields || !Array.isArray(response.shields)) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
return response.shields.some((shield) => {
|
|
74
|
+
const providerId = shield.provider_resource_id;
|
|
75
|
+
return VALID_TOPIC_RESTRICTION_PROVIDER_IDS.some(
|
|
76
|
+
(validId) => providerId.toLowerCase() === validId.toLowerCase()
|
|
77
|
+
);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
async getAllModels() {
|
|
81
|
+
const baseUrl = await this.getBaseUrl();
|
|
82
|
+
const result = await this.fetcher(`${baseUrl}/v1/models`);
|
|
83
|
+
if (!result.ok) {
|
|
84
|
+
throw new Error(
|
|
85
|
+
`failed to get models, status ${result.status}: ${result.statusText}`
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
const response = await result.json();
|
|
89
|
+
return response?.models ? response?.models : [];
|
|
90
|
+
}
|
|
91
|
+
async getConversationMessages(conversation_id) {
|
|
92
|
+
if (conversation_id === TEMP_CONVERSATION_ID) {
|
|
93
|
+
return [];
|
|
94
|
+
}
|
|
95
|
+
const baseUrl = await this.getBaseUrl();
|
|
96
|
+
const result = await this.fetcher(
|
|
97
|
+
`${baseUrl}/v2/conversations/${encodeURIComponent(conversation_id)}`
|
|
98
|
+
);
|
|
99
|
+
if (!result.ok) {
|
|
100
|
+
throw new Error(
|
|
101
|
+
`failed to get conversation messages, status ${result.status}: ${result.statusText}`
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
const response = await result.json();
|
|
105
|
+
return response.chat_history ?? [];
|
|
106
|
+
}
|
|
107
|
+
async getConversations() {
|
|
108
|
+
const baseUrl = await this.getBaseUrl();
|
|
109
|
+
const result = await this.fetcher(`${baseUrl}/v2/conversations`);
|
|
110
|
+
if (!result.ok) {
|
|
111
|
+
throw new Error(
|
|
112
|
+
`failed to get conversation, status ${result.status}: ${result.statusText}`
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
const response = await result.json();
|
|
116
|
+
return response.conversations ?? [];
|
|
117
|
+
}
|
|
118
|
+
async getNotebookConversationIds() {
|
|
119
|
+
const baseUrl = await this.getBaseUrl();
|
|
120
|
+
const result = await this.fetcher(`${baseUrl}/notebook-conversation-ids`);
|
|
121
|
+
if (!result.ok) {
|
|
122
|
+
throw new Error(
|
|
123
|
+
`failed to get notebook conversation IDs, status ${result.status}: ${result.statusText}`
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
const response = await result.json();
|
|
127
|
+
return response.conversation_ids ?? [];
|
|
128
|
+
}
|
|
129
|
+
async stopMessage(requestId) {
|
|
130
|
+
const baseUrl = await this.getBaseUrl();
|
|
131
|
+
const response = await this.fetchApi.fetch(
|
|
132
|
+
`${baseUrl}/v1/query/interrupt`,
|
|
133
|
+
{
|
|
134
|
+
method: "POST",
|
|
135
|
+
headers: {
|
|
136
|
+
"Content-Type": "application/json"
|
|
137
|
+
},
|
|
138
|
+
body: JSON.stringify({ request_id: requestId })
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
if (!response.ok) {
|
|
142
|
+
throw new Error(
|
|
143
|
+
`failed to stop message, status ${response.status}: ${response.statusText}`
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
return await response.json();
|
|
147
|
+
}
|
|
148
|
+
async deleteConversation(conversation_id) {
|
|
149
|
+
const baseUrl = await this.getBaseUrl();
|
|
150
|
+
const response = await this.fetchApi.fetch(
|
|
151
|
+
`${baseUrl}/v2/conversations/${encodeURIComponent(conversation_id)}`,
|
|
152
|
+
{
|
|
153
|
+
method: "DELETE",
|
|
154
|
+
headers: {}
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
if (!response.ok) {
|
|
158
|
+
let errorMessage = `failed to delete conversation, status ${response.status}: ${response.statusText}`;
|
|
159
|
+
try {
|
|
160
|
+
const errorBody = await response.json();
|
|
161
|
+
if (errorBody?.error) {
|
|
162
|
+
errorMessage = errorBody.error;
|
|
163
|
+
}
|
|
164
|
+
} catch (e) {
|
|
165
|
+
console.warn(e);
|
|
166
|
+
}
|
|
167
|
+
throw new Error(errorMessage);
|
|
168
|
+
}
|
|
169
|
+
return { success: true };
|
|
170
|
+
}
|
|
171
|
+
async renameConversation(conversation_id, newName) {
|
|
172
|
+
const baseUrl = await this.getBaseUrl();
|
|
173
|
+
const response = await this.fetchApi.fetch(
|
|
174
|
+
`${baseUrl}/v2/conversations/${encodeURIComponent(conversation_id)}`,
|
|
175
|
+
{
|
|
176
|
+
method: "PUT",
|
|
177
|
+
headers: {
|
|
178
|
+
"Content-Type": "application/json"
|
|
179
|
+
},
|
|
180
|
+
body: JSON.stringify({ topic_summary: newName })
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
if (!response.ok) {
|
|
184
|
+
let errorMessage = `failed to rename conversation, status ${response.status}: ${response.statusText}`;
|
|
185
|
+
try {
|
|
186
|
+
const errorBody = await response.json();
|
|
187
|
+
if (errorBody?.error) {
|
|
188
|
+
errorMessage = errorBody.error;
|
|
189
|
+
}
|
|
190
|
+
} catch (e) {
|
|
191
|
+
console.warn(e);
|
|
192
|
+
}
|
|
193
|
+
throw new Error(errorMessage);
|
|
194
|
+
}
|
|
195
|
+
return { success: true };
|
|
196
|
+
}
|
|
197
|
+
getFeedbackStatus = async () => {
|
|
198
|
+
const baseUrl = await this.getBaseUrl();
|
|
199
|
+
const response = await this.fetchApi.fetch(
|
|
200
|
+
`${baseUrl}/v1/feedback/status`,
|
|
201
|
+
{
|
|
202
|
+
method: "GET",
|
|
203
|
+
headers: {}
|
|
204
|
+
}
|
|
205
|
+
);
|
|
206
|
+
if (!response.ok) {
|
|
207
|
+
throw new Error(
|
|
208
|
+
`failed to GET feedback status, status ${response.status}: ${response.statusText}`
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
const result = await response.json();
|
|
212
|
+
return result?.status?.enabled ?? false;
|
|
213
|
+
};
|
|
214
|
+
captureFeedback = async (payload) => {
|
|
215
|
+
const baseUrl = await this.getBaseUrl();
|
|
216
|
+
const response = await this.fetchApi.fetch(`${baseUrl}/v1/feedback`, {
|
|
217
|
+
method: "POST",
|
|
218
|
+
headers: {
|
|
219
|
+
"Content-Type": "application/json",
|
|
220
|
+
accept: "application/json"
|
|
221
|
+
},
|
|
222
|
+
body: JSON.stringify(payload)
|
|
223
|
+
});
|
|
224
|
+
if (!response.ok) {
|
|
225
|
+
throw new Error(
|
|
226
|
+
`failed to capture feedback, status ${response.status}: ${response.statusText}`
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
return await response.json();
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export { LightspeedApiClient };
|
|
234
|
+
//# sourceMappingURL=LightspeedApiClient.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LightspeedApiClient.esm.js","sources":["../../src/api/LightspeedApiClient.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 { ConfigApi, FetchApi } from '@backstage/core-plugin-api';\n\nimport {\n TEMP_CONVERSATION_ID,\n VALID_TOPIC_RESTRICTION_PROVIDER_IDS,\n} from '../const';\nimport { Attachment, CaptureFeedback } from '../types';\nimport { LightspeedAPI } from './api';\n\n/**\n * @public\n * Lightspeed API client options\n */\n\nexport type Options = {\n configApi: ConfigApi;\n fetchApi: FetchApi;\n};\n\n/**\n * @public\n * Lightspeed API client implementation\n */\n\nexport class LightspeedApiClient implements LightspeedAPI {\n private readonly configApi: ConfigApi;\n private readonly fetchApi: FetchApi;\n\n constructor(options: Options) {\n this.configApi = options.configApi;\n this.fetchApi = options.fetchApi;\n }\n\n async getBaseUrl() {\n return `${this.configApi.getString('backend.baseUrl')}/api/intelligent-assistant`;\n }\n\n async createMessage(\n prompt: string,\n selectedModel: string,\n selectedProvider: string,\n conversation_id: string,\n attachments: Attachment[],\n ) {\n const baseUrl = await this.getBaseUrl();\n\n const response = await this.fetchApi.fetch(`${baseUrl}/v1/query`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n conversation_id:\n conversation_id === TEMP_CONVERSATION_ID\n ? undefined\n : conversation_id,\n model: selectedModel,\n provider: selectedProvider,\n query: prompt,\n attachments,\n }),\n });\n\n if (!response.body) {\n throw new Error('Readable stream is not supported or there is no body.');\n }\n\n if (!response.ok) {\n const body = await response.body.getReader();\n const reader = body.read();\n const decoder = new TextDecoder('utf-8');\n const text = await reader.then(({ done, value }) => {\n if (done) {\n return '';\n }\n return decoder.decode(value);\n });\n const errorMessage = JSON.parse(text);\n if (errorMessage?.error) {\n throw new Error(`failed to create message: ${errorMessage.error}`);\n }\n }\n return response.body.getReader();\n }\n\n private async fetcher(url: string) {\n const response = await this.fetchApi.fetch(url, {\n headers: {\n 'Content-Type': 'application/json',\n },\n });\n if (!response.ok) {\n throw new Error(\n `failed to fetch data, status ${response.status}: ${response.statusText}`,\n );\n }\n return response;\n }\n\n async isTopicRestrictionEnabled() {\n const baseUrl = await this.getBaseUrl();\n const result = await this.fetcher(`${baseUrl}/v1/shields`);\n\n if (!result.ok) {\n throw new Error(\n `failed to get shields, status ${result.status}: ${result.statusText}`,\n );\n }\n\n const response = await result.json();\n if (!response?.shields || !Array.isArray(response.shields)) {\n return false;\n }\n\n return response.shields.some((shield: any) => {\n const providerId = shield.provider_resource_id;\n\n return VALID_TOPIC_RESTRICTION_PROVIDER_IDS.some(\n validId => providerId.toLowerCase() === validId.toLowerCase(),\n );\n });\n }\n\n async getAllModels() {\n const baseUrl = await this.getBaseUrl();\n const result = await this.fetcher(`${baseUrl}/v1/models`);\n\n if (!result.ok) {\n throw new Error(\n `failed to get models, status ${result.status}: ${result.statusText}`,\n );\n }\n\n const response = await result.json();\n\n return response?.models ? response?.models : [];\n }\n\n async getConversationMessages(conversation_id: string) {\n if (conversation_id === TEMP_CONVERSATION_ID) {\n return [];\n }\n const baseUrl = await this.getBaseUrl();\n const result = await this.fetcher(\n `${baseUrl}/v2/conversations/${encodeURIComponent(conversation_id)}`,\n );\n if (!result.ok) {\n throw new Error(\n `failed to get conversation messages, status ${result.status}: ${result.statusText}`,\n );\n }\n const response = await result.json();\n return response.chat_history ?? [];\n }\n\n async getConversations() {\n const baseUrl = await this.getBaseUrl();\n const result = await this.fetcher(`${baseUrl}/v2/conversations`);\n\n if (!result.ok) {\n throw new Error(\n `failed to get conversation, status ${result.status}: ${result.statusText}`,\n );\n }\n\n const response = await result.json();\n return response.conversations ?? [];\n }\n\n async getNotebookConversationIds() {\n const baseUrl = await this.getBaseUrl();\n const result = await this.fetcher(`${baseUrl}/notebook-conversation-ids`);\n\n if (!result.ok) {\n throw new Error(\n `failed to get notebook conversation IDs, status ${result.status}: ${result.statusText}`,\n );\n }\n\n const response = await result.json();\n return response.conversation_ids ?? [];\n }\n\n async stopMessage(requestId: string): Promise<{ success: boolean }> {\n const baseUrl = await this.getBaseUrl();\n const response = await this.fetchApi.fetch(\n `${baseUrl}/v1/query/interrupt`,\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({ request_id: requestId }),\n },\n );\n if (!response.ok) {\n throw new Error(\n `failed to stop message, status ${response.status}: ${response.statusText}`,\n );\n }\n return await response.json();\n }\n async deleteConversation(conversation_id: string) {\n const baseUrl = await this.getBaseUrl();\n\n const response = await this.fetchApi.fetch(\n `${baseUrl}/v2/conversations/${encodeURIComponent(conversation_id)}`,\n {\n method: 'DELETE',\n headers: {},\n },\n );\n\n if (!response.ok) {\n let errorMessage = `failed to delete conversation, status ${response.status}: ${response.statusText}`;\n\n try {\n const errorBody = await response.json();\n if (errorBody?.error) {\n errorMessage = errorBody.error;\n }\n } catch (e) {\n // eslint-disable-next-line no-console\n console.warn(e);\n }\n\n throw new Error(errorMessage);\n }\n return { success: true };\n }\n\n async renameConversation(conversation_id: string, newName: string) {\n const baseUrl = await this.getBaseUrl();\n\n const response = await this.fetchApi.fetch(\n `${baseUrl}/v2/conversations/${encodeURIComponent(conversation_id)}`,\n {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({ topic_summary: newName }),\n },\n );\n\n if (!response.ok) {\n let errorMessage = `failed to rename conversation, status ${response.status}: ${response.statusText}`;\n\n try {\n const errorBody = await response.json();\n if (errorBody?.error) {\n errorMessage = errorBody.error;\n }\n } catch (e) {\n // eslint-disable-next-line no-console\n console.warn(e);\n }\n\n throw new Error(errorMessage);\n }\n return { success: true };\n }\n\n getFeedbackStatus = async () => {\n const baseUrl = await this.getBaseUrl();\n\n const response = await this.fetchApi.fetch(\n `${baseUrl}/v1/feedback/status`,\n {\n method: 'GET',\n headers: {},\n },\n );\n\n if (!response.ok) {\n throw new Error(\n `failed to GET feedback status, status ${response.status}: ${response.statusText}`,\n );\n }\n const result = await response.json();\n return result?.status?.enabled ?? false;\n };\n\n captureFeedback = async (payload: CaptureFeedback) => {\n const baseUrl = await this.getBaseUrl();\n\n const response = await this.fetchApi.fetch(`${baseUrl}/v1/feedback`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n accept: 'application/json',\n },\n body: JSON.stringify(payload),\n });\n\n if (!response.ok) {\n throw new Error(\n `failed to capture feedback, status ${response.status}: ${response.statusText}`,\n );\n }\n return await response.json();\n };\n}\n"],"names":[],"mappings":";;AAwCO,MAAM,mBAAA,CAA6C;AAAA,EACvC,SAAA;AAAA,EACA,QAAA;AAAA,EAEjB,YAAY,OAAA,EAAkB;AAC5B,IAAA,IAAA,CAAK,YAAY,OAAA,CAAQ,SAAA;AACzB,IAAA,IAAA,CAAK,WAAW,OAAA,CAAQ,QAAA;AAAA,EAC1B;AAAA,EAEA,MAAM,UAAA,GAAa;AACjB,IAAA,OAAO,CAAA,EAAG,IAAA,CAAK,SAAA,CAAU,SAAA,CAAU,iBAAiB,CAAC,CAAA,0BAAA,CAAA;AAAA,EACvD;AAAA,EAEA,MAAM,aAAA,CACJ,MAAA,EACA,aAAA,EACA,gBAAA,EACA,iBACA,WAAA,EACA;AACA,IAAA,MAAM,OAAA,GAAU,MAAM,IAAA,CAAK,UAAA,EAAW;AAEtC,IAAA,MAAM,WAAW,MAAM,IAAA,CAAK,SAAS,KAAA,CAAM,CAAA,EAAG,OAAO,CAAA,SAAA,CAAA,EAAa;AAAA,MAChE,MAAA,EAAQ,MAAA;AAAA,MACR,OAAA,EAAS;AAAA,QACP,cAAA,EAAgB;AAAA,OAClB;AAAA,MACA,IAAA,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