@mcpjam/inspector 0.1.4 → 0.1.6
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/LICENSE +200 -21
- package/README.md +2 -2
- package/client/dist/assets/{OAuthCallback-6y8mD7ke.js → OAuthCallback-CBw5QXWv.js} +1 -1
- package/client/dist/assets/{OAuthDebugCallback-B8mHfUnK.js → OAuthDebugCallback-wx6FGFG4.js} +1 -1
- package/client/dist/assets/{index-Be9LHGhj.js → index-CV_1RAbM.js} +906 -183
- package/client/dist/assets/{index-DfXL7p_B.css → index-CmBOF7JI.css} +99 -3
- package/client/dist/index.html +2 -2
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OAuthCallback-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OAuthCallback-CBw5QXWv.js","assets/oauthUtils-DTcoXpSP.js","assets/OAuthDebugCallback-wx6FGFG4.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
@@ -23935,7 +23935,7 @@ class DebugInspectorOAuthClientProvider extends InspectorOAuthClientProvider {
|
|
|
23935
23935
|
);
|
|
23936
23936
|
}
|
|
23937
23937
|
}
|
|
23938
|
-
const version$1 = "0.1.
|
|
23938
|
+
const version$1 = "0.1.6";
|
|
23939
23939
|
const packageJson = {
|
|
23940
23940
|
version: version$1
|
|
23941
23941
|
};
|
|
@@ -27933,7 +27933,9 @@ function useConnection({
|
|
|
27933
27933
|
const propertiesObj = value;
|
|
27934
27934
|
const sanitizedProps = {};
|
|
27935
27935
|
const keyMapping = {};
|
|
27936
|
-
for (const [propKey, propValue] of Object.entries(
|
|
27936
|
+
for (const [propKey, propValue] of Object.entries(
|
|
27937
|
+
propertiesObj
|
|
27938
|
+
)) {
|
|
27937
27939
|
const sanitizedKey = propKey.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
27938
27940
|
keyMapping[propKey] = sanitizedKey;
|
|
27939
27941
|
sanitizedProps[sanitizedKey] = sanitizeSchema(propValue);
|
|
@@ -28060,7 +28062,9 @@ function useConnection({
|
|
|
28060
28062
|
}
|
|
28061
28063
|
}
|
|
28062
28064
|
if (iteration >= MAX_ITERATIONS) {
|
|
28063
|
-
finalText.push(
|
|
28065
|
+
finalText.push(
|
|
28066
|
+
`[Warning: Reached maximum iterations (${MAX_ITERATIONS}). Stopping to prevent excessive API usage.]`
|
|
28067
|
+
);
|
|
28064
28068
|
}
|
|
28065
28069
|
return finalText.join("\n");
|
|
28066
28070
|
}
|
|
@@ -28359,6 +28363,15 @@ const Bell = createLucideIcon("Bell", [
|
|
|
28359
28363
|
["path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9", key: "1qo2s2" }],
|
|
28360
28364
|
["path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0", key: "qgo35s" }]
|
|
28361
28365
|
]);
|
|
28366
|
+
/**
|
|
28367
|
+
* @license lucide-react v0.447.0 - ISC
|
|
28368
|
+
*
|
|
28369
|
+
* This source code is licensed under the ISC license.
|
|
28370
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
28371
|
+
*/
|
|
28372
|
+
const Bookmark = createLucideIcon("Bookmark", [
|
|
28373
|
+
["path", { d: "m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z", key: "1fy3hk" }]
|
|
28374
|
+
]);
|
|
28362
28375
|
/**
|
|
28363
28376
|
* @license lucide-react v0.447.0 - ISC
|
|
28364
28377
|
*
|
|
@@ -28373,6 +28386,18 @@ const Bot = createLucideIcon("Bot", [
|
|
|
28373
28386
|
["path", { d: "M15 13v2", key: "1xurst" }],
|
|
28374
28387
|
["path", { d: "M9 13v2", key: "rq6x2g" }]
|
|
28375
28388
|
]);
|
|
28389
|
+
/**
|
|
28390
|
+
* @license lucide-react v0.447.0 - ISC
|
|
28391
|
+
*
|
|
28392
|
+
* This source code is licensed under the ISC license.
|
|
28393
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
28394
|
+
*/
|
|
28395
|
+
const Calendar = createLucideIcon("Calendar", [
|
|
28396
|
+
["path", { d: "M8 2v4", key: "1cmpym" }],
|
|
28397
|
+
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
28398
|
+
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
28399
|
+
["path", { d: "M3 10h18", key: "8toen8" }]
|
|
28400
|
+
]);
|
|
28376
28401
|
/**
|
|
28377
28402
|
* @license lucide-react v0.447.0 - ISC
|
|
28378
28403
|
*
|
|
@@ -28665,6 +28690,21 @@ const MessageSquare = createLucideIcon("MessageSquare", [
|
|
|
28665
28690
|
* See the LICENSE file in the root directory of this source tree.
|
|
28666
28691
|
*/
|
|
28667
28692
|
const Minus = createLucideIcon("Minus", [["path", { d: "M5 12h14", key: "1ays0h" }]]);
|
|
28693
|
+
/**
|
|
28694
|
+
* @license lucide-react v0.447.0 - ISC
|
|
28695
|
+
*
|
|
28696
|
+
* This source code is licensed under the ISC license.
|
|
28697
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
28698
|
+
*/
|
|
28699
|
+
const Pen = createLucideIcon("Pen", [
|
|
28700
|
+
[
|
|
28701
|
+
"path",
|
|
28702
|
+
{
|
|
28703
|
+
d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
|
|
28704
|
+
key: "1a8usu"
|
|
28705
|
+
}
|
|
28706
|
+
]
|
|
28707
|
+
]);
|
|
28668
28708
|
/**
|
|
28669
28709
|
* @license lucide-react v0.447.0 - ISC
|
|
28670
28710
|
*
|
|
@@ -28788,6 +28828,34 @@ const Settings = createLucideIcon("Settings", [
|
|
|
28788
28828
|
],
|
|
28789
28829
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
28790
28830
|
]);
|
|
28831
|
+
/**
|
|
28832
|
+
* @license lucide-react v0.447.0 - ISC
|
|
28833
|
+
*
|
|
28834
|
+
* This source code is licensed under the ISC license.
|
|
28835
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
28836
|
+
*/
|
|
28837
|
+
const Star = createLucideIcon("Star", [
|
|
28838
|
+
[
|
|
28839
|
+
"polygon",
|
|
28840
|
+
{
|
|
28841
|
+
points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",
|
|
28842
|
+
key: "8f66p6"
|
|
28843
|
+
}
|
|
28844
|
+
]
|
|
28845
|
+
]);
|
|
28846
|
+
/**
|
|
28847
|
+
* @license lucide-react v0.447.0 - ISC
|
|
28848
|
+
*
|
|
28849
|
+
* This source code is licensed under the ISC license.
|
|
28850
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
28851
|
+
*/
|
|
28852
|
+
const Trash2 = createLucideIcon("Trash2", [
|
|
28853
|
+
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
28854
|
+
["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
|
|
28855
|
+
["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }],
|
|
28856
|
+
["line", { x1: "10", x2: "10", y1: "11", y2: "17", key: "1uufr5" }],
|
|
28857
|
+
["line", { x1: "14", x2: "14", y1: "11", y2: "17", key: "xtxkd" }]
|
|
28858
|
+
]);
|
|
28791
28859
|
/**
|
|
28792
28860
|
* @license lucide-react v0.447.0 - ISC
|
|
28793
28861
|
*
|
|
@@ -28798,6 +28866,16 @@ const User = createLucideIcon("User", [
|
|
|
28798
28866
|
["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
|
|
28799
28867
|
["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
|
|
28800
28868
|
]);
|
|
28869
|
+
/**
|
|
28870
|
+
* @license lucide-react v0.447.0 - ISC
|
|
28871
|
+
*
|
|
28872
|
+
* This source code is licensed under the ISC license.
|
|
28873
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
28874
|
+
*/
|
|
28875
|
+
const X$1 = createLucideIcon("X", [
|
|
28876
|
+
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
28877
|
+
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
28878
|
+
]);
|
|
28801
28879
|
const buttonVariants = cva(
|
|
28802
28880
|
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
|
|
28803
28881
|
{
|
|
@@ -29737,7 +29815,7 @@ const HistoryAndNotifications = ({
|
|
|
29737
29815
|
toolResult
|
|
29738
29816
|
}) => {
|
|
29739
29817
|
const [expandedRequests, setExpandedRequests] = reactExports.useState({});
|
|
29740
|
-
const [isHistoryCollapsed, setIsHistoryCollapsed] = reactExports.useState(
|
|
29818
|
+
const [isHistoryCollapsed, setIsHistoryCollapsed] = reactExports.useState(true);
|
|
29741
29819
|
const {
|
|
29742
29820
|
height: historyPaneHeight,
|
|
29743
29821
|
handleDragStart,
|
|
@@ -34305,6 +34383,23 @@ const Label$1 = reactExports.forwardRef(({ className, ...props }, ref2) => /* @_
|
|
|
34305
34383
|
}
|
|
34306
34384
|
));
|
|
34307
34385
|
Label$1.displayName = Root.displayName;
|
|
34386
|
+
const Input = reactExports.forwardRef(
|
|
34387
|
+
({ className, type: type2, ...props }, ref2) => {
|
|
34388
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
34389
|
+
"input",
|
|
34390
|
+
{
|
|
34391
|
+
type: type2,
|
|
34392
|
+
className: cn(
|
|
34393
|
+
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
34394
|
+
className
|
|
34395
|
+
),
|
|
34396
|
+
ref: ref2,
|
|
34397
|
+
...props
|
|
34398
|
+
}
|
|
34399
|
+
);
|
|
34400
|
+
}
|
|
34401
|
+
);
|
|
34402
|
+
Input.displayName = "Input";
|
|
34308
34403
|
const ListPane = ({
|
|
34309
34404
|
items: items2,
|
|
34310
34405
|
listItems,
|
|
@@ -34312,43 +34407,97 @@ const ListPane = ({
|
|
|
34312
34407
|
setSelectedItem,
|
|
34313
34408
|
renderItem,
|
|
34314
34409
|
title: title2,
|
|
34315
|
-
isButtonDisabled
|
|
34316
|
-
|
|
34317
|
-
|
|
34318
|
-
|
|
34319
|
-
|
|
34410
|
+
isButtonDisabled,
|
|
34411
|
+
searchKey,
|
|
34412
|
+
searchPlaceholder = "Search...",
|
|
34413
|
+
buttonText = "Load Items"
|
|
34414
|
+
}) => {
|
|
34415
|
+
const [searchTerm, setSearchTerm] = reactExports.useState("");
|
|
34416
|
+
const filteredItems = reactExports.useMemo(() => {
|
|
34417
|
+
if (!searchTerm.trim()) return items2;
|
|
34418
|
+
return items2.filter((item) => {
|
|
34419
|
+
if (searchKey && item[searchKey]) {
|
|
34420
|
+
const value = item[searchKey];
|
|
34421
|
+
return String(value).toLowerCase().includes(searchTerm.toLowerCase());
|
|
34422
|
+
} else {
|
|
34423
|
+
return Object.values(item).some(
|
|
34424
|
+
(value) => String(value).toLowerCase().includes(searchTerm.toLowerCase())
|
|
34425
|
+
);
|
|
34426
|
+
}
|
|
34427
|
+
});
|
|
34428
|
+
}, [items2, searchTerm, searchKey]);
|
|
34429
|
+
const handleClearItems = () => {
|
|
34430
|
+
clearItems();
|
|
34431
|
+
setSearchTerm("");
|
|
34432
|
+
};
|
|
34433
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-card rounded-lg shadow", children: [
|
|
34434
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4 border-b border-gray-200 dark:border-gray-800 flex items-center justify-between", children: [
|
|
34435
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold dark:text-white", children: title2 }),
|
|
34436
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-1", children: [
|
|
34437
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
34438
|
+
Button,
|
|
34439
|
+
{
|
|
34440
|
+
variant: "outline",
|
|
34441
|
+
onClick: listItems,
|
|
34442
|
+
disabled: isButtonDisabled,
|
|
34443
|
+
className: "h-7 px-2 text-xs",
|
|
34444
|
+
children: buttonText
|
|
34445
|
+
}
|
|
34446
|
+
),
|
|
34447
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
34448
|
+
Button,
|
|
34449
|
+
{
|
|
34450
|
+
variant: "outline",
|
|
34451
|
+
onClick: handleClearItems,
|
|
34452
|
+
disabled: items2.length === 0,
|
|
34453
|
+
className: "h-7 px-2 text-xs",
|
|
34454
|
+
children: "Clear"
|
|
34455
|
+
}
|
|
34456
|
+
)
|
|
34457
|
+
] })
|
|
34458
|
+
] }),
|
|
34459
|
+
items2.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4 border-b border-gray-200 dark:border-gray-800", children: [
|
|
34320
34460
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
34321
|
-
|
|
34461
|
+
Input,
|
|
34322
34462
|
{
|
|
34323
|
-
|
|
34324
|
-
|
|
34325
|
-
|
|
34326
|
-
|
|
34327
|
-
|
|
34463
|
+
type: "text",
|
|
34464
|
+
placeholder: searchPlaceholder,
|
|
34465
|
+
value: searchTerm,
|
|
34466
|
+
onChange: (e) => setSearchTerm(e.target.value),
|
|
34467
|
+
className: "h-8 text-sm"
|
|
34328
34468
|
}
|
|
34329
34469
|
),
|
|
34330
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
34331
|
-
|
|
34332
|
-
|
|
34333
|
-
|
|
34334
|
-
|
|
34335
|
-
|
|
34336
|
-
|
|
34337
|
-
|
|
34338
|
-
|
|
34339
|
-
|
|
34340
|
-
|
|
34341
|
-
|
|
34342
|
-
|
|
34343
|
-
|
|
34344
|
-
|
|
34345
|
-
|
|
34346
|
-
|
|
34347
|
-
|
|
34348
|
-
|
|
34349
|
-
|
|
34350
|
-
|
|
34351
|
-
|
|
34470
|
+
searchTerm && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-gray-500 dark:text-gray-400 mt-2", children: [
|
|
34471
|
+
"Showing ",
|
|
34472
|
+
filteredItems.length,
|
|
34473
|
+
" of ",
|
|
34474
|
+
items2.length,
|
|
34475
|
+
" items"
|
|
34476
|
+
] })
|
|
34477
|
+
] }),
|
|
34478
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2 overflow-y-auto max-h-96", children: filteredItems.length > 0 ? filteredItems.map((item, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
34479
|
+
"div",
|
|
34480
|
+
{
|
|
34481
|
+
className: "cursor-pointer",
|
|
34482
|
+
onClick: () => setSelectedItem(item),
|
|
34483
|
+
children: renderItem(item)
|
|
34484
|
+
},
|
|
34485
|
+
index2
|
|
34486
|
+
)) : searchTerm ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-center py-8 text-gray-500 dark:text-gray-400", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm", children: [
|
|
34487
|
+
'No items found matching "',
|
|
34488
|
+
searchTerm,
|
|
34489
|
+
'"'
|
|
34490
|
+
] }) }) : filteredItems.map((item, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
34491
|
+
"div",
|
|
34492
|
+
{
|
|
34493
|
+
className: "cursor-pointer",
|
|
34494
|
+
onClick: () => setSelectedItem(item),
|
|
34495
|
+
children: renderItem(item)
|
|
34496
|
+
},
|
|
34497
|
+
index2
|
|
34498
|
+
)) }) })
|
|
34499
|
+
] });
|
|
34500
|
+
};
|
|
34352
34501
|
function debounce(func, wait) {
|
|
34353
34502
|
let timeout;
|
|
34354
34503
|
return (...args) => {
|
|
@@ -34491,7 +34640,8 @@ const PromptsTab = ({
|
|
|
34491
34640
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-gray-500", children: prompt.description })
|
|
34492
34641
|
] }),
|
|
34493
34642
|
title: "Prompts",
|
|
34494
|
-
isButtonDisabled: !nextCursor && prompts.length > 0
|
|
34643
|
+
isButtonDisabled: !nextCursor && prompts.length > 0,
|
|
34644
|
+
buttonText: "Load Prompts"
|
|
34495
34645
|
}
|
|
34496
34646
|
),
|
|
34497
34647
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-card rounded-lg shadow", children: [
|
|
@@ -34605,7 +34755,8 @@ const ResourcesTab = ({
|
|
|
34605
34755
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "w-4 h-4 flex-shrink-0 text-gray-400" })
|
|
34606
34756
|
] }),
|
|
34607
34757
|
title: "Resources",
|
|
34608
|
-
isButtonDisabled: !nextCursor && resources.length > 0
|
|
34758
|
+
isButtonDisabled: !nextCursor && resources.length > 0,
|
|
34759
|
+
buttonText: "Load Resources"
|
|
34609
34760
|
}
|
|
34610
34761
|
),
|
|
34611
34762
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -34631,7 +34782,8 @@ const ResourcesTab = ({
|
|
|
34631
34782
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "w-4 h-4 flex-shrink-0 text-gray-400" })
|
|
34632
34783
|
] }),
|
|
34633
34784
|
title: "Resource Templates",
|
|
34634
|
-
isButtonDisabled: !nextTemplateCursor && resourceTemplates.length > 0
|
|
34785
|
+
isButtonDisabled: !nextTemplateCursor && resourceTemplates.length > 0,
|
|
34786
|
+
buttonText: "Load Templates"
|
|
34635
34787
|
}
|
|
34636
34788
|
),
|
|
34637
34789
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-card rounded-lg shadow", children: [
|
|
@@ -34718,23 +34870,6 @@ const ResourcesTab = ({
|
|
|
34718
34870
|
] })
|
|
34719
34871
|
] });
|
|
34720
34872
|
};
|
|
34721
|
-
const Input = reactExports.forwardRef(
|
|
34722
|
-
({ className, type: type2, ...props }, ref2) => {
|
|
34723
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
34724
|
-
"input",
|
|
34725
|
-
{
|
|
34726
|
-
type: type2,
|
|
34727
|
-
className: cn(
|
|
34728
|
-
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
34729
|
-
className
|
|
34730
|
-
),
|
|
34731
|
-
ref: ref2,
|
|
34732
|
-
...props
|
|
34733
|
-
}
|
|
34734
|
-
);
|
|
34735
|
-
}
|
|
34736
|
-
);
|
|
34737
|
-
Input.displayName = "Input";
|
|
34738
34873
|
const RootsTab = ({
|
|
34739
34874
|
roots,
|
|
34740
34875
|
setRoots,
|
|
@@ -36724,7 +36859,7 @@ const JsonEditor = ({
|
|
|
36724
36859
|
] });
|
|
36725
36860
|
};
|
|
36726
36861
|
function generateDefaultValue(schema) {
|
|
36727
|
-
if ("default" in schema) {
|
|
36862
|
+
if ("default" in schema && schema.default !== void 0) {
|
|
36728
36863
|
return schema.default;
|
|
36729
36864
|
}
|
|
36730
36865
|
if (!schema.required) {
|
|
@@ -37440,18 +37575,291 @@ const Textarea = reactExports.forwardRef(
|
|
|
37440
37575
|
}
|
|
37441
37576
|
);
|
|
37442
37577
|
Textarea.displayName = "Textarea";
|
|
37443
|
-
|
|
37578
|
+
function generateRequestId() {
|
|
37579
|
+
return `req_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
37580
|
+
}
|
|
37581
|
+
function createMcpJamRequest(input) {
|
|
37582
|
+
const now = /* @__PURE__ */ new Date();
|
|
37583
|
+
return {
|
|
37584
|
+
id: generateRequestId(),
|
|
37585
|
+
name: input.name,
|
|
37586
|
+
description: input.description,
|
|
37587
|
+
toolName: input.toolName,
|
|
37588
|
+
tool: input.tool,
|
|
37589
|
+
parameters: input.parameters,
|
|
37590
|
+
createdAt: now,
|
|
37591
|
+
updatedAt: now,
|
|
37592
|
+
tags: input.tags || [],
|
|
37593
|
+
isFavorite: input.isFavorite || false
|
|
37594
|
+
};
|
|
37595
|
+
}
|
|
37596
|
+
function generateDefaultRequestName(tool, parameters) {
|
|
37597
|
+
const toolName = tool.name;
|
|
37598
|
+
const meaningfulParams = Object.entries(parameters).filter(
|
|
37599
|
+
([, value]) => value && typeof value === "string" && value.length > 0
|
|
37600
|
+
).slice(0, 1);
|
|
37601
|
+
if (meaningfulParams.length > 0) {
|
|
37602
|
+
const [, paramValue] = meaningfulParams[0];
|
|
37603
|
+
const shortValue = String(paramValue).slice(0, 30);
|
|
37604
|
+
return `${toolName} - ${shortValue}${String(paramValue).length > 30 ? "..." : ""}`;
|
|
37605
|
+
}
|
|
37606
|
+
return `${toolName} Request`;
|
|
37607
|
+
}
|
|
37608
|
+
function exportRequestCollection(requests) {
|
|
37609
|
+
return {
|
|
37610
|
+
requests,
|
|
37611
|
+
version: "1.0.0",
|
|
37612
|
+
exportedAt: /* @__PURE__ */ new Date()
|
|
37613
|
+
};
|
|
37614
|
+
}
|
|
37615
|
+
function importRequestCollection(data2) {
|
|
37616
|
+
return data2.requests.map((request) => ({
|
|
37617
|
+
...request,
|
|
37618
|
+
createdAt: new Date(request.createdAt),
|
|
37619
|
+
updatedAt: new Date(request.updatedAt)
|
|
37620
|
+
}));
|
|
37621
|
+
}
|
|
37622
|
+
function sortRequests(requests, sortBy, order = "desc") {
|
|
37623
|
+
return [...requests].sort((a, b) => {
|
|
37624
|
+
let comparison = 0;
|
|
37625
|
+
switch (sortBy) {
|
|
37626
|
+
case "name":
|
|
37627
|
+
comparison = a.name.localeCompare(b.name);
|
|
37628
|
+
break;
|
|
37629
|
+
case "toolName":
|
|
37630
|
+
comparison = a.toolName.localeCompare(b.toolName);
|
|
37631
|
+
break;
|
|
37632
|
+
case "createdAt":
|
|
37633
|
+
comparison = a.createdAt.getTime() - b.createdAt.getTime();
|
|
37634
|
+
break;
|
|
37635
|
+
case "updatedAt":
|
|
37636
|
+
comparison = a.updatedAt.getTime() - b.updatedAt.getTime();
|
|
37637
|
+
break;
|
|
37638
|
+
}
|
|
37639
|
+
return order === "asc" ? comparison : -comparison;
|
|
37640
|
+
});
|
|
37641
|
+
}
|
|
37642
|
+
const STORAGE_KEY$1 = "mcpjam_saved_requests";
|
|
37643
|
+
class RequestStorage {
|
|
37644
|
+
/**
|
|
37645
|
+
* Loads all saved requests from localStorage
|
|
37646
|
+
*/
|
|
37647
|
+
static loadRequests() {
|
|
37648
|
+
try {
|
|
37649
|
+
const stored = localStorage.getItem(STORAGE_KEY$1);
|
|
37650
|
+
if (!stored) return [];
|
|
37651
|
+
const data2 = JSON.parse(stored);
|
|
37652
|
+
return importRequestCollection(data2);
|
|
37653
|
+
} catch (error) {
|
|
37654
|
+
console.error("Failed to load saved requests:", error);
|
|
37655
|
+
return [];
|
|
37656
|
+
}
|
|
37657
|
+
}
|
|
37658
|
+
/**
|
|
37659
|
+
* Saves all requests to localStorage
|
|
37660
|
+
*/
|
|
37661
|
+
static saveRequests(requests) {
|
|
37662
|
+
try {
|
|
37663
|
+
const collection = exportRequestCollection(requests);
|
|
37664
|
+
localStorage.setItem(STORAGE_KEY$1, JSON.stringify(collection));
|
|
37665
|
+
} catch (error) {
|
|
37666
|
+
console.error("Failed to save requests:", error);
|
|
37667
|
+
throw new Error("Failed to save requests to storage");
|
|
37668
|
+
}
|
|
37669
|
+
}
|
|
37670
|
+
/**
|
|
37671
|
+
* Adds a new request to storage
|
|
37672
|
+
*/
|
|
37673
|
+
static addRequest(request) {
|
|
37674
|
+
const existing = this.loadRequests();
|
|
37675
|
+
const updated = [...existing, request];
|
|
37676
|
+
this.saveRequests(updated);
|
|
37677
|
+
}
|
|
37678
|
+
/**
|
|
37679
|
+
* Updates an existing request in storage
|
|
37680
|
+
*/
|
|
37681
|
+
static updateRequest(requestId, updates) {
|
|
37682
|
+
const existing = this.loadRequests();
|
|
37683
|
+
const index2 = existing.findIndex((r2) => r2.id === requestId);
|
|
37684
|
+
if (index2 === -1) {
|
|
37685
|
+
throw new Error(`Request with ID ${requestId} not found`);
|
|
37686
|
+
}
|
|
37687
|
+
existing[index2] = { ...existing[index2], ...updates, updatedAt: /* @__PURE__ */ new Date() };
|
|
37688
|
+
this.saveRequests(existing);
|
|
37689
|
+
}
|
|
37690
|
+
/**
|
|
37691
|
+
* Removes a request from storage
|
|
37692
|
+
*/
|
|
37693
|
+
static removeRequest(requestId) {
|
|
37694
|
+
const existing = this.loadRequests();
|
|
37695
|
+
const filtered = existing.filter((r2) => r2.id !== requestId);
|
|
37696
|
+
this.saveRequests(filtered);
|
|
37697
|
+
}
|
|
37698
|
+
/**
|
|
37699
|
+
* Gets a specific request by ID
|
|
37700
|
+
*/
|
|
37701
|
+
static getRequest(requestId) {
|
|
37702
|
+
const requests = this.loadRequests();
|
|
37703
|
+
return requests.find((r2) => r2.id === requestId) || null;
|
|
37704
|
+
}
|
|
37705
|
+
/**
|
|
37706
|
+
* Checks if a request with the given ID exists
|
|
37707
|
+
*/
|
|
37708
|
+
static hasRequest(requestId) {
|
|
37709
|
+
return this.getRequest(requestId) !== null;
|
|
37710
|
+
}
|
|
37711
|
+
/**
|
|
37712
|
+
* Clears all saved requests
|
|
37713
|
+
*/
|
|
37714
|
+
static clearAll() {
|
|
37715
|
+
localStorage.removeItem(STORAGE_KEY$1);
|
|
37716
|
+
}
|
|
37717
|
+
/**
|
|
37718
|
+
* Exports all requests as a JSON string for backup/sharing
|
|
37719
|
+
*/
|
|
37720
|
+
static exportToJson() {
|
|
37721
|
+
const requests = this.loadRequests();
|
|
37722
|
+
const collection = exportRequestCollection(requests);
|
|
37723
|
+
return JSON.stringify(collection, null, 2);
|
|
37724
|
+
}
|
|
37725
|
+
/**
|
|
37726
|
+
* Imports requests from a JSON string (merges with existing)
|
|
37727
|
+
*/
|
|
37728
|
+
static importFromJson(jsonString, merge = true) {
|
|
37729
|
+
try {
|
|
37730
|
+
const data2 = JSON.parse(jsonString);
|
|
37731
|
+
const importedRequests = importRequestCollection(data2);
|
|
37732
|
+
if (merge) {
|
|
37733
|
+
const existing = this.loadRequests();
|
|
37734
|
+
const existingIds = new Set(existing.map((r2) => r2.id));
|
|
37735
|
+
const newRequests = importedRequests.filter(
|
|
37736
|
+
(r2) => !existingIds.has(r2.id)
|
|
37737
|
+
);
|
|
37738
|
+
const merged = [...existing, ...newRequests];
|
|
37739
|
+
this.saveRequests(merged);
|
|
37740
|
+
} else {
|
|
37741
|
+
this.saveRequests(importedRequests);
|
|
37742
|
+
}
|
|
37743
|
+
} catch (error) {
|
|
37744
|
+
console.error("Failed to import requests:", error);
|
|
37745
|
+
throw new Error("Invalid JSON format or corrupted data");
|
|
37746
|
+
}
|
|
37747
|
+
}
|
|
37748
|
+
/**
|
|
37749
|
+
* Gets storage statistics
|
|
37750
|
+
*/
|
|
37751
|
+
static getStats() {
|
|
37752
|
+
const requests = this.loadRequests();
|
|
37753
|
+
const stored = localStorage.getItem(STORAGE_KEY$1);
|
|
37754
|
+
const toolCounts = {};
|
|
37755
|
+
let favoriteCount = 0;
|
|
37756
|
+
for (const request of requests) {
|
|
37757
|
+
if (request.isFavorite) favoriteCount++;
|
|
37758
|
+
toolCounts[request.toolName] = (toolCounts[request.toolName] || 0) + 1;
|
|
37759
|
+
}
|
|
37760
|
+
return {
|
|
37761
|
+
totalRequests: requests.length,
|
|
37762
|
+
totalSize: stored ? new Blob([stored]).size : 0,
|
|
37763
|
+
favoriteCount,
|
|
37764
|
+
toolCounts
|
|
37765
|
+
};
|
|
37766
|
+
}
|
|
37767
|
+
}
|
|
37768
|
+
const ToolRunCard = ({
|
|
37769
|
+
selectedTool,
|
|
37770
|
+
callTool: callTool2,
|
|
37771
|
+
loadedRequest
|
|
37772
|
+
}) => {
|
|
37444
37773
|
const [params, setParams] = reactExports.useState({});
|
|
37445
37774
|
const [isToolRunning, setIsToolRunning] = reactExports.useState(false);
|
|
37775
|
+
const [showSaveDialog, setShowSaveDialog] = reactExports.useState(false);
|
|
37776
|
+
const [saveRequestName, setSaveRequestName] = reactExports.useState("");
|
|
37777
|
+
const [saveRequestDescription, setSaveRequestDescription] = reactExports.useState("");
|
|
37778
|
+
const [isSaving, setIsSaving] = reactExports.useState(false);
|
|
37779
|
+
const [paramsInitialized, setParamsInitialized] = reactExports.useState(false);
|
|
37780
|
+
const [currentRequestId, setCurrentRequestId] = reactExports.useState(null);
|
|
37446
37781
|
reactExports.useEffect(() => {
|
|
37447
|
-
|
|
37448
|
-
|
|
37449
|
-
|
|
37450
|
-
|
|
37451
|
-
|
|
37452
|
-
|
|
37453
|
-
|
|
37454
|
-
|
|
37782
|
+
setParamsInitialized(false);
|
|
37783
|
+
setCurrentRequestId(null);
|
|
37784
|
+
}, [selectedTool == null ? void 0 : selectedTool.name]);
|
|
37785
|
+
reactExports.useEffect(() => {
|
|
37786
|
+
if (loadedRequest && selectedTool && loadedRequest.toolName === selectedTool.name) {
|
|
37787
|
+
setParams(loadedRequest.parameters);
|
|
37788
|
+
setParamsInitialized(true);
|
|
37789
|
+
setCurrentRequestId(loadedRequest.id);
|
|
37790
|
+
} else if (selectedTool && !paramsInitialized) {
|
|
37791
|
+
const params2 = Object.entries(
|
|
37792
|
+
(selectedTool == null ? void 0 : selectedTool.inputSchema.properties) ?? []
|
|
37793
|
+
).map(([key, value]) => {
|
|
37794
|
+
const defaultValue = generateDefaultValue(value);
|
|
37795
|
+
return [key, defaultValue];
|
|
37796
|
+
});
|
|
37797
|
+
const paramsObject = Object.fromEntries(params2);
|
|
37798
|
+
setParams(paramsObject);
|
|
37799
|
+
setParamsInitialized(true);
|
|
37800
|
+
setCurrentRequestId(null);
|
|
37801
|
+
}
|
|
37802
|
+
}, [selectedTool, loadedRequest, paramsInitialized]);
|
|
37803
|
+
const handleSaveRequest = async () => {
|
|
37804
|
+
if (!selectedTool) return;
|
|
37805
|
+
try {
|
|
37806
|
+
setIsSaving(true);
|
|
37807
|
+
if (currentRequestId) {
|
|
37808
|
+
const updateInput = {
|
|
37809
|
+
parameters: params
|
|
37810
|
+
};
|
|
37811
|
+
if (saveRequestName.trim()) {
|
|
37812
|
+
updateInput.name = saveRequestName;
|
|
37813
|
+
}
|
|
37814
|
+
if (saveRequestDescription.trim()) {
|
|
37815
|
+
updateInput.description = saveRequestDescription;
|
|
37816
|
+
}
|
|
37817
|
+
RequestStorage.updateRequest(currentRequestId, updateInput);
|
|
37818
|
+
} else {
|
|
37819
|
+
const requestInput = {
|
|
37820
|
+
name: saveRequestName || generateDefaultRequestName(
|
|
37821
|
+
selectedTool,
|
|
37822
|
+
params
|
|
37823
|
+
),
|
|
37824
|
+
description: saveRequestDescription,
|
|
37825
|
+
toolName: selectedTool.name,
|
|
37826
|
+
tool: selectedTool,
|
|
37827
|
+
parameters: params,
|
|
37828
|
+
tags: [],
|
|
37829
|
+
isFavorite: false
|
|
37830
|
+
};
|
|
37831
|
+
const request = createMcpJamRequest(requestInput);
|
|
37832
|
+
RequestStorage.addRequest(request);
|
|
37833
|
+
setCurrentRequestId(request.id);
|
|
37834
|
+
}
|
|
37835
|
+
setShowSaveDialog(false);
|
|
37836
|
+
setSaveRequestName("");
|
|
37837
|
+
setSaveRequestDescription("");
|
|
37838
|
+
window.dispatchEvent(new CustomEvent("requestSaved"));
|
|
37839
|
+
} catch (error) {
|
|
37840
|
+
console.error("Failed to save request:", error);
|
|
37841
|
+
alert("Failed to save request. Please try again.");
|
|
37842
|
+
} finally {
|
|
37843
|
+
setIsSaving(false);
|
|
37844
|
+
}
|
|
37845
|
+
};
|
|
37846
|
+
const openSaveDialog = () => {
|
|
37847
|
+
if (!selectedTool) return;
|
|
37848
|
+
if (currentRequestId && loadedRequest) {
|
|
37849
|
+
setSaveRequestName(loadedRequest.name);
|
|
37850
|
+
setSaveRequestDescription(loadedRequest.description || "");
|
|
37851
|
+
} else {
|
|
37852
|
+
setSaveRequestName(
|
|
37853
|
+
generateDefaultRequestName(
|
|
37854
|
+
selectedTool,
|
|
37855
|
+
params
|
|
37856
|
+
)
|
|
37857
|
+
);
|
|
37858
|
+
setSaveRequestDescription("");
|
|
37859
|
+
}
|
|
37860
|
+
setShowSaveDialog(true);
|
|
37861
|
+
};
|
|
37862
|
+
const isUpdatingExistingRequest = currentRequestId !== null;
|
|
37455
37863
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-gradient-to-br from-card/95 via-card to-card/95 backdrop-blur-sm rounded-xl shadow-lg border border-border/40 overflow-hidden transition-all duration-300 hover:shadow-xl hover:border-border/60", children: [
|
|
37456
37864
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-gradient-to-r from-muted/50 via-muted/30 to-muted/50 backdrop-blur-sm p-3 border-b border-border/30", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
|
|
37457
37865
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "font-mono text-sm bg-gradient-to-r from-secondary/70 to-secondary/50 px-3 py-1.5 rounded-lg border border-border/30 text-foreground font-semibold shadow-sm inline-block", children: selectedTool ? selectedTool.name : "Select a tool" }),
|
|
@@ -37532,11 +37940,28 @@ const ToolRunCard = ({ selectedTool, callTool: callTool2 }) => {
|
|
|
37532
37940
|
id: key,
|
|
37533
37941
|
name: key,
|
|
37534
37942
|
placeholder: prop.description || `Enter ${key}...`,
|
|
37535
|
-
value: params[key]
|
|
37536
|
-
onChange: (e) =>
|
|
37537
|
-
|
|
37538
|
-
|
|
37539
|
-
|
|
37943
|
+
value: params[key] !== void 0 && params[key] !== null ? String(params[key]) : "",
|
|
37944
|
+
onChange: (e) => {
|
|
37945
|
+
const value2 = e.target.value;
|
|
37946
|
+
let newParams;
|
|
37947
|
+
if (value2 === "") {
|
|
37948
|
+
newParams = {
|
|
37949
|
+
...params,
|
|
37950
|
+
[key]: void 0
|
|
37951
|
+
};
|
|
37952
|
+
} else {
|
|
37953
|
+
const numValue = Number(value2);
|
|
37954
|
+
if (!isNaN(numValue)) {
|
|
37955
|
+
newParams = {
|
|
37956
|
+
...params,
|
|
37957
|
+
[key]: numValue
|
|
37958
|
+
};
|
|
37959
|
+
} else {
|
|
37960
|
+
return;
|
|
37961
|
+
}
|
|
37962
|
+
}
|
|
37963
|
+
setParams(newParams);
|
|
37964
|
+
},
|
|
37540
37965
|
className: "font-mono text-xs bg-gradient-to-br from-background/80 to-background/60 border-border/40 rounded-lg focus:border-primary/50 focus:ring-1 focus:ring-primary/20 transition-all duration-200 h-8"
|
|
37541
37966
|
}
|
|
37542
37967
|
) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-gradient-to-br from-background/80 to-background/60 border border-border/40 rounded-lg p-2.5 hover:border-border/60 transition-all duration-200", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -37560,28 +37985,111 @@ const ToolRunCard = ({ selectedTool, callTool: callTool2 }) => {
|
|
|
37560
37985
|
] }, key);
|
|
37561
37986
|
}) })
|
|
37562
37987
|
] }),
|
|
37563
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
37564
|
-
|
|
37565
|
-
|
|
37566
|
-
|
|
37567
|
-
|
|
37568
|
-
|
|
37569
|
-
|
|
37570
|
-
|
|
37571
|
-
|
|
37988
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "pt-2 border-t border-border/20 space-y-2", children: [
|
|
37989
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex space-x-2", children: [
|
|
37990
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
37991
|
+
Button,
|
|
37992
|
+
{
|
|
37993
|
+
onClick: openSaveDialog,
|
|
37994
|
+
variant: "outline",
|
|
37995
|
+
className: "flex-1 h-8 bg-gradient-to-r from-secondary/20 to-secondary/10 hover:from-secondary/30 hover:to-secondary/20 text-foreground font-medium rounded-lg border-border/40 hover:border-border/60 transition-all duration-300 text-xs",
|
|
37996
|
+
children: [
|
|
37997
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Save, { className: "w-3.5 h-3.5 mr-2" }),
|
|
37998
|
+
isUpdatingExistingRequest ? "Update Request" : "Save Request"
|
|
37999
|
+
]
|
|
37572
38000
|
}
|
|
37573
|
-
|
|
37574
|
-
|
|
37575
|
-
|
|
37576
|
-
|
|
37577
|
-
|
|
37578
|
-
|
|
37579
|
-
|
|
37580
|
-
|
|
37581
|
-
|
|
38001
|
+
),
|
|
38002
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38003
|
+
Button,
|
|
38004
|
+
{
|
|
38005
|
+
onClick: async () => {
|
|
38006
|
+
try {
|
|
38007
|
+
setIsToolRunning(true);
|
|
38008
|
+
await callTool2(selectedTool.name, params);
|
|
38009
|
+
} finally {
|
|
38010
|
+
setIsToolRunning(false);
|
|
38011
|
+
}
|
|
38012
|
+
},
|
|
38013
|
+
disabled: isToolRunning,
|
|
38014
|
+
className: "flex-1 h-8 bg-gradient-to-r from-primary to-primary/90 hover:from-primary/90 hover:to-primary/80 text-primary-foreground font-medium rounded-lg shadow-md hover:shadow-lg transition-all duration-300 transform hover:scale-[1.01] active:scale-[0.99] text-xs",
|
|
38015
|
+
children: isToolRunning ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
38016
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "w-3.5 h-3.5 mr-2 animate-spin" }),
|
|
38017
|
+
"Executing..."
|
|
38018
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
38019
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Send, { className: "w-3.5 h-3.5 mr-2" }),
|
|
38020
|
+
"Run Tool"
|
|
38021
|
+
] })
|
|
38022
|
+
}
|
|
38023
|
+
)
|
|
38024
|
+
] }),
|
|
38025
|
+
showSaveDialog && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-card border border-border rounded-xl shadow-xl p-4 w-full max-w-md mx-4", children: [
|
|
38026
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between mb-3", children: [
|
|
38027
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-sm font-semibold text-foreground", children: isUpdatingExistingRequest ? "Update Request" : "Save Request" }),
|
|
38028
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38029
|
+
Button,
|
|
38030
|
+
{
|
|
38031
|
+
onClick: () => setShowSaveDialog(false),
|
|
38032
|
+
variant: "ghost",
|
|
38033
|
+
size: "sm",
|
|
38034
|
+
className: "h-6 w-6 p-0 hover:bg-muted",
|
|
38035
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(X$1, { className: "w-3.5 h-3.5" })
|
|
38036
|
+
}
|
|
38037
|
+
)
|
|
38038
|
+
] }),
|
|
38039
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
|
|
38040
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
38041
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-xs font-medium text-muted-foreground mb-1 block", children: "Request Name" }),
|
|
38042
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38043
|
+
Input,
|
|
38044
|
+
{
|
|
38045
|
+
value: saveRequestName,
|
|
38046
|
+
onChange: (e) => setSaveRequestName(e.target.value),
|
|
38047
|
+
placeholder: "Enter request name...",
|
|
38048
|
+
className: "text-xs h-8"
|
|
38049
|
+
}
|
|
38050
|
+
)
|
|
38051
|
+
] }),
|
|
38052
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
38053
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-xs font-medium text-muted-foreground mb-1 block", children: "Description (optional)" }),
|
|
38054
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38055
|
+
Textarea,
|
|
38056
|
+
{
|
|
38057
|
+
value: saveRequestDescription,
|
|
38058
|
+
onChange: (e) => setSaveRequestDescription(e.target.value),
|
|
38059
|
+
placeholder: "Enter description...",
|
|
38060
|
+
className: "text-xs min-h-[60px] resize-none"
|
|
38061
|
+
}
|
|
38062
|
+
)
|
|
38063
|
+
] }),
|
|
38064
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex space-x-2 pt-2", children: [
|
|
38065
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38066
|
+
Button,
|
|
38067
|
+
{
|
|
38068
|
+
onClick: () => setShowSaveDialog(false),
|
|
38069
|
+
variant: "outline",
|
|
38070
|
+
className: "flex-1 h-8 text-xs",
|
|
38071
|
+
children: "Cancel"
|
|
38072
|
+
}
|
|
38073
|
+
),
|
|
38074
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38075
|
+
Button,
|
|
38076
|
+
{
|
|
38077
|
+
onClick: handleSaveRequest,
|
|
38078
|
+
disabled: isSaving,
|
|
38079
|
+
className: "flex-1 h-8 text-xs",
|
|
38080
|
+
children: isSaving ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
38081
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "w-3.5 h-3.5 mr-2 animate-spin" }),
|
|
38082
|
+
isUpdatingExistingRequest ? "Updating..." : "Saving..."
|
|
38083
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
38084
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Save, { className: "w-3.5 h-3.5 mr-2" }),
|
|
38085
|
+
isUpdatingExistingRequest ? "Update" : "Save"
|
|
38086
|
+
] })
|
|
38087
|
+
}
|
|
38088
|
+
)
|
|
38089
|
+
] })
|
|
37582
38090
|
] })
|
|
37583
|
-
}
|
|
37584
|
-
|
|
38091
|
+
] }) })
|
|
38092
|
+
] })
|
|
37585
38093
|
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center py-6 text-center", children: [
|
|
37586
38094
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-10 h-10 rounded-xl bg-gradient-to-br from-muted/30 to-muted/50 flex items-center justify-center mb-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CodeXml, { className: "w-5 h-5 text-muted-foreground/60" }) }),
|
|
37587
38095
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "text-sm font-semibold text-foreground mb-1", children: "Ready to Execute" }),
|
|
@@ -37597,13 +38105,24 @@ const ToolsTab = ({
|
|
|
37597
38105
|
selectedTool,
|
|
37598
38106
|
setSelectedTool,
|
|
37599
38107
|
nextCursor,
|
|
37600
|
-
connectionStatus
|
|
38108
|
+
connectionStatus,
|
|
38109
|
+
loadedRequest
|
|
37601
38110
|
}) => {
|
|
37602
38111
|
reactExports.useEffect(() => {
|
|
37603
38112
|
if (connectionStatus === "connected") {
|
|
37604
38113
|
listTools2();
|
|
37605
38114
|
}
|
|
37606
38115
|
}, [connectionStatus]);
|
|
38116
|
+
reactExports.useEffect(() => {
|
|
38117
|
+
if (loadedRequest && tools.length > 0) {
|
|
38118
|
+
const matchingTool = tools.find(
|
|
38119
|
+
(tool) => tool.name === loadedRequest.toolName
|
|
38120
|
+
);
|
|
38121
|
+
if (matchingTool) {
|
|
38122
|
+
setSelectedTool(matchingTool);
|
|
38123
|
+
}
|
|
38124
|
+
}
|
|
38125
|
+
}, [loadedRequest, tools, setSelectedTool]);
|
|
37607
38126
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
37608
38127
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
37609
38128
|
ListPane,
|
|
@@ -37633,10 +38152,20 @@ const ToolsTab = ({
|
|
|
37633
38152
|
] }) });
|
|
37634
38153
|
},
|
|
37635
38154
|
title: "Tools",
|
|
37636
|
-
isButtonDisabled: !nextCursor && tools.length > 0
|
|
38155
|
+
isButtonDisabled: !nextCursor && tools.length > 0,
|
|
38156
|
+
searchKey: "name",
|
|
38157
|
+
searchPlaceholder: "Search tools by name...",
|
|
38158
|
+
buttonText: "Load Tools"
|
|
37637
38159
|
}
|
|
37638
38160
|
),
|
|
37639
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38161
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38162
|
+
ToolRunCard,
|
|
38163
|
+
{
|
|
38164
|
+
selectedTool,
|
|
38165
|
+
callTool: callTool2,
|
|
38166
|
+
loadedRequest
|
|
38167
|
+
}
|
|
38168
|
+
)
|
|
37640
38169
|
] });
|
|
37641
38170
|
};
|
|
37642
38171
|
const McpClientContext = reactExports.createContext(null);
|
|
@@ -39165,19 +39694,88 @@ const useTheme = () => {
|
|
|
39165
39694
|
[theme, setThemeWithSideEffect]
|
|
39166
39695
|
);
|
|
39167
39696
|
};
|
|
39168
|
-
const version = "0.1.
|
|
39169
|
-
const Sidebar = ({
|
|
39170
|
-
currentPage,
|
|
39171
|
-
onPageChange,
|
|
39172
|
-
serverCapabilities,
|
|
39173
|
-
pendingSampleRequests,
|
|
39174
|
-
shouldDisableAll
|
|
39175
|
-
}) => {
|
|
39697
|
+
const version = "0.1.6";
|
|
39698
|
+
const Sidebar = ({ onPageChange, onLoadRequest }) => {
|
|
39176
39699
|
const [theme, setTheme] = useTheme();
|
|
39700
|
+
const [savedRequests, setSavedRequests] = reactExports.useState([]);
|
|
39701
|
+
const [renamingRequestId, setRenamingRequestId] = reactExports.useState(
|
|
39702
|
+
null
|
|
39703
|
+
);
|
|
39704
|
+
const [renameValue, setRenameValue] = reactExports.useState("");
|
|
39705
|
+
reactExports.useEffect(() => {
|
|
39706
|
+
const loadSavedRequests = () => {
|
|
39707
|
+
const requests = RequestStorage.loadRequests();
|
|
39708
|
+
const sortedRequests = sortRequests(requests, "updatedAt", "desc");
|
|
39709
|
+
setSavedRequests(sortedRequests);
|
|
39710
|
+
};
|
|
39711
|
+
loadSavedRequests();
|
|
39712
|
+
const handleStorageChange = () => {
|
|
39713
|
+
loadSavedRequests();
|
|
39714
|
+
};
|
|
39715
|
+
window.addEventListener("storage", handleStorageChange);
|
|
39716
|
+
window.addEventListener("requestSaved", handleStorageChange);
|
|
39717
|
+
return () => {
|
|
39718
|
+
window.removeEventListener("storage", handleStorageChange);
|
|
39719
|
+
window.removeEventListener("requestSaved", handleStorageChange);
|
|
39720
|
+
};
|
|
39721
|
+
}, []);
|
|
39177
39722
|
const handlePageChange = (page) => {
|
|
39178
39723
|
onPageChange(page);
|
|
39179
39724
|
window.location.hash = page;
|
|
39180
39725
|
};
|
|
39726
|
+
const handleDeleteRequest = (requestId) => {
|
|
39727
|
+
if (confirm("Are you sure you want to delete this saved request?")) {
|
|
39728
|
+
RequestStorage.removeRequest(requestId);
|
|
39729
|
+
setSavedRequests((prev) => prev.filter((req) => req.id !== requestId));
|
|
39730
|
+
}
|
|
39731
|
+
};
|
|
39732
|
+
const handleLoadRequest = (request) => {
|
|
39733
|
+
if (onLoadRequest) {
|
|
39734
|
+
onLoadRequest(request);
|
|
39735
|
+
handlePageChange("tools");
|
|
39736
|
+
}
|
|
39737
|
+
};
|
|
39738
|
+
const handleRenameRequest = (requestId, currentName) => {
|
|
39739
|
+
setRenamingRequestId(requestId);
|
|
39740
|
+
setRenameValue(currentName);
|
|
39741
|
+
};
|
|
39742
|
+
const handleSaveRename = (requestId) => {
|
|
39743
|
+
if (renameValue.trim()) {
|
|
39744
|
+
RequestStorage.updateRequest(requestId, { name: renameValue.trim() });
|
|
39745
|
+
setSavedRequests(
|
|
39746
|
+
(prev) => prev.map(
|
|
39747
|
+
(req) => req.id === requestId ? { ...req, name: renameValue.trim() } : req
|
|
39748
|
+
)
|
|
39749
|
+
);
|
|
39750
|
+
}
|
|
39751
|
+
setRenamingRequestId(null);
|
|
39752
|
+
setRenameValue("");
|
|
39753
|
+
};
|
|
39754
|
+
const handleCancelRename = () => {
|
|
39755
|
+
setRenamingRequestId(null);
|
|
39756
|
+
setRenameValue("");
|
|
39757
|
+
};
|
|
39758
|
+
const handleDuplicateRequest = (request) => {
|
|
39759
|
+
const duplicatedRequest = createMcpJamRequest({
|
|
39760
|
+
name: `${request.name} (Copy)`,
|
|
39761
|
+
description: request.description,
|
|
39762
|
+
toolName: request.toolName,
|
|
39763
|
+
tool: request.tool,
|
|
39764
|
+
parameters: request.parameters,
|
|
39765
|
+
tags: request.tags || [],
|
|
39766
|
+
isFavorite: false
|
|
39767
|
+
});
|
|
39768
|
+
RequestStorage.addRequest(duplicatedRequest);
|
|
39769
|
+
setSavedRequests((prev) => [duplicatedRequest, ...prev]);
|
|
39770
|
+
};
|
|
39771
|
+
const formatDate = (date) => {
|
|
39772
|
+
return new Intl.DateTimeFormat("en-US", {
|
|
39773
|
+
month: "short",
|
|
39774
|
+
day: "numeric",
|
|
39775
|
+
hour: "2-digit",
|
|
39776
|
+
minute: "2-digit"
|
|
39777
|
+
}).format(date);
|
|
39778
|
+
};
|
|
39181
39779
|
const getLogoSrc = () => {
|
|
39182
39780
|
if (theme === "dark") {
|
|
39183
39781
|
return "/mcp_jam_dark.png";
|
|
@@ -39188,19 +39786,154 @@ const Sidebar = ({
|
|
|
39188
39786
|
return isDarkMode ? "/mcp_jam_dark.png" : "/mcp_jam_light.png";
|
|
39189
39787
|
}
|
|
39190
39788
|
};
|
|
39789
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-80 bg-card border-r border-border flex flex-col h-full", children: [
|
|
39790
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center space-y-2", children: [
|
|
39791
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full flex justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39792
|
+
"img",
|
|
39793
|
+
{
|
|
39794
|
+
src: getLogoSrc(),
|
|
39795
|
+
alt: "MCP Jam",
|
|
39796
|
+
className: "h-6 w-auto object-contain transition-opacity duration-200",
|
|
39797
|
+
onError: (e) => {
|
|
39798
|
+
console.warn("Failed to load MCP Jam logo");
|
|
39799
|
+
e.currentTarget.style.display = "none";
|
|
39800
|
+
}
|
|
39801
|
+
}
|
|
39802
|
+
) }),
|
|
39803
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-muted-foreground opacity-70", children: [
|
|
39804
|
+
"v",
|
|
39805
|
+
version
|
|
39806
|
+
] }) })
|
|
39807
|
+
] }) }),
|
|
39808
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 overflow-hidden flex flex-col", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 flex flex-col min-h-0", children: [
|
|
39809
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-3 border-b border-border/50", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
39810
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Bookmark, { className: "w-4 h-4 text-muted-foreground" }),
|
|
39811
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-sm font-medium text-foreground", children: "Saved Requests" }),
|
|
39812
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs text-muted-foreground bg-muted px-1.5 py-0.5 rounded", children: savedRequests.length })
|
|
39813
|
+
] }) }),
|
|
39814
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 overflow-y-auto p-2", children: savedRequests.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center py-8", children: [
|
|
39815
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Bookmark, { className: "w-8 h-8 text-muted-foreground/50 mx-auto mb-2" }),
|
|
39816
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-muted-foreground", children: "No saved requests" }),
|
|
39817
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-muted-foreground/70 mt-1", children: "Save requests from the Tools tab" })
|
|
39818
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2", children: savedRequests.map((request) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
39819
|
+
"div",
|
|
39820
|
+
{
|
|
39821
|
+
className: "group bg-muted/30 hover:bg-muted/50 border border-border/30 rounded-lg p-2.5 transition-all duration-200 cursor-pointer",
|
|
39822
|
+
onClick: () => renamingRequestId !== request.id && handleLoadRequest(request),
|
|
39823
|
+
children: [
|
|
39824
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start justify-between mb-1.5", children: [
|
|
39825
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
39826
|
+
renamingRequestId === request.id ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39827
|
+
Input,
|
|
39828
|
+
{
|
|
39829
|
+
value: renameValue,
|
|
39830
|
+
onChange: (e) => setRenameValue(e.target.value),
|
|
39831
|
+
onKeyDown: (e) => {
|
|
39832
|
+
if (e.key === "Enter") {
|
|
39833
|
+
handleSaveRename(request.id);
|
|
39834
|
+
} else if (e.key === "Escape") {
|
|
39835
|
+
handleCancelRename();
|
|
39836
|
+
}
|
|
39837
|
+
},
|
|
39838
|
+
onBlur: () => handleSaveRename(request.id),
|
|
39839
|
+
className: "text-xs h-6 font-medium",
|
|
39840
|
+
autoFocus: true,
|
|
39841
|
+
onClick: (e) => e.stopPropagation()
|
|
39842
|
+
}
|
|
39843
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "text-xs font-medium text-foreground truncate", children: request.name }),
|
|
39844
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-muted-foreground font-mono", children: request.toolName })
|
|
39845
|
+
] }),
|
|
39846
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-1", children: [
|
|
39847
|
+
request.isFavorite && /* @__PURE__ */ jsxRuntimeExports.jsx(Star, { className: "w-3 h-3 text-yellow-500 fill-current" }),
|
|
39848
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39849
|
+
Button,
|
|
39850
|
+
{
|
|
39851
|
+
onClick: (e) => {
|
|
39852
|
+
e.stopPropagation();
|
|
39853
|
+
handleRenameRequest(request.id, request.name);
|
|
39854
|
+
},
|
|
39855
|
+
size: "sm",
|
|
39856
|
+
variant: "ghost",
|
|
39857
|
+
className: "h-6 w-6 p-0 hover:bg-primary/20 hover:text-primary opacity-0 group-hover:opacity-100 transition-opacity",
|
|
39858
|
+
title: "Rename request",
|
|
39859
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Pen, { className: "w-3 h-3" })
|
|
39860
|
+
}
|
|
39861
|
+
),
|
|
39862
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39863
|
+
Button,
|
|
39864
|
+
{
|
|
39865
|
+
onClick: (e) => {
|
|
39866
|
+
e.stopPropagation();
|
|
39867
|
+
handleDuplicateRequest(request);
|
|
39868
|
+
},
|
|
39869
|
+
size: "sm",
|
|
39870
|
+
variant: "ghost",
|
|
39871
|
+
className: "h-6 w-6 p-0 hover:bg-blue-500/20 hover:text-blue-500 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
39872
|
+
title: "Duplicate request",
|
|
39873
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "w-3 h-3" })
|
|
39874
|
+
}
|
|
39875
|
+
),
|
|
39876
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39877
|
+
Button,
|
|
39878
|
+
{
|
|
39879
|
+
onClick: (e) => {
|
|
39880
|
+
e.stopPropagation();
|
|
39881
|
+
handleDeleteRequest(request.id);
|
|
39882
|
+
},
|
|
39883
|
+
size: "sm",
|
|
39884
|
+
variant: "ghost",
|
|
39885
|
+
className: "h-6 w-6 p-0 hover:bg-destructive/20 hover:text-destructive opacity-0 group-hover:opacity-100 transition-opacity",
|
|
39886
|
+
title: "Delete request",
|
|
39887
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Trash2, { className: "w-3 h-3" })
|
|
39888
|
+
}
|
|
39889
|
+
)
|
|
39890
|
+
] })
|
|
39891
|
+
] }),
|
|
39892
|
+
request.description && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-muted-foreground/80 mb-1.5 line-clamp-2", children: request.description }),
|
|
39893
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between text-xs text-muted-foreground/70", children: [
|
|
39894
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-1", children: [
|
|
39895
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Calendar, { className: "w-3 h-3" }),
|
|
39896
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: formatDate(request.updatedAt) })
|
|
39897
|
+
] }),
|
|
39898
|
+
request.isFavorite && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-yellow-500", children: "★" })
|
|
39899
|
+
] })
|
|
39900
|
+
]
|
|
39901
|
+
},
|
|
39902
|
+
request.id
|
|
39903
|
+
)) }) })
|
|
39904
|
+
] }) }),
|
|
39905
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-t", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
39906
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-muted-foreground", children: "Theme" }),
|
|
39907
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
39908
|
+
Select,
|
|
39909
|
+
{
|
|
39910
|
+
value: theme,
|
|
39911
|
+
onValueChange: (value) => setTheme(value),
|
|
39912
|
+
children: [
|
|
39913
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { className: "w-[100px]", id: "theme-select", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, {}) }),
|
|
39914
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
|
|
39915
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "system", children: "System" }),
|
|
39916
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "light", children: "Light" }),
|
|
39917
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "dark", children: "Dark" })
|
|
39918
|
+
] })
|
|
39919
|
+
]
|
|
39920
|
+
}
|
|
39921
|
+
)
|
|
39922
|
+
] }) })
|
|
39923
|
+
] });
|
|
39924
|
+
};
|
|
39925
|
+
const Tabs = ({
|
|
39926
|
+
currentPage,
|
|
39927
|
+
onPageChange,
|
|
39928
|
+
serverCapabilities,
|
|
39929
|
+
pendingSampleRequests,
|
|
39930
|
+
shouldDisableAll
|
|
39931
|
+
}) => {
|
|
39932
|
+
const handlePageChange = (page) => {
|
|
39933
|
+
onPageChange(page);
|
|
39934
|
+
window.location.hash = page;
|
|
39935
|
+
};
|
|
39191
39936
|
const tabs = [
|
|
39192
|
-
{
|
|
39193
|
-
id: "resources",
|
|
39194
|
-
label: "Resources",
|
|
39195
|
-
icon: Files2,
|
|
39196
|
-
disabled: !(serverCapabilities == null ? void 0 : serverCapabilities.resources) || shouldDisableAll
|
|
39197
|
-
},
|
|
39198
|
-
{
|
|
39199
|
-
id: "prompts",
|
|
39200
|
-
label: "Prompts",
|
|
39201
|
-
icon: MessageSquare,
|
|
39202
|
-
disabled: !(serverCapabilities == null ? void 0 : serverCapabilities.prompts) || shouldDisableAll
|
|
39203
|
-
},
|
|
39204
39937
|
{
|
|
39205
39938
|
id: "tools",
|
|
39206
39939
|
label: "Tools",
|
|
@@ -39219,6 +39952,18 @@ const Sidebar = ({
|
|
|
39219
39952
|
icon: Bell,
|
|
39220
39953
|
disabled: shouldDisableAll
|
|
39221
39954
|
},
|
|
39955
|
+
{
|
|
39956
|
+
id: "resources",
|
|
39957
|
+
label: "Resources",
|
|
39958
|
+
icon: Files2,
|
|
39959
|
+
disabled: !(serverCapabilities == null ? void 0 : serverCapabilities.resources) || shouldDisableAll
|
|
39960
|
+
},
|
|
39961
|
+
{
|
|
39962
|
+
id: "prompts",
|
|
39963
|
+
label: "Prompts",
|
|
39964
|
+
icon: MessageSquare,
|
|
39965
|
+
disabled: !(serverCapabilities == null ? void 0 : serverCapabilities.prompts) || shouldDisableAll
|
|
39966
|
+
},
|
|
39222
39967
|
{
|
|
39223
39968
|
id: "sampling",
|
|
39224
39969
|
label: "Sampling",
|
|
@@ -39245,61 +39990,23 @@ const Sidebar = ({
|
|
|
39245
39990
|
disabled: shouldDisableAll
|
|
39246
39991
|
}
|
|
39247
39992
|
];
|
|
39248
|
-
return /* @__PURE__ */ jsxRuntimeExports.
|
|
39249
|
-
|
|
39250
|
-
|
|
39251
|
-
|
|
39252
|
-
|
|
39253
|
-
|
|
39254
|
-
|
|
39255
|
-
|
|
39256
|
-
|
|
39257
|
-
|
|
39258
|
-
|
|
39259
|
-
}
|
|
39260
|
-
|
|
39261
|
-
|
|
39262
|
-
|
|
39263
|
-
|
|
39264
|
-
|
|
39265
|
-
] }) })
|
|
39266
|
-
] }) }),
|
|
39267
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 flex-1 overflow-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2", children: tabs.map((tab) => {
|
|
39268
|
-
const IconComponent = tab.icon;
|
|
39269
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
39270
|
-
"button",
|
|
39271
|
-
{
|
|
39272
|
-
onClick: () => handlePageChange(tab.id),
|
|
39273
|
-
disabled: tab.disabled,
|
|
39274
|
-
className: `w-full flex items-center gap-3 px-3 py-2 rounded-lg transition-all duration-200 text-left relative ${currentPage === tab.id ? "bg-muted/100 text-foreground border border-border/50" : "hover:bg-muted/30 text-muted-foreground hover:text-foreground"} disabled:opacity-50 disabled:cursor-not-allowed`,
|
|
39275
|
-
children: [
|
|
39276
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(IconComponent, { className: "w-4 h-4 flex-shrink-0" }),
|
|
39277
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex-1", children: tab.label }),
|
|
39278
|
-
tab.badge && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "bg-red-500 text-white text-xs rounded-full h-5 w-5 flex items-center justify-center animate-pulse", children: tab.badge })
|
|
39279
|
-
]
|
|
39280
|
-
},
|
|
39281
|
-
tab.id
|
|
39282
|
-
);
|
|
39283
|
-
}) }) }),
|
|
39284
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-t", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
39285
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-muted-foreground", children: "Theme" }),
|
|
39286
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
39287
|
-
Select,
|
|
39288
|
-
{
|
|
39289
|
-
value: theme,
|
|
39290
|
-
onValueChange: (value) => setTheme(value),
|
|
39291
|
-
children: [
|
|
39292
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { className: "w-[100px]", id: "theme-select", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, {}) }),
|
|
39293
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
|
|
39294
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "system", children: "System" }),
|
|
39295
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "light", children: "Light" }),
|
|
39296
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "dark", children: "Dark" })
|
|
39297
|
-
] })
|
|
39298
|
-
]
|
|
39299
|
-
}
|
|
39300
|
-
)
|
|
39301
|
-
] }) })
|
|
39302
|
-
] });
|
|
39993
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-card border-b border-border flex flex-col w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-4 py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center space-x-1 overflow-x-auto", children: tabs.map((tab) => {
|
|
39994
|
+
const IconComponent = tab.icon;
|
|
39995
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
39996
|
+
"button",
|
|
39997
|
+
{
|
|
39998
|
+
onClick: () => handlePageChange(tab.id),
|
|
39999
|
+
disabled: tab.disabled,
|
|
40000
|
+
className: `flex items-center gap-2 px-3 py-2 rounded-lg transition-all duration-200 whitespace-nowrap relative min-w-fit ${currentPage === tab.id ? "bg-muted/100 text-foreground border border-border/50" : "hover:bg-muted/30 text-muted-foreground hover:text-foreground"} disabled:opacity-50 disabled:cursor-not-allowed`,
|
|
40001
|
+
children: [
|
|
40002
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(IconComponent, { className: "w-4 h-4 flex-shrink-0" }),
|
|
40003
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm", children: tab.label }),
|
|
40004
|
+
tab.badge && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "bg-red-500 text-white text-xs rounded-full h-5 w-5 flex items-center justify-center animate-pulse ml-1", children: tab.badge })
|
|
40005
|
+
]
|
|
40006
|
+
},
|
|
40007
|
+
tab.id
|
|
40008
|
+
);
|
|
40009
|
+
}) }) }) });
|
|
39303
40010
|
};
|
|
39304
40011
|
const STORAGE_KEY = "claude-api-key";
|
|
39305
40012
|
const SettingsTab = ({
|
|
@@ -39916,7 +40623,7 @@ const ConnectionSection = ({
|
|
|
39916
40623
|
onConnect,
|
|
39917
40624
|
onDisconnect,
|
|
39918
40625
|
stdErrNotifications,
|
|
39919
|
-
clearStdErrNotifications
|
|
40626
|
+
clearStdErrNotifications,
|
|
39920
40627
|
logLevel,
|
|
39921
40628
|
sendLogLevelRequest: sendLogLevelRequest2,
|
|
39922
40629
|
loggingSupported,
|
|
@@ -40443,7 +41150,7 @@ const ConnectionSection = ({
|
|
|
40443
41150
|
{
|
|
40444
41151
|
variant: "outline",
|
|
40445
41152
|
size: "sm",
|
|
40446
|
-
onClick:
|
|
41153
|
+
onClick: clearStdErrNotifications,
|
|
40447
41154
|
className: "h-6 px-2 text-xs",
|
|
40448
41155
|
children: "Clear"
|
|
40449
41156
|
}
|
|
@@ -40652,9 +41359,6 @@ const sendLogLevelRequest = async (level, dependencies2) => {
|
|
|
40652
41359
|
);
|
|
40653
41360
|
dependencies2.setLogLevel(level);
|
|
40654
41361
|
};
|
|
40655
|
-
const clearStdErrNotifications = (setStdErrNotifications) => {
|
|
40656
|
-
setStdErrNotifications([]);
|
|
40657
|
-
};
|
|
40658
41362
|
const CONFIG_LOCAL_STORAGE_KEY = "inspectorConfig_v1";
|
|
40659
41363
|
const CLAUDE_API_KEY_STORAGE_KEY = "claude-api-key";
|
|
40660
41364
|
const validateClaudeApiKey = (key) => {
|
|
@@ -40716,6 +41420,9 @@ const App = () => {
|
|
|
40716
41420
|
const [resourceSubscriptions, setResourceSubscriptions] = reactExports.useState(/* @__PURE__ */ new Set());
|
|
40717
41421
|
const [selectedPrompt, setSelectedPrompt] = reactExports.useState(null);
|
|
40718
41422
|
const [selectedTool, setSelectedTool] = reactExports.useState(null);
|
|
41423
|
+
const [loadedRequest, setLoadedRequest] = reactExports.useState(
|
|
41424
|
+
null
|
|
41425
|
+
);
|
|
40719
41426
|
const [nextResourceCursor, setNextResourceCursor] = reactExports.useState();
|
|
40720
41427
|
const [nextResourceTemplateCursor, setNextResourceTemplateCursor] = reactExports.useState();
|
|
40721
41428
|
const [nextPromptCursor, setNextPromptCursor] = reactExports.useState();
|
|
@@ -40734,7 +41441,7 @@ const App = () => {
|
|
|
40734
41441
|
});
|
|
40735
41442
|
const [currentPage, setCurrentPage] = reactExports.useState(() => {
|
|
40736
41443
|
const hash = window.location.hash.slice(1);
|
|
40737
|
-
return hash || "
|
|
41444
|
+
return hash || "tools";
|
|
40738
41445
|
});
|
|
40739
41446
|
console.log(currentPage);
|
|
40740
41447
|
const {
|
|
@@ -40868,7 +41575,7 @@ const App = () => {
|
|
|
40868
41575
|
}, [roots]);
|
|
40869
41576
|
reactExports.useEffect(() => {
|
|
40870
41577
|
if (!window.location.hash) {
|
|
40871
|
-
window.location.hash = "
|
|
41578
|
+
window.location.hash = "tools";
|
|
40872
41579
|
}
|
|
40873
41580
|
}, []);
|
|
40874
41581
|
reactExports.useEffect(() => {
|
|
@@ -40957,11 +41664,15 @@ const App = () => {
|
|
|
40957
41664
|
return sendLogLevelRequest(level, helperDependencies);
|
|
40958
41665
|
};
|
|
40959
41666
|
const clearStdErrNotificationsWrapper = () => {
|
|
40960
|
-
|
|
41667
|
+
setStdErrNotifications([]);
|
|
41668
|
+
};
|
|
41669
|
+
const handleLoadRequest = (request) => {
|
|
41670
|
+
setLoadedRequest(request);
|
|
41671
|
+
setTimeout(() => setLoadedRequest(null), 100);
|
|
40961
41672
|
};
|
|
40962
41673
|
if (window.location.pathname === "/oauth/callback") {
|
|
40963
41674
|
const OAuthCallback = React.lazy(
|
|
40964
|
-
() => __vitePreload(() => import("./OAuthCallback-
|
|
41675
|
+
() => __vitePreload(() => import("./OAuthCallback-CBw5QXWv.js"), true ? __vite__mapDeps([0,1]) : void 0)
|
|
40965
41676
|
);
|
|
40966
41677
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 dark:from-slate-900 dark:to-slate-800 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
40967
41678
|
reactExports.Suspense,
|
|
@@ -40976,7 +41687,7 @@ const App = () => {
|
|
|
40976
41687
|
}
|
|
40977
41688
|
if (window.location.pathname === "/oauth/callback/debug") {
|
|
40978
41689
|
const OAuthDebugCallback = React.lazy(
|
|
40979
|
-
() => __vitePreload(() => import("./OAuthDebugCallback-
|
|
41690
|
+
() => __vitePreload(() => import("./OAuthDebugCallback-wx6FGFG4.js"), true ? __vite__mapDeps([2,1]) : void 0)
|
|
40980
41691
|
);
|
|
40981
41692
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 dark:from-slate-900 dark:to-slate-800 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
40982
41693
|
reactExports.Suspense,
|
|
@@ -41131,7 +41842,8 @@ const App = () => {
|
|
|
41131
41842
|
toolResult,
|
|
41132
41843
|
nextCursor: nextToolCursor,
|
|
41133
41844
|
error: errors.tools,
|
|
41134
|
-
connectionStatus
|
|
41845
|
+
connectionStatus,
|
|
41846
|
+
loadedRequest
|
|
41135
41847
|
}
|
|
41136
41848
|
);
|
|
41137
41849
|
case "chat":
|
|
@@ -41202,7 +41914,8 @@ const App = () => {
|
|
|
41202
41914
|
onPageChange: setCurrentPage,
|
|
41203
41915
|
serverCapabilities,
|
|
41204
41916
|
pendingSampleRequests,
|
|
41205
|
-
shouldDisableAll: !mcpClient
|
|
41917
|
+
shouldDisableAll: !mcpClient,
|
|
41918
|
+
onLoadRequest: handleLoadRequest
|
|
41206
41919
|
}
|
|
41207
41920
|
),
|
|
41208
41921
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 flex flex-col overflow-hidden", children: [
|
|
@@ -41235,6 +41948,16 @@ const App = () => {
|
|
|
41235
41948
|
clearStdErrNotifications: clearStdErrNotificationsWrapper
|
|
41236
41949
|
}
|
|
41237
41950
|
) }),
|
|
41951
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
41952
|
+
Tabs,
|
|
41953
|
+
{
|
|
41954
|
+
currentPage,
|
|
41955
|
+
onPageChange: setCurrentPage,
|
|
41956
|
+
serverCapabilities,
|
|
41957
|
+
pendingSampleRequests,
|
|
41958
|
+
shouldDisableAll: !mcpClient
|
|
41959
|
+
}
|
|
41960
|
+
),
|
|
41238
41961
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 flex flex-col overflow-hidden overflow-y-auto", children: renderTabs() }),
|
|
41239
41962
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
41240
41963
|
HistoryAndNotifications,
|