@modelcontextprotocol/inspector 0.8.2 → 0.9.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 +9 -5
- package/client/dist/assets/{OAuthCallback-CsnPYikN.js → OAuthCallback-C3r8TjnW.js} +1 -1
- package/client/dist/assets/{index-Bm3GdP0M.js → index-CgrYmEaq.js} +419 -241
- package/client/dist/assets/{index-CRtFq5fi.css → index-D5WIP3OH.css} +18 -5
- package/client/dist/index.html +2 -2
- package/package.json +3 -3
|
@@ -7261,43 +7261,60 @@ function composeContextScopes(...scopes) {
|
|
|
7261
7261
|
createScope.scopeName = baseScope.scopeName;
|
|
7262
7262
|
return createScope;
|
|
7263
7263
|
}
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
const
|
|
7267
|
-
const
|
|
7268
|
-
|
|
7269
|
-
const
|
|
7270
|
-
const
|
|
7271
|
-
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
});
|
|
7282
|
-
|
|
7283
|
-
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
7292
|
-
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
|
|
7296
|
-
|
|
7297
|
-
|
|
7298
|
-
}
|
|
7264
|
+
// @__NO_SIDE_EFFECTS__
|
|
7265
|
+
function createSlot(ownerName) {
|
|
7266
|
+
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
7267
|
+
const Slot2 = reactExports.forwardRef((props, forwardedRef) => {
|
|
7268
|
+
const { children, ...slotProps } = props;
|
|
7269
|
+
const childrenArray = reactExports.Children.toArray(children);
|
|
7270
|
+
const slottable = childrenArray.find(isSlottable);
|
|
7271
|
+
if (slottable) {
|
|
7272
|
+
const newElement = slottable.props.children;
|
|
7273
|
+
const newChildren = childrenArray.map((child) => {
|
|
7274
|
+
if (child === slottable) {
|
|
7275
|
+
if (reactExports.Children.count(newElement) > 1) return reactExports.Children.only(null);
|
|
7276
|
+
return reactExports.isValidElement(newElement) ? newElement.props.children : null;
|
|
7277
|
+
} else {
|
|
7278
|
+
return child;
|
|
7279
|
+
}
|
|
7280
|
+
});
|
|
7281
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: reactExports.isValidElement(newElement) ? reactExports.cloneElement(newElement, void 0, newChildren) : null });
|
|
7282
|
+
}
|
|
7283
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
7284
|
+
});
|
|
7285
|
+
Slot2.displayName = `${ownerName}.Slot`;
|
|
7286
|
+
return Slot2;
|
|
7287
|
+
}
|
|
7288
|
+
var Slot$3 = /* @__PURE__ */ createSlot("Slot");
|
|
7289
|
+
// @__NO_SIDE_EFFECTS__
|
|
7290
|
+
function createSlotClone(ownerName) {
|
|
7291
|
+
const SlotClone = reactExports.forwardRef((props, forwardedRef) => {
|
|
7292
|
+
const { children, ...slotProps } = props;
|
|
7293
|
+
if (reactExports.isValidElement(children)) {
|
|
7294
|
+
const childrenRef = getElementRef$1(children);
|
|
7295
|
+
const props2 = mergeProps(slotProps, children.props);
|
|
7296
|
+
if (children.type !== reactExports.Fragment) {
|
|
7297
|
+
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
7298
|
+
}
|
|
7299
|
+
return reactExports.cloneElement(children, props2);
|
|
7300
|
+
}
|
|
7301
|
+
return reactExports.Children.count(children) > 1 ? reactExports.Children.only(null) : null;
|
|
7302
|
+
});
|
|
7303
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
7304
|
+
return SlotClone;
|
|
7305
|
+
}
|
|
7306
|
+
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
7307
|
+
// @__NO_SIDE_EFFECTS__
|
|
7308
|
+
function createSlottable(ownerName) {
|
|
7309
|
+
const Slottable2 = ({ children }) => {
|
|
7310
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children });
|
|
7311
|
+
};
|
|
7312
|
+
Slottable2.displayName = `${ownerName}.Slottable`;
|
|
7313
|
+
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
|
7314
|
+
return Slottable2;
|
|
7315
|
+
}
|
|
7299
7316
|
function isSlottable(child) {
|
|
7300
|
-
return reactExports.isValidElement(child) && child.type ===
|
|
7317
|
+
return reactExports.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
7301
7318
|
}
|
|
7302
7319
|
function mergeProps(slotProps, childProps) {
|
|
7303
7320
|
const overrideProps = { ...childProps };
|
|
@@ -7351,17 +7368,19 @@ function createCollection(name) {
|
|
|
7351
7368
|
};
|
|
7352
7369
|
CollectionProvider.displayName = PROVIDER_NAME2;
|
|
7353
7370
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
7371
|
+
const CollectionSlotImpl = /* @__PURE__ */ createSlot(COLLECTION_SLOT_NAME);
|
|
7354
7372
|
const CollectionSlot = React$1.forwardRef(
|
|
7355
7373
|
(props, forwardedRef) => {
|
|
7356
7374
|
const { scope, children } = props;
|
|
7357
7375
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
7358
7376
|
const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
|
|
7359
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7377
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(CollectionSlotImpl, { ref: composedRefs, children });
|
|
7360
7378
|
}
|
|
7361
7379
|
);
|
|
7362
7380
|
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
7363
7381
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
7364
7382
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
7383
|
+
const CollectionItemSlotImpl = /* @__PURE__ */ createSlot(ITEM_SLOT_NAME);
|
|
7365
7384
|
const CollectionItemSlot = React$1.forwardRef(
|
|
7366
7385
|
(props, forwardedRef) => {
|
|
7367
7386
|
const { scope, children, ...itemData } = props;
|
|
@@ -7372,7 +7391,7 @@ function createCollection(name) {
|
|
|
7372
7391
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
7373
7392
|
return () => void context.itemMap.delete(ref);
|
|
7374
7393
|
});
|
|
7375
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7394
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
|
|
7376
7395
|
}
|
|
7377
7396
|
);
|
|
7378
7397
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
@@ -7415,9 +7434,10 @@ var NODES = [
|
|
|
7415
7434
|
"ul"
|
|
7416
7435
|
];
|
|
7417
7436
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
7437
|
+
const Slot2 = /* @__PURE__ */ createSlot(`Primitive.${node}`);
|
|
7418
7438
|
const Node2 = reactExports.forwardRef((props, forwardedRef) => {
|
|
7419
7439
|
const { asChild, ...primitiveProps } = props;
|
|
7420
|
-
const Comp = asChild ?
|
|
7440
|
+
const Comp = asChild ? Slot2 : node;
|
|
7421
7441
|
if (typeof window !== "undefined") {
|
|
7422
7442
|
window[Symbol.for("radix-ui")] = true;
|
|
7423
7443
|
}
|
|
@@ -7654,7 +7674,7 @@ function handleAndDispatchCustomEvent$1(name, handler, detail, { discrete }) {
|
|
|
7654
7674
|
}
|
|
7655
7675
|
var Root$6 = DismissableLayer;
|
|
7656
7676
|
var Branch = DismissableLayerBranch;
|
|
7657
|
-
var useLayoutEffect2 =
|
|
7677
|
+
var useLayoutEffect2 = (globalThis == null ? void 0 : globalThis.document) ? reactExports.useLayoutEffect : () => {
|
|
7658
7678
|
};
|
|
7659
7679
|
var PORTAL_NAME$4 = "Portal";
|
|
7660
7680
|
var Portal$3 = reactExports.forwardRef((props, forwardedRef) => {
|
|
@@ -17387,10 +17407,22 @@ const SESSION_KEYS = {
|
|
|
17387
17407
|
const DEFAULT_MCP_PROXY_LISTEN_PORT = "6277";
|
|
17388
17408
|
const DEFAULT_INSPECTOR_CONFIG = {
|
|
17389
17409
|
MCP_SERVER_REQUEST_TIMEOUT: {
|
|
17410
|
+
label: "Request Timeout",
|
|
17390
17411
|
description: "Timeout for requests to the MCP server (ms)",
|
|
17391
17412
|
value: 1e4
|
|
17392
17413
|
},
|
|
17414
|
+
MCP_REQUEST_TIMEOUT_RESET_ON_PROGRESS: {
|
|
17415
|
+
label: "Reset Timeout on Progress",
|
|
17416
|
+
description: "Reset timeout on progress notifications",
|
|
17417
|
+
value: true
|
|
17418
|
+
},
|
|
17419
|
+
MCP_REQUEST_MAX_TOTAL_TIMEOUT: {
|
|
17420
|
+
label: "Maximum Total Timeout",
|
|
17421
|
+
description: "Maximum total timeout for requests sent to the MCP server (ms) (Use with progress notifications)",
|
|
17422
|
+
value: 6e4
|
|
17423
|
+
},
|
|
17393
17424
|
MCP_PROXY_FULL_ADDRESS: {
|
|
17425
|
+
label: "Inspector Proxy Address",
|
|
17394
17426
|
description: "Set this if you are running the MCP Inspector Proxy on a non-default address. Example: http://10.1.1.22:5577",
|
|
17395
17427
|
value: ""
|
|
17396
17428
|
}
|
|
@@ -17456,19 +17488,34 @@ class InspectorOAuthClientProvider {
|
|
|
17456
17488
|
}
|
|
17457
17489
|
}
|
|
17458
17490
|
const authProvider = new InspectorOAuthClientProvider();
|
|
17459
|
-
const version$1 = "0.
|
|
17491
|
+
const version$1 = "0.9.0";
|
|
17460
17492
|
const packageJson = {
|
|
17461
17493
|
version: version$1
|
|
17462
17494
|
};
|
|
17495
|
+
const getMCPProxyAddress = (config) => {
|
|
17496
|
+
const proxyFullAddress = config.MCP_PROXY_FULL_ADDRESS.value;
|
|
17497
|
+
if (proxyFullAddress) {
|
|
17498
|
+
return proxyFullAddress;
|
|
17499
|
+
}
|
|
17500
|
+
return `${window.location.protocol}//${window.location.hostname}:${DEFAULT_MCP_PROXY_LISTEN_PORT}`;
|
|
17501
|
+
};
|
|
17502
|
+
const getMCPServerRequestTimeout = (config) => {
|
|
17503
|
+
return config.MCP_SERVER_REQUEST_TIMEOUT.value;
|
|
17504
|
+
};
|
|
17505
|
+
const resetRequestTimeoutOnProgress = (config) => {
|
|
17506
|
+
return config.MCP_REQUEST_TIMEOUT_RESET_ON_PROGRESS.value;
|
|
17507
|
+
};
|
|
17508
|
+
const getMCPServerRequestMaxTotalTimeout = (config) => {
|
|
17509
|
+
return config.MCP_REQUEST_MAX_TOTAL_TIMEOUT.value;
|
|
17510
|
+
};
|
|
17463
17511
|
function useConnection({
|
|
17464
17512
|
transportType,
|
|
17465
17513
|
command,
|
|
17466
17514
|
args,
|
|
17467
17515
|
sseUrl,
|
|
17468
17516
|
env,
|
|
17469
|
-
proxyServerUrl,
|
|
17470
17517
|
bearerToken,
|
|
17471
|
-
|
|
17518
|
+
config,
|
|
17472
17519
|
onNotification,
|
|
17473
17520
|
onStdErrNotification,
|
|
17474
17521
|
onPendingRequest,
|
|
@@ -17495,21 +17542,30 @@ function useConnection({
|
|
|
17495
17542
|
}
|
|
17496
17543
|
try {
|
|
17497
17544
|
const abortController = new AbortController();
|
|
17498
|
-
const
|
|
17499
|
-
|
|
17500
|
-
|
|
17545
|
+
const mcpRequestOptions = {
|
|
17546
|
+
signal: (options == null ? void 0 : options.signal) ?? abortController.signal,
|
|
17547
|
+
resetTimeoutOnProgress: (options == null ? void 0 : options.resetTimeoutOnProgress) ?? resetRequestTimeoutOnProgress(config),
|
|
17548
|
+
timeout: (options == null ? void 0 : options.timeout) ?? getMCPServerRequestTimeout(config),
|
|
17549
|
+
maxTotalTimeout: (options == null ? void 0 : options.maxTotalTimeout) ?? getMCPServerRequestMaxTotalTimeout(config)
|
|
17550
|
+
};
|
|
17551
|
+
if (mcpRequestOptions.resetTimeoutOnProgress) {
|
|
17552
|
+
mcpRequestOptions.onprogress = (params2) => {
|
|
17553
|
+
if (onNotification) {
|
|
17554
|
+
onNotification({
|
|
17555
|
+
method: "notification/progress",
|
|
17556
|
+
params: params2
|
|
17557
|
+
});
|
|
17558
|
+
}
|
|
17559
|
+
};
|
|
17560
|
+
}
|
|
17501
17561
|
let response;
|
|
17502
17562
|
try {
|
|
17503
|
-
response = await mcpClient.request(request, schema,
|
|
17504
|
-
signal: (options == null ? void 0 : options.signal) ?? abortController.signal
|
|
17505
|
-
});
|
|
17563
|
+
response = await mcpClient.request(request, schema, mcpRequestOptions);
|
|
17506
17564
|
pushHistory(request, response);
|
|
17507
17565
|
} catch (error) {
|
|
17508
17566
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
17509
17567
|
pushHistory(request, { error: errorMessage });
|
|
17510
17568
|
throw error;
|
|
17511
|
-
} finally {
|
|
17512
|
-
clearTimeout(timeoutId);
|
|
17513
17569
|
}
|
|
17514
17570
|
return response;
|
|
17515
17571
|
} catch (e) {
|
|
@@ -17584,7 +17640,7 @@ function useConnection({
|
|
|
17584
17640
|
};
|
|
17585
17641
|
const checkProxyHealth = async () => {
|
|
17586
17642
|
try {
|
|
17587
|
-
const proxyHealthUrl = new URL(`${
|
|
17643
|
+
const proxyHealthUrl = new URL(`${getMCPProxyAddress(config)}/health`);
|
|
17588
17644
|
const proxyHealthResponse = await fetch(proxyHealthUrl);
|
|
17589
17645
|
const proxyHealth = await proxyHealthResponse.json();
|
|
17590
17646
|
if ((proxyHealth == null ? void 0 : proxyHealth.status) !== "ok") {
|
|
@@ -17625,7 +17681,7 @@ function useConnection({
|
|
|
17625
17681
|
setConnectionStatus("error-connecting-to-proxy");
|
|
17626
17682
|
return;
|
|
17627
17683
|
}
|
|
17628
|
-
const mcpProxyServerUrl = new URL(`${
|
|
17684
|
+
const mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config)}/sse`);
|
|
17629
17685
|
mcpProxyServerUrl.searchParams.append("transportType", transportType);
|
|
17630
17686
|
if (transportType === "stdio") {
|
|
17631
17687
|
mcpProxyServerUrl.searchParams.append("command", command);
|
|
@@ -17651,7 +17707,6 @@ function useConnection({
|
|
|
17651
17707
|
if (onNotification) {
|
|
17652
17708
|
[
|
|
17653
17709
|
CancelledNotificationSchema,
|
|
17654
|
-
ProgressNotificationSchema,
|
|
17655
17710
|
LoggingMessageNotificationSchema,
|
|
17656
17711
|
ResourceUpdatedNotificationSchema,
|
|
17657
17712
|
ResourceListChangedNotificationSchema,
|
|
@@ -17775,7 +17830,7 @@ function useDraggablePane(initialHeight) {
|
|
|
17775
17830
|
handleDragStart
|
|
17776
17831
|
};
|
|
17777
17832
|
}
|
|
17778
|
-
var useReactId = React$2["useId".toString()] || (() => void 0);
|
|
17833
|
+
var useReactId = React$2[" useId ".trim().toString()] || (() => void 0);
|
|
17779
17834
|
var count$1 = 0;
|
|
17780
17835
|
function useId(deterministicId) {
|
|
17781
17836
|
const [id2, setId] = reactExports.useState(useReactId());
|
|
@@ -18531,6 +18586,15 @@ const Hash = createLucideIcon("Hash", [
|
|
|
18531
18586
|
["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
|
|
18532
18587
|
["line", { x1: "16", x2: "14", y1: "3", y2: "21", key: "weycgp" }]
|
|
18533
18588
|
]);
|
|
18589
|
+
/**
|
|
18590
|
+
* @license lucide-react v0.447.0 - ISC
|
|
18591
|
+
*
|
|
18592
|
+
* This source code is licensed under the ISC license.
|
|
18593
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
18594
|
+
*/
|
|
18595
|
+
const LoaderCircle = createLucideIcon("LoaderCircle", [
|
|
18596
|
+
["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
|
|
18597
|
+
]);
|
|
18534
18598
|
/**
|
|
18535
18599
|
* @license lucide-react v0.447.0 - ISC
|
|
18536
18600
|
*
|
|
@@ -18680,7 +18744,7 @@ const buttonVariants = cva(
|
|
|
18680
18744
|
);
|
|
18681
18745
|
const Button = reactExports.forwardRef(
|
|
18682
18746
|
({ className: className2, variant, size: size2, asChild = false, ...props }, ref) => {
|
|
18683
|
-
const Comp = asChild ? Slot : "button";
|
|
18747
|
+
const Comp = asChild ? Slot$3 : "button";
|
|
18684
18748
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18685
18749
|
Comp,
|
|
18686
18750
|
{
|
|
@@ -18692,6 +18756,11 @@ const Button = reactExports.forwardRef(
|
|
|
18692
18756
|
}
|
|
18693
18757
|
);
|
|
18694
18758
|
Button.displayName = "Button";
|
|
18759
|
+
function getDataType(value) {
|
|
18760
|
+
if (Array.isArray(value)) return "array";
|
|
18761
|
+
if (value === null) return "null";
|
|
18762
|
+
return typeof value;
|
|
18763
|
+
}
|
|
18695
18764
|
function tryParseJson(str) {
|
|
18696
18765
|
const trimmed = str.trim();
|
|
18697
18766
|
if (!(trimmed.startsWith("{") && trimmed.endsWith("}")) && !(trimmed.startsWith("[") && trimmed.endsWith("]"))) {
|
|
@@ -18703,13 +18772,81 @@ function tryParseJson(str) {
|
|
|
18703
18772
|
return { success: false, data: str };
|
|
18704
18773
|
}
|
|
18705
18774
|
}
|
|
18775
|
+
function updateValueAtPath(obj, path, value) {
|
|
18776
|
+
if (path.length === 0) return value;
|
|
18777
|
+
if (obj === null || obj === void 0) {
|
|
18778
|
+
obj = !isNaN(Number(path[0])) ? [] : {};
|
|
18779
|
+
}
|
|
18780
|
+
if (Array.isArray(obj)) {
|
|
18781
|
+
return updateArray(obj, path, value);
|
|
18782
|
+
} else if (typeof obj === "object" && obj !== null) {
|
|
18783
|
+
return updateObject(obj, path, value);
|
|
18784
|
+
} else {
|
|
18785
|
+
console.error(
|
|
18786
|
+
`Cannot update path ${path.join(".")} in non-object/array value:`,
|
|
18787
|
+
obj
|
|
18788
|
+
);
|
|
18789
|
+
return obj;
|
|
18790
|
+
}
|
|
18791
|
+
}
|
|
18792
|
+
function updateArray(array, path, value) {
|
|
18793
|
+
const [index2, ...restPath] = path;
|
|
18794
|
+
const arrayIndex = Number(index2);
|
|
18795
|
+
if (isNaN(arrayIndex)) {
|
|
18796
|
+
console.error(`Invalid array index: ${index2}`);
|
|
18797
|
+
return array;
|
|
18798
|
+
}
|
|
18799
|
+
if (arrayIndex < 0) {
|
|
18800
|
+
console.error(`Array index out of bounds: ${arrayIndex} < 0`);
|
|
18801
|
+
return array;
|
|
18802
|
+
}
|
|
18803
|
+
let newArray = [];
|
|
18804
|
+
for (let i = 0; i < array.length; i++) {
|
|
18805
|
+
newArray[i] = i in array ? array[i] : null;
|
|
18806
|
+
}
|
|
18807
|
+
if (arrayIndex >= newArray.length) {
|
|
18808
|
+
const extendedArray = new Array(arrayIndex).fill(null);
|
|
18809
|
+
for (let i = 0; i < newArray.length; i++) {
|
|
18810
|
+
extendedArray[i] = newArray[i];
|
|
18811
|
+
}
|
|
18812
|
+
newArray = extendedArray;
|
|
18813
|
+
}
|
|
18814
|
+
if (restPath.length === 0) {
|
|
18815
|
+
newArray[arrayIndex] = value;
|
|
18816
|
+
} else {
|
|
18817
|
+
newArray[arrayIndex] = updateValueAtPath(
|
|
18818
|
+
newArray[arrayIndex],
|
|
18819
|
+
restPath,
|
|
18820
|
+
value
|
|
18821
|
+
);
|
|
18822
|
+
}
|
|
18823
|
+
return newArray;
|
|
18824
|
+
}
|
|
18825
|
+
function updateObject(obj, path, value) {
|
|
18826
|
+
const [key, ...restPath] = path;
|
|
18827
|
+
if (typeof key !== "string") {
|
|
18828
|
+
console.error(`Invalid object key: ${key}`);
|
|
18829
|
+
return obj;
|
|
18830
|
+
}
|
|
18831
|
+
const newObj = { ...obj };
|
|
18832
|
+
if (restPath.length === 0) {
|
|
18833
|
+
newObj[key] = value;
|
|
18834
|
+
} else {
|
|
18835
|
+
if (!(key in newObj)) {
|
|
18836
|
+
newObj[key] = {};
|
|
18837
|
+
}
|
|
18838
|
+
newObj[key] = updateValueAtPath(newObj[key], restPath, value);
|
|
18839
|
+
}
|
|
18840
|
+
return newObj;
|
|
18841
|
+
}
|
|
18706
18842
|
const JsonView = reactExports.memo(
|
|
18707
18843
|
({
|
|
18708
18844
|
data,
|
|
18709
18845
|
name,
|
|
18710
18846
|
initialExpandDepth = 3,
|
|
18711
18847
|
className: className2,
|
|
18712
|
-
withCopyButton = true
|
|
18848
|
+
withCopyButton = true,
|
|
18849
|
+
isError = false
|
|
18713
18850
|
}) => {
|
|
18714
18851
|
const { toast: toast2 } = useToast();
|
|
18715
18852
|
const [copied, setCopied] = reactExports.useState(false);
|
|
@@ -18760,7 +18897,8 @@ const JsonView = reactExports.memo(
|
|
|
18760
18897
|
data: normalizedData,
|
|
18761
18898
|
name,
|
|
18762
18899
|
depth: 0,
|
|
18763
|
-
initialExpandDepth
|
|
18900
|
+
initialExpandDepth,
|
|
18901
|
+
isError
|
|
18764
18902
|
}
|
|
18765
18903
|
) })
|
|
18766
18904
|
] });
|
|
@@ -18768,22 +18906,24 @@ const JsonView = reactExports.memo(
|
|
|
18768
18906
|
);
|
|
18769
18907
|
JsonView.displayName = "JsonView";
|
|
18770
18908
|
const JsonNode = reactExports.memo(
|
|
18771
|
-
({
|
|
18909
|
+
({
|
|
18910
|
+
data,
|
|
18911
|
+
name,
|
|
18912
|
+
depth = 0,
|
|
18913
|
+
initialExpandDepth,
|
|
18914
|
+
isError = false
|
|
18915
|
+
}) => {
|
|
18772
18916
|
const [isExpanded, setIsExpanded] = reactExports.useState(depth < initialExpandDepth);
|
|
18773
|
-
const
|
|
18774
|
-
if (Array.isArray(value)) return "array";
|
|
18775
|
-
if (value === null) return "null";
|
|
18776
|
-
return typeof value;
|
|
18777
|
-
};
|
|
18778
|
-
const dataType = getDataType(data);
|
|
18779
|
-
const typeStyleMap = {
|
|
18917
|
+
const [typeStyleMap] = reactExports.useState({
|
|
18780
18918
|
number: "text-blue-600",
|
|
18781
18919
|
boolean: "text-amber-600",
|
|
18782
18920
|
null: "text-purple-600",
|
|
18783
18921
|
undefined: "text-gray-600",
|
|
18784
|
-
string: "text-green-600
|
|
18922
|
+
string: "text-green-600 group-hover:text-green-500",
|
|
18923
|
+
error: "text-red-600 group-hover:text-red-500",
|
|
18785
18924
|
default: "text-gray-700"
|
|
18786
|
-
};
|
|
18925
|
+
});
|
|
18926
|
+
const dataType = getDataType(data);
|
|
18787
18927
|
const renderCollapsible = (isArray) => {
|
|
18788
18928
|
const items = isArray ? data : Object.entries(data);
|
|
18789
18929
|
const itemCount = items.length;
|
|
@@ -18856,11 +18996,20 @@ const JsonNode = reactExports.memo(
|
|
|
18856
18996
|
name,
|
|
18857
18997
|
":"
|
|
18858
18998
|
] }),
|
|
18859
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
18860
|
-
|
|
18861
|
-
|
|
18862
|
-
|
|
18863
|
-
|
|
18999
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
19000
|
+
"pre",
|
|
19001
|
+
{
|
|
19002
|
+
className: clsx(
|
|
19003
|
+
typeStyleMap.string,
|
|
19004
|
+
"break-all whitespace-pre-wrap"
|
|
19005
|
+
),
|
|
19006
|
+
children: [
|
|
19007
|
+
'"',
|
|
19008
|
+
value,
|
|
19009
|
+
'"'
|
|
19010
|
+
]
|
|
19011
|
+
}
|
|
19012
|
+
)
|
|
18864
19013
|
] });
|
|
18865
19014
|
}
|
|
18866
19015
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex mr-1 rounded group hover:bg-gray-800/20", children: [
|
|
@@ -18872,8 +19021,8 @@ const JsonNode = reactExports.memo(
|
|
|
18872
19021
|
"pre",
|
|
18873
19022
|
{
|
|
18874
19023
|
className: clsx(
|
|
18875
|
-
typeStyleMap.string,
|
|
18876
|
-
"cursor-pointer
|
|
19024
|
+
isError ? typeStyleMap.error : typeStyleMap.string,
|
|
19025
|
+
"cursor-pointer break-all whitespace-pre-wrap"
|
|
18877
19026
|
),
|
|
18878
19027
|
onClick: () => setIsExpanded(!isExpanded),
|
|
18879
19028
|
title: isExpanded ? "Click to collapse" : "Click to expand",
|
|
@@ -19004,14 +19153,14 @@ const HistoryAndNotifications = ({
|
|
|
19004
19153
|
] });
|
|
19005
19154
|
};
|
|
19006
19155
|
const PingTab = ({ onPingClick }) => {
|
|
19007
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "ping", className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "col-span-2 flex justify-center items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
19156
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "ping", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "col-span-2 flex justify-center items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
19008
19157
|
Button,
|
|
19009
19158
|
{
|
|
19010
19159
|
onClick: onPingClick,
|
|
19011
19160
|
className: "font-bold py-6 px-12 rounded-full",
|
|
19012
19161
|
children: "Ping Server"
|
|
19013
19162
|
}
|
|
19014
|
-
) }) });
|
|
19163
|
+
) }) }) });
|
|
19015
19164
|
};
|
|
19016
19165
|
const alertVariants = cva(
|
|
19017
19166
|
"relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",
|
|
@@ -20147,6 +20296,7 @@ var DialogOverlay$1 = reactExports.forwardRef(
|
|
|
20147
20296
|
}
|
|
20148
20297
|
);
|
|
20149
20298
|
DialogOverlay$1.displayName = OVERLAY_NAME;
|
|
20299
|
+
var Slot$2 = /* @__PURE__ */ createSlot("DialogOverlay.RemoveScroll");
|
|
20150
20300
|
var DialogOverlayImpl = reactExports.forwardRef(
|
|
20151
20301
|
(props, forwardedRef) => {
|
|
20152
20302
|
const { __scopeDialog, ...overlayProps } = props;
|
|
@@ -20154,7 +20304,7 @@ var DialogOverlayImpl = reactExports.forwardRef(
|
|
|
20154
20304
|
return (
|
|
20155
20305
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
20156
20306
|
// ie. when `Overlay` and `Content` are siblings
|
|
20157
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(ReactRemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
20307
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ReactRemoveScroll, { as: Slot$2, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
20158
20308
|
Primitive.div,
|
|
20159
20309
|
{
|
|
20160
20310
|
"data-state": getState$2(context.open),
|
|
@@ -23060,6 +23210,7 @@ var PopoverContent$1 = reactExports.forwardRef(
|
|
|
23060
23210
|
}
|
|
23061
23211
|
);
|
|
23062
23212
|
PopoverContent$1.displayName = CONTENT_NAME$2;
|
|
23213
|
+
var Slot$1 = /* @__PURE__ */ createSlot("PopoverContent.RemoveScroll");
|
|
23063
23214
|
var PopoverContentModal = reactExports.forwardRef(
|
|
23064
23215
|
(props, forwardedRef) => {
|
|
23065
23216
|
const context = usePopoverContext(CONTENT_NAME$2, props.__scopePopover);
|
|
@@ -23070,7 +23221,7 @@ var PopoverContentModal = reactExports.forwardRef(
|
|
|
23070
23221
|
const content = contentRef.current;
|
|
23071
23222
|
if (content) return hideOthers(content);
|
|
23072
23223
|
}, []);
|
|
23073
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(ReactRemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
23224
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ReactRemoveScroll, { as: Slot$1, allowPinchZoom: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
23074
23225
|
PopoverContentImpl,
|
|
23075
23226
|
{
|
|
23076
23227
|
...props,
|
|
@@ -23367,7 +23518,7 @@ const ListPane = ({
|
|
|
23367
23518
|
buttonText,
|
|
23368
23519
|
isButtonDisabled
|
|
23369
23520
|
}) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-card rounded-lg shadow", children: [
|
|
23370
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200 dark:border-gray-
|
|
23521
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold dark:text-white", children: title }) }),
|
|
23371
23522
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [
|
|
23372
23523
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
23373
23524
|
Button,
|
|
@@ -23402,9 +23553,11 @@ const ListPane = ({
|
|
|
23402
23553
|
] });
|
|
23403
23554
|
function debounce(func, wait) {
|
|
23404
23555
|
let timeout;
|
|
23405
|
-
return
|
|
23556
|
+
return (...args) => {
|
|
23406
23557
|
clearTimeout(timeout);
|
|
23407
|
-
timeout = setTimeout(() =>
|
|
23558
|
+
timeout = setTimeout(() => {
|
|
23559
|
+
void func(...args);
|
|
23560
|
+
}, wait);
|
|
23408
23561
|
};
|
|
23409
23562
|
}
|
|
23410
23563
|
function useCompletionState(handleCompletion, completionsSupported = true, debounceMs = 300) {
|
|
@@ -23429,8 +23582,8 @@ function useCompletionState(handleCompletion, completionsSupported = true, debou
|
|
|
23429
23582
|
loading: {}
|
|
23430
23583
|
});
|
|
23431
23584
|
}, [cleanup]);
|
|
23432
|
-
const requestCompletions = reactExports.
|
|
23433
|
-
debounce(
|
|
23585
|
+
const requestCompletions = reactExports.useMemo(() => {
|
|
23586
|
+
return debounce(
|
|
23434
23587
|
async (ref, argName, value) => {
|
|
23435
23588
|
if (!completionsSupported) {
|
|
23436
23589
|
return;
|
|
@@ -23456,7 +23609,7 @@ function useCompletionState(handleCompletion, completionsSupported = true, debou
|
|
|
23456
23609
|
loading: { ...prev.loading, [argName]: false }
|
|
23457
23610
|
}));
|
|
23458
23611
|
}
|
|
23459
|
-
} catch
|
|
23612
|
+
} catch {
|
|
23460
23613
|
if (!abortController.signal.aborted) {
|
|
23461
23614
|
setState((prev) => ({
|
|
23462
23615
|
...prev,
|
|
@@ -23470,9 +23623,8 @@ function useCompletionState(handleCompletion, completionsSupported = true, debou
|
|
|
23470
23623
|
}
|
|
23471
23624
|
},
|
|
23472
23625
|
debounceMs
|
|
23473
|
-
)
|
|
23474
|
-
|
|
23475
|
-
);
|
|
23626
|
+
);
|
|
23627
|
+
}, [handleCompletion, completionsSupported, cleanup, debounceMs]);
|
|
23476
23628
|
reactExports.useEffect(() => {
|
|
23477
23629
|
if (!completionsSupported) {
|
|
23478
23630
|
clearCompletions();
|
|
@@ -23522,7 +23674,7 @@ const PromptsTab = ({
|
|
|
23522
23674
|
getPrompt(selectedPrompt.name, promptArgs);
|
|
23523
23675
|
}
|
|
23524
23676
|
};
|
|
23525
|
-
return /* @__PURE__ */ jsxRuntimeExports.
|
|
23677
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "prompts", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
23526
23678
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
23527
23679
|
ListPane,
|
|
23528
23680
|
{
|
|
@@ -23543,7 +23695,7 @@ const PromptsTab = ({
|
|
|
23543
23695
|
}
|
|
23544
23696
|
),
|
|
23545
23697
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-card rounded-lg shadow", children: [
|
|
23546
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold", children: selectedPrompt ? selectedPrompt.name : "Select a prompt" }) }),
|
|
23698
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold", children: selectedPrompt ? selectedPrompt.name : "Select a prompt" }) }),
|
|
23547
23699
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4", children: error ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Alert, { variant: "destructive", children: [
|
|
23548
23700
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { className: "h-4 w-4" }),
|
|
23549
23701
|
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertTitle, { children: "Error" }),
|
|
@@ -23572,7 +23724,7 @@ const PromptsTab = ({
|
|
|
23572
23724
|
promptContent && /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: promptContent, withCopyButton: false })
|
|
23573
23725
|
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { children: "Select a prompt from the list to view and use it" }) }) })
|
|
23574
23726
|
] })
|
|
23575
|
-
] });
|
|
23727
|
+
] }) });
|
|
23576
23728
|
};
|
|
23577
23729
|
const ResourcesTab = ({
|
|
23578
23730
|
resources,
|
|
@@ -23631,7 +23783,7 @@ const ResourcesTab = ({
|
|
|
23631
23783
|
setSelectedResource({ uri, name: uri });
|
|
23632
23784
|
}
|
|
23633
23785
|
};
|
|
23634
|
-
return /* @__PURE__ */ jsxRuntimeExports.
|
|
23786
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "resources", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-3 gap-4", children: [
|
|
23635
23787
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
23636
23788
|
ListPane,
|
|
23637
23789
|
{
|
|
@@ -23675,7 +23827,7 @@ const ResourcesTab = ({
|
|
|
23675
23827
|
}
|
|
23676
23828
|
),
|
|
23677
23829
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-card rounded-lg shadow", children: [
|
|
23678
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4 border-b border-gray-200 flex justify-between items-center", children: [
|
|
23830
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4 border-b border-gray-200 dark:border-gray-800 flex justify-between items-center", children: [
|
|
23679
23831
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
23680
23832
|
"h3",
|
|
23681
23833
|
{
|
|
@@ -23756,7 +23908,7 @@ const ResourcesTab = ({
|
|
|
23756
23908
|
)
|
|
23757
23909
|
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { children: "Select a resource or template from the list to view its contents" }) }) })
|
|
23758
23910
|
] })
|
|
23759
|
-
] });
|
|
23911
|
+
] }) });
|
|
23760
23912
|
};
|
|
23761
23913
|
const Input = reactExports.forwardRef(
|
|
23762
23914
|
({ className: className2, type, ...props }, ref) => {
|
|
@@ -23796,7 +23948,7 @@ const RootsTab = ({
|
|
|
23796
23948
|
const handleSave = () => {
|
|
23797
23949
|
onRootsChange();
|
|
23798
23950
|
};
|
|
23799
|
-
return /* @__PURE__ */ jsxRuntimeExports.
|
|
23951
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "roots", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
|
|
23800
23952
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { children: "Configure the root directories that the server can access" }) }),
|
|
23801
23953
|
roots.map((root, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2 items-center", children: [
|
|
23802
23954
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -23828,7 +23980,7 @@ const RootsTab = ({
|
|
|
23828
23980
|
"Save Changes"
|
|
23829
23981
|
] })
|
|
23830
23982
|
] })
|
|
23831
|
-
] });
|
|
23983
|
+
] }) });
|
|
23832
23984
|
};
|
|
23833
23985
|
const SamplingTab = ({ pendingRequests, onApprove, onReject }) => {
|
|
23834
23986
|
const handleApprove = (id2) => {
|
|
@@ -23842,7 +23994,7 @@ const SamplingTab = ({ pendingRequests, onApprove, onReject }) => {
|
|
|
23842
23994
|
}
|
|
23843
23995
|
});
|
|
23844
23996
|
};
|
|
23845
|
-
return /* @__PURE__ */ jsxRuntimeExports.
|
|
23997
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "sampling", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "h-96", children: [
|
|
23846
23998
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { children: "When the server requests LLM sampling, requests will appear here for approval." }) }),
|
|
23847
23999
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4 space-y-4", children: [
|
|
23848
24000
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold", children: "Recent Requests" }),
|
|
@@ -23861,7 +24013,7 @@ const SamplingTab = ({ pendingRequests, onApprove, onReject }) => {
|
|
|
23861
24013
|
] }, request.id)),
|
|
23862
24014
|
pendingRequests.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500", children: "No pending requests" })
|
|
23863
24015
|
] })
|
|
23864
|
-
] });
|
|
24016
|
+
] }) });
|
|
23865
24017
|
};
|
|
23866
24018
|
function clamp(value, [min2, max2]) {
|
|
23867
24019
|
return Math.min(max2, Math.max(min2, value));
|
|
@@ -24120,6 +24272,7 @@ SelectContent$1.displayName = CONTENT_NAME$1;
|
|
|
24120
24272
|
var CONTENT_MARGIN = 10;
|
|
24121
24273
|
var [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME$1);
|
|
24122
24274
|
var CONTENT_IMPL_NAME = "SelectContentImpl";
|
|
24275
|
+
var Slot = /* @__PURE__ */ createSlot("SelectContent.RemoveScroll");
|
|
24123
24276
|
var SelectContentImpl = reactExports.forwardRef(
|
|
24124
24277
|
(props, forwardedRef) => {
|
|
24125
24278
|
const {
|
|
@@ -25145,9 +25298,12 @@ const useTheme = () => {
|
|
|
25145
25298
|
document.documentElement.classList.toggle("dark", newTheme === "dark");
|
|
25146
25299
|
}
|
|
25147
25300
|
}, []);
|
|
25148
|
-
return reactExports.useMemo(
|
|
25301
|
+
return reactExports.useMemo(
|
|
25302
|
+
() => [theme, setThemeWithSideEffect],
|
|
25303
|
+
[theme, setThemeWithSideEffect]
|
|
25304
|
+
);
|
|
25149
25305
|
};
|
|
25150
|
-
const version = "0.
|
|
25306
|
+
const version = "0.9.0";
|
|
25151
25307
|
var [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [
|
|
25152
25308
|
createPopperScope
|
|
25153
25309
|
]);
|
|
@@ -25164,7 +25320,7 @@ var TooltipProvider$1 = (props) => {
|
|
|
25164
25320
|
disableHoverableContent = false,
|
|
25165
25321
|
children
|
|
25166
25322
|
} = props;
|
|
25167
|
-
const
|
|
25323
|
+
const isOpenDelayedRef = reactExports.useRef(true);
|
|
25168
25324
|
const isPointerInTransitRef = reactExports.useRef(false);
|
|
25169
25325
|
const skipDelayTimerRef = reactExports.useRef(0);
|
|
25170
25326
|
reactExports.useEffect(() => {
|
|
@@ -25175,16 +25331,16 @@ var TooltipProvider$1 = (props) => {
|
|
|
25175
25331
|
TooltipProviderContextProvider,
|
|
25176
25332
|
{
|
|
25177
25333
|
scope: __scopeTooltip,
|
|
25178
|
-
|
|
25334
|
+
isOpenDelayedRef,
|
|
25179
25335
|
delayDuration,
|
|
25180
25336
|
onOpen: reactExports.useCallback(() => {
|
|
25181
25337
|
window.clearTimeout(skipDelayTimerRef.current);
|
|
25182
|
-
|
|
25338
|
+
isOpenDelayedRef.current = false;
|
|
25183
25339
|
}, []),
|
|
25184
25340
|
onClose: reactExports.useCallback(() => {
|
|
25185
25341
|
window.clearTimeout(skipDelayTimerRef.current);
|
|
25186
25342
|
skipDelayTimerRef.current = window.setTimeout(
|
|
25187
|
-
() =>
|
|
25343
|
+
() => isOpenDelayedRef.current = true,
|
|
25188
25344
|
skipDelayDuration
|
|
25189
25345
|
);
|
|
25190
25346
|
}, [skipDelayDuration]),
|
|
@@ -25271,9 +25427,9 @@ var Tooltip$1 = (props) => {
|
|
|
25271
25427
|
trigger,
|
|
25272
25428
|
onTriggerChange: setTrigger,
|
|
25273
25429
|
onTriggerEnter: reactExports.useCallback(() => {
|
|
25274
|
-
if (providerContext.
|
|
25430
|
+
if (providerContext.isOpenDelayedRef.current) handleDelayedOpen();
|
|
25275
25431
|
else handleOpen();
|
|
25276
|
-
}, [providerContext.
|
|
25432
|
+
}, [providerContext.isOpenDelayedRef, handleDelayedOpen, handleOpen]),
|
|
25277
25433
|
onTriggerLeave: reactExports.useCallback(() => {
|
|
25278
25434
|
if (disableHoverableContent) {
|
|
25279
25435
|
handleClose();
|
|
@@ -25324,6 +25480,9 @@ var TooltipTrigger$1 = reactExports.forwardRef(
|
|
|
25324
25480
|
hasPointerMoveOpenedRef.current = false;
|
|
25325
25481
|
}),
|
|
25326
25482
|
onPointerDown: composeEventHandlers(props.onPointerDown, () => {
|
|
25483
|
+
if (context.open) {
|
|
25484
|
+
context.onClose();
|
|
25485
|
+
}
|
|
25327
25486
|
isPointerDownRef.current = true;
|
|
25328
25487
|
document.addEventListener("pointerup", handlePointerUp, { once: true });
|
|
25329
25488
|
}),
|
|
@@ -25412,6 +25571,7 @@ var TooltipContentHoverable = reactExports.forwardRef((props, forwardedRef) => {
|
|
|
25412
25571
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContentImpl, { ...props, ref: composedRefs });
|
|
25413
25572
|
});
|
|
25414
25573
|
var [VisuallyHiddenContentContextProvider, useVisuallyHiddenContentContext] = createTooltipContext(TOOLTIP_NAME, { isInside: false });
|
|
25574
|
+
var Slottable = /* @__PURE__ */ createSlottable("TooltipContent");
|
|
25415
25575
|
var TooltipContentImpl = reactExports.forwardRef(
|
|
25416
25576
|
(props, forwardedRef) => {
|
|
25417
25577
|
const {
|
|
@@ -25652,20 +25812,27 @@ const Sidebar = ({
|
|
|
25652
25812
|
const [showConfig, setShowConfig] = reactExports.useState(false);
|
|
25653
25813
|
const [shownEnvVars, setShownEnvVars] = reactExports.useState(/* @__PURE__ */ new Set());
|
|
25654
25814
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-80 bg-card border-r border-border flex flex-col h-full", children: [
|
|
25655
|
-
/* @__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: [
|
|
25815
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("h1", { className: "ml-2 text-lg font-semibold", children: [
|
|
25656
25816
|
"MCP Inspector v",
|
|
25657
25817
|
version
|
|
25658
25818
|
] }) }) }),
|
|
25659
25819
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 flex-1 overflow-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
|
|
25660
25820
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
|
|
25661
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
25821
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
25822
|
+
"label",
|
|
25823
|
+
{
|
|
25824
|
+
className: "text-sm font-medium",
|
|
25825
|
+
htmlFor: "transport-type-select",
|
|
25826
|
+
children: "Transport Type"
|
|
25827
|
+
}
|
|
25828
|
+
),
|
|
25662
25829
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
25663
25830
|
Select,
|
|
25664
25831
|
{
|
|
25665
25832
|
value: transportType,
|
|
25666
25833
|
onValueChange: (value) => setTransportType(value),
|
|
25667
25834
|
children: [
|
|
25668
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "Select transport type" }) }),
|
|
25835
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { id: "transport-type-select", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "Select transport type" }) }),
|
|
25669
25836
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
|
|
25670
25837
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "stdio", children: "STDIO" }),
|
|
25671
25838
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "sse", children: "SSE" })
|
|
@@ -25676,10 +25843,11 @@ const Sidebar = ({
|
|
|
25676
25843
|
] }),
|
|
25677
25844
|
transportType === "stdio" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
25678
25845
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
|
|
25679
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium", children: "Command" }),
|
|
25846
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium", htmlFor: "command-input", children: "Command" }),
|
|
25680
25847
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
25681
25848
|
Input,
|
|
25682
25849
|
{
|
|
25850
|
+
id: "command-input",
|
|
25683
25851
|
placeholder: "Command",
|
|
25684
25852
|
value: command,
|
|
25685
25853
|
onChange: (e) => setCommand(e.target.value),
|
|
@@ -25688,10 +25856,18 @@ const Sidebar = ({
|
|
|
25688
25856
|
)
|
|
25689
25857
|
] }),
|
|
25690
25858
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
|
|
25691
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
25859
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
25860
|
+
"label",
|
|
25861
|
+
{
|
|
25862
|
+
className: "text-sm font-medium",
|
|
25863
|
+
htmlFor: "arguments-input",
|
|
25864
|
+
children: "Arguments"
|
|
25865
|
+
}
|
|
25866
|
+
),
|
|
25692
25867
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
25693
25868
|
Input,
|
|
25694
25869
|
{
|
|
25870
|
+
id: "arguments-input",
|
|
25695
25871
|
placeholder: "Arguments (space-separated)",
|
|
25696
25872
|
value: args,
|
|
25697
25873
|
onChange: (e) => setArgs(e.target.value),
|
|
@@ -25701,10 +25877,11 @@ const Sidebar = ({
|
|
|
25701
25877
|
] })
|
|
25702
25878
|
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
25703
25879
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
|
|
25704
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium", children: "URL" }),
|
|
25880
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium", htmlFor: "sse-url-input", children: "URL" }),
|
|
25705
25881
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
25706
25882
|
Input,
|
|
25707
25883
|
{
|
|
25884
|
+
id: "sse-url-input",
|
|
25708
25885
|
placeholder: "URL",
|
|
25709
25886
|
value: sseUrl,
|
|
25710
25887
|
onChange: (e) => setSseUrl(e.target.value),
|
|
@@ -25719,6 +25896,7 @@ const Sidebar = ({
|
|
|
25719
25896
|
variant: "outline",
|
|
25720
25897
|
onClick: () => setShowBearerToken(!showBearerToken),
|
|
25721
25898
|
className: "flex items-center w-full",
|
|
25899
|
+
"aria-expanded": showBearerToken,
|
|
25722
25900
|
children: [
|
|
25723
25901
|
showBearerToken ? /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4 mr-2" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "w-4 h-4 mr-2" }),
|
|
25724
25902
|
"Authentication"
|
|
@@ -25726,10 +25904,18 @@ const Sidebar = ({
|
|
|
25726
25904
|
}
|
|
25727
25905
|
),
|
|
25728
25906
|
showBearerToken && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
|
|
25729
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
25907
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
25908
|
+
"label",
|
|
25909
|
+
{
|
|
25910
|
+
className: "text-sm font-medium",
|
|
25911
|
+
htmlFor: "bearer-token-input",
|
|
25912
|
+
children: "Bearer Token"
|
|
25913
|
+
}
|
|
25914
|
+
),
|
|
25730
25915
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
25731
25916
|
Input,
|
|
25732
25917
|
{
|
|
25918
|
+
id: "bearer-token-input",
|
|
25733
25919
|
placeholder: "Bearer Token",
|
|
25734
25920
|
value: bearerToken,
|
|
25735
25921
|
onChange: (e) => setBearerToken(e.target.value),
|
|
@@ -25748,6 +25934,7 @@ const Sidebar = ({
|
|
|
25748
25934
|
onClick: () => setShowEnvVars(!showEnvVars),
|
|
25749
25935
|
className: "flex items-center w-full",
|
|
25750
25936
|
"data-testid": "env-vars-button",
|
|
25937
|
+
"aria-expanded": showEnvVars,
|
|
25751
25938
|
children: [
|
|
25752
25939
|
showEnvVars ? /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4 mr-2" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "w-4 h-4 mr-2" }),
|
|
25753
25940
|
"Environment Variables"
|
|
@@ -25760,6 +25947,7 @@ const Sidebar = ({
|
|
|
25760
25947
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
25761
25948
|
Input,
|
|
25762
25949
|
{
|
|
25950
|
+
"aria-label": `Environment variable key ${idx + 1}`,
|
|
25763
25951
|
placeholder: "Key",
|
|
25764
25952
|
value: key,
|
|
25765
25953
|
onChange: (e) => {
|
|
@@ -25806,6 +25994,7 @@ const Sidebar = ({
|
|
|
25806
25994
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
25807
25995
|
Input,
|
|
25808
25996
|
{
|
|
25997
|
+
"aria-label": `Environment variable value ${idx + 1}`,
|
|
25809
25998
|
type: shownEnvVars.has(key) ? "text" : "password",
|
|
25810
25999
|
placeholder: "Value",
|
|
25811
26000
|
value,
|
|
@@ -25866,6 +26055,7 @@ const Sidebar = ({
|
|
|
25866
26055
|
onClick: () => setShowConfig(!showConfig),
|
|
25867
26056
|
className: "flex items-center w-full",
|
|
25868
26057
|
"data-testid": "config-button",
|
|
26058
|
+
"aria-expanded": showConfig,
|
|
25869
26059
|
children: [
|
|
25870
26060
|
showConfig ? /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4 mr-2" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "w-4 h-4 mr-2" }),
|
|
25871
26061
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Settings, { className: "w-4 h-4 mr-2" }),
|
|
@@ -25877,7 +26067,14 @@ const Sidebar = ({
|
|
|
25877
26067
|
const configKey = key;
|
|
25878
26068
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
|
|
25879
26069
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
25880
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
26070
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
26071
|
+
"label",
|
|
26072
|
+
{
|
|
26073
|
+
className: "text-sm font-medium text-green-600 break-all",
|
|
26074
|
+
htmlFor: `${configKey}-input`,
|
|
26075
|
+
children: configItem.label
|
|
26076
|
+
}
|
|
26077
|
+
),
|
|
25881
26078
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { children: [
|
|
25882
26079
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CircleHelp, { className: "h-4 w-4 text-muted-foreground" }) }),
|
|
25883
26080
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: configItem.description })
|
|
@@ -25886,6 +26083,7 @@ const Sidebar = ({
|
|
|
25886
26083
|
typeof configItem.value === "number" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
25887
26084
|
Input,
|
|
25888
26085
|
{
|
|
26086
|
+
id: `${configKey}-input`,
|
|
25889
26087
|
type: "number",
|
|
25890
26088
|
"data-testid": `${configKey}-input`,
|
|
25891
26089
|
value: configItem.value,
|
|
@@ -25913,7 +26111,7 @@ const Sidebar = ({
|
|
|
25913
26111
|
setConfig(newConfig);
|
|
25914
26112
|
},
|
|
25915
26113
|
children: [
|
|
25916
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, {}) }),
|
|
26114
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { id: `${configKey}-input`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, {}) }),
|
|
25917
26115
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
|
|
25918
26116
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "true", children: "True" }),
|
|
25919
26117
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "false", children: "False" })
|
|
@@ -25923,6 +26121,7 @@ const Sidebar = ({
|
|
|
25923
26121
|
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
25924
26122
|
Input,
|
|
25925
26123
|
{
|
|
26124
|
+
id: `${configKey}-input`,
|
|
25926
26125
|
"data-testid": `${configKey}-input`,
|
|
25927
26126
|
value: configItem.value,
|
|
25928
26127
|
onChange: (e) => {
|
|
@@ -25941,10 +26140,20 @@ const Sidebar = ({
|
|
|
25941
26140
|
] }),
|
|
25942
26141
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
|
|
25943
26142
|
connectionStatus === "connected" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
25944
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
25945
|
-
|
|
25946
|
-
|
|
25947
|
-
|
|
26143
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
26144
|
+
Button,
|
|
26145
|
+
{
|
|
26146
|
+
"data-testid": "connect-button",
|
|
26147
|
+
onClick: () => {
|
|
26148
|
+
onDisconnect();
|
|
26149
|
+
onConnect();
|
|
26150
|
+
},
|
|
26151
|
+
children: [
|
|
26152
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(RotateCcw, { className: "w-4 h-4 mr-2" }),
|
|
26153
|
+
transportType === "stdio" ? "Restart" : "Reconnect"
|
|
26154
|
+
]
|
|
26155
|
+
}
|
|
26156
|
+
),
|
|
25948
26157
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { onClick: onDisconnect, children: [
|
|
25949
26158
|
/* @__PURE__ */ jsxRuntimeExports.jsx(RefreshCwOff, { className: "w-4 h-4 mr-2" }),
|
|
25950
26159
|
"Disconnect"
|
|
@@ -25986,14 +26195,21 @@ const Sidebar = ({
|
|
|
25986
26195
|
})() })
|
|
25987
26196
|
] }),
|
|
25988
26197
|
loggingSupported && connectionStatus === "connected" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
|
|
25989
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
26198
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
26199
|
+
"label",
|
|
26200
|
+
{
|
|
26201
|
+
className: "text-sm font-medium",
|
|
26202
|
+
htmlFor: "logging-level-select",
|
|
26203
|
+
children: "Logging Level"
|
|
26204
|
+
}
|
|
26205
|
+
),
|
|
25990
26206
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
25991
26207
|
Select,
|
|
25992
26208
|
{
|
|
25993
26209
|
value: logLevel,
|
|
25994
26210
|
onValueChange: (value) => sendLogLevelRequest(value),
|
|
25995
26211
|
children: [
|
|
25996
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "Select logging level" }) }),
|
|
26212
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { id: "logging-level-select", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "Select logging level" }) }),
|
|
25997
26213
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectContent, { children: Object.values(LoggingLevelSchema.enum).map((level) => /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: level, children: level })) })
|
|
25998
26214
|
]
|
|
25999
26215
|
}
|
|
@@ -28166,73 +28382,6 @@ const JsonEditor = ({
|
|
|
28166
28382
|
displayError && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-red-500 mt-1", children: displayError })
|
|
28167
28383
|
] });
|
|
28168
28384
|
};
|
|
28169
|
-
function updateValueAtPath(obj, path, value) {
|
|
28170
|
-
if (path.length === 0) return value;
|
|
28171
|
-
if (obj === null || obj === void 0) {
|
|
28172
|
-
obj = !isNaN(Number(path[0])) ? [] : {};
|
|
28173
|
-
}
|
|
28174
|
-
if (Array.isArray(obj)) {
|
|
28175
|
-
return updateArray(obj, path, value);
|
|
28176
|
-
} else if (typeof obj === "object" && obj !== null) {
|
|
28177
|
-
return updateObject(obj, path, value);
|
|
28178
|
-
} else {
|
|
28179
|
-
console.error(
|
|
28180
|
-
`Cannot update path ${path.join(".")} in non-object/array value:`,
|
|
28181
|
-
obj
|
|
28182
|
-
);
|
|
28183
|
-
return obj;
|
|
28184
|
-
}
|
|
28185
|
-
}
|
|
28186
|
-
function updateArray(array, path, value) {
|
|
28187
|
-
const [index2, ...restPath] = path;
|
|
28188
|
-
const arrayIndex = Number(index2);
|
|
28189
|
-
if (isNaN(arrayIndex)) {
|
|
28190
|
-
console.error(`Invalid array index: ${index2}`);
|
|
28191
|
-
return array;
|
|
28192
|
-
}
|
|
28193
|
-
if (arrayIndex < 0) {
|
|
28194
|
-
console.error(`Array index out of bounds: ${arrayIndex} < 0`);
|
|
28195
|
-
return array;
|
|
28196
|
-
}
|
|
28197
|
-
let newArray = [];
|
|
28198
|
-
for (let i = 0; i < array.length; i++) {
|
|
28199
|
-
newArray[i] = i in array ? array[i] : null;
|
|
28200
|
-
}
|
|
28201
|
-
if (arrayIndex >= newArray.length) {
|
|
28202
|
-
const extendedArray = new Array(arrayIndex).fill(null);
|
|
28203
|
-
for (let i = 0; i < newArray.length; i++) {
|
|
28204
|
-
extendedArray[i] = newArray[i];
|
|
28205
|
-
}
|
|
28206
|
-
newArray = extendedArray;
|
|
28207
|
-
}
|
|
28208
|
-
if (restPath.length === 0) {
|
|
28209
|
-
newArray[arrayIndex] = value;
|
|
28210
|
-
} else {
|
|
28211
|
-
newArray[arrayIndex] = updateValueAtPath(
|
|
28212
|
-
newArray[arrayIndex],
|
|
28213
|
-
restPath,
|
|
28214
|
-
value
|
|
28215
|
-
);
|
|
28216
|
-
}
|
|
28217
|
-
return newArray;
|
|
28218
|
-
}
|
|
28219
|
-
function updateObject(obj, path, value) {
|
|
28220
|
-
const [key, ...restPath] = path;
|
|
28221
|
-
if (typeof key !== "string") {
|
|
28222
|
-
console.error(`Invalid object key: ${key}`);
|
|
28223
|
-
return obj;
|
|
28224
|
-
}
|
|
28225
|
-
const newObj = { ...obj };
|
|
28226
|
-
if (restPath.length === 0) {
|
|
28227
|
-
newObj[key] = value;
|
|
28228
|
-
} else {
|
|
28229
|
-
if (!(key in newObj)) {
|
|
28230
|
-
newObj[key] = {};
|
|
28231
|
-
}
|
|
28232
|
-
newObj[key] = updateValueAtPath(newObj[key], restPath, value);
|
|
28233
|
-
}
|
|
28234
|
-
return newObj;
|
|
28235
|
-
}
|
|
28236
28385
|
function generateDefaultValue(schema) {
|
|
28237
28386
|
if ("default" in schema) {
|
|
28238
28387
|
return schema.default;
|
|
@@ -28569,6 +28718,7 @@ const ToolsTab = ({
|
|
|
28569
28718
|
nextCursor
|
|
28570
28719
|
}) => {
|
|
28571
28720
|
const [params2, setParams] = reactExports.useState({});
|
|
28721
|
+
const [isToolRunning, setIsToolRunning] = reactExports.useState(false);
|
|
28572
28722
|
reactExports.useEffect(() => {
|
|
28573
28723
|
setParams({});
|
|
28574
28724
|
}, [selectedTool]);
|
|
@@ -28588,13 +28738,14 @@ const ToolsTab = ({
|
|
|
28588
28738
|
const isError = structuredResult.isError ?? false;
|
|
28589
28739
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
28590
28740
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("h4", { className: "font-semibold mb-2", children: [
|
|
28591
|
-
"Tool Result:
|
|
28592
|
-
|
|
28741
|
+
"Tool Result:",
|
|
28742
|
+
" ",
|
|
28743
|
+
isError ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-600 font-semibold", children: "Error" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-green-600 font-semibold", children: "Success" })
|
|
28593
28744
|
] }),
|
|
28594
28745
|
structuredResult.content.map((item, index2) => {
|
|
28595
28746
|
var _a, _b;
|
|
28596
28747
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-2", children: [
|
|
28597
|
-
item.type === "text" && /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: item.text }),
|
|
28748
|
+
item.type === "text" && /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: item.text, isError }),
|
|
28598
28749
|
item.type === "image" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
28599
28750
|
"img",
|
|
28600
28751
|
{
|
|
@@ -28622,7 +28773,7 @@ const ToolsTab = ({
|
|
|
28622
28773
|
] });
|
|
28623
28774
|
}
|
|
28624
28775
|
};
|
|
28625
|
-
return /* @__PURE__ */ jsxRuntimeExports.
|
|
28776
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "tools", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
28626
28777
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
28627
28778
|
ListPane,
|
|
28628
28779
|
{
|
|
@@ -28643,7 +28794,7 @@ const ToolsTab = ({
|
|
|
28643
28794
|
}
|
|
28644
28795
|
),
|
|
28645
28796
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-card rounded-lg shadow", children: [
|
|
28646
|
-
/* @__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" }) }),
|
|
28797
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold", children: selectedTool ? selectedTool.name : "Select a tool" }) }),
|
|
28647
28798
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4", children: selectedTool ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
|
|
28648
28799
|
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: selectedTool.description }),
|
|
28649
28800
|
Object.entries(selectedTool.inputSchema.properties ?? []).map(
|
|
@@ -28727,24 +28878,31 @@ const ToolsTab = ({
|
|
|
28727
28878
|
] }, key);
|
|
28728
28879
|
}
|
|
28729
28880
|
),
|
|
28730
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
28731
|
-
|
|
28732
|
-
|
|
28733
|
-
|
|
28881
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
28882
|
+
Button,
|
|
28883
|
+
{
|
|
28884
|
+
onClick: async () => {
|
|
28885
|
+
try {
|
|
28886
|
+
setIsToolRunning(true);
|
|
28887
|
+
await callTool(selectedTool.name, params2);
|
|
28888
|
+
} finally {
|
|
28889
|
+
setIsToolRunning(false);
|
|
28890
|
+
}
|
|
28891
|
+
},
|
|
28892
|
+
disabled: isToolRunning,
|
|
28893
|
+
children: isToolRunning ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
28894
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "w-4 h-4 mr-2 animate-spin" }),
|
|
28895
|
+
"Running..."
|
|
28896
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
28897
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Send, { className: "w-4 h-4 mr-2" }),
|
|
28898
|
+
"Run Tool"
|
|
28899
|
+
] })
|
|
28900
|
+
}
|
|
28901
|
+
),
|
|
28734
28902
|
toolResult && renderToolResult()
|
|
28735
28903
|
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { children: "Select a tool from the list to view its details and run it" }) }) })
|
|
28736
28904
|
] })
|
|
28737
|
-
] });
|
|
28738
|
-
};
|
|
28739
|
-
const getMCPProxyAddress = (config) => {
|
|
28740
|
-
const proxyFullAddress = config.MCP_PROXY_FULL_ADDRESS.value;
|
|
28741
|
-
if (proxyFullAddress) {
|
|
28742
|
-
return proxyFullAddress;
|
|
28743
|
-
}
|
|
28744
|
-
return `${window.location.protocol}//${window.location.hostname}:${DEFAULT_MCP_PROXY_LISTEN_PORT}`;
|
|
28745
|
-
};
|
|
28746
|
-
const getMCPServerRequestTimeout = (config) => {
|
|
28747
|
-
return config.MCP_SERVER_REQUEST_TIMEOUT.value;
|
|
28905
|
+
] }) });
|
|
28748
28906
|
};
|
|
28749
28907
|
const params = new URLSearchParams(window.location.search);
|
|
28750
28908
|
const CONFIG_LOCAL_STORAGE_KEY = "inspectorConfig_v1";
|
|
@@ -28783,10 +28941,17 @@ const App = () => {
|
|
|
28783
28941
|
const [config, setConfig] = reactExports.useState(() => {
|
|
28784
28942
|
const savedConfig = localStorage.getItem(CONFIG_LOCAL_STORAGE_KEY);
|
|
28785
28943
|
if (savedConfig) {
|
|
28786
|
-
|
|
28944
|
+
const mergedConfig = {
|
|
28787
28945
|
...DEFAULT_INSPECTOR_CONFIG,
|
|
28788
28946
|
...JSON.parse(savedConfig)
|
|
28789
28947
|
};
|
|
28948
|
+
Object.entries(mergedConfig).forEach(([key, value]) => {
|
|
28949
|
+
mergedConfig[key] = {
|
|
28950
|
+
...value,
|
|
28951
|
+
label: DEFAULT_INSPECTOR_CONFIG[key].label
|
|
28952
|
+
};
|
|
28953
|
+
});
|
|
28954
|
+
return mergedConfig;
|
|
28790
28955
|
}
|
|
28791
28956
|
return DEFAULT_INSPECTOR_CONFIG;
|
|
28792
28957
|
});
|
|
@@ -28813,7 +28978,7 @@ const App = () => {
|
|
|
28813
28978
|
serverCapabilities,
|
|
28814
28979
|
mcpClient,
|
|
28815
28980
|
requestHistory,
|
|
28816
|
-
makeRequest
|
|
28981
|
+
makeRequest,
|
|
28817
28982
|
sendNotification,
|
|
28818
28983
|
handleCompletion,
|
|
28819
28984
|
completionsSupported,
|
|
@@ -28826,8 +28991,7 @@ const App = () => {
|
|
|
28826
28991
|
sseUrl,
|
|
28827
28992
|
env,
|
|
28828
28993
|
bearerToken,
|
|
28829
|
-
|
|
28830
|
-
requestTimeout: getMCPServerRequestTimeout(config),
|
|
28994
|
+
config,
|
|
28831
28995
|
onNotification: (notification) => {
|
|
28832
28996
|
setNotifications((prev) => [...prev, notification]);
|
|
28833
28997
|
},
|
|
@@ -28921,9 +29085,9 @@ const App = () => {
|
|
|
28921
29085
|
const clearError = (tabKey) => {
|
|
28922
29086
|
setErrors((prev) => ({ ...prev, [tabKey]: null }));
|
|
28923
29087
|
};
|
|
28924
|
-
const
|
|
29088
|
+
const sendMCPRequest = async (request, schema, tabKey) => {
|
|
28925
29089
|
try {
|
|
28926
|
-
const response = await
|
|
29090
|
+
const response = await makeRequest(request, schema);
|
|
28927
29091
|
if (tabKey !== void 0) {
|
|
28928
29092
|
clearError(tabKey);
|
|
28929
29093
|
}
|
|
@@ -28940,7 +29104,7 @@ const App = () => {
|
|
|
28940
29104
|
}
|
|
28941
29105
|
};
|
|
28942
29106
|
const listResources = async () => {
|
|
28943
|
-
const response = await
|
|
29107
|
+
const response = await sendMCPRequest(
|
|
28944
29108
|
{
|
|
28945
29109
|
method: "resources/list",
|
|
28946
29110
|
params: nextResourceCursor ? { cursor: nextResourceCursor } : {}
|
|
@@ -28952,7 +29116,7 @@ const App = () => {
|
|
|
28952
29116
|
setNextResourceCursor(response.nextCursor);
|
|
28953
29117
|
};
|
|
28954
29118
|
const listResourceTemplates = async () => {
|
|
28955
|
-
const response = await
|
|
29119
|
+
const response = await sendMCPRequest(
|
|
28956
29120
|
{
|
|
28957
29121
|
method: "resources/templates/list",
|
|
28958
29122
|
params: nextResourceTemplateCursor ? { cursor: nextResourceTemplateCursor } : {}
|
|
@@ -28966,7 +29130,7 @@ const App = () => {
|
|
|
28966
29130
|
setNextResourceTemplateCursor(response.nextCursor);
|
|
28967
29131
|
};
|
|
28968
29132
|
const readResource = async (uri) => {
|
|
28969
|
-
const response = await
|
|
29133
|
+
const response = await sendMCPRequest(
|
|
28970
29134
|
{
|
|
28971
29135
|
method: "resources/read",
|
|
28972
29136
|
params: { uri }
|
|
@@ -28978,7 +29142,7 @@ const App = () => {
|
|
|
28978
29142
|
};
|
|
28979
29143
|
const subscribeToResource = async (uri) => {
|
|
28980
29144
|
if (!resourceSubscriptions.has(uri)) {
|
|
28981
|
-
await
|
|
29145
|
+
await sendMCPRequest(
|
|
28982
29146
|
{
|
|
28983
29147
|
method: "resources/subscribe",
|
|
28984
29148
|
params: { uri }
|
|
@@ -28993,7 +29157,7 @@ const App = () => {
|
|
|
28993
29157
|
};
|
|
28994
29158
|
const unsubscribeFromResource = async (uri) => {
|
|
28995
29159
|
if (resourceSubscriptions.has(uri)) {
|
|
28996
|
-
await
|
|
29160
|
+
await sendMCPRequest(
|
|
28997
29161
|
{
|
|
28998
29162
|
method: "resources/unsubscribe",
|
|
28999
29163
|
params: { uri }
|
|
@@ -29007,7 +29171,7 @@ const App = () => {
|
|
|
29007
29171
|
}
|
|
29008
29172
|
};
|
|
29009
29173
|
const listPrompts = async () => {
|
|
29010
|
-
const response = await
|
|
29174
|
+
const response = await sendMCPRequest(
|
|
29011
29175
|
{
|
|
29012
29176
|
method: "prompts/list",
|
|
29013
29177
|
params: nextPromptCursor ? { cursor: nextPromptCursor } : {}
|
|
@@ -29019,7 +29183,7 @@ const App = () => {
|
|
|
29019
29183
|
setNextPromptCursor(response.nextCursor);
|
|
29020
29184
|
};
|
|
29021
29185
|
const getPrompt = async (name, args2 = {}) => {
|
|
29022
|
-
const response = await
|
|
29186
|
+
const response = await sendMCPRequest(
|
|
29023
29187
|
{
|
|
29024
29188
|
method: "prompts/get",
|
|
29025
29189
|
params: { name, arguments: args2 }
|
|
@@ -29030,7 +29194,7 @@ const App = () => {
|
|
|
29030
29194
|
setPromptContent(JSON.stringify(response, null, 2));
|
|
29031
29195
|
};
|
|
29032
29196
|
const listTools = async () => {
|
|
29033
|
-
const response = await
|
|
29197
|
+
const response = await sendMCPRequest(
|
|
29034
29198
|
{
|
|
29035
29199
|
method: "tools/list",
|
|
29036
29200
|
params: nextToolCursor ? { cursor: nextToolCursor } : {}
|
|
@@ -29042,27 +29206,40 @@ const App = () => {
|
|
|
29042
29206
|
setNextToolCursor(response.nextCursor);
|
|
29043
29207
|
};
|
|
29044
29208
|
const callTool = async (name, params2) => {
|
|
29045
|
-
|
|
29046
|
-
|
|
29047
|
-
|
|
29048
|
-
|
|
29049
|
-
|
|
29050
|
-
|
|
29051
|
-
|
|
29052
|
-
|
|
29209
|
+
try {
|
|
29210
|
+
const response = await sendMCPRequest(
|
|
29211
|
+
{
|
|
29212
|
+
method: "tools/call",
|
|
29213
|
+
params: {
|
|
29214
|
+
name,
|
|
29215
|
+
arguments: params2,
|
|
29216
|
+
_meta: {
|
|
29217
|
+
progressToken: progressTokenRef.current++
|
|
29218
|
+
}
|
|
29053
29219
|
}
|
|
29054
|
-
}
|
|
29055
|
-
|
|
29056
|
-
|
|
29057
|
-
|
|
29058
|
-
|
|
29059
|
-
|
|
29220
|
+
},
|
|
29221
|
+
CompatibilityCallToolResultSchema,
|
|
29222
|
+
"tools"
|
|
29223
|
+
);
|
|
29224
|
+
setToolResult(response);
|
|
29225
|
+
} catch (e) {
|
|
29226
|
+
const toolResult2 = {
|
|
29227
|
+
content: [
|
|
29228
|
+
{
|
|
29229
|
+
type: "text",
|
|
29230
|
+
text: e.message ?? String(e)
|
|
29231
|
+
}
|
|
29232
|
+
],
|
|
29233
|
+
isError: true
|
|
29234
|
+
};
|
|
29235
|
+
setToolResult(toolResult2);
|
|
29236
|
+
}
|
|
29060
29237
|
};
|
|
29061
29238
|
const handleRootsChange = async () => {
|
|
29062
29239
|
await sendNotification({ method: "notifications/roots/list_changed" });
|
|
29063
29240
|
};
|
|
29064
29241
|
const sendLogLevelRequest = async (level) => {
|
|
29065
|
-
await
|
|
29242
|
+
await sendMCPRequest(
|
|
29066
29243
|
{
|
|
29067
29244
|
method: "logging/setLevel",
|
|
29068
29245
|
params: { level }
|
|
@@ -29073,7 +29250,7 @@ const App = () => {
|
|
|
29073
29250
|
};
|
|
29074
29251
|
if (window.location.pathname === "/oauth/callback") {
|
|
29075
29252
|
const OAuthCallback = React$1.lazy(
|
|
29076
|
-
() => __vitePreload(() => import("./OAuthCallback-
|
|
29253
|
+
() => __vitePreload(() => import("./OAuthCallback-C3r8TjnW.js"), true ? [] : void 0)
|
|
29077
29254
|
);
|
|
29078
29255
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthCallback, {}) });
|
|
29079
29256
|
}
|
|
@@ -29251,9 +29428,10 @@ const App = () => {
|
|
|
29251
29428
|
setTools([]);
|
|
29252
29429
|
setNextToolCursor(void 0);
|
|
29253
29430
|
},
|
|
29254
|
-
callTool: (name, params2) => {
|
|
29431
|
+
callTool: async (name, params2) => {
|
|
29255
29432
|
clearError("tools");
|
|
29256
|
-
|
|
29433
|
+
setToolResult(null);
|
|
29434
|
+
await callTool(name, params2);
|
|
29257
29435
|
},
|
|
29258
29436
|
selectedTool,
|
|
29259
29437
|
setSelectedTool: (tool) => {
|
|
@@ -29271,7 +29449,7 @@ const App = () => {
|
|
|
29271
29449
|
PingTab,
|
|
29272
29450
|
{
|
|
29273
29451
|
onPingClick: () => {
|
|
29274
|
-
void
|
|
29452
|
+
void sendMCPRequest(
|
|
29275
29453
|
{
|
|
29276
29454
|
method: "ping"
|
|
29277
29455
|
},
|