@modelcontextprotocol/inspector 0.7.0 → 0.8.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/README.md +13 -1
- package/bin/cli.js +36 -38
- package/client/bin/cli.js +16 -2
- package/client/dist/assets/{OAuthCallback-C5xCfXlk.js → OAuthCallback-DrQsfqzq.js} +1 -1
- package/client/dist/assets/{index-Dt6l7sEy.css → index-BxIjx6su.css} +59 -12
- package/client/dist/assets/{index-D7o7JmLV.js → index-DrNN0pLZ.js} +464 -171
- package/client/dist/index.html +2 -2
- package/package.json +5 -3
- package/server/build/index.js +15 -13
|
@@ -12180,7 +12180,7 @@ class McpError extends Error {
|
|
|
12180
12180
|
this.name = "McpError";
|
|
12181
12181
|
}
|
|
12182
12182
|
}
|
|
12183
|
-
const DEFAULT_REQUEST_TIMEOUT_MSEC
|
|
12183
|
+
const DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4;
|
|
12184
12184
|
class Protocol {
|
|
12185
12185
|
constructor(_options) {
|
|
12186
12186
|
this._options = _options;
|
|
@@ -12437,7 +12437,7 @@ class Protocol {
|
|
|
12437
12437
|
var _a2;
|
|
12438
12438
|
cancel((_a2 = options === null || options === void 0 ? void 0 : options.signal) === null || _a2 === void 0 ? void 0 : _a2.reason);
|
|
12439
12439
|
});
|
|
12440
|
-
const timeout = (_d = options === null || options === void 0 ? void 0 : options.timeout) !== null && _d !== void 0 ? _d : DEFAULT_REQUEST_TIMEOUT_MSEC
|
|
12440
|
+
const timeout = (_d = options === null || options === void 0 ? void 0 : options.timeout) !== null && _d !== void 0 ? _d : DEFAULT_REQUEST_TIMEOUT_MSEC;
|
|
12441
12441
|
const timeoutHandler = () => cancel(new McpError(ErrorCode.RequestTimeout, "Request timed out", { timeout }));
|
|
12442
12442
|
this._setupTimeout(messageId, timeout, options === null || options === void 0 ? void 0 : options.maxTotalTimeout, timeoutHandler);
|
|
12443
12443
|
this._transport.send(jsonrpcRequest).catch((error) => {
|
|
@@ -12685,15 +12685,18 @@ class Client extends Protocol {
|
|
|
12685
12685
|
return this.notification({ method: "notifications/roots/list_changed" });
|
|
12686
12686
|
}
|
|
12687
12687
|
}
|
|
12688
|
-
var __defProp = Object.defineProperty, __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value, __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
|
|
12689
12688
|
class ParseError extends Error {
|
|
12690
12689
|
constructor(message, options) {
|
|
12691
|
-
super(message),
|
|
12690
|
+
super(message), this.name = "ParseError", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line;
|
|
12692
12691
|
}
|
|
12693
12692
|
}
|
|
12694
12693
|
function noop(_arg) {
|
|
12695
12694
|
}
|
|
12696
12695
|
function createParser(callbacks) {
|
|
12696
|
+
if (typeof callbacks == "function")
|
|
12697
|
+
throw new TypeError(
|
|
12698
|
+
"`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?"
|
|
12699
|
+
);
|
|
12697
12700
|
const { onEvent = noop, onError = noop, onRetry = noop, onComment } = callbacks;
|
|
12698
12701
|
let incompleteLine = "", isFirstChunk = true, id2, data = "", eventType = "";
|
|
12699
12702
|
function feed(newChunk) {
|
|
@@ -12761,19 +12764,25 @@ function createParser(callbacks) {
|
|
|
12761
12764
|
}), id2 = void 0, data = "", eventType = "";
|
|
12762
12765
|
}
|
|
12763
12766
|
function reset(options = {}) {
|
|
12764
|
-
incompleteLine && options.consume && parseLine(incompleteLine), id2 = void 0, data = "", eventType = "", incompleteLine = "";
|
|
12767
|
+
incompleteLine && options.consume && parseLine(incompleteLine), isFirstChunk = true, id2 = void 0, data = "", eventType = "", incompleteLine = "";
|
|
12765
12768
|
}
|
|
12766
12769
|
return { feed, reset };
|
|
12767
12770
|
}
|
|
12768
12771
|
function splitLines(chunk) {
|
|
12769
12772
|
const lines = [];
|
|
12770
|
-
let incompleteLine = "";
|
|
12771
|
-
|
|
12772
|
-
|
|
12773
|
-
|
|
12774
|
-
|
|
12775
|
-
|
|
12776
|
-
|
|
12773
|
+
let incompleteLine = "", searchIndex = 0;
|
|
12774
|
+
for (; searchIndex < chunk.length; ) {
|
|
12775
|
+
const crIndex = chunk.indexOf("\r", searchIndex), lfIndex = chunk.indexOf(`
|
|
12776
|
+
`, searchIndex);
|
|
12777
|
+
let lineEnd = -1;
|
|
12778
|
+
if (crIndex !== -1 && lfIndex !== -1 ? lineEnd = Math.min(crIndex, lfIndex) : crIndex !== -1 ? lineEnd = crIndex : lfIndex !== -1 && (lineEnd = lfIndex), lineEnd === -1) {
|
|
12779
|
+
incompleteLine = chunk.slice(searchIndex);
|
|
12780
|
+
break;
|
|
12781
|
+
} else {
|
|
12782
|
+
const line = chunk.slice(searchIndex, lineEnd);
|
|
12783
|
+
lines.push(line), searchIndex = lineEnd + 1, chunk[searchIndex - 1] === "\r" && chunk[searchIndex] === `
|
|
12784
|
+
` && searchIndex++;
|
|
12785
|
+
}
|
|
12777
12786
|
}
|
|
12778
12787
|
return [lines, incompleteLine];
|
|
12779
12788
|
}
|
|
@@ -13494,6 +13503,12 @@ const SESSION_KEYS = {
|
|
|
13494
13503
|
TOKENS: "mcp_tokens",
|
|
13495
13504
|
CLIENT_INFORMATION: "mcp_client_information"
|
|
13496
13505
|
};
|
|
13506
|
+
const DEFAULT_INSPECTOR_CONFIG = {
|
|
13507
|
+
MCP_SERVER_REQUEST_TIMEOUT: {
|
|
13508
|
+
description: "Timeout for requests to the MCP server (ms)",
|
|
13509
|
+
value: 1e4
|
|
13510
|
+
}
|
|
13511
|
+
};
|
|
13497
13512
|
const StdErrNotificationSchema = NotificationSchema.extend({
|
|
13498
13513
|
method: z.literal("notifications/stderr"),
|
|
13499
13514
|
params: z.object({
|
|
@@ -13502,7 +13517,7 @@ const StdErrNotificationSchema = NotificationSchema.extend({
|
|
|
13502
13517
|
});
|
|
13503
13518
|
ClientNotificationSchema.or(
|
|
13504
13519
|
StdErrNotificationSchema
|
|
13505
|
-
).or(ServerNotificationSchema);
|
|
13520
|
+
).or(ServerNotificationSchema).or(NotificationSchema);
|
|
13506
13521
|
class InspectorOAuthClientProvider {
|
|
13507
13522
|
get redirectUrl() {
|
|
13508
13523
|
return window.location.origin + "/oauth/callback";
|
|
@@ -13556,7 +13571,7 @@ class InspectorOAuthClientProvider {
|
|
|
13556
13571
|
}
|
|
13557
13572
|
const authProvider = new InspectorOAuthClientProvider();
|
|
13558
13573
|
const name = "@modelcontextprotocol/inspector-client";
|
|
13559
|
-
const version$1 = "0.
|
|
13574
|
+
const version$1 = "0.8.0";
|
|
13560
13575
|
const description = "Client-side application for the Model Context Protocol inspector";
|
|
13561
13576
|
const license = "MIT";
|
|
13562
13577
|
const author = "Anthropic, PBC (https://anthropic.com)";
|
|
@@ -13574,14 +13589,14 @@ const scripts = {
|
|
|
13574
13589
|
dev: "vite",
|
|
13575
13590
|
build: "tsc -b && vite build",
|
|
13576
13591
|
lint: "eslint .",
|
|
13577
|
-
preview: "vite preview",
|
|
13592
|
+
preview: "vite preview --port 6274",
|
|
13578
13593
|
test: "jest --config jest.config.cjs",
|
|
13579
13594
|
"test:watch": "jest --config jest.config.cjs --watch"
|
|
13580
13595
|
};
|
|
13581
13596
|
const dependencies = {
|
|
13582
13597
|
"@modelcontextprotocol/sdk": "^1.6.1",
|
|
13583
|
-
"@radix-ui/react-dialog": "^1.1.3",
|
|
13584
13598
|
"@radix-ui/react-checkbox": "^1.1.4",
|
|
13599
|
+
"@radix-ui/react-dialog": "^1.1.3",
|
|
13585
13600
|
"@radix-ui/react-icons": "^1.3.0",
|
|
13586
13601
|
"@radix-ui/react-label": "^2.1.0",
|
|
13587
13602
|
"@radix-ui/react-popover": "^1.1.3",
|
|
@@ -13594,7 +13609,7 @@ const dependencies = {
|
|
|
13594
13609
|
cmdk: "^1.0.4",
|
|
13595
13610
|
"lucide-react": "^0.447.0",
|
|
13596
13611
|
"pkce-challenge": "^4.1.0",
|
|
13597
|
-
prismjs: "^1.
|
|
13612
|
+
prismjs: "^1.30.0",
|
|
13598
13613
|
react: "^18.3.1",
|
|
13599
13614
|
"react-dom": "^18.3.1",
|
|
13600
13615
|
"react-simple-code-editor": "^0.14.1",
|
|
@@ -13606,6 +13621,8 @@ const dependencies = {
|
|
|
13606
13621
|
};
|
|
13607
13622
|
const devDependencies = {
|
|
13608
13623
|
"@eslint/js": "^9.11.1",
|
|
13624
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
13625
|
+
"@testing-library/react": "^16.2.0",
|
|
13609
13626
|
"@types/jest": "^29.5.14",
|
|
13610
13627
|
"@types/node": "^22.7.5",
|
|
13611
13628
|
"@types/react": "^18.3.10",
|
|
@@ -13642,8 +13659,6 @@ const packageJson = {
|
|
|
13642
13659
|
dependencies,
|
|
13643
13660
|
devDependencies
|
|
13644
13661
|
};
|
|
13645
|
-
const params$1 = new URLSearchParams(window.location.search);
|
|
13646
|
-
const DEFAULT_REQUEST_TIMEOUT_MSEC = parseInt(params$1.get("timeout") ?? "") || 1e4;
|
|
13647
13662
|
function useConnection({
|
|
13648
13663
|
transportType,
|
|
13649
13664
|
command,
|
|
@@ -13652,7 +13667,7 @@ function useConnection({
|
|
|
13652
13667
|
env,
|
|
13653
13668
|
proxyServerUrl,
|
|
13654
13669
|
bearerToken,
|
|
13655
|
-
requestTimeout
|
|
13670
|
+
requestTimeout,
|
|
13656
13671
|
onNotification,
|
|
13657
13672
|
onStdErrNotification,
|
|
13658
13673
|
onPendingRequest,
|
|
@@ -13797,18 +13812,21 @@ function useConnection({
|
|
|
13797
13812
|
}
|
|
13798
13813
|
});
|
|
13799
13814
|
if (onNotification) {
|
|
13800
|
-
|
|
13815
|
+
[
|
|
13816
|
+
CancelledNotificationSchema,
|
|
13801
13817
|
ProgressNotificationSchema,
|
|
13802
|
-
onNotification
|
|
13803
|
-
);
|
|
13804
|
-
client.setNotificationHandler(
|
|
13805
|
-
ResourceUpdatedNotificationSchema,
|
|
13806
|
-
onNotification
|
|
13807
|
-
);
|
|
13808
|
-
client.setNotificationHandler(
|
|
13809
13818
|
LoggingMessageNotificationSchema,
|
|
13810
|
-
|
|
13811
|
-
|
|
13819
|
+
ResourceUpdatedNotificationSchema,
|
|
13820
|
+
ResourceListChangedNotificationSchema,
|
|
13821
|
+
ToolListChangedNotificationSchema,
|
|
13822
|
+
PromptListChangedNotificationSchema
|
|
13823
|
+
].forEach((notificationSchema) => {
|
|
13824
|
+
client.setNotificationHandler(notificationSchema, onNotification);
|
|
13825
|
+
});
|
|
13826
|
+
client.fallbackNotificationHandler = (notification) => {
|
|
13827
|
+
onNotification(notification);
|
|
13828
|
+
return Promise.resolve();
|
|
13829
|
+
};
|
|
13812
13830
|
}
|
|
13813
13831
|
if (onStdErrNotification) {
|
|
13814
13832
|
client.setNotificationHandler(
|
|
@@ -13851,6 +13869,13 @@ function useConnection({
|
|
|
13851
13869
|
setConnectionStatus("error");
|
|
13852
13870
|
}
|
|
13853
13871
|
};
|
|
13872
|
+
const disconnect = async () => {
|
|
13873
|
+
await (mcpClient == null ? void 0 : mcpClient.close());
|
|
13874
|
+
setMcpClient(null);
|
|
13875
|
+
setConnectionStatus("disconnected");
|
|
13876
|
+
setCompletionsSupported(false);
|
|
13877
|
+
setServerCapabilities(null);
|
|
13878
|
+
};
|
|
13854
13879
|
return {
|
|
13855
13880
|
connectionStatus,
|
|
13856
13881
|
serverCapabilities,
|
|
@@ -13860,7 +13885,8 @@ function useConnection({
|
|
|
13860
13885
|
sendNotification,
|
|
13861
13886
|
handleCompletion,
|
|
13862
13887
|
completionsSupported,
|
|
13863
|
-
connect
|
|
13888
|
+
connect,
|
|
13889
|
+
disconnect
|
|
13864
13890
|
};
|
|
13865
13891
|
}
|
|
13866
13892
|
function useDraggablePane(initialHeight) {
|
|
@@ -17612,6 +17638,21 @@ const Plus = createLucideIcon("Plus", [
|
|
|
17612
17638
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
17613
17639
|
["path", { d: "M12 5v14", key: "s699le" }]
|
|
17614
17640
|
]);
|
|
17641
|
+
/**
|
|
17642
|
+
* @license lucide-react v0.447.0 - ISC
|
|
17643
|
+
*
|
|
17644
|
+
* This source code is licensed under the ISC license.
|
|
17645
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
17646
|
+
*/
|
|
17647
|
+
const RefreshCwOff = createLucideIcon("RefreshCwOff", [
|
|
17648
|
+
["path", { d: "M21 8L18.74 5.74A9.75 9.75 0 0 0 12 3C11 3 10.03 3.16 9.13 3.47", key: "1krf6h" }],
|
|
17649
|
+
["path", { d: "M8 16H3v5", key: "1cv678" }],
|
|
17650
|
+
["path", { d: "M3 12C3 9.51 4 7.26 5.64 5.64", key: "ruvoct" }],
|
|
17651
|
+
["path", { d: "m3 16 2.26 2.26A9.75 9.75 0 0 0 12 21c2.49 0 4.74-1 6.36-2.64", key: "19q130" }],
|
|
17652
|
+
["path", { d: "M21 12c0 1-.16 1.97-.47 2.87", key: "4w8emr" }],
|
|
17653
|
+
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
|
|
17654
|
+
["path", { d: "M22 22 2 2", key: "1r8tn9" }]
|
|
17655
|
+
]);
|
|
17615
17656
|
/**
|
|
17616
17657
|
* @license lucide-react v0.447.0 - ISC
|
|
17617
17658
|
*
|
|
@@ -17624,6 +17665,16 @@ const RefreshCw = createLucideIcon("RefreshCw", [
|
|
|
17624
17665
|
["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
|
|
17625
17666
|
["path", { d: "M8 16H3v5", key: "1cv678" }]
|
|
17626
17667
|
]);
|
|
17668
|
+
/**
|
|
17669
|
+
* @license lucide-react v0.447.0 - ISC
|
|
17670
|
+
*
|
|
17671
|
+
* This source code is licensed under the ISC license.
|
|
17672
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
17673
|
+
*/
|
|
17674
|
+
const RotateCcw = createLucideIcon("RotateCcw", [
|
|
17675
|
+
["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
|
|
17676
|
+
["path", { d: "M3 3v5h5", key: "1xhq8a" }]
|
|
17677
|
+
]);
|
|
17627
17678
|
/**
|
|
17628
17679
|
* @license lucide-react v0.447.0 - ISC
|
|
17629
17680
|
*
|
|
@@ -17657,7 +17708,182 @@ const Send = createLucideIcon("Send", [
|
|
|
17657
17708
|
],
|
|
17658
17709
|
["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }]
|
|
17659
17710
|
]);
|
|
17711
|
+
/**
|
|
17712
|
+
* @license lucide-react v0.447.0 - ISC
|
|
17713
|
+
*
|
|
17714
|
+
* This source code is licensed under the ISC license.
|
|
17715
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
17716
|
+
*/
|
|
17717
|
+
const Settings = createLucideIcon("Settings", [
|
|
17718
|
+
[
|
|
17719
|
+
"path",
|
|
17720
|
+
{
|
|
17721
|
+
d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",
|
|
17722
|
+
key: "1qme2f"
|
|
17723
|
+
}
|
|
17724
|
+
],
|
|
17725
|
+
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
17726
|
+
]);
|
|
17660
17727
|
const ConsoleTab = () => /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "console", className: "h-96", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-gray-900 text-gray-100 p-4 rounded-lg h-full font-mono text-sm overflow-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "opacity-50", children: "Welcome to MCP Client Console" }) }) });
|
|
17728
|
+
function tryParseJson(str) {
|
|
17729
|
+
const trimmed = str.trim();
|
|
17730
|
+
if (!(trimmed.startsWith("{") && trimmed.endsWith("}")) && !(trimmed.startsWith("[") && trimmed.endsWith("]"))) {
|
|
17731
|
+
return { success: false, data: str };
|
|
17732
|
+
}
|
|
17733
|
+
try {
|
|
17734
|
+
return { success: true, data: JSON.parse(str) };
|
|
17735
|
+
} catch {
|
|
17736
|
+
return { success: false, data: str };
|
|
17737
|
+
}
|
|
17738
|
+
}
|
|
17739
|
+
const JsonView = reactExports.memo(
|
|
17740
|
+
({ data, name: name2, initialExpandDepth = 3 }) => {
|
|
17741
|
+
const normalizedData = typeof data === "string" ? tryParseJson(data).success ? tryParseJson(data).data : data : data;
|
|
17742
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-mono text-sm transition-all duration-300 ", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
17743
|
+
JsonNode,
|
|
17744
|
+
{
|
|
17745
|
+
data: normalizedData,
|
|
17746
|
+
name: name2,
|
|
17747
|
+
depth: 0,
|
|
17748
|
+
initialExpandDepth
|
|
17749
|
+
}
|
|
17750
|
+
) });
|
|
17751
|
+
}
|
|
17752
|
+
);
|
|
17753
|
+
JsonView.displayName = "JsonView";
|
|
17754
|
+
const JsonNode = reactExports.memo(
|
|
17755
|
+
({ data, name: name2, depth = 0, initialExpandDepth }) => {
|
|
17756
|
+
const [isExpanded, setIsExpanded] = reactExports.useState(depth < initialExpandDepth);
|
|
17757
|
+
const getDataType = (value) => {
|
|
17758
|
+
if (Array.isArray(value)) return "array";
|
|
17759
|
+
if (value === null) return "null";
|
|
17760
|
+
return typeof value;
|
|
17761
|
+
};
|
|
17762
|
+
const dataType = getDataType(data);
|
|
17763
|
+
const typeStyleMap = {
|
|
17764
|
+
number: "text-blue-600",
|
|
17765
|
+
boolean: "text-amber-600",
|
|
17766
|
+
null: "text-purple-600",
|
|
17767
|
+
undefined: "text-gray-600",
|
|
17768
|
+
string: "text-green-600 break-all whitespace-pre-wrap",
|
|
17769
|
+
default: "text-gray-700"
|
|
17770
|
+
};
|
|
17771
|
+
const renderCollapsible = (isArray) => {
|
|
17772
|
+
const items = isArray ? data : Object.entries(data);
|
|
17773
|
+
const itemCount = items.length;
|
|
17774
|
+
const isEmpty = itemCount === 0;
|
|
17775
|
+
const symbolMap = {
|
|
17776
|
+
open: isArray ? "[" : "{",
|
|
17777
|
+
close: isArray ? "]" : "}",
|
|
17778
|
+
collapsed: isArray ? "[ ... ]" : "{ ... }",
|
|
17779
|
+
empty: isArray ? "[]" : "{}"
|
|
17780
|
+
};
|
|
17781
|
+
if (isEmpty) {
|
|
17782
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
|
|
17783
|
+
name2 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400", children: [
|
|
17784
|
+
name2,
|
|
17785
|
+
":"
|
|
17786
|
+
] }),
|
|
17787
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-gray-500", children: symbolMap.empty })
|
|
17788
|
+
] });
|
|
17789
|
+
}
|
|
17790
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col", children: [
|
|
17791
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
17792
|
+
"div",
|
|
17793
|
+
{
|
|
17794
|
+
className: "flex items-center mr-1 rounded cursor-pointer group hover:bg-gray-800/10 dark:hover:bg-gray-800/20",
|
|
17795
|
+
onClick: () => setIsExpanded(!isExpanded),
|
|
17796
|
+
children: [
|
|
17797
|
+
name2 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400 dark:group-hover:text-gray-100 group-hover:text-gray-400", children: [
|
|
17798
|
+
name2,
|
|
17799
|
+
":"
|
|
17800
|
+
] }),
|
|
17801
|
+
isExpanded ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-gray-600 dark:text-gray-400 dark:group-hover:text-gray-100 group-hover:text-gray-400", children: symbolMap.open }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
17802
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-gray-600 dark:group-hover:text-gray-100 group-hover:text-gray-400", children: symbolMap.collapsed }),
|
|
17803
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "ml-1 text-gray-700 dark:group-hover:text-gray-100 group-hover:text-gray-400", children: [
|
|
17804
|
+
itemCount,
|
|
17805
|
+
" ",
|
|
17806
|
+
itemCount === 1 ? "item" : "items"
|
|
17807
|
+
] })
|
|
17808
|
+
] })
|
|
17809
|
+
]
|
|
17810
|
+
}
|
|
17811
|
+
),
|
|
17812
|
+
isExpanded && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
17813
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pl-2 ml-4 border-l border-gray-200 dark:border-gray-800", children: isArray ? items.map((item, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "my-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
17814
|
+
JsonNode,
|
|
17815
|
+
{
|
|
17816
|
+
data: item,
|
|
17817
|
+
name: `${index2}`,
|
|
17818
|
+
depth: depth + 1,
|
|
17819
|
+
initialExpandDepth
|
|
17820
|
+
}
|
|
17821
|
+
) }, index2)) : items.map(([key, value]) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "my-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
17822
|
+
JsonNode,
|
|
17823
|
+
{
|
|
17824
|
+
data: value,
|
|
17825
|
+
name: key,
|
|
17826
|
+
depth: depth + 1,
|
|
17827
|
+
initialExpandDepth
|
|
17828
|
+
}
|
|
17829
|
+
) }, key)) }),
|
|
17830
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-gray-600 dark:text-gray-400", children: symbolMap.close })
|
|
17831
|
+
] })
|
|
17832
|
+
] });
|
|
17833
|
+
};
|
|
17834
|
+
const renderString = (value) => {
|
|
17835
|
+
const maxLength = 100;
|
|
17836
|
+
const isTooLong = value.length > maxLength;
|
|
17837
|
+
if (!isTooLong) {
|
|
17838
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex mr-1 rounded hover:bg-gray-800/20", children: [
|
|
17839
|
+
name2 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400", children: [
|
|
17840
|
+
name2,
|
|
17841
|
+
":"
|
|
17842
|
+
] }),
|
|
17843
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("pre", { className: typeStyleMap.string, children: [
|
|
17844
|
+
'"',
|
|
17845
|
+
value,
|
|
17846
|
+
'"'
|
|
17847
|
+
] })
|
|
17848
|
+
] });
|
|
17849
|
+
}
|
|
17850
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex mr-1 rounded group hover:bg-gray-800/20", children: [
|
|
17851
|
+
name2 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400 dark:group-hover:text-gray-100 group-hover:text-gray-400", children: [
|
|
17852
|
+
name2,
|
|
17853
|
+
":"
|
|
17854
|
+
] }),
|
|
17855
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
17856
|
+
"pre",
|
|
17857
|
+
{
|
|
17858
|
+
className: clsx(
|
|
17859
|
+
typeStyleMap.string,
|
|
17860
|
+
"cursor-pointer group-hover:text-green-500"
|
|
17861
|
+
),
|
|
17862
|
+
onClick: () => setIsExpanded(!isExpanded),
|
|
17863
|
+
title: isExpanded ? "Click to collapse" : "Click to expand",
|
|
17864
|
+
children: isExpanded ? `"${value}"` : `"${value.slice(0, maxLength)}..."`
|
|
17865
|
+
}
|
|
17866
|
+
)
|
|
17867
|
+
] });
|
|
17868
|
+
};
|
|
17869
|
+
switch (dataType) {
|
|
17870
|
+
case "object":
|
|
17871
|
+
case "array":
|
|
17872
|
+
return renderCollapsible(dataType === "array");
|
|
17873
|
+
case "string":
|
|
17874
|
+
return renderString(data);
|
|
17875
|
+
default:
|
|
17876
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center mr-1 rounded hover:bg-gray-800/20", children: [
|
|
17877
|
+
name2 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400", children: [
|
|
17878
|
+
name2,
|
|
17879
|
+
":"
|
|
17880
|
+
] }),
|
|
17881
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: typeStyleMap[dataType] || typeStyleMap.default, children: data === null ? "null" : String(data) })
|
|
17882
|
+
] });
|
|
17883
|
+
}
|
|
17884
|
+
}
|
|
17885
|
+
);
|
|
17886
|
+
JsonNode.displayName = "JsonNode";
|
|
17661
17887
|
const HistoryAndNotifications = ({
|
|
17662
17888
|
requestHistory,
|
|
17663
17889
|
serverNotifications
|
|
@@ -17710,7 +17936,7 @@ const HistoryAndNotifications = ({
|
|
|
17710
17936
|
}
|
|
17711
17937
|
)
|
|
17712
17938
|
] }),
|
|
17713
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("
|
|
17939
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-background p-2 rounded", children: /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: request.request }) })
|
|
17714
17940
|
] }),
|
|
17715
17941
|
request.response && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2", children: [
|
|
17716
17942
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center mb-1", children: [
|
|
@@ -17724,11 +17950,7 @@ const HistoryAndNotifications = ({
|
|
|
17724
17950
|
}
|
|
17725
17951
|
)
|
|
17726
17952
|
] }),
|
|
17727
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("
|
|
17728
|
-
JSON.parse(request.response),
|
|
17729
|
-
null,
|
|
17730
|
-
2
|
|
17731
|
-
) })
|
|
17953
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-background p-2 rounded", children: /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: request.response }) })
|
|
17732
17954
|
] })
|
|
17733
17955
|
] })
|
|
17734
17956
|
]
|
|
@@ -17771,7 +17993,12 @@ const HistoryAndNotifications = ({
|
|
|
17771
17993
|
}
|
|
17772
17994
|
)
|
|
17773
17995
|
] }),
|
|
17774
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("
|
|
17996
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-background p-2 rounded", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
17997
|
+
JsonView,
|
|
17998
|
+
{
|
|
17999
|
+
data: JSON.stringify(notification, null, 2)
|
|
18000
|
+
}
|
|
18001
|
+
) })
|
|
17775
18002
|
] })
|
|
17776
18003
|
]
|
|
17777
18004
|
},
|
|
@@ -22556,22 +22783,6 @@ const Label$1 = reactExports.forwardRef(({ className: className2, ...props }, re
|
|
|
22556
22783
|
}
|
|
22557
22784
|
));
|
|
22558
22785
|
Label$1.displayName = Root$1.displayName;
|
|
22559
|
-
const Textarea = reactExports.forwardRef(
|
|
22560
|
-
({ className: className2, ...props }, ref) => {
|
|
22561
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
22562
|
-
"textarea",
|
|
22563
|
-
{
|
|
22564
|
-
className: cn(
|
|
22565
|
-
"flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
22566
|
-
className2
|
|
22567
|
-
),
|
|
22568
|
-
ref,
|
|
22569
|
-
...props
|
|
22570
|
-
}
|
|
22571
|
-
);
|
|
22572
|
-
}
|
|
22573
|
-
);
|
|
22574
|
-
Textarea.displayName = "Textarea";
|
|
22575
22786
|
const ListPane = ({
|
|
22576
22787
|
items,
|
|
22577
22788
|
listItems,
|
|
@@ -22784,14 +22995,7 @@ const PromptsTab = ({
|
|
|
22784
22995
|
] })
|
|
22785
22996
|
] }, arg.name)),
|
|
22786
22997
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onClick: handleGetPrompt, className: "w-full", children: "Get Prompt" }),
|
|
22787
|
-
promptContent && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
22788
|
-
Textarea,
|
|
22789
|
-
{
|
|
22790
|
-
value: promptContent,
|
|
22791
|
-
readOnly: true,
|
|
22792
|
-
className: "h-64 font-mono"
|
|
22793
|
-
}
|
|
22794
|
-
)
|
|
22998
|
+
promptContent && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border rounded", children: /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: promptContent }) })
|
|
22795
22999
|
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { children: "Select a prompt from the list to view and use it" }) }) })
|
|
22796
23000
|
] })
|
|
22797
23001
|
] });
|
|
@@ -22943,7 +23147,7 @@ const ResourcesTab = ({
|
|
|
22943
23147
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { className: "h-4 w-4" }),
|
|
22944
23148
|
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertTitle, { children: "Error" }),
|
|
22945
23149
|
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { children: error })
|
|
22946
|
-
] }) : selectedResource ? /* @__PURE__ */ jsxRuntimeExports.jsx("
|
|
23150
|
+
] }) : selectedResource ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-gray-50 dark:bg-gray-800 p-4 rounded text-sm overflow-auto max-h-96 text-gray-900 dark:text-gray-100", children: /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: resourceContent }) }) : selectedTemplate ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
|
|
22947
23151
|
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: selectedTemplate.description }),
|
|
22948
23152
|
(_a = selectedTemplate.uriTemplate.match(/{([^}]+)}/g)) == null ? void 0 : _a.map((param) => {
|
|
22949
23153
|
const key = param.slice(1, -1);
|
|
@@ -23063,7 +23267,7 @@ const SamplingTab = ({ pendingRequests, onApprove, onReject }) => {
|
|
|
23063
23267
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4 space-y-4", children: [
|
|
23064
23268
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold", children: "Recent Requests" }),
|
|
23065
23269
|
pendingRequests.map((request) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4 border rounded-lg space-y-4", children: [
|
|
23066
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("
|
|
23270
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-gray-50 dark:bg-gray-800 dark:text-gray-100 p-2 rounded", children: /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: JSON.stringify(request.request) }) }),
|
|
23067
23271
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex space-x-2", children: [
|
|
23068
23272
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onClick: () => handleApprove(request.id), children: "Approve" }),
|
|
23069
23273
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "outline", onClick: () => onReject(request.id), children: "Reject" })
|
|
@@ -24375,18 +24579,16 @@ const useTheme = () => {
|
|
|
24375
24579
|
darkModeMediaQuery.removeEventListener("change", handleDarkModeChange);
|
|
24376
24580
|
};
|
|
24377
24581
|
}, [theme]);
|
|
24378
|
-
|
|
24379
|
-
|
|
24380
|
-
|
|
24381
|
-
|
|
24382
|
-
|
|
24383
|
-
|
|
24384
|
-
|
|
24385
|
-
|
|
24386
|
-
}, [])
|
|
24387
|
-
];
|
|
24582
|
+
const setThemeWithSideEffect = reactExports.useCallback((newTheme) => {
|
|
24583
|
+
setTheme(newTheme);
|
|
24584
|
+
localStorage.setItem("theme", newTheme);
|
|
24585
|
+
if (newTheme !== "system") {
|
|
24586
|
+
document.documentElement.classList.toggle("dark", newTheme === "dark");
|
|
24587
|
+
}
|
|
24588
|
+
}, []);
|
|
24589
|
+
return reactExports.useMemo(() => [theme, setThemeWithSideEffect], [theme]);
|
|
24388
24590
|
};
|
|
24389
|
-
const version = "0.
|
|
24591
|
+
const version = "0.8.0";
|
|
24390
24592
|
const Sidebar = ({
|
|
24391
24593
|
connectionStatus,
|
|
24392
24594
|
transportType,
|
|
@@ -24402,14 +24604,18 @@ const Sidebar = ({
|
|
|
24402
24604
|
bearerToken,
|
|
24403
24605
|
setBearerToken,
|
|
24404
24606
|
onConnect,
|
|
24607
|
+
onDisconnect,
|
|
24405
24608
|
stdErrNotifications,
|
|
24406
24609
|
logLevel,
|
|
24407
24610
|
sendLogLevelRequest,
|
|
24408
|
-
loggingSupported
|
|
24611
|
+
loggingSupported,
|
|
24612
|
+
config,
|
|
24613
|
+
setConfig
|
|
24409
24614
|
}) => {
|
|
24410
24615
|
const [theme, setTheme] = useTheme();
|
|
24411
24616
|
const [showEnvVars, setShowEnvVars] = reactExports.useState(false);
|
|
24412
24617
|
const [showBearerToken, setShowBearerToken] = reactExports.useState(false);
|
|
24618
|
+
const [showConfig, setShowConfig] = reactExports.useState(false);
|
|
24413
24619
|
const [shownEnvVars, setShownEnvVars] = reactExports.useState(/* @__PURE__ */ new Set());
|
|
24414
24620
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-80 bg-card border-r border-border flex flex-col h-full", children: [
|
|
24415
24621
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-between p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("h1", { className: "ml-2 text-lg font-semibold", children: [
|
|
@@ -24618,7 +24824,91 @@ const Sidebar = ({
|
|
|
24618
24824
|
] })
|
|
24619
24825
|
] }),
|
|
24620
24826
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
|
|
24621
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
24827
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
24828
|
+
Button,
|
|
24829
|
+
{
|
|
24830
|
+
variant: "outline",
|
|
24831
|
+
onClick: () => setShowConfig(!showConfig),
|
|
24832
|
+
className: "flex items-center w-full",
|
|
24833
|
+
children: [
|
|
24834
|
+
showConfig ? /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4 mr-2" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "w-4 h-4 mr-2" }),
|
|
24835
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Settings, { className: "w-4 h-4 mr-2" }),
|
|
24836
|
+
"Configuration"
|
|
24837
|
+
]
|
|
24838
|
+
}
|
|
24839
|
+
),
|
|
24840
|
+
showConfig && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2", children: Object.entries(config).map(([key, configItem]) => {
|
|
24841
|
+
const configKey = key;
|
|
24842
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
|
|
24843
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium", children: configItem.description }),
|
|
24844
|
+
typeof configItem.value === "number" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24845
|
+
Input,
|
|
24846
|
+
{
|
|
24847
|
+
type: "number",
|
|
24848
|
+
"data-testid": `${configKey}-input`,
|
|
24849
|
+
value: configItem.value,
|
|
24850
|
+
onChange: (e) => {
|
|
24851
|
+
const newConfig = { ...config };
|
|
24852
|
+
newConfig[configKey] = {
|
|
24853
|
+
...configItem,
|
|
24854
|
+
value: Number(e.target.value)
|
|
24855
|
+
};
|
|
24856
|
+
setConfig(newConfig);
|
|
24857
|
+
},
|
|
24858
|
+
className: "font-mono"
|
|
24859
|
+
}
|
|
24860
|
+
) : typeof configItem.value === "boolean" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
24861
|
+
Select,
|
|
24862
|
+
{
|
|
24863
|
+
"data-testid": `${configKey}-select`,
|
|
24864
|
+
value: configItem.value.toString(),
|
|
24865
|
+
onValueChange: (val) => {
|
|
24866
|
+
const newConfig = { ...config };
|
|
24867
|
+
newConfig[configKey] = {
|
|
24868
|
+
...configItem,
|
|
24869
|
+
value: val === "true"
|
|
24870
|
+
};
|
|
24871
|
+
setConfig(newConfig);
|
|
24872
|
+
},
|
|
24873
|
+
children: [
|
|
24874
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, {}) }),
|
|
24875
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
|
|
24876
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "true", children: "True" }),
|
|
24877
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "false", children: "False" })
|
|
24878
|
+
] })
|
|
24879
|
+
]
|
|
24880
|
+
}
|
|
24881
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24882
|
+
Input,
|
|
24883
|
+
{
|
|
24884
|
+
"data-testid": `${configKey}-input`,
|
|
24885
|
+
value: configItem.value,
|
|
24886
|
+
onChange: (e) => {
|
|
24887
|
+
const newConfig = { ...config };
|
|
24888
|
+
newConfig[configKey] = {
|
|
24889
|
+
...configItem,
|
|
24890
|
+
value: e.target.value
|
|
24891
|
+
};
|
|
24892
|
+
setConfig(newConfig);
|
|
24893
|
+
},
|
|
24894
|
+
className: "font-mono"
|
|
24895
|
+
}
|
|
24896
|
+
)
|
|
24897
|
+
] }, key);
|
|
24898
|
+
}) })
|
|
24899
|
+
] }),
|
|
24900
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
|
|
24901
|
+
connectionStatus === "connected" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
24902
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { onClick: onConnect, children: [
|
|
24903
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(RotateCcw, { className: "w-4 h-4 mr-2" }),
|
|
24904
|
+
transportType === "stdio" ? "Restart" : "Reconnect"
|
|
24905
|
+
] }),
|
|
24906
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { onClick: onDisconnect, children: [
|
|
24907
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(RefreshCwOff, { className: "w-4 h-4 mr-2" }),
|
|
24908
|
+
"Disconnect"
|
|
24909
|
+
] })
|
|
24910
|
+
] }),
|
|
24911
|
+
connectionStatus !== "connected" && /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { className: "w-full", onClick: onConnect, children: [
|
|
24622
24912
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Play, { className: "w-4 h-4 mr-2" }),
|
|
24623
24913
|
"Connect"
|
|
24624
24914
|
] }),
|
|
@@ -24675,36 +24965,37 @@ const Sidebar = ({
|
|
|
24675
24965
|
}
|
|
24676
24966
|
),
|
|
24677
24967
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
24678
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24968
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "ghost", title: "Inspector Documentation", asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24679
24969
|
"a",
|
|
24680
24970
|
{
|
|
24681
24971
|
href: "https://modelcontextprotocol.io/docs/tools/inspector",
|
|
24682
24972
|
target: "_blank",
|
|
24683
24973
|
rel: "noopener noreferrer",
|
|
24684
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24974
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(CircleHelp, { className: "w-4 h-4 text-foreground" })
|
|
24685
24975
|
}
|
|
24686
|
-
),
|
|
24687
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24976
|
+
) }),
|
|
24977
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "ghost", title: "Debugging Guide", asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24688
24978
|
"a",
|
|
24689
24979
|
{
|
|
24690
24980
|
href: "https://modelcontextprotocol.io/docs/tools/debugging",
|
|
24691
24981
|
target: "_blank",
|
|
24692
24982
|
rel: "noopener noreferrer",
|
|
24693
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24983
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Bug, { className: "w-4 h-4 text-foreground" })
|
|
24694
24984
|
}
|
|
24695
|
-
),
|
|
24985
|
+
) }),
|
|
24696
24986
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24697
|
-
|
|
24987
|
+
Button,
|
|
24698
24988
|
{
|
|
24699
|
-
|
|
24700
|
-
|
|
24701
|
-
|
|
24989
|
+
variant: "ghost",
|
|
24990
|
+
title: "Report bugs or contribute on GitHub",
|
|
24991
|
+
asChild: true,
|
|
24702
24992
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24703
|
-
|
|
24993
|
+
"a",
|
|
24704
24994
|
{
|
|
24705
|
-
|
|
24706
|
-
|
|
24707
|
-
|
|
24995
|
+
href: "https://github.com/modelcontextprotocol/inspector",
|
|
24996
|
+
target: "_blank",
|
|
24997
|
+
rel: "noopener noreferrer",
|
|
24998
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Github, { className: "w-4 h-4 text-foreground" })
|
|
24708
24999
|
}
|
|
24709
25000
|
)
|
|
24710
25001
|
}
|
|
@@ -24876,6 +25167,22 @@ const Checkbox = reactExports.forwardRef(({ className: className2, ...props }, r
|
|
|
24876
25167
|
}
|
|
24877
25168
|
));
|
|
24878
25169
|
Checkbox.displayName = Root.displayName;
|
|
25170
|
+
const Textarea = reactExports.forwardRef(
|
|
25171
|
+
({ className: className2, ...props }, ref) => {
|
|
25172
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
25173
|
+
"textarea",
|
|
25174
|
+
{
|
|
25175
|
+
className: cn(
|
|
25176
|
+
"flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
25177
|
+
className2
|
|
25178
|
+
),
|
|
25179
|
+
ref,
|
|
25180
|
+
...props
|
|
25181
|
+
}
|
|
25182
|
+
);
|
|
25183
|
+
}
|
|
25184
|
+
);
|
|
25185
|
+
Textarea.displayName = "Textarea";
|
|
24879
25186
|
var lib = {};
|
|
24880
25187
|
var __assign = commonjsGlobal && commonjsGlobal.__assign || function() {
|
|
24881
25188
|
__assign = Object.assign || function(t2) {
|
|
@@ -26756,38 +27063,20 @@ const JsonEditor = ({
|
|
|
26756
27063
|
onChange,
|
|
26757
27064
|
error: externalError
|
|
26758
27065
|
}) => {
|
|
26759
|
-
const [editorContent, setEditorContent] = reactExports.useState(value);
|
|
27066
|
+
const [editorContent, setEditorContent] = reactExports.useState(value || "");
|
|
26760
27067
|
const [internalError, setInternalError] = reactExports.useState(
|
|
26761
27068
|
void 0
|
|
26762
27069
|
);
|
|
26763
27070
|
reactExports.useEffect(() => {
|
|
26764
|
-
setEditorContent(value);
|
|
27071
|
+
setEditorContent(value || "");
|
|
26765
27072
|
}, [value]);
|
|
26766
|
-
const formatJson = (json) => {
|
|
26767
|
-
try {
|
|
26768
|
-
return JSON.stringify(JSON.parse(json), null, 2);
|
|
26769
|
-
} catch {
|
|
26770
|
-
return json;
|
|
26771
|
-
}
|
|
26772
|
-
};
|
|
26773
27073
|
const handleEditorChange = (newContent) => {
|
|
26774
27074
|
setEditorContent(newContent);
|
|
26775
27075
|
setInternalError(void 0);
|
|
26776
27076
|
onChange(newContent);
|
|
26777
27077
|
};
|
|
26778
|
-
const handleFormatJson = () => {
|
|
26779
|
-
try {
|
|
26780
|
-
const formatted = formatJson(editorContent);
|
|
26781
|
-
setEditorContent(formatted);
|
|
26782
|
-
onChange(formatted);
|
|
26783
|
-
setInternalError(void 0);
|
|
26784
|
-
} catch (err) {
|
|
26785
|
-
setInternalError(err instanceof Error ? err.message : "Invalid JSON");
|
|
26786
|
-
}
|
|
26787
|
-
};
|
|
26788
27078
|
const displayError = internalError || externalError;
|
|
26789
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative
|
|
26790
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "outline", size: "sm", onClick: handleFormatJson, children: "Format JSON" }) }),
|
|
27079
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
|
|
26791
27080
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
26792
27081
|
"div",
|
|
26793
27082
|
{
|
|
@@ -26966,6 +27255,20 @@ const DynamicJsonForm = ({
|
|
|
26966
27255
|
setIsJsonMode(true);
|
|
26967
27256
|
}
|
|
26968
27257
|
};
|
|
27258
|
+
const formatJson = () => {
|
|
27259
|
+
try {
|
|
27260
|
+
const jsonStr = rawJsonValue.trim();
|
|
27261
|
+
if (!jsonStr) {
|
|
27262
|
+
return;
|
|
27263
|
+
}
|
|
27264
|
+
const formatted = JSON.stringify(JSON.parse(jsonStr), null, 2);
|
|
27265
|
+
setRawJsonValue(formatted);
|
|
27266
|
+
debouncedUpdateParent(formatted);
|
|
27267
|
+
setJsonError(void 0);
|
|
27268
|
+
} catch (err) {
|
|
27269
|
+
setJsonError(err instanceof Error ? err.message : "Invalid JSON");
|
|
27270
|
+
}
|
|
27271
|
+
};
|
|
26969
27272
|
const renderFormFields = (propSchema, currentValue, path = [], depth = 0) => {
|
|
26970
27273
|
var _a, _b;
|
|
26971
27274
|
if (depth >= maxDepth && (propSchema.type === "object" || propSchema.type === "array")) {
|
|
@@ -27166,7 +27469,10 @@ const DynamicJsonForm = ({
|
|
|
27166
27469
|
}
|
|
27167
27470
|
}, [shouldUseJsonMode, isJsonMode]);
|
|
27168
27471
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
|
|
27169
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
27472
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-end space-x-2", children: [
|
|
27473
|
+
isJsonMode && /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "outline", size: "sm", onClick: formatJson, children: "Format JSON" }),
|
|
27474
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "outline", size: "sm", onClick: handleSwitchToFormMode, children: isJsonMode ? "Switch to Form" : "Switch to JSON" })
|
|
27475
|
+
] }),
|
|
27170
27476
|
isJsonMode ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
27171
27477
|
JsonEditor,
|
|
27172
27478
|
{
|
|
@@ -27188,20 +27494,6 @@ const DynamicJsonForm = ({
|
|
|
27188
27494
|
)
|
|
27189
27495
|
] });
|
|
27190
27496
|
};
|
|
27191
|
-
function escapeUnicode(obj) {
|
|
27192
|
-
return JSON.stringify(
|
|
27193
|
-
obj,
|
|
27194
|
-
(_key, value) => {
|
|
27195
|
-
if (typeof value === "string") {
|
|
27196
|
-
return value.replace(/[^\0-\x7F]/g, (char) => {
|
|
27197
|
-
return "\\u" + ("0000" + char.charCodeAt(0).toString(16)).slice(-4);
|
|
27198
|
-
});
|
|
27199
|
-
}
|
|
27200
|
-
return value;
|
|
27201
|
-
},
|
|
27202
|
-
2
|
|
27203
|
-
);
|
|
27204
|
-
}
|
|
27205
27497
|
const ToolsTab = ({
|
|
27206
27498
|
tools,
|
|
27207
27499
|
listTools,
|
|
@@ -27210,8 +27502,7 @@ const ToolsTab = ({
|
|
|
27210
27502
|
selectedTool,
|
|
27211
27503
|
setSelectedTool,
|
|
27212
27504
|
toolResult,
|
|
27213
|
-
nextCursor
|
|
27214
|
-
error
|
|
27505
|
+
nextCursor
|
|
27215
27506
|
}) => {
|
|
27216
27507
|
const [params2, setParams] = reactExports.useState({});
|
|
27217
27508
|
reactExports.useEffect(() => {
|
|
@@ -27224,16 +27515,9 @@ const ToolsTab = ({
|
|
|
27224
27515
|
if (!parsedResult.success) {
|
|
27225
27516
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
27226
27517
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "font-semibold mb-2", children: "Invalid Tool Result:" }),
|
|
27227
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("
|
|
27518
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border rounded", children: /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: toolResult }) }),
|
|
27228
27519
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "font-semibold mb-2", children: "Errors:" }),
|
|
27229
|
-
parsedResult.error.errors.map((
|
|
27230
|
-
"pre",
|
|
27231
|
-
{
|
|
27232
|
-
className: "bg-gray-50 dark:bg-gray-800 dark:text-gray-100 p-4 rounded text-sm overflow-auto max-h-64",
|
|
27233
|
-
children: escapeUnicode(error2)
|
|
27234
|
-
},
|
|
27235
|
-
idx
|
|
27236
|
-
))
|
|
27520
|
+
parsedResult.error.errors.map((error, idx) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border rounded", children: /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: error }) }, idx))
|
|
27237
27521
|
] });
|
|
27238
27522
|
}
|
|
27239
27523
|
const structuredResult = parsedResult.data;
|
|
@@ -27246,7 +27530,7 @@ const ToolsTab = ({
|
|
|
27246
27530
|
structuredResult.content.map((item, index2) => {
|
|
27247
27531
|
var _a, _b;
|
|
27248
27532
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-2", children: [
|
|
27249
|
-
item.type === "text" && /* @__PURE__ */ jsxRuntimeExports.jsx("
|
|
27533
|
+
item.type === "text" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border rounded", children: /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: item.text }) }),
|
|
27250
27534
|
item.type === "image" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
27251
27535
|
"img",
|
|
27252
27536
|
{
|
|
@@ -27263,14 +27547,14 @@ const ToolsTab = ({
|
|
|
27263
27547
|
className: "w-full",
|
|
27264
27548
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "Your browser does not support audio playback" })
|
|
27265
27549
|
}
|
|
27266
|
-
) : /* @__PURE__ */ jsxRuntimeExports.jsx("
|
|
27550
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border rounded", children: /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: item.resource }) }))
|
|
27267
27551
|
] }, index2);
|
|
27268
27552
|
})
|
|
27269
27553
|
] });
|
|
27270
27554
|
} else if ("toolResult" in toolResult) {
|
|
27271
27555
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
27272
27556
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "font-semibold mb-2", children: "Tool Result (Legacy):" }),
|
|
27273
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("
|
|
27557
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border rounded", children: /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: toolResult.toolResult }) })
|
|
27274
27558
|
] });
|
|
27275
27559
|
}
|
|
27276
27560
|
};
|
|
@@ -27296,11 +27580,7 @@ const ToolsTab = ({
|
|
|
27296
27580
|
),
|
|
27297
27581
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-card rounded-lg shadow", children: [
|
|
27298
27582
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold", children: selectedTool ? selectedTool.name : "Select a tool" }) }),
|
|
27299
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4", children:
|
|
27300
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { className: "h-4 w-4" }),
|
|
27301
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertTitle, { children: "Error" }),
|
|
27302
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { children: error })
|
|
27303
|
-
] }) : selectedTool ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
|
|
27583
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4", children: selectedTool ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
|
|
27304
27584
|
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: selectedTool.description }),
|
|
27305
27585
|
Object.entries(selectedTool.inputSchema.properties ?? []).map(
|
|
27306
27586
|
([key, value]) => {
|
|
@@ -27368,14 +27648,14 @@ const ToolsTab = ({
|
|
|
27368
27648
|
) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
27369
27649
|
Input,
|
|
27370
27650
|
{
|
|
27371
|
-
type: prop.type === "number" ? "number" : "text",
|
|
27651
|
+
type: prop.type === "number" || prop.type === "integer" ? "number" : "text",
|
|
27372
27652
|
id: key,
|
|
27373
27653
|
name: key,
|
|
27374
27654
|
placeholder: prop.description,
|
|
27375
27655
|
value: params2[key] ?? "",
|
|
27376
27656
|
onChange: (e) => setParams({
|
|
27377
27657
|
...params2,
|
|
27378
|
-
[key]: prop.type === "number" ? Number(e.target.value) : e.target.value
|
|
27658
|
+
[key]: prop.type === "number" || prop.type === "integer" ? Number(e.target.value) : e.target.value
|
|
27379
27659
|
}),
|
|
27380
27660
|
className: "mt-1"
|
|
27381
27661
|
}
|
|
@@ -27393,16 +27673,11 @@ const ToolsTab = ({
|
|
|
27393
27673
|
] });
|
|
27394
27674
|
};
|
|
27395
27675
|
const params = new URLSearchParams(window.location.search);
|
|
27396
|
-
const PROXY_PORT = params.get("proxyPort") ?? "
|
|
27676
|
+
const PROXY_PORT = params.get("proxyPort") ?? "6277";
|
|
27397
27677
|
const PROXY_SERVER_URL = `http://${window.location.hostname}:${PROXY_PORT}`;
|
|
27678
|
+
const CONFIG_LOCAL_STORAGE_KEY = "inspectorConfig_v1";
|
|
27398
27679
|
const App = () => {
|
|
27399
27680
|
var _a;
|
|
27400
|
-
if (window.location.pathname === "/oauth/callback") {
|
|
27401
|
-
const OAuthCallback = React$1.lazy(
|
|
27402
|
-
() => __vitePreload(() => import("./OAuthCallback-C5xCfXlk.js"), true ? [] : void 0)
|
|
27403
|
-
);
|
|
27404
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthCallback, {}) });
|
|
27405
|
-
}
|
|
27406
27681
|
const [resources, setResources] = reactExports.useState([]);
|
|
27407
27682
|
const [resourceTemplates, setResourceTemplates] = reactExports.useState([]);
|
|
27408
27683
|
const [resourceContent, setResourceContent] = reactExports.useState("");
|
|
@@ -27432,26 +27707,16 @@ const App = () => {
|
|
|
27432
27707
|
const [stdErrNotifications, setStdErrNotifications] = reactExports.useState([]);
|
|
27433
27708
|
const [roots, setRoots] = reactExports.useState([]);
|
|
27434
27709
|
const [env, setEnv] = reactExports.useState({});
|
|
27710
|
+
const [config, setConfig] = reactExports.useState(() => {
|
|
27711
|
+
const savedConfig = localStorage.getItem(CONFIG_LOCAL_STORAGE_KEY);
|
|
27712
|
+
return savedConfig ? JSON.parse(savedConfig) : DEFAULT_INSPECTOR_CONFIG;
|
|
27713
|
+
});
|
|
27435
27714
|
const [bearerToken, setBearerToken] = reactExports.useState(() => {
|
|
27436
27715
|
return localStorage.getItem("lastBearerToken") || "";
|
|
27437
27716
|
});
|
|
27438
27717
|
const [pendingSampleRequests, setPendingSampleRequests] = reactExports.useState([]);
|
|
27439
27718
|
const nextRequestId = reactExports.useRef(0);
|
|
27440
27719
|
const rootsRef = reactExports.useRef([]);
|
|
27441
|
-
const handleApproveSampling = (id2, result) => {
|
|
27442
|
-
setPendingSampleRequests((prev) => {
|
|
27443
|
-
const request = prev.find((r2) => r2.id === id2);
|
|
27444
|
-
request == null ? void 0 : request.resolve(result);
|
|
27445
|
-
return prev.filter((r2) => r2.id !== id2);
|
|
27446
|
-
});
|
|
27447
|
-
};
|
|
27448
|
-
const handleRejectSampling = (id2) => {
|
|
27449
|
-
setPendingSampleRequests((prev) => {
|
|
27450
|
-
const request = prev.find((r2) => r2.id === id2);
|
|
27451
|
-
request == null ? void 0 : request.reject(new Error("Sampling request rejected"));
|
|
27452
|
-
return prev.filter((r2) => r2.id !== id2);
|
|
27453
|
-
});
|
|
27454
|
-
};
|
|
27455
27720
|
const [selectedResource, setSelectedResource] = reactExports.useState(
|
|
27456
27721
|
null
|
|
27457
27722
|
);
|
|
@@ -27473,7 +27738,8 @@ const App = () => {
|
|
|
27473
27738
|
sendNotification,
|
|
27474
27739
|
handleCompletion,
|
|
27475
27740
|
completionsSupported,
|
|
27476
|
-
connect: connectMcpServer
|
|
27741
|
+
connect: connectMcpServer,
|
|
27742
|
+
disconnect: disconnectMcpServer
|
|
27477
27743
|
} = useConnection({
|
|
27478
27744
|
transportType,
|
|
27479
27745
|
command,
|
|
@@ -27482,6 +27748,7 @@ const App = () => {
|
|
|
27482
27748
|
env,
|
|
27483
27749
|
bearerToken,
|
|
27484
27750
|
proxyServerUrl: PROXY_SERVER_URL,
|
|
27751
|
+
requestTimeout: config.MCP_SERVER_REQUEST_TIMEOUT.value,
|
|
27485
27752
|
onNotification: (notification) => {
|
|
27486
27753
|
setNotifications((prev) => [...prev, notification]);
|
|
27487
27754
|
},
|
|
@@ -27514,6 +27781,9 @@ const App = () => {
|
|
|
27514
27781
|
reactExports.useEffect(() => {
|
|
27515
27782
|
localStorage.setItem("lastBearerToken", bearerToken);
|
|
27516
27783
|
}, [bearerToken]);
|
|
27784
|
+
reactExports.useEffect(() => {
|
|
27785
|
+
localStorage.setItem(CONFIG_LOCAL_STORAGE_KEY, JSON.stringify(config));
|
|
27786
|
+
}, [config]);
|
|
27517
27787
|
reactExports.useEffect(() => {
|
|
27518
27788
|
const serverUrl = params.get("serverUrl");
|
|
27519
27789
|
if (serverUrl) {
|
|
@@ -27525,7 +27795,7 @@ const App = () => {
|
|
|
27525
27795
|
B$2.success("Successfully authenticated with OAuth");
|
|
27526
27796
|
connectMcpServer();
|
|
27527
27797
|
}
|
|
27528
|
-
}, []);
|
|
27798
|
+
}, [connectMcpServer]);
|
|
27529
27799
|
reactExports.useEffect(() => {
|
|
27530
27800
|
fetch(`${PROXY_SERVER_URL}/config`).then((response) => response.json()).then((data) => {
|
|
27531
27801
|
setEnv(data.defaultEnvironment);
|
|
@@ -27547,6 +27817,20 @@ const App = () => {
|
|
|
27547
27817
|
window.location.hash = "resources";
|
|
27548
27818
|
}
|
|
27549
27819
|
}, []);
|
|
27820
|
+
const handleApproveSampling = (id2, result) => {
|
|
27821
|
+
setPendingSampleRequests((prev) => {
|
|
27822
|
+
const request = prev.find((r2) => r2.id === id2);
|
|
27823
|
+
request == null ? void 0 : request.resolve(result);
|
|
27824
|
+
return prev.filter((r2) => r2.id !== id2);
|
|
27825
|
+
});
|
|
27826
|
+
};
|
|
27827
|
+
const handleRejectSampling = (id2) => {
|
|
27828
|
+
setPendingSampleRequests((prev) => {
|
|
27829
|
+
const request = prev.find((r2) => r2.id === id2);
|
|
27830
|
+
request == null ? void 0 : request.reject(new Error("Sampling request rejected"));
|
|
27831
|
+
return prev.filter((r2) => r2.id !== id2);
|
|
27832
|
+
});
|
|
27833
|
+
};
|
|
27550
27834
|
const clearError = (tabKey) => {
|
|
27551
27835
|
setErrors((prev) => ({ ...prev, [tabKey]: null }));
|
|
27552
27836
|
};
|
|
@@ -27700,6 +27984,12 @@ const App = () => {
|
|
|
27700
27984
|
);
|
|
27701
27985
|
setLogLevel(level);
|
|
27702
27986
|
};
|
|
27987
|
+
if (window.location.pathname === "/oauth/callback") {
|
|
27988
|
+
const OAuthCallback = React$1.lazy(
|
|
27989
|
+
() => __vitePreload(() => import("./OAuthCallback-DrQsfqzq.js"), true ? [] : void 0)
|
|
27990
|
+
);
|
|
27991
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthCallback, {}) });
|
|
27992
|
+
}
|
|
27703
27993
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-screen bg-background", children: [
|
|
27704
27994
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
27705
27995
|
Sidebar,
|
|
@@ -27715,9 +28005,12 @@ const App = () => {
|
|
|
27715
28005
|
setSseUrl,
|
|
27716
28006
|
env,
|
|
27717
28007
|
setEnv,
|
|
28008
|
+
config,
|
|
28009
|
+
setConfig,
|
|
27718
28010
|
bearerToken,
|
|
27719
28011
|
setBearerToken,
|
|
27720
28012
|
onConnect: connectMcpServer,
|
|
28013
|
+
onDisconnect: disconnectMcpServer,
|
|
27721
28014
|
stdErrNotifications,
|
|
27722
28015
|
logLevel,
|
|
27723
28016
|
sendLogLevelRequest,
|