@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/README.md
ADDED
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
# Lightspeed plugin for Backstage
|
|
2
|
+
|
|
3
|
+
Red Hat Developer Hub Intelligent Assistant (Intelligent Assistant for RHDH) is a virtual assistant powered by generative AI that offers in-depth insights into Red Hat Developer Hub (RHDH), including its wide range of capabilities. You can interact with this assistant to explore and learn more about RHDH in greater detail.
|
|
4
|
+
|
|
5
|
+
The Intelligent Assistant for RHDH provides a natural language interface within the RHDH console, helping you easily find information about the product, understand its features, and get answers to your questions as they come up.
|
|
6
|
+
|
|
7
|
+
## Plugin Architecture
|
|
8
|
+
|
|
9
|
+
This plugin supports two frontend systems:
|
|
10
|
+
|
|
11
|
+
| Entry Point | System | Import Path |
|
|
12
|
+
| -------------- | ----------------------------- | ---------------------------------------------------------------------- |
|
|
13
|
+
| `./` (default) | **NFS** (New Frontend System) | `@red-hat-developer-hub/backstage-plugin-intelligent-assistant` |
|
|
14
|
+
| `./legacy` | **OFS** (Old Frontend System) | `@red-hat-developer-hub/backstage-plugin-intelligent-assistant/legacy` |
|
|
15
|
+
| `./alpha` | Translations only | `@red-hat-developer-hub/backstage-plugin-intelligent-assistant/alpha` |
|
|
16
|
+
|
|
17
|
+
NFS is the primary and recommended mode. OFS is available exclusively at the `./legacy` subpath for community consumers until Backstage 2.x drops OFS support.
|
|
18
|
+
|
|
19
|
+
## For administrators
|
|
20
|
+
|
|
21
|
+
### Migration from `lightspeed` to `intelligent-assistant`
|
|
22
|
+
|
|
23
|
+
If you are upgrading from a previous version, the configuration namespace and RBAC permission names have changed. See the [backend plugin migration guide](../intelligent-assistant-backend/README.md#migration-from-lightspeed-to-intelligent-assistant) for the full list of renamed config keys and permission policies.
|
|
24
|
+
|
|
25
|
+
> **Warning**: The old `lightspeed:` config key and `lightspeed.*` permission names are no longer recognized. Existing deployments that do not update will silently lose functionality.
|
|
26
|
+
|
|
27
|
+
### Prerequisites
|
|
28
|
+
|
|
29
|
+
- Follow the lightspeed backend plugin [README](https://github.com/redhat-developer/rhdh-plugins/blob/main/workspaces/intelligent-assistant/plugins/intelligent-assistant-backend/README.md) to integrate lightspeed backend in your Backstage instance.
|
|
30
|
+
|
|
31
|
+
**Note**
|
|
32
|
+
|
|
33
|
+
### Permission Framework Support
|
|
34
|
+
|
|
35
|
+
The Lightspeed plugin has support for the permission framework.
|
|
36
|
+
|
|
37
|
+
- When [RBAC permission](https://github.com/backstage/community-plugins/tree/main/workspaces/rbac/plugins/rbac-backend#installation) framework is enabled, for non-admin users to access lightspeed UI, the role associated with your user should have the following permission policies associated with it. Add the following in your permission policies configuration file named `rbac-policy.csv`:
|
|
38
|
+
|
|
39
|
+
```CSV
|
|
40
|
+
p, role:default/team_a, intelligent-assistant.chat.read, read, allow
|
|
41
|
+
p, role:default/team_a, intelligent-assistant.chat.create, create, allow
|
|
42
|
+
p, role:default/team_a, intelligent-assistant.chat.delete, delete, allow
|
|
43
|
+
p, role:default/team_a, intelligent-assistant.chat.update, update, allow
|
|
44
|
+
|
|
45
|
+
# Required for Notebooks feature (if enabled)
|
|
46
|
+
p, role:default/team_a, intelligent-assistant.notebooks.use, update, allow
|
|
47
|
+
|
|
48
|
+
# Required for MCP server management (if configured)
|
|
49
|
+
p, role:default/team_a, intelligent-assistant.mcp.read, read, allow
|
|
50
|
+
p, role:default/team_a, intelligent-assistant.mcp.manage, update, allow
|
|
51
|
+
|
|
52
|
+
g, user:default/<your-user-name>, role:default/team_a
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
You can specify the path to this configuration file in your application configuration:
|
|
57
|
+
|
|
58
|
+
```yaml
|
|
59
|
+
permission:
|
|
60
|
+
enabled: true
|
|
61
|
+
rbac:
|
|
62
|
+
policies-csv-file: /some/path/rbac-policy.csv
|
|
63
|
+
policyFileReload: true
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Installation
|
|
67
|
+
|
|
68
|
+
```console
|
|
69
|
+
yarn workspace app add @red-hat-developer-hub/backstage-plugin-intelligent-assistant
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Configuration
|
|
73
|
+
|
|
74
|
+
#### NFS (New Frontend System) — Recommended
|
|
75
|
+
|
|
76
|
+
NFS is the default export. Import modules directly from the package root and register them as features in `createApp`:
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
import { createApp } from '@backstage/frontend-defaults';
|
|
80
|
+
|
|
81
|
+
import { appDrawerModule } from '@red-hat-developer-hub/backstage-plugin-app-react/alpha';
|
|
82
|
+
import {
|
|
83
|
+
intelligentAssistantFABModule,
|
|
84
|
+
intelligentAssistantRedirectModule,
|
|
85
|
+
intelligentAssistantTranslationsModule,
|
|
86
|
+
} from '@red-hat-developer-hub/backstage-plugin-intelligent-assistant';
|
|
87
|
+
|
|
88
|
+
export default createApp({
|
|
89
|
+
features: [
|
|
90
|
+
appDrawerModule,
|
|
91
|
+
intelligentAssistantFABModule,
|
|
92
|
+
intelligentAssistantRedirectModule,
|
|
93
|
+
intelligentAssistantTranslationsModule,
|
|
94
|
+
// ...other modules
|
|
95
|
+
],
|
|
96
|
+
});
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Enable the extensions in `app-config.yaml`:
|
|
100
|
+
|
|
101
|
+
```yaml
|
|
102
|
+
app:
|
|
103
|
+
extensions:
|
|
104
|
+
- app-root-wrapper:app/drawer
|
|
105
|
+
- app-root-wrapper:app/intelligent-assistant-fab
|
|
106
|
+
- translation:app/intelligent-assistant-translations
|
|
107
|
+
- api:app/app-language:
|
|
108
|
+
config:
|
|
109
|
+
availableLanguages: ['en', 'de', 'es', 'fr', 'it', 'ja']
|
|
110
|
+
defaultLanguage: 'en'
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
> **Important:** The order of `app-root-wrapper` extensions matters. `app/drawer` must come before `app/intelligent-assistant-fab` to ensure correct React Context nesting.
|
|
114
|
+
|
|
115
|
+
#### OFS (Old Frontend System / Legacy)
|
|
116
|
+
|
|
117
|
+
Legacy components are available at the `./legacy` subpath:
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
import {
|
|
121
|
+
LightspeedDrawerProvider,
|
|
122
|
+
LightspeedIcon,
|
|
123
|
+
LightspeedPage,
|
|
124
|
+
} from '@red-hat-developer-hub/backstage-plugin-intelligent-assistant/legacy';
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Add a route in `packages/app/src/App.tsx`:
|
|
128
|
+
|
|
129
|
+
```tsx
|
|
130
|
+
<Route path="/intelligent-assistant" element={<LightspeedPage />} />
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Add a sidebar entry in `packages/app/src/components/Root/Root.tsx`:
|
|
134
|
+
|
|
135
|
+
```tsx
|
|
136
|
+
<SidebarItem
|
|
137
|
+
icon={LightspeedIcon as IconComponent}
|
|
138
|
+
to="intelligent-assistant"
|
|
139
|
+
text="Intelligent assistant"
|
|
140
|
+
/>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## For users
|
|
144
|
+
|
|
145
|
+
### Using the Lightspeed plugin in Backstage
|
|
146
|
+
|
|
147
|
+
Lightspeed is a front-end plugin that enables you to interact with any LLM server running a model with OpenAI's API compatibility.
|
|
148
|
+
|
|
149
|
+
#### Prerequisites
|
|
150
|
+
|
|
151
|
+
- Your Backstage application is installed and running.
|
|
152
|
+
- You have installed the Lightspeed plugin. For installation process, see [Installation](#installation).
|
|
153
|
+
|
|
154
|
+
#### Procedure
|
|
155
|
+
|
|
156
|
+
1. Open your Backstage application and select the **Intelligent assistant** nav item from the **Navigation**.
|
|
157
|
+
2. Ask your questions to the intelligent assistant chatbot.
|
|
158
|
+
|
|
159
|
+
### Display modes and chat continuity
|
|
160
|
+
|
|
161
|
+
Intelligent assistant supports multiple **display modes** from Settings (for example overlay, docked, embedded, and fullscreen). Switching modes can remount the chat surface; your **current conversation** and **tool-call metadata** for that thread stay with the session so the active chat is not reset. Live streaming text may not update continuously across a mode switch until the assistant response finishes loading.
|
|
162
|
+
|
|
163
|
+
### MCP servers settings
|
|
164
|
+
|
|
165
|
+
Intelligent assistant includes an MCP servers settings panel where users can:
|
|
166
|
+
|
|
167
|
+
- View configured MCP servers and current status
|
|
168
|
+
- Enable or disable eligible servers
|
|
169
|
+
- Configure a personal token per server
|
|
170
|
+
- See inline status and validation feedback
|
|
171
|
+
|
|
172
|
+
#### Token validation behavior
|
|
173
|
+
|
|
174
|
+
When configuring a server token in the settings modal, the token is validated
|
|
175
|
+
automatically after typing stops briefly. The input shows inline feedback:
|
|
176
|
+
|
|
177
|
+
- Success: `Connection successful`
|
|
178
|
+
- Error: `Authorization failed. Try again.`
|
|
179
|
+
|
|
180
|
+
Users can then save the configuration after validation feedback is displayed.
|
|
181
|
+
|
|
182
|
+
### Notebooks (Developer Preview)
|
|
183
|
+
|
|
184
|
+
Notebooks is an experimental feature that enables **document-based conversations with Retrieval-Augmented Generation (RAG)**. This feature allows you to:
|
|
185
|
+
|
|
186
|
+
- **Create persistent notebook sessions** with their own vector databases
|
|
187
|
+
- **Upload and manage documents** to query against, including:
|
|
188
|
+
- Text files (`.txt`, `.md`, `.log`)
|
|
189
|
+
- PDF documents with automatic text extraction
|
|
190
|
+
- Structured data (`.json`, `.yaml`)
|
|
191
|
+
- Web content via URL (up to 20MB per file)
|
|
192
|
+
- **Query your documents** using natural language and get context-aware AI responses
|
|
193
|
+
- **Organize documents** by sessions with metadata and tagging
|
|
194
|
+
- **Maintain context** across conversations - all uploaded documents remain available throughout the session
|
|
195
|
+
|
|
196
|
+
#### How Notebooks Works
|
|
197
|
+
|
|
198
|
+
1. **Session Management**: Create a notebook session, which is backed by its own vector database
|
|
199
|
+
2. **Document Upload**: Upload documents - they are automatically processed, chunked, and embedded into the vector database
|
|
200
|
+
3. **RAG Conversations**: Ask questions about your documents - relevant chunks are retrieved and provided as context to the LLM
|
|
201
|
+
4. **Persistent Storage**: Your documents and conversations remain available throughout the session lifecycle
|
|
202
|
+
|
|
203
|
+
#### Prerequisites for Notebooks
|
|
204
|
+
|
|
205
|
+
- Notebooks requires a **Lightspeed Stack service** to be running
|
|
206
|
+
- The backend administrator must enable the feature (see [Backend Configuration](../intelligent-assistant-backend/README.md#notebooks-developer-preview))
|
|
207
|
+
- Users need the appropriate RBAC permissions (if enabled)
|
|
208
|
+
|
|
209
|
+
#### Using Notebooks
|
|
210
|
+
|
|
211
|
+
1. Ensure Notebooks is enabled in your Backstage instance
|
|
212
|
+
2. Navigate to the Intelligent assistant page
|
|
213
|
+
3. Create a new notebook session or select an existing one
|
|
214
|
+
4. Upload documents you want to query
|
|
215
|
+
5. Start asking questions about your uploaded documents
|
|
216
|
+
|
|
217
|
+
For backend configuration and API details, administrators should refer to the [Lightspeed Backend Plugin Documentation](../intelligent-assistant-backend/README.md#notebooks-developer-preview).
|
|
218
|
+
|
|
219
|
+
## Loading as Dynamic Plugin
|
|
220
|
+
|
|
221
|
+
### NFS Mode (Module Federation)
|
|
222
|
+
|
|
223
|
+
NFS mode uses standard Module Federation for dynamic plugin loading. Set the following environment variables on the RHDH instance:
|
|
224
|
+
|
|
225
|
+
```env
|
|
226
|
+
APP_CONFIG_app_packageName=app-next
|
|
227
|
+
ENABLE_STANDARD_MODULE_FEDERATION=true
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Enable the plugin and its extensions in your dynamic plugins configuration:
|
|
231
|
+
|
|
232
|
+
```yaml
|
|
233
|
+
plugins:
|
|
234
|
+
- package: './local-plugins/red-hat-developer-hub-backstage-plugin-intelligent-assistant'
|
|
235
|
+
disabled: false
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Then configure extensions in `app-config.yaml`:
|
|
239
|
+
|
|
240
|
+
```yaml
|
|
241
|
+
app:
|
|
242
|
+
extensions:
|
|
243
|
+
- app-root-wrapper:app/drawer
|
|
244
|
+
- app-root-wrapper:app/intelligent-assistant-fab
|
|
245
|
+
- translation:app/intelligent-assistant-translations
|
|
246
|
+
- api:app/app-language:
|
|
247
|
+
config:
|
|
248
|
+
availableLanguages: ['en', 'de', 'es', 'fr', 'it', 'ja']
|
|
249
|
+
defaultLanguage: 'en'
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
**Verify** the modules are exposed by checking:
|
|
253
|
+
|
|
254
|
+
```
|
|
255
|
+
http://localhost:7007/.backstage/dynamic-features/remotes
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Expected: entries for `IntelligentAssistantFABModule` and `IntelligentAssistantTranslationsModule`.
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
### OFS Mode (Scalprum / Legacy)
|
|
263
|
+
|
|
264
|
+
OFS mode uses Scalprum for dynamic plugin loading. Legacy exports require `module: Legacy`. Translation resources require `module: Alpha`:
|
|
265
|
+
|
|
266
|
+
```yaml
|
|
267
|
+
plugins:
|
|
268
|
+
- package: './local-plugins/red-hat-developer-hub-backstage-plugin-intelligent-assistant'
|
|
269
|
+
disabled: false
|
|
270
|
+
pluginConfig:
|
|
271
|
+
dynamicPlugins:
|
|
272
|
+
frontend:
|
|
273
|
+
red-hat-developer-hub.backstage-plugin-intelligent-assistant:
|
|
274
|
+
translationResources:
|
|
275
|
+
- importName: lightspeedTranslations
|
|
276
|
+
module: Alpha
|
|
277
|
+
ref: intelligentAssistantTranslationRef
|
|
278
|
+
dynamicRoutes:
|
|
279
|
+
- path: /intelligent-assistant
|
|
280
|
+
importName: LightspeedPage
|
|
281
|
+
module: Legacy
|
|
282
|
+
mountPoints:
|
|
283
|
+
- mountPoint: application/listener
|
|
284
|
+
importName: LightspeedFAB
|
|
285
|
+
module: Legacy
|
|
286
|
+
- mountPoint: application/provider
|
|
287
|
+
importName: LightspeedDrawerProvider
|
|
288
|
+
module: Legacy
|
|
289
|
+
- mountPoint: application/internal/drawer-state
|
|
290
|
+
importName: LightspeedDrawerStateExposer
|
|
291
|
+
module: Legacy
|
|
292
|
+
- mountPoint: application/internal/drawer-content
|
|
293
|
+
importName: LightspeedChatContainer
|
|
294
|
+
module: Legacy
|
|
295
|
+
config:
|
|
296
|
+
id: intelligent-assistant
|
|
297
|
+
priority: 100
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
**Verify** the plugin is loaded via:
|
|
301
|
+
|
|
302
|
+
```
|
|
303
|
+
http://localhost:7007/api/scalprum/plugins
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
### Installing locally
|
|
309
|
+
|
|
310
|
+
Export the dynamic plugin assets and install into your RHDH instance:
|
|
311
|
+
|
|
312
|
+
```bash
|
|
313
|
+
cd workspaces/intelligent-assistant/plugins/intelligent-assistant
|
|
314
|
+
yarn install
|
|
315
|
+
yarn tsc
|
|
316
|
+
yarn build
|
|
317
|
+
npx @red-hat-developer-hub/cli plugin export --dev --dynamic-plugins-root <path-to-dynamic-plugins-root>
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
Then configure the plugin for either NFS or OFS mode as described above.
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## Migration Guide
|
|
325
|
+
|
|
326
|
+
### NFS consumers
|
|
327
|
+
|
|
328
|
+
```ts
|
|
329
|
+
// Before (alpha subpath)
|
|
330
|
+
import { intelligentAssistantFABModule } from '@red-hat-developer-hub/backstage-plugin-intelligent-assistant/alpha';
|
|
331
|
+
|
|
332
|
+
// After (default entry point)
|
|
333
|
+
import { intelligentAssistantFABModule } from '@red-hat-developer-hub/backstage-plugin-intelligent-assistant';
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
### Legacy / OFS consumers
|
|
337
|
+
|
|
338
|
+
Legacy component imports have been **removed from the main package path**. OFS consumers must update imports to use the `./legacy` subpath:
|
|
339
|
+
|
|
340
|
+
```ts
|
|
341
|
+
// Before (no longer works)
|
|
342
|
+
import { LightspeedPage, LightspeedDrawerProvider } from '@red-hat-developer-hub/backstage-plugin-intelligent-assistant';
|
|
343
|
+
|
|
344
|
+
// After (required)
|
|
345
|
+
import { LightspeedPage, LightspeedDrawerProvider } from '@red-hat-developer-hub/backstage-plugin-intelligent-assistant/legacy';
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### Dynamic plugin configuration (OFS)
|
|
349
|
+
|
|
350
|
+
Legacy exports are available exclusively from the `Legacy` module. Use `module: Legacy` in your dynamic plugin configuration:
|
|
351
|
+
|
|
352
|
+
```yaml
|
|
353
|
+
dynamicRoutes:
|
|
354
|
+
- path: /intelligent-assistant
|
|
355
|
+
importName: LightspeedPage
|
|
356
|
+
module: Legacy
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
### Dynamic plugin module name change
|
|
360
|
+
|
|
361
|
+
The `LightspeedPlugin` scalprum module has been removed. Configurations that previously used `module: LightspeedPlugin` should be updated:
|
|
362
|
+
|
|
363
|
+
- **OFS/Legacy** — use `module: Legacy` (required since legacy exports are no longer on the default module)
|
|
364
|
+
- **NFS** — use the default `module: PluginRoot` (or omit `module` entirely)
|
|
365
|
+
|
|
366
|
+
```yaml
|
|
367
|
+
# Before
|
|
368
|
+
dynamicRoutes:
|
|
369
|
+
- path: /intelligent-assistant
|
|
370
|
+
importName: LightspeedPage
|
|
371
|
+
module: LightspeedPlugin
|
|
372
|
+
|
|
373
|
+
# After (OFS)
|
|
374
|
+
dynamicRoutes:
|
|
375
|
+
- path: /intelligent-assistant
|
|
376
|
+
importName: LightspeedPage
|
|
377
|
+
module: Legacy
|
|
378
|
+
```
|
package/config.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Red Hat, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export interface Config {
|
|
18
|
+
/**
|
|
19
|
+
* Configuration required for using intelligent-assistant
|
|
20
|
+
* @visibility frontend
|
|
21
|
+
*/
|
|
22
|
+
'intelligent-assistant'?: {
|
|
23
|
+
prompts?: Array</**
|
|
24
|
+
* @visibility frontend
|
|
25
|
+
*/
|
|
26
|
+
{
|
|
27
|
+
/**
|
|
28
|
+
* The title of the prompt.
|
|
29
|
+
* Displayed as the heading of the prompt.
|
|
30
|
+
* @visibility frontend
|
|
31
|
+
*/
|
|
32
|
+
title: string;
|
|
33
|
+
/**
|
|
34
|
+
* The main question or message shown in the prompt.
|
|
35
|
+
* @visibility frontend
|
|
36
|
+
*/
|
|
37
|
+
message: string;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Configuration for AI Notebooks
|
|
41
|
+
* @visibility frontend
|
|
42
|
+
*/
|
|
43
|
+
notebooks?: {
|
|
44
|
+
/**
|
|
45
|
+
* Enable/disable AI Notebooks feature
|
|
46
|
+
* When enabled, exposes AI Notebooks REST API endpoints for document-based conversations with RAG.
|
|
47
|
+
* Requires Lightspeed service to be running (default: http://0.0.0.0:8080).
|
|
48
|
+
* @default false
|
|
49
|
+
* @visibility frontend
|
|
50
|
+
*/
|
|
51
|
+
enabled: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Query configuration for notebooks
|
|
54
|
+
* @visibility frontend
|
|
55
|
+
*/
|
|
56
|
+
queryDefaults?: {
|
|
57
|
+
/**
|
|
58
|
+
* Model to use for answering queries
|
|
59
|
+
* @visibility frontend
|
|
60
|
+
*/
|
|
61
|
+
model: string;
|
|
62
|
+
/**
|
|
63
|
+
* AI provider for the query model
|
|
64
|
+
* @visibility frontend
|
|
65
|
+
*/
|
|
66
|
+
provider_id: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
}
|