@notebook-intelligence/notebook-intelligence 2.4.2 → 2.5.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.
@@ -0,0 +1,29 @@
1
+ // Copyright (c) Mehmet Bektas <mbektasgh@outlook.com>
2
+
3
+ import React from 'react';
4
+
5
+ import { MdOutlineCheckBoxOutlineBlank, MdCheckBox } from 'react-icons/md';
6
+
7
+ export function CheckBoxItem(props: any) {
8
+ const indent = props.indent || 0;
9
+
10
+ return (
11
+ <div
12
+ className={`checkbox-item checkbox-item-indent-${indent} ${props.header ? 'checkbox-item-header' : ''}`}
13
+ title={props.title}
14
+ onClick={event => props.onClick(event)}
15
+ >
16
+ <div className="checkbox-item-toggle">
17
+ {props.checked ? (
18
+ <MdCheckBox className="checkbox-icon" />
19
+ ) : (
20
+ <MdOutlineCheckBoxOutlineBlank className="checkbox-icon" />
21
+ )}
22
+ {props.label}
23
+ </div>
24
+ {props.title && (
25
+ <div className="checkbox-item-description">{props.title}</div>
26
+ )}
27
+ </div>
28
+ );
29
+ }
@@ -0,0 +1,53 @@
1
+ // Copyright (c) Mehmet Bektas <mbektasgh@outlook.com>
2
+
3
+ export function mcpServerSettingsToEnabledState(
4
+ mcpServers: any,
5
+ mcpServerSettings: any
6
+ ) {
7
+ const mcpServerEnabledState = new Map<string, Set<string>>();
8
+ for (const server of mcpServers) {
9
+ const mcpServerToolEnabledState = mcpServerSettingsToServerToolEnabledState(
10
+ mcpServers,
11
+ mcpServerSettings,
12
+ server.id
13
+ );
14
+ if (mcpServerToolEnabledState) {
15
+ mcpServerEnabledState.set(server.id, mcpServerToolEnabledState);
16
+ }
17
+ }
18
+
19
+ return mcpServerEnabledState;
20
+ }
21
+
22
+ export function mcpServerSettingsToServerToolEnabledState(
23
+ mcpServers: any,
24
+ mcpServerSettings: any,
25
+ serverId: string
26
+ ) {
27
+ const server = mcpServers.find((server: any) => server.id === serverId);
28
+
29
+ let mcpServerToolEnabledState: Set<string> | null = null;
30
+
31
+ if (!server) {
32
+ return mcpServerToolEnabledState;
33
+ }
34
+
35
+ if (mcpServerSettings[server.id]) {
36
+ const serverSettings = mcpServerSettings[server.id];
37
+ if (!serverSettings.disabled) {
38
+ mcpServerToolEnabledState = new Set<string>();
39
+ for (const tool of server.tools) {
40
+ if (!serverSettings.disabled_tools?.includes(tool.name)) {
41
+ mcpServerToolEnabledState.add(tool.name);
42
+ }
43
+ }
44
+ }
45
+ } else {
46
+ mcpServerToolEnabledState = new Set<string>();
47
+ for (const tool of server.tools) {
48
+ mcpServerToolEnabledState.add(tool.name);
49
+ }
50
+ }
51
+
52
+ return mcpServerToolEnabledState;
53
+ }
@@ -0,0 +1,15 @@
1
+ // Copyright (c) Mehmet Bektas <mbektasgh@outlook.com>
2
+
3
+ import React from 'react';
4
+
5
+ export function PillItem(props: any) {
6
+ return (
7
+ <div
8
+ className={`pill-item ${props.checked ? 'checked' : ''}`}
9
+ title={props.title}
10
+ onClick={event => props.onClick(event)}
11
+ >
12
+ {props.label}
13
+ </div>
14
+ );
15
+ }