@notebook-intelligence/notebook-intelligence 2.0.0 → 2.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/lib/chat-sidebar.js +10 -9
- package/package.json +1 -1
- package/src/chat-sidebar.tsx +23 -13
- package/style/base.css +33 -4
package/lib/chat-sidebar.js
CHANGED
|
@@ -318,10 +318,11 @@ async function submitCompletionRequest(request, responseEmitter) {
|
|
|
318
318
|
}
|
|
319
319
|
function CheckBoxItem(props) {
|
|
320
320
|
const indent = props.indent || 0;
|
|
321
|
-
return (React.createElement(
|
|
322
|
-
React.createElement("div", { className:
|
|
321
|
+
return (React.createElement("div", { className: `checkbox-item checkbox-item-indent-${indent} ${props.header ? 'checkbox-item-header' : ''}`, title: props.title, onClick: event => props.onClick(event) },
|
|
322
|
+
React.createElement("div", { className: "checkbox-item-toggle" },
|
|
323
323
|
props.checked ? (React.createElement(MdCheckBox, { className: "checkbox-icon" })) : (React.createElement(MdOutlineCheckBoxOutlineBlank, { className: "checkbox-icon" })),
|
|
324
|
-
props.label)
|
|
324
|
+
props.label),
|
|
325
|
+
props.title && (React.createElement("div", { className: "checkbox-item-description" }, props.title))));
|
|
325
326
|
}
|
|
326
327
|
function SidebarComponent(props) {
|
|
327
328
|
const [chatMessages, setChatMessages] = useState([]);
|
|
@@ -449,7 +450,7 @@ function SidebarComponent(props) {
|
|
|
449
450
|
const mcpServer = toolConfig.mcpServers.find(server => server.id === id);
|
|
450
451
|
const selectedServerTools = toolSelections.mcpServers[id];
|
|
451
452
|
for (const tool of mcpServer.tools) {
|
|
452
|
-
if (!selectedServerTools.includes(tool)) {
|
|
453
|
+
if (!selectedServerTools.includes(tool.name)) {
|
|
453
454
|
return false;
|
|
454
455
|
}
|
|
455
456
|
}
|
|
@@ -464,7 +465,7 @@ function SidebarComponent(props) {
|
|
|
464
465
|
else {
|
|
465
466
|
const mcpServer = toolConfig.mcpServers.find(server => server.id === id);
|
|
466
467
|
const newConfig = { ...toolSelections };
|
|
467
|
-
newConfig.mcpServers[id] = structuredClone(mcpServer.tools);
|
|
468
|
+
newConfig.mcpServers[id] = structuredClone(mcpServer.tools.map((tool) => tool.name));
|
|
468
469
|
setToolSelections(newConfig);
|
|
469
470
|
}
|
|
470
471
|
};
|
|
@@ -1206,16 +1207,16 @@ function SidebarComponent(props) {
|
|
|
1206
1207
|
React.createElement("div", null, "Done"))),
|
|
1207
1208
|
React.createElement("div", { className: "mode-tools-popover-tool-list" },
|
|
1208
1209
|
React.createElement("div", { className: "mode-tools-group-header" }, "Built-in"),
|
|
1209
|
-
React.createElement("div", { className: "mode-tools-group" }, toolConfig.builtinToolsets.map((toolset) => (React.createElement(CheckBoxItem, { key: toolset.id, label: toolset.name, checked: getBuiltinToolsetState(toolset.id), onClick: () => {
|
|
1210
|
+
React.createElement("div", { className: "mode-tools-group mode-tools-group-built-in" }, toolConfig.builtinToolsets.map((toolset) => (React.createElement(CheckBoxItem, { key: toolset.id, label: toolset.name, checked: getBuiltinToolsetState(toolset.id), header: true, onClick: () => {
|
|
1210
1211
|
setBuiltinToolsetState(toolset.id, !getBuiltinToolsetState(toolset.id));
|
|
1211
1212
|
} })))),
|
|
1212
1213
|
toolConfig.mcpServers.length > 0 && (React.createElement("div", { className: "mode-tools-group-header" }, "MCP Servers")),
|
|
1213
1214
|
toolConfig.mcpServers.map((mcpServer, index) => (React.createElement("div", { className: "mode-tools-group" },
|
|
1214
|
-
React.createElement(CheckBoxItem, { label: mcpServer.id, checked: getMCPServerState(mcpServer.id), onClick: () => onMCPServerClicked(mcpServer.id) }),
|
|
1215
|
-
mcpServer.tools.map((tool, index) => (React.createElement(CheckBoxItem, { label: tool, indent: 1, checked: getMCPServerToolState(mcpServer.id, tool), onClick: () => setMCPServerToolState(mcpServer.id, tool, !getMCPServerToolState(mcpServer.id, tool)) })))))),
|
|
1215
|
+
React.createElement(CheckBoxItem, { label: mcpServer.id, header: true, checked: getMCPServerState(mcpServer.id), onClick: () => onMCPServerClicked(mcpServer.id) }),
|
|
1216
|
+
mcpServer.tools.map((tool, index) => (React.createElement(CheckBoxItem, { label: tool.name, title: tool.description, indent: 1, checked: getMCPServerToolState(mcpServer.id, tool.name), onClick: () => setMCPServerToolState(mcpServer.id, tool.name, !getMCPServerToolState(mcpServer.id, tool.name)) })))))),
|
|
1216
1217
|
hasExtensionTools && (React.createElement("div", { className: "mode-tools-group-header" }, "Extension tools")),
|
|
1217
1218
|
toolConfig.extensions.map((extension, index) => (React.createElement("div", { className: "mode-tools-group" },
|
|
1218
|
-
React.createElement(CheckBoxItem, { label: `${extension.name} (${extension.id})`, checked: getExtensionState(extension.id), onClick: () => onExtensionClicked(extension.id) }),
|
|
1219
|
+
React.createElement(CheckBoxItem, { label: `${extension.name} (${extension.id})`, header: true, checked: getExtensionState(extension.id), onClick: () => onExtensionClicked(extension.id) }),
|
|
1219
1220
|
extension.toolsets.map((toolset, index) => (React.createElement(React.Fragment, null,
|
|
1220
1221
|
React.createElement(CheckBoxItem, { label: `${toolset.name} (${toolset.id})`, indent: 1, checked: getExtensionToolsetState(extension.id, toolset.id), onClick: () => onExtensionToolsetClicked(extension.id, toolset.id) }),
|
|
1221
1222
|
toolset.tools.map((tool, index) => (React.createElement(CheckBoxItem, { label: tool, indent: 2, checked: getExtensionToolsetToolState(extension.id, toolset.id, tool), onClick: () => setExtensionToolsetToolState(extension.id, toolset.id, tool, !getExtensionToolsetToolState(extension.id, toolset.id, tool)) }))))))))))))))));
|
package/package.json
CHANGED
package/src/chat-sidebar.tsx
CHANGED
|
@@ -651,11 +651,12 @@ function CheckBoxItem(props: any) {
|
|
|
651
651
|
const indent = props.indent || 0;
|
|
652
652
|
|
|
653
653
|
return (
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
654
|
+
<div
|
|
655
|
+
className={`checkbox-item checkbox-item-indent-${indent} ${props.header ? 'checkbox-item-header' : ''}`}
|
|
656
|
+
title={props.title}
|
|
657
|
+
onClick={event => props.onClick(event)}
|
|
658
|
+
>
|
|
659
|
+
<div className="checkbox-item-toggle">
|
|
659
660
|
{props.checked ? (
|
|
660
661
|
<MdCheckBox className="checkbox-icon" />
|
|
661
662
|
) : (
|
|
@@ -663,7 +664,10 @@ function CheckBoxItem(props: any) {
|
|
|
663
664
|
)}
|
|
664
665
|
{props.label}
|
|
665
666
|
</div>
|
|
666
|
-
|
|
667
|
+
{props.title && (
|
|
668
|
+
<div className="checkbox-item-description">{props.title}</div>
|
|
669
|
+
)}
|
|
670
|
+
</div>
|
|
667
671
|
);
|
|
668
672
|
}
|
|
669
673
|
|
|
@@ -823,7 +827,7 @@ function SidebarComponent(props: any) {
|
|
|
823
827
|
const selectedServerTools: string[] = toolSelections.mcpServers[id];
|
|
824
828
|
|
|
825
829
|
for (const tool of mcpServer.tools) {
|
|
826
|
-
if (!selectedServerTools.includes(tool)) {
|
|
830
|
+
if (!selectedServerTools.includes(tool.name)) {
|
|
827
831
|
return false;
|
|
828
832
|
}
|
|
829
833
|
}
|
|
@@ -839,7 +843,9 @@ function SidebarComponent(props: any) {
|
|
|
839
843
|
} else {
|
|
840
844
|
const mcpServer = toolConfig.mcpServers.find(server => server.id === id);
|
|
841
845
|
const newConfig = { ...toolSelections };
|
|
842
|
-
newConfig.mcpServers[id] = structuredClone(
|
|
846
|
+
newConfig.mcpServers[id] = structuredClone(
|
|
847
|
+
mcpServer.tools.map((tool: any) => tool.name)
|
|
848
|
+
);
|
|
843
849
|
setToolSelections(newConfig);
|
|
844
850
|
}
|
|
845
851
|
};
|
|
@@ -1915,12 +1921,13 @@ function SidebarComponent(props: any) {
|
|
|
1915
1921
|
</div>
|
|
1916
1922
|
<div className="mode-tools-popover-tool-list">
|
|
1917
1923
|
<div className="mode-tools-group-header">Built-in</div>
|
|
1918
|
-
<div className="mode-tools-group">
|
|
1924
|
+
<div className="mode-tools-group mode-tools-group-built-in">
|
|
1919
1925
|
{toolConfig.builtinToolsets.map((toolset: any) => (
|
|
1920
1926
|
<CheckBoxItem
|
|
1921
1927
|
key={toolset.id}
|
|
1922
1928
|
label={toolset.name}
|
|
1923
1929
|
checked={getBuiltinToolsetState(toolset.id)}
|
|
1930
|
+
header={true}
|
|
1924
1931
|
onClick={() => {
|
|
1925
1932
|
setBuiltinToolsetState(
|
|
1926
1933
|
toolset.id,
|
|
@@ -1937,19 +1944,21 @@ function SidebarComponent(props: any) {
|
|
|
1937
1944
|
<div className="mode-tools-group">
|
|
1938
1945
|
<CheckBoxItem
|
|
1939
1946
|
label={mcpServer.id}
|
|
1947
|
+
header={true}
|
|
1940
1948
|
checked={getMCPServerState(mcpServer.id)}
|
|
1941
1949
|
onClick={() => onMCPServerClicked(mcpServer.id)}
|
|
1942
1950
|
/>
|
|
1943
1951
|
{mcpServer.tools.map((tool: any, index: number) => (
|
|
1944
1952
|
<CheckBoxItem
|
|
1945
|
-
label={tool}
|
|
1953
|
+
label={tool.name}
|
|
1954
|
+
title={tool.description}
|
|
1946
1955
|
indent={1}
|
|
1947
|
-
checked={getMCPServerToolState(mcpServer.id, tool)}
|
|
1956
|
+
checked={getMCPServerToolState(mcpServer.id, tool.name)}
|
|
1948
1957
|
onClick={() =>
|
|
1949
1958
|
setMCPServerToolState(
|
|
1950
1959
|
mcpServer.id,
|
|
1951
|
-
tool,
|
|
1952
|
-
!getMCPServerToolState(mcpServer.id, tool)
|
|
1960
|
+
tool.name,
|
|
1961
|
+
!getMCPServerToolState(mcpServer.id, tool.name)
|
|
1953
1962
|
)
|
|
1954
1963
|
}
|
|
1955
1964
|
/>
|
|
@@ -1963,6 +1972,7 @@ function SidebarComponent(props: any) {
|
|
|
1963
1972
|
<div className="mode-tools-group">
|
|
1964
1973
|
<CheckBoxItem
|
|
1965
1974
|
label={`${extension.name} (${extension.id})`}
|
|
1975
|
+
header={true}
|
|
1966
1976
|
checked={getExtensionState(extension.id)}
|
|
1967
1977
|
onClick={() => onExtensionClicked(extension.id)}
|
|
1968
1978
|
/>
|
package/style/base.css
CHANGED
|
@@ -370,6 +370,10 @@ pre:has(.code-block-header) {
|
|
|
370
370
|
flex-direction: column;
|
|
371
371
|
}
|
|
372
372
|
|
|
373
|
+
.mode-tools-popover-title {
|
|
374
|
+
font-weight: bold;
|
|
375
|
+
}
|
|
376
|
+
|
|
373
377
|
.mode-tools-popover-header {
|
|
374
378
|
display: flex;
|
|
375
379
|
align-items: center;
|
|
@@ -758,10 +762,7 @@ svg.access-token-warning {
|
|
|
758
762
|
|
|
759
763
|
.checkbox-item {
|
|
760
764
|
display: flex;
|
|
761
|
-
|
|
762
|
-
gap: 5px;
|
|
763
|
-
margin: 0 2px;
|
|
764
|
-
padding: 3px 2px;
|
|
765
|
+
flex-direction: column;
|
|
765
766
|
cursor: pointer;
|
|
766
767
|
}
|
|
767
768
|
|
|
@@ -789,4 +790,32 @@ svg.access-token-warning {
|
|
|
789
790
|
width: 16px;
|
|
790
791
|
height: 16px;
|
|
791
792
|
color: var(--jp-brand-color1);
|
|
793
|
+
padding-top: 1px;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
.checkbox-item-toggle {
|
|
797
|
+
display: flex;
|
|
798
|
+
align-items: center;
|
|
799
|
+
gap: 5px;
|
|
800
|
+
margin: 0 2px;
|
|
801
|
+
padding: 3px 2px;
|
|
802
|
+
color: var(--jp-ui-font-color1);
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
.checkbox-item-header .checkbox-item-toggle {
|
|
806
|
+
color: var(--jp-ui-font-color0);
|
|
807
|
+
font-weight: bold;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
.mode-tools-group-built-in .checkbox-item-toggle {
|
|
811
|
+
font-weight: normal;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
.checkbox-item-description {
|
|
815
|
+
padding-left: 25px;
|
|
816
|
+
color: var(--jp-ui-font-color2);
|
|
817
|
+
padding-bottom: 4px;
|
|
818
|
+
overflow: hidden;
|
|
819
|
+
text-overflow: ellipsis;
|
|
820
|
+
white-space: nowrap;
|
|
792
821
|
}
|