@red-hat-developer-hub/backstage-plugin-intelligent-assistant 5.0.2 → 5.1.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 +11 -0
- package/dist/alpha.d.ts +0 -7
- package/dist/components/LightSpeedChat.esm.js +100 -67
- package/dist/components/LightSpeedChat.esm.js.map +1 -1
- package/dist/components/LightspeedChatBoxHeader.esm.js +2 -1
- package/dist/components/LightspeedChatBoxHeader.esm.js.map +1 -1
- package/dist/components/LightspeedChatContainer.esm.js +38 -60
- package/dist/components/LightspeedChatContainer.esm.js.map +1 -1
- package/dist/components/LightspeedFABContent.esm.js +9 -0
- package/dist/components/LightspeedFABContent.esm.js.map +1 -1
- package/dist/components/LightspeedPage.esm.js +11 -2
- package/dist/components/LightspeedPage.esm.js.map +1 -1
- package/dist/components/McpConfigureServerModal.esm.js +2 -3
- package/dist/components/McpConfigureServerModal.esm.js.map +1 -1
- package/dist/components/McpServersSettings.esm.js +24 -38
- package/dist/components/McpServersSettings.esm.js.map +1 -1
- package/dist/hooks/useAllModels.esm.js +2 -1
- package/dist/hooks/useAllModels.esm.js.map +1 -1
- package/dist/hooks/useConversations.esm.js +2 -1
- package/dist/hooks/useConversations.esm.js.map +1 -1
- package/dist/hooks/useIaChatPermission.esm.js +15 -0
- package/dist/hooks/useIaChatPermission.esm.js.map +1 -0
- package/dist/hooks/useIaMcpToolsPermission.esm.js +15 -0
- package/dist/hooks/useIaMcpToolsPermission.esm.js.map +1 -0
- package/dist/hooks/{notebooks/useLightspeedNotebooksPermission.esm.js → useIaNotebooksPermission.esm.js} +4 -5
- package/dist/hooks/useIaNotebooksPermission.esm.js.map +1 -0
- package/dist/hooks/useMcpConfigureModal.esm.js +5 -9
- package/dist/hooks/useMcpConfigureModal.esm.js.map +1 -1
- package/dist/hooks/useNotebookConversationIds.esm.js +2 -1
- package/dist/hooks/useNotebookConversationIds.esm.js.map +1 -1
- package/dist/hooks/useQuestionValidation.esm.js +3 -2
- package/dist/hooks/useQuestionValidation.esm.js.map +1 -1
- package/dist/hooks/useWelcomePrompts.esm.js +2 -2
- package/dist/hooks/useWelcomePrompts.esm.js.map +1 -1
- package/dist/translations/de.esm.js +0 -7
- package/dist/translations/de.esm.js.map +1 -1
- package/dist/translations/es.esm.js +0 -7
- package/dist/translations/es.esm.js.map +1 -1
- package/dist/translations/fr.esm.js +0 -7
- package/dist/translations/fr.esm.js.map +1 -1
- package/dist/translations/it.esm.js +0 -7
- package/dist/translations/it.esm.js.map +1 -1
- package/dist/translations/ja.esm.js +0 -7
- package/dist/translations/ja.esm.js.map +1 -1
- package/dist/translations/ref.esm.js +0 -8
- package/dist/translations/ref.esm.js.map +1 -1
- package/package.json +3 -2
- package/dist/components/PermissionRequiredIcon.esm.js +0 -18
- package/dist/components/PermissionRequiredIcon.esm.js.map +0 -1
- package/dist/components/PermissionRequiredState.esm.js +0 -88
- package/dist/components/PermissionRequiredState.esm.js.map +0 -1
- package/dist/hooks/notebooks/useLightspeedNotebooksPermission.esm.js.map +0 -1
- package/dist/hooks/useLightspeedDeletePermission.esm.js +0 -12
- package/dist/hooks/useLightspeedDeletePermission.esm.js.map +0 -1
- package/dist/hooks/useLightspeedUpdatePermission.esm.js +0 -12
- package/dist/hooks/useLightspeedUpdatePermission.esm.js.map +0 -1
- package/dist/hooks/useLightspeedViewPermission.esm.js +0 -16
- package/dist/hooks/useLightspeedViewPermission.esm.js.map +0 -1
- package/dist/images/permission-required.svg +0 -319
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @red-hat-developer-hub/backstage-plugin-intelligent-assistant
|
|
2
2
|
|
|
3
|
+
## 5.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- c37b5f1: Gate Intelligent Assistant UI by consolidated RBAC permissions (`intelligent-assistant.chat`, `intelligent-assistant.notebooks`, `intelligent-assistant.mcp.tools`, `intelligent-assistant.skills`). Features are hidden when access is denied instead of showing permission-denied screens or read-only MCP mode.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- a9d54a1: Add createExtensionTester coverage for the NFS extensions and modules
|
|
12
|
+
- @red-hat-developer-hub/backstage-plugin-intelligent-assistant-common@5.1.0
|
|
13
|
+
|
|
3
14
|
## 5.0.2
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/dist/alpha.d.ts
CHANGED
|
@@ -117,11 +117,6 @@ declare const intelligentAssistantTranslationRef: _backstage_frontend_plugin_api
|
|
|
117
117
|
readonly 'conversation.rename.confirm.title': string;
|
|
118
118
|
readonly 'conversation.rename.confirm.action': string;
|
|
119
119
|
readonly 'conversation.rename.placeholder': string;
|
|
120
|
-
readonly 'permission.required.title': string;
|
|
121
|
-
readonly 'permission.required.description': string;
|
|
122
|
-
readonly 'permission.subject.plugin': string;
|
|
123
|
-
readonly 'permission.subject.notebooks': string;
|
|
124
|
-
readonly 'permission.notebooks.goBack': string;
|
|
125
120
|
readonly 'lcore.notConfigured.title': string;
|
|
126
121
|
readonly 'lcore.notConfigured.description': string;
|
|
127
122
|
readonly 'lcore.notConfigured.developerLightspeedDocs': string;
|
|
@@ -193,7 +188,6 @@ declare const intelligentAssistantTranslationRef: _backstage_frontend_plugin_api
|
|
|
193
188
|
readonly 'modal.title.preview': string;
|
|
194
189
|
readonly 'modal.title.edit': string;
|
|
195
190
|
readonly 'icon.lightspeed.alt': string;
|
|
196
|
-
readonly 'icon.permissionRequired.alt': string;
|
|
197
191
|
readonly 'message.options.label': string;
|
|
198
192
|
readonly 'file.upload.error.alreadyExists': string;
|
|
199
193
|
readonly 'file.upload.error.multipleFiles': string;
|
|
@@ -229,7 +223,6 @@ declare const intelligentAssistantTranslationRef: _backstage_frontend_plugin_api
|
|
|
229
223
|
readonly 'mcp.settings.title': string;
|
|
230
224
|
readonly 'mcp.settings.selectedCount': string;
|
|
231
225
|
readonly 'mcp.settings.closeAriaLabel': string;
|
|
232
|
-
readonly 'mcp.settings.readOnlyAccess': string;
|
|
233
226
|
readonly 'mcp.settings.tableAriaLabel': string;
|
|
234
227
|
readonly 'mcp.settings.enabled': string;
|
|
235
228
|
readonly 'mcp.settings.name': string;
|
|
@@ -2,7 +2,6 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { useState, useEffect, useRef, useLayoutEffect, useCallback, useMemo } from 'react';
|
|
3
3
|
import { useNavigate, useMatch, useLocation } from 'react-router-dom';
|
|
4
4
|
import { useApi, configApiRef } from '@backstage/core-plugin-api';
|
|
5
|
-
import Button$1 from '@mui/material/Button';
|
|
6
5
|
import { styled } from '@mui/material/styles';
|
|
7
6
|
import Tab from '@mui/material/Tab';
|
|
8
7
|
import Tabs from '@mui/material/Tabs';
|
|
@@ -20,8 +19,9 @@ import { useConversations } from '../hooks/useConversations.esm.js';
|
|
|
20
19
|
import { useDeleteNotebook } from '../hooks/notebooks/useDeleteNotebook.esm.js';
|
|
21
20
|
import { useIsMobile } from '../hooks/useIsMobile.esm.js';
|
|
22
21
|
import { useLastOpenedConversation } from '../hooks/useLastOpenedConversation.esm.js';
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
22
|
+
import { useIaChatPermission } from '../hooks/useIaChatPermission.esm.js';
|
|
23
|
+
import { useIaMcpToolsPermission } from '../hooks/useIaMcpToolsPermission.esm.js';
|
|
24
|
+
import { useIaNotebooksPermission } from '../hooks/useIaNotebooksPermission.esm.js';
|
|
25
25
|
import '@backstage/plugin-permission-react';
|
|
26
26
|
import '@red-hat-developer-hub/backstage-plugin-intelligent-assistant-common';
|
|
27
27
|
import { useTranslation } from '../hooks/useTranslation.esm.js';
|
|
@@ -36,7 +36,6 @@ import { useStopConversation } from '../hooks/useStopConversation.esm.js';
|
|
|
36
36
|
import { useCreateNotebook } from '../hooks/notebooks/useCreateNotebook.esm.js';
|
|
37
37
|
import { useNotebookDocuments } from '../hooks/notebooks/useNotebookDocuments.esm.js';
|
|
38
38
|
import { useLightspeedDrawerContext } from '../hooks/useLightspeedDrawerContext.esm.js';
|
|
39
|
-
import { useLightspeedUpdatePermission } from '../hooks/useLightspeedUpdatePermission.esm.js';
|
|
40
39
|
import { useWelcomePrompts } from '../hooks/useWelcomePrompts.esm.js';
|
|
41
40
|
import { getAttachments } from '../utils/attachment-utils.esm.js';
|
|
42
41
|
import { extractPageContext } from '../utils/dom-extractor.esm.js';
|
|
@@ -56,7 +55,6 @@ import { NotebooksTab } from './notebooks/NotebooksTab.esm.js';
|
|
|
56
55
|
import { useNotebookStreamStore } from './notebooks/NotebookStreamProvider.esm.js';
|
|
57
56
|
import { NotebookView } from './notebooks/NotebookView.esm.js';
|
|
58
57
|
import { SidebarCollapseIcon, SidebarExpandIcon } from './notebooks/SidebarCollapseIcon.esm.js';
|
|
59
|
-
import PermissionRequiredState from './PermissionRequiredState.esm.js';
|
|
60
58
|
import { RenameConversationModal } from './RenameConversationModal.esm.js';
|
|
61
59
|
import { ToastAlertGroup } from './ToastAlertGroup.esm.js';
|
|
62
60
|
|
|
@@ -425,7 +423,6 @@ const LightspeedChat = ({
|
|
|
425
423
|
const isOnNotebookRoute = Boolean(
|
|
426
424
|
notebooksRouteMatch || notebookViewRouteMatch
|
|
427
425
|
);
|
|
428
|
-
const shouldShowTabs = notebooksEnabled || isOnNotebookRoute;
|
|
429
426
|
const {
|
|
430
427
|
displayMode,
|
|
431
428
|
setDisplayMode,
|
|
@@ -458,13 +455,21 @@ const LightspeedChat = ({
|
|
|
458
455
|
}
|
|
459
456
|
return 0;
|
|
460
457
|
});
|
|
461
|
-
const {
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
iaNotebooksPermissionName
|
|
465
|
-
} = useLightspeedNotebooksPermission();
|
|
458
|
+
const { allowed: hasChatAccess, loading: chatPermissionLoading } = useIaChatPermission();
|
|
459
|
+
const chatPermissionResolved = !chatPermissionLoading && hasChatAccess;
|
|
460
|
+
const { allowed: hasNotebooksAccess, loading: notebooksPermissionLoading } = useIaNotebooksPermission();
|
|
466
461
|
const notebooksPermissionResolved = !notebooksPermissionLoading && hasNotebooksAccess;
|
|
467
|
-
const
|
|
462
|
+
const canShowNotebooks = notebooksPermissionResolved && (notebooksEnabled || isOnNotebookRoute);
|
|
463
|
+
const hasChatTab = chatPermissionResolved;
|
|
464
|
+
const hasNotebooksTab = canShowNotebooks;
|
|
465
|
+
const hasBothTabs = hasChatTab && hasNotebooksTab;
|
|
466
|
+
const shouldShowTabs = hasBothTabs;
|
|
467
|
+
const selectedTabIndex = hasBothTabs ? activeTab : 0;
|
|
468
|
+
const { allowed: hasMcpToolsAccess, loading: mcpToolsPermissionLoading } = useIaMcpToolsPermission();
|
|
469
|
+
const mcpToolsPermissionResolved = !mcpToolsPermissionLoading && hasMcpToolsAccess;
|
|
470
|
+
const { data: notebookConversationIdsArray = [] } = useNotebookConversationIds(
|
|
471
|
+
chatPermissionResolved || notebooksPermissionResolved
|
|
472
|
+
);
|
|
468
473
|
const { data: notebooks = [], refetch: refetchNotebooks } = useNotebookSessions(notebooksPermissionResolved);
|
|
469
474
|
const hasNotebooks = notebooks.length > 0;
|
|
470
475
|
const [openNotebookMenuId, setOpenNotebookMenuId] = useState(
|
|
@@ -518,31 +523,79 @@ const LightspeedChat = ({
|
|
|
518
523
|
const [hasChatContentOverflow, setHasChatContentOverflow] = useState(false);
|
|
519
524
|
const wasStoppedByUserRef = useRef(false);
|
|
520
525
|
const { isReady, lastOpenedId, setLastOpenedId, clearLastOpenedId } = useLastOpenedConversation(user);
|
|
521
|
-
const showChatPanel = activeTab === 0;
|
|
522
|
-
const showNotebooksPanel =
|
|
526
|
+
const showChatPanel = hasChatTab && (activeTab === 0 || !hasNotebooksTab);
|
|
527
|
+
const showNotebooksPanel = hasNotebooksTab && (activeTab === 1 || !hasChatTab);
|
|
523
528
|
const [isChatHistoryDrawerOpen, setIsChatHistoryDrawerOpen] = useState(!isMobile && isFullscreenMode);
|
|
524
529
|
useLayoutEffect(() => {
|
|
525
|
-
if (!isFullscreenMode) {
|
|
530
|
+
if (!isFullscreenMode || chatPermissionLoading || notebooksPermissionLoading) {
|
|
526
531
|
return;
|
|
527
532
|
}
|
|
528
533
|
if (isNotebooksFullscreenPath) {
|
|
534
|
+
if (canShowNotebooks) {
|
|
535
|
+
setActiveTab(1);
|
|
536
|
+
setShellViewTab(1);
|
|
537
|
+
} else if (chatPermissionResolved) {
|
|
538
|
+
navigate(
|
|
539
|
+
routeConversationId ? `${LIGHTSPEED_PATH}/conversation/${routeConversationId}` : LIGHTSPEED_PATH,
|
|
540
|
+
{ replace: true }
|
|
541
|
+
);
|
|
542
|
+
setActiveTab(0);
|
|
543
|
+
setShellViewTab(0);
|
|
544
|
+
}
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
const isBaseLightspeedChatRoute = location.pathname === LIGHTSPEED_PATH || location.pathname === `${LIGHTSPEED_PATH}/`;
|
|
548
|
+
const isConversationRoute = location.pathname.startsWith(
|
|
549
|
+
`${LIGHTSPEED_PATH}/conversation/`
|
|
550
|
+
);
|
|
551
|
+
if (!chatPermissionResolved && canShowNotebooks && (isBaseLightspeedChatRoute || isConversationRoute)) {
|
|
552
|
+
navigate(
|
|
553
|
+
activeNotebookId ? `${LIGHTSPEED_PATH}/notebooks/${activeNotebookId}` : `${LIGHTSPEED_PATH}/notebooks`,
|
|
554
|
+
{ replace: true }
|
|
555
|
+
);
|
|
529
556
|
setActiveTab(1);
|
|
530
557
|
setShellViewTab(1);
|
|
531
558
|
return;
|
|
532
559
|
}
|
|
533
|
-
|
|
534
|
-
if (shellViewTab === 1 && isBaseLightspeedChatRoute) {
|
|
560
|
+
if (shellViewTab === 1 && isBaseLightspeedChatRoute && canShowNotebooks) {
|
|
535
561
|
navigate(`${LIGHTSPEED_PATH}/notebooks`, { replace: true });
|
|
536
562
|
return;
|
|
537
563
|
}
|
|
538
|
-
|
|
539
|
-
|
|
564
|
+
if (chatPermissionResolved) {
|
|
565
|
+
setActiveTab(0);
|
|
566
|
+
setShellViewTab(0);
|
|
567
|
+
}
|
|
540
568
|
}, [
|
|
541
569
|
isFullscreenMode,
|
|
542
570
|
isNotebooksFullscreenPath,
|
|
543
571
|
shellViewTab,
|
|
544
572
|
location.pathname,
|
|
545
573
|
navigate,
|
|
574
|
+
setShellViewTab,
|
|
575
|
+
chatPermissionLoading,
|
|
576
|
+
notebooksPermissionLoading,
|
|
577
|
+
chatPermissionResolved,
|
|
578
|
+
canShowNotebooks,
|
|
579
|
+
activeNotebookId,
|
|
580
|
+
routeConversationId
|
|
581
|
+
]);
|
|
582
|
+
useEffect(() => {
|
|
583
|
+
if (chatPermissionLoading || notebooksPermissionLoading) {
|
|
584
|
+
return;
|
|
585
|
+
}
|
|
586
|
+
if (!chatPermissionResolved && canShowNotebooks && activeTab === 0) {
|
|
587
|
+
setActiveTab(1);
|
|
588
|
+
setShellViewTab(1);
|
|
589
|
+
} else if (chatPermissionResolved && !canShowNotebooks && activeTab !== 0) {
|
|
590
|
+
setActiveTab(0);
|
|
591
|
+
setShellViewTab(0);
|
|
592
|
+
}
|
|
593
|
+
}, [
|
|
594
|
+
chatPermissionLoading,
|
|
595
|
+
notebooksPermissionLoading,
|
|
596
|
+
chatPermissionResolved,
|
|
597
|
+
canShowNotebooks,
|
|
598
|
+
activeTab,
|
|
546
599
|
setShellViewTab
|
|
547
600
|
]);
|
|
548
601
|
const maybeAutoDeleteScratchNotebook = useCallback(() => {
|
|
@@ -565,13 +618,19 @@ const LightspeedChat = ({
|
|
|
565
618
|
deleteNotebook
|
|
566
619
|
]);
|
|
567
620
|
const handleNotebookTabSelect = (_event, nextTab) => {
|
|
568
|
-
|
|
621
|
+
let logicalTab = 0;
|
|
622
|
+
if (hasBothTabs) {
|
|
623
|
+
logicalTab = nextTab;
|
|
624
|
+
} else if (hasNotebooksTab) {
|
|
625
|
+
logicalTab = 1;
|
|
626
|
+
}
|
|
627
|
+
if (logicalTab === 0) {
|
|
569
628
|
maybeAutoDeleteScratchNotebook();
|
|
570
629
|
}
|
|
571
|
-
setActiveTab(
|
|
572
|
-
setShellViewTab(
|
|
630
|
+
setActiveTab(logicalTab);
|
|
631
|
+
setShellViewTab(logicalTab);
|
|
573
632
|
if (isFullscreenMode) {
|
|
574
|
-
if (
|
|
633
|
+
if (logicalTab === 1) {
|
|
575
634
|
navigate(
|
|
576
635
|
activeNotebookId ? `${LIGHTSPEED_PATH}/notebooks/${activeNotebookId}` : `${LIGHTSPEED_PATH}/notebooks`
|
|
577
636
|
);
|
|
@@ -581,7 +640,7 @@ const LightspeedChat = ({
|
|
|
581
640
|
);
|
|
582
641
|
}
|
|
583
642
|
}
|
|
584
|
-
if (
|
|
643
|
+
if (logicalTab === 1 && notebooksPermissionResolved) {
|
|
585
644
|
refetchNotebooks();
|
|
586
645
|
}
|
|
587
646
|
};
|
|
@@ -678,6 +737,11 @@ const LightspeedChat = ({
|
|
|
678
737
|
setChatHeaderBgColor(computedBg);
|
|
679
738
|
}
|
|
680
739
|
}, [displayMode, isMcpSettingsOpen]);
|
|
740
|
+
useEffect(() => {
|
|
741
|
+
if (!mcpToolsPermissionResolved && isMcpSettingsOpen) {
|
|
742
|
+
setIsMcpSettingsOpen(false);
|
|
743
|
+
}
|
|
744
|
+
}, [mcpToolsPermissionResolved, isMcpSettingsOpen]);
|
|
681
745
|
const {
|
|
682
746
|
isPinningChatsEnabled,
|
|
683
747
|
pinnedChats,
|
|
@@ -738,10 +802,8 @@ const LightspeedChat = ({
|
|
|
738
802
|
data: conversations = [],
|
|
739
803
|
isLoading,
|
|
740
804
|
isRefetching
|
|
741
|
-
} = useConversations();
|
|
742
|
-
const
|
|
743
|
-
const { allowed: hasUpdateAccess } = useLightspeedUpdatePermission();
|
|
744
|
-
const samplePrompts = useWelcomePrompts();
|
|
805
|
+
} = useConversations(chatPermissionResolved);
|
|
806
|
+
const samplePrompts = useWelcomePrompts(chatPermissionResolved);
|
|
745
807
|
useEffect(() => {
|
|
746
808
|
if (!user || !isReady) return;
|
|
747
809
|
const onOverlayLikeSurface = isFullscreenMode || !routeConversationId;
|
|
@@ -939,7 +1001,6 @@ const LightspeedChat = ({
|
|
|
939
1001
|
/* @__PURE__ */ jsx(
|
|
940
1002
|
DropdownItem,
|
|
941
1003
|
{
|
|
942
|
-
isDisabled: !hasUpdateAccess,
|
|
943
1004
|
icon: /* @__PURE__ */ jsx(PenIcon, {}),
|
|
944
1005
|
onClick: () => openChatRenameModal(conversationSummary.conversation_id),
|
|
945
1006
|
children: t("conversation.rename")
|
|
@@ -963,7 +1024,6 @@ const LightspeedChat = ({
|
|
|
963
1024
|
/* @__PURE__ */ jsx(
|
|
964
1025
|
DropdownItem,
|
|
965
1026
|
{
|
|
966
|
-
isDisabled: !hasDeleteAccess,
|
|
967
1027
|
icon: /* @__PURE__ */ jsx(TrashIcon, {}),
|
|
968
1028
|
onClick: () => openDeleteModal(conversationSummary.conversation_id),
|
|
969
1029
|
children: t("conversation.delete")
|
|
@@ -972,15 +1032,7 @@ const LightspeedChat = ({
|
|
|
972
1032
|
] })
|
|
973
1033
|
};
|
|
974
1034
|
},
|
|
975
|
-
[
|
|
976
|
-
pinnedChats,
|
|
977
|
-
hasDeleteAccess,
|
|
978
|
-
isPinningChatsEnabled,
|
|
979
|
-
hasUpdateAccess,
|
|
980
|
-
t,
|
|
981
|
-
pinChat,
|
|
982
|
-
unpinChat
|
|
983
|
-
]
|
|
1035
|
+
[pinnedChats, isPinningChatsEnabled, t, pinChat, unpinChat]
|
|
984
1036
|
);
|
|
985
1037
|
const notebookConversationIds = useMemo(
|
|
986
1038
|
() => new Set(notebookConversationIdsArray),
|
|
@@ -1477,7 +1529,7 @@ const LightspeedChat = ({
|
|
|
1477
1529
|
}
|
|
1478
1530
|
);
|
|
1479
1531
|
const mainPanelContent = (() => {
|
|
1480
|
-
if (!isMcpSettingsOpen) {
|
|
1532
|
+
if (!isMcpSettingsOpen || !mcpToolsPermissionResolved) {
|
|
1481
1533
|
return /* @__PURE__ */ jsx(Fragment, { children: chatMainContent });
|
|
1482
1534
|
}
|
|
1483
1535
|
if (isFullscreenMode) {
|
|
@@ -1640,6 +1692,7 @@ const LightspeedChat = ({
|
|
|
1640
1692
|
isPinningChatsEnabled,
|
|
1641
1693
|
hideModelSelector: true,
|
|
1642
1694
|
showChatTabOptions: !showNotebooksPanel,
|
|
1695
|
+
showMcpSettings: mcpToolsPermissionResolved,
|
|
1643
1696
|
setDisplayMode: setDisplayModeFromHeader,
|
|
1644
1697
|
displayMode,
|
|
1645
1698
|
onPinnedChatsToggle: handlePinningChatsToggle,
|
|
@@ -1647,11 +1700,11 @@ const LightspeedChat = ({
|
|
|
1647
1700
|
}
|
|
1648
1701
|
)
|
|
1649
1702
|
] }),
|
|
1650
|
-
|
|
1703
|
+
/* @__PURE__ */ jsx(HeaderDivider, { "data-testid": "lightspeed-header-divider" }),
|
|
1651
1704
|
shouldShowTabs && /* @__PURE__ */ jsxs(
|
|
1652
1705
|
Tabs,
|
|
1653
1706
|
{
|
|
1654
|
-
value:
|
|
1707
|
+
value: selectedTabIndex,
|
|
1655
1708
|
onChange: handleNotebookTabSelect,
|
|
1656
1709
|
"aria-label": t("tabs.ariaLabel"),
|
|
1657
1710
|
variant: "standard",
|
|
@@ -1693,7 +1746,7 @@ const LightspeedChat = ({
|
|
|
1693
1746
|
}
|
|
1694
1747
|
}),
|
|
1695
1748
|
children: [
|
|
1696
|
-
/* @__PURE__ */ jsx(
|
|
1749
|
+
hasChatTab && /* @__PURE__ */ jsx(
|
|
1697
1750
|
Tab,
|
|
1698
1751
|
{
|
|
1699
1752
|
disableRipple: true,
|
|
@@ -1701,7 +1754,7 @@ const LightspeedChat = ({
|
|
|
1701
1754
|
"aria-label": t("tabs.chat")
|
|
1702
1755
|
}
|
|
1703
1756
|
),
|
|
1704
|
-
/* @__PURE__ */ jsx(
|
|
1757
|
+
hasNotebooksTab && /* @__PURE__ */ jsx(
|
|
1705
1758
|
Tab,
|
|
1706
1759
|
{
|
|
1707
1760
|
disableRipple: true,
|
|
@@ -1729,7 +1782,7 @@ const LightspeedChat = ({
|
|
|
1729
1782
|
}
|
|
1730
1783
|
),
|
|
1731
1784
|
/* @__PURE__ */ jsxs(ChatMain, { children: [
|
|
1732
|
-
showChatPanel && /* @__PURE__ */ jsx(
|
|
1785
|
+
showChatPanel && chatPermissionResolved && /* @__PURE__ */ jsx(
|
|
1733
1786
|
ConditionalWrapper,
|
|
1734
1787
|
{
|
|
1735
1788
|
condition: isFullscreenMode,
|
|
@@ -1805,7 +1858,7 @@ const LightspeedChat = ({
|
|
|
1805
1858
|
)
|
|
1806
1859
|
}
|
|
1807
1860
|
),
|
|
1808
|
-
showNotebooksPanel &&
|
|
1861
|
+
showNotebooksPanel && canShowNotebooks && activeNotebook && /* @__PURE__ */ jsx(
|
|
1809
1862
|
NotebookView,
|
|
1810
1863
|
{
|
|
1811
1864
|
sessionId: activeNotebook.session_id,
|
|
@@ -1829,7 +1882,7 @@ const LightspeedChat = ({
|
|
|
1829
1882
|
onUploadsInProgressChange: setNotebookUploadsInProgress
|
|
1830
1883
|
}
|
|
1831
1884
|
),
|
|
1832
|
-
showNotebooksPanel &&
|
|
1885
|
+
showNotebooksPanel && canShowNotebooks && !activeNotebook && /* @__PURE__ */ jsx(
|
|
1833
1886
|
"div",
|
|
1834
1887
|
{
|
|
1835
1888
|
style: {
|
|
@@ -1864,26 +1917,6 @@ const LightspeedChat = ({
|
|
|
1864
1917
|
}
|
|
1865
1918
|
)
|
|
1866
1919
|
}
|
|
1867
|
-
),
|
|
1868
|
-
showNotebooksPanel && !notebooksPermissionLoading && !hasNotebooksAccess && /* @__PURE__ */ jsx(
|
|
1869
|
-
PermissionRequiredState,
|
|
1870
|
-
{
|
|
1871
|
-
subject: t("permission.subject.notebooks"),
|
|
1872
|
-
permissions: [iaNotebooksPermissionName],
|
|
1873
|
-
action: /* @__PURE__ */ jsx(
|
|
1874
|
-
Button$1,
|
|
1875
|
-
{
|
|
1876
|
-
variant: "outlined",
|
|
1877
|
-
color: "primary",
|
|
1878
|
-
style: { borderRadius: "20px" },
|
|
1879
|
-
onClick: () => {
|
|
1880
|
-
setActiveTab(0);
|
|
1881
|
-
setShellViewTab(0);
|
|
1882
|
-
},
|
|
1883
|
-
children: t("permission.notebooks.goBack")
|
|
1884
|
-
}
|
|
1885
|
-
)
|
|
1886
|
-
}
|
|
1887
1920
|
)
|
|
1888
1921
|
] })
|
|
1889
1922
|
]
|